Merge from emacs--rel--22
authorMiles Bader <miles@gnu.org>
Mon, 13 Aug 2007 13:41:28 +0000 (13:41 +0000)
committerMiles Bader <miles@gnu.org>
Mon, 13 Aug 2007 13:41:28 +0000 (13:41 +0000)
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-851

319 files changed:
ChangeLog
MAINTAINERS
Makefile.in
admin/ChangeLog
admin/FOR-RELEASE
admin/admin.el
admin/make-tarball.txt
admin/notes/copyright
configure
configure.in
etc/ChangeLog
etc/DEBUG
etc/MORE.STUFF
etc/NEWS
etc/NEWS.22 [copied from etc/NEWS with 99% similarity]
etc/TODO
etc/compilation.txt
etc/fr-refcard.ps
etc/orgcard.tex
leim/ChangeLog
lib-src/ChangeLog
lib-src/etags.c
lisp/ChangeLog
lisp/ChangeLog.12 [copied from lisp/ChangeLog with 96% similarity]
lisp/Makefile.in
lisp/add-log.el
lisp/autoinsert.el
lisp/autorevert.el
lisp/bindings.el
lisp/bookmark.el
lisp/calc/calc-aent.el
lisp/calc/calc-bin.el
lisp/calc/calc-comb.el
lisp/calc/calc-embed.el
lisp/calc/calc-ext.el
lisp/calc/calc-forms.el
lisp/calc/calc-funcs.el
lisp/calc/calc-graph.el
lisp/calc/calc-help.el
lisp/calc/calc-lang.el
lisp/calc/calc-math.el
lisp/calc/calc-misc.el
lisp/calc/calc-nlfit.el [new file with mode: 0644]
lisp/calc/calc-poly.el
lisp/calc/calc-prog.el
lisp/calc/calc-units.el
lisp/calc/calc-yank.el
lisp/calc/calc.el
lisp/calc/calcalg3.el
lisp/calc/calccomp.el
lisp/calculator.el
lisp/calendar/appt.el
lisp/calendar/cal-bahai.el
lisp/calendar/cal-hebrew.el
lisp/calendar/cal-islam.el
lisp/calendar/cal-menu.el
lisp/calendar/cal-move.el
lisp/calendar/cal-tex.el
lisp/calendar/cal-x.el
lisp/calendar/calendar.el
lisp/calendar/diary-lib.el
lisp/cmuscheme.el
lisp/comint.el
lisp/complete.el
lisp/completion.el
lisp/composite.el
lisp/cus-dep.el
lisp/cus-edit.el
lisp/cus-start.el
lisp/custom.el
lisp/dabbrev.el
lisp/delsel.el
lisp/desktop.el
lisp/dframe.el
lisp/diff-mode.el
lisp/diff.el
lisp/dired-aux.el
lisp/dired.el
lisp/disp-table.el
lisp/ediff-init.el
lisp/ediff-mult.el
lisp/ediff-ptch.el
lisp/ediff-util.el
lisp/ediff.el
lisp/edmacro.el
lisp/emacs-lisp/advice.el
lisp/emacs-lisp/autoload.el
lisp/emacs-lisp/bytecomp.el
lisp/emacs-lisp/cl-extra.el
lisp/emacs-lisp/cl-loaddefs.el
lisp/emacs-lisp/cl-macs.el
lisp/emacs-lisp/cl-seq.el
lisp/emacs-lisp/cl.el
lisp/emacs-lisp/copyright.el
lisp/emacs-lisp/derived.el
lisp/emacs-lisp/easymenu.el
lisp/emacs-lisp/edebug.el
lisp/emacs-lisp/eldoc.el
lisp/emacs-lisp/lisp-mode.el
lisp/emacs-lisp/pp.el
lisp/emacs-lisp/rx.el
lisp/emulation/cua-base.el
lisp/emulation/tpu-edt.el
lisp/emulation/tpu-mapper.el
lisp/emulation/viper-cmd.el
lisp/emulation/viper-init.el
lisp/emulation/viper-keym.el
lisp/emulation/viper-util.el
lisp/emulation/viper.el
lisp/erc/ChangeLog
lisp/erc/erc-goodies.el
lisp/faces.el
lisp/ffap.el
lisp/files.el
lisp/filesets.el
lisp/follow.el
lisp/font-lock.el
lisp/format.el
lisp/frame.el
lisp/gnus/ChangeLog
lisp/gnus/gnus-art.el
lisp/gnus/gnus-ems.el
lisp/gnus/nntp.el
lisp/help-fns.el
lisp/help-mode.el
lisp/image-dired.el
lisp/image-mode.el
lisp/image.el
lisp/indent.el
lisp/info.el
lisp/international/quail.el
lisp/international/utf-8.el
lisp/isearch.el
lisp/kmacro.el
lisp/log-edit.el
lisp/log-view.el
lisp/mail/mail-extr.el
lisp/mb-depth.el [new file with mode: 0644]
lisp/menu-bar.el
lisp/mh-e/ChangeLog
lisp/mh-e/mh-compat.el
lisp/mouse.el
lisp/net/ange-ftp.el
lisp/net/rcirc.el
lisp/net/rcompile.el
lisp/net/tramp-cache.el [new file with mode: 0644]
lisp/net/tramp-fish.el [new file with mode: 0644]
lisp/net/tramp-ftp.el
lisp/net/tramp-gw.el [new file with mode: 0644]
lisp/net/tramp-smb.el
lisp/net/tramp-util.el [deleted file]
lisp/net/tramp-uu.el
lisp/net/tramp-vc.el [deleted file]
lisp/net/tramp.el
lisp/net/trampver.el
lisp/net/webjump.el
lisp/newcomment.el
lisp/novice.el
lisp/pcomplete.el
lisp/pcvs.el
lisp/play/gamegrid.el
lisp/printing.el
lisp/progmodes/compile.el
lisp/progmodes/ebnf-abn.el
lisp/progmodes/ebnf-bnf.el
lisp/progmodes/ebnf-dtd.el
lisp/progmodes/ebnf-ebx.el
lisp/progmodes/ebnf-iso.el
lisp/progmodes/ebnf-yac.el
lisp/progmodes/ebnf2ps.el
lisp/progmodes/flymake.el
lisp/progmodes/fortran.el
lisp/progmodes/gdb-ui.el
lisp/progmodes/grep.el
lisp/progmodes/gud.el
lisp/progmodes/hideshow.el
lisp/progmodes/python.el
lisp/progmodes/sh-script.el
lisp/progmodes/vera-mode.el
lisp/progmodes/which-func.el
lisp/ps-mule.el
lisp/ps-print.el
lisp/recentf.el
lisp/replace.el
lisp/savehist.el
lisp/server.el
lisp/shell.el
lisp/simple.el
lisp/startup.el
lisp/subr.el
lisp/t-mouse.el
lisp/tar-mode.el
lisp/term.el
lisp/term/linux.el
lisp/term/mac-win.el
lisp/term/x-win.el
lisp/term/xterm.el
lisp/textmodes/bibtex.el
lisp/textmodes/css-mode.el
lisp/textmodes/nroff-mode.el
lisp/textmodes/org-publish.el [new file with mode: 0644]
lisp/textmodes/org.el
lisp/textmodes/sgml-mode.el
lisp/textmodes/tex-mode.el
lisp/textmodes/texinfmt.el
lisp/thingatpt.el
lisp/thumbs.el
lisp/tutorial.el
lisp/uniquify.el
lisp/url/ChangeLog
lisp/url/url-cookie.el
lisp/url/url.el
lisp/vc-arch.el
lisp/vc-bzr.el
lisp/vc-cvs.el
lisp/vc-git.el
lisp/vc-hg.el
lisp/vc-hooks.el
lisp/vc-mcvs.el
lisp/vc-rcs.el
lisp/vc-sccs.el
lisp/vc-svn.el
lisp/vc.el
lisp/version.el
lisp/wdired.el
lisp/wid-edit.el
lisp/window.el
lisp/x-dnd.el
lisp/xt-mouse.el
lispintro/ChangeLog
lispintro/emacs-lisp-intro.texi
lispref/ChangeLog
lispref/commands.texi
lispref/control.texi
lispref/display.texi
lispref/elisp.texi
lispref/files.texi
lispref/hooks.texi
lispref/keymaps.texi
lispref/nonascii.texi
lispref/os.texi
lispref/processes.texi
lispref/searching.texi
lispref/text.texi
lwlib/ChangeLog
lwlib/lwlib-Xaw.c
lwlib/lwlib.c
mac/ChangeLog
man/ChangeLog
man/building.texi
man/calc.texi
man/dired.texi
man/emacs.texi
man/files.texi
man/gnus.texi
man/info.texi
man/org.texi
man/screen.texi
man/texinfo.tex
man/tramp.texi
man/trampver.texi
man/vc2-xtra.texi
mkinstalldirs
nt/ChangeLog
nt/configure.bat
nt/inc/sys/socket.h
src/ChangeLog
src/Makefile.in
src/abbrev.c
src/alloc.c
src/buffer.c
src/callint.c
src/casetab.c
src/coding.c
src/config.in
src/data.c
src/doc.c
src/editfns.c
src/emacs.c
src/eval.c
src/fileio.c
src/fns.c
src/fontset.c
src/frame.c
src/frame.h
src/insdel.c
src/keyboard.c
src/keymap.c
src/keymap.h
src/lisp.h
src/lread.c
src/m/alpha.h
src/mac.c
src/macfns.c
src/macgui.h
src/macmenu.c
src/macselect.c
src/macterm.c
src/macterm.h
src/minibuf.c
src/process.c
src/process.h
src/puresize.h
src/regex.c
src/search.c
src/sunfns.c
src/sysdep.c
src/term.c
src/termhooks.h
src/w32.c
src/w32term.c
src/w32term.h
src/xdisp.c
src/xfaces.c
src/xfns.c
src/xmenu.c
src/xselect.c
src/xterm.c
src/xterm.h

index 306a37f..f6a4b9e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,14 +9,93 @@
 
        * COPYING, info/COPYING: Switch to GPLv3.
 
+2007-06-20  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * configure.in: Complain if X seems to be installed but no
+       development files were found.
+
+2007-06-20  Glenn Morris  <rgm@gnu.org>
+
+       * configure.in: Prefer libgif over libungif.
+
+2007-06-14  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * configure.in: Check for all image libraries before exiting.
+
+2007-06-13  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * configure.in: Exit with error if image libraries aren't found.
+
+2007-06-13  Chong Yidong  <cyd@stupidchicken.com>
+
+       * configure.in: Merge xaw3d and libXaw checks.  Check xaw3d even
+       when compiling without scrollbars.
+
+2007-06-12  Glenn Morris  <rgm@gnu.org>
+
+       * configure.in (HAVE_GIF): If -lungif fails, try -lgif.
+
+2007-06-11  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * configure.in: Change wording about yes/gtk and lucid/athena being
+       synonyms.
+
+2007-06-08  Glenn Morris  <rgm@gnu.org>
+
+       * configure.in: Make gtk the default toolkit.
+
+2007-06-07  Glenn Morris  <rgm@gnu.org>
+
+       * configure.in (NON_GNU_CPP): On Solaris, set using a proper check
+       for a Sun C compiler.
+
+       * Makefile.in (install-arch-indep): Install only the DOC- file
+       specific to the build, if possible, rather than DOC-*.
+
 2007-06-02  Chong Yidong  <cyd@stupidchicken.com>
 
        * Version 22.1 released.
 
+2007-05-25  Chong Yidong  <cyd@stupidchicken.com>
+
+       * mkinstalldirs: Sync to version in automake CVS.
+
+2007-05-22  Andreas Schwab  <schwab@suse.de>
+
+       * configure.in: Prefer build_alias over host when host_alias is
+       not set.
+       * configure: Regenerate.
+
+2007-05-20  Andreas Schwab  <schwab@suse.de>
+
+       * configure.in: Remove empty AC_SUBST.
+       * configure: Regenerate.
+
+2007-05-20  Nick Roberts  <nickrob@snap.net.nz>
+
+       * configure.in: Use HAVE_GPM instead of HAVE_GPM_H and implement
+       it like others.
+       * configure: Regenerate.
+
+2007-05-20  Nick Roberts  <nickrob@snap.net.nz>
+
+       * configure.in (AC_CHECK_HEADERS) Add gpm.h.
+       (AC_CHECK_LIB): Add -lgpm.
+       * configure: Regenerate.
+
 2007-05-03  Glenn Morris  <rgm@gnu.org>
 
        * configure: Tweak message about the absence of shell functions.
 
+2007-04-27  Andreas Schwab  <schwab@suse.de>
+
+       * Makefile.in (config.status): Depend on
+       ${srcdir}/lisp/version.el.
+
+2007-04-26  Glenn Morris  <rgm@gnu.org>
+
+       * README: Increase version to 22.1.50.
+
 2007-04-24  Juanma Barranquero  <lekktu@gmail.com>
 
        * INSTALL (DETAILED BUILDING AND INSTALLATION): Fix typo.
index 92c2ff7..5d55ab8 100644 (file)
@@ -112,6 +112,12 @@ Miles Bader
 Thien-Thi Nguyen
        VMS
 
+Juanma Barranquero
+       lisp/bs.el
+       lisp/server.el
+       lib-src/emacsclient.c
+       lib-src/grep-changelog
+
 ==============================================================================
 3.
 ==============================================================================
@@ -149,13 +155,16 @@ src/filelock.c
 src/filemode.c
 src/firstfile.c
 src/floatfns.c
+src/fringe.c
 src/fns.c
 src/fontset.c
 src/getloadavg.c
 src/gmalloc.c
+src/gtkutil.c
 src/hftctl.c
 src/indent.c
 src/insdel.c
+src/image.c
 src/lastfile.c
 src/lread.c
 src/m/
index 502e653..ec93805 100644 (file)
@@ -311,7 +311,7 @@ blessmail: ${SUBDIR_MAKEFILES} src FRC
 Makefile: $(srcdir)/Makefile.in config.status
        ./config.status
 
-config.status: ${srcdir}/configure
+config.status: ${srcdir}/configure ${srcdir}/lisp/version.el
        ./config.status --recheck
 
 AUTOCONF_INPUTS = @MAINT@ $(srcdir)/configure.in $(srcdir)/m4/getopt.m4
@@ -409,10 +409,8 @@ install-arch-dep: mkdir
 ## Note that we copy DOC* and then delete DOC
 ## as a workaround for a bug in tar on Ultrix 4.2.
 
-## FIXME
-## Should only install the DOC- file appropriate to this build, not DOC-*.
-## http://lists.gnu.org/archive/html/emacs-pretest-bug/2007-01/msg00417.html
-## (fix available for consideration post-release).
+## We install only the relevant DOC file if possible
+## (ie DOC-${version}.buildnumber), otherwise DOC-${version}*.
 
 ## If people complain about the h flag in tar command, take that out.
 ## That flag is also used in leim/Makefile.in
@@ -474,8 +472,15 @@ install-arch-indep: mkdir info
        -unset CDPATH; \
        if [ `(cd ./etc; /bin/pwd)` != `(cd $(DESTDIR)${docdir}; /bin/pwd)` ]; \
        then \
-          echo "Copying etc/DOC-* to $(DESTDIR)${docdir} ..." ; \
-          (cd ./etc; tar -chf - DOC*) \
+          fullversion=`./src/emacs --version | sed -n '1 s/GNU Emacs *//p'`; \
+          if [ -f "./etc/DOC-$${fullversion}" ]; \
+          then \
+            docfile="DOC-$${fullversion}"; \
+          else \
+            docfile="DOC-${version}*"; \
+          fi; \
+          echo "Copying etc/$${docfile} to $(DESTDIR)${docdir} ..." ; \
+          (cd ./etc; tar -chf - $${docfile}) \
             |(cd $(DESTDIR)${docdir}; umask 022; tar -xvf - && cat > /dev/null) || exit 1; \
           (cd $(DESTDIR)$(docdir); chown $${LOGNAME:-$$USERNAME} DOC*; chmod a+r DOC*; \
            if test "`echo DOC-*`" != "DOC-*"; then rm -f DOC; fi); \
index c957ac4..3cb9827 100644 (file)
@@ -1,7 +1,19 @@
+2007-08-10  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * FOR-RELEASE (http): Add Gtk+ tool bar and GUD focus problem.
+
 2007-07-25  Glenn Morris  <rgm@gnu.org>
 
        * Relicense all FSF files to GPLv3 or later.
 
+2007-06-07  Glenn Morris  <rgm@gnu.org>
+
+       * admin.el (set-copyright): New function.
+
+2007-04-25  Nick Roberts  <nickrob@snap.net.nz>
+
+       * make-tarball.txt: Add note about cutting the branch.
+
 2007-06-02  Chong Yidong  <cyd@stupidchicken.com>
 
        * Version 22.1 released.
@@ -11,7 +23,7 @@
        * nt/makedist.bat: Change EOL format to DOS.  Don't use
        redirection characters in REM lines.
 
-2007-01-27  Jan Dj\e,Ad\e(Brv  <jhd@winter.localdomain>
+2007-01-27  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
 
        * FOR-RELEASE: Removed Gtk/Xft issue.
 
index a0b54c2..6ddf0bb 100644 (file)
@@ -22,6 +22,10 @@ sk   Miroslav VaÅ¡ko        No response
 
 Reminders sent out on 2006-06-08.
 
+** Remove temporary +++/--- lines in NEWS.
+
+** Try to reorder NEWS: most important things first, related items together.
+
 * WINDOWS SUPPORT BUGS.
 
 These don't need to be fixed before a release, but we call the
@@ -36,6 +40,14 @@ to the hack introduced on 2005-07-01 to fix some other Cleartype problem.
 
 * BUGS
 
+NB the definitive copy of this file for Emacs 22 is on the
+EMACS_22_BASE branch.  Any entries below are automatically copied from
+that branch.  Do not make manual changes to this file on the trunk.
+
+** michael.ewe@arcor.de, Apr 24: 22.0.98  not starting on Solaris 10/I386
+http://lists.gnu.org/archive/html/emacs-devel/2007-04/msg01113.html
+
+** davby@ida.liu.se, 6 July: Bug in pos-visible-in-window-p
 ** dak@gnu.org, 30 May: Redraw problem with overlapping frames
 
 ** bojohan+news@dd.chalmers.se, 1 Aug: n_schumacher@web.de: modification hooks called only once in
@@ -46,11 +58,21 @@ to the hack introduced on 2005-07-01 to fix some other Cleartype problem.
 
 ** andreas.roehler@online.de, 24 Jul: CVS build on Suse 10.0 failed
 
+** Gtk+ tool bar looses focus when pressing next tool bar button in GUD.
+http://lists.gnu.org/archive/html/emacs-pretest-bug/2007-08/msg00008.html
+
 * FIXES FOR EMACS 22.2
 
 Here we list small fixes that arrived too late for Emacs 22.2, but
 that should be installed on the release branch after 22.2 is released.
 
+** Changes to six pbm icons in etc/images.
+Sync change from trunk 2007-05-19.
+
+** viper should not load cl at run time.
+
+** yamaoka@jpl.org's patch for mail-extract-address-components problem.
+
 * DOCUMENTATION
 
 ** Check the Emacs Tutorial.
index 67b0c16..94e64a2 100644 (file)
@@ -24,6 +24,8 @@
 
 ;; add-release-logs    Add ``Version X released'' change log entries.
 ;; set-version         Change Emacs version number in source tree.
+;; set-copyright        Change emacs short copyright string (eg as
+;;                      printed by --version) in source tree.
 
 ;;; Code:
 
@@ -158,5 +160,50 @@ Root must be the root of an Emacs source tree."
        (rx (and (submatch (1+ (in "a-z"))) (0+ space) ?\, (0+ space)
                "/* development, alpha, beta, or final (release) */"))))))
 
+;; Note this makes some assumptions about form of short copyright.
+(defun set-copyright (root copyright)
+  "Set Emacs short copyright to COPYRIGHT in relevant files under ROOT.
+Root must be the root of an Emacs source tree."
+  (interactive (list
+                (read-directory-name "Emacs root directory: " nil nil t)
+                (read-string
+                 "Short copyright string: "
+                 (format "Copyright (C) %s Free Software Foundation, Inc."
+                         (format-time-string "%Y")))))
+  (unless (file-exists-p (expand-file-name "src/emacs.c" root))
+    (error "%s doesn't seem to be the root of an Emacs source tree" root))
+  (set-version-in-file root "lisp/version.el" copyright
+                      (rx (and "emacs-copyright" (0+ space)
+                               ?\" (submatch (1+ (not (in ?\")))) ?\")))
+  (set-version-in-file root "lib-src/etags.c" copyright
+                       (rx (and "emacs_copyright" (0+ (not (in ?\")))
+                               ?\" (submatch (1+ (not (in ?\")))) ?\")))
+  (set-version-in-file root "lib-src/rcs2log" copyright
+                      (rx (and "Copyright" (0+ space) ?= (0+ space)
+                               ?\' (submatch (1+ nonl)))))
+  (set-version-in-file
+   root "mac/Emacs.app/Contents/Resources/English.lproj/InfoPlist.strings"
+   copyright (rx (and "CFBundleGetInfoString" (0+ space) ?= (0+ space) ?\"
+                      (1+ anything)
+                      (submatch "Copyright" (1+ (not (in ?\")))))))
+  ;; This one is a nuisance, as it needs to be split over two lines.
+  (string-match "\\(.*[0-9]\\{4\\} *\\)\\(.*\\)" copyright)
+  (let ((csign "\\0xa9")
+        (cyear (match-string 1 copyright))  ; "Copyright (C) 2007 "
+        (owner (match-string 2 copyright))) ; "Free Software Foundation, Inc."
+    (set-version-in-file root "mac/src/Emacs.r"
+                         (regexp-quote
+                          (replace-regexp-in-string "(C)"
+                                                    (regexp-quote csign) cyear))
+                         (rx (and
+                              (submatch "Copyright" (0+ space) (eval csign)
+                                        (0+ space) (= 4 num)
+                                        (0+ (not (in ?\")))) ?\")))
+    (set-version-in-file root "mac/src/Emacs.r" owner
+                         (rx (and ?\"
+                              (submatch (1+ (not (in ?\"))))
+                              ?\" (0+ space)
+                              "/* Long version number */")))))
+
 ;;; arch-tag: 4ea83636-2293-408b-884e-ad64f22a3bf5
 ;; admin.el ends here.
index e56c265..2c6ccf9 100644 (file)
@@ -76,7 +76,22 @@ For each step, check for possible errors.
 14. For a pretest, let Richard Stallman <rms@gnu.org> know about the new pretest and
     tell him to announce it using the announcement you prepared.  Remind
     him to set a Reply-to header to <emacs-pretest-bug@gnu.org>.
-    For a release, Richard should prepare the announcement himself,
+
+15. Shortly before the release, cut the branch with the following commands:
+
+    cvs rtag EMACS_`NUMBER'_BASE
+    cvs rtag -b EMACS_`NUMBER'_RC -r EMACS_`NUMBER'_BASE
+
+where `NUMBER' is the major version number of the release.  This makes it
+easier to  see what changes have been applied to the branch with:
+
+    cvs diff -r EMACS_`NUMBER'_BASE -r EMACS_`NUMBER'_RC
+
+or merge changes back to the trunk with "cvs update -j", if necessary.
+
+After doing this, increase the version number on the trunk as per step 4.
+
+16. For a release, Richard should prepare the announcement himself,
     possibly starting from a previous announcment.
 
 # arch-tag: c23c771f-ca26-4584-8a04-50ecf0989390
index 30abdd0..4ab01fe 100644 (file)
@@ -131,7 +131,7 @@ mac/Emacs.app/Contents/Resources/English.lproj/InfoPlist.strings
 mac/src/Emacs.r           # resource 'vers'
 src/emacs.c
   - remember to change the latest copyright year in the --version output.
-  [Post-release, will automate this like set-version does for version.]
+   `set-copyright' in admin.el will do all the above.
 
 <top-level>/install-sh
 lispintro/install-sh
@@ -598,6 +598,70 @@ Done: TUTORIAL.eo
 None known.
 
 
+** NOTES ON RELICENSING TO GPL3
+
+The EMACS_22_BASE branch was changed to GPLv3 (or later) 2007/07/25.
+
+Some notes:
+(see http://lists.gnu.org/archive/html/emacs-devel/2007-07/msg01431.html)
+
+1. There are some files in Emacs CVS which are not part of Emacs (eg
+those included from Gnulib). These are all copyright FSF and (at time
+of writing) GPL >= 2. rms says may as well leave the licenses of these
+alone (may import them from Gnulib again). These are:
+
+    Gnulib:
+    src/getloadavg.c
+    src/gmalloc.c
+    src/md5.c
+    src/md5.h
+    src/mktime.c
+    src/strftime.c
+    src/termcap.c
+    src/tparam.c
+
+    Others:
+    config.guess
+    config.sub
+    lispintro/missing
+    man/texinfo.tex
+
+Note _not_ included in the above are src/regex.{c,h} (rms: "That
+forked version is only in Emacs, so definitely relicense that."), and
+oldXMenu/insque.c (rms: "We wrote that specifically for Emacs, so
+definitely relicense that.").
+
+2. The files that are copyright FSF and AIST, or AIST alone, should be
+and were updated, ditto the oldXMenu files with FSF copyright, and
+msdos/is_exec.c and sigaction.c.
+
+3. lwlib/
+
+Files originally in Lucid Widget Library were left alone (excludes
+ChangeLog, etc), ie remain under GPL v1 or later, or v2 or later.
+(rms: "We may as well leave this alone, since we are never going to
+change it much.")
+
+4. There are some files where the FSF holds no copyright. These were
+left alone:
+
+   leim/MISC-DIC/CTLau-b5.html  >= v2
+   leim/MISC-DIC/CTLau.html     >= v2
+     (above included in lisp/international/titdic-cnv.el)
+   leim/MISC-DIC/pinyin.map     >= v1
+   leim/MISC-DIC/ziranma.cin    >= v1
+   leim/SKK-DIC/SKK-JISYO.L     >= v2
+   leim/SKK-DIC/README          >= v2
+   leim/ja-dic/ja-dic.el        >= v2
+
+5. At time of writing, some non-Emacs icons included from Gnome remain
+under GPLv2 (no "or later"). See:
+
+   etc/images/gnus/README
+   etc/images/mail/README
+   etc/images/README
+   nt/icons/README
+
 \f
 This file is part of GNU Emacs.
 
index 1e0c418..c91f643 100755 (executable)
--- a/configure
+++ b/configure
@@ -686,6 +686,7 @@ ALSA_LIBS
 CFLAGS_SOUND
 SET_MAKE
 XMKMF
+HAVE_XSERVER
 GTK_CFLAGS
 GTK_LIBS
 XFT_CFLAGS
@@ -1337,8 +1338,9 @@ Optional Packages:
   --with-xpm              use -lXpm for displaying XPM images
   --with-jpeg             use -ljpeg for displaying JPEG images
   --with-tiff             use -ltiff for displaying TIFF images
-  --with-gif              use -lungif for displaying GIF images
+  --with-gif              use -lgif (or -lungif) for displaying GIF images
   --with-png              use -lpng for displaying PNG images
+  --with-gpm              use -lgpm for mouse support on a GNU/Linux console
   --with-gtk              use GTK (same as --with-x-toolkit=gtk)
   --with-pkg-config-prog  Path to pkg-config to use for finding GTK
   --without-toolkit-scroll-bars
@@ -1890,19 +1892,19 @@ fi
 # Check whether --with-x-toolkit was given.
 if test "${with_x_toolkit+set}" = set; then
   withval=$with_x_toolkit;       case "${withval}" in
-           y | ye | yes )      val=athena ;;
+           y | ye | yes )      val=gtk ;;
            n | no )            val=no  ;;
            l | lu | luc | luci | lucid )       val=lucid ;;
            a | at | ath | athe | athen | athena )      val=athena ;;
            m | mo | mot | moti | motif )       val=motif ;;
            g | gt | gtk  )     val=gtk ;;
            * )
-{ { echo "$as_me:$LINENO: error: \`--with-x-toolkit=$withval' is invalid\;
+{ { echo "$as_me:$LINENO: error: \`--with-x-toolkit=$withval' is invalid;
 this option's value should be \`yes', \`no', \`lucid', \`athena', \`motif' or \`gtk'.
-Currently, \`yes', \`athena' and \`lucid' are synonyms." >&5
-echo "$as_me: error: \`--with-x-toolkit=$withval' is invalid\;
+\`yes' and \`gtk' are synonyms. \`athena' and \`lucid' are synonyms." >&5
+echo "$as_me: error: \`--with-x-toolkit=$withval' is invalid;
 this option's value should be \`yes', \`no', \`lucid', \`athena', \`motif' or \`gtk'.
-Currently, \`yes', \`athena' and \`lucid' are synonyms." >&2;}
+\`yes' and \`gtk' are synonyms. \`athena' and \`lucid' are synonyms." >&2;}
    { (exit 1); exit 1; }; }
            ;;
          esac
@@ -1941,6 +1943,12 @@ if test "${with_png+set}" = set; then
 fi
 
 
+# Check whether --with-gpm was given.
+if test "${with_gpm+set}" = set; then
+  withval=$with_gpm;
+fi
+
+
 # Check whether --with-gtk was given.
 if test "${with_gtk+set}" = set; then
   withval=$with_gtk;
@@ -2169,7 +2177,7 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
 canonical=$host
-configuration=${host_alias-$host}
+configuration=${host_alias-${build_alias-$host}}
 
 
 
@@ -2995,14 +3003,8 @@ _ACEOF
                ;;
       *-sunos5* | *-solaris* )
                opsys=sol2-6
-## FIXME: make this into a proper fix that checks the compiler type,
-## rather than relying on path. Or is /usr/ccs/lib/cpp a bad default now?
-               if [ "x$CC" = x/opt/SUNWspro/bin/cc ]; then
-                 ## -Xs prevents spurious whitespace.
-                 NON_GNU_CPP="/opt/SUNWspro/bin/cc -E -Xs"
-               else
-                 NON_GNU_CPP=/usr/ccs/lib/cpp
-               fi
+               emacs_check_sunpro_c=yes
+               NON_GNU_CPP=/usr/ccs/lib/cpp
                ;;
       *                          ) opsys=bsd4-2   ;;
     esac
@@ -4158,6 +4160,72 @@ if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 
+## If not using gcc, and on Solaris, and no CPP specified, see if
+## using a Sun compiler, which needs -Xs to prevent whitespace.
+if test x"$GCC" != xyes && test x"$emacs_check_sunpro_c" = xyes && \
+ test x"$CPP" = x; then
+  { echo "$as_me:$LINENO: checking whether we are using a Sun C compiler" >&5
+echo $ECHO_N "checking whether we are using a Sun C compiler... $ECHO_C" >&6; }
+
+if test "${emacs_cv_sunpro_c+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __SUNPRO_C
+fail;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  emacs_cv_sunpro_c=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       emacs_cv_sunpro_c=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+
+  { echo "$as_me:$LINENO: result: $emacs_cv_sunpro_c" >&5
+echo "${ECHO_T}$emacs_cv_sunpro_c" >&6; }
+
+  if test x"$emacs_cv_sunpro_c" = xyes; then
+    NON_GNU_CPP="$CC -E -Xs"
+  fi
+fi
+
 #### Some systems specify a CPP to use unless we are using GCC.
 #### Now that we know whether we are using GCC, we can decide whether
 #### to use that one.
@@ -4185,7 +4253,6 @@ then
   CC="$CC $NON_GCC_TEST_OPTIONS"
 fi
 
-
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -9502,7 +9569,13 @@ case "${window_system}" in
       gtk ) with_gtk=yes
             USE_X_TOOLKIT=none ;;
       no ) USE_X_TOOLKIT=none ;;
-      * ) USE_X_TOOLKIT=maybe ;;
+      * )
+          if test x"$with_gtk" = xyes; then
+             USE_X_TOOLKIT=none
+          else
+             USE_X_TOOLKIT=maybe
+          fi
+          ;;
     esac
   ;;
   mac | none )
@@ -9512,6 +9585,68 @@ case "${window_system}" in
   ;;
 esac
 
+if test "$window_system" = none && test "X$with_x" != "Xno"; then
+   # Extract the first word of "X", so it can be a program name with args.
+set dummy X; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_HAVE_XSERVER+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$HAVE_XSERVER"; then
+  ac_cv_prog_HAVE_XSERVER="$HAVE_XSERVER" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_HAVE_XSERVER="true"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_prog_HAVE_XSERVER" && ac_cv_prog_HAVE_XSERVER="false"
+fi
+fi
+HAVE_XSERVER=$ac_cv_prog_HAVE_XSERVER
+if test -n "$HAVE_XSERVER"; then
+  { echo "$as_me:$LINENO: result: $HAVE_XSERVER" >&5
+echo "${ECHO_T}$HAVE_XSERVER" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+   if test "$HAVE_XSERVER" = true ||
+      test -n "$DISPLAY" ||
+      test "`echo /usr/lib/libX11.*`" != "/usr/lib/libX11.*"; then
+        { { echo "$as_me:$LINENO: error: You seem to be running X, but no X development libraries
+where found.  You should install the relevant development files for X
+and the for the toolkit you want, such as Gtk+, Lesstif or Motif.  Also make
+sure you have development files for image handling, i.e.
+tiff, gif, jpeg, png and xpm.
+If you are sure you want Emacs compiled without X window support, pass
+  --without-x
+to configure." >&5
+echo "$as_me: error: You seem to be running X, but no X development libraries
+where found.  You should install the relevant development files for X
+and the for the toolkit you want, such as Gtk+, Lesstif or Motif.  Also make
+sure you have development files for image handling, i.e.
+tiff, gif, jpeg, png and xpm.
+If you are sure you want Emacs compiled without X window support, pass
+  --without-x
+to configure." >&2;}
+   { (exit 1); exit 1; }; }
+   fi
+fi
+
 ### If we're using X11, we should use the X menu package.
 HAVE_MENUS=no
 case ${HAVE_X11} in
@@ -10937,7 +11072,8 @@ HAVE_GTK=no
 if test "${with_gtk}" = "yes" && test "$USE_X_TOOLKIT" = "gtk"; then
   USE_X_TOOLKIT=none
 fi
-if test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "gtk"; then
+if test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "gtk" || \
+ test "$USE_X_TOOLKIT" = "maybe"; then
   if test "$USE_X_TOOLKIT" != "none" && test "$USE_X_TOOLKIT" != "maybe"; then
     { { echo "$as_me:$LINENO: error: Conflicting options, --with-gtk is incompatible with --with-x-toolkit=${with_x_toolkit}" >&5
 echo "$as_me: error: Conflicting options, --with-gtk is incompatible with --with-x-toolkit=${with_x_toolkit}" >&2;}
   fi
 
   if test "$PKG_CONFIG" = "no" ; then
-     { { echo "$as_me:$LINENO: error:
-      *** The pkg-config script could not be found. Make sure it is in your path, or give the full path to pkg-config with the PKG_CONFIG environment variable or --with-pkg-config-prog.  Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." >&5
-echo "$as_me: error:
-      *** The pkg-config script could not be found. Make sure it is in your path, or give the full path to pkg-config with the PKG_CONFIG environment variable or --with-pkg-config-prog.  Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." >&2;}
-   { (exit 1); exit 1; }; }
+     pkg_check_gtk=no
   else
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
@@ -11033,7 +11165,7 @@ echo "${ECHO_T}no" >&6; }
             ## If we have a custom action on failure, don't print errors, but
             ## do set a variable so people can do so.
             GTK_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$GTK_MODULES"`
-            echo $GTK_PKG_ERRORS
+
         fi
 
 
@@ -11045,12 +11177,20 @@ echo "${ECHO_T}no" >&6; }
   fi
 
   if test $succeeded = yes; then
-     :
+     pkg_check_gtk=yes
   else
-     { { echo "$as_me:$LINENO: error: Library requirements ($GTK_MODULES) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5
-echo "$as_me: error: Library requirements ($GTK_MODULES) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;}
+     pkg_check_gtk=no
+  fi
+
+  if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then
+     { { echo "$as_me:$LINENO: error: $GTK_PKG_ERRORS" >&5
+echo "$as_me: error: $GTK_PKG_ERRORS" >&2;}
    { (exit 1); exit 1; }; }
   fi
+fi
+
+
+if test x"$pkg_check_gtk" = xyes; then
 
 
 
 done
 
   if test "${GTK_COMPILES}" != "yes"; then
-    { { echo "$as_me:$LINENO: error: Gtk+ wanted, but it does not compile, see config.log.  Maybe some x11-devel files missing?" >&5
+    if test "$USE_X_TOOLKIT" != "maybe"; then
+      { { echo "$as_me:$LINENO: error: Gtk+ wanted, but it does not compile, see config.log.  Maybe some x11-devel files missing?" >&5
 echo "$as_me: error: Gtk+ wanted, but it does not compile, see config.log.  Maybe some x11-devel files missing?" >&2;}
    { (exit 1); exit 1; }; };
-  fi
-
-  HAVE_GTK=yes
+    fi
+  else
+    HAVE_GTK=yes
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_GTK 1
 _ACEOF
 
-  USE_X_TOOLKIT=none
+    USE_X_TOOLKIT=none
+  fi
+
+fi
+
+
+if test "${HAVE_GTK}" = "yes"; then
 
       if test "$with_toolkit_scroll_bars" != no; then
     with_toolkit_scroll_bars=yes
@@ -12014,11 +12161,14 @@ _ACEOF
   fi
 fi
 
+HAVE_XAW3D=no
 if test x"${USE_X_TOOLKIT}" = xmaybe || test x"${USE_X_TOOLKIT}" = xLUCID; then
-  if test x"${HAVE_X11R5}" = xyes; then
-    { echo "$as_me:$LINENO: checking X11 version 5 with Xaw" >&5
-echo $ECHO_N "checking X11 version 5 with Xaw... $ECHO_C" >&6; }
-    if test "${emacs_cv_x11_version_5_with_xaw+set}" = set; then
+  if test x"${HAVE_X11R5}" != xyes; then
+    USE_X_TOOLKIT=none
+  else
+    { echo "$as_me:$LINENO: checking for xaw3d" >&5
+echo $ECHO_N "checking for xaw3d... $ECHO_C" >&6; }
+    if test "${emacs_cv_xaw3d+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -12029,7 +12179,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 #include <X11/Intrinsic.h>
-#include <X11/Xaw/Simple.h>
+#include <X11/Xaw3d/Simple.h>
 int
 main ()
 {
@@ -12056,35 +12206,97 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
         test ! -s conftest.err
        } && test -s conftest$ac_exeext &&
        $as_test_x conftest$ac_exeext; then
-  emacs_cv_x11_version_5_with_xaw=yes
+  emacs_cv_xaw3d=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       emacs_cv_x11_version_5_with_xaw=no
+       emacs_cv_xaw3d=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
 
-    if test $emacs_cv_x11_version_5_with_xaw = yes; then
-      { echo "$as_me:$LINENO: result: 5 or newer, with Xaw; use toolkit by default" >&5
-echo "${ECHO_T}5 or newer, with Xaw; use toolkit by default" >&6; }
+    if test $emacs_cv_xaw3d = yes; then
+      { echo "$as_me:$LINENO: result: yes; using Lucid toolkit" >&5
+echo "${ECHO_T}yes; using Lucid toolkit" >&6; }
       USE_X_TOOLKIT=LUCID
+      HAVE_XAW3D=yes
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_XAW3D 1
+_ACEOF
+
     else
-      if test x"${USE_X_TOOLKIT}" = xLUCID; then
+      { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+      { echo "$as_me:$LINENO: checking for libXaw" >&5
+echo $ECHO_N "checking for libXaw... $ECHO_C" >&6; }
+      if test "${emacs_cv_xaw+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <X11/Intrinsic.h>
+#include <X11/Xaw/Simple.h>
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  emacs_cv_xaw=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       emacs_cv_xaw=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+
+      if test $emacs_cv_xaw = yes; then
+        { echo "$as_me:$LINENO: result: yes; using Lucid toolkit" >&5
+echo "${ECHO_T}yes; using Lucid toolkit" >&6; }
+        USE_X_TOOLKIT=LUCID
+      elif test x"${USE_X_TOOLKIT}" = xLUCID; then
         { { echo "$as_me:$LINENO: error: Lucid toolkit requires X11/Xaw include files" >&5
 echo "$as_me: error: Lucid toolkit requires X11/Xaw include files" >&2;}
    { (exit 1); exit 1; }; }
       else
-        { echo "$as_me:$LINENO: result: before 5 or no Xaw; do not use toolkit by default" >&5
-echo "${ECHO_T}before 5 or no Xaw; do not use toolkit by default" >&6; }
+        { echo "$as_me:$LINENO: result: no; do not use toolkit by default" >&5
+echo "${ECHO_T}no; do not use toolkit by default" >&6; }
         USE_X_TOOLKIT=none
       fi
     fi
-  else
-    USE_X_TOOLKIT=none
   fi
 fi
 
@@ -12521,130 +12733,6 @@ echo "${ECHO_T}$emacs_cv_lesstif" >&6; }
   fi
 fi
 
-### Is -lXaw3d available?
-HAVE_XAW3D=no
-if test "${HAVE_X11}" = "yes"; then
-  if test "${USE_X_TOOLKIT}" != "none" && test "${with_toolkit_scroll_bars}" != "no"; then
-            { echo "$as_me:$LINENO: checking for X11/Xaw3d/Scrollbar.h" >&5
-echo $ECHO_N "checking for X11/Xaw3d/Scrollbar.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_X11_Xaw3d_Scrollbar_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <X11/Xaw3d/Scrollbar.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_cv_header_X11_Xaw3d_Scrollbar_h=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_cv_header_X11_Xaw3d_Scrollbar_h=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xaw3d_Scrollbar_h" >&5
-echo "${ECHO_T}$ac_cv_header_X11_Xaw3d_Scrollbar_h" >&6; }
-if test $ac_cv_header_X11_Xaw3d_Scrollbar_h = yes; then
-  { echo "$as_me:$LINENO: checking for XawScrollbarSetThumb in -lXaw3d" >&5
-echo $ECHO_N "checking for XawScrollbarSetThumb in -lXaw3d... $ECHO_C" >&6; }
-if test "${ac_cv_lib_Xaw3d_XawScrollbarSetThumb+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXaw3d  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XawScrollbarSetThumb ();
-int
-main ()
-{
-return XawScrollbarSetThumb ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_Xaw3d_XawScrollbarSetThumb=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_cv_lib_Xaw3d_XawScrollbarSetThumb=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xaw3d_XawScrollbarSetThumb" >&5
-echo "${ECHO_T}$ac_cv_lib_Xaw3d_XawScrollbarSetThumb" >&6; }
-if test $ac_cv_lib_Xaw3d_XawScrollbarSetThumb = yes; then
-  HAVE_XAW3D=yes
-fi
-
-fi
-
-
-    if test "${HAVE_XAW3D}" = "yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_XAW3D 1
-_ACEOF
-
-    fi
-  fi
-fi
-
 
 
 USE_TOOLKIT_SCROLL_BARS=no
@@ -13724,11 +13812,10 @@ _ACEOF
   fi
 fi
 
-### Use -lgif if available, unless `--with-gif=no'.
+### Use -lgif or -lungif if available, unless `--with-gif=no'.
 HAVE_GIF=no
-if test "${HAVE_X11}" = "yes"; then
-  if test "${with_gif}" != "no"; then
-    if test "${ac_cv_header_gif_lib_h+set}" = set; then
+if test "${HAVE_X11}" = "yes" && test "${with_gif}" != "no"; then
+  if test "${ac_cv_header_gif_lib_h+set}" = set; then
   { echo "$as_me:$LINENO: checking for gif_lib.h" >&5
 echo $ECHO_N "checking for gif_lib.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_gif_lib_h+set}" = set; then
 if test $ac_cv_header_gif_lib_h = yes; then
   # EGifPutExtensionLast only exists from version libungif-4.1.0b1.
 # Earlier versions can crash Emacs.
-      { echo "$as_me:$LINENO: checking for EGifPutExtensionLast in -lungif" >&5
+    { echo "$as_me:$LINENO: checking for EGifPutExtensionLast in -lgif" >&5
+echo $ECHO_N "checking for EGifPutExtensionLast in -lgif... $ECHO_C" >&6; }
+if test "${ac_cv_lib_gif_EGifPutExtensionLast+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgif  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char EGifPutExtensionLast ();
+int
+main ()
+{
+return EGifPutExtensionLast ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_gif_EGifPutExtensionLast=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_gif_EGifPutExtensionLast=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_gif_EGifPutExtensionLast" >&5
+echo "${ECHO_T}$ac_cv_lib_gif_EGifPutExtensionLast" >&6; }
+if test $ac_cv_lib_gif_EGifPutExtensionLast = yes; then
+  HAVE_GIF=yes
+else
+  try_libungif=yes
+fi
+
+fi
+
+
+
+  if test "$HAVE_GIF" = yes; then
+      ac_gif_lib_name="-lgif"
+  fi
+
+# If gif_lib.h but no libgif, try libungif.
+  if test x"$try_libungif" = xyes; then
+    { echo "$as_me:$LINENO: checking for EGifPutExtensionLast in -lungif" >&5
 echo $ECHO_N "checking for EGifPutExtensionLast in -lungif... $ECHO_C" >&6; }
 if test "${ac_cv_lib_ungif_EGifPutExtensionLast+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13921,9 +14085,15 @@ if test $ac_cv_lib_ungif_EGifPutExtensionLast = yes; then
   HAVE_GIF=yes
 fi
 
-fi
 
+    if test "$HAVE_GIF" = yes; then
 
+cat >>confdefs.h <<\_ACEOF
+#define LIBGIF -lungif
+_ACEOF
+
+      ac_gif_lib_name="-lungif"
+    fi
   fi
 
   if test "${HAVE_GIF}" = "yes"; then
@@ -13935,6 +14105,244 @@ _ACEOF
   fi
 fi
 
+if test "${HAVE_X11}" = "yes"; then
+  MISSING=""
+  WITH_NO=""
+  test "${with_xpm}" != "no" && test "${HAVE_XPM}" != "yes" &&
+    MISSING="libXpm" && WITH_NO="--with-xpm=no"
+  test "${with_jpeg}" != "no" && test "${HAVE_JPEG}" != "yes" &&
+    MISSING="$MISSING libjpeg" && WITH_NO="$WITH_NO --with-jpeg=no"
+  test "${with_png}" != "no" && test "${HAVE_PNG}" != "yes" &&
+    MISSING="$MISSING libpng" && WITH_NO="$WITH_NO --with-png=no"
+  test "${with_gif}" != "no" && test "${HAVE_GIF}" != "yes" &&
+    MISSING="$MISSING libgif/libungif" && WITH_NO="$WITH_NO --with-gif=no"
+  test "${with_tiff}" != "no" && test "${HAVE_TIFF}" != "yes" &&
+    MISSING="$MISSING libtiff" && WITH_NO="$WITH_NO --with-tiff=no"
+
+  if test "X${MISSING}" != X; then
+    { { echo "$as_me:$LINENO: error: The following required libraries was not found:
+    $MISSING
+Maybe some development libraries/packages are missing?
+If you don't want to link with them give
+    $WITH_NO
+as options to configure" >&5
+echo "$as_me: error: The following required libraries was not found:
+    $MISSING
+Maybe some development libraries/packages are missing?
+If you don't want to link with them give
+    $WITH_NO
+as options to configure" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+fi
+
+### Use -lgpm if available, unless `--with-gpm=no'.
+HAVE_GPM=no
+if test "${with_gpm}" != "no"; then
+  if test "${ac_cv_header_gpm_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for gpm.h" >&5
+echo $ECHO_N "checking for gpm.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_gpm_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_gpm_h" >&5
+echo "${ECHO_T}$ac_cv_header_gpm_h" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking gpm.h usability" >&5
+echo $ECHO_N "checking gpm.h usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <gpm.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking gpm.h presence" >&5
+echo $ECHO_N "checking gpm.h presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <gpm.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: gpm.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: gpm.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: gpm.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: gpm.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: gpm.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: gpm.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: gpm.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: gpm.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: gpm.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: gpm.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: gpm.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: gpm.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: gpm.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: gpm.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: gpm.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: gpm.h: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for gpm.h" >&5
+echo $ECHO_N "checking for gpm.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_gpm_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_gpm_h=$ac_header_preproc
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_gpm_h" >&5
+echo "${ECHO_T}$ac_cv_header_gpm_h" >&6; }
+
+fi
+if test $ac_cv_header_gpm_h = yes; then
+  { echo "$as_me:$LINENO: checking for Gpm_Open in -lgpm" >&5
+echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6; }
+if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgpm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char Gpm_Open ();
+int
+main ()
+{
+return Gpm_Open ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_gpm_Gpm_Open=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_gpm_Gpm_Open=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_gpm_Gpm_Open" >&5
+echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6; }
+if test $ac_cv_lib_gpm_Gpm_Open = yes; then
+  HAVE_GPM=yes
+fi
+
+fi
+
+
+fi
+
+if test "${HAVE_GPM}" = "yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GPM 1
+_ACEOF
+
+fi
+
 if test "${ac_cv_header_malloc_malloc_h+set}" = set; then
   { echo "$as_me:$LINENO: checking for malloc/malloc.h" >&5
 echo $ECHO_N "checking for malloc/malloc.h... $ECHO_C" >&6; }
@@ -23067,6 +23475,7 @@ fi
 
 
 
+
 #### Report on what we decided to do.
 #### Report GTK as a toolkit, even if it doesn't use Xt.
 #### It makes printing result more understandable as using GTK sets
@@ -23103,8 +23512,9 @@ echo "  Does Emacs use -lXaw3d?                                 ${HAVE_XAW3D}"
 echo "  Does Emacs use -lXpm?                                   ${HAVE_XPM}"
 echo "  Does Emacs use -ljpeg?                                  ${HAVE_JPEG}"
 echo "  Does Emacs use -ltiff?                                  ${HAVE_TIFF}"
-echo "  Does Emacs use -lungif?                                 ${HAVE_GIF}"
+echo "  Does Emacs use a gif library?                           ${HAVE_GIF} $ac_gif_lib_name"
 echo "  Does Emacs use -lpng?                                   ${HAVE_PNG}"
+echo "  Does Emacs use -lgpm?                                   ${HAVE_GPM}"
 echo "  Does Emacs use X toolkit scroll bars?                   ${USE_TOOLKIT_SCROLL_BARS}"
 echo
 
@@ -23864,6 +24274,7 @@ ALSA_LIBS!$ALSA_LIBS$ac_delim
 CFLAGS_SOUND!$CFLAGS_SOUND$ac_delim
 SET_MAKE!$SET_MAKE$ac_delim
 XMKMF!$XMKMF$ac_delim
+HAVE_XSERVER!$HAVE_XSERVER$ac_delim
 GTK_CFLAGS!$GTK_CFLAGS$ac_delim
 GTK_LIBS!$GTK_LIBS$ac_delim
 XFT_CFLAGS!$XFT_CFLAGS$ac_delim
@@ -23890,7 +24301,6 @@ bitmapdir!$bitmapdir$ac_delim
 gamedir!$gamedir$ac_delim
 gameuser!$gameuser$ac_delim
 c_switch_system!$c_switch_system$ac_delim
-c_switch_machine!$c_switch_machine$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -23932,6 +24342,7 @@ _ACEOF
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+c_switch_machine!$c_switch_machine$ac_delim
 LD_SWITCH_X_SITE!$LD_SWITCH_X_SITE$ac_delim
 LD_SWITCH_X_SITE_AUX!$LD_SWITCH_X_SITE_AUX$ac_delim
 C_SWITCH_X_SITE!$C_SWITCH_X_SITE$ac_delim
@@ -23942,7 +24353,7 @@ carbon_appdir!$carbon_appdir$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 8; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 9; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
index eed8891..9769f29 100644 (file)
@@ -84,21 +84,16 @@ AC_ARG_WITH(x-toolkit,
 [  --with-x-toolkit=KIT    use an X toolkit
                               (KIT = yes/lucid/athena/motif/gtk/no)],
 [        case "${withval}" in
-           y | ye | yes )      val=athena ;;
+           y | ye | yes )      val=gtk ;;
            n | no )            val=no  ;;
            l | lu | luc | luci | lucid )       val=lucid ;;
            a | at | ath | athe | athen | athena )      val=athena ;;
            m | mo | mot | moti | motif )       val=motif ;;
            g | gt | gtk  )     val=gtk ;;
-dnl These don't currently work.
-dnl        o | op | ope | open | open- | open-l | open-lo \
-dnl            | open-loo | open-look )        val=open-look ;;
            * )
-dnl AC_MSG_ERROR([the `--with-x-toolkit' option is supposed to have a value
-dnl which is `yes', `no', `lucid', `athena', `motif' or `open-look'.])
-AC_MSG_ERROR([`--with-x-toolkit=$withval' is invalid\;
+AC_MSG_ERROR([`--with-x-toolkit=$withval' is invalid;
 this option's value should be `yes', `no', `lucid', `athena', `motif' or `gtk'.
-Currently, `yes', `athena' and `lucid' are synonyms.])
+`yes' and `gtk' are synonyms. `athena' and `lucid' are synonyms.])
            ;;
          esac
          with_x_toolkit=$val
@@ -110,9 +105,11 @@ AC_ARG_WITH(jpeg,
 AC_ARG_WITH(tiff,
 [  --with-tiff             use -ltiff for displaying TIFF images])
 AC_ARG_WITH(gif,
-[  --with-gif              use -lungif for displaying GIF images])
+[  --with-gif              use -lgif (or -lungif) for displaying GIF images])
 AC_ARG_WITH(png,
 [  --with-png              use -lpng for displaying PNG images])
+AC_ARG_WITH(gpm,
+[  --with-gpm              use -lgpm for mouse support on a GNU/Linux console])
 AC_ARG_WITH(gtk,
 [  --with-gtk              use GTK (same as --with-x-toolkit=gtk)])
 AC_ARG_WITH(pkg-config-prog,
@@ -198,7 +195,7 @@ fi
 
 AC_CANONICAL_HOST
 canonical=$host
-configuration=${host_alias-$host}
+configuration=${host_alias-${build_alias-$host}}
 
 dnl This used to use changequote, but, apart from `changequote is evil'
 dnl per the autoconf manual, we can speed up autoconf somewhat by quoting
@@ -1030,14 +1027,8 @@ dnl see the `changequote' comment above.
                ;;
       *-sunos5* | *-solaris* )
                opsys=sol2-6
-## FIXME: make this into a proper fix that checks the compiler type,
-## rather than relying on path. Or is /usr/ccs/lib/cpp a bad default now?
-               if [ "x$CC" = x/opt/SUNWspro/bin/cc ]; then
-                 ## -Xs prevents spurious whitespace.
-                 NON_GNU_CPP="/opt/SUNWspro/bin/cc -E -Xs"
-               else
-                 NON_GNU_CPP=/usr/ccs/lib/cpp
-               fi
+               emacs_check_sunpro_c=yes
+               NON_GNU_CPP=/usr/ccs/lib/cpp
                ;;
       *                          ) opsys=bsd4-2   ;;
     esac
@@ -1273,6 +1264,24 @@ if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 
+## If not using gcc, and on Solaris, and no CPP specified, see if
+## using a Sun compiler, which needs -Xs to prevent whitespace.
+if test x"$GCC" != xyes && test x"$emacs_check_sunpro_c" = xyes && \
+ test x"$CPP" = x; then
+  AC_MSG_CHECKING([whether we are using a Sun C compiler])
+  AC_CACHE_VAL(emacs_cv_sunpro_c,
+  [AC_TRY_LINK([],
+[#ifndef __SUNPRO_C
+fail;
+#endif
+], emacs_cv_sunpro_c=yes, emacs_cv_sunpro_c=no)])
+  AC_MSG_RESULT($emacs_cv_sunpro_c)
+
+  if test x"$emacs_cv_sunpro_c" = xyes; then
+    NON_GNU_CPP="$CC -E -Xs"
+  fi
+fi
+
 #### Some systems specify a CPP to use unless we are using GCC.
 #### Now that we know whether we are using GCC, we can decide whether
 #### to use that one.
@@ -1860,15 +1869,20 @@ case "${window_system}" in
     case "${with_x_toolkit}" in
       athena | lucid ) USE_X_TOOLKIT=LUCID ;;
       motif ) USE_X_TOOLKIT=MOTIF ;;
-dnl      open-look ) USE_X_TOOLKIT=OPEN_LOOK ;;
       gtk ) with_gtk=yes
 dnl Dont set this for GTK.  A lot of tests below assumes Xt when
 dnl USE_X_TOOLKIT is set.
             USE_X_TOOLKIT=none ;;
       no ) USE_X_TOOLKIT=none ;;
-dnl If user did not say whether to use a toolkit,
-dnl make this decision later: use the toolkit if we have X11R5 or newer.
-      * ) USE_X_TOOLKIT=maybe ;;
+dnl If user did not say whether to use a toolkit, make this decision later:
+dnl use the toolkit if we have gtk, or X11R5 or newer.
+      * ) 
+          if test x"$with_gtk" = xyes; then
+             USE_X_TOOLKIT=none
+          else
+             USE_X_TOOLKIT=maybe
+          fi
+          ;;
     esac
   ;;
   mac | none )
@@ -1878,6 +1892,22 @@ dnl make this decision later: use the toolkit if we have X11R5 or newer.
   ;;
 esac
 
+if test "$window_system" = none && test "X$with_x" != "Xno"; then
+   AC_CHECK_PROG(HAVE_XSERVER, X, true, false)
+   if test "$HAVE_XSERVER" = true ||
+      test -n "$DISPLAY" || 
+      test "`echo /usr/lib/libX11.*`" != "/usr/lib/libX11.*"; then
+        AC_MSG_ERROR([You seem to be running X, but no X development libraries
+were found.  You should install the relevant development files for X
+and for the toolkit you want, such as Gtk+, Lesstif or Motif.  Also make
+sure you have development files for image handling, i.e.
+tiff, gif, jpeg, png and xpm.
+If you are sure you want Emacs compiled without X window support, pass
+  --without-x
+to configure.])
+   fi
+fi
+
 ### If we're using X11, we should use the X menu package.
 HAVE_MENUS=no
 case ${HAVE_X11} in
@@ -2096,7 +2126,8 @@ HAVE_GTK=no
 if test "${with_gtk}" = "yes" && test "$USE_X_TOOLKIT" = "gtk"; then
   USE_X_TOOLKIT=none
 fi
-if test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "gtk"; then
+if test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "gtk" || \
+ test "$USE_X_TOOLKIT" = "maybe"; then
   if test "$USE_X_TOOLKIT" != "none" && test "$USE_X_TOOLKIT" != "maybe"; then
     AC_MSG_ERROR([Conflicting options, --with-gtk is incompatible with --with-x-toolkit=${with_x_toolkit}]);
   fi
@@ -2109,7 +2140,15 @@ if test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "gtk"; then
     PKG_CONFIG="${with_pkg_config_prog}"
   fi
   dnl Checks for libraries.
-  PKG_CHECK_MODULES(GTK, $GTK_MODULES)
+  PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no)
+  if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then
+     AC_MSG_ERROR($GTK_PKG_ERRORS)
+  fi
+fi
+
+
+if test x"$pkg_check_gtk" = xyes; then
+
   AC_SUBST(GTK_CFLAGS)
   AC_SUBST(GTK_LIBS)
   C_SWITCH_X_SITE="$C_SWITCH_X_SITE $GTK_CFLAGS"
@@ -2119,12 +2158,19 @@ if test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "gtk"; then
   GTK_COMPILES=no
   AC_CHECK_FUNCS(gtk_main, GTK_COMPILES=yes)
   if test "${GTK_COMPILES}" != "yes"; then
-    AC_MSG_ERROR([Gtk+ wanted, but it does not compile, see config.log.  Maybe some x11-devel files missing?]);
+    if test "$USE_X_TOOLKIT" != "maybe"; then
+      AC_MSG_ERROR([Gtk+ wanted, but it does not compile, see config.log.  Maybe some x11-devel files missing?]);
+    fi
+  else
+    HAVE_GTK=yes
+    AC_DEFINE(HAVE_GTK, 1, [Define to 1 if using GTK.])
+    USE_X_TOOLKIT=none
   fi
-  
-  HAVE_GTK=yes
-  AC_DEFINE(HAVE_GTK, 1, [Define to 1 if using GTK.])
-  USE_X_TOOLKIT=none
+
+fi
+
+
+if test "${HAVE_GTK}" = "yes"; then
 
   dnl  GTK scrollbars resemble toolkit scrollbars a lot, so to avoid
   dnl  a lot if #ifdef:s, say we have toolkit scrollbars.
@@ -2205,29 +2251,45 @@ fi
 
 dnl Do not put whitespace before the #include statements below.
 dnl Older compilers (eg sunos4 cc) choke on it.
+HAVE_XAW3D=no
 if test x"${USE_X_TOOLKIT}" = xmaybe || test x"${USE_X_TOOLKIT}" = xLUCID; then
-  if test x"${HAVE_X11R5}" = xyes; then
-    AC_MSG_CHECKING(X11 version 5 with Xaw)
-    AC_CACHE_VAL(emacs_cv_x11_version_5_with_xaw,
+  if test x"${HAVE_X11R5}" != xyes; then
+    USE_X_TOOLKIT=none
+  else
+    AC_MSG_CHECKING(for xaw3d)
+    AC_CACHE_VAL(emacs_cv_xaw3d,
     [AC_TRY_LINK([
 #include <X11/Intrinsic.h>
-#include <X11/Xaw/Simple.h>],
+#include <X11/Xaw3d/Simple.h>],
       [],
-      emacs_cv_x11_version_5_with_xaw=yes,
-      emacs_cv_x11_version_5_with_xaw=no)])
-    if test $emacs_cv_x11_version_5_with_xaw = yes; then
-      AC_MSG_RESULT([5 or newer, with Xaw; use toolkit by default])
+      emacs_cv_xaw3d=yes,
+      emacs_cv_xaw3d=no)])
+    if test $emacs_cv_xaw3d = yes; then
+      AC_MSG_RESULT([yes; using Lucid toolkit])
       USE_X_TOOLKIT=LUCID
+      HAVE_XAW3D=yes
+      AC_DEFINE(HAVE_XAW3D, 1,
+                [Define to 1 if you have the Xaw3d library (-lXaw3d).])
     else
-      if test x"${USE_X_TOOLKIT}" = xLUCID; then
+      AC_MSG_RESULT(no)
+      AC_MSG_CHECKING(for libXaw)
+      AC_CACHE_VAL(emacs_cv_xaw,
+      [AC_TRY_LINK([
+#include <X11/Intrinsic.h>
+#include <X11/Xaw/Simple.h>],
+        [],
+        emacs_cv_xaw=yes,
+        emacs_cv_xaw=no)])
+      if test $emacs_cv_xaw = yes; then
+        AC_MSG_RESULT([yes; using Lucid toolkit])
+        USE_X_TOOLKIT=LUCID
+      elif test x"${USE_X_TOOLKIT}" = xLUCID; then
         AC_MSG_ERROR([Lucid toolkit requires X11/Xaw include files])
       else
-        AC_MSG_RESULT(before 5 or no Xaw; do not use toolkit by default)
+        AC_MSG_RESULT([no; do not use toolkit by default])
         USE_X_TOOLKIT=none
       fi
     fi
-  else
-    USE_X_TOOLKIT=none
   fi
 fi
 
@@ -2315,21 +2377,6 @@ Motif version prior to 2.1.
   fi
 fi
 
-### Is -lXaw3d available?
-HAVE_XAW3D=no
-if test "${HAVE_X11}" = "yes"; then
-  if test "${USE_X_TOOLKIT}" != "none" && test "${with_toolkit_scroll_bars}" != "no"; then
-    dnl Fixme: determine what Scrollbar.h needs to avoid compilation
-    dnl errors from the test without the `-'.
-    AC_CHECK_HEADER(X11/Xaw3d/Scrollbar.h,
-       [AC_CHECK_LIB(Xaw3d, XawScrollbarSetThumb, HAVE_XAW3D=yes)], , -)
-    if test "${HAVE_XAW3D}" = "yes"; then
-       AC_DEFINE(HAVE_XAW3D, 1,
-                 [Define to 1 if you have the Xaw3d library (-lXaw3d).])
-    fi
-  fi
-fi
-
 dnl Use toolkit scroll bars if configured for GTK or X toolkit and either
 dnl using Motif or Xaw3d is available, and unless
 dnl --with-toolkit-scroll-bars=no was specified.
@@ -2491,21 +2538,69 @@ if test "${HAVE_X11}" = "yes"; then
   fi
 fi
 
-### Use -lgif if available, unless `--with-gif=no'.
+### Use -lgif or -lungif if available, unless `--with-gif=no'.
 HAVE_GIF=no
-if test "${HAVE_X11}" = "yes"; then
-  if test "${with_gif}" != "no"; then
-    AC_CHECK_HEADER(gif_lib.h,
+if test "${HAVE_X11}" = "yes" && test "${with_gif}" != "no"; then
+  AC_CHECK_HEADER(gif_lib.h,
 # EGifPutExtensionLast only exists from version libungif-4.1.0b1.
 # Earlier versions can crash Emacs.
-      AC_CHECK_LIB(ungif, EGifPutExtensionLast, HAVE_GIF=yes))
+    AC_CHECK_LIB(gif, EGifPutExtensionLast, HAVE_GIF=yes, try_libungif=yes))
+
+  if test "$HAVE_GIF" = yes; then
+      ac_gif_lib_name="-lgif"
+  fi
+
+# If gif_lib.h but no libgif, try libungif.
+  if test x"$try_libungif" = xyes; then
+    AC_CHECK_LIB(ungif, EGifPutExtensionLast, HAVE_GIF=yes)
+
+    if test "$HAVE_GIF" = yes; then
+      AC_DEFINE(LIBGIF, -lungif, [Compiler option to link with the gif library (if not -lgif).])
+      ac_gif_lib_name="-lungif"
+    fi
   fi
 
   if test "${HAVE_GIF}" = "yes"; then
-    AC_DEFINE(HAVE_GIF, 1, [Define to 1 if you have the ungif library (-lungif).])
+    AC_DEFINE(HAVE_GIF, 1, [Define to 1 if you have a gif library (default -lgif; otherwise specify with LIBGIF).])
   fi
 fi
 
+dnl Check for required libraries.
+if test "${HAVE_X11}" = "yes"; then
+  MISSING=""
+  WITH_NO=""
+  test "${with_xpm}" != "no" && test "${HAVE_XPM}" != "yes" &&
+    MISSING="libXpm" && WITH_NO="--with-xpm=no"
+  test "${with_jpeg}" != "no" && test "${HAVE_JPEG}" != "yes" &&
+    MISSING="$MISSING libjpeg" && WITH_NO="$WITH_NO --with-jpeg=no"
+  test "${with_png}" != "no" && test "${HAVE_PNG}" != "yes" &&
+    MISSING="$MISSING libpng" && WITH_NO="$WITH_NO --with-png=no"
+  test "${with_gif}" != "no" && test "${HAVE_GIF}" != "yes" &&
+    MISSING="$MISSING libgif/libungif" && WITH_NO="$WITH_NO --with-gif=no"
+  test "${with_tiff}" != "no" && test "${HAVE_TIFF}" != "yes" &&
+    MISSING="$MISSING libtiff" && WITH_NO="$WITH_NO --with-tiff=no"
+
+  if test "X${MISSING}" != X; then
+    AC_MSG_ERROR([The following required libraries was not found:
+    $MISSING
+Maybe some development libraries/packages are missing?
+If you don't want to link with them give
+    $WITH_NO
+as options to configure])
+  fi
+fi
+
+### Use -lgpm if available, unless `--with-gpm=no'.
+HAVE_GPM=no
+if test "${with_gpm}" != "no"; then
+  AC_CHECK_HEADER(gpm.h,
+    AC_CHECK_LIB(gpm, Gpm_Open, HAVE_GPM=yes))
+fi
+
+if test "${HAVE_GPM}" = "yes"; then
+  AC_DEFINE(HAVE_GPM, 1, [Define to 1 if you have the gpm library (-lgpm).])
+fi
+
 dnl Check for malloc/malloc.h on darwin
 AC_CHECK_HEADER(malloc/malloc.h, AC_DEFINE(HAVE_MALLOC_MALLOC_H, 1, [Define to 1 if you have the <malloc/malloc.h> header file.]))
 
@@ -2937,6 +3032,7 @@ if test "${REL_ALLOC}" = "yes" ; then
             buffer space.])
 fi
 
+
 AH_TOP([/* GNU Emacs site configuration template file.
    Copyright (C) 1988, 1993, 1994, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007
              Free Software Foundation, Inc.
@@ -3264,8 +3360,9 @@ echo "  Does Emacs use -lXaw3d?                                 ${HAVE_XAW3D}"
 echo "  Does Emacs use -lXpm?                                   ${HAVE_XPM}"
 echo "  Does Emacs use -ljpeg?                                  ${HAVE_JPEG}"
 echo "  Does Emacs use -ltiff?                                  ${HAVE_TIFF}"
-echo "  Does Emacs use -lungif?                                 ${HAVE_GIF}"
+echo "  Does Emacs use a gif library?                           ${HAVE_GIF} $ac_gif_lib_name"
 echo "  Does Emacs use -lpng?                                   ${HAVE_PNG}"
+echo "  Does Emacs use -lgpm?                                   ${HAVE_GPM}"
 echo "  Does Emacs use X toolkit scroll bars?                   ${USE_TOOLKIT_SCROLL_BARS}"
 echo
 
index 26ead74..9fd1a50 100644 (file)
@@ -3,28 +3,76 @@
        * TODO: `iff' item is dealt with.
        * GNUS-NEWS, NEWS, NEWS.1-17, NEWS.19, NEWS.21: Replace `iff'.
 
+2007-08-01  Glenn Morris  <rgm@gnu.org>
+
+       * NEWS: Add fortran-line-length, plus some more sections.
+
 2007-07-25  Glenn Morris  <rgm@gnu.org>
 
        *  Relicense all FSF files to GPLv3 or later.
 
        * COPYING: Switch to GPLv3.
 
-2007-07-15  Werner Lemberg  <wl@gnu.org>
+2007-07-24  Michael Albinus  <michael.albinus@gmx.de>
 
-       * emacs.1: Completely revised.
-       Fix many typographical glitches.
-       Updated to handle current state of options and resources.
+       * NEWS: New functions `start-file-process-shell-command' and
+       `process-file-shell-command'.
+
+2007-07-17  Michael Albinus  <michael.albinus@gmx.de>
+
+       * NEWS: `file-remote-p' has a new optional parameter IDENTIFICATION.
+
+2007-07-15  Karl Fogel  <kfogel@red-bean.com>
+
+       * NEWS: Revert 2007-07-13T23:20:21Z!kfogel@red-bean.com, which
+       documented bookmark keybinding changes that were later reverted.
 
 2007-07-14  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
 
        * PROBLEMS: Mention gtk-engines-qt problem.
 
-2007-06-07  Glenn Morris  <rgm@gnu.org>
+2007-07-13  Karl Fogel  <kfogel@red-bean.com>
 
-       * images/cancel.pbm: Convert from PGM to PBM.
+       * NEWS: Update for recent bookmark keybinding changes.
 
-       * images/copy.pbm, images/next-node.pbm, images/prev-node.pbm:
-       * images/save.pbm, images/up-node.pbm: Convert from PPM to PBM.
+2007-07-10  Michael Albinus  <michael.albinus@gmx.de>
+
+       * NEWS: Add Tramp and comint-mode changes.
+
+2007-07-08  Michael Albinus  <michael.albinus@gmx.de>
+
+       * NEWS: `file-remote-p' has a new optional parameter CONNECTED.
+
+2007-07-07  Michael Albinus  <michael.albinus@gmx.de>
+
+       * NEWS: New function `start-file-process'.
+
+2007-07-02  Carsten Dominik  <dominik@science.uva.nl>
+
+       * orgcard.tex: Version 5.01
+
+2007-06-27  Michael Albinus  <michael.albinus@gmx.de>
+
+       * NEWS: `dired-call-process' has been removed.
+
+2007-06-20  Glenn Morris  <rgm@gnu.org>
+
+       * NEWS: configure prefers libgif over libungif.
+
+2007-06-14  Nick Roberts  <nickrob@snap.net.nz>
+
+       * NEWS: Mention mouse highlighting in a GNU/Linux console.
+
+2007-06-14  Werner Lemberg  <wl@gnu.org>
+
+       * emacs.1: Completely revised.
+       Fix many typographical glitches.
+       Updated to handle current state of options and resources.
+
+2007-06-12  Glenn Morris  <rgm@gnu.org>
+
+       * NEWS: Change bug address.  Add back +++/--- note.
+       Use present tense for X-toolkit entry.  Mention libgif.
 
 2007-06-07  Mark H. Weaver  <mhw@netris.org>  (tiny change)
 
 
        * MORE.STUFF: Update eshell URL.
 
+2007-06-06  Carsten Dominik  <dominik@science.uva.nl>
+
+       * orgcard.tex: Version 4.77.
+
+2007-06-05  Michael Albinus  <michael.albinus@gmx.de>
+
+       * NEWS: Add socks.el as new package.
+
+2007-06-02  Thien-Thi Nguyen  <ttn@gnuvola.org>
+
+       * MORE.STUFF (Hideshow): Delete.
+       (EDB, Go in a buffer): Update urls.
+       Suggested by CHENG Gao <chenggao@gmail.com>.
+
 2007-06-02  Chong Yidong  <cyd@stupidchicken.com>
 
        * Version 22.1 released.
 
        * NEWS: Fix instances of `allow' without object.
 
+2007-05-22  Glenn Morris  <rgm@gnu.org>
+
+       * NEWS.22: New file with entries for Emacs 22.
+       * NEWS: Move Emacs 22 entries to new file NEWS.22, leave empty
+       template for next Emacs version.
+
+2007-05-19  Glenn Morris  <rgm@gnu.org>
+
+       * images/cancel.pbm: Convert from PGM to PBM.
+
+       * images/copy.pbm, images/next-node.pbm, images/prev-node.pbm:
+       * images/save.pbm, images/up-node.pbm: Convert from PPM to PBM.
+
 2007-05-17  Glenn Morris  <rgm@gnu.org>
 
        * PROBLEMS (Dumping): Mention OpenBSD macppc problem.
 
 2007-02-19  Kenichi Handa  <handa@m17n.org>
 
-       * NEWS (New language environmets): Add "Esperanto".
+       * NEWS (New language environments): Add "Esperanto".
 
 2007-02-16  Dale Gulledge  <dsplat@rochester.rr.com>
 
index ca9b088..0186e2b 100644 (file)
--- a/etc/DEBUG
+++ b/etc/DEBUG
@@ -64,10 +64,10 @@ use the set command until the inferior process has been started.
 Put a breakpoint early in `main', or suspend the Emacs,
 to get an opportunity to do the set command.
 
-When Emacs is running in a terminal, it is useful to use a separate terminal
-for the debug session.  This can be done by starting Emacs as usual, then
-attaching to it from gdb with the `attach' command which is explained in the
-node "Attach" of the GDB manual.
+When Emacs is running in a terminal, it is sometimes useful to use a separate
+terminal for the debug session.  This can be done by starting Emacs as usual,
+then attaching to it from gdb with the `attach' command which is explained in
+the node "Attach" of the GDB manual.
 
 ** Examining Lisp object values.
 
index bd2a457..b10fafa 100644 (file)
@@ -185,7 +185,7 @@ Several are for Debian GNU/Linux in particular.
    page: eiffel-mode.el.
 
  * Go in a buffer: Go Text Protocol client:
-   <URL:http://www.glug.org/people/ttn/software/personal-elisp/standalone/>
+   <URL:http://www.gnuvola.org/software/personal-elisp/standalone/>
    A modified version is also bundled with GNU Go:
    <URL:http://www.gnu.org/software/gnugo/gnugo.html>
 
dissimilarity index 99%
index 8e4d7f9..c70f968 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
-GNU Emacs NEWS -- history of user-visible changes.
-
-Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
-          Free Software Foundation, Inc.
-See the end of the file for license conditions.
-
-Please send Emacs bug reports to bug-gnu-emacs@gnu.org.
-If possible, use M-x report-emacs-bug.
-
-This file is about changes in Emacs version 22.
-
-See files NEWS.21, NEWS.20, NEWS.19, NEWS.18, and NEWS.1-17 for changes
-in older Emacs versions.
-
-You can narrow news to a specific version by calling `view-emacs-news'
-with a prefix argument or by typing C-u C-h C-n.
-\f
-* About external Lisp packages
-
-When you upgrade to Emacs 22 from a previous version, some older
-versions of external Lisp packages are known to behave badly.
-So in general, it is recommended that you upgrade to the latest
-versions of any external Lisp packages that you are using.
-
-You should also be aware that many Lisp packages have been included
-with Emacs 22 (see the extensive list below), and you should remove
-any older versions of these packages to ensure that the Emacs 22
-version is used.  You can use M-x list-load-path-shadows to find such
-older packages.
-
-Some specific packages that are known to cause problems are:
-
-** Semantic (used by CEDET, ECB, JDEE): upgrade to latest version.
-
-** cua.el, cua-mode.el: remove old versions.
-\f
-* Installation Changes in Emacs 22.2
-
-** Emacs is now licensed under the GNU GPL version 3 (or later).
-
-* Changes in Emacs 22.2
-
-** The values of `dired-recursive-deletes' and `dired-recursive-copies'
-have been changed to `top'.  This means that the user is asked once,
-before deleting/copying the indicated directory recursively.
-
-** In Image mode, whenever the displayed image is wider and/or higher
-than the window, the usual keys for moving the cursor cause the image
-to be scrolled horizontally or vertically instead.
-
-** Scrollbars follow the system theme on Windows XP and later.
-Windows XP introduced themed scrollbars, but applications have to take
-special steps to use them. Emacs now has the appropriate resources linked
-in to make it use the scrollbars from the system theme.
-
-* New Modes and Packages in Emacs 22.2
-
-** bibtex-style-mode helps you write BibTeX's *.bst files.
-
-** The new package css-mode.el provides a major mode for editing CSS files.
-
-** The new package vera-mode.el provides a major mode for editing Vera files.
-
-** The new package socks.el implements the SOCKS v5 protocol.
-
-** VC
-
-*** VC backends can provide completion of revision names.
-
-*** VC has some support for Mercurial (hg).
-
-*** VC has some support for Bazaar (Bzr).
-
-*** VC has some support for Git.
-
-* Lisp Changes in Emacs 22.2.
-
-** New function `window-full-width-p' returns t if a window is as wide
-as its frame.
-
-** The new function `image-refresh' refreshes all images associated
-with a given image specification.
-
-** The new function `split-string-and-unquote' does (what?)
-
-** The new function `combine-and-quote-strings' does (what?)
-\f
-* Installation Changes in Emacs 22.1
-
-** You can build Emacs with Gtk+ widgets by specifying `--with-x-toolkit=gtk'
-when you run configure.  This requires Gtk+ 2.4 or newer.  This port
-provides a way to display multilingual text in menus (with some caveats).
-
-** The Emacs Lisp Reference Manual is now part of the distribution.
-
-The Emacs Lisp Reference Manual in Info format is built as part of the
-Emacs build procedure and installed together with the Emacs User
-Manual.  A menu item was added to the menu bar to make it easily
-accessible (Help->More Manuals->Emacs Lisp Reference).
-
-** The Introduction to Programming in Emacs Lisp manual is now part of
-the distribution.
-
-This manual is now part of the standard distribution and is installed,
-together with the Emacs User Manual, into the Info directory.  A menu
-item was added to the menu bar to make it easily accessible
-(Help->More Manuals->Introduction to Emacs Lisp).
-
-** Leim is now part of the Emacs distribution.
-You no longer need to download a separate tarball in order to build
-Emacs with Leim.
-
-** Support for MacOS X was added.
-See the files mac/README and mac/INSTALL for build instructions.
-
-** Mac OS 9 port now uses the Carbon API by default.  You can also
-create a non-Carbon build by specifying `NonCarbon' as a target.  See
-the files mac/README and mac/INSTALL for build instructions.
-
-** Support for a Cygwin build of Emacs was added.
-
-** Support for GNU/Linux systems on X86-64 machines was added.
-
-** Support for GNU/Linux systems on S390 machines was added.
-
-** Support for GNU/Linux systems on Tensilica Xtensa machines was added.
-
-** Support for FreeBSD/Alpha has been added.
-
-** New translations of the Emacs Tutorial are available in the
-following languages: Brasilian Portuguese, Bulgarian, Chinese (both
-with simplified and traditional characters), French, Russian, and
-Italian.  Type `C-u C-h t' to choose one of them in case your language
-setup doesn't automatically select the right one.
-
-** New translations of the Emacs reference card are available in the
-Brasilian Portuguese and Russian.  The corresponding PostScript files
-are also included.
-
-** A French translation of the `Emacs Survival Guide' is available.
-
-** Emacs now supports new configure options `--program-prefix',
-`--program-suffix' and `--program-transform-name' that affect the names of
-installed programs.
-
-** By default, Emacs now uses a setgid helper program to update game
-scores.  The directory ${localstatedir}/games/emacs is the normal
-place for game scores to be stored.  You can control this with the
-configure option `--with-game-dir'.  The specific user that Emacs uses
-to own the game scores is controlled by `--with-game-user'.  If access
-to a game user is not available, then scores will be stored separately
-in each user's home directory.
-
-** Emacs now includes support for loading image libraries on demand.
-(Currently this feature is only used on MS Windows.)  You can configure
-the supported image types and their associated dynamic libraries by
-setting the variable `image-library-alist'.
-
-** Emacs can now be built without sound support.
-
-** Emacs Lisp source files are compressed by default if `gzip' is available.
-
-** All images used in Emacs have been consolidated in etc/images and subdirs.
-See also the changes to `find-image', documented below.
-
-** Emacs comes with a new set of icons.
-These icons are displayed on the taskbar and/or titlebar when Emacs
-runs in a graphical environment.  Source files for these icons can be
-found in etc/images/icons.  (You can't change the icons displayed by
-Emacs by changing these files directly.  On X, the icon is compiled
-into the Emacs executable; see gnu.h in the source tree.  On MS
-Windows, see nt/icons/emacs.ico.)
-
-** The `emacsserver' program has been removed, replaced with Lisp code.
-
-** The `yow' program has been removed.
-Use the corresponding Emacs feature instead.
-
-** The Emacs terminal emulation in term.el uses a different terminfo name.
-The Emacs terminal emulation in term.el now uses "eterm-color" as its
-terminfo name, since term.el now supports color.
-
-** The script etc/emacs-buffer.gdb can be used with gdb to retrieve the
-contents of buffers from a core dump and save them to files easily, should
-Emacs crash.
-
-** Building with -DENABLE_CHECKING does not automatically build with union
-types any more.  Add -DUSE_LISP_UNION_TYPE if you want union types.
-
-** When pure storage overflows while dumping, Emacs now prints how
-much pure storage it will approximately need.
-
-\f
-* Startup Changes in Emacs 22.1
-
-** Init file changes
-If the init file ~/.emacs does not exist, Emacs will try
-~/.emacs.d/init.el or ~/.emacs.d/init.elc.  Likewise, if the shell init file
-~/.emacs_SHELL is not found, Emacs will try ~/.emacs.d/init_SHELL.sh.
-
-** Emacs can now be invoked in full-screen mode on a windowed display.
-When Emacs is invoked on a window system, the new command-line options
-`--fullwidth', `--fullheight', and `--fullscreen' produce a frame
-whose width, height, or both width and height take up the entire
-screen size.  (For now, this does not work with some window managers.)
-
-** Emacs now displays a splash screen by default even if command-line
-arguments were given.  The new command-line option --no-splash
-disables the splash screen; see also the variable
-`inhibit-splash-screen' (which is also aliased as
-`inhibit-startup-message').
-
-** New user option `inhibit-startup-buffer-menu'.
-When loading many files, for instance with `emacs *', Emacs normally
-displays a buffer menu.  This option turns the buffer menu off.
-
-** New command line option -nbc or --no-blinking-cursor disables
-the blinking cursor on graphical terminals.
-
-** The option --script FILE runs Emacs in batch mode and loads FILE.
-It is useful for writing Emacs Lisp shell script files, because they
-can start with this line:
-
-   #!/usr/bin/emacs --script
-
-** The -f option, used from the command line to call a function,
-now reads arguments for the function interactively if it is
-an interactively callable function.
-
-** The option --directory DIR now modifies `load-path' immediately.
-Directories are added to the front of `load-path' in the order they
-appear on the command line.  For example, with this command line:
-
-  emacs -batch -L .. -L /tmp --eval "(require 'foo)"
-
-Emacs looks for library `foo' in the parent directory, then in /tmp, then
-in the other directories in `load-path'.  (-L is short for --directory.)
-
-** When you specify a frame size with --geometry, the size applies to
-all frames you create.  A position specified with --geometry only
-affects the initial frame.
-
-** Emacs built for MS-Windows now behaves like Emacs on X does,
-with respect to its frame position: if you don't specify a position
-(in your .emacs init file, in the Registry, or with the --geometry
-command-line option), Emacs leaves the frame position to the Windows'
-window manager.
-
-** The command line option --no-windows has been changed to
---no-window-system.  The old one still works, but is deprecated.
-
-** If the environment variable DISPLAY specifies an unreachable X display,
-Emacs will now startup as if invoked with the --no-window-system option.
-
-** Emacs now reads the standard abbrevs file ~/.abbrev_defs
-automatically at startup, if it exists.  When Emacs offers to save
-modified buffers, it saves the abbrevs too if they have changed.  It
-can do this either silently or asking for confirmation first,
-according to the value of `save-abbrevs'.
-
-** New command line option -Q or --quick.
-This is like using -q --no-site-file, but in addition it also disables
-the fancy startup screen.
-
-** New command line option -D or --basic-display.
-Disables the menu-bar, the tool-bar, the scroll-bars, tool tips, and
-the blinking cursor.
-
-** The default is now to use a bitmap as the icon.
-The command-line options --icon-type, -i have been replaced with
-options --no-bitmap-icon, -nbi to turn the bitmap icon off.
-
-** If the environment variable EMAIL is defined, Emacs now uses its value
-to compute the default value of `user-mail-address', in preference to
-concatenation of `user-login-name' with the name of your host machine.
-
-\f
-* Incompatible Editing Changes in Emacs 22.1
-
-** You can now follow links by clicking Mouse-1 on the link.
-
-See below for more details.
-
-** When the undo information of the current command gets really large
-(beyond the value of `undo-outer-limit'), Emacs discards it and warns
-you about it.
-
-** When Emacs prompts for file names, SPC no longer completes the file name.
-This is so filenames with embedded spaces could be input without the
-need to quote the space with a C-q.  The underlying changes in the
-keymaps that are active in the minibuffer are described below under
-"New keymaps for typing file names".
-
-If you want the old behavior back, put these two key bindings to your
-~/.emacs init file:
-
-  (define-key minibuffer-local-filename-completion-map
-             " " 'minibuffer-complete-word)
-  (define-key minibuffer-local-must-match-filename-map
-             " " 'minibuffer-complete-word)
-
-** The completion commands TAB, SPC and ? in the minibuffer apply only
-to the text before point.  If there is text in the buffer after point,
-it remains unchanged.
-
-** In incremental search, C-w is changed.  M-%, C-M-w and C-M-y are special.
-
-See below under "incremental search changes".
-
-** M-g is now a prefix key.
-M-g g and M-g M-g run goto-line.
-M-g n and M-g M-n run next-error (like C-x `).
-M-g p and M-g M-p run previous-error.
-
-** C-u M-g M-g switches to the most recent previous buffer,
-and goes to the specified line in that buffer.
-
-When goto-line starts to execute, if there's a number in the buffer at
-point then it acts as the default argument for the minibuffer.
-
-** M-o now is the prefix key for setting text properties;
-M-o M-o requests refontification.
-
-** C-x C-f RET (find-file), typing nothing in the minibuffer, is no longer
-a special case.
-
-Since the default input is the current directory, this has the effect
-of specifying the current directory.  Normally that means to visit the
-directory with Dired.
-
-You can get the old behavior by typing C-x C-f M-n RET, which fetches
-the actual file name into the minibuffer.
-
-** In Dired's ! command (dired-do-shell-command), `*' and `?' now
-control substitution of the file names only when they are surrounded
-by whitespace.  This means you can now use them as shell wildcards
-too.  If you want to use just plain `*' as a wildcard, type `*""'; the
-doublequotes make no difference in the shell, but they prevent
-special treatment in `dired-do-shell-command'.
-
-** The info-search bindings on C-h C-f, C-h C-k and C-h C-i
-have been moved to C-h F, C-h K and C-h S.
-
-** `apply-macro-to-region-lines' now operates on all lines that begin
-in the region, rather than on all complete lines in the region.
-
-** line-move-ignore-invisible now defaults to t.
-
-** Adaptive filling misfeature removed.
-It no longer treats `NNN.' or `(NNN)' as a prefix.
-
-** The old bindings C-M-delete and C-M-backspace have been deleted,
-since there are situations where one or the other will shut down
-the operating system or your X server.
-
-** The register compatibility key bindings (deprecated since Emacs 19)
-have been removed:
-  C-x /   point-to-register (Use: C-x r SPC)
-  C-x j   jump-to-register  (Use: C-x r j)
-  C-x x   copy-to-register  (Use: C-x r s)
-  C-x g   insert-register   (Use: C-x r i)
-
-\f
-* Editing Changes in Emacs 22.1
-
-** The max size of buffers and integers has been doubled.
-On 32bit machines, it is now 256M (i.e. 268435455).
-
-** !MEM FULL! at the start of the mode line indicates that Emacs
-cannot get any more memory for Lisp data.  This often means it could
-crash soon if you do things that use more memory.  On most systems,
-killing buffers will get out of this state.  If killing buffers does
-not make !MEM FULL! disappear, you should save your work and start
-a new Emacs.
-
-** `undo-only' does an undo which does not redo any previous undo.
-
-** Yanking text now discards certain text properties that can
-be inconvenient when you did not expect them.  The variable
-`yank-excluded-properties' specifies which ones.  Insertion
-of register contents and rectangles also discards these properties.
-
-** New command `kill-whole-line' kills an entire line at once.
-By default, it is bound to C-S-<backspace>.
-
-** M-SPC (just-one-space) when given a numeric argument N
-converts whitespace around point to N spaces.
-
-** You can now switch buffers in a cyclic order with C-x C-left
-(previous-buffer) and C-x C-right (next-buffer).  C-x left and
-C-x right can be used as well.  The functions keep a different buffer
-cycle for each frame, using the frame-local buffer list.
-
-** C-x 5 C-o displays a specified buffer in another frame
-but does not switch to that frame.  It's the multi-frame
-analogue of C-x 4 C-o.
-
-** `special-display-buffer-names' and `special-display-regexps' now
-understand two new boolean pseudo-frame-parameters `same-frame' and
-`same-window'.
-
-** New commands to operate on pairs of open and close characters:
-`insert-pair', `delete-pair', `raise-sexp'.
-
-** M-x setenv now expands environment variable references.
-
-Substrings of the form `$foo' and `${foo}' in the specified new value
-now refer to the value of environment variable foo.  To include a `$'
-in the value, use `$$'.
-
-** The default values of paragraph-start and indent-line-function have
-been changed to reflect those used in Text mode rather than those used
-in Paragraph-Indent Text mode.
-
-** The default for the paper size (variable ps-paper-type) is taken
-from the locale.
-
-** Help command changes:
-
-*** Changes in C-h bindings:
-
-C-h e displays the *Messages* buffer.
-
-C-h d runs apropos-documentation.
-
-C-h r visits the Emacs Manual in Info.
-
-C-h followed by a control character is used for displaying files
-    that do not change:
-
-C-h C-f displays the FAQ.
-C-h C-e displays the PROBLEMS file.
-
-The info-search bindings on C-h C-f, C-h C-k and C-h C-i
-have been moved to C-h F, C-h K and C-h S.
-
-C-h c, C-h k, C-h w, and C-h f now handle remapped interactive commands.
-- C-h c and C-h k report the actual command (after possible remapping)
-  run by the key sequence.
-- C-h w and C-h f on a command which has been remapped now report the
-  command it is remapped to, and the keys which can be used to run
-  that command.
-
-For example, if C-k is bound to kill-line, and kill-line is remapped
-to new-kill-line, these commands now report:
-- C-h c and C-h k C-k reports:
-  C-k runs the command new-kill-line
-- C-h w and C-h f kill-line reports:
-  kill-line is remapped to new-kill-line which is on C-k, <deleteline>
-- C-h w and C-h f new-kill-line reports:
-  new-kill-line is on C-k
-
-*** The apropos commands now accept a list of words to match.
-When more than one word is specified, at least two of those words must
-be present for an item to match.  Regular expression matching is still
-available.
-
-*** The new option `apropos-sort-by-scores' causes the matching items
-to be sorted according to their score.  The score for an item is a
-number calculated to indicate how well the item matches the words or
-regular expression that you entered to the apropos command.  The best
-match is listed first, and the calculated score is shown for each
-matching item.
-
-*** Help commands `describe-function' and `describe-key' now show function
-arguments in lowercase italics on displays that support it.  To change the
-default, customize face `help-argument-name' or redefine the function
-`help-default-arg-highlight'.
-
-*** C-h v and C-h f commands now include a hyperlink to the C source for
-variables and functions defined in C (if the C source is available).
-
-*** Help mode now only makes hyperlinks for faces when the face name is
-preceded or followed by the word `face'.  It no longer makes
-hyperlinks for variables without variable documentation, unless
-preceded by one of the words `variable' or `option'.  It now makes
-hyperlinks to Info anchors (or nodes) if the anchor (or node) name is
-enclosed in single quotes and preceded by `info anchor' or `Info
-anchor' (in addition to earlier `info node' and `Info node').  In
-addition, it now makes hyperlinks to URLs as well if the URL is
-enclosed in single quotes and preceded by `URL'.
-
-*** The new command `describe-char' (C-u C-x =) pops up a buffer with
-description various information about a character, including its
-encodings and syntax, its text properties, how to input, overlays, and
-widgets at point.  You can get more information about some of them, by
-clicking on mouse-sensitive areas or moving there and pressing RET.
-
-*** The command `list-text-properties-at' has been deleted because
-C-u C-x = gives the same information and more.
-
-*** New command `display-local-help' displays any local help at point
-in the echo area.  It is bound to `C-h .'.  It normally displays the
-same string that would be displayed on mouse-over using the
-`help-echo' property, but, in certain cases, it can display a more
-keyboard oriented alternative.
-
-*** New user option `help-at-pt-display-when-idle' allows you to
-automatically show the help provided by `display-local-help' on
-point-over, after suitable idle time.  The amount of idle time is
-determined by the user option `help-at-pt-timer-delay' and defaults
-to one second.  This feature is turned off by default.
-
-** Mark command changes:
-
-*** A prefix argument is no longer required to repeat a jump to a
-previous mark if you set `set-mark-command-repeat-pop' to t.  I.e. C-u
-C-SPC C-SPC C-SPC ... cycles through the mark ring.  Use C-u C-u C-SPC
-to set the mark immediately after a jump.
-
-*** Marking commands extend the region when invoked multiple times.
-
-If you type C-M-SPC (mark-sexp), M-@ (mark-word), M-h
-(mark-paragraph), or C-M-h (mark-defun) repeatedly, the marked region
-extends each time, so you can mark the next two sexps with M-C-SPC
-M-C-SPC, for example.  This feature also works for
-mark-end-of-sentence, if you bind that to a key.  It also extends the
-region when the mark is active in Transient Mark mode, regardless of
-the last command.  To start a new region with one of marking commands
-in Transient Mark mode, you can deactivate the active region with C-g,
-or set the new mark with C-SPC.
-
-*** Some commands do something special in Transient Mark mode when the
-mark is active--for instance, they limit their operation to the
-region.  Even if you don't normally use Transient Mark mode, you might
-want to get this behavior from a particular command.  There are two
-ways you can enable Transient Mark mode and activate the mark, for one
-command only.
-
-One method is to type C-SPC C-SPC; this enables Transient Mark mode
-and sets the mark at point.  The other method is to type C-u C-x C-x.
-This enables Transient Mark mode temporarily but does not alter the
-mark or the region.
-
-After these commands, Transient Mark mode remains enabled until you
-deactivate the mark.  That typically happens when you type a command
-that alters the buffer, but you can also deactivate the mark by typing
-C-g.
-
-*** Movement commands `beginning-of-buffer', `end-of-buffer',
-`beginning-of-defun', `end-of-defun' do not set the mark if the mark
-is already active in Transient Mark mode.
-
-*** M-h (mark-paragraph) now accepts a prefix arg.
-
-With positive arg, M-h marks the current and the following paragraphs;
-if the arg is negative, it marks the current and the preceding
-paragraphs.
-
-** Incremental Search changes:
-
-*** M-% typed in isearch mode invokes `query-replace' or
-`query-replace-regexp' (depending on search mode) with the current
-search string used as the string to replace.
-
-*** C-w in incremental search now grabs either a character or a word,
-making the decision in a heuristic way.  This new job is done by the
-command `isearch-yank-word-or-char'.  To restore the old behavior,
-bind C-w to `isearch-yank-word' in `isearch-mode-map'.
-
-*** C-y in incremental search now grabs the next line if point is already
-at the end of a line.
-
-*** C-M-w deletes and C-M-y grabs a character in isearch mode.
-Another method to grab a character is to enter the minibuffer by `M-e'
-and to type `C-f' at the end of the search string in the minibuffer.
-
-*** Vertical scrolling is now possible within incremental search.
-To enable this feature, customize the new user option
-`isearch-allow-scroll'.  User written commands which satisfy stringent
-constraints can be marked as "scrolling commands".  See the Emacs manual
-for details.
-
-*** Isearch no longer adds `isearch-resume' commands to the command
-history by default.  To enable this feature, customize the new
-user option `isearch-resume-in-command-history'.
-
-** Replace command changes:
-
-*** When used interactively, the commands `query-replace-regexp' and
-`replace-regexp' allow \,expr to be used in a replacement string,
-where expr is an arbitrary Lisp expression evaluated at replacement
-time.  `\#' in a replacement string now refers to the count of
-replacements already made by the replacement command.  All regular
-expression replacement commands now allow `\?' in the replacement
-string to specify a position where the replacement string can be
-edited for each replacement.  `query-replace-regexp-eval' is now
-deprecated since it offers no additional functionality.
-
-*** query-replace uses isearch lazy highlighting when the new user option
-`query-replace-lazy-highlight' is non-nil.
-
-*** The current match in query-replace is highlighted in new face
-`query-replace' which by default inherits from isearch face.
-
-*** New user option `query-replace-skip-read-only': when non-nil,
-`query-replace' and related functions simply ignore
-a match if part of it has a read-only property.
-
-** Local variables lists:
-
-*** If the local variables list contains any variable-value pairs that
-are not known to be safe, Emacs shows a prompt asking whether to apply
-the local variables list as a whole.  In earlier versions, a prompt
-was only issued for variables explicitly marked as risky (for the
-definition of risky variables, see `risky-local-variable-p').
-
-At the prompt, you can choose to save the contents of this local
-variables list to `safe-local-variable-values'.  This new customizable
-option is a list of variable-value pairs that are known to be safe.
-Variables can also be marked as safe with the existing
-`safe-local-variable' property (see `safe-local-variable-p').
-However, risky variables will not be added to
-`safe-local-variable-values' in this way.
-
-*** The variable `enable-local-variables' controls how local variable
-lists are handled.  t, the default, specifies the standard querying
-behavior.  :safe means use only safe values, and ignore the rest.
-:all means set all variables, whether or not they are safe.
-nil means ignore them all.  Anything else means always query.
-
-*** The variable `safe-local-eval-forms' specifies a list of forms that
-are ok to evaluate when they appear in an `eval' local variables
-specification.  Normally Emacs asks for confirmation before evaluating
-such a form, but if the form appears in this list, no confirmation is
-needed.
-
-*** If a function has a non-nil `safe-local-eval-function' property,
-that means it is ok to evaluate some calls to that function when it
-appears in an `eval' local variables specification.  If the property
-is t, then any form calling that function with constant arguments is
-ok.  If the property is a function or list of functions, they are called
-with the form as argument, and if any returns t, the form is ok to call.
-
-If the form is not "ok to call", that means Emacs asks for
-confirmation as before.
-
-*** In processing a local variables list, Emacs strips the prefix and
-suffix from every line before processing all the lines.
-
-*** Text properties in local variables.
-
-A file local variables list cannot specify a string with text
-properties--any specified text properties are discarded.
-
-** File operation changes:
-
-*** Unquoted `$' in file names do not signal an error any more when
-the corresponding environment variable does not exist.
-Instead, the `$ENVVAR' text is left as is, so that `$$' quoting
-is only rarely needed.
-
-*** C-x C-f RET, typing nothing in the minibuffer, is no longer a special case.
-
-Since the default input is the current directory, this has the effect
-of specifying the current directory.  Normally that means to visit the
-directory with Dired.
-
-*** C-x s (save-some-buffers) now offers an option `d' to diff a buffer
-against its file, so you can see what changes you would be saving.
-
-*** Auto Compression mode is now enabled by default.
-
-*** If the user visits a file larger than `large-file-warning-threshold',
-Emacs asks for confirmation.
-
-*** The commands copy-file, rename-file, make-symbolic-link and
-add-name-to-file, when given a directory as the "new name" argument,
-convert it to a file name by merging in the within-directory part of
-the existing file's name.  (This is the same convention that shell
-commands cp, mv, and ln follow.)  Thus, M-x copy-file RET ~/foo RET
-/tmp RET copies ~/foo to /tmp/foo.
-
-*** require-final-newline now has two new possible values:
-
-`visit' means add a newline (as an undoable change) if it's needed
-when visiting the file.
-
-`visit-save' means add a newline (as an undoable change) if it's
-needed when visiting the file, and also add a newline if it's needed
-when saving the file.
-
-*** The new option mode-require-final-newline controls how certain
-major modes enable require-final-newline.  Any major mode that's
-designed for a kind of file that should normally end in a newline
-sets require-final-newline based on mode-require-final-newline.
-So you can customize mode-require-final-newline to control what these
-modes do.
-
-*** When you are root, and you visit a file whose modes specify
-read-only, the Emacs buffer is now read-only too.  Type C-x C-q if you
-want to make the buffer writable.  (As root, you can in fact alter the
-file.)
-
-*** find-file-read-only visits multiple files in read-only mode,
-when the file name contains wildcard characters.
-
-*** find-alternate-file replaces the current file with multiple files,
-when the file name contains wildcard characters.  It now asks if you
-wish save your changes and not just offer to kill the buffer.
-
-*** When used interactively, `format-write-file' now asks for confirmation
-before overwriting an existing file, unless a prefix argument is
-supplied.  This behavior is analogous to `write-file'.
-
-*** The variable `auto-save-file-name-transforms' now has a third element that
-controls whether or not the function `make-auto-save-file-name' will
-attempt to construct a unique auto-save name (e.g. for remote files).
-
-*** The new option `write-region-inhibit-fsync' disables calls to fsync
-in `write-region'.  This can be useful on laptops to avoid spinning up
-the hard drive upon each file save.  Enabling this variable may result
-in data loss, use with care.
-
-** Minibuffer changes:
-
-*** The completion commands TAB, SPC and ? in the minibuffer apply only
-to the text before point.  If there is text in the buffer after point,
-it remains unchanged.
-
-*** The new file-name-shadow-mode is turned ON by default, so that when
-entering a file name, any prefix which Emacs will ignore is dimmed.
-
-*** There's a new face `minibuffer-prompt'.
-Emacs adds this face to the list of text properties stored in the
-variable `minibuffer-prompt-properties', which is used to display the
-prompt string.
-
-*** Enhanced visual feedback in `*Completions*' buffer.
-
-Completions lists use faces to highlight what all completions
-have in common and where they begin to differ.
-
-The common prefix shared by all possible completions uses the face
-`completions-common-part', while the first character that isn't the
-same uses the face `completions-first-difference'.  By default,
-`completions-common-part' inherits from `default', and
-`completions-first-difference' inherits from `bold'.  The idea of
-`completions-common-part' is that you can use it to make the common
-parts less visible than normal, so that the rest of the differing
-parts is, by contrast, slightly highlighted.
-
-Above fontification is always done when listing completions is
-triggered at minibuffer.  If you want to fontify completions whose
-listing is triggered at the other normal buffer, you have to pass
-the common prefix of completions to `display-completion-list' as
-its second argument.
-
-*** File-name completion can now ignore specified directories.
-If an element of the list in `completion-ignored-extensions' ends in a
-slash `/', it indicates a subdirectory that should be ignored when
-completing file names.  Elements of `completion-ignored-extensions'
-which do not end in a slash are never considered when a completion
-candidate is a directory.
-
-*** New user option `history-delete-duplicates'.
-If set to t when adding a new history element, all previous identical
-elements are deleted from the history list.
-
-** Redisplay changes:
-
-*** The new face `mode-line-inactive' is used to display the mode line
-of non-selected windows.  The `mode-line' face is now used to display
-the mode line of the currently selected window.
-
-The new variable `mode-line-in-non-selected-windows' controls whether
-the `mode-line-inactive' face is used.
-
-*** The mode line position information now comes before the major mode.
-When the file is maintained under version control, that information
-appears between the position information and the major mode.
-
-*** You can now customize the use of window fringes.  To control this
-for all frames, use M-x fringe-mode or the Show/Hide submenu of the
-top-level Options menu, or customize the `fringe-mode' variable.  To
-control this for a specific frame, use the command M-x
-set-fringe-style.
-
-*** Angle icons in the fringes can indicate the buffer boundaries.  In
-addition, up and down arrow bitmaps in the fringe indicate which ways
-the window can be scrolled.
-
-This behavior is activated by setting the buffer-local variable
-`indicate-buffer-boundaries' to a non-nil value.  The default value of
-this variable is found in `default-indicate-buffer-boundaries'.
-
-If value is `left' or `right', both angle and arrow bitmaps are
-displayed in the left or right fringe, resp.
-
-The value can also be an alist which specifies the presence and
-position of each bitmap individually.
-
-For example, ((top . left) (t .  right)) places the top angle bitmap
-in left fringe, the bottom angle bitmap in right fringe, and both
-arrow bitmaps in right fringe.  To show just the angle bitmaps in the
-left fringe, but no arrow bitmaps, use ((top . left) (bottom . left)).
-
-*** On window systems, lines which are exactly as wide as the window
-(not counting the final newline character) are no longer broken into
-two lines on the display (with just the newline on the second line).
-Instead, the newline now "overflows" into the right fringe, and the
-cursor will be displayed in the fringe when positioned on that newline.
-
-The new user option 'overflow-newline-into-fringe' can be set to nil to
-revert to the old behavior of continuing such lines.
-
-*** A window can now have individual fringe and scroll-bar settings,
-in addition to the individual display margin settings.
-
-Such individual settings are now preserved when windows are split
-horizontally or vertically, a saved window configuration is restored,
-or when the frame is resized.
-
-*** When a window has display margin areas, the fringes are now
-displayed between the margins and the buffer's text area, rather than
-outside those margins.
-
-*** New face `escape-glyph' highlights control characters and escape glyphs.
-
-*** Non-breaking space and hyphens are now displayed with a special
-face, either nobreak-space or escape-glyph.  You can turn this off or
-specify a different mode by setting the variable `nobreak-char-display'.
-
-*** The parameters of automatic hscrolling can now be customized.
-The variable `hscroll-margin' determines how many columns away from
-the window edge point is allowed to get before automatic hscrolling
-will horizontally scroll the window.  The default value is 5.
-
-The variable `hscroll-step' determines how many columns automatic
-hscrolling scrolls the window when point gets too close to the
-window edge.  If its value is zero, the default, Emacs scrolls the
-window so as to center point.  If its value is an integer, it says how
-many columns to scroll.  If the value is a floating-point number, it
-gives the fraction of the window's width to scroll the window.
-
-The variable `automatic-hscrolling' was renamed to
-`auto-hscroll-mode'.  The old name is still available as an alias.
-
-*** Moving or scrolling through images (and other lines) taller than
-the window now works sensibly, by automatically adjusting the window's
-vscroll property.
-
-*** Preemptive redisplay now adapts to current load and bandwidth.
-
-To avoid preempting redisplay on fast computers, networks, and displays,
-the arrival of new input is now performed at regular intervals during
-redisplay.  The new variable `redisplay-preemption-period' specifies
-the period; the default is to check for input every 0.1 seconds.
-
-*** The %c and %l constructs are now ignored in frame-title-format.
-Due to technical limitations in how Emacs interacts with windowing
-systems, these constructs often failed to render properly, and could
-even cause Emacs to crash.
-
-*** If value of `auto-resize-tool-bars' is `grow-only', the tool bar
-will expand as needed, but not contract automatically.  To contract
-the tool bar, you must type C-l.
-
-*** New customize option `overline-margin' controls the space between
-overline and text.
-
-*** New variable `x-underline-at-descent-line' controls the relative
-position of the underline.  When set, it overrides the
-`x-use-underline-position-properties' variables.
-
-** New faces:
-
-*** `mode-line-highlight' is the standard face indicating mouse sensitive
-elements on mode-line (and header-line) like `highlight' face on text
-areas.
-
-*** `mode-line-buffer-id' is the standard face for buffer identification
-parts of the mode line.
-
-*** `shadow' face defines the appearance of the "shadowed" text, i.e.
-the text which should be less noticeable than the surrounding text.
-This can be achieved by using shades of grey in contrast with either
-black or white default foreground color.  This generic shadow face
-allows customization of the appearance of shadowed text in one place,
-so package-specific faces can inherit from it.
-
-*** `vertical-border' face is used for the vertical divider between windows.
-
-** Font-Lock (syntax highlighting) changes:
-
-*** All modes now support using M-x font-lock-mode to toggle
-fontification, even those such as Occur, Info, and comint-derived
-modes that do their own fontification in a special way.
-
-The variable `Info-fontify' is no longer applicable; to disable
-fontification in Info, remove `turn-on-font-lock' from
-`Info-mode-hook'.
-
-*** New standard font-lock face `font-lock-comment-delimiter-face'.
-
-*** New standard font-lock face `font-lock-preprocessor-face'.
-
-*** Easy to overlook single character negation can now be font-locked.
-You can use the new variable `font-lock-negation-char-face' and the face of
-the same name to customize this.  Currently the cc-modes, sh-script-mode,
-cperl-mode and make-mode support this.
-
-*** Font-Lock mode: in major modes such as Lisp mode, where some Emacs
-features assume that an open-paren in column 0 is always outside of
-any string or comment, Font-Lock now highlights any such open-paren in
-bold-red if it is inside a string or a comment, to indicate that it
-can cause trouble.  You should rewrite the string or comment so that
-the open-paren is not in column 0.
-
-*** M-o now is the prefix key for setting text properties;
-M-o M-o requests refontification.
-
-*** The default settings for JIT stealth lock parameters are changed.
-The default value for the user option jit-lock-stealth-time is now nil
-instead of 3.  This setting of jit-lock-stealth-time disables stealth
-fontification: on today's machines, it may be a bug in font lock
-patterns if fontification otherwise noticeably degrades interactivity.
-If you find movement in infrequently visited buffers sluggish (and the
-major mode maintainer has no better idea), customizing
-jit-lock-stealth-time to a non-nil value will let Emacs fontify
-buffers in the background when it considers the system to be idle.
-jit-lock-stealth-nice is now 0.5 instead of 0.125 which is supposed to
-cause less load than the old defaults.
-
-*** jit-lock can now be delayed with `jit-lock-defer-time'.
-
-If this variable is non-nil, its value should be the amount of Emacs
-idle time in seconds to wait before starting fontification.  For
-example, if you set `jit-lock-defer-time' to 0.25, fontification will
-only happen after 0.25s of idle time.
-
-*** contextual refontification is now separate from stealth fontification.
-
-jit-lock-defer-contextually is renamed jit-lock-contextually and
-jit-lock-context-time determines the delay after which contextual
-refontification takes place.
-
-*** lazy-lock is considered obsolete.
-
-The `lazy-lock' package is superseded by `jit-lock' and is considered
-obsolete.  `jit-lock' is activated by default; if you wish to continue
-using `lazy-lock', activate it in your ~/.emacs like this:
-  (setq font-lock-support-mode 'lazy-lock-mode)
-
-If you invoke `lazy-lock-mode' directly rather than through
-`font-lock-support-mode', it now issues a warning:
-  "Use font-lock-support-mode rather than calling lazy-lock-mode"
-
-** Menu support:
-
-*** A menu item "Show/Hide" was added to the top-level menu "Options".
-This menu allows you to turn various display features on and off (such
-as the fringes, the tool bar, the speedbar, and the menu bar itself).
-You can also move the vertical scroll bar to either side here or turn
-it off completely.  There is also a menu-item to toggle displaying of
-current date and time, current line and column number in the mode-line.
-
-*** Speedbar has moved from the "Tools" top level menu to "Show/Hide".
-
-*** The menu item "Open File..." has been split into two items, "New File..."
-and "Open File...".  "Open File..." now opens only existing files.  This is
-to support existing GUI file selection dialogs better.
-
-*** The file selection dialog for Gtk+, Mac, W32 and Motif/LessTif can be
-disabled by customizing the variable `use-file-dialog'.
-
-*** The pop up menus for Lucid now stay up if you do a fast click and can
-be navigated with the arrow keys (like Gtk+, Mac and W32).
-
-*** The menu bar for Motif/LessTif/Lucid/Gtk+ can be navigated with keys.
-Pressing F10 shows the first menu in the menu bar.  Navigation is done with
-the arrow keys, select with the return key and cancel with the escape keys.
-
-*** The Lucid menus can display multilingual text in your locale.  You have
-to explicitly specify a fontSet resource for this to work, for example
-`-xrm "Emacs*fontSet:  -*-helvetica-medium-r-*--*-120-*-*-*-*-*-*,*"'.
-
-*** Dialogs for Lucid/Athena and LessTif/Motif now pop down on pressing
-ESC, like they do for Gtk+, Mac and W32.
-
-*** For the Gtk+ version, you can make Emacs use the old file dialog
-by setting the variable `x-gtk-use-old-file-dialog' to t.  Default is to use
-the new dialog.
-
-*** You can exit dialog windows and menus by typing C-g.
-
-** Buffer Menu changes:
-
-*** The new options `buffers-menu-show-directories' and
-`buffers-menu-show-status' let you control how buffers are displayed
-in the menu dropped down when you click "Buffers" from the menu bar.
-
-`buffers-menu-show-directories' controls whether the menu displays
-leading directories as part of the file name visited by the buffer.
-If its value is `unless-uniquify', the default, directories are
-shown unless uniquify-buffer-name-style' is non-nil.  The value of nil
-and t turn the display of directories off and on, respectively.
-
-`buffers-menu-show-status' controls whether the Buffers menu includes
-the modified and read-only status of the buffers.  By default it is
-t, and the status is shown.
-
-Setting these variables directly does not take effect until next time
-the Buffers menu is regenerated.
-
-*** New command `Buffer-menu-toggle-files-only' toggles display of file
-buffers only in the Buffer Menu.  It is bound to T in Buffer Menu
-mode.
-
-*** `buffer-menu' and `list-buffers' now list buffers whose names begin
-with a space, when those buffers are visiting files.  Normally buffers
-whose names begin with space are omitted.
-
-** Mouse changes:
-
-*** You can now follow links by clicking Mouse-1 on the link.
-
-Traditionally, Emacs uses a Mouse-1 click to set point and a Mouse-2
-click to follow a link, whereas most other applications use a Mouse-1
-click for both purposes, depending on whether you click outside or
-inside a link.  Now the behavior of a Mouse-1 click has been changed
-to match this context-sensitive dual behavior.  (If you prefer the old
-behavior, set the user option `mouse-1-click-follows-link' to nil.)
-
-Depending on the current mode, a Mouse-2 click in Emacs can do much
-more than just follow a link, so the new Mouse-1 behavior is only
-activated for modes which explicitly mark a clickable text as a "link"
-(see the new function `mouse-on-link-p' for details).  The Lisp
-packages that are included in release 22.1 have been adapted to do
-this, but external packages may not yet support this.  However, there
-is no risk in using such packages, as the worst thing that could
-happen is that you get the original Mouse-1 behavior when you click
-on a link, which typically means that you set point where you click.
-
-If you want to get the original Mouse-1 action also inside a link, you
-just need to press the Mouse-1 button a little longer than a normal
-click (i.e. press and hold the Mouse-1 button for half a second before
-you release it).
-
-Dragging the Mouse-1 inside a link still performs the original
-drag-mouse-1 action, typically copy the text.
-
-You can customize the new Mouse-1 behavior via the new user options
-`mouse-1-click-follows-link' and `mouse-1-click-in-non-selected-windows'.
-
-*** If you set the new variable `mouse-autoselect-window' to a non-nil
-value, windows are automatically selected as you move the mouse from
-one Emacs window to another, even within a frame.  A minibuffer window
-can be selected only when it is active.
-
-*** On X, when the window manager requires that you click on a frame to
-select it (give it focus), the selected window and cursor position
-normally changes according to the mouse click position.  If you set
-the variable x-mouse-click-focus-ignore-position to t, the selected
-window and cursor position do not change when you click on a frame
-to give it focus.
-
-*** Emacs normally highlights mouse sensitive text whenever the mouse
-is over the text.  By setting the new variable `mouse-highlight', you
-can optionally enable mouse highlighting only after you move the
-mouse, so that highlighting disappears when you press a key.  You can
-also disable mouse highlighting.
-
-*** You can now customize if selecting a region by dragging the mouse
-shall not copy the selected text to the kill-ring by setting the new
-variable mouse-drag-copy-region to nil.
-
-*** Under X, mouse-wheel-mode is turned on by default.
-
-*** Emacs ignores mouse-2 clicks while the mouse wheel is being moved.
-
-People tend to push the mouse wheel (which counts as a mouse-2 click)
-unintentionally while turning the wheel, so these clicks are now
-ignored.  You can customize this with the mouse-wheel-click-event and
-mouse-wheel-inhibit-click-time variables.
-
-*** mouse-wheels can now scroll a specific fraction of the window
-(rather than a fixed number of lines) and the scrolling is `progressive'.
-
-** Multilingual Environment (Mule) changes:
-
-*** You can disable character translation for a file using the -*-
-construct.  Include `enable-character-translation: nil' inside the
--*-...-*- to disable any character translation that may happen by
-various global and per-coding-system translation tables.  You can also
-specify it in a local variable list at the end of the file.  For
-shortcut, instead of using this long variable name, you can append the
-character "!" at the end of coding-system name specified in -*-
-construct or in a local variable list.  For example, if a file has the
-following header, it is decoded by the coding system `iso-latin-1'
-without any character translation:
-;; -*- coding: iso-latin-1!; -*-
-
-*** Language environment and various default coding systems are setup
-more correctly according to the current locale name.  If the locale
-name doesn't specify a charset, the default is what glibc defines.
-This change can result in using the different coding systems as
-default in some locale (e.g. vi_VN).
-
-*** The keyboard-coding-system is now automatically set based on your
-current locale settings if you are not using a window system.  This
-can mean that the META key doesn't work but generates non-ASCII
-characters instead, depending on how the terminal (or terminal
-emulator) works.  Use `set-keyboard-coding-system' (or customize
-keyboard-coding-system) if you prefer META to work (the old default)
-or if the locale doesn't describe the character set actually generated
-by the keyboard.  See Info node `Unibyte Mode'.
-
-*** The new command `set-file-name-coding-system' (C-x RET F) sets
-coding system for encoding and decoding file names.  A new menu item
-(Options->Mule->Set Coding Systems->For File Name) invokes this
-command.
-
-*** The new command `revert-buffer-with-coding-system' (C-x RET r)
-revisits the current file using a coding system that you specify.
-
-*** New command `recode-region' decodes the region again by a specified
-coding system.
-
-*** The new command `recode-file-name' changes the encoding of the name
-of a file.
-
-*** New command `ucs-insert' inserts a character specified by its
-unicode.
-
-*** New command quail-show-key shows what key (or key sequence) to type
-in the current input method to input a character at point.
-
-*** Limited support for character `unification' has been added.
-Emacs now knows how to translate between different representations of
-the same characters in various Emacs charsets according to standard
-Unicode mappings.  This applies mainly to characters in the ISO 8859
-sets plus some other 8-bit sets, but can be extended.  For instance,
-translation works amongst the Emacs ...-iso8859-... charsets and the
-mule-unicode-... ones.
-
-By default this translation happens automatically on encoding.
-Self-inserting characters are translated to make the input conformant
-with the encoding of the buffer in which it's being used, where
-possible.
-
-You can force a more complete unification with the user option
-unify-8859-on-decoding-mode.  That maps all the Latin-N character sets
-into Unicode characters (from the latin-iso8859-1 and
-mule-unicode-0100-24ff charsets) on decoding.  Note that this mode
-will often effectively clobber data with an iso-2022 encoding.
-
-*** New language environments (set up automatically according to the
-locale): Belarusian, Bulgarian, Chinese-EUC-TW, Croatian, Esperanto,
-French, Georgian, Italian, Latin-7, Latvian, Lithuanian, Malayalam,
-Russian, Russian, Slovenian, Swedish, Tajik, Tamil, UTF-8,Ukrainian,
-Welsh,Latin-6, Windows-1255.
-
-*** New input methods: latin-alt-postfix, latin-postfix, latin-prefix,
-belarusian, bulgarian-bds, bulgarian-phonetic, chinese-sisheng (for
-Chinese Pinyin characters), croatian, dutch, georgian, latvian-keyboard,
-lithuanian-numeric, lithuanian-keyboard, malayalam-inscript, rfc1345,
-russian-computer, sgml, slovenian, tamil-inscript, ukrainian-computer,
-ucs, vietnamese-telex, welsh.
-
-*** There is support for decoding Greek and Cyrillic characters into
-either Unicode (the mule-unicode charsets) or the iso-8859 charsets,
-when possible.  The latter are more space-efficient.
-  This is controlled by user option utf-fragment-on-decoding.
-
-*** Improved Thai support.  A new minor mode `thai-word-mode' (which is
-automatically activated if you select Thai as a language
-environment) changes key bindings of most word-oriented commands to
-versions which recognize Thai words.  Affected commands are
-    M-f     (forward-word)
-    M-b     (backward-word)
-    M-d     (kill-word)
-    M-DEL   (backward-kill-word)
-    M-t     (transpose-words)
-    M-q     (fill-paragraph)
-
-*** Indian support has been updated.
-The in-is13194 coding system is now Unicode-based.  CDAC fonts are
-assumed.  There is a framework for supporting various Indian scripts,
-but currently only Devanagari, Malayalam and Tamil are supported.
-
-*** The utf-8/16 coding systems have been enhanced.
-By default, untranslatable utf-8 sequences are simply composed into
-single quasi-characters.  User option `utf-translate-cjk-mode' (it is
-turned on by default) arranges to translate many utf-8 CJK character
-sequences into real Emacs characters in a similar way to the Mule-UCS
-system.  As this loads a fairly big data on demand, people who are not
-interested in CJK characters may want to customize it to nil.
-You can augment/amend the CJK translation via hash tables
-`ucs-mule-cjk-to-unicode' and `ucs-unicode-to-mule-cjk'.  The utf-8
-coding system now also encodes characters from most of Emacs's
-one-dimensional internal charsets, specifically the ISO-8859 ones.
-The utf-16 coding system is affected similarly.
-
-*** A UTF-7 coding system is available in the library `utf-7'.
-
-*** A new coding system `euc-tw' has been added for traditional Chinese
-in CNS encoding; it accepts both Big 5 and CNS as input; on saving,
-Big 5 is then converted to CNS.
-
-*** Many new coding systems are available in the `code-pages' library.
-These include complete versions of most of those in codepage.el, based
-on Unicode mappings.  `codepage-setup' is now obsolete and is used
-only in the MS-DOS port of Emacs.  All coding systems defined in
-`code-pages' are auto-loaded.
-
-*** New variable `utf-translate-cjk-unicode-range' controls which
-Unicode characters to translate in `utf-translate-cjk-mode'.
-
-*** iso-10646-1 (`Unicode') fonts can be used to display any range of
-characters encodable by the utf-8 coding system.  Just specify the
-fontset appropriately.
-
-** Customize changes:
-
-*** Custom themes are collections of customize options.  Create a
-custom theme with M-x customize-create-theme.  Use M-x load-theme to
-load and enable a theme, and M-x disable-theme to disable it.  Use M-x
-enable-theme to enable a disabled theme.
-
-*** The commands M-x customize-face and M-x customize-face-other-window
-now look at the character after point.  If a face or faces are
-specified for that character, the commands by default customize those
-faces.
-
-*** The face-customization widget has been reworked to be less confusing.
-In particular, when you enable a face attribute using the corresponding
-check-box, there's no longer a redundant `*' option in value selection
-for that attribute; the values you can choose are only those which make
-sense for the attribute.  When an attribute is de-selected by unchecking
-its check-box, then the (now ignored, but still present temporarily in
-case you re-select the attribute) value is hidden.
-
-*** When you set or reset a variable's value in a Customize buffer,
-the previous value becomes the "backup value" of the variable.
-You can go back to that backup value by selecting "Use Backup Value"
-under the "[State]" button.
-
-** Dired mode:
-
-*** In Dired's ! command (dired-do-shell-command), `*' and `?' now
-control substitution of the file names only when they are surrounded
-by whitespace.  This means you can now use them as shell wildcards
-too.  If you want to use just plain `*' as a wildcard, type `*""'; the
-double quotes make no difference in the shell, but they prevent
-special treatment in `dired-do-shell-command'.
-
-*** The Dired command `dired-goto-file' is now bound to j, not M-g.
-This is to avoid hiding the global key binding of M-g.
-
-*** New faces dired-header, dired-mark, dired-marked, dired-flagged,
-dired-ignored, dired-directory, dired-symlink, dired-warning
-introduced for Dired mode instead of font-lock faces.
-
-*** New Dired command `dired-compare-directories' marks files
-with different file attributes in two dired buffers.
-
-*** New Dired command `dired-do-touch' (bound to T) changes timestamps
-of marked files with the value entered in the minibuffer.
-
-*** In Dired, the w command now stores the current line's file name
-into the kill ring.  With a zero prefix arg, it stores the absolute file name.
-
-*** In Dired-x, Omitting files is now a minor mode, dired-omit-mode.
-
-The mode toggling command is bound to M-o.  A new command
-dired-mark-omitted, bound to * O, marks omitted files.  The variable
-dired-omit-files-p is obsoleted, use the mode toggling function
-instead.
-
-*** The variables dired-free-space-program and dired-free-space-args
-have been renamed to directory-free-space-program and
-directory-free-space-args, and they now apply whenever Emacs puts a
-directory listing into a buffer.
-
-** Comint changes:
-
-*** The new INSIDE_EMACS environment variable is set to "t" in subshells
-running inside Emacs.  This supersedes the EMACS environment variable,
-which will be removed in a future Emacs release.  Programs that need
-to know whether they are started inside Emacs should check INSIDE_EMACS
-instead of EMACS.
-
-*** The comint prompt can now be made read-only, using the new user
-option `comint-prompt-read-only'.  This is not enabled by default,
-except in IELM buffers.  The read-only status of IELM prompts can be
-controlled with the new user option `ielm-prompt-read-only', which
-overrides `comint-prompt-read-only'.
-
-The new commands `comint-kill-whole-line' and `comint-kill-region'
-support editing comint buffers with read-only prompts.
-
-`comint-kill-whole-line' is like `kill-whole-line', but ignores both
-read-only and field properties.  Hence, it always kill entire
-lines, including any prompts.
-
-`comint-kill-region' is like `kill-region', except that it ignores
-read-only properties, if it is safe to do so.  This means that if any
-part of a prompt is deleted, then the entire prompt must be deleted
-and that all prompts must stay at the beginning of a line.  If this is
-not the case, then `comint-kill-region' behaves just like
-`kill-region' if read-only properties are involved: it copies the text
-to the kill-ring, but does not delete it.
-
-*** The new command `comint-insert-previous-argument' in comint-derived
-modes (shell-mode, etc.) inserts arguments from previous command lines,
-like bash's `ESC .' binding.  It is bound by default to `C-c .', but
-otherwise behaves quite similarly to the bash version.
-
-*** `comint-use-prompt-regexp-instead-of-fields' has been renamed
-`comint-use-prompt-regexp'.  The old name has been kept as an alias,
-but declared obsolete.
-
-** M-x Compile changes:
-
-*** M-x compile has become more robust and reliable
-
-Quite a few more kinds of messages are recognized.  Messages that are
-recognized as warnings or informational come in orange or green, instead of
-red.  Informational messages are by default skipped with `next-error'
-(controlled by `compilation-skip-threshold').
-
-Location data is collected on the fly as the *compilation* buffer changes.
-This means you could modify messages to make them point to different files.
-This also means you can not go to locations of messages you may have deleted.
-
-The variable `compilation-error-regexp-alist' has now become customizable.  If
-you had added your own regexps to this, you'll probably need to include a
-leading `^', otherwise they'll match anywhere on a line.  There is now also a
-`compilation-mode-font-lock-keywords' and it nicely handles all the checks
-that configure outputs and -o options so you see at a glance where you are.
-
-The new file etc/compilation.txt gives examples of each type of message.
-
-*** New user option `compilation-environment'.
-This option allows you to specify environment variables for inferior
-compilation processes without affecting the environment that all
-subprocesses inherit.
-
-*** New user option `compilation-disable-input'.
-If this is non-nil, send end-of-file as compilation process input.
-
-*** New options `next-error-highlight' and `next-error-highlight-no-select'
-specify the method of highlighting of the corresponding source line
-in new face `next-error'.
-
-*** A new minor mode `next-error-follow-minor-mode' can be used in
-compilation-mode, grep-mode, occur-mode, and diff-mode (i.e. all the
-modes that can use `next-error').  In this mode, cursor motion in the
-buffer causes automatic display in another window of the corresponding
-matches, compilation errors, etc.  This minor mode can be toggled with
-C-c C-f.
-
-*** When the left fringe is displayed, an arrow points to current message in
-the compilation buffer.
-
-*** The new variable `compilation-context-lines' controls lines of leading
-context before the current message.  If nil and the left fringe is displayed,
-it doesn't scroll the compilation output window.  If there is no left fringe,
-no arrow is displayed and a value of nil means display the message at the top
-of the window.
-
-** Occur mode changes:
-
-*** The new command `multi-occur' is just like `occur', except it can
-search multiple buffers.  There is also a new command
-`multi-occur-in-matching-buffers' which allows you to specify the
-buffers to search by their filenames or buffer names.  Internally,
-Occur mode has been rewritten, and now uses font-lock, among other
-changes.
-
-*** You can now use next-error (C-x `) and previous-error to advance to
-the next/previous matching line found by M-x occur.
-
-*** In the *Occur* buffer, `o' switches to it in another window, and
-C-o displays the current line's occurrence in another window without
-switching to it.
-
-** Grep changes:
-
-*** Grep has been decoupled from compilation mode setup.
-
-There's a new separate package grep.el, with its own submenu and
-customization group.
-
-*** `grep-find' is now also available under the name `find-grep' where
-people knowing `find-grep-dired' would probably expect it.
-
-*** New commands `lgrep' (local grep) and `rgrep' (recursive grep) are
-more user-friendly versions of `grep' and `grep-find', which prompt
-separately for the regular expression to match, the files to search,
-and the base directory for the search.  Case sensitivity of the
-search is controlled by the current value of `case-fold-search'.
-
-These commands build the shell commands based on the new variables
-`grep-template' (lgrep) and `grep-find-template' (rgrep).
-
-The files to search can use aliases defined in `grep-files-aliases'.
-
-Subdirectories listed in `grep-find-ignored-directories' such as those
-typically used by various version control systems, like CVS and arch,
-are automatically skipped by `rgrep'.
-
-*** The grep commands provide highlighting support.
-
-Hits are fontified in green, and hits in binary files in orange.  Grep buffers
-can be saved and automatically revisited.
-
-*** New option `grep-highlight-matches' highlights matches in *grep*
-buffer.  It uses a special feature of some grep programs which accept
---color option to output markers around matches.  When going to the next
-match with `next-error' the exact match is highlighted in the source
-buffer.  Otherwise, if `grep-highlight-matches' is nil, the whole
-source line is highlighted.
-
-*** New key bindings in grep output window:
-SPC and DEL scrolls window up and down.  C-n and C-p moves to next and
-previous match in the grep window.  RET jumps to the source line of
-the current match.  `n' and `p' shows next and previous match in
-other window, but does not switch buffer.  `{' and `}' jumps to the
-previous or next file in the grep output.  TAB also jumps to the next
-file.
-
-*** M-x grep now tries to avoid appending `/dev/null' to the command line
-by using GNU grep `-H' option instead.  M-x grep automatically
-detects whether this is possible or not the first time it is invoked.
-When `-H' is used, the grep command line supplied by the user is passed
-unchanged to the system to execute, which allows more complicated
-command lines to be used than was possible before.
-
-*** The new variables `grep-window-height' and `grep-scroll-output' override
-the corresponding compilation mode settings, for grep commands only.
-
-** Cursor display changes:
-
-*** Emacs can produce an underscore-like (horizontal bar) cursor.
-The underscore cursor is set by putting `(cursor-type . hbar)' in
-default-frame-alist.  It supports variable heights, like the `bar'
-cursor does.
-
-*** The variable `cursor-in-non-selected-windows' can now be set to any
-of the recognized cursor types.
-
-*** Display of hollow cursors now obeys the buffer-local value (if any)
-of `cursor-in-non-selected-windows' in the buffer that the cursor
-appears in.
-
-*** On text terminals, the variable `visible-cursor' controls whether Emacs
-uses the "very visible" cursor (the default) or the normal cursor.
-
-*** The X resource cursorBlink can be used to turn off cursor blinking.
-
-*** On X, MS Windows, and Mac OS, the blinking cursor's "off" state is
-now controlled by the variable `blink-cursor-alist'.
-
-** X Windows Support:
-
-*** Emacs now supports drag and drop for X.  Dropping a file on a window
-opens it, dropping text inserts the text.  Dropping a file on a dired
-buffer copies or moves the file to that directory.
-
-*** Under X11, it is possible to swap Alt and Meta (and Super and Hyper).
-The new variables `x-alt-keysym', `x-hyper-keysym', `x-meta-keysym',
-and `x-super-keysym' can be used to choose which keysyms Emacs should
-use for the modifiers.  For example, the following two lines swap
-Meta and Alt:
-    (setq x-alt-keysym 'meta)
-    (setq x-meta-keysym 'alt)
-
-*** The X resource useXIM can be used to turn off use of XIM, which can
-speed up Emacs with slow networking to the X server.
-
-If the configure option `--without-xim' was used to turn off use of
-XIM by default, the X resource useXIM can be used to turn it on.
-
-*** The new variable `x-select-request-type' controls how Emacs
-requests X selection.  The default value is nil, which means that
-Emacs requests X selection with types COMPOUND_TEXT and UTF8_STRING,
-and use the more appropriately result.
-
-*** The scrollbar under LessTif or Motif has a smoother drag-scrolling.
-On the other hand, the size of the thumb does not represent the actual
-amount of text shown any more (only a crude approximation of it).
-
-** Xterm support:
-
-*** If you enable Xterm Mouse mode, Emacs will respond to mouse clicks
-on the mode line, header line and display margin, when run in an xterm.
-
-*** Improved key bindings support when running in an xterm.
-When Emacs is running in an xterm more key bindings are available.
-The following should work:
-{C,S,C-S,A}-{right,left,up,down,prior,next,delete,insert,F1-12}.
-These key bindings work on xterm from X.org 6.8 (and later versions),
-they might not work on some older versions of xterm, or on some
-proprietary versions.
-The various keys generated by xterm when the "modifyOtherKeys"
-resource is set are also supported.
-
-** Character terminal color support changes:
-
-*** The new command-line option --color=MODE lets you specify a standard
-mode for a tty color support.  It is meant to be used on character
-terminals whose capabilities are not set correctly in the terminal
-database, or with terminal emulators which support colors, but don't
-set the TERM environment variable to a name of a color-capable
-terminal.  "emacs --color" uses the same color commands as GNU `ls'
-when invoked with "ls --color", so if your terminal can support colors
-in "ls --color", it will support "emacs --color" as well.  See the
-user manual for the possible values of the MODE parameter.
-
-*** Emacs now supports several character terminals which provide more
-than 8 colors.  For example, for `xterm', 16-color, 88-color, and
-256-color modes are supported.  Emacs automatically notes at startup
-the extended number of colors, and defines the appropriate entries for
-all of these colors.
-
-*** Emacs now uses the full range of available colors for the default
-faces when running on a color terminal, including 16-, 88-, and
-256-color xterms.  This means that when you run "emacs -nw" on an
-88-color or 256-color xterm, you will see essentially the same face
-colors as on X.
-
-*** There's a new support for colors on `rxvt' terminal emulator.
-
-** ebnf2ps changes:
-
-*** New option `ebnf-arrow-extra-width' which specify extra width for arrow
-shape drawing.
-The extra width is used to avoid that the arrowhead and the terminal border
-overlap.  It depends on `ebnf-arrow-shape' and `ebnf-line-width'.
-
-*** New option `ebnf-arrow-scale' which specify the arrow scale.
-Values lower than 1.0, shrink the arrow.
-Values greater than 1.0, expand the arrow.
-\f
-* New Modes and Packages in Emacs 22.1
-
-** CUA mode is now part of the Emacs distribution.
-
-The new cua package provides CUA-like keybindings using C-x for
-cut (kill), C-c for copy, C-v for paste (yank), and C-z for undo.
-With cua, the region can be set and extended using shifted movement
-keys (like pc-selection-mode) and typed text replaces the active
-region (like delete-selection-mode).  Do not enable these modes with
-cua-mode.  Customize the variable `cua-mode' to enable cua.
-
-The cua-selection-mode enables the CUA keybindings for the region but
-does not change the bindings for C-z/C-x/C-c/C-v. It can be used as a
-replacement for pc-selection-mode.
-
-In addition, cua provides unified rectangle support with visible
-rectangle highlighting: Use C-return to start a rectangle, extend it
-using the movement commands (or mouse-3), and cut or copy it using C-x
-or C-c (using C-w and M-w also works).
-
-Use M-o and M-c to `open' or `close' the rectangle, use M-b or M-f, to
-fill it with blanks or another character, use M-u or M-l to upcase or
-downcase the rectangle, use M-i to increment the numbers in the
-rectangle, use M-n to fill the rectangle with a numeric sequence (such
-as 10 20 30...), use M-r to replace a regexp in the rectangle, and use
-M-' or M-/ to restrict command on the rectangle to a subset of the
-rows.  See the commentary in cua-base.el for more rectangle commands.
-
-Cua also provides unified support for registers:  Use a numeric
-prefix argument between 0 and 9, i.e. M-0 .. M-9, for C-x, C-c, and
-C-v to cut or copy into register 0-9, or paste from register 0-9.
-
-The last text deleted (not killed) is automatically stored in
-register 0.  This includes text deleted by typing text.
-
-Finally, cua provides a global mark which is set using S-C-space.
-When the global mark is active, any text which is cut or copied is
-automatically inserted at the global mark position.  See the
-commentary in cua-base.el for more global mark related commands.
-
-The features of cua also works with the standard Emacs bindings for
-kill, copy, yank, and undo.  If you want to use cua mode, but don't
-want the C-x, C-c, C-v, and C-z bindings, you can customize the
-`cua-enable-cua-keys' variable.
-
-Note: This version of cua mode is not backwards compatible with older
-versions of cua.el and cua-mode.el.  To ensure proper operation, you
-must remove older versions of cua.el or cua-mode.el as well as the
-loading and customization of those packages from the .emacs file.
-
-** Tramp is now part of the distribution.
-
-This package is similar to Ange-FTP: it allows you to edit remote
-files.  But whereas Ange-FTP uses FTP to access the remote host,
-Tramp uses a shell connection.  The shell connection is always used
-for filename completion and directory listings and suchlike, but for
-the actual file transfer, you can choose between the so-called
-`inline' methods (which transfer the files through the shell
-connection using base64 or uu encoding) and the `out-of-band' methods
-(which invoke an external copying program such as `rcp' or `scp' or
-`rsync' to do the copying).
-
-Shell connections can be acquired via `rsh', `ssh', `telnet' and also
-`su' and `sudo'.  Ange-FTP is still supported via the `ftp' method.
-
-If you want to disable Tramp you should set
-
-  (setq tramp-default-method "ftp")
-
-Removing Tramp, and re-enabling Ange-FTP, can be achieved by M-x
-tramp-unload-tramp.
-
-** The image-dired.el package allows you to easily view, tag and in
-other ways manipulate image files and their thumbnails, using dired as
-the main interface.  Image-Dired provides functionality to generate
-simple image galleries.
-
-** Image files are normally visited in Image mode, which lets you toggle
-between viewing the image and viewing the text using C-c C-c.
-
-** The new python.el package is used to edit Python and Jython programs.
-
-** The URL package (which had been part of W3) is now part of Emacs.
-
-** Calc is now part of the Emacs distribution.
-
-Calc is an advanced desk calculator and mathematical tool written in
-Emacs Lisp.  The prefix for Calc has been changed to `C-x *' and Calc
-can be started with `C-x * *'.  The Calc manual is separate from the
-Emacs manual; within Emacs, type "C-h i m calc RET" to read the
-manual.  A reference card is available in `etc/calccard.tex' and
-`etc/calccard.ps'.
-
-** Org mode is now part of the Emacs distribution
-
-Org mode is a mode for keeping notes, maintaining ToDo lists, and
-doing project planning with a fast and effective plain-text system.
-It also contains a plain-text table editor with spreadsheet-like
-capabilities.
-
-The Org mode table editor can be integrated into any major mode by
-activating the minor Orgtbl-mode.
-
-The documentation for org-mode is in a separate manual; within Emacs,
-type "C-h i m org RET" to read that manual.  A reference card is
-available in `etc/orgcard.tex' and `etc/orgcard.ps'.
-
-** ERC is now part of the Emacs distribution.
-
-ERC is a powerful, modular, and extensible IRC client for Emacs.
-
-To see what modules are available, type
-M-x customize-option erc-modules RET.
-
-To start an IRC session with ERC, type M-x erc, and follow the prompts
-for server, port, and nick.
-
-** Rcirc is now part of the Emacs distribution.
-
-Rcirc is an Internet relay chat (IRC) client.  It supports
-simultaneous connections to multiple IRC servers.  Each discussion
-takes place in its own buffer.  For each connection you can join
-several channels (many-to-many) and participate in private
-(one-to-one) chats.  Both channel and private chats are contained in
-separate buffers.
-
-To start an IRC session using the default parameters, type M-x irc.
-If you type C-u M-x irc, it prompts you for the server, nick, port and
-startup channel parameters before connecting.
-
-** The new package ibuffer provides a powerful, completely
-customizable replacement for buff-menu.el.
-
-** Newsticker is now part of the Emacs distribution.
-
-Newsticker asynchronously retrieves headlines (RSS) from a list of news
-sites, prepares these headlines for reading, and allows for loading the
-corresponding articles in a web browser.  Its documentation is in a
-separate manual.
-
-** The wdired.el package allows you to use normal editing commands on Dired
-buffers to change filenames, permissions, etc...
-
-** Ido mode is now part of the Emacs distribution.
-
-The ido (interactively do) package is an extension of the iswitchb
-package to do interactive opening of files and directories in addition
-to interactive buffer switching.  Ido is a superset of iswitchb (with
-a few exceptions), so don't enable both packages.
-
-** The new global minor mode `file-name-shadow-mode' modifies the way
-filenames being entered by the user in the minibuffer are displayed, so
-that it's clear when part of the entered filename will be ignored due to
-Emacs' filename parsing rules.  The ignored portion can be made dim,
-invisible, or otherwise less visually noticeable.  The display method can
-be displayed by customizing the variable `file-name-shadow-properties'.
-
-** Emacs' keyboard macro facilities have been enhanced by the new
-kmacro package.
-
-Keyboard macros are now defined and executed via the F3 and F4 keys:
-F3 starts a macro, F4 ends the macro, and pressing F4 again executes
-the last macro.  While defining the macro, F3 inserts a counter value
-which automatically increments every time the macro is executed.
-
-There is now a keyboard macro ring which stores the most recently
-defined macros.
-
-The C-x C-k sequence is now a prefix for the kmacro keymap which
-defines bindings for moving through the keyboard macro ring,
-C-x C-k C-p and C-x C-k C-n, editing the last macro C-x C-k C-e,
-manipulating the macro counter and format via C-x C-k C-c,
-C-x C-k C-a, and C-x C-k C-f.  See the commentary in kmacro.el
-for more commands.
-
-The original macro bindings C-x (, C-x ), and C-x e are still
-available, but they now interface to the keyboard macro ring too.
-
-The C-x e command now automatically terminates the current macro
-before calling it, if used while defining a macro.
-
-In addition, when ending or calling a macro with C-x e, the macro can
-be repeated immediately by typing just the `e'.  You can customize
-this behavior via the variables kmacro-call-repeat-key and
-kmacro-call-repeat-with-arg.
-
-Keyboard macros can now be debugged and edited interactively.
-C-x C-k SPC steps through the last keyboard macro one key sequence
-at a time, prompting for the actions to take.
-
-** The new keypad setup package provides several common bindings for
-the numeric keypad which is available on most keyboards.  The numeric
-keypad typically has the digits 0 to 9, a decimal point, keys marked
-+, -, /, and *, an Enter key, and a NumLock toggle key.  The keypad
-package only controls the use of the digit and decimal keys.
-
-By customizing the variables `keypad-setup', `keypad-shifted-setup',
-`keypad-numlock-setup', and `keypad-numlock-shifted-setup', or by
-using the function `keypad-setup', you can rebind all digit keys and
-the decimal key of the keypad in one step for each of the four
-possible combinations of the Shift key state (not pressed/pressed) and
-the NumLock toggle state (off/on).
-
-The choices for the keypad keys in each of the above states are:
-`Plain numeric keypad' where the keys generates plain digits,
-`Numeric keypad with decimal key' where the character produced by the
-decimal key can be customized individually (for internationalization),
-`Numeric Prefix Arg' where the keypad keys produce numeric prefix args
-for Emacs editing commands, `Cursor keys' and `Shifted Cursor keys'
-where the keys work like (shifted) arrow keys, home/end, etc., and
-`Unspecified/User-defined' where the keypad keys (kp-0, kp-1, etc.)
-are left unspecified and can be bound individually through the global
-or local keymaps.
-
-** The printing package is now part of the Emacs distribution.
-
-If you enable the printing package by including (require 'printing) in
-the .emacs file, the normal Print item on the File menu is replaced
-with a Print sub-menu which allows you to preview output through
-ghostview, use ghostscript to print (if you don't have a PostScript
-printer) or send directly to printer a PostScript code generated by
-`ps-print' package.  Use M-x pr-help for more information.
-
-** The new package longlines.el provides a minor mode for editing text
-files composed of long lines, based on the `use-hard-newlines'
-mechanism.  The long lines are broken up by inserting soft newlines,
-which are automatically removed when saving the file to disk or
-copying into the kill ring, clipboard, etc.  By default, Longlines
-mode inserts soft newlines automatically during editing, a behavior
-referred to as "soft word wrap" in other text editors.  This is
-similar to Refill mode, but more reliable.  To turn the word wrap
-feature off, set `longlines-auto-wrap' to nil.
-
-** SES mode (ses-mode) is a new major mode for creating and editing
-spreadsheet files.  Besides the usual Emacs features (intuitive command
-letters, undo, cell formulas in Lisp, plaintext files, etc.) it also offers
-viral immunity and import/export of tab-separated values.
-
-** The new package table.el implements editable, WYSIWYG, embedded
-`text tables' in Emacs buffers.  It simulates the effect of putting
-these tables in a special major mode.  The package emulates WYSIWYG
-table editing available in modern word processors.  The package also
-can generate a table source in typesetting and markup languages such
-as latex and html from the visually laid out text table.
-
-** Filesets are collections of files.  You can define a fileset in
-various ways, such as based on a directory tree or based on
-program files that include other program files.
-
-Once you have defined a fileset, you can perform various operations on
-all the files in it, such as visiting them or searching and replacing
-in them.
-
-** The minor mode Reveal mode makes text visible on the fly as you
-move your cursor into hidden regions of the buffer.
-It should work with any package that uses overlays to hide parts
-of a buffer, such as outline-minor-mode, hs-minor-mode, hide-ifdef-mode, ...
-
-There is also Global Reveal mode which affects all buffers.
-
-** New minor mode, Visible mode, toggles invisibility in the current buffer.
-When enabled, it makes all invisible text visible.  When disabled, it
-restores the previous value of `buffer-invisibility-spec'.
-
-** The new package flymake.el does on-the-fly syntax checking of program
-source files.  See the Flymake's Info manual for more details.
-
-** savehist saves minibuffer histories between sessions.
-To use this feature, turn on savehist-mode in your `.emacs' file.
-
-** The ruler-mode.el library provides a minor mode for displaying an
-"active" ruler in the header line.  You can use the mouse to visually
-change the `fill-column', `window-margins' and `tab-stop-list'
-settings.
-
-** The file t-mouse.el is now part of Emacs and provides access to mouse
-events from the console.  It still requires gpm to work but has been updated
-for Emacs 22.  In particular, the mode-line is now position sensitive.
-
-** The new package scroll-lock.el provides the Scroll Lock minor mode
-for pager-like scrolling.  Keys which normally move point by line or
-paragraph will scroll the buffer by the respective amount of lines
-instead and point will be kept vertically fixed relative to window
-boundaries during scrolling.
-
-** The new global minor mode `size-indication-mode' (off by default)
-shows the size of accessible part of the buffer on the mode line.
-
-** The new package conf-mode.el handles thousands of configuration files, with
-varying syntaxes for comments (;, #, //, /* */ or !), assignment (var = value,
-var : value, var value or keyword var value) and sections ([section] or
-section { }).  Many files under /etc/, or with suffixes like .cf through
-.config, .properties (Java), .desktop (KDE/Gnome), .ini and many others are
-recognized.
-
-** GDB-Script-mode is used for files like .gdbinit.
-
-** The new package dns-mode.el adds syntax highlighting of DNS master files.
-It is a modern replacement for zone-mode.el, which is now obsolete.
-
-** `cfengine-mode' is a major mode for editing GNU Cfengine
-configuration files.
-
-** The TCL package tcl-mode.el was replaced by tcl.el.
-This was actually done in Emacs-21.1, and was not documented.
-\f
-* Changes in Specialized Modes and Packages in Emacs 22.1:
-
-** Changes in Dired
-
-*** Bindings for Image-Dired added.
-Several new keybindings, all starting with the C-t prefix, have been
-added to Dired.  They are all bound to commands in Image-Dired.  As a
-starting point, mark some image files in a dired buffer and do C-t d
-to display thumbnails of them in a separate buffer.
-
-** Info mode changes
-
-*** Images in Info pages are supported.
-
-Info pages show embedded images, in Emacs frames with image support.
-Info documentation that includes images, processed with makeinfo
-version 4.7 or newer, compiles to Info pages with embedded images.
-
-*** `Info-index' offers completion.
-
-*** http and ftp links in Info are now operational: they look like cross
-references and following them calls `browse-url'.
-
-*** isearch in Info uses Info-search and searches through multiple nodes.
-
-Before leaving the initial Info node isearch fails once with the error
-message [initial node], and with subsequent C-s/C-r continues through
-other nodes.  When isearch fails for the rest of the manual, it wraps
-around the whole manual to the top/final node.  The user option
-`Info-isearch-search' controls whether to use Info-search for isearch,
-or the default isearch search function that wraps around the current
-Info node.
-
-*** New search commands: `Info-search-case-sensitively' (bound to S),
-`Info-search-backward', and `Info-search-next' which repeats the last
-search without prompting for a new search string.
-
-*** New command `info-apropos' searches the indices of the known
-Info files on your system for a string, and builds a menu of the
-possible matches.
-
-*** New command `Info-history-forward' (bound to r and new toolbar icon)
-moves forward in history to the node you returned from after using
-`Info-history-back' (renamed from `Info-last').
-
-*** New command `Info-history' (bound to L) displays a menu of visited nodes.
-
-*** New command `Info-toc' (bound to T) creates a node with table of contents
-from the tree structure of menus of the current Info file.
-
-*** New command `Info-copy-current-node-name' (bound to w) copies
-the current Info node name into the kill ring.  With a zero prefix
-arg, puts the node name inside the `info' function call.
-
-*** New face `info-xref-visited' distinguishes visited nodes from unvisited
-and a new option `Info-fontify-visited-nodes' to control this.
-
-*** A numeric prefix argument of `info' selects an Info buffer
-with the number appended to the `*info*' buffer name (e.g. "*info*<2>").
-
-*** Info now hides node names in menus and cross references by default.
-
-If you prefer the old behavior, you can set the new user option
-`Info-hide-note-references' to nil.
-
-*** The default value for `Info-scroll-prefer-subnodes' is now nil.
-
-** Emacs server changes
-
-*** You can have several Emacs servers on the same machine.
-
-       % emacs --eval '(setq server-name "foo")' -f server-start &
-       % emacs --eval '(setq server-name "bar")' -f server-start &
-       % emacsclient -s foo file1
-       % emacsclient -s bar file2
-
-*** The `emacsclient' command understands the options `--eval' and
-`--display' which tell Emacs respectively to evaluate the given Lisp
-expression and to use the given display when visiting files.
-
-*** User option `server-mode' can be used to start a server process.
-
-** Locate changes
-
-*** By default, reverting the *Locate* buffer now just runs the last
-`locate' command back over again without offering to update the locate
-database (which normally only works if you have root privileges).  If
-you prefer the old behavior, set the new customizable option
-`locate-update-when-revert' to t.
-
-** Desktop package
-
-*** Desktop saving is now a minor mode, `desktop-save-mode'.
-
-*** The variable `desktop-enable' is obsolete.
-
-Customize `desktop-save-mode' to enable desktop saving.
-
-*** Buffers are saved in the desktop file in the same order as that in the
-buffer list.
-
-*** The desktop package can be customized to restore only some buffers
-immediately, remaining buffers are restored lazily (when Emacs is
-idle).
-
-*** New command line option --no-desktop
-
-*** New commands:
-  - desktop-revert reverts to the last loaded desktop.
-  - desktop-change-dir kills current desktop and loads a new.
-  - desktop-save-in-desktop-dir saves desktop in the directory from which
-    it was loaded.
-  - desktop-lazy-complete runs the desktop load to completion.
-  - desktop-lazy-abort aborts lazy loading of the desktop.
-
-*** New customizable variables:
-  - desktop-save. Determines whether the desktop should be saved when it is
-    killed.
-  - desktop-file-name-format. Format in which desktop file names should be saved.
-  - desktop-path. List of directories in which to lookup the desktop file.
-  - desktop-locals-to-save. List of local variables to save.
-  - desktop-globals-to-clear. List of global variables that `desktop-clear' will clear.
-  - desktop-clear-preserve-buffers-regexp. Regexp identifying buffers that `desktop-clear'
-    should not delete.
-  - desktop-restore-eager. Number of buffers to restore immediately. Remaining buffers are
-    restored lazily (when Emacs is idle).
-  - desktop-lazy-verbose. Verbose reporting of lazily created buffers.
-  - desktop-lazy-idle-delay. Idle delay before starting to create buffers.
-
-*** New hooks:
-  - desktop-after-read-hook run after a desktop is loaded.
-  - desktop-no-desktop-file-hook run when no desktop file is found.
-
-** Recentf changes
-
-The recent file list is now automatically cleaned up when recentf mode is
-enabled.  The new option `recentf-auto-cleanup' controls when to do
-automatic cleanup.
-
-The ten most recent files can be quickly opened by using the shortcut
-keys 1 to 9, and 0, when the recent list is displayed in a buffer via
-the `recentf-open-files', or `recentf-open-more-files' commands.
-
-The `recentf-keep' option replaces `recentf-keep-non-readable-files-p'
-and provides a more general mechanism to customize which file names to
-keep in the recent list.
-
-With the more advanced option `recentf-filename-handlers', you can
-specify functions that successively transform recent file names.  For
-example, if set to `file-truename' plus `abbreviate-file-name', the
-same file will not be in the recent list with different symbolic
-links, and the file name will be abbreviated.
-
-To follow naming convention, `recentf-menu-append-commands-flag'
-replaces the misnamed option `recentf-menu-append-commands-p'.  The
-old name remains available as alias, but has been marked obsolete.
-
-** Auto-Revert changes
-
-*** You can now use Auto Revert mode to `tail' a file.
-
-If point is at the end of a file buffer before reverting, Auto Revert
-mode keeps it at the end after reverting.  Similarly if point is
-displayed at the end of a file buffer in any window, it stays at the
-end of the buffer in that window.  This allows you to "tail" a file:
-just put point at the end of the buffer and it stays there.  This rule
-applies to file buffers.  For non-file buffers, the behavior can be
-mode dependent.
-
-If you are sure that the file will only change by growing at the end,
-then you can tail the file more efficiently by using the new minor
-mode Auto Revert Tail mode.  The function `auto-revert-tail-mode'
-toggles this mode.
-
-*** Auto Revert mode is now more careful to avoid excessive reverts and
-other potential problems when deciding which non-file buffers to
-revert.  This matters especially if Global Auto Revert mode is enabled
-and `global-auto-revert-non-file-buffers' is non-nil.  Auto Revert
-mode only reverts a non-file buffer if the buffer has a non-nil
-`revert-buffer-function' and a non-nil `buffer-stale-function', which
-decides whether the buffer should be reverted.  Currently, this means
-that auto reverting works for Dired buffers (although this may not
-work properly on all operating systems) and for the Buffer Menu.
-
-*** If the new user option `auto-revert-check-vc-info' is non-nil, Auto
-Revert mode reliably updates version control info (such as the version
-control number in the mode line), in all version controlled buffers in
-which it is active.  If the option is nil, the default, then this info
-only gets updated whenever the buffer gets reverted.
-
-** Changes in Shell Mode
-
-*** Shell output normally scrolls so that the input line is at the
-bottom of the window -- thus showing the maximum possible text.  (This
-is similar to the way sequential output to a terminal works.)
-
-** Changes in Hi Lock
-
-*** hi-lock-mode now only affects a single buffer, and a new function
-`global-hi-lock-mode' enables Hi Lock in all buffers.  By default, if
-hi-lock-mode is used in what appears to be the initialization file, a
-warning message suggests to use global-hi-lock-mode instead.  However,
-if the new variable `hi-lock-archaic-interface-deduce' is non-nil,
-using hi-lock-mode in an initialization file will turn on Hi Lock in all
-buffers and no warning will be issued (for compatibility with the
-behavior in older versions of Emacs).
-
-** Changes in Allout
-
-*** Topic cryptography added, enabling easy gpg topic encryption and
-decryption.  Per-topic basis enables interspersing encrypted-text and
-clear-text within a single file to your heart's content, using symmetric
-and/or public key modes.  Time-limited key caching, user-provided
-symmetric key hinting and consistency verification, auto-encryption of
-pending topics on save, and more, make it easy to use encryption in
-powerful ways.  Encryption behavior customization is collected in the
-allout-encryption customization group.
-
-*** Default command prefix was changed to "\C-c " (control-c space), to
-avoid intruding on user's keybinding space.  Customize the
-`allout-command-prefix' variable to your preference.
-
-*** Some previously rough topic-header format edge cases are reconciled.
-Level 1 topics use the mode's comment format, and lines starting with the
-asterisk - for instance, the comment close of some languages (eg, c's "*/"
-or mathematica's "*)") - at the beginning of line are no longer are
-interpreted as level 1 topics in those modes.
-
-*** Many or most commonly occurring "accidental" topics are disqualified.
-Text in item bodies that looks like a low-depth topic is no longer mistaken
-for one unless its first offspring (or that of its next sibling with
-offspring) is only one level deeper.
-
-For example, pasting some text with a bunch of leading asterisks into a
-topic that's followed by a level 3 or deeper topic will not cause the
-pasted text to be mistaken for outline structure.
-
-The same constraint is applied to any level 2 or 3 topics.
-
-This settles an old issue where typed or pasted text needed to be carefully
-reviewed, and sometimes doctored, to avoid accidentally disrupting the
-outline structure.  Now that should be generally unnecessary, as the most
-prone-to-occur accidents are disqualified.
-
-*** Allout now refuses to create "containment discontinuities", where a
-topic is shifted deeper than the offspring-depth of its container.  On the
-other hand, allout now operates gracefully with existing containment
-discontinuities, revealing excessively contained topics rather than either
-leaving them hidden or raising an error.
-
-*** Navigation within an item is easier.  Repeated beginning-of-line and
-end-of-line key commands (usually, ^A and ^E) cycle through the
-beginning/end-of-line and then beginning/end of topic, etc.  See new
-customization vars `allout-beginning-of-line-cycles' and
-`allout-end-of-line-cycles'.
-
-*** New or revised allout-mode activity hooks enable creation of
-cooperative enhancements to allout mode without changes to the mode,
-itself.
-
-See `allout-exposure-change-hook', `allout-structure-added-hook',
-`allout-structure-deleted-hook', and `allout-structure-shifted-hook'.
-
-`allout-exposure-change-hook' replaces the existing
-`allout-view-change-hook', which is being deprecated.  Both are still
-invoked, but `allout-view-change-hook' will eventually be ignored.
-`allout-exposure-change-hook' is called with explicit arguments detailing
-the specifics of each change (as are the other new hooks), making it easier
-to use than the old version.
-
-There is a new mode deactivation hook, `allout-mode-deactivate-hook', for
-coordinating with deactivation of allout-mode.  Both that and the mode
-activation hook, `allout-mode-hook' are now run after the `allout-mode'
-variable is changed, rather than before.
-
-*** Allout now uses text overlay's `invisible' property for concealed text,
-instead of selective-display.  This simplifies the code, in particular
-avoiding the need for kludges for isearch dynamic-display, discretionary
-handling of edits of concealed text, undo concerns, etc.
-
-*** There are many other fixes and refinements, including:
-
-   - repaired inhibition of inadvertent edits to concealed text, without
-     inhibiting undo; we now reveal undo changes within concealed text.
-   - auto-fill-mode is now left inactive when allout-mode starts, if it
-     already was inactive.  also, `allout-inhibit-auto-fill' custom
-     configuration variable makes it easy to disable auto fill in allout
-     outlines in general or on a per-buffer basis.
-   - allout now tolerates fielded text in outlines without disruption.
-   - hot-spot navigation now is modularized with a new function,
-     `allout-hotspot-key-handler', enabling easier use and enhancement of
-     the functionality in allout addons.
-   - repaired retention of topic body hanging indent upon topic depth shifts
-   - bulleting variation is simpler and more accommodating, both in the
-     default behavior and in ability to vary when creating new topics
-   - mode deactivation now does cleans up effectively, more properly
-     restoring affected variables and hooks to former state, removing
-     overlays, etc.  see `allout-add-resumptions' and
-     `allout-do-resumptions', which replace the old `allout-resumptions'.
-   - included a few unit-tests for interior functionality.  developers can
-     have them automatically run at the end of module load by customizing
-     the option `allout-run-unit-tests-on-load'.
-   - many, many other, more minor tweaks, fixes, and refinements.
-   - version number incremented to 2.2
-
-** Hideshow mode changes
-
-*** New variable `hs-set-up-overlay' allows customization of the overlay
-used to effect hiding for hideshow minor mode.  Integration with isearch
-handles the overlay property `display' specially, preserving it during
-temporary overlay showing in the course of an isearch operation.
-
-*** New variable `hs-allow-nesting' non-nil means that hiding a block does
-not discard the hidden state of any "internal" blocks; when the parent
-block is later shown, the internal blocks remain hidden.  Default is nil.
-
-** FFAP changes
-
-*** New ffap commands and keybindings:
-
-C-x C-r (`ffap-read-only'),
-C-x C-v (`ffap-alternate-file'), C-x C-d (`ffap-list-directory'),
-C-x 4 r (`ffap-read-only-other-window'), C-x 4 d (`ffap-dired-other-window'),
-C-x 5 r (`ffap-read-only-other-frame'), C-x 5 d (`ffap-dired-other-frame').
-
-*** FFAP accepts wildcards in a file name by default.
-
-C-x C-f passes the file name to `find-file' with non-nil WILDCARDS
-argument, which visits multiple files, and C-x d passes it to `dired'.
-
-** Changes in Skeleton
-
-*** In skeleton.el, `-' marks the `skeleton-point' without interregion interaction.
-
-`@' has reverted to only setting `skeleton-positions' and no longer
-sets `skeleton-point'.  Skeletons which used @ to mark
-`skeleton-point' independent of `_' should now use `-' instead.  The
-updated `skeleton-insert' docstring explains these new features along
-with other details of skeleton construction.
-
-*** The variables `skeleton-transformation', `skeleton-filter', and
-`skeleton-pair-filter' have been renamed to
-`skeleton-transformation-function', `skeleton-filter-function', and
-`skeleton-pair-filter-function'.  The old names are still available
-as aliases.
-
-** HTML/SGML changes
-
-*** Emacs now tries to set up buffer coding systems for HTML/XML files
-automatically.
-
-*** SGML mode has indentation and supports XML syntax.
-The new variable `sgml-xml-mode' tells SGML mode to use XML syntax.
-When this option is enabled, SGML tags are inserted in XML style,
-i.e., there is always a closing tag.
-By default, its setting is inferred on a buffer-by-buffer basis
-from the file name or buffer contents.
-
-*** The variable `sgml-transformation' has been renamed to
-`sgml-transformation-function'.  The old name is still available as
-alias.
-
-*** `xml-mode' is now an alias for `sgml-mode', which has XML support.
-
-** TeX modes
-
-*** New major mode Doctex mode, for *.dtx files.
-
-*** C-c C-c prompts for a command to run, and tries to offer a good default.
-
-*** The user option `tex-start-options-string' has been replaced
-by two new user options: `tex-start-options', which should hold
-command-line options to feed to TeX, and `tex-start-commands' which should hold
-TeX commands to use at startup.
-
-*** verbatim environments are now highlighted in courier by font-lock
-and super/sub-scripts are made into super/sub-scripts.
-
-** RefTeX mode changes
-
-*** Changes to RefTeX's table of contents
-
-The new command keys "<" and ">" in the TOC buffer promote/demote the
-section at point or all sections in the current region, with full
-support for multifile documents.
-
-The new command `reftex-toc-recenter' (`C-c -') shows the current
-section in the TOC buffer without selecting the TOC window.
-Recentering can happen automatically in idle time when the option
-`reftex-auto-recenter-toc' is turned on.  The highlight in the TOC
-buffer stays when the focus moves to a different window.  A dedicated
-frame can show the TOC with the current section always automatically
-highlighted.  The frame is created and deleted from the toc buffer
-with the `d' key.
-
-The toc window can be split off horizontally instead of vertically.
-See new option `reftex-toc-split-windows-horizontally'.
-
-Labels can be renamed globally from the table of contents using the
-key `M-%'.
-
-The new command `reftex-goto-label' jumps directly to a label
-location.
-
-*** Changes related to citations and BibTeX database files
-
-Commands that insert a citation now prompt for optional arguments when
-called with a prefix argument.  Related new options are
-`reftex-cite-prompt-optional-args' and `reftex-cite-cleanup-optional-args'.
-
-The new command `reftex-create-bibtex-file' creates a BibTeX database
-with all entries referenced in the current document.  The keys "e" and
-"E" allow to produce a BibTeX database file from entries marked in a
-citation selection buffer.
-
-The command `reftex-citation' uses the word in the buffer before the
-cursor as a default search string.
-
-The support for chapterbib has been improved.  Different chapters can
-now use BibTeX or an explicit `thebibliography' environment.
-
-The macros which specify the bibliography file (like \bibliography)
-can be configured with the new option `reftex-bibliography-commands'.
-
-Support for jurabib has been added.
-
-*** Global index matched may be verified with a user function.
-
-During global indexing, a user function can verify an index match.
-See new option `reftex-index-verify-function'.
-
-*** Parsing documents with many labels can be sped up.
-
-Operating in a document with thousands of labels can be sped up
-considerably by allowing RefTeX to derive the type of a label directly
-from the label prefix like `eq:' or `fig:'.  The option
-`reftex-trust-label-prefix' needs to be configured in order to enable
-this feature.  While the speed-up is significant, this may reduce the
-quality of the context offered by RefTeX to describe a label.
-
-*** Miscellaneous changes
-
-The macros which input a file in LaTeX (like \input, \include) can be
-configured in the new option `reftex-include-file-commands'.
-
-RefTeX supports global incremental search.
-
-** BibTeX mode
-
-*** The new command `bibtex-url' browses a URL for the BibTeX entry at
-point (bound to C-c C-l and mouse-2, RET on clickable fields).
-
-*** The new command `bibtex-entry-update' (bound to C-c C-u) updates
-an existing BibTeX entry by inserting fields that may occur but are not
-present.
-
-*** New `bibtex-entry-format' option `required-fields', enabled by default.
-
-*** `bibtex-maintain-sorted-entries' can take values `plain',
-`crossref', and `entry-class' which control the sorting scheme used
-for BibTeX entries.  `bibtex-sort-entry-class' controls the sorting
-scheme `entry-class'.  TAB completion for reference keys and
-automatic detection of duplicates does not require anymore that
-`bibtex-maintain-sorted-entries' is non-nil.
-
-*** The new command `bibtex-complete' completes word fragment before
-point according to context (bound to M-tab).
-
-*** In BibTeX mode the command `fill-paragraph' (M-q) fills
-individual fields of a BibTeX entry.
-
-*** The new variable `bibtex-autofill-types' contains a list of entry
-types for which fields are filled automatically (if possible).
-
-*** The new commands `bibtex-find-entry' and `bibtex-find-crossref'
-locate entries and crossref'd entries (bound to C-c C-s and C-c C-x).
-Crossref fields are clickable (bound to mouse-2, RET).
-
-*** The new variables `bibtex-files' and `bibtex-file-path' define a set
-of BibTeX files that are searched for entry keys.
-
-*** The new command `bibtex-validate-globally' checks for duplicate keys
-in multiple BibTeX files.
-
-*** If the new variable `bibtex-autoadd-commas' is non-nil,
-automatically add missing commas at end of BibTeX fields.
-
-*** The new command `bibtex-copy-summary-as-kill' pushes summary
-of BibTeX entry to kill ring (bound to C-c C-t).
-
-*** If the new variable `bibtex-parse-keys-fast' is non-nil,
-use fast but simplified algorithm for parsing BibTeX keys.
-
-*** The new variables bibtex-expand-strings and
-bibtex-autokey-expand-strings control the expansion of strings when
-extracting the content of a BibTeX field.
-
-*** The variables `bibtex-autokey-name-case-convert' and
-`bibtex-autokey-titleword-case-convert' have been renamed to
-`bibtex-autokey-name-case-convert-function' and
-`bibtex-autokey-titleword-case-convert-function'.  The old names are
-still available as aliases.
-
-** GUD changes
-
-*** The new package gdb-ui.el provides an enhanced graphical interface to
-GDB.  You can interact with GDB through the GUD buffer in the usual way, but
-there are also further buffers which control the execution and describe the
-state of your program.  It can separate the input/output of your program from
-that of GDB and watches expressions in the speedbar.  It also uses features of
-Emacs 21/22 such as the toolbar, and bitmaps in the fringe to indicate
-breakpoints.
-
-To use this package just type M-x gdb.  See the Emacs manual if you want the
-old behaviour.
-
-*** GUD mode has its own tool bar for controlling execution of the inferior
-and other common debugger commands.
-
-*** In GUD mode, when talking to GDB, C-x C-a C-j "jumps" the program
-counter to the specified source line (the one where point is).
-
-*** The variable tooltip-gud-tips-p has been removed.  GUD tooltips can now be
-toggled independently of normal tooltips with the minor mode
-`gud-tooltip-mode'.
-
-*** In graphical mode, with a C program, GUD Tooltips have been extended to
-display the #define directive associated with an identifier when program is
-not executing.
-
-*** GUD mode improvements for jdb:
-
-**** Search for source files using jdb classpath and class information.
-Fast startup since there is no need to scan all source files up front.
-There is also no need to create and maintain lists of source
-directories to scan.  Look at `gud-jdb-use-classpath' and
-`gud-jdb-classpath' customization variables documentation.
-
-**** The previous method of searching for source files has been
-preserved in case someone still wants/needs to use it.
-Set `gud-jdb-use-classpath' to nil.
-
-**** Supports the standard breakpoint (gud-break, gud-clear)
-set/clear operations from Java source files under the classpath, stack
-traversal (gud-up, gud-down), and run until current stack finish
-(gud-finish).
-
-**** Supports new jdb (Java 1.2 and later) in addition to oldjdb
-(Java 1.1 jdb).
-
-*** Added jdb Customization Variables
-
-**** `gud-jdb-command-name'.  What command line to use to invoke jdb.
-
-**** `gud-jdb-use-classpath'.  Allows selection of java source file searching
-method: set to t for new method, nil to scan `gud-jdb-directories' for
-java sources (previous method).
-
-**** `gud-jdb-directories'.  List of directories to scan and search for Java
-classes using the original gud-jdb method (if `gud-jdb-use-classpath'
-is nil).
-
-*** Minor Improvements
-
-**** The STARTTLS wrapper (starttls.el) can now use GNUTLS
-instead of the OpenSSL based `starttls' tool.  For backwards
-compatibility, it prefers `starttls', but you can toggle
-`starttls-use-gnutls' to switch to GNUTLS (or simply remove the
-`starttls' tool).
-
-**** Do not allow debugger output history variable to grow without bounds.
-
-** Lisp mode changes
-
-*** Lisp mode now uses `font-lock-doc-face' for doc strings.
-
-*** C-u C-M-q in Emacs Lisp mode pretty-prints the list after point.
-
-*** New features in evaluation commands
-
-**** The function `eval-defun' (C-M-x) called on defface reinitializes
-the face to the value specified in the defface expression.
-
-**** Typing C-x C-e twice prints the value of the integer result
-in additional formats (octal, hexadecimal, character) specified
-by the new function `eval-expression-print-format'.  The same
-function also defines the result format for `eval-expression' (M-:),
-`eval-print-last-sexp' (C-j) and some edebug evaluation functions.
-
-** Changes to cmuscheme
-
-*** Emacs now offers to start Scheme if the user tries to
-evaluate a Scheme expression but no Scheme subprocess is running.
-
-*** If the file ~/.emacs_NAME or ~/.emacs.d/init_NAME.scm (where NAME
-is the name of the Scheme interpreter) exists, its contents are sent
-to the Scheme subprocess upon startup.
-
-*** There are new commands to instruct the Scheme interpreter to trace
-procedure calls (`scheme-trace-procedure') and to expand syntactic forms
-(`scheme-expand-current-form').  The commands actually sent to the Scheme
-subprocess are controlled by the user options `scheme-trace-command',
-`scheme-untrace-command' and `scheme-expand-current-form'.
-
-** Ewoc changes
-
-*** The new function `ewoc-delete' deletes specified nodes.
-
-*** `ewoc-create' now takes optional arg NOSEP, which inhibits insertion of
-a newline after each pretty-printed entry and after the header and footer.
-This allows you to create multiple-entry ewocs on a single line and to
-effect "invisible" nodes by arranging for the pretty-printer to not print
-anything for those nodes.
-
-For example, these two sequences of expressions behave identically:
-
-;; NOSEP nil
-(defun PP (data) (insert (format "%S" data)))
-(ewoc-create 'PP "start\n")
-
-;; NOSEP t
-(defun PP (data) (insert (format "%S\n" data)))
-(ewoc-create 'PP "start\n\n" "\n" t)
-
-** CC mode changes
-
-*** The CC Mode manual has been extensively revised.
-The information about using CC Mode has been separated from the larger
-and more difficult chapters about configuration.
-
-*** New Minor Modes
-**** Electric Minor Mode toggles the electric action of non-alphabetic keys.
-The new command c-toggle-electric-mode is bound to C-c C-l.  Turning the
-mode off can be helpful for editing chaotically indented code and for
-users new to CC Mode, who sometimes find electric indentation
-disconcerting.  Its current state is displayed in the mode line with an
-'l', e.g. "C/al".
-
-**** Subword Minor Mode makes Emacs recognize word boundaries at upper case
-letters in StudlyCapsIdentifiers.  You enable this feature by C-c C-w.  It can
-also be used in non-CC Mode buffers.  :-) Contributed by Masatake YAMATO.
-
-*** Support for the AWK language.
-Support for the AWK language has been introduced.  The implementation is
-based around GNU AWK version 3.1, but it should work pretty well with
-any AWK.  As yet, not all features of CC Mode have been adapted for AWK.
-Here is a summary:
-
-**** Indentation Engine
-The CC Mode indentation engine fully supports AWK mode.
-
-AWK mode handles code formatted in the conventional AWK fashion: `{'s
-which start actions, user-defined functions, or compound statements are
-placed on the same line as the associated construct; the matching `}'s
-are normally placed under the start of the respective pattern, function
-definition, or structured statement.
-
-The predefined line-up functions haven't yet been adapted for AWK
-mode, though some of them may work serendipitously.  There shouldn't
-be any problems writing custom indentation functions for AWK mode.
-
-**** Font Locking
-There is a single level of font locking in AWK mode, rather than the
-three distinct levels the other modes have.  There are several
-idiosyncrasies in AWK mode's font-locking due to the peculiarities of
-the AWK language itself.
-
-**** Comment and Movement Commands
-These commands all work for AWK buffers.  The notion of "defun" has
-been augmented to include AWK pattern-action pairs - the standard
-"defun" commands on key sequences C-M-a, C-M-e, and C-M-h use this
-extended definition.
-
-**** "awk" style, Auto-newline Insertion and Clean-ups
-A new style, "awk" has been introduced, and this is now the default
-style for AWK code.  With auto-newline enabled, the clean-up
-c-one-liner-defun (see above) is useful.
-
-*** Font lock support.
-CC Mode now provides font lock support for all its languages.  This
-supersedes the font lock patterns that have been in the core font lock
-package for C, C++, Java and Objective-C.  Like indentation, font
-locking is done in a uniform way across all languages (except the new
-AWK mode - see below).  That means that the new font locking will be
-different from the old patterns in various details for most languages.
-
-The main goal of the font locking in CC Mode is accuracy, to provide a
-dependable aid in recognizing the various constructs.  Some, like
-strings and comments, are easy to recognize while others like
-declarations and types can be very tricky.  CC Mode can go to great
-lengths to recognize declarations and casts correctly, especially when
-the types aren't recognized by standard patterns.  This is a fairly
-demanding analysis which can be slow on older hardware, and it can
-therefore be disabled by choosing a lower decoration level with the
-variable font-lock-maximum-decoration.
-
-Note that the most demanding font lock level has been tuned with lazy
-fontification in mind; Just-In-Time-Lock mode should be enabled for
-the highest font lock level (by default, it is).  Fontifying a file
-with several thousand lines in one go can take the better part of a
-minute.
-
-**** The (c|c++|objc|java|idl|pike)-font-lock-extra-types variables
-are now used by CC Mode to recognize identifiers that are certain to
-be types.  (They are also used in cases that aren't related to font
-locking.)  At the maximum decoration level, types are often recognized
-properly anyway, so these variables should be fairly restrictive and
-not contain patterns for uncertain types.
-
-**** Support for documentation comments.
-There is a "plugin" system to fontify documentation comments like
-Javadoc and the markup within them.  It's independent of the host
-language, so it's possible to e.g. turn on Javadoc font locking in C
-buffers.  See the variable c-doc-comment-style for details.
-
-Currently three kinds of doc comment styles are recognized: Sun's
-Javadoc, Autodoc (which is used in Pike) and GtkDoc (used in C).  (The
-last was contributed by Masatake YAMATO).  This is by no means a
-complete list of the most common tools; if your doc comment extractor
-of choice is missing then please drop a note to bug-cc-mode@gnu.org.
-
-**** Better handling of C++ templates.
-As a side effect of the more accurate font locking, C++ templates are
-now handled much better.  The angle brackets that delimit them are
-given parenthesis syntax so that they can be navigated like other
-parens.
-
-This also improves indentation of templates, although there still is
-work to be done in that area.  E.g. it's required that multiline
-template clauses are written in full and then refontified to be
-recognized, and the indentation of nested templates is a bit odd and
-not as configurable as it ought to be.
-
-**** Improved handling of Objective-C and CORBA IDL.
-Especially the support for Objective-C and IDL has gotten an overhaul.
-The special "@" declarations in Objective-C are handled correctly.
-All the keywords used in CORBA IDL, PSDL, and CIDL are recognized and
-handled correctly, also wrt indentation.
-
-*** Changes in Key Sequences
-**** c-toggle-auto-hungry-state is no longer bound to C-c C-t.
-
-**** c-toggle-hungry-state is no longer bound to C-c C-d.
-This binding has been taken over by c-hungry-delete-forwards.
-
-**** c-toggle-auto-state (C-c C-t) has been renamed to c-toggle-auto-newline.
-c-toggle-auto-state remains as an alias.
-
-**** The new commands c-hungry-backspace and c-hungry-delete-forwards
-have key bindings C-c C-DEL (or C-c DEL, for the benefit of TTYs) and
-C-c C-d (or C-c C-<delete> or C-c <delete>) respectively.  These
-commands delete entire blocks of whitespace with a single
-key-sequence.  [N.B. "DEL" is the <backspace> key.]
-
-**** The new command c-toggle-electric-mode is bound to C-c C-l.
-
-**** The new command c-subword-mode is bound to C-c C-w.
-
-*** C-c C-s (`c-show-syntactic-information') now highlights the anchor
-position(s).
-
-*** New syntactic symbols in IDL mode.
-The top level constructs "module" and "composition" (from CIDL) are
-now handled like "namespace" in C++: They are given syntactic symbols
-module-open, module-close, inmodule, composition-open,
-composition-close, and incomposition.
-
-*** New functions to do hungry delete without enabling hungry delete mode.
-The new functions `c-hungry-backspace' and `c-hungry-delete-forward'
-provide hungry deletion without having to toggle a mode.  They are
-bound to C-c C-DEL and C-c C-d (and several variants, for the benefit
-of different keyboard setups.  See "Changes in key sequences" above).
-
-*** Better control over `require-final-newline'.
-
-The variable `c-require-final-newline' specifies which of the modes
-implemented by CC mode should insert final newlines.  Its value is a
-list of modes, and only those modes should do it.  By default the list
-includes C, C++ and Objective-C modes.
-
-Whichever modes are in this list will set `require-final-newline'
-based on `mode-require-final-newline'.
-
-*** Format change for syntactic context elements.
-
-The elements in the syntactic context returned by `c-guess-basic-syntax'
-and stored in `c-syntactic-context' has been changed somewhat to allow
-attaching more information.  They are now lists instead of single cons
-cells.  E.g. a line that previously had the syntactic analysis
-
-((inclass . 11) (topmost-intro . 13))
-
-is now analyzed as
-
-((inclass 11) (topmost-intro 13))
-
-In some cases there are more than one position given for a syntactic
-symbol.
-
-This change might affect code that calls `c-guess-basic-syntax'
-directly, and custom lineup functions if they use
-`c-syntactic-context'.  However, the argument given to lineup
-functions is still a single cons cell with nil or an integer in the
-cdr.
-
-*** API changes for derived modes.
-
-There have been extensive changes "under the hood" which can affect
-derived mode writers.  Some of these changes are likely to cause
-incompatibilities with existing derived modes, but on the other hand
-care has now been taken to make it possible to extend and modify CC
-Mode with less risk of such problems in the future.
-
-**** New language variable system.
-These are variables whose values vary between CC Mode's different
-languages.  See the comment blurb near the top of cc-langs.el.
-
-**** New initialization functions.
-The initialization procedure has been split up into more functions to
-give better control: `c-basic-common-init', `c-font-lock-init', and
-`c-init-language-vars'.
-
-*** Changes in analysis of nested syntactic constructs.
-The syntactic analysis engine has better handling of cases where
-several syntactic constructs appear nested on the same line.  They are
-now handled as if each construct started on a line of its own.
-
-This means that CC Mode now indents some cases differently, and
-although it's more consistent there might be cases where the old way
-gave results that's more to one's liking.  So if you find a situation
-where you think that the indentation has become worse, please report
-it to bug-cc-mode@gnu.org.
-
-**** New syntactic symbol substatement-label.
-This symbol is used when a label is inserted between a statement and
-its substatement.  E.g:
-
-    if (x)
-      x_is_true:
-        do_stuff();
-
-*** Better handling of multiline macros.
-
-**** Syntactic indentation inside macros.
-The contents of multiline #define's are now analyzed and indented
-syntactically just like other code.  This can be disabled by the new
-variable `c-syntactic-indentation-in-macros'.  A new syntactic symbol
-`cpp-define-intro' has been added to control the initial indentation
-inside `#define's.
-
-**** New lineup function `c-lineup-cpp-define'.
-
-Now used by default to line up macro continuation lines.  The behavior
-of this function closely mimics the indentation one gets if the macro
-is indented while the line continuation backslashes are temporarily
-removed.  If syntactic indentation in macros is turned off, it works
-much line `c-lineup-dont-change', which was used earlier, but handles
-empty lines within the macro better.
-
-**** Automatically inserted newlines continues the macro if used within one.
-This applies to the newlines inserted by the auto-newline mode, and to
-`c-context-line-break' and `c-context-open-line'.
-
-**** Better alignment of line continuation backslashes.
-`c-backslash-region' tries to adapt to surrounding backslashes.  New
-variable `c-backslash-max-column' puts a limit on how far out
-backslashes can be moved.
-
-**** Automatic alignment of line continuation backslashes.
-This is controlled by the new variable `c-auto-align-backslashes'.  It
-affects `c-context-line-break', `c-context-open-line' and newlines
-inserted in Auto-Newline mode.
-
-**** Line indentation works better inside macros.
-Regardless whether syntactic indentation and syntactic indentation
-inside macros are enabled or not, line indentation now ignores the
-line continuation backslashes.  This is most noticeable when syntactic
-indentation is turned off and there are empty lines (save for the
-backslash) in the macro.
-
-*** indent-for-comment is more customizable.
-The behavior of M-; (indent-for-comment) is now configurable through
-the variable `c-indent-comment-alist'.  The indentation behavior is
-based on the preceding code on the line, e.g. to get two spaces after
-#else and #endif but indentation to `comment-column' in most other
-cases (something which was hardcoded earlier).
-
-*** New function `c-context-open-line'.
-It's the open-line equivalent of `c-context-line-break'.
-
-*** New clean-ups
-
-**** `comment-close-slash'.
-With this clean-up, a block (i.e. c-style) comment can be terminated by
-typing a slash at the start of a line.
-
-**** `c-one-liner-defun'
-This clean-up compresses a short enough defun (for example, an AWK
-pattern/action pair) onto a single line.  "Short enough" is configurable.
-
-*** New lineup functions
-
-**** `c-lineup-string-cont'
-This lineup function lines up a continued string under the one it
-continues.  E.g:
-
-result = prefix + "A message "
-                  "string.";      <- c-lineup-string-cont
-
-**** `c-lineup-cascaded-calls'
-Lines up series of calls separated by "->" or ".".
-
-**** `c-lineup-knr-region-comment'
-Gives (what most people think is) better indentation of comments in
-the "K&R region" between the function header and its body.
-
-**** `c-lineup-gcc-asm-reg'
-Provides better indentation inside asm blocks.
-
-**** `c-lineup-argcont'
-Lines up continued function arguments after the preceding comma.
-
-*** Added toggle for syntactic indentation.
-The function `c-toggle-syntactic-indentation' can be used to toggle
-syntactic indentation.
-
-*** Better caching of the syntactic context.
-CC Mode caches the positions of the opening parentheses (of any kind)
-of the lists surrounding the point.  Those positions are used in many
-places as anchor points for various searches.  The cache is now
-improved so that it can be reused to a large extent when the point is
-moved.  The less it moves, the less needs to be recalculated.
-
-The effect is that CC Mode should be fast most of the time even when
-opening parens are hung (i.e. aren't in column zero).  It's typically
-only the first time after the point is moved far down in a complex
-file that it'll take noticeable time to find out the syntactic
-context.
-
-*** Statements are recognized in a more robust way.
-Statements are recognized most of the time even when they occur in an
-"invalid" context, e.g. in a function argument.  In practice that can
-happen when macros are involved.
-
-*** Improved the way `c-indent-exp' chooses the block to indent.
-It now indents the block for the closest sexp following the point
-whose closing paren ends on a different line.  This means that the
-point doesn't have to be immediately before the block to indent.
-Also, only the block and the closing line is indented; the current
-line is left untouched.
-
-** Changes in Makefile mode
-
-*** Makefile mode has submodes for automake, gmake, makepp, BSD make and imake.
-
-The former two couldn't be differentiated before, and the latter three
-are new.  Font-locking is robust now and offers new customizable
-faces.
-
-*** The variable `makefile-query-one-target-method' has been renamed
-to `makefile-query-one-target-method-function'.  The old name is still
-available as alias.
-
-** Sql changes
-
-*** The variable `sql-product' controls the highlighting of different
-SQL dialects.  This variable can be set globally via Customize, on a
-buffer-specific basis via local variable settings, or for the current
-session using the new SQL->Product submenu.  (This menu replaces the
-SQL->Highlighting submenu.)
-
-The following values are supported:
-
-    ansi       ANSI Standard (default)
-    db2                DB2
-    informix    Informix
-    ingres      Ingres
-    interbase  Interbase
-    linter     Linter
-    ms         Microsoft
-    mysql      MySQL
-    oracle     Oracle
-    postgres   Postgres
-    solid       Solid
-    sqlite      SQLite
-    sybase      Sybase
-
-The current product name will be shown on the mode line following the
-SQL mode indicator.
-
-The technique of setting `sql-mode-font-lock-defaults' directly in
-your `.emacs' will no longer establish the default highlighting -- Use
-`sql-product' to accomplish this.
-
-ANSI keywords are always highlighted.
-
-*** The function `sql-add-product-keywords' can be used to add
-font-lock rules to the product specific rules.  For example, to have
-all identifiers ending in `_t' under MS SQLServer treated as a type,
-you would use the following line in your .emacs file:
-
-  (sql-add-product-keywords 'ms
-             '(("\\<\\w+_t\\>" . font-lock-type-face)))
-
-*** Oracle support includes keyword highlighting for Oracle 9i.
-
-Most SQL and PL/SQL keywords are implemented.  SQL*Plus commands are
-highlighted in `font-lock-doc-face'.
-
-*** Microsoft SQLServer support has been significantly improved.
-
-Keyword highlighting for SqlServer 2000 is implemented.
-sql-interactive-mode defaults to use osql, rather than isql, because
-osql flushes its error stream more frequently.  Thus error messages
-are displayed when they occur rather than when the session is
-terminated.
-
-If the username and password are not provided to `sql-ms', osql is
-called with the `-E' command line argument to use the operating system
-credentials to authenticate the user.
-
-*** Postgres support is enhanced.
-Keyword highlighting of Postgres 7.3 is implemented.  Prompting for
-the username and the pgsql `-U' option is added.
-
-*** MySQL support is enhanced.
-Keyword highlighting of MySql 4.0 is implemented.
-
-*** Imenu support has been enhanced to locate tables, views, indexes,
-packages, procedures, functions, triggers, sequences, rules, and
-defaults.
-
-*** Added SQL->Start SQLi Session menu entry which calls the
-appropriate `sql-interactive-mode' wrapper for the current setting of
-`sql-product'.
-
-*** sql.el supports the SQLite interpreter--call 'sql-sqlite'.
-
-** Fortran mode changes
-
-*** F90 mode and Fortran mode have support for `hs-minor-mode' (hideshow).
-It cannot deal with every code format, but ought to handle a sizeable
-majority.
-
-*** F90 mode and Fortran mode have new navigation commands
-`f90-end-of-block', `f90-beginning-of-block', `f90-next-block',
-`f90-previous-block', `fortran-end-of-block',
-`fortran-beginning-of-block'.
-
-*** Fortran mode does more font-locking by default.  Use level 3
-highlighting for the old default.
-
-*** Fortran mode has a new variable `fortran-directive-re'.
-Adapt this to match the format of any compiler directives you use.
-Lines that match are never indented, and are given distinctive font-locking.
-
-*** The new function `f90-backslash-not-special' can be used to change
-the syntax of backslashes in F90 buffers.
-
-** Miscellaneous programming mode changes
-
-*** In sh-script, a continuation line is only indented if the backslash was
-preceded by a SPC or a TAB.
-
-*** Perl mode has a new variable `perl-indent-continued-arguments'.
-
-*** The old Octave mode bindings C-c f and C-c i have been changed
-to C-c C-f and C-c C-i.  The C-c C-i subcommands now have duplicate
-bindings on control characters--thus, C-c C-i C-b is the same as
-C-c C-i b, and so on.
-
-*** Prolog mode has a new variable `prolog-font-lock-keywords'
-to support use of font-lock.
-
-** VC Changes
-
-*** New backends for Subversion and Meta-CVS.
-
-*** The new variable `vc-cvs-global-switches' specifies switches that
-are passed to any CVS command invoked by VC.
-
-These switches are used as "global options" for CVS, which means they
-are inserted before the command name.  For example, this allows you to
-specify a compression level using the `-z#' option for CVS.
-
-*** The key C-x C-q only changes the read-only state of the buffer
-(toggle-read-only).  It no longer checks files in or out.
-
-We made this change because we held a poll and found that many users
-were unhappy with the previous behavior.  If you do prefer this
-behavior, you can bind `vc-toggle-read-only' to C-x C-q in your
-`.emacs' file:
-
-    (global-set-key "\C-x\C-q" 'vc-toggle-read-only)
-
-The function `vc-toggle-read-only' will continue to exist.
-
-*** VC-Annotate mode enhancements
-
-In VC-Annotate mode, you can now use the following key bindings for
-enhanced functionality to browse the annotations of past revisions, or
-to view diffs or log entries directly from vc-annotate-mode:
-
-    P:  annotates the previous revision
-    N:  annotates the next revision
-    J:  annotates the revision at line
-    A:  annotates the revision previous to line
-    D:  shows the diff of the revision at line with its previous revision
-    L:  shows the log of the revision at line
-    W:  annotates the workfile (most up to date) version
-
-** pcl-cvs changes
-
-*** In pcl-cvs mode, there is a new `d y' command to view the diffs
-between the local version of the file and yesterday's head revision
-in the repository.
-
-*** In pcl-cvs mode, there is a new `d r' command to view the changes
-anyone has committed to the repository since you last executed
-`checkout', `update' or `commit'.  That means using cvs diff options
--rBASE -rHEAD.
-
-** Diff changes
-
-*** M-x diff uses Diff mode instead of Compilation mode.
-
-*** Diff mode key bindings changed.
-
-These are the new bindings:
-
-C-c C-e   diff-ediff-patch  (old M-A)
-C-c C-n   diff-restrict-view   (old M-r)
-C-c C-r   diff-reverse-direction  (old M-R)
-C-c C-u   diff-context->unified   (old M-U)
-C-c C-w   diff-refine-hunk  (old C-c C-r)
-
-To convert unified to context format, use C-u C-c C-u.
-In addition, C-c C-u now operates on the region
-in Transient Mark mode when the mark is active.
-
-** EDiff changes.
-
-***  When comparing directories.
-Typing D brings up a buffer that lists the differences between the contents of
-directories.  Now it is possible to use this buffer to copy the missing files
-from one directory to another.
-
-*** When comparing files or buffers.
-Typing the = key now offers to perform the word-by-word comparison of the
-currently highlighted regions in an inferior Ediff session.  If you answer 'n'
-then it reverts to the old behavior and asks the user to select regions for
-comparison.
-
-*** The new command `ediff-backup' compares a file with its most recent
-backup using `ediff'.  If you specify the name of a backup file,
-`ediff-backup' compares it with the file of which it is a backup.
-
-** Etags changes.
-
-*** New regular expressions features
-
-**** New syntax for regular expressions, multi-line regular expressions.
-
-The syntax --ignore-case-regexp=/regex/ is now undocumented and retained
-only for backward compatibility.  The new equivalent syntax is
---regex=/regex/i.  More generally, it is --regex=/TAGREGEX/TAGNAME/MODS,
-where `/TAGNAME' is optional, as usual, and MODS is a string of 0 or
-more characters among `i' (ignore case), `m' (multi-line) and `s'
-(single-line).  The `m' and `s' modifiers behave as in Perl regular
-expressions: `m' allows regexps to match more than one line, while `s'
-(which implies `m') means that `.' matches newlines.  The ability to
-span newlines allows writing of much more powerful regular expressions
-and rapid prototyping for tagging new languages.
-
-**** Regular expressions can use char escape sequences as in GCC.
-
-The escaped character sequence \a, \b, \d, \e, \f, \n, \r, \t, \v,
-respectively, stand for the ASCII characters BEL, BS, DEL, ESC, FF, NL,
-CR, TAB, VT.
-
-**** Regular expressions can be bound to a given language.
-
-The syntax --regex={LANGUAGE}REGEX means that REGEX is used to make tags
-only for files of language LANGUAGE, and ignored otherwise.  This is
-particularly useful when storing regexps in a file.
-
-**** Regular expressions can be read from a file.
-
-The --regex=@regexfile option means read the regexps from a file, one
-per line.  Lines beginning with space or tab are ignored.
-
-*** New language parsing features
-
-**** New language HTML.
-
-Tags are generated for `title' as well as `h1', `h2', and `h3'.  Also,
-when `name=' is used inside an anchor and whenever `id=' is used.
-
-**** New language PHP.
-
-Functions, classes and defines are tags.  If the --members option is
-specified to etags, variables are tags also.
-
-**** New language Lua.
-
-All functions are tagged.
-
-**** The `::' qualifier triggers C++ parsing in C file.
-
-Previously, only the `template' and `class' keywords had this effect.
-
-**** The GCC __attribute__ keyword is now recognized and ignored.
-
-**** In C and derived languages, etags creates tags for #undef
-
-**** In Makefiles, constants are tagged.
-
-If you want the old behavior instead, thus avoiding to increase the
-size of the tags file, use the --no-globals option.
-
-**** In Perl, packages are tags.
-
-Subroutine tags are named from their package.  You can jump to sub tags
-as you did before, by the sub name, or additionally by looking for
-package::sub.
-
-**** In Prolog, etags creates tags for rules in addition to predicates.
-
-**** New default keywords for TeX.
-
-The new keywords are def, newcommand, renewcommand, newenvironment and
-renewenvironment.
-
-*** Honor #line directives.
-
-When Etags parses an input file that contains C preprocessor's #line
-directives, it creates tags using the file name and line number
-specified in those directives.  This is useful when dealing with code
-created from Cweb source files.  When Etags tags the generated file, it
-writes tags pointing to the source file.
-
-*** New option --parse-stdin=FILE.
-
-This option is mostly useful when calling etags from programs.  It can
-be used (only once) in place of a file name on the command line.  Etags
-reads from standard input and marks the produced tags as belonging to
-the file FILE.
-
-*** The --members option is now the default.
-
-Use --no-members if you want the old default behaviour of not tagging
-struct members in C, members variables in C++ and variables in PHP.
-
-** Ctags changes.
-
-*** Ctags now allows duplicate tags
-
-** Rmail changes
-
-*** Support for `movemail' from GNU mailutils was added to Rmail.
-
-This version of `movemail' allows you to read mail from a wide range of
-mailbox formats, including remote POP3 and IMAP4 mailboxes with or
-without TLS encryption.  If GNU mailutils is installed on the system
-and its version of `movemail' can be found in exec-path, it will be
-used instead of the native one.
-
-*** The new commands rmail-end-of-message and rmail-summary end-of-message,
-by default bound to `/', go to the end of the current mail message in
-Rmail and Rmail summary buffers.
-
-*** Rmail now displays 5-digit message ids in its summary buffer.
-
-** Gnus package
-
-*** Gnus now includes Sieve and PGG
-
-Sieve is a library for managing Sieve scripts.  PGG is a library to handle
-PGP/MIME.
-
-*** There are many news features, bug fixes and improvements.
-
-See the file GNUS-NEWS or the node "Oort Gnus" in the Gnus manual for details.
-
-** MH-E changes.
-
-Upgraded to MH-E version 8.0.3.  There have been major changes since
-version 5.0.2; see MH-E-NEWS for details.
-
-** Miscellaneous mail changes
-
-*** The new variable `mail-default-directory' specifies
-`default-directory' for mail buffers.  This directory is used for
-auto-save files of mail buffers.  It defaults to "~/".
-
-*** The mode line can indicate new mail in a directory or file.
-
-See the documentation of the user option `display-time-mail-directory'.
-
-** Calendar changes
-
-*** There is a new calendar package, icalendar.el, that can be used to
-convert Emacs diary entries to/from the iCalendar format.
-
-*** The new package cal-html.el writes HTML files with calendar and
-diary entries.
-
-*** The new functions `diary-from-outlook', `diary-from-outlook-gnus',
-and `diary-from-outlook-rmail' can be used to import diary entries
-from Outlook-format appointments in mail messages.  The variable
-`diary-outlook-formats' can be customized to recognize additional
-formats.
-
-*** The procedure for activating appointment reminders has changed:
-use the new function `appt-activate'.  The new variable
-`appt-display-format' controls how reminders are displayed, replacing
-`appt-issue-message', `appt-visible', and `appt-msg-window'.
-
-*** The function `simple-diary-display' now by default sets a header line.
-This can be controlled through the variables `diary-header-line-flag'
-and `diary-header-line-format'.
-
-*** Diary sexp entries can have custom marking in the calendar.
-Diary sexp functions which only apply to certain days (such as
-`diary-block' or `diary-cyclic') now take an optional parameter MARK,
-which is the name of a face or a single-character string indicating
-how to highlight the day in the calendar display.  Specifying a
-single-character string as @var{mark} places the character next to the
-day in the calendar.  Specifying a face highlights the day with that
-face.  This lets you have different colors or markings for vacations,
-appointments, paydays or anything else using a sexp.
-
-*** The meanings of C-x < and C-x > have been interchanged.
-< means to scroll backward in time, and > means to scroll forward.
-
-*** You can now use < and >, instead of C-x < and C-x >, to scroll
-the calendar left or right.
-
-*** The new function `calendar-goto-day-of-year' (g D) prompts for a
-year and day number, and moves to that date.  Negative day numbers
-count backward from the end of the year.
-
-*** The new Calendar function `calendar-goto-iso-week' (g w)
-prompts for a year and a week number, and moves to the first
-day of that ISO week.
-
-*** The functions `holiday-easter-etc' and `holiday-advent' now take
-optional arguments, in order to only report on the specified holiday
-rather than all.  This makes customization of variables such as
-`christian-holidays' simpler.
-
-*** The new variable `calendar-minimum-window-height' affects the
-window generated by the function `generate-calendar-window'.
-
-** Speedbar changes
-
-*** Speedbar items can now be selected by clicking mouse-1, based on
-the `mouse-1-click-follows-link' mechanism.
-
-*** The new command `speedbar-toggle-line-expansion', bound to SPC,
-contracts or expands the line under the cursor.
-
-*** New command `speedbar-create-directory', bound to `M'.
-
-*** The new commands `speedbar-expand-line-descendants' and
-`speedbar-contract-line-descendants', bound to `[' and `]'
-respectively, expand and contract the line under cursor with all of
-its descendents.
-
-*** The new user option `speedbar-use-tool-tips-flag', if non-nil,
-means to display tool-tips for speedbar items.
-
-*** The new user option `speedbar-query-confirmation-method' controls
-how querying is performed for file operations.  A value of 'always
-means to always query before file operations; 'none-but-delete means
-to not query before any file operations, except before a file
-deletion.
-
-*** The new user option `speedbar-select-frame-method' specifies how
-to select a frame for displaying a file opened with the speedbar.  A
-value of 'attached means to use the attached frame (the frame that
-speedbar was started from.)  A number such as 1 or -1 means to pass
-that number to `other-frame'.
-
-*** SPC and DEL are no longer bound to scroll up/down in the speedbar
-keymap.
-
-*** The frame management code in speedbar.el has been split into a new
-`dframe' library.  Emacs Lisp code that makes use of the speedbar
-should use `dframe-attached-frame' instead of
-`speedbar-attached-frame', `dframe-timer' instead of `speedbar-timer',
-`dframe-close-frame' instead of `speedbar-close-frame', and
-`dframe-activity-change-focus-flag' instead of
-`speedbar-activity-change-focus-flag'.  The variables
-`speedbar-update-speed' and `speedbar-navigating-speed' are also
-obsolete; use `dframe-update-speed' instead.
-
-** battery.el changes
-
-*** display-battery-mode replaces display-battery.
-
-*** battery.el now works on recent versions of OS X.
-
-** Games
-
-*** The game `mpuz' is enhanced.
-
-`mpuz' now allows the 2nd factor not to have two identical digits.  By
-default, all trivial operations involving whole lines are performed
-automatically.  The game uses faces for better visual feedback.
-
-** Obsolete and deleted packages
-
-*** fast-lock.el and lazy-lock.el are obsolete.  Use jit-lock.el instead.
-
-*** iso-acc.el is now obsolete.  Use one of the latin input methods instead.
-
-*** zone-mode.el is now obsolete.  Use dns-mode.el instead.
-
-*** cplus-md.el has been deleted.
-
-** Miscellaneous
-
-*** The variable `woman-topic-at-point' is renamed
-to `woman-use-topic-at-point' and behaves differently: if this
-variable is non-nil, the `woman' command uses the word at point
-automatically, without asking for a confirmation.  Otherwise, the word
-at point is suggested as default, but not inserted at the prompt.
-
-*** You can now customize `fill-nobreak-predicate' to control where
-filling can break lines.  The value is now normally a list of
-functions, but it can also be a single function, for compatibility.
-
-Emacs provide two predicates, `fill-single-word-nobreak-p' and
-`fill-french-nobreak-p', for use as the value of
-`fill-nobreak-predicate'.
-
-*** M-x view-file and commands that use it now avoid interfering
-with special modes such as Tar mode.
-
-*** `global-whitespace-mode' is a new alias for `whitespace-global-mode'.
-
-*** The saveplace.el package now filters out unreadable files.
-
-When you exit Emacs, the saved positions in visited files no longer
-include files that aren't readable, e.g. files that don't exist.
-Customize the new option `save-place-forget-unreadable-files' to nil
-to get the old behavior.  The new options `save-place-save-skipped'
-and `save-place-skip-check-regexp' allow further fine-tuning of this
-feature.
-
-*** Commands `winner-redo' and `winner-undo', from winner.el, are now
-bound to C-c <left> and C-c <right>, respectively.  This is an
-incompatible change.
-
-*** The type-break package now allows `type-break-file-name' to be nil
-and if so, doesn't store any data across sessions.  This is handy if
-you don't want the `.type-break' file in your home directory or are
-annoyed by the need for interaction when you kill Emacs.
-
-*** `ps-print' can now print characters from the mule-unicode charsets.
-
-Printing text with characters from the mule-unicode-* sets works with
-`ps-print', provided that you have installed the appropriate BDF
-fonts.  See the file INSTALL for URLs where you can find these fonts.
-
-*** New command `strokes-global-set-stroke-string'.
-This is like `strokes-global-set-stroke', but it allows you to bind
-the stroke directly to a string to insert.  This is convenient for
-using strokes as an input method.
-
-*** In Outline mode, `hide-body' no longer hides lines at the top
-of the file that precede the first header line.
-
-*** `hide-ifdef-mode' now uses overlays rather than selective-display
-to hide its text.  This should be mostly transparent but slightly
-changes the behavior of motion commands like C-e and C-p.
-
-*** In Artist mode the variable `artist-text-renderer' has been
-renamed to `artist-text-renderer-function'.  The old name is still
-available as alias.
-
-*** In Enriched mode, `set-left-margin' and `set-right-margin' are now
-by default bound to `C-c [' and `C-c ]' instead of the former `C-c C-l'
-and `C-c C-r'.
-
-*** `partial-completion-mode' now handles partial completion on directory names.
-
-*** You can now disable pc-selection-mode after enabling it.
-
-M-x pc-selection-mode behaves like a proper minor mode, and with no
-argument it toggles the mode.  Turning off PC-Selection mode restores
-the global key bindings that were replaced by turning on the mode.
-
-*** `uniquify-strip-common-suffix' tells uniquify to prefer
-`file|dir1' and `file|dir2' to `file|dir1/subdir' and `file|dir2/subdir'.
-
-*** New user option `add-log-always-start-new-record'.
-
-When this option is enabled, M-x add-change-log-entry always
-starts a new record regardless of when the last record is.
-
-*** M-x compare-windows now can automatically skip non-matching text to
-resync points in both windows.
-
-*** PO translation files are decoded according to their MIME headers
-when Emacs visits them.
-
-*** Telnet now prompts you for a port number with C-u M-x telnet.
-
-*** calculator.el now has radix grouping mode.
-
-To enable this, set `calculator-output-radix' non-nil.  In this mode a
-separator character is used every few digits, making it easier to see
-byte boundaries etc.  For more info, see the documentation of the
-variable `calculator-radix-grouping-mode'.
-
-*** LDAP support now defaults to ldapsearch from OpenLDAP version 2.
-
-*** The terminal emulation code in term.el has been improved; it can
-run most curses applications now.
-
-*** Support for `magic cookie' standout modes has been removed.
-
-Emacs still works on terminals that require magic cookies in order to
-use standout mode, but they can no longer display mode-lines in
-inverse-video.
-
-\f
-* Changes in Emacs 22.1 on non-free operating systems
-
-** The HOME directory defaults to Application Data under the user profile.
-
-If you used a previous version of Emacs without setting the HOME
-environment variable and a `.emacs' was saved, then Emacs will continue
-using C:/ as the default HOME.  But if you are installing Emacs afresh,
-the default location will be the "Application Data" (or similar
-localized name) subdirectory of your user profile.  A typical location
-of this directory is "C:\Documents and Settings\USERNAME\Application Data",
-where USERNAME is your user name.
-
-This change means that users can now have their own `.emacs' files on
-shared computers, and the default HOME directory is less likely to be
-read-only on computers that are administered by someone else.
-
-** Images are now supported on MS Windows.
-
-PBM and XBM images are supported out of the box.  Other image formats
-depend on external libraries.  All of these libraries have been ported
-to Windows, and can be found in both source and binary form at
-http://gnuwin32.sourceforge.net/.  Note that libpng also depends on
-zlib, and tiff depends on the version of jpeg that it was compiled
-against.  For additional information, see nt/INSTALL.
-
-** Sound is now supported on MS Windows.
-
-WAV format is supported on all versions of Windows, other formats such
-as AU, AIFF and MP3 may be supported in the more recent versions of
-Windows, or when other software provides hooks into the system level
-sound support for those formats.
-
-** Tooltips now work on MS Windows.
-
-See the Emacs 21.1 NEWS entry for tooltips for details.
-
-** Pointing devices with more than 3 buttons are now supported on MS Windows.
-
-The new variable `w32-pass-extra-mouse-buttons-to-system' controls
-whether Emacs should handle the extra buttons itself (the default), or
-pass them to Windows to be handled with system-wide functions.
-
-** Passing resources on the command line now works on MS Windows.
-
-You can use --xrm to pass resource settings to Emacs, overriding any
-existing values.  For example:
-
-  emacs --xrm "Emacs.Background:red" --xrm "Emacs.Geometry:100x20"
-
-will start up Emacs on an initial frame of 100x20 with red background,
-irrespective of geometry or background setting on the Windows registry.
-
-** Emacs takes note of colors defined in Control Panel on MS-Windows.
-
-The Control Panel defines some default colors for applications in much
-the same way as wildcard X Resources do on X.  Emacs now adds these
-colors to the colormap prefixed by System (eg SystemMenu for the
-default Menu background, SystemMenuText for the foreground), and uses
-some of them to initialize some of the default faces.
-`list-colors-display' shows the list of System color names, in case
-you wish to use them in other faces.
-
-** Running in a console window in Windows now uses the console size.
-
-Previous versions of Emacs erred on the side of having a usable Emacs
-through telnet, even though that was inconvenient if you use Emacs in
-a local console window with a scrollback buffer.  The default value of
-w32-use-full-screen-buffer is now nil, which favors local console
-windows.  Recent versions of Windows telnet also work well with this
-setting.  If you are using an older telnet server then Emacs detects
-that the console window dimensions that are reported are not sane, and
-defaults to 80x25.  If you use such a telnet server regularly at a size
-other than 80x25, you can still manually set
-w32-use-full-screen-buffer to t.
-
-** Different shaped mouse pointers are supported on MS Windows.
-
-The mouse pointer changes shape depending on what is under the pointer.
-
-** On MS Windows, the "system caret" now follows the cursor.
-
-This enables Emacs to work better with programs that need to track the
-cursor, for example screen magnifiers and text to speech programs.
-When such a program is in use, the system caret is made visible
-instead of Emacs drawing its own cursor. This seems to be required by
-some programs. The new variable w32-use-visible-system-caret allows
-the caret visibility to be manually toggled.
-
-** On MS Windows NT/W2K/XP, Emacs uses Unicode for clipboard operations.
-
-Those systems use Unicode internally, so this allows Emacs to share
-multilingual text with other applications.  On other versions of
-MS Windows, Emacs now uses the appropriate locale coding-system, so
-the clipboard should work correctly for your local language without
-any customizations.
-
-** On Mac OS, `keyboard-coding-system' changes based on the keyboard script.
-
-** The variable `mac-keyboard-text-encoding' and the constants
-`kTextEncodingMacRoman', `kTextEncodingISOLatin1', and
-`kTextEncodingISOLatin2' are obsolete.
-
-** The variable `mac-command-key-is-meta' is obsolete.  Use
-`mac-command-modifier' and `mac-option-modifier' instead.
-\f
-* Incompatible Lisp Changes in Emacs 22.1
-
-** Mode line display ignores text properties as well as the
-:propertize and :eval forms in the value of a variable whose
-`risky-local-variable' property is nil.
-
-The function `comint-send-input' now accepts 3 optional arguments:
-
-  (comint-send-input &optional no-newline artificial)
-
-Callers sending input not from the user should use bind the 3rd
-argument `artificial' to a non-nil value, to prevent Emacs from
-deleting the part of subprocess output that matches the input.
-
-** The `read-file-name' function now returns a null string if the
-user just types RET.
-
-** The variables post-command-idle-hook and post-command-idle-delay have
-been removed.  Use run-with-idle-timer instead.
-
-** A hex or octal escape in a string constant forces the string to
-be multibyte or unibyte, respectively.
-
-** The explicit method of creating a display table element by
-combining a face number and a character code into a numeric
-glyph code is deprecated.
-
-Instead, the new functions `make-glyph-code', `glyph-char', and
-`glyph-face' must be used to create and decode glyph codes in
-display tables.
-
-** `suppress-keymap' now works by remapping `self-insert-command' to
-the command `undefined'.  (In earlier Emacs versions, it used
-`substitute-key-definition' to rebind self inserting characters to
-`undefined'.)
-
-** The third argument of `accept-process-output' is now milliseconds.
-It used to be microseconds.
-
-** The function find-operation-coding-system may be called with a cons
-(FILENAME . BUFFER) in the second argument if the first argument
-OPERATION is `insert-file-contents', and thus a function registered in
-`file-coding-system-alist' is also called with such an argument.
-
-** When Emacs receives a USR1 or USR2 signal, this generates
-input events: sigusr1 or sigusr2.  Use special-event-map to
-handle these events.
-
-** The variable `memory-full' now remains t until
-there is no longer a shortage of memory.
-
-** Support for Mocklisp has been removed.
-
-\f
-* Lisp Changes in Emacs 22.1
-
-** General Lisp changes:
-
-*** New syntax: \s now stands for the SPACE character.
-
-`?\s' is a new way to write the space character.  You must make sure
-it is not followed by a dash, since `?\s-...' indicates the "super"
-modifier.  However, it would be strange to write a character constant
-and a following symbol (beginning with `-') with no space between
-them.
-
-`\s' stands for space in strings, too, but it is not really meant for
-strings; it is easier and nicer just to write a space.
-
-*** New syntax: \uXXXX and \UXXXXXXXX specify Unicode code points in hex.
-
-For instance, you can use "\u0428" to specify a string consisting of
-CYRILLIC CAPITAL LETTER SHA, or `"U0001D6E2" to specify one consisting
-of MATHEMATICAL ITALIC CAPITAL ALPHA (the latter is greater than
-#xFFFF and thus needs the longer syntax).
-
-This syntax works for both character constants and strings.
-
-*** New function `unsafep' determines whether a Lisp form is safe.
-
-It returns nil if the given Lisp form can't possibly do anything
-dangerous; otherwise it returns a reason why the form might be unsafe
-(calls unknown function, alters global variable, etc.).
-
-*** The function `eql' is now available without requiring the CL package.
-
-*** The new function `memql' is like `memq', but uses `eql' for comparison,
-that is, floats are compared by value and other elements with `eq'.
-
-*** New functions `string-or-null-p' and `booleanp'.
-
-`string-or-null-p' returns non-nil if OBJECT is a string or nil.
-`booleanp' returns non-nil if OBJECT is t or nil.
-
-*** `makehash' is now obsolete.  Use `make-hash-table' instead.
-
-*** Minor change in the function `format'.
-
-Some flags that were accepted but not implemented (such as "*") are no
-longer accepted.
-
-*** `add-to-list' takes an optional third argument, APPEND.
-
-If APPEND is non-nil, the new element gets added at the end of the
-list instead of at the beginning.  This change actually occurred in
-Emacs 21.1, but was not documented then.
-
-*** New function `add-to-ordered-list' is like `add-to-list' but
-associates a numeric ordering of each element added to the list.
-
-*** New function `add-to-history' adds an element to a history list.
-
-Lisp packages should use this function to add elements to their
-history lists.
-
-If `history-delete-duplicates' is non-nil, it removes duplicates of
-the new element from the history list it updates.
-
-*** New function `copy-tree' makes a copy of a tree.
-
-It recursively copies through both CARs and CDRs.
-
-*** New function `delete-dups' deletes `equal' duplicate elements from a list.
-
-It modifies the list destructively, like `delete'.  Of several `equal'
-occurrences of an element in the list, the one that's kept is the
-first one.
-
-*** New function `rassq-delete-all'.
-
-(rassq-delete-all VALUE ALIST) deletes, from ALIST, each element whose
-CDR is `eq' to the specified value.
-
-*** Functions `get' and `plist-get' no longer give errors for bad plists.
-
-They return nil for a malformed property list or if the list is
-cyclic.
-
-*** New functions `lax-plist-get' and `lax-plist-put'.
-
-They are like `plist-get' and `plist-put', except that they compare
-the property name using `equal' rather than `eq'.
-
-*** The function `number-sequence' makes a list of equally-separated numbers.
-
-For instance, (number-sequence 4 9) returns (4 5 6 7 8 9).  By
-default, the separation is 1, but you can specify a different
-separation as the third argument.  (number-sequence 1.5 6 2) returns
-(1.5 3.5 5.5).
-
-*** New variables `most-positive-fixnum' and `most-negative-fixnum'.
-
-They hold the largest and smallest possible integer values.
-
-*** The function `expt' handles negative exponents differently.
-The value for `(expt A B)', if both A and B are integers and B is
-negative, is now a float.  For example: (expt 2 -2) => 0.25.
-
-*** The function `atan' now accepts an optional second argument.
-
-When called with 2 arguments, as in `(atan Y X)', `atan' returns the
-angle in radians between the vector [X, Y] and the X axis.  (This is
-equivalent to the standard C library function `atan2'.)
-
-*** New macro `with-case-table'
-
-This executes the body with the case table temporarily set to a given
-case table.
-
-*** New macro `with-local-quit' temporarily allows quitting.
-
-A quit inside the body of `with-local-quit' is caught by the
-`with-local-quit' form itself, but another quit will happen later once
-the code that has inhibited quitting exits.
-
-This is for use around potentially blocking or long-running code
-inside timer functions and `post-command-hook' functions.
-
-*** New macro `define-obsolete-function-alias'.
-
-This combines `defalias' and `make-obsolete'.
-
-*** New macro `eval-at-startup' specifies expressions to
-evaluate when Emacs starts up.  If this is done after startup,
-it evaluates those expressions immediately.
-
-This is useful in packages that can be preloaded.
-
-*** New function `macroexpand-all' expands all macros in a form.
-
-It is similar to the Common-Lisp function of the same name.
-One difference is that it guarantees to return the original argument
-if no expansion is done, which can be tested using `eq'.
-
-*** A function or macro's doc string can now specify the calling pattern.
-
-You put this info in the doc string's last line.  It should be
-formatted so as to match the regexp "\n\n(fn .*)\\'".  If you don't
-specify this explicitly, Emacs determines it from the actual argument
-names.  Usually that default is right, but not always.
-
-*** New variable `print-continuous-numbering'.
-
-When this is non-nil, successive calls to print functions use a single
-numbering scheme for circular structure references.  This is only
-relevant when `print-circle' is non-nil.
-
-When you bind `print-continuous-numbering' to t, you should
-also bind `print-number-table' to nil.
-
-*** `list-faces-display' takes an optional argument, REGEXP.
-
-If it is non-nil, the function lists only faces matching this regexp.
-
-*** New hook `command-error-function'.
-
-By setting this variable to a function, you can control
-how the editor command loop shows the user an error message.
-
-*** `debug-on-entry' accepts primitive functions that are not special forms.
-
-** Lisp code indentation features:
-
-*** The `defmacro' form can contain indentation and edebug declarations.
-
-These declarations specify how to indent the macro calls in Lisp mode
-and how to debug them with Edebug.  You write them like this:
-
-   (defmacro NAME LAMBDA-LIST [DOC-STRING] [DECLARATION ...] ...)
-
-DECLARATION is a list `(declare DECLARATION-SPECIFIER ...)'.  The
-possible declaration specifiers are:
-
-(indent INDENT)
-       Set NAME's `lisp-indent-function' property to INDENT.
-
-(edebug DEBUG)
-       Set NAME's `edebug-form-spec' property to DEBUG.  (This is
-       equivalent to writing a `def-edebug-spec' for the macro,
-       but this is cleaner.)
-
-*** cl-indent now allows customization of Indentation of backquoted forms.
-
-See the new user option `lisp-backquote-indentation'.
-
-*** cl-indent now handles indentation of simple and extended `loop' forms.
-
-The new user options `lisp-loop-keyword-indentation',
-`lisp-loop-forms-indentation', and `lisp-simple-loop-indentation' can
-be used to customize the indentation of keywords and forms in loop
-forms.
-
-** Variable aliases:
-
-*** New function: defvaralias ALIAS-VAR BASE-VAR [DOCSTRING]
-
-This function defines the symbol ALIAS-VAR as a variable alias for
-symbol BASE-VAR.  This means that retrieving the value of ALIAS-VAR
-returns the value of BASE-VAR, and changing the value of ALIAS-VAR
-changes the value of BASE-VAR.
-
-DOCSTRING, if present, is the documentation for ALIAS-VAR; else it has
-the same documentation as BASE-VAR.
-
-*** The macro `define-obsolete-variable-alias' combines `defvaralias' and
-`make-obsolete-variable'.
-
-*** New function: indirect-variable VARIABLE
-
-This function returns the variable at the end of the chain of aliases
-of VARIABLE.  If VARIABLE is not a symbol, or if VARIABLE is not
-defined as an alias, the function returns VARIABLE.
-
-It might be noteworthy that variables aliases work for all kinds of
-variables, including buffer-local and frame-local variables.
-
-** defcustom changes:
-
-*** The package-version keyword has been added to provide
-`customize-changed-options' functionality to packages in the future.
-Developers who make use of this keyword must also update the new
-variable `customize-package-emacs-version-alist'.
-
-*** The new customization type `float' requires a floating point number.
-
-** String changes:
-
-*** A hex escape in a string constant forces the string to be multibyte.
-
-*** An octal escape in a string constant forces the string to be unibyte.
-
-*** New function `string-to-multibyte' converts a unibyte string to a
-multibyte string with the same individual character codes.
-
-*** `split-string' now includes null substrings in the returned list if
-the optional argument SEPARATORS is non-nil and there are matches for
-SEPARATORS at the beginning or end of the string.  If SEPARATORS is
-nil, or if the new optional third argument OMIT-NULLS is non-nil, all
-empty matches are omitted from the returned list.
-
-*** The new function `assoc-string' replaces `assoc-ignore-case' and
-`assoc-ignore-representation', which are still available, but have
-been declared obsolete.
-
-*** New function `substring-no-properties' returns a substring without
-text properties.
-
-** Displaying warnings to the user.
-
-See the functions `warn' and `display-warning', or the Lisp Manual.
-If you want to be sure the warning will not be overlooked, this
-facility is much better than using `message', since it displays
-warnings in a separate window.
-
-** Progress reporters.
-
-These provide a simple and uniform way for commands to present
-progress messages for the user.
-
-See the new functions `make-progress-reporter',
-`progress-reporter-update', `progress-reporter-force-update',
-`progress-reporter-done', and `dotimes-with-progress-reporter'.
-
-** Buffer positions:
-
-*** Function `compute-motion' now calculates the usable window
-width if the WIDTH argument is nil.  If the TOPOS argument is nil,
-the usable window height and width is used.
-
-*** The `line-move', `scroll-up', and `scroll-down' functions will now
-modify the window vscroll to scroll through display rows that are
-taller that the height of the window, for example in the presence of
-large images.  To disable this feature, bind the new variable
-`auto-window-vscroll' to nil.
-
-*** The argument to `forward-word', `backward-word' is optional.
-
-It defaults to 1.
-
-*** Argument to `forward-to-indentation' and `backward-to-indentation' is optional.
-
-It defaults to 1.
-
-*** `field-beginning' and `field-end' take new optional argument, LIMIT.
-
-This argument tells them not to search beyond LIMIT.  Instead they
-give up and return LIMIT.
-
-*** New function `window-line-height' is an efficient way to get
-information about a specific text line in a window provided that the
-window's display is up-to-date.
-
-*** New function `line-number-at-pos' returns the line number of a position.
-
-It an optional buffer position argument that defaults to point.
-
-*** Function `pos-visible-in-window-p' now returns the pixel coordinates
-and partial visibility state of the corresponding row, if the PARTIALLY
-arg is non-nil.
-
-*** New functions `posn-at-point' and `posn-at-x-y' return
-click-event-style position information for a given visible buffer
-position or for a given window pixel coordinate.
-
-*** New function `mouse-on-link-p' tests if a position is in a clickable link.
-
-This is the function used by the new `mouse-1-click-follows-link'
-functionality.
-
-** Text modification:
-
-*** The new function `buffer-chars-modified-tick' returns a buffer's
-tick counter for changes to characters.  Each time text in that buffer
-is inserted or deleted, the character-change counter is updated to the
-tick counter (`buffer-modified-tick').  Text property changes leave it
-unchanged.
-
-*** The new function `insert-for-yank' normally works like `insert', but
-removes the text properties in the `yank-excluded-properties' list
-and handles the `yank-handler' text property.
-
-*** The new function `insert-buffer-substring-as-yank' is like
-`insert-for-yank' except that it gets the text from another buffer as
-in `insert-buffer-substring'.
-
-*** The new function `insert-buffer-substring-no-properties' is like
-`insert-buffer-substring', but removes all text properties from the
-inserted substring.
-
-*** The new function `filter-buffer-substring' extracts a buffer
-substring, passes it through a set of filter functions, and returns
-the filtered substring.  Use it instead of `buffer-substring' or
-`delete-and-extract-region' when copying text into a user-accessible
-data structure, such as the kill-ring, X clipboard, or a register.
-
-The list of filter function is specified by the new variable
-`buffer-substring-filters'.  For example, Longlines mode adds to
-`buffer-substring-filters' to remove soft newlines from the copied
-text.
-
-*** Function `translate-region' accepts also a char-table as TABLE
-argument.
-
-*** The new translation table `translation-table-for-input'
-is used for customizing self-insertion.  The character to
-be inserted is translated through it.
-
-*** Text clones.
-
-The new function `text-clone-create'.  Text clones are chunks of text
-that are kept identical by transparently propagating changes from one
-clone to the other.
-
-*** The function `insert-string' is now obsolete.
-
-** Filling changes.
-
-*** In determining an adaptive fill prefix, Emacs now tries the function in
-`adaptive-fill-function' _before_ matching the buffer line against
-`adaptive-fill-regexp' rather than _after_ it.
-
-** Atomic change groups.
-
-To perform some changes in the current buffer "atomically" so that
-they either all succeed or are all undone, use `atomic-change-group'
-around the code that makes changes.  For instance:
-
-  (atomic-change-group
-    (insert foo)
-    (delete-region x y))
-
-If an error (or other nonlocal exit) occurs inside the body of
-`atomic-change-group', it unmakes all the changes in that buffer that
-were during the execution of the body.  The change group has no effect
-on any other buffers--any such changes remain.
-
-If you need something more sophisticated, you can directly call the
-lower-level functions that `atomic-change-group' uses.  Here is how.
-
-To set up a change group for one buffer, call `prepare-change-group'.
-Specify the buffer as argument; it defaults to the current buffer.
-This function returns a "handle" for the change group.  You must save
-the handle to activate the change group and then finish it.
-
-Before you change the buffer again, you must activate the change
-group.  Pass the handle to `activate-change-group' afterward to
-do this.
-
-After you make the changes, you must finish the change group.  You can
-either accept the changes or cancel them all.  Call
-`accept-change-group' to accept the changes in the group as final;
-call `cancel-change-group' to undo them all.
-
-You should use `unwind-protect' to make sure the group is always
-finished.  The call to `activate-change-group' should be inside the
-`unwind-protect', in case the user types C-g just after it runs.
-(This is one reason why `prepare-change-group' and
-`activate-change-group' are separate functions.)  Once you finish the
-group, don't use the handle again--don't try to finish the same group
-twice.
-
-To make a multibuffer change group, call `prepare-change-group' once
-for each buffer you want to cover, then use `nconc' to combine the
-returned values, like this:
-
-  (nconc (prepare-change-group buffer-1)
-         (prepare-change-group buffer-2))
-
-You can then activate the multibuffer change group with a single call
-to `activate-change-group', and finish it with a single call to
-`accept-change-group' or `cancel-change-group'.
-
-Nested use of several change groups for the same buffer works as you
-would expect.  Non-nested use of change groups for the same buffer
-will lead to undesirable results, so don't let it happen; the first
-change group you start for any given buffer should be the last one
-finished.
-
-** Buffer-related changes:
-
-*** The new function `buffer-local-value' returns the buffer-local
-binding of VARIABLE (a symbol) in buffer BUFFER.  If VARIABLE does not
-have a buffer-local binding in buffer BUFFER, it returns the default
-value of VARIABLE instead.
-
-*** `list-buffers-noselect' now takes an additional argument, BUFFER-LIST.
-
-If it is non-nil, it specifies which buffers to list.
-
-*** `kill-buffer-hook' is now a permanent local.
-
-*** The function `frame-or-buffer-changed-p' now lets you maintain
-various status records in parallel.
-
-It takes a variable (a symbol) as argument.  If the variable is non-nil,
-then its value should be a vector installed previously by
-`frame-or-buffer-changed-p'.  If the frame names, buffer names, buffer
-order, or their read-only or modified flags have changed, since the
-time the vector's contents were recorded by a previous call to
-`frame-or-buffer-changed-p', then the function returns t.  Otherwise
-it returns nil.
-
-On the first call to `frame-or-buffer-changed-p', the variable's
-value should be nil.  `frame-or-buffer-changed-p' stores a suitable
-vector into the variable and returns t.
-
-If the variable is itself nil, then `frame-or-buffer-changed-p' uses,
-for compatibility, an internal variable which exists only for this
-purpose.
-
-*** The function `read-buffer' follows the convention for reading from
-the minibuffer with a default value: if DEF is non-nil, the minibuffer
-prompt provided in PROMPT is edited to show the default value provided
-in DEF before the terminal colon and space.
-
-** Searching and matching changes:
-
-*** New function `looking-back' checks whether a regular expression matches
-the text before point.  Specifying the LIMIT argument bounds how far
-back the match can start; this is a way to keep it from taking too long.
-
-*** The new variable `search-spaces-regexp' controls how to search
-for spaces in a regular expression.  If it is non-nil, it should be a
-regular expression, and any series of spaces stands for that regular
-expression.  If it is nil, spaces stand for themselves.
-
-Spaces inside of constructs such as `[..]' and inside loops such as
-`*', `+', and `?' are never replaced with `search-spaces-regexp'.
-
-*** New regular expression operators, `\_<' and `\_>'.
-
-These match the beginning and end of a symbol.  A symbol is a
-non-empty sequence of either word or symbol constituent characters, as
-specified by the syntax table.
-
-*** `skip-chars-forward' and `skip-chars-backward' now handle
-character classes such as `[:alpha:]', along with individual
-characters and ranges.
-
-*** In `replace-match', the replacement text no longer inherits
-properties from surrounding text.
-
-*** The list returned by `(match-data t)' now has the buffer as a final
-element, if the last match was on a buffer.  `set-match-data'
-accepts such a list for restoring the match state.
-
-*** Functions `match-data' and `set-match-data' now have an optional
-argument `reseat'.  When non-nil, all markers in the match data list
-passed to these functions will be reseated to point to nowhere.
-
-*** rx.el has new corresponding `symbol-start' and `symbol-end' elements.
-
-*** The default value of `sentence-end' is now defined using the new
-variable `sentence-end-without-space', which contains such characters
-that end a sentence without following spaces.
-
-The function `sentence-end' should be used to obtain the value of the
-variable `sentence-end'.  If the variable `sentence-end' is nil, then
-this function returns the regexp constructed from the variables
-`sentence-end-without-period', `sentence-end-double-space' and
-`sentence-end-without-space'.
-
-** Undo changes:
-
-*** `buffer-undo-list' allows programmable elements.
-
-These elements have the form (apply FUNNAME . ARGS), where FUNNAME is
-a symbol other than t or nil.  That stands for a high-level change
-that should be undone by evaluating (apply FUNNAME ARGS).
-
-These entries can also have the form (apply DELTA BEG END FUNNAME . ARGS)
-which indicates that the change which took place was limited to the
-range BEG...END and increased the buffer size by DELTA.
-
-*** If the buffer's undo list for the current command gets longer than
-`undo-outer-limit', garbage collection empties it.  This is to prevent
-it from using up the available memory and choking Emacs.
-
-** Killing and yanking changes:
-
-*** New `yank-handler' text property can be used to control how
-previously killed text on the kill ring is reinserted.
-
-The value of the `yank-handler' property must be a list with one to four
-elements with the following format:
-  (FUNCTION PARAM NOEXCLUDE UNDO).
-
-The `insert-for-yank' function looks for a yank-handler property on
-the first character on its string argument (typically the first
-element on the kill-ring).  If a `yank-handler' property is found,
-the normal behavior of `insert-for-yank' is modified in various ways:
-
-  When FUNCTION is present and non-nil, it is called instead of `insert'
-to insert the string.  FUNCTION takes one argument--the object to insert.
-  If PARAM is present and non-nil, it replaces STRING as the object
-passed to FUNCTION (or `insert'); for example, if FUNCTION is
-`yank-rectangle', PARAM should be a list of strings to insert as a
-rectangle.
-  If NOEXCLUDE is present and non-nil, the normal removal of the
-`yank-excluded-properties' is not performed; instead FUNCTION is
-responsible for removing those properties.  This may be necessary
-if FUNCTION adjusts point before or after inserting the object.
-  If UNDO is present and non-nil, it is a function that will be called
-by `yank-pop' to undo the insertion of the current object.  It is
-called with two arguments, the start and end of the current region.
-FUNCTION can set `yank-undo-function' to override the UNDO value.
-
-*** The functions `kill-new', `kill-append', and `kill-region' now have an
-optional argument to specify the `yank-handler' text property to put on
-the killed text.
-
-*** The function `yank-pop' will now use a non-nil value of the variable
-`yank-undo-function' (instead of `delete-region') to undo the previous
-`yank' or `yank-pop' command (or a call to `insert-for-yank').  The function
-`insert-for-yank' automatically sets that variable according to the UNDO
-element of the string argument's `yank-handler' text property if present.
-
-*** The function `insert-for-yank' now supports strings where the
-`yank-handler' property does not span the first character of the
-string.  The old behavior is available if you call
-`insert-for-yank-1' instead.
-
-** Syntax table changes:
-
-*** The new function `syntax-ppss' provides an efficient way to find the
-current syntactic context at point.
-
-*** The new function `syntax-after' returns the syntax code
-of the character after a specified buffer position, taking account
-of text properties as well as the character code.
-
-*** `syntax-class' extracts the class of a syntax code (as returned
-by `syntax-after').
-
-*** The macro `with-syntax-table' no longer copies the syntax table.
-
-** File operation changes:
-
-*** New vars `exec-suffixes' and `load-suffixes' used when
-searching for an executable or an Emacs Lisp file.
-
-*** New function `locate-file' searches for a file in a list of directories.
-`locate-file' accepts a name of a file to search (a string), and two
-lists: a list of directories to search in and a list of suffixes to
-try; typical usage might use `exec-path' and `load-path' for the list
-of directories, and `exec-suffixes' and `load-suffixes' for the list
-of suffixes.  The function also accepts a predicate argument to
-further filter candidate files.
-
-One advantage of using this function is that the list of suffixes in
-`exec-suffixes' is OS-dependant, so this function will find
-executables without polluting Lisp code with OS dependencies.
-
-*** The new function `file-remote-p' tests a file name and returns
-non-nil if it specifies a remote file (one that Emacs accesses using
-its own special methods and not directly through the file system).
-The value in that case is an identifier for the remote file system.
-
-*** The new hook `before-save-hook' is invoked by `basic-save-buffer'
-before saving buffers.  This allows packages to perform various final
-tasks.  For example, it can be used by the copyright package to make
-sure saved files have the current year in any copyright headers.
-
-*** `file-chase-links' now takes an optional second argument LIMIT which
-specifies the maximum number of links to chase through.  If after that
-many iterations the file name obtained is still a symbolic link,
-`file-chase-links' returns it anyway.
-
-*** Functions `file-name-sans-extension' and `file-name-extension' now
-ignore the leading dots in file names, so that file names such as
-`.emacs' are treated as extensionless.
-
-*** If `buffer-save-without-query' is non-nil in some buffer,
-`save-some-buffers' will always save that buffer without asking (if
-it's modified).
-
-*** `buffer-auto-save-file-format' is the new name for what was
-formerly called `auto-save-file-format'.  It is now a permanent local.
-
-*** `visited-file-modtime' and `calendar-time-from-absolute' now return
-a list of two integers, instead of a cons.
-
-*** The precedence of file name handlers has been changed.
-
-Instead of choosing the first handler that matches,
-`find-file-name-handler' now gives precedence to a file name handler
-that matches nearest the end of the file name.  More precisely, the
-handler whose (match-beginning 0) is the largest is chosen.  In case
-of ties, the old "first matched" rule applies.
-
-*** A file name handler can declare which operations it handles.
-
-You do this by putting an `operation' property on the handler name
-symbol.  The property value should be a list of the operations that
-the handler really handles.  It won't be called for any other
-operations.
-
-This is useful for autoloaded handlers, to prevent them from being
-autoloaded when not really necessary.
-
-*** The function `make-auto-save-file-name' is now handled by file
-name handlers.  This will be exploited for remote files mainly.
-
-*** The function `file-name-completion' accepts an optional argument
-PREDICATE, and rejects completion candidates that don't satisfy PREDICATE.
-
-*** The new primitive `set-file-times' sets a file's access and
-modification times.  Magic file name handlers can handle this
-operation.
-
-** Input changes:
-
-*** Functions `y-or-n-p', `read-char', `read-key-sequence' and the like, that
-display a prompt but don't use the minibuffer, now display the prompt
-using the text properties (esp. the face) of the prompt string.
-
-*** The functions `read-event', `read-char', and `read-char-exclusive'
-have a new optional argument SECONDS.  If non-nil, this specifies a
-maximum time to wait for input, in seconds.  If no input arrives after
-this time elapses, the functions stop waiting and return nil.
-
-*** An interactive specification can now use the code letter `U' to get
-the up-event that was discarded in case the last key sequence read for a
-previous `k' or `K' argument was a down-event; otherwise nil is used.
-
-*** The new interactive-specification `G' reads a file name
-much like `F', but if the input is a directory name (even defaulted),
-it returns just the directory name.
-
-*** (while-no-input BODY...) runs BODY, but only so long as no input
-arrives.  If the user types or clicks anything, BODY stops as if a
-quit had occurred.  `while-no-input' returns the value of BODY, if BODY
-finishes.  It returns nil if BODY was aborted by a quit, and t if
-BODY was aborted by arrival of input.
-
-*** `recent-keys' now returns the last 300 keys.
-
-** Minibuffer changes:
-
-*** The new function `minibufferp' returns non-nil if its optional
-buffer argument is a minibuffer.  If the argument is omitted, it
-defaults to the current buffer.
-
-*** New function `minibuffer-selected-window' returns the window which
-was selected when entering the minibuffer.
-
-*** The `read-file-name' function now takes an additional argument which
-specifies a predicate which the file name read must satisfy.  The
-new variable `read-file-name-predicate' contains the predicate argument
-while reading the file name from the minibuffer; the predicate in this
-variable is used by read-file-name-internal to filter the completion list.
-
-*** The new variable `read-file-name-function' can be used by Lisp code
-to override the built-in `read-file-name' function.
-
-*** The new variable `read-file-name-completion-ignore-case' specifies
-whether completion ignores case when reading a file name with the
-`read-file-name' function.
-
-*** The new function `read-directory-name' is for reading a directory name.
-
-It is like `read-file-name' except that the defaulting works better
-for directories, and completion inside it shows only directories.
-
-*** The new variable `history-add-new-input' specifies whether to add new
-elements in history.  If set to nil, minibuffer reading functions don't
-add new elements to the history list, so it is possible to do this
-afterwards by calling `add-to-history' explicitly.
-
-** Completion changes:
-
-*** The new function `minibuffer-completion-contents' returns the contents
-of the minibuffer just before point.  That is what completion commands
-operate on.
-
-*** The functions `all-completions' and `try-completion' now accept lists
-of strings as well as hash-tables additionally to alists, obarrays
-and functions.  Furthermore, the function `test-completion' is now
-exported to Lisp.  The keys in alists and hash tables can be either
-strings or symbols, which are automatically converted with to strings.
-
-*** The new macro `dynamic-completion-table' supports using functions
-as a dynamic completion table.
-
-  (dynamic-completion-table FUN)
-
-FUN is called with one argument, the string for which completion is required,
-and it should return an alist containing all the intended possible
-completions.  This alist can be a full list of possible completions so that FUN
-can ignore the value of its argument.  If completion is performed in the
-minibuffer, FUN will be called in the buffer from which the minibuffer was
-entered.  `dynamic-completion-table' then computes the completion.
-
-*** The new macro `lazy-completion-table' initializes a variable
-as a lazy completion table.
-
-  (lazy-completion-table VAR FUN)
-
-If the completion table VAR is used for the first time (e.g., by passing VAR
-as an argument to `try-completion'), the function FUN is called with no
-arguments.  FUN must return the completion table that will be stored in VAR.
-If completion is requested in the minibuffer, FUN will be called in the buffer
-from which the minibuffer was entered.  The return value of
-`lazy-completion-table' must be used to initialize the value of VAR.
-
-** Abbrev changes:
-
-*** `define-abbrev' now accepts an optional argument SYSTEM-FLAG.
-
-If non-nil, this marks the abbrev as a "system" abbrev, which means
-that it won't be stored in the user's abbrevs file if he saves the
-abbrevs.  Major modes that predefine some abbrevs should always
-specify this flag.
-
-*** The new function `copy-abbrev-table' copies an abbrev table.
-
-It returns a new abbrev table that is a copy of a given abbrev table.
-
-** Enhancements to keymaps.
-
-*** Cleaner way to enter key sequences.
-
-You can enter a constant key sequence in a more natural format, the
-same one used for saving keyboard macros, using the macro `kbd'.  For
-example,
-
-(kbd "C-x C-f") => "\^x\^f"
-
-Actually, this format has existed since Emacs 20.1.
-
-*** Interactive commands can be remapped through keymaps.
-
-This is an alternative to using `defadvice' or `substitute-key-definition'
-to modify the behavior of a key binding using the normal keymap
-binding and lookup functionality.
-
-When a key sequence is bound to a command, and that command is
-remapped to another command, that command is run instead of the
-original command.
-
-Example:
-Suppose that minor mode `my-mode' has defined the commands
-`my-kill-line' and `my-kill-word', and it wants C-k (and any other key
-bound to `kill-line') to run the command `my-kill-line' instead of
-`kill-line', and likewise it wants to run `my-kill-word' instead of
-`kill-word'.
-
-Instead of rebinding C-k and the other keys in the minor mode map,
-command remapping allows you to directly map `kill-line' into
-`my-kill-line' and `kill-word' into `my-kill-word' using `define-key':
-
-   (define-key my-mode-map [remap kill-line] 'my-kill-line)
-   (define-key my-mode-map [remap kill-word] 'my-kill-word)
-
-When `my-mode' is enabled, its minor mode keymap is enabled too.  So
-when the user types C-k, that runs the command `my-kill-line'.
-
-Only one level of remapping is supported.  In the above example, this
-means that if `my-kill-line' is remapped to `other-kill', then C-k still
-runs `my-kill-line'.
-
-The following changes have been made to provide command remapping:
-
-- Command remappings are defined using `define-key' with a prefix-key
-  `remap', i.e. `(define-key MAP [remap CMD] DEF)' remaps command CMD
-  to definition DEF in keymap MAP.  The definition is not limited to
-  another command; it can be anything accepted for a normal binding.
-
-- The new function `command-remapping' returns the binding for a
-  remapped command in the current keymaps, or nil if not remapped.
-
-- `key-binding' now remaps interactive commands unless the optional
-  third argument NO-REMAP is non-nil.
-
-- `where-is-internal' now returns nil for a remapped command (e.g.
-  `kill-line', when `my-mode' is enabled), and the actual key binding for
-  the command it is remapped to (e.g. C-k for my-kill-line).
-  It also has a new optional fifth argument, NO-REMAP, which inhibits
-  remapping if non-nil (e.g. it returns "C-k" for `kill-line', and
-  "<kill-line>" for `my-kill-line').
-
-- The new variable `this-original-command' contains the original
-  command before remapping.  It is equal to `this-command' when the
-  command was not remapped.
-
-*** The definition of a key-binding passed to define-key can use XEmacs-style
-key-sequences, such as [(control a)].
-
-*** New keymaps for typing file names
-
-Two new keymaps, `minibuffer-local-filename-completion-map'  and
-`minibuffer-local-must-match-filename-map', apply whenever
-Emacs reads a file name in the minibuffer.  These key maps override
-the usual binding of SPC to `minibuffer-complete-word' (so that file
-names with embedded spaces could be typed without the need to quote
-the spaces).
-
-*** New function `current-active-maps' returns a list of currently
-active keymaps.
-
-*** New function `describe-buffer-bindings' inserts the list of all
-defined keys and their definitions.
-
-*** New function `keymap-prompt' returns the prompt string of a keymap.
-
-*** If text has a `keymap' property, that keymap takes precedence
-over minor mode keymaps.
-
-*** The `keymap' property now also works at the ends of overlays and
-text properties, according to their stickiness.  This also means that it
-works with empty overlays.  The same hold for the `local-map' property.
-
-*** `key-binding' will now look up mouse-specific bindings.  The
-keymaps consulted by `key-binding' will get adapted if the key
-sequence is started with a mouse event.  Instead of letting the click
-position be determined from the key sequence itself, it is also
-possible to specify it with an optional argument explicitly.
-
-*** `define-key-after' now accepts keys longer than 1.
-
-*** (map-keymap FUNCTION KEYMAP) applies the function to each binding
-in the keymap.
-
-*** New variable `emulation-mode-map-alists'.
-
-Lisp packages using many minor mode keymaps can now maintain their own
-keymap alist separate from `minor-mode-map-alist' by adding their
-keymap alist to this list.
-
-*** Dense keymaps now handle inheritance correctly.
-
-Previously a dense keymap would hide all of the simple-char key
-bindings of the parent keymap.
-
-** Enhancements to process support
-
-*** Adaptive read buffering of subprocess output.
-
-On some systems, when Emacs reads the output from a subprocess, the
-output data is read in very small blocks, potentially resulting in
-very poor performance.  This behavior can be remedied to some extent
-by setting the new variable `process-adaptive-read-buffering' to a
-non-nil value (the default), as it will automatically delay reading
-from such processes, allowing them to produce more output before
-Emacs tries to read it.
-
-*** Processes now have an associated property list where programs can
-maintain process state and other per-process related information.
-
-Use the new functions `process-get' and `process-put' to access, add,
-and modify elements on this property list.  Use the new functions
-`process-plist' and `set-process-plist' to access and replace the
-entire property list of a process.
-
-*** Function `list-processes' now has an optional argument; if non-nil,
-it lists only the processes whose query-on-exit flag is set.
-
-*** New fns `set-process-query-on-exit-flag' and `process-query-on-exit-flag'.
-
-These replace the old function `process-kill-without-query'.  That
-function is still supported, but new code should use the new
-functions.
-
-*** The new function `call-process-shell-command'.
-
-This executes a shell command synchronously in a separate process.
-
-*** The new function `process-file' is similar to `call-process', but
-obeys file handlers.  The file handler is chosen based on
-`default-directory'.
-
-*** Function `signal-process' now accepts a process object or process
-name in addition to a process id to identify the signaled process.
-
-*** Function `accept-process-output' has a new optional fourth arg
-JUST-THIS-ONE.  If non-nil, only output from the specified process
-is handled, suspending output from other processes.  If value is an
-integer, also inhibit running timers.  This feature is generally not
-recommended, but may be necessary for specific applications, such as
-speech synthesis.
-
-*** A process filter function gets the output as multibyte string
-if the process specifies t for its filter's multibyteness.
-
-That multibyteness is decided by the value of
-`default-enable-multibyte-characters' when the process is created, and
-you can change it later with `set-process-filter-multibyte'.
-
-*** The new function `set-process-filter-multibyte' sets the
-multibyteness of the strings passed to the process's filter.
-
-*** The new function `process-filter-multibyte-p' returns the
-multibyteness of the strings passed to the process's filter.
-
-*** If a process's coding system is `raw-text' or `no-conversion' and its
-buffer is multibyte, the output of the process is at first converted
-to multibyte by `string-to-multibyte' then inserted in the buffer.
-Previously, it was converted to multibyte by `string-as-multibyte',
-which was not compatible with the behavior of file reading.
-
-** Enhanced networking support.
-
-*** The new `make-network-process' function makes network connections.
-It allows opening of stream and datagram connections to a server, as well as
-create a stream or datagram server inside Emacs.
-
-- A server is started using :server t arg.
-- Datagram connection is selected using :type 'datagram arg.
-- A server can open on a random port using :service t arg.
-- Local sockets are supported using :family 'local arg.
-- IPv6 is supported (when available).  You may explicitly select IPv6
-  using :family 'ipv6 arg.
-- Non-blocking connect is supported using :nowait t arg.
-- The process' property list can be initialized using :plist PLIST arg;
-  a copy of the server process' property list is automatically inherited
-  by new client processes created to handle incoming connections.
-
-To test for the availability of a given feature, use featurep like this:
-  (featurep 'make-network-process '(:type datagram))
-  (featurep 'make-network-process '(:family ipv6))
-
-*** The old `open-network-stream' now uses `make-network-process'.
-
-*** `process-contact' has an optional KEY argument.
-
-Depending on this argument, you can get the complete list of network
-process properties or a specific property.  Using :local or :remote as
-the KEY, you get the address of the local or remote end-point.
-
-An Inet address is represented as a 5 element vector, where the first
-4 elements contain the IP address and the fifth is the port number.
-
-*** New functions `stop-process' and `continue-process'.
-
-These functions stop and restart communication through a network
-connection.  For a server process, no connections are accepted in the
-stopped state.  For a client process, no input is received in the
-stopped state.
-
-*** New function `format-network-address'.
-
-This function reformats the Lisp representation of a network address
-to a printable string.  For example, an IP address A.B.C.D and port
-number P is represented as a five element vector [A B C D P], and the
-printable string returned for this vector is "A.B.C.D:P".  See the doc
-string for other formatting options.
-
-*** New function `network-interface-list'.
-
-This function returns a list of network interface names and their
-current network addresses.
-
-*** New function `network-interface-info'.
-
-This function returns the network address, hardware address, current
-status, and other information about a specific network interface.
-
-*** New functions `process-datagram-address', `set-process-datagram-address'.
-
-These functions are used with datagram-based network processes to get
-and set the current address of the remote partner.
-
-*** Deleting a network process with `delete-process' calls the sentinel.
-
-The status message passed to the sentinel for a deleted network
-process is "deleted".  The message passed to the sentinel when the
-connection is closed by the remote peer has been changed to
-"connection broken by remote peer".
-
-** Using window objects:
-
-*** You can now make a window as short as one line.
-
-A window that is just one line tall does not display either a mode
-line or a header line, even if the variables `mode-line-format' and
-`header-line-format' call for them.  A window that is two lines tall
-cannot display both a mode line and a header line at once; if the
-variables call for both, only the mode line actually appears.
-
-*** The new function `window-inside-edges' returns the edges of the
-actual text portion of the window, not including the scroll bar or
-divider line, the fringes, the display margins, the header line and
-the mode line.
-
-*** The new functions `window-pixel-edges' and `window-inside-pixel-edges'
-return window edges in units of pixels, rather than columns and lines.
-
-*** New function `window-body-height'.
-
-This is like `window-height' but does not count the mode line or the
-header line.
-
-*** The new function `adjust-window-trailing-edge' moves the right
-or bottom edge of a window.  It does not move other window edges.
-
-*** The new macro `with-selected-window' temporarily switches the
-selected window without impacting the order of `buffer-list'.
-It saves and restores the current buffer, too.
-
-*** `select-window' takes an optional second argument NORECORD.
-
-This is like `switch-to-buffer'.
-
-*** `save-selected-window' now saves and restores the selected window
-of every frame.  This way, it restores everything that can be changed
-by calling `select-window'.  It also saves and restores the current
-buffer.
-
-*** `set-window-buffer' has an optional argument KEEP-MARGINS.
-
-If non-nil, that says to preserve the window's current margin, fringe,
-and scroll-bar settings.
-
-*** The new function `window-tree' returns a frame's window tree.
-
-*** The functions `get-lru-window' and `get-largest-window' take an optional
-argument `dedicated'.  If non-nil, those functions do not ignore
-dedicated windows.
-
-** Customizable fringe bitmaps
-
-*** There are new display properties, `left-fringe' and `right-fringe',
-that can be used to show a specific bitmap in the left or right fringe
-bitmap of the display line.
-
-Format is `display (left-fringe BITMAP [FACE])', where BITMAP is a
-symbol identifying a fringe bitmap, either built-in or defined with
-`define-fringe-bitmap', and FACE is an optional face name to be used
-for displaying the bitmap instead of the default `fringe' face.
-When specified, FACE is automatically merged with the `fringe' face.
-
-*** New buffer-local variables `fringe-indicator-alist' and
-`fringe-cursor-alist' maps between logical (internal) fringe indicator
-and cursor symbols and the actual fringe bitmaps to be displayed.
-This decouples the logical meaning of the fringe indicators from the
-physical appearance, as well as allowing different fringe bitmaps to
-be used in different windows showing different buffers.
-
-*** New function `define-fringe-bitmap' can now be used to create new
-fringe bitmaps, as well as change the built-in fringe bitmaps.
-
-*** New function `destroy-fringe-bitmap' deletes a fringe bitmap
-or restores a built-in one to its default value.
-
-*** New function `set-fringe-bitmap-face' specifies the face to be
-used for a specific fringe bitmap.  The face is automatically merged
-with the `fringe' face, so normally, the face should only specify the
-foreground color of the bitmap.
-
-*** New function `fringe-bitmaps-at-pos' returns the current fringe
-bitmaps in the display line at a given buffer position.
-
-** Other window fringe features:
-
-*** Controlling the default left and right fringe widths.
-
-The default left and right fringe widths for all windows of a frame
-can now be controlled by setting the `left-fringe' and `right-fringe'
-frame parameters to an integer value specifying the width in pixels.
-Setting the width to 0 effectively removes the corresponding fringe.
-
-The actual default fringe widths for the frame may deviate from the
-specified widths, since the combined fringe widths must match an
-integral number of columns.  The extra width is distributed evenly
-between the left and right fringe.  To force a specific fringe width,
-specify the width as a negative integer (if both widths are negative,
-only the left fringe gets the specified width).
-
-Setting the width to nil (the default), restores the default fringe
-width which is the minimum number of pixels necessary to display any
-of the currently defined fringe bitmaps.  The width of the built-in
-fringe bitmaps is 8 pixels.
-
-*** Per-window fringe and scrollbar settings
-
-**** Windows can now have their own individual fringe widths and
-position settings.
-
-To control the fringe widths of a window, either set the buffer-local
-variables `left-fringe-width', `right-fringe-width', or call
-`set-window-fringes'.
-
-To control the fringe position in a window, that is, whether fringes
-are positioned between the display margins and the window's text area,
-or at the edges of the window, either set the buffer-local variable
-`fringes-outside-margins' or call `set-window-fringes'.
-
-The function `window-fringes' can be used to obtain the current
-settings.  To make `left-fringe-width', `right-fringe-width', and
-`fringes-outside-margins' take effect, you must set them before
-displaying the buffer in a window, or use `set-window-buffer' to force
-an update of the display margins.
-
-**** Windows can now have their own individual scroll-bar settings
-controlling the width and position of scroll-bars.
-
-To control the scroll-bar of a window, either set the buffer-local
-variables `scroll-bar-mode' and `scroll-bar-width', or call
-`set-window-scroll-bars'.  The function `window-scroll-bars' can be
-used to obtain the current settings.  To make `scroll-bar-mode' and
-`scroll-bar-width' take effect, you must set them before displaying
-the buffer in a window, or use `set-window-buffer' to force an update
-of the display margins.
-
-** Redisplay features:
-
-*** `sit-for' can now be called with args (SECONDS &optional NODISP).
-
-*** Iconifying or deiconifying a frame no longer makes sit-for return.
-
-*** New function `redisplay' causes an immediate redisplay if no input is
-available, equivalent to (sit-for 0).  The call (redisplay t) forces
-an immediate redisplay even if input is pending.
-
-*** New function `force-window-update' can initiate a full redisplay of
-one or all windows.  Normally, this is not needed as changes in window
-contents are detected automatically.  However, certain implicit
-changes to mode lines, header lines, or display properties may require
-forcing an explicit window update.
-
-*** (char-displayable-p CHAR) returns non-nil if Emacs ought to be able
-to display CHAR.  More precisely, if the selected frame's fontset has
-a font to display the character set that CHAR belongs to.
-
-Fontsets can specify a font on a per-character basis; when the fontset
-does that, this value cannot be accurate.
-
-*** You can define multiple overlay arrows via the new
-variable `overlay-arrow-variable-list'.
-
-It contains a list of variables which contain overlay arrow position
-markers, including the original `overlay-arrow-position' variable.
-
-Each variable on this list can have individual `overlay-arrow-string'
-and `overlay-arrow-bitmap' properties that specify an overlay arrow
-string (for non-window terminals) or fringe bitmap (for window
-systems) to display at the corresponding overlay arrow position.
-If either property is not set, the default `overlay-arrow-string' or
-'overlay-arrow-fringe-bitmap' will be used.
-
-*** New `line-height' and `line-spacing' properties for newline characters
-
-A newline can now have `line-height' and `line-spacing' text or overlay
-properties that control the height of the corresponding display row.
-
-If the `line-height' property value is t, the newline does not
-contribute to the height of the display row; instead the height of the
-newline glyph is reduced.  Also, a `line-spacing' property on this
-newline is ignored.  This can be used to tile small images or image
-slices without adding blank areas between the images.
-
-If the `line-height' property value is a positive integer, the value
-specifies the minimum line height in pixels.  If necessary, the line
-height it increased by increasing the line's ascent.
-
-If the `line-height' property value is a float, the minimum line
-height is calculated by multiplying the default frame line height by
-the given value.
-
-If the `line-height' property value is a cons (FACE . RATIO), the
-minimum line height is calculated as RATIO * height of named FACE.
-RATIO is int or float.  If FACE is t, it specifies the current face.
-
-If the `line-height' property value is a cons (nil . RATIO), the line
-height is calculated as RATIO * actual height of the line's contents.
-
-If the `line-height' value is a cons (HEIGHT . TOTAL), HEIGHT specifies
-the line height as described above, while TOTAL is any of the forms
-described above and specifies the total height of the line, causing a
-varying number of pixels to be inserted after the line to make it line
-exactly that many pixels high.
-
-If the `line-spacing' property value is an positive integer, the value
-is used as additional pixels to insert after the display line; this
-overrides the default frame `line-spacing' and any buffer local value of
-the `line-spacing' variable.
-
-If the `line-spacing' property is a float or cons, the line spacing
-is calculated as specified above for the `line-height' property.
-
-*** The buffer local `line-spacing' variable can now have a float value,
-which is used as a height relative to the default frame line height.
-
-*** Enhancements to stretch display properties
-
-The display property stretch specification form `(space PROPS)', where
-PROPS is a property list, now allows pixel based width and height
-specifications, as well as enhanced horizontal text alignment.
-
-The value of these properties can now be a (primitive) expression
-which is evaluated during redisplay.  The following expressions
-are supported:
-
-EXPR ::= NUM | (NUM) | UNIT | ELEM | POS | IMAGE | FORM
-NUM  ::= INTEGER | FLOAT | SYMBOL
-UNIT ::= in | mm | cm | width | height
-ELEM ::= left-fringe | right-fringe | left-margin | right-margin
-      |  scroll-bar | text
-POS  ::= left | center | right
-FORM ::= (NUM . EXPR) | (OP EXPR ...)
-OP   ::= + | -
-
-The form `NUM' specifies a fractional width or height of the default
-frame font size.  The form `(NUM)' specifies an absolute number of
-pixels.  If a symbol is specified, its buffer-local variable binding
-is used.  The `in', `mm', and `cm' units specifies the number of
-pixels per inch, milli-meter, and centi-meter, resp.  The `width' and
-`height' units correspond to the width and height of the current face
-font.  An image specification corresponds to the width or height of
-the image.
-
-The `left-fringe', `right-fringe', `left-margin', `right-margin',
-`scroll-bar', and `text' elements specify to the width of the
-corresponding area of the window.
-
-The `left', `center', and `right' positions can be used with :align-to
-to specify a position relative to the left edge, center, or right edge
-of the text area.  One of the above window elements (except `text')
-can also be used with :align-to to specify that the position is
-relative to the left edge of the given area.  Once the base offset for
-a relative position has been set (by the first occurrence of one of
-these symbols), further occurrences of these symbols are interpreted as
-the width of the area.
-
-For example, to align to the center of the left-margin, use
-    :align-to (+ left-margin (0.5 . left-margin))
-
-If no specific base offset is set for alignment, it is always relative
-to the left edge of the text area.  For example, :align-to 0 in a
-header line aligns with the first text column in the text area.
-
-The value of the form `(NUM . EXPR)' is the value of NUM multiplied by
-the value of the expression EXPR.  For example, (2 . in) specifies a
-width of 2 inches, while (0.5 . IMAGE) specifies half the width (or
-height) of the specified image.
-
-The form `(+ EXPR ...)' adds up the value of the expressions.
-The form `(- EXPR ...)' negates or subtracts the value of the expressions.
-
-*** Normally, the cursor is displayed at the end of any overlay and
-text property string that may be present at the current window
-position.  The cursor can now be placed on any character of such
-strings by giving that character a non-nil `cursor' text property.
-
-*** The display space :width and :align-to text properties are now
-supported on text terminals.
-
-*** Support for displaying image slices
-
-**** New display property (slice X Y WIDTH HEIGHT) can be used with
-an image property to display only a specific slice of the image.
-
-**** Function `insert-image' has new optional fourth arg to
-specify image slice (X Y WIDTH HEIGHT).
-
-**** New function `insert-sliced-image' inserts a given image as a
-specified number of evenly sized slices (rows x columns).
-
-*** Images can now have an associated image map via the :map property.
-
-An image map is an alist where each element has the format (AREA ID PLIST).
-An AREA is specified as either a rectangle, a circle, or a polygon:
-A rectangle is a cons (rect . ((X0 . Y0) . (X1 . Y1))) specifying the
-pixel coordinates of the upper left and bottom right corners.
-A circle is a cons (circle . ((X0 . Y0) . R)) specifying the center
-and the radius of the circle; R can be a float or integer.
-A polygon is a cons (poly . [X0 Y0 X1 Y1 ...]) where each pair in the
-vector describes one corner in the polygon.
-
-When the mouse pointer is above a hot-spot area of an image, the
-PLIST of that hot-spot is consulted; if it contains a `help-echo'
-property it defines a tool-tip for the hot-spot, and if it contains
-a `pointer' property, it defines the shape of the mouse cursor when
-it is over the hot-spot.  See the variable `void-area-text-pointer'
-for possible pointer shapes.
-
-When you click the mouse when the mouse pointer is over a hot-spot,
-an event is composed by combining the ID of the hot-spot with the
-mouse event, e.g. [area4 mouse-1] if the hot-spot's ID is `area4'.
-
-*** The function `find-image' now searches in etc/images/ and etc/.
-The new variable `image-load-path' is a list of locations in which to
-search for image files.  The default is to search in etc/images, then
-in etc/, and finally in the directories specified by `load-path'.
-Subdirectories of etc/ and etc/images are not recursively searched; if
-you put an image file in a subdirectory, you have to specify it
-explicitly; for example, if an image is put in etc/images/foo/bar.xpm:
-
-  (defimage foo-image '((:type xpm :file "foo/bar.xpm")))
-
-Note that all images formerly located in the lisp directory have been
-moved to etc/images.
-
-*** New function `image-load-path-for-library' returns a suitable
-search path for images relative to library. This function is useful in
-external packages to save users from having to update
-`image-load-path'.
-
-*** The new variable `max-image-size' defines the maximum size of
-images that Emacs will load and display.
-
-*** The new variable `display-mm-dimensions-alist' can be used to
-override incorrect graphical display dimensions returned by functions
-`display-mm-height' and `display-mm-width'.
-
-** Mouse pointer features:
-
-*** The mouse pointer shape in void text areas (i.e. after the end of a
-line or below the last line in the buffer) of the text window is now
-controlled by the new variable `void-text-area-pointer'.  The default
-is to use the `arrow' (non-text) pointer.  Other choices are `text'
-(or nil), `hand', `vdrag', `hdrag', `modeline', and `hourglass'.
-
-*** The mouse pointer shape over an image can now be controlled by the
-:pointer image property.
-
-*** The mouse pointer shape over ordinary text or images can now be
-controlled/overridden via the `pointer' text property.
-
-** Mouse event enhancements:
-
-*** All mouse events now include a buffer position regardless of where
-you clicked.  For mouse clicks in window margins and fringes, this is
-a sensible buffer position corresponding to the surrounding text.
-
-*** Mouse events for clicks on window fringes now specify `left-fringe'
-or `right-fringe' as the area.
-
-*** Mouse events include actual glyph column and row for all event types
-and all areas.
-
-*** Mouse events can now indicate an image object clicked on.
-
-*** Mouse events include relative X and Y pixel coordinates relative to
-the top left corner of the object (image or character) clicked on.
-
-*** Mouse events include the pixel width and height of the object
-(image or character) clicked on.
-
-*** Function `mouse-set-point' now works for events outside text area.
-
-*** `posn-point' now returns buffer position for non-text area events.
-
-*** New function `posn-area' returns window area clicked on (nil means
-text area).
-
-*** New function `posn-actual-col-row' returns the actual glyph coordinates
-of the mouse event position.
-
-*** New functions 'posn-object', 'posn-object-x-y', 'posn-object-width-height'.
-
-These return the image or string object of a mouse click, the X and Y
-pixel coordinates relative to the top left corner of that object, and
-the total width and height of that object.
-
-** Text property and overlay changes:
-
-*** Arguments for `remove-overlays' are now optional, so that you can
-remove all overlays in the buffer with just (remove-overlays).
-
-*** New variable `char-property-alias-alist'.
-
-This variable allows you to create alternative names for text
-properties.  It works at the same level as `default-text-properties',
-although it applies to overlays as well.  This variable was introduced
-to implement the `font-lock-face' property.
-
-*** New function `get-char-property-and-overlay' accepts the same
-arguments as `get-char-property' and returns a cons whose car is the
-return value of `get-char-property' called with those arguments and
-whose cdr is the overlay in which the property was found, or nil if
-it was found as a text property or not found at all.
-
-*** The new function `remove-list-of-text-properties'.
-
-It is like `remove-text-properties' except that it takes a list of
-property names as argument rather than a property list.
-
-** Face changes
-
-*** The variable `facemenu-unlisted-faces' has been removed.
-Emacs has a lot more faces than in the past, and nearly all of them
-needed to be excluded.  The new variable `facemenu-listed-faces' lists
-the faces to include in the face menu.
-
-*** The new face attribute condition `min-colors' can be used to tailor
-the face color to the number of colors supported by a display, and
-define the foreground and background colors accordingly so that they
-look best on a terminal that supports at least this many colors.  This
-is now the preferred method for defining default faces in a way that
-makes a good use of the capabilities of the display.
-
-*** New function `display-supports-face-attributes-p' can be used to test
-whether a given set of face attributes is actually displayable.
-
-A new predicate `supports' has also been added to the `defface' face
-specification language, which can be used to do this test for faces
-defined with `defface'.
-
-*** The special treatment of faces whose names are of the form `fg:COLOR'
-or `bg:COLOR' has been removed.  Lisp programs should use the
-`defface' facility for defining faces with specific colors, or use
-the feature of specifying the face attributes :foreground and :background
-directly in the `face' property instead of using a named face.
-
-*** The first face specification element in a defface can specify
-`default' instead of frame classification.  Then its attributes act as
-defaults that apply to all the subsequent cases (and can be overridden
-by them).
-
-*** The function `face-differs-from-default-p' now truly checks
-whether the given face displays differently from the default face or
-not (previously it did only a very cursory check).
-
-*** `face-attribute', `face-foreground', `face-background', `face-stipple'.
-
-These now accept a new optional argument, INHERIT, which controls how
-face inheritance is used when determining the value of a face
-attribute.
-
-*** New functions `face-attribute-relative-p' and `merge-face-attribute'
-help with handling relative face attributes.
-
-*** The priority of faces in an :inherit attribute face list is reversed.
-
-If a face contains an :inherit attribute with a list of faces, earlier
-faces in the list override later faces in the list; in previous
-releases of Emacs, the order was the opposite.  This change was made
-so that :inherit face lists operate identically to face lists in text
-`face' properties.
-
-*** The variable `face-font-rescale-alist' specifies how much larger
-(or smaller) font we should use.  For instance, if the value is
-'((SOME-FONTNAME-PATTERN . 1.3)) and a face requests a font of 10
-point, we actually use a font of 13 point if the font matches
-SOME-FONTNAME-PATTERN.
-
-*** On terminals, faces with the :inverse-video attribute are displayed
-with swapped foreground and background colors even when one of them is
-not specified.  In previous releases of Emacs, if either foreground
-or background color was unspecified, colors were not swapped.  This
-was inconsistent with the face behavior under X.
-
-*** `set-fontset-font', `fontset-info', `fontset-font' now operate on
-the default fontset if the argument NAME is nil..
-
-** Font-Lock changes:
-
-*** New special text property `font-lock-face'.
-
-This property acts like the `face' property, but it is controlled by
-M-x font-lock-mode.  It is not, strictly speaking, a builtin text
-property.  Instead, it is implemented inside font-core.el, using the
-new variable `char-property-alias-alist'.
-
-*** font-lock can manage arbitrary text-properties beside `face'.
-
-**** the FACENAME returned in `font-lock-keywords' can be a list of the
-form (face FACE PROP1 VAL1 PROP2 VAL2 ...) so you can set other
-properties than `face'.
-
-**** `font-lock-extra-managed-props' can be set to make sure those
-extra properties are automatically cleaned up by font-lock.
-
-*** jit-lock obeys a new text-property `jit-lock-defer-multiline'.
-
-If a piece of text with that property gets contextually refontified
-(see `jit-lock-defer-contextually'), then all of that text will
-be refontified.  This is useful when the syntax of a textual element
-depends on text several lines further down (and when `font-lock-multiline'
-is not appropriate to solve that problem).  For example in Perl:
-
-       s{
-               foo
-       }{
-               bar
-       }e
-
-Adding/removing the last `e' changes the `bar' from being a piece of
-text to being a piece of code, so you'd put a `jit-lock-defer-multiline'
-property over the second half of the command to force (deferred)
-refontification of `bar' whenever the `e' is added/removed.
-
-*** `font-lock-extend-region-functions' makes it possible to alter the way
-the fontification region is chosen.  This can be used to prevent rounding
-up to whole lines, or to extend the region to include all related lines
-of multiline constructs so that such constructs get properly recognized.
-
-** Major mode mechanism changes:
-
-*** New variable `magic-mode-alist' determines major mode for a file by
-looking at the file contents.  It takes precedence over `auto-mode-alist'.
-
-*** New variable `magic-fallback-mode-alist' determines major mode for a file by
-looking at the file contents.  It is handled after `auto-mode-alist',
-only if `auto-mode-alist' (and `magic-mode-alist') says nothing about the file.
-
-*** XML or SGML major mode is selected when file starts with an `<?xml'
-or `<!DOCTYPE' declaration.
-
-*** An interpreter magic line (if present) takes precedence over the
-file name when setting the major mode.
-
-*** If new variable `auto-mode-case-fold' is set to a non-nil value,
-Emacs will perform a second case-insensitive search through
-`auto-mode-alist' if the first case-sensitive search fails.  This
-means that a file FILE.TXT is opened in text-mode, and a file
-PROG.HTML is opened in html-mode.  Note however, that independent of
-this setting, *.C files are usually recognized as C++ files.  It also
-has no effect on systems with case-insensitive file names.
-
-*** All major mode functions should now run the new normal hook
-`after-change-major-mode-hook', at their very end, after the mode
-hooks.  `run-mode-hooks' does this automatically.
-
-*** Major modes can define `eldoc-documentation-function'
-locally to provide Eldoc functionality by some method appropriate to
-the language.
-
-*** Use the new function `run-mode-hooks' to run the major mode's mode hook.
-
-*** The new function `run-mode-hooks' and the new macro `delay-mode-hooks'
-are used by `define-derived-mode' to make sure the mode hook for the
-parent mode is run at the end of the child mode.
-
-*** `define-derived-mode' by default creates a new empty abbrev table.
-It does not copy abbrevs from the parent mode's abbrev table.
-
-*** If a major mode function has a non-nil `no-clone-indirect'
-property, `clone-indirect-buffer' signals an error if you use
-it in that buffer.
-
-** Minor mode changes:
-
-*** `define-minor-mode' now accepts arbitrary additional keyword arguments
-and simply passes them to `defcustom', if applicable.
-
-*** `define-globalized-minor-mode'.
-
-This is a new name for what was formerly called
-`easy-mmode-define-global-mode'.  The old name remains as an alias.
-
-*** `minor-mode-list' now holds a list of minor mode commands.
-
-** Command loop changes:
-
-*** The new function `called-interactively-p' does what many people
-have mistakenly believed `interactive-p' to do: it returns t if the
-calling function was called through `call-interactively'.
-
-Only use this when you cannot solve the problem by adding a new
-INTERACTIVE argument to the command.
-
-*** The function `commandp' takes an additional optional argument.
-
-If it is non-nil, then `commandp' checks for a function that could be
-called with `call-interactively', and does not return t for keyboard
-macros.
-
-*** When a command returns, the command loop moves point out from
-within invisible text, in the same way it moves out from within text
-covered by an image or composition property.
-
-This makes it generally unnecessary to mark invisible text as intangible.
-This is particularly good because the intangible property often has
-unexpected side-effects since the property applies to everything
-(including `goto-char', ...) whereas this new code is only run after
-`post-command-hook' and thus does not care about intermediate states.
-
-*** If a command sets `transient-mark-mode' to `only', that
-enables Transient Mark mode for the following command only.
-During that following command, the value of `transient-mark-mode'
-is `identity'.  If it is still `identity' at the end of the command,
-the next return to the command loop changes to nil.
-
-*** Both the variable and the function `disabled-command-hook' have
-been renamed to `disabled-command-function'.  The variable
-`disabled-command-hook' has been kept as an obsolete alias.
-
-*** `emacsserver' now runs `pre-command-hook' and `post-command-hook'
-when it receives a request from emacsclient.
-
-*** `current-idle-time' reports how long Emacs has been idle.
-
-** Lisp file loading changes:
-
-*** `load-history' can now have elements of the form (t . FUNNAME),
-which means FUNNAME was previously defined as an autoload (before the
-current file redefined it).
-
-*** `load-history' now records (defun . FUNNAME) when a function is
-defined.  For a variable, it records just the variable name.
-
-*** The function `symbol-file' can now search specifically for function,
-variable or face definitions.
-
-*** `provide' and `featurep' now accept an optional second argument
-to test/provide subfeatures.  Also `provide' now checks `after-load-alist'
-and runs any code associated with the provided feature.
-
-*** The variable `recursive-load-depth-limit' has been deleted.
-Emacs now signals an error if the same file is loaded with more
-than 3 levels of nesting.
-
-** Byte compiler changes:
-
-*** The byte compiler now displays the actual line and character
-position of errors, where possible.  Additionally, the form of its
-warning and error messages have been brought into line with GNU standards
-for these.  As a result, you can use next-error and friends on the
-compilation output buffer.
-
-*** The new macro `with-no-warnings' suppresses all compiler warnings
-inside its body.  In terms of execution, it is equivalent to `progn'.
-
-*** You can avoid warnings for possibly-undefined symbols with a
-simple convention that the compiler understands.  (This is mostly
-useful in code meant to be portable to different Emacs versions.)
-Write forms like the following, or code that macroexpands into such
-forms:
-
-  (if (fboundp 'foo) <then> <else>)
-  (if (boundp 'foo) <then> <else)
-
-In the first case, using `foo' as a function inside the <then> form
-won't produce a warning if it's not defined as a function, and in the
-second case, using `foo' as a variable won't produce a warning if it's
-unbound.  The test must be in exactly one of the above forms (after
-macro expansion), but such tests can be nested.  Note that `when' and
-`unless' expand to `if', but `cond' doesn't.
-
-*** `(featurep 'xemacs)' is treated by the compiler as nil.  This
-helps to avoid noisy compiler warnings in code meant to run under both
-Emacs and XEmacs and can sometimes make the result significantly more
-efficient.  Since byte code from recent versions of XEmacs won't
-generally run in Emacs and vice versa, this optimization doesn't lose
-you anything.
-
-*** The local variable `no-byte-compile' in Lisp files is now obeyed.
-
-*** When a Lisp file uses CL functions at run-time, compiling the file
-now issues warnings about these calls, unless the file performs
-(require 'cl) when loaded.
-
-** Frame operations:
-
-*** New functions `frame-current-scroll-bars' and `window-current-scroll-bars'.
-
-These functions return the current locations of the vertical and
-horizontal scroll bars in a frame or window.
-
-*** The new function `modify-all-frames-parameters' modifies parameters
-for all (existing and future) frames.
-
-*** The new frame parameter `tty-color-mode' specifies the mode to use
-for color support on character terminal frames.  Its value can be a
-number of colors to support, or a symbol.  See the Emacs Lisp
-Reference manual for more detailed documentation.
-
-*** When using non-toolkit scroll bars with the default width,
-the `scroll-bar-width' frame parameter value is nil.
-
-** Mode line changes:
-
-*** New function `format-mode-line'.
-
-This returns the mode line or header line of the selected (or a
-specified) window as a string with or without text properties.
-
-*** The new mode-line construct `(:propertize ELT PROPS...)' can be
-used to add text properties to mode-line elements.
-
-*** The new `%i' and `%I' constructs for `mode-line-format' can be used
-to display the size of the accessible part of the buffer on the mode
-line.
-
-*** Mouse-face on mode-line (and header-line) is now supported.
-
-** Menu manipulation changes:
-
-*** To manipulate the File menu using easy-menu, you must specify the
-proper name "file".  In previous Emacs versions, you had to specify
-"files", even though the menu item itself was changed to say "File"
-several versions ago.
-
-*** The dummy function keys made by easy-menu are now always lower case.
-If you specify the menu item name "Ada", for instance, it uses `ada'
-as the "key" bound by that key binding.
-
-This is relevant only if Lisp code looks for the bindings that were
-made with easy-menu.
-
-*** `easy-menu-define' now allows you to use nil for the symbol name
-if you don't need to give the menu a name.  If you install the menu
-into other keymaps right away (MAPS is non-nil), it usually doesn't
-need to have a name.
-
-** Mule changes:
-
-*** Already true in Emacs 21.1, but not emphasized clearly enough:
-
-Multibyte buffers can now faithfully record all 256 character codes
-from 0 to 255.  As a result, most of the past reasons to use unibyte
-buffers no longer exist.  We only know of three reasons to use them
-now:
-
-1. If you prefer to use unibyte text all of the time.
-
-2. For reading files into temporary buffers, when you want to avoid
-the time it takes to convert the format.
-
-3. For binary files where format conversion would be pointless and
-wasteful.
-
-*** The new variable `auto-coding-functions' lets you specify functions
-to examine a file being visited and deduce the proper coding system
-for it.  (If the coding system is detected incorrectly for a specific
-file, you can put a `coding:' tags to override it.)
-
-*** The new variable `ascii-case-table' stores the case table for the
-ascii character set.  Language environments (such as Turkish) may
-alter the case correspondences of ASCII characters.  This variable
-saves the original ASCII case table before any such changes.
-
-*** The new function `merge-coding-systems' fills in unspecified aspects
-of one coding system from another coding system.
-
-*** New coding system property `mime-text-unsuitable' indicates that
-the coding system's `mime-charset' is not suitable for MIME text
-parts, e.g. utf-16.
-
-*** New function `decode-coding-inserted-region' decodes a region as if
-it is read from a file without decoding.
-
-*** New CCL functions `lookup-character' and `lookup-integer' access
-hash tables defined by the Lisp function `define-translation-hash-table'.
-
-*** New function `quail-find-key' returns a list of keys to type in the
-current input method to input a character.
-
-*** `set-buffer-file-coding-system' now takes an additional argument,
-NOMODIFY.  If it is non-nil, it means don't mark the buffer modified.
-
-** Operating system access:
-
-*** The new primitive `get-internal-run-time' returns the processor
-run time used by Emacs since start-up.
-
-*** Functions `user-uid' and `user-real-uid' now return floats if the
-user UID doesn't fit in a Lisp integer.  Function `user-full-name'
-accepts a float as UID parameter.
-
-*** New function `locale-info' accesses locale information.
-
-*** On MS Windows, locale-coding-system is used to interact with the OS.
-The Windows specific variable w32-system-coding-system, which was
-formerly used for that purpose is now an alias for locale-coding-system.
-
-*** New function `redirect-debugging-output' can be used to redirect
-debugging output on the stderr file handle to a file.
-
-** GC changes:
-
-*** New variable `gc-cons-percentage' automatically grows the GC cons threshold
-as the heap size increases.
-
-*** New variables `gc-elapsed' and `gcs-done' provide extra information
-on garbage collection.
-
-*** The normal hook `post-gc-hook' is run at the end of garbage collection.
-
-The hook is run with GC inhibited, so use it with care.
-
-** Miscellaneous:
-
-*** A number of hooks have been renamed to better follow the conventions:
-
-`find-file-hooks' to `find-file-hook',
-`find-file-not-found-hooks' to `find-file-not-found-functions',
-`write-file-hooks' to `write-file-functions',
-`write-contents-hooks' to `write-contents-functions',
-`x-lost-selection-hooks' to `x-lost-selection-functions',
-`x-sent-selection-hooks' to `x-sent-selection-functions',
-`delete-frame-hook' to `delete-frame-functions'.
-
-In each case the old name remains as an alias for the moment.
-
-*** Variable `local-write-file-hooks' is marked obsolete.
-
-Use the LOCAL arg of `add-hook'.
-
-*** New function `x-send-client-message' sends a client message when
-running under X.
-\f
-* New Packages for Lisp Programming in Emacs 22.1
-
-** The new library button.el implements simple and fast `clickable
-buttons' in Emacs buffers.  Buttons are much lighter-weight than the
-`widgets' implemented by widget.el, and can be used by lisp code that
-doesn't require the full power of widgets.  Emacs uses buttons for
-such things as help and apropos buffers.
-
-** The new library tree-widget.el provides a widget to display a set
-of hierarchical data as an outline.  For example, the tree-widget is
-well suited to display a hierarchy of directories and files.
-
-** The new library bindat.el provides functions to unpack and pack
-binary data structures, such as network packets, to and from Lisp
-data structures.
-
-** master-mode.el implements a minor mode for scrolling a slave
-buffer without leaving your current buffer, the master buffer.
-
-It can be used by sql.el, for example: the SQL buffer is the master
-and its SQLi buffer is the slave.  This allows you to scroll the SQLi
-buffer containing the output from the SQL buffer containing the
-commands.
-
-This is how to use sql.el and master.el together: the variable
-sql-buffer contains the slave buffer.  It is a local variable in the
-SQL buffer.
-
-(add-hook 'sql-mode-hook
-   (function (lambda ()
-              (master-mode t)
-              (master-set-slave sql-buffer))))
-(add-hook 'sql-set-sqli-hook
-   (function (lambda ()
-              (master-set-slave sql-buffer))))
-
-** The new library benchmark.el does timing measurements on Lisp code.
-
-This includes measuring garbage collection time.
-
-** The new library testcover.el does test coverage checking.
-
-This is so you can tell whether you've tested all paths in your Lisp
-code.  It works with edebug.
-
-The function `testcover-start' instruments all functions in a given
-file.  Then test your code.  The function `testcover-mark-all' adds
-overlay "splotches" to the Lisp file's buffer to show where coverage
-is lacking.  The command `testcover-next-mark' (bind it to a key!)
-will move point forward to the next spot that has a splotch.
-
-Normally, a red splotch indicates the form was never completely
-evaluated; a brown splotch means it always evaluated to the same
-value.  The red splotches are skipped for forms that can't possibly
-complete their evaluation, such as `error'.  The brown splotches are
-skipped for forms that are expected to always evaluate to the same
-value, such as (setq x 14).
-
-For difficult cases, you can add do-nothing macros to your code to
-help out the test coverage tool.  The macro `noreturn' suppresses a
-red splotch.  It is an error if the argument to `noreturn' does
-return.  The macro `1value' suppresses a brown splotch for its argument.
-This macro is a no-op except during test-coverage -- then it signals
-an error if the argument actually returns differing values.
-
-
-\f
-----------------------------------------------------------------------
-This file is part of GNU Emacs.
-
-GNU Emacs is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
-
-GNU Emacs is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Emacs; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA.
-
-\f
-Local variables:
-mode: outline
-paragraph-separate: "[         \f]*$"
-end:
-
-arch-tag: 1aca9dfa-2ac4-4d14-bebf-0007cee12793
+GNU Emacs NEWS -- history of user-visible changes.
+
+Copyright (C) 2007 Free Software Foundation, Inc.
+See the end of the file for license conditions.
+
+Please send Emacs bug reports to emacs-pretest-bug@gnu.org.
+If possible, use M-x report-emacs-bug.
+
+This file is about changes in Emacs version 23.
+
+See files NEWS.22, NEWS.21, NEWS.20, NEWS.19, NEWS.18, and NEWS.1-17
+for changes in older Emacs versions.
+
+You can narrow news to a specific version by calling `view-emacs-news'
+with a prefix argument or by typing C-u C-h C-n.
+
+Temporary note:
+ +++ indicates that the appropriate manual has already been updated.
+ --- means no change in the manuals is called for.
+When you add a new item, please add it without either +++ or ---
+so we will look at it and add it to the manual.
+
+\f
+* About external Lisp packages
+
+\f
+* Installation Changes in Emacs 23.1
+
+** The default X toolkit is now Gtk+, rather than Lucid.
+
+** configure now checks for libgif before libungif when searching for
+a GIF library.
+
+\f
+* Changes in Emacs 23.1
+
+** If you set find-file-confirm-nonexistent-file to t, then C-x C-f
+requires confirmation before opening a non-existent file.
+
+** If the gpm mouse server is running and t-mouse-mode enabled, Emacs uses a
+Unix socket in a GNU/Linux console to talk to server, rather than faking events
+using the client program mev.  This C level approach provides mouse
+highlighting, and help echoing in the minibuffer.
+
+** The new variable next-error-recenter specifies how next-error should
+recenter the visited source file.  Its value can be a number (for example,
+0 for top line, -1 for bottom line), or nil for no recentering.
+
+** The mode-line display a `@' if the default-directory for the current buffer
+is on a remote machine, or a hyphen otherwise.
+** The new command balance-window-area balances windows both vertically
+and horizontally.
+
+** The new command close-display-connection can be used to close a connection
+to a remote display, e.g. because the display is about to become unreachable.
+\f
+* Startup Changes in Emacs 23.1
+
+\f
+* Incompatible Editing Changes in Emacs 23.1
+
+\f
+* Editing Changes in Emacs 23.1
+
+** New command kill-matching-buffers kills buffers whose name matches a regexp.
+
+** Minibuffer changes:
+
+*** isearch started in the minibuffer searches in the minibuffer history.
+Reverse isearch commands (C-r, C-M-r) search in previous minibuffer
+history elements, and forward isearch commands (C-s, C-M-s) search in
+next history elements.  When the reverse search reaches the first history
+element, it wraps to the last history element, and the forward search
+wraps to the first history element.  When the search is terminated, the
+history element containing the search string becomes the current.
+
+\f
+* New Modes and Packages in Emacs 23.1
+
+** minibuffer-indicate-depth-mode shows the minibuffer depth in the prompt.
+
+\f
+* Changes in Specialized Modes and Packages in Emacs 23.1
+
+** compilation-auto-jump-to-first-error tells `compile' to jump to
+the first error encountered during compilations.
+
+** In the `copyright' package, you can specify your copyright holders's names.
+Only copyright lines with holders matching copyright-names-regexp will be
+considered for update.
+
+** VC
+*** Clicking on the VC mode-line entry now pops the VC menu.
+
+*** The VC mode-line entry now has a tooltip.
+
+*** VC backends can provide extra menu entries to be added to the "Version Control" menu.
+This can be used to add menu entries for backend specific functions.
+
+** sgml-electric-tag-pair-mode lets you simultaneously edit matched tag pairs.
+
+** BibTeX mode:
+
+*** New `bibtex-entry-format' options `whitespace', `braces', and
+`string', disabled by default.
+
+*** New variable `bibtex-cite-matcher-alist' contains rules to
+identify cited keys in BibTeX entries, used by `bibtex-find-crossref.
+
+*** Command `bibtex-url' now allows multiple URLs per entry.
+
++++
+** Tramp
+
+*** New connection methods.
+The new methods "plinkx", "plink2", "psftp", "sftp" and "fish" have
+been introduced.  There are also new so-called gateway methods
+"tunnel" and "socks".
+
+*** Multihop syntax has been removed.
+The pseudo-method "multi" has been removed.  Instead of, multi hops
+can be specified by the new variable `tramp-default-proxies-alist'.
+
+*** More default settings.
+Default values can be set via the variables `tramp-default-user',
+`tramp-default-user-alist' and `tramp-default-host'.
+
+*** Connection information is cached.
+In order to reduce connection setup, information about used
+connections are kept persistent in a file.  The name of this file is
+defined in the variable `tramp-persistency-file-name'.
+
+*** Control of remote processes.
+Running processes on a remote host can be controlled by settings in
+`tramp-remote-path' and `tramp-remote-process-environment'.
+
+*** Success of remote copy is checked.
+When the variable `file-precious-flag' is set, the success of a remote
+file copy is checked via the file's checksum.
+
+** Miscellaneous programming mode changes
+
+*** The variable `fortran-line-length' can change the fixed-form line-length.
+
+** Miscellaneous
+
+*** comint-mode uses `start-file-process' now (see Lisp Changes).
+If `default-directory' is a remote file name, subprocesses are started
+on the corresponding remote system.
+
+*** C-x C-q in dired-mode now runs the command wdired-change-to-wdired-mode,
+and C-x C-q in wdired-mode exits it with asking a question about
+saving changes.
+
+\f
+* Changes in Emacs 23.1 on non-free operating systems
+
+---
+** IPv6 is supported on MS-Windows.
+Emacs now supports IPv6 on Windows XP and later, and earlier versions
+of Windows with third party IPv6 stacks installed. Previously IPv6 was
+supported on other platforms, but not on Windows due to using the winsock
+1.1 header file, even though Emacs was linking to the winsock 2 library.
+
+\f
+* Incompatible Lisp Changes in Emacs 23.1
+
++++
+** The function `dired-call-process' has been removed.
+
+\f
+* Lisp Changes in Emacs 23.1
+
+** Non-breaking space now acts as whitespace.
+
++++
+** In `condition-case', a handler can specify "let the debugger run first".
+
+You do this by writing `debug' in the list of conditions to be handled,
+like this:
+
+    (condition-case nil
+       (foo bar)
+      ((debug error) nil))
+
+** The `require-match' argument to `completing-read' accepts a new value
+`confirm-only'.
+
++++
+** The regexp form \(?<num>:<regexp>\) specifies the group number explicitly.
+
++++
+** New variable `user-emacs-directory'.
+Use this instead of "~/.emacs.d".
+
++++
+** The new function `start-file-process is similar to `start-process',
+but obeys file handlers.  The file handler is chosen based on
+`default-directory'.  The functions `start-file-process-shell-command'
+and `process-file-shell-command' are also new; they call internally
+`start-file-process and `process-file', respectively.
+
++++
+** `file-remote-p' has new optional parameters IDENTIFICATION and CONNECTED.
+IDENTIFICATION specifies which part of the remote identifier has to be
+returned.  With CONNECTED passed non-nil, it is checked whether a
+remote connection has been established already.
+
+** The two new functions `looking-at-p' and `string-match-p' can do
+the same matching as `looking-at' and `string-match' without changing
+the match data.
+
+** The interactive-form of a function can be added post-facto via the
+`interactive-form' symbol property.  Mostly useful to add complex interactive
+forms to subroutines.
+\f
+* New Packages for Lisp Programming in Emacs 23.1
+
+\f
+----------------------------------------------------------------------
+This file is part of GNU Emacs.
+
+GNU Emacs is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.
+
+\f
+Local variables:
+mode: outline
+paragraph-separate: "[         \f]*$"
+end:
+
+arch-tag: e759449d-88b3-4de4-9900-3a6c3dfa23e2
similarity index 99%
copy from etc/NEWS
copy to etc/NEWS.22
index 8e4d7f9..6e22763 100644 (file)
--- a/etc/NEWS
@@ -2003,11 +2003,11 @@ old name remains available as alias, but has been marked obsolete.
 
 If point is at the end of a file buffer before reverting, Auto Revert
 mode keeps it at the end after reverting.  Similarly if point is
-displayed at the end of a file buffer in any window, it stays at the
-end of the buffer in that window.  This allows you to "tail" a file:
-just put point at the end of the buffer and it stays there.  This rule
-applies to file buffers.  For non-file buffers, the behavior can be
-mode dependent.
+displayed at the end of a file buffer in any window, it stays at the end
+of the buffer in that window.  This allows you to "tail" a file: just
+put point at the end of the buffer and it stays there.  This rule
+applies to file buffers.  For non-file buffers, the behavior can be mode
+dependent.
 
 If you are sure that the file will only change by growing at the end,
 then you can tail the file more efficiently by using the new minor
index 90a3d32..9fe7869 100644 (file)
--- a/etc/TODO
+++ b/etc/TODO
@@ -14,11 +14,8 @@ to the FSF.
 
 * Small but important fixes needed in existing features:
 
-** Fix compilation when Xaw3d libraries are present but libxaw is not.
-In new X11 versions, xaw3dg-dev does not depend on libxaw-dev, so the
-latter need not be installed.  As a result, all the source files that
-look for include files in X11/Xaw should look in X11/Xaw3d if we are
-using Xaw3d.
+** "Options -> Save Options" should save the font set via "Set Font/Fontset"
+I.e. mouse-set-font should use customize-face.
 
 ** Compute the list of active keymaps *after* reading the first event.
 
@@ -30,8 +27,6 @@ a window doesn't select it.
 but if you type M-n you should get the visited file name of the
 current buffer.
 
-** describe-face should show an example of text in the face.
-
 ** Distribute a bar cursor of width > 1 evenly between the two glyphs
    on each side of the bar (what to do at the edges?).
 
@@ -98,9 +93,6 @@ current buffer.
 
 ** make back_comment use syntax-ppss or equivalent.
 
-** Improve configure's treatment of NON_GNU_CPP on Solaris.
-(patch available for after Emacs 22)
-
 ** Consider improving src/sysdep.c's search for a fqdn.
 http://lists.gnu.org/archive/html/emacs-devel/2007-04/msg00782.html
 
@@ -177,6 +169,7 @@ specified filters, specified timers, and specified hooks.
 
 ** Remove the default toggling behavior of minor modes when called from elisp
 rather than interactively.  This a trivial one-liner in easy-mode.el.
+
 ** Create a category of errors called `user-error' for errors which are
 typically due to pilot errors and should thus be in debug-ignored-errors.
 
@@ -379,15 +372,6 @@ typically due to pilot errors and should thus be in debug-ignored-errors.
 ** Allow unknown image types to be rendered via an external program
   converting them to, say, PBM (in the same way as PostScript?).
 
-** Display images with alpha channels, such as png, with the current
-background color of whatever frame it is displayed in.  Currently, we
-use the default background color if specified in the png file, or, if
-that is unspecified, the background color of the frame in which the
-image was first created.  Ideally, the image should display the
-background color of whichever frame it is being displayed in.  The
-main complication is that this will require the loading of a new image
-object for each different background color.
-
 ** Allow displaying an X window from an external program in a buffer,
   e.g. to render graphics from Java applets.  [gerd and/or wmperry
   thought this was feasible.]
@@ -551,6 +535,10 @@ but which can also be used as a modifier).
 ** Cleanup all the GC_ mark bit stuff -- there is no longer any distinction
    since the mark bit is no longer stored in the Lisp_Object itself.
 
+** Refine the `predicate' arg to read-file-name.
+   Currently, it mixes up the predicate to apply when doing completion and the
+   one to use when terminating the selection.
+
 ** Merge ibuffer.el and buff-menu.el.
    More specifically do what's needed to make ibuffer.el the default,
    or just an extension of buff-menu.el.
@@ -592,6 +580,33 @@ but which can also be used as a modifier).
 
 * Other known bugs:
 
+** The \\{...} keymap dump output does not correctly remove shadowed entries:
+From: "Drew Adams" <drew.adams@oracle.com>
+
+(define-key minibuffer-local-map [(control ?=)] 'foo)
+(define-key minibuffer-local-completion-map [(control ?=)] 'foo)
+
+(defun toto () "\\{minibuffer-local-completion-map}"  4)
+
+C-h f toto shows a duplicate entry for C-=:
+
+toto is a Lisp function.
+(toto)
+
+key             binding
+- ---             -------
+
+C-g            abort-recursive-edit
+TAB            minibuffer-complete
+C-j            exit-minibuffer
+RET            exit-minibuffer
+ESC            Prefix Command
+SPC            minibuffer-complete-word
+?              minibuffer-completion-help
+C-=            foo
+C-=            foo
+...
+
 ** a two-char comment-starter whose two chars are symbol constituents will
 not be noticed if it appears within a word.
 
index c35ab96..2b30b17 100644 (file)
@@ -404,6 +404,7 @@ Compilation killed at Wed Jul 20 12:20:10
 Compilation terminated at Wed Jul 20 12:20:10
 Compilation exited abnormally with code 1 at Wed Jul 20 12:21:12
 Compilation finished at Thu Jul 21 15:02:15
+Compilation segmentation fault at Thu Jul 13 10:55:49
 
 \f
 Copyright (C) 2004, 2005, 2006, 2007
index b42e355..76055c6 100644 (file)
@@ -12,7 +12,7 @@
 %DVIPSCommandLine: dvips -t a4 -t landscape fr-refcard.dvi -o
 %+ fr-refcard.ps
 %DVIPSParameters: dpi=600
-%DVIPSSource:  TeX output 2007.05.15:0316
+%DVIPSSource:  TeX output 2007.05.15:0314
 %%BeginProcSet: tex.pro 0 0
 %!
 /TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S
index 1207fad..2b3496c 100644 (file)
@@ -1,27 +1,27 @@
 % Reference Card for Org Mode
-\def\orgversionnumber{4.67}
+\def\orgversionnumber{5.03}
 \def\versionyear{2007}          % latest update
 \def\year{2007}                 % latest copyright year
-%
+
 %**start of header
 \newcount\columnsperpage
+\newcount\letterpaper
 
 % This file can be printed with 1, 2, or 3 columns per page (see below).
-% At the moment this card works quite nicely in 3 column format and
-% currently takes 2 full pages.  It is thus suited to producing one 
-% double-side page when printed.
+% Specify how many you want here.
 
-% There are a couple of tweaks in the format of this card which make it work
-% slightly better on A4 paper.  The changes due, I think, to Stephen Eglen,
-% are commented below.  Revert the changes if you want letter sized paper.
+\columnsperpage=3
 
-% Try running something like
-% tex org-mode-ref.tex; dvips -t landscape org-mode-ref.dvi
-% to print the card
+% Set letterpapaer to 0 for A4 paper, 1 for letter (US) paper.  Useful
+% only when columnsperpage is 2 or 3.
 
-\columnsperpage=3
+\letterpaper=0
+
+% Nothing else needs to be changed below this line.
+% Copyright (C) 1987, 1993, 1996, 1997, 2001, 2002, 2003, 2004,
+%   2005, 2006, 2007  Free Software Foundation, Inc.
 
-% Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc
+% This file is part of GNU Emacs.
 
 % GNU Emacs is free software; you can redistribute it and/or modify
 % it under the terms of the GNU General Public License as published by
@@ -35,8 +35,8 @@
 
 % You should have received a copy of the GNU General Public License
 % along with GNU Emacs; see the file COPYING.  If not, write to
-% the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-% Boston, MA 02111-1307, USA.
+% the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+% Boston, MA 02110-1301, USA.
 
 % This file is intended to be processed by plain TeX (TeX82).
 %
 %    For this you need a dvi device driver that can print sideways.
 % Which mode to use is controlled by setting \columnsperpage above.
 %
+% To compile and print this document:
+% tex refcard.tex
+% dvips -t landscape refcard.dvi
+%
 % Author:
 %  Stephen Gildea
 %  Internet: gildea@stop.mail-abuse.org
@@ -82,20 +86,20 @@ are preserved on all copies.
 % can be scanned without complaint.
 \def\bye{\par\vfill\supereject\end}
 
-\newdimen\intercolumnskip       %horizontal space between columns
-\newbox\columna                 %boxes to hold columns already built
+\newdimen\intercolumnskip      %horizontal space between columns
+\newbox\columna                        %boxes to hold columns already built
 \newbox\columnb
 
 \def\ncolumns{\the\columnsperpage}
 
-\message{[\ncolumns\space 
+\message{[\ncolumns\space
   column\if 1\ncolumns\else s\fi\space per page]}
 
 \def\scaledmag#1{ scaled \magstep #1}
 
 % This multi-way format was designed by Stephen Gildea October 1986.
 % Note that the 1-column format is fontfamily-independent.
-\if 1\ncolumns                  %one-column format uses normal size
+\if 1\ncolumns                 %one-column format uses normal size
   \hsize 4in
   \vsize 10in
   \voffset -.7in
@@ -106,15 +110,18 @@ are preserved on all copies.
 
   \footline{\hss\folio}
   \def\makefootline{\baselineskip10pt\hsize6.5in\line{\the\footline}}
-\else                           %2 or 3 columns uses prereduced size
-  \hsize 3.2in
-
-% FIXME - Try to make things more A4 friendly
-%  \vsize 7.95in
-  \vsize 7.65in
-%  \hoffset -.75in
-  \hoffset -.25in
-  \voffset -.745in
+\else                          %2 or 3 columns uses prereduced size
+  \if 1\the\letterpaper
+     \hsize 3.2in
+     \vsize 7.95in
+     \hoffset -.75in
+     \voffset -.745in
+  \else
+     \hsize 3.2in
+     \vsize 7.65in
+     \hoffset -.25in
+     \voffset -.745in
+  \fi
   \font\titlefont=cmbx10 \scaledmag2
   \font\headingfont=cmbx10 \scaledmag1
   \font\smallfont=cmr6
@@ -132,13 +139,14 @@ are preserved on all copies.
   \def\bf{\eightbf}
   \def\it{\eightit}
   \def\tt{\eighttt}
-
-% FIXME - Try to make things more A4 friendly
-%  \normalbaselineskip=.8\normalbaselineskip
-  \normalbaselineskip=.7\normalbaselineskip
+  \if 1\the\letterpaper
+     \normalbaselineskip=.8\normalbaselineskip
+  \else
+     \normalbaselineskip=.7\normalbaselineskip
+  \fi
   \normallineskip=.8\normallineskip
   \normallineskiplimit=.8\normallineskiplimit
-  \normalbaselines\rm           %make definitions take effect
+  \normalbaselines\rm          %make definitions take effect
 
   \if 2\ncolumns
     \let\maxcolumn=b
@@ -154,16 +162,16 @@ are preserved on all copies.
 
   \intercolumnskip=.46in
   \def\abc{a}
-  \output={%                    %see The TeXbook page 257
+  \output={%                   %see The TeXbook page 257
       % This next line is useful when designing the layout.
       %\immediate\write16{Column \folio\abc\space starts with \firstmark}
       \if \maxcolumn\abc \multicolumnformat \global\def\abc{a}
       \else\if a\abc
-        \global\setbox\columna\columnbox \global\def\abc{b}
+       \global\setbox\columna\columnbox \global\def\abc{b}
         %% in case we never use \columnb (two-column mode)
         \global\setbox\columnb\hbox to -\intercolumnskip{}
       \else
-        \global\setbox\columnb\columnbox \global\def\abc{c}\fi\fi}
+       \global\setbox\columnb\columnbox \global\def\abc{c}\fi\fi}
   \def\multicolumnformat{\shipout\vbox{\makeheadline
       \hbox{\box\columna\hskip\intercolumnskip
         \box\columnb\hskip\intercolumnskip\columnbox}
@@ -173,7 +181,7 @@ are preserved on all copies.
   \def\bye{\par\vfill\supereject
     \if a\abc \else\null\vfill\eject\fi
     \if a\abc \else\null\vfill\eject\fi
-    \end}  
+    \end}
 \fi
 
 % we won't be using math mode much, so redefine some of the characters
@@ -225,7 +233,7 @@ are preserved on all copies.
 \def\<#1>{{\it #1\/}}
 
 % kbd - argument is characters typed literally.  Like the Texinfo command.
-\def\kbd#1{{\tt#1}\null}        %\null so not an abbrev even if period follows
+\def\kbd#1{{\tt#1}\null}       %\null so not an abbrev even if period follows
 
 % beginexample...endexample - surrounds literal text, such a code example.
 % typeset in a typewriter font with line breaks preserved
@@ -316,15 +324,15 @@ are preserved on all copies.
 \section{Archiving}
 
 \key{toggle ARCHIVE tag}{C-c C-x C-a}
-\metax{mark fully done children}{C-u C-c C-x C-a}
+%\metax{mark fully done children}{C-u C-c C-x C-a}
 \key{force cycling of an ARCHIVEd tree}{C-TAB}
 \key{move subtree to archive file}{C-c C-x C-s}
-\metax{move all fully done children}{C-u C-c C-x C-s}
-To set archive location for current file, add a line like$^2$:
-\vskip -1mm
-\beginexample%
-\#+ARCHIVE: archfile::* Archived Tasks
-\endexample
+%\metax{move all fully done children}{C-u C-c C-x C-s}
+%To set archive location for current file, add a line like$^2$:
+%\vskip -1mm
+%\beginexample%
+%\#+ARCHIVE: archfile::* Archived Tasks
+%\endexample
 
 \section{Filtering and Sparse Trees}
 
@@ -359,13 +367,11 @@ Outside of tables, the same keys may have other functionality.
 
 {\bf Row and column editing}
 
-\key{move the current column left}{M-LEFT}
-\key{move the current column right}{M-RIGHT}
+\key{move the current column left}{M-LEFT/RIGHT}
 \key{kill the current column}{M-S-LEFT}
 \key{insert new column to left of cursor position}{M-S-RIGHT}
 
-\key{move the current row up}{M-UP}
-\key{move the current row down}{M-DOWN}
+\key{move the current row up/down}{M-UP/DOWN}
 \key{kill the current row or horizontal line}{M-S-UP}
 \key{insert new row above the current row}{M-S-DOWN}
 \key{insert hline below (\kbd{C-u} : above) current row}{C-c -}
@@ -378,34 +384,6 @@ Outside of tables, the same keys may have other functionality.
 \key{paste rectangular region}{C-c C-x C-y}
 \key{fill paragraph across selected cells}{C-c C-q}
 
-{\bf Calculations} (in combination with Emacs \kbd{calc} package)
-
-\key{set and eval column formula}{C-c =}
-\key{set and eval field formula}{C-u C-c =}
-\key{edit formulas in separate buffer}{C-c '}
-\key{re-apply all stored equations to current line}{C-c *}
-\key{re-apply all stored equations to entire table}{C-u C-c *}
-\key{iterate table to stability}{C-u C-u C-c *}
-
-%\kbd{TAB}, \kbd{RET} and \kbd{C-c C-c} trigger automatic recalculation
-%in lines starting with: {\tt | \# |}.
-
-\key{rotate calculation mark through \# * ! \^ \_ \$}{C-\#}
-
-\key{show line, column, formula reference}{C-c ?}
-\key{sum numbers in current column/rectangle}{C-c +}
-\key{copy down with increment}{S-RET$^3$}
-
-Formulas typed in field are executed by \kbd{TAB},
-\kbd{RET} and \kbd{C-c C-c}.  \kbd{=} introduces a column
-formula, \kbd{:=} a named-field formula.
-
-\key{Example: Add Col1 and Col2}{=\$1+\$2}
-\key{... with printf format specification}{=\$1+\$2;\%.2f}
-\key{... with constants from constants.el}{=\$1/\$c/\$cm}
-\metax{sum from 2nd to 3rd hline}{:=vsum(@II..@III)}
-\key{apply current column formula}{=}
-
 {\bf Miscellaneous}
 
 \key{to limit column width to \kbd{N} characters, use}{...| <N> |...}
@@ -413,6 +391,7 @@ formula, \kbd{:=} a named-field formula.
 \key{make current field fully visible}{C-u TAB}
 \metax{export as tab-separated file}{M-x org-table-export}
 \metax{import tab-separated file}{M-x org-table-import}
+\key{sum numbers in current column/rectangle}{C-c +}
 
 {\bf Tables created with the \kbd{table.el} package}
 
@@ -420,6 +399,43 @@ formula, \kbd{:=} a named-field formula.
 \key{recognize existing table.el table}{C-c C-c}
 \key{convert table (Org-mode $\leftrightarrow$ table.el)}{C-c ~}
 
+{\bf Spreadsheet}
+
+Formulas typed in field are executed by \kbd{TAB},
+\kbd{RET} and \kbd{C-c C-c}.  \kbd{=} introduces a column
+formula, \kbd{:=} a field formula.
+
+\key{Example: Add Col1 and Col2}{|=\$1+\$2      |}
+\key{... with printf format specification}{|=\$1+\$2;\%.2f|}
+\key{... with constants from constants.el}{|=\$1/\$c/\$cm |}
+\metax{sum from 2nd to 3rd hline}{|:=vsum(@II..@III)|}
+\key{apply current column formula}{| = |}
+
+\key{set and eval column formula}{C-c =}
+\key{set and eval field formula}{C-u C-c =}
+\key{re-apply all stored equations to current line}{C-c *}
+\key{re-apply all stored equations to entire table}{C-u C-c *}
+\key{iterate table to stability}{C-u C-u C-c *}
+\key{rotate calculation mark through \# * ! \^ \_ \$}{C-\#}
+\key{show line, column, formula reference}{C-c ?}
+\key{toggle coordinate grid}{C-c \}}
+\key{toggle formula debugger}{C-c \{}
+
+\newcolumn
+{\it Formula Editor}
+
+\key{edit formulas in separate buffer}{C-c '}
+\key{exit and install new formulas}{C-c C-c}
+\key{exit, install, and apply new formulas}{C-u C-c C-c}
+\key{abort}{C-c C-q}
+\key{toggle reference style}{C-c C-r}
+\key{pretty-print Lisp formula}{TAB}
+\key{complete Lisp symbol}{M-TAB}
+\key{shift reference point}{S-cursor}
+\key{shift test line for column references}{M-up/down}
+\key{scroll the window showing the table}{M-S-up/down}
+\key{toggle table coordinate grid}{C-c \}}
+
 \section{Links}
 
 \key{globally store link to the current location}{C-c l$^1$}
@@ -466,24 +482,24 @@ formula, \kbd{:=} a named-field formula.
 %\key{\kbd{vm://myself@some.where.org/folder\#id}}{\rm VM remote}
 
 
-\section{Remember-mode Integration}
+\section{Remember-mode Integration}
 
-See the manual for how to make remember.el use Org-mode links and
-files.  The note-finishing command \kbd{C-c C-c} will first prompt for
-an org file. In the file, find a location with:
+See the manual for how to make remember.el use Org-mode links and
+files.  The note-finishing command \kbd{C-c C-c} will first prompt for
+an org file. In the file, find a location with:
 
-\key{rotate subtree visibility}{TAB}
-\key{next heading}{DOWN}
-\key{previous heading}{UP}
+\key{rotate subtree visibility}{TAB}
+\key{next heading}{DOWN}
+\key{previous heading}{UP}
 
-Insert the note with one of the following: 
+Insert the note with one of the following: 
 
-\key{as sublevel of heading at cursor}{RET}
-\key{right here (cursor not on heading)}{RET}
-\key{before current heading}{LEFT}
-\key{after current heading}{RIGHT}
-\key{shortcut to end of buffer (cursor at buf-start)}{RET}
-\key{Abort}{q}
+\key{as sublevel of heading at cursor}{RET}
+\key{right here (cursor not on heading)}{RET}
+\key{before current heading}{LEFT}
+\key{after current heading}{RIGHT}
+\key{shortcut to end of buffer (cursor at buf-start)}{RET}
+\key{Abort}{q}
 
 \section{Completion}
 
@@ -502,16 +518,18 @@ after  ``{\tt :}'', and dictionary words elsewhere.
 \section{TODO Items and Checkboxes}
 
 \key{rotate the state of the current item}{C-c C-t}
+\metax{select next/previous state}{S-LEFT/RIGHT}
+\metax{select next/previous set}{C-S-LEFT/RIGHT}
 \key{view TODO items in a sparse tree}{C-c C-v}
 \key{view 3rd TODO keyword's sparse tree}{C-3 C-c C-v}
 
 \key{set the priority of the current item}{C-c , [ABC]}
 \key{remove priority cookie from current item}{C-c , SPC}
-\key{raise priority of current item}{S-UP$^3$}
-\key{lower priority of current item}{S-DOWN$^3$}
+\key{raise/lower priority of current item}{S-UP/DOWN$^3$}
+%\key{lower priority of current item}{S-DOWN$^3$}
 
-\key{\kbd{\#+SEQ_TODO: TODO TRY BLUFF DONE}}{\rm todo workflow}
-\key{\kbd{\#+TYP_TODO: Phil home work DONE}}{\rm todo types}
+%\key{\kbd{\#+SEQ_TODO: TODO TRY BLUFF DONE}}{\rm todo workflow}
+%\key{\kbd{\#+TYP_TODO: Phil home work DONE}}{\rm todo types}
 
 \key{insert new checkbox item in plain list}{M-S-RET}
 \key{toggle checkbox(es) in region/entry/at point}{C-c C-x C-b}
@@ -526,6 +544,24 @@ after  ``{\tt :}'', and dictionary words elsewhere.
 \key{create sparse tree with matching tags}{C-c \\}
 \key{globally (agenda) match tags at cursor}{C-c C-o}
 
+\section{Properties and Column View}
+
+\key{special commands in property lines}{C-c C-c}
+\key{next/previous allowed value}{S-left/right}
+\key{turn on column view}{C-c C-x C-c}
+
+\key{quit column view}{q}
+\key{next/previous allowed value}{S-left/right}
+\key{next/previous allowed value}{n / p}
+\key{edit value}{e}
+\key{edit allowed values list}{a}
+\key{show value}{v}
+\key{make column wider/narrower}{> / <}
+\key{move column left/right}{M-left/right}
+\key{add new column}{M-S-right}
+\key{Delete current column}{M-S-left}
+
+
 \section{Timestamps}
 
 \key{prompt for date and insert timestamp}{C-c .}
@@ -548,23 +584,17 @@ after  ``{\tt :}'', and dictionary words elsewhere.
 %\key{... forward/backward one month}{M-S-LEFT/RIGT}
 \key{Toggle custom format display for dates/times}{C-c C-x C-t}
 
+\newcolumn
 
-\section{Clocking Time}
+{\bf Clocking time}
 
 \key{start clock on current item}{C-c C-x C-i}
 \key{stop clock on current item}{C-c C-x C-o}
 \key{cancel current clock}{C-c C-x C-x}
-
 \key{display total subtree times}{C-c C-x C-d}
 \key{remove displayed times}{C-c C-c}
 \key{insert/update table with clock report}{C-c C-x C-r}
 
-\section{LaTeX and cdlatex-mode}
-
-\key{preview LaTeX fragment}{C-c C-x C-l}
-\key{Expand abbreviation (cdlatex-mode)}{TAB}
-\key{Insert/modify math symbol (cdlatex-mode)}{` / '}
-
 \section{Agenda Views}
 
 \key{add/move current file to front of agenda}{C-c [}
@@ -605,7 +635,7 @@ To set categories, add lines like$^2$:
 {\bf Change display}
 
 \key{delete other windows}{o}
-\key{switch to daily / weekly view}{d / w}
+\key{switch to day/week/month/year view}{d w m y}
 \key{toggle inclusion of diary entries}{D}
 \key{toggle time grid for daily schedule}{g}
 \key{toggle display of logbook entries}{l}
@@ -632,6 +662,7 @@ To set categories, add lines like$^2$:
 \key{change timestamp to today}{>}
 \key{insert new entry into diary}{i}
 
+\newcolumn
 \key{start the clock on current item (clock-in)}{I}
 \key{stop the clock (clock-out)}{O}
 \key{cancel current clock}{X}
@@ -640,7 +671,6 @@ To set categories, add lines like$^2$:
 
 \key{Open link in current line}{C-c C-o}
 
-\newcolumn
 {\bf Calendar commands}
 
 \key{find agenda cursor date in calendar}{c}
@@ -662,6 +692,12 @@ Include Emacs diary entries into Org-mode agenda with:
 (setq org-agenda-include-diary t)
 \endexample
 
+\section{LaTeX and cdlatex-mode}
+
+\key{preview LaTeX fragment}{C-c C-x C-l}
+\key{Expand abbreviation (cdlatex-mode)}{TAB}
+\key{Insert/modify math symbol (cdlatex-mode)}{` / '}
+
 \section{Exporting and Publishing}
 
 Exporting creates files with extensions {\it .txt\/} and {\it .html\/}
@@ -674,17 +710,17 @@ some other place.
 \key{insert template of export options}{C-c C-x t}
 \key{toggle fixed width for entry or region}{C-c :}
 
-{\bf HTML formatting}
+%{\bf HTML formatting}
 
-\key{make words {\bf bold}}{*bold*}
-\key{make words {\it italic}}{/italic/}
-\key{make words \underbar{underlined}}{_underlined_}
-\key{sub- and superscripts}{x\^{}3, J_dust}
-\key{\TeX{}-like macros}{\\alpha, \\to}
-\key{typeset lines in fixed width font}{start with :}
-\key{tables are exported as HTML tables}{start with |}
-\key{links become HTML links}{http:... etc}
-\key{include html tags}{@<b>...@</b>}
+%\key{make words {\bf bold}}{*bold*}
+%\key{make words {\it italic}}{/italic/}
+%\key{make words \underbar{underlined}}{_underlined_}
+%\key{sub- and superscripts}{x\^{}3, J_dust}
+%\key{\TeX{}-like macros}{\\alpha, \\to}
+%\key{typeset lines in fixed width font}{start with :}
+%\key{tables are exported as HTML tables}{start with |}
+%\key{links become HTML links}{http:... etc}
+%\key{include html tags}{@<b>...@</b>}
 
 %{\bf Export options}
 %
@@ -720,21 +756,6 @@ Subtrees whose header starts with COMMENT are never exported.
 
 \key{toggle COMMENT keyword on entry}{C-c ;}
 
-
-%\section{CUA and pc-select compatibility}%
-
-%Configure the variable {\tt org-CUA-compatibility} to make Org-mode
-%avoid the \kbd{S-<cursor>} bindings used by these modes.  When set,
-%Org-mode will change the following keybindings (also in the agenda
-%buffer, but not during date selection). See note mark four$^3$
-%throughout the reference card.
-%%\vskip-mm
-%\beginexample
-%S-UP    $\to$ M-p             S-DOWN  $\to$ M-n
-%S-LEFT  $\to$ M--             S-RIGHT $\to$ M-+
-%S-RET   $\to$ C-S-RET
-%\endexample
-
 \section{Dynamic Blocks}
 
 \key{update dynamic block at point}{C-c C-x C-u}
@@ -753,10 +774,8 @@ $^3$ Keybinding affected by {\tt org-CUA-compatibility}.
 
 \bye
 \f
+% Local variables:
+% compile-command: "tex refcard"
+% End:
 
 % arch-tag: 139f6750-5cfc-49ca-92b5-237fe5795290
-
-%%% Local Variables: 
-%%% mode: latex
-%%% TeX-master: t
-%%% End: 
index a9292e3..3df1f9d 100644 (file)
@@ -4,7 +4,7 @@
 
        * COPYING: Switch to GPLv3.
 
-2007-07-20  Eli Zaretskii  <eliz@gnu.org>
+2007-07-16  Eli Zaretskii  <eliz@gnu.org>
 
        * makefile.w32-in (extraclean): Don't delete *~.
 
index f26845c..2f4b58a 100644 (file)
@@ -4,10 +4,34 @@
 
        * COPYING: Switch to GPLv3.
 
-2007-07-20  Eli Zaretskii  <eliz@gnu.org>
+2007-07-17  Francesco Potort\e,Al\e(B  <pot@gnu.org>
+
+       * etags.c (C_entries): Reset the fvdef machine when out of function.
+       (PRINT_UNDOCUMENTED_OPTIONS_HELP): #define as FALSE if undefined.
+       (print_help): Use it in if() rather than #if.
+       (print_help): Conditionally print help about --no-line-directive.
+
+2007-07-16  Eli Zaretskii  <eliz@gnu.org>
 
        * makefile.w32-in (clean): Don't delete *~.
 
+2007-06-07  Glenn Morris  <rgm@gnu.org>
+
+       * etags.c (print_version): Add `emacs_copyright' string, for
+       easier automatic updating.
+
+2007-05-18  Francesco Potort\e,Al\e(B  <pot@gnu.org>
+
+       * etags.c: Extern definitions of some more pointer functions for
+       standalone compilation, especially important for 64bit platforms.
+       (main, print_help): --members is now the default for etags.
+       (C_entries): Parse start of C comment as a space == end of token.
+       This is not necessary for C++ comment, already parsed as newline.
+
+2007-04-26  Glenn Morris  <rgm@gnu.org>
+
+       * makefile.w32-in (VERSION): Increase to 22.1.50.
+
 2007-06-02  Chong Yidong  <cyd@stupidchicken.com>
 
        * Version 22.1 released.
        [WINDOWSNT]: #undef DOS_NT and #define it even if built with
        HAVE_CONFIG_H.  This change does nothing in Emacs, as DOS_NT is
        always defined when HAVE_CONFIG_H and WINDOWS are both defined.
-       [!HAVE_UNISTD_H]: use defined(WINDOWSNT) instead of the bare
+       [!HAVE_UNISTD_H]: Use defined(WINDOWSNT) instead of the bare
        WINDOWSNT, as this is the correct way to use it.
 
 2001-01-28  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
 1997-03-14  Francesco Potort\e,Al\e(B  <F.Potorti@cnuce.cnr.it>
 
-       * etags.c (add_regex): reset *putbuf before using it.
+       * etags.c (add_regex): Reset *putbuf before using it.
 
 1997-02-23  Jonathan I. Kamens  <jik@kamens.brookline.ma.us>
 
 
 1995-12-04  Francesco Potort\e,Al\e(B  <pot@cnuce.cnr.it>
 
-       * Makefile.in (ctags): depend on etags only for simplicity;
+       * Makefile.in (ctags): Depend on etags only for simplicity;
        compile with regexp support enabled.
 
 1995-11-24  Richard Stallman  <rms@mole.gnu.ai.mit.edu>
 
 1995-06-27  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
-       * etags.c (plain_C_entries): new function.
-       (lowcase): new macro.
-       (tail, Fortran_functions, Pascal_functions): use new macro lowcase.
-       (lang_suffixes): new suffix ".pc" for Pro*C files.
-       (consider_token): don't tag all tokens beginning with DEFUN & Co..
-       (tail): look for the end of the token when comparing.
-       (takeprec): since now tail behaves differently, use strneq.
+       * etags.c (plain_C_entries): New function.
+       (lowcase): New macro.
+       (tail, Fortran_functions, Pascal_functions): Use new macro lowcase.
+       (lang_suffixes): New suffix ".pc" for Pro*C files.
+       (consider_token): Don't tag all tokens beginning with DEFUN & Co..
+       (tail): Look for the end of the token when comparing.
+       (takeprec): Since now tail behaves differently, use strneq.
 
 1995-07-08  Paul Eggert  <eggert@twinsun.com>
 
 
 1995-06-27  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
-       * etags.c (plain_C_entries): new function.
-       (lowcase): new macro.
-       (tail, Fortran_functions, Pascal_functions): use new macro lowcase.
-       (lang_suffixes): new suffix ".pc" for Pro*C files.
-       (consider_token): don't tag all tokens beginning with DEFUN & Co..
-       (tail): look for the end of the token when comparing.
-       (takeprec): since now tail behaves differently, use strneq.
+       * etags.c (plain_C_entries): New function.
+       (lowcase): New macro.
+       (tail, Fortran_functions, Pascal_functions): Use new macro lowcase.
+       (lang_suffixes): New suffix ".pc" for Pro*C files.
+       (consider_token): Don't tag all tokens beginning with DEFUN & Co..
+       (tail): Look for the end of the token when comparing.
+       (takeprec): Since now tail behaves differently, use strneq.
 
 1995-06-26  Richard Stallman  <rms@mole.gnu.ai.mit.edu>
 
 
 1995-03-13  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
-       * etags.c (process_file): free (filename) after using it.
+       * etags.c (process_file): Free (filename) after using it.
        (readline_internal): Do not access the char before start of line.
 
 1995-02-22  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
 1994-11-22  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
-       * etags.c (print_help): print --regex usage for ctags also.
-       (main): use -h in addition to -H as abbreviation for --help.
+       * etags.c (print_help): Print --regex usage for ctags also.
+       (main): Use -h in addition to -H as abbreviation for --help.
 
 1994-11-16  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
 
 1994-10-21  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
-       * etags.c (prestr, substr): return a logical type.
+       * etags.c (prestr, substr): Return a logical type.
        (consider_token): Comment out "EXFUN".  Use "DEFUN" instead of "DEF".
-       (consider_token): set funcdef to fignore when a DEFUN is met.
+       (consider_token): Set funcdef to fignore when a DEFUN is met.
        (C_entries): Now we can use Tom Hageman patch for extern "C".
 
 1994-10-20  Richard Stallman  <rms@mole.gnu.ai.mit.edu>
 
 1994-10-17  Francesco Potort\e,Al\e(B  (pot@fly.cnuce.cnr.it)
 
-       * Makefile.in.in (etags): add dependency on regex.o, link with it.
-       (REGEXPOBJ, REGEXPDEPS, regex.o): target and macros added.
+       * Makefile.in.in (etags): Add dependency on regex.o, link with it.
+       (REGEXPOBJ, REGEXPDEPS, regex.o): Target and macros added.
 
 1994-10-12  David J. MacKenzie  (djm@duality.gnu.ai.mit.edu)
 
 
 1994-07-08  Dave Love  (d.love@dl.ac.uk)
 
-       * etags.c (takeprec): recognise `character*(*) function'
+       * etags.c (takeprec): Recognise `character*(*) function'.
 
 1994-07-08  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
 
 1994-04-18  Francesco Potort\e,Al\e(B  (pot@fly.cnuce.cnr.it)
 
-       * etags.c (main, print_help): eliminate the -F option.
+       * etags.c (main, print_help): Eliminate the -F option.
 
 1994-04-18  Francesco Potort\e,Al\e(B  (pot@fly.cnuce.cnr.it)
 
-       * etags.c (absolute_filename): compare against '\0' instead of NULL.
+       * etags.c (absolute_filename): Compare against '\0' instead of NULL.
 
 1994-04-16  Richard Stallman  (rms@mole.gnu.ai.mit.edu)
 
 
 1994-04-08  Francesco Potort\e,Al\e(B  (pot@fly.cnuce.cnr.it)
 
-       * etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
-       (PF_funcs, Asm_funcs, L_funcs, PAS_funcs, TEX_funcs,
-       Scheme_funcs, prolog_funcs): renamed to Fortran_functions,
+       * etags.c (outf, outfiledir): Renamed to tagf, tagfiledir.
+       (PF_funcs, Asm_funcs, L_funcs, PAS_funcs, TEX_funcs)
+       (Scheme_funcs, prolog_funcs): Renamed to Fortran_functions,
        Asm_labels, Lisp_functions, Pascal_functions, Scheme_functions,
        TeX_functions, Prolog_functions.
-       (inf): no more a global variable.
-       (C_entries): take 2nd parameter `inf' instead of using the global one.
-       (find_entries): added the cp1 var for optimisation.
-       (find_entries): added more suffixes for assembler files.
+       (inf): No more a global variable.
+       (C_entries): Take 2nd parameter `inf' instead of using the global one.
+       (find_entries): Added the cp1 var for optimisation.
+       (find_entries): Added more suffixes for assembler files.
        (Asm_funcs): Now finds labels even without an ending colon.
 
 1994-03-30  Francesco Potort\e,Al\e(B  (pot@fly.cnuce.cnr.it)
 
-       * etags.c (main): use etags_getcwd for compatibility.
-       (etags_getcwd): new function.
+       * etags.c (main): Use etags_getcwd for compatibility.
+       (etags_getcwd): New function.
 
 1994-03-25  Richard Stallman  (rms@mole.gnu.ai.mit.edu)
 
 
 1994-03-25  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
-       * etags.c (emacs_tags_format, ETAGS): removed.  Use CTAGS instead.
-       (main): don't allow the use of -t and -T in etags mode.
-       (print_help): don't show options enabled by default.
-       (print_version): show the emacs version number if VERSION is #defined.
-       (find_entries): add "ss" as suffix for Chez Scheme.
+       * etags.c (emacs_tags_format, ETAGS): Removed.  Use CTAGS instead.
+       (main): Don't allow the use of -t and -T in etags mode.
+       (print_help): Don't show options enabled by default.
+       (print_version): Show the emacs version number if VERSION is #defined.
+       (find_entries): Add "ss" as suffix for Chez Scheme.
 
 1994-03-23  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
-       * etags.c (cwd, outfiledir): vars added.
+       * etags.c (cwd, outfiledir): Vars added.
        (relative_filename, absolute_filename, absolute_dirname):
        functions added to compute filenames in tags files.
-       (process_file): filenames in tags file are relative to the
+       (process_file): Filenames in tags file are relative to the
        directory where the tags file is (useful with the -o option).
-       (main): initialise the outfiledir var.
-       (TYPEDST): added the `tignore' value.
-       (C_entries): corrected various small bugs.
+       (main): Initialise the outfiledir var.
+       (TYPEDST): Added the `tignore' value.
+       (C_entries): Corrected various small bugs.
 
 1994-03-19  Richard Stallman  (rms@mole.gnu.ai.mit.edu)
 
 
 1994-03-14  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
-       * etags.c (TYPEDST): added the `tignore' value.
-       (C_entries): corrected various bugs, now correctly parses the
+       * etags.c (TYPEDST): Added the `tignore' value.
+       (C_entries): Corrected various bugs, now correctly parses the
        `extern "C" {' construction (patch by Tom R.Hageman).
 
 1994-03-05  Richard Stallman  (rms@mole.gnu.ai.mit.edu)
 1994-02-22  Karl Heuer  (kwzh@gnu.ai.mit.edu)
 
        * profile.c (get_time): Simplify; avoid calling index.
-       (main): exit on EOF.
+       (main): Exit on EOF.
 
 1994-02-17  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
 
 1994-02-14  Francesco Potort\e,Al\e(B  (pot@fly)
 
-       * etags.c (absolute_pathnames, cwd): added global vars.
-       (longopts, print_help, main, process_file): put absolute filenames
+       * etags.c (absolute_pathnames, cwd): Added global vars.
+       (longopts, print_help, main, process_file): Put absolute filenames
        in the tag file if the -A --absolute-pathnames option is used.
-       (print_help): alfabetically order the options.
-       (malloc, realloc, strcpy, strncpy, strcmp): remove extern declar.
+       (print_help): Alfabetically order the options.
+       (malloc, realloc, strcpy, strncpy, strcmp): Remove extern declar.
 
 1994-02-09  Richard Stallman  (rms@mole.gnu.ai.mit.edu)
 
 1994-01-14  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (stab_entry, stab_create, stab_find, stab_search,
-       stab_type, add_keyword, C_reate_stab, C_create_stabs): deleted.
+       stab_type, add_keyword, C_reate_stab, C_create_stabs): Deleted.
        Use gperf generated hash table instead of linked list.
-       (C_stab_entry, hash, in_word_set, get_C_stab, C_symtype): added.
+       (C_stab_entry, hash, in_word_set, get_C_stab, C_symtype): Added.
        Mostly code generated by gperf.
-       (consider_token): removed unused parameter `lp'.
-       (PF_funcs, getit): allow subroutine and similar declarations
+       (consider_token): Removed unused parameter `lp'.
+       (PF_funcs, getit): Allow subroutine and similar declarations
        to span multiple lines.
-       (C_entries): check for newline if inchar to avoid bus errors.
-       (process_file, find_entries): distinguish among nonexistent
+       (C_entries): Check for newline if inchar to avoid bus errors.
+       (process_file, find_entries): Distinguish among nonexistent
        and not regular file.
 
 1994-01-14  Richard Stallman  (rms@mole.gnu.ai.mit.edu)
        functions returning a pointer to a function, a la `signal', can be
        parsed.  This also required new state `fstartlist' to `FUNCST'.
        (SAVE_TOKEN, RESTORE_TOKEN, TOKEN_SAVED_P): 1-deep token save stack.
-       (C_entries, CNL): use it to isolate preprocessor directive processing
+       (C_entries, CNL): Use it to isolate preprocessor directive processing
        from the other state engines.
-       (begtk): add '~', for C++ class destructors.
+       (begtk): Add '~', for C++ class destructors.
 
 1993-11-02  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
-       * etags.c (consider_token): removed unused variable firsttok.
-       (prolog_getit): call pfnote with the right number of arguments.
+       * etags.c (consider_token): Removed unused variable firsttok.
+       (prolog_getit): Call pfnote with the right number of arguments.
 
 1993-10-19  Paul Eggert  (eggert@twinsun.com)
 
 
 1993-10-01  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
-       * etags.c (process_file): dead code removed.
+       * etags.c (process_file): Dead code removed.
        (S_ISREG): #define it using S_IFREG if not defined.
-       (process_file): regular files have nothing to do with symlinks.
+       (process_file): Regular files have nothing to do with symlinks.
 
 1993-09-28  Brian Fox  (bfox@ai.mit.edu)
 
 
 1993-08-04  Francesco Potort\e,Al\e(B  (pot@spiff.gnu.ai.mit.edu)
 
-       * etags.c (L_isdef, L_isquote, L_getit): small optimisations.
-       (L_funcs): the (foo::defmumble stuff now should work.
-       (consider_token): function returned random value--corrected.
-       (C_entries): corrected == versus = typo.
+       * etags.c (L_isdef, L_isquote, L_getit): Small optimisations.
+       (L_funcs): The (foo::defmumble stuff now should work.
+       (consider_token): Function returned random value--corrected.
+       (C_entries): Corrected == versus = typo.
 
 1993-08-01  Roland McGrath  (roland@churchy.gnu.ai.mit.edu)
 
        * etags.c (FINCST): Added the fignore status.  Means we are
        after the parameter list and before the open curly brace.
        Allows correct parsing of C++ constructors.
-       (C_entries, consider_token): make use of fignore.
-       (consider_token): reset funcdef when next_token_is_func: when in
+       (C_entries, consider_token): Make use of fignore.
+       (consider_token): Reset funcdef when next_token_is_func: when in
        ctags mode makes DEFVAR and others work better.
-       (L_isquote): function that recognises the "(quote" string.
-       (L_getit): ignore quoting via "'" or "(quote".  Useful for defalias.
+       (L_isquote): Function that recognises the "(quote" string.
+       (L_getit): Ignore quoting via "'" or "(quote".  Useful for defalias.
 
 1993-07-29  Paul Eggert  (eggert@twinsun.com)
 
 
 1993-07-08  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
-       * etags.c (alloca): removed all references to it.
-       (main): now calls xnew instead of alloca for portability.
-       (../src/config.h): included only if HAVE_CONFIG_H.
-       (const): void definition removed--config.h takes care of it.
+       * etags.c (alloca): Removed all references to it.
+       (main): Now calls xnew instead of alloca for portability.
+       (../src/config.h): Included only if HAVE_CONFIG_H.
+       (const): Void definition removed--config.h takes care of it.
 
 1993-07-08  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
-       * etags.c (consider_token): was `==', now is `='.
+       * etags.c (consider_token): Was `==', now is `='.
        (consider_token): DEFUNs now treated like funcs in ctags mode.
 
-       * etags.c (LEVEL_OK_FOR_FUNCDEF): removed.
-       (C_entries): optimized the test that used LEVEL_OK_FOR_FUNCDEF.
-       (C_entries): removed a piece of useless code.
-       (C_entries): making typedef tags is delayed until a semicolon
+       * etags.c (LEVEL_OK_FOR_FUNCDEF): Removed.
+       (C_entries): Optimized the test that used LEVEL_OK_FOR_FUNCDEF.
+       (C_entries): Removed a piece of useless code.
+       (C_entries): Making typedef tags is delayed until a semicolon
        is met.  This handles "typedef int X, Y, Z;" correctly.
 
 1993-07-06  Jim Blandy  (jimb@geech.gnu.ai.mit.edu)
 
 1993-03-22  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
-       * etags.c (YACC): flag added to c_ext.
-       (c_ext): no more a synonim for c_ext&C_PLPL because of YACC.
-       (find_entries): consistently use streq when reasonable.
-       (find_entries): a .y file is a yacc file.
+       * etags.c (YACC): Flag added to c_ext.
+       (c_ext): No more a synonim for c_ext&C_PLPL because of YACC.
+       (find_entries): Consistently use streq when reasonable.
+       (find_entries): A .y file is a yacc file.
        (get_C_stab): c_ext becomes c_ext&C_PLPL.
-       (C_entries): logical cplpl means c_ext&C_PLPL.
-       (C_entries): logical yacc_rules means we are after the first %%.
-       (C_entries): added logic for yacc files.
+       (C_entries): Logical cplpl means c_ext&C_PLPL.
+       (C_entries): Logical yacc_rules means we are after the first %%.
+       (C_entries): Added logic for yacc files.
 
 1993-03-16  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (C_entries): ':' case moved to the second switch.
-       (C_entries): do not examine token if structdef==scolonseen.
+       (C_entries): Do not examine token if structdef==scolonseen.
        (consider_token): structtag set to null string for enum.
 
 1993-03-12  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
-       * etags.c (GET_COOKIE): and related macros removed.
-       (logical): is now int, no more a char.
-       (reg): define deleted.
-       (isgood, _gd, notgd): deleted.
-       (gotone): deleted.
-       (TOKEN): member linestart removed.
-       (linepos, prev_linepos, lb1): deleted.
-       (main): call initbuffer on lbs array instead of lb1.
-       (init): removed the initialisation of the logical _gd array;
-       (find_entries): a .sa suffix means assembler file.
+       * etags.c (GET_COOKIE): And related macros removed.
+       (logical): Is now int, no more a char.
+       (reg): Define deleted.
+       (isgood, _gd, notgd): Deleted.
+       (gotone): Deleted.
+       (TOKEN): Member linestart removed.
+       (linepos, prev_linepos, lb1): Deleted.
+       (main): Call initbuffer on lbs array instead of lb1.
+       (init): Removed the initialisation of the logical _gd array;
+       (find_entries): A .sa suffix means assembler file.
        (C_create_stab): "auto", "void", "extern", "static" are st_C_typespec.
        All C state machines rewritten.
-       (C_entries): complete rewrite.
-       (condider_token): complete rewrite.
-       (getline): deleted.
+       (C_entries): Complete rewrite.
+       (condider_token): Complete rewrite.
+       (getline): Deleted.
 
 1993-03-01  Francesco Potort\e,Al\e(B  (pot@fly.CNUCE.CNR.IT)
 
 
 1993-03-19  Eric S. Raymond  (eric@geech.gnu.ai.mit.edu)
 
-       * Makefile.in (EXECUTABLES): added rcs-checkin.
+       * Makefile.in (EXECUTABLES): Added rcs-checkin.
 
        * Makefile.in (unlock, relock): New productions.
 
 
 1992-05-04  Jim Blandy  (jimb@pogo.cs.oberlin.edu)
 
-       * Makefile.in: flags in CC invocations rearranged for no reason.
+       * Makefile.in: Flags in CC invocations rearranged for no reason.
 
 1992-04-20  Jim Blandy  (jimb@pogo.cs.oberlin.edu)
 
 
 1989-04-18  Richard Stallman  (rms@sugar-bombs.ai.mit.edu)
 
-       * loadst.c: on bsd4.3, use gettimeofday instead of CPUSTATES.
+       * loadst.c: On bsd4.3, use gettimeofday instead of CPUSTATES.
 
 1989-03-15  Jeff Peck  (rms@sugar-bombs.ai.mit.edu)
 
        * emacstool.c: setenv IN_EMACSTOOL=t, TERM=sun, TERMCAP=.
 
-       * emacsstool.1: update to document environment variables.
+       * emacsstool.1: Update to document environment variables.
 
 1989-02-21  Richard Stallman  (rms@sugar-bombs.ai.mit.edu)
 
 
 1988-09-24  Richard Stallman  (rms@gluteus.ai.mit.edu)
 
-       * etags.c (main): default setting of eflag was backwards.
+       * etags.c (main): Default setting of eflag was backwards.
 
 1988-09-23  Richard Stallman  (rms@sugar-bombs.ai.mit.edu)
 
 1988-04-28  Richard Stallman  (rms@frosted-flakes.ai.mit.edu)
 
        * movemail.c: #undef close, since config can #define it on V.3.
-       * emacsclient.c, fakemail.c, loadst.c, server.c: likewise.
+       * emacsclient.c, fakemail.c, loadst.c, server.c: Likewise.
 
 1988-04-26  Richard Stallman  (rms@lucky-charms.ai.mit.edu)
 
 
 1988-03-20  Richard M. Stallman  (rms@wilson)
 
-       * server.c [not BSD and not HAVE_SYSVIPC]: fix error message.
+       * server.c [not BSD and not HAVE_SYSVIPC]: Fix error message.
 
-       * loadst.c (main) [XENIX]: use /usr/spool/mail, not /usr/mail.
+       * loadst.c (main) [XENIX]: Use /usr/spool/mail, not /usr/mail.
 
 ;; Local Variables:
 ;; coding: iso-2022-7bit
index 5da144c..0412137 100644 (file)
@@ -61,10 +61,10 @@ University of California, as described above. */
 
 /*
  * Authors:
- *     Ctags originally by Ken Arnold.
- *     Fortran added by Jim Kleckner.
- *     Ed Pelegri-Llopart added C typedefs.
- *     Gnu Emacs TAGS format and modifications by RMS?
+ * 1983        Ctags originally by Ken Arnold.
+ * 1984        Fortran added by Jim Kleckner.
+ * 1984        Ed Pelegri-Llopart added C typedefs.
+ * 1985        Emacs TAGS format by Richard Stallman.
  * 1989        Sam Kendall added C++.
  * 1992 Joseph B. Wells improved C and C++ parsing.
  * 1993        Francesco Potortì reorganised C and C++.
@@ -81,7 +81,7 @@ University of California, as described above. */
  * configuration file containing regexp definitions for etags.
  */
 
-char pot_etags_version[] = "@(#) pot revision number is 17.26";
+char pot_etags_version[] = "@(#) pot revision number is 17.34";
 
 #define        TRUE    1
 #define        FALSE   0
@@ -160,7 +160,14 @@ char pot_etags_version[] = "@(#) pot revision number is 17.26";
 #  include <stdlib.h>
 #  include <string.h>
 # else /* no standard C headers */
-    extern char *getenv ();
+   extern char *getenv ();
+   extern char *strcpy ();
+   extern char *strncpy ();
+   extern char *strcat ();
+   extern char *strncat ();
+   extern unsigned long strlen ();
+   extern PTR malloc ();
+   extern PTR realloc ();
 #  ifdef VMS
 #   define EXIT_SUCCESS        1
 #   define EXIT_FAILURE        0
@@ -484,7 +491,7 @@ static char
   *midtk = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz$0123456789";
 
 static bool append_to_tagfile; /* -a: append to tags */
-/* The next four default to TRUE for etags, but to FALSE for ctags.  */
+/* The next five default to TRUE for etags, but to FALSE for ctags.  */
 static bool typedefs;          /* -t: create tags for C and Ada typedefs */
 static bool typedefs_or_cplusplus; /* -T: create tags for C typedefs, level */
                                /* 0 struct/enum/union decls, and C++ */
@@ -876,18 +883,25 @@ etags --help --lang=ada.");
 # define EMACS_NAME "standalone"
 #endif
 #ifndef VERSION
-# define VERSION "version"
+# define VERSION "17.34"
 #endif
 static void
 print_version ()
 {
+  /* Makes it easier to update automatically. */
+  char emacs_copyright[] = "Copyright (C) 2007 Free Software Foundation, Inc.";
+
   printf ("%s (%s %s)\n", (CTAGS) ? "ctags" : "etags", EMACS_NAME, VERSION);
-  puts ("Copyright (C) 2007 Free Software Foundation, Inc.");
+  puts (emacs_copyright);
   puts ("This program is distributed under the terms in ETAGS.README");
 
   exit (EXIT_SUCCESS);
 }
 
+#ifndef PRINT_UNDOCUMENTED_OPTIONS_HELP
+# define PRINT_UNDOCUMENTED_OPTIONS_HELP FALSE
+#endif
+
 static void
 print_help (argbuffer)
      argument *argbuffer;
@@ -970,7 +984,16 @@ Relative ones are stored relative to the output file's directory.\n");
     puts ("--no-globals\n\
        Do not create tag entries for global variables in some\n\
        languages.  This makes the tags file smaller.");
-  puts ("--no-members\n\
+
+  if (PRINT_UNDOCUMENTED_OPTIONS_HELP)
+    puts ("--no-line-directive\n\
+        Ignore #line preprocessor directives in C and derived languages.");
+
+  if (CTAGS)
+    puts ("--members\n\
+       Create tag entries for members of structures in some languages.");
+  else
+    puts ("--no-members\n\
        Do not create tag entries for members of structures\n\
        in some languages.");
 
@@ -986,13 +1009,17 @@ Relative ones are stored relative to the output file's directory.\n");
        MODS are optional one-letter modifiers: `i' means to ignore case,\n\
        `m' means to allow multi-line matches, `s' implies `m' and\n\
        causes dot to match any character, including newline.");
+
   puts ("-R, --no-regex\n\
         Don't create tags from regexps for the following files.");
+
   puts ("-I, --ignore-indentation\n\
         In C and C++ do not assume that a closing brace in the first\n\
         column is the final brace of a function or structure definition.");
+
   puts ("-o FILE, --output=FILE\n\
         Write the tags to FILE.");
+
   puts ("--parse-stdin=NAME\n\
         Read from standard input and record tags as belonging to file NAME.");
 
@@ -1020,13 +1047,16 @@ Relative ones are stored relative to the output file's directory.\n");
         Print on the standard output an index of items intended for\n\
         human consumption, similar to the output of vgrind.  The index\n\
         is sorted, and gives the page number of each item.");
-# if PRINT_UNDOCUMENTED_OPTIONS_HELP
-      puts ("-w, --no-duplicates\n\
+
+      if (PRINT_UNDOCUMENTED_OPTIONS_HELP)
+       puts ("-w, --no-duplicates\n\
         Do not create duplicate tag entries, for compatibility with\n\
        traditional ctags.");
-      puts ("-w, --no-warn\n\
+
+      if (PRINT_UNDOCUMENTED_OPTIONS_HELP)
+       puts ("-w, --no-warn\n\
         Suppress warning messages about duplicate tag entries.");
-# endif /* PRINT_UNDOCUMENTED_OPTIONS_HELP */
+
       puts ("-x, --cxref\n\
         Like --vgrind, but in the style of cxref, rather than vgrind.\n\
         The output uses line numbers instead of page numbers, but\n\
@@ -1216,7 +1246,7 @@ main (argc, argv)
   if (!CTAGS)
     {
       typedefs = typedefs_or_cplusplus = constantypedefs = TRUE;
-      globals = TRUE;
+      globals = members = TRUE;
     }
 
   /* When the optstring begins with a '-' getopt_long does not rearrange the
@@ -3398,17 +3428,15 @@ C_entries (c_ext, inf)
        case '/':
          if (*lp == '*')
            {
-             lp++;
              incomm = TRUE;
-             continue;
+             lp++;
+             c = ' ';
            }
          else if (/* cplpl && */ *lp == '/')
            {
              c = '\0';
-             break;
            }
-         else
-           break;
+         break;
        case '%':
          if ((c_ext & YACC) && *lp == '%')
            {
@@ -3971,10 +3999,16 @@ C_entries (c_ext, inf)
              bracelev = 0;     /* reset brace level if first column */
              parlev = 0;       /* also reset paren level, just in case... */
            }
-         else if (bracelev > 0)
-           bracelev--;
          else
-           token.valid = FALSE; /* something gone amiss, token unreliable */
+           {
+             if (--bracelev < 0)
+               {
+                 bracelev = 0;
+                 token.valid = FALSE; /* something gone amiss, token unreliable */
+               }
+             if (bracelev == 0 && fvdef == vignore)
+               fvdef = fvnone;         /* end of function */
+           }
          popclass_above (bracelev);
          structdef = snone;
          /* Only if typdef == tinbody is typdefbracelev significant. */
dissimilarity index 95%
index c26869f..a5d5456 100644 (file)
-2007-08-13  Stephen Leake  <stephen_leake@stephe-leake.org>
-
-       * pcvs-parse.el (cvs-parse-table): Handle additional instance of
-       optional quotes around files in NEED-UPDATE . REMOVED case.
-
-       * progmodes/ada-xref.el (ada-gnatls-args): Fix docstring.
-       (ada-treat-cmd-string): Improve error message.
-       (ada-do-file-completion): Call `ada-require-project-file', so
-       project variables are set properly.
-       (ada-prj-find-prj-file): Delete Emacs 20.2 support.
-       (ada-gnatfind-buffer-name): New constant.
-       (ada-find-any-references): Use new constant.  Set buffer name
-       properly in compilation-start.  Toggle read-only properly.
-       (ada-find-in-src-path): Fix spelling error in docstring.
-
-       * progmodes/vhdl-mode.el (vhdl-update-progress-info): Avoid divide
-       by zero error.
-
-2007-08-13  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-send): Handle CTRL-D more carefully.
-
-2007-08-12  Richard Stallman  <rms@gnu.org>
-
-       * pcvs.el (cvs-reread-cvsrc, cvs-checkout, cvs-mode-checkout)
-       (cvs-execute-single-file): Use new name split-string-and-unquote.
-       (cvs-header-msg): Use new name combine-and-quote-strings.
-
-       * emulation/vi.el (vi-next-line): Ignore return value of line-move.
-
-       * progmodes/gud.el (gud-common-init): Use new name
-       split-string-and-unquote.
-
-       * progmodes/flymake.el (flymake-err-line-patterns): Fix infloop
-       in javac regexp.
-
-       * pcvs-util.el (cvs-qtypedesc-strings): Use new names
-       combine-and-quote-strings and split-string-and-unquote.
-
-       * subr.el (combine-and-quote-strings): Renamed from strings->string.
-       (split-string-and-unquote): Renamed from string->strings.
-
-2007-08-10  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * log-view.el (log-view-font-lock-keywords): Use `eval' so as to adapt
-       to buffer-local settings.
-
-       * emacs-lisp/backquote.el (backquote-delay-process): New function.
-       (backquote-process): Add internal arg `level'.  Use the two to
-       correctly handle nested backquotes.
-
-2007-08-09  Riccardo Murri  <riccardo.murri@gmail.com>
-
-       * vc-bzr.el (vc-bzr-registered): Use \0 instead of literal NULs.
-       (vc-bzr-state-words): Add "kind changed" state word.
-       (vc-bzr-status): New function.  Return Bzr idea of file status,
-       which is different from VC's.
-       (vc-bzr-state): Use vc-bzr-status.
-       (vc-workfile-unchanged-p): Use vc-bzr-status.
-       (vc-bzr-revert): Use synchronous process; expect exitcode 0.
-       (vc-dired-state): Process "kind changed" state word.
-
-2007-08-09  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * vc-hooks.el (vc-default-find-file-not-found-hook): Do nothing.
-
-       * vc-rcs.el (vc-rcs-find-file-not-found-hook):
-       Move from vc-default-find-file-not-found-hook.
-
-2007-08-09  Edward O'Connor  <hober0@gmail.com>  (tiny change)
-
-       * url/url-auth.el (url-basic-auth): When prompting for username
-       and password, default to the username and password in the URL.
-
-2007-08-08  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * man.el: Remove spurious * in docstrings.
-       Merge defvars and toplevel setq-defaults.
-       (Man-highlight-references0): Limit=nil rather than point-max.
-       (Man-mode-map): Move initialization into the declaration.
-       (Man-strip-page-headers, Man-unindent): Use dolist & inhibit-read-only.
-       (Man-view-header-file): Use expand-file-name rather than concat.
-       (Man-notify-when-ready, Man-bgproc-sentinel): Use with-current-buffer.
-
-       * man.el (Man-next-section): Make sure we do not move backward.
-
-2007-08-08  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
-
-       * ps-print.el (ps-default-fg, ps-default-bg): Docstring fix.
-       (ps-begin-job): Use ps-default-fg and ps-default-bg only when
-       ps-print-color-p is neither nil nor black-white.  Reported by Christian
-       Schlauer <cs-muelleimer-rubbish.bin@arcor.de>.
-
-2007-08-08  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * files.el (auto-mode-alist): Use the purecopied text (duh!).
-
-2007-08-08  Andreas Schwab  <schwab@suse.de>
-
-       * mail/mailabbrev.el (sendmail-pre-abbrev-expand-hook): Check for
-       self-insert-command, not self-insert.
-
-2007-08-08  Glenn Morris  <rgm@gnu.org>
-
-       * emacs-lisp/checkdoc.el (checkdoc-ispell-lisp-words): Remove `iff'.
-
-       * Replace `iff' in doc-strings and comments.
-
-       * help-mode.el (help-make-xrefs): Search for symbol constituents,
-       rather than just `-'.
-
-2007-08-08  Martin Rudalics  <rudalics@gmx.at>
-
-       * dired.el (dired-pop-to-buffer):
-       * mouse-drag.el (mouse-drag-should-do-col-scrolling):
-       * calendar/calendar.el (generate-calendar-window):
-       * progmodes/compile.el (compilation-set-window-height):
-       * textmodes/two-column.el (2C-two-columns, 2C-merge):
-       Use window-full-width-p instead of comparing frame-width and
-       window-width.
-
-       * progmodes/compile.el (compilation-find-buffer): Remove extra
-       argument in call to compilation-buffer-internal-p.
-
-2007-08-07  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/tramp.el (tramp-handle-file-remote-p): Handle optional
-       parameters IDENTIFICATION and CONNECTED.
-       (tramp-handle-insert-file-contents): VISIT must be handled after
-       insertion of the local copy.  Reported by Peter Gordon
-       <peter@pg-consultants.com>.
-       (tramp-file-name-handler): No special handling for
-       `expand-file-name'.  But for `file-name-as-directory'.
-       (tramp-find-shell, tramp-open-connection-telnet)
-       (tramp-open-connection-rsh, tramp-open-connection-su)
-       (tramp-open-connection-multi)
-       (tramp-open-connection-setup-interactive-shell): Guard against
-       $PROMPT_COMMAND shell var.  Reported by Steve Youngs
-       <steve@sxemacs.org>.
-       (tramp-append-tramp-buffers): Replace "sensible" by "sensitive" in
-       the hint.
-
-       * net/trampver.el: Update release number.
-
-2007-08-07  Tom Tromey  <tromey@redhat.com>
-
-       * progmodes/tcl.el (tcl-indent-level, tcl-continued-indent-level):
-       Add safe-local-variable property.
-
-2007-08-07  Chong Yidong  <cyd@stupidchicken.com>
-
-       * image-mode.el (image-toggle-display): Use image-refresh.
-
-       * longlines.el (longlines-decoded): New variable.
-       (longlines-mode): Avoid encoding or decoding the buffer twice.
-
-2007-08-07  Riccardo Murri  <riccardo.murri@gmail.com>
-
-       * vc-bzr.el: Remove comments about vc-bzr.el being a modified
-       unofficial version.
-       (vc-bzr-command): Remove redundant setting of process-connection-type.
-       (vc-bzr-admin-checkout-format-file): Add autoload.
-       (vc-bzr-root-dir): Remove in favor of vc-bzr-root.
-       (vc-bzr-root): Switch to implementation of vc-bzr-root-dir.
-       (vc-bzr-registered): Compare dirstate format tag with known good
-       value, abort parsing if match fails.  Warn user in docstring.
-       (vc-bzr-workfile-version): Case for different Bzr branch formats.
-       See bzrlib/branch.py in Bzr sources.
-       (vc-bzr-diff): First argument FILES may be a string rather than a list.
-       (vc-bzr-shell-command): Remove in favor of
-       vc-bzr-command-discarding-stderr.
-       (vc-bzr-command-discarding-stderr): New function.
-
-2007-08-06  Riccardo Murri  <riccardo.murri@gmail.com>
-
-       * vc-bzr.el (vc-bzr-registered): Gracefully handle missing "bzr"
-       program, and return nil
-       (vc-bzr-state): Gracefully handle missing "bzr" program, and return nil.
-       (vc-bzr-state): Look for path names relative to the repository
-       root after status keyword.
-       (vc-bzr-file-name-relative): New function.
-       (vc-bzr-admin-dirname): Reinstate, as other vc-bzr-admin-... paths
-       depend on it.
-       (vc-bzr-admin-dirname, ...-checkout-format-file)
-       (...-branch-format-file, ...-revhistory): Paths to some Bzr internal
-       files that we now parse directly for speed.
-       (vc-bzr-root-dir): Use `vc-bzr-admin-checkout-format-file' as witness.
-       (vc-bzr-registered): Only parse vc-bzr-admin-dirstate file if it exists.
-       (vc-bzr-state): "bzr status" successful only if exitcode is 0
-       (vc-bzr-root): Use `vc-bzr-shell-command'.  Stderr may contain
-       Bzr warnings, so we must discard it.
-       (vc-bzr-workfile-version): Speedup counting lines from
-       `vc-bzr-admin-revhistory' file, but fallback to spawning "bzr revno"
-       if that file doesn't exist.
-       (vc-bzr-responsible-p): Use `vc-bzr-root' instead of
-       `vc-bzr-root-dir' for speed.  Add `vc-bzr-admin-dirname'
-       (not ".bzr"!) to `vc-directory-exclusion-list'
-       (vc-bzr-shell-command): New function.
-
-2007-08-06  Tom Tromey  <tromey@redhat.com>
-
-       * diff-mode.el (diff-unified->context, diff-reverse-direction)
-       (diff-fixup-modifs): Typo in docstring.
-
-2007-08-06  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * emulation/tpu-edt.el (tpu-current-line): Use posn-at-point and
-       count-screen-lines.
-       (tpu-edt-off): Disable relevant pieces of advice.
-
-       * emulation/tpu-extras.el (tpu-before-save-hook): Rename from
-       tpu-write-file-hook.  Activate it with add-hook on buffer-save-hook.
-       (newline, newline-and-indent, do-auto-fill): Use advice instead of
-       redefining the function.
-       (tpu-set-scroll-margins): Activate the pieces of advice.
-
-2007-08-06  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/ange-ftp.el (ange-ftp-hook-function): Catch also errors in
-       process-filter.
-
-2007-08-06  Martin Rudalics  <rudalics@gmx.at>
-
-       * help.el (resize-temp-buffer-window): Use window-full-width-p
-       instead of comparing frame-width and window-width.
-
-2007-08-05  Peter Povinec  <ppovinec <at> yahoo.com> (tiny change)
-
-       * term.el: Honor term-default-fg-color and term-default-bg-color
-       settings when modifying term-current-face.
-       (term-default-fg-color, term-default-bg-color): Initialize from
-       default term-current-face.
-       (term-mode, term-reset-terminal): Set term-current-face with
-       term-default-fg-color and term-default-bg-color.
-       (term-handle-colors-array): term-current-face has term-default-fg-color
-       and term-default-bg-color after reset escape sequence.
-       (term-handle-colors-array): Set term-current-color with
-       term-default-fg/bg-color instead of ansi-term-color-vector when the
-       index (term-ansi-current-color or term-ansi-current-bg-color) is zero.
-
-2007-08-05  Michael Albinus  <michael.albinus@gmx.de>
-
-       * files.el (set-auto-mode): Handle also remote files wrt
-       `auto-mode-alist'.
-
-       * net/tramp.el (tramp-handle-file-remote-p): Return a string as
-       remote identification.
-
-2007-08-04  Glenn Morris  <rgm@gnu.org>
-
-       * autorevert.el (auto-revert-tail-mode): auto-revert-tail-pos is
-       zero, not nil, when the library is first loaded.  Check for a file
-       that has been modified on disk.
-
-       * progmodes/cperl-mode.el (cperl-compilation-error-regexp-alist):
-       Remove duplicate defvar preventing initialization.
-       (cperl-mode): Fix compilation-error-regexp-alist-alist setting.
-
-2007-08-03  Miles Bader  <miles@gnu.org>
-
-       * vc-hooks.el (vc-handled-backends): Change capitalization of VC
-       backend names for new backends to `Git', `Hg', and `Bzr'.
-       * vc-hg.el (vc-hg-dired-state-info): Use `Hg' as VC backend name,
-       not `HG'.
-       * vc-git.el (vc-git-dired-state-info): Use `Git' as VC backend
-       name, not `GIT'.
-       * vc-bzr.el (vc-bzr-dir-state, vc-bzr-dired-state-info)
-       (vc-bzr-unload-hook): Use `Bzr' as VC backend name, not `BZR'.
-
-2007-08-03  Glenn Morris  <rgm@gnu.org>
-
-       * net/telnet.el (telnet-mode): Set comint-use-prompt-regexp to t.
-
-2007-08-02  Richard Stallman  <rms@gnu.org>
-
-       * mail/rmailsum.el (rmail-make-summary-line): Find end of msg number
-       to update deleted flag.
-
-       * cus-edit.el (customize-apropos, customize-apropos-options)
-       (customize-apropos-faces, customize-apropos-groups): Improve prompt.
-
-       * menu-bar.el (menu-bar-help-menu): Add "About GNU" menu item.
-
-       * startup.el (fancy-splash-head, startup-echo-area-message):
-       Change message text.
-
-       * emulation/tpu-edt.el (next-line-internal): Setting deleted.
-       All callers use line-move.
-
-       * progmodes/compile.el (compilation-find-buffer): Return current
-       buffer immediately if suitable.
-       (compile, compilation-buffer-name, compilation-start): Doc fixes.
-
-2007-08-02  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * vc-bzr.el (vc-bzr-admin-dirstate): Rename from `...-dirname'.
-       Make it more discriminating and more useful.
-       (vc-bzr-root-dir): Use new name.
-       (vc-bzr-registered): Use new name and look at the dirstate file to
-       determine if it's registered or not without running `bzr'.
-
-2007-08-01  Eric Hanchrow  <offby1@blarg.net>  (tiny change)
-
-       * ibuf-ext.el (ibuffer-mark-old-buffers): Docstring fix.
-
-2007-07-31  Drew Adams  <drew.adams@oracle.com>
-
-       * cus-edit.el (custom-group-value-create, custom-goto-parent):
-       Fix parent groups link.
-
-2007-07-31  Daiki Ueno  <ueno@unixuser.org>
-
-       * faces.el (face-normalize-spec): New function.
-       (frame-set-background-mode): Normalize face-spec before calling
-       face-spec-match-p.
-
-2007-07-31  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * vc-bzr.el: New file (copied from the trunk).
-
-       * vc-hooks.el (vc-handled-backends): Add BZR.
-       (vc-find-file-hook): Failsafe if the backend's `registered'
-       function burps.
-
-       * server.el (server-window): Add switch-to-buffer-other-frame option.
-
-2007-07-30  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * vc-git.el (vc-directory-exclusion-list, vc-handled-backends): Remove.
-       (vc-git-revision-completion-table): Enable.
-
-       * vc-hooks.el (vc-handled-backends): Add GIT and HG.
-
-       * vc.el (vc-directory-exclusion-list): Add .git and .hg.
-
-       * vc-hg.el (vc-hg-revision-completion-table): Re-enable.
-       (vc-hg-registered): Set the vc-state property.
-
-       * diff-mode.el (diff-mode-menu): New entries.
-
-2007-06-30  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * diff-mode.el (diff-beginning-of-file-and-junk): New function.
-       (diff-file-kill): Use it.
-       (diff-beginning-of-hunk): Add arg `try-harder' using it.
-       (diff-restrict-view, diff-find-source-location, diff-refine-hunk):
-       Use it so they find the hunk even when we're in the file header.
-
-       * vc.el: Add new VC operation `revision-completion-table'.
-       (vc-default-revision-completion-table): New function.
-       (vc-version-diff, vc-version-other-window): Use it to provide
-       completion of revision names if the backend provides it.
-
-       * vc-arch.el (vc-arch--version-completion-table)
-       (vc-arch-revision-completion-table): New functions to provide
-       completion of revision names.
-
-       * vc-cvs.el: Require CL.
-       (vc-cvs-revision-table, vc-cvs-revision-completion-table):
-       New functions to provide completion of revision names.
-
-2007-07-29  Kimit Yada  <kimitto@gmail.com>  (tiny change)
-
-       * emacs-lisp/copyright.el (copyright-update-year, copyright-update)
-       (copyright-fix-years, copyright): Correctly handle the case where
-       copyright-limit is nil.
-
-2007-07-28  Konstantin Novitsky  <knovitsk@Bear.com>  (tiny change)
-
-       * progmodes/python.el (run-python): Fix path separator under w32.
-
-2007-07-28  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * vc-git.el: New File.
-
-2007-07-28  Alan Mackenzie  <acm@muc.de>
-
-       Fix problem with modes derived from CC Mode:
-       * progmodes/cc-mode.el (c-make-emacs-variables-local): Move this
-       macro to cc-langs.
-       (c-init-language-vars-for): Remove call to above macro.
-       * progmodes/cc-langs.el (c-make-emacs-variables-local): Macro has
-       been moved to here.
-       (c-make-init-lang-vars-fun): Call c-make-emacs-variables-local.
-
-2007-07-28  Eli Zaretskii  <eliz@gnu.org>
-
-       * net/trampver.el: Fix the `coding' cookie.
-
-2007-07-25  Nick Roberts  <nickrob@snap.net.nz>
-
-       * add-log.el (change-log-redate): Remove (not needed anymore and
-       doesn't appear to work).
-
-2007-07-25  Glenn Morris  <rgm@gnu.org>
-
-       * Relicense all FSF files to GPLv3 or later.
-
-       * COPYING: Switch to GPLv3.
-
-2007-07-25  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * pcvs.el (cvs-temp-buffer): Undo last ill-conceived change.
-       Replace it with another one which disables undo before calling
-       erase-buffer and then turns it back on if needed.
-
-2007-07-24  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
-
-       * ps-print.el: Problem with foreground and background color when
-       printing a buffer with and without faces.  Reported by Christian
-       Schlauer <cs-muelleimer-rubbish.bin@arcor.de>.
-       (ps-print-version): New version 6.7.5.
-       (ps-default-fg): Change default value to nil, so black color is used
-       when a face does not specify a foreground color.
-       (ps-default-bg): Change default value to nil, so white color is used
-       for background color.
-       (ps-begin-job): Fix code.
-
-2007-07-24  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * vc-hg.el (vc-hg-revision-completion-table): Temporarily comment out.
-
-2007-07-24  Alan Mackenzie  <acm@muc.de>
-
-       * emacs-lisp/bytecomp.el (byte-compile-from-buffer):
-       Initialise byte-compile-unresolved-functions before rather than
-       after a compilation.
-       (byte-compile-unresolved-functions): Amplify doc string.
-
-2007-07-24  Glenn Morris  <rgm@gnu.org>
-
-       * calendar/cal-tex.el (cal-tex-holidays, cal-tex-diary)
-       (cal-tex-rules, cal-tex-buffer, cal-tex-24)
-       (cal-tex-cursor-month-landscape, cal-tex-cursor-month)
-       (cal-tex-cursor-week, cal-tex-cursor-week2)
-       (cal-tex-cursor-week-iso, cal-tex-week-hours)
-       (cal-tex-cursor-week-monday, cal-tex-weekly4-box)
-       (cal-tex-cursor-filofax-2week, cal-tex-cursor-filofax-week)
-       (cal-tex-cursor-filofax-daily, cal-tex-daily-page): Doc fix.
-
-2007-07-24  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * pcvs.el (cvs-temp-buffer): Disable undo in temp buffers.
-
-2007-07-23  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * ses.el (ses-cleanup): Prevent Emacs from spuriously checking if the
-       underlying file is uptodate.
-
-2007-07-23  Richard Stallman  <rms@gnu.org>
-
-       * progmodes/octave-inf.el (inferior-octave-prompt): Accept .exe.
-
-2007-07-23  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/sh-script.el (sh-font-lock-backslash-quote)
-       (sh-font-lock-flush-syntax-ppss-cache): New funs.
-       (sh-font-lock-syntactic-keywords): Use them to distinguish the
-       different possible cases for \'.
-       (sh-font-lock-paren): Mark the relevant text with font-lock-multiline.
-
-       * vc-hooks.el (vc-find-root): Walk up the tree to find an existing
-       `file' from which to start the search and fix case where `file' is the
-       current directory and the root as well.
-
-       * pcvs.el (cvs-mode-add-change-log-entry-other-window): Use a directory
-       name for buffer-file-name if it refers to a directory.
-
-2007-07-22  Jason Rumney  <jasonr@gnu.org>
-
-       * w32-fns.el (set-default-process-coding-system): Use dos line ends
-       for input to cmdproxy on all versions of Windows.
-       Use dos line ends for input to plink.
-
-       * comint.el (comint-simple-send): Concat newline before sending.
-       (comint-password-prompt-regexp): Recognize plink's passphrase prompt.
-
-2007-07-22  Juri Linkov  <juri@jurta.org>
-
-       * isearch.el (isearch-edit-string): Save old point and
-       isearch-other-end to old-point and old-other-end before reading
-       the search string from minibuffer.  After exiting minibuffer set
-       point to old-other-end if point and the search direction is the
-       same as before reading the search string.
-       (isearch-del-char): Don't set isearch-yank-flag to t.  Put point
-       to isearch-other-end.  Instead of isearch-search-and-update call
-       three functions isearch-search, isearch-push-state and isearch-update.
-
-2007-07-22  Ralf Angeli  <angeli@caeruleus.net>
-
-       * textmodes/reftex.el (reftex-access-parse-file): Do not risk
-       destroying an existing buffer.
-
-2007-07-22  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * startup.el (command-line-x-option-alist): Use x-handle-no-bitmap-icon.
-
-       * term/x-win.el (x-handle-no-bitmap-icon): New function.
-
-2007-07-22  Ralf Angeli  <angeli@caeruleus.net>
-
-       * textmodes/reftex.el (reftex-access-parse-file): Create parse
-       file in a way that does not interfere with recentf.
-
-2007-07-21  Thien-Thi Nguyen  <ttn@gnuvola.org>
-
-       * image-dired.el (image-dired-sane-db-file): New func.
-       (image-dired-write-tags, image-dired-remove-tag)
-       (image-dired-list-tags, image-dired-write-comments)
-       (image-dired-get-comment, image-dired-mark-tagged-files)
-       (image-dired-create-gallery-lists): Call new func.
-       Reported by Dieter Wilhelm <dieter@duenenhof-wilhelm.de>.
-
-2007-07-21  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * vc-hg.el (vc-hg-diff): Use vc-hg-command.
-       (vc-hg-dir-state): Fix loop.
-       (vc-hg-print-log): Fix expected return value for vc-hg-command.
-       (vc-hg-next-version, vc-hg-delete-file, vc-hg-rename-file)
-       (vc-hg-register, vc-hg-create-repo, vc-hg-checkin)
-       (vc-hg-revert): Likewise.
-       (vc-hg-revision-table, vc-hg-revision-completion-table): New functions.
-
-2007-07-21  Thien-Thi Nguyen  <ttn@gnuvola.org>
-
-       * emacs-lisp/lisp-mode.el (calculate-lisp-indent): In the
-       case of alignment under a constant symbol, find and consider
-       the sexp actually at indentation to be the "last sexp".
-
-2007-07-20  Eli Zaretskii  <eliz@gnu.org>
-
-       * makefile.w32-in (install-lisp-SH, install-lisp-CMD): New targets.
-       (install): Use them to copy all *.el files before *.elc.
-       (clean): Don't delete *~.
-
-2007-07-20  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * vc-hg.el (vc-hg-workfile-unchanged-p): New function.
-
-2007-07-19  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * vc-hg.el (vc-hg-registered): Replace if with when.
-       (vc-hg-state): Deal with nonexistent files.
-
-2007-07-18  Juanma Barranquero  <lekktu@gmail.com>
-
-       * follow.el (follow-mode-hook, follow-mode-off-hook, follow-mode)
-       (follow-delete-other-windows-and-split, follow-recenter)
-       (follow-windows-aligned-p, follow-point-visible-all-windows-p)
-       (follow-redisplay, follow-estimate-first-window-start)
-       (follow-xemacs-scrollbar-support, follow-intercept-process-output):
-       Fix typos in docstrings.
-
-2007-07-17  Thien-Thi Nguyen  <ttn@gnuvola.org>
-
-       * bookmark.el (bookmark-show-all-annotations):
-       Make sure each inserted annotation ends with newline.
-
-       (bookmark-maybe-sort-alist): Don't modify
-       bookmark-alist.  Instead, if not sorting, simply return it.
-       (bookmark-bmenu-list): Call bookmark-maybe-sort-alist
-       for its return value, not for its side effect.
-
-2007-07-17  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * vc.el: Add more info about the vc-registered function.
-
-2007-07-16  David Kastrup  <dak@gnu.org>
-
-       * emacs-lisp/advice.el (defadvice): Doc fix.
-
-2007-07-16  Juanma Barranquero  <lekktu@gmail.com>
-
-       * subr.el (when, unless): Doc fix.
-
-2007-07-16  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * vc-hg.el (vc-hg-state): Handle removed files.
-       (vc-hg-dir-state, vc-hg-dired-state-info): New functions.
-       (vc-hg-checkout): Re-enable.
-
-2007-07-15  Richard Stallman  <rms@gnu.org>
-
-       * kmacro.el (kmacro-bind-to-key): Avoid comparisons on function keys.
-
-       * tutorial.el (tutorial--find-changed-keys):
-       Handle C-x specially like ESC.
-
-2007-07-15  Roland McGrath  <roland@frob.com>
-
-       * add-log.el (add-change-log-entry): Check add-log-full-name
-       and add-log-mailing-address later, after change-log-mode-hook.
-
-2007-07-15  Richard Stallman  <rms@gnu.org>
-
-       * isearch.el (isearch-mode, isearch-done):
-       Delete unintended code in previous change.
-
-       * ps-print.el (ps-default-bg): Change to White.
-
-2007-07-15  Aaron Hawley  <aaronh@garden.org>
-
-       * tar-mode.el (tar-get-descriptor): No error for zero-length file.
-
-2007-07-15  Martin Rudalics  <rudalics@gmx.at>
-
-       * mouse.el (mouse-drag-track): Reset transient-mark-mode to nil
-       when handling the terminating event.
-
-2007-07-15  Jeff Miller  <jmiller@cablespeed.com>  (tiny change)
-
-       * calendar/calendar.el (calendar-goto-bahai-date): Autoload it.
-
-2007-07-13  Eli Zaretskii  <eliz@gnu.org>
-
-       * makefile.w32-in (install-lisp-SH, install-lisp-CMD): New targets.
-       (install): Use them to copy all *.el files before *.elc.
-
-2007-07-13  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * replace.el (match): Use yellow1 instead of yellow.
-
-       * progmodes/gdb-ui.el (breakpoint-enabled): Use red1 instead of red.
-
-       * pcvs-info.el (cvs-unknown): Likewise.
-
-2007-07-12  Davis Herring  <herring@lanl.gov>
-
-       * desktop.el (desktop-buffer-info, desktop-save):
-       Use `desktop-dirname' instead of `dirname'.
-
-2007-07-10  Jim Meyering  <jim@meyering.net>  (tiny change)
-
-       * emacs-lisp/copyright.el (copyright-current-gpl-version): Set to 3.
-
-       * autoinsert.el (auto-insert-alist): s/2/3/ in the generated comment.
-
-2007-07-10  Richard Stallman  <rms@gnu.org>
-
-       * emacs-lisp/lisp-mode.el (eval-defun):
-       Explain special handling of `defface'.
-
-2007-07-09  Richard Stallman  <rms@gnu.org>
-
-       * isearch.el (isearch-edit-string): Call to isearch-push-state
-       after the search.
-
-2007-07-08  Katsumi Yamaoka  <yamaoka@jpl.org>
-
-       * cus-start.el (file-coding-system-alist): Fix custom type.
-
-2007-07-08  Chong Yidong  <cyd@stupidchicken.com>
-
-       * longlines.el (longlines-wrap-region): Avoid marking buffer as
-       modified.
-       (longlines-auto-wrap, longlines-window-change-function):
-       Remove unnecessary calls to set-buffer-modified-p.
-
-2007-06-20  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * vc.el (vc-default-log-view-mode): New function.
-       (vc-print-log): Add new `log-view-mode' VC operation.
-
-2007-07-08  Nick Roberts  <nickrob@snap.net.nz>
-
-       * pcvs-util.el (cvs-strings->string, cvs-string->strings):
-       Rename and move to...
-
-       * subr.el (strings->string, string->strings): ...here.
-
-       * pcvs.el (cvs-reread-cvsrc, cvs-header-msg, cvs-checkout)
-       (cvs-mode-checkout, cvs-execute-single-file): Use new function names.
-
-       * progmodes/gud.el (gud-common-init): Call string->strings instead
-       of split-string.
-
-2007-07-07  Eli Zaretskii  <eliz@gnu.org>
-
-       * term/w32-win.el (menu-bar-open): New function.
-       Bind <f10> to it.
-
-2007-07-07  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * log-view.el (log-view-mode-menu): New menu.
-
-2007-07-06  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * vc-hg.el: New file.
-
-2007-07-06  Andreas Schwab  <schwab@suse.de>
-
-       * emacs-lisp/lisp-mode.el (eval-last-sexp): Avoid introducing any
-       dynamic bindings around the evaluation of the expression.
-       Reported by Jay Belanger <jay.p.belanger@gmail.com>.
-
-2007-07-03  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * progmodes/gud.el (auto-mode-alist): Match more valid gdb init
-       file names.
-
-2007-07-02  Martin Rudalics  <rudalics@gmx.at>
-
-       * help-mode.el (help-make-xrefs): Skip spaces too when skipping tabs.
-
-       * mouse.el (mouse-drag-mode-line-1): Quit mouse tracking when
-       event is not a cons cell.  Do not unread drag-mouse-1 events.
-       Select right window in check whether space was stolen from
-       window above.
-
-2007-07-01  Richard Stallman  <rms@gnu.org>
-
-       * files.el (find-file-visit-truename): Fix safe-local-variable value.
-
-2007-06-29  Juanma Barranquero  <lekktu@gmail.com>
-
-       * generic-x.el (generic-define-mswindows-modes)
-       (generic-define-unix-modes, apache-log-generic-mode)
-       (bat-generic-mode-keymap, java-manifest-generic-mode)
-       (show-tabs-generic-mode): Fix typos in docstrings.
-
-2007-06-28  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * dnd.el (dnd-get-local-file-name): Set fixcase to t in call to
-       replace-regexp-in-string.
-
-2007-06-28  Andreas Schwab  <schwab@suse.de>
-
-       * Makefile.in ($(lisp)/mh-e/mh-loaddefs.el): Depend on
-       $(lisp)/subdirs.el.
-
-2007-06-28  Juanma Barranquero  <lekktu@gmail.com>
-
-       * speedbar.el (speedbar-handle-delete-frame): Don't try to delete
-       the speedbar frame if nil; that deletes the current frame or
-       causes an error if it is the only frame.
-       Reported by Angelo Graziosi <Angelo.Graziosi@roma1.infn.it>.
-
-2007-06-24  Juanma Barranquero  <lekktu@gmail.com>
-
-       * desktop.el (desktop-read): Run `desktop-not-loaded-hook' in the
-       directory where the desktop file was found, as the docstring says.
-       (desktop-kill): Use `read-directory-name'.
-
-       * desktop.el (desktop-load-locked-desktop): New option.
-       (desktop-read): Use it.
-       (desktop-truncate, desktop-outvar, desktop-restore-file-buffer):
-       Use `when'.
-
-2007-06-24  Davis Herring  <herring@lanl.gov>
-
-       * desktop.el (desktop-save-mode-off): New function.
-       (desktop-base-lock-name, desktop-not-loaded-hook): New variables.
-       (desktop-full-lock-name, desktop-file-modtime, desktop-owner)
-       (desktop-claim-lock, desktop-release-lock): New functions.
-       (desktop-kill): Tell `desktop-save' that this is the last save.
-       Release the lock afterwards.
-       (desktop-buffer-info): New function.
-       (desktop-save): Use it.  Run `desktop-save-hook' where the doc
-       says to.  Detect conflicts, and manage the lock.
-       (desktop-read): Detect conflicts.  Manage the lock.
-
-2007-06-23  Eli Zaretskii  <eliz@gnu.org>
-
-       * ls-lisp.el (insert-directory): If an invalid regexp error is
-       thrown, try using FILE as a literal file name, not a wildcard.
-       Check for FILE as an existing file, not just a directory.
-
-2007-06-23  Juanma Barranquero  <lekktu@gmail.com>
-
-       * ruler-mode.el (ruler-mode): Prevent clobbering the original
-       `header-line-format' when reentering ruler mode.
-
-2007-06-23  Eli Zaretskii  <eliz@gnu.org>
-
-       * ls-lisp.el (insert-directory): Don't treat FILE as a wildcard if
-       FILE exists as a directory.
-
-2007-06-21  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * vera-mode.el (vera-mode): Fix `commend-end-skip' setting.
-       (vera-font-lock-match-item): Fix doc string.
-       (vera-in-comment-p): Remove unused function.
-       (vera-skip-forward-literal, vera-skip-backward-literal): Improve code,
-       use `syntax-ppss'.
-       (vera-forward-syntactic-ws): Fix argument order.
-       (vera-prepare-search): Use `with-syntax-table'.
-       (vera-indent-line): Fix doc string.
-       (vera-electric-tab): Fix doc string.
-       (vera-expand-abbrev): Define alias instead of using `fset'.
-       (vera-comment-uncomment-region): Use `comment-start-skip'.
-
-2007-06-20  Reto Zimmermann  <reto@gnu.org>
-
-       * progmodes/vera-mode.el: New file.
-
-2007-06-20  Juanma Barranquero  <lekktu@gmail.com>
-
-       * ido.el (ido-find-file-in-dir): Don't signal an error for
-       empty directories.
-
-2007-06-18  Alan Mackenzie  <acm@muc.de>
-
-       * progmodes/cc-mode.el (c-remove-any-local-eval-or-mode-variables):
-       When removing lines, also remove the \n.  Correction of patch of
-       2007-04-21.
-
-2007-06-17  Glenn Morris  <rgm@gnu.org>
-
-       * lpr.el (lpr-page-header-switches): Move %s to separate element
-       for correct quoting.  Doc fix.
-
-2007-06-13  Johan Bockg\e,Ae\e(Brd  <bojohan@dd.chalmers.se>  (tiny change)
-
-       * term/xterm.el (terminal-init-xterm): Escape parens in character
-       constants.
-
-2007-06-12  Ralf Angeli  <angeli@caeruleus.net>
-
-       * scroll-lock.el (scroll-lock-mode): Doc fix.
-
-2007-06-11  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * font-lock.el (font-lock-add-keywords): In case font-lock was only
-       half-activated, forcefully activate it completely.
-
-2007-06-11  Richard Stallman  <rms@gnu.org>
-
-       * cus-edit.el (custom-variable-type): Doc fix.
-
-2007-06-09  Alfred M. Szmidt  <ams@gnu.org>  (tiny change)
-
-       * mail/rmail.el (rmail-movemail-variant-in-use): Fix doc typo.
-
-2007-06-09  Davis Herring  <herring@lanl.gov>
-
-       * desktop.el (desktop-minor-mode-table): Doc fix.
-
-2007-06-08  Chong Yidong  <cyd@stupidchicken.com>
-
-       * image-mode.el (image-forward-hscroll, image-backward-hscroll)
-       (image-next-line, image-previous-line, image-scroll-up)
-       (image-scroll-down, image-bol, image-eol, image-bob, image-eob):
-       New functions.
-       (image-mode-map): Remap motion commands.
-       (image-mode-text-map): New keymap for viewing images as text.
-       (image-mode): Use image-mode-map.
-       (image-toggle-display): Toggle auto-hscroll-mode and mode keymaps.
-
-2007-06-07  Michael Albinus  <michael.albinus@gmx.de>
-
-       Sync with Tramp 2.0.56.
-
-       * net/tramp.el:
-       * net/tramp-ftp.el:
-       * net/tramp-smb.el:
-       * net/tramp-util.el:
-       * net/tramp-vc.el:
-       Don't load cl.el, because that pollutes the namespace.  Replace cl
-       macros by their implementations where necessary.  Requested by
-       Richard Stallman <rms@gnu.org>.
-
-       * net/tramp.el (top): Make `set-buffer-multibyte' an alias if it
-       doesn't exist.
-       (with-parsed-tramp-file-name): Protect debug spec during compilation.
-       (tramp-handle-insert-directory): Check (featurep 'ls-lisp).
-       (tramp-file-name-p, tramp-file-name-multi-method)
-       (tramp-file-name-method, tramp-file-name-user)
-       (tramp-file-name-host, tramp-file-name-localname): New defuns,
-       replacing defstruct `tramp-file-name'.
-       (tramp-handle-file-remote-p, tramp-completion-dissect-file-name1)
-       (tramp-dissect-file-name, tramp-dissect-multi-file-name):
-       Apply `vector' instead of `make-tramp-file-name'.
-       (tramp-handle-make-auto-save-file-name):
-       Apply `tramp-temporary-file-directory' for compatibility reasons.
-       (tramp-completion-mode): Use `natnump' instead of `wholenump'
-       because of XEmacs.
-       (tramp-completion-mode): `last-input-event' is nil when XEmacs is
-       started.
-
-2007-06-07  David Kastrup  <dak@gnu.org>
-
-       * dired.el (dired-recursive-deletes, dired-recursive-copies):
-       Change default to `top'.
-
-2007-06-07  Chong Yidong  <cyd@stupidchicken.com>
-
-       * dired.el (dired-mode-map): Remove spurious separator.
-
-2007-06-07  Juanma Barranquero  <lekktu@gmail.com>
-
-       * progmodes/ebrowse.el (ebrowse-draw-file-member-info): Doc fix.
-
-       * progmodes/mixal-mode.el (mixal-operation-codes-alist):
-       * progmodes/idlwave.el (idlwave-one-key-select): Fix typo in docstring.
-
-2007-06-07  Alfred M. Szmidt  <ams@gnu.org>  (tiny change)
-
-       * mail/rmailsum.el (rmail-summary-save-buffer): New command.
-       (rmail-summary-mode-map): Add rmail-summary-save-buffer.
-
-2007-06-07  Juanma Barranquero  <lekktu@gmail.com>
-
-       * progmodes/ebrowse.el (ebrowse-member-table):
-       * textmodes/org.el (org-export-ascii-bullets): Fix typos in docstrings.
-
-2007-06-06  Juanma Barranquero  <lekktu@gmail.com>
-
-       * pgg.el (pgg-sign-region, pgg-sign):
-       * ses.el (ses-call-printer):
-       * calendar/icalendar.el (icalendar--diarytime-to-isotime):
-       * textmodes/org.el (org-cycle): Fix typos in docstrings.
-
-2007-06-06  Eli Zaretskii  <eliz@gnu.org>
-
-       * tar-mode.el (tar-header-block-summarize, tar-summarize-buffer)
-       (tar-get-descriptor): Handle type 55, an extended pax header.
-
-2007-06-06  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * textmodes/css-mode.el: New file.
-
-2007-06-06  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/socks.el: New file, taken from w3 repository.
-       (top): Update Copyright.  Don't load cl.el.
-       (all): Replace `case' by `cond', `string-to-int' by
-       `string-to-number', and `process-kill-without-query' by
-       `set-process-query-on-exit-flag'.
-       (socks-char-int): Remove defalias and all occurrences.
-
-2007-06-06  Juanma Barranquero  <lekktu@gmail.com>
-
-       * international/mule-cmds.el (toggle-enable-multibyte-characters)
-       (sort-coding-systems, search-unencodable-char): Doc fixes.
-       (coding-system-change-eol-conversion, set-default-coding-systems)
-       (prefer-coding-system, find-multibyte-characters, princ-list)
-       (leim-list-entry-regexp, set-input-method, locale-language-names)
-       (input-method-exit-on-first-char, exit-language-environment-hook)
-       (locale-charset-language-names): Fix typos in docstrings.
-
-2007-06-05  Juanma Barranquero  <lekktu@gmail.com>
-
-       * bs.el (bs-cycle-previous): Don't modify the cycle list until
-       `switch-to-buffer' has returned succesfully.
-       (bs-cycle-next): Ditto.  Also, don't bury the buffer when the
-       window is dedicated (it could iconify the frame).
-
-2007-06-05  Glenn Morris  <rgm@gnu.org>
-
-       * files.el (auto-mode-alist): Open `.asd' files in lisp-mode.
-
-2007-06-05  Chong Yidong  <cyd@stupidchicken.com>
-
-       * files.el (auto-mode-alist): Add lower-priority match for names
-       like ChangeLog.old.
-
-2007-06-04  Andreas Schwab  <schwab@suse.de>
-
-       * emacs-lisp/sregex.el (sregexq): Fix doc string quoting.
-
-2007-06-04  Davis Herring  <herring@lanl.gov>
-
-       * calendar/timeclock.el: Update version number.
-       (timeclock-modeline-display): Mention timeclock-use-display-time
-       in explanatory message.
-       (timeclock-log): Suppress warnings when finding the log.
-       Don't check for a nil project twice.  Run hooks after killing the
-       buffer (if applicable).
-       (timeclock-geometric-mean): Rename to `timeclock-mean' (it never
-       was geometric).  All uses changed.
-       (timeclock-generate-report): Support prefix argument.
-
-2007-06-04  Micha\e,Ak\e(Bl Cadilhac  <michael@cadilhac.name>
-
-       * man.el (Man-next-section): Don't consider the last line of the
-       page as being part of any section.
-
-2007-06-04  Martin Rudalics  <rudalics@gmx.at>
-
-       * hilit-chg.el (highlight-changes-rotate-faces): Don't set
-       modified flag of buffer.  Use `inhibit-modification-hooks'.
-
-2007-06-04  Katsumi Yamaoka  <yamaoka@jpl.org>
-
-       * mail/mail-extr.el (mail-extract-address-components):
-       Recognize non-ASCII characters except for NBSP as words.
-
-2007-06-04  Ryan Yeske  <rcyeske@gmail.com>
-
-       * net/webjump.el (webjump-sample-sites): Add Wikipedia query.
-
-2007-06-04  Michael Olson  <mwolson@gnu.org>
-
-       * emacs-lisp/tq.el (tq-queue-pop): Stifle error when a process has
-       died and we are trying to send a signal to it.
-
-2007-06-04  Juanma Barranquero  <lekktu@gmail.com>
-
-       * emacs-lisp/easy-mmode.el (define-minor-mode)
-       (easy-mmode-define-navigation): Fix typos in docstrings.
-
-       * progmodes/compile.el (compilation-find-file, compilation-handle-exit):
-       Fix typos in docstrings.
-       (compilation-search-path, compilation-buffer-name-function): Doc fixes.
-       (compilation-finish-function): Fix typo in obsolescence declaration.
-
-       * progmodes/idlwave.el (idlwave-routines): Fix typo in docstring.
-
-2007-06-04  Chong Yidong  <cyd@stupidchicken.com>
-
-       * files.el (magic-mode-alist): Remove image-type-auto-detected-p.
-       (magic-fallback-mode-alist): Add image-type-auto-detected-p.
-
-       * image.el (image-type-auto-detected-p): Don't scan auto-mode-alist.
-
-       * longlines.el (longlines-mode): Make longlines-auto-wrap
-       buffer-local.  Add hooks unconditionally.
-       (longlines-auto-wrap): Toggle wrapping.
-       (longlines-after-change-function)
-       (longlines-post-command-function): Check longlines-auto-wrap.
-
-2007-06-02  Chong Yidong  <cyd@stupidchicken.com>
-
-       * Version 22.1 released.
-
-2007-06-01  Chong Yidong  <cyd@stupidchicken.com>
-
-       * paren.el (show-paren-function): Undo 2007-04-19 and 2007-04-20
-       changes.
-
-2007-05-31  Richard Stallman  <rms@gnu.org>
-
-       * dired.el (dired-do-delete, dired-do-flagged-delete): Doc fixes.
-
-2007-05-29  Martin Rudalics  <rudalics@gmx.at>
-
-       * textmodes/table.el (table--point-entered-cell-function)
-       (table--point-left-cell-function):
-       Bind `inhibit-point-motion-hooks' to t.
-
-2007-05-29  Nikolaj Schumacher  <n_schumacher@web.de>  (tiny change)
-
-       * emacs-lisp/rx.el (rx): Doc fix.
-
-2007-05-28  Chong Yidong  <cyd@stupidchicken.com>
-
-       * textmodes/sgml-mode.el (sgml-point-entered): Use condition-case.
-
-2007-05-27  Tetsurou Okazaki  <okazaki@be.to>  (tiny change)
-
-       * log-edit.el (log-edit-changelog-paragraph): Return point-max
-       as the end of the ChangeLog paragraph when it ends without a line
-       termination.
-
-2007-05-25  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * textmodes/fill.el (canonically-space-region): Make the second arg
-       a marker if it's not already the case.
-
-       * xt-mouse.el (xterm-mouse-truncate-wrap): New function.
-       (xterm-mouse-event): Use it.
-
-2007-05-25  Miles Bader  <miles@fencepost.gnu.org>
-
-       * vc-hooks.el (vc-find-root): Fix file attribute test.
-
-2007-05-24  Richard Stallman  <rms@gnu.org>
-
-       * textmodes/flyspell.el (flyspell-correct-word-before-point):
-       Don't let opoint be nil.
-       (flyspell-emacs-popup): Explicit error if no dialogs.
-
-2007-05-23  Eli Zaretskii  <eliz@gnu.org>
-
-       * tar-mode.el (tar-file-name-handler): New function.
-       (tar-extract): Bind file-name-handler-alist to it to force
-       find-buffer-file-type-coding-system behave as if the file being
-       extracted existed.  Use last-coding-system-used to force
-       buffer-file-coding-system to what decode-coding-region actually
-       used to decode the file.
-
-2007-05-23  Nikolaj Schumacher  <n_schumacher@web.de>  (tiny change)
-
-       * progmodes/compile.el (compilation-handle-exit):
-       `compilation-finish-function' may change the current buffer.
-
-2007-05-22  Richard Stallman  <rms@gnu.org>
-
-       * files.el (set-auto-mode): Doc fix.
-
-2007-05-22  Eli Zaretskii  <eliz@gnu.org>
-
-       * dos-w32.el (find-buffer-file-type-coding-system): Doc fix.
-
-2007-05-21  Trent Buck  <trentbuck@gmail.com>  (tiny change)
-
-       * net/rcirc.el (rcirc-fill-column): Allow `window-width'.
-       (rcirc-print): Handle `window-width'.
-       (rcirc-buffer-maximum-lines): Doc fix.
-
-2007-05-19  Kevin Ryde  <user42@zip.com.au>
-
-       * info.el (Info-fontify-node): Match https also.
-
-2007-05-18  Richard Stallman  <rms@gnu.org>
-
-       * simple.el (push-mark): Doc fix.
-
-2007-05-18  Rob Riepel  <riepel@Stanford.EDU>
-
-       * emulation/tpu-edt.el (CSI-map, SS3-map): Move from global-map to
-       tpu-global-map.
-       (tpu-original-global-map): Delete variable.
-       (tpu-control-keys-map): New keymap variable.
-       (tpu-set-control-keys): Use tpu-reset-control-keys rather than
-       setting keymapping directly.
-       (tpu-reset-control-keys): Use tpu-control-keys-map instead of
-       tpu-global-map.
-       (tpu-edt-on): Activate the tpu-global-map.
-       (tpu-edt-off): Deactivate the tpu-global-map.
-
-2007-05-18  Ryan Yeske  <rcyeske@gmail.com>
-
-       * textmodes/ispell.el (ispell-get-word): Return markers
-       for start and end positions.
-       (ispell-word): Assume END is a marker.
-
-2007-05-17  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
-
-       * ps-print.el: Use default color when foreground or background color
-       are unspecified.  Reported by Leo <sdl.web@gmail.com>.
-       (ps-print-version): New version 6.7.4.
-       (ps-rgb-color): New argument.  Use default color when color is
-       unspecified.
-       (ps-begin-job): Fix code.
-
-2007-05-17  Martin Rudalics  <rudalics@gmx.at>
-
-       * textmodes/ispell.el (ispell-start-process): Defend against bad
-       default-directory.
-
-2007-05-17  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * vc-hooks.el (vc-find-root): Stop searching when the user changes.
-
-2007-05-16  Richard Stallman  <rms@gnu.org>
-
-       * buff-menu.el (Buffer-menu-sort-column): Doc fix.
-
-2007-05-16  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * files.el (magic-mode-alist, magic-fallback-mode-alist):
-       Move the *ml, Postscript, and XmCD entries to the fallback part.
-
-       * files.el (magic-fallback-mode-alist):
-       Rename from file-start-mode-alist.
-
-2007-05-16  Nikolaj Schumacher  <n_schumacher@web.de>  (tiny change)
-
-       * progmodes/compile.el (compilation-handle-exit): Quote first
-       argument of `run-hook-with-args'.
-
-2007-05-16  Juanma Barranquero  <lekktu@gmail.com>
-
-       * buff-menu.el (Buffer-menu-sort-column):
-       * dabbrev.el (dabbrev-upcase-means-case-search):
-       * dired.el (dired-recursive-deletes, dired-recursive-copies):
-       * info.el (Info-current-subfile):
-       * ls-lisp.el (ls-lisp-verbosity):
-       * msb.el (msb-menu-cond):
-       * pcvs.el (cvs-dired-use-hook):
-       * simple.el (set-mark-command-repeat-pop):
-       * time.el (display-time-24hr-format, display-time-mail-file):
-       Doc fixes.
-
-       * tutorial.el (get-lang-string, tutorial--find-changed-keys):
-       * printing.el (pr-ps-fast-fire): Fix typos in docstrings.
-
-       * view.el (view-inhibit-help-message): Fix typo in docstring.
-       (view-scroll-auto-exit, view-try-extend-at-buffer-end): Doc fixes.
-
-2007-05-14  Eli Zaretskii  <eliz@gnu.org>
-
-       * mail/rmail.el (rmail-convert-to-babyl-format):
-       Check content-transfer-encoding _last_, because we need its position
-       in base64-header-field-end.
-
-2007-05-14  Juanma Barranquero  <lekktu@gmail.com>
-
-       * files.el (mode-require-final-newline, require-final-newline)
-       (enable-local-variables, enable-local-eval): Doc fixes.
-
-2007-05-10  Edward O'Connor  <hober0@gmail.com>  (tiny change)
-
-       * progmodes/python.el (python-font-lock-keywords)
-       (python-open-block-statement-p, python-mode): Add support for the new
-       "with" keyword.
-
-2007-05-10  Richard Stallman  <rms@gnu.org>
-
-       * international/iso-cvt.el (iso-cvt-read-only): Ignore arguments.
-       (iso-cvt-write-only): Likewise.
-
-       * emacs-lisp/easy-mmode.el (define-minor-mode):
-       Fix generated doc string.
-
-       * startup.el (fancy-splash-text): Add URL of guided tour.
-       Adjust horizontal and vertical whitespace.
-
-       * progmodes/compile.el (compilation-handle-exit):
-       Use run-hook-with-args to run compilation-finish-functions.
-
-       * files.el (file-start-mode-alist): New variable.
-       (magic-mode-regexp-match-limit): Doc fix.
-       (set-auto-mode): Handle file-start-mode-alist.
-       A little cleanup of structure.
-
-2007-05-10  Davis Herring  <herring@lanl.gov>
-
-       * calendar/timeclock.el (timeclock-in): Fix non-interactive
-       workday specifications.
-       (timeclock-log): Don't kill the log buffer if it already existed.
-
-2007-05-08  Richard Stallman  <rms@gnu.org>
-
-       * mail/mailabbrev.el (sendmail-pre-abbrev-expand-hook):
-       Don't include non-self-insert commands in the exception for `-'.
-
-2007-05-08  David Reitter  <david.reitter@gmail.com>
-
-       * progmodes/python.el (python-guess-indent): Check non-nullness
-       before comparing indent against the 2..8 interval.
-
-2007-05-07  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el (mac-ts-unicode-for-key-event): Check if text is
-       available.
-
-2007-05-06  Richard Stallman  <rms@gnu.org>
-
-       * emacs-lisp/eldoc.el (turn-on-eldoc-mode): Doc fix.
-
-2007-05-03  Ryan Yeske  <rcyeske@gmail.com>
-
-       * net/rcirc.el (rcirc-timeout-seconds): Increase to prevent unwanted
-       disconnections.
-
-2007-05-01  Romain Francoise  <romain@orebokech.com>
-
-       * dired-x.el: Revert 2007-04-06 change.
-
-2007-04-30  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-menu-map): Pdb can't handle SIGINT so
-       don't put stop on toolbar.
-
-2007-04-29  Stephen Berman  <Stephen.Berman@gmx.net>
-
-       * find-dired.el (find-dired-filter): Propertize all text down to eob.
-
-2007-04-29  Richard Stallman  <rms@gnu.org>
-
-       * international/mule.el (auto-coding-alist): Add pdf => no-conversion.
-
-2007-04-28  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/cc-mode.el (c-before-change): Use point-min rather
-       than 1.
-
-2007-04-28  Richard Stallman  <rms@gnu.org>
-
-       * progmodes/sh-script.el (sh-mode): Recognize .profile as sh style.
-
-2007-04-28  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * vc-hooks.el (vc-ignore-dir-regexp): Add /.../ for the DFS filesystem.
-
-2007-04-28  Eli Zaretskii  <eliz@gnu.org>
-
-       * makefile.w32-in ($(lisp)/mh-e/mh-loaddefs.el): Use ./mh-e
-       instead of $(lisp)/mh-e.
-
-       * textmodes/fill.el (fill-paragraph): Doc fix.
-
-2007-04-28  Glenn Morris  <rgm@gnu.org>
-
-       * image-dired.el (image-dired-cmd-create-thumbnail-options)
-       (image-dired-cmd-create-temp-image-options): Replace option
-       +profile "*" with -strip.
-
-2007-04-27  Chong Yidong  <cyd@stupidchicken.com>
-
-       * textmodes/flyspell.el (flyspell-auto-correct-previous-word):
-       Use window-start and window-end.
-
-2007-04-26  Glenn Morris  <rgm@gnu.org>
-
-       * progmodes/python.el: Restore file pending consideration of legal
-       status.
-
-2007-04-26  Luc Teirlinck  <teirllm@dms.auburn.edu>
-
-       * locate.el (locate-in-alternate-database): Doc fix.
-
-2007-04-26  Glenn Morris  <rgm@gnu.org>
-
-       * button.el (button): Use underline if supported, else fall back
-       to color.
-
-2007-04-25  Richard Stallman  <rms@gnu.org>
-
-       * hi-lock.el (hi-lock-file-patterns-policy): Default to `ask'.
-
-2007-04-25  J.D. Smith  <jdsmith@as.arizona.edu>
-
-       * progmodes/idlwave.el (idlwave-beginning-of-subprogram)
-       (idlwave-end-of-subprogram): Take optional NOMARK arg to prevent
-       pushing mark.
-       (idlwave-current-routine): Don't push mark.
-
-2007-04-25  Mathias Dahl  <mathias.dahl@gmail.com>
-
-       * image-dired.el (image-dired-display-image): Derive image-type from
-       filename rather than assuming jpeg, in case no resizing was needed.
-
-2007-04-25  Johan Bockg\e,Ae\e(Brd  <bojohan@dd.chalmers.se>
-
-       * custom.el (defface): Doc fix.
-
-2007-04-24  Chong Yidong  <cyd@stupidchicken.com>
-
-       * progmodes/python.el: Remove due to unclear legal issues.
-
-2007-04-24  J.D. Smith  <jdsmith@as.arizona.edu>
-
-       * progmodes/idlw-shell.el (idlwave-shell-clear-all-bp):
-       Don't re-query for each cleared BP.
-       (idlwave-shell-clear-bp): Optionally skip BP query.
-       (idlwave-shell-update-bp-overlays): Use set-window-margins instead
-       of set-window-buffer, which incorrectly moves displayed region.
-
-2007-04-23  Jay Belanger  <jay.p.belanger@gmail.com>
-
-       * calc/calc.el (calc-bug-address): Update maintainer's address.
-       * calc/*: Update maintainer's address.
-
-2007-04-23  Richard Stallman  <rms@gnu.org>
-
-       * simple.el (set-mark-command-repeat-pop): Doc fix.
-       Put in `editing-basics' group.
-
-2007-04-23  Chong Yidong  <cyd@stupidchicken.com>
-
-       * info.el (Info-mouse-scroll-up, Info-mouse-scroll-down):
-       New functions.
-       (Info-mode-line-node-keymap): Bind mouse commands to
-       Info-mouse-scroll-up/down instead of Info-scroll-up/down.
-
-2007-04-23  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * locate.el (locate-local-prompt): New var.
-       (locate-prompt-for-command): Doc fix.
-       (locate-prompt-for-search-string): New function.
-       (locate): New optional arg.  Make locate-local-prompt
-       buffer-local.  Use locate-prompt-for-search-string.
-       (locate-with-filter): New optional arg.
-       Use locate-prompt-for-search-string.
-       (locate-update): Bind locate-prompt-for-command.
-
-2007-04-23  Glenn Morris  <rgm@gnu.org>
-
-       * files.el (magic-mode-alist): `<!DOCTYPE HTML' in html-mode.
-
-2007-04-23  Nick Roberts  <nickrob@snap.net.nz>
-
-       * button.el (button): Inherit from link face on a tty.
-
-2007-04-23  Glenn Morris  <rgm@gnu.org>
-
-       * button.el (button): Use color for this face on a tty.
-
-       * files.el (magic-mode-alist): Allow for carriage-returns in
-       html-mode and sgml-mode entries.
-
-2007-04-22  Richard Stallman  <rms@gnu.org>
-
-       * emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
-       Improve doc string of generated command.
-
-       * subr.el (read-number): Catch errors.
-
-       * hi-lock.el (hi-lock-file-patterns-policy): Doc fix.
-
-2007-04-22  Chong Yidong  <cyd@stupidchicken.com>
-
-       * image-dired.el: Rename from thumbnails.el.  All instances of
-       "thumbnails" replaced with "image-dired".
-
-       * dired.el (dired-mode-map): Rename "thumbnails" again, to
-       "image-dired".
-
-2007-04-22  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-kill-buffer-at-head, ido-delete-file-at-head):
-       Don't use kill-line.
-
-2007-04-22  Nick Roberts  <nickrob@snap.net.nz>
-
-       * t-mouse.el (t-mouse-make-event): Pass on mev's more informative
-       error message.
-
-2007-04-22  Chong Yidong  <cyd@stupidchicken.com>
-
-       * dired.el: Rename "tumme" to "thumbnails".
-
-       * thumbnails.el: Rename from tumme.el.  All instances of "tumme"
-       replaced with "thumbnails".
-
-2007-04-22  Glenn Morris  <rgm@gnu.org>
-
-       * hi-lock.el (hi-lock-file-patterns-policy): Make it a defcustom,
-       and give it the risky-local-variable property.
-
-       * textmodes/flyspell.el (flyspell-define-abbrev): Downcase abbrev
-       before defining it.
-
-2007-04-21  Martin Rudalics  <rudalics@gmx.at>
-
-       * progmodes/cc-mode.el (c-remove-any-local-eval-or-mode-variables):
-       Use delete-region instead of kill-line.
-
-2007-04-21  Alan Mackenzie  <acm@muc.de>
-
-       * progmodes/cc-cmds.el (c-electric-slash): Replace wrong use of
-       `kill-region' by `delete-region'.
-
-2007-04-21  Chong Yidong  <cyd@stupidchicken.com>
-
-       * progmodes/perl-mode.el (perl-indent-command): Use delete-region
-       instead of kill-region.
-
-       * progmodes/mantemp.el (mantemp-make-mantemps-region)
-       (mantemp-insert-cxx-syntax, mantemp-sort-and-unique-lines)
-       (mantemp-remove-memfuncs): Use delete-region instead of kill-word
-       and kill-line.
-
-       * progmodes/vhdl-mode.el (vhdl-template-type)
-       (vhdl-template-record, vhdl-template-nature)
-       (vhdl-template-configuration-spec, vhdl-template-component-inst)
-       (vhdl-template-break, vhdl-regress-line, vhdl-electric-tab):
-       Use delete-region instead of kill-word and kill-line.
-
-2007-04-21  Johan Bockg\e,Ae\e(Brd  <bojohan@dd.chalmers.se>
-
-       * dired-x.el (dired-virtual-mode): Doc fix.
-
-2007-04-21  Richard Stallman  <rms@gnu.org>
-
-       * font-lock.el (font-lock-keywords-alist): Mark as risky.
-
-       * subr.el (read-number): Doc fix.
-
-       * simple.el (pop-to-mark-command): Display message "mark popped"
-       if point does not move.
-       (set-mark-command): Doc fix.
-
-2007-04-21  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * locate.el: Revert 2006-09-09 and 2007-04-20 changes.
-       (locate-local-filter, locate-local-search): New vars.
-       (locate): Make variables local.
-       (locate-update): Bind locate-buffer-name.  Call locate using
-       locate-local-filter and locate-local-search.
-
-2007-04-20  David Koppelman  <koppel@ece.lsu.edu>
-
-       * hi-lock.el (hi-lock-file-patterns-policy): New var.
-       (hi-lock-find-patterns): Use hi-lock-file-patterns-policy.
-       (hi-lock-mode): Update docstring.
-
-2007-04-20  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * textmodes/fill.el (fill-move-to-break-point): Don't inhibit
-       fill-nobreak-predicate when the break is past fill-column.
-
-2007-04-20  Francesco Potort\e,Al\e(B  <pot@gnu.org>
-
-       * locate.el (locate): Output from shell-command should go in the
-       current buffer rather than *Shell Command Output*.
-
-2007-04-20  Chong Yidong  <cyd@stupidchicken.com>
-
-       * paren.el (show-paren-function): Fix last fix.
-
-2007-04-19  Kevin Ryde  <user42@zip.com.au>
-
-       * arc-mode.el (archive-find-type): lzh-exe for lzh self-extracting exe.
-       (archive-lzh-summarize): Add optional start arg for where to start
-       looking at the archive.
-       (archive-lzh-exe-summarize, archive-lzh-exe-extract): New functions.
-
-       * international/mule.el (auto-coding-alist): no-conversion for .exe
-       and .EXE.
-
-2007-04-19  Alan Mackenzie  <acm@muc.de>
-
-       * progmodes/cc-cmds.el (c-in-function-trailer-p): Fix this: when a
-       function return type contains "struct", "union", etc.
-       c-end-of-defun goes too far forward.
-
-2007-04-19  Chong Yidong  <cyd@stupidchicken.com>
-
-       * paren.el (show-paren-function): Reset window-start to avoid
-       recentering.
-
-2007-04-19  Glenn Morris  <rgm@gnu.org>
-
-       * calendar/todo-mode.el: Fix typo: "threshhold" -> "threshold".
-
-2007-04-18  Glenn Morris  <rgm@gnu.org>
-
-       * calendar/diary-lib.el (diary-header-line-format): Add a custom
-       :set function.
-       (diary-list-entries): Only switch to diary-mode from
-       default-major-mode (reverts 2007-03-21 change).  Otherwise, if in
-       diary-mode set header-line-format, in case of any customization.
-
-2007-04-18  Levin Du  <zslevin@gmail.com>  (tiny change)
-
-       * calendar/parse-time.el (parse-time-string-chars): Check if CHAR
-       is less than the length of parse-time-syntax.
-
-2007-04-17  David Kastrup  <dak@gnu.org>
-
-       * replace.el (query-replace-regexp-eval): Deprecate.
-
-2007-04-17  Alan Mackenzie  <acm@muc.de>
-
-       * progmodes/cc-cmds.el (c-beginning-of-defun): With -ve arg and
-       point too close to EOB, leave point at EOB rather than last `}'.
-
-2007-04-17  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
-
-       * textmodes/bibtex.el (bibtex-include-OPTkey)
-       (bibtex-user-optional-fields, bibtex-entry-field-alist):
-       Fix defcustom.
-
-2007-04-17  Glenn Morris  <rgm@gnu.org>
-
-       * calendar/cal-dst.el (calendar-dst-find-startend): If YEAR cannot
-       be encoded, fall back to current year.
-
-2007-04-14  Kevin Ryde  <user42@zip.com.au>
-
-       * arc-mode.el (archive-lzh-summarize): Only apply the "downcase if
-       all upcase" rule to OS-ID 0 "generic".  Always downcase for OS-ID
-       M "MSDOS".
-
-2007-04-16  Chong Yidong  <cyd@stupidchicken.com>
-
-       * progmodes/python.el (python-end-of-block): Avoid looping forever
-       if python-next-statement fails.
-
-2007-04-16  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
-
-       * textmodes/bibtex.el (bibtex-entry-field-alist): Use defcustom.
-
-2007-04-16  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * progmodes/perl-mode.el (perl-indent-level): Mark as safe local var.
-       * progmodes/cperl-mode.el (cperl-indent-level): Likewise.
-
-2007-04-15  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc.el (calc-version): New function.
-       (calc-trail-mode): Shorten the title.
-
-2007-04-15  Chong Yidong  <cyd@stupidchicken.com>
-
-       * mail/footnote.el (footnote-style): Clarify docstring to state
-       that customizing this only applies to future footnotes.
-
-2007-04-15  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
-
-       * textmodes/bibtex.el (bibtex-field-list): Use functionp.
-       (bibtex-make-field): Check that INIT is a string. Use functionp.
-
-2007-04-14  Glenn Morris  <rgm@gnu.org>
-
-       * complete.el (PC-goto-end): New buffer-local variable.
-       (PC-do-completion-end): Make buffer-local.
-       (partial-completion-mode) <choose-completion-string-functions>:
-       Do not go to the end of the minibuffer if PC-goto-end is non-nil.
-       (PC-do-completion): New optional fourth argument GOTO-END.  Add a
-       doc string.  Set PC-goto-end for choose-completion.
-       (PC-lisp-complete-symbol): Pass non-nil GOTO-END arg to
-       PC-do-completion.
-
-       * textmodes/bibtex.el (bibtex-insert-kill): Pass non-nil NODELIM
-       arg to bibtex-make-field.
-       (bibtex-make-field): Add optional fourth arg NODELIM.
-       Insert delimiters around INIT unless this arg is non-nil.
-
-2007-04-14  Nick Roberts  <nickrob@snap.net.nz>
-
-       * tmm.el (tmm-get-keybind): Use copy-sequence to ensure that the
-       global map isn't modified.
-
-2007-04-14  Glenn Morris  <rgm@gnu.org>
-
-       * calendar/appt.el (appt-disp-window): Do not split small windows.
-       Suggested by Jeff Miller <jmiller@cablespeed.com>.
-
-2007-04-13  Chong Yidong  <cyd@stupidchicken.com>
-
-       * progmodes/compile.el (compilation-start): Revert 2007-03-25 change.
-
-       * files.el: Ditto.
-
-2007-04-13  Juanma Barranquero  <lekktu@gmail.com>
-
-       * cus-edit.el (minibuffer, auto-save): Fix typos in docstrings.
-
-       * term.el (term-buffer-maximum-size, term-exec, term-escape-char)
-       (term-set-escape-char, term-termcap-format, term-get-old-input-default)
-       (term-skip-prompt, term-send-string, term-send-region, term-pager-page)
-       (term-pager-help): Fix typos in docstrings.
-
-       * wid-edit.el (widget-documentation): Fix typo in docstring.
-
-       * progmodes/ebnf2ps.el (ebnf-insert-style, ebnf-merge-style):
-       Fix typos in error messages.
-
-2007-04-13  Martin Rudalics  <rudalics@gmx.at>
-
-       * emacs-lisp/edebug.el (edebug-pop-to-buffer): Don't select
-       window marked as dedicated.
-
-       * mail/footnote.el (footnote-latin-string): New variable.
-       (footnote-latin-regexp): Redefine as regexp alternative.
-       (Footnote-latin): Use footnote-latin-string instead of
-       footnote-latin-regexp.
-
-2007-04-13  Glenn Morris  <rgm@gnu.org>
-
-       * tmm.el (tmm-get-keybind): Use car-safe to avoid errors with
-       inherited keymaps.
-
-2007-04-12  Chong Yidong  <cyd@stupidchicken.com>
-
-       * outline.el (outline-get-next-sibling): Clarify docstring.
-       (outline-get-last-sibling): Handle case where we are at the first
-       heading.  Clarify docstring.
-
-2007-04-12  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-minor-mode-map): Make go button same
-       length as stop button to lessen flicker.
-       (jdb): Add gud-print.
-       (gud-find-expr): Jdb prints the expression with the value, so
-       don't insert it in the output.
-
-2007-04-11  Jason Rumney  <jasonr@gnu.org>
-
-       * dnd.el (dnd-get-local-file-name): Decode both upper and lower
-       case hex.  Do not try to decode non-hex letters.
-
-2007-04-11  Markus Triska  <markus.triska@gmx.at>
-
-       * emacs-lisp/byte-opt.el (byte-optimize-backward-char)
-       (byte-optimize-backward-word): Remove (move to bytecomp.el).
-       (byte-optimize-form-code-walker): Evaluate pure function calls if
-       possible.
-       (byte-optimize-all-constp): New function.
-
-       * emacs-lisp/bytecomp.el (byte-compile-char-before):
-       Improve numeric argument case.
-       (byte-compile-backward-char, byte-compile-backward-word):
-       New functions, performing rewriting previously done in byte-opt.el.
-       Fix their "Fixme" item (restriction to numeric arguments).
-
-2007-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * desktop.el (desktop-save, desktop-create-buffer): Replace mapcar
-       with dolist.
-       (after-init-hook): Don't quote lambda.
-       (desktop-first-buffer): Don't wrap it in eval-when-compile.
-       (desktop-internal-v2s): Remove unused var `el'.
-       (desktop-buffer-major-mode, desktop-buffer-locals): Move out of
-       desktop-restore-file-buffer.
-       (desktop-buffer-ok-count, desktop-buffer-fail-count): Move out of
-       desktop-create-buffer.
-
-2007-04-10  Chong Yidong  <cyd@stupidchicken.com>
-
-       * woman.el (woman-decode-buffer): Postpone macro-set check...
-       (woman-decode-region): ...to here.
-
-2007-04-10  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * startup.el (tty-handle-args): Use %S to log ARGS.
-
-2007-04-10  Glenn Morris  <rgm@gnu.org>
-
-       * dframe.el (dframe-frame-mode): Do not set auto-show-mode, since
-       it is obsolete and has no effect.
-
-       * dos-w32.el (default-buffer-file-type): Add defvar to quieten
-       byte-compiler.
-
-       * progmodes/cperl-mode.el (cperl-mode): Remove unnecessary call to
-       obsolete function make-local-hook.
-
-       * progmodes/dcl-mode.el (top-level): Move (require 'tempo) to
-       start to quieten byte-compiler.
-
-2007-04-10  Markus Triska  <markus.triska@gmx.at>
-
-       * emacs-lisp/byte-opt.el (byte-optimize-char-before): Remove (move
-       to bytecomp.el as byte-compile-char-before).
-       * emacs-lisp/bytecomp.el (byte-compile-char-before):
-       New function (modified replacement for byte-optimize-char-before in
-       byte-opt.el).
-
-2007-04-09  Alan Mackenzie  <acm@muc.de>
-
-       * startup.el (inhibit-splash-screen): Emphatically state that it
-       can't be set in site-start.el.
-
-2007-04-09  Masatake YAMATO  <jet@gyve.org>
-
-       * progmodes/cc-subword.el (c-capitalize-subword): More closely
-       mimic the behavior of `capitalize-word'.  Do not move point with a
-       negative argument.  Based on tiny change by Paul Curry.
-
-2007-04-09  Paul Curry  <dashteacup@gmail.com>  (tiny change)
-
-       * progmodes/cc-subword.el (c-downcase-subword, c-upcase-subword):
-       Don't move point if ARG is negative.
-
-2007-04-09  Alan Mackenzie  <acm@muc.de>
-
-       Changes to make `narrow-to-defun' and `mark-defun' work properly
-       in CC Mode:
-
-       * progmodes/cc-defs.el (c-beginning-of-defun-1):
-       * progmodes/cc-cmds.el (c-beginning-of-defun, c-end-of-defun):
-       Bind beginning/end-of-defun-function to nil around calls to
-       beginning/end-of-defun.
-
-       * progmodes/cc-langs.el (beginning-of-defun-function)
-       (end-of-defun-function): New c-lang-setvar's.
-
-       * progmodes/cc-awk.el (c-awk-beginning-of-defun): Add "(or arg
-       (setq arg 1))" to enable non-interactive call.
-
-2007-04-09  Eli Zaretskii  <eliz@gnu.org>
-
-       * simple.el (set-mark-command): Doc fix.
-
-2007-04-09  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gdb): Restore existing session if user
-       tries to start a second one in graphical mode.
-
-2007-04-08  Martin Rudalics  <rudalics@gmx.at>
-
-       * cus-start.el <scroll-preserve-screen-position>: Add choices.
-
-2007-04-08  Johan Bockg\e,Ae\e(Brd  <bojohan@dd.chalmers.se>
-
-       * term/xterm.el (terminal-init-xterm): Fix key definitions.
-       Add binding for C-M-SPC.
-
-2007-04-08  Richard Stallman  <rms@gnu.org>
-
-       * pcomplete.el (pcomplete-read-event): One single definition,
-       and not a defsubst.
-
-2007-04-08  Chong Yidong  <cyd@stupidchicken.com>
-
-       * progmodes/cc-cmds.el (c-end-of-defun): Tidy up, to eliminate
-       byte-compiler warning "value unused".
-
-2007-04-08  Andreas Schwab  <schwab@suse.de>
-
-       * term/xterm.el (terminal-init-xterm): Add bindings for keypad keys.
-
-2007-04-07  Glenn Morris  <rgm@gnu.org>
-
-       * calendar/calendar.el (diary-font-lock-keywords, diary-live-p):
-       Autoload these functions.
-       (diary-date-forms): Add a custom :set form.
-
-       * calendar/diary-lib.el (diary-set-maybe-redraw): Move definition
-       before first use.
-       (diary-font-lock-keywords): New function with old code for
-       initialization of variable of same name.
-
-2007-04-07  David Hansen  <david.hansen@gmx.net>  (tiny change)
-
-       * progmodes/cc-cmds.el (c-electric-paren): Fix space-before-funcall
-       clean-up: only insert space when on identifier, etc.
-
-2007-04-07  Chong Yidong  <cyd@stupidchicken.com>
-
-       * progmodes/grep.el (grep-find-use-xargs): Rewrite docstring.
-
-       * net/tls.el (open-tls-stream): Properly handle case where there
-       is no associated buffer.
-
-2007-04-07  Glenn Morris  <rgm@gnu.org>
-
-       * ffap.el (ffap-file-at-point): Lower the priority of the
-       ffap-ftp-sans-slash-regexp check.
-
-2007-04-06  Alan Mackenzie  <acm@muc.de>
-
-       Fix fontification of labels, and other things with ":".
-
-       * progmodes/cc-engine.el (c-forward-label): The function now
-       returns 'goto-target, 'qt-2kwds-colon, 'qt-1kwd-colon, as well as
-       the former t.
-
-       * progmodes/cc-fonts.el (c-font-lock-declarations): Interpret the
-       new return code from c-forward-label, fontifying tokens properly.
-       Add some general comments throughout the file.
-
-2007-04-06  Chong Yidong  <cyd@stupidchicken.com>
-
-       * textmodes/flyspell.el (flyspell-duplicate, flyspell-incorrect):
-       Revert 2006-01-27 change.
-
-       * diff-mode.el (diff-mode): Revert 2007-03-04 change.
-
-       * menu-bar.el (menu-bar-tools-menu): Revert 2003-07-25 change.
-
-       * desktop.el (desktop-create-buffer, desktop-save):
-       Revert 2004-11-12 change for lack of copyright papers.
-
-       * dired-x.el (dired-guess-shell-case-fold-search): Delete var.
-       (dired-guess-default): Respect case.
-
-       * isearch.el (isearch-forward): Revert 1998-08-26 doc change.
-
-       * emacs-lisp/byte-opt.el (byte-optimize-pure-func): Remove function;
-       was originally checked in as byte-optimize-concat on 1997-11-02.
-
-       * mail/sendmail.el (mail-text, mail-mode): Revert extant pieces of
-       1995-05-19 doc changes.
-
-2007-04-06  Kim F. Storm  <storm@cua.dk>
-
-       * loadhist.el (read-feature): Reimplement.  New optional arg LOADED-P.
-       (unload-feature): Update interactive spec accordingly.
-
-       * progmodes/grep.el (grep-program): Remove commentary about zgrep.
-
-2007-04-06  John Paul Wallington  <jpw@pobox.com>
-
-       * subr.el (with-case-table): Use `make-symbol' to avoid variable
-       capture.  Restore the table in the same buffer.
-
-       * font-lock.el (lisp-font-lock-keywords-2): Add `with-case-table'.
-
-2007-04-05  Chong Yidong  <cyd@stupidchicken.com>
-
-       * emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
-       Print entire form.
-
-2007-04-05  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (breakpoint-disabled): Tweak face (again)
-       for low-color displays.
-
-2007-04-05  Glenn Morris  <rgm@gnu.org>
-
-       * play/5x5.el, play/animate.el, play/dissociate.el, play/doctor.el,
-       * play/gomoku.el, play/landmark.el, play/tetris.el, play/zone.el:
-       Seed random number generator on loading.
-
-       * emacs-lisp/authors.el (top-level): Provide self.
-
-       * play/animate.el (top-level): Provide self.
-
-2007-04-04  Alan Mackenzie  <acm@muc.de>
-
-       * progmodes/cc-vars.el (c-special-indent-hook): Amend doc-string
-       to mention c-syntactic-indentation.
-
-2007-04-04  Chong Yidong  <cyd@stupidchicken.com>
-
-       * subr.el (with-case-table): New macro.
-
-       * international/mule.el (ascii-case-table): New var.
-
-       * mail/smtpmail.el (smtpmail-via-smtp): Use ascii-case-table when
-       downcasing.
-
-2007-04-03  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-minor-mode-map): Simplify.
-
-       * t-mouse.el (t-mouse-make-event-element): Don't use the left edge
-       of the window if we're outside it e.g menu-bar.
-
-       * xt-mouse.el (xterm-mouse-event): Don't use the left edge of the
-       window if we're outside it e.g menu-bar.
-
-2007-04-03  Eli Zaretskii  <eliz@gnu.org>
-
-       * mail/rmail.el (rmail-convert-to-babyl-format): Don't try to
-       decode base-64 encoded body if its content-type is something other
-       than text/* or message/*.
-
-2007-04-03  Juanma Barranquero  <lekktu@gmail.com>
-
-       * simple.el (activate-mark-hook): Fix typo in docstring.
-
-2007-04-03  Nick Roberts  <nickrob@snap.net.nz>
-
-       * tmm.el (tmm-c-prompt): Initialize.
-       (tmm-menubar): Deal with extended menu-items at top level.
-       (tmm-get-keybind): Handle bindings redefined/undefined locally.
-       (tmm-prompt): Handle visibility of top level menu-items.
-
-       * progmodes/gud.el (gud-menu-map): Simplify.
-       (gud-minor-mode-map): Add tool-bar like bindings to the text mode
-       menubar.
-
-2007-04-02  Chong Yidong  <cyd@stupidchicken.com>
-
-       * mail/smtpmail.el (smtpmail-via-smtp): Revert last change.
-
-       * comint.el (comint-send-input): Widen the buffer first.
-
-       * info.el (Info-fontify-maximum-menu-size): Revert to 100000.
-
-2007-04-01  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * emacs-lisp/lisp-mode.el (lisp-fill-paragraph): Only obey
-       emacs-lisp-docstring-fill-column in emacs-lisp-mode.
-
-       * newcomment.el (comment-search-forward): Discard comment starters
-       before point.
-
-2007-04-01  Guanpeng Xu  <herberteuler@hotmail.com>
-
-       * mouse.el (mouse-set-secondary): Update mouse-secondary-overlay.
-
-2007-04-01  Chong Yidong  <cyd@stupidchicken.com>
-
-       * mail/smtpmail.el (smtpmail-via-smtp): Use standard case table
-       when downcasing.
-
-       * button.el (previous-button): Rewrite to account for adjacent buttons.
-
-2007-04-01  J.D. Smith  <jdsmith@as.arizona.edu>
-
-       * progmodes/idlwave.el (idlwave-auto-fill):
-       Revert paragraph-separate change.
-
-       * progmodes/idlw-shell.el (idlwave-shell-break-in):
-       Simplify module calc.
-       (idlwave-shell-set-bp-in-module): Compute module.
-
-2007-03-31  Glenn Morris  <rgm@gnu.org>
-
-       * emacs-lisp/timer.el (run-at-time): Doc fix.
-
-       * emacs-lisp/warnings.el (display-warning): If we create the
-       buffer displaying the warning, disable undo there.
-
-2007-03-31  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/tramp.el (tramp-register-file-name-handler)
-       (tramp-register-completion-file-name-handler): New defsubst,
-       derived from `tramp-register-file-name-handlers'.  The split is
-       necessary because Tramp's file name handlers must be registered at
-       different startup places.
-
-2007-03-31  Chong Yidong  <cyd@stupidchicken.com>
-
-       * progmodes/hideshow.el (turn-off-hideshow): New function.
-       (hs-minor-mode): Use it instead of a lambda expression in
-       change-major-mode-hook.
-
-2007-03-31  David Kastrup  <dak@gnu.org>
-
-       * woman.el (woman-Cyg-to-Win): Don't convert cons cells
-       corresponding to MANPATH_MAP entries.
-       (woman-man.conf-path, woman-parse-man.conf): Doc fix.
-       (woman-parse-man.conf): Use more discriminating man.conf name.
-       (woman-parse-man.conf): Parse MANPATH_MAP entries.
-       (woman-manpath): Doc fix and type fix.
-       (woman-cached-data): Check for MANPATH_MAP entries.
-       (woman-expand-directory-path): Treat MANPATH_MAP entries.
-
-2007-03-31  Stuart Herring  <herring@lanl.gov>
-
-       * emacs-lisp/sregex.el (sregexq): Doc fix.
-
-2007-03-31  Markus Triska  <markus.triska@gmx.at>
-
-       * flymake.el (flymake-err-line-patterns): Doc fix.
-
-2007-03-30  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * info.el (info-tool-bar-map): Use "exit" for Info-exit.
-       Move to the right.
-
-2007-03-30  Alan Mackenzie  <acm@muc.de>
-
-       * progmodes/cc-cmds.el (c-forward-to-nth-EOF-}): Fix EOB bug.
-
-2007-03-30  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * emacs-lisp/ewoc.el (ewoc--insert-new-node): Take additional arg DLL.
-       Use it, passed in explicitly, instead of from the dynamic binding.
-       (ewoc-create, ewoc-enter-before): Update to use new call sequence.
-
-2007-03-30  Juanma Barranquero  <lekktu@gmail.com>
-
-       * simple.el (blink-matching-open): When in minibuffer, don't
-       search for a match inside the prompt.
-
-2007-03-30  Nick Roberts  <nickrob@snap.net.nz>
-
-       * tmm.el (tmm-menubar): Select the right menu item with the mouse.
-       (tmm-prompt): Don't make the mouse user select the first menu
-       item twice.
-
-2007-03-30  Chong Yidong  <cyd@stupidchicken.com>
-
-       * eshell/esh-proc.el (eshell/kill): Tweak regexp to recognize
-       SIGUSR1 and SIGUSR2.
-
-2007-03-29  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-read-internal): When reading file or dir, only override
-       minibuffer-local-filename-completion-map, otherwise only override
-       minibuffer-local-completion-map.
-
-2007-03-29  Glenn Morris  <rgm@gnu.org>
-
-       * complete.el (partial-completion-mode): Set PC-do-completion-end
-       to nil after use.
-       (PC-lisp-complete-symbol): Create and use a marker at `end',
-       rather than using point-marker.
-
-2007-03-28  Chong Yidong  <cyd@stupidchicken.com>
-
-       * simple.el (next-error-highlight): Doc fix.
-       (compose-mail): Revert 2007-03-19 change.
-
-2007-03-28  Richard Stallman  <rms@gnu.org>
-
-       * emacs-lisp/edebug.el (edebug-display): Don't go to
-       edebug-outside-buffer if it is dead.
-
-2007-03-28  Juanma Barranquero  <lekktu@gmail.com>
-
-       * view.el (view-mode): Fix typos in docstring.
-
-2007-03-28  Stephen Berman  <Stephen.Berman@gmx.net>
-
-       * recentf.el (recentf-save-file): Add a custom :set function.
-
-2007-03-28  Glenn Morris  <rgm@gnu.org>
-
-       * complete.el (PC-do-completion-end): New variable.
-       (partial-completion-mode) <choose-completion-string-functions>:
-       Use PC-do-completion-end in the non-minibuffer case to replace the
-       correct amount of text.
-       (PC-do-completion): Set PC-do-completion-end for c-c-s-f.
-       (PC-lisp-complete-symbol): Give marker the after-insertion type,
-       to deal with improvements inserted after point.
-
-2007-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * button.el (make-text-button): Add explicit `button' property.
-       (default-button): Don't put a `button' property on it.
-
-       * progmodes/python.el (python-mode): Skip comments when parsing.
-
-       * vc-arch.el (vc-with-current-file-buffer): New macro.
-       (vc-arch-file-source-p): Use it to avoid infloop.
-
-2007-03-28  David Hansen  <david.hansen@gmx.net>  (tiny change)
-
-       * emacs-lisp/lisp.el (lisp-complete-symbol):
-       Fix call to get-buffer-window to find windows in other frames.
-
-2007-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * comint.el (comint-proc-query, comint-dynamic-list-completions):
-       Fix calls to get-buffer-window to find windows in other frames.
-       Reported by David Hansen <david.hansen@gmx.net>.
-
-2007-03-27   Kevin Ryde  <user42@zip.com.au>
-
-       * info.el (Info-display-images-node): On a text-only terminal,
-       show the "text" or "alt" parts of the image blobs.
-
-2007-03-27  Glenn Morris  <rgm@gnu.org>
-
-       * complete.el (PC-do-completion): Compute completion-base-size in
-       the non-filename case, rather than setting to nil.
-       (PC-lisp-complete-end): New variable.
-       (PC-lisp-complete-symbol): Use PC-lisp-complete-end to store the
-       original end in a series of consecutive invocations.
-
-       * calendar/calendar.el (calendar-mode-hook): Declare it.
-
-       * calendar/diary-lib.el (diary-live-p): Do not check for
-       diary-selective-display.
-
-2007-03-26  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * replace.el (occur-next-error): *Occur* might not be displayed in the
-       selected frame.  Reported by David Hansen <david.hansen@gmx.net>.
-
-2007-03-26  Richard Stallman  <rms@gnu.org>
-
-       * textmodes/flyspell.el (flyspell-large-region):
-       Use ispell-call-process-region.
-
-2007-03-26  Johan Bockg\e,Ae\e(Brd  <bojohan@dd.chalmers.se>
-
-       * emacs-lisp/bytecomp.el (byte-compile-file-form-defmumble):
-       Use prin1 instead of princ.
-
-2007-03-25  Chong Yidong  <cyd@stupidchicken.com>
-
-       * faces.el (face-set-after-frame-default): Revert 2007-03-10 change.
-       Merge in X resources before global face.
-
-       * progmodes/compile.el (compilation-start): Save compilation-directory
-       rather than default-directory as local var.
-       (compilation-directory): Mark as safe local var.
-
-       * files.el: Don't mark default-directory as a safe local var.
-
-2007-03-25  Alan Mackenzie  <acm@muc.de>
-
-       * progmodes/cc-mode.el (c-before-change): Fix BOB bug.
-       * progmodes/cc-engine.el: Fix typo.
-
-2007-03-25  Juri Linkov  <juri@jurta.org>
-
-       * compare-w.el (compare-windows): Rename customization group
-       `compare-w' to `compare-windows'.
-       (compare-windows-whitespace, compare-ignore-whitespace)
-       (compare-ignore-case, compare-windows-sync)
-       (compare-windows-sync-string-size, compare-windows-recenter)
-       (compare-windows-highlight, compare-windows): Change group name in
-       the `group' tag from `compare-w' to `compare-windows'.
-       (compare-windows-sync): Add option `nil' for no sync.  Doc fix.
-
-2007-03-24  Markus Triska  <markus.triska@gmx.at>
-
-       * expand.el: Change example to always enable abbrev-mode,
-       and remove redundant `function'.
-       (expand-abbrev-hook): Add autoload cookie.
-
-2007-03-24  Ryan Yeske  <rcyeske@gmail.com>
-
-       * emacs-lisp/testcover.el (testcover-start, testcover-end)
-       (testcover-mark-all, testcover-unmark-all): Add prompts to
-       interactive specs.
-
-2007-03-24  Jason Rumney  <jasonr@gnu.org>
-
-       * autorevert.el (find-file-hook, auto-revert-tail-mode):
-       Use file size in bytes for auto-revert-tail-pos not characters.
-
-2007-03-24  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * vc-rcs.el (vc-rcs-annotate-command):
-       Set text property :vc-annotate-prefix on the annotation text.
-       (vc-rcs-annotate-time): Instead of searching for ": ",
-       search for end of text propertized with :vc-annotate-prefix.
-
-2007-03-24  Martin Rudalics  <rudalics@gmx.at>
-
-       * whitespace.el (top level): Remove calls putting
-       permanent-local nil property since these are no-ops.
-
-       * man.el (Man-support-local-filenames): Assure that
-       default-directory exists when doing call-process.
-
-2007-03-23  David Vazquez  <xeos00@gmail.com>  (tiny change)
-
-       * progmodes/m4-mode.el (m4-m4-buffer, m4-m4-region):
-       Fix omission bug: Use m4-program-options to construct shell command.
-
-2007-03-23  David Kastrup  <dak@gnu.org>
-
-       * progmodes/cc-mode.el (c-make-emacs-variables-local):
-       Use `mapcar' rather than `mapcan' to silence compiler warning.
-
-2007-03-22  Ralf Angeli  <angeli@caeruleus.net>
-
-       * textmodes/reftex.el, textmodes/reftex-vars.el,
-       * textmodes/reftex-toc.el, textmodes/reftex-sel.el,
-       * textmodes/reftex-ref.el, textmodes/reftex-parse.el,
-       * textmodes/reftex-index.el, textmodes/reftex-global.el,
-       * textmodes/reftex-dcr.el, textmodes/reftex-cite.el,
-       * textmodes/reftex-auc.el: Add maintainer address.
-
-2007-03-22  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-agenda-mode, org-table-edit-formulas):
-       Make sure that `global-font-lock-mode' does not turn on font-lock
-       in these buffers.
-
-2007-03-21  Kim F. Storm  <storm@cua.dk>
-
-       * xt-mouse.el (xt-mouse-epoch): New variable.
-       (xterm-mouse-event): Use float-time.
-
-2007-03-21  Nick Roberts  <nickrob@snap.net.nz>
-
-       * xt-mouse.el (xterm-mouse-event): Compute a timestamp using
-       current-time.
-
-2007-03-21  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * complete.el (read-file-name-internal): Don't add the final > if the
-       completion is not finished (re-application of this patch, which was
-       accidentally undone by Eli).
-
-2007-03-21  Chong Yidong  <cyd@stupidchicken.com>
-
-       * emulation/viper.el (viper-non-hook-settings): Handle mouse
-       clicks in describe-key and describe-key-briefly advice a little better.
-
-2007-03-21  Juanma Barranquero  <lekktu@gmail.com>
-
-       * server.el (server-process-filter): Cancel any pending isearch.
-
-2007-03-21  Ulf Jasper  <ulf.jasper@web.de>
-
-       * calendar/icalendar.el (icalendar-version): Increase to 0.15.
-       (icalendar--get-unfolded-buffer): Define actual arguments rather
-       than just using &rest.  Check replace-in-string is fbound.
-       (icalendar-import-buffer): Doc fix.
-       (icalendar--convert-ical-to-diary): Set diary-file.
-       Check diary-file before inserting final newline.
-       (icalendar--add-diary-entry): Return diary-file.
-
-2007-03-21  Glenn Morris  <rgm@gnu.org>
-
-       * calendar/calendar.el (diary-set-maybe-redraw): Autoload it.
-       (diary-display-hook): Add custom :set function.
-
-       * calendar/diary-lib.el (diary-header-line-flag): Doc fix.
-       Add custom :set function.
-       (diary-header-line-format): Doc fix.
-       (diary-set-maybe-redraw): New function.
-       (number-of-diary-entries): Change :set to use diary-set-maybe-redraw.
-       (diary-list-entries): Always run diary-mode.
-
-2007-03-20  Kenichi Handa  <handa@m17n.org>
-
-       * international/quail.el (quail-setup-completion-buf): Make the
-       completion buffer read-only.
-       (quail-completion): Adjusted for the above change.  Leave the
-       modified flag nil.
-
-2007-03-20  David Kastrup  <dak@gnu.org>
-
-       * files.el (magic-mode-alist): Require literal "%!PS" string for
-       magic postscript file detection.
-
-2007-03-20  Richard Stallman  <rms@gnu.org>
-
-       * textmodes/ispell.el (ispell-call-process): New function.
-       Defends against bad `default-directory.'
-       (ispell-check-version, ispell-find-aspell-dictionaries)
-       (ispell-get-aspell-config-value, lookup-words): Call it.
-       (ispell-call-process-region): New function.
-       (ispell-send-string): Call it.
-
-2007-03-20  Andreas Schwab  <schwab@suse.de>
-
-       * Makefile.in (custom-deps): Depend on $(lisp)/subdirs.el.
-       (finder-data): Likewise.
-       (autoloads): Likewise.
-
-2007-03-20  Martin Rudalics  <rudalics@gmx.at>
-
-       * files.el (basic-save-buffer): Do not set visited filename when
-       the corresponding directory does not exist or the specified
-       filename is that of an existing directory.
-
-2007-03-20  Glenn Morris  <rgm@gnu.org>
-
-       * calendar/diary-lib.el (diary-live-p): New function.
-       (number-of-diary-entries): Add a :set function to redisplay diary
-       when necessary.
-
-2007-03-19  Nick Roberts  <nickrob@snap.net.nz>
-
-       * t-mouse.el (t-mouse-make-event-element): Use timestamp output
-       from client program, mev, to compute mouse event.
-
-2007-03-19  Chong Yidong  <cyd@stupidchicken.com>
-
-       * faces.el (momentary): Face removed; unused due to reversion of
-       2007-01-04 changes by Kevin Rodgers.
-
-       * mouse.el (mouse-drag-track): Remove spurious input-pending-p test.
-       Suggested by Johan Bockg\e,Ae\e(Brd.
-
-2007-03-19  Martin Rudalics  <rudalics@gmx.at>
-
-       * font-lock.el (lisp-font-lock-keywords-1):
-       Highlight define-globalized-minor-mode as a keyword.
-
-2007-03-19  Kim F. Storm  <storm@cua.dk>
-
-       * calc/calc-forms.el (math-std-daylight-savings)
-       (math-std-daylight-savings-old): Doc fix.
-
-2007-03-19  Juanma Barranquero  <lekktu@gmail.com>
-
-       * progmodes/python.el (python-default-template): Doc fix.
-       (python-buffer): Fix typo in docstring.
-
-       * isearchb.el (isearchb-follow-char):
-       * subr.el (def-edebug-spec): Fix typo in docstring.
-
-2007-03-19  Richard Stallman  <rms@gnu.org>
-
-       * files.el (default-directory): Mark safe.
-       (basic-save-buffer-2): Put proper dir name in error message.
-
-       * simple.el (compose-mail): Run switch-function after
-       setting up the mail buffer.
-
-       * startup.el (inhibit-splash-screen, initial-major-mode): Doc fixes.
-
-2007-03-18  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-forms.el (math-parse-date): Fix a regular expression.
-       (math-std-daylight-savings-new): Rename from
-       `math-std-daylight-savings'.
-       (math-std-daylight-savings-old): Rename from old value of
-       `math-std-daylight-savings'.
-       (math-std-daylight-savings): Use `math-std-daylight-savings-new' or
-       `math-std-daylight-savings-old' depending on the year.
-
-2007-03-18  Detlev Zundel  <dzu@gnu.org>
-
-       * emacs-lisp/re-builder.el (reb-update-overlays): Do not mark
-       zero-width regexps as invalid but rather at least count them correctly.
-
-2007-03-18  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * net/tls.el (open-tls-stream): In handshake-waiting loop,
-       don't wait more if there is output available to process.
-
-2007-03-18  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/compile.el (compilation-find-file): Revert change
-       from 2006-07-18 to allow completion of directory names.
-       Reported by John Carter <john.carter@tait.co.nz>.
-
-2007-03-18  Kim F. Storm  <storm@cua.dk>
-
-       * subr.el (when, unless): Doc fix.
-
-2007-03-17  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * net/tls.el (tls-program): Doc fix.
-
-2007-03-17  Denis Bueno  <dbueno@gmail.com>  (tiny change)
-
-       * autorevert.el (auto-revert-tail-handler):
-       Call after-revert-hook.
-
-2007-03-17  Ryan Yeske  <rcyeske@gmail.com>
-
-       * simple.el (switch-to-completions): No error if search for \n\n fails.
-
-2007-03-17  Chong Yidong  <cyd@stupidchicken.com>
-
-       * simple.el (line-move-1):
-       Respect `inhibit-line-move-field-capture' property.
-
-2007-03-13  Chong Yidong  <cyd@stupidchicken.com>
-
-       * comint.el (comint-arguments): Mark backslash-escaped chars.
-       (comint-delim-arg): Don't treat them as delimiters.
-
-2007-03-12  Kim F. Storm  <storm@cua.dk>
-       * ido.el (ido-init-completion-maps): Remap delete-backward-char.
-
-2007-03-12  Lawrence Mitchell  <wence@gmx.li>  (tiny change)
-
-       * tempo.el (tempo-insert): Deal with 'r> if it appears
-       specified with a prompt argument.
-
-2007-03-12  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-set-font-lock-defaults):
-       Handle narrow table columns correctly.
-
-2007-03-12  Mark A. Hershberger  <mah@everybody.org>
-
-       * xml.el (xml-parse-tag, xml-parse-string, xml-parse-attlist)
-       (xml-parse-dtd, xml-parse-elem-type, xml-substitute-special):
-       Return to use of the -no-properties variants.  There was
-       consensus on emacs-devel that the speed of these variants was
-       prefered since we are usually parsing files (from the internet
-       or on disk) instead of XML created in Emacs.
-
-       * eshell/esh-mode.el (eshell-handle-ansi-color): New function.
-       Add customize option.
-
-2007-03-12  Glenn Morris  <rgm@gnu.org>
-
-       * calc/calc-forms.el (math-std-daylight-savings): Switch to new
-       North American rule.  Replace "daylight savings" with "daylight
-       saving" in doc.
-
-       * calendar/cal-china.el, cal-dst.el, calendar.el, diary-lib.el:
-       * calendar/lunar.el, solar.el: Replace "daylight savings" with
-       "daylight saving" in text.
-
-       * woman.el (woman-change-fonts): Tweak previous change by using
-       woman-request-regexp rather than "^\\.".
-
-       * startup.el (command-line-1): Make insertion of
-       initial-scratch-message not depend on scratch being selected.
-
-2007-03-11  Juri Linkov  <juri@jurta.org>
-
-       * replace.el (match): Use yellow background on light-bg terminals.
-
-2007-03-11  Richard Stallman  <rms@gnu.org>
-
-       * emacs-lisp/bytecomp.el (byte-compile-warning-prefix):
-       Correctly compute line number.
-
-2007-03-11  Guanpeng Xu  <herberteuler@hotmail.com>
-
-       * type-break.el (type-break-get-previous-count):
-       Repeat previous change here.
-
-2007-03-11  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * progmodes/grep.el (grep-find-ignored-directories):
-       Add .git and .bzr to list.
-
-2007-03-11  Andreas Schwab  <schwab@suse.de>
-
-       * diff-mode.el (diff-apply-hunk): Use proper format string for error.
-
-2007-03-11  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * mail/emacsbug.el (report-emacs-bug): Don't hard code the "X" name.
-
-2007-03-10  Chong Yidong  <cyd@stupidchicken.com>
-
-       * faces.el (face-set-after-frame-default): Recalculate face
-       customizations after applying X resources.
-
-2007-03-10  Ryan Yeske  <rcyeske@gmail.com>
-
-       * net/rcirc.el (rcirc-timeout-seconds): New variable.
-       (rcirc-keepalive-seconds): Remove variable.
-       (rcirc-server-name, rcirc-timeout-timer, rcirc-connecting)
-       (rcirc-process, rcirc-user-disconnect): New variables.
-       (rcirc-connect): Initalize new variables.
-       (rcirc-keepalive): Don't send keepalive pings before connection
-       is completed.
-       (rcirc-sentinel): Do mark all channels with activity when
-       connection is dropped.  Run hook with process buffer local.
-       (rcirc-reschedule-timeout, rcirc-delete-process): New functions.
-       (rcirc-buffer-process): Return value of rcirc-process if
-       rcirc-server-buffer is nil.
-       (rcirc-server-name): Return the reported server name.
-       (rcirc-update-prompt): Simplify computation of the server name.
-       (rcirc-format-response-string): Likewise.
-       (rcirc-handler-001): Mark server as connected, record the reported
-       server name, and schedule a timeout.
-       (rcirc-track-nick): Add a spec for the tty class.
-       (rcirc-user-non-nick): Remove function.
-       (rcirc-nick-prefix-chars): Add variable.
-       (rcirc-user-nick): Use above variable.
-
-2007-03-10  Johan Bockg\e,Ae\e(Brd  <bojohan@dd.chalmers.se>
-
-       * icomplete.el (icomplete-tidy, icomplete-exhibit):
-       Bind deactivate-mark to nil.
-
-2007-03-10  Martin Rudalics  <rudalics@gmx.at>
-
-       * complete.el (PC-do-completion): Bind dirlength to nil to avoid
-       that buffer contents get erased during completion.
-
-2007-03-10  Glenn Morris  <rgm@gnu.org>
-
-       * woman.el (woman-change-fonts): Add a hack to deal with
-       font-escape followed by "." at start of a line.
-       (woman2-IP): Add a hack to deal with consecutive requests.
-       (woman2-tagged-paragraph): Extend existing hack to handle "sp".
-
-2007-03-10  Alan Mackenzie  <acm@muc.de>
-
-       * progmodes/cc-mode.el (c-before-change): Wrap in save-match-data.
-
-2007-03-09  Richard Stallman  <rms@gnu.org>
-
-       * abbrev.el (abbrev): Add `provide'.
-
-2007-03-09  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * net/ange-ftp.el (ange-ftp-try-passive-mode): Doc fix.
-
-2007-03-09  Martin Rudalics  <rudalics@gmx.at>
-
-       * complete.el (PC-try-completion): New function.
-       (PC-do-completion, read-file-name-internal): Use it instead of
-       try-completion.
-
-2007-03-08  Alan Mackenzie  <acm@muc.de>
-
-       Remove stale tokens from `c-found-types' cache.
-
-       * progmodes/cc-mode.el (c-unfind-enclosing-token)
-       (c-unfind-coalesced-tokens, c-before-change): New functions.
-       (c-maybe-stale-found-type): New variable.
-
-       * progmodes/cc-engine.el (c-partial-ws-p, c-unfind-type)
-       (c-trim-found-types): New functions.
-
-2007-03-08  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * smerge-mode.el (smerge-remove-props): Don't mark the buffer modified.
-       (debug-ignored-errors): Add entry from smerge-match-conflict.
-
-2007-03-08  J.D. Smith  <jdsmith@as.arizona.edu>
-
-       * progmodes/idlw-help.el (idlwave-do-context-help1): Don't visit
-       special help topics for keywords.
-       (idlwave-help-assistant-command): Include ".exe" for ms-dos
-       etc. Assistant command.
-
-2007-03-08  Chong Yidong  <cyd@stupidchicken.com>
-
-       * replace.el (occur-engine): Move buffer-undo-list binding...
-       (occur-1): ...to here.
-
-       * complete.el (PC-bindings): Rebind M-TAB in read-expression-map.
-
-       * simple.el (minibuffer-completing-symbol): New var.
-       (eval-expression): Use it.
-       (completion-setup-function): Don't bind completion-base-size when
-       completing a symbol in the minibuffer.
-
-2007-03-08  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gdb): Pop up current GUD buffer if user
-       tries to start a second session in graphical mode.
-
-2007-03-07  Miles Bader  <miles@gnu.org>
-
-       * international/isearch-x.el
-       (isearch-process-search-multibyte-characters):
-       Strip text-properties from PROMPT to avoid an error from read-string.
-
-2007-03-07  Kim F. Storm  <storm@cua.dk>
-
-       * complete.el (PC-bindings): Remap lisp-complete-symbol to
-       PC-lisp-complete-symbol instead of binding M-TAB in global-map.
-
-2007-03-07  Micha\e,Ak\e(Bl Cadilhac  <michael@cadilhac.name>
-
-       * complete.el (PC-do-completion): Delete duplicates in the list of
-       possible completions.
-
-2007-03-07  Glenn Morris  <rgm@gnu.org>
-
-       * ses.el (ses-mode): Doc fix.
-
-2007-03-06  Kim F. Storm  <storm@cua.dk>
-
-       * isearch.el (isearch-message-prefix): Undo 2007-03-01 change.
-
-2007-03-06  Kenichi Handa  <handa@m17n.org>
-
-       * term/x-win.el (x-select-utf8-or-ctext): Improve the strategy.
-
-2007-03-06  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * simple.el (completion-setup-function): Improve last fix so it doesn't
-       set it to a relative directory name either.
-
-2007-03-05  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
-
-       * ps-print.el: Replace some (defvar VAR) by (defvar VAR nil).
-
-2007-03-05  Richard Stallman  <rms@gnu.org>
-
-       * emacs-lisp/re-builder.el (reb-re-syntax): Fix custom type.
-
-       * files.el (find-file-noselect): No error if file no longer exists.
-       Display a message and avoid other questions.
-
-2007-03-05  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * pcomplete.el (pcomplete-show-completions): Improve last change, so
-       as not to use an invisible window and to create a window if none exist.
-
-       * progmodes/python.el (python-send-command): Restart proc if necessary.
-       (python-proc): Simplify.
-
-2007-03-05  David Hansen  <david.hansen@gmx.net>  (tiny change)
-
-       * pcomplete.el (pcomplete-show-completions): Search all frames for
-       completions buffer.
-
-2007-03-05  Chong Yidong  <cyd@stupidchicken.com>
-
-       * cus-edit.el (customize-save-variable): Clear customized-value
-       property (saved values are now put in theme-value property).
-       (customize-set-variable): Doc fix.
-
-       * complete.el (PC-do-completion): If completion-ignore-case is
-       non-nil, replace field with completion string before exiting.
-
-2007-03-05  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/tramp.el (tramp-make-temp-file): New parameter FILENAME.
-       Append its extension to the resulting temporary file name.
-       (tramp-handle-file-local-copy, tramp-handle-write-region): Apply it.
-
-       * net/tramp-smb.el (tramp-smb-handle-file-local-copy)
-       (tramp-smb-handle-write-region): Apply it.
-
-2007-03-05  Alin C. Soare  <alinsoar@voila.fr>  (tiny change)
-
-       * emacs-lisp/lisp-mode.el (calculate-lisp-indent):
-       Redo previous change.
-
-2007-03-04  Kevin Rodgers  <kevin.d.rodgers@gmail.com>  (tiny change)
-
-       * diff-mode.el (diff-mode): Doc fix.
-
-2007-03-05  Kenichi Handa  <handa@m17n.org>
-
-       * international/characters.el: Set category `l' (latin)
-       for more characters.
-
-2007-03-04  Kim F. Storm  <storm@cua.dk>
-
-       * emacs-lisp/authors.el (authors-aliases): Add alias.
-
-2007-03-04  Glenn Morris  <rgm@gnu.org>
-
-       * progmodes/hideshow.el (hs-minor-mode): Turn mode off and show
-       all when switching major mode.
-       (hs-minor-mode, hs-c-start-regexp, hs-block-start-regexp)
-       (hs-block-start-mdata-select, hs-block-end-regexp)
-       (hs-forward-sexp-func, hs-adjust-block-beginning):
-       Do not make these variables permanent-local.
-
-2007-03-04  Richard Stallman  <rms@gnu.org>
-
-       * progmodes/cperl-mode.el (cperl-mode):
-       Modify cperl-compilation-error-regexp-alist by appending.
-
-       * emacs-lisp/edebug.el (edebug-kill-buffer): New function.
-       (edebug-mode): Add the hook.
-       (edebug-recursive-edit): Remove the hook on exiting.
-
-       * type-break.el (type-break-get-previous-time):
-       Handle end-of-file errors specially
-       so they don't get reported wrong in .emacs.
-
-       * startup.el (fancy-splash-text): Clarify text.
-
-       * simple.el (beginning-of-buffer, end-of-buffer):
-       Avoid treating plain C-u like numeric arg.
-
-       * simple.el (completion-setup-function): Don't set
-       default-directory to nil.
-
-       * shell.el (shell-dirstack-query): Doc fix.
-
-       * mouse.el (mouse-drag-mode-line-1, mouse-drag-vertical-line):
-       Don't select the window -- pass it to primitives instead.
-
-       * faces.el (minibuffer-prompt): Use medium blue by default.
-
-2007-03-04  David Kastrup  <dak@gnu.org>
-
-       * jit-lock.el (jit-lock-stealth-time): Change default to nil.
-       Preserve 16 as default value for "seconds" when customizing.
-
-2007-03-04  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-self-insert-command)
-       (orgtbl-self-insert-command, org-delete-char)
-       (org-delete-backward-char): Set the `flyspell-delayed' property.
-
-2007-03-03  Chong Yidong  <cyd@stupidchicken.com>
-
-       * international/mule.el (find-auto-coding): Don't search for
-       line-ending characters past the end of the tail.
-
-2007-03-03  Christopher Allan Webber  <cwebber@dustycloud.org>  (tiny change)
-
-       * play/gamegrid.el (gamegrid-add-score-with-update-game-score-1):
-       Jump to the line where new score has been uploaded.
-
-       * play/tetris.el (tetris-move-bottom, tetris-move-left)
-       (tetris-move-right, tetris-rotate-prev, tetris-rotate-next):
-       Do nothing when the game is paused.
-
-2007-03-03  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-set-tags): Prevent slipping of point
-       during completion.
-
-2007-03-01  Lennart Borgman  <lennart.borgman.073@student.lu.se>
-
-       * isearch.el (isearch-message-prefix):
-       Use minibuffer-prompt-properties.
-
-2007-03-01  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
-
-       * ps-print.el: Replace (defvar VAR nil) by (defvar VAR).
-       (ps-setup): Print which Emacsen is running ps-print package.
-
-2007-03-01  Stuart Herring  <herring@lanl.gov>
-
-       * files.el (set-auto-mode-0): Use `indirect-function'.
-       (hack-one-local-variable): Don't reapply current major mode.
-
-2007-03-01  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/python.el (python-quote-syntax): Don't bother with
-       syntax-ppss-context.
-       (python-fill-paragraph): Make sure that fenced-string delimiters that
-       stand on their own line stay there.
-
-2007-03-01  Lennart Borgman  <lennart.borgman.073@student.lu.se>
-
-       * replace.el (perform-replace): Propertize message.
-
-2007-03-01  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-prepare-agenda-buffers): Also check for
-       invisible heading.
-
-2007-02-28  Chong Yidong  <cyd@stupidchicken.com>
-
-       * net/tramp.el (tramp-file-name-handler): Revert last change.
-
-2007-02-28  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-mouse-until, gdb-mouse-jump):
-       Correct doc strings.
-
-2007-02-28  Chong Yidong  <cyd@stupidchicken.com>
-
-       * replace.el (perform-replace): Undo forward-char immediately if
-       non-adjacent search fails.
-
-2007-02-28  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * version.el (emacs-major-version, emacs-minor-version):
-       string-to-int -> string-to-number.
-
-2007-02-28  Juanma Barranquero  <lekktu@gmail.com>
-
-       * help.el (where-is): Fail gracefully when not passed a command.
-
-2007-02-28  Stuart Herring  <herring@lanl.gov>
-
-       * find-lisp.el (find-lisp-default-directory-predicate):
-       Fix bug: Do symlink check on expanded filename.
-
-2007-02-28  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-set-tags, org-table-get-field): Avoid case
-       changes during replacement.
-       (org-agenda-mode-map): Add default binding for `org-agenda-archive'.
-
-2007-02-28  Lars Hansen  <larsh@soem.dk>
-
-       * desktop.el: Delete header line listing me as maintainer.
-
-2007-02-28  Glenn Morris  <rgm@gnu.org>
-
-       * tutorial.el (tutorial--describe-nonstandard-key): Tweak text in
-       the menus case.
-
-2007-02-28  Chong Yidong  <cyd@stupidchicken.com>
-
-       * net/tramp.el (tramp-file-name-handler): Inhibit modification
-       hooks to avoid confusion when combining after-change calls.
-
-2007-02-27  Ken Manheimer  <ken.manheimer@gmail.com>
-
-       * allout.el (allout-encrypt-string): Remove inhibition of gpg-agent,
-       now that pgg-gpg-process-region correctly honors passed-in passphrase.
-       (allout-distinctive-bullets-string): Add info about bullet conventions.
-       (allout-mode): Add info about distinctive vs plain bullets.
-
-2007-02-27  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-archive-subtree): Quote variable name.
-       (org-agenda-get-todos): Make sure skip properties are checked correctly.
-
-2007-02-26  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-bashdb-history, gud-bashdb-marker-filter)
-       (gud-bashdb-command-name, bashdb): Remove.
-       (gud, gud-menu-map): Remove references to bash/bashdb.
-
-2007-02-26  Andrey Zhdanov  <susuman@hotmail.com>  (tiny change)
-
-       * progmodes/gud.el (gud-pdb-marker-regexp): Add optional <module>
-       keyword for Python 2.5.
-
-2007-02-26  Romain Francoise  <romain@orebokech.com>
-
-       * net/net-utils.el (whois-server-tld): Update server for .org.
-       (whois-server-list): Add whois.publicinterestregistry.net.
-       (whois-guess-server): Fix formatting in docstring.
-
-2007-02-26  Kim F. Storm  <storm@cua.dk>
-
-       * mouse.el (mouse-show-mark): Run hooks and perform command
-       remapping for mouse-region-delete-keys.
-
-2007-02-26  Johan Bockg\e,Ae\e(Brd  <bojohan@dd.chalmers.se>
-
-       * font-core.el (font-lock-mode): Doc fix.
-
-2007-02-25  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-buffer-internal): Set this-command to fallback command.
-       Add selected buffer to buffer-name-history.
-       (ido-file-internal): Set this-command to fallback command.
-       Add file names to file-name-history.
-
-       * emacs-lisp/map-ynp.el (map-y-or-n-p):
-       Apply minibuffer-prompt-properties.
-
-2007-02-25  Andreas Schwab  <schwab@suse.de>
-
-       * files.el (hack-one-local-variable-eval-safep): Correct handling
-       of edebug-form-spec property value.  Reported by Johan Bockg\e,Ae\e(Brd.
-
-2007-02-25  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-table-overlay-coordinates)
-       (org-table-toggle-coordinate-overlays): New functions.
-       (org-table-overlay-coordinates, org-table-coordinate-overlays):
-       New variables.
-       (org-startup-with-deadline-check): Remove option.
-       (org-mode): Remove deadline check on startup.
-       (org-table-limit-column-width): Remove option.
-       (org-table-formula-numbers-only): Remove option.
-       (org-link-style, org-link-format): Remove options.
-       (org-select-agenda-window, org-fit-agenda-window): Remove options.
-       (org-export-ascii-show-new-buffer)
-       (org-export-html-show-new-buffer): Remove options.
-       (org-activate-links): Remove camel option.
-       (org-file-link-context-use-camel-case): Remove option.
-       (org-camel-regexp): Remove variable.
-       (org-activate-camels): Remove function.
-       (org-store-link): Remove Camel stuff.
-       (org-make-org-heading-camel): Remove function.
-       (org-open-at-point): Remove camel stuff.
-       (org-link-search): Remove camel stuff.
-       (org-camel-to-words): Function removed.
-       (org-get-agenda-file-buffer): Make sure we prepare the base
-       buffers, not any indirect buffers.
-       (org-sort-entries): Sort top-level when not on a headline, and no
-       active region.
-       (org-in-regexp): New function.
-       (org-search-not-self): Rename from `org-search-not-link'.
-       (org-open-link-marker): New variable.
-       (org-open-at-point): Set `org-open-link-marker'.
-       (org-print-icalendar-entries): Fixe bug with excluding DONE
-       entries from the exported list.
-       (org-edit-formula-lisp-indent): New command.
-       (orgtbl-to-texinfo, orgtbl-to-html): New functions.
-       (orgtbl-to-latex, orgtbl-insert-radio-table)
-       (orgtbl-toggle-comment, orgtbl-send-table): New functions.
-       (orgtbl-radio-table-templates): New option.
-       (org-store-link-props):
-       (org-remember-templates): More possibilities to insert info
-       into templates.
-       (org-remember-apply-template): Make use of the extended
-       template capabilities.
-       (org-remember-redo-template): New command.
-       (org-upgrade-old-links)
-       (org-table-modify-formulas, org-table-replace-in-formulas)
-       (org-table-find-dataline)
-       (org-table-get-vertical-vector): Remove functions.
-       (org-table-remove-rectangle-highlight)
-       (org-time-stamp-format, org-toggle-log-option)
-       (org-table-highlight-rectangle)
-       (org-table-iterate, org-table-make-reference):
-       (org-translate-time, org-tree-to-indirect-buffer)
-       (org-table-field-info, org-table-fix-formulas)
-       (org-table-force-dataline, org-table-get-descriptor-line)
-       (org-table-get-range)
-       (org-skip-comments, org-sort)
-       (org-sort-entries, org-sublist, org-table-add-rectangle-overlay)
-       (org-table-current-dline, org-table-current-field-formula)
-       (org-table-edit-backward-field)
-       (org-table-edit-formulas-post-command)
-       (org-table-edit-line-down, org-table-edit-line-up)
-       (org-agenda-archive)
-       (org-agenda-clock-cancel)
-       (org-agenda-clock-out, org-agenda-list-stuck-projects)
-       (org-agenda-open-link, org-agenda-show-new-time)
-       (org-agenda-skip-subtree-when-regexp-matches)
-       (org-agenda-tree-to-indirect-buffer, org-agenda-undo)
-       (org-at-regexp-p, org-auto-repeat-maybe, org-check-log-option)
-       (org-do-sort, org-file-image-p, org-find-overlays)
-       (org-find-row-type, org-get-indirect-buffer, org-get-repeat)
-       (org-highlight-until-next-command, org-isearch-end)
-       (org-match-any-p, org-next-link, org-previous-link):
-       (org-remove-subtree-entries-from-agenda, org-replace-escapes)
-       (org-rewrite-old-row-references)
-       (org-isearch-post-command)
-       (org-table-edit-move, org-table-edit-next-field)
-       (org-table-edit-scroll, org-table-edit-scroll-down)
-       (org-set-frame-title, org-show-reference)
-       (org-unhighlight-once, org-verify-change-for-undo): New functions.
-       (org-show-variable): Remove command.
-       (org-add-log-maybe): New arguments STATE, FINDPOS
-       (org-table-sort-lines): Rewrite from scratch.
-       (org-link-search): New argument AVOID-POS.
-       (org-print-icalendar-entries): Remove argument CATEGORY.
-       (org-run-agenda-series): Remove argument WONDOW.
-       (org-next-link, org-previous-link): New commands.
-       (org-agenda-date-format): New option.
-       (org-table-iterate): New command.
-       (org-table-modify-formulas)
-       (org-table-replace-in-formulas): Remove functions.
-       (org-table-fix-formulas): New function.
-       (org-table-insert-column, org-table-delete-column)
-       (org-table-move-column): Use `org-table-fix-formulas'.
-       (org-follow-gnus-link): Patch from Bastien/Leo.
-       (org-table-current-field-formula): New function.
-       (org-file-image-p): New function.
-       (org-agenda-show-new-time): New function.
-       (org-agenda-date-later): Call `org-agenda-show-new-time'.
-       (org-with-remote-undo): New macro.
-       (org-agenda-undo): New command.
-       (org-verify-change-for-undo): New function.
-       (org-time-stamp-format): New function.
-       (org-agenda-get-timestamps): Skip scheduled if DONE and requested
-       by user.
-       (org-match-any-p): New function.
-       (org-make-tags-matcher): Handle regular expressions for tag and
-       todo matches.
-       (org-read-date): Accept "+N" as input for a date relative to the
-       current date.
-       (org-remove-subtree-entries-from-agenda): New function.
-       (org-agenda-archive, org-agenda-kill):
-       Use `org-remove-subtree-entries-from-agenda'.
-       (org-do-sort, org-sort-entries): New functions.
-       (org-sort): New command.
-       (org-table-sort-lines): Use `org-do-sort'.
-       (org-fix-decoded-time): New function.
-       (org-table-number-regexp): Require 0x... to identify as number
-       in tables.
-       (org-startup-options): New keywords for note taking.
-       (org-upgrade-old-links): Remove function.
-       (org-get-repeat): New function.
-       (org-show-context): Also show siblings on current level.
-       (org-show-siblings): New function.
-       (org-isearch-end, org-isearch-post-command): New functions.
-       (org-show-siblings): New option.
-       (org-show-context): Use `org-show-siblings'.
-       (org-table-maybe-recalculate-line): No longer require `calc-eval'
-       to be bound, because user may just use elisp.
-
-2007-02-24  Kim F. Storm  <storm@cua.dk>
-
-       * emulation/cua-base.el (cua-paste): Handle x-clipboard-yank.
-       (cua--init-keymaps): Remap x-clipboard-yank to cua-paste.
-
-2007-02-24  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * startup.el (command-line): Also check if the abbrev file is readable.
-
-2007-02-24  John Paul Wallington  <jpw@pobox.com>
-
-       * net/tls.el (tls-certtool-program): Fix custom type.
-
-       * mail/feedmail.el (feedmail-message-id-generator)
-       (feedmail-date-generator): Fix custom types.
-
-       * mail/rmail.el (rmail-message-filter): Fix custom type.
-
-2007-02-24  Eli Zaretskii  <eliz@gnu.org>
-
-       * startup.el (command-line): If simple.el cannot be found, proceed
-       with a warning message.
-
-2007-02-24  Kenichi Handa  <handa@m17n.org>
-
-       * international/utf-8.el (utf-8-pre-write-conversion): Handle the
-       case that BEG is a string.
-
-2007-02-24  Chris Moore  <dooglus@gmail.com>
-
-       * pgg-pgp5.el (pgg-pgp5-encrypt-region):
-       * pgg-pgp.el (pgg-pgp-encrypt-region):
-       * pgg-gpg.el (pgg-gpg-encrypt-region):
-       Check pgg-encrypt-for-me if no other recipients.
-
-2007-02-23  Eli Zaretskii  <eliz@gnu.org>
-
-       * mail/rmailedit.el (rmail-cease-edit): Restore the Rmail toolbar.
-
-       * textmodes/sgml-mode.el (sgml-validate): Quote the file name with
-       shell-quote-argument.
-
-2007-02-23  Andreas Seltenreich  <uwi7@rz.uni-karlsruhe.de>
-
-       * comint.el (comint-read-input-ring): Use comint-input-ring-size
-       from the comint buffer instead of the temporary one.
-
-2007-02-23  David Reitter  <david.reitter@gmail.com>
-
-       * cus-edit.el (custom-save-all): Canonicalize custom-file before
-       storing it in recentf-exclude.
-
-2007-02-23  Chong Yidong  <cyd@stupidchicken.com>
-
-       * startup.el (fancy-splash-screens): Make cursor-type buffer-local
-       in splash screen.
-
-2007-02-22  J.D. Smith  <jdsmith@as.arizona.edu>
-
-       * progmodes/idlw-shell.el (idlwave-shell-mode): Clean up pending
-       commands, for restart.
-       (idlwave-shell-current-module): Fix handling of module name by type.
-       (idlwave-shell-break-in): Update type handling.
-       (idlwave-shell-bp-get): Encode type in BP structure.
-       (idlwave-shell-set-bp): Fix setting condition/count on disabled BPs.
-       (idlwave-shell-module-source-query): Query routine info based on type.
-       Fix path parsing for non-compiled files.
-       (idlwave-shell-module-source-filter): Don't signal error in filter
-       if no source found.
-       (idlwave-shell-set-bp-in-module): Use fallback source to prevent
-       filter race.
-
-2007-02-22  Kim F. Storm  <storm@cua.dk>
-
-       * wid-edit.el (widget-default-create): Undo 2007-02-04 change.
-       (editable-field): Document need to put some text before the %v
-       escape in :format string.
-
-2007-02-19  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * vc-svn.el: Remove the code inherited from CVSREAD and `cvs edit'.
-       (vc-svn-use-edit): Remove unused config var.
-       (vc-svn-update, vc-svn-revert): Checkout is always implicit.
-
-       * outline.el (hide-sublevels): Keep empty last line, if available.
-
-       * buff-menu.el (list-buffers-noselect): Use explicit unicode code
-       rather than the corresponding unicode char, to make the code
-       more readable.
-
-2007-02-19  Juanma Barranquero  <lekktu@gmail.com>
-
-       * speedbar.el (speedbar-frame-mode, speedbar-frame-width)
-       (speedbar-show-unknown-files, speedbar-item-info-file-helper)
-       (speedbar-item-info-tag-helper): Doc fixes.
-
-2007-02-19  Kenichi Handa  <handa@m17n.org>
-
-       * international/mule-cmds.el (locale-language-names):
-       Map "eo" to "Esperanto".
-
-       * language/european.el ("Esperanto"): New language environment.
-
-2007-02-17  Sven Joachim  <svenjoac@gmx.de>  (tiny change)
-
-       * simple.el (kill-line): Doc fix.
-
-2007-02-17  Kim F. Storm  <storm@cua.dk>
-
-       * emacs-lisp/bindat.el (bindat--unpack-u*): Optimize.
-       (bindat--unpack-item, bindat--length-group, bindat--pack-item)
-       (bindat--unpack-group, bindat--pack-group):
-       Handle vectors with optional element type.
-
-2007-02-17  Daiki Ueno  <ueno@unixuser.org>
-
-       * pgg-gpg.el (pgg-gpg-process-region): Make USE-AGENT nil
-       if PASSPHRASE is given.
-
-2007-02-17  Chris Moore  <dooglus@gmail.com>
-
-       * jka-cmpr-hook.el (jka-compr-compression-info-list):
-       Recognize backups of bz2 compressed files.
-
-2007-02-17  Eli Zaretskii  <eliz@gnu.org>
-
-       * info-look.el (info-lookup): Bind Info-fontify-maximum-menu-size
-       to nil to speed up lookup of the symbol in index nodes.
-
-2007-02-17  Alin C. Soare  <alinsoar@voila.fr>  (tiny change)
-
-       * emacs-lisp/lisp-mode.el (calculate-lisp-indent):
-       Add indentation for the constants of Lisp.
-
-2007-02-16  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * ps-print.el: Use (defvar <foo>) where applicable.
-       (ps-print-emacs-type): Remove.
-       (ps-x-frame-property, ps-e-frame-parameter): Remove.
-       (ps-frame-parameter): Align its call-convention with frame-parameter.
-       (ps-begin-job): Adjust calls to it appropriately.
-       (ps-setup): Don't print ps-print-emacs-type.
-       (ps-e-find-composition, ps-mark-active-p, ps-color-device):
-       Define in such a way that it's obvious that it's defined.
-       (ps-prsc, ps-c-prsc, ps-s-prsc): Remove.
-       (ps-rmail-mode-hook, ps-vm-mode-hook, ps-gnus-summary-setup)
-       (ps-jts-ps-setup): Use flavor-neutral syntax instead.
-
-2007-02-15  Alan Mackenzie  <acm@muc.de>
-
-       * progmodes/cc-cmds.el (c-indent-new-comment-line): When splitting
-       an empty one-line C-style comment, post-position point properly.
-
-2007-02-15  Chris Moore  <dooglus@gmail.com>
-
-       * isearch.el (isearch-lazy-highlight-space-regexp): New variable.
-       (isearch-lazy-highlight-new-loop): Bind it.
-       (isearch-lazy-highlight-search): Use it.
-
-       * replace.el (replace-highlight): Bind search-whitespace-regexp to nil.
-
-2007-02-15  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * font-lock.el (font-lock-extend-region-wholelines):
-       Only return non-nil if the region has really been changed.
-       Reported by David Hansen <david.hansen@physik.fu-berlin.de>
-
-2007-02-15  Juanma Barranquero  <lekktu@gmail.com>
-
-       * play/5x5.el (5x5-crack-xor-mutate): Doc fix.
-       (5x5-draw-grid-end, 5x5-make-xor-with-mutation, 5x5-mode, 5x5-crack)
-       (5x5-play-solution, 5x5-y-or-n-p): Fix typos in docstrings.
-
-2007-02-14  Juanma Barranquero  <lekktu@gmail.com>
-
-       * faces.el (color-values): Revert changes to docstring from
-       2007-01-31 and 2000-09-07.
-
-       * textmodes/ispell.el (ispell-keep-choices-win, ispell-word)
-       (ispell-begin-skip-region-regexp): Fix typos in docstrings.
-       (ispell-dictionary-alist, ispell-process-line): Doc fixes.
-       (ispell-help): Fix typos in docstring and output message.
-
-2007-02-14  Kim F. Storm  <storm@cua.dk>
-
-       * progmodes/grep.el (grep-files-aliases): Add tex and texi aliases.
-       (lgrep): Add DIR arg to start grep in specific directory, like rgrep.
-       (grep): Fix lgrep reference.
-
-       * disp-table.el (make-glyph-code, glyph-char, glyph-face): New defuns.
-       (standard-display-underline): Use make-glyph-code.
-
-       * descr-text.el (describe-char): Use glyph-char and glyph-face.
-
-       * international/latin1-disp.el (latin1-display-char):
-       Use make-glyph-code.
-
-2007-02-13  Juanma Barranquero  <lekktu@gmail.com>
-
-       * ehelp.el (with-electric-help, electric-help-exit)
-       (electric-help-retain): Doc fixes.
-
-       * emacs-lisp/bytecomp.el (byte-compile-dest-file)
-       (byte-compile-file): Doc fixes.
-
-2007-02-13  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el: Change all uses of
-       mac-set-font-panel-visibility to mac-set-font-panel-visible-p.
-       (mac-ae-number): Return integer 0 if coerced result is float 0.0.
-       (mac-ae-get-url): Call select-frame-set-input-focus.
-       (mac-dnd-handle-drag-n-drop-event): Don't call
-       select-frame-set-input-focus.
-
-2007-02-13  Kenichi Handa  <handa@m17n.org>
-
-       * international/characters.el: Fix documentation of category `a'.
-
-2007-02-11  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * progmodes/grep.el (grep): Mention lgrep and rgrep in the docstring.
-
-2007-02-12  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/tramp.el (tramp-get-ls-command, tramp-get-file-exists-command)
-       (tramp-get-remote-ln): Handle error case.
-       Reported by Chris Moore <dooglus@gmail.com>.
-
-2007-02-11  Kim F. Storm  <storm@cua.dk>
-
-       * bindings.el (ctl-x-map): Remove register compatibility bindings
-       C-x /, C-x j, C-x x, and C-x g (deprecated since Emacs 19).
-
-2007-02-11  Richard Stallman  <rms@gnu.org>
-
-       * loadhist.el (unload-feature): Handle (t . SYMBOL) entries
-       in load history.
-
-       * emacs-lisp/lisp-mode.el (indent-sexp): Clean up termination
-       condition -- don't fail to stop at endpos.
-
-2007-02-11  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-agenda-get-todos)
-       (org-agenda-get-timestamps, org-agenda-get-closed)
-       (org-agenda-get-deadlines, org-agenda-get-scheduled)
-       (org-agenda-get-blocks, org-format-agenda-item)
-       (org-agenda-change-all-lines, org-scan-tags): Rename text property
-       from `category' to `org-category'.
-
-2007-02-11  Kenichi Handa  <handa@m17n.org>
-
-       * international/titdic-cnv.el (titdic-convert): Force files be written
-       with Unix-like eol format.  Read files under CXTERM-DIC by raw-text.
-       (miscdic-convert): Force files be written with Unix-like eol format.
-
-2007-02-11  Juanma Barranquero  <lekktu@gmail.com>
-
-       * files.el (change-major-mode-with-file-name): Fix typo in docstring.
-
-       * calculator.el (calculator-prompt): Doc fix.
-       (calculator-mode-map): Fix typo in menu entry.
-
-2007-02-10  Jay Belanger  <belanger@truman.edu>
-
-       * calculator.el (calculator): Do more extensive checking for when
-       3 lines should be used for the calculator.
-
-2007-02-10  Eli Zaretskii  <eliz@gnu.org>
-
-       * info-look.el (info-lookup-make-completions):
-       Bind Info-fontify-maximum-menu-size to nil to speed up lookup of
-       index nodes.
-
-       * info.el (Info-fontify-maximum-menu-size): Document the effect
-       of a nil value.
-       (Info-fontify-node): Make sure Info-fontify-maximum-menu-size is
-       non-nil before using it as size.
-
-2007-02-09  Chong Yidong  <cyd@stupidchicken.com>
-
-       * subr.el (insert-for-yank-1): Prevent read-only properties from
-       interfering with text property operations.
-
-       * image-mode.el (image-mode): Revert 2007-01-30 changes.
-
-       * image.el (image-type-auto-detectable): Don't autodetect x[pb]m.
-       (image-type-auto-detected-p): Fail if another match is found in
-       auto-mode-alist.
-
-       * files.el (magic-mode-alist): Call image-mode instead of
-       image-mode-maybe for autodetected images.
-
-2007-02-09  Juanma Barranquero  <lekktu@gmail.com>
-
-       * mail/smtpmail.el (smtpmail-smtp-service, smtpmail-queue-index-file):
-       Fix typos in docstrings.
-       (smtpmail-local-domain, smtpmail-queue-mail): Doc fixes.
-
-2007-02-09  Kim F. Storm  <storm@cua.dk>
-
-       * emacs-lisp/float-sup.el: Remove obsolete comment.
-
-2007-02-08  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * diff-mode.el (diff-sanity-check-hunk): Fix last fix.
-
-2007-02-08  Karl Fogel  <kfogel@red-bean.com>
-
-       * simple.el: Revert previous change, at request of RMS:
-       (fundamental-mode-hook): Remove.
-       (fundamental-mode): Run after-change-major-mode-hooks manually,
-       and don't run the now-nonexistent fundamental-mode-hook.
-
-2007-02-08  Karl Fogel  <kfogel@red-bean.com>
-
-       * simple.el (fundamental-mode-hook): Declare new hook.
-       (fundamental-mode): Run the new dedicated hook, and don't run
-       after-change-major-mode-hooks manually anymore.
-
-2007-02-07  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * vc-svn.el (vc-svn-merge-news): Understand the new format with two
-       added columns of chars.  Remove support for the "no-meta-info" format.
-       Prompted by Romain Francoise <romain@orebokech.com>.
-
-2007-02-07  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-if-arrow): New macro.
-       (gdb-mouse-until, gdb-mouse-jump): Use it.
-
-2007-02-07  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-mouse-until, gdb-mouse-jump): Make them
-       work when there is just an assembler buffer (no source buffer).
-
-2007-02-07  Per Cederqvist  <ceder@lysator.liu.se>  (tiny change)
-
-       * diff-mode.el (diff-sanity-check-hunk): Don't reject the hunk
-       just because the diff was produced using "-p" (--show-c-function).
-
-2007-02-07  Juanma Barranquero  <lekktu@gmail.com>
-
-       * faces.el (frame-set-background-mode): Use `color-values' and
-       `display-color-p', not `x-color-values' and `x-display-color-p'.
-       (face-valid-attribute-values): Use `defined-colors' instead of
-       `x-defined-colors'.
-
-2007-02-07  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
-
-       * ps-print.ps: The ps-print commands without face printing should not
-       print background color.  Reported by Leo <sdl.web@gmail.com>.
-       (ps-print-version): New version 6.7.3.
-       (ps-begin-job): New arg.  Fix ps-default-background and
-       ps-default-foreground initialization.
-       (ps-face-attributes): Fix doc string.
-       (ps-face-background, ps-generate-postscript, ps-generate): Fix code.
-
-       * printing.el: Fix ps-print link.
-
-2007-02-06  Chong Yidong  <cyd@stupidchicken.com>
-
-       * faces.el (face-set-after-frame-default): Compile attributes to
-       be set by frame parameters before merging in X resources.
-
-2007-02-06  Juanma Barranquero  <lekktu@gmail.com>
-
-       * simple.el (blink-matching-paren-dont-ignore-comments):
-       (blink-matching-paren-on-screen): Doc fixes.
-
-2007-02-06  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-frames-mode): Truncate lines in stack buffer.
-
-2007-02-05  Juanma Barranquero  <lekktu@gmail.com>
-
-       * loadhist.el (unload-feature): Silently ignore `load-history' entries
-       of the form `(defface . SYMBOL)', and treat `(autoload . SYMBOL)'
-       entries like `defun'.  Return nil.
-
-2007-02-05  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el: Doc fixes.
-
-2007-02-04  David Kastrup  <dak@gnu.org>
-
-       * play/mpuz.el (mpuz-random-puzzle): Fix potential lockup when
-       `mpuz-allow-double-multiplicator' is non-zero, and correct
-       calculation of `min'.
-
-2007-02-04  Per Abrahamsen  <abraham@dina.kvl.dk>
-
-       * wid-edit.el (widget-default-create): Insert new text at the
-       :from marker _after_ the marker, not before it.
-
-2007-02-04  Alan Mackenzie  <acm@muc.de>
-
-       * progmodes/cc-cmds.el (c-indent-line): Don't erase ^L when a line
-       containing it is re-indented.
-
-2007-02-03  Chong Yidong  <cyd@stupidchicken.com>
-
-       * net/newsticker.el (newsticker--insert-image): Update docstring,
-       and insert the image directly.
-       (newsticker--buffer-redraw): Update docstring.
-
-       * emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
-       Rename from define-global-minor-mode.
-
-       * progmodes/cwarn.el (global-cwarn-mode):
-       * emacs-lisp/autoload.el (make-autoload):
-       * hi-lock.el (global-hi-lock-mode):
-       * font-core.el (global-font-lock-mode): All callers changed.
-
-2007-02-03  Eli Zaretskii  <eliz@gnu.org>
-
-       * textmodes/texnfo-upd.el (texinfo-menu-copy-old-description):
-       Don't copy @ignore lines into menu descriptions.
-       (texinfo-multi-file-update): Goto the @node line before attempting
-       to pluck the node name.
-       (texinfo-multiple-files-update): Reverse the optional arguments'
-       order, as per the doc string and the `interactive' form.
-
-2007-02-03  Chong Yidong  <cyd@stupidchicken.com>
-
-       * image-mode.el: Use autoload to avoid overriding disabled setting
-       applied in .emacs.
-
-2007-02-03  Alan Mackenzie  <acm@muc.de>
-
-       * progmodes/cc-engine.el (c-in-knr-argdecl): Slight correction
-       for, e.g. "void (*hdone)();" in a k&r list.  (No WS between
-       adjacent paren groups).
-
-2007-02-02  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
-
-       * progmodes/ebnf2ps.el: Doc fixes.
-       (ebnf-eps-buffer, ebnf-eps-region, ebnf-syntax-alist): Doc fixes.
-
-2007-02-02  Eli Zaretskii  <eliz@gnu.org>
-
-       * dired-x.el (dired-do-relsymlink): Add reference to
-       dired-do-symlink.  Add an autoload cookie.
-
-       * dired-aux.el (dired-do-symlink): Add reference to
-       dired-do-relsymlink.
-
-2007-02-02  Doug Maxey  <dwm@enoyolf.org>  (tiny change)
-
-       * mouse.el <left-fringe mouse-2, right-fringe mouse-3>:
-       <left-fringe mouse-3>: New bindings.
-
-2007-02-02  Ulf Jasper  <ulf.jasper@web.de>
-
-       * newsticker.el (newsticker-version): Changed to "1.10".
-       (newsticker--set-customvar): Doc string.
-       (newsticker-new-item-face): Doc string.
-       (newsticker-mode): Initialize `invisibility-spec' with t.
-       (newsticker-mode-map): Added
-       `newsticker-mark-all-items-at-point-as-read'.
-       (newsticker-menu): Added narrow-to-item and narrow-to-feed.
-       (newsticker-w3m-show-inline-images): Do not call
-       `w3m-remove-image'.
-       (newsticker--buffer-after-w3m-insert-image): New advice for
-       w3m-insert-image to cache images.
-       (newsticker-next-item-same-feed): New.
-       (newsticker-mark-all-items-at-point-as-read-and-redraw): New.
-       (newsticker-mark-all-items-of-feed-as-read): New.
-       (newsticker-mark-all-items-at-point-as-read): Use new functions.
-       (newsticker-mark-item-at-point-as-read): Doc string.
-       (newsticker-mark-item-at-point-as-read): Use new functions.
-       (newsticker--do-mark-item-at-point-as-read): New, extracted from
-       `newsticker-mark-item-at-point-as-read'.
-       (newsticker-hide-entry): Use (t) instead of t for invisibility.
-       (newsticker--sentinel): Yet another xml-parser workaround.
-       (newsticker--decode-iso8601-date): Bugfix for datestrings without
-       days.
-       (newsticker--buffer-do-insert-text): Fix.
-       (newsticker--buffer-insert-enclosure): Fix. length might be missing.
-       (newsticker--buffer-make-item-completely-visible):
-       `switch-to-buffer' not necessary.
-
-2007-02-02  Eli Zaretskii  <eliz@gnu.org>
-
-       * progmodes/ebnf2ps.el (ebnf-eps-buffer, ebnf-eps-region)
-       (ebnf-syntax-directory, ebnf-syntax-file, ebnf-syntax-region)
-       (ebnf-style-database, ebnf-apply-style, ebnf-reset-style)
-       (ebnf-push-style, ebnf-pop-style, ebnf-eps-production-list)
-       (ebnf-directory, ebnf-file, ebnf-syntax-alist): Doc fixes.
-
-2007-02-02  Kenichi Handa  <handa@m17n.org>
-
-       * international/quail.el (quail-show-key): Fix an error message.
-
-2007-02-01  Juanma Barranquero  <lekktu@gmail.com>
-
-       * faces.el (set-face-underline-p, modify-face): Rename arg
-       UNDERLINE-P to UNDERLINE (it is not a flag).
-
-2007-02-01  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-speedbar-update): Avoid duplication
-       when adding gdb-speedbar-update to gdb-input-queue.
-
-2007-02-01  Kenichi Handa  <handa@m17n.org>
-
-       * international/quail.el (quail-show-key): Signal an error if the
-       current input method is not using Quail.
-
-2007-02-01  J.D. Smith  <jdsmith@as.arizona.edu>
-
-       * progmodes/idlwave.el (idlwave-xml-create-sysvar-alist):
-       Trim leading whitespace in sysvar names.
-
-2007-02-01  Juanma Barranquero  <lekktu@gmail.com>
-
-       * faces.el (internal-find-face, internal-get-face): Doc fixes.
-
-2007-01-31  Juanma Barranquero  <lekktu@gmail.com>
-
-       * ido.el (ido-set-common-completion): Use `let', not `let*'.
-
-2007-01-31  Romain Francoise  <romain@orebokech.com>
-
-       * comint.el: Delete extra copy of `comint-copy-old-input' added in
-       previous change to this file.
-
-2007-01-31  Jason Rumney  <jasonr@gnu.org>
-
-       * files.el (magic-mode-alist): Use image-mode-maybe rather than
-       image-mode.
-
-       * image-mode.el (image-mode-maybe): Prevent magic-mode-alist from
-       interfering with attempt to set major mode from modified
-       auto-mode-alist.
-
-2007-01-31  Juanma Barranquero  <lekktu@gmail.com>
-
-       * faces.el (color-values): Doc fix.
-       (face-differs-from-default-p): Don't check :foreground twice.
-
-2007-01-31  J.D. Smith  <jdsmith@as.arizona.edu>
-
-       * comint.el (comint-mode): Prevent non-keyword fontification by default.
-
-2007-01-31  Kenichi Handa  <handa@m17n.org>
-
-       * international/quail.el (quail-store-decode-map-key): Store a
-       translated character too.
-       (quail-char-equal-p): New function.
-       (quail-find-key1): Check character equality by quail-char-equal-p.
-       (quail-decode-map-generated): New variable.
-       (quail-find-key): Check quail-decode-map-generated and re-generate
-       a decode map if necessary.
-
-2007-01-30  Richard Stallman  <rms@gnu.org>
-
-       * tutorial.el (tutorial--detailed-help): Make the list of
-       changed keys look nicer.
-
-2007-01-30  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-var-delete-1): New function.
-       (gdb-var-delete): Use it.
-       (gdb-var-update-handler-1): Handle value "invalid" for MI field
-       `in_scope'.
-
-2007-01-30  Michael Albinus  <michael.albinus@gmx.de>
-
-       * files.el (get-free-disk-space): Return nil for remote directories.
-
-       * net/ange-ftp.el (ange-ftp-ls): In case of wildcards, use "ls"
-       instead of "dir".
-
-2007-01-30  Chong Yidong  <cyd@stupidchicken.com>
-
-       * type-break.el (type-break-catch-up-event): New function.
-       (type-break-demo-hanoi, type-break-demo-life)
-       (type-break-demo-boring): Use it.
-
-       * image-mode.el (image-mode): Don't automatically view as image.
-       (image-toggle-display): Add `disabled' property.
-
-2007-01-29  Juanma Barranquero  <lekktu@gmail.com>
-
-       * isearchb.el (isearchb-iswitchb):
-       * ps-print.el (ps-build-face-reference):
-       * emacs-lisp/shadow.el (list-load-path-shadows):
-       * eshell/esh-cmd.el (eshell-rewrite-for-command):
-       * international/mule.el (find-auto-coding):
-       * mail/supercite.el (sc-attrib-selection-list):
-       * progmodes/cc-defs.el (c-emacs-features):
-       * progmodes/cc-vars.el (c-offsets-alist):
-       * progmodes/flymake.el
-       (flymake-init-create-temp-source-and-master-buffer-copy):
-       Fix typos in docstrings (some suggested by Chris Moore).
-
-       * progmodes/vhdl-mode.el (vhdl-components-package-name)
-       (vhdl-get-library-unit, vhdl-corresponding-begin)
-       (vhdl-skip-case-alternative, vhdl-backward-skip-label)
-       (vhdl-align-region-2, vhdl-electric-dash, vhdl-case-word)
-       (vhdl-hooked-abbrev, vhdl-hs-forward-sexp-func)
-       (vhdl-font-lock-match-item): Fix typos in docstrings.
-       (vhdl-get-library-unit, vhdl-get-block-state, vhdl-sort-alist)
-       (vhdl-set-offset, vhdl-fix-case-region-1, vhdl-scan-directory-contents)
-       (vhdl-speedbar-insert-project-hierarchy):
-       Improve argument/docstring consistency.
-
-2007-01-29  Kenichi Handa  <handa@m17n.org>
-
-       * international/titdic-cnv.el (py-converter): Fix previous change.
-
-2007-01-29  Chong Yidong  <cyd@stupidchicken.com>
-
-       * jka-compr.el (jka-compr-partial-uncompress)
-       (jka-compr-call-process): Rebind default-directory if it is
-       invalid.  Suggested by Chris Moore.
-
-       * comint.el (comint-insert-input): Handle situation where the
-       selected buffer is not the clicked buffer.
-
-2007-01-29  Kenichi Handa  <handa@m17n.org>
-
-       * international/ja-dic-cnv.el (skkdic-convert):
-       Add byte-compile-disable-print-circle:t at the head.
-
-       * international/titdic-cnv.el (tit-process-header):
-       Add byte-compile-disable-print-circle:t at the head.
-       (miscdic-convert): Likewise.
-       (py-converter): Skip the header comments.
-
-       * emacs-lisp/bytecomp.el (byte-compile-disable-print-circle):
-       New variable.
-       (byte-compile-output-file-form): Bing print-circle to nil if
-       byte-compile-output-file-form is not nil.
-       (byte-compile-output-docform): Likewise.
-
-2007-01-28  Kim F. Storm  <storm@cua.dk>
-
-       * emulation/cua-base.el (cua-global-keymap, cua--region-keymap):
-       Declare earlier to avoid byte compiler warnings.
-
-2007-01-28  Markus Triska  <markus.triska@gmx.at>
-
-       * speedbar.el (speedbar-make-specialized-keymap): Doc fix.
-
-2007-01-28  Chong Yidong  <cyd@stupidchicken.com>
-
-       * play/gamegrid.el (gamegrid-kill-timer): Cancel timer directly.
-       (gamegrid-add-score-with-update-game-score-1): Allow local quits
-       when calling update-game-score program.  Remove unnecessary
-       save-excursion.
-
-       * play/tetris.el (tetris-new-shape): Stop drawing if game is over.
-
-2007-01-28  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-breakpoint-regexp): Declare earlier to
-       avoid compiler warning.
-       (gdb-var-update-handler-1): Consider that the MI field `in_scope'
-       might have values other than "true" or "false".
-
-2007-01-28  Richard Stallman  <rms@gnu.org>
-
-       * textmodes/fill.el (fill-paragraph-function): Doc fix.
-       (fill-paragraph): Bind fill-paragraph-function to t to avoid recursion.
-
-       * emacs-lisp/pp.el (pp-eval-last-sexp): Don't eval here.
-
-       * image.el (image-type-header-regexps): Make GIF regex more specific.
-
-       * tutorial.el (tutorial--default-keys): Check M-DEL, not `M-backspace'.
-       Don't check `backspace'.
-       (tutorial--find-changed-keys): Look up bindings in a temp buffer
-       in Fundamental mode.
-
-       * startup.el (fancy-splash-text, normal-splash-screen):
-       Mention C-g.
-
-       * simple.el (eval-expression): Don't use eval-last-sexp-print-value
-       when inserting in buffer.
-
-       * vc-arch.el (vc-arch-file-id): Move with-current-buffer
-       inside the if.
-
-2007-01-27  Richard Stallman  <rms@gnu.org>
-
-       * obsolete/awk-mode.el (awk-font-lock-keywords): Add "do".
-
-2007-01-27  Guanpeng Xu  <herberteuler@hotmail.com>
-
-       * add-log.el (add-log-current-defun): Skip the semicolon ``;'' for
-       enum/union/struct/class definition.
-       Revert change to call `forward-sexp' multiple times.
-
-2007-01-27  Chong Yidong  <cyd@stupidchicken.com>
-
-       * files.el (hack-local-variables-confirm): Don't keep trying to
-       read an event from an empty kbd macro.
-
-2007-01-27  Eli Zaretskii  <eliz@gnu.org>
-
-       * server.el (server-start): Mention LEAVE-DEAD arg in the doc string.
-
-2007-01-27  Ben North  <ben@redfrontdoor.org>
-
-       * outline.el (outline-promote, outline-demote): Doc fix.  Rename
-       the arg CHILDREN -> WHICH.
-
-2007-01-27  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/tramp.el (tramp-do-copy-or-rename-file-out-of-band): Set
-       default-directory to a sane value when calling start-process.
-
-2007-01-27  Eli Zaretskii  <eliz@gnu.org>
-
-       * ls-lisp.el (ls-lisp-use-localized-time-format): New defcustom.
-       (ls-lisp-format-time-list): Doc fix.  Mention
-       ls-lisp-use-localized-time-format.
-       (ls-lisp-format-time): Use ls-lisp-format-time-list if
-       ls-lisp-use-localized-time-format is non-nil, even if a valid
-       locale is defined.
-
-2007-01-27  Juanma Barranquero  <lekktu@gmail.com>
-
-       * jka-compr.el (jka-compr-shell): Doc fix.
-
-       * jka-cmpr-hook.el (jka-compr-compression-info-list): Doc fix.
-
-2007-01-26  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
-
-       * ps-print.ps: Fix background height.
-       (ps-print-version): New version 6.7.2.
-
-2007-01-26  Eli Zaretskii  <eliz@gnu.org>
-
-       * makefile.w32-in (finder-data, custom-deps): Depend on
-       $(lisp)/loaddefs.el.
-
-2007-01-24  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * Makefile.in (custom-deps, finder-data): Add dependency to loaddefs.el.
-
-2007-01-24  Miles Bader  <miles@gnu.org>
-
-       * emacs-lisp/bytecomp.el (byte-compile-output-file-form)
-       (byte-compile-output-docform): Bind `print-circle' to t.
-
-2007-01-24  Kenichi Handa  <handa@m17n.org>
-
-       * international/ja-dic-cnv.el (skkdic-convert): Insert a related
-       file name of the original SKK dictionary file.
-
-2007-01-24  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-initial-position): New variable.
-       (ido-read-internal): Set it if default item is specified.
-       (ido-minibuffer-setup): Position cursor accordingly if set.
-       (ido-edit-input): C-e moves to end of input if not already there.
-       (ido-magic-backward-char): C-b does like M-b if prev char is /.
-       Don't switch to buffer mode if repeating C-b at start of input.
-       (ido-toggle-ignore): C-a only toggles ignore at start or end of
-       input; else it moves to start of input.
-       (ido-kill-buffer-at-head, ido-delete-file-at-head): If cursor is
-       not at end of input, delete rest of input, rather than normal op.
-
-2007-01-23  Michael Kifer  <kifer@cs.stonybrook.edu>
-
-       * viper-keym.el (viper-insert-basic-map): Delete binding for S-TAB.
-
-       * ediff-util.el (ediff-clone-buffer-for-region-comparison): Change text
-       of message.  Activate mark.
-       (ediff-activate-mark): Set transient-mark-mode to t.
-
-       * ediff.el (ediff-regions-wordwise, ediff-regions-linewise): Doc fix.
-
-2007-01-23  Martin Rudalics  <rudalics@gmx.at>
-
-       * help-fns.el (describe-variable): Don't suppress display of
-       buffer local value when the value is "large".
-
-2007-01-22  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-active): Add XEmacs test from ido-minibuffer-setup.
-       (ido-initiate-auto-merge, ido-exhibit, ido-minibuffer-setup)
-       (ido-tidy): Use ido-active.
-
-2007-01-22  Chris Moore  <christopher.ian.moore@gmail.com>
-
-       * hexl.el (hexl-mode-exit): Add missing quote.
-
-2007-01-22  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el (mac-keyboard-modifier-mask-alist): New constant.
-       (mac-ae-keyboard-modifiers): New function.
-       (mac-handle-toolbar-switch-mode): Use it.
-       (mac-dnd-handle-drag-n-drop-event): Likewise.  Set action to `copy'
-       if keyboard modifiers on drop contain option key.
-       (mac-dnd-drop-data): Add optional argument `action'.
-       (special-event-map): Remove binding for M-drag-n-drop.
-
-2007-01-21  Guanpeng Xu  <herberteuler@hotmail.com>
-
-       * add-log.el (add-log-current-defun): Use CC Mode functions to
-       find the beginning and end of a defun.
-
-2007-01-21  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-var-create-regexp)
-       (gdb-var-create-handler): Handle value field in GDB output of
-       -var-create.
-       (gdb-max-frames): New variable.
-       (gdb-stack-buffer, gdb-frames-select): Use it.
-       (gdb-info-stack-custom): Help user customize gdb-max-frames,
-       if necessary.
-       (gdb-get-frame-number): Simplify.
-
-2007-01-21  Glenn Morris  <rgm@gnu.org>
-
-       * net/tramp.el (tramp-perl-encode, tramp-perl-decode):
-       Update copyrights.
-
-2007-01-21  Alan Mackenzie  <acm@muc.de>
-
-       * progmodes/cc-cmds.el (c-where-wrt-brace-construct): Correct the
-       handling of K&R stuff.
-
-2007-01-21  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
-
-       * textmodes/bibtex.el (bibtex-files): Fix customization type.
-
-2007-01-21  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
-
-       * ps-print.el: Handle frame parameters (background and/or foreground
-       colors) changing dynamically.  Reported by Leo <sdl.web@gmail.com>.
-       (ps-print-version): New version 6.7.1.
-       (ps-x-frame-property, ps-e-frame-parameter): New aliases.
-       (ps-frame-parameter): New fun.
-       (ps-default-fg, ps-default-bg): New default value ('frame-parameter).
-       Fix doc and customization.
-       (ps-begin-job): Get frame parameters (background and/or foreground
-       colors).
-       (ps-do-despool): Ensure ps-printer-name has a valid value.
-
-2007-01-21  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-debug-log): Rename from gdb-debug-ring.
-       (gdb-debug-log-max): Rename from gdb-debug-ring-max.
-       (gud-gdba-marker-filter): Make a value of nil for gdb-debug-ring-max
-       mean unlimited.
-
-2007-01-20  Alan Mackenzie  <acm@muc.de>
-
-       * progmodes/cc-engine.el (c-in-knr-argdecl): Reformulate to do
-       much more rigorous analysis of putative K&R regions.
-
-2007-01-20  Alan Mackenzie  <acm@muc.de>
-
-       * progmodes/cc-defs.el (c-go-list-forward, c-go-list-backward):
-       New functions.
-
-2007-01-20  Alan Mackenzie  <acm@muc.de>
-
-       * progmodes/cc-align.el, progmodes/cc-cmds.el,
-       * progmodes/cc-defs.el, progmodes/cc-engine.el,
-       * progmodes/cc-langs.el, progmodes/cc-styles.el,
-       * progmodes/cc-vars.el: Add my name.
-
-2007-01-20  Chong Yidong  <cyd@stupidchicken.com>
-
-       * files.el (find-alternate-file): Revert query message to Emacs 21
-       version.
-
-2007-01-20  Eric Hanchrow  <offby1@blarg.net>  (tiny change)
-
-       * progmodes/cperl-mode.el (cperl-electric-keywords): Document in
-       the doc string how to use personal abbrevs without electric
-       keywords.
-
-2007-01-20  Alin C. Soare  <alinsoar@voila.fr>  (tiny change)
-
-       * lisp/emacs-lisp/lisp-mode.el (last-sexp-toggle-display):
-       Fixed cursor position when toggle abbreviated display.
-
-2007-01-20  Nick Roberts  <nickrob@snap.net.nz>
-
-       * t-mouse.el: Update copyright following assignment by
-       Alessandro Rubini.
-
-2007-01-20  Chong Yidong  <cyd@stupidchicken.com>
-
-       * type-break.el (type-break-demo-hanoi, type-break-demo-life)
-       (type-break-demo-boring): Call read-event instead of read-char.
-
-2007-01-19  Daniel Pfeiffer  <occitan@esperanto.org>  (tiny change)
-
-       * progmodes/compile.el: Add handling for makepplog.
-
-2007-01-19  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * textmodes/ispell.el (ispell-change-dictionary): Ensure that
-       aspell dictionaries are initialized when called non-interactively.
-
-2007-01-19  Chong Yidong  <cyd@stupidchicken.com>
-
-       * progmodes/compile.el (compilation-loop): New arg limit.
-       Handle case where the first error is at point-min.
-       (compilation-next-error): New arg to compilation-loop call.
-
-2007-01-18  Bruno Haible  <bruno@clisp.org>  (tiny change)
-
-       * info.el (Info-default-dirs): Change default info dir to
-       share/info.
-
-       * paths.el (Info-default-directory-list): Ditto.
-
-2007-01-18  Chris Moore  <christopher.ian.moore@gmail.com>
-
-       * hexl.el (hexl-before-revert-hook): New function.
-       (hexl-mode): Use it.
-       (hexl-after-revert-hook): Just call hexl-mode.
-       (hexl-mode-exit): Remove before-revert-hook.
-
-2007-01-17  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * isearch.el (isearch-no-upper-case-p): Look for [:upper:] as well.
-
-2007-01-16  Martin Rudalics  <rudalics@gmx.at>
-
-       * textmodes/ispell.el (ispell-dictionary-alist-3): Replace "---"
-       by "-" in francais7 otherchars entry.
-       (ispell-dictionary-alist-5): Replace "." by "[.]" for polish
-       otherchars entry.
-
-2007-01-15  Karl Fogel  <kfogel@red-bean.com>
-
-       * bookmark.el (bookmark-buffer-file-name): Abbreviate the bookmark
-       path.  Rewrite function in `cond' style for readability.
-
-       Suggested by: Stephen Eglen <S.J.Eglen{_AT_}damtp.cam.ac.uk>.
-       (The path shortening, that is, not the rearrarangement.)
-
-2007-01-15  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el (mac-ae-quit-application): New function.
-       (mac-apple-event-map): Bind "quit application" Apple event to it.
-
-2007-01-14  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * vc-svn.el (vc-svn-parse-status): Trust the filename argument more
-       than the program's output.
-
-2007-01-14  Juanma Barranquero  <lekktu@gmail.com>
-
-       * kmacro.el (kmacro-insert-counter, kmacro-set-counter)
-       (kmacro-start-macro-or-insert-counter)
-       (kmacro-step-edit-prefix-commands): Fix typos in docstrings.
-       (kmacro-call-ring-2nd, kmacro-call-ring-2nd-repeat): Doc fixes.
-
-       * longlines.el (longlines-show-hard-newlines):
-       * ruler-mode.el (ruler-mode-ruler):
-       * emulation/keypad.el (keypad-setup):
-       * progmodes/antlr-mode.el (antlr-indent-at-bol-alist):
-       Fix typo in docstring.
-
-2007-01-13  Mathias Dahl  <mathias.dahl@gmail.com>
-
-       * tumme.el (tumme-cmd-rotate-original-options): Add -outfile option.
-       Remove redirect character ">".
-
-2007-01-13  Juanma Barranquero  <lekktu@gmail.com>
-
-       * replace.el (perform-replace): Remove leftover code.
-
-2007-01-12  Richard Stallman  <rms@gnu.org>
-
-       * replace.el (perform-replace): Don't clear NODENT when computing
-       the replacement string.
-
-2007-01-11  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/tramp.el (tramp-handle-file-local-copy):
-       Set `enable-multibyte-characters' to nil.  Reported by Chris Moore
-       <christopher.ian.moore@gmail.com>.
-
-2007-01-11  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * diff-mode.el (diff-sanity-check-context-hunk-half)
-       (diff-sanity-check-hunk): New functions.
-       (diff-find-source-location): Use'em to check the hunks are well-formed.
-
-       * hexl.el (hexlify-buffer, dehexlify-buffer): Don't complain and don't
-       activate undo when undo is not active.
-       Reported by Chris Moore <christopher.ian.moore@gmail.com>.
-
-2007-01-10  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * ffap.el (ffap-next-regexp, ffap-machine-p, ffap-newsgroup-regexp)
-       (ffap-newsgroup-p, ffap-alist, ffap-string-at-point-mode-alist)
-       (ffap-url-at-point): Use char-classes rather than "a-z".
-
-2007-01-10  Juanma Barranquero  <lekktu@gmail.com>
-
-       * ediff-init.el (ediff-autostore-merges):
-       * textmodes/fill.el (fill-region): Doc fix.
-
-2007-01-10  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * server.el (server-ensure-safe-dir): UIDs may be floats.
-
-2007-01-10  Richard Stallman  <rms@gnu.org>
-
-       * battery.el (battery-linux-proc-acpi): Use ignore-errors
-       around calls to directory-files.
-
-       * subr.el (momentary-string-display): Use save-excursion.
-
-       * emacs-lisp/pp.el (pp-eval-expression): Once again eval the
-       argument, but read it as `X' does.
-
-2007-01-09  Juri Linkov  <juri@jurta.org>
-
-       * info.el (Info-fontify-node): Don't hide node names of index entries.
-
-       * faces.el (momentary): Change :group to basic-faces where all
-       basic faces belong to.  Add :version.
-
-2007-01-09  Lennart Borgman  <lennart.borgman.073@student.lu.se>
-
-       * tutorial.el (tutorial--display-changes): Show M-x sequence if no
-       keybinding is found.
-       (tutorial--find-changed-keys): Never treat null keybinding as a
-       remapping.
-
-2007-01-09  Martin Rudalics  <rudalics@gmx.at>
-
-       * wdired.el (wdired-xcase-word): Skip non-word read-only characters.
-
-2007-01-09  Kenichi Handa  <handa@m17n.org>
-
-       * international/mule-cmds.el
-       (select-safe-coding-system-interactively): Fix message.
-
-2007-01-09  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/tramp.el (tramp-process-one-action): Remove `with-timeout'.
-       (tramp-process-actions): Add optional parameter TIMEOUT.
-       (tramp-open-connection-telnet, tramp-open-connection-rsh)
-       (tramp-open-connection-su): Add timeout of 60".
-
-2007-01-09  Richard Stallman  <rms@gnu.org>
-
-       * progmodes/compile.el (compile): Doc fix.
-
-2007-01-09  Markus Triska  <markus.triska@gmx.at>
-
-       * tumme.el (tumme-display-thumb): Doc fix.
-
-2007-01-08  Juanma Barranquero  <lekktu@gmail.com>
-
-       * battery.el (battery-search-for-one-match-in-files):
-       * bindings.el (mode-line-minor-mode-help):
-       * x-dnd.el (x-dnd-types-alist):
-       * calendar/icalendar.el (icalendar-import-buffer):
-       * term/mac-win.el (mac-dnd-types-alist): Fix typo in docstring.
-
-       * progmodes/vhdl-mode.el (vhdl-save-caches): Fix typo in error message.
-
-2007-01-07  Chris Moore  <christopher.ian.moore@gmail.com>
-
-       * replace.el (replace-regexp): Fix typo in docstring.
-
-2007-01-07  Alan Mackenzie  <acm@muc.de>
-
-       * progmodes/cc-langs.el (c-operators, c-filter-ops):
-       Amend doc-string and comments.
-
-2007-01-06  Eli Zaretskii  <eliz@gnu.org>
-
-       * files.el (abbreviate-file-name): Doc fix.
-
-2007-01-06  Markus Triska  <triska@gmx.at>
-
-       * subr.el (split-string): Remove spurious ")" from doc string.
-
-2007-01-05  Takaaki Ota  <Takaaki.Ota@am.sony.com>
-
-       * textmodes/table.el (table--warn-incompatibility):
-       Use display-warning instead of momentary-string-display.
-
-2007-01-05  Richard Stallman  <rms@gnu.org>
-
-       * image.el (image-type-header-regexps): Recognize xbm more strictly.
-
-       * simple.el (backward-kill-word): Doc fix.
-
-2007-01-05  Romain Francoise  <romain@orebokech.com>
-
-       * international/mule.el (sgml-html-meta-auto-coding-function):
-       Ensure that the buffer contains a HTML document.
-
-2007-01-05  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * faces.el (momentary): Move here ...
-       * subr.el (momentary): ... from here.
-
-2007-01-05  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-max-children): New customizable variable.
-       (gdb-speedbar-expand-node): Ask user for confirmation before expanding
-       large structures/arrays.
-
-2007-01-04  Juanma Barranquero  <lekktu@gmail.com>
-
-       * files.el (find-file-noselect-1, set-visited-file-name):
-       Allow backup-enable-predicate to be nil.
-
-2007-01-04  Andreas Schwab  <schwab@suse.de>
-
-       * progmodes/ebrowse.el (ebrowse-global-prefix-key): Fix typo in
-       last change.
-
-2007-01-03  Richard Stallman  <rms@gnu.org>
-
-       * woman.el (woman-decode-buffer): Clarify error message.
-
-2007-01-03  Alan Mackenzie  <acm@muc.de>
-
-       * progmode/cc-cmds.el (c-mask-paragraph): Fix yesterday's buggy patch.
-
-2007-01-03  Chris Moore  <christopher.ian.moore@gmail.com>
-
-       * tutorial.el (tutorial--describe-nonstandard-key): Fix typo.
-
-2007-01-03  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * iswitchb.el (iswitchb-global-map): Use command-remapping if available.
-
-2007-01-02  Juanma Barranquero  <lekktu@gmail.com>
-
-       * emulation/viper.el (viper-custom-file-name, viper-mode):
-       Fix typos in docstrings.
-
-       * subr.el (momentary-string-display): After moving point, set POS
-       variable to it to avoid later errors once the buffer is modified.
-       Doc fix.
-
-2007-01-02  Alan Mackenzie  <acm@muc.de>
-
-       * progmodes/cc-cmds.el (c-mask-paragraph): In a block comment,
-       check that the "*/" is present before trying to manipulate it.
-
-2007-01-02  Richard Stallman  <rms@gnu.org>
-
-       * wid-edit.el (widget-choose): Avoid ugly error for function keys.
-
-       * progmodes/cfengine.el (cfengine-font-lock-syntactic-keywords):
-       Fix format of value.
-
-       * cus-edit.el (customize-unsaved): Rename from customize-customized.
-       Change messages accordingly.
-       (customize-customized): Now alias.
-
-2007-01-02  Juanma Barranquero  <lekktu@gmail.com>
-
-       * files.el (version-control): Doc fix.
-
-2007-01-01  Alan Mackenzie  <acm@muc.de>
-
-       * progmodes/cc-engine.el (c-guess-basic-syntax, case 5N):
-       Check the format of c-state-cache is valid for an optimisation before
-       using it.
-
-       * progmodes/cc-engine.el (c-guess-basic-syntax): New case 5Q "we
-       are at a statement within a macro".  Other changes so that only
-       the first continuation line in a macro gets the symbol
-       `cpp-define-intro', the others getting `statement', or whatever.
-
-       * progmodes/cc-cmds.el (c-context-line-break): When invoked within
-       a string, preserve whitespace.  Add a backslash only when also in
-       a macro.
-
-       * progmodes/cc-defs.el: Correct typos.
-
-       * progmodes/cc-cmds.el (c-context-line-break): Don't indent the
-       new line after an escaped EOL in a string.
-
-       * progmodes/cc-engine.el (c-forward-label): Recognise "foo:" as a
-       label when it directly follows "else", "do", ....
-
-       * progmodes/cc-engine.el (c-backward-<>-arglist): Tolerate empty
-       angle brackets (as seen in "explicit specialisations" of C++
-       templates).
-
-       * progmodes/cc-vars.el (c-indentation-style): Mention c-file-style
-       in the doc-string.
-
-       * progmodes/cc-cmds.el (c-mask-paragraph): Fix for C comments,
-       when the comment ender looks like "=========*/" and is alone on
-       its line.
-
-       * progmodes/cc-langs.el, progmodes/cc-engine.el: Correct the
-       spelling of c-opt-op-identiTier-prefix, t -> f.  Leave an alias
-       for the old name.
-
-       * progmodes/cc-mode.el: Bind C-M-a and C-M-e to
-       c-\(beginning\|end\)-of-defun by default.
-
-       * progmodes/cc-align.el (c-lineup-gnu-DEFUN-intro-cont):
-       New line-up function, for the DEFUN macro in the Emacs C sources.
-       Only used in "gnu" style.
-
-       * progmodes/cc-styles.el (c-style-alist): Use this new function in
-       the "gnu" style.
-
-       * progmodes/cc-cmds.el (c-electric-slash): Extend the handling of
-       clean-up comment-close-slash also to work when there's a comment
-       terminator on the line.
-       (c-beginning-of-defun, c-end-of-defun): Refactor and optimise
-       these for large arg - only take account of top level {..}, except
-       for initial and final adjustments.  M-- C-M-[ae] now go to the
-       right defuns when the starting point is between defuns.  They use
-       the four new functions:
-       (c-in-function-trailer-p, c-where-wrt-brace-construct)
-       (c-backward-to-nth-BOF-{, c-forward-to-nth-EOF-}): New functions to
-       support c-\(beginning\|end\)-of-defun.
-
-       * progmodes/cc-engine.el (c-forward-label): Analyze ":"
-       expressions more rigorously, to exclude bit-field specifiers from
-       being classed as labels.
-       (c-forward-label): When analyzing a ":" within a macro, be careful
-       about using c-forward-syntactic-ws at the macro beginning.
-       (c-beginning-of-decl-1): Whilst searching for "=" as evidence of a
-       stmt boundary, check for "operator=", etc.
-
-       * progmodes/cc-mode.el (c-postprocess-file-styles):
-       Bind inhibit-read-only to t, around the call to
-       c-remove-any-local-eval-or-mode-variables, so that it works on a
-       RO file.
-
-       * progmodes/cc-defs.el (c-version): Update the version number to
-       "5.31.4".
-
-2007-01-01  Richard Stallman  <rms@gnu.org>
-
-       * isearch.el (isearch-done): Use FOUND-POINT or FOUND-START
-       only if we restored isearch-window-configuration.
-
-2006-12-31  Romain Francoise  <romain@orebokech.com>
-
-       * net/tramp.el (tramp-default-method): Don't use `symbol-function'.
-
-2006-12-31  Kim F. Storm  <storm@cua.dk>
-
-       * files.el (auto-mode-case-fold): New defcustom.
-       (set-auto-mode): If non-nil, perform second case-sensitive pass
-       through auto-mode-alist if first pass failed.
-
-2006-12-30  Richard Stallman  <rms@gnu.org>
-
-       * emacs-lisp/easy-mmode.el (define-global-minor-mode): Doc fix.
-
-2006-12-30  Ken Manheimer  <ken.manheimer@gmail.com>
-
-       * allout.el (allout-encrypt-string): Handle symmetric-key
-       passphrase caching but leave keypair caching to pgg.
-
-2006-12-30  Michael Albinus  <michael.albinus@gmx.de>
-
-       Sync with Tramp 2.0.55.
-
-       * net/tramp.el (tramp-completion-mode): Use `wholenump' instead of
-       `integerp'.  `char-equal' could fail else in case of negative
-       numbers.  Reported by Toby Speight <T.M.Speight.90@cantab.net>.
-       (top): Check for `font-lock-add-keywords' before calling; it
-       doesn't exist under XEmacs.
-       (tramp-yn-prompt-regexp): Fix regexp.  Add question from plink.
-       (tramp-completion-mode): Remove clause (not
-       tramp-unified-filenames), because the function is called in other
-       context too, where this check results in wrong results in the
-       XEmacs case on Windows.
-       (tramp-touch): UTC handling is not possible for XEmacs.
-
-2006-12-30  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * scroll-bar.el (previous-scroll-bar-mode): New variable
-       (set-scroll-bar-mode): Set previous-scroll-bar-mode.
-       (scroll-bar-mode): Use previous-scroll-bar-mode if set.
-
-       * term/x-win.el: Set scroll bar mode to right if set by X resources.
-
-2006-12-30  Richard Stallman  <rms@gnu.org>
-
-       * files.el (make-backup-file-name-1): Precompute abs name
-       but don't lose the relative name.
-
-       * international/mule-cmds.el (select-safe-coding-system-interactively):
-       Fix message.
-
-2006-12-30  Kevin Rodgers  <kevin.d.rodgers@gmail.com>  (tiny change)
-
-       * files.el (backup-buffer): Show entire backup file name in msg.
-
-2006-12-30  Juanma Barranquero  <lekktu@gmail.com>
-
-       * image.el (image-type-header-regexps, image-type-from-data)
-       (image-type-from-buffer, image-type-from-file-header):
-       Revert changes from 2006-12-26.
-       (image-type-auto-detectable): New variable.
-       (image-type-auto-detected-p): New function.
-
-       * files.el (magic-mode-alist): Detect image files with
-       `image-type-auto-detected-p' instead of `image-type-from-buffer'.
-
-2006-12-29  Nick Roberts  <nickrob@snap.net.nz>
-
-       * dired.el (dired-sort-other): Move test for dired-mode...
-       (dired-sort-set-modeline): ...to here.
-
-2006-12-29  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac@lrde.org>
-
-       * textmodes/fill.el (fill-comment-paragraph): Document 2006-12-24
-       change.  Suggested by Stefan Monnier.
-
-2006-12-29  Kim F. Storm  <storm@cua.dk>
-
-       * emacs-lisp/bindat.el (bindat--unpack-group, bindat--length-group)
-       (bindat--pack-group): Let-bind COUNT during repeat block evaluation.
-
-2006-12-27  Kim F. Storm  <storm@cua.dk>
-
-       * emacs-lisp/authors.el (authors-aliases): Anchor FSF alias regexp,
-       so it doesn't accidentally match an fsf.org mail address.
-       (authors-renamed-files-alist): Add tcover-*.el.
-
-2006-12-27  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * vc-arch.el (vc-arch-find-version): New function.
-
-       * vc-hooks.el (vc-version-backup-file-name): Revision names may be
-       composed of arbitrary characters (even /) in some systems.
-
-2006-12-27  Eli Zaretskii  <eliz@gnu.org>
-
-       * international/mule-cmds.el (select-safe-coding-system-interactively):
-       Improve the message in the *Warning* buffer.
-
-2006-12-27  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-set-matches-1): Fix last change.  If default item is
-       current buffer, it is ok to be first.
-
-2006-12-27  Kenichi Handa  <handa@m17n.org>
-
-       * international/mule-cmds.el (select-safe-coding-system-interactively):
-       Use face `link' for problematic chars.
-
-2006-12-27  Kenichi Handa  <handa@m17n.org>
-
-       * international/mule-cmds.el (select-safe-coding-system-interactively):
-       Improve the message in *Warning* buffer.
-
-2006-12-27  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-set-matches-1): Never put current buffer first if
-       there are other matches.
-
-2006-12-26  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gud-watch): Allow duplicate names for watch
-       expressions.
-       (gdb-var-delete): Handle duplicate names.  Print message for non
-       root expressions.
-       (gdb-partial-output-name): Start buffer name with a space.
-       (gdb-info-breakpoints-custom, gdb-reset): Handle space in above
-       buffer name.
-
-2006-12-26  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac@lrde.org>
-
-       * mail/footnote.el (Footnote-insert-footnote): Fix the search of the
-       last footnote when `footnote-spaced-footnotes' is nil.
-
-2006-12-26  Richard Stallman  <rms@gnu.org>
-
-       * cus-edit.el (custom-browse-sort-alphabetically)
-       (custom-buffer-sort-alphabetically)
-       (custom-menu-sort-alphabetically): Doc fixes.  Add autoloads.
-
-       * image.el (image-type-header-regexps): Change element format
-       to include third item NOT-ALWAYS.
-       (image-type-from-data): Handle new format.
-       (image-type-from-buffer): Handle new format.  New arg INCLUDE-MAYBES.
-       (image-type-from-file-header): Pass t for INCLUDE-MAYBES.
-
-2006-12-26  Guanpeng Xu  <herberteuler@hotmail.com>
-
-       * add-log.el (add-log-current-defun): Call `forward-sexp'
-       multiple times to pick a member function name defined as
-       part of nested classes/namespaces.
-
-2006-12-26  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
-
-       * emacs-lisp/easymenu.el (easy-menu-change): New arg MAP to indicate
-       which keymap should be used to change menu.  It does not affect any
-       existent code.
-
-2006-12-26  Richard Stallman  <rms@gnu.org>
-
-       * textmodes/fill.el (fill-paragraph): Check for a minibuffer
-       rather than for being in a minibuffer window.
-
-2006-12-25  Daiki Ueno  <ueno@unixuser.org>
-
-       * pgg-def.el (pgg-passphrase-coding-system): Default to nil instead of
-       locale-coding-system.
-       * pgg-gpg.el (pgg-gpg-process-region): Encode passphrase with eol-type
-       LF.
-
-2006-12-25  Michael R. Mauger  <mmaug@yahoo.com>
-
-       * progmodes/sql.el (sql-mode-abbrev-table): Correct initialization.
-       (sql-mode-syntax-table): Disable double quoted strings.
-       (sql-mode-font-lock-object-name): Add TYPE and TYPE BODY.
-
-2006-12-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * startup.el (fancy-splash-last-input-event): New variable.
-       (fancy-splash-special-event-action): New function.
-       (fancy-splash-screens): Temporarily bind special events to it.
-       Execute command for saved special event before exiting from
-       recursive editing.
-
-       * term/mac-win.el (mac-keyboard-translate-char, mac-unread-string):
-       New functions.
-       (mac-ts-update-active-input-area, mac-ts-unicode-for-key-event):
-       Use mac-unread-string.
-
-2006-12-24  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac@lrde.org>
-
-       * textmodes/fill.el (fill-comment-paragraph): Prevent the use of
-       an optimized comment regexp if `comment-start-skip' uses a ^.
-       * bs.el (bs--up): Remove interactive spec.
-
-2006-12-24  Chong Yidong  <cyd@stupidchicken.com>
-
-       * woman.el (woman-decode-buffer): Signal error for alien macro sets.
-       Suggested by James Cloos.
-
-2006-12-24  Kevin Ryde  <user42@zip.com.au>
-
-       * calendar/cal-dst.el (calendar-dst-starts): Default to second Sunday
-       in March.
-       (calendar-dst-ends): Default to first Sunday in November.
-
-2006-12-24  Ken Manheimer  <ken.manheimer@gmail.com>
-
-       * allout.el (allout-encrypt-string): Inhibit use of agent within
-       body of let form where encryption happens.  Acknowledge non-use of
-       gpg-agent in docstring.
-       (allout-toggle-subtree-encryption): Acknowledge non-use of
-       gpg-agent in docstring.
-
-2006-12-24  Chong Yidong  <cyd@stupidchicken.com>
-
-       * custom.el (custom-add-frequent-value): Alias for custom-add-option.
-
-2006-12-23  Michael Kifer  <kifer@cs.stonybrook.edu>
-
-       * ediff-diff.el (ediff-diff-options): Clarify docstring.
-       (ediff-setup-diff-regions): Disallow -u in ediff-diff-options.
-
-       * viper-cmd.el (viper-post-command-sentinel): Protect against errors
-       in hooks.
-       (viper-add-newline-at-eob-if-necessary): Add newline only if we
-       actually modify buffer; ignore errors if occur.
-
-2006-12-23  Chong Yidong  <cyd@stupidchicken.com>
-
-       * calendar/calendar.el (calendar-mode-map): Switch < and >.
-       (calendar-mode-line-format): Use mouse-1 bindings, and tweak
-       formatting.
-
-2006-12-23  Richard Stallman  <rms@gnu.org>
-
-       * simple.el (delete-horizontal-space): Doc fix.
-
-2006-12-23  Eli Zaretskii  <eliz@gnu.org>
-
-       * makefile.w32-in (bootstrap-clean): Run bootstrap-clean-$(SHELLTYPE)
-       explicitly in a recursive Make, not implicitly through prerequisites,
-       since the latter is wrong under parallel builds.
-
-2006-12-22  Eli Zaretskii  <eliz@gnu.org>
-
-       * w32-fns.el (convert-standard-filename): Wrap in save-match-data.
-
-2006-12-22  Kevin Rodgers  <kevin.d.rodgers@gmail.com>  (tiny change)
-
-       * progmodes/sh-script.el (sh-make-vars-local): Fix a typo in
-       message string.
-
-2006-12-22  Ben North  <ben@redfrontdoor.org>  (tiny change)
-
-       * outline.el (outline-next-visible-heading): Fix the case with a
-       header at end-of-file with no final newline.
-
-2006-12-22  Robert Thorpe  <rthorpe@realworldtech.com>  (tiny change)
-
-       * indent.el (tab-always-indent): Doc fix.
-
-2006-12-22  Chong Yidong  <cyd@stupidchicken.com>
-
-       * info.el (Info-fontify-maximum-menu-size): Bump to 1000000.
-       (Info-fontify-node): Do fontify indices.
-
-       * tutorial.el (tutorial--detailed-help): Remove unnecessary link
-       to the Emacs Lisp reference manual.
-       (tutorial--tab-map): Remove.  All callers changed.
-       (tutorial--find-changed-keys): New elt QUIET, used to...
-       (tutorial--display-changes): ...ensure that warning messages are
-       only issued once per changed key.
-       (tutorial--remove-remarks): Delete unused code-path.
-       (lang-strings): Remove extraneous formatting.
-       (tutorial--save-tutorial): Prompt before saving tutorial state.
-
-2006-12-21  Chong Yidong  <cyd@stupidchicken.com>
-
-       * tutorial.el: Remove `cl' requirement.  Clean up whitespace.
-       Replace '?\ ' by '?\s' throughout.
-       (tutorial-warning-face): Inherit font-lock-warning-face.  Move to
-       `help' custom group.
-       (tutorial--key-description): New function.
-       (tutorial--display-changes): Remove redundant arg.  Scan for all
-       key sequences to avoid false matches.  Cleanup.
-       (tutorial--saved-dir): Save to a subdirectory in .emacs.d to
-       reduce homedir pollution.
-       (help-with-tutorial): Call tutorial--display-changes with no arg.
-
-2006-12-21  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-mode-map): Bind org-complete also to M-\t.
-
-2006-12-20  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/tramp.el (tramp-default-method): We still need to check for
-       `executable-find', because it is not bound under Emacs 20.
-       (tramp-handle-file-name-completion)
-       (tramp-completion-handle-file-name-completion): Handle optional
-       parameter PREDICATE.
-       (tramp-find-default-method): Add code for default values.
-
-2006-12-20  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-stopped): After attaching to a process
-       make gud-go send "continue".
-
-2006-12-19  Juanma Barranquero  <lekktu@gmail.com>
-
-       * image.el (image-type-header-regexps): Be more specific detecting `pbm'
-       and `png' files.  Use non-capturing parenthesis for `tiff' regexp.
-
-2006-12-19  Kim F. Storm  <storm@cua.dk>
-
-       * bindings.el: Bind sigusr1 and sigusr2 in special-event-map
-       instead of global-map.
-
-       * files.el (magic-mode-alist): Allow matching file type by
-       calling a function at bob.  Check for image types by calling
-       image-type-from-buffer.  Suggested by Juanma Barranquero.
-       (set-auto-mode): Do it.
-
-2006-12-19  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/tramp.el (tramp-methods): Introduce new method `scpc'.
-       Remove "ControlMaster" option from the other `scp*' methods.
-       (tramp-default-method): Check for ssh-agent before setting to `scp'.
-
-2006-12-18  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-mode): Show context after isearch.
-       (org-show-siblings): New function.
-       (org-show-context): Use `org-show-siblings'.
-
-2006-12-18  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * emacs-lisp/syntax.el (syntax-ppss-flush-cache, syntax-ppss):
-       Use syntax-ppss-toplevel-pos.
-
-2006-12-18  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-current-line): Make sure that lines are
-       counted from beginning of buffer.
-       (org-table-copy-region, org-table-paste-rectangle): Make sure that
-       lines are counted from beginning of buffer.
-
-2006-12-17  Chong Yidong  <cyd@stupidchicken.com>
-
-       * info.el (Info-build-node-completions): Signal error if tag-table
-       marker is not found.
-
-       * pgg-gpg.el (pgg-gpg-use-agent): Default to t.
-
-2006-12-17  Alan Mackenzie  <acm@muc.de>
-
-       * emacs-lisp/lisp.el (beginning-of-defun-raw): Optimise (for
-       speed) the case when open-paren-in-column-0-is-defun-start is nil.
-       Based on code by Martin Rudalics.
-
-       * progmodes/cc-mode.el (c-basic-common-init): Don't set
-       open-paren-in-column-0-is-defun-start to nil any more.
-
-2006-12-17  Richard Stallman  <rms@gnu.org>
-
-       * simple.el (delete-horizontal-space): Use prefix arg.
-
-       * help-fns.el (describe-variable): Improve blank separator lines.
-
-       * files.el (magic-mode-alist): Mark as risky.
-
-       * files.el (make-backup-file-name-1):
-       Expand backup-directory explicitly.
-
-2006-12-17  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/tramp.el (tramp-default-method): Before setting to "pscp",
-       check whether package password.el is loaded, or Pageant is running.
-
-2006-12-17  Ulf Jasper  <ulf.jasper@web.de>
-
-       * calendar/icalendar.el (icalendar-version): Increase to "0.14".
-       (icalendar--rris): First try Emacs, then XEmacs.
-       (icalendar--convert-ical-to-diary): Doc fix.
-       Insert newline at end of target file.
-
-2006-12-17  Kim F. Storm  <storm@cua.dk>
-
-       * outline.el (outline-isearch-open-invisible-function): New defvar.
-       (outline-flag-region): Use it if non-nil for isearch-open-invisible
-       overlay property instead of outline-isearch-open-invisible.
-
-2006-12-16  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-completion-help): Build ido-cur-list and ido-matches
-       if ido-directory-too-big is set on entry.
-       (ido-toggle-ignore, ido-completion-help): Print message while
-       reading big directory.
-
-2006-12-15  Richard Stallman  <rms@gnu.org>
-
-       * shell.el (shell): Doc fix.
-
-2006-12-15  Kevin Gallagher  <Kevin.Gallagher@boeing.com>
-
-       * emulation/edt.el (edt-xserver):
-       * emulation/edt-mapper.el (edt-xserver): Replace `/' with a `-',
-       to fix a problem on Cygwin.
-
-       * emulation/edt.el
-       * emulation/edt-mapper.el
-       * emulation/edt-lk201.el
-       * emulation/edt-pc.el
-       * emulation/edt-vt100.el: Update maintainer's email address.
-
-2006-12-15  Simon Marshall  <simon@gnu.org>
-
-       * progmodes/cc-fonts.el (c-font-lock-declarations): Fix previous change.
-
-2006-12-15  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el (mac-atsu-font-table): Remove defvar.
-       (mac-handle-font-selection): Use mac-atsu-font-face-attributes
-       instead of mac-atsu-font-table.
-       (fontset-default): Specify argument MAXIMUM in x-list-fonts calls.
-
-2006-12-14  Stephen Leake  <stephen_leake@member.fsf.org>
-
-       * align.el (align-match-tex-pattern): Fix a rare bug which
-       hanged Emacs.
-
-2006-12-14  Richard Stallman  <rms@gnu.org>
-
-       * startup.el (use-fancy-splash-screens-p): Use frame-height
-       instead of window-height.  Pass frame to image-size.
-
-2006-12-13  Kenichi Handa  <handa@m17n.org>
-
-       * international/mule-cmds.el (set-locale-environment):
-       Set default-sendmail-coding-system too.
-
-2006-12-12  J.D. Smith  <jdsmith@as.arizona.edu>
-
-       * progmodes/idlw-help.el: Fix copyright notice.
-
-2006-12-12  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * emacs-lisp/syntax.el (syntax-ppss-toplevel-pos): New fun.
-
-2006-12-11  Juanma Barranquero  <lekktu@gmail.com>
-
-       * subr.el (unread-command-char): Reformat obsolescence info.
-
-2006-12-11  Richard Stallman  <rms@gnu.org>
-
-       * emacs-lisp/cl-macs.el (defstruct): Suppress warnings
-       about calls to cl-struct-setf-expander.
-
-2006-12-11  Juanma Barranquero  <lekktu@gmail.com>
-
-       * ediff-merg.el (ediff-show-clashes-only): Doc fix.
-       (ediff-combination-pattern): Fix typo in docstring.
-
-       * textmodes/refer.el (refer-find-entry): Doc fix.
-       (refer-bib-files-regexp, refer-bib-directory, refer-bib-files)
-       (refer-cache-bib-files, refer-find-next-entry, refer-yank-key):
-       Fix tipos in docstrings.
-
-       * progmodes/idlwave.el (idlwave-library-path): Fix typos in docstring.
-
-2006-12-10  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-init-completion-maps): Remap backward-kill-word
-       instead of binding M-backspace.
-
-2006-12-10  Juanma Barranquero  <lekktu@gmail.com>
-
-       * replace.el (replace-match-data, replace-match-maybe-edit):
-       * calc/calc-aent.el (calc-eval-error):
-       * emulation/vi.el (vi-char-argument):
-       * progmodes/cc-langs.el (c-at-vsemi-p-fn)
-       (c-vsemi-status-unknown-p-fn): Doc fixes.
-
-2006-12-10  Chong Yidong  <cyd@stupidchicken.com>
-
-       * menu-bar.el (menu-bar-showhide-menu, menu-bar-tools-menu)
-       (menu-bar-help-menu): Tooltip fixes.  Suggested by Francis Wright.
-
-2006-12-10  Masatake YAMATO  <jet@gyve.org>
-
-       * progmodes/ld-script.el (ld-script-keywords): Fix a typo.
-
-2006-12-09  Chong Yidong  <cyd@stupidchicken.com>
-
-       * mouse-sel.el (mouse-sel-mode): Register mouse-2 as a click type.
-
-       * man.el (Man-xref-button-action): New function.  If the
-       `Man-target-string' button property is a function, assume it
-       accepts a position argument.
-       (Man-abstract-xref-man-page): Use it.
-       (Man-default-man-entry): New optional arg POS.
-
-       * wdired.el (wdired-preprocess-symlinks): Make the spaces after
-       symlink arrows read-only and non-rear-sticky.
-
-2006-12-09  Martin Rudalics  <rudalics@gmx.at>
-
-       * wdired.el (wdired-change-to-wdired-mode, wdired-finish-edit)
-       (wdired-search-and-rename): Simplify code.
-       (wdired-preprocess-files, wdired-preprocess-perms): Make
-       read-only property of preceding character rear-nonsticky to
-       avoid that it can be modified.  Put old-name and old-link
-       properties on character preceding name and replace
-       put-text-property by add-text-properties.
-       (wdired-get-filename, wdired-get-previous-link): Get old-name
-       and old-link properties from character preceding name and
-       simplify code.
-       (wdired-preprocess-perms, wdired-set-bit, wdired-toggle-bit)
-       (wdired-perms-to-number): Make local-map property
-       rear-nonsticky to avoid that text following permissions may be
-       modified.  Use add-text-properties instead of put-text-property
-       when changing a permission bit.
-       (wdired-change-to-dired-mode): Remove stickiness properties.
-
-2006-12-09  Juanma Barranquero  <lekktu@gmail.com>
-
-       * international/mule-cmds.el (register-input-method): Doc fix.
-
-2006-12-09  Masayuki Ataka  <masayuki.ataka@gmail.com>  (tiny change)
-
-       * cmuscheme.el (scheme-start-file): Use `let*', not `let'.
-
-2006-12-09  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac@lrde.org>
-
-       * textmodes/flyspell.el (flyspell-hack-local-variables-hook): New.
-       Force buffer local defs evaluation on local variables loading.
-       (flyspell-mode-on, flyspell-mode-off): Use it in
-       `hack-local-variables-hook'.
-
-2006-12-09  Eli Zaretskii  <eliz@gnu.org>
-
-       * emacs-lisp/find-func.el (find-variable): Doc fix.
-
-       * help-fns.el (variable-at-point): Doc fix.
-
-       * w32-fns.el (w32-append-code-lines): New function.
-
-2006-12-09  Romain Francoise  <romain@orebokech.com>
-
-       * comint.el (comint-insert-input): Delete obsolete comment.
-
-2006-12-08  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * net/browse-url.el (browse-url): Set DISPLAY to the one of the
-       current frame, in case we're connected to several displays.
-
-2006-12-08  Juanma Barranquero  <lekktu@gmail.com>
-
-       * frame.el (other-frame): Doc fix.
-       (set-frame-parameter): Fix typo in docstring.
-
-2006-12-07  Kim F. Storm  <storm@cua.dk>
-
-       * info.el (Info-index): Strip leading colon from topic.
-
-2006-12-07  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-speedbar-buttons): Deal with references
-       to pointers.
-
-2006-12-05  J.D. Smith  <jdsmith@as.arizona.edu>
-
-       * progmodes/idlwave.el (idlwave-xml-create-class-method-lists):
-       Trim out spurious class inheritance "None" entries.
-
-2006-12-05  Kim F. Storm  <storm@cua.dk>
-
-       * emulation/cua-base.el (cua-paste-pop-rotate-temporarily): Doc fix.
-       (cua-paste-pop): Rework last change for
-       cua-paste-pop-rotate-temporarily, so first M-y and C-y works alike,
-       pasting the head of the kill-ring, and prefix arg C-u M-y inserts the
-       text inserted by the last M-y command.
-
-2006-12-05  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac@lrde.org>
-
-       * cmuscheme.el (run-scheme, scheme-start-file): Search the start
-       file in ~/.emacs.d as `init_SCHEMENAME.scm' instead.
-
-       * shell.el (shell): Search the start file in ~/.emacs.d as
-       `init_SHELLNAME.sh' instead.
-
-2006-12-05  Glenn Morris  <rgm@gnu.org>
-
-       * progmodes/cperl-mode.el (cperl-mode)
-       * progmodes/f90.el (f90-mode-abbrev-table)
-       * progmodes/fortran.el (fortran-mode-abbrev-table)
-       * progmodes/octave-mod.el (octave-abbrev-table)
-       * progmodes/sql.el (sql-mode-abbrev-table): Define abbrevs even
-       if abbrev-table is non-nil (saved user abbrevs may have been restored).
-
-       * progmodes/vhdl-mode.el (vhdl-mode-abbrev-table-init): Do not
-       clear abbrev table, else saved abbrevs will not be restored.
-
-2006-12-04  Juanma Barranquero  <lekktu@gmail.com>
-
-       * facemenu.el (facemenu-unlisted-faces): Put obsolescence info in
-       the call to `make-obsolete-variable', not in the docstring.
-
-2006-12-04  Chong Yidong  <cyd@stupidchicken.com>
-
-       * facemenu.el (facemenu-unlisted-faces): Define as obsolete variable.
-
-2006-12-04  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
-
-       * progmodes/ebnf-abn.el:
-       * progmodes/ebnf-bnf.el:
-       * progmodes/ebnf-dtd.el:
-       * progmodes/ebnf-ebx.el:
-       * progmodes/ebnf-iso.el:
-       * progmodes/ebnf-otz.el:
-       * progmodes/ebnf-yac.el:
-       * progmodes/ebnf2ps.el:
-       * delim-col.el:
-       * printing.el:
-       * ps-bdf.el:
-       * ps-mule.el:
-       * ps-print.el: Remove 'Time-stamp' comment mark.
-
-       * printing.el (pr-menu-bind): Replace 'easy-menu-change' by
-       'easy-menu-add-item' when called in Emacs 21 or higher.
-
-2006-12-04  Stephen Leake  <stephen_leake@stephe-leake.org>
-
-       * progmodes/ada-xref.el (ada-check-current): Doc fix.
-       (ada-make-body-gnatstub): Doc fix.  Remove redundant `progn'.
-
-2006-12-04  Kim F. Storm  <storm@cua.dk>
-
-       * bindings.el (global-map): Bind [signal t] to ignore, to have
-       user signals ignored by default.
-
-2006-12-04  Juanma Barranquero  <lekktu@gmail.com>
-
-       * descr-text.el (describe-char-unicode-data): Use a hidden buffer for
-       Unicode data file pointed to by `describe-char-unicodedata-file'.
-
-2006-12-04  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * textmodes/sgml-mode.el (sgml-font-lock-keywords-1): Fix pathological
-       O(n^2) regexp-search by anchoring the search.
-
-2006-12-04  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * whitespace.el (whitespace-cleanup-internal): Use current
-       argument for recursive call.
-
-2006-12-04  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/tramp.el (tramp-methods): Add "ControlPath" and
-       "ControlMaster" to scp, scp1 and scp2 methods.  Suggested by
-       Andreas Schwab <schwab@suse.de>.
-       (tramp-do-copy-or-rename-file-out-of-band)
-       (tramp-open-connection-rsh): Compute format spec for ?t.
-       (tramp-process-actions): Trace command parameters.
-
-2006-12-04  Nick Roberts  <nickrob@snap.net.nz>
-
-       * simple.el (toggle-truncate-lines): Clarify doc string.
-
-       * progmodes/gdb-ui.el (gdb-var-delete-children): New function.
-       (gdb-speedbar-expand-node): Use it.
-
-2006-12-04  Richard Stallman  <rms@gnu.org>
-
-       * progmodes/python.el (python-indent): Add safe-local-variable prop.
-
-       * dired.el (dired-revert): Turn off dired-after-readin-hook
-       around call to dired-readin.
-
-       * menu-bar.el (menu-bar-make-toggle): Add "globally"
-       to echo area messages.
-       <indicate-empty-lines, case-fold-search>:
-       Add "globally" to Help string.
-       <case-fold-search>: MESSAGE arg need not say "globally".
-       (menu-bar-edit-menu <paste-from-menu>): Rename from select-and-paste.
-
-2006-12-03  Liam Healy  <lnp@healy.washington.dc.us>  (tiny change)
-
-       * outline.el (outline-end-of-subtree): Don't leave an empty
-       line hidden as we would a real next heading.
-
-2006-12-03  Ken Manheimer  <ken.manheimer@gmail.com>
-
-       * allout.el (allout-ascend): Add an optional argument to preserve
-       original position of point when unsuccessful.  Also, fix a
-       docstring error.
-       (allout-yank-processing): Fix depth shift of multiple-topic so yanks
-       work again, using allout-ascend's new option.
-       (allout-setup-mode-map): Extract from allout-mode to initialize
-       allout-mode-map.  Call it on file load, so the mode docstring
-       substitutions work even if allout mode has not yet been invoked.
-       (allout-mode): Use new allout-setup-mode-map to track any keybinding
-       customizations since the map was last processed.  Also, refine the
-       docstring so it's ship-shape for release.
-       (allout-default-layout, allout-beginning-of-line-cycles)
-       (allout-distinctive-bullets-string, allout-use-mode-specific-leader)
-       (allout-encrypt-unencrypted-on-saves, allout-inhibit-auto-fill)
-       (allout-version, allout-layout, allout-infer-body-reindent)
-       (allout-infer-header-lead-and-primary-bullet, allout-view-change-hook)
-       (allout-init, allout-mode, allout-next-heading, allout-chart-subtree)
-       (allout-previous-heading, allout-goto-prefix-doublechecked)
-       (allout-current-bullet-pos, allout-next-sibling-leap)
-       (allout-pre-command-business, allout-encrypted-type-prefix)
-       (allout-make-topic-prefix, allout-open-topic, allout-rebullet-heading)
-       (allout-rebullet-topic, allout-rebullet-topic-grunt)
-       (allout-flag-region, allout-expose-topic, allout-expose-topic)
-       (allout-old-expose-topic, allout-listify-exposed)
-       (allout-process-exposed, allout-latex-verb-quote)
-       (allout-latex-verbatim-quote-curr-line, allout-adjust-file-variable)
-       (allout-toggle-current-subtree-encryption)
-       (allout-toggle-subtree-encryption, allout-bullet-isearch):
-       Remove extraneous open-paren and close paren string escapes.
-
-2006-12-03  Juanma Barranquero  <lekktu@gmail.com>
-
-       * progmodes/ada-xref.el (is-windows, ada-find-in-src-path): Doc fixes.
-       (ada-xref-pos-ring-max, ada-xref-project-files, ada-xref-initialize)
-       (ada-prj-default-comp-cmd, ada-quote-cmd, ada-compile-current):
-       Fix typos in docstrings.
-
-2006-12-03  Glenn Morris  <rgm@gnu.org>
-
-       * progmodes/cc-align.el
-       * progmodes/cc-awk.el
-       * progmodes/cc-cmds.el
-       * progmodes/cc-compat.el
-       * progmodes/cc-defs.el
-       * progmodes/cc-engine.el
-       * progmodes/cc-langs.el
-       * progmodes/cc-menus.el
-       * progmodes/cc-mode.el
-       * progmodes/cc-styles.el
-       * progmodes/cc-vars.el
-       * progmodes/vhdl-mode.el: Fix Copyright format.
-
-2006-12-02  Chong Yidong  <cyd@stupidchicken.com>
-
-       * mouse.el (mouse-drag-track): Suppress automatic hscrolling for
-       initial down event.
-
-2006-12-02  Kim F. Storm  <storm@cua.dk>
-
-       * emulation/cua-base.el (cua-toggle-set-mark): Doc fix.
-       (cua-repeat-replace-region): Make M-v more robust.
-       (cua-paste-pop-rotate-temporarily): New defcustom.
-       (cua-paste-pop): Use it.
-       (cua-auto-mark-last-change): New defcustom.
-       (cua-pop-to-last-change): New helper function.
-       (cua-set-mark): Use them.
-
-2006-12-01  Nick Roberts  <nickrob@snap.net.nz>
-
-       * menu-bar.el (toggle-case-fold-search): Clarify doc/help string and
-       mini-buffer message.
-
-2006-12-01  Juanma Barranquero  <lekktu@gmail.com>
-
-       * descr-text.el (describe-char-unicodedata-file): Fix typo in docstring.
-
-2006-12-01  Ben North  <ben@redfrontdoor.org>
-
-       * paren.el: Fix the highlight overlay extension when the user types a
-       sequence of char very fast just before the open parenthesis.
-
-2006-12-01  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
-
-       * ps-mule.el: Eliminate Emacs 20 compatibility.
-
-       * ps-print.el: Eliminate Emacs 20 & 21 compatibility.
-       (ps-print-version): New version 6.7.
-       (ps-print-quote): Replace '?\ ' by '?\s'.
-
-2006-11-30  Juanma Barranquero  <lekktu@gmail.com>
-
-       * hexl.el (hexl-goto-address, hexl-forward-char, hexl-forward-short)
-       (hexl-forward-word, hexl-previous-line, hexl-beginning-of-1k-page)
-       (hexl-end-of-1k-page): Doc fixes.
-       (hexl-address-region, hexl-ascii-region, hexl-highlight-line-range):
-       Fix typos in docstrings.
-
-2006-11-30  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac@lrde.org>
-
-       * ido.el (ido-local-file-exists-p): New.  Tell if a file exists
-       locally, i.e. without using file name handlers.
-       (ido-read-internal): Allow mono letter host names, avoiding the
-       `c:' problem by testing if the file exists locally.
-       (ido-complete, ido-make-file-list, ido-exhibit): Ditto.
-
-2006-11-30  Masatake YAMATO  <jet@gyve.org>
-
-       * hexl.el (hl-line-range-function, hl-line-face): Declare variables
-       to avoid bytecomp warnings.
-       (hexl-mode-old-ruler-function): New variable.
-       (hexl-follow-line): Bind `hexl-mode-old-hl-line-range-function'
-       and `hl-line-range-function' after `require' hl-line.
-       Then bind `hl-line-range-function' and `hl-line-face'.
-       Don't require frame.  Don't use `with-no-warnings'.
-       (hexl-activate-ruler): Store the original value of
-       `ruler-mode-ruler-function' to `hexl-mode-old-ruler-function'.
-       (hexl-mode-exit): Restore the original value of
-       `ruler-mode-ruler-function'.
-
-2006-11-30  Alin C. Soare  <alinsoar@voila.fr>  (tiny change)
-
-       * hexl.el (hexl-mode-old-hl-line-range-function): New variable.
-       (hexl-mode-old-hl-line-face): New variable.
-       (hexl-mode, hexl-mode-exit): Fix the highlighting of the current
-       line when exit from the hexl-mode.
-
-2006-11-30  Juanma Barranquero  <lekktu@gmail.com>
-
-       * emacs-lisp/bytecomp.el (byte-optimize, byte-compile-warnings):
-       Doc fixes.
-
-       * international/fontset.el (create-fontset-from-ascii-font)
-       (create-fontset-from-fontset-spec, x-compose-font-name): Doc fixes.
-       (fontset-name-p): Fix typo in docstring.
-
-       * progmodes/cc-cmds.el (c-indent-exp): Fix typo in docstring.
-
-2006-11-30  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
-
-       * ps-bdf.el: Fix maintainer email.
-
-       * ps-mule.el: Fix maintainer email.  Define functions for Emacs 20
-       compatibility.
-
-       * ps-print.el: Fix maintainer email.  Define functions for Emacs 20 &
-       21 compatibility.
-       (ps-print-quote): Replace '?\s' by '?\ ' to keep compatibility with
-       Emacs 20 & 21.
-
-2006-11-29  J.D. Smith  <jdsmith@as.arizona.edu>
-
-       * progmodes/idlwave.el (idlwave-auto-fill):
-       Remove paragraph-start let to prevent auto-fill giving up.
-
-2006-11-28  Juanma Barranquero  <lekktu@gmail.com>
-
-       * vt100-led.el (led-state): Fix typo in previous change.
-
-2006-11-27  Andreas Seltenreich  <uwi7@rz.uni-karlsruhe.de>
-
-       * emacs-lisp/easy-mmode.el (easy-mmode-define-navigation):
-       Fix interactive spec of the functions getting defined to make them
-       work as documented.
-
-2006-11-28  Chong Yidong  <cyd@stupidchicken.com>
-
-       * startup.el (fancy-splash-screens): Hide initial splash buffer.
-
-2006-11-28  Kim F. Storm  <storm@cua.dk>
-
-       * icomplete.el (icomplete-tidy, icomplete-exhibit): Check that
-       icomplete-mode is enabled.
-
-2006-11-28  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (require): Require gnus-sum during compilation
-       to avoid problem with a macro call.
-
-2006-11-28  Glenn Morris  <rgm@gnu.org>
-
-       * emacs-lisp/authors.el (authors-aliases): Add new alias.
-
-       * progmodes/fortran.el (fortran-font-lock-keywords-4): Add `min'.
-       (fortran-window-create-momentarily): Do not need string-to-char.
-
-2006-11-28  Richard Stallman  <rms@gnu.org>
-
-       * emacs-lisp/bytecomp.el (byte-compile-get-constant):
-       Replace incorrect use of assoc-default with a loop.
-
-       * term.el (term-exec-1): Set envvar INSIDE_EMACS.
-
-       * simple.el (next-error-find-buffer): Improve messages.
-
-       * files.el (revert-buffer): Special error message if file
-       is now not readable.
-
-       * facemenu.el (facemenu-add-new-face): Improve doc strings of
-       constructed commands.
-
-       * comint.el (comint-exec-1): Provide Emacs version and `comint'
-       in INSIDE_EMACS.
-
-2006-11-27  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * diff-mode.el (diff-mode-map): Add a binding for unified->context.
-
-       * server.el: Remove spurious * in docstrings.
-       (server-process-filter): Exit from recursive editing before processing
-       a new request.
-
-2006-11-27  J.D. Smith  <jdsmith@as.arizona.edu>
-
-       * progmodes/hideshow.el (hs-already-hidden-p): Move to end of
-       line so hidden blocks will be correctly identified.
-
-2006-11-27  Juanma Barranquero  <lekktu@gmail.com>
-
-       * ledit.el (ledit-save-defun, ledit-mode):
-       * resume.el (resume-emacs-args-buffer):
-       * rot13.el (rot13-display-table, rot13-translate-table, rot13)
-       (rot13-string, rot13-region, rot13-other-window, toggle-rot13-mode):
-       * vmsproc.el (subprocess-input, start-subprocess, subprocess-command)
-       (command-send-input, command-kill-line):
-       * vt100-led.el (led-state, led-on): Fix typos in docstrings.
-
-       * autoarg.el (autoarg-kp-mode): Doc fix.
-
-       * emacs-lock.el (toggle-emacs-lock): Doc fix.  Simplify.
-       (emacs-lock-check-buffer-lock): Doc fix.  Use `when'.
-       (check-emacs-lock): Doc fix.  Simplify.
-
-       * iimage.el (iimage-mode-image-regex-alist): Doc fix.
-       (iimage-mode-buffer): Fix typos in docstring.
-
-       * misc.el (zap-up-to-char): Doc fix.
-
-       * time-stamp.el: Fix comment and obsolescence string for old
-       functions.  Use `dolist' instead of `while'.
-
-       * userlock.el (ask-user-about-lock-help): Fix typos in output message.
-
-       * disp-table.el (standard-display-8bit, standard-display-default):
-       * ebuff-menu.el (electric-buffer-list):
-       * ehelp.el (electric-help-command-loop):
-       * font-core.el (font-lock-mode):
-       * help-macro.el (make-help-screen):
-       * help.el (describe-minor-mode-completion-table-for-indicator)
-       (lookup-minor-mode-from-indicator):
-       * indent.el (tab-to-tab-stop, move-to-tab-stop):
-       * info-look.el (info-lookup-guess-custom-symbol):
-       * locate.el (locate-main-listing-line-p, locate-mode, locate-do-setup):
-       * longlines.el (longlines-wrap-line):
-       * macros.el (insert-kbd-macro):
-       * menu-bar.el (menu-bar-update-buffers):
-       * misc.el (copy-from-above-command):
-       * mouse.el (mouse-popup-menubar, mouse-buffer-menu-alist):
-       * newcomment.el (comment-indent):
-       * novice.el (disabled-command-function):
-       * sort.el (sort-fields-syntax-table):
-       * subr.el (momentary-string-display):
-       * tar-mode.el (tar-header-block-summarize)
-       (tar-clear-modification-flags):
-       * terminal.el (terminal-cease-edit, te-more-break-unwind, te-newline)
-       (te-clear-rest-of-line, te-clear-rest-of-screen, te-clear-screen)
-       (te-insert-lines, te-delete-lines, te-delete, te-insert-spaces)
-       (te-delete-char, te-down-vertically-or-scroll):
-       * time-stamp.el (time-stamp-string-preprocess):
-       * tmm.el (tmm-add-one-shortcut): "?\ " -> "?\s".
-
-2006-11-26  Nick Roberts  <nickrob@snap.net.nz>
-
-       * speedbar.el (speedbar-timer-fn): Revert to old behaviour when not
-       in GUD mode.
-
-       * progmodes/gud.el (gud-install-speedbar-variables): Remove bindings:
-       speedbar-expand-line-descendants, speedbar-contract-line-descendants.
-
-2006-11-26  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * progmodes/cc-vars.el (c-backslash-column): Add . at end of sentence.
-
-2006-11-26  Stephen Leake  <stephen_leake@stephe-leake.org>
-
-       * progmodes/ada-mode.el (ada-which-compiler): Fix typo in docstring.
-       (ada-compile-goto-error): Adapt to new argument profile of
-       compilation-goto-locus in Emacs 22.  Don't check if the various
-       compile functions are defined; we already do "(require 'compile)".
-
-2006-11-26  Kim F. Storm  <storm@cua.dk>
-
-       * kmacro.el: Fix commentary.
-
-2006-11-26  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gdb): Explain how to run in text command mode
-       more clearly.  Say in error message that multiple debugging
-       requires restarting GDB.
-
-2006-11-25  Juanma Barranquero  <lekktu@gmail.com>
-
-       * international/fontset.el (create-fontset-from-fontset-spec): Doc fix.
-
-2006-11-25  Pavel Kobiakov  <pk_at_work@yahoo.com>
-
-       * progmodes/flymake.el (flymake-posn-at-point-as-event): New function.
-       (flymake-popup-menu): Use it instead of posn-at-point.
-
-2006-11-25  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * progmodes/cc-vars.el (c-backslash-column):
-       Mention c-backslash-max-column in documentation for c-backslash-column.
-
-2006-11-24  Lars Hansen  <larsh@soem.dk>
-
-       * net/tramp.el (tramp-default-method): Under Windows, change from
-       plink to pscp.
-       (tramp-copy-failed-regexp, tramp-action-copy-failed): Add.
-       (tramp-actions-copy-out-of-band):
-       Add pair (tramp-copy-failed-regexp tramp-action-copy-failed).
-       (tramp-action-out-of-band): Move "Permission denied" handling to
-       tramp-action-copy-failed.
-       (tramp-do-copy-or-rename-file-out-of-band): unwind-protect killing of
-       process buffer.
-
-2006-11-24  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * pgg-pgp.el (pgg-pgp-process-region): Change `args' from a list of
-       strings to a single string.  Quote `errors-file-name'.
-       (pgg-pgp-encrypt-region, pgg-pgp-decrypt-region, pgg-pgp-sign-region)
-       (pgg-pgp-verify-region, pgg-pgp-insert-key, pgg-pgp-snarf-keys-region):
-       Adjust calls.  Use `shell-quote-argument'.
-
-       * international/mule.el (load-with-code-conversion)
-       (with-category-table): Use with-current-buffer.
-       (after-insert-file-set-coding): Use restore-buffer-modified-p.
-
-2006-11-24  Eli Zaretskii  <eliz@gnu.org>
-
-       * mail/smtpmail.el (smtpmail-send-it):
-       Copy buffer-file-coding-system from the mail buffer.  Possibly add a
-       MIME header for the message encoding.
-       Bind coding-system-for-write around the call to mail-do-fcc.
-       Use smtpmail-code-conv-from to encode queued mail messages.
-
-2006-11-24  Juanma Barranquero  <lekktu@gmail.com>
-
-       * tabify.el (tabify-regexp): Doc fix.
-
-       * net/rcirc.el (rcirc-buffer-maximum-lines):
-       * progmodes/gud.el (jdb): Fix space/tab mixup in docstrings.
-
-       * play/gomoku.el (gomoku-terminate-game, gomoku-human-takes-back)
-       (gomoku-prompt-for-move, gomoku-human-plays, gomoku-offer-a-draw):
-       Fix typos in output messages.
-       (gomoku-vector-length, gomoku-init-board): Fix typos in docstrings.
-
-2006-11-23  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * hexl.el (hexl-mode): Don't try to guess the max-address: get it from
-       the horse's mouth.
-       (hexlify-buffer): Don't re-encode an arg that's already encoded.
-
-2006-11-23  Michael Kifer  <kifer@cs.stonybrook.edu>
-
-       * ediff-diff.el (ediff-exec-process, ediff-same-file-contents):
-       Remove condition-case.
-
-2006-11-23  Glenn Morris  <rgm@gnu.org>
-
-       * progmodes/f90.el (f90-comment-indent): Do not move point in
-       default case.
-
-2006-11-21  Romain Francoise  <romain@orebokech.com>
-
-       * emacs-lisp/find-func.el (find-library-name): Don't strip ".el"
-       from library name (reverts change of 2005-10-25).
-
-2006-11-21  Lennart Borgman  <lennart.borgman.073@student.lu.se>
-
-       * tutorial.el (tutorial--default-keys): Add newline and
-       delete-backward-char bindings.
-       (tutorial--detailed-help): Save excursion when finding keys.
-       Correct warning string for M-x FOO case.
-       (tutorial--display-changes): Print special keys in tutorial style.
-       Tweak search regexp for changed keys.
-
-2006-11-21  Bob Rogers  <rogers-emacs@rgrjr.dyndns.org>  (tiny change)
-
-       * thingatpt.el (thing-at-point-url-at-point): Don't add a
-       redundant scheme.
-
-2006-11-21  Diane Murray  <disumu@x3y2z1.net>  (tiny change)
-
-       * thingatpt.el (thing-at-point-uri-schemes): Add schemes that
-       are new to the list at IANA.  Also added irc, mms, mmsh.
-
-2006-11-20  J.D. Smith  <jdsmith@as.arizona.edu>
-
-       * progmodes/idlw-help.el (idlwave-html-help-location):
-       Fail gracefully for missing help packages.
-       (idlwave-help-assistant-open-link): Open full links.
-       (idlwave-help-assistant-help-with-topic): Direct help link.
-
-       * progmodes/idlwave.el (idlwave-mode):
-       Set add-log-current-defun-function.
-       (idlwave-current-routine-fullname): Add, to support add-log.
-       (idlwave-convert-xml-system-routine-info): Simplify XML parsing
-       to reflect improvements to xml-parse-file.
-       (idlwave-mode-menu-def): New binding for help-with-topic.
-
-       * progmodes/idlw-shell.el (idlwave-shell-filter-directory):
-       Handle extra newlines and spaces.
-       (idlwave-shell-mode-map): Add help-with-topic.
-
-2006-11-20  Chong Yidong  <cyd@stupidchicken.com>
-
-       * tutorial.el (tutorial-warning-face): New face.
-       (tutorial--detailed-help, tutorial--display-changes): Use it.
-       (tutorial--find-changed-keys): Check ESC-prefix binding specially.
-       Improve search pattern for occurrences of changed keys.
-
-2006-11-20  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * term/x-win.el (x-last-cut-buffer-coding): New variable.
-       (x-select-text): Set it.
-       (x-cut-buffer-or-selection-value): Check also x-last-cut-buffer-coding
-       when checking for newness.
-
-2006-11-19  Juanma Barranquero  <lekktu@gmail.com>
-
-       * subr.el (posn-image):
-       * progmodes/ebnf2ps.el (ebnf-stop-on-error): Fix typos in docstrings.
-
-       * emacs-lisp/regexp-opt.el (regexp-opt): Doc fix.
-
-2006-11-19  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac@lrde.org>
-
-       * progmodes/glasses.el (glasses-separate-parentheses-exceptions): New.
-       Exceptions to the rule "add a space between an identifier and an
-       opening parenthesis".  Defaulted to the `#define' problem of cpp.
-       (glasses-parenthesis-exception-p): New.  Check if the region is an
-       exception regarding to that.
-       (glasses-make-readable): Use it.
-       (glasses-convert-to-unreadable): Ditto.  Modify the file also if
-       `glasses-convert-on-write-p' and `glasses-separate-parentheses-p' are t.
-
-2006-11-19  Chong Yidong  <cyd@stupidchicken.com>
-
-       * emacs-lisp/bytecomp.el (byte-compile-if): Revert last change.
-
-2006-11-19  Stephen Leake  <stephen_leake@stephe-leake.org>
-
-       * progmodes/ada-mode.el (ada-make-body): Fix typo.
-
-       * progmodes/ada-xref.el (ada-make-body-gnatstub): Fix typo.
-       (ada-xref-initialize): Fix typo.  Use add-hook and remove-hook.
-
-2006-11-18  Chong Yidong  <cyd@stupidchicken.com>
-
-       * emacs-lisp/bytecomp.el (byte-compile-maybe-guarded): Check `and'
-       conditions for function or variable bindings.
-
-       * comint.el (comint-exec-1): Set EMACS and INSIDE_EMACS to t.
-
-       * progmodes/compile.el (compilation-start): Ditto.
-
-2006-11-18  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/tramp.el (top): cl and custom are always required.
-
-2006-11-18  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * term/x-win.el (x-cut-buffer-or-selection-value): Decode text from
-       cut-buffers with next-selection-coding-system if not nil.
-
-2006-11-17  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-fix-decoded-time): New function.
-       (org-display-custom-time): Use `org-fix-decoded-time'.
-
-2006-11-17  Chong Yidong  <cyd@stupidchicken.com>
-
-       * menu-bar.el (menu-bar-games-menu): Remove yow.
-
-2006-11-17  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-scan-tags): Re-align code fixed.
-       (org-detach-overlay): Rename from `org-detatch-overlay'.
-       (org-table-convert-region): Insert space after column separator.
-       (org-agenda-kill): New command.
-       (org-metaleft): Call `org-outdent-item' on bullets.
-       (org-metaright): Call `org-indent-item' on bullets.
-       (org-timestamp-change): Set `org-last-changed-timestamp'.
-       (org-current-line): Make sure (bolp) returns correct result.
-       (org-agenda-change-all-lines): Make sure TODO are highlighted.
-
-2006-11-17  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * pcvs.el (cvs-retrieve-revision): Set buffer-file-coding-system.
-
-2006-11-16  Chong Yidong  <cyd@stupidchicken.com>
-
-       * mouse.el (global-map): Change 2006-08-16 fix to call
-       mouse-yank-at-click explicitly, since mouse events are not carried
-       over into keyboard macros.
-
-2006-11-16  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-file-internal): Use current buffer's file name as default
-       choice for ido-find-alternate-file.  Suggested by Matt Hodges.
-
-2006-11-15  Ken Manheimer  <ken.manheimer@gmail.com>
-
-       * allout.el (allout-doublecheck-at-and-shallower): Clarify docstring.
-       (allout-inhibit-aberrance-doublecheck): Rename from
-       allout-during-yank-processing.  All callers changed.
-       (allout-ascend): Provide for unusual case where some topic after
-       the first in file is at lower depth than the first.
-       (allout-shift-in): Ensure the offspring of the new containing
-       topic are exposed.
-       (allout-encrypt-string): Preserve the coding-system of the text,
-       according to that of the containing buffer.
-       (allout-toggle-subtree-encryption): When the text being encrypted
-       requires a different coding system, offer to preserve the coding
-       system using a file local var.
-
-2006-11-15  Simon Marshall  <simon@gnu.org>
-
-       * progmodes/cc-fonts.el (c-font-lock-declarators): Use c-at-toplevel-p
-       to recognise "T t()" as a function declaration, rather than a
-       variable instantiation, iff at the top-level or inside a class
-       declaration.  Suggested by Feng Li <fengli@gmail.com>.
-
-2006-11-14  Stephen Leake  <stephen_leake@stephe-leake.org>
-
-       * progmodes/ada-xref.el (ada-parse-prj-file):
-       Don't delete project buffer; user may want to edit it.
-       (ada-xref-set-project-field, ada-xref-current-project-file)
-       (ada-xref-current-project, ada-show-current-project)
-       (ada-set-main-compile-application): New functions.
-       (ada-xref-get-project-field, ada-require-project-file):
-       Normalize use of ada-prj-default-project-file.
-       (ada-gdb-application, ada-get-ada-file-name, ada-make-body-gnatstub):
-       Normalize use of ada-require-project-file.
-       (ada-prj-find-prj-file): Improve doc string, comments.
-
-       * progmodes/ada-mode.el (ada-mode-version): Bump version.
-       (ada-create-keymap): Add \C-c\C-m 'ada-set-main-compile-application.
-       (ada-create-menu): Add ada-set-main-compile-application,
-       ada-show-current-main, ada-show-current-project.
-
-2006-11-14  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/python.el (inferior-python-mode-syntax-table): New var.
-       (inferior-python-mode): Use it.
-
-2006-11-14  Andreas Schwab  <schwab@suse.de>
-
-       * term/xterm.el (terminal-init-xterm): Add more key bindings.
-
-2006-11-13  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-copy-current-word): C-o copies region if active.
-
-2006-11-13  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-emph-face): Fix typo in variable name.
-
-2006-11-13  Juanma Barranquero  <lekktu@gmail.com>
-
-       * ediff.el (ediff-revision):
-       * files.el (set-visited-file-name):
-       * mail/rmailout.el (rmail-output-body-to-file):
-       Use `format', not `message', in `y-or-n-p' call.
-
-2006-11-13  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-metaleft): Call `org-outdent-item' on bullets.
-       (org-metaright): Call `org-indent-item' on bullets.
-       (org-timestamp-change): Set `org-last-changed-timestamp'.
-       (org-current-line): Make sure (bolp) returns correct result.
-       (org-agenda-change-all-lines): Make sure highlighting TODO always works.
-
-2006-11-12  Richard Stallman  <rms@gnu.org>
-
-       * language/european.el (turkish-case-conversion-enable)
-       (turkish-case-conversion-disable): New functions.
-       ("Turkish" lang env): Use them.
-
-       * international/characters.el (case table):
-       Do nothing special for i and I.
-
-       * subr.el (remove-overlays): Fix last change.
-
-       * cus-edit.el (custom-save-all): Use find-file-visit-truename
-       for visiting the custom file.
-
-2006-11-12  Markus Triska  <triska@gmx.at>
-
-       * play/handwrite.el (handwrite): Also process lines not ending
-       with newline.  Replace some position-fiddling with different
-       logic.  Improve performance.
-
-2006-11-12  Stephen Leake  <stephen_leake@stephe-leake.org>
-
-       * progmodes/ada-xref.el (ada-prj-default-check-cmd): New variable,
-       replacing deleted variable `ada-check-switch'.
-       (ada-project-file-extension): Rename to `ada-prj-file-extension'.
-       (ada-xref-project-files): Improve doc string.
-       (ada-find-executable): New function.
-       (ada-initialize-runtime-library): Use `ada-find-executable'.
-       (ada-xref-set-default-prj-values): In compile commands, don't need
-       `ada-cd-command'; `compile' does that more portably.
-       Use ada-prj-default-check-cmd.
-       (ada-parse-prj-file): Don't set 'debug_post_cmd, 'debug_pre_cmd
-       properties if not specified in project file.
-       (ada-goto-declaration): Display useful message for new error
-       'error-file-not-found.
-       (ada-get-ada-file-name, ada-find-in-src-path): Signal new error
-       'error-file-not-found.
-       (ada-get-all-references): Match latest ali syntax.  Signal new
-       error 'error-file-not-found.
-       (ada-find-in-ali): Match latest ali syntax.
-       (ada-make-filename-from-adaname): Handle different semantics of
-       gnatkr in GNAT 3.15p vs later.
-
-       * progmodes/ada-stmt.el (ada-func-or-proc-name): Match changes to
-       ada-procedure-start-regexp.
-       (ada-or-accept, ada-or-delay, ada-or-terminate): Improve doc string.
-
-       * progmodes/ada-mode.el: Replace conditional (require 'ispell)
-       with defvar.
-       (ada-language-version): Rename ada05 -> ada2005.
-       (ada-align-region-separate): Add `eval-when-compile'.
-       (ada-name-regexp): Remove unneeded escapes in regexp character
-       alternative.
-       (ada-compile-goto-error-file-linenr-re): New constant.
-       (ada-matching-start-re): Handle additional cases `declare',
-       `procedure', `function'.
-       (ada-compile-goto-error): Handle "... at line nn".
-       (ada-mode): Clearer syntax, comments for ff-special-constructs.
-       Delete support for old versions of `align'.
-       (ada-search-prev-end-stmt): Handle additional keyword `private'.
-       (ada-check-defun-name): Simplify handling of `declare'.
-       (ada-goto-matching-start): Handle nested `begin ... end'.
-       Handle `declare', `protected', `procedure', `function'.
-       (ada-create-menu): Presence of arm95 is not conditional on using
-       GNAT compiler.
-
-2006-11-12  Juanma Barranquero  <lekktu@gmail.com>
-
-       * emacs-lisp/re-builder.el (reb-mode): Set `blink-matching-paren' to
-       nil in the *RE-Builder* buffer (it causes spurious error messages).
-
-       * server.el (server-visit-files): If `minibuffer-auto-raise' has
-       been set to t, respect it.
-
-2006-11-11  Stephen Leake  <stephen_leake@stephe-leake.org>
-
-       * progmodes/ada-mode.el: Delete `eval-and-compile' around `require'.
-       Delete commented out code for old Emacs versions.  Autoloading of
-       "ada-xref", "ada-prj" is useful even if compiler is not GNAT.
-       (ada-mode-version): Bump version number.
-       (ada-95-string-keywords, ada-2005-string-keywords)
-       (ada-2005-keywords, ada-name-regexp): New constant.
-       (ada-language-version, ada-procedure-start-regexp, ada-mode)
-       (ada-font-lock-keywords): Add support for Ada 2005 keywords.
-       (ada-package-start-regexp): Support private packages, include package
-       name (for ada-set-point-accordingly).
-       (ada-next-procedure, ada-previous-procedure)
-       (ada-which-function-are-we-in): Match changes to
-       ada-procedure-start-regexp.
-       (ada-make-body): Make non-interactive; not a user function.
-       (ada-make-subprogram-body): Improve doc string.
-
-2006-11-11  Romain Francoise  <romain@orebokech.com>
-
-       * progmodes/cperl-mode.el (cperl-mode): Before adding to it, make
-       `compilation-error-regexp-alist' buffer-local, since we changed
-       `compilation-error-regexp-alist-alist' locally.
-
-2006-11-11  Juanma Barranquero  <lekktu@gmail.com>
-
-       * server.el (server-visit-files): Bind `minibuffer-auto-raise'
-       to the value of `server-raise-frame'.
-
-2006-11-11  Glenn Morris  <rgm@gnu.org>
-
-       * ido.el (ido-enable-prefix)
-       * ses.el (ses-call-printer-return)
-       * net/tramp.el (tramp-unified-filenames)
-       * progmodes/cc-align.el (c-lineup-string-cont)
-       * progmodes/compile.el (compilation-directory-matcher)
-       * progmodes/ebnf2ps.el (ebnf-stop-on-error)
-       * progmodes/vhdl-mode.el (vhdl-reset-active-high)
-       (vhdl-clock-rising-edge)
-       * textmodes/org.el (org-export-with-timestamps)
-       (org-export-remove-timestamps-from-toc)
-       (org-export-with-tags): Improve previous doc fixes.
-
-2006-11-11  Richard Stallman  <rms@gnu.org>
-
-       * textmodes/flyspell.el (flyspell-mode-map):
-       Bind C-c $ instead of M-RET.
-
-2006-11-10  Simon Marshall  <simon@gnu.org>
-
-       * progmodes/cc-fonts.el (c-font-lock-declarations): Don't overwrite
-       fontification for "case" and "default" keywords.
-
-2006-11-10  Andreas Schwab  <schwab@suse.de>
-
-       * calendar/cal-dst.el (calendar-dst-check-each-year-flag):
-       Avoid starting sentence with "nil".
-
-2006-11-10  Juanma Barranquero  <lekktu@gmail.com>
-
-       * server.el (server-raise-frame): New option.
-       (server-switch-buffer): Use it.
-
-2006-11-10  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-many-windows): Start doc string
-       with a capital.
-
-2006-11-10  Carsten Dominik  <carsten.dominik@gmail.com>
-
-       * textmodes/org.el (org-show-hierarchy-above)
-       (org-show-following-heading): Fix typo in default value.
-       (org-scan-tags): Make the search case-sensitive.
-       (org-tags-sparse-tree): Don't overrule
-       `org-show-following-heading' and `org-show-hierarchy-above'.
-       (org-reveal): New command.
-       (org-show-context): Rename from `org-show-hierarchy-above'.
-       (org-fast-tag-selection-single-key): New option.
-       (org-fast-tag-show-exit, org-set-current-tags-overlay): New functions.
-       (org-tags-overlay): New variable.
-       (org-agenda-todo-ignore-deadlines): New option.
-       ("session"): Add circular data structure `org-mark-ring' to
-       exceptions list in session.el.
-       (org-agenda-window-setup, org-agenda-restore-windows-after-quit):
-       New options.
-       (org-agenda-quit): Use `org-agenda-restore-windows-after-quit'.
-       (org-prepare-agenda, org-agenda-quit): Use `org-agenda-window-setup'.
-       (org-pre-agenda-window-conf, org-blank-before-new-entry): New vars.
-       (org-finalize-agenda): Activate bracket links in agenda.
-       (org-at-timestamp-p, org-at-date-range-p): Additional argument
-       INACTIVE-OK.
-       (org-show-hierarchy-above, org-show-following-heading):
-       List values allowed for fine-tuned configuration.
-       (org-show-hierarchy-above): New argument CONTEXT, use the
-       fine-tuned settings in `org-show-hierarchy-above' and
-       `org-show-following-heading'.
-       (org-display-custom-time): New function.
-       (org-toggle-time-stamp-overlays, org-insert-time-stamp): New function.
-       (org-display-custom-times, org-time-stamp-custom-formats):
-       (org-maybe-intangible): New macro.
-       (org-activate-bracket-links, org-hide-wide-columns):
-       Use `org-maybe-intangible'.
-       (org-open-file): Use `shell-quote-argument'.
-       (org-display-internal-link-with-indirect-buffer): New option.
-       (org-file-remote-p): Get regexp from list.
-       (org-link-expand-abbrev): New function.
-       (org-link-abbrev-alist): New option.
-       (org-open-at-point, org-cleaned-string-for-export):
-       Call `org-link-expand-abbrev'.
-       (org-timeline, org-agenda-list, org-todo-list)
-       (org-tags-view): Remove the KEEP-MODES argument.
-       (org-finalize-agenda-hook): New hook.
-       (org-get-alist-option): New function.
-       (org-follow-timestamp-link): New function.
-       (org-open-at-point): Call `org-follow-timestamp-link'.
-       (org-log-note-marker, org-log-note-purpose)
-       (org-log-note-window-configuration): New variables.
-       (org-add-log-maybe, org-add-log-note, org-store-log-note): New funs.
-       (org-log-note-headings): New option.
-       (org-dblock-write:clocktable): Bug fix, removed infinite loop.
-       (org-store-link): Support for dired-mode.
-       (org-open-file): Substitute environment variables into filename.
-       (org-last): New defsubst.
-       (org-agenda-re-align-tags): New function.
-       (org-agenda-align-tags-to-column): New option.
-       (org-agenda-timeline): Group removed.
-       (org-prepare-agenda, org-prepare-agenda-buffers)
-       (org-run-agenda-series, org-timeline, org-agenda-list)
-       (org-todo-list, org-tags-view): Call `org-agenda-prepare' and set
-       the text property inticating the agenda type.
-       (org-agenda-post-command-hook): Get agenda type from text property
-       at point.
-       (org-agenda): Handle command sets.  Set `org-agenda-last-arguments'
-       and obey `org-agenda-overriding-arguments'.
-       (org-agenda-overriding-arguments, org-agenda-last-arguments): New vars.
-       (org-agenda-goto-today, org-agenda-later, org-agenda-earlier)
-       (org-agenda-week-view, org-agenda-day-view):
-       Use `org-agenda-overriding-arguments' to make updating work with
-       multi-block agendas.
-       (org-agenda-prefix-format): Allow different formats for the
-       different agenda entry types.
-       (org-timeline-prefix-format): Option removed, use
-       `org-agenda-prefix-format' instead.
-       (org-prepare-agenda): New function.
-       (org-select-timeline-window): Option removed, use
-       `org-select-agenda-window' instead.
-       (org-respect-restriction): Variable removed.
-       (org-cmp-tag): New function.
-       (org-agenda-sorting-strategy, org-entries-lessp):
-       Implement sorting by last tag.
-       (org-complete): Better completion in in-buffer option lines.
-       (org-in-item-p): New function.
-       (org-org-menu): Add entries for checkboxes.
-       (org-cycle): Extra brouping in outline-regexp, because it is used
-       in a search with "^" prepended.
-       (org-provide-checkbox-statistics): New option.
-       (org-set-font-lock-defaults): Highlight checkbox statistics.
-       (org-update-checkbox-count-maybe)
-       (org-get-checkbox-statistics-face): New functions.
-       (org-update-checkbox-count): New command.
-       (org-insert-item, org-toggle-checkbox):
-       Call `org-update-checkbox-count-maybe'.
-       (org-export-as-html): XEmacs compatibility for coding system.
-       (org-force-cycle-archived): New command.
-       (org-cycle-hide-archived-subtrees): Display message when ARCHIVE
-       overrules cycling.
-       (org-fix-position-after-promote): If the line contains only a todo
-       keyword, add a final space.
-       (org-promote-subtree, org-demote-subtree):
-       Call `org-fix-position-after-promote'.
-
-2006-11-10  Glenn Morris  <rgm@gnu.org>
-
-       * calendar/cal-dst.el: Do not assume DST starts/ends on the same
-       date in every year.
-       (calendar-dst-check-each-year-flag): New customizable variable.
-       (calendar-dst-find-data): New function, extracted from
-       calendar-current-time-zone.
-       (calendar-current-time-zone): Use calendar-dst-find-data.
-       (calendar-dst-transition-cache): New variable.
-       (calendar-dst-find-startend, calendar-dst-starts)
-       (calendar-dst-ends): New functions.
-       (calendar-daylight-savings-starts)
-       (calendar-daylight-savings-ends): Change value to use
-       calendar-dst-starts, calendar-dst-ends; respectively.
-
-       * progmodes/f90.el (f90-indent-region): Bind case-fold-search to t.
-
-       * ido.el (ido-enable-prefix)
-       * ses.el (ses-call-printer-return)
-       * net/tramp.el (tramp-unified-filenames)
-       * progmodes/cc-align.el (c-lineup-string-cont)
-       * progmodes/compile.el (compilation-directory-matcher)
-       * progmodes/ebnf2ps.el (ebnf-stop-on-error)
-       * progmodes/gdb-ui.el (gdb-many-windows)
-       * progmodes/vhdl-mode.el (vhdl-reset-active-high)
-       (vhdl-clock-rising-edge)
-       * textmodes/org.el (org-export-with-timestamps)
-       (org-export-remove-timestamps-from-toc, org-export-with-tags)
-       (org-read-date): Doc fix (Nil -> nil).
-
-2006-11-10  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * term/x-win.el (x-select-text, x-cut-buffer-or-selection-value):
-       Encode/decode text to/from cut buffers to/from iso-latin-1 only.
-
-2006-11-10  Juanma Barranquero  <lekktu@gmail.com>
-
-       * bs.el (bs--window-for-buffer): Remove.
-       (bs--show-with-configuration): Use `get-window-with-predicate'
-       instead of `bs--window-for-buffer'.
-
-2006-11-10  Kenichi Handa  <handa@m17n.org>
-
-       * files.el (revert-buffer): Fix previous change.
-
-2006-11-09  Juanma Barranquero  <lekktu@gmail.com>
-
-       * bs.el (bs--redisplay): Fix typo in docstring.
-       (bs--window-config-coming-from): Make frame-local.
-       (bs--restore-window-config): New function.
-       (bs-kill, bs-select, bs-select-other-window)
-       (bs-select-other-frame): Use it.
-       (bs--window-for-buffer): Return as soon as a matching buffer is found.
-       (bs--show-with-configuration): Save the window configuration as a
-       frame local var, and only if *buffer-selection* is not already
-       visible on this frame.
-
-2006-11-08  Chong Yidong  <cyd@stupidchicken.com>
-
-       * vc-svn.el (vc-svn-admin-directory): New var.
-       (vc-svn-registered, vc-svn-responsible-p)
-       (vc-svn-repository-hostname): Use it.
-       Suggested by arit93@yahoo.com.
-
-2006-11-08  Juanma Barranquero  <lekktu@gmail.com>
-
-       * ldefs-boot.el: Regenerate.
-
-2006-11-08  Alan Mackenzie  <acm@muc.de>
-
-       * emacs-lisp/lisp.el (beginning-of-defun-raw): Code up the
-       case (eq open-paren-in-column-0-is-defun-start nil) by searching
-       for least nested open-paren.
-
-2006-11-08  Romain Francoise  <romain@orebokech.com>
-
-       * subr.el (remove-overlays): Fix typo in last change.
-
-2006-11-08  Richard Stallman  <rms@gnu.org>
-
-       * subr.el (remove-overlays): Call overlay-recenter.
-
-2006-11-08  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
-
-       * printing.el (pr-alist-custom-set, pr-ps-utility-custom-set)
-       (pr-ps-name-custom-set, pr-txt-name-custom-set): Return back the old
-       behaviour.
-       (pr-menu-bind): Act on global-map instead of menu-bar-file-menu
-       directly.
-
-2006-11-08  Juanma Barranquero  <lekktu@gmail.com>
-
-       * ido.el (ido-ignore-extensions, ido-show-dot-for-dired)
-       (ido-max-dir-file-cache, ido-decorations)
-       (ido-rewrite-file-prompt-functions, ido-use-mycompletion-depth)
-       (ido-magic-backward-char, ido-enter-dired)
-       (ido-enter-insert-buffer, ido-enter-insert-file, ido-dired)
-       (ido-list-directory, ido-first-match, ido-only-match)
-       (ido-subdir, ido-indicator): Fix typos in docstrings.
-       (ido-buffer-internal, ido-completion-help): Fix typos in messages.
-       (ido-read-internal): Fix typo in error message.
-
-2006-11-08  Kenichi Handa  <handa@m17n.org>
-
-       * international/mule-cmds.el (set-default-coding-systems):
-       Always set default-file-name-coding-system to utf-8 for Mac Darwin.
-
-2006-11-08  Juanma Barranquero  <lekktu@gmail.com>
-
-       * makefile.w32-in (setwins): Remove.
-       (WINS_ALMOST): New macro.
-       (WINS): Use it.
-       (autoloads): Don't extract autoloads from files in obsolete/.
-
-2006-11-07  Chong Yidong  <cyd@stupidchicken.com>
-
-       * whitespace.el (whitespace-buffer): Call remove-overlays after
-       overlay-recenter for performance.  Suggested by Martin Rudalics.
-
-2006-11-07  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/tramp.el (tramp-default-method): scp is the default method.
-
-2006-11-07  Juanma Barranquero  <lekktu@gmail.com>
-
-       * server.el (server-start): Save also the Emacs pid in the server file.
-
-2006-11-07  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/reftex-cite.el (reftex-pop-to-bibtex-entry): Preserve
-       point when displaying a bibtex cross reference in the echo area.
-
-2006-11-06  Juanma Barranquero  <lekktu@gmail.com>
-
-       * international/mule.el (make-char): Fix typo in docstring.
-       (load-with-code-conversion, charsetp): Doc fixes.
-
-       * international/ja-dic-cnv.el (skkdic-convert):
-       * cus-edit.el (hook): Fix typo in docstring.
-
-2006-11-06  Chong Yidong  <cyd@stupidchicken.com>
-
-       * cus-edit.el (custom-mode-map): Move defvar above code using it.
-       (custom-mode-link-map): New variable.
-       (custom-group-link, custom-manual): Use follow-link.
-
-2006-11-06  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
-
-       * textmodes/bibtex.el: Fix typo in name of author of bibtex.el,
-       "Mark Shapiro" -> "Marc Shapiro".  Update his email address.
-
-2006-11-06  Richard Stallman  <rms@gnu.org>
-
-       * textmodes/flyspell.el (flyspell-correct-word-before-point):
-       New function broken out of flyspell-correct-word.
-       (flyspell-mode-map): Bind it to M-RET.
-       (flyspell-correct-word): Call it.
-
-       * textmodes/fill.el (fill-minibuffer-function): New function.
-       (fill-paragraph): Bind fill-paragraph-function to
-       fill-minibuffer-function.
-
-       * ruler-mode.el (ruler-mode-map): Add bindings for up-events
-       so that they aren't undefined.
-
-       * dired.el (dired-readin): Locally bind file-name-coding-system.
-
-       * bindings.el: Shorten and clarify usual mode line mouse help string.
-
-       * Makefile.in (autoloads): Don't include `obsolete'.
-
-2006-11-06  Chong Yidong  <cyd@stupidchicken.com>
-
-       * printing.el (pr-alist-custom-set, pr-ps-utility-custom-set)
-       (pr-ps-name-custom-set, pr-txt-name-custom-set): Don't update the
-       Printing menu if it's not initialized.
-       (pr-menu-bind): Act on menu-bar-file-menu directly.
-
-2006-11-06  Juanma Barranquero  <lekktu@gmail.com>
-
-       * help.el (view-emacs-news): Fix typo in error message.
-
-       * menu-bar.el (menu-bar-update-buffers): Fix typo in menu entry.
-
-       * shadowfile.el (shadow-define-regexp-group)
-       (shadow-literal-groups, shadow-insert-var): Doc fixes.
-       (shadow-read-files): Fix typo in message.
-       (shadow-inhibit-overload, shadow-find, shadow-suffix)
-       (shadow-site-match, shadow-write-todo-file, shadow-insert-var)
-       (shadow-suffix, shadow-site-match, shadow-expand-file-name)
-       (shadow-file-match): Fix typos in docstrings.
-
-       * terminal.el (terminal-emulator): Fix typo in message.
-
-       * emacs-lisp/authors.el (authors-fixed-entries): Fix typo.
-
-       * emacs-lisp/lselect.el (x-kill-primary-selection)
-       (x-delete-primary-selection, x-copy-primary-selection):
-       Fix typos in error messages.
-
-       * emulation/edt-mapper.el: Fix typo in interactive message.
-
-       * mail/emacsbug.el (report-emacs-bug): Fix typos in output message.
-
-       * textmodes/ispell.el (ispell, ispell-local-dictionary-alist)
-       (ispell-help): Fix typos in docstrings.
-       (ispell-help): Fix typo in output message.
-
-       * allout.el (allout-adjust-file-variable)
-       (allout-passphrase-verifier-string)
-       (allout-passphrase-hint-string)
-       (allout-toggle-current-subtree-encryption):
-       * apropos.el (apropos-synonyms):
-       * cus-edit.el (hook):
-       * emacs-lock.el (emacs-lock-from-exiting):
-       * follow.el (follow-avoid-tail-recenter-p):
-       * hexl.el (hexl-mode):
-       * mouse-copy.el (mouse-copy-work-around-drag-bug):
-       * mouse.el (mouse-set-font):
-       * resume.el (resume-emacs-args-file):
-       * rfn-eshadow.el (file-name-shadow-tty-properties):
-       * t-mouse.el (t-mouse-process, t-mouse-mode):
-       * emacs-lisp/cust-print.el (custom-print-install)
-       (custom-print-uninstall, custom-format):
-       * emacs-lisp/shadow.el (list-load-path-shadows):
-       * emulation/tpu-edt.el (tpu-help-text)
-       (tpu-save-all-buffers-kill-emacs, tpu-emacs-replace)
-       (tpu-reset-control-keys):
-       * emulation/vip.el (vip-emacs-local-map)
-       (vip-change-mode-to-emacs):
-       * emulation/viper.el (viper-mode, viper-set-hooks)
-       (viper-major-mode-modifier-list):
-       * emulation/viper-init.el (viper-emacs-state-cursor-color):
-       * emulation/viper-keym.el (viper-emacs-kbd-map)
-       (viper-toggle-key):
-       * mail/feedmail.el (feedmail-queue-reminder)
-       (feedmail-queue-reminder-alist, feedmail-confirm-outgoing)
-       (feedmail-confirm-outgoing-timeout, feedmail-nuke-bcc)
-       (feedmail-nuke-resent-bcc, feedmail-fill-to-cc-fill-column)
-       (feedmail-sender-line, feedmail-force-binary-write)
-       (feedmail-from-line, feedmail-deduce-envelope-from)
-       (feedmail-x-mailer-line, feedmail-message-id-generator)
-       (feedmail-date-generator, feedmail-fiddle-plex-user-list)
-       (feedmail-enable-spray, feedmail-spray-this-address)
-       (feedmail-spray-address-fiddle-plex-list, feedmail-enable-queue)
-       (feedmail-queue-runner-confirm-global)
-       (feedmail-ask-before-queue-prompt)
-       (feedmail-ask-before-queue-reprompt)
-       (feedmail-prompt-before-queue-standard-alist)
-       (feedmail-prompt-before-queue-user-alist)
-       (feedmail-prompt-before-queue-help-supplement)
-       (feedmail-queue-use-send-time-for-message-id)
-       (feedmail-queue-default-file-slug, feedmail-queue-fqm-suffix)
-       (feedmail-mail-send-hook-splitter, feedmail-mail-send-hook)
-       (feedmail-mail-send-hook-queued)
-       (feedmail-confirm-addresses-hook-example)
-       (feedmail-last-chance-hook, feedmail-before-fcc-hook)
-       (feedmail-queue-runner-mode-setter)
-       (feedmail-queue-alternative-mail-header-separator)
-       (feedmail-queue-runner-message-sender)
-       (feedmail-buffer-eating-function, feedmail-binmail-template)
-       (feedmail-run-the-queue-no-prompts)
-       (feedmail-run-the-queue-global-prompt)
-       (feedmail-queue-subject-slug-maker, feedmail-fiddle-header)
-       (feedmail-envelope-deducer, feedmail-fiddle-date)
-       (feedmail-default-message-id-generator)
-       (feedmail-fiddle-message-id, feedmail-fiddle-x-mailer)
-       (feedmail-fiddle-spray-address, feedmail-deduce-address-list):
-       * mail/vms-pmail.el (vms-pmail-save-and-exit, vms-pmail-abort)
-       (vms-pmail-setup):
-       * play/dunnet.el (dun-help):
-       * play/handwrite.el (handwrite):
-       * play/hanoi.el (hanoi-unix-64):
-       * progmodes/idlwave.el (idlwave-rescan-asynchronously):
-       * textmodes/enriched.el (fixed):
-       * textmodes/org.el (org-file-apps)
-       (org-emphasis-regexp-components, org-emphasis-alist):
-       * textmodes/texinfmt.el (batch-texinfo-format):
-       Fix typos in docstrings.
-
-2006-11-05  Juanma Barranquero  <lekktu@gmail.com>
-
-       * loadhist.el (read-feature): Don't complete features not loaded
-       from a file (which make `unload-feature' to fail).
-
-2006-11-05  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * add-log.el (add-log-time-zone-rule): Mark as safe-local-variable.
-
-2006-11-05  Chong Yidong  <cyd@stupidchicken.com>
-
-       * startup.el (command-line-1): Kill emacs if the last frame is
-       deleted while evaluating the command-line arguments.
-
-2006-11-05  Richard Stallman  <rms@gnu.org>
-
-       * startup.el (init-file-had-error): Add doc string.
-       (fancy-splash-text, fancy-splash-head, fancy-splash-tail):
-       Use fixed-width font for keyboard key descriptions.
-
-       * cus-edit.el (custom-save-all): Error if saving in .emacs
-       and it had an error when loaded.
-
-       * dired-aux.el (dired-copy-file-recursive): Catch errors
-       from recursive copies in the loop, around the recursive call.
-
-2006-11-05  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac@lrde.org>
-
-       * battery.el (battery-linux-proc-acpi): Search an ac_adapter in
-       `/proc/acpi/ac_adapter/*'.  Ditto for the thermometers in
-       `/proc/acpi/thermal_zone/*'.
-       (battery-search-for-one-match-in-files): New.  Search a regexp in
-       the content of some files.
-
-2006-11-05  Martin Rudalics  <rudalics@gmx.at>
-
-       * window.el (mouse-autoselect-window-now): Remove variable.
-       (mouse-autoselect-window-state): New variable.
-       (mouse-autoselect-window-start, mouse-autoselect-window-cancel)
-       (mouse-autoselect-window-select, handle-select-window):
-       Rewritten to make mouse-autoselect-window-timer a one-shot timer.
-       Suspend delayed autoselection during menu or popup dialog.
-
-       * info-look.el (info-lookup-guess-custom-symbol): New function
-       for retrieving symbol at point in custom buffers.
-       (top level) <info-lookup-maybe-add-help>: Add backquote and
-       comma to ignored characters in regexps of help specifications
-       for emacs-lisp-mode and lisp-interaction-mode.  This permits
-       looking up symbols in `...' and after a comma.  Add help
-       specifications for custom-mode and help-mode.
-
-2006-11-04  Eli Zaretskii  <eliz@gnu.org>
-
-       * mail/rmail.el (rmail-redecode-body): New optional argument RAW.
-       Don't encode body if RAW is non-nil, or if the old encoding is
-       identical to the new encoding, or if the body contains only
-       eight-bit-* characters.
-
-2006-11-04  Yoni Rabkin Katzenell  <yoni-r@actcom.com>  (tiny change)
-
-       * faces.el (faces-sample-overlay, describe-face): Revert last changes.
-       (faces-sample-overlay): Remove variable.
-       (describe-face): Insert sample text in the face being described.
-
-2006-11-04  Martin Rudalics  <rudalics@gmx.at>
-
-       * whitespace.el (whitespace-indent-regexp): Make this match any
-       multiples of eight spaces near the beginning of a line.
-       (whitespace-buffer): Use `remove-overlays' instead of
-       `whitespace-unhighlight-the-space' and `overlay-recenter' to
-       speed up overlay handling.
-       (whitespace-buffer-leading, whitespace-buffer-trailing):
-       Make these functions highlight the text removed by
-       `whitespace-buffer-leading-cleanup' and
-       `whitespace-buffer-trailing-cleanup' respectively.
-       (whitespace-buffer-search): Use `with-local-quit'.
-       Move `format' out of loop to speed up scanning larger buffers.
-       (whitespace-unhighlight-the-space): Remove `remove-hook' since
-       that function is never added to a hook.
-       (whitespace-spacetab-regexp, whitespace-ateol-regexp)
-       (whitespace-buffer-leading-cleanup)
-       (whitespace-refresh-rescan-list): Fix docstrings.
-
-2006-11-03  Ken Manheimer  <ken.manheimer@gmail.com>
-
-       * allout.el (allout-during-yank-processing): Cue for inhibiting
-       aberrance processing during yanks.
-       (allout-doublecheck-at-and-shallower): Reduce the limit to reduce
-       the amount of yanked topics that can be aberrant.
-       (allout-do-doublecheck): Encapsulate this multiply-used recipe in
-       a function, and supplement with inihibition of doublechecking
-       during yanks.
-       (allout-beginning-of-line, allout-next-heading)
-       (allout-previous-heading, allout-goto-prefix-doublechecked)
-       (allout-back-to-current-heading, allout-next-visible-heading)
-       (allout-next-sibling): Use new allout-do-doublecheck function.
-       (allout-next-sibling): Ensure we made progress when returning
-       other than nil.
-       (allout-rebullet-heading): Preserve text property annotations
-       indicating the text was hidden, if it was.
-       (allout-kill-line): Remove any added was-hidden annotations.
-       (allout-kill-topic): Remove any added was-hidden annotations.
-       (allout-annotate-hidden): Inhibit adding was-hidden text
-       properties to the undo list.
-       (allout-deannotate-hidden): New function to remove was-hidden
-       annotation.
-       (allout-hide-by-annotation): Use new allout-deannotate-hidden.
-       (allout-remove-exposure-annotation): Replace by
-       allout-deannotate-hidden.
-       (allout-yank-processing): Signal that yank processing is happening
-       with allout-during-yank-processing.  Also, wrap
-       allout-unprotected's closer to the text changes, for easier
-       debugging.  We need to inhibit-field-text-motion explicitly, in
-       lieu of the encompassing allout-unprotected.
-       (outlineify-sticky): Adjust criteria for triggering new outline
-       decorations to presence or absence of any topics, not just a topic
-       at the beginning of the buffer.
-
-2006-11-03  Juanma Barranquero  <lekktu@gmail.com>
-
-       * bs.el (bs--show-all, bs--redisplay):
-       * cus-edit.el (custom-unlispify-menu-entries)
-       (custom-unlispify-tag-names, custom-prompt-variable):
-       * expand.el (expand-pos):
-       * speedbar.el (speedbar-generic-list-tag-p):
-       * wid-edit.el (widget-image-enable):
-       * emacs-lisp/checkdoc.el (checkdoc-rogue-space-check-engine):
-       * emacs-lisp/find-func.el (find-function-noselect)
-       (find-function, find-variable-noselect, find-variable)
-       (find-definition-noselect, find-face-definition):
-       * mail/rmail-spam-filter.el (rsf-scanning-messages-now):
-       * net/eudc-vars.el (eudc-expansion-overwrites-query):
-       * progmodes/ada-xref.el (ada-find-in-ali):
-       * textmodes/flyspell.el (flyspell-check-tex-math-command):
-       * textmodes/org.el (org-copy-subtree):
-       * textmodes/table.el (table--row-column-insertion-point-p):
-       Use "non-nil" in docstrings.
-
-2006-11-03  Mark Davies  <mark@mcs.vuw.ac.nz>
-
-       * sort.el (sort-columns): Set the field separator to tab; on
-       NetBSD, sort complains if "\n" is used as field separator.
-
-2006-11-03  NIIMI Satoshi  <sa2c@sa2c.net>
-
-       * emacs-lisp/pp.el (pp-eval-last-sexp): Evaluate target sexp.
-
-2006-11-02  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * server.el (server-auth-key): Remove.  Replace by a process-property.
-       (server-start): Don't remove the file of the previous process, but
-       instead clear out the place for the new file.
-       (server-start): Set the :auth-key property.
-       (server-process-filter): Use the :auth-key property.
-
-2006-11-02  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-mode-map): No longer copy
-       `outline-mode-map' explicitly - this is already done by
-       `define-derived-mode'.
-
-2006-11-02  Juanma Barranquero  <lekktu@gmail.com>
-
-       * server.el (server-visit-files): Use `when'.
-       (server-process-filter): When authentication fails, send error
-       message to client.  Wrap `process-send-region' in `ignore-errors'
-       instead of `condition-case', and remove misleading comment.
-
-2006-11-01  Juri Linkov  <juri@jurta.org>
-
-       * simple.el (yank): Doc fix.
-
-2006-11-01  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * server.el: Try and fit within 80 columns.
-       (server-start): Make the auth file unreadable by other users.
-
-2006-10-31  Andreas Seltenreich  <uwi7@rz.uni-karlsruhe.de>
-
-       * battery.el (battery-linux-proc-acpi): Prevent range error when
-       `full-capacity' is 0.
-
-2006-10-31  Yoni Rabkin Katzenell  <yoni-r@actcom.com>  (tiny change)
-
-       * faces.el (faces-sample-overlay): New defvar.
-       (faces-sample-overlay): New function to show face sample text.
-       (describe-face): Use it.
-
-2006-10-31  Stephen Leake  <stephen_leake@stephe-leake.org>
-
-       * progmodes/ada-stmt.el: Change maintainer, apply
-       whitespace-cleanup, checkdoc.
-       (ada-func-or-proc-name): Add doc string.
-
-       * progmodes/ada-prj.el (ada-prj-new): Change maintainer, apply
-       whitespace-cleanup, checkdoc.  Minor improvements to many doc
-       strings and comments.
-       (ada-prj-display-page): Change buffer name to more accurately
-       reflect function.
-
-       * progmodes/ada-xref.el: Change maintainer, apply
-       whitespace-cleanup, checkdoc.  Minor improvements to many doc
-       strings and comments.  Don't look for `gvd' or `ddd' debuggers.
-       (ada-compile-current): Don't add newlines to commands.
-
-2006-10-31  Juanma Barranquero  <lekktu@gmail.com>
-
-       * server.el: Add support for TCP sockets.
-       (server-use-tcp, server-host, server-auth-dir): New options.
-       (server-auth-key): New variable.
-       (server-ensure-safe-dir): Create nonexistent parent dirs.
-       Ignore Unix-style file modes on Windows.
-       (server-start): Crete a TCP or Unix socket according to the value
-       of `server-use-tcp'.  For TCP sockets, create the id/auth file in
-       `server-auth-dir' directory.
-       (server-process-filter): Delete process if authentication
-       fails (which never happens for Unix sockets).
-
-2006-10-30  David Kastrup  <dak@gnu.org>
-
-       * subr.el (add-to-list): Don't continue checking if a match has
-       been found.
-
-2006-10-30  Chong Yidong  <cyd@stupidchicken.com>
-
-       * tutorial.el: Move defvars to avoid bytecomp warnings.
-       (tutorial--find-changed-keys): Check if viper-current-state is
-       bound before using it.
-       (help-with-tutorial): Check if viper-tutorial is defined before
-       using it.
-
-2006-10-30  Lennart Borgman  <lennart.borgman.073@student.lu.se>
-
-       * help-fns.el (help-with-tutorial): Move to tutorial.el.
-
-       * tutorial.el: New file.
-       (help-with-tutorial): Move here from help-fns.el. Added help for
-       rebound keys.  Fixed resume of tutorial.
-       (tutorial--describe-nonstandard-key, tutorial--sort-keys)
-       (tutorial--find-changed-keys, tutorial--display-changes)
-       (tutorial--saved-dir, tutorial--saved-file)
-       (tutorial--save-tutorial): New functions to support the changes in
-       help-with-tutorial.
-
-2006-10-30  Kenichi Handa  <handa@m17n.org>
-
-       * files.el (revert-buffer): If a unibyte buffer is being reverted
-       with a coding system for multibyte, set buffer multibyte before
-       calling insert-file-contents.
-
-2006-10-30  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * server.el (server-select-display): Use a dummy buffer to detect when
-       the frame is later used.
-       (server-select-display): New function.
-       (server-process-filter): Use it to detect unused temp frames.
-
-2006-10-29  Stephen Leake  <stephen_leake@stephe-leake.org>
-
-       * progmodes/ada-mode.el: Change maintainer, apply
-       whitespace-clean, checkdoc.  Minor improvements to many doc strings.
-       (ada-mode-version): New function.
-       (ada-create-menu): Menu operations are available for all supported
-       compilers.
-
-2006-10-29  Lars Hansen  <larsh@soem.dk>
-
-       * net/tramp.el (with-parsed-tramp-file-name): Correct debug spec.
-       Highlight as keyword.
-       (tramp-do-copy-or-rename-file): Correct data for 'file-already-exists.
-       Don't call tramp-method-out-of-band-p for local files.
-       (tramp-touch): Quote file name.
-
-2006-10-28  Glenn Morris  <rgm@gnu.org>
-
-       * calendar/calendar.el (cal-html-cursor-month)
-       (cal-html-cursor-year): Add autoloads for this new package.
-       (calendar-mode-map): Bind cal-html-cursor-month, cal-html-cursor-year.
-
-2006-10-28  Anna M. Bigatti  <bigatti@dima.unige.it>
-
-       * calendar/cal-html.el: New file.
-
-2006-10-28  Chong Yidong  <cyd@stupidchicken.com>
-
-       * emacs-lisp/authors.el (authors-aliases): Update.
-
-2006-10-27  Chong Yidong  <cyd@stupidchicken.com>
-
-       * version.el (emacs-version): Bump version number to 22.0.90.
-
-2006-10-26  John W. Eaton  <jwe@octave.org>
-
-       * progmodes/octave-inf.el (inferior-octave-has-built-in-variables):
-       New defvar.
-       (inferior-octave-resync-dirs): Check to see whether Octave has
-       built-in variables and set inferior-octave-has-built-in-variables.
-       Check inferior-octave-has-built-in-variables to decide whether to
-       send commands that set built-in variables or call functions to
-       change Octave's behavior.
-       Send "disp (pwd ())" to Octave instead of just "pwd".
-       (inferior-octave-startup): Send "more off" to Octave instead of
-       "page_screen_output = 0".
-
-2006-10-26  Chong Yidong  <cyd@stupidchicken.com>
-
-       * emacs-lisp/cl-indent.el (lisp-indent-259): Indent nil's in the
-       pattern normally.
-
-2006-10-26  Nick Roberts  <nickrob@snap.net.nz>
-
-       * bindings.el (mode-line-mode-menu): Remove bindings for global
-       minor modes (line/column number) as they are on the menubar.
-
-2006-10-25  Juanma Barranquero  <lekktu@gmail.com>
-
-       * term/w32-win.el (x-handle-name-switch): Doc fix.
-       (w32-standard-fontset-spec): Fix typo in docstring.
-
-       * midnight.el (midnight-buffer-display-time): Doc fix.
-       (clean-buffer-list-kill-never-buffer-names): Add "*server*".
-
-2006-10-23  Michael Kifer  <kifer@cs.stonybrook.edu>
-
-       * viper-cmd.el (viper-prefix-arg-com): Define gg as G0.
-
-       * viper-ex.el (ex-read): Quote file argument.
-
-       * ediff-diff.el (ediff-same-file-contents): Expand file names.
-
-       * ediff-mult.el (ediff-append-custom-diff): Quote shell file arguments.
-
-2006-10-22  Martin Rudalics  <rudalics@gmx.at>
-
-       * textmodes/flyspell.el (flyspell-check-region-doublons):
-       Fix last fix.
-
-2006-10-23  Nick Roberts  <nickrob@snap.net.nz>
-
-       * bindings.el (mode-line-mode-menu): List global minor modes
-       before local ones.
-
-2006-10-23  Kim F. Storm  <storm@cua.dk>
-
-       * subr.el (add-to-list): Optimize if compare-fn is `eq' or `eql'.
-       (sit-for): If last command was a prefix arg, add the read-ahead
-       event to unread-command-events as (t . EVENT) so it will be added
-       to this-command-keys by read-key-sequence.
-
-2006-10-22  Martin Rudalics  <rudalics@gmx.at>
-
-       * textmodes/flyspell.el (flyspell-word): Skip past all previous
-       whitespace when checking doublons.
-       (flyspell-check-region-doublons): Fix doublon regexp.
-       (flyspell-highlight-incorrect-region): Highlight doublons using
-       flyspell-duplicate face.
-
-       * progmodes/cperl-mode.el (cperl-invalid-face): Fix defcustom.
-
-2006-10-22  John Wiegley  <johnw@newartisans.com>
-
-       * progmodes/python.el (python-use-skeletons): python-mode was
-       auto-inserting templates (for those with abbrev-mode on), not only
-       by default -- *but without a configuration variable to disable
-       it*.  This rendered python-mode completely useless for me, so I
-       have added `python-use-skeletons', which is now off by default.
-
-2006-10-22  Chong Yidong  <cyd@stupidchicken.com>
-
-       * progmodes/cperl-mode.el (cperl-mode): Don't assume
-       font-lock-multiline is auto-local (it's not).
-       (cperl-windowed-init): Ensure that cperl-font-lock-multiline is
-       initialized before calling cperl-init-faces.
-
-2006-10-22  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-info-stack-custom): Don't try to give
-       gdb-stack-position a value when there is no fringe.
-
-       * bindings.el (mode-line-mode-menu): Disable auto-revert-tail-mode
-       indicator if not visiting a file.
-
-2006-10-20  David Kastrup  <dak@gnu.org>
-
-       * window.el (kill-buffer-and-window): Fix a bug where an aborted
-       operation would still cause some window to collapse later.
-
-2006-10-20  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * vc.el (vc-switch-backend): Try to be more careful with unwanted
-       side-effect due to mixing various backends's file properties.
-
-       * vc-svn.el (vc-svn-parse-status): Remove unused arg `localp'.
-       Add arg `filename' instead.  Don't set vc-backend if `filename' is set.
-       Return `filename's status if applicable.  Update callers.
-
-2006-10-19  Kenichi Handa  <handa@m17n.org>
-
-       * international/kkc.el (kkc-region): When a key sequence is not
-       defined, append (this-single-command-raw-keys) to
-       unread-input-method-events.
-
-2006-10-19  Juanma Barranquero  <lekktu@gmail.com>
-
-       * progmodes/ada-mode.el (ada-in-string-p): Doc fix.
-
-2006-10-19  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * version.el (emacs-version): Use mac-carbon-version-string.
-
-       * term/macterm.el (res-geometry): Apply 2006-10-18 change for x-win.el.
-
-2006-10-19  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * select.el (ccl-check-utf-8, string-utf-8-p): New functions (by
-       Kenichi Handa).
-       (xselect-convert-to-string): Decline requests for UTF8_STRING if
-       the selection is not UTF-8.
-
-2006-10-18  Juanma Barranquero  <lekktu@gmail.com>
-
-       * progmodes/ada-mode.el (ada-83-string-keywords)
-       (ada-last-which-function-line ada-no-auto-case, ada-indent-region)
-       (ada-which-compiler, ada-align-modes, ada-adjust-case-buffer)
-       (ada-looking-at-semi-private, ada-get-body-name):
-       Fix typos in docstrings.
-       (ada-create-case-exception, ada-create-case-exception-substring):
-       Fix typos in error messages.
-       (ada-goto-matching-end, ada-narrow-to-defun): Doc fixes.
-
-2006-10-18  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * term/x-win.el (res-geometry): Don't set geometry from Xresources
-       to default-frame-alist if default-frame-alist already contains
-       width/height.
-
-2006-10-18  Richard Stallman  <rms@gnu.org>
-
-       * emacs-lisp/pp.el (pp-eval-expression): Use `X' to read value.
-       Non-interactive arg is the value, not the expression.
-
-       * simple.el (read-expression-map): Just set it, no defvar.
-
-       * subr.el (insert-for-yank-1): If last inserted char has
-       properties, mark them as rear-nonsticky.
-
-       * recentf.el (recentf-mode): Doc fix.
-
-       * facemenu.el (facemenu-add-new-face): Defend against symbol
-       that isn't a face name.
-
-       * dired-aux.el (dired-do-copy): Doc fix.
-
-2006-10-18  Chong Yidong  <cyd@stupidchicken.com>
-
-       * simple.el (line-move-1): Ignore fields when moving to the
-       beginning of line to avoid getting point stuck.
-
-2006-10-18  Martin Rudalics  <rudalics@gmx.at>
-
-       * textmodes/flyspell.el (flyspell-word-search-backward):
-       Set inhibit-point-motion-hooks to avoid looping due to intangibile
-       text.
-
-2006-10-16  Richard Stallman  <rms@gnu.org>
-
-       * help-fns.el (describe-function-1): Special case optimization
-       for self-insert-command.
-
-2006-10-16  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-reread-directory): Work in `dir' mode too.
-
-2006-10-15  Martin Rudalics  <rudalics@gmx.at>
-
-       * textmodes/table.el: Require 'regexp-opt.
-
-2006-10-15  Lennart Borgman  <lennart.borgman.073@student.lu.se>
-
-       * progmodes/flymake.el (flymake-get-project-include-dirs-imp):
-       Use shell-quote-argument.
-
-       * shell.el (explicit-bash-args): Likewise.
-
-       * progmodes/ada-xref.el (ada-find-in-src-path): Likewise.
-       Use grep -E rather than egrep.
-
-2006-10-15  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac@lrde.org>
-
-       * ido.el (ido-exhibit): Allow `-', `_', and trailing `$' in user id.
-
-2006-10-15  Kim F. Storm  <storm@cua.dk>
-
-       * filesets.el (filesets-run-cmd--repl-fn): Use shell-quote-argument.
-
-2006-10-14  Lennart Borgman  <lennart.borgman.073@student.lu.se>
-
-       * filesets.el (filesets-cmd-shell-command): Quote buffer-file-name
-       to protect whitespace and metacharacters from the shell.
-
-2006-10-13  Giorgos Keramidas  <keramida@ceid.upatras.gr>  (tiny change)
-
-       * apropos.el (apropos-pattern-quoted): Fix a typo in a doc string.
-
-2006-10-13  Eli Zaretskii  <eliz@gnu.org>
-
-       * subr.el (start-process-shell-command): Doc fix.
-
-2006-10-13  Andrea Russo  <rastandy@salug.it>  (tiny change)
-
-       * info-look.el <maxima-mode, inferior-maxima-mode>: Allow [0-9] in
-       the regexp for Maxima symbols.
-
-2006-10-13  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * vc-hooks.el (vc-ignore-dir-regexp): Make it into a defcustom.
-       (vc-find-root): Don't walk higher up than ~.
-
-2006-10-12  Chong Yidong  <cyd@stupidchicken.com>
-
-       * international/utf-8.el (utf-translate-cjk-load-tables):
-       Avoid clobbering last-coding-system-used during load.
-
-2006-10-12  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/reftex-global.el (reftex-create-tags-file):
-       Quote file arguments.
-
-2006-10-12  Richard Stallman  <rms@gnu.org>
-
-       * files.el (file-name-history): Add defvar.
-       (save-some-buffers-action-alist): Improve description strings.
-
-2006-10-12  Andreas Schwab  <schwab@suse.de>
-
-       * files.el (auto-mode-alist): Match change log file name also with
-       a dash before a numeric extension.
-
-2006-10-11  Ilya Zakharevich  <ilyaz@cpan.org>
-
-       * progmodes/cperl-mode.el: Merge from upstream, upto version 5.22.
-       After 5.0:
-       (cperl-add-tags-recurse-noxs-fullpath): New function (for -batch mode).
-
-       After 5.1: Major edit.  Summary of most visible changes:
-
-       - Multiple <<HERE per line allowed.
-       - Handles multiline subroutine declaration headers (with comments).
-         (The exception is `cperl-etags' - but it is not used in the rest
-         of the mode.)
-       - Fontifies multiline my/our declarations (even with comments,
-         and with legacy `font-lock').
-       - Major speedup of syntaxification, both immediate and postponed
-         (3.5x to 15x [for different CPUs and versions of Emacs] on the
-         huge real-life document I tested).
-       - New bindings, edits to imenu.
-       - "_" is made into word-char during fontification/syntaxification;
-         some attempts to recognize non-word "_" during other operations too.
-       - Detect bug in Emacs with `looking-at' inside `narrow' and bulk out.
-       - autoload some more perldoc-related stuff
-       - New convenience features: ISpell POD/HEREDOCs, narrow-to-HEREDOC.
-       - Attempt to incorporate XEmacs edits which reached me.
-
-       Fine-grained changelog:
-       (cperl-hook-after-change): New configuration variable.
-       (cperl-vc-sccs-header): Likewise.
-       (cperl-vc-sccs-header): Likewise.
-       (cperl-vc-header-alist): Default via two preceding variables.
-       (cperl-invalid-face): Remove double quoting under XEmacs
-               (still needed under 21.2).
-       (cperl-tips): Update URLs for resources.
-       (cperl-problems): Likewise.
-       (cperl-praise): Mention new features.
-       New C-c key bindings: for `cperl-find-bad-style',
-       `cperl-pod-spell', `cperl-here-doc-spell', `cperl-narrow-to-here-doc',
-       `cperl-perdoc', and `cperl-perldoc-at-point'.
-       CPerl Mode menu changes: "Fix style by spaces", "Imenu on Perl Info"
-       moved, new submenu of Tools with Ispell entries and narrowing.
-       (cperl-after-sub-regexp): New defsubst.
-       (cperl-imenu--function-name-regexp-perl): Use `cperl-after-sub-regexp'.
-               Allows heads up to head4.
-               Allow "package;".
-       (defun-prompt-regexp): Use `cperl-after-sub-regexp'.
-       (paren-backwards-message): ??? Something for XEmacs???
-       (cperl-mode): Never auto-switch abbrev-mode off.
-               Try to allow '_' be non-word char.
-               Do not use `font-lock-unfontify-region-function' on XEmacs.
-               Reset syntax cache on mode start.
-               Support multiline facification (even on legacy `font-lock').
-       (cperl-facemenu-add-face-function): ??? Some contributed code ???
-       (cperl-after-change-function): Since `font-lock' and `lazy-lock'
-               refuse to inform us whether the fontification is due to lazy
-               calling or due to edit to a buffer, install our own hook
-               (controlled by `cperl-hook-after-change').
-       (cperl-electric-pod): =cut may have been recognized as start.
-       (cperl-block-p): Move, updatedfor attributes.
-       (cperl-calculate-indent): Try to allow '_' be non-word char
-               Support subs with attributes.
-       (cperl-where-am-i): Quiet (?) a warning.
-       (cperl-cached-syntax-table): New function.
-       (cperl-forward-re): Use `cperl-cached-syntax-table'.
-       (cperl-unwind-to-safe): Recognize `syntax-type' property
-               changing in a middle of line.
-       (cperl-find-sub-attrs): New function.
-       (cperl-find-pods-heres): Allow many <<EOP per line.
-               Allow subs with attributes.
-               Major speedups (3.5x..15x on a real-life test file nph-proxy.pl).
-               Recognize "extproc " (OS/2) case-folded and only at start.
-               /x on s///x with empty replacement was not recognized.
-               Better comments.
-       (cperl-after-block-p): Remarks on diff with `cperl-block-p'.
-               Allow subs with attributes, labels.
-               Do not confuse "else::foo" with "else".
-               Minor optimizations...
-       (cperl-after-expr-p): Try to allow '_' be non-word char.
-       (cperl-fill-paragraph): Try to detect a major bug in Emacs
-               with `looking-at' inside `narrow' and bulk out if found.
-       (cperl-imenu--create-perl-index): Updates for new
-               `cperl-imenu--function-name-regexp-perl'.
-       (cperl-outline-level): Likewise.
-       (cperl-init-faces): Allow multiline subroutine headers
-               and my/our declarations, and ones with comments.
-               Allow subroutine attributes.
-       (cperl-imenu-on-info): Better docstring.
-       (cperl-etags): Rudimentary support for attributes.
-               Support for packages and "package;".
-       (cperl-add-tags-recurse-noxs): Better (?) docstring.
-       (cperl-add-tags-recurse-noxs-fullpath): Likewise.
-       (cperl-tags-hier-init): Misprint for `fboundp' fixed.
-       (cperl-not-bad-style-regexp): Try to allow '_' be non-word char.
-       (cperl-perldoc): Add autoload.
-       (cperl-perldoc-at-point): Likewise.
-       (cperl-here-doc-spell): New function.
-       (cperl-pod-spell): Likewise.
-       (cperl-map-pods-heres): Likewise.
-       (cperl-get-here-doc-region): Likewise.
-       (cperl-font-lock-fontify-region-function): Likewise (backward
-               compatibility for legacy `font-lock').
-       (cperl-font-lock-unfontify-region-function): Fix style.
-       (cperl-fontify-syntaxically): Recognize and optimize away deferred
-               calls with no-change.  Governed by `cperl-hook-after-change'.
-       (cperl-fontify-update): Recognize that syntaxification region
-               can be larger than fontification one.
-               XXXX we leave `cperl-postpone' property, so this is quadratic...
-       (cperl-fontify-update-bad): Temporary placeholder until
-               it is clear how to implement `cperl-fontify-update'.
-       (cperl-time-fontification): New function.
-       (attrib-group): New text attribute.
-       (multiline): New value: `syntax-type' text attribute.
-
-       After 5.2:
-       (cperl-emulate-lazy-lock): New function.
-       (cperl-fontify-syntaxically): Would skip large regions.
-       Add `cperl-time-fontification', `cperl-emulate-lazy-lock' to menu.
-       Some globals were declared, but uninitialized.
-
-       After 5.3, 5.4:
-       (cperl-facemenu-add-face-function): Add docs, fix U<>.
-       Copyright message updated.
-       (cperl-init-faces): Work around a bug in `font-lock'. May slow
-                       facification down a bit.
-               Misprint for my|our|local for old `font-lock'
-                       "our" was not fontified same as "my|local".
-               Highlight variables after "my" etc even in
-                       a middle of an expression.
-               Do not facify multiple variables after my etc
-                       unless parentheses are present.
-
-       After 5.5, 5.6
-       (cperl-fontify-syntaxically): after-change hook could reset.
-       (cperl-syntax-done-to) to a middle of line; unwind to BOL.
-
-       After 5.7:
-       (cperl-init-faces): Allow highlighting of local ($/).
-       (cperl-problems-old-emaxen): New variable (for the use of DOCSTRING).
-       (cperl-problems): Remove fixed problems.
-       (cperl-find-pods-heres): Recognize #-comments in m##x too.
-               Recognize charclasses (unless delimiter is \).
-       (cperl-fontify-syntaxically): Unwinding to safe was done in wrong order.
-       (cperl-regexp-scan): Update docs.
-       (cperl-beautify-regexp-piece): Use information got from regexp scan.
-
-       After 5.8:
-       Major user visible changes:
-       Recognition and fontification of character classes in RExen.
-       Variable indentation of RExen according to groups.
-
-       (cperl-find-pods-heres): Recognize POSIX classes in REx charclasses.
-               Fontify REx charclasses in variable-name face.
-               Fontify POSIX charclasses in "type" face.
-               Fontify unmatched "]" in function-name face.
-               Mark first-char of HERE-doc as `front-sticky'.
-               Reset `front-sticky' property when needed.
-       (cperl-calculate-indent): Indents //x -RExen accordning to parens level.
-       (cperl-to-comment-or-eol): Recognize ends of `syntax-type' constructs.
-       (cperl-backward-to-noncomment): Recognize stringy `syntax-type'
-               constructs.  Support `narrow'ed buffers.
-       (cperl-praise): Remove a reservation.
-       (cperl-make-indent): New function.
-       (cperl-indent-for-comment): Use `cperl-make-indent'.
-       (cperl-indent-line): Likewise.
-       (cperl-lineup): Likewise.
-       (cperl-beautify-regexp-piece): Likewise.
-       (cperl-contract-level): Likewise.
-       (cperl-toggle-set-debug-unwind): New function.
-               New menu entry for this.
-       (fill-paragraph-function): Use when `boundp'.
-       (cperl-calculate-indent): Take into account groups when indenting RExen.
-       (cperl-to-comment-or-eol): Recognize # which end a string.
-       (cperl-modify-syntax-type): Make only syntax-table property non-sticky.
-       (cperl-fill-paragraph): Return t: needed for `fill-paragraph-function'.
-       (cperl-fontify-syntaxically): More clear debugging message.
-       (cperl-pod2man-build-command): Check (XEmacs) `Man-filter-list'.
-       (cperl-init-faces): More complicated highlight even on XEmacs (new).
-       Merge cosmetic changes from XEmacs.
-
-       After 5.9:
-       (cperl-1+): Move to before the first use.
-       (cperl-1-): Likewise.
-
-       After 5.10:
-
-       This code may lock Emacs hard!!!  Use at your own risk!
-
-       (cperl-font-locking): New internal variable.
-       (cperl-beginning-of-property): New function.
-       (cperl-calculate-indent): Use `cperl-beginning-of-property'
-       instead of `previous-single-property-change'.
-       (cperl-unwind-to-safe): Likewise.
-       (cperl-after-expr-p): Likewise.
-       (cperl-get-here-doc-region): Likewise.
-       (cperl-font-lock-fontify-region-function): Likewise.
-       (cperl-to-comment-or-eol): Do not call `cperl-update-syntaxification'
-                       recursively.
-               Bound `next-single-property-change' via `point-max'.
-       (cperl-unwind-to-safe): Bound likewise
-       (cperl-font-lock-fontify-region-function): Likewise.
-       (cperl-find-pods-heres): Mark as recursive for `cperl-to-comment-or-eol'
-               Initialization of `cperl-font-lock-multiline-start' could be
-               missed if the "main" fontification did not run due to the
-               keyword being already fontified.
-       (cperl-pod-spell): Return t from do-one-chunk function.
-       (cperl-map-pods-heres): Stop when the worker returns nil.
-               Call `cperl-update-syntaxification'.
-       (cperl-get-here-doc-region): Call `cperl-update-syntaxification'.
-       (cperl-get-here-doc-delim): Remove unused function.
-
-       After 5.11:
-
-       The possible lockup of Emacs (introduced in 5.10) fixed.
-
-       (cperl-unwind-to-safe): `cperl-beginning-of-property' won't return nil.
-       (cperl-syntaxify-for-menu): New customization variable.
-       (cperl-select-this-pod-or-here-doc): New function.
-       (cperl-get-here-doc-region): Extra argument.
-               Do not adjust pos by 1.
-
-       New menu entries
-               (Perl/Tools): Selection of current POD or HERE-DOC section.
-               (Debugging CPerl:) backtrace on fontification.
-
-       After 5.12:
-       (cperl-cached-syntax-table): Use `car-safe'.
-       (cperl-forward-re): Remove spurious argument SET-ST.
-               Add documentation.
-       (cperl-forward-group-in-re): New function.
-       (cperl-find-pods-heres): Find and highlight (?{}) blocks in RExen
-       (XXXX Temporary (?) hack is to syntax-mark them as comment).
-
-       After 5.13:
-       (cperl-string-syntax-table): Make { and } not-grouping
-         (Sometimes they ARE grouping in RExen, but matching them would only
-          confuse in many situations when they are not)
-       (beginning-of-buffer): Replace two occurrences with goto-char...
-       (cperl-calculate-indent): `char-after' could be nil...
-       (cperl-find-pods-heres): REx can start after "[" too.
-               Hightlight (??{}) in RExen too.
-       (cperl-maybe-white-and-comment-rex): New constant
-       (cperl-white-and-comment-rex): Likewise.
-               XXXX Not very efficient, but hard to make
-               better while keeping 1 group.
-
-       After 5.13:
-       (cperl-find-pods-heres): $foo << identifier() is not a HERE-DOC.
-               Likewise for 1 << identifier.
-
-       After 5.14:
-       (cperl-find-pods-heres): Different logic for $foo .= <<EOF etc.
-               Error-less condition-case could fail.
-       (cperl-font-lock-fontify-region-function): Likewise.
-       (cperl-init-faces): Likewise.
-
-       After 5.15:
-       (cperl-find-pods-heres): Support property REx-part2.
-       (cperl-calculate-indent): Likewise.
-               Don't special-case REx with non-empty 1st line.
-       (cperl-find-pods-heres): In RExen, highlight non-literal backslashes.
-               Invert highlighting of charclasses:
-                       now the envelop is highlighted.
-               Highlight many others 0-length builtins.
-       (cperl-praise): Mention indenting and highlight in RExen.
-
-       After 5.15:
-       (cperl-find-pods-heres): Highlight capturing parens in REx.
-
-       After 5.16:
-       (cperl-find-pods-heres): Highlight '|' for alternation
-       Initialize `font-lock-warning-face' if not present.
-       (cperl-find-pods-heres): Use `font-lock-warning-face' instead of
-                        `font-lock-function-name-face'.
-       (cperl-look-at-leading-count): Likewise.
-       (cperl-find-pods-heres): Localize `font-lock-variable-name-face',
-                       `font-lock-keyword-face' (needed for
-                       batch processing), etc...
-               Use `font-lock-builtin-face' for builtin in REx
-                       Now `font-lock-variable-name-face'
-                       is used for interpolated variables
-               Use "talking aliases" for faces inside REx
-               Highlight parts of REx (except in charclasses)
-                       according to the syntax and/or semantic
-               Syntax-mark a {}-part of (?{}) as "comment"
-                       (it was the ()-part)
-               Better logic to distinguish what is what in REx
-       (cperl-tips-faces): Document REx highlighting
-       (cperl-praise): Mention REx syntax highlight etc.
-
-       After 5.17:
-       (cperl-find-sub-attrs): Would not always manage to print error message.
-       (cperl-find-pods-heres): Localize `font-lock-constant-face'.
-
-       After 5.18:
-       (cperl-find-pods-heres): Misprint in REx for parsing REx.
-               Very minor optimization.
-               `my-cperl-REx-modifiers-face' got quoted.
-               Recognize "print $foo <<END" as HERE-doc.
-               Put `REx-interpolated' text attribute if needed.
-       (cperl-invert-if-unless-modifiers): New function.
-       (cperl-backward-to-start-of-expr): Likewise.
-       (cperl-forward-to-end-of-expr): Likewise.
-       (cperl-invert-if-unless): Works in "the opposite way" too.
-               Cursor position on return is on the switch-word.
-               Indents comments better.
-       (REx-interpolated): New text attribute.
-       (cperl-next-interpolated-REx): New function.
-       (cperl-next-interpolated-REx-0): Likewise.
-       (cperl-next-interpolated-REx-1): Likewise.
-       "\C-c\C-x", "\C-c\C-y", "\C-c\C-v": New keybinding for these functions.
-       Perl/Regexp menu: 3 new entries for `cperl-next-interpolated-REx'.
-       (cperl-praise): Mention finded interpolated RExen.
-
-       After 5.19:
-       (cperl-init-faces): Highlight %$foo, @$foo too.
-       (cperl-short-docs): Better docs for system, exec.
-       (cperl-find-pods-heres): Better detect << after print {FH} <<EOF etc.
-               Would not find HERE-doc ended by EOF without NL.
-       (cperl-short-docs): Correct not-doubled \-escapes.
-       start block: Put some `defvar' for stuff gone from XEmacs.
-
-       After 5.20:
-       initial comment: Extend copyright, fix email address.
-       (cperl-indent-comment-at-column-0): New customization variable.
-       (cperl-comment-indent): Indentation after $#a would increasy by 1.
-       (cperl-mode): Make `defun-prompt-regexp' grok BEGIN/END etc.
-       (cperl-find-pods-heres): Mark CODE of s///e as `syntax-type' `multiline'
-       (cperl-at-end-of-expr): Would fail if @BAR=12 follows after ";".
-       (cperl-init-faces): If `cperl-highlight-variables-indiscriminately'
-                       highlight $ in $foo too (UNTESTED).
-       (cperl-set-style): Docstring missed some available styles.
-       toplevel: Menubar/Perl/Indent-Styles had FSF, now K&R.
-               Change "Current" to "Memorize Current".
-       (cperl-indent-wrt-brace): New customization variable; the default is
-               as for pre-5.2 version.
-       (cperl-styles-entries): Keep `cperl-extra-newline-before-brace-multiline'.
-       (cperl-style-alist): Likewise.
-       (cperl-fix-line-spacing): Support `cperl-merge-trailing-else' being nil,
-               and `cperl-extra-newline-before-brace' etc
-               being t
-       (cperl-indent-exp): Plans B and C to find continuation blocks even
-               if `cperl-extra-newline-before-brace' is t.
-
-       After 5.21:
-       Improve some docstrings concerning indentation.
-       (cperl-indent-rules-alist): New variable.
-       (cperl-sniff-for-indent): New function name
-               (separated from `cperl-calculate-indent').
-       (cperl-calculate-indent): Separate the sniffer and the indenter;
-               uses `cperl-sniff-for-indent' now.
-       (cperl-comment-indent): Test for `cperl-indent-comment-at-column-0'
-               was inverted;
-               Support `comment-column' = 0.
-
-2006-10-11  Martin Rudalics  <rudalics@gmx.at>
-
-       * dnd.el (dnd-handle-one-url): Fix typo in doc-string.
-       * help-at-pt.el (scan-buf-move-to-region): Likewise.
-       * longlines.el (longlines-window-change-function): Likewise.
-       * simple.el (undo-ask-before-discard): Likewise.
-       * wid-edit.el (widget-field-prompt-internal)
-       (widget-documentation-link-p): Likewise.
-
-2006-10-10  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/sh-script.el (sh-get-kw): | is not among the allowed chars
-       for a keyword.
-
-2006-10-09  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * newcomment.el (comment-valid-prefix-p): Make the check
-       more thorough.  From an idea by Martin Rudalics <rudalics@gmx.at>.
-       (comment-indent-new-line): Adjust call.
-
-2006-10-09  Ken Manheimer  <ken.manheimer@gmail.com>
-
-       * allout.el (allout-back-to-current-heading): Base on lower-level
-       routines to get proper disqualification of aberrant topics.
-
-2006-10-09  Richard Stallman  <rms@gnu.org>
-
-       * textmodes/two-column.el (2C-two-columns): Doc fix.
-
-2006-10-09  Kim F. Storm  <storm@cua.dk>
-
-       * shell.el (explicit-csh-args, explicit-bash-args): Add comment
-       about implicit use.
-
-2006-10-08  Richard Stallman  <rms@gnu.org>
-
-       * textmodes/two-column.el (2C-two-columns): Doc fix.
-
-2006-10-08  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * files.el: Mark `buffer-read-only' as safe-local-variable.
-
-2006-10-08  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-speedbar-expand-node):
-       Burp if GUD buffer has been killed.
-
-2006-10-07  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * completion.el (add-completions-from-c-buffer):
-       Don't presume an error's second element is a string.
-       Use looking-at rather than buffer-substring + member.
-
-2006-10-07  Eli Zaretskii  <eliz@gnu.org>
-
-       * mail/rmail.el (rmail-redecode-body): If the old encoding is
-       `undecided', call find-coding-systems-region to find a proper
-       non-trivial encoding.
-       (rmail-mime-charset-pattern): Allow a TAB between "Content-Type"
-       and "text/plain".
-
-2006-10-07  Kevin Ryde  <user42@zip.com.au>
-
-       * textmodes/reftex-vars.el (defgroup reftex): Update home page
-       url-link.
-
-       * strokes.el (defgroup strokes): Remove invalid url-link.
-
-2006-10-07  Magnus Henoch  <mange@freemail.hu>
-
-       * autoinsert.el (auto-insert-alist): Doc fix.
-
-2006-10-07  Johan Bockg\e,Ae\e(Brd  <bojohan@dd.chalmers.se>
-
-       * mouse-sel.el (mouse-insert-selection-internal):
-       Use insert-for-yank, so that yank handlers are run.
-
-2006-10-07  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-file-extension-aux): Fix comparison.
-
-2006-10-06  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-wide-find-dirs-or-files): Use shell-quote-argument.
-
-2006-10-05  Juanma Barranquero  <lekktu@gmail.com>
-
-       * emacs-lisp/advice.el (ad-remove-advice, ad-parse-arglist)
-       (ad-make-mapped-call): Use `let', not `let*'.
-
-2006-10-05  Chong Yidong  <cyd@stupidchicken.com>
-
-       * international/mule-cmds.el (coding-system-change-eol-conversion):
-       Ensure the coding system is initialized before calling
-       coding-system-eol-type.
-
-2006-10-04  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-rm-props, org-activate-plain-links)
-       (org-activate-angle-links, org-activate-dates)
-       (org-activate-target-links, org-activate-camels)
-       (org-activate-tags): Add `rear-nonsticky' text property to avoid
-       textproperty keymaps from being active beyond the end of a line.
-       (org-unfontify-region): Also remove `rear-nonsticky' property.
-
-2006-10-04  Kenichi Handa  <handa@m17n.org>
-
-       * international/code-pages.el (next): Table fixed.
-
-2006-10-04  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/sh-script.el (sh-prev-thing): Remove (forward-char 1) now
-       that it's been made unnecessary by removing narrowing.
-
-2006-10-03  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/sh-script.el (sh-prev-thing): Massage to untangle the
-       control flow a bit, simplify another bit, and add comments.
-
-2006-10-03  David Kastrup  <dak@gnu.org>
-
-       * help.el (describe-mode): For clicks on mode-line, use "@"
-       interactive argument to get the major mode of the click instead of
-       the current buffer.
-
-       * isearch.el (isearch-mouse-2): Use new semantics of `key-binding'
-       in order to better redirect mouse-2 clicks.  Also allow default
-       bindings to apply.
-
-2006-10-03  Kim F. Storm  <storm@cua.dk>
-
-       * emacs-lisp/cl.el (pushnew-internal): Remove defvar.
-       (pushnew): Fix last change.
-
-2006-10-03  Denis St\e,A|\e(Bnkel  <dstuenkel@googlemail.com>  (tiny change)
-
-       * ibuf-ext.el (eval, view-and-eval) <define-ibuffer-op>:
-       Use the interactive spec of `eval-expression'.
-
-2006-10-02  Michael Welsh Duggan  <md5i@cs.cmu.edu>
-
-       * progmodes/sh-script.el (sh-prev-thing): Fix last change.
-
-2006-10-02  MIYOSHI Masanori  <miyoshi@meadowy.org>  (tiny change)
-
-       * mail/smtpmail.el (smtpmail-try-auth-methods): Fix typo in
-       2006-09-28 commit.
-
-2006-10-02  Kenichi Handa  <handa@m17n.org>
-
-       * international/code-pages.el (iso-8859-6): Table fixed.
-
-2006-10-01  Chris Moore  <christopher.ian.moore@gmail.com>
-
-       * dired.el (dired-build-subdir-alist): Fix previous change.
-
-2006-10-01  Johan Bockg\e,Ae\e(Brd  <bojohan@dd.chalmers.se>
-
-       * simple.el (undo-elt-crosses-region): Fix the inequalities.
-
-2006-10-01  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * emacs-lisp/find-func.el (find-function-regexp): Don't match
-       "define-button-type".
-
-       * pcvs.el (cvs-update-header): Fix handling of extra newlines so that
-       they don't keep accumulating.
-
-2006-10-01  Bob Rogers  <rogers-emacs@rgrjr.dyndns.org>  (tiny change)
-
-       * ffap.el (ffap-rfc-path): Change the address of the RFC
-       repository to ftp.rfc-editor.org, as ds.internic.net seems to be gone.
-
-2006-10-01  Stephen Berman  <Stephen.Berman@gmx.net>
-
-       * allout.el (allout-expose-topic): Rectify implementation of "+"
-       spec, so that bodies are not exposed with headlines.
-
-2006-10-01  Ken Manheimer  <ken.manheimer@gmail.com>
-
-       * allout.el (allout-current-depth): Do aberrent check only at or
-       below doublecheck depth.
-       (allout-chart-subtree): Make it explicit that LEVELS being nil
-       means unlimited depth.  Drop undocumented support for LEVELS value
-       t meaning unlimited depth.  (This is consistent with
-       allout-chart-to-reveal, but contrary to allout-show-children,
-       which needs to use nil to default to depth of 1.)
-       (allout-goto-prefix-doublechecked): Wrap long docstring line.
-       (allout-chart-to-reveal): Be explicit in docstring about meaning
-       of nil LEVELS, and drop support for LEVELS value t.
-       (allout-show-children): Translate the level spec used by this
-       routine to that used by allout-chart-subtree and
-       allout-chart-to-reveal.
-       (allout-show-to-offshoot): Retry once when stuck, after opening
-       subtree - improvements in discontinuity handling likely will
-       enable progress.
-
-2006-09-30  Chong Yidong  <cyd@stupidchicken.com>
-
-       * wid-edit.el (widget-button-click-moves-point): New variable.
-       (widget-button-click): If widget-button-click-moves-point is
-       non-nil, set point after performing the button action.
-
-       * cus-edit.el (custom-mode): Set widget-button-click-moves-point.
-
-2006-09-30  Martin Rudalics  <rudalics@gmx.at>
-
-       * files.el (find-file-existing): Modify to not allow wildcards.
-
-2006-09-30  Johan Bockg\e,Ae\e(Brd  <bojohan@dd.chalmers.se>
-
-       * simple.el (undo-more): When undo information for the region is
-       exhausted, say "No further undo information FOR REGION".
-
-2006-09-30  Michael Welsh Duggan  <md5i@cs.cmu.edu>
-
-       * progmodes/sh-script.el (sh-prev-thing):
-       Take `sh-leading-keywords' into account.
-
-2006-09-29  Glenn Morris  <rgm@gnu.org>
-
-       * custom.el (defcustom): Doc fix.
-
-       * calendar/calendar.el (european-calendar-style):
-       Call european-calendar or american-calendar as needed when set.
-       (diary-view-entries, list-calendar-holidays): Move autoloads
-       before use.
-
-2006-09-29  Juri Linkov  <juri@jurta.org>
-
-       * progmodes/cperl-mode.el (cperl-after-expr-p): Don't move point
-       to nil if there is no previous property change.
-
-2006-09-29  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac@lrde.org>
-
-       * cus-edit.el (custom-save-all): Switch to emacs-lisp mode before
-       saving anything to be sure that `forward-sexp' behaves correctly.
-
-2006-09-29  Chong Yidong  <cyd@stupidchicken.com>
-
-       * simple.el (line-move-finish): Ignore field boundaries if the
-       initial and final points have the same `field' property.
-
-2006-09-29  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-file-internal): Only bind minibuffer-completing-file-name
-       to t while calling ido-read-internal.
-
-2006-09-29  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-file-remote-p): Get regexp from list.
-       (org-archive-subtree): Remove erraneous `]' from character list.
-
-2006-09-28  Jonathan Yavner  <jyavner@member.fsf.org>
-
-       * ses.el (ses-in-print-area, ses-goto-data, ses-load)
-       (ses-reconstruct-all): Make undo of "insert row" work by keeping
-       markers for data-area and parameters-area.
-
-2006-09-28  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/make-mode.el (makefile-mode): Don't disable jit-lock.
-
-       * font-lock.el (font-lock-after-change-function): Refontify next line
-       as well if end is at BOL.
-       (font-lock-extend-jit-lock-region-after-change): Be more careful to
-       only extend the region as much as needed.
-
-2006-09-28  Richard Stallman  <rms@gnu.org>
-
-       * comint.el (comint-mode): Bind font-lock-defaults non-nil.
-
-       * subr.el (insert-for-yank-1): Handle `font-lock-face' specially.
-
-       * international/mule.el (after-insert-file-set-coding):
-       If VISIT, don't let set-buffer-multibyte make undo info.
-
-2006-09-28  Osamu Yamane  <yamane@green.ocn.ne.jp>  (tiny change)
-
-       * mail/smtpmail.el (smtpmail-try-auth-methods): Do not break long
-       lines in base64-encoded authentication response.
-
-2006-09-26  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
-
-       * progmode/ebnf2ps.el: Doc fix. Implement arrow spacing and scaling.
-       (ebnf-version): New version 4.3.
-       (ebnf-arrow-extra-width, ebnf-arrow-scale): New options.
-       (ebnf-prologue): Adjust PostScript programming.
-       (ebnf-begin-file, ebnf-insert-ebnf-prologue, ebnf-terminal-dimension1)
-       (ebnf-repeat-dimension, ebnf-except-dimension): Adjust code.
-
-2006-09-26  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * jit-lock.el (jit-lock-force-redisplay): Rename from
-       jit-lock-fontify-again, and undo the mistaken change I've just done.
-
-       * jit-lock.el (jit-lock-fontify-now): Don't fontify the empty text.
-       (jit-lock-fontify-again): Don't refontify text that's not displayed.
-
-2006-09-26  Kenichi Handa  <handa@m17n.org>
-
-       * startup.el (display-splash-screen): Allow a prefix argument.
-
-2006-09-25  Jason Rumney  <jasonr@gnu.org>
-
-       * subr.el (shell-quote-argument): Use DOS logic for Windows
-       shells with DOS semantics.
-
-2006-09-24  Richard Stallman  <rms@gnu.org>
-
-       * progmodes/compile.el (compilation-goto-locus-delete-o): New fn.
-       (compilation-goto-locus): Use compilation-goto-locus-delete-o
-       to delete the overlay.  Put it on pre-command-hook.
-
-       * emacs-lisp/timer.el (timer-max-repeats): Doc fix.
-
-       * startup.el (fancy-splash-screens, normal-splash-screen):
-       Call the splash buffer *About GNU Emacs*.
-
-       * simple.el (next-error-highlight, next-error-highlight-no-select):
-       Default to 0.5.
-       (yank-excluded-properties): Add `fontified'.
-
-       * font-lock.el (font-lock-compile-keywords): Allow value of
-       syntax-begin-function to enable paren-column-0 highlighting.
-
-2006-09-24  Chris Moore  <christopher.ian.moore@gmail.com>
-
-       * dired.el (dired-build-subdir-alist): When file ends in colon,
-       don't exit the loop, just disregard that file.
-
-2006-09-24  Chong Yidong  <cyd@stupidchicken.com>
-
-       * simple.el (line-move-finish): Handle corner case for fields in
-       continued lines.
-       (line-move-1): Remove flawed test for that case.
-
-2006-09-24  Ken Manheimer  <ken.manheimer@gmail.com>
-
-       * icomplete.el (icomplete-simple-completing-p): Use the correct
-       name for the new variable, `icomplete-with-completion-tables'.
-       (file local variables): Remove superfluous setting.
-
-2006-09-23  Jeff Miller  <jmiller@cablespeed.com>  (tiny change)
-
-       * calendar/appt.el (appt-check): Fix typo for appointments just
-       after midnight.
-
-2006-09-23  Chong Yidong  <cyd@stupidchicken.com>
-
-       * help.el (describe-key-briefly, describe-key): Don't expect an
-       extra up event if a down-event is generated by a popup menu.
-
-2006-09-23  Michal Nazarewicz  <mnazarewicz@gmail.com>  (tiny change)
-
-       * textmodes/ispell.el (ispell-change-dictionary): Don't check the
-       local dictionary when changing the global dictionary.
-
-2006-09-23  Ken Manheimer  <ken.manheimer@gmail.com>
-
-       * icomplete.el (icomplete-with-completion-tables): List of
-       specialized completion tables with which icomplete should
-       operate.  Include the new `internal-complete-buffer', so icomplete
-       works with interactive buffer-selection.
-       (icomplete-simple-completing-p): Add acceptance of specialized
-       completion tables listed in icomplete-with-completion-tables.
-
-2006-09-23  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * frame.el (focus-follows-mouse): Set default to nil on Mac.
-
-       * startup.el (command-line): Use `custom-reevaluate-setting' for
-       `focus-follows-mouse'.
-
-2006-09-22  Richard Stallman  <rms@gnu.org>
-
-       * cus-edit.el (custom-buffer-create-internal): In `emacs -q',
-       explain why Save is not available.
-
-2006-09-22  Juanma Barranquero  <lekktu@gmail.com>
-
-       * woman.el (woman0-so): Use `let*', not `let'.
-       (woman-horizontal-line): Remove unbalanced parenthesis.
-
-2006-09-22  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * woman.el: Make sure all the end-of-region markers we use have
-       a non-nil insertion-type.
-       (woman0-so): Move things around so we can use copy-marker.
-       (woman0-roff-buffer, woman2-process-escapes-to-eol, woman2-roff-buffer):
-       Adjust marker type.
-       (woman2-process-escapes): Check marker type.
-       (woman-horizontal-line): Dispense with the use of a marker.
-
-2006-09-22  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-lang.el: Add Greek letters to math-variable-table
-       property of tex.
-
-2006-09-22  Chong Yidong  <cyd@stupidchicken.com>
-
-       * files.el (save-some-buffers-action-alist): Display diff in view-mode.
-
-2006-09-22  Masatake YAMATO  <jet@gyve.org>
-
-       * add-log.el (add-log-current-defun): Use `forward-sexp'
-       instead of `forward-word' to pick c++::symbol.
-       Reported by Guanpeng Xu <herberteuler@hotmail.com>.
-
-2006-09-22  Kenichi Handa  <handa@m17n.org>
-
-       * bindings.el: Fix setting self-insert-command for multibyte
-       characters in global-map.
-
-2006-09-21  David Kastrup  <dak@gnu.org>
-
-       * mouse.el (mouse-posn-property): Fix typo for `event-start' in
-       doc string.
-
-2006-09-21  Kenichi Handa  <handa@m17n.org>
-
-       * language/european.el ("Latin-1"): Add windows-1252 to
-       coding-priority.
-       ("German"): Likewise.
-
-2006-09-21  Kim F. Storm  <storm@cua.dk>
-
-       * emacs-lisp/cl-macs.el (member*): Use memql instead of complex code.
-       Suggested by Miles Bader.
-
-       * emacs-lisp/cl.el (pushnew): Rework 2006-09-10 change.  Use memql
-       instead of add-to-list in the simple case.
-
-2006-09-20  Kenichi Handa  <handa@m17n.org>
-
-       * isearch.el (isearch-process-search-char): Cancel the previous change.
-       (isearch-search-string): New function.
-       (isearch-search): Use isearch-search-string.
-       (isearch-lazy-highlight-search): Likewise.
-
-2006-09-20  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
-
-       * lpr.el (lpr-page-header-switches): Insert `*' at beginning of doc
-       string to become an option.
-
-2006-09-20  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * files.el (find-buffer-visiting): Don't get fooled by a nil inode.
-
-2006-09-20  Kim F. Storm  <storm@cua.dk>
-
-       * simple.el (line-move-partial): Call pos-visible-in-window-p with
-       position t instead of trying both window-end and window-end - 1.
-
-2006-09-20  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-scan-tags): Find end of subtrees also in
-       hidden trees.
-
-2006-09-20  David Kastrup  <dak@gnu.org>
-
-       * mouse.el (mouse-posn-property): Improve doc string.
-       (mouse-on-link-p): Change buffers for function calls on links.
-
-       * menu-bar.el (clipboard-yank): Bomb out in interactive use if
-       buffer is read-only.
-
-2006-09-20  Ken Manheimer  <ken.manheimer@gmail.com>
-
-       * allout.el (allout-unprotected): Let inhibit-read-only only when
-       buffer-read-only isn't set.
-       (allout-annotate-hidden): Enable topic annotation during copies even
-       when the buffer is read-only, eg for topic copies.  Ensure that the loop
-       advances, even when the span extends beyond the deletion region.
-       (allout-toggle-subtree-encryption): Use allout-structure-added-hook
-       rather than allout-exposure-changed-hook, as a stronger assertion.
-       (allout-keybindings-list): Add bindings for
-       allout-copy-line-as-kill and allout-copy-topic-as-kill.
-       (allout-copy-line-as-kill, allout-copy-topic-as-kill):
-       Copy wrappers for allout-kill-line and allout-kill-topic.
-       (allout-listify-exposed): Position correctly to accumulate lines.
-
-2006-09-19  Chong Yidong  <cyd@stupidchicken.com>
-
-       * simple.el (line-move-1): Escape field boundaries occurring
-       exactly at point.  Update goal column if constrained to a field.
-       (line-move-finish): Escape field boundaries occurring exactly at point.
-
-2006-09-19  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * mouse.el (mouse-on-link-p): Tentatively fix last change.
-       (mouse-drag-vertical-line): Remove unused var `wconfig'.
-
-2006-09-19  Kim F. Storm  <storm@cua.dk>
-
-       * help.el (describe-key-briefly, describe-key): Simplify printing
-       of descriptions by using format and %S.  Fix "is undefined"
-       messages to say "at that spot" for mouse events.
-
-       * simple.el (line-move-partial): Optimize.  Try window-line-height
-       before posn-at-point to get vpos of current line.
-
-2006-09-18  Michael Kifer  <kifer@cs.stonybrook.edu>
-
-       * viper.el: Bump up version/date of update to reflect the substantial
-       changes done in August 2006.
-
-       * viper-cmd (viper-next-line-at-bol): Make sure button-at, push-button
-       are defined.
-
-       * ediff-util.el (ediff-add-to-history): New function.
-
-       * ediff.el: Use ediff-add-to-history instead of add-to-history.
-
-2006-09-18  Wolfgang Jenkner  <wjenkner@inode.at>  (tiny change)
-
-       * textmodes/conf-mode.el (conf-space-mode): Doc fix.
-       Delete duplicate make-local-variable form.
-       (conf-space-keywords): Add autoload cookie.
-       Fix typo (`keywords', not `keyword').
-
-2006-09-18  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * cus-start.el (all): Rename x-gtk-show-chooser-help-text to
-       x-gtk-file-dialog-help-text.  Rename x-use-old-gtk-file-dialog
-       to x-gtk-use-old-file-dialog.
-
-2006-09-18  Richard Stallman  <rms@gnu.org>
-
-       * wid-edit.el (widget-button-click): Handle non-mouse-motion events
-       that might come in during mouse tracking.
-
-2006-09-18  Kim F. Storm  <storm@cua.dk>
-
-       * simple.el (line-move-partial): Rework 2006-09-15 change to use
-       new window-line-height function.  Further optimize by not calling
-       pos-visible-in-window-p for window-end when window-line-height
-       returns useful information.
-
-2006-09-16  Richard Stallman  <rms@gnu.org>
-
-       * textmodes/conf-mode.el (conf-mode-map): Use conf-space-keywords cmd.
-       (conf-space-mode): Don't handle prefix arg.
-       Delete conf-space-keywords-override code.
-       Use add-hook.
-       (conf-space-keywords): New command.
-       (conf-space-mode-internal): Be careful with imenu-generic-expression.
-       Delete conf-space-keywords-override code.
-       (conf-space-keywords-alist): Doc fix.
-       (conf-space-font-lock-keywords): Doc fix.
-       (conf-space-keywords-override): Var deleted.
-
-2006-09-16  Chong Yidong  <cyd@stupidchicken.com>
-
-       * startup.el (fancy-splash-screens): Don't switch to the scratch
-       buffer; it may not be the next buffer.
-
-2006-09-16  Romain Francoise  <romain@orebokech.com>
-
-       * saveplace.el (load-save-place-alist-from-file): Use expanded name
-       in both messages.
-
-2006-09-16  Slawomir Nowaczyk  <slawomir.nowaczyk.847@student.lu.se>
-
-       * progmodes/python.el (python-preoutput-filter):
-       Fix arg order to string-match.
-
-2006-09-16  Richard Stallman  <rms@gnu.org>
-
-       * obsolete/fast-lock.el (fast-lock-cache-data): Provide 2nd arg to
-       font-lock-compile-keywords.
-
-       * font-lock.el (font-lock-compile-keywords): Rename optional arg
-       to SYNTACTIC-KEYWORDS and reverse the sense.  All callers changed.
-
-2006-09-16  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * cus-start.el (all): Add x-gtk-show-chooser-help-text.
-
-       * select.el (xselect-convert-to-string): If UTF8_STRING is requested
-       and the data doesn't look like UTF8, send STRING instead.
-
-2006-09-16  Agust\e,Am\e(Bn Mart\e,Am\e(Bn  <agustin.martin@hispalinux.es>
-
-       * textmodes/flyspell.el (flyspell-check-region-doublons):
-       New function to detect duplicated words.
-       (flyspell-large-region): Use it.
-
-2006-09-16  Chong Yidong  <cyd@stupidchicken.com>
-
-       * simple.el (line-move-to-column): Revert 2006-08-03 change.
-
-2006-09-16  Eli Zaretskii  <eliz@gnu.org>
-
-       * help.el (describe-prefix-bindings): Use let, not let*.
-
-2006-09-16  Ken Manheimer  <ken.manheimer@gmail.com>
-
-       * allout.el (allout-regexp, allout-line-boundary-regexp)
-       (allout-bob-regexp): Correct grouping and boundaries to fix
-       backwards traversal.
-       (allout-depth-specific-regexp, allout-depth-one-regexp):
-       New versions that exploit \\{M\\} regexp syntax, to avoid geometric or
-       worse time in allout-ascend.
-       (allout-doublecheck-at-and-shallower): Identify depth threshold
-       below which topics are checked for and disqualified by containment
-       discontinuities.
-       (allout-hotspot-key-handler): Correctly handle multiple-key
-       strokes.  Remove some unused variables.
-       (allout-mode-leaders): Clarify that mode-specific comment-start
-       will be used.
-       (set-allout-regexp): Correctly regexp-quote allout regexps to
-       properly accept alternative header-leads and primary bullets with
-       regexp-specific characters (eg, C "/*", mathematica "(*").
-       Include new regular expressions among those configured.
-       (allout-infer-header-lead-and-primary-bullet):
-       Rename allout-infer-header-lead.
-       (allout-recent-depth): Manifest as a variable as well as a function.
-       (allout-prefix-data): Simplify into an inline instead of a macro,
-       assuming current match data rather than being explicitly passed
-       it.  Establish allout-recent-depth value as well as
-       allout-recent-prefix-beginning and allout-recent-prefix-end.
-       (allout-aberrant-container-p): True when an item's immediate
-       offspring discontinuously contained.  Useful for disqualifying
-       unintended topic prefixes, likely at low depths.
-       (allout-goto-prefix-doublechecked): Elaborate version of
-       allout-goto-prefix which disqualifies aberrant pseudo-items.
-       (allout-pre-next-prefix): Layer on top of lower-level routines, to
-       get disqualification of aberrant containers.
-       (allout-end-of-prefix, allout-end-of-subtree): Disqualify aberrant
-       containers.
-       (allout-beginning-of-current-entry): Position at start of buffer
-       when in container (depth 0) entry.
-       (nullify-allout-prefix-data): Invalidate allout-recent-* prefix data.
-       (allout-current-bullet): Strip text properties.
-       (allout-get-prefix-bullet): Use right match groups.
-       (allout-beginning-of-line, allout-next-heading):
-       Disqualify aberrant containers.
-       (allout-previous-heading): Disqualify aberrant containers, and
-       change to regular (rather than inline) function, to allow
-       self-recursion.
-       (allout-get-invisibility-overlay): Increment so progress is made
-       when the first overlay is not the sought one.
-       (allout-end-of-prefix): Disqualify aberrant containers.
-       (allout-end-of-line): Cycle something like allout-beginning-of-line.
-       (allout-mode): Make allout-old-style-prefixes (ie, enabling use with
-       outline.el outlines) functional again.  Change the primary bullet
-       along with the header-lead - level 1 new-style bullets now work.
-       Engage allout-before-change-handler in mainline Emacs, not just
-       XEmacs, to do undo handling.
-       (allout-before-change-handler): Expose undo changes occurring in
-       hidden regions.  Use allout-get-invisibility-overlay instead of
-       reimplementing it inline.
-       (allout-chart-subtree): Use start rather than end of prefix in
-       charts.  Use allout-recent-depth variable.
-       (allout-chart-siblings): Disqualify aberrant topics.
-       (allout-beginning-of-current-entry): Position correctly.
-       (allout-ascend): Use new allout-depth-specific-regexp and
-       allout-depth-one-regexp for linear instead of O(N^2) or worse
-       behavior.
-       (allout-ascend-to-depth): Depend on allout-ascend, rather than
-       reimplementing an algorithm.
-       (allout-up-current-level): Depend on allout-ascend, rather than
-       reimplementing an algorithm.  Return to start-point if we fail.
-       (allout-descend-to-depth): Use allout-recent-depth variable
-       instead of function.
-       (allout-next-sibling): On traversal of numerous intervening
-       topics, resort to economical allout-next-sibling-leap.
-       (allout-next-sibling-leap): Specialized version of
-       allout-next-sibling that uses allout-ascend cleverly, to depend on
-       a regexp search to leap large numbers of contained topics, rather
-       than arbitrarily many one-by-one traversals.
-       (allout-next-visible-heading): Disqualify aberrant topics.
-       (allout-previous-visible-heading): Position consistently when
-       interactive.
-       (allout-forward-current-level): Base on allout-previous-sibling
-       rather than (differently) reimplmenting the algorithm.  Remove some
-       unused variables.
-       (allout-solicit-alternate-bullet): Present default choice stripped
-       of text properties.
-       (allout-rebullet-heading): Use bullet stripped of text properties.
-       Register changes using allout-exposure-change-hook.
-       Disregard aberrant topics.
-       (allout-shift-in): With universal-argument, make topic a peer of
-       it's former offspring.  Simplify the code by separating out
-       allout-shift-out functionality.
-       (allout-shift-out): With universal-argument, make offspring peers
-       of their former container, and its siblings.  Implement the
-       functionality here, rather than inappropriately muddling the
-       implementation of allout-shift-in.
-       (allout-rebullet-topic): Respect additional argument for new
-       parent-child separation function.
-       (allout-yank-processing): Use allout-ascend directly.
-       (allout-show-entry): Disqualify aberrant topics.
-       (allout-show-children): Handle discontinuous children gracefully,
-       extending the depth being revealed to expose them and posting a
-       message indicating the situation.
-       (allout-show-to-offshoot): Remove obsolete and incorrect comment.
-       Leave cursor in correct position.
-       (allout-hide-current-subtree): Use allout-ascend directly.
-       Disqualify aberrant topics.
-       (allout-kill-line, allout-kill-topic): Preserve exposure layout in
-       a way that the yanks can restore it, as used to happen.
-       (allout-yank-processing): Restore exposure layout as recorded by
-       allout-kill-*, as used to happen.
-       (allout-annotate-hidden, allout-hide-by-annotation): New routines
-       for preseving and restoring exposure layout across kills.
-       (allout-toggle-subtree-encryption): Run allout-exposure-change-hook.
-       (allout-encrypt-string): Strip text properties.
-       Rearranged order and outline-headings for some of the
-       miscellaneous functions.
-       (allout-resolve-xref): No need to quote the error name in the
-       condition-case handler section.
-       (allout-flatten): Classic recursive (and recursively intensive,
-       without tail-recursion) list-flattener, needed by allout-shift-out
-       when confronted with discontinuous children.
-
-2006-09-16  Jason Rumney  <jasonr@gnu.org>
-
-       * dnd.el (dnd-open-remote-file-function): Use dnd-open-local-file
-       on ms-windows.
-       (dnd-open-unc-file): Remove.
-       (dnd-open-local-file): Mention in doc string that it also handles
-       remote files if the system natively supports unc file-names.
-
-2006-09-15  Kim F. Storm  <storm@cua.dk>
-
-       * help.el (describe-key): Handle C-h k in *Help* buffer; collect
-       all necessary information about the event before erasing *Help*.
-
-       * simple.el (line-move-partial): Use window-line-visiblity to
-       quickly check whether last line is partially visible, and only do
-       the hard (and slow) part in that case.
-
-2006-09-15  Jay Belanger  <belanger@truman.edu>
-
-       * COPYING: Replace "Library Public License" by "Lesser Public
-       License" throughout.
-
-2006-09-15  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * term/x-win.el (x-menu-bar-open): New function for F10.
-
-2006-09-15  Chong Yidong  <cyd@stupidchicken.com>
-
-       * progmodes/compile.el (compilation-error-regexp-alist-alist):
-       Disallow filenames containing " -" to avoid confusion with libtool
-       compilation messages.  Suggested by Stefan Monnier.
-
-2006-09-15  David Kastrup  <dak@gnu.org>
-
-       * mouse-sel.el (mouse-sel-follow-link-p): Use event position
-       instead of buffer position for `mouse-on-link-p'.
-
-       * mouse.el (mouse-posn-property): New function looking up the
-       properties at a click position in overlays and text properties in
-       either buffer or strings.
-       (mouse-on-link-p): Use `mouse-posn-property' to streamline lookup
-       of both `follow-link' as well as `mouse-face' properties.
-       (mouse-drag-track): Check `mouse-on-link-p' on event position, not
-       buffer position.
-
-       * help.el (describe-key-briefly): When reading a down-event on
-       mode lines or scroll bar, swallow the following up event, too.
-       Use the new mouse sensitity of `key-binding' for lookup.
-       (describe-key): The same here.
-
-2006-09-15  Juanma Barranquero  <lekktu@gmail.com>
-
-       * play/life.el (life-patterns): Add a few more interesting patterns.
-       (life-setup): Force `show-trailing-whitespace' to nil.
-
-2006-09-14  Richard Stallman  <rms@gnu.org>
-
-       * startup.el (fancy-splash-text): Change text to improve alignment.
-       (fancy-splash-screens): Don't set non-standard tab width.
-       Bind cursor-type temporarily, and make it easy to patch to
-       preserve the splash buffer.
-       (normal-splash-screen, fancy-splash-tail): Spell out "Meta-x".
-       (fancy-splash-screens): Display echo-area message explicitly.
-       Don't set fancy-splash-help-echo.
-
-       * simple.el (line-number-mode): Group mode-line instead of
-       editing-basics.
-       (column-number-mode, size-indication-mode): Likewise.
-
-       * faces.el (mode-line-faces): Group mode-line instead of modeline.
-
-       * time.el (display-time): Group mode-line instead of modeline.
-
-       * cus-edit.el (mode-line): Rename from modeline.  All uses changed.
-
-2006-09-14  Chong Yidong  <cyd@stupidchicken.com>
-
-       * startup.el (fancy-splash-text): Move editing instructions to
-       fancy-splash-head.
-       (fancy-splash-head): Issue editing instructions.
-       (fancy-splash-screens): Fixup whitespace.
-
-2006-09-14  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * bindings.el (mode-line-buffer-identification-keymap):
-       Remove duplicate line.
-
-2006-09-14  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac@lrde.org>
-
-       * ido.el (ido-ignore-item-p): Allow any kind of functions in
-       ignore lists.
-
-2006-09-14  Kim F. Storm  <storm@cua.dk>
-
-       * jit-lock.el (jit-lock-fontify-again): New function.
-       (jit-lock-fontify-now): Use it instead of lambda form.
-
-2006-09-13  Agustin Martin  <agustin.martin@hispalinux.es>
-
-       * textmodes/flyspell.el (flyspell-word, flyspell-correct-word)
-       (flyspell-auto-correct-word): Make ispell-filter local to these
-       functions.  Check that ispell-filter has new stuff before calling
-       ispell-parse-output.
-
-2006-09-13  Kim F. Storm  <storm@cua.dk>
-
-       * simple.el (line-move-partial): Optimize.
-
-2006-09-13  Richard Stallman  <rms@gnu.org>
-
-       * thingatpt.el (thing-at-point-bounds-of-url-at-point):
-       Delete spurious backquote.
-
-2006-09-07  Ryan Yeske  <rcyeske@gmail.com>
-
-       * net/rcirc.el (rcirc-print): Fix last change.
-
-2006-09-12  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc.el (calc-dispatch): Remove unnecessary `sit-for'.
-
-2006-09-07  Ryan Yeske  <rcyeske@gmail.com>
-
-       * net/rcirc.el (rcirc-scroll-show-maximum-output): Rename from
-       rcirc-show-maximum-output.
-       (rcirc-mode): Remove window-scroll-function hook.
-       (rcirc-scroll-to-bottom): Remove function.
-       (rcirc-print): Recenter so point stays at the bottom of the window
-       if point was already there.
-
-2006-09-12  Paul Eggert  <eggert@cs.ucla.edu>
-
-       * comint.el (comint-exec-1): Set EMACS to the full name of Emacs,
-       not to "t".
-       * progmodes/compile.el (compilation-start): Likewise.
-       * progmodes/idlwave.el (idlwave-rescan-asynchronously):
-       Don't use expand-file-name on invocation-directory, since this
-       might mishandle special characters in invocation-directory.
-
-2006-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * pcvs-defs.el: Remove * in defcustom's docstrings.
-
-2006-09-12  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/compile.el (compilation-directory-properties):
-       Doc fix for help-echo.
-
-2006-09-12  Lars Hansen  <larsh@soem.dk>
-
-       * desktop.el (desktop-read): Add comment.
-
-2006-09-12  Kim F. Storm  <storm@cua.dk>
-
-       * simple.el (next-error-highlight, next-error-highlight-no-select):
-       Fix spelling error.
-
-       * subr.el (sit-for): Rework to use input-pending-p and cond.
-       Return nil input is pending on entry also for SECONDS <= 0.
-       (while-no-input): Use input-pending-p instead of sit-for.
-
-2006-09-11  Richard Stallman  <rms@gnu.org>
-
-       * simple.el (next-error-highlight, next-error-highlight-no-select):
-       Fix custom type and doc strings.
-
-2006-09-11  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * diff-mode.el (diff-apply-hunk-to-backup-file): New var.
-       (diff-apply-hunk): Use it to ask for confirmation.
-
-2006-09-11  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * emacs-lisp/cl.el (pushnew): Add missing `,'.
-
-2006-09-11  David Kastrup  <dak@gnu.org>
-
-       * help.el (string-key-binding, describe-key-briefly)
-       (describe-key): Remove `string-key-binding' and its callers since
-       `key-binding' already caters for the proper lookup now.
-
-2006-09-11  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/cfengine.el (cfengine-font-lock-syntactic-keywords): Newvar.
-       (cfengine-mode): Use it.  Fix \ syntax to be like /.
-
-       * bindings.el (mode-line-buffer-identification-keymap):
-       Move initialization into declaration.
-
-2006-09-10  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-edit-input, ido-complete, ido-take-first-match)
-       (ido-push-dir-first, ido-kill-buffer-at-head, ido-exhibit)
-       (ido-delete-file-at-head): Pass head of ido-matches through ido-name
-       in case of merged directories.  Reported by Micha\e,Ak\e(Bl Cadilhac.
-
-2006-09-10  Richard Stallman  <rms@gnu.org>
-
-       * dired-aux.el: Handle errors in recursive copy usefully.
-       (dired-create-files-failures): New variable.
-       (dired-copy-file): Remove condition-case.
-       (dired-copy-file-recursive): Check for errors on all file
-       operations, and add them to dired-create-files-failures.
-       Check file file-date-erorr here too.
-       (dired-create-files): Check dired-create-files-failures
-       and report those errors too.
-
-       * emacs-lisp/cl.el (pushnew): Use add-to-list when convenient.
-
-       * subr.el (add-to-list): New argument COMPARE-FN.
-
-2006-09-10  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * filecache.el (file-cache-add-directory)
-       (file-cache-add-directory-list, file-cache-add-file)
-       (file-cache-add-directory-using-find)
-       (file-cache-add-directory-using-locate)
-       (file-cache-add-directory-recursively): Add autoloads.
-
-2006-09-09  Richard Stallman  <rms@gnu.org>
-
-       * textmodes/conf-mode.el (conf-space-mode):
-       Use hack-local-variables-hook instead of calling hack-local-variables.
-       (conf-space-keywords-override): New variable.
-       (conf-space-mode-internal): New subroutine.  Reinit Font Lock mode.
-       (conf-space-mode): Always make conf-space-keywords and
-       conf-space-keywords-override local.
-       Call conf-space-mode-internal directly as well as via hook.
-
-2006-09-09  Slawomir Nowaczyk  <slawomir.nowaczyk.847@student.lu.se>  (tiny change)
-
-       * progmodes/python.el (python-font-lock-keywords): Add `self' and other
-       quasi-keywords.
-
-2006-09-09  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/python.el: Quieten the compiler about hippie-expand vars.
-       (python-send-string): Be slightly more careful about adding \n.
-
-       * startup.el (normal-splash-screen): Don't display the buffer if we'll
-       kill it right away anyway.
-
-2006-09-09  Eli Zaretskii  <eliz@gnu.org>
-
-       * international/codepage.el (cp850-decode-table): Fix a few codes.
-       (cp858-decode-table): New variable.
-
-2006-09-09  Toby Allsopp  <Toby.Allsopp@navman.com>  (tiny change)
-
-       * net/ldap.el (ldap-search-internal): Doc fix.
-
-2006-09-09  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac@lrde.org>
-
-       * play/life.el (life-display-generation): Test for input manually if
-       `sleeptime' is negative or null.
-
-       * lpr.el (lpr-page-header-switches): Page title switch is one of them.
-       (print-region-1): Substitute `%s' with the page title.
-
-2006-09-09  Matt Hodges  <MPHodges@member.fsf.org>
-
-       * locate.el (locate-current-search): New variable.
-       (locate): Set buffer local value.  Use current buffer if it is
-       in Locate mode.
-       (locate-mode): Disable undo here.
-       (locate-do-setup): Use locate-current-filter from buffer to be killed.
-       (locate-update): Use locate-current-search and locate-current-filter.
-
-2006-09-08  David Kastrup  <dak@gnu.org>
-
-       * desktop.el (desktop-read): When loading a desktop, disable
-       saving it while the load progresses, and switch off a pending lazy
-       load by calling `desktop-lazy-abort'.
-
-2006-08-27  Martin Rudalics  <rudalics@gmx.at>
-
-       * window.el (mouse-autoselect-window-timer)
-       (mouse-autoselect-window-position)
-       (mouse-autoselect-window-window)
-       (mouse-autoselect-window-now): New vars.
-       (mouse-autoselect-window-cancel)
-       (mouse-autoselect-window-select)
-       (mouse-autoselect-window-start): New functions.
-       (handle-select-window): Call `mouse-autoselect-window-start' when
-       delayed window autoselection is enabled.
-
-       * cus-start.el (mouse-autoselect-window): Handle delayed window
-       autoselection.
-
-       * emacs-lisp/eldoc.el: Add `handle-select-window' to the set of
-       commands after which it is allowed to print in the echo area.
-
-2006-09-08  Richard Stallman  <rms@gnu.org>
-
-       * textmodes/fill.el (adaptive-fill-regexp): Don't match `(1)' or `1.'
-
-       * mail/rmail.el (rmail-get-new-mail): Say whether all msgs are spam.
-       (rmail-convert-to-babyl-format): Don't record undo, leave list empty.
-
-       * emacs-lisp/timer.el (timer-create, timer-activate): Doc fixes.
-       (cancel-timer-internal): Add doc string.
-       (cancel-function-timers): Doc fix.
-       (with-timeout-handler, timer-event-last*): Add doc strings.
-
-       * emacs-lisp/bindat.el (bindat-unpack): Doc fix.
-
-       * files.el (risky-local-variable-p): Match ...-bindat-spec.
-
-       * dired.el (dired-log-summary): Add doc string.
-
-       * cus-edit.el (custom-menu-create): Bind deactivate-mark here.
-       (custom-group-menu-create): Not here.
-
-2006-09-08  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-dblock-write:clocktable): Avoid infinite loop.
-
-2006-09-08  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el (show-hide-font-panel): New HI command ID symbol.
-       (mac-apple-event-map): Define its handler.
-
-2006-09-07  Toby Allsopp  <Toby.Allsopp@navman.com>  (tiny change)
-
-       * net/ldap.el (ldap-search-internal): Handle `auth' key.
-
-2006-09-07  Magnus Henoch  <mange@freemail.hu>
-
-       * net/rcirc.el (rcirc-activity-string): Don't quote value in case
-       clause.
-
-2006-09-07  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac@lrde.org>
-
-       * info.el (Info-index): Bind completion-ignore-case.
-
-2006-09-07  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/prolog.el (inferior-prolog-flavor): New var left out of
-       previous commit.
-       (inferior-prolog-guess-flavor): New fun left out of previous commit.
-       (prolog-consult-region-and-go): Don't hard code "*prolog*" and don't
-       burp in dedicated windows.
-       (inferior-prolog-self-insert-command): New command.
-       (inferior-prolog-mode-map): Use it.
-
-2006-09-07  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * international/latexenc.el (latex-inputenc-coding-alist): Add cp858.
-
-       * international/code-pages.el: Add cp858.
-
-2006-09-07  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * dnd.el: Fix bootstrapping.
-
-2006-09-07  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * dnd.el (dnd-protocol-alist): Add what url-handler-mode can handle.
-       (dnd-open-remote-url): New function.
-       (dnd-open-remote-file-function): Set to dnd-open-remote-url if
-       not windows-nt.
-
-2006-09-07  Jason Rumney  <jasonr@gnu.org>
-
-       * dnd.el (dnd-open-remote-file-function): New variable.
-       (dnd-open-unc-file): New function.
-       (dnd-open-file): Call dnd-open-remote-file-function if set.
-
-2006-09-06  Daiki Ueno  <ueno@unixuser.org>
-
-       * pgg-gpg.el (pgg-gpg-process-region): Encode passphrase with
-       pgg-passphrase-coding-system rather than locale-coding-system.
-       * pgg-def.el (pgg-passphrase-coding-system): New user option.
-
-2006-09-06  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/prolog.el: Remove * in docstrings.
-       (prolog-program-name): Add SWI prolog.
-       (prolog-mode-menu): New menu.
-       (prolog-mode): Set comment-add.
-       (prolog-indent-line): Simplify.  Use indent-line-to.
-       (inferior-prolog-buffer): New var.
-       (inferior-prolog-run, inferior-prolog-process): New funs.
-       (run-prolog, switch-to-prolog): Rewrite, using them.
-       (prolog-consult-region): Use inferior-prolog-buffer.
-       (inferior-prolog-load-file): New function.
-       (prolog-mode-map): Add bindings for load-file and switch-to-prolog.
-
-       * textmodes/fill.el (fill-single-word-nobreak-p): Allow breaking before
-       last word, if it's not the end of the paragraph.
-
-       * files.el (abbreviate-file-name): Don't mistakenly match newlines in
-       file name.
-
-2006-09-06  Ralf Angeli  <angeli@caeruleus.net>
-
-       * frame.el (display-mm-dimensions-alist): New defcustom.
-       (display-mm-height, display-mm-width): Use it.
-
-2006-09-06  Simon Josefsson  <jas@extundo.com>
-
-       * mail/smtpmail.el (smtpmail-starttls-credentials): Doc fix.
-
-2006-09-06  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-var-list-children-regexp)
-       (gdb-var-list-children-regexp-1): Tweak regexps to catch full
-       string values.
-
-2006-09-06  Kim F. Storm  <storm@cua.dk>
-
-       * simple.el (line-move-partial): New function to do vscrolling for
-       partially visible images / tall lines.  Rewrite based on code
-       previously in line-move.  Simplify backwards vscrolling.
-       (line-move): Use it.  Simplify.
-
-2006-09-05  Kim F. Storm  <storm@cua.dk>
-
-       * emulation/cua-base.el (cua--pre-command-handler-1): Rewrite.
-
-2006-09-05  Chong Yidong  <cyd@stupidchicken.com>
-
-       * progmodes/compile.el (compilation-error-regexp-alist-alist):
-       Process the `gcc-include' after the `gnu' rule.
-
-2006-09-05  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-visit-buffer): Use buffer name if buffer arg is a buffer.
-
-2006-09-05  Daiki Ueno  <ueno@unixuser.org>
-
-       * pgg.el (pgg-clear-string): Alias to clear-string for backward
-       compatibility.
-
-       * pgg-gpg.el (pgg-gpg-process-region): Avoid display blinking with
-       inhibit-redisplay; encode passphrase with locale-coding-system.
-
-2006-09-04  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * term/xterm.el (terminal-init-xterm): Add more C-M- bindings.
-
-2006-09-05  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-var-list-children-regexp)
-       (gdb-var-list-children-regexp): Make type field optional.
-
-       * progmodes/gud.el (gud-speedbar-buttons): Allow for no type
-       e.g public, protected in C++.
-
-2006-09-04  John Paul Wallington  <jpw@pobox.com>
-
-       * simple.el (completion-show-help): New defcustom.
-       (completion-setup-function): Heed it.
-
-2006-09-04  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * term/xterm.el (terminal-init-xterm): Add C-M- bindings.
-
-2006-09-04  Richard Stallman  <rms@gnu.org>
-
-       * mail/rmail-spam-filter.el (rsf-scanning-messages-now): Doc fix.
-       (rsf-min-region-to-spam-list): Doc fix.
-       (rsf-add-content-type-field): Doc fix.
-
-       * simple.el (kill-region): Explicitly test there is a region.
-
-2006-09-04  Chong Yidong  <cyd@stupidchicken.com>
-
-       * mail/feedmail.el (feedmail-buffer-to-sendmail): Look for
-       sendmail in several common directories.
-
-       * mail/sendmail.el (sendmail-program): Moved here from paths.el.
-
-       * paths.el (sendmail-program): Removed.
-
-2006-09-04  Daiki Ueno  <ueno@unixuser.org>
-
-       * pgg-gpg.el (pgg-gpg-process-region): Revert two patches from Satyaki
-       Das.  http://article.gmane.org/gmane.emacs.gnus.general/49947
-       http://article.gmane.org/gmane.emacs.gnus.general/50457
-
-2006-09-03  Chong Yidong  <cyd@stupidchicken.com>
-
-       * cus-edit.el (custom-group-menu-create): Avoid deactivating the
-       mark after running the menu filter.
-
-2006-09-03  Juri Linkov  <juri@jurta.org>
-
-       * international/quail.el (quail-defrule-internal): Add a check
-       if a key is a vector.
-
-2006-09-02  Juri Linkov  <juri@jurta.org>
-
-       * man.el (Man-topic-history): New variable.
-       (man): Use it.
-
-       * woman.el (woman-topic-history): Change defvar to defvaralias
-       for symbol `Man-topic-history'.
-
-       * shell.el (shell-filter-ctrl-a-ctrl-b): Check if
-       `comint-last-output-start' is a marker by using `markerp' and
-       check if it has a position by using `marker-position', and use
-       this position for `goto-char'.
-
-       * international/quail.el (quail-defrule-internal): Add missing
-       `error' call for null key.
-
-2006-09-02  Ryan Yeske  <rcyeske@gmail.com>
-
-       * rcirc.el (rcirc-keywords): New variable.
-       (rcirc-bright-nicks, rcirc-dim-nicks): New variables.
-       (rcirc-bright-nick-regexp, rcirc-dim-nick-regexp): Remove
-       variables.
-       (rcirc-responses-no-activity): New function.
-       (rcirc-handler-generic): Check for responses in above.
-       (rcirc-process-command): Add ?: character to arguments of raw
-       server commands.
-       (rcirc-format-response-string): Use `rcirc-bright-nicks' and
-       `rcirc-dim-nicks'.
-       (rcirc-gray-toggle): Remove unused variable.
-       (rcirc-print): Remove some tracking logic, which is moved into
-       markup functions.
-       (rcirc-activity-types): Was `rcirc-activity-type', now a list of
-       types.
-       (rcirc-activity-string): Look for 'keyword in activity-types.
-       (rcirc-window-configuration-change): Don't erase overlay-arrow
-       unnecessarily.
-       (rcirc-add-or-remove): New function.
-       (rcirc-cmd-ignore): Use it.
-       (rcirc-message-leader): Remove unused function.
-       (rcicr-cmd-bright, rcirc-cmd-dim, rcirc-cmd-keyword): New commands.
-       (rcirc-add-face): New function.
-       (rcirc-facify): Use rcirc-add-face.
-       (rcirc-url-regexp): Add parens.
-       (rcirc-map-regexp): Remove function.
-       (rcirc-mangle-regexp): Remove function.
-       (rcirc-markup-text-functions): New variable.
-       (rcirc-markup-text): New function (replaces `rcirc-mangle-text').
-       (rcirc-markup-body-text, rcirc-markup-attributes)
-       (rcirc-markup-my-nick, rcirc-markup-urls, rcirc-markup-keywords)
-       (rcirc-markup-bright-nicks): New markup handler functions.
-       (rcirc-nick-in-message-full-line): New face.
-       (rcirc-track-nick): Rename from `rcirc-mode-line-nick'.
-       (rcirc-track-keyword, rcirc-url, rcirc-keyword): New faces.
-
-2006-09-02  Martin Rudalics  <rudalics@gmx.at>
-
-       * cus-start.el (hscroll-margin, hscroll-step)
-       (mode-line-in-non-selected-windows, mouse-autoselect-window)
-       (x-use-underline-position-properties): Change version to "22.1"
-       since they will appear there for the first time.
-
-2006-09-01  Chong Yidong  <cyd@stupidchicken.com>
-
-       * imenu.el (imenu-update-menubar): Use buffer-chars-modified-tick.
-
-2006-08-31  Richard Stallman  <rms@gnu.org>
-
-       * cus-edit.el (custom-save-variables): Slight cleanup.
-       (Custom-no-edit): Renamed from custom-no-edit.
-       (Custom-newline): Renamed from custom-newline.
-       (custom-mode-map): Use new names.
-
-       * emacs-lisp/easy-mmode.el (define-minor-mode): Reference manual
-       about customization, rather than M-x customize, in the doc string
-       made for the defcustom.
-
-       * emacs-lisp/trace.el (trace-function-background): Doc fix.
-
-2006-08-31  Romain Francoise  <romain@orebokech.com>
-
-       * dired-x.el (dired-guess-shell-alist-default): Update.
-
-2006-08-31  Michael Mauger  <mmaug@yahoo.com>
-
-       * custom.el (custom-theme-set-variables): Autoload packages before
-       sorting the variables.
-
-2006-08-30  Michael Kifer  <kifer@cs.stonybrook.edu>
-
-       * viper-cmd.el (viper-special-read-and-insert-char): Convert events to
-       chars if XEmacs.
-       (viper-after-change-undo-hook): Check if undo-in-progress is bound.
-
-2006-08-30  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/python.el (python-eldoc-function): Re-enable quit while
-       waiting for process.
-
-2006-08-30  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el (mac-string-to-utxt): If adjustment for MacJapanese
-       results in ASCII-only string, encode original one directly.
-
-2006-08-29  Romain Francoise  <romain@orebokech.com>
-
-       * startup.el (normal-splash-screen, fancy-splash-screens):
-       Make buffer read-only and arrange to enter view mode if necessary.
-
-2006-08-29  Chong Yidong  <cyd@stupidchicken.com>
-
-       * hl-line.el (hl-line): New face.
-       (hl-line-face): Use it.
-
-       * image-mode.el (image-mode): Fix last fix.
-       Suggested by Kim F. Storm.
-
-2006-08-29  Michael Albinus  <michael.albinus@gmx.de>
-
-       Sync with Tramp 2.0.54.
-
-       * net/tramp.el (tramp-convert-file-attributes): Call `eql' instead
-       of `=', because `tramp-get-remote-gid' might not always return an
-       integer when expected.
-       (tramp-register-file-name-handlers): `partial-completion-mode' is
-       unknown to XEmacs.
-       (tramp-time-diff): Don't use `floor', it might fail for large
-       differences.
-       (tramp-handle-make-auto-save-file-name): For Emacs 21, set
-       `tramp-auto-save-directory' if unset in order to guarantee unique
-       auto-save file names.
-
-2006-08-28  Chong Yidong  <cyd@stupidchicken.com>
-
-       * image-mode.el (image-mode): Display image as text on a terminal.
-
-2006-08-28  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/python.el (python-send-command): Simplify.
-       (run-python): Don't generate a new buffer unless `new' was specified.
-       Make sure we send `import emacs' to the proper process.
-
-       * progmodes/python.el (python-send-command): Don't wait for the command
-       to terminate.  Don't fiddle with compilation-parsing-end.
-
-2006-08-28  Chong Yidong  <cyd@stupidchicken.com>
-
-       * emacs-lisp/checkdoc.el (checkdoc-file-comments-engine):
-       Insert commentary after first line summary.
-
-       * woman.el (woman-follow): New function, based on `man-follow'.
-       (woman-mode-map): Use it.
-
-       * ibuffer.el (ibuffer-do-sort-by-recency): Perform full update
-       since ibuffer-do-sort-by-recency does not define a sorter.
-
-2006-08-28  Kim F. Storm  <storm@cua.dk>
-
-       * find-dired.el (find-dired): Use shell-quote-argument to properly
-       escape ( and ) args.  Also use it on {} and ; args in default
-       value of find-ls-option string.
-       (find-grep-dired): Use shell-quote-argument on {} and ; args.
-
-2006-08-27  Michael Olson  <mwolson@gnu.org>
-
-       * emacs-lisp/tq.el: Small grammar fix in comments.
-       (tq-enqueue): Check for existence of queue rather than the
-       head queue item's question, which was a no-op.
-       (tq-filter, tq-process-buffer): Make sure the process buffer
-       exists before making it the current buffer.
-
-2006-08-27  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el (mac-apple-event-map): Rename hicommand to hi-command.
-       (mac-dnd-drop-data): Apply 2006-08-22 change for x-dnd-drop-data.
-       (special-event-map): Apply 2006-08-16 change for x-win.el.
-
-2006-08-26  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/python.el (python-send-receive): Wait in the
-       process's buffer so as to check the right buffer-local variables.
-
-2006-08-25  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * emacs-lisp/checkdoc.el: Remove * in defcustoms.
-       (defgroup checkdoc): Move to beginning.
-
-       * progmodes/python.el (python-preoutput-skip-next-prompt): New var.
-       (python-preoutput-continuation): Remove.
-       (python-preoutput-filter): Simplify correspondingly.
-       Remove handling of _emacs_ok.  Make sure we skip _emacs_out's prompts.
-       Loop around to catch embedded _emacs_out output.
-       (run-python): Send the import&print command on a single line.
-       (python-send-command): Send command&print on a single line.
-       (python-send-string): Only add double \n if needed.
-       (python-send-receive): Loop until the result comes.
-       (python-mode-running): Defvar it.
-       (python-setup-brm): Remove unused var `menu'.
-       Only bind py-mode-map and `features' around brm-init.
-       (python-calculate-indentation): Remove unused var `point'.
-       (python-beginning-of-defun): Remove unused var `def-line'.
-
-2006-08-25  Richard Stallman  <rms@gnu.org>
-
-       * kmacro.el (kmacro-repeat-on-last-key): Doc fix.
-
-2006-08-25  Michael Kifer  <kifer@cs.stonybrook.edu>
-
-       * viper.el (viper-set-hooks): Use frame bindings for
-       viper-vi-state-cursor-color.
-       (viper-non-hook-settings): Don't set default
-       mode-line-buffer-identification.
-
-       * viper-util.el (viper-set-cursor-color-according-to-state): New fun.
-       (viper-set-cursor-color-according-to-state)
-       (viper-get-saved-cursor-color-in-replace-mode)
-       (viper-get-saved-cursor-color-in-insert-mode): Make conditional on
-       viper-emacs-state-cursor-color.
-
-       * viper-cmd.el (viper-envelop-ESC-key): Bug fix.
-       (viper-undo): Use point if undo-beg-posn is nil.
-       (viper-insert-state-post-command-sentinel, viper-change-state-to-emacs)
-       (viper-after-change-undo-hook): Don't use
-       viper-emacs-state-cursor-color by default.
-       (viper-undo): More sensible positioning after undo.
-
-       * viper-ex.el (ex-splice-args-in-1-letr-cmd): Get rid of caddr.
-       (viper-emacs-state-cursor-color): Default to nil, since this feature
-       doesn't work well yet.
-
-       * ediff-mult.el (ediff-intersect-directories)
-       (ediff-get-directory-files-under-revision, ediff-dir-diff-copy-file):
-       always expand filenames.
-
-2006-08-24  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * tumme.el: Remove * in defcustoms's docstrings.
-
-2006-08-24  Chong Yidong  <cyd@stupidchicken.com>
-
-       * emacs-lisp/timer.el (timer-set-idle-time, run-with-idle-timer):
-       Accept internal time format for SECS arg.
-       (timer-relative-time): Doc fix.
-
-       * jit-lock.el: "Stealth fontification by requeuing timers" patch,
-       adapted from Martin Rudalics.
-       (jit-lock-stealth-repeat-timer, jit-lock-stealth-buffers): New vars.
-       (jit-lock-mode): Create jit-lock-stealth-repeat-timer.
-       (jit-lock-stealth-fontify): Reschedule as a idle timer instead of
-       using sit-for.
-
-2006-08-24  Francesc Rocher  <francesc.rocher@gmail.com>
-
-       * cus-start.el (all): Add `overline-margin' and
-       `x-underline-at-descent-line'.
-
-2006-08-24  Kim F. Storm  <storm@cua.dk>
-
-       * progmodes/grep.el (grep-find-use-xargs): Use explicit value `exec'
-       to mean "use find -exec"; nil now unambiguously means auto-detect.
-       (grep-compute-defaults): Set grep-find-use-xargs to `exec' if not `gnu'.
-       Use shell-quote-argument to build grep-find-command and
-       grep-find-template.
-       (rgrep): Use shell-quote-argument to properly quote arguments to find.
-       Reported by Tom Seddon.
-
-2006-08-23  Chong Yidong  <cyd@stupidchicken.com>
-
-       * startup.el (fancy-splash-head): Give instructions for dismissing
-       the splash screen for default startup too.
-       (display-startup-echo-area-message, fancy-splash-screens)
-       (use-fancy-splash-screens-p): New arg hide-on-input.  If nil, show
-       all splash text at once and keep the splash buffer around.
-       (command-line-1): Give display-startup-echo-area-message a t arg.
-
-2006-08-23  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-follow-gnus-link): Make sure the dedicated
-       gnus frame is selected.
-
-2006-08-23  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-starting): Reset gdb-signalled to nil.
-
-2006-08-22  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-set-matches-1): Fix full matching for subdirs.
-       Add suffix matching for subdirs.
-
-2006-08-22  Jorgen Schaefer  <forcer@forcix.cx>  (tiny change)
-
-       * x-dnd.el (x-dnd-drop-data): Don't call goto-char if
-       mouse-yank-at-point is non-nil.
-
-2006-08-22  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-frame-memory-buffer): Make frame
-       a bit wider and remove fringes to fit initial output on line.
-
-2006-08-21  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * frame.el (blink-cursor-end): Only ignore the error we care about.
-       (blink-cursor-mode): Use blink-cursor-end to simplify the code.
-
-2006-08-21  Richard Stallman  <rms@gnu.org>
-
-       * whitespace.el (whitespace-cleanup): Doc fix.
-
-2006-08-20  Ryan Yeske  <rcyeske@gmail.com>
-
-       * net/rcirc.el (rcirc-show-maximum-output): New var.
-       (rcirc-buffer-process): If no buffer argument is supplied, use
-       current-buffer.
-       (rcirc-complete-nick): Complete to the last completed nick first.
-       (rcirc-mode): Preserve the value of `rcirc-urls' across
-       connections.  Setup scroll function.
-       (rcirc-scroll-to-bottom): New function.
-       (rcirc-print): Use nick syntax around regexp work.
-       Notice dim-nicks speaking only if they say our nick.
-       (rcirc-update-activity-string): Do not show the modeline indicator
-       if there are no live rcirc processes.
-       (rcirc-cmd-ignore): Ignore case.
-       (rcirc-browse-url-at-point): Fix off-by-one error.
-
-2006-08-20  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/python.el: Remove * in defcustom docstrings.
-       (run-python, python-proc, python-try-complete): Use derived-mode-p.
-       (python-mode): Set tab-width and indent-tabs-mode.
-
-2006-08-20  Dave Love  <fx@gnu.org>
-
-       * progmodes/python.el: Update to Dave Love's latest version.
-       (python-font-lock-keywords, python-mode): Don't use
-       font-lock-syntax-table, but match symbol elements explicitly instead.
-       (python-mode-map): Add help, and a few more key bindings.
-       (python-skip-comments/blanks): Move out of comments as well.
-       (python-continuation-line-p): Behave better with unbalanced parens.
-       (python-blank-line-p): New fun.
-       (python-open-block-statement-p): Don't use a heuristic.
-       (python-outdent-p): Better handle blocks-in-the-same-line.
-       (python-calculate-indentation): Misc improvements.
-       (python-comment-indent): Remove.
-       (python-block-pairs): New var.
-       (python-first-word): New fun.
-       (python-indentation-levels): Handle more common cases.
-       (python-indent-line-1): Add `leave' argument.
-       (python-indent-region): New fun.
-       (python-skip-out): New fun.
-       (python-beginning-of-statement, python-end-of-statement): Use it.
-       (python-next-statement): Return correct count even at eob.
-       (python-end-of-block): Fix paren-typo.
-       (python-imenu-create-index): Add module variables.
-       (run-python): Add `new' arg.
-       Check we're at a prompt before returning.
-       (python-send-command): Move to end of buffer.
-       Wait for prompt to return.
-       (python-set-proc): New fun.
-       (python-imports): New var.
-       (python-describe-symbol): Use it.  Adjust to new interface of `ehelp'.
-       (python-eldoc-function): Try to move out of arg list.
-       (python-outline-level): Offset by 1.
-       (python-find-imports): New fun.
-       (python-symbol-completions): Use python-imports.
-       (python-module-path, ffap-alist): Add support for ffap.
-       (python-skeletons, python-mode-abbrev-table, def-python-skeleton)
-       (python-insert-*, python-default-template, python-expand-template):
-       Add templates/skeletons.
-       (python-setup-brm): Support for Bicycle Repair Man.
-       (python-abbrev-syntax-table): New var.
-       (python-abbrev-pc-hook, python-pea-hook): New funs.
-
-2006-08-20  Chong Yidong  <cyd@stupidchicken.com>
-
-       * frame.el (blink-cursor-start): Set timer first.
-       (blink-cursor-end): Ignore timer cancelling errors.
-       Suggested by Ken Manheimer.
-
-2006-08-20  Juanma Barranquero  <lekktu@gmail.com>
-
-       * newcomment.el (comment-box): Call `comment-normalize-vars'.
-       Add autoload cookie.
-
-2006-08-20  Richard Stallman  <rms@gnu.org>
-
-       * simple.el (line-number-at-pos): Doc fix.
-
-       * emacs-lisp/timer.el (run-with-idle-timer): Pass t to
-       timer-activate-when-idle, so timer can run before Emacs becomes
-       non-idle again.
-
-2006-08-18  Yoni Rabkin Katzenell  <yoni-r@actcom.com>  (tiny change)
-
-       * whitespace.el (whitespace-cleanup-internal): New optional arg
-       REGION-ONLY.  If it's non-nil, modify the message to the user
-       accordingly.
-       (whitespace-cleanup-region): Call whitespace-cleanup-internal with
-       a non-nil argument.
-
-2006-08-18  Gustav H\e,Ae\e(Bllberg  <gustav@gmail.com>  (tiny change)
-
-       * rect.el (spaces-string): Simplify and add doc string.
-
-2006-08-17  Romain Francoise  <romain@orebokech.com>
-
-       * progmodes/gdb-ui.el (gdb-edit-locals-value): Balance parens.
-
-2006-08-17  Richard Stallman  <rms@gnu.org>
-
-       * compare-w.el (compare-windows): lambda's take an arg and pass
-       it to compare-windows-skip-whitespace.
-
-2006-08-17  Martin Rudalics  <rudalics@gmx.at>
-
-       * jit-lock.el (jit-lock-fontify-now): Protect the modified status of
-       the right buffer.
-
-2006-08-17  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * pcvs-parse.el (cvs-parse-table): Accept the new `...' format for
-       removed files.
-
-2006-08-17  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-locals-watch-map)
-       (gdb-locals-watch-map-1): Suppress keymap first.
-       (gdb-edit-locals-map-1): New variable.
-       (gdb-edit-locals-value): New function.
-       (gdb-stack-list-locals-handler): Use them.
-
-2006-08-16  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * mouse.el (global-map): Allow yanking with mouse-2 at a spot whose
-       cursor would normally be drawn in the fringe.
-
-       * font-lock.el (font-lock-extend-region-wholelines): Fix up typo.
-       Reported by Martin Rudalics <rudalics@gmx.at>.
-
-2006-08-16  Richard Stallman  <rms@gnu.org>
-
-       * term/x-win.el (x-clipboard-yank): Specify * in interactive spec.
-       (special-event-map): Process drag-n-drop events this way.
-
-       * simple.el (move-beginning-of-line): Test whether fields
-       would prevent motion back to line's first visible character.
-       If so, stop where the fields would stop the motion.
-
-       * newcomment.el (comment-indent): Fully update INDENT
-       before checking to see if it will change the text.
-
-       * cus-edit.el (custom-newline): New function.
-       (custom-mode-map): Bind newline to custom-newline.
-
-       * compare-w.el (compare-windows): Factor compare-ignore-whitespace
-       into ignore-whitespace.
-       Check each buffer for its skip-function.
-       Handle compare-windows-skip-whitespace special-case test
-       by returning t from default skip function.
-
-2006-08-15  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-clock-special-range)
-       (org-clock-update-time-maybe): New functions.
-       (org-stamp-time-of-day-regexp): Allow weekday to be of word chars,
-       not only a-z.
-       (org-agenda-get-blocks): Allow multiple blocks per headline.
-       (org-timestamp-change): Call `org-clock-update-time-maybe'.
-       (org-export-html-title-format)
-       (org-export-html-toplevel-hlevel): New options.
-       (org-export-language-setup): Add support for Czech.
-       (org-mode, org-insert-todo-heading, org-find-visible)
-       (org-find-invisible, org-invisible-p, org-invisible-p2)
-       (org-back-to-heading, org-on-heading-p, org-up-heading-all)
-       (org-show-subtree, org-show-entry, org-make-options-regexp):
-       Remove compatibility support for old outline-mode.
-       (org-check-occur-regexp): Funtion removed.
-       (org-on-heading-p, org-back-to-heading): Made defalias.
-       (org-set-local): New defsubst.
-       (org-set-regexps-and-options, org-mode)
-       (org-set-font-lock-defaults, org-edit-agenda-file-list)
-       (org-timeline, org-agenda-list, org-todo-list, org-tags-view)
-       (org-remember-apply-template, org-table-edit-field)
-       (org-table-edit-formulas, orgtbl-mode, org-export-as-ascii)
-       (org-set-autofill-regexps): Use `org-set-local'.
-       (org-table-eval-formula): Fix bug with parsing of display flags.
-
-2006-08-15  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-info-stack-custom): Indicate selected
-       frame with fringe arrow.  Suggested by Simon Marshall
-       <simon.marshall@misys.com>.
-       (gdb-stack-position): New variable.
-       (gdb-starting, gdb-exited): Reset gdb-stack-position to nil.
-       (gdb-frames-mode): Set gdb-stack-position to nil.
-       Add to overlay-arrow-variable-list
-       (gdb-reset): Delete gdb-stack-position from above list.
-
-2006-08-14  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * term/x-win.el (menu-bar-edit-menu): Disable paste if buffer is
-       read only.
-
-2006-08-13  Romain Francoise  <romain@orebokech.com>
-
-       * cus-theme.el (customize-create-theme)
-       (custom-theme-visit-theme): End `y-or-n-p' prompt with a space.
-
-       * filesets.el (filesets-add-buffer): Ditto.
-
-       * pcvs.el (cvs-change-cvsroot): Ditto.
-
-2006-08-13  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-frame-separate-io-buffer)
-       (gdb-use-separate-io-buffer, menu): Avoid using `inferior' in text.
-       (gdb-memory-mode, gdb-locals-watch-map): Don't quote lambda
-       expressions.
-       (gdb-info-breakpoints-custom): Use gdb-breakpoint-regexp.
-       Only search till end of line.
-       Add face to function names in case of no filename.
-       Add face to variable names of watchpoints.
-
-2006-08-12  Robert Thorpe  <rthorpe@realworldtech.com>  (tiny change)
-
-       * cus-start.el <indent-tabs-mode>: Move to the `indent'
-       customization group.
-
-2006-08-12  Ken Manheimer  <ken.manheimer@gmail.com>
-
-       * allout.el (allout-prior-bindings, allout-added-bindings):
-       Remove, after long deprecation.
-       (allout-beginning-of-line-cycles, allout-end-of-line-cycles):
-       Add customization vars controlling allout-beginning-of-line and
-       allout-end-of-line conveniences.
-       (allout-header-prefix, allout-use-mode-specific-leader)
-       (allout-use-mode-specific-leader, allout-mode-leaders):
-       Revise docstrings.
-       (allout-infer-header-lead): Change to be an alias for
-       allout-infer-header-lead-and-primary-bullet.
-       (allout-infer-header-lead-and-primary-bullet): New version of
-       allout-infer-header-lead which assigns the primary bullet to the
-       same as the header lead, when its being changed.
-       (allout-infer-body-reindent): Apply regexp-quote instead of
-       unconditionally prepending "\\", so that all literal
-       allout-header-prefix and allout-primary-bullet strings are
-       properly handled.
-       (allout-add-resumptions): Add optional qualifier for extending or
-       appending to existing values, rather than replacing them.
-       (allout-view-change-hook): Clarify docstring.
-       (allout-exposure-change-hook): Take explicit arguments, via
-       run-hook-with-args.
-       (allout-structure-added-hook)
-       (allout-structure-deleted-hook)
-       (allout-structure-shifted-hook): New hooks analogous to
-       allout-exposure-change-hook for other kinds of structural outline
-       edits.
-       (allout-encryption-plaintext-sanitization-regexps): New encryption
-       customization variable, by which cooperating modes can provde
-       massage of the plaintext without actually being passed it.
-       (allout-encryption-ciphertext-rejection-regexps)
-       (allout-encryption-ciphertext-rejection-ceiling): New encryption
-       customization variables, by which cooperating modes can prohibit
-       rare but possible ciphertext patterns from fouling their
-       operation, with actually being passed the ciphertext.
-       (allout-mode): Run activation and deactivation hooks after the
-       minor-mode variable has been toggled, to clarify the mode
-       disposition.  The new encryption ciphertext rejection variable is
-       used to ensure that the ciphertext does not contain text that
-       would be recognized as outline structural elements by allout.
-       Substite allout-beginning-of-line and allout-end-of-line for
-       conventionall beginning-of-line and end-of-line bindings.
-       If allout-old-style-prefixes is non-nil, don't nullify it on mode
-       activation!
-       (allout-beginning-of-line): Respect `allout-beginning-of-line-cycles'.
-       (allout-end-of-line): Respect `allout-end-of-line-cycles'.
-       (allout-chart-subtree): Implement new mode, charting only the
-       visible items in the subtree, when new 'visible' parameter is non-nil.
-       (allout-end-of-subtree): Properly handle the last item in the buffer.
-       (allout-pre-command-business, allout-command-counter):
-       Increment an advertised counter so that cooperating enhancements can
-       track revisions of items.
-       (allout-open-topic): Run allout-structure-added-hook with suitable
-       arguments.
-       (allout-shift-in): Run allout-structure-shifted-hook with suitable
-       arguments.
-       (allout-shift-out): Fix doubling for negative args and ensure call
-       of allout-structure-shifted-hook by solely using allout-shift-in.
-       (allout-kill-line, allout-kill-topic):
-       Run allout-structure-deleted-hook with suitable arguments.
-       (allout-yank-processing): Run allout-structure-added-hook with
-       proper arguments.
-       (allout-yank): Enclose activity in allout-unprotected.
-       (allout-flag-region): Run allout-exposure-change-hook with
-       suitable arguments, instead of making the callee infer the arguments.
-       (allout-encrypt-string):
-       Support allout-encryption-plaintext-sanitization-regexps,
-       allout-encryption-ciphertext-rejection-regexps, and
-       allout-encryption-ciphertext-rejection-ceiling.  Indicate correct
-       en/de cryption mode in symmetric encryption failure message.
-       (allout-obtain-passphrase): Use copy-sequence to get a distinct
-       copy of the passphrase, and don't zero it or we'll corrupt the
-       stashed copy.
-       (allout-create-encryption-passphrase-verifier)
-       (allout-verify-passphrase): Respect the new signature for
-       allout-encrypt-string.
-       (allout-get-configvar-values): Convenience for getting a
-       configuration variable value and handling its absence gracefully.
-
-2006-08-11  Romain Francoise  <romain@orebokech.com>
-
-       * obsolete/zone-mode.el: Delete.
-
-2006-08-11  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * textmodes/dns-mode.el (dns-mode): Use before-save-hook.
-
-2006-08-11  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * emacs-lisp/bindat.el (bindat-ip-to-string):
-       Use `format-network-address' if possible.
-
-2006-08-11  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * x-dnd.el (x-dnd-init-frame): Call x-register-dnd-atom.
-
-2006-08-10  Chong Yidong  <cyd@stupidchicken.com>
-
-       * emacs-lisp/edebug.el (edebug-recursive-edit): Don't save and
-       restore unread-command-events here.
-       (edebug-display): Do it here, to detect sit-for interruptions.
-
-2006-08-10  Romain Francoise  <romain@orebokech.com>
-
-       * textmodes/dns-mode.el: Alias `zone-mode' to `dns-mode'.
-       (dns-mode-soa-auto-increment-serial): New user option.
-       (dns-mode-soa-maybe-increment-serial): New function.
-       (dns-mode): Add the latter to `write-contents-functions'.
-
-       * obsolete/zone-mode.el: Move to obsolete/ from net/.
-       Delete autoload cookies.
-
-2006-08-10  John Wiegley  <johnw@newartisans.com>
-
-       * eshell/em-glob.el (eshell-glob-chars-list)
-       (eshell-glob-translate-alist): Add support for [^g] in character globs.
-
-2006-08-10  Richard Stallman  <rms@gnu.org>
-
-       * facemenu.el (facemenu-add-face): Pass frame to facemenu-active-faces.
-       (facemenu-set-face): Doc fix.
-       (facemenu-listed-faces): Doc fix.
-
-2006-08-09  Chong Yidong  <cyd@stupidchicken.com>
-
-       * avoid.el (mouse-avoidance-animating-pointer): New var.
-       (mouse-avoidance-nudge-mouse): Use it.
-       (mouse-avoidance-banish): Rename from mouse-avoidance-banish-hook.
-       (mouse-avoidance-exile): Rename from mouse-avoidance-exile-hook
-       (mouse-avoidance-fancy): Rename from mouse-avoidance-fancy-hook.
-       Don't activate if currently animating.  All callers changed.
-
-2006-08-09  John Wiegley  <johnw@newartisans.com>
-
-       * calendar/timeclock.el (timeclock-use-elapsed): Added a new
-       variable, which causes timeclock to report elapsed time worked,
-       instead of just work remaining.
-
-2006-08-09  Kenichi Handa  <handa@m17n.org>
-
-       * international/latexenc.el (latexenc-find-file-coding-system):
-       Fix for the case that the 2nd element of arg-list is a cons.
-
-2006-08-08  Chong Yidong  <cyd@stupidchicken.com>
-
-       * info.el (Info-fontify-node): Handle preceding `in' for note
-       reference hiding rules.
-
-2006-08-08  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/sh-script.el (sh-quoted-subshell): Make sure we don't
-       mistake a closing " for an opening one.
-
-2006-08-07  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * term/xterm.el (terminal-init-xterm): Add more key bindings.
-
-2006-08-07  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * complete.el (PC-do-completion): Filter out completions matching
-       completion-ignored-extensions before checking whether there are
-       multiple completions.
-       Don't use `list' unnecessarily when building completion tables.
-
-2006-08-06  Richard Stallman  <rms@gnu.org>
-
-       * help.el (describe-mode): Make minor mode list more concise.
-
-2006-08-05  Chong Yidong  <cyd@stupidchicken.com>
-
-       * bindings.el: Give mode-line-format, mode-line-modes, and
-       mode-line-position `standard-value' properties.
-
-2006-08-05  Eli Zaretskii  <eliz@gnu.org>
-
-       * buff-menu.el (list-buffers-noselect): For Info buffers, use
-       "(file)node" instead of the file name.
-
-2006-08-05  Richard Stallman  <rms@gnu.org>
-
-       * faces.el (escape-glyph): Doc fix.
-
-2006-08-04  Kenichi Handa  <handa@m17n.org>
-
-       * international/mule-diag.el (describe-font): Improve docstring
-       and error message.  Use frame-parameter (not frame-parameters).
-
-2006-08-03  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/gud.el (gdb-script-font-lock-syntactic-keywords):
-       Correctly mark the end-of-docstring char.
-
-2006-08-03  Chong Yidong  <cyd@stupidchicken.com>
-
-       * simple.el (line-move-to-column): Constrain move-to-column to
-       current field.
-
-2006-08-03  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * font-lock.el (font-lock-beg, font-lock-end)
-       (font-lock-extend-region-functions): New vars.
-       (font-lock-extend-region-multiline)
-       (font-lock-extend-region-wholelines): New functions.
-       (font-lock-default-fontify-region): Use them.
-       (font-lock-extend-jit-lock-region-after-change): Only round up
-       if font-lock-default-fontify-region will do it as well.
-
-       * font-lock.el (font-lock-extend-after-change-region-function):
-       Rename from font-lock-extend-region-function.
-       (font-lock-extend-region): Remove by inlining at call sites.
-       (font-lock-after-change-function): Don't needlessly round up to a whole
-       number of lines.
-       (font-lock-extend-jit-lock-region-after-change): Be more careful about
-       the boundary conditions and the interactions between the various ways
-       to extend the region.
-
-2006-08-02  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * jit-lock.el (jit-lock-fontify-now): Preserve the buffer's
-       modification status when forcing the second redisplay.
-
-2006-08-03  Kim F. Storm  <storm@cua.dk>
-
-       * edmacro.el (edmacro-fix-menu-commands): Ignore switch-frame.
-
-2006-08-02  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * pcvs-util.el (cvs-get-buffer-create): Obey `noreuse' even if `name'
-       doesn't look like a file name.
-
-       * complete.el (PC-expand-many-files): Avoid signalling an error when
-       the current directory doesn't exist.  Reported by Micha\e,Ak\e(Bl Cadilhac.
-
-2006-08-02  Andreas Schwab  <schwab@suse.de>
-
-       * bindings.el (mode-line-format): Simplify reference to vc-mode.
-
-2006-08-02  Nick Roberts  <nickrob@snap.net.nz>
-
-       * bindings.el (map): Make mode-line-buffer-identification-keymap
-       before defining propertized-buffer-identification.
-
-2006-08-01  Richard Stallman  <rms@gnu.org>
-
-       * bindings.el (mode-line-format): Adjust spacing around vc-mode.
-
-2006-08-02  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-find-source-frame): Make nil the
-       default value.
-       (gdb-find-source-frame): New function.
-       (menu): Add to menu bar.
-
-2006-08-01  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * font-core.el (font-lock-extend-region-function)
-       (font-lock-extend-region): Move to font-lock.el.
-
-       * font-lock.el (font-lock-extend-region-function)
-       (font-lock-extend-region): Move from font-core.el.  Simplify.
-
-       * jit-lock.el (jit-lock-fontify-now): Cause a second redisplay
-       if needed.
-       (jit-lock-start, jit-lock-end): New dynamic scoped vars.
-       (jit-lock-after-change-extend-region-functions): New hook.
-       (jit-lock-after-change): Use it instead of hard-coding font-lock code.
-
-       * font-lock.el (font-lock-extend-jit-lock-region-after-change): New fun.
-       (font-lock-turn-on-thing-lock): Use it.
-
-       * longlines.el (longlines-show-region): Make it work on read-only
-       buffers as well.
-
-2006-08-01  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-set-hollow): Check for gud-last-last-frame.
-
-2006-07-31  Richard Stallman  <rms@gnu.org>
-
-       * progmodes/vhdl-mode.el (vhdl-speedbar-display-directory)
-       (vhdl-speedbar-display-projects): Update old obsolete
-       speedbar variable names.
-
-2006-07-31  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-find-source-frame): New option.
-       (gdb-stopped): Use it.
-
-       * t-mouse.el (t-mouse-mode): Use set-process-query-on-exit-flag.
-
-2006-07-29  Chong Yidong  <cyd@stupidchicken.com>
-
-       * loadhist.el (unload-feature): Handle new `(t . SYMBOL)' format
-       for load-history elements.
-
-2006-07-29  Eli Zaretskii  <eliz@gnu.org>
-
-       * files.el (convert-standard-filename): For Cygwin, replace
-       characters not allowed in Windows file names.
-       (make-auto-save-file-name): Add Cygwin to the list of systems
-       where the auto-save file name needs to be run through
-       convert-standard-filename.
-
-2006-07-29  Lennart Borgman  <lennart.borgman.073@student.lu.se>
-
-       * window.el (bw-get-tree): Don't integerp subtree if it's nil.
-
-2006-07-28  Richard Stallman  <rms@gnu.org>
-
-       * bindings.el (mode-line-frame-identification)
-       (propertized-buffer-identification): Centralize the code
-       to initialize the variable.
-
-       * progmodes/grep.el (grep-default-command): Catch errors from
-       wildcard-to-regexp.
-
-2006-07-29  Kim F. Storm  <storm@cua.dk>
-
-       * progmodes/grep.el (grep-tag-default): New function.
-       (grep-default-command, grep-read-regexp): Use it.
-       (grep-read-files): Use car of grep-files-history or grep-files-aliases
-       as default if nothing else applies.
-
-2006-07-28  Bill Atkins  <atkinw@rpi.edu>  (tiny change)
-
-       * wdired.el (wdired-change-to-wdired-mode, wdired-change-to-dired-mode):
-       Throw error if buffer is not in Dired and Wdired mode, respectively.
-
-2006-07-28  Chong Yidong  <cyd@stupidchicken.com>
-
-       * cus-edit.el (custom-no-edit): Revert 2006-07-27 change, so that
-       self-insert-command keys don't activate buttons.
-       (custom-mode-map): Just don't bind "\C-m" to `custom-no-edit'.
-
-2006-07-29  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-info-breakpoints-custom): Use different
-       faces for enable character.
-
-2006-07-28  Nick Roberts  <nickrob@snap.net.nz>
-
-       * Makefile.in (recompile): Update comment to reflect change
-       on 2004-04-21.
-
-2006-07-27  Richard Stallman  <rms@gnu.org>
-
-       * cus-edit.el (customize-package-emacs-version-alist): Doc fix.
-       (customize-package-emacs-version): Change msg when pkg has no entry.
-       (custom-no-edit): On a button, do like widget-button-press.
-
-2006-07-27  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * term/xterm.el (terminal-init-xterm): Fix bindings for C-tab,
-       S-tab and C-S-tab.
-
-2006-07-28  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/which-func.el (which-function): Fix documentation/
-       comment typo.
-
-2006-07-26  Richard Stallman  <rms@gnu.org>
-
-       * textmodes/ispell.el (ispell-word): If we replace the word,
-       move point to the end.  Insert before deleting.
-
-2006-07-26  Chong Yidong  <cyd@stupidchicken.com>
-
-       * subr.el (sit-for): Use new SECONDS arg of read-event instead of
-       a timer.
-
-2006-07-26  Mathias Dahl  <mathias.dahl@gmail.com>
-
-       * tumme.el (tumme-backward-image): Add prefix argument.  Add error
-       when at first image.
-       (tumme-forward-image): Add prefix argument.  Add error when at last
-       image.
-
-2006-07-25  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * tabify.el (tabify-regexp): Use more specific regexps.
-       (tabify): Avoid modifying the buffer unnecessarily.
-
-2006-07-25  Mathias Dahl  <mathias.dahl@gmail.com>
-
-       * tumme.el (tumme-track-original-file): Add `buffer-live-p' check.
-       (tumme-format-properties-string): Handle empty `buf'.
-       (tumme-get-comment): Change variable names inside `let'.
-       Add missing `let' variable that cause font-lock problems.
-       (tumme-write-comments): Change variable names inside `let'.
-       Add missing `let' variable that cause font-lock problems.
-       (tumme-forward-image): Rename from `tumme-forward-char'.
-       (tumme-backward-image): Rename from `tumme-backward-char'.
-
-2006-07-25  Masatake YAMATO  <jet@gyve.org>
-
-       * progmodes/ld-script.el (ld-script-keywords)
-       (ld-script-font-lock-keywords, ld-script-builtins): Update keywords
-       and add comments.
-
-2006-07-25  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-set-gud-minor-mode-existing-buffers)
-       (gdb-resync, gdb-prompt, gdb-starting, gdb-exited, gdb-stopped)
-       (gdb-set-gud-minor-mode-existing-buffers-1): Use different faces
-       for status indicator.
-
-2006-07-24  Richard Stallman  <rms@gnu.org>
-
-       * xml.el (xml-parse-file): Clean up, and use with-temp-buffer.
-
-       * subr.el (dolist, dotimes): Use interned symbols for locals.
-       (--dotimes-limit--, --dolist-tail--): New defvars.
-       (looking-back): Doc fix.
-
-       * replace.el (replace-match-string-symbols): Handle dotted lists.
-
-2006-07-24  Mathias Dahl  <mathias.dahl@gmail.com>
-
-       * tumme.el (tumme-write-tags): Add.
-       (tumme-write-comments): Add.
-       (tumme-tag-files): Change to use `tumme-write-tags'.
-       (tumme-tag-thumbnail): Change to use `tumme-write-tags'.
-       (tumme-dired-comment-files): Change to use `tumme-write-comments'.
-       (tumme-save-information-from-widgets): Change to use
-       `tumme-write-comments' and `tumme-write-tags'.
-       (tumme-comment-thumbnail): Change to use `tumme-write-comments'.
-       (tumme-write-tag): Remove.
-       (tumme-write-comment): Remove.
-       (tumme-display-previous-thumbnail-original): Remove empty line.
-       (tumme-widget-list): Add punctuation.
-
-2006-07-24  Mathias Dahl  <mathias.dahl@gmail.com>
-
-       * tumme.el (tumme-line-up): Add an extra check for end of buffer.
-
-2006-07-24  Daiki Ueno  <ueno@unixuser.org>
-
-       * pgg-def.el (pgg-truncate-key-identifier): Truncate the key ID to 8
-       letters from the end.  Thanks to "David Smith" <davidsmith@acm.org>
-       and andreas@altroot.de (Andreas V\e,Av\e(Bgele).
-
-2006-07-23  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * mouse.el (mouse-on-link-p): Doc fix.
-
-2006-07-23  Nick Roberts  <nickrob@snap.net.nz>
-
-       * emacs-lisp/find-func.el (find-function-search-for-symbol):
-       Handle "C-h f `".
-
-2006-07-22  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * ibuffer.el (ibuffer-formats): Use left alignment for the mode
-       column.
-
-2006-07-22  Matt Hodges  <MPHodges@member.fsf.org>
-
-       * textmodes/table.el: Add move-beginning-of-line and
-       move-end-of-line to Point Motion Only Group.
-
-2006-07-22  Eric Hanchrow  <offby1@blarg.net>  (tiny change)
-
-       * progmodes/delphi.el (delphi-fill-comment): Use save-restriction.
-
-2006-07-22  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac@lrde.org>
-
-       * startup.el (user-mail-address): Initialize from the `EMAIL'
-       environment variable first.  Document this.
-       (command-line): Ditto.
-
-2006-07-22  Nick Roberts  <nickrob@snap.net.nz>
-
-       * help-mode.el (help-function-def, help-variable-def)
-       (help-face-def): Print a message in the minibuffer.
-
-2006-07-21  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * term/xterm.el (terminal-init-xterm): Fix key bindings
-       syntax.  Bind S-return, C-M-., C-TAB, S-TAB and C-S-TAB.
-
-2006-07-21  Eli Zaretskii  <eliz@gnu.org>
-
-       * dos-w32.el (find-buffer-file-type-coding-system): Support calls
-       where `(nth 1 command)' is a cons cell.  Doc fix.
-
-       * textmodes/po.el (po-find-charset): Doc fix.
-
-2006-07-21  Ken Manheimer  <ken.manheimer@gmail.com>
-
-       * allout.el (allout-unprotected, allout-e-o-prefix-p)
-       (allout-beginning-of-current-line, allout-end-of-current-line)
-       (allout-next-visible-heading, allout-open-topic)
-       (allout-kill-topic, allout-yank-processing, allout-resolve-xref)
-       (allout-flag-current-subtree, allout-show-to-offshoot)
-       (allout-hide-current-entry, allout-show-current-branches)
-       (allout-hide-region-body, allout-old-expose-topic)
-       (allout-listify-exposed, allout-latex-verbatim-quote-curr-line)
-       (allout-mark-topic, allout-adjust-file-variable): Enclose scopes
-       containing `beginning-of-line' and `end-of-line' with
-       `inhibit-field-text-motion' t.
-
-2006-07-21  Eli Zaretskii  <eliz@gnu.org>
-
-       * frame.el (focus-follows-mouse): Document that it doesn't have
-       any effect on MS-Windows.
-
-2006-07-20  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/sh-script.el (sh-quoted-subshell): Further fix last change.
-
-2006-07-20  Jay Belanger  <belanger@truman.edu>
-
-       * calc.el (calc-previous-alg-entry): Remove variable.
-
-       * calc-aent.el (calc-alg-entry-history, calc-quick-calc-history):
-       New variables.
-       (calc-alg-entry): Use `calc-alg-entry-history'.
-       (calc-do-quick-calc): Use `calc-quick-calc-history'.
-       Remove reference to `calc-previous-alg-entry'.
-       (calcAlg-edit, calcAlg-enter): Remove reference to
-       `calc-previous-alg-entry'.
-       (calcAlg-previous): Use `previous-history-element' instead of
-       `calc-previous-alg-entry'.
-       (calc-do-alg-entry): Use history when calling `read-from-minibuffer'.
-       Change keybinding for `calcAlg-plus-minus', add keybindings for
-       `previous-history-element' and `next-history-element'.
-
-       * calc-rewr.el (calc-match): Remove reference to
-       `calc-previous-alg-entry'.
-
-       * calc-sel.el (calc-selection-history): New variable.
-       (calc-enter-selection, calc-sel-mult-both-sides)
-       (calc-sel-add-both-sides): Use `calc-selection-history'.
-
-       * calc-map.el (calc-get-operator-history): New variable.
-       (calc-get-operator): Use `calc-get-operator-history'.
-
-       * calcalg3.el (calc-curve-fit-history): New variable.
-       (calc-curve-fit): Use `calc-curve-fit-history'.
-
-2006-07-20  Kenichi Handa  <handa@m17n.org>
-
-       * international/mule-cmds.el (select-safe-coding-system): Fix the
-       way of deciding eol-type of the coding system.
-
-2006-07-20  Alan Mackenzie  <acm@muc.de>
-
-       * progmodes/cc-langs.el (c-emacs-variable-inits): New variable.
-       (c-lang-setvar): New macro.
-       (c-make-init-lang-vars-fun): Use the initialization forms in
-       c-emacs-variable-inits in addition to those in c-lang-variable-inits.
-       (comment-start, comment-end, comment-start-skip): Change these from
-       c-lang-defvar's to c-lang-setvar's.
-
-       * progmodes/cc-mode.el (c-make-emacs-variables-local): New macro,
-       which calls make-local-variable on the elements of
-       c-emacs-variable-inits.
-       (c-init-language-vars-for): Call this new macro.
-
-2006-07-19  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/compile.el (compilation-error-regexp-alist-alist) <gnu>:
-       Try to rule out false positives due to time stamps.
-       (compilation-mode-font-lock-keywords): Remove rules made redundant
-       because of the above change.  Add `segmentation fault' to the known and
-       highlighted compilation termination messages.
-
-2006-07-19  Kim F. Storm  <storm@cua.dk>
-
-       * progmodes/grep.el (grep-find-ignored-directories):
-       Add .svn and _darcs to list.
-
-2006-07-19  Mathias Dahl  <mathias.dahl@gmail.com>
-
-       * dired.el (dired-mode-map): Add key binding `C-te' for
-       `tumme-dired-edit-comment-and-tags'.
-
-       * tumme.el (tumme-display-thumbnail-original-image): Make sure
-       image display buffer is displayed before call to
-       `tumme-display-image.
-       (tumme-dired-display-image): Make sure image display buffer is
-       displayed before call to `tumme-display-image.
-       (tumme-mouse-display-image): Make sure image display buffer is
-       displayed before call to `tumme-display-image.
-       (tumme-widget-list): Add.
-       (tumme-dired-edit-comment-and-tags): Add.
-       (tumme-save-information-from-widgets): Add.
-
-2006-07-19  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/sh-script.el (sh-quoted-subshell): Fix last change.
-
-2006-07-18  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/sh-script.el (sh-font-lock-keywords-1):
-       Revert inadvertently installed patch hunk.
-
-       * progmodes/compile.el (compilation-find-file): Handle the
-       cases where the user selects a non-existent file.
-
-2006-07-18  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * bindings.el (minibuffer-local-map): Rebind TAB so it inserts a \t.
-
-2006-07-17  Chong Yidong  <cyd@stupidchicken.com>
-
-       * subr.el (sit-for): Just sleep-for if noninteractive.
-
-2006-07-17  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * emacs-lisp/autoload.el (make-autoload): Use new arg.
-
-       * custom.el (custom-autoload): Add `noset' argument.
-       (custom-push-theme): Don't autoload the variable, let callers do it.
-       (custom-theme-set-variables): Autoload the variable if necessary.
-
-       * cus-edit.el (custom-variable-state-set): If the variable was
-       originally set outside custom, but to the same value as the default,
-       consider it to be standard.
-
-       * Makefile.in (mh-loaddefs.el): Finish setting up the default empty
-       file *before* telling Emacs to add the autoloads, in case it fails.
-
-       * progmodes/sh-script.el (sh-quoted-subshell): Don't match escaped `.
-       Use `cond', push', and `dolist'.
-
-2006-07-17  Richard Stallman  <rms@gnu.org>
-
-       * image-mode.el (tar-superior-buffer, archive-superior-buffer):
-       Add defvars to silence warnings.
-
-2006-07-17  Chong Yidong  <cyd@stupidchicken.com>
-
-       * progmodes/compile.el (compilation-mode-font-lock-keywords):
-       Don't highlight "Compiling file" messages as error.
-
-       * dired-aux.el (dired-compress-file): Confirm again if gzipped
-       file already exists.
-
-2006-07-16  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * find-file.el (ff-special-constructs): Doc fix.  Also, for C/C++
-       entry, don't assign to free var; simply return the extracted filename.
-       (ff-treat-as-special): Incorporate common preamble from callers.
-       (ff-other-file-name, ff-find-the-other-file):
-       Update call to ff-treat-as-special.
-
-       * progmodes/ada-mode.el (ada-mode): Rewrite ff-special-constructs init.
-
-2006-07-16  Mathias Dahl  <mathias.dahl@gmail.com>
-
-       * tumme.el (tumme-get-comment): Fix bug.
-
-2006-07-16  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * files.el: Remove spurious * in docstrings.
-
-2006-07-14  Ken Manheimer  <ken.manheimer@gmail.com>
-
-       * allout.el (allout-run-unit-tests-on-load): Rectify docstring
-       grammar.
-       (allout-beginning-of-current-line): Beware beginning of buffer.
-       Also, a comment is simplified.
-       (allout-hotspot-key-handler): Only set allout-post-goto-bullet
-       when appropriate.  (This fix enables use for other than
-       bullet-hotspot operation.)
-       (allout-hide-current-subtree): While escalating to sibling-close,
-       make sure to situate on a topic.
-
-2006-07-14  Kim F. Storm  <storm@cua.dk>
-
-       * emulation/cua-base.el (cua-delete-selection)
-       (cua-toggle-set-mark): New defcustoms.
-       (cua-rectangle-modifier-key): Add `alt' modifier.
-       (cua-replace-region): Don't delete if cua-delete-selection is nil.
-       (cua-set-mark): Don't clear mark if cua-toggle-set-mark is nil.
-       Suggested by Klaus Zeitler <kzeitler@lucent.com>.
-
-       * emulation/cua-rect.el (cua-help-for-rectangle): Add `alt' modifier.
-
-2006-07-14  Ken Manheimer  <ken.manheimer@gmail.com>
-
-       * allout.el: Require 'cl during byte-compilation/interactive load,
-       for the `assert' macro.
-       (allout-mode-deactivate-hook): New hook, run when allout mode
-       deactivates.
-       (allout-developer): New allout customization subgroup.
-       (allout-run-unit-tests-on-load): New allout-developer
-       customization variable, when true allout unit tests are run towards
-       end of file load/eval.
-       (allout-inhibit-auto-fill): Disable auto-fill activity even during
-       auto-fill-mode.
-       (allout-resumptions): Remove, to be replaced by...
-       (allout-add-resumptions): Register variable settings to be
-       reinstated by `allout-do-resumptions'.  The settings are made
-       buffer-local, but the locality/globality of the suspended setting
-       is restored on resumption.
-       (allout-do-resumptions): Reinstate all settings suspended using
-       `allout-add-resumptions'.
-       (allout-test-resumptions): Unit tests (and intermediate variables)
-       for resumptions.
-       (allout-tests-globally-unbound, allout-tests-globally-true)
-       (allout-tests-locally-true): Intermediate variables for
-       resumptions unit tests.
-       (allout-overlay-preparations): Replaces `allout-set-overlay-category'.
-       (allout-exposure-category): Replaces 'allout-overlay-category variable.
-       (allout-mode): Use `allout-add-resumptions' and `allout-do-resumptions'
-       instead of retired `allout-resumptions'.  For hook functions, use
-       `local' parameter so hook settings are created and removed as
-       buffer-local settings.  Revise (resumptions) setting
-       auto-fill-function so it is set only if already active.  (The
-       related fill-function settings are all made in either case, so
-       that activating auto-fill-mode activity will have the custom
-       allout-mode behaviors (hanging indent on topics, if configured for it).
-       Remove all allout-exposure-category overlays on mode deactivation.
-       (allout-hotspot-key-handler): New function extracted from
-       `allout-pre-command-business', so the functionality can be used
-       for other purposes, eg as a binding in an overlay.
-       (allout-pre-command-business): Use new `allout-hotspot-key-handler'.
-       (allout-auto-fill): Respect new `allout-inhibit-auto-fill'
-       customization variable.
-       (allout-run-unit-tests): Run the (currently quite small)
-       repertoire of unit tests.  Called just before the provide iff user
-       has customized `allout-run-unit-tests-on-load' non-nil.
-
-2006-07-14  K\e,Aa\e(Broly L\e$,1 q\e(Brentey  <lorentey@elte.hu>
-
-       * emacs-lisp/authors.el (authors-aliases): Update.
-
-2006-07-14  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-display-buffer): Check for
-       gdb-source-window.  Add dedicated argument.
-       (gdb-display-separate-io-buffer, gdb-append-to-inferior-io)
-       (gdb-display-breakpoints-buffer, gdb-display-stack-buffer)
-       (gdb-display-threads-buffer, gdb-display-memory-buffer)
-       (gdb-display-locals-buffer): Use it.
-
-       * progmodes/gud.el (gud-display-line): Use gdb-display-buffer.
-       Set gdb-source-window.
-
-2006-07-13  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * emacs-lisp/autoload.el (make-autoload): Remove special handling of
-       minor modes, redundant with the custom-autoload line above.
-
-2006-07-12  Chong Yidong  <cyd@stupidchicken.com>
-
-       * longlines.el (longlines-post-command-function): Handle open-line too.
-
-2006-07-12  Richard Stallman  <rms@gnu.org>
-
-       * progmodes/grep.el (grep-last-buffer): Doc fix.
-
-       * info.el (Info-try-follow-nearest-node): Doc fix.
-
-       * emacs-lisp/edebug.el (edebug-instrument-function):
-       Err if find-function-noselect gives no position.
-
-       * emacs-lisp/find-func.el (find-function-search-for-symbol):
-       If can't find definition, return nil for position.
-       (find-function-do-it): Handle new return value
-       of find-definition-noselect.
-       (find-definition-noselect, find-variable-noselect): Doc fix.
-       (find-function-noselect): Doc fix.
-
-       * help-mode.el (help-variable-def): Handle find-variable-noselect
-       returning no position.
-       (help-function-def): Likewise for find-function-search-for-symbol.
-       (help-face-def): Likewise.
-
-       * help-fns.el (describe-variable): Handle find-variable-noselect
-       returning no position.
-
-       * files.el (locate-file-completion): Avoid duplicates in result.
-
-       * cus-edit.el (custom-no-edit): New command.
-       (custom-mode-map): Remap to custom-no-edit instead of
-       using suppress-keymap.
-
-2006-07-12  Nick Roberts  <nickrob@snap.net.nz>
-
-       * tumme.el (tumme-create-thumb, tumme-thumbnail-display-external)
-       (tumme-display-image, tumme-rotate-thumbnail, tumme-rotate-original)
-       (tumme-set-exif-data, tumme-get-exif-data): Use shell-command-switch.
-
-       * thumbs.el (thumbs-call-convert): Use shell-command-switch.
-
-2006-07-11  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-copy-current-file-name): Use buffer-name if
-       buffer-file-name is nil.
-
-2006-07-11  Chong Yidong  <cyd@stupidchicken.com>
-
-       * simple.el (undo-ask-before-discard): Set to nil.
-
-       * vc.el (vc-exec-after): Don't delete process manually.
-       (vc-print-log): Run log-view-mode in process sentinel inside
-       inhibit-read-only.  Don't shrink window due to timing issues.
-
-       * progmodes/ebrowse.el (ebrowse-display-member-buffer):
-       Avoid using with-output-to-temp-buffer, which clobbers local vars.
-
-2006-07-11  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/compile.el (compilation-error-regexp-alist-alist):
-       Fix ambiguity introduced by last change.
-       (compilation-find-file): Move save-excursion to where it may
-       make sense.  Fix a left over `find-file'.
-
-2006-07-11  Robert J. Chassell  <bob@rattlesnake.com>
-
-       * textmodes/texinfmt.el (texinfo-format-separate-node):
-       Insert a string before point, which fits documentation, not after.
-       (texinfo-multitable-item): In a multitable row, insert any
-       additional needed @tabs and spaces.
-
-2006-07-11  Nick Roberts  <nickrob@snap.net.nz>
-
-       * tumme.el (tumme-create-thumb, tumme-thumbnail-display-external)
-       (tumme-display-image, tumme-rotate-thumbnail, tumme-rotate-original)
-       (tumme-set-exif-data, tumme-get-exif-data): Use call-process
-       instead of shell-command.
-       (tumme-create-thumbnail-buffer, tumme-create-display-image-buffer)
-       (tumme-display-thumbs, tumme-modify-mark-on-thumb-original-file)
-       (tumme-display-image, tumme-get-exif-data): Use with-current-buffer.
-       (tumme-display-properties-format, tumme-dired-insert-marked-thumbs)
-       (tumme-thumbnail-set-image-description, tumme-gallery-generate)
-       (tumme-rotate-original, tumme-get-exif-file-name): Fit to 80 columns.
-
-2006-07-11  Kim F. Storm  <storm@cua.dk>
-
-       * subr.el (sit-for): Doc fix.  Specify normal arg list using fn-form.
-       Remove special case for seconds < 0.  Use (redisplay t) instead.
-
-2006-07-10  Chong Yidong  <cyd@stupidchicken.com>
-
-       * progmodes/cc-awk.el (c-awk-escaped-nls*): Use eval-and-compile to
-       avoid compilation error.
-
-       * subr.el (sit-for): New function.
-
-       * play/hanoi.el (hanoi-sit-for): Check sit-for return value.
-
-2006-07-10  Richard Stallman  <rms@gnu.org>
-
-       * ldefs-boot.el (edebug): Update page.
-
-2006-07-10  Kim F. Storm  <storm@cua.dk>
-
-       * emacs-lisp/authors.el (authors-ignored-files): Ignore changes
-       to FOR-RELEASE and TODO.
-
-2006-07-10  Romain Francoise  <romain@orebokech.com>
-
-       * emacs-lisp/authors.el (authors-aliases): Update.
-
-2006-07-10  Alan Mackenzie  <acm@muc.de>
-
-       * progmodes/cc-awk.el, cc-defs.el, cc-fonts.el, cc-langs.el:
-       * cc-mode.el: Changes to eradicate eval-after-load.
-
-2006-07-09  Chong Yidong  <cyd@stupidchicken.com>
-
-       * emacs-lisp/helper.el (Helper-help-scroller): Don't signal error
-       on non-char events.
-
-2006-07-09  Romain Francoise  <romain@orebokech.com>
-
-       * progmodes/compile.el (compilation-mode-font-lock-keywords):
-       Don't highlight start/end markers as compilation messages.
-
-       * isearch.el (isearch-yank-line): Let-bind `inhibit-field-text-motion'
-       to t.
-
-2006-07-09  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * textmodes/fill.el (fill-region-as-paragraph): Refine last change.
-
-2006-07-08  Richard Stallman  <rms@gnu.org>
-
-       * term/x-win.el (x-handle-display): Add doc string.
-
-       * emacs-lisp/easy-mmode.el (define-minor-mode): Doc fix.
-
-       * subr.el (def-edebug-spec): Move here.
-       * emacs-lisp/edebug.el (def-edebug-spec): Move to subr.el.
-
-       * imenu.el (imenu-choose-buffer-index): Doc fix.
-
-2006-07-08  Romain Francoise  <romain@orebokech.com>
-
-       * term/x-win.el (x-display-name): Fix typo.
-
-2006-07-08  Eli Zaretskii  <eliz@gnu.org>
-
-       * hexl.el (hexl-find-file): Doc fix.
-
-       * emacs-lisp/easy-mmode.el (define-minor-mode): Doc fix.
-
-2006-07-07  Chong Yidong  <cyd@stupidchicken.com>
-
-       * term/x-win.el (x-display-name): Doc fix.
-
-2006-07-07  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * textmodes/fill.el (fill-delete-prefix): Don't ignore excessively
-       long prefixes.
-       (fill-region-as-paragraph): Don't round up to a whole line.
-       (fill-comment-paragraph): Don't include the code-before-the-comment
-       when calling fill-region-as-paragraph.
-
-       * international/mule.el (make-char): Remove redundancy.
-
-       * emacs-lisp/bytecomp.el (byte-compile-form): The `byte-compile'
-       property may contain an anonymous function rather than a symbol.
-
-       * pcvs-defs.el (cvs-temp-buffer-name): Fix non-hiddenness.
-
-       * progmodes/compile.el (compilation-error-regexp-alist-alist) <gnu>:
-       Use shy regexp.  Fix incorrect backref to potentially unmatched group.
-
-       * dirtrack.el (dirtrack-default-directory-function): Remove.
-       (dirtrack-directory-function): Use file-name-as-directory.
-       (dirtrack-windows-directory-function): Simplify.
-       (dirtrack-forward-slash, dirtrack-backward-slash)
-       (dirtrack-replace-slash): Remove.
-       (dirtrack-toggle): Adjust comint-preoutput-filter-functions as well.
-       (dirtrack): Fix wrong parenthesizing; use match-string.
-
-       * progmodes/octave-inf.el: Remove spurious * in docstrings.
-       (inferior-octave-mode): Only change the buffer-local value of
-       comint-dynamic-complete-functions.
-       (inferior-octave-mode-map, inferior-octave-mode-syntax-table):
-       Move the initialization to the declaration.
-       (inferior-octave-complete): Remove unused var `filter'.
-
-       * shell.el (shell-mode): Only change the buffer-local value of
-       comint-dynamic-complete-functions.
-
-2006-07-07  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-agenda-get-todos): Skip subtree also if
-       entry is skipped because it has been scheduled.
-       (org-prepare-agenda-buffers): Don't mark buffers as modified when
-       changing `:org-archived' and `:org-comment' properties.
-
-2006-07-06  Chong Yidong  <cyd@stupidchicken.com>
-
-       * server.el (server-select-display): Don't make the temp frame
-       minibuffer-only, in case it's not a temp frame.
-       (server-process-filter): Don't delete the temp frame if it's the
-       only one we have on that display.
-
-       * files.el (find-alternate-file): Doc fix.
-
-2006-07-05  Richard Stallman  <rms@gnu.org>
-
-       * files.el (abbreviate-file-name): Add save-match-data.
-
-2006-07-03  Richard Stallman  <rms@gnu.org>
-
-       * faces.el (read-face-name): Doc fix.
-
-2006-07-05  Chong Yidong  <cyd@stupidchicken.com>
-
-       * net/goto-addr.el (goto-address): Mark as safe for local evals.
-
-2006-07-05  Andre Spiegel  <spiegel@gnu.org>
-
-       * vc.el (vc-diff-internal): Fix prev change.
-
-2006-07-05  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * emacs-lisp/lisp-mode.el (emacs-lisp-mode-map): Use eval-buffer.
-       * play/dunnet.el (dun-load-d, dun-eval): Likewise.
-
-2006-07-04  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * thingatpt.el (symbol-at-point): Don't use `form-at-point' which
-       fails if the symbol contains chars like ( or '.
-       (bounds-of-thing-at-point): Remove unused vars `end' and `beg'.
-       (thing-at-point-bounds-of-url-at-point): Remove unused vars `url' and
-       `short'.
-
-2006-07-04  Kenichi Handa  <handa@m17n.org>
-
-       * international/mule-cmds.el (set-language-info): If LANG-ENV is
-       the current one, don't call set-language-environment, but call one
-       of set-language-environment-XXX to make INFO effective now.
-       (set-language-environment): Call set-language-environment-XXX
-       functions instead of doing the various setups directly.
-       (set-language-environment-coding-systems): Delete argument eol-type.
-       (set-language-environment-input-method)
-       (set-language-environment-nonascii-translation)
-       (set-language-environment-charset)
-       (set-language-environment-fontset)
-       (set-language-environment-unibyte): New functions.
-
-2006-07-03  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * locate.el (locate-update-when-revert): New option.
-       (locate-update-path): New option (suggested by Michael Albinus).
-       (locate-prompt-for-command): Whitespace change.
-       (locate-update): No longer offer to update the locate database by
-       default.  Implement the two new options.
-
-2006-07-04  Nick Roberts  <nickrob@snap.net.nz>
-
-       * tooltip.el: Move comment about track-mouse...
-
-       * progmodes/gud.el: ...to here.
-
-2006-07-03  Chong Yidong  <cyd@stupidchicken.com>
-
-       * facemenu.el (facemenu-listed-faces): New var.
-       (facemenu-unlisted-faces): Variable deleted.
-       (facemenu-add-new-face): Use facemenu-listed-faces.
-
-       * emulation/viper-init.el, calendar/calendar.el:
-       * progmodes/make-mode.el: Delete calls to facemenu-unlisted-faces.
-
-2006-07-03  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-mode): Remove no invalid settings for
-       calc embedded mode.
-       (org-mode-p): New defsubst.
-       (org-save-all-org-buffers): New function.
-       (org-first-headline-recenter): Enclose outline-regexp in group
-       delimiters.
-       (org-set-tags): Keep single space after stars.
-
-2006-07-02  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * window.el (set-window-text-height): Only set window-min-height to
-       1 if that's the requested size.
-
-       * diff-mode.el (diff-find-file-name): Obey cvs-pcl-cvs-dirchange-re.
-       (diff-unified->context, diff-context->unified)
-       (diff-reverse-direction): Make sure the end marker stays at the end.
-       (diff-mode): Add the keymap table at the end of docstring.
-       Use lexical-let rather than constructing a closure manually.
-
-       * files.el (find-file-noselect-1): Remove unused var assignment.
-       (hack-local-variables-confirm): Print lists of strings as lists of
-       strings rather than lists of symbols.
-       (abbreviate-file-name, hack-local-variables-prop-line):
-       Use match-string.
-       (hack-one-local-variable): Move `make-local-variable' nearer its use.
-       (recover-session-finish): Use line-end-position.
-
-2006-07-02  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/tramp.el (tramp-handle-shell-command): Preserve current-buffer.
-
-2006-07-02  Daniel Pfeiffer  <occitan@esperanto.org>
-
-       * progmodes/make-mode.el (makefile-macroassign-regex):
-       Accept preceding keyword.
-       (makefile-gmake-statements): Reorganize, now that makepp has
-       "override" and also handle forgotten "override define".
-       (makefile-makepp-statements): Add new "global", "override export"
-       and "override global".
-
-2006-06-30  Juanma Barranquero  <lekktu@gmail.com>
-
-       * progmodes/ada-mode.el (ada-which-compiler, ada-mode-menu)
-       (ada-compile-mouse-goto-error, ada-deactivate-properties)
-       (ada-no-auto-case): Fix typos in docstrings.
-
-2006-06-30  Nick Roberts  <nickrob@snap.net.nz>
-
-       * info.el (Info-find-node-2): Search for makeinfo version more
-       carefully.
-
-2006-06-29  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-prepare-agenda-buffers):
-       Use `invisible-OK' argument for `org-end-of-subtree'.
-       (org-export-cleanup-toc-line): Rename from `org-html-cleanup-toc-line'.
-       (org-beginning-of-item): Fix bug in regular expression for white line.
-       (org-export-as-html): Enforce space after bullet in plain list items.
-       (org-set-autofill-regexps): Require space after plain list bullet
-       for paragraph-start.
-       (org-ts-regexp3): New constant.
-       (org-at-timestamp-p): New optional argument ALSO-INACTIVE.
-       (org-timestamp-up-day, org-timestamp-down-day)
-       (org-timestamp-change): Work with inactive timestamps.
-       (org-ts-regexp1): Don't allow brackets in time stamps.
-
-2006-06-29  Nick Roberts  <nickrob@snap.net.nz>
-
-       * help-mode.el (help-xref-symbol-regexp): Add property as a keyword
-       for ignoring links.
-
-       * faces.el (read-face-name): Use it.
-
-2006-06-28  Juri Linkov  <juri@jurta.org>
-
-       * buff-menu.el (list-buffers-noselect): Compare Info file
-       with the string "dir" to detect Info directory.
-
-       * complete.el (partial-completion-mode): In lambda for
-       `choose-completion-string-functions' use full function signature
-       with 4 args, and move point to the end of the minibuffer only if arg
-       `mini-p' is non-nil.
-
-2006-06-28  John Paul Wallington  <jpw@pobox.com>
-
-       * ibuffer.el (ibuffer-mode): Doc fix.
-
-2006-06-28  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-context): New contexts :item-bullet,
-       :latex-fragment, :latex-preview.
-       (org-overlays-at, org-overlay-start, org-overlay-end):
-       New compatibility functions.
-       (org-inside-LaTeX-fragment-p): More accurate matching, using the
-       exact regexp that will be used during export.
-       (org-latex-regexps): New variable.
-       (org-cdlatex-mode): Improve advice for `texmathp'.
-       (turn-on-org-cdlatex): New function.
-
-2006-06-28  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el (mac-handle-font-selection): Change keys of
-       mac-atsu-font-table from strings to numbers.
-       (mac-ts-caret-position): Use also when cursor-type is nil.
-       (mac-ts-update-active-input-area): Add Mac OS Classic support.
-       Relax condition for using overlay strings.
-       Use mac-ts-caret-position face when cursor-type is nil.
-
-2006-06-26  Kim F. Storm  <storm@cua.dk>
-
-       * help.el (view-emacs-news): Declare `res' in the right let* form.
-
-2006-06-25  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/rcompile.el (remote-compile): Replace ange-ftp based
-       implementation by Tramp functions.
-       Suggested by Marc Abramowitz <msabramo@gmail.com>.
-
-       * net/tramp.el (tramp-unload-tramp): Provide a doc string.
-
-2006-06-24  Yoshinori Koseki  <kose@meadowy.org>
-
-       * international/fontset.el (setup-default-fontset): Fix a typo in
-       the "Oriya-Akruti" registry name.
-
-2006-06-23  Lars Hansen  <larsh@soem.dk>
-
-       * desktop.el (desktop-full-file-name): New function.
-       (desktop-kill, desktop-save, desktop-remove, desktop-read)
-       (desktop-revert): Use it.
-       (desktop-clear, desktop-save, desktop-remove): Add autoload cookie.
-       (desktop-after-read-hook): Add option list-buffers.
-       (desktop-locals-to-save): Add tab-width.
-       (desktop-save-mode, desktop-no-desktop-file-hook, desktop-save-hook):
-       Fix docstring.
-
-2006-06-23  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-cdlatex-mode-map)
-       (org-cdlatex-texmathp-advice-is-done): New variables.
-       (org-cdlatex-mode): New minor mode.
-       (org-inside-LaTeX-fragment-p, org-try-cdlatex-tab): New functions.
-       (org-cdlatex-underscore-caret, org-cdlatex-math-modify): New commands.
-       (org-export-with-archived-trees): New option.
-       (org-open-file): Remove the call to `convert-standard-filename'.
-       (org-archive-tag, org-agenda-skip-archived-trees)
-       (org-cycle-open-archived-trees)
-       (org-sparse-tree-open-archived-trees): New options.
-       (org-cycle-hide-archived-subtrees, org-hide-archived-subtrees)
-       (org-toggle-tag, org-prepare-agenda-buffers, org-agenda-skip):
-       New functions.
-       (org-agenda-toggle-archive-tag, org-toggle-archive-tag): New commands.
-       (org-agenda-mode-map): Add binding of `org-agenda-toggle-archive-tag'.
-       (org-mode-map): Add binding for `org-toggle-archive-tag'.
-       (org-timeline, org-agenda-list, org-todo-list, org-tags-view):
-       Call `org-prepare-agenda-buffers'.
-       (org-occur, org-scan-tags): Call `org-hide-archived-subtrees'.
-       (org-file-apps, org-file-apps-defaults-gnu)
-       (org-file-apps-defaults-macosx, org-file-apps-defaults-windowsnt):
-       Handle remote files by forcing them to be opened in Emacs.
-
-2006-06-23  Andre Spiegel  <spiegel@gnu.org>
-
-       * vc.el (vc-diff-knows-L): New variable.
-       (vc-diff-internal): Use it to handle "diff" programs that don't
-       understand -L.  This works automatically, no user action is necessary.
-
-2006-06-23  Daniel Brockman  <daniel@brockman.se>
-
-       * net/rcirc.el (rcirc-default-user-full-name): Default to
-       `rcirc-default-user-name' instead of `rcirc-user-name' (which no
-       longer exists).
-       (rcirc-process-list): Check `buffer-live-p' before attempting to
-       switch to a buffer.
-
-2006-06-23  Ryan Yeske  <rcyeske@gmail.com>
-
-       * net/rcirc.el (rcirc-mode): Fix initialization of coding systems
-       based on rcirc-coding-system-alist.
-
-2006-06-23  Martin Rudalics  <rudalics@gmx.at>
-
-       * cus-edit.el (customize-apropos): A better error message.
-       (top level) <debug-ignored-errors>: Extend and update the list of
-       ignored error messages.
-
-2006-06-23  Michael Ernst  <mernst@alum.mit.edu>
-
-       * complete.el (PC-do-completion): Retain capitalization of user
-       input, when possible, even if completion-ignore-case is set.
-
-2006-06-23  Eli Zaretskii  <eliz@gnu.org>
-
-       * generic-x.el (bat-generic-mode): Support .cmd files.
-
-       * dos-w32.el (top level): Use find-file-not-found-functions
-       instead of the obsolete find-file-not-found-hooks.
-
-2006-06-22  Kim F. Storm  <storm@cua.dk>
-
-       * progmodes/grep.el (grep-mode-font-lock-keywords): Correct regexps
-       to recognize mode name containing submodes, such as Grep/lw.
-
-2006-06-21  Kim F. Storm  <storm@cua.dk>
-
-       * simple.el (line-move-1): Check for move-end-of-line instead of
-       end-of-line when setting temporary-goal-column.
-
-2006-06-21  Miles Bader  <miles@gnu.org>
-
-       * play/cookie1.el (cookie): Work properly when there's only one entry.
-
-2006-06-21  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-exited): Ensure overlay arrow gets killed.
-       (gdb-frame-handler): Generalize frame regexp for templates.
-
-2006-06-20  Glenn Morris  <rgm@gnu.org>
-
-       * calendar/appt.el (appt-display-format): Default value must be
-       one of the customize options.
-
-2006-06-20  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * term/xterm.el (terminal-init-xterm): Update key availability info.
-       Bind C-return.
-
-       * term.el (term-delete-lines, term-insert-lines): Clarify comments.
-
-2006-06-20  Chong Yidong  <cyd@stupidchicken.com>
-
-       * files.el (hack-local-variables): Run `hack-local-variables-hook'
-       whether or not a local variables list is defined.
-
-       * msb.el (msb): Move `sit-for' hack here to handle both
-       "mouse-down and drag" and "mouse-up and select" situations.
-       (mouse-select-buffer): Move `sit-for' hack to `msb'.
-
-2006-06-20  Kenichi Handa  <handa@m17n.org>
-
-       * international/characters.el (word-combining-categories):
-       Add entries for 2-byte Han characters.
-
-2006-06-19  Richard Stallman  <rms@gnu.org>
-
-       * bindings.el (mode-line-format): Save some mode line space.
-
-       * files.el (find-file-noselect): Improve the question wording.
-       (basic-save-buffer-2): Mask UMASK against 666.
-
-       * mouse.el (mouse-drag-vertical-line-rightward-window): New function.
-       (mouse-drag-vertical-line): Call it.
-
-       * cus-edit.el (customize-option, customize-option-other-window):
-       Error if SYMBOL is nil.
-
-2006-06-19  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el: Require noutline, also on XEmacs.
-       (org-end-of-subtree): Return point.
-       (org-dblock-start-re, org-dblock-end-re): New constants.
-       (org-create-dblock, org-prepare-dblock, org-map-dblocks)
-       (org-dblock-update, org-update-dblock, org-beginning-of-dblock)
-       (org-update-all-dblocks, org-find-dblock): New functions.
-       (org-collect-clock-time-entries): New function.
-       (org-html-handle-time-stamps): Never export CLOCK timeranges.
-       (org-fixup-indentation): Modify to deal correctly with lines
-       starting with TAB.  Only one argument DIFF now.
-       (org-demote, org-promote): Call `org-fixup-indentation' with just
-       one argument, DIFF.
-       (org-mode): Don't mark buffer as modified when aligning tables.
-       (org-clock-sum): Don't mark buffer modified when adding time sum
-       properties.
-       (org-export-as-html): Add support for a link validation function.
-       (org-archive-all-done): New function.
-       (org-archive-subtree): New prefix argument.  When set, archive all
-       done subtrees in this buffer.
-       (org-remove-clock-overlays)
-       (org-remove-occur-highlights): Use `org-inhibit-highlight-removal'.
-       (org-inhibit-highlight-removal): New variable, for dynamic scoping.
-       (org-put-clock-overlay): Don't swallow last headline character
-       when displaying overlay.
-       (org-store-link): Link to `image-mode' with just the file name.
-
-2006-06-18  Michael Kifer  <kifer@cs.stonybrook.edu>
-
-       * viper-cmd.el (viper-special-read-and-insert-char):
-       Use read-key-sequence.
-       (viper-after-change-undo-hook): Misc enhancements.
-       (viper-after-change-undo-hook): New hook.
-       (viper-undo): Use viper-after-change-undo-hook.
-       (viper-add-newline-at-eob-if-necessary): Widen before making changes.
-       (viper-next-line-at-bol): If point is on a widget or a button, simulate
-       clicking on that widget/button.
-
-       * viper.el (viper-mode): Allow a separate cursor color in Emacs state.
-
-       * ediff-diff (ediff-test-patch-utility): Catch errors.
-       (ediff-actual-diff-options, ediff-actual-diff3-options): New variables.
-       (ediff-set-actual-diff-options): New function.
-       (ediff-reset-diff-options, ediff-toggle-ignore-case):
-       Use ediff-set-actual-diff-options.
-       (ediff-extract-diffs): Catch errors.
-       (ediff-whitespace): Add non-breakable space.
-       (ediff-same-file-contents): Catch errors.
-
-       * ediff-mult.el (ediff-collect-custom-diffs):
-       Save coding-system-for-read.
-
-       * ediff-vers.el (ediff-keep-tmp-versions): New variable.
-       (ediff-vc-internal, ediff-vc-merge-internal):
-       Use ediff-delete-version-file.
-       (ediff-delete-version-file): New function.
-
-       * ediff-wind.el (ediff-control-frame-parameters): Set frame fringes.
-
-       * ediff.el (ediff-directories, ediff-directory-revisions)
-       (ediff-merge-directories, ediff-merge-directories-with-ancestor)
-       (ediff-directories-internal, ediff-merge-directory-revisions)
-       (ediff-merge-directory-revisions-with-ancestor)
-       (ediff-directories3): Use read-directory-name.
-
-2006-06-18  Ralf Angeli  <angeli@caeruleus.net>
-
-       * textmodes/tex-mode.el (tex-font-lock-match-suscript):
-       Remove superfluous part of regexp for brace matching which is handled
-       by `scan-lists' call.
-
-2006-06-16  Richard Stallman  <rms@gnu.org>
-
-       * obsolete/options.el (list-options): Put "obsolete" msg in buffer.
-
-       * files.el (basic-save-buffer-2): For a new precious file,
-       use the default modes in the return value.
-
-       * facemenu.el (facemenu-color-alist): Doc fix.
-
-       * cus-edit.el (custom-guess-name-alist): Recognize `-flag'.
-
-2006-06-16  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * cus-start.el (all): Add mac-ts-script-language-on-focus.
-
-       * term/mac-win.el (mac-text-encoding-ascii): New constant.
-       (mac-utxt-to-string): Use it.
-       (mac-ts-update-active-input-area): Use mac-ae-number.
-
-2006-06-15  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * term.el (term-handle-scroll, term-delete-lines)
-       (term-insert-lines): Fix off by one errors.
-
-2006-06-15  Katsumi Yamaoka  <yamaoka@jpl.org>
-
-       * net/tramp.el (tramp-touch): Use UTC to express time.
-
-2006-06-15  Chong Yidong  <cyd@stupidchicken.com>
-
-       * mail/sendmail.el (mail-send): Search explicitly for
-       mail-header-separator when checking for corrupted header lines.
-
-2006-06-15  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-same-frame): New option.
-       (gud-old-arrow, gdb-frame-begin, gdb-printing): New variables.
-       (gdb-init-1): Initialise them.
-       (gdb-starting): Reset gdb-printing
-       (gdb-starting): Save value of gud-overlay-arrow-position.
-       (gdb-frame-begin): Set gdb-frame-begin, gdb-printing.
-       (gdb-stopped): Don't look for source if calling procedure e.g "p a ()".
-       Use gdb-*-gdb-buffer conditionally on gdb-same-frame.
-       (gdb-frame-gdb-buffer): Keep menu bar, tool bar for GUD buffer.
-
-2006-06-14  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * pcvs.el (cvs-retrieve-revision): Use decode-coding-inserted-region.
-
-2006-06-13  Martin J. Reed  <mjreed@essex.ac.uk>  (tiny change)
-
-       * net/ldap.el (ldap-ldapsearch-args): Default to SASL search.
-       (ldap-search-internal): Keep error messages, and a regexp fix.
-
-2006-06-12  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * files.el (hack-local-variables-confirm):
-       Display string value using its printed representation.
-
-2006-06-11  Chong Yidong  <cyd@stupidchicken.com>
-
-       * server.el (server-edit): No-op if no server buffers exist.
-
-2006-06-11  Robert J. Chassell  <bob@rattlesnake.com>
-
-       * textmodes/page-ext.el (pages-directory-for-addresses):
-       Including `pages-directory-address-mode' in the function results
-       in the message "Buffer in which pages were found is deleted".
-
-2006-06-10  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-agenda-mode-map): Add bindings for
-       clocking functions.
-
-       (org-agenda-clock-in, org-check-running-clock)
-       (org-clock-out-if-current, org-remove-clock-overlays)
-       (org-put-clock-overlay): New functions.
-       (org-clock-marker, org-clock-file-total-minutes)
-       (org-clock-overlays): New variables.
-       (org-clock-display, org-clock-sum, org-clock-cancel)
-       (org-clock-out, org-clock-in): New commands.
-       (org-export): New function.
-       (org-emph-re): New constant.
-       (org-set-emph-re, org-do-emphasis-faces): New functions.
-       (org-emphasis-regexp-components, org-emphasis-alist): New options.
-       (org-set-font-lock-defaults): Call `org-do-emphasis-faces'.
-       (org-export-html-convert-emphasize): Use the configurable emphasis.
-       (org-cleaned-string-for-export): Make multiline emphasis visible
-       to the exporter.  New optional argument PARAMETERS.
-       (org-export-as-html): Specify :emph-multiline parameter to
-       `org-cleaned-string-for-export'.
-
-2006-06-10  Richard Stallman  <rms@gnu.org>
-
-       * help.el (help-for-help-internal): Clean up help text.
-
-2006-06-10  Andreas Schwab  <schwab@suse.de>
-
-       * language/ethio-util.el (ethio-fidel-to-java-buffer): Fix quoting
-       in doc string.
-
-       * progmodes/cperl-mode.el (cperl-short-docs): Likewise.
-
-2006-06-09  Karl Chen  <quarl@cs.berkeley.edu>
-
-       * progmodes/make-mode.el (makefile-fill-paragraph): Don't remove
-       spaces after the comment start.
-
-2006-06-09  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac@lrde.org>
-
-       * play/pong.el (pong-init-buffer):
-       Fill buffer with spaces instead of ^A.
-
-       * textmodes/ispell.el (ispell-kill-ispell): If ispell has been
-       launched asynchronously, delete its process instead of being cool.
-       (ispell-async-processp): Check for `delete-process' existence
-       instead of `kill-process' one for consistency.
-
-2006-06-09  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-set-gud-minor-mode-existing-buffers-1)
-       (gdb-prompt, gdb-set-gud-minor-mode-existing-buffers): Show status
-       in mode line at startup.
-
-2006-06-08  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-take-first-match, ido-push-dir-first): New commands.
-       (ido-init-completion-maps): Bind them to M-SPC and M-v.
-       (ido-copy-current-file-name): Repeating C-w inserts whole file name.
-       (ido-file-internal): Pass full file name to write-file.
-       (ido-read-internal): Only pop stack elements automatically if they
-       actually match an existing directory or file name.
-
-2006-06-07  Kenichi Handa  <handa@m17n.org>
-
-       * international/mule.el (find-auto-coding): Don't handle the short
-       name `char-trans'.
-
-       * files.el (hack-local-variables-prop-line)
-       (hack-local-variables): Cancel the previous change.
-
-2006-06-06  Jesper Harder  <harder@phys.au.dk>
-
-       * ediff-diff.el (ediff-test-utility): Protect against file-error.
-
-2006-06-06  Chong Yidong  <cyd@stupidchicken.com>
-
-       * diff-mode.el (diff-mode): Set buffer-read-only to t when
-       diff-default-read-only is non-nil.
-       (diff-hunk-kill, diff-file-kill, diff-split-hunk)
-       (diff-refine-hunk): Set inhibit-read-only to t.
-
-       * diff.el (diff-sentinel, diff): Set inhibit-read-only to t when
-       modifying the *Diff* buffer.
-       (diff-process-filter): New filter function for diff process that
-       sets inhibit-read-only to t when modifying the *Diff* buffer.
-
-2006-06-06  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-archive-subtree): Use end-of-subtree as
-       insertion point and control the number of empty lines.
-       (org-paste-subtree): Limit the number of empty lines at the end of
-       the inserted tree.
-       (org-agenda): Use buffer name of current file for narrowing.
-       (org-export-as-xml): Command removed.
-       (org-export-xml-type): Option removed.
-       (org-mode-map): Call `org-export-as-xoxo' directly.
-       (org-get-indentation): New optional argument LINE.
-       (org-fix-indentation, org-remove-tabs): New functions.
-       (org-export-as-ascii, org-ascii-level-start): Determine and apply
-       correct indentation for headlines that are converted it items.
-       (org-skip-comments): Remove table lines that contain narrowing
-       cookies but no other non-empty fields.
-       (org-set-tags): Allow groups of mutually exclusive tags.
-       (org-cmp-time): Sort 24:21 before items without time.
-       (org-get-time-of-day): Fix the interpretation of 12pm and 12am.
-       (org-open-at-point): Require double colon also for numbers.
-
-2006-06-06  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-default-file-method, ido-default-buffer-method):
-       Make choice values consistent with corresponding command names.
-       (ido-visit-buffer): Update accordingly.  Default to selected-window.
-
-2006-06-06  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-running): Fix doc string.
-       (gud-menu-map): Use :visible instead fo :enable for debugger test.
-       (gud-tooltip-modes): Add python-mode.
-       (gud-tooltip-print-command): Add pdb.  Remove perldb.
-
-2006-06-05  Eli Zaretskii  <eliz@gnu.org>
-
-       * makefile.w32-in (bootstrap, $(lisp)/mh-e/mh-loaddefs.el):
-       Quote $(EMACS).
-
-2006-06-05  Richard Stallman  <rms@gnu.org>
-
-       * faces.el (defined-colors): Doc fix.
-
-2006-06-05  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * vc.el (vc-process-filter): Inhibit undo info collection around
-       call to insert.
-       (vc-setup-buffer): Likewise for call to erase-buffer.
-       (vc-do-command): Likewise for call to process-file.
-
-2006-06-05  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-menu-map): Use a conditional help echo
-       for gud-go.
-       (gud-common-init): Other debuggers may trigger error.
-
-2006-06-05  Kenichi Handa  <handa@m17n.org>
-
-       * international/mule.el (find-auto-coding):
-       Handle enable-character-translation in file header.
-
-2006-06-04  Kim F. Storm  <storm@cua.dk>
-
-       * emacs-lisp/authors.el (authors-aliases): Add mode aliases.
-       (authors-fixed-entries): Fix spelling.
-       (authors-canonical-file-name): Don't report error for wildcards.
-
-       * help.el (view-emacs-news): Rewrite to support new NEWS,
-       NEWS.major, and NEWS.1-17 file naming.  Add more intelligence,
-       e.g. version 10 matches 1.10, and don't be confused by version 1.1
-       being a prefix of 1.12 (etc).  A numeric prefix arg also works.
-
-2006-06-03  Vivek Dasmohapatra  <vivek@etla.org>
-
-       * progmodes/sh-script.el (sh-quoted-exec): New face for quoted
-       exec constructs like `foo bar`.
-       (sh-quoted-subshell): New helper function to search for a possibly
-       nested subshell (like `` or $()) within a "" quoted string.
-       (sh-font-lock-keywords-var): Add sh-quoted-exec for Bash.
-       (sh-apply-quoted-subshell): Flag quote characters inside a
-       subshell, which is itself already in a quoted region, as
-       punctuation, since this is the closest to what they actually are.
-       (sh-font-lock-syntactic-keywords): Add sh-quoted-subshell and
-       sh-apply-quoted-subshell.
-       (sh-font-lock-syntactic-face-function): Apply the new face for
-       text inside `` instead of the old font-lock-string-face.
-
-2006-06-03  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el (mac-ts-active-input-overlay): Add defvar.
-       (mac-ae-number, mac-ae-frame, mac-ae-script-language)
-       (mac-bytes-to-text-range, mac-ae-text-range-array)
-       (mac-ts-update-active-input-buf, mac-split-string-by-property-change)
-       (mac-replace-untranslated-utf-8-chars, mac-ts-update-active-input-area)
-       (mac-ts-unicode-for-key-event): New functions.
-       (mac-handle-toolbar-switch-mode): Use mac-ae-frame.
-       (mac-handle-font-selection): Use mac-ae-number.
-       (mac-ts-active-input-buf, mac-ts-update-active-input-area-seqno):
-       New variables.
-       (mac-ts-caret-position, mac-ts-raw-text, mac-ts-selected-raw-text)
-       (mac-ts-converted-text, mac-ts-selected-converted-text)
-       (mac-ts-block-fill-text, mac-ts-outline-text)
-       (mac-ts-selected-text, mac-ts-no-hilite): New faces.
-       (mac-ts-hilite-style-faces): New constant.
-       (mac-apple-event-map): Bind text input events.
-       (mac-dispatch-apple-event): Use command-execute instead of
-       call-interactively.
-       (global-map): Don't bind mac-apple-event.
-       (special-event-map): Bind mac-apple-event.
-
-2006-06-02  Eli Zaretskii  <eliz@gnu.org>
-
-       * makefile.w32-in (EMACS): Remove quotes from the Emacs executable
-       file name.
-       (emacs): Enclose the value of $(EMACS) in quotes.
-
-2006-06-02  Juri Linkov  <juri@jurta.org>
-
-       * international/mule.el (sgml-html-meta-auto-coding-function):
-       Remove the condition `(search-forward "<html" size t)'.
-       Replace `\"' with `[\"']?' in `re-search-forward'.
-
-2006-06-02  Kenichi Handa  <handa@m17n.org>
-
-       * files.el (hack-local-variables-prop-line): Ignore `char-trans'
-       as well as `coding'.
-       (hack-local-variables): Likewise.
-
-       * international/mule.el (enable-character-translation):
-       Put permanent-local and safe-local-variable properties.
-       (find-auto-coding): Handle char-trans: tag.
-
-2006-06-02  Juri Linkov  <juri@jurta.org>
-
-       * international/mule.el (sgml-html-meta-auto-coding-function):
-       Limit the search by the end of the HTML header (if any).
-
-2006-06-01  Richard Stallman  <rms@gnu.org>
-
-       * subr.el (with-current-buffer): Doc fix.
-
-2006-06-02  Masatake YAMATO  <jet@gyve.org>
-
-       * progmodes/compile.el (compilation-error-regexp-alist-alist::gcov-*):
-       Almost rewrite.  Underlines over all lines of gcov output are too
-       uncomfortable to read.  Suggested by Dan Nicolaescu.
-
-2006-06-01  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * progmodes/inf-lisp.el (inferior-lisp-mode): Doc fixes.
-
-       * shell.el (shell-mode): Use shell-mode-map in docstring.
-
-       * comint.el (comint-send-input): Do not add help-echo and
-       mouse-face to input if `comint-use-prompt-regexp' is non-nil.
-
-2006-06-01  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * term/x-win.el: Change x-menu-bar-start to menu-bar-open.
-
-2006-06-01  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-look-up-stack): New variable.
-       (gdb-stopped, gdb-info-stack-custom): If there is no source info
-       look up the stack and pop up GUD buffer if necessary.
-       (gdb-frames-select): Remove redundant call to gud-display-frame.
-       (gdb-info-threads-custom): Keep point at start of buffer.
-       (gdb-find-file-hook): Make it work for pre-GDB 6.4.
-
-2006-05-31  Juri Linkov  <juri@jurta.org>
-
-       * replace.el (query-replace-read-from, query-replace-read-to):
-       Bind `history-add-new-input' to nil.  Call `add-to-history'.
-
-2006-05-31  Takaaki Ota  <Takaaki.Ota@am.sony.com>
-
-       * textmodes/table.el: Convert all HTML tags to lower case for
-       XHTML compatibility.
-
-2006-05-31  Masatake YAMATO  <jet@gyve.org>
-
-       * progmodes/compile.el:
-       (compilation-error-regexp-alist-alist::gcov-called-line):
-       Don't put face on `-' lines in gcov file.  Suggested by Dan Nicolaescu.
-
-2006-05-31  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-query-cmdline, gud-common-init):
-       Revert inadvertent changes made with last commit.
-
-2006-05-30  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * textmodes/flyspell.el (turn-on-flyspell, turn-off-flyspell):
-       New functions.
-
-       * textmodes/text-mode.el (text-mode-hook): Use turn-on-flyspell.
-
-2006-05-30  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-agenda-highlight-todo): Make sure regexp
-       only matches in the right place.
-       (org-upcoming-deadline): New face.
-       (org-agenda-get-deadlines): Use new face `org-upcoming-deadline'.
-       (org-export-ascii-underline): Rename constant `org-ascii-underline'
-       and make it an option.
-       (org-export-ascii-bullets): New option.
-       (org-export-as-html): Many changes to emit valid XHTML.
-       (org-par-open): New variable.
-       (org-open-par, org-close-par-maybe, org-close-li-maybe): New functions.
-       (org-html-do-expand, org-section-number): Fix case in `replace-match'.
-       (org-timeline): Pass `org-timeline-show-empty-dates' to
-       `org-get-all-dates'.  Interpret empty dates returned by
-       `org-get-all-dates'.
-       (org-get-all-dates): New argument EMPTY.  Add dates without
-       entries to the list, mark large ranges of empty dates.
-       (org-point-in-group, org-context): New functions.
-
-2006-05-30  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-stop-subjob): Make it work in all buffers.
-
-       * progmodes/gdb-ui.el: Move gdb-mouse-toggle-breakpoint-* to
-       C-mouse-1.  Move gdb-mouse-until to mouse-3, gdb-mouse-jump
-       to C-mouse-3 (for 2 button mice).
-       (gdb-send): Do the right thing for C-d.
-
-       * speedbar.el (speedbar-detach): Delete.
-       (speedbar-easymenu-definition-trailer): Remove speedbar-detach as
-       it breaks things.
-       (speedbar-reconfigure-keymaps): Always add extra items to pop up menu.
-
-2006-05-30  Daniel Pfeiffer  <occitan@esperanto.org>
-
-       * files.el (auto-mode-alist): Add makepp suffix and optional mk on
-       Makeppfile.
-
-       * progmodes/compile.el (compilation-error-regexp-alist-alist):
-       Add makepp diagnostic.
-
-2006-05-29  Richard Stallman  <rms@gnu.org>
-
-       * window.el (fit-window-to-buffer): Doc fix.
-
-       * help.el (temp-buffer-max-height): Doc fix.
-
-       * subr.el (with-current-buffer): Doc fix.
-
-2006-05-29  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * term/x-win.el: Bind F10 to menu-bar-start if available.
-
-2006-05-28  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * term.el (term-if-xemacs, term-ifnot-xemacs): Delete, replace
-       uses with a simple test.
-       (term-set-escape-char, term-mode, term-check-kill-echo-list)
-       (term-send-raw-string, term-send-raw, term-mouse-paste)
-       (term-char-mode, term-line-mode, term-exec, term-sentinel)
-       (term-handle-exit, term-read-input-ring)
-       (term-previous-matching-input-string)
-       (term-previous-matching-input-string-position)
-       (term-previous-matching-input-from-input)
-       (term-replace-by-expanded-history, term-send-input)
-       (term-skip-prompt, term-bol, term-send-invisible)
-       (term-kill-input, term-delchar-or-maybe-eof)
-       (term-backward-matching-input, term-check-source)
-       (term-proc-query, term-emulate-terminal)
-       (term-handle-colors-array, term-process-pager, term-pager-line)
-       (term-pager-bob, term-unwrap-line, term-word)
-       (term-dynamic-complete-filename)
-       (term-dynamic-complete-as-filename)
-       (term-dynamic-simple-complete): Replace one arm ifs with whens or
-       unlesses.
-
-2006-05-29  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * files.el (hack-one-local-variable-eval-safep): Don't burp if used
-       during bootstrapping.
-
-       * emacs-lisp/ewoc.el (ewoc--current-dll): Remove.
-       Basically undo the change of 2006-05-26: use extra arguments instead of
-       dynamic scoping.
-       (ewoc-locate): Remove unused var `footer'.
-
-2006-05-28  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * emacs-lisp/ewoc.el (ewoc--insert-new-node): Use ewoc--refresh-node.
-
-       * emacs-lisp/autoload.el (no-update-autoloads): Declare.
-       (generate-file-autoloads): Obey it.  Return whether autoloads were
-       added at point or not.
-       (update-file-autoloads): Use this new return value.
-       Remove redundant test for the presence of an autoload cookie.
-
-       * emacs-lisp/autoload.el (autoload-find-file): New fun.
-       This one calls hack-local-variables.
-       (generate-file-autoloads, update-file-autoloads): Use it.
-
-       * textmodes/bibtex.el (bibtex-autokey-name-case-convert-function)
-       (bibtex-sort-entry-class): Add safe-local-variable predicate.
-       (bibtex-sort-entry-class-alist): Don't set the global value.
-       (bibtex-init-sort-entry-class-alist): New fun.
-       (bibtex-sort-buffer, bibtex-prepare-new-entry): Call it to compute
-       bibtex-init-sort-entry-class-alist from the buffer-local value (if any)
-       of bibtex-init-sort-entry-class.
-
-2006-05-28  Richard Stallman  <rms@gnu.org>
-
-       * subr.el (load-history-regexp): If FILE is relative, insist
-       entire last name component must match it.
-       (load-history-filename-element, load-history-regexp): Doc fixes.
-
-2006-05-29  Kim F. Storm  <storm@cua.dk>
-
-       * emacs-lisp/bindat.el (bindat-idx, bindat-raw): Rename dynamic vars
-       `pos' and `raw-data' for clarity, as eval forms may access these.
-
-2006-05-28  Kim F. Storm  <storm@cua.dk>
-
-       * emacs-lisp/bindat.el (bindat--unpack-u8): Use aref also for strings.
-
-2006-05-28  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/make-mode.el (makefile-browser-map)
-       (makefile-mode-syntax-table): Move initialization inside declaration.
-       (makefile-fill-paragraph): Use the default comment-filling code.
-
-2006-05-28  Chong Yidong  <cyd@stupidchicken.com>
-
-       * replace.el (query-replace-defaults): New variable.
-       (query-replace-read-from): Use `query-replace-defaults' for
-       default value, instead of history list.
-       (query-replace-read-to): Update `query-replace-defaults'.
-
-2006-05-27  Chong Yidong  <cyd@stupidchicken.com>
-
-       * msb.el (mouse-select-buffer): Minor fix to make popup menu work
-       with no X toolkit.
-
-2006-05-28  Nick Roberts  <nickrob@snap.net.nz>
-
-       * tumme.el (tumme-show-all-from-dir-max-files): Fix typo.
-       (tumme-show-all-from-dir): Add autoload.
-
-2006-05-27  Mathias Dahl  <mathias.dahl@gmail.com>
-
-       * tumme.el: Change a lot of `(if .. (progn ..)' to `(when ..)'.
-       (tumme-remove-tag): Fix bug.
-
-2006-05-27  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * emacs-lisp/ewoc.el (ewoc--create): No longer take HEADER and
-       FOOTER args.  Update unique caller.
-       (ewoc-delete): Compute last node once before looping.
-       (ewoc--node-branch): Merge into unique caller.
-       (ewoc--node): Don't define constructor make-ewoc--node for this
-       structure.
-       (ewoc): Add member `hf-pp' to this structure.
-       (ewoc--wrap): New func.
-       (ewoc-create): Take additional arg NOSEP.  If nil, wrap node and
-       header/footer pretty-printers.  Save header/footer pretty-printer.
-       (ewoc-set-hf): Use ewoc's header/footer pretty-printer.
-
-       * pcvs.el (cvs-make-cvs-buffer): Specify NOSEP to `ewoc-create'.
-
-2006-05-27  Mathias Dahl  <mathias.dahl@gmail.com>
-
-       * dired.el (dired-mode-map): Change `tumme-tag-remove' to
-       `tumme-delete-tag'.  Rename `Remove Image Tag' to `Delete Image
-       Tag'.  Change "Compare directories..." to "Change Directories...".
-       Move tumme commands to Operate, Regexp and Immediate menus.
-       Change "Add Comment" to "Add Image Comment".  Change "Add Image
-       Tag" to "Add Image Tags".
-
-       * tumme.el (tumme-delete-tag): Rename from `tumme-tag-remove'.
-       (tumme-setup-dired-keybindings): Change `tumme-add-remove' to
-       `tumme-delete-tag'.
-
-2006-05-26  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * shell.el (shell-mode): Call shell-dirtrack-mode after
-       list-buffers-directory is made a local variable, to avoid setting
-       the default value.
-
-2006-05-26  Kevin Ryde  <user42@zip.com.au>
-
-       * info.el (Info-index-next): Use where-is-internal to report
-       actual binding of Info-index-next, rather than hard-coded `,'.
-
-2006-05-26  Eli Zaretskii  <eliz@gnu.org>
-
-       * menu-bar.el (menu-bar-apropos-menu): Move "Find Key in Manual"
-       and "Find Command in Manual" to here.
-
-       * buff-menu.el (list-buffers-noselect): For Info buffers, use
-       Info-current-file as the file name.
-
-2006-05-26  Jonathan Yavner  <jyavner@member.fsf.org>
-
-       * ses.el (defadvice undo-more): Delete this defadvice.  The undo
-       overrides will now be done a different way.
-       (ses-set-parameter): Reapply this function for undo.
-       (ses-set-header-row): Reconstruct header row during undo.
-       (ses-widen): New function.
-       (ses-goto-data, ses-reconstruct-all): Use new function.
-       (ses-command-hook): Widen buffer during undo, before unupdating
-       the cells.
-       (ses-insert-row, ses-delete-row): Widen buffer during undo.
-       (ses-load, ses-header-row): Permit empty (zero-row) spreadsheets.
-       (ses-read-cell): Avoid stupid warning for RET RET on a cell whose
-       formula hasn't been executed yet.
-
-2006-05-26  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * comint.el (comint-kill-whole-line): Rename arg to count.
-       Fix doc string.
-
-2006-05-26  Chong Yidong  <cyd@stupidchicken.com>
-
-       * files.el (backup-buffer-copy): Remove deleted MUSTBENEW argument
-       to copy-file.
-
-2006-05-26  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * simple.el (toggle-truncate-lines): Make arg optional for
-       backward compatibility.
-
-2006-05-26  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * emacs-lisp/ewoc.el (ewoc--current-dll): New var.
-       (ewoc--node-next, ewoc--node-prev, ewoc--node-nth): Don't take
-       DLL arg.  Instead, use ewoc--current-dll.  Update all callers.
-       (ewoc--set-buffer-bind-dll-let*): Bind ewoc--current-dll, not `dll'.
-       (ewoc--adjust): Use ewoc--current-dll.
-       (ewoc-next, ewoc-prev, ewoc-nth): Bind ewoc--current-dll.
-
-2006-05-26  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-next-item, org-previous-item): Emit more
-       compact error message.
-       (org-tags-view): Refresh category table in each file.
-       (org-table-justify-field-maybe): Remove superfluous arguments to
-       `format'.
-       (org-export-as-html): Insert "<p>" before postamble.
-       (org-paste-subtree, org-kill-is-subtree-p): Check for empty kill ring.
-
-2006-05-26  Kenichi Handa  <handa@m17n.org>
-
-       * textmodes/po.el (po-find-charset): Pay attention to the case
-       FILENAME is a cons (NAME . BUFFER).
-       (po-find-file-coding-system-guts): Likewise.
-
-       * arc-mode.el (archive-set-buffer-as-visiting-file):
-       Call find-operation-coding-system with (FILENAME . BUFFER).
-
-       * tar-mode.el (tar-extract): Call find-operation-coding-system
-       with (FILENAME . BUFFER).
-
-       * international/mule.el (decode-coding-inserted-region):
-       Call find-operation-coding-system with (FILENAME . BUFFER).
-
-2006-05-25  Chong Yidong  <cyd@stupidchicken.com>
-
-       * image-mode.el (image-toggle-display): Use buffer contents to
-       generate image for a remote file.
-
-2006-05-25  Juri Linkov  <juri@jurta.org>
-
-       * replace.el (query-replace-read-from, query-replace-read-to):
-       Remove 8th arg KEEP-ALL in read-from-minibuffer.
-
-2006-05-25  Rajesh Vaidheeswarran  <rv@gnu.org>
-
-       * whitespace.el (whitespace-cleanup): Change to cleanup
-       region if one is active.
-       * whitespace.el (whitespace-cleanup-internal): New internal method.
-
-2006-05-25  Mathias Dahl  <mathias.dahl@gmail.com>
-
-       * dired.el (dired-mode-map): Add help-echo strings to tumme
-       commands.  Bind `tumme-dired-display-image' to C-t i.
-
-       * tumme.el (tumme-display-image): Change documentation string slightly.
-       (tumme-dired-display-image): Add call to `display-buffer'.
-
-2006-05-25  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * emacs-lisp/bindat.el (bindat-unpack, bindat-pack):
-       Signal error if RAW-DATA is a multibyte string.
-
-2006-05-24  Richard Stallman  <rms@gnu.org>
-
-       * subr.el (with-local-quit): When handling `quit' signal,
-       make a chance for quit-flag to cause a quit.
-
-       * emacs-lisp/advice.el (ad-enable-advice, ad-activate)
-       (ad-disable-advice): Add autoloads.
-
-       * subr.el (read-passwd): Copy PROMPT before changing its properties.
-
-2006-05-25  Mathias Dahl  <mathias.dahl@gmail.com>
-
-       * dired.el (dired-mode-map): Change menu items for tumme as per
-       suggestions in emacs-devel.
-
-2006-05-25  Nick Roberts  <nickrob@snap.net.nz>
-
-       * dired.el (dired-mode-map): Fix breakage.
-
-2006-05-25  Mathias Dahl  <mathias.dahl@gmail.com>
-
-       * tumme.el (tumme-display-dired-image): Rename to...
-       (tumme-dired-display-image): ...this.
-       (tumme-track-movement): Change default value to t.
-       (tumme-display-thumbs): Add new optional parameter DO-NOT-POP,
-       used from `tumme-next-line-and-display' and similar commands.
-
-       * dired.el (dired-mode-map): Add Thumbnail submenu under the
-       Immediate menu.  Add some tumme commands there.
-
-2006-05-24  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * loadup.el ("jka-cmpr-hook"): Load it before it is needed.
-
-2006-05-24  Chong Yidong  <cyd@mit.edu>
-
-       * menu-bar.el, international/mule-cmds.el: Remove tooltips for
-       menu entries that open submenus.
-
-2006-05-24  Alan Mackenzie  <acm@muc.de>
-
-       * startup.el (command-line): For names of preloaded files, don't
-       append ".elc" (now done in Fload), and call file-truename on the
-       lisp directory.
-
-       * subr.el (eval-after-load): Fix the doc-string.  Allow FILE to
-       match ANY loaded file with the right name, not just those in
-       load-path.  Put a regexp matching the file name into
-       after-load-alist, rather than the name itself.
-
-       * subr.el (load-history-regexp, load-history-filename-element)
-       (do-after-load-evaluation): New functions.
-
-       * international/mule.el (load-with-code-conversion): Do the
-       eval-after-load stuff by calling do-after-load-evaluation.
-
-2006-05-25  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-sentinel): Condition on GUD buffer if it
-       has not been killed.
-
-2006-05-24  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el: Set idle timer to clean up expired Apple events.
-       (mac-ae-get-url): Redispatch Apple event on unknown scheme.
-       (mac-dispatch-apple-event): Resume Apple event if it is suspended.
-       Optionally set error message in reply.
-
-2006-05-24  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-open-at-point): Use renamed variable
-       `org-confirm-shell-link-function'.
-       (org-confirm-shell-link-function): Rename from
-       `org-confirm-shell-links'.
-       (org-export-directory): New function.
-       (org-export-as-ascii, org-export-as-html, org-export-as-xoxo)
-       (org-export-icalendar): Use `org-export-directory'.
-       (org-indent-item): Keep cursor position.
-       (org-link-file-path-type): New option.
-       (org-export-as-html): Fix bug with plain lists starting in
-       column 0.
-       (org-export-as-html): Remove deadline formatting, this happens
-       now already in `org-html-handle-time-stamps'.
-       (org-export-html-style): Deadline class removed.
-       (org-insert-labeled-timestamps-at-point): New option.
-       (org-cycle, org-occur, org-scan-tags): Use `org-overview' instead
-       of `hide-sublevels 1', in case the first headline is not level 1.
-       (org-overview, org-content): New fuction.
-       (org-cycle-global-status, org-cycle-subtree-status): Make these
-       variables buffer-local.
-       (org-global-cycle): New command.
-       (org-shifttab): Use `org-global-cycle'.
-       (org-insert-heading, org-insert-item): Go to end of new
-       headline/item after creating it.
-       (org-export-visible): Rename from `org-export-copy-visible'.
-       Now creates a temporary org-file and applies an exporting command
-       to it.
-       (org-table-eval-formula): Support for lisp forms.
-       (org-agenda-todo-ignore-scheduled): New option.
-       (org-agenda-get-todos): Use new option
-       `org-agenda-todo-ignore-scheduled'.
-       (org-export-html-inline-images): New value `maybe'.
-       (org-export-as-html): Inlining of images dependent on link description.
-       (org-archive-subtree): Check for end-of-buffer before trying
-       `kill-line'.
-       (org-agenda-follow-mode): New option.
-       (org-export-with-tags, org-export-with-timestamps): New options.
-       (org-html-handle-time-stamps): New function.
-       (org-keyword-time-regexp): New variable.
-       (org-agenda-get-todos): Use `org-agenda-todo-list-sublevels'.
-       (org-agenda-todo-list-sublevels): New option.
-       (org-html-level-start): When TITLE is nil, just close all levels.
-       (org-parse-key-lines, org-parse-export-options): Remove functions,
-       replaced by `org-infile-export-plist'.
-       (org-combine-plists, org-infile-export-plist)
-       (org-default-export-plist): New functions.
-       (org-export-html-preamble, org-export-html-postamble)
-       (org-export-html-auto-preamble, org-export-html-auto-postamble):
-       New variables.
-       (org-export-publishing-directory): New option.
-       (org-export-as-html, org-export-as-ascii): Use the new property
-       lists for settings.
-       (org-export-copy-visible, org-export-as-xoxo):
-       Respect `org-export-publishing-directory'.
-       (org-link-search, org-store-link, org-file-apps): Support for
-       links to BibTeX database entries..
-       (org-get-current-options, org-set-regexps-and-options):
-       Implement logging as a startup option.
-       (org-store-link): Make sure context string is never empty
-       (org-insert-link): Use relative path when possible.
-       (org-at-item-checklet-p): New function.
-       (org-shifttab, org-shiftmetaleft, org-shiftmetaright)
-       (org-shiftmetaup, org-shiftmetadown, org-metaleft)
-       (org-metaright, org-metaup, org-metadown, org-shiftup)
-       (org-shiftdown, org-shiftright, org-shiftleft)
-       (org-ctrl-c-ctrl-c, org-cycle, org-return, org-meta-return):
-       Dispatch using `call-interactively'.
-       (org-call-with-arg): New defsubst.
-       (org-tag-alist, org-use-fast-tag-selection): New options.
-       (org-complete): Use `org-tag-alist'.
-       (org-fast-tag-insert, org-fast-tag-selection): New functions.
-       (org-next-item, org-previous-item): New commands.
-       (org-beginning-of-item, org-end-of-item): Add (interactive) to
-       make command.
-       (org-shiftup, org-shiftdown): Accommodate the item-navigation commands.
-
-2006-05-23  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * emacs-lisp/ewoc.el (ewoc-delete): New function.
-       (ewoc-filter): Use `ewoc-delete'.
-
-       * emacs-lisp/bindat.el (bindat-pack): Doc fix.
-
-2006-05-22  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * textmodes/bibtex.el (bibtex-format-entry, bibtex-clean-entry):
-       Signal more user-friendly error messages.
-
-       * complete.el (PC-do-completion): Undo the addition of implicit
-       wildcards if they did not lead to finding any match.
-       (read-file-name-internal): Don't add the final > if the completion is
-       not finished.
-
-2006-05-22  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * textmodes/bibtex.el (bibtex-maintain-sorted-entries):
-       Quote safe-local-variable predicate.
-
-2006-05-22  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * emacs-lisp/ewoc.el (ewoc-set-data): New function.
-
-2006-05-21  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
-
-       * textmodes/bibtex.el (bibtex-maintain-sorted-entries): Mark as safe.
-
-       * progmodes/make-mode.el (makefile-special-targets-list)
-       (makefile-macro-table, makefile-target-table): Mark as risky.
-       (makefile-query-one-target-method): Make this the alias for the
-       following variable.
-       (makefile-query-one-target-method-function): Make this the real name.
-
-       * textmodes/artist.el (artist-text-renderer): Make this the alias
-       for the following variable.
-       (artist-text-renderer-function): Make this the real name.
-
-       * textmodes/flyspell.el (flyspell-generic-check-word-p): Make this
-       the alias for the following variable.
-       (flyspell-generic-check-word-predicate): Make this the real name.
-
-       * textmodes/ispell.el (ispell-format-word): Make this the alias
-       for the following variable.
-       (ispell-format-word-function): Make this the real name.
-       (ispell-message-text-end): Mark as risky.
-
-       * skeleton.el (skeleton-transformation, skeleton-filter)
-       (skeleton-pair-filter): Make these the aliases for the following
-       variables.
-       (skeleton-transformation-function, skeleton-filter-function)
-       (skeleton-pair-filter-function): Make these the real names.
-
-       * progmodes/sh-script.el (sh-mode): Use skeleton-filter-function
-       and skeleton-pair-filter-function.
-
-       * textmodes/sgml-mode.el (sgml-transformation): Make this the
-       alias for the following variable.
-       (sgml-transformation-function): Make this the real name.
-       (sgml-tag-alist): Mark as risky.
-
-2006-05-21  Richard Stallman  <rms@gnu.org>
-
-       * simple.el (kill-region): Interactively, pass point, then mark.
-
-2006-05-22  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * emacs-lisp/ewoc.el (ewoc-create): Add autoload cookie.
-
-2006-05-21  Romain Francoise  <romain@orebokech.com>
-
-       * dired-x.el (dired-mode-map): Don't bind M-g.
-
-2006-05-20  Richard Stallman  <rms@gnu.org>
-
-       * dired.el (dired-mode-map): Put dired-goto-file on j, not M-g.
-       (dired-goto-file): Doc fix.
-
-2006-05-21  Kim F. Storm  <storm@cua.dk>
-
-       * emulation/cua-base.el: Mention customizing cua-mode as alternative
-       way to enable built-in cua-mode if user loads older CUA-mode package.
-
-       * ido.el (ido-read-file-name): Bind ido-show-dot-for-dired to nil
-       if default-filename is specified.
-
-2006-05-20  Eli Zaretskii  <eliz@gnu.org>
-
-       * menu-bar.el (menu-bar-manuals-menu) <info-apropos>: New menu item.
-
-       * info.el (info-apropos): Make sure current-file and current-node
-       have non-nil values.  Speed up by using add-to-list instead of
-       manual consing.
-
-2006-05-20  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac@lrde.org>
-
-       * progmodes/make-mode.el (makefile-mode): Doc fix.
-
-2006-05-20  Eli Zaretskii  <eliz@gnu.org>
-
-       * dired-aux.el (dired-do-shell-command): Doc fix.
-
-2006-05-20  Kevin Ryde  <user42@zip.com.au>
-
-       * info-xref.el (info-xref-check-all-custom): Skip :tag part of
-       ``(custom-manual :tag "Foo" "(foo)Node")''.
-
-2006-05-20  Karl Chen  <quarl@cs.berkeley.edu>
-
-       * progmodes/cc-vars.el (c-backslash-column): Mark as safe if its
-       value is an integer.
-
-2006-05-20  Eli Zaretskii  <eliz@gnu.org>
-
-       * mail/rmail.el (rmail-mime-charset-pattern): Add "?:" before
-       "format".
-       (rmail-convert-to-babyl-format): Undo the change from 2006-04-19.
-
-2006-05-20  Martin Rudalics  <rudalics@gmx.at>
-
-       * progmodes/hideif.el (show-ifdef-block): Fix bug where parts of
-       a hidden block remained hidden if `hide-ifdef-lines' is non-nil.
-
-2006-05-20  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/gud.el (gdb-script-font-lock-keywords): Use a stricter
-       regexp for keywords.
-
-2006-05-20  Masayuki FUJII  <boochang@m4.kcn.ne.jp>  (tiny change)
-
-       * dnd.el (dnd-get-local-file-name): Specify LITERAL in
-       replace-regexp-in-string.
-
-       * term/w32-win.el (w32-drag-n-drop): Substitute '/' for '\',
-       encode, and escape file name on conversion to URL.
-
-2006-05-20  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * dnd.el (dnd-handle-one-url): Change 3rd arg ARG to URL.
-       Don't unescape URL.
-       (dnd-get-local-file-name): Unescape URL on conversion to file name.
-
-       * x-dnd.el (x-dnd-handle-file-name): Encode and escape file names
-       on conversion to URLs.
-
-       * net/browse-url.el (browse-url-file-url): Encode file name on
-       conversion to URL.
-
-       * term/mac-win.el (mac-ae-open-documents): Escape file name on
-       conversion to URL.
-
-2006-05-19  Eli Zaretskii  <eliz@gnu.org>
-
-       * progmodes/cc-styles.el (c-style-alist): Doc fix.
-
-2006-05-19  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el (mac-bytes-to-digits): Remove function.
-       (mac-handle-toolbar-switch-mode): Use coercion instead of it.
-
-2006-05-19  Glenn Morris  <rgm@gnu.org>
-
-       * calendar/diary-lib.el (diary-bahai-date)
-       (list-bahai-diary-entries, mark-bahai-diary-entries)
-       (mark-bahai-calendar-date-pattern): Not interactive.
-       (add-to-diary-list): New optional arg LITERAL.  Doc fix.
-       (diary-entries-list): Change format of 4th element in each entry.
-       (diary-list-entries): Use add-to-diary-list.
-       (diary-goto-entry): Handle the case where the buffer visiting the
-       diary has been killed.
-       (fancy-diary-display): Add 'locator to button rather than 'marker.
-       Only generate temp-face when there are marks to apply.
-       (list-sexp-diary-entries): Pass literal to add-to-diary-list.
-       (diary-fancy-date-pattern): New variable.
-       (diary-time-regexp): Doc fix.
-       (diary-anniversary, diary-time): New faces.
-       (fancy-diary-font-lock-keywords): Use diary-fancy-date-pattern and
-       diary-time-regexp.  Add font-lock-multiline property where needed.
-       Use new faces diary-anniversary and diary-time.
-       (diary-fancy-font-lock-fontify-region-function): New function, to
-       handle multiline font-lock pattern in fancy diary.
-       (fancy-diary-display-mode): Set font-lock-fontify-region-function.
-       (diary-font-lock-keywords): Tweak time regexp.  Use new face
-       diary-time.
-
-2006-05-19  Alexander Shopov  <ash@contact.bg>  (tiny change)
-
-       * international/code-pages.el (mik): Table corrected.
-
-2006-05-18  Kim F. Storm  <storm@cua.dk>
-
-       * progmodes/grep.el (grep-find): Don't check grep-find-command
-       before running command (breaks non-interactive usage).
-
-2006-05-18  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * emacs-lisp/ewoc.el (ewoc--adjust): New func.
-       (ewoc--insert-new-node): Don't insert trailing newline.
-       Instead, adjust successor nodes's start markers.
-       (ewoc--refresh-node): Delete all text from current node's start
-       marker to the next one's; adjust successor nodes's start markers.
-       (ewoc--create): Doc fixes.
-       (ewoc--refresh): Don't insert newline.
-       (ewoc--set-hf): Use `ewoc--set-buffer-bind-dll-let*'.
-       * pcvs.el (cvs-make-cvs-buffer):
-       Specify extra newline for ewoc's header and footer.
-       (cvs-update-header): Update initial header recognition.
-       Append newline to final header and footer values.
-       * pcvs-info.el (cvs-fileinfo-pp): Insert trailing newline.
-
-2006-05-17  Richard Stallman  <rms@gnu.org>
-
-       * files.el (file-name-extension): Doc fix.
-
-2006-05-17  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * shell.el (shell-dirtrack-mode): Make it into a proper minor mode, so
-       we can explicitly enable/disable rather than toggle.
-       (shell-mode): Use it.
-       (shell-cd): Don't try to reproduce what `cd' does.
-
-2006-05-17  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-read-internal): Use only nondirectory part of
-       default item.
-
-2006-05-17  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * emacs-lisp/ewoc.el (ewoc-data): Add docstring.
-       (ewoc-nth): Doc fix.
-
-       (ewoc-map, ewoc-invalidate): Compute PP before looping.
-
-2006-05-16  Eli Zaretskii  <eliz@gnu.org>
-
-       * international/mule.el (auto-coding-alist): Add .lha to files
-       read with no-conversion.
-
-       * files.el (auto-mode-alist): Add .lha files to archive file
-       extensions.
-
-       * arc-mode.el (archive-arc-summarize, archive-lzh-summarize):
-       Convert csize to integer when computing offsets within the
-       compressed archive file.
-
-2006-05-16  Kim F. Storm  <storm@cua.dk>
-
-       * subr.el (add-to-history): Add KEEP-ALL arg and align functionality
-       with read-from-minibuffer.
-
-2006-05-16  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * emacs-lisp/bytecomp.el (byte-compile-warnings-safe-p): New function.
-       (byte-compile-warnings): Fix safe-local-variable property.
-
-2006-05-16  Ken Manheimer  <ken.manheimer@gmail.com>
-
-       * allout.el (allout-show-bodies, allout-old-style-prefixes)
-       (allout-stylish-prefixes, allout-numbered-bullet)
-       (allout-file-xref-bullet, allout-use-hanging-indents): Use simple
-       predicates to qualify `safe-local-variable' property, when
-       available, else use equivalent lambda.
-       (allout-current-topic-collapsed-p): Do the right thing regarding
-       trailing blank lines.
-
-2006-05-16  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * server.el (server-start): Only create a directory if needed.
-       (server-edit, server-unload-hook): server-start => server-mode.
-       (kill-emacs-hook): Cleanup upon exit.
-
-2006-05-15  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * hexl.el (hexlify-buffer): Encode process arguments manually.
-
-2006-05-16  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-tooltip-tips): Add missing argument to
-       call to gdb-tooltip-print.
-
-2006-05-15  Romain Francoise  <romain@orebokech.com>
-
-       * dired-x.el (dired-guess-shell-gnutar): On GNU and GNU/Linux
-       systems, default to "tar" since those systems probably have GNU tar.
-
-2006-05-14  Lars Hansen  <larsh@soem.dk>
-
-       * desktop.el (desktop-missing-file-warning): Fix docstring.
-       (desktop-restore-file-buffer): Correct question asked on missing file.
-
-2006-05-14  Kim F. Storm  <storm@cua.dk>
-
-       * progmodes/cc-subword.el (c-forward-subword, c-backward-subword):
-       Add CUA move property.
-
-2006-05-13  Chong Yidong  <cyd@stupidchicken.com>
-
-       * custom.el (custom-push-theme): Load the variable before checking
-       its `standard-value'.
-
-2006-05-13  Lars Hansen  <larsh@soem.dk>
-
-       * desktop.el (desktop-save): Use with-temp-buffer.
-
-2006-05-12  Glenn Morris  <rgm@gnu.org>
-
-       * calendar/cal-menu.el (calendar-mode-map, calendar-mouse-3-map):
-       * calendar/calendar.el (calendar-mode-map):
-       * calendar/diary-lib.el (include-other-diary-files, diary-mail-entries):
-       * calendar/appt.el (appt-check, appt-make-list): Refer to
-       diary-view-entries, diary-list-entries, diary-show-all-entries
-       rather than obsolete aliases.
-
-2006-05-12  Chong Yidong  <cyd@stupidchicken.com>
-
-       * simple.el (line-move-finish): Avoid calling point motion hooks
-       while processing intangibility.
-
-2006-05-12  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * term/xterm.el (terminal-init-xterm): Fix typo.
-
-2006-05-12  Ken Manheimer  <ken.manheimer@gmail.com>
-
-       * allout.el (allout-view-change-hook): Mark as being deprecated,
-       to be replaced by `allout-exposure-change-hook'.
-       (allout-exposure-change-hook): New, replacing
-       `allout-view-change-hook'.
-       (allout-flag-region): Run new hook `allout-exposure-change-hook',
-       in addition to `allout-view-change-hook'.
-       (allout-show-bodies, allout-old-style-prefixes)
-       (allout-stylish-prefixes, allout-use-hanging-indents): Quote the
-       lambda forms to prevent their showing up in variable help
-       presentations as inscrutable byte-compiled code.
-       (allout-numbered-bullet, allout-file-xref-bullet, allout-layout):
-       Use string-or-null-p to qualify safe-local-variable values.
-       (allout-reindent-bodies): Use memq to qualify matches against
-       valid safe-local-variable values.  Also, quote the lambda as above.
-       (allout-use-mode-specific-leader): Add missing candidate-value
-       symbols, use memq, and quote the lambda.
-       (allout-overlay-interior-modification-handler): Remove unused
-       variables `msg' and 'opened'.
-       (allout-hidden-p): Constrain invisibility consideration to allout's
-       invisibility spec, disregarding invisibility for other reasons.
-
-2006-05-12  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * files.el (version-control): Correct safe values.
-
-2006-05-12  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * emacs-lisp/ewoc.el (ewoc-refresh): Compute PP once before looping.
-
-       (ewoc--node-enter-before, ewoc--create-node): Delete funcs.
-       (ewoc--insert-new-node): New func.
-       Update callers of deleted funcs to use it, instead.
-
-2006-05-11  Glenn Morris  <rgm@gnu.org>
-
-       * calendar/calendar.el (diary-show-all-entries): Do not refer to
-       obsolete alias `show-all-diary-entries'.
-       (make-diary-entry): Not interactive.
-       (cal-tex-cursor-month, cal-tex-cursor-month-landscape)
-       (cal-tex-cursor-day, cal-tex-cursor-week, cal-tex-cursor-week2)
-       (cal-tex-cursor-week-iso, cal-tex-cursor-week-monday)
-       (cal-tex-cursor-filofax-2week, cal-tex-cursor-filofax-week)
-       (cal-tex-cursor-year-landscape, cal-tex-cursor-filofax-year)
-       (cal-tex-cursor-filofax-daily, cal-tex-cursor-year): Interactive.
-
-2006-05-11  Johan Bockg\e,Ae\e(Brd  <bojohan@dd.chalmers.se>
-
-       * calendar/calendar.el (calendar-french-date-string)
-       (calendar-mayan-date-string, calendar-chinese-date-string)
-       (calendar-astro-date-string, calendar-iso-date-string)
-       (calendar-islamic-date-string, calendar-bahai-date-string)
-       (calendar-hebrew-date-string, calendar-coptic-date-string)
-       (calendar-ethiopic-date-string, calendar-persian-date-string):
-       These functions are not interactive.
-
-2006-05-11  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * files.el: Balance parentheses.
-
-2006-05-11  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * files.el, newcomment.el, outline.el, simple.el,
-       * emacs-lisp/bytecomp.el, progmodes/cc-compat.el,
-       * progmodes/cc-vars.el, progmodes/compile.el:
-       Move `safe-local-variable' declarations to the respective files.
-
-       * help-fns.el (describe-variable): Don't print safe-var if it is
-       byte-code.  Improve wording as suggested by Luc Teirlinck.
-
-2006-05-11  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-reset): Update speedbar if necessary.
-       (gdb-var-evaluate-expression-handler, gdb-var-update-handler):
-       Use a token for pending-triggers to ensure gdb-var-update
-       gets called once per user input again for pre-GDB 6.4.
-       (gdb-var-delete): Match on more complex expressions.
-       (gdb-var-list-children-handler, gdb-var-create-handler):
-       Use a token for consistency.
-
-2006-05-11  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-read-date, org-goto-calendar)
-       (org-agenda-goto-calendar):
-       Bind `view-calendar-holidays-initially' to nil.
-
-2006-05-11  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * emacs-lisp/ewoc.el (ewoc--refresh-node): No longer save-excursion.
-       Update all callers to do it there, instead.
-
-2006-05-10  Glenn Morris  <rgm@gnu.org>
-
-       * calendar/calendar.el (calendar-basic-setup): Set day to 1 in
-       prefix arg case, to avoid view-diary-entries-initially error.
-       Reported by Stephen Berman <Stephen.Berman at gmx.net>.
-       (calendar-date-is-legal-p): Handle dates with no day part.
-
-2006-05-11  Nick Roberts  <nickrob@snap.net.nz>
-
-       * comint.el (comint-insert-input): Just make it when
-       comint-use-prompt regexp is nil (default) and with the mouse.
-       (comint-copy-old-input): Reinstate from 2004-06-23.
-       (comint-mode-map): Bind C-c C-m to it.
-
-2006-05-10  J.D. Smith  <jdsmith@as.arizona.edu>
-
-       * progmodes/idlw-shell.el (idlwave-shell-move-or-history):
-       Remove spurious move to point-max (new comint behavior fixes).
-
-       * progmodes/idlwave.el (idlwave-push-mark): Removed obsolete
-       compatibility function (Emacs 18/19).
-       (idlwave-is-continuation-line): Always return point at start of
-       previous non-blank continuation line.
-       (keyword-parameters): Fix continued comment font-lock matcher.
-       (idlwave-font-lock-fontify-region): Written, use as
-       font-lock-fontify-region-function, to fix continued keyword
-       fontification issues.
-
-2006-05-10  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el (mac-font-panel-mode): Doc fix.
-       (mac-service-selection, mac-service-open-file)
-       (mac-service-open-selection, mac-service-mail-selection)
-       (mac-service-mail-to, mac-service-insert-text): Rename from
-       mac-services-*.  All uses changed.
-       (mac-apple-event-map): Rename event symbol `services' to `service'.
-
-2006-05-10  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * emacs-lisp/ewoc.el (ewoc--dll-create, ewoc--node-delete)
-       (ewoc--node-enter-first, ewoc--node-enter-last)
-       (ewoc--delete-node-internal): Merge funcs into unique callers.
-
-2006-05-09  Chong Yidong  <cyd@stupidchicken.com>
-
-       * emacs-lisp/crm.el (completing-read-multiple): Properly handle
-       return value of read-from-minibuffer for empty input.
-
-2006-05-09  Miles Bader  <miles@gnu.org>
-
-       * comint.el (comint-insert-input): Remove redundant calls to setq
-       and goto-char.
-
-2006-05-10  Nick Roberts  <nickrob@snap.net.nz>
-
-       * comint.el (comint-insert-input): Make it work when
-       comint-use-prompt-regexp is t.
-
-2006-05-10  Miles Bader  <miles@gnu.org>
-
-       * subr.el (field-at-pos): New function.
-
-       * comint.el (comint-insert-input): Use it.
-
-2006-05-09  Juri Linkov  <juri@jurta.org>
-
-       * battery.el (battery-linux-proc-acpi): Also try
-       `/proc/acpi/thermal_zone/THR2/temperature'.
-
-       * files.el <safe-local-variable>: Remove `eval' and `let' binding
-       for now unused lambda `string-or-null'.
-
-       * add-log.el (change-log-default-name): Put `string-or-null-p'
-       instead of lambda on `safe-local-variable' property.
-
-       * diff-mode.el (diff-context->unified): Use `region-beginning' and
-       `region-end' instead of `mark' and `point'.
-       (diff-unified->context, diff-reverse-direction, diff-fixup-modifs):
-       Operate on region in Transient Mark mode when the mark is active.
-       Use `region-beginning' and `region-end' instead of `mark' and
-       `point'.
-       (diff-hunk-text, diff-goto-source): Doc fix.
-
-       * startup.el (fancy-splash-screens, normal-splash-screen): Use
-       face `mode-line-buffer-id' for mode-line buffer face instead of
-       hard-coded `(:weight bold)'.
-
-       * arc-mode.el (archive-set-buffer-as-visiting-file): Bind
-       buffer-undo-list to t (undo-ask is reproducible by visiting
-       nested archives).
-
-2006-05-09  Kim F. Storm  <storm@cua.dk>
-
-       * progmodes/grep.el (rgrep): Set default directory of *grep*
-       buffer if we start M-x rgrep in the *grep* buffer and choose
-       a different base directory.
-
-2006-05-09  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/tramp.el (tramp-register-file-name-handlers): Enable Tramp
-       completion also when ido is loaded.
-
-2006-05-09  Masatake YAMATO  <jet@gyve.org>
-
-       * font-lock.el (cpp-font-lock-keywords-source-directives): Addded
-       "warning" and "import".
-       (cpp-font-lock-keywords): Added "warning".
-
-2006-05-08  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * term/xterm.el (terminal-init-xterm): Add more key bindings.
-
-2006-05-08  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * mwheel.el (mwheel-scroll): Make sure that when scrolling multiple
-       pages at a time, if we signal the end, we should indeed reach that end.
-
-2006-05-08  David Reitter  <david.reitter@gmail.com>
-
-       * emacs-lisp/easy-mmode.el (define-minor-mode): Only preserve messages
-       output during execution of the body.
-
-2006-05-08  Kim F. Storm  <storm@cua.dk>
-
-       * progmodes/grep.el (lgrep, rgrep): Doc fixes.
-
-2006-05-08  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * emacs-lisp/ewoc.el (ewoc--set-buffer-bind-dll-let*):
-       Use with-current-buffer.
-
-2006-05-07  Kim F. Storm  <storm@cua.dk>
-
-       * subr.el (add-to-history): Remove keep-dups arg.
-
-       * kmacro.el (kmacro-push-ring): Let-bind history-delete-duplicates
-       to nil around call to add-to-history.
-
-2006-05-07  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * emacs-lisp/syntax.el (syntax-ppss): Flush the cache before rather
-       than after a buffer modification.
-
-2006-05-08  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-var-create-handler): Move speedbar
-       call to...
-       (gud-watch): ...here so speedbar is raised for already watched
-       expressions.
-       (gdb-speedbar-refresh): Delete function.
-       (gdb-speedbar-update, gdb-speedbar-timer-fn): New functions.
-       Use speedbar-timer-fn instead of speedbar-refresh (reverting
-       earlier change).
-       (gdb-var-evaluate-expression-handler)
-       (gdb-var-list-children-handler-1, gdb-var-update-handler-1): Use it.
-
-       * speedbar.el (speedbar-timer-fn): Remove save-window-excursion.
-       Update localized contents for all buffers except ignored modes.
-
-2006-05-07  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el (mac-utxt-to-string): Use `eq' instead of `='.
-       (mac-atsu-font-table, mac-font-panel-mode): Add defvars.
-       (mac-bytes-to-digits, mac-handle-toolbar-switch-mode)
-       (mac-handle-font-panel-closed, mac-handle-font-selection):
-       New functions.
-       (mac-font-panel-mode): New minor mode.
-       (mac-apple-event-map): Add bindings for toolbar toggle button and
-       font panel.
-       (menu-bar-showhide-menu): Add mac-font-panel-mode.
-
-2006-05-07  John Paul Wallington  <jpw@pobox.com>
-
-       * ibuffer.el (ibuffer-compressed-file-name-regexp):
-       Avoid `regexp-opt'; simplify regexp for readability.
-
-2006-05-06  Eli Zaretskii  <eliz@gnu.org>
-
-       * ldefs-boot.el (dired-do-redisplay, dired-maybe-insert-subdir):
-       * files.el (buffer-stale-function):
-       * dired-aux.el (dired-do-redisplay, dired-maybe-insert-subdir):
-       * autorevert.el (global-auto-revert-non-file-buffers): Point Info
-       links to the main manual, not to emacs-xtra.
-
-2006-05-06  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el (mac-utxt-to-string): Don't make adjustment for
-       MacJapanese if text is ASCII-only.
-
-2006-05-06  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-goto-breakpoint): Use or instead of
-       unless so nil isn't returned.
-       (gdb-setup-windows, gdb-restore-windows): Reset gdb-source-window.
-
-2006-05-06  Kim F. Storm  <storm@cua.dk>
-
-       * subr.el (add-to-history): New function.
-
-       * ediff.el (ediff-files, ediff-files3, ediff-merge-files)
-       (ediff-merge-files-with-ancestor):
-       * env.el (setenv):
-       * isearch.el (isearch-update-ring):
-       * server.el (server-visit-files):
-       * progmodes/grep.el (lgrep, rgrep):
-       * progmodes/vhdl-mode.el (vhdl-generate-makefile-1):
-       * progmodes/xscheme.el (xscheme-insert-expression):
-       Use add-to-history.
-
-       * kmacro.el (kmacro-push-ring): Use add-to-history.
-       (kmacro-ring-length): Remove unused defun.
-       (kmacro-start-macro): Use kmacro-push-ring.
-
-2006-05-06  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * emacs-lisp/ewoc.el (ewoc-create, ewoc-set-hf): Use `insert'
-       directly instead of a lambda expression that calls it.
-
-2006-05-06  Kim F. Storm  <storm@cua.dk>
-
-       * avoid.el (mouse-avoidance-point-position): Use posn-at-point
-       instead of compute-motion.
-
-2006-05-05  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * ibuffer.el (ibuffer-compressed-file-name-regexp): Undo previous
-       change.
-
-2006-05-05  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * startup.el (command-line-1): Refer to "Pure Storage" on
-       pure-space-overflow.
-
-2006-05-05  Martin Rudalics  <rudalics@gmx.at>
-
-       * emacs-lisp/re-builder.el (reb-update-overlays): Cycle through
-       provided faces once they all have been used up.
-
-2006-05-05  Eli Zaretskii  <eliz@gnu.org>
-
-       * startup.el (normal-splash-screen, fancy-splash-screens-1): Add a
-       reference to the Lisp manual to the warning about pure space
-       overflow.
-
-2006-05-05  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac@lrde.org>
-
-       * textmodes/ispell.el (ispell-buffer-local-dict): Add a `no-reload'
-       argument to avoid the call to `ispell-internal-change-dictionary'
-       when not needed.
-       (ispell-change-dictionary): Use this argument and call
-       `ispell-internal-change-dictionary' after the possible change
-       to `ispell-local-dictionary'.
-       (ispell-internal-change-dictionary): Check for a change in
-       personal dictionary use too.
-
-2006-05-05  Eli Zaretskii  <eliz@gnu.org>
-
-       * startup.el (command-line): On MS-Windows, probe "~", not
-       "~USER", for warning about non-existent home directory.
-
-       * arc-mode.el (archive-l-e): New optional argument `float' means
-       generate a float value.
-       (archive-arc-summarize, archive-lzh-summarize)
-       (archive-zip-summarize, archive-zoo-summarize): Invoke archive-l-e
-       with 3rd argument non-nil when file's size is being computed.
-       Format the file sizes with %8.0f instead of %8d.
-
-2006-05-05  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * cus-start.el (all): Add mac-dnd-known-types.
-
-       * term/mac-win.el (mac-utxt-to-string, mac-string-to-utxt)
-       (mac-TEXT-to-string, mac-string-to-TEXT, mac-furl-to-string)
-       (mac-TIFF-to-string): New functions.
-       (x-get-selection, x-selection-value)
-       (mac-select-convert-to-string): Use them.
-       (mac-text-encoding-mac-japanese-basic-variant): New constant.
-       (mac-dnd-types-alist): New customization variable.
-       (mac-dnd-handle-furl, mac-dnd-handle-hfs, mac-dnd-insert-utxt)
-       (mac-dnd-insert-TEXT, mac-dnd-insert-TIFF, mac-dnd-drop-data)
-       (mac-dnd-handle-drag-n-drop-event): New functions.
-       (mac-drag-n-drop): Remove function.
-       (global-map): Bind drag-n-drop and M-drag-n-drop to
-       mac-dnd-handle-drag-n-drop-event.
-
-2006-05-04  Karl Chen  <quarl@NOSPAM.quarl.org>
-
-       * progmodes/perl-mode.el (perl-beginning-of-function):
-       Skip anonymous subs.
-
-2006-05-04  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * ibuffer.el (ibuffer-compressed-file-name-regexp): Avoid loading
-       regexp-opt at run time.
-
-       * term.el (term-handle-ansi-escape): Fix off by one error.
-
-2006-05-04  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-force-update): Delete variable...
-       (gdb-init-1, gdb-post-prompt): ...and references to it.
-       (gdb-frame-handler): Strip directory name from filename if present.
-
-       * progmodes/gud.el (gdb-force-update): Delete defvar
-       (gud-speedbar-buttons): ...and references to it.  Use window-start
-       to try to keep positon in watch expression.
-
-2006-05-03  Richard Stallman  <rms@gnu.org>
-
-       * simple.el (next-history-element, previous-history-element): Doc fix.
-
-       * isearch.el (isearch-update-ring): Doc fix.
-
-2006-05-03  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * isearch.el (isearch-update-ring): Take history-delete-duplicates
-       into consideration.  Replace one arm ifs with whens.
-
-2006-05-03  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gud-watch): Let user select an expression.
-       (menu): Fix typo.
-
-2006-05-02  Miles Bader  <miles@gnu.org>
-
-       * replace.el (occur-engine): Bind `inhibit-field-text-motion' to t.
-
-2006-05-02  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-embed.el (calc-override-minor-modes-map)
-       (calc-override-minor-modes): New variables.
-       (calc-do-embedded): Make sure that Calc keystrokes aren't
-       overwritten by minor modes.
-
-2006-05-02  Chong Yidong  <cyd@mit.edu>
-
-       * msb.el (msb): If EVENT is a down event, read and discard the up event.
-
-2006-05-02  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * startup.el (command-line-1): Refer to Lisp manual when
-       pure-space-overflow occurs.
-
-       * files.el (byte-compile-dynamic, byte-compile-dynamic-docstrings)
-       (byte-compile-warnings, find-file-visit-truename, indent-tabs-mode)
-       (left-margin, no-byte-compile, no-update-autoloads, truncate-lines)
-       (version-control): Don't use `t' for safe-local-variable declarations.
-
-2006-05-01  Richard Stallman  <rms@gnu.org>
-
-       * diff-mode.el (diff-mode-shared-map): Don't bind M-W, M-U, M-C,
-       M-r, M-R, M-A, M-SPC or M-DEL.
-       (diff-mode-map): diff-refine-hunk now on C-c C-w
-       (diff-mode-map): Bind C-c C-e, C-c C-n, C-c C-r, C-c C-u.
-
-       * help-mode.el (help-mode): view-exit-action calls delete-window
-       only when it is safe and possible.
-
-       * simple.el (undo-outer-limit-truncate): Put quotes around buffer name
-       in messages.
-
-       * emacs-lisp/warnings.el (display-warning, lwarn): Doc fixes.
-
-       * tool-bar.el (tool-bar-setup): Put Help and Preferences items
-       in the default tool-bar-map.
-
-2006-05-01  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/tramp.el (tramp-completion-file-name-handler-alist)
-       (tramp-run-real-handler, tramp-completion-run-real-handler)
-       (tramp-completion-handle-file-name-all-completions)
-       (tramp-completion-handle-file-name-completion): Autoload them.
-       (tramp-completion-handle-file-exists-p)
-       (tramp-completion-handle-file-name-directory)
-       (tramp-completion-handle-file-name-nondirectory)
-       (tramp-completion-handle-expand-file-name): Remove them.
-       (tramp-handle-file-name-directory): Return the real directory name.
-       Returning "/" only doesn't need to be necessary any longer.
-       (tramp-file-name-handler): Make special attention when in hostname
-       completion mode.
-       (tramp-completion-file-name-handler): Revert patch from 2006-04-28.
-       (tramp-register-file-name-handlers):
-       Register `tramp-completion-file-name-handler' only when
-       `partial-completion-mode' is enabled.
-       (tramp-completion-handle-file-name-all-completions):
-       Delete directory part from results.
-       (tramp-get-completion-methods, tramp-get-completion-user-host):
-       Discard deleting "/", it doesn't work after the change of
-       `tramp-handle-file-name-directory' above.
-
-2006-05-01  Kim F. Storm  <storm@cua.dk>
-
-       * progmodes/grep.el (grep-expand-template): Use save-match-data
-       and symbol-value.
-
-2006-05-01  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el (mac-ae-open-documents, mac-drag-n-drop):
-       Use select-frame-set-input-focus instead of raise-frame.
-       (global-map): Bind M-drag-n-drop to mac-drag-n-drop.
-
-2006-05-01  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-def): Add %c case.
-       (gud-speedbar-buttons): Don't bind case-fold-search unnecessarily.
-       (gud-format-command): Make match case sensitive.  Match on %F.
-
-2006-04-30  Glenn Morris  <rgm@gnu.org>
-
-       * calendar/cal-tex.el (cal-tex-preamble-extra): New variable.
-       (cal-tex-preamble): Use cal-tex-preamble-extra.
-       (cal-tex-list-diary-entries): Refer to `diary-list-entries' rather
-       than alias `list-diary-entries'.
-
-2006-04-29  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * help-fns.el (describe-variable): Add info about safe local variables.
-
-2006-04-29  Richard Stallman  <rms@gnu.org>
-
-       * bindings.el (mode-line-format): help-echo doc fixes.
-
-       * net/tramp.el (tramp-file-name-handler-alist): Delete
-       expand-file-name and other operations that can cause spurious loading.
-
-2006-04-29  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * files.el (safe-local-variable-p): Remove support for the special
-       value t.
-
-       * textmodes/paragraphs.el (sentence-end-without-space):
-       Fix safety predicate.
-       (sentence-end-double-space, sentence-end-without-period)
-       (paragraph-ignore-fill-prefix):
-       * textmodes/fill.el (colon-double-space):
-       * abbrev.el (abbrev-mode): Tighten the safety predicate.
-
-       * subr.el (booleanp): New fun.
-
-       * textmodes/reftex-vars.el (reftex-guess-label-type):
-       Tighten the safety predicate.
-
-2006-04-28  Kim F. Storm  <storm@cua.dk>
-
-       * progmodes/grep.el (defgroup grep): Doc fix.
-       (grep-auto-highlight): Remove.
-       (grep-template): New defcustom.
-       (grep-find-template): Rename from grep-tree-template.
-       (grep-files-aliases): Rename from grep-tree-files-aliases.
-       Remove "all" alias, add "l" alias.
-       (grep-tree-ignore-case, grep-tree-ignore-CVS-directories): Remove.
-       (grep-find-ignored-directories): New defcustom to replace
-       grep-tree-ignore-CVS-directories, to facilitate ignoring
-       subdirectories for multiple version control systems.
-       (grep-mode-map): Add Recursive grep item to GREP menu.
-       (grep-regexp-history, grep-files-history): New defvars.
-       (grep-probe): New helper function.
-       (grep-compute-defaults): Use it to simplify code.
-       Adapt to name changes.
-       Use `.' as base in grep-find-template rather than <D>.
-       (grep): Remove superfluous highlight-regexp arg.  Fix doc.
-       Call grep-compute-defaults unconditionally.
-       (grep-expand-keywords): New defconst.
-       (grep-expand-template): Rename from grep-expand-command-macros.
-       Simplify via grep-expand-keywords.  Look at case-fold-search instead
-       of grep-tree-ignore-case to add -i option.
-       Bind case-fold-search to nil while matching keywords.
-       (grep-tree-last-regexp, grep-tree-last-files): Remove.
-       (grep-read-regexp, grep-read-files): New helper functions.
-       (rgrep): Rename from grep-tree.  Rework to use proper histories.
-       Adapt to changes in defcustoms and functions above.
-       (lgrep): New command, as grep, but using same interactive UI as rgrep.
-
-2006-04-28  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/tramp.el (tramp-completion-file-name-handler):
-       Disable Tramp's functionality while loading Tramp itself.
-       (tramp-register-file-name-handlers): That's a defsubst now.
-       Code from `tramp-repair-jka-compr' moved here.  Apply it via
-       `after-init-hook'.
-       (tramp-repair-jka-compr): Remove.
-
-2006-04-27  Jay Belanger  <belanger@truman.edu>
-
-       * calc-embed.el (calc-embedded-make-info): Use `math-read-expr' to
-       read expression when `math-read-big-expr' doesn't work.
-
-2006-04-27  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * startup.el (command-line-1): Display warning when
-       pure-space-overflow is non-nil.
-
-2006-04-26  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
-
-       * textmodes/bibtex.el (bibtex-user-optional-fields): Mark as
-       risky.
-
-2006-04-26  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
-
-       * textmodes/bibtex.el (bibtex-url): New optional arg no-browse.
-       Return the URL or nil if none can be generated.
-
-2006-04-27  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-comint-buffer): Move forward to stop
-       byte compiler warnings.
-       (gud-basic-call, gud-find-expr): Let user select an expression
-       for printing.  Print expression as well as value in GUD buffer.
-
-2006-04-17  Ken Manheimer  <ken.manheimer@gmail.com>
-
-       * allout.el: Remove local autoload declaration for
-       pgg-gpg-symmetric-key-p, since that's now done in pgg-gpg.el.
-       (allout-show-bodies, allout-header-prefix, allout-primary-bullet)
-       (allout-plain-bullets-string, allout-distinctive-bullets-string)
-       (allout-use-mode-specific-leader, allout-old-style-prefixes)
-       (allout-stylish-prefixes, allout-numbered-bullet)
-       (allout-file-xref-bullet, allout-presentation-padding)
-       (allout-use-hanging-indents, allout-reindent-bodies): Mark as
-       safe-local-variable with suitable value spec, and add autoload
-       cookie for loaddefs inclusion.  We now use an explicit spec everywhere.
-       (move-beginning-of-line, move-end-of-line): Repair so these compat
-       functions now actually resituate the point, when appropriate.
-
-2006-04-26  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/cc-subword.el (c-subword-mode-map): Use command remapping.
-
-       * add-log.el (add-log-iso8601-time-zone): Make parameter optional.
-       (add-log-iso8601-time-string): Fix call to format-time-string.
-
-2006-04-26  Kim F. Storm  <storm@cua.dk>
-
-       * subr.el (posn-string, posn-image, posn-object): Doc fix.
-
-2006-04-26  Masatake YAMATO  <jet@gyve.org>
-
-       * progmodes/asm-mode.el (asm-mode, asm-mode-syntax-table):
-       Add support for "//" style comments.  Remove `b' flag
-       from ?* in `asm-mode-syntax-table'.
-
-2006-04-26  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * follow.el: Use (featurep 'xemacs) everywhere.
-       (follow-mode): Use define-minor-mode.
-       (follow-mode-map): Move initialization into the declaration.
-       Use command remapping.
-       (follow-emacs-version-xemacs-p): Remove.
-       (follow-submit-feedback): Remove.
-
-       * allout.el (allout-layout, allout-passphrase-verifier-string)
-       (allout-passphrase-hint-string): Tighten up a bit the safety predicate.
-
-       * textmodes/reftex-vars.el (reftex-vref-is-default)
-       (reftex-fref-is-default, reftex-guess-label-type):
-       Tighten up a bit the safety predicate.
-
-       * textmodes/paragraphs.el (sentence-end-double-space)
-       (sentence-end-without-period, sentence-end-without-space)
-       (page-delimiter, paragraph-ignore-fill-prefix):
-       Tighten up a bit the safety predicate.
-
-       * textmodes/fill.el (colon-double-space): Tighten up the safety pred.
-
-       * progmodes/python.el (python-continuation-line-p)
-       (python-beginning-of-statement): syntax-ppss may return
-       a negative depth.
-       (python-mode): Don't forcefully enable font-lock.
-
-       * time-stamp.el (time-stamp-start, time-stamp-end)
-       (time-stamp-inserts-lines): Tighten up a bit the safety predicate.
-
-       * add-log.el: Remove spurious * in docstrings.
-       (add-log-time-zone-rule): Rename from change-log-time-zone-rule.
-       (add-change-log-entry): Use it here, since it's not specific
-       to iso8601.
-       (add-log-iso8601-time-string): Don't use it here any more.
-       (change-log-indent-text, change-log-indent): Rename from add-log-*.
-
-       * abbrev.el (abbrev-mode): Tighten up a bit the safety predicate.
-
-2006-04-25  Ryan Yeske  <rcyeske@gmail.com>
-
-       * net/rcirc.el (rcirc-print): Revert last change with ignored nicks.
-       (rcirc-toggle-low-priority): Doc fix.
-       (rcirc-handler-NOTICE): Remove beginning of line anchor in
-       ChanServ regexp.
-       (rcirc-startup-channels-alist): Connect to #rcirc by default, not
-       #emacs.
-       (rcirc-bright-nick-regexp, rcirc-dim-nick-regexp): Add variables.
-       (rcirc-decode-coding-system): Use utf-8 as the default.
-       (rcirc-multiline-minor-mode): Set the fill-column.
-       (rcirc-format-response-string): Display bright and dim nicks.
-       (rcirc-browse-url): Update interactive spec to fill ARG.
-       (rcirc-bright-nick, rcirc-dim-nick): Add faces.
-       (rcirc-print): Ignore dim-nick messages wrt modeline-activity.
-
-2006-04-24  J.D. Smith  <jdsmith@as.arizona.edu>
-
-       * textmodes/bibtex.el (bibtex-find-entry): Don't demand matching
-       case for @Article, etc.
-
-2006-04-23  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/tramp.el (tramp-register-file-name-handlers): New defun.
-       Added with autoload cookie.
-       (tramp-unload-file-name-handlers): Rename from
-       `tramp-unload-file-name-handler-alist'.
-
-2006-04-23  Romain Francoise  <romain@orebokech.com>
-
-       * comint.el (comint-match-partial-filename): Doc fix.
-
-2006-04-21  Glenn Morris  <rgm@gnu.org>
-
-       * calendar/cal-menu.el (calendar-mode-map): Refer to
-       `diary-view-entries' rather than alias `view-diary-entries'.
-       * calendar/diary-lib.el (view-other-diary-entries): Ditto.
-
-2006-04-21  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * progmodes/antlr-mode.el (antlr-default):
-       * cus-edit.el (custom-documentation):
-       * faces.el (scroll-bar, border, cursor, mouse): Avoid nil spec
-       in defface.
-
-2006-04-21  Kim F. Storm  <storm@cua.dk>
-
-       * image.el (image-type): New defun split out of create-image.
-       (create-image): Use it.
-
-2006-04-21  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-mode-map): Catch conflict with old allout.el.
-       (org-open-at-point): Remove the "...done" message to keep output
-       in the echo area visible.
-       (org-export-as-xoxo): Fix call to `indent-region'.
-
-2006-04-21  Kevin Ryde  <user42@zip.com.au>
-
-       * international/mule.el (keyboard-coding-system): defcustom
-       info-link fixes: "Specify Coding" has been split, keyboard now in
-       "Terminal Coding", and "Single-Byte Character Support" is now
-       "Unibyte Mode".
-
-2006-04-21  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-data-list-register-values-handler):
-       Use font-lock-warning-face for any errors e.g. no stack.
-       (gdb-stack-list-locals-handler): Display any errors e.g. no stack.
-
-2006-04-20  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * progmodes/sh-script.el (sh-shell): Mark as safe.
-
-       * newcomment.el (comment-start, comment-start-skip)
-       (comment-end-skip, comment-end): Mark as safe.
-
-2006-04-20  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-deadline-announce): Face removed.
-       (org-level-faces, org-n-levels): Convert to constant.
-       (org-compatible-face): New function.
-       (org-hide, org-level-1, org-level-2, org-level-3, org-level-4)
-       (org-level-5, org-level-6, org-level-7, org-level-8)
-       (org-special-keyword, org-warning, org-headline-done, org-link)
-       (org-date, org-tag, org-todo, org-done, org-table, org-formula)
-       (org-scheduled-today, org-scheduled-previously, org-time-grid):
-       Face definition revised for better color tty support.
-       (org-bold-re, org-italic-re, org-underline-re): New constants.
-       (org-set-font-lock-defaults): Use the new constants.
-       (org-agenda-highlight-todo): New function.
-       (org-agenda-todo): Fix bug with point at end of line.
-       (org-agenda-change-all-lines, org-finalize-agenda-entries):
-       Fontify TODO keywords.
-       (org-insert-link): Preserve relative path in ../ links.
-       (org-export-as-html): Convert links pointing to .org files into
-       links that will work beteen the exported HTML files.
-       (org-todo-list): Fix bug when arg=0.
-       (org-insert-heading): More fine-tuning.
-
-2006-04-19  Romain Francoise  <romain@orebokech.com>
-
-       * mail/rmail.el (rmail-convert-to-babyl-format): Use second group
-       from `rmail-mime-charset-pattern'.
-
-2006-04-18  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * progmodes/python.el (python-mode): Fix typo.
-
-2006-04-18  J.D. Smith  <jdsmith@as.arizona.edu>
-
-       * comint.el (comint-previous-input): Don't clobber input line
-       when moving off either end of the input history ring.
-       (comint-delete-input): New function, used by
-       `comint-previous-input' and others.
-       (comint-previous-matching-input):
-       Use `coming-delete-input'.  Save the partial input if leaving the
-       edit line.  Goto point-max before deleting input to avoid
-       partial input fragments hanging around.
-       (comint-restore-input): New function, used by `comint-previous-input'.
-
-2006-04-18  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * imenu.el (imenu--index-alist): Balance parentheses.
-
-2006-04-18  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * progmodes/python.el (python-mode): Add support for hs-minor-mode.
-
-2006-04-19  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * abbrev.el (read-abbrev-file): Use abbrev-file-name if optional
-       file is nil.
-
-2006-04-18  Richard Stallman  <rms@gnu.org>
-
-       * tooltip.el (tooltip-mode, tooltip-use-echo-area): Doc fixes.
-
-       * imenu.el (imenu-create-index-function, imenu--index-alist)
-       (imenu--last-menubar-index-alist, imenu--make-index-alist)
-       (imenu-default-create-index-function, imenu--generic-function):
-       Doc fixes.
-
-       * image-mode.el (image-toggle-display): Handle tar and arc subfiles.
-
-       * help-mode.el (help-mode): Set view-exit-action to delete window.
-
-       * env.el (setenv): Get rid of arg UNSET.  Interactive unsetting
-       now works by passing nil as arg.
-
-       * apropos.el (apropos-print): Don't do where-is on self-insert-command.
-
-       * abbrev.el (edit-abbrevs-redefine): Temporarily widen.
-       (read-abbrev-file): Provide default when reading filename.
-
-       * files.el (enable-local-variables): Allow :all as value.
-       (hack-local-variables): Implement that value.
-       (safe-local-variable-values, safe-local-eval-forms)
-       (enable-local-variables): Mark as risky.
-       (find-file-visit-truename, kept-old-versions): Mark safe.
-
-       * time-stamp.el (time-stamp-format, time-stamp-line-limit)
-       (time-stamp-start, time-stamp-end, time-stamp-inserts-lines)
-       (time-stamp-count, time-stamp-pattern): Add safe-local-variable prop.
-
-2006-04-18  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/tcl.el (tcl-send-string, tcl-send-region):
-       Use forward-line so as to get to BOL even in the presence of fields.
-       (tcl-eval-region): Strip surrounding space to avoid multiple prompts
-       in return.
-       (inferior-tcl): Tell tclsh to work in interactive mode.
-
-       * complete.el (partial-completion-mode):
-       Use 'choose-completion-string-functions to make sure that
-       choose-completion fills the minibuffer properly.
-
-       * complete.el (PC-old-read-file-name-internal): Remove.
-       (PC-read-include-file-name-internal): Remove.  Turn it into an advice
-       of read-file-name-internal.
-       (partial-completion-mode): Enable/disable this advice.
-
-2006-04-18  Juanma Barranquero  <lekktu@gmail.com>
-
-       * net/tramp.el (tramp-completion-file-name-handler): Revert change
-       of 2006-04-17.
-
-2006-04-18  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-insert-heading): Insert heading before
-       current if at beginning of line.
-       (org-todo, org-date): New faces.
-       (org-table-align): Make sure tooltip window contains full text.
-       (org-no-properties): New defsubst.
-       (org-set-font-lock-defaults): Use new faces.
-
-2006-04-18  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-speedbar-item-info): Display frame address
-       for root variables.
-
-       * progmodes/gdb-ui.el (gdb-pc-address): Rename from gdb-frame-address.
-       (gdb-frame-address): Re-use to identify frame for watch expression.
-       (gdb-var-list, gdb-var-create-handler): Add frame address for root
-       variables.
-       (gdb-init-1, gdb-source, gdb-post-prompt)
-       (gdb-assembler-custom, gdb-invalidate-assembler): Use gdb-pc-address.
-       (gdb-frame-handler): Get gdb-frame-address.
-
-2006-04-17  Michael Albinus  <michael.albinus@gmx.de>
-
-       Sync with Tramp 2.0.53.
-
-       * net/tramp.el (tramp-completion-mode): ?\t has event-modifier
-       'control.  Reported by Matthias F\e,Av\e(Brste <slashdevslashnull@gmx.net>.
-       (tramp-completion-file-name-handler): Add autoload cookie for
-       adding to `file-name-handler-alist'.
-
-       * net/tramp-smb.el (tramp-smb-wait-for-output): Wait always for
-       the prompt.  If it returns earlier (when detecting an error
-       message), the rest of the output will merge accidently with the
-       output of the next command.  Reported by M Jared Finder
-       <jared@hpalace.com>.
-
-       * net/tramp-vc.el (vc-user-login-name): Wrap defadvice with a test
-       for `process-file', in order to let it work for older Emacsen too.
-
-2006-04-17  Ralf Angeli  <angeli@iwi.uni-sb.de>
-
-       * textmodes/tex-mode.el (tex-font-lock-match-suscript): New function.
-       (tex-font-lock-keywords-3): Use it.
-
-2006-04-16  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * newcomment.el (comment-add): New function.
-       (comment-region-default, comment-dwim): Use it.
-
-2006-04-15  Michael Olson  <mwolson@gnu.org>
-
-       * emacs-lisp/tq.el: Improve comments.
-       (tq-queue-head-question): New accessor function.
-       (tq-queue-head-regexp, tq-queue-head-closure, tq-queue-head-fn):
-       Update for modified queue structure.
-       (tq-queue-add): Accept `question' argument.
-       (tq-queue-pop): If a question is pending, send it.
-       (tq-enqueue): Accept new optional argument `delay-question'.
-       If this is non-nil, and at least one other question is pending a
-       response, queue the question rather than sending it immediately.
-
-2006-04-15  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
-
-       * calendar/appt.el (appt-add): Check whether an appointment is
-       already present in appt-time-msg-list.  Simplify code.
-
-2006-04-14  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/cc-langs.el (c-mode-menu):
-       Don't presume c-subword-mode is bound.
-
-2006-04-13  Bill Wohler  <wohler@newt.com>
-
-       * cus-edit.el (customize-package-emacs-version-alist): Update docstring.
-       (customize-package-emacs-version): Use cdr instead of cadr now
-       that alists use dotted pairs.
-
-       * custom.el (defcustom): Fix docstring for :package-version.
-
-2006-04-13  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/tramp.el (tramp-display-shell-command-buffer): New defvar.
-       (tramp-handle-shell-command): Display output buffer only when
-       `tramp-display-shell-command-buffer' is true.
-       (tramp-handle-process-file): Set `tramp-display-shell-command-buffer'.
-
-2006-04-13  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-set-autofill-regexps): Set only the local
-       values of `adaptive-fill-regexp' and `adaptive-fill-function'.
-
-2006-04-13  Romain Francoise  <romain@orebokech.com>
-
-       * pcvs-parse.el (cvs-parse-table): Use `with-temp-buffer' to avoid
-       leaving temporary .cvsignore buffers behind.
-
-2006-04-13  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-set-regexps-and-options)
-       (org-get-current-options): Better names for the startup folding
-       options.
-
-2006-04-13  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * vc.el (vc-annotate): Arrange for point to end up at the same
-       line number as in the original, but only when using a new buffer.
-
-2006-04-12  Stuart Herring  <herring@lanl.gov>  (tiny change)
-
-       * files.el (hack-one-local-variable-eval-safep):
-       Recognize `edebug-form-spec' for `put', but only if it passes
-       `edebug-basic-spec'.  Generalize `put' handling.
-
-       * emacs-lisp/edebug.el (edebug-basic-spec): New function for
-       vetting file-local form specs.
-
-       * allout.el (allout-layout): Autoload its `safe-local-variable'
-       property.
-
-2006-04-13  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-ctrl-c-ctrl-c): Improve documentation string.
-       (org-agenda-mouse-1-follows-link)
-       (org-mouse-1-follows-link): New options.
-       (org-format-agenda-item): Fix bug if TAGS is nil.
-       (org-agenda-get-scheduled): Quote `priority' symbol in plist.
-
-2006-04-13  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-set-gud-minor-mode-existing-buffers):
-       GDB 6.1+ gives full filename for "info sources" so use
-       file-name-nondirectory.
-
-2006-04-12  Romain Francoise  <romain@orebokech.com>
-
-       * subr.el (read-passwd): Bind `message-log-max' to nil.
-
-2006-04-12  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/perl-mode.el (perl-indent-new-calculate):
-       Recompute parse-start after jumping backward by a whole sexp.
-
-2006-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * vc.el (vc-ensure-vc-buffer): Only change current-buffer, not the
-       window configuration.
-       (vc-annotate-display-select): Select the buffer so that current-buffer
-       (and selected-window) is the output buffer at the end of vc-annotate.
-
-2006-04-11  J.D. Smith  <jdsmith@as.arizona.edu>
-
-       * vc.el (vc-annotate-color-map): Add custom TTY color map for
-       8-color terminals, to use all of the colors in a sensible order.
-       256-color terminals work well with the standard map.
-       (vc-annotate-lines): Only strip the first color character if it
-       is "#", to allow for terminal-style named colors.
-       (vc-annotate-warp-version): Pass buf to `goto-line' to ensure
-       the correct buffer is scrolled.
-
-2006-04-11  Richard Stallman  <rms@gnu.org>
-
-       * emacs-lisp/bytecomp.el (byte-compile-file):
-       Bind enable-local-variables to :safe, and make normal-mode obey it.
-
-       * files.el (enable-local-variables): Allow value :safe.
-       (normal-mode): Doc fix.
-       (hack-local-variables): Implement enable-local-variables = :safe.
-       (hack-local-variables-confirm): Don't prevent quitting.
-
-2006-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * loadhist.el (unload-feature): A bit of sanity check of
-       load-history entries.  Cancel timer-vars before unbinding them.
-
-       * hexl.el (hexl-isearch-search-function): Fix regexp-building code to
-       quote special chars, and make the trick work on the hex part of the
-       buffer as well.
-       (hexl-mode, hexl-save-buffer, hexl-mode-exit)
-       (hexl-maybe-dehexlify-buffer): Use restore-buffer-modified-p.
-
-       * startup.el (normal-splash-screen): Fix last change so we don't wait
-       2 minutes if we don't show the splash screen.
-
-2006-04-11  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-export-plain-list-max-depth)
-       (org-table-spaces-around-separators)
-       (org-radio-targets, org-activate-camels)
-       (org-table-spaces-around-invisible-separators): Options removed.
-       (org-time-stamp-rounding-minutes, org-remember-templates)
-       (org-ellipsis, org-activate-links, org-descriptive-links):
-       New options.
-       (org-remember-apply-template, org-current-time)
-       (org-finish-edit-table-field)
-       (org-link-unescape, org-link-escape)
-       (org-string-width, org-table-clean-line, org-html-do-expand)
-       (org-edit-agenda-file-list, org-store-new-agenda-file-list)
-       (org-read-agenda-file-list): New functions.
-       (org-table-edit-field)
-       (org-table-create-or-convert-from-region): New commands
-       (org-table-toggle-vline-visibility): Command removed.
-       (org-table-convert-region): Made a command.
-       (orgtbl-deleta-backward-char, orgtbl-delete-char): Remove commands.
-       Replace with the normal org- functions.
-       (org-self-insert-command): Don't trigger realign unnecessarily
-       when blanking a field that is not full.
-       (org-mode): `Set buffer-invisibility-spec' for links.
-       (org-activate-links2): Hide link part and only show descriptive
-       part of the link.
-       (org-insert-link): Modify for new linking system.
-       (org-store-link): Store description separately, for use by
-       `org-insert-link'.
-       (org-table-align): Use `org-string-width'.
-       (defgroup): Completely new group structure for custom variables.
-       (org-agenda-files): Option: Single file name allowed.  Function:
-       Optional argument unrestrited means ignore any restricitons.
-       (org-install-agenda-files-menu): Find a buffer in Org-mode before
-       trying to modify the menu.  Use generalized access to
-       `org-agenda-files.'
-       (org-agenda-list, org-todo-list, org-cycle-agenda-files)
-       (org-agenda-file-to-front, org-remove-file, org-diary)
-       (org-tags-view, org-export-icalendar-all-agenda-files)
-       (org-export-icalendar-combine-agenda-files): Use generalized
-       access to `org-agenda-files'.
-       (org-remember-handler): Correctly preserve heading if present.
-       (org-table-insert-row, org-table-insert-hline): Deal with
-       invisible characters.
-
-2006-04-10  J.D. Smith  <jdsmith@as.arizona.edu>
-
-       * vc.el (vc-annotate-display-mode): Made default 'fullscale.
-       (vc-annotate-color-map): New 18 element constant
-       value/saturation, rotating hue colormap, from red->blue.
-       (vc-annotate-mode-menu): "Default" -> "By Color Map Range".
-       (vc-annotate-display-select): Switch to annotate-mode elsewhere.
-       (vc-annotate): To avoid killing the required local variables,
-       set them before the end of `with-output-to-temp-buffer', and
-       after first switching to annotate-mode.
-       (vc-annotate-warp-version): Add buffer argument in goto-line to
-       ensure annotation, not source, is scrolled.
-
-2006-04-10  Bill Wohler  <wohler@newt.com>
-
-       * custom.el (defcustom, custom-handle-keyword):
-       Add :package-version keyword.
-       (custom-add-package-version): New function.  Sets value of new
-       property 'custom-package-version from :package-version keyword.
-       (defcustom): Create Common Keywords section in docstring.
-       (defface, defgroup): Replace definitions of a select few keywords
-       with a reference to the Common Keywords in defcustom.
-       (defcustom, defface, defgroup): Replace reference to Customization
-       chapter in manual with hyperlink.
-
-       * cus-edit.el (customize-package-emacs-version-alist): New variable.
-       (customize-changed-options): Add check for custom-package-version.
-       (customize-package-emacs-version): New function to look up Emacs
-       version corresponding to the given package version.
-
-       * emacs-lisp/find-func.el (find-function-regexp): Allow dashes in
-       defun name, in similar fashion to find-variable-regexp.
-
-2006-04-10  Eli Zaretskii  <eliz@gnu.org>
-
-       * international/mule-cmds.el (set-locale-environment): Fix last
-       change for when the locale's preferences don't specify any encoding.
-
-2006-04-10  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * emacs-lisp/find-func.el (find-function-search-for-symbol): Fix regexp
-       so the defined var/fun doesn't need to be quoted.
-
-2006-04-10  Richard Stallman  <rms@gnu.org>
-
-       * finder.el (finder-mode-map): Add n and p bindings.
-
-2006-04-10  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-init-1): Re-initialise gdb-main-file to nil.
-       (gdb-get-version): Make it work for pre "interpreter mi" (GDB 5.3?).
-       (gdb-setup-windows): Put something in source window if we can't find
-       the source file.
-       (gdb-frame-handler): Make it work again with just assembly.
-       (gdb-data-list-register-values-handler): Make it work when there is
-       no stack.
-
-2006-04-09  Richard Stallman  <rms@gnu.org>
-
-       * mail/rmail.el (rmail-mime-charset-pattern): Ignore format and delsp
-       specs while looking for charset.
-
-       * textmodes/picture.el (picture-mode-exit): Run picture-mode-exit-hook.
-
-       * play/landmark.el (lm-font-lock-face-O, lm-font-lock-face-X):
-       Make them faces.
-       (lm-font-lock-keywords): Update appropriately.
-
-2006-04-10  Kim F. Storm  <storm@cua.dk>
-
-       * simple.el (filter-buffer-substring): Add NOPROPS arg, so
-       it can also replace buffer-substring-no-properties.
-
-       * emulation/cua-base.el (cua-delete-region, cua-paste)
-       (cua-repeat-replace-region): Use filter-buffer-substring.
-
-       * emulation/cua-gmrk.el (cua-copy-region-to-global-mark)
-       (cua-cut-region-to-global-mark): Likewise.
-
-       * emulation/cua-rect.el (cua--extract-rectangle)
-       (cua-incr-rectangle, cua--rectangle-aux-replace): Likewise.
-
-2006-04-09  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
-
-       * textmodes/bibtex.el (bibtex-entry-update): New optional arg
-       entry-type.  Add field delimiters to numerical fields if they are
-       not present.
-
-2006-04-09  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
-
-       * textmodes/bibtex.el (bibtex-find-text-internal): Add new element
-       string-const to return value.
-       (bibtex-remove-delimiters): Use it.
-
-2006-04-08  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * emacs-lisp/bytecomp.el (byte-compile-form): Don't call
-       cl-byte-compile-compiler-macro unless it exists.
-
-2006-04-08  Eli Zaretskii  <eliz@gnu.org>
-
-       * files.el (hack-local-variables-confirm) <offer-save>:
-       Clarify message text.  Suggested by Ralf Angeli.
-
-2006-04-08  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac@lrde.org>
-
-       * rect.el (kill-rectangle): Don't barf if `kill-read-only-ok' is set.
-       (delete-extract-rectangle-line): Use `filter-buffer-substring'
-       instead of `buffer-substring' and `delete-region'.  (Most of the
-       code actually copied from `kill-region'.)
-
-2006-04-08  Ryan Yeske  <rcyeske@gmail.com>
-
-       * rcirc.el (rcirc-default-server): Rename from rcirc-server.
-       (rcirc-default-port): Rename from rcirc-port.
-       (rcirc-default-nick): Rename from rcirc-nick.
-       (rcirc-default-user-name): Rename from rcirc-user-name.
-       (rcirc-default-user-full-name): Rename from rcirc-user-full-name.
-       (rcirc-low-priority-flag): New variable.
-       (rcirc-decode-coding-system): New defcustom.
-       (rcirc-encode-coding-system): New defcustom.
-       (rcirc-coding-system-alist): New defcustom.
-       (rcirc-multiline-major-mode): New defcustom.
-       (rcirc-nick): New internal variable.
-       (rcirc-process): Remove variable.
-       (rcirc-server-buffer): New variable.
-       (rcirc): Update to use rcirc-default-* variables above.
-       (rcirc-connect): Do not add window-configuration-hook-here.
-       (rcirc-server): New internal variable.
-       (rcirc-connect): Do not send keepalive pings if
-       rcirc-keepalive-seconds is nil.
-       (with-rcirc-server-buffer): New macro.
-       (rcirc-send-string): Encode with rcirc-encode-coding-system.
-       (rcirc-server-name): Rename from rcirc-server.
-       (rcirc-buffer-process): New function.
-       (rcirc-buffer-nick): New function.
-       (rcirc-buffer-target): Remove function.
-       (set-rcirc-decode-coding-system, set-rcirc-encode-coding-system):
-       New commands.
-       (rcirc-mode-map): Change binding of C-c C-l to
-       rcirc-toggle-low-priority.
-       (rcirc-mode): Initialize coding system based on
-       rcirc-coding-system-alist.  New change-major-mode-hook to part the
-       channel on a mode change.  Make kill-buffer-hook buffer-local.
-       (rcirc-change-major-mode-hook): New function.
-       (rcirc-clean-up-buffer): Rename from rcirc-kill-buffer-hook-1.
-       (rcirc-last-post-time): New variable.
-       (rcirc-process-message): Store the last time user posted a message
-       to this target.
-       (rcirc-multiline-minor-mode): New mode.
-       (rcirc-multiline-minor-mode-map): New mode map.
-       (rcirc-edit-multiline): Put multiline-edit buffer in
-       rcirc-multiline-major-mode along with rcirc-multiline-minor-mode.
-       (rcirc-print): Ignore any line starting with an ignored nick.
-       (rcirc-print): Decode using rcirc-decode-coding-system.
-       (rcirc-track-minor-mode): Update global-mode-string when disabling
-       this mode.
-       (minor-mode-alist): Add LowPri indicator.
-       (rcirc-toggle-low-priority): New function.
-       (rcirc-last-non-irc-buffer): Prefix arg now no means switch to
-       next lowpriority buffer with activity.
-       (rcirc-record-activity): Sort buffers in rcirc-activity by the
-       last time the user posted a message in to the target.
-       (rcirc-update-activity-string): New formatting for low priority
-       buffers.
-       (rcirc-split-activity): New function.
-       (rcirc-handler-PART, rcirc-handler-KICK)
-       (rcirc-handler-PART-or-KICK): Kick responses are printed properly.
-       (rcirc-nick-away-alist): New variable.
-       (rcirc-handler-301): New handler.  Away messages are printed once
-       per change.
-
-2006-04-08  Eli Zaretskii  <eliz@gnu.org>
-
-       * info.el (Info-follow-nearest-node): Doc fix.
-
-       * international/mule-cmds.el (set-locale-environment): Make sure
-       the coding-system preferred by the locale's language has the same
-       EOL conversion type as the original buffer-file-coding-system.
-       (locale-language-names): Add a few MS Windows language codes.
-
-2006-04-07  Richard Stallman  <rms@gnu.org>
-
-       * simple.el (eval-expression): Doc fix.
-
-       * emacs-lisp/lisp-mode.el (eval-print-last-sexp, eval-last-sexp)
-       (eval-defun): Doc fixes.
-
-2006-04-07  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * pgg-gpg.el: Revert to revision 1.8 to allow the use of gpg-agent.
-
-2006-04-07  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-init-2): Set current filename using
-       GDB list command without argument for greater generality.
-
-2006-04-06  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * subr.el (string-or-null-p): New function.
-
-       * textmodes/paragraphs.el (sentence-end): Use string-or-null-p.
-
-       * textmodes/ispell.el (ispell-local-dictionary): Use string-or-null-p.
-
-       * files.el: Update comment about safe-local-variable declarations.
-
-2006-04-06  J.D. Smith  <jdsmith@as.arizona.edu>
-
-       * progmodes/idlwave.el: Updated to IDLWAVE version 6.0.
-       See idlwave.org.
-
-       * progmodes/idlw-shell.el: Updated to IDLWAVE version 6.0.
-       See idlwave.org.  Includes code to obsolete idlw-rinfo.el.
-
-       * progmodes/idlw-help.el: Updated to IDLWAVE version 6.0.
-       See idlwave.org.
-
-       * progmodes/idlw-complete-structtag.el: Updated to IDLWAVE
-       version 6.0 (minimal changes).  See idlwave.org.
-
-       * progmodes/idlw-toolbar.el: Updated to IDLWAVE version
-       6.0 (minimal changes).  See idlwave.org.
-
-       * progmodes/idlw-rinfo.el: File obsoleted and removed.
-
-2006-04-06  Romain Francoise  <romain@orebokech.com>
-
-       * pgg-gpg.el: Sync back with Gnus 5.10, reverting changes that add
-       symmetric encryption features and a new asynchronous interface to
-       GnuPG.  This new version is version 1.4, plus whitespace changes.
-
-2006-04-06  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * files.el: Move some `safe-local-variable' declarations to the
-       respective files.
-
-       * textmodes/ispell.el (ispell-check-comments)
-       (ispell-local-dictionary): Mark as safe.
-
-       * abbrev.el (abbrev-mode): Mark as safe.
-
-       * add-log.el (change-log-default-name): Mark as safe.
-
-       * textmodes/reftex-vars.el (reftex-vref-is-default)
-       (reftex-fref-is-default, reftex-level-indent)
-       (reftex-guess-label-type): Mark as safe.
-
-       * textmodes/fill.el (colon-double-space): Mark as safe.
-
-       * textmodes/paragraphs.el (paragraph-start, paragraph-separate)
-       (sentence-end-double-space, sentence-end-without-period)
-       (sentence-end-without-space, sentence-end, sentence-end-base)
-       (page-delimiter, paragraph-ignore-fill-prefix): Mark as safe.
-
-2006-04-06  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-mode): Remove ido-ignore-unc-host-regexps from
-       the :set-after list.
-       (ido-downcase-unc-hosts): New user option.  Default on.
-       (ido-ignore-unc-host-regexps): Don't reset ido-unc-hosts-cache
-       when it is set, as regexps are now applied on the fly.
-       (ido-unc-hosts): Keep all known hosts in ido-unc-hosts-cache.
-       Make C-a DTRT--filter hosts through ido-ignore-unc-host-regexps
-       on the fly, but only when ido-process-ignore-lists is set.
-       Do case insensitive filtering if ido-downcase-unc-hosts is set.
-       Only downcase names if ido-downcase-unc-hosts is set.
-
-2006-04-06  Juanma Barranquero  <lekktu@gmail.com>
-
-       * ido.el (ido-unc-hosts-cache): Fix typo in docstring.
-
-       * woman.el (WoMan-xref-man-page): Fix call to `substring'.
-
-2006-04-05  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-mode): Set after ido-unc-hosts and
-       ido-ignore-unc-host-regexps.
-       (ido-save-history): Save ido-unc-hosts-cache.
-       (ido-load-history): Load ido-unc-hosts-cache.
-       (ido-reread-directory): Refresh unc hosts cache in // dir.
-
-       * startup.el (fancy-splash-screens): Set emulation-mode-map-alists
-       to nil while displaying slash screen.
-
-2006-04-05  Daiki Ueno  <ueno@unixuser.org>
-
-       * pgg-gpg.el (pgg-gpg-encrypt-region, pgg-gpg-sign-region):
-       Wait for BEGIN_SIGNING too, new in GnuPG 1.4.3.
-
-2006-04-05  Kenichi Handa  <handa@m17n.org>
-
-       * international/characters.el: Setup cases of Latin, Greek, and
-       Cyrillic characters in CJK charsets.
-
-2006-03-29  Daiki Ueno  <ueno@unixuser.org>
-
-       * pgg-gpg.el (pgg-gpg-start-process): Don't bind
-       default-enable-multibyte-characters.  This reverts the change from
-       revision 6.17 which is no longer necessary because the passphrase
-       is sent separately now.  GnuPG messages are unreadable under
-       multibyte locales with default-enable-multibyte-characters set to nil.
-
-2006-04-04  Andreas Schwab  <schwab@suse.de>
-
-       * files.el: Mark `left-margin', `byte-compile-dynamic-docstrings'
-       and `byte-compile-warnings' as `safe-local-variable'.
-
-2006-04-04  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * man.el (Man-mode-map): Restore the \r binding.
-       (Man-abstract-xref-man-page): If Man-target-string is a function,
-       call it.
-       (Man-highlight-references): Use Man-default-man-entry to get the
-       target.  Deal with xrefs too.
-       (Man-highlight-references0): Don't call the target function.
-
-       * woman.el (WoMan-xref-man-page): Strip the section number, woman
-       cannot deal with it.
-
-2006-04-04  Daiki Ueno  <ueno@unixuser.org>
-
-       * pgg-gpg.el: Clean up process buffers every time gpg processes
-       complete.
-
-2006-04-04  Kenichi Handa  <handa@m17n.org>
-
-       * sort.el (sort-build-lists): Don't bind inhibit-field-text-motion
-       here.
-       (sort-lines, sort-numeric-fields, sort-fields, sort-columns):
-       Temporarily bind inhibit-field-text-motion to t.
-
-2006-04-03  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * startup.el (normal-splash-screen): Only set mode-line-format in the
-       splash buffer, so as not to interfere when debugging the code.
-       Ignore errors when switching buffer.
-
-2006-04-03  Romain Francoise  <romain@orebokech.com>
-
-       * dired.el (dired-dnd-protocol-alist): Fix typo.
-
-2006-04-03  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * savehist.el (savehist): Add :version.
-       (savehist-ignored-variables): New variable.
-       (savehist-minibuffer-hook): Don't save variables listed in
-       `savehist-ignored-variables'.
-
-       * dired.el (dired-dnd-protocol-alist): Mention that change does
-       only apply to new buffers in doc string.
-
-2006-04-03  Lennart Borgman  <lennart.borgman.073@student.lu.se>  (tiny change)
-
-       * recentf.el (recentf-open-files-item): Include newline in button
-       field, so opening a file will work, when the point is at the end
-       of the file name.  Allow, for example, to [i]search a file by
-       extension and just push RET to open it.
-
-2006-04-03  Daiki Ueno  <ueno@unixuser.org>
-
-       * pgg-gpg.el (pgg-gpg-process-filter)
-       (pgg-gpg-wait-for-completion): Check if buffer is alive.
-
-       * pgg-gpg.el (pgg-gpg-process-sentinel): Don't remove GNUPG:
-       lines, temporary fix.
-
-2006-04-02  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * ibuf-macs.el (define-ibuffer-column): Document the new parameter.
-
-2006-04-02  Richard Stallman  <rms@gnu.org>
-
-       * progmodes/compile.el (compilation-message-face): Make it defcustom.
-
-2006-04-02  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * ibuf-macs.el (define-ibuffer-column): Add a new key:
-       header-mouse-map.
-
-       * ibuffer.el (ibuffer-name-header-map, ibuffer-size-header-map)
-       (ibuffer-mode-header-map): New keymaps.
-       (ibuffer-update-title-and-summary): Enable mouse face highlighting
-       and keybindings for column headers.
-       (name, size, mode) <define-ibuffer-column>: Add a header-mouse-map
-       property.
-
-2006-04-02  Drew Adams  <drew.adams@oracle.com>
-
-       * speedbar.el (speedbar-after-create-hook): Doc fix.
-
-2006-04-02  Michael Ernst  <mernst@alum.mit.edu>
-
-       * shell.el (shell-directory-tracker)
-       (shell-dynamic-complete-command): Doc fixes.
-
-2006-04-01  Matt Hodges  <MPHodges@member.fsf.org>
-
-       * pcomplete.el (pcomplete-show-completions): Recognize TAB on text
-       terminals.
-
-2006-04-01  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-unc-hosts-cache): New defvar.
-       (ido-unc-hosts): If value of defcustom is a function, call it to
-       get list of UNC hosts.  Add function-item choices to specify
-       ido-unc-hosts-net-view or user function.
-       (ido-ignore-unc-host-regexps): New defcustom.
-       (ido-unc-hosts-net-view, ido-unc-hosts): New functions.
-       (ido-is-unc-root, ido-is-unc-host, ido-file-name-all-completions)
-       (ido-exhibit): Call ido-unc-hosts to get list of UNC hosts.
-
-2006-03-13  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * pcvs-util.el (cvs-insert-strings): Fix bug with strings longer than
-       wwidth.
-
-2006-03-31  Juanma Barranquero  <lekktu@gmail.com>
-
-       * ido.el (ido-cache-unc-host-shares-time, ido-report-no-match)
-       (ido-max-work-file-list, ido-switch-buffer)
-       (ido-read-file-name-as-directory-commands):
-       Fix typos in docstrings.
-
-2006-03-30  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el (mac-system-coding-system): Define and use after
-       Mac-specific coding systems are ready.
-
-2006-03-27  Romain Francoise  <romain@orebokech.com>
-
-       * net/rcirc.el (rcirc-connect): Add autoload cookie.
-
-       * ldefs-boot.el: Update.
-
-2006-03-27  Daiki Ueno  <ueno@unixuser.org>
-
-       * pgg-gpg.el: Invoke gpg asynchronous, to avoid querying for
-       passphrases when it is not needed.
-       (pgg-gpg-use-agent): Add, to hard code that pgg shouldn't wait for
-       passphrase stuff from gpg, should only be necessary when you use
-       gpg with a smartcard.
-
-2006-03-27  Nick Roberts  <nickrob@snap.net.nz>
-
-       * comint.el (comint-dynamic-list-completions): Allow user to
-       select *Completions* buffer.
-
-2006-03-27  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-get-level-face): Fix bug with level counting.
-
-2006-03-26  Andreas Schwab  <schwab@suse.de>
-
-       * progmodes/gud.el (gdb): Only complain about multiple debugging
-       when the gdb process is still running.
-
-2006-03-25  Eli Zaretskii  <eliz@gnu.org>
-
-       * mail/rmail.el (tool-bar-map): Defvar it.
-       (rmail-tool-bar-map): Tool-bar buttons for Rmail.
-       (rmail-perm-variables): Make rmail-tool-bar-map a local variable.
-
-2006-03-25  Sven Joachim  <svenjoac@gmx.de>  (tiny change)
-
-       * help.el (print-help-return-message): Suggest to use
-       display-buffer instead of switch-to-buffer-other-window to restore
-       the previous window without selecting it.
-
-2006-03-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * frame.el (select-frame-by-name): Call x-focus-frame also when
-       window-system is mac.
-
-       * term/mac-win.el: Adjust Courier font specifications in
-       x-fixed-font-alist.
-       (mac-select-convert-to-string): Use utf-16be-mac or utf-16le-mac
-       when directly encoding to UTF-16 in native byte order, no BOM.
-
-2006-03-25  Kim F. Storm  <storm@cua.dk>
-
-       * emulation/cua-base.el (cua-rectangle-mark-key): New defcustom.
-       (cua--init-keymaps): Use it instead of fixed C-return.
-       (cua-mode): Set after it.
-
-       * emulation/cua-rect.el (cua--init-rectangles):
-       Use cua-rectangle-mark-key instead of fixed C-return.
-
-2006-03-25  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdba): Revert 2006-03-10 change for case of
-       "run" in .gdbinit.
-       (gdb-var-create-regexp): Remove "^done" prefix for gdb-mi.el.
-
-2006-03-24  Romain Francoise  <romain@orebokech.com>
-
-       * files.el (ctl-x-5-map): Really bind C-x 5 C-o to
-       `display-buffer-other-frame'.
-
-2006-03-24  Kim F. Storm  <storm@cua.dk>
-
-       * apropos.el (apropos-synonyms): Add selection => region.
-
-2006-03-24  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-var-create-regexp)
-       (gdb-var-list-children-regexp, gdb-var-update-regexp)
-       (gdb-var-list-children-regexp-1, gdb-var-update-regexp-1)
-       (gdb-data-list-register-values-regexp)
-       (gdb-stack-list-locals-regexp, gdb-stack-list-locals-handler):
-       Future proof against new fields being added to MI output.
-       (gdb-send): Don't treat backslashes for program input as
-       continuations.
-       (gdb-assembler-handler): Don't use window-start for this handler.
-       (gdb-frame-handler): Don't change to hollow arrow if overlay
-       arrow doesn't move to new frame.
-
-2006-03-24  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-continuation): Declare earlier to
-       prevent compiler warnings.
-       (gdb-stopped): Check for gud-last-last-frame (case: signal).
-       (breakpoint-disabled): Make lighter for contrast with overlay arrow.
-       (gdb-assembler-custom): Use hollow-right-triangle for assembler
-       buffer too.
-
-2006-03-23  Reiner Steib  <reinersteib+gmane@imap.cc>
-
-       * pgg-gpg.el (pgg-gpg-update-agent): Check for
-       make-network-process, so we can use the same code in Gnus v5-10
-       too and have this file fully synchronized with that release.
-
-2006-03-23  Romain Francoise  <romain@orebokech.com>
-
-       * ibuf-ext.el (ibuffer-read-filter-group-name):
-       Use `ibuffer-generate-filter-groups' to make completion list match
-       the filter groups that are really displayed in the Ibuffer buffer.
-       (ibuffer-generate-filter-groups): Add new args noempty, nodefault.
-
-2006-03-23  Kenichi Handa  <handa@m17n.org>
-
-       * international/mule-cmds.el (sort-coding-systems): Describe that
-       the argument is modified in docstring.
-
-2006-03-22  Sascha Wilde  <wilde@sha-bang.de>
-
-       * pgg-gpg.el (pgg-gpg-use-agent): Disable by default.
-       (pgg-gpg-update-agent): New function.
-       (pgg-gpg-use-agent-p): New function.
-       (pgg-gpg-process-region, pgg-gpg-encrypt-region)
-       (pgg-gpg-encrypt-symmetric-region, pgg-gpg-decrypt-region)
-       (pgg-gpg-sign-region): Use it.
-
-2006-03-21  Chong Yidong  <cyd@stupidchicken.com>
-
-       * cus-edit.el (custom-face-set): Call custom-push-theme before
-       face-spec set so that `changed' theme is correctly saved.
-       (custom-face-reset-standard): Reset to recalculated face rather
-       than defface spec.
-
-       * custom.el (custom-push-theme): Only save `changed' theme if the
-       current face does not match the defface specs.
-
-2006-03-21  Simon Josefsson  <jas@extundo.com>
-
-       * pgg-gpg.el: Ideas below based on patch from Sascha Wilde
-       <wilde@sha-bang.de>.
-       (pgg-gpg-use-agent): New variable.
-       (pgg-gpg-process-region): Use it.
-       (pgg-gpg-encrypt-region): Likewise.
-       (pgg-gpg-encrypt-symmetric-region): Likewise.
-       (pgg-gpg-decrypt-region): Likewise.
-       (pgg-gpg-sign-region): Likewise.
-       (pgg-gpg-possibly-cache-passphrase): Don't cache a nil password.
-
-2006-03-21  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-open-at-point): Fix bug in wiki-style
-       bracket links.
-
-2006-03-21  Kim F. Storm  <storm@cua.dk>
-
-       * progmodes/gdb-ui.el (gdb-reset): Set buffer local value of
-       fringe-indicator-alist instead of modifying global value.
-       (gdb-frame-handler): Likewise.
-
-2006-03-21  Nick Roberts  <nickrob@snap.net.nz>
-
-       * diff-mode.el (diff-function): Make it inherit from diff-header
-       instead of diff-context.
-
-       * progmodes/gdb-ui.el (hollow-right-triangle): Define as fringe
-       bitmap.
-       (gdb-info-stack-custom): Rename from gdb-info-frames-custom and
-       change names in macro above for consistency.
-       (gdb-frame-handler): Use hollow-right-triangle for all selected
-       frames which except the innermost (where execution has stopped).
-       (gdb-reset): Reset buffer-local values of overlay-arrow.
-
-2006-03-20  Richard Stallman  <rms@gnu.org>
-
-       * simple.el (set-mark-command): Doc fix.
-
-       * files.el (display-buffer-other-frame): New command.
-       (ctl-x-4-map): Bind C-x 5 C-o to it.
-
-2006-03-20  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * jit-lock.el (jit-lock-function): Check for the actual defer-timer
-       rather than just defer-time, in case defer-time has been changed but
-       the timer isn't running yet.
-       (jit-lock-deferred-fontify): Correspondingly let-bind defer-timer.
-
-2006-03-19  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * help-mode.el (help-follow-symbol): New function.
-       Essentially identical to the old `help-follow', but do not let
-       `push-button' do the work when on an xref.
-       (help-mode-map): Bind `help-follow-symbol' to "C-c C-c".
-
-2006-03-19  Richard Stallman  <rms@gnu.org>
-
-       * help-mode.el (help-xref-symbol-regexp): Make no xref for symbol
-       preceded by the word `program'.
-       (help-follow-mouse, help-follow): Throw error if not on xref.
-       Delete no longer used args.
-
-2006-03-20  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-stopped): Even when there is no source
-       annotation ensure gud-overlay-arrow-position is redisplayed.
-
-2006-03-19  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
-
-       * textmodes/bibtex.el (bibtex-include-OPTkey)
-       (bibtex-entry-field-alist, bibtex-generate-url-list): Mark as risky.
-       (bibtex-autokey-name-case-convert)
-       (bibtex-autokey-titleword-case-convert): Make these the aliases
-       for the following two variables.
-       (bibtex-autokey-name-case-convert-function)
-       (bibtex-autokey-titleword-case-convert-function): Make these the
-       real names.
-       (bibtex-font-lock-keywords): Make bibtex-font-lock-url and
-       bibtex-font-lock-crossref sublists.
-       (bibtex-mode): Revert 2005-12-30 change (which made
-       completion-ignore-case buffer-local).
-       (bibtex-url): Simplify.
-
-2006-03-19  Kim F. Storm  <storm@cua.dk>
-
-       * emulation/cua-rect.el (cua--highlight-rectangle): Set overlay
-       cursor property value to 2 (to align with C level change).
-
-2006-03-19  Bill Wohler  <wohler@newt.com>
-
-       * image.el (image-load-path-for-library): Shorten first line in
-       docstring.
-
-2006-03-18  Richard Stallman  <rms@gnu.org>
-
-       * mail/rmail.el (rmail-reply-regexp): Undo previous change.
-
-2006-03-18  Ben North  <ben@redfrontdoor.org>  (tiny change)
-
-       * isearch.el (isearch-other-meta-char): Handle user bindings for
-       shifted control characters.
-
-2006-03-18  Agustin Martin  <agustin.martin@hispalinux.es>
-
-       * textmodes/ispell.el (ispell-skip-region-alist): Add "_+" to the
-       part that matches email addresses, file names, etc.
-
-2006-03-18  Eli Zaretskii  <eliz@gnu.org>
-
-       * term/w32-win.el (mouse-set-font):
-       Mention w32-list-proportional-fonts in the doc string.
-
-2006-03-18  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-cache-ftp-work-directory-time): Doc fix.
-       (ido-unc-hosts): New user option to explicitly define list of know
-       UNC-style hosts for completion.
-       (ido-cache-unc-host-shares-time): New user option.
-       (ido-is-unc-root, ido-is-unc-host, ido-cache-unc-valid):
-       New helper functions for UNC file-name support.
-       (ido-may-cache-directory): Check for UNC host.  Simplify.
-       (ido-wash-history): Clean out old UNC hosts.
-       (ido-nonreadable-directory-p): UNC hosts are always readable.
-       (ido-directory-too-big-p): UNC hosts are never too big.
-       (ido-set-current-directory): Handle UNC root path.
-       (ido-file-name-all-completions): Complete UNC host names from
-       ido-unc-hosts list.  Cache UNC host shares.
-       (ido-make-file-list-1): Don't filter UNC root.
-       (ido-exhibit): Check for // in root directory, and switch to UNC
-       mode by setting ido-current-directory to //.
-
-2006-03-17  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * cus-edit.el (customize-changed-options): Mention explicit
-       version number as default in prompt.
-
-2006-03-17  Bill Wohler  <wohler@newt.com>
-
-       * image.el (image-load-path-for-library): Minor docstring fix.
-
-2006-03-17  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-read-date): Include subgroup 5 into
-       replacement text.
-       (org-popup-calendar-for-date-prompt): Fix customization type.
-
-2006-03-17  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gud-watch): Provide completion.
-       (gdb-continuation): New variable.
-       (gdb-send): Deal with continuation lines.
-
-       * progmodes/gud.el (gud-gdb-complete-command)
-       (gud-gdb-run-command-fetch-lines): Adapt for use with watch
-       expressions.
-       (gud-tooltip-mode): Use buffer-local value.
-
-2006-03-16  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-edit-input): Use selected match, if any.
-
-2006-03-16  Bill Wohler  <wohler@newt.com>
-
-       * image.el (image-load-path-for-library): Prefer user's images in
-       image-load-path.
-
-2006-03-16  Martin Rudalics  <rudalics@gmx.at>
-
-       * mouse.el (mouse-drag-vertical-line): Use window-inside-edges
-       when checking for attempt to drag leftmost or rightmost scrollbar.
-
-2006-03-16  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-inferior-status): New variable.
-       (gdb-force-mode-line-update): New function.
-       (gdb-resync, gdb-starting, gdb-signal, gdb-exited, gdb-stopped)
-       (gdb-exited): Use them.
-       (gdb-signal): New function.
-       (gdb-annotation-rules): Provide a rule for it.
-
-2006-03-16  Kenichi Handa  <handa@m17n.org>
-
-       * international/mule.el (auto-coding-regexp-alist): Add entries
-       for Unicode BOM.
-
-       * sort.el (sort-build-lists): Temporarily bind
-       inhibit-field-text-motion to t.
-
-2006-03-15  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * locate.el (locate-command, locate-make-command-line)
-       (locate-fcodes-file, locate-update-command)
-       (locate-prompt-for-command, locate, locate-with-filter)
-       (locate-get-file-positions): Doc fixes.
-       (locate-buffer-name, locate-header-face): Remove leading `*' in
-       defcustom.
-       (locate-filter-output): Use `keep-lines' instead of its alias
-       `delete-non-matching-lines'.
-       (locate-get-filename, locate-get-dirname): Add introductory comment.
-       (locate-find-directory-other-window): Give appropriate error
-       message if used outside main listing.
-
-2006-03-15  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * font-lock.el (font-lock-lines-before): Delete variable, subsumed by
-       the new extend-region feature.
-       (font-lock-after-change-function): Update correspondingly.
-       * jit-lock.el (jit-lock-after-change): Update correspondingly.
-       * progmodes/grep.el (font-lock-lines-before): Don't disable.
-
-2006-03-15  Bill Wohler  <wohler@newt.com>
-
-       * image.el (image-load-path-for-library): Fix example by not
-       recommending that one binds image-load-path.  Just defvar it to
-       placate compiler and only use it if previously defined.
-
-2006-03-15  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-insert-centered): Use `string-width' to
-       make underlining work for wide characters.
-       (org-goto-map, org-agenda-mode-map, org-mode-map): Explicitly bind
-       TAB to `org-cycle', to make sure that no binding in
-       `outline-mode-map' can supercede it.
-
-2006-03-14  Ken Manheimer  <ken.manheimer@gmail.com>
-
-       * allout.el: Increment version to 2.2.1 in file commentary.
-
-       (allout-version): Increment to 2.2.1.
-
-       (allout-default-layout): New customization variable, used when the
-       file lacks a specific allout-layout.  Uses allout-layout-type for
-       recursively nested definition.
-
-       (allout-layout-type): Widget defining allout layouts, necessary for
-       self-recursive definition.
-
-       (allout-mode): Incorporate allout-default-layout as fallback for
-       allout-layout.
-
-       (allout-layout): Mark as 'safe-local-variable', and refer mention
-       fallback to `allout-default-layout' in absence of a specified value.
-       (allout-passphrase-verifier-string)
-       (allout-passphrase-hint-string): Mark as 'safe-local-variable'.
-
-       (allout-file-passphrase-verifier-string): Obsolete variable, removed.
-
-       (allout-get-encryption-passphrase-verifier): Use correct name of
-       passphrase verifier in docstring.
-
-2006-03-15  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-var-list): Change order of first two
-       elements.
-       (gdb-find-watch-expression): Make it work for arrays too.
-       Follow change to gdb-var-list.
-       (gud-watch): Allow the user to enter variable name with a prexix
-       arg.  Create keybindings.
-       (gdb-var-create-handler, gdb-var-evaluate-expression-handler)
-       (gdb-var-list-children-handler, gdb-var-update-handler)
-       (gdb-var-delete, gdb-edit-value, gdb-speedbar-expand-node)
-       (gdb-var-list-children-handler-1, gdb-var-update-handler-1):
-       Follow change to gdb-var-list.
-       (gdb-starting): Don't show the overlay arrows when program is running.
-
-       * progmodes/gud.el (gud-speedbar-buttons): Follow change to
-       gdb-var-list.
-
-2006-03-14  Bill Wohler  <wohler@newt.com>
-
-       * image.el (image-load-path-for-library): Pass value of path
-       rather than symbol.  Always return list of directories.
-       Guarantee that image directory comes first.
-
-2006-03-14  Alan Mackenzie  <acm@muc.de>
-
-       * font-core.el (font-lock-extend-region\(-function\)?.):
-       New function/variable.
-
-       * font-lock.el (font-lock-after-change-function):
-       Call font-lock-extend-region.  Obey font-lock-lines-before.
-       (font-lock-default-fontify-region): Remove reference to
-       font-lock-lines-before.
-
-       * jit-lock.el (jit-lock-after-change):
-       Call font-lock-extend-region.  Obey font-lock-lines-before.
-
-2006-03-14  David Ponce  <david@dponce.com>
-
-       * tree-widget.el (tree-widget-themes-load-path)
-       (tree-widget-themes-directory, tree-widget-theme): Doc fix.
-
-2006-03-13  Ryan Yeske  <rcyeske@gmail.com>
-
-       * net/rcirc.el (rcirc) <defgroup>: Add link to manual.
-       (rcirc-print): Mark the start of text at the end of the prompt.
-       (rcirc-track-minor-mode): Add autoload cookie.
-       (rcirc-update-activity-string): Add space to front of mode-line
-       indicator.
-
-2006-03-13  Miles Bader  <miles@gnu.org>
-
-       * net/rcirc.el (rcirc-nick-abbrevs): Remove variable.
-       (rcirc-abbrev-nick): Remove function.
-       (rcirc-format-response-string): Don't call `rcirc-abbrev-nick'.
-
-2006-03-13  David Ponce  <david@dponce.com>
-
-       * tree-widget.el: Handle themes across all occurrences of the main
-       themes sub-directory found in tree-widget-themes-load-path.
-       (tree-widget-themes-directory, tree-widget-theme): Doc fix.
-       (tree-widget--locate-sub-directory): Return all occurrences.
-       (tree-widget-themes-path): New function.
-       Replace tree-widget-themes-directory, and return a list of directories.
-       (tree-widget-set-parent-theme)
-       (tree-widget-lookup-image): Use it.
-
-2006-03-13  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-link-search): Avoid self-matching of
-       links, allow target text to be distributed over several lines.
-       (org-search-not-link): New function.
-       (org-set-regexps-and-options, org-get-current-options):
-       New startup options.
-       (org-export-as-html): Take odd-level setting from local variable.
-       (org-fontify-emphasized-text): New option.
-       (org-set-font-lock-defaults): Include emphasized text.
-       (org-follow-mhe-link): Allow folder-only links, fix folder name.
-       (org-font-lock): Customize group renamed from `org-faces'.
-
-2006-03-13  John Paul Wallington  <jpw@pobox.com>
-
-       * ibuf-ext.el (ibuffer-never-show-predicates): Add `require'
-       keyword; require `ibuf-ext' feature.  Thanks to Zhang Wei.
-
-2006-03-12  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * cus-start.el (all): Delete :version keyword for members of the
-       fringe group, since the entire group is new in 22.1.
-
-2006-03-13  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-stack-list-locals-handler): Add local
-       map if value is hexadecimal (an address).
-       (gud-watch): Only search roots for existing watch expressions.
-       (gdb-speedbar-refresh): Bind speedbar-shown-directories to nil to
-       prevent caching problems with speedbar-update-directory-contents.
-
-2006-03-12  Juri Linkov  <juri@jurta.org>
-
-       * battery.el (battery-linux-proc-acpi): Check `capacity' for non-nil
-       before comparing with `low' and `warn'.
-
-       * info.el (Info-dir-remove-duplicates): Move point to the
-       beginning of the current line after deleting the entries from
-       redundant heading.  Use marker for `limit' and compare it with
-       point before calling `re-search-forward'.
-
-2006-03-11  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * simple.el (yank): Fix typo in docstring.
-
-2006-03-11  Ryan Yeske  <rcyeske@gmail.com>
-
-       * mail/rmailsum.el (rmail-summary-next-msg): Skip deleted
-       messages, where "D" is the 6th character.
-
-2006-03-11  Eli Zaretskii  <eliz@gnu.org>
-
-       * simple.el (yank): Fix last change.
-
-2006-03-11  David Ponce  <david@dponce.com>
-
-       * ispell.el (ispell-find-aspell-dictionaries): Add aliases before
-       merging elements from the standard ispell-dictionary-alist.
-       (ispell-aspell-add-aliases): Add aliases to the passed dictionary
-       alist, and return the new alist.
-
-2006-03-11  Richard Stallman  <rms@gnu.org>
-
-       * mail/rmail.el (rmail-ignored-headers): Discard DomainKey-Signature.
-
-       * eshell/eshell.el (eshell-prefer-to-shell): Variable deleted;
-       the way it is implemented is too unclean.
-
-       * simple.el (kill-region, yank): Doc fix.
-
-       * battery.el (battery-echo-area-format): Doc fix.
-       (battery-mode-line-format): Likewise.
-       (battery-linux-proc-apm, battery-linux-proc-acpi): Likewise.
-       (battery-linux-proc-acpi): Ignore batteries that say "charged".
-
-2006-03-11  Kurt Hornik  <Kurt.Hornik@wu-wien.ac.at>
-
-       * progmodes/octave-mod.el (octave-indent-for-comment):
-       Behave according to do string.
-
-2006-03-11  Agustin Martin  <agustin.martin@hispalinux.es>
-
-       * textmodes/ispell.el (ispell-menu-map-needed) [ispell-message]:
-       Be visible only if major mode is Mail Mode.
-
-       * textmodes/flyspell.el (flyspell-external-point-words)
-       (flyspell-process-localwords): Fix last changes.
-
-2006-03-11  Eli Zaretskii  <eliz@gnu.org>
-
-       * calendar/holidays.el (list-holidays): Doc fix.
-
-       * international/mule.el (auto-coding-alist): Add .odt
-       (OpenOffice's open document) files.
-
-       * files.el (auto-mode-alist): Add .odt (OpenOffice's open
-       document) files.  Mention in the doc string the need to sync with
-       auto-coding-alist.
-
-2006-03-10  Chong Yidong  <cyd@stupidchicken.com>
-
-       * files.el (hack-local-variables-confirm): Don't prompt for ! if
-       enable-local-variables is set to always query, or there is no
-       savable variable.
-
-2006-03-10  Bill Wohler  <wohler@newt.com>
-
-       * image.el (image-load-path-for-library): Merge at least three
-       functions from Gnus and MH-E into this one function that can now
-       be shared.
-
-2006-03-11  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-remove-text-properties): Rename from
-       gdb-remove-mouse-face and remove help-echo too.
-       (gdb-enqueue-input): Correct conditional clause.
-
-2006-03-10  Glenn Morris  <rgm@gnu.org>
-
-       * calendar/calendar.el (calendar-holidays): Doc fix.
-       * calendar/holidays.el (list-holidays): Doc fix.
-
-2006-03-10  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdba): Don't call gdb-init-1 explicitly as
-       it gets called in gdb-prompt anyway.
-       (gdb-use-separate-io-buffer): Only restore window arrangement for
-       gdb-many-windows.
-       (gdb-enqueue-input): Make it harder to send GDB input when program
-       is running.
-       (gdb-buffer-list): New variable.
-       (gdb-remove-mouse-face): New function.
-       (gdb-starting): Use it when GDB input won't get sent.
-
-2006-03-08  Juanma Barranquero  <lekktu@gmail.com>
-
-       * help.el (view-lossage): Remove trailing whitespace before
-       inserting "\n".
-
-2006-03-07  Chong Yidong  <cyd@stupidchicken.com>
-
-       * files.el (hack-local-variables-confirm):
-       Set coding-system-for-read to nil before writing to .emacs.
-
-       * arc-mode.el (archive-extract): Check if an existing buffer name
-       comes from a different archive.
-
-       * help.el (describe-key-briefly): If KEY is a down event, read and
-       discard the up event.
-
-2006-03-07  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-speedbar-buttons): Allow pointers to
-       be edited and use font-lock-warning-face for any changes.
-
-       * progmodes/gdb-ui.el (gdb-edit-value-handler): New function.
-       (gdb-edit-value): Use it to report any errors.
-
-2006-03-07  Juanma Barranquero  <lekktu@gmail.com>
-
-       * help.el (describe-key): Remove leftover test code.
-
-2006-03-07  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el: Move defvars out of eval-when-compile.
-       Use buffer-file-name variable.
-       (org-agenda-file-to-end, org-agenda-file-to-front): Remove unused
-       arg `file'.
-       (org-level-faces): Remove startup dependency.
-       (org-cycle, org-map-tree, org-scan-tags)
-       (org-remember-handler): Don't call `outline-level' directly.
-       (org-mhe-search-all-folders): New option.
-       (org-mhe-get-message-folder-from-index)
-       (org-mhe-get-message-folder): Fix indexing search.
-       (org-format-agenda-item): Handle nil TAGS argument.
-       (org-cleaned-string-for-export, org-activate-target-links)
-       (org-make-target-link-regexp): Deal with empty radio target list.
-       (org-tag): New face.
-       (org-get-level-face): New function.
-       (org-set-font-lock-defaults): Simplify setup for headlines.
-       (org-complete): Pass common substring to `display-completion-list'.
-
-2006-03-06  David Ponce  <david@dponce.com>
-
-       * tree-widget.el: Update Commentary header.
-       (tree-widget-theme-name): Ignore parent themes.
-       (tree-widget-set-parent-theme): New function.
-       (tree-widget-set-theme): Use it.
-       (tree-widget-set-image-properties): Move definition.  Does nothing
-       if image properties have already been set.
-       (tree-widget-image-properties): Move definition.  Receive an image
-       name.  Set the :pointer property.
-       (tree-widget-lookup-image): Doc fix.  Search in parent themes.
-       Don't set the :pointer image property.
-       (tree-widget-convert-widget): New function.  Handle :dynargs
-       compatibility here.
-       (tree-widget): Use it to :convert-widget.  Add the :expander-p
-       predicate to control when the :expander function is entered.
-       Thanks to Ken Manheimer <ken.manheimer@gmail.com> for the idea.
-       (tree-widget-value-create): Handle :expander-p.  widget-apply
-       :expander.
-       (tree-widget-expander-p): New function.  Default value of the
-       :expander-p property.
-
-2006-03-06  Chong Yidong  <cyd@stupidchicken.com>
-
-       * help.el (describe-key): Properly handle the return value of
-       read-key-sequence when grabbing an up-event.  Cleanup mouse-1
-       remaps.  Handle string and vector `follow-link' values.
-
-2006-03-06  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * complete.el (PC-expand-many-files): Try be more careful when parsing
-       the shell's output.
-
-2006-03-05  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * outline.el (hide-sublevels): Provide better interactive default.
-
-2006-03-06  Kenichi Handa  <handa@m17n.org>
-
-       * international/fontset.el (create-fontset-from-fontset-spec):
-       Fix regexp for paring FONTSET-SPEC (allow spaces after `:').
-
-2006-03-05  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * progmodes/gud.el (gud-jdb-marker-filter): Quote `[' with two
-       backslashes instead of one in regexp.
-       (gud-tooltip-dereference): Add missing optional argument.
-
-2006-03-04  John Paul Wallington  <jpw@pobox.com>
-
-       * wdired.el (toplevel): Require `cl' at compile-time.
-
-2006-03-04  Andreas Schwab  <schwab@suse.de>
-
-       * server.el (server-process-filter): Handle errors during
-       evaluation of the argument.
-
-2006-03-03  John Paul Wallington  <jpw@pobox.com>
-
-       * t-mouse.el (t-mouse-drag-start, t-mouse-swap-alt-keys): Doc fix;
-       escape parentheses at beginning of line.
-       (t-mouse-tty, t-mouse-make-event): Doc fix; use imperative.
-       (t-mouse-mode): Remove period from end of error message.
-
-2006-03-03  Agustin Martin  <agustin.martin@hispalinux.es>
-
-       * textmodes/flyspell.el (flyspell-process-localwords):
-       Be case-sensitive.
-
-2006-03-03  Martin Rudalics  <rudalics@gmx.at>
-
-       * cus-edit.el (custom-quote): Remove function, since it has been
-       moved to custom.el.
-
-       * font-lock.el (lisp-font-lock-keywords-2)
-       * emacs-lisp/rx.el (rx-check-any, rx-check-not)
-       * generic-x.el (reg-generic-mode): Quote "]"s in regexps when
-       they have no special meaning.
-
-       * midnight.el (clean-buffer-list): Handle case where base-buffer of
-       indirect buffer gets killed before indirect buffer.  Use dolist.
-
-2006-03-03  Ken Manheimer  <ken.manheimer@gmail.com>
-
-       * emacs-lisp/edebug.el (edebug-display): Use `edebug-sit-for-seconds'
-       value instead of a literal constant (1) on more pauses.
-
-2006-03-03  Slawomir Nowaczyk  <slawomir.nowaczyk.847@student.lu.se>  (tiny change)
-
-       * textmodes/flyspell.el (flyspell-external-point-words):
-       Be case-sensitive.
-
-2006-03-03  Ryan Yeske  <rcyeske@gmail.com>
-
-       * net/rcirc.el (rcirc-url-regexp): Match entire url when it starts
-       with "www".
-
-2006-03-03  Ken Manheimer  <ken.manheimer@gmail.com>
-
-       * allout.el: Restablish intermediate missing comment header to
-       preserve outline structure.
-       (allout-beginning-of-current-entry): Skip invisible text.
-       (allout-open-topic): Fix opening a topic at end-of-buffer.
-       (allout-minor-mode): Move nearer to allout-mode function.
-
-2006-03-02  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-paste-subtree): Remove (debug) form.
-
-2006-03-02  Nick Roberts  <nickrob@snap.net.nz>
-
-       * dframe.el (dframe-frame-mode): Don't burp when menu-bar-lines
-       is nil.
-
-       * progmodes/gud.el (gud-speedbar-menu-items):
-       Use buffer-local-value and add missing :visible keyword.
-
-       * progmodes/gdb-ui.el (gdb-speedbar-refresh): Quieten speedbar-refresh.
-
-2006-03-01  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/reftex-index.el (reftex-index-map): `follow-mouse'
-       must be `follow-link'.
-
-       * textmodes/reftex-toc.el (reftex-toc-map): Likewise.
-
-       * textmodes/org.el (org-export-as-html): Fix bugs in HTML
-       formatting: No nested anchors.
-       (org-all-targets): Fix bug with XEmacs compatibility.
-       (org-read-date): Add (require 'parse-time).
-       (org-set-tags): Fix bug with extra inserted space.
-       (org-export-html-style): Define a style class for targets.
-       (org-agenda-keymap, org-mouse-map): Add a binding for `follow-link'.
-       (org-hide-leading-stars): New option.
-       (org-hide): New face.
-       (org-set-font-lock-defaults): Allow to hide leading stars.
-       (org-get-legal-level, org-tr-level): New functions.
-       (org-odd-levels-only): New option.
-       (org-level-faces, org-paste-subtree, org-convert-to-odd-levels)
-       (org-demote, org-promote): Deal with double-star levels.
-       (org-convert-to-odd-levels): New command.
-
-2006-03-01  Nick Roberts  <nickrob@snap.net.nz>
-
-       * speedbar.el (speedbar-update-localized-contents): Try to
-       preserve window-start.
-       (speedbar-update-directory-contents): Try to preserve window-start
-       and window-point.
-       (speedbar-update-special-contents): Don't move back to start of window.
-
-       * progmodes/gdb-ui.el (gdb-speedbar-refresh): Rename from
-       gdb-speedbar-timer-fn.  Use speedbar-refresh instead of
-       speedbar-timer-fn.
-       (gdb-var-update-handler, gdb-var-update-handler-1): Use it.
-       (gdb-speedbar-expand-node): Use speedbar-delete-subblock
-       instead of gdb-speedbar-timer-fn.
-
-2006-02-28  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calccomp.el (math-compose-tex-matrix): Add a latex option.
-       (math-compose-expr): Use latex option when calling
-       `math-compose-tex-matrix' for latex mode.
-
-2006-02-28  Nick Roberts  <nickrob@snap.net.nz>
-
-       * speedbar.el: Re-instate comments about developing for speedbar
-       [this is what info and gdb-ui use even if better methods exist now].
-
-       * t-mouse.el: New file.
-       (t-mouse-tty): Use with-temp-buffer.  Add more terminal types.
-       (t-mouse-lispy-buffer-posn-from-coords): Remove.
-       (t-mouse-make-event-element): Use posn-at-x-y instead.
-       (t-mouse-make-event): Deal with Fedora Core 3.
-       (t-mouse-make-event): Don't sink the `stupid text mode menubar'.
-       (t-mouse-mouse-position-function): New function.  Use it instead
-       of advising mouse-position.
-       (t-mouse-mode): New minor mode.
-       (t-mouse-stop, t-mouse-run): Remove.  Use t-mouse-mode instead.
-
-2006-02-27  Glenn Morris  <rgm@gnu.org>
-
-       * calendar/calendar.el (calendar-holidays): Doc fix.
-
-2006-02-27  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-source-window): New variable.
-       Re-introduce the concept of a source window.
-       (gdb-get-buffer-create): Rename from gdb-get-create-buffer for
-       consistency with get-buffer-create.
-       (def-gdb-auto-update-handler, gdb-info-locals-handler)
-       (gdb-data-list-register-values-handler)
-       (gdb-stack-list-locals-handler): Try to preserve window-start as
-       well as window-point.
-       (gdb-display-source-buffer): New function (old concept).
-       (gdb-goto-breakpoint): Use it.
-
-       * progmodes/gud.el (gud-display-line): Use gdb-display-source-buffer
-       for gdb-ui/gdb-mi (old concept).
-
-2006-02-27  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/reftex-index.el (reftex-index-map): Add `follow-mouse'
-       binding.
-
-       * textmodes/reftex-toc.el (reftex-toc-map): Add `follow-mouse' binding.
-
-       * textmodes/reftex-sel.el (reftex-select-label-map)
-       (reftex-select-bib-map): Add `follow-mouse' binding.
-
-2006-02-26  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * jka-cmpr-hook.el (jka-compr-compression-info-list)
-       (jka-compr-mode-alist-additions, jka-compr-load-suffixes):
-       Give :set functions to provide automatic updating.
-       Update docstring.  Give compiler defvars early in the file
-       and move the defcustoms to a later spot where all called functions
-       are defined.
-       (jka-compr-file-name-handler-entry): Doc fix.
-       (jka-compr-compression-info-list--internal)
-       (jka-compr-mode-alist-additions--internal)
-       (jka-compr-load-suffixes--internal): New variables.
-       (jka-compr-install): Set the three above variables.
-       Update `load-file-rep-suffixes' instead of `load-suffixes'.
-       (jka-compr-update, jka-compr-set): New functions.
-       (auto-compression-mode): Doc fix.
-
-       * jka-compr.el (jka-compr-uninstall): Replace `mapcar' with `mapc'.
-       Update `load-file-rep-suffixes' instead of `load-suffixes'.
-       Use jka-compr-compression-info-list--internal,
-       jka-compr-mode-alist-additions--internal and
-       jka-compr-load-suffixes--internal.
-
-       * files.el (load-library):
-       * loadhist.el (file-loadhist-lookup):
-       * startup.el (command-line):
-       * subr.el (locate-library):
-       * emacs-lisp/autoload.el (update-directory-autoloads):
-       * emacs-lisp/find-func.el (find-library-suffixes):
-       Use `get-load-suffixes' instead of `load-suffixes'.
-
-       * subr.el (locate-library):
-       * emacs-lisp/find-func.el (find-library-name):
-       Use `load-file-rep-suffixes' instead of '("").
-
-2006-02-26  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-save-history, ido-load-history): Simplify.
-       Don't use find-file-noselect to avoid interference from other modes.
-
-2006-02-25  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * progmodes/sh-script.el (sh-mode): Fix bug: Arrange
-       to use the default shell if filename is not available.
-       Reported by Giorgos Keramidas.
-
-2006-02-25  John Williams  <jrw@pobox.com>  (tiny change)
-
-       * progmodes/etags.el (tags-completion-table): Do completion from
-       all the tables in the current list, as documented in the manual.
-
-2006-02-24  Alan Mackenzie  <bug-cc-mode@gnu.org>
-
-       * CC Mode Update to 5.31.3.
-
-2006-02-24  Alan Mackenzie  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-mode.el (c-postprocess-file-styles):
-       Bind inhibit-read-only to t, around the call to
-       c-remove-any-local-eval-or-mode-variables, so that it works on a
-       RO file.
-
-2006-02-24  Alan Mackenzie  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-awk.el: Correct a typo.
-
-2006-02-24  Alan Mackenzie  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-cmds.el, cc-mode.el: Rename c-hungry-backspace to
-       c-hungry-delete-backwards, at the request of RMS.  Leave the old
-       name as an alias.
-
-2006-02-24  Alan Mackenzie  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-mode.el: Correct a typo.
-
-2006-02-24  Alan Mackenzie  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-defs.el: Update the version number to 5.31.3.
-
-2006-02-24  Alan Mackenzie  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-cmds.el (c-electric-brace): Fix clean-up
-       brace-else-brace (error due to mbeg, mend being undefined).
-
-2006-02-24  Alan Mackenzie  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-mode.el: File Local variables: Solve the problem
-       where both `mode' and c-file-offsets are specified: `mode' will
-       overwrite c-f-o's settings:
-       (c-remove-any-local-eval-or-mode-variables): New function.
-       (c-postprocess-file-styles): Call the above new function, within
-       c-tentative-buffer-change, to splat `mode' and `eval' before the
-       second hack-local-variables.
-
-2006-02-24  Alan Mackenzie  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-mode.el:
-       [Supersedes patch to cc-engine.el 2005-12-16T20:07:49Z!monnier@iro.umontreal.ca]
-       (c-after-change): Protect the match data with save-match-data.
-       It was getting corrupted by c-after-change-check-<>-operators.
-
-       * cc-defs.el: [Supersedes patch V1.38]:
-       (top level): Check for a buggy font-lock-compile-keywords ONLY in
-       XEmacs.  GNU Emacs 22 now has a check which would throw an error here.
-
-       * progmodes/cc-awk.el (c-awk-after-change): Protect the match data
-       with save-match-data.  It was being corrupted when Font Lock was
-       not enabled.
-
-2006-02-24  Alan Mackenzie  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-langs.el (c-mode-menu): Add menu items for Electric
-       Mode and Subword Mode.
-
-       * progmodes/cc-engine.el (c-beginning-of-statment-1): Distinguish
-       real labels ("case 1:" or "foo:") from non-labels ("public:").
-       (c-forward-objc-directive): Replace c-forward-token-2 with crude
-       coding; c-f-t-2 doesn't move over a token at EOB.
-
-       * progmodes/cc-defs.el (c-version): Update version number to 5.31.2.
-
-       * progmodes/cc-cmds.el, cc-mode.el, cc-engine.el
-       (c-update-modeline): Concatenate the minor mode indicators
-       directly onto mode-name, removing c-submode-indicators.
-       Sometimes, c-s-i got separated from the mode name on the mode line.
-
-       * progmodes/cc-cmds.el (c-electric-brace, c-electric-semi&comma)
-       (c-electric-colon): Correct doc-strings: "/ln" -> "/la".
-
-2006-02-24  Martin Stjernholm  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-langs.el (c-make-init-lang-vars-fun): Improve the
-       error message when there's an evaluation error to show whether
-       it's loaded from source or not.
-       (c-filter-ops): Make it available at runtime too to work when
-       `c-make-init-lang-vars-fun' needs to evaluate from source.
-
-2006-02-24  Juanma Barranquero  <lekktu@gmail.com>
-
-       * help.el (help): Revert last part of 2006-02-23 change (deletion
-       of the `provide' call).
-
-2006-02-23  Juri Linkov  <juri@jurta.org>
-
-       * compare-w.el (compare-windows-highlight): Add new value
-       `persistent' and change :type from `boolean' to `choice'.
-       (compare-windows-overlays1, compare-windows-overlays2):
-       New internal variables.
-       (compare-windows-highlight): If compare-windows-highlight is
-       `persistent', add current overlays to compare-windows-overlays[12]
-       instead of adding compare-windows-dehighlight to pre-command-hook.
-       (compare-windows-dehighlight): Delete all overlays from
-       compare-windows-overlays[12].
-
-       * info.el (Info-search): Don't bind search-spaces-regexp to
-       Info-search-whitespace-regexp in non-regexp isearch mode.
-
-2006-02-23  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * help.el (describe-mode): Pass `mode-name' to format-mode-line.
-
-2006-02-23  Juanma Barranquero  <lekktu@gmail.com>
-
-       * textmodes/org.el (org-xemacs-p)
-       (org-export-html-show-new-buffer, org-table-may-need-update)
-       (org-insert-item, org-mhe-get-message-real-folder)
-       (org-mhe-get-message-folder-from-index)
-       (org-mhe-get-message-folder, org-mhe-get-message-num)
-       (org-mhe-get-header, org-make-org-heading-search-string)
-       (org-make-org-heading-camel, org-table-sort-lines)
-       (org-format-org-table-html, org-format-table-table-html):
-       Fix typos in docstrings.
-
-2006-02-23  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-cleaned-string-for-export)
-       (org-solidify-link-text): New function.
-       (org-add-hook): Use `add-local-hook' instead of `make-local-hook' for
-       XEmacs, just to silence the compiler.
-       (org-export-as-ascii, org-export-as-html-and-open):
-       Use `org-cleaned-string-for-export' and create internal links.
-       (org-follow-mhe-link): Require mh-e, use folder.
-
-2006-02-23  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-speedbar-buttons): Use shadow face properly.
-
-       * progmodes/gdb-ui.el (gdb-debug-ring-max): Rename from
-       gdb-debug-log-length.
-       (gdb-debug-ring): Rename from gdb-debug-log-ring.  Don't make
-       it a real ring but...
-       (gud-gdba-marker-filter): ...make it work like mark-ring.
-       (gdb-enable-debug): Rename from gdb-enable-debug-log.
-       (gdb-mouse-jump): New function.  Add bindings.
-
-2006-02-23  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-signalled): New variable and function.
-       (gdb-debug-log-ring): Rename from gdb-debug-log and make a ring.
-       (gdb-send, gdb-send-item, gud-gdba-marker-filter): Use it.
-       (gdb-debug-log-length): Customize it's length.
-       (gud-watch, gdb-var-create-handler): Display function::var format
-       but don't use to create variable object.
-       (gdb-var-create-handler): Use message-box in place of message.
-       (gdb-stopped): Call gdb-exited if signalled.
-
-2006-02-22  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/reftex.el (reftex-locate-file): Remove duplicate function.
-
-       * textmodes/reftex-vars.el (reftex-try-all-extensions): New option.
-
-       * textmodes/reftex.el (reftex-locate-file): Search all extensions
-       if `reftex-try-all-extensions' is set.
-
-       * textmodes/reftex-dcr.el (reftex-view-crossref): New argument to
-       fail silently when there is no valid argument at point.
-       (reftex-view-crossref-when-idle): Call `reftex-view-crossref' with
-       `fail-silently' argument.  From a patch by David Reiter.
-
-       * textmodes/org.el (org-mark-ring-push, org-mark-ring-goto):
-       New commands.
-       (org-mark-ring): New variable.
-       (org-mark-ring-length): New option.
-       (org-open-at-point, org-goto, org-open-file): Push old position
-       onto the mark ring.
-       (org-add-hook): New function.
-       (org-export-table-remove-special-lines): New option.
-       (org-skip-comments, org-format-org-table-html): Respect new
-       option `org-export-table-remove-special-lines'.
-       (org-open-file): Allow special command configuration for
-       directory link.
-       (org-file-apps): Fix bugs in customize type, added setting
-       for directories.
-       (org-activate-tags, org-format-agenda-item, org-complete)
-       (org-get-tags-at, org-scan-tags, org-make-tags-matcher)
-       (org-get-tags, org-get-buffer-tags, org-open-at-point)
-       (org-link-search, org-make-org-heading-search-string)
-       (org-make-org-heading-camel): Allow @ and 0-9 as tags characters.
-       (org-radio-targets, org-file-link-context-use-camel-case)
-       (org-activate-camels): New options.
-       (org-update-radio-target-regexp, org-all-targets)
-       (org-make-target-link-regexp, org-activate-target-links):
-       New functions.
-       (org-make-org-heading-search-string): New function.
-       (org-store-link, org-insert-link): Use new option
-       `org-file-link-context-use-camel-case'.
-       (org-activate-camels): Use new option `org-activate-camels'.
-       (org-link-regexp): Add mhe prefix.
-       (org-open-at-point, org-store-link): Support for mhe links.
-       (org-mhe-get-message-real-folder, org-mhe-get-message-folder)
-       (org-mhe-get-message-folder-from-index, org-mhe-get-message-num)
-       (org-mhe-get-header, org-follow-mhe-link): New functions.
-       (org-remove-angle-brackets, org-add-angle-brackets):
-       New functions.
-       (org-bracket-link-regexp): New constant.
-       (org-read-date): Fix bug that was rejecting all typed dates.
-       (org-link-search): Make hierarchy above visible after a match.
-       (org-follow-bbdb-link): Inhibit electric mode for BBDB.
-       (org-store-link): Fix bug with link creation when cursor is in
-       an empty line.
-       (org-open-at-point): Fix bug with matching a link.
-       Fixed buggy argument sequence in call to `org-view-tags'.
-       (org-compile-prefix-format): Set `org-prefix-has-tag'.
-       (org-prefix-has-tag): New variable.
-       (org-format-agenda-item): Remove tags from headline
-       if appropriate.
-       (org-agenda-remove-tags-when-in-prefix): New option.
-
-2006-02-21  Michael Kifer  <kifer@cs.stonybrook.edu>
-
-       * ediff-diff.el (ediff-setup-diff-regions, ediff-setup-diff-regions3):
-       Fix the regular expressions.
-
-2006-02-21  Richard M. Stallman  <rms@gnu.org>
-
-       * progmodes/sh-script.el (sh-mode): Set shell type based on file name
-       if there's no other specific basis.
-
-       * emacs-lisp/unsafep.el (unsafep): Don't treat &rest or &optional
-       as variables at all.
-       (unsafep-variable): Rename arg; doc fix.
-
-       * abbrevlist.el (list-one-abbrev-table): Add autoload.
-
-       * calendar/appt.el (diary-selective-display): Add defvar.
-
-       * sort.el (sort-columns): Use Posix arg syntax for `sort'.
-
-       * isearch.el (search-whitespace-regexp): Fix custom type.
-
-       * help.el (describe-key-briefly): Compute interactive args
-       in same was as before previous change.
-
-       * files.el (enable-local-variables): Doc fix.
-
-2006-02-21  Kim F. Storm  <storm@cua.dk>
-
-       * fringe.el: Cleanup as file is now pre-loaded.
-       (fringe-bitmaps): Initialize unconditionally.
-       (fringe-mode, set-fringe-style): Remove autoload cookies.
-
-2006-02-21  Giorgos Keramidas  <keramida@ceid.upatras.gr>  (tiny change)
-
-       * fringe.el (fringe-bitmaps): Rename `horisontal-bar' to
-       `horizontal-bar'.
-       (fringe-cursor-alist): Use `horizontal-bar'.
-
-2006-02-20  Kim F. Storm  <storm@cua.dk>
-
-       * fringe.el (fringe-bitmaps): Update to new bitmap names.
-       (fringe-indicator-alist, fringe-cursor-alist): Initialize.
-
-       * loadup.el: Load "fringe" on window systems.
-
-2006-02-20  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-speedbar-buttons): Use shadow face for all
-       out of scope components.
-
-       * progmodes/gdb-ui.el (gdb-speedbar-auto-raise): Don't enable by
-       default.
-
-2006-02-20  Chong Yidong  <cyd@stupidchicken.com>
-
-       * custom.el (customize-mark-to-save, customize-mark-as-set):
-       Load the symbol first.
-
-2006-02-20  Juanma Barranquero  <lekktu@gmail.com>
-
-       * buff-menu.el (list-buffers-noselect): Turn also "\n" into a
-       strech spec so it doesn't display as "^J" on the header line
-       when `Buffer-menu-use-header-line' is t.
-
-2006-02-20  Nick Roberts  <nickrob@snap.net.nz>
-
-       * speedbar.el (speedbar-make-button): Keep text properties
-       of string arguments if desired.
-
-       * progmodes/gud.el (gud-speedbar-buttons): Fontify watch
-       expessions.
-
-       * progmodes/gdb-ui.el (gdb-speedbar-expand-node): Force update
-       of speedbar.
-
-2006-02-19  Ryan Yeske  <rcyeske@gmail.com>
-
-       * ffap.el (ffap-read-file-or-url): Bind `completion-ignore-case'
-       to value of `read-file-name-completion-ignore-case'.
-
-2006-02-19  Chong Yidong  <cyd@stupidchicken.com>
-
-       * custom.el (customize-mark-as-set): Push to `user' theme.
-
-       * cus-edit.el (custom-save-variables): Allow unthemed values.
-       (customize-set-variable): Push setting to `user' theme.
-
-2006-02-19  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el: Don't require font-lock as it's now
-       automatically loaded.
-       (gud-speedbar-buttons): Replace gdb-var-changed with
-       gdb-force-update.
-
-       * progmodes/gdb-ui.el (gdb-force-update): Rename from
-       gdb-var-changed.
-       (gdb-post-prompt): Use it.
-       (gdb-var-create-handler, gdb-var-evaluate-expression-handler)
-       (gdb-var-update-handler, gdb-var-delete)
-       (gdb-speedbar-expand-node, gdb-var-list-children-handler-1)
-       (gdb-var-update-handler-1): Don't set gdb-var-changed, just set
-       gdb-force-update in gdb-post-prompt.
-       (gdb-reset): Clear watch expressions from speedbar when quitting.
-
-2006-02-19  Michael Kifer  <kifer@cs.stonybrook.edu>
-
-       * viper-cmd.el (viper-insert-state-post-command-sentinel)
-       (viper-change-state-to-vi, viper-change-state-to-emacs):
-       Make aware of cursor coloring in the Emacs state.
-       (viper-special-read-and-insert-char): Use read-char-exclusive.
-       (viper-minibuffer-trim-tail): Workaround for fields in minibuffer.
-
-       * viper-init.el (viper-emacs-state-cursor-color): New variable.
-
-       * viper-util.el (viper-save-cursor-color)
-       (viper-get-saved-cursor-color-in-replace-mode)
-       (viper-get-saved-cursor-color-in-insert-mode)
-       (viper-restore-cursor-color): Make aware of the cursor color in Emacs
-       state.
-       (viper-get-saved-cursor-color-in-emacs-mode): New function.
-
-       * ediff-diff.el (ediff-ignore-case, ediff-ignore-case-option)
-       (ediff-ignore-case-option3, ediff-actual-diff-options)
-       (ediff-actual-diff3-options): New variables to control case sensitivity.
-       (ediff-make-diff2-buffer, ediff-setup-fine-diff-regions)
-       (ediff-setup-diff-regions3): Make aware of case-sensitivity.
-       (ediff-toggle-ignore-case): New function.
-       (ediff-extract-diffs, ediff-extract-diffs3): Preserve point in buffers.
-
-       * ediff-help.el (ediff-long-help-message-narrow2)
-       (ediff-long-help-message-compare2, ediff-long-help-message-compare3)
-       (ediff-long-help-message-word-mode): Add ignore-case command.
-       (ediff-help-for-quick-help): Add ignore-case command.
-
-       * ediff-merg.el: Move provide to the end.
-
-       * ediff-ptch.el: Move provide to the end.
-
-       * ediff-wind.el: Move provide to the end.
-
-       * ediff-mult.el: Move provide to the end.
-       (ediff-set-meta-overlay): Enable follow-link.
-
-       * ediff.el: Move provide to the end.
-       Break recursive load cycle in eval-when-compile.
-       (ediff-patch-buffer): Better heuristics.
-
-       * ediff-util.el: Move provide to the end.
-       Break recursive load cycle in eval-when-compile.
-       (ediff-setup-keymap): Add binding for #c.  Replace some defsubsts with
-       defuns.
-       (ediff-submit-report): Pass the values of ediff-diff3-program,
-       ediff-diff3-options.
-
-2006-02-19  Juanma Barranquero  <lekktu@gmail.com>
-
-       * help-fns.el (help-do-arg-highlight): Recognize also ARG- followed by
-       the opening bracket of the following bracketing pairs: {}, [], (), <>,
-       `' (for example, in the docstring of `windmove-default-keybindings').
-
-2006-02-19  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-speedbar-buttons): Update properly for
-       shadow face.  Don't provide binding to edit variable when it is
-       out of scope.
-
-       * progmodes/gdb-ui.el (gdb-var-evaluate-expression-handler)
-       (gdb-var-update-handler): Detect out of scope variables with pre
-       GDB 6.4 too.
-       (gdb-post-prompt): Revert change from 2006-02-17 (force update).
-       Reset status of variable objects to nil in update handlers.
-       (gdb-var-update-handler-1): Detect when a variable object comes
-       in scope.  setcar on var changes gdb-var-list directly.
-
-2006-02-17  Juri Linkov  <juri@jurta.org>
-
-       * ffap.el (ffap) <defface>: Add explicit face declaration.
-       (ffap-highlight): Use face `ffap' directly instead of checking
-       for its existence.
-
-       * icomplete.el (icomplete-get-keys): Use `t' for the second arg
-       `visible-ok' of `other-buffer' to find the right original buffer.
-
-       * info.el (Info-search): Skip `Local Variables' node.
-
-2006-02-17  Juri Linkov  <juri@jurta.org>
-
-       * info.el (Info-find-file): Check for symbols `apropos', `history',
-       `toc' in the input filename, and return these symbols as is.
-       (Info-find-node-2): Set Info-current-file to symbols `apropos',
-       `history', `toc' instead of strings.
-       (Info-set-mode-line): For non-string Info-current-file use the
-       symbol's name inside **.
-       (Info-isearch-push-state): Add quote before Info-current-file and
-       Info-current-node.
-       (Info-isearch-pop-state): Use `equal' instead of `string='.
-       (Info-extract-pointer, Info-following-node-name): Use
-       `match-string-no-properties' instead of `match-string'.
-       (Info-up): Check `old-file' for `stringp'.
-       (Info-history): Use `equal' instead of `string-equal'.
-       Check `file' for `stringp'.
-       (Info-history): Use symbol `history' instead of string as first arg
-       of `Info-find-node'.
-       (Info-toc): Check `Info-current-file' for `stringp'.  Use symbol
-       `toc' instead of string.
-       (Info-extract-menu-node-name): Use `buffer-substring-no-properties'
-       instead of `buffer-substring', and `match-string-no-properties'
-       instead of `match-string'.
-       (Info-index-nodes): Check for symbols `apropos', `history', `toc'
-       instead of strings.
-       (info-apropos): Use `Info-find-node' instead of `Info-goto-node'.
-       Use symbol `apropos' instead of string.
-       (Info-copy-current-node-name): Check `Info-current-file' for
-       `stringp' and construct a command with `Info-find-node' from it.
-       (Info-fontify-node): Use `match-string-no-properties' instead of
-       `match-string' and check file names for `stringp'.
-       (Info-desktop-buffer-misc-data): Check for symbols `apropos',
-       `history', `toc' instead of strings.
-
-2006-02-17  Chong Yidong  <cyd@stupidchicken.com>
-
-       * files.el: Rearrange functions and variables in the file local
-       variables section.
-
-2006-02-17  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * files.el: Add truncate-lines, ispell-check-comments and
-       ispell-local-dictionary as safe local variables.
-
-2006-02-18  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-speedbar-buttons): Use shadow face for
-       out of scope variables.
-       (gud-speedbar-buttons): Use unless.
-
-       * progmodes/gdb-ui.el (gdb-var-list): Update doc string.
-       (gdb-init-1, gdb-var-changed): Set gdb-var-changed to t initially.
-       (gdb-show-changed-values): Also use for out of scope variables.
-       (gdb-var-update-handler-1): Note if variable goes out of scope.
-
-2006-02-17  Ryan Yeske  <rcyeske@gmail.com>
-
-       * net/rcirc.el (rcirc-connect): Make all arguments optional, and
-       default to global variable values for unsupplied args.
-       (rcirc-get-buffer-create): Fix bug with setting the target.
-       (rcirc-any-buffer): Rename from rcirc-get-any-buffer, and include
-       test for rcirc-always-use-server-buffer-flag here.
-       (rcirc-response-formats): Add %N, which is a facified nick.  %n
-       uses the default face.  Change the ACTION format string.  If the
-       "nick" is the server, don't print anything for that field.
-       Comment fixes.
-       (rcirc-target-buffer): Don't test
-       rcirc-always-use-server-buffer-flag here.
-       (rcirc-print): Squeeze extra spaces out of the text before message.
-       (rcirc-put-nick-channel): Strip potential "@" char from nick
-       before adding them to nick table.
-       (rcirc-url-regexp): Improve to match address like "foo.com".
-
-2006-02-17  Eli Zaretskii  <eliz@gnu.org>
-
-       * allout.el (allout-hidden-p): Move this defsubst before
-       allout-overlay-interior-modification-handler, where it is first
-       used.
-
-2006-02-17  Ken Manheimer  <ken.manheimer@gmail.com>
-
-       * allout.el: Use allout invisible-text overlays instead of
-       selective display for concealed text.  Also, lots of general
-       cleanup, and improved compatibility code.
-
-       (allout-version): Incremented, corrected, revised, and refined
-       module commentary.
-
-       (provide 'allout): Moved to the bottom, added a require of overlay.
-
-       (allout-encrypt-unencrypted-on-saves): Defaults to t instead of
-       `except-current'.
-       (allout-write-file-hook-handler): Minimize delay.
-       (count-trailing-whitespace-region): New function so
-       auto-encryption of current topic can resituate cursor exactly.
-       PGP/GPG encryption trims trailing whitespace from lines, which
-       must be accounted for across encryption then decryption.
-
-       (allout-command-prefix): Now defaults to "\C-c<space>" rather than
-       just plain "\C-c", to avoid intruding on user's keybinding space.
-
-       (allout-toggle-current-subtree-encryption): Pass along fetch-pass
-       parameter, so user request to provide a new password is done.
-
-       (allout-outside-normal-auto-fill-function, allout-auto-fill):
-       Refined mechanism for auto-filling behavior while in allout mode.
-
-       (allout-mode): Explicitly specify the mode map in the docstring.
-       Clarify provision for various write-file hook var names.
-       Adjusted for invisible-text overlays instead of selective-display.
-
-       (allout-depth): Really return 0 if not within any topic.  This
-       rectifies `allout-beginning-of-level' and sequence numbering
-       errors that occur when cutting and pasting numbered topics.
-       Changed from a in-line subst to a regular function, as well.
-
-       (allout-pre-next-prefix): Renamed from allout-pre-next-preface.
-
-       (allout-end-of-subtree, allout-end-of-subtree)
-       (allout-end-of-entry, allout-end-of-current-heading)
-       (allout-next-visible-heading, allout-open-topic, allout-show-entry)
-       (allout-show-children, allout-show-to-offshoot)
-       (allout-hide-current-entry, allout-show-current-entry): Rectified
-       handling of trailing blank lines between items.
-
-       (allout-line-boundary-regexp, set-allout-regexp, allout-depth)
-       (allout-current-depth, allout-unprotected, allout-hidden-p)
-       (allout-on-current-heading-p, allout-listify-exposed)
-       (allout-chart-subtree, allout-goto-prefix)
-       (allout-back-to-current-heading, allout-get-body-text)
-       (allout-snug-back, allout-flag-current-subtree, allout-show-all)
-       (allout-hide-region-body, allout-toggle-subtree-encryption)
-       (allout-encrypt-string, allout-encrypted-key-info)
-       (allout-next-topic-pending-encryption, allout-encrypt-decrypted)
-       (allout-file-vars-section-data): Adjusted for use with
-       invisible-text overlays instead of selective-display.
-
-       (allout-kill-line, allout-kill-topic, allout-yank-processing):
-       Reworked for use with invisible text overlays.
-
-       (allout-current-topic-collapsed-p): New function.
-
-       (allout-hide-current-subtree): Use allout-current-topic-collapsed-p
-       to know when to close the containing topic.
-
-       (allout-pre-command-business, allout-post-command-business):
-       Simplify undo-batching and dynamic isearch exposure.
-
-       (allout-set-overlay-category): New for invisible-text overlays.
-       Sets properties of allout-overlay-category, used by
-       allout-flag-region to set invisible-text overlay properties.
-       (allout-get-invisibility-overlay): Get the first qualifying
-       invisibility overlay, so we can find the extent of it.
-       (allout-back-to-visible-text): Get to just before the beginnining
-       of the current invisibility overlay, if any.
-
-       (allout-overlay-insert-in-front-handler)
-       (allout-overlay-interior-modification-handler)
-       (allout-before-change-handler, allout-isearch-end-handler): New
-       functions to handle extraordinary actions affecting concealed
-       text.
-
-       (allout-flag-region): Use overlays instead of selective-display
-       for invisible text - by inheritence from the properties of
-       allout-overlay-category in mainline Emacs, and applied
-       property-by-property in XEmacs, some recent versions of which
-       don't inherit the properties from the category.  Provisions to
-       respond to concealed-text edits simplified drastically.
-
-       (allout-isearch-rectification, allout-isearch-was-font-lock)
-       (allout-isearch-expose, allout-enwrap-isearch)
-       (allout-isearch-abort, allout-pre-was-isearching)
-       (allout-isearch-prior-pos, allout-isearch-did-quit)
-       (allout-isearch-dynamic-expose)
-       (allout-hide-current-entry-completely): Functions deleted.
-
-       (allout-undo-aggregation): Explicit undo aggregation no longer
-       necessary due to transition away from selective-display.
-
-       (set-allout-regexp, allout-up-current-level)
-       (allout-next-visible-heading, allout-forward-current-level)
-       (allout-open-topic, allout-reindent-body, allout-rebullet-topic)
-       (allout-kill-line, allout-yank-processing, allout-show-children)
-       (allout-expose-topic, allout-old-expose-topic)
-       (allout-listify-exposed, allout-insert-latex-header)
-       (allout-toggle-subtree-encryption, allout-encrypt-string)
-       (remove-from-invisibility-spec, allout-hide-current-subtree):
-       Ditched unused variables.
-
-2006-02-17  Agustin Martin  <agustin.martin@hispalinux.es>
-
-       * textmodes/ispell.el (ispell-change-dictionary): Call
-       ispell-buffer-local-dict instead of
-       ispell-accept-buffer-local-defs.
-       (ispell-local-dictionary-alist): Accept as valid any coding-system
-       supported by Emacs.
-       (ispell-dictionary-alist-3): Esperanto dictionary's coding system
-       changed to iso-8859-3.
-
-2006-02-17  Nick Roberts  <nickrob@snap.net.nz>
-
-       * speedbar.el (speedbar-frame-width): Make an inline function
-       instead of a macro.  Use frame-width.
-       (speedbar-try-completion, speedbar-update-contents)
-       (speedbar-timer-fn): Use consp.
-       (speedbar-update-localized-contents): Try to preserve point.
-
-       * progmodes/gdb-ui.el (gdba, gdb-var-list): Improve doc strings.
-       (menu): Re-order menu items.
-       (gdb-var-update-regexp, gdb-var-update-regexp-1): Match "in_scope"
-       field.
-       (gdb-var-update-handler-1): Use it for GDB 6.4+.
-       (gdb-post-prompt): Speed things by not forcing update.
-
-2006-02-16  Chong Yidong  <cyd@stupidchicken.com>
-
-       * wid-edit.el (widget-button-click): For mouse-1, cancel button
-       press and perform default action if we get a mouse movement event.
-
-2006-02-16  Juanma Barranquero  <lekktu@gmail.com>
-
-       * calendar/icalendar.el (icalendar--get-event-property)
-       (icalendar--get-event-property-attributes): Fix typos in
-       docstrings.
-
-       * progmodes/flymake.el (flymake-fix-file-name): Fix typo in
-       docstring.
-
-2006-02-15  Juanma Barranquero  <lekktu@gmail.com>
-
-       * bs.el (bs-mode): Use `buffer-disable-undo'.
-       (bs--get-file-name): Simplify.
-       (bs-show-in-buffer): Mark the buffer as not modified.
-
-2006-02-14  Chong Yidong  <cyd@stupidchicken.com>
-
-       * wid-edit.el (widget-keymap): Bind down-mouse-1 to
-       widget-button-click.
-
-       * cus-edit.el (custom-mode-map): Remove mouse-1 binding.
-       (custom-mode): Update docstring.
-
-       * cus-theme.el (custom-new-theme-mode-map): Remove mouse-1
-       binding.
-
-       * files.el (hack-local-variables-confirm): Allow scrolling if the
-       file variable list is too long.  Kill temp buffer after use.
-
-2006-02-15  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gdb): Improve doc string.
-       (gdb-script-font-lock-keywords): Expand allowed character set.
-
-       * progmodes/gdb-ui.el (gdb-use-separate-io-buffer)
-       (gdb-display-separate-io-buffer, gdb-frame-separate-io-buffer)
-       (gdb-separate-io-interrupt, gdb-separate-io-quit)
-       (gdb-separate-io-stop, gdb-separate-io-eof):
-       Rename from gdb-inferior-* to gdb-separate-*.
-       (gdb-set-gud-minor-mode-existing-buffers-1): Improve doc string.
-
-2006-02-14  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-arith.el (math-check-known-scalarp): Make sure
-       expression is a symbol before checking that it is bound.
-
-       * calc/calcalg2.el (math-integrate-by-parts): Do a more careful
-       test to see if equation can be solved.
-
-2006-02-14  Chong Yidong  <cyd@stupidchicken.com>
-
-       * wid-edit.el (widget-button-click): Use :pressed-face property
-       for overlay face, if it exists.
-
-       * cus-edit.el (custom-manual, custom-add-see-also)
-       (custom-add-parent-links, custom-group-link): Add :pressed-face
-       property to links.
-
-       * files.el (hack-local-variables): Remove ignored variables before
-       checking if any variables need setting.
-
-2006-02-14  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * cus-start.el (all): Add x-gtk-whole-detached-tool-bar.
-
-2006-02-14  Juanma Barranquero  <lekktu@gmail.com>
-
-       * help.el (where-is): Fix message for remapped commands.
-
-       * mwheel.el (mouse-wheel-click-event, mouse-wheel-mode):
-       Fix typos in docstrings.
-
-2006-02-13  Chong Yidong  <cyd@stupidchicken.com>
-
-       * files.el (safe-local-variable-values): New option.
-       (hack-local-variables-prop-line): Return a list of variable-value
-       pairs if MODE-ONLY is non-nil.
-       (hack-local-variables): Construct list of variable-value pairs,
-       and apply or reject them in one go.  Ask for confirmation if
-       variables are not known safe.
-       (hack-local-variables-confirm): Complete rewrite.  Support
-       `safe-local-variable-values'.
-       (enable-local-variables): Update docstring to reflect new
-       behavior.
-       (ignored-local-variables): Ignore ignored-local-variables and
-       safe-local-variable-values.
-       (safe-local-variable-p): New function.
-       (risky-local-variable-p): `safe-local-variable' property check
-       moved to safe-local-variable-p.
-       (hack-one-local-variable): Checks moved to hack-local-variables.
-
-       (byte-compile-dynamic, c-basic-offset, c-file-style)
-       (c-indent-level, comment-column, fill-column, fill-prefix)
-       (indent-tabs-mode, kept-new-versions, no-byte-compile)
-       (no-update-autoloads, outline-regexp, page-delimiter)
-       (paragraph-start, paragraph-separate, sentence-end)
-       (sentence-end-double-space tab-width, version-control):
-       Add `safe-local-variable' property.
-
-       * find-lisp.el: Delete nonexistent `autocompile' file variable.
-
-       * icomplete.el, play/landmark.el: Change nonexistent
-       `outline-layout' file variable to `allout-layout'.
-
-2006-02-14  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gud-watch, gdb-invalidate-registers-1)
-       (gdb-get-changed-registers): Test value of gud-minor-mode relative
-       to gud-comint-buffer.
-       (gdb-speedbar-expand-node, gdb-locals-mode): Use functions in
-       gdb-ui.el for gdb-mi.el.
-       (gdb-post-prompt, gdb-get-changed-registers): Move test for
-       registers buffer to gdb-get-changed-registers.
-       (gdb-breakpoint-regexp): New regexp.  Allow toggling and
-       deletion of catchpoints (throw and catch).
-       (gdb-toggle-breakpoint, gdb-delete-breakpoint)
-       (gdb-goto-breakpoint): Use it for both gdb-ui and gdb-mi.
-       (gdb-find-file-hook, gdb-set-gud-minor-mode-existing-buffers-1)
-       (gdb-var-list-children-1, gdb-info-breakpoints-custom)
-       (gdb-var-update-1, gdb-invalidate-locals-1): Use also for gdb-mi.
-
-2006-02-13  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-arith.el (math-check-known-matrixp): Make sure
-       expression is a symbol before checking that it is bound.
-
-2006-02-13  Richard M. Stallman  <rms@gnu.org>
-
-       * mouse.el (mouse-drag-mode-line-1): Use mouse-drag-move-window-bottom
-       for the minibuffer too, but not if resize-mini-windows will interfere.
-
-       * help.el (describe-key-briefly, describe-key): Do all arg-reading
-       inside `interactive' spec.
-       (describe-key-briefly-internal, describe-key-internal):
-       Functions merged back into their callers.
-
-2006-02-13  Martin Rudalics  <rudalics@gmx.at>
-
-       * info.el (info-xref-visited): Inherit from info-xref too.
-       (Info-set-mode-line): Replace occurrences of `%' by `%%'
-       when propertizing Info-current-file and Info-current-node.
-
-2006-02-13  Juri Linkov  <juri@jurta.org>
-
-       * tumme.el (tumme-thumbnail-storage): Fix docstring.
-       (tumme-thumb-name): Fix per-directory format.
-
-2006-02-13  Juanma Barranquero  <lekktu@gmail.com>
-
-       * subr.el (substitute-key-definition): Doc fix (hide internal arg).
-
-2006-02-12  Miles Bader  <miles@gnu.org>
-
-       * net/rcirc.el (rcirc-format-response-string): Fix small bugs.
-
-2006-02-13  Mathias Dahl  <mathias.dahl@gmail.com>
-
-       * tumme.el: Remove history section.  If someone needs the it, it
-       can always be found in CVS.
-
-2006-02-12  Mathias Dahl  <mathias.dahl@gmail.com>
-
-       * tumme.el (tumme-thumbnail-storage): Update docstring.  Add info
-       about the Thumbnail Managing Standard option.
-
-2006-02-12  Richard M. Stallman  <rms@gnu.org>
-
-       * subr.el (substitute-key-definition): Doc fix.
-
-       * simple.el (blink-matching-paren-dont-ignore-comments): Doc fix.
-
-       * files.el (magic-mode-alist): Don't use `\\s ' in regexps.
-
-       * info.el (Info-mode): Doc fix.
-
-       * progmodes/ebrowse.el (ebrowse-global-prefix-key): Change to C-c C-m.
-
-2006-02-12  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/tramp.el (tramp-remote-path): Add "/usr/xpg4/bin" on top,
-       because on Solaris a POSIX compatible "id" is needed.  Reported by
-       Magnus Henoch <mange@freemail.hu>.
-
-2006-02-12  Juri Linkov  <juri@jurta.org>
-
-       * tumme.el: Remove todo item about Thumbnail Managing Standard.
-       (tumme) <defgroup>: Change :group to `multimedia'.
-       (tumme-thumbnail-storage): Add choice `standard' for Thumbnail
-       Managing Standard.
-       (tumme-cmd-create-thumbnail-options): Use %w and %h instead of %s.
-       Fix dostring.
-       (tumme-cmd-create-temp-image-options): Use %w and %h instead of %x
-       and %y.  Fix docstring.
-       (tumme-cmd-pngnq-program, tumme-cmd-pngcrush-program)
-       (tumme-cmd-create-standard-thumbnail-command): New user options.
-       (tumme-thumb-size): Set default to 128 if tumme-thumbnail-storage
-       is `standard'.  Fix docstring.
-       (tumme-thumb-width, tumme-thumb-height): New user options.
-       (tumme-external-viewer): Try to find various viewers.
-       (tumme-get-thumbnail-image): Use `create-image' instead of
-       constructing the `image' structure.
-       (tumme-insert-thumbnail): Use `png' if tumme-thumbnail-storage is
-       `standard'.
-       (tumme-thumb-name): Add file name generation for standard storage.
-       Simplify code for other storages.
-       (tumme-thumb-name): Use width %w and height %h instead of size %s.
-       Add modification time %m and thumbnail-nq8 %q.
-       Use `tumme-cmd-create-standard-thumbnail-command' if
-       tumme-thumbnail-storage is `standard'.
-       (tumme-dired-insert-marked-thumbs): New autoload command.
-       (tumme-dired-after-readin-hook): New function.
-       (tumme-line-up-dynamic): Use `tumme-thumb-width' instead of
-       `tumme-thumb-size'.
-       (tumme-display-image): Replace size-x %x and size-y %y with
-       width %w and height %h.
-
-       * dired.el (dired-mode-map): Bind `\C-t\C-t' to
-       `tumme-dired-insert-marked-thumbs'.
-
-2006-02-12  Mathias Dahl  <mathias.dahl@gmail.com>
-
-       * tumme.el (tumme-write-tag): Fix small bug (file name did not
-       include path).
-       (tumme-mark-tagged-files): Fix bug in regexp used to find rows
-       matching tag.
-
-2006-02-12  Miles Bader  <miles@gnu.org>
-
-       * net/rcirc.el (rcirc-nick-abbrevs, rcirc-response-formats):
-       New variables.
-       (rcirc-abbrev-nick): New function.
-       (rcirc-format-response-string): Rewrite to use the formats in
-       `rcirc-response-formats' and expand escape sequences therein.
-       A text-property `rcirc-text' is added over the actual response
-       text to make easy to find inside the returned string.
-       (rcirc-print): When filling, just look for the `rcirc-text'
-       text-property to find the appropriate fill prefix, instead of
-       using hardwired patterns.
-
-2006-02-11  Mathias Dahl  <brakjoller@hotmail.com>
-
-       * tumme.el: Enhance some docstrings.  Add todo item about Thumbnail
-       Managing Standard.
-
-2006-02-11  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-buffer-internal): Set mark for ido-insert-buffer.
-       Don't use insert-buffer; do insert-buffer-substring directly.
-       (ido-file-internal): Set mark for ido-insert-file.  Use insert-file-1.
-
-2006-02-11  Martin Rudalics  <rudalics@gmx.at>
-
-       * files.el (revert-buffer, recover-file): Replace buffer-read-only
-       with inhibit-read-only.  Suggested by Stefan Monnier.
-       (revert-buffer): Let insert-file-contents discard
-       buffer-undo-list.  Simplify code.
-       (find-file, find-file-existing, revert-buffer): Doc-string fixes.
-
-2006-02-11  Eli Zaretskii  <eliz@gnu.org>
-
-       * menu-bar.el (menu-bar-select-yank): Add a doc string.
-
-       * help.el (describe-key-briefly): Now a wrapper for
-       describe-key-briefly-internal.  Bind enable-disabled-menus-and-buttons
-       to t.  Populate yank-menu if empty.
-       (describe-key-briefly-internal): Renamed from describe-key-briefly.
-       (describe-key): Now a wrapper for describe-key-internal.  Bind
-       enable-disabled-menus-and-buttons to t.  Populate yank-menu if empty.
-       (describe-key-internal): Renamed from describe-key.
-
-2006-02-11  Milan Zamazal  <pdm@zamazal.org>
-
-       * progmodes/glasses.el (glasses-separator): Doc fix.
-       (glasses-original-separator): New defcustom.
-       (glasses-make-readable, glasses-convert-to-unreadable): Use it.
-
-2006-02-11  Martin Rudalics  <rudalics@gmx.at>
-
-       * mwheel.el (mouse-wheel-up-event): Doc fix.
-
-2006-02-11  Mathias Dahl  <brakjoller@hotmail.com>
-
-       * tumme.el (tumme-dir): Change default value to "~/.emacs.d/tumme/".
-       (tumme-dir): New function.  Copied from thumbs.el.
-
-2006-02-10  Juanma Barranquero  <lekktu@gmail.com>
-
-       * desktop.el (desktop-outvar): Fix typo.
-       (desktop-save-buffer-p): Doc fix.
-
-       * subr.el (substitute-key-definition): Fix typo.
-
-2006-02-10  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * frame.el (select-frame-set-input-focus): Call x-focus-frame also
-       when window-system is mac.
-
-       * term/mac-win.el (fontset-standard): Rename from "fontset-mac".
-
-2006-02-10  Kim F. Storm  <storm@cua.dk>
-
-       * subr.el (substitute-key-definition-key): Pass t for NOERROR to
-       indirect-function instead of using condition-case.
-
-2006-02-10  Mathias Dahl  <mathias.dahl@gmail.com>
-
-       * tumme.el (tumme-copy-with-exif-file-name): Try to make docstring
-       less `colloquial'...
-
-2006-02-09  Mathias Dahl  <mathias.dahl@gmail.com>
-
-       * tumme.el: Add a couple of todo items.
-
-2006-02-09  Lars Hansen  <larsh@soem.dk>
-
-       * hilit-chg.el: Add highlight-changes-mode to desktop-locals-to-save.
-       (highlight-changes-mode): Don't change desktop-locals-to-save.
-
-2006-02-09  Chong Yidong  <cyd@stupidchicken.com>
-
-       * image-mode.el (image-toggle-display): Clear image cache if using
-       filename.
-
-2006-02-09  Masatake YAMATO  <jet@gyve.org>
-
-       * dired-x.el (dired-guess-shell-alist-default): Add .man as
-       a `dired-man' target.
-
-       * progmodes/autoconf.el (autoconf-font-lock-keywords): Check start
-       boundary of symbols.
-
-2006-02-08  Peter Doornbosch  <peter.doornbosch@luminis.nl>  (tiny change)
-
-       * vc-svn.el (vc-svn-print-log): Show recent commits as well.
-
-2006-02-09  Juanma Barranquero  <lekktu@gmail.com>
-
-       * hilit-chg.el (hilit-chg-update-all-buffers): Use `mapc' instead of
-       `mapcar'; return nil.
-
-2006-02-08  Chong Yidong  <cyd@stupidchicken.com>
-
-       * mouse.el (mouse-drag-track): Don't change window if we rebind to
-       some other event.
-
-2006-02-08  Ryan Yeske  <rcyeske@gmail.com>
-
-       * net/rcirc.el (rcirc-startup-channels-alist):
-       Add irc.freenode.net and #emacs as defaults.
-       (rcirc-ignore-all-activity-flag): Remove variable.
-       (rcirc-authinfo): New variable.
-       (rcirc-authinfo-filename): Remove variable.
-       (rcirc-always-use-server-buffer-flag): New flag.
-       (rcirc): M-x rcirc will automatically connect without prompting.
-       C-u M-x rcirc will prompt.  Use rcirc-connect to create a
-       connection in lisp.
-       (rcirc-process-server-response-1): Remove everything but the nick
-       portion of the sender so it doesn't need to be done everywhere
-       else.  Update related code.
-       (global-map): Remove global keybindings.
-       (rcirc-get-buffer-create): Make sure rcirc-topic is set.
-       (rcirc-send-input): Split into several functions.
-       (rcirc-process-input-line, rcirc-process-message)
-       (rcirc-process-command): New functions.
-       (rcirc-target-buffer): New function to determine where to route
-       messages.
-       (rcirc-user-nick): Save match data.
-       (rcirc-toggle-ignore-buffer-activity)
-       (rcirc-update-activity-string): Remove global ignore functionality,
-       which can be done now by toggling rcirc-track-minor-mode.
-       (rcirc-track-minor-mode-map): New keymap.
-       (rcirc-track-minor-mode): New minor-mode.
-       (ignore): Make the ignore output nicer.  Always print it when
-       adding or removing nicks.
-       (rcirc-url-regexp): Improve.
-       (rcirc-mangle-text): Remove properties before using text in the
-       modeline.
-       (rcirc-authenticate): Authentication data comes from
-       rcirc-authinfo, not the file pointed to by rcirc-authinfo-file.
-       (rcirc-server-prefix): Inherit from rcirc-server.
-
-2006-02-08  Mathias Megyei  <Mathias.Megyei@micronas.com>  (tiny change)
-
-       * Makefile.in (compile): Append "|| true" to the end of the `find'
-       command, like compile-always does.
-
-2006-02-08  Sam Steingold  <sds@gnu.org>
-
-       * net/tramp.el (tramp-maybe-open-connection): Do not wait for
-       output from a dead connection.
-
-2006-02-07  Mathias Dahl  <brakjoller@hotmail.com>
-
-       * dired.el (dired-mode-map): Add more bindings for tumme.
-
-2006-02-07  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * wdired.el (wdired-mode-map): Use remap.
-       (wdired-get-filename): Massage.
-       (wdired-perm-mode-map): Don't copy bindings from wdired-mode-map.
-       (wdired-preprocess-perms, wdired-set-bit, wdired-toggle-bit): Use the
-       `keymap' property rather than `local-map'.
-
-2006-02-07  Mathias Dahl  <brakjoller@hotmail.com>
-
-       * tumme.el (tumme-get-thumbnail-image): New utility function.
-       Suggested by from Chong Yidong.
-       (tumme-dired-with-window-configuration): Rename from
-       `tumme-dired'.  Add code to save window configuration.
-       (tumme-restore-window-configuration): New command to restore the
-       window configuration that `tumme-dired-with-window-configuration'
-       saves before it changes the window configuration.
-       (tumme-show-all-from-dir): New command to display thumbnails for
-       all files in a directory entered by the user, like M-x thumbs.
-       (tumme-display-thumbs): Call `pop-to-buffer' after all thumbnails
-       have been created.
-       (tumme-display-thumbnail-original-image): Call `display-buffer'.
-       (obsolete-tumme-display-thumbnail-original-image-and-buffer):
-       Remove obsolete test function.
-
-2006-02-07  Juanma Barranquero  <lekktu@gmail.com>
-
-       * vc.el (small-temporary-file-directory): Remove defvar; there's
-       a defcustom for it in files.el.
-
-       * tumme.el (tumme-get-thumbnail-image): Add missing arg to `error'.
-       Fix typo in message.
-       (tumme-gallery-generate): Fix typo in `error' message.
-       (tumme-display-window-height-correction)
-       (tumme-display-window-width-correction, tumme-line-up-dynamic)
-       (tumme-line-up-interactive): Dox fixes.
-       (tumme-cmd-rotate-original-options, tumme-display-properties-format)
-       (tumme-restore-window-configuration, tumme-format-properties-string)
-       (tumme-create-thumbs, tumme-display-previous-thumbnail-original):
-       Fix typos in docstrings.
-
-2006-02-07  Chris Moore  <christopher.ian.moore@gmail.com>
-
-       * wdired.el (wdired-get-filename): Fix bug: Don't re-normalize OLD.
-
-2006-02-07  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-tooltip-mode): Remove autoload cookie.
-       User should use hook if desired.
-
-       * progmodes/gdb-ui.el (gdb-post-prompt): Regenerate breakpoints
-       buffer if necessary.
-       (gdb-delete-frame-or-window): New function.
-       (gdb-breakpoints-mode-map): Bind "q" to it.
-
-2006-02-06  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * textmodes/nroff-mode.el: Clean up name space.
-       (nroff-mode-syntax-table): Remove spurious `1' in the syntax of \n.
-       (nroff-mode): Obey the global setting of nroff-electric-mode.
-       (nroff-electric-mode): Use define-minor-mode and derived-mode-p.
-
-       * calendar/calendar.el (calendar-increment-month): Typo in last change.
-
-2006-02-06  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * vc-svn.el (vc-svn-previous-version, vc-svn-next-version): New funcs.
-
-2006-02-06  Lars Hansen  <larsh@soem.dk>
-
-       * generic-x.el (etc-fstab-generic-mode): Add file system types
-       cifs and usbdevfs.  Allow special chars in file names.
-
-2006-02-05  Jay Belanger  <belanger@truman.edu>
-
-       Update copyright notices of the files in lisp/calc.
-
-2006-02-05  Romain Francoise  <romain@orebokech.com>
-
-       Update copyright notices of all files in the lisp/play directory.
-
-2006-02-04  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * ldefs-boot.el: Regenerate.
-
-       * emacs-lisp/find-func.el (find-definition-noselect): Minor doc fix.
-
-2006-02-05  Kim F. Storm  <storm@cua.dk>
-
-       * files.el (magic-mode-regexp-match-limit): New defvar.
-       (set-auto-mode): Use it to limit magic-mode-alist matching.
-
-2006-02-04  Eli Zaretskii  <eliz@gnu.org>
-
-       * info.el (Info-index, Info-mode): Improve the description of the
-       `i' command.
-
-       * ldefs-boot.el: Regenerate.
-
-2006-02-03  Werner Lemberg  <wl@gnu.org>
-
-       * textmodes/nroff-mode.el (nroff-font-lock-keywords): Don't be
-       greedy to find the closing bracket in \*[...] and similar
-       expressions.  This is a first rough fix -- many additional
-       refinements are necessary to make nroff mode really usable with groff.
-
-2006-02-03  Jens Petersen  <petersen@redhat.com>  (tiny change)
-
-       * international/mule-cmds.el (set-locale-environment):
-       Add "/usr/share/X11/locale/locale.alias" to search list for xorg-x11
-       libX11.
-
-2006-02-03  Joe Wells  <jbw@macs.hw.ac.uk>  (tiny change)
-
-       * arc-mode.el (archive-maybe-copy): Fix the way directories in the
-       archive are created in archive-tmpdir.
-
-2006-02-02  John Paul Wallington  <jpw@pobox.com>
-
-       * ibuffer.el (ibuffer-compressed-file-name-regexp): New defcustom.
-       (ibuffer-fontification-alist): Use it.
-       (ibuffer-mode-map): Bind `ibuffer-mark-compressed-file-buffers'
-       to "* z" and the Ibuffer Mark menu.
-
-       * ibuf-ext.el (ibuffer-mark-compressed-file-buffers): New command.
-
-2006-02-02  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * textmodes/table.el (*table--cell-describe-mode)
-       (*table--cell-describe-bindings): Undo last change since
-       print-help-return-message is not obsoleted by anything at all.
-
-2006-02-02  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * emulation/cua-base.el (cua-mode): Doc fix.
-
-2006-02-02  Juanma Barranquero  <lekktu@gmail.com>
-
-       * dframe.el (dframe-handle-make-frame-visible)
-       (dframe-handle-iconify-frame, dframe-get-focus)
-       (dframe-select-attached-frame, dframe-power-click)
-       (dframe-frame-mode): Fix typos in docstrings.
-
-       * ezimage.el (ezimage-mail, ezimage-object-out-of-date)
-       (ezimage-insert-image-button-maybe, ezimage-insert-over-text):
-       Fix typos in docstrings.
-
-       * hi-lock.el (hi-lock-mode, hi-lock-line-face-buffer)
-       (hi-lock-face-buffer, hi-lock-font-lock-hook)
-       (hi-lock-archaic-interface-message-used)
-       (hi-lock-file-patterns-range): Fix typos in docstrings.
-
-       * savehist.el (savehist-loaded, savehist-load, savehist-install)
-       (savehist-autosave, savehist-trim-history): Fix typos in docstrings.
-
-       * mail/mailclient.el (mailclient-place-body-on-clipboard-flag):
-       Fix typo in docstring.
-
-       * net/newsticker.el (newsticker--decode-iso8601-date)
-       (newsticker--set-customvar, newsticker--buffer-insert-item)
-       (newsticker--do-run-auto-mark-filter)
-       (newsticker--parse-generic-feed): Doc fixes.
-       (newsticker--retrieval-timer-list, newsticker-url-list)
-       (newsticker-hide-immortal-items-in-echo-area)
-       (newsticker-hide-obsolete-items-in-echo-area)
-       (newsticker-new-item-face, newsticker--enclosure)
-       (newsticker-buffer-update, newsticker-w3m-show-inline-images)
-       (newsticker--parse-atom-0.3, newsticker--parse-rss-1.0)
-       (newsticker--parse-generic-feed, newsticker--cache-contains)
-       (newsticker--stat-num-items, newsticker-download-enclosures):
-       Fix typos in docstrings.
-
-       * net/rcirc.el (rcirc-debug): Doc fix.
-       (rcirc-fill-column, rcirc-receive-message-hooks)
-       (rcirc-browse-url-map, rcirc-read-only-flag, rcirc-prompt)
-       (rcirc-mode, rcirc-generate-new-buffer-name)
-       (rcirc-startup-channels, rcirc-ignore-update-automatic)
-       (rcirc-cmd-ignore, rcirc-browse-url, rcirc-url-regexp):
-       Fix typos in docstrings.
-       (rcirc-print): "?\ " -> "?\s".
-       (rcirc-cmd-join): Improve argument/docstring consistency.
-
-2006-02-01  Mark A. Hershberger  <mah@everybody.org>
-
-       * xml.el (xml-parse-region): Move save-excursion and set-buffer up
-       before narrow-to-region.
-
-2006-02-01  Richard M. Stallman  <rms@gnu.org>
-
-       * simple.el (move-beginning-of-line): Scan properly for invis change.
-
-       * replace.el (multi-occur-in-matching-buffers): Fix prev change.
-
-2006-02-01  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/tramp.el (tramp-convert-file-attributes): Set file's gid
-       change bit only when id-format is 'integer.  Reported by Matt
-       Hodges <M.P.Hodges@rl.ac.uk>.
-
-2006-02-01  Juanma Barranquero  <lekktu@gmail.com>
-
-       * hilit-chg.el (highlight-changes-initial-state)
-       (highlight-changes-global-initial-state): Doc fixes.
-       (highlight-changes-global-modes, global-highlight-changes):
-       Fix typos in docstrings.
-
-2006-02-01  Kim F. Storm  <storm@cua.dk>
-
-       * emulation/cua-base.el (cua-mode): Mention that CUA enables
-       transient-mark-mode in doc string.
-
-2006-01-31  Richard M. Stallman  <rms@gnu.org>
-
-       * replace.el (multi-occur): Doc fix.
-       (multi-occur-in-matching-buffers): Rename from
-       multi-occur-by-filename-regexp.  Prefix arg says match
-       buffer names instead of file names.
-
-2006-01-31  Juanma Barranquero  <lekktu@gmail.com>
-
-       * bs.el: Allow non-default values of `bs-header-lines-length'.
-       (bs--running-in-xemacs): Remove (not needed anymore).
-       (bs--set-window-height): Simplify by using `fit-window-to-buffer'
-       instead of `shrink-window', thus avoiding having to compute the
-       height of the window.
-       (bs--up): Wrap around even when there's no header.
-       (bs--down): Use `forward-line' instead of `next-line'.
-
-2006-01-30  Chong Yidong  <cyd@stupidchicken.com>
-
-       * image-mode.el (image-toggle-display): Use file name if possible,
-       instead of unnecessarily allocating a (possibly huge) lisp string.
-
-2006-01-30  John Paul Wallington  <jpw@pobox.com>
-
-       * subr.el (toplevel): Define `cl-assertion-failed' condition here
-       because the `assert' macro signals it at runtime.
-
-       * emacs-lisp/cl.el (toplevel): Remove definition of
-       `cl-assertion-failed' condition.
-
-2006-01-30  Nick Roberts  <nickrob@snap.net.nz>
-
-       * thumbs.el (thumbs-marked-list): Make buffer-local and
-       permanent-local.
-       (thumbs-insert-thumb): Make help-echo non-sticky.
-       (thumbs-file-alist): Use eolp as check for (non)-image.
-
-2006-01-30  Juanma Barranquero  <lekktu@gmail.com>
-
-       * ediff-mult.el (ediff-meta-buffer-keymap-setup-hook)
-       (ediff-before-session-group-setup-hooks)
-       (ediff-default-filtering-regexp, ediff-meta-mark-equal-files):
-       Fix typos in docstrings.
-
-       * window.el (bw-dir, bw-eqdir, balance-windows)
-       (split-window-keep-point): Fix typos in docstrings.
-
-       * textmodes/org.el (org-allow-space-in-links, org-closed-string)
-       (org-quote-string, org-calendar-to-agenda-key)
-       (org-agenda-sorting-strategy, org-agenda-use-time-grid)
-       (org-show-following-heading, org-tags-column)
-       (org-use-tag-inheritance, org, org-allow-space-in-links)
-       (org-usenet-links-prefer-google, org-file-apps-defaults-gnu)
-       (org-enable-table-editor, org-calc-default-modes)
-       (org-table-allow-automatic-line-recalculation)
-       (org-export-html-style, org-export-with-fixed-width)
-       (org-export-with-sub-superscripts, org-special-keyword)
-       (org-formula, org-time-grid, org-table-may-need-update)
-       (org-mode, org-goto-ret, org-goto-left, org-goto-right)
-       (org-goto-quit, org-get-indentation, org-end-of-item)
-       (org-move-item-down, org-move-item-up)
-       (org-renumber-ordered-list, org-todo, org-log-done, org-occur)
-       (org-remove-occur-highlights, org-read-date, org-goto-calendar)
-       (org-agenda, org-agenda-day-view, org-agenda-previous-date-line)
-       (org-agenda-log-mode, org-agenda-toggle-diary)
-       (org-agenda-toggle-time-grid, org-agenda-cleanup-fancy-diary)
-       (org-agenda-file-to-end, org-agenda-no-heading-message)
-       (org-agenda-get-closed, org-format-agenda-item)
-       (org-cmp-priority, org-cmp-category, org-cmp-time)
-       (org-agenda-change-all-lines, org-agenda-diary-entry)
-       (org-scan-tags, org-after-todo-state-change-hook, org-tags-view)
-       (org-link-search, org-camel-to-words, org-open-file)
-       (org-remember-handler, org-table-convert-region)
-       (org-table-move-row-down, org-table-move-row-up)
-       (org-table-copy-region, org-table-wrap-region)
-       (org-table-toggle-vline-visibility)
-       (org-table-get-vertical-vector, org-table-modify-formulas)
-       (org-table-get-specials, org-recalc-commands)
-       (org-table-rotate-recalc-marks, org-table-eval-formula)
-       (orgtbl-make-binding, org-in-invisibility-spec-p, org-cycle)
-       (org-level-color-stars-only, org-insert-heading):
-       Fix typos in docstrings.
-       (last-arg): Add defvar.
-
-       * makefile.w32-in (WINS): Add erc.
-       (MH_E_SRC): Update (copied from lisp/Makefile.in).
-
-2006-01-29  Bill Wohler  <wohler@newt.com>
-
-       * Makefile.in (MH_E_SRC): Add mh-compat.el, mh-folder.el,
-       mh-letter.el, mh-limit.el, mh-scan.el, mh-show.el, mh-thread.el,
-       mh-tool-bar.el, mh-xface.el.  Remove mh-customize.el, mh-init.el.
-       (mh-autoloads): Don't use comments on otherwise empty lines.
-
-2006-01-29  Edward O'Connor  <ted@oconnor.cx>
-
-       * emulation/viper.el (viper-major-mode-modifier-list):
-       Add insert-state and vi-state entries for erc-mode.
-       (viper-go-away, viper-set-hooks): Add and remove
-       viper-comint-mode-hook from erc-mode-hook as appropriate.
-
-       * emulation/viper.el (viper-insert-state-mode-list): Add erc-mode.
-
-2006-01-29  Juanma Barranquero  <lekktu@gmail.com>
-
-       * bs.el (bs--format-aux): Implement `middle' alignment as
-       described in the docstring for `bs-attributes-list'.
-       (bs--get-name): Simplify.  Don't pad the buffer name.
-
-2006-01-27  Agustin Martin  <agustin.martin@hispalinux.es>
-
-       * textmodes/ispell.el (ispell-find-aspell-dictionaries): If no
-       English aspell dictionary is installed, use the first entry of
-       ispell-dictionary-alist-1.
-
-2006-01-27  Kevin Rodgers  <ihs_4664@yahoo.com>  (tiny change)
-
-       * textmodes/flyspell.el (flyspell-incorrect, flyspell-duplicate):
-       Doc fix.
-
-2006-01-27  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/tramp-vc.el (vc-user-login-name): Wrap defadvice with a test
-       for `process-file', in order to let it work for older Emacsen too.
-
-2006-01-27  Eli Zaretskii  <eliz@gnu.org>
-
-       * international/latexenc.el: Add a suitable `coding:' tag.
-       (latexenc-find-file-coding-system): Undo last change.
-
-2006-01-27  Arne J\e,Ax\e(Brgensen  <arne@arnested.dk>
-
-       * international/latexenc.el (latexenc-find-file-coding-system):
-       Make sure latexenc-main-file is a regular file and is readable.
-
-2006-01-27  Andre Spiegel  <spiegel@gnu.org>
-
-       * vc-rcs.el (vc-rcs-fetch-master-state, vc-rcs-consult-headers):
-       Pass FILE to vc-user-login-name.
-
-       * vc-sccs.el (vc-sccs-state): Pass FILE to vc-user-login-name.
-
-2006-01-27  Nick Roberts  <nickrob@snap.net.nz>
-
-       * thumbs.el (thumbs-do-thumbs-insertion): Suppress message when
-       there are no more images to display.
-       (thumbs-mark, thumbs-unmark): Revert change so that they move to
-       the next image.
-
-2006-01-26  Richard M. Stallman  <rms@gnu.org>
-
-       * cus-edit.el (custom-mode): Doc: Use advertised-widget-backward.
-
-       * wid-edit.el (advertised-widget-backward): New alias.
-       (widget-keymap): Use advertised-widget-backward for S-TAB.
-
-       * tumme.el: Correct the keywords.
-       (tumme-dir-max-size): Use defvar.
-       (tumme-setup-dired-keybindings, tumme-dired): Add autoload cookie.
-
-       * simple.el (move-beginning-of-line): Take account of fields.
-       (clone-indirect-buffer-other-window): Take args like
-       clone-indirect-buffer, and work like it.
-
-       * help-fns.el (describe-function): Don't pass `nil' as default.
-
-       * files.el (risky-local-variable-p): Follow var aliases.
-
-       * subr.el (lazy-completion-table): Doc fix.
-
-       * mail/rmailsum.el (rmail-make-summary-line-1): Don't set
-       global binding of `line'.
-
-2006-01-25  Andre Spiegel  <spiegel@gnu.org>
-
-       * vc-hooks.el (vc-user-login-name): Rewritten to handle access via
-       Tramp.
-
-       * vc.el (vc-default-dired-state-info): Pass FILE to
-       vc-user-login-name.
-       (vc-default-update-changelog): Don't use vc-user-login-name, we
-       don't need it here.
-
-       * net/tramp-vc.el (vc-user-login-name): Comment out defadvice, it is
-       no longer necessary.
-
-2006-01-25  Kenichi Handa  <handa@m17n.org>
-
-       * international/mule.el (decode-char): Avoid the overhead of
-       calling utf-lookup-subst-table-for-decode if
-       utf-translate-cjk-mode is nil.
-       (encode-char): Avoid the overhead of calling
-       utf-lookup-subst-table-for-encode if utf-translate-cjk-mode is
-       nil.
-
-2006-01-22  Kenichi Handa  <handa@m17n.org>
-
-       * international/mule.el (make-subsidiary-coding-system): Reset
-       `coding-system-define-form' property of subsidiaries to nil.
-       Avoid duplicated entry in coding-system-alist.
-       (make-coding-system): Avoid duplicated entry in
-       coding-system-alist.
-       (define-coding-system-alias): Likewise.
-
-2006-01-24  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * completion.el: Minor fixes in introductory comment.
-       (completion-def-wrapper): Fix alist.
-
-2006-01-25  Nick Roberts  <nickrob@snap.net.nz>
-
-       * thumbs.el (thumbs-new-image-size): New function.
-       (thumbs-increment-image-size-element)
-       (thumbs-decrement-image-size-element, thumbs-increment-image-size)
-       (thumbs-decrement-image-size): Delete.
-       (thumbs-resize-image-1): Rename from thumbs-resize-image.  Keep old
-       temp files and use to resize.
-       (thumbs-resize-image): Rename from thumbs-resize-image-interactive.
-       Use increment argument to enlarge/shrink.  Preserve point.
-       (thumbs-shrink-image): Rename from thumbs-resize-image-size-down.
-       (thumbs-enlarge-image): Rename from thumbs-resize-image-size-up
-       (thumbs-show-thumbs-list): Set thumbs-buffer to current-buffer.
-       (thumbs-mark, thumbs-unmark): Preserve point.
-       (thumbs-modify-image): Keep old temp files and use to modify.
-       Cleanup old temp files at load time.  Preserve point.
-       (thumbs-view-image-mode-map): Use new command names.
-
-2006-01-24  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * log-view.el (log-view-minor-wrap): First rev is the one at point.
-
-       * calendar/cal-menu.el: Avoid macros from calendar.el so as to break
-       the nastiest part of the cyclic dependency.
-       (cal-menu-update): Use dotimes and calendar-increment-month.
-
-       * calendar/calendar.el: Remove unnecessary leading stars in docstrings.
-       (calendar-week-start-day): Add an :initializer.
-       (calendar-mode-map): Use suppress-keymap, and command remapping.
-       (describe-calendar-mode): Setup xref-stack info for the back button.
-       (calendar-star-date): Insert before delete.
-       (calendar-set-mode-line): Add file-modified info if applicable.
-       (calendar-increment-month): New function.
-
-2006-01-24  Tobias C. Rittweiler  <tcr@freebits.de>  (tiny change)
-
-       * font-lock.el (lisp-font-lock-keywords-2):
-       Recognize "& keywords" only at word boundaries.
-
-2006-01-24  Nick Roberts  <nickrob@snap.net.nz>
-
-       * thumbs.el (thumbs-extra-images): New variable.  Make it buffer-local
-       and permanent-local.
-       (thumbs-max-image-number): New variable.
-       (thumbs-do-thumbs-insertion): Use them.
-       (thumbs-per-line): Change default to 4.
-       (thumbs-marked-list): Rename from thumbs-markedL.
-       (thumbs-cleanup-thumbsdir, thumbs-delete-images)
-       (thumbs-rename-images): Use -list instead of L for internal variables.
-       (thumbs-call-convert): Use call-process instead of shell-command.
-       (thumbs-insert-thumb): Add filename as help-echo to each image.
-       (thumbs-show-from-dir): Rename from thumbs-show-all-from-dir.
-       Give dir to thumbs-show-thumbs-list.
-       (thumbs-show-thumbs-list): Set default-directory to that of images.
-       (thumbs-dired-show): Rename from thumbs-dired-show-all.
-       (thumbs-display-thumbs-buffer, thumbs-show-more-images): New functions.
-       (thumbs-mode-map): Bind "+" to thumbs-show-more-images.
-       (thumbs-view-image-mode-map): Bind "^" to thumbs-display-thumbs-buffer.
-
-2006-01-23  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * ses.el (ses-read-cell): Provide a default value.
-
-2006-01-23  Juanma Barranquero  <lekktu@gmail.com>
-
-       * term/w32-win.el (image-library-alist): Add additional names for
-       GIF library.
-
-2006-01-23  Arne J\e,Ax\e(Brgensen  <arne@arnested.dk>
-
-       * international/latexenc.el (latexenc-find-file-coding-system):
-       Add file-regular-p check.
-
-2006-01-22  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * simple.el (clone-buffer): Don't show the new buffer in the same
-       window.
-
-2006-01-23  Juri Linkov  <juri@jurta.org>
-
-       * faces.el (link, link-visited): New faces based on default values
-       of `info-xref' and `info-xref-visited'.
-
-       * info.el (info-xref): Inherit from `link'.
-       (info-xref-visited): Inherit from `link-visited'.
-
-       * cus-edit.el (custom-buffer-create-internal): Use widget type
-       `custom-manual' instead of `info-link' and don't set properties
-       `button-face' and `mouse-face' explicitly.
-       (custom-browse-group-tag, custom-browse-variable-tag)
-       (custom-browse-face-tag): Inherit from widget class
-       `custom-group-link' instead of `push-button'.
-       (custom-button-unraised): Inherit from `underline' face.
-       (custom-link): Inherit from `link' face.  Fix doc and group.
-       (custom-add-parent-links, custom-group-value-create): Don't set
-       properties `button-face' and `mouse-face' explicitly for
-       `custom-group-link' widget.
-       (custom-group-link): Add properties `button-face' and `mouse-face'
-       to widget definition.
-       (custom-field-keymap): New variable.  Put `custom-field-keymap' to
-       editable-field's :keymap property.
-       (custom-mode): Fix docstring: substitute keybindings for
-       `widget-forward' and `widget-backward' from `widget-keymap',
-       `widget-complete' from `custom-field-keymap', replace old
-       `Custom-move-and-invoke' with `widget-move-and-invoke'.  Untabify.
-
-       * desktop.el (desktop-load-file): Check for `fboundp' before
-       calling `symbol-function'.
-
-       * simple.el (clone-buffer, clone-indirect-buffer)
-       (clone-indirect-buffer-other-window): Use `read-buffer' instead of
-       `read-string'.  Fix prompts.
-
-       * play/doctor.el (doctor-mode-map): Rename from `doc-mode-map'.
-
-2006-01-23  Nick Roberts  <nickrob@snap.net.nz>
-
-       * thumbs.el (thumbs-file-alist): Avoid creating duplicate entries.
-
-2006-01-22  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * startup.el (inhibit-splash-screen, initial-scratch-message):
-       Doc fixes.
-
-2006-01-22  Michael Albinus  <michael.albinus@gmx.de>
-
-       Sync with Tramp 2.0.52.
-
-       * net/tramp.el, net/tramp-ftp.el, net/tramp-util.el,
-       * net/tramp-vc.el: Add code for unloading Tramp.  See comment before
-       `tramp-unload-tramp' for checklist.
-
-       * net/tramp.el: Require `timer-funcs' instead of `timer' if in
-       XEmacs.  Contributed by Steve Youngs <steve@sxemacs.org>.
-       (tramp-unload-file-name-handler-alist)
-       (tramp-unload-tramp): New defuns.
-       (tramp-advice-PC-expand-many-files): New defadvice.
-       (tramp-save-PC-expand-many-files, tramp-setup-complete): Defuns
-       removed.
-       (tramp-handle-expand-file-name): Remove double slash.
-       (tramp-handle-file-attributes-with-ls): Return t as 9th attribute.
-       It doesn't matter, because it will be converted later on.
-       (tramp-handle-file-ownership-preserved-p): Rewritten.  The old
-       implementation was just heuristic.
-       (tramp-post-connection): Set uid and gid properties.
-       (tramp-convert-file-attributes): Set file's gid change bit.
-       (tramp-get-remote-uid, tramp-get-remote-gid): New defuns.
-       (tramp-handle-expand-file-name): Use "~root" for tilde expansion
-       in case of su(do)? methods.  The home directory of the local user
-       will be taken else.
-       (tramp-open-connection-telnet)
-       (tramp-open-connection-rsh, tramp-open-connection-su)
-       (tramp-open-connection-multi): Set PS1 to "$ ".  Otherwise, a
-       local shell prompt could hurt.  Reported by Romain Francoise
-       <romain@orebokech.com>.
-       (tramp-let-maybe): Add `edebug-form-spec' property.
-       (tramp-handle-expand-file-name): Bind `default-directory' locally
-       to "/" in order to avoid problems with UNC shares or Cygwin
-       mounts.
-       (tramp-md5-function): Fix typo in error message.
-
-       * net/tramp-ftp.el (tramp-ftp-enable-ange-ftp): New defun.
-
-       * net/tramp-util.el (top): Apply `ignore' instead of `identity'
-       for byte-compiler pacification.
-
-2006-01-22  Andre Spiegel  <spiegel@gnu.org>
-
-       * vc-rcs.el (vc-rcs-state-heuristic): Use file-attributes with
-       ID-FORMAT `string'.  This allows us to get rid of
-       `vc-user-login-name UID'.
-
-       * vc-sccs.el (vc-sccs-state-heuristic): Likewise.
-
-2006-01-22  John Paul Wallington  <jpw@pobox.com>
-
-       * hl-line.el (hl-line-highlight, hl-line-move): Doc fixes.
-
-2006-01-21  Martin Rudalics  <rudalics@gmx.at>
-
-       * emacs-lisp/find-func.el (find-definition-noselect)
-       (find-variable-noselect): Search variables in C source code too.
-       (find-function-C-source, find-function-noselect, find-function)
-       (find-function-other-frame, find-variable-noselect, find-variable)
-       (find-variable-other-frame, find-variable-at-point):
-       Fix docstrings.
-
-2006-01-21  Francesco Potort\e,Al\e(B  <pot@gnu.org>
-
-       * mail/rmailout.el (rmail-output): Don't use content-type if it is nil.
-
-2006-01-21  Agustin Martin  <agustin.martin@hispalinux.es>
-
-       * textmodes/flyspell.el (flyspell-emacs-popup, flypell-xemacs-popup):
-       Default to disabling the "Save affix" question.
-
-2006-01-21  Marien Zwart  <marienz@gentoo.org>  (tiny change)
-
-       * progmodes/python.el (python-mode) <eldoc-mode-hook>: Pass nil as
-       the first arg to run-python.
-
-2006-01-21  Eli Zaretskii  <eliz@gnu.org>
-
-       * startup.el (command-line-1): Handle --no-desktop if desktop.el
-       is not loaded.
-
-2006-01-20  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calcalg2.el (calc-sum-rec): Fix the sum when the lower
-       limit is 0.
-
-       * calc/calc-arith.el (math-add-symb-fancy): Check the length of
-       the correct variable.
-
-2006-01-20  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-open-at-point): Fixed bug with matching a
-       link.  Fixed buggy argument sequence in call to `org-view-tags'.
-       (org-compile-prefix-format): Set `org-prefix-has-tag'.
-       (org-prefix-has-tag): New variable.
-       (org-format-agenda-item): Remove tags from headline if
-       appropriate.
-       (org-agenda-remove-tags-when-in-prefix): New option.
-       (org-get-tags-at): New function.
-
-2006-01-20  Nick Roberts  <nickrob@snap.net.nz>
-
-       * thumbs.el (thumbs-buffer): New variable.  Make it buffer local.
-       (thumbs-find-image): Move image name and number from buffer name
-       to mode name.  Set thumbs-buffer.  Preserve point so that large
-       images remain visible.
-       (thumbs-file-alist): Construct list in thumbs-buffer and reverse
-       order.
-       (thumbs-show-image-num): Get image from thumbs-file-alist.  Set
-       mode name.
-       (thumbs-next-image, thumbs-previous-image): Make them work.
-
-2006-01-19  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * cus-edit.el (custom-buffer-create-internal): State in the text above
-       the whole buffer buttons that they do not operate on hidden items.
-       (custom-face-menu): Use `custom-face-save' instead of
-       `custom-face-save-command'.
-       (custom-face-save-command): Make it an alias for `custom-face-save'
-       and declare it obsolete.
-       (custom-face-save): Doc fix.
-
-       * dired.el (dired-no-confirm): Add quote.
-       (dired-subdir-alist-pre-R): Add quote in
-       `make-variable-buffer-local' form and remove unbalanced parenthesis.
-
-2006-01-19  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * textmodes/table.el (table-mode-indicator): Typo in last change.
-
-2006-01-19  Richard M. Stallman  <rms@gnu.org>
-
-       * outline.el (hide-leaves): Don't call outline-end-of-heading.
-       Fixes bug reported in Nov 2005.
-
-       * isearch.el (isearch-forward): Doc fix.
-
-       * dired.el (dired-move-to-filename-regexp): Define as alias.
-       (dired-no-confirm): Use defcustom.
-       (dired-subdir-alist-pre-R): Put defvar at top level.
-
-       * battery.el (battery-linux-proc-acpi): Handle "last full capacity".
-
-       * textmodes/bibtex.el (bibtex-strings, bibtex-reference-keys):
-       Mark as risky.
-
-       * simple.el (set-mark-command): Doc fix.
-       (clone-indirect-buffer-other-window):
-       Read arg like clone-indirect-buffer.
-       (move-beginning-of-line): Skip invisible newlines.
-
-2006-01-19  Masatake YAMATO  <jet@gyve.org>
-
-       * progmodes/cpp.el (cpp-edit-load): Make the order of
-       listed conditions in a base C code buffer and its associate
-       CPP Edit buffer the same.
-
-2006-01-19  Kenichi Handa  <handa@m17n.org>
-
-       * mail/rmail.el (rmail-enable-mime): Docstring fixed.
-       (rmail-mime-feature): Likewise.
-       (rmail-require-mime-maybe): Use display-warning to show a warning
-       message.
-
-       * international/mule.el (auto-coding-regexp-alist-lookup): New fun.
-       (find-auto-coding): Use auto-coding-regexp-alist-lookup.
-
-2006-01-18  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * array.el: Move defvars out of eval-when-compile.
-       (array-make-template): Replace undeclared global var with a local one.
-       (array-mode): Inline initialization functions.
-       (array-init-local-variables, array-init-max-row)
-       (array-init-max-column, array-init-columns-per-line)
-       (array-init-field-width, array-init-rows-numbered)
-       (array-init-line-length, array-init-lines-per-row): Remove.
-
-       * play/doctor.el: Move defvars out of eval-when-compile.  Use dolist.
-       (doc-mode-map): Define explicitly.
-       (doctor-txtype): Use mapc.
-
-       * textmodes/table.el: Move defvars out of eval-when-compile.
-       Remove harmful code meant to avoid byte-compiler warnings.
-       (table-fixed-mode-indicator): Remove.  Use a more complex mode-line
-       specification that checks table-fixed-width-mode directly.
-       (table-recognize-region, table-recognize-cell):
-       Use restore-buffer-modified-p.
-       (table-fixed-width-mode): Remove code that refreshes
-       table-fixed-mode-indicator.
-       (*table--cell-describe-bindings, *table--cell-describe-mode):
-       Avoid obsolete name print-help-return-message.
-       (table--test-cell-list): Don't use replace-regexp from elisp.
-       (table--point-entered-cell-function, table--point-left-cell-function):
-       Don't set table-fixed-mode-indicator, use force-mode-line-update.
-
-       * textmodes/org.el: Move defvars out of eval-when-compile.  Move code
-       that was after the end of file.  Use buffer-file-name variable.
-       (org-timestamp-change): Use with-current-buffer.
-       (org-todo-list): Don't unnecessarily define a new buffer-local var.
-       (org-agenda-file-to-end, org-agenda-file-to-front): Remove unused arg
-       `file'.
-
-       * progmodes/fortran.el: Move defvars out of eval-when-compile.
-       (fortran-break-line): Remove unused var `opoint'.
-       (fortran-abbrev-start): Obey help-event-list.
-
-2006-01-18  Jesper Harder  <harder@phys.au.dk>
-
-       * mail/smtpmail.el (smtpmail-send-it): Use insert-buffer-substring.
-
-2006-01-18  Masatake YAMATO  <jet@gyve.org>
-
-       * progmodes/make-mode.el (makefile-imake-mode): New mode
-       derived from makefile-mode.
-       (makefile-imake-mode-syntax-table): New syntax table
-       derived from makefile-mode-syntax-table.
-       (makefile-mode): Write about makefile-imake-mode in doc string.
-       (makefile-mode-map): Bind "\C-c\C-m\C-i" to makefile-imake-mode.
-       (makefile-imake-font-lock-keywords): New font lock keywords.
-
-       * files.el (auto-mode-alist): Add Imakefile.
-
-2006-01-17  Agustin Martin  <agustin.martin@hispalinux.es>
-
-       * textmodes/flyspell.el (ispell-kill-ispell-hook): Add to the hook when
-       loading the file rather than when turning on flyspell-mode.
-
-2006-01-16  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * cus-edit.el (customize-rogue): Minor doc fix.
-
-2006-01-17  Juri Linkov  <juri@jurta.org>
-
-       * dired-aux.el (dired-diff): Use dired-dwim-target-directory
-       instead of the file at the mark as default if the file at the mark
-       is the same as the file at point or if dired-dwim-target-directory
-       is not the same as the current directory and the mark is not active.
-
-       * log-view.el (log-view-minor-wrap): Use the same logic to get
-       revisions as `log-view-diff'.
-
-       * info.el (Info-revert-find-node): Check for Info-current-file
-       before preserving new-history.
-
-       * man.el (Man-heading-regexp): Add `/'.
-
-       * textmodes/sgml-mode.el: Add `coding: iso-2022-7bit' cookie.
-       (html-mode): Set `sentence-end-base' instead of `sentence-end'.
-
-2006-01-16  Juri Linkov  <juri@jurta.org>
-
-       * faces.el (mode-line-faces): New defgroup.
-       (mode-line-highlight): Move definition after new defgroup.
-       (mode-line, mode-line-inactive, mode-line-highlight):
-       Replace :group `modeline' with `mode-line-faces'.
-       (mode-line-buffer-id): New face.
-       (modeline-buffer-id): New face alias.
-       (vertical-border): Remove :group `modeline'.
-
-       * bindings.el (propertized-buffer-identification): Use face
-       `mode-line-buffer-id' instead of `Buffer-menu-buffer'.
-       (mode-line-next-buffer, mode-line-previous-buffer): New functions.
-       (mode-line-buffer-identification-keymap): For mouse-1 replace
-       `mode-line-unbury-buffer' with `mode-line-previous-buffer'.
-       Replace `mode-line-bury-buffer' with `mode-line-next-buffer' for
-       mouse-3.
-
-       * buff-menu.el (buffer-menu-buffer) <defface>: Renamed from
-       Buffer-menu-buffer.  Doc fix.
-       (Buffer-menu-buffer): Face alias to buffer-menu-buffer.
-       (list-buffers-noselect): Use `buffer-menu-buffer' face instead of
-       `Buffer-menu-buffer'.
-
-       * info.el (Info-mode-line-node-keymap): New defvar.
-       (Info-set-mode-line): Use `stringp' to check Info-current-file.
-       Propertize Info-current-node with `mode-line-buffer-id' and
-       `mode-line-highlight' faces and `Info-mode-line-node-keymap'.
-
-       * time.el (display-time-mail-face): Replace :group `faces' with
-       `mode-line-faces'.
-
-2006-01-16  Kenichi Handa  <handa@m17n.org>
-
-       * international/code-pages.el: Add autoload cookies for cp125[0345678].
-
-       * language/european.el (cp1252): New alias for windows-1252.
-
-       * international/mule.el (autoload-coding-system): Prepare for EOL
-       variants.
-
-2006-01-15  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * term.el (term-raw-map): Add mapping for insert.
-       (term-send-insert): New.
-       (term-mode): Make variables local here instead of doing it in
-       `term-emulate-terminal'.
-       (term-emulate-terminal): Delete incorrect optimization for cr+lf.
-       Scroll reverse needs to take into account the scroll region.
-       Saving and restoring the cursor should save the color attributes too.
-       (term-reset-terminal): Reset the scroll region.
-       (term-handle-ansi-escape): Cursor up and down should take into
-       account the scroll region.
-       (term-set-scroll-region): Rename from `term-scroll-region'.
-       Move to 0,0 after setting the region.
-       (term-handle-scroll): Handle scroll up.
-       (term-down): Fix off by one error.
-       (term-delete-lines): Do not delete outside the scroll region.
-       (term-insert-lines): Take into account the scroll region.
-
-2006-01-15  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * textmodes/ispell.el (ispell-internal-change-dictionary)
-       (ispell-change-dictionary): Undo most of last change of 2006-01-13.
-       (start, end): Move declaration outside of eval-when-compile.
-
-       * textmodes/flyspell.el (flyspell-kill-ispell-hook): New fun.
-       (flyspell-mode-on): Use it.
-
-       * textmodes/ispell.el (ispell-kill-ispell): Run new hook
-       ispell-kill-ispell-hook.
-
-2006-01-14  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * cus-edit.el (Custom-set, Custom-save, Custom-reset-current)
-       (Custom-reset-saved): Do not ask for confirmation in single option
-       buffers.
-
-2006-01-13  Richard M. Stallman  <rms@gnu.org>
-
-       * font-lock.el (lisp-font-lock-keywords-1): Minor rearrangement.
-
-2006-01-13  Romain Francoise  <romain@orebokech.com>
-
-       * add-log.el (add-change-log-entry, change-log-merge):
-       Conditionally use `hard-newline'.
-
-2006-01-13  Martin Rudalics  <rudalics@gmx.at>
-
-       * wid-edit.el (widget-field-end): If the overlay is no longer
-       associated with a buffer, behave as if the overlay didn't exist.
-
-       * cus-edit.el (custom-add-see-also, custom-add-parent-links):
-       Make sure the links use the `custom-link' face.
-
-2006-01-13  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/ld-script.el (auto-mode-alist): Use \' rather than $.
-       (ld-script-mode): Don't set indent-line-function since we don't
-       have one.
-
-2006-01-13  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-open-file): Use mailcap for selecting an
-       application.
-       (org-file-apps-defaults-gnu): Use mailcap as the default for
-       selecting an application on a UNIX system.
-       (org-agenda-show-tags): New command.
-       (org-table-insert-hline): Keep cursor in current table line.
-       (org-table-convert): Offset effect of modifying
-       `org-table-insert-hline'.
-       (org-format-agenda-item): New optional argument TAG.
-       (org-compile-prefix-format): Handle %T format for the tag.
-       (org-expand-wide-chars): New function.
-       (org-table-insert-row, org-table-insert-hline):
-       Use `org-expand-wide-chars'.
-       (org-open-file): Fix bug in program launch.
-       (org-get-time-of-day): Fix bug with times before 1am.
-       (org-agenda-menu): Add tags commands.
-
-2006-01-13  Agustin Martin  <agustin.martin@hispalinux.es>
-
-       * textmodes/ispell.el (ispell-init-process): Include the used
-       dictionary in ispell process start message.
-       (ispell-internal-change-dictionary): When flyspell-mode is active
-       and dictionary is changed, make sure ispell process is restarted
-       and flyspell word cache cleared out for the current buffer.
-       (ispell-change-dictionary): Make sure flyspell word cache is
-       cleared out in all buffers with active flyspell mode when
-       dictionary is globally changed.
-       Call ispell-internal-change-dictionary after dictionary change.
-
-2006-01-13  Eli Zaretskii  <eliz@gnu.org>
-
-       * emacs-lisp/bytecomp.el (batch-byte-recompile-directory): Doc fix.
-
-       * makefile.w32-in (MH_E_SRC): Synchronize with Makefile.in.
-       (pre-mh-loaddefs.el-SH, pre-mh-loaddefs.el-CMD): Update Copyright
-       years.  Fix small differences wrt Makefile.in.
-       (recompile): Use --eval '(batch-byte-recompile-directory 0)', like
-       Makefile.in does.
-
-2006-01-12  Bill Wohler  <wohler@newt.com>
-
-       * Makefile.in (MH_E_SRC): Replace mh-index.el and mh-pick.el with
-       mh-search.el.
-
-2006-01-12  Masatake YAMATO  <jet@gyve.org>
-
-       * progmodes/ld-script.el: Update copyright year.
-
-2006-01-12  Chong Yidong  <cyd@stupidchicken.com>
-
-       * cus-theme.el (custom-theme-add-variable, custom-theme-add-face):
-       Don't add widget if setting undefined.
-
-2006-01-12  John Paul Wallington  <jpw@pobox.com>
-
-       * help-fns.el (describe-variable): Remove newlines from void
-       variable output.
-
-2006-01-13  Nick Roberts  <nickrob@snap.net.nz>
-
-       * wdired.el (wdired-mode-map): Add help echo for
-       wdired-abort-changes.
-
-       * man.el (Man-file-name-regexp): Adjust for a list of files.
-
-2006-01-12  Masatake YAMATO  <jet@gyve.org>
-
-       * progmodes/ld-script.el (auto-mode-alist): Support
-       suffix conventions used in netbsd and eCos.
-
-2006-01-11  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * cus-edit.el (custom-reset-menu, custom-buffer-create-internal)
-       (custom-variable-menu, custom-face-menu, custom-group-menu)
-       (Custom-mode-menu): Change names of menu items.  (As discussed on
-       emacs-devel.)
-       (custom-face-menu): Add "Undo Edits" item.
-
-       * startup.el (init-file-user): defcustom -> defvar.
-
-       * tooltip.el (tooltip-mode): Doc fix.
-
-2006-01-11  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * reveal.el (reveal-post-command): window-buffer signals an error on
-       dead windows rather than returning nil.
-       (reveal-open-new-overlays): An overlay might die while we open others.
-
-2006-01-11  Bill Wohler  <wohler@newt.com>
-
-       * cus-dep.el (generated-custom-dependencies-file): Fix typo and
-       phrasing in docstring.
-
-       * Makefile.in (MH_E_SRC): Rename from MH-E-SRC since the dashes
-       can give some systems gas.  Add new file mh-buffers.el.
-
-2006-01-06  Masatake YAMATO  <jet@gyve.org>
-
-       * font-lock.el (cpp-font-lock-keywords): Font lock keywords for
-       C preprocessor forward ported from GNU Emacs 21.2.
-
-       * progmodes/asm-mode.el (asm-font-lock-keywords):
-       Use `cpp-font-lock-keywords'.
-
-       * progmodes/ld-script.el (ld-script-font-lock-keywords): Ditto.
-
-       * progmodes/ld-script.el (auto-mode-alist): Use \\> instead
-       of $ for "\\.ld[s]?".
-
-2006-01-10  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/tcl.el (tcl-indent-command): Use indent-for-tab-command.
-       (tcl-indent-line): Return `noindent' if inside a string.
-
-       * progmodes/flymake.el (flymake-split-string): Remove more than one
-       empty string at beg/end of the result.
-       (flymake-find-buildfile, flymake-find-possible-master-files):
-       Use expand-file-name.
-       (flymake-fix-file-name): Don't replace \ with / and don't remove ./
-       since expand-file-name does it for us.  Use directory-file-name.
-       (flymake-ler-get-full-file, flymake-ler-get-file, flymake-ler-get-line)
-       (flymake-ler-get-type, flymake-ler-get-text)
-       (flymake-ler-make-ler): Remove.  Replace by defstruct.  Update callers.
-       (flymake-current-line-no): Remove spurious interactive spec.
-       (flymake-delete-temp-directory): Remove unused var `slash-pos'.
-       (flymake-check-include): Remove arg inc-path merged into inc-name.
-       (flymake-check-patch-master-file-buffer): Fit in 80 columns.
-       Arg regexp-list replaced by a simple regexp.
-       (flymake-master-make-header-init, flymake-master-tex-init):
-       Correspondingly replace regexp-list with a regexp.  Fix regexp.
-
-2006-01-10  Simon Josefsson  <jas@extundo.com>
-
-       * mail/smtpmail.el (smtpmail-try-auth-methods): Add comment
-       describing AUTH PLAIN fix.
-
-2006-01-10  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * mail/emacsbug.el (report-emacs-bug-text-prompt): Delete var.
-       (report-emacs-bug): Don't record initial prompt text.
-       Instead, add text properties to prompting text.
-       (report-emacs-bug-hook): Delete prompting text.
-
-2006-01-09  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/flymake.el (flymake-find-buildfile): Remove invariant arg
-       `dirs'.  Adjust callers.
-
-2006-01-09  John Paul Wallington  <jpw@gnu.org>
-
-       * cus-edit.el (custom-comment) <defface>: Add TTY definitions.
-
-2006-01-09  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * reveal.el (reveal-open-new-overlays): New extracted fun.
-       (reveal-close-old-overlays): Idem.  Check overlays's liveness before
-       using them.  Simplify the code.
-       (reveal-post-command): Use them.  Fix up obsolete windows in
-       reveal-open-spots.
-
-       * progmodes/flymake.el: Use `require' rather than autoload for
-       XEmacs's overlays.
-       (flymake-get-common-file-prefix, flymake-build-relative-filename):
-       Delete.  Use file-relative-name instead.
-       (flymake-get-syntax-check-program-args, flymake-perl-init):
-       Simplify the resulting code.
-
-       * log-view.el (log-view-file-re, log-view-message-re): Add support
-       for DaRCS output.
-
-2006-01-09  Alex Schroeder  <alex@gnu.org>
-
-       * mail/rmail.el (rmail-reply-regexp): Also ignore mailing list
-       identifiers sometimes added in square brackets at the beginning of
-       subject lines.
-
-2006-01-07  Richard M. Stallman  <rms@gnu.org>
-
-       * cus-edit.el (Custom-set, Custom-save): Doc fix.
-       (Custom-reset-current, Custom-reset-saved): Change question text.
-       (Custom-reset-standard): Likewise.
-       (custom-variable-reset-saved): Doc fix.
-
-2006-01-07  Eli Zaretskii  <eliz@gnu.org>
-
-       * startup.el (init-file-user): Doc fix.
-
-2006-01-07  Alex Schroeder  <alex@gnu.org>
-
-       * mail/rmail.el (rmail-current-subject): New function.
-       (rmail-current-subject-regexp): New function.
-       (rmail-next-same-subject): Use it.
-
-       * mail/rmailsum.el (rmail-summary-by-topic):
-       Use rmail-current-subject and rmail-current-subject-regexp.
-       (rmail-summary-next-same-subject): Ditto.
-
-       * net/rcirc.el (rcirc-send-input): No longer check whether the
-       process is open, since not all commands need an open process.
-       (rcirc-send-string): Check whether the process is open before
-       sending anything.
-       (rcirc-ignore-list): New option.
-       (rcirc-ignore-list-automatic): New variable.
-       (rcirc-print): Take rcirc-ignore-list into account.
-       (rcirc-cmd-ignore): New command.
-       (rcirc-ignore-update-automatic): New function.
-       (rcirc-handler-PART, rcirc-handler-QUIT): Use it to maintain the
-       list if ignored nicks.
-       (rcirc-handler-NICK): Ditto, and also ignore the new nick.
-
-2006-01-06  David Reitter  <david.reitter@gmail.com>
-
-       * mail/emacsbug.el (report-emacs-bug): Let explanations correctly
-       reflect the address to which the report will be sent.
-
-2006-01-06  Eli Zaretskii  <eliz@gnu.org>
-
-       * progmodes/ld-script.el (auto-mode-alist): Recognize linker
-       scripts whose file-name extensions are "\.x[bdsru]?[cn]?$".
-
-2006-01-01  Michael Ernst  <mernst@alum.mit.edu>  (tiny changes)
-
-       * textmodes/tildify.el: Fix typos (misspellings) in the commentary.
-
-       * emacs-lisp/find-func.el (find-definition-noselect): Fix typo in
-       the doc string: "functoin" => "function".
-       * ldefs-boot.el: Likewise.
-
-       * textmodes/bibtex.el (bibtex-validate-globally): Fix typo in a
-       message text: "Duplicat" => "Duplicate".
-
-2006-01-06  Sven Joachim  <svenjoac@gmx.de>  (tiny change)
-
-       * files.el (basic-save-buffer-2): If backing-up failed, reset
-       buffer-backed-up to nil.
-
-2006-01-06  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gdb-script-skip-to-head)
-       (gdb-script-calculate-indentation): Indent for breakpoint command
-       lists also.
-
-2006-01-05  Bill Wohler  <wohler@newt.com>
-
-       * Makefile.in (compile-always): Add mh-autoloads dependency.
-       (bootstrap): Remove mh-autoloads dependency, as compile dependency
-       provides it.
-       (updates): Remove mh-autoloads dependency, since it probably has
-       already run recently (via recompile).
-
-2006-01-05  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * textmodes/flyspell.el (flyspell-accept-buffer-local-defs): Add an
-       argument `force' to disable the flyspell-last-buffer optimization.
-       (flyspell-mode-on): Use it.
-
-       * progmodes/flymake.el (flymake-get-cleanup-function): Default to
-       flymake-simple-cleanup.
-       (flymake-allowed-file-name-masks): Use this new default.
-       All the functions are now called in the right buffer rather than
-       passing the buffer as argument.
-       (flymake-process-sentinel): Switch to buffer before calling cleanup.
-       (flymake-parse-err-lines): Remove redundant buffer arg.
-       (flymake-get-program-dir): Comment out unused function.
-       (flymake-start-syntax-check, flymake-start-syntax-check-process):
-       Remove redundant buffer argument.
-       (flymake-get-real-file-name, flymake-simple-java-cleanup)
-       (flymake-simple-cleanup, flymake-master-cleanup): Remove buffer arg.
-
-2006-01-05  Richard M. Stallman  <rms@gnu.org>
-
-       * info.el (Info-find-node): Don't record previous node if have none.
-       (info): Go to directory only if history is empty.
-
-       * simple.el (mark): Doc fix.
-
-2006-01-05  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el (mac-ae-parameter): Don't coerce data if it is
-       already of desired type.
-       (mac-ae-list): Coerce parameter to "list" type.
-       (mac-dispatch-apple-event): Replace cadr part of event with a
-       dummy position so that event-start returns it.
-
-2006-01-05  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-end-of-subtree): New function.
-       (org-cycle, org-subtree-end-visible-p, org-scan-tags):
-       Use `org-end-of-subtree'.
-       (org-agenda, org-agenda-convert-date): Protect calls to
-       `fit-window-to-buffer'.
-       (org-tags-view): Force matching of sublevels when doing a
-       todo-only search.  Define the correct redo command, including the
-       arguments.
-       (org-agenda-redo): Display message.
-       (org-check-for-org-mode): New function.
-       (org-agenda-type): New variable.
-       (org-timeline, org-agenda-list, org-todo-list, org-tags-view):
-       Set `org-agenda-type'.
-       (org-agenda-check-type): New function.
-       (org-agenda-goto-today, org-agenda-later, org-agenda-earlier)
-       (org-agenda-week-view, org-agenda-day-view)
-       (org-agenda-next-date-line, org-agenda-previous-date-line)
-       (org-agenda-log-mode, org-agenda-toggle-diary)
-       (org-agenda-toggle-time-grid, org-agenda-date-later)
-       (org-agenda-date-prompt, org-agenda-diary-entry)
-       (org-agenda-execute-calendar-command, org-agenda-goto-calendar)
-       (org-agenda-convert-date, org-agenda-menu):
-       Use `org-agenda-check-type'.
-       (org-make-overlay, org-delete-overlay)
-       (org-detatch-overlay, org-move-overlay, org-overlay-put):
-       New compatibility functions.
-       (org-calendar-select-mouse): New command.
-
-2006-01-04  Chong Yidong  <cyd@stupidchicken.com>
-
-       * cus-edit.el (Custom-reset-current, Custom-reset-saved)
-       (Custom-reset-standard): Fix y-or-n-p messages.
-       (custom-link): New face for links.
-       (custom-buffer-create-internal, custom-manual): Use it.
-       (custom-face-save): Push to theme-face before setting face spec.
-
-       * wid-edit.el (widget-default-mouse-face-get): New function.
-       (widget-specify-button): Handle mouse-face like button-face.
-
-       * custom.el (load-theme): Clear old theme settings if reloading.
-
-2006-01-03  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * cus-edit.el (custom-buffer-create-internal): Move whole buffer
-       "Erase Customization" button back to same position it occupies in
-       the individual State menus.
-
-2006-01-04  Kim F. Storm  <storm@cua.dk>
-
-       * wid-edit.el (key-sequence): Rework widget to read key binding
-       using `kbd' syntax.  Use C-q to insert literal key, event, or code.
-       (widget-key-sequence-default-value): Default value for empty sequence.
-       (widget-key-sequence-map): New map for reading key binding.  Bind C-q.
-       (widget-key-sequence-read-event): New command for C-q.
-       (widget-key-sequence-validate, widget-key-sequence-value-to-internal)
-       (widget-key-sequence-value-to-external): New functions.
-
-2006-01-03  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/flymake.el (flymake-create-temp-with-folder-structure):
-       Use expand-file-name.
-       (flymake-delete-temp-directory): Use expand-file-name,
-       file-name-directory, and directory-file-name.
-       (flymake-strrchr): Delete.
-       (flymake-start-syntax-check): Don't pass the redundant buffer argument
-       to the init-f function.
-       (flymake-save-buffer-in-file, flymake-init-create-temp-buffer-copy)
-       (flymake-init-find-buildfile-dir)
-       (flymake-init-create-temp-source-and-master-buffer-copy)
-       (flymake-simple-make-init-impl, flymake-simple-make-init)
-       (flymake-master-make-init, flymake-master-make-header-init)
-       (flymake-simple-make-java-init, flymake-simple-ant-java-init)
-       (flymake-perl-init, flymake-simple-tex-init, flymake-master-tex-init)
-       (flymake-xml-init): Remove corresponding redundant buffer argument.
-       (flymake-allowed-file-name-masks): Remove last elems that are equal to
-       the default anyway.  Clean up regexps.
-
-       * progmodes/flymake.el (flymake-temp-source-file-name)
-       (flymake-master-file-name, flymake-temp-master-file-name)
-       (flymake-base-dir): New buffer-local vars.
-       (flymake-buffer-data, flymake-get-buffer-value)
-       (flymake-set-buffer-value): Replace those hash-tables by the new
-       buffer-local vars.  Update callers.
-
-       * progmodes/flymake.el (flymake-check-start-time)
-       (flymake-check-was-interrupted, flymake-err-info, flymake-is-running)
-       (flymake-last-change-time, flymake-new-err-info, flymake-timer):
-       Move definition, so we can remove redundant earlier declaration.
-       (flymake-replace-regexp-in-string, flymake-split-string)
-       (flymake-get-temp-dir): Use defalias.
-       (flymake-popup-menu): Remove `pos' argument.  Use posn-at-point.
-       (flymake-xemacs-window-edges): Remove unused function.
-       (flymake-get-point-pixel-pos): Move.
-       (flymake-pid-to-names, flymake-reg-names)
-       (flymake-get-source-buffer-name, flymake-unreg-names): Remove.
-       Replace by a simple list flymake-processes and by process-buffer.
-       Update callers.  Other than simplify the code, it uses buffers rather
-       than buffer-names so it doesn't get confused by uniquify.
-       (flymake-buffer-data): The global value should just be nil.
-
-       * emacs-lisp/bytecomp.el (byte-compile-file-form-defalias):
-       Optimize the body of a defalias like any other code.
-
-       * font-lock.el (font-lock-fontify-buffer, font-lock-fontify-region):
-       Make sure we've setup font-lock's vars.  It may influence which
-       function we then call.
-       (font-lock-default-fontify-buffer): Don't bother calling set-defaults
-       here since it's too late anyway.
-
-2006-01-03  Romain Francoise  <romain@orebokech.com>
-
-       * startup.el (fancy-splash-tail, normal-splash-screen):
-       Update copyright year.
-
-2006-01-02  J.D. Smith  <jdsmith@as.arizona.edu>
-
-       * mouse.el (mouse-drag-track): Rename, from
-       `mouse-drag-region-1'.  Includes optional argument required to
-       enable post-drag event processing (e.g. delete region keys).
-       Can be used without this argument to track a mouse region and operate
-       on it as soon as the drag completes.
-       (mouse-drag-region): Use `mouse-drag-track'.
-
-2006-01-02  Chong Yidong  <cyd@stupidchicken.com>
-
-       * cus-edit.el (custom-guess-name-alist, custom-guess-doc-alist):
-       Move to `custom-buffer' group.
-
-       * cus-theme.el: Rewrite the Custom New Theme Mode interface.
-       (custom-new-theme-mode-map, custom-theme-insert-variable-marker)
-       (custom-theme-insert-face-marker, custom-theme-variable-menu)
-       (custom-theme-face-menu): New variables.
-       (custom-theme-add-variable, custom-theme-variable-action)
-       (custom-variable-reset-theme, custom-theme-delete-variable)
-       (custom-face-reset-theme, custom-theme-face-action)
-       (custom-theme-delete-face, custom-theme-merge-theme)
-       (custom-theme-add-face, custom-theme-visit-theme): New functions.
-
-2006-01-01  Chong Yidong  <cyd@stupidchicken.com>
-
-       * custom.el: Move Custom Themes commentary to start of theme code.
-       (custom-known-themes): Rename `standard' theme to `changed'.
-       (custom-push-theme): Caller no longer specifies what theme to use
-       when doing `reset'---the setting is simply removed from the theme.
-       Delete MODE from `theme-value' and `theme-settings' properties.
-       (custom-declare-theme): Ignore &rest args since we don't use them.
-
-       (custom-loaded-themes): Delete variable.
-       (custom-theme-load-themes, custom-theme-loaded-p)
-       (custom-theme-value): Delete functions.
-
-       (custom-declare-theme): Signal error on invalid theme names.
-       (provide-theme): custom-loaded-themes was deleted.
-       (load-theme): Load the file unconditionally.
-       (enable-theme): Call `load-theme' if theme is undefined.
-       (custom-enabled-themes): Only update value for successful loads.
-       (disable-theme): Complete from enabled themes when interactive.
-       (custom-variable-theme-value): Calculate theme value directly.
-
-       (custom-theme-reset-variables, custom-reset-variables): Mark as
-       XEmacs compatibility functions.  We don't actually use these.
-
-       * cus-edit.el (custom-variable-state-set):
-       Use custom-variable-theme-value instead of custom-theme-value.
-       (custom-face-state-set): Rename `standard' theme to `changed'.
-       (custom-save-variables, custom-save-faces): Delete unneeded
-       references to custom-reset-variables.
-       (custom-save-resets): Delete function.
-       (custom-save-variables, custom-save-faces): MODE argument deleted.
-       (custom-save-variables, custom-save-faces): Ignore theme values.
-
-       * cus-face.el (custom-theme-reset-faces): Mark as XEmacs
-       compatibility function.
-
-2006-01-01  Richard M. Stallman  <rms@gnu.org>
-
-       * cus-edit.el (Custom-set, Custom-save): Ask for confirmation.
-       (Custom-reset-current, Custom-reset-saved): Likewise.
-       (Custom-reset-standard): Show message if aborted.
-       (custom-mode): Doc fix, describing those commands.
-
-       * mouse.el (mouse-drag-region-1): When following link via mouse-2,
-       put on event-kind property.
-
-2005-12-31  Chong Yidong  <cyd@stupidchicken.com>
-
-       * custom.el (provide-theme): Ban `user' theme name.
-       (custom-enabling-themes): New variable.
-       (enable-theme): Don't enable user if custom-enabling-themes is t.
-       (custom-enabled-themes): Make it a defcustom.
-       (custom-theme-recalc-face): No-op if face is undefined.
-
-       * cus-edit.el (custom-button-mouse): New variable.
-       (custom-button-mouse): New face.
-       (custom-raised-buttons, custom-mode): Use it.
-
-       * cus-theme.el (custom-new-theme-mode): Use custom-button-mouse.
-
-2005-12-31  Eli Zaretskii  <eliz@gnu.org>
-
-       * progmodes/gud.el (gud-display-line): Support hl-line in the
-       source buffer.
-
-2005-12-31  Lennart Borgman  <lennart.borgman.073@student.lu.se>  (tiny change)
-
-       * mouse.el (mouse-drag-window-above): Verify that the found window
-       overlaps with the given window in the horizontal dimension.
-
-2005-12-31  Eli Zaretskii  <eliz@gnu.org>
-
-       * Makefile.in (cvs-update): New target.
-
-       * makefile.w32-in (cvs-update): Ditto.
-
-2005-12-30  Chong Yidong  <cyd@stupidchicken.com>
-
-       * cus-theme.el (custom-new-theme-mode): Use cus-edit faces.
-       (custom-new-theme-mode-map): New variable.
-
-2005-12-30  Richard M. Stallman  <rms@gnu.org>
-
-       * custom.el (custom-load-themes): Function deleted.
-
-       * cus-edit.el (custom-save-loaded-themes): Function deleted.
-       (custom-save-variables): Don't delete or add custom-load-themes call.
-
-2005-12-30  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * cus-start.el: Add `visible-cursor'.
-
-       * progmodes/flymake.el (flymake-copy-buffer-to-temp-buffer): Simplify.
-       (flymake-parse-output-and-residual): Remove `source-buffer' argument.
-       (flymake-process-filter): Switch to buffer before calling it instead.
-       (flymake-post-syntax-check, flymake-highlight-err-lines)
-       (flymake-delete-own-overlays, flymake-parse-err-lines)
-       (flymake-start-syntax-check, flymake-start-syntax-check-process)
-       (flymake-count-lines, flymake-parse-residual):
-       Remove constant buffer argument.
-       (flymake-start-syntax-check-for-current-buffer): Remove.
-       Update callers to use flymake-start-syntax-check instead.
-       (flymake-display-err-menu-for-current-line):
-       Remove unused var `mouse-pos'.
-       (flymake-restore-formatting): Comment out unused function.
-       (flymake-report-status, flymake-report-fatal-status): Remove buffer
-       argument, use current-buffer instead.  Update callers.
-
-2005-12-30  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
-
-       * textmodes/bibtex.el (bibtex-mode): Make completion-ignore-case
-       buffer-local because choose-completion-delete-max-match requires
-       that we set completion-ignore-case (i.e., binding via let is not
-       sufficient).
-       (bibtex-complete): Always set completion-ignore-case and
-       choose-completion-string-functions.  The latter is needed because
-       choose-completion-string-functions keeps its value if we quit the
-       *Completions* buffer without requesting a completion.
-
-2005-12-30  Andreas Schwab  <schwab@suse.de>
-
-       * progmodes/cc-defs.el: Ignore errors from font-lock-compile-keywords.
-
-2005-12-30  Eli Zaretskii  <eliz@gnu.org>
-
-       * jit-lock.el (jit-lock-chunk-size): Doc fix.
-
-2005-12-30  Juri Linkov  <juri@jurta.org>
-
-       * locate.el (locate-fcodes-file, locate-header-face)
-       * progmodes/delphi.el (delphi-other-face)
-       * progmodes/glasses.el (glasses-face): Add tag "None" to const nil.
-
-       * paren.el (show-paren-match, show-paren-mismatch): Use existing
-       group `paren-showing-faces'.
-
-       * net/goto-addr.el (goto-address-highlight-keymap): Fix docstring.
-       (goto-address): Fix docstring.
-
-       * net/webjump.el (webjump-sample-sites): Update URLs.
-
-       * textmodes/fill.el (fill-single-word-nobreak-p): Use `sentence-end'.
-
-       * subr.el (cancel-change-group): Add listp around pending-undo-list.
-
-2005-12-29  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * font-lock.el (font-lock-compile-keywords): Signal an error when
-       font-lock-set-defaults hasn't been called.
-
-2005-12-29  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * subr.el (noreturn, 1value): Doc fixes.
-
-2005-12-29  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
-
-       * textmodes/bibtex.el (bibtex-text-in-field-bounds): Handle case
-       that assoc-string returns nil.
-
-2005-12-29  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
-
-       * textmodes/bibtex.el (bibtex-entry-type-whitespace)
-       (bibtex-entry-type-str, bibtex-empty-field-re)
-       (bibtex-search-backward-string, bibtex-preamble-prefix)
-       (bibtex-search-entry, bibtex-enclosing-entry-maybe-empty-head): Remove.
-       (bibtex-any-valid-entry-type): New variable.
-       (bibtex-parse-field-name): Simplify.
-       (bibtex-parse-string, bibtex-search-forward-string): New arg empty-key.
-       (bibtex-preamble-prefix): Include left delimiter.
-       (bibtex-search-forward-field, bibtex-search-backward-field):
-       Allow unbounded search past entry boundaries (required by bibtex-pop).
-       (bibtex-text-in-field-bounds): Use push.
-       (bibtex-text-in-field): Do not use bibtex-narrow-to-entry.
-       (bibtex-parse-preamble, bibtex-valid-entry)
-       (bibtex-beginning-first-field): New functions.
-       (bibtex-skip-to-valid-entry): Use bibtex-valid-entry.  Fix regexp.
-       (bibtex-map-entries): Fix docstring.
-       (bibtex-flash-head): New arg prompt.  Simplify.
-       (bibtex-enclosing-field): Include code of bibtex-inside-field.
-       (bibtex-insert-kill): Simplify.  Always insert text past the
-       current field or entry.
-       (bibtex-format-entry): Use bibtex-parse-field.
-       (bibtex-pop): Use bibtex-beginning-of-entry and
-       bibtex-end-of-entry to initiate the search.  Insert empty field if
-       we found ourselves.
-       (bibtex-print-help-message): New args field and comma.
-       Handle entry keys.
-       (bibtex-make-field): Use bibtex-beginning-of-entry.
-       (bibtex-end-of-entry): Use bibtex-valid-entry.  Recognize any
-       invalid entry.
-       (bibtex-validate): Use bibtex-valid-entry and bibtex-parse-string.
-       Handle preambles.  Simplify code for thorough test.
-       (bibtex-next-field, bibtex-find-text, bibtex-find-text-internal):
-       New arg comma.  Handle entry heads.
-       (bibtex-remove-OPT-or-ALT, bibtex-remove-delimiters)
-       (bibtex-kill-field, bibtex-copy-field-as-kil, bibtex-empty-field):
-       New arg comma.
-       (bibtex-kill-entry): Use bibtex-any-entry-maybe-empty-head.
-       (bibtex-fill-field): Simplify.
-       (bibtex-fill-entry): Use bibtex-beginning-first-field and
-       bibtex-parse-field.
-       (bibtex-convert-alien): Do not wait before calling bibtex-validate.
-       (bibtex-complete): Use bibtex-parse-preamble.
-
-2005-12-29  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-tooltip-print, gdb-tooltip-print-1):
-       Display name of expression instead of convenience variable.
-       (gdb-post-prompt): Only call gdb-get-changed-registers if needed.
-
-       * progmodes/gud.el (gud-tooltip-dereference): Rename from
-       toggle-gud-tooltip-dereference.
-       (gud-tooltip-print-command): Move concatenation of "*" to expr to...
-       (gud-tooltip-tips): ...here when dereferencing.
-
-2005-12-28  Bill Wohler  <wohler@newt.com>
-
-       * simple.el (mh-e-user-agent): Move to mh-e/mh-comp.el and autoload.
-
-2005-12-28  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * vc.el (vc-annotate-display): Replace optional arg `color-map' with
-       compulsory arg `ratio'.  Inline body of vc-annotate-time-span.
-       (vc-annotate-display-autoscale): Adjust call.
-       (vc-annotate-display-default): Adjust call.  Make arg compulsory.
-       Fix interactive spec.
-       (vc-annotate-time-span): Remove.
-       (vc-annotate-oldest-in-map): Rename from vc-annotate-car-last-cons.
-       (vc-annotate-mode-menu, vc-annotate-display-autoscale)
-       (vc-annotate-display-select): Use new name.
-
-       * vc.el (vc-annotate-mode-map): Remove obsolete binding.
-       (vc-annotate-mode-menu): Remove left-over redundant declaration.
-       Correct the construction of span entries.  Simplify.
-       (vc-annotate-display-select): Fix the nil case.
-       (vc-annotate): Remove obsolete (and now broken) code.
-       (vc-annotate-extract-revision-at-line): Remove obsolete code.
-       (vc-annotate-time-span): Remove unused arg `quantize'.  Simplify.
-
-2005-12-28  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * subr.el (lazy-completion-table): Correct typo in docstring.
-
-       * startup.el (command-line): Use `custom-reevaluate-setting' for
-       `send-mail-function'.
-
-       * mail/sendmail.el (send-mail-function): Autoload the standard-value.
-
-2005-12-05  Ralf Angeli  <angeli@iwi.uni-sb.de>
-
-       * mail/smtpmail.el (smtpmail-try-auth-methods):
-       Send credentials together with "AUTH PLAIN" command.
-
-2005-12-27  Richard M. Stallman  <rms@gnu.org>
-
-       * mouse.el (mouse-drag-region-1): When remapping mouse-1 to
-       mouse-2, go back to previously selected window, so it's selected
-       when mouse-2 command runs.
-
-2005-12-27  Juri Linkov  <juri@jurta.org>
-
-       * descr-text.el (describe-text-sexp): Use square brackets for
-       button [Show] to distinguish it from the property value `show'.
-       (describe-property-list): Use `insert-text-button' with
-       `help-face' type instead of putting face in quotes, because button
-       is not created automatically for a list of faces.
-       (describe-text-properties-1): Put button-type value in quotes to
-       distinguish from plain text "button".
-       (describe-char): Display code point values in hex.  Don't use
-       `symbol-name' for `current-input-method' because it is a string.
-       Use `insert-text-button' with `help-face' type instead of putting
-       hardcoded face in quotes, because button is not created automatically.
-
-2005-12-27  Richard M. Stallman  <rms@gnu.org>
-
-       * progmodes/glasses.el (glasses-face): More specific custom type.
-
-       * files.el (set-visited-file-name): Doc fix.
-
-       * textmodes/flyspell.el (flyspell-external-point-words):
-       Use local var buffer-scan-pos to advance scan for next misspelling.
-       Advance it only after we find the misspelling.
-
-2005-12-27  Agustin Martin  <agustin.martin@hispalinux.es>
-
-       * textmodes/flyspell.el (flyspell-external-point-words):
-       New criteria for finding the misspelling in the buffer.
-
-2005-12-27  Nick Roberts  <nickrob@snap.net.nz>
-
-       * help-mode.el (help-insert-string): Set help-xref-stack-item
-       rather than call help-setup-xref.
-
-       * descr-text.el (describe-char): Revert previous changes for
-       optional buffer argument.
-
-2005-12-27  Juri Linkov  <juri@jurta.org>
-
-       * help-mode.el (help-insert-string): New function.  Save buffer
-       contents in cases where it is impossible to recompute the old contents.
-
-       * descr-text.el (describe-char): Set help-xref-stack-item
-       explicitly after buffer has been generated.
-
-2005-12-27  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * cus-start.el (all): Add x-gtk-show-hidden-files.
-
-2005-12-26  Richard M. Stallman  <rms@gnu.org>
-
-       * replace.el (perform-replace): Calculate match-again
-       before skipping read-only matches.
-
-       * paren.el (paren-showing-faces): New group.
-       (show-paren-match, show-paren-mismatch): Move to that group.
-
-       * button.el (button): Put into group `basic-faces'.
-
-       * progmodes/make-mode.el: Remove faces from group `faces'.
-
-       * apropos.el (apropos, apropos-value): Doc fix.
-       (apropos-documentation): Doc fix.
-
-2005-12-26  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * subr.el (lazy-completion-table): Remove argument `args'.
-
-       * textmodes/bibtex.el (bibtex-strings, bibtex-reference-keys):
-       Don't use the `args' argument of lazy-completion-table.
-
-2005-12-26  Nick Roberts  <nickrob@snap.net.nz>
-
-       * descr-text.el (describe-char): Add optional argument for buffer.
-       Set buffer appropriately.  Call help-setup-xref.
-       Suggested by Stefan Monnier.
-
-2005-12-26  Juri Linkov  <juri@jurta.org>
-
-       * descr-text.el: Require `help-fns' at runtime.  Don't require
-       `button' for byte compilation.
-       (describe-text-widget): Add `help-echo' for first button.
-       Use `help-info' for second.
-       (describe-property-list): Use `help-argument-name' instead of `italic'.
-       (describe-text-category): Add prompt to interactive spec.
-       Call `help-setup-xref'.
-       (describe-char): Use `help-character-set'.  Add `help-echo' for
-       code point.  Use `help-input-method'.  Remove superfluous insert.
-
-2005-12-25  Richard M. Stallman  <rms@gnu.org>
-
-       * progmodes/cc-defs.el (c-emacs-features): Do parse-partial-sexp
-       at point, in case of narrowing.
-
-       * progmodes/delphi.el (delphi-other-face): Allow nil in type.
-
-       * locate.el (locate-header-face): Allow nil in type.
-
-       * progmodes/cpp.el (cpp-face-none-list): Use cpp-face instead of face.
-
-2005-12-25  Romain Francoise  <romain@orebokech.com>
-
-       * battery.el (battery-linux-proc-acpi): Also try
-       `/proc/acpi/thermal_zone/THM0/temperature'.
-
-2005-12-24  Chong Yidong  <cyd@stupidchicken.com>
-
-       * custom.el (custom-push-theme): Fix docstring.
-
-       * cus-edit.el (custom-variable-set, custom-variable-save)
-       (custom-variable-save): Custom-quote widget values.
-       (customize-save-variable): Fix custom-push-theme call.
-
-2005-12-24  Eli Zaretskii  <eliz@gnu.org>
-
-       * w32-fns.el (w32-batch-update-autoloads): New function.
-
-       * makefile.w32-in (autoloads, $(lisp)/mh-e/mh-loaddefs.el):
-       Use w32-batch-update-autoloads, and don't setq generated-autoload-file
-       from the command line.
-
-2005-12-23  Chong Yidong  <cyd@stupidchicken.com>
-
-       * custom.el (custom-push-theme): Clarify docstring.  VALUE nil for
-       reset means to remove setting from theme entirely.  Don't keep
-       expanding theme-settings list; delete old entries if necessary.
-
-       * cus-edit.el (custom-buffer-create-internal): Move "Erase
-       customization" button one line up.
-       (custom-themed): New face.
-       (custom-magic-alist): New value, THEMED, for theme settings.
-       (custom-variable-state-set, custom-face-state-set):
-       Check theme-value instead of saved-value.
-       (custom-variable-reset-standard, custom-face-reset-standard):
-       Remove theme setting entirely.  Recalculate new values.
-       (custom-variable-set, custom-variable-set)
-       (custom-variable-reset-saved, custom-variable-reset-backup)
-       (custom-face-set, custom-face-reset-saved): Update `user' theme.
-       (custom-variable-save): Fix typos.
-
-2005-12-23  Juri Linkov  <juri@jurta.org>
-
-       * emacs-lisp/edebug.el (edebug-all-defs, edebug-all-forms):
-       Add autoload cookies.
-       (edebug-outside-d-c-i-n-s-w): New variable.
-       (edebug-display, edebug-outside-excursion): Use it to save the
-       original value of default-cursor-in-non-selected-windows.
-       Set default-cursor-in-non-selected-windows to t while Edebug
-       is active.
-       (edebug-mode, edebug-eval-mode): Doc fix.
-
-       * mouse.el (mouse-choose-completion): Replace `buffer-substring'
-       with `buffer-substring-no-properties' to remove common substring
-       highlighting.
-
-       * info.el (info-other-window, info): Rename function argument
-       `file' to `file-or-node'.
-       (Info-complete-menu-item): Use local variable `complete-nodes' to
-       keep the global value of `Info-complete-nodes' unchanged for
-       subsequent completions.
-       (info-tool-bar-map): Put `Info-index' icon just before `Info-search'.
-
-       * simple.el (get-next-valid-buffer, last-buffer)
-       (next-error-buffer-p, next-error-find-buffer)
-       (minibuffer-history-sexp-flag): Doc fix.
-
-       * savehist.el (savehist-mode-hook): Add `:group'.
-
-       * log-view.el: Call autoload for vc-find-version.
-       (log-view-current-file): Adjust subgroup numbers.
-       (log-view-current-tag): Add `length'.
-
-2005-12-23  Richard M. Stallman  <rms@gnu.org>
-
-       * vc.el (vc-annotate-car-last-cons): Defn moved up.
-
-2005-12-23  Juri Linkov  <juri@jurta.org>
-
-       * hi-lock.el (hi-lock-archaic-interface-message-used)
-       (hi-lock-archaic-interface-deduce, hi-lock-mode): Doc fix.
-       (hi-lock-mode): Display "Hi" in the mode line only when
-       hi-lock-interactive-patterns or hi-lock-file-patterns is non-nil.
-       (hi-lock-write-interactive-patterns):
-       Use hi-lock-file-patterns-prefix instead of hard-coded "Hi-lock".
-       (hi-lock-set-pattern, hi-lock-set-file-patterns)
-       (hi-lock-font-lock-hook): Set 3rd arg `how' of
-       font-lock-add-keywords to t.
-
-2005-12-23  David Koppelman  <koppel@ece.lsu.edu>
-
-       * hi-lock.el (hi-lock-highlight-range): New variable.
-       (hi-lock-mode, hi-lock-unface-buffer): Call font-lock-fontify-buffer
-       only if font-lock-fontified is non-nil.  Remove overlays.
-       (hi-lock-set-pattern): Call font-lock-fontify-buffer if
-       font-lock-fontified is non-nil, otherwise use overlays (instead of
-       text properties).
-       (hi-lock-string-serialize-hash, hi-lock-string-serialize-serial):
-       New variables.
-       (hi-lock-string-serialize): New function.
-
-2005-12-23  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * menu-bar.el (menu-find-file-existing): New function.
-       (menu-bar-file-menu): Use menu-find-file-existing for Open.
-
-       * tool-bar.el (tool-bar-setup): Open changed to menu-find-file-existing.
-
-2005-12-22  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * vc.el: Remove unnecessary leading * in docstrings.
-       (vc-annotate-mode-map): Move initialization into declaration.
-       (vc-static-header-alist): Nitpick on the regexp.
-       (vc-default-init-version): New fun.
-       (vc-register): Use it.
-       (vc-insert-headers): Use dolist.
-       (vc-annotate-get-backend): Remove unused function.
-       (vc-annotate-add-menu): Remove.  Build the menu directly at toplevel.
-       (vc-annotate-mode): Remove corresponding call.
-       (vc-annotate-car-last-cons): Simplify.
-       (vc-annotate-buffers): Remove var.
-       (vc-annotate-backend): Make it buffer-local.
-       (vc-annotate): Move the interaction to the interactive spec.
-       Add a `buf' argument.
-       (vc-annotate-warp-version): Use this new `buf' argument to avoid
-       killing&creating a vc-annotate buffer, which is very disruptive when
-       the buffers are shown in dedicated frames.
-
-2005-12-23  Nick Roberts  <nickrob@snap.net.nz>
-
-       * descr-text.el: Add FSF as maintainer.
-       (describe-text-mode, describe-text-mode-map)
-       (describe-text-mode-hook, describe-text-done): Delete.  Use normal
-       help-mode.
-       (describe-text-widget, describe-text-sexp)
-       (describe-property-list, describe-text-category)
-       (describe-text-properties, describe-text-properties-1)
-       (describe-char): Use help buttons instead of widgets.
-       (describe-char-unicodedata-file): Make URL link in doc string.
-
-2005-12-22  Richard M. Stallman  <rms@gnu.org>
-
-       * cus-edit.el (custom-variable-prompt): Say "variable" in prompt.
-       (custom-buffer-create-internal): Reword the top-of-buffer help intro.
-       Don't include buttons that write a file when there's no file.
-       (custom-variable-menu, custom-face-menu, custom-group-menu):
-       Don't include commands that write a file when there's no file.
-       (customize-browse): Reword the top-of-buffer help intro.
-       (custom-buffer-create-internal): Fix previous change.
-       (customize-changed-options-previous-release): Prev release is 21.1.
-       (customize-changed-options): Doc fix.
-       (customize-changed): New alias.
-       (custom-reset-menu, custom-magic-alist, Custom-mode-menu):
-       Say "standard values".
-       (Custom-reset-standard): Doc fix.
-       (custom-face-reset-standard): Doc fix.
-
-2005-12-22  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * font-lock.el (font-lock-default-fontify-buffer): Try and set-defaults
-       even if font-lock-mode is non-nil since it may be t without having
-       turned on font-lock-mode-internal.
-       (font-lock-choose-keywords): Minor optimization.
-       (font-lock-add-keywords, font-lock-remove-keywords)
-       (font-lock-set-defaults): Don't call make-local-variable on a variable
-       that we know to already be local.
-
-2005-12-22  Katsumi Yamaoka  <yamaoka@jpl.org>
-
-       * emacs-lisp/lisp.el (lisp-complete-symbol): Don't print progress
-       messages if in the minibuffer.
-
-2005-12-21  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * textmodes/flyspell.el (flyspell-check-word-p): Don't quote - in a RE.
-       (tex-mode-flyspell-verify, flyspell-get-word)
-       (flyspell-external-point-words): Don't use point-min/max uselessly.
-
-       * emacs-lisp/lisp.el (lisp-complete-symbol): Mostly undo the change
-       by Kevin Rodgers.  Instead, just hide the completions buffer if we
-       don't need to show it.
-
-2005-12-21  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * wid-edit.el (file, directory): Doc fixes for the `define-widget's.
-
-2005-12-21  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * emacs-lisp/lisp.el (lisp-complete-symbol): Don't call
-       delete-windows-on with an inexistent buffer.
-
-2005-12-22  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-tooltip-modes, gud-tooltip-display):
-       Delete defcustom variable :tag names.
-
-2005-12-20  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * log-view.el (log-view-file-re, log-view-message-re): Use shy groups.
-       (log-view-font-lock-keywords): Ajust subgroup numbers.
-       (log-view-current-tag): Don't hard code the number of subgroups.
-
-2005-12-20  Juri Linkov  <juri@jurta.org>
-
-       * tooltip.el (tooltip): Move defgroup before define-minor-mode.
-       (tooltip-x-offset, tooltip-y-offset): Doc fix.
-
-       * menu-bar.el (menu-bar-menu-frame-live-and-visible-p)
-       (menu-bar-non-minibuffer-window-p): Instead of checking
-       display-multi-frame-p, use selected-frame when menu-updating-frame
-       is nil.
-
-2005-12-20  Stuart Herring  <herring@lanl.gov>  (tiny change)
-
-       * align.el (align-rules-list): Use [ \t] instead of \s-
-       for column separators in text mode.
-
-2005-12-20  Nick Roberts  <nickrob@snap.net.nz>
-
-       * help-mode.el (help-customize-variable, help-customize-face):
-       Don't pop help-xref-stack as help-follow no longer pushes
-       anything on to it.
-
-2005-12-20  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-agenda-custom-commands): New option.
-       (org-agenda): Offer custom commands on splash screen.
-       (org-make-tags-matcher): Parser for Boolean logic added.
-       (org-agenda-set-tags): New command.
-       (org-agenda-menu, org-agenda-mode-map): Add `org-agenda-set-tags'.
-       (org-set-tags): Efficiency improvements.
-       (org-auto-align-tags): New option.
-       (org-todo, org-demote, org-promote): Realign tags.
-       (org-tags-completion-function): Use also "&" and "|" as separators.
-       (org-org-menu): Agenda commands simplified.
-
-2005-12-19  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * cus-edit.el (customize-apropos, customize-apropos-options):
-       Docstring changes.
-
-       * font-lock.el (font-lock): Add tags to the links in the defgroup.
-
-2005-12-19  Chong Yidong  <cyd@stupidchicken.com>
-
-       * longlines.el (longlines-mode): Wrap while widened.
-       (longlines-decode-region, longlines-encode-region): Compute max
-       just once.
-
-2005-12-19  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * cus-edit.el (mac): New group.
-
-       * cus-start.el (all): Add user options in macterm.c.  Add test for
-       Mac-related built-ins.  Fix test for GTK-related built-ins.
-
-       * term/mac-win.el (mac-handle-language-change)
-       (mac-ae-open-documents, mac-ae-get-url, mac-services-open-file)
-       (mac-services-open-selection, mac-services-mail-selection)
-       (mac-services-mail-to, mac-services-insert-text)
-       (mac-dispatch-apple-event): Add docstrings.
-       (x-get-selection, mac-select-convert-to-string): Select coding
-       system from `utf-16be' and `utf-16le' using `byteorder'.
-
-2005-12-18  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * subr.el (lazy-completion-table): Don't be fooled if the var holds
-       a "list" (lambda ...) rather than a real completion list.
-
-       * emacs-lisp/cl-extra.el (cl-macroexpand-all): Fix code-walk for
-       lexical-let when encountering ((lambda (...) ...) ...).
-
-2005-12-17  Chong Yidong  <cyd@stupidchicken.com>
-
-       * progmodes/sh-script.el (sh-mode):
-       * language/ethio-util.el (ethio-fidel-to-sera-mail-or-marker):
-       * textmodes/picture.el (picture-mode): Update docstrings.
-
-2005-12-17  Eli Zaretskii  <eliz@gnu.org>
-
-       * makefile.w32-in (autoloads, custom-deps): Warn that parts of
-       commands enclosed in $(ARGQUOTE)s should not be split between two
-       lines, as that will break with GNU Make >3.80, when sh.exe is used
-       and arg quoting is with '..'.
-       (autoloads): Don't break the quoted --eval expression between
-       several lines.
-
-2005-12-17  Chong Yidong  <cyd@stupidchicken.com>
-
-       * emacs-lisp/edebug.el (edebug-safe-prin1-to-string):
-       Capture error from printing circular structures.
-
-2005-12-17  Martin Rudalics  <rudalics@gmx.at>
-
-       * wid-edit.el (widget-checkbox-action): Clear undo info.
-
-2005-12-16  Bill Wohler  <wohler@newt.com>
-
-       * menu-bar.el (kill-this-buffer): Set a good example by using menu
-       bar, not menubar in comment.
-
-2005-12-16  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/cc-engine.el (c-after-change-check-<>-operators):
-       After-change-functions should not clobber the match data.
-
-2005-12-16  Juri Linkov  <juri@jurta.org>
-
-       * simple.el (choose-completion): Use `buffer-substring-no-properties'
-       instead of `buffer-substring'.
-       (completion-common-substring): Doc fix.
-       (completion-setup-function): Use minibuffer-completion-contents
-       instead of minibuffer-contents.  Don't set common-string-length
-       initially.  Remove special handling of partial-completion-mode.
-       Move computation of completion-base-size into one cond.
-       Call completion-base-size-function in mainbuf.  In computation of
-       completion-base-size for file name completion don't move point to
-       the end of the minibuffer.  Move computation of common-string-length
-       into one cond.  Start putting faces only when common-string-length>=0.
-       Add condition to put completions-common-part when
-       common-string-length>0.
-
-       * complete.el (PC-do-completion): Remove `(equal (point) beg)' to
-       place point at the first different character in the minibuffer
-       even if this position is at the beginning of the minibuffer.
-
-       * info.el (Info-read-node-name-1): In completion-base-size-function's
-       lambda return 1 if common-substring or minibuffer-completion-contents
-       starts with (, and 0 otherwise.
-
-       * emacs-lisp/crm.el (crm-minibuffer-completion-help):
-       Use `crm-current-element' for second arg of `display-completion-list'.
-
-2005-12-16  Klaus Zeitler  <kzeitler@lucent.com>
-
-       * files.el (set-auto-mode): Look for an interpreter specified on
-       the first line also if search for mode specification succeeded,
-       but the mode is not known.
-
-2005-12-16  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-tags-match-list-sublevels): New option.
-       (org-open-at-point): Implement tag searches as links.
-       (org-fit-agenda-window, org-get-buffer-tags, org-get-tags)
-       (org-make-tags-matcher, org-scan-tags, org-activate-tags): New funs.
-       (org-tags-sparse-tree, org-tags-view, org-set-tags)
-       (org-agenda-dispatch): New commands.
-       (org-use-tag-inheritance, org-tags-column): New options.
-       (org-tab-follows-link, org-return-follows-link): New options.
-       (org-tags): New customize group.
-       (org-start-icalendar-file): Get local time zone.
-       (org-tags-completion-function): New function.
-       (org-set-font-lock-defaults): Make sure links will also be
-       highlighted inside headlines.
-
-2005-12-16  Mark Plaksin  <happy@usg.edu>  (tiny change)
-
-       * term.el (term-emulate-terminal):
-       Let term-handle-ansi-terminal-messages override what Bash says about
-       its current directory.
-
-2005-12-16  K\e,Aa\e(Broly L\e$,1 q\e(Brentey  <lorentey@elte.hu>
-
-       * bindings.el (last-buffer): Move to simple.el.
-       * simple.el (last-buffer): Move here.
-       (get-next-valid-buffer): New function.
-       (next-buffer): Use frame-local buffer list, maintain buried buffer list.
-       (prev-buffer): Ditto.  Rename to `previous-buffer'.
-
-       * menu-bar.el (menu-bar-update-buffers): Update uses of `prev-buffer'.
-       * bindings.el (global-map): Ditto.
-
-2005-12-15  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * cus-edit.el: Introductory comment change.
-       (custom-magic-alist): Change message string for the `rogue' state.
-
-2005-12-15  Richard M. Stallman  <rms@gnu.org>
-
-       * tooltip.el: Delete defcustom variable :tag names.
-
-       * complete.el (partial-completion-mode): Doc fix.
-
-       * textmodes/flyspell.el (flyspell-external-point-words):
-       Use save-excursion to ensure we don't move backward in the
-       search loop, not even one character.
-       (flyspell-delete-all-overlays): Use remove-overlays directly.
-
-       * textmodes/ispell.el (ispell-current-personal-dictionary): New var.
-       (ispell-start-process): Set that variable.
-       Clear ispell-buffer-local-name.
-       (ispell-internal-change-dictionary):
-       Set ispell-current-dictionary after killing process.
-       (ispell-buffer-local-dict):
-       Don't set spell-personal-dictionary after killing process.
-       (ispell-buffer-local-words): Don't clear out ispell-buffer-local-name.
-       (ispell-tex-skip-alists, ispell-html-skip-alists)
-       (ispell-skip-region-alist): Mark as risky.
-
-       * net/newsticker.el (newsticker--retrieval-timer-list)
-       (newsticker--display-timer, newsticker-running-p)
-       (newsticker-ticker-running-p): Definitions moved up.
-
-2005-12-16  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-many-windows): Echo new state in minibuffer.
-
-2005-12-15  David Ponce  <david@dponce.com>
-
-       * recentf.el (recentf-dialog-goto-first): Fix missing error condition.
-       (recentf-edit-list, recentf-open-files): Signal an error when
-       there is no recent file.
-
-2005-12-14  Lennart Borgman  <lennart.borgman.073@student.lu.se>
-
-       * textmodes/texinfmt.el (texinfo-format-region): Set buffer to
-       read-only except for texinfo-format-region evaluation.
-
-2005-12-14  Richard M. Stallman  <rms@gnu.org>
-
-       * vc.el (vc-default-previous-version, vc-default-next-version)
-       (vc-do-command): Doc fixes.
-
-2005-12-14  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
-
-       * textmodes/bibtex.el (bibtex-expand-strings)
-       (bibtex-autokey-expand-string, bibtex-name-part)
-       (bibtex-entry-type-whitespace, bibtex-entry-type-str)
-       (bibtex-any-entry-maybe-empty-head, bibtex-string-type)
-       (bibtex-preamble-prefix, bibtex-string-empty-key): New variables.
-       (bibtex-entry-type, bibtex-entry-head): Match only valid entries.
-       (bibtex-entry-postfix, bibtex-known-entry-type-re)
-       (bibtex-valid-entry-re, bibtex-any-valid-entry-re)
-       (bibtex-valid-entry-whitespace-re, bibtex-empty-field-re)
-       (bibtex-field-name-for-parsing, bibtex-remove-delimiters-string)
-       (bibtex-beginning-of-last-entry): Remove.
-       (bibtex-parse-field-name): Use bibtex-field-name.  Issue error
-       message if comma is missing but buffer is read-only.
-       (bibtex-parse-field-text): Handle whitespaces at the end of field
-       text.  Return 3-element list with beginning and end of field text
-       and end of field.
-       (bibtex-end-of-text-in-field, bibtex-end-of-field): Change accordingly.
-       (bibtex-parse-field): Remove arg name.  Use bibtex-field-name.
-       (bibtex-search-forward-field, bibtex-search-backward-field):
-       Search always delimited by limits of entry.  Use more efficient
-       search algorithms.
-       (bibtex-name-in-field): Use bibtex-start-of-name-in-field and
-       bibtex-end-of-name-in-field.
-       (bibtex-text-in-field-bounds): Handle BibTeX strings when
-       extracting the content of a field.
-       (bibtex-text-in-field): Use search limits.
-       (bibtex-parse-string-prefix): Handle empty string keys based on
-       bibtex-string-empty-key.
-       (bibtex-parse-string): Fix docstring.
-       (bibtex-text-in-string): Use bibtex-text-in-field-bounds.
-       (bibtex-preamble-prefix, bibtex-strings): New functions.
-       (bibtex-skip-to-valid-entry): Include preceding whitespace in
-       BibTeX entries (consistent with other BibTeX functions).
-       (bibtex-map-entries): Use bibtex-skip-to-valid-entry.
-       (bibtex-search-entry): Fix docstring.  Simplify.
-       (bibtex-flash-head, bibtex-complete-string-cleanup)
-       (bibtex-count-entries, bibtex-sort-buffer): Simplify.
-       (bibtex-beginning-of-first-entry): Use bibtex-skip-to-valid-entry.
-       (bibtex-parse-entry): New optional arg content.
-       (bibtex-format-entry, bibtex-autofill-entry, bibtex-url): Use it.
-       Use bibtex-text-in-field-bounds.
-       (bibtex-print-help-message): Handle BibTeX strings and preambles.
-       (bibtex-end-of-entry): Use bibtex-preamble-prefix and
-       bibtex-parse-string-postfix.
-       (bibtex-find-text-internal): New function.
-       (bibtex-remove-delimiters): Use it.
-       (bibtex-find-text): Use it.  New optional arg help.
-       (bibtex-complete): Handle BibTeX string and preamble entries.
-       (bibtex-Preamble): Fix order of closing delimiters.
-
-2005-12-14  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * vc.el (vc-default-revert): New fun.
-
-       * vc-mcvs.el (vc-mcvs-revert): Fix call to vc-default-revert.
-
-2005-12-14  Romain Francoise  <romain@orebokech.com>
-
-       * font-lock.el (font-lock-keywords-alist): Rename `append' to `how'.
-       (font-lock-add-keywords, font-lock-update-removed-keyword-alist):
-       (font-lock-remove-keywords): Likewise.
-
-2005-12-14  Juri Linkov  <juri@jurta.org>
-
-       * log-view.el (log-view-diff): Doc fix.
-
-       * isearch.el (isearch-query-replace): Use (mark) instead of
-       isearch-opoint if mark is active in transient-mark-mode.
-
-2005-12-14  Aaron S. Hawley  <Aaron.Hawley@uvm.edu>
-
-       * isearch.el (isearch-query-replace): Check for isearch-other-end.
-
-2005-12-14  Per Abrahamsen  <abraham@dina.kvl.dk>
-
-       * progmodes/cpp.el (cpp-face): New widget.
-       (cpp-known-face, cpp-unknown-face, cpp-edit-list): Use it.
-
-2005-12-14  Juri Linkov  <juri@jurta.org>
-
-       * help-macro.el (make-help-screen): Bind `inhibit-read-only' to t
-       around `erase-buffer' and `insert'.
-
-       * descr-text.el (describe-text-properties): Replace buffer name
-       "*Help-2*" with "*Help*<2>".
-       (describe-char): Add functions print-help-return-message,
-       toggle-read-only.  Use help-setup-xref with nil to not store
-       describe-char in help-xref-stack.  Use help-make-xrefs to
-       make [back] button.
-
-       * desktop.el (desktop-minor-mode-table): Add vc-dired-mode with nil.
-
-       * wdired.el (wdired-old-point): New internal variable.
-       (wdired-change-to-wdired-mode): Set it buffer-locally.
-       (wdired-abort-changes): Restore point after aborting changes.
-
-2005-12-13  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * vc.el (vc-do-command): Add a new value t for okstatus.
-
-       * vc-svn.el (vc-svn-registered): Use it to avoid popping up a spurious
-       frame in case of errors.
-
-2005-12-13  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * menu-bar.el (menu-bar-showhide-fringe-menu): Move "On the Right"
-       so it comes after "On the Left" in the menu.
-
-2005-12-12  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * cus-edit.el (customize-apropos, customize-apropos-options)
-       (customize-apropos-faces, customize-apropos-groups): Doc fixes.
-
-2005-12-12  Bill Wohler  <wohler@newt.com>
-
-       * vc-svn.el (vc-svn-registered): Fix problem of visiting
-       non-writable Subversion-controlled files by saving window
-       configuration before calling vc-do-command.  vc-do-command calls
-       pop-to-buffer on error which is unexpected during registration.
-
-2005-12-12  Jay Belanger  <belanger@truman.edu>
-
-       * calc/README: Update the summary of changes.
-
-2005-12-12  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * descr-text.el (describe-char): Rework last fix to solve the problem
-       is the same way it's solved for everything else in that function
-       (i.e. by extracting the info before setting up the *Help* buffer).
-
-2005-12-12  Kim F. Storm  <storm@cua.dk>
-
-       * subr.el (version-regexp-alist): Allow space as separator before
-       non-numeric part, e.g. "1.0 alpha".
-       (version-to-list): Interpret .X.Y version as 0.X.Y version.
-
-2005-12-12  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-agenda, org-timeline, org-todo):
-       Implement Logging and the keep-modes setting.
-       (org-get-category): Make sure a string is returned.
-       (org-log-done): New function.
-       (org-log-done, org-closed-string): New options.
-
-2005-12-12  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * tooltip.el (tooltip-y-offset): Change default to 20.
-
-2005-12-12  Richard M. Stallman  <rms@gnu.org>
-
-       * mouse.el (mouse-drag-vertical-line): Use adjust-window-trailing-edge.
-
-       * frame.el (display-hourglass): Doc fix.
-
-       * help.el (help-for-help-internal): Simplify entry for `a'.
-
-       * info.el (Info-on-current-buffer): Doc fix.
-       (info-insert-file-contents): Don't test (featurep 'jka-compr).
-
-       * startup.el (inhibit-splash-screen): Make this the real name.
-       (inhibit-startup-message): Make this the alias.
-       (command-line): Find only simple.el, and use its directory
-       to fill in other preloaded files' names.
-       (command-line): Deactivate the mark if deactivate-mark is set.
-
-       * international/mule.el (load-with-code-conversion):
-       Bind deactivate-mark.
-
-       * progmodes/compile.el (compilation-error-regexp-alist): Doc fix.
-
-2005-12-11  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * cus-edit.el (customize-apropos): Avoid listing an option more
-       than once under different aliases.  No longer list user options
-       that are not defined with defcustom (unless a prefix arg is given).
-       Doc fix.
-       (customize-apropos-options): Doc fix.
-
-2005-12-11  Juri Linkov  <juri@jurta.org>
-
-       * frame.el (set-background-color, set-foreground-color)
-       (set-cursor-color, set-mouse-color, set-border-color):
-       Add explicit prompts to read colors by `facemenu-read-color'.
-       (show-trailing-whitespace, blink-cursor-delay)
-       (blink-cursor-interval, display-hourglass, hourglass-delay):
-       Remove tags.
-       (display-hourglass, hourglass-delay): Doc fix.
-       (cursor-in-non-selected-windows): Capitalize words in tag.
-
-       * faces.el (frame-background-mode): Replace `choice-item' keywords
-       with `const' to not make [default] button.  Change default value tag
-       from `default' to `automatic'.  Doc fix.
-       (trailing-whitespace) <defface>: Change group `whitespace' to
-       `whitespace-faces'.
-
-2005-12-11  Richard M. Stallman  <rms@gnu.org>
-
-       * buff-menu.el (Buffer-menu-sort-column): Not a user variable.
-
-2005-12-11  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el: Create keymap for mac-apple-event-map.
-
-2005-12-11  Nick Roberts  <nickrob@snap.net.nz>
-
-       * tooltip.el (tooltip-mode): Move to start of file so that it
-       appears at top of customize buffer.
-
-       * progmodes/gud.el (gud-tooltip-modes, gud-tooltip-display):
-       Add the gud groupname.
-       (gud-tooltip-mode): Add the tooltip groupname.
-       (gud-tooltip-echo-area): Add the gud groupname.  Remove tag to
-       avoid conflict with tooltip-use-echo-area.
-
-2005-12-10  Romain Francoise  <romain@orebokech.com>
-
-       * help.el (help-for-help-internal): Add `r' in doc string.
-
-2005-12-10  Johan Bockg\e,Ae\e(Brd  <bojohan@dd.chalmers.se>
-
-       * align.el (align-regexp, align-highlight-rule):
-       Use region-beginning and region-end instead of point and mark, so that
-       repetition (with `repeat-complex-command') recomputes the region
-       bounds.
-
-2005-12-10  Lennart Borgman  <lennart.borgman.073@student.lu.se>
-
-       * window.el (bw-get-tree, bw-get-tree-1, bw-find-tree-sub)
-       (bw-find-tree-sub-1, bw-l, bw-t, bw-r, bw-b, bw-dir, bw-eqdir)
-       (bw-refresh-edges, bw-adjust-window, bw-balance-sub): New functions.
-       (balance-windows): Rewrite using the above new functions.
-
-2005-12-10  David Koppelman  <koppel@ece.lsu.edu>
-
-       * hi-lock.el (hi-lock-mode): Rename from hi-lock-buffer-mode;
-       react if global-hi-lock-mode seems intended.
-       (global-hi-lock-mode): Renamed from hi-lock-mode.
-       (hi-lock-archaic-interface-message-used)
-       (hi-lock-archaic-interface-deduce): New variables.
-       (turn-on-hi-lock-if-enabled, hi-lock-line-face-buffer)
-       (hi-lock-face-buffer, hi-lock-face-phrase-buffer)
-       (hi-lock-find-patterns, hi-lock-font-lock-hook):
-       Replace hi-lock-buffer-mode with hi-lock-mode.
-
-2005-12-10  Kevin Rodgers  <ihs_4664@yahoo.com>  (tiny change)
-
-       * emacs-lisp/lisp.el (lisp-complete-symbol): Regenerate the
-       completion list, even after a partial completion has been
-       inserted in the current buffer.  If there are more than 1
-       completion, redisplay the *Completions* buffer; if the
-       completion is unique, delete the *Completions* window.
-
-2005-12-10  Eli Zaretskii  <eliz@gnu.org>
-
-       * mail/rmail.el (rmail-next-same-subject): Handle multiple "Re: "
-       strings and long subject lines that were broken into multiple
-       lines at arbitrary places.  Handle subjects that have "Re: " in
-       the middle.
-
-2005-12-10  John W. Eaton  <jwe@octave.org>
-
-       * emacs/octave-mod.el (octave-electric-space): Don't indent
-       comments or strings if octave-auto-indent is nil.
-
-2005-12-10  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el: Require url when compiling.
-       Call mac-process-deferred-apple-events after loading init files.
-       (mac-apple-event-map): New defvar.  Define event handlers in it.
-       (core-event, internet-event): New Apple event class symbols.
-       (open-application, reopen-application, open-documents)
-       (print-documents, open-contents, quit-application)
-       (application-died, show-preferences, autosave-now, get-url):
-       New Apple event ID symbols.
-       (about): New HICommand ID symbol.
-       (mac-event-spec, mac-event-ae): New macros.
-       (mac-ae-parameter, mac-ae-list, mac-bytes-to-integer)
-       (mac-ae-selection-range, mac-ae-text-for-search)
-       (mac-ae-open-documents, mac-ae-text, mac-ae-get-url): New functions.
-       (mac-application-menu-map): Remove keymap.  Handlers for HICommand
-       and Services menu events are now defined in mac-apple-event-map.
-       (mac-drag-n-drop): Remove selection range handling.
-
-2005-12-10  Kenichi Handa  <handa@m17n.org>
-
-       * simple.el (zap-to-char):
-       * isearch.el (isearch-process-search-char): Translate CHAR by
-       translation-table-for-input.
-
-2005-12-09  Chong Yidong  <cyd@stupidchicken.com>
-
-       * foldout.el (foldout-exit-fold): Properly hide subtree.
-
-2005-12-09  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * files.el (save-buffer):
-       * international/ucs-tables.el (ucs-set-table-for-input):
-       * mail/mail-extr.el (mail-extract-address-components):
-       * mail/sendmail.el (mail-mode): Reformat doc string.
-
-2005-12-09  Juri Linkov  <juri@jurta.org>
-
-       * isearch.el (isearch-highlight): Change main overlay priority
-       from 1 to 1001.  Simplify.
-       (isearch-lazy-highlight-update): Change lazy overlay priority
-       from 0 to 1000.
-
-       * replace.el (replace-highlight): Change overlay priority from
-       1 to 1001.
-
-       * textmodes/ispell.el (ispell-highlight-spelling-error-overlay):
-       Change overlay priority from 1 to 1001.  Reuse existing overlay.
-
-       * compare-w.el (compare-windows-highlight): Change overlay
-       priority from 1 to 1000.
-
-       * menu-bar.el (menu-bar-edit-menu): Add listp around
-       pending-undo-list to disable menu item "undo" when pending
-       undo list is empty.
-
-       * locate.el (locate): Disable undo in *Locate* buffer.
-
-2005-12-09  Kim F. Storm  <storm@cua.dk>
-
-       * mail/smtpmail.el (smtpmail-via-smtp): Disable undo in SMTP buffer.
-
-2005-12-09  David Ponce  <david@dponce.com>
-
-       * recentf.el: Improvement of the menu code.
-       (recentf-enabled-p): Move before first use.  Use `kill-emacs-hook'
-       instead of menu hook.
-       (recentf-show-menu, recentf-hide-menu): New functions.
-       (recentf-menu-customization-changed, recentf-mode): Use them.
-       (recentf-menu-action, recentf-max-menu-items)
-       (recentf-menu-open-all-flag, recentf-menu-append-commands-flag)
-       (recentf-arrange-by-rule-others)
-       (recentf-arrange-by-rules-min-items)
-       (recentf-arrange-by-rule-subfilter): Don't use
-       `recentf-menu-customization-changed'.
-       (recentf-arrange-rules): Likewise.  Accept functions to compute
-       sub-menu titles.
-       (recentf-menu-filter): Likewise.  Doc fix.
-       (recentf-menu-value-shortcut): Doc fix.
-       (recentf-dump-variable): Quote atom value.
-       (recentf-make-menu-items): Update to use it as a menu filter.
-       (recentf-match-rule): New function.
-       (recentf-arrange-by-rule): Use it.
-       (recentf-indirect-mode-rule): New function.
-       (recentf-build-mode-rules): Use it.
-       (recentf-dir-rule): New function.
-       (recentf-arrange-by-dir): Use it.
-       (recentf-filter-changer-current): Rename from
-       `recentf-filter-changer-state'.  All references updated.
-       (recentf-filter-changer-alist): Update filter names.
-       (recentf-filter-changer-select): New function.
-       (recentf-filter-changer): Use it.  Make a sub-menu from filters
-       available in `recentf-filter-changer-alist'.
-       (recentf-data-cache, recentf-clear-data)
-       (recentf-update-menu): Remove.  All references updated.
-       (recentf-match-rule-p, recentf-build-dir-rules)
-       (recentf-filter-changer-goto-next)
-       (recentf-filter-changer-get-current)
-       (recentf-filter-changer-get-next): Remove.
-
-2005-12-08  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * cus-edit.el (custom-buffer-create-internal): Relabel the whole
-       buffer "Reset" button to "Reset to Current" for consistency with
-       the State buttons.
-
-2005-12-08  John Paul Wallington  <jpw@pobox.com>
-
-       * ibuf-ext.el (define-ibuffer-filter filename):
-       If `dired-directory' is a list then really use its car.
-
-2005-12-08  Kim F. Storm  <storm@cua.dk>
-
-       * emulation/cua-rect.el (cua--rectangle-aux-replace):
-       Fix indention of text on right side of replaced rectangle.
-
-2005-12-09  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-speedbar-buttons, gud-tooltip-tips):
-       No need to check gud-comint-buffer is bound.
-       (gdb): Prevent multiple debugging when first session uses gdba.
-
-2005-12-08  Alan Mackenzie  <bug-cc-mode@gnu.org>
-
-       CC Mode update to 5.31.
-
-       * progmodes/cc-subword.el: Add a dummy `c-subword-mode' for
-       Emacsen which lack `define-minor-mode'.  (Currently Emacs <21.
-       We might do this function properly in the future).
-
-       * progmodes/cc-cmds.el, cc-defs.el, cc-styles.el, cc-vars.el:
-       New macros c-sentence-end and c-default-value-sentence end, to cope
-       with Emacs 22's new function `sentence-end'.
-
-2005-12-08  Martin Stjernholm  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-cmds.el (c-show-syntactic-information): Solve the
-       compat issue using `c-put-overlay' and `c-delete-overlay'.
-
-       * progmodes/cc-defs.el (c-put-overlay, c-delete-overlay):
-       New compat macros to handle overlays/extents.
-
-2005-12-08  Alan Mackenzie  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-fix.el: Add definitions of the macros push and pop
-       (for GNU Emacs 20.4).
-
-       * progmodes/cc-defs.el:
-       (i): Load cc-fix.elc for `push' and `pop' (for GNU Emacs 20.4).
-
-       * progmodes/cc-cmds.el (c-show-syntactic-information): Change the
-       highlighting mechanism so it will work in XEmacs too.
-
-       * progmodes/cc-defs.el: Insert c-int-to-char.
-
-       * progmodes/cc-langs.el (c-nonsymbol-token-char-list): Insert a
-       call to the new macro c-int-to-char.  This solves XEmacs's
-       regarding characters as different from integers.
-
-2005-12-08  Martin Stjernholm  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-fonts.el (c-make-syntactic-matcher):
-       New internal helper.
-
-       (c-cpp-matchers, c-basic-matchers-before): Use the `eval'
-       construct to make the indirect face lookup work in XEmacs.
-
-       (c-cpp-matchers): Append the negation char face to the existing
-       fontification, so that the cpp face doesn't disappear.
-       Use `c-make-syntactic-matcher' to avoid negation chars in comments
-       and strings.
-
-       * progmodes/cc-fonts.el (c-negation-char-face-name): New variable
-       to map to `font-lock-negation-char-face' in emacsen where it exists.
-
-2005-12-08  Alan Mackenzie  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-mode.el: Bind c-subword-mode to C-c C-w.
-
-       * progmodes/cc-subword.el, cc-cmds.el, cc-mode.el:
-       Rename "c-subword-move-mode" as "c-subword-mode".
-
-       * progmodes/cc-mode.el: Added tty suitable bindings for C-c
-       <delete> and C-c C-<delete>.  (To the c-hungry- delete functions).
-
-2005-12-08  Martin Stjernholm  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-mode.el: Added autoload directive for
-       `c-subword-move-mode' for use in older emacsen.
-
-2005-12-08  Alan Mackenzie  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-mode.el:
-       (i): Insert a binding for C-c C-backspace into
-       c-bind-special-erase-keys which works in TTYs.
-       (ii): Make sure that when file styles are used, any explicitly
-       given style variables take priority over those in the style.
-       Do this by calling `hack-local-variables' a second time.
-
-       * progmodes/cc-vars.el: Add language specific customization
-       widgets for AWK to c-doc-comment-style, c-require-final-newline
-       and c-default-style.  Add a defcustom for awk-mode-hook.
-       Give c-syntactic-element and c-syntactic-context doc-strings by
-       directly setting their `variable-documentation' propery.
-       This allows Emacs 22.1 to read these with C-h v.
-
-       * progmodes/cc-awk.el: Apply a tidy-up patch (from Stefan Monnier).
-
-2005-12-08  Martin Stjernholm  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-fonts.el, cc-vars.el
-       (gtkdoc-font-lock-doc-comments, gtkdoc-font-lock-doc-protection)
-       (gtkdoc-font-lock-keywords): GtkDoc patterns contributed by
-       Masatake YAMATO.
-
-       (c-doc-comment-style): Made GtkDoc default in C mode.
-
-       * progmodes/cc-mode.el: Fixed key bindings for C-c C-<backspace>
-       and C-c C-<delete>.
-
-       (c-bind-special-erase-keys): New function for use on
-       `normal-erase-is-backspace-hook' to bind C-c C-<delete> correctly.
-
-       * progmodes/cc-cmds.el (c-hungry-delete): New function to fix
-       <delete> key behavior in XEmacs according to `delete-forward-p'.
-       C.f. `c-electric-delete'.
-
-2005-12-08  Alan Mackenzie  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-mode.el: Give c-hungry-backspace and
-       c-hungry-delete-forward permanent key bindings.
-
-       * progmodes/cc-cmds.el (c-electric-semi&comma):
-       Bind c-syntactic-context for calls to "criteria functions", for
-       consistency with other calls to user functions.
-
-       * progmodes/cc-cmds.el (c-indent-command): Expunge use of
-       `current-prefix-arg', since this might be the prefix arg to a
-       command which calls c-indent-command as a function.  Change the
-       interactive spec from "p" to "P".
-
-       * progmodes/cc-styles.el: Amend the doc-string of c-set-style, in
-       reponse to a report from Joseph Kiniry <kiniry@acm.org> that it
-       was difficult to understand.
-
-2005-12-08  Martin Stjernholm  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-engine.el (c-on-identifier): Fix bug when at the
-       first char of an identifier.
-
-       * progmodes/cc-engine.el (c-on-identifier): Handle the "operator
-       +" syntax in C++.
-
-2005-12-08  Alan Mackenzie  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-cmds.el (c-mask-paragraph): Correct, so that
-       auto-fill doesn't split a c-comment's last word from a hanging
-       "*/" when a space is typed between them after fill-column.
-
-       * progmodes/cc-defs.el: New macro c-delete-and-extract-region.
-
-       * progmodes/cc-styles.el (c-set-style)
-       (c-setup-paragraph-variables): Abort the command if we're not in a
-       CC Mode buffer.
-
-       * progmodes/cc-align.el (c-lineup-C-comments): Correct indentation
-       with blank comment-prefix, and a blank line as the comment's
-       second line.
-
-2005-12-08  Martin Stjernholm  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-fonts.el (c-cpp-matchers, c-basic-matchers-before):
-       Incorporate the patterns added in the Emacs development branch
-       for the new Emacs 22 face `font-lock-negation-char-face'.
-
-       * progmodes/cc-fonts.el (c-invalid-face-name): Use "red1" instead
-       of "red" since it stands out better in xterms and DOS terminals.
-
-       * progmodes/cc-engine.el (c-literal-faces):
-       Add `font-lock-comment-delimiter-face' which is new in Emacs 22.
-
-2005-12-08  Alan Mackenzie  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-cmds.el: Make C-c C-a (`c-toggle-auto-newline')
-       forcibly enable c-electric-flag.
-
-       * progmodes/cc-vars.el, cc-cmds.el: New clean-up
-       `comment-close-slash' on c-electric-slash: if enabled, typing `/' just
-       after the comment-prefix of a C-style comment will close that comment.
-
-2005-12-08  Martin Stjernholm  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-fonts.el (c-basic-matchers-before)
-       (c-complex-decl-matchers): Fix the "not-arrow-prefix" regexp used
-       in Pike.
-
-       * progmodes/cc-langs.el (c-other-op-syntax-tokens): Only C++ has
-       digraphs.
-
-       * progmodes/cc-fonts.el, cc-langs.el, cc-engine.el
-       (c-cpp-message-directives, c-cpp-include-directives)
-       (c-opt-cpp-macro-define, c-opt-cpp-macro-define-start)
-       (c-cpp-expr-directives): Introduce new language constants to
-       control cpp syntax in a cleaner way.
-
-       (c-cpp-expr-functions): Rename from c-cpp-defined-fns.
-
-       (c-cpp-matchers, c-forward-to-cpp-define-body): Use them.
-
-       * progmodes/cc-langs.el, cc-fonts.el (c-string-escaped-newlines)
-       (c-multiline-string-start-char): New language constants and
-       variables to specify how newlines in string literals work.
-
-       (c-font-lock-invalid-string): Use them.
-
-       * progmodes/cc-cmds.el (c-try-one-liner): Robustness fix if an
-       unbalanced close brace is entered.  Optimization by avoiding going
-       back over arbitrarily large blocks.  Removed hints that this
-       function only would be relevant/useful in AWK.
-
-       (c-electric-brace): Indent syntactically after the cleanups since
-       lineup functions might do it differently then.
-
-       * progmodes/cc-engine.el, cc-langs.el
-       (c-opt-op-identifier-prefix): New language constant and variable.
-
-       (c-just-after-func-arglist-p, c-after-special-operator-id)
-       (c-search-decl-header-end, c-inside-bracelist-p): Use it.
-
-       * progmodes/cc-align.el, cc-engine.el
-       (c-after-special-operator-id): New helper to handle C++ operator
-       identifiers.
-
-       (c-lineup-topmost-intro-cont, c-just-after-func-arglist-p)
-       (c-guess-basic-syntax): Handle C++ operator identifiers in
-       declarations.
-
-       * progmodes/cc-langs.el (c-assignment-operators): Add the
-       trigraph version of ^= too.
-
-       * progmodes/cc-langs.el (c-assignment-operators): Add the
-       trigraph version of |= in C++.
-
-       * progmodes/cc-fonts.el (c-font-lock-declarators):
-       Handle `c-decl-hangon-kwds' after the identifier name.
-
-       * progmodes/cc-engine.el (c-guess-basic-syntax): When deciding
-       whether an arglist is "nonempty", ignore a comment after the open
-       paren if it isn't followed by a non-comment token on the same line.
-
-       * progmodes/cc-engine.el (c-guess-basic-syntax): Case 4:
-       Enable heuristics below the point to cope with classes inside special
-       brace lists in Pike.
-
-2005-12-08  Alan Mackenzie  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-cmds.el: Amend c-point-syntax to handle macros.
-
-2005-12-08  Martin Stjernholm  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-guess.el (cc-guess-install): New function to
-       install an already guessed style in another buffer.
-
-       * progmodes/cc-defs.el (c-tentative-buffer-changes): No longer
-       sets `inhibit-read-only' - `c-save-buffer-state' should be used
-       anyway if the change always is undone.
-
-2005-12-08  Alan Mackenzie  <bug-cc-mode@gnu.org>
-
-       Implement togglable electricity:
-
-       * progmodes/cc-defs.el: Enhance c-save-buffer-state's doc-string,
-       saying when it should be used.
-
-       * progmodes/cc-engine.el: Add the new buffer-local variable,
-       c-electric-flag.
-
-       * progmodes/cc-langs.el: Change the name of c-toggle-auto-state to
-       c-toggle-auto-newline.
-
-       * progmodes/cc-mode.el: Rename c-toggle-auto-state to
-       c-toggle-auto-newline.  Remove the binding for
-       c-toggle-auto-hungry-state.  Add the binding C-c C-l for the new
-       c-toggle-electric-state.
-
-       * progmodes/cc-vars.el: Make c-syntactic-indentation buffer local.
-
-       * progmodes/cc-cmds.el: Add `c-bytecomp-defun's for
-       c-\(forward\|backward\)-subword.
-       (c-update-modeline): Add the new modeline flag `l' for
-       `c-electric-flag'.  Make the auto-newline flag `a' dependent on `l'.
-       (c-toggle-auto-state): Rename it to `c-toggle-auto-newline'.
-       Make the old name an alias of the new name.
-       (c-toggle-electric-state): New function.
-       (c-electric-\(pound\|brace\|slash\|star\|semi&comma\|colon\|lt-gt\|paren\|continued-statement\)):
-       Adapt these functions to do electric things only when
-       c-electric-flag is non-nil.
-       (c-point-syntax, c-brace-newlines, c-try-oneliner): Extract these
-       new functions from c-electric-brace.
-       (c-point-syntax): Add a check for "virtual semicolons" in AWK
-       mode, so that the tentative extra newline doesn't change the
-       syntax of the following brace.
-       (c-electric-brace): Restructure by extracting the above functions.
-       Tidy up the coding somewhat.
-       (c-electric-semi&comma, c-electric-colon, c-electric-paren):
-       restructure a bit.
-
-2005-12-08  Martin Stjernholm  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-cmds.el (c-show-syntactic-information): Show the
-       anchor position(s) using faces.  Thanks to Masatake YAMATO for the idea.
-
-       * progmodes/cc-mode.el, cc-cmds.el, cc-defs.el, cc-engine.el
-       (c-submode-indicators): Change name from `c-auto-hungry-string'
-       since it's now used to track another submode.
-
-       (c-update-modeline): Convert to function and extended to check
-       `c-subword-move-mode'.
-
-       (c-forward-into-nomenclature, c-backward-into-nomenclature):
-       Convert to compat aliases for `c-forward-subword' and
-       `c-backward-subword'.
-
-       * progmodes/cc-subword.el: New functions and minor mode to handle
-       SillyCapsedStyleIndentifiers, contributed by Masatake YAMATO:
-
-       (c-forward-subword, c-backward-subword, c-mark-subword)
-       (c-kill-subword, c-backward-kill-subword, c-transpose-subwords)
-       (c-capitalize-subword, c-downcase-subword, c-upcase-subword):
-       Functions corresponding to the standard word handling functions.
-
-       (c-subword-move-mode): Minor mode that replaces all the standard
-       word handling functions with their subword equivalences.
-
-2005-12-08  Alan Mackenzie  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-vars.el (c-cleanup-list): Insert a customization
-       entry for one-liner-defun.
-
-       * progmodes/cc-defs.el: Give c-tentative-buffer-changes its own
-       name in its def-edebug-spec.
-
-       * progmodes/cc-cmds.el (c-electric-brace): Make the
-       one-liner-defun clean-up work with empty-defun-braces.  o-l-d now
-       compacts space before a comment, if this will make things fit on
-       one line.
-
-       Introduce an "awk" style, mainly for auto-newline and clean-ups.
-
-       * progmodes/cc-align.el: New function c-snug-1line-defun-close.
-
-       * progmodes/cc-cmds.el: In c-electric-brace, add code for new
-       clean-up one-liner-defun.
-
-       * progmodes/cc-styles.el: Add the new "awk" style.
-
-       * progmodes/cc-vars.el: Add description of one-liner-defun to
-       c-cleanup-list's doc-string.  New user options,
-       c-max-one-liner-length.  In c-default-style, set the default style
-       for AWK to "awk".
-
-2005-12-08  Martin Stjernholm  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-engine.el (c-forward-label): Fix fontification of
-       macros inside labels.
-
-       * progmodes/cc-engine.el (c-looking-at-bos): Obsolete in favor of
-       `c-at-statement-start-p' and `c-at-expression-start-p'.
-
-       * progmodes/cc-defs.el (c-tnt-chng-record-state): Don't signal an
-       error if the mark isn't set.
-
-       * progmodes/cc-engine.el (c-guess-continued-construct)
-       (c-guess-basic-syntax): Use `c-forward-decl-or-cast-1' to more
-       accurately detect functions inside functions.
-
-       * progmodes/cc-engine.el (c-at-expression-start-p): New function
-       like `c-at-statement-start-p' that additionally recognizes commas
-       and expression parentheses as delimiters.
-
-       * progmodes/cc-engine.el (c-looking-at-inexpr-block): Add flag
-       to avoid heuristics that doesn't work for unclosed blocks.
-       (c-at-statement-start-p): New function.
-
-       * progmodes/cc-engine.el, cc-fonts.el: Fixes in handling of
-       Objective-C directives, e.g. directives spanning lines should work
-       reasonably well now.
-
-       (c-put-c-type-property, c-clear-c-type-property): New helpers.
-
-       (c-forward-objc-directive): New function to move over any ObjC
-       directive.
-
-       (c-just-after-func-arglist-p, c-guess-basic-syntax)
-       (c-basic-matchers-before): Use it.
-
-       (c-font-lock-objc-iip-decl): Remove.
-
-       * progmodes/cc-engine.el (c-guess-basic-syntax): Some improvement
-       in the template arglist recognition.
-
-       * progmodes/cc-styles.el (c-style-alist): Fix several
-       inconsistencies in the Whitesmith style.
-
-       * progmodes/cc-align.el (c-lineup-after-whitesmith-blocks):
-       New lineup function to get lines after Whitesmith style blocks
-       correctly indented.
-
-       (c-lineup-whitesmith-in-block): Back out the compensation for
-       opening parens since it's done using `add' lists in the style
-       definition instead.  Don't use the anchor position since it varies
-       too much between the syntactic symbols. :P
-
-       * progmodes/cc-vars.el (c-valid-offset): Update.
-
-       * progmodes/cc-engine.el (c-evaluate-offset): Extend to handle
-       lists where the offsets are combined according to several
-       different methods: `first', `min', `max', and `add'.
-       Report offset evaluation errors with `c-benign-error' so that some kind
-       of reindentation still is done.
-
-       * progmodes/cc-engine.el (c-guess-basic-syntax):
-       Anchor `arglist-intro' the same way as `arglist-cont-nonempty' and
-       `arglist-close'.
-
-       * progmodes/cc-engine.el (c-guess-basic-syntax): Fix similar
-       situations for `arglist-cont-nonempty' and `arglist-close'.
-
-       * progmodes/cc-langs.el (c-opt-identifier-concat-key-depth): New const.
-
-       * progmodes/cc-defs.el: Use `cc-bytecomp-fboundp' and
-       cc-bytecomp-boundp' in a number of places.
-
-       * progmodes/cc-engine.el (c-beginning-of-statement-1): Fix a
-       macro related issue.
-
-2005-12-08  Alan Mackenzie  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-awk.el: Change the terminology of regexps: A char
-       list is now [asdf], a char class [:alpha:].
-       Include code for char classes.
-       Set c-awk-NL-prop on lines ending in open strings.  (Bug fix.)
-       Add character classes (e.g. "[:alpha:]") into AWK Mode's regexps.
-
-       Remove (nearly all of) the cruft associated with AWK Mode's former
-       concept of "virtual semicolons":
-
-       Adapt c-beginning-of-statement, c-end-of-statement (together with
-       subfunctions) to use the new notion of "virtual semicolon" in
-       place of the old awkward special handling for AWK.  There remains
-       much cruft in cc-awk.el, cc-cmds.el and cc-engine.el to clear out.
-       * progmodes/cc-cmds.el:
-       (c-ascertain-adjacent-literal): In the backwards direction, now
-       recognises AWK regexp delimiters as string delimiters.
-       (c-after-statement-terminator-p): Adapt for virtual semicolons;
-       check more rigorously for "end of macro".
-       (c-back-over-illiterals, c-forward-over-illiterals): Adapt for
-       virtual semicolons;
-       (c-beginning-of-statement): Adapt for virtual semicolons; Separate
-       out the code for forward movement into ...
-       (c-end-of-statement): Now contains the code for forward movement,
-       adapted for virtual semicolons.
-
-       * progmodes/cc-engine.el:
-       (c-ws*-string-limit-regexp): New regexp.
-       (c-forward-single-comment, c-backward-single-comment): Comment out
-       the (now redundant) "special" AWK stuff.
-
-       * progmodes/cc-styles.el, cc-vars.el: Change the settings of
-       c-string-par-start, c-string-par-separate to be more like Text
-       Mode than Fundamental Mode.
-
-2005-12-08  Martin Stjernholm  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-fonts.el (c-font-lock-declarations): Always narrow
-       to the fontified region so that fontification doesn't occur
-       outside it (could happen e.g. when fontifying a line with an
-       unfinished declaration).
-
-2005-12-08  Alan Mackenzie  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-awk.el: Move regexps for analysing AWK code to near the
-       start of the file.  ^L now separate sections of the file.
-       (c-awk-non-eol-esc-pair-re, c-awk-blank-or-comment-line-re)
-       (c-awk-one-line-possibly-open-string-re)
-       (c-awk-regexp-one-line-possibly-open-char-class-re)
-       (c-awk-one-line-possibly-open-regexp-re)
-       (c-awk-one-line-non-syn-ws*-re): New defonsts.
-       (c-awk-at-vsemi-p, c-awk-vsemi-status-unknown-p): New functions.
-
-       Amend the concept of "virtual semicolons" (in the indentation
-       engine) for languages like AWK, such that they are now
-       conceptually attached to end of the last token of a statement, not
-       the end of the line.  (In AWK Mode, however, the pertinent text
-       property is still physically set on the EOL.)  Remove the specific
-       tests for awk-mode, thus facilitating the introduction of other
-       language modes where EOLs can end statements.
-       (Note: The funtionality in cc-cmds.el, specifically
-       c-beginning/end-of-statement has yet to be amended.)
-
-       * progmodes/cc-defs.el (c-at-vsemi-p, c-vsemi-status-unknown-p):
-       New macros.
-
-       * progmodes/cc-langs.el: Added `#' into AWK Mode's value of
-       c-stmt-delim-chars.  New c-lang-defvars: c-at-vsemi-p-fn,
-       c-vsemi-status-unknown-p-fn (in a new page).
-
-       * progmodes/cc-engine.el: In c-beginning-of-statement-1,
-       c-crosses-statement-barrier-p, c-guess-basic-syntax, replace
-       numerous awkward forms like
-       (if (c-major-mode-is 'awk-mode) (c-awk-prev-line-incomplete-p))
-       with (c-at-vsemi-p).  Fix a few typos.  In c-guess-basic-syntax, new
-       variable before-ws-ip, the place just after char-before-ip appears.
-
-       * progmodes/cc-mode.el: Fix what's almost a semantic ambiguity in
-       a comment.
-
-2005-12-08  Martin Stjernholm  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-cmds.el (c-electric-brace): Clean up using
-       `c-tentative-buffer-changes'.
-
-       * progmodes/cc-defs.el (c-region-is-active-p): Simplify and
-       convert to macro to choose between Emacs and XEmacs at compile time.
-
-       (c-set-region-active): New set counterpart to `c-region-is-active-p'.
-
-       (c-tentative-buffer-changes): New macro to handle temporary buffer
-       changes in a convenient way.
-
-       (c-tnt-chng-record-state, c-tnt-chng-cleanup): Internal helpers
-       for `c-tentative-buffer-changes'.
-
-       * progmodes/cc-engine.el (c-looking-at-inexpr-block): Tighten up
-       the checks for paren sexps between the point and the keyword, to
-       avoid some false alarms.
-
-       * progmodes/cc-engine.el, cc-langs.el (c-looking-at-inexpr-block):
-       Fixed a situation where an error could be thrown for unbalanced
-       parens.  Changed to make use of c-keyword-member' to avoid some
-       repeated regexp matches.
-
-       (c-opt-lambda-key, c-opt-inexpr-block-key, c-opt-inexpr-class-key):
-       These language variable are no longer necessary.
-
-       (c-block-stmt-kwds): New language constant used by
-       c-looking-at-inexpr-block'.
-
-       (c-guess-basic-syntax): Remove an optional check that looked at
-       the existence of the now removed language variables.
-
-       * progmodes/cc-engine.el (c-fdoc-shift-type-backward)
-       (c-forward-decl-or-cast-1): Fix invalid recognition of C++ style
-       object instantiation expressions as declarations in some contexts.
-       This bug only affected languages where the declarator can't be
-       enclosed in parentheses.
-
-       * progmodes/cc-styles.el (c-style-alist): Fix the GNU style to
-       insert newlines before and after substatement braces.
-
-       * progmodes/cc-engine.el: Improved the heuristics for recognizing
-       function declaration headers and the handling of C++ style member
-       init lists.
-
-       (c-just-after-func-arglist-p): Rewritten to use
-       `c-forward-decl-or-cast-1'.  Now behaves a bit differently too.
-
-       (c-beginning-of-member-init-list): Remove since it isn't used anymore.
-
-       (c-guess-basic-syntax): Adapt case 5B for the new
-       `c-just-after-func-arglist-p'.  Merge cases 5B.1 and 5B.3.
-       Remove cases 5D.1 and 5D.2 since they aren't trigged anymore (case 5B.1
-       covers all cases now).
-
-       * progmodes/cc-defs.el (c-point): Add `bosws' and `eosws'.
-
-2005-12-08  Alan Mackenzie  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-cmds.el, cc-styles.el, cc-vars.el: New variables
-       c-string-par-start/separate c-sentence-end-with-esc-eol,
-       initialised in c-setup-paragraph-variables, used in string
-       scanning subroutines of c-beginning-of-statement.
-
-       * progmodes/cc-cmds.el (c-electric-brace): Don't delete a comment
-       which precedes the newly inserted `{'.
-
-2005-12-08  Martin Stjernholm  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-engine.el, cc-langs.el: Rewrote the recognition
-       function for declaration level blocks.  It should now cope with
-       templates better and also be a lot more comprehensible.
-
-       (c-looking-at-decl-block): The new function.
-
-       (c-search-uplist-for-classkey): The old one.  It's now a wrapper
-       for compatibility.
-
-       (c-add-class-syntax, c-guess-continued-construct)
-       (c-guess-basic-syntax): Adapt for `c-looking-at-decl-block'.
-
-       (c-decl-block-key): Change to tell apart ambiguous and
-       unambiguous keywords.  Pike specials are now handled directly in
-       the code instead.
-
-       (c-block-prefix-disallowed-chars, c-block-prefix-charset):
-       New language constants and variables to make the backward skip in
-       `c-looking-at-decl-block' as tight as possible.
-
-       (c-nonsymbol-token-char-list): New language constant.
-
-       * progmodes/cc-engine.el (c-backward-<>-arglist): New function to
-       find balanced template arglists backwards.
-
-       * progmodes/cc-defs.el (c-make-bare-char-alt): New helper for
-       making char classes for `c-syntactic-skip-backward'.
-
-       * progmodes/cc-engine.el (c-guess-basic-syntax): Simplify case
-       16D - can't be a class-close at that point.
-
-       * progmodes/cc-engine.el (c-guess-basic-syntax)
-       (c-add-class-syntax): Don't narrow out the enclosing declaration
-       level.  This makes everything a lot easier, and it was actually
-       only four small places that needed it to work.  Some places that
-       previously did `widen' are removed now, which has the effect that
-       `c-guess-basic-syntax' never will look at things outside the
-       current narrowment now.  The anchor position for `topmost-intro'
-       is affected by this, but it was so bogus it was basically useless
-       before, and now it's equally bogus but in a slightly different way.
-
-       (c-narrow-out-enclosing-class): Gone.
-
-       (c-most-enclosing-brace, c-least-enclosing-brace): Don't filter to
-       the narrowed region.
-
-       (c-least-enclosing-brace): Remove silly optional argument.
-
-       * progmodes/cc-engine.el (c-beginning-of-decl-1): Fix bug where
-       the point could be left directly after an open paren when finding
-       the beginning of the first decl in the block.
-
-       * progmodes/cc-engine.el, cc-fonts.el (c-forward-keyword-clause):
-       Specify which submatch to use.
-
-       * progmodes/cc-langs.el (c-symbol-start): Include `@' in ObjC.
-
-       (c-decl-start-re): No longer any need for special treatment of
-       ObjC due to the above.
-
-       (c-other-block-decl-kwds): Handle "extern" in ObjC too since it
-       presumably follows C in that regard.
-
-       * progmodes/cc-langs.el (c-identifier-ops, c-after-id-concat-ops):
-       New language constants to specify operator tokens inside
-       identifiers in a more high level way.
-
-       (c-opt-identifier-prefix-key): New internal language constant.
-
-       (c-opt-identifier-concat-key, c-opt-after-id-concat-key)
-       (c-identifier-start, c-identifier-key): Now completely calculated
-       from other constants.
-
-       (c-identifier-last-sym-match): Decommission since it's no longer used.
-
-       (c-operators): Use `c-identifier-ops'.  Document `postfix-if-paren'.
-
-       * progmodes/cc-engine.el (c-forward-name): Remove the
-       optimization when c-identifier-key is equal to c-symbol-key since
-       it doesn't work in byte compiled files.  Don't record empty
-       regions as identifiers.
-
-       * progmodes/cc-langs.el (c-filter-ops): New helper function to
-       simplify access to `c-operators' and its likes.
-
-       (c-operator-list, c-all-op-syntax-tokens)
-       (c-nonsymbol-token-regexp, c-<>-multichar-token-regexp)
-       (c-<-op-cont-regexp, c->-op-cont-regexp, c-expr-kwds)
-       (c-primary-expr-regexp, c-cast-parens): Use it.
-
-       * progmodes/cc-defs.el (c-lang-const): Fixes to allow use without
-       an explicit language in functions.
-
-       * progmodes/cc-defs.el (c-make-keywords-re): Add an appendable
-       variant of adornment.
-
-       * progmodes/cc-langs.el (c-any-class-key): Remove unused language
-       variable.
-
-       (c-type-decl-prefix-key): Remove some now unnecessary cruft from
-       the Pike value.
-
-       * progmodes/cc-engine.el (c-on-identifier)
-       (c-simple-skip-symbol-backward): Small fix for handling "-"
-       correctly in `skip-chars-backward'.  Affected the operator lfun
-       syntax in Pike.
-
-       * progmodes/cc-langs.el (c-make-init-lang-vars-fun): Disable the
-       diagnostic message about precompiled language vars not being used.
-
-       * progmodes/cc-langs.el (c-paren-nontype-kwds): The GCC keyword
-       "__attribute__" is followed by a parenthesis.
-
-       (c-type-start-kwds, c-prefix-spec-kwds, c-prefix-spec-kwds-re)
-       (c-specifier-key, c-not-decl-init-keywords): Some cleanup using new
-       language constants `c-type-start-kwds' and `c-prefix-spec-kwds'.
-
-       * progmodes/cc-fonts.el, cc-langs.el, cc-engine.el:
-       Internal cleanups to properly detect the declared identifiers in
-       various declarations.
-
-       (c-decl-start-kwds): New language constant to recognize
-       declarations that can start anywhere.  Used for class declarations
-       in Pike.
-
-       (c-specifier-key, c-not-decl-init-keywords)
-       (c-decl-prefix-or-start-re, c-find-decl-prefix-search)
-       (c-find-decl-spots): Implement `c-decl-start-kwds'.
-
-       (c-other-decl-kwds, c-postfix-decl-spec-kwds, c-decl-hangon-kwds)
-       (c-decl-hangon-key, c-forward-decl-or-cast-1): Separate the
-       handling of the compiler specific extension keywords into a new
-       language constant `c-decl-hangon-kwds' that defines keyword
-       clauses to be ignored in declarations.
-
-       (c-forward-id-comma-list, c-forward-keyword-clause): Don't skip
-       past unrecognized tokens when handling `c-colon-type-list-kwds'.
-       Necessary to stop at the declared identifier in e.g. IDL valuetype
-       declarations.
-
-       (c-typedef-decl-kwds, c-typeless-decl-kwds, c-type-list-kwds)
-       (c-prefix-spec-kwds-re, c-postfix-spec-kwds)
-       (c-after-suffixed-type-decl-key, c-opt-postfix-decl-spec-key)
-       (c-forward-decl-or-cast-1): Recognize the declared identifier in
-       class and enum declarations as such and not as part of the type.
-
-       (c-forward-decl-or-cast-1, c-forward-label): Relax the
-       interpretation of PRECEDING-TOKEN-END when there's no preceding token.
-
-       (c-forward-decl-or-cast-1): Don't disregard sure signs of
-       declarations when there's some syntax error later on.
-
-       (c-complex-decl-matchers): Did away with a reference to
-       `c-specifier-key'.
-
-       * progmodes/cc-engine.el (c-maybe-labelp): Provide no default
-       value - this variable is always dynamically bound.
-
-       * progmodes/cc-engine.el, cc-fonts.el, cc-langs.el, cc-menus.el
-       * cc-mode.el, cc-styles.el, cc-vars.el, cc-align.el, cc-awk.el
-       * cc-cmds.el, cc-defs.el: Change the policy for marking up
-       functions that might do hidden buffer changes: All such internal
-       functions are now marked instead of those that don't.
-
-       (c-beginning-of-macro, c-end-of-macro, c-(forward|backward)-comments)
-       (c-(forward|backward)-single-comment, c-parse-state, c-on-identifier)
-       (c-(fast-|slow-|)in-literal, c-literal-limits, c-collect-line-comments)
-       (c-literal-type): Allow these functions to make hidden buffer changes,
-       so that they are free to use text property caching later on.
-
-       (c-electric-backspace, c-electric-delete-forward, c-electric-pound)
-       (c-electric-brace, c-electric-slash, c-electric-star)
-       (c-electric-semi&comma, c-electric-colon, c-electric-lt-gt)
-       (c-electric-paren, c-electric-continued-statement, c-indent-command)
-       (c-indent-region, c-mask-paragraph, c-indent-new-comment-line)
-       (c-context-line-break): Add `c-save-buffer-state' calls to comply
-       with the changed semantics of the functions above.
-
-       * progmodes/cc-engine.el (c-beginning-of-statement-1): Fix a bug
-       when macros occur in obscure places.  Optimized the sexp movement
-       a bit.
-
-2005-12-08  Alan Mackenzie  <bug-cc-mode@gnu.org>
-
-       Enhancements for c-beginning-of-statement to work in AWK Mode:
-
-       * progmodes/cc-awk.el: Supersede c-awk-NL-prop value `;'
-       (completed statement) with `}' (statement completed by closing
-       brace or semicolon) and `$' (statement completed by EOL).
-
-       (c-awk-virtual-semicolon-ends-prev-line-p)
-       (c-awk-virtual-semicolon-ends-line-p)
-       (c-awk-skip-semantic-ws-forward, c-awk-skip-semantic-ws-backward)
-       (c-awk-at-statement-end-p): New functions.
-
-       * progmodes/cc-cmds.el: Simplify the structure of functions
-       c-forward-over-illiterals, c-back-over-illiterals.  Enhance these
-       two functions and c-beginning-of-statement to handle AWK Mode.
-
-       * progmodes/cc-engine.el: Enhance c-forward-single-comment,
-       c-backward-single-comment for AWK mode.  Attempt to clarify their
-       doc-strings.
-
-       * progmodes/cc-mode.el: Put M-a and M-e into awk-mode-map.
-
-2005-12-08  Martin Stjernholm  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-engine.el, cc-fonts.el, cc-langs.el: Cleaned up the
-       label handling.  Labels are now recognized in a uniform and more
-       robust way, regardless of context.  Text properties are put on all
-       labels to recognize the following declarations better.
-       Multiword labels are handled both in indentation and fontification for
-       the benefit of language extensions like Qt.  For consistency, keywords
-       in labels are now fontified with the label face instead.
-       That also applies to "case" and "default".
-
-       (c-beginning-of-statement-1): Fix some bugs in the label
-       handling.  Disregard `c-nonlabel-token-key' in labels that begin
-       with `c-label-kwds'.
-
-       (c-find-decl-spots): Support that the callback adds more
-       `c-decl-end' spots to find.
-
-       (c-forward-decl-or-cast-1): Don't treat a list of plain
-       identifiers followed by a colon as a declaration.
-
-       (c-forward-label): New function to recognize labels.
-
-       (c-guess-basic-syntax): Replace uses of `c-label-key' with
-       `c-forward-label'.  Moved the label recognition cases (14 and 15)
-       earlier since they aren't so context sensitive now.  Handle labels
-       on the top level gracefully.  Moved access label recognition to
-       the generic label case (CASE 15) - removed CASE 5E.
-
-       (c-font-lock-declarations): Add recognition of labels in the
-       same round since we need to handle labels in parallell with other
-       declarations to recognize both accurately.  It should also improve
-       speed.
-
-       (c-simple-decl-matchers, c-basic-matchers-after):
-       Move `c-font-lock-labels' so that it only is used on decoration level 2
-       since `c-font-lock-declarations' handles it otherwise.
-
-       (c-complex-decl-matchers): Remove the simplistic recognition of
-       access labels.
-
-       (c-decl-prefix-re): Remove the kludges that was necessary to cope
-       with labels earlier.
-
-       (c-decl-start-re): New language variable to make
-       `c-font-lock-declarations' stop for the special protection labels
-       in Objective-C that start with `@'.
-
-       (c-label-key): Remove since it's no longer used.
-
-       (c-recognize-colon-labels, c-label-prefix-re): New language
-       constants to support recognition of generic colon-terminated labels.
-
-       (c-type-decl-end-used): `c-decl-end' is now used whenever there
-       are colon terminated labels.
-
-       * progmodes/cc-align.el (c-lineup-arglist): Fix bug when the
-       first argument starts with a special brace list.
-
-       * progmodes/cc-engine.el, cc-fonts.el (c-forward-decl-or-cast-1)
-       (c-font-lock-declarations): Break out the declaration and cast
-       recognition from `c-font-lock-declarations' to a new function, so
-       that it can be used in the indentation engine.
-
-       * progmodes/cc-engine.el (c-find-decl-spots): Fix bug in backing
-       up to the start of the literal.  Fixed bug with the point on the
-       wrong side of the search limit that could happen when the start
-       position is inside a literal.
-
-       * progmodes/cc-engine.el (c-parse-state)
-       (c-invalidate-state-cache): Modify the use of `c-state-cache-end'
-       so that it's kept a little bit back to increase the hit rate.
-
-       (c-parse-state): Change the macro handling and fixed some
-       glitches.  Macro context is checked more often than necessary now,
-       but otoh less garbage conses are generated.
-
-       * progmodes/cc-engine.el (c-parse-state)
-       (c-invalidate-state-cache): Cache the last position where
-       `c-state-cache' applies.  This can speed up refontification quite
-       a bit in blocks where there are many non-brace parens before the point.
-
-       (c-state-cache-end): New variable for this.
-
-       (c-guess-basic-syntax, c-debug-parse-state): Adapt for the new
-       cache variable.
-
-       * progmodes/cc-engine.el (c-find-decl-spots): Take more care to
-       get close initial continue positions when the start position is
-       inside a literal or macro.  Do not call the callback for spots
-       before the start position (which can happen e.g. for `c-decl-end'
-       spots inside comments).  Optimize better in special cases when the
-       region is a single line inside a literal or macro (typically when
-       the current line is refontified).
-
-       * progmodes/cc-engine.el (c-guess-basic-syntax): Simplify calls
-       to `c-add-stmt-syntax' - there's no need to explicitly whack off
-       entries from the paren state.
-
-       * progmodes/cc-engine.el (c-add-stmt-syntax): Narrow down the
-       special case for "else if" clauses.
-
-       * progmodes/cc-engine.el (c-looking-at-inexpr-block)
-       (c-add-stmt-syntax): Use `c-recognize-paren-inexpr-blocks'.
-
-       * progmodes/cc-langs.el (c-recognize-paren-inexpr-blocks):
-       New language variable to recognize the gcc extension with statement
-       blocks inside expressions.
-
-       * progmodes/cc-engine.el (c-add-stmt-syntax): Restructure to make
-       it somewhat more comprehensible.  The argument AT-BLOCK-START is
-       no longer used and hence removed.
-
-       (c-guess-continued-construct, c-guess-basic-syntax): Update calls
-       to `c-add-stmt-syntax'.
-
-       * progmodes/cc-engine.el (c-backward-to-decl-anchor):
-       Use `c-beginning-of-statement-1' instead of duplicating parts of it.
-       This fixes bogus label recognition.
-
-       * progmodes/cc-engine.el (c-add-type, c-check-type)
-       (c-forward-name, c-forward-type): Improve storage of template
-       types in `c-found-types' so that they can be recognized better.
-
-       (c-syntactic-content): Add option to skip past nested parens.
-
-       * progmodes/cc-engine.el (c-forward-name):
-       Set `c-last-identifier-range' all the time.  It's less work that way.
-       Handle that there might not be an identifier to store in
-       `c-last-identifier-range'.
-
-       (c-forward-type): Handle that `c-last-identifier-range' might be
-       nil from `c-forward-name'.
-
-       * progmodes/cc-defs.el (c-safe-scan-lists)
-       (c-(go-)?(up|down)-list-(forward|backward)): Add limit arguments.
-
-       * progmodes/cc-defs.el (c-save-buffer-state): Use `unwind-protect'
-       to work even if the form fails.
-
-       * progmodes/cc-engine.el (c-parse-state): Speedup when moving far
-       down in a large file in one go.
-
-       (c-get-fallback-start-pos): New helper function for `c-parse-state'.
-
-       * progmodes/cc-align.el (c-lineup-assignments): New lineup
-       function which is like `c-lineup-math' but returns nil instead of
-       `c-basic-offset' when it doesn't match.
-
-       (c-lineup-math): Change to use `c-lineup-assignments'.
-
-2005-12-08  Alan Mackenzie  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-cmds.el: Fix some bugs in subfunctions of
-       c-beginning-of-statement.  New subfunctions
-       c-in-comment-line-prefix-p, c-narrow-to-comment-innards.
-
-2005-12-08  Martin Stjernholm  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-fonts.el, cc-langs.el: Use `c-simple-ws' instead of
-       hardcoded char classes whereever possible.  Changed a couple of
-       places to use skip by syntax instead of skip by char class.
-
-       * progmodes/cc-langs.el (c-unterminated-block-comment-regexp):
-       Fix a bug in the regexp that caused extreme backtracking.
-
-       * progmodes/cc-langs.el (c-block-comment-starter)
-       (c-block-comment-ender): New language constants to specify in a
-       single place how block comments look.
-
-       (c-comment-start-regexp, c-block-comment-start-regexp)
-       (comment-start, comment-end, comment-start-skip)
-       (c-syntactic-ws-start, c-syntactic-ws-end, c-nonwhite-syntactic-ws)
-       (c-syntactic-ws, c-nonempty-syntactic-ws)
-       (c-single-line-syntactic-ws, c-syntactic-eol): Now built from
-       `c-line-comment-starter', `c-block-comment-starter' and
-       `c-block-comment-ender'.
-
-       (c-block-comment-regexp, c-unterminated-block-comment-regexp):
-       New language constants to break up things a bit.
-
-       (c-simple-ws): New language constant for simple whitespace.
-
-       * progmodes/cc-defs.el (c-concat-separated): New convenience function.
-
-       * progmodes/cc-defs.el (c-make-keywords-re): Add kludge for bug
-       in `regexp-opt' in Emacs 20 and XEmacs when strings contain
-       newlines.  Allow and ignore nil elements in the list.
-
-2005-12-08  Alan Mackenzie  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-cmds.el: Comment out a (n almost certainly
-       superfluous) check, (eq here (point-max)) in c-beginning-of-statement.
-
-       * progmodes/cc-cmds.el: Tidy up the comments in
-       c-beginning-of-statement and subfunctions.
-
-       * progmodes/cc-awk.el: Replace calls to put-text-property to the
-       more flexible c-put-char-property and c-clear-char-properties.
-       Add the author's email address.
-
-       * progmodes/cc-langs.el (c-block-comment-start-regexp): New variable.
-
-       * progmodes/cc-cmds.el: Fix bug with M-e, when point is inside the
-       closing "*/" of a block comment.
-
-       * progmodes/cc-cmds.el: Tidy c-beginning-of-sentence (and
-       subfunctions) so that it works at BOB and EOB.
-
-       * progmodes/cc-cmds.el, cc-vars.el: More updating of
-       c-beginning-of-statement, including new variable
-       c-block-comment-start-regexp.
-
-2005-12-08  Martin Stjernholm  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-langs.el (c-known-type-key): Optimize simple
-       symbols from `*-font-lock-extra-types' so that there's no need to
-       use `regexp-opt' on those lists.
-
-       * progmodes/cc-langs.el (c-type-decl-suffix-key): Fix when
-       `c-type-modifier-kwds' is empty.
-
-       * progmodes/cc-fonts.el (c-font-lock-invalid-string): Fix when
-       there are several strings on the same line.
-
-       * progmodes/cc-engine.el (c-literal-limits): Remove the
-       compatibility function for older emacsen.  `c-literal-limits-fast'
-       has now taken the place of this function.
-
-       * progmodes/cc-vars.el (c-emacs-features): Remove compatibility
-       with older emacsen: We now require `pps-extended-state'.
-
-2005-12-08  Alan Mackenzie  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-cmds.el: New function c-beginning-of-sentence,
-       which obviates the need to hack sentence-end.  This now handles
-       escaped newlines in strings correctly.  Correct minor bugs in
-       c-move-over-sentence and in c-beginning-of-statement.
-
-       * progmodes/cc-cmds.el (c-beginning-of-statement (and
-       subfunctions)): Adapt c-\(back\|forward\)-over-illiterals such
-       that movement over macros and code are rigorously separated from
-       eachother.  Correct a few incidental bugs.
-
-       * progmodes/cc-cmds.el: Restructure c-beginning-of-statement:
-       Improve its doc-string.  Improve the handling of certain specific cases.
-
-2005-12-08  Martin Stjernholm  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-engine.el, cc-fonts.el, cc-langs.el
-       (c-guess-basic-syntax): Change the way class-level labels are
-       recognized; they can now contain essentially any symbols.
-
-       (c-opt-extra-label-key): New language variable to cope with the
-       special protection label syntax in Objective-C.
-
-       (c-opt-access-key): Remove; this is now handled better by
-       `c-nonlabel-token-key' and `c-opt-extra-label-key'.
-
-       (c-complex-decl-matchers): Update to handle that
-       `c-opt-access-key' no longer exists.
-
-       * progmodes/cc-engine.el (c-guess-basic-syntax): Make use of the
-       improved label recognition in `c-beginning-of-statement-1'.
-
-       * progmodes/cc-engine.el (c-beginning-of-member-init-list):
-       Recognize bitfields better.
-
-       * progmodes/cc-engine.el (c-beginning-of-inheritance-list):
-       Remove some cruft and fixed a bug that could cause it to go to a
-       position further down.
-
-       * progmodes/cc-langs.el, cc-engine.el
-       (c-beginning-of-statement-1): Improve detection of labels in
-       declaration contexts.
-
-       (c-beginning-of-decl-1): Use it.
-
-       (c-nonlabel-token-key): New language constant and variable needed
-       by `c-beginning-of-statement-1'.
-
-       * progmodes/cc-engine.el (c-guess-basic-syntax): Fix bug that
-       manifested itself due to the correction in `c-forward-sexp'.
-
-       * progmodes/cc-defs.el (c-forward-sexp, c-backward-sexp):
-       Make these behave as documented when used at the buffer limits.
-
-       * progmodes/cc-mode.el, cc-engine.el, cc-langs.el
-       (c-type-decl-end-used): Made this a language variable.
-
-       * progmodes/cc-mode.el (c-after-change): Widen the buffer to work
-       correctly when `combine-after-change-calls' is used together with
-       temporary narrowings.
-
-       * progmodes/cc-engine.el (c-beginning-of-statement-1):
-       Report labels correctly when the start point is immediately after the
-       colon.
-
-       * progmodes/cc-defs.el (c-parse-sexp-lookup-properties):
-       Remove since it isn't used anymore.
-
-       * progmodes/cc-cmds.el (c-electric-lt-gt): Detect and mark angle
-       bracket arglists such as template parens in C++.
-
-       * progmodes/cc-engine.el (c-syntactic-skip-backward): Fix a bug
-       in the last check-in.  Some optimization.
-
-       * progmodes/cc-engine.el (c-syntactic-skip-backward): Fix bug
-       where it could stop at the same level in a preceding sexp when
-       PAREN-LEVEL is set.
-
-       * progmodes/cc-mode.el (c-basic-common-init): Turn on syntax-table
-       text property lookup only when it's needed.
-
-       * progmodes/cc-langs.el, cc-engine.el, cc-fonts.el, cc-mode.el:
-       Change the policy for paren marked angle brackets to be more
-       persistent; once marked they remain marked even when they're found
-       to be unbalanced in the searched region.  This should keep the
-       paren syntax around even when individual lines are refontified in
-       multiline template arglists.
-
-       (c-parse-and-markup-<>-arglists): New dynamically bound variable
-       to control markup so that incorrect angle bracket arglists aren't
-       marked in contexts where the correct value for
-       `c-disallow-comma-in-<>-arglists' isn't known.
-
-       (c-forward-<>-arglist, c-forward-<>-arglist-recur): The reparse
-       argument has become `c-parse-and-markup-<>-arglists'.
-
-       (c-remove-<>-arglist-properties): Remove - no longer used.
-
-       (c-after-change-check-<>-operators): New function used on
-       `after-change-functions' to avoid that "<" and ">" characters that
-       are part of longer operators have paren syntax.
-
-       (c-<>-multichar-token-regexp): New language variable used by
-       `c-after-change-check-<>-operators'.
-
-       (c-after-change): Call `c-after-change-check-<>-operators'.
-
-       (c-font-lock-<>-arglists): Use the context properties set by
-       `c-font-lock-declarations' to set `c-disallow-comma-in-<>-arglists'
-       correctly to avoid doing invalid markup.
-
-       (c-font-lock-declarations): Remove code that undoes the invalid
-       markup done by `c-font-lock-<>-arglists'.
-
-       (c-complex-decl-matchers): `c-font-lock-<>-arglists' now runs
-       after `c-font-lock-declarations'.
-
-       * progmodes/cc-engine.el (c-syntactic-skip-backward):
-       Add paren-level feature.
-
-       (c-guess-basic-syntax): Improve the anchor position for
-       `template-args-cont' in nested template arglists.  There's still
-       much to be desired in this area, though.
-
-2005-12-08  Alan Mackenzie  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-cmds.el, cc-engine.el, cc-langs.el, cc-vars.el:
-       Make the "Text Filling and Line Breaking" commands work for AWK buffers.
-
-2005-12-08  Martin Stjernholm  <bug-cc-mode@gnu.org>
-
-       * progmodes/cc-defs.el, cc-engine.el (c-mode-is-new-awk-p):
-       Removed; (c-major-mode-is 'awk-mode) can be used instead now.
-
-       * progmodes/cc-mode.el: Always set up AWK mode since emacsen where
-       it doesn't work no longer are supported.
-
-       * progmodes/cc-mode.el, cc-styles.el, cc-vars.el, cc-defs.el
-       * cc-engine.el, cc-fonts.el, cc-langs.el, cc-cmds.el: CC Mode now
-       requires support for the syntax-table' text property, which rules
-       out Emacs 19 and XEmacs < 21.4.  Removed various compatibility
-       cruft associated with those versions.
-
-       * progmodes/cc-defs.el, cc-fix.el: CC Mode now requires support
-       for the `syntax-table' text property, which rules out Emacs 19 and
-       XEmacs < 21.4.  Removed various compatibility cruft associated
-       with those versions.
-
-       * progmodes/cc-vars.el (c-emacs-features): CC Mode now requires
-       support for the `syntax-table' text property.
-
-       * progmodes/cc-fonts.el (c-nonbreakable-space-face): Remove the
-       variable and use an extra quoted face name instead.  All the
-       emacsen flavors handle that correctly.
-
-       * progmodes/cc-fonts.el (c-font-lock-complex-decl-prepare)
-       (c-font-lock-declarators, c-font-lock-declarations)
-       (c-complex-decl-matchers, c-basic-matchers-after): Use a text
-       property to mark the items in in declarator lists to handle
-       refontification inside multiline declarations better.
-
-       * progmodes/cc-fonts.el (c-font-lock-declarations): Recognize a
-       construct like "a * b = c;" as a declaration.
-
-2005-12-08  Kim F. Storm  <storm@cua.dk>
-
-       * emulation/cua-base.el (cua-use-hyper-key): Replace by ...
-       (cua-rectangle-modifier-key): ... this.  New defcustom.  Can now
-       select either meta, hyper, or super modifier for rectangle commands.
-       (cua--rectangle-modifier-key): New defvar.
-       (cua--M/H-key): Use it.  Remove special case for `space'.
-       (cua--init-keymaps): Initialize it from cua-rectangle-modifier-key
-       on X, to meta otherwise.  Always bind C-return to toggle
-       rectangle.  Pass ?\s instead of `space' to cua--M/H-key.
-
-       * emulation/cua-rect.el (cua-help-for-rectangle):
-       Use cua--rectangle-modifier-key.  Handle super modifier too.
-       (cua--init-rectangles): Always bind C-return to toggle rectangle.
-       Pass ?\s instead of `space' to cua--M/H-key and cua--rect-M/H-key.
-
-       * ido.el: Move Acknowledgements and History after Commentary.
-       Minor changes to Commentary.
-
-       * emulation/cua-base.el (cua--select-keymaps): Enable repeat
-       keymap if cua--prefix-override-timer is `shift'.
-       (cua--shift-control-prefix): New function; emulate "type prefix
-       key twice" functionality to handle shifted prefix key override.
-       (cua--shift-control-c-prefix, cua--shift-control-x-prefix):
-       New commands.
-       (cua--init-keymaps): Bind them to S-C-c and S-C-x.
-
-2005-12-08  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-insert-heading): Try to do items before
-       headings.
-       (org-agenda-mode): Quote `org-agenda-mode-hook'.
-       (org-insert-item): New function.
-       (org-renumber-ordered-list): Don't skip to higher level lists.
-
-2005-12-08  Juri Linkov  <juri@jurta.org>
-
-       * info.el (Info-mode-map): Bind M-TAB to `Info-prev-reference'.
-
-       * button.el (button-buffer-map): Bind M-TAB to `backward-button'.
-
-       * wid-edit.el (widget-keymap): Bind M-TAB to `widget-backward'.
-
-       * pcvs.el (defun-cvs-mode): Put `definition-name' property on
-       the constructed function name fun-1.
-
-       * cus-edit.el (custom-add-parent-links): Filter out custom-group-link,
-       because such links don't lead to parent documentation.
-
-2005-12-08  Kenichi Handa  <handa@m17n.org>
-
-       * descr-text.el (describe-char): Use *Help-2* buffer if the
-       current buffer is *Help*.  Call describe-text-properties while
-       setting the original buffer.
-
-2005-12-07  Bill Wohler  <wohler@newt.com>
-
-       * files.el (auto-mode-alist): Remove mh-letter-mode.  Unnecessary,
-       and causes problems with non-MH users (such as Gnus users).
-
-2005-12-08  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-find-file-unhook): Delete variable.
-       (gdb-set-gud-minor-mode, gdb-set-gud-minor-mode): Delete functions.
-       (gdb-set-gud-minor-mode-existing-buffers, gdb-init-2): Use GDB
-       command "info sources".  Move calls to GDB command "list".
-       (gdb-find-file-hook): Just use gdb-source-file-list.
-       (gdb-source-file-regexp): Use regexp for pre-GDB 6.4.
-       (gdb-source-file-regexp-1): New regexp for GDB 6.4+ only.
-       (gdb-set-gud-minor-mode-existing-buffers-1): Use it.
-       (gdb-data-list-register-values-handler): Use correct trigger name.
-
-2005-12-07  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-completion-map): Rename from ido-mode-map.
-       (ido-common-completion-map, ido-file-completion-map)
-       (ido-file-dir-completion-map, ido-buffer-completion-map):
-       Rename from ido-mode-....-map.
-       (ido-init-completion-maps): Rename from ido-init-mode-maps.
-       (ido-setup-completion-map): Rename from ido-define-mode-map.
-       (ido-read-internal): Bind minibuffer-local-filename-completion-map
-       to ido-completion-map.
-
-2005-12-07  Kenichi Handa  <handa@m17n.org>
-
-       * international/mule-cmds.el
-       (set-display-table-and-terminal-coding-system): If the coding
-       system specified in `unibyte-display' property is different from
-       the arg coding-system, don't setup standard-display-table.
-
-2005-12-06  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * emacs-lisp/edebug.el (edebug-skip-whitespace): read1:lread.c says
-       that comments end at \n, regardless of selective-display.
-
-2005-12-07  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-error-regexp, gdb-first-post-prompt)
-       (gdb-version): New variables.
-       (gdb-source-file-list, gdb-register-names)
-       (gdb-changed-registers): New variables for use with GDB 6.4+.
-       (gdb-ann3): Replace with...
-       (gdb-init-1, gdb-init-2): ...two new functions.
-       (gdba, gdb-prompt): Call gdb-init-1.
-       (gdb-get-version): New function.  Call gdb-init-2 from here.
-       (gud-watch): Make it work with mouse events too.
-       (gdb-post-prompt): Don't add to queue until GDB version is known.
-       (gdb-speedbar-expand-node, gdb-post-prompt, gdb-registers-mode)
-       (gdb-locals-mode): Use gdb-version.
-       (gdb-memory-format-map, gdb-memory-unit-map)
-       (gdb-locals-watch-map): Rename from gdb-*-*-keymap.
-       (gdb-locals-font-lock-keywords-1)
-       (gdb-locals-font-lock-keywords-2): New variables.
-       (gdb-find-file-hook): Make it work with GDB 6.4+ too.
-       (gdb-set-gud-minor-mode-existing-buffers-1)
-       (gdb-var-list-children-1, gdb-var-list-children-handler-1)
-       (gdb-var-update-1, gdb-var-update-handler-1)
-       (gdb-data-list-register-values-handler)
-       (gdb-data-list-register-values-custom)
-       (gdb-get-changed-registers, gdb-get-changed-registers-handler)
-       (gdb-stack-list-locals-handler, gdb-get-register-names):
-       New functions for use with GDB 6.4+.
-       (gdb-locals-watch-map-1): New variable for use with GDB 6.4+.
-       (gdb-source-file-regexp, gdb-var-list-children-regexp-1)
-       (gdb-var-update-regexp-1, gdb-data-list-register-values-regexp)
-       (gdb-stack-list-locals-regexp)
-       (gdb-data-list-register-names-regexp): New regexps for use with
-       GDB 6.4+.
-
-2005-12-06  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/cc-defs.el (c-emacs-features): Don't assume point-min==1.
-
-2005-12-06  Nozomu Ando  <nand@mac.com>
-
-       * mail/smtpmail.el (smtpmail-try-auth-methods): Make password
-       prompts work for AUTH PLAIN.  Also reported by Steve Allan
-       <seallan@verizon.net>.
-
-2005-12-06  K\e,Aa\e(Broly L\e$,1 q\e(Brentey  <lorentey@elte.hu>
-
-       * frame.el (set-frame-parameter): Add doc string.
-
-2005-12-06  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-occur-highlights): New variable.
-       (org-highlight-new-match, org-remove-occur-highlights): New functions.
-       (org-highlight-sparse-tree-matches): New option.
-       (org-do-occur): New function.
-       (org-get-heading): Make it work also at beginning of line.
-       (org-category-table): New variable.
-       (org-get-category-table, org-get-category)
-       (org-camel-to-words, org-link-search): New functions.
-       (org-select-this-todo-keyword): New variable.
-       (org-todo-list): New command.
-       (org-shiftright, org-shiftleft): New commands.
-       (org-agenda-todo): Add prefix argument.
-       (org-show-hierarchy-above): New option.
-       (org-show-todo-tree): Numerical prefix creates tree for specific
-       TODO keyword.
-       (org-outline-level): New function, to assign a level to plain
-       lists items.
-       (org-cycle-include-plain-lists): New option.
-       (org-mode): Use `org-outline-level' as value of `outline-level'.
-       (org-cycle): Temporarily switch `outline-regexp' if
-       `org-cycle-include-plain-lists' is non-nil.
-       (org-start-icalendar-file): Fix format bug.
-       (org-agenda-get-day-entries): Create category table.
-       (org-agenda-get-todos, org-agenda-get-timestamps)
-       (org-agenda-get-deadlines, org-agenda-get-scheduled)
-       (org-agenda-get-blocks): Use `org-get-category'.
-       (org-context-in-file-links): Rename from
-       `org-line-numbers-in-file-links'.
-
-2005-12-06  Romain Francoise  <romain@orebokech.com>
-
-       * window.el (balance-windows): Delete extraneous third arg in call
-       to `enlarge-window'.
-
-2005-12-06  Kenichi Handa  <handa@m17n.org>
-
-       * international/kinsoku.el (kinsoku-longer): Check eolp, not eobp.
-
-2005-12-06  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-var-create-handler)
-       (gdb-var-evaluate-expression-handler, gdb-frame-handler)
-       (gdb-var-list-children-handler, gdb-var-update-handler):
-       Current buffer is already gdb-partial-output-buffer, don't
-       make it current again.
-
-2005-12-05  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * buff-menu.el (Buffer-menu-use-frame-buffer-list): New user option.
-       (list-buffers-noselect): Use it.
-
-2005-12-05  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * mail/sendmail.el: Remove unnecessary leading-star in docstrings.
-       (mail-yank-ignored-headers): Use regexp-opt.
-       (mail-mode-map): Move initialization into declaration.
-       (mail-sent-via): Remove unused shadowed var `to-line'.
-       (mail-mailer-swallows-blank-line): Use with-temp-buffer.
-       (mail-bury, sendmail-send-it, mail-do-fcc): Use with-current-buffer.
-       (mail-do-fcc): Use dolist and push.
-       (mail-mode-fill-paragraph): Pass the arg to fill-region-as-paragraph.
-       (mail-yank-ignored-headers): Don't autoload.
-
-2005-12-05  Kenichi Handa  <handa@m17n.org>
-
-       * international/mule-cmds.el (set-language-info-internal): New fun.
-       (set-language-info): Call set-language-info-internal to update
-       language-info-alist.  If LANG-ENV is the current one, call
-       set-language-environment to make INFO effective now.
-       (set-language-info-alist): Likewise.
-       (locale-language-names): With locale "en", use English
-       lang. env. but set the default codings to iso-8859-1.
-
-2005-12-04  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-use-inferior-io-buffer)
-       (gdb-speedbar-auto-raise): Echo new state in minibuffer.
-       (gdb-var-create-handler, gdb-assembler-custom): Use search-forward
-       for plain strings.
-       (gdb-frames-mode): Remove redundant call to font-lock-mode.
-       (gdb-all-registers): Rename from toggle-gdb-all-registers.
-       Create registers buffer if necessary.  Echo new state in minibuffer.
-       (gdb-registers-mode-map, gdb-registers-mode): Use gdb-all-registers.
-
-2005-12-03  Chong Yidong  <cyd@stupidchicken.com>
-
-       * info.el (Info-fontify-node): Match external links using
-       non-directory part of filename.
-
-2005-12-04  Juri Linkov  <juri@jurta.org>
-
-       * font-core.el (global-font-lock-mode): Use define-global-minor-mode
-       instead of easy-mmode-define-global-mode.  Add `:group font-lock'.
-       (font-lock-mode): Replace `:group font-lock' with `nil nil nil'
-       because there is no customization option for it.
-
-       * font-lock.el (lisp-font-lock-keywords-1):
-       Add define-global-minor-mode.
-
-       * emacs-lisp/autoload.el (make-autoload): Add define-global-minor-mode.
-
-       * emacs-lisp/derived.el (define-derived-mode): Put `definition-name'
-       properties on the constructed variable names.
-
-       * emacs-lisp/easy-mmode.el (easy-mmode-define-navigation):
-       Put `definition-name' properties on the constructed function names
-       next-sym and prev-sym.
-
-       * emacs-lisp/find-func.el (find-function-regexp):
-       Add define-global-minor-mode.  Replace `easy-mmode-define-global-mode'
-       with `easy-mmode-define-[a-z-]+'.  Add easy-menu-define.
-       (find-variable-regexp): Add easy-mmode-defmap, easy-mmode-defsyntax
-       and easy-menu-define.
-
-       * emacs-lisp/lisp-mode.el: Put `doc-string-elt' property on
-       easy-mmode-define-global-mode and define-global-minor-mode.
-       (lisp-imenu-generic-expression): Add define-global-minor-mode.
-
-       * progmodes/cwarn.el (global-cwarn-mode): Use define-global-minor-mode
-       instead of easy-mmode-define-global-mode.
-
-       * progmodes/idlw-shell.el (idlwave-shell-electric-debug-mode):
-       Use define-minor-mode instead of easy-mmode-define-minor-mode.
-
-       * cus-edit.el (customize-group, customize-group-other-window):
-       Filter out autoloaded options from the group completion list by
-       using heuristics that autoloaded groups don't have `custom-autoload'
-       property on their symbols (they have only `custom-loads').
-
-       * simple.el (completion-setup-function): Put completions-common-part
-       face on complete completion string too (i.e. completion string
-       without completions-first-difference face).
-
-       * man.el (Man-section-regexp): Add 0-9 to support "3X11" sections.
-
-2005-12-03  Eli Zaretskii  <eliz@gnu.org>
-
-       * view.el (view-mode): Doc fix.
-
-       * disp-table.el (standard-display-european): Add to the warning
-       message a reference to the doc string.
-
-       * play/yow.el (apropos-zippy): Call print-help-return-message,
-       similar to other Help and Apropos commands.
-
-       * help.el (print-help-return-message): If pop-up-frames is
-       non-nil, set up help-return-method to delete the help window and,
-       possibly, its frame as well, and don't display message about
-       scrolling the help window.  Doc fix.
-       (help-return-method): Doc fix.
-
-2005-12-03  Martin Rudalics  <rudalics@gmx.at>
-
-       * emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression): Fix bug
-       whereby names of length one or names starting with a
-       symbol-constituent character would not be returned.
-
-2005-12-03  Johan Bockg\e,Ae\e(Brd  <bojohan@dd.chalmers.se>
-
-       * subr.el (atomic-change-group): Add edebug and indentation spec.
-
-2005-12-02  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * completion.el (save-completions-file-name): Fix typo in last change.
-
-2005-12-02  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * info.el: Move back/forward history to the beginning of the tool bar.
-
-2005-12-02  Ken Manheimer  <ken.manheimer@gmail.com>
-
-       * allout.el (eval-when-compile): Remove unnecessary load of cl.
-       Add fset of allout-real-isearch-abort during compile to fix
-       byte-compilation warnings.
-       (allout-mode-p): Move definition of this macro above all uses, or
-       byte compilation in barren Emacs (eg, during Emacs build) will
-       lack the definition.
-       (allout-mode): Move this variable above any uses, or byte
-       compilation will fail.
-       (allout-resolve-xref): Remove use of personal file-reference function.
-       (allout-toggle-current-subtree-encryption): Do the current (ie,
-       visible containing) topic, rather than nearest around point.  Doc fix.
-       (allout-toggle-subtree-encryption): New function, workhorse that
-       works on nearest topic containing point.
-       (allout-encrypt-string): Signal requirement for newer version of pgg.
-       (allout-resumptions): Doc fix.
-
-2005-12-02  Eli Zaretskii  <eliz@gnu.org>
-
-       * international/latexenc.el (latex-inputenc-coding-alist): Doc fix.
-
-2005-12-02  Agustin Martin  <agustin.martin@hispalinux.es>
-
-       * textmodes/flyspell.el (flyspell-external-point-words):
-       Consider a misspelling as found in the string search if: (a) misspelling
-       and found string lengths match, or (b) misspelling is found as
-       element in a boundary-chars separated longer string, or (c)
-       ispell-program-name is really ispell and misspelling is found as
-       part of a TeX string.  After successful match move beginning of
-       search region to end of match.  Warn about not found misspellings
-       once the process is done.
-       (flyspell-large-region): Do not set ispell-parser to tex if in TeX mode.
-
-2005-12-02  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-menu-map): Put gud-finish back on the
-       tool bar (removed inadvertently).
-
-2005-12-02  Juri Linkov  <juri@jurta.org>
-
-       * log-view.el (log-view-diff): Clarify doc string.
-
-2005-12-01  Bill Wohler  <wohler@newt.com>
-
-       * Makefile.in (mh-loaddefs.el): Reinsert Change Log as its absence
-       triggers lm-verify errors.
-
-2005-12-01  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * simple.el (transient-mark-mode, line-number-mode)
-       (column-number-mode, size-indication-mode): Remove `:require nil'.
-
-2005-12-01  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-ann3): Bind mouse-2 to gdb-mouse-until
-       in the margin also.
-       (gdb-breakpoints-mode-map): Use D instead of d for
-       gdb-delete-breakpoint.
-       (gdb-get-frame-number): Require a number to match on.
-       (gdb-threads-mode-map): Add follow-link binding.
-
-2005-11-30  Jason Rumney  <jasonr@gnu.org>
-
-       * isearch.el (isearch-mode-map): Avoid exiting search on
-       language-change event.
-
-2005-11-30  Romain Francoise  <romain@orebokech.com>
-
-       * speedbar.el (speedbar-default-position): New defcustom.
-       (speedbar-frame-reposition-smartly): Use it.
-
-       * dframe.el (dframe-reposition-frame-emacs): Fix position
-       computation for `left' location.
-       Update copyright year.
-
-2005-11-30  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * help.el (help-map): Move initialization into declaration.
-
-       * emacs-lisp/autoload.el (make-autoload): Handle defgroup specially.
-
-       * help-fns.el (help-argument-name): Don't autoload.
-       It's useless and triggers a bug in cus-dep.el causing ldefs-boot
-       to be re-loaded when customizing the `help' group.
-
-2005-11-30  John Paul Wallington  <jpw@gnu.org>
-
-       * help-fns.el (describe-function-1): Fill arglist output.
-
-2005-11-30  Kim F. Storm  <storm@cua.dk>
-
-       * emulation/cua-rect.el (cua--rectangle-overlays): Make permanent-local.
-       (cua--rectangle-post-command): Cleanup overlays and deactivate mark
-       after revert-buffer (or anything else which kills all local variables).
-
-       * apropos.el (apropos-parse-pattern): Doc fix.
-       Set apropos-regexp directly, rather than expecting callers to do so.
-       (apropos-command, apropos, apropos-value, apropos-documentation):
-       Simplify calls to apropos-parse-pattern.
-
-2005-11-29  Chong Yidong  <cyd@stupidchicken.com>
-
-       * hi-lock.el (hi-lock-line-face-buffer, hi-lock-face-buffer)
-       (hi-lock-face-phrase-buffer): Use hi-yellow face.
-       (hi-lock-write-interactive-patterns): Use comment-region.
-
-       * longlines.el (longlines-mode): Add mail-setup-hook.
-
-       * mail/mailheader.el, mail/sendmail.el: Revert 2005-11-17 changes.
-
-       * simple.el (sendmail-user-agent-compose, next-line):
-       Conditionally use hard-newline.
-
-2005-11-29  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * international/latexenc.el (latex-inputenc-coding-alist):
-       Reword doc string.
-
-2005-11-29  Chong Yidong  <cyd@stupidchicken.com>
-
-       * help.el (describe-key-briefly, describe-key): Recognize default
-       bindings.
-
-2005-11-29  Romain Francoise  <romain@orebokech.com>
-
-       * view.el (view-inhibit-help-message): New defcustom.
-       (view-mode-enter): Use it.
-
-2005-11-29  Michael Kifer  <kifer@cs.stonybrook.edu>
-
-       * ediff-wind.el (ediff-setup-control-frame, ediff-make-wide-display):
-       Preserve user position.
-
-2005-11-28  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * font-lock.el: Throw error if facemenu is not loaded to prevent
-       accidental change of loading order in loadup.el.  (Suggested by RMS.)
-
-       * loadup.el: Add comment explaining why facemenu must be loaded
-       before font-lock.
-
-2005-11-28  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc.el: Change global keybinding for calc-dispatch to "\C-x*".
-       (calc-dispatch-map): Add more keys for `calc-same-interface'.
-
-       * calc/calc-misc.el (calc-dispatch-help): Update docstring.
-
-       * calc/calc-embed.el (calc-do-embedded): Update help message.
-
-       * calc/calc-prog.el (calc-user-define-invokation): Update help message.
-
-2005-11-28  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * log-edit.el (log-edit-insert-cvs-rcstemplate): Ignore stderr.
-
-       * emacs-lisp/elp.el (elp-not-profilable): Replace interactive-p with
-       called-interactively-p.
-       (elp-profilable-p): Rename from elp-not-profilable-p.
-       Invert result and take into account macros and autoloaded functions.
-       (elp-instrument-function): Update call.
-       (elp-instrument-package): Update call.  Add completion.
-       (elp-pack-number): Use match-string.
-       (elp-results-jump-to-definition-by-mouse): Merge into
-       elp-results-jump-to-definition and then remove.
-       (elp-output-insert-symname): Make help echo text single-line.
-
-       * replace.el (query-replace-map): Move initialization into declaration.
-       (occur-engine): Use with-current-buffer.
-       (occur-mode-goto-occurrence): Make it work for mouse-clicks as well.
-       (occur-mode-mouse-goto): Replace with an alias.
-
-2005-11-28  Juri Linkov  <juri@jurta.org>
-
-       * simple.el (quoted-insert): Let-bind input-method-function to nil.
-
-       * term/w32-win.el: Bind [S-tab] to [backtab].
-
-       * info.el (Info-fontify-node): Set 2nd arg `noerror' of
-       `Info-find-file' to t.
-
-       * replace.el (occur-mode-mouse-goto): Pop, don't switch.
-       (occur-mode-goto-occurrence): Let-bind same-window-buffer-names
-       and same-window-regexps.
-       (occur-next-error): Don't move point for arg 0.
-
-2005-11-28  Chong Yidong  <cyd@stupidchicken.com>
-
-       * replace.el (occur-mode-goto-occurrence): Pop, don't switch.
-
-2005-11-28  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * log-edit.el (log-edit-changelog-use-first): New var.
-       (log-edit-changelog-ours-p): Use it.
-       (log-edit-insert-changelog): Set it with new arg `use-first'.
-       (log-edit-insert-cvs-rcstemplate, log-edit-insert-filenames): New funs.
-       (log-edit-hook): Add them to the list of suggested options.
-
-       * textmodes/flyspell.el (flyspell-last-buffer): New var.
-       (flyspell-accept-buffer-local-defs): Use it to avoid doing silly
-       redundant work.
-       (flyspell-mode-on): Use add-hook for after-change-functions.
-       (flyspell-mode-off): Use remove-hook for after-change-functions.
-       (flyspell-changes): Make it buffer-local.
-       (flyspell-after-change-function): Make it non-interactive.  Use push.
-       (flyspell-post-command-hook): Check input-pending-p while processing
-       the potentially long list of buffer changes.
-
-2005-11-28  K\e,Aa\e(Broly L\e$,1 q\e(Brentey  <lorentey@elte.hu>
-
-       * buff-menu.el (list-buffers-noselect): Display the selected
-       frame's buffer list, not the global one.
-
-2005-11-28  Nick Roberts  <nickrob@snap.net.nz>
-
-       * xt-mouse.el (xterm-mouse-event): Set last-input-event so
-       that (list last-input-event) works as in interactive spec.
-
-2005-11-27  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * loadup.el ("facemenu"): Load facemenu before font-lock, because
-       `facemenu-keymap' needs to be defined when font-lock is loaded.
-       Otherwise, `M-o M-o' is not bound to `font-lock-fontify-block'.
-
-2005-11-27  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * completion.el: Remove useless leading * in defcustom docstrings.
-       (save-completions-file-name): Use ~/.emacs.d if available.
-       (completion-standard-syntax-table): Rename from
-       cmpl-standard-syntax-table and fold initialization into declaration,
-       thus removing cmpl-make-standard-completion-syntax-table.
-       (completion-lisp-syntax-table, completion-c-syntax-table)
-       (completion-fortran-syntax-table, completion-c-def-syntax-table): Idem.
-       (cmpl-saved-syntax, cmpl-saved-point): Remove.
-       (symbol-under-point, symbol-before-point)
-       (symbol-under-or-before-point, symbol-before-point-for-complete)
-       (add-completions-from-c-buffer): Use with-syntax-table.
-       (make-completion): Don't return a list of completion entries.
-       Update callers.
-       (cmpl-prefix-entry-head, cmpl-prefix-entry-tail): Use defalias.
-       (completion-initialize): Rename from initialize-completions.
-       (completion-find-file-hook): Rename from cmpl-find-file-hook.
-       (kill-emacs-save-completions): Collect stats here.
-       (save-completions-to-file, load-completions-from-file):
-       Use with-current-buffer.
-       (completion-def-wrapper): Rename from def-completion-wrapper.  Make it
-       into a function.  Move all calls to toplevel.
-       (completion-lisp-mode-hook): New fun.
-       (completion-c-mode-hook, completion-setup-fortran-mode):
-       Set the syntax-table here.  Use local-set-key.
-       (completion-saved-bindings): New var.
-       (dynamic-completion-mode): Make it into a proper minor mode.
-       (load-completions-from-file): Remove unused var `num-uses'.
-
-       * emacs-lisp/cl-macs.el (defstruct): Don't define the default
-       constructor if it is explicitly overridden.
-
-       * complete.el (PC-completion-as-file-name-predicate):
-       Use minibuffer-completing-file-name.
-       (partial-completion-mode): Use find-file-not-found-functions.
-       (PC-lisp-complete-symbol): Use with-syntax-table.
-       (PC-look-for-include-file): Remove dead setq.
-       (PC-look-for-include-file, PC-expand-many-files, PC-do-completion)
-       (PC-complete): Use with-current-buffer.
-
-       * progmodes/sh-script.el (sh-font-lock-syntactic-keywords): \ doesn't
-       escape single quotes.
-
-2005-11-27  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * dabbrev.el (dabbrev-completion): Simplify code, by getting rid
-       of `if' whose condition always returned nil.  Doc fix.
-
-       * buff-menu.el (Buffer-menu-revert-function): Make the selected
-       window's buffer the current buffer around the call to
-       `list-buffers-noselect'.  This is necessary to mark that buffer
-       with a `.' in the Buffer Menu when called from Lisp, for instance
-       by Auto Revert Mode.
-
-2005-11-28  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-stopped): Detect child process when
-       attaching to it.
-       (gdb-pre-prompt): Make sure gdb-error is reset.
-
-       * progmodes/gud.el (gud-gdb-marker-filter): When GDB is invoked
-       with a child process, detect it.
-       (gud-speedbar-buttons): Match regexp more carefully.
-
-2005-11-27  Richard M. Stallman  <rms@gnu.org>
-
-       * mouse.el (mouse-drag-move-window-bottom):
-       Use adjust-window-trailing-edge.
-
-2005-11-27  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * simple.el (blink-matching-open): Ignore
-       `blink-matching-paren-on-screen' if `show-paren-mode' is enabled.
-       (blink-matching-paren-on-screen): Update docstring.
-
-       * paren.el (show-paren-mode): No longer change
-       `blink-matching-paren-on-screen'.
-
-2005-11-27  John Paul Wallington  <jpw@pobox.com>
-
-       * progmodes/gdb-ui.el (gdb-goto-breakpoint, gdb-frames-select)
-       (gdb-threads-select, gdb-edit-register-value):
-       Use `posn-set-point' instead of `mouse-set-point' because the
-       latter is not fbound when configured without X.
-
-2005-11-27  Kim F. Storm  <storm@cua.dk>
-
-       * emulation/cua-rect.el (cua--highlight-rectangle): Preserve
-       existing face when partially highlighting a TAB in a rectangle.
-
-2005-11-26  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-mode-map): Doc fix.
-       (ido-mode-common-map, ido-mode-file-map)
-       (ido-mode-file-dir-map, ido-mode-buffer-map): New keymaps.
-       (ido-define-mode-map): Rewrite.  Select one of the new maps as
-       parent for ido-mode-map instead of building from scratch.
-       (ido-init-mode-maps): New defun to initialize new maps.
-       (ido-mode): Call it.
-       (ido-switch-buffer): Doc fix -- use \<ido-mode-buffer-map>.
-       (ido-find-file): Doc fix -- use \<ido-mode-file-map>.
-
-2005-11-26  John Paul Wallington  <jpw@pobox.com>
-
-       * arc-mode.el (archive-extract): Use `posn-set-point' instead of
-       `mouse-set-point' because the latter is not fbound when configured
-       without X.
-
-2005-11-26  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * files.el (file-relative-name): Doc fix.
-
-2005-11-26  Kurt Hornik  <Kurt.Hornik@wu-wien.ac.at>
-
-       * progmodes/octave-inf.el (inferior-octave-startup): Force a
-       non-empty string for secondary prompt PS2.
-
-2005-11-25  Chong Yidong  <cyd@stupidchicken.com>
-
-       * progmodes/compile.el (compilation-setup): Fix last change.
-
-2005-11-26  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-info-breakpoints-custom)
-       (gdb-mouse-toggle-breakpoint-margin)
-       (gdb-mouse-toggle-breakpoint-fringe, gdb-threads-select):
-       Add gdb-server-prefix to keep out of command history.
-       (gdb-edit-register-value): New function.
-       (gdb-registers-mode-map): Bind mouse-2 and RET to it.
-       (gdb-info-registers-custom): Use above map.
-
-2005-11-25  Chong Yidong  <cyd@stupidchicken.com>
-
-       * custom.el (enable-theme): Signal error if argument is not a
-       theme.  Don't recalculate a face if it's not loaded yet.
-
-       * cus-face.el (custom-theme-set-faces): Don't change saved-face if
-       the `user' theme is in effect.
-
-       * info.el (Info-on-current-buffer): Record actual filename in
-       Info-current-file, instead of t, or a fake filename if a non-file
-       buffer.  Make autoload.
-       (Info-find-node, Info-revert-find-node): No need to check for
-       Info-current-file nil.
-       (Info-set-mode-line, Info-up, Info-copy-current-node-name):
-       Info-current-file is now never `t'.
-       (Info-fontify-node): Many simplifications due to Info-current-file
-       always being valid.  Use Info-find-file to find node filename.
-
-2005-11-25  David Kastrup  <dak@gnu.org>
-
-       * longlines.el (longlines-wrap-line): Reorder wrapping to "insert
-       new character, then delete" in order to preserve markers.
-
-2005-11-25  David Ponce  <david@dponce.com>
-
-       * recentf.el (recentf-arrange-by-rule): Handle a special
-       `auto-mode-alist'-like "strip suffix" rule.
-       (recentf-build-mode-rules): Handle second level auto-mode entries.
-
-2005-11-25  Michael Kifer  <kifer@cs.stonybrook.edu>
-
-       * viper-keym.el (viper-ESC-key): Use different values in terminal and
-       window modes.
-
-       * viper.el (viper-emacs-state-mode-list): Delete mail-mode, add
-       jde-javadoc-checker-report-mode.
-
-       * ediff-wind (ediff-make-wide-display): Slight simplification.
-
-       * ediff.el (ediff-date): Change the date of last update.
-
-2005-11-24  Chong Yidong  <cyd@stupidchicken.com>
-
-       * hi-lock.el (hi-lock-buffer-mode): Renamed from `hi-lock-mode'.
-       Use define-minor-mode, and make it a local mode.  Turn on font-lock.
-       (hi-lock-mode): New global minor mode.
-       (turn-on-hi-lock-if-enabled): New function.
-       (hi-lock-line-face-buffer, hi-lock-face-buffer, hi-lock-set-pattern):
-       Change arguments to regexp and face instead of a font-lock pattern.
-       Directly set face property, instead of refontifying.
-       (hi-lock-font-lock-hook): Check if font-lock is being turned on.
-       (hi-lock-find-patterns): Use line-number-at-pos.
-
-       (hi-lock-face-phrase-buffer): Call hi-lock-buffer-mode.  Use new
-       arguments for hi-lock-set-pattern.
-       (hi-lock-unface-buffer, hi-lock-set-file-patterns):
-       Call font-lock-fontify-buffer.
-       (hi-lock-find-file-hook, hi-lock-current-line)
-       (hi-lock-refontify, hi-lock-set-patterns): Delete unused functions.
-
-       (hi-lock-font-lock-hook): Turn off hi-lock when font lock is
-       turned off.
-
-       * progmodes/compile.el (compilation-setup): Don't fiddle with
-       font-lock-defaults.
-
-2005-11-25  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-var-create-handler)
-       (gdb-var-list-children-handler): Find values for all variable
-       objects.  gud-speedbar-buttons decides whether to display them.
-
-2005-11-24  Romain Francoise  <romain@orebokech.com>
-
-       * info.el (Info-speedbar-fetch-file-nodes): Prefix temporary
-       buffer name with a space.
-
-2005-11-24  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-export-plain-list-max-depth): Rename from
-       `org-export-local-list-max-depth'.  Change default value to 3.
-       (org-auto-renumber-ordered-lists)
-       (org-plain-list-ordered-item-terminator): New options.
-       (org-at-item-p, org-beginning-of-item, org-end-of-item)
-       (org-get-indentation, org-get-string-indentation)
-       (org-maybe-renumber-ordered-list, org-renumber-ordered-list):
-       New functions.
-       (org-move-item-down, org-move-item-up): New commands.
-       (org-export-as-html): New classes for CSS support.  Bug fix in
-       regular expression detecting fixed-width regions.  Respect
-       `org-local-list-ordered-item-terminator'.
-       (org-set-autofill-regexps, org-adaptive-fill-function): "1)" is
-       also a list item.
-       (org-metaup, org-metadown, org-shiftmetaup, org-shiftmetadown):
-       New item moving functions.
-
-2005-11-24  Juri Linkov  <juri@jurta.org>
-
-       * isearch.el (isearch-repeat): With empty search ring set
-       `isearch-error' to the error string instead of signaling error
-       with the function `error'.
-
-2005-11-24  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el: Make modifier `ctrl' an alias for `control'.
-
-2005-11-24  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-speedbar-auto-raise): New function
-       and variable.
-       (gdb-var-create-handler, gdb-var-list-children-handler):
-       Don't match on "char **...".
-       (gdb-var-update-handler): Find values for all variable objects.
-       (gdb-info-frames-custom): Identify frames by leading "#".
-
-       * progmodes/gud.el (gud-speedbar-menu-items): Add
-       gdb-speedbar-auto-raise as radio button.
-       (gud-speedbar-buttons): Raise speedbar if requested.
-       Don't match on "char **...".
-       (gud-speedbar-buttons): Add (pointer) value for non-leaves.
-       Make it editable.
-
-2005-11-23  Chong Yidong  <cyd@stupidchicken.com>
-
-       * info.el (Info-fontify-node): Handle the case where
-       Info-current-file is t.
-
-2005-11-23  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * simple.el (blink-matching-open): Fix off-by-one in last change.
-
-2005-11-23  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el: Don't change default directory.
-
-2005-11-22  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * cus-edit.el (Custom-reset-standard): Make it handle Custom group
-       buffers correctly.  (It used to throw an error in such buffers.)
-       Make it ask for confirmation in group buffers and other Custom
-       buffers containing more than one customization item.
-
-2005-11-22  John Paul Wallington  <jpw@gnu.org>
-
-       * net/goto-addr.el (goto-address-fontify): Put `follow-link'
-       property on mail and url overlays.
-       (goto-address-at-point): Use `posn-set-point' instead of
-       `mouse-set-point' because the latter is not fbound when configured
-       without X.
-
-2005-11-22  Lars Hansen  <larsh@soem.dk>
-
-       * ls-lisp.el (ls-lisp-parse-symlink): Delete.
-       (ls-lisp-classify, ls-lisp-format): Delete call to
-       ls-lisp-parse-symlink.
-       (ls-lisp-handle-switches): Handle symlinks to directories as
-       directories when ls-lisp-dirs-first in non-nil.
-
-2005-11-21  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * startup.el (command-line): Make sure that loaddefs.el is handled
-       correctly in load-history.
-
-2005-11-22  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-locals-watch-keymap): New local map.
-       (gdb-struct-string, gdb-array-string): New constants.
-       (gdb-info-locals-handler): Use them.
-       (gdb-reset): Reset gdb-var-list to nil.
-
-2005-11-21  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/sh-script.el (sh-font-lock-paren): Handle continued lines
-       in patterns.
-
-2005-11-21  Juri Linkov  <juri@jurta.org>
-
-       * custom.el (defcustom): Update link types in docstring.
-
-2005-11-20  Martin Rudalics  <rudalics@gmx.at>
-
-       * custom.el (defgroup): Add doc-string-elt info.
-
-       * widget.el (define-widget): Don't use declare for the doc-string-elt.
-
-2005-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * newcomment.el (comment-enter-backward): Fix last fix.
-
-       * simple.el (blink-matching-open):
-       * paren.el (show-paren-function): Allow new paren-class info.
-
-2005-11-20  Chong Yidong  <cyd@stupidchicken.com>
-
-       * faces.el: Revert 2005-11-17 change.  :ignore-defface is now
-       handled automagically.
-
-2005-11-20  Andreas Schwab  <schwab@suse.de>
-
-       * descr-text.el (describe-char): When copying overlays put them
-       over the full char description instead of just the first character
-       of it.
-
-2005-11-20  Juri Linkov  <juri@jurta.org>
-
-       * simple.el (what-cursor-position):
-       * descr-text.el (describe-char): Use Lisp-readable syntax
-       for octal and hex.  Reorder decimal, octal and hex values.
-       Remove excess whitespace in the output.  Use `=' in `column='
-       like in `point=' and `Hscroll='.
-
-       * international/mule-cmds.el (encoded-string-description):
-       Use Lisp-readable syntax for hex.
-
-2005-11-19  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * newcomment.el (comment-enter-backward): Handle the case where the
-       comment is closed by EOB.
-
-2005-11-19  Chong Yidong  <cyd@stupidchicken.com>
-
-       * longlines.el (longlines-before-revert-hook)
-       (longlines-after-revert-hook): New functions.
-       (longlines-mode): Turn off longlines temporarily when reverting.
-       Add a message-setup-hook.
-       (longlines-decode-buffer): New function.
-       (longlines-wrap-line): Preserve marker positions.
-
-2005-11-19  Andreas Schwab  <schwab@suse.de>
-
-       * emacs-lisp/shadow.el: Handle compressed files.
-
-2005-11-19  Romain Francoise  <romain@orebokech.com>
-
-       * net/browse-url.el (browse-url-default-browser): Signal an error
-       if no usable browser can be found, rather than try to load w3.
-
-2005-11-16  Ryan Yeske  <rcyeske@gmail.com>
-
-       * net/rcirc.el (rcirc-mangle-text): Add bold face property without
-       replacing existing properties.
-       (rcirc-my-nick, rcirc-other-nick, rcirc-server)
-       (rcirc-nick-in-message, rcirc-prompt): Use min-colors and remove
-       tty specs.
-       (rcirc-server-prefix, rcirc-server): New faces.
-       (rcirc-url-regexp): Generate with rx macro.
-       (rcirc-last-server-message-time): New variable.
-       (rcirc-filter): Record time of last message.
-       (rcirc-keepalive): Kill processes that did not send a message
-       since the last ping.
-       (rcirc-mode): Give rcirc-topic a local binding here.
-
-2005-11-19  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac@lrde.org>
-
-       * subr.el (read-passwd): Fontify the prompt as we do with other
-       prompts.
-
-2005-11-19  Ryan Yeske  <rcyeske@gmail.com>
-
-       * ffap.el (ffap-menu-rescan): Use inhibit-read-only instead of
-       binding buffer-read-only to nil.
-
-2005-11-19  Eli Zaretskii  <eliz@gnu.org>
-
-       * complete.el (partial-completion-mode):
-       Mention completion-auto-help in the doc string.
-
-       * man.el (Man-highlight-references): Doc fix.  Reformat code in a
-       more Lisp-ish way.
-
-2005-11-19  Slawomir Nowaczyk  <slawomir.nowaczyk.847@student.lu.se>  (tiny change)
-
-       * ls-lisp.el (ls-lisp-format-file-size): Format file size with 9
-       digits, not 8, to avoid misalignment for files larger than 100MB.
-
-2005-11-19  Eli Zaretskii  <eliz@gnu.org>
-
-       * menu-bar.el (menu-bar-describe-menu) <list-keybindings>:
-       Mention "keyboard shortcuts" in the help text.
-
-2005-11-19  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * startup.el (fancy-splash-default-action): Discard only
-       mouse-down and succeeding mouse-up events in the splash screen
-       window so that drag-n-drop event can be processed.
-
-2005-11-18  Chong Yidong  <cyd@stupidchicken.com>
-
-       * longlines.el (longlines-mode): Add hacks for mail-mode and
-       message-mode.
-
-2005-11-18  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-table-sort-lines): New command.
-       (org-tbl-menu): Add entry for `org-table-sort-lines'.
-       (org-add-file): Command removed, use `org-agenda-file-to-front'
-       instead.
-       (org-export-icalendar): Use `org-icalendar-combined-name'.
-       (org-cycle-agenda-files, org-agenda-file-to-end)
-       (org-agenda-file-to-front): New commands.
-       (org-table-tab-jumps-over-hlines, org-export-html-style):
-       New options.
-       (org-table-next-field): Use `org-table-tab-jumps-over-hlines'.
-       (org-at-table.el-p, org-set-autofill-regexps, org-html-protect):
-       New functions.
-       (org-fill-paragraph): Call `org-table-align' in tables.
-       (org-mode): Call `org-set-autofill-regexps'.
-       (org-export-as-html): Support for local handformatted lists.
-       Modified to produce valid HTML 4.0.  Use `org-export-html-style'.
-       (org-export-local-list-max-depth): New option.
-       (org-html-expand): Use `org-html-protect'.
-
-2005-11-18  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-install-speedbar-variables): Bind gud-pp
-       to "p".
-       (gdb): Move definition of gud-pp to...
-
-       * progmodes/gdb-ui.el (gdb-ann3): ...here.  Make it work in the
-       speedbar.
-       (gdb-find-watch-expression): New function.
-
-2005-11-17  Chong Yidong  <cyd@stupidchicken.com>
-
-       * faces.el (face-attribute, set-face-attribute): Mention existence
-       of `:ignore-defface' setting in docstring.
-
-2005-11-17  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * simple.el (completion-setup-function): Fix last change.
-
-2005-11-17  John Paul Wallington  <jpw@pobox.com>
-
-       * ibuf-ext.el (ibuffer-interactive-filter-by-mode):
-       Use `posn-set-point' instead of `mouse-set-point' because the
-       latter is not fbound when configured without X.
-
-       * comint.el (comint-insert-input): Likewise.
-
-2005-11-17  Chong Yidong  <cyd@stupidchicken.com>
-
-       * simple.el (hard-newline): New variable.
-       (sendmail-user-agent-compose, next-line): Use it.
-
-       * mail/sendmail.el (mail-setup, mail-send, mail-insert-from-field)
-       (sendmail-send-it, mail-do-fcc, mail-cc, mail-bcc, mail-fcc)
-       (mail-mail-reply-to, mail-mail-followup-to)
-       (mail-position-on-field, mail-signature, mail-yank-original)
-       (mail-attach-file): Likewise.
-
-       * mail/mailheader.el (mail-header-format)
-       (mail-header-format-function): Likewise.
-
-       * add-log.el (add-change-log-entry, change-log-merge): Likewise.
-
-2005-11-17  Juri Linkov  <juri@jurta.org>
-
-       * font-lock.el (font-lock-faces): Rename this defgroup from
-       `font-lock-highlighting-faces'.
-       (font-lock-comment-face, font-lock-comment-delimiter-face)
-       (font-lock-string-face, font-lock-doc-face)
-       (font-lock-keyword-face, font-lock-builtin-face)
-       (font-lock-function-name-face, font-lock-variable-name-face)
-       (font-lock-type-face, font-lock-constant-face)
-       (font-lock-warning-face, font-lock-negation-char-face)
-       (font-lock-preprocessor-face)
-       (font-lock-regexp-grouping-backslash)
-       (font-lock-regexp-grouping-construct): Rename :group from
-       `font-lock-highlighting-faces' to `font-lock-faces'.
-
-       * cus-edit.el (lisp, c, tex):
-       * progmodes/ada-mode.el (ada):
-       * progmodes/asm-mode.el (asm):
-       * progmodes/cperl-mode.el (cperl-faces):
-       * progmodes/cpp.el (cpp):
-       * progmodes/dcl-mode.el (dcl):
-       * progmodes/f90.el (f90):
-       * progmodes/fortran.el (fortran):
-       * progmodes/icon.el (icon):
-       * progmodes/idlwave.el (idlwave-misc):
-       * progmodes/m4-mode.el (m4):
-       * progmodes/make-mode.el (makefile):
-       * progmodes/meta-mode.el (meta-font):
-       * progmodes/modula2.el (modula2):
-       * progmodes/octave-mod.el (octave):
-       * progmodes/pascal.el (pascal):
-       * progmodes/perl-mode.el (perl):
-       * progmodes/prolog.el (prolog):
-       * progmodes/ps-mode.el (PostScript-edit):
-       * progmodes/scheme.el (scheme):
-       * progmodes/sh-script.el (sh-script):
-       * progmodes/simula.el (simula):
-       * progmodes/tcl.el (tcl):
-       * textmodes/nroff-mode.el (nroff):
-       * textmodes/reftex-vars.el (reftex-fontification-configurations):
-       * textmodes/sgml-mode.el (sgml):
-       * textmodes/texinfo.el (texinfo):
-       Add :link (custom-group-link font-lock-faces) to defgroup.
-
-       * hi-lock.el (hi-lock): Rename this defgroup from
-       `hi-lock-interactive-text-highlighting'.  Change parent group from
-       `faces' to `font-lock'.  Add link to the manual.
-       (hi-lock-mode, hi-lock-file-patterns-range)
-       (hi-lock-exclude-modes, hi-lock-faces): Rename :group from
-       `hi-lock-interactive-text-highlighting' to `hi-lock'.
-       (hi-lock-faces): Add :group `faces'.
-
-       * cus-edit.el (custom-variable-prompt): Clarify the code.
-
-       * faces.el (face-read-string): Set the default value arg of
-       completing-read.
-
-2005-11-16  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * rfn-eshadow.el (file-name-shadow-properties)
-       (file-name-shadow-tty-properties, file-name-shadow-mode):
-       Remove autoloads, because the file is now preloaded.
-
-2005-11-16  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * printing.el (easy-menu-intern): Don't define.
-       (pr-get-symbol): Use easy-menu-intern only if defined.
-
-       * simple.el (blink-matching-open): Simplify a bit.
-       (completion-setup-function): Fix the case of partial-completion-mode
-       when the minibuffer's contents start with "-".
-       Obey completion-base-size-function even when
-       minibuffer-completing-file-name is non-nil.
-
-2005-11-16  Richard M. Stallman  <rms@gnu.org>
-
-       * net/eudcb-ph.el (eudc-ph-open-session):
-       Use set-process-query-on-exit-flag.
-
-       * mail/smtpmail.el (smtpmail-send-it): Use insert-buffer-contents.
-
-       * international/ucs-tables.el (ucs-set-table-for-input):
-       Use make-local-variable, not make-variable-buffer-local.
-
-       * emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
-       Improve warning message text.
-
-       * savehist.el (savehist-save-hook): Add :group.
-
-       * menu-bar.el (menu-bar-help-menu):
-       Rename Find Extra Packages to External Packages.
-
-       * cus-edit.el (Custom-reset-standard): Verify that
-       :custom-standard-value prop exists before calling it.
-
-       * apropos.el (apropos-calc-scores): Use apropos-pattern.
-
-2005-11-16  Martin Rudalics  <rudalics@gmx.at>
-
-       * wid-edit.el (color): Enclose %t in %{...%}.
-
-       * cus-edit.el (face): Enclose %t in %{...%}.
-
-2005-11-16  Hrvoje Niksic  <hniksic@xemacs.org>
-
-       * savehist.el (savehist-mode-hook): Re-add the var.
-       (savehist-mode): Use it.
-
-2005-11-16  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * textmodes/flyspell.el: Fix commenting convention.
-       Remove unnecessary leading * in custom docstrings.
-       (flyspell-emacs): Remove unused var.
-       (flyspell-delete-region-overlays): Use remove-overlays.
-       (flyspell-accept-buffer-local-defs): Use save-current-buffer.
-       (flyspell-debug-signal-no-check, flyspell-debug-signal-changed-checked)
-       (flyspell-debug-signal-pre-word-checked, flyspell-post-command-hook)
-       (flyspell-debug-signal-word-checked): Use with-current-buffer.
-       (make-flyspell-overlay): Don't locally reuse a global name.
-       (flyspell-highlight-incorrect-region)
-       (flyspell-highlight-duplicate-region): Use flyspell-unhighlight-at.
-       (flyspell-check-previous-highlighted-word): Use flyspell-overlay-p.
-       (flyspell-notify-misspell): Remove unused args `start' and `end'.
-       (flyspell-word): Adjust call accordingly.  Use ispell-send-string.
-       Wrap calls to accept-process-output inside with-local-quit since it's
-       often called from a post-command-hook.
-       (flyspell-correct-word, flyspell-auto-correct-word):
-       Use ispell-send-string.
-       (flyspell-xemacs-popup): Remove unused arg `event'.  Update call.
-
-       * calendar/diary-lib.el (diary-list-entries): Also hide the
-       terminating newline.
-
-2005-11-16  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/reftex.el (reftex-use-fonts): Remove the check for
-       window-system, to allow fonts on tty.
-
-2005-11-17  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-speedbar-item-info): New function.
-       (gud-install-speedbar-variables): Use it to display data type
-       of watch expression as a tooltip in speedbar.
-
-2005-11-15  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * font-core.el (global-font-lock-mode): Add :version keyword,
-       because default was changed.
-
-       * jka-cmpr-hook.el (auto-compression-mode): Ditto.
-
-       * startup.el (command-line): Use `custom-reevaluate-setting' for
-       `file-name-shadow-mode'.
-
-       * loadup.el: Preload rfn-eshadow.
-
-       * rfn-eshadow.el (file-name-shadow-mode): Set :init-value to t.
-       Add :version keyword.
-       (file-name-shadow-properties, file-name-shadow-tty-properties)
-       (file-name-shadow): Add :version keyword.
-
-       * cus-edit.el (custom-add-parent-links): Fix bug whereby, for
-       instance, `(fringe custom-face)' shadowed `(fringe custom-group)'
-       in the custom-group property of the symbol frames and the fringe
-       group got no link to its parent group frames.
-       Doc fix.
-
-2005-11-16  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-stop-subjob): New function.
-       (gud-menu-map, gud-tool-bar-map): Use it.
-
-2005-11-16  Kim F. Storm  <storm@cua.dk>
-
-       * progmodes/gud.el (gud-menu-map): Let [stop] stop program rather
-       than kill it.
-       (gud-tool-bar-map): Likewise.  Move cont/until/finish buttons
-       to a more useful/logical place.
-
-2005-11-16  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-menu-map): Make visibility of stop and
-       go buttons complementary.
-
-2005-11-15  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * rfn-eshadow.el (rfn-eshadow-regexp): Remove.
-       (rfn-eshadow-sifn-equal): New function.
-       (rfn-eshadow-update-overlay): Rewrite to use substitute-in-file-name.
-
-2005-11-15  Michael Kifer  <kifer@cs.stonybrook.edu>
-
-       * viper-utils.el (viper-non-word-characters-reformed-vi):
-       Quote `-' in string.
-
-       * viper.el (viper-emacs-state-mode-list): Ensure that
-       rcirc-mode buffers come up in Emacs state.
-
-       * ediff-util.el (ediff-make-temp-file): Use proper file-name-handler
-       operation.
-
-2005-11-15  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * term.el (term-termcap-format): Fix typos.
-       (term-down): Fix the negative argument case.
-
-2005-11-16  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el: Remove face-alias left over from change on
-       2005-08-15.
-       (gdb-ann3): New command gud-go.
-       (menu): Accomodate gdb-mi.el.
-       (gdb-assembler-custom): Make buffer of selected window current
-       so that set-window-point works.
-
-       * progmodes/gud.el (gud-menu-map, gud-tool-bar-map): Re-define
-       buttons and include new ones.
-
-2005-11-16  Kim F. Storm  <storm@cua.dk>
-
-       * progmodes/gud.el (gud-tool-bar-item-visible-no-fringe): New function.
-       (gud-menu-map): Use it.
-
-2005-11-14  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * jka-cmpr-hook.el (auto-compression-mode): Enable it in a way
-       that works correctly for Custom and that does not override a user
-       who disables it.
-
-       * help-mode.el (help-make-xrefs, help-xref-on-pp)
-       (help-xref-interned, help-follow): Make hyperlinks for variables
-       that are unbound, but have a non-nil variable-documentation property.
-
-       * emacs-lisp/derived.el (define-derived-mode): Remove defvar for
-       mode hook.  (It conflicted with defcustoms for some mode hooks.)
-       Use the `variable-documentation' property to give the mode hook a
-       docstring and expand that docstring.
-
-2005-11-14  Hrvoje Niksic  <hniksic@xemacs.org>
-
-       * savehist.el (savehist-mode): Don't bother with
-       `custom-set-minor-mode'.
-       (savehist-coding-system): Check XEmacs version.
-       (history-length): Declare also at run time.
-       (savehist-mode): Don't emit a message.  Don't run the minor mode hook.
-       Don't set the customize state.
-       (savehist-minibuffer-hook): Special case for when
-       minibuffer-history-variable is equal to t.
-
-2005-11-14  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * files.el (write-file): Refresh VC status.
-
-       * calendar/diary-lib.el (diary-list-entries, diary-show-all-entries)
-       (mark-diary-entries, make-diary-entry): Check default-major-mode rather
-       than fundamental-mode to see if the mode was set.
-
-2005-11-14  Romain Francoise  <romain@orebokech.com>
-
-       * dired-x.el: If `vm-visit-folder' doesn't exist, define it as a
-       dummy function in `eval-when-compile' to avoid compiler warning.
-       Require `man' at compile time.
-
-2005-11-14  Jay Belanger  <belanger@truman.edu>
-
-       * calc-alg.el (calcFunc-write-out-power): Rename it to
-       calcFunc-powerexpand.
-       (math-write-out-power): Rename it to math-powerexpand; have it
-       handle negative exponents.
-       (calc-writeoutpower): Rename it to calc-powerexpand.
-
-       * calc-ext.el: Change calcFunc-writeoutpower and
-       calc-writeoutpower to calcFunc-powerexpand and calc-powerexpand in
-       autoloads.
-       Add calcFunc-ldiv to autoloads.
-
-       * calc-arith.el (calcFunc-ldiv): New function.
-
-       * calc.el (calc-left-divide): New function.
-
-2005-11-14  Juri Linkov  <juri@jurta.org>
-
-       * cus-edit.el (custom-variable-prompt): Set the default value arg
-       of completing-read.
-
-       * cus-dep.el (custom-make-dependencies): Reverse the list of
-       found dependencies.
-
-2005-11-14  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * menu-bar.el (menu-bar-options-menu): Delete "Syntax
-       Highlighting" entry, it is on by default now.
-       (menu-bar-options-save): Do not save global-font-lock-mode.
-
-2005-11-13  Richard M. Stallman  <rms@gnu.org>
-
-       * textmodes/flyspell.el (flyspell-large-region):
-       Call flyspell-accept-buffer-local-defs.
-
-2005-11-13  Agustin Martin  <agustin.martin@hispalinux.es>
-
-       * textmodes/flyspell.el (flyspell-notify-misspell):
-       Fix misspelling of "Misspelling".
-       (flyspell-process-localwords): New function.
-       (flyspell-large-region): Call flyspell-process-localwords and
-       flyspell-delete-region-overlays.
-       (flyspell-delete-region-overlays): New function.
-       (flyspell-delete-all-overlays): Call that.
-
-2005-11-13  Richard M. Stallman  <rms@gnu.org>
-
-       * help.el (help-for-help-internal): Improve doc of C-h a.
-       (describe-key): Improve prompt; doc fix.
-
-2005-11-13  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * vc-svn.el (vc-svn-registered): Catch all errors.
-
-       * cus-dep.el (custom-make-dependencies): Typo.
-
-2005-11-13  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/tramp-util.el (top): Fix compilation warning.
-
-2005-11-13  Kim F. Storm  <storm@cua.dk>
-
-       * help.el (help-for-help-internal): Fix `a' entry.  Add `d' entry.
-
-2005-11-13  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-menu-map): Move parentheses (again).
-       (gud-speedbar-buttons): Match on "const char *" too.
-
-       * progmodes/gdb-ui.el (gdb-var-create-handler)
-       (gdb-var-list-children-handler): Match on "const char *" too.
-       (gdb-var-evaluate-expression-handler): Match on empty string.
-       (gdb-var-update-handler): Only call
-       gdb-var-evaluate-expression-handler when required.
-
-2005-11-13  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-menu-map): Revert to window-fringes for
-       selected window.  This still doesn't work for speedbar.
-       (gud-speedbar-buttons): Handle string expressions properly.
-
-       * progmodes/gdb-ui.el (gdb-var-evaluate-expression-handler)
-       (gdb-var-create-handler): Handle string expressions properly.
-       (gdb-var-list-children-regexp, gdb-var-list-children-handler):
-       Handle string expressions properly.  Move "type" field into regexp.
-
-2005-11-12  Karl Fogel  <kfogel@red-bean.com>
-
-       * bookmark.el (bookmark-maybe-message): New function to reduce
-       code duplication: invokes `message' iff baud-rate is high enough.
-       (bookmark-write-file): Use above instead of an inline conditional.
-       (bookmark-load): Same.
-
-2005-11-12  Karl Fogel  <kfogel@red-bean.com>
-
-       * bookmark.el (bookmark-write-file): Don't visit the destination
-       file, just write the data to it using write-region.  This is
-       similar to saveplace.el at 2005-05-29T08:36:26Z!rms@gnu.org, but with an additional
-       change to avoid visiting the file in the first place.
-
-2005-11-12  Chong Yidong  <cyd@stupidchicken.com>
-
-       * hi-lock.el (hi-lock-mode): Set the default value of
-       font-lock-defaults.
-
-2005-11-11  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * find-lisp.el (find-lisp-find-dired-insert-file): Pass `string'
-       arg to `file-attributes'.
-       (find-lisp-format): The UID and GID can now be strings.
-
-2005-11-12  Kim F. Storm  <storm@cua.dk>
-
-       * help.el (help-map): Bind C-h d to apropos-documentation.
-
-       * simple.el (what-cursor-position): Print (EOB) instead of (100%)
-       when point is at end-of-buffer.
-
-       * apropos.el (apropos-match-face): Doc fix.
-       (apropos-sort-by-scores): Add new choice `verbose'.
-       (apropos-documentation-sort-by-scores): New defcustom.
-       (apropos-pattern): Now contains the pattern entered by the user.
-       (apropos-pattern-quoted): New defvar.
-       (apropos-regexp): New defvar, containing the regexp corresponding
-       to apropos-pattern.
-       (apropos-all-words-regexp): Rename from apropos-all-regexp.
-       (apropos-read-pattern): New defun.  Use it to read pattern arg in
-       interactive calls; returns list of words for a word list, and
-       string for a regexp.
-       (apropos-parse-pattern): Rename from apropos-rewrite-regexp.  Now
-       parses a list of words or regexp as returned by apropos-read-pattern.
-       (apropos-calc-scores): Return nil if apropos-regexp doesn't match.
-       (apropos-score-doc): Return a very high score if the string
-       entered by the user matches literally.
-       (apropos-variable): Doc fix.  Use apropos-read-pattern.
-       (apropos-command): Doc fix.  Use apropos-read-pattern and
-       apropos-parse-pattern.  Call apropos-print with nosubst=t.
-       (apropos, apropos-value): Doc fix.  Use apropos-read-pattern and
-       apropos-parse-pattern.
-       (apropos-documentation): Doc fix.  Use apropos-read-pattern and
-       apropos-parse-pattern.  Locally bind apropos-sort-by-scores to
-       apropos-documentation-sort-by-scores.  Call apropos-print with
-       nosubst=t.
-       (apropos-documentation-internal): Pass doc string through
-       substitute-key-definition before adding text properties.
-       Highlight substring matching literal user input if possible.
-       (apropos-documentation-check-doc-file): Remove locals beg and end.
-       Fix calculation of score (as added twice).  Pass doc string through
-       substitute-key-definition before adding text properties.
-       (apropos-documentation-check-elc-file): Pass doc string through
-       substitute-key-definition before adding text properties.
-       Highlight substring matching literal user input if possible.
-       (apropos-print): Add new arg NOSUBST; if set, command and variable
-       doc strings have already been passed through substitute-key-definition.
-       Add code to handle apropos-accumulator items without score element
-       for backwards compatibility (e.g. with woman package).
-       Only show scores if apropos-sort-by-scores is `verbose'.
-
-2005-11-10  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * jka-cmpr-hook.el (jka-compr-install): Use push and dolist.
-       Add jka-compr-load-suffixes to load-suffixes.
-
-       * jka-compr.el: Require jka-cmpr-hook.
-       (jka-compr-info-compress-message, jka-compr-info-compress-program)
-       (jka-compr-info-compress-args, jka-compr-info-uncompress-message)
-       (jka-compr-info-uncompress-program, jka-compr-info-uncompress-args)
-       (jka-compr-info-can-append, jka-compr-info-strip-extension)
-       (jka-compr-info-file-magic-bytes, jka-compr-get-compression-info)
-       (jka-compr-info-regexp): Remove.  Provided by jka-cmpr-hook.
-       (jka-compr-uninstall): Remove entries from
-       jka-compr-added-to-file-coding-system-alist after they are used.
-       (jka-compr-error): Remove unused var `curbuf'.
-       (jka-compr-file-local-copy): Remove unused var `notfound'.
-
-2005-11-10  Romain Francoise  <romain@orebokech.com>
-
-       * apropos.el (apropos-calc-scores): Use `apropos-pattern'.
-
-2005-11-11  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-menu-map): Move parentheses.
-       (gdb): New command gud-pv.
-
-2005-11-10  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * tar-mode.el: Remove spurious or unnecessary leading stars
-       in docstrings.
-       (tar-header-block-tokenize): Also obey default-file-name-coding-system.
-       (tar-parse-octal-integer-safe): Use mapc.
-       (tar-header-block-summarize): Remove unused var `ck'.
-       (tar-summarize-buffer): Don't clear the modified-p bit if it wasn't
-       cleared before.  Obey default-enable-multibyte-characters.
-       Use mapconcat.  Simplify setting of tar-header-offset.
-       (tar-mode-map): Move initialization inside delcaration.
-       (tar-flag-deleted): Use `abs'.
-       (tar-expunge-internal): Remove unused var `line'.
-       (tar-expunge-internal): Don't hardcode point-min==1.
-       (tar-expunge): Widen while doing set-buffer-multibyte.
-       (tar-rename-entry): Use file-name-coding-system.
-       (tar-alter-one-field): Don't hardcode point-min==1.
-       (tar-subfile-save-buffer): string-as-unibyte works on unibyte strings.
-       (tar-pad-to-blocksize): Don't hardcode point-min==1.  Clarify the code.
-
-2005-11-10  Masatake YAMATO  <jet@gyve.org>
-
-       * add-log.el (add-log-current-defun): Handle class::method
-       notation of c++.  Fix incorrect comment.
-
-2005-11-10  Alan Mackenzie  <acm@muc.de>
-
-       * help-fns.el (describe-variable): Make C-h v work when a variable
-       has variable documentation yet is unbound.
-
-2005-11-10  Masatake YAMATO  <jet@gyve.org>
-
-       * man.el (Man-highlight-references): Set an empty
-       string to `Man-arguments' if it is nil.
-       Suggested by Reiner Steib <Reiner.Steib@gmx.de>.
-
-2005-11-09  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * Makefile.in (mh-loaddefs.el, loaddefs.el): Better follow the
-       commenting conventions.
-
-       * cus-dep.el (custom-make-dependencies): Simplify.
-       Better follow the commenting conventions.
-
-2005-11-09  Richard M. Stallman  <rms@gnu.org>
-
-       * apropos.el (apropos-pattern): Rename from apropos-regexp.
-       (apropos-orig-pattern): Rename from apropos-orig-regexp.
-       All uses changed.
-       (apropos-rewrite-regexp): Doc fix.
-       (apropos-variable, apropos-command, apropos, apropos-value):
-       Change prompt; carry through the argument renaming.
-
-2005-11-09  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * find-lisp.el: Require dired.
-       (find-lisp-find-dired-internal): Do not call
-       `abbreviate-file-name' on DIR.
-
-2005-11-10  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gdb): Make gud-pp use user-defined command pp1.
-
-2005-11-09  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-menu-map): Ensure tool-bar is constant
-       when using the speedbar.
-       (gdb): New command gud-pp.
-       (gud-menu-map, gud-tool-bar-map): Put it on the tool bar.
-
-2005-11-09  Juri Linkov  <juri@jurta.org>
-
-       * replace.el (occur-excluded-properties): New defcustom.
-       (occur-1, occur-engine, occur-accumulate-lines): Use it.
-
-2005-11-08  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-units.el (math-convert-units): Replace any composite
-       unit by its definition.
-
-2005-11-08  Lars Hansen  <larsh@soem.dk>
-
-       * emacs-lisp/autoload.el (update-directory-autoloads):
-       Add obsolete function alias.
-
-2005-11-07  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * emacs-lisp/lisp-mode.el (lisp-mode-variables): Don't set
-       comment-indent-function.
-       (lisp-comment-indent): Replace by an alias for comment-indent-default.
-
-       * reveal.el (reveal-post-command): Rework the handling of
-       reveal-open-spots, so as to be more reliable.  There were several
-       tricky corner cases where an open spot might be lost, or where
-       a closed spot might end up on the list of open spots.
-       Only reveal text that's ellipsised.
-
-2005-11-07  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-export-as-html): Remove bogus (debug) form.
-
-2005-11-07  John Paul Wallington  <jpw@gnu.org>
-
-       * ibuffer.el (ibuffer): Search iconified frames too when
-       getting Ibuffer buffer's window.
-
-2005-11-06  Richard M. Stallman  <rms@gnu.org>
-
-       * progmodes/compile.el (compilation-internal-error-properties):
-       save-excursion around the computation of MARKER.
-
-2005-11-06  Piet van Oostrum  <piet@cs.uu.nl>
-
-       * textmodes/flyspell.el (flyspell-external-point-words):
-       flyspell-get-word returns a list, not just a string.
-
-2005-11-06  John Paul Wallington  <jpw@pobox.com>
-
-       * ibuffer.el (ibuffer): Search all visible frames when getting
-       Ibuffer buffer's window.
-
-2005-11-07  Masatake YAMATO  <jet@gyve.org>
-
-       * man.el (Man-reference-regexp): Accept spaces between
-       `Man-name-regexp' and `Man-section-regexp'.
-       (Man-apropos-regexp): New variable.
-       (Man-abstract-xref-man-page): Use value for `Man-target-string'
-       if available.
-       (Man-highlight-references, Man-highlight-references0):
-       Handle the case when `Man-arguments' includes "-k".
-       (Man-highlight-references0): Rename the argument `TARGET-POS' to
-       `TARGET'. `TARGET' can be a number, function or nil.
-
-2005-11-06  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-var-create-handler, gdb-var-delete)
-       (gdb-edit-value, gdb-speedbar-expand-node, gdb-get-create-buffer)
-       (gdb-breakpoints-mode, gdb-toggle-breakpoint, gdb-delete-breakpoint)
-       (gdb-goto-breakpoint, gdb-frames-mode, gdb-registers-mode)
-       (gdb-locals-mode, gdb-find-file-hook): Use buffer-local-value.
-       (gdb-send-item): Use buffer-local-value and simplify.
-
-2005-11-05  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * startup.el (command-line): Use `custom-reevaluate-setting' for
-       `global-font-lock-mode'.
-
-       * font-core.el (global-font-lock-mode): Enable `global-font-lock-mode'
-       by default, except in batch mode or when the -D option is given.
-
-       * emacs-lisp/easy-mmode.el (define-global-minor-mode): Pass all
-       specified keyword args on to `define-minor-mode'.  Update docstring.
-
-2005-11-05  Romain Francoise  <romain@orebokech.com>
-
-       * replace.el (occur-engine): Add marker at end of line, too.
-
-2005-11-04  Ken Manheimer  <ken.manheimer@gmail.com>
-
-       * pgg-pgp.el (pgg-pgp-encrypt-region, pgg-pgp-decrypt-region)
-       (pgg-pgp-encrypt-symmetric-region, pgg-pgp-encrypt-symmetric)
-       (pgg-pgp-encrypt, pgg-pgp-decrypt-region, pgg-pgp-decrypt)
-       (pgg-pgp-sign-region, pgg-pgp-sign): Add optional PASSPHRASE
-       argument to all these routines, so the passphrase can be managed
-       externally and passed in to the system.
-       (pgg-pgp-decrypt-region, pgg-pgp-sign-region): Use new name for
-       pgg-add-passphrase-to-cache function.
-
-       * pgg-pgp5.el (pgg-pgp5-encrypt-region, pgg-pgp5-decrypt-region)
-       (pgg-pgp5-encrypt-symmetric-region, pgg-pgp5-encrypt-symmetric)
-       (pgg-pgp5-encrypt, pgg-pgp5-decrypt-region, pgg-pgp5-decrypt)
-       (pgg-pgp5-sign-region, pgg-pgp5-sign): Add optional PASSPHRASE
-       argument to all these routines, so the passphrase can be managed
-       externally and passed in to the system.
-       (pgg-pgp5-sign-region): Use new name of pgg-add-passphrase-to-cache
-       function.
-
-2005-11-04  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * font-lock.el: Don't deal with font-lock-face-attributes here,
-       move the code ...
-
-       * startup.el (command-line): ... here.  Use face-spec-set instead
-       of custom-declare-face.
-
-       * faces.el (face-spec-set): Reset the face if spec is not nil.
-
-2005-11-04  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * newcomment.el (comment-region-internal): Box more tightly in the
-       common case where there's no TAB in the boxed text.
-
-2005-11-04  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * info.el (info-tool-bar-map): Use images prev-node, next-node and
-       up-node.
-
-2005-11-04  Ulf Jasper  <ulf.jasper@web.de>
-
-       * newsticker.el: Commentary updated.  Code formatting changed.
-       (newsticker-version): Change to "1.9".
-       (newsticker, newsticker-feed): Doc fix.
-       (newsticker-url-list): Doc fix.  Add option "Weekly".
-       (newsticker-retrieval-interval): Add option "Weekly".
-       (newsticker-headline-processing): Doc fix.
-       (newsticker-auto-mark-filter): Remove.
-       (newsticker-auto-mark-filter-list): New.
-       (newsticker-layout, newsticker-sort-method): Doc fix.
-       (newsticker-hide-old-items-in-newsticker-buffer)
-       (newsticker-heading-format, newsticker-item-format)
-       (newsticker-desc-format): Doc fix.
-       (newsticker-show-all-rss-elements): Remove.
-       (newsticker-show-all-news-elements): New.
-       (newsticker-faces, newsticker-ticker): Doc fix.
-       (remove-from-invisibility-spec): Code formatting.
-       (newsticker--process-ids): New.
-       (newsticker-mode): Doc fix.
-       (newsticker-mode): Change mode-line-format.
-       (newsticker-start): Remove debug output.
-       (newsticker-start-ticker): Doc fix.  Add autoload cookie.
-       (newsticker-w3m-show-inline-images): Code formatting.
-       (newsticker-next-item): Call `force-mode-line-update'.
-       (newsticker-previous-item): Call `force-mode-line-update'.
-       (newsticker-next-feed): Call `force-mode-line-update'.
-       (newsticker-previous-feed): Call `force-mode-line-update'.
-       (newsticker-mark-all-items-at-point-as-read): Code formatting.
-       (newsticker-show-old-items): Do not show descs.
-       (newsticker-hide-entry): Hide too much.
-       (newsticker-hide-entry, newsticker-show-entry)
-       (newsticker-toggle-auto-narrow-to-feed): Code formatting.
-       (newsticker-set-auto-narrow-to-feed): Update buffer immediately.
-       (newsticker-toggle-auto-narrow-to-item): Code formatting.
-       (newsticker-set-auto-narrow-to-item): Update buffer immediately.
-       (newsticker-running-p, newsticker-ticker-running-p): Autoload cookie.
-       (newsticker-get-news): Call `force-mode-line-update'.
-       Collect process ids.
-       (newsticker--sentinel): Change coding system handling.
-       Move image retrieval to new functions newsticker--get-logo-url-*.
-       Move feed parsing to new functions newsticker--parse-*.
-       Update list of process ids.
-       (newsticker--get-logo-url-atom-1.0, newsticker--get-logo-url-atom-0.3)
-       (newsticker--get-logo-url-rss-2.0, newsticker--get-logo-url-rss-1.0)
-       (newsticker--get-logo-url-rss-0.92, newsticker--get-logo-url-rss-0.91)
-       (newsticker--parse-atom-0.3, newsticker--parse-atom-1.0)
-       (newsticker--parse-rss-0.91, newsticker--parse-rss-0.92)
-       (newsticker--parse-rss-1.0, newsticker--parse-rss-2.0)
-       (newsticker--parse-generic-feed, newsticker--parse-generic-items): New.
-       (newsticker--decode-coding-string): Remove.
-       (newsticker--decode-numeric-entities): Check input.  Format code.
-       (newsticker--remove-whitespace): Check input.
-       (newsticker--do-forget-preformatted): Doc fix.
-       (newsticker--decode-rfc822-date): Allow for missing time.
-       (newsticker--update-process-ids): New.
-       (newsticker--image-sentinel): Change comment.
-       (newsticker--image-read): Change error message.
-       (newsticker--imenu-goto): Doc fix.  Show headline title.
-       (newsticker--buffer-set-uptodate): Call `force-mode-line-update'.
-       (newsticker--buffer-do-insert-text): Clean whitespace in
-       html-rendered headline title.  Code formatting.
-       Call `newsticker--buffer-print-extra-elements'.
-       (newsticker--buffer-print-extra-element): Remove.
-       (newsticker--buffer-print-extra-elements): New.
-       (newsticker--buffer-do-print-extra-element): New.
-       (newsticker--buffer-insert-enclosure): Doc fix.  Use MBytes for
-       large sizes.
-       (newsticker--run-auto-mark-filter)
-       (newsticker--do-run-auto-mark-filter):
-       Use `newsticker-auto-mark-filter-list'.
-
-2005-11-04  Ryan Yeske  <rcyeske@gmail.com>
-
-       * net/rcirc.el: Use split-string OMIT-NULLS argument.
-       (rcirc-print): Force redisplay before running hooks.  Do long
-       buffer truncation after making new text read-only.  Deal with nil
-       text when decoding strings.  If TARGET is nil, use either the
-       currently selected buffer, if it is an rcirc buffer and of the
-       same process or the process buffer.
-       (rcirc-mode): Remove header-line.  Recompute short buffer names.
-       Initialize rcirc-buffer-alist here instead of rcirc-get-buffer-create.
-       (rcirc-short-buffer-name): Add variable.
-       (rcirc-kill-buffer-hook): Recompute short buffer names.
-       Remove nick from private channel.
-       (rcirc-send-input): Send command text to current-buffer.
-       Don't clear overlay arrow here.
-       (rcirc-short-buffer-name): Return a short buffer name.
-       (rcirc-update-short-buffer-names, rcirc-abbreviate)
-       (rcirc-rebuild-tree, rcirc-make-trees): Add functions to generate
-       buffer-name abbreviations.
-       (rcirc-kill-buffer-hook-1): Split to make debugging easier.
-       Do not touch nick-table when killing a parted channel.
-       (rcirc-window-configuration-change): Rename from rcirc-update-activity.
-       Clear arrow from current buffer if it is now hidden.
-       (rcirc-current-buffer): Add variable.
-       (rcirc-my-nick, rcirc-other-nick, rcirc-server)
-       (rcirc-nick-in-message, rcirc-prompt, rcirc-mode-line-nick):
-       Remove -face from names.
-       (rcirc-update-activity-string): Print "DND" when globally ignoring
-       activity.
-       (rcirc-ignore-buffer-activity-flag): Rename from
-       rcirc-ignore-channel-activity.
-       (rcirc-ignore-all-activity-flag): Doc fix.
-       (rcirc-channels): Remove variable.
-       (rcirc-kill-buffer-hook):
-       (rcirc-get-buffer-create): Add nick to private channel.
-       (rcirc-multiline-edit-submit): Remove tabs.
-       (rcirc-put-nick-channel, rcirc-channel-nicks): Look up nicks case
-       folded.
-       (rcirc-remove-nick-channel): Bug fix.
-       (rcirc-toggle-ignore-buffer-activity): Rename from
-       rcirc-toggle-ignore-channel-activity.
-       (rcirc-record-activity): Add buffers to the front of the list.
-       (rcirc-update-activity): Remove killed buffers from list.
-       (rcirc-process-server-response-1): Remove last argument if it is
-       null before calling handler.
-       (rcirc): Add "rcirc" defcustom prefix.
-       (rcirc-prompt): Simplify default prompt.
-       Use custom-initialize-default.
-       (rcirc-private-chats): Remove variable.
-       (rcirc-prompt): Change initialization.
-       (rcirc-version): Remove function.
-       (rcirc-id-string): Add constant.
-       (rcirc-last-buffer): Remove variable.
-       (rcirc-buffer-alist): Add variable.
-       (rcirc-connect): Update variable setup.
-       (rcirc-sentinel, rcirc-update-prompt): Use `rcirc-buffer-alist'.
-       (rcirc-trap-errors-flag): Rename from `rcirc-trap-errors' change
-       default.
-       (rcirc-handler-generic): Trigger activity.
-       (rcirc-send-message): Create the buffor of the target.
-       (rcirc-generate-new-buffer-name): Rename from `rcirc-get-buffer-name'.
-       (rcirc-get-buffer): Just return nil if there is no matching buffer.
-       (rcirc-multiline-edit-cancel): Remove function.
-       (rcirc-set-last-buffer): Remove function.
-       (rcirc-get-any-buffer): Add function.
-       (rcirc-join-channels): Don't print /join text.
-       (rcirc-toggle-ignore-channel-activity): Add and update echo area
-       messages.
-       (rcirc-cmd-ctcp): Use rcirc-send-string to send request.
-       (rcirc-handler-NOTICE): Recognize CTCP responses.
-       (rcirc-handler-332, rcirc-handler-332): Use a temp buffer for
-       constructing TOPIC string for buffers we are not JOINed.
-       (rcirc-handler-CTCP-response): Add handler.
-       (rcirc-multiline-edit-submit): Restore the window-configuration
-       before adjusting point.
-       (rcirc): Add customization group.
-       (rcirc-server, rcirc-port, rcirc-nick, rcirc-user-name)
-       (rcirc-user-full-name, rcirc-startup-channels-alist)
-       (rcirc-fill-flag, rcirc-fill-column, rcirc-fill-prefix)
-       (rcirc-ignore-all-activity-flag, rcirc-time-format)
-       (rcirc-input-ring-size, rcirc-read-only-flag)
-       (rcirc-buffer-maximum-lines, rcirc-authinfo-file-name)
-       (rcirc-auto-authenticate-flag, rcirc-prompt, rcirc-print-hooks):
-       Change defvar to defcustom.
-       (rcirc-update-prompt): Add optional ALL arg, which will update
-       prompts in all rcirc buffers.  Regexp quote replacement text.
-       (rcirc-fill-column): Accept frame-width as a value.
-       (rcirc-set-changed): Add function.
-       (rcirc-next-active-buffer): Write more meaningful messages.
-       (rcirc-faces): Add customization group.
-       (rcirc-my-nick-face, rcirc-other-nick-face, rcirc-server-face)
-       (rcirc-nick-in-message-face, rcirc-prompt-face)
-       (rcirc-mode-line-nick-face): Move into rcirc-faces group.
-       (with-rcirc-process-buffer): Move before first usage.
-       (rcirc-debug-buffer): Rename from `rcirc-log-buffer'.
-       (rcirc-debug-flag): Rename from `rcirc-log-p'.
-       (rcirc-debug): Rename from `rcirc-log'.
-       (rcirc-format-response-string): Do not print `-' chars for a
-       NOTICE with no sender.  Simplify output of server responses.
-
-2005-11-04  Henrik Enberg  <henrik.enberg@telia.com>
-
-       (rcirc-browse-url-map, rcirc-browse-url-at-point)
-       (rcirc-browse-url-at-mouse, rcirc-mangle-text):
-       Make urls mouse and RET clickable.
-
-2005-11-04  Henrik Enberg  <henrik.enberg@telia.com>
-
-       * mail/rmailout.el (rmail-output-to-rmail-file, rmail-output): Doc fix.
-
-2005-11-04  Ken Manheimer  <ken.manheimer@gmail.com>
-
-       * pgg-pgp.el (pgg-pgp-encrypt-region, pgg-pgp-decrypt-region)
-       (pgg-pgp-encrypt-symmetric-region, pgg-pgp-encrypt-symmetric)
-       (pgg-pgp-encrypt, pgg-pgp-decrypt-region, pgg-pgp-decrypt)
-       (pgg-pgp-sign-region, pgg-pgp-sign): Add optional PASSPHRASE
-       argument to all these routines, so the passphrase can be managed
-       externally and passed in to the system.
-       (pgg-pgp-decrypt-region, pgg-pgp-sign-region): Use new name for
-       pgg-add-passphrase-to-cache function.
-
-       * pgg-pgp5.el (pgg-pgp5-encrypt-region, pgg-pgp5-decrypt-region)
-       (pgg-pgp5-encrypt-symmetric-region, pgg-pgp5-encrypt-symmetric)
-       (pgg-pgp5-encrypt, pgg-pgp5-decrypt-region, pgg-pgp5-decrypt)
-       (pgg-pgp5-sign-region, pgg-pgp5-sign): Add optional PASSPHRASE
-       argument to all these routines, so the passphrase can be managed
-       externally and passed in to the system.
-       (pgg-pgp5-sign-region): Use new name of pgg-add-passphrase-to-cache
-       function.
-
-2005-11-04  Edward O'Connor  <hober0@gmail.com>  (tiny change)
-
-       * net/goto-addr.el (goto-address-url-regexp): Remove `data:' URLs
-       from goto-address-url-regexp.
-
-2005-11-04  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-read-date, org-goto-calendar)
-       (org-recenter-calendar, org-agenda-goto-calendar):
-       Temporarily clear `calendar-move-hook'.
-
-2005-11-04  Michael Kifer  <kifer@cs.stonybrook.edu>
-
-       * ediff-merge.el (ediff-merge-region-is-non-clash): Return t, if not
-       merging.
-
-       * ediff-util.el (ediff-previous-difference): Don't skip regions that
-       have merge clashes.
-
-2005-11-04  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * mwheel.el (mouse-wheel-down-event, mouse-wheel-up-event):
-       Undo previous change.
-
-       * startup.el (command-line): Use `custom-reevaluate-setting' for
-       mouse-wheel-down-event and mouse-wheel-up-event.  Don't call
-       tty-register-default-colors on Mac.
-
-2005-11-04  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-buffer-type): Remove duplicate declaration.
-       (gdb-buffer-type): Make it automatically buffer local...
-       (gdb-get-create-buffer): ...and set it accordingly.
-       (gdb-frame-gdb-buffer, gdb-display-gdb-buffer): Make these
-       actually work.
-
-2005-11-03  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * font-lock.el (font-lock-warning-face): Use the more vivid red1,
-       not red.
-
-2005-11-04  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gud-watch): Use save-selected-window in
-       case GUD buffer is not visible.
-       (gdb-goto-breakpoint): Try to force display in source buffer.
-       (gdb-frame-gdb-buffer): Copy other similar functions.
-       (gdb-restore-windows): Don't display source if not asked for.
-       (gdb-assembler-buffer-name): Don't capitalise.
-
-2005-11-03  Richard M. Stallman  <rms@gnu.org>
-
-       * wid-edit.el (key-sequence): New widget type.
-
-       * simple.el (set-mark-command-repeat-pop): New variable.
-       (set-mark-command): Only interpret plan C-@ after a pop as a pop
-       if set-mark-command-repeat-pop is true.
-
-       * info.el (Info-fontify-node): Don't display extra "see" if there
-       already is one here.
-
-       * mouse.el: Fix special handling of DEL after dragging a region:
-       (mouse-drag-region-1): Treat mouse-set-region like mouse-set-point.
-       (mouse-region-delete-keys): Change to defcustom.  Add [backspace].
-
-       * mail/feedmail.el: Use insert-buffer-substring, not insert-buffer.
-
-       * textmodes/ispell.el (ispell-command-loop): Change `i' description
-       not to assume it pertains to an affix.
-
-       * textmodes/flyspell.el (flyspell-post-command-hook):
-       Bind deactivate-mark to prevent deactivation.
-
-2005-11-03  Lars Hansen  <larsh@soem.dk>
-
-       * dired-x.el: Add menu bindings for dired-do-find-marked-files,
-       dired-do-relsymlink, dired-flag-extension, dired-mark-extension,
-       dired-mark-omitted, dired-do-relsymlink-regexp, dired-omit-mode.
-
-2005-11-03  Romain Francoise  <romain@orebokech.com>
-
-       * net/eudcb-mab.el: Now part of GNU Emacs.  Update FSF's address.
-       Update copyright years.
-
-2005-11-03  Sam Steingold  <sds@gnu.org>
-
-       * mwheel.el (mouse-wheel-down-event, mouse-wheel-up-event):
-       Use system-type instead of window-system because window-system is not
-       correctly defined during loadup.
-
-2005-11-02  Mark A. Hershberger  <mah@everybody.org>
-
-       * xml.el (xml-syntax-table): Allow xml.el to compile in XEmacs.
-       (xml-parse-tag): Join strings separated by a comment properly.
-
-2005-11-02  Andreas Schwab  <schwab@suse.de>
-
-       * emacs-lisp/byte-opt.el (byte-optimize-pure-func): Fix last fix.
-
-2005-11-02  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * emacs-lisp/byte-opt.el (string-to-syntax): Mark it as pure.
-       (byte-optimize-pure-func): Quote the eval'd value.
-
-       * progmodes/perl-mode.el (perl-font-lock-special-syntactic-constructs):
-       Rename from perl-font-lock-syntactic-face-function.
-       Change the calling convention so it can be used as a font-lock MATCHER.
-       Do the parse-partial-sexp loop outselves.
-       (perl-font-lock-syntactic-keywords): Use it.
-       (perl-mode): Don't set font-lock-syntactic-face-function any more.
-
-2005-11-02  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-mouse-until): Make it work in the
-       disassembly buffer too.
-       (gdb-exited): Remove overlay arrows when execution has finished.
-       (gdb-info-frames-custom, gdb-info-threads-custom)
-       (gdb-info-registers-custom): Don't add inappropriate text
-       properties if inferior is not active.
-
-2005-11-02  Glenn Morris  <rgm@gnu.org>
-
-       * progmodes/fortran.el (fortran-blink-match):
-       Use `blink-matching-delay'.
-
-2005-11-02  John Mongan  <jmongan@mccammon.ucsd.edu>  (tiny change)
-
-       * progmodes/f90.el (f90-match-end): Use `blink-matching-delay'.
-
-2005-11-02  Lars Hansen  <larsh@soem.dk>
-
-       * net/tramp.el (tramp-action-out-of-band): Handle scp message
-       "Permission denied".
-
-2005-11-01  Richard M. Stallman  <rms@gnu.org>
-
-       * textmodes/flyspell.el (flyspell-external-point-words):
-       Pass nil to flyspell-get-word.
-
-2005-11-02  Kim F. Storm  <storm@cua.dk>
-
-       * menu-bar.el (menu-bar-options-menu): Show "Shift Movement (CUA)"
-       item instead of "C-x/C-c/C-v (CUA)" if cua-enable-cua-keys is nil.
-
-2005-11-01  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * calendar/cal-menu.el (date, event): Don't declare as dynamic-var.
-       (calendar-mouse-holidays, calendar-mouse-view-diary-entries)
-       (calendar-mouse-print-dates): Add optional `event' argument.
-       Update interactive-spec.
-       (calendar-mouse-cal-tex-menu, cal-tex-mouse-filofax):
-       Use `calendar-event-to-date' instead of `event'.
-
-2005-11-02  Masatake YAMATO  <jet@gyve.org>
-
-       * progmodes/ld-script.el (ld-script-builtins):
-       Add more words: "DATA_SEGMENT_ALIGN", "DATA_SEGMENT_END",
-       "DATA_SEGMENT_RELRO_END", "LENGTH", "ORIGIN", and "SEGMENT_START".
-       (auto-mode-alist): Accept .ld, .lds, ld.in and .lds.in.
-
-2005-11-01  Romain Francoise  <romain@orebokech.com>
-
-       * vc-sccs.el: Update copyright year.
-       * ezimage.el: Likewise.
-
-2005-11-01  KOBAYASHI Yasuhiro  <kobayays@otsukakj.co.jp>  (tiny change)
-
-       * info.el (Info-fontify-node): Use `string-width' for fontifying
-       underlined titles.
-
-2005-11-01  Juri Linkov  <juri@jurta.org>
-
-       * info.el (Info-fontify-node): Downcase node header keywords Node,
-       Prev, Next, Up before comparison.
-       (Info-history): Insert absolute directory name, and put invisible
-       property on it.
-
-2005-11-01  Juri Linkov  <juri@jurta.org>
-
-       * info.el (Info-file-supports-index-cookies): New variable.
-       (Info-find-node-2): Check makeinfo version for index cookie support.
-       (Info-index-nodes): Search for nodes with index cookies only when
-       Info-file-supports-index-cookies is t.  Otherwise, search nodes
-       with "Index" in the node name.
-       (Info-index-node): Search index cookie in the current node only when
-       Info-file-supports-index-cookies is t.  Otherwise, check the word
-       "Index" in the node name.
-       (Info-find-emacs-command-nodes): Remove code that searches nodes
-       with "Index" node name in the top menu.
-
-2005-11-01  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/scheme.el (scheme-mode-variables): Use the default
-       comment-indent-function.
-
-       * faces.el (face-attribute): Handle the case where a face inherits from
-       a non-existent face.
-
-       * simple.el (eval-expression-print-format): Use lisp-readable syntax
-       for octal and hexa output, and merge the char into the paren.
-       (kill-new): Use push.
-       (copy-to-buffer): Use with-current-buffer.
-       (completion-setup-function): Move code in loop to remove redundancy.
-       (minibuffer-local-must-match-map): Don't add bindings that duplicate
-       those inherited from minibuffer-local-completion-map.
-
-       * savehist.el (savehist-mode) <defcustom>:
-       Use custom-set-minor-mode if available.
-       (savehist-mode) <defun>: Run the minor mode hook, set the custom state
-       and emit a message if applicable.
-
-2005-11-01  Hrvoje Niksic  <hniksic@xemacs.org>
-
-       * savehist.el: Sync up to version 19.
-       (savehist-mode): New minor mode.
-       (savehist-file): Use ~/.emacs.d or ~/.xemacs if available.
-       (savehist-length): Remove (use history-length instead).
-       (savehist-file-modes): Rename from savehist-modes.
-       (savehist-save-hook, savehist-loaded): New vars.
-       (savehist-load): Use savehist-mode.  Try to smooth up transition from
-       old format to new format.
-       (savehist-install): Allow savehist-autosave-interval to be nil.
-       (savehist-save): Run the new hook.  Be more careful to only trim the
-       history variables.
-       (savehist-trim-history): New fun.  Replaces savehist-process-for-saving.
-       (savehist-printable): Print into a buffer rather than char-by-char.
-
-2005-11-01  John Wiegley  <johnw@newartisans.com>
-
-       * iswitchb.el (iswitchb-define-mode-map): Re-enable the
-       toggle-ignore keybinding (C-a).  The author said it had been
-       disabled much earlier due to a possible incompatibility, but after
-       many months of usage I have encountered no problems (and it is a
-       rather useful option, especially for switching to " *temp*").
-
-       * net/eudcb-mab.el (eudc-mab-query-internal): Add backend
-       support for OS/X's AddressBook, by calling out to the open source
-       program "contacts" (installable through Fink).
-
-       * net/eudc.el (eudc-expand-inline): If the
-       `eudc-multiple-match-handling-method' is set to `all', delete the
-       query string before inserting the query result.
-
-       * eshell/em-ls.el (eshell-do-ls): Add no-op support for --dired
-       flag, to prevent Eshell from using the system ls when
-       `eshell-ls-insert-directory' is in used.
-       (eshell-ls-insert-directory): Disable font-lock in directory
-       buffer so that Eshell's own fontification is seen.  This broke
-       recently due to changes in font-lock, so this goes back to version
-       21 behavior.
-
-2005-11-01  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-use-inferior-io-buffer): New function.
-       (menu, toggle-gdb-use-inferior-io-buffer): Get rid of defadvice.
-       (gdb-many-windows): Doc fix.
-
-2005-10-31  Romain Francoise  <romain@orebokech.com>
-
-       * help-fns.el (describe-simplify-lib-file-name): Add autoload cookie.
-
-2005-10-31  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * loadup.el: Load emacs-lisp/syntax, font-lock and jit-lock so
-       that global-font-lock-mode can be enabled by default.
-
-       * font-lock.el (font-lock-keywords, font-lock-mode-internal)
-       (font-lock-add-keywords, font-lock-remove-keywords)
-       (font-lock-fontify-buffer): Remove autoload cookies.
-
-       * jit-lock.el (jit-lock-register): Likewise.
-
-       * emacs-lisp/syntax.el (syntax-ppss): Likewise.
-
-2005-10-31  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-many-windows): Leave window configuration
-       intact if there is no gud-comint-buffer.
-
-2005-10-31  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * progmodes/gud.el (gud-filter): Use comint-update-fence to delete
-       old prompt comint-prompt-read-only is t and GDB commands are
-       issued from tool bar etc.
-
-2005-10-31  Masatake YAMATO  <jet@gyve.org>
-
-       * vc.el (vc-directory-exclusion-list): Add "{arch}".
-
-2005-10-30  Chong Yidong  <cyd@stupidchicken.com>
-
-       * thumbs.el (thumbs-thumbsdir): Default to ~/.emacs.d/thumbs.
-       (thumbs-thumbsdir): Make .emacs.d if it does not exist.
-
-2005-10-30  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/tramp.el (tramp-chunksize): Escape parentheses in docstring
-       starting at beginning of line.  Fontification is messed up when
-       `open-paren-in-column-0-is-defun-start' set to t.
-       Reported by John Paul Wallington <jpw@pobox.com>.
-
-2005-10-30  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * comint.el (comint-send-input): Call `comint-update-fence' when
-       `comint-process-echoes' and `comint-prompt-read-only' are both
-       non-nil, to avoid leftover read-only newline.
-
-2005-10-30  Richard M. Stallman  <rms@gnu.org>
-
-       * textmodes/flyspell.el (flyspell-external-point-words):
-       Detect when WORD can't be checked properly because
-       flyspell-get-word finds just part of it, and move on.
-
-       * textmodes/ispell.el (ispell-dictionary-alist-5): Add . as
-       boundarychar for Polish.
-       (ispell-dictionary-alist-4): Add . as boundarychar for Italian.
-       (ispell-dictionary-alist-3): Add . and @ as boundarychars for French.
-
-2005-10-31  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-tooltip-print-1): Fix regexp.
-       (gdb-registers-font-lock-keywords): Delete.
-       (gdb-registers-mode): Don't fontify.
-       (gdb-info-registers-custom): Use text properties instead as, in
-       future, changed register values will use font-lock-warning-face.
-       (gdb-local-font-lock-keywords): Rename to...
-       (gdb-locals-font-lock-keywords): ...for consistency.
-
-2005-10-30  Andre Spiegel  <spiegel@gnu.org>
-
-       * vc.el (vc-switch-backend): Better error message if the buffer is
-       not visiting a file under version control.
-
-       * vc-cvs.el (vc-cvs-delete-file): Commit the file after removing it.
-
-2005-10-29  Chong Yidong  <cyd@stupidchicken.com>
-
-       * startup.el (command-line): Use ~/.emacs.d/init.el instead of
-       ~/.emacs.d/.emacs.
-
-2005-10-29  Richard M. Stallman  <rms@gnu.org>
-
-       * replace.el (occur-mode-mouse-goto): Always go to other window.
-       (occur-mode-goto-occurrence): Always switch in same window.
-
-       * simple.el (undo): Display message at end, not at start.
-
-       * emacs-lisp/timer.el (timer-activate, timer-activate-when-idle):
-       New arg REUSE-CELL.
-       (cancel-timer-internal): New function.
-       (timer-event-handler): Use cancel-timer-internal,
-       and pass the cell it returns to timer-activate...
-
-       * jit-lock.el (jit-lock-function, jit-lock-stealth-fontify)
-       (jit-lock-deferred-fontify, jit-lock-context-fontify)
-       (jit-lock-after-change): Test memory-full.
-
-2005-10-29  Ken Manheimer  <ken.manheimer@gmail.com>
-
-       * pgg-gpg.el (pgg-gpg-select-matching-key): Fix: look at the right
-       part of the decoded armor to find the key-identifier.
-       (pgg-gpg-lookup-key-owner): New function to return the
-       human-readable identifier of a key owner.
-       (pgg-gpg-lookup-id-from-key-owner): Make it easy to identify the
-       key itself.
-       (pgg-gpg-decrypt-region): Prompt with the key owner (rather than
-       the key value) if we have a key and can match it against a secret
-       key.  Also, added a note pointing out fact that the prompt only
-       indicates the first matching key.
-
-       * pgg.el (pgg-decrypt): Passing along PASSPHRASE in call to
-       pgg-decrypt-region.
-       (pgg-pending-timers): A new hash for tracking the passphrase cache
-       timers, so that new ones supercede old ones.
-       (pgg-add-passphrase-to-cache): Rename from
-       `pgg-add-passphrase-cache' to reduce confusion (all callers
-       changed).  Modified to cancel old timers when new ones are added.
-       (pgg-remove-passphrase-from-cache): Rename from
-       `pgg-remove-passphrase-cache' to reduce confusion (all callers
-       changed).  Modified to cancel old timers when their keys are
-       removed from the cache.
-       (pgg-cancel-timer): In Emacs, an alias for cancel-timer; in
-       XEmacs, an indirection to delete-itimer.
-       (pgg-read-passphrase-from-cache, pgg-read-passphrase):
-       Extract pgg-read-passphrase-from-cache from pgg-read-passphrase so
-       users can only check cache without risk of prompting.  Correct bug in
-       notruncate behavior.
-       (pgg-read-passphrase-from-cache, pgg-read-passphrase)
-       (pgg-add-passphrase-cache, pgg-remove-passphrase-cache):
-       Add informative docstrings.
-       (pgg-decrypt): Convey provided passphrase in subordinate call to
-       pgg-decrypt-region.
-
-       * pgg.el (pgg-encrypt-region, pgg-encrypt-symmetric-region)
-       (pgg-encrypt-symmetric, pgg-encrypt, pgg-decrypt-region)
-       (pgg-decrypt, pgg-sign-region, pgg-sign): Add optional
-       `passphrase' argument, so the passphrase can be managed externally
-       and then passed in to the system.
-
-       * pgg.el (pgg-read-passphrase, pgg-add-passphrase-cache)
-       (pgg-remove-passphrase-cache): Add optional NOTRUNCATE argument,
-       so the passphrase cache can be used reliably with identifiers
-       besides a pgp packet's key id.
-
-       * pgg-gpg.el (pgg-pgp-encrypt-region)
-       (pgg-pgp-encrypt-symmetric-region, pgg-pgp-encrypt-symmetric)
-       (pgg-pgp-encrypt, pgg-pgp-decrypt-region, pgg-pgp-decrypt)
-       (pgg-pgp-sign-region, pgg-pgp-sign): Add optional PASSPHRASE
-       argument to all these routines, so the passphrase can be managed
-       externally and passed in to the system.
-
-       * pgg-gpg.el (pgg-gpg-possibly-cache-passphrase): Add optional
-       `notruncate' argument, so the passphrase cache can be used
-       reliably with identifiers besides a pgp packet's key id.
-
-2005-10-29  Sascha Wilde  <swilde@sha-bang.de>
-
-       * pgg-gpg.el (pgg-gpg-encrypt-symmetric-region): New function for
-       symmetric encryption.
-       (pgg-gpg-symmetric-key-p): New function to check for an symmetric
-       encrypted session key.
-       (pgg-gpg-decrypt-region): When decrypting a symmetric encrypted
-       message ask for the passphrase in a proper way.
-
-       * pgg.el (pgg-encrypt-symmetric, pgg-encrypt-symmetric-region):
-       New user commands for symmetric encryption.
-
-2005-10-29  Roland Winkler  <roland.winkler@physik.uni-erlangen.de>
-
-       * textmodes/conf-mode.el (conf-assignment-sign)
-       (conf-assignment-regexp): Fix docstrings.
-       (conf-mode-initialize): New function.
-       (conf-mode): Remove optional args.  Use delay-mode-hooks to
-       recognize recursive calls.
-       (conf-unix-mode, conf-windows-mode, conf-javaprop-mode)
-       (conf-space-mode, conf-colon-mode, conf-ppd-mode)
-       (conf-xdefaults-mode): Use define-derived-mode and
-       conf-mode-initialize.
-
-2005-10-29  Romain Francoise  <romain@orebokech.com>
-
-       * help-fns.el (describe-simplify-lib-file-name): Fix regexp.
-
-2005-10-29  Ken Manheimer  <ken.manheimer@gmail.com>
-
-       * pgg-gpg.el (pgg-gpg-select-matching-key): Fix: look at the right
-       part of the decoded armor to find the key-identifier.
-       (pgg-gpg-lookup-key-owner): New function to return the
-       human-readable identifier of a key owner.
-       (pgg-gpg-lookup-id-from-key-owner): Make it easy to identify the
-       key itself.
-       (pgg-gpg-decrypt-region): Prompt with the key owner (rather than
-       the key value) if we have a key and can match it against a secret
-       key.  Also, added a note pointing out fact that the prompt only
-       indicates the first matching key.
-
-       * pgg.el (pgg-decrypt): Passing along PASSPHRASE in call to
-       pgg-decrypt-region.
-       (pgg-pending-timers): A new hash for tracking the passphrase cache
-       timers, so that new ones supercede old ones.
-       (pgg-add-passphrase-to-cache): Rename from
-       `pgg-add-passphrase-cache' to reduce confusion (all callers
-       changed).  Modified to cancel old timers when new ones are added.
-       (pgg-remove-passphrase-from-cache): Rename from
-       `pgg-remove-passphrase-cache' to reduce confusion (all callers
-       changed).  Modified to cancel old timers when their keys are
-       removed from the cache.
-       (pgg-cancel-timer): In Emacs, an alias for cancel-timer; in
-       XEmacs, an indirection to delete-itimer.
-       (pgg-read-passphrase-from-cache, pgg-read-passphrase):
-       Extract pgg-read-passphrase-from-cache from pgg-read-passphrase so
-       users can only check cache without risk of prompting.  Correct bug in
-       notruncate behavior.
-       (pgg-read-passphrase-from-cache, pgg-read-passphrase)
-       (pgg-add-passphrase-cache, pgg-remove-passphrase-cache):
-       Add informative docstrings.
-       (pgg-decrypt): Convey provided passphrase in subordinate call to
-       pgg-decrypt-region.
-
-2005-10-20  Ken Manheimer  <ken.manheimer+emacs@gmail.com>
-
-       * pgg.el (pgg-encrypt-region, pgg-encrypt-symmetric-region)
-       (pgg-encrypt-symmetric, pgg-encrypt, pgg-decrypt-region)
-       (pgg-decrypt, pgg-sign-region, pgg-sign): Add optional
-       `passphrase' argument, so the passphrase can be managed externally
-       and then passed in to the system.
-
-       * pgg.el (pgg-read-passphrase, pgg-add-passphrase-cache)
-       (pgg-remove-passphrase-cache): Add optional NOTRUNCATE argument,
-       so the passphrase cache can be used reliably with identifiers
-       besides a pgp packet's key id.
-
-       * pgg-gpg.el (pgg-pgp-encrypt-region)
-       (pgg-pgp-encrypt-symmetric-region, pgg-pgp-encrypt-symmetric)
-       (pgg-pgp-encrypt, pgg-pgp-decrypt-region, pgg-pgp-decrypt)
-       (pgg-pgp-sign-region, pgg-pgp-sign): Add optional PASSPHRASE
-       argument to all these routines, so the passphrase can be managed
-       externally and passed in to the system.
-
-       * pgg-gpg.el (pgg-gpg-possibly-cache-passphrase): Add optional
-       `notruncate' argument, so the passphrase cache can be used
-       reliably with identifiers besides a pgp packet's key id.
-
-2005-10-29  Sascha Wilde  <swilde@sha-bang.de>
-
-       * pgg-gpg.el (pgg-gpg-encrypt-symmetric-region): New function for
-       symmetric encryption.
-       (pgg-gpg-symmetric-key-p): New function to check for an symmetric
-       encrypted session key.
-       (pgg-gpg-decrypt-region): When decrypting a symmetric encrypted
-       message ask for the passphrase in a proper way.
-
-       * pgg.el (pgg-encrypt-symmetric, pgg-encrypt-symmetric-region):
-       New user commands for symmetric encryption.
-
-2005-10-28  Bill Wohler  <wohler@newt.com>
-
-       * help-mode.el (help-url): New button type.  Calls browse-url.
-       (help-xref-url-regexp): New regexp to recognize URLs in docstring.
-       Similar to Info nodes: URL `url'.
-       (help-make-xrefs): Create help-url buttons for
-       help-xref-url-regexp matches.
-
-2005-10-29  Nick Roberts  <nickrob@snap.net.nz>
-
-       * tool-bar.el (tool-bar-add-item-from-menu)
-       (tool-bar-local-item-from-menu): Fix doc strings.
-
-2005-10-28  Romain Francoise  <romain@orebokech.com>
-
-       * ldefs-boot.el: Update.
-
-       * subr.el (locate-library): Move from help-fns.el.
-       * help-fns.el (locate-library): Move to subr.el.
-
-2005-10-28  Richard M. Stallman  <rms@gnu.org>
-
-       * net/tramp.el (tramp-completion-mode): defvar moved up.
-
-       * emacs-lisp/easymenu.el (easy-menu-change): Doc fix.
-
-       * tool-bar.el (tool-bar-mode): Delete autoload cookie.
-
-       * files.el (find-file-noselect): Use %d to format large file size.
-
-       * bindings.el (mode-line-format): Add %e.
-
-       * loadup.el ("facemenu"): Load unconditionally.
-       ("image", "international/fontset", "dnd", "mwheel", "tool-bar"):
-       ("x-dnd"): Load, when appropriate.
-
-       * startup.el (command-line): Call before-init-hook earlier.
-       Warn about some bad characters in -u user name.
-
-       * textmodes/flyspell.el (flyspell-large-region): Pass -t if Tex file.
-       (flyspell-external-point-words): Error if misspelled word is not found.
-       Set flyspell-large-region-beg at end of word.
-
-2005-10-28  Andreas Schwab  <schwab@suse.de>
-
-       * view.el (View-revert-buffer-scroll-page-forward):
-       Use view-page-size-default.
-
-2005-10-28  Juri Linkov  <juri@jurta.org>
-
-       * international/quail.el (quail-get-current-str): Translate last
-       raw character for deterministic input methods.
-
-2005-10-27  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-ext.el: Add functions to autoloads.
-       (math-identity-matrix-p, math-ident-row-p): New functions.
-
-       * calc/calc-arith.el (calc-mul-symb-fancy): Add checks for
-       multiplication by an identity matrix; don't turn multiplication by
-       an inverse matrix into division.
-       (math-div-symbol-fancy): Replace division by matrices with
-       multiplication by inverse.
-
-       * calc/calc-misc.el (calcFunc-inv): Check for symbolic matrices.
-
-       * calc/calc-alg.el (calcFunc-writeoutpower, math-write-out-power)
-       (calc-writeoutpower): New functions.
-
-2005-10-27  Romain Francoise  <romain@orebokech.com>
-
-       * replace.el (occur-engine): Include colon in mouse-face highlight.
-
-       * dired-x.el: Change Maintainer field.
-
-2005-10-26  Chong Yidong  <cyd@stupidchicken.com>
-
-       * longlines.el (longlines-mode): Bind after-change-functions to
-       nil during initial decoding and final encoding.
-
-2005-10-26  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * term.el (term-emulate-terminal, term-handle-colors-array)
-       (term-handle-ansi-escape): Specify the terminfo capabilities
-       implemented.
-
-2005-10-26  Richard M. Stallman  <rms@gnu.org>
-
-       * info.el (Info-fontify-node): Fix detection of sentence-break
-       before *Note.
-
-2005-10-26  Romain Francoise  <romain@orebokech.com>
-
-       * smerge-mode.el: Add `tools' to file keywords.
-
-2005-10-26  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-menu-map): Only display gud-until icon
-       when the fringe is not available.
-
-       * progmodes/gdb-ui.el (def-gdb-auto-updated-buffer)
-       (def-gdb-auto-update-trigger): Simplify construction.
-       (gdb-locals-buffer): Use def-gdb-auto-update-trigger instead of
-       def-gdb-auto-updated-buffer as gdb-info-locals-handler is
-       defined explicitly.
-       (gdb-assembler-buffer): Use def-gdb-auto-update-handler instead of
-       def-gdb-auto-updated-buffer as gdb-invalidate-assembler is
-       defined explicitly.
-       (gdb-info-locals-custom): Remove as it's a no-op.
-
-2005-10-25  Chong Yidong  <cyd@stupidchicken.com>
-
-       * longlines.el (longlines-mode): Remove narrowing before
-       performing the initial decoding or final encoding.
-
-2005-10-25  Romain Francoise  <romain@orebokech.com>
-
-       * emacs-lisp/find-func.el (find-library-name): Also strip
-       extension if library name ends in .el, to take advantage of
-       `find-library-suffixes'.
-
-2005-10-25  Richard M. Stallman  <rms@gnu.org>
-
-       * menu-bar.el (menu-bar-help-menu): Say which kind of therapist.
-
-2005-10-25  Juri Linkov  <juri@jurta.org>
-
-       * textmodes/texinfo.el (texinfo-mode): Change charset of one
-       quotation mark from [mule-unicode-0100-24ff] to [japanese-jisx0208].
-
-2005-10-25  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * play/blackbox.el (blackbox-mode-map): Move init into declaration.
-       (blackbox-redefine-key): Add argument `map'.
-
-       * jit-lock.el (jit-lock-fontify-now): Be careful not to skip multiline
-       regions when moving the jit-lock-context-unfontify-pos boundary.
-
-2005-10-25  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * net/browse-url.el (browse-url-of-buffer): Add ".html" to filename.
-
-2005-10-25  Masatake YAMATO  <jet@gyve.org>
-
-       * dired-x.el (dired-virtual): Don't use `dired-insert-headerline'.
-
-2005-10-25  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac-@t-lrde.epita.fr>
-
-       * play/blackbox.el (blackbox-redefine-key): New function.
-       (blackbox-mode-map): Use it to remap existing bindings for cursor
-       motion instead of binding literal keys.
-
-2005-10-25  Glenn Morris  <rgm@gnu.org>
-
-       * calendar/diary-lib.el (diary-list-entries): Prevent infloop when
-       diary does not end in a newline.  Do not assume a blank line at
-       the start of the diary file.
-
-2005-10-25  Kenichi Handa  <handa@m17n.org>
-
-       * international/quail.el (quail-translate-key): If the input
-       method is deterministic and failed to handle the last key, restart
-       the key handling loop from an appropriate key.
-
-2005-10-25  Michael Albinus  <michael.albinus@gmx.de>
-
-       * vc.el (vc-dired-mode): Extend comment for binding of
-       `directory-listing-before-filename-regexp'.
-
-2005-10-25  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * textmodes/texinfo.el (texinfo-mode):
-       * textmodes/paragraphs.el (sentence-end-base): Use real chars, so as
-       not to unnecessarily expose emacs-mule's internal char codes.
-
-2005-10-25  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-put-breakpoint-icon): Correct help-echo.
-       Display hand pointer and help-echo on disabled icon too.
-       (gdb-mouse-until): New function.
-       (gdb-ann3): Bind it to mouse-2 and drag-mouse-1 in left fringe.
-
-2005-10-24  Chong Yidong  <cyd@stupidchicken.com>
-
-       * menu-bar.el (menu-bar-help-menu): Rename "psychiatrist", in line
-       with 2005-10-23 change to doctor.el.
-
-       * finder.el (finder-mode-map): Add follow-link binding.
-
-2005-10-25  Kim F. Storm  <storm@cua.dk>
-
-       * progmodes/gdb-ui.el (gdb-ann3): Bind mouse-3 in left fringe
-       to gdb-mouse-toggle-breakpoint-fringe.
-       (gdb-mouse-toggle-breakpoint-margin): Rename from
-       gdb-mouse-toggle-breakpoint.  Fix doc.
-       (gdb-mouse-toggle-breakpoint-fringe): New defun.
-       (gdb-put-string): Add optional SPROPS arg.  Add props to string.
-       (gdb-put-breakpoint-icon): Add gdb-bptno and gdb-enabled
-       string properties also for fringe breakpoint bitmaps.
-
-2005-10-24  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-start-icalendar-file): Fix format form.
-
-2005-10-25  Masatake YAMATO  <jet@gyve.org>
-
-       * simple.el (completion-common-substring):
-       Use `completion-common-substring' prior to `completion-base-size'.
-
-2005-10-24  Hrvoje Niksic  <hniksic@xemacs.org>
-
-       * savehist.el: Require CL while compiling.
-       (savehist-history-variables): Remove.
-       (savehist-save-minibuffer-history, savehist-additional-variables)
-       (savehist-minibuffer-history-variables): New vars.
-       (savehist-save): Use them.
-       (savehist-uninstall, savehist-minibuffer-hook): New funs.
-       (savehist-install): New fun, extracted from savehist-load.
-       (savehist-load): Use them.
-
-2005-10-24  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * emacs-lisp/lisp-mode.el (easy-mmode-define-global-mode): Don't add
-       a dummy doc-string-elt property.
-       (defalias, defvaralias, define-category): Add a docstring property.
-
-       * image.el (defimage):
-       * widget.el (define-widget):
-       * custom.el (defface, defcustom): Add `doc-string' declaration.
-
-       * emacs-lisp/advice.el (ad-make-advised-definition): Fix arg-order.
-       (defadvice): Add `doc-string' declaration.
-
-       * emacs-lisp/byte-run.el (macro-declaration-function):
-       Handle `doc-string' declarations.
-       (define-obsolete-function-alias, define-obsolete-variable-alias):
-       Add `doc-string' declaration.
-
-2005-10-24  Kenichi Handa  <handa@m17n.org>
-
-       * international/utf-7.el (utf-7): Add autoload cookie.
-
-       * term/x-win.el: Register more Cyrillic characters in x-keysym-table.
-
-2005-10-24  Eli Zaretskii  <eliz@gnu.org>
-
-       * makefile.w32-in (autoloads): Use "." instead of $(lisp) in the
-       list of directories passed to batch-update-autoloads.  Add "." to
-       the list of the echoed directories.
-
-       * pgg-def.el:
-       * pgg-gpg.el:
-       * pgg-parse.el:
-       * pgg-pgp.el:
-       * pgg-pgp5.el:
-       * pgg.el: Moved here from the gnus subdirectory.
-
-2005-10-24  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-filter): Bind inhibit-read-only to t
-       in case comint-prompt-read-only is set to t.
-
-       * progmodes/gdb-ui.el (gdb-send): Bind inhibit-read-only to t
-       in case comint-prompt-read-only is set to t.
-
-2005-10-24  Ulf Jasper  <ulf.jasper@web.de>
-
-       * calendar/icalendar.el (icalendar-version): Increase to 0.13.
-       Now a string.
-       (icalendar-import-format): Handle CLASS, STATUS, URL.
-       Rename `subject' to `summary'.
-       (icalendar-import-format-summary): Rename from
-       `icalendar-import-format-subject'.
-       (icalendar-import-format-url, icalendar-import-format-status)
-       (icalendar-import-format-class): New variables.
-       (icalendar--rris): Take variable argument list.
-       (icalendar--datestring-to-isodate): Remove unnecessary
-       calendar-style check when converting dates with explicit month names.
-       (icalendar-export-region): Change return type of conversion
-       subroutines.  Bury current buffer unless error occurred.
-       (icalendar--convert-to-ical)
-       (icalendar--parse-summary-and-rest): New functions.
-       (icalendar--convert-ordinary-to-ical)
-       (icalendar--convert-weekly-to-ical)
-       (icalendar--convert-yearly-to-ical)
-       (icalendar--convert-block-to-ical)
-       (icalendar--convert-cyclic-to-ical)
-       (icalendar--convert-anniversary-to-ical): Change return type.
-       Strip trailing blanks from subject.
-       (icalendar--convert-sexp-to-ical): Change return type.
-       Strip trailing blanks from subject.  Handle simple sexp
-       entries as generated by icalendar.el.
-       (icalendar--convert-float-to-ical)
-       (icalendar--convert-date-to-ical): Strip trailing blanks from subject.
-       (icalendar-import-file): Doc fix.
-       (icalendar--format-ical-event): Handle CLASS, STATUS, URL.
-       Correct call to icalendar--rris.
-       (icalendar--convert-ical-to-diary): Doc fix.  Rename `subject' to
-       `summary'.
-       (icalendar--add-diary-entry): Rename `subject' to `summary'.
-
-2005-10-24  Romain Francoise  <romain@orebokech.com>
-
-       * server.el (server-sentinel): Set query-on-exit flag to nil on
-       new client processes (it isn't inherited from the server process).
-
-       * replace.el (occur-engine): Rearrange text properties.
-
-2005-10-23  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * emacs-lisp/debug.el (debugger-make-xrefs): Don't assume
-       case-fold-search is nil.
-       (debug-help-follow): Use help-xref-interned directly.
-
-2005-10-23  Chong Yidong  <cyd@stupidchicken.com>
-
-       * thumbs.el (thumbs-image-type): Add .pbm.
-
-2005-10-23  Richard M. Stallman  <rms@gnu.org>
-
-       * faces.el (inhibit-face-set-after-frame-default): New variable.
-       (set-face-attribute): Bind it.
-       (face-set-after-frame-default): Test it.
-
-       * help-fns.el (describe-simplify-lib-file-name): New function.
-       (describe-function-1, describe-variable): Use it.
-
-       * faces.el (describe-face): Use describe-simplify-lib-file-name.
-
-       * tooltip.el (tooltip-x-offset, tooltip-y-offset): Change defaults.
-       Eliminate nil as possible value.
-       (tooltip-hide-delay): Reduce internal-border-width.
-
-       * menu-bar.el (menu-bar-file-menu) <dired>: Change help-echo string.
-       (menu-bar-file-menu) <new-file>: Likewise.
-
-       * simple.el (line-move-finish): Ignore fields computing LINE-END.
-
-       * international/mule.el (load-with-code-conversion):
-       Pass full file name to `eval-buffer' unless preloading.
-
-       * textmodes/flyspell.el (flyspell-large-region):
-       Call ispell-check-version.
-
-       * textmodes/ispell.el (ispell-local-dictionary-overridden):
-       Fix the make-variable-buffer-local call that was supposed
-       to be for this variable.
-       (ispell-aspell-supports-utf8): Doc fix.
-       (ispell-find-aspell-dictionaries): Preserve elements of
-       ispell-dictionary-alist for dictionaries that aspell doesn't report.
-       (ispell-aspell-find-dictionary): Return nil on error.
-
-       * play/doctor.el (doctor-doc): Don't say "psychiatrist".
-       (doctor-symptoms): Likewise.
-
-       * add-log.el (add-log-current-defun): Clean up handling of DEFUNs.
-
-2005-10-23  Chong Yidong  <cyd@stupidchicken.com>
-
-       * cus-edit.el (custom-button, custom-button-pressed): New vars.
-       (custom-raised-buttons): Add :set spec.
-       (custom-button-unraised, custom-button-pressed-unraised):
-       New faces, so that custom-raised-buttons actually does something.
-       (custom-mode): Use custom-button and custom-button-pressed.
-
-       * wid-edit.el (widget-specify-button): Don't ignore
-       widget-mouse-face on graphic terminals.
-       (widget-move-and-invoke): Cleanup.
-
-2005-10-23  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * whitespace.el (whitespace-cleanup): Doc fix.
-
-2005-10-23  Romain Francoise  <romain@orebokech.com>
-
-       * emulation/viper.el (viper-set-hooks): Quote forms passed to
-       `eval-after-load' to avoid evaluating their result.
-
-2005-10-23  Michael Albinus  <michael.albinus@gmx.de>
-
-       * files.el (directory-listing-before-filename-regexp):
-       New defvar.  Replaces `dired-move-to-filename-regexp' from dired.el.
-
-       * dired.el (dired-move-to-filename-regexp): Remove.
-       All occurrences replaced by `directory-listing-before-filename-regexp'.
-
-       * dired-x.el, locate.el, vc.el:
-       Replace `dired-move-to-filename-regexp' by
-       `directory-listing-before-filename-regexp'.  In vc.el it is
-       overwritten locally; maybe this can be handled in files.el too.
-
-       * net/ange-ftp.el (ange-ftp-date-regexp): Remove.  All occurrences
-       replaced by `directory-listing-before-filename-regexp'.
-
-2005-10-23  Andreas Schwab  <schwab@suse.de>
-
-       * font-lock.el (lisp-font-lock-keywords-2): Add eval-at-startup
-       and eval-next-after-load.
-
-2005-10-23  MIYOSHI Masanori  <miyoshi@meadowy.org>  (tiny change)
-
-       * mouse.el (mouse-drag-region): If the *Messages* buffer doesn't
-       exist, create it.
-
-2005-10-23  Ken Manheimer  <ken.manheimer@gmail.com>
-
-       * allout.el: Remove autoloads for mailcrypt and crypt++.
-       Require pgg, pgg-gpg during compilation.
-       (allout-version): Increment version number to 2.1, and use a literal
-       rather than RCS Id.
-       (allout-default-encryption-scheme): Remove.
-       (allout-passphrase-verifier-handling)
-       (allout-passphrase-verifier-string)
-       (allout-file-passphrase-verifier-string)
-       (allout-passphrase-hint-string): Rename -key- to -passphrase-.
-       (allout-passphrase-hint-handling): Rename and simplify.
-       (allout-init): Use `find-file-hook' if available, otherwise
-       `find-file-hooks'.
-       (allout-mode): Use `write-file-functions' if available, otherwise
-       `local-write-file-hooks' and, instead of making auto-save-hook
-       buffer local, make the write-file-hook activity contingent to
-       allout-mode.
-       (allout-mode): Use key-binding substitution in the docstring.
-       (allout-kill-line): Spell-out kill ring data structure mutation
-       instead of using byte-compiler-complaint-provoking `pop'.
-       (allout-insert-listified): Use `insert' rather than `insert-string'
-       (allout-toggle-current-subtree-encryption): Update docstring, adjust
-       to new gpp-based encryption, use new `allout-encrypted-topic-p'.
-       (allout-encrypt-string): Totally revamped vis new underlying
-       encryption facilities.
-       (allout-mc-activate-passwd): Remove.
-       (allout-obtain-passphrase): New, more or less replaces
-       allout-mc-activate-passwd.
-       (allout-encrypted-key-info): More or less replaces
-       allout-encrypted-text-type.
-       (outlineify-sticky, outlinify-sticky): Add autoload cookie.
-       (my-mark-marker): Use `(featurep 'xemacs)'.
-
-2005-10-23  Lars Hansen  <larsh@soem.dk>
-
-       * emacs-lisp/bytecomp.el (byte-compile-lambda): New arg add-lambda.
-       (byte-compile-file-form-defmumble, byte-compile-defun)
-       (byte-compile-defmacro): Use it.
-       (byte-compile-form): Don't call byte-compile-set-symbol-position
-       when a byte-compile handler is called.
-
-2005-10-22  Romain Francoise  <romain@orebokech.com>
-
-       * savehist.el (savehist-history-variables): Add `grep-find-history'.
-
-       * subr.el (eval-after-load): Convert library name to an absolute
-       file name using locate-library, since load-history no longer has
-       library names in it.
-
-2005-10-22  Richard M. Stallman  <rms@gnu.org>
-
-       * files.el (make-temp-file): Move from subr.el.
-       * subr.el (make-temp-file): Move to files.el.
-
-       * window.el (get-buffer-window-list): Move from subr.el.
-       * subr.el (get-buffer-window-list): Move to window.el.
-
-       * image.el (image-load-path): Use eval-at-startup to initialize.
-
-       * subr.el (eval-at-startup): New macro.
-
-       * subr.el: Much rearrangement of functions and division
-       into pages.  No code changes.
-
-2005-10-22  Kenichi Handa  <handa@m17n.org>
-
-       * tar-mode.el (tar-extract): Be sure to call
-       find-operation-coding-system if set-auto-coding doesn't find a
-       coding system.
-
-2005-10-22  Kim F. Storm  <storm@cua.dk>
-
-       * image.el (image-type-header-regexps): Rename from image-type-regexps.
-       Change users.
-       (image-type-file-name-regexps): New defconst.
-       (image-type-from-data): Simplify loop.
-       (image-type-from-buffer): New defun.
-       (image-type-from-file-header): Use it instead of image-type-from-data.
-       Use image-search-load-path instead of only looking in data-directory.
-       (image-type-from-file-name): New defun.
-       (image-search-load-path): Change `pathname' to `filename'.
-       Make PATH arg optional, default to image-load-path.
-
-2005-10-21  Richard M. Stallman  <rms@gnu.org>
-
-       * textmodes/texinfo.el (texinfo-mode): Set sentence-end-base.
-
-       * textmodes/paragraphs.el (sentence-end-base): New variable.
-       (sentence-end): Use sentence-end-base.
-
-2005-10-21  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * font-lock.el (font-lock-default-fontify-region): Check the multiline
-       property independently from the font-lock-multiline variable.
-
-2005-10-21  Richard M. Stallman  <rms@gnu.org>
-
-       * emacs-lisp/find-func.el (find-library-name): Doc fix.
-
-       * startup.el (command-line): Convert library names
-       in `load-history' to absolute file names.
-
-       * subr.el (symbol-file): Doc fix.
-
-       * loadhist.el (file-loadhist-lookup): Call locate-library
-       instead of find-library-name.  Don't try converting
-       abs file names to library names, since load-history no longer
-       has library names in it.
-       (file-dependents, file-provides, file-requires): Doc fixes.
-
-2005-10-21  Juri Linkov  <juri@jurta.org>
-
-       * progmodes/etags.el (tags-table-mode): New function.
-       (tags-verify-table): Replace initialize-new-tags-table with
-       tags-table-mode.
-
-       * desktop.el (desktop-buffers-not-to-save): Remove TAGS from the
-       default value.
-       (desktop-modes-not-to-save): Add tags-table-mode to the
-       default value.
-
-       * info.el (Info-index-next): Add total number of index
-       alternatives to the message.
-
-       * textmodes/fill.el (fill-nobreak-p): Fix first two rules to skip
-       backward only space (instead of space and period) before looking
-       at sentence end.
-
-       * simple.el (set-variable): Use user-variable-p instead of symbolp.
-       Add the old variable value as 4th default-value arg of read-string.
-
-2005-10-21  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * cus-face.el (custom-declare-face): Make face from X resources
-       also on Mac.
-
-       * disp-table.el (standard-display-g1, standard-display-graphic):
-       Refuse to use string glyphs also on Mac.
-       (standard-display-european): Don't set terminal coding system also
-       on Mac.
-
-       * frame.el (display-screens): Use x-display-screens also on Mac.
-
-2005-10-21  Romain Francoise  <romain@orebokech.com>
-
-       * net/rcirc.el: Now part of GNU Emacs.  Update FSF's address.
-
-2005-10-21  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/sh-script.el (sh-font-lock-syntactic-keywords): Make $@
-       and $? into sexps.
-
-       * font-lock.el (font-lock-compile-keywords): Add a help-echo to the
-       warning face on open-paren-in-column-0.
-
-       * emacs-lisp/syntax.el (syntax-ppss-flush-cache): Fix corner
-       boundary case.  Fix typo.
-       Suggested by Martin Rudalics <rudalics@gmx.at>.
-
-2005-10-21  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-combined-agenda-icalendar-file)
-       (org-icalendar-include-todo, org-icalendar-combined-name): New options.
-       (org-export-icalendar-this-file)
-       (org-export-icalendar-all-agenda-files)
-       (org-export-icalendar-combine-agenda-files): New commands.
-       (org-export-icalendar, org-print-icalendar-entries)
-       (org-start-icalendar-file, org-finish-icalendar-file)
-       (org-ical-ts-to-string): New functions.
-       (org-read-date, org-goto-calendar)
-       (org-agenda-goto-calendar): Inhibit displaying diary entries by
-       call to `calendar'.
-       (orgtbl-setup): Remove the :keys arguments from the menu description.
-       (org-after-save-iCalendar-file-hook): New variable.
-
-2005-10-21  Kenichi Handa  <handa@m17n.org>
-
-       * language/vietnamese.el (tcvn-5712): Make it an alias of
-       vietnamese-tcvn coding-system.
-
-2005-10-20  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/ange-ftp.el (ange-ftp-date-regexp): Handle also the case no
-       group id is given.
-
-2005-10-20  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/sh-script.el (sh-escaped-line-re): New var.
-       (sh-here-doc-open-re, sh-font-lock-close-heredoc): Use it.
-       (sh-font-lock-open-heredoc): Try to properly handle heredoc starters
-       whose line is either continued or ends with a comment.
-
-2005-10-20  Romain Francoise  <romain@orebokech.com>
-
-       * net/rcirc.el (with-rcirc-process-buffer): Move above its first user.
-
-       * replace.el (occur-engine): Add follow-link property.
-
-       * font-core.el (font-lock-mode): Doc fix.
-
-2005-10-20  Richard M. Stallman  <rms@gnu.org>
-
-       * net/rcirc.el: New file.
-
-2005-10-20  Bryan Henderson  <bryanh@giraffe-data.com>  (tiny change)
-
-       * term.el (term-term-name): Initialize to "eterm-color".
-
-2005-10-20  Ken Manheimer  <ken.manheimer@gmail.com>
-
-       * allout.el: Add autoloads of crypt++ and mailcrypt routines, all
-       for encryption functionality.
-       Move allout customization subgroup from `editing' to `outlines' group.
-       Fix commentary keywords to legitimate ones.
-       Update author info (using my current email address, obscurified).
-       (allout-encrypt-string, allout-encryption-produce-work-buffer)
-       (allout-encrypted-topic-p, allout-encrypted-text-type)
-       (allout-mc-activate-passwd, allout-create-encryption-key-verifier)
-       (allout-situate-encryption-key-verifier)
-       (allout-get-encryption-key-verifier, allout-verify-key)
-       (allout-next-topic-pending-encryption)
-       (allout-encrypt-decrypted, allout-encrypted-type-prefix): New funcs.
-       (outline-topic-encryption-bullet, outline-default-encryption-scheme)
-       (outline-key-verifier-handling, outline-key-hint-handling)
-       (outline-encrypt-unencrypted-on-saves): New defcustoms.
-       (allout-file-key-verifier-string, allout-encryption-scheme)
-       (allout-key-verifier-string, allout-key-hint-string)
-       (allout-after-save-decrypt): New variables.
-       (allout-write-file-hook-handler, allout-auto-save-hook-handler)
-       (allout-after-saves-handler): New hook functions.
-       (allout-post-command-business): Do allout-after-save-decrypt.
-       (allout-enable-file-variable-adjustment): Custom var to enable
-       mechanism for adding and adjusting settings of Emacs file variables.
-       (allout-adjust-file-variable, allout-file-vars-section-data):
-       New functions, implement the mechanism.
-       (outlineify-sticky): Use the file vars mechanism.
-       (allout-inhibit-protection, allout-during-write-cue)
-       (allout-override-protect, allout-before-change-protect): Remove.
-       (allout-flag-region, allout-open-topic): Adjust read-only text.
-       (allout-open-line-not-read-only): Add to facilitate read-only
-       text based protection.
-       (allout-kill-line): Revise to adjust read-only text, clue the
-       user about the inhibition.
-       (allout-unprotected): Use unwind-protect.
-       (allout-shift-in, allout-shift-out): Disallow manually shifting a
-       topic deeper than the offspring depth of the previous topic -
-       avoiding confusing "containment discontinuities".
-       (allout-reindent-bodies): Fix retention of body relative hanging
-       indent during promotion of collapsed bodies.
-       (allout-open-topic): Make it easy to open new topic with same
-       bullet as current topic - topic creation functions provided with
-       any universal argument provokes now prompt for bullet, defaulting
-       to the bullet of the previous topic.
-       (allout-plain-bullets-string, allout-distinctive-bullets-string):
-       Plain bullet alternates `.' period and `,' comma only.  All other
-       bullets are relegated to special status (but customizable).
-       (allout-end-of-entry): Rename from allout-end-of-current-entry
-       since it actually operates w.r.t. most immediately containing
-       entry, visible or not.
-       (allout-hide-current-entry, allout-show-current-entry): Use the
-       revised version.
-       (allout-old-expose-topic): Solidify deprecation.
-       (allout-end-of-subtree): Add so we can span concealed as well
-       as visible topics.
-       (allout-end-of-current-subtree): Use `allout-end-of-subtree'.
-       (allout-end-of-current-heading): Tweak to just respect the first line.
-       (allout-get-body-text): Add.
-       (allout-ascend-to-depth, allout-ascend): Position at end of prefix
-       when invoked interactively.
-       (allout-up-current-level): Use `interactive-p'.
-       (allout-mode, allout-init): Miscellaneous docstring and
-       operational refinements, as well as hookups of new encryption stuff.
-       (allout-beginning-of-current-entry): Now works as advertised.
-       (allout-end-of-current-entry): Remove of superfluous allout-show-entry.
-       (allout-isearch-rectification): Refine condition for isearching.
-       (allout-isearch-abort, allout-enwrap-isearch)
-       (allout-flag-region, my-region-active-p): Relocate some macros.
-       (allout-title): Fallback title is (buffer-name), not
-       non-existing (current-buffer-name).
-       (subst-char-in-string): Define if absent (for some XEmacs versions).
-
-2005-10-20  Jari Aalto  <jari.aalto@cante.net>
-
-       * mail/sendmail.el (mail-setup-hook, mail-aliases)
-       (mail-yank-prefix, mail-indentation-spaces, mail-yank-hooks)
-       (mail-citation-prefix-regexp, mail-signature-file)
-       (mail-default-headers, mail-bury-selects-summary)
-       (mail-send-nonascii): Add autoload cookies.
-
-2005-10-20  Emanuele Giaquinta  <emanuele.giaquinta@gmail.com>  (tiny change)
-
-       * frame.el (blink-cursor-mode): Add `mac' to the list of
-       window-system's that support blinking cursor.
-
-2005-10-20  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * textmodes/org.el (org-level-color-stars-only): Fix typo in docstring.
-
-2005-10-20  Eli Zaretskii  <eliz@gnu.org>
-
-       * makefile.w32-in ($(lisp)/mh-e/mh-loaddefs.el):
-       Bind find-file-suppress-same-file-warnings to t, to avoid warnings due
-       to different drive letter case in D:/foo/bar.el vs d:/foo/bar.el.
-
-2005-10-20  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-is-tramp-root): Simplify regexp matching tramp root.
-       (ido-set-current-directory): Don't add / after final @.
-       (ido-file-name-all-completions-1): Adapt to fixed tramp completion.
-       Explicitly handle ange-ftp completion oddities.
-       (ido-make-file-list): Don't rotate list at tramp root to avoid
-       triggering tramp file handler for expand-file-name via get-file-buffer.
-
-2005-10-19  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * savehist.el (savehist-coding-system): Revert to checking XEmacs.
-
-2005-10-19  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-units.el (math-standard-units): Add units, adjust
-       symbols and update values.
-       (math-unit-prefixes): Add more prefixes.
-
-2005-10-19  Romain Francoise  <romain@orebokech.com>
-
-       * bookmark.el (bookmark-menu-heading): New face.
-       (bookmark-bmenu-list): Use it.
-       Don't fiddle with `baud-rate' at top-level.
-
-2005-10-18  Chong Yidong  <cyd@stupidchicken.com>
-
-       * image.el (create-image, find-image): Mention max-image-size in
-       docstring.
-
-2005-10-18  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * savehist.el (savehist-load): Revert to checking XEmacs.
-
-       * textmodes/conf-mode.el: Don't use font-lock-defaults-alist.
-       Various docstring and line-width fixups.
-       (conf-mode): Use cond.
-       Set font-lock-defaults.  Don't set comment-use-syntax.
-
-2005-10-18  David Ponce  <david@dponce.com>
-
-       * tree-widget.el (tree-widget-button-click): New function.
-       (tree-widget-button-keymap): Use it.
-
-2005-10-18  Romain Francoise  <romain@orebokech.com>
-
-       * bookmark.el (bookmark-insert-location, bookmark-bmenu-list)
-       (bookmark-bmenu-hide-filenames): Add follow-link property.
-       Improve help-echo text.
-
-       * ffap.el (find-file-at-point): Doc fix.
-
-2005-10-18  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * mouse.el (mouse-set-region): Don't do sit-for on a mac frame.
-
-2005-10-18  Masatake YAMATO  <jet@gyve.org>
-
-       Install to the CVS repository what I forgot to install in my
-       2005-10-16 changes.
-
-       * progmodes/python.el (python-complete-symbol): Pass the common
-       prefix substring of completion to `display-completion-list'.
-
-       * textmodes/org.el (org-complete): Ditto.
-
-2005-10-18  Masatake YAMATO  <jet@gyve.org>
-
-       Fix a bug reported by Sven Joachim <sven_joachim@web.de>.
-
-       * woman.el (WoMan-xref-man-page): New button type derived
-       from `Man-abstract-xref-man-page'.
-       (woman-mode): Pass `WoMan-xref-man-page' to `Man-highlight-references'.
-
-       * man.el (Man-abstract-xref-man-page): New button type.
-       (Man-xref-man-page): Make it derived from `Man-abstract-xref-man-page'.
-       (Man-highlight-references): Add new optional argument `xref-man-type'.
-
-2005-10-18  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-menu-map): Correct condition for fringe.
-
-2005-10-17  Chong Yidong  <cyd@stupidchicken.com>
-
-       * cus-edit.el (Custom-move-and-invoke): Delete.
-       (custom-mode-map): Bind mouse-1 to widget-move-and-invoke.
-
-       * wid-edit.el (widget-move-and-invoke): New function, from
-       Custom-move-and-invoke.
-
-2005-10-17  Bill Wohler  <wohler@newt.com>
-
-       Move all remaining images from lisp/toolbar to etc/images, move
-       lisp/toolbar/tool-bar to lisp and "delete" lisp/toolbar.  Place
-       the low resolution images in their own directory (low-color).
-
-       * toolbar/attach.*, toolbar/cancel.*, toolbar/close.*
-       * toolbar/copy.*, toolbar/cut.*, toolbar/diropen.*, toolbar/exit.*
-       * toolbar/help.*, toolbar/home.*, toolbar/index.*, toolbar/info.*
-       * toolbar/mail.*, toolbar/new.*, toolbar/open.*, toolbar/paste.*
-       * toolbar/preferences.*, toolbar/print.*, toolbar/save.*
-       * toolbar/saveas.*, toolbar/search.*, toolbar/search-replace.*
-       * toolbar/spell.*, toolbar/undo.*: Move to etc/images.
-
-       * toolbar/lc-copy.*: Move to etc/images/low-color/copy.*.
-       * toolbar/lc-cut.*: Move to etc/images/low-color/cut.*.
-       * toolbar/lc-help.*: Move to etc/images/low-color/help.*.
-       * toolbar/lc-home.*: Move to etc/images/low-color/home.*.
-       * toolbar/lc-index.*: Move to etc/images/low-color/index.*.
-       * toolbar/lc-new.*: Move to etc/images/low-color/new.*.
-       * toolbar/lc-open.*: Move to etc/images/low-color/open.*.
-       * toolbar/lc-paste.*: Move to etc/images/low-color/paste.*.
-       * toolbar/lc-preferences.*: Move to etc/images/low-color/preferences.*.
-       * toolbar/lc-print.*: Move to etc/images/low-color/print.*.
-       * toolbar/lc-save.*: Move to etc/images/low-color/save.*.
-       * toolbar/lc-saveas.*: Move to etc/images/low-color/saveas.*.
-       * toolbar/lc-search.*: Move to etc/images/low-color/search.*.
-       * toolbar/lc-spell.*: Move to etc/images/low-color/spell.*.
-       * toolbar/lc-undo.*: Move to etc/images/low-color/undo.*.
-
-       To conform with convention, replace the underscore (_) in the
-       following image names with dash (-) or (/) as appropriate.
-
-       * toolbar/back_arrow.*: Move to etc/images/back-arrow.*.
-       * toolbar/fld_open.*: Move to etc/images/fld-open.*.
-       * toolbar/fwd_arrow.*: Move to etc/images/fwd-arrow.*.
-       * toolbar/jump_to.*: Move to etc/images/jump-to.*.
-       * toolbar/left_arrow.*: Move to etc/images/left-arrow.*.
-       * toolbar/right_arrow.*: Move to etc/images/right-arrow.*.
-       * toolbar/up_arrow.*: Move to etc/images/up-arrow.*.
-       * toolbar/lc-back_arrow.*: Move to etc/images/low-color/back-arrow.*.
-       * toolbar/lc-fwd_arrow.*: Move to etc/images/low-color/fwd-arrow.*.
-       * toolbar/lc-jump_to.*: Move to etc/images/low-color/jump-to.*.
-       * toolbar/lc-left_arrow.*: Move to etc/images/low-color/left-arrow.*.
-       * toolbar/lc-right_arrow.*: Move to etc/images/low-color/right-arrow.*.
-       * toolbar/lc-up_arrow.*: Move to etc/images/low-color/up-arrow.*.
-       * toolbar/mail_compose.*: Move to etc/images/mail/compose.*.
-       * toolbar/mail_send.*: Move to etc/images/mail/send.*.
-
-       * info.el (info-tool-bar-map): Replace underscores in image names
-       with dashes.
-
-       * makefile.w32-in (WINS): Remove toolbar.
-
-       * menu-bar.el: Replace toolbar/tool-bar.el with tool-bar.el in comment.
-
-       * tool-bar.el: Move to lisp from toolbar.  Now that
-       toolbar is empty, it should be deleted when folks run "cvs up -P".
-
-2005-10-18  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-store.el (calc-store-into): Get the proper variable name
-       to display in message.
-
-2005-10-18  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-var-create-handler): Make watch
-       expressions display in speedbar for all buffers when debugging.
-       (gdb-speedbar-expand-node): Ensure node contraction is always updated.
-
-       * speedbar.el (speedbar-set-mode-line-format): Indent properly.
-       (speedbar-insert-button, speedbar-make-button):
-       Use add-text-properties.
-       (speedbar-update-localized-contents)
-       (speedbar-update-directory-contents)
-       (speedbar-update-special-contents): Use dolist.
-       (speedbar-buffer-easymenu-definition): Add a menu separator.
-
-2005-10-17  Jason Rumney  <jasonr@gnu.org>
-
-       * makefile.w32-in: Use $(lisp) consistently.
-       (pre-mh-loaddefs.el-SH, pre-mh-loaddefs.el-CMD): New targets
-       for shell specific generation of mh-autoloads.
-
-2005-10-17  Richard M. Stallman  <rms@gnu.org>
-
-       * textmodes/tex-mode.el (tex-font-lock-keywords-2): Undo prev change.
-
-2005-10-17  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * jit-lock.el (jit-lock-fontify-now):
-       Move jit-lock-context-unfontify-pos to avoid wasted work.
-
-2005-10-17  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/tramp.el (tramp-completion-mode): New defvar.  Used in
-       `tramp-completion-mode' for checking if we are in completion mode.
-       (tramp-completion-handle-file-name-all-completions): Reorder code
-       in order to complete for file names only in case there are no
-       method/user/host completions.  This is necessary for cooperation
-       with ido.  Reported by Kim F. Storm <storm@cua.dk>.
-
-2005-10-16  Chong Yidong  <cyd@stupidchicken.com>
-
-       * longlines.el (longlines-search-forward)
-       (longlines-search-backward): Match any number of spaces.
-
-2005-10-16  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * diff-mode.el (diff-mode): Doc fix.
-
-2005-10-16  David Reitter  <david.reitter@gmail.com>
-
-       * mail/sendmail.el (send-mail-function): Use mailclient-send-it
-       as default on darwin and windows systems.
-
-2005-10-16  Sven Joachim  <svenjoac@gmx.de>  (tiny change)
-
-       * arc-mode.el (archive-zip-extract): Doc fix.
-
-2005-10-16  Romain Francoise  <romain@orebokech.com>
-
-       * mouse.el (mouse-1-click-follows-link): Doc fix.
-
-2005-10-16  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * savehist.el: Don't require CL at runtime.
-       (savehist-xemacs): Remove.
-       (savehist-coding-system): Use utf-8 if present, regardless of religion.
-       (savehist-no-conversion): Use (featurep 'xemacs).
-       (savehist-load): Check existence of start-itimer rather than XEmacs.
-       Use an idle timer.
-       (savehist-process-for-saving): Replace use of CL funs `subseq' and
-       `delete-if-not'.
-
-2005-10-16  Hrvoje Niksic  <hniksic@xemacs.org>
-
-       * savehist.el: Newer version.
-       (savehist-autosave-interval, savehist-coding-system, savehist-timer)
-       (savehist-last-checksum, savehist-no-conversion): New vars.
-       (savehist-autosave, savehist-process-for-saving, savehist-printable):
-       New functions.
-       (savehist-load, savehist-save): Use them.
-       (savehist-delimit): Remove.
-
-2005-10-16  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/compile.el (compilation-goto-locus): Display the
-       compilation buffer first and the source buffer second, in case they're
-       in overlapping frames.  Don't raise the compilation frame if it was the
-       selected window upon entry.  Pass the `other-window' arg to
-       pop-to-buffer.
-
-       * info.el (Info-fontify-node): Use dolist.
-       Change add-text-properties to put-text-property.
-
-2005-10-16  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
-
-       * textmodes/bibtex.el (bibtex-font-lock-url): Catch when point past
-       bound of search.
-
-2005-10-16  Masatake YAMATO  <jet@gyve.org>
-
-       * dabbrev.el (dabbrev-completion): Pass the common
-       prefix substring of completion to `display-completion-list'.
-
-       * filecache.el (file-cache-minibuffer-complete)
-       (file-cache-complete): Ditto.
-
-       * tempo.el (tempo-display-completions): Ditto.
-
-       * wid-edit.el (widget-file-complete, widget-color-complete): Ditto.
-
-       * emacs-lisp/lisp.el (lisp-complete-symbol): Ditto.
-
-       * eshell/em-hist.el (eshell-list-history): Ditto.
-
-       * mail/mailabbrev.el (mail-abbrev-complete-alias): Ditto.
-
-       * mail/mailalias.el (mail-complete): Ditto.
-
-       * progmodes/etags.el (complete-tag): Ditto.
-
-       * progmodes/make-mode.el (makefile-complete): Ditto.
-
-       * progmodes/meta-mode.el (meta-complete-symbol): Ditto.
-
-       * progmodes/octave-mod.el (octave-complete-symbol): Ditto.
-
-       * progmodes/pascal.el (pascal-complete-word)
-       (pascal-show-completions): Ditto.
-
-       * textmodes/bibtex.el (bibtex-complete-internal): Ditto.
-
-       * simple.el (completion-common-substring): New variable.
-       (completion-setup-function): Use `completion-common-substring'
-       to put faces.
-
-2005-10-16  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el: Apply 2005-10-09 change for term/x-win.el.
-       (x-get-selection, mac-select-convert-to-string): Convert from/to
-       UTF-16 clipboard data as in native byte order, no BOM.
-
-2005-10-16  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-tool-bar-map): Rename the images
-       appropriately (gud/next, gud/nexti, gud/step, gud/stepi).
-       (gud-sentinel): Use speedbar-frame to check for speedbar.
-
-2005-10-15  Richard M. Stallman  <rms@gnu.org>
-
-       * savehist.el: New file.
-
-2005-10-14  Karl Chen  <quarl@cs.berkeley.edu>
-
-       * textmodes/tex-mode.el (tex-font-lock-keywords-2):
-       Fix bug in \bf fontification.
-
-2005-10-15  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * pcvs.el (cvs-edit-log-files): New var.
-       (cvs-mode-edit-log): New arg `file'.
-       (cvs-edit-log-minor-wrap): Don't set the ignore-marks property.
-       Instead force the use of the original file and nothing else.
-       (cvs-edit-log-filelist): Don't use the cvs-mode-* function unless
-       the cvs-minor-wrap-function is set.
-       (cvs-do-edit-log): Obey the vars set in cvs-edit-log-minor-wrap.
-
-2005-10-14  Bill Wohler  <wohler@newt.com>
-
-       * toolbar/gud-break.*: Moved to etc/images/gud/break.*.
-       * toolbar/gud-cont.*: Moved to etc/images/gud/cont.*.
-       * toolbar/gud-down.*: Moved to etc/images/gud/down.*.
-       * toolbar/gud-finish.*: Moved to etc/images/gud/finish.*.
-       * toolbar/gud-ni.*: Moved to etc/images/gud/ni.*.
-       * toolbar/gud-n.*: Moved to etc/images/gud/n.*.
-       * toolbar/gud-print.*: Moved to etc/images/gud/print.*.
-       * toolbar/gud-pstar.*: Moved to etc/images/gud/pstar.*.
-       * toolbar/gud-remove.*: Moved to etc/images/gud/remove.*.
-       * toolbar/gud-run.*: Moved to etc/images/gud/run.*.
-       * toolbar/gud-si.*: Moved to etc/images/gud/si.*.
-       * toolbar/gud-s.*: Moved to etc/images/gud/s.*.
-       * toolbar/gud-until.*: Moved to etc/images/gud/until.*.
-       * toolbar/gud-up.*: Moved to etc/images/gud/up.*.
-       * toolbar/gud-watch.*: Moved to etc/images/gud/watch.*.
-
-       * progmodes/gud.el (gud-tool-bar-map): Rename the images
-       appropriately (for example, gud-break to gud/break).
-
-2005-10-14  Chong Yidong  <cyd@stupidchicken.com>
-
-       * longlines.el (longlinges-search-function)
-       (longlines-search-forward, longlines-search-backward): New functions.
-       (longlines-mode): Set isearch-search-fun-function to
-       longlinges-search-function.
-
-       * mouse.el (mouse-drag-region-1): Handle the case where a
-       double-click event is bound to an arbitrary function.
-
-2005-10-14  David Ponce  <david@dponce.com>
-
-       * recentf.el (recentf-track-opened-file)
-       (recentf-track-closed-file, recentf-update-menu)
-       (recentf-used-hooks, recentf-enabled-p): Move before dialog stuff.
-       (recentf-dialog-mode-map): Map follow-link to RET, so dialogs obey
-       mouse-1-click-follows-link.
-
-2005-10-13  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * toolbar/diropen.xpm, toolbar/diropen.pbm: New versions made from
-       Gnome file-manager.png.  Suggested by
-       Joachim Nilsson <joachim.nilsson@vmlinux.org>.
-
-       * toolbar/README: Add diropen.xpm.
-
-2005-10-13  Bill Wohler  <wohler@newt.com>
-
-       * makefile.w32-in (MH_E_SRC): Rename from MH-E-SRC per NMAKE
-       restrictions.  Suggested by David Robinow <drobinow@gmail.com>.
-
-2005-10-13  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/mixal-mode.el (mixal-operation-codes-alist):
-       Don't waste the byte-compiler's time on constant data.
-
-2005-10-13  Kenichi Handa  <handa@m17n.org>
-
-       * international/utf-8.el (utf-8-compose): Display an invalid UTF-8
-       byte with `escape-glyph' face.
-
-       * international/fontset.el (ccl-encode-unicode-font):
-       Lookup utf-subst-table-for-encode, not ucs-mule-cjk-to-unicode.
-       Handle the case that ucs-mule-to-mule-unicode translates a character to
-       ASCII (usually for IPA characters).
-
-2005-10-12  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * info.el (Info-fontify-node): Don't be fooled by a lone "...".
-       Don't hide the underline of titles if font-lock-mode is disabled.
-
-2005-10-12  Bill Wohler  <wohler@newt.com>
-
-       * makefile.w32-in (MH-E-SRC): New.  Used by mh-autoloads.
-       (mh-autoloads): New.  Builds mh-e/mh-loaddefs.el.  Rebuilds if any
-       files in MH-E-SRC have been updated.
-       (updates, compile, recompile, bootstrap): Depend on mh-autoloads.
-
-2005-10-12  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/mixal-mode.el (mixal-operation-codes): Remove.
-       (mixal-mode-syntax-table): Add \n as end-comment.
-       (mixal-operation-codes-alist): Immediately initialize to full value.
-       (mixal-add-operation-code): Remove.
-       (mixal-describe-operation-code): Make the arg non-optional.
-       Use the interactive spec instead.
-       Use mixal-operation-codes-alist rather than mixal-operation-codes.
-       (mixal-font-lock-keywords): Don't highlight comments here any more.
-       (mixal-font-lock-syntactic-keywords): New var.
-       (mixal-mode): Use it.  Fix comment-start-skip.
-
-2005-10-12  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * startup.el (command-line-x-option-alist): -nb => -nbi.
-
-2005-10-12  Kim F. Storm  <storm@cua.dk>
-
-       * startup.el (fancy-splash-default-action): Discard mouse click in
-       the splash screen window, as it has no sensible meaning in the
-       next window to be selected.  Fixes error reported by Jan D.
-
-2005-10-12  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * desktop.el (desktop-load-file): Do nothing when FUNCTION is nil.
-
-2005-10-11  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/mixal-mode.el: Sync with version in the GNU MDK project.
-       Try to fix up minor layout issues like indentation, line break, etc...
-       (mixal-mode-syntax-table): Don't try to specify comment syntax,
-       because it doesn't work.
-       (mixal-operation-codes): Add some more codes.
-       (mixal-font-lock-keywords): Process comments here.
-       (mixal-mode): mixasm no longer needs -g option.
-
-2005-10-11  Sven Joachim  <svenjoac@gmx.de>  (tiny change)
-
-       * progmodes/sh-script.el (sh-tmp-file):
-       Use mktemp -t.  Finish support for es and rc shells.
-
-2005-10-11  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calcalg2.el (calc-integral): With an argument, compute the
-       definite integral.
-
-2005-10-11  Chong Yidong  <cyd@stupidchicken.com>
-
-       * mouse.el (mouse-drag-region-1): Don't try to catch a
-       double-click when doing follow-link (it's overridden anyway).
-
-2005-10-11  Juanma Barranquero  <lekktu@gmail.com>
-
-       * emacs-lisp/autoload.el (update-directory-autoloads): Doc fix.
-       (autoload-print-form-outbuf): Add docstring.
-
-2005-10-11  Juri Linkov  <juri@jurta.org>
-
-       * info.el (Info-mode-menu): Delete menu item "Edit".
-       (Info-mode): Delete description of Info-edit from docstring,
-       and rearrange descriptions of Info commands in the order
-       they are documented in the Info manual.
-
-2005-10-11  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * calendar/appt.el (appt-check): Use diary-selective-display var.
-
-2005-10-10  Richard M. Stallman  <rms@gnu.org>
-
-       * net/newsticker.el (newsticker-start, newsticker-show-news):
-       Add autoload cookies.
-
-2005-10-10  Emanuele Giaquinta  <emanuele.giaquinta@gmail.com>
-
-       * progmodes/sh-script.el (sh-tmp-file): Use mktemp.
-
-2005-10-10  Karl Chen  <quarl@cs.berkeley.edu>
-
-       * jka-cmpr-hook.el (jka-compr-handler): Fix typo in `operations' prop.
-
-2005-10-10  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-arith.el (math-check-known-scalarp)
-       (math-check-known-matrixp): Check the values of arguments that are
-       variables.
-       (math-check-known-square-matrixp): New function.
-       (math-known-square-matrixp): Use math-check-known-square-matrixp.
-       (math-super-types): Add sqmatrix type.
-
-       * calc/calc-mode.el (calc-matrix-mode, math-get-modes-vec): Change the
-       mode name `square' to `sqmatrix'.
-
-       * calc/calc.el (calc-matrix-mode, calc-set-mode-line): Change the
-       mode name `square' to `sqmatrix'.
-
-2005-10-10  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/etags.el (select-tags-table-mode): Don't use
-       selective-display.
-       (tags-select-tags-table): Pass `button' to the action function.
-       (select-tags-table): Place the side-info on button properties rather
-       than in hidden text.  Abbreviate file names.
-       (select-tags-table-mode-map): Inherit rather than copy buttom-map.
-       (select-tags-table-select): Add `button' argument.
-       Get side-info from the button property rather than from hidden text.
-
-2005-10-11  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-install-speedbar-variables): Add more bindings.
-       (gud-speedbar-buttons): Preserve point if possible.
-       (gud-sentinel): Restore previous speedbar display type.
-
-       * progmodes/gdb-ui.el (gdba): Improve diagram.
-       (def-gdb-auto-update-handler, gdb-info-locals-handler)
-       (gdb-put-breakpoint-icon, gdb-remove-breakpoint-icons):
-       Call get-buffer-window once.
-
-2005-10-10  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/pascal.el (pascal-mode-map): Move init into declaration.
-       (pascal-mode-syntax-table): Make (* *) markers same class as { ... }.
-       (pascal-indent-command): Remove unused var `ind'.
-       (pascal-indent-case): Remove unused var `oldpos'.
-       (pascal-outline-map): Don't inherit from pascal-mode-map anymore,
-       since it's now used as a proper minor mode map.
-       (pascal-outline): Rename to pascal-outline-mode.
-       (pascal-outline-mode): Use define-minor-mode.
-       (pascal-outline-mode, pascal-outline-change): Use overlays rather than
-       selective-display.
-
-2005-10-10  Andreas Schwab  <schwab@suse.de>
-
-       * textmodes/tex-mode.el (tex-font-lock-keywords-2): Adjust match
-       number.  Reported by Karl Chen <quarl@cs.berkeley.edu>.
-
-       * Makefile.in ($(lisp)/mh-e/mh-loaddefs.el): Fix for building
-       outside source directory.
-
-2005-10-10  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-mode-map): Explicit definition of `C-c
-       C-x' as a prefix.
-       (orgtbl-mode-map): Full keymap instead of sparse, because all
-       `self-insert-command' keys are redefined in this map.
-       (org-export-as-html): Specify charset for HTML file, by taking it
-       from the coding system.
-
-2005-10-10  Kenichi Handa  <handa@m17n.org>
-
-       * textmodes/flyspell.el (flyspell-check-word-p):
-       If unread-command-events is non-empty, don't call sit-for.
-
-2005-10-09  Richard M. Stallman  <rms@gnu.org>
-
-       * font-lock.el (font-lock-syntactic-keywords)
-       (font-lock-keywords): Doc fixes.
-
-       * textmodes/flyspell.el (flyspell-external-point-words):
-       Simplify logic, and don't try to check for consecutive appearances
-       of one incorrect word.
-
-2005-10-10  Nick Roberts  <nickrob@snap.net.nz>
-
-       * speedbar.el (speedbar-buffer-easymenu-definition): Add menu
-       separator.
-
-       * progmodes/gud.el (gud-last-speedbar-buffer): Remove.
-       (gud-install-speedbar-variables): Add GUD to speedbar "Displays" list.
-       (gud-expansion-speedbar-buttons): New function.
-       (gud-speedbar-buttons): Check for gud-comint-buffer.
-
-2005-10-09  Bill Wohler  <wohler@newt.com>
-
-       * Makefile.in (updates): Add mh-loaddefs dependency.
-
-2005-10-09  Chong Yidong  <cyd@stupidchicken.com>
-
-       * speedbar.el (speedbar-file-key-map): Fix typo.
-
-2005-10-09  Daniel Brockman  <daniel@brockman.se>
-
-       * cus-start.el (line-spacing): Add custom spec.
-
-2005-10-09  Romain Francoise  <romain@orebokech.com>
-
-       * textmodes/ispell.el (ispell-check-version): Fix last change.
-
-2005-10-09  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * term/x-win.el: Remove -i, --icon-type from comment.
-
-       * startup.el (command-line-x-option-alist): Remove options -i,
-       -itype, --icon-type, added -nb, --no-bitmap-icon.
-
-2005-10-09  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-speedbar-menu-items): Use :visible
-       instead of :active.
-
-2005-10-08  Eric Hanchrow  <offby1@blarg.net>  (tiny change)
-
-       * textmodes/ispell.el (ispell-check-version):
-       Ignore hyphen, and all that follows, in aspell's version text.
-
-2005-10-08  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-arith.el (math-known-square-matrixp): New function.
-       (math-pow-fancy): Check for matrices before distributing exponent
-       across products.
-
-       * calc/calc-keypd.el (calc-do-keypad): Widen keypad window for
-       fullscreen keypad.  Suggested by Luc Teirlinck.
-       (calc-keypad-show-input): Add space for formatting.
-
-       * calc/calc-mode.el (calc-matrix-mode, math-get-modes-vec):
-       Add square matrix option.
-
-       * calc/calc-poly.el (math-expand-term): Check for matrices instead
-       of checking calc-matrix-mode when deciding how to expand.
-
-       * calc/calc.el (calc-set-mode-line): Add square matrix option.
-
-2005-10-08  Lars Hansen  <larsh@soem.dk>
-
-       * net/tramp.el (tramp-perl-directory-files-and-attributes):
-       Add error handling.
-       (tramp-handle-directory-files-and-attributes): Handle perl error msg.
-
-2005-10-08  Michael Albinus  <michael.albinus@gmx.de>
-
-       Sync with Tramp 2.0.51.
-
-       * net/tramp.el (tramp-handle-set-visited-file-modtime)
-       (tramp-handle-insert-file-contents, tramp-handle-write-region):
-       Insert special handling for `last-coding-system-used', again
-       it still seems to be necessary (unlike stated before).
-       Reported by Toshinori Sugita <sugita@d-pad.co.jp>.
-       (tramp-password-prompt-regexp): There might be other words before
-       trailing ":".  Reported by Kurt Steinkraus <kurt@steinkraus.us>.
-       (tramp-chunksize): Improve docstring.
-       (tramp-set-auto-save-file-modes): Octal integer code #o600 breaks
-       Emacs 20.  Use `tramp-octal-to-decimal' therefore.  Reported by
-       Christian Joergensen <bugs@razor.dk>.
-
-2005-10-07  Glenn Morris  <rgm@gnu.org>
-
-       * progmodes/f90.el (f90-keywords-re, f90-mode): Doc fix.
-       (f90-font-lock-keywords-2, f90-mode-abbrev-table): Add `double
-       precision'.
-
-2005-10-07  Romain Francoise  <romain@orebokech.com>
-
-       * ibuf-ext.el (ibuffer-do-shell-command-pipe)
-       (ibuffer-do-shell-command-pipe-replace)
-       (ibuffer-do-shell-command-file, ibuffer-do-eval)
-       (ibuffer-do-view-and-eval, ibuffer-do-rename-uniquely)
-       (ibuffer-do-revert, ibuffer-do-replace-regexp)
-       (ibuffer-do-query-replace, ibuffer-do-query-replace-regexp)
-       (ibuffer-do-print, ibuffer-filter-by-mode, ibuffer-filter-by-used-mode)
-       (ibuffer-filter-by-name, ibuffer-filter-by-filename)
-       (ibuffer-filter-by-size-gt, ibuffer-filter-by-size-lt)
-       (ibuffer-filter-by-content, ibuffer-filter-by-predicate
-       (ibuffer-do-sort-by-major-mode, ibuffer-do-sort-by-mode-name)
-       (ibuffer-do-sort-by-alphabetic, ibuffer-do-sort-by-size):
-       Autoload file sans suffix.
-
-       * emulation/cua-base.el (cua-toggle-global-mark): Likewise.
-
-2005-10-07  David Ponce  <david@dponce.com>
-
-       * recentf.el (recentf-menu-open-all-flag): New option.
-       (recentf-digit-shortcut-command-name): New function.
-       (recentf--shortcuts-keymap): New variable.
-       (recentf-menu-shortcuts): New variable.
-       (recentf-make-menu-items): Initialize it.  Replace the "More..."
-       menu item by "All...", if `recentf-menu-open-all-flag' is non-nil.
-       (recentf-menu-value-shortcut): New function.
-       (recentf-make-menu-item): Use it.  No more in-lined.
-       (recentf-dialog-mode-map): Base on `recentf--shortcuts-keymap'.
-       (recentf-open-most-recent-file): Rename from
-       `recentf-open-file-with-key'.  Don't depend on key binding.
-       (recentf-mode-map): New variable.
-       (recentf-mode): Use it.
-
-2005-10-06  Bill Wohler  <wohler@newt.com>
-
-       * mh-e/mh-loaddefs.el: Remove.  Now generated automatically.
-
-       * Makefile.in (AUTOGENEL): Add mh-e/mh-loaddefs.el.
-       (MH-E-SRC): New.  Used by mh-autoloads.
-       (mh-autoloads): New.  Builds mh-e/mh-loaddefs.el.  Rebuilds if any
-       files in MH-E-SRC have been updated.
-       (compile, recompile, bootstrap): Depend on mh-autoloads.
-
-2005-10-07  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-menu-map): Only display un-intuitive
-       gud-break and gud-remove icons when the fringe is not available.
-
-       * progmodes/gdb-ui.el (gdb-fringe-width -> gdb-buffer-fringe-width):
-       Typo.
-
-2005-10-06  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac-@t-lrde.epita.fr>
-
-       * play/zone.el (zone): Wrap body with save-window-excursion.
-
-2005-10-06  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * calendar/cal-menu.el (calendar-mouse-view-diary-entries):
-       Use the new `list-only' arg to diary-list-entries.
-
-       * calendar/diary-lib.el: Use overlays rather than selective-display.
-       (diary-selective-display): New var.
-       (diary-header-line-format): Use it.
-       (diary-list-entries): Add argument `list-only'.
-       Put the buffer in diary-mode.  Don't add \^M at beg and end.
-       Replace \^M by invisible overlays.
-       (diary-unhide-everything): Replace \^M by invisible overlays.
-       (print-diary-entries): Look for overlays rather than \^M.
-       Add a space to the temp buffer name.
-       (diary-show-all-entries, mark-diary-entries, make-diary-entry):
-       Put the buffer in diary-mode.
-       (list-sexp-diary-entries): Replace \^M by invisible overlays.
-       (diary-anniversary): Make the year arg optional.
-       (diary-time-regexp): New const.
-       (diary-font-lock-keywords): Use it to accept a few more time formats.
-
-       * pcvs.el (cvs-sentinel): Make sure we do re-enable undo.
-
-2005-10-06  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * textmodes/artist.el (artist-ellipse-mirror-quadrant):
-       Fix bug introduced 2005-07-03: Use (car (last ...))
-       to faithfully reproduce replaced artist-last.
-       (artist-set-arrow-points-for-poly): Likewise.
-       Suggested by Johan Bockg\e,Ae\e(Brd.
-
-2005-10-06  Juanma Barranquero  <lekktu@gmail.com>
-
-       * dframe.el (x-pointer-hand2, x-pointer-top-left-arrow):
-       * wid-edit.el (widget):
-       * progmodes/gdb-ui.el (gdb-buffer-fringe-width):
-       * progmodes/vhdl-mode.el (speedbar-attached-frame): Add defvars.
-
-2005-10-06  Kenichi Handa  <handa@m17n.org>
-
-       * international/mule-cmds.el (set-language-environment):
-       Fix setting up of case-table for unibyte mode.
-
-       * simple.el (what-cursor-position): If the character is displayed
-       by some `display' text property, show that.  Don't use
-       single-key-description for eight-bit characters in multibyte mode.
-
-2005-10-06  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-fringe-width): New variable.
-       (gdb-ann3): Set it.
-       (gdb-put-breakpoint-icon): Don't take fringe-width from speedbar frame.
-       (gdb-info-frames-custom): Use inverse-video for first five
-       characters of selected frame only.
-       (gdb-get-frame-number): Select frame even when point is on frame
-       number.
-
-2005-10-06  Masatake YAMATO  <jet@gyve.org>
-
-       * progmodes/gdb-ui.el (gdb-info-breakpoints-custom):
-       Put `font-lock-function-name-face'.
-       (gdb-info-frames-custom): Put `font-lock-function-name-face'
-       and `font-lock-variable-name-face'
-       (gdb-registers-font-lock-keywords): New font lock keywords definition.
-       (gdb-registers-mode): Use `gdb-registers-font-lock-keywords`.
-       (gdb-memory-font-lock-keywords): New font lock keywords definition.
-       (gdb-memory-mode): Use `gdb-memory-font-lock-keywords'.
-       (gdb-local-font-lock-keywords): New font lock keywords definition.
-       (gdb-locals-mode): Use `gdb-local-font-lock-keywords'
-       (gdb-threads-font-lock-keywords): New font lock keywords definition.
-       (gdb-threads-mode): Use `gdb-threads-font-lock-keywords'.
-
-2005-10-05  Michael Kifer  <kifer@cs.stonybrook.edu>
-
-       * ediff-merge.el (ediff-merge-region-is-non-clash): New defsubst.
-       (ediff-merge-region-is-non-clash-to-skip): Previously called
-       ediff-merge-region-is-non-clash.
-
-       * ediff-mult.el (ediff-append-custom-diff, ediff-meta-show-patch):
-       Use insert-buffer-substring.
-
-       * ediff-ptch.el (ediff-fixup-patch-map): Use better heuristics for
-       selecting files to patch.  Also bug fixes.
-
-       * ediff-util.el (ediff-setup): Bug fix.
-       (ediff-next-difference): Never skip clashes that differ in white
-       space only.
-
-       * ediff-wind.el (ediff-setup-control-frame)
-       (ediff-destroy-control-frame): Check the menubar feature.
-
-       * viper-cmd.el (viper-normalize-minor-mode-map-alist)
-       (viper-refresh-mode-line): Use make-local-variable to localize
-       some vars instead of make-variable-buffer-local.  Suggested by
-       Stefan Monnier.
-
-       * viper-init.el (viper-make-variable-buffer-local): Delete alias.
-       (viper-restore-cursor-type, viper-set-insert-cursor-type):
-       Use make-local-variable instead of make-variable-buffer-local.
-       Suggested by Stefan Monnier.
-
-       * viper.el (viper-mode): Don't use viper-make-variable-buffer-local.
-       (viper-comint-mode-hook): Use make-local-variable on
-       require-final-newline.
-       (viper-non-hook-settings): Don't use make-variable-buffer-local.
-
-2005-10-05  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/scheme.el (scheme-mode-syntax-table): Mark ; as being
-       also the second char of a comment-start sequence.
-       (scheme-sexp-comment-syntax-table): New var.
-       (lambda, define): Set their scheme-doc-string-elt property.
-       (scheme-font-lock-syntactic-face-function): Handle sexp-comments.
-       Use lisp-font-lock-syntactic-face-function now that it properly
-       handles |...| symbols.
-       (scheme-mode-variables): Set lisp-doc-string-elt-property,
-       parse-sexp-lookup-properties and font-lock-extra-managed-props.
-
-       * emacs-lisp/lisp-mode.el (lisp-mode-syntax-table): Move the nesting
-       bit from # to |.
-       (lisp-font-lock-syntactic-face-function): Distinguish |...| symbols.
-
-       * emacs-lisp/lisp-mode.el (lambda): Add its doc-string-elt property.
-       (lisp-doc-string-elt-property): New var.
-       (lisp-font-lock-syntactic-face-function): Use it.
-       Rewrite to recognize docstrings even for forms not at toplevel.
-
-       * progmodes/scheme.el (scheme-mode-syntax-table): Put the nested
-       annotation on the | part of #| rather than on the # part.
-       (scheme-font-lock-syntactic-face-function): New function, to
-       distinguish strings from |...| symbols.
-       (scheme-mode-variables): Use it.  Also fix up the font-lock-time
-       syntax-table so that #|...|# is properly highlighted.
-
-       * emacs-lisp/lisp-mode.el (lisp-font-lock-syntactic-face-function):
-       Don't mark as docstring the 3rd elem of an unknown toplevel form.
-
-2005-10-04  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * bindings.el (global-map): Resync [home] and [end] bindings with C-a
-       and C-e.
-
-       * emacs-lisp/eldoc.el: Move comments into docstrings.
-       (eldoc-message-commands): Initialize in its declaration.
-       Add move-beginning-of-line and move-end-of-line.
-       (eldoc-add-command, eldoc-add-command-completions)
-       (eldoc-remove-command, eldoc-remove-command-completions): Simplify.
-
-       * outline.el (outline-mark-subtree): Activate the mark.
-
-       * calendar/appt.el (appt-time-regexp): New var.
-       (appt-add, appt-make-list): Use it.
-       (appt-convert-time): Clean up.
-
-       * textmodes/tex-mode.el (tex-font-lock-syntactic-face-function):
-       Don't set any syntax-table property here.
-       (tex-font-lock-verb): New function.  Do it here.
-       (tex-font-lock-syntactic-keywords): Use it.
-
-2005-10-04  Richard M. Stallman  <rms@gnu.org>
-
-       * wid-edit.el (widget-file-complete): Get the widget start point
-       the right way.  Default directory to `/' if file has none.
-
-       * x-dnd.el (x-dnd-drop-data): Check for dedicated windows.
-
-       * textmodes/flyspell.el (flyspell-mode-on):
-       Call ispell-maybe-find-aspell-dictionaries.
-
-       * textmodes/ispell.el (ispell-word, ispell-region):
-       Call ispell-maybe-find-aspell-dictionaries.
-       (ispell-accept-buffer-local-defs):
-       Don't call ispell-maybe-find-aspell-dictionaries.
-
-2005-10-04  Richard M. Stallman  <rms@gnu.org>
-
-       * iswitchb.el (iswitchb-buffer-ignore): Label it risky.
-
-2005-10-04  Emilio C. Lopes  <eclig@gmx.net>
-
-       * iswitchb.el (iswitchb-ignore-buffername-p): Use `functionp'
-       instead of `fboundp' in order to allow for anonymous functions.
-
-2005-10-04  Chong Yidong  <cyd@stupidchicken.com>
-
-       * info.el (Info-next, Info-prev, Info-up): Select info buffer, in
-       case the user clicks on the link while another window is selected.
-       (Info-speedbar-hierarchy-buttons): Use speedbar-current-frame.
-
-       * dframe.el (dframe-update-keymap): Use mouse-1-click-follows-link
-       functionality.
-       (dframe-help-echo): Save point in case mouse tracking is off.
-
-2005-10-04  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * net/ange-ftp.el (ange-ftp-ls): Fix typo introduced in last change.
-
-2005-10-03  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/cc-styles.el (c-setup-paragraph-variables): Make sure we do
-       not change the global value of those vars.
-
-       * progmodes/cc-mode.el (c-basic-common-init): Remove calls to
-       make-local-variable which we do not need any more.
-
-2005-10-03  Chong Yidong  <cyd@stupidchicken.com>
-
-       * speedbar.el (speedbar-ignored-path-regexp, speedbar-line-path)
-       (speedbar-ignored-path-expressions, speedbar-buffers-line-path)
-       (speedbar-add-ignored-path-regexp, speedbar-buffers-line-path)
-       (speedbar-path-line): Define obsolete aliases.
-       (speedbar-line-directory): Doc fix.
-
-       * progmodes/vhdl-mode.el (vhdl-speedbar-initialize)
-       (vhdl-speedbar-rescan-hierarchy): Call speedbar-line-directory
-       instead of speedbar-line-path.
-
-2005-10-03  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * x-dnd.el (x-dnd-drop-data): Don't set dnd-open-file-other-window
-       to nil if dropping on a window.  Handle dropping on a minibuffer window
-       like dropping on a non-window part of Emacs.
-
-2005-10-03  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * net/ange-ftp.el: Use with-current-buffer.
-       (ange-ftp-insert-directory): Do not follow symlinks any more.
-
-       * textmodes/ispell.el (ispell-find-aspell-dictionaries):
-       Remove interactive spec.
-
-2005-10-03  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-mode): Use custom-initialize-set.
-
-2005-10-02  Richard M. Stallman  <rms@gnu.org>
-
-       * progmodes/ebnf2ps.el (ebnf-eps-production-list):
-       Use insert-buffer-substring.
-
-       * net/tramp.el: Pacify byte compiler warnings in pacification code.
-       (tramp-handle-file-local-copy): Use insert-buffer-substring.
-
-2005-10-02  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * net/ange-ftp.el (ange-ftp-insert-directory): Undo unintended part
-       in last change.
-       (ange-ftp-insert-directory): Fix up the search for the case where
-       `file' is absolute.
-
-2005-10-02  Romain Francoise  <romain@orebokech.com>
-
-       * progmodes/compile.el (compile-goto-error): Delete extra paren.
-
-2005-10-02  Andreas Schwab  <schwab@suse.de>
-
-       * ediff-ptch.el (ediff-fixup-patch-map): Handle file names without
-       directory component in the session info.
-
-2005-10-01  Richard M. Stallman  <rms@gnu.org>
-
-       * comint.el (comint-redirect-subvert-readonly): Doc fix.
-
-       * simple.el (next-error-internal): New function.
-
-       * progmodes/compile.el (compilation-buffer-name): New arg MODE-COMMAND.
-       (compilation-start): Pass new arg to compilation-buffer-name.
-       (compile-goto-error): Use next-error-internal.
-
-2005-10-01  Chong Yidong  <cyd@stupidchicken.com>
-
-       * speedbar.el: Remove RCS tag.
-       (speedbar-check-read-only): Handle non-existent files.
-
-       * dframe.el, ezimage.el, sb-image.el: Remove RCS tags.
-
-       * info.el (Info-speedbar-hierarchy-buttons)
-       (Info-speedbar-goto-node): Call speedbar-select-attached-frame.
-
-2005-10-01  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
-
-       * textmodes/bibtex.el (bibtex-valid-entry-whitespace-re):
-       Do not match newline.
-       (bibtex-realign): Do not use bibtex-valid-entry-whitespace-re.
-       (bibtex-summary): Remove unnecessary save-excursion.
-       (bibtex-fill-field-bounds): Use fill-region-as-paragraph.
-
-2005-10-01  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el: Add charset info for "iso10646-1".
-       Modify default fontset to use ATSUI-compatible fonts for some charsets
-       if available.
-
-2005-10-01  Chong Yidong  <cyd@stupidchicken.com>
-
-       * speedbar.el: Re-apply arch tag.
-       (speedbar-version): Rename to version 1.0.  Suggested by Eric
-       M. Ludlam.
-       Reapply two changes from Emacs CVS' version of speedbar lost
-       during the merge:
-       (speedbar-use-imenu-flag): Avoid unnecessary use of locate-library.
-       (speedbar-frame-parameters): Improve customize type.
-
-2005-09-30  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * net/ange-ftp.el (ange-ftp-gwp-start): Use with-current-buffer.
-       (ange-ftp-file-directory-p): Fix the symlink case.
-       (ange-ftp-insert-directory): When listing a single file, get a list of
-       the parent buffer and extract the relevant line.  Inspired from a patch
-       by Katsumi Yamaoka <yamaoka@jpl.org>.
-       (ange-ftp-file-name-sans-versions): Simplify.
-
-2005-09-30  Bill Wohler  <wohler@newt.com>
-
-       Move MH-E image files from toolbar and mail directories into
-       etc/images.
-
-       * mail/reply2.*: Move to etc/images/mail/reply*.
-
-       * toolbar/execute.*, toolbar/highlight.*, toolbar/mh-logo.xpm:
-       * toolbar/page-down.*, toolbar/show.*, toolbar/widen.*: Move to
-       etc/images.
-
-       * toolbar/alias.*, toolbar/refile.*, toolbar/repack.*:
-       * toolbar/reply*: Move to etc/images/mail.
-
-       * toolbar/rescan.*: Move and rename to etc/images/refresh.*.
-
-2005-09-30  Eric M. Ludlam  <zappo@gnu.org>
-
-       * speedbar.el: New version 1.0pre3.
-
-       Frame management code (including timer, and mouse click specifics)
-       moved to dframe.el:
-       (speedbar-attached-frame): Removed.  Use dframe-attached-frame.
-       (speedbar-timer): Removed.  Use dframe-timer.
-       (speedbar-close-frame): Removed.  Use dframe-close-frame.
-       (speedbar-activity-change-focus-flag): Removed.  Use
-       dframe-activity-change-focus-flag.
-       (speedbar-update-speed, speedbar-navigating-speed): Obsolete.  Use
-       dframe-update-speed.
-
-       (speedbar-current-frame): New macro.  Use this instead of the
-       variable speedbar-frame.
-
-       (speedbar-use-images, speedbar-expand-image-button-alist)
-       (speedbar-insert-image-button-maybe): Moved to sb-image.el.
-
-       (speedbar-find-image-on-load-path): Removed.  Replaced by
-       defezimage in ezimage.el.
-       (speedbar-expand-image-button-alist): Removed.  Replaced by
-       ezimage-expand-image-button-alist in ezimage.el.
-
-       (speedbar-ignored-directory-regexp)
-       (speedbar-add-ignored-directory-regexp)
-       (speedbar-ignored-directory-expressions)
-       (speedbar-line-directory, speedbar-buffers-line-directory)
-       (speedbar-directory-line, speedbar-buffers-line-directory):
-       Renamed, replacing `path' with `directory'.
-
-       (speedbar-create-directory, speedbar-expand-line-descendants)
-       (speedbar-toggle-line-expansion)
-       (speedbar-contract-line-descendants): New commands.
-
-       (speedbar-query-confirmation-method, speedbar-select-frame-method)
-       (speedbar-use-tool-tips-flag): New options.
-
-       (speedbar-check-read-only, speedbar-require-version)
-       (speedbar-insert-separator, speedbar-buffers-tail-notes)
-       (speedbar-handle-delete-frame, speedbar-try-completion)
-       (speedbar-update-localized-contents): New functions.
-
-       (speedbar-incompatible-version, speedbar-ro-to-do-point)
-       (speedbar-object-read-only-indicator): New variables.
-
-       (speedbar-visiting-tag-hook, speedbar-before-visiting-file-hook):
-       New hooks.
-
-       (speedbar-separator-face): New face.
-
-       (speedbar-supported-extension-expressions): Add `.g' and `.ma?k'.
-       (speedbar-ignored-modes): Add fundamental-mode.
-       (speedbar-directory-unshown-regexp): Add . directories.
-
-       (speedbar-key-map): Remove old SPC and DEL page up/down keys.
-       (speedbar-file-key-map): Add SPC to toggle node expansion, `[' and
-       `]' for full expand/close.
-       (speedbar-buffers-key-map): Add SPC to toggle node expansion.
-
-       (speedbar-check-vc): Support hidden files.
-       (speedbar-vc-check-dir-p): Use vc-state if available for CVS.
-       (speedbar-this-file-in-vc): Use vc-state if available.  If VC
-       state is nil, it is not checked out.
-
-       (speedbar-line-text, speedbar-line-token): Support expand buttons
-       with no text.
-       (speedbar-refresh): Universal argument acts as power-click.
-       (speedbar-fetch-dynamic-tags): If a buffer is in Emacs, switch to
-       that buffer to get variable values.
-
-       And many other bugfixes.
-
-       * dframe.el, ezimage.el, sb-image.el: New files.
-
-       * sb-*.xpm: Remove files.  New image files installed into
-       etc/images/ezimage.
-
-2005-09-30  Kenichi Handa  <handa@m17n.org>
-
-       * ps-mule.el (ps-mule-show-warning): If a character is in
-       ps-print-translation-table, don't treat it as non-printable.
-
-2005-09-30  David Ponce  <david@dponce.com>
-
-       * tree-widget.el (tree-widget-themes-load-path): New variable.
-       (tree-widget-themes-directory): Doc fix.
-       (tree-widget-image-formats) [Emacs]: Doc fix.
-       (tree-widget--locate-sub-directory): New function.
-       (tree-widget-themes-directory): Use it.
-
-       * recentf.el (recentf-filename-handlers): Rename from
-       `recentf-filename-handler'.  Allow a list of functions.
-       (recentf-menu-items-for-commands): Fix :help strings.
-       (recentf-apply-filename-handlers): New function.
-       (recentf-expand-file-name): Use it.
-       (recentf-cleanup): Remove duplicates too.
-
-2005-09-29  Juri Linkov  <juri@jurta.org>
-
-       * faces.el: Rearrange face definitions to be in the same order as
-       their face descriptions in "(emacs)Standard Faces".
-
-       * isearch.el (isearch, lazy-highlight): Add group `basic-faces'.
-
-       * tooltip.el (tooltip): Add group `basic-faces'.
-
-       * buff-menu.el (Buffer-menu-buffer): Remove group
-       `font-lock-highlighting-faces'.
-
-       * progmodes/compile.el (compilation-error, compilation-warning)
-       (compilation-info, compilation-line-number, compilation-column-number):
-       Change group from `font-lock-highlighting-faces' to `compilation'.
-
-       * progmodes/vhdl-mode.el (vhdl-font-lock-prompt-face)
-       (vhdl-font-lock-attribute-face, vhdl-font-lock-enumvalue-face)
-       (vhdl-font-lock-function-face, vhdl-font-lock-directive-face)
-       (vhdl-font-lock-reserved-words-face)
-       (vhdl-font-lock-translate-off-face, syntax-alist): Remove group
-       `font-lock-highlighting-faces'.
-
-       * cus-edit.el (custom-buffer-sort-alphabetically): Default to nil.
-
-2005-09-28  Kim F. Storm  <storm@cua.dk>
-
-       * emulation/cua-base.el: Set CUA move property on additional commands:
-       up-list, down-list, backward-up-list, end-of-defun beginning-of-defun,
-       forward-sexp, backward-sexp, forward-list, backward-list.
-
-2005-09-28  Romain Francoise  <romain@orebokech.com>
-
-       * comint.el (comint-show-output): Really set point at the
-       beginning of the output when not using `comint-use-prompt-regexp'.
-
-2005-09-27  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-lang.el (math-oper-table): Raise the precedence of "/"
-       in TeX mode.
-
-2005-09-26  Juanma Barranquero  <lekktu@gmail.com>
-
-       * textmodes/org.el (org-table-sum): Fix format string.
-
-       * textmodes/tex-mode.el (tex-insert-quote, latex-indent):
-       Quote face names.
-
-2005-09-26  Romain Francoise  <romain@orebokech.com>
-
-       * isearch.el (isearch-forward-regexp): Close doc string.
-
-2005-09-25  Richard M. Stallman  <rms@gnu.org>
-
-       * simple.el (blink-matching-open): Don't no-op when point is BEGV+1.
-
-       * isearch.el (isearch-forward, isearch-forward-regexp): Doc fixes.
-
-       * progmodes/compile.el (compilation-error-properties):
-       When getting the file from the previous error message,
-       correctly decode the new data format.
-
-       * progmodes/cc-cmds.el (c-electric-paren):
-       Call old-blink-paren only for close-paren.
-
-2005-09-24  Andreas Schwab  <schwab@suse.de>
-
-       * term/rxvt.el (rxvt-register-default-colors): Delete redundant
-       condition.
-
-2005-09-25  Romain Francoise  <romain@orebokech.com>
-
-       * dired-aux.el (dired-copy-file-recursive):
-       * dired.el (dired-delete-file):
-       * ediff-mult.el (ediff-dir-diff-copy-file):
-       * ediff-util.el (ediff-test-save-region):
-       * forms.el (forms-mode):
-       * ido.el (ido-file-internal, ido-delete-file-at-head):
-       * log-edit.el (log-edit-done):
-       * ses.el (ses-yank-resize):
-       * play/gomoku.el (gomoku-human-plays, gomoku)
-       (gomoku-human-resigns, gomoku-prompt-for-other-game)
-       (gomoku-offer-a-draw):
-       * play/landmark.el (lm-human-resigns, lm):
-       * net/eudcb-ldap.el (eudc-ldap-check-base):
-       * play/mpuz.el (mpuz-offer-abort, mpuz-try-letter, mpuz-close-game):
-       * progmodes/ebrowse.el (ebrowse-find-pattern):
-       * progmodes/idlw-shell.el (idlwave-shell-set-bp-check):
-       * textmodes/reftex-index.el (reftex-index-initialize-phrases-buffer):
-       End `yes-or-no-p' and `y-or-n-p' prompts with question mark and space.
-
-       * vc.el (vc-delete-file):
-       * play/gomoku.el (gomoku-terminate-game, gomoku)
-       (gomoku-prompt-for-move, gomoku-human-takes-back):
-       * play/landmark.el (lm-human-takes-back, lm-prompt-for-move)
-       (lm-start-robot, lm-human-plays): Remove extraneous spaces in messages.
-
-2005-09-24  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * term/rxvt.el (rxvt-register-default-colors): Add support for 255
-       color rxvt terminals by using the code xterm.el used to use before
-       2005-04-09 in order to match the colors used by rxvt.
-
-2005-09-24  Emanuele Giaquinta  <emanuele.giaquinta@gmail.com>  (tiny change)
-
-       * term/rxvt.el (rxvt-register-default-colors): Add support for 88
-       colors rxvt-unicode terminals by using the same code as xterm.el.
-
-2005-09-24  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * textmodes/tex-mode.el (tex-font-lock-append-prop)
-       (tex-font-lock-suscript, tex-insert-quote, latex-indent): Adjust to the
-       new symbol used for the tex-verbatim face.
-
-2005-09-24  Emilio C. Lopes  <eclig@gmx.net>
-
-       * woman.el (woman-file-name):
-       * wid-edit.el (widget-file-prompt-value)
-       (widget-coding-system-prompt-value):
-       * w32-fns.el (set-w32-system-coding-system):
-       * vc.el (vc-version-diff, vc-annotate):
-       * textmodes/reftex-auc.el (reftex-arg-cite)
-       (reftex-arg-index-tag):
-       * textmodes/refer.el (refer-get-bib-files):
-       * textmodes/artist.el (artist-figlet-choose-font):
-       * terminal.el (terminal-emulator):
-       * replace.el (occur-read-primary-args):
-       * rect.el (string-rectangle, string-insert-rectangle):
-       * ps-print.el (ps-print-preprint):
-       * progmodes/pascal.el (pascal-goto-defun):
-       * progmodes/etags.el (visit-tags-table, visit-tags-table-buffer):
-       * progmodes/compile.el (compilation-find-file):
-       * printing.el (pr-interactive-n-up):
-       * play/animate.el (animate-birthday-present):
-       * net/rcompile.el (remote-compile):
-       * man.el (man, Man-goto-section, Man-follow-manual-reference):
-       * mail/rmailsum.el (rmail-summary-search-backward)
-       (rmail-summary-search):
-       * mail/rmailout.el (rmail-output-read-rmail-file-name)
-       (rmail-output-read-file-name):
-       * mail/rmail.el (rmail-search, rmail-search-backwards):
-       * mail/mailabbrev.el (merge-mail-abbrevs, rebuild-mail-abbrevs):
-       * locate.el (locate):
-       * international/quail.el (quail-show-keyboard-layout):
-       * international/mule.el (set-buffer-file-coding-system)
-       (revert-buffer-with-coding-system, set-file-name-coding-system)
-       (set-terminal-coding-system, set-keyboard-coding-system)
-       (set-next-selection-coding-system):
-       * international/mule-diag.el (describe-coding-system)
-       (describe-font, describe-fontset):
-       * international/mule-cmds.el (universal-coding-system-argument)
-       (search-unencodable-char, describe-input-method)
-       (set-language-environment, describe-language-environment):
-       * international/codepage.el (codepage-setup):
-       * international/code-pages.el (codepage-setup):
-       * info.el (Info-search, Info-follow-reference)
-       (Info-search-backward):
-       * emacs-lisp/advice.el (ad-read-advised-function)
-       (ad-read-advice-class, ad-clear-cache, ad-activate)
-       (ad-deactivate, ad-update, ad-unadvise, ad-read-advice-name)
-       (ad-enable-advice, ad-disable-advice, ad-remove-advice)
-       (ad-read-regexp):
-       * ediff-util.el (ediff-toggle-regexp-match):
-       * ediff-ptch.el (ediff-prompt-for-patch-file):
-       * dired-aux.el (dired-diff):
-       * diff.el (diff):
-       * cus-edit.el (custom-variable-prompt):
-       * calendar/timeclock.el (timeclock-ask-for-project):
-       * calc/calcalg3.el (calc-get-fit-variables):
-       * calc/calc-store.el (calc-edit-variable)
-       (calc-permanent-variable):
-       * vc-mcvs.el (vc-mcvs-register):
-       * shadowfile.el (shadow-define-literal-group):
-       * woman.el (woman-file-name):
-       * vc.el (vc-version-diff, vc-merge):
-       * textmodes/reftex-index.el (reftex-index-complete-tag):
-       * format.el (format-decode-buffer, format-decode-region):
-       * emulation/viper-cmd.el (viper-read-string-with-history):
-       * emacs-lisp/debug.el (cancel-debug-on-entry):
-       * emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
-       * ediff.el (ediff-merge-revisions)
-       (ediff-merge-revisions-with-ancestor, ediff-revision):
-       * completion.el (interactive-completion-string-reader):
-       * calc/calc-prog.el (calc-user-define-formula):
-       Follow convention for reading with the minibuffer.
-
-2005-09-24  Steven Huwig  <steven_h@acm.org>  (tiny change)
-
-       * progmodes/python.el (python-describe-symbol): Add globals() and
-       locals() to the arguments of emacs.ehelp.
-
-2005-09-24  Magnus Henoch  <mange@freemail.hu>
-
-       * textmodes/ispell.el (ispell-maybe-find-aspell-dictionaries):
-       New function, code extracted from ispell-valid-dictionary-list.
-       (ispell-valid-dictionary-list, ispell-accept-buffer-local-defs):
-       Call it.
-
-2005-09-24  Eli Zaretskii  <eliz@gnu.org>
-
-       * subr.el (version-regexp-alist): Extend valid syntax for version
-       strings: allow any of the characters -,_,+ to separate the
-       alpha/beta/rc part from the version part.  Doc fix.
-       (version-to-list): Doc fix.  Bind case-fold-search to t, as advertised.
-
-2005-09-23  David Reitter  <david.reitter@gmail.com>
-
-       * mail/mailclient.el: New file.
-
-2005-09-23  Richard M. Stallman  <rms@gnu.org>
-
-       * textmodes/flyspell.el (flyspell-highlight-incorrect-region)
-       (flyspell-incorrect-hook, flyspell-highlight-duplicate-region):
-       Doc fixes.
-
-       * progmodes/cc-mode.el (c-font-lock-init):
-       Specify font-lock-lines-before.
-
-2005-09-23  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * smerge-mode.el (smerge-remove-props): Cause re-highlighting of the
-       whole conflict.
-
-2005-09-23  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-mode-map, orgtbl-mode-map):
-       Move keybindings with `C-c C-h' prefix to `C-c C-x' prefix.  Make use
-       of `remap' feature when available.  Additional key bindings for
-       better tty support.
-       (org-mode-restart, org-force-self-insert): New commands.
-       (org-time-stamp-inactive): New command.
-       (org-remap): New function.
-       (org-table-auto-blank-field, org-level-color-stars-only): New options.
-       (org-enable-fixed-width-editor): Move to `org-structure'
-       customization group.
-       (org-self-insert-command, orgtbl-self-insert-command): Modify to
-       blank field after field motion commands.
-
-2005-09-23  Kenichi Handa  <handa@m17n.org>
-
-       * international/mule-cmds.el (set-language-environment):
-       Don't check utf-translate-cjk-lang-env is nil or not on deciding if we
-       have to call utf-translate-cjk-load-tables.
-
-2005-09-22  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * mouse.el (mouse-move-drag-overlay): Fix last change.
-
-2005-09-22  David Ponce  <david@dponce.com>
-
-       * tree-widget.el (tree-widget-value-create): Fix previous change.
-
-2005-09-21  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * term/xterm.el (terminal-init-xterm): Fix loading rxvt at run time.
-
-2005-09-21  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * mouse.el (mouse-move-drag-overlay): New function.
-       (mouse-drag-region-1): Use it.
-       Try to simplify a bit the state handling.  Handle clicks on links
-       inside intangible areas.
-       (mouse-save-then-kill): Minor simplification.
-       (mouse-secondary-overlay): Make it always non-nil instead of
-       recreating it each time.
-       (mouse-start-secondary, mouse-set-secondary, mouse-drag-secondary)
-       (mouse-kill-secondary, mouse-secondary-save-then-kill):
-       Simplify accordingly.
-
-2005-09-21  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * term/rxvt.el (rxvt-standard-colors): Fix some colors.
-
-2005-09-20  Michael Kifer  <kifer@cs.stonybrook.edu>
-
-       * ediff-ptch.el (ediff-prompt-for-patch-file): More intuitive prompt.
-       (ediff-file-name-sans-prefix): Treat nil as an empty string.
-       (ediff-fixup-patch-map): Better heuristic for intuiting the file names
-       to patch.
-
-       * ediff-util.el: Use insert-buffer-substring.
-
-       * ediff-vers.el (cvs-run-ediff-on-file-descriptor): Bug fix.
-
-       * emulation/viper-cmd.el (viper-change-state): Don't move over the
-       field boundaries in the minibuffer.
-       (viper-set-minibuffer-style): Add viper-minibuffer-post-command-hook.
-       (viper-minibuffer-post-command-hook): New hook.
-       (viper-line): Don't move cursor at bolp.
-
-       * emulation/viper-ex.el (ex-pwd, viper-info-on-file): Fix message.
-
-       * emulation/viper-init.el: Add alias to make-variable-buffer-local to
-       avoid compiler warnings.
-
-       * emulation/viper-macs.el (ex-map): Better messages.
-
-       * emulation/viper-utils.el (viper-beginning-of-field): New function.
-
-       * emulation/viper.el: Replace make-variable-buffer-local with
-       viper-make-variable-buffer-local everywhere, to avoid warnings.
-
-2005-09-19  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * mouse.el (mouse-drag-mode-line-1, mouse-drag-vertical-line):
-       Delete unused var `old-selected-window'.
-       (mouse-drag-region-1): Delete unused vars `start-frame', `end-of-range'.
-       (mouse-drag-secondary): Delete unused var `start-frame'.
-
-2005-09-19  Emanuele Giaquinta  <emanuele.giaquinta@gmail.com>  (tiny change)
-
-       * term/rxvt.el (terminal-init-rxvt): Add entry for [end].
-
-2005-09-19  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * calendar/calendar.el (mark-visible-calendar-date): Save excursion.
-       Re-indent within 80 columns.  Use inhibit-read-only.
-
-2005-09-19  Romain Francoise  <romain@orebokech.com>
-
-       * calendar/diary-lib.el (mark-diary-entries): Revert last change.
-
-2005-09-19  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * font-lock.el (font-lock-default-fontify-region): Don't add a line
-       unconditionally, since the after-change-function already did it.
-
-2005-09-19  Miles Bader  <miles@gnu.org>
-
-       * net/newsticker.el: Get rid of CVS keyword.
-
-2005-09-19  Johan Bockg\e,Ae\e(Brd  <bojohan@dd.chalmers.se>
-
-       * dired-aux.el (dired-handle-overwrite): Don't use `format' here.
-       The prompt is formatted later.
-
-2005-09-19  David Ponce  <david@dponce.com>
-
-       * tree-widget.el (tree-widget-value-create): Save the converted
-       tree :node widget.
-
-2005-09-19  Juanma Barranquero  <lekktu@gmail.com>
-
-       * progmodes/sh-script.el (sh-blink): Fix spurious reference to
-       variable `message'.
-
-2005-09-18  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/tramp.el (tramp-login-prompt-regexp): Expand regexp in order
-       to cover prompts like "login as:".  Reported by Slawomir Nowaczyk
-       <slawomir.nowaczyk.847@student.lu.se>.
-
-2005-09-18  Chong Yidong  <cyd@stupidchicken.com>
-
-       * image.el (image-load-path): Use symbol `data-directory' instead
-       of its value, for backward compatibility with packages that bind
-       it during `find-image'.  Suggested by Katsumi Yamaoka.
-       (image-search-load-path): Handle symbols whose values are strings.
-
-2005-09-18  Romain Francoise  <romain@orebokech.com>
-
-       * calendar/diary-lib.el (mark-diary-entries): Rearrange to wrap
-       with-current-buffer form in save-excursion.
-
-2005-09-18  Deepak Goel  <deego@gnufans.org>
-
-       * apropos.el (apropos-command): Fix `message' call: first arg
-       should be a format spec.  In this and all other cases that appear
-       below and elsewhere in the source code, I made a change only when
-       two conditions were satisfied: [1] I can think of a possibility
-       that the arguments would cause an error, for example, the code in
-       question relies on external variables such as filenames.  [2] I
-       was sure that the arg to `message' could not have been nil in the code.
-
-       * textmodes/tildify.el (tildify-region): Ditto.
-
-       * textmodes/reftex-index.el (reftex-index-change-entry)
-       (reftex-index-phrase-selection-or-word, reftex-query-index-phrase):
-       * textmodes/reftex-dcr.el (reftex-echo-ref, reftex-echo-cite):
-       * textmodes/org.el (org-complete, org-deadline, org-schedule)
-       (org-priority, org-table-sum):
-       * textmodes/ispell.el (ispell-check-version, ispell-parse-output):
-       * textmodes/flyspell.el (flyspell-mode-on, flyspell-notify-misspell)
-       (flyspell-word, flyspell-display-next-corrections):
-       * textmodes/bibtex.el (bibtex-print-help-message):
-       * textmodes/artist.el (artist-key-set-point-poly):
-       * term/mac-win.el (mac-services-insert-text):
-       * progmodes/vhdl-mode.el (vhdl-warning, vhdl-print-warnings)
-       (vhdl-hooked-abbrev, vhdl-template-insert-fun)
-       (vhdl-port-paste-testbench, vhdl-compose-new-component)
-       (vhdl-compose-configuration):
-       * progmodes/sh-script.el (sh-blink, sh-show-indent)
-       (sh-set-indent, sh-learn-line-indent):
-       * progmodes/ps-mode.el (ps-mode-target-column):
-       * progmodes/idlwave.el (idlwave-make-tags)
-       (idlwave-scan-library-catalogs):
-       * progmodes/idlw-shell.el (idlwave-shell-parse-stack-and-display):
-       * progmodes/gud.el (gud-jdb-analyze-source):
-       * progmodes/flymake.el (flymake-log):
-       * progmodes/ebnf2ps.el (ebnf-generate-region):
-       * progmodes/cmacexp.el (c-macro-expansion):
-       * progmodes/ada-xref.el (ada-treat-cmd-string):
-       * progmodes/ada-mode.el (ada-create-case-exception-substring)
-       (ada-justified-indent-current, ada-batch-reformat):
-       * play/zone.el (zone):
-       * play/landmark.el (lm-move):
-       * play/decipher.el (decipher-show-alphabet):
-       * net/newsticker.el (newsticker--display-jump)
-       (newsticker--display-scroll):
-       * mail/rmail-spam-filter.el (rsf-add-subject-to-spam-list)
-       (rsf-add-sender-to-spam-list, rsf-add-region-to-spam-list):
-       * mail/feedmail.el (feedmail-dump-message-to-queue):
-       * eshell/esh-proc.el (eshell-remove-process-entry):
-       * emulation/ws-mode.el (ws-last-error):
-       * emulation/viper-macs.el (ex-map-read-args, ex-unmap-read-args)
-       (viper-record-kbd-macro):
-       * emulation/viper-ex.el (ex-pwd, viper-info-on-file):
-       * emacs-lisp/lisp-mnt.el (lm-report-bug):
-       * emacs-lisp/find-func.el (find-function-noselect):
-       * calendar/timeclock.el (timeclock-status-string)
-       (timeclock-workday-remaining-string, timeclock-workday-elapsed-string)
-       (timeclock-when-to-leave-string):
-       * calendar/icalendar.el (icalendar--convert-ical-to-diary):
-       * calc/calc-units.el (calc-enter-units-table):
-       * calc/calc-mode.el (calc-mode-record-mode):
-       * woman.el (woman-mini-help):
-       * wdired.el (wdired-change-to-wdired-mode):
-       * vc.el (vc-retrieve-snapshot):
-       * strokes.el (strokes-read-stroke, strokes-read-complex-stroke):
-       * startup.el (display-startup-echo-area-message):
-       * simple.el (set-goal-column):
-       * ses.el (ses-command-hook, ses-recalculate-cell):
-       * server.el (server-process-filter):
-       * printing.el (pr-interface-txt-print, pr-interface-printify)
-       (pr-interface-ps):
-       * pcvs.el (cvs-help):
-       * log-edit.el (log-edit, log-edit-mode-help):
-       * iswitchb.el (iswitchb-possible-new-buffer):
-       * isearch.el (isearch-edit-string):
-       * image-mode.el (image-mode, image-minor-mode):
-       * ibuf-macs.el (define-ibuffer-filter):
-       * hi-lock.el (hi-lock-find-patterns):
-       * files.el (toggle-read-only):
-       * ediff-util.el (ediff-copy-diff)
-       (ediff-write-merge-buffer-and-maybe-kill):
-       * echistory.el (Electric-history-undefined):
-       * dnd.el (dnd-insert-text):
-       * dired-aux.el (dired-query):
-       * desktop.el (desktop-restore-file-buffer, desktop-lazy-create-buffer):
-       * bookmark.el (bookmark-bmenu-locate):
-       * obsolete/fast-lock.el (@top-level) <with-temp-message macro>:
-       Fix `message' calls to ensure first arg is a format string.
-       The change was made only when these two conditions were satisfied:
-       [1] when there is a possibility that the arguments would cause an error
-       for example, if the code in question relies on external variables
-       such as filenames, and
-       [2] if the arg to `message' could not have been nil in the code.
-
-       * pcomplete.el (pcomplete--help): Fix `message' format spec.
-       Not having a %s would be weird, though not technically wrong.
-
-2005-09-18  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el (mac-add-charset-info): Doc fix.
-
-2005-09-17  Romain Francoise  <romain@orebokech.com>
-
-       * shell.el (shell-resync-dirs): Handle echoing processes more
-       reliably.  Don't insert resync command if `comint-process-echoes'
-       is non-nil.
-
-2005-09-17  Magnus Henoch  <mange@freemail.hu>
-
-       * textmodes/ispell.el (ispell-aspell-supports-utf8): New variable.
-       (ispell-check-version): Set ispell-aspell-supports-utf8 to t for
-       aspell versions >= 0.60.
-       (ispell-valid-dictionary-list): Call ispell-find-aspell-dictionaries
-       only if ispell-aspell-supports-utf8 is non-nil.
-
-2005-09-17  Johan Bockg\e,Ae\e(Brd  <bojohan@dd.chalmers.se>
-
-       * progmodes/scheme.el (scheme-mode-variables): Use setq to assign
-       buffer-local value to lisp-indent-function.
-
-2005-09-17  Milan Zamazal  <pdm@zamazal.org>
-
-       * progmodes/glasses.el (glasses-make-readable): If
-       glasses-separator differs from underscore, put appropriate
-       overlays over underscore characters.
-       (glasses-convert-to-unreadable): If glasses-separator differs from
-       underscore, try to convert glasses-separator characters to
-       underscores.
-
-2005-09-16  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * calendar/diary-lib.el (mark-diary-entries): Don't move point.
-       Use with-syntax-table and dolist.
-
-2005-09-16  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/reftex-auc.el:
-       * textmodes/reftex-cite.el:
-       * textmodes/reftex-dcr.el:
-       * textmodes/reftex-global.el:
-       * textmodes/reftex-parse.el:
-       * textmodes/reftex-ref.el:
-       * textmodes/reftex-sel.el:
-       * textmodes/reftex-toc.el:
-       * textmodes/reftex-vars.el:
-       * textmodes/reftex.el: Small changes to remove compiler warnings.
-
-       * textmodes/reftex-index.el: Likewise.
-       (reftex-query-index-phrase): More efficient use of markers.
-
-2005-09-15  Chong Yidong  <cyd@stupidchicken.com>
-
-       * image.el (image-load-path): New variable.
-       (image-search-load-path): New function.
-       (find-image): Search for images in `image-load-path'.
-
-2005-09-15  Richard M. Stallman  <rms@gnu.org>
-
-       * follow.el: Change Maintainer field.
-
-2005-09-15  David Ponce  <david@dponce.com>
-
-       * recentf.el (recentf-save-file-modes): New option.
-       (recentf-save-list): Use it.
-
-2005-09-15  Nick Roberts  <nickrob@snap.net.nz>
-
-       * bindings.el (mode-line-eol-desc, mode-line-coding-system-map)
-       (mode-line-mule-info, mode-line-modified): Move bindings from
-       mouse-3 to mouse-1.
-
-2005-09-15  Chong Yidong  <cyd@stupidchicken.com>
-
-       * simple.el (sendmail-user-agent-compose): Revert last change.
-
-2005-09-14  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * net/ange-ftp.el (ange-ftp-process-filter): Revert to ^#+$.
-       Use with-current-buffer.
-       (ange-ftp-gwp-start): Remove unused var `gw-user'.
-       (ange-ftp-guess-hash-mark-size): Remove unused var `result'.
-       (ange-ftp-insert-directory): Remove unused var `short'.
-       (ange-ftp-file-name-sans-versions): Remove unused var `host-type'.
-
-       * pcvs-defs.el (cvs-version): Recognize CVSNT version string.
-       (cvs-execute-single-dir): Change default: cvs-1.9 is ancient.
-
-       * calendar/cal-menu.el: Don't require easymenu, since we don't use it.
-       (check-calendar-holidays, diary-list-entries): Autoload.
-       Otherwise `emacs -q' followed by "mouse-2 -> diary entries" burps.
-       (calendar-mouse-holidays, calendar-mouse-view-diary-entries): Simplify.
-
-       * calendar/diary-lib.el (diary-show-all-entries): Fix last change,
-       which mistakenly removed a call to display-buffer.
-
-2005-09-14  Juanma Barranquero  <lekktu@gmail.com>
-
-       * obsolete/iso-insert.el: Move to obsolete/ from international/.
-
-2005-09-14  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * progmodes/hideshow.el
-       (hs-hide-comments-when-hiding-all): Remove autoload cookie.
-       (hs-allow-nesting): New user var.
-       (hs-discard-overlays): Skip "internal" overlays if nesting allowed.
-       (hs-hide-block-at-point): When nesting allowed,
-       if there is already an overlay in place, delete it.
-       (hs-safety-is-job-n): Delete func; remove call sites.
-       (hs-hide-level-recursive): Don't pre-clean if nesting allowed.
-       (hs-overlay-at): New func.
-       (hs-already-hidden-p, hs-show-block): Use it.
-       (hs-hide-all): Don't pre-clean if nesting allowed.
-       (hs-show-all): Temporarily disallow
-       nesting around call to `hs-discard-overlays'.
-
-2005-09-14  Chong Yidong  <cyd@stupidchicken.com>
-
-       * mouse.el (mouse-major-mode-menu): Make `prefix' optional.
-       Delete unused local var.
-
-2005-09-13  Juanma Barranquero  <lekktu@gmail.com>
-
-       * help-fns.el (describe-categories): "?\ " -> "?\s".
-       (help-do-arg-highlight): Recognize also ARG-n, as in
-       `move-to-left-margin' (ARG+n is already recognized).  Simplify.
-
-       * international/codepage.el (dos-unsupported-char-glyph):
-       * net/newsticker.el (tool-bar-map, w3-mode-map)
-       (w3m-minor-mode-map):
-       * progmodes/vhdl-mode.el (conf-alist, conf-entry, conf-key)
-       (ent-alist):
-       * textmodes/reftex-vars.el (reftex-tables-dirty): Add defvars.
-
-2005-09-13  Chong Yidong  <cyd@stupidchicken.com>
-
-       * custom.el (custom-push-theme): Handle the case where a symbol is
-       bound but face properties have not yet been assigned.
-
-       * mail/sendmail.el (mail): Use new buffer if `noerase' is `new'.
-       Fix behavior if noerase is `t' and there is no mail buffer.
-
-       * simple.el (sendmail-user-agent-compose): Use a new mail buffer
-       if `continue' is nil, rather than signal an error.
-
-2005-09-12  Richard M. Stallman  <rms@gnu.org>
-
-       * font-lock.el (font-lock-keywords): Add autoload.
-
-       * help-fns.el (describe-variable): Rearrange to put source link
-       in a predictable place.
-
-       * net/newsticker.el: New file.
-
-2005-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * calendar/calendar.el (calendar-for-loop): Add edebug info.
-       (calendar-basic-setup): Use the new nil arg.
-       (number-of-diary-entries): Move to diary-lib.el.
-
-       * calendar/diary-lib.el: Use with-current-buffer, match-string.
-       (diary-list-entries): Use with-syntax-table and dolist.
-       Rename from list-diary-entries.
-       Use number-of-diary-entries if `number' is nil.
-       (diary, diary-view-entries): Use this new name and new nil arg value.
-       (number-of-diary-entries): Move from calendar.el.
-       (diary-unhide-everything): New function.
-       (include-other-diary-files, fancy-diary-display)
-       (diary-show-all-entries, make-diary-entry): Use it.
-       (diary-mail-entries): Use buffer-string.
-       (mark-diary-entries): Fix long standing paren typo.
-       (diary-sexp-entry): Use count-lines.
-       (make-diary-entry): Avoid `previous-line'.
-       (diary-mode-map): New var.
-       (diary-mode): Redraw cal after saving.  Setup header-line.
-       (fancy-diary-display-mode): Use local-set-key.
-
-       * startup.el (command-line): Try calling various terminal-init-foo-bar
-       functions by stripping hyphenated suffixes from $TERM.
-
-       * files.el (normal-mode): Check boundness of font-lock-keywords.
-
-2005-09-12  Richard M. Stallman  <rms@gnu.org>
-
-       * progmodes/compile.el: Don't decide a file's directory
-       until the user actually tries to go there.
-       (compilation-next-error-function):
-       Pass compilation-find-file the directory from the file-struct.
-       (compilation-internal-error-properties): Separate local FILE-STRUCT
-       from FILE.  Doc the args better.  Rename arg FMT to FMTS.
-       (compilation-find-file): Arg DIR renamed to DIRECTORY.
-       Expand it, and if nil, use default-directory.
-       (compilation-get-file-structure): Don't mix specified directory
-       with default directory.  Put specified directory into
-       file-struct.  Don't make the file name absolute.
-
-       * progmodes/compile.el (compilation-error-regexp-alist): Doc fix.
-       (compile-command): Add autoload.
-       (compilation-disable-input): Add autoload.
-
-2005-09-11  Stephen Gildea  <gildea@stop.mail-abuse.org>
-
-       * time-stamp.el: Mention variable `time-stamp-pattern' in doc
-       strings of the variables it can override.
-       (time-stamp): New (as yet undocumented) time-stamp-format escapes
-       %Q and %q, for fully-qualified domain name and unqualified host name.
-
-2005-09-11  Kim F. Storm  <storm@cua.dk>
-
-       * emacs-lisp/authors.el (authors-aliases): Update list.
-       (authors-fixed-entries): Update mldrag.el entry.
-
-2005-09-10  Alan Mackenzie  <acm@muc.de>
-
-       * page.el (narrow-to-page): Exclude _entire_ multi-line delimiter
-       from the region narrowed to.
-
-2005-09-10  Magnus Henoch  <mange@freemail.hu>
-
-       * textmodes/ispell.el (ispell-check-version): Signal an error if
-       aspell version is less than 0.60.
-
-2005-09-10  Pascal Dupuis  <Pascal.Dupuis@esat.kuleuven.be>  (tiny change)
-
-       * progmodes/octave-inf.el (inferior-octave-startup):
-       Resync current dir at the end.
-
-2005-09-10  Emilio C. Lopes  <eclig@gmx.net>
-
-       * woman.el (woman-topic-at-point-default):
-       Rename to woman-use-topic-at-point-default.
-       (woman-topic-at-point): Rename to woman-use-topic-at-point.
-       (woman-file-name): Reflect renames above.  Automatically use the
-       word at point as topic if woman-use-topic-at-point is non-nil.
-       Otherwise offer it as default but don't insert it in the
-       minibuffer.  Also use `test-completion' instead of `assoc' as
-       suggested by Stefan Monnier.
-
-2005-09-10  Andre Spiegel  <spiegel@gnu.org>
-
-       * vc.el (vc-directory, vc-update-change-log): Throw an error on
-       the attempt to do it over Tramp.  This is not yet supported.
-
-2005-09-10  Eli Zaretskii  <eliz@gnu.org>
-
-       * menu-bar.el (menu-bar-menu-frame-live-and-visible-p)
-       (menu-bar-non-minibuffer-window-p): New functions.
-       ("Split Window", "Save As..."): Use them.
-       ("Postscript Print Buffer (B+W)", "Postscript Print Buffer")
-       ("Print Buffer", "Truncate Long Lines in this Buffer"):
-       Use menu-bar-menu-frame-live-and-visible-p.
-       ("Save Buffer", "Insert File", "Open Directory...")
-       ("Open File...", "Visit New File..."):
-       Use menu-bar-non-minibuffer-window-p.
-       (kill-this-buffer-enabled-p, dired <menu-enable>):
-       Use menu-bar-non-minibuffer-window-p.
-
-2005-09-09  Eli Zaretskii  <eliz@gnu.org>
-
-       * cus-start.el (all): Don't complain about fringe-related
-       built-ins if fringes are not supported.  Ditto about
-       selection-related built-ins.  Fix the test for GTK-related built-ins.
-
-       * menu-bar.el ("Split Window", "Postscript Print Buffer (B+W)")
-       ("Postscript Print Buffer", "Print Region", "Save As...")
-       ("Save", "Insert File...", "Open Directory...")
-       ("Open File...", "Visit New File..."")
-       ("Truncate Long Lines in this Buffer"): Don't look at
-       menu-updating-frame if this display does not support multiple frames.
-
-2005-09-09  Frederik Fouvry  <fouvry@CoLi.Uni-SB.DE>
-
-       * mail/sendmail.el (default-sendmail-coding-system): Doc fix.
-
-2005-09-09  Emilio C. Lopes  <eclig@gmx.net>
-
-       * woman.el: Format- and whitespace-related changes.
-
-2005-09-09  Eli Zaretskii  <eliz@gnu.org>
-
-       * woman.el: Fix my email address.
-
-2005-09-08  Richard M. Stallman  <rms@gnu.org>
-
-       * progmodes/sh-script.el (sh-skeleton-pair-default-alist): New var.
-       (sh-mode): Locally set skeleton-pair-default-alist.
-
-       * progmodes/make-mode.el (makefile-add-log-defun): Trim the result.
-
-       * progmodes/flymake.el: Require `compile' unconditionally.
-
-       * mail/sendmail.el (send-mail-function): Add Mailclient alternative.
-
-       * woman.el (woman-file-name): Provide a default, not initial input.
-
-       * smerge-mode.el (smerge-resolve): Pass args to smerge-remove-props.
-
-       * font-lock.el (font-lock-support-mode): Doc fix.
-
-       * descr-text.el (describe-property-list): Handle non-symbol prop names.
-
-2005-09-08  Richard M. Stallman  <rms@gnu.org>
-
-       * simple.el (blink-matching-open): Get rid of text props from
-       the string shown in echo area.  Don't permanently set point.
-       Some rearrangements.
-
-2005-09-08  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * recentf.el (recentf-filename-handler): Add custom choice
-       `abbreviate-file-name'.
-
-       * msb.el (msb--very-many-menus): Fix typo.
-
-       * disp-table.el (standard-display-european): Don't set
-       enable-multibyte-characters to nil.
-
-2005-09-08  David Ponce  <david@dponce.com>
-
-       * recentf.el (recentf-show-file-shortcuts-flag): New option.
-       (recentf-expand-file-name): Doc fix.
-       (recentf-dialog-mode-map): Define digit shortcuts.
-       (recentf--files-with-key): New variable.
-       (recentf-show-digit-shortcut-filter): New function.
-       (recentf-open-files-items): New function.
-       (recentf-open-files): Use it.
-       (recentf-open-file-with-key): New command.
-
-2005-09-08  Chong Yidong  <cyd@stupidchicken.com>
-
-       * buff-menu.el (Buffer-menu-sort-by-column): New function.
-       Suggested by Kim F. Storm.
-       (Buffer-menu-sort-button-map): Global keymap for sort buttons.
-       (Buffer-menu-make-sort-button): Use global keymap.
-
-2005-09-07  Michael Albinus  <michael.albinus@gmx.de>
-
-       * woman.el (top): Remap `man' command by `woman' in `woman-mode-map'.
-       (Man-getpage-in-background-advice): Remove defadvice; it isn't
-       necessary any longer with the remapped command.
-       (Man-bgproc-sentinel-advice): Remove defadvice which counts
-       formatting time only.
-
-       * net/tramp.el (tramp-action-password)
-       (tramp-multi-action-password): Compile the password prompt from
-       `method', `user' and `host'.  Sometimes it isn't obvious which
-       password to enter, for example with remote files offered by
-       recentf.el, or with multiple steps.  Suggested by Robert Marshall
-       <robert@chezmarshall.freeserve.co.uk>.
-
-2005-09-07  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/perl-mode.el (perl-font-lock-syntactic-keywords):
-       Fix regexp for when "s///" is at the beginning of line.
-
-2005-09-07  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-poly.el (math-expand-term): Multiply out any powers
-       when in matrix mode.
-
-2005-09-06  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * buff-menu.el (Buffer-menu-make-sort-button): Add docstrings, use
-       non-anonymous functions.
-
-2005-09-06  Chong Yidong  <cyd@stupidchicken.com>
-
-       * buff-menu.el (Buffer-menu-make-sort-button): Allow mouse-1 clicks
-       when using a header line.  Otherwise, use mouse-1-click-follows-link.
-
-       * mouse.el (mouse-drag-header-line): Do nothing if the header-line
-       can't be moved; don't signal an error.
-
-2005-09-05  Chong Yidong  <cyd@stupidchicken.com>
-
-       * cus-theme.el (custom-theme-write-faces): Save the current face
-       spec, not the defface spec.
-
-       * custom.el (custom-known-themes): Clarify meaning of "standard".
-       (custom-push-theme): Save old values in the standard theme.
-       (disable-theme): Correct typo.
-       (custom-face-theme-value): Deleted unused function.
-       (custom-theme-recalc-face): Rewritten to treat enable/disable properly.
-
-2005-09-05  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/compile.el (compilation-goto-locus): Take into account
-       iconified frames when determining whether the buffer is
-       already visible.
-       Don't reset window height if the window already existed.
-
-2005-09-04  Chong Yidong  <cyd@stupidchicken.com>
-
-       * custom.el (load-theme): Rename from require-theme.
-       Add interactive spec.
-       (enable-theme): Rename from custom-enable-theme.
-       Add interactive spec.
-       (disable-theme): Rename from custom-disable-theme.
-       Add interactive spec.
-       (custom-make-theme-feature): Doc fix.
-       (custom-theme-directory): Doc fix.
-       (provide-theme): Call enable-theme.
-
-2005-09-02  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * obsolete/lazy-lock.el (lazy-lock-mode):
-       * obsolete/fast-lock.el (fast-lock-mode): Don't try to turn on
-       font-lock-mode if it's off.  Print a warning instead.
-
-       * progmodes/compile.el (compilation-start): Ignore errors if the
-       process died before we get to send-eof.
-
-       * textmodes/tex-mode.el (tex-send-tex-command, tex-bibtex-file):
-       Undo last change.  Enclosing the result in quotes broke things on Unix
-       since tex-send-command passes it through shell-quote-argument.
-       (tex-send-command): Pass `file' through convert-standard-filename
-       when possible.
-       (tex-uptodate-p): Handle the case where TeX hasn't put additional
-       info in a transcript.
-
-2005-09-02  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * term/xterm.el (terminal-init-xterm): Add eval-when-compile to
-       fix compilation warning.  Reorder the key definitions to group
-       together keys emitted by the current version of xterm.
-
-       * progmodes/vhdl-mode.el (vhdl-highlight-faces)
-       (vhdl-speedbar-entity-face, vhdl-speedbar-entity-selected-face):
-       Reorder predicates to correct min-color usage.
-
-2005-09-01  Chong Yidong  <cyd@stupidchicken.com>
-
-       * longlines.el (longlines-mode): Inhibit read-only when encoding.
-       Kill local variables when longlines-mode is turned off.
-
-2005-09-01  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * international/mule-cmds.el (set-locale-environment): Soothe compiler.
-
-       * obsolete/lazy-lock.el (lazy-lock) <defgroup>: Move from font-lock.el.
-
-       * obsolete/fast-lock.el (fast-lock) <defgroup>: Move from font-lock.el.
-
-       * font-lock.el (fast-lock, lazy-lock) <defgroup>: Remove.
-       (font-lock-lines-before): Change default to being inactive.
-       (font-lock-default-fontify-region): Obey font-lock-lines-before.
-       (font-lock-after-change-function): Don't handle f-l-lines-before here.
-
-2005-08-31  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/tramp.el (tramp-handle-make-auto-save-file-name):
-       Deactivate temporarily advice if active (not needed for Emacs 22,
-       but for backwards compatibility).
-       (tramp-exists-file-name-handler): Rewrite.  First implementation
-       was too simple.
-       (tramp-advice-make-auto-save-file-name):
-       Call `tramp-handle-make-auto-save-file-name' (again, just for
-       backwards compatibility).
-
-2005-08-31  Reto Zimmermann  <reto@gnu.org>
-
-       * progmodes/vhdl-mode.el
-       (vhdl-update-sensitivity-list): Handle multi-dimensional array access.
-       (vhdl-end-p): Fix indentation bug "else" after "-- when".
-       (vhdl-set-default-project): New function (easier setting of default).
-       (vhdl-port-copy): Handle extended identifiers for generics.
-       (vhdl-compiler-alist): Better description for error message regexp.
-       (vhdl-make): Query for target, use previous as default.
-       (vhdl-port-copy): Fix port copy for port names starting with "signal".
-       (vhdl-font-lock-keywords-2): Fix fontification for record
-       el. assign.
-       (vhdl-speedbar-make-subpack-line): Add package body link.
-       (vhdl-generate-makefile-1): Not include itself as dependency.
-       (vhdl-font-lock-init): Highlight c-preprocessor directives.
-       (vhdl-*ward-syntactic-ws): Skip c-preprocessor directives.
-       (vhdl-get-syntactic-context): Handle c-preprocessor directives.
-       (vhdl-update-sensitivity-list): Start scan at opening parenthesis.
-       (vhdl-fixup-whitespace-region): Fix jumping point (infinite loop).
-       (vhdl-update-sensitivity-list-buffer): Add string argument for `error'.
-       (vhdl-import-project): Add string argument for `error'.
-       (vhdl-compose-configuration)
-       (vhdl-compose-configuration-architecture): Add configuration
-       declaration generation.
-       (vhdl-scan-directory-contents): Scan for block/generate hierarchy.
-       (vhdl-trailer-re): Add "record" keyword (better indentation).
-       (vhdl-fixup-whitespace-region): "[^ \t\"-]+" instead of
-       "[^ \t-\"]+".
-       (vhdl-font-lock-keywords-2): Not highlight formal parameter after `|'.
-       (vhdl-testbench-entity-file-name)
-       (vhdl-testbench-architecture-file-name): Allow separate
-       customization of testbench file names.
-       (vhdl-beginning-of-block): Handle optional subprogram parameter list.
-       (vhdl-get-visible-signals): Allow newline within alias declaration.
-       (vhdl-update-sensitivity-list): Signal read only on certain attributes.
-       (vhdl-fixup-whitespace-region): Fix bug with strings (double quotes).
-       (member-ignore-case): Alias for missing function in XEmacs.
-       (vhdl-compiler-alist): Add unit-to-file name mapping for Cadence NC.
-       (vhdl-update-sensitivity-list): Ignore case on read signals.
-       (vhdl-replace-string): Adjust case only for file names.
-       (vhdl-update-sensitivity-list): Fix search for read signals.
-       (vhdl-update-sensitivity-list): Exclude formal parameters.
-       (vhdl-get-visible-signals): Include aliases of signals.
-       (vhdl-get-visible-signals): Fix signal name searching.
-       (vhdl-port-flatten, vhdl-port-reverse-direction): Better message.
-       (vhdl-fixup-whitespace-region): Fix for character
-       literals (e.g. `:').
-
-2005-08-31  Juanma Barranquero  <lekktu@gmail.com>
-
-       * ansi-color.el (comint-last-output-start):
-       * bs.el (font-lock-verbose):
-       * diff-mode.el (add-log-buffer-file-name-function):
-       * dired-x.el (vm-folder-directory):
-       * faces.el (help-xref-stack-item):
-       * files.el (font-lock-keywords):
-       * find-lisp.el (dired-buffers, dired-subdir-alist):
-       * ido.el (cua-inhibit-cua-keys):
-       * log-view.el (cvs-minor-wrap-function):
-       * outline.el (font-lock-warning-face):
-       * simple.el (compilation-current-error):
-       * speedbar.el (ange-ftp-path-format, efs-path-regexp)
-       (font-lock-keywords, x-pointer-hand2, x-pointer-top-left-arrow):
-       * tooltip.el (comint-prompt-regexp):
-       * w32-fns.el (explicit-shell-file-name):
-       * term/mac-win.el (mac-charset-info-alist)
-       (mac-services-selection, mac-system-script-code):
-       * term/tty-colors.el (msdos-color-values):
-       * term/w32-win.el (xlfd-regexp-registry-subnum):
-       * term/x-win.el (x-keysym-table, x-selection-timeout)
-       (x-session-id, x-session-previous-id):
-       * textmodes/ispell.el (mail-yank-prefix):
-       * textmodes/makeinfo.el (tex-end-of-header, tex-start-of-header):
-       * textmodes/org.el (calc-embedded-close-formula)
-       (calc-embedded-open-formula)
-       (font-lock-unfontify-region-function):
-       * textmodes/reftex-global.el (isearch-next-buffer-function)
-       (TeX-master):
-       * textmodes/reftex.el (font-lock-keywords):
-       * textmodes/tex-mode.el (font-lock-comment-face)
-       (font-lock-doc-face):
-       * textmodes/texinfo.el (outline-heading-alist):
-       Add defvars.
-
-       * textmodes/artist.el (x-pointer-crosshair): Add defvar.
-       (artist-spray-chars, artist-mode-init, artist-replace-string)
-       (artist-select-erase-char, artist-vap-find-endpoints-horiz)
-       (artist-vap-find-endpoints-vert, artist-vap-find-endpoints-swne)
-       (artist-vap-find-endpoints-nwse): "?\ " -> "?\s".
-
-       * textmodes/conf-mode.el (outline-heading-end-regexp): Add defvar.
-       (conf-align-assignments): "?\ " -> "?\s".
-
-       * textmodes/reftex-index.el (TeX-master): Add defvar.
-       (reftex-index-phrases-marker): Move up defvar.
-
-       * textmodes/reftex-toc.el (zmacs-regions): Add defvar.
-       (reftex-toc-include-labels-indicator)
-       (reftex-toc-include-index-indicator)
-       (reftex-toc-max-level-indicator): Move up declarations.
-
-       * net/tramp.el (tramp-handle-make-auto-save-file-name): Pass list
-       of args to `tramp-run-real-handler', even if it's empty in this case.
-
-2005-08-31  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * dired.el (dired-move-to-filename-regexp): Add date format for
-       Mac OS X 10.3 in East Asian locales.
-
-2005-08-31  Michael Albinus  <michael.albinus@gmx.de>
-
-       * files.el (make-auto-save-file-name): Add file name handler call
-       if applicable.
-
-       * net/tramp.el (tramp-file-name-handler-alist)
-       (tramp-file-name-for-operation): Add `make-auto-save-file-name'.
-       (tramp-handle-make-auto-save-file-name): Rename from
-       `tramp-make-auto-save-file-name'.
-       (tramp-exists-file-name-handler): New defun.
-       (tramp-advice-make-auto-save-file-name): Make defadvice only when
-       `make-auto-save-file-name' is not a magic file name operation.
-
-2005-08-30  Richard M. Stallman  <rms@gnu.org>
-
-       * files.el (risky-local-variable-p):
-       Match `-predicates' and `-commands.
-
-       * cus-edit.el (custom-buffer-sort-alphabetically): Default to t.
-       (custom-save-all): Visit the file if necessary;
-       kill the buffer if we created it.
-       (custom-save-delete): Don't visit file or kill buffer here.
-
-2005-08-30  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-special-keyword): New face.
-       (org-table-copy-down, org-table-eval-formula)
-       (org-table-recalculate, org-init-section-numbers):
-       Use `string-to-number' instead of `string-to-int'.
-       (org-get-location): Use `insert-buffer-substring' instead of
-       `insert-buffer'.
-       (org-modify-diary-entry-string): New function.
-       (org-get-entries-from-diary): Set the hook for `add-to-diary-list'.
-       (org-disable-agenda-to-diary): Rename from `org-disable-diary'.
-       (org-toggle-fixed-width-section): Use QUOTE keyword if there is no
-       active region.
-       (org-export-as-html): Handle QUOTE keyword.
-       (org-quote-string): New option.
-       (org-bookmark-jump-unhide): New function, used for
-       `bookmark-after-jump-hook'.
-       (org-diary-default-entry): Apply only when not called through
-       `org-agenda'.
-
-2005-08-30  Juanma Barranquero  <lekktu@gmail.com>
-
-       * net/eudc.el (mode-popup-menu):
-       * play/handwrite.el (ps-printer-name, ps-lpr-command):
-       * progmodes/ada-mode.el (compile-auto-highlight)
-       (skeleton-further-elements):
-       * progmodes/autoconf.el (font-lock-syntactic-keywords):
-       * progmodes/cmacexp.el (msdos-shells):
-       * progmodes/compile.el (font-lock-extra-managed-props)
-       (font-lock-keywords, font-lock-maximum-size)
-       (font-lock-support-mode):
-       * progmodes/grep.el (font-lock-lines-before):
-       * progmodes/idlw-complete-structtag.el (idlwave-completion-help-info):
-       * progmodes/mixal-mode.el (compile-command):
-       * progmodes/perl-mode.el (font-lock-comment-face)
-       (font-lock-doc-face, font-lock-string-face):
-       * progmodes/prolog.el (comint-prompt-regexp):
-       * progmodes/sh-script.el (font-lock-comment-face)
-       (font-lock-set-defaults, font-lock-string-face):
-       * progmodes/sql.el (font-lock-keyword-face)
-       (font-lock-set-defaults, font-lock-string-face):
-       * progmodes/vhdl-mode.el (compilation-file-regexp-alist)
-       (itimer-version, lazy-lock-defer-contextually)
-       (lazy-lock-defer-on-scrolling, lazy-lock-defer-on-the-fly):
-       Add defvars.
-
-       * progmodes/cperl-mode.el (cperl-electric-lbrace)
-       (cperl-electric-keyword, cperl-electric-pod)
-       (cperl-electric-backspace, cperl-forward-re)
-       (cperl-fix-line-spacing, cperl-fill-paragraph): "?\ " -> "?\s".
-       (vc-rcs-header, vc-sccs-header): Add defvars.
-
-       * progmodes/fortran.el (fortran-indent-to-column): "?\ " -> "?\s".
-       (font-lock-syntactic-keywords, gud-find-expr-function):
-       Add defvars.
-
-       * progmodes/gdb-ui.el (tool-bar-map): Add defvar.
-       (gdb-frame-parameters): Declare before use.
-
-       * progmodes/gud.el (gdb-active-process, gdb-define-alist)
-       (gdb-macro-info, gdb-server-prefix, gdb-show-changed-values)
-       (gdb-var-changed, gdb-var-list, tool-bar-map): Add defvars.
-       (gud-expr-compound-sep, gud-expr-compound): "?\ " -> "?\s".
-
-       * progmodes/idlw-help.el (browse-url-generic-args): Add defvar.
-       (idlwave-help-with-source): Use `insert-buffer-substring', not
-       `insert-buffer'.
-
-2005-08-29  Juri Linkov  <juri@jurta.org>
-
-       * outline.el (hide-entry, hide-leaves, outline-toggle-children):
-       Put outline-back-to-heading function call inside save-excursion.
-
-2005-08-29  Juanma Barranquero  <lekktu@gmail.com>
-
-       * man.el (Man-init-defvars, Man-translate-references)
-       (Man-support-local-filenames, Man-highlight-references):
-       * progmodes/sql.el (sql-interactive-mode):
-       * shell.el (shell-mode, shell-resync-dirs): Fix typos in docstrings.
-
-       * emacs-lisp/checkdoc.el (compilation-error-regexp-alist)
-       (compilation-mode-font-lock-keywords): Add defvars.
-       (checkdoc-interactive-loop): "?\ " -> "?\s".
-
-       * emacs-lisp/lisp-mode.el (font-lock-comment-face)
-       (font-lock-doc-face, font-lock-string-face)
-       (font-lock-keywords-case-fold-search): Add defvars.
-       (emacs-lisp-mode-syntax-table): "?\ " -> "?\s".
-
-       * obsolete/sun-fns.el (mouse-select-or-drag-move-point):
-       Don't pass X and Y (they are ignored anyway).
-       (mouse-set-mark, mouse-select-window, mouse-delete-other-windows)
-       (mouse-delete-window): Make arguments optional.
-
-       * obsolete/rnews.el (news-add-news-group): Don't use `end-of-line'.
-       (caesar-translate-table, minor-modes, news-buffer-save)
-       (news-group-name, news-minor-modes): Add defvars.
-
-       * emacs-lisp/lselect.el (mouse-highlight-priority)
-       (x-lost-selection-functions, zmacs-regions):
-       * emacs-lisp/pp.el (font-lock-verbose):
-       * emacs-lisp/syntax.el (font-lock-beginning-of-syntax-function):
-       * emacs-lisp/tcover-ses.el (ses-initial-global-parameters)
-       (ses-mode-map):
-       * emacs-lisp/tcover-unsafep.el (safe-functions):
-       * international/mule-cmds.el (mac-system-coding-system)
-       (mac-system-locale):
-       * language/ethio-util.el (rmail-current-message)
-       (rmail-message-vector):
-       * language/thai-util.el (thai-auto-composition-mode):
-       * mail/metamail.el (rmail-current-message, rmail-message-vector):
-       * mail/mspools.el (rmail-inbox-list, vm-crash-box)
-       (vm-folder-directory, vm-init-file, vm-init-file-loaded)
-       (vm-primary-inbox, vm-spool-files):
-       * mail/rmail.el (deleted-head, font-lock-fontified)
-       (mail-abbrev-syntax-table, mail-abbrevs, messages-head)
-       (rmail-use-spam-filter, rsf-beep, rsf-sleep-after-message)
-       (total-messages):
-       * mail/rmail-spam-filter.el (bbdb/mail_auto_create_p)
-       (rmail-summary-mode-map):
-       * mail/rmailkwd.el (rmail-buffer, rmail-current-message)
-       (rmail-last-label, rmail-last-multi-labels)
-       (rmail-summary-vector, rmail-total-messages):
-       * mail/rmailmsc.el (rmail-current-message, rmail-inbox-list):
-       * mail/rmailsum.el (msgnum):
-       * mail/uce.el (gnus-original-article-buffer, mail-reply-buffer)
-       (rmail-current-message):
-       * obsolete/fast-lock.el (font-lock-face-list):
-       * obsolete/rnewspost.el (mail-reply-buffer):
-       * obsolete/scribe.el (compile-command):
-       * obsolete/x-menu.el (x-process-mouse-hook): Add defvars.
-
-2005-08-28  John Paul Wallington  <jpw@gnu.org>
-
-       * ibuf-ext.el (ibuffer-auto-update-changed):
-       Use `frame-or-buffer-changed-p' to check whether we need to update.
-       (ibuffer-auto-mode): Don't advise `get-buffer-create' and
-       `kill-buffer'.  Initialise `ibuffer-auto-buffers-changed'
-       as a `frame-or-buffer-changed-p' state vector instead.
-
-2005-08-27  Romain Francoise  <romain@orebokech.com>
-
-       * textmodes/makeinfo.el (makeinfo-compile):
-       Use `compilation-start'.  Set `next-error-function' according to
-       `disable-errors'.
-       (makeinfo-next-error): New function.
-       (makeinfo-region): Adjust to new `makeinfo-compile' prototype.
-       (makeinfo-buffer): Likewise.
-
-       * progmodes/compile.el (compilation-start): Add autoload cookie.
-
-       * progmodes/antlr-mode.el: Don't autoload `compilation-start'.
-       * textmodes/sgml-mode.el: Likewise.
-       * progmodes/python.el: Likewise.
-
-2005-08-27  Eli Zaretskii  <eliz@gnu.org>
-
-       * simple.el (blink-matching-paren-distance): Document the meaning
-       of nil value, and allow to customize to nil.
-
-       * eshell/esh-ext.el (eshell-windows-shell-file): Look for
-       command.com, not command.exe.
-
-2005-08-26  John Wiegley  <johnw@newartisans.com>
-
-       * eshell/esh-cmd.el (eshell-rewrite-named-command): Change the
-       code around a bit so that an extraneous nil argument is not added
-       to a command when no args are given.
-
-       * eshell/esh-arg.el (eshell-parse-double-quote): If a
-       double-quoted argument resolves to nil, return it as an empty
-       string rather than as nil.  This made it impossible to pass "" to
-       a shell script as a null string argument.
-
-2005-08-26  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * outline.el (outline-invent-heading): New fun.
-       (outline-promote, outline-demote): Use it.
-       (outline-move-subtree-down): Remove unused vars `re' and `txt'.
-       (outline-end-of-subtree): Remove unused var `opoint'.
-
-2005-08-26  David Reitter  <david.reitter@gmail.com>
-
-       * menu-bar.el (truncate-lines, write-file, print-buffer)
-       (ps-print-buffer-faces, ps-print-buffer, split-window):
-       Disable menu items when the frame they refer to is invisible, or when
-       they refer to a buffer and the minibuffer is selected.
-
-2005-08-26  Pavel Kobiakov  <pk_at_work@yahoo.com>
-
-       * progmodes/flymake.el (flymake-highlight-err-lines):
-       Use save-excursion around flymake-highlight-line to preserve point.
-
-2005-08-26  Eli Zaretskii  <eliz@gnu.org>
-
-       * progmodes/octave-mod.el: Change Author and Maintainer address.
-       (octave-maintainer-address): Change Kurt's email address.
-       * progmodes/octave-inf.el: Change Author and Maintainer address.
-       * progmodes/octave-hlp.el: Change Author and Maintainer address.
-
-2005-08-26  Kim F. Storm  <storm@cua.dk>
-
-       * subr.el (version-list-<, version-list-<=, version-list-=):
-       Rename from integer-list-*.
-       (version-list-not-zero): Likewise.  Fix while loop.
-       (version=): Use version-list-= instead of string-equal.
-
-2005-08-26  Richard M. Stallman  <rms@gnu.org>
-
-       * outline.el (outline-promote): Try shortening the heading.
-       As last resort, read the heading to use.
-       (outline-demote): As last resort, read the heading to use.
-
-2005-08-26  Romain Francoise  <romain@orebokech.com>
-
-       * progmodes/compile.el (compilation-start): Doc fix.
-
-       * progmodes/antlr-mode.el (antlr-default): Fix defface form.
-       (antlr-font-lock-additional-keywords): Fix reference to
-       `antlr-font-lock-literal-regexp' erroneously changed during the
-       mass face rename.
-       (antlr-run-tool): Use `compilation-start'.
-
-       * textmodes/sgml-mode.el (sgml-validate): Use `compilation-start'
-       instead of the obsolete `compile-internal'.
-
-2005-08-26  Juanma Barranquero  <lekktu@gmail.com>
-
-       * calendar/cal-bahai.el (date, displayed-month, displayed-year)
-       (number, original-date):
-       * calendar/cal-china.el (date):
-       * calendar/cal-coptic.el (date):
-       * calendar/cal-french.el (date):
-       * calendar/cal-hebrew.el (date, entry, number, original-date):
-       * calendar/cal-islam.el (date, number, original-date):
-       * calendar/cal-iso.el (date):
-       * calendar/cal-julian.el (date):
-       * calendar/cal-mayan.el (date):
-       * calendar/cal-menu.el (date, event):
-       * calendar/cal-persia.el (date):
-       * calendar/lunar.el (date):
-       * calendar/solar.el (date): Add defvars.
-
-       * emerge.el:
-       * ibuffer.el:
-       * info-xref.el:
-       * obsolete/bg-mouse.el:
-       * obsolete/sun-curs.el:
-       * obsolete/swedish.el: Move the `defvar's to the top level.
-
-       * smerge-mode.el (smerge-refined-change): Add :group.
-
-2005-08-25  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * smerge-mode.el (smerge-remove-props): Make the args non-optional.
-       (smerge-keep-n): Remove props.
-       (smerge-keep-base, smerge-keep-other, smerge-keep-mine)
-       (smerge-keep-current, smerge-kill-current): Don't remove props anymore
-       now that it's done in smerge-keep-n.
-       (smerge-refined-change): New face.
-       (smerge-refine-chopup-region, smerge-refine-highlight-change)
-       (smerge-refine): New funs.
-       (smerge-basic-map): Bind smerge-refine.
-
-2005-08-25  Juri Linkov  <juri@jurta.org>
-
-       * progmodes/grep.el (grep, grep-mode): Make buffer-local variables
-       compilation-process-setup-function and compilation-disable-input
-       in grep-mode instead of let-bindings in grep.
-
-       * menu-bar.el (menu-bar-options-menu, menu-bar-options-save):
-       Delete "Automatic File De/compression" (auto-compression-mode).
-
-2005-08-25  Juanma Barranquero  <lekktu@gmail.com>
-
-       * obsolete/bg-mouse.el: Move to obsolete/ from term/.
-       Silence warning about non-existent variable.
-
-2005-08-25  Richard M. Stallman  <rms@gnu.org>
-
-       * menu-bar.el (menu-bar-describe-menu): Delete "What's New".
-       Rename "Describe Key" to "Describe Key or Mouse Operation".
-
-       * mail/mailalias.el (build-mail-aliases): Delete comments
-       from the contents before processing them.
-
-       * isearch.el (isearch-edit-string): Erase the Search prompt
-       if user enters an empty string and there is no default.
-
-       * comint.el (comint-file-name-prefix): Add autoload.
-
-2005-08-25  Joe Corneli  <jcorneli@math.utexas.edu>
-
-       * subr.el (play-sound): Rearrange to avoid warning.
-
-2005-08-25  Carsten Dominik  <dominik@science.uva.nl>
-
-       * calendar/diary-lib.el (diary-modify-entry-list-string-function):
-       New hook.
-       (add-to-diary-list): Call `diary-modify-entry-list-string-function'.
-
-2005-08-24  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * emacs-lisp/easy-mmode.el (define-minor-mode): Simplify.
-
-       * custom.el (custom-theme-set-variables): Sort minor modes last.
-
-2005-08-24  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
-
-       * subr.el (version-separator, version-regexp-alist): New vars used by
-       version comparison funs.
-       (integer-list-<, integer-list-=, integer-list-<=)
-       (integer-list-not-zero): New funs for integer list comparison.
-       (version-to-list, version=, version<, version<=): New funs for version
-       comparison.
-
-2005-08-24  Juanma Barranquero  <lekktu@gmail.com>
-
-       * emerge.el (merge-begin, merge-end, template, A-begin, A-end)
-       (B-begin, B-end, diff, diff-vector, valid-diff): Defvar at compile
-       time to silence the byte-compiler.
-
-       * ibuffer.el (ibuffer-compile-make-eliding-form)
-       (ibuffer-check-formats): Use `with-no-warnings' to hide references
-       to `ibuffer-elide-long-columns' (which is defined on ibuffer.el,
-       so it's silly to get warnings for it).
-       (ibuffer-auto-mode, ibuffer-cached-filter-formats)
-       (ibuffer-compiled-filter-formats, ibuffer-filter-format-alist)
-       (ibuffer-filter-group-kill-ring, ibuffer-filter-groups)
-       (ibuffer-filtering-qualifiers, ibuffer-hidden-filter-groups)
-       (ibuffer-inline-columns, ibuffer-show-empty-filter-groups)
-       (ibuffer-tmp-hide-regexps, ibuffer-tmp-show-regexps):
-       Defvar at compile time.
-       (ibuffer-compiled-formats, ibuffer-cached-eliding-string)
-       (ibuffer-cached-formats, ibuffer-cached-elide-long-columns):
-       Declare them before use.
-
-       * info-xref.el (info-xref-xfile-alist, info-xref-filename-heading)
-       (info-xref-good, info-xref-bad): Defvar at compile time.
-
-       * obsolete/mlsupport.el (filter-region, execute-monitor-command):
-       Use `let*' instead of `let'.
-
-       * obsolete/sun-curs.el (icon-edit, *mouse-window*, *mouse-x*)
-       (*mouse-y*, menu, char): Defvar at compile time.
-       (sc::menu): Declare it before use.
-       (sc::pack-one-line): Use `let', not `let*'.
-
-       * obsolete/swedish.el (news-inews-hook, news-group-hook-alist)
-       (mail-send-hook): Defvar at compile time.
-
-       * term/bg-mouse.el (bg-mouse-x, bg-mouse-y, bg-cursor-window):
-       Defvar at compile time.
-
-       * term/sun-mouse.el (current-global-mousemap)
-       (current-local-mousemap): Declare them before use.
-
-2005-08-24  Carsten Dominik  <dominik@science.uva.nl>
-
-       * bookmark.el (bookmark-after-jump-hook): New hook.
-       (bookmark-jump): Run `bookmark-after-jump-hook'.
-
-2005-08-23  Juri Linkov  <juri@jurta.org>
-
-       * faces.el (minibuffer-prompt): Doc fix.
-
-2005-08-23  Juanma Barranquero  <lekktu@gmail.com>
-
-       * progmodes/xscheme.el: Trivial changes to silence warnings.
-       (xscheme-previous-mode, xscheme-previous-process-state):
-       Add defvars.
-       (xscheme-last-input-end, xscheme-process-command-line)
-       (xscheme-process-name, xscheme-buffer-name)
-       (xscheme-expressions-ring-max, xscheme-expressions-ring)
-       (xscheme-expressions-ring-yank-pointer, xscheme-running-p)
-       (xscheme-control-g-synchronization-p)
-       (xscheme-control-g-disabled-p, xscheme-string-receiver)
-       (default-xscheme-runlight, xscheme-runlight)
-       (xscheme-runlight-string, xscheme-process-filter-state)
-       (xscheme-allow-output-p, xscheme-prompt, xscheme-mode-string):
-       Move to beginning of file.
-       (scheme-interaction-mode-commands-alist)
-       (scheme-interaction-mode-map, scheme-debugger-mode-map):
-       Declare them before use.  Note: the initialization code for the
-       variables has not been moved because it uses functions that reference
-       the variables.
-       (xscheme-control-g-message-string, xscheme-process-filter-alist)
-       (xscheme-prompt-for-expression-map): Declare them before use.
-       (scheme-debugger-mode-commands): "?\ " -> "?\s".
-
-2005-08-23  Ed Swarthout  <ed.swarthout@gmail.com>  (tiny change)
-
-       * hexl.el (hexl-print-current-point-info): Fix simple spelling error.
-
-2005-08-22  Juri Linkov  <juri@jurta.org>
-
-       * faces.el (set-face-underline): Delete this duplicate function
-       and make an obsolete alias to set-face-underline-p.
-       (set-face-underline-p): Use docstring of set-face-underline.
-       (describe-face): Create hyperlink to parent face.
-
-       * info.el (Info-insert-dir): Use save-excursion around
-       insert-buffer-substring.
-       (Info-isearch-search): Use LITERAL arg of replace-regexp-in-string.
-       (Info-escape-percent): Delete function.
-       (Info-fontify-node): Replace Info-escape-percent by
-       replace-regexp-in-string with REP arg set to lambda that
-       duplicates `%' and preserves text properties.
-
-       * progmodes/compile.el (compilation-disable-input): Doc fix.
-       (define-compilation-mode): Doc fix and refill.
-       (kill-compilation): Use `mode-name' in the error message.
-       (compilation-find-file): Use `compilation-error' in the
-       read-file-name's prompt.
-
-2005-08-22  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * smerge-mode.el (smerge-basic-map): Bind smerge-combine-with-next.
-       (smerge-auto-leave): Make undo re-enable the mode.
-       (debug-ignored-errors): Add the user-error of impossible resolution.
-       (smerge-resolve): Move things around a bit, in preparation for later.
-       (smerge-diff): Don't fail if the buffer has no associated file.
-       (ediff-ancestor-buffer, ediff-quit-hook): Quieten byte-compiler.
-       (smerge-conflict-overlay): New function.
-       (smerge-match-conflict): Don't add text properties here.
-       (smerge-find-conflict): Instead, add an overlay here.
-       Also check for the case where we're inside a conflict already, so as to
-       obviate the need for font-lock-multiline, which is unbearably slow with
-       large conflicts and ciomplex font-lock patterns.
-       (smerge-remove-props): Remove overlay rather than text-properties.
-       (smerge-mode): Don't set font-lock-multiline.
-       Remove overlays when turned off.
-
-2005-08-21  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-ignore-item-p): Use save-match-data.
-       Bind case-fold-search to ido-case-fold locally.
-
-2005-08-20  Richard M. Stallman  <rms@gnu.org>
-
-       * files.el (normal-mode): If font lock is on, turn it off and on.
-
-       * subr.el (replace-regexp-in-string): Doc fix.
-
-       * startup.el (command-line-1): Don't suppress startup screen
-       due to existing processes.
-
-       * progmodes/grep.el (grep): Bind compilation-disable-input to t.
-
-       * progmodes/compile.el (compilation-disable-input): Default to nil.
-
-2005-08-20  Kevin Rodgers  <ihs_4664@yahoo.com>  (tiny change)
-
-       * progmodes/compile.el (compilation-disable-input): New defcustom.
-       (compilation-start): If compilation-disable-input is non-nil, send
-       EOF to the compilation process.
-
-2005-08-20  Eli Zaretskii  <eliz@gnu.org>
-
-       * textmodes/tex-mode.el (tex-bibtex-file, tex-send-tex-command):
-       Run the argument of tex-shell-cd-command through
-       convert-standard-filename, to get the correct style of slashes on
-       Windows, and enclose the result in quotes, in case the file name
-       includes whitespace or other special characters.
-
-2005-08-19  Andreas Schwab  <schwab@suse.de>
-
-       * progmodes/gud.el (gud-kill-buffer-hook): Don't kill unrelated
-       process.
-
-2005-08-18  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * cus-start.el (minibuffer-prompt-properties): Correct typo.
-
-2005-08-18  Kim F. Storm  <storm@cua.dk>
-
-       * scroll-lock.el: Fix errors due to incorrect line wrapping.
-
-2005-08-18  Richard M. Stallman  <rms@gnu.org>
-
-       * scroll-lock.el: New file.
-
-2005-08-18  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * dired.el (dired-move-to-end-of-filename):
-       Handle fifo as rendered by "ls -lF": Don't include trailing "|".
-
-2005-08-18  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-everywhere): Fix defcustom :set function to disable
-       rather than toggle mode when custom value is nil.
-       (ido-everywhere): Fix defun doc string.
-
-2005-08-17  Richard M. Stallman  <rms@gnu.org>
-
-       * cus-start.el (minibuffer-prompt-properties): Use "Don't Enter"
-       as tag instead of "Inviolable".
-
-2005-08-17  Kim F. Storm  <storm@cua.dk>
-
-       * windmove.el (windmove-coordinates-of-position): Remove.
-       (windmove-coordinates-of-window-position): Remove.
-       (windmove-reference-loc): Use posn-at-point instead.
-
-       * subr.el (insert-for-yank-1): Doc fix.
-
-       * ido.el (ido-enter-matching-directory): Rename from
-       ido-enter-single-matching-directory.  Change `slash' choice to
-       `only'.  Add `first' choice.
-       (ido-exhibit): Adapt to above changes.
-
-2005-08-16  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * Makefile.in: Expand comment about building loaddefs.el.
-
-2005-08-16  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (toggle-gdb-use-inferior-io-buffer):
-       Comment use of defadvice.
-
-       * progmodes/gud.el (gud-jump): Rework for gdb-ui.
-
-2005-08-15  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * buff-menu.el, compare-w.el, emacs-lisp/testcover.el,
-       * play/gomoku.el, play/mpuz.el, progmodes/flymake.el,
-       * progmodes/gdb-ui.el, progmodes/idlw-help.el,
-       * progmodes/idlw-shell.el, progmodes/ld-script.el,
-       * progmodes/which-func.el, ruler-mode.el, strokes.el,
-       * textmodes/sgml-mode.el, textmodes/table.el: Do not use face-alias
-       for backward compatibility for faces that did not appear in the
-       previous Emacs release.
-
-       * simple.el (next-error-follow-minor-mode): Fix init value and lighter.
-
-2005-08-15  Kim F. Storm  <storm@cua.dk>
-
-       * emulation/cua-base.el (cua-delete-region): Return t if
-       deleted region was non-empty.
-       (cua-replace-region): Inhibit overwrite-mode for
-       self-insert-command if replaced region was non-empty.
-       (cua--explicit-region-start, cua--status-string): Make them
-       buffer-local at top-level...
-       (cua-mode): ...rather than when mode is enabled.
-
-2005-08-15  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * progmodes/vhdl-mode.el (vhdl-emacs-21):
-       Set t for Emacs 21, 22, and so on.
-
-2005-08-15  David Ponce  <david@dponce.com>
-
-       * tree-widget.el: Update Commentary header.
-       (tree-widget-theme): Doc fix.
-       (tree-widget-space-width): New option.
-       (tree-widget-image-properties): Look up in the default theme too.
-       (tree-widget--cursors): Only for images with arrow pointer shape.
-       (tree-widget-lookup-image): Pointer shape is hand by default.
-       (tree-widget-icon): Rename generic icon widget from
-       `tree-widget-control'.
-       (tree-widget-*-icon): Rename from `tree-widget-*-control' and
-       derive from `tree-widget-icon'.
-       (tree-widget-handle): Improve default look and feel of the text
-       representation.
-       (tree-widget): Rename :*-control properties to :*-icon properties.
-       Add :action and :help-echo properties.
-       (tree-widget-after-toggle-functions): Move.
-       (tree-widget-close-node, tree-widget-open-node): Remove.
-       (tree-widget-before-create-icon-functions): New hook.
-       (tree-widget-value-create): Update to allow customization of icons
-       and nodes at run-time via that new hook.
-       (tree-widget-icon-create, tree-widget-leaf-node-icon-p)
-       (tree-widget-icon-action, tree-widget-icon-help-echo)
-       (tree-widget-action, tree-widget-help-echo): New functions.
-
-2005-08-15  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-buffer-internal): Use with-no-warnings.
-       (ido-make-merged-file-list): Use while-no-input.
-
-2005-08-15  Richard M. Stallman  <rms@gnu.org>
-
-       * textmodes/flyspell.el (flyspell-mark-duplications-flag): Doc fix.
-       (flyspell-large-region): Fix doc and custom type.
-
-2005-08-14  Richard M. Stallman  <rms@gnu.org>
-
-       * files.el (interpreter-mode-alist): Doc fix.
-
-       * mail/rmail.el (rmail-nonignored-headers): New variable.
-       (rmail-clear-headers): Use it.
-       (rmail-reply): Better handling of mail-followup-to header.
-
-       * progmodes/sh-script.el (sh-font-lock-keywords-var):
-       Rename variable from sh-font-lock-keywords.  In the `shell' entry,
-       don't try to refer to executable-font-lock-keywords.
-       (sh-font-lock-keywords-var-1): Rename from sh-font-lock-keywords-1.
-       (sh-font-lock-keywords-var-2): Rename from sh-font-lock-keywords-2.
-       (sh-font-lock-keywords): Append executable-font-lock-keywords here.
-       (sh-mode): Set comment-start-skip, local-abbrev-table,
-       imenu-case-fold-search.
-       (sh-set-shell): Don't set them here.
-       (sh-feature): Simplify.  Get rid of the eval-a-variable feature.
-       Don't cache the results in the original alist; don't ever modify
-       that alist.
-
-       * textmodes/flyspell.el (flyspell-mode): Autoload a defvar.
-
-       * textmodes/ispell.el (lookup-words): Cope with case where ARGS is
-       empty.
-
-2005-08-15  Andreas Schwab  <schwab@suse.de>
-
-       * desktop.el: Put autoload cookie at risky-local-variable declarations.
-
-       * dired.el, info.el, mail/rmail.el: Revert last change.
-
-2005-08-14  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * dired.el: Fix dependency bug: Wrap `desktop-buffer-mode-handlers'
-       modification in `eval-after-load' form.
-       * info.el: Likewise.
-       * mail/rmail.el: Likewise.
-
-2005-08-14  Juri Linkov  <juri@jurta.org>
-
-       * progmodes/compile.el (compilation-mode-font-lock-keywords):
-       Remove highlighting of "Compilation started".  Highlight only
-       the word "finished" in "Compilation finished".  Add highlighting
-       of "interrupt", "killed", "terminated" and the exit code.
-       (compilation-start): Add newline after header.  Use exactly the
-       same time stamp format as the finishing message.
-       (compilation-mode-map): Add ellipsis to "Search Files (grep)".
-
-       * progmodes/grep.el (grep-mode-map): Add ellipsis to "Another grep".
-       (grep-mode-font-lock-keywords): Don't highlight "Grep started".
-       Add highlighting of "interrupt", "killed", "terminated".
-
-       * delsel.el (delete-selection-pre-hook): If overwrite-mode is
-       enabled and the current command is self-insert-command, call it
-       explicitly with overwrite-mode bound to nil, to not allow it
-       to delete the character after the selected region.
-
-2005-08-12  Matt Hodges  <MPHodges@member.fsf.org>
-
-       * emacs-lisp/eldoc.el: Add move-beginning-of-line,
-       move-end-of-line, end-of-line, and beginning-of-line to the list
-       of commands after which the echo area is updated.
-
-2005-08-12  Eli Zaretskii  <eliz@gnu.org>
-
-       * cus-edit.el (custom-save-all, custom-save-delete):
-       Bind recentf-exclude to exclude custom-file.
-
-2005-08-12  Ehud Karni  <ehud@unix.mvs.co.il>
-
-       * mail/rmailsum.el (rmail-summary-end-of-message): New command
-       to go to the bottom of the mail message.  Added to
-       `rmail-summary-mode-map' with key "/".
-       (rmail-summary-show-message): New (internal) function for use by
-       both `rmail-summary-beginning/end-of-message'.
-       (rmail-summary-beginning-of-message): Change to use
-       rmail-summary-show-message.
-
-       * mail/rmail.el (rmail-end-of-message): New command to go to the
-       end of the current message.  Added to `rmail-mode-map' with key "/".
-       (rmail-beginning-of-message): Fix to work as documented.
-       (rmail-mode): Change documentation.
-
-       * progmodes/compile.el (compilation-start): Add the line
-       "Compilation started" with compilation start time.
-       (compilation-mode-font-lock-keywords): Add `started' to keywords.
-
-2005-08-11  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * menu-bar.el (menu-bar-options-menu): Standardize capitalization
-       of menu items.
-
-2005-08-11  Richard M. Stallman  <rms@gnu.org>
-
-       * simple.el (pop-global-mark): Reverse test of widen-automatically.
-
-       * battery.el (battery-status-function): Don't use ignore-errors.
-
-2005-08-11  Lute Kamstra  <lute@gnu.org>
-
-       * emacs-lisp/generic.el (generic-font-lock-defaults): Declare with
-       define-obsolete-variable-alias.
-
-2005-08-11  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * net/ange-ftp.el: Use \\` and \\' instead of ^ and $ in regexps.
-       (ange-ftp-send-cmd): Revert last change, and expand
-       the comment explaining the problem.
-
-2005-08-10  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * ldefs-boot.el: Update.
-
-       * menu-bar.el (menu-bar-showhide-menu): Rename "Date, Time and Mail"
-       item to "Time, Load and Mail".  Change help echo text.
-
-       * time.el (display-time-use-mail-icon, display-time-format)
-       (display-time-string-forms): Shorten first line of docstrings.
-
-2005-08-10  Lars Hansen  <larsh@soem.dk>
-
-       * desktop.el (desktop-buffer-mode-handlers):
-       Make non-customizable.  Add autoload cookie.  Change initial value to
-       nil; add elements in respective modules instead.  Fix doc string.
-       (desktop-load-file): New function.
-       (desktop-minor-mode-handlers): New autoloaded variable.
-       (desktop-create-buffer): Call minor mode handlers.
-       Use desktop-load-file to load major and minor mode modules prior to
-       checking for a handler.
-       (desktop-save): Don't add nil to desktop-minor-modes for minor
-       modes with nil function in desktop-minor-mode-table.  Don't delete
-       desktop file before rewriting it.
-       (desktop-locals-to-save): Add autoload cookie.  Don't make
-       automatically buffer-local.  Add variables column-number-mode,
-       size-indication-mode, indent-tabs-mode,
-       indicate-buffer-boundaries, indicate-empty-lines and
-       show-trailing-whitespace.
-       (desktop-clear): Allow desktop-clear-preserve-buffers to contain
-       regexps.  Don't use desktop-clear-preserve-buffers-regexp.
-       (desktop-clear-preserve-buffers-regexp): Delete.
-       (desktop-clear-preserve-buffers): Update initial value and docstring.
-       (desktop-save-buffer): Fix doc string.
-
-       * hilit-chg.el: Add handler to desktop-minor-mode-handlers.
-       (hilit-chg-desktop-restore): New function.
-       (highlight-changes-mode): Add highlight-changes-mode to
-       desktop-locals-to-save.
-
-       * dired.el: Add handler to desktop-buffer-mode-handlers.
-       (dired-restore-desktop-buffer): Remove autoload cookie.
-       (dired-mode): Add autoload cookie.
-
-       * info.el: Add handler to desktop-buffer-mode-handlers.
-       (Info-restore-desktop-buffer): Remove autoload cookie.
-       (Info-mode): Add autoload cookie.
-
-       * mh-e/mh-e.el: Add handler to desktop-buffer-mode-handlers.
-       (mh-restore-desktop-buffer): Remove autoload cookie.
-       (mh-folder-mode): Add autoload cookie.
-
-       * mail/rmail.el: Add handler to desktop-buffer-mode-handlers.
-       (rmail-restore-desktop-buffer): Remove autoload cookie.
-
-2005-08-11  Masatake YAMATO  <jet@gyve.org>
-
-       * hexl.el (hexl-address-region):
-       (hexl-ascii-region, hexl-font-lock-keywords):
-       (hexl-highlight-line-range): Use the term "region"
-       instead of "area" for consistency with the other symbols
-       defined in hexl.el.
-
-2005-08-09  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * menu-bar.el (menu-bar-options-save): Move `display-time-mode' to
-       correct group: it is set with `menu-bar-make-mm-toggle' (pointed
-       out by Juri Linkov).  Add `display-battery-mode'.
-
-2005-08-09  Juri Linkov  <juri@jurta.org>
-
-       * progmodes/compile.el (compilation-mode-font-lock-keywords):
-       Remove `-text' from face variable names.
-       (compilation-error-file-name, compilation-warning-file-name)
-       (compilation-info-file-name): Delete faces.
-       (compilation-line-number, compilation-column-number):
-       Remove face underlining.
-       (compilation-message-face): Set to `underline' value by default.
-       (compilation-error-face, compilation-warning-face)
-       (compilation-info-face): Remove `-file-name' from face names.
-       (compilation-error-text-face, compilation-warning-text-face)
-       (compilation-info-text-face): Delete face variables.
-       (compilation-text-face): Delete function.
-
-       * progmodes/grep.el (grep-regexp-alist): Use `.+?' instead of `[^:\n]+'.
-       (grep-mode-font-lock-keywords): Use `.+?' instead of `[^\n-]+'.
-       (grep-error-face): Set to `compilation-error' instead of
-       `compilation-error-face' (which is redefined to `grep-hit-face' in
-       grep buffers).
-       (grep-mode-font-lock-keywords): Remove `-text' from face variable
-       names.  Use `grep-error-face' instead of `compilation-error-text-face'.
-
-       * dired-aux.el (dired-do-query-replace-regexp):
-       Use `query-replace-read-args'.
-
-       * replace.el (query-replace-read-from, query-replace-read-to)
-       (query-replace-read-args): Rename arg `string' to `prompt'.
-
-       * menu-bar.el (menu-bar-showhide-menu): Add `showhide-battery'.
-
-2005-08-09  Katsumi Yamaoka  <yamaoka@jpl.org>
-
-       * net/ange-ftp.el (ange-ftp-send-cmd): Make it work properly with
-       uploading files.
-       (ange-ftp-canonize-filename): Handle file names beginning with ~
-       correctly.
-
-2005-08-09  Juanma Barranquero  <lekktu@gmail.com>
-
-       * textmodes/fill.el (canonically-space-region)
-       (fill-context-prefix, fill-french-nobreak-p)
-       (fill-delete-newlines, fill-comment-paragraph)
-       (justify-current-line): "?\ " -> "?\s".
-
-2005-08-09  Ben North  <ben@redfrontdoor.org>  (tiny change)
-
-       * textmodes/fill.el (fill-nonuniform-paragraphs):
-       Improve argument/docstring consistency.
-
-2005-08-09  Richard M. Stallman  <rms@gnu.org>
-
-       * textmodes/ispell.el (ispell-word): More fboundp checks.
-
-       * files.el (find-file-noselect): Don't call set-buffer-major-mode.
-       (find-file-noselect-1): Call it here, only if RAWFILE.
-       (normal-mode): Always set some major mode.
-       (save-some-buffers-action-alist): Change some explanation strings.
-       (file-name-non-special): In the `quote' method, use unwind-protect.
-
-2005-08-09  Magnus Henoch  <mange@freemail.hu>
-
-       * textmodes/ispell.el (ispell-find-aspell-dictionaries): New command.
-       (ispell-have-aspell-dictionaries): New variable.
-       (ispell-aspell-data-dir, ispell-aspell-dict-dir): New variables.
-       (ispell-get-aspell-config-value): New function.
-       (ispell-aspell-find-dictionary): New function.
-       (ispell-aspell-add-aliases): New function.
-       (ispell-valid-dictionary-list): Call ispell-find-aspell-dictionaries if
-       appropriate.  Don't look for ispell dictionaries if we use aspell.
-       (ispell-menu-map): Don't build a submenu of dictionaries.
-
-2005-08-09  Richard M. Stallman  <rms@gnu.org>
-
-       * progmodes/sql.el (sql-interactive-mode-map): Use fboundp.
-       (sql-read-passwd): Use read-passwd.
-
-       * progmodes/idlw-toolbar.el (idlwave-toolbar)
-       (idlwave-toolbar-is-possible): Add defvars.
-
-       * progmodes/idlw-shell.el (idlwave-xemacs-hack-mouse-track):
-       Avoid warnings.
-
-       * progmodes/idlw-rinfo.el (idlwave-system-variables-alist)
-       (idlwave-system-class-info, idlwave-executive-commands-alist):
-       Use defvar.
-
-       * progmodes/cc-engine.el (c-guess-basic-syntax): Add autoload.
-
-       * mail/supercite.el (sc-ask, sc-no-blank-line-or-header):
-       Avoid warnings.
-
-       * mail/rmail.el (rmail-ignored-headers): Don't hide mime-version:
-       and content-type: headers.
-
-       * eshell/eshell.el (eshell): Avoid warnings about eshell-mode.
-
-       * emacs-lisp/map-ynp.el (map-y-or-n-p): Reorder the options
-       and rename some of them to be more self-explanatory.
-
-       * calendar/calendar.el (calendar-mode-map): Bind < and > usefully.
-
-       * startup.el (command-line-1): Implement -scriptload.
-
-       * replace.el (occur-engine): Initial *Occur* output not undoable.
-
-       * menu-bar.el (menu-bar-file-menu): Rename some menu items
-       and improve help strings.
-
-       * isearch.el (isearch-repeat): When changing direction,
-       mark search successful.
-
-       * ediff-init.el: Use (featurep 'xemacs).
-
-       * comint.el (send-invisible): Identify buffer, if not selected.
-
-       * align.el: Delete autoload for c-guess-basic-syntax.
-
-2005-08-09  Juanma Barranquero  <lekktu@gmail.com>
-
-       * textmodes/refbib.el (r2b-convert-record, r2b-convert-buffer):
-       Improve argument/docstring consistency.  Doc fixes.
-       (r2b-variables, r2bv-address, r2bv-annote, r2bv-author)
-       (r2bv-booktitle, r2bv-date, r2bv-decade, r2bv-editor)
-       (r2bv-entry-kind, r2bv-institution, r2bv-journal, r2bv-keywords)
-       (r2bv-kn, r2bv-month, r2bv-note, r2bv-number, r2bv-ordering)
-       (r2bv-organization, r2bv-pages, r2bv-primary-author)
-       (r2bv-publisher, r2bv-school, r2bv-title, r2bv-title-first-word)
-       (r2bv-tr, r2bv-type, r2bv-volume, r2bv-where, r2bv-year):
-       Defvar at compile time.
-
-2005-08-09  Juri Linkov  <juri@jurta.org>
-
-       * info.el: Replace `info' with upper-case `Info' where appropriate.
-       (info-title-1, info-title-2, info-title-3, info-title-4)
-       (info-menu-header): Move up face definitions.
-       (info-menu-star): Rename from `info-menu-5'.
-       (Info-fontify-node): Replace `info-menu-5' with `info-menu-star'.
-       (Info-fontify-visited-nodes): Fix docstring.
-       (Info-hide-note-references): Fix docstring.
-       (Info-up, Info-next-reference, Info-prev-reference): Put cursor on
-       menu items in the same way as on cross-references.
-       (info-apropos): Fix sorting order and formatting to be like in the
-       stand-alone Info browser.  Display error messages for 1 sec.
-       (Info-mode-map): Move down `c' key binding.  Bind `^' to `Info-up'.
-       (Info-mode-menu): Remove item for `Info-search-case-sensitively'
-       from the menu bar.
-       (Info-insert-dir): Restore point after calling
-       `insert-buffer-substring'.
-
-2005-08-08  Richard M. Stallman  <rms@gnu.org>
-
-       * emacs-lisp/lmenu.el (lucid-menubar-map, lucid-failing-menubar)
-       (recompute-lucid-menubar): Add defvars.
-
-       * mail/sendmail.el (mail-yank-original): Use with-no-warnings.
-
-       * mail/reporter.el (reporter-dump-state): Use insert-buffer-substring.
-
-       * net/net-utils.el (run-dig): Rename from `dig'.
-
-       * play/gametree.el (gametree-mode): Use make-local-variable,
-       not make-variable-buffer-local.
-
-       * progmodes/ada-prj.el (ada-prj-display-page): Use with-no-warnings.
-
-       * ansi-color.el (ansi-color-make-extent)
-       (ansi-color-set-extent-face): Use fboundp, not functionp.
-
-       * autorevert.el (auto-revert-tail-mode): Use make-local-variable,
-       not make-variable-buffer-local.
-
-       * bookmark.el (Info-current-file): Add defvar.
-       (bookmark-jump-noselect): Use with-no-warnings.
-
-       * completion.el (c-mode-map, fortran-mode-map): Add defvars.
-
-       * ebuff-menu.el (Helper-return-blurb): Add defvar.
-
-       * ffap.el (gnus-summary-buffer, gnus-article-buffer): Add defvars.
-
-       * find-file.el (ada-procedure-start-regexp)
-       (ada-package-start-regexp): Add defvars.
-
-       * info.el (Info-insert-dir): Use insert-buffer-substring.
-
-       * xml.el (xml-att-def-re): Add defvar.
-
-       * icomplete.el (icomplete-exhibit): Adapt to new while-no-input
-       calling convention.
-
-       * subr.el (while-no-input): Return t if there is input.
-
-2005-08-08  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * cus-start.el (all): Add `overflow-newline-into-fringe'.
-
-2005-08-08  Juanma Barranquero  <lekktu@gmail.com>
-
-       * cmuscheme.el (inferior-scheme-mode-hook, inferior-scheme-mode)
-       (scheme-prev-l/c-dir/file): Fix typos in docstrings.
-
-2005-08-08  Emilio C. Lopes  <eclig@gmx.net>
-
-       * cmuscheme.el (scheme-start-file): Replace reference to
-       `user-emacs-directory' by "~/.emacs.d/".
-
-2005-08-08  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * info.el (Info-dir-remove-duplicates): Avoid case folding
-       in loop; instead, keep downcased strings for comparison.
-       Suggested by Helmut Eller.
-
-2005-08-07  Michael Albinus  <michael.albinus@gmx.de>
-
-       Sync with Tramp 2.0.50.
-
-       * net/tramp.el: Remove defvar of `last-coding-system-used' in the
-       XEmacs case; not necessary anymore.
-       (tramp-user-regexp): Allow "@" as part of user name.
-       (tramp-handle-set-visited-file-modtime)
-       (tramp-handle-insert-file-contents)
-       (tramp-handle-write-region): No special handling for
-       `last-coding-system-used, because this is done in
-       `tramp-accept-process-output' now.
-       (tramp-accept-process-output): New defun.
-       (tramp-process-one-action, tramp-process-one-multi-action)
-       (tramp-wait-for-regexp, tramp-wait-for-output)
-       (tramp-discard-garbage-erase-buffer): Call it.  Reported by David
-       Howells <dhowells@redhat.com>.
-       (clear-visited-file-modtime): Defadvice removed.  The check for
-       unset buffer's modtime does not need to be based on
-       `tramp-buffer-file-attributes'.  Suggested by RMS.
-       (tramp-message): Insert "\n" if not being at beginning of line.
-       (tramp-find-shell): Use `tramp-barf-if-no-shell-prompt' for code
-       sequence with same logic.
-       (tramp-completion-handle-expand-file-name): Discard call of
-       `tramp-drop-volume-letter'.  It is not necessary, and there have
-       been problems with (expand-file-name "~/.netrc" "/") in ange-ftp.
-       Reported by Richard G. Bielawski <Richard.G.Bielawski@wellsfargo.com>.
-       (tramp-do-copy-or-rename-file-out-of-band): Transfer message
-       should always be visible.
-       (tramp-handle-insert-directory, tramp-setup-complete)
-       (tramp-set-process-query-on-exit-flag)
-       (tramp-append-tramp-buffers): Pacify byte-compiler.
-       (tramp-bug): Delete non-existing variables from list.
-       Apply `tramp-load-report-modules' as pre-hook.
-       Mask `tramp-password-prompt-regexp', `tramp-shell-prompt-pattern' and
-       `shell-prompt-pattern' because of non-7bit characters.
-       Reported by Sebastian Luque <sluque@mun.ca>.
-       (tramp-reporter-dump-variable, tramp-load-report-modules): New defuns.
-       (tramp-match-string-list): Remove function.
-       (tramp-wait-for-regexp): Remove call of that function.
-       Suggested by Kim F. Storm <storm@cua.dk>.
-       (tramp-set-auto-save-file-modes): Use octal integer code #o600
-       instead of octal character code ?\600.  The latter resulted in a
-       syntax error with XEmacs.
-
-       * net/tramp-smb.el: Remove defvar of `last-coding-system-used' in the
-       XEmacs case; not necessary anymore.
-       (tramp-smb-handle-write-region): No special handling for
-       `last-coding-system-used, because this is done in
-       `tramp-accept-process-output' now.
-       (tramp-smb-wait-for-output): Call `tramp-accept-process-output'.
-
-2005-08-06  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * wid-edit.el (widget-choice-value-create):
-       Unconditionally respect user choice.  Set :explicit-choice back to nil
-       when no longer needed.
-       (widget-choice-action): Unconditionally respect user choice.
-       Eliminate :explicit-choice-value.
-
-       * fringe.el (set-fringe-indicators-1, fringe-indicators): Delete.
-
-       * menu-bar.el (menu-bar-options-save): Replace `fringe-indicators'
-       with `indicate-empty-lines' and `indicate-buffer-boundaries'.
-       (menu-bar-showhide-fringe-menu): Add new item "Empty line indicators"
-       running new function `toggle-indicate-empty-lines'.
-       Rename "Customize" item to "Customize fringe".
-       Rename "Indicators" item to "Buffer boundaries" and change help echo.
-       (menu-bar-showhide-fringe-ind-menu): Change several help echos.
-       Add `menu-bar-showhide-fringe-ind-customize' as "Other (customize)".
-       Delete "Empty lines only" item.
-       (menu-bar-showhide-fringe-ind-customize): New function.
-       (menu-bar-showhide-fringe-ind-mixed)
-       (menu-bar-showhide-fringe-ind-box)
-       (menu-bar-showhide-fringe-ind-right)
-       (menu-bar-showhide-fringe-ind-left)
-       (menu-bar-showhide-fringe-ind-none): Use `indicate-buffer-boundaries'
-       instead of `fringe-indicators'.
-
-2005-08-06  Michael Kifer  <kifer@cs.stonybrook.edu>
-
-       * viper.el (viper-emacs-state-mode-list): Add recentf-dialog-mode.
-       Change the date of last update.
-
-2005-08-06  Michael Kifer  <kifer@cs.stonybrook.edu>
-
-       * viper-cmd.el (viper-harness-minor-mode, viper-exec-delete)
-       (viper-exec-yank, viper-put-back): Don't display modification msg
-       if in the minibuffer.
-
-       * viper-init.el (viper-replace-overlay-cursor-color)
-       (viper-insert-state-cursor-color, viper-vi-state-cursor-color):
-       Make variables frame local.
-
-       * viper-util.el (viper-append-filter-alist): Use append instead of
-       nconc.
-
-       * viper.el (viper-vi-state-mode-list)
-       (viper-emacs-state-mode-list): Move help-mode and
-       completion-list-mode from the first list to the second.
-       (viper-mode): Docstring.
-       (viper-go-away, viper-non-hook-settings): Don't localize
-       minor-mode-alist in newer Emacsen.  Add advice to
-       set-cursor-color.  Don't bind "\C-c\\".
-
-2005-08-06  Emilio C. Lopes  <eclig@gmx.net>
-
-       * cmuscheme.el (scheme-trace-command, scheme-untrace-command)
-       (scheme-macro-expand-command): New user options.
-       (scheme-trace-procedure, scheme-expand-current-form): New commands.
-       (scheme-form-at-point, scheme-start-file)
-       (scheme-interactively-start-process): New functions.
-       (scheme-get-process): New function, extracted from `scheme-proc'.
-       (run-scheme): Call `scheme-start-file' to get start file, and pass
-       it to `make-comint'.
-       (switch-to-scheme, scheme-proc):
-       Call `scheme-interactively-start-process' if no Scheme buffer/process
-       is available.
-
-2005-08-06  Juri Linkov  <juri@jurta.org>
-
-       * progmodes/compile.el (compilation-mode-font-lock-keywords):
-       Use `compilation-text-face', `compilation-info-text-face' and
-       `compilation-error-text-face' instead of `font-lock-keyword-face'.
-       (compilation-error): New face.
-       (compilation-error-file-name): Inherit from
-       `compilation-error' instead of `font-lock-warning-face'.
-       (compilation-warning-file-name): Inherit from
-       `compilation-warning' instead of `font-lock-warning-face'.
-       (compilation-info, compilation-error-file-name)
-       (compilation-warning-file-name, compilation-info-file-name)
-       (compilation-line-number, compilation-column-number): Doc fix.
-       (compilation-error-text-face, compilation-warning-text-face)
-       (compilation-info-text-face): New face variables.
-       (compilation-line-face, compilation-column-face)
-       (compilation-enter-directory-face)
-       (compilation-leave-directory-face): Doc fix.
-       (compilation-text-face): New function.
-
-       * progmodes/grep.el (grep-regexp-alist): Set 5th arg `TYPE' to 0
-       instead of 1 to display binary file names as info file links.
-       (grep-error-face): Use `compilation-error-face' instead of
-       `font-lock-keyword-face'.
-       (grep-mode-font-lock-keywords): Use `compilation-info-text-face'
-       and `compilation-warning-text-face' instead of
-       `font-lock-keyword-face'.  Use `compilation-error-text-face'
-       instead of `grep-error-face'.
-
-2005-08-05  Kenichi Handa  <handa@m17n.org>
-
-       * international/code-pages.el: Add autoload cookies for all coding
-       systems.
-
-2005-08-04  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * cus-start.el (all): Put undo.c where it alphabetically belongs.
-
-2005-08-04  Juri Linkov  <juri@jurta.org>
-
-       * progmodes/compile.el (compilation-mode-map):
-       * progmodes/grep.el (grep-mode-map):
-       Bind TAB to `compilation-next-error' and [backtab] to
-       `compilation-previous-error'.
-
-       * progmodes/grep.el (grep-regexp-alist): Replace complex regexp
-       matching line numbers, column numbers and their ranges with regexp
-       matching only line numbers.
-       (grep-context-face): New face variable.
-       (grep-mode-font-lock-keywords): Use it.
-
-       * faces.el (read-face-name): Delete duplicate faces.
-
-2005-08-02  Juanma Barranquero  <lekktu@gmail.com>
-
-       * thumbs.el (thumbs-find-image): Don't make variables
-       automatically buffer local.
-       (thumbs-current-tmp-filename, thumbs-current-image-filename)
-       (thumbs-image-num): Make automatically buffer local.
-       (thumbs-show-thumbs-list): Use `make-local-variable', not
-       `make-variable-buffer-local'.
-       (thumbs-insert-image): Make `thumbs-current-image-size' buffer-local.
-
-       * play/doctor.el (doctor-type-symbol): "?\ " -> "?\s".
-       (**mad**, *debug*, *print-space*, *print-upcase*, abuselst)
-       (abusewords, account, afraidof, arerelated, areyou, bak, beclst)
-       (bother, bye, canyou, chatlst, continue, deathlst, describe)
-       (drnk, drugs, eliza-flag, elizalst, famlst, feared, fears)
-       (feelings-about, foullst, found, hello, history, howareyoulst)
-       (howdyflag, huhlst, ibelieve, improve, inter, isee, isrelated)
-       (lincount, longhuhlst, lover, machlst, mathlst, maybe, moods)
-       (neglst, obj, object, owner, please, problems, qlist)
-       (random-adjective, relation, remlst, repetitive-shortness)
-       (replist, rms-flag, schoollst, sent, sexlst, shortbeclst)
-       (shortlst, something, sportslst, stallmanlst, states, subj)
-       (suicide-flag, sure, things, thlst, toklst, typos, verb, want)
-       (whatwhen, whereoutp, whysay, whywant, zippy-flag, zippylst):
-       Defvar at compile time.
-
-       * progmodes/ada-mode.el (ada-mode): Use `make-local-variable',
-       not `make-variable-buffer-local'.
-
-2005-08-02  Kim F. Storm  <storm@cua.dk>
-
-       * emulation/cua-rect.el (cua--highlight-rectangle): Only show
-       rectangle overlay in selected window.
-
-2005-08-01  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * cus-start.el (all): Put `indicate-empty-lines' in fringe group
-       instead of display group.  Make `indicate-buffer-boundaries'
-       customizable through Custom.
-
-2005-08-01  Juanma Barranquero  <lekktu@gmail.com>
-
-       * progmodes/gdb-ui.el (gdb-frame-address, gdb-var-changed)
-       (gdb-output-sink, gdba, gdb-cpp-define-alist-program)
-       (gdb-set-gud-minor-mode, gdb-exited, gdb-setup-windows)
-       (gdb-put-string): Fix typos in docstrings.
-
-2005-08-01  Nick Roberts  <nickrob@snap.net.nz>
-
-       Update copyright notices of files in progmodes directory for
-       release of Emacs 22.1.
-
-       * progmodes/gdb-ui.el (gdb-enable-debug-log): Add autoload cookie.
-
-       * progmodes/gud.el (gud-tooltip-mode): Add autoload cookie.
-       Don't barf if the GUD buffer has been killed.
-
-2005-08-01  Kim F. Storm  <storm@cua.dk>
-
-       * textmodes/table.el (table-yank-handler): Change defcustom to defvar.
-
-2005-07-29  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * simple.el (next-error-follow-minor-mode):
-       make-variable-buffer-local -> make-local-variable.
-
-       * emacs-lisp/cl-extra.el: Require CL also when compiling.
-
-       * emacs-lisp/bytecomp.el (byte-compile-make-variable-buffer-local)
-       (byte-compile-form-make-variable-buffer-local): New functions to warn
-       about misuses of make-variable-buffer-local where make-local-variable
-       was meant.
-
-2005-07-29  Juanma Barranquero  <lekktu@gmail.com>
-
-       * bs.el (bs-attributes-list): Doc fix.
-       (bs): Update url-link.
-
-       * desktop.el (desktop-save-buffer): Fix typos in docstring.
-       (desktop-load-default): Simplify.
-
-       * ibuffer.el (ibuffer-columnize-and-insert-list)
-       (ibuffer-mouse-toggle-mark, ibuffer-count-marked-lines)
-       (ibuffer-unmark-all, ibuffer-toggle-marks)
-       (ibuffer-unmark-forward, ibuffer-unmark-backward)
-       (ibuffer-compile-make-format-form, ibuffer-format-column)
-       (ibuffer-current-buffers-with-marks)
-       (ibuffer-update-title-and-summary): "?\ " -> "?\s".
-       (ibuffer): Doc fix.
-       (ibuffer-mode): Fix typo in docstring.
-       (ibuffer-hooks, ibuffer-mode-hooks): Make obsolete and declare
-       with `define-obsolete-variable-alias'.
-       (ibuffer-elide-long-columns): Mark as obsolete.  Doc fix.
-
-2005-07-29  Kenichi Handa  <handa@m17n.org>
-
-       * international/mule-cmds.el (select-message-coding-system):
-       Be sure to use LF for end-of-line.  If no coding system is decided,
-       return iso-8859-1-unix.
-
-2005-07-28  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * net/ange-ftp.el (ange-ftp-gateway-fatal-msgs)
-       (ange-ftp-pending-error-line): New vars.
-       (ange-ftp-process-handle-line, ange-ftp-process-filter): Use them
-       to handle the non-fatal no-route-to-host messages.
-       (internal-ange-ftp-mode): Make the no-match regexp more efficient.
-
-2005-07-28  Juanma Barranquero  <lekktu@gmail.com>
-
-       * isearch.el (isearch-mode-map, isearch-other-meta-char)
-       (isearch-quote-char, isearch-printing-char)
-       (isearch-text-char-description): "?\ " -> "?\s".
-       (isearch-lazy-highlight-cleanup)
-       (isearch-lazy-highlight-initial-delay)
-       (isearch-lazy-highlight-interval)
-       (isearch-lazy-highlight-max-at-a-time)
-       (isearch-lazy-highlight-face, isearch-lazy-highlight-cleanup):
-       Declare with define-obsolete-*-alias macros.
-       (isearch-forward): Fix typo in docstring.
-       (search-invisible, search-ring-yank-pointer)
-       (regexp-search-ring-yank-pointer): Doc fixes.
-
-       * recentf.el (recentf-menu-append-commands-p): Declare with
-       `define-obsolete-variable-alias'.
-       (recentf-max-saved-items, recentf-menu-filter)
-       (recentf-arrange-by-rule-subfilter): Doc fixes.
-       (recentf-menu-append-commands-flag)
-       (recentf-initialize-file-name-history, recentf-expand-file-name)
-       (recentf-clear-data): Fix typos in docstrings.
-
-2005-07-28  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el: Smarten comments.
-       (gdb-info-breakpoints-custom): Use nowarn when finding file.
-
-2005-07-27  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * term/apollo.el (terminal-init-apollo): New function containing
-       all former top level forms in the file.
-       * term/bobcat.el (terminal-init-bobcat):
-       * term/cygwin.el (terminal-init-cygwin):
-       * term/iris-ansi.el (terminal-init-iris-ansi):
-       * term/linux.el (terminal-init-linux):
-       * term/news.el (terminal-init-news):
-       * term/rxvt.el (terminal-init-rxvt):
-       * term/sun.el (terminal-init-sun):
-       * term/tvi970.el (terminal-init-tvi970):
-       * term/vt100.el (terminal-init-vt100):
-       * term/vt102.el (terminal-init-vt102):
-       * term/vt125.el (terminal-init-vt125):
-       * term/vt200.el (terminal-init-vt200):
-       * term/vt201.el (terminal-init-vt201):
-       * term/vt220.el (terminal-init-vt220):
-       * term/vt240.el (terminal-init-vt240):
-       * term/vt300.el (terminal-init-vt300):
-       * term/vt320.el (terminal-init-vt320):
-       * term/vt400.el (terminal-init-vt400):
-       * term/vt420.el (terminal-init-vt420):
-       * term/wyse50.el (terminal-init-wyse50):
-       * term/xterm.el (terminal-init-xterm): Likewise.
-
-       * term/README: Describe the terminal-init-* functionality.
-
-       * startup.el (command-line): After loading the terminal initialization
-       file call the corresponding terminal initialization function.
-
-2005-07-27  Kenichi Handa  <handa@m17n.org>
-
-       * ps-bdf.el (bdf-read-font-info): Ignore glyphs whose ENCODING is
-       negative.
-
-       * ps-mule.el (ps-mule-bitmap-prologue): Fix arguments to setcharwidth.
-       (ps-mule-composition-prologue): Fix for the case that
-       RelativeCompose is false.
-
-2005-07-26  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * smerge-mode.el (smerge-ediff): Use insert-buffer-substring.
-
-       * descr-text.el (describe-char): Handle the case where the list of
-       chars is displayed in a separate frame.
-       Be a bit more discriminating when looking for the char.
-
-2005-07-26  Juanma Barranquero  <lekktu@gmail.com>
-
-       * bookmark.el (bookmark-automatically-show-annotations)
-       (bookmark-read-annotation-text-func): Doc fixes.
-       (bookmark-save): Improve argument/docstring consistency.
-       (bookmark-get-bookmark, bookmark-get-bookmark-record)
-       (bookmark-alist-from-buffer)
-       (bookmark-upgrade-file-format-from-0)
-       (bookmark-grok-file-format-version)
-       (bookmark-maybe-upgrade-file-format, bookmark-kill-line)
-       (bookmark-read-annotation-mode)
-       (bookmark-insert-current-bookmark, bookmark-jump)
-       (bookmark-exit-hook): Fix typos in docstrings.
-       (bookmark-exit-hooks): Define as obsolete alias.
-       (bookmark-exit-hook-internal): Run `bookmark-exit-hook',
-       not `bookmark-exit-hooks'.  Fix docstring.
-       (bookmark-bmenu-select): "?\ " -> "?\s".
-
-2005-07-25  Ari Roponen  <arjuropo@cc.jyu.fi>  (tiny change)
-
-       * startup.el (command-line): Fix typo.
-
-2005-07-24  Richard M. Stallman  <rms@gnu.org>
-
-       * tooltip.el (tooltip-mode): Test emacs-basic-display,
-       not emacs-quick-startup.
-
-2005-07-24  Juanma Barranquero  <lekktu@gmail.com>
-
-       * emacs-lisp/re-builder.el (reb-with-current-window): Delete.
-       (reb-next-match, reb-show-subexp): Use `with-selected-window'
-       instead of `reb-with-current-window'.
-       (reb-prev-match): Likewise.  Also, don't move left if the search
-       was unsuccessful.
-       (reb-initialize-buffer): New function.
-       (re-builder, reb-change-syntax): Use it.
-
-       * man.el (Man-goto-page): Make second argument NOERROR optional.
-
-2005-07-23  Richard M. Stallman  <rms@gnu.org>
-
-       * man.el (Man-bgproc-sentinel): Check here for failure to find
-       any man page in the output, and report the error here.
-       (Man-arguments): Make it permanent local.
-       (Man-goto-page): New arg NOERROR.  Never kill the current buffer.
-       (Man-mode): Pass t for NOERROR.
-
-       * progmodes/grep.el (grep-error-face): Use font-lock-keyword-face.
-       (grep-mode-font-lock-keywords):
-       Don't use compilation-...-face for messages that are not file names.
-
-       * progmodes/compile.el (compilation-mode-font-lock-keywords):
-       Don't use compilation-...-face for messages that are not file names.
-
-2005-07-22  Juri Linkov  <juri@jurta.org>
-
-       * startup.el (normal-splash-screen): Update menu name.
-
-       * tempo.el (tempo-insert-template): Fix 2005-07-16 change.
-
-2005-07-22  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * term/xterm.el: Load term/rxvt if the terminal is actually an
-       rxvt terminal.
-       (xterm-rxvt-set-background-mode): Remove, not used anymore.
-
-       * term/rxvt.el (function-key-map): Use substitute-key-definition
-       to bind {C,S,C-S}-{f1-f10}.  Add a few missing key bindings.
-
-       * term/cygwin.el: New file.
-
-2005-07-22  Kim F. Storm  <storm@cua.dk>
-
-       * image-file.el (insert-image-file, image-file-yank-handler):
-       Fix last change to maintain a (unique) yank-handler on yanked images.
-
-2005-07-22  Eduardo Mu\e,Aq\e(Boz  <emufer@terra.es>  (tiny change)
-
-       * dired.el (dired-move-to-filename-regexp): Recognize the B suffix
-       of the file size (as in "177B" for 177 bytes).  This happens with
-       "ls -lh" on FreeBSD.
-
-2005-07-22  Juanma Barranquero  <lekktu@gmail.com>
-
-       * hilit-chg.el (highlight-changes-global-initial-state)
-       (highlight-compare-buffers, hilit-chg-turn-on-maybe)
-       (hilit-chg-fixup, highlight-changes-mode):
-       Fix typos in docstrings.
-       (highlight-changes-global-modes, highlight-changes-rotate-faces):
-       Doc fixes.
-
-2005-07-21  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * emacs-lisp/easy-mmode.el (define-minor-mode): Never call the
-       mode function using `eval-after-load'.
-
-2005-07-21  Kim F. Storm  <storm@cua.dk>
-
-       * mail/emacsbug.el (report-emacs-bug): Request that backtraces are
-       included when reporting an Emacs crash, and tell about the DEBUG file.
-
-       * image-file.el (insert-image-file): Add yank-handler.
-       (image-file-yank-handler): Yank handler to make unique copies of
-       images when they are yanked into a buffer next to each other.
-
-2005-07-21  Juanma Barranquero  <lekktu@gmail.com>
-
-       * comint.el (comint-use-prompt-regexp, comint-send-input)
-       (comint-source-default, comint-extract-string)
-       (comint-get-source, comint-word, comint-completion)
-       (comint-source, comint-prompt-read-only, comint-update-fence):
-       Fix typos in docstrings.
-       (comint-use-prompt-regexp-instead-of-fields, comint-kill-output):
-       Declare with define-obsolete-*-alias macros.
-       (comint-previous-matching-input-from-input)
-       (comint-next-matching-input-from-input)
-       (comint-previous-matching-input, comint-next-matching-input)
-       (comint-forward-matching-input):
-       Improve argument/docstring consistency.
-
-       * desktop.el (desktop-clear-preserve-buffers-regexp):
-       Also preserve the *server* buffer.
-
-       * simple.el (clone-indirect-buffer): Doc fix.
-       (fixup-whitespace, just-one-space)
-       (backward-delete-char-untabify, lambda): "?\ " -> "?\s".
-       (next-error, next-error-highlight)
-       (next-error-highlight-no-select, next-error-last-buffer)
-       (next-error-buffer-p, next-error-find-buffer, next-error)
-       (previous-error, next-error-no-select, previous-error-no-select)
-       (open-line, split-line, minibuffer-prompt-width, kill-new)
-       (binary-overwrite-mode): Fix typos in docstrings.
-       (set-fill-column): Fix typo in message.
-
-       * skeleton.el (skeleton-proxy-new): Doc fix.
-
-       * strokes.el (strokes-load-hook): Doc fix.
-       (strokes-grid-resolution, strokes-get-grid-position)
-       (strokes-renormalize-to-grid, strokes-read-stroke)
-       (strokes-read-complex-stroke, strokes-file, strokes-last-stroke)
-       (strokes-global-map): Fix typos in docstrings.
-       (strokes-help): Doc fix.  Fix help message and pass it through
-       `substitute-command-keys'.
-
-       * tempo.el (tempo-insert-prompt, tempo-interactive)
-       (tempo-show-completion-buffer, tempo-tags, tempo-match-finder)
-       (tempo-insert-string-functions, tempo-local-tags)
-       (tempo-define-template, tempo-insert-template)
-       (tempo-insert-prompt-compat, tempo-is-user-element)
-       (tempo-insert-mark, tempo-find-match-string, tempo-complete-tag):
-       Fix typos in docstrings.
-
-       * vcursor.el (vcursor-other-window, vcursor-bind-keys)
-       (vcursor-key-bindings, vcursor-use-vcursor-map)
-       (vcursor-find-window, vcursor-scroll-down)
-       (vcursor-disable, vcursor-beginning-of-buffer)
-       (vcursor-end-of-buffer): Fix typos in docstrings.
-       (vcursor-relative-move, vcursor-get-char-count):
-       Improve argument/docstring consistency.
-
-       * version.el: "?\ " -> "?\s".
-
-       * wid-edit.el (widget-default-create, widget-after-change)
-       (widget-default-format-handler, widget-checklist-add-item)
-       (widget-radio-add-item, widget-choose, widget-specify-secret)
-       (widget-field-value-create, widget-field-value-get)
-       (widget-editable-list-format-handler)
-       (widget-editable-list-entry-create, widget-group-value-create)
-       (widget-documentation-link-add)
-       (widget-documentation-string-value-create): "?\ " -> "?\s".
-       (widget-convert-text): Doc fix.
-       (widget-narrow-to-field, widget-field-find)
-       (widget-url-link-action, widget-emacs-library-link-action)
-       (widget-color-notify): Fix typos in docstrings.
-
-       * w32-fns.el (w32-shell-name): Use `bound-and-true-p'.
-       (x-select-text, set-w32-system-coding-system)
-       (w32-add-charset-info): Fix typos in docstrings.
-
-       * emulation/cua-base.el (cua-mode, cua-enable-register-prefix)
-       (cua-enable-cua-keys, cua-use-hyper-key)
-       (cua-virtual-rectangle-edges): Fix typos in docstrings.
-       (cua--M/H-key, cua--init-keymaps): "?\ " -> "?\s".
-
-       * net/tramp.el (tramp-handle-load): Fix typo in error message.
-
-       * emacs-lisp/re-builder.el (regexp-builder): Declare with
-       `defalias' instead of faking it.
-
-       * eshell/em-ls.el (eshell-ls-decorated-name): Doc fix.
-       (eshell-ls-missing, eshell-ls-dired-initial-args)
-       (eshell-ls-use-in-dired): Fix typos in docstrings.
-
-2005-07-20  Kim F. Storm  <storm@cua.dk>
-
-       * emulation/cua-base.el (cua-mode): Improve doc string.
-
-2005-07-20  Juanma Barranquero  <lekktu@gmail.com>
-
-       * abbrev.el (expand-region-abbrevs): Doc fix.
-       (inverse-add-mode-abbrev, inverse-add-global-abbrev):
-       Improve argument/docstring consistency.
-
-       * arc-mode.el (archive-get-descr, archive-alternate-display):
-       Doc fixes.
-       (archive-l-e): Improve argument/docstring consistency.
-       (archive-tmpdir, archive-unixdate, archive-unixtime)
-       (archive-chmod-entry): Fix typos in docstrings.
-       (archive-unflag, archive-unflag-backwards)
-       (archive-unmark-all-files): "?\ " -> "?\s".
-
-       * buff-menu.el (Buffer-menu-unmark): Doc fix.
-       (Buffer-menu-not-modified, Buffer-menu-execute)
-       (Buffer-menu-toggle-read-only, Buffer-menu-buffer+size)
-       (list-buffers-noselect, Buffer-menu-select): "?\ " -> "?\s".
-
-       * composite.el (compose-string, encode-composition-rule)
-       (compose-last-chars): Fix typos in docstrings.
-
-       * desktop.el (desktop-enable, desktop-basefilename):
-       Declare with `define-obsolete-variable-alias'.
-       (desktop-internal-v2s): Don't quote keywords.
-       (desktop-clear): "?\ " -> "?\s".
-
-       * dired.el (dired-align-file, dired-flag-backup-files)
-       (dired-change-marks, dired-unmark-all-files): "?\ " -> "?\s".
-       (dired-listing-switches, dired-ls-F-marks-symlinks)
-       (dired-dwim-target, dired-load-hook, dired-mode-hook)
-       (dired-directory, dired-faces, dired, dired-revert)
-       (dired-mode, dired-summary, dired-view-file)
-       (dired-copy-filename-as-kill, dired-delete-file)
-       (dired-no-confirm, dired-unmark-all-marks)
-       (dired-sort-by-date-regexp, dired-sort-by-name-regexp)
-       (dired-sort-inhibit, dired-sort-other): Fix typos in docstrings.
-       (dired-undo, dired-get-file-for-visit, dired-sort-toggle-or-edit):
-       Fix typos in message strings.
-
-       * dired-x.el (virtual-dired): Declare with `defalias'.
-       (dired-mark-unmarked-files, dired-local-variables-file)
-       (dired-omit-here-always): Doc fix.
-       (dired-omit-mode, dired-find-subdir)
-       (dired-enable-local-variables, dired-clean-up-buffers-too)
-       (dired-extra-startup, dired-mark-extension, dired-jump)
-       (dired-jump-other-window, dired-omit-localp, dired-virtual-mode)
-       (dired-smart-shell-command, dired-guess-shell-alist-user)
-       (dired-man, dired-initial-position, dired-x-hands-off-my-keys)
-       (dired-x-bind-find-file, dired-x-submit-report):
-       Fix typos in docstrings.
-       (dired-mark-unmarked-files): "?\ " -> "?\s".
-
-       * dirtrack.el (dirtrack-list): Fix typos in docstring.
-
-       * faces.el (describe-face): "?\ " -> "?\s".
-       (read-all-face-attributes, read-face-font, modify-face)
-       (face-attr-construct, italic): Fix typos in docstrings.
-       (frame-update-face-colors): Declare with
-       `define-obsolete-function-alias'.
-
-       * files.el (find-file-noselect, recode-file-name): Doc fixes.
-       (insert-directory, kill-some-buffers): "?\ " -> "?\s".
-       (magic-mode-alist, buffer-file-numbers-unique)
-       (write-file-functions, get-free-disk-space):
-       Fix typos in docstrings.
-       (find-file-not-found-hooks, find-file-hooks, write-file-hooks)
-       (write-contents-hooks, write-file-hooks):
-       Declare with `define-obsolete-variable-alias'.
-
-       * forms-d2.el (arch-rj): Fix typo in docstrings.
-       (arch-tocol): Likewise.  "?\ " -> "?\s".
-
-       * frame.el (set-frame-font, cursor-in-non-selected-windows):
-       Fix typo in docstring.
-       (set-screen-width, set-screen-height): Delete redundant info in
-       doctrings.
-       (new-frame, screen-height, screen-width): Declare with
-       `define-obsolete-function-alias'.
-       (delete-frame-hook, blink-cursor): Declare with
-       `define-obsolete-variable-alias'.
-
-       * paths.el (prune-directory-list): Fix typos in docstring.
-
-       * pcvs-util.el (cvs-flags-query, cvs-strings->string)
-       (cvs-prefix-get): Fix typos in docstrings.
-
-       * ps-print.el (ps-extend-face-list, ps-extend-face)
-       (ps-print-background-image): Fix typos in docstrings.
-       (ps-default-fg, ps-default-bg): Doc fixes.
-
-       * s-region.el (s-region-bind): Doc fix.
-       (s-region-move-p1, s-region-move-p2): Fix typos in docstrings.
-
-       * textmodes/org.el (org-table-formula-substitute-names)
-       (org-table-get-vertical-vector): Doc fixes.
-       (org-table-recalculate): Remove unused argument to `message'.
-
-2005-07-19  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-table-column-names)
-       (org-table-column-name-regexp)
-       (org-table-named-field-locations): New variables.
-       (org-archive-subtree): Protect `this-command' when calling
-       `org-copy-subtree' and `org-cut-subtree', to avoid appending to
-       the kill buffer.
-       (org-complete): Remove fixed-formula completion.
-       (org-edit-formulas-map): New variable.
-       (org-table-edit-formulas): New command.
-       (org-finish-edit-formulas, org-abort-edit-formulas)
-       (org-show-variable, org-table-get-vertical-vector): New functions.
-       (org-table-maybe-eval-formula): Handle `:=' fields.
-       (org-table-get-stored-formulas, org-table-store-formulas)
-       (org-table-get-formula, org-table-modify-formulas)
-       (org-table-replace-in-formulas): Handle named field formulas.
-       (org-table-get-specials): Store locations of named fields.
-
-2005-07-19  Juri Linkov  <juri@jurta.org>
-
-       * progmodes/grep.el (grep-regexp-alist)
-       (grep-mode-font-lock-keywords, grep-process-setup):
-       Use default GNU grep match color "01;31m" instead of "01;41m".
-       (grep-regexp-alist, grep-mode-font-lock-keywords):
-       Use `\\[[0-9]*m' instead of `\\[00m'.
-       (grep-regexp-alist): Move `\\(?:\033\\[K\\)?' from sgr_end to
-       sgr_start where its handling is more important.  Use the real
-       length of sgr_start instead of constant 8.
-       (grep-mode-font-lock-keywords): Don't delete `\\(?:\033\\[K\\)?'
-       specially.  Delete all remaining escape sequences.
-       (grep-process-setup): Set "GREP_COLORS" for GNU grep 2.5.1-cvs.
-       (grep-regexp-alist): Make hyperlink only for binary file name
-       instead of the whole line.
-       (grep-mode-map): Bind `backtab' to `compilation-previous-file'.
-       (grep-mode): Add autoload.
-
-       * emacs-lisp/find-func.el (find-function-regexp):
-       Add `define-compilation-mode'.
-
-2005-07-19  Juri Linkov  <juri@jurta.org>
-
-       * compare-w.el (compare-ignore-whitespace, compare-windows-sync)
-       (compare-windows-sync-string-size, compare-windows-recenter)
-       (compare-windows-highlight, compare-windows): Add version 22.1.
-       (compare-windows) <defface>: Inherit from lazy-highlight instead
-       of duplicating its default value.
-
-       * cus-edit.el (custom-mode-map): Bind `C-c C-c' to `Custom-set'.
-       (Custom-mode-menu): Use `info' instead of `Info-goto-node'.
-
-       * descr-text.el (describe-char): Create link buttons for `charset'
-       and `code point'.  Add the current input method name with a link
-       button to `to input' field.  Print face names of display table
-       characters in `The display table entry is displayed by' section
-       instead of printing face-id in the `display' field.
-       Guess hardcoded faces and create a link button for them.
-       Skip empty fields when calculating max-width.
-       Treat `widget-create' specially while inserting strings from the
-       collected field list.
-       (describe-char-after): Made obsolete in version 22.1, not 21.5.
-
-       * diff-mode.el (diff-file-header): Change foreground color from
-       yellow to green on light backgrounds.
-       (diff-context): Inherit from `shadow' only for color/grayscale
-       with more than 88 colors.
-       (diff-indicator-removed, diff-indicator-added)
-       (diff-indicator-changed): New faces.
-       (diff-font-lock-keywords): Use new faces.  Regroup rules.
-       Add "^---$" for `normal' diff format.  Fontify `#' lines with
-       font-lock-comment-delimiter-face and font-lock-comment-face.
-       Add `#' to ^[^...] in the rule for `diff-context-face'.
-
-       * faces.el (mode-line-highlight): Replace RoyalBlue4 with
-       a button-like box.  Inherit from `highlight' on low colors.
-       (shadow): Use shades of gray only for color/grayscale with
-       more than 88 colors.  Use green for light backgrounds with
-       8 colors, and yellow for dark backgrounds with 8 colors.
-
-       * font-lock.el (font-lock-regexp-grouping-backslash):
-       Don't inherit from escape-glyph (use bold for all cases).
-
-       * info.el (info-xref-visited): Use light foreground color `violet'
-       for dark backgrounds instead of dark color `magenta3'.
-       (info-title-1): Use `yellow' color for dark backgrounds.
-
-       * isearch.el (isearch): Use not-too-dark magenta3 instead of
-       too-light magenta2.
-
-       * replace.el (match): Use slightly more light RoyalBlue3 instead
-       of dark RoyalBlue4.
-
-       * wid-edit.el (widget-inactive): Inherit from `shadow'.
-
-2005-07-19  Juanma Barranquero  <lekktu@gmail.com>
-
-       * novice.el (disabled-command-hook): Declare it with
-       `define-obsolete-variable-alias'.
-
-       * desktop.el (desktop-enable, desktop-buffer-modes-to-save)
-       (desktop-buffer-misc-functions, desktop-buffer-handlers)
-       (desktop-load-default): Add release to obsolescence info.
-       (desktop-globals-to-clear, desktop-buffer-mode-handlers)
-       (desktop-append-buffer-args, desktop-read):
-       Fix typos in docstrings.
-       (desktop-kill): Fix typo in message.
-       (desktop-save): Doc fix.
-
-2005-07-19  Michael Kifer  <kifer@cs.stonybrook.edu>
-
-       * viper-cmd.el (viper-escape-to-state): Bug fix.
-       (viper-envelop-ESC-key): Change the definition of fast
-       keysequence so it'll work with keyboard macros.
-
-       * ediff.el (ediff-patch-buffer): Change the docstring.
-
-2005-07-19  Kenichi Handa  <handa@m17n.org>
-
-       * international/mule-cmds.el (select-safe-coding-system): Try to
-       use an auto-coding (if any) before anything else.  If the found
-       auto-coding is invalid, show a warning message.
-
-       * international/mule.el (find-auto-coding): New function created
-       by modifying the body of set-auto-coding.
-       (set-auto-coding): Use find-auto-coding to find a coding.
-
-2005-07-18  Richard M. Stallman  <rms@gnu.org>
-
-       * allout.el (allout-isearch-expose): Use isearch-mode-end-hook-quit,
-       not isearch-mode-end-hook-error.
-       (allout-before-change-protect): Fix error message.
-
-2005-07-18  Juri Linkov  <juri@jurta.org>
-
-       * allout.el (allout-mode):
-       * calculator.el (calculator-copy):
-       * custom.el (custom-known-themes):
-       * dired.el (dired-desktop-buffer-misc-data)
-       (dired-restore-desktop-buffer):
-       * dired-x.el (dired-omit-marker-char):
-       * files.el (basic-save-buffer):
-       * font-core.el (font-lock-mode):
-       * calendar/calendar.el (calendar-goto-hebrew-date)
-       (calendar-goto-coptic-date, calendar-goto-ethiopic-date)
-       (calendar-goto-persian-date):
-       * language/ethio-util.el (ethio-sera-to-fidel-region):
-       * textmodes/picture.el (picture-mode):
-       Delete duplicate duplicate words.
-
-2005-07-18  Juri Linkov  <juri@jurta.org>
-
-       * isearch.el (isearch-mode-map): Remove key bindings for regexp
-       chars * ? } |.
-       (isearch-fallback): Don't call `isearch-process-search-char'.
-       (isearch-*-char, isearch-}-char, isearch-|-char): Remove functions.
-       (isearch-process-search-char): Call `isearch-fallback' for regexp
-       chars * ? } |.
-       (isearch-return-char): Make obsolete with `make-obsolete' instead
-       of simply documenting it as obsolete in the docstring.
-       (isearch-fallback): Refill docstring.
-
-       * international/isearch-x.el
-       (isearch-process-search-multibyte-characters): Remove unneeded
-       `concat'.  Add intermediate values to `junk-hist' instead of
-       `minibuffer-history'.  Test the length of `str'.
-
-2005-07-18  Juanma Barranquero  <lekktu@gmail.com>
-
-       * allout.el (allout-resolve-xref): Fix typos in error strings.
-       (allout-before-change-protect): Remove unneeded `concat'.
-
-       * array.el (array-mode, array-reconfigure-rows)
-       (untabify-backward): Fix typos in docstrings.
-       (array-reconfigure-rows): Use `insert-buffer-substring', not
-       `insert-buffer'.
-
-       * calendar/icalendar.el (icalendar--get-unfolded-buffer):
-       * progmodes/ada-mode.el (ada-make-body):
-       Use `insert-buffer-substring' and `goto-char', not `insert-buffer'.
-
-       * dired.el (dired-log):
-       * tar-mode.el (tar-subfile-save-buffer):
-       * play/zone.el (zone-pgm-stress-destress):
-       Use `insert-buffer-substring', not `insert-buffer'.
-
-2005-07-17  Simon Josefsson  <jas@extundo.com>
-
-       * mail/smtpmail.el (smtpmail-auth-supported): Prefer PLAIN over LOGIN.
-
-2005-07-16  Jose E. Marchesi  <jemarch@gnu.org>
-
-       * lisp/mail/smtpmail.el (smtpmail-auth-supported):
-       Add plain auth method.
-       (smtpmail-try-auth-methods): Add AUTH PLAIN dialog.
-
-2005-07-17  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (dired-other-window): Add ido property.
-
-2005-07-16  Juanma Barranquero  <lekktu@gmail.com>
-
-       * emacs-lisp/bytecomp.el (byte-compile-maybe-guarded):
-       Fix typo in docstring.
-       (byte-compile-interactive-only-functions): Add `insert-buffer' and
-       `insert-file-literally'.
-
-       * emacs-lisp/edebug.el (def-edebug-form-spec): Add obsolescence
-       info and delete redundant message.  Doc fix.
-       (edebug-install-custom-print-funcs, edebug-reset-print-funcs)
-       (edebug-uninstall-custom-print-funcs): Define as obsolete aliases.
-
-2005-07-16  Richard M. Stallman  <rms@gnu.org>
-
-       * emacs-lisp/bytecomp.el (byte-compile-and-recursion): New function.
-       (byte-compile-and): Use byte-compile-and-recursion.
-       (byte-compile-or-recursion): New function.
-       (byte-compile-or): Use that.
-       (byte-compile-if): Guard the else-clause too.
-       (byte-compile-maybe-guarded): Handle (not (featurep 'emacs)).
-
-       * isearch.el (isearch-mode-end-hook-quit): New variable.
-       (isearch-done): Bind it.
-       (isearch-mode-end-hook): Doc fix.
-
-       * allout.el (allout-isearch-did-quit): Variable deleted.
-       (allout-real-isearch-abort): Function name no longer used.
-       (allout-mode): Do allout-enwrap-isearch whenever feature is wanted.
-       (allout-isearch-rectification): isearch-mode always exists.
-       Don't set allout-isearch-did-quit.
-       (allout-isearch-expose): Check isearch-mode-end-hook-error, not
-       allout-isearch-did-quit.
-       (allout-enwrap-isearch): Just add the hook.
-       (allout-isearch-abort): Function deleted.
-       (allout-pre-command-business): Avoid warning.
-
-       * progmodes/pascal.el (pascal-outline-map): Use fboundp, not boundp.
-       Correctly avoid warnings.
-       (pascal-outline): Likewise.
-
-       * progmodes/f90.el (f90-abbrev-start): Avoid warning.
-
-       * progmodes/asm-mode.el (asm-comment): Use with-no-warnings.
-
-       * play/tetris.el (tetris-mode): Avoid warning.
-
-       * play/snake.el (snake-mode): Avoid warning.
-
-       * play/gamegrid.el (gamegrid-shared-game-dir): Add defvar.
-       (gamegrid-set-display-table): Avoid warning.
-       (gamegrid-set-timer): Likewise.
-       (gamegrid-make-mono-tty-face): Use set-face-inverse-video-p.
-       (gamegrid-add-score-with-update-game-score-1): Take FILE
-       as argument.
-       (gamegrid-add-score-with-update-game-score): Pass that argument.
-       Rename have-shared-game-dir to gamegrid-shared-game-dir.
-
-       * net/eudc-hotlist.el (eudc-hotlist-mode): Avoid warnings.
-
-       * net/eudc-bob.el (eudc-jump-to-event): Avoid warning.
-       (eudc-bob-display-jpeg, eudc-bob-can-display-inline-images): Likewise.
-
-       * mail/uce.el (uce-reply-to-uce): Replace beginning-of-buffer
-       and insert-file.
-
-       * mail/supercite.el (sc-no-blank-line-or-header): Avoid warning.
-       (sc-ask): Avoid warnings.
-
-       * eshell/em-hist.el (eshell-rebind-keys-alist): Add defvar.
-       (eshell-hist-initialize): Use that var the natural way.
-
-       * emulation/viper-init.el (viper-activate-input-method): Avoid warning.
-
-       * emacs-lisp/re-builder.el (reb-cook-regexp):
-       Avoid warning calling lre-compile-string.
-       (reb-color-display-p): Avoid warning.
-
-       * calculator.el (calculator-last-input): Guard uses
-       of event-key and key-press-event-p.
-       (event-key, key-press-event-p): Delete definitions.
-
-       * emacs-lisp/find-gc.el (find-gc-unsafe-list)
-       (find-gc-source-directory, find-gc-subrs-callers)
-       (find-gc-noreturn-list, find-gc-source-files)
-       (find-gc-subrs-called): Vars renamed and defvar'd.
-
-       * emacs-lisp/checkdoc.el (checkdoc-make-overlay)
-       (checkdoc-overlay-put, checkdoc-delete-overlay)
-       (checkdoc-overlay-start, checkdoc-overlay-end)
-       (checkdoc-mode-line-update, checkdoc-char=):
-       Define such that compiler knows they are defined.
-       (checkdoc-call-eval-buffer): Delete.  Use eval-buffer directly.
-       (checkdoc-read-event): Delete.  Use read-event directly.
-
-       * whitespace.el (whitespace-make-overlay)
-       (whitespace-overlay-put, whitespace-delete-overlay)
-       (whitespace-overlay-start, whitespace-overlay-end):
-       Define such that compiler knows they are defined.
-       (whitespace): Move conditional inside.
-
-       * tempo.el (tempo-insert-template): Suppress warning.
-
-       * ediff-diff.el (longlines-mode): Add defvar.
-
-2005-07-16  Gary Howell  <g1howell-list@yahoo.com>  (tiny change)
-
-       * server.el: Bind "C-x #" in a way that works even if C-x is
-       redefined to a command key, not a prefix key.
-
-2005-07-16  Johan Bockg\e,Ae\e(Brd  <bojohan@users.sourceforge.net>  (tiny change)
-
-       * emacs-lisp/cl-macs.el (cl-make-type-test): Defer evaluation of
-       cl-make-type-test till execution time.
-
-2005-07-16  Markus Rost  <rost@math.uni-bielefeld.de>
-
-       * dired-x.el (dired-do-relsymlink-regexp): Add missing optional
-       arg ARG and use it.
-
-2005-07-16  Johan Bockg\e,Ae\e(Brd  <bojohan@users.sourceforge.net>  (tiny change)
-
-       * emacs-lisp/cl-macs.el (cl-make-type-test): Add `atom' type.
-
-2005-07-15  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * emacs-lisp/easy-mmode.el (define-minor-mode): Avoid constructing
-       a defcustom with two :set or :type keywords.
-
-2005-07-15  Richard M. Stallman  <rms@gnu.org>
-
-       * emacs-lisp/lisp-mode.el (emacs-lisp-mode-syntax-table):
-       Don't give ^M comment-end syntax.
-
-2005-07-16  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-var-update, gdb-var-update-handler):
-       Don't consider gdbmi (gdb-mi.el has its own update functions).
-       (gdb-var-delete): Make it work for gdbmi as well.
-       (gdb-speedbar-expand-node): Move var-update here for gdbmi.
-
-       * progmodes/gud.el (etags, sdb): Only require etags when needed.
-       (gud-speedbar-menu-items): Correct logic for enabling items.
-
-2005-07-15  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el: Fix commentary.
-       (ido-define-mode-map): Move ido-next-work-file to C-M-o.
-       Use with-no-warnings around ffap-guesser.
-       (ido-file-internal, ido-read-file-name, ido-read-directory-name):
-       Let bind minibuffer-completing-file-name to t.
-
-2005-07-15  Juanma Barranquero  <lekktu@gmail.com>
-
-       * startup.el (site-run-file, keyboard-type): Doc fixes.
-       (command-line): Check for "--basic-display" argument; also for
-       "--quick", not "--bare-bones" (which was renamed).
-       (fancy-splash-text): Add missing item "Getting New Versions".
-       (normal-splash-screen): Fix typos and improve consistency with
-       `fancy-splash-text'.  Update copyright year.
-
-       * hexl.el (hexl-mode-map): Recognize also `ehelp-command' as a
-       valid binding for `help-char'.
-
-       * emacs-lisp/derived.el (derived-mode-hook-name): Doc fix.
-
-2005-07-14  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * term.el (term-mode): Disable cua-mode for term buffers.
-
-2005-07-14  Juanma Barranquero  <lekktu@gmail.com>
-
-       * add-log.el (add-log-mailing-address, change-log-merge):
-       Doc fixes.
-       (change-log-get-method-definition): Fix typo in docstring.
-
-2005-07-14  Kim F. Storm  <storm@cua.dk>
-
-       * emulation/cua-base.el:
-       (cua--pre-command-handler-1, cua--pre-command-handler)
-       (cua--post-command-handler-1, cua--post-command-handler):
-       Split in two.  Check (buffer local) value of cua-mode.
-       (cua-selection-mode): New command.
-
-2005-07-13  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * custom.el (custom-initialize-safe-set)
-       (custom-initialize-safe-default): Doc fixes.
-
-       * frame.el (blink-cursor-mode): Use `custom-initialize-safe-default'
-       and simplify :init-value again.
-
-       * tooltip.el (tooltip-mode): Use `custom-initialize-safe-default'
-       and simplify :init-value again.  Delete autoload.
-
-       * startup.el (command-line): Use `custom-reevaluate-setting' again
-       for tooltip-mode.
-
-       * emacs-lisp/easy-mmode.el (define-minor-mode): Avoid constructing
-       a defcustom with two :initialize keywords.
-
-2005-07-13  Juanma Barranquero  <lekktu@gmail.com>
-
-       * allout.el (my-mark-marker, allout-isearch-prior-pos)
-       (allout-unprotected, allout-undo-aggregation, allout-snug-back)
-       (allout-post-command-business, allout-flag-region)
-       (isearch-reenable-font-lock, allout-yank)
-       (allout-insert-latex-header, allout-insert-latex-trailer)
-       (allout-latex-verbatim-quote-curr-line, allout-latexify-exposed)
-       (allout-latex-verb-quote): Fix typos in docstrings.
-       (allout-enwrap-isearch, regexp-sans-escapes): Doc fixes.
-       (allout-unprotected, allout-prefix-data):
-       Improve argument/docstring consistency.
-       (allout-chart-subtree): Fix argument spec.
-       (allout-open-topic): Rename `use_sib_bullet' argument to
-       `use-sib-bullet'.  Doc fix.
-
-       * whitespace.el (whitespace-check-buffer-leading)
-       (whitespace-check-buffer-trailing)
-       (whitespace-check-buffer-indent)
-       (whitespace-check-buffer-spacetab)
-       (whitespace-check-buffer-ateol, whitespace-highlighted-space)
-       (whitespace-check-leading-whitespace)
-       (whitespace-check-trailing-whitespace)
-       (whitespace-check-spacetab-whitespace)
-       (whitespace-check-indent-whitespace)
-       (whitespace-check-ateol-whitespace, whitespace-abort-on-error)
-       (whitespace-modes): Fix typos in docstrings.
-       (defgroup, defcustom): Doc fixes.
-
-       * winner.el (winner-mode, winner-boring-buffers)
-       (winner-pending-undo-ring): Doc fixes.
-       (winner-ring): Remove unneeded `progn'.
-       (winner-equal): `defsubst' it.
-       (winner-redo): Fix message.
-
-2005-07-13  Kim F. Storm  <storm@cua.dk>
-
-       * simple.el (line-move-1): Always use vertical-motion to
-       do the last (or only) line move to ensure some movement.
-       Undo 2005-06-23 change--don't check for overlays.
-
-2005-07-13  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el (ccl-encode-mac-roman-font)
-       (ccl-encode-mac-centraleurroman-font)
-       (ccl-encode-mac-cyrillic-font, ccl-encode-mac-symbol-font):
-       (ccl-encode-mac-dingbats-font): Remove check for ASCII.
-       Change charset-id boundary of dimension to ?\xef.
-       (mac-char-fontspec-list): New constant.
-       (fontset-add-mac-fonts): Use it.  Accept non-string `base-family'
-       argument.  Nil uses itself as family in font-spec.  Previous
-       behavior for nil is now provided by non-nil non-string argument.
-       All callers changed.  Add font-specs for Mac fonts to
-       "fontset-default" unless iso8859-1 fonts are installed.
-
-2005-07-13  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/sh-script.el (sh-get-indent-info): Only indent
-       a continuation line if the \ is preceded by SPC or TAB.
-       (sh-get-indent-info): Simplify.
-       (sh-mark-init, sh-learn-buffer-indent, sh-add-completer):
-       Use with-current-buffer.
-
-       * font-lock.el (font-lock-fontify-keywords-region): Avoid inf-loops
-       when the matched text is empty.
-
-2005-07-12  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * startup.el (command-line): Revert to previous handling of
-       tooltip-mode.  Explain in comment why the complexity is needed.
-
-       * tooltip.el (tooltip-mode): Revert to previous implementation of
-       its defcustom.
-
-       * frame.el (blink-cursor-mode): Revert to previous implementation
-       of its defcustom.  Update comment.
-
-2005-07-12  Lars Hansen  <larsh@soem.dk>
-
-       * desktop.el: Update e-mail address.
-
-2005-07-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el (mac-services-mail-selection)
-       (mac-services-mail-to): New functions.
-       (mac-application-menu-map): Bind them.
-
-2005-07-12  wulei  <milton@wulei.net>  (tiny change)
-
-       * progmodes/gdb-ui.el: Add note about buffering with Windows.
-
-2005-07-11  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * custom.el (custom-reevaluate-setting): Doc fix.
-
-2005-07-11  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc.el (calc-embedded-announce-formula-alist)
-       (calc-embedded-open-close-plain-alist)
-       (calc-embedded-open-close-mode-alist): Add checks for additional
-       major modes (due to Robert J. Chassell <bob@rattlesnake.com>).
-
-2005-07-11  Juanma Barranquero  <lekktu@gmail.com>
-
-       * custom.el (custom-enable-theme): Don't add theme to
-       `custom-enabled-themes' with `push' because there is no
-       setf-method for `delq'.
-
-2005-07-11  Richard M. Stallman  <rms@gnu.org>
-
-       * custom.el (custom-declare-variable): Doc fix.
-
-       * dired-aux.el (dired-compare-directories): Remove "." and ".."
-       from the alists.
-
-       * emacs-lisp/edebug.el (edebug-slow-after, edebug-slow-before):
-       Do nothing if edebug-active.
-
-       * emacs-lisp/edebug.el (edebug-enter): Don't with-timeout-suspend here.
-       (edebug-display): Do it here instead.
-
-2005-07-10  Richard M. Stallman  <rms@gnu.org>
-
-       * cus-face.el (custom-theme-set-faces): Make it work.
-       (custom-reset-faces): Doc fix.
-       (custom-theme-reset-internal-face, custom-theme-face-value):
-       Functions deleted.
-
-       * custom.el (custom-push-theme): Maintain list of the settings
-       of a given theme in its theme-settings property.
-       Maintain position of old settings in the theme-value
-       or theme-face property.
-       (custom-enabled-themes): New variable.
-       (custom-theme-enabled-p): New function.
-       (provide-theme): Update custom-enabled-themes.
-       Disable and reenable the `user' theme.
-       (require-theme): Doc fix.
-       (custom-do-theme-reset, custom-remove-theme): Functions deleted.
-       (custom-theme-value, custom-theme-variable-value): Likewise.
-       (custom-theme-reset-internal): Likewise.
-       (custom-theme-load-themes): Fix bugs and use custom-disable-theme.
-       (custom-enable-theme, custom-disable-theme): New functions.
-       (custom-variable-theme-value, custom-face-theme-value): Likewise.
-       (custom-theme-recalc-variable, custom-theme-recalc-face): Likewise.
-       (custom-theme-reset-variables): Simplify.
-       (deftheme, custom-declare-theme, custom-make-theme-feature):
-       Definitions moved.
-
-2005-07-10  Chong Yidong  <cyd@stupidchicken.com>
-
-       * longlines.el (longlines-show-region)
-       (longlines-unshow-hard-newlines): Recognize hard newlines by
-       non-nil hard property, instead of t.
-
-2005-07-10  Michael Kifer  <kifer@cs.stonybrook.edu>
-
-       * viper-cmd.el (viper--key-maps): New variable.
-       (viper-normalize-minor-mode-map-alist): Use viper--key-maps and
-       emulation-mode-map-alists.
-       (viper-envelop-ESC-key): Use viper-subseq.
-       (viper-search-forward/backward/next): Disable debug-on-error.
-
-       * viper-keym.el (viper-toggle-key, viper-quoted-insert-key)
-       (viper-ESC-key): New defcustoms.
-
-       * viper-macs.el (ex-map-read-args): Use viper-subseq.
-
-       * viper-util.el (viper-key-to-emacs-key): Use viper-subseq.
-       (viper-subseq): Copy of subseq from cl.el.
-
-       * viper.el (viper-go-away, viper-set-hooks): Use
-       emulation-mode-map-alists, advise self-insert-command, add-minor-mode.
-
-       * viper-mous.el (viper-current-frame-saved): Use defvar.
-
-       * viper-init.el: Get rid of -face in face names.
-
-       * ediff-diff.el (ediff-extract-diffs, ediff-extract-diffs3):
-       Make it work with longlines mode.
-
-       * ediff-mult.el (ediff-meta-mode-hook): New variable.
-
-       * ediff-ptch.el (ediff-file-name-sans-prefix): Quote regexp.
-
-       * ediff-init.el: Get rid of -face in face names.
-
-2005-07-10  Richard M. Stallman  <rms@gnu.org>
-
-       * emacs-lisp/edebug.el (edebug-enter): Call with-timeout-suspend
-       and with-timeout-unsuspend.
-
-       * emacs-lisp/debug.el (debug): Call with-timeout-suspend
-       and with-timeout-unsuspend.
-
-       * emacs-lisp/timer.el (with-timeout-timers): New variable.
-       (with-timeout): Bind that variable to record timers.
-       (with-timeout-suspend, with-timeout-unsuspend): New functions.
-
-       * emacs-lisp/debug.el (debug-help-follow): New function.
-       (debugger-mode-map): Use that instead of help-follow.
-       (debugger-setup-buffer): Use eval-buffer-list
-       to handle eval-buffer frames.
-
-2005-07-10  N. Raghavendra  <raghu@mri.ernet.in>  (tiny change)
-
-       * timezone.el (timezone-parse-date): Change first regexp
-       so it will not mistakenly match dates with no time zone.
-
-2005-07-10  Jeff Dwork  <jeff.dwork@amd.com>  (tiny change)
-
-       * facemenu.el (facemenu-read-color): Do case-insensitive matching.
-
-2005-07-10  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * custom.el (custom-initialize-safe-set)
-       (custom-initialize-safe-default): New functions.
-
-       * frame.el (blink-cursor-mode): Use `custom-initialize-safe-default'
-       and simplify :init-value.
-
-       * tooltip.el (tooltip-mode): Use `custom-initialize-safe-default'
-       and simplify :init-value.  Delete obsolete comment.
-
-       * startup.el (command-line): Use `custom-reevaluate-setting' to
-       handle `tooltip-mode'.  Delete obsolete comment.
-
-       * files.el (set-visited-file-name): Avoid calling
-       `file-name-nondirectory' with a nil argument.
-
-2005-07-09  Richard M. Stallman  <rms@gnu.org>
-
-       * emacs-lisp/debug.el (debugger-setup-buffer): When eval-buffer
-       was called with nil for the buffer, handle the read position right.
-       Handle read position for eval-region, too.
-
-2005-07-09  Juri Linkov  <juri@jurta.org>
-
-       * fringe.el (fringe-mode): Add period in docstring.
-       (fringe-query-style): Build prompt depending on `all-frames' arg.
-
-       * dired.el (dired-marker-char): Avoid quotations for `do' and `mark'
-       to not create links to unrelated functions in the Help buffer.
-
-       * progmodes/compile.el (compilation-mode-hook, compilation-mode):
-       Doc fix.
-
-       * simple.el (next-error-hook): New variable.
-       (next-error): Use it.  Doc fix.
-
-       * textmodes/ispell.el (ispell-command-loop): Add current
-       dictionary name and program name to mode-line-format.
-       (ispell-region, ispell-process-line): Add current dictionary name
-       and program name to messages.
-
-2005-07-08  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc.el (calc-embedded-announce-formula-alist)
-       (calc-embedded-open-close-formula-alist)
-       (calc-embedded-open-close-word-alist)
-       (calc-embedded-open-close-plain-alist)
-       (calc-embedded-open-close-new-formula-alist)
-       (calc-embedded-open-close-mode-alist)
-       (calc-embedded-new-buffer-hook, calc-embedded-new-formula-hook)
-       (calc-embedded-mode-hook): New variables.
-
-       * calc/calc-embed.el (calc-embedded-firsttime)
-       (calc-embedded-firsttime-buf, calc-embedded-firsttime-formula):
-       New variables.
-       (calc-do-embedded): Use calc-embedded-firsttime,
-       calc-embedded-firsttime-buf and calc-embedded-firsttime-formula to
-       determine whether or not to run hooks.
-       (calc-embedded-make-info): Set calc-embedded-firsttime-buf and
-       calc-embedded-firsttime-formula appropriately.
-       Set calc-embedded delimiter variables according to mode.
-
-2005-07-08  Richard M. Stallman  <rms@gnu.org>
-
-       * emacs-lisp/checkdoc.el (checkdoc-proper-noun-list):
-       Check for "emacs", etc., as entire symbol, not just as word.
-       (checkdoc-file-comments-engine): Use regexp-quote on FN.
-
-       * files.el (set-visited-file-name): Report the error
-       for "empty filename" earlier.
-       (kill-some-buffers): Ignore buffers already dead.
-
-       * fringe.el (fringe-mode): Doc fix.
-
-       * emacs-lisp/bytecomp.el (byte-compile-maybe-guarded):
-       Check for (featurep 'xemacs) and turn off warnings in what it guards.
-       Use unwind-protect to ensure byte-compile-unresolved-functions
-       is updated.
-
-       * whitespace.el (whitespace-buffer-leading-cleanup):
-       Simplify w/ skip-chars-forward.
-       (whitespace-buffer-trailing-cleanup): Simplify w/ skip-chars-backward.
-
-       * mail/rmail.el (rmail-only-expunge): Fix paren error.
-       Unconditionally try to leave point at the same old place.
-
-2005-07-08  Ralf Angeli  <angeli@iwi.uni-sb.de>  (tiny change)
-
-       * comint.el (comint-postoutput-scroll-to-bottom)
-       (comint-show-maximum-output): Take scroll-margin into consideration.
-
-2005-07-08  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-use-filename-at-point): New choice `guess'.
-       (ido-file-internal): Try ffap-guesser if selected.
-
-       * ido.el (ido-before-fallback-functions): New hook.
-       (ido-buffer-internal, ido-file-internal, ido-read-buffer)
-       (ido-read-file-name): Run it.
-
-2005-07-07  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/hideif.el (hide-ifdef-use-define-alist): Pass a list of
-       strings rather than a list of symbols to the completion function.
-
-2005-07-07  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-units.el (math-apply-units): Change the places in
-       which units are simplified.
-
-2005-07-07  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * cus-edit.el (customize-option, customize-option-other-window):
-       Make them handle aliases.
-
-       * custom.el (custom-variable-p): Make it recursively follow
-       aliases.  Mention that in the docstring.
-
-2005-07-07  Richard M. Stallman  <rms@gnu.org>
-
-       * cus-start.el (exec-path): Use `directory' instead of `file'.
-       Fix tag for nil.
-
-2005-07-07  Juanma Barranquero  <lekktu@gmail.com>
-
-       * replace.el (occur-rename-buffer): Use `generate-new-buffer' also
-       when called non-interactively.  Doc fix.
-
-2005-07-07  Lute Kamstra  <lute@gnu.org>
-
-       * elide-head.el (elide-head-headers-to-hide): Recognize the FSF's
-       new address as well.
-
-2005-07-07  Kenichi Handa  <handa@m17n.org>
-
-       * international/mule.el (make-coding-system):
-       Describe `ascii-incompatible' property in the docstring.
-       (set-file-name-coding-system): Signal an error if coding-system is
-       ascii-incompatible.
-       (set-keyboard-coding-system): Likewise.
-
-       * international/mule-cmds.el (set-default-coding-systems):
-       Don't set default-file-name-coding-system and
-       default-keyboard-coding-system if coding-system is ASCII-incompatible.
-
-       * international/utf-16.el: Declare that all UTF-16-based coding
-       systems are ASCII-incompatible.
-
-2005-07-07  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el: Require font-lock for displaying errors.
-       Used by gdb-ui.el.
-
-2005-07-07  Juanma Barranquero  <lekktu@gmail.com>
-
-       * hi-lock.el (hi-lock-find-patterns): Protect also against invalid
-       values for the pattern lists which are `read'able but not
-       `append'able (like symbols).
-
-2005-07-06  Richard M. Stallman  <rms@gnu.org>
-
-       * progmodes/flymake.el (flymake-float-time): Instead of
-       with-no-warnings, test for XEmacs.
-       (flymake-replace-regexp-in-string): Test fboundp of replace-in-string
-       to avoid warning.
-
-2005-07-06  Juanma Barranquero  <lekktu@gmail.com>
-
-       * w32-vars.el (w32-fixed-font-alist): Fix typo in `defcustom' tag.
-
-2005-07-05  Lute Kamstra  <lute@gnu.org>
-
-       * battery.el: Add support for Darwin (with much debugging help
-       from Samuel Lauber <sam124@operamail.com>).
-       (battery-status-function, battery-echo-area-format)
-       (battery-mode-line-format): Add support for pmset on Darwin.
-       (battery-load-low, battery-load-critical): New user options.
-       (battery-pmset): New function.
-
-2005-07-05  Lute Kamstra  <lute@gnu.org>
-
-       Update FSF's address in GPL notices.
-
-       * textmodes/page-ext.el: Update FSF's address.
-
-2005-07-04  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * emacs-lisp/lisp-mode.el (lisp-mode-variables): Prevent adaptive
-       filling from using prefix when filling a single-line docstring.
-
-       * progmodes/flymake.el: Remove useless eval-when-compile.
-
-       * arc-mode.el (archive-lzh-ogm): Reorder save excursion/restriction.
-
-2005-07-04  Richard M. Stallman  <rms@gnu.org>
-
-       * textmodes/org.el (org-file-apps-defaults-gnu):
-       Rename from org-file-apps-defaults-linux.
-       (org-default-apps): Don't test system-type for `linux'.
-       (org-file-apps): Doc fix.
-
-2005-07-04  David Ponce  <david@dponce.com>
-
-       * tree-widget.el: Improve header Commentary section.
-       (tree-widget) [defgroup]
-       (tree-widget-image-enable, tree-widget-themes-directory)
-       (tree-widget-theme, tree-widget-image-properties-emacs)
-       (tree-widget-image-properties-xemacs, tree-widget-create-image)
-       (tree-widget-image-formats, tree-widget-control)
-       (tree-widget-empty-control, tree-widget-leaf-control
-       (tree-widget-guide, tree-widget-end-guide, tree-widget-no-guide)
-       (tree-widget-handle, tree-widget-no-handle, tree-widget-p)
-       (tree-widget-keep, tree-widget-after-toggle-functions)
-       (tree-widget-open-node, tree-widget-close-node): Doc fix.
-       (tree-widget-open-control, tree-widget-close-control): Fix doc and
-       :help-echo message.
-       (tree-widget-set-theme): Doc fix.  Use `string-equal'.
-       (tree-widget-image-properties): Doc fix.  Clearer implementation.
-       (tree-widget--cursors): New constant.
-       (tree-widget-lookup-image): New function split from
-       `tree-widget-find-image'.  Clearer implementation.
-       (tree-widget-find-image): Use it.
-       (tree-widget-button-keymap): Use `set-keymap-parent'.
-       (tree-widget) [define-widget]: Use `widget-children-value-delete'.
-       Define the sub-widgets here.
-       (tree-widget-node): Check that :node is not a tree-widget.
-       (tree-widget-get-super, tree-widget-open-control)
-       (tree-widget-close-control, tree-widget-empty-control)
-       (tree-widget-leaf-control, tree-widget-guide)
-       (tree-widget-end-guide, tree-widget-no-guide, tree-widget-handle)
-       (tree-widget-no-handle, tree-widget-value-delete)
-       (tree-widget-map): Remove.
-       (tree-widget-children-value-save): Doc fix.  Simplified.
-       (tree-widget-value-create): Update according to previous changes.
-
-2005-07-04  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el: Leading space replaced by TABS.
-       (org-recalc-marks, org-table-rotate-recalc-marks)
-       (org-table-get-specials): Treat "^" and "_" marks.
-       (org-table-justify-field-maybe): Optional argument NEW.
-       (org-table-eval-formula): Parsing of the format simplified.
-       New modes C,I.  Honor the %= parameter in the current table.
-       Avoid unnecessary re-align by using the NEW argument to
-       `org-table-justify-field-maybe'.
-       (org-calc-default-modes): Default for date-format mimicks org-mode.
-       (org-agenda, org-timeline): Quote argument in org-agenda-redo-command.
-
-2005-07-03  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * cus-face.el (custom-theme-set-faces): Make it handle face
-       aliases whose alias declarations are pre- or autoloaded.
-
-2005-07-04  Juri Linkov  <juri@jurta.org>
-
-       * faces.el (read-face-name): Put the code for getting a face name
-       from the buffer before adding the faces from the `face' property.
-       Use `completing-read-multiple' instead of `completing-read'.
-       Require `crm'.  Add default value and post-process the returned
-       list of faces.
-
-       * emacs-lisp/crm.el (crm-find-current-element)
-       (crm-minibuffer-complete-and-exit): Handle minibuffer prompt.
-
-       * emacs-lisp/lisp-mode.el (eval-defun-1):
-       * emacs-lisp/edebug.el (edebug-eval-defun):
-       Remove unnecessary quotes.
-
-2005-07-04  Juanma Barranquero  <lekktu@gmail.com>
-
-       * progmodes/prolog.el (prolog-eof-string): Doc fixes.
-       (prolog-indent-level): Fix typo in docstring.
-
-       * info.el (Info-history, Info-history-forward)
-       (Info-history-list, Info-speedbar-fetch-file-nodes): Doc fixes.
-
-       * add-log.el (add-change-log-entry):
-       * comint.el (comint-dynamic-list-input-ring)
-       (comint-dynamic-list-completions):
-       * dabbrev.el (dabbrev-expand):
-       * delim-col.el (delimit-columns-rectangle-line):
-       * diff-mode.el (diff-context->unified, diff-reverse-direction)
-       (diff-unified->context):
-       * ediff-init.el (ediff-abbrev-jobname):
-       * ediff-mult.el (ediff-replace-session-status-in-meta-buffer)
-       (ediff-replace-session-activity-marker-in-meta-buffer):
-       * info.el (Info-summary):
-       * lpr.el (printify-region):
-       * printing.el (pr-create-interface):
-       * ps-print.el (ps-print-quote):
-       * ses.el (ses-column-widths, ses-print-cell)
-       (ses-adjust-print-width, ses-center):
-       * shell.el (shell-file-name-quote-list):
-       * strokes.el (strokes-read-stroke, strokes-read-complex-stroke)
-       (strokes-fill-current-buffer-with-whitespace)
-       (strokes-xpm-for-stroke, strokes-list-strokes)
-       (strokes-xpm-char-bit-p, strokes-xpm-for-compressed-string):
-       * term.el (term-dynamic-list-input-ring)
-       (term-dynamic-list-completions):
-       * calc/calc.el (math-format-stack-value):
-       * emacs-lisp/edebug.el (edebug-display-freq-count):
-       * progmodes/delphi.el (delphi-indent-line, delphi-fill-comment)
-       (delphi-new-comment-line):
-       * progmodes/ebnf2ps.el (ebnf-eps-filename, ebnf-trim-right):
-       * progmodes/executable.el (executable-set-magic):
-       * progmodes/python.el (inferior-python-mode):
-       * progmodes/scheme.el (scheme-mode-syntax-table):
-       * progmodes/sh-script.el (sh-maybe-here-document):
-       * progmodes/sql.el (sql-copy-column):
-       * progmodes/tcl.el (tcl-comment-indent, tcl-quote):
-       * textmodes/bibtex.el (bibtex-mode):
-       * textmodes/sgml-mode.el (html-imenu-index, sgml-attributes)
-       (sgml-auto-attributes):
-       * textmodes/table.el (table-insert, table-shorten-cell)
-       (table--generate-source-scan-lines, table-delete-row)
-       (*table--cell-delete-char, table--spacify-frame)
-       (table--horizontally-shift-above-and-below)
-       (table--cell-insert-char, table--cell-blank-str)
-       (table--fill-region-strictly):
-       * textmodes/tex-mode.el (tex-insert-quote, latex-find-indent):
-       * textmodes/texinfo.el (texinfo-insert-quote): "?\ " -> "?\s".
-
-       * add-log.el (change-log):
-       * apropos.el (apropos):
-       * comint.el (comint-completion, comint-source):
-       * dabbrev.el (dabbrev):
-       * delim-col.el (columns):
-       * diff-mode.el (diff-mode):
-       * ediff.el (ediff):
-       * ediff-diff.el (ediff-diff):
-       * ediff-init.el (ediff-highlighting, ediff-merge, ediff-hook):
-       * ediff-mult.el (ediff-mult):
-       * ediff-ptch.el (ediff-ptch):
-       * ediff-wind.el (ediff-window):
-       * facemenu.el (facemenu):
-       * indent.el (indent):
-       * info.el (info):
-       * jka-cmpr-hook.el (compression, jka-compr):
-       * lpr.el (lpr):
-       * outline.el (outlines):
-       * pcmpl-cvs.el (pcmpl-cvs):
-       * pcmpl-rpm.el (pcmpl-rpm):
-       * printing.el (printing):
-       * ps-print.el (postscript, ps-print, ps-print-horizontal)
-       (ps-print-vertical, ps-print-headers, ps-print-font)
-       (ps-print-color, ps-print-face, ps-print-n-up, ps-print-zebra)
-       (ps-print-background, ps-print-printer, ps-print-page)
-       (ps-print-miscellany):
-       * ses.el (ses):
-       * shell.el (shell, shell-directories, shell-faces):
-       * startup.el (initialization):
-       * strokes.el (strokes):
-       * term.el (term):
-       * uniquify.el (uniquify):
-       * w32-vars.el (w32):
-       * calc/calc.el (calc):
-       * emacs-lisp/bytecomp.el (bytecomp):
-       * emacs-lisp/cl-indent.el (lisp-indent):
-       * emacs-lisp/edebug.el (edebug):
-       * emacs-lisp/elp.el (elp):
-       * emacs-lisp/testcover.el (testcover):
-       * emacs-lisp/trace.el (trace):
-       * emulation/viper-ex.el (viper-ex):
-       * emulation/viper-mous.el (viper-mouse):
-       * mail/mailalias.el (mailalias):
-       * mail/supercite.el (supercite, supercite-frames)
-       (supercite-attr, supercite-cite, supercite-hooks):
-       * net/rcompile.el (remote-compile):
-       * net/rlogin.el (rlogin):
-       * obsolete/ooutline.el (outlines):
-       * progmodes/delphi.el (delphi):
-       * progmodes/ebnf2ps.el (postscript, ebnf2ps, ebnf-special)
-       (ebnf-except, ebnf-repeat, ebnf-terminal, ebnf-non-terminal)
-       (ebnf-production, ebnf-shape, ebnf-displacement, ebnf-syntactic)
-       (ebnf-optimization):
-       * progmodes/etags.el (etags):
-       * progmodes/executable.el (executable):
-       * progmodes/idlwave.el (idlwave):
-       * progmodes/pascal.el (pascal):
-       * progmodes/prolog.el (prolog):
-       * progmodes/python.el (python):
-       * progmodes/scheme.el (scheme):
-       * progmodes/sh-script.el (sh, sh-script):
-       * progmodes/sql.el (SQL):
-       * progmodes/tcl.el (tcl):
-       * textmodes/bibtex.el (bibtex, bibtex-autokey):
-       * textmodes/enriched.el (enriched):
-       * textmodes/makeinfo.el (makeinfo):
-       * textmodes/sgml-mode.el (sgml):
-       * textmodes/table.el (table-hooks):
-       * textmodes/tex-mode.el (tex-file, tex-run, tex-view):
-       * textmodes/texinfo.el (texinfo):
-       * textmodes/two-column.el (two-column):
-       Finish `defgroup' description with period.
-
-       * emacs-lisp/cl-indent.el (lisp-indent-maximum-backtracking):
-       * eshell/esh-var.el (eshell-var):
-       * progmodes/vhdl-mode.el (vhdl-testbench):
-       * textmodes/org.el (org): Fix typos in docstrings.
-
-       * emacs-lisp/timer.el (with-timeout): Improve argument/docstring
-       consistency.
-
-       * progmodes/flymake.el (flymake-find-file): Remove.
-       (flymake-float-time): Use `with-no-warnings'.
-       (flymake-check-start-time, flymake-check-was-interrupted)
-       (flymake-err-info, flymake-is-running, flymake-last-change-time)
-       (flymake-new-err-info): `defvar' at compile time.
-
-2005-07-03  Juanma Barranquero  <lekktu@gmail.com>
-
-       * replace.el (occur-hook): Doc fix.
-       (occur-1): Don't call `occur-hook' if there are no matches.
-
-2005-07-03  Richard M. Stallman  <rms@gnu.org>
-
-       * emulation/tpu-edt.el (tpu-original-global-map): Don't copy
-       global-map, save the same map.
-       (global-map): Don't alter it at top level.
-       (tpu-edt-on): Save global map in tpu-original-global-map, then copy.
-       Then alter it here instead.
-       (tpu-edt-off): Set global-map to the saved one.
-
-       * emulation/tpu-edt.el (tpu-emacs19-p): Var deleted.
-       All references simplified.
-       (tpu-lucid-emacs-p): Rename from tpu-lucid-emacs19-p.  Uses changed.
-       (zmacs-regions): Add defvar.
-       (repeat-complex-command-map): Everything about that deleted.
-
-       * textmodes/artist.el (artist-key-is-drawing)
-       (artist-key-endpoint1, artist-key-poly-point-list)
-       (artist-key-shape, artist-key-draw-how, artist-popup-menu-table)
-       (artist-key-compl-table, artist-rb-save-data)
-       (artist-arrow-point-1, artist-arrow-point-2): Move defvars up.
-       Don't put them in eval-when-compile.
-       (artist-set-arrow-points-for-poly): Use `last', not `artist-last'.
-
-       * progmodes/ebrowse.el (ebrowse-revert-tree-buffer-from-file):
-       Use with-no-warnings.
-
-       * net/browse-url.el (dos-windows-version): Add defvar.
-
-       * mail/supercite.el (filladapt-prefix-table): Add defvar.
-
-       * mail/rmailsum.el (rmail-summary-redo): Add defvar.
-       (rmail-summary-mode-map, rmail-summary-overlay): Defvars moved up.
-       (rmail-new-summary-line-count): Rename from new-summary-line-count.
-       Add defvar.
-       (rmail-summary-beginning-of-message): Use with-no-warnings.
-       (rmail-summary-first-message, rmail-summary-last-message): Likewise.
-
-       * emulation/vip.el (vip-replace-string, ex-map, ex-read):
-       Use with-no-warnings.
-
-       * emulation/vi.el (vi-mark-region): Use c-mark-function.
-       (c-mark-function): Add point-moving-unit property.
-       (vi-goto-line): Use with-no-warnings.
-
-       * emulation/edt.el (edt-last-copied-word): Add defvar.
-       (zmacs-region-stays): Likewise.
-       (edt-mark-section-wisely): Use c-mark-function for C.
-       Use makr-defun for Fortran.
-       (time-string): defvar deleted.
-       (edt-display-the-time): Don't set time-string.
-
-       * emacs-lisp/macroexp.el (macroexp-accumulate): Rename arg to var+list.
-
-       * emacs-lisp/bytecomp.el (byte-compile-nogroup-warn):
-       Don't warn when name is not constant
-       or for defining the group `emacs'.
-
-       * tooltip.el (gud-tooltip-mode): Add defvar.
-
-       * startup.el (default-frame-background-mode): Add defvar.
-
-       * smerge-mode.el (smerge-mode): Add duplicate defvar near top.
-
-       * info.el (tool-bar-map): Add defvar.
-
-       * dired.el (dnd-protocol-alist): Add defvar.
-
-       * dired-aux.el (dired-query): Display question with answer, when
-       the user answers.
-
-       * custom.el (custom-add-option): Doc fix.
-
-       * bookmark.el (Info-current-node, Info-suffix-list): Add defvars.
-
-2005-07-03  Eli Zaretskii  <eliz@gnu.org>
-
-       * font-lock.el (font-lock-regexp-grouping-construct): Fix the
-       bogus name from the last change.
-
-2005-07-02  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * custom.el (custom-declare-variable): Fix typos in comment.
-       (custom-known-themes): Doc fix.
-       (custom-theme-directory): New defcustom.
-       (require-theme): Make it check `custom-theme-directory'.
-
-       * cus-theme.el (custom-new-theme-mode): New function.
-       (custom-theme-name, custom-theme-variables, custom-theme-faces)
-       (custom-theme-description): Add compiler defvars.
-       (customize-create-theme): Add doc to the "*New Custom Theme*"
-       buffer.  Use `custom-new-theme-mode'.
-       (custom-theme-write): Put the created buffer in emacs-lisp-mode
-       and save it to the `custom-theme-directory'.  Make this the
-       default directory of the buffer.
-
-2005-07-02  David Hunter  <hunterd_42@comcast.net>  (tiny change)
-
-       * progmodes/flymake.el (flymake-mode, flymake-mode-off):
-       Fix unbalanced parentheses.
-
-2005-07-02  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/flymake.el (flymake-mode-on, flymake-mode-off): Move body
-       into flymake-mode and delegate to flymake-mode.
-
-       * find-file.el (ff-which-function-are-we-in): Clean up.
-
-2005-07-02  Juanma Barranquero  <lekktu@gmail.com>
-
-       * replace.el (occur-rename-buffer): Fix docstring.
-
-       * emulation/edt.el (*EDT-keys*, edt-default-global-map)
-       (edt-last-copied-word, edt-learn-macro-count)
-       (edt-orig-page-delimiter, edt-orig-transient-mark-mode)
-       (edt-rect-start-point, edt-user-global-map, rect-start-point)
-       (time-string, zmacs-region-stays):
-       * emulation/edt-mapper.el (edt-save-function-key-map)
-       (EDT-key-name): `defvar' to silence the byte-compiler.
-
-2005-07-02  Martin Rudalics  <rudalics@gmx.at>
-
-       * font-lock.el (font-lock-regexp-grouping-backslash): Rename from
-       font-lock-regexp-backslash.  Doc fix.
-       (font-lock-regexp-backslash-grouping-construct): Rename from
-       font-lock-regexp-backslash-construct.  Doc fix.
-       (lisp-font-lock-keywords-2): Fix highlighting of Elisp regexp
-       grouping constructs.
-
-2005-07-02  Eli Zaretskii  <eliz@gnu.org>
-
-       * makefile.w32-in (bootstrap): Remove the $(EMACS) binary after
-       updating all the prerequisites.
-
-2005-07-01  Juanma Barranquero  <lekktu@gmail.com>
-
-       * textmodes/org.el (org-agenda-start-on-weekday)
-       (org-calendar-to-agenda-key, org-agenda-sorting-strategy)
-       (org-agenda-use-time-grid, org-archive-location)
-       (org-allow-space-in-links, org-usenet-links-prefer-google)
-       (org-enable-table-editor, org-export-default-language)
-       (org-export-html-show-new-buffer, org-fill-paragraph)
-       (org-cycle, org-goto-ret, org-goto-left, org-goto-right)
-       (org-goto-quit, org-occur, org-eval-in-calendar)
-       (org-agenda-cleanup-fancy-diary, org-agenda-no-heading-message)
-       (org-agenda-diary-entry, org-remember-help)
-       (org-table-convert-region, org-at-table-p)
-       (org-table-move-row-down, org-table-move-row-up)
-       (org-table-copy-region, org-table-toggle-vline-visibility)
-       (org-table-get-stored-formulas, org-table-get-specials)
-       (org-recalc-commands, org-table-eval-formula)
-       (org-table-formula-substitute-names, orgtbl-make-binding)
-       (org-format-org-table-html, org-format-table-table-html)
-       (org-format-table-table-html-using-table-generate-source)
-       (org-customize): Fix typos in docstrings.
-       (org-level-2, org-at-timestamp-p, org-agenda-day-view)
-       (org-agenda-toggle-diary, org-agenda-toggle-time-grid)
-       (org-back-to-heading): Doc fixes.
-       (org-agenda-toggle-time-grid, org-cmp-category, org-cmp-time)
-       (org-agenda-change-all-lines, org-get-header):
-       Improve argument/docstring consistency.
-       (orgtbl-error): Fix error message.
-
-       * progmodes/flymake.el (flymake-find-possible-master-files)
-       (flymake-master-file-compare, flymake-get-line-err-count)
-       (flymake-highlight-line, flymake-gui-warnings-enabled):
-       Fix typos in docstrings.
-       (flymake-parse-line, flymake-get-project-include-dirs-function)
-       (flymake-get-prev-err-line-no, flymake-goto-prev-error):
-       Doc fixes.
-       (flymake-get-project-include-dirs-function)
-       (flymake-make-err-menu-data):
-       Improve argument/docstring consistency.
-
-2005-07-01  Lute Kamstra  <lute@gnu.org>
-
-       * battery.el (battery-linux-proc-apm): Fix typo in docstring.
-       Catch errors with ignore-errors.  Use temporary buffer.
-       (battery-linux-proc-acpi): Fix typo in docstring.  Document `%r'.
-
-       * facemenu.el (facemenu-unlisted-faces): Delete foreground and
-       background color faces.
-       (facemenu-set-foreground, facemenu-set-background):
-       Use facemenu-set-face-from-menu.
-       (facemenu-set-face-from-menu): Treat face names that start with
-       "fg:" or "bg:" as special.
-       (facemenu-add-new-color): Don't create faces.  Simplify.
-
-2005-06-30  Richard M. Stallman  <rms@gnu.org>
-
-       * emacs-lisp/crm.el (crm-do-completion): Handle minibuffer prompt.
-       (crm-find-current-element): Likewise.
-
-2005-06-30  Johan Bockg\e,Ae\e(Brd  <bojohan@users.sourceforge.net>
-
-       * help-fns.el (help-do-arg-highlight): Regexp-quote argument names.
-
-2005-06-30  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * arc-mode.el (archive-extract): Make it work as a mouse binding.
-       (archive-mouse-extract): Make it an obsolete alias.
-       (archive-mode-map): Don't use archive-mouse-extract any more.
-       (archive-mode, archive-extract): write-contents-hooks ->
-       write-contents-functions.
-       (archive-arc-rename-entry, archive-lzh-rename-entry): Remove unused
-       first arg.
-       (archive-rename-entry): Update the call.
-       (archive-zip-summarize): Remove unused var `method'.
-       (archive-lzh-summarize): Remove unused var `creator'.
-
-       * emacs-lisp/debug.el (debug): Quieten Drew Adams by killing the
-       dedicated frame upon exit.
-
-       * arc-mode.el: Bind inhibit-read-only rather than buffer-read-only.
-       (archive-zip-extract, archive-zip-expunge)
-       (archive-zip-update, archive-zip-update-case): Use executable-find.
-       (archive-resummarize, archive-flag-deleted, archive-unmark-all-files):
-       Use restore-buffer-modified-p.
-       (archive-extract, archive-add-new-member, archive-write-file-member):
-       Use with-current-buffer.
-       (archive-lzh-ogm, archive-zip-chmod-entry): Use dolist.
-
-2005-06-30  Andreas Schwab  <schwab@suse.de>
-
-       * progmodes/gud.el (gud-filter): Remove unneeded progn.
-
-2005-06-30  Glenn Morris  <gmorris@ast.cam.ac.uk>
-
-       * progmodes/sh-script.el (sh-get-kw): `&' also separates words.
-
-2005-06-30  Juri Linkov  <juri@jurta.org>
-
-       * faces.el (vertical-border): Inherit from mode-line-inactive
-       only on tty.
-
-2005-06-30  Juanma Barranquero  <lekktu@gmail.com>
-
-       * help-fns.el (help-do-arg-highlight): Highlight also -ARG (for
-       example, -NLINES in the `occur' docstring).
-
-       * replace.el (occur-1): When no matches are found, do not set the
-       `buffer-read-only' and modified flags for the occur buffer,
-       because it is deleted.
-
-       * emulation/cua-base.el (cua-check-pending-input)
-       (cua-repeat-replace-region, cua-mode, cua-debug)
-       (cua-auto-tabify-rectangles, cua-inhibit-cua-keys):
-       Fix typos in docstrings.
-
-       * emulation/cua-gmrk.el (cua-toggle-global-mark)
-       (cua-cut-region-to-global-mark)
-       (cua--cut-rectangle-to-global-mark):
-       Remove period from end of messages.
-
-       * emulation/cua-rect.el (cua-do-rectangle-padding):
-       Remove period from end of messages.
-       (cua--rectangle-seq-format): Fix typo in docstring.
-       (cua-sequence-rectangle, cua-fill-char-rectangle):
-       Improve argument/docstring consistency.
-
-2005-06-29  Juri Linkov  <juri@jurta.org>
-
-       * faces.el (default-frame-background-mode): New internal variable.
-       (frame-set-background-mode): Use it.
-
-       * startup.el (normal-top-level): Set default-frame-background-mode
-       instead of frame-background-mode.  Before setting it, test for its
-       nil value.  Remove tests for frame-background-mode and frame
-       parameter `reverse'.  Add test for "unspecified-fg".
-
-       * term/xterm.el (xterm-rxvt-set-background-mode):
-       * term/rxvt.el (rxvt-set-background-mode):
-       Set default-frame-background-mode instead of frame-background-mode.
-
-2005-06-29  Juanma Barranquero  <lekktu@gmail.com>
-
-       * simple.el (set-variable): Warn about obsolete user variables.
-
-       * imenu.el (imenu--completion-buffer):
-       * mouse.el (mouse-buffer-menu-alist):
-       * msb.el (msb-invisible-buffer-p):
-       * calendar/diary-lib.el (diary-header-line-format):
-       * emacs-lisp/pp.el (pp-buffer):
-       * progmodes/cperl-mode.el (cperl-do-auto-fill):
-       * textmodes/picture.el (picture-replace-match):
-       Change space constants followed by a sexp to "?\s ".
-
-       * play/decipher.el (decipher-loop-with-breaks):
-       * textmodes/texinfo.el (texinfo-insert-@item): Change space
-       constants "protected" from end of line by a comment to "?\s".
-
-2005-06-29  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * font-lock.el (save-buffer-state): Use `declare'.
-
-       * progmodes/cperl-mode.el (cperl-find-pods-heres): Don't gratuitously
-       reset the syntax-table to cperl-mode-syntax-table.
-       (cperl-mode): Make _ into word-syntax during font-locking so "print" in
-       "foo_print_bar" is not matched as a reserved keyword.
-
-2005-06-29  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (orgtbl-setup): New function, for delayed
-       setup for the orgtbl commands.
-       (org-calc-default-modes): New option.
-       (orgtbl-make-binding): Use `defun' to get better help display.
-       (org-diary): Call `org-compile-prefix-format'.
-       (org-table-formula-substitute-names): New function.
-       (org-agenda-day-view, org-agenda-week-view): New commands.
-       (org-agenda-toggle-week-view): Command removed.
-       (org-tbl-menu): Split off from org-org-menu.
-       (org-mode): Move removal of outline-mode menus to here.
-       (org-table-formula-debug): New option.
-       (org-table-insert-row): Keep first field if just "#" or "*".
-       (org-mode): Paragraph regexps fixed.
-       (org-table-recalculate-regexp): New constant.
-       (org-table-justify-field-maybe): Avoid replace if not necessary.
-       (org-copy-special, org-cut-special): Use `call-interactively'.
-       (org-table-copy-region): Take region from `interactive' call.
-       (org-trim): Return string even if no match.
-       (org-formula): New face.
-       (org-set-font-lock-defaults): No longer highlight "FIXME".
-       But highlight formula-related fields in table.
-       (org-table-p): Use regexp, not fontification.
-       (org-table-align): Handle white space at end of line.
-       (org-table-formula-evaluate-inline): New option.
-       (org-mode): Auto-wrapping in comment lines turned off.
-       (org-table-copy-down): Evaluate only in copied field, not in
-       destination.
-       (org-table-current-formula): Variable removed.
-       (org-table-store-formulas, org-table-get-stored-formulas)
-       (org-table-modify-formulas, org-table-replace-in-formulas)
-       (org-table-maybe-eval-formula): New functions.
-       (org-table-get-formula): Modify to use stored formulas.
-       (org-table-insert-column, org-table-delete-column)
-       (org-table-move-column): Call `org-table-modify-formulas'.
-       (org-complete): Add completion for keyword formulas.
-       (orgtbl-mode): Pull orgtbl-mode-map to start of
-       minor-mode-map-alist.
-
-2005-06-29  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/python.el (python-check): Require `compile' before
-       modifying its variables.
-
-       * newcomment.el (comment-indent-default): Don't get fooled by an early
-       end of buffer.
-
-2005-06-28  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
-
-       * ps-print.el (ps-print-version): Fix version number.
-
-2005-06-28  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * textmodes/ispell.el (ispell-word): Remove stray parenthesis.
-
-2005-06-28  Richard M. Stallman  <rms@gnu.org>
-
-       * textmodes/flyspell.el (flyspell-use-local-map): Variable deleted.
-       (flyspell-local-mouse-map): Declaration deleted.
-       (flyspell-mouse-map): Bind only mouse-2.
-       (flyspell-mode-map): Don't test flyspell-use-local-map.
-       (flyspell-overlay-keymap-property-name): Var deleted.
-       (flyspell-mode-on): Don't make local bindings for
-       flyspell-mouse-map and flyspell-mode-map.
-       (make-flyspell-overlay): Unconditionally put on `keymap' text prop.
-
-       * textmodes/ispell.el (ispell-word): Do not ignore short words.
-
-       * progmodes/compile.el (compilation-next-error-function):
-       Don't switch buffers; operate on the current buffer.
-
-       * progmodes/compile.el (compilation-error-file-name)
-       (compilation-warning-file-name, compilation-info-file-name)
-       (compilation-line-number, compilation-column-number): New faces.
-       (compilation-error-face, compilation-warning-face)
-       (compilation-info-face, compilation-line-face)
-       (compilation-column-face): Use them.
-
-       * facemenu.el (facemenu-add-face): Warn when font-lock is active.
-
-       * comint.el (comint-password-prompt-regexp): Accept ", try again".
-
-       * bindings.el (global-map): Bind insertchar and its variants.
-
-2005-06-27  Richard M. Stallman  <rms@gnu.org>
-
-       * textmodes/artist.el (artist-text-overwrite)
-       (artist-figlet-get-extra-args, artist-text-see-thru): Use read-string.
-
-2005-06-27  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
-
-       * ps-print.el: It was not working the page selection for printing.
-       Reported by Sebastian Tennant <sebyte@smolny.plus.com>.
-       (ps-print-version): New version 6.6.7.
-       (ps-end-sheet): New fun.
-       (ps-header-sheet, ps-end-job): Call it.
-
-2005-06-27  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * subr.el (add-to-list, add-to-ordered-list): Doc fixes.
-
-2005-06-27  Lute Kamstra  <lute@gnu.org>
-
-       * facemenu.el (facemenu-unlisted-faces): Add foreground and
-       background color faces.
-       (facemenu-get-face): Delete function.
-       (facemenu-set-face-from-menu): Don't call facemenu-get-face.
-       (facemenu-add-new-color): Make second argument mandatory.
-       Create the appropriate face and return it.  Simplify.
-       (facemenu-set-foreground, facemenu-set-background): Don't check if
-       color is defined.  Use return value of facemenu-add-new-color.
-
-2005-06-26  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-filter): Add missing argument to
-       with-selected-window.
-
-2005-06-26  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * emacs-lisp/easy-mmode.el (define-minor-mode): Don't automatically add
-       a :require to the defcustom.
-
-       * emacs-lisp/autoload.el (make-autoload): Add the :setter for
-       defcustoms corresponding to minor modes.
-
-2005-06-26  David Ponce  <david@dponce.com>
-
-       * recentf.el: Require tree-widget instead of wid-edit.
-       (recentf-filename-handler): Fix widget :type.
-       (recentf-cancel-dialog, recentf-open-more-files)
-       (recentf-open-files-action): Doc fix.
-       (recentf-dialog-goto-first): New function.
-       (recentf-dialog-mode-map): Set parent keymap first.
-       (recentf-dialog-mode): Define with define-derived-mode.
-       Don't display continuation lines in dialogs.
-       (recentf-edit-list): Rename from recentf-edit-selected-items.
-       (recentf-edit-list-select): Rename from recentf-edit-list-action.
-       Simplify.
-       (recentf-edit-list-validate): New function.
-       (recentf-edit-list): Update accordingly.
-       (recentf-open-files-item-shift): Remove.
-       (recentf-open-files-item): Convert menu elements into tree and
-       link widgets.  Don't create the widgets.
-       (recentf-open-files): Update accordingly.
-       (recentf-save-list): Untabify.
-
-2005-06-25  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * replace.el (keep-lines-read-args): Add INTERACTIVE arg.
-       (keep-lines): Add INTERACTIVE arg.  Never delete lines only
-       partially contained in the active region.  Do not take active
-       region into account when called from Lisp, unless INTERACTIVE arg
-       is non-nil.  Use `forward-line' instead of `beginning-of-line' to
-       avoid trouble with fields.  Make marker point nowhere when no
-       longer used.  Always return nil.  Doc fix.
-       (flush-lines): Add INTERACTIVE arg.  Do not take active region
-       into account when called from Lisp, unless INTERACTIVE arg is
-       non-nil.  Use `forward-line' instead of `beginning-of-line' to
-       avoid trouble with fields.  Make marker point nowhere when no
-       longer used.  Always return nil.  Doc fix.
-       (how-many): Add INTERACTIVE arg.  Make RSTART and REND args
-       interchangeable.  Do not take active region into account when
-       called from Lisp, unless INTERACTIVE arg is non-nil.  Do not print
-       message in echo area when called from Lisp, unless INTERACTIVE arg
-       is non-nil.  Avoid saying "1 occurrences".  Do not use markers.
-       Return the number of matches.  Doc fix.
-       (occur): Doc fix.
-       (perform-replace): Make comment follow double space convention for
-       the sake of `outline-minor-mode'.
-
-       * faces.el (facep): Doc fix.
-
-2005-06-25  Richard M. Stallman  <rms@gnu.org>
-
-       * facemenu.el (facemenu-enable-faces-p): New function.
-       (facemenu-background-menu, facemenu-foreground-menu)
-       (facemenu-face-menu): Add menu-enable property.
-
-       * jka-compr.el (jka-compr-insert-file-contents):
-       Special handling if cannot find the uncompression program.
-
-       * cus-face.el (custom-face-attributes): Add autoload.
-
-       * emacs-lisp/lisp-mode.el (lisp-mode-variables):
-       Bind comment-indent-function locally.
-
-       * window.el (save-selected-window): Use save-current-buffer.
-
-       * subr.el (with-selected-window): Use save-current-buffer.
-
-       * progmodes/gud.el (gud-filter): Simplify using with-selected-window
-       and with-current-buffer.
-
-2005-06-24  Richard M. Stallman  <rms@gnu.org>
-
-       * simple.el (line-move-1): Fix previous change.
-
-2005-06-24  Juanma Barranquero  <lekktu@gmail.com>
-
-       * replace.el (occur-1): Set `buffer-read-only' and the
-       buffer-modified flag before running `occur-hook' to protect
-       against unintentional buffer switches that can lead to data loss.
-
-2005-06-24  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-tooltip-print-command): Indent properly.
-       (gud-gdb-marker-filter): Use font-lock-warning-face for any
-       initial error.
-
-       * progmodes/gdb-ui.el (gdb-send): Remove warning face from errors
-       after fresh input.
-       (gdb-var-create-handler): Put name of expression in quotes.
-
-2005-06-23  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * emacs-lisp/ring.el (ring-elements): Make it return a list of the
-       elements of RING in order, and without bogus nil elements.
-
-2005-06-23  Richard M. Stallman  <rms@gnu.org>
-
-       * simple.el (set-variable): Args renamed; doc fix.
-       (line-move-1): When there are overlays around, use vertical-motion.
-
-       * faces.el (escape-glyph): Use brown against light background.
-       (nobreak-space): Rename from no-break-space.
-       Fix previous change.
-
-       * dired-aux.el (dired-do-copy): Fix arg prompt.
-
-       * mail/sendmail.el (mail-setup-with-from): Fix custom type.
-
-2005-06-23  Glenn Morris  <gmorris@ast.cam.ac.uk>
-
-       * mail/emacsbug.el (report-emacs-bug): Use "X server distributor"
-       rather than "Distributor".
-
-2005-06-23  Lute Kamstra  <lute@gnu.org>
-
-       * emacs-lisp/debug.el (debugger-special-form-p): New defun.
-       (debug-on-entry): Use it.  New interactive declaration that uses
-       function-called-at-point.
-
-2005-06-23  Kim F. Storm  <storm@cua.dk>
-
-       * subr.el (save-match-data): Add comment about using evaporate arg
-       to set-match-data.
-
-2005-06-22  Glenn Morris  <gmorris@ast.cam.ac.uk>
-
-       * cus-edit.el (customize-face)
-       (customize-face-other-window): Handle face aliases.
-
-       * faces.el (face-documentation, set-face-attribute)
-       (face-spec-set): Handle face aliases.
-
-2005-06-22  Juanma Barranquero  <lekktu@gmail.com>
-
-       * help-mode.el (help-make-xrefs): If a symbol representing a face
-       name is not followed by the word "face", it could still be a
-       function or variable name, so don't bypass other checks.
-
-2005-06-22  Juri Linkov  <juri@jurta.org>
-
-       * ps-print.el (ps-face-foreground-name, ps-face-background-name):
-       Replace aliased functions with calls where second arg `inherit' is t.
-
-2005-06-22  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-error): New variable.
-       (gdb-error): New function.
-       (gdb-annotation-rules): Act on error-begin and error annotations.
-       (gdb-concat-output): Use font-lock-warning-face for errors.
-
-2005-06-22  Miles Bader  <miles@gnu.org>
-
-       * bindings.el (propertized-buffer-identification): Use renamed
-       `Buffer-menu-buffer' face.
-
-       * faces.el (vertical-border): Rename from `vertical-divider'.
-       (escape-glyph): Change dark-background color back to `cyan'.
-
-2005-06-21  Juri Linkov  <juri@jurta.org>
-
-       * faces.el (face-user-default-spec): Try getting `customized-face'
-       prior to `saved-face'.
-       (frame-background-mode): Refill docstring.
-
-       * emacs-lisp/lisp-mode.el (eval-defun-1):
-       * emacs-lisp/edebug.el (edebug-eval-defun):
-       Set `saved-face' temporarily to nil before calling form.
-       Set `customized-face' to the new spec after that.
-
-2005-06-21  Juanma Barranquero  <lekktu@gmail.com>
-
-       * subr.el (1value, lambda, key-substitution-in-progress):
-       Doc fixes.
-
-       * autoinsert.el (auto-insert-alist):
-       * ses.el (ses-call-printer):
-       * subr.el (noreturn):
-       * emacs-lisp/lisp.el (check-parens):
-       * emacs-lisp/byte-opt.el (byte-optimize-pure-func):
-       * net/browse-url.el (browse-url-mosaic):
-       * progmodes/cc-defs.el (c-safe-scan-lists):
-       * progmodes/ebnf-abn.el (ebnf-abn-lex):
-       * progmodes/ebnf-bnf.el (ebnf-bnf-lex):
-       * progmodes/ebnf-dtd.el (ebnf-dtd-lex):
-       * progmodes/ebnf-ebx.el (ebnf-ebx-lex):
-       * progmodes/ebnf-iso.el (ebnf-iso-lex):
-       * progmodes/ebnf-yac.el (ebnf-yac-lex): Fix spellings.
-
-2005-06-21  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * pcvs-defs.el (cvs-menu): Add cvs-mode-mark and cvs-mode-unmark.
-
-2005-06-21  Glenn Morris  <gmorris@ast.cam.ac.uk>
-
-       * calendar/appt.el (appt-make-list): Activate the package, if
-       not already active (for backwards compatibility).
-
-2005-06-20  Kim F. Storm  <storm@cua.dk>
-
-       * subr.el (add-to-ordered-list): Test membership with eq.  Simplify.
-
-2005-06-20  Miles Bader  <miles@gnu.org>
-
-       * faces.el (vertical-divider): New face.
-
-2005-06-20  Juanma Barranquero  <lekktu@gmail.com>
-
-       * simple.el (kill-whole-line): Doc fix.
-       (next-error-buffer-p, next-error-find-buffer)
-       (clone-indirect-buffer): Fix typos in docstrings.
-       (comment-line-break-function): Doc fix: don't say variable
-       is automatically buffer-local (it isn't).
-
-2005-06-19  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/tramp-ftp.el (top):
-       * net/tramp-smb.el (top):
-       * net/tramp-util.el (top):
-       * net/tramp-uu.el (top):
-       * net/tramp-vc.el (top):
-       * net/tramp.el (top): Revert copyright years back to original
-       ones.  Tramp has a life outside GNU Emacs.
-
-2005-06-19  Nick Roberts  <nickrob@snap.net.nz>
-
-       * tooltip.el (tooltip-use-echo-area): Don't make it obsolete.
-
-2005-06-18  Juri Linkov  <juri@jurta.org>
-
-       * progmodes/grep.el (grep-regexp-alist): Use backreference at the
-       end of first regexp to limit the match to the position between
-       line number and source line with same separator character as used
-       between file name and line number.  In the second regexp limit
-       mouse-face area to file name and line number by adding new group
-       for them and referring it in HYPERLINK arg.
-       (grep-regexp-alist, grep-mode-font-lock-keywords): Use shy group.
-       (grep-mode): Set font-lock-lines-before to 0 to not refontify the
-       previous line where grep markers may be already removed.
-
-2005-06-18  Peter Kleiweg  <p.c.j.kleiweg@rug.nl>
-
-       * progmodes/ps-mode.el: Update version and maintainer's email address.
-
-2005-06-18  Steve Youngs  <steve@xemacs.org>
-
-       * net/browse-url.el (browse-url-browser-function)
-       (browse-url-default-browser): Add firefox.
-       (browse-url-firefox-program, browse-url-firefox-arguments)
-       (browse-url-firefox-startup-arguments)
-       (browse-url-firefox-new-window-is-tab): New defcustoms.
-       (browse-url-firefox, browse-url-firefox-sentinel): New functions.
-
-2005-06-17  Richard M. Stallman  <rms@gnu.org>
-
-       * startup.el (command-line): Warn if specified user name has
-       no home directory.
-
-       * term.el (term-get-old-input, term-input-filter, term-input-sender)
-       (term-mode-hook, term-exec-hook, term-escape-char): Doc fixes.
-
-       * longlines.el (longlines-mode, longlines-show-hard-newlines):
-       Doc fixes.
-
-       * faces.el (underline): Try bold if terminal doesn't support underline.
-
-       * mail/sendmail.el (mail-setup-with-from): New variable.
-       (mail-insert-from-field): New function.
-       (sendmail-send-it): Call it.
-       (mail-setup): Optionally call it here.
-
-       * term/linux.el: Call tty-no-underline.
-
-2005-06-17  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * emacs-lisp/edebug.el (edebug-goto-here): Doc fix.
-
-2005-06-17  Miles Bader  <miles@gnu.org>
-
-       * ediff-init.el (ediff-current-diff-A, ediff-current-diff-B)
-       (ediff-current-diff-C, ediff-current-diff-Ancestor)
-       (ediff-fine-diff-A, ediff-fine-diff-B, ediff-fine-diff-C)
-       (ediff-fine-diff-Ancestor, ediff-even-diff-A, ediff-even-diff-B)
-       (ediff-even-diff-C, ediff-even-diff-Ancestor, ediff-odd-diff-A)
-       (ediff-odd-diff-B, ediff-odd-diff-C, ediff-odd-diff-Ancestor):
-       Remove "-face" suffix from face names.
-       (ediff-current-diff-face-A, ediff-current-diff-face-B)
-       (ediff-current-diff-face-C, ediff-current-diff-face-Ancestor)
-       (ediff-fine-diff-face-A, ediff-fine-diff-face-B)
-       (ediff-fine-diff-face-C, ediff-fine-diff-face-Ancestor)
-       (ediff-even-diff-face-A, ediff-even-diff-face-B)
-       (ediff-even-diff-face-C, ediff-even-diff-face-Ancestor)
-       (ediff-odd-diff-face-A, ediff-odd-diff-face-B)
-       (ediff-odd-diff-face-C, ediff-odd-diff-face-Ancestor):
-       New backward-compatibility aliases for renamed faces.
-       (ediff-current-diff-face-A, ediff-current-diff-face-B)
-       (ediff-current-diff-face-C, ediff-current-diff-face-Ancestor)
-       (ediff-fine-diff-face-A, ediff-fine-diff-face-B)
-       (ediff-fine-diff-face-C, ediff-fine-diff-face-Ancestor)
-       (ediff-even-diff-face-A, ediff-even-diff-face-B)
-       (ediff-even-diff-face-C, ediff-even-diff-face-Ancestor)
-       (ediff-odd-diff-face-A, ediff-odd-diff-face-B)
-       (ediff-odd-diff-face-C, ediff-odd-diff-face-Ancestor):
-       Use renamed ediff faces.
-
-       * eshell/esh-test.el (eshell-test-ok, eshell-test-failed):
-       Remove "-face" suffix from face names.
-       (eshell-test-ok-face, eshell-test-failed-face):
-       New backward-compatibility aliases for renamed faces.
-       (eshell-run-test): Use renamed eshell-test faces.
-
-       * eshell/em-prompt.el (eshell-prompt): Remove "-face" suffix from
-       face name.
-       (eshell-prompt-face): New backward-compatibility alias for renamed
-       face.
-       (eshell-emit-prompt): Use renamed eshell-prompt face.
-
-       * eshell/em-ls.el (eshell-ls-directory, eshell-ls-symlink)
-       (eshell-ls-executable, eshell-ls-readonly, eshell-ls-unreadable)
-       (eshell-ls-special, eshell-ls-missing, eshell-ls-archive)
-       (eshell-ls-backup, eshell-ls-product, eshell-ls-clutter):
-       Remove "-face" suffix from face names.
-       (eshell-ls-directory-face, eshell-ls-symlink-face)
-       (eshell-ls-executable-face, eshell-ls-readonly-face)
-       (eshell-ls-unreadable-face, eshell-ls-special-face)
-       (eshell-ls-missing-face, eshell-ls-archive-face)
-       (eshell-ls-backup-face, eshell-ls-product-face)
-       (eshell-ls-clutter-face):
-       New backward-compatibility aliases for renamed faces.
-       (eshell-ls-decorated-name): Use renamed eshell-ls faces.
-
-       * progmodes/cc-fonts.el (c-nonbreakable-space-face):
-       Remove "-face" suffix from face name.
-       (c-cpp-matchers): Use the variable `c-nonbreakable-space-face'
-       instead of literal face.
-
-2005-06-17  Juanma Barranquero  <lekktu@gmail.com>
-
-       * emacs-lisp/warnings.el (display-warning, lwarn)
-       (warning-minimum-log-level): Doc fixes.
-       (warning-minimum-level, warning-minimum-log-level):
-       Add :debug to :type choices.
-
-       * progmodes/ada-mode.el (ada-format-paramlist)
-       (ada-get-indent-case, ada-check-matching-start)
-       (ada-check-defun-name, ada-goto-matching-decl-start)
-       (ada-goto-matching-start, ada-goto-matching-end, ada-tab)
-       (ada-untab, ada-move-to-start, ada-fill-comment-paragraph)
-       (ada-make-subprogram-body): Follow error conventions.
-       (ada-case-exception-file, ada-indent-comment-as-code)
-       (ada-indent-handle-comment-special, ada-indent-renames)
-       (ada-indent-return, ada-search-directories-internal)
-       (ada-tab-policy, ada-case-exception-substring)
-       (ada-other-file-alist, ada-matching-start-re)
-       (ada-matching-decl-start-re, ada-contextual-menu-last-point)
-       (ada-imenu-generic-expression, ada-compile-goto-error)
-       (ada-in-comment-p, ada-in-string-p, ada-in-string-or-comment-p)
-       (ada-popup-menu, ada-add-extensions, ada-mode)
-       (ada-region-selected, ada-create-case-exception)
-       (ada-create-case-exception-substring, ada-after-keyword-p)
-       (ada-activate-keys-for-case, ada-adjust-case-region)
-       (ada-adjust-case-buffer, ada-format-paramlist)
-       (ada-scan-paramlist, ada-insert-paramlist)
-       (ada-indent-newline-indent)
-       (ada-indent-newline-indent-conditional)
-       (ada-justified-indent-current, ada-goto-previous-word)
-       (ada-indent-current, ada-get-indent-open-paren)
-       (ada-get-indent-paramlist, ada-get-indent-end)
-       (ada-get-indent-case, ada-get-indent-when, ada-get-indent-if)
-       (ada-get-indent-block-start, ada-get-indent-subprog)
-       (ada-get-indent-noindent, ada-get-indent-label)
-       (ada-get-indent-loop, ada-get-indent-type, ada-goto-stmt-start)
-       (ada-search-prev-end-stmt, ada-goto-next-non-ws)
-       (ada-goto-stmt-end, ada-goto-next-word)
-       (ada-check-matching-start, ada-check-defun-name)
-       (ada-goto-matching-decl-start, ada-goto-matching-start)
-       (ada-goto-matching-end, ada-search-ignore-string-comment)
-       (ada-in-decl-p, ada-looking-at-semi-or)
-       (ada-looking-at-semi-private, ada-in-paramlist-p)
-       (ada-in-open-paren-p, ada-tab, ada-indent-current-function)
-       (ada-untab-hard, ada-move-to-start, ada-move-to-end)
-       (ada-next-procedure, ada-previous-procedure, ada-next-package)
-       (ada-previous-package, ada-create-menu)
-       (ada-fill-comment-paragraph-justify)
-       (ada-fill-comment-paragraph-postfix, ada-fill-comment-paragraph)
-       (ada-other-file-name, ada-last-which-function-line)
-       (ada-last-which-function-subprog, ada-which-function)
-       (ada-get-body-name, ada-outline-level, ada-narrow-to-defun)
-       (ada-gen-treat-proc, ada-check-emacs-version)
-       (ada-continuation-indent, ada-align-region-separate):
-       Fix typos in docstrings.
-       (ada-adjust-case, ada-adjust-case-interactive): Doc fixes.
-
-2005-06-16  Lute Kamstra  <lute@gnu.org>
-
-       * simple.el (fundamental-mode): Run after-change-major-mode-hook
-       conditionally.
-
-2005-06-16  Juanma Barranquero  <lekktu@gmail.com>
-
-       * comint.el (comint-replace-by-expanded-filename)
-       (comint-prompt-regexp, comint-delimiter-argument-list)
-       (comint-preinput-scroll-to-bottom):
-       * info.el (Info-hide-cookies-node):
-       * ls-lisp.el (ls-lisp-classify):
-       * find-file.el (ff-search-directories, ff-special-constructs)
-       (ff-find-other-file):
-       * font-lock.el (font-lock-keywords):
-       * shell.el (shell-prompt-pattern)
-       (shell-dynamic-complete-functions, shell-mode)
-       (shell-delimiter-argument-list):
-       * term.el (term-replace-by-expanded-filename)
-       (term-prompt-regexp, term-delimiter-argument-list):
-       * woman.el (woman-ignore, woman0-if):
-       * emacs-lisp/derived.el (derived-mode-init-mode-variables):
-       * emacs-lisp/elint.el (elint-init-env):
-       * emacs-lisp/regexp-opt.el (regexp-opt-depth):
-       * eshell/esh-mode.el (eshell-preinput-scroll-to-bottom):
-       * language/ethio-util.el (ethio-tilde-escape)
-       (ethio-use-three-dot-question):
-       * net/zone-mode.el (zone-mode-load-time-setup):
-       * progmodes/cc-align.el (c-lineup-argcont):
-       * progmodes/cc-awk.el (c-awk-beginning-of-defun):
-       * progmodes/cperl-mode.el (cperl-set-style-back):
-       * progmodes/inf-lisp.el (inferior-lisp-prompt):
-       * progmodes/vhdl-mode.el (vhdl-beginning-of-libunit):
-       Fix spellings in docstrings.
-
-       * textmodes/sgml-mode.el (sgml-calculate-indent, html-tag-help):
-       * progmodes/modula2.el (m2-for): Fix spellings.
-
-       * menu-bar.el (menu-bar-games-menu): Fix typo in menu help string.
-
-       * simple.el (undo-more): Don't use `format' on `error' arguments.
-       Improve argument/docstring consistency.
-       (pending-undo-list): Doc fix.
-
-       * smerge-mode.el (smerge-ensure-match):
-       * emulation/vip.el (vip-ex):
-       * net/zone-mode.el (zone-mode-update-serial):
-       * progmodes/idlwave.el (idlwave-complete):
-       * progmodes/vhdl-mode.el (vhdl-visit-file)
-       (vhdl-compose-wire-components):
-       Don't use `format' on `error' arguments.
-
-       * tooltip.el (tooltip-start-delayed-tip, tooltip-timeout)
-       (tooltip-use-echo-area, tooltip-process-prompt-regexp)
-       (tooltip-help-tips): Fix typos in docstrings.
-
-2005-06-16  David Ponce  <david@dponce.com>
-
-       * tree-widget.el (tree-widget-value-create): Simplify last change.
-
-2005-06-15  Matt Hodges  <MPHodges@member.fsf.org>
-
-       * ido.el (ido-incomplete-regexp): New variable.
-       (ido-set-matches-1): Handle invalid-regexp error and set
-       ido-incomplete-regexp.
-       (ido-incomplete-regexp): New face.
-       (ido-completions): Use it.
-       (ido-complete, ido-exit-minibuffer, ido-completions):
-       Handle incomplete regexps.
-       (ido-completions): Add check for complete match when entering a regexp.
-
-2005-06-15  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * subr.el (add-to-ordered-list): Use a weak hash-table to avoid leaks.
-
-2005-06-15  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
-
-       * textmodes/bibtex.el (bibtex-Preamble): Enclose BibTeX preamble
-       by field delimiters.
-
-2005-06-15  David Ponce  <david@dponce.com>
-
-       * tree-widget.el: eval-and-compile inlined functions so they will
-       be available at run-time too.
-       (tree-widget-super-format-handler)
-       (tree-widget-format-handler): Remove.
-       (tree-widget-value-create): Handle the :indent property.
-
-2005-06-15  Miles Bader  <miles@gnu.org>
-
-       * progmodes/which-func.el (which-func): Only inherit
-       `font-lock-function-name-face' when that makes sense against the
-       default mode-line face, otherwise set the face color explicitly.
-
-       * progmodes/cperl-mode.el (cperl-init-faces): Use literal cperl
-       faces instead of (non-existent) variables.
-
-2005-06-14  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * iswitchb.el (iswitchb-to-end): Replace mapcar with dolist.
-       (iswitchb-get-matched-buffers): Likewise.  Simplify.
-
-2005-06-14  Miles Bader  <miles@gnu.org>
-
-       * progmodes/ld-script.el (ld-script-location-counter):
-       Remove "-face" suffix from face name.
-       (ld-script-location-counter-face):
-       New backward-compatibility alias for renamed face.
-       (ld-script-location-counter-face): Use renamed face.
-
-       * progmodes/cperl-mode.el (cperl-nonoverridable, cperl-array)
-       (cperl-hash): Remove "-face" suffix from face names.
-       (cperl-nonoverridable-face, cperl-array-face, cperl-hash-face):
-       New backward-compatibility aliases for renamed faces.
-       (cperl-find-pods-heres, cperl-init-faces, cperl-ps-print-init)
-       (cperl-ps-print-face-properties): Use renamed cperl-mode faces.
-
-       * progmodes/which-func.el (which-func): Remove "-face" suffix from face
-       name.
-       (which-func-face): New backward-compatibility alias for renamed face.
-       (which-func-format): Use renamed which-func face.
-
-       * progmodes/vhdl-mode.el (vhdl-prompt, vhdl-attribute, vhdl-enumvalue)
-       (vhdl-function, vhdl-directive, vhdl-reserved-word)
-       (vhdl-translate-off): Remove "-face" suffix and "font-lock-" from face
-       names.
-       (vhdl-speedbar-entity, vhdl-speedbar-architecture)
-       (vhdl-speedbar-configuration, vhdl-speedbar-package)
-       (vhdl-speedbar-library, vhdl-speedbar-instantiation)
-       (vhdl-speedbar-subprogram, vhdl-speedbar-entity-selected)
-       (vhdl-speedbar-architecture-selected)
-       (vhdl-speedbar-configuration-selected)
-       (vhdl-speedbar-package-selected)
-       (vhdl-speedbar-instantiation-selected): Remove "-face" suffix from face
-       names.
-       (vhdl-font-lock-keywords-2, vhdl-font-lock-keywords-5):
-       Use renamed faces.
-       (vhdl-prompt-face, vhdl-attribute-face, vhdl-enumvalue-face)
-       (vhdl-function-face, vhdl-directive-face, vhdl-reserved-words-face)
-       (vhdl-translate-off-face): Variables renamed to remove "font-lock-".
-       Use renamed faces.
-       (syntax-alist): Don't use "font-lock-" or "-face" in generated face
-       names.
-       (vhdl-font-lock-init, vhdl-ps-print-settings): Use renamed faces.
-       (vhdl-speedbar-insert-hierarchy, vhdl-speedbar-expand-entity)
-       (vhdl-speedbar-expand-package, vhdl-speedbar-update-current-unit)
-       (vhdl-speedbar-make-inst-line, vhdl-speedbar-make-pack-line)
-       (vhdl-speedbar-make-subpack-line, vhdl-speedbar-make-subprogram-line)
-       (vhdl-speedbar-item-info, vhdl-speedbar-check-unit): Use renamed faces.
-
-       * progmodes/sh-script.el (sh-heredoc): Remove "-face" suffix from
-       face name.
-       (sh-heredoc-face): New backward-compatibility alias for renamed face.
-       (sh-heredoc-face): Use renamed sh-heredoc face.
-
-       * progmodes/idlw-help.el (idlwave-help-link):
-       Remove "-face" suffix from face name.
-       (idlwave-help-link-face):
-       New backward-compatibility alias for renamed face.
-       (idlwave-highlight-linked-completions): Use renamed idlwave-help faces.
-
-       * progmodes/idlw-shell.el (idlwave-shell-bp-face)
-       (idlwave-shell-disabled-bp): Remove "-face" suffix from face names.
-       (idlwave-shell-bp-face, idlwave-shell-disabled-bp):
-       New backward-compatibility aliases for renamed faces.
-       (idlwave-shell-disabled-breakpoint-face)
-       (idlwave-shell-breakpoint-face): Use renamed idlwave-shell faces.
-
-       * progmodes/flymake.el (flymake-errline, flymake-warnline):
-       Remove "-face" suffix from face names.
-       (flymake-errline-face, flymake-warnline-face):
-       New backward-compatibility aliases for renamed faces.
-       (flymake-highlight-line): Use renamed flymake faces.
-
-       * progmodes/ebrowse.el (ebrowse-tree-mark, ebrowse-root-class)
-       (ebrowse-file-name, ebrowse-default, ebrowse-member-attribute)
-       (ebrowse-member-class, ebrowse-progress):
-       Remove "-face" suffix from face names.
-       (ebrowse-tree-mark-face, ebrowse-root-class-face)
-       (ebrowse-file-name-face, ebrowse-default-face)
-       (ebrowse-member-attribute-face, ebrowse-member-class-face)
-       (ebrowse-progress-face):
-       New backward-compatibility aliases for renamed faces.
-       (ebrowse-show-progress, ebrowse-show-file-name-at-point)
-       (ebrowse-set-mark-props, ebrowse-draw-tree-fn)
-       (ebrowse-draw-member-buffer-class-line, ebrowse-draw-member-long-fn)
-       (ebrowse-draw-member-short-fn): Use renamed ebrowse faces.
-
-       * progmodes/antlr-mode.el (antlr-default, antlr-keyword,
-       antlr-syntax)
-       (antlr-ruledef, antlr-tokendef, antlr-ruleref, antlr-tokenref)
-       (antlr-literal): Remove "-face" suffix and "font-lock-" from face
-       names.
-       (antlr-font-lock-default-face, antlr-font-lock-keyword-face)
-       (antlr-font-lock-syntax-face, antlr-font-lock-ruledef-face)
-       (antlr-font-lock-tokendef-face, antlr-font-lock-ruleref-face)
-       (antlr-font-lock-tokenref-face, antlr-font-lock-literal-face): New
-       backward-compatibility aliases for renamed faces.
-       (antlr-default-face, antlr-keyword-face, antlr-syntax-face)
-       (antlr-ruledef-face, antlr-tokendef-face, antlr-ruleref-face)
-       (antlr-tokenref-face, antlr-literal-face): Variables renamed to
-       remove "font-lock-".  Use renamed antlr-mode faces.
-       (antlr-font-lock-additional-keywords): Use renamed faces.  Replace
-       literal face-names with face variable references.
-
-       * buff-menu.el (Buffer-menu-buffer): Remove "-face" suffix from
-       face name.
-       (Buffer-menu-buffer-face): New backward-compatibility alias for
-       renamed face.
-       (list-buffers-noselect): Use renamed Buffer-menu-buffer face.
-
-2005-06-15  Daniel Pfeiffer  <occitan@esperanto.org>
-
-       * progmodes/make-mode.el (makefile-space, makefile-makepp-perl):
-       Eliminate "-face" suffix.
-       (makefile-targets): Inherit from font-lock-function-name-face and
-       eliminate "-face" suffix.
-       (makefile-shell): Remove attributes and eliminate "-face" suffix.
-       (makefile-*-font-lock-keywords): Append makefile-targets in rule
-       actions, instead of prepending, to make it less visible.
-       (makefile-previous-dependency, makefile-match-dependency):
-       Don't match a target on a continuation line.
-
-       * files.el (auto-mode-alist): Put Makefile in gmake mode.
-
-2005-06-15  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (menu): Re-order menu items.
-       (gdb-tooltip-print): Respect tooltip-use-echo-area.
-
-       * progmodes/gud.el (tooltip-use-echo-area): Remove alias.
-       Define in tooltip.el.
-       (gud-tooltip-process-output): Respect tooltip-use-echo-area.
-       (gud-tooltip-tips): Respect tooltip-use-echo-area and
-       gud-tooltip-echo-area.
-
-       * tooltip.el (tooltip-use-echo-area): Restore from gud.el for
-       backward compatibility and make obsolete.
-       (tooltip-help-tips): Use tooltip-use-echo-area.
-       (tooltip-show-help-function): Rename to...
-       (tooltip-show-help): ...this, because it is a function.
-       (tooltip-mode, tooltip-help-message): Call tooltip-show-help.
-
-2005-06-14  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * emacs-lisp/edebug.el (edebug-all-defs, edebug-initial-mode)
-       (edebug-print-length, edebug-print-level, edebug-print-circle)
-       (edebug-modify-breakpoint, edebug-eval-last-sexp)
-       (edebug-eval-print-last-sexp): Doc fixes.
-
-2005-06-14  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-mode): Make a new keymap every time we enable ido,
-       as the coverage buffer/file/both may change.
-
-2005-06-14  Lute Kamstra  <lute@gnu.org>
-
-       * net/ange-ftp.el (internal-ange-ftp-mode): Use delay-mode-hooks
-       and run-mode-hooks.  Simplify.
-
-       * mail/rmailedit.el (rmail-edit-mode):
-       * progmodes/octave-inf.el (inferior-octave-mode):
-       * progmodes/sql.el (sql-interactive-mode): Use delay-mode-hooks.
-
-       * recentf.el (recentf-dialog-mode): Use kill-all-local-variables
-       and run-mode-hooks.
-       (recentf-edit-list, recentf-open-files): Don't call
-       kill-all-local-variables directly.
-
-       * emacs-lisp/debug.el (debug-on-entry): Fix docstring.
-
-2005-06-14  Juanma Barranquero  <lekktu@gmail.com>
-
-       * emacs-lisp/byte-run.el (make-obsolete)
-       (define-obsolete-function-alias): Rename arguments FUNCTION and
-       NEW to OBSOLETE-NAME and CURRENT-NAME respectively.
-       (make-obsolete-variable, define-obsolete-variable-alias):
-       Rename arguments VARIABLE and NEW to OBSOLETE-NAME and CURRENT-NAME
-       respectively.
-
-       * isearchb.el (isearchb-activate):
-       * pcvs.el (cvs-mode):
-       * ses.el (ses-load):
-       * vc-arch.el (vc-arch-checkin, vc-arch-diff):
-       * net/tramp.el (tramp-find-file-exists-command)
-       (tramp-find-shell):
-       * progmodes/ada-mode.el (ada-create-case-exception)
-       (ada-create-case-exception-substring, ada-make-subprogram-body):
-       * progmodes/idlw-shell.el (idlwave-shell-move-to-bp):
-       * progmodes/idlwave.el (idlwave-complete-class-structure-tag-help):
-       * progmodes/vhdl-mode.el (vhdl-speedbar-place-component):
-       * textmodes/org.el (org-promote, org-evaluate-time-range)
-       (org-agenda-next-date-line, org-agenda-previous-date-line)
-       (org-agenda-error, org-open-at-point, org-table-move-row)
-       (org-format-table-table-html-using-table-generate-source)
-       (org-shiftcursor-error, org-ctrl-c-ctrl-c):
-       * textmodes/reftex.el (reftex-access-scan-info):
-       * textmodes/reftex-toc.el (reftex-toc-dframe-p)
-       (reftex-toc-promote-prepare): Follow error conventions.
-
-       * diff-mode.el (diff-mode): Fix typo in docstring.
-
-       * forms.el (forms--intuit-from-file): Fix reference to
-       `forms-number-of-fields' in error message.
-       (forms-print): Fix quoting in error message.
-
-       * forms.el (forms-mode):
-       * emulation/vi.el (vi-goto-insert-state):
-       * progmodes/flymake.el (flymake-new-err-info)
-       (flymake-start-syntax-check-for-current-buffer)
-       (flymake-simple-cleanup):
-       * eshell/esh-var.el (eshell/export):
-       * progmodes/gud.el (xdb):
-       * textmodes/flyspell.el (flyspell-incorrect-hook)
-       (flyspell-maybe-correct-transposition)
-       (flyspell-maybe-correct-doubling): Fix quoting in docstring.
-
-2005-06-13  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * emacs-lisp/debug.el (cancel-debug-on-entry): Mention default in
-       minibuffer prompt.
-
-2005-06-13  Kim F. Storm  <storm@cua.dk>
-
-       * subr.el (add-to-ordered-list): New defun.
-
-       * emulation/cua-base.el (cua-mode): Use add-to-ordered-list to
-       add cua--keymap-alist to emulation-mode-map-alists.
-
-2005-06-13  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * subr.el (complete-in-turn): New macro.
-       (dynamic-completion-table, lazy-completion-table): Add debug info.
-
-       * faces.el (read-face-name): Use complete-in-turn complete non-aliases
-       in preference to face aliases.
-
-       * textmodes/fill.el (fill-match-adaptive-prefix): New function.
-       (fill-context-prefix): Use it to avoid guessing absurdly long prefixes.
-       Remove unused vars `start' and `firstline'.
-       (fill-nobreak-p): Fix line-move-invisible -> line-move-invisible-p.
-       (justify-current-line, fill-individual-paragraphs): Remove unused vars.
-
-2005-06-13  Eli Zaretskii  <eliz@gnu.org>
-
-       * cus-start.el (all): Don't complain about missing GTK-related
-       variables, unless either `gtk' is boundp or this isn't a
-       `windows-nt' build.
-
-2005-06-13  Lute Kamstra  <lute@gnu.org>
-
-       * abbrev.el (edit-abbrevs-mode): Use kill-all-local-variables and
-       run-mode-hooks.
-
-       * ediff-mult.el (ediff-meta-mode):
-       * ediff-util.el (ediff-mode): Use run-mode-hooks.
-
-       * ledit.el (ledit-mode): Use delay-mode-hooks.
-
-       * woman.el (woman-mode-line-format): Delete constant.
-       (woman-mode-map): Initialize it properly.
-       (woman-mode): Set mode-class property to special.
-       Use delay-mode-hooks and run-mode-hooks.  Use the right keymap.
-       Set major-mode and mode-name.  Don't set mode-line-format directly.
-       (Man-getpage-in-background): Don't reference woman-mode-line-format.
-
-       * emacs-lisp/debug.el (cancel-debug-on-entry): Make the empty
-       string argument obsolete.
-
-2005-06-13  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-CUA-compatible): New option.
-       (org-disputed-keys): New variable.
-       (org-key): New function.
-       (orgtbl-make-binding): Add docstring to the created function.
-       (org-mode): Set paragraph start/separate regexps.
-       (orgtbl-mode): Don't start `orgtbl-mode' in `org-mode' buffers.
-       (org-archive-location, org-archive-mark-done)
-       (org-archive-stamp-time): New options.
-       (org-archive-subtree): New command.
-       (org-fill-paragraph): New function.
-       (org-mode): Set `fill-paragraph-function' to `org-fill-paragraph'.
-       (org-fake-empty-table-line): Function removed.
-       (org-format-org-table-html): Do not create empty table lines at
-       separator lines.  Improved table header treatment.
-       (org-link-format): New option.
-       (org-make-link): New function.
-       (org-insert-link, org-store-link): Use org-make-link.
-       (org-open-file): Quote file name for shell command, to allow
-       spaces in file names.
-       (org-link-regexp): Fix bug with mailto link.
-       (org-link-maybe-angles-regexp, org-protected-link-regexp):
-       New constants.
-       (org-export-as-html): Deal with the optional angles around a link.
-       Better treatment of file: links.
-       (org-open-at-point): Replace @{ and @} with < and >.
-       (org-run-mode-hooks): Function removed.
-       (org-agenda-mode): No longer use `org-run-mode-hooks'.
-
-2005-06-13  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-registers-mode): Let gdbmi use
-       MI command -data-list-register-values.
-       (gdb-post-prompt): Indent properly.
-
-2005-06-13  Juanma Barranquero  <lekktu@gmail.com>
-
-       * hilit-chg.el (highlight-changes-colors): Rename from
-       `highlight-changes-colours'.
-       (highlight-changes-colours): Keep as obsolete alias.
-       (highlight-changes-face-list): Doc fix.
-       (hilit-chg-make-list): Use `highlight-changes-colors'.
-
-2005-06-12  Mark A. Hershberger  <mah@everybody.org>
-
-       * progmodes/cperl-mode.el (cperl-mode): Remove stray paren in
-       defun-prompt-regexp.
-
-2005-06-12  Eli Zaretskii  <eliz@gnu.org>
-
-       * loadup.el: Don't say we are dumping under 2 names on windows-nt
-       and cygwin.
-
-       * makefile.w32-in (bootstrap-clean-CMD, bootstrap-clean-SH):
-       Don't use an old loaddefs.el, as in Makefile.in.
-
-2005-06-12  Lute Kamstra  <lute@gnu.org>
-
-       * Makefile.in (bootstrap-prepare): Don't use an old loaddefs.el.
-
-       * man.el (Man-mode-map): Initialize it properly.
-       (Man-mode): Set mode-class property to special.
-
-       * calendar/calendar.el (calendar-mode): Use run-mode-hooks.
-
-2005-06-11  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * menu-bar.el (menu-bar-make-toggle): Remove stray backslash.
-       A newline is needed in the docstring there.
-
-       * emacs-lisp/debug.el (debug-on-entry, cancel-debug-on-entry):
-       Doc fixes.
-
-2005-06-11  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
-
-       * printing.el: Doc fix.  The menubar is no more changed when printing
-       is loaded, it only changes when pr-menu-bind or pr-update-menus is
-       called.  Now, the menubar changing will work in Emacs 20, 21 and 22.
-       (pr-version): New version number (6.8.4).
-       (pr-menu-bind): New command.
-       (pr-update-menus): Docstring and code fix.
-       (pr-menu-print-item): Now is a global var in Emacs and XEmacs.
-       Docstring fix.
-       (pr-txt-printer-alist, pr-ps-printer-alist, pr-gv-command)
-       (pr-gs-command, pr-gs-switches, pr-ps-utility-alist): Docstring fix.
-
-2005-06-11  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * emacs-lisp/ewoc.el: Doc fixes for public funcs:
-       "Returns" to "return", document useful return values, etc.
-
-2005-06-11  Alan Mackenzie  <acm@muc.de>
-
-       * fill.el (fill-context-prefix): Try `adaptive-fill-function'
-       BEFORE `adaptive-fill-regexp' when determining a fill prefix.
-       (adaptive-file-function): Minor amendment to doc-string.
-
-2005-06-11  Frederik Fouvry  <fouvry@CoLi.Uni-SB.DE>
-
-       * thumbs.el (thumbs-per-line, thumbs-thumbsdir-max-size)
-       (thumbs-relief, thumbs-margin, thumbs-image-resizing-step):
-       Fix :type--it is `integer', not `string'.
-
-       * faces.el (modeline-highlight): Rename from (the erroneous)
-       `modeline-higilight'.
-
-2005-06-11  Lute Kamstra  <lute@gnu.org>
-
-       * emacs-lisp/edebug.el (edebug-eval-mode-map): Don't copy
-       lisp-interaction-mode-map but make it the parent.
-       (edebug-eval-mode): Use define-derived-mode.
-
-2005-06-11  Andreas Schwab  <schwab@suse.de>
-
-       * bindings.el: Add binding of `ESC functionkey' for every
-       `M-functionkey'.
-       * hexl.el (hexl-mode-map): Likewise.
-
-2005-06-10  Michael Hotchin  <michael@hotchin.net>  (tiny change)
-
-       * progmodes/compile.el (compilation-error-regexp-alist-alist)
-       [msft]: update regexp for newer msft compilers.
-
-2005-06-10  Mark A. Hershberger  <mah@everybody.org>
-
-       * xml.el (start-chars, xml-parse-dtd): Add the ability to skip
-       ATTLIST portions of included DTDs.
-       (xml-parse-dtd): Eliminate use of inefficient match-data.
-
-2005-06-10  Miles Bader  <miles@gnu.org>
-
-       * play/mpuz.el (mpuz-unsolved, mpuz-solved, mpuz-trivial)
-       (mpuz-text): Remove "-face" suffix from face names.
-       (mpuz-unsolved-face, mpuz-solved-face, mpuz-trivial-face)
-       (mpuz-text-face): New backward-compatibility aliases for renamed faces.
-       (mpuz-create-buffer, mpuz-paint-digit): Use renamed mpuz faces.
-
-       * play/gomoku.el (gomoku-O, gomoku-X):
-       Remove "-face" suffix from face names.
-       (gomoku-font-lock-O-face, gomoku-font-lock-X-face):
-       New backward-compatibility aliases for renamed faces.
-       (gomoku-font-lock-keywords): Use renamed gomoku faces.
-
-2005-06-10  Juanma Barranquero  <lekktu@gmail.com>
-
-       * thumbs.el: Fixes for changes of 2005-06-09.
-       (thumbs-thumbsdir): Force `thumbs-thumbsdir' to be interpretable
-       as a directory.
-       (thumbs-thumbname): Remove directory separator from format string;
-       `thumbs-thumbsdir' now returns a valid directory name.
-       (thumbs-temp-dir): New defsubst.
-       (thumbs-temp-file, thumbs-resize-image, thumbs-modify-image):
-       Use it.
-
-       * cus-edit.el (minibuffer):
-       * files.el (make-backup-file-name-function):
-       * filesets.el (filesets-external-viewers):
-       * hilit-chg.el (highlight-changes-colours)
-       (highlight-changes-face-list, highlight-changes-rotate-faces):
-       * ielm.el (ielm-dynamic-return, inferior-emacs-lisp-mode):
-       * kmacro.el (kmacro-call-macro):
-       * log-edit.el (log-edit-changelog-full-paragraphs):
-       * mouse.el (mouse-1-click-follows-link):
-       * skeleton.el (skeleton-autowrap):
-       * subr.el (insert-for-yank-1):
-       * tempo.el (tempo-insert-region):
-       * terminal.el (terminal-emulator):
-       * time.el (display-time-mail-face):
-       * vc.el (vc-annotate):
-       * vcursor.el (vcursor-copy-line):
-       * woman.el (woman-bold-headings, woman-ignore)
-       (woman-default-faces, woman-monochrome-faces):
-       * calendar/todo-mode.el (todo-insert-threshold):
-       * emulation/pc-select.el (pc-select-selection-keys-only)
-       (pc-selection-mode):
-       * emulation/vip.el (vip-find-char-forward):
-       * emulation/viper-cmd.el (viper-find-char-forward):
-       * international/mule-cmds.el
-       (select-safe-coding-system-accept-default-p)
-       (input-method-exit-on-invalid-key):
-       * international/mule-diag.el (describe-coding-system):
-       * international/ucs-tables.el (unify-8859-on-encoding-mode):
-       * net/browse-url.el (browse-url-xterm-program):
-       * obsolete/lazy-lock.el (lazy-lock-mode):
-       * progmodes/cperl-mode.el (cperl-info-on-command-no-prompt)
-       (cperl-mode):
-       * progmodes/cpp.el (cpp-face-light-name-list)
-       (cpp-face-dark-name-list):
-       * progmodes/delphi.el (delphi-newline-always-indents):
-       Fix spellings in docstrings.
-
-       * ido.el (ido-mode, ido-file-extensions-order)
-       (ido-default-file-method, ido-default-buffer-method)
-       (ido-max-prospects, ido-slow-ftp-hosts, ido-setup-hook)
-       (ido-decorations, ido-read-file-name-as-directory-commands)
-       (ido-read-file-name-non-ido, ido-work-directory-list)
-       (ido-ignore-item-temp-list, ido-current-directory)
-       (ido-magic-forward-char, ido-enter-find-file)
-       (ido-enter-switch-buffer, ido-visit-buffer, ido-switch-buffer)
-       (ido-find-file, ido-read-buffer): Fix typos in docstrings.
-
-2005-06-10  Lute Kamstra  <lute@gnu.org>
-
-       * play/dunnet.el (dun-mode): Use define-derived-mode.
-       (dungeon-mode-map): Rename to dun-mode-map.  Keep old name as an
-       obsolete alias.
-
-       * play/doctor.el (doctor-mode-map): Remove defvar.
-       (doctor-mode): Use define-derived-mode.
-
-       * mail/mspools.el (mspools-mode):
-       * net/eudc-hotlist.el (eudc-hotlist-mode):
-       * play/blackbox.el (blackbox-mode): Use run-mode-hooks.
-
-2005-06-10  Miles Bader  <miles@gnu.org>
-
-       * textmodes/flyspell.el (flyspell-incorrect, flyspell-duplicate):
-       Remove "-face" suffix from face names.
-       (flyspell-incorrect-face, flyspell-duplicate-face):
-       New backward-compatibility aliases for renamed faces.
-       (flyspell-mode-on, make-flyspell-overlay)
-       (flyspell-highlight-incorrect-region)
-       (flyspell-highlight-duplicate-region)
-       (flyspell-display-next-corrections)
-       (flyspell-auto-correct-previous-word): Use renamed flyspell faces.
-
-       * textmodes/texinfo.el (texinfo-heading): Remove "-face" suffix
-       from face name.
-       (texinfo-heading-face): New backward-compatibility alias for
-       renamed face.
-       (texinfo-heading-face): Use renamed texinfo-heading face.
-
-       * textmodes/tex-mode.el (tex-math, tex-verbatim): Remove "-face"
-       suffix from face names.
-       (tex-math-face, tex-verbatim-face):
-       New backward-compatibility aliases for renamed faces.
-       (tex-math-face, tex-verbatim-face): Use renamed tex-mode faces.
-       (tex-insert-quote): Use `tex-verbatim-face' variable instead of
-       literal face name.
-
-       * textmodes/table.el (table-cell): Remove "-face" suffix from face
-       name.
-       (table-cell-face): New backward-compatibility alias for renamed face.
-       (table--put-cell-face-property, table--update-cell-face):
-       Use renamed table-cell face.
-
-       * textmodes/sgml-mode.el (sgml-namespace): Remove "-face" suffix
-       from face name.
-       (sgml-namespace-face): New backward-compatibility alias for
-       renamed face.
-       (sgml-namespace-face): Use renamed sgml-namespace face.
-
-       * textmodes/org.el (org-level-1, org-level-2, org-level-3)
-       (org-level-4, org-level-5, org-level-6, org-level-7)
-       (org-level-8, org-warning, org-headline-done)
-       (org-deadline-announce, org-scheduled-today)
-       (org-scheduled-previously, org-link, org-done, org-table)
-       (org-time-grid): Remove "-face" suffix from face names.
-       (org-level-1-face, org-level-2-face, org-level-3-face)
-       (org-level-4-face, org-level-5-face, org-level-6-face)
-       (org-level-7-face, org-level-8-face, org-warning-face)
-       (org-headline-done-face, org-deadline-announce-face)
-       (org-scheduled-today-face, org-scheduled-previously-face)
-       (org-link-face, org-done-face, org-table-face)
-       (org-time-grid-face):
-       New backward-compatibility aliases for renamed faces.
-       (org-level-faces, org-set-font-lock-defaults, org-timeline)
-       (org-agenda, org-agenda-get-todos, org-agenda-get-deadlines)
-       (org-agenda-get-timestamps, org-agenda-get-scheduled)
-       (org-agenda-add-time-grid-maybe, org-table-p): Use renamed org faces.
-
-       * emulation/viper-init.el (viper-search, viper-replace-overlay)
-       (viper-minibuffer-emacs, viper-minibuffer-insert)
-       (viper-minibuffer-vi): Remove "-face" suffix from face names.
-       (viper-search-face, viper-replace-overlay-face)
-       (viper-minibuffer-emacs-face, viper-minibuffer-insert-face)
-       (viper-minibuffer-vi-face):
-       New backward-compatibility aliases for renamed faces.
-       (viper-search-face, viper-replace-overlay-face)
-       (viper-minibuffer-emacs-face, viper-minibuffer-insert-face)
-       (viper-minibuffer-vi-face): Use renamed viper faces.
-
-       * emacs-lisp/testcover.el (testcover-nohits, testcover-1value):
-       Remove "-face" suffix from face names.
-       (testcover-nohits-face, testcover-1value-face):
-       New backward-compatibility aliases for renamed faces.
-       (testcover-mark): Use renamed testcover faces.
-
-       * calendar/diary-lib.el (diary-button): Remove "-face" suffix from
-       face name.
-       (diary-button-face): New backward-compatibility alias for renamed face.
-       (diary-entry): Use renamed diary-button face.
-
-       * calendar/calendar.el (diary, calendar-today, holiday)
-       (mark-visible-calendar-date): Remove "-face" suffix from face names.
-       (diary-face, calendar-today-face, holiday-face):
-       New backward-compatibility aliases for renamed faces.
-       (eval-after-load "facemenu", diary-entry-marker)
-       (calendar-today-marker, calendar-holiday-marker, diary-face):
-       Use renamed calendar faces.
-
-       * compare-w.el (compare-windows): Remove "-face" suffix from face name.
-       (compare-windows-face): New backward-compatibility alias for
-       renamed face.
-       (compare-windows-highlight): Use renamed compare-windows face.
-
-       * strokes.el (strokes-char): Remove "-face" suffix from face name.
-       (strokes-char-face): New backward-compatibility alias for renamed face.
-       (strokes-encode-buffer): Use renamed strokes-char face.
-
-       * pcvs-info.el (cvs-header, cvs-filename, cvs-unknown)
-       (cvs-handled, cvs-need-action, cvs-marked, cvs-msg):
-       Remove "-face" suffix from face names.
-       (cvs-header-face, cvs-filename-face, cvs-unknown-face)
-       (cvs-handled-face, cvs-need-action-face, cvs-marked-face)
-       (cvs-msg-face): New backward-compatibility aliases for renamed faces.
-       (cvs-fi-up-to-date-face, cvs-fi-unknown-face, cvs-fileinfo-pp):
-       Use renamed pcvs faces.
-       * pcvs.el (cvs-mode-find-file): Use renamed pcvs faces.
-       * pcvs-defs.el (cvs-mode-map): Likewise.
-       * cvs-status.el (cvs-status-font-lock-keywords): Likewise.
-
-       * info.el (info-title-1, info-title-2, info-title-3)
-       (info-title-4): Remove "-face" suffix from and downcase face names.
-       (Info-title-1-face, Info-title-2-face, Info-title-3-face)
-       (Info-title-4-face):
-       New backward-compatibility aliases for renamed faces.
-       (Info-fontify-node): Use renamed info faces.
-
-       * hilit-chg.el (highlight-changes, highlight-changes-delete):
-       Remove "-face" suffix from face names.
-       (highlight-changes-face, highlight-changes-delete-face):
-       New backward-compatibility aliases for renamed faces.
-       (hilit-chg-cust-fix-changes-face-list, hilit-chg-make-ov)
-       (hilit-chg-make-list): Use renamed highlight-changes faces.
-
-       * generic-x.el (show-tabs-tab, show-tabs-space):
-       Remove "-face" suffix from face names.
-       (show-tabs-tab-face, show-tabs-space-face):
-       New backward-compatibility aliases for renamed faces.
-       (show-tabs-generic-mode-font-lock-defaults-1)
-       (show-tabs-generic-mode-font-lock-defaults-2):
-       Use renamed show-tabs faces.
-
-       * smerge-mode.el (smerge-mine, smerge-other, smerge-base)
-       (smerge-markers): Remove "-face" suffix from face names.
-       (smerge-mine-face, smerge-other-face, smerge-base-face)
-       (smerge-markers-face):
-       New backward-compatibility aliases for renamed faces.
-       (smerge-mine-face, smerge-other-face, smerge-base-face)
-       (smerge-markers-face): Use renamed smerge faces.
-
-       * log-view.el (log-view-file, log-view-message): Remove "-face"
-       suffix from face names.
-       (log-view-file-face, log-view-message-face):
-       New backward-compatibility aliases for renamed faces.
-       (log-view-file-face, log-view-message-face): Use renamed log-view
-       faces.
-
-       * paren.el (show-paren-match, show-paren-mismatch):
-       Remove "-face" suffix from face names.
-       (show-paren-match-face, show-paren-mismatch-face):
-       New backward-compatibility aliases for renamed faces.
-       (show-paren-function): Use renamed show-paren faces.
-
-       * ruler-mode.el (ruler-mode-default, ruler-mode-pad)
-       (ruler-mode-margins, ruler-mode-fringes)
-       (ruler-mode-column-number, ruler-mode-fill-column)
-       (ruler-mode-comment-column, ruler-mode-goal-column)
-       (ruler-mode-tab-stop, ruler-mode-current-column): Remove "-face"
-       suffix from face names.
-       (ruler-mode-default-face, ruler-mode-pad-face)
-       (ruler-mode-margins-face, ruler-mode-fringes-face)
-       (ruler-mode-column-number-face, ruler-mode-fill-column-face)
-       (ruler-mode-comment-column-face, ruler-mode-goal-column-face)
-       (ruler-mode-tab-stop-face, ruler-mode-current-column-face):
-       New backward-compatibility aliases for renamed faces.
-       (ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
-       (ruler-mode-column-number, ruler-mode-fill-column)
-       (ruler-mode-comment-column, ruler-mode-goal-column)
-       (ruler-mode-tab-stop, ruler-mode-current-column)
-       (ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed
-       faces.
-
-       * whitespace.el (whitespace-highlight): Remove "-face" suffix from
-       face name.
-       (whitespace-highlight-the-space): Use renamed face.
-       (whitespace-highlight-face): New backward-compatibility alias for
-       renamed face.
-
-       * woman.el (woman-italic, woman-bold, woman-unknown)
-       (woman-addition, woman-symbol-face):
-       Remove "-face" suffix from face names.
-       (woman-italic-face, woman-bold-face, woman-unknown-face)
-       (woman-addition-face):
-       New backward-compatibility aliases for renamed faces.
-       (woman-default-faces, woman-monochrome-faces, woman-man-buffer)
-       (woman-decode-region, woman-replace-match)
-       (woman-display-extended-fonts, woman-special-characters)
-       (woman-font-alist, woman-change-fonts, woman2-TH, woman2-SH):
-       Use renamed woman faces.
-
-       * longlines.el (longlines-visible-face): Face removed.
-
-       * diff-mode.el (diff-header, diff-file-header, diff-index)
-       (diff-hunk-header, diff-removed, diff-added, diff-changed)
-       (diff-function, diff-context, diff-nonexistent): Remove "-face"
-       suffix from face names.
-       (diff-header-face, diff-file-header-face, diff-index-face)
-       (diff-hunk-header-face, diff-removed-face, diff-added-face)
-       (diff-changed-face, diff-function-face, diff-context-face)
-       (diff-nonexistent-face): New backward-compatibility aliases for
-       renamed faces.
-       (diff-header-face, diff-file-header-face)
-       (diff-index, diff-index-face, diff-hunk-header)
-       (diff-hunk-header-face, diff-removed, diff-removed-face)
-       (diff-added, diff-added-face, diff-changed-face, diff-function)
-       (diff-function-face, diff-context-face, diff-nonexistent)
-       (diff-nonexistent-face): Use renamed diff-mode faces.
-
-       * progmodes/compile.el (compilation-warning-face)
-       (compilation-info-face): Remove "-face" suffix from face names.
-       (compilation-warning-face, compilation-info-face):
-       New backward-compatibility aliases for renamed faces.
-       (compilation-warning-face, compilation-info-face):
-       Use renamed compilation faces.
-
-       * add-log.el (change-log-date, change-log-name)
-       (change-log-email, change-log-file, change-log-list)
-       (change-log-conditionals, change-log-function)
-       (change-log-acknowledgement): Remove "-face" suffix from face names.
-       (change-log-date-face, change-log-name-face)
-       (change-log-email-face, change-log-file-face)
-       (change-log-list-face, change-log-conditionals-face)
-       (change-log-function-face, change-log-acknowledgement-face):
-       New backward-compatibility aliases for renamed faces.
-       (change-log-font-lock-keywords): Use renamed change-log faces.
-
-       * cus-edit.el (custom-invalid, custom-rogue, custom-modified)
-       (custom-set, custom-changed, custom-saved, custom-button)
-       (custom-button-pressed, custom-documentation, custom-state)
-       (custom-comment, custom-comment-tag, custom-variable-tag)
-       (custom-variable-button, custom-face-tag, custom-group-tag-1)
-       (custom-group-tag): Remove "-face" suffix from face names.
-       (custom-magic-alist, custom-magic-value-create)
-       (custom-group-sample-face-get, custom-mode): Use renamed custom faces.
-       (custom-invalid-face, custom-rogue-face, custom-modified-face)
-       (custom-set-face, custom-changed-face, custom-saved-face)
-       (custom-button-face, custom-button-pressed-face)
-       (custom-documentation-face, custom-state-face)
-       (custom-comment-face, custom-comment-tag-face)
-       (custom-variable-tag-face, custom-variable-button-face)
-       (custom-face-tag-face, custom-group-tag-face-1)
-       (custom-group-tag-face):
-       New backward-compatibility aliases for renamed faces.
-
-       * wid-edit.el (widget-documentation, widget-button)
-       (widget-field, widget-single-line-field, widget-inactive)
-       (widget-button-pressed): "-face" suffix removed from face names.
-       (widget-documentation-face, widget-button-face)
-       (widget-field-face, widget-single-line-field-face)
-       (widget-inactive-face, widget-button-pressed-face):
-       New backward-compatibility aliases for renamed faces.
-       (widget-documentation-face, widget-button-face)
-       (widget-button-pressed-face, widget-specify-field)
-       (widget-specify-inactive): Use renamed widget faces.
-
-2005-06-10  Kenichi Handa  <handa@m17n.org>
-
-       * term/x-win.el (x-clipboard-yank): Remove condition-case
-       wrapping.
-
-2005-06-11  Kenichi Handa  <handa@m17n.org>
-
-       * add-log.el (change-log-font-lock-keywords): Make the regexp for
-       date lines stricter.
-
-2005-06-10  Zhang Wei  <id.brep@gmail.com>
-
-       * term/x-win.el (x-clipboard-yank): Use x-selection-value instead
-       of x-get-selection.
-
-2005-06-10  Juanma Barranquero  <lekktu@gmail.com>
-
-       * comint.el (comint-mode, comint-snapshot-last-prompt):
-       * frame.el (frame-current-scroll-bars):
-       * term.el (term-mode, term-check-proc, term-input-sender)
-       (term-simple-send, term-extract-string, term-word)
-       (term-match-partial-filename):
-       * window.el (window-current-scroll-bars):
-       * emulation/cua-base.el (cua-normal-cursor-color)
-       (cua-read-only-cursor-color, cua-overwrite-cursor-color)
-       (cua-global-mark-cursor-color):
-       * mail/undigest.el (rmail-forward-separator-regex):
-       Fix typos in docstrings.
-
-       * comint.el (comint-check-proc, make-comint-in-buffer)
-       (comint-source-default): Doc fixes.
-
-       * term.el (term-send-string): Improve argument/docstring consistency.
-
-2005-06-09  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * comint.el (comint-send-input): Bind `inhibit-read-only' around
-       call to `delete-region'.
-       (comint-mode-hook): Do not enable Font Lock by default.
-
-2005-06-09  Lute Kamstra  <lute@gnu.org>
-
-       * textmodes/ispell.el (ispell-menu-map-needed): flyspell-mode
-       could be void.
-
-2005-06-09  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * emacs-lisp/debug.el (debugger-will-be-back): New var.
-       (debug): Use it.
-       (debugger-step-through, debugger-continue, debugger-jump)
-       (debugger-return-value): Set it when needed.
-       (debugger-make-xrefs, debugger-frame, debugger-frame-clear):
-       Use inhibit-read-only.
-
-2005-06-09  Juanma Barranquero  <lekktu@gmail.com>
-
-       * window.el (shrink-window-if-larger-than-buffer)
-       (window-size-fixed): Fix typo in docstring.
-
-       * thumbs.el: Don't set `auto-image-file-mode'.  Do not create the
-       thumbnails directory on loading.
-       (thumbs-conversion-program): Use `eq' to check the system type,
-       not `equal'.
-       (thumbs-temp-dir): Initialize to `temporary-file-directory',
-       not "/tmp".  Fix docstring.
-       (thumbs-thumbsdir): New function to return the thumbnails
-       directory, creating it if needed.
-       (thumbs-cleanup-thumbsdir, thumbs-thumbname): Use it.
-       (thumbs-temp-file): Delete variable and make it into a function.
-       (thumbs-resize-image, thumbs-modify-image): Use it.
-       (thumbs-kill-buffer): Simplify.
-       (thumbs-gensym): Defalias or duplicate CL `gensym'.
-       (thumbs-resize-image, thumbs-resize-interactive): Fix typos in
-       docstrings.
-
-2005-06-09  Kim F. Storm  <storm@cua.dk>
-
-       * subr.el (save-match-data): Add RESEAT arg `evaporate' to
-       set-match-data to free markers in match-data.
-
-       * replace.el (replace-match-data): Pass RESEAT arg `t' to
-       match-data to unchain markers in match-data.
-
-2005-06-08  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * emacs-lisp/debug.el (debug): Don't iconify if we know we'll re-enter
-       the debugger immediately anyway.  Undo the 2005-06-06 change, rendered
-       unnecessary now.
-
-2005-06-08  Richard M. Stallman  <rms@gnu.org>
-
-       * emacs-lisp/easy-mmode.el (define-minor-mode): If BODY is empty,
-       give the variable a doc string that doesn't say don't set it directly.
-
-       * textmodes/ispell.el (ispell-check-version):
-       Use match-string-no-properties.
-       (ispell-region, ispell-buffer-local-parsing, ispell-buffer-local-dict)
-       (ispell-buffer-local-words): Likewise.
-
-       * progmodes/make-mode.el (makefile-shell-face): Make this a no-op
-       except on terminals with enough colors to really display it.
-       (makefile-dependency-regex): Delete spurious `bb'.
-
-       * faces.el (escape-glyph): Use blue once again in last case.
-       (no-break-space): Redefine so that it isn't invisible on a tty.
-
-2005-06-08  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-read-file-name): Fallback to read-file-name on C-f
-       also when reading directory name.
-
-2005-06-08  Lute Kamstra  <lute@gnu.org>
-
-       * textmodes/flyspell.el (flyspell-mode): Use define-minor-mode.
-       (flyspell-mode-line-string): Remove autoload cookie.
-       (flyspell-mode): Remove defvar.
-
-2005-06-07  Lute Kamstra  <lute@gnu.org>
-
-       * textmodes/org.el (org-run-mode-hooks): New function.
-       (org-agenda-mode): Use it.
-
-2005-06-07  David McCabe  <davemccabe@gmail.com>  (tiny change)
-
-       * emacs-lisp/lisp-mode.el (defstruct): Set `doc-string-elt' property.
-
-2005-06-06  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * international/iso-cvt.el (iso-sgml2iso-trans-tab): Add NBSP.
-
-2005-06-06  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * font-lock.el (font-lock-add-keywords): Doc fix.
-
-2005-06-06  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * textmodes/tex-mode.el (tex-guess-mode): Add RequirePackage.
-       (tex-compile-default): In the absence of any history, use the order in
-       tex-compile-alist to choose the preferred command.
-       (tex-compile-commands): Reorder a bit.
-
-       * textmodes/flyspell.el (flyspell-auto-correct-binding)
-       (flyspell-incorrect-face, flyspell-duplicate-face):
-       Use (X)Emacs-agnostic code.
-       (flyspell-mode-map): Don't overwrite at each load.  Remove code
-       redundant with the subsequent add-minor-mode.  Merge Emacs and
-       XEmacs code.
-       (flyspell-word): Minor simplification.
-       (flyspell-math-tex-command-p): Quieten the byte-compiler.
-       (flyspell-external-point-words): Remove unused vars `size' and `start'.
-       (flyspell-do-correct): Rename from flyspell-xemacs-correct.
-       Merge the corresponding Emacs code.
-       (flyspell-correct-word, flyspell-xemacs-popup):
-       Use flyspell-do-correct.
-
-       * emacs-lisp/debug.el (debug): Don't bury the buffer unless it's in
-       a dedicated window.
-
-       * international/latexenc.el (latexenc-find-file-coding-system):
-       Undo part of last patch, to turn off a compiler warning.
-
-2005-06-06  Juri Linkov  <juri@jurta.org>
-
-       * tmm.el (tmm-inactive, tmm-remove-inactive-mouse-face):
-       Rename `tmm-inactive-face' to `tmm-inactive'.
-
-2005-06-06  Matt Hodges  <MPHodges@member.fsf.org>
-
-       * iswitchb.el: Rename faces.
-
-2005-06-06  Kim F. Storm  <storm@cua.dk>
-
-       * emulation/cua-base.el (cua-rectangle, cua-rectangle-noselect)
-       (cua-global-mark): Remove -face suffix from face names.
-
-       * emulation/cua-gmrk.el (cua--init-global-mark):
-       Remove cua-global-mark face setup.
-
-2005-06-06  Richard M. Stallman  <rms@gnu.org>
-
-       * progmodes/make-mode.el (makefile-dependency-regex): Handle whitespace
-       just like other allowed characters.
-       (makefile-match-dependency): Exclude leading and training whitespace
-       from the range of regexp subexp 1.
-       (makefile-macroassign-regex): Don't try to match the body,
-       just the name of the macro being defined.
-
-       * info.el (Info-read-node-name-2): New function.
-       (Info-read-node-name-1): Use that.
-       Add a completion-base-size-function property.
-
-       * simple.el (completion-setup-function): Look for
-       completion-base-size-function property of minibuffer-completion-table.
-
-       * files.el (locate-file-completion): Doc fix.
-
-       * printing.el: Don't call pr-update-menus; user must do that.
-
-       * emacs-lisp/debug.el (debugger-window): New variable.
-       (debug): Use debugger-window if it is set and still alive.
-       Record debugger-window for next entry.
-
-       * mail/supercite.el (sc-mail-glom-frame): Mark as risky.
-
-2005-06-06  Matthias F\e,Av\e(Brste  <slashdevslashnull@gmx.net>
-
-       * files.el (hack-local-variables-confirm): New arg FLAG-TO-CHECK.
-       (hack-one-local-variable, hack-local-variables)
-       (hack-local-variables-prop-line): Pass that arg.
-
-2005-06-06  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-first-match, ido-only-match, ido-subdir)
-       (ido-indicator): Remove -face suffix from face names.
-
-2005-06-06  Juri Linkov  <juri@jurta.org>
-
-       * font-lock.el (font-lock-regexp-backslash)
-       (font-lock-regexp-backslash-construct): New faces.
-       (lisp-font-lock-keywords-2): Use new faces.  Match `?:' only
-       after `('.  Add `while-no-input' to control structures.
-
-       * faces.el (no-break-space, shadow): New faces.
-       (escape-glyph): Use less loud colors pink2 and red4.
-
-       * diff-mode.el (diff-context-face)
-       * dired.el (dired-ignored)
-       * rfn-eshadow.el (file-name-shadow)
-       * tmm.el (tmm-inactive-face): Inherit from `shadow' face.
-
-       * info.el (Info-title-1-face): Use green instead of yellow because
-       bold yellow is not readable on light backgrounds.
-
-       * progmodes/compile.el (compilation-start): Move `erase-buffer' up
-       before selecting the desired mode to not spend time fontifying
-       old contents.
-
-2005-06-06  Juanma Barranquero  <lekktu@gmail.com>
-
-       * thumbs.el (thumbs-thumbsdir-max-size, thumbs-image-resizing-step)
-       (thumbs-thumbsdir-auto-clean): Fix typos in docstrings.
-
-       * ps-print.el (ps-default-fg, ps-default-bg):
-       Fix typos in docstrings.
-
-       * isearchb.el (isearchb): Don't pass a spurious second argument to
-       `iswitchb-completions'.
-
-2005-06-05  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-info-locals-handler): Use window point
-       to preserve point.
-       (gdb-find-file-hook): Add doc string.
-
-       * progmodes/gud.el (gdb, gud-menu-map): Add command to evaluate
-       C dereferenced pointer expression.
-       (gud-tool-bar-map): Put it on the tool bar.  Re-order icons.
-
-       * toolbar/gud-pstar.xpm, toolbar/gud-pstar.pbm: New files.
-
-       * toolbar/gud-break.xpm, toolbar/gud-cont.xpm, toolbar/gud-down.xpm
-       * toolbar/gud-finish.xpm, toolbar/gud-ni.xpm, toolbar/gud-n.xpm
-       * toolbar/gud-print.xpm, toolbar/gud-remove.xpm, toolbar/gud-run.xpm
-       * toolbar/gud-si.xpm, toolbar/gud-s.xpm, toolbar/gud-until.xpm
-       * toolbar/gud-up.xpm, toolbar/gud-watch.xpm:
-       Make background transparent.
-
-2005-06-04  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * font-lock.el (font-lock-add-keywords): Doc fix.  Comment change.
-       (font-lock-remove-keywords): Doc fix.
-       (font-lock-mode-major-mode): Compiler defvar.
-       (font-lock-set-defaults): Use `font-lock-mode-major-mode'.
-
-       * font-core.el (font-lock-mode-major-mode): Compiler defvar.
-       (font-lock-mode): Update `font-lock-mode-major-mode'.
-       (font-lock-set-defaults): Compiler defvar.
-       (font-lock-default-function): Take `font-lock-mode-major-mode'
-       into account.
-
-       * emacs-lisp/easy-mmode.el (define-global-minor-mode): Make it
-       keep track of which major mode it enabled the minor mode for.
-       Use find-file-hook again.  Update docstring.
-
-       * simple.el (eval-expression-print-level)
-       (eval-expression-print-length, eval-expression-debug-on-error):
-       Doc fixes.
-
-2005-06-04  Matt Hodges  <MPHodges@member.fsf.org>
-
-       * iswitchb.el (iswitchb-single-match-face)
-       (iswitchb-current-match-face, iswitchb-virtual-matches-face)
-       (iswitchb-invalid-regexp-face): New faces.
-       (iswitchb-completions): Use them.
-       (iswitchb-use-faces): Rename from iswitchb-use-fonts, which is
-       now marked as an obsolete alias.
-       (iswitchb-read-buffer): Remove check for bound font variables.
-       (iswitchb-invalid-regexp): New free variable.
-       (iswitchb-get-matched-buffers): Catch invalid-regexp errors and
-       set iswitchb-invalid-regexp.
-       (iswitchb, iswitchb-complete, iswitchb-completions): Deal with
-       invalid regexps.
-       (iswitchb-completions): Add check for complete match when entering
-       a regexp.
-       (iswitchb-completions): Remove require-match argument.
-       (iswitchb-exhibit): Fix caller.
-       (iswitchb-common-match-inserted): New variable.
-       (iswitchb-complete, iswitchb-completion-help): Use it.
-
-2005-06-04  David Reitter  <david.reitter@gmail.com>  (tiny change)
-
-       * url-http.el (url-http-chunked-encoding-after-change-function):
-       Use `url-http-debug' instead of `message'.
-
-2005-06-04  Thierry Emery  <thierry.emery@free.fr>  (tiny change)
-
-       * url-http.el (url-http-parse-headers): Pass redirected URL as a
-       callback argument.
-
-2005-06-04  Kim F. Storm  <storm@cua.dk>
-
-       * simple.el (line-move): Only call sit-for when moving backwards.
-
-       * ido.el (ido-make-merged-file-list-1): New defun split from
-       ido-make-merged-file-list.
-       (ido-make-merged-file-list): Bind throw-on-input around call to
-       ido-make-merged-file-list-1.  Return input-pending-p if
-       interrupted by more input available.
-       (ido-read-internal): Handle input-pending-p return value from
-       ido-make-merged-file-list.
-
-2005-06-03  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * textmodes/flyspell.el (flyspell-check-word-p): Simplify silly
-       compatibility code.
-
-       * international/latexenc.el (latexenc-find-file-coding-system):
-       Don't inherit the EOL part of the coding-system from the
-       tex-main buffer.  Fit within 80 columns.
-
-2005-06-03  Matt Hodges  <MPHodges@member.fsf.org>
-
-       * tmm.el (tmm-inactive-face): New face.
-       (tmm-remove-inactive-mouse-face): New function.
-       (tmm-prompt, tmm-add-one-shortcut)
-       (tmm-add-prompt, tmm-get-keymap): Make active menu items visible
-       but not selectable.
-
-2005-06-03  Juanma Barranquero  <lekktu@gmail.com>
-
-       * faces.el (face-equal): Improve argument/docstring consistency.
-
-2005-06-03  Daniel Pfeiffer  <occitan@esperanto.org>
-
-       * progmodes/make-mode.el (makefile-targets-face)
-       (makefile-shell-face, makefile-makepp-perl-face): Add :version.
-       (makefile-bsdmake-dependency-regex)
-       (makefile-makepp-rule-action-regex)
-       (makefile-bsdmake-rule-action-regex): New constants.
-       (makefile-makepp-mode, makefile-bsdmake-mode): Use them.
-
-       * progmodes/compile.el (compilation-error-regexp-alist-alist):
-       Allow (...) within `...' for makepp messages.
-
-2005-06-03  Michael Kifer  <kifer@cs.stonybrook.edu>
-
-       * ediff-diff.el (ediff-same-contents): Eliminate CL-type functions.
-
-       * ediff-mult.el (ediff-intersect-directories): Make sure that ".." and
-       "." files are deleted from all file lists before comparison.
-
-       * viper-keym.el (viper-toggle-key, viper-quoted-insert-key)
-       (viper-ESC-key): Made them customizable.
-
-       * viper.el (viper-non-hook-settings): Fix the names of defadvices.
-
-2005-06-01  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * autorevert.el (auto-revert-buffers): Use save-match-data.
-
-2005-06-01  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * emacs-lisp/easymenu.el (easy-menu-return-item): Quick fix to find
-       menu items with a nil command binding.
-
-2005-06-01  Juanma Barranquero  <lekktu@gmail.com>
-
-       * emacs-lisp/cl-macs.el (defsetf):
-       Improve argument/docstring consistency.
-
-       * faces.el (list-faces-display): Improve the formatting by
-       computing the maximum length required for any face-name (reworked
-       patch of 1999-01-11, accidentally deleted on 1999-07-21).
-       (internal-find-face): Remove redundant info in docstring.
-
-2005-06-01  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-set-gud-minor-mode-1)
-       (gdb-info-breakpoints-custom, gdb-delete-breakpoint)
-       (gdb-goto-breakpoint, gdb-source-info, gdb-get-location)
-       (gdb-assembler-custom): Improve regexps.
-       (def-gdb-auto-update-handler): Use window point to preserve point.
-
-2005-05-31  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * thumbs.el (thumbs-mode): Fix misuse of make-variable-buffer-local.
-
-2005-05-31  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-embed.el (calc-embedded-word): Change argument passed
-       to calc-embedded.
-       (calc-embedded-make-info): Have plain prefix argument select
-       entire line.
-
-2005-05-31  Juanma Barranquero  <lekktu@gmail.com>
-
-       * faces.el (list-faces-display): Signal error if passed a regexp
-       that matches no face name.
-
-       * simple.el (filter-buffer-substring): Fix typo in docstring.
-
-2005-05-31  Richard M. Stallman  <rms@gnu.org>
-
-       * progmodes/vhdl-mode.el (vhdl-fill-region): Test ARG, not INTERACTIVE.
-       (vhdl-emacs-21): Doc fix.
-       (vhdl-mode): Unconditionally set comment-padding.
-       (vhdl-fixup-whitespace-region): Insert spaces only where
-       there are none.
-       (vhdl-statistics-buffer): Make the Emacs 21 behavior universal.
-
-2005-05-30  John Wiegley  <johnw@newartisans.com>
-
-       * eshell/em-cmpl.el, eshell/em-dirs.el, eshell/em-glob.el
-       * eshell/em-unix.el, eshell/esh-ext.el, eshell/esh-io.el
-       * eshell/esh-util.el, eshell/esh-var.el: Change all uses of
-       `directory-sep-char' to ?/, and all uses of `string-to-int' to
-       `string-to-number'.
-
-2005-05-30  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc.el (calc-bug-address): Fix docstring.
-       (calc-window-hook, calc-trail-window-hook): New variables.
-       (calc-trail-display): Restore use of calc-trail-window-hook.
-       (calc): Restore use of calc-window-hook.
-
-2005-05-31  Masatake YAMATO  <jet@gyve.org>
-
-       * emacs-lisp/find-func.el (find-function-noselect): Handle subroutines.
-
-       * help-fns.el (help-C-file-name): Add autoload mark for
-       `find-function-noselect'.
-
-2005-05-30  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * textmodes/tex-mode.el (tex-compile-commands, tex-compile)
-       (tex-start-tex): Undo all but the last part of the 2005-05-28 change.
-
-2005-05-30  Glenn Morris  <gmorris@ast.cam.ac.uk>
-
-       * calendar/diary-lib.el (mark-included-diary-files): Only kill
-       included diary buffer if it was not already being visited.
-       Reported by Stephen Berman <Stephen.Berman@gmx.net>.
-
-       * calendar/icalendar.el (top-level): Do not require appt.
-
-       * mail/supercite.el (sc-select-attribution): Only use a list
-       element from sc-attrib-selection-list if it returns a string.
-       Reported by Davide G. M. Salvetti <salve@debian.org>.
-
-2005-05-30  Juanma Barranquero  <lekktu@gmail.com>
-
-       * thumbs.el (thumbs-thumbname): The resulting thumbname now
-       includes a hash value to improve its uniqueness, and has a ".jpg"
-       extension.  Also, it is now a valid filename on all systems.
-       (thumbs-make-thumb): Use `let', not `let*'.
-       (thumbs-show-thumbs-list): Check for JPEG availability.
-
-2005-05-30  Richard M. Stallman  <rms@gnu.org>
-
-       * filesets.el (filesets-menu-ensure-use-cached):
-       Prevent warning when emacs-version>= is undefined.
-
-       * printing.el (pr-interactive-n-up): Use string-to-number.
-
-       * emulation/tpu-mapper.el: Use eval-buffer, not eval-current-buffer.
-
-       * emacs-lisp/bytecomp.el (byte-compile-nogroup-warn):
-       Warn only when name to be defined is quoted.
-
-2005-05-30  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-toggle-breakpoint):
-       Make regexp more robust.
-       (gdb-display-assembler-buffer, gdb-frame-assembler-buffer):
-       Force regeneration of disassembly.
-
-2005-05-29  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc.el (calc-user-invocation): Check if
-       calc-invocation-macro is non-nil.
-
-2005-05-29  Juri Linkov  <juri@jurta.org>
-
-       * add-log.el (change-log-font-lock-keywords):
-       Add `+' to e-mail regexp to accept mail address with keywords.
-
-       * man.el (Man-name-regexp): Add `:' to accept qualified names.
-
-2005-05-29  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * progmodes/inf-lisp.el (inferior-lisp-mode): Use delay-mode-hooks.
-
-       * ielm.el (inferior-emacs-lisp-mode): Ditto.
-
-2005-05-29  Richard M. Stallman  <rms@gnu.org>
-
-       * textmodes/flyspell.el (flyspell-auto-correct-previous-word):
-       Undo the change that moves to end of the current word.
-
-2005-05-29  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-memory-set-repeat-count):
-       Throw error when count <= 0 to ensure input is a number.
-       (gdb-read-memory-custom): Pick up address from buffer.
-       (gdb-memory-mode): Allow user to increment and decrement
-       memory address from header line.
-
-2005-05-29  Richard M. Stallman  <rms@gnu.org>
-
-       * flyspell.el (flyspell-version): Function deleted.
-       (flyspell-auto-correct-previous-hook): Doc fix.
-
-       * jit-lock.el (jit-lock-function, jit-lock-after-change):
-       Do nothing if memory is full.
-
-       * font-lock.el (font-lock-fontify-syntactically-region):
-       Pass t for GREEDY to looking-back.
-
-       * saveplace.el (save-place-alist-to-file): Write the file
-       using write-region.
-
-       * subr.el (looking-back): New argument GREEDY.
-
-       * progmodes/compile.el (compilation-start): Set the mode
-       before inserting the initial text.
-
-       * progmodes/which-func.el (which-func-update-1): Turn the mode
-       off in case of error by setting which-func-mode.
-
-2005-05-29  Peter Heslin  <p.j.heslin@durham.ac.uk>  (tiny change)
-
-       * flyspell.el (flyspell-auto-correct-previous-word):
-       Narrow down to what's on the screen, and recenter overlays
-       at the end of the next word.
-
-2005-05-29  Manuel Serrano  <Manuel.Serrano@sophia.inria.fr>
-
-       * flyspell.el (flyspell-emacs, flyspell-use-local-map): Vars moved up.
-       (flyspell-default-delayed-commands): Add backward-delete-char-untabify.
-       (flyspell-abbrev-p): Default to nil.
-       (flyspell-use-global-abbrev-table-p): Doc fix.
-       (flyspell-large-region): Allow nil as value.
-       (flyspell-use-meta-tab, flyspell-auto-correct-binding): New variables.
-
-       (mail-mode-flyspell-verify): More robust handling
-       of `mail-header-separator'.  More efficient signature detection.
-       Allow for regexp metacharacters in message-header-separator.
-       Adding `To' not to be checked in mail-mode-flyspell-verify.
-
-       (flyspell-prog-mode): Run flyspell-prog-mode-hook.
-       (flyspell-mouse-map): Bind M-TAB only if flyspell-use-meta-tab.
-       Bind flyspell-auto-correct-binding.
-       Bind C-. and C-, .
-       (flyspell-mode-map): Likewise.
-       (flyspell-mode): Doc fix.
-       (flyspell-accept-buffer-local-defs): Preserve current buffer.
-       (flyspell-mode-on): Bind flyspell-mouse-map and flyspell-mode-map.
-       (flyspell-word-cache-result): New var, always local.
-       (flyspell-check-pre-word-p): Doc fix.
-       (flyspell-check-changed-word-p): Handle spc like newline.
-       (flyspell-post-command-hook): Set flyspell-word-cache-result.
-       (flyspell-word-search-backward, flyspell-word-search-forward):
-       New functions.
-       (flyspell-word): Return t if nothing to check.
-       When parsing TeX code, check for after } or \.
-       Use flyspell-word-search-backward to find previous word.
-       Return nil if duplicated word.
-       For word already checked, return same value as last time.
-       Set flyspell-word-cache-result after checking.
-       Don't clobber the return value.
-       (flyspell-get-word): Major rewrite.
-       (flyspell-external-point-words): New locals pword, pcount.
-       Fix size used in progress message.
-       Find the proper corresponding word in flyspell-large-region-buffer.
-       (flyspell-region): Check for flyspell-large-region = nil.
-       (flyspell-highlight-incorrect-region): Clean up overlays in region.
-       (flyspell-auto-correct-word): Check that WORD is a cons.
-       (flyspell-correct-word): Likewise.
-
-2005-05-29  Daniel Pfeiffer  <occitan@esperanto.org>
-
-       * progmodes/make-mode.el (makefile-rule-action-regex)
-       (makefile-macroassign-regex, makefile-makepp-mode)
-       (makefile-bsdmake-mode): Continuation lines may be empty.
-       Reported by Joshua Varner.
-       (makefile-makepp-font-lock-keywords): Add $(stem).
-
-2005-05-28  Karl Berry  <karl@gnu.org>
-
-       * textmodes/tex-mode.el: Now that tex-send-command calls
-       shell-quote-argument (2005-03-31 change), remove all calls to
-       shell-quote-argument; they all end up invoking tex-send-command.
-       The double quoting loses on filenames with non-safe characters,
-       such as "@".  Reported by Frederik Fouvry.
-
-2005-05-29  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-assembler-custom): Be more careful
-       about preserving point.
-
-2005-05-27  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-misc.el (calc-info-goto-node): Use info instead of
-       Info-goto-node.
-
-       * calc/calc-embed.el (calc-embed-arg): New variable.
-       (calc-do-embedded-activate, calc-embedded-activate-formula)
-       (calc-embedded-edit, calc-do-embedded-activate): Replace undeclared
-       variable by new variable.
-       (calc-embedded-make-info): Replace undeclared variable by new
-       variable.  When selecting region with positive prefix
-       argument, use end of previous line instead of beginning of line.
-
-       * calc/calc-aent.el (calc-arg-values): Declare it.
-
-       * calc/calc-ext.el (calc-help-map, calc-alg-map, calc-alg-esc-map):
-       Declare them.
-
-       * calc/calc-stuff.el (math-decls-cache-tag): Declare it.
-
-       * calc/calc.el (calc-alg-map): Declare it.
-
-       * calc/calcalg2.el (math-decls-cache, math-decls-all): Declare them.
-
-2005-05-28  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-all-registers): New variable.
-       (gdb-registers-buffer, toggle-gdb-all-registers):
-       Toggle display of floating point registers.
-       (gdb-registers-mode-map): Bind SPC to toggle-gdb-all-registers.
-
-       * progmodes/gud.el (gud-goto-info): Use info.  Don't use require.
-       (toggle-gud-tooltip-dereference):
-       Rename from gud-toggle-tooltip-dereference.
-
-2005-05-27  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * info.el (Info-goto-node): Revert autoload addition (2004-06-12).
-
-2005-05-27  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-prog.el (calc-kbd-report): Remove.
-       (calc-kbd-query): Rewrite.
-
-2005-05-27  Juanma Barranquero  <lekktu@gmail.com>
-
-       * image.el (image-library-alist): Move to image.c.
-       (image-type-available-p): Doc fix.
-
-2005-05-27  Lute Kamstra  <lute@gnu.org>
-
-       * calc/calc.el (calc):
-       * outline.el (outline-1, outline-2, outline-3, outline-4)
-       (outline-5, outline-6, outline-7, outline-8):
-       * textmodes/dns-mode.el (dns-mode):
-       * textmodes/sgml-mode.el (sgml-namespace-face):
-       * textmodes/tex-mode.el (superscript, subscript, tex-math-face)
-       (tex-verbatim-face, tex-use-reftex):
-       * textmodes/texinfo.el (texinfo-heading-face):
-       Specify customization group.
-
-       * longlines.el: Don't require easy-mmode.
-       (longlines-visible-face): Specify customization group.
-
-2005-05-27  Kenichi Handa  <handa@m17n.org>
-
-       * language/cyrillic.el: Add cyrillic-iso8859-5 characters in the
-       encoding table of windows-1251.
-
-       * international/ucs-tables.el (ucs-set-table-for-input):
-       If translation-table-for-input of a coding system is a symbol, get
-       its translation-table property.
-
-       * international/code-pages.el: Don't register a coding system into
-       non-iso-charset-alist more than once.
-       (cp-make-coding-system): Likewise.
-
-2005-05-26  John Wiegley  <johnw@newartisans.com>
-
-       * eshell/esh-cmd.el (eshell-eval-command): If the return value of
-       `eshell-resume-eval' is wrapped in a list, it indicates that the
-       command was run asynchronously.  In that case, unwrap the value
-       before checking the delimiter value.
-
-       * eshell/em-cmpl.el (eshell-complete-parse-arguments): If the
-       character before a space at the end of a line is \, assume the space
-       is part of the last argument rather than a final argument separator.
-
-       * eshell/esh-io.el (eshell-get-target): If `eshell-buffer-shorthand'
-       is in use, and the target is `t' or `nil' (which are the most common
-       values), don't assume that the symbol target is a buffer.
-
-2005-05-26  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * calendar/calendar.el (calendar-mode-line-format):
-       Use mode-line-highlight as mouse-face.
-
-       * time.el (display-time-string-forms, display-time-update):
-       Use mode-line-highlight as mouse-face.
-
-2005-05-26  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc.el (calc-language-alist): Remove extra defvar.
-
-2005-05-26  Lute Kamstra  <lute@gnu.org>
-
-       * arc-mode.el (archive-mode):
-       * bookmark.el (bookmark-read-annotation-mode)
-       (bookmark-edit-annotation-mode, bookmark-bmenu-mode):
-       * bs.el (bs-mode):
-       * calc/calc-yank.el (calc-edit-mode):
-       * calc/calc.el (calc-mode, calc-trail-mode):
-       * calculator.el (calculator-mode):
-       * chistory.el (command-history-mode):
-       * comint.el:
-       * cus-edit.el (custom-mode):
-       * descr-text.el (describe-text-mode):
-       * ebuff-menu.el (Electric-buffer-menu-mode):
-       * ediff-util.el (ediff-mode):
-       * emacs-lisp/re-builder.el (reb-mode):
-       * emulation/vi.el (vi-mode-setup):
-       * emulation/ws-mode.el (wordstar-mode):
-       * eshell/esh-mode.el (eshell-mode):
-       * forms.el (forms-mode):
-       * help-mode.el (help-mode):
-       * hexl.el (hexl-mode):
-       * ibuffer.el (ibuffer-mode):
-       * ielm.el (inferior-emacs-lisp-mode):
-       * info.el (Info-mode, Info-edit-mode):
-       * international/swedish.el:
-       * ledit.el (ledit-from-lisp-mode):
-       * locate.el (locate-mode):
-       * mail/rmail.el (rmail-mode):
-       * mail/rmailedit.el (rmail-edit-mode):
-       * mail/rmailsum.el (rmail-summary-mode):
-       * mail/supercite.el (sc-electric-mode):
-       * net/eudc.el (eudc-mode):
-       * net/quickurl.el (quickurl-list-mode):
-       * net/snmp-mode.el (snmp-mode, snmpv2-mode):
-       * obsolete/ooutline.el (outline-mode):
-       * obsolete/options.el (Edit-options-mode):
-       * obsolete/rnews.el (news-mode):
-       * obsolete/rnewspost.el (news-reply-mode):
-       * play/5x5.el (5x5-mode):
-       * play/decipher.el (decipher-mode, decipher-stats-mode):
-       * play/gomoku.el (gomoku-mode):
-       * play/snake.el (snake-mode):
-       * play/solitaire.el (solitaire-mode):
-       * play/tetris.el (tetris-mode):
-       * progmodes/ada-mode.el (ada-mode):
-       * progmodes/antlr-mode.el (antlr-mode):
-       * progmodes/autoconf.el (autoconf-mode):
-       * progmodes/dcl-mode.el (dcl-mode):
-       * progmodes/delphi.el (delphi-mode):
-       * progmodes/ebrowse.el (ebrowse-tree-mode)
-       (ebrowse-electric-list-mode, ebrowse-member-mode)
-       (ebrowse-electric-position-mode):
-       * progmodes/f90.el (f90-mode):
-       * progmodes/fortran.el (fortran-mode):
-       * progmodes/icon.el (icon-mode):
-       * progmodes/idlw-help.el (idlwave-help-mode):
-       * progmodes/idlw-shell.el (idlwave-shell-mode):
-       * progmodes/idlwave.el (idlwave-mode):
-       * progmodes/inf-lisp.el (inferior-lisp-mode):
-       * progmodes/m4-mode.el (m4-mode):
-       * progmodes/meta-mode.el (metafont-mode, metapost-mode):
-       * progmodes/modula2.el (modula-2-mode):
-       * progmodes/octave-inf.el (inferior-octave-mode):
-       * progmodes/octave-mod.el (octave-mode):
-       * progmodes/pascal.el (pascal-mode):
-       * progmodes/sh-script.el (sh-mode):
-       * progmodes/sql.el (sql-mode, sql-interactive-mode):
-       * progmodes/vhdl-mode.el (vhdl-mode):
-       * progmodes/xscheme.el (scheme-interaction-mode):
-       * replace.el (occur-mode):
-       * ses.el (ses-mode):
-       * simple.el (completion-list-mode):
-       * skeleton.el:
-       * speedbar.el (speedbar-mode):
-       * term.el (term-mode):
-       * terminal.el (terminal-edit-mode):
-       * textmodes/reftex-index.el (reftex-index-mode)
-       (reftex-index-phrases-mode):
-       * textmodes/reftex-sel.el (reftex-select-label-mode)
-       (reftex-select-bib-mode):
-       * textmodes/reftex-toc.el (reftex-toc-mode):
-       * wdired.el (wdired-change-to-wdired-mode):
-       * wid-browse.el (widget-browse-mode):
-       Use run-mode-hooks.
-
-       * array.el (array-mode):
-       * calendar/todo-mode.el (todo-mode):
-       * man.el (Man-mode):
-       * play/landmark.el (lm-mode):
-       * play/mpuz.el (mpuz-mode):
-       Use kill-all-local-variables and run-mode-hooks.
-
-       * subr.el (delay-mode-hooks): Specify indentation.
-
-2005-05-26  Mark A. Hershberger  <mah@everybody.org>
-
-       * xml.el (xml-substitute-special): Don't die for undefined xml
-       entities.
-
-2005-05-26  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-prog.el (calc-user-define-edit): Don't find substring
-       of nil.
-
-2005-05-27  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-frame-address):
-       Rename from gdb-current-address.
-       (gdb-previous-frame-address): Rename from gdb-previous-address.
-       (gdb-selected-frame): Rename from gdb-current-frame.
-       (gdb-get-selected-frame): Rename from gdb-get-current-frame.
-       (gdb-frame-number): Rename from gdb-current-stack-level.
-       (gdb-ann3): Match new mode-name for disassembly buffer.
-       Extend initialization of variables.
-       (gdb-post-prompt): Update disassembly from gdb-frame-handler.
-       (gdb-memory-mode): Use mouse-face in header line.
-       (gdb-assembler-buffer-name): Call it disassembly and give frame
-       in mode line.
-       (gdb-source-spec-regexp, gdb-assembler-custom)
-       (gdb-invalidate-assembler, gdb-frame-handler):
-       Make robust to leading zeroes in address format.
-
-2005-05-26  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-mode): Use `define-derived-mode' to
-       define `org-mode'.
-       (org-agenda-mode): Use `run-mode-hooks' instead of `run-hooks'.
-
-2005-05-26  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * log-edit.el (log-edit-changelog-entries): Distinguish between
-       filenames like xfns.c and fns.c.
-
-2005-05-25  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * buff-menu.el (Buffer-menu-revert-function): Improve handling of
-       point after reverting.
-       (Buffer-menu-make-sort-button): Handle the case where
-       `Buffer-menu-use-header-line' is nil.
-
-2005-05-25  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * vms-patch.el (vms-magic-right-square-brace, vms-magic-colon):
-       New funcs.  In minibuffer-local-completion-map bind `]', `/'
-       and `:' to them.
-
-2005-05-25  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * startup.el (normal-top-level): Allow modification of load-path while
-       we're iterating over it.
-
-2005-05-25  Juanma Barranquero  <lekktu@gmail.com>
-
-       * thumbs.el (thumbs-thumbsdir-max-size, thumbs-temp-file)
-       (thumbs-cleanup-thumbsdir, thumbs-call-convert)
-       (thumbs-resize-interactive, thumbs-insert-image)
-       (thumbs-insert-thumb, thumbs-dired-show-marked)
-       (thumbs-find-image-at-point, thumbs-delete-images)
-       (thumbs-rename-images, thumbs-next-image, thumbs-dired-setroot)
-       (thumbs-increment-image-size, thumbs-decrement-image-size):
-       Fix typos in docstrings.
-
-2005-05-24  Andre Spiegel  <spiegel@gnu.org>
-
-       * progmodes/cperl-mode.el (cperl-vc-header-alist): Obsolete.
-       (cperl-vc-rcs-header, cperl-vc-sccs-header): New user options.
-       (cperl-mode): Use them.
-
-2005-05-24  Juanma Barranquero  <lekktu@gmail.com>
-
-       * window.el (quit-window, shrink-window-if-larger-than-buffer):
-       Doc fixes.
-
-2005-05-24  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-inferior-io-mode-map):
-       Bind C-d to gdb-inferior-io-eof.
-
-       * dired.el (dired-dnd-popup-notice): Use message-box.
-
-2005-05-23  Masatake YAMATO  <jet@gyve.org>
-
-       * bindings.el (mode-line-major-mode-keymap):
-       Bind [mode-line down-mouse-1] to `mouse-major-mode-menu'.
-
-       * faces.el (mode-line-highlight): New face.
-
-       * ruler-mode.el (ruler-mode-ruler): Use mode-line-highlight
-       as mouse-face.
-
-       * bindings.el (top-level, help-echo, mode-line-modified)
-       (mode-line-mule-info, mode-line-eol-desc): Use mode-line-highlight
-       as mouse-face.
-
-2005-05-23  Juanma Barranquero  <lekktu@gmail.com>
-
-       * progmodes/cc-engine.el (c-guess-basic-syntax):
-       Remove spurious call to `zerop'.
-
-       * emacs-lisp/cl.el (acons, pairlis): Add docstring.
-
-2005-05-23  Martin Stjernholm  <bug-cc-mode@gnu.org>
-
-       CC Mode update to 5.30.10:
-
-       * cc-fonts.el (c-font-lock-declarators): Fix bug where the point
-       could go past the limit in decoration level 2, thereby causing
-       errors during interactive fontification.
-
-       * cc-mode.el (c-make-inherited-keymap): Fix cc-bytecomp bug when
-       the file is evaluated interactively.
-
-       * cc-engine.el (c-guess-basic-syntax): Handle operator
-       declarations somewhat better in C++.
-
-       * cc-styles.el, cc-mode.el (c-run-mode-hooks): New helper macro to
-       make use of `run-mode-hooks' which has been added in Emacs 21.1.
-       (c-mode, c++-mode, objc-mode, java-mode, idl-mode, pike-mode)
-       (awk-mode): Use it.
-       (make-local-hook): Suppress warning about obsoleteness.
-
-       * cc-engine.el, cc-align.el, cc-cmds.el
-       (c-append-backslashes-forward, c-delete-backslashes-forward)
-       (c-find-decl-spots, c-semi&comma-no-newlines-before-nonblanks):
-       Compensate for return value from `forward-line' when it has moved
-       but not to a different line due to eob.
-
-       * cc-engine.el (c-guess-basic-syntax): Fix anchoring in
-       `objc-method-intro' and `objc-method-args-cont'.
-
-2005-05-23  Alan Mackenzie  <bug-cc-mode@gnu.org>
-
-       CC Mode update to 5.30.10:
-
-       * cc-mode.el, cc-engine.el, cc-align.el: Change the FSF's address
-       in the copyright statement.  Incidentally, change "along with GNU
-       Emacs" to "along with this program" where it occurs.
-
-       * cc-mode.el: Add a fourth parameter `t' to the awk-mode autoload,
-       so that it is interactive, hence can be found by M-x awk-mode
-       whilst cc-mode is yet to be loaded.  Reported by Glenn Morris
-       <gmorris+emacs@ast.cam.ac.uk>.
-
-       * cc-awk.el: Add character classes (e.g. "[:alpha:]") into AWK
-       Mode's regexps.
-
-2005-05-23  Kevin Ryde  <user42@zip.com.au>
-
-       * cc-align.el (c-lineup-argcont): Ignore conses for {} pairs from
-       c-parse-state, to avoid a lisp error (on bad code).
-
-2005-05-23  Lute Kamstra  <lute@gnu.org>
-
-       * subr.el (font-lock-defaults): Remove defvar as it's already
-       defined in font-core.el.
-
-       * font-lock.el (font-lock-beginning-of-syntax-function): Fix docstring.
-
-2005-05-23  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-info-locals-handler): Make regexps
-       more general and work when GDB variable "print pretty" is on,
-       as with Emacs, for example.
-
-2005-05-22  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * font-core.el: Update comment.
-
-       * emacs-lisp/easy-mmode.el (define-global-minor-mode):
-       Use `after-change-major-mode-hook' instead of `find-file-hook'.
-
-       * buff-menu.el (Buffer-menu-mode): Use `run-mode-hooks'.
-
-2005-05-22  Eli Zaretskii  <eliz@gnu.org>
-
-       * simple.el (yank, yank-pop): Mention `yank-excluded-properties'
-       and `yank-handler' in the doc strings.
-
-2005-05-22  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * emacs-lisp/cl.el (eql): Remove.  It's a builtin already.
-
-2005-05-22  Richard M. Stallman  <rms@gnu.org>
-
-       * help.el (describe-key): Move print-help-return-message call
-       out of conditional.
-
-       * progmodes/etags.el (list-tags): Use with-no-warnings.
-
-       * mail/smtpmail.el (smtpmail-open-stream): Use with-no-warnings.
-       (smtpmail-send-queued-mail): Avoid beginning-of-buffer.
-       (starttls-extra-args, starttls-extra-arguments): Add defvars.
-
-       * mail/mailalias.el (mail-get-names): Avoid beginning-of-buffer.
-
-       * language/viet-util.el (viet-viscii-nonascii-translation-table):
-       Add defvar.
-
-       * emulation/viper-ex.el (viper-ex-work-buf, viper-ex-print-buf):
-       Use defvar, not defconst.
-
-       * hexl.el (hexl-follow-line): Use with-no-warnings.
-
-       * emulation/tpu-extras.el: Use write-file-functions instead of
-       write-file-hooks.
-
-       * dired.el (dired-font-lock-keywords): Fontify files with junk
-       extensions even if marked by -F.
-
-2005-05-22  Juanma Barranquero  <lekktu@gmail.com>
-
-       * emacs-lisp/cl.el (pushnew, cl-macroexpand, floatp-safe, plusp)
-       (minusp, oddp, evenp, mapcar*, list*, copy-list, adjoin, subst):
-       * emacs-lisp/cl-extra.el (coerce, map, maplist, cl-mapc, mapl)
-       (mapcan, mapcon, some, every, notany, notevery, signum, isqrt)
-       (concatenate, list-length, get*, getf, cl-remprop):
-       * emacs-lisp/cl-macs.el (function*, case, ecase, typecase)
-       (etypecase, progv, lexical-let, lexical-let*)
-       (multiple-value-bind, multiple-value-setq, shiftf):
-       Improve argument/docstring consistency.
-
-       * subr.el (focus-frame, unfocus-frame): Revert deletion on 2005-05-01.
-
-2005-05-22  Andre Spiegel  <spiegel@gnu.org>
-
-       * vc-cvs.el (vc-cvs-checkout-model): Handle the case where FILE
-       doesn't exist.
-
-       * vc.el (vc-trunk-p): Add autoload cookie.  The function is used in
-       vc-rcs.el when vc-mistrust-permissions is t, which is not the default.
-
-2005-05-22  Nick Roberts  <nickrob@snap.net.nz>
-
-       * emacs-lisp/bytecomp.el: Remove make-obsolete-variable for
-       already deleted variables: auto-fill-hook, blink-paren-hook,
-       lisp-indent-hook, inhibit-local-variables, unread-command-event,
-       suspend-hooks, comment-indent-hook, meta-flag,
-       before-change-function, after-change-function,
-       font-lock-doc-string-face.
-
-2005-05-21  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * emacs-lisp/derived.el (define-derived-mode): Doc fix.
-
-2005-05-21  Eli Zaretskii  <eliz@gnu.org>
-
-       * mail/rmail.el (rmail-reply): Filter the list in reply-to through
-       rmail-dont-reply-to.
-
-2005-05-21  Frederik Fouvry  <fouvry@CoLi.Uni-SB.DE>
-
-       * mail/sendmail.el (mail-send): Use [[:space:]] instead of a
-       literal blank when splitting new-header-values.
-
-2005-05-21  Matt Hodges  <MPHodges@member.fsf.org>
-
-       * calendar/cal-menu.el (cal-menu-update): Add separator as a
-       string so that tmm doesn't create a completion entry for it.
-
-       * textmodes/table.el (table-disable-menu): Ditto.
-
-2005-05-21  Richard M. Stallman  <rms@gnu.org>
-
-       * progmodes/idlwave.el (idlwave-doc-header): Use insert-file-contents.
-
-       * progmodes/flymake.el (flymake-makehash): Use with-no-warnings.
-
-       * net/rcompile.el (remote-compile): Use compilation-start.
-
-       * tmm.el (tmm-shortcut): Avoid using beginning-of-buffer.
-
-2005-05-21  Daniel Pfeiffer  <occitan@esperanto.org>
-
-       * files.el (auto-mode-alist): Check GNUmakefile before makefile.
-       Default to makefile-bsdmake-mode on BSD systems.
-
-       * imenu.el (imenu-generic-expression, imenu--generic-function'):
-       REGEXP may also be a search function now.  The part of doc-string
-       for describing the structure was 95% identical to that of
-       `imenu--generic-function'.  Unify it there.
-
-       * progmodes/make-mode.el (makefile-imenu-generic-expression):
-       Use function to find dependencies, because regexp alone is so complex,
-       it easily goes into an endless loop.
-       (makefile-makepp-mode): Also add submenu for Perl functions
-       defined in the makefile.
-       (makefile-bsdmake-mode): Special imenu-generic-expression no
-       longer needed, due to function call.
-       (makefile-match-dependency): Take BOUND into account when checking
-       if we're through.
-
-2005-05-20  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-units.el (calc-invalidate-units-table):
-       Use inhibit-read-only.
-       (math-build-units-table-buffer): Use view-mode.
-
-2005-05-20  David Kastrup  <dak@gnu.org>
-
-       * emacs-lisp/easymenu.el (easy-menu-add): Correct docstring since
-       easy-menu-add is not a nop on Emacs; and clarify when to call it.
-
-2005-05-20  Lute Kamstra  <lute@gnu.org>
-
-       * diff-mode.el (diff-header-face, diff-file-header-face)
-       (diff-index-face, diff-hunk-header-face, diff-removed-face)
-       (diff-added-face, diff-changed-face, diff-function-face)
-       (diff-context-face, diff-nonexistent-face): Put them in the
-       diff-mode customization group.
-
-2005-05-20  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/vhdl-mode.el (vhdl-font-lock-match-item): Simplify regexp.
-
-       * progmodes/sh-script.el (sh-mode, sh-get-word): Minor regexp fixes.
-
-       * font-lock.el (lisp-font-lock-keywords-2): Don't error.
-       Minor regexp-optimization.
-
-2005-05-20  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-agenda-toggle-time-grid): New command.
-       (org-agenda-use-time-grid, org-agenda-time-grid): New options.
-       (org-agenda-add-time-grid-maybe): New function.
-       (org-agenda): Call `org-agenda-add-time-grid-maybe'.
-       (org-table-create): `dotimes' instead of `mapcar'.
-       (org-xor): Simplify implementation.
-       (org-agenda): `inhibit-redisplay' turned on.
-       (org-agenda-change-all-lines): Use `org-format-agenda-item' to get
-       a consistent line after a state change.
-       (org-agenda-remove-times-when-in-prefix): New option.
-       (org-prefix-has-time): New variable.
-       (org-parse-time-string): Optional argument NODEFAULT.
-       (org-format-agenda-item): Parse items for time-of-day
-       specifications and move these into the prefix if possible.
-       (org-agenda-priority): Get current heading, not previous heading
-       during agenda remote editing.
-
-2005-05-20  Juanma Barranquero  <lekktu@gmail.com>
-
-       * emacs-lisp/cl-seq.el (reduce, fill, replace, remove*)
-       (remove-if, remove-if-not, delete*, delete-if, delete-if-not)
-       (remove-duplicates, delete-duplicates, substitute)
-       (substitute-if, substitute-if-not, nsubstitute, nsubstitute-if)
-       (nsubstitute-if-not, find, find-if, find-if-not, position)
-       (position-if, position-if-not, count, count-if, count-if-not)
-       (mismatch, search, sort*, stable-sort, merge, member*)
-       (member-if, member-if-not, assoc*, assoc-if, assoc-if-not)
-       (rassoc*, rassoc-if, rassoc-if-not, union, nunion)
-       (intersection, nintersection, set-difference, nset-difference)
-       (set-exclusive-or, nset-exclusive-or, subsetp, subst-if)
-       (subst-if-not, nsubst, nsubst-if, nsubst-if-not, sublis)
-       (nsublis, tree-equal): Improve argument/docstring consistency.
-
-       * subr.el (send-string, send-region): Remove obsolescence declaration.
-       (window-dot, set-window-dot, read-input, show-buffer)
-       (eval-current-buffer, string-to-int):
-       Add release number to obsolescence declarations.
-
-2005-05-19  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-magic-forward-char): Enter ido-find-file at end of input.
-       (ido-magic-backward-char): Enter ido-switch-buffer at start of input.
-
-2005-05-20  Matt Hodges  <MPHodges@member.fsf.org>
-
-       * faces.el (list-faces-display): Make back button respect optional
-       regexp arg.
-
-2005-05-19  Juanma Barranquero  <lekktu@gmail.com>
-
-       * calculator.el (calculator-radix-grouping-mode)
-       (calculator-radix-grouping-digits, calculator-displayer)
-       (calculator-radix-grouping-separator, calculator-copy-displayer):
-       * dabbrev.el (dabbrev-search-these-buffers-only):
-       * diff-mode.el (diff-jump-to-old-file, diff-update-on-the-fly)
-       (diff-advance-after-apply-hunk, diff-mode-hook)
-       (diff-minor-mode-prefix):
-       * imenu.el (imenu-use-popup-menu):
-       * jit-lock.el (jit-lock-context-time):
-       * newcomment.el (comment-fill-column, comment-column)
-       (comment-style, comment-padding, comment-multi-line)
-       (comment-empty-lines, comment-auto-fill-only-comments):
-       * reveal.el (reveal-around-mark):
-       * uniquify.el (uniquify-buffer-name-style)
-       (uniquify-after-kill-buffer-p)
-       (uniquify-ask-about-buffer-names-p, uniquify-ignore-buffers-re)
-       (uniquify-min-dir-content, uniquify-separator)
-       (uniquify-trailing-separator-p, uniquify-strip-common-suffix):
-       * w32-vars.el (w32-fixed-font-alist):
-       * emacs-lisp/testcover.el (testcover-potentially-1value-functions):
-       * obsolete/rsz-mini.el (resize-minibuffer-frame-max-height):
-       * progmodes/antlr-mode.el (antlr-font-lock-maximum-decoration):
-       * progmodes/perl-mode.el (perl-indent-level)
-       (perl-continued-statement-offset, perl-continued-brace-offset)
-       (perl-brace-offset, perl-brace-imaginary-offset)
-       (perl-label-offset, perl-indent-continued-arguments)
-       (perl-tab-always-indent, perl-tab-to-comment, perl-nochange):
-       * progmodes/tcl.el (tcl-indent-level)
-       (tcl-continued-indent-level, tcl-auto-newline)
-       (tcl-tab-always-indent, tcl-electric-hash-style)
-       (tcl-help-directory-list, tcl-use-smart-word-finder)
-       (tcl-application, tcl-command-switches, tcl-prompt-regexp)
-       (inferior-tcl-source-command):
-       * textmodes/fill.el (enable-kinsoku):
-       * textmodes/reftex-vars.el (reftex-index-phrases-wrap-long-lines):
-       * textmodes/table.el (table-yank-handler):
-       Specify missing group (and type, if simple) in defcustom.
-
-2005-05-19  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * progmodes/compile.el (compilation-finish-function): Fix defvar.
-
-2005-05-19  Richard M. Stallman  <rms@gnu.org>
-
-       * progmodes/make-mode.el (makefile-mode): Use run-mode-hooks.
-
-       * subr.el (event-basic-type): Don't get an error.
-       (left-fringe-p): Function deleted.
-
-       * buff-menu.el (Buffer-menu-buffer-face): In group Buffer-menu.
-       (list-buffers-noselect): Set `font-lock-face' property, not `face'.
-
-       * dired-aux.el (dired-copy-file-recursive): Handle symlinks
-       in recursive copy.
-
-       * frame.el (show-trailing-whitespace): In group `whitespace-faces'.
-
-       * emacs-lisp/byte-run.el (eval-when-compile): Doc fix.
-
-       * emacs-lisp/bytecomp.el
-       (byte-compile-file-form-custom-declare-variable):
-       Call byte-compile-nogroup-warn if appropriate.
-
-       * progmodes/compile.el (compilation-finish-function): Mark obsolete.
-       (compilation-set-window): Don't call left-fringe-p; do it directly.
-
-2005-05-19  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-graph.el (calc-graph-format-data): Make sure
-       var-PlotRejects is bound before trying to check its value.
-
-2005-05-19  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/reftex.el (reftex-isearch-minor-mode): Move the
-       definition of this variable from reftex-global.el to reftex.el,
-       because it is needed in the menu.
-
-2005-05-19  Lute Kamstra  <lute@gnu.org>
-
-       * emacs-lisp/copyright.el (copyright-fix-years): Make sure all
-       years are fixed.  Don't insert a space after a dash.
-
-2005-05-19  Kim F. Storm  <storm@cua.dk>
-
-       * emulation/crisp.el (crisp-home, crisp-end): Put CUA property.
-
-2005-05-19  Daniel Pfeiffer  <occitan@esperanto.org>
-
-       * font-lock.el (lisp-font-lock-keywords-2): Do \\) only in
-       strings, because (eq ... ?\\) is fairly frequent.
-
-       * progmodes/make-mode.el (makefile-add-this-line-targets):
-       Simplify and integrate into `makefile-pickup-targets'.
-       (makefile-add-this-line-macro): Simplify and integrate into
-       `makefile-pickup-macros.
-       (makefile-pickup-filenames-as-targets): Simplify.
-       (makefile-previous-dependency, makefile-match-dependency):
-       Don't stumble over `::'.
-
-2005-05-19  Nick Roberts  <nickrob@snap.net.nz>
-
-       * subr.el (post-command-idle-hook, post-command-idle-delay):
-       Remove obsoletion of post-command-idle-hook and
-       post-command-idle-delay.
-
-       * faces.el (list-faces-display): Provide button when describe-face
-       is called to take user back to the list of faces.
-
-       * help-fns.el (describe-variable): Remove hyperlinks in a
-       variable's value as these are quite frequently inappropriate.
-
-       * follow.el (follow-submit-feedback, follow-mode):
-       Remove references to post-command-idle-hook.
-
-2005-05-18  Daniel Pfeiffer  <occitan@esperanto.org>
-
-       * progmodes/make-mode.el (makefile-previous-dependency)
-       (makefile-match-dependency): Check for := (and in bsd mode also
-       !=) to give a better result, even when font-lock is not on.
-
-2005-05-18  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-help.el (calc-s-prefix-help):
-       Add `calc-copy-special-constant' to help string.
-
-2005-05-18  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * emacs-lisp/eldoc.el (eldoc-mode): Doc fix.
-
-2005-05-18  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-poly.el (math-factor-poly-coefs): Make sure the terms
-       in linear factors are in proper order.
-
-2005-05-18  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/reftex-vars.el (reftex-cite-format-builtin):
-       Support for jurabib.
-
-       * textmodes/reftex.el (featurep): Define aliases for overlay
-       commands, for XEmacs compatibility, and use these aliases in
-       overlay initializations.
-       (reftex-highlight): Use `reftex-move-overlay'.
-       (reftex-unhighlight): Use `reftex-delete-overlay'.
-       (reftex-uniq): Function removed.  Use `reftex-uniquify' instead.
-       (reftex-access-search-path): Use `reftex-uniquify' instead of
-       `reftex-uniq'.
-
-       * textmodes/reftex-sel.el (reftex-select-unmark): Overlay
-       `before-string' property modification enables for Emacs as well.
-       (reftex-select-item): Use `reftex-delete-overlay'.
-       (reftex-select-mark): Use `reftex-make-overlay' and
-       `reftex-overlay-put'.
-       (reftex-select-unmark): Use `reftex-delete-overlay' and
-       `reftex-overlay-put'.
-
-2005-05-18  Lute Kamstra  <lute@gnu.org>
-
-       * emacs-lisp/lisp.el (check-parens): Fix docstring.
-
-2005-05-18  Juanma Barranquero  <lekktu@gmail.com>
-
-       * add-log.el (add-change-log-entry):
-       * array.el (array-make-template, array-reconfigure-rows)
-       (array-init-max-row, array-init-max-column)
-       (array-init-columns-per-line, array-init-field-width):
-       * replace.el (replace-match-maybe-edit, perform-replace):
-       * textmodes/spell.el (spell-region):
-       Replace `read-input' by `read-string'.
-
-       * forms.el (forms-mode):
-       * finder.el (finder-compile-keywords):
-       * shadowfile.el (shadow-read-files):
-       Replace `eval-current-buffer' by `eval-buffer'.
-
-       * terminal.el (te-pass-through):
-       * net/ange-ftp.el (ange-ftp-process-filter, ange-ftp-gwp-filter)
-       (ange-ftp-raw-send-cmd):
-       * net/telnet.el (telnet-interrupt-subjob, telnet-c-z)
-       (send-process-next-char, telnet-initial-filter, telnet):
-       Replace `send-string' by `process-send-string'.
-
-       * progmodes/prolog.el (inferior-prolog-mode): Doc fix.
-       (prolog-consult-region): Replace `send-string' by
-       `process-send-string'; replace `send-region' by `process-send-region'.
-
-       * progmodes/delphi.el (delphi-log-msg):
-       Replace `set-window-dot' by `set-window-point'.
-
-       * subr.el (window-dot, set-window-dot, read-input, send-string)
-       (send-region, show-buffer, eval-current-buffer):
-       Make really obsolete, as the comment says.
-
-2005-05-17  Kim F. Storm  <storm@cua.dk>
-
-       * emulation/cua-base.el (cua-use-hyper-key): Doc fix.
-       (cua--init-keymaps): Bind C-return instead of S-return to set
-       rectangle mark.
-
-       * emulation/cua-rect.el (cua--init-rectangles): Bind C-return
-       instead of S-return to toggle/clear rectangle mark.
-
-2005-05-17  Daniel Pfeiffer  <occitan@esperanto.org>
-
-       * progmodes/make-mode.el (makefile-dependency-skip): New variable.
-       (makefile-macroassign-regex, makefile-make-font-lock-keywords):
-       Also fontify plain strings assigned to variables, mostly so that a
-       colon has a face and is thus not taken as a dependency separator.
-       (makefile-previous-dependency): Inline the new matcher, because it
-       is too complex to work in both directions.
-       (makefile-match-dependency): Eliminate `backward' arg (see above).
-       Completely reimplemented so as to not sometimes go into an endless
-       loop.  It should also be more efficient, because first it only
-       searches for `:', instead of applying the very complex regexp.
-       (makefile-mode): Cancel `font-lock-support-mode', because blocks
-       to be fontified in one piece can be too long for JIT.
-       Makefiles are never *that* big.
-
-2005-05-17  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * dired.el (dired-mode): Simplify.
-
-2005-05-17  Lute Kamstra  <lute@gnu.org>
-
-       * emacs-lisp/easy-mmode.el (define-minor-mode): Don't generate a
-       defcustom for the mode hook variable.
-
-       * emacs-lisp/authors.el (authors): Do parse the ChangeLogs of the
-       Emacs Lisp Reference Manual.
-
-2005-05-17  Juanma Barranquero  <lekktu@gmail.com>
-
-       * emacs-lisp/cl.el (eql, floatp-safe, plusp, minusp, oddp)
-       (evenp, list*):
-       * emacs-lisp/cl-macs.el (macrolet, symbol-macrolet):
-       * emacs-lisp/cl-seq.el (subsetp, tree-equal): Doc fixes.
-
-       * net/tramp-smb.el (tramp-smb-open-connection):
-       Pass `tramp-chunksize' as fifth (required) argument.
-
-2005-05-16  Daniel Pfeiffer  <occitan@esperanto.org>
-
-       * font-lock.el (lisp-font-lock-keywords-1):
-       Set `font-lock-negation-char-face' for [^...] char group.
-       (lisp-font-lock-keywords-2): Highlight regexp's \\( \\| \\).
-
-       * progmodes/make-mode.el (makefile-dependency-regex): Turn it into
-       a var, and refine it to mask one more level of nested vars.
-       (makefile-rule-action-regex): Turn it into a var, and refine it so
-       it recognizes backslashed continuation lines as belonging to the
-       same command.
-       (makefile-macroassign-regex): Refine it so it recognizes
-       backslashed continuation lines as belonging to the same command.
-       (makefile-var-use-regex): Don't look at the next char, because it
-       might be the same one to be skipped by the initial [^$], leading
-       to an overlooked variable use.
-       (makefile-make-font-lock-keywords): Remove two parameters, which
-       are now variables that some of the modes set locally.
-       Handle dependency and rule action matching through functions, because
-       regexps alone match too often.  Dependency matching now comes
-       last, so it can check, whether a colon already matched something else.
-       (makefile-mode): Inform that font-lock improves makefile parsing
-       capabilities.
-       (makefile-match-dependency, makefile-match-action): New functions.
-
-2005-05-16  Juanma Barranquero  <lekktu@gmail.com>
-
-       * emacs-lisp/cl-extra.el (equalp): Doc fix.
-
-       * align.el (align-regexp):
-       * ansi-color.el (ansi-color-get-face):
-       * array.el (array-reconfigure-rows, array-init-max-row)
-       (array-init-max-column, array-init-columns-per-line)
-       (array-init-field-width):
-       * dired-aux.el (dired-trample-file-versions):
-       * dired-x.el (dired-mark-sexp):
-       * ediff-diff.el (ediff-extract-diffs, ediff-get-diff3-group):
-       * edmacro.el (edmacro-finish-edit, edmacro-parse-keys):
-       * emerge.el (emerge-extract-diffs, emerge-get-diff3-group):
-       * faces.el (face-read-integer):
-       * files.el (backup-extract-version, insert-directory):
-       * hexl.el (hexl-insert-decimal-char):
-       * server.el (server-process-filter):
-       * shell.el (shell-extract-num):
-       * startup.el (command-line-1):
-       * term.el (term-command-hook):
-       * time-stamp.el (time-stamp, time-stamp-string-preprocess)
-       (time-stamp-do-number):
-       * time.el (display-time-update):
-       * timezone.el (timezone-parse-date, timezone-zone-to-minute)
-       (timezone-fix-time):
-       * vms-patch.el (vms-suspend-resume-hook):
-       * calendar/appt.el (appt-convert-time):
-       * calendar/cal-bahai.el (mark-bahai-diary-entries):
-       * calendar/cal-hebrew.el (mark-hebrew-diary-entries):
-       * calendar/cal-islam.el (mark-islamic-diary-entries):
-       * calendar/calendar.el (calendar-cursor-to-date)
-       (calendar-star-date):
-       * calendar/diary-lib.el (diary-attrtype-convert)
-       (mark-diary-entries, diary-entry-time):
-       * calendar/solar.el (solar-get-number):
-       * emacs-lisp/lisp-mnt.el (lm-last-modified-date):
-       * emacs-lisp/re-builder.el (reb-display-subexp):
-       * emulation/edt.el (edt-set-scroll-margins):
-       * emulation/tpu-extras.el (tpu-set-scroll-margins):
-       * emulation/vip.el (vip-get-ex-token, vip-get-ex-buffer)
-       (vip-get-ex-count):
-       * emulation/viper-ex.el (viper-get-ex-token)
-       (viper-get-ex-buffer, viper-get-ex-count, ex-next):
-       * international/fontset.el (fontset-plain-name):
-       * mail/feedmail.el (feedmail-look-at-queue-directory):
-       * mail/mailalias.el (mail-get-names):
-       * mail/rmail.el (rmail-convert-to-babyl-format):
-       * mail/rmailsum.el (rmail-make-basic-summary-line)
-       (rmail-summary-next-same-subject, rmail-summary-rmail-update)
-       (rmail-summary-goto-msg):
-       * mail/smtpmail.el (smtpmail-read-response):
-       * net/ange-ftp.el (ange-ftp-guess-hash-mark-size)
-       (ange-ftp-vms-add-file-entry):
-       * play/gametree.el (gametree-looking-at-ply)
-       (gametree-current-branch-score):
-       * progmodes/ada-xref.el (ada-prj-find-prj-file)
-       (ada-xref-find-in-modified-ali, ada-find-in-src-path):
-       * progmodes/cperl-mode.el (condition-case):
-       * progmodes/ebrowse.el (ebrowse-set-tree-indentation)
-       (ebrowse-set-member-buffer-column-width)
-       (ebrowse-select-1st-to-9nth):
-       * progmodes/etags.el (etags-snarf-tag):
-       * progmodes/flymake.el (flymake-parse-line):
-       * progmodes/idlw-shell.el (idlwave-shell-parse-line)
-       (idlwave-shell-filter-bp, idlwave-shell-goto-next-error)
-       (idlwave-shell-menu-def):
-       * progmodes/ps-mode.el (ps-run-goto-error):
-       * progmodes/vhdl-mode.el (vhdl-read-offset, vhdl-load-cache)
-       (vhdl-speedbar-contract-level):
-       * term/mac-win.el (x-handle-numeric-switch):
-       * term/sun-mouse.el (sun-get-frame-data):
-       * term/w32-win.el (x-handle-numeric-switch):
-       * term/x-win.el (x-handle-numeric-switch):
-       * textmodes/ispell.el (ispell-parse-output):
-       * textmodes/nroff-mode.el (nroff-outline-level):
-       * textmodes/reftex-cite.el (reftex-bib-sort-year)
-       (reftex-bib-sort-year-reverse, reftex-format-citation):
-       * textmodes/reftex-parse.el (reftex-init-section-numbers)
-       (reftex-section-number):
-       * textmodes/texinfmt.el (texinfo-paragraphindent):
-       Replace `string-to-int' by `string-to-number'.
-
-       * international/latexenc.el: Add page marker to force the "Local
-       Variables:" string out of the last page.
-
-2005-05-16  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-tooltip-mode): Add gud prefix to
-       tooltip-change-major-mode.
-       (gud-tooltip-print-command): Remove case where gud-minor-mode
-       is gdb ("--fullname").
-       (gud-tooltip-tips): Turn GUD tooltips off for this case and
-       explain to user.
-
-2005-05-16  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-store.el (calc-copy-special-constant): New function.
-
-       * calc/calc-ext.el (calc-init-extensions): Add binding for
-       `calc-copy-special-constant'.
-
-       * calc/calc-prog.el (calc-edit-format-macro-buffer): Add a case
-       for the `calc-copy-special-constant' command.
-
-2005-05-16  Nick Roberts  <nickrob@snap.net.nz>
-
-       * subr.el (left-fringe-p): New function.
-
-       * progmodes/compile.el (compilation-setup): Set local value of
-       overlay-arrow-string to "" always.
-       (compilation-set-window): Left fringe then don't scroll.
-       No left fringe then no arrow and scroll message to top.
-       (compilation-context-lines): Adjust doc string accordingly.
-
-2005-05-16  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-magic-forward-char, ido-magic-backward-char)
-       (ido-magic-delete-char): New commands for C-f, C-b, C-d.
-       (ido-wide-find-dir-or-delete-dir): New command for M-d.
-       (ido-define-mode-map): Bind them.  Add C-x prefix to fallback commands.
-       (ido-read-file-name): Handle commands with ido property value
-       equal to find-file as reading a file name, to allow C-d to enter dired.
-       (ibuffer-find-file): Add ido property with value find-file.
-
-2005-05-15  Kim F. Storm  <storm@cua.dk>
-
-       * subr.el (open-network-stream-nowait): Remove.
-       (open-network-stream-server): Remove.
-
-2005-05-15  Richard M. Stallman  <rms@gnu.org>
-
-       * faces.el (describe-face): Output a definition link button.
-
-       * help-mode.el (help-face-def): New button type.
-
-       * emacs-lisp/copyright.el (copyright-fix-years):
-       Match properly if the first year is 2-digit.
-       Don't mess up the whitespace after the years by filling.
-
-       * dired-aux.el (dired-mark-confirm):
-       Pass t to dired-get-marked-files for DISTINGUISH-ONE-MARKED.
-
-       * dired.el (dired-map-over-marks): New arg DISTINGUISH-ONE-MARKED.
-       (dired-get-marked-files): New arg DISTINGUISH-ONE-MARKED.
-       (dired-mark-pop-up): Handle FILES = (t FILE) specially.
-
-       * emacs-lisp/lisp-mode.el (lisp-mode-variables):
-       Set font-lock-comment-start-skip.
-
-       * font-lock.el (font-lock-comment-start-skip): New variable.
-       (font-lock-comment-end-skip): New variable.
-       (font-lock-fontify-syntactically-region): Use them if non-nil.
-
-2005-05-15  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-store.el (calc-store-value): Return a string rather
-       than display it as a message.
-       Use calc-var-name for variable name.
-       (calc-store-into): Add the result of calc-store-value to message.
-       (calc-copy-variable): Add a message.
-       (calc-store-exchange): Improve error messages.
-       (calc-store-binary, calc-store-map): Don't reset the values of
-       special constants.
-
-2005-05-14  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * emacs-lisp/derived.el (define-derived-mode): Add link to Elisp
-       manual to docstring.
-
-       * files.el (hack-local-variables-confirm): Add STRING argument.
-       Make the function handle non file visiting buffers correctly.
-       (hack-local-variables-prop-line, hack-local-variables)
-       (hack-one-local-variable): Use STRING arg of
-       `hack-local-variables-confirm'.
-
-2005-05-14  Michael Albinus  <michael.albinus@gmx.de>
-
-       Sync with Tramp 2.0.49.
-
-       * net/tramp.el (tramp-handle-dired-call-process)
-       (tramp-handle-insert-directory):`insert-buffer' cannot be used
-       because the contents of the Tramp buffer is changed before
-       insertion (`expand-file' and alike).
-       (tramp-handle-insert-directory): If `localname' has an empty
-       nondirectory name, it must not be quoted.
-       (tramp-pre-connection): Add parameter CHUNKSIZE.  Make local
-       variable `tramp-chunksize'.  Change callees.
-       (tramp-open-connection-setup-interactive-shell): Check remote host
-       for buggy `send-process-string' implementation.
-       Set `tramp-chunksize' if found.  Reported by Michael Kifer
-       <kifer@cs.sunysb.edu> (and a lot of other people all the years).
-       (tramp-handle-shell-command): `insert-buffer' cannot be used
-       because the contents of the Tramp buffer is changed before
-       insertion (`expand-file' and alike).  Reported by Fr\e,Ai\e(Bd\e,Ai\e(Bric Bothamy
-       <frederic.bothamy@free.fr>.
-       (tramp-set-auto-save): Actions should be done for Tramp file name
-       handler only.  Ange-FTP has its own auto-save mechanism.
-       Reported by Richard G. Bielawski <Richard.G.Bielawski@wellsfargo.com>.
-       (tramp-set-auto-save-file-modes): Set file modes of
-       `buffer-auto-save-file-name' to ?\600 as fallback solution.
-       Reported by Ferenc Wagner <wferi@tba.elte.hu>.
-       (tramp-bug): Remove obsolete variable.
-       (tramp-append-tramp-buffers): Rewrite partly.  More suitable check
-       for presence of `mml-mode'.  Make it running for older Emacsen as well.
-
-2005-05-14  John Paul Wallington  <jpw@pobox.com>
-
-       * ibuf-ext.el (define-ibuffer-filter filename):
-       If `dired-directory' is a list, use its car.
-
-2005-05-14  Daniel Brockman  <daniel@brockman.se>  (tiny change)
-
-       * ibuffer.el (define-ibuffer-column filename):
-       If `dired-directory' is a list, use its car.
-
-2005-05-14  Richard M. Stallman  <rms@gnu.org>
-
-       * subr.el (symbol-file): Doc fix.
-
-       * emacs-lisp/bytecomp.el (byte-compile-nogroup-warn): New function.
-       (byte-compile-form): Call byte-compile-nogroup-warn.
-       (byte-compile-warning-types): Doc fix.
-
-       * eshell/esh-mode.el (eshell-find-tag): Use with-no-warnings.
-
-       * progmodes/cc-engine.el (c-literal-faces):
-       Add font-lock-comment-delimiter-face.
-
-       * net/net-utils.el (dig): Use with-no-warnings.
-
-       * mail/supercite.el (sc-cite-frame-alist, sc-uncite-frame-alist)
-       (sc-recite-frame-alist, sc-default-cite-frame)
-       (sc-default-uncite-frame, sc-default-recite-frame)
-       (sc-attrib-selection-list, sc-rewrite-header-list):
-       Mark as risky-local-variable.
-
-       * international/ogonek.el (ogonek-jak, ogonek-how):
-       Don't use beginning-of-buffer.
-
-       * emacs-lisp/eldoc.el (eldoc-documentation-function): Add autoload.
-
-       * calendar/solar.el (solar-data-list): Move definition up.
-
-       * dnd.el (dnd-protocol-alist): Add autoload.
-
-       * progmodes/sh-script.el: Many doc usage fixes.
-       (sh-indent-after-do): Change default to match common styles.
-
-2005-05-13  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * files.el (interpreter-mode-alist)
-       (auto-mode-interpreter-regexp): Doc fixes.
-
-2005-05-13  Matt Hodges  <MPHodges@member.fsf.org>
-
-       * tmm.el (tmm-get-keymap): Include only active menus and menu items.
-
-       * emacs-lisp/easymenu.el (easy-menu-define): Doc fixes.
-
-2005-05-13  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * dired.el (dired-mode): make-variable-buffer-local =>
-       make-local-variable.
-
-2005-05-13  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el (mac-select-convert-to-string): Try coding
-       systems in mac-script-code-coding-systems if specified one cannot
-       encode string for `com.apple.traditional-mac-plain-text'.
-
-2005-05-13  Daniel Pfeiffer  <occitan@esperanto.org>
-
-       * progmodes/make-mode.el (makefile-targets-face)
-       (makefile-shell-face, makefile-makepp-perl-face): New faces.
-       (makefile-dependency-regex): Fix it to not make the colon in
-       $(var:a=b) special.
-       (makefile-rule-action-regex): New regexp for highlighting embedded
-       Shell strings.
-       (makefile-macroassign-regex): Handle != for highlighting as
-       embedded Shell strings.
-       (makefile-var-use-regex): New const.
-       (makefile-statements, makefile-automake-statements)
-       (makefile-gmake-statements, makefile-makepp-statements)
-       (makefile-bsdmake-statements): New consts.
-       (makefile-make-font-lock-keywords): New function.
-       (makefile-automake-font-lock-keywords)
-       (makefile-gmake-font-lock-keywords)
-       (makefile-makepp-font-lock-keywords)
-       (makefile-bsdmake-font-lock-keywords): New consts.
-       (makefile-mode-map): Add switchers between the various submodes.
-       (makefile-mode): Document the availability of the variants.
-       (makefile-automake-mode, makefile-gmake-mode)
-       (makefile-makepp-mode, makefile-bsdmake-mode): New derived modes.
-
-       * files.el (auto-mode-alist, interpreter-mode-alist): Set up the
-       new variants of makefile-mode.
-
-2005-05-12  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * font-lock.el (font-lock-comment-delimiter-face): Fix up
-       the inheritance.
-
-2005-05-12  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * progmodes/inf-lisp.el (inferior-lisp-mode-hook)
-       (inferior-lisp-load-hook): Convert defcustoms back to defvars.
-
-       * files.el (normal-mode): Extend the scope of the
-       `enable-local-variables' binding to include the `set-auto-mode' call.
-       (magic-mode-alist): Doc fix.
-
-2005-05-12  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * font-lock.el (font-lock-comment-delimiter-face): Inherit from
-       font-lock-comment-face rather than copying its setting.
-
-2005-05-12  Andreas Schwab  <schwab@suse.de>
-
-       * eshell/esh-mode.el (eshell-send-input): Doc fix.
-
-2005-05-12  Lute Kamstra  <lute@gnu.org>
-
-       * emacs-lisp/generic.el (define-generic-mode): Don't generate a
-       defcustom for the mode hook variable.  Delete the last argument.
-       * generic-x.el: Fix callers of define-generic-mode.
-       (generic-x-modes): Delete group.
-       (show-tabs-tab-face, show-tabs-space-face): Put them in the
-       generic-x customization group.
-
-2005-05-12  Kim F. Storm  <storm@cua.dk>
-
-       * font-lock.el (font-lock-negation-char-face): Default to "off".
-
-       * progmodes/cc-fonts.el (c-basic-matchers-before): Don't apply
-       font-lock-negation-char-face to ! in !=.
-
-2005-05-12  Masatake YAMATO  <jet@gyve.org>
-
-       * add-log.el (find-change-log): Fix typos in the docstring
-       of function.
-
-2005-05-11  Arne J\e,Ax\e(Brgensen  <arne@arnested.dk>
-
-       * international/latexenc.el (latexenc-find-file-coding-system):
-       Avoid `re-search-forward' when looking for input encoding because
-       of speed and safety.  Better regular expressions for recognizing
-       input encoding.  Limit a search for TeX-master/tex-main-file to
-       the local variable section.
-
-2005-05-11  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * progmodes/sh-script.el (sh-mode-default-syntax-table): Set the
-       syntax of $ to "'" (quote).
-
-2005-05-11  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * dnd.el (dnd-protocol-alist): Improve custom type.
-
-       * dired.el (dired-dnd-protocol-alist): New variable.
-       (dired-mode): Use `dired-dnd-protocol-alist'.  Move call of
-       `dired-mode-hook' to the end.
-
-2005-05-11  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * font-lock.el (font-lock-fontify-syntactically-region): Don't use
-       comment-end if comment-start-skip is not set.
-       Obey the font-lock-comment-delimiter-face variables.
-
-2005-05-11  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * files.el (executable-find): Move from executable.el.  Use
-       locate-file.
-       * progmodes/executable.el (executable-find): Move to files.el.
-
-       * font-lock.el (font-lock-fontify-keywords-region): Use a marker
-       when trying to ensure forward progress.
-
-2005-05-11  Chong Yidong  <cyd@stupidchicken.com>
-
-       * mouse-sel.el (mouse-sel-follow-link-p): New function.
-       (mouse-select, mouse-select-internal, mouse-extend-internal):
-       Use it to implement mouse-1-click-follows-link functionality.
-
-2005-05-11  Richard M. Stallman  <rms@gnu.org>
-
-       * font-lock.el (font-lock-fontify-syntactically-region):
-       Use font-lock-comment-delimiter-face for comment delimiters.
-
-2005-05-10  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-help.el (calc-m-prefix-help): Add mention of
-       preserving embedded modes.
-
-2005-05-10  Richard M. Stallman  <rms@gnu.org>
-
-       * progmodes/sh-script.el (sh-indent-for-do): Default to 0.
-
-       * progmodes/ada-mode.el (ada-adjust-case-skeleton):
-       Move from ada-stmt.el.
-       (ada-mode): Add ada-adjust-case-skeleton to skeleton-end-hook.
-
-       * progmodes/ada-stmt.el (ada-adjust-case-skeleton):
-       Move to ada-mode.el.
-       (ada-stmt-mode-hook): Delete; do the work in ada-mode.
-
-       * cus-edit.el (custom-file): Call file-chase-links.
-
-       * files.el (read-directory-name): Fix previous change.
-       (hack-local-variables-confirm): New function.
-       (hack-local-variables-prop-line, hack-local-variables)
-       (hack-one-local-variable): Use it.
-
-2005-05-10  Lute Kamstra  <lute@gnu.org>
-
-       * font-lock.el (font-lock-keywords-alist)
-       (font-lock-removed-keywords-alist): Clarify docstrings.
-
-2005-05-10  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-macro-info): New variable.
-       (gdb-source-info): Check for preprocessor info.
-       (gdb-tooltip-print-1): New function.  Don't print tooltip if it is
-       a macro for a function.
-       (gdb-info-breakpoints-custom): Try to find file again if not already
-       found (user might have used GDB dir command).
-       (gdb-get-location): Update gdb-location-alist correctly for change
-       to gdb-info-breakpoints-custom.
-
-       * progmodes/gud.el (gud-tooltip-mode): Require tooltip to be safe.
-       (gud-tooltip-print-command): Add gdbmi case.
-       (gud-tooltip-tips): Call gdb-tooltip-print-1 first if there is
-       preprocessor info.
-
-2005-05-09  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * startup.el (fancy-splash-insert): Fix typo in doc string.
-
-2005-05-09  Juanma Barranquero  <lekktu@gmail.com>
-
-       * obsolete/float.el (string-to-float):
-       * obsolete/hilit19.el (hilit-add-pattern):
-       * obsolete/rnews.el (news-parse-range, news-select-message)
-       (news-get-pruned-list-of-files): Replace `string-to-int' by
-       `string-to-number'.
-
-       * obsolete/uncompress.el: Set `find-file-not-found-functions', not
-       `find-file-not-found-hooks'; use `add-hook'.
-       (uncompress-while-visiting): Set `write-file-functions', not
-       `write-file-hooks'; use `add-hook'.
-
-2005-05-09  Kim F. Storm  <storm@cua.dk>
-
-       * emulation/cua-base.el (cua-copy-region, cua-cut-region)
-       (cua-paste): Handle clipboard action.
-       (cua--init-keymaps): Remap clipboard-kill-region and
-       clipboard-kill-ring-save.
-
-2005-05-08  Eli Zaretskii  <eliz@gnu.org>
-
-       * emacs-lisp/easy-mmode.el (easy-mmode-pretty-mode-name):
-       Improve commentary.
-
-       * simple.el (next-error-overlay-arrow-position): Revert the change
-       made on 2005-04-30.
-
-2005-05-07  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calcsel2.el (calc-commute-left, calc-commute-right)
-       (calc-sel-unpack, calc-sel-isolate): Rename variable `reselect' to
-       `calc-sel-reselect'.
-
-       * calc/calc-mode.el (calc-save-modes): Reset the modes list if
-       Calc is in embedded mode.
-
-2005-05-07  Eli Zaretskii  <eliz@gnu.org>
-
-       * progmodes/compile.el (compilation-setup):
-       Set overlay-arrow-string to an empty string on text terminals.
-
-       * textmodes/ispell.el (ispell-program-name): Try looking for
-       "aspell" along exec-path, and if found, use it as the default
-       speller program.
-
-2005-05-07  Jirka Kosek  <jirka@kosek.cz>  (tiny change)
-
-       * international/mule.el (sgml-xml-auto-coding-function):
-       Recognize encoding='FOO' in single quotes as well as in double quotes.
-
-2005-05-07  Johan Bockg\e,Ae\e(Brd  <bojohan@dd.chalmers.se>
-
-       * emacs-lisp/cl-macs.el (cl-transform-lambda): Recognize `declare'
-       as well as `interactive', so that defmacro* would recognize
-       `declare' forms.
-
-2005-05-07  Eli Zaretskii  <eliz@gnu.org>
-
-       * emacs-lisp/easy-mmode.el (easy-mmode-pretty-mode-name):
-       Explain more about the LIGHTER arg's usage in the doc string.
-       Add commentary to clarify what the code does.  Fix the regexp that
-       strips whitespace from LIGHTER.  Quote LIGHTER before using it,
-       since it could have characters special to regular expressions.
-
-2005-05-07  Matt Hodges  <MPHodges@member.fsf.org>  (tiny change)
-
-       * replace.el (occur-1): Bind inhibit-read-only so that
-       erase-buffer doesn't barf on read-only text properties (likewise
-       for add-text-properties in occur-engine).  Mark buffer as unmodified.
-       (occur-engine): Don't set buffer-read-only here.
-
-2005-05-06  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * pcvs.el (cvs-mode-commit, cvs-mode-edit-log): Don't fiddle with
-       list-buffers-directory.  This caused the *cvs-commit* buffer to be
-       sometimes mistakenly reused as a *cvs* buffer.
-
-2005-05-07  Nick Roberts  <nickrob@snap.net.nz>
-
-       * tooltip.el: Move code for GUD tooltips into gud.el.
-       (require): CL no longer needed to compile case.
-       (tooltip-mode): Do not toggle functions for GUD tooltips.
-       (tooltip-gud-tips-p): Remove.  Replace with minor mode
-       gud-tooltip-mode in gud.el.
-       (tooltip-gud-modes, tooltip-gud-display, tooltip-gud-echo-area)
-       (tooltip-gud-toggle-dereference): Rename in gud.el by replacing
-       tooltip-gud prefix with gud-tooltip and obsolete.
-       (tooltip-change-major-mode, tooltip-activate-mouse-motions-if-enabled)
-       (tooltip-mouse-motions-active, tooltip-activate-mouse-motions)
-       (tooltip-mouse-motion): Mouse movement functions/variable.
-       Rename in gud.el by adding gud prefix.
-       (tooltip-gud-original-filter, tooltip-gud-dereference)
-       (tooltip-gud-event, tooltip-toggle-gud-tips)
-       (tooltip-gud-process-output, tooltip-gud-print-command)
-       (tooltip-gud-tips): GUD tooltip functions/variables.  Rename in
-       gud.el by replacing tooltip-gud prefix with gud-tooltip.
-       (gdb-tooltip-print): Move to gdb-ui.el.
-
-       * progmodes/gud.el: Move code for GUD tooltips from tooltip.el.
-       (require): CL needed to compile case.
-       (gud-tooltip-mode): Use to toggle GUD tooltips instead of
-       tooltip-gud-tips-p.  Make it a minor-mode.
-       (gud-find-file): Only prepare GUD tooltips if gud-tooltip-mode is t.
-       (gud-menu-map): GUD tooltips use gud-tooltip-mode now.
-       (gud-tooltip-modes, gud-tooltip-display, gud-tooltip-echo-area)
-       (gud-tooltip-change-major-mode)
-       (gud-tooltip-activate-mouse-motions-if-enabled)
-       (gud-tooltip-mouse-motions-active, gud-tooltip-activate-mouse-motions)
-       (gud-tooltip-mouse-motion, gud-tooltip-toggle-dereference)
-       (gud-tooltip-original-filter, gud-tooltip-dereference)
-       (gud-tooltip-event, tooltip-toggle-gud-tips)
-       (gud-tooltip-process-output, gud-tooltip-print-command)
-       (gud-tooltip-tips): Move from tooltip.el.
-
-       * progmodes/gdb-ui.el (gdb-tooltip-print): Move from tooltip.el.
-       (gdb-cpp-define-alist-flags): Doc fix.
-       (gdb-set-gud-minor-mode-1): Only prepare GUD tooltips if
-       gud-tooltip-mode is t.
-
-2005-05-06  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * net/goto-addr.el (goto-address-fontify): Make sure the overlays
-       evaporate if their text is deleted.
-       (goto-address-at-point): Make it work as a mouse binding as well.
-       (goto-address-at-mouse): Obsolete it.  Update users.
-
-2005-05-06  Glenn Morris  <gmorris@ast.cam.ac.uk>
-
-       * calendar/appt.el (top-level): No longer activate on load.
-
-2005-05-06  Juanma Barranquero  <lekktu@gmail.com>
-
-       * calendar/cal-bahai.el (mark-bahai-diary-entries):
-       * net/webjump.el (webjump):
-       * progmodes/idlw-help.el (idlwave-do-context-help1)
-       (idlwave-highlight-linked-completions):
-       * textmodes/po.el (po-find-file-coding-system-guts):
-       Replace `assoc-ignore-case' by `assoc-string'.
-
-2005-05-06  Eli Zaretskii  <eliz@gnu.org>
-
-       * files.el (locate-file): Doc fix.
-
-       * progmodes/gdb-ui.el (gdb-cpp-define-alist-program): Doc fix.
-       Remove the redundant test for ms-dos.
-
-       * progmodes/cmacexp.el (c-macro-preprocessor): Use locate-file to
-       look for the preprocessor with exec-suffixes.  If not found in
-       standard places, look in exec-path.  Remove most of the tests that
-       used system-type.
-
-       * loadup.el: Load jka-cmpr-hook instead of jka-comp-hook.
-
-       * jka-compr.el (jka-compr-uninstall): Add autoload cookie.
-
-       * jka-cmpr-hook.el: Renamed from jka-comp-hook.el, to avoid
-       file-name clash with jka-compr.el on 8+3 filesystems.
-
-2005-05-06  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el: Don't define or bind scroll bar functions if
-       x-toolkit-scroll-bars is t.
-       (x-select-text, x-get-selection-value): Clear
-       x-last-selected-text-clipboard if x-select-enable-clipboard is
-       nil.
-       (PRIMARY): Put mac-scrap-name property.
-       (mac-select-convert-to-file-url): New function.
-       (public.file-url): New selection target type.  Add to
-       selection-converter-alist.
-       (x-get-selection, x-selection-value): Handle it.
-       (x-cut-buffer-or-selection-value): New alias.
-
-2005-05-05  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
-
-       * textmodes/bibtex.el (bibtex-summary): Use current BibTeX
-       entry to avoid calling bibtex-find-entry with arg global
-       being t.  Remove arg key.
-       (bibtex-summary-function, bibtex-complete-crossref-cleanup)
-       (bibtex-copy-summary-as-kill): Change accordingly.
-
-2005-05-05  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * textmodes/org.el (org-get-entries-from-diary): Remove unused vars.
-       (org-agenda-date-later): Use with-current-buffer.
-
-2005-05-05  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * emacs-lisp/byte-run.el (define-obsolete-function-alias)
-       (define-obsolete-variable-alias): Doc Fixes.
-
-2005-05-06  Kim F. Storm  <storm@cua.dk>
-
-       * simple.el (line-move-1): Fix 2005-04-26 change.  Must still use
-       vertical-motion when selective-display is active.
-
-       * ido.el (ido-setup-hook): New hook.
-       (ido-define-mode-map-hook): Remove hook; use ido-setup-hook instead.
-       (ido-input-stack): New var.
-       (ido-define-mode-map): Bind M-b to ido-push-dir.  Move old
-       ido-next-work-file binding to M-O.
-       Bind M-f to ido-wide-find-file-or-pop-dir.
-       (ido-define-mode-map): Don't run ido-define-mode-map-hook.
-       (ido-read-internal): Run ido-setup-hook.
-       Catch quit in read-file-name and read-string to cancel edit.
-       Handle new push, pop, and pop-all exit codes (for M-b/M-f).
-       Automatically pop-all when completing a directory name (RET).
-       (ido-file-internal): Add with-no-warnings around ffap and dired code.
-       (ido-exit-minibuffer): Use exit-minibuffer instead of throw.
-       (ido-wide-find-file, ido-wide-find-dir): Catch quit to cancel find.
-       (ido-push-dir, ido-pop-dir, ido-wide-find-file-or-pop-dir):
-       New functions for M-b/M-f to move among the directory components.
-       (ido-make-merged-file-list): Catch quit to cancel merge.
-       (ido-make-dir-list): Delete "." when ido-input-stack is non-empty.
-       (ido-completion-help): No warnings for ido-completion-buffer-full.
-
-2005-05-05  Daniel Pfeiffer  <occitan@esperanto.org>
-
-       * font-lock.el (font-lock-negation-char-face): New face and variable.
-       * progmodes/cc-fonts.el (c-cpp-matchers): Use it.
-       * progmodes/sh-script.el (sh-font-lock-keywords): Use it.
-       * progmodes/cperl-mode.el (cperl-init-faces): Use it.
-       * progmodes/make-mode.el (makefile-font-lock-keywords): Use it.
-
-2005-05-05  Juanma Barranquero  <lekktu@gmail.com>
-
-       * emacs-lisp/byte-run.el (define-obsolete-function-alias):
-       Fix typo in docstring.
-
-       * progmodes/ebrowse.el (ebrowse-install-1-to-9-keys)
-       (ebrowse-print-statistics-line)
-       (ebrowse-electric-position-mode-hook): Fix typo in docstring.
-
-       * term/w32-win.el (image-library-alist): Add additional name for
-       Xpm library.
-
-2005-05-05  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/cmacexp.el (c-macro-preprocessor): Update for BSD and
-       use gcc instead of cpp.
-
-       * progmodes/gdb-ui.el (gdb-cpp-define-alist-flags): New variable.
-       (gdb-create-define-alist): Use it.
-       (gdb-cpp-define-alist-program): Update for MS-DOS.
-
-2005-05-04  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/cmacexp.el (c-macro-preprocessor): Update for Mac OS X.
-
-2005-05-04  Richard M. Stallman  <rms@gnu.org>
-
-       * help.el (describe-key): No error when UNTRANSLATED is nil.
-
-       * simple.el (line-move-1): Fix previous change to signal errors
-       appropriately.
-
-2005-05-03  Ulf Jasper  <ulf.jasper@web.de>
-
-       * calendar/icalendar.el (icalendar-version): Now at 0.12.
-       (icalendar-duration-correction): Remove.
-       (icalendar--get-event-properties): Split result at commas.
-       (icalendar--decode-isoduration): New optional argument
-       DURATION-CORRECTION.
-       (icalendar--convert-ordinary-to-ical, icalendar--convert-sexp-to-ical)
-       (icalendar--convert-yearly-to-ical, icalendar--convert-weekly-to-ical)
-       (icalendar--convert-block-to-ical, icalendar--convert-float-to-ical)
-       (icalendar--convert-date-to-ical, icalendar--convert-cyclic-to-ical)
-       (icalendar--convert-anniversary-to-ical): New functions, extracted
-       from icalendar-export-region, with bug fixes.
-       (icalendar-export-region): Use the above functions.
-       (icalendar-import-buffer): Check before saving diary file.
-       (icalendar--convert-recurring-to-diary)
-       (icalendar--convert-non-recurring-all-day-to-diary)
-       (icalendar--convert-non-recurring-not-all-day-to-diary): New functions,
-       extracted from icalendar--convert-ical-to-diary, with bug fixes.
-       (icalendar--convert-ical-to-diary): Use the above functions.
-
-2005-05-03  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/cc-mode.el (cc-define-alist, cc-create-define-alist):
-       Remove these recent additions.
-       (c-mode): Restore to before 2005-04-28.
-
-       * progmodes/cc-vars.el (cc-define-list-program): Remove this
-       recent addition.
-
-       * progmodes/gdb-ui.el (gdb-cpp-define-alist-program)
-       (gdb-define-alist): New variables.
-       (gdb-create-define-alist): New function.
-       (gdb-set-gud-minor-mode-1): Handle gdb-define-alist.
-       (gdb-source, gdb-memory-set-repeat-count): Replace string-to-int
-       with string-to-number.
-       (gdb-reset): Kill gdb-define-alist.  Move assignments outside loop.
-
-       * progmodes/gud.el: Replace string-to-int with string-to-number.
-       (gud-find-file): Handle gdb-define-alist.
-
-       * tooltip.el (tooltip-gud-tips): Use gdb-define-alist.
-
-2005-05-02  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-aent.el (math-read-token):
-       * calc/calc-bin.el (calc-word-size):
-       * calc/calc-ext.el (calc-read-number-fancy):
-       * calc/calc-forms.el (calc-time, calc-date-notation, math-this-year)
-       (math-parse-date, math-parse-standard-date, calcFunc-tzone):
-       * calc/calc-frac.el (calc-over-notation):
-       * calc/calc-graph.el (calc-graph-plot, calc-graph-set-styles)
-       (calc-graph-num-points, calc-graph-init):
-       * calc/calc-prog.el (calc-read-parse-table-part)
-       (calc-edit-macro-repeats):
-       * calc/calc-yank.el (calc-do-grab-rectangle):
-       * calc/calc.el (calcDigit-key, math-read-number, math-read-bignum):
-       Replace `string-to-int' by `string-to-number'.
-
-2005-05-02  Kim F. Storm  <storm@cua.dk>
-
-       * kmacro.el: Use executing-kbd-macro-index variable.
-
-2005-05-02  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * net/rlogin.el (rlogin-parse-words): Delete func.
-       (rlogin): Use split-string, not rlogin-parse-words.
-       Also, if there are option-like elements in the parsed args,
-       take the host to be the first arg immediately following them.
-       Suggested by Michael Mauger.
-
-2005-05-01  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * subr.el (executing-macro): Use `define-obsolete-variable-alias'.
-
-2005-05-02  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/cc-mode.el (cc-create-define-alist): Use a shell.
-       (cc-mode-cpp-program): Rename to cc-define-list-program and
-       move to cc-vars.el.
-
-       * progmodes/cc-vars.el (cc-define-list-program):
-       Change to "gcc -E -dM -".  Make customizable.
-
-2005-05-02  Kim F. Storm  <storm@cua.dk>
-
-       * emulation/cua-base.el: Fix check for CUA-mode if no init file.
-
-2005-05-02  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/cc-mode.el (cc-mode-cpp-program): Change to "gcc -E".
-
-       * international/mule-util.el (truncate-string): Remove alias and
-       obsolete declaration.
-
-       * international/mule-cmds.el (update-iso-coding-systems):
-       Remove alias and obsolete declaration.
-
-       * international/mule.el (coding-system-parent): Remove alias and
-       obsolete declaration.
-
-       * subr.el (define-function, sref): Remove aliases and obsolete
-       declarations.
-       (chars-in-region): Remove obsolete declaration.
-
-2005-05-01  Richard M. Stallman  <rms@gnu.org>
-
-       * info.el (Info-mode): Set widen-automatically to nil, locally.
-
-       * simple.el (widen-automatically): New variable.
-       (pop-global-mark): Obey widen-automatically.
-
-2005-05-01  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * term/xterm.el (function-key-map): Call substitute-key-definition
-       before the keymap size is increased by a lot of define-key calls.
-
-2005-05-01  Richard M. Stallman  <rms@gnu.org>
-
-       * subr.el (add-to-invisibility-spec, remove-from-invisibility-spec):
-       Rename ARG to ELEMENT.  Doc fix.
-
-2005-05-01  Nick Roberts  <nickrob@snap.net.nz>
-
-       * allout.el (allout-exposure): Remove macro and obsolete declaration.
-       Remove references to allout-exposure/change to allout-new-exposure.
-
-       * emacs-lisp/bytecomp.el (dot, dot-min, dot-max): Don't create
-       bytecode symbols.
-
-       * subr.el (dot, dot-marker, dot-min, dot-max, buffer-flush-undo)
-       (compiled-function-p, focus-frame, unfocus-frame):
-       Remove aliases and obsolete declarations.
-       Back out inadvertent changes from previous commit.
-
-2005-05-01  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * files.el (require-final-newline): Make Custom tags consistent
-       with mode-require-final-newline.
-       (mode-require-final-newline): Doc fix.
-
-2005-05-01  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * international/latexenc.el (latexenc-find-file-coding-system):
-       Fix regular expressions.
-
-2005-05-01  David Kastrup  <dak@gnu.org>
-
-       * international/latexenc.el (latexenc-find-file-coding-system):
-       Fix regular expressions.
-
-2005-05-01  Nick Roberts  <nickrob@snap.net.nz>
-
-       * subr.el (string-to-int): Make obsolete.
-
-2005-04-30  Richard M. Stallman  <rms@gnu.org>
-
-       * simple.el (next-error-overlay-arrow-position): Turn off, for ttys.
-
-       * loadup.el: load jka-comp-hook.
-
-       * jka-compr.el: Many functions and vars moved to jka-comp-hook.el.
-       (jka-compr-handler): Add autoload.  `put' calls moved
-       to jka-comp-hook.el.
-       (compression, jka-compr): defgroups moved to jka-comp-hook.el.
-       (jka-compr-inhibit): Autoload.
-
-       * jka-comp-hook.el: New file.
-       Enable the mode by default.
-
-       * files.el (backup-buffer-copy): Use copy-file instead
-       of write-region, and put back the 'excl.
-
-2005-04-30  Chong Yidong  <cyd@stupidchicken.com>
-
-       * progmodes/flymake.el (flymake-split-string)
-       (flymake-split-string, flymake-log, flymake-pid-to-names)
-       (flymake-reg-names, flymake-get-source-buffer-name)
-       (flymake-unreg-names, flymake-add-line-err-info)
-       (flymake-add-err-info): Clarify docstrings.
-       (flymake-popup-menu, flymake-make-emacs-menu)
-       (flymake-make-xemacs-menu): Add docstrings.
-       (flymake-get-buffer-*, flymake-set-buffer-*): Functions deleted.
-       Set variables directly throughout.
-
-2005-04-30  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/cc-mode.el (cc-create-define-alist): Check that file
-       exists.  Initialize cc-define-alist.
-       (c-mode): Add cc-create-define-alist locally to after-save-hook.
-       If there is no file (Macroexpansion) don't create an alist.
-
-2005-04-29  Sam Steingold  <sds@gnu.org>
-
-       * progmodes/cc-mode.el (cc-mode-cpp-program): New user variable.
-       (cc-create-define-alist): Use it instead of the hard-coded string.
-
-2005-04-29  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * international/mule-conf.el (file-coding-system-alist): Fix regexp
-       for latexenc.
-
-2005-04-29  Lute Kamstra  <lute@gnu.org>
-
-       * emacs-lisp/generic.el: Improve commentary section.
-       (define-generic-mode): Improve docstring.
-
-2005-04-29  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (many places): Change to quiet the byte compiler.
-       (org-prefix-format-compiled): New variable.
-       (org-compile-prefix-format): New function.
-       (org-timeline, org-agenda, org-diary): Call org-compile-prefix-format.
-       (org-agenda-prefix-format, org-timeline-prefix-format): New options.
-       (org-agenda-get-scheduled): Check if file is opened in `org-mode'.
-       (org-get-entries-from-diary): Use `org-get-time-of-day' for
-       consistency with entries from `org-mode' files.
-       (org-get-time-of-day): Fix bug with partial matches early in a line.
-       (org-non-link-chars): New constant.
-       (org-link-regexp): Respect `org-non-link-chars'.
-       (org-agenda-day-view): Remove command.
-       (org-agenda-toggle-week-view): Rename from `org-agenda-week-view'.
-       (org-follow-bbdb-link, org-store-link): Search also company field.
-       (org-highlight-overlay): New variable.
-       (org-highlight, org-unhighlight): New functions.
-       (org-agenda-mode): Add pre-command-hook to remove highlight.
-       (org-evaluate-time-range): Behavior depends upon whether time stamp
-       contains a time or not.
-       (org-show-subtree, org-show-entry): New functions.
-       (org-agenda-cleanup-fancy-diary): Remove empty lines.
-
-2005-04-28  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * comint.el (comint-output-filter-functions): Add autoload cookie.
-
-2005-04-28  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-everywhere): Fix last change.
-
-2005-04-28  Arne J\e,Ax\e(Brgensen  <arne@arnested.dk>
-
-       * international/latexenc.el: New file.
-       * international/mule-conf.el (file-coding-system-alist): For .tex,
-       .ltx, .dtx and .drv extensions, use `latexenc-find-file-coding-system'.
-
-2005-04-28  Lute Kamstra  <lute@gnu.org>
-
-       * font-lock.el (font-lock-add-keywords)
-       (font-lock-remove-keywords): Clarify docstring.
-       (font-lock-keywords-alist, font-lock-removed-keywords-alist):
-       Don't start docstrings with a `*'.
-       (font-lock-update-removed-keyword-alist): Give it a docstring.
-
-       * generic-x.el: Update commentary section.
-       Only require font-lock when compiling.
-       Define all modes conditionally.
-       Place all generic modes in the generic-x-modes customization group.
-       (generic-x-modes): New customization group.
-       (generic-default-modes, generic-mswindows-modes)
-       (generic-unix-modes, generic-other-modes): New constants.
-       (generic-define-mswindows-modes, generic-define-unix-modes):
-       Update docstrings.  Make them obsolete.
-       (generic-extras-enable-list): New default value.  Update docstring.
-       Improve :type.  Change :set function.
-       (bat-generic-mode-syntax-table, rul-generic-mode-syntax-table):
-       Fix docstring.
-
-       * emacs-lisp/generic.el (generic-mode-internal):
-       Simplify font-lock-defaults.
-       (define-generic-mode): Fix docstring.
-
-2005-04-28  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/grep.el (grep-mode-font-lock-keywords): Use the
-       font-lock-face property to highlight matches.
-
-2005-04-28  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/cc-mode.el (cc-create-define-alist): New function.
-       (cc-define-alist): New variable.
-       (c-mode): Make it local and initialize it.
-
-       * progmodes/gdb-ui.el (gdb-active-process): New variable.
-       (gdb-exited): New function.
-       (gdb-annotation-rules): Use it.
-       (gdb-starting): Set gdb-active-process to t.
-       (gdb-stopping): Amend doc string.
-       (gdb-reset): Set gdb-active-process to nil.
-
-       * tooltip.el (tooltip-gud-tips): Show the associated #define
-       directives when a C program under GDB is not executing.
-
-2005-04-27  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/cperl-mode.el (cperl-mode): Don't precompile the
-       font-lock-fontify-syntactic-keywords.
-
-       * font-lock.el (font-lock-default-fontify-region): Don't force
-       parse-sexp-lookup-properties to nil.
-
-2005-04-27  Alexander Klimov  <alserkli@inbox.ru>  (tiny change)
-
-       * man.el (man-mode-syntax-table): Set up `:' to have
-       word-constituent syntax.
-
-2005-04-27  Lute Kamstra  <lute@gnu.org>
-
-       * novice.el (disable-command): Don't add spurious newlines to the
-       init file.  Reported by Dan Jacobson <jidanni@jidanni.org>.
-
-2005-04-26  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-yank.el (calc-edit-finish): Make sure there is more
-       than one window before deleting window.
-
-2005-04-26  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * shell.el (shell-prompt-pattern): Doc fix.
-       (shell-mode): Set paragraph-separate buffer locally to "\\'".
-
-       * comint.el (comint-prompt-regexp, comint-get-old-input)
-       (comint-use-prompt-regexp)
-       (comint-use-prompt-regexp-instead-of-fields)
-       (comint-replace-by-expanded-history, comint-send-input)
-       (comint-output-filter, comint-get-old-input-default)
-       (comint-line-beginning-position, comint-bol, comint-show-output)
-       (comint-backward-matching-input, comint-forward-matching-input)
-       (comint-next-prompt, comint-previous-prompt):
-       Rename `comint-use-prompt-regexp-instead-of-fields' to
-       `comint-use-prompt-regexp'.  Keep old name as alias and declare
-       obsolete.
-       (comint-use-prompt-regexp): Shorten first line of doc string.
-
-       * ielm.el (inferior-emacs-lisp-mode): Adapt to above name change.
-       Set paragraph-separate buffer locally to "\\'".
-
-       * hippie-exp.el (try-expand-line, try-expand-line-all-buffers):
-       Adapt to above name change.
-
-       * net/net-utils.el (nslookup-prompt-regexp, ftp-prompt-regexp)
-       (smbclient-prompt-regexp): Ditto.
-
-       * progmodes/inf-lisp.el (inferior-lisp-prompt): Ditto.
-
-2005-04-27  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-location-alist): Rename from
-       gdb-location-list.
-       Break lines that are over 80 characters wide.
-
-2005-04-26  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * pcvs-info.el (cvs-fileinfo->full-path, cvs-display-full-path):
-       New fun and var, to preserve compatibility.
-
-       * pcvs.el, pcvs-info.el: Rename "full-path" -> "full-name".
-
-2005-04-26  Dominique de Waleffe  <ddw@missioncriticalit.com>  (tiny change)
-
-       * pcvs-info.el (cvs-fileinfo->backup-file): Don't pass the full file
-       name to file-newer-than-file-p.
-
-2005-04-26  Richard M. Stallman  <rms@gnu.org>
-
-       * simple.el (line-move-1): Avoid using vertical-motion in easy cases.
-
-       * progmodes/python.el (python-mode):
-       Use new name eldoc-documentation-function.
-
-       * hexl.el (hexl-mode): Use new name eldoc-documentation-function.
-
-       * emacs-lisp/eldoc.el (eldoc-mode): Doc fix.
-       (eldoc-documentation-function):
-       Rename from eldoc-print-current-symbol-info-function.  Calls changed.
-
-2005-04-26  Nick Roberts  <nickrob@snap.net.nz>
-
-       * emacs-lisp/byte-run.el (define-obsolete-function-alias): New macro.
-
-2005-04-25  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * term/xterm.el (function-key-map): Fix strings for
-       {C,S,A,C-S}-f[1-4].  Use substitute-key-definition to bind
-       {C,S,A,C-S}-{f1-f12}.
-
-2005-04-26  Kenichi Handa  <handa@m17n.org>
-
-       * international/mule-cmds.el (select-safe-coding-system):
-       Fix previous change.
-
-2005-04-26  Lute Kamstra  <lute@gnu.org>
-
-       * emacs-lisp/easy-mmode.el (define-minor-mode): Fix docstring.
-
-       * font-lock.el (font-lock-fontify-region-function): Fix docstring.
-       (font-lock-comment-delimiter-face): Ditto.
-
-       * calc/calc.el (calc-trail-mode): Don't set font-lock-defaults.
-
-2005-04-25  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-help.el (calc-view-news): Let-bind inhibit-read-only
-       to t while inserting information; use help-mode.
-
-2005-04-25  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * term.el (ansi-term-color-vector): Use the xterm colors.
-       (term-raw-map): Don't add mappings for \eO and \e[.  Map deletechar.
-
-2005-04-25  Lute Kamstra  <lute@gnu.org>
-
-       * font-core.el (font-lock-defaults): Fix docstring.
-
-       * font-lock.el (font-lock-syntactic-face-function): Fix docstring.
-
-2005-04-25  Kenichi Handa  <handa@m17n.org>
-
-       * international/mule-cmds.el (select-safe-coding-system):
-       Don't check consistency with coding: spec, etc if raw-text or
-       no-conversion was found to be safe.
-
-2005-04-24  Richard M. Stallman  <rms@gnu.org>
-
-       * mail/sendmail.el (mail-font-lock-keywords): Match any number of
-       citation markers at start of each line.
-
-       * mail/rmail.el (rmail-font-lock-keywords): Match any number of
-       citation markers at start of each line.
-
-       * font-lock.el (font-lock-comment-delimiter-face): Doc fix.
-
-       * files.el (mode-require-final-newline): Fix previous change.
-       (require-final-newline): Fix type label.
-
-2005-04-24  Glenn Morris  <gmorris@ast.cam.ac.uk>
-
-       * progmodes/f90.el (f90-calculate-indent): Fix treatment of first
-       statement in buffer (broken by 2004-11-24 change).
-
-2005-04-24  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-everywhere): Save and restore old read-buffer-function
-       and read-file-name-function values.  Don't overwrite existing
-       non-nil values if ido-mode is enabled without ido-everywhere.
-
-2005-04-24  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * files.el (mode-require-final-newline): Minor doc fix.
-
-2005-04-24  Eli Zaretskii  <eliz@gnu.org>
-
-       * subr.el (syntax-after): Doc fix.
-       (syntax-class): If argument is nil, return nil.  Mask off upper 16
-       bits, not 8 bits.
-
-       * files.el (mode-require-final-newline): Doc fix.
-       (backup-buffer-copy): Fix last change.
-
-2005-04-24  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el: Require select.  Set selection-coding-system to
-       mac-system-coding-system.  Call menu-bar-enable-clipboard.
-       (x-last-selected-text-clipboard, x-last-selected-text-primary)
-       (x-select-enable-clipboard): New variables.
-       (x-select-text, x-get-selection, x-selection-value)
-       (x-get-selection-value, mac-select-convert-to-string)
-       (mac-services-open-file, mac-services-open-selection)
-       (mac-services-insert-text): New functions.
-       (CLIPBOARD, FIND): Put mac-scrap-name property.
-       (com.apple.traditional-mac-plain-text, public.utf16-plain-text)
-       (public.tiff): Put mac-ostype property.
-       (selection-converter-alist): Add entries for them.
-       (mac-application-menu-map): New keymap.
-       (interprogram-cut-function, interprogram-paste-function): Set to
-       x-select-text and x-get-selection-value, respectively.
-       (split-window-keep-point): Set to t.
-
-2005-04-23  Richard M. Stallman  <rms@gnu.org>
-
-       * files.el (read-directory-name): Always pass non-nil
-       DEFAULT-FILENAME arg to read-file-name.
-       (backup-buffer-copy, basic-save-buffer-2): Take care against
-       writing thru an unexpected existing symlink.
-       (revert-buffer): In indirect buffer, revert the base buffer.
-       (magic-mode-alist): Doc fix.
-       (buffer-stale-function): Doc fix.
-       (minibuffer-with-setup-hook): Avoid warning.
-       (mode-require-final-newline): Doc and custom fix.
-
-       * follow.el (follow-end-of-buffer): Use with-no-warnings.
-
-       * font-lock.el (font-lock-comment-face): On terminals with few colors,
-       use the default appearance.
-       (font-lock-comment-delimiter-face): New face, new variable.
-
-       * imenu.el (imenu--generic-function): The official position of a
-       definition is the start of the line that BEG is in.
-
-       * midnight.el (midnight-timer): Move defvar up.
-
-       * mouse.el (mouse-drag-region-1): Delete some debugging code.
-
-       * saveplace.el (save-place-to-alist): Use with-no-warnings.
-
-       * startup.el (command-line): Use with-no-warnings.
-
-       * window.el (window-size-fixed): New defvar.
-
-       * emacs-lisp/easymenu.el (easy-menu-do-define): Use defalias, not fset.
-
-       * mail/rmail.el (rmail-font-lock-keywords):
-       Use font-lock-comment-delimiter-face.
-
-       * mail/sendmail.el (mail-font-lock-keywords):
-       Use font-lock-comment-delimiter-face.
-
-       * progmodes/compile.el (next-error-highlight-timer): New defvar.
-
-2005-04-23  SAITO Takuya  <tabmore@rivo.mediatti.net>  (tiny change)
-
-       * progmodes/compile.el (compilation-mode-font-lock-keywords):
-       Specify t for LAXMATCH when matching directories.
-       Save match data around compilation-compat-error-properties form.
-
-2005-04-23  David Kastrup  <dak@gnu.org>
-
-       * textmodes/tex-mode.el (TeX-mode, plain-TeX-mode, LaTeX-mode):
-       Mention that the autoloaded aliases should be kept for AUCTeX.
-
-2005-04-23  Andreas Schwab  <schwab@suse.de>
-
-       * isearch.el (isearch-forward): Doc fix.
-
-2005-04-23  Eli Zaretskii  <eliz@gnu.org>
-
-       * jit-lock.el (jit-lock-stealth-time): Change default value to 16.
-       (jit-lock-stealth-nice): Change default value to 0.5.
-
-2005-04-23  Eric Hanchrow  <offby1@blarg.net>  (tiny change)
-
-       * abbrev.el (write-abbrev-file): Write table entries in
-       alphabetical order by table name.
-
-2005-04-22  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-read-internal): Fix `list' completion.
-
-2005-04-22  Kenichi Handa  <handa@m17n.org>
-
-       * recentf.el (recentf-save-file-coding-system): New variable.
-       (recentf-save-list): Encode the file by
-       recentf-save-file-coding-system and add coding: tag.
-
-2005-04-22  Nick Roberts  <nickrob@snap.net.nz>
-
-       * emacs-lisp/byte-run.el (define-obsolete-variable-alias): New macro.
-
-2005-04-21  Lute Kamstra  <lute@gnu.org>
-
-       * loadhist.el (unload-feature): Don't remove a function from hooks
-       if it is about to be restored to an autoload .  Remove functions
-       that will become unbound from auto-mode-alist.  Simplify the code.
-
-       * subr.el (assq-delete-all): New implementation that is linear,
-       not quadratic.  Suggested by David Kastrup <dak@gnu.org>.
-       (rassq-delete-all): New function.
-
-       * menu-bar.el (menu-bar-options-save, menu-bar-showhide-menu):
-       Add size-indication-mode.
-
-2005-04-21  Kenichi Handa  <handa@m17n.org>
-
-       * international/mule-cmds.el: Add autoload for widget-value in
-       eval-when-compile.
-
-2005-04-21  Nick Roberts  <nickrob@snap.net.nz>
-
-       * menu-bar.el (menu-bar-options-save, menu-bar-showhide-menu):
-       Add tooltip-mode.
-
-       * bindings.el (mode-line-mode-menu): Remove tooltip-mode.
-
-2005-04-20  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * progmodes/inf-lisp.el (inferior-lisp): New defgroup.
-       (inferior-lisp-filter-regexp, inferior-lisp-program)
-       (inferior-lisp-load-command, inferior-lisp-prompt)
-       (inferior-lisp-mode-hook, lisp-source-modes)
-       (inferior-lisp-load-hook): defvar->defcustom.
-       (inferior-lisp-program, inferior-lisp-prompt)
-       (inferior-lisp-load-hook): Doc fixes.
-       (inferior-lisp-install-letter-bindings): Small change in
-       introductory comment.
-
-2005-04-20  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * vc.el (vc-annotate-color-map): Change some colors so that text
-       using them as foreground is readable on both white and black
-       backgrounds.
-
-2005-04-20  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * international/mule-conf.el (translation-table-for-input):
-       Remove redundant declaration.
-
-2005-04-20  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-menu-map): Add tooltip-toggle-gud-tips.
-
-       * tooltip.el (tooltip-gud-tips-p): Expand documentation.
-       (tooltip-toggle-gud-tips): New function.
-
-2005-04-20  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el (mac-symbol-encoder): Fix mappings of left and
-       right angle brackets.
-
-2005-04-20  Nick Roberts  <nickrob@snap.net.nz>
-
-       * tooltip.el (tooltip-use-echo-area): Replace as alias and deprecate.
-
-2005-04-19  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/flymake.el (flymake-get-absolute-file-name-basedir):
-       Remove.  Update callers to use expand-file-name instead.
-
-       * subr.el (syntax-class): New function.
-
-       * simple.el (blink-matching-open): Use it.
-
-       * paren.el (show-paren-function): Use it to recognize parens that are
-       also used in 2-char comment markers.
-
-2005-04-19  Lute Kamstra  <lute@gnu.org>
-
-       * loadhist.el (unload-feature): Update for new format of
-       load-history.  Simplify the code.
-
-2005-04-19  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el: Add coding: tag and set it to iso-2022-7bit.
-       (mac-add-charset-info): New function.  Initialize variable
-       mac-charset-info-alist using it.
-       (mac-centraleurroman, mac-cyrillic): Do not use UCS in table data
-       for translation.
-       (mac-symbol-encoder, mac-dingbats-encoder): New translation table.
-       (mac-font-encoder-list): Add entries for mac-symbol and mac-dingbats.
-       (ccl-encode-mac-symbol-font, ccl-encode-mac-dingbats-font):
-       New CCL programs.
-
-2005-04-19  Kim F. Storm  <storm@cua.dk>
-
-       * simple.el (next-buffer, prev-buffer, next-error)
-       (scroll-other-window, keyboard-quit, keyboard-escape-quit)
-       (clone-indirect-buffer-other-window): Move bindings to bindings.el.
-
-       * bindings.el (next-buffer, prev-buffer, next-error)
-       (scroll-other-window, keyboard-quit, keyboard-escape-quit)
-       (clone-indirect-buffer-other-window): Move bindings from simple.el.
-       (next-buffer, prev-buffer): Add C-x C-right and C-x C-left bindings.
-       (next-error, previous-error): Add M-g M-n/n and M-g M-p/p bindings.
-
-2005-04-18  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * isearch.el (isearch-edit-string): Make the search-ring available for
-       minibuffer history commands.
-       (minibuffer-local-isearch-map): Remove bindings for M-p and M-n,
-       the default history commands now work just as well.
-       (isearch-ring-retreat-edit, isearch-ring-advance-edit): Remove.
-
-2005-04-18  Kim F. Storm  <storm@cua.dk>
-
-       * emulation/cua-base.el (cua--pre-command-handler): Add more
-       elaborate check for shift modifier on non-window systems.
-
-2005-04-18  Lars Hansen  <larsh@math.ku.dk>
-
-       * desktop.el: Make "--no-desktop" turn off `desktop-save-mode'.
-
-2005-04-18  Kim F. Storm  <storm@cua.dk>
-
-       * tooltip.el (tooltip-show): Change second arg to USE-ECHO-AREA
-       and make it optional.  Don't test tooltip-gud-echo-area here.
-       (tooltip-gud-process-output, gdb-tooltip-print):
-       Pass tooltip-gud-echo-area to tooltip-show.
-       (tooltip-help-tips): Remove second optional arg to tooltip-show.
-
-2005-04-18  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * tooltip.el (tooltip-mode): `emacs-quick-startup' and
-       `display-graphic-p' may not be bound yet.
-
-2005-04-17  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * startup.el (command-line): No longer enable Xterm Mouse mode by
-       default in terminals compatible with xterm.
-
-       * xt-mouse.el (xterm-mouse-mode): Set init value back to nil.
-
-2005-04-18  Nick Roberts  <nickrob@snap.net.nz>
-
-       * tooltip.el (tooltip-gud-echo-area): Rename from
-       tooltip-use-echo-area.
-       (tooltip-show, tooltip-gud-process-output, gdb-tooltip-print)
-       (tooltip-help-tips): Allow GUD tooltips to be displayed in echo
-       area independently of where help tooltips are displayed.
-
-2005-04-17  David Kastrup  <dak@gnu.org>
-
-       * cus-theme.el (custom-theme-write-variables): Quote variables
-       where necessary.
-
-2005-04-17  Richard M. Stallman  <rms@gnu.org>
-
-       * simple.el (yank-excluded-properties): Add follow-link to value.
-
-       * jka-compr.el (jka-compr-compression-info-list): Fix custom type.
-
-       * startup.el (fancy-splash-max-time): Just 30 seconds.
-       (fancy-splash-delay): Just 7.
-       (fancy-splash-screens): No time limit other than fancy-splash-max-time.
-
-       * loadhist.el (unload-feature): Update for new format of load-history.
-       Simplify the code.
-
-       * mail/rmail.el (rmail-ignored-headers): Ignore more headers
-       (rmail-font-lock-keywords): Don't fontify the text of a citation.
-
-       * mail/sendmail.el (mail-font-lock-keywords):
-       Don't fontify subject text.
-       Don't fontify the text of a citation.
-
-2005-04-17  Mark H. Weaver  <mhw@netris.org>  (tiny change)
-
-       * comint.el (comint-output-filter): Run comint-output-filter-functions
-       with point where the user had it.
-
-2005-04-16  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * international/ucs-tables.el (ucs-set-table-for-input):
-       Disable when using unify-on-decoding.
-
-2005-04-16  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * emulation/cua-base.el (cua-global-mark-face): Add special case
-       for displays supporting a high number of colors.
-
-2005-04-16  Matt Hodges  <MPHodges@member.fsf.org>  (tiny change)
-
-       * repeat.el (repeat): Invoke pre-command-hook and post-command-hook.
-
-2005-04-16  Chong Yidong  <cyd@stupidchicken.com>
-
-       * filesets.el (filesets-add-buffer): If user supplies a name of a
-       non-existing fileset, create a new fileset.
-
-2005-04-16  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-up-heading-all): Fix bug with
-       `outline-up-heading-all'.
-
-2005-04-16  Andreas Schwab  <schwab@suse.de>
-
-       * files.el (auto-mode-alist): Handle /etc/sysconfig/*,
-       /etc/permissions.d/* and /etc/aliases.d/*.
-
-2005-04-16  Kenichi Handa  <handa@m17n.org>
-
-       * international/code-pages.el (cp-make-coding-system):
-       Set `translation-table-for-input' property value to the symbol
-       ucs-mule-to-mule-unicode, not to that value.
-       (pt154): Escape guillemet by `\'.
-
-2005-04-15  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * loadup.el: Load tooltip if x-show-tip is fboundp.
-
-       * startup.el (command-line): Add comment.
-
-       * tooltip.el (tooltip-mode): Specify correct standard value for
-       Custom in init-value.
-
-2005-04-15  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-goto-info): Use existing Info buffer, if
-       possible.
-
-2005-04-15  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-agenda-date-prompt): Rename from
-       `org-agenda-date-today'.
-       (org-evaluate-time-range): Insert at point instead of directly
-       after time range.
-       (org-first-headline-recenter, org-subtree-end-visible-p)
-       (org-optimize-window-after-visibility-change): New functions
-       (org-agenda-post-command-hook): Don't allow point at end of line,
-       to make sure it always hits the text properties.
-       (org-agenda-next-date-line, org-agenda-previous-date-line):
-       New commands.
-       (org-set-regexps-and-options): Category may contain white space.
-       (org-agenda-get-deadlines, org-agenda-get-scheduled):
-       Improve marker positions.
-       (org-agenda-new-marker): Argument POS made optional.
-       (org-agenda-get-timestamps): Deadlines which are done are listed
-       in org-done-face now.
-       (org-agenda-get-todos, org-agenda-get-timestamps)
-       (org-agenda-get-deadlines, org-agenda-get-scheduled):
-       Set `undone-face' and `done-face' properties.
-       (org-last-todo-state-is-todo): New variable.
-       (org-todo): Set `org-last-todo-state-is-todo'.
-       (org-agenda-todo): Change face according to
-       `org-last-todo-state-is-todo'.  And change other lines referring to
-       the same entry.
-       (org-calendar-goto-agenda): New command.
-       (org-calendar-to-agenda-key): New option.
-       (org-startup-folded): New allowed value `content'.
-       (org-set-regexps-and-options): Accept new value `content' for
-       `org-startup-folded'.
-       (org-get-current-options): Handle new value `content' for
-       `org-startup-folded'.
-       (org-insert-todo-heading): New command.
-       (org-mode): Insert first line "*-* mode: org-mode -*-" when called
-       interactively in empty file and option
-       `org-insert-mode-line-in-empty-file' has been set.
-       (org-agenda-todo, org-agenda-priority): Modify to use
-       `org-agenda-change-all-lines'.
-       (org-warning-face): Change color on dark background.
-
-2005-04-14  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * international/mule-cmds.el (set-locale-environment): On Mac OS,
-       use preferences AppleLocale and AppleLanguages, and variable
-       mac-system-locale for default locale.  On Mac OS Classic, use
-       mac-system-coding-system for default coding systems.
-
-       * term/mac-win.el: Don't set file-name-coding-system.
-       Decode variables system-name, emacs-build-system, user-login-name, and
-       user-full-name by mac-system-coding-system on Mac OS Classic.
-       (mac-system-coding-system): New variable.
-
-2005-04-13  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * startup.el (command-line): Handle `xterm-mouse-mode' before
-       reading init file.
-
-       * xt-mouse.el (xterm-mouse-mode): Adapt to above change.
-
-2005-04-13  Glenn Morris  <gmorris@ast.cam.ac.uk>
-
-       * progmodes/sh-script.el (sh-here-document-word): Make it a
-       defcustom.  Doc fix.
-       (sh-add): Bash uses $(( )) for arithmetic.
-       (sh-while-getopts) <sh>: Set OPTIND back to 1 at end.
-       (sh-maybe-here-document): Remove quotes and leading whitespace
-       from heredoc word when closing.  Indent heredoc with tabs if word
-       starts with "-".
-
-2005-04-13  Richard M. Stallman  <rms@gnu.org>
-
-       * simple.el (undo): Fix previous change.
-
-       * custom.el (defface): Doc fix.
-
-2005-04-13  Lute Kamstra  <lute@gnu.org>
-
-       * Makefile.in (DONTCOMPILE): Remove list.
-       (compile, compile-always): Don't use DONTCOMPILE.
-       (update-authors): Load the library in which batch-update-authors
-       is defined.
-       * makefile.w32-in (DONTCOMPILE): Remove list.
-       (compile, compile-always): Fix comments.
-       (update-authors): Load the library in which batch-update-authors
-       is defined.
-
-       * generic-x.el (generic-mode-ini-file-find-file-hook):
-       Rename to ini-generic-mode-find-file-hook.
-       Keep generic-mode-ini-file-find-file-hook as an alias.
-       (ini-generic-mode-find-file-hook): Rename from
-       generic-mode-ini-file-find-file-hook.  Fix docstring.
-       (ini-generic-mode): Docstring change.
-       (bat-generic-mode-run-as-comint): Silence the byte compiler.
-
-       * help.el (describe-key-briefly): UNTRANSLATED can be nil when
-       called from lisp.
-
-       * generic.el: Move to the emacs-lisp subdir.
-
-2005-04-12  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * term/xterm.el (function-key-map): Add mappings for A-, C-, S-
-       and C-S- function and cursor motion keys.
-
-2005-04-12  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * startup.el (command-line): Enable Xterm Mouse mode by default.
-       * xt-mouse.el (xterm-mouse-mode): Provide correct standard value
-       for Custom.  No longer show "Mouse" in mode line when enabled.
-       Doc fix.
-
-2005-04-12  Kim F. Storm  <storm@cua.dk>
-
-       * emulation/cua-base.el (cua-rectangle-face)
-       (cua-rectangle-noselect-face): Define face attributes here.
-
-       * emulation/cua-rect.el (cua--init-rectangles): Remove face setup.
-
-2005-04-12  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * startup.el (command-line): Turn off blinking cursor if
-       cursorBlink in resources is off or false.
-
-2005-04-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el (dnd): Require dnd.
-       (mac-drag-n-drop): Call dnd-handle-one-url.
-       (kTextEncodingMacRoman, kTextEncodingISOLatin1)
-       (kTextEncodingISOLatin2): Remove constants.
-       (mac-script-code-coding-systems): New constant.
-       (mac-handle-language-change): New function.
-       (special-event-map): Bind it to `language-change' event.
-       (mac-centraleurroman, mac-cyrillic): New coding systems.
-       (mac-font-encoder-list, ccl-encode-mac-centraleurroman-font)
-       (ccl-encode-mac-cyrillic-font): Rename mac-centraleurroman-encoder
-       and mac-cyrillic-encoder to encode-mac-centraleurroman and
-       encode-mac-cyrillic, respectively.
-
-2005-04-12  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el, progmodes/gdb-ui.el (gdb-assembler-mode):
-       Don't set overlay-arrow-string to "=>" as this is done
-       globally in C now.
-
-2005-04-12  Lute Kamstra  <lute@gnu.org>
-
-       * generic-x.el (rc-generic-mode, rul-generic-mode):
-       Fix auto-mode-alist entries.
-       (etc-fstab-generic-mode): Tweak fontification.
-
-       * generic.el (generic-make-keywords-list): Fix docstring.
-       (generic-mode-internal): Simplify generic-font-lock-keywords.
-
-2005-04-11  Rajesh Vaidheeswarran  <rv@gnu.org>
-
-       * whitespace.el (whitespace-buffer-leading)
-       (whitespace-buffer-trailing): Revert the incorrect test inversion.
-       However, fix the highlight area for the leading and
-       trailing whitespaces to show space.
-
-2005-04-11  Rajesh Vaidheeswarran  <rv@gnu.org>
-
-       * whitespace.el (whitespace-version): Bump to 3.5.
-
-       (whitespace-buffer-leading, whitespace-buffer-trailing):
-       Invert sense of the test to highlight the whitespace.
-
-2005-04-12  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-display-line): GUD uses its own
-       overlay arrow now so don't set overlay-arrow-string.
-       (gud-pdb-command-name): Revert back to "pdb" (2004-04-26).
-
-2005-04-11  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * term.el (term-ansi-current-bold, term-ansi-current-underline)
-       (term-ansi-current-reverse, term-ansi-current-invisible)
-       (term-ansi-face-already-done): Change to boolean.
-       (term-reset-terminal, term-handle-colors-array): Handle the above
-       vars accordingly.
-       (term-buffer-vertical-motion): Rename from buffer-vertical-motion.
-       (term-emulate-terminal): Use the new name.
-
-       * faces.el (secondary-selection): Use yellow1, not yellow.
-       (trailing-whitespace): Use red1, not red.
-
-2005-04-11  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * dired.el (dired-mode): Use dnd-* instead of x-dnd-*
-       (dired-dnd-handle-local-file): Call dnd-get-local-file-name.
-       (dired-dnd-handle-file): Call dnd-get-local-file-uri.
-
-       * cus-edit.el (dnd): New group.
-
-       * term/w32-win.el (dnd): Require dnd
-       (w32-drag-n-drop): Call dnd-handle-one-url.
-
-       * x-dnd.el: Require dnd.
-       (x-dnd-handle-uri-list, x-dnd-handle-file-name):
-       Call dnd-handle-one-url.
-       (x-dnd-types-alist, x-dnd-insert-utf8-text)
-       (x-dnd-insert-utf16-text, x-dnd-insert-ctext): Change x-dnd-insert-text
-       to dnd-insert-text.
-       (x-dnd-protocol-alist, x-dnd-open-file-other-window)
-       (x-dnd-handle-one-url, x-dnd-get-local-file-uri)
-       (x-dnd-get-local-file-name, x-dnd-open-local-file)
-       (x-dnd-open-file, x-dnd-insert-text): Move to dnd.el (without x-).
-
-       * dnd.el (dnd-protocol-alist): New file with generic DND functions.
-
-2005-04-11  JUAN-LEON Lahoz Garcia  <juanleon1@gmail.com>
-
-       * wdired.el: Doc fixes.
-       (wdired-confirm-overwrite): Rename from wdired-is-ok-overwrite.
-       (wdired-use-dired-vertical-movement): Rename from
-       wdired-always-move-to-filename-beginning.
-       (wdired-mode-map): Use `ignore' instead of `wdired-newline'.
-       (wdired-change-to-wdired-mode): Change mode name.
-       (wdired-newline): Delete.
-
-2005-04-11  Richard M. Stallman  <rms@gnu.org>
-
-       * whitespace.el (whitespace-highlight-the-space):
-       Don't call whitespace-unhighlight-the-space here.
-
-       * simple.el (undo): Record t in undo-equiv-table
-       for the redo record made by an undo-in-region.
-
-2005-04-12  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-display-inferior-io-buffer)
-       (gdb-frame-inferior-io-buffer): New Functions to control
-       display of separate IO buffer.
-       (menu): Add them to menu-bar.
-       (gdb-display-buffer): Check for buffer another frame.
-       Protect GUD buffer.
-       (gdb-setup-windows): Create IO buffer if not already there.
-       (gdb-memory-mode): Remove purecopy noops.
-
-2005-04-11  Glenn Morris  <gmorris@ast.cam.ac.uk>
-
-       * progmodes/f90.el (f90-electric-insert): Add optional prefix arg,
-       and pass to self-insert-command.
-
-2005-04-11  Lute Kamstra  <lute@gnu.org>
-
-       * generic.el: Commentary section cleanup.
-       (generic): Delete.
-       (generic-use-find-file-hook, generic-lines-to-scan)
-       (generic-find-file-regexp, generic-ignore-files-regexp)
-       (default-generic-mode, generic-mode-find-file-hook)
-       (generic-mode-ini-file-find-file-hook): Move to generic-x.el.
-       * generic-x.el (generic-x): Docstring fix.  Put it in the data group.
-       (generic-use-find-file-hook, generic-lines-to-scan)
-       (generic-find-file-regexp, generic-ignore-files-regexp)
-       (default-generic-mode, generic-mode-find-file-hook)
-       (generic-mode-ini-file-find-file-hook): Move from generic.el.
-
-2005-04-10  Karl Fogel  <kfogel@red-bean.com>
-
-       * bookmark.el (bookmark-write-file): Catch errors writing file.
-       This is the same change as saveplace.el at 2005-04-10T23:32:00Z!rms@gnu.org.
-
-2005-04-10  Richard M. Stallman  <rms@gnu.org>
-
-       * startup.el (fancy-splash-tail): Update copyright year.
-       (command-line): Split part of -Q into -D.
-       (emacs-basic-display): New defvar.
-       (fancy-splash-text): Correct name of menu item.
-
-       * saveplace.el (save-place-alist-to-file): Catch errors writing file.
-
-       * info.el (Info-fontify-node): Handle fontification of multiple * Menu
-       lines in one node.
-
-       * comint.el (comint-send-input): New arg ARTIFICIAL.
-       Callers in this file changed.
-
-       * abbrev.el (define-abbrevs): Read system abbrevs properly.
-
-       * emacs-lisp/map-ynp.el (map-y-or-n-p): Clarify RET/q in help message.
-
-2005-04-10  Chong Yidong  <cyd@stupidchicken.com>
-
-       * url/url-ldap.el (url-ldap): Add docstring.  Fix call to
-       `ldap-search-internal'.
-
-2005-04-10  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * files.el (set-auto-mode-1): Use line-end-position.
-
-       * international/latin-1.el:
-       * international/latin-2.el:
-       * international/latin-3.el:
-       * international/latin-4.el:
-       * international/latin-5.el:
-       * international/latin-8.el:
-       * international/latin-9.el: Give punctuation syntax to NBSP.
-
-       * textmodes/bibtex.el (bibtex-autokey-titleword-ignore)
-       (bibtex-reference-key, bibtex-autokey-demangle-name, bibtex-mode):
-       Use char-classes to accept non-ascii letters, accepted in some recent
-       bibtex implementations.
-
-2005-04-10  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * custom.el (custom-set-minor-mode): Any non-nil value for the
-       variable should enable the mode when set through Custom.
-
-2005-04-10  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/vhdl-mode.el (vhdl-mode-map-init): Don't override default
-       TAB binding so tab-always-indent is obeyed.
-       (vhdl-minibuffer-local-map): Move initialization into declaration.
-       (vhdl-mode-abbrev-table-init): Mark the abbrevs as `system'.
-       (vhdl-run-when-idle, vhdl-create-mode-menu, vhdl-character-to-event)
-       (vhdl-hooked-abbrev): Avoid test for XEmacs.
-       (vhdl-current-line): Use line-beginning-position.
-       (vhdl-doc-variable, vhdl-doc-mode): Call help-setup-xref before
-       with-output-to-temp-buffer, so the current position can be recorded.
-
-2005-04-10  Masatake YAMATO  <jet@gyve.org>
-
-       * progmodes/compile.el (compilation-error-regexp-alist-alist):
-       Add regexp for gcov.
-
-2005-04-06  Katsumi Yamaoka  <yamaoka@jpl.org>
-
-       * calendar/time-date.el (time-to-seconds, seconds-to-time)
-       (days-to-time, time-subtract, time-add): Don't use the #xhhhh
-       syntax which Emacs 20 doesn't support.
-
-2005-04-09  Richard M. Stallman  <rms@gnu.org>
-
-       * help.el (describe-key-briefly, describe-key):
-       Replace strings as event types with "(any string)".
-
-2005-04-09  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * arc-mode.el (archive-mode-map): Move initialization into
-       the declaration.  Override *all* bindings of `undo'.
-       (archive-lemacs): Remove, use (featurep 'xemacs) instead.
-
-2005-04-09  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-units.el (math-standard-units): Redefine Watt hour as W*hr.
-
-2005-04-09  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * term/xterm.el (xterm-rgb-convert-to-16bit): Simplify.
-       (xterm-register-default-colors): Update color values computation
-       to match xterm-200.
-
-2005-04-09  Kenichi Handa  <handa@m17n.org>
-
-       * international/code-pages.el (iso-latin-7): Fix the map.
-
-2005-04-08  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * emacs-lisp/lisp.el (defun-prompt-regexp)
-       (parens-require-spaces, buffer-end, end-of-defun)
-       (insert-parentheses): Doc fixes.
-
-2005-04-08  Kim F. Storm  <storm@cua.dk>
-
-       * comint.el (comint-highlight-prompt): Fix face spec.
-       * hi-lock.el (hi-green): Likewise.
-
-2005-04-08  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * cus-edit.el (custom-modified-face):
-       * comint.el (comint-highlight-input): Fix previous changes.
-       * term.el (term-handle-ansi-escape): Add a comment.
-
-2005-04-08  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * whitespace.el (whitespace-highlight-the-space): Put the same overlay
-       in the buffer and in whitespace-highlighted-space.
-       (whitespace-unhighlight-the-space): Simplify.
-       (whitespace-buffer): Simplify.
-
-2005-04-08  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * textmodes/table.el (table-cell-face): Add special case for
-       displays supporting a high number of colors.
-       * progmodes/vhdl-mode.el (vhdl-font-lock-prompt-face)
-       (vhdl-font-lock-reserved-words-face)
-       (vhdl-speedbar-architecture-face)
-       (vhdl-speedbar-instantiation-face)
-       (vhdl-speedbar-architecture-selected-face)
-       (vhdl-speedbar-instantiation-selected-face): Likewise.
-       * progmodes/sh-script.el (sh-heredoc-face): Likewise.
-       * progmodes/idlw-help.el (idlwave-help-link-face): Likewise.
-       * progmodes/ebrowse.el (ebrowse-tree-mark-face)
-       (ebrowse-root-class-face, ebrowse-member-attribute-face)
-       (ebrowse-progress-face): Likewise.
-       * progmodes/compile.el (compilation-info-face): Likewise.
-       * progmodes/cc-fonts.el (c-invalid-face): Likewise.
-       * emacs-lisp/re-builder.el (reb-match-3): Likewise.
-       * calendar/calendar.el (diary-face): Likewise.
-       * woman.el (woman-italic-face, woman-bold-face)
-       (woman-unknown-face): Likewise.
-       * wid-edit.el (widget-button-pressed-face): Likewise.
-       * whitespace.el (whitespace-highlight-face): Likewise.
-       * smerge-mode.el (smerge-mine-face, smerge-base-face): Likewise.
-       * pcvs-info.el (cvs-marked-face): Likewise.
-       * info.el (info-xref): Likewise.
-       * ido.el (ido-subdir-face, ido-indicator-face): Likewise.
-       * hilit-chg.el (highlight-changes-face)
-       (highlight-changes-delete-face): Likewise.
-       * hi-lock.el (hi-yellow, hi-green, hi-blue-b, hi-green-b)
-       (hi-red-b): Likewise.
-       * generic-x.el (show-tabs-tab-face, show-tabs-space-face): Likewise.
-       * font-lock.el (font-lock-keyword-face)
-       (font-lock-function-name-face, font-lock-warning-face): Likewise.
-       * cus-edit.el (custom-invalid-face, custom-modified-face)
-       (custom-set-face, custom-changed-face, custom-variable-tag-face)
-       (custom-group-tag-face-1, custom-group-tag-face): Likewise.
-       * comint.el (comint-highlight-prompt): Likewise.
-
-2005-04-08  Lute Kamstra  <lute@gnu.org>
-
-       * font-lock.el (font-lock-keywords): Docstring fixes.
-
-2005-04-08  Kenichi Handa  <handa@m17n.org>
-
-       * ps-mule.el (ps-mule-show-warning): If the number of unprintable
-       chars are more than a limit, print " and more..." at the tail.
-
-2005-04-08  Kim F. Storm  <storm@cua.dk>
-
-       * emacs-lisp/authors.el (authors-aliases): Update list.
-       (authors-ignored-files): New list.
-       (authors-fixed-entries): Fix typo.
-       (authors-renamed-files-alist): Update list.
-       (authors-add): Check authors-ignored-files.
-
-2005-04-08  Carsten Dominik  <dominik@science.uva.nl>
-
-       * calendar/diary-lib.el (add-to-diary-list): MARKER argument made
-       optional, to ensure backward compatibility.
-
-2005-04-08  Stephen Eglen  <stephen@gnu.org>
-
-       * textmodes/flyspell.el (flyspell-large-region): Doc fix.
-
-2005-04-08  Kim F. Storm  <storm@cua.dk>
-
-       * buff-menu.el (Buffer-menu-mode-map): Map follow-link to mouse-face.
-
-       * mouse.el (mouse-on-link-p): Doc fix.
-
-2005-04-07  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * ielm.el (ielm-prompt-read-only): Doc fix.
-
-       * comint.el (comint-prompt-read-only): Doc fix.
-
-2005-04-07  Benjamin Rutt  <brutt@bloomington.in.us>
-
-       * ffap.el (ffap-pass-wildcards-to-dired): New user option to
-       ensure dired always handles wildcards passed to ffap.
-       (find-file-at-point): Use it.
-       (ffap-dired-wildcards): Doc fix.
-
-2005-04-07  Juri Linkov  <juri@jurta.org>
-
-       * simple.el (next-error-overlay-arrow-position): New defvar.
-       Put "=>" on its property `overlay-arrow-string'.  Add it to
-       `overlay-arrow-variable-list'.
-
-       * progmodes/compile.el (compilation-setup):
-       Set `next-error-overlay-arrow-position' to nil.  Also set it to
-       nil in the local hook `kill-buffer-hook'.  Make local variable
-       `overlay-arrow-string' and set it to "=>".
-       (compilation-goto-locus): Set BOL position to
-       `next-error-overlay-arrow-position' instead of
-       `overlay-arrow-position'.
-
-       * info.el (Info-mode): Add `Info-kill-buffer' to `kill-buffer-hook'
-       locally instead of adding it to the global hook.
-       (Info-kill-buffer): Move up.
-
-2005-04-06  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * term/xterm.el (xterm-standard-colors): Update color values from
-       xterm-200.
-
-2005-04-06  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * textmodes/tex-mode.el (tex-font-lock-keywords-2): Add \bfseries.
-
-       * fast-lock.el:
-       * lazy-lock.el: Move them to the obsolete subdir.
-
-2005-04-06  JUAN-LEON Lahoz Garcia  <juanleon1@gmail.com>
-
-       * wdired.el (wdired-advise-functions, wdired-add-skip-in-replace)
-       (wdired-add-replace-advice): Remove.
-       (wdired-change-to-wdired-mode): Use query-replace-skip-read-only.
-
-2005-04-06  Kim F. Storm  <storm@cua.dk>
-
-       * startup.el (command-line): Add --bare-bones alias for -Q.
-
-2005-04-06  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el: Use create-fontset-from-mac-roman-font to
-       create the startup fontset if a font specification ends with
-       `mac-roman'.
-
-2005-04-06  Lute Kamstra  <lute@gnu.org>
-
-       * add-log.el (change-log-font-lock-keywords): Complete 2005-04-03
-       change.
-
-       * emacs-lisp/copyright.el (copyright-update-year): Replace the
-       right subexpression.  Suggested by Jay Bingham <jay.bingham@hp.com>.
-
-2005-04-05  Lute Kamstra  <lute@gnu.org>
-
-       * generic.el (generic-mode-internal): Fix 2005-03-31 change.
-       (define-generic-mode): Ditto.  Fix debug declaration.
-
-       * generic-x.el (show-tabs-tab-face, show-tabs-space-face):
-       Put them in the generic-x group.
-
-       * calendar/timeclock.el (timeclock): Doc fix.
-
-       * generic.el (define-generic-mode): Don't use custom-current-group.
-       Document default :group value.
-       * emacs-lisp/easy-mmode.el (define-minor-mode): Ditto.
-       (define-global-minor-mode): Don't use custom-current-group.
-
-2005-04-05  Glenn Morris  <gmorris@ast.cam.ac.uk>
-
-       * startup.el (command-line-1): Display startup-echo-area-message
-       when fancy splash screen is in use.
-
-       * progmodes/sh-script.el (sh-builtins) <bash>: Add `caller'.
-       (sh-escaped-newline): New face.
-       (sh-font-lock-keywords) <shell>: Improve regexp for escaped
-       newline, and use sh-escaped-newline face.
-
-       * progmodes/tcl.el (tcl-escaped-newline): New face.
-       (tcl-builtin-list): New variable.
-       (tcl-set-font-lock-keywords): Add builtins, variables, and escaped
-       newlines.  Fix keywords subexpression number.
-
-2005-04-05  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-diary-default-entry): Fix call to
-       `add-to-diary-entry'.
-
-2005-04-05  Kim F. Storm  <storm@cua.dk>
-
-       * ediff-init.el: Use (featurep 'xemacs).
-
-2005-04-05  David Ponce  <david@dponce.com>
-
-       * cus-edit.el (face): Derive from symbol widget.  Display sample
-       of the current face on the fly.
-       (widget-face-sample-face-get, widget-face-notify): New functions.
-       (widget-face-value-create): Remove.
-
-       * wid-edit.el (widget-field-end): Temporarily remove field
-       narrowing before to call `get-char-property'.
-
-2005-04-04  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-aent.el (math-read-replacement-list): Add subscripts.
-       (math-read-subscripts): New variable.
-       (math-read-preprocess-string): Process subscripts.
-
-2005-04-04  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * comint.el (comint-prompt-read-only): Doc fix.
-
-       * dired.el (dired-copy-filename-as-kill): Make `-' arg behave like
-       `-1'.  Doc fix.
-
-2005-04-04  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-insert-mode-line-in-empty-file):
-       Change default value to nil.
-
-2005-04-04  Lute Kamstra  <lute@gnu.org>
-
-       * autorevert.el (auto-revert-mode): Specify :group.
-       * battery.el (display-battery-mode): Specify :group.
-       * diff-mode.el (diff-minor-mode): Specify :group.
-       * font-core.el (font-lock-mode): Specify :group.
-       * hl-line.el (hl-line-mode): Specify :group.
-       * iimage.el (iimage): New customization group.
-       (iimage-mode): Specify :group.
-       * longlines.el (longlines-mode): Specify :group.
-       * master.el: Don't require easy-mmode.
-       (master): New customization group.
-       (master-mode): Specify :group.
-       * msb.el (msb-mode): Specify :group.
-       * reveal.el (reveal-mode): Specify :group.
-       * simple.el (next-error-follow-minor-mode): Specify :group.
-       * smerge-mode.el (smerge-mode): Specify :group.
-       * emacs-lisp/eldoc.el (eldoc-mode): Specify :group.
-       * emulation/cua-base.el (cua-mode): Specify :group.
-       * international/encoded-kb.el (encoded-kbd-mode): Specify :group.
-       * language/thai-util.el (thai-auto-composition-mode)
-       (thai-word-mode): Specify :group.
-       * mail/supercite.el (sc-minor-mode): Specify :group.
-       * progmodes/cwarn.el (cwarn-mode): Specify :group.
-       * progmodes/flymake.el (flymake-mode): Specify :group.
-       * progmodes/glasses.el (glasses-mode): Specify :group.
-       * progmodes/hideif.el (hide-ifdef-mode): Specify :group.
-       * textmodes/enriched.el (enriched-mode): Specify :group.
-       * textmodes/refill.el (refill-mode): Specify :group.
-
-       * add-log.el (change-log-font-lock-keywords): Names in
-       parenthesized lists can contain spaces.
-
-2005-04-04  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * startup.el (fancy-splash-text): Shorten default text of
-       "Emacs Tutorial" line.  Also, if the current language env
-       indicates an available tutorial file other than TUTORIAL,
-       extract its title and append it to the line in parentheses.
-       (fancy-splash-insert): If arg is a thunk, funcall it.
-
-2005-04-04  Jay Belanger  <belanger@truman.edu>
-
-       * calc.el (calc-language-alist): Add tags to customization type.
-
-2005-04-03  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * xt-mouse.el (xterm-mouse-mode): Add explicit Custom group, mouse.
-       Doc fix.
-
-2005-04-03  Marcelo Toledo  <marcelo@gnu.org>
-
-       * add-log.el (change-log-font-lock-keywords): The manual
-       describing a Change Log entry, says: (...) "Aside from these
-       header lines, every line in the change log starts with a space or
-       a tab.".  The font-lock was not highlighting lines started with
-       spaces, added support for it.
-
-2005-04-03  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
-
-       * textmodes/bibtex.el (bibtex-url): Use format to generate the url.
-       (bibtex-generate-url-list): Update docstring accordingly.  Put the
-       complex example in the docstring.
-       (bibtex-font-lock-url): Use pop.
-
-2005-04-03  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/tcl.el (tcl-set-font-lock-keywords): Use new \_< ops.
-
-       * pcvs.el (cvs-checkout): Prompt for cvsroot as well.
-
-2005-04-03  Glenn Morris  <gmorris@ast.cam.ac.uk>
-
-       * filesets.el (filesets-set-default): Doc fix.
-
-2005-04-03  Lute Kamstra  <lute@gnu.org>
-
-       * generic.el (define-generic-mode): Add argument to specify
-       keywords for defcustom.
-       (default-generic-mode): Specify :group.
-
-       * generic-x.el: Specify :group for all generic modes.
-
-       * desktop.el (desktop-no-desktop-file-hook)
-       (desktop-after-read-hook): Doc fix.
-
-2005-04-02  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * simple.el (visible-mode): Use explicit :group keyword.
-       This changes the group of `visible-mode-hook' from paren-blinking
-       to editing-basics.
-
-2005-04-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>  (tiny change)
-
-       * mail/rmail.el (rmail-parse-url): Bugfix.  Parse traditional
-       mailbox specifications as well as URLs.
-       (rmail-insert-inbox-text): Remove unused conditional branches.
-
-2005-04-01  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-graph.el (calc-gnuplot-name, calc-gnuplot-plot-command)
-       (calc-gnuplot-print-command): Move definitions to calc.el.
-
-       * calc/calc-embed.el (calc-embedded-announce-formula)
-       (calc-embedded-open-formula, calc-embedded-close-formula)
-       (calc-embedded-open-word, calc-embedded-close-word)
-       (calc-embedded-open-plain, calc-embedded-close-plain)
-       (calc-embedded-open-new-formula, calc-embedded-close-new-formula)
-       (calc-embedded-open-mode, calc-embedded-close-mode):
-       Move definitions to calc.el.
-
-       * calc/calc.el (calc-settings-file, calc-language-alist):
-       Make customizable.
-       (calc-embedded-announce-formula, calc-embedded-open-formula)
-       (calc-embedded-close-formula, calc-embedded-open-word)
-       (calc-embedded-close-word, calc-embedded-open-plain)
-       (calc-embedded-close-plain, calc-embedded-open-new-formula)
-       (calc-embedded-close-new-formula, calc-embedded-open-mode)
-       (calc-embedded-close-mode, calc-gnuplot-name)
-       (calc-gnuplot-plot-command, calc-gnuplot-print-command): Move here
-       from other files and make customizable.
-
-2005-04-01  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * pcvs.el (cvs-temp-buffer, cvs-mode-kill-process, cvs-buffer-check):
-       Use buffer-live-p.
-       (cvs-mode-run): Don't call cvs-update-header here.
-       (cvs-run-process): Call cvs-update-header.
-       Use process properties for cvs-postprocess and cvs-buffer so that
-       the sentinel can behave better if the temp buffer is killed.
-       Use a pipe rather than a tty, to better handle unexpected prompts.
-       (cvs-sentinel): Rewrite.  Call cvs-update-header.
-
-2005-04-01  Andre Spiegel  <spiegel@gnu.org>
-
-       * vc-hooks.el (vc-workfile-unchanged-p): Disable mtime check when
-       we go via Tramp or Ange-FTP.  Suggested by Kai Grossjohann.
-
-2005-03-31  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * generic.el (define-generic-mode): Add indentation rule.
-
-2005-03-31  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * files.el (mode-require-final-newline): Make Custom correctly
-       report a nil value and allow to set it to nil via Custom.
-       Doc fix.
-
-2005-04-01  Kenichi Handa  <handa@m17n.org>
-
-       * international/characters.el: Enable the correct case setting for
-       dotless-i and dotted-I.
-
-2005-04-01  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-file-internal): Fall back to non-ido command if
-       initial directory is on slow ftp (or tramp) host.
-
-2005-03-31  Richard M. Stallman  <rms@gnu.org>
-
-       * emacs-lisp/autoload.el (make-autoload):
-       Handle define-global-minor-mode.
-
-       * emacs-lisp/easy-mmode.el (define-global-minor-mode):
-       Rename from easy-mmode-define-global-mode.
-       (easy-mmode-define-global-mode): Alias for define-global-minor-mode.
-
-       * progmodes/scheme.el (scheme-mode-syntax-table):
-       Update syntax of | and # for two-character comment syntax.
-
-2005-03-31  Lute Kamstra  <lute@gnu.org>
-
-       * emacs-lisp/easy-mmode.el (easy-mmode-define-global-mode)
-       (define-minor-mode): Call custom-current-group at load-time.
-
-       * generic.el (define-generic-mode): Add debug declaration.
-       Add defcustom for the mode hook.
-       (generic-mode-internal): Use run-mode-hooks.
-
-2005-03-31  Kim F. Storm  <storm@cua.dk>
-
-       * mouse.el (mouse-1-click-follows-link): Increase to 450 ms.
-       (mouse-fixup-help-message): New defun called by show_help_echo
-       to fixup mouse-2 prefix in help messages when applicable.
-
-       * tooltip.el (tooltip-show-help-function): Don't fixup message here.
-
-2005-03-31  Kenichi Handa  <handa@m17n.org>
-
-       * language/thai-word.el (thai-find-word-ends): Pay attention to
-       the case that we reach the end of buffer.
-
-       * textmodes/fill.el (fill-text-properties-at): New function.
-       (fill-newline): Use fill-text-properties-at instead of
-       text-properties-at.
-
-2005-03-31  Olive Lin  <olive.lin@versateladsl.be>  (tiny change)
-
-       * textmodes/tex-mode.el (tex-start-tex): Use shell-quote-argument,
-       not comint-quote-filename.
-
-2005-03-31  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * help-fns.el (help-with-tutorial): Revert last change.
-
-2005-03-31  Kim F. Storm  <storm@cua.dk>
-
-       * emulation/cua-base.el (cua-scroll-down): Add CUA property.
-
-2005-03-30  Paul Eggert  <eggert@cs.ucla.edu>
-
-       * calendar/cal-china.el: Update reference to "Calendrical
-       Calculations" book; there's a new edition.
-       * calendar/cal-coptic.el: Likewise.
-       * calendar/cal-french.el: Likewise.
-       * calendar/cal-hebrew.el: Likewise.
-       * calendar/cal-islam.el: Likewise.
-       * calendar/cal-iso.el: Likewise.
-       * calendar/cal-julian.el: Likewise.
-       * calendar/cal-mayan.el: Likewise.
-       * calendar/cal-persia.el: Likewise.
-       * calendar/calendar.el: Likewise.
-       * calendar/holidays.el: Likewise.
-       * calendar/lunar.el: Likewise.
-       * calendar/solar.el: Likewise.
-
-       * calendar/calendar.el (calendar-day-abbrev-array): Remove trailing
-       white space from doc string.
-
-2005-03-30  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-help.el (calc-full-help): Remove email address.
-
-2005-03-30  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * help-fns.el (help-with-tutorial): Delete title line.
-
-2005-03-30  Glenn Morris  <gmorris@ast.cam.ac.uk>
-
-       * calendar/cal-x.el (calendar-one-frame-setup)
-       (calendar-only-one-frame-setup, calendar-two-frame-setup): Use t
-       rather than `symbol' for set-window-dedicated-p.
-
-       * calendar/appt.el (appt-buffer-name): Make it a constant.
-       (appt-add): Doc fix.
-
-       * filesets.el (filesets-menu-path, filesets-menu-before)
-       (filesets-menu-in-menu): Doc fix.  Now valid in GNU Emacs.
-       (filesets-menu-cache-file): Use directory ~/.emacs.d.
-       (filesets-add-submenu): Delete and use add-submenu instead.
-
-2005-03-30  Carsten Dominik  <dominik@science.uva.nl>
-
-       * org.el (org-agenda-phases-of-moon, org-agenda-sunrise-sunset)
-       (org-agenda-convert-date, org-agenda-goto-calendar): New commands.
-       (org-diary-default-entry): New function.
-       (org-get-entries-from-diary): Better parsing of diary entries.
-       (org-agenda-check-no-diary): New function.
-       ("diary-lib"): Advice to function `add-to-diary-list', to allow
-       linking to diary entries.
-       (org-agenda-execute-calendar-command): New function.
-       (org-agenda): Improve visible section in window.
-       Use `org-fit-agenda-window'.
-       (org-fit-agenda-window): New option.
-       (org-move-subtree-down): Better handling of empty lines
-       at end of subtree.
-       (org-cycle): Numeric prefix is interpreted now as show-subtree N
-       levels up.
-       (org-fontify-done-headline): New option.
-       (org-headline-done-face): New face.
-       (org-set-font-lock-defaults): Use `org-headline-done-face'.
-       (org-table-copy-down): Rename from `org-table-copy-from-above'.
-       When current field is non-empty, it is copied to next row.
-       (org-table-copy-from-above): Fix bug which made it
-       impossible to copy fields containing only a single non-white character.
-
-2005-03-30  Kim F. Storm  <storm@cua.dk>
-
-       * kmacro.el (kmacro-end-macro): Isearch may store this command
-       into the macro -- so ignore it when executing keyboard macro.
-
-2005-03-30  Nick Roberts  <nickrob@snap.net.nz>
-
-       * tooltip.el (tooltip-gud-display): Use gud-overlay-arrow-position.
-
-2005-03-29  Kenichi Handa  <handa@m17n.org>
-
-       * language/thai.el ("Thai"): Set setup-function and exit-function
-       for Thai language environment.
-
-       * language/thai-util.el: Require thai-word.
-       (thai-word-mode-map): New variable.
-       (thai-word-mode): New minor mode.
-       (setup-thai-language-environment-internal): New function.
-       (exit-thai-language-environment-internal): New function.
-
-       * language/thai-word.el (thai-word-table): Declare it by defvar,
-       use dolist to initialize it.
-       (thai-kill-word, thai-backward-kill-word, thai-transpose-words)
-       (thai-fill-find-break-point): New functions.
-
-2005-03-29  Richard M. Stallman  <rms@gnu.org>
-
-       * simple.el (idle-update-delay): Move definition up.
-       (set-mark): Doc fix.
-
-2005-03-29  Chong Yidong  <cyd@stupidchicken.com>
-
-       * longlines.el: New file.
-
-       * simple.el (buffer-substring-filters): New variable.
-       (filter-buffer-substring): New function.
-       (kill-region, copy-region-as-kill): Use it.
-
-       * register.el (copy-to-register, append-to-register)
-       (prepend-to-register): Use filter-buffer-substring.
-
-2005-03-30  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gdb): (Re)-initialize gud-filter-pending-text.
-       (gud-filter-pending-text): Move in front of gdb.
-       (gud-overlay-arrow-position): New variable.
-       (gud-sentinel, gud-display-line): Use it in place of
-       overlay-arrow-position.
-
-2005-03-29  Glenn Morris  <gmorris@ast.cam.ac.uk>
-
-       * progmodes/fortran.el (fortran-if-indent): Doc fix.
-       (fortran-font-lock-keywords-2): Add "where", "elsewhere".
-       (fortran-font-lock-keywords-4): New variable.
-       (fortran-blocks-re, fortran-end-block-re)
-       (fortran-start-block-re): New constants, for hideshow.
-       (hs-special-modes-alist): Add a Fortran entry.
-       (fortran-mode-map): Bind fortran-end-of-block,
-       fortran-beginning-of-block to \M-\C-n, \M-\C-p.
-       (fortran-mode): Doc fix.  Add fortran-font-lock-keywords-4.
-       (fortran-looking-at-if-then, fortran-end-of-block)
-       (fortran-beginning-of-block): New functions, for hideshow.
-
-       * progmodes/f90.el (f90-end-block-re, f90-start-block-re):
-       Doc fix.  Tweak regexp.
-       (f90-beginning-of-block): Push mark first.
-
-2005-03-29  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc.el: Update copyright date.
-       (calc-version): Increase to 2.1.
-       (calc-version-date): Remove.
-
-       * calc/calc-help.el: Update copyright date.
-       (calc-full-help): Remove reference to calc-version-date.
-       Update copyright date.
-
-2005-03-29  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * vc.el (vc-do-command): Use a pipe for async processes, so password
-       prompts don't show up at places where the user can't reply.
-
-2005-03-29  Olive Lin  <olive.lin@versateladsl.be>  (tiny change)
-
-       * textmodes/tex-mode.el (tex-send-command): shell-quote-argument
-       on the file name we pass to the inferior shell.
-
-2005-03-29  Stephan Stahl  <stahl@eos.franken.de>  (tiny change)
-
-       * progmodes/which-func.el (which-function): Be robust in the face of an
-       imenu--make-index-alist failure.
-
-2005-03-29  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * reveal.el (reveal-mode-map): Don't override C-a and C-e.
-
-       * progmodes/python.el (python-preoutput-filter): Fix last change.
-
-2005-03-29  Lute Kamstra  <lute@gnu.org>
-
-       * emacs-lisp/debug.el (debug-on-entry): Handle autoloaded
-       functions and compiled macros.
-       (debug-convert-byte-code): Handle macros too.
-       (debug-on-entry-1): Don't signal an error when trying to clear a
-       function that is not set to debug on entry.
-
-2005-03-29  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-lang.el: Add functions to math-function-table
-       properties of tex and math.
-
-2005-03-29  Kenichi Handa  <handa@m17n.org>
-
-       * ps-mule.el (ps-mule-plot-string): Translate characters by
-       ps-print-translation-table.
-       (ps-mule-begin-job): Call find-charset-region/string with
-       ps-print-translation-table.
-       (ps-mule-printable-p): Return t if CHARSET is ascii or latin-iso8859-1.
-
-       * ps-print.el (ps-print-translation-table): New variable.
-       (ps-plot-region): Translate characters by ps-print-translation-table.
-
-2005-03-29  Juri Linkov  <juri@jurta.org>
-
-       * simple.el (next-error-highlight-timer): New variable.
-
-       * progmodes/compile.el (compilation-goto-locus):
-       Use `next-error-highlight-timer' instead of `sit-for'.
-
-2005-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * mail/supercite.el (sc-mail-field): Use assoc-string.
-       (sc-get-address): Simplify regexps.
-
-       * files.el (minibuffer-with-setup-hook): New macro.
-       (find-file-read-args): Use it to avoid let-binding
-       minibuffer-with-setup-hook (which breaks turning on/off
-       file-name-shadow-mode while in the prompt).
-
-       * complete.el (PC-read-include-file-name-internal):
-       Use test-completion.
-
-2005-03-28  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * font-lock.el: Bind `font-lock-fontify-block' to M-o M-o.
-
-2005-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * window.el (window-buffer-height): Use count-screen-lines.
-
-       * progmodes/python.el (python-preoutput-leftover): New var.
-       (python-preoutput-filter): Use it.
-       (python-send-receive): Loop until all the result has been received.
-
-2005-03-28  Juri Linkov  <juri@jurta.org>
-
-       * dired.el (dired-mode-map): Add ellipsis to "Compare directories".
-
-       * menu-bar.el (menu-bar-file-menu): Remove ellipsis from
-       "Recover Crashed Session".
-       (menu-bar-search-menu): Add ellipsis to "Search tagged files".
-       (menu-bar-replace-menu): Add ellipsis to "Replace in tagged files".
-       (menu-bar-goto-menu): Add ellipsis to "Set Tags File Name".
-       (menu-bar-goto-menu): Add ellipsis to "Tags Apropos".
-       (menu-bar-options-menu): Add ellipsis to "Set Font/Fontset".
-       (menu-bar-manuals-menu): Add ellipsis to "Find Command in Manual".
-       (menu-bar-manuals-menu): Add ellipsis to "Find Key in Manual".
-       (menu-bar-help-menu): Remove ellipsis from "Find Emacs Packages".
-
-       * ediff-hook.el (menu-bar-ediff-misc-menu, ediff-misc-menu):
-       Remove ellipsis from "Ediff Manual", "Customize Ediff", "List
-       Ediff Sessions", "Toggle use of separate control buffer frame",
-       "Use separate frame for Ediff control buffer".
-
-       * bookmark.el (menu-bar-bookmark-map): Add ellipsis to "Jump to
-       Bookmark", "Set Bookmark", "Insert Contents", "Insert Location",
-       "Rename Bookmark", "Delete Bookmark".
-
-       * info.el (Info-mode-menu): Remove ellipsis from "Index".
-       Add ellipsis to "Lookup a String", "Lookup a string in all indices".
-       Add `:active Info-index-alternatives' to "Next Matching Item".
-
-       * wdired.el (wdired-change-to-wdired-mode):
-       Mention `wdired-abort-changes' key in the initial message.
-
-       * international/mule.el (auto-coding-alist): Associate non-ascii
-       image filename extensions with `no-conversion'.
-
-2005-03-27  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * international/iso-acc.el:
-       * obsolete/iso-acc.el: Move iso-acc to the obsolete subdir.
-
-2005-03-26  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * textmodes/sgml-mode.el (html-mode): Doc update.
-
-       * autorevert.el (auto-revert-check-vc-info): Minor doc fix.
-
-2005-03-26  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * term.el (term-move-columns): Fix face after extending a line.
-       (term-insert-spaces): Likewise.
-       (term-reset-terminal): Fix off by one error.
-
-2005-03-26  Eli Zaretskii  <eliz@gnu.org>
-
-       * international/mule.el (auto-coding-alist): Add .xpi files.
-
-       * files.el (auto-mode-alist): Add .xpi files.
-
-2005-03-26  Jure Cuhalev  <gandalf@owca.info>  (tiny change)
-
-       * textmodes/ispell.el (ispell-dictionary-alist-6): Add slovenian.
-
-2005-03-26  Eli Zaretskii  <eliz@gnu.org>
-
-       * term/bobcat.el: Don't use keyswap.el, since it is now obsolete.
-
-2005-03-26  Glenn Morris  <gmorris@ast.cam.ac.uk>
-
-       * calendar/cal-menu.el (top level): Delete local C-down-mouse-3
-       binding.  Suggested by Stephan Stahl <stahl@eos.franken.de>.
-
-       * calendar/cal-move.el (calendar-beginning-of-year): Move the
-       cursor to Jan 1 when needed.
-       (calendar-end-of-year): Fix -/+ typo.
-       Reported by Chong Yidong <cyd@stupidchicken.com>.
-
-2005-03-26  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/flymake.el (flymake-mode): Add autoload cookie.
-
-       * emacs-lisp/debug.el (debugger-record-expression): Add a missing
-       format to `message'.  Inspired by Deepak Goel <deego@gnufans.org>.
-
-2005-03-25  Richard M. Stallman  <rms@gnu.org>
-
-       * filesets.el (filesets-init): Add autoload.
-
-       * mail/mailalias.el (mail-directory): Doc fix.
-
-2005-03-25  Frederik Fouvry  <fouvry@CoLi.Uni-SB.DE>
-
-       * mail/mailalias.el (mail-directory-process): Do nothing if
-       mail-directory-process is an atom.
-       (mail-get-names): Ignore mail-directory-names if it is an atom.
-       (mail-directory-process defvar): Doc fix.
-       (mail-names): Doc fix.
-
-2005-03-25  Johan Bockg\e,Ae\e(Brd  <bojohan@dd.chalmers.se>  (tiny change)
-
-       * textmodes/flyspell.el (mail-mode-flyspell-verify): Fix regexp syntax.
-
-2005-03-26  Kenichi Handa  <handa@m17n.org>
-
-       * international/mule-util.el (detect-coding-with-priority):
-       Call update-coding-systems-internal before detect-coding-region.
-
-2005-03-26  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-breakpoints-mode-map)
-       (gdb-frames-mode-map): Add follow-link property.
-
-2005-03-25  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calcalg2.el (calc-solve-for): Use "Variable(s)" to prompt
-       for variables.
-
-2005-03-25  Juri Linkov  <juri@jurta.org>
-
-       * image-mode.el: Optimize image filename extension regexps in
-       autoload cookies.  Associate .x[bp]m with `image-mode-maybe'
-       in `auto-mode-alist'.
-       (image-mode): Add `image-toggle-display-text' to local hook
-       `change-major-mode-hook'.  Display the image as an image by
-       default.  Set `cursor-type' and `truncate-lines' if the image
-       is already displayed.  Take into account the current mode (image
-       or text) in message.
-       (image-minor-mode): New minor mode.
-       (image-mode-maybe, image-toggle-display-text): New functions.
-       (image-toggle-display): Use called-interactively-p.
-       Let-bind `inhibit-read-only' to t.
-
-       * image-mode.el (image-minor-mode): Set `cursor-type' and
-       `truncate-lines' if the image is already displayed.  Add turning
-       image-minor-mode off to `change-major-mode-hook'.  Add message.
-       Call `image-toggle-display-text' after turning image-minor-mode off.
-
-2005-03-25  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * international/mule-cmds.el (set-locale-environment): For Mac OS X's
-       Terminal.app, use utf-8.
-       (set-display-table-and-terminal-coding-system): Add coding-system arg.
-       (set-locale-environment): Use it.
-
-       * term/xterm.el: Undo last change, better done in mule-cmds.el.
-
-       * emacs-lisp/rx.el (rx-constituents): Add symbol-start and symbol-end.
-
-       * progmodes/python.el (python-close-block-statement-p)
-       (python-outdent-p, python-current-defun): Use symbol-end.
-
-2005-03-25  Karl Chen  <quarl@cs.berkeley.edu>
-
-       * files.el (save-some-buffers): Doc fix.
-
-2005-03-25  Werner Lemberg  <wl@gnu.org>
-
-       * complete.el, thumbs.el: Replace `legal' with `valid'.
-       * calendar/calendar.el: Replace `legal' with `valid'.
-       * emacs-lisp/advice.el: Replace `legal' with `valid'.
-       * mail/supercite.el: Replace `legal' with `valid'.
-       * progmodes/cperl-mode.el, progmodes/idlw-shell.el
-       * progmodes/idlwave.el, progmodes/vhdl-mode.el:
-       Replace `legal' with `valid'.
-       * textmodes/reftex-vars.el, textmodes/reftex.el:
-       Replace `legal' with `valid'.
-
-2005-03-25  Werner Lemberg  <wl@gnu.org>
-
-       * calc/calc-forms.el, calc/calc-sel.el
-       * midnight.el, vc-cvs.el
-       * emacs-lisp/cl-macs.el
-       * emulation/vip.el
-       * eshell/esh-io.el, eshell/esh-var.el
-       * mail/supercite.el
-       * progmodes/ebnf-abn.el, progmodes/ebnf-bnf.el
-       * progmodes/ebnf-ebx.el, progmodes/ebnf-dtd.el, progmodes/ebnf-iso.el
-       * progmodes/ebnf-yac.el, progmodes/ebnf2ps.el, progmodes/idlwave.el
-       * progmodes/sh-script.el, progmodes/xscheme.el
-       * textmodes/refbib.el, textmodes/refer.el, textmodes/reftex-cite.el
-       * textmodes/reftex-index.el, textmodes/reftex-parse.el
-       * textmodes/reftex-ref.el, textmodes/reftex-vars.el
-       * textmodes/reftex.el, textmodes/org.el:
-       Replace `illegal' with `invalid'.
-
-2005-03-24  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/flymake.el (flymake-get-file-name-mode-and-masks)
-       (flymake-find-buildfile, flymake-find-possible-master-files)
-       (flymake-check-include, flymake-parse-line): Replace loops over the
-       length of lists, by loops over lists, to remove silly O(n\e,A2\e(B) behavior.
-
-       * progmodes/flymake.el (flymake-ensure-ends-with-slash): Remove.
-       Substitute file-name-as-directory in the rest of the file.
-       (flymake-get-common-file-prefix): Rewrite, using compare-strings.
-       (flymake-replace-region): Remove unused arg `buffer'.
-       (flymake-check-patch-master-file-buffer): Update calls to it.
-       (flymake-add-err-info): Remove unused var `count'.
-       (flymake-mode): Use define-minor-mode.
-
-       * progmodes/flymake.el: Use with-current-buffer.
-       (flymake-float-time, flymake-get-temp-dir, flymake-line-end-position)
-       flymake-replace-regexp-in-string, flymake-line-beginning-position)
-       (flymake-popup-menu, flymake-current-row, flymake-selected-frame):
-       Avoid testing for `xemacs'.
-       (flymake-nop): Move.
-       (flymake-region-has-flymake-overlays): Return the computed value.
-       (flymake-reformat-err-line-patterns-from-compile-el): Use dolist.
-       Remove unused var `endline'.
-       (flymake-get-line-count): Remove unused function.
-       (flymake-display-err-menu-for-current-line): Unused var move-mouse-pos.
-
-       * emulation/vi.el:
-       * generic.el:
-       * hilit-chg.el (global-highlight-changes):
-       * hi-lock.el (hi-lock-mode):
-       * follow.el: find-file-hooks -> find-file-hook.
-
-       * comint.el (comint-insert-input): Obey mouse-yank-at-point.
-
-2005-03-24  Juri Linkov  <juri@jurta.org>
-
-       * dired.el (dired-mode-map): Add menu item "Compare directories"
-       for dired-compare-directories.
-
-       * dired-aux.el (dired-compare-directories): Add autoload cookie.
-       Doc fix.  Replace `read-file-name' with `read-directory-name'.
-
-2005-03-24  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * term/xterm.el: If running in Terminal.app set coding-system to utf-8.
-
-2005-03-24  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-embed.el (calc-embedded-mode-change): Save all
-       relevant mode settings in calc-embedded-original-modes when modes
-       are permanently changed.
-
-2005-03-24  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * autoinsert.el: find-file-hooks -> find-file-hook.
-
-2005-03-24  Lute Kamstra  <lute@gnu.org>
-
-       * generic.el (generic-font-lock-defaults): Make it obsolete.
-       (generic-font-lock-keywords): New variable to replace
-       generic-font-lock-defaults.
-       (generic-mode-set-font-lock): Delete it.
-       (generic-mode-internal): Don't call generic-mode-set-font-lock.
-       (generic-bracket-support): Add docstring.
-
-       * generic-x.el: Rename generic-font-lock-defaults to
-       generic-font-lock-keywords throughout.
-       (mailagent-rules-setup-function): Delete it.
-       (mailagent-rules-generic-mode): Use anonymous function instead.
-       (show-tabs-generic-mode-font-lock-defaults-1)
-       (show-tabs-generic-mode-font-lock-defaults-2): Make them constants.
-       Quote faces.
-       (show-tabs-tab-face, show-tabs-space-face): Specify background,
-       not foreground.
-
-       * emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression):
-       Recognize define-generic-mode.
-
-2005-03-23  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * icomplete.el (icomplete-simple-completing-p): Don't turn on icomplete
-       if there's no completion table.
-
-2005-03-23  Miles Bader  <miles@gnu.org>
-
-       * progmodes/gdb-ui.el (breakpoint-enabled, breakpoint-disabled):
-       Remove tty-specific variants, as they're no longer needed.
-
-2005-03-23  Lute Kamstra  <lute@gnu.org>
-
-       * generic-x.el: Code cleanup: make args constant whenever possible.
-       (installshield-statement-keyword-list)
-       (installshield-system-functions-list)
-       (installshield-system-variables-list, installshield-types-list)
-       (installshield-funarg-constants-list): Make them constants.
-
-       * generic.el (generic-make-keywords-list): Add autoload cookie.
-
-       * calendar/time-date.el: Add comment on time value formats.
-       Don't require parse-time.
-       (with-decoded-time-value): New macro.
-       (encode-time-value): New function.
-       (time-to-seconds, time-less-p, time-subtract, time-add): Use them.
-       (days-to-time): Return a valid time value when arg is huge.
-       (time-since): Use time-subtract.
-       (time-to-number-of-days): Use time-to-seconds.
-
-2005-03-23  David Ponce  <david@dponce.com>
-
-       * recentf.el (recentf-keep): New option.
-       (recentf-menu-action): Default to `find-file'.
-       (recentf-keep-non-readable-files-flag)
-       (recentf-keep-non-readable-files-p)
-       (recentf-file-readable-p, recentf-find-file)
-       (recentf-cleanup-remote): Remove.
-       (recentf-include-p): More robust.
-       (recentf-keep-p): New function.
-       (recentf-remove-if-non-kept): Rename from
-       `recentf-remove-if-non-readable'.  Use `recentf-keep-p'.
-       All callers updated.
-       (recentf-menu-items-for-commands): Fix help string.
-       (recentf-track-closed-file): Update.  Doc fix.
-       (recentf-cleanup): Update.  Count removed files.  Doc fix.
-
-2005-03-23  Kim F. Storm  <storm@cua.dk>
-
-       * progmodes/gdb-ui.el (breakpoint-enabled, breakpoint-disabled):
-       Don't inherit from fringe face (now happens automatically).
-
-2005-03-22  Kim F. Storm  <storm@cua.dk>
-
-       * tooltip.el (tooltip-show-help-function): Ignore negative mouse
-       position values.
-
-2005-03-22  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * menu-bar.el (showhide-date-time): Remove.
-       (menu-bar-showhide-menu): Use menu-bar-make-mm-toggle.
-       (menu-bar-make-mm-toggle): Simplify.
-
-2005-03-22  JUAN-LEON Lahoz Garcia  <juanleon1@gmail.com>
-
-       * progmodes/perl-mode.el (perl-font-lock-keywords-2):
-       Accept qualified variable and function names.
-
-2005-03-22  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * bindings.el (completion-ignored-extensions):
-       Remove ".lis" for `vax-vms'.
-
-2005-03-22  Andreas Schwab  <schwab@suse.de>
-
-       * generic-x.el: Revert last change.
-       * ldefs-boot.el: Update.
-
-2005-03-22  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-embed.el (calc-embedded-original-modes): New variable.
-       (calc-embedded-save-original-modes)
-       (calc-embedded-restore-original-modes): New functions.
-       (calc-do-embedded): Save original modes when entering embedded mode
-       and restore when leaving embedded mode.
-       (calc-embedded-modes-change): Change the value of
-       calc-embedded-original-modes to reflect permanent changes.
-
-2005-03-22  Lute Kamstra  <lute@gnu.org>
-
-       * generic-x.el: Require generic again.
-
-2005-03-22  Miles Bader  <miles@gnu.org>
-
-       * progmodes/gdb-ui.el (breakpoint-enabled, breakpoint-disabled):
-       Tweak details to look good on both ttys and bitmap displays, light
-       or dark background, etc.
-
-2005-03-21  Kim F. Storm  <storm@cua.dk>
-
-       * tooltip.el (tooltip-show-help-function): Check car and cdr of
-       mouse position.
-
-2005-03-21  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * icomplete.el: Don't forcibly turn on the mode upon load.
-       (icomplete-mode): Use define-minor-mode.
-       (icomplete-eoinput): Default to nil.
-       (icomplete-minibuffer-setup): Remove autoload.
-       (icomplete-tidy): Simplify.
-       (icomplete-exhibit): Use buffer-undo-list to determine if we're still
-       in the initial state or if the user has modified the field.
-       Fix handling of icomplete-max-delay-chars.
-       Remove code that handles the oddball case where
-       minibuffer-completion-table is an integer.
-       Wrap icomplete-completions in while-no-input in case building
-       completions takes more time than expected.
-       (icomplete-completions): Simplify.
-
-2005-03-21  Richard M. Stallman  <rms@gnu.org>
-
-       * jka-compr.el (jka-compr-really-do-compress):
-       Make variable buffer-local.
-
-       * image-mode.el: Handle .xpm files too.
-       (image-toggle-display): Preserve modification flag.
-
-       * help.el (where-is): Don't mention aliases with no key bindings.
-
-2005-03-21  Lute Kamstra  <lute@gnu.org>
-
-       * generic.el: Fix commentary section.  Don't require cl for
-       compilation.
-       (generic-mode-list): Add autoload cookie.
-       (generic-use-find-file-hook, generic-lines-to-scan)
-       (generic-find-file-regexp, generic-ignore-files-regexp)
-       (generic-mode, generic-mode-find-file-hook)
-       (generic-mode-ini-file-find-file-hook): Fix docstrings.
-       (define-generic-mode): Make it a defmacro.  Fix docstring.
-       (generic-mode-internal): Code cleanup.  Add autoload cookie.
-       (generic-mode-set-comments): Code cleanup.
-       * generic-x.el: Don't prevent compilation.  Don't require generic.
-       Follow coding conventions.  Minor code cleanup.
-       (etc-fstab-generic-mode): Add some keywords.
-       * font-lock.el (lisp-font-lock-keywords-1): Font lock a call to
-       define-generic-mode like a function declaration.
-
-2005-03-21  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-embed.el (calc-do-embedded): Put data on stack before
-       changing modes.
-
-2005-03-21  Sam Steingold  <sds@gnu.org>
-
-       * add-log.el (add-log-current-defun): Support more C DEFUN forms.
-
-2005-03-21  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * progmodes/dcl-mode.el (dcl-font-lock-keywords):
-       Add underscore to "f$ lexicals" regexp.
-
-2005-03-20  Juri Linkov  <juri@jurta.org>
-
-       * subr.el (progress-reporter-do-update): When `min-value' is equal
-       to `max-value', set `percentage' to 0 and prevent division by zero.
-
-2005-03-20  Michael Albinus  <michael.albinus@gmx.de>
-
-       Sync with Tramp 2.0.48.
-
-       * net/tramp.el (all): Change all addresses to .gnu.org.
-       (tramp-append-tramp-buffers): New defun.
-       (tramp-bug): Apply `tramp-append-tramp-buffers' as post-hook.
-       Catch `dont-send' signal.
-       (tramp-set-auto-save-file-modes): Set always permissions, because
-       there might be an old auto-saved file belonging to another
-       original file.  This could be a security threat.  Reported by
-       Kjetil Kjernsmo <kjetil@kjernsmo.net>.
-       Check for Emacs 21.3.50 removed.
-
-       * net/tramp-smb.el (all): Remove debug construct for
-       `with-parsed-tramp-file-name'.
-       (tramp-smb-prompt): Prompt can contain spaces inside directory names.
-       (tramp-smb-handle-delete-directory, tramp-smb-handle-delete-file):
-       No error message if DIRECTORY or FILENAME doesn't exist.
-       (tramp-smb-open-connection): Check existence of
-       `tramp-smb-program'.
-
-2005-03-20  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/perl-mode.el (perl-font-lock-syntactic-face-function):
-       Properly handle the case where the `m' or `s' command's argument is not
-       yet terminated.
-       (perl-indent-new-calculate): New function.
-       (perl-indent-line): Use it.
-
-2005-03-20  Miles Bader  <miles@gnu.org>
-
-       * progmodes/gdb-ui.el (gdb-put-breakpoint-icon): Use breakpoint faces
-       in text-mode too.  Change to new face names.
-       (breakpoint-enabled): Rename from `breakpoint-enabled-bitmap-face'.
-       Add `:weight bold' attribute.
-       (breakpoint-disabled): Rename from `breakpoint-disabled-bitmap-face'.
-
-2005-03-19  Juri Linkov  <juri@jurta.org>
-
-       * files.el (auto-mode-alist): Add comment.  Optimize jar/ear/war.
-
-       * international/mule.el (auto-coding-alist): Sync with
-       `auto-mode-alist' by adding upper case archive file extensions
-       and adding ear/war to jar extension.
-
-2005-03-19  David Casperson  <casper@unbc.ca>  (tiny change)
-
-       * textmodes/tex-mode.el (tex-view): If tex-shell process is not
-       running, restart it.
-
-2005-03-19  Yoichi NAKAYAMA  <yoichi@geiin.org>  (tiny changes)
-
-       * finder.el (finder-current-item): Throw an error on an empty line.
-
-       * man.el (Man-follow-manual-reference): If current-word returns
-       nil, use "".
-
-2005-03-19  Matt Hodges  <MPHodges@member.fsf.org>
-
-       * simple.el (goto-line): Doc fix.
-
-2005-03-19  Aaron S. Hawley  <Aaron.Hawley@uvm.edu>
-
-       * files.el (save-buffer): Doc fix.
-
-2005-03-19  Michael R. Mauger  <mmaug@yahoo.com>
-
-       * recentf.el (recentf-cleanup-remote): New variable.
-       (recentf-cleanup): Use it to conditionally check availability of
-       remote files.
-
-2005-03-19  Joe Edmonds  <joe-bugs-debian-org@elem.com>  (tiny change)
-
-       * emacs-lisp/lisp-mode.el (lisp-mode-variables): Recognize `@' in
-       function names.
-
-2005-03-19  Eli Zaretskii  <eliz@gnu.org>
-
-       * language/thai-word.el: New file.
-
-2005-03-19  JUAN-LEON Lahoz Garcia  <juanleon1@gmail.com>
-
-       * files.el (backup-buffer): If the file's directory is not
-       writable, use copy instead of move to backup the file.
-
-2005-03-19  Eli Zaretskii  <eliz@gnu.org>
-
-       * obsolete/keyswap.el: Moved to obsolete/ from term/.
-
-2005-03-19  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
-
-       * ps-print.el (ps-generate-string-list, ps-generate-header-line):
-       Use functionp instead of symbolp and fboundp.  Reported by Drkm
-       <darkman_spam@yahoo.fr>.
-       (ps-print-version): New version 6.6.6.
-
-2005-03-18  Tak Ota  <Takaaki.Ota@am.sony.com>
-
-       * textmodes/table.el (table--line-column-position): New idiom.
-       (table--row-column-insertion-point-p): New function to test
-       validity of row and column insertion operation at a location.
-       (table-global-menu, table-cell-menu): Use above functions for
-       deterministic test operation.
-       (table--editable-cell-p): Behave in deterministic fashion.
-
-2005-03-18  Juri Linkov  <juri@jurta.org>
-
-       * isearch.el (isearch-lazy-highlight-new-loop):
-       Make arguments beg and end optional.
-       (isearch-update): Remove optional arguments nil from
-       isearch-lazy-highlight-new-loop.
-       (isearch-lazy-highlight-search): Let-bind case-fold-search to
-       isearch-lazy-highlight-case-fold-search instead of
-       isearch-case-fold-search, and let-bind isearch-regexp to
-       isearch-lazy-highlight-regexp.
-       Use isearch-lazy-highlight-last-string instead of isearch-string.
-
-       * replace.el (perform-replace): Remove bindings of global
-       variables isearch-string, isearch-regexp, isearch-case-fold-search.
-       Add three new arguments to `replace-highlight'.
-       (replace-highlight): Add arguments string, regexp, case-fold.
-       Let-bind isearch-string, isearch-regexp, isearch-case-fold-search
-       to allow isearch-lazy-highlight-new-loop to use these values
-       to set corresponding isearch-lazy-highlight-* internal
-       variables whose values lazy highlighting will use regardless of
-       changes to global variables isearch-string, isearch-regexp,
-       isearch-case-fold-search during lazy highlighting loop.
-       (replace-dehighlight): Rename `isearch-lazy-highlight-cleanup'
-       to `lazy-highlight-cleanup'.
-
-       * textmodes/ispell.el (ispell-lazy-highlight): New defcustom.
-       (ispell-highlight-face): Set default face to `isearch' when
-       lazy highlighting is enabled.
-       (ispell-highlight-spelling-error-overlay): Set `ispell-overlay'
-       priority to 1.  Add lazy highlighting.
-       (ispell-highlight-spelling-error-xemacs): Remove obsolete arg
-       from `isearch-dehighlight'.
-
-2005-03-18  David Ponce  <david@dponce.com>
-
-       * files.el (hack-local-variables): Do a case-insensitive search
-       for End.
-
-2005-03-18  Juri Linkov  <juri@jurta.org>
-
-       * isearch.el (lazy-highlight-cleanup) <command>: Rename from
-       `isearch-lazy-highlight-cleanup', add alias to old name and
-       declare obsolete.  Add release numbers to other obsolete vars.
-       (isearch-done, isearch-lazy-highlight-new-loop):
-       Rename `isearch-lazy-highlight-cleanup' to `lazy-highlight-cleanup'.
-       (lazy-highlight-cleanup) <variable>: Doc fix.
-       (isearch-lazy-highlight-update): Rename obsolete
-       `isearch-lazy-highlight-face' to `lazy-highlight-face'.
-
-2005-03-18  Kenichi Handa  <handa@m17n.org>
-
-       * language/thai-util.el: Fix categorization of Thai characters in
-       thai-category-table.
-       (thai-composition-pattern): Adjust it for the above change.
-       (thai-self-insert-command, thai-compose-syllable): New functions.
-       (thai-compose-region): Use thai-compose-syllable.
-       (thai-compose-string): Likewise.
-       (thai-composition-function): Likewise.
-       (thai-auto-composition): New function.
-       (thai-auto-composition-mode): New minor mode.
-
-       * language/thai.el: Fix patterns to be registered in
-       composition-function-table.
-
-       * international/quail.el (quail-input-method): Locally bind
-       inhibit-modification-hooks to t.
-
-2005-03-17  Richard M. Stallman  <rms@gnu.org>
-
-       * progmodes/perl-mode.el (perl-mode-hook): Defvar it.
-       (perl-mode): Use run-mode-hooks.
-
-       * mail/rmail.el (rmail-movemail-program, rmail-pop-password)
-       (rmail-pop-password-required, rmail-remote-password): Doc fixes.
-       (rmail-preserve-inbox, rmail-probe, rmail-autodetect): Doc fix.
-
-       * mail/sendmail.el (sendmail-send-it): Reenable the code
-       to compute resend-to-address and use it.
-
-       * tar-mode.el (tar-mode): Turn off undo unconditionally.
-
-       * image-mode.el: New file.
-
-       * image.el (insert-sliced-image): Add autoload cookie.
-
-       * font-lock.el (font-lock-lines-before): New user option.
-       (font-lock-after-change-function): Obey it.
-
-       * bindings.el (esc-map): Make M-g a prefix.
-       Bind M-g g and M-g M-g to goto-line.
-
-       * faces.el (face-id): Doc fix.
-
-2005-03-17  Frederik Fouvry  <fouvry@CoLi.Uni-SB.DE>
-
-       * mail/rmail.el (rmail-unknown-mail-followup-to): New function.
-       (rmail-show-message): Use rmail-unknown-mail-followup-to.
-       (rmail-reply): Recognize Mail-Followup-To and Mail-Reply-To headers.
-
-       * mail/sendmail.el (mail-yank-ignored-headers)
-       (mail-font-lock-keywords, mail-mode-fill-paragraph):
-       Add Mail-Followup-To and Mail-Reply-To headers.
-       (mail-citation-hook): Add autoload cookie.
-       (mail-mode): Doc fix.
-       (mail-mode-map): Bind mail-mail-followup-to and mail-mail-reply-to.
-       (mail-send): Compute Mail-Followup-To and Mail-Reply-To headers.
-       (mail-mode-fill-paragraph): Handle those headers.
-       (mail-mailing-lists): New variable.
-       (mail-mail-reply-to, mail-mail-followup-to): New functions.
-
-2005-03-17  Juri Linkov  <juri@jurta.org>
-
-       * isearch.el (isearch-fallback): Check for `(car previous)'
-       before calling `isearch-other-end-state'.
-
-2005-03-17  Kim F. Storm  <storm@cua.dk>
-
-       * simple.el (move-beginning-of-line): Move to beginning of buffer
-       line, as well as beginning of screen line.
-
-2005-03-16  Glenn Morris  <gmorris@ast.cam.ac.uk>
-
-       * calendar/diary-lib.el (mark-diary-entries): Use new optional
-       argument REDRAW rather than calendar-redrawing variable.
-       * calendar/calendar.el (calendar-redrawing): Delete.
-       (redraw-calendar): Do not bind calendar-redrawing.
-
-2005-03-16  Matt Hodges  <MPHodges@member.fsf.org>
-
-       * calendar/diary-lib.el (diary-redraw-calendar): Preserve point in
-       diary-file buffer.
-
-2005-03-16  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * help.el (describe-mode): Allow a :minor-mode-function property to
-       specify a different minor mode toggle function than the variable.
-       * simple.el (auto-fill-function):
-       * subr.el (add-minor-mode): Use it.
-
-2005-03-16  Kenichi Handa  <handa@m17n.org>
-
-       * language/ethio-util.el (sera-being-called-by-w3): New variable.
-       (ethio-sera-to-fidel-ethio): Check also sera-being-called-by-w3.
-       (ethio-fidel-to-sera-buffer): Likewise.
-
-2005-03-16  Juri Linkov  <juri@jurta.org>
-
-       * emacs-lisp/find-func.el (find-function-regexp):
-       Add defun-emitting macro `menu-bar-make-toggle'.
-
-       * isearch.el: Put `isearch-scroll' property to
-       `split-window-horizontally'.
-
-       * info.el: Update error messages for `debug-ignored-errors'.
-       (Info-isearch-search): Doc fix.
-       (Info-find-node): Move up code to go into info buffer before
-       recording the node to the history.
-       (Info-fontify-node): Fontify titles only if the next line
-       has two or more `*', `=', `-', `.'.
-       Display "go to this node" for empty (match-string 3).
-
-2005-03-16  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el: Add mouse pointer shape constants.
-
-2005-03-15  Kim F. Storm  <storm@cua.dk>
-
-       * simple.el (move-beginning-of-line): Use vertical-motion.
-
-2005-03-15  Juri Linkov  <juri@jurta.org>
-
-       * isearch.el (isearch-error): New variable.
-       (isearch-invalid-regexp, isearch-within-brackets): Remove.
-       (isearch-error-state): Rename from `isearch-invalid-regexp-state'.
-       (isearch-within-brackets-state): Remove.
-       (isearch-case-fold-search-state, isearch-pop-fun-state):
-       Decrease frame index.
-       (isearch-mode, isearch-top-state, isearch-push-state)
-       (isearch-edit-string, isearch-abort, isearch-search-and-update)
-       (isearch-fallback, isearch-message-prefix, isearch-message-suffix)
-       (isearch-search, isearch-lazy-highlight-new-loop):
-       Replace `isearch-invalid-regexp' with `isearch-error'.
-       Remove `isearch-within-brackets'.
-       (isearch-search): Add `search-failed' handler to `condition-case'.
-       (isearch-lazy-highlight-search): Add `condition-case' to catch
-       errors and allow `isearch-lazy-highlight-update' to try
-       highlighting from the beginning of the window.
-       (isearch-repeat): Move up code to set isearch-wrapped to t
-       before calling isearch-wrap-function.
-
-       * info.el (Info-isearch-initial-node): New internal variable.
-       (Info-search): Signal an error in isearch mode when search leaves
-       the initial node.  Signal an error when `bound' is non-nil and
-       nothing was found in the current subfile.
-       (Info-isearch-search): Remove `condition-case'.
-       (Info-isearch-wrap): Don't wrap when search failed during leaving
-       the initial node.  If `Info-isearch-search' is nil, wrap around
-       the current node.
-       (Info-isearch-start): New fun.
-       (Info-mode): Add buffer-local hook `Info-isearch-start' to
-       `isearch-mode-hook'.
-
-2005-03-15  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * simple.el (normal-erase-is-backspace): Set default to t if
-       running on Mac.
-
-       * term/mac-win.el (function-key-map): Sync with x-win.el.
-
-2005-03-15  Kenichi Handa  <handa@m17n.org>
-
-       * international/mule-cmds.el (locale-language-names): Modify the
-       format of elements and add more entries.
-       (locale-preferred-coding-systems): Add more entries.
-       (set-locale-environment): Adjust for the change of
-       locale-language-names.
-
-2005-03-14  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * pcvs.el (smerge-ediff): Remove bogus autoload.
-
-2005-03-14  Lute Kamstra  <lute@gnu.org>
-
-       * emacs-lisp/debug.el (debugger-make-xrefs): Docstring fix.
-       Ignore a `*' at the beginning of a line.
-
-       * subr.el (macro-declaration-function): Move to emacs-lisp/byte-run.el.
-       * emacs-lisp/byte-run.el (macro-declaration-function): Move from
-       subr.el.
-       (dont-compile, eval-when-compile, eval-and-compile): Use declare
-       to specify indentation.
-
-       * generic.el (define-generic-mode): Let generic-mode-list be a
-       list of strings; test membership with equal.
-
-2005-03-14  Kim F. Storm  <storm@cua.dk>
-
-       * simple.el (next-line, previous-line): Add optional try-vscroll
-       arg to recognize interactive use.  Pass it on to line-move.
-       (line-move): Don't perform auto-window-vscroll when defining or
-       executing keyboard macro to ensure consistent behavior.
-
-2005-03-13  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * pcvs-util.el (cvs-string->strings): Strip trailing whitespace.
-
-2005-03-13  Lute Kamstra  <lute@gnu.org>
-
-       * emacs-lisp/debug.el (debug): Set debug-on-exit before calling
-       debugger-setup-buffer so that backtrace marks the frames set to
-       debug-on-exit and we don't have to do it manually.  Set an extra
-       debug-on-exit for macro's.
-       (debugger-setup-buffer): Don't mark the top frame manually.
-
-2005-03-12  Lute Kamstra  <lute@gnu.org>
-
-       * emacs-lisp/byte-run.el: Replace lisp-indent-hook with
-       lisp-indent-function throughout.
-       (with-no-warnings): Set lisp-indent-function property.
-
-2005-03-12  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * progmodes/dcl-mode.el (dcl-mode-syntax-table):
-       Add entry for backslash.
-
-2005-03-12  Juri Linkov  <juri@jurta.org>
-
-       * info.el (Info-search): Four fixes for backward search.
-
-2005-03-11  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc.el (calc-language-alist): New variable.
-       * calc/calc-embed.el (calc-embedded-language-alist): Remove.
-       (calc-embedded-find-modes): Use calc-language-alist instead of
-       calc-embedded-language-alist.
-
-2005-03-11  Glenn Morris  <gmorris@ast.cam.ac.uk>
-
-       * calendar/calendar.el (calendar-redrawing): New internal
-       variable.
-       (redraw-calendar): Remove bogus save-excursion from previous
-       change.  Bind calendar-redrawing to t for mark-diary-entries.
-       * calendar/diary-lib.el (mark-diary-entries): No need to redraw
-       calendar if that is why we were called.
-
-2005-03-11  Kenichi Handa  <handa@m17n.org>
-
-       * international/mule.el (make-coding-system): Set property
-       coding-system-define-form to nil.
-       (define-coding-system-alias): Likewise.
-
-2005-03-11  Kenichi Handa  <handa@m17n.org>
-
-       These changes are suggested by Dave Love <fx@gnu.org>.
-
-       * textmodes/fill.el: Change encoding to iso-2022-7bit and add
-       coding: tag.
-       (adaptive-fill-regexp): Add more bullets.
-       (fill-french-nobreak-p): Add Latin-1 and Latin-9 guillemets in
-       regexps.
-
-2005-03-10  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * help.el (describe-mode): Properly handle non-trivial lighters.
-       Don't ignore minor modes that are not listed in minor-mode-list.
-
-       * tooltip.el (tooltip-mode): Don't complain that you can't turn the
-       feature ON when the user requests to turn it OFF.
-
-2005-03-10  Lute Kamstra  <lute@gnu.org>
-
-       * emacs-lisp/debug.el (debug-entry-code): Delete it.
-       (implement-debug-on-entry): New function to replace debug-entry-code.
-       (debug-on-entry-1): Use implement-debug-on-entry.  Delete the
-       second argument as the 2005-03-07 change makes it obsolete.
-       (debug-on-entry, cancel-debug-on-entry): Update call to
-       debug-on-entry-1.
-       (debug, debugger-setup-buffer): Comment update.
-       (debugger-frame-number): Update to work with implement-debug-on-entry.
-
-2005-03-10  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-embed.el (math-ms-args): Declare it.
-       (calc-embedded-eval-expr, calc-embedded-eval-get-var): Use variable
-       math-ms-args.
-       (calc-embedded-subst): Use math-multi-subst-rec to substitute
-       variables.
-
-2005-03-10  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-var-create-handler, gdb-get-location):
-       Use message-box.
-
-       * tooltip.el (tooltip-mode): Use define-minor-mode and simplify.
-       (tooltip-activate-mouse-motions-if-enabled): Use dolist.
-       (tooltip-gud-tips): Simplify.
-       (tooltip-gud-tips-p): Remove superfluous :set.
-       (tooltip-gud-modes): Add fortran-mode.
-       (gdb-tooltip-print): Remove newline for tooltip-use-echo-area.
-
-       * bindings.el (mode-line-mode-menu): Add tooltip-mode to mode-line.
-
-2005-03-09  Kim F. Storm  <storm@cua.dk>
-
-       * play/animate.el (animate-place-char): Use forward-line instead
-       of next-line to improve performance.
-
-2005-03-09  Simon Josefsson  <jas@extundo.com>
-
-       * net/browse-url.el (browse-url-default-browser): Doc fix.
-
-2005-03-09  Miles Bader  <miles@gnu.org>
-
-       * emacs-lisp/bytecomp.el (byte-compile-variable-ref)
-       (byte-compile-obsolete): Change " since VER" to " (as of Emacs VER)".
-
-2005-03-09  Kenichi Handa  <handa@m17n.org>
-
-       * international/latin-1.el: Set case and syntax for 255 only if
-       set-case-syntax-set-multibyte is nil.
-
-       * textmodes/ispell.el (ispell-insert-word): New function.
-       (ispell-word): Use ispell-insert-word to insert a new word.
-       (ispell-process-line): Likewise.
-       (ispell-complete-word): Likewise.
-
-2005-03-09  Glenn Morris  <gmorris@ast.cam.ac.uk>
-
-       * calendar/calendar.el (redraw-calendar): Preserve point.
-       Reported by Matt Hodges <MPHodges@member.fsf.org>.
-       (calendar-week-start-day): Move after definition of
-       redraw-calendar.  Delete buffer test, since redraw-calendar has
-       that now.
-
-       * calendar/diary-lib.el (mark-diary-entries): Only call
-       redraw-calendar in the first of any recursive calls.
-       Reported by Alan Shutko <ats@acm.org>.
-
-2005-03-08  Juri Linkov  <juri@jurta.org>
-
-       * textmodes/sgml-mode.el (sgml-tag, html-tag-alist)
-       (html-horizontal-rule, html-line, html-image, html-checkboxes)
-       (html-radio-buttons): Add a space before the trailing `/>' where
-       sgml-xml-mode is non-nil.
-       (sgml-delete-tag): Check if the tag ends with `/>' to not delete
-       the subsequent tag of the empty XML tag.
-       (html-href-anchor): Don't set initial input to "http:".
-       (html-image): Ask for the image URL and set point inside alt="".
-       (html-name-anchor): Duplicate the name in the `id' attribute when
-       sgml-xml-mode is non-nil.
-       (html-paragraph): Remove \n before <p>.
-       (html-checkboxes, html-radio-buttons): Insert `checked="checked"'
-       instead of `checked' when sgml-xml-mode is non-nil.
-
-       * facemenu.el (list-colors-print): Print #RRGGBB in default face.
-       Remove 1 space before #RRGGBB to not truncate it on terminal
-       windows w/o fringes.  Remove 1 space between bg and fg examples
-       to get more space.
-       (list-colors-duplicates): Replace `and' with `if' for `boundp' to
-       avoid byte-compile warnings.
-
-       * image-file.el (image-file-handler): Put `safe-magic' property to
-       `image-file-handler'.
-
-       * info.el (Info-isearch-search): Emulate word search in
-       isearching through multiple Info nodes with Info-search.
-       (Info-isearch-wrap): Allow isearch-word.
-
-2005-03-08  Lute Kamstra  <lute@gnu.org>
-
-       * emacs-lisp/debug.el (debugger-step-through): Make sure that
-       stepping into the debugger's code is not possible.
-       (debugger-jumping-flag): Docstring update.
-
-2005-03-08  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-embed.el (calc-do-embedded): Reset mode line when
-       embedded mode begins.
-       (calc-embedded-language-alist): New variable.
-       (calc-embedded-find-modes): Use calc-embedded-language-alist to
-       set default language mode.
-
-2005-03-08  Kenichi Handa  <handa@m17n.org>
-
-       * international/ccl.el (define-ccl-program): Fix docstring about
-       extra 256 bytes assured for the output buffer.
-
-       * international/utf-16.el (ccl-encode-mule-utf-16le-with-signature):
-       Fix BUFFER_MAGNIFICATION to 2.
-       (ccl-encode-mule-utf-16be-with-signature): Likewise.
-
-2005-03-07  Karl Chen  <quarl@cs.berkeley.edu>
-
-       * align.el (align-rules-list): Added an alignment rule for CSS
-       declarations (applies to css-mode and html-mode buffers).
-
-2005-03-07  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * emacs-lisp/debug.el (debug-on-entry-1): Fix handling of macros.
-
-2005-03-07  Kim F. Storm  <storm@cua.dk>
-
-       * simple.el (move-beginning-of-line): New command.
-
-       * bindings.el (global-map): Bind C-a to move-beginning-of-line.
-
-       * reveal.el (reveal-mode-map): Bind C-a to beginning-of-line.
-
-       * emulation/cua-base.el: Put CUA move property on move-end-of-line
-       and move-beginning-of-line.
-
-       * apropos.el (apropos-print): Omit command from M-x ... RET.
-
-2005-03-07  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-var-create-handler): Handle just MI case.
-       (gdb-send, gdb-send-item): Log items sent from gdb-send too.
-
-2005-03-06  Richard M. Stallman  <rms@gnu.org>
-
-       * bindings.el (esc-map): Bind M-g to goto-line.
-
-       * facemenu.el (global-map): Bind M-o, not M-g.
-
-2005-03-06  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * menu-bar.el (menu-bar-file-menu): Add the same :enable to
-       "Open Directory" as for "Open File".
-
-2005-03-06  Chong Yidong  <cyd@stupidchicken.com>
-
-       * simple.el (activate-mark-hook, deactivate-mark-hook): Add defvars.
-       (push-mark-command): Run activate-mark-hook.
-
-2005-03-06  Richard M. Stallman  <rms@gnu.org>
-
-       * help-mode.el (help-mode-finish): Don't alter the element
-       in view-return-to-alist if there already is one.
-
-       * jit-lock.el (jit-lock-stealth-fontify): When calling sit-for,
-       make sure the current buffer is the expected one.
-
-       * novice.el (disabled-command-function): Output in *Disabled Command*.
-       Explicitly ignore non-keyboard events, and explicitly handle C-g.
-
-       * textmodes/flyspell.el (flyspell-large-region):
-       Pass args differently for aspell.
-
-       * files.el (mode-require-final-newline): Doc fix.
-
-2005-03-03  Stephan Stahl  <stahl@eos.franken.de>  (tiny change)
-
-       * progmodes/which-func.el (which-function):
-       Specify NOERROR when calling imenu--make-index-alist.
-
-2005-03-05  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * simple.el (normal-erase-is-backspace): Define default value.
-
-       * custom.el (custom-theme-set-variables): Remove unused var
-       `immediate'.
-       (custom-reevaluate-setting): Simple function to handle variables
-       that are defined before their default value can really be
-       computed.
-
-       * startup.el (command-line): Use it for temporary-file-directory,
-       small-emporary-file-directory, auto-save-file-name-transforms,
-       blink-cursor-mode, and normal-erase-is-backspace.
-
-       * font-lock.el (font-lock-fontify-keywords-region): Ensure forward
-       progress, even with buggy anchored keywords.
-
-2005-03-05  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * simple.el (goto-line): Remove unbalanced final parenthesis.
-
-2005-03-05  Richard M. Stallman  <rms@gnu.org>
-
-       * simple.el (goto-line): Use a number at point as the default.
-       With C-u as arg, switch buffers.
-
-2005-03-05  Juri Linkov  <juri@jurta.org>
-
-       * frame.el (blink-cursor-mode): Replace `emacs-quick-startup'
-       with `no-blinking-cursor'.
-
-       * startup.el (no-blinking-cursor): New defvar.
-       (command-line): Add `--no-blinking-cursor' to longopts.
-       Set `no-blinking-cursor' to t for command line arguments
-       -Q, -nbc, --no-blinking-cursor.  Replace `emacs-quick-startup'
-       with `no-blinking-cursor' in the condition for calling
-       `blink-cursor-mode'.
-
-2005-03-04  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * menu-bar.el (menu-bar-make-mm-toggle): Doc fix.
-       (menu-bar-options-save): Add blink-cursor-mode.
-       (menu-bar-options-menu): Add blink-cursor-mode.
-
-2005-03-04  Ulf Jasper  <ulf.jasper@web.de>
-
-       * calendar/icalendar.el (icalendar-version): Increase to 0.11.
-       (icalendar-export-file, icalendar-export-region)
-       (icalendar-import-file, icalendar-import-buffer): Add autoload cookies.
-       (icalendar--convert-ical-to-diary): Fix problem with DURATION.
-
-2005-03-04  Lute Kamstra  <lute@gnu.org>
-
-       * emacs-lisp/debug.el (debugger-step-after-exit): Make it a defvar.
-       (debug-function-list): Ditto.
-
-2005-03-04  Robert J. Chassell  <bob@rattlesnake.com>
-
-       * textmodes/texinfmt.el (texinfo-append-refill):
-       Redefine the types of line to which @refill
-       is not appended by replacing a search for `@refill\\|@bye' with
-       `@refill\\|^[ \t]*@'.  The intent is to solve both the `@end
-       itemize@refill' bug and the unfilled long lines bug.
-       (texinfmt-version): Update number and date.
-
-2005-03-04  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * international/code-pages.el (windows-1250, windows-125[2-8])
-       (iso-8859-10, -13, -16, georgian-ps): Add autoload cookies.
-
-2005-03-03  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * frame.el (blink-cursor-mode): `emacs-quick-startup' may not be
-       bound yet.
-
-2005-03-02  Romain Francoise  <romain@orebokech.com>
-
-       * ibuf-ext.el (ibuffer-filter-disable): Move back to the current
-       buffer after removing limits.
-       (ibuffer-pop-filter): Ditto.
-       Update copyright.
-
-2005-03-02  Miles Bader  <miles@gnu.org>
-
-       * button.el (make-text-button): If the user doesn't specify a
-       type, use the default.  Rewrite to use `add-text-properties' and
-       plist functions.
-
-2005-03-01  Lute Kamstra  <lute@gnu.org>
-
-       * emacs-lisp/debug.el (inhibit-debug-on-entry): Add docstring.
-       (debugger-jumping-flag): New var.
-       (debug-entry-code): Use it.
-       (debugger-jump): Use debugger-jumping-flag and add
-       debugger-reenable to post-command-hook.
-       (debugger-reenable): Use debugger-jumping-flag and remove itself
-       from post-command-hook.
-       (debug, debug-on-entry, cancel-debug-on-entry): Remove call to
-       debugger-reenable.
-
-2005-03-01  Robert J. Chassell  <bob@rattlesnake.com>
-
-       * textmodes/texinfmt.el (texinfo-no-refill-regexp): Comment out
-       inclusion of "itemize\\|", which may be unnecessary, is certainly
-       inelegant, and stops refilling in itemize lists when formatting
-       Japanese Texinfo files to Info.
-       Update copyright to 2005.
-
-2005-03-01  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-get-location): Use a warning instead
-       of an error if GDB can't find the source file.
-
-2005-03-01  Glenn Morris  <gmorris@ast.cam.ac.uk>
-
-       * calendar/calendar.el (redraw-calendar): Work from any buffer,
-       not just the calendar.
-
-       * calendar/diary-lib.el (mark-diary-entries): Remove any old marks
-       first.
-       (diary-redraw-calendar): New function.
-       (make-diary-entry): Add diary-redraw-calendar to local
-       write-contents-functions.  Turn off selective display before
-       inserting in diary.
-
-2005-03-01  Kim F. Storm  <storm@cua.dk>
-
-       * emacs-lisp/copyright.el (copyright-fix-years): New command.
-
-2005-03-01  Lute Kamstra  <lute@gnu.org>
-
-       * emacs-lisp/debug.el (debug-on-entry-1): Reimplement to make sure
-       that debug-entry-code can be safely removed from a function while
-       this code is being evaluated.  Revert the 2005-02-27 change as the
-       new implementation no longer requires it.  Make sure that a
-       function body containing just a string is not mistaken for a docstring.
-       (debug): Skip one more frame in case of debug on entry.
-       (debugger-setup-buffer): Delete one more frame line in case of
-       debug on entry.
-       (debugger-frame-number): Update to use the new text introduced by
-       the 1999-11-03 change.  Skip one more frame in case of debug on entry.
-
-2005-02-28  Kim F. Storm  <storm@cua.dk>
-
-       * double.el (double-translate-key): Call force-window-update after
-       read-event to avoid crash in redisplay.
-
-2005-02-28  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * emacs-lisp/debug.el (inhibit-debug-on-entry): New var.
-       (debug): Use it.  Move the inhibit-trace earlier.
-       (debug-entry-code): New const.
-       (debug-on-entry-1): Use it.
-
-2005-02-28  Chong Yidong  <cyd@stupidchicken.com>
-
-       * international/utf-16.el (ccl-encode-mule-utf-16le):
-       Fix BUFFER_MAGNIFICATION to 2.
-       (ccl-encode-mule-utf-16be): Likewise.
-
-2005-02-28  Kenichi Handa  <handa@m17n.org>
-
-       * international/utf-16.el (ccl-encode-mule-utf-16le-with-signature):
-       Fix BUFFER_MAGNIFICATION to 4.
-       (ccl-encode-mule-utf-16be-with-signature): Likewise.
-
-2005-02-28  Nick Roberts  <nickrob@snap.net.nz>
-
-       * speedbar.el (speedbar-update-flag): Doc fix.
-       (speedbar-show-info-under-mouse): Give set-mouse-position the right
-       argument.
-
-2005-02-27  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * reveal.el (reveal-post-command): Don't try to reveal overlays which
-       have a non-nil `invisible' property but are actually visible.
-
-       * progmodes/perl-mode.el (perl-imenu-generic-expression): Add entries
-       for perldoc sections.
-       (perl-outline-regexp, perl-outline-level): New var and function.
-       (perl-mode): Use them.
-
-2005-02-27  Glenn Morris  <gmorris@ast.cam.ac.uk>
-
-       * calendar/diary-lib.el (diary-remind): Discard any mark portion
-       from diary-entry.  Reported by Andrew Kemp <ajwk@pell.uklinux.net>.
-
-2005-02-27  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * cus-edit.el: Comment change.
-       (custom-buffer-create-internal): Slightly reword text at top of
-       Custom buffers.  Mention there that saving an option edits the
-       init file.  Add link to Emacs manual node on `custom-file'.
-       (custom-magic-alist): Rewrite individual State messages to use
-       capitalized keywords.  Doc fix.
-
-2005-02-27  Matt Hodges  <MPHodges@member.fsf.org>
-
-       * calendar/calendar.el (calendar-buffer): Move above
-       calendar-week-start-day.
-       (calendar-week-start-day): Doc fix.  Add :set function.
-       (calendar-minimum-window-height): New variable.
-       (generate-calendar-window): Only resize window if selected-window
-       is displaying the calendar buffer.  Use new variable
-       calendar-minimum-window-height.
-       (generate-calendar): Reword error message.
-       (calendar-mode-map): Bind DEL to scroll-other-window-down.
-
-2005-02-27  Andreas Schwab  <schwab@suse.de>
-
-       * vc.el (vc-do-command): Don't run command asynchronously when
-       operating in a remote directory.
-
-       * net/tramp.el (tramp-file-name-for-operation): Fix misapplied
-       change from sync with Tramp 2.0.47.
-
-2005-02-27  Richard M. Stallman  <rms@gnu.org>
-
-       * textmodes/ispell.el (ispell-change-dictionary): Doc fix.
-
-       * textmodes/flyspell.el (flyspell-mode-on):
-       Call ispell-change-dictionary only if necessary.
-
-       * emacs-lisp/re-builder.el (regexp-builder): New function.
-
-       * register.el (describe-register-1): Explicitly handle
-       yank-excluded-properties = t.
-
-       * cus-edit.el (custom-buffer-create-internal): Improve progress msgs.
-       (custom-magic-alist): Change the status descriptions again.
-       (face widget-type): Total rewrite based on `restricted-sexp'
-       to eliminate the confusing double hiding levels.
-
-       * emacs-lisp/debug.el (debug-on-entry-1):
-       If function body is empty, add nil as body form.
-
-2005-02-26  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * emacs-lisp/trace.el (inhibit-trace): New var.
-       (trace-make-advice): Use it.
-
-       * emacs-lisp/debug.el (debug): Put back the inhibit-trace.
-
-2005-02-26  Kim F. Storm  <storm@cua.dk>
-
-       * mouse.el (mouse-1-click-in-non-selected-windows): New defcustom.
-       (mouse-on-link-p, mouse-drag-region-1): Use it.
-
-2005-02-25  Lute Kamstra  <lute@gnu.org>
-
-       * replace.el (query-replace-read-from): Fix 2005-02-19 change.
-
-2005-02-24  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * frame.el (blink-cursor-mode): Add :group keyword.
-
-2005-02-24  Ulf Jasper  <ulf.jasper@web.de>
-
-       * calendar/icalendar.el (icalendar--decode-isodatetime):
-       New optional argument DAY-SHIFT.
-       (icalendar-export-region): Fix coding-system-for-write.
-       (icalendar--convert-ical-to-diary): Shift end-day of all-day
-       events by one.
-
-2005-02-24  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * textmodes/tex-mode.el (tex-font-lock-keywords-3): #n is atomic.
-
-2005-02-24  Kim F. Storm  <storm@cua.dk>
-
-       * international/iso-acc.el (iso-accents-compose): Fix crash
-       during redisplay.  Call force-window-update after read-event
-       and delete-region to signal that window is not accurate.
-
-2005-02-23  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * emacs-lisp/debug.el (debug): Hide the buffer if it's not killed.
-       Remove unused and inexistent var `inhibit-trace'.
-       (debugger-mode): Use run-mode-hooks.
-       (debugger-list-functions): Add buttons; setup xref stack.
-
-2005-02-23  Richard M. Stallman  <rms@gnu.org>
-
-       * calendar/appt.el (appt-time-msg-list): 3rd elt of each
-       appointment says it was explicitly made.
-       (appt-add): Set the 3rd element.
-       (appt-make-list): Preserve explicit appointments.
-
-       * subr.el (find-tag-default): Catch errors in forward-sexp.
-
-2005-02-23  Juri Linkov  <juri@jurta.org>
-
-       * info.el (Info-isearch-search): New defcustom.
-       (Info-isearch-search): Call the default isearch function
-       when Info-isearch-search is nil.
-       (Info-isearch-wrap): Use variable Info-isearch-search.
-
-2005-02-22  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * cus-edit.el: Comment change.
-
-2005-02-22  Kim F. Storm  <storm@cua.dk>
-
-       * progmodes/hideif.el (hide-ifdef-use-define-alist):
-       Use completing-read.  Suggested by Juan-Leon Lahoz Garcia.
-
-2005-02-22  Simon Josefsson  <jas@extundo.com>
-
-       * net/browse-url.el (browse-url-netscape-new-window-is-tab):
-       New variable.
-       (browse-url-netscape): Use it.  Suggested by "Johann 'Myrkraverk'
-       Oskarsson" <myrkraverk@users.sourceforget.net>.
-
-2005-02-22  Kim F. Storm  <storm@cua.dk>
-
-       * mouse.el (mouse-on-link-p): If arg POS is a mouse event,
-       check that window of that event is the selected window.
-       (mouse-drag-region-1): Compare mouse event window to selected
-       window before setting point.
-
-       * tooltip.el (tooltip-show-help-function): Pass event to
-       mouse-on-link-p so it can check selected window.
-
-2005-02-22  Kenichi Handa  <handa@m17n.org>
-
-       * ps-mule.el (ps-mule-header-string-charsets): Delete it.
-       (ps-mule-show-warning): New function.
-       (ps-mule-begin-job): Use ps-mule-show-warning if unprintable
-       characters are found.
-
-       * ps-print.el (ps-header-footer-string): Return a list of header
-       and footer strings.
-
-2005-02-21  Wolfgang Jenkner  <wjenkner@inode.at>  (tiny change)
-
-       * pcvs.el (cvs-retrieve-revision): Fix thinko.
-
-2005-02-21  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * frame.el (blink-cursor-mode): Use define-minor-mode.
-
-       * term/mac-win.el (function-key-map): Use char-names more consistently.
-       (file-name-coding-system): Only set it for MacOS-9.  The other case is
-       already handled in mule-cmds.el (where it also works when mac-win.el
-       is not used).
-
-2005-02-21  Kenichi Handa  <handa@m17n.org>
-
-       * international/mule.el (ctext-pre-write-conversion): Always use
-       " *code-converting-work*" buffer for work.
-
-       * textmodes/ispell.el (ispell-dictionary-alist): Fix docstring.
-
-2005-02-20  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * progmodes/scheme.el (scheme-font-lock-keywords-2): Handle named-let.
-
-2005-02-20  Jonathan Yavner  <jyavner@member.fsf.org>
-
-       * ses.el (undo-more): Restore defadvice, but only the part that
-       allows changes outside the restricted area of the buffer.
-
-2005-02-20  Kim F. Storm  <storm@cua.dk>
-
-       * simple.el (line-move): Add fourth optional arg try-vscroll which
-       must be set to perform auto-window-vscroll.
-       When moving backwards and doing auto-window-vscroll, automatically
-       vscroll to the last part of lines which are taller than the window.
-       (next-line, previous-line): Set try-vscroll arg on line-move.
-
-2005-02-19  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * replace.el (query-replace, query-replace-regexp)
-       (replace-string, replace-regexp): When operating on region, make
-       the minibuffer prompt say so.
-
-       * isearch.el (isearch-forward): Document isearch-query-replace and
-       isearch-query-replace-regexp keybindings.
-
-2005-02-19  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-aent.el (math-read-token): Add local variable.
-
-       * calc/calc-prog.el (calc-user-define-edit): Add local variable.
-       (calc-edit-top): Move declaration to earlier in file.
-       (calc-edit-macro-repeats): Add local variables.
-
-       * calc/calcalg2.el: Add differentiation rule for calcFunc-coth.
-       Adjust differentiation rules for calcFunc-tan, calcFunc-cot,
-       calcFunc-tanh.
-       Adjust integration rule for calcFunc-tan.
-
-2005-02-19  Michael Kifer  <kifer@cs.stonybrook.edu>
-
-       * viper-cmd.el (viper-prefix-commands): Make into a defconst.
-       (viper-exec-buffer-search): Use regexp-quote to quote buffer string.
-       (viper-minibuffer-setup-sentinel): Make some variables buffer-local.
-       (viper-skip-separators): Bug fix.
-       (viper-set-searchstyle-toggling-macros): Allow to unset macros in a
-       particular major mode.
-       (viper-del-backward-char-in-replace): Don't put deleted char on the
-       kill ring.
-
-       * viper-ex.el (viper-color-display-p): New function.
-       (viper-has-face-support-p): Use viper-color-display-p.
-
-       * viper-keym.el (viper-gnus-modifier-map): New keymap.
-
-       * viper-macs.el (viper-unrecord-kbd-macro): Bug fix.
-
-       * viper-util.el (viper-glob-unix-files): Fix shell status check.
-       (viper-file-remote-p): Make equivalent to file-remote-p.
-
-       * viper.el (viper-major-mode-modifier-list):
-       Use viper-gnus-modifier-map.
-
-2005-02-19  David Kastrup  <dak@gnu.org>
-
-       * subr.el (subregexp-context-p): Fix garbled doc string by adding
-       quoting.
-
-2005-02-19  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-math.el (calc-arctan, calc-tanh, calc-arctanh):
-       Remove extra definitions.
-       (calc-coth): New function.
-       (calcFunc-cot): Fix `let'.
-
-2005-02-19  Eli Zaretskii  <eliz@gnu.org>
-
-       * faces.el (escape-glyph, minibuffer-prompt): Add commentary for
-       the reasons we use "type pc" in these faces.
-
-       * button.el (button): Ditto.
-
-2005-02-19  Michael Mauger  <mmaug@yahoo.com>
-
-       * replace.el (query-replace-read-from): Set the value of
-       query-replace-from-history-variable to handle the case of an empty
-       string entered to accept the suggested default.
-
-       * net/tramp.el (tramp-file-name-for-operation):
-       Use dired-call-process instead of dired-call-process-command.
-
-2005-02-19  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-arith.el (math-trig-inverses, math-div-trig)
-       (math-div-non-trig): New variables.
-       (math-combine-prod-trig, math-div-new-trig, math-div-new-non-trig)
-       (math-div-isolate-trig, math-div-isolate-trig-term): New functions.
-       (math-combine-prod, math-div-symb-fancy): Add simplifications for
-       trig expressions.
-
-2005-02-19  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-var-update-handler)
-       (gdb-speedbar-timer-fn): Ensure speedbar updates with new values
-       for watch expressions,
-       (gdb-var-create-handler): Don't set speedbar-update-flag.
-       (gdb-post-prompt): Simplify test for speedbar.
-
-2005-02-19  Michael Kifer  <kifer@cs.stonybrook.edu>
-
-       * ediff.el (ediff-set-diff-overlays-in-one-buffer)
-       (ediff-set-fine-overlays-in-one-buffer, ediff-goto-word): Make sure
-       we use the syntax table of the correct buffer.
-       (ediff-same-file-contents, ediff-same-contents): Enhancements thanks to
-       Felix Gatzemeier.
-
-       * ediff-init.el (ediff-hide-face): Check for definedness of functions.
-       (ediff-file-remote-p): Make synonymous with file-remote-p.
-       In all deffaces ediff-*-face-*, use min-colors.
-
-       * ediff-mult.el (ediff-meta-mark-equal-files): Make use of
-       ediff-recurse-to-subdirectories.
-       (ediff-mark-if-equal): Check that the arguments are strings, use
-       ediff-same-contents (after to Felix Gatzemeier).
-
-       * ediff.el (ediff-merge-on-startup): Don't set buffer-modified-p to
-       nil.
-
-2005-02-18  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * log-view.el (log-view-message-re): Fix up Subversion regexp.
-
-2005-02-18  David Kastrup  <dak@gnu.org>
-
-       * progmodes/meta-mode.el (meta-mark-active): Fix condition to just
-       use `mark-active' when defined.
-
-2005-02-18  Kenichi Handa  <handa@m17n.org>
-
-       * ps-print.el (ps-font-info-database): New entry
-       ZapfChancery-MediumItalic with correct font name.  Fix font name
-       of the entry Zapf-Chancery-MediumItalic.
-
-2005-02-16  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * autorevert.el (auto-revert-stop-on-user-input): Further doc fix.
-
-2005-02-16  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-fallback-command): Pass user input to fallback command.
-
-2005-02-16  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-set-gud-minor-mode-existing-buffers)
-       (gdb-find-file-hook): Add server prefix.
-
-2005-02-16  Richard M. Stallman  <rms@gnu.org>
-
-       * replace.el (perform-replace): Pass new args to replace-highlight.
-       (replace-highlight): Take region args,
-       and pass them to isearch-lazy-highlight-new-loop.
-
-       * novice.el (disabled-command-hook): Autoload the defalias
-       and the make-obsolete-variable call.
-
-       * menu-bar.el (menu-bar-select-frame): FRAME defaults to selected.
-
-       * isearch.el (isearch-lazy-highlight-start-limit)
-       (isearch-lazy-highlight-end-limit): New variables limit
-       the region for highlighting.
-       (isearch-lazy-highlight-new-loop): New args BEG and END.
-       (isearch-lazy-highlight-search): Use the new vars.
-       (isearch-lazy-highlight-update): Likewise.
-
-       * dired.el (dired-build-subdir-alist): Bind buffer-undo-list to t.
-
-       * cus-start.el (all): Use default-boundp.
-
-2005-02-15  David Casperson  <casper@unbc.ca>  (tiny change)
-
-       * menu-bar.el (menu-bar-select-frame): Handle current frame.
-
-2005-02-15  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * autorevert.el (auto-revert-stop-on-user-input)
-       (auto-revert-verbose): Doc fixes.
-
-2005-02-15  Benjamin Riefenstahl  <Benjamin.Riefenstahl@epost.de>
-
-       * international/mule-cmds.el (set-locale-environment): Remove call
-       to set-selection-coding-system on Windows.
-
-2005-02-15  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-alg.el: Add simplification rules for calcFunc-sec,
-       calcFunc-csc, calcFunc-cot, calcFunc-sech, calcFunc-csch, and
-       calcFunc-coth.
-       (math-simplify-sqrt): Add simplifications.
-
-       * calc/calc-arith.el (math-real-if-arg-functions): Add functions
-       to list.
-
-       * calc/calc-ext.el: Add functions to autoloads.
-
-       * calc/calc-math.el (calc-sec, calc-csc, calc-cot, calc-sech)
-       (calc-csch, calc-coth, calcFunc-sec, calcFunc-csc, calcFunc-cot)
-       (calcFunc-sech, calcFunc-csch, calcFunc-coth, math-sec-raw)
-       (math-csc-raw, math-cot-raw): New functions.
-
-       * calc/calc-rules.el (calc-DistribRules, calc-NegateRules): Add rules.
-
-       * calc/calc-undo.el (calc-handle-undo): Remove prefix from
-       the variable name in a message.
-
-       * calc/calc-units.el: Add simplification rules for calcFunc-sec,
-       calcFunc-csc, calcFunc-cot.
-
-       * calc/calcalg2.el: Add derivative and integration rules for
-       calcFunc-sec, calcFunc-csc, calcFunc-cot, calcFunc-sech,
-       calcFunc-csch, calcFunc-coth.
-       (math-do-integral-methods): Add to checks for when to use
-       substitutions.
-
-       * calc/calccomp.el (math-eqn-special-funcs): Add functions to list.
-
-2005-02-15  Lute Kamstra  <lute@gnu.org>
-
-       * emacs-lisp/lisp-mode.el (lisp-mode-variables):
-       Add ;;;###autoload to `outline-regexp'.  Suggested by Stefan Monnier
-       <monnier@iro.umontreal.ca>.
-       (lisp-outline-level): Improve efficiency.  Suggested by David
-       Kastrup <dak@gnu.org>.
-
-2005-02-15  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-find-file-unhook): New variable.
-       (gdb-set-gud-minor-mode, gdb-set-gud-minor-mode-1)
-       (gdb-set-gud-minor-mode-existing-buffers): New functions.
-       (gdb-find-file-hook): New hook.  Add it to find-file-hook.
-       (gdb-info-breakpoints-custom, gdb-source-info): Simplify.
-
-2005-02-14  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * cus-start.el (all): Comment change.
-
-2005-02-14  Lute Kamstra  <lute@gnu.org>
-
-       * cus-start.el (all): Check if symbol is void.
-
-2005-02-14  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/reftex-cite.el (reftex-do-citation): Cleanup single
-       optional argument to \cite.
-
-2005-02-14  Richard M. Stallman  <rms@gnu.org>
-
-       * cus-edit.el (custom-buffer-create-internal): Update help message.
-       (custom-magic-alist): Update help messages.
-
-       * cus-start.el (all): Allow a var to specify a standard value.
-
-2005-02-12  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * custom.el (custom-theme-set-variables): Handle variable aliases.
-
-       * frame.el (blink-cursor-timer): Doc fix.
-       (blink-cursor): Make it an alias for `blink-cursor-mode' and
-       declare obsolete.
-       (blink-cursor-mode): Define with defcustom and use correct
-       standard expression in that defcustom.
-       * startup.el (command-line): Adapt to above changes in frame.el.
-
-2005-02-11  Lute Kamstra  <lute@gnu.org>
-
-       * apropos.el (apropos-score-doc): Prevent division by zero.
-
-2005-02-11  Ulf Jasper  <ulf.jasper@web.de>
-
-       * calendar/icalendar.el (icalendar--get-event-property): Doc fix.
-       (icalendar--get-event-property-attributes)
-       (icalendar--get-event-properties)
-       (icalendar--datetime-to-diary-date): New functions.
-       (icalendar--split-value): Doc fix.
-       (icalendar--datetime-to-noneuropean-date)
-       (icalendar--datetime-to-european-date): New optional argument
-       SEPARATOR.  Return result as a string instead of a list.
-       (icalendar--get-weekday-number): Check if ABBREVWEEKDAY is nil.
-       (icalendar--convert-string-for-export): Rename arg S to STRING.
-       (icalendar-export-region): Doc fix.  Change name of error buffer.
-       Save output buffer.
-       (icalendar-import-file): Add blank at end of prompt.
-       (icalendar-import-buffer): Doc fix.  Do not switch to error
-       buffer.  Indicate status in return value.
-       (icalendar--convert-ical-to-diary): Doc fix.  Change name of error
-       buffer.  Save output buffer.  Handle exception from recurrence
-       rules (EXDATE, EXRULE).  Handle start- and end-date of recurring
-       events.  Fix problems with weekly all-day events.
-
-2005-02-10  Richard M. Stallman  <rms@gnu.org>
-
-       * simple.el (eval-expression-print-format):
-       Avoid warning about edebug-active.
-
-       * help.el (help-for-help-internal): Rename from help-for-help.
-       (help-for-help): Define with defalias.
-
-       * font-core.el (font-lock-default-function): Use with-no-warnings.
-
-       * cus-edit.el (custom-buffer-create-internal): Improve help-echo.
-
-       * custom.el (defface): Doc fix.
-
-2005-02-10  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-ann3): Re-instate GDB command "set
-       width 0" to prevent word wrapping problems.
-
-2005-02-09  Kim F. Storm  <storm@cua.dk>
-
-       * ido.el (ido-file-extensions-order): New defcustom.
-       (ido-file-extension-lessp, ido-file-extension-aux)
-       (ido-file-extension-order): New advanced file ordering.
-       (ido-file-lessp): New simple file ordering.
-       (ido-sort-list): Remove.
-       (ido-make-file-list): Use ido-file-lessp or ido-file-extension-lessp.
-       (ido-make-dir-list, ido-completion-help): Use ido-file-lessp.
-
-2005-02-08  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * progmodes/grep.el (grep-regexp-alist): Match an optional ^[[K
-       that some versions of grep produce.
-       (grep-mode-font-lock-keywords): Likewise.
-
-2005-02-09  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-location-list): New variable.
-       (gdb-cdir): Delete.
-       (gdb-info-breakpoints-custom, gdb-goto-breakpoint)
-       (gdb-source-info): Treat case when source file is in another
-       directory properly.
-       (gdb-get-location): New function.
-
-2005-02-07  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-prog.el (calc-write-parse-table-part)
-       (calc-fix-token-name): Fix a check for language type.
-
-       * calc/calccomp.el (math-compose-expr): Fix a check for language type.
-
-2005-02-07  Andre Spiegel  <spiegel@gnu.org>
-
-       * vc-hooks.el (vc-make-version-backup): Ignore file-errors such
-       as directory not writable.
-
-2005-02-07  Kim F. Storm  <storm@cua.dk>
-
-       * emulation/cua-base.el (cua-max-undo, cua-undo): Remove.
-       (cua--standard-movement-commands): Remove list.
-       Instead, set CUA property value to move for movement commands.
-       (cua-movement-commands): Remove.  Users must set CUA prop instead.
-       (cua--pre-command-handler): Check CUA property.
-       (cua--init-keymaps): Don't remap undo commands.
-       (cua-mode): Don't call cua--rectangle-on-off.
-
-       * emulation/cua-rect.el (cua--undo-list, cua--tidy-undo-counter)
-       (cua--rect-undo, cua--tidy-undo-lists, cua--rectangle-on-off): Remove.
-       (cua--rect-undo-set-point): New var.
-       (cua--rectangle-undo-boundary): Setup undo apply entry.
-       (cua--rect-undo-handler): New function for rectangle undo.
-       (cua--rect-start-position, cua--rect-end-position): Add.
-       (cua--rectangle-post-command): Call cua--rectangle-set-corners
-       for restored rectangle.  Set point if cua--rect-undo-set-point.
-
-2005-02-06  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-lang.el (calc-tex-language): Display more information
-       in messages.
-
-       * calc/calccomp.el (math-compose-expr): Allow multiline matrices
-       in TeX mode.
-
-2005-02-06  Richard M. Stallman  <rms@gnu.org>
-
-       * emacs-lisp/lisp.el (buffer-end): Doc fix.
-
-2005-02-05  Arne J\e,Ax\e(Brgensen  <arne@arnested.dk>  (tiny change)
-
-       * net/ldap.el (ldap-search-internal): Support attributes with
-       optional descriptions separated by a semi-colon, as in
-       "userCertificate;binary".
-
-2005-02-05  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * x-dnd.el (x-dnd-handle-xdnd): Handle the case where the flags
-       isn't a cons (i.e. the version is 0).
-
-2005-02-05  Eli Zaretskii  <eliz@gnu.org>
-
-       * help.el (help-for-help): Doc fix.
-
-2005-02-05  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el: Update copyright.  Put GDB-Frames before
-       GDB-Windows on the menu-bar as this works better.
-
-2005-02-04  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-embed.el (calc-embedded-update): Don't put in
-       unnecessary newlines.  Adjust the end of formula marker.
-
-       * calc/calc-lang.el (math-latex-parse-frac): Don't use arguments.
-       (math-latex-parse-two-args): New function.
-
-2005-02-03  Lute Kamstra  <lute@gnu.org>
-
-       * help-fns.el (help-with-tutorial): Make sure that users cannot
-       remove the entire text of the tutorial by means of `undo'.
-
-2005-02-03  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * textmodes/ispell.el (ispell-internal-change-dictionary): Fix problem
-       in recent changes, where the ispell process was repeatedly
-       killed & restarted.
-
-       * international/mule-cmds.el (set-locale-environment): Set file-name
-       coding system to utf-8 on Darwin systems.
-       (set-default-coding-systems): Don't set default-file-name-coding-system
-       on Darwin systems.
-
-2005-02-03  Richard M. Stallman  <rms@gnu.org>
-
-       * hi-lock.el (hi-lock-mode): Turning on Hi-Lock turns on Font-Lock.
-
-2005-02-03  Matt Hodges  <MPHodges@member.fsf.org>
-
-       * faces.el (list-faces-display): Add optional argument.
-
-2005-02-02  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * font-core.el (font-lock-default-function): Handle the rare case where
-       only font-lock-keywords is set.
-
-2005-02-02  Kenichi Handa  <handa@m17n.org>
-
-       * international/characters.el: Cancel previous change for
-       I-WITH-DOT-ABOVE and DOTLESS-i.
-
-       * international/latin-5.el: Cancel previous change.
-
-2005-02-02  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el: Correction to syntax in gud-menu-map.
-
-2005-02-02  Kenichi Handa  <handa@m17n.org>
-
-       * international/latin-5.el (tbl): Setup cases of I-WITH-DOT-ABOVE,
-       DOTLESS-i.
-
-       * international/characters.el: Setup cases of GREEK-FINAL-SIGMA,
-       Y-WITH-DIAERESIS, I-WITH-DOT-ABOVE, DOTLESS-i.
-
-       * case-table.el (get-upcase-table): New function.
-       (copy-case-table): Copy upcaes table too if non-nil.
-       (set-case-syntax-delims): Maintain upcase table too.
-       (set-case-syntax-pair): Likewise.
-       (set-upcase-syntax, set-downcase-syntax): New functions.
-       (set-case-syntax): Maintain upcase table too.
-
-2005-02-02  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-goto-info): Delete.
-
-       * progmodes/gud.el (gud-goto-info): New function.
-       (gud-tool-bar-map): Use correct icon.
-
-2005-02-01  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * emacs-lisp/lisp-mode.el (lisp-indent-function): Fix bug:
-       When delegating, order args in the funcall correctly.
-
-2005-02-01  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * emacs-lisp/lisp-mode.el (lisp-indent-function): Doc fix.
-
-2005-02-01  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/reftex.el (reftex-access-scan-info): Error out in a
-       buffer not visiting a file.
-
-2005-01-31  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-embed.el (calc-embedded-find-bounds): Set the formula
-       bound on the line with the formula.
-
-2005-01-31  Kim F. Storm  <storm@cua.dk>
-
-       * ses.el (ses-create-cell-variable-range)
-       (ses-destroy-cell-variable-range, ses-reset-header-string)
-       (ses-set-with-undo, ses-unset-with-undo, ses-aset-with-undo)
-       (ses-insert-row): Fix format of apply undo entries.
-
-2005-01-31  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-aent.el (math-read-token): Separate the TeX and LaTeX
-       parts.
-
-       * calc/calc-embed.el (calc-embedded-open-formula)
-       (calc-embedded-close-formula): Ignore matrix environments.
-
-       * calc/calc-ext.el (math-read-big-expr): Make LaTeX the default
-       TeX mode.
-
-       * calc/calc-lang.el (math-function-table, math-oper-table)
-       (math-variable-table): Adjust the LaTeX portions.
-
-       * calc/calc.el (math-tex-ignore-words): Remove LaTeX portion.
-       (math-latex-ignore-words): New constant.
-
-2005-01-31  Richard M. Stallman  <rms@gnu.org>
-
-       * textmodes/ispell.el (ispell-local-dictionary-overridden): New var.
-       (ispell-local-dictionary): Doc fix.
-       (ispell-dictionary-alist): Don't include ispell-local-dictionary-alist.
-       Don't reinitialize at run time.  Don't defcustom.
-       All uses changed to append ispell-local-dictionary-alist,
-       or check it first.
-       (ispell-current-dictionary): New variable for dictionary in use.
-       (ispell-dictionary): Now used only for global default.
-       (ispell-start-process): Set ispell-current-dictionary,
-       not ispell-dictionary.
-       (ispell-change-dictionary): Use this only for setting
-       user preferences.
-       (ispell-internal-change-dictionary): New function
-       to change the current dictionary in use.
-       (ispell-region, ispell-process-line, ispell-buffer-local-dict):
-       Use ispell-current-dictionary.
-       Handle ispell-local-dictionary-overridden.
-       (ispell-buffer-local-dict): Call ispell-internal-change-dictionary.
-
-2005-01-31  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-aent.el (math-read-token): Add support for LaTeX.
-
-       * calc/calc-ext.el: Add calc-latex-language to autoloads.
-       (calc-mode-map): Add calc-latex-language.
-
-       * calc/calc-lang.el (calc-latex-language, math-latex-parse-frac)
-       (math-latex-print-frac): New functions.
-       (math-oper-table, math-function-table, math-variable-table)
-       (math-complex-format, math-input-filter): Add latex properties.
-       (calc-set-language): Set math-expr-special-function-mapping.
-
-       * calc/calc-prog.el (calc-edit-user-syntax, calc-fix-token-name)
-       (calc-write-parse-table-part): Add LaTeX support.
-
-       * calc/calc.el (calc-language): Adjust docstring.
-       (calc-set-mode-line): Add LaTeX support.
-       (math-expr-special-function-mapping): New variable.
-       (math-tex-ignore-words): Add to list.
-
-       * calc/calccomp.el (math-compose-expr, math-compose-rows):
-       Add LaTeX support.
-       (math-compose-expr): Add support for special functions.
-
-       * calc/calc-help.el (calc-d-prefix-help): Add LaTeX.
-
-2005-01-31  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-memory-address)
-       (gdb-memory-repeat-count, gdb-memory-format, gdb-memory-unit)
-       (gdb-memory-mode-map, gdb-memory-format-keymap)
-       (gdb-memory-format-menu, gdb-memory-unit-keymap)
-       (gdb-memory-unit-menu): New variables for a buffer
-       that lets the user examine program memory.
-       (gdb-memory-set-address, gdb-memory-set-repeat-count)
-       (gdb-memory-format-binary, gdb-memory-format-octal)
-       (gdb-memory-format-unsigned, gdb-memory-format-signed)
-       (gdb-memory-format-hexadecimal, gdb-memory-format-menu)
-       (gdb-memory-format-menu-1, gdb-memory-unit-giant)
-       (gdb-memory-unit-word, gdb-memory-unit-halfword)
-       (gdb-memory-unit-byte, gdb-memory-unit-menu)
-       (gdb-memory-unit-menu-1, gdb-make-header-line-mouse-map)
-       (gdb-memory-mode, gdb-memory-buffer-name)
-       (gdb-display-memory-buffer, gdb-frame-memory-buffer):
-       New functions for above buffer.
-
-2005-01-30  Richard M. Stallman  <rms@gnu.org>
-
-       * cus-edit.el (custom-bury-buffer): Function deleted.
-       (custom-buffer-done-function): Option deleted.
-       (custom-buffer-done-kill): New replacement option.
-       (Custom-buffer-done): Call quit-window.
-       (custom-buffer-create-internal): Update for above changes.
-
-2005-01-29  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * simple.el (undo-ask-before-discard): New var.
-       (undo-outer-limit-truncate): Implement it.
-       (undo-extra-outer-limit): Doc update.
-
-2005-01-29  Richard M. Stallman  <rms@gnu.org>
-
-       * ses.el (undo-more): Delete defadvice.
-       (ses-begin-change): Doc fix.
-
-       * dired.el (dired-mode-map): Remap `undo' and `advertised-undo'
-       instead of rebinding C-x u and C-_.
-
-       * files.el (normal-backup-enable-predicate): Return nil for files
-       in /tmp, regardless of temporary-file-directory.
-
-       * man.el (Man-getpage-in-background): Disable undo in Man buffer.
-
-       * rect.el (delete-rectangle-line, delete-extract-rectangle-line)
-       (open-rectangle, delete-whitespace-rectangle-line)
-       (clear-rectangle-line): If FILL, pass t instead of FILL
-       for move-to-column's 2nd arg.
-
-       * simple.el (undo): Fix the test for continuing a series of undos.
-       (undo-more): Set pending-undo-list to t when we reach end.
-       (pending-undo-list): Move up defvar.
-
-       * wid-edit.el (widget-button-click):
-       Shorten the range of the track-mouse binding.
-
-       * comint.el (comint-insert-input): Undo previous changes;
-       use last-input-event in interactive spec.
-
-2005-01-29  Eli Zaretskii  <eliz@gnu.org>
-
-       * progmodes/compile.el (compilation-start): Bind buffer-read-only
-       to nil before invoking call-process.  Reset buffer's modified flag
-       after fontifying it in the no-async branch.
-
-       * wid-edit.el (widget-specify-button): If mouse pointer shape
-       cannot be changed, use mouse face instead.
-
-2005-01-29  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-info-breakpoints-custom)
-       (gdb-goto-breakpoint): Make breakpoint handling work on template
-       functions in C++.  Reported by Martin Reed <mjreed@essex.ac.uk>.
-       (gdb-assembler-custom): Update to recognize breakpoint information
-       added on 2005-01-19.
-
-2005-01-28  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/scheme.el (scheme-mode-variables): Set comment-add.
-       (dsssl-mode): Use define-derived-mode.
-       (scheme-mode-initialize): Remove.
-       (scheme-mode): Use run-mode-hooks.
-
-       * cus-edit.el (customize-group-other-window)
-       (custom-buffer-create-other-window): Don't override special-display-*.
-       (custom-mode-map): Make it dense.
-
-       * emacs-lisp/lisp-mode.el (eval-defun-1): Make sure `defvar' always
-       sets the default value.
-
-2005-01-28  Eli Zaretskii  <eliz@gnu.org>
-
-       * descr-text.el: Add more keywords.
-
-2005-01-27  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * speedbar.el: Avoid unnecessary use of locate-library.
-
-       * international/mule-cmds.el (standard-display-european-internal):
-       Don't fiddle with latin-1 non-break space any more since it's now
-       special cased in the C code.
-       Don't "do&undo" setting for 160 (especially, don't undo incorrectly).
-
-2005-01-26  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * cus-start.el (all): Add `undo-outer-limit'.
-
-2005-01-25  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
-
-       * textmodes/bibtex.el (bibtex-format-entry):
-       Use `bibtex-empty-field-re' only on the text of fields, not on entire
-       field lines.
-       (bibtex-autofill-entry): Use `bibtex-empty-field-re' on a string,
-       not on part of a buffer.
-
-2005-01-25  Lute Kamstra  <lute@gnu.org>
-
-       * textmodes/bibtex.el (bibtex-empty-field-re): Don't match
-       nonempty field text strings like "{letters\\macro{}more letters}".
-       Clarify docstring.
-       (bibtex-sort-entry-class, bibtex-autokey-titleword-ignore)
-       (bibtex-entry-offset, bibtex-parse-association)
-       (bibtex-parse-field-name): Fix typos in docstrings.
-       (bibtex-field-list, bibtex-find-crossref): Fix typos in error messages.
-
-2005-01-24  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/reftex-global.el (reftex-isearch-push-state-function)
-       (reftex-isearch-pop-state-function, reftex-isearch-isearch-search)
-       (reftex-isearch-switch-to-next-file, reftex-isearch-turn-off)
-       (reftex-isearch-turn-on, reftex-isearch-minor-mode): New functions.
-
-       * textmodes/reftex.el (reftex-mode-menu): Add entry for reftex
-       isearch minor mode.
-
-2005-01-24  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * help-at-pt.el (help-at-pt-display-when-idle): Add autoload cookie.
-
-2005-01-24  Lute Kamstra  <lute@gnu.org>
-
-       * textmodes/ispell.el (ispell-dictionary-alist-4): Rewrite the
-       CASECHARS and NOT-CASECHARS regular expressions of the
-       "nederlands" and "nederlands8" dictionaries to prevent a "Range
-       striding over charsets" error.
-
-2005-01-24  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-store.el (calc-declare-variable): Use calc-var-name to
-       display variable name.
-
-2005-01-24  Kenichi Handa  <handa@m17n.org>
-
-       * international/encoded-kb.el (encoded-kbd-iso2022-single-shift):
-       Fix setting of the element of encoded-kbd-iso2022-invocations.
-
-2005-01-24  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-goto-breakpoint, gdb-frames-select)
-       (gdb-threads-select): Change to also accept mouse events.
-       (gdb-mouse-goto-breakpoint, gdb-frames-mouse-select)
-       (gdb-threads-mouse-select): Delete.
-
-2005-01-23  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * files.el (insert-directory): Take care of empty directory,
-       listed without -a switch.
-
-2005-01-23  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * textmodes/refill.el (refill-post-command-function):
-       Add `indent-new-comment-line' and `reindent-then-newline-and-indent'
-       to the list of functions that we should be careful not to undo.
-       (refill-late-fill-paragraph-function): Remove.
-       (refill-saved-state): New var.
-       (refill-mode): Use it to save fill-paragraph-function.
-       Save also the value of auto-fill-function.
-
-       * term/w32-win.el: Simplify code.
-
-2005-01-23  Kim F. Storm  <storm@cua.dk>
-
-       * simple.el (line-move): Adapt to new return value from
-       pos-visible-in-window-p.
-
-       * simple.el (line-move): Fix last change.  Check partial
-       visibility at point rather than at window-start.
-
-2005-01-22  Jason Rumney  <jasonr@gnu.org>
-
-       * term/w32-win.el (xw-defined-colors): Remove debug-message.
-
-2005-01-22  David Kastrup  <dak@gnu.org>
-
-       * progmodes/grep.el: Add alias `find-grep' for `grep-find'.
-
-2005-01-22  Eli Zaretskii  <eliz@gnu.org>
-
-       * type-break.el (type-break-mode): Add a test for
-       type-break-file-name being non-nil.
-
-2005-01-22  Toby Allsopp  <Toby.Allsopp@navman.com>  (tiny change)
-
-       * net/eudc.el (top level): Call (message "") via progn, so that
-       eudc-options-file is loaded.
-
-2005-01-22  Kim F. Storm  <storm@cua.dk>
-
-       * simple.el (line-move-1): Rename from line-move.
-       (line-move): New function that adjusts vscroll for partially
-       visible rows, and calls line-move-1 otherwise.
-
-2005-01-21  Ren\e,Ai\e(B Kyllingstad  <listmailxemacs@kyllingstad.com>
-
-       * pcomplete.el: Define pcomplete-read-event instead of read-event,
-       since it's not a complete read-event implementation.
-
-2005-01-20  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-ext.el (calc-fancy-prefix-other-key): Set prefix arg
-       for called function.
-
-2005-01-20  Steven Tamm  <steventamm@mac.com>
-
-       * term/mac-win.el (process-connection-type): Remove.
-       Controlled now by s/darwin.h:PTY_ITERATION.
-
-2005-01-20  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * window.el (handle-select-window): Don't switch window when we're
-       in the minibuffer.
-
-2005-01-10  Paul Pogonyshev  <pogonyshev@gmx.net>
-
-       * subr.el (dotimes-with-progress-reporter): New macro.
-
-       * ses.el (ses-dotimes-msg): Remove macro.
-       Use `dotimes-with-progress-reporter' instead.
-
-2005-01-19  Steven Tamm  <steventamm@mac.com>
-
-       * term/mac-win.el (process-connection-type): Use new
-       operating-system-release variable to use ptys on Darwin 7 (OS X
-       10.3) when using carbon build.
-
-2005-01-19  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-ext.el (calc-fancy-prefix-other-key): Don't clear
-       flags if the last command was a tab or M-tab.
-
-       * calc/calc-prog.el (calc-user-define-edit): Put original formula
-       in formula editing buffer.
-
-2005-01-19  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-put-breakpoint-icon): Add help-echo for
-       breakpoint image symbol in margin.
-
-2005-01-19  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-prog.el (calc-execute-kbd-macro):
-       Ignore calc-keep-arg-flag.
-
-2005-01-19  Kenichi Handa  <handa@m17n.org>
-
-       * textmodes/ispell.el (ispell-looking-at): New function.
-       (ispell-process-line): Use ispell-looking-at to compare the ispell
-       output and the buffer contents.
-
-2005-01-18  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc.el (calc-display-raw): Fix docstring.
-
-2005-01-18  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * simple.el (blink-matching-open): Strip extra info from syntax.
-
-       * progmodes/sh-script.el (sh-here-doc-open-re): Don't allow | or other
-       funny chars in the end-of-here-doc marker.
-
-2005-01-19  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-put-string): Copy/create strings so
-       that enable/disabled state of breakpoints is shown correctly in
-       fringe and on ttys.
-       (gdb-put-breakpoint-icon, gdb-info-breakpoints-custom):
-       Add breakpoint information as text properties.
-       (gdb-mouse-toggle-breakpoint):
-       Rename to gdb-mouse-set-clear-breakpoint.
-       (gdb-mouse-toggle-breakpoint): New function.  Enable/disable
-       breakpoints in the margin.
-       (gdb-remove-strings): Simplify.
-
-2005-01-17  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-yank.el (calc-edit-mode): Inhibit read-only when
-       erasing buffer.
-
-2005-01-17  Richard M. Stallman  <rms@gnu.org>
-
-       * progmodes/grep.el (grep-find): Copy from `grep' the condition
-       for calling grep-compute-defaults.
-
-       * play/decipher.el (decipher-mode): Don't call decipher-read-alphabet
-       if buffer is empty.
-
-       * emacs-lisp/lisp.el (backward-kill-sexp, kill-sexp): Doc fixes.
-
-2005-01-17  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * hilit-chg.el (highlight-changes-mode): Don't autoload.
-
-       * bindings.el (mode-line-mode-menu): Use bound-and-true-p for all the
-       non-preloaded variables.
-
-2005-01-17  Steven Tamm  <steventamm@mac.com>
-
-       * textmodes/tex-mode.el (tex-start-shell): Adding -i to the
-       tex-shell cause to force interactivity when using pipes.
-
-2005-01-17  Kim F. Storm  <storm@cua.dk>
-
-       * simple.el (just-one-space): Make arg optional.
-
-2005-01-17  Nick Roberts  <nickrob@snap.net.nz>
-
-       * xt-mouse.el (xterm-mouse-event): Set new optional fourth arg in
-       posn-at-x-y to t to access left-margin.
-
-2005-01-16  Michael Albinus  <michael.albinus@gmx.de>
-
-       Sync with Tramp 2.0.47.
-
-       * net/tramp.el (tramp-operation-not-permitted-regexp): New defcustom,
-       catching keep-date problems in cp/scp operations.
-       (tramp-handle-copy-file): Don't call `set-file-modes'
-       unconditionally.  Specialized functions should know better what is
-       necessary.  This improves performance a little bit, and the
-       functions could catch errors with `cp -p' and `scp -p'.
-       (tramp-do-copy-or-rename-file-via-buffer)
-       (tramp-do-copy-or-rename-file-out-of-band): Call `set-file-modes'
-       when appropriate.
-       (tramp-do-copy-or-rename-file-directly): Mask `cp -p' error.
-       Call `set-file-modes' when appropriate.
-       (tramp-action-out-of-band): Mask `scp -p' error.  Reported by Isak
-       Johnsson <isak@hypergene.com>.
-       (tramp-get-buffer, tramp-get-debug-buffer): Discard the undo list
-       of both Tramp buffer and debug buffer.  Reported by Joakim Verona
-       <joakim@verona.se>.
-       (tramp-file-name-for-operation): Mark `shell-command' as magic for
-       Emacs only.
-
-       * net/tramp-util.el (tramp-minor-mode): New minor mode.  Add it to
-       `find-file-hooks' and `dired-mode-hook'.
-       (tramp-minor-mode-map): Respective map.  Add remapping for
-       `compile' and `recompile'.
-       (tramp-remap-command, tramp-recompile): New defuns.
-       (tramp-compile): Enable `tramp-minor-mode' and `compilation-mode'
-       in buffer "*Compilation*".  Call the commands asynchronously.
-
-       * net/tramp-vc.el (tramp-vc-do-command, tramp-vc-do-command-new)
-       (tramp-vc-simple-command): Call `tramp-handle-shell-command' but
-       `shell-command', because it isn't magic in XEmacs.  Reported by
-       Adrian Aichner <adrian@xemacs.org>.
-
-       * net/tramp-smb.el (tramp-smb-file-name-handler-alist): Add entry for
-       `substitute-in-file-name.
-       (tramp-smb-handle-substitute-in-file-name): New defun.
-       (tramp-smb-advice-PC-do-completion): Delete advice.
-
-2005-01-16  Kai Grossjohann  <kgrossjo@eu.uu.net>
-
-       * net/tramp.el (tramp-wait-for-output): Fix typo in echo processing.
-       Fix error in deleting region.
-
-2005-01-15  Richard M. Stallman  <rms@gnu.org>
-
-       * emacs-lisp/lisp-mnt.el (lm-with-file): Use Lisp mode in temp buffer.
-       In non-temp buffer, switch syntax table temporarily.
-
-       * emacs-lisp/lisp-mode.el (indent-pp-sexp): Doc fix.
-
-       * replace.el (occur-accumulate-lines, occur-engine): Avoid warnings.
-
-       * tar-mode.el (tar-extract): Bind buffer-undo-list to t.
-
-       * imenu.el (imenu--split-menu): Copy menulist before sorting.
-       (imenu--generic-function): Use START, not BEG, as pos of definition.
-
-       * simple.el (just-one-space): Argument specifies number of spaces.
-
-       * simple.el (eval-expression-print-format): Avoid warning
-       about edebug-active.
-
-2005-01-15  James R. Van Zandt  <jrvz@comcast.net>  (tiny change)
-
-       * progmodes/sh-script.el: Code copied from make-mode.el
-       with small changes,
-       (sh-mode-map): Bind C-c C-\.
-       (sh-backslash-column, sh-backslash-align): New variables.
-       (sh-backslash-region, sh-append-backslash): New functions.
-
-2005-01-15  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
-
-       * mail/rmail.el: Updated to work with movemail from GNU Mailutils
-       (rmail-pop-password, rmail-pop-password-required): Move to
-       rmail-obsolete group.
-       (rmail-set-pop-password): Rename to rmail-set-remote-password.
-       All callers updated.
-       (rmail-get-pop-password): Rename to rmail-get-remote-password.
-       Take an argument specifying whether it is POP or IMAP mailbox we
-       are using.  All callers updated.
-       (rmail-pop-password-error): Rename to
-       rmail-remote-password-error.  Added mailutils-specific error message.
-       (rmail-movemail-search-path)
-       (rmail-movemail-variant-in-use): New variables.
-       (rmail-remote-password, rmail-remote-password-required):
-       New customization variables.
-       (rmail-probe, rmail-autodetect, rmail-movemail-variant-p): New funs.
-       (rmail-parse-url): New function.
-       (rmail-get-new-mail, rmail-insert-inbox-text): Update for use
-       with GNU mailutils movemail.
-
-2005-01-15  Kevin Ryde  <user42@zip.com.au>
-
-       * info-look.el (c-mode/symbol): Add ^` to prefix, and change
-       suffix to space, $ or '$, to correctly position point when going
-       to @table style constants like DBL_MAX.
-
-2005-01-15  Jorgen Schaefer  <forcer@forcix.cx>  (tiny change)
-
-       * type-break.el (type-break-mode, type-break-file-time)
-       (type-break-file-keystroke-count, type-break-choose-file):
-       Don't store data in or load data from the file if type-break-file-name
-       is nil.
-       (type-break-file-name): Doc update as per the above.
-
-2005-01-15  Stephen Eglen  <S.J.Eglen@damtp.cam.ac.uk>  (tiny change)
-
-       * woman.el (woman-dired-define-key-maybe): If KEY is undefined,
-       lookup-key might return nil; handle that.
-
-2005-01-15  Alan Mackenzie  <acm@muc.de>
-
-       * ebrowse.el (ebrowse-class-in-tree): Return the tail of the tree
-       rather than the element found, thus enabling the tree to be setcar'd.
-
-2005-01-14  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/org.el (org-show-following-heading): New option.
-       (org-show-hierarchy-above): Use `org-show-following-heading'.
-       (org-cycle): Documentation fix.
-
-       * textmodes/org.el (orgtbl-optimized): New option
-       (orgtbl-mode): New command, a minor mode.
-       (orgtbl-mode-map): New variable.
-       (turn-on-orgtbl, orgtbl-mode, orgtbl-make-binding)
-       (orgtbl-error, orgtbl-self-insert-command)
-       (orgtbl-delete-backward-char, orgtbl-delete-char): New functions.
-
-       * textmodes/org.el (org-mode): `org-table-may-need-update' is now
-       a local variable in each org-mode buffer.
-
-       * textmodes/org.el (org-set-regexps-and-options): Rename from
-       `org-set-regexps'.  Added checking for STARTUP keyword.
-       (org-get-current-options): Add STARTUP options.
-       (org-table-insert-row): Make mode intelligent about when
-       realignment is needed.
-       (org-self-insert-command, org-delete-backward-char, org-delete-char):
-       New commands.
-       (org-enable-table-editor): New default value `optimized'.
-       (org-table-blank-field): Support blanking regions if active.
-
-2005-01-14  Carsten Dominik  <dominik@science.uva.nl>
-
-       * textmodes/reftex-cite.el (reftex-bib-sort-year): Catch the case
-       if the year is not given.
-
-       * textmodes/reftex-ref.el (reftex-replace-prefix-escapes):
-       Add new escapes %m and %M, fixed bug with %F by adding
-       save-match-data.
-       (reftex-reference): Remove ?. from list of spaces.
-       (reftex-label-info): Add automatic label prefix recognition.
-
-       * textmodes/reftex-index.el (reftex-index-next-phrase):
-       Add slave parameter to call of `reftex-index-this-phrase'.
-       (reftex-index-this-phrase): New optional argument.
-       (reftex-index-region-phrases): Add slave parameter to call of
-       `reftex-index-this-phrase'.
-       (reftex-display-index): New argument redo.
-       (reftex-index-rescan): Add `redo' to arguments of
-       `reftex-display-index'.
-       (reftex-index-Rescan, reftex-index-revert)
-       (reftex-index-switch-index-tag): Add `redo' to arguments of
-       `reftex-display-index'.
-       (reftex-index-make-phrase-regexp): Fix bug with case-sensitive
-       indexing.  Fix bug with matching is there is a quote before or
-       after the word.
-
-       * textmodes/reftex-cite.el (reftex-all-used-citation-keys):
-       Fix bug when collecting citation keys in lines with comments.
-       (reftex-citation): Prefix argument no longer rescans the document,
-       but forces prompting for optional arguments of cite macros.
-       (reftex-do-citation): Prompting for optional arguments implemented.
-
-       * textmodes/reftex-vars.el (reftex-cite-format-builtin):
-       Add optional arguments to most cite commands.
-       (reftex-cite-cleanup-optional-args): New option
-       (reftex-cite-prompt-optional-args): New option.
-       (reftex-trust-label-prefix): New option.
-
-       * textmodes/reftex-toc.el (reftex-toc-find-section):
-       Add push-mark before changing the position in the buffer.
-
-       * textmodes/reftex.el (reftex-prefix-to-typekey-alist): New variable.
-       (reftex-compile-variables): Compute reftex-prefix-to-typekey-alist.
-
-2005-01-14  Nick Roberts  <nickrob@snap.net.nz>
-
-       * xt-mouse.el (xterm-mouse-event): Compute window co-ordinates
-       more carefully.
-
-2005-01-13  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * textmodes/sgml-mode.el (sgml-fill-nobreak): New fun.
-       (sgml-mode): Use it.
-       (sgml-get-context): Better keep track of implicitly closed tags.
-
-2005-01-13  Kenichi Handa  <handa@m17n.org>
-
-       * textmodes/ispell.el: These changes are to fix misalignment error
-       caused by equivalent characters of different Emacs charsets.
-       (ispell-unified-chars-table): New variable.
-       (ispell-get-decoded-string): New function.
-       (ispell-get-casechars, ispell-get-not-casechars)
-       (ispell-get-otherchars): Call ispell-get-decoded-string.
-
-2005-01-12  Johan Bockg\e,Ae\e(Brd  <bojohan@users.sourceforge.net>
-
-       * custom.el (custom-declare-variable): Just put symbol instead
-       of (defvar . symbol) in `current-load-list'.
-
-2005-01-12  Reiner Steib  <Reiner.Steib@gmx.de>
-
-       * emacs-lisp/elint.el: Fixed typo in Commentary section.
-
-2005-01-12  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-help.el (calc-describe-key): Use temporary info buffer
-       to create a Calc summary.
-
-2005-01-12  Kim F. Storm  <storm@cua.dk>
-
-       * mouse.el (mouse-on-link-p): Change functionality and doc
-       string to comply with latest description in lisp ref.
-
-2005-01-12  Nick Roberts  <nickrob@snap.net.nz>
-
-       * xt-mouse.el (xterm-mouse-translate, xterm-mouse-event):
-       Enable mouse clicks on mode-line, header-line and margin.
-       (event-type): Give mouse event symbols an `event-kind' property
-       with value `mouse-click'.
-
-2005-01-12  Juri Linkov  <juri@jurta.org>
-
-       * facemenu.el (list-colors-display): Add new arg buffer-name.
-       Use it.  Fix docstring.  Replace code for identifying duplicate
-       colors by the name with call to `list-colors-duplicates' which
-       identifies duplicate colors by the value unless the color
-       is one of special Windows colors.  Set truncate-lines to t.
-       Print sorted duplicate color names on each line.  Indent to 22
-       \(the longest color name in rgb.txt) instead of 20.  Optimize.
-       (list-colors-duplicates): New function.
-       (facemenu-color-name-equal): Delete function.
-
-       * facemenu.el (list-colors-print): New function created from code
-       in list-colors-display.  Print #RRGGBB at the window right edge.
-       (list-colors-display): When temp-buffer-show-function is not
-       defined, call list-colors-print from temp-buffer-show-hook
-       to get the right value of window-width in list-colors-print
-       after the buffer is displayed.
-
-       * simple.el (pop-mark): Move deactivate-mark out of conditional
-       part to deactivate the active mark regardless of the state of the
-       mark ring.
-
-       * desktop.el (desktop-save): Add `mode: emacs-lisp' to the local
-       variables line in desktop files.
-
-2005-01-12  Juri Linkov  <juri@jurta.org>
-
-       * isearch.el (search-highlight, isearch, isearch-lazy-highlight):
-       Bring together isearch highlight related options.
-       (lazy-highlight): Replace group `replace' by `matching'.
-       (lazy-highlight-cleanup, lazy-highlight-initial-delay)
-       (lazy-highlight-interval, lazy-highlight-max-at-a-time)
-       (lazy-highlight): Add aliases to old names isearch-lazy-highlight-...
-       and declare them obsolete.
-       (lazy-highlight-face): Rename from isearch-lazy-highlight-face.
-       (isearch-faces): Remove defgroup.
-       (isearch-overlay, isearch-highlight, isearch-dehighlight):
-       Move isearch highlighting code closer to lazy highlighting code.
-
-       * replace.el (query-replace-lazy-highlight): Add lazy-highlight group.
-       (query-replace-highlight, query-replace-lazy-highlight)
-       (query-replace): Move definitions to the beginning of the file.
-
-2005-01-11  Juri Linkov  <juri@jurta.org>
-
-       * toolbar/back_arrow.xpm, toolbar/back_arrow.pbm
-       * toolbar/lc-back_arrow.xpm, toolbar/lc-fwd_arrow.xpm
-       * toolbar/fwd_arrow.xpm, toolbar/fwd_arrow.pbm: New icons.
-
-       * info.el (Info-history-forward): New variable.
-       (Info-select-node): Reset Info-history-forward to nil.
-       (Info-last): Turn into defalias.
-       (Info-history-back): Rename from Info-last.
-       Add current node to Info-history-forward.
-       (Info-history-forward): New fun.
-       (Info-mode-map): Replace Info-last by Info-history-back.
-       Bind Info-history-forward to "r".
-       (Info-mode-menu): Replace Info-last by Info-history-back.
-       Fix menu item text.  Add menu item for Info-history-forward.
-       (info-tool-bar-map): Replace Info-last by Info-history-back.
-       Replace its icon "undo" by "back_arrow".  Add icon "fwd_arrow"
-       for Info-history-forward.
-       (Info-mode): Replace Info-last by Info-history-back in docstring.
-       Add local variable Info-history-forward.
-       (Info-goto-emacs-command-node): Replace Info-last by Info-history-back.
-
-2005-01-11  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * mouse.el (mouse-drag-mode-line-1, mouse-drag-vertical-line)
-       (mouse-drag-region, mouse-drag-region-1, mouse-drag-secondary):
-       Ignore select-window events rather than fiddle with
-       mouse-autoselect-window.
-
-2005-01-11  Matthew Mundell  <matt@mundell.ukfsn.org>
-
-       * type-break.el (type-break-mode): Fix previous change.
-
-2005-01-10  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-ext.el (calc-reset): Reset when inside embedded
-       calculator; only reset when point is inside a calculator.
-       Don't adjust the window height if the window takes up the whole height
-       of the frame.
-
-2005-01-10  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * ebuff-menu.el (Electric-buffer-menu-mode):
-       Preserve value of buffer-local var header-line-format.
-
-2005-01-09  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc.el (calc-mode-var-list-restore-saved-values):
-       Make sure settings file exists before accessing it.
-
-       * calc/calc-embed.el (calc-embedded-subst):
-       Replace math-multi-subst-rec, which is only supposed to be called
-       by math-multi-subst, by math-multi-subst.
-
-2005-01-09  Andre Spiegel  <spiegel@gnu.org>
-
-       * vc.el (vc-allow-async-revert): New user option.
-       (vc-disable-async-diff): New internal variable.
-       (vc-revert-buffer): Use them to disable asynchronous diff.
-
-       * vc-cvs.el, vc-arch.el, vc-svn.el, vc-mcvs.el (vc-cvs-diff)
-       (vc-arch-diff, vc-svn-diff, vc-mcvs-diff): Don't diff
-       asynchronously if vc-disable-async-diff is t.
-
-2005-01-09  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc.el (defcalcmodevar): New macro.
-       (calc-mode-var-list-restore-default-values)
-       (calc-mode-var-list-restore-saved-values): New functions.
-       (calc-mode-var-list): Use defcalcmodevar to define it.
-       (calc-always-load-extensions, calc-line-numbering)
-       (calc-line-breaking, calc-display-just, calc-display-origin)
-       (calc-number-radix, calc-leading-zeros, calc-group-digits)
-       (calc-group-char, calc-point-char, calc-frac-format)
-       (calc-prefer-frac, calc-hms-format, calc-date-format)
-       (calc-float-format, calc-full-float-format, calc-complex-format)
-       (calc-complex-mode, calc-infinite-mode, calc-display-strings)
-       (calc-matrix-just, calc-break-vectors, calc-full-vectors)
-       (calc-full-trail-vectors, calc-vector-commas, calc-vector-brackets)
-       (calc-matrix-brackets, calc-language, calc-language-option)
-       (calc-left-label, calc-right-label, calc-word-size)
-       (calc-previous-modulo, calc-simplify-mode, calc-auto-recompute)
-       (calc-display-raw, calc-internal-prec, calc-angle-mode)
-       (calc-algebraic-mode, calc-incomplete-algebraic-mode)
-       (calc-symbolic-mode, calc-matrix-mode, calc-shift-prefix)
-       (calc-window-height, calc-display-trail, calc-show-selections)
-       (calc-use-selections, calc-assoc-selections)
-       (calc-display-working-message, calc-auto-why, calc-timing)
-       (calc-mode-save-mode, calc-standard-date-formats, calc-autorange-units)
-       (calc-was-keypad-mode, calc-full-mode, calc-user-parse-tables)
-       (calc-gnuplot-default-device, calc-gnuplot-default-output)
-       (calc-gnuplot-print-device, calc-gnuplot-print-output)
-       (calc-gnuplot-geometry, calc-graph-default-resolution)
-       (calc-graph-default-resolution-3d, calc-invocation-macro)
-       (calc-show-banner): Use defcalcmodevar to declare them and set
-       their default values.
-
-       * calc/calc-ext.el (calc-reset): Restore saved values of variables
-       instead of default values (but restore default values if there is
-       an argument of 0).
-
-2005-01-09  David Kastrup  <dak@gnu.org>
-
-       * desktop.el (desktop-restore-eager): Fix typo in type.
-
-2005-01-08  Richard M. Stallman  <rms@gnu.org>
-
-       * cus-edit.el (customize): Delete :link.
-
-2005-01-08  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc.el (calc-mode): Remove the extension from the
-       `calc-settings-file' file name when loading it.
-
-2005-01-08  Kim F. Storm  <storm@cua.dk>
-
-       * info.el (Info-mode-map, Info-next-link-keymap)
-       (Info-prev-link-keymap, Info-up-link-keymap):
-       Map follow-link to mouse-face.
-       (Info-fontify-node): Add "mouse-2: " prefix to tooltip.
-
-2005-01-08  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc.el (calc-settings-file): Change default value.
-       Suggested by cgw in a comment in calc-mode.el.
-
-       * calc/calc-mode.el (calc-settings-file-name):
-       Compare calc-settings-file to user-init-file instead of ~/.emacs.
-       Replace ~/.emacs in a prompt by calc-settings-file.
-
-2005-01-07  Lars Hansen  <larsh@math.ku.dk>
-
-       * desktop.el (desktop-restore-eager, desktop-lazy-verbose)
-       (desktop-lazy-idle-delay): New customizable variables.
-       (desktop-buffer-args-list): New variable.
-       (desktop-append-buffer-args): New function.
-       (desktop-save): Call desktop-append-buffer-args for some buffers.
-       (desktop-lazy-create-buffer): New function.
-       (desktop-idle-create-buffers): New function.
-       (desktop-read): Add message about buffers to restore lazily.
-       (desktop-lazy-abort): New command.
-       (desktop-clear): Call desktop-lazy-abort.
-       (desktop-lazy-complete): New command.
-
-2005-01-06  Richard M. Stallman  <rms@gnu.org>
-
-       * emacs-lisp/find-func.el (find-face-definition):
-       Rename from find-face.
-
-2005-01-06  Kim F. Storm  <storm@cua.dk>
-
-       * simple.el (completion-list-mode-map): Map follow-link to mouse-face.
-
-       * man.el (Man-xref-man-page, Man-xref-header-file)
-       (Man-xref-normal-file): Add follow-link property.
-
-2005-01-06  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-units.el: Make sure the proper macro definitions are
-       available when compiling.
-
-2005-01-06  Juri Linkov  <juri@jurta.org>
-
-       * isearch.el (isearch-lazy-highlight-update):
-       Rename `isearch-lazy-highlight-interval' to `lazy-highlight-interval'.
-
-2005-01-06  Miles Bader  <miles@gnu.org>
-
-       * isearch.el (lazy-highlight): Rename from `lazy-highlight-face'.
-       (isearch-lazy-highlight-face): Use new name.
-
-2005-01-05  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * uniquify.el (uniquify-rationalize-file-buffer-names):
-       Re-add an interactive spec.
-       (uniquify-rationalize-file-buffer-names): Fix corner case when renaming
-       to the same name.
-
-       * isearch.el (isearch-dehighlight): Remove unused arg `totally'.
-       (isearch-update, isearch-done): Adjust calls accordingly.
-
-2005-01-05  Richard M. Stallman  <rms@gnu.org>
-
-       * custom.el (custom-set-variables, custom-theme-set-variables):
-       Clarify documentation.
-
-       * emacs-lisp/find-func.el (find-variable)
-       (find-variable-other-window, find-variable-other-frame):
-       Fix the TYPE args to find-function-read and find-function-do-it.
-       (find-function): Doc fix.
-       (find-function-at-point): Replace function-at-point alias.
-
-2005-01-04  Richard M. Stallman  <rms@gnu.org>
-
-       * cus-face.el (custom-declare-face):
-       Record defface in current-load-list.
-
-       * help-fns.el (variable-at-point): New arg ANY-SYMBOL.
-
-       * emacs-lisp/find-func.el: Doc fixes.
-       (find-face-regexp): New variable.
-       (find-function-regexp-alist): New variable.
-       (find-function-C-source): Third arg is now TYPE.
-       (find-function-search-for-symbol): Handle general TYPE.
-       (find-function-read, find-function-do-it): Handle general TYPE.
-       (find-definition-noselect, find-face): New functions.
-       (function-at-point): Alias deleted.
-
-2005-01-04  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * battery.el (display-battery-mode): Rename from display-battery.
-       Handle the case where it gets turned off.
-
-2005-01-04  Richard M. Stallman  <rms@gnu.org>
-
-       * cus-edit.el (customize): Make :link point to user doc.
-
-       * man.el (Man-fontify-manpage): Turn off undo generation.
-
-       * add-log.el (change-log-font-lock-keywords): Don't match just "From".
-
-2005-01-04  Andreas Schwab  <schwab@suse.de>
-
-       * files.el (insert-directory): Only look for error lines in
-       inserted text.  Don't move too far after processing --dired markers.
-
-2005-01-04  Richard M. Stallman  <rms@gnu.org>
-
-       * mail/mailabbrev.el (sendmail-pre-abbrev-expand-hook):
-       Don't expand if the character is @, period, dash, etc.
-       (define-mail-abbrev): Quote names that contain problem characters.
-
-2005-01-04  Thien-Thi Nguyen  <ttn@gnu.org>
-
-       * progmodes/hideshow.el: No longer require `cl'; `dolist' is standard.
-
-2005-01-03  Richard M. Stallman  <rms@gnu.org>
-
-       * replace.el (replace-dehighlight): Use lazy-highlight-cleanup.
-       (query-replace-highlight, query-replace-lazy-highlight)
-       (query-replace): Definitions moved up.  Doc fix.
-
-2005-01-03  Richard M. Stallman  <rms@gnu.org>
-
-       * isearch.el (lazy-highlight): Group renamed from isearch-lazy-...
-       (lazy-highlight-cleanup, lazy-highlight-initial-delay)
-       (lazy-highlight-interval, lazy-highlight-max-at-a-time)
-       (lazy-highlight-face): Rename from isearch-lazy-...
-       Change all references to them.
-
-2005-01-03  Luc Teirlinck  <teirllm@auburn.edu>
-
-       * cus-edit.el (custom-file): Doc fix for defcustom.
-       (custom-file): The function no longer sets the variable
-       `custom-file' to its return value.
-
-       * startup.el (command-line): No longer load `custom-file'.
-
-2005-01-03  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * emacs-lisp/find-func.el (find-variable-regexp): Avoid defface.
-
-       * progmodes/perl-mode.el (perl-nochange, perl-calculate-indent):
-       Don't confuse module-prefixed identifiers for labels.
-       Reported by Juan-Leon Lahoz Garcia <juanleon1@gmail.com>.
-
-2005-01-02  Richard M. Stallman  <rms@gnu.org>
-
-       * files.el (basic-save-buffer-1): Fix previous change.
-
-       * loadhist.el (file-loadhist-lookup): New function.
-       (file-provides, file-requires): Use it.
-
-       * electric.el (Electric-pop-up-window): Use fit-window-to-buffer
-       instead of calculating the right size.
-
-2005-01-02  Karl Chen  <quarl@cs.berkeley.edu>
-
-       * vc-svn.el (vc-svn-diff): Stay local if possible.
-
-2005-01-02  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * vc-arch.el (vc-arch-workfile-version): Handle the empty-branch case.
-
-       * files.el (hack-local-variables): Fix last change.
-
-2005-01-02  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-yank.el (calc-edit-top): New variable.
-       (calc-edit-mode): Set calc-edit-top to be the beginning of the edited
-       object.  Change header properties.
-       (calc-edit-finish, calc-edit-finish-stack-object)
-       (calc-edit-show-buffer): Use calc-edit-top to find the beginning of the
-       edited object.
-       * calc/calc-sel.el (calc-finish-selection-edit): Use calc-edit-top
-       for the beginning of the edited object.
-       * calc/calc-embed.el (calc-embedded-finish-edit): Use calc-edit-top
-       for the beginning of the edited object.
-       * calc/calc-prog.el (calc-edit-macro-finish-edit)
-       (calc-finish-formula-edit, calc-macro-repeats)
-       (calc-edit-macro-adjust-buffer, calc-edit-format-macro-buffer)
-       (calc-edit-macro-pre-finish-edit): Use calc-edit-top for the
-       beginning of the edited object.
-       (calc-user-define-edit): Change the header for editing macros.
-       Remove unnecessary variable.
-
-2005-01-01  Jay Belanger  <belanger@truman.edu>
-
-       * calc/calc-yank.el (calc-edit-mode): Change default header.
-       (calc-edit-finish, calc-show-edit-buffer): Adjust to handle new header.
-       * calc/calc-store.el (calc-edit-variable): Change title to match new
-       header.
-       * calc/calc-prog.el (calc-edit-user-syntax): Change title in edit
-       mode to match new header.
-       (calc-user-define-edit): Change titles to include names of commands.
-       (calc-finish-formula-edit): Adjust to handle new header.
-       (calc-finish-macro-edit): Remove.
-       (calc-edit-macro-repeats, calc-edit-macro-adjust-buffer)
-       (calc-edit-macro-command, calc-edit-macro-command-type)
-       (calc-edit-macro-combine-alg-ent, calc-edit-macro-combine-ext-command)
-       (calc-edit-macro-combine-var-name, calc-edit-macro-combine-digits)
-       (calc-edit-format-macro-buffer, calc-edit-macro-pre-finish-edit)
-       (calc-edit-macro-finish-edit): New functions.
-       (calc-user-define-edit): Use new functions to edit named calc macros.
-
-2005-01-01  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * files.el (hack-local-variables): Cleanup prefix/suffix matching.
-
-       * ses.el (copy-region-as-kill): Deactivate mark.
-
-2005-01-01  Richard M. Stallman  <rms@gnu.org>
-
-       * replace.el (occur-1): If the output buffer is also an input,
-       don't kill it, rename it.
-
-       * faces.el (set-face-background, set-face-foreground): Doc fix.
-
-       * cus-face.el (custom-face-attributes): Fix :help-echo strings
-       for :foreground and :background.
-
-       * dired.el (dired-view-command-alist): Variable deleted.
-       (dired-view-file, dired-mouse-find-file-other-window):
-       Delete the code to use it.
-
-2005-01-01  Kim F. Storm  <storm@cua.dk>
-
-       * image.el (insert-sliced-image): Use t for line-height property.
-
-See ChangeLog.11 for earlier changes.
-
-;; Local Variables:
-;; coding: iso-2022-7bit
-;; add-log-time-zone-rule: t
-;; End:
-
-    Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
-
-  This file is part of GNU Emacs.
-
-  GNU Emacs is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 3, or (at your option)
-  any later version.
-
-  GNU Emacs is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with GNU Emacs; see the file COPYING.  If not, write to the
-  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-  Boston, MA 02110-1301, USA.
-
-;;; arch-tag: e39939be-dab3-400e-86f5-0e2701a883c1
+2007-08-13  Nick Roberts  <nickrob@snap.net.nz>
+
+       * progmodes/gdb-ui.el (gdb-send): Handle CTRL-D more carefully.
+
+2007-08-12  Richard Stallman  <rms@gnu.org>
+
+       * pcvs.el (cvs-reread-cvsrc, cvs-checkout, cvs-mode-checkout)
+       (cvs-execute-single-file): Use new name split-string-and-unquote.
+       (cvs-header-msg): Use new name combine-and-quote-strings.
+
+       * emulation/vi.el (vi-next-line): Ignore return value of line-move.
+
+       * progmodes/gud.el (gud-common-init): Use new name
+       split-string-and-unquote.
+
+       * progmodes/flymake.el (flymake-err-line-patterns): Fix infloop
+       in javac regexp.
+
+       * pcvs-util.el (cvs-qtypedesc-strings): Use new names
+       combine-and-quote-strings and split-string-and-unquote.
+
+       * subr.el (combine-and-quote-strings): Renamed from strings->string.
+       (split-string-and-unquote): Renamed from string->strings.
+
+2007-08-10  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * log-view.el (log-view-font-lock-keywords): Use `eval' so as to adapt
+       to buffer-local settings.
+
+       * emacs-lisp/backquote.el (backquote-delay-process): New function.
+       (backquote-process): Add internal arg `level'.  Use the two to
+       correctly handle nested backquotes.
+
+2007-08-09  Riccardo Murri  <riccardo.murri@gmail.com>
+
+       * vc-bzr.el (vc-bzr-registered): Use \0 instead of literal NULs.
+       (vc-bzr-state-words): Add "kind changed" state word.
+       (vc-bzr-status): New function.  Return Bzr idea of file status,
+       which is different from VC's.
+       (vc-bzr-state): Use vc-bzr-status.
+       (vc-workfile-unchanged-p): Use vc-bzr-status.
+       (vc-bzr-revert): Use synchronous process; expect exitcode 0.
+       (vc-dired-state): Process "kind changed" state word.
+
+2007-08-09  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * vc-hooks.el (vc-default-find-file-not-found-hook): Do nothing.
+
+       * vc-rcs.el (vc-rcs-find-file-not-found-hook):
+       Move from vc-default-find-file-not-found-hook.
+
+2007-08-08  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * man.el: Remove spurious * in docstrings.
+       Merge defvars and toplevel setq-defaults.
+       (Man-highlight-references0): Limit=nil rather than point-max.
+       (Man-mode-map): Move initialization into the declaration.
+       (Man-strip-page-headers, Man-unindent): Use dolist & inhibit-read-only.
+       (Man-view-header-file): Use expand-file-name rather than concat.
+       (Man-notify-when-ready, Man-bgproc-sentinel): Use with-current-buffer.
+
+       * man.el (Man-next-section): Make sure we do not move backward.
+
+2007-08-08  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * files.el (auto-mode-alist): Use the purecopied text (duh!).
+
+2007-08-08  Glenn Morris  <rgm@gnu.org>
+
+       * Replace `iff' in doc-strings and comments.
+
+2007-08-08  Martin Rudalics  <rudalics@gmx.at>
+
+       * dired.el (dired-pop-to-buffer):
+       * mouse-drag.el (mouse-drag-should-do-col-scrolling):
+       * calendar/calendar.el (generate-calendar-window):
+       * progmodes/compile.el (compilation-set-window-height):
+       * textmodes/two-column.el (2C-two-columns, 2C-merge):
+       Use window-full-width-p instead of comparing frame-width and
+       window-width.
+
+       * progmodes/compile.el (compilation-find-buffer): Remove extra
+       argument in call to compilation-buffer-internal-p.
+
+2007-08-07  Tom Tromey  <tromey@redhat.com>
+
+       * progmodes/tcl.el (tcl-indent-level, tcl-continued-indent-level):
+       Add safe-local-variable property.
+
+2007-08-07  Chong Yidong  <cyd@stupidchicken.com>
+
+       * image-mode.el (image-toggle-display): Use image-refresh.
+
+2007-08-07  Riccardo Murri  <riccardo.murri@gmail.com>
+
+       * vc-bzr.el: Remove comments about vc-bzr.el being a modified
+       unofficial version.
+       (vc-bzr-command): Remove redundant setting of process-connection-type.
+       (vc-bzr-admin-checkout-format-file): Add autoload.
+       (vc-bzr-root-dir): Remove in favor of vc-bzr-root.
+       (vc-bzr-root): Switch to implementation of vc-bzr-root-dir.
+       (vc-bzr-registered): Compare dirstate format tag with known good
+       value, abort parsing if match fails.  Warn user in docstring.
+       (vc-bzr-workfile-version): Case for different Bzr branch formats.
+       See bzrlib/branch.py in Bzr sources.
+       (vc-bzr-diff): First argument FILES may be a string rather than a list.
+       (vc-bzr-shell-command): Remove in favor of
+       vc-bzr-command-discarding-stderr.
+       (vc-bzr-command-discarding-stderr): New function.
+
+2007-08-06  Riccardo Murri  <riccardo.murri@gmail.com>
+
+       * vc-bzr.el (vc-bzr-registered): Gracefully handle missing "bzr"
+       program, and return nil
+       (vc-bzr-state): Gracefully handle missing "bzr" program, and return nil.
+       (vc-bzr-state): Look for path names relative to the repository
+       root after status keyword.
+       (vc-bzr-file-name-relative): New function.
+       (vc-bzr-admin-dirname): Reinstate, as other vc-bzr-admin-... paths
+       depend on it.
+       (vc-bzr-admin-dirname, ...-checkout-format-file)
+       (...-branch-format-file, ...-revhistory): Paths to some Bzr internal
+       files that we now parse directly for speed.
+       (vc-bzr-root-dir): Use `vc-bzr-admin-checkout-format-file' as witness.
+       (vc-bzr-registered): Only parse vc-bzr-admin-dirstate file if it exists.
+       (vc-bzr-state): "bzr status" successful only if exitcode is 0
+       (vc-bzr-root): Use `vc-bzr-shell-command'.  Stderr may contain
+       Bzr warnings, so we must discard it.
+       (vc-bzr-workfile-version): Speedup counting lines from
+       `vc-bzr-admin-revhistory' file, but fallback to spawning "bzr revno"
+       if that file doesn't exist.
+       (vc-bzr-responsible-p): Use `vc-bzr-root' instead of
+       `vc-bzr-root-dir' for speed.  Add `vc-bzr-admin-dirname'
+       (not ".bzr"!) to `vc-directory-exclusion-list'
+       (vc-bzr-shell-command): New function.
+
+2007-08-06  Tom Tromey  <tromey@redhat.com>
+
+       * diff-mode.el (diff-unified->context, diff-reverse-direction)
+       (diff-fixup-modifs): Typo in docstring.
+
+2007-08-06  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emulation/tpu-edt.el (tpu-current-line): Use posn-at-point and
+       count-screen-lines.
+       (tpu-edt-off): Disable relevant pieces of advice.
+
+       * emulation/tpu-extras.el (tpu-before-save-hook): Rename from
+       tpu-write-file-hook.  Activate it with add-hook on buffer-save-hook.
+       (newline, newline-and-indent, do-auto-fill): Use advice instead of
+       redefining the function.
+       (tpu-set-scroll-margins): Activate the pieces of advice.
+
+2007-08-06  Martin Rudalics  <rudalics@gmx.at>
+
+       * help.el (resize-temp-buffer-window): Use window-full-width-p
+       instead of comparing frame-width and window-width.
+
+2007-08-13  Stephen Leake  <stephen_leake@stephe-leake.org>
+
+       * pcvs-parse.el (cvs-parse-table): Handle additional instance of
+       optional quotes around files in NEED-UPDATE . REMOVED case.
+
+       * progmodes/ada-xref.el (ada-gnatls-args): Fix docstring.
+       (ada-treat-cmd-string): Improve error message.
+       (ada-do-file-completion): Call `ada-require-project-file', so
+       project variables are set properly.
+       (ada-prj-find-prj-file): Delete Emacs 20.2 support.
+       (ada-gnatfind-buffer-name): New constant.
+       (ada-find-any-references): Use new constant.  Set buffer name
+       properly in compilation-start.  Toggle read-only properly.
+       (ada-find-in-src-path): Fix spelling error in docstring.
+
+       * progmodes/vhdl-mode.el (vhdl-update-progress-info): Avoid divide
+       by zero error.
+
+2007-08-13  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emacs-lisp/autoload.el (autoload-print-form): Use print-quoted.
+
+2007-08-12  Richard Stallman  <rms@gnu.org>
+
+       * progmodes/sh-script.el (sh): Delete group `unix'.
+
+       * progmodes/gud.el (gud): Change to group `processes'.
+
+2007-08-11  Glenn Morris  <rgm@gnu.org>
+
+       * progmodes/compile.el (compilation-buffer-name): Don't check
+       compilation-arguments.  It is superfluous, and the variable isn't
+       even set when this function is called.
+
+2007-08-10  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * term/mac-win.el (mac-ae-reopen-application): New function.
+       (mac-apple-event-map): Bind "reopen application" Apple event to it.
+
+2007-08-10  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * textmodes/tex-mode.el (tex-font-lock-unfontify-region): Fix to
+       take tex-font-script-display into account.
+       (tex-font-script-display, tex-font-lock-suscript): Change from a cons
+       cell to a list of 2 elements to simplify the unfontify code.
+
+2007-08-09  Edward O'Connor  <hober0@gmail.com>  (tiny change)
+
+       * url/url-auth.el (url-basic-auth): When prompting for username
+       and password, default to the username and password in the URL.
+
+2007-08-08  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
+
+       * ps-print.el (ps-default-fg, ps-default-bg): Docstring fix.
+       (ps-begin-job): Use ps-default-fg and ps-default-bg only when
+       ps-print-color-p is neither nil nor black-white.  Reported by Christian
+       Schlauer <cs-muelleimer-rubbish.bin@arcor.de>.
+
+2007-08-08  Andreas Schwab  <schwab@suse.de>
+
+       * mail/mailabbrev.el (sendmail-pre-abbrev-expand-hook): Check for
+       self-insert-command, not self-insert.
+
+2007-08-08  Glenn Morris  <rgm@gnu.org>
+
+       * emacs-lisp/eldoc.el (eldoc-get-fnsym-args-string): Make second
+       argument optional, for backwards compatibility, and only highlight
+       args when present.  Fix symbol name typo (doc/args).
+
+       * help-mode.el (help-make-xrefs): Search for symbol constituents,
+       rather than just `-'.
+
+2007-08-07  Jay Belanger  <jay.p.belanger@gmail.com>
+
+       * calc/calc-units.el (calc-convert-temperature):
+       Use `/' to create fractions.
+
+2007-08-07  Michael Albinus  <michael.albinus@gmx.de>
+
+       * net/tramp.el (tramp-wrong-passwd-regexp): Make the regexp more
+       global matching.
+       (tramp-handle-shell-command): Handle OUTPUT-BUFFER and
+       ERROR-BUFFER more robust.  Display output.
+       (tramp-file-name-handler): Add a connection property when we found
+       a foreign file name handler.  This allows backends like ftp to
+       profit also from usr/host name completion based on connection
+       cache.
+       (tramp-send-command-and-read): Search for trash after the regexp
+       until eol only.  In XEmacs, there is a problem with \n.
+
+       * net/tramp-cache.el (top): Read persistent connection history
+       when cache is empty.
+
+2007-08-07  Nic Ferrier  <nferrier@tapsellferrier.co.uk>  (tiny change)
+
+       * net/tramp.el (tramp-handle-process-file): Fix bug inserting
+       resulting output.
+
+2007-08-07  Sam Steingold  <sds@gnu.org>
+
+       * progmodes/compile.el (compilation-start): Pass nil as startfile
+       to comint-exec.
+
+2007-08-07  Chong Yidong  <cyd@stupidchicken.com>
+
+       * longlines.el (longlines-decoded): New variable.
+       (longlines-mode): Avoid encoding or decoding the buffer twice.
+
+2007-08-07  Martin Rudalics  <rudalics@gmx.at>
+
+       * format.el (format-insert-file): Make sure that at most one undo
+       entry is recorded for the insertion.  Inhibit point-motion and
+       modification hooks around call to insert-file-contents.
+
+2007-08-07  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * vc.el (vc-annotate): Select temp-buffer before running vc-exec-after.
+       Select the buffer's window before moving point.
+
+2007-08-07  Richard Stallman  <rms@gnu.org>
+
+       * term.el (term): Remove parent group `unix'.
+
+       * simple.el (default-indent-new-line): New function.
+       It calls comment-line-break-function if there are comments.
+       (do-auto-fill): Use that.
+
+2007-08-07  Ivan Kanis  <apple@kanis.eu>
+
+       * time.el (display-time-world-mode, display-time-world-display)
+       (display-time-world, display-time-world-list)
+       (display-time-world-time-format, display-time-world-buffer-name)
+       (display-time-world-timer-enable, display-time-world-timer-second)
+       (display-time-world-mode-map): New.
+
+2007-08-07  Sean O'Rourke  <sorourke@cs.ucsd.edu>
+
+       * complete.el (PC-lisp-complete-symbol): Complete symbol around point.
+       (PC-do-completion): Add "acronym completion" for symbols and
+       filenames, so e.g. "mvbl" expands to "make-variable-buffer-local".
+
+2007-08-06  Sam Steingold  <sds@gnu.org>
+
+       * mouse.el (mouse-buffer-menu): Pass mode-name through
+       format-mode-line because it may be a list,
+       e.g., (sgml-xml-mode "XML" "SGML"), and not a string.
+
+2007-08-06  Vinicius Jose Latorre  <viniciusig@ig.com.br>
+
+       * printing.el (pr-update-menus): Docstring fix.
+
+2007-08-06  Jason Rumney  <jasonr@gnu.org>
+
+       * menu-bar.el (menu-bar-vc-filter): Use vc-call-backend.
+
+       * vc-hooks.el (vc-call): Add doc string.
+
+2007-08-06  Michael Albinus  <michael.albinus@gmx.de>
+
+       * net/ange-ftp.el (ange-ftp-hook-function): Catch also errors in
+       process-filter.
+
+2007-08-06  Kenichi Handa  <handa@m17n.org>
+
+       * international/quail.el: Wrap (require 'help-mode) by
+       eval-when-compile.
+       (quail-help-init): New function.
+       (quail-help): Call quail-help-init.
+       (quail-store-decode-map-key): Change it to a function.
+
+2007-08-05  Jason Rumney  <jasonr@gnu.org>
+
+       * vc.el (vc-rollback): Add norevert argument back.
+       (vc-revert-buffer): Add back as obsolete alias.
+
+2007-08-05  Peter Povinec  <ppovinec@yahoo.com>  (tiny change)
+
+       * term.el: Honor term-default-fg-color and term-default-bg-color
+       settings when modifying term-current-face.
+       (term-default-fg-color, term-default-bg-color): Initialize from
+       default term-current-face.
+       (term-mode, term-reset-terminal): Set term-current-face with
+       term-default-fg-color and term-default-bg-color.
+       (term-handle-colors-array): term-current-face has term-default-fg-color
+       and term-default-bg-color after reset escape sequence.
+       (term-handle-colors-array): Set term-current-color with
+       term-default-fg/bg-color instead of ansi-term-color-vector when the
+       index (term-ansi-current-color or term-ansi-current-bg-color) is zero.
+
+2007-08-05  Jay Belanger  <jay.p.belanger@gmail.com>
+
+       * calc/calc-nlfit.el (math-nlfit-curve): Remove unnecessary variables.
+       (math-nlfit-givens): Let bind free variables.
+
+2007-08-05  Vinicius Jose Latorre  <viniciusig@ig.com.br>
+
+       * printing.el: Require lpr and ps-print when loading printing package.
+       Reported by Glenn Morris <rgm@gnu.org>.
+
+2007-08-05  Michael Albinus  <michael.albinus@gmx.de>
+
+       * files.el (set-auto-mode): Handle also remote files wrt
+       `auto-mode-alist'.
+
+2007-08-04  Jay Belanger  <jay.p.belanger@gmail.com>
+
+       * calc/calcalg3.el (calc-curve-fit): Add support for nonlinear
+       curves and plotting.
+
+       * calc/calc-nlfit.el: New file.
+
+2007-08-04  Glenn Morris  <rgm@gnu.org>
+
+       * autorevert.el (auto-revert-tail-mode): auto-revert-tail-pos is
+       zero, not nil, when the library is first loaded.  Check for a file
+       that has been modified on disk.
+
+       * progmodes/cperl-mode.el (cperl-compilation-error-regexp-alist):
+       Remove duplicate defvar preventing initialization.
+       (cperl-mode): Fix compilation-error-regexp-alist-alist setting.
+
+2007-08-03  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * diff-mode.el (diff-font-lock-keywords): Fix up false positives.
+       (diff-beginning-of-file): Adjust to the fact that diff-file-header-re
+       may match up to 4 lines.
+       (diff-beginning-of-file-and-junk): Rewrite.
+
+2007-08-03  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
+
+       * printing.el: Evaluate require only during compilation.
+       (pr-version): New version 6.9.1.
+       (deactivate-mark): Replace (defvar VAR nil) by (defvar VAR).
+       (pr-global-menubar): Fix code.
+
+2007-08-03  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * term.el (term-erase-in-display): Fix case when point is not at
+       the beginning of the line.
+
+2007-08-03  Jay Belanger  <jay.p.belanger@gmail.com>
+
+       * calc/calc-ext.el (math-get-value, math-get-sdev)
+       (math-contains-sdev): New functions.
+
+       * calc/calc-graph.el (calc-graph-format-data)
+       (calc-graph-add-curve): Check for error forms.
+       (calc-graph-set-styles): Add option for error forms.
+
+2007-08-03  Miles Bader  <miles@gnu.org>
+
+       * vc-hooks.el (vc-handled-backends): Change capitalization of VC
+       backend names for new backends to `Git', `Hg', and `Bzr'.
+       * vc-hg.el (vc-hg-dired-state-info): Use `Hg' as VC backend name,
+       not `HG'.
+       * vc-git.el (vc-git-dired-state-info): Use `Git' as VC backend
+       name, not `GIT'.
+       * vc-bzr.el (vc-bzr-dir-state, vc-bzr-dired-state-info)
+       (vc-bzr-unload-hook): Use `Bzr' as VC backend name, not `BZR'.
+
+2007-08-03  Richard Stallman  <rms@gnu.org>
+
+       * mail/rmailsum.el (rmail-make-summary-line): Find end of msg number
+       to update deleted flag.
+
+       * cus-edit.el (customize-apropos, customize-apropos-options)
+       (customize-apropos-faces, customize-apropos-groups): Improve prompt.
+
+       * menu-bar.el (menu-bar-help-menu): Add "About GNU" menu item.
+
+       * startup.el (fancy-splash-head, startup-echo-area-message):
+       Change message text.
+
+       * emulation/tpu-edt.el (next-line-internal): Setting deleted.
+       All callers use line-move.
+
+       * progmodes/compile.el (compilation-find-buffer): Return current
+       buffer immediately if suitable.
+       (compile, compilation-buffer-name, compilation-start): Doc fixes.
+
+2007-08-03  Daiki Ueno  <ueno@unixuser.org>
+
+       * faces.el (face-normalize-spec): New function.
+       (frame-set-background-mode): Normalize face-spec before calling
+       face-spec-match-p.
+
+2007-08-03  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * server.el (server-window): Add switch-to-buffer-other-frame option.
+
+2007-08-03  Glenn Morris  <rgm@gnu.org>
+
+       * cus-edit.el (customize-apropos): Make the error message indicate
+       what kind of thing the user was trying to customize.
+
+       * net/telnet.el (telnet-mode): Set comint-use-prompt-regexp to t.
+
+       * progmodes/fortran.el (fortran-font-lock-syntactic-keywords):
+       Fix off-by-one error in previous change.
+
+2007-08-03  Drew Adams  <drew.adams@oracle.com>
+
+       * emacs-lisp/pp.el (pp-eval-expression): Add progress message.
+       Make buffer writable.
+
+2007-08-01  Jay Belanger  <jay.p.belanger@gmail.com>
+
+       * calc/calc-math.el (math-sqrt-raw, math-sin-raw-2)
+       (math-cos-raw-2, math-arctan-raw, math-ln-raw):
+       Use native Emacs functions, when appropriate.
+
+2007-08-01  Dan Nicolaescu  <dann@ics.uci.edu>
+           Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * vc.el: Document new VC operation `extra-menu'.
+
+       * vc-hooks.el (vc-default-extra-menu): New function.
+
+       * menu-bar.el (menu-bar-vc-filter): New function.
+       (menu-bar-tools-menu): Use it as a filter.
+
+2007-08-01  Eric Hanchrow  <offby1@blarg.net>  (tiny change)
+
+       * ibuf-ext.el (ibuffer-mark-old-buffers): Docstring fix.
+
+2007-08-01  Glenn Morris  <rgm@gnu.org>
+
+       * progmodes/fortran.el: Remove leading `*' from all defcustom doc
+       strings.
+       (fortran-tab-mode-default): Remove needless autoload.
+       (fortran-tab-mode-string): Add help-echo and mouse properties, and
+       mark as risky.
+       (fortran-line-length): New buffer-local variable, safe if integer.
+       (fortran-if-start-re, fortran-end-prog-re1, fortran-end-prog-re):
+       Change from variables to constants.
+       (fortran-font-lock-syntactic-keywords): Delete as a variable,
+       replace with a new function definition.
+       (fortran-mode): Use fortran-line-length, and
+       fortran-font-lock-syntactic-keywords as a function.  Add a
+       hack-local-variables-hook function.
+       (fortran-line-length, fortran-hack-local-variables): New functions.
+       (fortran-window-create, fortran-strip-sequence-nos): Doc fix.
+       Use fortran-line-length rather than 72.
+       (fortran-window-create-momentarily): Doc fix.
+
+2007-07-31  Drew Adams  <drew.adams@oracle.com>  (tiny change)
+
+       * cus-edit.el (custom-group-value-create, custom-goto-parent):
+       Fix parent groups link.
+
+2007-07-31  Paul Pogonyshev  <pogonyshev@gmx.net>
+
+       * progmodes/python.el (python-current-defun): Adjust to never fall
+       into infinite loop.
+
+2007-07-31  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * pcvs.el (cvs-vc-command-advice): Handle the new fileset case.
+
+2007-07-29  Kimit Yada  <kimitto@gmail.com>  (tiny change)
+
+       * emacs-lisp/copyright.el (copyright-update-year, copyright-update)
+       (copyright-fix-years, copyright): Correctly handle the case where
+       copyright-limit is nil.
+
+2007-07-28  Konstantin Novitsky  <knovitsk@Bear.com>  (tiny change)
+
+       * progmodes/python.el (run-python): Fix path separator under w32.
+
+2007-07-30  Richard Stallman  <rms@gnu.org>
+
+       * emacs-lisp/lisp-mode.el (emacs-lisp-mode-syntax-table):
+       Treat non-break space as whitespace in Lisp.
+
+2007-07-30  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * vc.el (vc-dired-hook): Use inhibit-read-only.
+
+       * progmodes/compile.el (compilation-forget-errors):
+       Reset compilation-auto-jump-to-next.
+
+2007-07-30  Michael Olson  <mwolson@gnu.org>
+
+       * cus-edit.el (custom-group-save): Fix void function definition
+       error.  Thanks to Zhang Wei for the report.
+
+       * ps-print.el: Check in trivial changes to the autoloads section
+       caused by the build process.  These autoloads really ought to be
+       placed in a separate file, methinks.
+
+2007-07-29  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * calendar/calendar.el (calendar-mode): Make sure
+       displayed-(month|year) are set.
+       (calendar-basic-setup): Display buffer before adjusting window sizes.
+       (generate-calendar-window): Use inhibit-read-only.  Simplify.
+       Generate buffer and set displayed-month and displayed-year before
+       calling update-calendar-mode-line.
+
+2007-07-29  Michael Albinus  <michael.albinus@gmx.de>
+
+       * net/tramp.el:
+       * net/tramp-uu.el:
+       * net/trampver.el: Use utf-8 encoding with coding cookie.
+
+       * net/tramp-cache.el:
+       * net/tramp-fish.el:
+       * net/tramp-ftp.el:
+       * net/tramp-gw.el:
+       * net/tramp-smb.el: Remove coding cookie.
+
+       * net/tramp.el (tramp-handle-verify-visited-file-modtime):
+       Flush buffer file-name's file property.
+       (tramp-handle-file-remote-p): The first parameter is FILENAME.
+
+       * net/trampver.el: Update release number.
+
+2007-07-29  Juri Linkov  <juri@jurta.org>
+
+       * dired.el (dired-mode-map): Bind C-x C-q to dired-toggle-read-only.
+       Filter out menu item "Edit File Names" `wdired-change-to-wdired-mode'
+       when major-mode is not dired-mode.
+       (dired-toggle-read-only): New function.
+       (dired-recursive-deletes): Remove obsolete comments about old
+       default value.
+       (dired-do-flagged-delete, dired-do-delete): Refill docstring.
+
+       * wdired.el (wdired-exit): New function.
+       (wdired-mode-map): Bind C-x C-q to wdired-exit.
+
+2007-07-28  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * cus-edit.el (customize-read-group): New fun.
+       (customize-group-other-window, customize-face-other-window):
+       Prompt before delegating to customize-(group|face).
+       Bind pop-up-windows rather than use the other-window argument.
+       (customize-group, customize-face): Prompt from the interactive spec.
+       Remove args `prompt-for-group' and `other-window'.
+
+       * emacs-lisp/advice.el (ad-interactive-form): Re-introduce.
+       (ad-body-forms, ad-advised-interactive-form): Revert this part of
+       last change.
+
+2007-07-28  Masatake YAMATO  <jet@gyve.org>
+
+       * vc.el (vc-dired-mode): Add a menu for VC related operation.
+       Use backend name as the menu label Suggested by David Kastrup.
+
+2007-07-28  Alan Mackenzie  <acm@muc.de>
+
+       Fix problem with modes derived from CC Mode:
+       * progmodes/cc-mode.el (c-make-emacs-variables-local): Move this
+       macro to cc-langs.
+       (c-init-language-vars-for): Remove call to above macro.
+       * progmodes/cc-langs.el (c-make-emacs-variables-local): Macro has
+       been moved to here.
+       (c-make-init-lang-vars-fun): Call c-make-emacs-variables-local.
+
+2007-07-28  Eli Zaretskii  <eliz@gnu.org>
+
+       * net/trampver.el: Fix the `coding' cookie.
+
+2007-07-28  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * vc-git.el (vc-git-print-log): Support both the old single file
+       interface and the new one.
+
+2007-07-28  Nick Roberts  <nickrob@snap.net.nz>
+
+       * bindings.el (mode-line-remote): Use updated %@ construct.
+
+2007-07-27  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * calendar/cal-bahai.el (calendar-bahai-month-name-array)
+       (calendar-bahai-epoch, calendar-bahai-leap-year-p)
+       (calendar-bahai-leap-base, calendar-bahai-prompt-for-date)
+       (diary-list-bahai-entries, diary-bahai-mark-entries)
+       (calendar-bahai-mark-date-pattern, diary-insert-bahai-entry)
+       (diary-bahai-insert-monthly-entry, diary-bahai-insert-yearly-entry):
+       New names to clean up namespace.
+       (list-bahai-diary-entries, mark-bahai-diary-entries)
+       (insert-bahai-diary-entry, insert-monthly-bahai-diary-entry)
+       (insert-yearly-bahai-diary-entry, mark-bahai-calendar-date-pattern):
+       Add compatibility aliases.
+
+       * calendar/appt.el: Don't wrap defvar within eval-when-compile.
+
+       * calendar/cal-move.el (calendar-scroll-left, calendar-scroll-right)
+       (calendar-scroll-left-three-months)
+       (calendar-scroll-right-three-months): Clean up namespace.
+       (scroll-calendar-left, scroll-calendar-right)
+       (scroll-calendar-left-three-months)
+       (scroll-calendar-right-three-months): Add compatibility aliases.
+
+       * calendar/cal-move.el (calendar-scroll-left, calendar-scroll-right):
+       Behave like mouse-scroll-calendar-* when used from the mouse.
+
+       * calendar/cal-menu.el (cal-menu-scroll-menu)
+       (cal-menu-global-mouse-menu):
+       * calendar/calendar.el (calendar-mode-map):
+       Use new calendar-scroll-* names.
+       (mouse-scroll-calendar-left, mouse-scroll-calendar-right):
+       Remove.  Use calendar-scroll-* directly instead.
+
+2007-07-26  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emacs-lisp/advice.el (ad-interactive-p, ad-interactive-form): Remove.
+       (ad-body-forms, ad-advised-interactive-form, ad-make-cache-id)
+       (ad-make-advised-definition, ad-cache-id-verification-code):
+       Use commandp and interactive-form instead.
+
+2007-07-26  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * vc-git.el: Relicense to GPLv3 or later.
+       (vc-directory-exclusion-list, vc-handled-backends): Remove.
+
+       * vc-hooks.el (vc-handled-backends): Add GIT.
+
+       * vc.el (vc-directory-exclusion-list): Add .git.
+
+2007-07-26  Alexandre Julliard  <julliard@winehq.org>
+
+       * vc-git.el (vc-git-revision-table)
+       (vc-git-revision-completion-table): New functions.
+
+2007-07-26  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
+
+       * progmodes/ebnf-abn.el (ebnf-abn-skip-comment):
+       * progmodes/ebnf-bnf.el (ebnf-bnf-skip-comment):
+       * progmodes/ebnf-dtd.el (ebnf-dtd-skip-comment):
+       * progmodes/ebnf-ebx.el (ebnf-ebx-skip-comment):
+       * progmodes/ebnf-iso.el (ebnf-iso-skip-comment):
+       * progmodes/ebnf-yac.el (ebnf-yac-skip-comment): New version.
+       New command actions for EPS header and EPS footer.
+
+       * progmodes/ebnf2ps.el: New command actions for EPS header and EPS
+       footer.  Fix some problems with one-or-more, zero-or-more and
+       alternative constructions generation.  Some log messages
+       implementation.  Doc fix.
+       (ebnf-version): New version 4.4.
+       (ebnf-eps-header-font, ebnf-eps-header, ebnf-eps-footer-font)
+       (ebnf-eps-footer, ebnf-log): New options.
+       (ebnf-find-style, ebnf-eps-header-footer, ebnf-eps-header)
+       (ebnf-eps-footer, ebnf-eps-string, ebnf-eps-header-footer-comment)
+       (ebnf-eps-header-footer-p, ebnf-eps-header-comment)
+       (ebnf-eps-footer-comment, ebnf-eps-header-footer-file)
+       (ebnf-eps-header-footer-set, ebnf-log-header, ebnf-log): New funs.
+       (ebnf-style-custom-list, ebnf-style-database): Put new values.
+       (ebnf-print-directory, ebnf-print-file, ebnf-print-buffer)
+       (ebnf-print-region, ebnf-spool-directory, ebnf-spool-file)
+       (ebnf-spool-buffer, ebnf-spool-region, ebnf-eps-directory)
+       (ebnf-eps-file, ebnf-eps-buffer, ebnf-eps-region)
+       (ebnf-syntax-directory, ebnf-syntax-file, ebnf-syntax-buffer)
+       (ebnf-syntax-region, ebnf-parse-and-sort, ebnf-begin-job)
+       (ebnf-dimensions, ebnf-production-dimension, ebnf-terminal-dimension)
+       (ebnf-non-terminal-dimension, ebnf-special-dimension)
+       (ebnf-terminal-dimension1, ebnf-repeat-dimension)
+       (ebnf-except-dimension, ebnf-alternative-dimension)
+       (ebnf-optional-dimension, ebnf-one-or-more-dimension)
+       (ebnf-zero-or-more-dimension, ebnf-sequence-dimension): Insert log
+       message fun.
+       (ebnf-setup, ebnf-generate-one-or-more, ebnf-generate-zero-or-more)
+       (ebnf-begin-job, ebnf-begin-file, ebnf-eps-finish-and-write)
+       (ebnf-insert-ebnf-prologue, ebnf-production-dimension)
+       (ebnf-terminal-dimension1, ebnf-alternative-dimension)
+       (ebnf-one-or-more-dimension, ebnf-zero-or-more-dimension)
+       (ebnf-eps-add-context, ebnf-eps-add-production): Fix code.
+       (ebnf-eps-filename, ebnf-trim-right): Replace `?\s' by `?\ ' to keep
+       compatibility with Emacs 20 & 21.
+       (ebnf-eps-header-comment, ebnf-eps-footer-comment)
+       (ebnf-eps-file-alist, ebnf-basic-width-extra)
+       (ebnf-basic-empty-height): New vars.
+       (ebnf-prologue): Fix PostScript code.
+       (ebnf-make-empty, ebnf-make-terminal1, ebnf-make-or-more1)
+       (ebnf-make-production, ebnf-make-alternative, ebnf-make-optional)
+       (ebnf-make-except, ebnf-make-repeat, ebnf-make-sequence)
+       (ebnf-make-dup-sequence, ebnf-token-alternative): Add comments.
+
+2007-07-25  Glenn Morris  <rgm@gnu.org>
+
+       * Relicense all FSF files to GPLv3 or later.
+
+       * COPYING: Switch to GPLv3.
+
+2007-07-25  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * pcvs.el (cvs-temp-buffer): Undo last ill-conceived change.
+       Replace it with another one which disables undo before calling
+       erase-buffer and then turns it back on if needed.
+
+2007-07-24  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
+
+       * ps-print.el: Problem with foreground and background color when
+       printing a buffer with and without faces.  Reported by Christian
+       Schlauer <cs-muelleimer-rubbish.bin@arcor.de>.
+       (ps-print-version): New version 6.7.5.
+       (ps-default-fg): Change default value to nil, so black color is used
+       when a face does not specify a foreground color.
+       (ps-default-bg): Change default value to nil, so white color is used
+       for background color.
+       (ps-begin-job): Fix code.
+
+2007-07-24  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * vc-hg.el (vc-hg-revision-completion-table): Temporarily comment out.
+
+2007-07-24  Glenn Morris  <rgm@gnu.org>
+
+       * calendar/cal-tex.el (cal-tex-holidays, cal-tex-diary)
+       (cal-tex-rules, cal-tex-buffer, cal-tex-24)
+       (cal-tex-cursor-month-landscape, cal-tex-cursor-month)
+       (cal-tex-cursor-week, cal-tex-cursor-week2)
+       (cal-tex-cursor-week-iso, cal-tex-week-hours)
+       (cal-tex-cursor-week-monday, cal-tex-weekly4-box)
+       (cal-tex-cursor-filofax-2week, cal-tex-cursor-filofax-week)
+       (cal-tex-cursor-filofax-daily, cal-tex-daily-page): Doc fix.
+
+2007-07-25  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * calendar/calendar.el (calendar-mode-map): Move initialization
+       into declaration.  Add menu bindings (used to be done in cal-menu).
+       (calendar-mode): Don't add an activate-menubar-hook.
+
+       * calendar/cal-menu.el: Break dependency on calendar.el (i.e. do not
+       modify calendar-mode-map), use easy-menu, and make sure that C-h k
+       can be used on the menu entries.
+       (cal-menu-holiday-window-suffix, cal-menu-set-date-title): New funs.
+       (cal-menu-moon-menu, cal-menu-diary-menu, cal-menu-holidays-menu)
+       (cal-menu-goto-menu, cal-menu-scroll-menu): New consts.
+       (cal-menu-context-mouse-menu, cal-menu-global-mouse-menu): New menus.
+       (calendar-flatten, cal-menu-update): Remove.
+       (calendar-mouse-insert-hebrew-diary-entry)
+       (calendar-mouse-insert-islamic-diary-entry)
+       (calendar-mouse-insert-bahai-diary-entry):
+       Remove (fold into cal-menu-diary-menu).
+       (calendar-mouse-2-date-menu, calendar-mouse-cal-tex-menu)
+       (cal-tex-mouse-filofax): Remove (fold into cal-menu-context-mouse-menu).
+       (calendar-mouse-3-map): Remove (turn into cal-menu-global-mouse-menu).
+       (calendar-mouse-view-diary-entries): Minor simplifications.
+       (calendar-event-to-date): Use with-current-buffer.
+
+2007-07-25  Nick Roberts  <nickrob@snap.net.nz>
+
+       * add-log.el (change-log-redate): Remove (not needed anymore and
+       doesn't appear to work).
+
+2007-07-25  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * frame.el: Use mapc and dolist instead of mapcar where possible.
+       (close-display-connection): New command.
+
+2007-07-25  Alexandre Julliard  <julliard@winehq.org>
+
+       * vc-git.el (vc-git-log-view-mode): Port to the multi-file vc interface.
+       (vc-git-create-snapshot, vc-git-retrieve-snapshot): New functions.
+
+2007-07-25  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
+
+       * ps-print.el (ps-multibyte-buffer): Docstring fix.
+
+       * ps-mule.el: Doc fix.
+       (ps-multibyte-buffer, ps-mule-font-info-database-default)
+       (ps-mule-external-libraries, ps-mule-begin-job): Docstring fix.
+
+2007-07-25  Glenn Morris  <rgm@gnu.org>
+
+       * calendar/cal-tex.el (cal-tex-which-days, cal-tex-holidays)
+       (cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
+       (cal-tex-daily-end, cal-tex-hook)
+       (cal-tex-cal-one-month, cal-tex-cal-multi-month)
+       (cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
+       (cal-tex-cursor-week-iso, cal-tex-week-hours)
+       (cal-tex-cursor-week-monday, cal-tex-weekly4-box)
+       (cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
+       (cal-tex-day-prefix, cal-tex-day-name-format)
+       (cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
+       (cal-tex-caldate, cal-tex-LaTeX-hourbox)
+       (cal-tex-LaTeX-subst-list): Change from variables to constants.
+       (cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
+       (cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
+       etc, rather than \bf.
+       (cal-tex-mini-calendar): Fix typos in previous change.
+       (cal-tex-latexify-list): Remove inner let binding.
+       (cal-tex-end-document, cal-tex-banner): Use multi-line
+       cal-tex-comment.
+       (cal-tex-comment): Handle embedded newlines.
+       (cal-tex-LaTeXify-string): Use substring-no-properties.
+
+2007-07-25  Joakim Verona  <joakim@verona.se>  (tiny change)
+
+       * progmodes/compile.el (compilation-error-regexp-alist-alist):
+       Add support for the Maden build tool.
+
+2007-07-25  William Xu  <william.xwl@gmail.com>  (tiny change)
+
+       * net/webjump.el (webjump-url-encode): Fix for non-ASCII characters.
+
+2007-07-24  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * pcvs.el (cvs-temp-buffer): Disable undo in temp buffers.
+
+2007-07-24  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * dired.el (dired-mode-map): Bind wdired-change-to-wdired-mode to
+       C-x C-q.
+
+       * vc-git.el (vc-git-print-log): Fix previous change.
+
+2007-07-24  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * window.el (save-selected-window): Minor optimization.
+       (bw-adjust-window): If operation failed, try with a smaller delta.
+       (window-fixed-size-p): New function.
+       (window-area-factor): New var.
+       (balance-windows-area): New command.
+
+       * ps-mule.el (ps-multibyte-buffer): Docstring fixes.
+       (ps-mule-encode-ethiopic): Make it clear that it's always defined.
+       (ps-mule-prepare-font-for-components, ps-mule-encode-header-string)
+       (ps-mule-encode-bit, ps-mule-encode-ucs2): Use dotimes.
+       (ps-mule-begin-job): Use dolist.
+
+2007-07-24  Michael Albinus  <michael.albinus@gmx.de>
+
+       * subr.el (start-file-process-shell-command)
+       (process-file-shell-command): New defuns.
+
+       * progmodes/compile.el (compilation-start):
+       Apply `start-file-process-shell-command'.
+
+2007-07-24  Alexandre Julliard  <julliard@winehq.org>
+
+       * vc-git.el (vc-git-checkout, vc-directory-exclusion-list): Fix typos.
+
+2007-07-24  Alan Mackenzie  <acm@muc.de>
+
+       * emacs-lisp/bytecomp.el (byte-compile-from-buffer):
+       Initialise byte-compile-unresolved-functions before rather than
+       after a compilation.
+       (byte-compile-unresolved-functions): Amplify doc string.
+
+2007-07-24  Glenn Morris  <rgm@gnu.org>
+
+       * startup.el (normal-splash-screen): Use `emacs-copyright'.
+
+       * calendar/cal-tex.el (cal-tex-holidays, cal-tex-diary)
+       (cal-tex-rules, cal-tex-buffer, cal-tex-24)
+       (cal-tex-cursor-month-landscape, cal-tex-cursor-month)
+       (cal-tex-cursor-week, cal-tex-cursor-week2)
+       (cal-tex-cursor-week-iso, cal-tex-week-hours)
+       (cal-tex-cursor-week-monday, cal-tex-weekly4-box)
+       (cal-tex-cursor-filofax-2week, cal-tex-cursor-filofax-week)
+       (cal-tex-cursor-filofax-daily, cal-tex-daily-page): Doc fix.
+
+       * calendar/cal-tex.el: Remove leading `*' from defcustom docs.
+       (cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
+       (cal-tex-day-name-format, cal-tex-cal-one-month)
+       (cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
+       (cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
+       (cal-tex-mini-calendar, cal-tex-em): Doc fix.
+       (cal-tex-list-holidays, cal-tex-cursor-year)
+       (cal-tex-cursor-year-landscape, cal-tex-year)
+       (cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
+       (cal-tex-cursor-month, cal-tex-insert-days)
+       (cal-tex-insert-day-names, cal-tex-insert-blank-days)
+       (cal-tex-first-blank-p, cal-tex-cursor-week)
+       (cal-tex-cursor-week2, cal-tex-cursor-week-iso)
+       (cal-tex-week-hours, cal-tex-cursor-week-monday)
+       (cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
+       (cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
+       (cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
+       (cal-tex-latexify-list, cal-tex-previous-month)
+       (cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
+       modernization, including using dotimes rather than
+       calendar-for-loop.
+       (cal-tex-LaTeX-subst-list): Remove `@'.
+       (cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf):
+       Use \textit and \textbf rather than \em and \it.
+
+       * calendar/cal-bahai.el (list-bahai-diary-entries)
+       * calendar/cal-hebrew.el (list-hebrew-diary-entries)
+       * calendar/cal-islam.el (list-islamic-diary-entries)
+       * calendar/calendar.el (generate-calendar, generate-calendar-month)
+       * calendar/diary-lib.el (diary-list-entries)
+       (mark-calendar-date-pattern): Use `dotimes' rather than
+       `calendar-for-loop'.
+
+       * calendar/calendar.el (calendar-for-loop): Doc fix.
+
+2007-07-23  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * ses.el (ses-cleanup): Prevent Emacs from spuriously checking if the
+       underlying file is uptodate.
+
+2007-07-23   Christopher J. Madsen  <cjm@cjmweb.net>
+
+       * replace.el (perform-replace): Use isearch-no-upper-case-p.
+
+2007-07-23  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * vc-hooks.el (vc-mode-line-map): New const.
+       (vc-mode-line): Use it.
+
+2007-07-23  Alexandre Julliard  <julliard@winehq.org>
+
+       * vc-git.el (vc-git-delete-file, vc-git-rename-file)
+       (vc-git-unregister): New functions.
+       (vc-git-find-version): Use the result of ls-files as a parameter
+       for cat-file.
+
+2007-07-23  Michael Albinus  <michael.albinus@gmx.de>
+
+       * net/tramp.el (tramp-perl-file-attributes)
+       (tramp-perl-directory-files-and-attributes)
+       (tramp-handle-file-attributes-with-stat)
+       (tramp-handle-directory-files-and-attributes-with-stat)
+       (tramp-convert-file-attributes): Handle huge file sizes.
+
+2007-07-23  Juri Linkov  <juri@jurta.org>
+
+       * isearch.el (isearch-message-function): New variable.
+       (isearch-update, isearch-search): Use it.
+
+       * simple.el (goto-history-element): New function created from
+       next-history-element.
+       (next-history-element): Most code moved to goto-history-element.
+       Call goto-history-element with (- minibuffer-history-position n).
+       (previous-history-element): Call goto-history-element with (+
+       minibuffer-history-position n).
+       (minibuffer-setup-hook): Add minibuffer-history-isearch-setup.
+       (minibuffer-history-isearch-message-overlay): New buffer-local variable.
+       (minibuffer-history-isearch-setup, minibuffer-history-isearch-end)
+       (minibuffer-history-isearch-search, minibuffer-history-isearch-message)
+       (minibuffer-history-isearch-wrap, minibuffer-history-isearch-push-state)
+       (minibuffer-history-isearch-pop-state): New functions.
+
+2007-07-23  Thien-Thi Nguyen  <ttn@gnuvola.org>
+
+       * vc-hooks.el (vc-stay-local-p): Fix bug: Avoid remove-if-not.
+       Also, if FILE is a list, return non-nil if any of its elements
+       should stay local.  Update docstring.
+
+2007-07-23  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emacs-lisp/copyright.el (copyright-update-year): Fix 2007-05-25
+       change by reverting a small part.
+
+2007-07-23  Richard Stallman  <rms@gnu.org>
+
+       * progmodes/octave-inf.el (inferior-octave-prompt): Accept .exe.
+
+2007-07-23  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * vc-git.el (vc-git-checkin): Delete unused parameter and the code
+       handling it.  Use vc-git-command.
+       (vc-git-find-version, vc-git-diff-tree): New functions.
+       (vc-git-revert): Use vc-git-command.
+       (vc-git--run-command): Delete.
+
+2007-07-23  Alexandre Julliard  <julliard@winehq.org>
+
+       * vc-git.el (vc-git-workfile-unchanged-p): Update comment.
+
+2007-07-20  Kenichi Handa  <handa@m17n.org>
+
+       * international/utf-8.el (utf-8-post-read-conversion):
+       Temporarily bind utf-8-compose-scripts to nil while running
+       *-compose-region functions.
+
+2007-07-23  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * vc-git.el: Update status.
+       (vc-directory-exclusion-list): Use eval-after-load.
+
+2007-07-22  Nick Roberts  <nickrob@snap.net.nz>
+
+       * bindings.el (mode-line-remote): New variable.
+       (help-echo): Add to default values of mode-line-format.
+
+       * files.el: Mark mode-line-remote as risky.
+
+2007-07-22  Juri Linkov  <juri@jurta.org>
+
+       * isearch.el (isearch-edit-string): Save old point and
+       isearch-other-end to old-point and old-other-end before reading
+       the search string from minibuffer.  After exiting minibuffer set
+       point to old-other-end if point and the search direction is the
+       same as before reading the search string.
+       (isearch-del-char): Don't set isearch-yank-flag to t.  Put point
+       to isearch-other-end.  Instead of isearch-search-and-update call
+       three functions isearch-search, isearch-push-state and isearch-update.
+
+2007-07-22  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * vc-git.el (vc-git-register, vc-git-checkin): Use vc-git-command,
+       deal with multiple file arguments.
+       (vc-git-print-log): Deal with multiple file arguments.
+
+2007-07-22  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * diff-mode.el (diff-refine-ignore-spaces-hunk): Rename from
+       diff-refine-hunk.  Adjust users.
+       (diff-unified-hunk-p, diff-splittable-p): New functions.
+       (diff-mode-menu): Use it to disable Split when it doesn't work.
+
+2007-07-22  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * diff-mode.el (diff-mode-menu): New entries.
+
+2007-07-22  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * diff-mode.el (diff-unified->context): Use the new `apply' undo entry
+       if applicable, so as to save undo-log space.
+
+       * diff-mode.el (diff-find-file-name): Add arg `batch'.
+
+       * diff-mode.el (diff-beginning-of-file-and-junk): New function.
+       (diff-file-kill): Use it.
+       (diff-beginning-of-hunk): Add arg `try-harder' using it.
+       (diff-restrict-view, diff-find-source-location, diff-refine-hunk):
+       Use it so they find the hunk even when we're in the file header.
+
+2007-07-22  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * vc-git.el (vc-git-revision-granularity, vc-git-root)
+       (vc-git-command, vc-git-dir-state, vc-git-dired-state-info)
+       (vc-git-create-repo): New functions.
+       (vc-git-registered): New autoloaded function definition.
+       (vc-git-registered): Use vc-git-root.
+       (vc-git-responsible-p): New defalias.
+       (vc-git-annotate-extract-revision-at-line): Uncomment.
+       (vc-git-print-log): Add the file name to the log.
+       (vc-git-log-view-mode): New derived mode.
+       (vc-git-diff, vc-git-annotate-command): Use vc-git-command.
+
+2007-07-22  Michael Albinus  <michael.albinus@gmx.de>
+
+       * progmodes/grep.el (grep-compute-defaults): Keep default values.
+
+2007-07-22  Ralf Angeli  <angeli@caeruleus.net>
+
+       * textmodes/reftex.el (reftex-access-parse-file): Create parse
+       file in a way that does not interfere with recentf mode.
+       (reftex-access-parse-file): Do not risk destroying an existing
+       buffer.
+
+2007-07-22  Alexandre Julliard  <julliard@winehq.org>
+
+       * vc-git.el: New file.
+
+2007-07-22  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * textmodes/tex-mode.el (tex-font-script-display): Change default.
+
+2007-07-22  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * vc-cvs.el (vc-cvs-mode-line-string): Add support for tooltips
+       for branches and new files.
+
+       * vc-hooks.el (vc-default-mode-line-string): Move mouse-face and
+       local-map handling ...
+       (vc-mode-line): ... here.  Improve handling of help-echo.
+
+       * vc.el (mode-line-string): Document help-echo usage.
+
+2007-07-22  Michael Albinus  <michael.albinus@gmx.de>
+
+       Sync with Tramp 2.1.10.
+
+       * net/tramp.el (tramp-get-ls-command): Fyx typo.
+
+       * net/trampver.el: Update release number.
+
+2007-07-22  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * startup.el (command-line-x-option-alist): Use x-handle-no-bitmap-icon.
+
+       * term/x-win.el (x-handle-no-bitmap-icon): New function.
+
+2007-07-22  Martin Rudalics  <rudalics@gmx.at>
+
+       * add-log.el (change-log-fill-parenthesized-list): New function.
+       (change-log-indent): Call change-log-fill-parenthesized-list.
+       (change-log-fill-paragraph): Bind fill-indent-according-to-mode to t.
+       Have lines with leading asterisk start a paragraph.
+
+2007-07-21  Jay Belanger  <jay.p.belanger@gmail.com>
+
+       * calc/calc-math.el (math-emacs-precision)
+       (math-largest-emacs-expt, math-smallest-emacs-expt):
+       New variables.
+       (math-use-emacs-fn): New function.
+       (math-exp-raw): Evaluate with `math-use-emacs-fn', when
+       appropriate.
+
+2007-07-21  Thien-Thi Nguyen  <ttn@gnuvola.org>
+
+       * image-dired.el (image-dired-sane-db-file): New func.
+       (image-dired-write-tags, image-dired-remove-tag)
+       (image-dired-list-tags, image-dired-write-comments)
+       (image-dired-get-comment, image-dired-mark-tagged-files)
+       (image-dired-create-gallery-lists): Call new func.
+       Reported by Dieter Wilhelm <dieter@duenenhof-wilhelm.de>.
+
+2007-07-21  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * vc-hg.el (vc-hg-dir-state): Fix loop.
+       (vc-hg-print-log): Fix expected return value for vc-hg-command.
+       (vc-hg-next-version, vc-hg-delete-file, vc-hg-rename-file)
+       (vc-hg-register, vc-hg-create-repo, vc-hg-checkin)
+       (vc-hg-revert): Likewise.
+       (vc-hg-revision-table, vc-hg-revision-completion-table): New
+       functions.
+
+2007-07-20  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * add-log.el (change-log-resolve-conflict): Don't lose data if the
+       merge fails.
+
+2007-07-20  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * progmodes/compile.el (compilation-auto-jump-to-first-error):
+       Add group and version.
+
+2007-07-20  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * add-log.el (add-log-file-name): Use file-relative-name.
+       (add-change-log-entry): Delay reading
+       add-log-(full-name|mailing-address) to after we've switched to the
+       ChangeLog buffer so we get the right value.
+       (add-change-log-entry, add-log-current-defun, change-log-merge):
+       Use derived-mode-p rather than checking major-mode directly.
+
+       * pcvs.el (cvs-mode-add-change-log-entry-other-window): Use a directory
+       name for buffer-file-name if it refers to a directory.
+
+       * vc-arch.el (vc-arch-diff): Fix last change.
+
+       * progmodes/compile.el (compilation-start): Remember the original
+       directory in a buffer-local compilation-directory.
+       (compile): Set the global value of compilation-directory.
+       (recompile): Use compilation-directory even in the compilation buffer.
+
+2007-07-20  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * vc-hg.el (vc-hg-diff): Use vc-hg-command.
+
+2007-07-20  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
+
+       * ps-print.el: Problem with foreground and background color when
+       printing a buffer with and without faces.  Reported by Christian
+       Schlauer <cs-muelleimer-rubbish.bin@arcor.de>.
+       (ps-print-version): New version 6.7.5.
+       (ps-default-fg): Change default value to nil, so black color is used
+       when a face does not specify a foreground color.
+       (ps-default-bg): Change default value to nil, so white color is used
+       for background color.
+       (ps-begin-job): Fix code.
+
+2007-07-20  Eli Zaretskii  <eliz@gnu.org>
+
+       * makefile.w32-in (install-lisp-SH): Don't create subdirectories
+       in $(INSTALL_DIR)/lisp/ if they already exist.
+
+2007-07-20  Dhruva Krishnamurthy  <dhruvakm@gmail.com>  (tiny change)
+
+       * makefile.w32-in (install-lisp-CMD): Don't create subdirectories
+       in $(INSTALL_DIR)/lisp/ if they already exist.
+
+2007-07-20  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * progmodes/vera-mode.el (vera-re-search-forward)
+       (vera-re-search-backward): Remove use of store-match-data.
+       (vera-mode-map): Move initialization into declaration.
+
+       * progmodes/flymake.el (flymake-buildfile-dirs): Remove.
+       (flymake-find-buildfile): Use locate-dominating-file.
+
+       * vc.el (vc-delistify): Use mapconcat.
+       (vc-do-command): Minor simplification.
+       (vc-expand-dirs): Use push.
+
+       * vc-mcvs.el (vc-mcvs-create-repo):
+       * vc-cvs.el (vc-cvs-create-repo): Remove.
+
+       * vc-hooks.el (vc-find-root): Fix case where `file' is the current
+       directory and the root as well.
+
+2007-07-20  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * vc-hooks.el (vc-default-workfile-unchanged-p): Pass a list
+       instead of a file.
+
+       * vc-hg.el (vc-hg-print-log): Deal with multiple file arguments.
+       (vc-hg-registered): Replace if with when.
+       (vc-hg-state): Deal with nonexistent files and handle removed files.
+       (vc-hg-dir-state, vc-hg-dired-state-info): New functions.
+       (vc-hg-checkout): Re-enable.
+       (vc-hg-create-repo): Fix typos.
+       (vc-hg-print-log): Fix for multiple files.
+       (vc-hg-workfile-unchanged-p): New function.
+
+       * vc.el: Fix typo.
+       (vc-print-log): Fix call to print-log.
+       (vc-default-comment-history): Likewise.
+       (vc-directory-exclusion-list): Add .hg and .bzr.
+       (vc-diff-internal): Pass a list instead of a file.
+
+       * vc-mcvs.el (vc-mcvs-create-repo): Fix typos.
+
+       * vc-bzr.el (vc-bzr-create-repo): New function.
+
+2007-07-19  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * vc-hooks.el (vc-find-root): Walk up the tree to find an existing
+       `file' from which to start the search.
+
+2007-07-19  Eric S. Raymond  <esr@snark.thyrsus.com>
+
+       * vc-cvs.el: vc-cvs-checkin had some reference problems, now fixed.
+
+2007-07-19  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * files.el (locate-dominating-file): New function.
+
+2007-07-18  Michael Albinus  <michael.albinus@gmx.de>
+
+       * progmodes/grep.el (grep-host-defaults-alist): New defvar.
+       (grep-compute-defaults): Use it.
+
+2007-07-18  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * uniquify.el: Docstring fixes.
+
+2007-07-18  Eric S. Raymond  <esr@snark.thyrsus.com>
+
+       * vc-hooks.el: Generalize stay-local-p to operate on lists of
+       files.  Change two keybindings to point to new function names.
+       * vc-arch.el, vc-bzr.el, vc-cvs.el, vc-hg.el, vc-mcvs.el, vc-rcs.el,
+       vc-sccs.el, vc-svn.el: These now implement the NewVC-fileset.
+       * vc.el: Adapted for NewVC-fileset, but no functional changes yet.
+
+2007-07-18  Juanma Barranquero  <lekktu@gmail.com>
+
+       * follow.el (follow-mode-hook, follow-mode-off-hook, follow-mode)
+       (follow-delete-other-windows-and-split, follow-recenter)
+       (follow-windows-aligned-p, follow-point-visible-all-windows-p)
+       (follow-redisplay, follow-estimate-first-window-start)
+       (follow-xemacs-scrollbar-support, follow-intercept-process-output):
+       Fix typos in docstrings.
+
+2007-07-18  Martin Rudalics  <rudalics@gmx.at>
+
+       * add-log.el (change-log-mode): Use fill-nobreak-predicate to
+       avoid that filling introduces lines with a single asterisk.
+
+       * kmacro.el (kmacro-end-macro): When ignoring empty macro
+       avoid incorrect kmacro-ring-empty-p messages.
+       Reported by Michael Schierl <schierlm@gmx.de>.
+
+2007-07-17  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * vc.el: Add more info about the vc-registered function.
+
+2007-07-17  Michael Albinus  <michael.albinus@gmx.de>
+
+       * files.el (file-remote-p): Introduce optional parameter
+       IDENTIFICATION.
+
+       * recentf.el (recentf-keep-default-predicate): Adapt call of
+       `file-remote-p'.
+
+       * progmodes/grep.el (grep-probe): Use `process-file'.
+       (grep-compute-defaults): Handle variables host specific.
+
+       * net/ange-ftp.el (ange-ftp-file-remote-p): Handle optional
+       parameter IDENTIFICATION.
+
+       * net/tramp.el (tramp-handle-file-remote-p): Handle optional
+       parameter IDENTIFICATION.
+       (tramp-handle-set-file-times): New defun.  Replaces `tramp-touch'.
+       (tramp-file-name-handler-alist, tramp-file-name-for-operation):
+       Add entry for `set-file-times'.
+       (tramp-do-copy-or-rename-file-via-buffer)
+       (tramp-do-copy-or-rename-file-out-of-band): Use `set-file-times'.
+       (tramp-handle-unhandled-file-name-directory): Rewrite.
+       (tramp-convert-file-attributes): Add error handling when inode is
+       extraordinary big.
+       (tramp-get-inode): Change parameter from FILE to VEC.
+       (tramp-handle-start-file-process): Use (current-buffer) if BUFFER
+       is nil.  This is according to the specification.  Goto (point-max)
+       when ready.
+       (tramp-handle-shell-command): Rewrite completely, using
+       `process-file' and `start-file-process'.
+       (tramp-methods, tramp-find-shell)
+       (tramp-open-connection-setup-interactive-shell)
+       (tramp-maybe-open-connection): Guard against $PROMPT_COMMAND shell
+       var.  Reported by Steve Youngs <steve@sxemacs.org>.
+
+       * net/tramp-fish.el (tramp-fish-file-name-handler-alist): Add
+       entry for `set-file-times'.  Rename `start-process' into
+       `start-file-process'.  Remove `call-process' entry.
+       (tramp-fish-handle-set-file-times): New defun.
+       (tramp-fish-handle-executable-find): Use `process-file'.
+       (tramp-fish-handle-process-file): New defun.  Replaces
+       `tramp-fish-handle-call-process'.
+       (tramp-fish-do-copy-or-rename-file-directly): Use
+       `set-file-times'.
+       (tramp-fish-get-file-entries): Change `tramp-get-inode' parameter.
+
+       * net/tramp-smb.el (tramp-smb-handle-file-attributes): Change
+       `tramp-get-inode' parameter.
+
+2007-07-17  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * vc-bzr.el (vc-bzr-version, vc-bzr-at-least-version)
+       (vc-bzr-post-command-function): Remove.  Version 0.8 is already old
+       nowadays, and by the time Emacs-23 comes out, nobody will even remember
+       it has ever existed.
+
+2007-07-17  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * vc.el: Undo previous change.
+
+2007-07-16  Eli Zaretskii  <eliz@gnu.org>
+
+       * makefile.w32-in (clean): Don't delete *~.
+
+2007-07-16  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * textmodes/tex-mode.el (tex-verbatim-environments):
+       Add safe-local-variable property.
+       (tex-font-lock-syntactic-keywords): Lookup tex-verbatim-environments
+       when starting font-lock rather than when loading tex-mode.el.
+
+       * progmodes/sh-script.el (sh-font-lock-quoted-subshell): Skip over the
+       whole $( rather than just the $.  Rename from sh-quoted-subshell.
+       (sh-font-lock-syntactic-keywords): Adjust call accordingly.
+
+2007-07-16  Thien-Thi Nguyen  <ttn@gnuvola.org>
+
+       * bookmark.el (bookmark-maybe-sort-alist): Don't modify
+       bookmark-alist.  Instead, if not sorting, simply return it.
+       (bookmark-bmenu-list): Call bookmark-maybe-sort-alist
+       for its return value, not for its side effect.
+
+       * emacs-lisp/lisp-mode.el (calculate-lisp-indent): In the
+       case of alignment under a constant symbol, find and consider
+       the sexp actually at indentation to be the "last sexp".
+
+2007-07-16  Drew Adams  <drew.adams@oracle.com>
+
+       * mouse.el (mouse-yank-secondary): Better error message if no
+       secondary selection.
+
+2007-07-16  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * vc-hooks.el (vc-handled-backends): Move BZR later in the list.
+
+       * term/xterm.el (xterm-turn-on-modify-other-keys)
+       (xterm-turn-off-modify-other-keys): New functions.
+       (terminal-init-xterm): Enable the modifyOtherKeys feature if the
+       terminal supports it.
+
+2007-07-16  Thien-Thi Nguyen  <ttn@gnuvola.org>
+
+       * bookmark.el (bookmark-show-all-annotations):
+       Make sure each inserted annotation ends with newline.
+
+2007-07-15  Richard Stallman  <rms@gnu.org>
+
+       * kmacro.el (kmacro-bind-to-key): Avoid comparisons on function keys.
+
+       * tutorial.el (tutorial--find-changed-keys):
+       Handle C-x specially like ESC.
+
+2007-07-15  Aaron Hawley  <aaronh@garden.org>
+
+       * tar-mode.el (tar-get-descriptor): No error for zero-length file.
+
+2007-07-15  Juri Linkov  <juri@jurta.org>
+
+       * delsel.el (delete-selection-pre-hook):
+       * emulation/cua-base.el (cua-paste): Before a yank command,
+       check also whether last-command is one of mouse-save-then-kill,
+       mouse-secondary-save-then-kill, mouse-set-region, mouse-drag-region.
+
+2007-07-15  Michael Albinus  <michael.albinus@gmx.de>
+
+       * recentf.el (recentf-keep-default-predicate): New defun.
+       (recentf-keep): Use it as initial value.
+
+2007-07-15  Karl Fogel  <kfogel@red-bean.com>
+
+       * bookmark.el: Revert 2007-07-13T18:16:17Z!kfogel@red-bean.com,
+       thus restoring bookmark bindings to three slots under C-x r.  See
+       http://lists.gnu.org/archive/html/emacs-devel/2007-07/msg00705.html.
+
+2007-07-15  Jeff Miller  <jmiller@cablespeed.com>  (tiny change)
+
+       * calendar/calendar.el (calendar-goto-bahai-date): Autoload it.
+
+2007-07-15  Jason Rumney  <jasonr@gnu.org>
+
+       * w32-fns.el (set-default-process-coding-system): Use dos line ends
+       for input to cmdproxy on all versions of Windows.
+       Use dos line ends for input to plink.
+
+       * comint.el (comint-simple-send): Concat newline before sending.
+       (comint-password-prompt-regexp): Recognize plink's passphrase prompt.
+
+2007-07-14  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emacs-lisp/autoload.el (generated-autoload-file): Autoload the
+       safe-local-variable setting.
+
+2007-07-14  David Kastrup  <dak@gnu.org>
+
+       * emacs-lisp/advice.el (defadvice): Doc fix.
+
+2007-07-14  Juanma Barranquero  <lekktu@gmail.com>
+
+       * subr.el (when, unless): Doc fix.
+
+2007-07-13  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * replace.el (match): Use yellow1 instead of yellow.
+
+       * progmodes/gdb-ui.el (breakpoint-enabled): Use red1 instead of red.
+
+       * pcvs-info.el (cvs-unknown): Likewise.
+
+2007-07-13  Eli Zaretskii  <eliz@gnu.org>
+
+       * makefile.w32-in (install-lisp-SH, install-lisp-CMD): New targets.
+       (install): Use them to copy all *.el files before *.elc.
+
+2007-07-13  Drew Adams  <drew.adams@oracle.com>
+
+       * bookmark.el (bookmark-jump-other-window): New function.
+       (bookmark-map): Bind it to "o".
+
+       http://lists.gnu.org/archive/html/emacs-devel/2007-07/msg00633.html
+       and its thread contains discussion about this change.
+       The original patch was slightly tweaked by Karl Fogel
+       <kfogel@red-bean.com> before committing.
+
+2007-07-13  Karl Fogel  <kfogel@red-bean.com>
+
+       * bookmark.el: Shorten some comments to fit within 80 lines.
+
+2007-07-13  Karl Fogel  <kfogel@red-bean.com>
+
+       * bookmark.el: Don't define bookmark keys under the "C-xr" map;
+       instead, make "C-xp" a prefix for bookmark-map.  Patch by Drew
+       Adams <drew.adams@oracle.com>, mildly tweaked by me.  See
+       http://lists.gnu.org/archive/html/emacs-devel/2007-07/msg00633.html.
+
+2007-07-13  Carsten Dominik  <dominik@science.uva.nl>
+
+       * textmodes/org.el: Bug fixes.
+       (org-end-of-line): Move to end of line if in headline without tags.
+
+2007-07-13  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * vc-hooks.el: Remove spurious * in docstrings.
+       (vc-handled-backends): Add BZR.
+
+       * vc-hooks.el (vc-find-file-hook): Use with-demoted-errors.
+
+2007-07-12  Davis Herring  <herring@lanl.gov>
+
+       * desktop.el (desktop-buffer-info, desktop-save):
+       Use `desktop-dirname' instead of `dirname'.
+
+2007-07-12  Paul Pogonyshev  <pogonyshev@gmx.net>
+
+       * progmodes/which-func.el (which-func-modes): Add `python-mode'.
+
+       * progmodes/python.el (python-which-func-length-limit): New var.
+       (python-which-func): New function.
+       (python-current-defun): Add optional `length-limit' and try to fit
+       computed function name to that length.
+       (python-mode): Hook `python-which-func' up.
+
+2007-07-12  Sean O'Rourke  <sorourke@cs.ucsd.edu>  (tiny change)
+
+       * pcomplete.el (pcomplete-entries): Obey pcomplete-ignore-case.
+
+       * comint.el (comint-dynamic-complete-as-filename):
+       Use read-file-name-completion-ignore-case.
+
+2007-07-12  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * comint.el (comint-dynamic-list-filename-completions):
+       Use read-file-name-completion-ignore-case.
+
+       * vc-cvs.el: Require CL.
+       (vc-cvs-revision-table, vc-cvs-revision-completion-table):
+       New functions to provide completion of revision names.
+
+       * vc-cvs.el (vc-functions): Clear up the cache when reloading the file.
+       (vc-cvs-annotate-first-line-re): New const.
+       (vc-cvs-annotate-process-filter): New fun.
+       (vc-cvs-annotate-command): Use them and run the command asynchronously.
+
+2007-07-12  Paul Pogonyshev  <pogonyshev@gmx.net>
+
+       * emacs-lisp/eldoc.el (eldoc-last-data): Revise documentation.
+       (eldoc-print-current-symbol-info): Adjust for changed helper
+       function signatures.
+       (eldoc-get-fnsym-args-string): Add `args' argument.  Use new
+       `eldoc-highlight-function-argument'.
+       (eldoc-highlight-function-argument): New function.
+       (eldoc-get-var-docstring): Format documentation with
+       `font-lock-variable-name-face'.
+       (eldoc-docstring-format-sym-doc): Add `face' argument and apply it
+       where suited.
+       (eldoc-fnsym-in-current-sexp): Return a list with argument index.
+       (eldoc-beginning-of-sexp): Return number of skipped sexps.
+
+2007-07-11  Michael Albinus  <michael.albinus@gmx.de>
+
+       * progmodes/compile.el (compilation-start): `start-process' must
+       still be redefined when calling `start-process-shell-command'.
+
+       * progmodes/gud.el (gud-file-name): When `default-directory' is a
+       remote file name, prepend its remote part to the filename.
+       (gud-common-init): When `default-directory' is a remote file name,
+       make the filename relative to it.
+       Based on a patch by Nick Roberts <nickrob@snap.net.nz>.
+
+2007-07-11  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * vc-hooks.el (vc-default-mode-line-string): Add a mouse face,
+       mouse binding and a tooltip.
+
+2007-07-11  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * menu-bar.el (vc-menu-map): New defalias.
+
+2007-07-10  Richard Stallman  <rms@gnu.org>
+
+       * emacs-lisp/lisp-mode.el (eval-defun):
+       Explain special handling of `defface'.
+
+2007-07-10  Jim Meyering  <jim@meyering.net>  (tiny change)
+
+       * emacs-lisp/copyright.el (copyright-current-gpl-version): Set to 3.
+
+       * autoinsert.el (auto-insert-alist): s/2/3/ in the generated comment.
+
+2007-07-10  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emacs-lisp/cl.el: Load cl-loaddefs.el quietly.
+
+       * vc-arch.el (vc-arch-complete): Remove.
+       (vc-arch-revision-completion-table): Use complete-with-action.
+
+       * subr.el (condition-case-no-debug, with-demoted-errors): New macros.
+       (complete-with-action): New function.
+       (dynamic-completion-table): Use it.
+
+2007-07-10  Michael Albinus  <michael.albinus@gmx.de>
+
+       * comint.el (make-comint, make-comint-in-buffer)
+       (comint-exec-1): Replace `start-process' by `start-file-process'.
+
+       * progmodes/compile.el (compilation-start): Revert redefining
+       `start-process'.
+
+2007-07-10  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emacs-lisp/autoload.el (autoload-generate-file-autoloads): Be careful
+       with EOLs when generating MD5 checksums.
+
+       * follow.el: Don't change the global map from the follow-mode-map
+       defvar, but from the toplevel.  Use easy-menu to unify the Emacs and
+       XEmacs code.
+       (turn-on-follow-mode, turn-off-follow-mode): Remove interactive spec
+       since `follow-mode' should be used instead for that.
+
+       * emacs-lisp/easymenu.el (easy-menu-binding): New function.
+       (easy-menu-do-define): Use it.
+       (easy-menu-do-add-item): Inline into easy-menu-add-item and then remove.
+
+       * progmodes/compile.el (compilation-auto-jump-to-first-error)
+       (compilation-auto-jump-to-next): New vars.
+       (compilation-auto-jump): New function.
+       (compilation-error-properties): Use them to jump to first error.
+       (compilation-start): Set the var if requested.
+
+       * emacs-lisp/autoload.el (update-directory-autoloads): Remove
+       duplicates without also removing entries from other directories.
+
+2007-07-10  Carsten Dominik  <dominik@science.uva.nl>
+
+       * textmodes/org.el (org-agenda-day-view, org-agenda-week-view):
+       Remember span as default.
+       (org-columns-edit-value): Rename from `org-column-edit'.
+       (org-columns-display-here-title): Rename from
+       `org-overlay-columns-title'.
+       (org-columns-remove-overlays): Rename from org-remove-column-overlays.
+       (org-columns-get-autowidth-alist): Rename from
+       `org-get-columns-autowidth-alist'.
+       (org-columns-display-here): Rename from `org-overlay-columns'.
+       (org-columns-new-overlay): Rename from `org-new-column-overlay'.
+       (org-columns-quit): Rename from `org-column-quit'.
+       (org-columns-show-value): Rename from `org-column-show-value'.
+       (org-columns-content, org-columns-widen)
+       (org-columns-next-allowed-value)
+       (org-columns-edit-allowed, org-columns-store-format)
+       (org-columns-uncompile-format, org-columns-redo)
+       (org-columns-edit-attributes, org-delete-property)
+       (org-set-property, org-columns-update)
+       (org-columns-compute, org-columns-eval)
+       (org-columns-not-in-agenda, org-columns-compute-all)
+       (org-property-next-allowed-value)
+       (org-columns-compile-format)
+       (org-fill-paragraph-experimental)
+       (org-string-to-number, org-property-action)
+       (org-columns-move-left, org-columns-new)
+       (org-column-number-to-string)
+       (org-property-previous-allowed-value)
+       (org-at-property-p, org-columns-delete)
+       (org-columns-previous-allowed-value)
+       (org-columns-move-right, org-columns-narrow)
+       (org-property-get-allowed-values)
+       (org-verify-version, org-column-string-to-number)
+       (org-delete-property-globally): New functions.
+       (org-columns-current-fmt): Rename from `org-current-columns-fmt'.
+       (org-columns-overlays): Rename from `org-column-overlays'.
+       (org-columns-map): Rename from `org-column-map'.
+       (org-columns-current-maxwidths): Rename from
+       `org-current-columns-maxwidths'.
+       (org-columns-begin-marker, org-columns-current-fmt-compiled)
+       (org-previous-header-line-format)
+       (org-columns-inhibit-recalculation)
+       (org-columns-top-level-marker): New variables.
+       (org-columns-default-format): Rename from `org-default-columns-format'.
+       (org-property-re): New constant.
+
+2007-07-10  Guanpeng Xu  <herberteuler@hotmail.com>
+
+       * subr.el (looking-at-p, string-match-p): New functions.
+
+2007-07-09  Reiner Steib  <Reiner.Steib@gmx.de>
+
+       * textmodes/tex-mode.el (tex-fontify-script)
+       (tex-font-script-display): New variables to make display of
+       superscripts and subscripts customizable.
+       (tex-font-lock-suscript, tex-font-lock-match-suscript): Use them.
+
+2007-07-09  Richard Stallman  <rms@gnu.org>
+
+       * isearch.el (isearch-edit-string): Call to isearch-push-state
+       after the search.
+
+2007-07-09  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * window.el (fit-window-to-buffer): Remove setting of window-min-height
+       to 1 as enlarge-window uses the value to resize/shrink windows other
+       than WINDOW if needed.
+
+2007-07-08  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * cus-start.el (file-coding-system-alist): Fix custom type.
+
+2007-07-08  Chong Yidong  <cyd@stupidchicken.com>
+
+       * longlines.el (longlines-wrap-region): Avoid marking buffer as
+       modified.
+       (longlines-auto-wrap, longlines-window-change-function):
+       Remove unnecessary calls to set-buffer-modified-p.
+
+2007-07-08  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * cus-start.el (file-coding-system-alist): Fix custom type.
+
+2007-07-08  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * vc-cvs.el (vc-cvs-revert): Use vc-default-revert.
+       (vc-cvs-checkout): Remove last arg now unused; simplify.
+
+2007-07-08  Michael Albinus  <michael.albinus@gmx.de>
+
+       * files.el (file-remote-p): Introduce optional parameter CONNECTED.
+
+       * net/tramp.el:
+       * net/tramp-ftp.el:
+       * net/tramp-smb.el:
+       * net/tramp-uu.el:
+       * net/trampver.el: Migrate to Tramp 2.1.
+
+       * net/tramp-cache.el:
+       * net/tramp-fish.el:
+       * net/tramp-gw.el: New Tramp packages.
+
+       * net/tramp-util.el:
+       * net/tramp-vc.el: Removed.
+
+       * net/ange-ftp.el: Add ange-ftp property to 'start-file-process
+       (ange-ftp-file-remote-p): Handle optional parameter CONNECTED.
+
+       * net/rcompile.el (remote-compile): Handle Tramp 2.1 arguments.
+
+       * progmodes/compile.el (compilation-start): Redefine
+       `start-process' temporarily when `default-directory' is remote.
+       Remove case of synchronous compilation, this won't happen ever.
+       (compilation-setup): Make local variable `comint-file-name-prefix'
+       for remote compilation.
+
+2007-07-08  Martin Rudalics  <rudalics@gmx.at>
+
+       * novice.el (disabled-command-function): Fit window to buffer to
+       make last line visible.
+       Reported by Stephen Berman <Stephen.Berman at gmx.net>.
+
+       * mouse.el (mouse-drag-track): Reset transient-mark-mode to nil
+       when handling the terminating event.
+
+2007-07-07  Jay Belanger  <jay.p.belanger@gmail.com>
+
+       * calc/calc.el (math-read-number-simple): Remove leading 0s.
+       (math-bignum-digit-length): Change to optimal value.
+
+       * calc/calc-bin.el (math-bignum-logb-digit-size)
+       (math-bignum-digit-power-of-two): Evaluate when compiled.
+
+       * calc/calc-comb.el (math-small-factorial-table)
+       (math-init-random-base, math-prime-test): Remove unnecessary calls
+       to `math-read-number-simple'.
+
+       * calc/calc-ext.el (math-approx-pi, math-approx-sqrt-e)
+       (math-approx-gamma-const): Add docstrings.
+
+       * calc/calc-forms.el (math-julian-date-beginning)
+       (math-julian-date-beginning-int): New constants.
+       (math-format-date-part, math-parse-standard-date, calcFunc-julian):
+       Use the new constants.
+
+       * calc/calc-funcs.el (math-gammap1-raw): Add docstring.
+
+       * calc/calc-math.el (math-approx-ln-10, math-approx-ln-2):
+       Add docstrings.
+
+2007-07-07  Tom Tromey  <tromey@redhat.com>
+
+       * vc.el (vc-annotate): Jump to line and output message only after the
+       process is really all done.
+
+2007-07-07  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * vc.el (vc-exec-after): Don't move point from the sentinel.
+       Forcefully read all the remaining text in the pipe upon process exit.
+       (vc-annotate-display-autoscale, vc-annotate-lines):
+       Don't stop at the first unrecognized line.
+       (vc-annotate-display-select): Run autoscale after the process is done
+       since it depends on the whole result.
+
+2007-07-07  Eli Zaretskii  <eliz@gnu.org>
+
+       * term/w32-win.el (menu-bar-open): New function.
+       Bind <f10> to it.
+
+2007-07-07  Michael Albinus  <michael.albinus@gmx.de>
+
+       * simple.el (start-file-process): New defun.
+
+2007-07-07  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * files.el (find-file-confirm-nonexistent-file): Rename from
+       find-file-confirm-inexistent-file.  Update users.
+
+       * emacs-lisp/autoload.el (autoload-find-destination): Understand a new
+       format of autoload block where the file's time-stamp is replaced by its
+       MD5 checksum.
+       (autoload-generate-file-autoloads): Use MD5 checksum instead of
+       time-stamp for secondary autoloads files.
+       (update-directory-autoloads): Remove duplicate entries.
+       Use time-less-p for time-stamps, as done in autoload-find-destination.
+
+2007-07-07  Jay Belanger  <jay.p.belanger@gmail.com>
+
+       * calc/calc.el (math-read-number): Replace number by variable.
+       (math-read-number-simple): Properly parse small integers.
+
+2007-07-07  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * vc.el: Fix doc for the checkout function.
+
+2007-07-06  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * vc-hg.el (vc-hg-root): New function.
+       (vc-hg-registered): Use it.
+       (vc-hg-diff-tree): New defalias.
+       (vc-hg-responsible-p): Likewise.
+       (vc-hg-checkout): Comment out, not needed.
+       (vc-hg-delete-file, vc-hg-rename-file, vc-hg-could-register)
+       (vc-hg-find-version, vc-hg-next-version): New functions.
+
+2007-07-06  Andreas Schwab  <schwab@suse.de>
+
+       * emacs-lisp/lisp-mode.el (eval-last-sexp): Avoid introducing any
+       dynamic bindings around the evaluation of the expression.
+       Reported by Jay Belanger <jay.p.belanger@gmail.com>.
+
+2007-07-06  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * autorevert.el (auto-revert-tail-handler): Use inhibit-read-only.
+       Run before-revert-hook.  Suggested by Denis Bueno <denbuen@sandia.gov>.
+       Use run-hooks rather than run-mode-hooks.
+
+2007-07-05  Jay Belanger  <jay.p.belanger@gmail.com>
+
+       * calc/calc-comb.el (math-random-digit): Rename to
+       `math-random-three-digit-number'.
+       (math-random-digits): Don't depend on representation of integer.
+
+       * calc/calc-bin.el (math-bignum-logb-digit-size)
+       (math-bignum-digit-power-of-two): New constants.
+       (math-and-bignum, math-or-bignum, math-xor-bignum, math-diff-bignum)
+       (math-not-bignum, math-clip-bignum): Use the constants
+       `math-bignum-digit-power-of-two' and `math-bignum-logb-digit-size'
+       instead of their values.
+       (math-clip): Use math-small-integer-size instead of its value.
+
+       * calc/calc.el (math-add-bignum): Replace number by constant.
+
+2007-07-05  Chong Yidong  <cyd@stupidchicken.com>
+
+       * wid-edit.el (widget-documentation-string-value-create):
+       Insert indentation spaces.
+
+2007-07-05  Thien-Thi Nguyen  <ttn@gnuvola.org>
+
+       * emacs-lisp/byte-opt.el: Revert last change.
+
+2007-07-05  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * vc-hooks.el (vc-handled-backends): Add HG.
+
+       * vc-hg.el (vc-handled-backends): Remove, done in vc-hooks.el now.
+
+2007-07-05  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * complete.el (PC-do-complete-and-exit): Add support for the new
+       `confirm-only' confirmation mode.
+
+2007-07-05  Chong Yidong  <cyd@stupidchicken.com>
+
+       * cus-edit.el (custom-commands): New variable.
+       (custom-tool-bar-map): New variable.  Initialize using
+       `custom-commands'.
+       (custom-mode): Use `custom-tool-bar-map'.
+       (custom-buffer-create-internal): Insert action buttons only if
+       tool bar is not used.  Use `custom-commands'.
+       (Custom-help, custom-command-apply): New function.
+       (custom-command-apply, Custom-set, Custom-save)
+       (Custom-reset-current, Custom-reset-saved, Custom-reset-standard):
+       Use `custom-command-apply' instead of duplicating code.
+       (customize-group-other-window): Call `customize-group' instead of
+       duplicating code.
+       (customize-face-other-window): Call `customize-face' instead of
+       duplicating code.
+       (customize-group, customize-face): Add optional args for opening
+       in another window.
+       (custom-variable-tag): Don't inherit `variable-pitch' face.
+       (custom-group-tag): Inherit `variable-pitch' face.
+       (custom-variable-value-create): Set documentation indentation.
+       (custom-group-value-create): Make group name a link, instead of
+       using an extra "go to group" button.
+       (custom-prompt-variable, custom-group-set, custom-group-save)
+       (custom-group-reset-current, custom-group-reset-saved)
+       (custom-group-reset-standard): Minor cleanup.
+
+2007-07-05  Thien-Thi Nguyen  <ttn@gnuvola.org>
+
+       * Makefile.in (bootstrap-prepare): When copying from
+       ldefs-boot.el, make sure loaddefs.el is writeable.
+
+       (bootstrap-prepare): Make $(lisp)/ps-print.el
+       and $(lisp)/emacs-lisp/cl-loaddefs.el writable, as well.
+
+2007-07-05  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * vc-hg.el (vc-hg-internal-status): Inline in `vc-hg-state', the
+       only caller, and delete.
+       (vc-hg-state): Deal with exceptions and only parse the output on
+       successful return.
+       (vc-hg-internal-log): Inline in `vc-hg-workfile-version', the only
+       caller, and delete.
+       (vc-hg-workfile-version): Deal with exceptions and only parse the
+       output on successful return.
+       (vc-hg-revert): New function.
+
+2007-07-04  Jay Belanger  <jay.p.belanger@gmail.com>
+
+       * calculator.el (calculator-expt): Use more cases to determine
+       the value.
+
+2007-07-03  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * progmodes/gud.el (auto-mode-alist): Match more valid gdb init
+       file names.
+
+2007-07-03  Jay Belanger  <jay.p.belanger@gmail.com>
+
+       * calculator.el (calculator-expt, calculator-integer-p):
+       New functions.
+       (calculator-fact): Check to see if the factorial will be too
+       large before computing it.
+       (calculator-initial-operators): Use `calculator-expt' to
+       compute "^".
+       (calculator-mode): Mention that results which are too large
+       will return inf.
+       * calc/calc-comb.el (math-small-factorial-table): Replace list
+       by vector.
+
+2007-07-03  David Kastrup  <dak@gnu.org>
+
+       * shell.el: On request of the authors, remove their addresses for
+       the sake of bug reports, and add the developer list address as
+       maintainer information.
+
+2007-07-03  Richard Stallman  <rms@gnu.org>
+
+       * files.el (make-directory): Doc fix.
+       (find-file-confirm-inexistent-file): Make it a defcustom.
+       Make nil the default.
+
+2007-07-02  Richard Stallman  <rms@gnu.org>
+
+       * startup.el (command-line): Set buffer-offer-save in *scratch*
+       and enable auto-save in it.
+
+2007-07-02  Carsten Dominik  <dominik@science.uva.nl>
+
+       * textmodes/org.el (orgstruct-mode-map): New variable.
+       (orgstruct-mode): New minor mode.
+       (turn-on-orgstruct, orgstruct-error, orgstruct-setup)
+       (orgstruct-make-binding, org-context-p, org-get-local-variables)
+       (org-run-like-in-org-mode): New functions.
+       (org-cycle-list-bullet): New command.
+       (org-special-properties, org-property-start-re)
+       (org-property-end-re): New constants.
+       (org-with-point-at): New macro.
+       (org-get-property-block, org-entry-properties, org-entry-get)
+       (org-entry-delete, org-entry-get-with-inheritance)
+       (org-entry-put, org-buffer-property-keys): New functions.
+       (org-insert-property-drawer): New command.
+       (org-entry-property-inherited-from): New variable.
+       (org-column): New face.
+       (org-column-overlays, org-current-columns-fmt)
+       (org-current-columns-maxwidths, org-column-map): New variables.
+       (org-column-menu): New menu.
+       (org-new-column-overlay, org-overlay-columns)
+       (org-overlay-columns-title, org-remove-column-overlays)
+       (org-column-show-value, org-column-quit, org-column-edit): New
+       functions.
+       (org-columns, org-agenda-columns): New commands.
+       (org-get-columns-autowidth-alist): New functions.
+       (org-properties): New customize group.
+       (org-default-columns-format): New option.
+       (org-priority): Realign tags after changing priority.
+       (org-preserve-lc): New macro.
+       (org-update-checkbox-count): Catch case when there is no headline.
+       (org-agenda-quit): Remove any column overlays.
+       (org-beginning-of-item-list): Fixed bug when non-item line is
+       indented too deep.
+       (org-cached-props): New variable.
+       (org-cached-entry-get): New function.
+       (org-make-tags-matcher): Handle property matches.
+       (org-table-recalculate): Swap evaluation order: Field formula
+       first, then column formulas, but don't allow them to overwrite the
+       field formulas.
+       (org-table-eval-formula): New argument untouchable.
+       (org-table-put-field-property): New function.
+
+2007-07-02  Martin Rudalics  <rudalics@gmx.at>
+
+       * help-mode.el (help-make-xrefs): Skip spaces too when
+       skipping tabs.
+
+       * ffap.el (dired-at-point-prompter): Improve prompt in
+       list-directory case.
+
+2007-07-01  Richard Stallman  <rms@gnu.org>
+
+       * files.el (find-file-visit-truename): Fix safe-local-variable value.
+
+2007-07-01  Richard Stallman  <rms@gnu.org>
+
+       * cus-start.el (max-mini-window-height): Added.
+
+2007-07-01  Sean O'Rourke  <sorourke@cs.ucsd.edu>  (tiny change)
+
+       * complete.el (partial-completion-mode): Remove advice of
+       read-file-name-internal.
+       (PC-do-completion): Rebind minibuffer-completion-table.
+       (PC-read-file-name-internal): New function doing what
+       read-file-name-internal advice did.
+
+2007-07-01  Paul Pogonyshev  <pogonyshev@gmx.net>
+
+       * emacs-lisp/byte-opt.el: Set `binding-is-magic'
+       property on a few symbols.
+       (byte-compile-side-effect-free-dynamically-safe-ops): New defconst.
+       (byte-optimize-lapcode): Remove bindings that are not referenced
+       and certainly will not effect through dynamic scoping.
+
+2007-07-01  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * files.el (find-file-confirm-inexistent-file): New var.
+       (find-file, find-file-other-window, find-file-other-frame)
+       (find-file-read-only, find-file-read-only-other-window)
+       (find-file-read-only-other-frame): Use it.
+
+2007-06-30  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emacs-lisp/rx.el (rx-constituents): Fix up `anything'.
+
+2007-06-29  Juanma Barranquero  <lekktu@gmail.com>
+
+       * generic-x.el (generic-define-mswindows-modes)
+       (generic-define-unix-modes, apache-log-generic-mode)
+       (bat-generic-mode-keymap, java-manifest-generic-mode)
+       (show-tabs-generic-mode): Fix typos in docstrings.
+
+2007-06-29  Ryan Yeske  <rcyeske@gmail.com>
+
+       * net/rcirc.el (rcirc-server-alist): Rename from rcirc-connections.
+       (rcirc-default-full-name): Rename from rcirc-default-user-full-name.
+       (rcirc-clear-activity): Make sure RCIRC-ACTIVITY isn't modified.
+       (rcirc-print): Never ignore messages from ourself.
+
+2007-06-29  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * font-lock.el (lisp-font-lock-keywords-2): Recognize the new \(?1:..\)
+       syntax as well.  Reported by Juri Linkov <juri@jurta.org>.
+
+2007-06-28  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * dnd.el (dnd-get-local-file-name): Set fixcase to t in call to
+       replace-regexp-in-string.
+
+2007-06-28  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emacs-lisp/cl.el: Set edebug and indentation before loading
+       cl-loaddefs.el so that its use of dolist doesn't load cl-macs.
+
+2007-06-28  Andreas Schwab  <schwab@suse.de>
+
+       * Makefile.in ($(lisp)/mh-e/mh-loaddefs.el): Depend on
+       $(lisp)/subdirs.el.
+
+2007-06-28  Juanma Barranquero  <lekktu@gmail.com>
+
+       * speedbar.el (speedbar-handle-delete-frame): Don't try to delete
+       the speedbar frame if nil; that deletes the current frame or
+       causes an error if it is the only frame.
+       Reported by Angelo Graziosi <Angelo.Graziosi@roma1.infn.it>.
+
+2007-06-28  Kevin Ryde  <user42@zip.com.au>
+
+       * textmodes/nroff-mode.el: Groff \# comments.
+       (nroff-mode-syntax-table): \# comment intro,
+       plain # as punct per global table.
+       (nroff-font-lock-keywords): Add # as a single char escape.
+       (nroff-mode): In comment-start-skip, match \#.
+
+2007-06-28  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * vc-bzr.el (vc-functions): Clear up the cache when reloading the file.
+       (vc-bzr-workfile-version, vc-bzr-could-register): Don't hardcode
+       point-min == 1.
+
+2007-06-28  Nick Roberts  <nickrob@snap.net.nz>
+
+       * pcvs-util.el (cvs-strings->string, cvs-string->strings):
+       Rename and move to...
+
+       * subr.el (strings->string, string->strings): ...here.
+
+       * pcvs.el (cvs-reread-cvsrc, cvs-header-msg, cvs-checkout)
+       (cvs-mode-checkout, cvs-execute-single-file): Use new function names.
+
+       * progmodes/gud.el (gud-common-init): Call string->strings instead
+       of split-string.
+
+2007-06-27  Michael Albinus  <michael.albinus@gmx.de>
+
+       * dired-aux.el: Remove `dired-call-process'.
+       (dired-check-process): Call `process-file'.
+
+       * wdired.el (wdired-do-perm-changes): Call `process-file'.
+
+       * net/ange-ftp.el (ange-ftp-dired-call-process): Reimplement it as
+       `ange-ftp-process-file'.
+
+2007-06-27  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emacs-lisp/cl.el: Use cl-loaddefs.el rather than manual autoloads.
+
+       * emacs-lisp/cl-extra.el:
+       * emacs-lisp/cl-seq.el:
+       * emacs-lisp/cl-macs.el: Set generated-autoload-file to cl-loaddefs.el.
+       Add autoload cookies on all defs autoloaded manually in cl.el.
+
+       * emacs-lisp/cl-loaddefs.el: New file.
+
+       * textmodes/texinfmt.el (texinfo-raisesections-alist)
+       (texinfo-lowersections-alist): Merge definition and declaration.
+       (texinfo-start-of-header, texinfo-end-of-header): Remove.
+       (texinfo-format-syntax-table): Merge init into declaration.
+       (texinfo-format-parse-line-args, texinfo-format-parse-args)
+       (texinfo-format-parse-defun-args, texinfo-format-node)
+       (texinfo-push-stack, texinfo-multitable-widths)
+       (texinfo-define-info-enclosure, texinfo-alias)
+       (texinfo-format-defindex, batch-texinfo-format): Use push.
+       (texinfo-footnote-number): Remove duplicate declaration.
+
+       * ps-print.el: Update with auto-generated autoloads.
+
+       * ps-mule.el: Set generated-autoload-file to "ps-print.el".
+
+2007-06-26  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emacs-lisp/autoload.el (autoload-generated-file): Interpret names
+       relative to current dir for file-local settings.
+       (autoload-generate-file-autoloads): Add `outfile' arg.
+       (update-directory-autoloads): Use it to directly call
+       autoload-generate-file-autoloads instead of going through
+       update-file-autoloads so we avoid redundant searches and so we can know
+       the set of buffers changed so we can save them all.
+
+       * emacs-lisp/autoload.el (autoload-find-destination): Return nil
+       rather than throwing `up-to-date'.
+       (autoload-generate-file-autoloads): Adjust correspondingly.
+       (update-file-autoloads): Be careful to let-bind
+       autoload-modified-buffers and adjust to new calling conventions.
+       (autoload-modified-buffers): Make it a dynamically scoped var.
+       (update-directory-autoloads): Use file-relative-name instead of
+       autoload-trim-file-name.
+       (autoload-insert-section-header): Don't use autoload-trim-file-name
+       since the file is already relative now.
+       (autoload-trim-file-name): Remove.
+
+       * vc-arch.el (vc-arch-add-tagline): Do a slightly cleaner job.
+       (vc-arch-complete, vc-arch--version-completion-table)
+       (vc-arch-revision-completion-table): New functions to provide
+       completion of revision names.
+       (vc-arch-trim-find-least-useful-rev, vc-arch-trim-make-sentinel)
+       (vc-arch-trim-one-revlib, vc-arch-trim-revlib): New functions
+       to let the user trim the revlib.
+
+       * vc.el: Add new VC operation `revision-completion-table'.
+       (vc-default-revision-completion-table): New function.
+       (vc-version-diff, vc-version-other-window): Use it to provide
+       completion of revision names if the backend provides it.
+
+       * log-edit.el (log-edit-changelog-entries): Use with-current-buffer.
+
+       * vc-svn.el (vc-svn-repository-hostname): Adjust to non-XML format
+       of newer .svn/entries.
+
+2007-06-25  David Kastrup  <dak@gnu.org>
+
+       * calc/calc-poly.el (math-padded-polynomial)
+       (math-partial-fractions): Add some function comments.
+
+2007-06-25  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emacs-lisp/autoload.el (autoload-generate-file-autoloads):
+       Make `outbuf' optional.
+       (update-file-autoloads): Use it.
+
+2007-06-25  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emacs-lisp/autoload.el (autoload-modified-buffers): New var.
+       (autoload-find-destination): Keep it uptodate.
+       (autoload-save-buffers): New fun.
+       (update-file-autoloads): Use it.  Re-add the "up to date" message.
+
+       * emacs-lisp/autoload.el: Refactor for upcoming changes.
+       (autoload-find-destination): New function extracted from
+       update-file-autoloads.
+       (update-file-autoloads): Use it.
+       (autoload-generate-file-autoloads): New function extracted from
+       generate-file-autoloads.  Use file-relative-name.  Delay computation of
+       output-start to the first cookie.  Remove done-any, replaced by
+       output-start.
+       (generate-file-autoloads): Use it.
+
+2007-06-24  Jay Belanger  <jay.p.belanger@gmail.com>
+
+       * calc/calc-comb.el (math-init-random-base, math-prime-test):
+       Use math-read-number-simple to insert constants.
+       (math-prime-test): Redo calculation of sum.
+
+       * calc/calc-misc.el (math-div2-bignum): Use math-bignum-digit-size.
+
+       * calc/calc-math.el (math-scale-bignum-digit-size): Rename from
+       math-scale-bignum-3.
+       (math-isqrt-bignum): Use math-scale-bignum-digit-size and
+       math-bignum-digit-size.
+       (math-isqrt-small): Add another possible initial guess.
+
+2007-06-23  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
+
+       * textmodes/bibtex.el (bibtex-entry-format): New options
+       `whitespace', `braces', and `string'.
+       (bibtex-field-braces-alist, bibtex-field-strings-alist)
+       (bibtex-field-braces-opt, bibtex-field-strings-opt)
+       (bibtex-cite-matcher-alist): New variables.
+       (bibtex-font-lock-keywords): Use bibtex-cite-matcher-alist.
+       (bibtex-flash-head): Use blink-matching-delay.
+       (bibtex-insert-kill, bibtex-mark-entry): Use push-mark.
+       (bibtex-format-entry, bibtex-reformat): Handle new options of
+       bibtex-entry-format.
+       (bibtex-field-re-init, bibtex-font-lock-cite, bibtex-dist):
+       New functions.
+       (bibtex-complete-internal): Do not display messages while
+       minibuffer is used.  Do not leave around a completions buffer
+       that is out of date.
+       (bibtex-copy-summary-as-kill): New optional arg.
+       (bibtex-font-lock-url): New optional arg no-button.
+       (bibtex-find-crossref): Use `bibtex-cite-matcher-alist'.
+       (bibtex-url): Allow multiple URLs per entry.
+
+2007-06-23  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emacs-lisp/autoload.el (autoload-generated-file): New function.
+       (update-file-autoloads, update-directory-autoloads): Use it.
+       (autoload-file-load-name): New function.
+       (generate-file-autoloads, update-file-autoloads): Use it.
+       (autoload-find-file): Accept non-absolute argument.  Set default-dir.
+       (generate-file-autoloads): If the autoloaded form is malformed,
+       indicate the problem with a warning instead of aborting.
+
+2007-06-23  Thien-Thi Nguyen  <ttn@gnuvola.org>
+
+       * simple.el (next-error-recenter): Accept `(4)' as well;
+       also, specify `integer' instead of `number'.
+
+2007-06-23  Eli Zaretskii  <eliz@gnu.org>
+
+       * ls-lisp.el (insert-directory): If an invalid regexp error is
+       thrown, try using FILE as a literal file name, not a wildcard.
+
+2007-06-23  Juanma Barranquero  <lekktu@gmail.com>
+
+       * ruler-mode.el (ruler-mode): Prevent clobbering the original
+       `header-line-format' when reentering ruler mode.
+
+2007-06-23  Eli Zaretskii  <eliz@gnu.org>
+
+       * ls-lisp.el (insert-directory): Don't treat FILE as a wildcard if
+       FILE exists as a file.
+
+2007-06-22  Jay Belanger  <jay.p.belanger@gmail.com>
+
+       * calc/calc.el (math-bignum-digit-length)
+       (math-bignum-digit-size, math-small-integer-size):
+       New constants.
+       (math-normalize, math-bignum-big, math-make-float)
+       (math-div10-bignum, math-scale-left, math-scale-left-bignum)
+       (math-scale-right, math-scale-right-bignum, math-scale-rounding)
+       (math-add, math-add-bignum, math-sub-bignum, math-sub, math-mul)
+       (math-mul-bignum, math-mul-bignum-digit, math-idivmod)
+       (math-quotient, math-div-bignum, math-div-bignum-digit)
+       (math-div-bignum-part, math-format-bignum-decimal)
+       (math-read-bignum): Use math-bignum-digit-length,
+       math-bignum-digit-size and math-small-integer-size.
+
+       * calc/calc-ext.el (math-fixnum-big): Use the variable
+       math-bignum-digit-size.
+
+2007-06-23  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * log-view.el (log-view-mode-menu): New menu.
+
+2007-06-22  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * diff-mode.el (diff-font-lock-keywords): Fix M. Kifer's last change
+       differently.
+
+       * vc-hg.el (vc-hg-registered): Add an autoloaded version.
+       (vc-hg-log-view-mode): Use log-view-font-lock-keywords.
+
+2007-06-22  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * vc-hg.el (vc-hg-print-log): Insert the file name.
+       (vc-hg-log-view-mode): Fontify the file name.
+
+2007-06-22  Jay Belanger  <jay.p.belanger@gmail.com>
+
+       * calc/calc-forms.el (math-format-date-part, calc-parse-standard-date)
+       (calcFunc-julian): Fix incorrect number used in calculations.
+
+2007-06-22  Thien-Thi Nguyen  <ttn@gnuvola.org>
+
+       * simple.el (next-error-recenter): New defcustom.
+       (next-error, next-error-internal): Recenter if specified,
+       immediately prior to running `next-error-hook'.
+
+       * progmodes/hideshow.el (hs-show-block): Use line-end-position.
+       (hs-hide-block-at-point, hs-hide-comment-region): Likewise.
+
+       * progmodes/hideshow.el (hs-hide-all): Use progress reporter.
+
+2007-06-22  Jay Belanger  <jay.p.belanger@gmail.com>
+
+       * calc/calc-comb.el (math-small-factorial-table): New variable.
+       (calcFunc-fact): Use `math-small-factorial-table'.
+
+       * calc/calc-ext.el (math-defcache): Allow forms to evaluate
+       initial values.
+       (math-approx-pi, math-approx-sqrt-e, math-approx-gamma-const):
+       New variables to use in caches.
+
+       * calc/calc-forms.el (math-format-date-part, math-parse-standard-date)
+       (calcFunc-julian): Use `math-read-number-simple' to insert bignums.
+
+       * calc/calc-func.el (math-besJ0, math-besJ1, math-besY0, math-besY1)
+       (math-bernoulli-b-cache): Use math-read-number-simple to insert
+       bignums.
+
+       * calc/calc-math.el (math-approx-ln-10, math-approx-ln-2):
+       New variables to use in caches.
+
+2007-06-22  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * vc-bzr.el (vc-bzr-log-view-mode): Add + to the email address regexp.
+
+       * vc-hg.el (vc-hg-log-view-mode): New mode.
+
+2007-06-21  Jay Belanger  <jay.p.belanger@gmail.com>
+
+       * calc/calc.el (math-read-number-simple): New function.
+
+2007-06-21  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * vera-mode.el (vera-mode): Fix `commend-end-skip' setting.
+       (vera-font-lock-match-item): Fix doc string.
+       (vera-in-comment-p): Remove unused function.
+       (vera-skip-forward-literal, vera-skip-backward-literal): Improve code,
+       use `syntax-ppss'.
+       (vera-forward-syntactic-ws): Fix argument order.
+       (vera-prepare-search): Use `with-syntax-table'.
+       (vera-indent-line): Fix doc string.
+       (vera-electric-tab): Fix doc string.
+       (vera-expand-abbrev): Define alias instead of using `fset'.
+       (vera-comment-uncomment-region): Use `comment-start-skip'.
+
+2007-06-21  Carsten Dominik  <dominik@science.uva.nl>
+
+       * textmodes/org.el (org-export-with-footnotes): New option.
+       (org-export-as-html): Fix replacement bug for XEmacs.
+       (org-agenda-default-appointment-duration): New option.
+
+2007-06-21  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * vc-hg.el: Add to do items.
+       (vc-hg-diff): Add support for comparing different revisions.
+       (vc-hg-diff, vc-hg-annotate-command, vc-hg-annotate-time)
+       (vc-hg-annotate-extract-revision-at-line)
+       (vc-hg-previous-version, vc-hg-checkin): New functions.
+       (vc-hg-annotate-re): New constant.
+
+2007-06-20  Jay Belanger  <jay.p.belanger@gmail.com>
+
+       * calc/calc.el (math-standard-ops): Fix precedence of multiplication.
+
+2007-06-20  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * log-view.el (log-view-font-lock-keywords): Use `eval' to consult the
+       buffer-local value of log-view-*-re if applicable.
+
+       * vc-bzr.el (vc-bzr-dir-state): Use setq rather than set.
+       Use vc-bzr-command rather than the ill defined vc-bzr-command*.
+       (vc-bzr-command*): Remove both (incompatible) versions.
+       (vc-bzr-do-command*): Remove.
+       (vc-bzr-with-process-environment, vc-bzr-std-process-invocation):
+       Remove by folding into its only caller vc-bzr-command.
+       (vc-bzr-command): Always set the environment, even when ineffective.
+       (vc-bzr-version): Minor fix up.
+       (vc-bzr-admin-dirname): New var.
+       (vc-bzr-bzr-dir): Remove.
+       (vc-bzr-root-dir): New fun.
+       (vc-bzr-registered): Use it.  Add an autoloaded version.
+       (vc-bzr-responsible-p): Use vc-bzr-root-dir as well.
+       (vc-bzr-view-log-function): Remove.
+       (vc-bzr-log-view-mode): New major mode to replace it.
+       (vc-bzr-print-log): Only activate the old hack if needed.
+
+       * vc.el (vc-default-log-view-mode): New function.
+       (vc-print-log): Add new `log-view-mode' VC operation.
+
+2007-06-20  Juanma Barranquero  <lekktu@gmail.com>
+
+       * ido.el (ido-find-file-in-dir): Don't signal an error for
+       empty directories.
+
+       * add-log.el (change-log-mode): Set `show-trailing-whitespace'.
+
+       * desktop.el (desktop-read): Run `desktop-not-loaded-hook' in the
+       directory where the desktop file was found, as the docstring says.
+       (desktop-kill): Use `read-directory-name'.
+
+2007-06-20  Alan Mackenzie  <acm@muc.de>
+
+       * progmodes/cc-mode.el (c-remove-any-local-eval-or-mode-variables):
+       When removing lines, also remove the \n.  Correction of patch of
+       2007-04-21.
+
+2007-06-20  Martin Rudalics  <rudalics@gmx.at>
+
+       * mouse.el (mouse-drag-mode-line-1): Quit mouse tracking when
+       event is not a cons cell.  Do not unread drag-mouse-1 events.
+       Select right window in check whether space was stolen from
+       window above.
+
+       * help-mode.el (help-make-xrefs): Adjust position of new forward
+       button.
+
+2007-06-20  Riccardo Murri  <riccardo.murri@gmail.com>
+
+       * vc-bzr.el (vc-bzr-with-process-environment)
+       (vc-bzr-std-process-invocation): New macros.
+       (vc-bzr-command, vc-bzr-command*): Use them.
+       (vc-bzr-with-c-locale): Remove.
+       (vc-bzr-dir-state): Replace its use with vc-bzr-command.
+       (vc-bzr-buffer-nonblank-p): New function.
+       (vc-bzr-state-words): New const.
+       (vc-bzr-state): Look for `bzr status` keywords in output.
+       Display everything else as a warning message to the user.
+       Fix status report with bzr >= 0.15.
+
+2007-06-20  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * vc-hg.el (vc-hg-global-switches): Simplify.
+       (vc-hg-state): Handle more states.
+       (vc-hg-diff): Fix doc-string.
+       (vc-hg-register): New function.
+       (vc-hg-checkout): Likewise.
+
+2007-06-20  Reto Zimmermann  <reto@gnu.org>
+
+       * progmodes/vera-mode.el: New file.
+
+2007-06-19  Jay Belanger  <jay.p.belanger@gmail.com>
+
+       * calc/calc.el (calc-multiplication-has-precendence):
+       New variable.
+       (math-standard-ops, math-standard-ops-p, math-expr-ops):
+       New functions.
+       (math-expr-opers): Define using math-standard-ops rather than
+       math-standard-opers.
+       * calc/calc-aent.el (calc-do-calc-eval): Let math-expr-opers
+       equal the function math-standard-ops rather than the variable
+       math-standard-opers.
+       (calc-algebraic-entry): Let math-expr-opers equal
+       math-standard-ops or math-expr-ops, as appropriate.
+       (math-expr-read-level, math-read-factor): Let math-expr-opers
+       equal math-expr-ops.
+       * calc/calc-embed.el (calc-embedded-finish-edit):
+       Let math-expr-opers equal the function math-standard-ops
+       rather than the variable math-standard-opers.
+       * calc/calc-ext.el (math-read-plain-expr)
+       (math-format-flat-expr-fancy): Let math-expr-opers equal the
+       function math-standard-ops rather than the variable
+       math-standard-opers.
+       * calc/calc-lang.el (calc-set-language, math-read-big-rec):
+       Let math-expr-opers equal the function math-standard-ops rather
+       than the variable math-standard-opers.
+       * calc/calc-prog.el (calc-read-parse-table): Let math-expr-opers
+       equal the function math-standard-ops rather than the variable
+       math-standard-opers.
+       * calc/calc-yank.el (calc-finish-stack-edit): Let math-expr-opers
+       equal the function math-standard-ops rather than the variable
+       math-standard-opers.
+       * calc/calccomp.el (math-compose-expr): Let math-expr-opers equal
+       math-expr-ops.
+
+2007-06-19  Ivan Kanis  <apple@kanis.eu>
+
+       * vc-hg.el: New file.
+
+2007-06-18  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * progmodes/sh-script.el (sh-font-lock-paren): Mark the relevant text
+       with font-lock-multiline.
+
+2007-06-17  Glenn Morris  <rgm@gnu.org>
+
+       * lpr.el (lpr-page-header-switches): Move %s to separate element
+       for correct quoting.  Doc fix.
+
+2007-06-17  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * textmodes/sgml-mode.el (sgml-xml-guess): Return the result rather
+       than setting sgml-xml-mode.
+       (sgml-mode, html-mode): Set sgml-xml-mode.
+       (sgml-skip-tag-backward): Tell if we skipped over matched tags.
+       (sgml-skip-tag-backward, sgml-electric-tag-pair-overlays): New var.
+       (sgml-electric-tag-pair-before-change-function)
+       (sgml-electric-tag-pair-flush-overlays): New functions.
+       (sgml-electric-tag-pair-mode): New minor mode.
+       (sgml-font-lock-keywords-2, sgml-get-context, sgml-unclosed-tag-p)
+       (sgml-calculate-indent): Use assoc-string.
+
+2007-06-16  Karl Fogel  <kfogel@red-bean.com>
+
+       * thingatpt.el (thing-at-point-email-regexp): Don't require two
+       chars before the "@" in an email address.  Andreas Roehler noticed
+       this problem.
+
+2007-06-15  Karl Fogel  <kfogel@red-bean.com>
+
+       * thingatpt.el: Add support for email addresses (`email').
+       (thing-at-point, bounds-of-thing-at-point): Document `email' support.
+       (thing-at-point-email-regexp): New variable.
+       (`email'): Put `bounds-of-thing-at-point' and `thing-at-point'
+       properties on this symbol, with lambda forms for values.
+
+2007-06-15  Masatake YAMATO  <jet@gyve.org>
+
+       * vc-bzr.el (vc-bzr-root): Cache the output of shell command execution.
+
+       * vc.el (vc-dired-hook): Check the backend returned from
+       `vc-responsible-backend' can really handle `subdir'.
+
+2007-06-15  Chong Yidong  <cyd@stupidchicken.com>
+
+       * wid-edit.el (widget-add-documentation-string-button):
+       Fix handling of documentation indent.
+
+2007-06-15  Miles Bader  <miles@fencepost.gnu.org>
+
+       * mb-depth.el: New file.
+
+2007-06-15  Masatake YAMATO  <jet@gyve.org>
+
+       * vc.el (vc-dired-mode): Show backend name as part of mode name.
+
+2007-06-14  Chong Yidong  <cyd@stupidchicken.com>
+
+       * wid-edit.el (widget-default-create): Move ?h handling here...
+       (widget-default-format-handler): ...from here.
+       (widget-docstring, widget-add-documentation-string-button): New funs.
+       (documentation-string): Add :visibility-widget property.
+       (widget-documentation-string-value-create): Use it.
+
+       * cus-edit.el (custom-split-regexp-maybe): Simplify.
+       (custom-buffer-create-internal): Simplify message.
+       (custom-variable-tag): Reduce height to normal.
+       (custom-variable-value-create, custom-face-value-create)
+       (custom-visibility): New widget.
+       (custom-visibility): New face.
+       (custom-group-value-create):
+       Call widget-add-documentation-string-button, using `custom-visibility'.
+
+2007-06-14  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emacs-lisp/bytecomp.el (byte-compile-current-group)
+       (byte-compile-nogroup-warn, byte-compile-file): Revert part of last
+       change.  Apparently the "warning even if the group is implicit" is
+       a feature rather than a bug.
+
+2007-06-14  Michael Kifer  <kifer@cs.stonybrook.edu>
+
+       * viper.el (viper-describe-key-ad, viper-describe-key-briefly-ad):
+       Different advices for Emacs and XEmacs.  Compile them conditionally.
+       (viper-version): Belated version change.
+
+2007-06-14  Juanma Barranquero  <lekktu@gmail.com>
+
+       * follow.el (follow-all-followers, follow-generic-filter):
+       * pcomplete.el (pcomplete-restore-windows):
+       * x-dnd.el (x-dnd-maybe-call-test-function, x-dnd-save-state)
+       (x-dnd-drop-data):
+       * emacs-lisp/edebug.el (edebug-pop-to-buffer, edebug-display):
+       * progmodes/python.el (python-complete-symbol):
+       * term/mac-win.el (mac-dnd-drop-data): Remove redundant check.
+
+2007-06-13  Ryan Yeske  <rcyeske@gmail.com>
+
+       * rcirc.el (rcirc-format-response-string): Use rcirc-nick-syntax
+       around bright and dim regexps.  Make sure bright and dim matches
+       use word anchors.  Send text through rcirc-markup functions.
+       (rcirc-url-regexp): Add single quote character.
+       (rcirc-connect): Write logs to disk on auto-save-hook.
+       Make server a non-optional argument.
+       (rcirc-log-alist): New variable.
+       (rcirc-log-directory): Make customizable.
+       (rcirc-log-flag): New customizable variable.
+       (rcirc-log): New function.
+       (rcirc-print): Use above function.
+       (rcirc-log-write): New function.
+       (rcirc-generate-new-buffer-name): Strip text properties.
+       (rcirc-switch-to-buffer-function): Remove variable.
+       (rcirc-last-non-irc-buffer): Remove variable.
+       (rcirc-non-irc-buffer): Add function.
+       (rcirc-next-active-buffer): Use above function.
+       (rcirc-keepalive): Send KEEPALIVE ctcp instead of a PING.
+       (rcirc-handler-ctcp-KEEPALIVE): Add handler.
+       (rcirc-handler-CTCP): Don't print KEEPALIVE responses.
+       (rcirc-omit-mode): Add minor-mode.
+       (rcirc-mode-map): Change C-c C-o binding.
+       (rcirc-mode): Clear mode-line-process.  Use a custom
+       fill-paragraph-function.  Set up buffer-invisibility-spec.
+       (rcirc-response-formats): Remove timestamp code.
+       (rcirc-omit-responses): Add variable.
+       (rcirc-print): Don't put the overlay arrow on potentially omitted
+       lines.  Log line to disk.  Record activity for private messages
+       from /dim nicks.  Facify the fill-prefix with rcirc-timestamp face.
+       (rcirc-jump-to-first-unread-line): Print message if there is no
+       unread text.
+       (rcirc-clear-unread): New function.
+       (rcirc-markup-text-functions): Add variable.
+       (rcirc-markup-timestamp, rcirc-markup-fill): Add functions.
+       (rcirc-debug): Don't mess with window configuration.
+       (rcirc-send-message): Send message before printing locally.
+       Add SILENT argument, do not print message if non-nil.
+       (rcirc-visible-buffers): New function and variable.
+       (rcirc-window-configuration-change-1): Add function.
+       (rcirc-target-buffer): Make sure ACTIONs don't get sent to the
+       server buffer.
+       (rcirc-clean-up-buffer): Set rcirc-target to nil when finished.
+       (rcirc-fill-paragraph): Add function.
+       (rcirc-record-activity, rcirc-window-configuration-change-1):
+       Only update the activity string if it has actually changed.
+       (rcirc-update-activity-string): Remove padding characters from the
+       mode-line string.
+       (rcirc-disconnect-buffer): New function to be called when a
+       channel is parted or the user quits.
+       (rcirc-server-name): Warn when the server-name hasn't been set.
+       (rcirc-window-configuration-change): Postpone work until
+       post-command-hook.
+       (rcirc-window-configuration-change-1): Update mode-line and
+       overlay arrows here.
+       (rcirc-authenticate): Fixc hanserv identification.
+       (rcirc-default-server): Remove variable.
+       (rcirc): Connect according to rcirc-connections.
+       (rcirc-connections): Add variable.
+       (rcirc-startup-channels-alist): Remove variable.
+       (rcirc-startup-channels): Remove function.
+
+2007-06-13  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * diff-mode.el (diff-font-lock-keywords): Fix M. Kifer's last change.
+
+2007-06-13  Johan Bockg\e,Ae\e(Brd  <bojohan@dd.chalmers.se>  (tiny change)
+
+       * term/xterm.el (terminal-init-xterm): Escape parens in character
+       constants.
+
+2007-06-13  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * progmodes/sh-script.el: Remove unneeded * from docstrings.
+       Use [:alpha:] and [:alnum:] where applicable.
+       (sh-quoted-subshell): Rewrite to correctly
+       handle nested mixes of `...` and $(...).
+       (sh-apply-quoted-subshell): Remove.
+       (sh-font-lock-syntactic-keywords): Adjust call to sh-quoted-subshell.
+
+       * vc-arch.el (vc-arch-command): Remove bzr.  It's a different program.
+
+2007-06-13  Michael Kifer  <kifer@cs.stonybrook.edu>
+
+       * ediff-ptch.el (ediff-context-diff-label-regexp): Partially undo
+       previous change.
+
+2007-06-12  Tom Tromey  <tromey@redhat.com>
+
+       * subr.el (user-emacs-directory): New defconst.
+       * cmuscheme.el (scheme-start-file):
+       * shell.el (shell):
+       * completion.el (save-completions-file-name):
+       * custom.el (custom-theme-directory):
+       * term/x-win.el (emacs-session-filename):
+       * filesets.el (filesets-menu-cache-file):
+       * thumbs.el (thumbs-thumbsdir):
+       * server.el (server-auth-dir):
+       * image-dired.el (image-dired-dir):
+       (image-dired-db-file):
+       (image-dired-temp-image-file):
+       (image-dired-gallery-dir):
+       (image-dired-temp-rotate-image-file):
+       * play/gamegrid.el (gamegrid-user-score-file-directory):
+       * savehist.el (savehist-file):
+       * tutorial.el (tutorial--saved-dir):
+       * startup.el (auto-save-list-file-prefix): Use user-emacs-directory.
+
+2007-06-12  Ralf Angeli  <angeli@caeruleus.net>
+
+       * scroll-lock.el (scroll-lock-mode): Doc fix.
+
+2007-06-12  Michael Kifer  <kifer@cs.stonybrook.edu>
+
+       * ediff-ptch.el (ediff-context-diff-label-regexp): Spurious parenthesis.
+
+       * ediff-init.el: Doc strings.
+
+2007-06-12  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emacs-lisp/bytecomp.el (byte-compile-current-group): New var.
+       (byte-compile-file): Bind it.
+       (byte-compile-nogroup-warn): Use it to avoid spurious warnings when the
+       group argument is provided implicitly.
+       (byte-compile-format-warn, byte-compile-from-buffer)
+       (byte-compile-insert-header): Don't hardcode point-min==1.
+       (byte-compile-file-form-require): Remove unused var old-load-list.
+       (byte-compile-eval): Remove unused vars old-autoloads and hist-nil-new.
+
+2007-06-12  Michael Kifer  <kifer@cs.stonybrook.edu>
+
+       * emulation/viper-cmd.el (viper-prefix-arg-com, viper-prefix-arg-value):
+       Display error messages.
+       (viper-prev-destructive-command, viper-insert-prev-from-insertion-ring):
+       Get rid of cl.el dependencies.
+
+       * emulation/viper-init.el (viper-suppress-input-method-change-message):
+       New variable.
+       (viper-activate-input-method-action)
+       (viper-inactivate-input-method-action):
+       Use viper-suppress-input-method-change-message.
+
+       * emulation/viper-kem.el (viper-vi-basic-map): Disable the bindings
+       for C-s, C-r.
+
+       * emulation/viper-util.el (viper-set-cursor-color-according-to-state):
+       Use viper-replace-overlay-cursor-color instead of
+       viper-replace-overlay-cursor-color.
+       (viper-sit-for-short): Use sit-for with 3 arguments.
+
+       * emulation/viper.el (viper-insert-state-mode-list): Add gud-mode.
+       (viper-major-mode-modifier-list): Add viper-comint-mode-modifier-map
+       to gud-mode.
+
+       * ediff-mult.el (ediff-meta-buffer-brief-message)
+       (ediff-meta-buffer-verbose-message): New variables.
+       (ediff-meta-buffer-message): Variable deleted.
+       (ediff-verbose-help-enabled): New variable.
+       (ediff-toggle-verbose-help-meta-buffer): New function.
+       (ediff-redraw-directory-group-buffer): Made aware of short/verbose
+       message options.
+
+       * ediff-ptch.el (ediff-context-diff-label-regexp): Better regexp.
+       (ediff-fixup-patch-map): Improve heuristic.
+
+2007-06-12  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * log-view.el (log-view-file-re, log-view-message-re): Use \(?1:...\).
+       (log-view-font-lock-keywords): Simplify.
+       (log-view-current-file, log-view-current-tag): Simplify.
+
+2007-06-12  Sam Steingold  <sds@gnu.org>
+
+       * vc-arch.el (vc-arch-command): Also try "baz" and "bzr".
+
+2007-06-12  Juanma Barranquero  <lekktu@gmail.com>
+
+       * desktop.el (desktop-load-locked-desktop): New option.
+       (desktop-read): Use it.
+       (desktop-truncate, desktop-outvar, desktop-restore-file-buffer):
+       Use `when'.
+
+2007-06-12  Davis Herring  <herring@lanl.gov>
+
+       * desktop.el (desktop-save-mode-off): New function.
+       (desktop-base-lock-name, desktop-not-loaded-hook): New variables.
+       (desktop-full-lock-name, desktop-file-modtime, desktop-owner)
+       (desktop-claim-lock, desktop-release-lock): New functions.
+       (desktop-kill): Tell `desktop-save' that this is the last save.
+       Release the lock afterwards.
+       (desktop-buffer-info): New function.
+       (desktop-save): Use it.  Run `desktop-save-hook' where the doc
+       says to.  Detect conflicts, and manage the lock.
+       (desktop-read): Detect conflicts.  Manage the lock.
+
+2007-06-12  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emulation/tpu-mapper.el (tpu-emacs-map-key): Use new keymap names.
+
+       * emulation/tpu-edt.el (tpu-gold-map): Rename from GOLD-map.
+       (tpu-lucid-emacs-p): Remove.  Use (featurep 'xemacs) instead.
+       (CSI-map, GOLD-CSI-map, GOLD-SS3-map, SS3-map): Delete vars.
+       (tpu-gold-map, tpu-global-map): Add all the SS3 and CSI bindings, using
+       keysyms rather than byte sequences.
+       (tpu-copy-keyfile): Don't force the user to use tpu-mapper.el.
+
+2007-06-11  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * font-lock.el (font-lock-add-keywords): In case font-lock was only
+       half-activated, forcefully activate it completely.
+
+2007-06-11  Richard Stallman  <rms@gnu.org>
+
+       * cus-edit.el (custom-variable-type): Doc fix.
+
+2007-06-11  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * progmodes/sh-script.el (sh-font-lock-backslash-quote)
+       (sh-font-lock-flush-syntax-ppss-cache): New functions.
+       (sh-font-lock-syntactic-keywords): Use them to distinguish the
+       different possible cases for \'.
+
+       * complete.el (PC-bindings): Don't bind things already bound in the
+       parent keymap.
+
+       * textmodes/bibtex-style.el: New file.
+
+2007-06-11  Riccardo Murri  <riccardo.murri@gmail.com>
+
+       * vc-bzr.el: New file.
+
+2007-06-11  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * vc-svn.el (vc-svn-program): New var.
+       (vc-svn-command): Use it.
+
+2007-06-11  Juanma Barranquero  <lekktu@gmail.com>
+
+       * server.el (server-switch-buffer): Remove redundant check.
+
+2007-06-10  Martin Rudalics  <rudalics@gmx.at>
+
+       * emacs-lisp/bytecomp.el (byte-compile-find-cl-functions):
+       Match against file-name-nondirectory.
+       Fix text on user customization variables.
+       Reported by Johan Bockg\e,Ae\e(Brd <bojohan@dd.chalmers.se>.
+
+2007-06-09  Alfred M. Szmidt  <ams@gnu.org>  (tiny change)
+
+       * mail/rmail.el (rmail-movemail-variant-in-use): Fix doc typo.
+
+2007-06-09  Davis Herring  <herring@lanl.gov>
+
+       * desktop.el (desktop-minor-mode-table): Doc fix.
+
+2007-06-08  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * textmodes/css-mode.el (css-navigation-syntax-table):
+       Use set-char-table-range so it also works in the unicode branch.
+
+2007-06-08  Nick Roberts  <nickrob@snap.net.nz>
+
+       * help-mode.el (help-xref-forward-stack)
+       (help-xref-stack-forward-item, help-forward-label): New variables.
+       (help-forward): New button type.
+       (help-setup-xref): Initialise help-xref-forward-stack.
+       (help-make-xrefs): Add forward button, if appropriate.
+       (help-xref-go-back): Push item on forward stack.
+       (help-xref-go-forward, help-go-forward): New functions.
+
+2007-06-07  Chong Yidong  <cyd@stupidchicken.com>
+
+       * dired.el (dired-mode-map): Remove spurious separator.
+
+2007-06-07  Juanma Barranquero  <lekktu@gmail.com>
+
+       * progmodes/ebrowse.el (ebrowse-draw-file-member-info): Doc fix.
+
+       * progmodes/mixal-mode.el (mixal-operation-codes-alist):
+       * progmodes/idlwave.el (idlwave-one-key-select): Fix typo in docstring.
+
+2007-06-07  Carsten Dominik  <dominik@science.uva.nl>
+
+       * textmodes/org.el: Version number fixed.
+
+2007-06-07  Glenn Morris  <rgm@gnu.org>
+
+       * version.el (emacs-copyright): New constant.
+       * startup.el (fancy-splash-tail): Use emacs-copyright.
+       * calc/calc-help.el (calc-full-help): Use emacs-copyright.
+
+       * emacs-lisp/bytecomp.el (byte-compile-warnings): Add new option
+       `make-local'.
+       (byte-compile-warnings-safe-p): Add `make-local'.
+       (byte-compile-make-variable-buffer-local):
+       Allow byte-compile-warnings to suppress this warning.
+
+       * tutorial.el (tutorial--describe-nonstandard-key): Adjust for new
+       format of "menu" description.
+       (tutorial--find-changed-keys): Describe the specific menu a
+       command is in.
+
+       * dframe.el (dframe-frame-parameter, dframe-mouse-event-p):
+       Rewrite compatibility functions to silence byte-compiler.
+
+2007-06-07  Alfred M. Szmidt  <ams@gnu.org>  (tiny change)
+
+       * mail/rmailsum.el (rmail-summary-save-buffer): New command.
+       (rmail-summary-mode-map): Add rmail-summary-save-buffer.
+
+2007-06-07  Eric M. Ludlam  <eric@siege-engine.com>
+
+       * emacs-lisp/checkdoc.el (checkdoc-ispell-lisp-words): Remove "iff".
+
+2007-06-07  Juanma Barranquero  <lekktu@gmail.com>
+
+       * progmodes/ebrowse.el (ebrowse-member-table):
+       * textmodes/org.el (org-export-ascii-bullets, org-batch-agenda)
+       (org-batch-agenda-csv): Fix typos in docstrings.
+
+2007-06-06  Juanma Barranquero  <lekktu@gmail.com>
+
+       * international/mule-cmds.el (toggle-enable-multibyte-characters)
+       (sort-coding-systems, search-unencodable-char): Doc fixes.
+       (coding-system-change-eol-conversion, set-default-coding-systems)
+       (prefer-coding-system, find-multibyte-characters, princ-list)
+       (leim-list-entry-regexp, set-input-method, locale-language-names)
+       (input-method-exit-on-first-char, exit-language-environment-hook)
+       (locale-charset-language-names): Fix typos in docstrings.
+
+2007-06-06  Juanma Barranquero  <lekktu@gmail.com>
+
+       * pgg.el (pgg-sign-region, pgg-sign):
+       * ses.el (ses-call-printer):
+       * calendar/icalendar.el (icalendar--diarytime-to-isotime):
+       * textmodes/org.el (org-cycle): Fix typos in docstrings.
+
+2007-06-06  Carsten Dominik  <dominik@science.uva.nl>
+
+       * textmodes/org.el
+       (org-export-region-as-html, org-replace-region-by-html)
+       (org-number-to-letters, org-table-fedit-finish)
+       (org-normalize-color, org-table-fedit-ref-right)
+       (org-date-to-gregorian, org-table-fedit-move)
+       (org-table-convert-refs-to-rc, org-calendar-holiday)
+       (org-table-fedit-toggle-ref-type, org-write-agenda)
+       (org-colgroup-info-to-vline-list, org-agenda-todo-previousset)
+       (org-defkey, org-encode-for-stdout)
+       (org-indent-line-function, org-export-as-html-to-buffer)
+       (org-store-agenda-views, org-update-mode-line)
+       (org-find-if, org-delete-all)
+       (org-table-fedit-convert-buffer, org-emphasize)
+       (org-uniquify, org-table-fedit-lisp-indent)
+       (org-table-fedit-scroll, org-get-todo-sequence-head)
+       (org-table-fedit-scroll-down, org-table-fedit-line-down)
+       (org-table-fedit-ref-left, org-agenda-export-csv-mapper)
+       (org-table-fedit-toggle-coordinates, org-dvipng-color)
+       (org-table-fedit-line-up, org-table-fedit-ref-down)
+       (org-table-formula-from-user, org-mode-flyspell-verify)
+       (org-cycle-show-empty-lines, org-ctrl-c-ret)
+       (org-table-formula-to-user, org-diary-to-ical-string)
+       (orgtbl-export, org-table-fedit-post-command)
+       (org-closed-in-range, org-shiftcontrolright)
+       (org-table-convert-refs-to-an, org-table-hline-and-move)
+       (org-table-formula-less-p, org-format-table-ascii)
+       (org-agenda-get-sexps, org-shift-refpart)
+       (org-diary-sexp-entry, org-time-string-to-absolute)
+       (org-table-show-reference, org-letters-to-number)
+       (org-fix-agenda-info, org-table-fedit-ref-up)
+       (org-table-fedit-shift-reference, org-table-fedit-abort)
+       (org-closest-date, org-shiftcontrolleft)
+       (org-at-heading-or-item-p, org-rematch-and-replace)
+       (org-agenda-todo-nextset, org-export-grab-title-from-buffer):
+       New functions.
+       (org-table-edit-scroll-down, org-finish-edit-formulas)
+       (org-table-edit-next-field, org-abort-edit-formulas)
+       (org-font-lock-level, org-export-find-first-heading-line)
+       (org-table-edit-line-down, org-table-edit-backward-field)
+       (org-edit-formula-lisp-indent, org-table-edit-move)
+       (org-check-log-option, org-this-word)
+       (org-table-edit-line-up, org-table-edit-formulas-post-command)
+       (org-agenda-file-to-end, org-expand-file-name)
+       (org-fake-empty-table-line, org-table-edit-scroll)
+       (org-toggle-log-option, org-show-reference): Function removed.
+       (org-inhibit-invisibility, org-table-formula-make-cmp-string):
+       New defsubsts.
+       (org-unmodified, org-batch-store-agenda-views)
+       (org-batch-agenda-csv): New macro.
+       (org-agenda-export): New customization group.
+       (org-agenda-skip-deadline-if-done, org-agenda-remove-tags)
+       (org-highest-priority, org-agenda-exporter-settings)
+       (org-log-done-with-time, org-replace-disputed-keys)
+       (org-format-latex-header, org-export-table-header-tags)
+       (org-cycle-separator-lines, org-export-table-data-tags)
+       (org-icalendar-include-sexps)
+       (org-empty-line-terminates-plain-lists)
+       (org-log-repeat, org-special-ctrl-a)
+       (org-table-use-standard-references, org-disputed-keys)
+       (org-export-skip-text-before-1st-heading, org-agenda-with-colors)
+       (org-agenda-export-html-style): New option.
+       (org-allow-auto-repeat, org-agenda-remove-tags-when-in-prefix)
+       (org-CUA-compatible): Option removed.
+       (org-agenda-structure, org-sexp-date): New face.
+       (org-todo-keywords-for-agenda, org-not-done-keywords)
+       (org-planning-or-clock-line-re, org-agenda-name)
+       (org-table-colgroup-info, org-todo-sets)
+       (constants-unit-system, org-clock-mode-line-entry)
+       (org-mode-line-timer, org-table-current-begin-pos)
+       (org-todo-keywords-1, org-mode-line-string)
+       (org-table-clean-did-remove-column, org-table-fedit-map)
+       (org-clock-heading, org-table-buffer-is-an)
+       (org-agenda-info, org-done-keywords)
+       (org-done-keywords-for-agenda, org-todo-heads)
+       (org-todo-kwd-alist, org-clock-start-time): New variable.
+       (org-todo-kwd-priority-p, org-edit-formulas-map)
+       (org-repeat-re, org-todo-kwd-max-priority)
+       (org-version, org-done-string)
+       (org-table-clean-did-remove-column-1, org-disputed-keys):
+       Remove variables.
+       (org-table-translate-regexp, org-repeat-re, org-version): New consts.
+       (org-ts-lengths): Constant removed.
+       (org-follow-gnus-link): Don't ask how many articles to read.
+       (org-export-find-first-export-line): Rename from
+       `org-export-find-first-heading'.
+       Use `org-export-skip-text-before-1st-heading'.
+       (org-table-fedit-post-command): Rename from
+       `org-table-edit-formulas-post-command'.
+       (org-table-fedit-finish): Rename from `org-finish-edit-formulas'.
+       (org-table-fedit-abort): Rename from `org-abort-edit-formulas'.
+       (org-table-fedit-lisp-indent): Rename from
+       `org-edit-formula-lisp-indent'.
+       (org-table-show-reference): Rename from `org-show-reference'.
+       (org-table-store-formulas): Use `org-table-formula-less-p'.
+       (org-table-edit-formulas): Position cursor to current field equation.
+       (org-update-checkbox-count, org-hide-archived-subtrees)
+       (org-timestamp-up-day, org-timestamp-down-day)
+       (org-shiftmetaleft, org-shiftmetaright, org-shiftmetaup)
+       (org-shiftmetadown, org-metaleft, org-metaright, org-metaup)
+       (org-metadown, org-shiftup, org-shiftdown, org-shiftright)
+       (org-shiftleft, org-ctrl-c-ctrl-c, org-context):
+       Let `org-on-heading-p' also check for invisible heading.
+       (org-read-date): Match am/pm times.
+       (org-eval-in-calendar): Fix default date in prompt.
+
+2007-06-05  Chong Yidong  <cyd@stupidchicken.com>
+
+       * files.el (auto-mode-alist): Separate "ChangeLog.1" and
+       "ChangeLog.a" entries, giving the latter lower priority.
+
+2007-06-05  Juanma Barranquero  <lekktu@gmail.com>
+
+       * faces.el (face-id): If the argument is a face alias,
+       return the ID of the target face.
+
+2007-06-05  Michael Albinus  <michael.albinus@gmx.de>
+
+       * net/socks.el (top): Remove unnecessary copyright line.
+
+2007-06-04  Chong Yidong  <cyd@stupidchicken.com>
+
+       * longlines.el (longlines-auto-wrap): Handle argument correctly.
+
+2007-06-04  Michael Albinus  <michael.albinus@gmx.de>
+
+       * net/socks.el: New file, taken from w3 repository.
+       (top): Update Copyright.  Don't load cl.el.
+       (all): Replace `case' by `cond', `string-to-int' by
+       `string-to-number', and `process-kill-without-query' by
+       `set-process-query-on-exit-flag'.
+       (socks-char-int): Remove defalias and all occurencies.
+
+2007-06-04  Juanma Barranquero  <lekktu@gmail.com>
+
+       * progmodes/compile.el (compilation-find-file, compilation-handle-exit):
+       Fix typos in docstrings.
+       (compilation-search-path, compilation-buffer-name-function): Doc fixes.
+       (compilation-finish-function): Fix typo in obsolescence declaration.
+
+2007-06-03  Sam Steingold  <sds@gnu.org>
+
+       * progmodes/compile.el: Add TIMESTAMP to the LOC data structure, to
+       handle unending automatic recompilation of changed files (`omake -P').
+       (compilation-loop): VISITED is now 5th CDR.
+       (compilation-next-error-function): Set TIMESTAMP.
+
+2007-06-03  Sam Steingold  <sds@gnu.org>
+
+       * files.el (kill-buffer-ask): New function.
+       (kill-some-buffers): Use it.
+       (kill-matching-buffers): New user command.
+
+2007-06-01  David Kastrup  <dak@gnu.org>
+
+       * dired.el (dired-recursive-deletes, dired-recursive-copies):
+       Change default to `top'.
+
+2007-05-31  Richard Stallman  <rms@gnu.org>
+
+       * dired.el (dired-do-flagged-delete, dired-do-delete): Doc fix.
+
+2007-05-31  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * textmodes/css-mode.el: New file.
+
+2007-05-30  Michael Olson  <mwolson@gnu.org>
+
+       * emacs-lisp/tq.el (tq-queue-pop): Stifle error when a process has
+       died and we are trying to send a signal to it.  The program using
+       tq.el should periodically check to see whether the process has
+       died and react appropriately -- this is not the responsibility of
+       tq.el, and is consistent with the rest of the tq.el source code.
+
+2007-05-29  Martin Rudalics  <rudalics@gmx.at>
+
+       * textmodes/table.el (table--point-entered-cell-function)
+       (table--point-left-cell-function):
+       Bind `inhibit-point-motion-hooks' to t.
+
+2007-05-29  Nikolaj Schumacher  <n_schumacher@web.de>  (tiny change)
+
+       * emacs-lisp/rx.el (rx): Doc fix.
+
+2007-05-28  Juanma Barranquero  <lekktu@gmail.com>
+
+       * progmodes/idlwave.el (idlwave-routines): Fix typo in docstring.
+
+2007-05-28  Michael Albinus  <michael.albinus@gmx.de>
+
+       Sync with Tramp 2.0.56.
+
+       * net/tramp.el:
+       * net/tramp-ftp.el:
+       * net/tramp-smb.el:
+       * net/tramp-util.el:
+       * net/tramp-vc.el:
+       Don't load cl.el, because that pollutes the namespace.  Replace cl
+       macros by their implementations where necessary.  Requested by
+       Richard Stallman <rms@gnu.org>.
+
+       * net/tramp.el (top): Make `set-buffer-multibyte' an alias if it
+       doesn't exist.
+       (with-parsed-tramp-file-name): Protect debug spec during compilation.
+       (tramp-handle-insert-directory): Check (featurep 'ls-lisp).
+       (tramp-file-name-p, tramp-file-name-multi-method)
+       (tramp-file-name-method, tramp-file-name-user)
+       (tramp-file-name-host, tramp-file-name-localname): New defuns,
+       replacing defstruct `tramp-file-name'.
+       (tramp-handle-file-remote-p, tramp-completion-dissect-file-name1)
+       (tramp-dissect-file-name, tramp-dissect-multi-file-name):
+       Apply `vector' instead of `make-tramp-file-name'.
+       (tramp-handle-make-auto-save-file-name):
+       Apply `tramp-temporary-file-directory' for compatibility reasons.
+       (tramp-completion-mode): Use `natnump' instead of `wholenump'
+       because of XEmacs.
+       (tramp-completion-mode): `last-input-event' is nil when XEmacs is
+       started.
+
+2007-05-28  Chong Yidong  <cyd@stupidchicken.com>
+
+       * textmodes/sgml-mode.el (sgml-point-entered): Use condition-case.
+
+2007-05-27  Tetsurou Okazaki  <okazaki@be.to>  (tiny change)
+
+       * log-edit.el (log-edit-changelog-paragraph): Return point-max
+       as the end of the ChangeLog paragraph when it ends without a line
+       termination.
+
+2007-05-27  Ryan Yeske  <rcyeske@gmail.com>
+
+       * net/webjump.el (webjump-sample-sites):
+       Add simple Wikipedia query.
+
+2007-05-25  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emacs-lisp/derived.el (define-derived-mode): Remove bogus
+       compatibility code.
+
+       * emacs-lisp/copyright.el (copyright-names-regexp): New var.
+       (copyright-update-year): Use it.
+
+       * edmacro.el (edmacro-format-keys): Use current-active-maps.
+
+       * ediff-init.el (ediff-defvar-local, ediff-with-current-buffer):
+       Add indentation and debugging info.  Fix up comment convention.
+
+       * cus-dep.el (custom-make-dependencies): Simplify.
+
+       * composite.el (compose-region, decompose-region):
+       Use inhibit-read-only and restore-buffer-modified-p.
+
+       * xt-mouse.el (xterm-mouse-truncate-wrap): New function.
+       (xterm-mouse-event): Use it.
+
+2007-05-25  Juanma Barranquero  <lekktu@gmail.com>
+
+       * bs.el (bs-cycle-previous): Don't modify the cycle list until
+       `switch-to-buffer' has returned succesfully.
+       (bs-cycle-next): Ditto.  Also, don't bury the buffer when the
+       window is dedicated (it could iconify the frame).
+
+2007-05-25  Miles Bader  <miles@fencepost.gnu.org>
+
+       * vc-hooks.el (vc-find-root): Fix file attribute test.
+
+2007-05-24  Richard Stallman  <rms@gnu.org>
+
+       * textmodes/flyspell.el (flyspell-correct-word-before-point):
+       Don't let opoint be nil.
+       (flyspell-emacs-popup): Explicit error if no dialogs.
+
+2007-05-24  Chong Yidong  <cyd@stupidchicken.com>
+
+       * image-mode.el (image-forward-hscroll, image-backward-hscroll)
+       (image-next-line, image-previous-line, image-scroll-up)
+       (image-scroll-down, image-bol, image-eol, image-bob, image-eob):
+       New functions.
+       (image-mode-map): Remap motion commands.
+       (image-mode-text-map): New keymap for viewing images as text.
+       (image-mode): Use image-mode-map.
+       (image-toggle-display): Toggle auto-hscroll-mode and mode keymaps.
+
+2007-05-24  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * textmodes/fill.el (canonically-space-region): Make the second arg
+       a marker if it's not already the case.
+
+2007-05-23  Eli Zaretskii  <eliz@gnu.org>
+
+       * tar-mode.el (tar-header-block-summarize, tar-summarize-buffer)
+       (tar-get-descriptor): Handle type 55, an extended pax header.
+
+2007-05-23  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * autoinsert.el (auto-insert-alist): Quote elisp sample code so as not
+       to confuse outline-minor-mode.
+
+2007-05-23  Eli Zaretskii  <eliz@gnu.org>
+
+       * tar-mode.el (tar-file-name-handler): New function.
+       (tar-extract): Bind file-name-handler-alist to it to force
+       find-buffer-file-type-coding-system behave as if the file being
+       extracted existed.  Use last-coding-system-used to force
+       buffer-file-coding-system to what decode-coding-region actually
+       used to decode the file.
+
+2007-05-23  Nikolaj Schumacher  <n_schumacher@web.de>  (tiny change)
+
+       * progmodes/compile.el (compilation-handle-exit):
+       `compilation-finish-function' may change the current buffer.
+
+2007-05-22  Richard Stallman  <rms@gnu.org>
+
+       * files.el (set-auto-mode): Doc fix.
+
+2007-05-22  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * help-fns.el (find-source-lisp-file): New function.
+       (describe-function-1): Use find-source-lisp-file to find source
+       file in compile tree.
+
+2007-05-22  Eli Zaretskii  <eliz@gnu.org>
+
+       * dos-w32.el (find-buffer-file-type-coding-system): Doc fix.
+
+2007-05-22  Juanma Barranquero  <lekktu@gmail.com>
+
+       * emacs-lisp/easy-mmode.el (define-minor-mode)
+       (easy-mmode-define-navigation): Fix typos in docstrings.
+
+2007-05-22  Glenn Morris  <rgm@gnu.org>
+
+       * files.el (auto-mode-alist): Open `.asd' files in lisp-mode.
+
+2007-05-22  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * mail/mail-extr.el (mail-extract-address-components):
+       Recognize non-ASCII characters except for NBSP as words.
+
+2007-05-21  Trent Buck  <trentbuck@gmail.com>  (tiny change)
+
+       * net/rcirc.el (rcirc-fill-column): Allow `window-width'.
+       (rcirc-print): Handle `window-width'.
+       (rcirc-buffer-maximum-lines): Doc fix.
+
+2007-05-21  Chong Yidong  <cyd@stupidchicken.com>
+
+       * image-mode.el (image-toggle-display): Don't clear image cache.
+       Only use filename in image spec if the file is readable.
+       Call image-refresh.
+
+       * image.el (image-type-from-file-name, image-type): Simplify.
+       (image-type-auto-detected-p): Don't scan auto-mode-alist.
+
+       * files.el (magic-mode-alist): Remove image-type-auto-detected-p.
+       (magic-fallback-mode-alist): Add image-type-auto-detected-p.
+
+2007-05-20  Nick Roberts  <nickrob@snap.net.nz>
+
+       * t-mouse.el (t-mouse-mode): Reset t-mouse-mode to nil if there
+       is an error.
+
+       * term/linux.el (terminal-init-linux): Don't signal an error
+       if gpm isn't running.
+
+2007-05-20  Nick Roberts  <nickrob@snap.net.nz>
+
+       * t-mouse.el: Reduce to a minor-mode macro call.
+       (t-mouse-mode): Remove the lighter.
+
+       * term/linux.el (terminal-init-linux): Enable t-mouse by default.
+
+2007-05-19  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * files.el (auto-mode-alist): Change the regexp so that
+       ChangeLog.unicode and ChangeLog.multi-tty use change-log-mode.
+
+2007-06-02  Chong Yidong  <cyd@stupidchicken.com>
+
+       * Version 22.1 released.
+
+2007-05-19  Chong Yidong  <cyd@stupidchicken.com>
+
+       * paren.el (show-paren-function): Undo 2007-04-19 and 2007-04-20
+       changes.
+
+2007-05-19  Kevin Ryde  <user42@zip.com.au>
+
+       * info.el (Info-fontify-node): Fontify https as well as http and ftp.
+
+2007-05-18  Thien-Thi Nguyen  <ttn@gnuvola.org>
+
+       * textmodes/sgml-mode.el: Revert last change.
+
+2007-05-18  Richard Stallman  <rms@gnu.org>
+
+       * simple.el (push-mark): Doc fix.
+
+2007-05-18  Rob Riepel  <riepel@Stanford.EDU>
+
+       * emulation/tpu-edt.el (CSI-map, SS3-map): Move from global-map to
+       tpu-global-map.
+       (tpu-original-global-map): Variable deleted.
+       (tpu-control-keys-map): New keymap variable.
+       (tpu-set-control-keys): Use tpu-reset-control-keys rather than
+       setting keymapping directly.
+       (tpu-reset-control-keys): Use tpu-control-keys-map instead of
+       tpu-global-map.
+       (tpu-edt-on): Activate the tpu-global-map.
+       (tpu-edt-off): Deactivate the tpu-global-map.
+
+2007-05-18  Ryan Yeske  <rcyeske@gmail.com>
+
+       * textmodes/ispell.el (ispell-get-word): Return markers
+       for start and end positions.
+       (ispell-word): Assume END is a marker.
+
+2007-05-17  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
+
+       * printing.el: Group together all XEmacs/Emacs definitions.
+       (pr-version): New version 6.9.
+       (pr-global-menubar, pr-menu-char-height, pr-menu-char-width): New funs.
+       (pr-menu-char-height, pr-menu-char-width): Fix initialization code.
+       (pr-menu-bind): Fix code.
+       (pr-e-frame-char-height, pr-e-frame-char-width)
+       (pr-e-mouse-pixel-position, pr-x-add-submenu, pr-x-event-function)
+       (pr-x-event-object, pr-x-find-menu-item, pr-x-font-height)
+       (pr-x-font-width, pr-x-get-popup-menu-response, pr-x-make-event)
+       (pr-x-misc-user-event-p, pr-x-relabel-menu-item, pr-x-event-x-pixel)
+       (pr-x-event-y-pixel): Aliases eliminated.
+       (pr-xemacs-global-menubar): Macro moved.
+       (current-menubar, current-mouse-event, zmacs-region-stays)
+       (deactivate-mark, pr-menu-position, pr-menu-state, pr-ps-name-old)
+       (pr-txt-name-old, pr-ps-utility-old, pr-even-or-odd-old, pr-temp-menu):
+       Vars moved.
+       (pr-region-active-p, pr-menu-position, pr-menu-lookup, pr-menu-lock)
+       (pr-update-mode-line, pr-do-update-menus, pr-menu-alist)
+       (pr-relabel-menu-item, pr-menu-set-ps-title, pr-menu-set-txt-title)
+       (pr-menu-set-utility-title, pr-even-or-odd-pages)
+       (pr-f-set-keymap-parents, pr-f-set-keymap-name, pr-f-read-string)
+       (pr-keep-region-active, pr-menu-get-item, pr-menu-set-item-name): Funs
+       moved.
+
+2007-05-17  Christian Plate  <cplate@web.de>  (tiny change)
+
+       * textmodes/sgml-mode.el (sgml-tag):
+       Fix bug: Call sgml-transformation-function.
+
+2007-05-17  Martin Rudalics  <rudalics@gmx.at>
+
+       * hilit-chg.el (highlight-changes-rotate-faces): Don't set
+       modified flag of buffer.  Use `inhibit-modification-hooks'.
+
+2007-05-16  Richard Stallman  <rms@gnu.org>
+
+       * buff-menu.el (Buffer-menu-sort-column): Doc fix.
+
+2007-05-16  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * files.el (magic-mode-alist, magic-fallback-mode-alist):
+       Move the *ml, Postscript, and XmCD entries to the fallback part.
+
+       * files.el (magic-fallback-mode-alist):
+       Rename from file-start-mode-alist.
+
+2007-05-16  Nikolaj Schumacher  <n_schumacher@web.de>  (tiny change)
+
+       * progmodes/compile.el (compilation-handle-exit): Quote first
+       argument of `run-hook-with-args'.
+
+2007-05-16  Juanma Barranquero  <lekktu@gmail.com>
+
+       * buff-menu.el (Buffer-menu-sort-column):
+       * dabbrev.el (dabbrev-upcase-means-case-search):
+       * dired.el (dired-recursive-deletes, dired-recursive-copies):
+       * info.el (Info-current-subfile):
+       * ls-lisp.el (ls-lisp-verbosity):
+       * msb.el (msb-menu-cond):
+       * pcvs.el (cvs-dired-use-hook):
+       * simple.el (set-mark-command-repeat-pop):
+       * time.el (display-time-24hr-format, display-time-mail-file):
+       Doc fixes.
+
+       * tutorial.el (get-lang-string, tutorial--find-changed-keys):
+       * printing.el (pr-ps-fast-fire): Fix typos in docstrings.
+
+       * view.el (view-inhibit-help-message): Fix typo in docstring.
+       (view-scroll-auto-exit, view-try-extend-at-buffer-end): Doc fixes.
+
+2007-05-16  Martin Rudalics  <rudalics@gmx.at>
+
+       * textmodes/ispell.el (ispell-start-process): Defend against bad
+       default-directory.
+
+2007-05-14  Eli Zaretskii  <eliz@gnu.org>
+
+       * mail/rmail.el (rmail-convert-to-babyl-format): Check
+       content-transfer-encoding _last_, because it's its position that
+       we need as value of base64-header-field-end.
+
+2007-05-14  Juanma Barranquero  <lekktu@gmail.com>
+
+       * files.el (mode-require-final-newline, require-final-newline)
+       (enable-local-variables, enable-local-eval): Doc fixes.
+
+2007-05-13  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
+
+       * ps-print.el: Use default color when foreground or background color
+       are unspecified.  Reported by Leo <sdl.web@gmail.com>.
+       (ps-print-version): New version 6.7.4.
+       (ps-rgb-color): New argument.  Use default color when color is
+       unspecified.
+       (ps-begin-job): Fix code.
+
+2007-05-12  Chong Yidong  <cyd@stupidchicken.com>
+
+       * longlines.el (longlines-mode): Make longlines-auto-wrap
+       buffer-local.  Add hooks unconditionally.
+       (longlines-auto-wrap): Toggle wrapping.
+       (longlines-after-change-function)
+       (longlines-post-command-function): Check longlines-auto-wrap.
+
+2007-05-12  Nick Roberts  <nickrob@snap.net.nz>
+
+       * xt-mouse.el (xterm-mouse-debug-buffer): New variable.
+       (xterm-mouse-translate): Use it.
+
+2007-05-10  Richard Stallman  <rms@gnu.org>
+
+       * international/iso-cvt.el (iso-cvt-read-only): Ignore arguments.
+       (iso-cvt-write-only): Likewise.
+
+       * emacs-lisp/easy-mmode.el (define-minor-mode):
+       Fix generated doc string.
+
+       * startup.el (fancy-splash-text): Add URL of guided tour.
+       Adjust horizontal and vertical whitespace.
+
+       * progmodes/compile.el (compilation-handle-exit):
+       Use run-hook-with-args to run compilation-finish-functions.
+
+       * files.el (file-start-mode-alist): New variable.
+       (magic-mode-regexp-match-limit): Doc fix.
+       (set-auto-mode): Handle file-start-mode-alist.
+       A little cleanup of structure.
+
+       * dabbrev.el (dabbrev-eliminate-newlines):
+       Renamed from dabbrev--eliminate-newlines.  All uses changed.
+
+2007-05-10  Micha\e,Ak\e(Bl Cadilhac  <michael@cadilhac.name>
+
+       * man.el (Man-next-section): Don't consider the last line of the page
+       as being part of any section.
+
+2007-05-10  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * textmodes/sgml-mode.el (sgml-value): Fix handling of attributes which
+       can take any number of values.
+
+2007-05-09  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * textmodes/tex-mode.el (tex-font-lock-keywords-2): Add citet and citep
+       to the list of citation commands.
+
+2007-05-09  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * vc-hooks.el (vc-find-root): Stop searching when the user changes.
+
+2007-05-09  Edward O'Connor  <hober0@gmail.com>  (tiny change)
+
+       * progmodes/python.el (python-font-lock-keywords)
+       (python-open-block-statement-p, python-mode): Add support for the new
+       "with" keyword.
+
+2007-05-08  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * diff-mode.el (diff-apply-hunk, diff-test-hunk): Don't do by default
+       the exact opposite of diff-goto-source.
+
+       * emacs-lisp/advice.el (ad-special-forms): Remove.
+       (ad-special-form-p): Use subr-arity.
+
+       * newcomment.el (comment-search-forward): Make sure we search forward.
+       (comment-enter-backward): Try and distinguish the non-matching case at
+       EOB from the non-matching case with a missing comment-end-skip for
+       a 2-char comment ender.
+       (comment-choose-indent): New function extracted from comment-indent.
+       Improve the alignment algorithm.
+       (comment-indent): Use it.
+
+       * textmodes/sgml-mode.el (sgml-lexical-context): Add handling of
+       XML style Processing Instructions.
+       (sgml-parse-tag-backward): Handle XML-style PIs.  Also ensure progress.
+       (sgml-calculate-indent): Handle `pi' context.
+
+       * vc.el: Ensure that update-changelog issues an error when used with
+       a backend that does not implement it.
+       (vc-update-changelog-rcs2log): Rename from vc-default-update-changelog.
+       Remove `backend' argument.  Use expand-file-name.
+       (vc-cvs-update-changelog, vc-rcs-update-changelog): New aliases.
+
+       * progmodes/python.el (python-end-of-block): Revert last change.
+       (python-end-of-statement): Make sure we move *forward*.
+
+2007-05-08  Richard Stallman  <rms@gnu.org>
+
+       * mail/mailabbrev.el (sendmail-pre-abbrev-expand-hook):
+       Don't include non-self-insert commands in the exception for `-'.
+
+2007-05-08  David Reitter  <david.reitter@gmail.com>
+
+       * progmodes/python.el (python-guess-indent): Check non-nullness
+       before comparing indent against the 2..8 interval.
+
+2007-05-07  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * term/mac-win.el (mac-ts-unicode-for-key-event): Check if text is
+       available.
+
+2007-05-06  Richard Stallman  <rms@gnu.org>
+
+       * emacs-lisp/eldoc.el (turn-on-eldoc-mode): Doc fix.
+
+2007-05-05  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * diff.el (diff): Use buffer-local vars diff-old-file and diff-new-file
+       rather than storing their value in the revert-buffer function.
+
+2007-05-04  Nick Roberts  <nickrob@snap.net.nz>
+
+       * t-mouse.el (t-mouse-mode): Do nothing on a graphical display
+       when disabling t-mouse-mode.
+
+2007-05-01  Davis Herring  <herring@lanl.gov>
+
+       * calendar/timeclock.el: Update version number.
+       (timeclock-modeline-display): Mention timeclock-use-display-time
+       in explanatory message.
+       (timeclock-in): Fix non-interactive workday specifications.
+       (timeclock-log): Don't kill the log buffer if it already existed.
+       Suppress warnings when finding the log.  Don't check for a nil
+       project twice.  Run hooks after killing the buffer (if applicable).
+       (timeclock-geometric-mean): Rename to `timeclock-mean' (it never
+       was geometric).  All uses changed.
+       (timeclock-generate-report): Support prefix argument.
+
+2007-05-03  Ryan Yeske  <rcyeske@gmail.com>
+
+       * net/rcirc.el (rcirc-timeout-seconds): Increase to prevent unwanted
+       disconnections.
+
+2007-05-01  Romain Francoise  <romain@orebokech.com>
+
+       * dired-x.el: Revert 2007-04-06 change.
+
+2007-04-29  Stephen Berman  <Stephen.Berman@gmx.net>
+
+       * find-dired.el (find-dired-filter): Propertize all text down to eob.
+
+2007-04-29  Richard Stallman  <rms@gnu.org>
+
+       * international/mule.el (auto-coding-alist): Add pdf => no-conversion.
+
+2007-04-28  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * progmodes/cc-mode.el (c-before-change): Use point-min rather
+       than 1.
+
+2007-04-28  Richard Stallman  <rms@gnu.org>
+
+       * progmodes/sh-script.el (sh-mode): Recognize .profile as sh style.
+
+2007-04-28  Nick Roberts  <nickrob@snap.net.nz>
+
+       * progmodes/gud.el (gud-menu-map): Pdb can't handle SIGINT so
+       don't put stop on toolbar.
+
+2007-04-28  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * vc-hooks.el (vc-ignore-dir-regexp): Add /.../ for the DFS filesystem.
+
+2007-04-28  Eli Zaretskii  <eliz@gnu.org>
+
+       * makefile.w32-in ($(lisp)/mh-e/mh-loaddefs.el): Use ./mh-e
+       instead of $(lisp)/mh-e.
+
+2007-04-28  Glenn Morris  <rgm@gnu.org>
+
+       * image-dired.el (image-dired-cmd-create-thumbnail-options)
+       (image-dired-cmd-create-temp-image-options): Replace option
+       +profile "*" with -strip.
+
+2007-04-27  Chong Yidong  <cyd@stupidchicken.com>
+
+       * textmodes/flyspell.el (flyspell-auto-correct-previous-word):
+       Use window-start and window-end.
+
+2007-04-27  Andreas Schwab  <schwab@suse.de>
+
+       * emacs-lisp/sregex.el (sregexq): Fix doc string quoting.
+
+2007-04-27  Eli Zaretskii  <eliz@gnu.org>
+
+       * textmodes/fill.el (fill-paragraph): Doc fix.
+
+2007-04-26  Luc Teirlinck  <teirllm@dms.auburn.edu>
+
+       * locate.el (locate-in-alternate-database): Doc fix.
+
+2007-04-26  Glenn Morris  <rgm@gnu.org>
+
+       * button.el (button): Use underline if supported, else fall back
+       to color.
+
+       * version.el (emacs-version): Increase to 22.1.50.
+
+2007-04-25  Richard Stallman  <rms@gnu.org>
+
+       * hi-lock.el (hi-lock-file-patterns-policy): Default to `ask'.
+
+2007-04-25  J.D. Smith  <jdsmith@as.arizona.edu>
+
+       * progmodes/idlwave.el (idlwave-beginning-of-subprogram)
+       (idlwave-end-of-subprogram): Take optional NOMARK arg to prevent
+       pushing mark.
+       (idlwave-current-routine): Don't push mark.
+
+2007-04-25  Mathias Dahl  <mathias.dahl@gmail.com>
+
+       * image-dired.el (image-dired-display-image): Derive image-type from
+       filename rather than assuming jpeg, in case no resizing was needed.
+
+2007-04-25  Johan Bockg\e,Ae\e(Brd  <bojohan@dd.chalmers.se>
+
+       * custom.el (defface): Doc fix.
+
+See ChangeLog.12 for earlier changes.
+
+;; Local Variables:
+;; coding: iso-2022-7bit
+;; add-log-time-zone-rule: t
+;; End:
+
+    Copyright (C) 2007 Free Software Foundation, Inc.
+
+  This file is part of GNU Emacs.
+
+  GNU Emacs is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 3, or (at your option)
+  any later version.
+
+  GNU Emacs is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with GNU Emacs; see the file COPYING.  If not, write to the
+  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+  Boston, MA 02110-1301, USA.
+
+;; arch-tag: 1e8aa93a-fc6c-4ac3-9b10-1f445e1840af
similarity index 96%
copy from lisp/ChangeLog
copy to lisp/ChangeLog.12
index c26869f..c26f79b 100644 (file)
-2007-08-13  Stephen Leake  <stephen_leake@stephe-leake.org>
-
-       * pcvs-parse.el (cvs-parse-table): Handle additional instance of
-       optional quotes around files in NEED-UPDATE . REMOVED case.
-
-       * progmodes/ada-xref.el (ada-gnatls-args): Fix docstring.
-       (ada-treat-cmd-string): Improve error message.
-       (ada-do-file-completion): Call `ada-require-project-file', so
-       project variables are set properly.
-       (ada-prj-find-prj-file): Delete Emacs 20.2 support.
-       (ada-gnatfind-buffer-name): New constant.
-       (ada-find-any-references): Use new constant.  Set buffer name
-       properly in compilation-start.  Toggle read-only properly.
-       (ada-find-in-src-path): Fix spelling error in docstring.
-
-       * progmodes/vhdl-mode.el (vhdl-update-progress-info): Avoid divide
-       by zero error.
-
-2007-08-13  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gdb-ui.el (gdb-send): Handle CTRL-D more carefully.
-
-2007-08-12  Richard Stallman  <rms@gnu.org>
-
-       * pcvs.el (cvs-reread-cvsrc, cvs-checkout, cvs-mode-checkout)
-       (cvs-execute-single-file): Use new name split-string-and-unquote.
-       (cvs-header-msg): Use new name combine-and-quote-strings.
-
-       * emulation/vi.el (vi-next-line): Ignore return value of line-move.
-
-       * progmodes/gud.el (gud-common-init): Use new name
-       split-string-and-unquote.
-
-       * progmodes/flymake.el (flymake-err-line-patterns): Fix infloop
-       in javac regexp.
-
-       * pcvs-util.el (cvs-qtypedesc-strings): Use new names
-       combine-and-quote-strings and split-string-and-unquote.
-
-       * subr.el (combine-and-quote-strings): Renamed from strings->string.
-       (split-string-and-unquote): Renamed from string->strings.
-
-2007-08-10  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * log-view.el (log-view-font-lock-keywords): Use `eval' so as to adapt
-       to buffer-local settings.
-
-       * emacs-lisp/backquote.el (backquote-delay-process): New function.
-       (backquote-process): Add internal arg `level'.  Use the two to
-       correctly handle nested backquotes.
-
-2007-08-09  Riccardo Murri  <riccardo.murri@gmail.com>
-
-       * vc-bzr.el (vc-bzr-registered): Use \0 instead of literal NULs.
-       (vc-bzr-state-words): Add "kind changed" state word.
-       (vc-bzr-status): New function.  Return Bzr idea of file status,
-       which is different from VC's.
-       (vc-bzr-state): Use vc-bzr-status.
-       (vc-workfile-unchanged-p): Use vc-bzr-status.
-       (vc-bzr-revert): Use synchronous process; expect exitcode 0.
-       (vc-dired-state): Process "kind changed" state word.
-
-2007-08-09  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * vc-hooks.el (vc-default-find-file-not-found-hook): Do nothing.
-
-       * vc-rcs.el (vc-rcs-find-file-not-found-hook):
-       Move from vc-default-find-file-not-found-hook.
-
-2007-08-09  Edward O'Connor  <hober0@gmail.com>  (tiny change)
-
-       * url/url-auth.el (url-basic-auth): When prompting for username
-       and password, default to the username and password in the URL.
-
-2007-08-08  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * man.el: Remove spurious * in docstrings.
-       Merge defvars and toplevel setq-defaults.
-       (Man-highlight-references0): Limit=nil rather than point-max.
-       (Man-mode-map): Move initialization into the declaration.
-       (Man-strip-page-headers, Man-unindent): Use dolist & inhibit-read-only.
-       (Man-view-header-file): Use expand-file-name rather than concat.
-       (Man-notify-when-ready, Man-bgproc-sentinel): Use with-current-buffer.
-
-       * man.el (Man-next-section): Make sure we do not move backward.
-
-2007-08-08  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
-
-       * ps-print.el (ps-default-fg, ps-default-bg): Docstring fix.
-       (ps-begin-job): Use ps-default-fg and ps-default-bg only when
-       ps-print-color-p is neither nil nor black-white.  Reported by Christian
-       Schlauer <cs-muelleimer-rubbish.bin@arcor.de>.
-
-2007-08-08  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * files.el (auto-mode-alist): Use the purecopied text (duh!).
-
-2007-08-08  Andreas Schwab  <schwab@suse.de>
-
-       * mail/mailabbrev.el (sendmail-pre-abbrev-expand-hook): Check for
-       self-insert-command, not self-insert.
-
-2007-08-08  Glenn Morris  <rgm@gnu.org>
-
-       * emacs-lisp/checkdoc.el (checkdoc-ispell-lisp-words): Remove `iff'.
-
-       * Replace `iff' in doc-strings and comments.
-
-       * help-mode.el (help-make-xrefs): Search for symbol constituents,
-       rather than just `-'.
-
-2007-08-08  Martin Rudalics  <rudalics@gmx.at>
-
-       * dired.el (dired-pop-to-buffer):
-       * mouse-drag.el (mouse-drag-should-do-col-scrolling):
-       * calendar/calendar.el (generate-calendar-window):
-       * progmodes/compile.el (compilation-set-window-height):
-       * textmodes/two-column.el (2C-two-columns, 2C-merge):
-       Use window-full-width-p instead of comparing frame-width and
-       window-width.
-
-       * progmodes/compile.el (compilation-find-buffer): Remove extra
-       argument in call to compilation-buffer-internal-p.
-
-2007-08-07  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/tramp.el (tramp-handle-file-remote-p): Handle optional
-       parameters IDENTIFICATION and CONNECTED.
-       (tramp-handle-insert-file-contents): VISIT must be handled after
-       insertion of the local copy.  Reported by Peter Gordon
-       <peter@pg-consultants.com>.
-       (tramp-file-name-handler): No special handling for
-       `expand-file-name'.  But for `file-name-as-directory'.
-       (tramp-find-shell, tramp-open-connection-telnet)
-       (tramp-open-connection-rsh, tramp-open-connection-su)
-       (tramp-open-connection-multi)
-       (tramp-open-connection-setup-interactive-shell): Guard against
-       $PROMPT_COMMAND shell var.  Reported by Steve Youngs
-       <steve@sxemacs.org>.
-       (tramp-append-tramp-buffers): Replace "sensible" by "sensitive" in
-       the hint.
-
-       * net/trampver.el: Update release number.
-
-2007-08-07  Tom Tromey  <tromey@redhat.com>
-
-       * progmodes/tcl.el (tcl-indent-level, tcl-continued-indent-level):
-       Add safe-local-variable property.
-
-2007-08-07  Chong Yidong  <cyd@stupidchicken.com>
-
-       * image-mode.el (image-toggle-display): Use image-refresh.
-
-       * longlines.el (longlines-decoded): New variable.
-       (longlines-mode): Avoid encoding or decoding the buffer twice.
-
-2007-08-07  Riccardo Murri  <riccardo.murri@gmail.com>
-
-       * vc-bzr.el: Remove comments about vc-bzr.el being a modified
-       unofficial version.
-       (vc-bzr-command): Remove redundant setting of process-connection-type.
-       (vc-bzr-admin-checkout-format-file): Add autoload.
-       (vc-bzr-root-dir): Remove in favor of vc-bzr-root.
-       (vc-bzr-root): Switch to implementation of vc-bzr-root-dir.
-       (vc-bzr-registered): Compare dirstate format tag with known good
-       value, abort parsing if match fails.  Warn user in docstring.
-       (vc-bzr-workfile-version): Case for different Bzr branch formats.
-       See bzrlib/branch.py in Bzr sources.
-       (vc-bzr-diff): First argument FILES may be a string rather than a list.
-       (vc-bzr-shell-command): Remove in favor of
-       vc-bzr-command-discarding-stderr.
-       (vc-bzr-command-discarding-stderr): New function.
-
-2007-08-06  Riccardo Murri  <riccardo.murri@gmail.com>
-
-       * vc-bzr.el (vc-bzr-registered): Gracefully handle missing "bzr"
-       program, and return nil
-       (vc-bzr-state): Gracefully handle missing "bzr" program, and return nil.
-       (vc-bzr-state): Look for path names relative to the repository
-       root after status keyword.
-       (vc-bzr-file-name-relative): New function.
-       (vc-bzr-admin-dirname): Reinstate, as other vc-bzr-admin-... paths
-       depend on it.
-       (vc-bzr-admin-dirname, ...-checkout-format-file)
-       (...-branch-format-file, ...-revhistory): Paths to some Bzr internal
-       files that we now parse directly for speed.
-       (vc-bzr-root-dir): Use `vc-bzr-admin-checkout-format-file' as witness.
-       (vc-bzr-registered): Only parse vc-bzr-admin-dirstate file if it exists.
-       (vc-bzr-state): "bzr status" successful only if exitcode is 0
-       (vc-bzr-root): Use `vc-bzr-shell-command'.  Stderr may contain
-       Bzr warnings, so we must discard it.
-       (vc-bzr-workfile-version): Speedup counting lines from
-       `vc-bzr-admin-revhistory' file, but fallback to spawning "bzr revno"
-       if that file doesn't exist.
-       (vc-bzr-responsible-p): Use `vc-bzr-root' instead of
-       `vc-bzr-root-dir' for speed.  Add `vc-bzr-admin-dirname'
-       (not ".bzr"!) to `vc-directory-exclusion-list'
-       (vc-bzr-shell-command): New function.
-
-2007-08-06  Tom Tromey  <tromey@redhat.com>
-
-       * diff-mode.el (diff-unified->context, diff-reverse-direction)
-       (diff-fixup-modifs): Typo in docstring.
-
-2007-08-06  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * emulation/tpu-edt.el (tpu-current-line): Use posn-at-point and
-       count-screen-lines.
-       (tpu-edt-off): Disable relevant pieces of advice.
-
-       * emulation/tpu-extras.el (tpu-before-save-hook): Rename from
-       tpu-write-file-hook.  Activate it with add-hook on buffer-save-hook.
-       (newline, newline-and-indent, do-auto-fill): Use advice instead of
-       redefining the function.
-       (tpu-set-scroll-margins): Activate the pieces of advice.
-
-2007-08-06  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/ange-ftp.el (ange-ftp-hook-function): Catch also errors in
-       process-filter.
-
-2007-08-06  Martin Rudalics  <rudalics@gmx.at>
-
-       * help.el (resize-temp-buffer-window): Use window-full-width-p
-       instead of comparing frame-width and window-width.
-
-2007-08-05  Peter Povinec  <ppovinec <at> yahoo.com> (tiny change)
-
-       * term.el: Honor term-default-fg-color and term-default-bg-color
-       settings when modifying term-current-face.
-       (term-default-fg-color, term-default-bg-color): Initialize from
-       default term-current-face.
-       (term-mode, term-reset-terminal): Set term-current-face with
-       term-default-fg-color and term-default-bg-color.
-       (term-handle-colors-array): term-current-face has term-default-fg-color
-       and term-default-bg-color after reset escape sequence.
-       (term-handle-colors-array): Set term-current-color with
-       term-default-fg/bg-color instead of ansi-term-color-vector when the
-       index (term-ansi-current-color or term-ansi-current-bg-color) is zero.
-
-2007-08-05  Michael Albinus  <michael.albinus@gmx.de>
-
-       * files.el (set-auto-mode): Handle also remote files wrt
-       `auto-mode-alist'.
-
-       * net/tramp.el (tramp-handle-file-remote-p): Return a string as
-       remote identification.
-
-2007-08-04  Glenn Morris  <rgm@gnu.org>
-
-       * autorevert.el (auto-revert-tail-mode): auto-revert-tail-pos is
-       zero, not nil, when the library is first loaded.  Check for a file
-       that has been modified on disk.
-
-       * progmodes/cperl-mode.el (cperl-compilation-error-regexp-alist):
-       Remove duplicate defvar preventing initialization.
-       (cperl-mode): Fix compilation-error-regexp-alist-alist setting.
-
-2007-08-03  Miles Bader  <miles@gnu.org>
-
-       * vc-hooks.el (vc-handled-backends): Change capitalization of VC
-       backend names for new backends to `Git', `Hg', and `Bzr'.
-       * vc-hg.el (vc-hg-dired-state-info): Use `Hg' as VC backend name,
-       not `HG'.
-       * vc-git.el (vc-git-dired-state-info): Use `Git' as VC backend
-       name, not `GIT'.
-       * vc-bzr.el (vc-bzr-dir-state, vc-bzr-dired-state-info)
-       (vc-bzr-unload-hook): Use `Bzr' as VC backend name, not `BZR'.
-
-2007-08-03  Glenn Morris  <rgm@gnu.org>
-
-       * net/telnet.el (telnet-mode): Set comint-use-prompt-regexp to t.
-
-2007-08-02  Richard Stallman  <rms@gnu.org>
-
-       * mail/rmailsum.el (rmail-make-summary-line): Find end of msg number
-       to update deleted flag.
-
-       * cus-edit.el (customize-apropos, customize-apropos-options)
-       (customize-apropos-faces, customize-apropos-groups): Improve prompt.
-
-       * menu-bar.el (menu-bar-help-menu): Add "About GNU" menu item.
-
-       * startup.el (fancy-splash-head, startup-echo-area-message):
-       Change message text.
-
-       * emulation/tpu-edt.el (next-line-internal): Setting deleted.
-       All callers use line-move.
-
-       * progmodes/compile.el (compilation-find-buffer): Return current
-       buffer immediately if suitable.
-       (compile, compilation-buffer-name, compilation-start): Doc fixes.
-
-2007-08-02  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * vc-bzr.el (vc-bzr-admin-dirstate): Rename from `...-dirname'.
-       Make it more discriminating and more useful.
-       (vc-bzr-root-dir): Use new name.
-       (vc-bzr-registered): Use new name and look at the dirstate file to
-       determine if it's registered or not without running `bzr'.
-
-2007-08-01  Eric Hanchrow  <offby1@blarg.net>  (tiny change)
-
-       * ibuf-ext.el (ibuffer-mark-old-buffers): Docstring fix.
-
-2007-07-31  Drew Adams  <drew.adams@oracle.com>
-
-       * cus-edit.el (custom-group-value-create, custom-goto-parent):
-       Fix parent groups link.
-
-2007-07-31  Daiki Ueno  <ueno@unixuser.org>
-
-       * faces.el (face-normalize-spec): New function.
-       (frame-set-background-mode): Normalize face-spec before calling
-       face-spec-match-p.
-
-2007-07-31  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * vc-bzr.el: New file (copied from the trunk).
-
-       * vc-hooks.el (vc-handled-backends): Add BZR.
-       (vc-find-file-hook): Failsafe if the backend's `registered'
-       function burps.
-
-       * server.el (server-window): Add switch-to-buffer-other-frame option.
-
-2007-07-30  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * vc-git.el (vc-directory-exclusion-list, vc-handled-backends): Remove.
-       (vc-git-revision-completion-table): Enable.
-
-       * vc-hooks.el (vc-handled-backends): Add GIT and HG.
-
-       * vc.el (vc-directory-exclusion-list): Add .git and .hg.
-
-       * vc-hg.el (vc-hg-revision-completion-table): Re-enable.
-       (vc-hg-registered): Set the vc-state property.
-
-       * diff-mode.el (diff-mode-menu): New entries.
-
-2007-06-30  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * diff-mode.el (diff-beginning-of-file-and-junk): New function.
-       (diff-file-kill): Use it.
-       (diff-beginning-of-hunk): Add arg `try-harder' using it.
-       (diff-restrict-view, diff-find-source-location, diff-refine-hunk):
-       Use it so they find the hunk even when we're in the file header.
-
-       * vc.el: Add new VC operation `revision-completion-table'.
-       (vc-default-revision-completion-table): New function.
-       (vc-version-diff, vc-version-other-window): Use it to provide
-       completion of revision names if the backend provides it.
-
-       * vc-arch.el (vc-arch--version-completion-table)
-       (vc-arch-revision-completion-table): New functions to provide
-       completion of revision names.
-
-       * vc-cvs.el: Require CL.
-       (vc-cvs-revision-table, vc-cvs-revision-completion-table):
-       New functions to provide completion of revision names.
-
-2007-07-29  Kimit Yada  <kimitto@gmail.com>  (tiny change)
-
-       * emacs-lisp/copyright.el (copyright-update-year, copyright-update)
-       (copyright-fix-years, copyright): Correctly handle the case where
-       copyright-limit is nil.
-
-2007-07-28  Konstantin Novitsky  <knovitsk@Bear.com>  (tiny change)
-
-       * progmodes/python.el (run-python): Fix path separator under w32.
-
-2007-07-28  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * vc-git.el: New File.
-
-2007-07-28  Alan Mackenzie  <acm@muc.de>
-
-       Fix problem with modes derived from CC Mode:
-       * progmodes/cc-mode.el (c-make-emacs-variables-local): Move this
-       macro to cc-langs.
-       (c-init-language-vars-for): Remove call to above macro.
-       * progmodes/cc-langs.el (c-make-emacs-variables-local): Macro has
-       been moved to here.
-       (c-make-init-lang-vars-fun): Call c-make-emacs-variables-local.
-
-2007-07-28  Eli Zaretskii  <eliz@gnu.org>
-
-       * net/trampver.el: Fix the `coding' cookie.
-
-2007-07-25  Nick Roberts  <nickrob@snap.net.nz>
-
-       * add-log.el (change-log-redate): Remove (not needed anymore and
-       doesn't appear to work).
-
-2007-07-25  Glenn Morris  <rgm@gnu.org>
-
-       * Relicense all FSF files to GPLv3 or later.
-
-       * COPYING: Switch to GPLv3.
-
-2007-07-25  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * pcvs.el (cvs-temp-buffer): Undo last ill-conceived change.
-       Replace it with another one which disables undo before calling
-       erase-buffer and then turns it back on if needed.
-
-2007-07-24  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
-
-       * ps-print.el: Problem with foreground and background color when
-       printing a buffer with and without faces.  Reported by Christian
-       Schlauer <cs-muelleimer-rubbish.bin@arcor.de>.
-       (ps-print-version): New version 6.7.5.
-       (ps-default-fg): Change default value to nil, so black color is used
-       when a face does not specify a foreground color.
-       (ps-default-bg): Change default value to nil, so white color is used
-       for background color.
-       (ps-begin-job): Fix code.
-
-2007-07-24  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * vc-hg.el (vc-hg-revision-completion-table): Temporarily comment out.
-
-2007-07-24  Alan Mackenzie  <acm@muc.de>
-
-       * emacs-lisp/bytecomp.el (byte-compile-from-buffer):
-       Initialise byte-compile-unresolved-functions before rather than
-       after a compilation.
-       (byte-compile-unresolved-functions): Amplify doc string.
-
-2007-07-24  Glenn Morris  <rgm@gnu.org>
-
-       * calendar/cal-tex.el (cal-tex-holidays, cal-tex-diary)
-       (cal-tex-rules, cal-tex-buffer, cal-tex-24)
-       (cal-tex-cursor-month-landscape, cal-tex-cursor-month)
-       (cal-tex-cursor-week, cal-tex-cursor-week2)
-       (cal-tex-cursor-week-iso, cal-tex-week-hours)
-       (cal-tex-cursor-week-monday, cal-tex-weekly4-box)
-       (cal-tex-cursor-filofax-2week, cal-tex-cursor-filofax-week)
-       (cal-tex-cursor-filofax-daily, cal-tex-daily-page): Doc fix.
-
-2007-07-24  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * pcvs.el (cvs-temp-buffer): Disable undo in temp buffers.
-
-2007-07-23  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * ses.el (ses-cleanup): Prevent Emacs from spuriously checking if the
-       underlying file is uptodate.
-
-2007-07-23  Richard Stallman  <rms@gnu.org>
-
-       * progmodes/octave-inf.el (inferior-octave-prompt): Accept .exe.
-
-2007-07-23  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/sh-script.el (sh-font-lock-backslash-quote)
-       (sh-font-lock-flush-syntax-ppss-cache): New funs.
-       (sh-font-lock-syntactic-keywords): Use them to distinguish the
-       different possible cases for \'.
-       (sh-font-lock-paren): Mark the relevant text with font-lock-multiline.
-
-       * vc-hooks.el (vc-find-root): Walk up the tree to find an existing
-       `file' from which to start the search and fix case where `file' is the
-       current directory and the root as well.
-
-       * pcvs.el (cvs-mode-add-change-log-entry-other-window): Use a directory
-       name for buffer-file-name if it refers to a directory.
-
-2007-07-22  Jason Rumney  <jasonr@gnu.org>
-
-       * w32-fns.el (set-default-process-coding-system): Use dos line ends
-       for input to cmdproxy on all versions of Windows.
-       Use dos line ends for input to plink.
-
-       * comint.el (comint-simple-send): Concat newline before sending.
-       (comint-password-prompt-regexp): Recognize plink's passphrase prompt.
-
-2007-07-22  Juri Linkov  <juri@jurta.org>
-
-       * isearch.el (isearch-edit-string): Save old point and
-       isearch-other-end to old-point and old-other-end before reading
-       the search string from minibuffer.  After exiting minibuffer set
-       point to old-other-end if point and the search direction is the
-       same as before reading the search string.
-       (isearch-del-char): Don't set isearch-yank-flag to t.  Put point
-       to isearch-other-end.  Instead of isearch-search-and-update call
-       three functions isearch-search, isearch-push-state and isearch-update.
-
-2007-07-22  Ralf Angeli  <angeli@caeruleus.net>
-
-       * textmodes/reftex.el (reftex-access-parse-file): Do not risk
-       destroying an existing buffer.
-
-2007-07-22  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * startup.el (command-line-x-option-alist): Use x-handle-no-bitmap-icon.
-
-       * term/x-win.el (x-handle-no-bitmap-icon): New function.
-
-2007-07-22  Ralf Angeli  <angeli@caeruleus.net>
-
-       * textmodes/reftex.el (reftex-access-parse-file): Create parse
-       file in a way that does not interfere with recentf.
-
-2007-07-21  Thien-Thi Nguyen  <ttn@gnuvola.org>
-
-       * image-dired.el (image-dired-sane-db-file): New func.
-       (image-dired-write-tags, image-dired-remove-tag)
-       (image-dired-list-tags, image-dired-write-comments)
-       (image-dired-get-comment, image-dired-mark-tagged-files)
-       (image-dired-create-gallery-lists): Call new func.
-       Reported by Dieter Wilhelm <dieter@duenenhof-wilhelm.de>.
-
-2007-07-21  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * vc-hg.el (vc-hg-diff): Use vc-hg-command.
-       (vc-hg-dir-state): Fix loop.
-       (vc-hg-print-log): Fix expected return value for vc-hg-command.
-       (vc-hg-next-version, vc-hg-delete-file, vc-hg-rename-file)
-       (vc-hg-register, vc-hg-create-repo, vc-hg-checkin)
-       (vc-hg-revert): Likewise.
-       (vc-hg-revision-table, vc-hg-revision-completion-table): New functions.
-
-2007-07-21  Thien-Thi Nguyen  <ttn@gnuvola.org>
-
-       * emacs-lisp/lisp-mode.el (calculate-lisp-indent): In the
-       case of alignment under a constant symbol, find and consider
-       the sexp actually at indentation to be the "last sexp".
-
-2007-07-20  Eli Zaretskii  <eliz@gnu.org>
-
-       * makefile.w32-in (install-lisp-SH, install-lisp-CMD): New targets.
-       (install): Use them to copy all *.el files before *.elc.
-       (clean): Don't delete *~.
-
-2007-07-20  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * vc-hg.el (vc-hg-workfile-unchanged-p): New function.
-
-2007-07-19  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * vc-hg.el (vc-hg-registered): Replace if with when.
-       (vc-hg-state): Deal with nonexistent files.
-
-2007-07-18  Juanma Barranquero  <lekktu@gmail.com>
-
-       * follow.el (follow-mode-hook, follow-mode-off-hook, follow-mode)
-       (follow-delete-other-windows-and-split, follow-recenter)
-       (follow-windows-aligned-p, follow-point-visible-all-windows-p)
-       (follow-redisplay, follow-estimate-first-window-start)
-       (follow-xemacs-scrollbar-support, follow-intercept-process-output):
-       Fix typos in docstrings.
-
-2007-07-17  Thien-Thi Nguyen  <ttn@gnuvola.org>
-
-       * bookmark.el (bookmark-show-all-annotations):
-       Make sure each inserted annotation ends with newline.
-
-       (bookmark-maybe-sort-alist): Don't modify
-       bookmark-alist.  Instead, if not sorting, simply return it.
-       (bookmark-bmenu-list): Call bookmark-maybe-sort-alist
-       for its return value, not for its side effect.
-
-2007-07-17  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * vc.el: Add more info about the vc-registered function.
-
-2007-07-16  David Kastrup  <dak@gnu.org>
-
-       * emacs-lisp/advice.el (defadvice): Doc fix.
-
-2007-07-16  Juanma Barranquero  <lekktu@gmail.com>
-
-       * subr.el (when, unless): Doc fix.
-
-2007-07-16  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * vc-hg.el (vc-hg-state): Handle removed files.
-       (vc-hg-dir-state, vc-hg-dired-state-info): New functions.
-       (vc-hg-checkout): Re-enable.
-
-2007-07-15  Richard Stallman  <rms@gnu.org>
-
-       * kmacro.el (kmacro-bind-to-key): Avoid comparisons on function keys.
-
-       * tutorial.el (tutorial--find-changed-keys):
-       Handle C-x specially like ESC.
-
-2007-07-15  Roland McGrath  <roland@frob.com>
-
-       * add-log.el (add-change-log-entry): Check add-log-full-name
-       and add-log-mailing-address later, after change-log-mode-hook.
-
-2007-07-15  Richard Stallman  <rms@gnu.org>
-
-       * isearch.el (isearch-mode, isearch-done):
-       Delete unintended code in previous change.
-
-       * ps-print.el (ps-default-bg): Change to White.
-
-2007-07-15  Aaron Hawley  <aaronh@garden.org>
-
-       * tar-mode.el (tar-get-descriptor): No error for zero-length file.
-
-2007-07-15  Martin Rudalics  <rudalics@gmx.at>
-
-       * mouse.el (mouse-drag-track): Reset transient-mark-mode to nil
-       when handling the terminating event.
-
-2007-07-15  Jeff Miller  <jmiller@cablespeed.com>  (tiny change)
-
-       * calendar/calendar.el (calendar-goto-bahai-date): Autoload it.
-
-2007-07-13  Eli Zaretskii  <eliz@gnu.org>
-
-       * makefile.w32-in (install-lisp-SH, install-lisp-CMD): New targets.
-       (install): Use them to copy all *.el files before *.elc.
-
-2007-07-13  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * replace.el (match): Use yellow1 instead of yellow.
-
-       * progmodes/gdb-ui.el (breakpoint-enabled): Use red1 instead of red.
-
-       * pcvs-info.el (cvs-unknown): Likewise.
-
-2007-07-12  Davis Herring  <herring@lanl.gov>
-
-       * desktop.el (desktop-buffer-info, desktop-save):
-       Use `desktop-dirname' instead of `dirname'.
-
-2007-07-10  Jim Meyering  <jim@meyering.net>  (tiny change)
-
-       * emacs-lisp/copyright.el (copyright-current-gpl-version): Set to 3.
-
-       * autoinsert.el (auto-insert-alist): s/2/3/ in the generated comment.
-
-2007-07-10  Richard Stallman  <rms@gnu.org>
-
-       * emacs-lisp/lisp-mode.el (eval-defun):
-       Explain special handling of `defface'.
-
-2007-07-09  Richard Stallman  <rms@gnu.org>
-
-       * isearch.el (isearch-edit-string): Call to isearch-push-state
-       after the search.
-
-2007-07-08  Katsumi Yamaoka  <yamaoka@jpl.org>
-
-       * cus-start.el (file-coding-system-alist): Fix custom type.
-
-2007-07-08  Chong Yidong  <cyd@stupidchicken.com>
-
-       * longlines.el (longlines-wrap-region): Avoid marking buffer as
-       modified.
-       (longlines-auto-wrap, longlines-window-change-function):
-       Remove unnecessary calls to set-buffer-modified-p.
-
-2007-06-20  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * vc.el (vc-default-log-view-mode): New function.
-       (vc-print-log): Add new `log-view-mode' VC operation.
-
-2007-07-08  Nick Roberts  <nickrob@snap.net.nz>
-
-       * pcvs-util.el (cvs-strings->string, cvs-string->strings):
-       Rename and move to...
-
-       * subr.el (strings->string, string->strings): ...here.
-
-       * pcvs.el (cvs-reread-cvsrc, cvs-header-msg, cvs-checkout)
-       (cvs-mode-checkout, cvs-execute-single-file): Use new function names.
-
-       * progmodes/gud.el (gud-common-init): Call string->strings instead
-       of split-string.
-
-2007-07-07  Eli Zaretskii  <eliz@gnu.org>
-
-       * term/w32-win.el (menu-bar-open): New function.
-       Bind <f10> to it.
-
-2007-07-07  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * log-view.el (log-view-mode-menu): New menu.
-
-2007-07-06  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * vc-hg.el: New file.
-
-2007-07-06  Andreas Schwab  <schwab@suse.de>
-
-       * emacs-lisp/lisp-mode.el (eval-last-sexp): Avoid introducing any
-       dynamic bindings around the evaluation of the expression.
-       Reported by Jay Belanger <jay.p.belanger@gmail.com>.
-
-2007-07-03  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * progmodes/gud.el (auto-mode-alist): Match more valid gdb init
-       file names.
-
-2007-07-02  Martin Rudalics  <rudalics@gmx.at>
-
-       * help-mode.el (help-make-xrefs): Skip spaces too when skipping tabs.
-
-       * mouse.el (mouse-drag-mode-line-1): Quit mouse tracking when
-       event is not a cons cell.  Do not unread drag-mouse-1 events.
-       Select right window in check whether space was stolen from
-       window above.
-
-2007-07-01  Richard Stallman  <rms@gnu.org>
-
-       * files.el (find-file-visit-truename): Fix safe-local-variable value.
-
-2007-06-29  Juanma Barranquero  <lekktu@gmail.com>
-
-       * generic-x.el (generic-define-mswindows-modes)
-       (generic-define-unix-modes, apache-log-generic-mode)
-       (bat-generic-mode-keymap, java-manifest-generic-mode)
-       (show-tabs-generic-mode): Fix typos in docstrings.
-
-2007-06-28  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * dnd.el (dnd-get-local-file-name): Set fixcase to t in call to
-       replace-regexp-in-string.
-
-2007-06-28  Andreas Schwab  <schwab@suse.de>
-
-       * Makefile.in ($(lisp)/mh-e/mh-loaddefs.el): Depend on
-       $(lisp)/subdirs.el.
-
-2007-06-28  Juanma Barranquero  <lekktu@gmail.com>
-
-       * speedbar.el (speedbar-handle-delete-frame): Don't try to delete
-       the speedbar frame if nil; that deletes the current frame or
-       causes an error if it is the only frame.
-       Reported by Angelo Graziosi <Angelo.Graziosi@roma1.infn.it>.
-
-2007-06-24  Juanma Barranquero  <lekktu@gmail.com>
-
-       * desktop.el (desktop-read): Run `desktop-not-loaded-hook' in the
-       directory where the desktop file was found, as the docstring says.
-       (desktop-kill): Use `read-directory-name'.
-
-       * desktop.el (desktop-load-locked-desktop): New option.
-       (desktop-read): Use it.
-       (desktop-truncate, desktop-outvar, desktop-restore-file-buffer):
-       Use `when'.
-
-2007-06-24  Davis Herring  <herring@lanl.gov>
-
-       * desktop.el (desktop-save-mode-off): New function.
-       (desktop-base-lock-name, desktop-not-loaded-hook): New variables.
-       (desktop-full-lock-name, desktop-file-modtime, desktop-owner)
-       (desktop-claim-lock, desktop-release-lock): New functions.
-       (desktop-kill): Tell `desktop-save' that this is the last save.
-       Release the lock afterwards.
-       (desktop-buffer-info): New function.
-       (desktop-save): Use it.  Run `desktop-save-hook' where the doc
-       says to.  Detect conflicts, and manage the lock.
-       (desktop-read): Detect conflicts.  Manage the lock.
-
-2007-06-23  Eli Zaretskii  <eliz@gnu.org>
-
-       * ls-lisp.el (insert-directory): If an invalid regexp error is
-       thrown, try using FILE as a literal file name, not a wildcard.
-       Check for FILE as an existing file, not just a directory.
-
-2007-06-23  Juanma Barranquero  <lekktu@gmail.com>
-
-       * ruler-mode.el (ruler-mode): Prevent clobbering the original
-       `header-line-format' when reentering ruler mode.
-
-2007-06-23  Eli Zaretskii  <eliz@gnu.org>
-
-       * ls-lisp.el (insert-directory): Don't treat FILE as a wildcard if
-       FILE exists as a directory.
-
-2007-06-21  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * vera-mode.el (vera-mode): Fix `commend-end-skip' setting.
-       (vera-font-lock-match-item): Fix doc string.
-       (vera-in-comment-p): Remove unused function.
-       (vera-skip-forward-literal, vera-skip-backward-literal): Improve code,
-       use `syntax-ppss'.
-       (vera-forward-syntactic-ws): Fix argument order.
-       (vera-prepare-search): Use `with-syntax-table'.
-       (vera-indent-line): Fix doc string.
-       (vera-electric-tab): Fix doc string.
-       (vera-expand-abbrev): Define alias instead of using `fset'.
-       (vera-comment-uncomment-region): Use `comment-start-skip'.
-
-2007-06-20  Reto Zimmermann  <reto@gnu.org>
-
-       * progmodes/vera-mode.el: New file.
-
-2007-06-20  Juanma Barranquero  <lekktu@gmail.com>
-
-       * ido.el (ido-find-file-in-dir): Don't signal an error for
-       empty directories.
-
-2007-06-18  Alan Mackenzie  <acm@muc.de>
-
-       * progmodes/cc-mode.el (c-remove-any-local-eval-or-mode-variables):
-       When removing lines, also remove the \n.  Correction of patch of
-       2007-04-21.
-
-2007-06-17  Glenn Morris  <rgm@gnu.org>
-
-       * lpr.el (lpr-page-header-switches): Move %s to separate element
-       for correct quoting.  Doc fix.
-
-2007-06-13  Johan Bockg\e,Ae\e(Brd  <bojohan@dd.chalmers.se>  (tiny change)
-
-       * term/xterm.el (terminal-init-xterm): Escape parens in character
-       constants.
-
-2007-06-12  Ralf Angeli  <angeli@caeruleus.net>
-
-       * scroll-lock.el (scroll-lock-mode): Doc fix.
-
-2007-06-11  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * font-lock.el (font-lock-add-keywords): In case font-lock was only
-       half-activated, forcefully activate it completely.
-
-2007-06-11  Richard Stallman  <rms@gnu.org>
-
-       * cus-edit.el (custom-variable-type): Doc fix.
-
-2007-06-09  Alfred M. Szmidt  <ams@gnu.org>  (tiny change)
-
-       * mail/rmail.el (rmail-movemail-variant-in-use): Fix doc typo.
-
-2007-06-09  Davis Herring  <herring@lanl.gov>
-
-       * desktop.el (desktop-minor-mode-table): Doc fix.
-
-2007-06-08  Chong Yidong  <cyd@stupidchicken.com>
-
-       * image-mode.el (image-forward-hscroll, image-backward-hscroll)
-       (image-next-line, image-previous-line, image-scroll-up)
-       (image-scroll-down, image-bol, image-eol, image-bob, image-eob):
-       New functions.
-       (image-mode-map): Remap motion commands.
-       (image-mode-text-map): New keymap for viewing images as text.
-       (image-mode): Use image-mode-map.
-       (image-toggle-display): Toggle auto-hscroll-mode and mode keymaps.
-
-2007-06-07  Michael Albinus  <michael.albinus@gmx.de>
-
-       Sync with Tramp 2.0.56.
-
-       * net/tramp.el:
-       * net/tramp-ftp.el:
-       * net/tramp-smb.el:
-       * net/tramp-util.el:
-       * net/tramp-vc.el:
-       Don't load cl.el, because that pollutes the namespace.  Replace cl
-       macros by their implementations where necessary.  Requested by
-       Richard Stallman <rms@gnu.org>.
-
-       * net/tramp.el (top): Make `set-buffer-multibyte' an alias if it
-       doesn't exist.
-       (with-parsed-tramp-file-name): Protect debug spec during compilation.
-       (tramp-handle-insert-directory): Check (featurep 'ls-lisp).
-       (tramp-file-name-p, tramp-file-name-multi-method)
-       (tramp-file-name-method, tramp-file-name-user)
-       (tramp-file-name-host, tramp-file-name-localname): New defuns,
-       replacing defstruct `tramp-file-name'.
-       (tramp-handle-file-remote-p, tramp-completion-dissect-file-name1)
-       (tramp-dissect-file-name, tramp-dissect-multi-file-name):
-       Apply `vector' instead of `make-tramp-file-name'.
-       (tramp-handle-make-auto-save-file-name):
-       Apply `tramp-temporary-file-directory' for compatibility reasons.
-       (tramp-completion-mode): Use `natnump' instead of `wholenump'
-       because of XEmacs.
-       (tramp-completion-mode): `last-input-event' is nil when XEmacs is
-       started.
-
-2007-06-07  David Kastrup  <dak@gnu.org>
-
-       * dired.el (dired-recursive-deletes, dired-recursive-copies):
-       Change default to `top'.
-
-2007-06-07  Chong Yidong  <cyd@stupidchicken.com>
-
-       * dired.el (dired-mode-map): Remove spurious separator.
-
-2007-06-07  Juanma Barranquero  <lekktu@gmail.com>
-
-       * progmodes/ebrowse.el (ebrowse-draw-file-member-info): Doc fix.
-
-       * progmodes/mixal-mode.el (mixal-operation-codes-alist):
-       * progmodes/idlwave.el (idlwave-one-key-select): Fix typo in docstring.
-
-2007-06-07  Alfred M. Szmidt  <ams@gnu.org>  (tiny change)
-
-       * mail/rmailsum.el (rmail-summary-save-buffer): New command.
-       (rmail-summary-mode-map): Add rmail-summary-save-buffer.
-
-2007-06-07  Juanma Barranquero  <lekktu@gmail.com>
-
-       * progmodes/ebrowse.el (ebrowse-member-table):
-       * textmodes/org.el (org-export-ascii-bullets): Fix typos in docstrings.
-
-2007-06-06  Juanma Barranquero  <lekktu@gmail.com>
-
-       * pgg.el (pgg-sign-region, pgg-sign):
-       * ses.el (ses-call-printer):
-       * calendar/icalendar.el (icalendar--diarytime-to-isotime):
-       * textmodes/org.el (org-cycle): Fix typos in docstrings.
-
-2007-06-06  Eli Zaretskii  <eliz@gnu.org>
-
-       * tar-mode.el (tar-header-block-summarize, tar-summarize-buffer)
-       (tar-get-descriptor): Handle type 55, an extended pax header.
-
-2007-06-06  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * textmodes/css-mode.el: New file.
-
-2007-06-06  Michael Albinus  <michael.albinus@gmx.de>
-
-       * net/socks.el: New file, taken from w3 repository.
-       (top): Update Copyright.  Don't load cl.el.
-       (all): Replace `case' by `cond', `string-to-int' by
-       `string-to-number', and `process-kill-without-query' by
-       `set-process-query-on-exit-flag'.
-       (socks-char-int): Remove defalias and all occurrences.
-
-2007-06-06  Juanma Barranquero  <lekktu@gmail.com>
-
-       * international/mule-cmds.el (toggle-enable-multibyte-characters)
-       (sort-coding-systems, search-unencodable-char): Doc fixes.
-       (coding-system-change-eol-conversion, set-default-coding-systems)
-       (prefer-coding-system, find-multibyte-characters, princ-list)
-       (leim-list-entry-regexp, set-input-method, locale-language-names)
-       (input-method-exit-on-first-char, exit-language-environment-hook)
-       (locale-charset-language-names): Fix typos in docstrings.
-
-2007-06-05  Juanma Barranquero  <lekktu@gmail.com>
-
-       * bs.el (bs-cycle-previous): Don't modify the cycle list until
-       `switch-to-buffer' has returned succesfully.
-       (bs-cycle-next): Ditto.  Also, don't bury the buffer when the
-       window is dedicated (it could iconify the frame).
-
-2007-06-05  Glenn Morris  <rgm@gnu.org>
-
-       * files.el (auto-mode-alist): Open `.asd' files in lisp-mode.
-
-2007-06-05  Chong Yidong  <cyd@stupidchicken.com>
-
-       * files.el (auto-mode-alist): Add lower-priority match for names
-       like ChangeLog.old.
-
-2007-06-04  Andreas Schwab  <schwab@suse.de>
-
-       * emacs-lisp/sregex.el (sregexq): Fix doc string quoting.
-
-2007-06-04  Davis Herring  <herring@lanl.gov>
-
-       * calendar/timeclock.el: Update version number.
-       (timeclock-modeline-display): Mention timeclock-use-display-time
-       in explanatory message.
-       (timeclock-log): Suppress warnings when finding the log.
-       Don't check for a nil project twice.  Run hooks after killing the
-       buffer (if applicable).
-       (timeclock-geometric-mean): Rename to `timeclock-mean' (it never
-       was geometric).  All uses changed.
-       (timeclock-generate-report): Support prefix argument.
-
-2007-06-04  Micha\e,Ak\e(Bl Cadilhac  <michael@cadilhac.name>
-
-       * man.el (Man-next-section): Don't consider the last line of the
-       page as being part of any section.
-
-2007-06-04  Martin Rudalics  <rudalics@gmx.at>
-
-       * hilit-chg.el (highlight-changes-rotate-faces): Don't set
-       modified flag of buffer.  Use `inhibit-modification-hooks'.
-
-2007-06-04  Katsumi Yamaoka  <yamaoka@jpl.org>
-
-       * mail/mail-extr.el (mail-extract-address-components):
-       Recognize non-ASCII characters except for NBSP as words.
-
-2007-06-04  Ryan Yeske  <rcyeske@gmail.com>
-
-       * net/webjump.el (webjump-sample-sites): Add Wikipedia query.
-
-2007-06-04  Michael Olson  <mwolson@gnu.org>
-
-       * emacs-lisp/tq.el (tq-queue-pop): Stifle error when a process has
-       died and we are trying to send a signal to it.
-
-2007-06-04  Juanma Barranquero  <lekktu@gmail.com>
-
-       * emacs-lisp/easy-mmode.el (define-minor-mode)
-       (easy-mmode-define-navigation): Fix typos in docstrings.
-
-       * progmodes/compile.el (compilation-find-file, compilation-handle-exit):
-       Fix typos in docstrings.
-       (compilation-search-path, compilation-buffer-name-function): Doc fixes.
-       (compilation-finish-function): Fix typo in obsolescence declaration.
-
-       * progmodes/idlwave.el (idlwave-routines): Fix typo in docstring.
-
-2007-06-04  Chong Yidong  <cyd@stupidchicken.com>
-
-       * files.el (magic-mode-alist): Remove image-type-auto-detected-p.
-       (magic-fallback-mode-alist): Add image-type-auto-detected-p.
-
-       * image.el (image-type-auto-detected-p): Don't scan auto-mode-alist.
-
-       * longlines.el (longlines-mode): Make longlines-auto-wrap
-       buffer-local.  Add hooks unconditionally.
-       (longlines-auto-wrap): Toggle wrapping.
-       (longlines-after-change-function)
-       (longlines-post-command-function): Check longlines-auto-wrap.
-
-2007-06-02  Chong Yidong  <cyd@stupidchicken.com>
-
-       * Version 22.1 released.
-
-2007-06-01  Chong Yidong  <cyd@stupidchicken.com>
-
-       * paren.el (show-paren-function): Undo 2007-04-19 and 2007-04-20
-       changes.
-
-2007-05-31  Richard Stallman  <rms@gnu.org>
-
-       * dired.el (dired-do-delete, dired-do-flagged-delete): Doc fixes.
-
-2007-05-29  Martin Rudalics  <rudalics@gmx.at>
-
-       * textmodes/table.el (table--point-entered-cell-function)
-       (table--point-left-cell-function):
-       Bind `inhibit-point-motion-hooks' to t.
-
-2007-05-29  Nikolaj Schumacher  <n_schumacher@web.de>  (tiny change)
-
-       * emacs-lisp/rx.el (rx): Doc fix.
-
-2007-05-28  Chong Yidong  <cyd@stupidchicken.com>
-
-       * textmodes/sgml-mode.el (sgml-point-entered): Use condition-case.
-
-2007-05-27  Tetsurou Okazaki  <okazaki@be.to>  (tiny change)
-
-       * log-edit.el (log-edit-changelog-paragraph): Return point-max
-       as the end of the ChangeLog paragraph when it ends without a line
-       termination.
-
-2007-05-25  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * textmodes/fill.el (canonically-space-region): Make the second arg
-       a marker if it's not already the case.
-
-       * xt-mouse.el (xterm-mouse-truncate-wrap): New function.
-       (xterm-mouse-event): Use it.
-
-2007-05-25  Miles Bader  <miles@fencepost.gnu.org>
-
-       * vc-hooks.el (vc-find-root): Fix file attribute test.
-
-2007-05-24  Richard Stallman  <rms@gnu.org>
-
-       * textmodes/flyspell.el (flyspell-correct-word-before-point):
-       Don't let opoint be nil.
-       (flyspell-emacs-popup): Explicit error if no dialogs.
-
-2007-05-23  Eli Zaretskii  <eliz@gnu.org>
-
-       * tar-mode.el (tar-file-name-handler): New function.
-       (tar-extract): Bind file-name-handler-alist to it to force
-       find-buffer-file-type-coding-system behave as if the file being
-       extracted existed.  Use last-coding-system-used to force
-       buffer-file-coding-system to what decode-coding-region actually
-       used to decode the file.
-
-2007-05-23  Nikolaj Schumacher  <n_schumacher@web.de>  (tiny change)
-
-       * progmodes/compile.el (compilation-handle-exit):
-       `compilation-finish-function' may change the current buffer.
-
-2007-05-22  Richard Stallman  <rms@gnu.org>
-
-       * files.el (set-auto-mode): Doc fix.
-
-2007-05-22  Eli Zaretskii  <eliz@gnu.org>
-
-       * dos-w32.el (find-buffer-file-type-coding-system): Doc fix.
-
-2007-05-21  Trent Buck  <trentbuck@gmail.com>  (tiny change)
-
-       * net/rcirc.el (rcirc-fill-column): Allow `window-width'.
-       (rcirc-print): Handle `window-width'.
-       (rcirc-buffer-maximum-lines): Doc fix.
-
-2007-05-19  Kevin Ryde  <user42@zip.com.au>
-
-       * info.el (Info-fontify-node): Match https also.
-
-2007-05-18  Richard Stallman  <rms@gnu.org>
-
-       * simple.el (push-mark): Doc fix.
-
-2007-05-18  Rob Riepel  <riepel@Stanford.EDU>
-
-       * emulation/tpu-edt.el (CSI-map, SS3-map): Move from global-map to
-       tpu-global-map.
-       (tpu-original-global-map): Delete variable.
-       (tpu-control-keys-map): New keymap variable.
-       (tpu-set-control-keys): Use tpu-reset-control-keys rather than
-       setting keymapping directly.
-       (tpu-reset-control-keys): Use tpu-control-keys-map instead of
-       tpu-global-map.
-       (tpu-edt-on): Activate the tpu-global-map.
-       (tpu-edt-off): Deactivate the tpu-global-map.
-
-2007-05-18  Ryan Yeske  <rcyeske@gmail.com>
-
-       * textmodes/ispell.el (ispell-get-word): Return markers
-       for start and end positions.
-       (ispell-word): Assume END is a marker.
-
-2007-05-17  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
-
-       * ps-print.el: Use default color when foreground or background color
-       are unspecified.  Reported by Leo <sdl.web@gmail.com>.
-       (ps-print-version): New version 6.7.4.
-       (ps-rgb-color): New argument.  Use default color when color is
-       unspecified.
-       (ps-begin-job): Fix code.
-
-2007-05-17  Martin Rudalics  <rudalics@gmx.at>
-
-       * textmodes/ispell.el (ispell-start-process): Defend against bad
-       default-directory.
-
-2007-05-17  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * vc-hooks.el (vc-find-root): Stop searching when the user changes.
-
-2007-05-16  Richard Stallman  <rms@gnu.org>
-
-       * buff-menu.el (Buffer-menu-sort-column): Doc fix.
-
-2007-05-16  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * files.el (magic-mode-alist, magic-fallback-mode-alist):
-       Move the *ml, Postscript, and XmCD entries to the fallback part.
-
-       * files.el (magic-fallback-mode-alist):
-       Rename from file-start-mode-alist.
-
-2007-05-16  Nikolaj Schumacher  <n_schumacher@web.de>  (tiny change)
-
-       * progmodes/compile.el (compilation-handle-exit): Quote first
-       argument of `run-hook-with-args'.
-
-2007-05-16  Juanma Barranquero  <lekktu@gmail.com>
-
-       * buff-menu.el (Buffer-menu-sort-column):
-       * dabbrev.el (dabbrev-upcase-means-case-search):
-       * dired.el (dired-recursive-deletes, dired-recursive-copies):
-       * info.el (Info-current-subfile):
-       * ls-lisp.el (ls-lisp-verbosity):
-       * msb.el (msb-menu-cond):
-       * pcvs.el (cvs-dired-use-hook):
-       * simple.el (set-mark-command-repeat-pop):
-       * time.el (display-time-24hr-format, display-time-mail-file):
-       Doc fixes.
-
-       * tutorial.el (get-lang-string, tutorial--find-changed-keys):
-       * printing.el (pr-ps-fast-fire): Fix typos in docstrings.
-
-       * view.el (view-inhibit-help-message): Fix typo in docstring.
-       (view-scroll-auto-exit, view-try-extend-at-buffer-end): Doc fixes.
-
-2007-05-14  Eli Zaretskii  <eliz@gnu.org>
-
-       * mail/rmail.el (rmail-convert-to-babyl-format):
-       Check content-transfer-encoding _last_, because we need its position
-       in base64-header-field-end.
-
-2007-05-14  Juanma Barranquero  <lekktu@gmail.com>
-
-       * files.el (mode-require-final-newline, require-final-newline)
-       (enable-local-variables, enable-local-eval): Doc fixes.
-
-2007-05-10  Edward O'Connor  <hober0@gmail.com>  (tiny change)
-
-       * progmodes/python.el (python-font-lock-keywords)
-       (python-open-block-statement-p, python-mode): Add support for the new
-       "with" keyword.
-
-2007-05-10  Richard Stallman  <rms@gnu.org>
-
-       * international/iso-cvt.el (iso-cvt-read-only): Ignore arguments.
-       (iso-cvt-write-only): Likewise.
-
-       * emacs-lisp/easy-mmode.el (define-minor-mode):
-       Fix generated doc string.
-
-       * startup.el (fancy-splash-text): Add URL of guided tour.
-       Adjust horizontal and vertical whitespace.
-
-       * progmodes/compile.el (compilation-handle-exit):
-       Use run-hook-with-args to run compilation-finish-functions.
-
-       * files.el (file-start-mode-alist): New variable.
-       (magic-mode-regexp-match-limit): Doc fix.
-       (set-auto-mode): Handle file-start-mode-alist.
-       A little cleanup of structure.
-
-2007-05-10  Davis Herring  <herring@lanl.gov>
-
-       * calendar/timeclock.el (timeclock-in): Fix non-interactive
-       workday specifications.
-       (timeclock-log): Don't kill the log buffer if it already existed.
-
-2007-05-08  Richard Stallman  <rms@gnu.org>
-
-       * mail/mailabbrev.el (sendmail-pre-abbrev-expand-hook):
-       Don't include non-self-insert commands in the exception for `-'.
-
-2007-05-08  David Reitter  <david.reitter@gmail.com>
-
-       * progmodes/python.el (python-guess-indent): Check non-nullness
-       before comparing indent against the 2..8 interval.
-
-2007-05-07  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
-
-       * term/mac-win.el (mac-ts-unicode-for-key-event): Check if text is
-       available.
-
-2007-05-06  Richard Stallman  <rms@gnu.org>
-
-       * emacs-lisp/eldoc.el (turn-on-eldoc-mode): Doc fix.
-
-2007-05-03  Ryan Yeske  <rcyeske@gmail.com>
-
-       * net/rcirc.el (rcirc-timeout-seconds): Increase to prevent unwanted
-       disconnections.
-
-2007-05-01  Romain Francoise  <romain@orebokech.com>
-
-       * dired-x.el: Revert 2007-04-06 change.
-
-2007-04-30  Nick Roberts  <nickrob@snap.net.nz>
-
-       * progmodes/gud.el (gud-menu-map): Pdb can't handle SIGINT so
-       don't put stop on toolbar.
-
-2007-04-29  Stephen Berman  <Stephen.Berman@gmx.net>
-
-       * find-dired.el (find-dired-filter): Propertize all text down to eob.
-
-2007-04-29  Richard Stallman  <rms@gnu.org>
-
-       * international/mule.el (auto-coding-alist): Add pdf => no-conversion.
-
-2007-04-28  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * progmodes/cc-mode.el (c-before-change): Use point-min rather
-       than 1.
-
-2007-04-28  Richard Stallman  <rms@gnu.org>
-
-       * progmodes/sh-script.el (sh-mode): Recognize .profile as sh style.
-
-2007-04-28  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * vc-hooks.el (vc-ignore-dir-regexp): Add /.../ for the DFS filesystem.
-
-2007-04-28  Eli Zaretskii  <eliz@gnu.org>
-
-       * makefile.w32-in ($(lisp)/mh-e/mh-loaddefs.el): Use ./mh-e
-       instead of $(lisp)/mh-e.
-
-       * textmodes/fill.el (fill-paragraph): Doc fix.
-
-2007-04-28  Glenn Morris  <rgm@gnu.org>
-
-       * image-dired.el (image-dired-cmd-create-thumbnail-options)
-       (image-dired-cmd-create-temp-image-options): Replace option
-       +profile "*" with -strip.
-
-2007-04-27  Chong Yidong  <cyd@stupidchicken.com>
-
-       * textmodes/flyspell.el (flyspell-auto-correct-previous-word):
-       Use window-start and window-end.
-
-2007-04-26  Glenn Morris  <rgm@gnu.org>
-
-       * progmodes/python.el: Restore file pending consideration of legal
-       status.
-
-2007-04-26  Luc Teirlinck  <teirllm@dms.auburn.edu>
-
-       * locate.el (locate-in-alternate-database): Doc fix.
-
-2007-04-26  Glenn Morris  <rgm@gnu.org>
-
-       * button.el (button): Use underline if supported, else fall back
-       to color.
-
-2007-04-25  Richard Stallman  <rms@gnu.org>
-
-       * hi-lock.el (hi-lock-file-patterns-policy): Default to `ask'.
-
-2007-04-25  J.D. Smith  <jdsmith@as.arizona.edu>
-
-       * progmodes/idlwave.el (idlwave-beginning-of-subprogram)
-       (idlwave-end-of-subprogram): Take optional NOMARK arg to prevent
-       pushing mark.
-       (idlwave-current-routine): Don't push mark.
-
-2007-04-25  Mathias Dahl  <mathias.dahl@gmail.com>
-
-       * image-dired.el (image-dired-display-image): Derive image-type from
-       filename rather than assuming jpeg, in case no resizing was needed.
-
-2007-04-25  Johan Bockg\e,Ae\e(Brd  <bojohan@dd.chalmers.se>
-
-       * custom.el (defface): Doc fix.
-
-2007-04-24  Chong Yidong  <cyd@stupidchicken.com>
-
-       * progmodes/python.el: Remove due to unclear legal issues.
-
 2007-04-24  J.D. Smith  <jdsmith@as.arizona.edu>
 
        * progmodes/idlw-shell.el (idlwave-shell-clear-all-bp):
        path.  Rewrite function in `cond' style for readability.
 
        Suggested by: Stephen Eglen <S.J.Eglen{_AT_}damtp.cam.ac.uk>.
-       (The path shortening, that is, not the rearrarangement.)
+       (The path shortening, that is, not the rearrangement.)
 
 2007-01-15  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
 
        * help.el (describe-key-briefly): When reading a down-event on
        mode lines or scroll bar, swallow the following up event, too.
-       Use the new mouse sensitity of `key-binding' for lookup.
+       Use the new mouse sensitivity of `key-binding' for lookup.
        (describe-key): The same here.
 
 2006-09-15  Juanma Barranquero  <lekktu@gmail.com>
 
        * tumme.el (tumme-display-thumbnail-original-image): Make sure
        image display buffer is displayed before call to
-       `tumme-display-image.
+       `tumme-display-image'.
        (tumme-dired-display-image): Make sure image display buffer is
-       displayed before call to `tumme-display-image.
+       displayed before call to `tumme-display-image'.
        (tumme-mouse-display-image): Make sure image display buffer is
-       displayed before call to `tumme-display-image.
+       displayed before call to `tumme-display-image'.
        (tumme-widget-list): Add.
        (tumme-dired-edit-comment-and-tags): Add.
        (tumme-save-information-from-widgets): Add.
        instead of retired `allout-resumptions'.  For hook functions, use
        `local' parameter so hook settings are created and removed as
        buffer-local settings.  Revise (resumptions) setting
-       auto-fill-function so it is set only if already active.  (The
+       auto-fill-function so it is set only if already active.  The
        related fill-function settings are all made in either case, so
        that activating auto-fill-mode activity will have the custom
        allout-mode behaviors (hanging indent on topics, if configured for it).
 
 2006-05-09  Masatake YAMATO  <jet@gyve.org>
 
-       * font-lock.el (cpp-font-lock-keywords-source-directives): Addded
+       * font-lock.el (cpp-font-lock-keywords-source-directives): Added
        "warning" and "import".
        (cpp-font-lock-keywords): Added "warning".
 
        (ibuffer-do-print, ibuffer-filter-by-mode, ibuffer-filter-by-used-mode)
        (ibuffer-filter-by-name, ibuffer-filter-by-filename)
        (ibuffer-filter-by-size-gt, ibuffer-filter-by-size-lt)
-       (ibuffer-filter-by-content, ibuffer-filter-by-predicate
+       (ibuffer-filter-by-content, ibuffer-filter-by-predicate)
        (ibuffer-do-sort-by-major-mode, ibuffer-do-sort-by-mode-name)
        (ibuffer-do-sort-by-alphabetic, ibuffer-do-sort-by-size):
        Autoload file sans suffix.
        (gdb-info-frames-custom): Put `font-lock-function-name-face'
        and `font-lock-variable-name-face'
        (gdb-registers-font-lock-keywords): New font lock keywords definition.
-       (gdb-registers-mode): Use `gdb-registers-font-lock-keywords`.
+       (gdb-registers-mode): Use `gdb-registers-font-lock-keywords'.
        (gdb-memory-font-lock-keywords): New font lock keywords definition.
        (gdb-memory-mode): Use `gdb-memory-font-lock-keywords'.
        (gdb-local-font-lock-keywords): New font lock keywords definition.
 2005-08-30  Richard M. Stallman  <rms@gnu.org>
 
        * files.el (risky-local-variable-p):
-       Match `-predicates' and `-commands.
+       Match `-predicates' and `-commands'.
 
        * cus-edit.el (custom-buffer-sort-alphabetically): Default to t.
        (custom-save-all): Visit the file if necessary;
        (tramp-handle-set-visited-file-modtime)
        (tramp-handle-insert-file-contents)
        (tramp-handle-write-region): No special handling for
-       `last-coding-system-used, because this is done in
+       `last-coding-system-used', because this is done in
        `tramp-accept-process-output' now.
        (tramp-accept-process-output): New defun.
        (tramp-process-one-action, tramp-process-one-multi-action)
        * net/tramp-smb.el: Remove defvar of `last-coding-system-used' in the
        XEmacs case; not necessary anymore.
        (tramp-smb-handle-write-region): No special handling for
-       `last-coding-system-used, because this is done in
+       `last-coding-system-used', because this is done in
        `tramp-accept-process-output' now.
        (tramp-smb-wait-for-output): Call `tramp-accept-process-output'.
 
        (tree-widget-theme, tree-widget-image-properties-emacs)
        (tree-widget-image-properties-xemacs, tree-widget-create-image)
        (tree-widget-image-formats, tree-widget-control)
-       (tree-widget-empty-control, tree-widget-leaf-control
+       (tree-widget-empty-control, tree-widget-leaf-control)
        (tree-widget-guide, tree-widget-end-guide, tree-widget-no-guide)
        (tree-widget-handle, tree-widget-no-handle, tree-widget-p)
        (tree-widget-keep, tree-widget-after-toggle-functions)
        (ebrowse-draw-member-buffer-class-line, ebrowse-draw-member-long-fn)
        (ebrowse-draw-member-short-fn): Use renamed ebrowse faces.
 
-       * progmodes/antlr-mode.el (antlr-default, antlr-keyword,
-       antlr-syntax)
+       * progmodes/antlr-mode.el (antlr-default, antlr-keyword, antlr-syntax)
        (antlr-ruledef, antlr-tokendef, antlr-ruleref, antlr-tokenref)
        (antlr-literal): Remove "-face" suffix and "font-lock-" from face
        names.
        * progmodes/make-mode.el (makefile-add-this-line-targets):
        Simplify and integrate into `makefile-pickup-targets'.
        (makefile-add-this-line-macro): Simplify and integrate into
-       `makefile-pickup-macros.
+       `makefile-pickup-macros'.
        (makefile-pickup-filenames-as-targets): Simplify.
        (makefile-previous-dependency, makefile-match-dependency):
        Don't stumble over `::'.
        Adrian Aichner <adrian@xemacs.org>.
 
        * net/tramp-smb.el (tramp-smb-file-name-handler-alist): Add entry for
-       `substitute-in-file-name.
+       `substitute-in-file-name'.
        (tramp-smb-handle-substitute-in-file-name): New defun.
        (tramp-smb-advice-PC-do-completion): Delete advice.
 
index 81d7b1d..490bde9 100644 (file)
@@ -275,6 +275,9 @@ $(lisp)/mh-e/mh-loaddefs.el: $(lisp)/subdirs.el $(MH_E_SRC)
 # an up-to-date copy of loaddefs.el that is uncorrupted by
 # local changes.  (Because loaddefs.el is an automatically generated
 # file, we don't want to store it in the source repository).
+#
+# The chmod +w is to handle env var CVSREAD=1.  Files named
+# are identified by being the value of `generated-autoload-file'.
 
 bootstrap-prepare:
        if test -x $(EMACS); then                               \
@@ -282,6 +285,9 @@ bootstrap-prepare:
        else                                                    \
          cp $(lisp)/ldefs-boot.el $(lisp)/loaddefs.el;         \
        fi
+       chmod +w $(lisp)/loaddefs.el            \
+         $(lisp)/ps-print.el                   \
+         $(lisp)/emacs-lisp/cl-loaddefs.el
 
 maintainer-clean: distclean
        cd $(lisp); rm -f *.elc */*.elc $(AUTOGENEL)
index d60580a..4b6b345 100644 (file)
@@ -55,7 +55,7 @@
 ;; Many modes set this variable, so avoid warnings.
 ;;;###autoload
 (defcustom add-log-current-defun-function nil
-  "*If non-nil, function to guess name of surrounding function.
+  "If non-nil, function to guess name of surrounding function.
 It is used by `add-log-current-defun' in preference to built-in rules.
 Returns function's name as a string, or nil if outside a function."
   :type '(choice (const nil) function)
@@ -63,7 +63,7 @@ Returns function's name as a string, or nil if outside a function."
 
 ;;;###autoload
 (defcustom add-log-full-name nil
-  "*Full name of user, for inclusion in ChangeLog daily headers.
+  "Full name of user, for inclusion in ChangeLog daily headers.
 This defaults to the value returned by the function `user-full-name'."
   :type '(choice (const :tag "Default" nil)
                 string)
@@ -148,7 +148,7 @@ use the file's name relative to the directory of the change log file."
 
 
 (defcustom change-log-version-info-enabled nil
-  "*If non-nil, enable recording version numbers with the changes."
+  "If non-nil, enable recording version numbers with the changes."
   :version "21.1"
   :type 'boolean
   :group 'change-log)
@@ -160,7 +160,7 @@ use the file's name relative to the directory of the change log file."
      (concat "^(def[^ \t\n]+[ \t]+[^ \t\n][ \t]\"" re)
      ;; Revision: pcl-cvs.el,v 1.72 1999/09/05 20:21:54 monnier Exp
      (concat "^;+ *Revision: +[^ \t\n]+[ \t]+" re)))
-  "*List of regexps to search for version number.
+  "List of regexps to search for version number.
 The version number must be in group 1.
 Note: The search is conducted only within 10%, at the beginning of the file."
   :version "21.1"
@@ -460,11 +460,7 @@ Optional arg BUFFER-FILE overrides `buffer-file-name'."
     (if add-log-file-name-function
        (funcall add-log-file-name-function buffer-file)
       (setq buffer-file
-           (if (string-match
-                (concat "^" (regexp-quote (file-name-directory log-file)))
-                buffer-file)
-               (substring buffer-file (match-end 0))
-             (file-name-nondirectory buffer-file)))
+            (file-relative-name buffer-file (file-name-directory log-file)))
       ;; If we have a backup file, it's presumably because we're
       ;; comparing old and new versions (e.g. for deleted
       ;; functions) and we'll want to use the original name.
@@ -508,117 +504,111 @@ non-nil, otherwise in local time."
         (buffer-file (if buf-file-name (expand-file-name buf-file-name)))
         (file-name (expand-file-name (find-change-log file-name buffer-file)))
         ;; Set ITEM to the file name to use in the new item.
-        (item (add-log-file-name buffer-file file-name))
-        bound full-name mailing-address)
-
-    (if whoami
-       (progn
-         (setq full-name (read-string "Full name: "
-                                      (or add-log-full-name (user-full-name))))
-         ;; Note that some sites have room and phone number fields in
-         ;; full name which look silly when inserted.  Rather than do
-         ;; anything about that here, let user give prefix argument so that
-         ;; s/he can edit the full name field in prompter if s/he wants.
-         (setq mailing-address
-               (read-string "Mailing address: "
-                            (or add-log-mailing-address user-mail-address)))))
+        (item (add-log-file-name buffer-file file-name)))
 
     (unless (equal file-name buffer-file-name)
       (if (or other-window (window-dedicated-p (selected-window)))
          (find-file-other-window file-name)
        (find-file file-name)))
-    (or (eq major-mode 'change-log-mode)
+    (or (derived-mode-p 'change-log-mode)
        (change-log-mode))
     (undo-boundary)
     (goto-char (point-min))
 
-    (or full-name
-       (setq full-name (or add-log-full-name (user-full-name))))
-    (or mailing-address
-        (setq mailing-address (or add-log-mailing-address user-mail-address)))
-
-    ;; If file starts with a copyright and permission notice, skip them.
-    ;; Assume they end at first blank line.
-    (when (looking-at "Copyright")
-      (search-forward "\n\n")
-      (skip-chars-forward "\n"))
-
-    ;; Advance into first entry if it is usable; else make new one.
-    (let ((new-entries
-           (mapcar (lambda (addr)
-                     (concat
-                      (if (stringp add-log-time-zone-rule)
-                          (let ((tz (getenv "TZ")))
-                            (unwind-protect
-                                (progn
-                                  (set-time-zone-rule add-log-time-zone-rule)
-                                  (funcall add-log-time-format))
-                              (set-time-zone-rule tz)))
-                        (funcall add-log-time-format))
-                      "  " full-name
-                      "  <" addr ">"))
-                   (if (consp mailing-address)
-                       mailing-address
-                     (list mailing-address)))))
-      (if (and (not add-log-always-start-new-record)
-               (let ((hit nil))
-                (dolist (entry new-entries hit)
-                  (when (looking-at (regexp-quote entry))
-                    (setq hit t)))))
-         (forward-line 1)
-       (insert (nth (random (length new-entries))
-                    new-entries)
-               (if use-hard-newlines hard-newline "\n")
-               (if use-hard-newlines hard-newline "\n"))
-       (forward-line -1)))
+    (let ((full-name (or add-log-full-name (user-full-name)))
+          (mailing-address (or add-log-mailing-address user-mail-address)))
+
+      (when whoami
+        (setq full-name (read-string "Full name: " full-name))
+        ;; Note that some sites have room and phone number fields in
+        ;; full name which look silly when inserted.  Rather than do
+        ;; anything about that here, let user give prefix argument so that
+        ;; s/he can edit the full name field in prompter if s/he wants.
+        (setq mailing-address
+             (read-string "Mailing address: " mailing-address)))
+
+      ;; If file starts with a copyright and permission notice, skip them.
+      ;; Assume they end at first blank line.
+      (when (looking-at "Copyright")
+        (search-forward "\n\n")
+        (skip-chars-forward "\n"))
+
+      ;; Advance into first entry if it is usable; else make new one.
+      (let ((new-entries
+             (mapcar (lambda (addr)
+                       (concat
+                        (if (stringp add-log-time-zone-rule)
+                            (let ((tz (getenv "TZ")))
+                              (unwind-protect
+                                  (progn
+                                    (set-time-zone-rule add-log-time-zone-rule)
+                                    (funcall add-log-time-format))
+                                (set-time-zone-rule tz)))
+                          (funcall add-log-time-format))
+                        "  " full-name
+                        "  <" addr ">"))
+                     (if (consp mailing-address)
+                         mailing-address
+                       (list mailing-address)))))
+        (if (and (not add-log-always-start-new-record)
+                 (let ((hit nil))
+                   (dolist (entry new-entries hit)
+                     (when (looking-at (regexp-quote entry))
+                       (setq hit t)))))
+            (forward-line 1)
+          (insert (nth (random (length new-entries))
+                       new-entries)
+                  (if use-hard-newlines hard-newline "\n")
+                  (if use-hard-newlines hard-newline "\n"))
+          (forward-line -1))))
 
     ;; Determine where we should stop searching for a usable
     ;; item to add to, within this entry.
-    (setq bound
-         (save-excursion
-            (if (looking-at "\n*[^\n* \t]")
-                (skip-chars-forward "\n")
-             (if add-log-keep-changes-together
-                 (forward-page)        ; page delimits entries for date
-               (forward-paragraph)))   ; paragraph delimits entries for file
-           (point)))
-
-    ;; Now insert the new line for this item.
-    (cond ((re-search-forward "^\\s *\\*\\s *$" bound t)
-          ;; Put this file name into the existing empty item.
-          (if item
-              (insert item)))
-         ((and (not new-entry)
-               (let (case-fold-search)
-                 (re-search-forward
-                  (concat (regexp-quote (concat "* " item))
-                          ;; Don't accept `foo.bar' when
-                          ;; looking for `foo':
-                          "\\(\\s \\|[(),:]\\)")
-                  bound t)))
-          ;; Add to the existing item for the same file.
-          (re-search-forward "^\\s *$\\|^\\s \\*")
-          (goto-char (match-beginning 0))
-          ;; Delete excess empty lines; make just 2.
-          (while (and (not (eobp)) (looking-at "^\\s *$"))
-            (delete-region (point) (line-beginning-position 2)))
-          (insert (if use-hard-newlines hard-newline "\n")
-                  (if use-hard-newlines hard-newline "\n"))
-          (forward-line -2)
-          (indent-relative-maybe))
-         (t
-          ;; Make a new item.
-          (while (looking-at "\\sW")
-            (forward-line 1))
-          (while (and (not (eobp)) (looking-at "^\\s *$"))
-            (delete-region (point) (line-beginning-position 2)))
-          (insert (if use-hard-newlines hard-newline "\n")
-                  (if use-hard-newlines hard-newline "\n")
-                  (if use-hard-newlines hard-newline "\n"))
-          (forward-line -2)
-          (indent-to left-margin)
-          (insert "* ")
-          (if item (insert item))))
+    (let ((bound
+           (save-excursion
+             (if (looking-at "\n*[^\n* \t]")
+                 (skip-chars-forward "\n")
+               (if add-log-keep-changes-together
+                   (forward-page)      ; page delimits entries for date
+                 (forward-paragraph))) ; paragraph delimits entries for file
+             (point))))
+
+      ;; Now insert the new line for this item.
+      (cond ((re-search-forward "^\\s *\\*\\s *$" bound t)
+             ;; Put this file name into the existing empty item.
+             (if item
+                 (insert item)))
+            ((and (not new-entry)
+                  (let (case-fold-search)
+                    (re-search-forward
+                     (concat (regexp-quote (concat "* " item))
+                             ;; Don't accept `foo.bar' when
+                             ;; looking for `foo':
+                             "\\(\\s \\|[(),:]\\)")
+                     bound t)))
+             ;; Add to the existing item for the same file.
+             (re-search-forward "^\\s *$\\|^\\s \\*")
+             (goto-char (match-beginning 0))
+             ;; Delete excess empty lines; make just 2.
+             (while (and (not (eobp)) (looking-at "^\\s *$"))
+               (delete-region (point) (line-beginning-position 2)))
+             (insert (if use-hard-newlines hard-newline "\n")
+                     (if use-hard-newlines hard-newline "\n"))
+             (forward-line -2)
+             (indent-relative-maybe))
+            (t
+             ;; Make a new item.
+             (while (looking-at "\\sW")
+               (forward-line 1))
+             (while (and (not (eobp)) (looking-at "^\\s *$"))
+               (delete-region (point) (line-beginning-position 2)))
+             (insert (if use-hard-newlines hard-newline "\n")
+                     (if use-hard-newlines hard-newline "\n")
+                     (if use-hard-newlines hard-newline "\n"))
+             (forward-line -2)
+             (indent-to left-margin)
+             (insert "* ")
+             (if item (insert item)))))
     ;; Now insert the function name, if we have one.
     ;; Point is at the item for this file,
     ;; either at the end of the line or at the first blank line.
@@ -667,9 +657,45 @@ the change log file in another window."
   (add-change-log-entry whoami file-name t))
 ;;;###autoload (define-key ctl-x-4-map "a" 'add-change-log-entry-other-window)
 
+
 (defvar change-log-indent-text 0)
 
+(defun change-log-fill-parenthesized-list ()
+  ;; Fill parenthesized lists of names according to GNU standards.
+  ;; * file-name.ext (very-long-foo, very-long-bar, very-long-foobar):
+  ;; should be filled as
+  ;; * file-name.ext (very-long-foo, very-long-bar)
+  ;; (very-long-foobar):
+  (save-excursion
+    (end-of-line 0)
+    (skip-chars-backward " \t")
+    (when (and (equal (char-before) ?\,)
+              (> (point) (1+ (point-min))))
+      (condition-case nil
+         (when (save-excursion
+                 (and (prog2
+                          (up-list -1)
+                          (equal (char-after) ?\()
+                        (skip-chars-backward " \t"))
+                      (or (bolp)
+                          ;; Skip everything but a whitespace or asterisk.
+                          (and (not (zerop (skip-chars-backward "^ \t\n*")))
+                               (skip-chars-backward " \t")
+                               ;; We want one asterisk here.
+                               (= (skip-chars-backward "*") -1)
+                               (skip-chars-backward " \t")
+                               (bolp)))))
+           ;; Delete the comma.
+           (delete-char -1)
+           ;; Close list on previous line.
+           (insert ")")
+           (skip-chars-forward " \t\n")
+           ;; Start list on new line.
+           (insert-before-markers "("))
+       (error nil)))))
+
 (defun change-log-indent ()
+  (change-log-fill-parenthesized-list)
   (let* ((indent
          (save-excursion
            (beginning-of-line)
@@ -700,9 +726,15 @@ Runs `change-log-mode-hook'.
   (setq left-margin 8
        fill-column 74
        indent-tabs-mode t
-       tab-width 8)
+       tab-width 8
+       show-trailing-whitespace t)
   (set (make-local-variable 'fill-paragraph-function)
        'change-log-fill-paragraph)
+  ;; Avoid that filling leaves behind a single "*" on a line.
+  (add-hook 'fill-nobreak-predicate
+           '(lambda ()
+              (looking-back "^\\s *\\*\\s *" (line-beginning-position))) 
+           nil t)
   (set (make-local-variable 'indent-line-function) 'change-log-indent)
   (set (make-local-variable 'tab-always-indent) nil)
   ;; We really do want "^" in paragraph-start below: it is only the
@@ -731,7 +763,11 @@ Prefix arg means justify as well."
   (interactive "P")
   (let ((end (progn (forward-paragraph) (point)))
        (beg (progn (backward-paragraph) (point)))
-       (paragraph-start (concat paragraph-start "\\|\\s *\\s(")))
+       ;; Add lines starting with whitespace followed by a left paren or an
+       ;; asterisk.
+       (paragraph-start (concat paragraph-start "\\|\\s *\\(?:\\s(\\|\\*\\)"))
+       ;; Make sure we call `change-log-indent'.
+       (fill-indent-according-to-mode t))
     (fill-region beg end justify)
     t))
 \f
@@ -753,7 +789,7 @@ Prefix arg means justify as well."
 
 ;;;###autoload
 (defvar add-log-tex-like-modes
-  '(TeX-mode plain-TeX-mode LaTeX-mode plain-tex-mode latex-mode)
+  '(TeX-mode plain-TeX-mode LaTeX-mode tex-mode)
   "*Modes that look like TeX to `add-log-current-defun'.")
 
 ;;;###autoload
@@ -775,7 +811,7 @@ Has a preference of looking backwards."
        (let ((location (point)))
          (cond (add-log-current-defun-function
                 (funcall add-log-current-defun-function))
-               ((memq major-mode add-log-lisp-like-modes)
+               ((apply 'derived-mode-p add-log-lisp-like-modes)
                 ;; If we are now precisely at the beginning of a defun,
                 ;; make sure beginning-of-defun finds that one
                 ;; rather than the previous one.
@@ -799,7 +835,7 @@ Has a preference of looking backwards."
                   (buffer-substring-no-properties (point)
                                                   (progn (forward-sexp 1)
                                                          (point)))))
-               ((and (memq major-mode add-log-c-like-modes)
+               ((and (apply 'derived-mode-p add-log-c-like-modes)
                      (save-excursion
                        (beginning-of-line)
                        ;; Use eq instead of = here to avoid
@@ -817,7 +853,7 @@ Has a preference of looking backwards."
                 (buffer-substring-no-properties (point)
                                                 (progn (forward-sexp 1)
                                                        (point))))
-               ((memq major-mode add-log-c-like-modes)
+               ((apply 'derived-mode-p add-log-c-like-modes)
                 ;; See whether the point is inside a defun.
                 (let (having-previous-defun
                       having-next-defun
@@ -959,7 +995,7 @@ Has a preference of looking backwards."
                                   (setq end (point)))
                                 (buffer-substring-no-properties
                                  middle end)))))))))
-               ((memq major-mode add-log-tex-like-modes)
+               ((apply 'derived-mode-p add-log-tex-like-modes)
                 (if (re-search-backward
                      "\\\\\\(sub\\)*\\(section\\|paragraph\\|chapter\\)"
                      nil t)
@@ -968,17 +1004,17 @@ Has a preference of looking backwards."
                       (buffer-substring-no-properties
                        (1+ (point))    ; without initial backslash
                        (line-end-position)))))
-               ((eq major-mode 'texinfo-mode)
+               ((derived-mode-p 'texinfo-mode)
                 (if (re-search-backward "^@node[ \t]+\\([^,\n]+\\)" nil t)
                     (match-string-no-properties 1)))
-               ((memq major-mode '(perl-mode cperl-mode))
+               ((derived-mode-p '(perl-mode cperl-mode))
                 (if (re-search-backward "^sub[ \t]+\\([^({ \t\n]+\\)" nil t)
                     (match-string-no-properties 1)))
                ;; Emacs's autoconf-mode installs its own
                ;; `add-log-current-defun-function'.  This applies to
                ;; a different mode apparently for editing .m4
                ;; autoconf source.
-                ((eq major-mode 'autoconf-mode)
+                ((derived-mode-p 'autoconf-mode)
                  (if (re-search-backward
                      "^\\(\\(m4_\\)?define\\|A._DEFUN\\)(\\[?\\([A-Za-z0-9_]+\\)" nil t)
                      (match-string-no-properties 3)))
@@ -1045,17 +1081,32 @@ Point is assumed to be at the start of the entry."
 
 (defun change-log-resolve-conflict ()
   "Function to be used in `smerge-resolve-function'."
-  (let ((buf (current-buffer)))
-    (with-temp-buffer
-      (insert-buffer-substring buf (match-beginning 1) (match-end 1))
-      (save-match-data (change-log-mode))
-      (let ((other-buf (current-buffer)))
-       (with-current-buffer buf
-         (save-excursion
-           (save-restriction
-             (narrow-to-region (match-beginning 0) (match-end 0))
-             (replace-match (match-string 3) t t)
-             (change-log-merge other-buf))))))))
+  (save-excursion
+    (save-restriction
+      (narrow-to-region (match-beginning 0) (match-end 0))
+      (let ((mb1 (match-beginning 1))
+            (me1 (match-end 1))
+            (mb3 (match-beginning 3))
+            (me3 (match-end 3))
+            (tmp1 (generate-new-buffer " *changelog-resolve-1*"))
+           (tmp2 (generate-new-buffer " *changelog-resolve-2*")))
+       (unwind-protect
+           (let ((buf (current-buffer)))
+             (with-current-buffer tmp1
+                (change-log-mode)
+               (insert-buffer-substring buf mb1 me1))
+             (with-current-buffer tmp2
+                (change-log-mode)
+               (insert-buffer-substring buf mb3 me3)
+                ;; Do the merge here instead of inside `buf' so as to be
+                ;; more robust in case change-log-merge fails.
+               (change-log-merge tmp1))
+             (goto-char (point-max))
+             (delete-region (point-min)
+                            (prog1 (point)
+                              (insert-buffer-substring tmp2))))
+         (kill-buffer tmp1)
+         (kill-buffer tmp2))))))
 
 ;;;###autoload
 (defun change-log-merge (other-log)
@@ -1067,7 +1118,7 @@ or a buffer.
 Entries are inserted in chronological order.  Both the current and
 old-style time formats for entries are supported."
   (interactive "*fLog file name to merge: ")
-  (if (not (eq major-mode 'change-log-mode))
+  (if (not (derived-mode-p 'change-log-mode))
       (error "Not in Change Log mode"))
   (let ((other-buf (if (bufferp other-log) other-log
                     (find-file-noselect other-log)))
@@ -1077,7 +1128,7 @@ old-style time formats for entries are supported."
       (goto-char (point-min))
       (set-buffer other-buf)
       (goto-char (point-min))
-      (if (not (eq major-mode 'change-log-mode))
+      (if (not (derived-mode-p 'change-log-mode))
          (error "%s not found in Change Log mode" other-log))
       ;; Loop through all the entries in OTHER-LOG.
       (while (not (eobp))
index 805065b..91bfb39 100644 (file)
@@ -186,33 +186,33 @@ If this contains a %s, that will be replaced by the matching rule."
     (completing-read "Keyword, C-h: " v1 nil t))
     str ", ") & -2 "
 
-;; This file is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+\;; This file is free software; you can redistribute it and/or modify
+\;; it under the terms of the GNU General Public License as published by
+\;; the Free Software Foundation; either version 3, or (at your option)
+\;; any later version.
 
-;; This file is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
+\;; This file is distributed in the hope that it will be useful,
+\;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+\;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+\;; GNU General Public License for more details.
 
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+\;; You should have received a copy of the GNU General Public License
+\;; along with GNU Emacs; see the file COPYING.  If not, write to
+\;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+\;; Boston, MA 02110-1301, USA.
 
-;;; Commentary:
+\;;; Commentary:
 
-;; " _ "
+\;; " _ "
 
-;;; Code:
+\;;; Code:
 
 
 
 \(provide '"
        (file-name-sans-extension (file-name-nondirectory (buffer-file-name)))
        ")
-;;; " (file-name-nondirectory (buffer-file-name)) " ends here\n"))
+\;;; " (file-name-nondirectory (buffer-file-name)) " ends here\n"))
   "A list specifying text to insert by default into a new file.
 Elements look like (CONDITION . ACTION) or ((CONDITION . DESCRIPTION) . ACTION).
 CONDITION may be a regexp that must match the new file's name, or it may be
index 5220f3f..f1e5b14 100644 (file)
@@ -276,9 +276,9 @@ the list of old buffers.")
   "Position of last known end of file.")
 
 (add-hook 'find-file-hook
-         (lambda ()
-           (set (make-local-variable 'auto-revert-tail-pos)
-                (nth 7 (file-attributes buffer-file-name)))))
+         (lambda ()
+           (set (make-local-variable 'auto-revert-tail-pos)
+                (nth 7 (file-attributes buffer-file-name)))))
 
 ;; Functions:
 
@@ -334,7 +334,7 @@ Use `auto-revert-mode' for changes other than appends!"
       (auto-revert-tail-mode 0)
       (error "This buffer is not visiting a file"))
     (if (and (buffer-modified-p)
-            (not auto-revert-tail-pos) ; library was loaded only after finding file
+            (zerop auto-revert-tail-pos) ; library was loaded only after finding file
             (not (y-or-n-p "Buffer is modified, so tail offset may be wrong.  Proceed? ")))
        (auto-revert-tail-mode 0)
       ;; a-r-tail-pos stores the size of the file at the time of the
@@ -348,11 +348,11 @@ Use `auto-revert-mode' for changes other than appends!"
       ;; revert, then you might miss some output then happened
       ;; between visiting the file and activating a-r-t-mode.
       (and (zerop auto-revert-tail-pos)
-          (not (verify-visited-file-modtime (current-buffer)))
-          (y-or-n-p "File changed on disk, content may be missing.  \
+           (not (verify-visited-file-modtime (current-buffer)))
+           (y-or-n-p "File changed on disk, content may be missing.  \
 Perform a full revert? ")
-          ;; Use this (not just revert-buffer) for point-preservation.
-          (auto-revert-handler))
+           ;; Use this (not just revert-buffer) for point-preservation.
+           (auto-revert-handler))
       ;; else we might reappend our own end when we save
       (add-hook 'before-save-hook (lambda () (auto-revert-tail-mode 0)) nil t)
       (or (local-variable-p 'auto-revert-tail-pos) ; don't lose prior position
@@ -463,20 +463,21 @@ This is an internal function used by Auto-Revert Mode."
 (defun auto-revert-tail-handler ()
   (let ((size (nth 7 (file-attributes buffer-file-name)))
        (modified (buffer-modified-p))
-       buffer-read-only                ; ignore
+       (inhibit-read-only t)           ; Ignore.
        (file buffer-file-name)
-       buffer-file-name)               ; ignore that file has changed
+       (buffer-file-name nil))         ; Ignore that file has changed.
     (when (> size auto-revert-tail-pos)
+      (run-hooks 'before-revert-hook)
       (undo-boundary)
       (save-restriction
        (widen)
        (save-excursion
          (goto-char (point-max))
          (insert-file-contents file nil auto-revert-tail-pos size)))
-      (run-mode-hooks 'after-revert-hook)
+      (run-hooks 'after-revert-hook)
       (undo-boundary)
       (setq auto-revert-tail-pos size)
-      (set-buffer-modified-p modified)))
+      (restore-buffer-modified-p modified)))
   (set-visited-file-modtime))
 
 (defun auto-revert-buffers ()
@@ -550,5 +551,5 @@ the timer when no buffers need to be checked."
 
 (run-hooks 'auto-revert-load-hook)
 
-;;; arch-tag: f6bcb07b-4841-477e-9e44-b18678e58876
+;; arch-tag: f6bcb07b-4841-477e-9e44-b18678e58876
 ;;; autorevert.el ends here
index 3c7237a..e38cc5b 100644 (file)
@@ -248,6 +248,22 @@ Normally nil in most modes, since there is no process to display.")
 
 (make-variable-buffer-local 'mode-line-modified)
 
+(defvar mode-line-remote
+  (list (propertize
+        "%1@"
+        'help-echo (purecopy (lambda (window object point)
+                               (format "%s"
+                                       (save-selected-window
+                                         (select-window window)
+                                         (concat 
+                                         (if (file-remote-p default-directory)
+                                             "Remote: "
+                                           "Local: ")
+                                         default-directory)))))))
+  "Mode-line flag to show if default-directory for current buffer is remote.")
+
+(make-variable-buffer-local 'mode-line-remote)
+
 ;; Actual initialization is below.
 (defvar mode-line-position nil
   "Mode-line control for displaying the position in the buffer.
@@ -287,6 +303,7 @@ Keymap to display on minor modes.")
         (propertize "-" 'help-echo help-echo)
         'mode-line-mule-info
         'mode-line-modified
+        'mode-line-remote
         'mode-line-frame-identification
         'mode-line-buffer-identification
         (propertize "   " 'help-echo help-echo)
index 5a173e6..c1904cb 100644 (file)
@@ -240,12 +240,13 @@ functions have a binding in this keymap.")
 
 ;; Read the help on all of these functions for details...
 ;;;###autoload (define-key bookmark-map "x" 'bookmark-set)
-;;;###autoload (define-key bookmark-map "m" 'bookmark-set) ; "m" for "mark"
+;;;###autoload (define-key bookmark-map "m" 'bookmark-set) ;"m"ark
 ;;;###autoload (define-key bookmark-map "j" 'bookmark-jump)
-;;;###autoload (define-key bookmark-map "g" 'bookmark-jump) ; "g" for "go"
+;;;###autoload (define-key bookmark-map "g" 'bookmark-jump) ;"g"o
+;;;###autoload (define-key bookmark-map "o" 'bookmark-jump-other-window)
 ;;;###autoload (define-key bookmark-map "i" 'bookmark-insert)
 ;;;###autoload (define-key bookmark-map "e" 'edit-bookmarks)
-;;;###autoload (define-key bookmark-map "f" 'bookmark-insert-location) ; "f" for "find"
+;;;###autoload (define-key bookmark-map "f" 'bookmark-insert-location) ;"f"ind
 ;;;###autoload (define-key bookmark-map "r" 'bookmark-rename)
 ;;;###autoload (define-key bookmark-map "d" 'bookmark-delete)
 ;;;###autoload (define-key bookmark-map "l" 'bookmark-load)
@@ -1083,6 +1084,27 @@ of the old one in the permanent bookmark record."
              (bookmark-show-annotation bookmark)))))
 
 
+;;;###autoload
+(defun bookmark-jump-other-window (bookmark)
+  "Jump to BOOKMARK (a point in some file) in another window.
+See `bookmark-jump'."
+  (interactive
+   (let ((bkm (bookmark-completing-read "Jump to bookmark (in another window)"
+                                        bookmark-current-bookmark)))
+     (if (> emacs-major-version 21)
+         (list bkm) bkm)))
+  (when bookmark
+    (bookmark-maybe-historicize-string bookmark)
+    (let ((cell (bookmark-jump-noselect bookmark)))
+      (and cell
+           (switch-to-buffer-other-window (car cell))
+           (goto-char (cdr cell))
+           (if bookmark-automatically-show-annotations
+               ;; if there is an annotation for this bookmark,
+               ;; show it in a buffer.
+               (bookmark-show-annotation bookmark))))))
+
+
 (defun bookmark-file-or-variation-thereof (file)
   "Return FILE (a string) if it exists, or return a reasonable
 variation of FILE if that exists.  Reasonable variations are checked
index 5b32bdb..e640eb5 100644 (file)
       (cond
        ((and (consp str) (not (symbolp (car str))))
        (let ((calc-language nil)
-             (math-expr-opers math-standard-opers)
+             (math-expr-opers (math-standard-ops))
              (calc-internal-prec 12)
              (calc-word-size 32)
              (calc-symbolic-mode nil)
@@ -254,7 +254,7 @@ The value t means abort and give an error message.")
   (interactive "P")
   (calc-wrapper
    (let ((calc-language (if prefix nil calc-language))
-        (math-expr-opers (if prefix math-standard-opers math-expr-opers)))
+        (math-expr-opers (if prefix (math-standard-ops) (math-expr-ops))))
      (calc-alg-entry (and auto (char-to-string last-command-char))))))
 
 (defvar calc-alg-entry-history nil
@@ -876,7 +876,10 @@ in Calc algebraic input.")
                calcFunc-eq calcFunc-neq))
 
 (defun math-read-expr-level (exp-prec &optional exp-term)
-  (let* ((x (math-read-factor)) (first t) op op2)
+  (let* ((math-expr-opers (math-expr-ops))
+         (x (math-read-factor)) 
+         (first t) 
+         op op2)
     (while (and (or (and calc-user-parse-table
                         (setq op (calc-check-user-syntax x exp-prec))
                         (setq x op
@@ -1121,7 +1124,8 @@ in Calc algebraic input.")
        (assoc math-expr-data '(("(") ("[") ("{"))))))
 
 (defun math-read-factor ()
-  (let (op)
+  (let ((math-expr-opers (math-expr-ops))
+        op)
     (cond ((eq math-exp-token 'number)
           (let ((num (math-read-number math-expr-data)))
             (if (not num)
index 49d5499..c58d0ad 100644 (file)
 (require 'calc-ext)
 (require 'calc-macs)
 
+;;; Some useful numbers
+(defconst math-bignum-logb-digit-size
+  (eval-when-compile (logb math-bignum-digit-size))
+  "The logb of the size of a bignum digit.
+This is the largest value of B such that 2^B is less than 
+the size of a Calc bignum digit.")
+
+(defconst math-bignum-digit-power-of-two
+  (eval-when-compile (expt 2 (logb math-bignum-digit-size)))
+  "The largest power of 2 less than the size of a Calc bignum digit.")
+
 ;;; b-prefix binary commands.
 
 (defun calc-and (n)
 
 (defun math-and-bignum (a b)   ; [l l l]
   (and a b
-       (let ((qa (math-div-bignum-digit a 512))
-            (qb (math-div-bignum-digit b 512)))
+       (let ((qa (math-div-bignum-digit a math-bignum-digit-power-of-two))
+            (qb (math-div-bignum-digit b math-bignum-digit-power-of-two)))
         (math-mul-bignum-digit (math-and-bignum (math-norm-bignum (car qa))
                                                  (math-norm-bignum (car qb)))
-                                512
+                                math-bignum-digit-power-of-two
                                 (logand (cdr qa) (cdr qb))))))
 
 (defun calcFunc-or (a b &optional w)   ; [I I I] [Public]
 
 (defun math-or-bignum (a b)   ; [l l l]
   (and (or a b)
-       (let ((qa (math-div-bignum-digit a 512))
-            (qb (math-div-bignum-digit b 512)))
+       (let ((qa (math-div-bignum-digit a math-bignum-digit-power-of-two))
+            (qb (math-div-bignum-digit b math-bignum-digit-power-of-two)))
         (math-mul-bignum-digit (math-or-bignum (math-norm-bignum (car qa))
                                                 (math-norm-bignum (car qb)))
-                                512
+                                math-bignum-digit-power-of-two
                                 (logior (cdr qa) (cdr qb))))))
 
 (defun calcFunc-xor (a b &optional w)   ; [I I I] [Public]
 
 (defun math-xor-bignum (a b)   ; [l l l]
   (and (or a b)
-       (let ((qa (math-div-bignum-digit a 512))
-            (qb (math-div-bignum-digit b 512)))
+       (let ((qa (math-div-bignum-digit a math-bignum-digit-power-of-two))
+            (qb (math-div-bignum-digit b math-bignum-digit-power-of-two)))
         (math-mul-bignum-digit (math-xor-bignum (math-norm-bignum (car qa))
                                                  (math-norm-bignum (car qb)))
-                                512
+                                math-bignum-digit-power-of-two
                                 (logxor (cdr qa) (cdr qb))))))
 
 (defun calcFunc-diff (a b &optional w)   ; [I I I] [Public]
 
 (defun math-diff-bignum (a b)   ; [l l l]
   (and a
-       (let ((qa (math-div-bignum-digit a 512))
-            (qb (math-div-bignum-digit b 512)))
+       (let ((qa (math-div-bignum-digit a math-bignum-digit-power-of-two))
+            (qb (math-div-bignum-digit b math-bignum-digit-power-of-two)))
         (math-mul-bignum-digit (math-diff-bignum (math-norm-bignum (car qa))
                                                   (math-norm-bignum (car qb)))
-                                512
+                                math-bignum-digit-power-of-two
                                 (logand (cdr qa) (lognot (cdr qb)))))))
 
 (defun calcFunc-not (a &optional w)   ; [I I] [Public]
                                   w))))))
 
 (defun math-not-bignum (a w)   ; [l l]
-  (let ((q (math-div-bignum-digit a 512)))
-    (if (<= w 9)
+  (let ((q (math-div-bignum-digit a math-bignum-digit-power-of-two)))
+    (if (<= w math-bignum-logb-digit-size)
        (list (logand (lognot (cdr q))
                      (1- (lsh 1 w))))
       (math-mul-bignum-digit (math-not-bignum (math-norm-bignum (car q))
-                                              (- w 9))
-                             512
-                             (logxor (cdr q) 511)))))
+                                              (- w math-bignum-logb-digit-size))
+                             math-bignum-digit-power-of-two
+                             (logxor (cdr q) 
+                                      (1- math-bignum-digit-power-of-two))))))
 
 (defun calcFunc-lsh (a &optional n w)   ; [I I] [Public]
   (setq a (math-trunc a)
           (math-sub a (math-power-of-2 (- w)))))
        ((Math-negp a)
         (math-normalize (cons 'bigpos (math-binary-arg a w))))
-       ((and (integerp a) (< a 1000000))
-        (if (>= w 20)
+       ((and (integerp a) (< a math-small-integer-size))
+        (if (> w (logb math-small-integer-size))
             a
           (logand a (1- (lsh 1 w)))))
        (t
 (defalias 'calcFunc-clip 'math-clip)
 
 (defun math-clip-bignum (a w)   ; [l l]
-  (let ((q (math-div-bignum-digit a 512)))
-    (if (<= w 9)
+  (let ((q (math-div-bignum-digit a math-bignum-digit-power-of-two)))
+    (if (<= w math-bignum-logb-digit-size)
        (list (logand (cdr q)
                      (1- (lsh 1 w))))
       (math-mul-bignum-digit (math-clip-bignum (math-norm-bignum (car q))
-                                               (- w 9))
-                             512
+                                               (- w math-bignum-logb-digit-size))
+                             math-bignum-digit-power-of-two
                              (cdr q)))))
 
 (defvar math-max-digits-cache nil)
index cbc81ce..90a0a20 100644 (file)
 
 ;;; Factorial and related functions.
 
+(defconst math-small-factorial-table
+  (eval-when-compile
+    (vector 1 1 2 6 24 120 720 5040 40320 362880 3628800 39916800
+            (math-read-number-simple "479001600")
+            (math-read-number-simple "6227020800")
+            (math-read-number-simple "87178291200")
+            (math-read-number-simple "1307674368000")
+            (math-read-number-simple "20922789888000")
+            (math-read-number-simple "355687428096000")
+            (math-read-number-simple "6402373705728000")
+            (math-read-number-simple "121645100408832000")
+            (math-read-number-simple "2432902008176640000"))))
+
 (defun calcFunc-fact (n)   ; [I I] [F F] [Public]
   (let (temp)
     (cond ((Math-integer-negp n)
             (math-reject-arg n 'range)))
          ((integerp n)
           (if (<= n 20)
-              (aref '[1 1 2 6 24 120 720 5040 40320 362880
-                        (bigpos 800 628 3) (bigpos 800 916 39)
-                        (bigpos 600 1 479) (bigpos 800 20 227 6)
-                        (bigpos 200 291 178 87) (bigpos 0 368 674 307 1)
-                        (bigpos 0 888 789 922 20) (bigpos 0 96 428 687 355)
-                        (bigpos 0 728 705 373 402 6)
-                        (bigpos 0 832 408 100 645 121)
-                        (bigpos 0 640 176 8 902 432 2)] n)
+              (aref math-small-factorial-table n)
             (math-factorial-iter (1- n) 2 1)))
          ((and (math-messy-integerp n)
                (Math-lessp n 100))
          nil
        (if (Math-integerp var-RandSeed)
            (let* ((seed (math-sub 161803 var-RandSeed))
-                  (mj (1+ (math-mod seed '(bigpos 0 0 1))))
-                  (mk (1+ (math-mod (math-quotient seed '(bigpos 0 0 1))
-                                    '(bigpos 0 0 1))))
+                  (mj (1+ (math-mod seed 1000000)))
+                  (mk (1+ (math-mod (math-quotient seed 1000000)
+                                     1000000)))
                   (i 0))
              (setq math-random-table (cons 'vec (make-list 55 mj)))
              (while (<= (setq i (1+ i)) 54)
 ;;; Avoid various pitfalls that may lurk in the built-in (random) function!
 ;;; Shuffling algorithm from Numerical Recipes, section 7.1.
 (defvar math-random-last)
-(defun math-random-digit ()
+(defun math-random-three-digit-number ()
+  "Return a random three digit number."
   (let (i)
     (or (and (boundp 'var-RandSeed) (eq var-RandSeed math-last-RandSeed))
        (math-init-random-base))
 
 ;;; Produce an N-digit random integer.
 (defun math-random-digits (n)
-  (cond ((<= n 6)
-        (math-scale-right (+ (* (math-random-digit) 1000) (math-random-digit))
-                          (- 6 n)))
-       (t (let* ((slop (% (- 900003 n) 3))
-                 (i (/ (+ n slop) 3))
-                 (digs nil))
-            (while (> i 0)
-              (setq digs (cons (math-random-digit) digs)
-                    i (1- i)))
-            (math-normalize (math-scale-right (cons 'bigpos digs)
-                                              slop))))))
+  "Produce a random N digit integer."
+  (let* ((slop (% (- 3 (% n 3)) 3))
+         (i (/ (+ n slop) 3))
+         (rnum 0))
+    (while (> i 0)
+      (setq rnum 
+            (math-add
+             (math-random-three-digit-number)
+             (math-mul rnum 1000)))
+      (setq i (1- i)))
+    (math-normalize (math-scale-right rnum slop))))
 
 ;;; Produce a uniformly-distributed random float 0 <= N < 1.
 (defun math-random-float ()
                   (error "Argument must be an integer"))
                  ((Math-integer-negp n)
                   '(nil))
-                 ((Math-natnum-lessp n '(bigpos 0 0 8))
+                 ((Math-natnum-lessp n 8000000)
                   (setq n (math-fixnum n))
                   (let ((i -1) v)
                     (while (and (> (% n (setq v (aref math-primes-table
                  ((not (equal n (car math-prime-test-cache)))
                   (cond ((= (% (nth 1 n) 2) 0) '(nil 2))
                         ((= (% (nth 1 n) 5) 0) '(nil 5))
-                        (t (let ((dig (cdr n)) (sum 0))
-                             (while dig
-                               (if (cdr dig)
-                                   (setq sum (% (+ (+ sum (car dig))
-                                                   (* (nth 1 dig) 1000))
-                                                111111)
-                                         dig (cdr (cdr dig)))
-                                 (setq sum (% (+ sum (car dig)) 111111)
-                                       dig nil)))
+                        (t (let ((q n) (sum 0))
+                              (while (not (eq q 0))
+                                (setq sum (%
+                                           (+
+                                            sum
+                                            (calcFunc-mod 
+                                             q 1000000))
+                                           111111))
+                                (setq q 
+                                      (math-quotient 
+                                       q 1000000)))
                              (cond ((= (% sum 3) 0) '(nil 3))
                                    ((= (% sum 7) 0) '(nil 7))
                                    ((= (% sum 11) 0) '(nil 11))
index 4c1e852..ff2dc3e 100644 (file)
     (let ((val (save-excursion
                 (set-buffer (aref info 1))
                 (let ((calc-language nil)
-                      (math-expr-opers math-standard-opers))
+                      (math-expr-opers (math-standard-ops)))
                   (math-read-expr str)))))
       (if (eq (car-safe val) 'error)
          (progn
index f4888f6..5a33477 100644 (file)
@@ -1878,8 +1878,19 @@ calc-kill calc-kill-region calc-yank))))
        (last-prec (intern (concat (symbol-name name) "-last-prec")))
        (last-val (intern (concat (symbol-name name) "-last"))))
     (list 'progn
-         (list 'defvar cache-prec (if init (math-numdigs (nth 1 init)) -100))
-         (list 'defvar cache-val (list 'quote init))
+;        (list 'defvar cache-prec (if init (math-numdigs (nth 1 init)) -100))
+         (list 'defvar cache-prec 
+                `(cond
+                  ((consp ,init) (math-numdigs (nth 1 ,init)))
+                  (,init 
+                   (nth 1 (math-numdigs (eval ,init))))
+                  (t
+                   -100)))
+         (list 'defvar cache-val 
+                `(cond
+                  ((consp ,init) ,init)
+                  (,init (eval ,init))
+                  (t ,init)))
          (list 'defvar last-prec -100)
          (list 'defvar last-val nil)
          (list 'setq 'math-cache-list
@@ -1914,7 +1925,12 @@ calc-kill calc-kill-region calc-yank))))
 (put 'math-defcache 'lisp-indent-hook 2)
 
 ;;; Betcha didn't know that pi = 16 atan(1/5) - 4 atan(1/239).   [F] [Public]
-(math-defcache math-pi (float (bigpos 463 238 793 589 653 592 141 3) -21)
+(defconst math-approx-pi
+  (eval-when-compile
+    (math-read-number-simple "3.141592653589793238463"))
+  "An approximation for pi.")
+
+(math-defcache math-pi math-approx-pi
   (math-add-float (math-mul-float '(float 16 0)
                                  (math-arctan-raw '(float 2 -1)))
                  (math-mul-float '(float -4 0)
@@ -1945,7 +1961,11 @@ calc-kill calc-kill-region calc-yank))))
 (math-defcache math-sqrt-two-pi nil
   (math-sqrt-float (math-two-pi)))
 
-(math-defcache math-sqrt-e (float (bigpos 849 146 128 700 270 721 648 1) -21)
+(defconst math-approx-sqrt-e
+  (eval-when-compile (math-read-number-simple "1.648721270700128146849"))
+  "An approximation for sqrt(3).")
+    
+(math-defcache math-sqrt-e math-approx-sqrt-e
   (math-add-float '(float 1 0) (math-exp-minus-1-raw '(float 5 -1))))
 
 (math-defcache math-e nil
@@ -1955,10 +1975,14 @@ calc-kill calc-kill-region calc-yank))))
   (math-mul-float (math-add-float (math-sqrt-raw '(float 5 0)) '(float 1 0))
                  '(float 5 -1)))
 
-(math-defcache math-gamma-const nil
-  '(float (bigpos 495 467 917 632 470 369 709 646 776 267 677 848 348 672
-                 057 988 235 399 359 593 421 310 024 824 900 120 065 606
-                 328 015 649 156 772 5) -100))
+(defconst math-approx-gamma-const
+  (eval-when-compile
+    (math-read-number-simple 
+     "0.5772156649015328606065120900824024310421593359399235988057672348848677267776646709369470632917467495"))
+  "An approximation for gamma.")
+
+(math-defcache math-gamma-const nil 
+  math-approx-gamma-const)
 
 (defun math-half-circle (symb)
   (if (eq calc-angle-mode 'rad)
@@ -2189,6 +2213,25 @@ calc-kill calc-kill-region calc-yank))))
       a
     (math-reject-arg a 'constp)))
 
+;;; Some functions for working with error forms.
+(defun math-get-value (x)
+  "Get the mean value of the error form X.
+If X is not an error form, return X."
+  (if (eq (car-safe x) 'sdev)
+      (nth 1 x)
+    x))
+       
+(defun math-get-sdev (x &optional one)
+  "Get the standard deviation of the error form X.
+If X is not an error form, return 1."
+  (if (eq (car-safe x) 'sdev)
+      (nth 2 x)
+    (if one 1 0)))
+
+(defun math-contains-sdev-p (ls)
+  "Non-nil if the list LS contains an error form."
+  (let ((ls (if (eq (car-safe ls) 'vec) (cdr ls) ls)))
+    (memq t (mapcar (lambda (x) (eq (car-safe x) 'sdev)) ls))))
 
 ;;; Coerce integer A to be a small integer.  [S I]
 (defun math-fixnum (a)
@@ -2202,7 +2245,7 @@ calc-kill calc-kill-region calc-yank))))
 
 (defun math-fixnum-big (a)
   (if (cdr a)
-      (+ (car a) (* (math-fixnum-big (cdr a)) 1000))
+      (+ (car a) (* (math-fixnum-big (cdr a)) math-bignum-digit-size))
     (car a)))
 
 (defvar math-simplify-only nil)
@@ -2960,7 +3003,7 @@ calc-kill calc-kill-region calc-yank))))
 
 (defun math-read-plain-expr (exp-str &optional error-check)
   (let* ((calc-language nil)
-        (math-expr-opers math-standard-opers)
+        (math-expr-opers (math-standard-ops))
         (val (math-read-expr exp-str)))
     (and error-check
         (eq (car-safe val) 'error)
@@ -3116,7 +3159,7 @@ calc-kill calc-kill-region calc-yank))))
     (concat (substring (symbol-name (car a)) 9)
            "(" (math-vector-to-string (nth 1 a) t) ")"))
    (t
-    (let ((op (math-assq2 (car a) math-standard-opers)))
+    (let ((op (math-assq2 (car a) (math-standard-ops))))
       (cond ((and op (= (length a) 3))
             (if (> prec (min (nth 2 op) (nth 3 op)))
                 (concat "(" (math-format-flat-expr a 0) ")")
index b8692e0..7ac0a0b 100644 (file)
               (setcdr math-fd-dt nil))
          fmt))))
 
+(defconst math-julian-date-beginning '(float 17214235 -1)
+  "The beginning of the Julian calendar,
+as measured in the number of days before January 1 of the year 1AD.")
+
+(defconst math-julian-date-beginning-int 1721424
+  "The beginning of the Julian calendar,
+as measured in the integer number of days before January 1 of the year 1AD.")
+
 (defun math-format-date-part (x)
   (cond ((stringp x)
         x)
        ((eq x 'n)
         (math-format-number (math-floor math-fd-date)))
        ((eq x 'J)
-        (math-format-number (math-add math-fd-date '(float (bigpos 235 214 17) -1))))
+        (math-format-number 
+          (math-add math-fd-date math-julian-date-beginning)))
        ((eq x 'j)
-        (math-format-number (math-add (math-floor math-fd-date) '(bigpos 424 721 1))))
+        (math-format-number (math-add 
+                              (math-floor math-fd-date) 
+                              math-julian-date-beginning-int)))
        ((eq x 'U)
         (math-format-number (nth 1 (math-date-parts math-fd-date 719164))))
        ((progn
                                              0
                                            (if (or (eq this 'j)
                                                    (math-integerp num))
-                                               '(bigpos 424 721 1)
-                                             '(float (bigpos 235 214 17)
-                                                     -1))))
+                                                math-julian-date-beginning-int
+                                              math-julian-date-beginning)))
                            hour (or (nth 3 num) hour)
                            minute (or (nth 4 num) minute)
                            second (or (nth 5 num) second)
 (defun calcFunc-julian (date &optional zone)
   (if (math-realp date)
       (list 'date (if (math-integerp date)
-                     (math-sub date '(bigpos 424 721 1))
-                   (setq date (math-sub date '(float (bigpos 235 214 17) -1)))
+                     (math-sub date math-julian-date-beginning-int)
+                   (setq date (math-sub date math-julian-date-beginning))
                    (math-sub date (math-div (calcFunc-tzone zone date)
                                             '(float 864 2)))))
     (if (eq (car date) 'date)
        (math-add (nth 1 date) (if (math-integerp (nth 1 date))
-                                  '(bigpos 424 721 1)
-                                (math-add '(float (bigpos 235 214 17) -1)
+                                   math-julian-date-beginning-int
+                                (math-add math-julian-date-beginning
                                           (math-div (calcFunc-tzone zone date)
                                                     '(float 864 2)))))
       (math-reject-arg date 'datep))))
index 9f7a6ee..b0209d3 100644 (file)
   (or (math-numberp x) (math-reject-arg x 'numberp))
   (calcFunc-fact (math-add x -1)))
 
-(defun math-gammap1-raw (x &optional fprec nfprec)   ; compute gamma(1 + x)
+(defun math-gammap1-raw (x &optional fprec nfprec)
+  "Compute gamma(1+X) to the appropriate precision."
   (or fprec
       (setq fprec (math-float calc-internal-prec)
            nfprec (math-float (- calc-internal-prec))))
        ((Math-lessp '(float 8 0) (math-abs-approx x))
         (let* ((z (math-div '(float 8 0) x))
                (y (math-sqr z))
-               (xx (math-add x '(float (bigneg 164 398 785) -9)))
+               (xx (math-add x 
+                              (eval-when-compile
+                                (math-read-number-simple "-0.785398164"))))
                (a1 (math-poly-eval y
-                                   '((float (bigpos 211 887 093 2) -16)
-                                     (float (bigneg 639 370 073 2) -15)
-                                     (float (bigpos 407 510 734 2) -14)
-                                     (float (bigneg 627 628 098 1) -12)
-                                     (float 1 0))))
+                        (eval-when-compile
+                          (list
+                           (math-read-number-simple "0.0000002093887211")
+                           (math-read-number-simple "-0.000002073370639")
+                           (math-read-number-simple "0.00002734510407")
+                           (math-read-number-simple "-0.001098628627")
+                           '(float 1 0)))))
                (a2 (math-poly-eval y
-                                   '((float (bigneg 152 935 934) -16)
-                                     (float (bigpos 161 095 621 7) -16)
-                                     (float (bigneg 651 147 911 6) -15)
-                                     (float (bigpos 765 488 430 1) -13)
-                                     (float (bigneg 995 499 562 1) -11))))
+                         (eval-when-compile
+                           (list
+                            (math-read-number-simple "-0.0000000934935152")
+                            (math-read-number-simple "0.0000007621095161")
+                            (math-read-number-simple "-0.000006911147651")
+                            (math-read-number-simple "0.0001430488765")
+                            (math-read-number-simple "-0.01562499995")))))
                (sc (math-sin-cos-raw xx)))
               (if yflag
                   (setq sc (cons (math-neg (cdr sc)) (car sc))))
               (math-mul (math-sqrt
-                         (math-div '(float (bigpos 722 619 636) -9) x))
+                         (math-div (eval-when-compile
+                                      (math-read-number-simple "0.636619722"))
+ x))
                         (math-sub (math-mul (cdr sc) a1)
                                   (math-mul (car sc) (math-mul z a2))))))
         (t
          (let ((y (math-sqr x)))
            (math-div (math-poly-eval y
-                                     '((float (bigneg 456 052 849 1) -7)
-                                       (float (bigpos 017 233 739 7) -5)
-                                       (float (bigneg 418 442 121 1) -2)
-                                       (float (bigpos 407 196 516 6) -1)
-                                       (float (bigneg 354 590 362 13) 0)
-                                       (float (bigpos 574 490 568 57) 0)))
+                            (eval-when-compile
+                              (list
+                               (math-read-number-simple "-184.9052456")
+                               (math-read-number-simple "77392.33017")
+                               (math-read-number-simple "-11214424.18")
+                               (math-read-number-simple "651619640.7")
+                               (math-read-number-simple "-13362590354.0")
+                               (math-read-number-simple "57568490574.0"))))
                      (math-poly-eval y
-                                     '((float 1 0)
-                                       (float (bigpos 712 532 678 2) -7)
-                                       (float (bigpos 853 264 927 5) -5)
-                                       (float (bigpos 718 680 494 9) -3)
-                                       (float (bigpos 985 532 029 1) 0)
-                                       (float (bigpos 411 490 568 57) 0))))))))
+                             (eval-when-compile
+                               (list
+                                '(float 1 0)
+                                (math-read-number-simple "267.8532712")
+                                (math-read-number-simple "59272.64853")
+                                (math-read-number-simple "9494680.718")
+                                (math-read-number-simple "1029532985.0")
+                                (math-read-number-simple "57568490411.0")))))))))
 
 (defun math-besJ1 (x &optional yflag)
   (cond ((and (math-negp (calcFunc-re x)) (not yflag))
        ((Math-lessp '(float 8 0) (math-abs-approx x))
         (let* ((z (math-div '(float 8 0) x))
                (y (math-sqr z))
-               (xx (math-add x '(float (bigneg 491 194 356 2) -9)))
+               (xx (math-add x (eval-when-compile 
+                                  (math-read-number-simple "-2.356194491"))))
                (a1 (math-poly-eval y
-                                   '((float (bigneg 019 337 240) -15)
-                                     (float (bigpos 174 520 457 2) -15)
-                                     (float (bigneg 496 396 516 3) -14)
-                                     (float 183105 -8)
-                                     (float 1 0))))
+                            (eval-when-compile
+                              (list
+                               (math-read-number-simple "-0.000000240337019")
+                               (math-read-number-simple "0.000002457520174")
+                               (math-read-number-simple "-0.00003516396496")
+                               '(float 183105 -8)
+                               '(float 1 0)))))
                (a2 (math-poly-eval y
-                                   '((float (bigpos 412 787 105) -15)
-                                     (float (bigneg 987 228 88) -14)
-                                     (float (bigpos 096 199 449 8) -15)
-                                     (float (bigneg 873 690 002 2) -13)
-                                     (float (bigpos 995 499 687 4) -11))))
+                             (eval-when-compile
+                               (list
+                                (math-read-number-simple "0.000000105787412")
+                                (math-read-number-simple "-0.00000088228987")
+                                (math-read-number-simple "0.000008449199096")
+                                (math-read-number-simple "-0.0002002690873")
+                                (math-read-number-simple "0.04687499995")))))
                (sc (math-sin-cos-raw xx)))
           (if yflag
               (setq sc (cons (math-neg (cdr sc)) (car sc)))
             (if (math-negp x)
                 (setq sc (cons (math-neg (car sc)) (math-neg (cdr sc))))))
-          (math-mul (math-sqrt (math-div '(float (bigpos 722 619 636) -9) x))
+          (math-mul (math-sqrt (math-div 
+                                 (eval-when-compile
+                                   (math-read-number-simple "0.636619722"))
+                                 x))
                     (math-sub (math-mul (cdr sc) a1)
                               (math-mul (car sc) (math-mul z a2))))))
        (t
           (math-mul
            x
            (math-div (math-poly-eval y
-                                     '((float (bigneg 606 036 016 3) -8)
-                                       (float (bigpos 826 044 157) -4)
-                                       (float (bigneg 439 611 972 2) -3)
-                                       (float (bigpos 531 968 423 2) -1)
-                                       (float (bigneg 235 059 895 7) 0)
-                                       (float (bigpos 232 614 362 72) 0)))
+                             (eval-when-compile
+                               (list
+                                (math-read-number-simple "-30.16036606")
+                                (math-read-number-simple "15704.4826")
+                                (math-read-number-simple "-2972611.439")
+                                (math-read-number-simple "242396853.1")
+                                (math-read-number-simple "-7895059235.0")
+                                (math-read-number-simple "72362614232.0"))))
                      (math-poly-eval y
-                                     '((float 1 0)
-                                       (float (bigpos 397 991 769 3) -7)
-                                       (float (bigpos 394 743 944 9) -5)
-                                       (float (bigpos 474 330 858 1) -2)
-                                       (float (bigpos 178 535 300 2) 0)
-                                       (float (bigpos 442 228 725 144)
-                                              0)))))))))
+                              (eval-when-compile
+                                (list
+                                 '(float 1 0)
+                                 (math-read-number-simple "376.9991397")
+                                 (math-read-number-simple "99447.43394")
+                                 (math-read-number-simple "18583304.74")
+                                 (math-read-number-simple "2300535178.0")
+                                 (math-read-number-simple "144725228442.0"))))))))))
 
 (defun calcFunc-besY (v x)
   (math-inexact-result)
         (let ((y (math-sqr x)))
           (math-add
            (math-div (math-poly-eval y
-                                     '((float (bigpos 733 622 284 2) -7)
-                                       (float (bigneg 757 792 632 8) -5)
-                                       (float (bigpos 129 988 087 1) -2)
-                                       (float (bigneg 036 598 123 5) -1)
-                                       (float (bigpos 065 834 062 7) 0)
-                                       (float (bigneg 389 821 957 2) 0)))
+                            (eval-when-compile
+                              (list
+                               (math-read-number-simple "228.4622733")
+                               (math-read-number-simple "-86327.92757")
+                               (math-read-number-simple "10879881.29")
+                               (math-read-number-simple "-512359803.6")
+                               (math-read-number-simple "7062834065.0")
+                               (math-read-number-simple "-2957821389.0"))))
                      (math-poly-eval y
-                                     '((float 1 0)
-                                       (float (bigpos 244 030 261 2) -7)
-                                       (float (bigpos 647 472 474) -4)
-                                       (float (bigpos 438 466 189 7) -3)
-                                       (float (bigpos 648 499 452 7) -1)
-                                       (float (bigpos 269 544 076 40) 0))))
-           (math-mul '(float (bigpos 772 619 636) -9)
+                            (eval-when-compile
+                              (list
+                               '(float 1 0)
+                               (math-read-number-simple "226.1030244")
+                               (math-read-number-simple "47447.2647")
+                               (math-read-number-simple "7189466.438")
+                               (math-read-number-simple "745249964.8")
+                               (math-read-number-simple "40076544269.0")))))
+           (math-mul (eval-when-compile
+                        (math-read-number-simple "0.636619772"))
                      (math-mul (math-besJ0 x) (math-ln-raw x))))))
        ((math-negp (calcFunc-re x))
         (math-add (math-besJ0 (math-neg x) t)
            (math-mul
             x
             (math-div (math-poly-eval y
-                                      '((float (bigpos 935 937 511 8) -6)
-                                        (float (bigneg 726 922 237 4) -3)
-                                        (float (bigpos 551 264 349 7) -1)
-                                        (float (bigneg 139 438 153 5) 1)
-                                        (float (bigpos 439 527 127) 4)
-                                        (float (bigneg 943 604 900 4) 3)))
+                             (eval-when-compile
+                               (list
+                                (math-read-number-simple "8511.937935")
+                                (math-read-number-simple "-4237922.726")
+                                (math-read-number-simple "734926455.1")
+                                (math-read-number-simple "-51534381390.0")
+                                (math-read-number-simple "1275274390000.0")
+                                (math-read-number-simple "-4900604943000.0"))))
                       (math-poly-eval y
-                                      '((float 1 0)
-                                        (float (bigpos 885 632 549 3) -7)
-                                        (float (bigpos 605 042 102) -3)
-                                        (float (bigpos 002 904 245 2) -2)
-                                        (float (bigpos 367 650 733 3) 0)
-                                        (float (bigpos 664 419 244 4) 2)
-                                        (float (bigpos 057 958 249) 5)))))
-           (math-mul '(float (bigpos 772 619 636) -9)
-                     (math-sub (math-mul (math-besJ1 x) (math-ln-raw x))
+                             (eval-when-compile
+                               (list
+                                '(float 1 0)
+                                (math-read-number-simple "354.9632885")
+                                (math-read-number-simple "102042.605")
+                                (math-read-number-simple "22459040.02")
+                                (math-read-number-simple "3733650367.0")
+                                (math-read-number-simple "424441966400.0")
+                                (math-read-number-simple "24995805700000.0"))))))
+           (math-mul (eval-when-compile (math-read-number-simple "0.636619772"))
+                      (math-sub (math-mul (math-besJ1 x) (math-ln-raw x))
                                (math-div 1 x))))))
        ((math-negp (calcFunc-re x))
         (math-neg
                    (calcFunc-euler n '(float 5 -1)))
                (calcFunc-euler n '(frac 1 2))))))
 
-(defvar math-bernoulli-b-cache '((frac -174611
-                                      (bigpos 0 200 291 698 662 857 802))
-                                (frac 43867 (bigpos 0 944 170 217 94 109 5))
-                                (frac -3617 (bigpos 0 880 842 622 670 10))
-                                (frac 1 (bigpos 600 249 724 74))
-                                (frac -691 (bigpos 0 368 674 307 1))
-                                (frac 1 (bigpos 160 900 47))
-                                (frac -1 (bigpos 600 209 1))
-                                (frac 1 30240) (frac -1 720)
-                                (frac 1 12) 1 ))
+(defvar math-bernoulli-b-cache 
+  (eval-when-compile
+    (list
+     (list 'frac 
+           -174611
+           (math-read-number-simple "802857662698291200000"))
+     (list 'frac 
+           43867 
+           (math-read-number-simple "5109094217170944000"))
+     (list 'frac 
+           -3617 
+           (math-read-number-simple "10670622842880000"))
+     (list 'frac 
+           1 
+           (math-read-number-simple "74724249600"))
+     (list 'frac 
+           -691 
+           (math-read-number-simple "1307674368000"))
+     (list 'frac 
+           1 
+           (math-read-number-simple "47900160"))
+     (list 'frac 
+           -1 
+           (math-read-number-simple "1209600"))
+     (list 'frac 
+           1 
+           30240) 
+     (list 'frac 
+           -1 
+           720)
+     (list 'frac 
+           1 
+           12) 
+     1 )))
 
 (defvar math-bernoulli-B-cache '((frac -174611 330) (frac 43867 798)
                                 (frac -3617 510) (frac 7 6) (frac -691 2730)
index 48bdecf..a7e85d9 100644 (file)
          0)
      (or (and (Math-num-integerp pstyle) (math-trunc pstyle))
          (if (eq (car-safe (calc-var-value (nth 2 ydata))) 'vec)
-             0 -1)))))
+             0 -1))
+     (math-contains-sdev-p (eval (nth 2 ydata))))))
 
 (defun calc-graph-lookup (thing)
   (if (and (eq (car-safe thing) 'var)
          calc-graph-numsteps (1- (* calc-graph-numsteps (1+ calc-graph-numsteps3))))))
 
 (defun calc-graph-format-data ()
+  (if (math-contains-sdev-p calc-graph-yp)
+      (let ((yp calc-graph-yp))
+        (setq calc-graph-yp (cons 'vec (mapcar 'math-get-value (cdr yp))))
+        (setq calc-graph-zp (cons 'vec (mapcar 'math-get-sdev (cdr yp))))))
   (while (<= (setq calc-graph-stepcount (1+ calc-graph-stepcount)) calc-graph-numsteps)
     (if calc-graph-xvec
        (setq calc-graph-xp (cdr calc-graph-xp)
@@ -1059,7 +1064,7 @@ This \"dumb\" driver will be present in Gnuplot 3.0."
   (interactive "P")
   (calc-graph-set-styles t (and style (prefix-numeric-value style))))
 
-(defun calc-graph-set-styles (lines points)
+(defun calc-graph-set-styles (lines points &optional yerr)
   (calc-graph-init)
   (save-excursion
     (set-buffer calc-gnuplot-input)
@@ -1067,7 +1072,7 @@ This \"dumb\" driver will be present in Gnuplot 3.0."
        (error "No data points have been set!"))
     (let ((base (point))
          (mode nil) (lstyle nil) (pstyle nil)
-         start end lenbl penbl)
+         start end lenbl penbl errform)
       (re-search-forward "[,\n]")
       (forward-char -1)
       (setq end (point) start end)
@@ -1087,29 +1092,48 @@ This \"dumb\" driver will be present in Gnuplot 3.0."
                (setq pstyle (string-to-number
                              (buffer-substring (match-beginning 1)
                                                (match-end 1)))))))
-      (setq lenbl (or (equal mode "lines") (equal mode "linespoints"))
-           penbl (or (equal mode "points") (equal mode "linespoints")))
-      (if lines
-         (or (eq lines t)
-             (setq lstyle lines
-                   lenbl (>= lines 0)))
-       (setq lenbl (not lenbl)))
-      (if points
-         (or (eq points t)
-             (setq pstyle points
-                   penbl (>= points 0)))
-       (setq penbl (not penbl)))
-      (delete-region start end)
+      (unless yerr
+        (setq lenbl (or (equal mode "lines") 
+                        (equal mode "linespoints"))
+              penbl (or (equal mode "points") 
+                        (equal mode "linespoints")))
+        (if lines
+            (or (eq lines t)
+                (setq lstyle lines
+                      lenbl (>= lines 0)))
+          (setq lenbl (not lenbl)))
+        (if points
+            (or (eq points t)
+                (setq pstyle points
+                      penbl (>= points 0)))
+          (setq penbl (not penbl))))
+        (delete-region start end)
       (goto-char start)
-      (insert " with "
-             (if lenbl
-                 (if penbl "linespoints" "lines")
-               (if penbl "points" "dots")))
-      (if (and pstyle (> pstyle 0))
-         (insert " " (if (and lstyle (> lstyle 0)) (int-to-string lstyle) "1")
-                 " " (int-to-string pstyle))
-       (if (and lstyle (> lstyle 0))
-           (insert " " (int-to-string lstyle))))))
+      (setq errform
+            (condition-case nil
+                (math-contains-sdev-p
+                 (eval (intern 
+                        (concat "var-"
+                                (save-excursion
+                                  (re-search-backward ":\\(.*\\)\\}")
+                                  (match-string 1))))))
+              (error nil)))
+      (if yerr
+          (insert " with yerrorbars")
+        (insert " with "
+                (if (and errform
+                         (equal mode "dots")
+                         (eq lines t))
+                    "yerrorbars"
+                  (if lenbl
+                      (if penbl "linespoints" "lines")
+                    (if penbl "points" "dots"))))
+        (if (and pstyle (> pstyle 0))
+            (insert " " 
+                    (if (and lstyle (> lstyle 0)) (int-to-string lstyle) "1")
+                    " " (int-to-string pstyle))
+          (if (and lstyle (> lstyle 0))
+              (insert " " (int-to-string lstyle)))))))
   (calc-graph-view-commands))
 
 (defun calc-graph-zero-x (flag)
index c2d3369..871f281 100644 (file)
@@ -414,7 +414,7 @@ C-w  Describe how there is no warranty for Calc."
     (princ (format "GNU Emacs Calculator version %s.\n"
                   calc-version))
     (princ "  By Dave Gillespie.\n")
-    (princ "  Copyright (C) 2007 Free Software Foundation, Inc.\n\n")
+    (princ (format "  %s\n\n" emacs-copyright))
     (princ "Type `h s' for a more detailed summary.\n")
     (princ "Or type `h i' to read the full Calc manual on-line.\n\n")
     (princ "Basic keys:\n")
index 3bb1e41..efaf17e 100644 (file)
@@ -35,7 +35,7 @@
 ;;; Alternate entry/display languages.
 
 (defun calc-set-language (lang &optional option no-refresh)
-  (setq math-expr-opers (or (get lang 'math-oper-table) math-standard-opers)
+  (setq math-expr-opers (or (get lang 'math-oper-table) (math-standard-ops))
        math-expr-function-mapping (get lang 'math-function-table)
        math-expr-special-function-mapping (get lang 'math-special-function-table)
        math-expr-variable-mapping (get lang 'math-variable-table)
                                         h (1+ v) (1+ h) math-rb-v2)
                                        (string-match "<=\\|>=\\|\\+/-\\|!=\\|&&\\|||\\|:=\\|=>\\|." line h)
                                        (assoc (math-match-substring line 0)
-                                              math-standard-opers)))
+                                              (math-standard-ops))))
                      (and (>= (nth 2 widest) prec)
                           (setq h (match-end 0)))
                    (and (not (eq (string-match ",\\|;\\|\\.\\.\\|)\\|\\]\\|:" line h)
index 249dff5..a4dad15 100644 (file)
 (require 'calc-ext)
 (require 'calc-macs)
 
+
+;;; Find out how many 9s in 9.9999... will give distinct Emacs floats,
+;;; then back off by one.
+
+(defvar math-emacs-precision
+  (let* ((n 1)
+         (x 9)
+         (xx (+ x (* 9 (expt 10 (- n))))))
+    (while (/= x xx)
+      (progn
+        (setq n (1+ n))
+        (setq x xx)
+        (setq xx (+ x (* 9 (expt 10 (- n)))))))
+    (1- n))
+  "The number of digits in an Emacs float.")
+
+;;; Find the largest power of 10 which is an Emacs float, 
+;;; then back off by one so that any float d.dddd...eN 
+;;; is an Emacs float, for acceptable d.dddd....
+
+(defvar math-largest-emacs-expt
+  (let ((x 1))
+    (while (condition-case nil
+               (expt 10.0 x)
+             (error nil))
+      (setq x (* 2 x)))
+    (setq x (/ x 2))
+    (while (condition-case nil
+               (expt 10.0 x)
+             (error nil))
+      (setq x (1+ x)))
+    (- x 2))
+  "The largest exponent which Calc will convert to an Emacs float.")
+
+(defvar math-smallest-emacs-expt
+  (let ((x -1))
+    (while (condition-case nil
+               (expt 10.0 x)
+             (error nil))
+      (setq x (* 2 x)))
+    (setq x (/ x 2))
+    (while (condition-case nil
+               (expt 10.0 x)
+             (error nil))
+      (setq x (1- x)))
+    (+ x 2))
+    "The smallest exponent which Calc will convert to an Emacs float.")
+
+(defun math-use-emacs-fn (fn x)
+  "Use the native Emacs function FN to evaluate the Calc number X.
+If this can't be done, return NIL."
+  (and
+   (<= calc-internal-prec math-emacs-precision)
+   (math-realp x)
+   (let* ((fx (math-float x))
+          (xpon (+ (nth 2 x) (1- (math-numdigs (nth 1 x))))))
+     (and (<= math-smallest-emacs-expt xpon)
+          (<= xpon math-largest-emacs-expt)
+          (condition-case nil
+              (math-read-number
+               (number-to-string
+                (funcall fn 
+                         (string-to-number (math-format-number (math-float x))))))
+            (error nil))))))
+
 (defun calc-sqrt (arg)
   (interactive "P")
   (calc-slow-wrapper
        (let* ((top (nthcdr (- len 2) a)))
          (math-isqrt-bignum-iter
           a
-          (math-scale-bignum-3
+          (math-scale-bignum-digit-size
            (math-bignum-big
             (1+ (math-isqrt-small
-                 (+ (* (nth 1 top) 1000) (car top)))))
+                 (+ (* (nth 1 top) math-bignum-digit-size) (car top)))))
            (1- (/ len 2)))))
       (let* ((top (nth (1- len) a)))
        (math-isqrt-bignum-iter
         a
-        (math-scale-bignum-3
+        (math-scale-bignum-digit-size
          (list (1+ (math-isqrt-small top)))
          (/ len 2)))))))
 
         (while (eq (car (setq a (cdr a))) 0))
         (null a))))
 
-(defun math-scale-bignum-3 (a n)   ; [L L S]
+(defun math-scale-bignum-digit-size (a n)   ; [L L S]
   (while (> n 0)
     (setq a (cons 0 a)
          n (1- n)))
   a)
 
 (defun math-isqrt-small (a)   ; A > 0.  [S S]
-  (let ((g (cond ((>= a 10000) 1000)
+  (let ((g (cond ((>= a 1000000) 10000)
+                 ((>= a 10000) 1000)
                 ((>= a 100) 100)
                 (t 10)))
        g2)
 (defun math-sqrt-raw (a &optional guess)   ; [F F F]
   (if (not (Math-posp a))
       (math-sqrt a)
-    (if (null guess)
-       (let ((ldiff (- (math-numdigs (nth 1 a)) 6)))
-         (or (= (% (+ (nth 2 a) ldiff) 2) 0) (setq ldiff (1+ ldiff)))
-         (setq guess (math-make-float (math-isqrt-small
-                                       (math-scale-int (nth 1 a) (- ldiff)))
-                                      (/ (+ (nth 2 a) ldiff) 2)))))
-    (math-sqrt-float-iter a guess)))
+    (cond
+     ((math-use-emacs-fn 'sqrt a))
+     (t
+      (if (null guess)
+          (let ((ldiff (- (math-numdigs (nth 1 a)) 6)))
+            (or (= (% (+ (nth 2 a) ldiff) 2) 0) (setq ldiff (1+ ldiff)))
+            (setq guess (math-make-float (math-isqrt-small
+                                          (math-scale-int (nth 1 a) (- ldiff)))
+                                         (/ (+ (nth 2 a) ldiff) 2)))))
+      (math-sqrt-float-iter a guess)))))
 
 (defun math-sqrt-float-iter (a guess)   ; [F F F]
   (math-working "sqrt" guess)
          ((math-lessp-float x (math-neg (math-pi-over-4)))
           (math-neg (math-cos-raw-2 (math-add (math-pi-over-2) x) orgx)))
          ((math-nearly-zerop-float x orgx) '(float 0 0))
+          ((math-use-emacs-fn 'sin x))
          (calc-symbolic-mode (signal 'inexact-result nil))
          (t (math-sin-series x 6 4 x (math-neg-float (math-sqr-float x)))))))
 
 (defun math-cos-raw-2 (x orgx)   ; [F F]
   (cond ((math-nearly-zerop-float x orgx) '(float 1 0))
+        ((math-use-emacs-fn 'cos x))
        (calc-symbolic-mode (signal 'inexact-result nil))
        (t (let ((xnegsqr (math-neg-float (math-sqr-float x))))
             (math-sin-series
        ((Math-integer-negp (nth 1 x))
         (math-neg-float (math-arctan-raw (math-neg-float x))))
        ((math-zerop x) x)
+        ((math-use-emacs-fn 'atan x))
        (calc-symbolic-mode (signal 'inexact-result nil))
        ((math-equal-int x 1) (math-pi-over-4))
        ((math-equal-int x -1) (math-neg (math-pi-over-4)))
           (list 'polar
                 (math-exp-raw (nth 1 xc))
                 (math-from-radians (nth 2 xc)))))
+        ((math-use-emacs-fn 'exp x))
        ((or (math-lessp-float '(float 5 -1) x)
             (math-lessp-float x '(float -5 -1)))
         (if (math-lessp-float '(float 921035 1) x)
         '(float 0 0))
        (calc-symbolic-mode (signal 'inexact-result nil))
        ((math-posp (nth 1 x))    ; positive and real
-        (let ((xdigs (1- (math-numdigs (nth 1 x)))))
-          (math-add-float (math-ln-raw-2 (list 'float (nth 1 x) (- xdigs)))
-                          (math-mul-float (math-float (+ (nth 2 x) xdigs))
-                                          (math-ln-10)))))
+         (cond 
+          ((math-use-emacs-fn 'log x))
+          (t
+           (let ((xdigs (1- (math-numdigs (nth 1 x)))))
+             (math-add-float (math-ln-raw-2 (list 'float (nth 1 x) (- xdigs)))
+                             (math-mul-float (math-float (+ (nth 2 x) xdigs))
+                                             (math-ln-10)))))))
        ((math-zerop x)
         (math-reject-arg x "*Logarithm of zero"))
        ((eq calc-complex-mode 'polar)    ; negative and real
        sum
       (math-lnp1-series nextsum (1+ n) nextx x))))
 
-(math-defcache math-ln-10 (float (bigpos 018 684 045 994 092 585 302 2) -21)
+(defconst math-approx-ln-10
+  (eval-when-compile
+    (math-read-number-simple "2.302585092994045684018"))
+  "An approximation for ln(10).")
+     
+(math-defcache math-ln-10 math-approx-ln-10
   (math-ln-raw-2 '(float 1 1)))
 
-(math-defcache math-ln-2 (float (bigpos 417 309 945 559 180 147 693) -21)
+(defconst math-approx-ln-2
+  (eval-when-compile
+    (math-read-number-simple "0.693147180559945309417"))
+  "An approximation for ln(2).")
+
+(math-defcache math-ln-2 math-approx-ln-2
   (math-ln-raw-3 (math-float '(frac 1 3))))
 
 
index 1fdb64a..10222fc 100644 (file)
@@ -579,7 +579,7 @@ loaded and the keystroke automatically re-typed."
 
 (defun math-div2-bignum (a)   ; [l l]
   (if (cdr a)
-      (cons (+ (/ (car a) 2) (* (% (nth 1 a) 2) 500))
+      (cons (+ (/ (car a) 2) (* (% (nth 1 a) 2) (/ math-bignum-digit-size 2)))
            (math-div2-bignum (cdr a)))
     (list (/ (car a) 2))))
 
diff --git a/lisp/calc/calc-nlfit.el b/lisp/calc/calc-nlfit.el
new file mode 100644 (file)
index 0000000..4895997
--- /dev/null
@@ -0,0 +1,817 @@
+;;; calc-nlfit.el --- nonlinear curve fitting for Calc
+
+;; Copyright (C) 2007 Free Software Foundation, Inc.
+
+;; Maintainer: Jay Belanger <jay.p.belanger@gmail.com>
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;; This code uses the Levenberg-Marquardt method, as described in
+;; _Numerical Analysis_ by H. R. Schwarz, to fit data to 
+;; nonlinear curves.  Currently, the only the following curves are
+;; supported:
+;; The logistic S curve, y=a/(1+exp(b*(t-c)))
+;;   Here, y is usually interpreted as the population of some
+;;   quantity at time t.  So we will think of the data as consisting
+;;   of quantities q0, q1, ..., qn and their respective times
+;;   t0, t1, ..., tn.
+
+;; The logistic bell curve, y=A*exp(B*(t-C))/(1+exp(B*(t-C)))^2
+;;   Note that this is the derivative of the formula for the S curve.
+;;   We get A=-a*b, B=b and C=c.  Here, y is interpreted as the rate 
+;;   of growth of a population at time t.  So we will think of the 
+;;   data as consisting of rates p0, p1, ..., pn and their 
+;;   respective times t0, t1, ..., tn.
+
+;; The Hubbert Linearization, y/x=A*(1-x/B)
+;;   Here, y is thought of as the rate of growth of a population
+;;   and x represents the actual population.  This is essentially 
+;;   the differential equation describing the actual population.
+
+;; The Levenberg-Marquardt method is an iterative process: it takes
+;; an initial guess for the parameters and refines them.  To get an
+;; initial guess for the parameters, we'll use a method described by
+;; Luis de Sousa in "Hubbert's Peak Mathematics".  The idea is that
+;; given quantities Q and the corresponding rates P, they should
+;; satisfy P/Q= mQ+a.  We can use the parameter a for an
+;; approximation for the parameter a in the S curve, and
+;; approximations for b and c are found using least squares on the
+;; linearization log((a/y)-1) = log(bb) + cc*t of
+;; y=a/(1+bb*exp(cc*t)), which is equivalent to the above s curve
+;; formula, and then tranlating it to b and c.  From this, we can
+;; also get approximations for the bell curve parameters.
+
+;;; Code:
+
+(require 'calc-arith)
+
+(defun math-nlfit-least-squares (xdata ydata &optional sdata sigmas)
+  "Return the parameters A and B for the best least squares fit y=a+bx."
+  (let* ((n (length xdata))
+         (s2data (if sdata 
+                     (mapcar 'calcFunc-sqr sdata)
+                  (make-list n 1)))
+         (S (if sdata 0 n))
+         (Sx 0)
+         (Sy 0)
+         (Sxx 0)
+         (Sxy 0)
+         D)
+    (while xdata
+      (let ((x (car xdata))
+            (y (car ydata))
+            (s (car s2data)))
+        (setq Sx  (math-add Sx (if s (math-div x s) x)))
+        (setq Sy  (math-add Sy (if s (math-div y s) y)))
+        (setq Sxx (math-add Sxx (if s (math-div (math-mul x x) s)
+                                  (math-mul x x))))
+        (setq Sxy (math-add Sxy (if s (math-div (math-mul x y) s)
+                                  (math-mul x y))))
+        (if sdata
+            (setq S (math-add S (math-div 1 s)))))
+      (setq xdata (cdr xdata))
+      (setq ydata (cdr ydata))
+      (setq s2data (cdr s2data)))
+    (setq D (math-sub (math-mul S Sxx) (math-mul Sx Sx)))
+    (let ((A (math-div (math-sub (math-mul Sxx Sy) (math-mul Sx Sxy)) D))
+          (B (math-div (math-sub (math-mul S Sxy) (math-mul Sx Sy)) D)))
+      (if sigmas
+          (let ((C11 (math-div Sxx D))
+                (C12 (math-neg (math-div Sx D)))
+                (C22 (math-div S D)))
+            (list (list 'sdev A (calcFunc-sqrt C11))
+                  (list 'sdev B (calcFunc-sqrt C22))
+                  (list 'vec
+                        (list 'vec C11 C12)
+                        (list 'vec C12 C22))))
+        (list A B)))))
+
+;;; The methods described by de Sousa require the cumulative data qdata
+;;; and the rates pdata.  We will assume that we are given either
+;;; qdata and the corresponding times tdata, or pdata and the corresponding
+;;; tdata.  The following two functions will find pdata or qdata, 
+;;; given the other..
+
+;;; First, given two lists; one of values q0, q1, ..., qn and one of 
+;;; corresponding times t0, t1, ..., tn; return a list 
+;;; p0, p1, ..., pn of the rates of  change of the qi with respect to t.
+;;; p0 is the right hand derivative (q1 - q0)/(t1 - t0).
+;;; pn is the left hand derivative (qn - q(n-1))/(tn - t(n-1)).
+;;; The other pis are the averages of the two:
+;;;      (1/2)((qi - q(i-1))/(ti - t(i-1)) + (q(i+1) - qi)/(t(i+1) - ti)).
+
+(defun math-nlfit-get-rates-from-cumul (tdata qdata)
+  (let ((pdata (list
+                (math-div 
+                 (math-sub (nth 1 qdata)
+                           (nth 0 qdata))
+                 (math-sub (nth 1 tdata)
+                           (nth 0 tdata))))))
+    (while (> (length qdata) 2)
+      (setq pdata
+            (cons
+             (math-mul
+              '(float 5 -1)
+              (math-add
+               (math-div
+                (math-sub (nth 2 qdata)
+                          (nth 1 qdata))
+                (math-sub (nth 2 tdata)
+                          (nth 1 tdata)))
+               (math-div
+                (math-sub (nth 1 qdata)
+                          (nth 0 qdata))
+                (math-sub (nth 1 tdata)
+                          (nth 0 tdata)))))
+             pdata))
+      (setq qdata (cdr qdata)))
+    (setq pdata
+          (cons
+           (math-div
+            (math-sub (nth 1 qdata)
+                      (nth 0 qdata))
+            (math-sub (nth 1 tdata)
+                      (nth 0 tdata)))
+           pdata))
+    (reverse pdata)))
+
+;;; Next, given two lists -- one of rates p0, p1, ..., pn and one of 
+;;; corresponding times t0, t1, ..., tn -- and an initial values q0,
+;;;  return a list q0, q1, ..., qn of the cumulative values.
+;;; q0 is the initial value given.
+;;; For i>0, qi is computed using the trapezoid rule:
+;;;     qi = q(i-1) + (1/2)(pi + p(i-1))(ti - t(i-1))
+
+(defun math-nlfit-get-cumul-from-rates (tdata pdata q0)
+  (let* ((qdata (list q0)))
+    (while (cdr pdata)
+      (setq qdata
+            (cons
+             (math-add (car qdata)
+                       (math-mul
+                        (math-mul 
+                         '(float 5 -1)
+                         (math-add (nth 1 pdata) (nth 0 pdata)))
+                        (math-sub (nth 1 tdata)
+                                  (nth 0 tdata))))
+             qdata))
+      (setq pdata (cdr pdata))
+      (setq tdata (cdr tdata)))
+    (reverse qdata)))
+
+;;; Given the qdata, pdata and tdata, find the parameters
+;;; a, b and c that fit q = a/(1+b*exp(c*t)).
+;;; a is found using the method described by de Sousa.  
+;;; b and c are found using least squares on the linearization
+;;; log((a/q)-1) = log(b) + c*t
+;;; In some cases (where the logistic curve may well be the wrong
+;;; model), the computed a will be less than or equal to the maximum
+;;; value of q in qdata; in which case the above linearization won't work.
+;;; In this case, a will be replaced by a number slightly above 
+;;; the maximum value of q.
+
+(defun math-nlfit-find-qmax (qdata pdata tdata)
+  (let* ((ratios (mapcar* 'math-div pdata qdata))
+         (lsdata (math-nlfit-least-squares ratios tdata))
+         (qmax (math-max-list (car qdata) (cdr qdata)))
+         (a (math-neg (math-div (nth 1 lsdata) (nth 0 lsdata)))))
+    (if (math-lessp a qmax)
+        (math-add '(float 5 -1) qmax)
+      a)))
+
+(defun math-nlfit-find-logistic-parameters (qdata pdata tdata)
+  (let* ((a (math-nlfit-find-qmax qdata pdata tdata))
+         (newqdata
+          (mapcar (lambda (q) (calcFunc-ln (math-sub (math-div a q) 1)))
+                  qdata))
+         (bandc (math-nlfit-least-squares tdata newqdata)))
+    (list
+     a
+     (calcFunc-exp (nth 0 bandc))
+     (nth 1 bandc))))
+
+;;; Next, given the pdata and tdata, we can find the qdata if we know q0.
+;;; We first try to find q0, using the fact that when p takes on its largest
+;;; value, q is half of its maximum value.  So we'll find the maximum value
+;;; of q given various q0, and use bisection to approximate the correct q0.
+
+;;; First, given pdata and tdata, find what half of qmax would be if q0=0.
+
+(defun math-nlfit-find-qmaxhalf (pdata tdata)
+  (let ((pmax (math-max-list (car pdata) (cdr pdata)))
+        (qmh 0))
+    (while (math-lessp (car pdata) pmax)
+      (setq qmh
+            (math-add qmh
+                      (math-mul
+                       (math-mul 
+                        '(float 5 -1)
+                        (math-add (nth 1 pdata) (nth 0 pdata)))
+                       (math-sub (nth 1 tdata)
+                                 (nth 0 tdata)))))
+      (setq pdata (cdr pdata))
+      (setq tdata (cdr tdata)))
+    qmh))
+
+;;; Next, given pdata and tdata, approximate q0.
+
+(defun math-nlfit-find-q0 (pdata tdata)
+  (let* ((qhalf (math-nlfit-find-qmaxhalf pdata tdata))
+         (q0 (math-mul 2 qhalf))
+         (qdata (math-nlfit-get-cumul-from-rates tdata pdata q0)))
+    (while (math-lessp (math-nlfit-find-qmax 
+                        (mapcar
+                         (lambda (q) (math-add q0 q))
+                         qdata)
+                        pdata tdata)
+                       (math-mul
+                        '(float 5 -1)
+                        (math-add
+                         q0
+                         qhalf)))
+      (setq q0 (math-add q0 qhalf)))
+    (let* ((qmin (math-sub q0 qhalf))
+           (qmax q0)
+           (qt (math-nlfit-find-qmax
+                (mapcar
+                 (lambda (q) (math-add q0 q))
+                 qdata)
+                pdata tdata))
+           (i 0))
+      (while (< i 10)
+        (setq q0 (math-mul '(float 5 -1) (math-add qmin qmax)))
+        (if (math-lessp 
+             (math-nlfit-find-qmax
+              (mapcar
+               (lambda (q) (math-add q0 q))
+               qdata)
+              pdata tdata)
+             (math-mul '(float 5 -1) (math-add qhalf q0)))
+            (setq qmin q0)
+          (setq qmax q0))
+        (setq i (1+ i)))
+      (math-mul '(float 5 -1) (math-add qmin qmax)))))
+
+;;; To improve the approximations to the parameters, we can use 
+;;; Marquardt method as described in Schwarz's book.
+
+;;; Small numbers used in the Givens algorithm
+(defvar math-nlfit-delta '(float 1 -8))
+
+(defvar math-nlfit-epsilon '(float 1 -5))
+
+;;; Maximum number of iterations
+(defvar math-nlfit-max-its 100)
+
+;;; Next, we need some functions for dealing with vectors and
+;;; matrices.  For convenience, we'll work with Emacs lists
+;;; as vectors, rather than Calc's vectors.
+
+(defun math-nlfit-set-elt (vec i x)
+  (setcar (nthcdr (1- i) vec) x))
+
+(defun math-nlfit-get-elt (vec i)
+  (nth (1- i) vec))
+
+(defun math-nlfit-make-matrix (i j)
+  (let ((row (make-list j 0))
+        (mat nil)
+        (k 0))
+    (while (< k i)
+      (setq mat (cons (copy-list row) mat))
+      (setq k (1+ k)))
+    mat))
+
+(defun math-nlfit-set-matx-elt (mat i j x)
+  (setcar (nthcdr (1- j) (nth (1- i) mat)) x))
+
+(defun math-nlfit-get-matx-elt (mat i j)
+  (nth (1- j) (nth (1- i) mat)))
+
+;;; For solving the linearized system.
+;;; (The Givens method, from Schwarz.)
+
+(defun math-nlfit-givens (C d)
+  (let* ((C (copy-tree C))
+         (d (copy-tree d))
+         (n (length (car C)))
+         (N (length C))
+         (j 1)
+         (r (make-list N 0))
+         (x (make-list N 0))
+         w
+         gamma
+         sigma
+         rho)
+    (while (<= j n)
+      (let ((i (1+ j)))
+        (while (<= i N)
+          (let ((cij (math-nlfit-get-matx-elt C i j))
+                (cjj (math-nlfit-get-matx-elt C j j)))
+            (when (not (math-equal 0 cij))
+                (if (math-lessp (calcFunc-abs cjj) 
+                                (math-mul math-nlfit-delta (calcFunc-abs cij)))
+                    (setq w (math-neg cij)
+                          gamma 0
+                          sigma 1
+                          rho 1)
+                  (setq w (math-mul
+                           (calcFunc-sign cjj)
+                           (calcFunc-sqrt 
+                            (math-add
+                             (math-mul cjj cjj)
+                             (math-mul cij cij))))
+                        gamma (math-div cjj w)
+                        sigma (math-neg (math-div cij w)))
+                  (if (math-lessp (calcFunc-abs sigma) gamma)
+                      (setq rho sigma)
+                    (setq rho (math-div (calcFunc-sign sigma) gamma))))
+              (setq cjj w
+                    cij rho)
+              (math-nlfit-set-matx-elt C j j w)
+              (math-nlfit-set-matx-elt C i j rho)
+              (let ((k (1+ j)))
+                (while (<= k n)       
+                  (let* ((cjk (math-nlfit-get-matx-elt C j k))
+                         (cik (math-nlfit-get-matx-elt C i k))
+                         (h (math-sub 
+                             (math-mul gamma cjk) (math-mul sigma cik))))
+                    (setq cik (math-add
+                               (math-mul sigma cjk)
+                               (math-mul gamma cik)))
+                    (setq cjk h)
+                    (math-nlfit-set-matx-elt C i k cik)
+                    (math-nlfit-set-matx-elt C j k cjk)
+                    (setq k (1+ k)))))
+              (let* ((di (math-nlfit-get-elt d i))
+                     (dj (math-nlfit-get-elt d j))
+                     (h (math-sub
+                         (math-mul gamma dj)
+                         (math-mul sigma di))))
+                (setq di (math-add
+                          (math-mul sigma dj)
+                          (math-mul gamma di)))
+                (setq dj h)
+                (math-nlfit-set-elt d i di)
+                (math-nlfit-set-elt d j dj))))
+          (setq i (1+ i))))
+      (setq j (1+ j)))
+    (let ((i n)
+          s)
+      (while (>= i 1)
+        (math-nlfit-set-elt r i 0)
+        (setq s (math-nlfit-get-elt d i))
+        (let ((k (1+ i)))
+          (while (<= k n)
+            (setq s (math-add s (math-mul (math-nlfit-get-matx-elt C i k)
+                            (math-nlfit-get-elt x k))))
+            (setq k (1+ k))))
+        (math-nlfit-set-elt x i 
+                            (math-neg 
+                             (math-div s 
+                                       (math-nlfit-get-matx-elt C i i))))
+        (setq i (1- i))))
+    (let ((i (1+ n)))
+      (while (<= i N)
+        (math-nlfit-set-elt r i (math-nlfit-get-elt d i))
+        (setq i (1+ i))))
+    (let ((j n))
+      (while (>= j 1)
+        (let ((i N))
+          (while (>= i (1+ j))
+            (setq rho (math-nlfit-get-matx-elt C i j))
+            (if (math-equal rho 1)
+                (setq gamma 0
+                      sigma 1)
+              (if (math-lessp (calcFunc-abs rho) 1)
+                  (setq sigma rho
+                        gamma (calcFunc-sqrt 
+                               (math-sub 1 (math-mul sigma sigma))))
+                (setq gamma (math-div 1 (calcFunc-abs rho))
+                      sigma (math-mul (calcFunc-sign rho)
+                                       (calcFunc-sqrt
+                                        (math-sub 1 (math-mul gamma gamma)))))))
+            (let ((ri (math-nlfit-get-elt r i))
+                  (rj (math-nlfit-get-elt r j))
+                  h)
+              (setq h (math-add (math-mul gamma rj)
+                         (math-mul sigma ri)))
+              (setq ri (math-sub
+                        (math-mul gamma ri)
+                        (math-mul sigma rj)))
+              (setq rj h)
+              (math-nlfit-set-elt r i ri)
+              (math-nlfit-set-elt r j rj))
+            (setq i (1- i))))
+        (setq j (1- j))))
+
+    x))
+
+(defun math-nlfit-jacobian (grad xlist parms &optional slist)
+  (let ((j nil))
+    (while xlist 
+      (let ((row (apply grad (car xlist) parms)))
+        (setq j
+              (cons
+               (if slist
+                   (mapcar (lambda (x) (math-div x (car slist))) row)
+                 row)
+               j)))
+      (setq slist (cdr slist))
+      (setq xlist (cdr xlist)))
+    (reverse j)))
+
+(defun math-nlfit-make-ident (l n)
+  (let ((m (math-nlfit-make-matrix n n))
+        (i 1))
+    (while (<= i n)
+      (math-nlfit-set-matx-elt m i i l)
+      (setq i (1+ i)))
+    m))
+
+(defun math-nlfit-chi-sq (xlist ylist parms fn &optional slist)
+  (let ((cs 0))
+    (while xlist
+      (let ((c
+             (math-sub
+              (apply fn (car xlist) parms)
+              (car ylist))))
+        (if slist
+            (setq c (math-div c (car slist))))
+        (setq cs
+              (math-add cs
+                 (math-mul c c))))
+      (setq xlist (cdr xlist))
+      (setq ylist (cdr ylist))
+      (setq slist (cdr slist)))
+    cs))
+
+(defun math-nlfit-init-lambda (C)
+  (let ((l 0)
+        (n (length (car C)))
+        (N (length C)))
+    (while C
+      (let ((row (car C)))
+        (while row
+          (setq l (math-add l (math-mul (car row) (car row))))
+          (setq row (cdr row))))
+      (setq C (cdr C)))
+    (calcFunc-sqrt (math-div l (math-mul n N)))))
+
+(defun math-nlfit-make-Ctilda (C l)
+  (let* ((n (length (car C)))
+         (bot (math-nlfit-make-ident l n)))
+    (append C bot)))
+
+(defun math-nlfit-make-d (fn xdata ydata parms &optional sdata)
+  (let ((d nil))
+    (while xdata
+      (setq d (cons
+               (let ((dd (math-sub (apply fn (car xdata) parms)
+                                   (car ydata))))
+                 (if sdata (math-div dd (car sdata)) dd))
+               d))
+      (setq xdata (cdr xdata))
+      (setq ydata (cdr ydata))
+      (setq sdata (cdr sdata)))
+    (reverse d)))
+    
+(defun math-nlfit-make-dtilda (d n)
+  (append d (make-list n 0)))
+
+(defun math-nlfit-fit (xlist ylist parms fn grad &optional slist)
+  (let*
+      ((C (math-nlfit-jacobian grad xlist parms slist))
+       (d (math-nlfit-make-d fn xlist ylist parms slist))
+       (chisq (math-nlfit-chi-sq xlist ylist parms fn slist))
+       (lambda (math-nlfit-init-lambda C))
+       (really-done nil)
+       (iters 0))
+    (while (and
+            (not really-done)
+            (< iters math-nlfit-max-its))
+      (setq iters (1+ iters))
+      (let ((done nil))
+        (while (not done)
+          (let* ((Ctilda (math-nlfit-make-Ctilda C lambda))
+                 (dtilda (math-nlfit-make-dtilda d (length (car C))))
+                 (zeta (math-nlfit-givens Ctilda dtilda))
+                 (newparms (mapcar* 'math-add (copy-tree parms) zeta))
+                 (newchisq (math-nlfit-chi-sq xlist ylist newparms fn slist)))
+            (if (math-lessp newchisq chisq)
+                (progn
+                  (if (math-lessp 
+                       (math-div 
+                        (math-sub chisq newchisq) newchisq) math-nlfit-epsilon)
+                      (setq really-done t))
+                  (setq lambda (math-div lambda 10))
+                  (setq chisq newchisq)
+                  (setq parms newparms)
+                  (setq done t))
+              (setq lambda (math-mul lambda 10)))))
+        (setq C (math-nlfit-jacobian grad xlist parms slist))
+        (setq d (math-nlfit-make-d fn xlist ylist parms slist))))
+    (list chisq parms)))
+
+;;; The functions that describe our models, and their gradients.
+
+(defun math-nlfit-s-logistic-fn (x a b c)
+  (math-div a (math-add 1 (math-mul b (calcFunc-exp (math-mul c x))))))
+
+(defun math-nlfit-s-logistic-grad (x a b c)
+  (let* ((ep (calcFunc-exp (math-mul c x)))
+         (d (math-add 1 (math-mul b ep)))
+         (d2 (math-mul d d)))
+    (list
+     (math-div 1 d)
+     (math-neg (math-div (math-mul a ep) d2))
+     (math-neg (math-div (math-mul a (math-mul b (math-mul x ep))) d2)))))
+
+(defun math-nlfit-b-logistic-fn (x a c d)
+  (let ((ex (calcFunc-exp (math-mul c (math-sub x d)))))
+    (math-div
+     (math-mul a ex)
+     (math-sqr 
+      (math-add
+       1 ex)))))
+
+(defun math-nlfit-b-logistic-grad (x a c d)
+  (let* ((ex (calcFunc-exp (math-mul c (math-sub x d))))
+        (ex1 (math-add 1 ex))
+        (xd (math-sub x d)))
+    (list
+     (math-div
+      ex
+      (math-sqr ex1))
+     (math-sub
+      (math-div
+       (math-mul a (math-mul xd ex))
+       (math-sqr ex1))
+      (math-div
+       (math-mul 2 (math-mul a (math-mul xd (math-sqr ex))))
+       (math-pow ex1 3)))
+     (math-sub
+      (math-div
+       (math-mul 2 (math-mul a (math-mul c (math-sqr ex))))
+       (math-pow ex1 3))
+      (math-div
+       (math-mul a (math-mul c ex))
+       (math-sqr ex1))))))
+
+;;; Functions to get the final covariance matrix and the sdevs
+
+(defun math-nlfit-find-covar (grad xlist pparms)
+  (let ((j nil))
+    (while xlist 
+      (setq j (cons (cons 'vec (apply grad (car xlist) pparms)) j))
+      (setq xlist (cdr xlist)))
+    (setq j (cons 'vec (reverse j)))
+    (setq j
+          (math-mul
+           (calcFunc-trn j) j))
+    (calcFunc-inv j)))
+
+(defun math-nlfit-get-sigmas (grad xlist pparms chisq)
+  (let* ((sgs nil)
+         (covar (math-nlfit-find-covar grad xlist pparms))
+         (n (1- (length covar)))
+         (N (length xlist))
+         (i 1))
+    (when (> N n)
+      (while (<= i n)
+        (setq sgs (cons (calcFunc-sqrt (nth i (nth i covar))) sgs))
+        (setq i (1+ i)))
+      (setq sgs (reverse sgs)))
+    (list sgs covar)))
+   
+;;; Now the Calc functions
+
+(defun math-nlfit-s-logistic-params (xdata ydata)
+  (let ((pdata (math-nlfit-get-rates-from-cumul xdata ydata)))
+    (math-nlfit-find-logistic-parameters ydata pdata xdata)))
+
+(defun math-nlfit-b-logistic-params (xdata ydata)
+  (let* ((q0 (math-nlfit-find-q0 ydata xdata))
+         (qdata (math-nlfit-get-cumul-from-rates xdata ydata q0))
+         (abc (math-nlfit-find-logistic-parameters qdata ydata xdata))
+         (B (nth 1 abc))
+         (C (nth 2 abc))
+         (A (math-neg
+             (math-mul
+              (nth 0 abc)
+              (math-mul B C))))
+         (D (math-neg (math-div (calcFunc-ln B) C)))
+         (A (math-div A B)))
+    (list A C D)))
+
+;;; Some functions to turn the parameter lists and variables
+;;; into the appropriate functions.
+
+(defun math-nlfit-s-logistic-solnexpr (pms var)
+  (let ((a (nth 0 pms))
+        (b (nth 1 pms))
+        (c (nth 2 pms)))
+    (list '/ a
+            (list '+
+                  1
+             (list '*
+                   b
+                   (calcFunc-exp
+                    (list '*
+                          c
+                          var)))))))
+
+(defun math-nlfit-b-logistic-solnexpr (pms var)
+  (let ((a (nth 0 pms))
+        (c (nth 1 pms))
+        (d (nth 2 pms)))
+    (list '/
+          (list '*
+                a
+                (calcFunc-exp
+                 (list '*
+                       c
+                       (list '- var d))))
+          (list '^
+                (list '+
+                      1
+                      (calcFunc-exp
+                       (list '*
+                             c
+                             (list '- var d))))
+                2))))
+
+(defun math-nlfit-enter-result (n prefix vals)
+  (setq calc-aborted-prefix prefix)
+  (calc-pop-push-record-list n prefix vals)
+  (calc-handle-whys))
+
+(defun math-nlfit-fit-curve (fn grad solnexpr initparms &optional sdv)
+  (calc-slow-wrapper
+   (let* ((sdevv (or (eq sdv 'calcFunc-efit) (eq sdv 'calcFunc-xfit)))
+          (calc-display-working-message nil)
+          (data (calc-top 1))
+          (xdata (cdr (car (cdr data))))
+          (ydata (cdr (car (cdr (cdr data)))))
+          (sdata (if (math-contains-sdev-p ydata)
+                     (mapcar (lambda (x) (math-get-sdev x t)) ydata)
+                   nil))
+          (ydata (mapcar (lambda (x) (math-get-value x)) ydata))
+          (calc-curve-varnames nil)
+          (calc-curve-coefnames nil)
+          (calc-curve-nvars 1)
+          (fitvars (calc-get-fit-variables 1 3))
+          (var (nth 1 calc-curve-varnames))
+          (parms (cdr calc-curve-coefnames))
+          (parmguess
+           (funcall initparms xdata ydata))
+          (fit (math-nlfit-fit xdata ydata parmguess fn grad sdata))
+          (finalparms (nth 1 fit))
+          (sigmacovar 
+           (if sdevv
+               (math-nlfit-get-sigmas grad xdata finalparms (nth 0 fit))))
+          (sigmas 
+           (if sdevv
+               (nth 0 sigmacovar)))
+          (finalparms 
+           (if sigmas
+               (mapcar* (lambda (x y) (list 'sdev x y)) finalparms sigmas)
+             finalparms))
+          (soln (funcall solnexpr finalparms var)))
+     (let ((calc-fit-to-trail t)
+           (traillist nil))
+       (while parms
+         (setq traillist (cons (list 'calcFunc-eq (car parms) (car finalparms))
+                               traillist))
+         (setq finalparms (cdr finalparms))
+         (setq parms (cdr parms)))
+       (setq traillist (calc-normalize (cons 'vec (nreverse traillist))))
+       (cond ((eq sdv 'calcFunc-efit)
+              (math-nlfit-enter-result 1 "efit" soln))
+             ((eq sdv 'calcFunc-xfit)
+              (let (sln)
+                (setq sln
+                      (list 'vec 
+                            soln 
+                            traillist
+                            (nth 1 sigmacovar)
+                            '(vec)
+                            (nth 0 fit)
+                            (let ((n (length xdata))
+                                  (m (length finalparms)))
+                              (if (and sdata (> n m))
+                                  (calcFunc-utpc (nth 0 fit) 
+                                                 (- n m))
+                                '(var nan var-nan)))))
+                (math-nlfit-enter-result 1 "xfit" sln)))
+             (t
+              (math-nlfit-enter-result 1 "fit" soln)))
+       (calc-record traillist "parm")))))
+
+(defun calc-fit-s-shaped-logistic-curve (arg)
+  (interactive "P")
+  (math-nlfit-fit-curve 'math-nlfit-s-logistic-fn
+                        'math-nlfit-s-logistic-grad
+                        'math-nlfit-s-logistic-solnexpr
+                        'math-nlfit-s-logistic-params
+                        arg))
+
+(defun calc-fit-bell-shaped-logistic-curve (arg)
+  (interactive "P")
+  (math-nlfit-fit-curve 'math-nlfit-b-logistic-fn
+                        'math-nlfit-b-logistic-grad
+                        'math-nlfit-b-logistic-solnexpr
+                        'math-nlfit-b-logistic-params
+                        arg))
+
+(defun calc-fit-hubbert-linear-curve (&optional sdv)
+  (calc-slow-wrapper
+   (let* ((sdevv (or (eq sdv 'calcFunc-efit) (eq sdv 'calcFunc-xfit)))
+          (calc-display-working-message nil)
+          (data (calc-top 1))
+          (qdata (cdr (car (cdr data))))
+          (pdata (cdr (car (cdr (cdr data)))))
+          (sdata (if (math-contains-sdev-p pdata)
+                     (mapcar (lambda (x) (math-get-sdev x t)) pdata)
+                   nil))
+          (pdata (mapcar (lambda (x) (math-get-value x)) pdata))
+          (poverqdata (mapcar* 'math-div pdata qdata))
+          (parmvals (math-nlfit-least-squares qdata poverqdata sdata sdevv))
+          (finalparms (list (nth 0 parmvals)
+                            (math-neg
+                             (math-div (nth 0 parmvals)
+                                       (nth 1 parmvals)))))
+          (calc-curve-varnames nil)
+          (calc-curve-coefnames nil)
+          (calc-curve-nvars 1)
+          (fitvars (calc-get-fit-variables 1 2))
+          (var (nth 1 calc-curve-varnames))
+          (parms (cdr calc-curve-coefnames))
+          (soln (list '* (nth 0 finalparms)
+                      (list '- 1
+                            (list '/ var (nth 1 finalparms))))))
+     (let ((calc-fit-to-trail t)
+           (traillist nil))
+       (setq traillist
+             (list 'vec
+                   (list 'calcFunc-eq (nth 0 parms) (nth 0 finalparms))
+                   (list 'calcFunc-eq (nth 1 parms) (nth 1 finalparms))))
+       (cond ((eq sdv 'calcFunc-efit)
+              (math-nlfit-enter-result 1 "efit" soln))
+             ((eq sdv 'calcFunc-xfit)
+              (let (sln
+                    (chisq
+                     (math-nlfit-chi-sq
+                      qdata poverqdata
+                      (list (nth 1 (nth 0 finalparms))
+                            (nth 1 (nth 1 finalparms)))
+                      (lambda (x a b)
+                        (math-mul a 
+                                  (math-sub
+                                   1
+                                   (math-div x b))))
+                      sdata)))
+                (setq sln
+                      (list 'vec 
+                            soln 
+                            traillist
+                            (nth 2 parmvals)
+                            (list
+                             'vec
+                             '(calcFunc-fitdummy 1)
+                             (list 'calcFunc-neg
+                                   (list '/
+                                         '(calcFunc-fitdummy 1)
+                                         '(calcFunc-fitdummy 2))))
+                            chisq
+                            (let ((n (length qdata)))
+                              (if (and sdata (> n 2))
+                                  (calcFunc-utpc 
+                                   chisq
+                                   (- n 2))
+                                '(var nan var-nan)))))
+                (math-nlfit-enter-result 1 "xfit" sln)))
+             (t
+              (math-nlfit-enter-result 1 "fit" soln)))
+       (calc-record traillist "parm")))))
+
+(provide 'calc-nlfit)
+
+;; arch-tag: 6eba3cd6-f48b-4a84-8174-10c15a024928
index e94a8e0..de2cf2e 100644 (file)
 
 
 (defun math-padded-polynomial (expr var deg)
+  "Return a polynomial as list of coefficients.
+If EXPR is of the form \"a + bx + cx^2 + ...\" in the variable VAR, return
+the list (a b c ...) with at least DEG elements, else return NIL."
   (let ((p (math-is-polynomial expr var deg)))
     (append p (make-list (- deg (length p)) 0))))
 
 (defun math-partial-fractions (r den var)
+  "Return R divided by DEN expressed in partial fractions of VAR.
+All whole factors of DEN have already been split off from R.
+If no partial fraction representation can be found, return nil."
   (let* ((fden (calcFunc-factors den var))
         (tdeg (math-polynomial-p den var))
         (fp fden)
index 4e048a9..4ceeeba 100644 (file)
                          (set-buffer calc-buf)
                          (let ((calc-user-parse-tables nil)
                                (calc-language nil)
-                               (math-expr-opers math-standard-opers)
+                               (math-expr-opers (math-standard-ops))
                                (calc-hashes-used 0))
                            (math-read-expr
                             (if (string-match ",[ \t]*\\'" str)
index 82769a6..e823a57 100644 (file)
@@ -49,7 +49,7 @@
 (defvar math-standard-units
   '( ;; Length
     ( m       nil                    "*Meter" )
-    ( in      "2.54 cm"           "Inch" )
+    ( in      "2.54 cm"              "Inch" )
     ( ft      "12 in"                "Foot" )
     ( yd      "3 ft"                 "Yard" )
     ( mi      "5280 ft"              "Mile" )
@@ -971,17 +971,17 @@ Entries are (SYMBOL EXPR DOC-STRING TEMP-TYPE BASE-UNITS).")
                                                     (symbol-name v)))))))
     (or (eq (nth 3 uold) (nth 3 unew))
        (cond ((eq (nth 3 uold) 'K)
-              (setq expr (list '- expr '(float 27315 -2)))
+              (setq expr (list '- expr '(/ 27315 100)))
               (if (eq (nth 3 unew) 'F)
-                  (setq expr (list '+ (list '* expr '(frac 9 5)) 32))))
+                  (setq expr (list '+ (list '* expr '(/ 9 5)) 32))))
              ((eq (nth 3 uold) 'C)
               (if (eq (nth 3 unew) 'F)
-                  (setq expr (list '+ (list '* expr '(frac 9 5)) 32))
-                (setq expr (list '+ expr '(float 27315 -2)))))
+                  (setq expr (list '+ (list '* expr '(/ 9 5)) 32))
+                (setq expr (list '+ expr '(/ 27315 100)))))
              (t
-              (setq expr (list '* (list '- expr 32) '(frac 5 9)))
+              (setq expr (list '* (list '- expr 32) '(/ 5 9)))
               (if (eq (nth 3 unew) 'K)
-                  (setq expr (list '+ expr '(float 27315 -2)))))))
+                  (setq expr (list '+ expr '(/ 27315 100)))))))
     (if pure
        expr
       (list '* expr new))))
index c6ea137..d83321e 100644 (file)
@@ -559,7 +559,7 @@ To cancel the edit, simply kill the *Calc Edit* buffer."
          (aset str pos ?\,)))
     (switch-to-buffer calc-original-buffer)
     (let ((vals (let ((calc-language nil)
-                     (math-expr-opers math-standard-opers))
+                     (math-expr-opers (math-standard-ops)))
                  (and (string-match "[^\n\t ]" str)
                       (math-read-exprs str)))))
       (when (eq (car-safe vals) 'error)
index 5f95deb..755834f 100644 (file)
@@ -401,6 +401,13 @@ This is not required to be present for user-written mode annotations."
   :group 'calc
   :type '(choice (string) (sexp)))
 
+(defcustom calc-multiplication-has-precedence
+  t
+  "*If non-nil, multiplication has precedence over division
+in normal mode."
+  :group 'calc
+  :type 'boolean)
+
 (defvar calc-bug-address "jay.p.belanger@gmail.com"
   "Address of the maintainer of Calc, for use by `report-calc-bug'.")
 
@@ -2276,7 +2283,21 @@ See calc-keypad for details."
 
 
 
+(defconst math-bignum-digit-length 4
+;  (truncate (/ (log10 (/ most-positive-fixnum 2)) 2))
+  "The length of a \"digit\" in Calc bignums.
+If a big integer is of the form (bigpos N0 N1 ...), this is the
+length of the allowable Emacs integers N0, N1,...
+The value of 2*10^(2*MATH-BIGNUM-DIGIT-LENGTH) must be less than the
+largest Emacs integer.")
+
+(defconst math-bignum-digit-size 
+  (expt 10 math-bignum-digit-length)
+  "An upper bound for the size of the \"digit\"s in Calc bignums.")
 
+(defconst math-small-integer-size 
+  (expt math-bignum-digit-size 2)
+  "An upper bound for the size of \"small integer\"s in Calc.")
 
 
 ;;;; Arithmetic routines.
@@ -2285,11 +2306,17 @@ See calc-keypad for details."
 ;;; following forms:
 ;;;
 ;;; integer                 An integer.  For normalized numbers, this format
-;;;                        is used only for -999999 ... 999999.
+;;;                        is used only for  
+;;;                         negative math-small-integer-size + 1 to
+;;;                         math-small-integer-size - 1
 ;;;
-;;; (bigpos N0 N1 N2 ...)   A big positive integer, N0 + N1*1000 + N2*10^6 ...
-;;; (bigneg N0 N1 N2 ...)   A big negative integer, - N0 - N1*1000 ...
-;;;                        Each digit N is in the range 0 ... 999.
+;;; (bigpos N0 N1 N2 ...)   A big positive integer, 
+;;;                           N0 + N1*math-bignum-digit-size 
+;;;                              + N2*(math-bignum-digit-size)^2 ...
+;;; (bigneg N0 N1 N2 ...)   A big negative integer, 
+;;;                           - N0 - N1*math-bignum-digit-size ...
+;;;                        Each digit N is in the range 
+;;;                             0 ... math-bignum-digit-size -1.
 ;;;                        Normalized, always at least three N present,
 ;;;                        and the most significant N is nonzero.
 ;;;
@@ -2379,7 +2406,8 @@ See calc-keypad for details."
   (cond
    ((not (consp math-normalize-a))
     (if (integerp math-normalize-a)
-       (if (or (>= math-normalize-a 1000000) (<= math-normalize-a -1000000))
+       (if (or (>= math-normalize-a math-small-integer-size) 
+                (<= math-normalize-a (- math-small-integer-size)))
            (math-bignum math-normalize-a)
          math-normalize-a)
       math-normalize-a))
@@ -2394,7 +2422,8 @@ See calc-keypad for details."
        math-normalize-a
       (cond
        ((cdr (cdr math-normalize-a)) (+ (nth 1 math-normalize-a) 
-                                        (* (nth 2 math-normalize-a) 1000)))
+                                        (* (nth 2 math-normalize-a) 
+                                           math-bignum-digit-size)))
        ((cdr math-normalize-a) (nth 1 math-normalize-a))
        (t 0))))
    ((eq (car math-normalize-a) 'bigneg)
@@ -2408,7 +2437,8 @@ See calc-keypad for details."
        math-normalize-a
       (cond
        ((cdr (cdr math-normalize-a)) (- (+ (nth 1 math-normalize-a) 
-                                           (* (nth 2 math-normalize-a) 1000))))
+                                           (* (nth 2 math-normalize-a) 
+                                              math-bignum-digit-size))))
        ((cdr math-normalize-a) (- (nth 1 math-normalize-a)))
        (t 0))))
    ((eq (car math-normalize-a) 'float)
@@ -2528,7 +2558,8 @@ See calc-keypad for details."
 (defun math-bignum-big (a)   ; [L s]
   (if (= a 0)
       nil
-    (cons (% a 1000) (math-bignum-big (/ a 1000)))))
+    (cons (% a math-bignum-digit-size) 
+          (math-bignum-big (/ a math-bignum-digit-size)))))
 
 
 ;;; Build a normalized floating-point number.  [F I S]
@@ -2545,7 +2576,7 @@ See calc-keypad for details."
              (progn
                (while (= (car digs) 0)
                  (setq digs (cdr digs)
-                       exp (+ exp 3)))
+                       exp (+ exp math-bignum-digit-length)))
                (while (= (% (car digs) 10) 0)
                  (setq digs (math-div10-bignum digs)
                        exp (1+ exp)))
@@ -2563,7 +2594,8 @@ See calc-keypad for details."
 
 (defun math-div10-bignum (a)   ; [l l]
   (if (cdr a)
-      (cons (+ (/ (car a) 10) (* (% (nth 1 a) 10) 100))
+      (cons (+ (/ (car a) 10) (* (% (nth 1 a) 10) 
+                                 (expt 10 (1- math-bignum-digit-length))))
            (math-div10-bignum (cdr a)))
     (list (/ (car a) 10))))
 
@@ -2594,7 +2626,7 @@ See calc-keypad for details."
       (if (cdr a)
          (let* ((len (1- (length a)))
                 (top (nth len a)))
-           (+ (* len 3) (cond ((>= top 100) 0) ((>= top 10) -1) (t -2))))
+            (+ (* (1- len) math-bignum-digit-length) (math-numdigs top)))
        0)
     (cond ((>= a 100) (+ (math-numdigs (/ a 1000)) 3))
          ((>= a 10) 2)
@@ -2615,24 +2647,24 @@ See calc-keypad for details."
       a
     (if (consp a)
        (cons (car a) (math-scale-left-bignum (cdr a) n))
-      (if (>= n 3)
-         (if (or (>= a 1000) (<= a -1000))
+      (if (>= n math-bignum-digit-length)
+         (if (or (>= a math-bignum-digit-size) 
+                  (<= a (- math-bignum-digit-size)))
              (math-scale-left (math-bignum a) n)
-           (math-scale-left (* a 1000) (- n 3)))
-       (if (= n 2)
-           (if (or (>= a 10000) (<= a -10000))
-               (math-scale-left (math-bignum a) 2)
-             (* a 100))
-         (if (or (>= a 100000) (<= a -100000))
-             (math-scale-left (math-bignum a) 1)
-           (* a 10)))))))
+           (math-scale-left (* a math-bignum-digit-size) 
+                             (- n math-bignum-digit-length)))
+        (let ((sz (expt 10 (- (* 2 math-bignum-digit-length) n))))
+          (if (or (>= a sz) (<= a (- sz)))
+              (math-scale-left (math-bignum a) n)
+            (* a (expt 10 n))))))))
 
 (defun math-scale-left-bignum (a n)
-  (if (>= n 3)
+  (if (>= n math-bignum-digit-length)
       (while (>= (setq a (cons 0 a)
-                      n (- n 3)) 3)))
+                      n (- n math-bignum-digit-length)) 
+                 math-bignum-digit-length)))
   (if (> n 0)
-      (math-mul-bignum-digit a (if (= n 2) 100 10) 0)
+      (math-mul-bignum-digit a (expt 10 n) 0)
     a))
 
 (defun math-scale-right (a n)   ; [i i S]
@@ -2644,21 +2676,20 @@ See calc-keypad for details."
          (if (= a 0)
              0
            (- (math-scale-right (- a) n)))
-       (if (>= n 3)
-           (while (and (> (setq a (/ a 1000)) 0)
-                       (>= (setq n (- n 3)) 3))))
-       (if (= n 2)
-           (/ a 100)
-         (if (= n 1)
-             (/ a 10)
-           a))))))
+       (if (>= n math-bignum-digit-length)
+           (while (and (> (setq a (/ a math-bignum-digit-size)) 0)
+                       (>= (setq n (- n math-bignum-digit-length)) 
+                            math-bignum-digit-length))))
+       (if (> n 0)
+            (/ a (expt 10 n))
+          a)))))
 
 (defun math-scale-right-bignum (a n)   ; [L L S; l l S]
-  (if (>= n 3)
-      (setq a (nthcdr (/ n 3) a)
-           n (% n 3)))
+  (if (>= n math-bignum-digit-length)
+      (setq a (nthcdr (/ n math-bignum-digit-length) a)
+           n (% n math-bignum-digit-length)))
   (if (> n 0)
-      (cdr (math-mul-bignum-digit a (if (= n 2) 10 100) 0))
+      (cdr (math-mul-bignum-digit a (expt 10 (- math-bignum-digit-length n)) 0))
     a))
 
 ;;; Multiply (with rounding) the integer A by 10^N.   [I i S]
@@ -2668,16 +2699,18 @@ See calc-keypad for details."
        ((consp a)
         (math-normalize
          (cons (car a)
-               (let ((val (if (< n -3)
-                              (math-scale-right-bignum (cdr a) (- -3 n))
-                            (if (= n -2)
-                                (math-mul-bignum-digit (cdr a) 10 0)
-                              (if (= n -1)
-                                  (math-mul-bignum-digit (cdr a) 100 0)
-                                (cdr a))))))  ; n = -3
-                 (if (and val (>= (car val) 500))
+               (let ((val (if (< n (- math-bignum-digit-length))
+                              (math-scale-right-bignum 
+                                (cdr a) 
+                                (- (- math-bignum-digit-length) n))
+                            (if (< n 0)
+                                (math-mul-bignum-digit 
+                                  (cdr a) 
+                                  (expt 10 (+ math-bignum-digit-length n)) 0)
+                               (cdr a)))))  ; n = -math-bignum-digit-length
+                 (if (and val (>= (car val) (/ math-bignum-digit-size 2)))
                      (if (cdr val)
-                         (if (eq (car (cdr val)) 999)
+                         (if (eq (car (cdr val)) (1- math-bignum-digit-size))
                              (math-add-bignum (cdr val) '(1))
                            (cons (1+ (car (cdr val))) (cdr (cdr val))))
                        '(1))
@@ -2696,7 +2729,7 @@ See calc-keypad for details."
    (and (not (or (consp a) (consp b)))
        (progn
          (setq a (+ a b))
-         (if (or (<= a -1000000) (>= a 1000000))
+         (if (or (<= a (- math-small-integer-size)) (>= a math-small-integer-size))
              (math-bignum a)
            a)))
    (and (Math-zerop a) (not (eq (car-safe a) 'mod))
@@ -2745,21 +2778,22 @@ See calc-keypad for details."
          (let* ((a (copy-sequence a)) (aa a) (carry nil) sum)
            (while (and aa b)
              (if carry
-                 (if (< (setq sum (+ (car aa) (car b))) 999)
+                 (if (< (setq sum (+ (car aa) (car b))) 
+                         (1- math-bignum-digit-size))
                      (progn
                        (setcar aa (1+ sum))
                        (setq carry nil))
-                   (setcar aa (+ sum -999)))
-               (if (< (setq sum (+ (car aa) (car b))) 1000)
+                   (setcar aa (- sum (1- math-bignum-digit-size))))
+               (if (< (setq sum (+ (car aa) (car b))) math-bignum-digit-size)
                    (setcar aa sum)
-                 (setcar aa (+ sum -1000))
+                 (setcar aa (- sum math-bignum-digit-size))
                  (setq carry t)))
              (setq aa (cdr aa)
                    b (cdr b)))
            (if carry
                (if b
                    (nconc a (math-add-bignum b '(1)))
-                 (while (eq (car aa) 999)
+                 (while (eq (car aa) (1- math-bignum-digit-size))
                    (setcar aa 0)
                    (setq aa (cdr aa)))
                  (if aa
@@ -2783,17 +2817,17 @@ See calc-keypad for details."
                      (progn
                        (setcar aa (1- diff))
                        (setq borrow nil))
-                   (setcar aa (+ diff 999)))
+                   (setcar aa (+ diff (1- math-bignum-digit-size))))
                (if (>= (setq diff (- (car aa) (car b))) 0)
                    (setcar aa diff)
-                 (setcar aa (+ diff 1000))
+                 (setcar aa (+ diff math-bignum-digit-size))
                  (setq borrow t)))
              (setq aa (cdr aa)
                    b (cdr b)))
            (if borrow
                (progn
                  (while (eq (car aa) 0)
-                   (setcar aa 999)
+                   (setcar aa (1- math-bignum-digit-size))
                    (setq aa (cdr aa)))
                  (if aa
                      (progn
@@ -2833,7 +2867,7 @@ See calc-keypad for details."
   (if (or (consp a) (consp b))
       (math-add a (math-neg b))
     (setq a (- a b))
-    (if (or (<= a -1000000) (>= a 1000000))
+    (if (or (<= a (- math-small-integer-size)) (>= a math-small-integer-size))
        (math-bignum a)
       a)))
 
@@ -2860,7 +2894,8 @@ See calc-keypad for details."
 (defun math-mul (a b)
   (or
    (and (not (consp a)) (not (consp b))
-       (< a 1000) (> a -1000) (< b 1000) (> b -1000)
+       (< a math-bignum-digit-size) (> a (- math-bignum-digit-size)) 
+        (< b math-bignum-digit-size) (> b (- math-bignum-digit-size))
        (* a b))
    (and (Math-zerop a) (not (eq (car-safe b) 'mod))
        (if (Math-scalarp b)
@@ -2929,14 +2964,14 @@ See calc-keypad for details."
                 aa a)
           (while (progn
                    (setcar ss (% (setq prod (+ (+ (car ss) (* (car aa) d))
-                                               c)) 1000))
+                                               c)) math-bignum-digit-size))
                    (setq aa (cdr aa)))
-            (setq c (/ prod 1000)
+            (setq c (/ prod math-bignum-digit-size)
                   ss (or (cdr ss) (setcdr ss (list 0)))))
-          (if (>= prod 1000)
+          (if (>= prod math-bignum-digit-size)
               (if (cdr ss)
-                  (setcar (cdr ss) (+ (/ prod 1000) (car (cdr ss))))
-                (setcdr ss (list (/ prod 1000))))))
+                  (setcar (cdr ss) (+ (/ prod math-bignum-digit-size) (car (cdr ss))))
+                (setcdr ss (list (/ prod math-bignum-digit-size))))))
         sum)))
 
 ;;; Multiply digit list A by digit D.  [L L D D; l l D D]
@@ -2946,12 +2981,14 @@ See calc-keypad for details."
          (and (= d 1) a)
        (let* ((a (copy-sequence a)) (aa a) prod)
          (while (progn
-                  (setcar aa (% (setq prod (+ (* (car aa) d) c)) 1000))
+                  (setcar aa 
+                           (% (setq prod (+ (* (car aa) d) c)) 
+                              math-bignum-digit-size))
                   (cdr aa))
            (setq aa (cdr aa)
-                 c (/ prod 1000)))
-         (if (>= prod 1000)
-             (setcdr aa (list (/ prod 1000))))
+                 c (/ prod math-bignum-digit-size)))
+         (if (>= prod math-bignum-digit-size)
+             (setcdr aa (list (/ prod math-bignum-digit-size))))
          a))
     (and (> c 0)
         (list c))))
@@ -2964,7 +3001,7 @@ See calc-keypad for details."
   (if (eq b 0)
       (math-reject-arg a "*Division by zero"))
   (if (or (consp a) (consp b))
-      (if (and (natnump b) (< b 1000))
+      (if (and (natnump b) (< b math-bignum-digit-size))
          (let ((res (math-div-bignum-digit (cdr a) b)))
            (cons
             (math-normalize (cons (car a) (car res)))
@@ -2983,7 +3020,7 @@ See calc-keypad for details."
       (if (= b 0)
          (math-reject-arg a "*Division by zero")
        (/ a b))
-    (if (and (natnump b) (< b 1000))
+    (if (and (natnump b) (< b math-bignum-digit-size))
        (if (= b 0)
            (math-reject-arg a "*Division by zero")
          (math-normalize (cons (car a)
@@ -2992,7 +3029,7 @@ See calc-keypad for details."
       (or (consp b) (setq b (math-bignum b)))
       (let* ((alen (1- (length a)))
             (blen (1- (length b)))
-            (d (/ 1000 (1+ (nth (1- blen) (cdr b)))))
+            (d (/ math-bignum-digit-size (1+ (nth (1- blen) (cdr b)))))
             (res (math-div-bignum-big (math-mul-bignum-digit (cdr a) d 0)
                                       (math-mul-bignum-digit (cdr b) d 0)
                                       alen blen)))
@@ -3006,7 +3043,7 @@ See calc-keypad for details."
   (if (cdr b)
       (let* ((alen (length a))
             (blen (length b))
-            (d (/ 1000 (1+ (nth (1- blen) b))))
+            (d (/ math-bignum-digit-size (1+ (nth (1- blen) b))))
             (res (math-div-bignum-big (math-mul-bignum-digit a d 0)
                                       (math-mul-bignum-digit b d 0)
                                       alen blen)))
@@ -3021,7 +3058,7 @@ See calc-keypad for details."
 (defun math-div-bignum-digit (a b)
   (if a
       (let* ((res (math-div-bignum-digit (cdr a) b))
-            (num (+ (* (cdr res) 1000) (car a))))
+            (num (+ (* (cdr res) math-bignum-digit-size) (car a))))
        (cons
         (cons (/ num b) (car res))
         (% num b)))
@@ -3037,10 +3074,11 @@ See calc-keypad for details."
        (cons (car res2) (car res))
        (cdr res2)))))
 
-(defun math-div-bignum-part (a b blen)   ; a < b*1000  [D.l l L]
-  (let* ((num (+ (* (or (nth blen a) 0) 1000) (or (nth (1- blen) a) 0)))
+(defun math-div-bignum-part (a b blen)   ; a < b*math-bignum-digit-size  [D.l l L]
+  (let* ((num (+ (* (or (nth blen a) 0) math-bignum-digit-size) 
+                 (or (nth (1- blen) a) 0)))
         (den (nth (1- blen) b))
-        (guess (min (/ num den) 999)))
+        (guess (min (/ num den) (1- math-bignum-digit-size))))
     (math-div-bignum-try a b (math-mul-bignum-digit b guess 0) guess)))
 
 (defun math-div-bignum-try (a b c guess)   ; [D.l l l D]
@@ -3351,15 +3389,22 @@ See calc-keypad for details."
   (if a
       (let ((s ""))
        (while (cdr (cdr a))
-         (setq s (concat (format "%06d" (+ (* (nth 1 a) 1000) (car a))) s)
+         (setq s (concat 
+                   (format 
+                    (concat "%0" 
+                            (number-to-string (* 2 math-bignum-digit-length))  
+                            "d")
+                    (+ (* (nth 1 a) math-bignum-digit-size) (car a))) s)
                a (cdr (cdr a))))
-       (concat (int-to-string (+ (* (or (nth 1 a) 0) 1000) (car a))) s))
+       (concat (int-to-string 
+                 (+ (* (or (nth 1 a) 0) math-bignum-digit-size) (car a))) s))
     "0"))
 
 
 
 ;;; Parse a simple number in string form.   [N X] [Public]
 (defun math-read-number (s)
+  "Convert the string S into a Calc number."
   (math-normalize
    (cond
 
@@ -3370,7 +3415,7 @@ See calc-keypad for details."
                (> (length digs) 1)
                (eq (aref digs 0) ?0))
           (math-read-number (concat "8#" digs))
-        (if (<= (length digs) 6)
+        (if (<= (length digs) (* 2 math-bignum-digit-length))
             (string-to-number digs)
           (cons 'bigpos (math-read-bignum digs))))))
 
@@ -3416,15 +3461,42 @@ See calc-keypad for details."
     ;; Syntax error!
     (t nil))))
 
+;;; Parse a very simple number, keeping all digits.
+(defun math-read-number-simple (s)
+  "Convert the string S into a Calc number.
+S is assumed to be a simple number (integer or float without an exponent)
+and all digits are kept, regardless of Calc's current precision."
+   (cond
+    ;; Integer
+    ((string-match "^[0-9]+$" s)
+     (if (string-match "^\\(0+\\)" s)
+         (setq s (substring s (match-end 0))))
+     (if (<= (length s) (* 2 math-bignum-digit-length))
+         (string-to-number s)
+       (cons 'bigpos (math-read-bignum s))))
+    ;; Minus sign
+    ((string-match "^-[0-9]+$" s)
+     (if (<= (length s) (1+ (* 2 math-bignum-digit-length)))
+         (string-to-number s)
+       (cons 'bigneg (math-read-bignum (substring s 1)))))
+    ;; Decimal point
+    ((string-match "^\\(-?[0-9]*\\)\\.\\([0-9]*\\)$" s)
+     (let ((int (math-match-substring s 1))
+          (frac (math-match-substring s 2)))
+       (list 'float (math-read-number-simple (concat int frac))
+             (- (length frac)))))
+    ;; Syntax error!
+    (t nil)))
+
 (defun math-match-substring (s n)
   (if (match-beginning n)
       (substring s (match-beginning n) (match-end n))
     ""))
 
 (defun math-read-bignum (s)   ; [l X]
-  (if (> (length s) 3)
-      (cons (string-to-number (substring s -3))
-           (math-read-bignum (substring s 0 -3)))
+  (if (> (length s) math-bignum-digit-length)
+      (cons (string-to-number (substring s (- math-bignum-digit-length)))
+           (math-read-bignum (substring s 0 (- math-bignum-digit-length))))
     (list (string-to-number s))))
 
 
@@ -3467,8 +3539,6 @@ See calc-keypad for details."
      ( "!"     calcFunc-fact 210  -1 )
      ( "^"     ^             201 200 )
      ( "**"    ^             201 200 )
-     ( "*"     *             196 195 )
-     ( "2x"    *             196 195 )
      ( "/"     /             190 191 )
      ( "%"     %             190 191 )
      ( "\\"    calcFunc-idiv 190 191 )
@@ -3492,7 +3562,31 @@ See calc-keypad for details."
      ( "::"    calcFunc-condition 45 46 )
      ( "=>"    calcFunc-evalto 40 41 )
      ( "=>"    calcFunc-evalto 40 -1 )))
-(defvar math-expr-opers math-standard-opers)
+
+(defun math-standard-ops ()
+  (if calc-multiplication-has-precedence
+      (cons
+       '( "*"     *             196 195 )
+       (cons
+        '( "2x"    *             196 195 )
+        math-standard-opers))
+    (cons
+     '( "*"     *             190 191 )
+     (cons
+      '( "2x"    *             190 191 )
+      math-standard-opers))))
+
+(defvar math-expr-opers (math-standard-ops))
+
+(defun math-standard-ops-p ()
+  (let ((meo (caar math-expr-opers)))
+    (and (stringp meo)
+         (string= meo "*"))))
+
+(defun math-expr-ops ()
+  (if (math-standard-ops-p)
+      (math-standard-ops)
+    math-expr-opers))
 
 ;;;###autoload
 (defun calc-grab-region (top bot arg)
index 9f263a2..5aa410b 100644 (file)
                 (if (calc-is-hyperbolic) 'calcFunc-efit
                   'calcFunc-fit)))
         key (which 0)
+         (nonlinear nil)
+         (plot nil)
         n calc-curve-nvars temp data
         (homog nil)
         (msgs '( "(Press ? for help)"
                  "E = a 10^(b x), X = 10^(a + b x), L = a + b log10(x)"
                  "q = a + b (x-c)^2"
                  "g = (a/b sqrt(2 pi)) exp(-0.5*((x-c)/b)^2)"
+                  "s = a/(1 + exp(b (x - c)))"
+                  "b = a exp(b (x - c))/(1 + exp(b (x - c)))^2"
+                  "o = (y/x) = a (1 - x/b)"
                  "h prefix = homogeneous model (no constant term)"
+                  "P prefix = plot result"
                  "' = alg entry, $ = stack, u = Model1, U = Model2")))
      (while (not calc-curve-model)
-       (message "Fit to model: %s:%s"
-               (nth which msgs)
-               (if homog " h" ""))
+       (message 
+        "Fit to model: %s:%s%s"
+        (nth which msgs)
+        (if plot "P" " ")
+        (if homog "h" ""))
        (setq key (read-char))
        (cond ((= key ?\C-g)
              (keyboard-quit))
              (setq which (% (1+ which) (length msgs))))
             ((memq key '(?h ?H))
              (setq homog (not homog)))
+             ((= key ?P)
+              (if plot
+                  (setq plot nil)
+                (let ((data (calc-top 1)))
+                  (if (or
+                       (calc-is-hyperbolic)
+                       (calc-is-inverse)
+                       (not (= (length data) 3)))
+                      (setq plot "Can't plot")
+                    (setq plot data)))))
             ((progn
                (if (eq key ?\$)
                    (setq n 1)
             ((= key ?1)  ; linear or multilinear
              (calc-get-fit-variables calc-curve-nvars 
                                       (1+ calc-curve-nvars) (and homog 0))
-             (setq calc-curve-model (math-mul calc-curve-coefnames
-                                   (cons 'vec (cons 1 (cdr calc-curve-varnames))))))
+             (setq calc-curve-model 
+                    (math-mul calc-curve-coefnames
+                              (cons 'vec (cons 1 (cdr calc-curve-varnames))))))
             ((and (>= key ?2) (<= key ?9))   ; polynomial
              (calc-get-fit-variables 1 (- key ?0 -1) (and homog 0))
              (setq calc-curve-model 
             ((= key ?p)  ; power law
              (calc-get-fit-variables calc-curve-nvars 
                                       (1+ calc-curve-nvars) (and homog 1))
-             (setq calc-curve-model (math-mul (nth 1 calc-curve-coefnames)
-                                   (calcFunc-reduce
-                                    '(var mul var-mul)
-                                    (calcFunc-map
-                                     '(var pow var-pow)
-                                     calc-curve-varnames
-                                     (cons 'vec (cdr (cdr calc-curve-coefnames))))))))
+             (setq calc-curve-model 
+                    (math-mul 
+                     (nth 1 calc-curve-coefnames)
+                     (calcFunc-reduce
+                      '(var mul var-mul)
+                      (calcFunc-map
+                       '(var pow var-pow)
+                       calc-curve-varnames
+                       (cons 'vec (cdr (cdr calc-curve-coefnames))))))))
             ((= key ?^)  ; exponential law
              (calc-get-fit-variables calc-curve-nvars 
                                       (1+ calc-curve-nvars) (and homog 1))
-             (setq calc-curve-model (math-mul (nth 1 calc-curve-coefnames)
-                                   (calcFunc-reduce
-                                    '(var mul var-mul)
-                                    (calcFunc-map
-                                     '(var pow var-pow)
-                                     (cons 'vec (cdr (cdr calc-curve-coefnames)))
-                                     calc-curve-varnames)))))
+             (setq calc-curve-model 
+                    (math-mul (nth 1 calc-curve-coefnames)
+                              (calcFunc-reduce
+                               '(var mul var-mul)
+                               (calcFunc-map
+                                '(var pow var-pow)
+                                (cons 'vec (cdr (cdr calc-curve-coefnames)))
+                                calc-curve-varnames)))))
+             ((= key ?s)
+              (setq nonlinear t)
+              (setq calc-curve-model t)
+              (require 'calc-nlfit)
+              (calc-fit-s-shaped-logistic-curve func))
+             ((= key ?b)
+              (setq nonlinear t)
+              (setq calc-curve-model t)
+              (require 'calc-nlfit)
+              (calc-fit-bell-shaped-logistic-curve func))
+             ((= key ?o)
+              (setq nonlinear t)
+              (setq calc-curve-model t)
+              (require 'calc-nlfit)
+              (if (and plot (not (stringp plot)))
+                  (setq plot
+                        (list 'vec
+                              (nth 1 plot)
+                              (cons
+                               'vec
+                               (mapcar* 'calcFunc-div
+                                        (cdr (nth 2 plot))
+                                        (cdr (nth 1 plot)))))))
+              (calc-fit-hubbert-linear-curve func))
             ((memq key '(?e ?E))
              (calc-get-fit-variables calc-curve-nvars 
                                       (1+ calc-curve-nvars) (and homog 1))
-             (setq calc-curve-model (math-mul (nth 1 calc-curve-coefnames)
-                                   (calcFunc-reduce
-                                    '(var mul var-mul)
-                                    (calcFunc-map
-                                     (if (eq key ?e)
-                                         '(var exp var-exp)
-                                       '(calcFunc-lambda
-                                         (var a var-a)
-                                         (^ 10 (var a var-a))))
-                                     (calcFunc-map
-                                      '(var mul var-mul)
-                                      (cons 'vec (cdr (cdr calc-curve-coefnames)))
-                                      calc-curve-varnames))))))
+             (setq calc-curve-model 
+                    (math-mul (nth 1 calc-curve-coefnames)
+                              (calcFunc-reduce
+                               '(var mul var-mul)
+                               (calcFunc-map
+                                (if (eq key ?e)
+                                    '(var exp var-exp)
+                                  '(calcFunc-lambda
+                                    (var a var-a)
+                                    (^ 10 (var a var-a))))
+                                (calcFunc-map
+                                 '(var mul var-mul)
+                                 (cons 'vec (cdr (cdr calc-curve-coefnames)))
+                                 calc-curve-varnames))))))
             ((memq key '(?x ?X))
              (calc-get-fit-variables calc-curve-nvars 
                                       (1+ calc-curve-nvars) (and homog 0))
-             (setq calc-curve-model (math-mul calc-curve-coefnames
-                                   (cons 'vec (cons 1 (cdr calc-curve-varnames)))))
+             (setq calc-curve-model 
+                    (math-mul calc-curve-coefnames
+                              (cons 'vec (cons 1 (cdr calc-curve-varnames)))))
              (setq calc-curve-model (if (eq key ?x)
                              (list 'calcFunc-exp calc-curve-model)
                            (list '^ 10 calc-curve-model))))
             ((memq key '(?l ?L))
              (calc-get-fit-variables calc-curve-nvars 
                                       (1+ calc-curve-nvars) (and homog 0))
-             (setq calc-curve-model (math-mul calc-curve-coefnames
-                                   (cons 'vec
-                                         (cons 1 (cdr (calcFunc-map
-                                                       (if (eq key ?l)
-                                                           '(var ln var-ln)
-                                                         '(var log10
-                                                               var-log10))
-                                                       calc-curve-varnames)))))))
+             (setq calc-curve-model 
+                    (math-mul calc-curve-coefnames
+                              (cons 'vec
+                                    (cons 1 (cdr (calcFunc-map
+                                                  (if (eq key ?l)
+                                                      '(var ln var-ln)
+                                                    '(var log10
+                                                          var-log10))
+                                                  calc-curve-varnames)))))))
             ((= key ?q)
              (calc-get-fit-variables calc-curve-nvars 
                                       (1+ (* 2 calc-curve-nvars)) (and homog 0))
                                           (list '- (car v) (nth 1 c))
                                           2)))))))
             ((= key ?g)
-             (setq calc-curve-model 
-                    (math-read-expr "(AFit / BFit sqrt(2 pi)) exp(-0.5 * ((XFit - CFit) / BFit)^2)")
-                   calc-curve-varnames '(vec (var XFit var-XFit))
-                   calc-curve-coefnames '(vec (var AFit var-AFit)
-                                   (var BFit var-BFit)
-                                   (var CFit var-CFit)))
+             (setq 
+               calc-curve-model 
+               (math-read-expr 
+                "(AFit / BFit sqrt(2 pi)) exp(-0.5 * ((XFit - CFit) / BFit)^2)")
+               calc-curve-varnames '(vec (var XFit var-XFit))
+               calc-curve-coefnames '(vec (var AFit var-AFit)
+                                          (var BFit var-BFit)
+                                          (var CFit var-CFit)))
              (calc-get-fit-variables 1 (1- (length calc-curve-coefnames)) 
                                       (and homog 1)))
             ((memq key '(?\$ ?\' ?u ?U))
                    (let* ((calc-dollar-values calc-arg-values)
                           (calc-dollar-used 0)
                           (calc-hashes-used 0))
-                     (setq calc-curve-model (calc-do-alg-entry "" "Model formula: "
-                                                        nil 'calc-curve-fit-history))
+                     (setq calc-curve-model 
+                            (calc-do-alg-entry "" "Model formula: "
+                                               nil 'calc-curve-fit-history))
                      (if (/= (length calc-curve-model) 1)
                          (error "Bad format"))
                      (setq calc-curve-model (car calc-curve-model)
                                   (or (nth 3 calc-curve-model)
                                       (cons 'vec
                                             (math-all-vars-but
-                                             calc-curve-model calc-curve-varnames)))
+                                             calc-curve-model 
+                                             calc-curve-varnames)))
                                  calc-curve-model (nth 1 calc-curve-model))
                          (error "Incorrect model specifier")))))
                (or calc-curve-varnames
-                   (let ((with-y (eq (car-safe calc-curve-model) 'calcFunc-eq)))
+                   (let ((with-y 
+                           (eq (car-safe calc-curve-model) 'calcFunc-eq)))
                      (if calc-curve-coefnames
                          (calc-get-fit-variables 
                            (if with-y (1+ calc-curve-nvars) calc-curve-nvars)
                            nil with-y)
                        (let* ((coefs (math-all-vars-but calc-curve-model nil))
                               (vars nil)
-                              (n (- (length coefs) calc-curve-nvars (if with-y 2 1)))
+                              (n (- 
+                                   (length coefs) 
+                                   calc-curve-nvars 
+                                   (if with-y 2 1)))
                               p)
                          (if (< n 0)
                              (error "Not enough variables in model"))
                                        calc-curve-varnames calc-curve-coefnames)
                                 "modl"))))
             (t (beep))))
-     (let ((calc-fit-to-trail t))
-       (calc-enter-result n (substring (symbol-name func) 9)
-                         (list func calc-curve-model
-                               (if (= (length calc-curve-varnames) 2)
-                                   (nth 1 calc-curve-varnames)
-                                 calc-curve-varnames)
-                               (if (= (length calc-curve-coefnames) 2)
-                                   (nth 1 calc-curve-coefnames)
-                                 calc-curve-coefnames)
-                               data))
-       (if (consp calc-fit-to-trail)
-          (calc-record (calc-normalize calc-fit-to-trail) "parm"))))))
+     (unless nonlinear
+       (let ((calc-fit-to-trail t))
+         (calc-enter-result n (substring (symbol-name func) 9)
+                            (list func calc-curve-model
+                                  (if (= (length calc-curve-varnames) 2)
+                                      (nth 1 calc-curve-varnames)
+                                    calc-curve-varnames)
+                                  (if (= (length calc-curve-coefnames) 2)
+                                      (nth 1 calc-curve-coefnames)
+                                    calc-curve-coefnames)
+                                  data))
+         (if (consp calc-fit-to-trail)
+             (calc-record (calc-normalize calc-fit-to-trail) "parm"))))
+  (when plot
+    (if (stringp plot)
+        (message plot)
+      (let ((calc-graph-no-auto-view t))
+        (calc-graph-delete t)
+        (calc-graph-add-curve
+         (calc-graph-lookup (nth 1 plot))
+         (calc-graph-lookup (nth 2 plot)))
+        (unless (math-contains-sdev-p (nth 2 data))
+          (calc-graph-set-styles nil nil)
+          (calc-graph-point-style nil))
+        (setq plot (cdr (nth 1 plot)))
+        (setq plot 
+              (list 'intv
+                    3
+                    (math-sub
+                     (math-min-list (car plot) (cdr plot))
+                     '(float 5 -1))
+                    (math-add
+                     '(float 5 -1)
+                     (math-max-list (car plot) (cdr plot)))))
+        (calc-graph-add-curve (calc-graph-lookup plot)
+                              (calc-graph-lookup (calc-top-n 1)))
+        (calc-graph-plot nil)))))))
 
 (defun calc-invent-independent-variables (n &optional but)
   (calc-invent-variables n but '(x y z t) "x"))
index 507ad53..6bd663c 100644 (file)
@@ -83,6 +83,7 @@
 
 (defun math-compose-expr (a prec)
   (let ((math-compose-level (1+ math-compose-level))
+        (math-expr-opers (math-expr-ops))
         spfn)
     (cond
      ((or (and (eq a math-comp-selected) a)
index 80d6830..6f3c2a0 100644 (file)
@@ -278,7 +278,7 @@ Examples:
     ("IC" acos (D (acos X))    x  6)
     ("IT" atan (D (atan X))    x  6)
     ("Q"  sqrt sqrt            x  7)
-    ("^"  ^    expt            2  7)
+    ("^"  ^    calculator-expt 2  7)
     ("!"  !    calculator-fact x  7)
     (";"  1/   (/ 1 X)         1  7)
     ("_"  -    -               1  8)
@@ -596,7 +596,8 @@ specified, then it is fixed, otherwise it depends on this variable).
 `+' and `-' can be used as either binary operators or prefix unary
 operators.  Numbers can be entered with exponential notation using `e',
 except when using a non-decimal radix mode for input (in this case `e'
-will be the hexadecimal digit).
+will be the hexadecimal digit).  If the result of a calculation is too
+large (out of range for Emacs), the value of \"inf\" is returned.
 
 Here are the editing keys:
 * `RET' `='      evaluate the current expression
@@ -1779,13 +1780,57 @@ To use this, apply a binary operator (evaluate it), then call this."
        (car calculator-last-opXY) (nth 1 calculator-last-opXY) x))
     x))
 
+(defun calculator-integer-p (x)
+  "Non-nil if X is equal to an integer."
+  (condition-case nil
+      (= x (ftruncate x))
+    (error nil)))
+
+(defun calculator-expt (x y)
+  "Compute X^Y, dealing with errors appropriately."
+  (condition-case
+      nil
+      (expt x y)
+    (domain-error 0.0e+NaN)
+    (range-error
+     (cond
+      ((and (< x 1.0) (> x -1.0))
+       ;; For small x, the range error comes from large y.
+       0.0)
+      ((and (> x 0.0) (< y 0.0))
+       ;; For large positive x and negative y, the range error 
+       ;; comes from large negative y.
+       0.0)
+      ((and (> x 0.0) (> y 0.0))
+       ;; For large positive x and positive y, the range error 
+       ;; comes from large y.
+       1.0e+INF)
+      ;; For the rest, x must be large and negative.
+      ;; The range errors come from large integer y.
+      ((< y 0.0)
+       0.0)
+      ((oddp (truncate y))
+       ;; If y is odd
+       -1.0e+INF)
+      (t
+       ;; 
+       1.0e+INF)))
+    (error 0.0e+NaN)))
+
 (defun calculator-fact (x)
   "Simple factorial of X."
-  (let ((r (if (<= x 10) 1 1.0)))
-    (while (> x 0)
-      (setq r (* r (truncate x)))
-      (setq x (1- x)))
-    (+ 0.0 r)))
+  (if (and (>= x 0)
+           (calculator-integer-p x))
+      (if (= (calculator-expt (/ x 3.0) x) 1.0e+INF)
+          1.0e+INF
+        (let ((r (if (<= x 10) 1 1.0)))
+          (while (> x 0)
+            (setq r (* r (truncate x)))
+            (setq x (1- x)))
+          (+ 0.0 r)))
+    (if (= x 1.0e+INF)
+        x
+      0.0e+NaN)))
 
 (defun calculator-truncate (n)
   "Truncate N, return 0 in case of overflow."
index 7f343f3..94df068 100644 (file)
@@ -531,9 +531,9 @@ The time should be in either 24 hour format or am/pm format."
     (message "")))
 
 
-(eval-when-compile (defvar number)
-                  (defvar original-date)
-                  (defvar diary-entries-list))
+(defvar number)
+(defvar original-date)
+(defvar diary-entries-list)
 ;;;###autoload
 (defun appt-make-list ()
   "Update the appointments list from today's diary buffer.
@@ -634,7 +634,7 @@ appointment package (if it is not already active)."
 (defun appt-sort-list (appt-list)
   "Sort an appointment list, putting earlier items at the front.
 APPT-LIST is a list of the same format as `appt-time-msg-list'."
-(sort appt-list (lambda (e1 e2) (< (caar e1) (caar e2)))))
+  (sort appt-list (lambda (e1 e2) (< (caar e1) (caar e2)))))
 
 
 (defun appt-convert-time (time2conv)
index adb9e20..1657611 100644 (file)
 
 (require 'cal-julian)
 
-(defvar bahai-calendar-month-name-array
+(defconst calendar-bahai-month-name-array
   ["Baha" "Jalal" "Jamal" "`Azamat" "Nur" "Rahmat" "Kalimat" "Kamal"
    "Asma" "`Izzat" "Mashiyyat" "`Ilm" "Qudrat" "Qawl" "Masa'il"
    "Sharaf" "Sultan" "Mulk" "`Ala"])
 
-(defvar calendar-bahai-epoch (calendar-absolute-from-gregorian '(3 21 1844))
+(defconst calendar-bahai-epoch (calendar-absolute-from-gregorian '(3 21 1844))
   "Absolute date of start of Baha'i calendar = March 19, 622 A.D. (Julian).")
 
-(defun bahai-calendar-leap-year-p (year)
+(defun calendar-bahai-leap-year-p (year)
   "True if YEAR is a leap year on the Baha'i calendar."
   (calendar-leap-year-p (+ year 1844)))
 
-(defvar bahai-calendar-leap-base
+(defconst calendar-bahai-leap-base
   (+ (/ 1844 4) (- (/ 1844 100)) (/ 1844 400)))
 
 (defun calendar-absolute-from-bahai (date)
@@ -89,7 +89,7 @@ Gregorian date Sunday, December 31, 1 BC."
         (leap-days (- (+ (/ prior-years 4) ; Leap days in prior years.
                          (- (/ prior-years 100))
                          (/ prior-years 400))
-                      bahai-calendar-leap-base)))
+                      calendar-bahai-leap-base)))
     (+ (1- calendar-bahai-epoch)       ; Days before epoch
        (* 365 (1- year))               ; Days in prior years.
        leap-days
@@ -131,10 +131,10 @@ Defaults to today's date if DATE is not given."
           (if (and (= m 19)
                    (<= d 0))
               "Ayyam-i-Ha"
-            (aref bahai-calendar-month-name-array (1- m))))
+            (aref calendar-bahai-month-name-array (1- m))))
          (day (int-to-string
                (if (<= d 0)
-                   (if (bahai-calendar-leap-year-p y)
+                   (if (calendar-bahai-leap-year-p y)
                        (+ d 5)
                      (+ d 4))
                  d)))
@@ -152,12 +152,12 @@ Defaults to today's date if DATE is not given."
 (defun calendar-goto-bahai-date (date &optional noecho)
   "Move cursor to Baha'i date DATE.
 Echo Baha'i date unless NOECHO is t."
-  (interactive (bahai-prompt-for-date))
+  (interactive (calendar-bahai-prompt-for-date))
   (calendar-goto-date (calendar-gregorian-from-absolute
                        (calendar-absolute-from-bahai date)))
   (or noecho (calendar-print-bahai-date)))
 
-(defun bahai-prompt-for-date ()
+(defun calendar-bahai-prompt-for-date ()
   "Ask for a Baha'i date."
   (let* ((today (calendar-current-date))
          (year (calendar-read
@@ -172,9 +172,9 @@ Echo Baha'i date unless NOECHO is t."
                        (completing-read
                         "Baha'i calendar month name: "
                         (mapcar 'list
-                                (append bahai-calendar-month-name-array nil))
+                                (append calendar-bahai-month-name-array nil))
                         nil t)
-                      (calendar-make-alist bahai-calendar-month-name-array
+                      (calendar-make-alist calendar-bahai-month-name-array
                                            1))))
          (day (calendar-read "Baha'i calendar day (1-19): "
                             '(lambda (x) (and (< 0 x) (<= x 19))))))
@@ -204,7 +204,7 @@ nil if it is not visible in the current calendar window."
             (if (calendar-date-is-visible-p date)
                 (list (list date string))))))))
 
-(defun list-bahai-diary-entries ()
+(defun diary-list-bahai-entries ()
   "Add any Baha'i date entries from the diary file to `diary-entries-list'.
 Baha'i date diary entries must be prefaced by an
 `bahai-diary-entry-symbol' (normally a `B').  The same diary date
@@ -220,77 +220,77 @@ calendar.  This function is provided for use with the
             (diary-modified (buffer-modified-p))
             (gdate original-date)
             (mark (regexp-quote diary-nonmarking-symbol)))
-        (calendar-for-loop i from 1 to number do
-           (let* ((d diary-date-forms)
-                  (bdate (calendar-bahai-from-absolute
-                          (calendar-absolute-from-gregorian gdate)))
-                  (month (extract-calendar-month bdate))
-                  (day (extract-calendar-day bdate))
-                  (year (extract-calendar-year bdate)))
-             (while d
-               (let*
-                   ((date-form (if (equal (car (car d)) 'backup)
-                                   (cdr (car d))
-                                 (car d)))
-                    (backup (equal (car (car d)) 'backup))
-                    (dayname
-                     (concat
-                      (calendar-day-name gdate) "\\|"
-                      (substring (calendar-day-name gdate) 0 3) ".?"))
-                    (calendar-month-name-array
-                     bahai-calendar-month-name-array)
-                    (monthname
-                     (concat
-                      "\\*\\|"
-                      (calendar-month-name month)))
-                    (month (concat "\\*\\|0*" (int-to-string month)))
-                    (day (concat "\\*\\|0*" (int-to-string day)))
-                    (year
-                     (concat
-                      "\\*\\|0*" (int-to-string year)
-                      (if abbreviated-calendar-year
-                          (concat "\\|" (int-to-string (% year 100)))
-                        "")))
-                    (regexp
-                     (concat
-                      "\\(\\`\\|\^M\\|\n\\)" mark "?"
-                      (regexp-quote bahai-diary-entry-symbol)
-                      "\\("
-                      (mapconcat 'eval date-form "\\)\\(")
-                      "\\)"))
-                    (case-fold-search t))
-                 (goto-char (point-min))
-                 (while (re-search-forward regexp nil t)
-                   (if backup (re-search-backward "\\<" nil t))
-                   (if (and (or (char-equal (preceding-char) ?\^M)
-                                (char-equal (preceding-char) ?\n))
-                            (not (looking-at " \\|\^I")))
-                       ;;  Diary entry that consists only of date.
-                       (backward-char 1)
-                     ;;  Found a nonempty diary entry--make it visible and
-                     ;;  add it to the list.
-                     (let ((entry-start (point))
-                           (date-start))
-                       (re-search-backward "\^M\\|\n\\|\\`")
-                       (setq date-start (point))
-                       (re-search-forward "\^M\\|\n" nil t 2)
-                       (while (looking-at " \\|\^I")
-                         (re-search-forward "\^M\\|\n" nil t))
-                       (backward-char 1)
-                       (subst-char-in-region date-start (point) ?\^M ?\n t)
-                       (add-to-diary-list
-                        gdate
-                        (buffer-substring-no-properties entry-start (point))
-                        (buffer-substring-no-properties
-                         (1+ date-start) (1- entry-start)))))))
-               (setq d (cdr d))))
-           (setq gdate
-                 (calendar-gregorian-from-absolute
-                  (1+ (calendar-absolute-from-gregorian gdate)))))
-           (set-buffer-modified-p diary-modified))
-        (goto-char (point-min))))
-
-(defun mark-bahai-diary-entries ()
+        (dotimes (idummy number)
+          (let* ((d diary-date-forms)
+                 (bdate (calendar-bahai-from-absolute
+                         (calendar-absolute-from-gregorian gdate)))
+                 (month (extract-calendar-month bdate))
+                 (day (extract-calendar-day bdate))
+                 (year (extract-calendar-year bdate)))
+            (while d
+              (let*
+                  ((date-form (if (equal (car (car d)) 'backup)
+                                  (cdr (car d))
+                                (car d)))
+                   (backup (equal (car (car d)) 'backup))
+                   (dayname
+                    (concat
+                     (calendar-day-name gdate) "\\|"
+                     (substring (calendar-day-name gdate) 0 3) ".?"))
+                   (calendar-month-name-array
+                    calendar-bahai-month-name-array)
+                   (monthname
+                    (concat
+                     "\\*\\|"
+                     (calendar-month-name month)))
+                   (month (concat "\\*\\|0*" (int-to-string month)))
+                   (day (concat "\\*\\|0*" (int-to-string day)))
+                   (year
+                    (concat
+                     "\\*\\|0*" (int-to-string year)
+                     (if abbreviated-calendar-year
+                         (concat "\\|" (int-to-string (% year 100)))
+                       "")))
+                   (regexp
+                    (concat
+                     "\\(\\`\\|\^M\\|\n\\)" mark "?"
+                     (regexp-quote bahai-diary-entry-symbol)
+                     "\\("
+                     (mapconcat 'eval date-form "\\)\\(")
+                     "\\)"))
+                   (case-fold-search t))
+                (goto-char (point-min))
+                (while (re-search-forward regexp nil t)
+                  (if backup (re-search-backward "\\<" nil t))
+                  (if (and (or (char-equal (preceding-char) ?\^M)
+                               (char-equal (preceding-char) ?\n))
+                           (not (looking-at " \\|\^I")))
+                      ;;  Diary entry that consists only of date.
+                      (backward-char 1)
+                    ;;  Found a nonempty diary entry--make it visible and
+                    ;;  add it to the list.
+                    (let ((entry-start (point))
+                          (date-start))
+                      (re-search-backward "\^M\\|\n\\|\\`")
+                      (setq date-start (point))
+                      (re-search-forward "\^M\\|\n" nil t 2)
+                      (while (looking-at " \\|\^I")
+                        (re-search-forward "\^M\\|\n" nil t))
+                      (backward-char 1)
+                      (subst-char-in-region date-start (point) ?\^M ?\n t)
+                      (add-to-diary-list
+                       gdate
+                       (buffer-substring-no-properties entry-start (point))
+                       (buffer-substring-no-properties
+                        (1+ date-start) (1- entry-start)))))))
+              (setq d (cdr d))))
+          (setq gdate
+                (calendar-gregorian-from-absolute
+                 (1+ (calendar-absolute-from-gregorian gdate)))))
+        (set-buffer-modified-p diary-modified))
+    (goto-char (point-min))))
+
+(defun diary-bahai-mark-entries ()
   "Mark days in the calendar window that have Baha'i date diary entries.
 Each entry in diary-file (or included files) visible in the calendar
 window is marked.  Baha'i date entries are prefaced by a
@@ -311,7 +311,7 @@ nongregorian-diary-marking-hook."
            (dayname (diary-name-pattern calendar-day-name-array))
            (monthname
             (concat
-             (diary-name-pattern bahai-calendar-month-name-array t)
+             (diary-name-pattern calendar-bahai-month-name-array t)
              "\\|\\*"))
            (month "[0-9]+\\|\\*")
            (day "[0-9]+\\|\\*")
@@ -395,12 +395,12 @@ nongregorian-diary-marking-hook."
                           (cdr (assoc-string
                                 mm-name
                                 (calendar-make-alist
-                                  bahai-calendar-month-name-array)
+                                  calendar-bahai-month-name-array)
                                 t)))))
-              (mark-bahai-calendar-date-pattern mm dd yy)))))
+              (calendar-bahai-mark-date-pattern mm dd yy)))))
       (setq d (cdr d)))))
 
-(defun mark-bahai-calendar-date-pattern (month day year)
+(defun calendar-bahai-mark-date-pattern (month day year)
   "Mark dates in calendar window that conform to Baha'i date MONTH/DAY/YEAR.
 A value of 0 in any position is a wildcard."
   (save-excursion
@@ -458,12 +458,12 @@ A value of 0 in any position is a wildcard."
                  (mark-visible-calendar-date
                   (calendar-gregorian-from-absolute date)))))))))
 
-(defun insert-bahai-diary-entry (arg)
+(defun diary-insert-bahai-entry (arg)
   "Insert a diary entry.
 For the Baha'i date corresponding to the date indicated by point.
 Prefix arg will make the entry nonmarking."
   (interactive "P")
-  (let* ((calendar-month-name-array bahai-calendar-month-name-array))
+  (let* ((calendar-month-name-array calendar-bahai-month-name-array))
     (make-diary-entry
      (concat
       bahai-diary-entry-symbol
@@ -474,14 +474,14 @@ Prefix arg will make the entry nonmarking."
        nil t))
      arg)))
 
-(defun insert-monthly-bahai-diary-entry (arg)
+(defun diary-bahai-insert-monthly-entry (arg)
   "Insert a monthly diary entry.
 For the day of the Baha'i month corresponding to the date indicated by point.
 Prefix arg will make the entry nonmarking."
   (interactive "P")
   (let* ((calendar-date-display-form
           (if european-calendar-style '(day " * ") '("* " day )))
-         (calendar-month-name-array bahai-calendar-month-name-array))
+         (calendar-month-name-array calendar-bahai-month-name-array))
     (make-diary-entry
      (concat
       bahai-diary-entry-symbol
@@ -491,7 +491,7 @@ Prefix arg will make the entry nonmarking."
          (calendar-cursor-to-date t)))))
      arg)))
 
-(defun insert-yearly-bahai-diary-entry (arg)
+(defun diary-bahai-insert-yearly-entry (arg)
   "Insert an annual diary entry.
 For the day of the Baha'i year corresponding to the date indicated by point.
 Prefix arg will make the entry nonmarking."
@@ -500,7 +500,7 @@ Prefix arg will make the entry nonmarking."
           (if european-calendar-style
               '(day " " monthname)
             '(monthname " " day)))
-         (calendar-month-name-array bahai-calendar-month-name-array))
+         (calendar-month-name-array calendar-bahai-month-name-array))
     (make-diary-entry
      (concat
       bahai-diary-entry-symbol
@@ -510,7 +510,21 @@ Prefix arg will make the entry nonmarking."
          (calendar-cursor-to-date t)))))
      arg)))
 
+;; Backward compatibility.
+(define-obsolete-function-alias
+  'list-bahai-diary-entries 'diary-list-bahai-entries "23.1")
+(define-obsolete-function-alias
+  'mark-bahai-diary-entries 'diary-mark-bahai-entries "23.1")
+(define-obsolete-function-alias
+  'insert-bahai-diary-entry 'diary-insert-bahai-entry "23.1")
+(define-obsolete-function-alias
+  'insert-monthly-bahai-diary-entry 'diary-insert-bahai-monthly-entry "23.1")
+(define-obsolete-function-alias
+  'insert-yearly-bahai-diary-entry 'diary-insert-bahai-yearly-entry "23.1")
+(define-obsolete-function-alias
+  'mark-bahai-calendar-date-pattern 'calendar-bahai-mark-date-pattern "23.1")
+
 (provide 'cal-bahai)
 
-;;; arch-tag: c1cb1d67-862a-4264-a01c-41cb4df01f14
+;; arch-tag: c1cb1d67-862a-4264-a01c-41cb4df01f14
 ;;; cal-bahai.el ends here
index 052c9bf..f48d3b2 100644 (file)
@@ -516,76 +516,76 @@ not be marked in the calendar.  This function is provided for use with the
             (diary-modified (buffer-modified-p))
             (gdate original-date)
             (mark (regexp-quote diary-nonmarking-symbol)))
-        (calendar-for-loop i from 1 to number do
-           (let* ((d diary-date-forms)
-                  (hdate (calendar-hebrew-from-absolute
-                          (calendar-absolute-from-gregorian gdate)))
-                  (month (extract-calendar-month hdate))
-                  (day (extract-calendar-day hdate))
-                  (year (extract-calendar-year hdate)))
-             (while d
-               (let*
-                   ((date-form (if (equal (car (car d)) 'backup)
-                                   (cdr (car d))
-                                 (car d)))
-                    (backup (equal (car (car d)) 'backup))
-                    (dayname
-                     (format "%s\\|%s\\.?"
-                             (calendar-day-name gdate)
-                             (calendar-day-name gdate 'abbrev)))
-                    (calendar-month-name-array
-                     calendar-hebrew-month-name-array-leap-year)
-                    (monthname
-                     (concat
-                      "\\*\\|"
-                      (calendar-month-name month)))
-                    (month (concat "\\*\\|0*" (int-to-string month)))
-                    (day (concat "\\*\\|0*" (int-to-string day)))
-                    (year
-                     (concat
-                      "\\*\\|0*" (int-to-string year)
-                      (if abbreviated-calendar-year
-                          (concat "\\|" (int-to-string (% year 100)))
-                        "")))
-                    (regexp
-                     (concat
-                      "\\(\\`\\|\^M\\|\n\\)" mark "?"
-                      (regexp-quote hebrew-diary-entry-symbol)
-                      "\\("
-                      (mapconcat 'eval date-form "\\)\\(")
-                      "\\)"))
-                    (case-fold-search t))
-                 (goto-char (point-min))
-                 (while (re-search-forward regexp nil t)
-                   (if backup (re-search-backward "\\<" nil t))
-                   (if (and (or (char-equal (preceding-char) ?\^M)
-                                (char-equal (preceding-char) ?\n))
-                            (not (looking-at " \\|\^I")))
-                       ;;  Diary entry that consists only of date.
-                       (backward-char 1)
-                     ;;  Found a nonempty diary entry--make it visible and
-                     ;;  add it to the list.
-                     (let ((entry-start (point))
-                           (date-start))
-                       (re-search-backward "\^M\\|\n\\|\\`")
-                       (setq date-start (point))
-                       (re-search-forward "\^M\\|\n" nil t 2)
-                       (while (looking-at " \\|\^I")
-                         (re-search-forward "\^M\\|\n" nil t))
-                       (backward-char 1)
-                       (subst-char-in-region date-start (point) ?\^M ?\n t)
-                       (add-to-diary-list
-                        gdate
-                        (buffer-substring-no-properties entry-start (point))
-                        (buffer-substring-no-properties
-                         (1+ date-start) (1- entry-start))
-                        (copy-marker entry-start))))))
-               (setq d (cdr d))))
-           (setq gdate
-                 (calendar-gregorian-from-absolute
-                  (1+ (calendar-absolute-from-gregorian gdate)))))
-           (set-buffer-modified-p diary-modified))
-        (goto-char (point-min))))
+        (dotimes (idummy number)
+          (let* ((d diary-date-forms)
+                 (hdate (calendar-hebrew-from-absolute
+                         (calendar-absolute-from-gregorian gdate)))
+                 (month (extract-calendar-month hdate))
+                 (day (extract-calendar-day hdate))
+                 (year (extract-calendar-year hdate)))
+            (while d
+              (let*
+                  ((date-form (if (equal (car (car d)) 'backup)
+                                  (cdr (car d))
+                                (car d)))
+                   (backup (equal (car (car d)) 'backup))
+                   (dayname
+                    (format "%s\\|%s\\.?"
+                            (calendar-day-name gdate)
+                            (calendar-day-name gdate 'abbrev)))
+                   (calendar-month-name-array
+                    calendar-hebrew-month-name-array-leap-year)
+                   (monthname
+                    (concat
+                     "\\*\\|"
+                     (calendar-month-name month)))
+                   (month (concat "\\*\\|0*" (int-to-string month)))
+                   (day (concat "\\*\\|0*" (int-to-string day)))
+                   (year
+                    (concat
+                     "\\*\\|0*" (int-to-string year)
+                     (if abbreviated-calendar-year
+                         (concat "\\|" (int-to-string (% year 100)))
+                       "")))
+                   (regexp
+                    (concat
+                     "\\(\\`\\|\^M\\|\n\\)" mark "?"
+                     (regexp-quote hebrew-diary-entry-symbol)
+                     "\\("
+                     (mapconcat 'eval date-form "\\)\\(")
+                     "\\)"))
+                   (case-fold-search t))
+                (goto-char (point-min))
+                (while (re-search-forward regexp nil t)
+                  (if backup (re-search-backward "\\<" nil t))
+                  (if (and (or (char-equal (preceding-char) ?\^M)
+                               (char-equal (preceding-char) ?\n))
+                           (not (looking-at " \\|\^I")))
+                      ;;  Diary entry that consists only of date.
+                      (backward-char 1)
+                    ;;  Found a nonempty diary entry--make it visible and
+                    ;;  add it to the list.
+                    (let ((entry-start (point))
+                          (date-start))
+                      (re-search-backward "\^M\\|\n\\|\\`")
+                      (setq date-start (point))
+                      (re-search-forward "\^M\\|\n" nil t 2)
+                      (while (looking-at " \\|\^I")
+                        (re-search-forward "\^M\\|\n" nil t))
+                      (backward-char 1)
+                      (subst-char-in-region date-start (point) ?\^M ?\n t)
+                      (add-to-diary-list
+                       gdate
+                       (buffer-substring-no-properties entry-start (point))
+                       (buffer-substring-no-properties
+                        (1+ date-start) (1- entry-start))
+                       (copy-marker entry-start))))))
+              (setq d (cdr d))))
+          (setq gdate
+                (calendar-gregorian-from-absolute
+                 (1+ (calendar-absolute-from-gregorian gdate)))))
+        (set-buffer-modified-p diary-modified))
+    (goto-char (point-min))))
 
 (defun mark-hebrew-calendar-date-pattern (month day year)
   "Mark dates in calendar window that conform to Hebrew date MONTH/DAY/YEAR.
index 850a3e2..c562437 100644 (file)
@@ -210,76 +210,76 @@ not be marked in the calendar.  This function is provided for use with the
             (diary-modified (buffer-modified-p))
             (gdate original-date)
             (mark (regexp-quote diary-nonmarking-symbol)))
-        (calendar-for-loop i from 1 to number do
-           (let* ((d diary-date-forms)
-                  (idate (calendar-islamic-from-absolute
-                          (calendar-absolute-from-gregorian gdate)))
-                  (month (extract-calendar-month idate))
-                  (day (extract-calendar-day idate))
-                  (year (extract-calendar-year idate)))
-             (while d
-               (let*
-                   ((date-form (if (equal (car (car d)) 'backup)
-                                   (cdr (car d))
-                                 (car d)))
-                    (backup (equal (car (car d)) 'backup))
-                    (dayname
-                     (format "%s\\|%s\\.?"
-                      (calendar-day-name gdate)
-                      (calendar-day-name gdate 'abbrev)))
-                    (calendar-month-name-array
-                     calendar-islamic-month-name-array)
-                    (monthname
-                     (concat
-                      "\\*\\|"
-                      (calendar-month-name month)))
-                    (month (concat "\\*\\|0*" (int-to-string month)))
-                    (day (concat "\\*\\|0*" (int-to-string day)))
-                    (year
-                     (concat
-                      "\\*\\|0*" (int-to-string year)
-                      (if abbreviated-calendar-year
-                          (concat "\\|" (int-to-string (% year 100)))
-                        "")))
-                    (regexp
-                     (concat
-                      "\\(\\`\\|\^M\\|\n\\)" mark "?"
-                      (regexp-quote islamic-diary-entry-symbol)
-                      "\\("
-                      (mapconcat 'eval date-form "\\)\\(")
-                      "\\)"))
-                    (case-fold-search t))
-                 (goto-char (point-min))
-                 (while (re-search-forward regexp nil t)
-                   (if backup (re-search-backward "\\<" nil t))
-                   (if (and (or (char-equal (preceding-char) ?\^M)
-                                (char-equal (preceding-char) ?\n))
-                            (not (looking-at " \\|\^I")))
-                       ;;  Diary entry that consists only of date.
-                       (backward-char 1)
-                     ;;  Found a nonempty diary entry--make it visible and
-                     ;;  add it to the list.
-                     (let ((entry-start (point))
-                           (date-start))
-                       (re-search-backward "\^M\\|\n\\|\\`")
-                       (setq date-start (point))
-                       (re-search-forward "\^M\\|\n" nil t 2)
-                       (while (looking-at " \\|\^I")
-                         (re-search-forward "\^M\\|\n" nil t))
-                       (backward-char 1)
-                       (subst-char-in-region date-start (point) ?\^M ?\n t)
-                       (add-to-diary-list
-                        gdate
-                        (buffer-substring-no-properties entry-start (point))
-                        (buffer-substring-no-properties
-                         (1+ date-start) (1- entry-start))
-                        (copy-marker entry-start))))))
-               (setq d (cdr d))))
-           (setq gdate
-                 (calendar-gregorian-from-absolute
-                  (1+ (calendar-absolute-from-gregorian gdate)))))
-           (set-buffer-modified-p diary-modified))
-        (goto-char (point-min))))
+        (dotimes (idummy number)
+          (let* ((d diary-date-forms)
+                 (idate (calendar-islamic-from-absolute
+                         (calendar-absolute-from-gregorian gdate)))
+                 (month (extract-calendar-month idate))
+                 (day (extract-calendar-day idate))
+                 (year (extract-calendar-year idate)))
+            (while d
+              (let*
+                  ((date-form (if (equal (car (car d)) 'backup)
+                                  (cdr (car d))
+                                (car d)))
+                   (backup (equal (car (car d)) 'backup))
+                   (dayname
+                    (format "%s\\|%s\\.?"
+                            (calendar-day-name gdate)
+                            (calendar-day-name gdate 'abbrev)))
+                   (calendar-month-name-array
+                    calendar-islamic-month-name-array)
+                   (monthname
+                    (concat
+                     "\\*\\|"
+                     (calendar-month-name month)))
+                   (month (concat "\\*\\|0*" (int-to-string month)))
+                   (day (concat "\\*\\|0*" (int-to-string day)))
+                   (year
+                    (concat
+                     "\\*\\|0*" (int-to-string year)
+                     (if abbreviated-calendar-year
+                         (concat "\\|" (int-to-string (% year 100)))
+                       "")))
+                   (regexp
+                    (concat
+                     "\\(\\`\\|\^M\\|\n\\)" mark "?"
+                     (regexp-quote islamic-diary-entry-symbol)
+                     "\\("
+                     (mapconcat 'eval date-form "\\)\\(")
+                     "\\)"))
+                   (case-fold-search t))
+                (goto-char (point-min))
+                (while (re-search-forward regexp nil t)
+                  (if backup (re-search-backward "\\<" nil t))
+                  (if (and (or (char-equal (preceding-char) ?\^M)
+                               (char-equal (preceding-char) ?\n))
+                           (not (looking-at " \\|\^I")))
+                      ;;  Diary entry that consists only of date.
+                      (backward-char 1)
+                    ;;  Found a nonempty diary entry--make it visible and
+                    ;;  add it to the list.
+                    (let ((entry-start (point))
+                          (date-start))
+                      (re-search-backward "\^M\\|\n\\|\\`")
+                      (setq date-start (point))
+                      (re-search-forward "\^M\\|\n" nil t 2)
+                      (while (looking-at " \\|\^I")
+                        (re-search-forward "\^M\\|\n" nil t))
+                      (backward-char 1)
+                      (subst-char-in-region date-start (point) ?\^M ?\n t)
+                      (add-to-diary-list
+                       gdate
+                       (buffer-substring-no-properties entry-start (point))
+                       (buffer-substring-no-properties
+                        (1+ date-start) (1- entry-start))
+                       (copy-marker entry-start))))))
+              (setq d (cdr d))))
+          (setq gdate
+                (calendar-gregorian-from-absolute
+                 (1+ (calendar-absolute-from-gregorian gdate)))))
+        (set-buffer-modified-p diary-modified))
+    (goto-char (point-min))))
 
 (defun mark-islamic-diary-entries ()
   "Mark days in the calendar window that have Islamic date diary entries.
index 7f9451d..1f4e4df 100644 (file)
 
 ;;; Code:
 
-(defvar displayed-month)
 (defvar displayed-year)
 
-;; Don't require calendar because calendar requires us.
-;; (eval-when-compile (require 'calendar))
-(defvar calendar-mode-map)
-
-(define-key calendar-mode-map [menu-bar edit] 'undefined)
-(define-key calendar-mode-map [menu-bar search] 'undefined)
-
-(define-key calendar-mode-map [down-mouse-2] 'calendar-mouse-2-date-menu)
-(define-key calendar-mode-map [mouse-2] 'ignore)
-
-(defvar calendar-mouse-3-map (make-sparse-keymap "Calendar"))
-(define-key calendar-mode-map [down-mouse-3] calendar-mouse-3-map)
-
-(define-key calendar-mode-map [menu-bar moon]
-  (cons "Moon" (make-sparse-keymap "Moon")))
-
-(define-key calendar-mode-map [menu-bar moon moon]
-  '("Lunar Phases" . calendar-phases-of-moon))
-
-(define-key calendar-mode-map [menu-bar diary]
-  (cons "Diary" (make-sparse-keymap "Diary")))
-
-(define-key calendar-mode-map [menu-bar diary heb]
-  '("Insert Hebrew" . calendar-mouse-insert-hebrew-diary-entry))
-(define-key calendar-mode-map [menu-bar diary isl]
-  '("Insert Islamic" . calendar-mouse-insert-islamic-diary-entry))
-(define-key calendar-mode-map [menu-bar diary baha]
-  '("Insert Baha'i" . calendar-mouse-insert-bahai-diary-entry))
-(define-key calendar-mode-map [menu-bar diary cyc]
-  '("Insert Cyclic" . insert-cyclic-diary-entry))
-(define-key calendar-mode-map [menu-bar diary blk]
-  '("Insert Block" . insert-block-diary-entry))
-(define-key calendar-mode-map [menu-bar diary ann]
-  '("Insert Anniversary" . insert-anniversary-diary-entry))
-(define-key calendar-mode-map [menu-bar diary yr]
-  '("Insert Yearly" . insert-yearly-diary-entry))
-(define-key calendar-mode-map [menu-bar diary mon]
-  '("Insert Monthly" . insert-monthly-diary-entry))
-(define-key calendar-mode-map [menu-bar diary wk]
-  '("Insert Weekly" . insert-weekly-diary-entry))
-(define-key calendar-mode-map [menu-bar diary ent]
-  '("Insert Diary Entry" . insert-diary-entry))
-(define-key calendar-mode-map [menu-bar diary all]
-  '("Show All" . diary-show-all-entries))
-(define-key calendar-mode-map [menu-bar diary mark]
- '("Mark All" . mark-diary-entries))
-(define-key calendar-mode-map [menu-bar diary view]
-  '("Cursor Date" . diary-view-entries))
-(define-key calendar-mode-map [menu-bar diary view]
-  '("Other File" . view-other-diary-entries))
-
-(define-key calendar-mode-map [menu-bar Holidays]
-  (cons "Holidays" (make-sparse-keymap "Holidays")))
-
-(define-key calendar-mode-map [menu-bar goto]
-  (cons "Goto" (make-sparse-keymap "Goto")))
-
-(define-key calendar-mode-map [menu-bar goto french]
-  '("French Date" . calendar-goto-french-date))
-(define-key calendar-mode-map [menu-bar goto mayan]
-  (cons "Mayan Date" (make-sparse-keymap "Mayan")))
-(define-key calendar-mode-map [menu-bar goto ethiopic]
-  '("Ethiopic Date" . calendar-goto-ethiopic-date))
-(define-key calendar-mode-map [menu-bar goto coptic]
-  '("Coptic Date" . calendar-goto-coptic-date))
-(define-key calendar-mode-map [menu-bar goto chinese]
-  '("Chinese Date" . calendar-goto-chinese-date))
-(define-key calendar-mode-map [menu-bar goto julian]
-  '("Julian Date" . calendar-goto-julian-date))
-(define-key calendar-mode-map [menu-bar goto islamic]
-  '("Islamic Date" . calendar-goto-islamic-date))
-(define-key calendar-mode-map [menu-bar goto persian]
-  '("Baha'i Date" . calendar-goto-bahai-date))
-(define-key calendar-mode-map [menu-bar goto persian]
-  '("Persian Date" . calendar-goto-persian-date))
-(define-key calendar-mode-map [menu-bar goto hebrew]
-  '("Hebrew Date" . calendar-goto-hebrew-date))
-(define-key calendar-mode-map [menu-bar goto astro]
-  '("Astronomical Date" . calendar-goto-astro-day-number))
-(define-key calendar-mode-map [menu-bar goto iso]
-  '("ISO Date" . calendar-goto-iso-date))
-(define-key calendar-mode-map [menu-bar goto iso-week]
-  '("ISO Week" . calendar-goto-iso-week))
-(define-key calendar-mode-map [menu-bar goto day-of-year]
-  '("Day of Year" . calendar-goto-day-of-year))
-(define-key calendar-mode-map [menu-bar goto gregorian]
-  '("Other Date" . calendar-goto-date))
-(define-key calendar-mode-map [menu-bar goto end-of-year]
-  '("End of Year" . calendar-end-of-year))
-(define-key calendar-mode-map [menu-bar goto beginning-of-year]
-  '("Beginning of Year" . calendar-beginning-of-year))
-(define-key calendar-mode-map [menu-bar goto end-of-month]
-  '("End of Month" . calendar-end-of-month))
-(define-key calendar-mode-map [menu-bar goto beginning-of-month]
-  '("Beginning of Month" . calendar-beginning-of-month))
-(define-key calendar-mode-map [menu-bar goto end-of-week]
-  '("End of Week" . calendar-end-of-week))
-(define-key calendar-mode-map [menu-bar goto beginning-of-week]
-  '("Beginning of Week" . calendar-beginning-of-week))
-(define-key calendar-mode-map [menu-bar goto today]
-  '("Today" . calendar-goto-today))
-
-
-(define-key calendar-mode-map [menu-bar goto mayan prev-rnd]
-  '("Previous Round" . calendar-previous-calendar-round-date))
-(define-key calendar-mode-map [menu-bar goto mayan nxt-rnd]
-  '("Next Round" . calendar-next-calendar-round-date))
-(define-key calendar-mode-map [menu-bar goto mayan prev-haab]
-  '("Previous Haab" . calendar-previous-haab-date))
-(define-key calendar-mode-map [menu-bar goto mayan next-haab]
-  '("Next Haab" . calendar-next-haab-date))
-(define-key calendar-mode-map [menu-bar goto mayan prev-tzol]
-  '("Previous Tzolkin" . calendar-previous-tzolkin-date))
-(define-key calendar-mode-map [menu-bar goto mayan next-tzol]
-  '("Next Tzolkin" . calendar-next-tzolkin-date))
-
-(define-key calendar-mode-map [menu-bar scroll]
-  (cons "Scroll" (make-sparse-keymap "Scroll")))
-
-(define-key calendar-mode-map [menu-bar scroll bk-12]
-  '("Backward 1 Year" . "4\ev"))
-(define-key calendar-mode-map [menu-bar scroll bk-3]
-  '("Backward 3 Months" . scroll-calendar-right-three-months))
-(define-key calendar-mode-map [menu-bar scroll bk-1]
-  '("Backward 1 Month" . scroll-calendar-right))
-(define-key calendar-mode-map [menu-bar scroll fwd-12]
-  '("Forward 1 Year" . "4\C-v"))
-(define-key calendar-mode-map [menu-bar scroll fwd-3]
-  '("Forward 3 Months" . scroll-calendar-left-three-months))
-(define-key calendar-mode-map [menu-bar scroll fwd-1]
-  '("Forward 1 Month" . scroll-calendar-left))
-
-(defun calendar-flatten (list)
-  "Flatten LIST eliminating sublists structure; result is a list of atoms.
-This is the same as the preorder list of leaves in a rooted forest."
-  (if (atom list)
-      (list list)
-    (if (cdr list)
-        (append (calendar-flatten (car list)) (calendar-flatten (cdr list)))
-      (calendar-flatten (car list)))))
+(defconst cal-menu-moon-menu
+  '("Moon"
+    ["Lunar Phases" calendar-phases-of-moon]))
+
+(defconst cal-menu-diary-menu
+  '("Diary"
+    ["Other File" view-other-diary-entries]
+    ["Cursor Date" diary-view-entries]
+    ["Mark All" mark-diary-entries]
+    ["Show All" diary-show-all-entries]
+    ["Insert Diary Entry" insert-diary-entry]
+    ["Insert Weekly" insert-weekly-diary-entry]
+    ["Insert Monthly" insert-monthly-diary-entry]
+    ["Insert Yearly" insert-yearly-diary-entry]
+    ["Insert Anniversary" insert-anniversary-diary-entry]
+    ["Insert Block" insert-block-diary-entry]
+    ["Insert Cyclic" insert-cyclic-diary-entry]
+    ("Insert Baha'i"
+     [" " nil :suffix (calendar-bahai-date-string (calendar-cursor-to-date))]
+     ["One time" insert-bahai-diary-entry]
+     ["Monthly" insert-monthly-bahai-diary-entry]
+     ["Yearly" insert-yearly-bahai-diary-entry])
+    ("Insert Islamic"
+     [" " nil :suffix (calendar-islamic-date-string (calendar-cursor-to-date))]
+     ["One time" insert-islamic-diary-entry]
+     ["Monthly" insert-monthly-islamic-diary-entry]
+     ["Yearly" insert-yearly-islamic-diary-entry])
+    ("Insert Hebrew"
+     [" " nil :suffix (calendar-hebrew-date-string (calendar-cursor-to-date))]
+     ["One time" insert-hebrew-diary-entry]
+     ["Monthly" insert-monthly-hebrew-diary-entry]
+     ["Yearly" insert-yearly-hebrew-diary-entry])))
+
+(defun cal-menu-holiday-window-suffix ()
+  (let ((my1 (calendar-increment-month -1))
+        (my2 (calendar-increment-month 1)))
+    (if (= (cdr my1) (cdr my2))
+        (format "%s-%s, %d"
+                (calendar-month-name (car my1) 'abbrev)
+                (calendar-month-name (car my2) 'abbrev)
+                (cdr my2))
+      (format "%s, %d-%s, %d"
+              (calendar-month-name (car my1) 'abbrev)
+              (cdr my1)
+              (calendar-month-name (car my2) 'abbrev)
+              (cdr my2)))))
+
+(defconst cal-menu-holidays-menu
+  `("Holidays"
+    ["For Cursor Date -" calendar-cursor-holidays
+     :suffix (calendar-date-string (calendar-cursor-to-date) t t)
+     :visible (calendar-cursor-to-date)]
+    ["For Window -" list-calendar-holidays
+     :suffix (cal-menu-holiday-window-suffix)]
+    ["For Today -" cal-menu-today-holidays
+     :suffix (calendar-date-string (calendar-current-date) t t)]
+    "--"
+    ,@(let ((l ()))
+        ;; Show 11 years--5 before, 5 after year of middle month.
+        (dotimes (i 11)
+          (push (vector "For Year"
+                        `(lambda ()
+                           (interactive)
+                           (list-holidays (+ displayed-year ,(- i 5))))
+                        :suffix `(number-to-string (+ displayed-year ,(- i 5))))
+                l))
+        (nreverse l))
+    "--"
+    ["Unmark Calendar" calendar-unmark]
+    ["Mark Holidays" mark-calendar-holidays]))
+
+(defconst cal-menu-goto-menu
+  '("Goto"
+    ["Today" calendar-goto-today]
+    ["Beginning of Week" calendar-beginning-of-week]
+    ["End of Week" calendar-end-of-week]
+    ["Beginning of Month" calendar-beginning-of-month]
+    ["End of Month" calendar-end-of-month]
+    ["Beginning of Year" calendar-beginning-of-year]
+    ["End of Year" calendar-end-of-year]
+    ["Other Date" calendar-goto-date]
+    ["Day of Year" calendar-goto-day-of-year]
+    ["ISO Week" calendar-goto-iso-week]
+    ["ISO Date" calendar-goto-iso-date]
+    ["Astronomical Date" calendar-goto-astro-day-number]
+    ["Hebrew Date" calendar-goto-hebrew-date]
+    ["Persian Date" calendar-goto-persian-date]
+    ["Baha'i Date" calendar-goto-bahai-date]
+    ["Islamic Date" calendar-goto-islamic-date]
+    ["Julian Date" calendar-goto-julian-date]
+    ["Chinese Date" calendar-goto-chinese-date]
+    ["Coptic Date" calendar-goto-coptic-date]
+    ["Ethiopic Date" calendar-goto-ethiopic-date]
+    ("Mayan Date"
+     ["Next Tzolkin" calendar-next-tzolkin-date]
+     ["Previous Tzolkin" calendar-previous-tzolkin-date]
+     ["Next Haab" calendar-next-haab-date]
+     ["Previous Haab" calendar-previous-haab-date]
+     ["Next Round" calendar-next-calendar-round-date]
+     ["Previous Round" calendar-previous-calendar-round-date])
+    ["French Date" calendar-goto-french-date]))
+
+(defconst cal-menu-scroll-menu
+  '("Scroll"
+    ["Forward 1 Month" calendar-scroll-left]
+    ["Forward 3 Months" calendar-scroll-left-three-months]
+    ["Forward 1 Year" "4\C-v"]
+    ["Backward 1 Month" calendar-scroll-right]
+    ["Backward 3 Months" calendar-scroll-right-three-months]
+    ["Backward 1 Year" "4\ev"]))
 
 (defun cal-menu-x-popup-menu (position menu)
   "Like `x-popup-menu', but prints an error message if popup menus are
@@ -202,103 +171,15 @@ not available."
   (let ((year (1- (extract-calendar-year (calendar-cursor-to-date)))))
     (list-holidays year year)))
 
-(defun cal-menu-update ()
-  ;; Update the holiday part of calendar menu bar for the current display.
-  (condition-case nil
-      (if (eq major-mode 'calendar-mode)
-          (let ((l))
-            ;; Show 11 years--5 before, 5 after year of middle month
-            (dotimes (i 11)
-              (let ((y (+ displayed-year -5 i)))
-                (push (vector (format "For Year %s" y)
-                              (list (list 'lambda 'nil '(interactive)
-                                          (list 'list-holidays y y)))
-                              t)
-                      l)))
-            (setq l (cons ["Mark Holidays" mark-calendar-holidays t]
-                          (cons ["Unmark Calendar" calendar-unmark t]
-                                (cons "--" l))))
-            (define-key calendar-mode-map [menu-bar Holidays]
-             (cons "Holidays" (easy-menu-create-menu "Holidays" (nreverse l))))
-            (define-key calendar-mode-map [menu-bar Holidays separator]
-              '("--"))
-            (define-key calendar-mode-map [menu-bar Holidays today]
-                `(,(format "For Today (%s)"
-                           (calendar-date-string (calendar-current-date) t t))
-                  . cal-menu-today-holidays))
-            (let ((title
-                   (let ((my1 (calendar-increment-month -1))
-                         (my2 (calendar-increment-month 1)))
-                     (if (= (cdr my1) (cdr my2))
-                         (format "%s-%s, %d"
-                                 (calendar-month-name (car my1) 'abbrev)
-                                 (calendar-month-name (car my2) 'abbrev)
-                                 (cdr my2))
-                       (format "%s, %d-%s, %d"
-                               (calendar-month-name (car my1) 'abbrev)
-                               (cdr my1)
-                               (calendar-month-name (car my2) 'abbrev)
-                               (cdr my2))))))
-              (define-key  calendar-mode-map [menu-bar Holidays 3-month]
-                `(,(format "For Window (%s)" title)
-                  . list-calendar-holidays)))
-            (let ((date (calendar-cursor-to-date)))
-              (if date
-                  (define-key calendar-mode-map [menu-bar Holidays 1-day]
-                    `(,(format "For Cursor Date (%s)"
-                               (calendar-date-string date t t))
-                      . calendar-cursor-holidays))))))
-    ;; Try to avoid entering infinite beep mode in case of errors.
-    (error (ding))))
-
 (defun calendar-event-to-date (&optional error)
   "Date of last event.
 If event is not on a specific date, signals an error if optional parameter
 ERROR is t, otherwise just returns nil."
-  (save-excursion
-    (set-buffer (window-buffer (posn-window (event-start last-input-event))))
+  (with-current-buffer
+      (window-buffer (posn-window (event-start last-input-event)))
     (goto-char (posn-point (event-start last-input-event)))
     (calendar-cursor-to-date error)))
 
-(defun calendar-mouse-insert-hebrew-diary-entry (event)
-  "Pop up menu to insert a Hebrew-date diary entry."
-  (interactive "e")
-  (let ((hebrew-selection
-         (cal-menu-x-popup-menu
-          event
-          (list "Hebrew insert menu"
-                (list (calendar-hebrew-date-string (calendar-cursor-to-date))
-                      '("One time" . insert-hebrew-diary-entry)
-                      '("Monthly" . insert-monthly-hebrew-diary-entry)
-                      '("Yearly" . insert-yearly-hebrew-diary-entry))))))
-    (and hebrew-selection (call-interactively hebrew-selection))))
-
-(defun calendar-mouse-insert-islamic-diary-entry (event)
-  "Pop up menu to insert an Islamic-date diary entry."
-  (interactive "e")
-  (let ((islamic-selection
-         (cal-menu-x-popup-menu
-          event
-          (list "Islamic insert menu"
-                (list (calendar-islamic-date-string (calendar-cursor-to-date))
-                      '("One time" . insert-islamic-diary-entry)
-                      '("Monthly" . insert-monthly-islamic-diary-entry)
-                      '("Yearly" . insert-yearly-islamic-diary-entry))))))
-    (and islamic-selection (call-interactively islamic-selection))))
-
-(defun calendar-mouse-insert-bahai-diary-entry (event)
-  "Pop up menu to insert an Baha'i-date diary entry."
-  (interactive "e")
-  (let ((bahai-selection
-         (x-popup-menu
-          event
-          (list "Baha'i insert menu"
-                (list (calendar-bahai-date-string (calendar-cursor-to-date))
-                      '("One time" . insert-bahai-diary-entry)
-                      '("Monthly" . insert-monthly-bahai-diary-entry)
-                      '("Yearly" . insert-yearly-bahai-diary-entry))))))
-    (and bahai-selection (call-interactively bahai-selection))))
-
 (defun calendar-mouse-sunrise/sunset ()
   "Show sunrise/sunset times for mouse-selected date."
   (interactive)
@@ -337,12 +218,12 @@ Use optional DATE and alternative file DIARY.
 
 Any holidays are shown if `holidays-in-diary-buffer' is t."
   (interactive "i\ni\ne")
-  (let* ((date (if date date (calendar-event-to-date)))
+  (let* ((date (or date (calendar-event-to-date)))
          (diary-file (if diary diary diary-file))
          (diary-list-include-blanks nil)
          (diary-display-hook 'ignore)
          (diary-entries
-          (mapcar (lambda (x) (split-string (car (cdr x)) "\^M\\|\n"))
+          (mapcar (lambda (x) (split-string (cadr x) "\n"))
                   (diary-list-entries date 1 'list-only)))
          (holidays (if holidays-in-diary-buffer
                        (check-calendar-holidays date)))
@@ -360,7 +241,7 @@ Any holidays are shown if `holidays-in-diary-buffer' is t."
                   (if holidays
                       (list "--shadow-etched-in" "--shadow-etched-in"))
                   (if diary-entries
-                      (mapcar 'list (calendar-flatten diary-entries))
+                      (mapcar 'list (apply 'append diary-entries))
                     '("None")))))))
     (and selection (call-interactively selection))))
 
@@ -543,88 +424,49 @@ The output is in landscape format, one month to a page."
   (set-buffer (window-buffer (posn-window (event-start last-input-event))))
   (calendar-goto-date date))
 
-(defun calendar-mouse-2-date-menu (event)
+(easy-menu-define cal-menu-context-mouse-menu nil
   "Pop up menu for Mouse-2 for selected date in the calendar window."
-  (interactive "e")
-  (let* ((date (calendar-event-to-date t))
-         (selection
-          (cal-menu-x-popup-menu
-           event
-           (list (calendar-date-string date t nil)
-                 (list
-                  ""
-                  '("Holidays" . calendar-mouse-holidays)
-                  '("Mark date" . calendar-mouse-set-mark)
-                  '("Sunrise/sunset" . calendar-mouse-sunrise/sunset)
-                  '("Other calendars" . calendar-mouse-print-dates)
-                  '("Prepare LaTeX buffer" . calendar-mouse-cal-tex-menu)
-                  '("Diary entries" . calendar-mouse-view-diary-entries)
-                  '("Insert diary entry" . calendar-mouse-insert-diary-entry)
-                  '("Other diary file entries"
-                    . calendar-mouse-view-other-diary-entries)
-                  )))))
-    (and selection (call-interactively selection))))
-
-(defun calendar-mouse-cal-tex-menu (event)
-  "Pop up submenu for Mouse-2 for cal-tex commands for selected date in the calendar window."
-  (interactive "e")
-  (let* ((selection
-          (cal-menu-x-popup-menu
-           event
-           (list (calendar-date-string (calendar-event-to-date t) t nil)
-                 (list
-                  ""
-                  '("Daily (1 page)" . cal-tex-mouse-day)
-                  '("Weekly (1 page)" . cal-tex-mouse-week)
-                  '("Weekly (2 pages)" . cal-tex-mouse-week2)
-                  '("Weekly (other style; 1 page)" . cal-tex-mouse-week-iso)
-                  '("Weekly (yet another style; 1 page)" .
-                    cal-tex-mouse-week-monday)
-                  '("Monthly" . cal-tex-mouse-month)
-                  '("Monthly (landscape)" . cal-tex-mouse-month-landscape)
-                  '("Yearly" . cal-tex-mouse-year)
-                  '("Yearly (landscape)" . cal-tex-mouse-year-landscape)
-                  '("Filofax styles" . cal-tex-mouse-filofax)
-                  )))))
-    (and selection (call-interactively selection))))
-
-(defun cal-tex-mouse-filofax (event)
-  "Pop up sub-submenu for Mouse-2 for Filofax cal-tex commands for selected date."
-  (interactive "e")
-  (let* ((selection
-          (cal-menu-x-popup-menu
-           event
-           (list (calendar-date-string (calendar-event-to-date t) t nil)
-                 (list
-                  ""
-                  '("Filofax Daily (one-day-per-page)" .
-                    cal-tex-mouse-filofax-daily)
-                  '("Filofax Weekly (2-weeks-at-a-glance)" .
-                    cal-tex-mouse-filofax-2week)
-                  '("Filofax Weekly (week-at-a-glance)" .
-                    cal-tex-mouse-filofax-week)
-                  '("Filofax Yearly" . cal-tex-mouse-filofax-year)
-                  )))))
-    (and selection (call-interactively selection))))
-
-(define-key calendar-mouse-3-map [exit-calendar]
-  '("Exit calendar" . exit-calendar))
-(define-key calendar-mouse-3-map [show-diary]
-  '("Show diary" . diary-show-all-entries))
-(define-key calendar-mouse-3-map [lunar-phases]
-  '("Lunar phases" . calendar-phases-of-moon))
-(define-key calendar-mouse-3-map [unmark]
-  '("Unmark" . calendar-unmark))
-(define-key calendar-mouse-3-map [mark-holidays]
-  '("Mark holidays" . mark-calendar-holidays))
-(define-key calendar-mouse-3-map [list-holidays]
-  '("List holidays" . list-calendar-holidays))
-(define-key calendar-mouse-3-map [mark-diary-entries]
-  '("Mark diary entries" . mark-diary-entries))
-(define-key calendar-mouse-3-map [scroll-backward]
-  '("Scroll backward" . scroll-calendar-right-three-months))
-(define-key calendar-mouse-3-map [scroll-forward]
-  '("Scroll forward" . scroll-calendar-left-three-months))
+  '("foo" :filter cal-menu-set-date-title
+    "--"
+    ["Holidays" calendar-mouse-holidays]
+    ["Mark date" calendar-mouse-set-mark]
+    ["Sunrise/sunset" calendar-mouse-sunrise/sunset]
+    ["Other calendars" calendar-mouse-print-dates]
+    ("Prepare LaTeX buffer"
+     ["Daily (1 page)" cal-tex-mouse-day]
+     ["Weekly (1 page)" cal-tex-mouse-week]
+     ["Weekly (2 pages)" cal-tex-mouse-week2]
+     ["Weekly (other style; 1 page)" cal-tex-mouse-week-iso]
+     ["Weekly (yet another style; 1 page)" cal-tex-mouse-week-monday]
+     ["Monthly" cal-tex-mouse-month]
+     ["Monthly (landscape)" cal-tex-mouse-month-landscape]
+     ["Yearly" cal-tex-mouse-year]
+     ["Yearly (landscape)" cal-tex-mouse-year-landscape]
+     ("Filofax styles"
+      ["Filofax Daily (one-day-per-page)" cal-tex-mouse-filofax-daily]
+      ["Filofax Weekly (2-weeks-at-a-glance)" cal-tex-mouse-filofax-2week]
+      ["Filofax Weekly (week-at-a-glance)" cal-tex-mouse-filofax-week]
+      ["Filofax Yearly" cal-tex-mouse-filofax-year]))
+    ["Diary entries" calendar-mouse-view-diary-entries]
+    ["Insert diary entry" calendar-mouse-insert-diary-entry]
+    ["Other diary file entries" calendar-mouse-view-other-diary-entries]))
+
+(defun cal-menu-set-date-title (menu)
+  (easy-menu-filter-return
+   menu (calendar-date-string (calendar-event-to-date t) t nil)))
+
+(easy-menu-define cal-menu-global-mouse-menu nil
+  "Menu bound to a mouse event, not specific to the mouse-click location."
+  '("Calendar"
+    ["Scroll forward" calendar-scroll-left-three-months]
+    ["Scroll backward" calendar-scroll-right-three-months]
+    ["Mark diary entries" mark-diary-entries]
+    ["List holidays" list-calendar-holidays]
+    ["Mark holidays" mark-calendar-holidays]
+    ["Unmark" calendar-unmark]
+    ["Lunar phases" calendar-phases-of-moon]
+    ["Show diary" diary-show-all-entries]
+    ["Exit calendar" exit-calendar]))
 
 (run-hooks 'cal-menu-load-hook)
 
index 02760b3..81f7511 100644 (file)
@@ -85,47 +85,51 @@ Movement is forward is ARG is negative."
   (interactive "p")
   (calendar-forward-month (* -12 arg)))
 
-(defun scroll-calendar-left (&optional arg)
+(defun calendar-scroll-left (&optional arg event)
   "Scroll the displayed calendar left by ARG months.
 If ARG is negative the calendar is scrolled right.  Maintains the relative
 position of the cursor with respect to the calendar as well as possible."
-  (interactive "p")
+  (interactive (list (prefix-numeric-value current-prefix-arg)
+                     last-nonmenu-event))
   (unless arg (setq arg 1))
-  (calendar-cursor-to-nearest-date)
-  (let ((old-date (calendar-cursor-to-date))
-        (today (calendar-current-date)))
-    (if (/= arg 0)
-        (let ((month displayed-month)
-             (year displayed-year))
-          (increment-calendar-month month year arg)
-         (generate-calendar-window month year)
-          (calendar-cursor-to-visible-date
-           (cond
-            ((calendar-date-is-visible-p old-date) old-date)
-            ((calendar-date-is-visible-p today) today)
-            (t (list month 1 year)))))))
-  (run-hooks 'calendar-move-hook))
-
-(defun scroll-calendar-right (&optional arg)
+  (save-selected-window
+    (select-window (posn-window (event-start event)))
+    (calendar-cursor-to-nearest-date)
+    (let ((old-date (calendar-cursor-to-date))
+          (today (calendar-current-date)))
+      (if (/= arg 0)
+          (let ((month displayed-month)
+                (year displayed-year))
+            (increment-calendar-month month year arg)
+            (generate-calendar-window month year)
+            (calendar-cursor-to-visible-date
+             (cond
+              ((calendar-date-is-visible-p old-date) old-date)
+              ((calendar-date-is-visible-p today) today)
+              (t (list month 1 year)))))))
+    (run-hooks 'calendar-move-hook)))
+
+(defun calendar-scroll-right (&optional arg event)
   "Scroll the displayed calendar window right by ARG months.
 If ARG is negative the calendar is scrolled left.  Maintains the relative
 position of the cursor with respect to the calendar as well as possible."
-  (interactive "p")
-  (scroll-calendar-left (- (or arg 1))))
+  (interactive (list (prefix-numeric-value current-prefix-arg)
+                     last-nonmenu-event))
+  (calendar-scroll-left (- (or arg 1)) event))
 
-(defun scroll-calendar-left-three-months (arg)
+(defun calendar-scroll-left-three-months (arg)
   "Scroll the displayed calendar window left by 3*ARG months.
 If ARG is negative the calendar is scrolled right.  Maintains the relative
 position of the cursor with respect to the calendar as well as possible."
   (interactive "p")
-  (scroll-calendar-left (* 3 arg)))
+  (calendar-scroll-left (* 3 arg)))
 
-(defun scroll-calendar-right-three-months (arg)
+(defun calendar-scroll-right-three-months (arg)
   "Scroll the displayed calendar window right by 3*ARG months.
 If ARG is negative the calendar is scrolled left.  Maintains the relative
 position of the cursor with respect to the calendar as well as possible."
   (interactive "p")
-  (scroll-calendar-left (* -3 arg)))
+  (calendar-scroll-left (* -3 arg)))
 
 (defun calendar-cursor-to-nearest-date ()
   "Move the cursor to the closest date.
@@ -345,7 +349,17 @@ Negative DAY counts backward from end of year."
       (+ 1 day (calendar-absolute-from-gregorian (list 12 31 year))))))
   (or noecho (calendar-print-day-of-year)))
 
+;; Backward compatibility.
+(define-obsolete-function-alias
+  'scroll-calendar-left 'calendar-scroll-left "23.1")
+(define-obsolete-function-alias
+  'scroll-calendar-right 'calendar-scroll-right "23.1")
+(define-obsolete-function-alias
+  'scroll-calendar-left-three-months 'calendar-scroll-left-three-months "23.1")
+(define-obsolete-function-alias
+  'scroll-calendar-right-three-months 'calendar-scroll-right-three-months "23.1")
+
 (provide 'cal-move)
 
-;;; arch-tag: d0883c46-7e16-4914-8ff8-8f67e699b781
+;; arch-tag: d0883c46-7e16-4914-8ff8-8f67e699b781
 ;;; cal-move.el ends here
index bd9db74..1faa71e 100644 (file)
 ;; This collection of functions implements the creation of LaTeX calendars
 ;; based on the user's holiday choices and diary file.
 
+;; The user commands are:
+;; cal-tex-cursor-year
+;; cal-tex-cursor-year-landscape
+;; cal-tex-cursor-filofax-year
+;; cal-tex-cursor-month-landscape
+;; cal-tex-cursor-month
+;; cal-tex-cursor-week
+;; cal-tex-cursor-week2
+;; cal-tex-cursor-week-iso
+;; cal-tex-cursor-week-monday
+;; cal-tex-cursor-filofax-2week
+;; cal-tex-cursor-filofax-week
+;; cal-tex-cursor-filofax-daily
+;; cal-tex-cursor-day
+
 ;; TO DO
 ;;
 ;;     (*)  Add holidays and diary entries to daily calendar.
 ;;;
 
 (defcustom cal-tex-which-days '(0 1 2 3 4 5 6)
-  "*The days of the week that are displayed on the portrait monthly calendar.
+  "The days of the week that are displayed on the portrait monthly calendar.
 Sunday is 0, Monday is 1, and so on.  The default is to print from Sunday to
-Saturday.  For example, use
-
-                    (setq cal-tex-which-days '(1 3 5))
-
-to only print Monday, Wednesday, Friday."
+Saturday.  For example, use '(1 3 5) to only print Monday, Wednesday, Friday."
   :type '(repeat integer)
   :group 'calendar-tex)
 
 (defcustom cal-tex-holidays t
   "Non-nil means holidays are printed in the LaTeX calendars that support it.
-If finding the holidays is too slow, set this to nil."
+Setting this to nil may speed up calendar generation."
   :type 'boolean
   :group 'calendar-tex)
 
 (defcustom cal-tex-diary nil
   "Non-nil means diary entries are printed in LaTeX calendars that support it.
 At present, this only affects the monthly, filofax, and iso-week
-calendars (i.e. not the yearly, plain weekly, or daily calendars)."
+calendars (i.e. not the yearly, plain weekly, or daily calendars).
+Setting this to nil may speed up calendar generation."
   :type 'boolean
   :group 'calendar-tex)
 
@@ -85,20 +97,21 @@ At present, this only affects the daily filofax calendar."
 
 (defcustom cal-tex-daily-string
   '(let* ((year (extract-calendar-year date))
-          (day  (calendar-day-number date))
+          (day (calendar-day-number date))
           (days-remaining (- (calendar-day-number (list 12 31 year)) day)))
-     (format "%d/%d" day  days-remaining))
-  "*An expression in the variable `date' whose value is placed on date.
-The string resulting from evaluating this expression is placed at the bottom
-center of `date' on the monthly calendar, next to the date in the weekly
-calendars, and in the top center of daily calendars.
+     (format "%d/%d" day days-remaining))
+  "Lisp expression giving the date format to use in the LaTeX calendars.
+This should be an expression involving the variable `date'.  When
+this expression is called, `date' is a list of the form '(MONTH DAY YEAR)'.
 
-Default is ordinal day number of the year and the number of days remaining.
-As an example of what you do, setting this to
+The string resulting from evaluating this expression is placed at
+the bottom center of each date in monthly calendars, next to the
+date in the weekly calendars, and in the top center of daily calendars.
 
-    '(progn
-       (require 'cal-hebrew)
-       (calendar-hebrew-date-string date))
+The default is ordinal day number of the year and the number of
+days remaining.  As an example, setting this to
+
+    '(calendar-hebrew-date-string date)
 
 will put the Hebrew date at the bottom of each day."
   :type 'sexp
@@ -115,12 +128,14 @@ will put the Hebrew date at the bottom of each day."
   :group 'calendar-tex)
 
 (defcustom cal-tex-daily-start 8
-  "*The first hour of the daily calendar page."
+  "The first hour of the daily LaTeX calendar page.
+At present, this only affects `cal-tex-cursor-day'."
   :type 'integer
   :group 'calendar-tex)
 
 (defcustom cal-tex-daily-end 20
-  "*The last hour of the daily calendar page."
+  "The last hour of the daily LaTeX calendar page.
+At present, this only affects `cal-tex-cursor-day'"
   :type 'integer
   :group 'calendar-tex)
 
@@ -133,31 +148,31 @@ For example, to include extra packages:
   :version "22.1")
 
 (defcustom cal-tex-hook nil
-  "*List of functions called after any LaTeX calendar buffer is generated.
+  "List of functions called after any LaTeX calendar buffer is generated.
 You can use this to do postprocessing on the buffer.  For example, to change
 characters with diacritical marks to their LaTeX equivalents, use
-     (add-hook 'cal-tex-hook
-               '(lambda () (iso-iso2tex (point-min) (point-max))))"
+    (add-hook 'cal-tex-hook
+              (lambda () (iso-iso2tex (point-min) (point-max))))"
   :type 'hook
   :group 'calendar-tex)
 
 (defcustom cal-tex-year-hook nil
-  "*List of functions called after a LaTeX year calendar buffer is generated."
+  "List of functions called after a LaTeX year calendar buffer is generated."
   :type 'hook
   :group 'calendar-tex)
 
 (defcustom cal-tex-month-hook nil
-  "*List of functions called after a LaTeX month calendar buffer is generated."
+  "List of functions called after a LaTeX month calendar buffer is generated."
   :type 'hook
   :group 'calendar-tex)
 
 (defcustom cal-tex-week-hook nil
-  "*List of functions called after a LaTeX week calendar buffer is generated."
+  "List of functions called after a LaTeX week calendar buffer is generated."
   :type 'hook
   :group 'calendar-tex)
 
 (defcustom cal-tex-daily-hook nil
-  "*List of functions called after a LaTeX daily calendar buffer is generated."
+  "List of functions called after a LaTeX daily calendar buffer is generated."
   :type 'hook
   :group 'calendar-tex)
 
@@ -165,42 +180,42 @@ characters with diacritical marks to their LaTeX equivalents, use
 ;;; Definitions for LaTeX code
 ;;;
 
-(defvar cal-tex-day-prefix "\\caldate{%s}{%s}"
+(defconst cal-tex-day-prefix "\\caldate{%s}{%s}"
   "The initial LaTeX code for a day.
 The holidays, diary entries, bottom string, and the text follow.")
 
-(defvar cal-tex-day-name-format "\\myday{%s}%%"
-  "The format for LaTeX code for a day name.  The names are taken from
-`calendar-day-name-array'.")
+(defconst cal-tex-day-name-format "\\myday{%s}%%"
+  "The format for LaTeX code for a day name.
+The names are taken from `calendar-day-name-array'.")
 
-(defvar cal-tex-cal-one-month
-"\\def\\calmonth#1#2%
+(defconst cal-tex-cal-one-month
+  "\\def\\calmonth#1#2%
 {\\begin{center}%
 \\Huge\\bf\\uppercase{#1} #2 \\\\[1cm]%
 \\end{center}}%
 \\vspace*{-1.5cm}%
 %
 "
-  "LaTeX code for the month header")
+  "LaTeX code for the month header, for a single month calendar.")
 
-(defvar cal-tex-cal-multi-month
-"\\def\\calmonth#1#2#3#4%
+(defconst cal-tex-cal-multi-month
+  "\\def\\calmonth#1#2#3#4%
 {\\begin{center}%
 \\Huge\\bf #1 #2---#3 #4\\\\[1cm]%
 \\end{center}}%
 \\vspace*{-1.5cm}%
 %
 "
-  "LaTeX code for the month header")
+  "LaTeX code for the month header, for a multi-month calendar.")
 
-(defvar cal-tex-myday
-"\\renewcommand{\\myday}[1]%
+(defconst cal-tex-myday
+  "\\renewcommand{\\myday}[1]%
 {\\makebox[\\cellwidth]{\\hfill\\large\\bf#1\\hfill}}
 %
 "
-  "LaTeX code for a day heading")
+  "LaTeX code for a day heading.")
 
-(defvar cal-tex-caldate
+(defconst cal-tex-caldate
 "\\fboxsep=0pt
 \\long\\def\\caldate#1#2#3#4#5#6{%
     \\fbox{\\hbox to\\cellwidth{%
@@ -233,18 +248,16 @@ This definition is the heart of the calendar!")
           (1+ (/ (calendar-interval displayed-month displayed-year
                                     end-month end-year)
                  3)))
-         (holidays nil)
-         (in-range))
+         holidays in-range a)
     (increment-calendar-month displayed-month displayed-year 1)
-    (calendar-for-loop i from 1 to number-of-intervals do
+    (dotimes (idummy number-of-intervals)
       (setq holidays (append holidays (calendar-holiday-list)))
       (increment-calendar-month displayed-month displayed-year 3))
-    (while holidays
-      (and (car (car holidays))
-           (let ((a (calendar-absolute-from-gregorian (car (car holidays)))))
-             (and (<= d1 a) (<= a d2)))
-           (setq in-range (append (list (car holidays)) in-range)))
-      (setq holidays (cdr holidays)))
+    (dolist (hol holidays)
+      (and (car hol)
+           (setq a (calendar-absolute-from-gregorian (car hol)))
+           (and (<= d1 a) (<= a d2))
+           (setq in-range (append (list hol) in-range))))
     in-range))
 
 (defun cal-tex-list-diary-entries (d1 d2)
@@ -256,15 +269,15 @@ This definition is the heart of the calendar!")
      (1+ (- d2 d1)))))
 
 (defun cal-tex-preamble (&optional args)
-  "Insert the LaTeX preamble.
-Preamble Includes initial definitions for various LaTeX commands.
-Optional ARGS are included."
+  "Insert the LaTeX calendar preamble into `cal-tex-buffer'.
+Preamble includes initial definitions for various LaTeX commands.
+Optional string ARGS are included as options for the article document class."
+  ;; FIXME use generate-new-buffer, and adjust cal-tex-end-document.
   (set-buffer (get-buffer-create cal-tex-buffer))
-  (erase-buffer)
-  (insert "\\documentclass")
-  (if args
-      (insert "[" args "]"))
-  (insert "{article}\n")
+  (insert (format "\\documentclass%s{article}\n"
+                  (if (stringp args)
+                      (format "[%s]" args)
+                    "")))
   (if (stringp cal-tex-preamble-extra)
       (insert cal-tex-preamble-extra "\n"))
   (insert "\\hbadness 20000
@@ -296,29 +309,28 @@ Optional ARGS are included."
 
 (defun cal-tex-cursor-year (&optional arg)
   "Make a buffer with LaTeX commands for the year cursor is on.
-Optional prefix argument specifies number of years."
+Optional prefix argument ARG specifies number of years."
   (interactive "p")
   (cal-tex-year (extract-calendar-year (calendar-cursor-to-date t))
-                (if arg arg 1)))
+                (or arg 1)))
 
 (defun cal-tex-cursor-year-landscape (&optional arg)
   "Make a buffer with LaTeX commands for the year cursor is on.
-Optional prefix argument specifies number of years."
+Optional prefix argument ARG specifies number of years."
   (interactive "p")
   (cal-tex-year (extract-calendar-year (calendar-cursor-to-date t))
-                (if arg arg 1)
-                t))
+                (or arg 1) t))
 
 (defun cal-tex-year (year n &optional landscape)
   "Make a one page yearly calendar of YEAR; do this for N years.
-There are four rows of three months each, unless optional LANDSCAPE is t,
-in which case the calendar isprinted in landscape mode with three rows of
-four months each."
+There are four rows of three months each, unless optional
+LANDSCAPE is non-nil, in which case the calendar is printed in
+landscape mode with three rows of four months each."
   (cal-tex-insert-preamble 1 landscape "12pt")
   (if landscape
       (cal-tex-vspace "-.6cm")
     (cal-tex-vspace "-3.1cm"))
-  (calendar-for-loop j from 1 to n do
+  (dotimes (j n)
     (insert "\\vfill%\n")
     (cal-tex-b-center)
     (cal-tex-Huge (number-to-string year))
@@ -329,28 +341,28 @@ four months each."
     (insert "\n")
     (cal-tex-noindent)
     (cal-tex-nl)
-    (calendar-for-loop i from 1 to 12 do
-        (insert (cal-tex-mini-calendar i year "month" "1.1in" "1in"))
-        (insert "\\month")
-        (cal-tex-hspace "0.5in")
-        (if (zerop (mod i (if landscape 4 3)))
-            (cal-tex-nl "0.5in")))
+    (dotimes (i 12)
+      (insert (cal-tex-mini-calendar (1+ i) year "month" "1.1in" "1in"))
+      (insert "\\month")
+      (cal-tex-hspace "0.5in")
+      (if (zerop (mod (1+ i) (if landscape 4 3)))
+          (cal-tex-nl "0.5in")))
     (cal-tex-e-parbox)
     (cal-tex-e-center)
     (insert "\\vfill%\n")
     (setq year (1+ year))
-    (if (/= j n)
-        (cal-tex-newpage)
-      (cal-tex-end-document))
+    (if (= j (1- n))
+        (cal-tex-end-document)
+      (cal-tex-newpage))
     (run-hooks 'cal-tex-year-hook))
   (run-hooks 'cal-tex-hook))
 
 (defun cal-tex-cursor-filofax-year (&optional arg)
   "Make a Filofax one page yearly calendar of year indicated by cursor.
-Optional parameter specifies number of years."
+Optional prefix argument ARG specifies number of years."
   (interactive "p")
-  (let* ((n (if arg arg 1))
-         (year (extract-calendar-year (calendar-cursor-to-date t))))
+  (let ((n (or arg 1))
+        (year (extract-calendar-year (calendar-cursor-to-date t))))
     (cal-tex-preamble "twoside")
     (cal-tex-cmd "\\textwidth 3.25in")
     (cal-tex-cmd "\\textheight 6.5in")
@@ -362,8 +374,8 @@ Optional parameter specifies number of years."
     (cal-tex-cmd "\\pagestyle{empty}")
     (cal-tex-b-document)
     (cal-tex-cmd "\\vspace*{0.25in}")
-    (calendar-for-loop j from 1 to n do
-      (insert (format "\\hfil {\\Large \\bf %s} \\hfil\\\\\n" year))
+    (dotimes (j n)
+      (insert (format "\\hfil \\textbf{\\Large %s} \\hfil\\\\\n" year))
       (cal-tex-b-center)
       (cal-tex-b-parbox "l" "\\textwidth")
       (insert "\n")
@@ -374,9 +386,8 @@ Optional parameter specifies number of years."
              ;; the names of the months they insert.
              ["January" "February" "March" "April" "May" "June"
               "July" "August" "September" "October" "November" "December"]))
-        (calendar-for-loop i from 1 to 12 do
-          (insert (cal-tex-mini-calendar i year
-                                         (aref month-names (1- i))
+        (dotimes (i 12)
+          (insert (cal-tex-mini-calendar (1+ i) year (aref month-names i)
                                          "1in" ".9in" "tiny" "0.6mm"))))
       (insert
        "\\noindent\\fbox{\\January}\\fbox{\\February}\\fbox{\\March}\\\\
@@ -387,7 +398,7 @@ Optional parameter specifies number of years."
       (cal-tex-e-parbox)
       (cal-tex-e-center)
       (setq year (1+ year))
-      (if (= j n)
+      (if (= j (1- n))
           (cal-tex-end-document)
         (cal-tex-newpage)
         (cal-tex-cmd "\\vspace*{0.25in}"))
@@ -400,45 +411,34 @@ Optional parameter specifies number of years."
 
 (defun cal-tex-cursor-month-landscape (&optional arg)
   "Make a LaTeX calendar buffer for the month the cursor is on.
-Optional prefix argument specifies number of months to be
+Optional prefix argument ARG specifies number of months to be
 produced (default 1).  The output is in landscape format, one
 month to a page.  It shows holiday and diary entries if
-`cal-tex-holidays' and `cal-tex-diary', respectively, are
-non-nil."
+`cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil."
   (interactive "p")
-  (let* ((n (if arg arg 1))
+  (let* ((n (or arg 1))
          (date (calendar-cursor-to-date t))
          (month (extract-calendar-month date))
          (year (extract-calendar-year date))
          (end-month month)
          (end-year year)
-         (cal-tex-which-days '(0 1 2 3 4 5 6)))
+         (cal-tex-which-days '(0 1 2 3 4 5 6))
+         (d1 (calendar-absolute-from-gregorian (list month 1 year)))
+         (d2 (calendar-absolute-from-gregorian
+              (list end-month
+                    (calendar-last-day-of-month end-month end-year)
+                    end-year))))
     (increment-calendar-month end-month end-year (1- n))
     (let ((diary-list (if cal-tex-diary
-                          (cal-tex-list-diary-entries
-                           (calendar-absolute-from-gregorian
-                            (list month 1 year))
-                           (calendar-absolute-from-gregorian
-                            (list end-month
-                                  (calendar-last-day-of-month
-                                   end-month end-year)
-                                  end-year)))))
+                          (cal-tex-list-diary-entries d1 d2)))
           (holidays (if cal-tex-holidays
-                        (cal-tex-list-holidays
-                         (calendar-absolute-from-gregorian
-                          (list month 1 year))
-                         (calendar-absolute-from-gregorian
-                          (list end-month
-                                (calendar-last-day-of-month end-month end-year)
-                                end-year)))))
-          (other-month)
-          (other-year)
-          (small-months-at-start))
+                        (cal-tex-list-holidays d1 d2)))
+          other-month other-year small-months-at-start)
       (cal-tex-insert-preamble (cal-tex-number-weeks month year 1) t "12pt")
       (cal-tex-cmd cal-tex-cal-one-month)
-      (calendar-for-loop i from 1 to n do
-        (setq other-month month)
-        (setq other-year year)
+      (dotimes (i n)
+        (setq other-month month
+              other-year year)
         (increment-calendar-month other-month other-year -1)
         (insert (cal-tex-mini-calendar other-month other-year "lastmonth"
                                        "\\cellwidth" "\\cellheight"))
@@ -448,11 +448,10 @@ non-nil."
         (cal-tex-insert-month-header 1 month year month year)
         (cal-tex-insert-day-names)
         (cal-tex-nl ".2cm")
-        (setq small-months-at-start
+        (if (setq small-months-at-start
                   (< 1 (mod (- (calendar-day-of-week (list month 1 year))
                                calendar-week-start-day)
                             7)))
-        (if small-months-at-start
             (insert "\\lastmonth\\nextmonth\\hspace*{-2\\cellwidth}"))
         (cal-tex-insert-blank-days month year cal-tex-day-prefix)
         (cal-tex-insert-days month year diary-list holidays
@@ -468,20 +467,19 @@ non-nil."
             (insert "\\vspace*{-\\cellwidth}\\hspace*{-2\\cellwidth}"
                     "\\lastmonth\\nextmonth%
 "))
-        (if (/= i n)
-            (progn
-              (run-hooks 'cal-tex-month-hook)
-              (cal-tex-newpage)
-              (increment-calendar-month month year 1)
-              (cal-tex-vspace "-2cm")
-              (cal-tex-insert-preamble
-               (cal-tex-number-weeks month year 1) t "12pt" t))))
+        (unless (= i (1- n))
+          (run-hooks 'cal-tex-month-hook)
+          (cal-tex-newpage)
+          (increment-calendar-month month year 1)
+          (cal-tex-vspace "-2cm")
+          (cal-tex-insert-preamble
+           (cal-tex-number-weeks month year 1) t "12pt" t)))
       (cal-tex-end-document)
       (run-hooks 'cal-tex-hook))))
 
 (defun cal-tex-cursor-month (arg)
   "Make a LaTeX calendar buffer for the month the cursor is on.
-Optional prefix argument specifies number of months to be
+Optional prefix argument ARG specifies number of months to be
 produced (default 1).  The calendar is condensed onto one page.
 It shows holiday and diary entries if `cal-tex-holidays' and
 `cal-tex-diary', respectively, are non-nil."
@@ -491,27 +489,18 @@ It shows holiday and diary entries if `cal-tex-holidays' and
          (year (extract-calendar-year date))
          (end-month month)
          (end-year year)
-         (n (if arg arg 1)))
+         (n (or arg 1))
+         (d1 (calendar-absolute-from-gregorian (list month 1 year)))
+         (d2 (calendar-absolute-from-gregorian
+              (list end-month
+                    (calendar-last-day-of-month end-month end-year)
+                    end-year))))
     (increment-calendar-month end-month end-year (1- n))
     (let ((diary-list (if cal-tex-diary
-                          (cal-tex-list-diary-entries
-                           (calendar-absolute-from-gregorian
-                            (list month 1 year))
-                           (calendar-absolute-from-gregorian
-                            (list end-month
-                                  (calendar-last-day-of-month
-                                   end-month end-year)
-                                  end-year)))))
+                          (cal-tex-list-diary-entries d1 d2)))
           (holidays (if cal-tex-holidays
-                        (cal-tex-list-holidays
-                         (calendar-absolute-from-gregorian
-                          (list month 1 year))
-                         (calendar-absolute-from-gregorian
-                          (list end-month
-                                (calendar-last-day-of-month end-month end-year)
-                                end-year)))))
-          (other-month)
-          (other-year))
+                        (cal-tex-list-holidays d1 d2)))
+          other-month other-year)
       (cal-tex-insert-preamble (cal-tex-number-weeks month year n) nil"12pt")
       (if (> n 1)
           (cal-tex-cmd cal-tex-cal-multi-month)
@@ -520,20 +509,18 @@ It shows holiday and diary entries if `cal-tex-holidays' and
       (cal-tex-insert-day-names)
       (cal-tex-nl ".2cm")
       (cal-tex-insert-blank-days month year cal-tex-day-prefix)
-      (calendar-for-loop i from 1 to n do
-        (setq other-month month)
-        (setq other-year year)
-        (cal-tex-insert-days month year diary-list holidays
-                             cal-tex-day-prefix)
-        (if (= (mod (calendar-absolute-from-gregorian
+      (dotimes (idummy n)
+        (setq other-month month
+              other-year year)
+        (cal-tex-insert-days month year diary-list holidays cal-tex-day-prefix)
+        (when (= (mod (calendar-absolute-from-gregorian
                        (list month
                              (calendar-last-day-of-month month year)
                              year))
                       7)
-                 6); last day of month was Saturday
-            (progn
-              (cal-tex-hfill)
-              (cal-tex-nl)))
+                 6)                   ; last day of month was Saturday
+          (cal-tex-hfill)
+          (cal-tex-nl))
         (increment-calendar-month month year 1))
       (cal-tex-insert-blank-days-at-end end-month end-year cal-tex-day-prefix)
       (cal-tex-end-document)))
@@ -544,32 +531,31 @@ It shows holiday and diary entries if `cal-tex-holidays' and
 LaTeX commands are inserted for the days of the MONTH in YEAR.
 Diary entries on DIARY-LIST are included.  Holidays on HOLIDAYS
 are included.  Each day is formatted using format DAY-FORMAT."
-  (let* ((blank-days;; at start of month
-          (mod
-           (- (calendar-day-of-week (list month 1 year))
-              calendar-week-start-day)
-           7))
-         (date)
-         (last (calendar-last-day-of-month month year)))
-    (calendar-for-loop i from 1 to last do
-       (setq date (list month i year))
-       (if (memq (calendar-day-of-week date) cal-tex-which-days)
-           (progn
-             (insert (format day-format (cal-tex-month-name month) i))
-             (cal-tex-arg (cal-tex-latexify-list diary-list date))
-             (cal-tex-arg (cal-tex-latexify-list holidays date))
-             (cal-tex-arg (eval cal-tex-daily-string))
-             (cal-tex-arg)
-             (cal-tex-comment)))
-       (if (and (zerop (mod (+ i blank-days) 7))
-                (/= i last))
-           (progn
-             (cal-tex-hfill)
-             (cal-tex-nl))))))
+  (let ((blank-days                     ; at start of month
+         (mod
+          (- (calendar-day-of-week (list month 1 year))
+             calendar-week-start-day)
+          7))
+        (last (calendar-last-day-of-month month year))
+        date j)
+    (dotimes (i last)
+      (setq j (1+ i)                    ; 1-last, incl
+            date (list month j year))
+      (when (memq (calendar-day-of-week date) cal-tex-which-days)
+        (insert (format day-format (cal-tex-month-name month) j))
+        (cal-tex-arg (cal-tex-latexify-list diary-list date))
+        (cal-tex-arg (cal-tex-latexify-list holidays date))
+        (cal-tex-arg (eval cal-tex-daily-string))
+        (cal-tex-arg)
+        (cal-tex-comment))
+      (when (and (zerop (mod (+ j blank-days) 7))
+                 (/= j last))
+        (cal-tex-hfill)
+        (cal-tex-nl)))))
 
 (defun cal-tex-insert-day-names ()
   "Insert the names of the days at top of a monthly calendar."
-  (calendar-for-loop i from 0 to 6 do
+  (dotimes (i 7)
     (if (memq i cal-tex-which-days)
         (insert (format cal-tex-day-name-format
                         (cal-tex-LaTeXify-string
@@ -581,13 +567,13 @@ are included.  Each day is formatted using format DAY-FORMAT."
   "Create a title for a calendar.
 A title is inserted for a calendar with N months starting with
 MONTH YEAR and ending with END-MONTH END-YEAR."
-  (let ((month-name (cal-tex-month-name  month))
-         (end-month-name (cal-tex-month-name  end-month)))
+  (let ((month-name (cal-tex-month-name month))
+        (end-month-name (cal-tex-month-name end-month)))
     (if (= 1 n)
         (insert (format "\\calmonth{%s}{%s}\n\\vspace*{-0.5cm}"
-                month-name year) )
-        (insert (format "\\calmonth{%s}{%s}{%s}{%s}\n\\vspace*{-0.5cm}"
-                month-name year end-month-name end-year))))
+                        month-name year) )
+      (insert (format "\\calmonth{%s}{%s}{%s}{%s}\n\\vspace*{-0.5cm}"
+                      month-name year end-month-name end-year))))
   (cal-tex-comment))
 
 (defun cal-tex-insert-blank-days (month year day-format)
@@ -596,12 +582,12 @@ Insert LaTeX code for the blank days at the beginning of the MONTH in
 YEAR.  The entry is formatted using DAY-FORMAT.  If the entire week is
 blank, no days are inserted."
   (if (cal-tex-first-blank-p month year)
-      (let* ((blank-days;; at start of month
-              (mod
-               (- (calendar-day-of-week (list month 1 year))
-                  calendar-week-start-day)
-               7)))
-        (calendar-for-loop i from 0 to (1- blank-days) do
+      (let ((blank-days                ; at start of month
+             (mod
+              (- (calendar-day-of-week (list month 1 year))
+                 calendar-week-start-day)
+              7)))
+        (dotimes (i blank-days)
           (if (memq i cal-tex-which-days)
               (insert (format day-format " " " ") "{}{}{}{}%\n"))))))
 
@@ -611,7 +597,7 @@ Insert LaTeX code for the blank days at the end of the MONTH in YEAR.
 The entry is formatted using DAY-FORMAT."
   (if (cal-tex-last-blank-p month year)
       (let* ((last-day (calendar-last-day-of-month month year))
-             (blank-days;; at end of month
+             (blank-days                ; at end of month
               (mod
                (- (calendar-day-of-week (list month last-day year))
                   calendar-week-start-day)
@@ -624,24 +610,22 @@ The entry is formatted using DAY-FORMAT."
   "Determine if any days of the first week will be printed.
 Return t if there will there be any days of the first week printed
 in the calendar starting in MONTH YEAR."
-  (let ((any-days nil)
-        (the-saturday))                 ;the day of week of 1st Saturday
-    (calendar-for-loop i from 1 to 7 do
-       (if (= 6 (calendar-day-of-week (list month i year)))
-           (setq the-saturday i)))
-    (calendar-for-loop i from 1 to the-saturday do
-       (if (memq (calendar-day-of-week (list month i year))
-                 cal-tex-which-days)
-           (setq any-days t)))
+  (let (any-days the-saturday)        ; the day of week of 1st Saturday
+    (dotimes (i 7)
+      (if (= 6 (calendar-day-of-week (list month (1+ i) year)))
+          (setq the-saturday (1+ i))))
+    (dotimes (i the-saturday)
+      (if (memq (calendar-day-of-week (list month (1+ i) year))
+                cal-tex-which-days)
+          (setq any-days t)))
     any-days))
 
 (defun cal-tex-last-blank-p (month year)
   "Determine if any days of the last week will be printed.
 Return t if there will there be any days of the last week printed
 in the calendar starting in MONTH YEAR."
-  (let ((any-days nil)
-        (last-day (calendar-last-day-of-month month year))
-        (the-sunday))                   ;the day of week of last Sunday
+  (let ((last-day (calendar-last-day-of-month month year))
+        any-days the-sunday)          ; the day of week of last Sunday
     (calendar-for-loop i from (- last-day 6) to last-day do
        (if (= 0 (calendar-day-of-week (list month i year)))
            (setq the-sunday i)))
@@ -654,7 +638,7 @@ in the calendar starting in MONTH YEAR."
 (defun cal-tex-number-weeks (month year n)
   "Determine the number of weeks in a range of dates.
 Compute the number of  weeks in the calendar starting with MONTH and YEAR,
-and lasting N months, including only the days in WHICH-DAYS. As it stands,
+and lasting N months, including only the days in WHICH-DAYS.  As it stands,
 this is only an upper bound."
   (let ((d (list month 1 year)))
     (increment-calendar-month month year (1- n))
@@ -671,20 +655,21 @@ this is only an upper bound."
 ;;; Weekly calendars
 ;;;
 
-(defvar cal-tex-LaTeX-hourbox
+(defconst cal-tex-LaTeX-hourbox
   "\\newcommand{\\hourbox}[2]%
 {\\makebox[2em]{\\rule{0cm}{#2ex}#1}\\rule{3in}{.15mm}}\n"
   "One hour and a line on the right.")
 
 ;; TODO cal-tex-diary-support.
+;; TODO respect cal-tex-daily-start,end (see cal-tex-week-hours).
 (defun cal-tex-cursor-week (&optional arg)
   "Make a LaTeX calendar buffer for a two-page one-week calendar.
 It applies to the week that point is in.  The optional prefix
-argument specifies the number of weeks (default 1).  The calendar
-shows holidays if `cal-tex-holidays' is t (note that diary
-entries are not shown)."
+argument ARG specifies the number of weeks (default 1).  The calendar
+shows holidays if `cal-tex-holidays' is non-nil (note that diary
+entries are not shown).  The calendar shows the hours 8-12am, 1-5pm."
   (interactive "p")
-  (let* ((n (if arg arg 1))
+  (let* ((n (or arg 1))
          (date (calendar-gregorian-from-absolute
                 (calendar-dayname-on-or-before
                  calendar-week-start-day
@@ -692,11 +677,10 @@ entries are not shown)."
                   (calendar-cursor-to-date t)))))
          (month (extract-calendar-month date))
          (year (extract-calendar-year date))
+         (d1 (calendar-absolute-from-gregorian date))
+         (d2 (+ (* 7 n) d1))
          (holidays (if cal-tex-holidays
-                       (cal-tex-list-holidays
-                        (calendar-absolute-from-gregorian date)
-                        (+ (* 7 n)
-                           (calendar-absolute-from-gregorian date))))))
+                       (cal-tex-list-holidays d1 d2))))
     (cal-tex-preamble "11pt")
     (cal-tex-cmd "\\textwidth   6.5in")
     (cal-tex-cmd "\\textheight 10.5in")
@@ -705,7 +689,7 @@ entries are not shown)."
     (insert cal-tex-LaTeX-hourbox)
     (cal-tex-b-document)
     (cal-tex-cmd "\\pagestyle{empty}")
-    (calendar-for-loop i from 1 to n do
+    (dotimes (i n)
       (cal-tex-vspace "-1.5in")
       (cal-tex-b-center)
       (cal-tex-Huge-bf (format "\\uppercase{%s}"
@@ -716,28 +700,28 @@ entries are not shown)."
       (cal-tex-e-center)
       (cal-tex-hspace "-.2in")
       (cal-tex-b-parbox "l" "7in")
-      (calendar-for-loop j from 1 to 7 do
+      (dotimes (jdummy 7)
         (cal-tex-week-hours date holidays "3.1")
         (setq date (cal-tex-incr-date date)))
       (cal-tex-e-parbox)
-      (setq month (extract-calendar-month date))
-      (setq year (extract-calendar-year date))
-      (if (/= i n)
-          (progn
-            (run-hooks 'cal-tex-week-hook)
-            (cal-tex-newpage))))
+      (setq month (extract-calendar-month date)
+            year (extract-calendar-year date))
+      (unless (= i (1- n))
+        (run-hooks 'cal-tex-week-hook)
+        (cal-tex-newpage)))
     (cal-tex-end-document)
     (run-hooks 'cal-tex-hook)))
 
 ;; TODO cal-tex-diary support.
+;; TODO respect cal-tex-daily-start,end (see cal-tex-week-hours).
 (defun cal-tex-cursor-week2 (&optional arg)
   "Make a LaTeX calendar buffer for a two-page one-week calendar.
 It applies to the week that point is in.  Optional prefix
-argument specifies number of weeks (default 1).  The calendar
+argument ARG specifies number of weeks (default 1).  The calendar
 shows holidays if `cal-tex-holidays' is non-nil (note that diary
-entries are not shown)."
+entries are not shown).  The calendar shows the hours 8-12am, 1-5pm"
   (interactive "p")
-  (let* ((n (if arg arg 1))
+  (let* ((n (or arg 1))
          (date (calendar-gregorian-from-absolute
                 (calendar-dayname-on-or-before
                  calendar-week-start-day
@@ -746,11 +730,10 @@ entries are not shown)."
          (month (extract-calendar-month date))
          (year (extract-calendar-year date))
          (d date)
+         (d1 (calendar-absolute-from-gregorian date))
+         (d2 (+ (* 7 n) d1))
          (holidays (if cal-tex-holidays
-                       (cal-tex-list-holidays
-                        (calendar-absolute-from-gregorian date)
-                        (+ (* 7 n)
-                           (calendar-absolute-from-gregorian date))))))
+                       (cal-tex-list-holidays d1 d2))))
     (cal-tex-preamble "12pt")
     (cal-tex-cmd "\\textwidth   6.5in")
     (cal-tex-cmd "\\textheight 10.5in")
@@ -759,7 +742,7 @@ entries are not shown)."
     (insert cal-tex-LaTeX-hourbox)
     (cal-tex-b-document)
     (cal-tex-cmd "\\pagestyle{empty}")
-    (calendar-for-loop i from 1 to n do
+    (dotimes (i n)
       (cal-tex-vspace "-1.5in")
       (cal-tex-b-center)
       (cal-tex-Huge-bf (format "\\uppercase{%s}"
@@ -770,7 +753,7 @@ entries are not shown)."
       (cal-tex-e-center)
       (cal-tex-hspace "-.2in")
       (cal-tex-b-parbox "l" "\\textwidth")
-      (calendar-for-loop j from 1 to 3 do
+      (dotimes (jdummy 3)
         (cal-tex-week-hours date holidays "5")
         (setq date (cal-tex-incr-date date)))
       (cal-tex-e-parbox)
@@ -798,26 +781,26 @@ entries are not shown)."
       (insert "}")
       (cal-tex-nl)
       (cal-tex-b-parbox "l" "\\textwidth")
-      (calendar-for-loop j from 4 to 7 do
+      (dotimes (jdummy 4)
         (cal-tex-week-hours date holidays "5")
         (setq date (cal-tex-incr-date date)))
       (cal-tex-e-parbox)
-      (setq month (extract-calendar-month date))
-      (setq year (extract-calendar-year date))
-      (if (/= i n)
-          (progn
-            (run-hooks 'cal-tex-week-hook)
-            (cal-tex-newpage))))
+      (setq month (extract-calendar-month date)
+            year (extract-calendar-year date))
+      (unless (= i (1- n))
+        (run-hooks 'cal-tex-week-hook)
+        (cal-tex-newpage)))
     (cal-tex-end-document)
     (run-hooks 'cal-tex-hook)))
 
 (defun cal-tex-cursor-week-iso (&optional arg)
   "Make a LaTeX calendar buffer for a one page ISO-style weekly calendar.
-Optional prefix argument specifies number of weeks (default 1).
+Optional prefix argument ARG specifies number of weeks (default 1).
 The calendar shows holiday and diary entries if
-`cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil."
+`cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil.
+It does not show hours of the day."
   (interactive "p")
-  (let* ((n (if arg arg 1))
+  (let* ((n (or arg 1))
          (date (calendar-gregorian-from-absolute
                 (calendar-dayname-on-or-before
                  1
@@ -826,17 +809,16 @@ The calendar shows holiday and diary entries if
          (month (extract-calendar-month date))
          (year (extract-calendar-year date))
          (day (extract-calendar-day date))
+         (d1 (calendar-absolute-from-gregorian date))
+         (d2 (+ (* 7 n) d1))
          (holidays (if cal-tex-holidays
-                       (cal-tex-list-holidays
-                        (calendar-absolute-from-gregorian date)
-                        (+ (* 7 n)
-                           (calendar-absolute-from-gregorian date)))))
+                       (cal-tex-list-holidays d1 d2)))
          (diary-list (if cal-tex-diary
                          (cal-tex-list-diary-entries
-                          (calendar-absolute-from-gregorian
-                           (list month 1 year))
-                        (+ (* 7 n)
-                           (calendar-absolute-from-gregorian date))))))
+                          ;; FIXME d1?
+                          (calendar-absolute-from-gregorian (list month 1 year))
+                          d2)))
+         s)
     (cal-tex-preamble "11pt")
     (cal-tex-cmd "\\textwidth 6.5in")
     (cal-tex-cmd "\\textheight 10.5in")
@@ -844,19 +826,19 @@ The calendar shows holiday and diary entries if
     (cal-tex-cmd "\\evensidemargin 0in")
     (cal-tex-b-document)
     (cal-tex-cmd "\\pagestyle{empty}")
-    (calendar-for-loop i from 1 to n do
+    (dotimes (i n)
       (cal-tex-vspace "-1.5in")
       (cal-tex-b-center)
       (cal-tex-Huge-bf
-       (let* ((d (calendar-iso-from-absolute
-                  (calendar-absolute-from-gregorian date))))
+       (let ((d (calendar-iso-from-absolute
+                 (calendar-absolute-from-gregorian date))))
          (format "Week %d of %d"
                  (extract-calendar-month d)
                  (extract-calendar-year d))))
       (cal-tex-nl ".5cm")
       (cal-tex-e-center)
       (cal-tex-b-parbox "l" "\\textwidth")
-      (calendar-for-loop j from 1 to 7 do
+      (dotimes (j 7)
         (cal-tex-b-parbox "t" "\\textwidth")
         (cal-tex-b-parbox "t" "\\textwidth")
         (cal-tex-rule "0pt" "\\textwidth" ".2mm")
@@ -867,47 +849,48 @@ The calendar shows holiday and diary entries if
         (cal-tex-large-bf (cal-tex-month-name month))
         (insert " ")
         (cal-tex-large-bf (number-to-string day))
-        (if (not (string= "" (cal-tex-latexify-list holidays date)))
-            (progn
-              (insert ": ")
-              (cal-tex-large-bf (cal-tex-latexify-list holidays date "; "))))
+        (unless (string-equal "" (setq s (cal-tex-latexify-list
+                                          holidays date "; ")))
+          (insert ": ")
+          (cal-tex-large-bf s))
         (cal-tex-hfill)
         (insert " " (eval cal-tex-daily-string))
         (cal-tex-e-parbox)
         (cal-tex-nl)
         (cal-tex-noindent)
         (cal-tex-b-parbox "t" "\\textwidth")
-        (if (not (string= "" (cal-tex-latexify-list diary-list date)))
-            (progn
-              (insert "\\vbox to 0pt{")
-              (cal-tex-large-bf
-               (cal-tex-latexify-list diary-list date))
-              (insert "}")))
+        (unless (string-equal "" (setq s (cal-tex-latexify-list
+                                          diary-list date)))
+          (insert "\\vbox to 0pt{")
+          (cal-tex-large-bf s)
+          (insert "}"))
         (cal-tex-e-parbox)
         (cal-tex-nl)
-        (setq date (cal-tex-incr-date date))
-        (setq month (extract-calendar-month date))
-        (setq day (extract-calendar-day date))
+        (setq date (cal-tex-incr-date date)
+              month (extract-calendar-month date)
+              day (extract-calendar-day date))
         (cal-tex-e-parbox)
         (cal-tex-e-parbox "2cm")
         (cal-tex-nl)
-        (setq month (extract-calendar-month date))
-        (setq year (extract-calendar-year date)))
+        (setq month (extract-calendar-month date)
+              year (extract-calendar-year date)))
       (cal-tex-e-parbox)
-      (if (/= i n)
-          (progn
-            (run-hooks 'cal-tex-week-hook)
-            (cal-tex-newpage))))
+      (unless (= i (1- n))
+        (run-hooks 'cal-tex-week-hook)
+        (cal-tex-newpage)))
     (cal-tex-end-document)
     (run-hooks 'cal-tex-hook)))
 
+;; TODO respect cal-tex-daily-start,end?
+;; Using different numbers of hours will probably break some layouts.
 (defun cal-tex-week-hours (date holidays height)
   "Insert hourly entries for DATE with HOLIDAYS, with line height HEIGHT.
-Uses the 24-hour clock if `cal-tex-24' is non-nil."
+Uses the 24-hour clock if `cal-tex-24' is non-nil.  Note that the hours
+shown are hard-coded to 8-12, 13-17."
   (let ((month (extract-calendar-month date))
-        (day   (extract-calendar-day date))
-        (year  (extract-calendar-year date))
-        (afternoon))
+        (day (extract-calendar-day date))
+        (year (extract-calendar-year date))
+        morning afternoon s)
   (cal-tex-comment "begin cal-tex-week-hours")
   (cal-tex-cmd  "\\ \\\\[-.2cm]")
   (cal-tex-cmd "\\noindent")
@@ -917,48 +900,51 @@ Uses the 24-hour clock if `cal-tex-24' is non-nil."
   (cal-tex-large-bf (cal-tex-month-name month))
   (insert " ")
   (cal-tex-large-bf (number-to-string day))
-  (if (not (string= "" (cal-tex-latexify-list holidays date)))
-      (progn
-        (insert ": ")
-        (cal-tex-large-bf (cal-tex-latexify-list holidays date "; "))))
+  (unless (string-equal "" (setq s (cal-tex-latexify-list
+                                    holidays date "; ")))
+    (insert ": ")
+    (cal-tex-large-bf s))
   (cal-tex-hfill)
   (insert " " (eval cal-tex-daily-string))
   (cal-tex-e-parbox)
   (cal-tex-nl "-.3cm")
   (cal-tex-rule "0pt" "6.8in" ".2mm")
   (cal-tex-nl "-.1cm")
-  (calendar-for-loop i from 8 to 12 do
-     (if cal-tex-24
-         (setq afternoon (+ i 5))
-       (setq afternoon (- i 7)))
-     (cal-tex-cmd "\\hourbox"  (number-to-string i))
-     (cal-tex-arg height)
-     (cal-tex-hspace ".4cm")
-     (cal-tex-cmd "\\hourbox"  (number-to-string afternoon))
-     (cal-tex-arg height)
-     (cal-tex-nl))))
+  (dotimes (i 5)
+    (setq morning (+ i 8)               ; 8-12 incl
+          afternoon (if cal-tex-24
+                        (+ i 13)        ; 13-17 incl
+                      (1+ i)))          ; 1-5 incl
+    (cal-tex-cmd "\\hourbox" (number-to-string morning))
+    (cal-tex-arg height)
+    (cal-tex-hspace ".4cm")
+    (cal-tex-cmd "\\hourbox" (number-to-string afternoon))
+    (cal-tex-arg height)
+    (cal-tex-nl))))
 
 ;; TODO cal-tex-diary support.
+;; TODO respect cal-tex-daily-start,end (see cal-tex-weekly4-box).
 (defun cal-tex-cursor-week-monday (&optional arg)
   "Make a LaTeX calendar buffer for a two-page one-week calendar.
 It applies to the week that point is in, and starts on Monday.
-Optional prefix argument specifies number of weeks (default 1).
+Optional prefix argument ARG specifies number of weeks (default 1).
 The calendar shows holidays if `cal-tex-holidays' is
-non-nil (note that diary entries are not shown)."
+non-nil (note that diary entries are not shown).   The calendar shows
+the hours 8-12am, 1-5pm."
   (interactive "p")
-  (let* ((n (if arg arg 1))
-         (date (calendar-gregorian-from-absolute
-                (calendar-dayname-on-or-before
-                 0
-                 (calendar-absolute-from-gregorian
-                  (calendar-cursor-to-date t))))))
+  (let ((n (or arg 1))
+        (date (calendar-gregorian-from-absolute
+               (calendar-dayname-on-or-before
+                0
+                (calendar-absolute-from-gregorian
+                 (calendar-cursor-to-date t))))))
     (cal-tex-preamble "11pt")
     (cal-tex-cmd "\\textwidth   6.5in")
     (cal-tex-cmd "\\textheight 10.5in")
     (cal-tex-cmd "\\oddsidemargin 0in")
     (cal-tex-cmd "\\evensidemargin 0in")
     (cal-tex-b-document)
-    (calendar-for-loop i from 1 to n do
+    (dotimes (i n)
       (cal-tex-vspace "-1cm")
       (insert "\\noindent ")
       (cal-tex-weekly4-box (cal-tex-incr-date date) nil)
@@ -969,61 +955,62 @@ non-nil (note that diary entries are not shown)."
       (cal-tex-nl ".2cm")
       (cal-tex-weekly4-box (cal-tex-incr-date date 3) nil)
       (cal-tex-weekly4-box (cal-tex-incr-date date 6) t)
-      (if (/= i n)
-          (progn
-            (run-hooks 'cal-tex-week-hook)
-            (setq date (cal-tex-incr-date date 7))
-            (cal-tex-newpage))))
+      (unless (= i (1- n))
+        (run-hooks 'cal-tex-week-hook)
+        (setq date (cal-tex-incr-date date 7))
+        (cal-tex-newpage)))
     (cal-tex-end-document)
     (run-hooks 'cal-tex-hook)))
 
+;; TODO respect cal-tex-daily-start,end?
+;; Using different numbers of hours will probably break some layouts.
 (defun cal-tex-weekly4-box (date weekend)
   "Make one box for DATE, different if WEEKEND.
-Uses the 24-hour clock if `cal-tex-24' is non-nil."
-  (let* (
-       (day (extract-calendar-day date))
-       (month (extract-calendar-month date))
-       (year (extract-calendar-year date))
-       (dayname (cal-tex-LaTeXify-string (calendar-day-name date)))
-       (date1 (cal-tex-incr-date date))
-       (day1 (extract-calendar-day date1))
-       (month1 (extract-calendar-month date1))
-       (year1 (extract-calendar-year date1))
-       (dayname1 (cal-tex-LaTeXify-string (calendar-day-name date1)))
-       )
+Uses the 24-hour clock if `cal-tex-24' is non-nil.  Note that the hours
+shown are hard-coded to 8-12, 13-17."
+  (let* ((day (extract-calendar-day date))
+         (month (extract-calendar-month date))
+         (year (extract-calendar-year date))
+         (dayname (cal-tex-LaTeXify-string (calendar-day-name date)))
+         (date1 (cal-tex-incr-date date))
+         (day1 (extract-calendar-day date1))
+         (month1 (extract-calendar-month date1))
+         (year1 (extract-calendar-year date1))
+         (dayname1 (cal-tex-LaTeXify-string (calendar-day-name date1))))
     (cal-tex-b-framebox "8cm" "l")
     (cal-tex-b-parbox "b" "7.5cm")
-    (insert (format "{\\Large\\bf %s,} %s/%s/%s\\\\\n" dayname month day year))
+    (insert (format "\\textbf{\\Large %s,} %s/%s/%s\\\\\n"
+                    dayname month day year))
     (cal-tex-rule "0pt" "7.5cm" ".5mm")
     (cal-tex-nl)
-    (if (not weekend)
-       (progn
-         (calendar-for-loop i from 8 to 12 do
-            (insert (format "{\\large\\sf %d}\\\\\n" i)))
-         (calendar-for-loop i from 1 to 5 do
-            (insert (format "{\\large\\sf %d}\\\\\n"
-                            (if cal-tex-24 (+ i 12) i))))))
+    (unless weekend
+      (dotimes (i 5)
+        (insert (format "\\textsf{\\large %d}\\\\\n" (+ i 8))))
+      (dotimes (i 5)
+        (insert (format "\\textsf{\\large %d}\\\\\n"
+                        (if cal-tex-24
+                            (+ i 13)    ; 13-17 incl
+                          (1+ i))))))   ; 1-5 incl
     (cal-tex-nl ".5cm")
-    (if weekend
-       (progn
-         (cal-tex-vspace "1cm")
-         (insert "\\ \\vfill")
-         (insert (format "{\\Large\\bf %s,} %s/%s/%s\\\\\n"
-                         dayname1 month1 day1 year1))
-         (cal-tex-rule "0pt" "7.5cm" ".5mm")
-         (cal-tex-nl "1.5cm")
-         (cal-tex-vspace "1cm")))
+    (when weekend
+      (cal-tex-vspace "1cm")
+      (insert "\\ \\vfill")
+      (insert (format "\\textbf{\\Large %s,} %s/%s/%s\\\\\n"
+                      dayname1 month1 day1 year1))
+      (cal-tex-rule "0pt" "7.5cm" ".5mm")
+      (cal-tex-nl "1.5cm")
+      (cal-tex-vspace "1cm"))
      (cal-tex-e-parbox)
      (cal-tex-e-framebox)
      (cal-tex-hspace "1cm")))
 
 (defun cal-tex-cursor-filofax-2week (&optional arg)
   "Two-weeks-at-a-glance Filofax style calendar for week cursor is in.
-Optional prefix argument specifies number of weeks (default 1).
+Optional prefix argument ARG specifies number of weeks (default 1).
 The calendar shows holiday and diary entries if
 `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil."
   (interactive "p")
-  (let* ((n (if arg arg 1))
+  (let* ((n (or arg 1))
          (date (calendar-gregorian-from-absolute
                 (calendar-dayname-on-or-before
                  calendar-week-start-day
@@ -1032,17 +1019,15 @@ The calendar shows holiday and diary entries if
          (month (extract-calendar-month date))
          (year (extract-calendar-year date))
          (day (extract-calendar-day date))
+         (d1 (calendar-absolute-from-gregorian date))
+         (d2 (+ (* 7 n) d1))
          (holidays (if cal-tex-holidays
-                       (cal-tex-list-holidays
-                        (calendar-absolute-from-gregorian date)
-                        (+ (* 7 n)
-                           (calendar-absolute-from-gregorian date)))))
+                       (cal-tex-list-holidays d1 d2)))
          (diary-list (if cal-tex-diary
                          (cal-tex-list-diary-entries
-                          (calendar-absolute-from-gregorian
-                           (list month 1 year))
-                        (+ (* 7 n)
-                           (calendar-absolute-from-gregorian date))))))
+                          ;; FIXME d1?
+                          (calendar-absolute-from-gregorian (list month 1 year))
+                          d2))))
     (cal-tex-preamble "twoside")
     (cal-tex-cmd "\\textwidth 3.25in")
     (cal-tex-cmd "\\textheight 6.5in")
@@ -1073,58 +1058,53 @@ The calendar shows holiday and diary entries if
 ")
     (cal-tex-b-document)
     (cal-tex-cmd "\\pagestyle{empty}")
-    (calendar-for-loop i from 1 to n do
-       (if (= (mod i 2) 1)
-           (insert "\\righthead")
-         (insert "\\lefthead"))
-       (cal-tex-arg
-        (let ((d (cal-tex-incr-date date 6)))
-          (if (= (extract-calendar-month date)
-                 (extract-calendar-month d))
-              (format "%s %s"
-                      (cal-tex-month-name
-                       (extract-calendar-month date))
-                      (extract-calendar-year date))
-            (if (=  (extract-calendar-year date)
-                    (extract-calendar-year d))
-                (format "%s---%s %s"
-                        (cal-tex-month-name
-                         (extract-calendar-month date))
-                        (cal-tex-month-name
-                         (extract-calendar-month d))
-                        (extract-calendar-year date))
+    (dotimes (i n)
+      (if (zerop (mod i 2))
+          (insert "\\righthead")
+        (insert "\\lefthead"))
+      (cal-tex-arg
+       (let ((d (cal-tex-incr-date date 6)))
+         (if (= (extract-calendar-month date)
+                (extract-calendar-month d))
+             (format "%s %s"
+                     (cal-tex-month-name (extract-calendar-month date))
+                     (extract-calendar-year date))
+           (if (= (extract-calendar-year date)
+                  (extract-calendar-year d))
+               (format "%s---%s %s"
+                       (cal-tex-month-name (extract-calendar-month date))
+                       (cal-tex-month-name (extract-calendar-month d))
+                       (extract-calendar-year date))
               (format "%s %s---%s %s"
-                      (cal-tex-month-name
-                       (extract-calendar-month date))
+                      (cal-tex-month-name (extract-calendar-month date))
                       (extract-calendar-year date)
                       (cal-tex-month-name (extract-calendar-month d))
                       (extract-calendar-year d))))))
-       (insert "%\n")
-       (calendar-for-loop j from 1 to 7 do
-          (if (= (mod i 2) 1)
-              (insert "\\rightday")
-            (insert "\\leftday"))
-          (cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date)))
-          (cal-tex-arg (int-to-string (extract-calendar-day date)))
-          (cal-tex-arg (cal-tex-latexify-list diary-list date))
-          (cal-tex-arg (cal-tex-latexify-list holidays date))
-          (cal-tex-arg (eval cal-tex-daily-string))
-          (insert "%\n")
-          (setq date (cal-tex-incr-date date)))
-       (if (/= i n)
-           (progn
-             (run-hooks 'cal-tex-week-hook)
-             (cal-tex-newpage))))
+      (insert "%\n")
+      (dotimes (jdummy 7)
+        (if (zerop (mod i 2))
+            (insert "\\rightday")
+          (insert "\\leftday"))
+        (cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date)))
+        (cal-tex-arg (int-to-string (extract-calendar-day date)))
+        (cal-tex-arg (cal-tex-latexify-list diary-list date))
+        (cal-tex-arg (cal-tex-latexify-list holidays date))
+        (cal-tex-arg (eval cal-tex-daily-string))
+        (insert "%\n")
+        (setq date (cal-tex-incr-date date)))
+      (unless (= i (1- n))
+        (run-hooks 'cal-tex-week-hook)
+        (cal-tex-newpage)))
     (cal-tex-end-document)
     (run-hooks 'cal-tex-hook)))
 
 (defun cal-tex-cursor-filofax-week (&optional arg)
   "One-week-at-a-glance Filofax style calendar for week indicated by cursor.
-Optional prefix argument specifies number of weeks (default 1),
+Optional prefix argument ARG specifies number of weeks (default 1),
 starting on Mondays.  The calendar shows holiday and diary entries
 if `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil."
   (interactive "p")
-  (let* ((n (if arg arg 1))
+  (let* ((n (or arg 1))
          (date (calendar-gregorian-from-absolute
                 (calendar-dayname-on-or-before
                  1
@@ -1133,17 +1113,15 @@ if `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil."
          (month (extract-calendar-month date))
          (year (extract-calendar-year date))
          (day (extract-calendar-day date))
+         (d1 (calendar-absolute-from-gregorian date))
+         (d2 (+ (* 7 n) d1))
          (holidays (if cal-tex-holidays
-                       (cal-tex-list-holidays
-                        (calendar-absolute-from-gregorian date)
-                        (+ (* 7 n)
-                           (calendar-absolute-from-gregorian date)))))
+                       (cal-tex-list-holidays d1 d2)))
          (diary-list (if cal-tex-diary
                          (cal-tex-list-diary-entries
-                          (calendar-absolute-from-gregorian
-                           (list month 1 year))
-                        (+ (* 7 n)
-                           (calendar-absolute-from-gregorian date))))))
+                          ;; FIXME d1?
+                          (calendar-absolute-from-gregorian (list month 1 year))
+                          d2))))
     (cal-tex-preamble "twoside")
     (cal-tex-cmd "\\textwidth 3.25in")
     (cal-tex-cmd "\\textheight 6.5in")
@@ -1183,32 +1161,28 @@ if `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil."
     (cal-tex-b-document)
     (cal-tex-cmd "\\pagestyle{empty}\\ ")
     (cal-tex-newpage)
-    (calendar-for-loop i from 1 to n do
+    (dotimes (i n)
       (insert "\\lefthead")
       (cal-tex-arg
        (let ((d (cal-tex-incr-date date 2)))
          (if (= (extract-calendar-month date)
                 (extract-calendar-month d))
              (format "%s %s"
-                     (cal-tex-month-name
-                      (extract-calendar-month date))
+                     (cal-tex-month-name (extract-calendar-month date))
                      (extract-calendar-year date))
            (if (= (extract-calendar-year date)
                   (extract-calendar-year d))
                (format "%s---%s %s"
-                       (cal-tex-month-name
-                        (extract-calendar-month date))
-                       (cal-tex-month-name
-                        (extract-calendar-month d))
+                       (cal-tex-month-name (extract-calendar-month date))
+                       (cal-tex-month-name (extract-calendar-month d))
                        (extract-calendar-year date))
              (format "%s %s---%s %s"
-                     (cal-tex-month-name
-                      (extract-calendar-month date))
+                     (cal-tex-month-name (extract-calendar-month date))
                      (extract-calendar-year date)
                      (cal-tex-month-name (extract-calendar-month d))
                      (extract-calendar-year d))))))
       (insert "%\n")
-      (calendar-for-loop j from 1 to 3 do
+      (dotimes (jdummy 3)
         (insert "\\leftday")
         (cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date)))
         (cal-tex-arg (int-to-string (extract-calendar-day date)))
@@ -1225,25 +1199,21 @@ if `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil."
          (if (= (extract-calendar-month date)
                  (extract-calendar-month d))
              (format "%s %s"
-                     (cal-tex-month-name
-                      (extract-calendar-month date))
+                     (cal-tex-month-name (extract-calendar-month date))
                      (extract-calendar-year date))
            (if (= (extract-calendar-year date)
                   (extract-calendar-year d))
                (format "%s---%s %s"
-                       (cal-tex-month-name
-                        (extract-calendar-month date))
-                       (cal-tex-month-name
-                        (extract-calendar-month d))
+                       (cal-tex-month-name (extract-calendar-month date))
+                       (cal-tex-month-name (extract-calendar-month d))
                        (extract-calendar-year date))
              (format "%s %s---%s %s"
-                     (cal-tex-month-name
-                      (extract-calendar-month date))
+                     (cal-tex-month-name (extract-calendar-month date))
                      (extract-calendar-year date)
                      (cal-tex-month-name (extract-calendar-month d))
                      (extract-calendar-year d))))))
       (insert "%\n")
-      (calendar-for-loop j from 1 to 2 do
+      (dotimes (jdummy 2)
         (insert "\\rightday")
         (cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date)))
         (cal-tex-arg (int-to-string (extract-calendar-day date)))
@@ -1252,7 +1222,7 @@ if `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil."
         (cal-tex-arg (eval cal-tex-daily-string))
         (insert "%\n")
         (setq date (cal-tex-incr-date date)))
-      (calendar-for-loop j from 1 to 2 do
+      (dotimes (jdummy 2)
         (insert "\\weekend")
         (cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date)))
         (cal-tex-arg (int-to-string (extract-calendar-day date)))
@@ -1261,21 +1231,20 @@ if `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil."
         (cal-tex-arg (eval cal-tex-daily-string))
         (insert "%\n")
         (setq date (cal-tex-incr-date date)))
-      (if (/= i n)
-          (progn
-            (run-hooks 'cal-tex-week-hook)
-            (cal-tex-newpage))))
+      (unless (= i (1- n))
+        (run-hooks 'cal-tex-week-hook)
+        (cal-tex-newpage)))
     (cal-tex-end-document)
     (run-hooks 'cal-tex-hook)))
 
 (defun cal-tex-cursor-filofax-daily (&optional arg)
   "Day-per-page Filofax style calendar for week indicated by cursor.
-Optional prefix argument specifies number of weeks (default 1),
+Optional prefix argument ARG specifies number of weeks (default 1),
 starting on Mondays.  The calendar shows holiday and diary
 entries if `cal-tex-holidays' and `cal-tex-diary', respectively,
 are non-nil.  Pages are ruled if `cal-tex-rules' is non-nil."
   (interactive "p")
-  (let* ((n (if arg arg 1))
+  (let* ((n (or arg 1))
          (date (calendar-gregorian-from-absolute
                 (calendar-dayname-on-or-before
                  1
@@ -1284,17 +1253,15 @@ are non-nil.  Pages are ruled if `cal-tex-rules' is non-nil."
          (month (extract-calendar-month date))
          (year (extract-calendar-year date))
          (day (extract-calendar-day date))
+         (d1 (calendar-absolute-from-gregorian date))
+         (d2 (+ (* 7 n) d1))
          (holidays (if cal-tex-holidays
-                       (cal-tex-list-holidays
-                        (calendar-absolute-from-gregorian date)
-                        (+ (* 7 n)
-                           (calendar-absolute-from-gregorian date)))))
+                       (cal-tex-list-holidays d1 d2)))
          (diary-list (if cal-tex-diary
                          (cal-tex-list-diary-entries
-                          (calendar-absolute-from-gregorian
-                           (list month 1 year))
-                         (+ (* 7 n)
-                            (calendar-absolute-from-gregorian date))))))
+                          ;; FIXME d1?
+                          (calendar-absolute-from-gregorian (list month 1 year))
+                         d2))))
     (cal-tex-preamble "twoside")
     (cal-tex-cmd "\\textwidth 3.25in")
     (cal-tex-cmd "\\textheight 6.5in")
@@ -1337,24 +1304,28 @@ are non-nil.  Pages are ruled if `cal-tex-rules' is non-nil."
 ")
     (cal-tex-b-document)
     (cal-tex-cmd "\\pagestyle{empty}")
-    (calendar-for-loop i from 1 to n do
-      (calendar-for-loop j from 1 to 5 do
-                         (let ((odd (/= 0 (% j 2))))
-                           (insert (if odd "\\righthead" "\\lefthead"))
-                           (cal-tex-arg (calendar-date-string date))
-                           (insert "%\n")
-                           (insert (if odd "\\rightday"  "\\leftday")))
-                         (cal-tex-arg (cal-tex-latexify-list diary-list date))
-                         (cal-tex-arg (cal-tex-latexify-list holidays date "\\\\" t))
-                         (cal-tex-arg (eval cal-tex-daily-string))
-                         (insert "%\n")
-                         (if cal-tex-rules
-                             (insert "\\linesfill\n")
-                           (insert "\\vfill\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n"))
-                         (cal-tex-newpage)
-                         (setq date (cal-tex-incr-date date)))
+    (dotimes (i n)
+      (dotimes (j 4)
+        (let ((even (zerop (% j 2))))
+          (insert (if even
+                      "\\righthead"
+                    "\\lefthead"))
+          (cal-tex-arg (calendar-date-string date))
+          (insert "%\n")
+          (insert (if even
+                      "\\rightday"
+                    "\\leftday")))
+        (cal-tex-arg (cal-tex-latexify-list diary-list date))
+        (cal-tex-arg (cal-tex-latexify-list holidays date "\\\\" t))
+        (cal-tex-arg (eval cal-tex-daily-string))
+        (insert "%\n")
+        (if cal-tex-rules
+            (insert "\\linesfill\n")
+          (insert "\\vfill\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n"))
+        (cal-tex-newpage)
+        (setq date (cal-tex-incr-date date)))
       (insert "%\n")
-      (calendar-for-loop j from 1 to 2 do
+      (dotimes (jdummy 2)
         (insert "\\lefthead")
         (cal-tex-arg (calendar-date-string date))
         (insert "\\weekend")
@@ -1366,12 +1337,11 @@ are non-nil.  Pages are ruled if `cal-tex-rules' is non-nil."
             (insert "\\linesfill\n")
           (insert "\\vfill"))
         (setq date (cal-tex-incr-date date)))
-      (if (not cal-tex-rules)
+      (or cal-tex-rules
           (insert "\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n"))
-      (if (/= i n)
-          (progn
-            (run-hooks 'cal-tex-week-hook)
-            (cal-tex-newpage))))
+      (unless (= i (1- n))
+        (run-hooks 'cal-tex-week-hook)
+        (cal-tex-newpage)))
     (cal-tex-end-document)
     (run-hooks 'cal-tex-hook)))
 
@@ -1382,23 +1352,24 @@ are non-nil.  Pages are ruled if `cal-tex-rules' is non-nil."
 
 (defun cal-tex-cursor-day (&optional arg)
   "Make a buffer with LaTeX commands for the day cursor is on.
-Optional prefix argument specifies number of days."
+Optional prefix argument ARG specifies number of days.  The calendar shows
+the hours between `cal-tex-daily-start' and `cal-tex-daily-end', using
+the 24-hour clock if `cal-tex-24' is non-nil."
   (interactive "p")
-  (let ((n (if arg arg 1))
+  (let ((n (or arg 1))
         (date (calendar-absolute-from-gregorian (calendar-cursor-to-date t))))
     (cal-tex-preamble "12pt")
-    (cal-tex-cmd "\\textwidth       6.5in")
+    (cal-tex-cmd "\\textwidth 6.5in")
     (cal-tex-cmd "\\textheight 10.5in")
     (cal-tex-b-document)
     (cal-tex-cmd "\\pagestyle{empty}")
-    (calendar-for-loop i from 1 to n do
+    (dotimes (i n)
       (cal-tex-vspace "-1.7in")
       (cal-tex-daily-page (calendar-gregorian-from-absolute date))
       (setq date (1+ date))
-      (if (/= i n)
-          (progn
-            (cal-tex-newpage)
-            (run-hooks 'cal-tex-daily-hook))))
+      (unless (= i (1- n))
+        (cal-tex-newpage)
+        (run-hooks 'cal-tex-daily-hook)))
     (cal-tex-end-document)
     (run-hooks 'cal-tex-hook)))
 
@@ -1407,8 +1378,8 @@ Optional prefix argument specifies number of days."
 Uses the 24-hour clock if `cal-tex-24' is non-nil.  Produces
 hourly sections for the period specified by `cal-tex-daily-start'
 and `cal-tex-daily-end'."
-  (let* ((hour)
-         (month-name (cal-tex-month-name (extract-calendar-month date))))
+  (let ((month-name (cal-tex-month-name (extract-calendar-month date)))
+        hour)
     (cal-tex-banner "cal-tex-daily-page")
     (cal-tex-b-makebox "4cm" "l")
     (cal-tex-b-parbox "b" "3.8cm")
@@ -1434,7 +1405,7 @@ and `cal-tex-daily-end'."
        (setq hour (if cal-tex-24
                       i
                     (mod i 12)))
-       (if (= 0 hour) (setq hour 12))
+       (if (zerop hour) (setq hour 12))
        (cal-tex-b-makebox "1cm" "c")
        (cal-tex-arg (number-to-string hour))
        (cal-tex-e-makebox)
@@ -1475,47 +1446,50 @@ and `cal-tex-daily-end'."
 
 (defun cal-tex-mini-calendar (month year name width height &optional ptsize colsep)
   "Produce mini-calendar for MONTH, YEAR in macro NAME with WIDTH and HEIGHT.
-Optional PTSIZE gives the point ptsize; scriptsize is the default.  Optional
-COLSEP gives the column separation; 1mm is the default."
-  (let* ((blank-days;; at start of month
-          (mod
-           (- (calendar-day-of-week (list month 1 year))
-              calendar-week-start-day)
-           7))
-          (last (calendar-last-day-of-month month year))
-         (colsep (if colsep colsep "1mm"))
-         (str (concat "\\def\\" name "{\\hbox to" width "{%\n"
-                      "\\vbox to" height "{%\n"
-                      "\\vfil  \\hbox to" width "{%\n"
-                      "\\hfil\\"
-                      (if ptsize ptsize "scriptsize")
-                      "\\begin{tabular}"
-                      "{@{\\hspace{0mm}}r@{\\hspace{" colsep
-                      "}}r@{\\hspace{" colsep "}}r@{\\hspace{" colsep
-                      "}}r@{\\hspace{" colsep "}}r@{\\hspace{" colsep
-                      "}}r@{\\hspace{" colsep "}}r@{\\hspace{0mm}}}%\n"
-                      "\\multicolumn{7}{c}{"
-                      (cal-tex-month-name month)
-                      " "
-                      (int-to-string year)
-                      "}\\\\[1mm]\n")))
-    (calendar-for-loop i from 0 to 6 do
+Optional string PTSIZE gives the point size (default \"scriptsize\").
+Optional string COLSEP gives the column separation (default \"1mm\")."
+  (or colsep (setq colsep "1mm"))
+  (or ptsize (setq ptsize "scriptsize"))
+  (let ((blank-days                     ; at start of month
+         (mod
+          (- (calendar-day-of-week (list month 1 year))
+             calendar-week-start-day)
+          7))
+        (last (calendar-last-day-of-month month year))
+        (str (concat "\\def\\" name "{\\hbox to" width "{%\n"
+                     "\\vbox to" height "{%\n"
+                     "\\vfil  \\hbox to" width "{%\n"
+                     "\\hfil\\" ptsize
+                     "\\begin{tabular}"
+                     "{@{\\hspace{0mm}}r@{\\hspace{" colsep
+                     "}}r@{\\hspace{" colsep "}}r@{\\hspace{" colsep
+                     "}}r@{\\hspace{" colsep "}}r@{\\hspace{" colsep
+                     "}}r@{\\hspace{" colsep "}}r@{\\hspace{0mm}}}%\n"
+                     "\\multicolumn{7}{c}{"
+                     (cal-tex-month-name month)
+                     " "
+                     (int-to-string year)
+                     "}\\\\[1mm]\n")))
+    (dotimes (i 7)
       (setq str
             (concat str
                     (cal-tex-LaTeXify-string
                      (substring (aref calendar-day-name-array
                                       (mod (+ calendar-week-start-day i) 7))
+
                                 0 2))
-                    (if (/= i 6)
-                        " & "
-                      "\\\\[0.7mm]\n"))))
-    (calendar-for-loop i from 1 to blank-days do
+                    (if (= i 6)
+                        "\\\\[0.7mm]\n"
+                      " & "))))
+    (dotimes (idummy blank-days)
       (setq str (concat str " & ")))
-    (calendar-for-loop i from 1 to last do
-                       (setq str (concat str (int-to-string i)))
-                       (setq str (concat str (if (zerop (mod (+ i blank-days) 7))
-                                                 (if (/= i last) "\\\\[0.5mm]\n" "")
-                                               " & "))))
+    (dotimes (i last)
+      (setq str (concat str (int-to-string (1+ i)))
+            str (concat str (if (zerop (mod (+ i 1 blank-days) 7))
+                                (if (= i (1- last))
+                                    ""
+                                  "\\\\[0.5mm]\n")
+                              " & "))))
     (setq str (concat str "\n\\end{tabular}\\hfil}\\vfil}}}%\n"))
     str))
 
@@ -1527,40 +1501,38 @@ COLSEP gives the column separation; 1mm is the default."
   "The date of the day following DATE.
 If optional N is given, the date of N days after DATE."
   (calendar-gregorian-from-absolute
-   (+ (if n n 1) (calendar-absolute-from-gregorian date))))
+   (+ (or n 1) (calendar-absolute-from-gregorian date))))
 
 (defun cal-tex-latexify-list (date-list date &optional separator final-separator)
-  "Return string with concatenated, LaTeXified entries in DATE-LIST for DATE.
+  "Return string with concatenated, LaTeX-ified entries in DATE-LIST for DATE.
 Use double backslash as a separator unless optional SEPARATOR is given.
 If resulting string is not empty, put separator at end if optional
-FINAL-SEPARATOR is t."
-  (let* ((sep (if separator separator "\\\\"))
-         (result
-          (mapconcat '(lambda (x) (cal-tex-LaTeXify-string  x))
-                     (let ((result)
-                           (p date-list))
-                       (while p
-                         (and (car (car p))
-                              (calendar-date-equal date (car (car p)))
-                              (setq result (cons (car (cdr (car p))) result)))
-                         (setq p (cdr p)))
-                       (reverse result))
-                     sep)))
-    (if (and final-separator (not (string-equal result "")))
-          (concat result sep)
-        result)))
+FINAL-SEPARATOR is non-nil."
+  (or separator (setq separator "\\\\"))
+  (let (result)
+    (setq result
+          (mapconcat (lambda (x) (cal-tex-LaTeXify-string x))
+                     (dolist (d date-list (reverse result))
+                       (and (car d)
+                            (calendar-date-equal date (car d))
+                            (setq result (cons (cadr d) result))))
+                     separator))
+    (if (and final-separator
+             (not (string-equal result "")))
+        (concat result separator)
+      result)))
 
 (defun cal-tex-previous-month (date)
   "Return the date of the first day in the month previous to DATE."
-  (let* ((month (extract-calendar-month date))
-         (year (extract-calendar-year date)))
+  (let ((month (extract-calendar-month date))
+        (year (extract-calendar-year date)))
     (increment-calendar-month month year -1)
     (list month 1 year)))
 
 (defun cal-tex-next-month (date)
-  "Return the date of the first day in the  month following DATE."
-  (let* ((month (extract-calendar-month date))
-         (year (extract-calendar-year date)))
+  "Return the date of the first day in the month following DATE."
+  (let ((month (extract-calendar-month date))
+        (year (extract-calendar-year date)))
     (increment-calendar-month month year 1)
     (list month 1 year)))
 
@@ -1576,40 +1548,39 @@ informative header, and run HOOK."
   (latex-mode)
   (pop-to-buffer cal-tex-buffer)
   (goto-char (point-min))
-  (cal-tex-comment "       This buffer was produced by cal-tex.el.")
-  (cal-tex-comment "       To print a calendar, type")
-  (cal-tex-comment "          M-x tex-buffer RET")
-  (cal-tex-comment "          M-x tex-print  RET")
-  (goto-char (point-min)))
+  ;; FIXME auctex equivalents?
+  (cal-tex-comment
+   (format "\tThis buffer was produced by cal-tex.el.
+\tTo print a calendar, type
+\t\tM-x tex-buffer RET
+\t\tM-x tex-print  RET")))
 
 (defun cal-tex-insert-preamble (weeks landscape size &optional append)
-  "Initialize the output buffer.
-Select the output buffer, and insert the preamble for a calendar of
-WEEKS weeks.  Insert code for landscape mode if LANDSCAPE is true.
-Use pointsize SIZE.  Optional argument APPEND, if t, means add to end of
-without erasing current contents."
+  "Initialize the output LaTeX calendar buffer, `cal-tex-buffer'.
+Select the output buffer, and insert the preamble for a calendar
+of WEEKS weeks.  Insert code for landscape mode if LANDSCAPE is
+non-nil.  Use pointsize SIZE.  Optional argument APPEND, if
+non-nil, means add to end of buffer without erasing current contents."
   (let ((width "18cm")
         (height "24cm"))
-    (if landscape
-        (progn
-          (setq width "24cm")
-          (setq height "18cm")))
-    (if (not append)
-        (progn
-          (cal-tex-preamble size)
-          (if (not landscape)
-            (progn
-              (cal-tex-cmd "\\oddsidemargin -1.75cm")
-              (cal-tex-cmd "\\def\\holidaymult{.06}"))
-            (cal-tex-cmd "\\special{landscape}")
-            (cal-tex-cmd "\\textwidth  9.5in")
-            (cal-tex-cmd "\\textheight 7in")
-            (cal-tex-comment)
-            (cal-tex-cmd "\\def\\holidaymult{.08}"))
-          (cal-tex-cmd  cal-tex-caldate)
-          (cal-tex-cmd  cal-tex-myday)
-          (cal-tex-b-document)
-          (cal-tex-cmd "\\pagestyle{empty}")))
+    (when landscape
+      (setq width "24cm"
+            height "18cm"))
+    (unless append
+      (cal-tex-preamble size)
+      (if (not landscape)
+          (progn
+            (cal-tex-cmd "\\oddsidemargin -1.75cm")
+            (cal-tex-cmd "\\def\\holidaymult{.06}"))
+        (cal-tex-cmd "\\special{landscape}")
+        (cal-tex-cmd "\\textwidth 9.5in")
+        (cal-tex-cmd "\\textheight 7in")
+        (cal-tex-comment)
+        (cal-tex-cmd "\\def\\holidaymult{.08}"))
+      (cal-tex-cmd cal-tex-caldate)
+      (cal-tex-cmd cal-tex-myday)
+      (cal-tex-b-document)
+      (cal-tex-cmd "\\pagestyle{empty}"))
     (cal-tex-cmd "\\setlength{\\cellwidth}" width)
     (insert (format "\\setlength{\\cellwidth}{%f\\cellwidth}\n"
                     (/ 1.1 (length cal-tex-which-days))))
@@ -1619,10 +1590,12 @@ without erasing current contents."
     (cal-tex-cmd "\\ \\par")
     (cal-tex-vspace "-3cm")))
 
-(defvar cal-tex-LaTeX-subst-list
+(defconst cal-tex-LaTeX-subst-list
   '(("\"". "``")
-    ("\"". "''");; Quote changes meaning when list is reversed.
-    ("@" . "\\verb|@|")
+    ("\"". "''")        ; quote changes meaning when list is reversed
+    ;; Don't think this is necessary, and in any case, does not work:
+    ;; "LaTeX Error: \verb illegal in command argument".
+;;;    ("@" . "\\verb|@|")
     ("&" . "\\&")
     ("%" . "\\%")
     ("$" . "\\$")
@@ -1632,8 +1605,8 @@ without erasing current contents."
     ("}" . "\\}")
     ("<" . "$<$")
     (">" . "$>$")
-    ("\n" . "\\ \\\\"))  ;\\ needed for e.g \begin{center}\n AA\end{center}
-  "List of symbols and their replacements.")
+    ("\n" . "\\ \\\\")) \\ needed for e.g \begin{center}\n AA\end{center}
+  "Alist of symbols and their LaTeX replacements.")
 
 (defun cal-tex-LaTeXify-string (string)
   "Protect special characters in STRING from LaTeX."
@@ -1643,23 +1616,29 @@ without erasing current contents."
           (tail string)
           (list cal-tex-LaTeX-subst-list))
       (while (not (string-equal tail ""))
-        (let* ((ch (substring tail 0 1))
+        (let* ((ch (substring-no-properties tail 0 1))
                (pair (assoc ch list)))
           (if (and pair (string-equal ch "\""))
-              (setq list (reverse list)));; Quote changes meaning each time.
-          (setq tail (substring tail 1))
-          (setq head (concat head (if pair (cdr pair) ch)))))
+              (setq list (reverse list))) ; quote changes meaning each time
+          (setq tail (substring-no-properties tail 1)
+                head (concat head (if pair (cdr pair) ch)))))
       head)))
 
 (defun cal-tex-month-name (month)
   "The name of MONTH, LaTeXified."
   (cal-tex-LaTeXify-string (calendar-month-name month)))
 
-(defun cal-tex-hfill () "Insert hfill." (insert "\\hfill"))
+(defun cal-tex-hfill ()
+  "Insert hfill."
+  (insert "\\hfill"))
 
-(defun cal-tex-newpage () "Insert newpage." (insert "\\newpage%\n"))
+(defun cal-tex-newpage ()
+  "Insert newpage."
+  (insert "\\newpage%\n"))
 
-(defun cal-tex-noindent () "Insert noindent." (insert "\\noindent"))
+(defun cal-tex-noindent ()
+  "Insert noindent."
+  (insert "\\noindent"))
 
 (defun cal-tex-vspace (space)
   "Insert vspace command to move SPACE vertically."
@@ -1672,37 +1651,32 @@ without erasing current contents."
   (cal-tex-comment))
 
 (defun cal-tex-comment (&optional comment)
-  "Insert % at end of line, include COMMENT if present, and move
-   to next line."
-  (insert "% ")
-  (if comment
-      (insert comment))
-  (insert "\n"))
+  "Insert `% ', followed by optional string COMMENT, followed by newline.
+COMMENT may contain newlines, which are prefixed by `% ' in the output."
+  (insert (format "%% %s\n"
+                  (if comment
+                      (replace-regexp-in-string "\n" "\n% " comment)
+                    ""))))
 
 (defun cal-tex-banner (comment)
-  "Insert the COMMENT separated by blank lines."
-  (cal-tex-comment)
-  (cal-tex-comment)
-  (cal-tex-comment (concat "\t\t\t" comment))
-  (cal-tex-comment))
-
+  "Insert string COMMENT, separated by blank lines."
+  (cal-tex-comment (format "\n\n\n\t\t\t%s\n" comment)))
 
 (defun cal-tex-nl (&optional skip comment)
   "End a line with \\.  If SKIP, then add that much spacing.
-   Add COMMENT if present"
-  (insert "\\\\")
-  (if skip
-      (insert "[" skip "]"))
+Add trailing COMMENT if present."
+  (insert (format "\\\\%s"
+                  (if skip
+                      (format "[%s]" skip)
+                    "")))
   (cal-tex-comment comment))
 
 (defun cal-tex-arg (&optional text)
-  "Insert optional TEXT surrounded by braces."
-  (insert "{")
-  (if text (insert text))
-  (insert "}"))
+  "Insert a brace {} pair containing the optional string TEXT."
+  (insert (format "{%s}" (or text ""))))
 
 (defun cal-tex-cmd (cmd &optional arg)
-  "Insert LaTeX CMD, with optional ARG, and end with %"
+  "Insert LaTeX CMD, with optional argument ARG, and end with %."
   (insert cmd)
   (cal-tex-arg arg)
   (cal-tex-comment))
@@ -1740,15 +1714,15 @@ without erasing current contents."
   (cal-tex-comment))
 
 (defun cal-tex-e-parbox (&optional height)
-  "Insert end of parbox. Force it to be a given HEIGHT."
+  "Insert end of parbox.  Optionally, force it to be a given HEIGHT."
   (cal-tex-comment)
   (if height
       (cal-tex-rule "0mm" "0mm" height))
   (insert "}")
   (cal-tex-comment "end parbox"))
 
-(defun cal-tex-b-framebox ( width position )
-  "Insert  framebox with parameters WIDTH and POSITION (clr)."
+(defun cal-tex-b-framebox (width position)
+  "Insert framebox with parameters WIDTH and POSITION (clr)."
   (insert "\\framebox[" width "][" position "]{" )
   (cal-tex-comment))
 
@@ -1760,7 +1734,7 @@ without erasing current contents."
 
 
 (defun cal-tex-b-makebox ( width position )
-  "Insert  makebox with parameters WIDTH and POSITION (clr)."
+  "Insert makebox with parameters WIDTH and POSITION (clr)."
   (insert "\\makebox[" width "][" position "]{" )
   (cal-tex-comment))
 
@@ -1780,36 +1754,37 @@ without erasing current contents."
 ;;;
 
 (defun cal-tex-em (string)
-  "Insert STRING in bf font."
-  (insert "{\\em " string "}"))
+  "Insert STRING in italic font."
+  (insert "\\textit{" string "}"))
 
 (defun cal-tex-bf (string)
   "Insert STRING in bf font."
-  (insert "{\\bf " string "}"))
+  (insert "\\textbf{ " string "}"))
 
 (defun cal-tex-scriptsize (string)
   "Insert STRING in scriptsize font."
   (insert "{\\scriptsize " string "}"))
 
 (defun cal-tex-huge (string)
-  "Insert STRING in huge size."
+  "Insert STRING in huge font."
   (insert "{\\huge " string "}"))
 
 (defun cal-tex-Huge (string)
-  "Insert STRING in Huge size."
+  "Insert STRING in Huge font."
   (insert "{\\Huge " string "}"))
 
 (defun cal-tex-Huge-bf (string)
-  "Insert STRING in Huge bf size."
-  (insert "{\\Huge\\bf " string "}"))
+  "Insert STRING in Huge bf font."
+  (insert "\\textbf{\\Huge " string "}"))
 
 (defun cal-tex-large (string)
-  "Insert STRING in large size."
+  "Insert STRING in large font."
   (insert "{\\large " string "}"))
 
 (defun cal-tex-large-bf (string)
-  "Insert STRING in large bf size."
-  (insert "{\\large\\bf  " string "}"))
+  "Insert STRING in large bf font."
+  (insert "\\textbf{\\large " string "}"))
+
 
 (provide 'cal-tex)
 
index b6a77bb..24b1f89 100644 (file)
@@ -164,5 +164,5 @@ This function requires a display capable of multiple frames, else
 
 (provide 'cal-x)
 
-;;; arch-tag: c6dbddca-ae84-442d-87fc-244b76e38e17
+;; arch-tag: c6dbddca-ae84-442d-87fc-244b76e38e17
 ;;; cal-x.el ends here
index 330cf85..ea49577 100644 (file)
@@ -1343,7 +1343,9 @@ MON defaults to `displayed-month'.  YR defaults to `displayed-year'."
   (cons mon yr))
 
 (defmacro calendar-for-loop (var from init to final do &rest body)
-  "Execute a for loop."
+  "Execute a for loop.
+Evaluate BODY with VAR bound to successive integers from INIT to FINAL,
+inclusive."
   (declare (debug (symbolp "from" form "to" form "do" body)))
   `(let ((,var (1- ,init)))
     (while (>= ,final (setq ,var (1+ ,var)))
@@ -1491,19 +1493,19 @@ return negative results."
   "Move the cursor backward ARG years."
   t)
 
-(autoload 'scroll-calendar-left "cal-move"
+(autoload 'calendar-scroll-left "cal-move"
   "Scroll the displayed calendar left by ARG months."
   t)
 
-(autoload 'scroll-calendar-right "cal-move"
+(autoload 'calendar-scroll-right "cal-move"
   "Scroll the displayed calendar window right by ARG months."
   t)
 
-(autoload 'scroll-calendar-left-three-months "cal-move"
+(autoload 'calendar-scroll-left-three-months "cal-move"
   "Scroll the displayed calendar window left by 3*ARG months."
   t)
 
-(autoload 'scroll-calendar-right-three-months "cal-move"
+(autoload 'calendar-scroll-right-three-months "cal-move"
   "Scroll the displayed calendar window right by 3*ARG months."
   t)
 
@@ -1675,8 +1677,10 @@ to be replaced by asterisks to highlight it whenever it is in the window."
     ;; (calendar-read-date t) returns a date with day = nil, which is
     ;; not a legal date for the visible test in the diary section.
     (if arg (setcar (cdr date) 1))
-    (pop-to-buffer calendar-buffer)
     (increment-calendar-month month year (- calendar-offset))
+    ;; Display the buffer before calling generate-calendar-window so that it
+    ;; can get a chance to adjust the window sizes to the frame size.
+    (pop-to-buffer calendar-buffer)
     (generate-calendar-window month year)
     (if (and view-diary-entries-initially (calendar-date-is-visible-p date))
         (diary-view-entries)))
@@ -2056,7 +2060,7 @@ existing output files are overwritten." t)
 (defun generate-calendar-window (&optional mon yr)
   "Generate the calendar window for the current date.
 Or, for optional MON, YR."
-  (let* ((buffer-read-only nil)
+  (let* ((inhibit-read-only t)
          (today (calendar-current-date))
          (month (extract-calendar-month today))
          (day (extract-calendar-day today))
@@ -2068,10 +2072,8 @@ Or, for optional MON, YR."
          (day-in-week (calendar-day-of-week today))
          (in-calendar-window (eq (window-buffer (selected-window))
                                  (get-buffer calendar-buffer))))
+    (generate-calendar (or mon month) (or yr year))
     (update-calendar-mode-line)
-    (if mon
-        (generate-calendar mon yr)
-      (generate-calendar month year))
     (calendar-cursor-to-visible-date
      (if today-visible today (list displayed-month 1 displayed-year)))
     (set-buffer-modified-p nil)
@@ -2100,19 +2102,19 @@ Or, for optional MON, YR."
 
 (defun generate-calendar (month year)
   "Generate a three-month Gregorian calendar centered around MONTH, YEAR."
-;;; A negative YEAR is interpreted as BC; -1 being 1 BC, and so on.
-;;; Note that while calendars for years BC could be displayed as it
-;;; stands, almost all other calendar functions (eg holidays) would
-;;; at best have unpredictable results for such dates.
+  ;; A negative YEAR is interpreted as BC; -1 being 1 BC, and so on.
+  ;; Note that while calendars for years BC could be displayed as it
+  ;; stands, almost all other calendar functions (eg holidays) would
+  ;; at best have unpredictable results for such dates.
   (if (< (+ month (* 12 (1- year))) 2)
       (error "Months before January, 1 AD cannot be displayed"))
   (setq displayed-month month
         displayed-year year)
   (erase-buffer)
   (increment-calendar-month month year -1)
-  (calendar-for-loop i from 0 to 2 do
-       (generate-calendar-month month year (+ 5 (* 25 i)))
-       (increment-calendar-month month year 1)))
+  (dotimes (i 3)
+    (generate-calendar-month month year (+ 5 (* 25 i)))
+    (increment-calendar-month month year 1)))
 
 (defun generate-calendar-month (month year indent)
   "Produce a calendar for MONTH, YEAR on the Gregorian calendar.
@@ -2133,18 +2135,18 @@ line."
     indent t)
    (calendar-insert-indented "" indent);; Go to proper spot
    ;; Use the first two characters of each day to head the columns.
-   (calendar-for-loop i from 0 to 6 do
-      (insert
-       (let ((string
-              (calendar-day-name (mod (+ calendar-week-start-day i) 7) nil t)))
-         (if enable-multibyte-characters
-             (truncate-string-to-width string 2)
-           (substring string 0 2)))
-       " "))
+   (dotimes (i 7)
+     (insert
+      (let ((string
+             (calendar-day-name (mod (+ calendar-week-start-day i) 7) nil t)))
+        (if enable-multibyte-characters
+            (truncate-string-to-width string 2)
+          (substring string 0 2)))
+      " "))
    (calendar-insert-indented "" 0 t);; Force onto following line
    (calendar-insert-indented "" indent);; Go to proper spot
    ;; Add blank days before the first of the month
-   (calendar-for-loop i from 1 to blank-days do (insert "   "))
+   (dotimes (idummy blank-days) (insert "   "))
    ;; Put in the days of the month
    (calendar-for-loop i from 1 to last do
       (insert (format "%2d " i))
@@ -2210,9 +2212,9 @@ movement commands will not work correctly."
   :type 'boolean
   :group 'calendar)
 
-(defvar calendar-mode-map nil)
-(if calendar-mode-map
-    nil
+(require 'cal-menu)
+
+(defvar calendar-mode-map
   (let ((map (make-keymap)))
     (suppress-keymap map)
     (dolist (c '(narrow-to-region mark-word mark-sexp mark-paragraph
@@ -2220,14 +2222,14 @@ movement commands will not work correctly."
                  downcase-region upcase-region kill-region
                  copy-region-as-kill capitalize-region write-region))
       (define-key map (vector 'remap c) 'calendar-not-implemented))
-    (define-key map "<"     'scroll-calendar-right)
-    (define-key map "\C-x<" 'scroll-calendar-right)
-    (define-key map [prior] 'scroll-calendar-right-three-months)
-    (define-key map "\ev"   'scroll-calendar-right-three-months)
-    (define-key map ">"     'scroll-calendar-left)
-    (define-key map "\C-x>" 'scroll-calendar-left)
-    (define-key map [next]  'scroll-calendar-left-three-months)
-    (define-key map "\C-v"  'scroll-calendar-left-three-months)
+    (define-key map "<"     'calendar-scroll-right)
+    (define-key map "\C-x<" 'calendar-scroll-right)
+    (define-key map [prior] 'calendar-scroll-right-three-months)
+    (define-key map "\ev"   'calendar-scroll-right-three-months)
+    (define-key map ">"     'calendar-scroll-left)
+    (define-key map "\C-x>" 'calendar-scroll-left)
+    (define-key map [next]  'calendar-scroll-left-three-months)
+    (define-key map "\C-v"  'calendar-scroll-left-three-months)
     (define-key map "\C-b"  'calendar-backward-day)
     (define-key map "\C-p"  'calendar-backward-week)
     (define-key map "\e{"   'calendar-backward-month)
@@ -2248,7 +2250,7 @@ movement commands will not work correctly."
     (define-key map "\e>"   'calendar-end-of-year)
     (define-key map "\C-@"  'calendar-set-mark)
     ;; Many people are used to typing C-SPC and getting C-@.
-    (define-key map [?\C- ] 'calendar-set-mark)
+    (define-key map [?\C-\s] 'calendar-set-mark)
     (define-key map "\C-x\C-x" 'calendar-exchange-point-and-mark)
     (define-key map "\e=" 'calendar-count-days-region)
     (define-key map "gd"  'calendar-goto-date)
@@ -2336,9 +2338,26 @@ movement commands will not work correctly."
     (define-key map "tfy" 'cal-tex-cursor-filofax-year)
     (define-key map "ty" 'cal-tex-cursor-year)
     (define-key map "tY" 'cal-tex-cursor-year-landscape)
-    (setq calendar-mode-map map)
-    ;; Require cal-menu after initializing calendar-mode-map because it uses it.
-    (require 'cal-menu)))
+
+    (define-key map [menu-bar edit] 'undefined)
+    (define-key map [menu-bar search] 'undefined)
+    ;; This ignores the mouse-up event after the mouse-down that pops up the
+    ;; context menu.  It should not be necessary because the mouse-up event
+    ;; should be eaten up by the menu-handling toolkit.
+    ;; (define-key map [mouse-2] 'ignore)
+
+    (easy-menu-define nil map nil cal-menu-moon-menu)
+    (easy-menu-define nil map nil cal-menu-diary-menu)
+    (easy-menu-define nil map nil cal-menu-holidays-menu)
+    (easy-menu-define nil map nil cal-menu-goto-menu)
+    (easy-menu-define nil map nil cal-menu-scroll-menu)
+  
+    (define-key map [down-mouse-3]
+      (easy-menu-binding cal-menu-context-mouse-menu))
+    (define-key map [down-mouse-2]
+      (easy-menu-binding cal-menu-global-mouse-menu))
+
+    map))
 
 (defun describe-calendar-mode ()
   "Create a help buffer with a brief description of the `calendar-mode'."
@@ -2362,7 +2381,7 @@ movement commands will not work correctly."
               'help-echo "mouse-1: previous month"
               'mouse-face 'mode-line-highlight
               'keymap (make-mode-line-mouse-map 'mouse-1
-                                                'mouse-scroll-calendar-right))
+                                                'calendar-scroll-right))
    "Calendar"
    (concat
     (propertize
@@ -2391,7 +2410,7 @@ movement commands will not work correctly."
               'help-echo "mouse-1: next month"
               'mouse-face 'mode-line-highlight
               'keymap (make-mode-line-mouse-map
-                       'mouse-1 'mouse-scroll-calendar-left)))
+                       'mouse-1 'calendar-scroll-left)))
   "The mode line of the calendar buffer.
 
 This must be a list of items that evaluate to strings--those strings are
@@ -2399,8 +2418,8 @@ evaluated and concatenated together, evenly separated by blanks.  The variable
 `date' is available for use as the date under (or near) the cursor; `date'
 defaults to the current date if it is otherwise undefined.  Here is an example
 value that has the Hebrew date, the day number/days remaining in the year,
-and the ISO week/year numbers in the mode.  When calendar-move-hook is set to
-'update-calendar-mode-line, these mode line shows these values for the date
+and the ISO week/year numbers in the mode.  When `calendar-move-hook' is set
+to `update-calendar-mode-line', these mode line shows these values for the date
 under the cursor:
 
       (list
@@ -2416,26 +2435,7 @@ under the cursor:
           (format \"ISO week %d of %d\"
             (extract-calendar-month iso-date)
             (extract-calendar-year iso-date)))
-       \"\"))
-")
-
-(defun mouse-scroll-calendar-left (event)
-  "Scroll the displayed calendar left by one month.
-Maintains the relative position of the cursor
-with respect to the calendar as well as possible."
-  (interactive "e")
-  (save-selected-window
-    (select-window (posn-window (event-start event)))
-    (scroll-calendar-left 1)))
-
-(defun mouse-scroll-calendar-right (event)
-  "Scroll the displayed calendar right by one month.
-Maintains the relative position of the cursor
-with respect to the calendar as well as possible."
-  (interactive "e")
-  (save-selected-window
-    (select-window (posn-window (event-start event)))
-    (scroll-calendar-right 1)))
+       \"\"))")
 
 (defun mouse-calendar-other-month (event)
   "Display a three-month calendar centered around a specified month and year."
@@ -2472,10 +2472,14 @@ For a complete description, type \
   (setq buffer-read-only t)
   (setq indent-tabs-mode nil)
   (update-calendar-mode-line)
-  (add-hook 'activate-menubar-hook 'cal-menu-update nil t)
   (make-local-variable 'calendar-mark-ring)
-  (make-local-variable 'displayed-month);;  Month in middle of window.
-  (make-local-variable 'displayed-year)        ;;  Year in middle of window.
+  (make-local-variable 'displayed-month) ;; Month in middle of window.
+  (make-local-variable 'displayed-year)  ;; Year in middle of window.
+  ;; Most functions only work if displayed-month and displayed-year are set,
+  ;; so let's make sure they're always set.  Most likely, this will be reset
+  ;; soon in generate-calendar, but better safe than sorry.
+  (unless (boundp 'displayed-month) (setq displayed-month 1))
+  (unless (boundp 'displayed-year)  (setq displayed-year  2001))
   (set (make-local-variable 'font-lock-defaults)
        '(calendar-font-lock-keywords t))
   (run-mode-hooks 'calendar-mode-hook))
@@ -2596,7 +2600,7 @@ ERROR is t, otherwise just returns nil."
              (< 2 (count-lines (point-min) (point))))
         (save-excursion
           (if (not (looking-at " "))
-                   (re-search-backward "[^0-9]"))
+              (re-search-backward "[^0-9]"))
           (list month
                 (string-to-number (buffer-substring (1+ (point)) (+ 4 (point))))
                 year))
index 88589c7..09034ab 100644 (file)
@@ -461,95 +461,94 @@ If LIST-ONLY is non-nil don't modify or display the buffer, only return a list."
                     (set (make-local-variable 'diary-selective-display) t)
                     (overlay-put ol 'invisible 'diary)
                     (overlay-put ol 'evaporate t)))
-                (calendar-for-loop
-                 i from 1 to number do
-                 (let ((month (extract-calendar-month date))
-                       (day (extract-calendar-day date))
-                       (year (extract-calendar-year date))
-                       (entry-found (list-sexp-diary-entries date)))
-                   (dolist (date-form diary-date-forms)
-                     (let*
-                         ((backup (when (eq (car date-form) 'backup)
-                                    (setq date-form (cdr date-form))
-                                    t))
-                          (dayname
-                           (format "%s\\|%s\\.?"
-                                   (calendar-day-name date)
-                                   (calendar-day-name date 'abbrev)))
-                          (monthname
-                           (format "\\*\\|%s\\|%s\\.?"
-                                   (calendar-month-name month)
-                                   (calendar-month-name month 'abbrev)))
-                          (month (concat "\\*\\|0*" (int-to-string month)))
-                          (day (concat "\\*\\|0*" (int-to-string day)))
-                          (year
-                           (concat
-                            "\\*\\|0*" (int-to-string year)
-                            (if abbreviated-calendar-year
-                                (concat "\\|" (format "%02d" (% year 100)))
-                              "")))
-                          (regexp
-                           (concat
-                            "\\(\\`\\|\^M\\|\n\\)" mark "?\\("
-                            (mapconcat 'eval date-form "\\)\\(?:")
-                            "\\)"))
-                          (case-fold-search t))
-                       (goto-char (point-min))
-                       (while (re-search-forward regexp nil t)
-                         (if backup (re-search-backward "\\<" nil t))
-                         (if (and (or (char-equal (preceding-char) ?\^M)
-                                      (char-equal (preceding-char) ?\n))
-                                  (not (looking-at " \\|\^I")))
-                             ;;  Diary entry that consists only of date.
-                             (backward-char 1)
-                           ;; Found a nonempty diary entry--make it
-                           ;; visible and add it to the list.
-                           (setq entry-found t)
-                           (let ((entry-start (point))
-                                 date-start temp)
-                             (re-search-backward "\^M\\|\n\\|\\`")
-                             (setq date-start (point))
-                             ;; When selective display (rather than
-                             ;; overlays) was used, diary file used to
-                             ;; start in a blank line and end in a
-                             ;; newline. Now that neither of these
-                             ;; need be true, 'move handles the latter
-                             ;; and 1/2 kludge the former.
-                             (re-search-forward
-                              "\^M\\|\n" nil 'move
-                              (if (and (bobp) (not (looking-at "\^M\\|\n")))
-                                  1
-                                2))
-                             (while (looking-at " \\|\^I")
-                               (re-search-forward "\^M\\|\n" nil 'move))
-                             (unless (and (eobp) (not (bolp)))
-                               (backward-char 1))
-                             (unless list-only
-                               (remove-overlays date-start (point)
-                                                'invisible 'diary))
-                             (setq entry (buffer-substring entry-start (point))
-                                   temp (diary-pull-attrs entry file-glob-attrs)
-                                   entry (nth 0 temp))
-                             (add-to-diary-list
-                              date
-                              entry
-                              (buffer-substring
-                               (1+ date-start) (1- entry-start))
-                              (copy-marker entry-start) (nth 1 temp)))))))
-                   (or entry-found
-                       (not diary-list-include-blanks)
-                       (add-to-diary-list date "" "" "" ""))
-                   (setq date
-                         (calendar-gregorian-from-absolute
-                          (1+ (calendar-absolute-from-gregorian date))))
-                   (setq entry-found nil)))))
+                (dotimes (idummy number)
+                  (let ((month (extract-calendar-month date))
+                        (day (extract-calendar-day date))
+                        (year (extract-calendar-year date))
+                        (entry-found (list-sexp-diary-entries date)))
+                    (dolist (date-form diary-date-forms)
+                      (let*
+                          ((backup (when (eq (car date-form) 'backup)
+                                     (setq date-form (cdr date-form))
+                                     t))
+                           (dayname
+                            (format "%s\\|%s\\.?"
+                                    (calendar-day-name date)
+                                    (calendar-day-name date 'abbrev)))
+                           (monthname
+                            (format "\\*\\|%s\\|%s\\.?"
+                                    (calendar-month-name month)
+                                    (calendar-month-name month 'abbrev)))
+                           (month (concat "\\*\\|0*" (int-to-string month)))
+                           (day (concat "\\*\\|0*" (int-to-string day)))
+                           (year
+                            (concat
+                             "\\*\\|0*" (int-to-string year)
+                             (if abbreviated-calendar-year
+                                 (concat "\\|" (format "%02d" (% year 100)))
+                               "")))
+                           (regexp
+                            (concat
+                             "\\(\\`\\|\^M\\|\n\\)" mark "?\\("
+                             (mapconcat 'eval date-form "\\)\\(?:")
+                             "\\)"))
+                           (case-fold-search t))
+                        (goto-char (point-min))
+                        (while (re-search-forward regexp nil t)
+                          (if backup (re-search-backward "\\<" nil t))
+                          (if (and (or (char-equal (preceding-char) ?\^M)
+                                       (char-equal (preceding-char) ?\n))
+                                   (not (looking-at " \\|\^I")))
+                              ;;  Diary entry that consists only of date.
+                              (backward-char 1)
+                            ;; Found a nonempty diary entry--make it
+                            ;; visible and add it to the list.
+                            (setq entry-found t)
+                            (let ((entry-start (point))
+                                  date-start temp)
+                              (re-search-backward "\^M\\|\n\\|\\`")
+                              (setq date-start (point))
+                              ;; When selective display (rather than
+                              ;; overlays) was used, diary file used to
+                              ;; start in a blank line and end in a
+                              ;; newline. Now that neither of these
+                              ;; need be true, 'move handles the latter
+                              ;; and 1/2 kludge the former.
+                              (re-search-forward
+                               "\^M\\|\n" nil 'move
+                               (if (and (bobp) (not (looking-at "\^M\\|\n")))
+                                   1
+                                 2))
+                              (while (looking-at " \\|\^I")
+                                (re-search-forward "\^M\\|\n" nil 'move))
+                              (unless (and (eobp) (not (bolp)))
+                                (backward-char 1))
+                              (unless list-only
+                                (remove-overlays date-start (point)
+                                                 'invisible 'diary))
+                              (setq entry (buffer-substring entry-start (point))
+                                    temp (diary-pull-attrs entry file-glob-attrs)
+                                    entry (nth 0 temp))
+                              (add-to-diary-list
+                               date
+                               entry
+                               (buffer-substring
+                                (1+ date-start) (1- entry-start))
+                               (copy-marker entry-start) (nth 1 temp)))))))
+                    (or entry-found
+                        (not diary-list-include-blanks)
+                        (add-to-diary-list date "" "" "" ""))
+                    (setq date
+                          (calendar-gregorian-from-absolute
+                           (1+ (calendar-absolute-from-gregorian date))))
+                    (setq entry-found nil)))))
             (goto-char (point-min))
             (run-hooks 'nongregorian-diary-listing-hook
                        'list-diary-entries-hook)
             (unless list-only
               (if diary-display-hook
-                  (run-hooks 'diary-display-hook)
-                (simple-diary-display)))
+              (run-hooks 'diary-display-hook)
+              (simple-diary-display)))
             (run-hooks 'diary-hook)
             diary-entries-list))))))
 
@@ -1190,9 +1189,9 @@ A value of 0 in any position is a wildcard."
     (let ((m displayed-month)
           (y displayed-year))
       (increment-calendar-month m y -1)
-      (calendar-for-loop i from 0 to 2 do
-          (mark-calendar-month m y month day year color)
-          (increment-calendar-month m y 1)))))
+      (dotimes (idummy 3)
+        (mark-calendar-month m y month day year color)
+        (increment-calendar-month m y 1)))))
 
 (defun mark-calendar-month (month year p-month p-day p-year &optional color)
   "Mark dates in the MONTH/YEAR that conform to pattern P-MONTH/P_DAY/P-YEAR.
index dc8e6e8..0f64e85 100644 (file)
@@ -271,7 +271,7 @@ Search in the directories \"~\" and \"~/.emacs.d\", in this
 order.  Return nil if no start file found."
   (let* ((progname (file-name-nondirectory prog))
         (start-file (concat "~/.emacs_" progname))
-        (alt-start-file (concat "~/.emacs.d/init_" progname ".scm")))
+        (alt-start-file (concat user-emacs-directory "init_" progname ".scm")))
     (if (file-exists-p start-file)
         start-file
       (and (file-exists-p alt-start-file) alt-start-file))))
index 2abb362..23a78bb 100644 (file)
@@ -671,13 +671,13 @@ BUFFER can be either a buffer or the name of one."
   "Make a Comint process NAME in BUFFER, running PROGRAM.
 If BUFFER is nil, it defaults to NAME surrounded by `*'s.
 PROGRAM should be either a string denoting an executable program to create
-via `start-process', or a cons pair of the form (HOST . SERVICE) denoting a TCP
-connection to be opened via `open-network-stream'.  If there is already a
-running process in that buffer, it is not restarted.  Optional fourth arg
+via `start-file-process', or a cons pair of the form (HOST . SERVICE) denoting
+a TCP connection to be opened via `open-network-stream'.  If there is already
+running process in that buffer, it is not restarted.  Optional fourth arg
 STARTFILE is the name of a file to send the contents of to the process.
 
 If PROGRAM is a string, any more args are arguments to PROGRAM."
-  (or (fboundp 'start-process)
+  (or (fboundp 'start-file-process)
       (error "Multi-processing is not supported for this system"))
   (setq buffer (get-buffer-create (or buffer (concat "*" name "*"))))
   ;; If no process, or nuked process, crank up a new one and put buffer in
@@ -694,9 +694,9 @@ If PROGRAM is a string, any more args are arguments to PROGRAM."
   "Make a Comint process NAME in a buffer, running PROGRAM.
 The name of the buffer is made by surrounding NAME with `*'s.
 PROGRAM should be either a string denoting an executable program to create
-via `start-process', or a cons pair of the form (HOST . SERVICE) denoting a TCP
-connection to be opened via `open-network-stream'.  If there is already a
-running process in that buffer, it is not restarted.  Optional third arg
+via `start-file-process', or a cons pair of the form (HOST . SERVICE) denoting
+a TCP connection to be opened via `open-network-stream'.  If there is already
+running process in that buffer, it is not restarted.  Optional third arg
 STARTFILE is the name of a file to send the contents of the process to.
 
 If PROGRAM is a string, any more args are arguments to PROGRAM."
@@ -782,17 +782,17 @@ buffer.  The hook `comint-exec-hook' is run after each exec."
                         ;; If the command has slashes, make sure we
                         ;; first look relative to the current directory.
                         (cons default-directory exec-path) exec-path)))
-      (setq proc (apply 'start-process name buffer command switches)))
+      (setq proc (apply 'start-file-process name buffer command switches)))
     (let ((coding-systems (process-coding-system proc)))
       (setq decoding (car coding-systems)
            encoding (cdr coding-systems)))
-    ;; If start-process decided to use some coding system for decoding
+    ;; If start-file-process decided to use some coding system for decoding
     ;; data sent from the process and the coding system doesn't
     ;; specify EOL conversion, we had better convert CRLF to LF.
     (if (vectorp (coding-system-eol-type decoding))
        (setq decoding (coding-system-change-eol-conversion decoding 'dos)
              changed t))
-    ;; Even if start-process left the coding system for encoding data
+    ;; Even if start-file-process left the coding system for encoding data
     ;; sent from the process undecided, we had better use the same one
     ;; as what we use for decoding.  But, we should suppress EOL
     ;; conversion.
@@ -2811,7 +2811,7 @@ Returns t if successful."
 (defun comint-dynamic-complete-as-filename ()
   "Dynamically complete at point as a filename.
 See `comint-dynamic-complete-filename'.  Returns t if successful."
-  (let* ((completion-ignore-case (memq system-type '(ms-dos windows-nt cygwin)))
+  (let* ((completion-ignore-case read-file-name-completion-ignore-case)
         (completion-ignored-extensions comint-completion-fignore)
         ;; If we bind this, it breaks remote directory tracking in rlogin.el.
         ;; I think it was originally bound to solve file completion problems,
@@ -2940,7 +2940,7 @@ See also `comint-dynamic-complete-filename'."
 (defun comint-dynamic-list-filename-completions ()
   "List in help buffer possible completions of the filename at point."
   (interactive)
-  (let* ((completion-ignore-case (memq system-type '(ms-dos windows-nt cygwin)))
+  (let* ((completion-ignore-case read-file-name-completion-ignore-case)
         ;; If we bind this, it breaks remote directory tracking in rlogin.el.
         ;; I think it was originally bound to solve file completion problems,
         ;; but subsequent changes may have made this unnecessary.  sm.
index 4b4e478..75774b6 100644 (file)
@@ -153,11 +153,8 @@ If nil, means use the colon-separated path in the variable $INCPATH instead."
           (define-key completion-map " "       'minibuffer-complete-word)
           (define-key completion-map "?"       'minibuffer-completion-help)
 
-          (define-key must-match-map "\t"      'minibuffer-complete)
-          (define-key must-match-map " "       'minibuffer-complete-word)
           (define-key must-match-map "\r"      'minibuffer-complete-and-exit)
           (define-key must-match-map "\n"      'minibuffer-complete-and-exit)
-          (define-key must-match-map "?"       'minibuffer-completion-help)
 
           (define-key global-map [remap lisp-complete-symbol]  nil))
          (PC-default-bindings
@@ -173,17 +170,11 @@ If nil, means use the colon-separated path in the variable $INCPATH instead."
           (define-key completion-map "\e\n"    'PC-force-complete-and-exit)
           (define-key completion-map "\e?"     'PC-completion-help)
 
-          (define-key must-match-map "\t"      'PC-complete)
-          (define-key must-match-map " "       'PC-complete-word)
           (define-key must-match-map "\r"      'PC-complete-and-exit)
           (define-key must-match-map "\n"      'PC-complete-and-exit)
-          (define-key must-match-map "?"       'PC-completion-help)
 
-          (define-key must-match-map "\e\t"    'PC-complete)
-          (define-key must-match-map "\e "     'PC-complete-word)
           (define-key must-match-map "\e\r"    'PC-complete-and-exit)
           (define-key must-match-map "\e\n"    'PC-complete-and-exit)
-          (define-key must-match-map "\e?"     'PC-completion-help)
 
           (define-key global-map [remap lisp-complete-symbol]  'PC-lisp-complete-symbol)))))
 
@@ -231,13 +222,6 @@ second TAB brings up the `*Completions*' buffer."
         (remove-hook 'find-file-not-found-functions 'PC-look-for-include-file))
        ((not PC-disable-includes)
         (add-hook 'find-file-not-found-functions 'PC-look-for-include-file)))
-  ;; ... with some underhand redefining.
-  (cond ((not partial-completion-mode)
-         (ad-disable-advice 'read-file-name-internal 'around 'PC-include-file)
-         (ad-activate 'read-file-name-internal))
-       ((not PC-disable-includes)
-         (ad-enable-advice 'read-file-name-internal 'around 'PC-include-file)
-         (ad-activate 'read-file-name-internal)))
   ;; Adjust the completion selection in *Completion* buffers to the way
   ;; we work.  The default minibuffer completion code only completes the
   ;; text before point and leaves the text after point alone (new in
@@ -344,14 +328,24 @@ See `PC-complete' for details."
     (PC-do-complete-and-exit)))
 
 (defun PC-do-complete-and-exit ()
-  (if (= (point-max) (minibuffer-prompt-end))  ; Duplicate the "bug" that Info-menu relies on...
-      (exit-minibuffer)
+  (cond
+   ((= (point-max) (minibuffer-prompt-end))
+    ;; Duplicate the "bug" that Info-menu relies on...
+    (exit-minibuffer))
+   ((eq minibuffer-completion-confirm 'confirm-only)
+    (if (or (eq last-command this-command)
+            (test-completion (field-string)
+                             minibuffer-completion-table
+                             minibuffer-completion-predicate))
+        (exit-minibuffer)
+      (PC-temp-minibuffer-message " [Confirm]")))
+   (t
     (let ((flag (PC-do-completion 'exit)))
       (and flag
           (if (or (eq flag 'complete)
                   (not minibuffer-completion-confirm))
               (exit-minibuffer)
-            (PC-temp-minibuffer-message " [Confirm]"))))))
+            (PC-temp-minibuffer-message " [Confirm]")))))))
 
 
 (defun PC-completion-help ()
@@ -439,7 +433,9 @@ point-max (as is appropriate for completing a file name).  If
 GOTO-END is non-nil, however, it instead replaces up to END."
   (or beg (setq beg (minibuffer-prompt-end)))
   (or end (setq end (point-max)))
-  (let* ((table minibuffer-completion-table)
+  (let* ((table (if (eq minibuffer-completion-table 'read-file-name-internal)
+                    'PC-read-file-name-internal
+                    minibuffer-completion-table))
         (pred minibuffer-completion-predicate)
         (filename (funcall PC-completion-as-file-name-predicate))
         (dirname nil) ; non-nil only if a filename is being completed
@@ -454,6 +450,7 @@ GOTO-END is non-nil, however, it instead replaces up to END."
         env-on
         regex
         p offset
+         abbreviated
         (poss nil)
         helpposs
         (case-fold-search completion-ignore-case))
@@ -532,11 +529,11 @@ GOTO-END is non-nil, however, it instead replaces up to END."
                     (insert str)
                     (setq end (+ beg (length str)))))
               (if origstr
-                   ;; If the wildcards were introduced by us, it's possible
-                   ;; that read-file-name-internal (especially our
-                   ;; PC-include-file advice) can still find matches for the
-                   ;; original string even if we couldn't, so remove the
-                   ;; added wildcards.
+                       ;; If the wildcards were introduced by us, it's
+                       ;; possible that PC-read-file-name-internal can
+                       ;; still find matches for the original string
+                       ;; even if we couldn't, so remove the added
+                       ;; wildcards.
                    (setq str origstr)
                 (setq filename nil table nil pred nil)))))
 
@@ -590,17 +587,42 @@ GOTO-END is non-nil, however, it instead replaces up to END."
                  pred nil))
 
       ;; Find an initial list of possible completions
-      (if (not (setq p (string-match (concat PC-delim-regex
+        (unless (setq p (string-match (concat PC-delim-regex
                                             (if filename "\\|\\*" ""))
                                     str
-                                    (+ (length dirname) offset))))
+                                      (+ (length dirname) offset)))
 
          ;; Minibuffer contains no hyphens -- simple case!
-         (setq poss (all-completions (if env-on
-                                         basestr str)
+          (setq poss (all-completions (if env-on basestr str)
                                      table
                                      pred))
-
+          (unless poss
+            ;; Try completion as an abbreviation, e.g. "mvb" ->
+            ;; "m-v-b" -> "multiple-value-bind"
+            (setq origstr str
+                  abbreviated t)
+            (if filename
+                (cond
+                  ;; "alpha" or "/alpha" -> expand whole path.
+                  ((string-match "^/?\\([A-Za-z0-9]+\\)$" str)
+                   (setq
+                    basestr ""
+                    p nil
+                    poss (PC-expand-many-files
+                          (concat "/"
+                                  (mapconcat #'list (match-string 1 str) "*/")
+                                  "*"))
+                    beg (1- beg)))
+                  ;; Alphanumeric trailer -> expand trailing file
+                  ((string-match "^\\(.+/\\)\\([A-Za-z0-9]+\\)$" str)
+                   (setq regex (concat "\\`"
+                                        (mapconcat #'list
+                                                   (match-string 2 str)
+                                                   "[A-Za-z0-9]*[^A-Za-z0-9]"))
+                          p (1+ (length (match-string 1 str))))))
+                (setq regex (concat "\\`" (mapconcat #'list str "[^-]*-"))
+                      p 1))))
+        (when p
        ;; Use all-completions to do an initial cull.  This is a big win,
        ;; since all-completions is written in C!
        (let ((compl (all-completions (if env-on
@@ -609,12 +631,24 @@ GOTO-END is non-nil, however, it instead replaces up to END."
                                       table
                                       pred)))
          (setq p compl)
+            (when (and compl abbreviated)
+              (if filename
+                  (progn
+                    (setq p nil)
+                    (dolist (x compl)
+                      (when (string-match regex x)
+                        (push x p)))
+                    (setq basestr (try-completion "" p)))
+                  (setq basestr (mapconcat 'list str "-"))
+                  (delete-region beg end)
+                  (setq end (+ beg (length basestr)))
+                  (insert basestr))))
          (while p
            (and (string-match regex (car p))
                 (progn
                   (set-text-properties 0 (length (car p)) '() (car p))
                   (setq poss (cons (car p) poss))))
-           (setq p (cdr p)))))
+            (setq p (cdr p))))
 
       ;; If table had duplicates, they can be here.
       (delete-dups poss)
@@ -648,6 +682,7 @@ GOTO-END is non-nil, however, it instead replaces up to END."
              (and p (setq poss p))))
 
       ;; Now we have a list of possible completions
+
       (cond
 
        ;; No valid completions found
@@ -657,6 +692,9 @@ GOTO-END is non-nil, however, it instead replaces up to END."
            (let ((PC-word-failed-flag t))
              (delete-backward-char 1)
              (PC-do-completion 'word))
+               (when abbreviated
+                 (delete-region beg end)
+                 (insert origstr))
          (beep)
          (PC-temp-minibuffer-message (if ambig
                                          " [Ambiguous dir name]"
@@ -793,13 +831,18 @@ GOTO-END is non-nil, however, it instead replaces up to END."
                           (setq completion-base-size (if dirname
                                                          dirlength
                                                        (- beg prompt-end))))))
-                 (PC-temp-minibuffer-message " [Next char not unique]"))
-               nil)))))
+                             (PC-temp-minibuffer-message " [Next char not unique]"))))))
+           ;; Expansion of filenames is not reversible, so just keep
+           ;; the prefix.
+           (when (and abbreviated filename)
+             (delete-region (point) end))
+           nil)
 
        ;; Only one possible completion
        (t
        (if (and (equal basestr (car poss))
-                (not (and env-on filename)))
+                 (not (and env-on filename))
+                 (not abbreviated))
            (if (null mode)
                (PC-temp-minibuffer-message " [Sole completion]"))
          (delete-region beg end)
@@ -857,13 +900,11 @@ only symbols with function definitions are considered.
 Otherwise, all symbols with function definitions, values
 or properties are considered."
   (interactive)
-  (let* ((end (point))
-         ;; To complete the word under point, rather than just the portion
-         ;; before point, use this:
-;;;           (save-excursion
-;;;             (with-syntax-table lisp-mode-syntax-table
-;;;               (forward-sexp 1)
-;;;               (point))))
+  (let* ((end
+          (save-excursion
+            (with-syntax-table lisp-mode-syntax-table
+              (skip-syntax-forward "_w")
+              (point))))
         (beg (save-excursion
                 (with-syntax-table lisp-mode-syntax-table
                   (backward-sexp 1)
@@ -921,7 +962,7 @@ or properties are considered."
                                       (point-min) t)
                    (+ (point) 2)
                    (point-min)))
-          (minibuffer-completion-table 'read-file-name-internal)
+          (minibuffer-completion-table 'PC-read-file-name-internal)
           (minibuffer-completion-predicate "")
           (PC-not-minibuffer t))
      (goto-char end)
@@ -1107,24 +1148,23 @@ absolute rather than relative to some directory on the SEARCH-PATH."
          (setq sorted (cdr sorted)))
        compressed))))
 
-(defadvice read-file-name-internal (around PC-include-file disable)
-  (if (string-match "<\\([^\"<>]*\\)>?\\'" (ad-get-arg 0))
-      (let* ((string (ad-get-arg 0))
-             (action (ad-get-arg 2))
-             (name (match-string 1 string))
+(defun PC-read-file-name-internal (string dir action)
+  "Extend `read-file-name-internal' to handle include files.
+This is only used by "
+  (if (string-match "<\\([^\"<>]*\\)>?\\'" string)
+      (let* ((name (match-string 1 string))
             (str2 (substring string (match-beginning 0)))
             (completion-table
              (mapcar (lambda (x)
                         (format (if (string-match "/\\'" x) "<%s" "<%s>") x))
                      (PC-include-file-all-completions
                       name (PC-include-file-path)))))
-        (setq ad-return-value
               (cond
                ((not completion-table) nil)
                ((eq action 'lambda) (test-completion str2 completion-table nil))
                ((eq action nil) (PC-try-completion str2 completion-table nil))
-               ((eq action t) (all-completions str2 completion-table nil)))))
-    ad-do-it))
+          ((eq action t) (all-completions str2 completion-table nil))))
+    (read-file-name-internal string dir action)))
 \f
 
 (provide 'complete)
index 2180e2d..99d559d 100644 (file)
@@ -301,9 +301,9 @@ See also `save-completions-retention-time'."
   (let ((olddef (convert-standard-filename "~/.completions")))
     (cond
      ((file-readable-p olddef) olddef)
-     ((file-directory-p (convert-standard-filename "~/.emacs.d/"))
+     ((file-directory-p user-emacs-directory)
       (convert-standard-filename
-       (expand-file-name "completions" "~/.emacs.d/")))
+       (expand-file-name "completions" user-emacs-directory)))
      (t olddef)))
   "The filename to save completions to."
   :type 'file
index e2fc4ec..a2457ab 100644 (file)
@@ -194,7 +194,7 @@ adjust the composition when it gets invalid because of a change of
 text in the composition."
   (interactive "r")
   (let ((modified-p (buffer-modified-p))
-       (buffer-read-only nil))
+       (inhibit-read-only t))
     (if (or (vectorp components) (listp components))
        (setq components (encode-composition-components components)))
     (compose-region-internal start end components modification-func)
@@ -208,9 +208,9 @@ When called from a program, expects two arguments,
 positions (integers or markers) specifying the region."
   (interactive "r")
   (let ((modified-p (buffer-modified-p))
-       (buffer-read-only nil))
+       (inhibit-read-only t))
     (remove-text-properties start end '(composition nil))
-    (set-buffer-modified-p modified-p)))
+    (restore-buffer-modified-p modified-p)))
 
 ;;;###autoload
 (defun compose-string (string &optional start end components modification-func)
@@ -372,8 +372,8 @@ after a sequence of character events."
 ;;;###autoload(global-set-key [compose-last-chars] 'compose-last-chars)
 
 \f
-;;; The following codes are only for backward compatibility with Emacs
-;;; 20.4 and earlier.
+;; The following codes are only for backward compatibility with Emacs
+;; 20.4 and earlier.
 
 ;;;###autoload
 (defun decompose-composite-char (char &optional type with-composition-rule)
@@ -392,5 +392,5 @@ Optional 3rd arg WITH-COMPOSITION-RULE is ignored."
 
 \f
 
-;;; arch-tag: ee703d77-1723-45d4-a31f-e9f0f867aa33
+;; arch-tag: ee703d77-1723-45d4-a31f-e9f0f867aa33
 ;;; composite.el ends here
index ed248ac..815e2d4 100644 (file)
@@ -141,7 +141,7 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
                                    (member where
                                            (cdr (assoc version version-alist)))
                                  (push where (cdr (assoc version version-alist))))
-                             (push (cons version (list where)) version-alist)))
+                             (push (list version where) version-alist)))
                        ;; This is a group
                        (insert "(custom-put-if-not '" (symbol-name symbol)
                                " 'custom-version ")
index 29840b8..869533b 100644 (file)
 
 (require 'cus-face)
 (require 'wid-edit)
-(eval-when-compile
-  (defvar custom-versions-load-alist)  ; from cus-load
-  (defvar recentf-exclude))            ; from recentf.el
+
+(defvar custom-versions-load-alist)    ; from cus-load
+(defvar recentf-exclude)               ; from recentf.el
 
 (condition-case nil
     (require 'cus-load)
 
 (defun custom-split-regexp-maybe (regexp)
   "If REGEXP is a string, split it to a list at `\\|'.
-You can get the original back with from the result with:
+You can get the original back from the result with:
   (mapconcat 'identity result \"\\|\")
 
 IF REGEXP is not a string, return it unchanged."
   (if (stringp regexp)
-      (let ((start 0)
-           all)
-       (while (string-match "\\\\|" regexp start)
-         (setq all (cons (substring regexp start (match-beginning 0)) all)
-               start (match-end 0)))
-       (nreverse (cons (substring regexp start) all)))
+      (split-string regexp "\\\\|")
     regexp))
 
 (defun custom-variable-prompt ()
@@ -760,52 +755,86 @@ groups after non-groups, if nil do not order groups at all."
 
 ;;; Custom Mode Commands.
 
-(defvar custom-options nil
-  "Customization widgets in the current buffer.")
-
-(defun Custom-set ()
-  "Set the current value of all edited settings in the buffer."
+;; This variable is used by `custom-tool-bar-map', or directly by
+;; `custom-buffer-create-internal' if the toolbar is not present and
+;; `custom-buffer-verbose-help' is non-nil.
+
+(defvar custom-commands
+  '(("Set for current session" Custom-set t
+     "Apply all settings in this buffer to the current session"
+     "index")
+    ("Save for future sessions" Custom-save
+     (or custom-file user-init-file)
+     "Apply all settings in this buffer and save them for future Emacs sessions."
+     "save")
+    ("Undo edits" Custom-reset-current t
+     "Restore all settings in this buffer to reflect their current values."
+     "refresh")
+    ("Reset to saved" Custom-reset-saved t
+     "Restore all settings in this buffer to their saved values (if any)."
+     "undo")
+    ("Erase customizations" Custom-reset-standard
+     (or custom-file user-init-file)
+     "Un-customize all settings in this buffer and save them with standard values."
+     "delete")
+    ("Help for Customize" Custom-help t
+     "Get help for using Customize."
+     "help")
+    ("Exit" Custom-buffer-done t "Exit Customize." "exit")))
+
+(defun Custom-help ()
+  "Read the node on Easy Customization in the Emacs manual."
   (interactive)
-  (let ((children custom-options))
-    (if (or (and (= 1 (length children))
-                (memq (widget-type (car children))
-                      '(custom-variable custom-face)))
-           (y-or-n-p "Set all values according to this buffer? "))
-       (mapc (lambda (child)
-               (when (eq (widget-get child :custom-state) 'modified)
-                 (widget-apply child :custom-set)))
-             children)
-      (message "Aborted"))))
-
-(defun Custom-save ()
-  "Set all edited settings, then save all settings that have been set.
-If a setting was edited and set before, this saves it.
-If a setting was merely edited before, this sets it then saves it."
-  (interactive)
-  (let ((children custom-options))
-    (if (or (and (= 1 (length children))
-                (memq (widget-type (car children))
-                      '(custom-variable custom-face)))
-           (yes-or-no-p "Save all settings in this buffer? "))
-       (progn
-         (mapc (lambda (child)
-                 (when (memq (widget-get child :custom-state)
-                             '(modified set changed rogue))
-                   (widget-apply child :custom-save)))
-               children)
-         (custom-save-all))
-      (message "Aborted"))))
+  (info "(emacs)Easy Customization"))
 
 (defvar custom-reset-menu
   '(("Undo Edits" . Custom-reset-current)
     ("Reset to Saved" . Custom-reset-saved)
-    ("Erase Customization (use standard values)" . Custom-reset-standard))
+    ("Erase Customizations (use standard values)" . Custom-reset-standard))
   "Alist of actions for the `Reset' button.
 The key is a string containing the name of the action, the value is a
 Lisp function taking the widget as an element which will be called
 when the action is chosen.")
 
-(defun custom-reset (event)
+(defvar custom-options nil
+  "Customization widgets in the current buffer.")
+
+(defun custom-command-apply (fun query &optional strong-query)
+  "Call function FUN on all widgets in `custom-options'.
+If there is more than one widget, ask user for confirmation using
+the query string QUERY, using `y-or-n-p' if STRONG-QUERY is nil,
+and `yes-or-no-p' otherwise."
+  (if (or (and (= 1 (length custom-options))
+              (memq (widget-type (car custom-options))
+                    '(custom-variable custom-face)))
+         (funcall (if strong-query 'yes-or-no-p 'y-or-n-p) query))
+      (progn (mapc fun custom-options) t)
+    (message "Aborted")
+    nil))
+
+(defun Custom-set (&rest ignore)
+  "Set the current value of all edited settings in the buffer."
+  (interactive)
+  (custom-command-apply
+   (lambda (child)
+     (when (eq (widget-get child :custom-state) 'modified)
+       (widget-apply child :custom-set)))
+   "Set all values according to this buffer? "))
+
+(defun Custom-save (&rest ignore)
+  "Set all edited settings, then save all settings that have been set.
+If a setting was edited and set before, this saves it.
+If a setting was merely edited before, this sets it then saves it."
+  (interactive)
+  (if (custom-command-apply
+       (lambda (child)
+        (when (memq (widget-get child :custom-state)
+                    '(modified set changed rogue))
+          (widget-apply child :custom-save)))
+       "Save all settings in this buffer? " t)
+      (custom-save-all)))
+
+(defun custom-reset (widget &optional event)
   "Select item from reset menu."
   (let* ((completion-ignore-case t)
         (answer (widget-choose "Reset settings"
@@ -817,33 +846,21 @@ when the action is chosen.")
 (defun Custom-reset-current (&rest ignore)
   "Reset all edited settings in the buffer to show their current values."
   (interactive)
-  (let ((children custom-options))
-    (if (or (and (= 1 (length children))
-                (memq (widget-type (car children))
-                      '(custom-variable custom-face)))
-           (y-or-n-p "Reset all settings' buffer text to show current values? "))
-       (mapc (lambda (widget)
-               (if (memq (widget-get widget :custom-state)
-                         '(modified changed))
-                   (widget-apply widget :custom-reset-current)))
-             children)
-      (message "Aborted"))))
+  (custom-command-apply
+   (lambda (widget)
+     (if (memq (widget-get widget :custom-state) '(modified changed))
+        (widget-apply widget :custom-reset-current)))
+   "Reset all settings' buffer text to show current values? "))
 
 (defun Custom-reset-saved (&rest ignore)
   "Reset all edited or set settings in the buffer to their saved value.
 This also shows the saved values in the buffer."
   (interactive)
-  (let ((children custom-options))
-    (if (or (and (= 1 (length children))
-                (memq (widget-type (car children))
-                      '(custom-variable custom-face)))
-           (y-or-n-p "Reset all settings (current values and buffer text) to saved values? "))
-       (mapc (lambda (widget)
-               (if (memq (widget-get widget :custom-state)
-                         '(modified set changed rogue))
-                   (widget-apply widget :custom-reset-saved)))
-             children)
-      (message "Aborted"))))
+  (custom-command-apply
+   (lambda (widget)
+     (if (memq (widget-get widget :custom-state) '(modified set changed rogue))
+        (widget-apply widget :custom-reset-saved)))
+   "Reset all settings (current values and buffer text) to saved values? "))
 
 (defun Custom-reset-standard (&rest ignore)
   "Erase all customization (either current or saved) for the group members.
@@ -851,20 +868,14 @@ The immediate result is to restore them to their standard values.
 This operation eliminates any saved values for the group members,
 making them as if they had never been customized at all."
   (interactive)
-  (let ((children custom-options))
-    (if (or (and (= 1 (length children))
-                (memq (widget-type (car children))
-                      '(custom-variable custom-face)))
-           (yes-or-no-p "Erase all customizations for settings in this buffer? "))
-       (mapc (lambda (widget)
-               (and (if (widget-get widget :custom-standard-value)
-                        (widget-apply widget :custom-standard-value)
-                      t)
-                    (memq (widget-get widget :custom-state)
-                          '(modified set changed saved rogue))
-                    (widget-apply widget :custom-reset-standard)))
-             children)
-      (message "Aborted"))))
+  (custom-command-apply
+   (lambda (widget)
+     (and (or (null (widget-get widget :custom-standard-value))
+             (widget-apply widget :custom-standard-value))
+         (memq (widget-get widget :custom-state)
+               '(modified set changed saved rogue))
+         (widget-apply widget :custom-reset-standard)))
+   "Erase all customizations for settings in this buffer? " t))
 
 ;;; The Customize Commands
 
@@ -893,9 +904,9 @@ it as the third element in the list."
            (cond (prop
                   ;; Use VAR's `variable-interactive' property
                   ;; as an interactive spec for prompting.
-                  (call-interactively (list 'lambda '(arg)
-                                            (list 'interactive prop)
-                                            'arg)))
+                  (call-interactively `(lambda (arg)
+                                         (interactive ,prop)
+                                         arg)))
                  (type
                   (widget-prompt-value type
                                        prompt
@@ -1021,44 +1032,20 @@ then prompt for the MODE to customize."
                          t nil nil (if group (symbol-name major-mode))))))))
   (customize-group (custom-group-of-mode mode)))
 
+(defun customize-read-group ()
+  (let ((completion-ignore-case t))
+    (completing-read "Customize group (default emacs): "
+                     obarray
+                     (lambda (symbol)
+                       (or (and (get symbol 'custom-loads)
+                                (not (get symbol 'custom-autoload)))
+                           (get symbol 'custom-group)))
+                     t)))
 
 ;;;###autoload
-(defun customize-group (group)
-  "Customize GROUP, which must be a customization group."
-  (interactive
-   (list (let ((completion-ignore-case t))
-          (completing-read "Customize group (default emacs): "
-                           obarray
-                           (lambda (symbol)
-                             (or (and (get symbol 'custom-loads)
-                                      (not (get symbol 'custom-autoload)))
-                                 (get symbol 'custom-group)))
-                           t))))
-  (when (stringp group)
-    (if (string-equal "" group)
-       (setq group 'emacs)
-      (setq group (intern group))))
-  (let ((name (format "*Customize Group: %s*"
-                     (custom-unlispify-tag-name group))))
-    (if (get-buffer name)
-       (pop-to-buffer name)
-      (custom-buffer-create (list (list group 'custom-group))
-                           name
-                           (concat " for group "
-                                   (custom-unlispify-tag-name group))))))
-
-;;;###autoload
-(defun customize-group-other-window (group)
+(defun customize-group (&optional group)
   "Customize GROUP, which must be a customization group."
-  (interactive
-   (list (let ((completion-ignore-case t))
-          (completing-read "Customize group (default emacs): "
-                           obarray
-                           (lambda (symbol)
-                             (or (and (get symbol 'custom-loads)
-                                      (not (get symbol 'custom-autoload)))
-                                 (get symbol 'custom-group)))
-                           t))))
+  (interactive (list (customize-read-group)))
   (when (stringp group)
     (if (string-equal "" group)
        (setq group 'emacs)
@@ -1066,17 +1053,21 @@ then prompt for the MODE to customize."
   (let ((name (format "*Customize Group: %s*"
                      (custom-unlispify-tag-name group))))
     (if (get-buffer name)
-       (let (
-             ;; Copied from `custom-buffer-create-other-window'.
-             (pop-up-windows t)
-             (same-window-buffer-names nil)
-             (same-window-regexps nil))
-         (pop-to-buffer name))
-      (custom-buffer-create-other-window
+        (pop-to-buffer name)
+      (custom-buffer-create
        (list (list group 'custom-group))
        name
        (concat " for group "
-              (custom-unlispify-tag-name group))))))
+               (custom-unlispify-tag-name group))))))
+
+;;;###autoload
+(defun customize-group-other-window (&optional group)
+  "Customize GROUP, which must be a customization group, in another window."
+  (interactive (list (customize-read-group)))
+  (let ((pop-up-windows t)
+        (same-window-buffer-names nil)
+        (same-window-regexps nil))
+    (customize-group group)))
 
 ;;;###autoload
 (defalias 'customize-variable 'customize-option)
@@ -1264,27 +1255,26 @@ face-alias, customize the face it is aliased to.
 
 Interactively, when point is on text which has a face specified,
 suggest to customize that face, if it's customizable."
-  (interactive
-   (list (read-face-name "Customize face" "all faces" t)))
+  (interactive (list (read-face-name "Customize face" "all faces" t)))
   (if (member face '(nil ""))
       (setq face (face-list)))
   (if (and (listp face) (null (cdr face)))
       (setq face (car face)))
   (if (listp face)
-      (custom-buffer-create (custom-sort-items
-                            (mapcar (lambda (s)
-                                      (list s 'custom-face))
-                                    face)
-                            t nil)
-                           "*Customize Faces*")
+      (custom-buffer-create
+       (custom-sort-items
+        (mapcar (lambda (s) (list s 'custom-face)) face)
+        t nil)
+       "*Customize Faces*")
     ;; If FACE is actually an alias, customize the face it is aliased to.
     (if (get face 'face-alias)
         (setq face (get face 'face-alias)))
     (unless (facep face)
       (error "Invalid face %S" face))
-    (custom-buffer-create (list (list face 'custom-face))
-                         (format "*Customize Face: %s*"
-                                 (custom-unlispify-tag-name face)))))
+    (custom-buffer-create
+     (list (list face 'custom-face))
+     (format "*Customize Face: %s*"
+             (custom-unlispify-tag-name face)))))
 
 ;;;###autoload
 (defun customize-face-other-window (&optional face)
@@ -1293,28 +1283,11 @@ If FACE is actually a face-alias, customize the face it is aliased to.
 
 Interactively, when point is on text which has a face specified,
 suggest to customize that face, if it's customizable."
-  (interactive
-   (list (read-face-name "Customize face" "all faces" t)))
-  (if (member face '(nil ""))
-      (setq face (face-list)))
-  (if (and (listp face) (null (cdr face)))
-      (setq face (car face)))
-  (if (listp face)
-      (custom-buffer-create-other-window
-       (custom-sort-items
-       (mapcar (lambda (s)
-                 (list s 'custom-face))
-               face)
-       t nil)
-       "*Customize Faces*")
-    (if (get face 'face-alias)
-        (setq face (get face 'face-alias)))
-    (unless (facep face)
-      (error "Invalid face %S" face))
-    (custom-buffer-create-other-window
-     (list (list face 'custom-face))
-     (format "*Customize Face: %s*"
-            (custom-unlispify-tag-name face)))))
+  (interactive (list (read-face-name "Customize face" "all faces" t)))
+  (let ((pop-up-windows t)
+        (same-window-buffer-names nil)
+        (same-window-regexps nil))
+    (customize-face face)))
 
 (defalias 'customize-customized 'customize-unsaved)
 
@@ -1403,7 +1376,14 @@ that are not customizable options, as well as faces and groups
                                      (get symbol 'variable-documentation))))
                    (push (list symbol 'custom-variable) found)))))
     (if (not found)
-       (error "No customizable items matching %s" regexp)
+       (error "No %s matching %s"
+               (if (eq all t)
+                   "items"
+                 (format "customizable %s"
+                         (if (memq all '(options faces groups))
+                             (symbol-name all)
+                           "items")))
+               regexp)
       (custom-buffer-create
        (custom-sort-items found t custom-buffer-order-groups)
        "*Customize Apropos*"))))
@@ -1546,99 +1526,60 @@ Otherwise use brackets."
 
 (defun custom-buffer-create-internal (options &optional description)
   (custom-mode)
-  (if custom-buffer-verbose-help
-      (progn
-       (widget-insert "This is a customization buffer")
-       (if description
-           (widget-insert description))
-       (widget-insert (format ".
-%s buttons; type RET or click mouse-1 to actuate one.
-Editing a setting changes only the text in the buffer."
-                              (if custom-raised-buttons
-                                  "`Raised' text indicates"
-                                "Square brackets indicate")))
-       (if init-file-user
-           (widget-insert "
-Use the setting's State button to set it or save changes in it.
-Saving a change normally works by editing your Emacs init file.")
-           (widget-insert "
-\nSince you started Emacs with `-q', which inhibits use of the
-Emacs init file, you cannot save settings into the Emacs init file."))
-       (widget-insert "\nSee ")
-       (widget-create 'custom-manual
-                      :tag "Custom file"
-                      "(emacs)Saving Customizations")
-       (widget-insert
-        " for information on how to save in a different file.\n
-See ")
-       (widget-create 'custom-manual
-                      :tag "Help"
-                      :help-echo "Read the online help."
-                      "(emacs)Easy Customization")
-       (widget-insert " for more information.\n\n")
-       (widget-insert "Operate on all settings in this buffer that \
-are not marked HIDDEN:\n "))
-    (widget-insert " "))
-  (widget-create 'push-button
-                :tag "Set for Current Session"
-                :help-echo "\
-Make your editing in this buffer take effect for this session."
-                :action (lambda (widget &optional event)
-                          (Custom-set)))
-  (if (not custom-buffer-verbose-help)
-      (progn
-       (widget-insert " ")
-       (widget-create 'custom-manual
-                      :tag "Help"
-                      :help-echo "Read the online help."
-                      "(emacs)Easy Customization")))
-  (when (or custom-file user-init-file)
-    (widget-insert " ")
-    (widget-create 'push-button
-                  :tag "Save for Future Sessions"
-                  :help-echo "\
-Make your editing in this buffer take effect for future Emacs sessions.
-This updates your Emacs initialization file or creates a new one."
-                  :action (lambda (widget &optional event)
-                            (Custom-save))))
-  (if custom-reset-button-menu
-      (progn
-       (widget-insert " ")
-       (widget-create 'push-button
-                      :tag "Reset buffer"
-                      :help-echo "Show a menu with reset operations."
-                      :mouse-down-action (lambda (&rest junk) t)
-                      :action (lambda (widget &optional event)
-                                (custom-reset event))))
-    (widget-insert "\n ")
-    (widget-create 'push-button
-                  :tag "Undo Edits"
-                  :help-echo "\
-Reset all edited text in this buffer to reflect current values."
-                  :action 'Custom-reset-current)
-    (widget-insert " ")
-    (widget-create 'push-button
-                  :tag "Reset to Saved"
-                  :help-echo "\
-Reset all settings in this buffer to their saved values."
-                  :action 'Custom-reset-saved)
-    (widget-insert " ")
-    (when (or custom-file user-init-file)
-      (widget-create 'push-button
-                    :tag "Erase Customization"
-                    :help-echo "\
-Un-customize all settings in this buffer and save them with standard values."
-                    :action 'Custom-reset-standard)))
-  (widget-insert "   ")
-  (widget-create 'push-button
-                :tag "Finish"
-                :help-echo
-                (lambda (&rest ignore)
-                  (if custom-buffer-done-kill
-                      "Kill this buffer"
-                    "Bury this buffer"))
-                :action #'Custom-buffer-done)
-  (widget-insert "\n\n")
+  (let ((init-file (or custom-file user-init-file)))
+    ;; Insert verbose help at the top of the custom buffer.
+    (when custom-buffer-verbose-help
+      (widget-insert "Editing a setting changes only the text in this buffer."
+                    (if init-file
+                        "
+To set apply your changes, use the Save or Set buttons.
+Saving a change normally works by editing your init file."
+                      "
+Currently, these settings cannot be saved for future Emacs sessions,
+possibly because you started Emacs with `-q'.")
+                    "\nFor details, see ")
+      (widget-create 'custom-manual
+                    :tag "Saving Customizations"
+                    "(emacs)Saving Customizations")
+      (widget-insert " in the ")
+      (widget-create 'custom-manual
+                    :tag "Emacs manual"
+                    :help-echo "Read the Emacs manual."
+                    "(emacs)Top")
+      (widget-insert "."))
+    ;; Insert custom command buttons if the toolbar is not in use.
+
+    (widget-insert "\n")
+    (when (not (and tool-bar-mode (display-graphic-p)))
+      (if custom-buffer-verbose-help
+         (widget-insert "\n
+ Operate on all settings in this buffer that are not marked HIDDEN:\n"))
+      (let ((button (lambda (tag action active help icon)
+                     (widget-insert " ")
+                     (if (eval active)
+                         (widget-create 'push-button :tag tag
+                                        :help-echo help :action action))))
+           (commands custom-commands))
+       (apply button (pop commands)) ; Set for current session
+       (apply button (pop commands)) ; Save for future sessions
+       (if custom-reset-button-menu
+           (progn
+             (widget-insert " ")
+             (widget-create 'push-button
+                            :tag "Reset buffer"
+                            :help-echo "Show a menu with reset operations."
+                            :mouse-down-action 'ignore
+                            :action 'custom-reset))
+         (widget-insert "\n")
+         (apply button (pop commands)) ; Undo edits
+         (apply button (pop commands)) ; Reset to saved
+         (apply button (pop commands)) ; Erase customization
+         (widget-insert "  ")
+         (pop commands) ; Help (omitted)
+         (apply button (pop commands))))) ; Exit
+    (widget-insert "\n\n"))
+
+  ;; Now populate the custom buffer.
   (message "Creating customization items...")
   (buffer-disable-undo)
   (setq custom-options
@@ -2439,13 +2380,13 @@ If INITIAL-STRING is non-nil, use that rather than \"Parent groups:\"."
 (defface custom-variable-tag
   `((((class color)
       (background dark))
-     (:foreground "light blue" :weight bold :height 1.2 :inherit variable-pitch))
+     (:foreground "light blue" :weight bold))
     (((min-colors 88) (class color)
       (background light))
-     (:foreground "blue1" :weight bold :height 1.2 :inherit variable-pitch))
+     (:foreground "blue1" :weight bold))
     (((class color)
       (background light))
-     (:foreground "blue" :weight bold :height 1.2 :inherit variable-pitch))
+     (:foreground "blue" :weight bold))
     (t (:weight bold)))
   "Face used for unpushable variable tags."
   :group 'custom-faces)
@@ -2636,15 +2577,11 @@ try matching its doc string against `custom-guess-doc-alist'."
                    widget 'custom-magic nil)))
        (widget-put widget :custom-magic magic)
        (push magic buttons))
-      ;; ### NOTE: this is ugly!!!! I need to update the :buttons property
-      ;; before the call to `widget-default-format-handler'. Otherwise, I
-      ;; loose my current `buttons'. This function shouldn't be called like
-      ;; this anyway. The doc string widget should be added like the others.
-      ;; --dv
       (widget-put widget :buttons buttons)
-      (insert "\n")
       ;; Insert documentation.
-      (widget-default-format-handler widget ?h)
+      (widget-put widget :documentation-indent 3)
+      (widget-add-documentation-string-button
+       widget :visibility-widget 'custom-visibility)
 
       ;; The comment field
       (unless (eq state 'hidden)
@@ -2984,6 +2921,21 @@ to switch between two values."
     ;; This call will possibly make the comment invisible
     (custom-redraw widget)))
 
+;;; The `custom-visibility' Widget
+
+(define-widget 'custom-visibility 'visibility
+  "Show or hide a documentation string."
+  :button-face 'custom-visibility
+  :pressed-face 'custom-visibility
+  :mouse-face 'highlight
+  :pressed-face 'highlight)
+
+(defface custom-visibility
+  '((t :height 0.8 :inherit link))
+  "Face for the `custom-visibility' widget."
+  :version "23.1"
+  :group 'custom-faces)
+
 ;;; The `custom-face-edit' Widget.
 
 (define-widget 'custom-face-edit 'checklist
@@ -3355,7 +3307,9 @@ SPEC must be a full face spec."
           ;; Update buttons.
           (widget-put widget :buttons buttons)
           ;; Insert documentation.
-          (widget-default-format-handler widget ?h)
+          (widget-add-documentation-string-button
+           widget :visibility-widget 'custom-visibility)
+
           ;; The comment field
           (unless (eq state 'hidden)
             (let* ((comment (get symbol 'face-comment))
@@ -3745,13 +3699,13 @@ and so forth.  The remaining group tags are shown with `custom-group-tag'."
 (defface custom-group-tag
   `((((class color)
       (background dark))
-     (:foreground "light blue" :weight bold :height 1.2))
+     (:foreground "light blue" :weight bold :height 1.2 :inherit variable-pitch))
     (((min-colors 88) (class color)
       (background light))
-     (:foreground "blue1" :weight bold :height 1.2))
+     (:foreground "blue1" :weight bold :height 1.2 :inherit variable-pitch))
     (((class color)
       (background light))
-     (:foreground "blue" :weight bold :height 1.2))
+     (:foreground "blue" :weight bold :height 1.2 :inherit variable-pitch))
     (t (:weight bold)))
   "Face used for low level group tags."
   :group 'custom-faces)
@@ -3895,28 +3849,22 @@ If GROUPS-ONLY non-nil, return only those members that are groups."
          ;; Nested style.
          ((eq state 'hidden)
           ;; Create level indicator.
-          (unless (eq custom-buffer-style 'links)
-            (insert-char ?\  (* custom-buffer-indent (1- level)))
-            (insert "-- "))
           ;; Create tag.
-          (let ((begin (point)))
-            (insert tag)
-            (widget-specify-sample widget begin (point)))
-          (insert " group: ")
-          ;; Create link/visibility indicator.
           (if (eq custom-buffer-style 'links)
               (push (widget-create-child-and-convert
                      widget 'custom-group-link
-                     :tag "Go to Group"
+                     :tag tag
                      symbol)
                     buttons)
+            (insert-char ?\  (* custom-buffer-indent (1- level)))
+            (insert "-- ")
             (push (widget-create-child-and-convert
                    widget 'custom-group-visibility
                    :help-echo "Show members of this group."
                    :action 'custom-toggle-parent
                    (not (eq state 'hidden)))
                   buttons))
-          (insert " \n")
+          (insert " ")
           ;; Create magic button.
           (let ((magic (widget-create-child-and-convert
                         widget 'custom-magic nil)))
@@ -3927,7 +3875,9 @@ If GROUPS-ONLY non-nil, return only those members that are groups."
           ;; Insert documentation.
           (if (and (eq custom-buffer-style 'links) (> level 1))
               (widget-put widget :documentation-indent 0))
-          (widget-default-format-handler widget ?h))
+          (widget-add-documentation-string-button
+           widget :visibility-widget 'custom-visibility))
+
          ;; Nested style.
          (t                            ;Visible.
           ;; Add parent groups references above the group.
@@ -3942,9 +3892,9 @@ If GROUPS-ONLY non-nil, return only those members that are groups."
           (insert "/- ")
           ;; Create tag.
           (let ((start (point)))
-            (insert tag)
+            (insert tag " group: ")
             (widget-specify-sample widget start (point)))
-          (insert " group: ")
+          (insert (widget-docstring widget))
           ;; Create visibility indicator.
           (unless (eq custom-buffer-style 'links)
             (insert "--------")
@@ -3971,7 +3921,9 @@ If GROUPS-ONLY non-nil, return only those members that are groups."
           ;; Update buttons.
           (widget-put widget :buttons buttons)
           ;; Insert documentation.
-          (widget-default-format-handler widget ?h)
+          (widget-add-documentation-string-button
+           widget :visibility-widget 'custom-visibility)
+
           ;; Parent groups.
           (if nil  ;;; This should test that the buffer
                    ;;; was not made to display a group.
@@ -4063,44 +4015,34 @@ Optional EVENT is the location for the menu."
 
 (defun custom-group-set (widget)
   "Set changes in all modified group members."
-  (let ((children (widget-get widget :children)))
-    (mapc (lambda (child)
-           (when (eq (widget-get child :custom-state) 'modified)
-             (widget-apply child :custom-set)))
-           children )))
+  (dolist (child (widget-get widget :children))
+    (when (eq (widget-get child :custom-state) 'modified)
+      (widget-apply child :custom-set))))
 
 (defun custom-group-save (widget)
   "Save all modified group members."
-  (let ((children (widget-get widget :children)))
-    (mapc (lambda (child)
-           (when (memq (widget-get child :custom-state) '(modified set))
-             (widget-apply child :custom-save)))
-           children )))
+  (dolist (child (widget-get widget :children))
+    (when (memq (widget-get child :custom-state) '(modified set))
+      (widget-apply child :custom-save))))
 
 (defun custom-group-reset-current (widget)
   "Reset all modified group members."
-  (let ((children (widget-get widget :children)))
-    (mapc (lambda (child)
-           (when (eq (widget-get child :custom-state) 'modified)
-             (widget-apply child :custom-reset-current)))
-           children )))
+  (dolist (child (widget-get widget :children))
+    (when (eq (widget-get child :custom-state) 'modified)
+      (widget-apply child :custom-reset-current))))
 
 (defun custom-group-reset-saved (widget)
   "Reset all modified or set group members."
-  (let ((children (widget-get widget :children)))
-    (mapc (lambda (child)
-           (when (memq (widget-get child :custom-state) '(modified set))
-             (widget-apply child :custom-reset-saved)))
-           children )))
+  (dolist (child (widget-get widget :children))
+    (when (memq (widget-get child :custom-state) '(modified set))
+      (widget-apply child :custom-reset-saved))))
 
 (defun custom-group-reset-standard (widget)
   "Reset all modified, set, or saved group members."
-  (let ((children (widget-get widget :children)))
-    (mapc (lambda (child)
-           (when (memq (widget-get child :custom-state)
-                       '(modified set saved))
-             (widget-apply child :custom-reset-standard)))
-           children )))
+  (dolist (child (widget-get widget :children))
+    (when (memq (widget-get child :custom-state)
+               '(modified set saved))
+      (widget-apply child :custom-reset-standard))))
 
 (defun custom-group-state-update (widget)
   "Update magic."
@@ -4489,6 +4431,32 @@ The format is suitable for use with `easy-menu-define'."
              (let ((menu (custom-menu-create ',symbol)))
                (if (consp menu) (cdr menu) menu)))))
 
+;;; Toolbar and menubar support
+
+(easy-menu-define
+  Custom-mode-menu custom-mode-map
+  "Menu used in customization buffers."
+  (nconc (list "Custom"
+              (customize-menu-create 'customize))
+        (mapcar (lambda (arg)
+                  (let ((tag     (nth 0 arg))
+                        (command (nth 1 arg))
+                        (active  (nth 2 arg))
+                        (help    (nth 3 arg)))
+                    (vector tag command :active (eval active) :help help)))
+                custom-commands)))
+
+(defvar tool-bar-map)
+(defvar custom-tool-bar-map
+  (if (display-graphic-p)
+      (let ((map (make-sparse-keymap)))
+       (mapc
+        (lambda (arg)
+          (tool-bar-local-item-from-menu
+           (nth 1 arg) (nth 4 arg) map custom-mode-map))
+        custom-commands)
+       map)))
+
 ;;; The Custom Mode.
 
 (defun Custom-no-edit (pos &optional event)
@@ -4504,18 +4472,6 @@ The format is suitable for use with `easy-menu-define'."
        (widget-apply-action button event)
       (error "You can't edit this part of the Custom buffer"))))
 
-(easy-menu-define Custom-mode-menu
-    custom-mode-map
-  "Menu used in customization buffers."
-  `("Custom"
-    ,(customize-menu-create 'customize)
-    ["Set" Custom-set t]
-    ["Save" Custom-save t]
-    ["Undo Edits" Custom-reset-current t]
-    ["Reset to Saved" Custom-reset-saved t]
-    ["Erase Customization" Custom-reset-standard t]
-    ["Info" (info "(emacs)Easy Customization") t]))
-
 (defvar custom-field-keymap
   (let ((map (copy-keymap widget-field-keymap)))
     (define-key map "\C-c\C-c" 'Custom-set)
@@ -4572,6 +4528,7 @@ if that value is non-nil."
        mode-name "Custom")
   (use-local-map custom-mode-map)
   (easy-menu-add Custom-mode-menu)
+  (set (make-local-variable 'tool-bar-map) custom-tool-bar-map)
   (make-local-variable 'custom-options)
   (make-local-variable 'custom-local-buffer)
   (make-local-variable 'widget-documentation-face)
index 27d72d4..b83f26f 100644 (file)
@@ -142,6 +142,9 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
             ;; eval.c
             (max-specpdl-size limits integer)
             (max-lisp-eval-depth limits integer)
+            (max-mini-window-height limits
+                                    (choice (const :tag "quarter screen" nil)
+                                            number))
             (stack-trace-on-error debug
                                   (choice (const :tag "off")
                                           (repeat :menu-tag "When"
index e5925dd..5138f80 100644 (file)
@@ -1009,10 +1009,7 @@ Every theme X has a property `provide-theme' whose value is \"X-theme\".
 ;;; Loading themes.
 
 (defcustom custom-theme-directory
-  (if (eq system-type 'ms-dos)
-        ;; MS-DOS cannot have initial dot.
-        "~/_emacs.d/"
-      "~/.emacs.d/")
+  user-emacs-directory
   "Directory in which Custom theme files should be written.
 `load-theme' searches this directory in addition to load-path.
 The command `customize-create-theme' writes the files it produces
index 0fa23db..929844c 100644 (file)
@@ -128,7 +128,7 @@ Set this to nil if no characters should be skipped."
                 (const :tag "off" nil))
   :group 'dabbrev)
 
-(defcustom dabbrev--eliminate-newlines t
+(defcustom dabbrev-eliminate-newlines t
   "*Non-nil means dabbrev should not insert newlines.
 Instead it converts them to spaces."
   :type 'boolean
@@ -913,10 +913,12 @@ to record whether we upcased the expansion, downcased it, or did neither."
                          ((equal abbrev (downcase abbrev)) 'downcase)))))
 
     ;; Convert whitespace to single spaces.
-    (if dabbrev--eliminate-newlines
-       ;; Start searching at end of ABBREV so that any whitespace
-       ;; carried over from the existing text is not changed.
-       (let ((pos (length abbrev)))
+    (if dabbrev-eliminate-newlines
+       (let ((pos
+              (if (equal abbrev " ") 0 (length abbrev))))
+         ;; If ABBREV is real, search after the end of it.
+         ;; If ABBREV is space and we are copying successive words,
+         ;; search starting at the front.
          (while (string-match "[\n \t]+" expansion pos)
            (setq pos (1+ (match-beginning 0)))
            (setq expansion (replace-match " " nil nil expansion)))))
index e33dac6..8d6e6ea 100644 (file)
@@ -87,12 +87,16 @@ any selection."
          (cond ((eq type 'kill)
                 (delete-active-region t))
                ((eq type 'yank)
-                ;; Before a yank command,
-                ;; make sure we don't yank the same region
-                ;; that we are going to delete.
-                ;; That would make yank a no-op.
-                (when (string= (buffer-substring-no-properties (point) (mark))
-                               (car kill-ring))
+                ;; Before a yank command, make sure we don't yank the
+                ;; head of the kill-ring that really comes from the
+                ;; currently active region we are going to delete
+                ;; (when last-command is one that uses copy-region-as-kill
+                ;; or kill-new).  That would make yank a no-op.
+                (when (and (string= (buffer-substring-no-properties (point) (mark))
+                                    (car kill-ring))
+                           (memq last-command
+                                 '(mouse-set-region mouse-drag-region
+                                   mouse-save-then-kill mouse-secondary-save-then-kill)))
                   (current-kill 1))
                 (delete-active-region))
                ((eq type 'supersede)
index 0fa38ed..bddba82 100644 (file)
@@ -204,7 +204,7 @@ the normal hook `desktop-not-loaded-hook' is run."
     (const :tag "Don't load" nil)
     (const :tag "Ask the user" ask))
   :group 'desktop
-  :version "22.2")
+  :version "23.1")
 
 (defcustom desktop-base-file-name
   (convert-standard-filename ".emacs.desktop")
@@ -219,7 +219,7 @@ the normal hook `desktop-not-loaded-hook' is run."
   "Name of lock file for Emacs desktop, excluding the directory part."
   :type 'file
   :group 'desktop
-  :version "22.2")
+  :version "23.1")
 
 (defcustom desktop-path '("." "~")
   "List of directories to search for the desktop file.
@@ -253,7 +253,7 @@ May be used to deal with accidental multiple Emacs jobs."
   :type 'hook
   :group 'desktop
   :options '(desktop-save-mode-off save-buffers-kill-emacs)
-  :version "22.2")
+  :version "23.1")
 
 (defcustom desktop-after-read-hook nil
   "Normal hook run after a successful `desktop-read'.
index b90d15e..6d811a6 100644 (file)
 \f
 ;;; Compatibility functions
 ;;
-(if (fboundp 'frame-parameter)
-
-    (defalias 'dframe-frame-parameter 'frame-parameter)
-
-  (defun dframe-frame-parameter (frame parameter)
-    "Return FRAME's PARAMETER value."
-    (cdr (assoc parameter (frame-parameters frame)))))
+(defun dframe-frame-parameter (frame parameter)
+  "Return FRAME's PARAMETER value."
+  (if (fboundp 'frame-parameter)
+      (frame-parameter frame parameter)
+    (cdr (assoc parameter (frame-parameters frame))))) ; XEmacs
 
 \f
 ;;; Variables
@@ -887,10 +885,10 @@ Must be bound to event E."
 
 ;;; Interactive user functions for the mouse
 ;;
-(if dframe-xemacsp
-    (defalias 'dframe-mouse-event-p 'button-press-event-p)
-  (defun dframe-mouse-event-p (event)
-    "Return t if the event is a mouse related event."
+(defun dframe-mouse-event-p (event)
+  "Return t if the event is a mouse related event."
+  (if (fboundp 'button-press-event-p)
+      (button-press-event-p event)      ; XEmacs
     (if (and (listp event)
             (member (event-basic-type event)
                     '(mouse-1 mouse-2 mouse-3)))
index e0aee67..be4c7e7 100644 (file)
@@ -72,7 +72,7 @@
   :group 'diff-mode)
 
 (defcustom diff-jump-to-old-file nil
-  "*Non-nil means `diff-goto-source' jumps to the old file.
+  "Non-nil means `diff-goto-source' jumps to the old file.
 Else, it jumps to the new file."
   :type 'boolean
   :group 'diff-mode)
@@ -155,7 +155,7 @@ when editing big diffs)."
     ("\C-c\C-u" . diff-context->unified)
     ;; `d' because it duplicates the context :-(  --Stef
     ("\C-c\C-d" . diff-unified->context)
-    ("\C-c\C-w" . diff-refine-hunk)
+    ("\C-c\C-w" . diff-refine-ignore-spaces-hunk)
     ("\C-c\C-f" . next-error-follow-minor-mode))
   "Keymap for `diff-mode'.  See also `diff-mode-shared-map'.")
 
@@ -172,8 +172,8 @@ when editing big diffs)."
     ["Unified -> Context"      diff-unified->context   t]
     ;;["Fixup Headers"         diff-fixup-modifs       (not buffer-read-only)]
     "-----"
-    ["Split hunk"              diff-split-hunk         t]
-    ["Refine hunk"             diff-refine-hunk        t]
+    ["Split hunk"              diff-split-hunk         (diff-splittable-p)]
+    ["Refine hunk"             diff-refine-ignore-spaces-hunk t]
     ["Kill current hunk"       diff-hunk-kill          t]
     ["Kill current file's hunks" diff-file-kill        t]
     "-----"
@@ -349,8 +349,11 @@ when editing big diffs)."
     ("^--- .+ ----$"             . diff-hunk-header-face) ;context
     ("^[0-9,]+[acd][0-9,]+$"     . diff-hunk-header-face) ;normal
     ("^---$"                     . diff-hunk-header-face) ;normal
-    ("^\\(---\\|\\+\\+\\+\\|\\*\\*\\*\\) \\(\\S-+\\)\\(.*[^*-]\\)?\n"
-     (0 diff-header-face) (2 diff-file-header-face prepend))
+    ;; For file headers, accept files with spaces, but be careful to rule
+    ;; out false-positives when matching hunk headers.
+    ("^\\(---\\|\\+\\+\\+\\|\\*\\*\\*\\) \\([^\t\n]+?\\)\\(?:\t.*\\| \\(\\*\\*\\*\\*\\|----\\)\\)?\n"
+     (0 diff-header-face)
+     (2 (if (not (match-end 3)) diff-file-header-face) prepend))
     ("^\\([-<]\\)\\(.*\n\\)"
      (1 diff-indicator-removed-face) (2 diff-removed-face))
     ("^\\([+>]\\)\\(.*\n\\)"
@@ -416,13 +419,29 @@ but in the file header instead, in which case move forward to the first hunk."
          (diff-beginning-of-file-and-junk)
          (diff-hunk-next))))))
 
+(defun diff-unified-hunk-p ()
+  (save-excursion
+    (ignore-errors
+      (diff-beginning-of-hunk)
+      (looking-at "^@@"))))
+
 (defun diff-beginning-of-file ()
   (beginning-of-line)
   (unless (looking-at diff-file-header-re)
-    (forward-line 2)
-    (condition-case ()
-       (re-search-backward diff-file-header-re)
-      (error (error "Can't find the beginning of the file")))))
+    (let ((start (point))
+          res)
+      ;; diff-file-header-re may need to match up to 4 lines, so in case
+      ;; we're inside the header, we need to move up to 3 lines forward.
+      (forward-line 3)
+      (if (and (setq res (re-search-backward diff-file-header-re nil t))
+               ;; Maybe the 3 lines forward were too much and we matched
+               ;; a file header after our starting point :-(
+               (or (<= (point) start)
+                   (setq res (re-search-backward diff-file-header-re nil t))))
+          res
+        (goto-char start)
+        (error "Can't find the beginning of the file")))))
+        
 
 (defun diff-end-of-file ()
   (re-search-forward "^[-+#!<>0-9@* \\]" nil t)
@@ -475,26 +494,34 @@ If the prefix ARG is given, restrict the view to the current file instead."
   "Go to the beginning of file-related diff-info.
 This is like `diff-beginning-of-file' except it tries to skip back over leading
 data such as \"Index: ...\" and such."
-  (let ((start (point))
-        (file (condition-case err (progn (diff-beginning-of-file) (point))
-                (error err)))
-        ;; prevhunk is one of the limits.
-        (prevhunk (save-excursion (ignore-errors (diff-hunk-prev) (point))))
-        err)
-    (when (consp file)
-      ;; Presumably, we started before the file header, in the leading junk.
-      (setq err file)
-      (diff-file-next)
-      (setq file (point)))
-    (let ((index (save-excursion
-                   (re-search-backward "^Index: " prevhunk t))))
-      (when index (setq file index))
-      (if (<= file start)
-          (goto-char file)
-        ;; File starts *after* the starting point: we really weren't in
-        ;; a file diff but elsewhere.
-        (goto-char start)
-        (signal (car err) (cdr err))))))
+  (let* ((start (point))
+         (prevfile (condition-case err
+                       (save-excursion (diff-beginning-of-file) (point))
+                     (error err)))
+         (err (if (consp prevfile) prevfile))
+         (nextfile (ignore-errors
+                     (save-excursion
+                       (goto-char start) (diff-file-next) (point))))
+         ;; prevhunk is one of the limits.
+         (prevhunk (save-excursion
+                     (ignore-errors
+                       (if (numberp prevfile) (goto-char prevfile))
+                       (diff-hunk-prev) (point))))
+         (previndex (save-excursion
+                      (re-search-backward "^Index: " prevhunk t))))
+    ;; If we're in the junk, we should use nextfile instead of prevfile.
+    (if (and (numberp nextfile)
+             (or (not (numberp prevfile))
+                 (and previndex (> previndex prevfile))))
+        (setq prevfile nextfile))
+    (if (and previndex (numberp prevfile) (< previndex prevfile))
+        (setq prevfile previndex))
+    (if (and (numberp prevfile) (<= prevfile start))
+        (goto-char prevfile)
+      ;; File starts *after* the starting point: we really weren't in
+      ;; a file diff but elsewhere.
+      (goto-char start)
+      (signal (car err) (cdr err)))))
           
 (defun diff-file-kill ()
   "Kill current file's hunks."
@@ -528,6 +555,13 @@ data such as \"Index: ...\" and such."
       (while (re-search-forward re end t) (incf n))
       n)))
 
+(defun diff-splittable-p ()
+  (save-excursion
+    (beginning-of-line)
+    (and (looking-at "^[-+ ]")
+         (progn (forward-line -1) (looking-at "^[-+ ]"))
+         (diff-unified-hunk-p))))
+
 (defun diff-split-hunk ()
   "Split the current (unified diff) hunk at point into two hunks."
   (interactive)
@@ -622,9 +656,11 @@ If the OLD prefix arg is passed, tell the file NAME of the old file."
               (list (if old (match-string 2) (match-string 4))
                     (if old (match-string 4) (match-string 2)))))))))
 
-(defun diff-find-file-name (&optional old prefix)
+(defun diff-find-file-name (&optional old batch prefix)
   "Return the file corresponding to the current patch.
 Non-nil OLD means that we want the old file.
+Non-nil BATCH means to prefer returning an incorrect answer than to prompt
+the user.
 PREFIX is only used internally: don't use it."
   (save-excursion
     (unless (looking-at diff-file-header-re)
@@ -659,7 +695,10 @@ PREFIX is only used internally: don't use it."
            (boundp 'cvs-pcl-cvs-dirchange-re)
            (save-excursion
              (re-search-backward cvs-pcl-cvs-dirchange-re nil t))
-           (diff-find-file-name old (match-string 1)))
+           (diff-find-file-name old batch (match-string 1)))
+       ;; Invent something, if necessary.
+       (when batch
+         (or (car fs) default-directory))
        ;; if all else fails, ask the user
        (let ((file (read-file-name (format "Use file %s: " (or (first fs) ""))
                                   nil (first fs) t (first fs))))
@@ -707,7 +746,12 @@ else cover the whole buffer."
            (let ((line1 (match-string 4))
                  (lines1 (match-string 5))
                  (line2 (match-string 6))
-                 (lines2 (match-string 7)))
+                 (lines2 (match-string 7))
+                 ;; Variables to use the special undo function.
+                 (old-undo buffer-undo-list)
+                 (old-end (marker-position end))
+                 (start (match-beginning 0))
+                 (reversible t))
              (replace-match
               (concat "***************\n*** " line1 ","
                       (number-to-string (+ (string-to-number line1)
@@ -749,6 +793,14 @@ else cover the whole buffer."
                  (if (not (save-excursion (re-search-forward "^+" nil t)))
                      (delete-region (point) (point-max))
                    (let ((modif nil) (delete nil))
+                     (if (save-excursion (re-search-forward "^\\+.*\n-" nil t))
+                          ;; Normally, lines in a substitution come with
+                          ;; first the removals and then the additions, and
+                          ;; the context->unified function follows this
+                          ;; convention, of course.  Yet, other alternatives
+                          ;; are valid as well, but they preclude the use of
+                          ;; context->unified as an undo command.
+                         (setq reversible nil))
                      (while (not (eobp))
                        (case (char-after)
                          (?\s (insert " ") (setq modif nil) (backward-char 1))
@@ -767,7 +819,15 @@ else cover the whole buffer."
                          (forward-line 1)
                          (when delete
                            (delete-region last-pt (point))
-                           (setq delete nil)))))))))))))))
+                           (setq delete nil)))))))
+               (unless (or (not reversible) (eq buffer-undo-list t))
+                  ;; Drop the many undo entries and replace them with
+                  ;; a single entry that uses diff-context->unified to do
+                  ;; the work.
+                 (setq buffer-undo-list
+                       (cons (list 'apply (- old-end end) start (point-max)
+                                   'diff-context->unified start (point-max))
+                             old-undo)))))))))))
 
 (defun diff-context->unified (start end &optional to-context)
   "Convert context diffs to unified diffs.
@@ -1313,7 +1373,7 @@ Whitespace differences are ignored."
        (if (> (- (car forw) orig) (- orig (car back))) back forw)
       (or back forw))))
 
-(defsubst diff-xor (a b) (if a (not b) b))
+(defsubst diff-xor (a b) (if a (if (not b) a) b))
 
 (defun diff-find-source-location (&optional other-file reverse)
   "Find out (BUF LINE-OFFSET POS SRC DST SWITCHED).
@@ -1396,8 +1456,15 @@ the value of this variable when given an appropriate prefix argument).
 With a prefix argument, REVERSE the hunk."
   (interactive "P")
   (destructuring-bind (buf line-offset pos old new &optional switched)
-      ;; If REVERSE go to the new file, otherwise go to the old.
-      (diff-find-source-location (not reverse) reverse)
+      ;; Sometimes we'd like to have the following behavior: if REVERSE go
+      ;; to the new file, otherwise go to the old.  But that means that by
+      ;; default we use the old file, which is the opposite of the default
+      ;; for diff-goto-source, and is thus confusing.  Also when you don't
+      ;; know about it it's pretty surprising.
+      ;; TODO: make it possible to ask explicitly for this behavior.
+      ;; 
+      ;; This is duplicated in diff-test-hunk.
+      (diff-find-source-location nil reverse)
     (cond
      ((null line-offset)
       (error "Can't find the text to patch"))
@@ -1441,8 +1508,7 @@ With a prefix argument, REVERSE the hunk."
 With a prefix argument, try to REVERSE the hunk."
   (interactive "P")
   (destructuring-bind (buf line-offset pos src dst &optional switched)
-      ;; If REVERSE go to the new file, otherwise go to the old.
-      (diff-find-source-location (not reverse) reverse)
+      (diff-find-source-location nil reverse)
     (set-window-point (display-buffer buf) (+ (car pos) (cdr src)))
     (diff-hunk-status-msg line-offset (diff-xor reverse switched) t)))
 
@@ -1493,7 +1559,7 @@ For use in `add-log-current-defun-function'."
            (goto-char (+ (car pos) (cdr src)))
            (add-log-current-defun))))))
 
-(defun diff-refine-hunk ()
+(defun diff-refine-ignore-spaces-hunk ()
   "Refine the current hunk by ignoring space differences."
   (interactive)
   (let* ((char-offset (- (point) (progn (diff-beginning-of-hunk 'try-harder)
index 75ae34d..b063c07 100644 (file)
@@ -125,9 +125,13 @@ With prefix arg, prompt for diff switches."
        (erase-buffer))
       (buffer-enable-undo (current-buffer))
       (diff-mode)
+      ;; Use below 2 vars for backward-compatibility.
+      (set (make-local-variable 'diff-old-file) old)
+      (set (make-local-variable 'diff-new-file) new)
+      (set (make-local-variable 'diff-extra-args) (list switches no-async))
       (set (make-local-variable 'revert-buffer-function)
-          `(lambda (ignore-auto noconfirm)
-             (diff ',old ',new ',switches ',no-async)))
+          (lambda (ignore-auto noconfirm)
+             (apply 'diff diff-old-file diff-new-file diff-extra-args)))
       (set (make-local-variable 'diff-old-temp-file) old-alt)
       (set (make-local-variable 'diff-new-temp-file) new-alt)
       (setq default-directory thisdir)
@@ -187,5 +191,5 @@ With prefix arg, prompt for diff switches."
 
 (provide 'diff)
 
-;;; arch-tag: 7de2c29b-7ea5-4b85-9b9d-72dd860de2bd
+;; arch-tag: 7de2c29b-7ea5-4b85-9b9d-72dd860de2bd
 ;;; diff.el ends here
index 4d9849c..124c53b 100644 (file)
@@ -582,18 +582,6 @@ can be produced by `dired-get-marked-files', for example."
   ;; Return nil for sake of nconc in dired-bunch-files.
   nil)
 \f
-;; In Emacs 19 this will return program's exit status.
-;; This is a separate function so that ange-ftp can redefine it.
-(defun dired-call-process (program discard &rest arguments)
-;  "Run PROGRAM with output to current buffer unless DISCARD is t.
-;Remaining arguments are strings passed as command arguments to PROGRAM."
-  ;; Look for a handler for default-directory in case it is a remote file name.
-  (let ((handler
-        (find-file-name-handler (directory-file-name default-directory)
-                                'dired-call-process)))
-    (if handler (apply handler 'dired-call-process
-                      program discard arguments)
-      (apply 'call-process program nil (not discard) nil arguments))))
 
 (defun dired-check-process (msg program &rest arguments)
 ;  "Display MSG while running PROGRAM, and check for output.
@@ -610,8 +598,7 @@ can be produced by `dired-get-marked-files', for example."
       (set-buffer err-buffer)
       (erase-buffer)
       (setq default-directory dir      ; caller's default-directory
-           err (not (eq 0
-                (apply (function dired-call-process) program nil arguments))))
+           err (not (eq 0 (apply 'process-file program nil t nil arguments))))
       (if err
          (progn
            (dired-log (concat program " " (prin1-to-string arguments) "\n"))
@@ -1203,7 +1190,7 @@ Special value `always' suppresses confirmation."
              ;; It is a symlink
              (make-symbolic-link (car attrs) to ok-flag)
            (copy-file from to ok-flag dired-copy-preserve-time))
-       (file-date-error 
+       (file-date-error
         (push (dired-make-relative from)
               dired-create-files-failures)
         (dired-log "Can't set date on %s:\n%s\n" from err))))))
index bd160df..d263f0b 100644 (file)
@@ -1247,6 +1247,7 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
     (define-key map "$" 'dired-hide-subdir)
     (define-key map "\M-$" 'dired-hide-all)
     ;; misc
+    (define-key map "\C-x\C-q" 'dired-toggle-read-only)
     (define-key map "?" 'dired-summary)
     (define-key map "\177" 'dired-unmark-backward)
     (define-key map [remap undo] 'dired-undo)
@@ -1352,7 +1353,8 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
     (define-key map [menu-bar immediate create-directory]
       '(menu-item "Create Directory..." dired-create-directory))
     (define-key map [menu-bar immediate wdired-mode]
-      '(menu-item "Edit File Names" wdired-change-to-wdired-mode))
+      '(menu-item "Edit File Names" wdired-change-to-wdired-mode
+                 :filter (lambda (x) (if (eq major-mode 'dired-mode) x))))
 
     (define-key map [menu-bar regexp]
       (cons "Regexp" (make-sparse-keymap "Regexp")))
@@ -1451,6 +1453,7 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
 
     (define-key map [menu-bar operate]
       (cons "Operate" (make-sparse-keymap "Operate")))
+
     (define-key map
       [menu-bar operate image-dired-delete-tag]
       '(menu-item "Delete Image Tag..." image-dired-delete-tag
@@ -1654,6 +1657,16 @@ You can use it to recover marks, killed lines or subdirs."
   (message "Change in dired buffer undone.
 Actual changes in files cannot be undone by Emacs."))
 
+(defun dired-toggle-read-only ()
+  "Edit dired buffer with Wdired, or set it read-only.
+Call `wdired-change-to-wdired-mode' in dired buffers whose editing is
+supported by Wdired (the major mode of the dired buffer is `dired-mode').
+Otherwise, for buffers inheriting from dired-mode, call `toggle-read-only'."
+  (interactive)
+  (if (eq major-mode 'dired-mode)
+      (wdired-change-to-wdired-mode)
+    (toggle-read-only)))
+
 (defun dired-next-line (arg)
   "Move down lines then position at filename.
 Optional prefix ARG says how many lines to move; default is one line."
@@ -2407,8 +2420,8 @@ Anything else, ask for each sub-directory."
   "In Dired, delete the files flagged for deletion.
 If NOMESSAGE is non-nil, we don't display any message
 if there are no flagged files.
-`dired-recursive-deletes' controls whether 
-deletion of non-empty directories is allowed."
+`dired-recursive-deletes' controls whether deletion of
+non-empty directories is allowed."
   (interactive)
   (let* ((dired-marker-char dired-del-marker)
         (regexp (dired-marker-regexp))
@@ -2425,8 +2438,8 @@ deletion of non-empty directories is allowed."
 
 (defun dired-do-delete (&optional arg)
   "Delete all marked (or next ARG) files.
-`dired-recursive-deletes' controls whether 
-deletion of non-empty directories is allowed."
+`dired-recursive-deletes' controls whether deletion of
+non-empty directories is allowed."
   ;; This is more consistent with the file marking feature than
   ;; dired-do-flagged-delete.
   (interactive "P")
index 5a9a696..4bf5289 100644 (file)
@@ -220,7 +220,7 @@ with either the `--unibyte' option or the EMACS_UNIBYTE environment
 variable, or else customize `enable-multibyte-characters'.
 
 With prefix argument, this command enables European character display
-if arg is positive, disables it otherwise.  Otherwise, it toggles
+if ARG is positive, disables it otherwise.  Otherwise, it toggles
 European character display.
 
 When this mode is enabled, characters in the range of 160 to 255
@@ -264,5 +264,5 @@ for users who call this function in `.emacs'."
 
 (provide 'disp-table)
 
-;;; arch-tag: ffe4c28c-960c-47aa-b8a8-ae89d371ffc7
+;; arch-tag: ffe4c28c-960c-47aa-b8a8-ae89d371ffc7
 ;;; disp-table.el ends here
index 8843837..21bf73f 100644 (file)
@@ -102,7 +102,7 @@ that Ediff doesn't know about.")
        (boundp 'ediff-use-toolbar-p)
        ediff-use-toolbar-p))           ;Does the user want it ?
 
-;; Defines SYMBOL as an advertised local variable.
+;; Defines VAR as an advertised local variable.
 ;; Performs a defvar, then executes `make-variable-buffer-local' on
 ;; the variable.  Also sets the `permanent-local' property,
 ;; so that `kill-all-local-variables' (called by major-mode setting
@@ -110,6 +110,8 @@ that Ediff doesn't know about.")
 ;;
 ;; Plagiarised from `emerge-defvar-local' for XEmacs.
 (defmacro ediff-defvar-local (var value doc)
+  "Defines VAR as a local variable."
+  (declare (indent defun))
   `(progn
      (defvar ,var ,value ,doc)
      (make-variable-buffer-local ',var)
@@ -258,6 +260,8 @@ It needs to be killed when we quit the session.")
 ;; Doesn't save the point and mark.
 ;; This is `with-current-buffer' with the added test for live buffers."
 (defmacro ediff-with-current-buffer (buffer &rest body)
+  "Evaluates BODY in BUFFER."
+  (declare (indent 1) (debug (form body)))
   `(if (ediff-buffer-live-p ,buffer)
        (save-current-buffer
         (set-buffer ,buffer)
@@ -1873,11 +1877,11 @@ Unless optional argument INPLACE is non-nil, return a new string."
 
 
 
-;;; Local Variables:
-;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
-;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
-;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
-;;; End:
+;; Local Variables:
+;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
+;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
+;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
+;; End:
 
-;;; arch-tag: fa31d384-1e70-4d4b-82a7-3e96307c46f5
+;; arch-tag: fa31d384-1e70-4d4b-82a7-3e96307c46f5
 ;;; ediff-init.el ends here
index 5b8b8d8..d94e751 100644 (file)
 ;; the registry buffer
 (defvar ediff-registry-buffer nil)
 
-(defconst ediff-meta-buffer-message "This is an Ediff Session Group Panel: %s
+(defconst ediff-meta-buffer-brief-message "Ediff Session Group Panel: %s
 
-Useful commands:
+     Type ? to show useful commands in this buffer
+
+")
+
+(defconst ediff-meta-buffer-verbose-message "Ediff Session Group Panel: %s
+
+Useful commands (type ? to hide them and free up screen):
      button2, v, or RET over session record:   start that Ediff session
      M:\tin sessions invoked from here, brings back this group panel
      R:\tdisplay the registry of active Ediff sessions
@@ -360,10 +366,24 @@ buffers."
        (if (stringp (ediff-get-session-objC-name session-info))
           (file-directory-p (ediff-get-session-objC-name session-info)) t)))
 
+
+(ediff-defvar-local ediff-verbose-help-enabled nil
+  "If t, display redundant help in ediff-directories and other meta buffers.
+Toggled by ediff-toggle-verbose-help-meta-buffer" )
+  
+;; Toggle verbose help in meta-buffers
+;; TODO: Someone who understands all this can make it better.
+(defun ediff-toggle-verbose-help-meta-buffer ()
+  "Toggle showing tediously verbose help in meta buffers."
+  (interactive)
+  (setq ediff-verbose-help-enabled (not ediff-verbose-help-enabled))
+  (ediff-update-meta-buffer (current-buffer) 'must-redraw))
+
 ;; set up the keymap in the meta buffer
 (defun ediff-setup-meta-map ()
   (setq ediff-meta-buffer-map (make-sparse-keymap))
   (suppress-keymap ediff-meta-buffer-map)
+  (define-key ediff-meta-buffer-map "?" 'ediff-toggle-verbose-help-meta-buffer)
   (define-key ediff-meta-buffer-map "q" 'ediff-quit-meta-buffer)
   (define-key ediff-meta-buffer-map "T" 'ediff-toggle-filename-truncation)
   (define-key ediff-meta-buffer-map "R" 'ediff-show-registry)
@@ -924,27 +944,31 @@ behavior."
        (mapcar 'delete-overlay (overlays-in 1 1))  ; emacs
        )
 
-      (insert (format ediff-meta-buffer-message
-                     (ediff-abbrev-jobname ediff-metajob-name)))
-
       (setq regexp (ediff-get-group-regexp meta-list)
            merge-autostore-dir
            (ediff-get-group-merge-autostore-dir meta-list))
 
-      (cond ((ediff-collect-diffs-metajob)
-            (insert
-             "     P:\tcollect custom diffs of all marked sessions\n"))
-           ((ediff-patch-metajob)
-            (insert
-             "     P:\tshow patch appropriately for the context (session or group)\n")))
-      (insert
-       "     ^:\tshow parent session group\n")
-      (or (ediff-one-filegroup-metajob)
-         (insert
-          "     D:\tshow differences among directories\n"
-          "    ==:\tfor each session, show which files are identical\n"
-          "    =h:\tlike ==, but also marks those sessions for hiding\n"
-          "    =m:\tlike ==, but also marks those sessions for operation\n\n"))
+      (if ediff-verbose-help-enabled
+         (progn
+           (insert (format ediff-meta-buffer-verbose-message
+                           (ediff-abbrev-jobname ediff-metajob-name)))
+
+           (cond ((ediff-collect-diffs-metajob)
+                  (insert
+                   "     P:\tcollect custom diffs of all marked sessions\n"))
+                 ((ediff-patch-metajob)
+                  (insert
+                   "     P:\tshow patch appropriately for the context (session or group)\n")))
+           (insert
+            "     ^:\tshow parent session group\n")
+           (or (ediff-one-filegroup-metajob)
+               (insert
+                "     D:\tshow differences among directories\n"
+                "    ==:\tfor each session, show which files are identical\n"
+                "    =h:\tlike ==, but also marks sessions for hiding\n"
+                "    =m:\tlike ==, but also marks sessions for operation\n\n")))
+       (insert (format ediff-meta-buffer-brief-message
+                       (ediff-abbrev-jobname ediff-metajob-name))))
 
       (insert "\n")
       (if (and (stringp regexp) (> (length regexp) 0))
index 89d0893..7a46987 100644 (file)
@@ -134,11 +134,13 @@ patch.  So, don't change these variables, unless the default doesn't work."
   :type '(choice (const nil) string)
   :group 'ediff-ptch)
 
+;; This context diff does not recognize spaces inside files, but removing ' '
+;; from [^ \t] breaks normal patches for some reason
 (defcustom ediff-context-diff-label-regexp
   (concat "\\("        ; context diff 2-liner
-         "^\\*\\*\\* \\([^ \t]+\\)[^*]+[\t ]*\n--- \\([^ \t]+\\)"
+         "^\\*\\*\\* +\\([^ \t]+\\)[^*]+[\t ]*\n--- +\\([^ \t]+\\)"
          "\\|"         ; GNU unified format diff 2-liner
-         "^--- \\([^ \t]+\\)[\t ]+.*\n\\+\\+\\+ \\([^ \t]+\\)"
+         "^--- +\\([^ \t]+\\)[\t ]+.*\n\\+\\+\\+ +\\([^ \t]+\\)"
          "\\)")
   "*Regexp matching filename 2-liners at the start of each context diff.
 You probably don't want to change that, unless you are using an obscure patch
@@ -231,7 +233,7 @@ program."
            ;; possible-file-names is holding the new file names until we
            ;; insert the old file name in the patch map
            ;; It is a pair
-           ;;     (filename-from-1st-header-line . fn from 2nd line)
+           ;;     (filename-from-1st-header-line . filename-from-2nd-line)
            (setq possible-file-names
                  (cons (if (and beg1 end1)
                            (buffer-substring beg1 end1)
@@ -309,12 +311,13 @@ program."
                ;; these dirs lead to the actual files starting at the present
                ;; directory. So, we don't strip these relative dirs from the
                ;; file names. This is a heuristic intended to improve guessing
-               (unless (or (file-name-absolute-p base-dir1)
-                           (file-name-absolute-p base-dir2)
-                           (not (file-exists-p base-dir1))
-                           (not (file-exists-p base-dir2)))
-                 (setq base-dir1 ""
-                       base-dir2 ""))
+               (let ((default-directory (file-name-directory filename)))
+                 (unless (or (file-name-absolute-p base-dir1)
+                             (file-name-absolute-p base-dir2)
+                             (not (file-exists-p base-dir1))
+                             (not (file-exists-p base-dir2)))
+                   (setq base-dir1 ""
+                         base-dir2 "")))
                (or (string= (car proposed-file-names) "/dev/null")
                    (setcar proposed-file-names
                            (ediff-file-name-sans-prefix
index 1b1db4a..decff44 100644 (file)
@@ -4315,11 +4315,11 @@ Mail anyway? (y or n) ")
 (provide 'ediff-util)
 
 
-;;; Local Variables:
-;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
-;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
-;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
-;;; End:
+;; Local Variables:
+;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
+;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
+;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
+;; End:
 
-;;; arch-tag: f51099b6-ef4b-470f-88a1-3a0e0b03a879
+;; arch-tag: f51099b6-ef4b-470f-88a1-3a0e0b03a879
 ;;; ediff-util.el ends here
index 82a70e6..3970078 100644 (file)
@@ -7,8 +7,8 @@
 ;; Created: February 2, 1994
 ;; Keywords: comparing, merging, patching, tools, unix
 
-(defconst ediff-version "2.81.1" "The current version of Ediff")
-(defconst ediff-date "October 23, 2006" "Date of last update")
+(defconst ediff-version "2.81.2" "The current version of Ediff")
+(defconst ediff-date "June 13, 2007" "Date of last update")
 
 
 ;; This file is part of GNU Emacs.
index d914d40..15568e8 100644 (file)
@@ -430,10 +430,7 @@ doubt, use whitespace."
 
 (defun edmacro-format-keys (macro &optional verbose)
   (setq macro (edmacro-fix-menu-commands macro))
-  (let* ((maps (append (current-minor-mode-maps)
-                      (if (current-local-map)
-                          (list (current-local-map)))
-                      (list (current-global-map))))
+  (let* ((maps (current-active-maps))
         (pkeys '(end-macro ?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9 ?- ?\C-u
                  ?\M-- ?\M-0 ?\M-1 ?\M-2 ?\M-3 ?\M-4 ?\M-5 ?\M-6
                  ?\M-7 ?\M-8 ?\M-9))
index ed97c87..dbebf31 100644 (file)
@@ -2467,27 +2467,11 @@ will clear the cache."
   "Take a macro function DEFINITION and make a lambda out of it."
   `(cdr ,definition))
 
-;; There is no way to determine whether some subr is a special form or not,
-;; hence we need this list (which is probably out of date):
-(defvar ad-special-forms
-  (let ((tem '(and catch cond condition-case defconst defmacro
-                  defun defvar function if interactive let let*
-                  or prog1 prog2 progn quote save-current-buffer
-                  save-excursion save-restriction save-window-excursion
-                  setq setq-default unwind-protect while
-                  with-output-to-temp-buffer)))
-    ;; track-mouse could be void in some configurations.
-    (if (fboundp 'track-mouse)
-       (push 'track-mouse tem))
-    (mapcar 'symbol-function tem)))
-
-(defmacro ad-special-form-p (definition)
-  ;;"non-nil if DEFINITION is a special form."
-  (list 'memq definition 'ad-special-forms))
-
-(defmacro ad-interactive-p (definition)
-  ;;"non-nil if DEFINITION can be called interactively."
-  (list 'commandp definition))
+(defun ad-special-form-p (definition)
+  "Non-nil iff DEFINITION is a special form."
+  (if (and (symbolp definition) (fboundp definition))
+      (setq definition (indirect-function definition)))
+  (and (subrp definition) (eq (cdr (subr-arity definition)) 'unevalled)))
 
 (defmacro ad-subr-p (definition)
   ;;"non-nil if DEFINITION is a subr."
@@ -2603,13 +2587,12 @@ that property, or otherwise use `(&rest ad-subr-args)'."
        docstring)))
 
 (defun ad-interactive-form (definition)
-  "Return the interactive form of DEFINITION."
-  (cond ((ad-compiled-p definition)
-        (and (commandp definition)
-             (list 'interactive (aref (ad-compiled-code definition) 5))))
-       ((or (ad-advice-p definition)
-            (ad-lambda-p definition))
-        (commandp (ad-lambda-expression definition)))))
+  "Return the interactive form of DEFINITION.
+Like `interactive-form', but also works on pieces of advice."
+  (interactive-form
+   (if (ad-advice-p definition)
+       (ad-lambda-expression definition)
+     definition)))
 
 (defun ad-body-forms (definition)
   "Return the list of body forms of DEFINITION."
@@ -3063,7 +3046,7 @@ in any of these classes."
           (ad-has-redefining-advice function))
       (let* ((origdef (ad-real-orig-definition function))
             (origname (ad-get-advice-info-field function 'origname))
-            (orig-interactive-p (ad-interactive-p origdef))
+            (orig-interactive-p (commandp origdef))
             (orig-subr-p (ad-subr-p origdef))
             (orig-special-form-p (ad-special-form-p origdef))
             (orig-macro-p (ad-macro-p origdef))
@@ -3075,15 +3058,11 @@ in any of these classes."
             (interactive-form
              (cond (orig-macro-p nil)
                    (advised-interactive-form)
-                   ((ad-interactive-form origdef)
-                    (if (and (symbolp function) (get function 'elp-info))
-                        (interactive-form (aref (get function 'elp-info) 2))
-                      (ad-interactive-form origdef)))
-                   ;; Otherwise we must have a subr: make it interactive if
-                   ;; we have to and initialize required arguments in case
-                   ;; it is called interactively:
-                   (orig-interactive-p
-                    (interactive-form origdef))))
+                   ((interactive-form origdef)
+                    (interactive-form
+                      (if (and (symbolp function) (get function 'elp-info))
+                          (aref (get function 'elp-info) 2)
+                        origdef)))))
             (orig-form
              (cond ((or orig-special-form-p orig-macro-p)
                     ;; Special forms and macros will be advised into macros.
@@ -3306,8 +3285,8 @@ advised definition from scratch."
              t
            (ad-arglist original-definition function))
          (if (eq (ad-definition-type original-definition) 'function)
-             (equal (ad-interactive-form original-definition)
-                    (ad-interactive-form cached-definition))))))
+             (equal (interactive-form original-definition)
+                    (interactive-form cached-definition))))))
 
 (defun ad-get-cache-class-id (function class)
   "Return the part of FUNCTION's cache id that identifies CLASS."
@@ -3354,8 +3333,8 @@ advised definition from scratch."
                       (ad-arglist cached-definition))
                (setq code 'interactive-form-mismatch)
                (or (null (nth 5 cache-id))
-                   (equal (ad-interactive-form original-definition)
-                          (ad-interactive-form cached-definition)))
+                   (equal (interactive-form original-definition)
+                          (interactive-form cached-definition)))
                (setq code 'verified))))
     code))
 
index ee6c229..14877e1 100644 (file)
 A `.el' file can set this in its local variables section to make its
 autoloads go somewhere else.  The autoload file is assumed to contain a
 trailer starting with a FormFeed character.")
+;;;###autoload
+(put 'generated-autoload-file 'safe-local-variable 'stringp)
 
-(defconst generate-autoload-cookie ";;;###autoload"
+;; This feels like it should be a defconst, but MH-E sets it to
+;; ";;;###mh-autoload" for the autoloads that are to go into mh-loaddefs.el.
+(defvar generate-autoload-cookie ";;;###autoload"
   "Magic comment indicating the following form should be autoloaded.
 Used by \\[update-file-autoloads].  This string should be
 meaningless to Lisp (e.g., a comment).
 
 This string is used:
 
-;;;###autoload
+\;;;###autoload
 \(defun function-to-be-autoloaded () ...)
 
 If this string appears alone on a line, the following form will be
@@ -65,6 +69,8 @@ that text will be copied verbatim to `generated-autoload-file'.")
 (defconst generate-autoload-section-continuation ";;;;;; "
   "String to add on each continuation of the section header form.")
 
+(defvar autoload-modified-buffers)      ;Dynamically scoped var.
+
 (defun make-autoload (form file)
   "Turn FORM into an autoload or defvar for source file FILE.
 Returns nil if FORM is not a special autoload form (i.e. a function definition
@@ -149,16 +155,14 @@ or macro definition or a defcustom)."
 ;; the doc-string in FORM.
 ;; Those properties are now set in lisp-mode.el.
 
+(defun autoload-generated-file ()
+  (expand-file-name generated-autoload-file
+                    ;; File-local settings of generated-autoload-file should
+                    ;; be interpreted relative to the file's location,
+                    ;; of course.
+                    (if (not (local-variable-p 'generated-autoload-file))
+                        (expand-file-name "lisp" source-directory))))
 
-(defun autoload-trim-file-name (file)
-  ;; Returns a relative file path for FILE
-  ;; starting from the directory that loaddefs.el is in.
-  ;; That is normally a directory in load-path,
-  ;; which means Emacs will be able to find FILE when it looks.
-  ;; Any extra directory names here would prevent finding the file.
-  (setq file (expand-file-name file))
-  (file-relative-name file
-                     (file-name-directory generated-autoload-file)))
 
 (defun autoload-read-section-header ()
   "Read a section header form.
@@ -205,6 +209,7 @@ put the output in."
            (setcdr p nil)
            (princ "\n(" outbuf)
            (let ((print-escape-newlines t)
+                  (print-quoted t)
                  (print-escape-nonascii t))
              (dolist (elt form)
                (prin1 elt outbuf)
@@ -228,6 +233,7 @@ put the output in."
                       outbuf))
              (terpri outbuf)))
        (let ((print-escape-newlines t)
+              (print-quoted t)
              (print-escape-nonascii t))
          (print form outbuf)))))))
 
@@ -253,9 +259,7 @@ put the output in."
   "Insert the section-header line,
 which lists the file name and which functions are in it, etc."
   (insert generate-autoload-section-header)
-  (prin1 (list 'autoloads autoloads load-name
-              (if (stringp file) (autoload-trim-file-name file) file)
-              time)
+  (prin1 (list 'autoloads autoloads load-name file time)
         outbuf)
   (terpri outbuf)
   ;; Break that line at spaces, to avoid very long lines.
@@ -272,12 +276,14 @@ which lists the file name and which functions are in it, etc."
 (defun autoload-find-file (file)
   "Fetch file and put it in a temp buffer.  Return the buffer."
   ;; It is faster to avoid visiting the file.
+  (setq file (expand-file-name file))
   (with-current-buffer (get-buffer-create " *autoload-file*")
     (kill-all-local-variables)
     (erase-buffer)
     (setq buffer-undo-list t
           buffer-read-only nil)
     (emacs-lisp-mode)
+    (setq default-directory (file-name-directory file))
     (insert-file-contents file nil)
     (let ((enable-local-variables :safe))
       (hack-local-variables))
@@ -286,6 +292,12 @@ which lists the file name and which functions are in it, etc."
 (defvar no-update-autoloads nil
   "File local variable to prevent scanning this file for autoload cookies.")
 
+(defun autoload-file-load-name (file)
+  (let ((name (file-name-nondirectory file)))
+    (if (string-match "\\.elc?\\(\\.\\|\\'\\)" name)
+        (substring name 0 (match-beginning 0))
+      name)))
+
 (defun generate-file-autoloads (file)
   "Insert at point a loaddefs autoload section for FILE.
 Autoloads are generated for defuns and defmacros in FILE
@@ -294,100 +306,155 @@ If FILE is being visited in a buffer, the contents of the buffer
 are used.
 Return non-nil in the case where no autoloads were added at point."
   (interactive "fGenerate autoloads for file: ")
-  (let ((outbuf (current-buffer))
-       (autoloads-done '())
-       (load-name (let ((name (file-name-nondirectory file)))
-                    (if (string-match "\\.elc?\\(\\.\\|$\\)" name)
-                        (substring name 0 (match-beginning 0))
-                      name)))
-       (print-length nil)
-       (print-readably t)              ; This does something in Lucid Emacs.
-       (float-output-format nil)
-       (done-any nil)
-       (visited (get-file-buffer file))
-        output-start)
-
-    ;; If the autoload section we create here uses an absolute
-    ;; file name for FILE in its header, and then Emacs is installed
-    ;; under a different path on another system,
-    ;; `update-autoloads-here' won't be able to find the files to be
-    ;; autoloaded.  So, if FILE is in the same directory or a
-    ;; subdirectory of the current buffer's directory, we'll make it
-    ;; relative to the current buffer's directory.
-    (setq file (expand-file-name file))
-    (let* ((source-truename (file-truename file))
-          (dir-truename (file-name-as-directory
-                         (file-truename default-directory)))
-          (len (length dir-truename)))
-      (if (and (< len (length source-truename))
-              (string= dir-truename (substring source-truename 0 len)))
-         (setq file (substring source-truename len))))
-
-    (with-current-buffer (or visited
-                             ;; It is faster to avoid visiting the file.
-                             (autoload-find-file file))
-      ;; Obey the no-update-autoloads file local variable.
-      (unless no-update-autoloads
-        (message "Generating autoloads for %s..." file)
-        (setq output-start (with-current-buffer outbuf (point)))
-        (save-excursion
-          (save-restriction
-            (widen)
-            (goto-char (point-min))
-            (while (not (eobp))
-              (skip-chars-forward " \t\n\f")
-              (cond
-               ((looking-at (regexp-quote generate-autoload-cookie))
-                (search-forward generate-autoload-cookie)
-                (skip-chars-forward " \t")
-                (setq done-any t)
-                (if (eolp)
-                    ;; Read the next form and make an autoload.
-                    (let* ((form (prog1 (read (current-buffer))
-                                   (or (bolp) (forward-line 1))))
-                           (autoload (make-autoload form load-name)))
-                      (if autoload
-                          (push (nth 1 form) autoloads-done)
-                        (setq autoload form))
-                      (let ((autoload-print-form-outbuf outbuf))
-                        (autoload-print-form autoload)))
-
-                  ;; Copy the rest of the line to the output.
-                  (princ (buffer-substring
-                          (progn
-                            ;; Back up over whitespace, to preserve it.
-                            (skip-chars-backward " \f\t")
-                            (if (= (char-after (1+ (point))) ? )
-                                ;; Eat one space.
-                                (forward-char 1))
-                            (point))
-                          (progn (forward-line 1) (point)))
-                         outbuf)))
-               ((looking-at ";")
-                ;; Don't read the comment.
-                (forward-line 1))
-               (t
-                (forward-sexp 1)
-                (forward-line 1))))))
-
-        (when done-any
-          (with-current-buffer outbuf
-            (save-excursion
-              ;; Insert the section-header line which lists the file name
-              ;; and which functions are in it, etc.
-              (goto-char output-start)
-              (autoload-insert-section-header
-               outbuf autoloads-done load-name file
-               (nth 5 (file-attributes file)))
-              (insert ";;; Generated autoloads from "
-                      (autoload-trim-file-name file) "\n"))
-            (insert generate-autoload-section-trailer)))
-        (message "Generating autoloads for %s...done" file))
-      (or visited
-          ;; We created this buffer, so we should kill it.
-          (kill-buffer (current-buffer))))
-    (not done-any)))
+  (autoload-generate-file-autoloads file (current-buffer)))
+
+;; When called from `generate-file-autoloads' we should ignore
+;; `generated-autoload-file' altogether.  When called from
+;; `update-file-autoloads' we don't know `outbuf'.  And when called from
+;; `update-directory-autoloads' it's in between: we know the default
+;; `outbuf' but we should obey any file-local setting of
+;; `generated-autoload-file'.
+(defun autoload-generate-file-autoloads (file &optional outbuf outfile)
+  "Insert an autoload section for FILE in the appropriate buffer.
+Autoloads are generated for defuns and defmacros in FILE
+marked by `generate-autoload-cookie' (which see).
+If FILE is being visited in a buffer, the contents of the buffer are used.
+OUTBUF is the buffer in which the autoload statements should be inserted.
+If OUTBUF is nil, it will be determined by `autoload-generated-file'.
+
+If provided, OUTFILE is expected to be the file name of OUTBUF.
+If OUTFILE is non-nil and FILE specifies a `generated-autoload-file'
+different from OUTFILE, then OUTBUF is ignored.
+
+Return non-nil iff FILE adds no autoloads to OUTFILE
+\(or OUTBUF if OUTFILE is nil)."
+  (catch 'done
+    (let ((autoloads-done '())
+          (load-name (autoload-file-load-name file))
+          (print-length nil)
+          (print-readably t)           ; This does something in Lucid Emacs.
+          (float-output-format nil)
+          (visited (get-file-buffer file))
+          (otherbuf nil)
+          (absfile (expand-file-name file))
+          relfile
+          ;; nil until we found a cookie.
+          output-start)
+
+      (with-current-buffer (or visited
+                               ;; It is faster to avoid visiting the file.
+                               (autoload-find-file file))
+        ;; Obey the no-update-autoloads file local variable.
+        (unless no-update-autoloads
+          (message "Generating autoloads for %s..." file)
+          (save-excursion
+            (save-restriction
+              (widen)
+              (goto-char (point-min))
+              (while (not (eobp))
+                (skip-chars-forward " \t\n\f")
+                (cond
+                 ((looking-at (regexp-quote generate-autoload-cookie))
+                  ;; If not done yet, figure out where to insert this text.
+                  (unless output-start
+                    (when (and outfile
+                               (not (equal outfile (autoload-generated-file))))
+                      ;; A file-local setting of autoload-generated-file says
+                      ;; we should ignore OUTBUF.
+                      (setq outbuf nil)
+                      (setq otherbuf t))
+                    (unless outbuf
+                      (setq outbuf (autoload-find-destination absfile))
+                      (unless outbuf
+                        ;; The file has autoload cookies, but they're
+                        ;; already up-to-date.  If OUTFILE is nil, the
+                        ;; entries are in the expected OUTBUF, otherwise
+                        ;; they're elsewhere.
+                        (throw 'done outfile)))
+                    (with-current-buffer outbuf
+                      (setq relfile (file-relative-name absfile))
+                      (setq output-start (point)))
+                    ;; (message "file=%S, relfile=%S, dest=%S"
+                    ;;          file relfile (autoload-generated-file))
+                    )
+                  (search-forward generate-autoload-cookie)
+                  (skip-chars-forward " \t")
+                  (if (eolp)
+                      (condition-case err
+                          ;; Read the next form and make an autoload.
+                          (let* ((form (prog1 (read (current-buffer))
+                                         (or (bolp) (forward-line 1))))
+                                 (autoload (make-autoload form load-name)))
+                            (if autoload
+                                (push (nth 1 form) autoloads-done)
+                              (setq autoload form))
+                            (let ((autoload-print-form-outbuf outbuf))
+                              (autoload-print-form autoload)))
+                        (error
+                         (message "Error in %s: %S" file err)))
+
+                    ;; Copy the rest of the line to the output.
+                    (princ (buffer-substring
+                            (progn
+                              ;; Back up over whitespace, to preserve it.
+                              (skip-chars-backward " \f\t")
+                              (if (= (char-after (1+ (point))) ? )
+                                  ;; Eat one space.
+                                  (forward-char 1))
+                              (point))
+                            (progn (forward-line 1) (point)))
+                           outbuf)))
+                 ((looking-at ";")
+                  ;; Don't read the comment.
+                  (forward-line 1))
+                 (t
+                  (forward-sexp 1)
+                  (forward-line 1))))))
+
+          (when output-start
+            (let ((secondary-autoloads-file-buf
+                   (if (local-variable-p 'generated-autoload-file)
+                       (current-buffer))))
+              (with-current-buffer outbuf
+                (save-excursion
+                  ;; Insert the section-header line which lists the file name
+                  ;; and which functions are in it, etc.
+                  (goto-char output-start)
+                  (autoload-insert-section-header
+                   outbuf autoloads-done load-name relfile
+                   (if secondary-autoloads-file-buf
+                       ;; MD5 checksums are much better because they do not
+                       ;; change unless the file changes (so they'll be
+                       ;; equal on two different systems and will change
+                       ;; less often than time-stamps, thus leading to fewer
+                       ;; unneeded changes causing spurious conflicts), but
+                       ;; using time-stamps is a very useful optimization,
+                       ;; so we use time-stamps for the main autoloads file
+                       ;; (loaddefs.el) where we have special ways to
+                       ;; circumvent the "random change problem", and MD5
+                       ;; checksum in secondary autoload files where we do
+                       ;; not need the time-stamp optimization because it is
+                       ;; already provided by the primary autoloads file.
+                       (md5 secondary-autoloads-file-buf
+                            ;; We'd really want to just use
+                            ;; `emacs-internal' instead.
+                            nil nil 'emacs-mule-unix)
+                     (nth 5 (file-attributes relfile))))
+                  (insert ";;; Generated autoloads from " relfile "\n"))
+                (insert generate-autoload-section-trailer))))
+          (message "Generating autoloads for %s...done" file))
+        (or visited
+            ;; We created this buffer, so we should kill it.
+            (kill-buffer (current-buffer))))
+      ;; If the entries were added to some other buffer, then the file
+      ;; doesn't add entries to OUTFILE.
+      (or (not output-start) otherbuf))))
 \f
+(defun autoload-save-buffers ()
+  (while autoload-modified-buffers
+    (with-current-buffer (pop autoload-modified-buffers)
+      (save-buffer))))
+
 ;;;###autoload
 (defun update-file-autoloads (file &optional save-after)
   "Update the autoloads for FILE in `generated-autoload-file'
@@ -397,80 +464,80 @@ save the buffer too.
 
 Return FILE if there was no autoload cookie in it, else nil."
   (interactive "fUpdate autoloads for file: \np")
-  (let ((load-name (let ((name (file-name-nondirectory file)))
-                    (if (string-match "\\.elc?\\(\\.\\|$\\)" name)
-                        (substring name 0 (match-beginning 0))
-                      name)))
-       (found nil)
-       (existing-buffer (get-file-buffer file))
-       (no-autoloads nil))
-    (save-excursion
-      ;; We want to get a value for generated-autoload-file from
-      ;; the local variables section if it's there.
-      (if existing-buffer
-         (set-buffer existing-buffer))
-      ;; We must read/write the file without any code conversion,
-      ;; but still decode EOLs.
-      (let ((coding-system-for-read 'raw-text))
-       (set-buffer (find-file-noselect
-                    (autoload-ensure-default-file
-                     (expand-file-name generated-autoload-file
-                                       (expand-file-name "lisp"
-                                                         source-directory)))))
-       ;; This is to make generated-autoload-file have Unix EOLs, so
-       ;; that it is portable to all platforms.
-       (setq buffer-file-coding-system 'raw-text-unix))
-      (or (> (buffer-size) 0)
-         (error "Autoloads file %s does not exist" buffer-file-name))
-      (or (file-writable-p buffer-file-name)
-         (error "Autoloads file %s is not writable" buffer-file-name))
-      (save-excursion
-       (save-restriction
-         (widen)
-         (goto-char (point-min))
-         ;; Look for the section for LOAD-NAME.
-         (while (and (not found)
-                     (search-forward generate-autoload-section-header nil t))
-           (let ((form (autoload-read-section-header)))
-             (cond ((string= (nth 2 form) load-name)
-                    ;; We found the section for this file.
-                    ;; Check if it is up to date.
-                    (let ((begin (match-beginning 0))
-                          (last-time (nth 4 form))
-                          (file-time (nth 5 (file-attributes file))))
-                      (if (and (or (null existing-buffer)
-                                   (not (buffer-modified-p existing-buffer)))
-                               (listp last-time) (= (length last-time) 2)
-                               (not (time-less-p last-time file-time)))
-                          (progn
-                            (if (interactive-p)
-                                (message "\
-Autoload section for %s is up to date."
-                                         file))
-                            (setq found 'up-to-date))
-                        (search-forward generate-autoload-section-trailer)
-                        (delete-region begin (point))
-                        (setq found t))))
-                   ((string< load-name (nth 2 form))
-                    ;; We've come to a section alphabetically later than
-                    ;; LOAD-NAME.  We assume the file is in order and so
-                    ;; there must be no section for LOAD-NAME.  We will
-                    ;; insert one before the section here.
-                    (goto-char (match-beginning 0))
-                    (setq found 'new)))))
-         (or found
-             (progn
-               (setq found 'new)
-               ;; No later sections in the file.  Put before the last page.
-               (goto-char (point-max))
-               (search-backward "\f" nil t)))
-         (or (eq found 'up-to-date)
-             (setq no-autoloads (generate-file-autoloads file)))))
-      (and save-after
-          (buffer-modified-p)
-          (save-buffer))
-
-      (if no-autoloads file))))
+  (let* ((autoload-modified-buffers nil)
+         (no-autoloads (autoload-generate-file-autoloads file)))
+    (if autoload-modified-buffers
+        (if save-after (autoload-save-buffers))
+      (if (interactive-p)
+          (message "Autoload section for %s is up to date." file)))
+    (if no-autoloads file)))
+
+(defun autoload-find-destination (file)
+  "Find the destination point of the current buffer's autoloads.
+FILE is the file name of the current buffer.
+Returns a buffer whose point is placed at the requested location.
+Returns nil if the file's autoloads are uptodate, otherwise
+removes any prior now out-of-date autoload entries."
+  (catch 'up-to-date
+    (let* ((load-name (autoload-file-load-name file))
+           (buf (current-buffer))
+           (existing-buffer (if buffer-file-name buf))
+           (found nil))
+      (with-current-buffer
+          ;; We must read/write the file without any code conversion,
+          ;; but still decode EOLs.
+          (let ((coding-system-for-read 'raw-text))
+            (find-file-noselect
+             (autoload-ensure-default-file (autoload-generated-file))))
+        ;; This is to make generated-autoload-file have Unix EOLs, so
+        ;; that it is portable to all platforms.
+        (setq buffer-file-coding-system 'raw-text-unix)
+        (or (> (buffer-size) 0)
+            (error "Autoloads file %s does not exist" buffer-file-name))
+        (or (file-writable-p buffer-file-name)
+            (error "Autoloads file %s is not writable" buffer-file-name))
+        (widen)
+        (goto-char (point-min))
+        ;; Look for the section for LOAD-NAME.
+        (while (and (not found)
+                    (search-forward generate-autoload-section-header nil t))
+          (let ((form (autoload-read-section-header)))
+            (cond ((string= (nth 2 form) load-name)
+                   ;; We found the section for this file.
+                   ;; Check if it is up to date.
+                   (let ((begin (match-beginning 0))
+                         (last-time (nth 4 form))
+                         (file-time (nth 5 (file-attributes file))))
+                     (if (and (or (null existing-buffer)
+                                  (not (buffer-modified-p existing-buffer)))
+                              (or
+                               ;; last-time is the time-stamp (specifying
+                               ;; the last time we looked at the file) and
+                               ;; the file hasn't been changed since.
+                               (and (listp last-time) (= (length last-time) 2)
+                                    (not (time-less-p last-time file-time)))
+                               ;; last-time is an MD5 checksum instead.
+                               (and (stringp last-time)
+                                    (equal last-time
+                                           (md5 buf nil nil 'emacs-mule)))))
+                         (throw 'up-to-date nil)
+                       (autoload-remove-section begin)
+                       (setq found t))))
+                  ((string< load-name (nth 2 form))
+                   ;; We've come to a section alphabetically later than
+                   ;; LOAD-NAME.  We assume the file is in order and so
+                   ;; there must be no section for LOAD-NAME.  We will
+                   ;; insert one before the section here.
+                   (goto-char (match-beginning 0))
+                   (setq found t)))))
+        (or found
+            (progn
+              ;; No later sections in the file.  Put before the last page.
+              (goto-char (point-max))
+              (search-backward "\f" nil t)))
+        (unless (memq (current-buffer) autoload-modified-buffers)
+          (push (current-buffer) autoload-modified-buffers))
+        (current-buffer)))))
 
 (defun autoload-remove-section (begin)
   (goto-char begin)
@@ -498,20 +565,21 @@ directory or directories specified."
                                 (directory-files (expand-file-name dir)
                                                  t files-re))
                               dirs)))
+         (done ())
         (this-time (current-time))
-        (no-autoloads nil)             ;files with no autoload cookies.
-        (autoloads-file
-         (expand-file-name generated-autoload-file
-                           (expand-file-name "lisp" source-directory)))
-        (top-dir (file-name-directory autoloads-file)))
+         ;; Files with no autoload cookies or whose autoloads go to other
+         ;; files because of file-local autoload-generated-file settings.
+        (no-autoloads nil)
+         (autoload-modified-buffers nil))
 
     (with-current-buffer
-       (find-file-noselect (autoload-ensure-default-file autoloads-file))
+       (find-file-noselect
+         (autoload-ensure-default-file (autoload-generated-file)))
       (save-excursion
 
        ;; Canonicalize file names and remove the autoload file itself.
-       (setq files (delete (autoload-trim-file-name buffer-file-name)
-                           (mapcar 'autoload-trim-file-name files)))
+       (setq files (delete (file-relative-name buffer-file-name)
+                           (mapcar 'file-relative-name files)))
 
        (goto-char (point-min))
        (while (search-forward generate-autoload-section-header nil t)
@@ -531,19 +599,27 @@ directory or directories specified."
                           (push file no-autoloads)
                           (setq files (delete file files)))))))
                  ((not (stringp file)))
-                 ((not (file-exists-p (expand-file-name file top-dir)))
-                  ;; Remove the obsolete section.
+                 ((or (not (file-exists-p file))
+                       ;; Remove duplicates as well, just in case.
+                       (member file done))
+                   ;; Remove the obsolete section.
                   (autoload-remove-section (match-beginning 0)))
-                 ((equal (nth 4 form) (nth 5 (file-attributes file)))
+                 ((not (time-less-p (nth 4 form)
+                                     (nth 5 (file-attributes file))))
                   ;; File hasn't changed.
                   nil)
                  (t
-                  (update-file-autoloads file)))
+                   (autoload-remove-section (match-beginning 0))
+                   (if (autoload-generate-file-autoloads
+                        file (current-buffer) buffer-file-name)
+                       (push file no-autoloads))))
+            (push file done)
            (setq files (delete file files)))))
       ;; Elements remaining in FILES have no existing autoload sections yet.
-      (setq no-autoloads
-           (append no-autoloads
-                   (delq nil (mapcar 'update-file-autoloads files))))
+      (dolist (file files)
+        (if (autoload-generate-file-autoloads file nil buffer-file-name)
+            (push file no-autoloads)))
+
       (when no-autoloads
        ;; Sort them for better readability.
        (setq no-autoloads (sort no-autoloads 'string<))
@@ -554,7 +630,10 @@ directory or directories specified."
         (current-buffer) nil nil no-autoloads this-time)
        (insert generate-autoload-section-trailer))
 
-      (save-buffer))))
+      (save-buffer)
+      ;; In case autoload entries were added to other files because of
+      ;; file-local autoload-generated-file settings.
+      (autoload-save-buffers))))
 
 (define-obsolete-function-alias 'update-autoloads-from-directories
     'update-directory-autoloads "22.1")
index b3b9ca8..286725f 100644 (file)
 ;;                             `obsolete'  (obsolete variables and functions)
 ;;                             `noruntime' (calls to functions only defined
 ;;                                          within `eval-when-compile')
-;;                             `cl-warnings' (calls to CL functions)
+;;                             `cl-functions' (calls to CL functions)
 ;;                             `interactive-only' (calls to commands that are
 ;;                                                not good to call from Lisp)
+;;                             `make-local' (dubious calls to
+;;                                           `make-variable-buffer-local')
 ;; byte-compile-compatibility  Whether the compiler should
 ;;                             generate .elc files which can be loaded into
 ;;                             generic emacs 18.
@@ -356,14 +358,16 @@ Elements of the list may be:
   cl-functions    calls to runtime functions from the CL package (as
                  distinguished from macros and aliases).
   interactive-only
-             commands that normally shouldn't be called from Lisp code."
+             commands that normally shouldn't be called from Lisp code.
+  make-local  calls to make-variable-buffer-local that may be incorrect."
   :group 'bytecomp
   :type `(choice (const :tag "All" t)
                 (set :menu-tag "Some"
                      (const free-vars) (const unresolved)
                      (const callargs) (const redefine)
                      (const obsolete) (const noruntime)
-                     (const cl-functions) (const interactive-only))))
+                     (const cl-functions) (const interactive-only)
+                     (const make-local))))
 (put 'byte-compile-warnings 'safe-local-variable 'byte-compile-warnings-safe-p)
 ;;;###autoload
 (defun byte-compile-warnings-safe-p (x)
@@ -374,7 +378,7 @@ Elements of the list may be:
                     (when (memq e '(free-vars unresolved
                                     callargs redefine
                                     obsolete noruntime
-                                    cl-functions interactive-only))
+                                    cl-functions interactive-only make-local))
                       e))
                   x)
                  x))))
@@ -850,13 +854,11 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'."
                (when (and (consp s) (eq t (car s)))
                  (push (cdr s) old-autoloads)))))))
       (when (memq 'cl-functions byte-compile-warnings)
-       (let ((hist-new load-history)
-             (hist-nil-new current-load-list))
+       (let ((hist-new load-history))
          ;; Go through load-history, look for newly loaded files
          ;; and mark all the functions defined therein.
          (while (and hist-new (not (eq hist-new hist-orig)))
-           (let ((xs (pop hist-new))
-                 old-autoloads)
+           (let ((xs (pop hist-new)))
              ;; Make sure the file was not already loaded before.
              (when (and (equal (car xs) "cl") (not (assoc (car xs) hist-orig)))
                (byte-compile-find-cl-functions)))))))))
@@ -1262,7 +1264,7 @@ extra args."
             (get (car form) 'byte-compile-format-like))
     (let ((nfields (with-temp-buffer
                     (insert (nth 1 form))
-                    (goto-char 1)
+                    (goto-char (point-min))
                     (let ((n 0))
                       (while (re-search-forward "%." nil t)
                         (unless (eq ?% (char-after (1+ (match-beginning 0))))
@@ -1280,19 +1282,19 @@ extra args."
 ;; Warn if a custom definition fails to specify :group.
 (defun byte-compile-nogroup-warn (form)
   (let ((keyword-args (cdr (cdr (cdr (cdr form)))))
-       (name (cadr form)))
+        (name (cadr form)))
     (or (not (eq (car-safe name) 'quote))
-       (and (eq (car form) 'custom-declare-group)
-            (equal name ''emacs))
-       (plist-get keyword-args :group)
-       (not (and (consp name) (eq (car name) 'quote)))
-       (byte-compile-warn
-        "%s for `%s' fails to specify containing group"
-        (cdr (assq (car form)
-                   '((custom-declare-group . defgroup)
-                     (custom-declare-face . defface)
-                     (custom-declare-variable . defcustom))))
-        (cadr name)))))
+        (and (eq (car form) 'custom-declare-group)
+             (equal name ''emacs))
+        (plist-get keyword-args :group)
+        (not (and (consp name) (eq (car name) 'quote)))
+        (byte-compile-warn
+         "%s for `%s' fails to specify containing group"
+         (cdr (assq (car form)
+                    '((custom-declare-group . defgroup)
+                      (custom-declare-face . defface)
+                      (custom-declare-variable . defcustom))))
+         (cadr name)))))
 
 ;; Warn if the function or macro is being redefined with a different
 ;; number of arguments.
@@ -1345,7 +1347,8 @@ extra args."
   (unless byte-compile-cl-functions
     (dolist (elt load-history)
       (when (and (stringp (car elt))
-                (string-match "^cl\\>" (car elt)))
+                (string-match
+                 "^cl\\>" (file-name-nondirectory (car elt))))
        (setq byte-compile-cl-functions
              (append byte-compile-cl-functions
                      (cdr elt)))))
@@ -1830,9 +1833,8 @@ With argument, insert value in current buffer after the form."
        ;;                                 byte-compile-warnings))
        )
     (byte-compile-close-variables
-     (save-excursion
-       (setq outbuffer
-            (set-buffer (get-buffer-create " *Compiler Output*")))
+     (with-current-buffer
+         (setq outbuffer (get-buffer-create " *Compiler Output*"))
        (set-buffer-multibyte t)
        (erase-buffer)
        ;;       (emacs-lisp-mode)
@@ -1846,9 +1848,8 @@ With argument, insert value in current buffer after the form."
        (setq overwrite-mode 'overwrite-mode-binary))
      (displaying-byte-compile-warnings
       (and filename (byte-compile-insert-header filename inbuffer outbuffer))
-      (save-excursion
-       (set-buffer inbuffer)
-       (goto-char 1)
+      (with-current-buffer inbuffer
+       (goto-char (point-min))
        ;; Should we always do this?  When calling multiple files, it
        ;; would be useful to delay this warning until all have been
        ;; compiled.  A: Yes!  b-c-u-f might contain dross from a
@@ -1917,7 +1918,7 @@ With argument, insert value in current buffer after the form."
   (let ((dynamic-docstrings byte-compile-dynamic-docstrings)
        (dynamic byte-compile-dynamic))
     (set-buffer outbuffer)
-    (goto-char 1)
+    (goto-char (point-min))
     ;; The magic number of .elc files is ";ELC", or 0x3B454C43.  After
     ;; that is the file-format version number (18, 19 or 20) as a
     ;; byte, followed by some nulls.  The primary motivation for doing
@@ -2238,8 +2239,7 @@ list that represents a doc string reference.
 
 (put 'require 'byte-hunk-handler 'byte-compile-file-form-require)
 (defun byte-compile-file-form-require (form)
-  (let ((old-load-list current-load-list)
-       (args (mapcar 'eval (cdr form))))
+  (let ((args (mapcar 'eval (cdr form))))
     (apply 'require args)
     ;; Detect (require 'cl) in a way that works even if cl is already loaded.
     (if (member (car args) '("cl" cl))
@@ -3890,7 +3890,8 @@ that suppresses all warnings during execution of BODY."
 ;; Warn about misuses of make-variable-buffer-local.
 (byte-defop-compiler-1 make-variable-buffer-local byte-compile-make-variable-buffer-local)
 (defun byte-compile-make-variable-buffer-local (form)
-  (if (eq (car-safe (car-safe (cdr-safe form))) 'quote)
+  (if (and (eq (car-safe (car-safe (cdr-safe form))) 'quote)
+           (memq 'make-local byte-compile-warnings))
       (byte-compile-warn
        "`make-variable-buffer-local' should be called at toplevel"))
   (byte-compile-normal-call form))
index 3036bb7..375a07f 100644 (file)
@@ -43,6 +43,7 @@
 
 ;;; Type coercion.
 
+;;;###autoload
 (defun coerce (x type)
   "Coerce OBJECT to type TYPE.
 TYPE is a Common Lisp type specifier.
@@ -60,6 +61,7 @@ TYPE is a Common Lisp type specifier.
 
 ;;; Predicates.
 
+;;;###autoload
 (defun equalp (x y)
   "Return t if two Lisp objects have similar structures and contents.
 This is like `equal', except that it accepts numerically equal
@@ -87,6 +89,7 @@ strings case-insensitively."
 
 ;;; Control structures.
 
+;;;###autoload
 (defun cl-mapcar-many (cl-func cl-seqs)
   (if (cdr (cdr cl-seqs))
       (let* ((cl-res nil)
@@ -119,6 +122,7 @@ strings case-insensitively."
                   cl-res)))
       (nreverse cl-res))))
 
+;;;###autoload
 (defun map (cl-type cl-func cl-seq &rest cl-rest)
   "Map a FUNCTION across one or more SEQUENCEs, returning a sequence.
 TYPE is the sequence type to return.
@@ -126,6 +130,7 @@ TYPE is the sequence type to return.
   (let ((cl-res (apply 'mapcar* cl-func cl-seq cl-rest)))
     (and cl-type (coerce cl-res cl-type))))
 
+;;;###autoload
 (defun maplist (cl-func cl-list &rest cl-rest)
   "Map FUNCTION to each sublist of LIST or LISTs.
 Like `mapcar', except applies to lists and their cdr's rather than to
@@ -154,6 +159,7 @@ the elements themselves.
             cl-seq)
     (mapc cl-func cl-seq)))
 
+;;;###autoload
 (defun mapl (cl-func cl-list &rest cl-rest)
   "Like `maplist', but does not accumulate values returned by the function.
 \n(fn FUNCTION LIST...)"
@@ -163,16 +169,19 @@ the elements themselves.
       (while cl-p (funcall cl-func cl-p) (setq cl-p (cdr cl-p)))))
   cl-list)
 
+;;;###autoload
 (defun mapcan (cl-func cl-seq &rest cl-rest)
   "Like `mapcar', but nconc's together the values returned by the function.
 \n(fn FUNCTION SEQUENCE...)"
   (apply 'nconc (apply 'mapcar* cl-func cl-seq cl-rest)))
 
+;;;###autoload
 (defun mapcon (cl-func cl-list &rest cl-rest)
   "Like `maplist', but nconc's together the values returned by the function.
 \n(fn FUNCTION LIST...)"
   (apply 'nconc (apply 'maplist cl-func cl-list cl-rest)))
 
+;;;###autoload
 (defun some (cl-pred cl-seq &rest cl-rest)
   "Return true if PREDICATE is true of any element of SEQ or SEQs.
 If so, return the true (non-nil) value returned by PREDICATE.
@@ -188,6 +197,7 @@ If so, return the true (non-nil) value returned by PREDICATE.
       (while (and cl-seq (not (setq cl-x (funcall cl-pred (pop cl-seq))))))
       cl-x)))
 
+;;;###autoload
 (defun every (cl-pred cl-seq &rest cl-rest)
   "Return true if PREDICATE is true of every element of SEQ or SEQs.
 \n(fn PREDICATE SEQ...)"
@@ -201,19 +211,23 @@ If so, return the true (non-nil) value returned by PREDICATE.
       (setq cl-seq (cdr cl-seq)))
     (null cl-seq)))
 
+;;;###autoload
 (defun notany (cl-pred cl-seq &rest cl-rest)
   "Return true if PREDICATE is false of every element of SEQ or SEQs.
 \n(fn PREDICATE SEQ...)"
   (not (apply 'some cl-pred cl-seq cl-rest)))
 
+;;;###autoload
 (defun notevery (cl-pred cl-seq &rest cl-rest)
   "Return true if PREDICATE is false of some element of SEQ or SEQs.
 \n(fn PREDICATE SEQ...)"
   (not (apply 'every cl-pred cl-seq cl-rest)))
 
 ;;; Support for `loop'.
+;;;###autoload
 (defalias 'cl-map-keymap 'map-keymap)
 
+;;;###autoload
 (defun cl-map-keymap-recursively (cl-func-rec cl-map &optional cl-base)
   (or cl-base
       (setq cl-base (copy-sequence [0])))
@@ -228,6 +242,7 @@ If so, return the true (non-nil) value returned by PREDICATE.
        (funcall cl-func-rec cl-base cl-bind))))
    cl-map))
 
+;;;###autoload
 (defun cl-map-intervals (cl-func &optional cl-what cl-prop cl-start cl-end)
   (or cl-what (setq cl-what (current-buffer)))
   (if (bufferp cl-what)
@@ -255,6 +270,7 @@ If so, return the true (non-nil) value returned by PREDICATE.
        (funcall cl-func cl-start (min cl-next cl-end))
        (setq cl-start cl-next)))))
 
+;;;###autoload
 (defun cl-map-overlays (cl-func &optional cl-buffer cl-start cl-end cl-arg)
   (or cl-buffer (setq cl-buffer (current-buffer)))
   (if (fboundp 'overlay-lists)
@@ -296,6 +312,7 @@ If so, return the true (non-nil) value returned by PREDICATE.
       (set-marker cl-mark nil) (if cl-mark2 (set-marker cl-mark2 nil)))))
 
 ;;; Support for `setf'.
+;;;###autoload
 (defun cl-set-frame-visible-p (frame val)
   (cond ((null val) (make-frame-invisible frame))
        ((eq val 'icon) (iconify-frame frame))
@@ -304,6 +321,7 @@ If so, return the true (non-nil) value returned by PREDICATE.
 
 ;;; Support for `progv'.
 (defvar cl-progv-save)
+;;;###autoload
 (defun cl-progv-before (syms values)
   (while syms
     (push (if (boundp (car syms))
@@ -323,6 +341,7 @@ If so, return the true (non-nil) value returned by PREDICATE.
 
 ;;; Numbers.
 
+;;;###autoload
 (defun gcd (&rest args)
   "Return the greatest common divisor of the arguments."
   (let ((a (abs (or (pop args) 0))))
@@ -331,6 +350,7 @@ If so, return the true (non-nil) value returned by PREDICATE.
        (while (> b 0) (setq b (% a (setq a b))))))
     a))
 
+;;;###autoload
 (defun lcm (&rest args)
   "Return the least common multiple of the arguments."
   (if (memq 0 args)
@@ -341,6 +361,7 @@ If so, return the true (non-nil) value returned by PREDICATE.
          (setq a (* (/ a (gcd a b)) b))))
       a)))
 
+;;;###autoload
 (defun isqrt (x)
   "Return the integer square root of the argument."
   (if (and (integerp x) (> x 0))
@@ -352,12 +373,14 @@ If so, return the true (non-nil) value returned by PREDICATE.
        g)
     (if (eq x 0) 0 (signal 'arith-error nil))))
 
+;;;###autoload
 (defun floor* (x &optional y)
   "Return a list of the floor of X and the fractional part of X.
 With two arguments, return floor and remainder of their quotient."
   (let ((q (floor x y)))
     (list q (- x (if y (* y q) q)))))
 
+;;;###autoload
 (defun ceiling* (x &optional y)
   "Return a list of the ceiling of X and the fractional part of X.
 With two arguments, return ceiling and remainder of their quotient."
@@ -365,12 +388,14 @@ With two arguments, return ceiling and remainder of their quotient."
     (if (= (car (cdr res)) 0) res
       (list (1+ (car res)) (- (car (cdr res)) (or y 1))))))
 
+;;;###autoload
 (defun truncate* (x &optional y)
   "Return a list of the integer part of X and the fractional part of X.
 With two arguments, return truncation and remainder of their quotient."
   (if (eq (>= x 0) (or (null y) (>= y 0)))
       (floor* x y) (ceiling* x y)))
 
+;;;###autoload
 (defun round* (x &optional y)
   "Return a list of X rounded to the nearest integer and the remainder.
 With two arguments, return rounding and remainder of their quotient."
@@ -389,14 +414,17 @@ With two arguments, return rounding and remainder of their quotient."
       (let ((q (round x)))
        (list q (- x q))))))
 
+;;;###autoload
 (defun mod* (x y)
   "The remainder of X divided by Y, with the same sign as Y."
   (nth 1 (floor* x y)))
 
+;;;###autoload
 (defun rem* (x y)
   "The remainder of X divided by Y, with the same sign as X."
   (nth 1 (truncate* x y)))
 
+;;;###autoload
 (defun signum (x)
   "Return 1 if X is positive, -1 if negative, 0 if zero."
   (cond ((> x 0) 1) ((< x 0) -1) (t 0)))
@@ -405,6 +433,7 @@ With two arguments, return rounding and remainder of their quotient."
 ;; Random numbers.
 
 (defvar *random-state*)
+;;;###autoload
 (defun random* (lim &optional state)
   "Return a random nonnegative number less than LIM, an integer or float.
 Optional second arg STATE is a random-state object."
@@ -412,7 +441,7 @@ Optional second arg STATE is a random-state object."
   ;; Inspired by "ran3" from Numerical Recipes.  Additive congruential method.
   (let ((vec (aref state 3)))
     (if (integerp vec)
-       (let ((i 0) (j (- 1357335 (% (abs vec) 1357333))) (k 1) ii)
+       (let ((i 0) (j (- 1357335 (% (abs vec) 1357333))) (k 1))
          (aset state 3 (setq vec (make-vector 55 nil)))
          (aset vec 0 j)
          (while (> (setq i (% (+ i 21) 55)) 0)
@@ -429,6 +458,7 @@ Optional second arg STATE is a random-state object."
              (if (< (setq n (logand n mask)) lim) n (random* lim state))))
        (* (/ n '8388608e0) lim)))))
 
+;;;###autoload
 (defun make-random-state (&optional state)
   "Return a copy of random-state STATE, or of `*random-state*' if omitted.
 If STATE is t, return a new state object seeded from the time of day."
@@ -437,6 +467,7 @@ If STATE is t, return a new state object seeded from the time of day."
        ((integerp state) (vector 'cl-random-state-tag -1 30 state))
        (t (make-random-state (cl-random-time)))))
 
+;;;###autoload
 (defun random-state-p (object)
   "Return t if OBJECT is a random-state object."
   (and (vectorp object) (= (length object) 4)
@@ -460,6 +491,7 @@ If STATE is t, return a new state object seeded from the time of day."
 (defvar float-epsilon)
 (defvar float-negative-epsilon)
 
+;;;###autoload
 (defun cl-float-limits ()
   (or most-positive-float (not (numberp '2e1))
       (let ((x '2e0) y z)
@@ -497,6 +529,7 @@ If STATE is t, return a new state object seeded from the time of day."
 
 ;;; Sequence functions.
 
+;;;###autoload
 (defun subseq (seq start &optional end)
   "Return the subsequence of SEQ from START to END.
 If END is omitted, it defaults to the length of the sequence.
@@ -522,6 +555,7 @@ If START or END is negative, it counts from the end."
                 (setq i (1+ i) start (1+ start)))
               res))))))
 
+;;;###autoload
 (defun concatenate (type &rest seqs)
   "Concatenate, into a sequence of type TYPE, the argument SEQUENCEs.
 \n(fn TYPE SEQUENCE...)"
@@ -533,14 +567,17 @@ If START or END is negative, it counts from the end."
 
 ;;; List functions.
 
+;;;###autoload
 (defun revappend (x y)
   "Equivalent to (append (reverse X) Y)."
   (nconc (reverse x) y))
 
+;;;###autoload
 (defun nreconc (x y)
   "Equivalent to (nconc (nreverse X) Y)."
   (nconc (nreverse x) y))
 
+;;;###autoload
 (defun list-length (x)
   "Return the length of list X.  Return nil if list is circular."
   (let ((n 0) (fast x) (slow x))
@@ -548,6 +585,7 @@ If START or END is negative, it counts from the end."
       (setq n (+ n 2) fast (cdr (cdr fast)) slow (cdr slow)))
     (if fast (if (cdr fast) nil (1+ n)) n)))
 
+;;;###autoload
 (defun tailp (sublist list)
   "Return true if SUBLIST is a tail of LIST."
   (while (and (consp list) (not (eq sublist list)))
@@ -559,6 +597,7 @@ If START or END is negative, it counts from the end."
 
 ;;; Property lists.
 
+;;;###autoload
 (defun get* (sym tag &optional def)    ; See compiler macro in cl-macs.el
   "Return the value of SYMBOL's PROPNAME property, or DEFAULT if none.
 \n(fn SYMBOL PROPNAME &optional DEFAULT)"
@@ -569,6 +608,7 @@ If START or END is negative, it counts from the end."
               (setq plist (cdr (cdr plist))))
             (if plist (car (cdr plist)) def)))))
 
+;;;###autoload
 (defun getf (plist tag &optional def)
   "Search PROPLIST for property PROPNAME; return its value or DEFAULT.
 PROPLIST is a list of the sort returned by `symbol-plist'.
@@ -583,16 +623,19 @@ PROPLIST is a list of the sort returned by `symbol-plist'.
          (setq plist (cdr (cdr plist))))
        (if plist (car (cdr plist)) def))))
 
+;;;###autoload
 (defun cl-set-getf (plist tag val)
   (let ((p plist))
     (while (and p (not (eq (car p) tag))) (setq p (cdr (cdr p))))
     (if p (progn (setcar (cdr p) val) plist) (list* tag val plist))))
 
+;;;###autoload
 (defun cl-do-remf (plist tag)
   (let ((p (cdr plist)))
     (while (and (cdr p) (not (eq (car (cdr p)) tag))) (setq p (cdr (cdr p))))
     (and (cdr p) (progn (setcdr p (cdr (cdr (cdr p)))) t))))
 
+;;;###autoload
 (defun cl-remprop (sym tag)
   "Remove from SYMBOL's plist the property PROPNAME and its value.
 \n(fn SYMBOL PROPNAME)"
@@ -600,6 +643,7 @@ PROPLIST is a list of the sort returned by `symbol-plist'.
     (if (and plist (eq tag (car plist)))
        (progn (setplist sym (cdr (cdr plist))) t)
       (cl-do-remf plist tag))))
+;;;###autoload
 (defalias 'remprop 'cl-remprop)
 
 
@@ -616,14 +660,22 @@ PROPLIST is a list of the sort returned by `symbol-plist'.
 (defvar cl-builtin-clrhash (symbol-function 'clrhash))
 (defvar cl-builtin-maphash (symbol-function 'maphash))
 
+;;;###autoload
 (defalias 'cl-gethash 'gethash)
+;;;###autoload
 (defalias 'cl-puthash 'puthash)
+;;;###autoload
 (defalias 'cl-remhash 'remhash)
+;;;###autoload
 (defalias 'cl-clrhash 'clrhash)
+;;;###autoload
 (defalias 'cl-maphash 'maphash)
 ;; These three actually didn't exist in Emacs-20.
+;;;###autoload
 (defalias 'cl-make-hash-table 'make-hash-table)
+;;;###autoload
 (defalias 'cl-hash-table-p 'hash-table-p)
+;;;###autoload
 (defalias 'cl-hash-table-count 'hash-table-count)
 
 ;;; Some debugging aids.
@@ -672,6 +724,7 @@ PROPLIST is a list of the sort returned by `symbol-plist'.
 (defvar cl-macroexpand-cmacs nil)
 (defvar cl-closure-vars nil)
 
+;;;###autoload
 (defun cl-macroexpand-all (form &optional env)
   "Expand all macro calls through a Lisp FORM.
 This also does some trivial optimizations to make the form prettier."
@@ -753,6 +806,7 @@ This also does some trivial optimizations to make the form prettier."
 (defun cl-macroexpand-body (body &optional env)
   (mapcar (function (lambda (x) (cl-macroexpand-all x env))) body))
 
+;;;###autoload
 (defun cl-prettyexpand (form &optional full)
   (message "Expanding...")
   (let ((cl-macroexpand-cmacs full) (cl-compiling-file full)
@@ -767,5 +821,9 @@ This also does some trivial optimizations to make the form prettier."
 
 (run-hooks 'cl-extra-load-hook)
 
+;; Local variables:
+;; generated-autoload-file: "cl-loaddefs.el"
+;; End:
+
 ;; arch-tag: bcd03437-0871-43fb-a8f1-ad0e0b5427ed
 ;;; cl-extra.el ends here
index 1589e19..7d94faa 100644 (file)
@@ -10,7 +10,7 @@
 ;;;;;;  ceiling* floor* isqrt lcm gcd cl-progv-before cl-set-frame-visible-p
 ;;;;;;  cl-map-overlays cl-map-intervals cl-map-keymap-recursively
 ;;;;;;  notevery notany every some mapcon mapcan mapl maplist map
-;;;;;;  cl-mapcar-many equalp coerce) "cl-extra" "cl-extra.el" "47c92504dda976a632c2c10bedd4b6a4")
+;;;;;;  cl-mapcar-many equalp coerce) "cl-extra" "cl-extra.el" "53c2b3ede19dac62cff13a37f58cdf9c")
 ;;; Generated autoloads from cl-extra.el
 
 (autoload (quote coerce) "cl-extra" "\
@@ -283,7 +283,7 @@ Not documented
 ;;;;;;  do* do loop return-from return block etypecase typecase ecase
 ;;;;;;  case load-time-value eval-when destructuring-bind function*
 ;;;;;;  defmacro* defun* gentemp gensym cl-compile-time-init) "cl-macs"
-;;;;;;  "cl-macs.el" "7ccc827d272482ca276937ca18a7895a")
+;;;;;;  "cl-macs.el" "d9759da97810bc01423e77442b459468")
 ;;; Generated autoloads from cl-macs.el
 
 (autoload (quote cl-compile-time-init) "cl-macs" "\
@@ -745,7 +745,7 @@ Not documented
 ;;;;;;  find nsubstitute-if-not nsubstitute-if nsubstitute substitute-if-not
 ;;;;;;  substitute-if substitute delete-duplicates remove-duplicates
 ;;;;;;  delete-if-not delete-if delete* remove-if-not remove-if remove*
-;;;;;;  replace fill reduce) "cl-seq" "cl-seq.el" "8805f76626399794931f5db36ddf855f")
+;;;;;;  replace fill reduce) "cl-seq" "cl-seq.el" "c972a97c053d4e001ac1d1012c315b28")
 ;;; Generated autoloads from cl-seq.el
 
 (autoload (quote reduce) "cl-seq" "\
index 5a79a64..a126494 100644 (file)
@@ -58,8 +58,8 @@
 (defvar cl-optimize-speed)
 
 
-;;; This kludge allows macros which use cl-transform-function-property
-;;; to be called at compile-time.
+;; This kludge allows macros which use cl-transform-function-property
+;; to be called at compile-time.
 
 (require
  (progn
@@ -75,6 +75,7 @@
 
 (defvar cl-old-bc-file-form nil)
 
+;;;###autoload
 (defun cl-compile-time-init ()
   (run-hooks 'cl-hack-bytecomp-hook))
 
 ;;; Symbols.
 
 (defvar *gensym-counter*)
+;;;###autoload
 (defun gensym (&optional prefix)
   "Generate a new uninterned symbol.
 The name is made by appending a number to PREFIX, default \"G\"."
@@ -174,6 +176,7 @@ The name is made by appending a number to PREFIX, default \"G\"."
                 (setq *gensym-counter* (1+ *gensym-counter*))))))
     (make-symbol (format "%s%d" pfix num))))
 
+;;;###autoload
 (defun gentemp (&optional prefix)
   "Generate a new interned symbol with a unique name.
 The name is made by appending a number to PREFIX, default \"G\"."
@@ -186,6 +189,7 @@ The name is made by appending a number to PREFIX, default \"G\"."
 
 ;;; Program structure.
 
+;;;###autoload
 (defmacro defun* (name args &rest body)
   "Define NAME as a function.
 Like normal `defun', except ARGLIST allows full Common Lisp conventions,
@@ -196,6 +200,7 @@ and BODY is implicitly surrounded by (block NAME ...).
         (form (list* 'defun name (cdr res))))
     (if (car res) (list 'progn (car res) form) form)))
 
+;;;###autoload
 (defmacro defmacro* (name args &rest body)
   "Define NAME as a macro.
 Like normal `defmacro', except ARGLIST allows full Common Lisp conventions,
@@ -206,6 +211,7 @@ and BODY is implicitly surrounded by (block NAME ...).
         (form (list* 'defmacro name (cdr res))))
     (if (car res) (list 'progn (car res) form) form)))
 
+;;;###autoload
 (defmacro function* (func)
   "Introduce a function.
 Like normal `function', except that if argument is a lambda form,
@@ -422,6 +428,7 @@ its argument list allows full Common Lisp conventions."
            (setq res (nconc res (cl-arglist-args arg))))))
       (nconc res (and args (list args))))))
 
+;;;###autoload
 (defmacro destructuring-bind (args expr &rest body)
   (let* ((bind-lets nil) (bind-forms nil) (bind-inits nil)
         (bind-defs nil) (bind-block 'cl-none))
@@ -435,6 +442,7 @@ its argument list allows full Common Lisp conventions."
 
 (defvar cl-not-toplevel nil)
 
+;;;###autoload
 (defmacro eval-when (when &rest body)
   "Control when BODY is evaluated.
 If `compile' is in WHEN, BODY is evaluated when compiled at top-level.
@@ -466,6 +474,7 @@ If `eval' is in WHEN, BODY is evaluated when interpreted or at non-top-level.
             form)))
        (t (eval form) form)))
 
+;;;###autoload
 (defmacro load-time-value (form &optional read-only)
   "Like `progn', but evaluates the body at load time.
 The result of the body appears to the compiler as a quoted constant."
@@ -488,6 +497,7 @@ The result of the body appears to the compiler as a quoted constant."
 
 ;;; Conditional control structures.
 
+;;;###autoload
 (defmacro case (expr &rest clauses)
   "Eval EXPR and choose among clauses on that value.
 Each clause looks like (KEYLIST BODY...).  EXPR is evaluated and compared
@@ -522,12 +532,14 @@ Key values are compared by `eql'.
     (if (eq temp expr) body
       (list 'let (list (list temp expr)) body))))
 
+;;;###autoload
 (defmacro ecase (expr &rest clauses)
   "Like `case', but error if no case fits.
 `otherwise'-clauses are not allowed.
 \n(fn EXPR (KEYLIST BODY...)...)"
   (list* 'case expr (append clauses '((ecase-error-flag)))))
 
+;;;###autoload
 (defmacro typecase (expr &rest clauses)
   "Evals EXPR, chooses among clauses on that value.
 Each clause looks like (TYPE BODY...).  EXPR is evaluated and, if it
@@ -554,6 +566,7 @@ final clause, and matches if no other keys match.
     (if (eq temp expr) body
       (list 'let (list (list temp expr)) body))))
 
+;;;###autoload
 (defmacro etypecase (expr &rest clauses)
   "Like `typecase', but error if no case fits.
 `otherwise'-clauses are not allowed.
@@ -563,6 +576,7 @@ final clause, and matches if no other keys match.
 
 ;;; Blocks and exits.
 
+;;;###autoload
 (defmacro block (name &rest body)
   "Define a lexically-scoped block named NAME.
 NAME may be any symbol.  Code inside the BODY forms can call `return-from'
@@ -598,11 +612,13 @@ called from BODY."
     (if cl-found (setcdr cl-found t)))
   (byte-compile-normal-call (cons 'throw (cdr cl-form))))
 
+;;;###autoload
 (defmacro return (&optional result)
   "Return from the block named nil.
 This is equivalent to `(return-from nil RESULT)'."
   (list 'return-from nil result))
 
+;;;###autoload
 (defmacro return-from (name &optional result)
   "Return from the block named NAME.
 This jump out to the innermost enclosing `(block NAME ...)' form,
@@ -622,6 +638,7 @@ This is compatible with Common Lisp, but note that `defun' and
 (defvar loop-result) (defvar loop-result-explicit)
 (defvar loop-result-var) (defvar loop-steps) (defvar loop-symbol-macs)
 
+;;;###autoload
 (defmacro loop (&rest args)
   "The Common Lisp `loop' macro.
 Valid clauses are:
@@ -1181,12 +1198,14 @@ Valid clauses are:
 
 ;;; Other iteration control structures.
 
+;;;###autoload
 (defmacro do (steps endtest &rest body)
   "The Common Lisp `do' loop.
 
 \(fn ((VAR INIT [STEP])...) (END-TEST [RESULT...]) BODY...)"
   (cl-expand-do-loop steps endtest body nil))
 
+;;;###autoload
 (defmacro do* (steps endtest &rest body)
   "The Common Lisp `do*' loop.
 
@@ -1214,6 +1233,7 @@ Valid clauses are:
                                                 (apply 'append sets)))))))
               (or (cdr endtest) '(nil)))))
 
+;;;###autoload
 (defmacro dolist (spec &rest body)
   "Loop over a list.
 Evaluate BODY with VAR bound to each `car' from LIST, in turn.
@@ -1230,6 +1250,7 @@ Then evaluate RESULT to get return value, default nil.
                     (cons (list 'setq (car spec) nil) (cdr (cdr spec)))
                   '(nil))))))
 
+;;;###autoload
 (defmacro dotimes (spec &rest body)
   "Loop a certain number of times.
 Evaluate BODY with VAR bound to successive integers from 0, inclusive,
@@ -1244,6 +1265,7 @@ nil.
                        (append body (list (list 'incf (car spec)))))
                 (or (cdr (cdr spec)) '(nil))))))
 
+;;;###autoload
 (defmacro do-symbols (spec &rest body)
   "Loop over all symbols.
 Evaluate BODY with VAR bound to each interned symbol, or to each symbol
@@ -1258,12 +1280,14 @@ from OBARRAY.
                     (and (cadr spec) (list (cadr spec))))
              (caddr spec))))
 
+;;;###autoload
 (defmacro do-all-symbols (spec &rest body)
   (list* 'do-symbols (list (car spec) nil (cadr spec)) body))
 
 
 ;;; Assignments.
 
+;;;###autoload
 (defmacro psetq (&rest args)
   "Set SYMs to the values VALs in parallel.
 This is like `setq', except that all VAL forms are evaluated (in order)
@@ -1275,6 +1299,7 @@ before assigning any symbols SYM to the corresponding values.
 
 ;;; Binding control structures.
 
+;;;###autoload
 (defmacro progv (symbols values &rest body)
   "Bind SYMBOLS to VALUES dynamically in BODY.
 The forms SYMBOLS and VALUES are evaluated, and must evaluate to lists.
@@ -1288,6 +1313,7 @@ a `let' form, except that the list of symbols can be computed at run-time."
              '(cl-progv-after))))
 
 ;;; This should really have some way to shadow 'byte-compile properties, etc.
+;;;###autoload
 (defmacro flet (bindings &rest body)
   "Make temporary function definitions.
 This is an analogue of `let' that operates on the function cell of FUNC
@@ -1315,6 +1341,7 @@ go back to their previous definitions, or lack thereof).
          bindings)
         body))
 
+;;;###autoload
 (defmacro labels (bindings &rest body)
   "Make temporary function bindings.
 This is like `flet', except the bindings are lexical instead of dynamic.
@@ -1339,6 +1366,7 @@ Unlike `flet', this macro is fully compliant with the Common Lisp standard.
 
 ;; The following ought to have a better definition for use with newer
 ;; byte compilers.
+;;;###autoload
 (defmacro macrolet (bindings &rest body)
   "Make temporary macro definitions.
 This is like `flet', but for macros instead of functions.
@@ -1355,6 +1383,7 @@ This is like `flet', but for macros instead of functions.
                            (cons (list* name 'lambda (cdr res))
                                  cl-macro-environment))))))
 
+;;;###autoload
 (defmacro symbol-macrolet (bindings &rest body)
   "Make symbol macro definitions.
 Within the body FORMs, references to the variable NAME will be replaced
@@ -1371,6 +1400,7 @@ by EXPANSION, and (setq NAME ...) will act like (setf EXPANSION ...).
                                cl-macro-environment)))))
 
 (defvar cl-closure-vars nil)
+;;;###autoload
 (defmacro lexical-let (bindings &rest body)
   "Like `let', but lexically scoped.
 The main visible difference is that lambdas inside BODY will create
@@ -1414,6 +1444,7 @@ lexical closures as in Common Lisp.
                           vars))
            ebody))))
 
+;;;###autoload
 (defmacro lexical-let* (bindings &rest body)
   "Like `let*', but lexically scoped.
 The main visible difference is that lambdas inside BODY will create
@@ -1434,6 +1465,7 @@ lexical closures as in Common Lisp.
 
 ;;; Multiple values.
 
+;;;###autoload
 (defmacro multiple-value-bind (vars form &rest body)
   "Collect multiple return values.
 FORM must return a list; the BODY is then executed with the first N elements
@@ -1451,6 +1483,7 @@ a synonym for (list A B C).
                               vars))
           body)))
 
+;;;###autoload
 (defmacro multiple-value-setq (vars form)
   "Collect multiple return values.
 FORM must return a list; the first N elements of this list are stored in
@@ -1477,7 +1510,9 @@ values.  For compatibility, (values A B C) is a synonym for (list A B C).
 
 ;;; Declarations.
 
+;;;###autoload
 (defmacro locally (&rest body) (cons 'progn body))
+;;;###autoload
 (defmacro the (type form) form)
 
 (defvar cl-proclaim-history t)    ; for future compilers
@@ -1532,6 +1567,7 @@ values.  For compatibility, (values A B C) is a synonym for (list A B C).
   (while p (cl-do-proclaim (pop p) t))
   (setq cl-proclaims-deferred nil))
 
+;;;###autoload
 (defmacro declare (&rest specs)
   (if (cl-compiling-file)
       (while specs
@@ -1543,6 +1579,7 @@ values.  For compatibility, (values A B C) is a synonym for (list A B C).
 
 ;;; Generalized variables.
 
+;;;###autoload
 (defmacro define-setf-method (func args &rest body)
   "Define a `setf' method.
 This method shows how to handle `setf's to places of the form (NAME ARGS...).
@@ -1561,8 +1598,9 @@ form.  See `defsetf' for a simpler way to define most setf-methods.
                 func 'setf-method (cons args body)))))
 (defalias 'define-setf-expander 'define-setf-method)
 
+;;;###autoload
 (defmacro defsetf (func arg1 &rest args)
-  "(defsetf NAME FUNC): define a `setf' method.
+  "Define a `setf' method.
 This macro is an easy-to-use substitute for `define-setf-method' that works
 well for simple place forms.  In the simple `defsetf' form, `setf's of
 the form (setf (NAME ARGS...) VAL) are transformed to function or macro
@@ -1836,6 +1874,7 @@ Example:
          (list 'substring (nth 4 method) from-temp to-temp))))
 
 ;;; Getting and optimizing setf-methods.
+;;;###autoload
 (defun get-setf-method (place &optional env)
   "Return a list of five values describing the setf-method for PLACE.
 PLACE may be any Lisp form which can appear as the PLACE argument to
@@ -1903,6 +1942,7 @@ a macro like `setf' or `incf'."
        (not (eq (car-safe (symbol-function (car form))) 'macro))))
 
 ;;; The standard modify macros.
+;;;###autoload
 (defmacro setf (&rest args)
   "Set each PLACE to the value of its VAL.
 This is a generalized version of `setq'; the PLACEs may be symbolic
@@ -1921,6 +1961,7 @@ The return value is the last VAL in the list.
             (store (cl-setf-do-store (nth 1 method) (nth 1 args))))
        (if (car method) (list 'let* (car method) store) store)))))
 
+;;;###autoload
 (defmacro psetf (&rest args)
   "Set PLACEs to the values VALs in parallel.
 This is like `setf', except that all VAL forms are evaluated (in order)
@@ -1944,6 +1985,7 @@ before assigning any PLACEs to the corresponding values.
          (setq expr (list 'setf (cadr args) (list 'prog1 (car args) expr))))
        (list 'progn expr nil)))))
 
+;;;###autoload
 (defun cl-do-pop (place)
   (if (cl-simple-expr-p place)
       (list 'prog1 (list 'car place) (list 'setf place (list 'cdr place)))
@@ -1956,6 +1998,7 @@ before assigning any PLACEs to the corresponding values.
                  (list 'car temp)
                  (cl-setf-do-store (nth 1 method) (list 'cdr temp)))))))
 
+;;;###autoload
 (defmacro remf (place tag)
   "Remove TAG from property list PLACE.
 PLACE may be a symbol, or any generalized variable allowed by `setf'.
@@ -1976,6 +2019,7 @@ The form returns true if TAG was found and removed, nil otherwise."
                      t)
                (list 'cl-do-remf tval ttag)))))
 
+;;;###autoload
 (defmacro shiftf (place &rest args)
   "Shift left among PLACEs.
 Example: (shiftf A B C) sets A to B, B to C, and returns the old A.
@@ -1991,6 +2035,7 @@ Each PLACE may be a symbol, or any generalized variable allowed by `setf'.
         (prog1 ,(nth 2 method)
           ,(cl-setf-do-store (nth 1 method) `(shiftf ,@args))))))))
 
+;;;###autoload
 (defmacro rotatef (&rest args)
   "Rotate left among PLACEs.
 Example: (rotatef A B C) sets A to B, B to C, and C to A.  It returns nil.
@@ -2016,6 +2061,7 @@ Each PLACE may be a symbol, or any generalized variable allowed by `setf'.
        (list 'let* (append (car method) (list (list temp (nth 2 method))))
              (cl-setf-do-store (nth 1 method) form) nil)))))
 
+;;;###autoload
 (defmacro letf (bindings &rest body)
   "Temporarily bind to PLACEs.
 This is the analogue of `let', but with generalized variables (in the
@@ -2072,6 +2118,7 @@ the PLACE is not modified before executing BODY.
                rev (cdr rev))))
       (list* 'let* lets body))))
 
+;;;###autoload
 (defmacro letf* (bindings &rest body)
   "Temporarily bind to PLACEs.
 This is the analogue of `let*', but with generalized variables (in the
@@ -2090,6 +2137,7 @@ the PLACE is not modified before executing BODY.
       (setq body (list (list* 'letf (list (pop bindings)) body))))
     (car body)))
 
+;;;###autoload
 (defmacro callf (func place &rest args)
   "Set PLACE to (FUNC PLACE ARGS...).
 FUNC should be an unquoted function name.  PLACE may be a symbol,
@@ -2104,6 +2152,7 @@ or any generalized variable allowed by `setf'.
                              (list* 'funcall (list 'function func)
                                     rargs))))))
 
+;;;###autoload
 (defmacro callf2 (func arg1 place &rest args)
   "Set PLACE to (FUNC ARG1 PLACE ARGS...).
 Like `callf', but PLACE is the second argument of FUNC, not the first.
@@ -2120,6 +2169,7 @@ Like `callf', but PLACE is the second argument of FUNC, not the first.
                                (list* 'funcall (list 'function func)
                                       rargs)))))))
 
+;;;###autoload
 (defmacro define-modify-macro (name arglist func &optional doc)
   "Define a `setf'-like modify macro.
 If NAME is called, it combines its PLACE argument with the other arguments
@@ -2134,6 +2184,7 @@ from ARGLIST using FUNC: (define-modify-macro incf (&optional (n 1)) +)"
 
 ;;; Structures.
 
+;;;###autoload
 (defmacro defstruct (struct &rest descs)
   "Define a struct type.
 This macro defines a new Lisp data type called NAME, which contains data
@@ -2358,6 +2409,7 @@ copier, a `NAME-p' predicate, and setf-able `NAME-SLOT' accessors.
             forms)
     (cons 'progn (nreverse (cons (list 'quote name) forms)))))
 
+;;;###autoload
 (defun cl-struct-setf-expander (x name accessor pred-form pos)
   (let* ((temp (make-symbol "--cl-x--")) (store (make-symbol "--cl-store--")))
     (list (list temp) (list x) (list store)
@@ -2426,11 +2478,13 @@ The type name can then be used in `typecase', `check-type', etc."
          ((eq (car type) 'satisfies) (list (cadr type) val))
          (t (error "Bad type spec: %s" type)))))
 
+;;;###autoload
 (defun typep (object type)   ; See compiler macro below.
   "Check that OBJECT is of type TYPE.
 TYPE is a Common Lisp-style type specifier."
   (eval (cl-make-type-test 'object type)))
 
+;;;###autoload
 (defmacro check-type (form type &optional string)
   "Verify that FORM is of type TYPE; signal an error if not.
 STRING is an optional description of the desired type."
@@ -2445,6 +2499,7 @@ STRING is an optional description of the desired type."
         (if (eq temp form) (list 'progn body nil)
           (list 'let (list (list temp form)) body nil)))))
 
+;;;###autoload
 (defmacro assert (form &optional show-args string &rest args)
   "Verify that FORM returns non-nil; signal an error if not.
 Second arg SHOW-ARGS means to include arguments of FORM in message.
@@ -2466,6 +2521,7 @@ omitted, a default message listing FORM itself is used."
                             (list* 'list (list 'quote form) sargs))))
               nil))))
 
+;;;###autoload
 (defmacro ignore-errors (&rest body)
   "Execute BODY; if an error occurs, return nil.
 Otherwise, return result of last form in BODY."
@@ -2474,6 +2530,7 @@ Otherwise, return result of last form in BODY."
 
 ;;; Compiler macros.
 
+;;;###autoload
 (defmacro define-compiler-macro (func args &rest body)
   "Define a compiler-only macro.
 This is like `defmacro', but macro expansion occurs only if the call to
@@ -2497,6 +2554,7 @@ and then returning foo."
              (list 'put (list 'quote func) '(quote byte-compile)
                    '(quote cl-byte-compile-compiler-macro)))))
 
+;;;###autoload
 (defun compiler-macroexpand (form)
   (while
       (let ((func (car-safe form)) (handler nil))
@@ -2552,9 +2610,9 @@ surrounded by (block NAME ...).
       (if lets (list 'let lets body) body))))
 
 
-;;; Compile-time optimizations for some functions defined in this package.
-;;; Note that cl.el arranges to force cl-macs to be loaded at compile-time,
-;;; mainly to make sure these macros will be present.
+;; Compile-time optimizations for some functions defined in this package.
+;; Note that cl.el arranges to force cl-macs to be loaded at compile-time,
+;; mainly to make sure these macros will be present.
 
 (put 'eql 'byte-compile nil)
 (define-compiler-macro eql (&whole form a b)
@@ -2665,9 +2723,10 @@ surrounded by (block NAME ...).
 
 (run-hooks 'cl-macs-load-hook)
 
-;;; Local variables:
-;;; byte-compile-warnings: (redefine callargs free-vars unresolved obsolete noruntime)
-;;; End:
+;; Local variables:
+;; byte-compile-warnings: (redefine callargs free-vars unresolved obsolete noruntime)
+;; generated-autoload-file: "cl-loaddefs.el"
+;; End:
 
 ;; arch-tag: afd947a6-b553-4df1-bba5-000be6388f46
 ;;; cl-macs.el ends here
index b418568..8016b75 100644 (file)
 (defvar cl-key)
 
 
+;;;###autoload
 (defun reduce (cl-func cl-seq &rest cl-keys)
   "Reduce two-argument FUNCTION across SEQ.
 \nKeywords supported:  :start :end :from-end :initial-value :key
                                  (cl-check-key (pop cl-seq))))))
       cl-accum)))
 
+;;;###autoload
 (defun fill (seq item &rest cl-keys)
   "Fill the elements of SEQ with ITEM.
 \nKeywords supported:  :start :end
          (setq cl-start (1+ cl-start)))))
     seq))
 
+;;;###autoload
 (defun replace (cl-seq1 cl-seq2 &rest cl-keys)
   "Replace the elements of SEQ1 with the elements of SEQ2.
 SEQ1 is destructively modified, then returned.
@@ -206,6 +209,7 @@ SEQ1 is destructively modified, then returned.
            (setq cl-start2 (1+ cl-start2) cl-start1 (1+ cl-start1))))))
     cl-seq1))
 
+;;;###autoload
 (defun remove* (cl-item cl-seq &rest cl-keys)
   "Remove all occurrences of ITEM in SEQ.
 This is a non-destructive function; it makes a copy of SEQ if necessary
@@ -251,6 +255,7 @@ to avoid corrupting the original SEQ.
                cl-seq))
          cl-seq)))))
 
+;;;###autoload
 (defun remove-if (cl-pred cl-list &rest cl-keys)
   "Remove all items satisfying PREDICATE in SEQ.
 This is a non-destructive function; it makes a copy of SEQ if necessary
@@ -259,6 +264,7 @@ to avoid corrupting the original SEQ.
 \n(fn PREDICATE SEQ [KEYWORD VALUE]...)"
   (apply 'remove* nil cl-list :if cl-pred cl-keys))
 
+;;;###autoload
 (defun remove-if-not (cl-pred cl-list &rest cl-keys)
   "Remove all items not satisfying PREDICATE in SEQ.
 This is a non-destructive function; it makes a copy of SEQ if necessary
@@ -267,6 +273,7 @@ to avoid corrupting the original SEQ.
 \n(fn PREDICATE SEQ [KEYWORD VALUE]...)"
   (apply 'remove* nil cl-list :if-not cl-pred cl-keys))
 
+;;;###autoload
 (defun delete* (cl-item cl-seq &rest cl-keys)
   "Remove all occurrences of ITEM in SEQ.
 This is a destructive function; it reuses the storage of SEQ whenever possible.
@@ -310,6 +317,7 @@ This is a destructive function; it reuses the storage of SEQ whenever possible.
            cl-seq)
        (apply 'remove* cl-item cl-seq cl-keys)))))
 
+;;;###autoload
 (defun delete-if (cl-pred cl-list &rest cl-keys)
   "Remove all items satisfying PREDICATE in SEQ.
 This is a destructive function; it reuses the storage of SEQ whenever possible.
@@ -317,6 +325,7 @@ This is a destructive function; it reuses the storage of SEQ whenever possible.
 \n(fn PREDICATE SEQ [KEYWORD VALUE]...)"
   (apply 'delete* nil cl-list :if cl-pred cl-keys))
 
+;;;###autoload
 (defun delete-if-not (cl-pred cl-list &rest cl-keys)
   "Remove all items not satisfying PREDICATE in SEQ.
 This is a destructive function; it reuses the storage of SEQ whenever possible.
@@ -324,12 +333,14 @@ This is a destructive function; it reuses the storage of SEQ whenever possible.
 \n(fn PREDICATE SEQ [KEYWORD VALUE]...)"
   (apply 'delete* nil cl-list :if-not cl-pred cl-keys))
 
+;;;###autoload
 (defun remove-duplicates (cl-seq &rest cl-keys)
   "Return a copy of SEQ with all duplicate elements removed.
 \nKeywords supported:  :test :test-not :key :start :end :from-end
 \n(fn SEQ [KEYWORD VALUE]...)"
   (cl-delete-duplicates cl-seq cl-keys t))
 
+;;;###autoload
 (defun delete-duplicates (cl-seq &rest cl-keys)
   "Remove all duplicate elements from SEQ (destructively).
 \nKeywords supported:  :test :test-not :key :start :end :from-end
@@ -376,6 +387,7 @@ This is a destructive function; it reuses the storage of SEQ whenever possible.
     (let ((cl-res (cl-delete-duplicates (append cl-seq nil) cl-keys nil)))
       (if (stringp cl-seq) (concat cl-res) (vconcat cl-res)))))
 
+;;;###autoload
 (defun substitute (cl-new cl-old cl-seq &rest cl-keys)
   "Substitute NEW for OLD in SEQ.
 This is a non-destructive function; it makes a copy of SEQ if necessary
@@ -397,6 +409,7 @@ to avoid corrupting the original SEQ.
          (apply 'nsubstitute cl-new cl-old cl-seq :count cl-count
                 :start cl-i cl-keys))))))
 
+;;;###autoload
 (defun substitute-if (cl-new cl-pred cl-list &rest cl-keys)
   "Substitute NEW for all items satisfying PREDICATE in SEQ.
 This is a non-destructive function; it makes a copy of SEQ if necessary
@@ -405,6 +418,7 @@ to avoid corrupting the original SEQ.
 \n(fn NEW PREDICATE SEQ [KEYWORD VALUE]...)"
   (apply 'substitute cl-new nil cl-list :if cl-pred cl-keys))
 
+;;;###autoload
 (defun substitute-if-not (cl-new cl-pred cl-list &rest cl-keys)
   "Substitute NEW for all items not satisfying PREDICATE in SEQ.
 This is a non-destructive function; it makes a copy of SEQ if necessary
@@ -413,6 +427,7 @@ to avoid corrupting the original SEQ.
 \n(fn NEW PREDICATE SEQ [KEYWORD VALUE]...)"
   (apply 'substitute cl-new nil cl-list :if-not cl-pred cl-keys))
 
+;;;###autoload
 (defun nsubstitute (cl-new cl-old cl-seq &rest cl-keys)
   "Substitute NEW for OLD in SEQ.
 This is a destructive function; it reuses the storage of SEQ whenever possible.
@@ -446,6 +461,7 @@ This is a destructive function; it reuses the storage of SEQ whenever possible.
              (setq cl-start (1+ cl-start))))))
     cl-seq))
 
+;;;###autoload
 (defun nsubstitute-if (cl-new cl-pred cl-list &rest cl-keys)
   "Substitute NEW for all items satisfying PREDICATE in SEQ.
 This is a destructive function; it reuses the storage of SEQ whenever possible.
@@ -453,6 +469,7 @@ This is a destructive function; it reuses the storage of SEQ whenever possible.
 \n(fn NEW PREDICATE SEQ [KEYWORD VALUE]...)"
   (apply 'nsubstitute cl-new nil cl-list :if cl-pred cl-keys))
 
+;;;###autoload
 (defun nsubstitute-if-not (cl-new cl-pred cl-list &rest cl-keys)
   "Substitute NEW for all items not satisfying PREDICATE in SEQ.
 This is a destructive function; it reuses the storage of SEQ whenever possible.
@@ -460,6 +477,7 @@ This is a destructive function; it reuses the storage of SEQ whenever possible.
 \n(fn NEW PREDICATE SEQ [KEYWORD VALUE]...)"
   (apply 'nsubstitute cl-new nil cl-list :if-not cl-pred cl-keys))
 
+;;;###autoload
 (defun find (cl-item cl-seq &rest cl-keys)
   "Find the first occurrence of ITEM in SEQ.
 Return the matching ITEM, or nil if not found.
@@ -468,6 +486,7 @@ Return the matching ITEM, or nil if not found.
   (let ((cl-pos (apply 'position cl-item cl-seq cl-keys)))
     (and cl-pos (elt cl-seq cl-pos))))
 
+;;;###autoload
 (defun find-if (cl-pred cl-list &rest cl-keys)
   "Find the first item satisfying PREDICATE in SEQ.
 Return the matching item, or nil if not found.
@@ -475,6 +494,7 @@ Return the matching item, or nil if not found.
 \n(fn PREDICATE SEQ [KEYWORD VALUE]...)"
   (apply 'find nil cl-list :if cl-pred cl-keys))
 
+;;;###autoload
 (defun find-if-not (cl-pred cl-list &rest cl-keys)
   "Find the first item not satisfying PREDICATE in SEQ.
 Return the matching item, or nil if not found.
@@ -482,6 +502,7 @@ Return the matching item, or nil if not found.
 \n(fn PREDICATE SEQ [KEYWORD VALUE]...)"
   (apply 'find nil cl-list :if-not cl-pred cl-keys))
 
+;;;###autoload
 (defun position (cl-item cl-seq &rest cl-keys)
   "Find the first occurrence of ITEM in SEQ.
 Return the index of the matching item, or nil if not found.
@@ -512,6 +533,7 @@ Return the index of the matching item, or nil if not found.
        (setq cl-start (1+ cl-start)))
       (and (< cl-start cl-end) cl-start))))
 
+;;;###autoload
 (defun position-if (cl-pred cl-list &rest cl-keys)
   "Find the first item satisfying PREDICATE in SEQ.
 Return the index of the matching item, or nil if not found.
@@ -519,6 +541,7 @@ Return the index of the matching item, or nil if not found.
 \n(fn PREDICATE SEQ [KEYWORD VALUE]...)"
   (apply 'position nil cl-list :if cl-pred cl-keys))
 
+;;;###autoload
 (defun position-if-not (cl-pred cl-list &rest cl-keys)
   "Find the first item not satisfying PREDICATE in SEQ.
 Return the index of the matching item, or nil if not found.
@@ -526,6 +549,7 @@ Return the index of the matching item, or nil if not found.
 \n(fn PREDICATE SEQ [KEYWORD VALUE]...)"
   (apply 'position nil cl-list :if-not cl-pred cl-keys))
 
+;;;###autoload
 (defun count (cl-item cl-seq &rest cl-keys)
   "Count the number of occurrences of ITEM in SEQ.
 \nKeywords supported:  :test :test-not :key :start :end
@@ -540,18 +564,21 @@ Return the index of the matching item, or nil if not found.
        (setq cl-start (1+ cl-start)))
       cl-count)))
 
+;;;###autoload
 (defun count-if (cl-pred cl-list &rest cl-keys)
   "Count the number of items satisfying PREDICATE in SEQ.
 \nKeywords supported:  :key :start :end
 \n(fn PREDICATE SEQ [KEYWORD VALUE]...)"
   (apply 'count nil cl-list :if cl-pred cl-keys))
 
+;;;###autoload
 (defun count-if-not (cl-pred cl-list &rest cl-keys)
   "Count the number of items not satisfying PREDICATE in SEQ.
 \nKeywords supported:  :key :start :end
 \n(fn PREDICATE SEQ [KEYWORD VALUE]...)"
   (apply 'count nil cl-list :if-not cl-pred cl-keys))
 
+;;;###autoload
 (defun mismatch (cl-seq1 cl-seq2 &rest cl-keys)
   "Compare SEQ1 with SEQ2, return index of first mismatching element.
 Return nil if the sequences match.  If one sequence is a prefix of the
@@ -582,6 +609,7 @@ other, the return value indicates the end of the shorter sequence.
        (and (or (< cl-start1 cl-end1) (< cl-start2 cl-end2))
             cl-start1)))))
 
+;;;###autoload
 (defun search (cl-seq1 cl-seq2 &rest cl-keys)
   "Search for SEQ1 as a subsequence of SEQ2.
 Return the index of the leftmost element of the first match found;
@@ -608,6 +636,7 @@ return nil if there are no matches.
          (if cl-from-end (setq cl-end2 cl-pos) (setq cl-start2 (1+ cl-pos))))
        (and (< cl-start2 cl-end2) cl-pos)))))
 
+;;;###autoload
 (defun sort* (cl-seq cl-pred &rest cl-keys)
   "Sort the argument SEQ according to PREDICATE.
 This is a destructive function; it reuses the storage of SEQ if possible.
@@ -622,6 +651,7 @@ This is a destructive function; it reuses the storage of SEQ if possible.
                                 (funcall cl-pred (funcall cl-key cl-x)
                                          (funcall cl-key cl-y)))))))))
 
+;;;###autoload
 (defun stable-sort (cl-seq cl-pred &rest cl-keys)
   "Sort the argument SEQ stably according to PREDICATE.
 This is a destructive function; it reuses the storage of SEQ if possible.
@@ -629,6 +659,7 @@ This is a destructive function; it reuses the storage of SEQ if possible.
 \n(fn SEQ PREDICATE [KEYWORD VALUE]...)"
   (apply 'sort* cl-seq cl-pred cl-keys))
 
+;;;###autoload
 (defun merge (cl-type cl-seq1 cl-seq2 cl-pred &rest cl-keys)
   "Destructively merge the two sequences to produce a new sequence.
 TYPE is the sequence type to return, SEQ1 and SEQ2 are the two argument
@@ -647,6 +678,7 @@ sequences, and PREDICATE is a `less-than' predicate on the elements.
       (coerce (nconc (nreverse cl-res) cl-seq1 cl-seq2) cl-type))))
 
 ;;; See compiler macro in cl-macs.el
+;;;###autoload
 (defun member* (cl-item cl-list &rest cl-keys)
   "Find the first occurrence of ITEM in LIST.
 Return the sublist of LIST whose car is ITEM.
@@ -661,6 +693,7 @@ Return the sublist of LIST whose car is ITEM.
        (member cl-item cl-list)
       (memq cl-item cl-list))))
 
+;;;###autoload
 (defun member-if (cl-pred cl-list &rest cl-keys)
   "Find the first item satisfying PREDICATE in LIST.
 Return the sublist of LIST whose car matches.
@@ -668,6 +701,7 @@ Return the sublist of LIST whose car matches.
 \n(fn PREDICATE LIST [KEYWORD VALUE]...)"
   (apply 'member* nil cl-list :if cl-pred cl-keys))
 
+;;;###autoload
 (defun member-if-not (cl-pred cl-list &rest cl-keys)
   "Find the first item not satisfying PREDICATE in LIST.
 Return the sublist of LIST whose car matches.
@@ -675,6 +709,7 @@ Return the sublist of LIST whose car matches.
 \n(fn PREDICATE LIST [KEYWORD VALUE]...)"
   (apply 'member* nil cl-list :if-not cl-pred cl-keys))
 
+;;;###autoload
 (defun cl-adjoin (cl-item cl-list &rest cl-keys)
   (if (cl-parsing-keywords (:key) t
        (apply 'member* (cl-check-key cl-item) cl-list cl-keys))
@@ -682,6 +717,7 @@ Return the sublist of LIST whose car matches.
     (cons cl-item cl-list)))
 
 ;;; See compiler macro in cl-macs.el
+;;;###autoload
 (defun assoc* (cl-item cl-alist &rest cl-keys)
   "Find the first item whose car matches ITEM in LIST.
 \nKeywords supported:  :test :test-not :key
@@ -697,18 +733,21 @@ Return the sublist of LIST whose car matches.
        (assoc cl-item cl-alist)
       (assq cl-item cl-alist))))
 
+;;;###autoload
 (defun assoc-if (cl-pred cl-list &rest cl-keys)
   "Find the first item whose car satisfies PREDICATE in LIST.
 \nKeywords supported:  :key
 \n(fn PREDICATE LIST [KEYWORD VALUE]...)"
   (apply 'assoc* nil cl-list :if cl-pred cl-keys))
 
+;;;###autoload
 (defun assoc-if-not (cl-pred cl-list &rest cl-keys)
   "Find the first item whose car does not satisfy PREDICATE in LIST.
 \nKeywords supported:  :key
 \n(fn PREDICATE LIST [KEYWORD VALUE]...)"
   (apply 'assoc* nil cl-list :if-not cl-pred cl-keys))
 
+;;;###autoload
 (defun rassoc* (cl-item cl-alist &rest cl-keys)
   "Find the first item whose cdr matches ITEM in LIST.
 \nKeywords supported:  :test :test-not :key
@@ -722,18 +761,21 @@ Return the sublist of LIST whose car matches.
        (and cl-alist (car cl-alist)))
     (rassq cl-item cl-alist)))
 
+;;;###autoload
 (defun rassoc-if (cl-pred cl-list &rest cl-keys)
   "Find the first item whose cdr satisfies PREDICATE in LIST.
 \nKeywords supported:  :key
 \n(fn PREDICATE LIST [KEYWORD VALUE]...)"
   (apply 'rassoc* nil cl-list :if cl-pred cl-keys))
 
+;;;###autoload
 (defun rassoc-if-not (cl-pred cl-list &rest cl-keys)
   "Find the first item whose cdr does not satisfy PREDICATE in LIST.
 \nKeywords supported:  :key
 \n(fn PREDICATE LIST [KEYWORD VALUE]...)"
   (apply 'rassoc* nil cl-list :if-not cl-pred cl-keys))
 
+;;;###autoload
 (defun union (cl-list1 cl-list2 &rest cl-keys)
   "Combine LIST1 and LIST2 using a set-union operation.
 The result list contains all items that appear in either LIST1 or LIST2.
@@ -754,6 +796,7 @@ to avoid corrupting the original LIST1 and LIST2.
           (pop cl-list2))
         cl-list1)))
 
+;;;###autoload
 (defun nunion (cl-list1 cl-list2 &rest cl-keys)
   "Combine LIST1 and LIST2 using a set-union operation.
 The result list contains all items that appear in either LIST1 or LIST2.
@@ -764,6 +807,7 @@ whenever possible.
   (cond ((null cl-list1) cl-list2) ((null cl-list2) cl-list1)
        (t (apply 'union cl-list1 cl-list2 cl-keys))))
 
+;;;###autoload
 (defun intersection (cl-list1 cl-list2 &rest cl-keys)
   "Combine LIST1 and LIST2 using a set-intersection operation.
 The result list contains all items that appear in both LIST1 and LIST2.
@@ -786,6 +830,7 @@ to avoid corrupting the original LIST1 and LIST2.
               (pop cl-list2))
             cl-res)))))
 
+;;;###autoload
 (defun nintersection (cl-list1 cl-list2 &rest cl-keys)
   "Combine LIST1 and LIST2 using a set-intersection operation.
 The result list contains all items that appear in both LIST1 and LIST2.
@@ -795,6 +840,7 @@ whenever possible.
 \n(fn LIST1 LIST2 [KEYWORD VALUE]...)"
   (and cl-list1 cl-list2 (apply 'intersection cl-list1 cl-list2 cl-keys)))
 
+;;;###autoload
 (defun set-difference (cl-list1 cl-list2 &rest cl-keys)
   "Combine LIST1 and LIST2 using a set-difference operation.
 The result list contains all items that appear in LIST1 but not LIST2.
@@ -814,6 +860,7 @@ to avoid corrupting the original LIST1 and LIST2.
          (pop cl-list1))
        cl-res))))
 
+;;;###autoload
 (defun nset-difference (cl-list1 cl-list2 &rest cl-keys)
   "Combine LIST1 and LIST2 using a set-difference operation.
 The result list contains all items that appear in LIST1 but not LIST2.
@@ -824,6 +871,7 @@ whenever possible.
   (if (or (null cl-list1) (null cl-list2)) cl-list1
     (apply 'set-difference cl-list1 cl-list2 cl-keys)))
 
+;;;###autoload
 (defun set-exclusive-or (cl-list1 cl-list2 &rest cl-keys)
   "Combine LIST1 and LIST2 using a set-exclusive-or operation.
 The result list contains all items that appear in exactly one of LIST1, LIST2.
@@ -836,6 +884,7 @@ to avoid corrupting the original LIST1 and LIST2.
        (t (append (apply 'set-difference cl-list1 cl-list2 cl-keys)
                   (apply 'set-difference cl-list2 cl-list1 cl-keys)))))
 
+;;;###autoload
 (defun nset-exclusive-or (cl-list1 cl-list2 &rest cl-keys)
   "Combine LIST1 and LIST2 using a set-exclusive-or operation.
 The result list contains all items that appear in exactly one of LIST1, LIST2.
@@ -848,6 +897,7 @@ whenever possible.
        (t (nconc (apply 'nset-difference cl-list1 cl-list2 cl-keys)
                  (apply 'nset-difference cl-list2 cl-list1 cl-keys)))))
 
+;;;###autoload
 (defun subsetp (cl-list1 cl-list2 &rest cl-keys)
   "Return true if LIST1 is a subset of LIST2.
 I.e., if every element of LIST1 also appears in LIST2.
@@ -862,6 +912,7 @@ I.e., if every element of LIST1 also appears in LIST2.
               (pop cl-list1))
             (null cl-list1)))))
 
+;;;###autoload
 (defun subst-if (cl-new cl-pred cl-tree &rest cl-keys)
   "Substitute NEW for elements matching PREDICATE in TREE (non-destructively).
 Return a copy of TREE with all matching elements replaced by NEW.
@@ -869,6 +920,7 @@ Return a copy of TREE with all matching elements replaced by NEW.
 \n(fn NEW PREDICATE TREE [KEYWORD VALUE]...)"
   (apply 'sublis (list (cons nil cl-new)) cl-tree :if cl-pred cl-keys))
 
+;;;###autoload
 (defun subst-if-not (cl-new cl-pred cl-tree &rest cl-keys)
   "Substitute NEW for elts not matching PREDICATE in TREE (non-destructively).
 Return a copy of TREE with all non-matching elements replaced by NEW.
@@ -876,6 +928,7 @@ Return a copy of TREE with all non-matching elements replaced by NEW.
 \n(fn NEW PREDICATE TREE [KEYWORD VALUE]...)"
   (apply 'sublis (list (cons nil cl-new)) cl-tree :if-not cl-pred cl-keys))
 
+;;;###autoload
 (defun nsubst (cl-new cl-old cl-tree &rest cl-keys)
   "Substitute NEW for OLD everywhere in TREE (destructively).
 Any element of TREE which is `eql' to OLD is changed to NEW (via a call
@@ -884,6 +937,7 @@ to `setcar').
 \n(fn NEW OLD TREE [KEYWORD VALUE]...)"
   (apply 'nsublis (list (cons cl-old cl-new)) cl-tree cl-keys))
 
+;;;###autoload
 (defun nsubst-if (cl-new cl-pred cl-tree &rest cl-keys)
   "Substitute NEW for elements matching PREDICATE in TREE (destructively).
 Any element of TREE which matches is changed to NEW (via a call to `setcar').
@@ -891,6 +945,7 @@ Any element of TREE which matches is changed to NEW (via a call to `setcar').
 \n(fn NEW PREDICATE TREE [KEYWORD VALUE]...)"
   (apply 'nsublis (list (cons nil cl-new)) cl-tree :if cl-pred cl-keys))
 
+;;;###autoload
 (defun nsubst-if-not (cl-new cl-pred cl-tree &rest cl-keys)
   "Substitute NEW for elements not matching PREDICATE in TREE (destructively).
 Any element of TREE which matches is changed to NEW (via a call to `setcar').
@@ -898,6 +953,7 @@ Any element of TREE which matches is changed to NEW (via a call to `setcar').
 \n(fn NEW PREDICATE TREE [KEYWORD VALUE]...)"
   (apply 'nsublis (list (cons nil cl-new)) cl-tree :if-not cl-pred cl-keys))
 
+;;;###autoload
 (defun sublis (cl-alist cl-tree &rest cl-keys)
   "Perform substitutions indicated by ALIST in TREE (non-destructively).
 Return a copy of TREE with all matching elements replaced.
@@ -920,6 +976,7 @@ Return a copy of TREE with all matching elements replaced.
              (cons cl-a cl-d)))
        cl-tree))))
 
+;;;###autoload
 (defun nsublis (cl-alist cl-tree &rest cl-keys)
   "Perform substitutions indicated by ALIST in TREE (destructively).
 Any matching element of TREE is changed via a call to `setcar'.
@@ -944,6 +1001,7 @@ Any matching element of TREE is changed via a call to `setcar'.
          (progn (setcdr cl-tree (cdr (car cl-p))) (setq cl-tree nil))
        (setq cl-tree (cdr cl-tree))))))
 
+;;;###autoload
 (defun tree-equal (cl-x cl-y &rest cl-keys)
   "Return t if trees TREE1 and TREE2 have `eql' leaves.
 Atoms are compared by `eql'; cons cells are compared recursively.
@@ -961,5 +1019,9 @@ Atoms are compared by `eql'; cons cells are compared recursively.
 
 (run-hooks 'cl-seq-load-hook)
 
-;;; arch-tag: ec1cc072-9006-4225-b6ba-d6b07ed1710c
+;; Local variables:
+;; generated-autoload-file: "cl-loaddefs.el"
+;; End:
+
+;; arch-tag: ec1cc072-9006-4225-b6ba-d6b07ed1710c
 ;;; cl-seq.el ends here
index 89c0721..8d60950 100644 (file)
@@ -113,8 +113,9 @@ a future Emacs interpreter will be able to use it.")
 (defun cl-cannot-unload ()
   (error "Cannot unload the feature `cl'"))
 
-;;; Generalized variables.  These macros are defined here so that they
-;;; can safely be used in .emacs files.
+;;; Generalized variables.
+;; These macros are defined here so that they
+;; can safely be used in .emacs files.
 
 (defmacro incf (place &optional x)
   "Increment PLACE by X (1 by default).
@@ -185,8 +186,8 @@ an element already on the list.
 
 ;;; Control structures.
 
-;;; These macros are so simple and so often-used that it's better to have
-;;; them all the time than to load them from cl-macs.el.
+;; These macros are so simple and so often-used that it's better to have
+;; them all the time than to load them from cl-macs.el.
 
 (defun cl-map-extents (&rest cl-args)
   (apply 'cl-map-overlays cl-args))
@@ -198,9 +199,10 @@ an element already on the list.
 (defalias 'cl-block-throw 'throw)
 
 
-;;; Multiple values.  True multiple values are not supported, or even
-;;; simulated.  Instead, multiple-value-bind and friends simply expect
-;;; the target form to return the values as a list.
+;;; Multiple values.
+;; True multiple values are not supported, or even
+;; simulated.  Instead, multiple-value-bind and friends simply expect
+;; the target form to return the values as a list.
 
 (defsubst values (&rest values)
   "Return multiple values, Common Lisp style.
@@ -321,7 +323,7 @@ always returns nil."
 
 (defvar *random-state* (vector 'cl-random-state-tag -1 30 (cl-random-time)))
 
-;;; The following are actually set by cl-float-limits.
+;; The following are actually set by cl-float-limits.
 (defconst most-positive-float nil)
 (defconst most-negative-float nil)
 (defconst least-positive-float nil)
@@ -585,105 +587,55 @@ If ALIST is non-nil, the new pairs are prepended to it."
 
 ;;; Miscellaneous.
 
-(defvar cl-fake-autoloads nil
-  "Non-nil means don't make CL functions autoload.")
-
-;;; Autoload the other portions of the package.
+;; Define data for indentation and edebug.
+(dolist (entry
+         '(((defun* defmacro*) 2)
+           ((function*) nil
+            (&or symbolp ([&optional 'macro] 'lambda (&rest sexp) &rest form)))
+           ((eval-when) 1 (sexp &rest form))
+           ((declare) nil (&rest sexp))
+           ((the) 1 (sexp &rest form))
+           ((case ecase typecase etypecase) 1 (form &rest (sexp &rest form)))
+           ((block return-from) 1 (sexp &rest form))
+           ((return) nil (&optional form))
+           ((do do*) 2 ((&rest &or symbolp (symbolp &optional form form))
+                        (form &rest form)
+                        &rest form))
+           ((do-symbols) 1 ((symbolp form &optional form form) &rest form))
+           ((do-all-symbols) 1 ((symbolp form &optional form) &rest form))
+           ((psetq setf psetf) nil edebug-setq-form)
+           ((progv) 2 (&rest form))
+           ((flet labels macrolet) 1
+            ((&rest (sexp sexp &rest form)) &rest form))
+           ((symbol-macrolet lexical-let lexical-let*) 1
+            ((&rest &or symbolp (symbolp form)) &rest form))
+           ((multiple-value-bind) 2 ((&rest symbolp) &rest form))
+           ((multiple-value-setq) 1 ((&rest symbolp) &rest form))
+           ((incf decf remf pushnew shiftf rotatef) nil (&rest form))
+           ((letf letf*) 1 ((&rest (&rest form)) &rest form))
+           ((callf destructuring-bind) 2 (sexp form &rest form))
+           ((callf2) 3 (sexp form form &rest form))
+           ((loop) nil (&rest &or symbolp form))
+           ((ignore-errors) 0 (&rest form))))
+  (dolist (func (car entry))
+    (put func 'lisp-indent-function (nth 1 entry))
+    (put func 'lisp-indent-hook (nth 1 entry))
+    (or (get func 'edebug-form-spec)
+        (put func 'edebug-form-spec (nth 2 entry)))))
+
+;; Autoload the other portions of the package.
 ;; We want to replace the basic versions of dolist, dotimes, declare below.
 (fmakunbound 'dolist)
 (fmakunbound 'dotimes)
 (fmakunbound 'declare)
-(mapcar (function
-        (lambda (set)
-          (let ((file (if cl-fake-autoloads "<none>" (car set))))
-            (mapcar (function
-                     (lambda (func)
-                       (autoload func (car set) nil nil (nth 1 set))))
-                    (cddr set)))))
-       '(("cl-extra" nil
-          coerce equalp cl-map-keymap maplist mapc mapl mapcan mapcon
-          cl-map-keymap cl-map-keymap-recursively cl-map-intervals
-          cl-map-overlays cl-set-frame-visible-p cl-float-limits
-          gcd lcm isqrt floor* ceiling* truncate* round*
-          mod* rem* signum random* make-random-state random-state-p
-          subseq concatenate cl-mapcar-many map some every notany
-          notevery revappend nreconc list-length tailp copy-tree get* getf
-          cl-set-getf cl-do-remf remprop cl-make-hash-table cl-hash-lookup
-          cl-gethash cl-puthash cl-remhash cl-clrhash cl-maphash cl-hash-table-p
-          cl-hash-table-count cl-progv-before cl-prettyexpand
-          cl-macroexpand-all)
-         ("cl-seq" nil
-          reduce fill replace remove* remove-if remove-if-not
-          delete* delete-if delete-if-not remove-duplicates
-          delete-duplicates substitute substitute-if substitute-if-not
-          nsubstitute nsubstitute-if nsubstitute-if-not find find-if
-          find-if-not position position-if position-if-not count count-if
-          count-if-not mismatch search sort* stable-sort merge member*
-          member-if member-if-not cl-adjoin assoc* assoc-if assoc-if-not
-          rassoc* rassoc-if rassoc-if-not union nunion intersection
-          nintersection set-difference nset-difference set-exclusive-or
-          nset-exclusive-or subsetp subst-if subst-if-not nsubst nsubst-if
-          nsubst-if-not sublis nsublis tree-equal)
-         ("cl-macs" nil
-          gensym gentemp typep cl-do-pop get-setf-method
-          cl-struct-setf-expander compiler-macroexpand cl-compile-time-init)
-         ("cl-macs" t
-          defun* defmacro* function* destructuring-bind eval-when
-          load-time-value case ecase typecase etypecase
-          block return return-from loop do do* dolist dotimes do-symbols
-          do-all-symbols psetq progv flet labels macrolet symbol-macrolet
-          lexical-let lexical-let* multiple-value-bind multiple-value-setq
-          locally the declare define-setf-method defsetf define-modify-macro
-          setf psetf remf shiftf rotatef letf letf* callf callf2 defstruct
-          check-type assert ignore-errors define-compiler-macro)))
-
-;;; Define data for indentation and edebug.
-(mapcar (function
-        (lambda (entry)
-          (mapcar (function
-                   (lambda (func)
-                     (put func 'lisp-indent-function (nth 1 entry))
-                     (put func 'lisp-indent-hook (nth 1 entry))
-                     (or (get func 'edebug-form-spec)
-                         (put func 'edebug-form-spec (nth 2 entry)))))
-                  (car entry))))
-       '(((defun* defmacro*) 2)
-         ((function*) nil
-          (&or symbolp ([&optional 'macro] 'lambda (&rest sexp) &rest form)))
-         ((eval-when) 1 (sexp &rest form))
-         ((declare) nil (&rest sexp))
-         ((the) 1 (sexp &rest form))
-         ((case ecase typecase etypecase) 1 (form &rest (sexp &rest form)))
-         ((block return-from) 1 (sexp &rest form))
-         ((return) nil (&optional form))
-         ((do do*) 2 ((&rest &or symbolp (symbolp &optional form form))
-                      (form &rest form)
-                      &rest form))
-         ((do-symbols) 1 ((symbolp form &optional form form) &rest form))
-         ((do-all-symbols) 1 ((symbolp form &optional form) &rest form))
-         ((psetq setf psetf) nil edebug-setq-form)
-         ((progv) 2 (&rest form))
-         ((flet labels macrolet) 1
-          ((&rest (sexp sexp &rest form)) &rest form))
-         ((symbol-macrolet lexical-let lexical-let*) 1
-          ((&rest &or symbolp (symbolp form)) &rest form))
-         ((multiple-value-bind) 2 ((&rest symbolp) &rest form))
-         ((multiple-value-setq) 1 ((&rest symbolp) &rest form))
-         ((incf decf remf pushnew shiftf rotatef) nil (&rest form))
-         ((letf letf*) 1 ((&rest (&rest form)) &rest form))
-         ((callf destructuring-bind) 2 (sexp form &rest form))
-         ((callf2) 3 (sexp form form &rest form))
-         ((loop) nil (&rest &or symbolp form))
-         ((ignore-errors) 0 (&rest form))))
-
-
-;;; This goes here so that cl-macs can find it if it loads right now.
-(provide 'cl-19)     ; usage: (require 'cl-19 "cl")
+(load "cl-loaddefs" nil 'quiet)
 
+;; This goes here so that cl-macs can find it if it loads right now.
+(provide 'cl-19)     ; usage: (require 'cl-19 "cl")
 
-;;; Things to do after byte-compiler is loaded.
-;;; As a side effect, we cause cl-macs to be loaded when compiling, so
-;;; that the compiler-macros defined there will be present.
+;; Things to do after byte-compiler is loaded.
+;; As a side effect, we cause cl-macs to be loaded when compiling, so
+;; that the compiler-macros defined there will be present.
 
 (defvar cl-hacked-flag nil)
 (defun cl-hack-byte-compiler ()
@@ -692,15 +644,15 @@ If ALIST is non-nil, the new pairs are prepended to it."
        (setq cl-hacked-flag t)         ; Do it first, to prevent recursion.
        (cl-compile-time-init))))       ; In cl-macs.el.
 
-;;; Try it now in case the compiler has already been loaded.
+;; Try it now in case the compiler has already been loaded.
 (cl-hack-byte-compiler)
 
-;;; Also make a hook in case compiler is loaded after this file.
+;; Also make a hook in case compiler is loaded after this file.
 (add-hook 'bytecomp-load-hook 'cl-hack-byte-compiler)
 
 
-;;; The following ensures that packages which expect the old-style cl.el
-;;; will be happy with this one.
+;; The following ensures that packages which expect the old-style cl.el
+;; will be happy with this one.
 
 (provide 'cl)
 
index ed1d010..8543bad 100644 (file)
@@ -46,14 +46,21 @@ A value of nil means to search whole buffer."
 ;; The character classes have the Latin-1 version and the Latin-9
 ;; version, which is probably enough.
 (defcustom copyright-regexp
- "\\([\81©\8e©]\\|@copyright{}\\|[Cc]opyright\\s *:?\\s *\\(?:(C)\\)?\
-\\|[Cc]opyright\\s *:?\\s *[\81©\8e©]\\)\
+ "\\([\81©\81©]\\|@copyright{}\\|[Cc]opyright\\s *:?\\s *\\(?:(C)\\)?\
+\\|[Cc]opyright\\s *:?\\s *[\81©\81©]\\)\
 \\s *\\([1-9]\\([-0-9, ';/*%#\n\t]\\|\\s<\\|\\s>\\)*[0-9]+\\)"
   "What your copyright notice looks like.
 The second \\( \\) construct must match the years."
   :group 'copyright
   :type 'regexp)
 
+(defcustom copyright-names-regexp ""
+  "Regexp matching the names which correspond to the user.
+Only copyright lines where the name matches this regexp will be updated.
+This allows you to avoid adding yars to a copyright notice belonging to
+someone else or to a group for which you do not work."
+  :type 'regexp)
+
 (defcustom copyright-years-regexp
  "\\(\\s *\\)\\([1-9]\\([-0-9, ';/*%#\n\t]\\|\\s<\\|\\s>\\)*[0-9]+\\)"
   "Match additional copyright notice years.
@@ -83,8 +90,18 @@ When this is `function', only ask when called non-interactively."
   "String representing the current year.")
 
 (defun copyright-update-year (replace noquery)
-  (when (re-search-forward copyright-regexp
-                           (if copyright-limit (+ (point) copyright-limit)) t)
+  (when
+      (condition-case err
+         (re-search-forward (concat "\\(" copyright-regexp
+                                    "\\)\\([ \t]*\n\\)?.*\\(?:"
+                                    copyright-names-regexp "\\)")
+                            (if copyright-limit (+ (point) copyright-limit))
+                            t)
+       ;; In case the regexp is rejected.  This is useful because
+       ;; copyright-update is typically called from before-save-hook where
+       ;; such an error is very inconvenient for the user.
+       (error (message "Can't update copyright: %s" err) nil))
+    (goto-char (match-end 1))
     ;; If the years are continued onto multiple lined
     ;; that are marked as comments, skip to the end of the years anyway.
     (while (save-excursion
@@ -104,7 +121,7 @@ When this is `function', only ask when called non-interactively."
 
     ;; Note that `current-time-string' isn't locale-sensitive.
     (setq copyright-current-year (substring (current-time-string) -4))
-    (unless (string= (buffer-substring (- (match-end 2) 2) (match-end 2))
+    (unless (string= (buffer-substring (- (match-end 3) 2) (match-end 3))
                     (substring copyright-current-year -2))
       (if (or noquery
              (y-or-n-p (if replace
index 68b82d5..acf73d9 100644 (file)
@@ -254,11 +254,7 @@ No problems result if this variable is not bound.
          ,@body
          )
         ;; Run the hooks, if any.
-        ;; Make the generated code work in older Emacs versions
-        ;; that do not yet have run-mode-hooks.
-        (if (fboundp 'run-mode-hooks)
-            (run-mode-hooks ',hook)
-          (run-hooks ',hook))))))
+         (run-mode-hooks ',hook)))))
 
 ;; PUBLIC: find the ultimate class of a derived mode.
 
index 030e1bc..b802d8a 100644 (file)
@@ -152,6 +152,21 @@ A menu item can be a list with the same format as MENU.  This is a submenu."
      ,(if symbol `(defvar ,symbol nil ,doc))
      (easy-menu-do-define (quote ,symbol) ,maps ,doc ,menu)))
 
+(defun easy-menu-binding (menu &optional item-name)
+  "Return a binding suitable to pass to `define-key'.
+This is expected to be bound to a mouse event."
+  ;; Under Emacs this is almost trivial, whereas under XEmacs this may
+  ;; involve defining a function that calls popup-menu.
+  (let ((props (if (symbolp menu)
+                   (prog1 (get menu 'menu-prop)
+                     (setq menu (symbol-function menu))))))
+    (cons 'menu-item
+          (cons (or item-name
+                    (if (keymapp menu)
+                        (keymap-prompt menu))
+                    "")
+                (cons menu props)))))
+
 ;;;###autoload
 (defun easy-menu-do-define (symbol maps doc menu)
   ;; We can't do anything that might differ between Emacs dialects in
@@ -173,15 +188,10 @@ A menu item can be a list with the same format as MENU.  This is a submenu."
                                       'identity)
                                   (symbol-function ,symbol)))
                             ,symbol)))))
-    (mapcar (lambda (map)
-             (define-key map (vector 'menu-bar (easy-menu-intern (car menu)))
-               (cons 'menu-item
-                     (cons (car menu)
-                           (if (not (symbolp keymap))
-                               (list keymap)
-                             (cons (symbol-function keymap)
-                                   (get keymap 'menu-prop)))))))
-           (if (keymapp maps) (list maps) maps))))
+    (dolist (map (if (keymapp maps) (list maps) maps))
+      (define-key map
+        (vector 'menu-bar (easy-menu-intern (car menu)))
+        (easy-menu-binding keymap (car menu))))))
 
 (defun easy-menu-filter-return (menu &optional name)
  "Convert MENU to the right thing to return from a menu filter.
@@ -249,10 +259,6 @@ possibly preceded by keyword pairs as described in `easy-menu-define'."
 (defvar easy-menu-button-prefix
   '((radio . :radio) (toggle . :toggle)))
 
-(defun easy-menu-do-add-item (menu item &optional before)
-  (setq item (easy-menu-convert-item item))
-  (easy-menu-define-key menu (easy-menu-intern (car item)) (cdr item) before))
-
 (defvar easy-menu-converted-items-table (make-hash-table :test 'equal))
 
 (defun easy-menu-convert-item (item)
@@ -269,7 +275,7 @@ would always fail because the key is `equal' but not `eq'."
 (defun easy-menu-convert-item-1 (item)
   "Parse an item description and convert it to a menu keymap element.
 ITEM defines an item as in `easy-menu-define'."
-  (let (name command label prop remove help)
+  (let (name command label prop remove)
     (cond
      ((stringp item)                   ; An item or separator.
       (setq label item))
@@ -536,7 +542,8 @@ earlier by `easy-menu-define' or `easy-menu-create-menu'."
                 (setq item (symbol-value item))))
        ;; Item is a keymap, find the prompt string and use as item name.
        (setq item (cons (keymap-prompt item) item)))
-    (easy-menu-do-add-item map item before)))
+    (setq item (easy-menu-convert-item item))
+    (easy-menu-define-key map (easy-menu-intern (car item)) (cdr item) before)))
 
 (defun easy-menu-item-present-p (map path name)
   "In submenu of MAP with path PATH, return non-nil if item NAME is present.
@@ -615,7 +622,8 @@ In some cases we use that to select between the local and global maps."
        (catch 'found
          (if (and map (symbolp map) (not (keymapp map)))
              (setq map (symbol-value map)))
-         (let ((maps (if map (list map) (current-active-maps))))
+         (let ((maps (if map (if (keymapp map) (list map) map)
+                       (current-active-maps))))
            ;; Look for PATH in each map.
            (unless map (push 'menu-bar path))
            (dolist (name path)
index a39975c..5a52612 100644 (file)
@@ -369,7 +369,7 @@ Return the result of the last expression in BODY."
   ;; Otherwise, find a new window, possibly splitting one.
   (setq window
        (cond
-        ((and (windowp window) (edebug-window-live-p window)
+        ((and (edebug-window-live-p window)
               (eq (window-buffer window) buffer))
          window)
         ((eq (window-buffer (selected-window)) buffer)
@@ -2739,7 +2739,7 @@ MSG is printed after `::::} '."
 
                  ;; Unrestore edebug-buffer's window-start, if displayed.
                  (let ((window (car edebug-window-data)))
-                   (if (and window (edebug-window-live-p window)
+                   (if (and (edebug-window-live-p window)
                             (eq (window-buffer) edebug-buffer))
                        (progn
                          (set-window-start window (cdr edebug-window-data)
index 3876efe..2ff273e 100644 (file)
@@ -124,8 +124,8 @@ directly.  Instead, use `eldoc-add-command' and `eldoc-remove-command'.")
 (defconst eldoc-last-data (make-vector 3 nil)
   "Bookkeeping; elements are as follows:
   0 - contains the last symbol read from the buffer.
-  1 - contains the string last displayed in the echo area for that
-      symbol, so it can be printed again if necessary without reconsing.
+  1 - contains the string last displayed in the echo area for variables,
+      or argument string for functions.
   2 - 'function if function args, 'variable if variable documentation.")
 (defvar eldoc-last-message nil)
 
@@ -249,12 +249,16 @@ Emacs Lisp mode) that support Eldoc.")
             (let* ((current-symbol (eldoc-current-symbol))
                    (current-fnsym  (eldoc-fnsym-in-current-sexp))
                    (doc (cond
-                         ((eq current-symbol current-fnsym)
-                          (or (eldoc-get-fnsym-args-string current-fnsym)
+                         ((null current-fnsym)
+                          nil)
+                         ((eq current-symbol (car current-fnsym))
+                          (or (apply 'eldoc-get-fnsym-args-string
+                                     current-fnsym)
                               (eldoc-get-var-docstring current-symbol)))
                          (t
                           (or (eldoc-get-var-docstring current-symbol)
-                              (eldoc-get-fnsym-args-string current-fnsym))))))
+                              (apply 'eldoc-get-fnsym-args-string
+                                     current-fnsym))))))
               (eldoc-message doc))))
     ;; This is run from post-command-hook or some idle timer thing,
     ;; so we need to be careful that errors aren't ignored.
@@ -263,7 +267,7 @@ Emacs Lisp mode) that support Eldoc.")
 ;; Return a string containing the function parameter list, or 1-line
 ;; docstring if function is a subr and no arglist is obtainable from the
 ;; docstring or elsewhere.
-(defun eldoc-get-fnsym-args-string (sym)
+(defun eldoc-get-fnsym-args-string (sym &optional argument-index)
   (let ((args nil)
         (doc nil))
     (cond ((not (and sym (symbolp sym) (fboundp sym))))
@@ -273,14 +277,53 @@ Emacs Lisp mode) that support Eldoc.")
          ((setq doc (help-split-fundoc (documentation sym t) sym))
           (setq args (car doc))
           (string-match "\\`[^ )]* ?" args)
-          (setq args (concat "(" (substring args (match-end 0)))))
+          (setq args (concat "(" (substring args (match-end 0))))
+          (eldoc-last-data-store sym args 'function))
           (t
            (setq args (eldoc-function-argstring sym))))
-    (cond (args
-           (setq doc (eldoc-docstring-format-sym-doc sym args))
-           (eldoc-last-data-store sym doc 'function)))
+    (and args
+         argument-index
+         (setq doc (eldoc-highlight-function-argument sym args argument-index)))
     doc))
 
+;; Highlight argument INDEX in ARGS list for SYM.
+(defun eldoc-highlight-function-argument (sym args index)
+  (let ((start          nil)
+       (end            0)
+       (argument-face  'bold))
+    ;; Find the current argument in the argument string.  We need to
+    ;; handle `&rest' and informal `...' properly.
+    ;;
+    ;; FIXME: What to do with optional arguments, like in
+    ;;        (defun NAME ARGLIST [DOCSTRING] BODY...) case?
+    ;;        The problem is there is no robust way to determine if
+    ;;        the current argument is indeed a docstring.
+    (while (>= index 1)
+      (if (string-match "[^ ()]+" args end)
+         (progn
+           (setq start (match-beginning 0)
+                 end   (match-end 0))
+           (let ((argument (match-string 0 args)))
+             (cond ((string= argument "&rest")
+                    ;; All the rest arguments are the same.
+                    (setq index 1))
+                   ((string= argument "&optional"))
+                   ((string-match "\\.\\.\\.$" argument)
+                    (setq index 0))
+                   (t
+                    (setq index (1- index))))))
+       (setq end           (length args)
+             start         (1- end)
+             argument-face 'font-lock-warning-face
+             index         0)))
+    (let ((doc args))
+      (when start
+       (setq doc (copy-sequence args))
+       (add-text-properties start end (list 'face argument-face) doc))
+      (setq doc (eldoc-docstring-format-sym-doc
+                sym doc 'font-lock-function-name-face))
+      doc)))
+
 ;; Return a string containing a brief (one-line) documentation string for
 ;; the variable.
 (defun eldoc-get-var-docstring (sym)
@@ -292,7 +335,8 @@ Emacs Lisp mode) that support Eldoc.")
           (let ((doc (documentation-property sym 'variable-documentation t)))
             (cond (doc
                    (setq doc (eldoc-docstring-format-sym-doc
-                              sym (eldoc-docstring-first-line doc)))
+                              sym (eldoc-docstring-first-line doc)
+                              'font-lock-variable-name-face))
                    (eldoc-last-data-store sym doc 'variable)))
             doc)))))
 
@@ -316,7 +360,7 @@ Emacs Lisp mode) that support Eldoc.")
 ;; If the entire line cannot fit in the echo area, the symbol name may be
 ;; truncated or eliminated entirely from the output to make room for the
 ;; description.
-(defun eldoc-docstring-format-sym-doc (sym doc)
+(defun eldoc-docstring-format-sym-doc (sym doc face)
   (save-match-data
     (let* ((name (symbol-name sym))
            (ea-multi eldoc-echo-area-use-multiline-p)
@@ -328,7 +372,7 @@ Emacs Lisp mode) that support Eldoc.")
       (cond ((or (<= strip 0)
                  (eq ea-multi t)
                  (and ea-multi (> (length doc) ea-width)))
-             (format "%s: %s" sym doc))
+             (format "%s: %s" (propertize name 'face face) doc))
             ((> (length doc) ea-width)
              (substring (format "%s" doc) 0 ea-width))
             ((>= strip (length name))
@@ -338,27 +382,44 @@ Emacs Lisp mode) that support Eldoc.")
              ;; than the beginning, since the former is more likely
              ;; to be unique given package namespace conventions.
              (setq name (substring name strip))
-             (format "%s: %s" name doc))))))
+             (format "%s: %s" (propertize name 'face face) doc))))))
 
 \f
+;; Return a list of current function name and argument index.
 (defun eldoc-fnsym-in-current-sexp ()
-  (let ((p (point)))
-    (eldoc-beginning-of-sexp)
-    (prog1
-        ;; Don't do anything if current word is inside a string.
-        (if (= (or (char-after (1- (point))) 0) ?\")
-            nil
-          (eldoc-current-symbol))
-      (goto-char p))))
-
+  (save-excursion
+    (let ((argument-index (1- (eldoc-beginning-of-sexp))))
+      ;; If we are at the beginning of function name, this will be -1.
+      (when (< argument-index 0)
+       (setq argument-index 0))
+      ;; Don't do anything if current word is inside a string.
+      (if (= (or (char-after (1- (point))) 0) ?\")
+         nil
+       (list (eldoc-current-symbol) argument-index)))))
+
+;; Move to the beginnig of current sexp.  Return the number of nested
+;; sexp the point was over or after.
 (defun eldoc-beginning-of-sexp ()
-  (let ((parse-sexp-ignore-comments t))
+  (let ((parse-sexp-ignore-comments t)
+       (num-skipped-sexps 0))
     (condition-case err
-        (while (progn
-                 (forward-sexp -1)
-                 (or (= (char-before) ?\")
-                     (> (point) (point-min)))))
-      (error nil))))
+       (progn
+         ;; First account for the case the point is directly over a
+         ;; beginning of a nested sexp.
+         (condition-case err
+             (let ((p (point)))
+               (forward-sexp -1)
+               (forward-sexp 1)
+               (when (< (point) p)
+                 (setq num-skipped-sexps 1)))
+           (error))
+         (while
+             (let ((p (point)))
+               (forward-sexp -1)
+               (when (< (point) p)
+                 (setq num-skipped-sexps (1+ num-skipped-sexps))))))
+      (error))
+    num-skipped-sexps))
 
 ;; returns nil unless current word is an interned symbol.
 (defun eldoc-current-symbol ()
index d41c0af..6556779 100644 (file)
@@ -56,6 +56,8 @@
        (modify-syntax-entry i "_   " table)
        (setq i (1+ i)))
       (modify-syntax-entry ?\s "    " table)
+      ;; Non-break space acts as whitespace.
+      (modify-syntax-entry ?\x8a0 "    " table)
       (modify-syntax-entry ?\t "    " table)
       (modify-syntax-entry ?\f "    " table)
       (modify-syntax-entry ?\n ">   " table)
index 21175a0..a5cefff 100644 (file)
@@ -103,6 +103,7 @@ Also add the value to the front of the list in the variable `values'."
   (interactive
    (list (read-from-minibuffer "Eval: " nil read-expression-map t
                               'read-expression-history)))
+  (message "Evaluating...")
   (setq values (cons (eval expression) values))
   (let* ((old-show-function temp-buffer-show-function)
         ;; Use this function to display the buffer.
@@ -126,13 +127,16 @@ Also add the value to the front of the list in the variable `values'."
                         (progn
                           (select-window window)
                           (run-hooks 'temp-buffer-show-hook))
-                      (select-window old-selected)))
+                      (select-window old-selected)
+                      (message "Evaluating...done.  \
+See buffer *Pp Eval Output*.")))
                 (message "%s" (buffer-substring (point-min) (point)))
                 ))))))
     (with-output-to-temp-buffer "*Pp Eval Output*"
       (pp (car values))
       (with-current-buffer standard-output
        (emacs-lisp-mode)
+       (setq buffer-read-only nil)
        (set (make-local-variable 'font-lock-verbose) nil)))))
 
 ;;;###autoload
index 45a1e9c..ae15007 100644 (file)
     (|                 . or)           ; SRE
     (not-newline       . ".")
     (nonl              . not-newline)  ; SRE
-    (anything          . ".\\|\n")
+    (anything          . "\\(?:.\\|\n\\)")
     (any               . (rx-any 1 nil rx-check-any)) ; inconsistent with SRE
     (in                        . any)
     (char              . any)          ; sregex
index 9b18bb6..d0ec557 100644 (file)
@@ -898,9 +898,6 @@ If global mark is active, copy from register or one character."
      (t
       ;; Must save register here, since delete may override reg 0.
       (if mark-active
-         ;; Before a yank command, make sure we don't yank
-         ;; the same region that we are going to delete.
-         ;; That would make yank a no-op.
          (if cua--rectangle
              (progn
                (goto-char (min (mark) (point)))
@@ -908,8 +905,16 @@ If global mark is active, copy from register or one character."
                (setq paste-lines (cua--delete-rectangle))
                (if (= paste-lines 1)
                    (setq paste-lines nil))) ;; paste all
-           (if (string= (filter-buffer-substring (point) (mark))
-                        (car kill-ring))
+           ;; Before a yank command, make sure we don't yank the
+           ;; head of the kill-ring that really comes from the
+           ;; currently active region we are going to delete
+           ;; (when last-command is one that uses copy-region-as-kill
+           ;; or kill-new).  That would make yank a no-op.
+           (if (and (string= (filter-buffer-substring (point) (mark))
+                             (car kill-ring))
+                    (memq last-command
+                          '(mouse-set-region mouse-drag-region
+                            mouse-save-then-kill mouse-secondary-save-then-kill)))
                (current-kill 1))
            (cua-delete-region)))
       (cond
index 9220090..8118711 100644 (file)
 
 ;;    ; The emacs universal-argument function is very useful.
 ;;    ; This line maps universal-argument to Gold-PF1.
-;;    (define-key GOLD-SS3-map "P" 'universal-argument)          ; Gold-PF1
+;;    (define-key tpu-gold-map [kp_f1] 'universal-argument)      ; Gold-PF1
 
 ;;    ; Make KP7 move by paragraphs, instead of pages.
-;;    (define-key SS3-map "w" 'tpu-paragraph)                    ; KP7
+;;    (define-key tpu-global-map [kf_7] 'tpu-paragraph)          ; KP7
 
 ;;    ; Repeat the preceding mappings for X-windows.
 ;;    (cond
 ;;     (window-system
-;;      (global-set-key [kp_7] 'tpu-paragraph)                   ; KP7
-;;      (define-key GOLD-map [kp_f1] 'universal-argument)))      ; GOLD-PF1
+;;      (define-key tpu-global-map [kp_7] 'tpu-paragraph)        ; KP7
+;;      (define-key tpu-gold-map [kp_f1] 'universal-argument)))  ; GOLD-PF1
 
 ;;    ; Display the TPU-edt version.
 ;;    (tpu-version)
 ;;;  User Configurable Variables
 ;;;
 (defcustom tpu-have-ispell t
-  "*If non-nil (default), TPU-edt uses ispell for spell checking."
+  "If non-nil (default), TPU-edt uses ispell for spell checking."
   :type 'boolean
   :group 'tpu)
 
 (defcustom tpu-kill-buffers-silently nil
-  "*If non-nil, TPU-edt kills modified buffers without asking."
+  "If non-nil, TPU-edt kills modified buffers without asking."
   :type 'boolean
   :group 'tpu)
 
 (defcustom tpu-percent-scroll 75
-  "*Percentage of the screen to scroll for next/previous screen commands."
+  "Percentage of the screen to scroll for next/previous screen commands."
   :type 'integer
   :group 'tpu)
 
 (defcustom tpu-pan-columns 16
-  "*Number of columns the tpu-pan functions scroll left or right."
+  "Number of columns the tpu-pan functions scroll left or right."
   :type 'integer
   :group 'tpu)
 
 
-;;;
-;;;  Emacs version identifiers - currently referenced by
-;;;
-;;;     o tpu-mark              o tpu-set-mark
-;;;     o mode line section     o tpu-load-xkeys
-;;;
-(defconst tpu-lucid-emacs-p
-  (string-match "Lucid" emacs-version)
-  "Non-nil if we are running Lucid Emacs.")
-
 ;;;
 ;;;  Global Keymaps
 ;;;
-(defvar CSI-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map "A" 'tpu-previous-line)               ; up
-    (define-key map "B" 'tpu-next-line)                   ; down
-    (define-key map "D" 'tpu-backward-char)               ; left
-    (define-key map "C" 'tpu-forward-char)                ; right
-
-    (define-key map "1~" 'tpu-search)                     ; Find
-    (define-key map "2~" 'tpu-paste)                      ; Insert Here
-    (define-key map "3~" 'tpu-cut)                        ; Remove
-    (define-key map "4~" 'tpu-select)                     ; Select
-    (define-key map "5~" 'tpu-scroll-window-down)         ; Prev Screen
-    (define-key map "6~" 'tpu-scroll-window-up)           ; Next Screen
-
-    (define-key map "11~" 'nil)                           ; F1
-    (define-key map "12~" 'nil)                           ; F2
-    (define-key map "13~" 'nil)                           ; F3
-    (define-key map "14~" 'nil)                           ; F4
-    (define-key map "15~" 'nil)                           ; F5
-    (define-key map "17~" 'nil)                           ; F6
-    (define-key map "18~" 'nil)                           ; F7
-    (define-key map "19~" 'nil)                           ; F8
-    (define-key map "20~" 'nil)                           ; F9
-    (define-key map "21~" 'tpu-exit)                      ; F10
-    (define-key map "23~" 'tpu-insert-escape)             ; F11 (ESC)
-    (define-key map "24~" 'tpu-next-beginning-of-line)    ; F12 (BS)
-    (define-key map "25~" 'tpu-delete-previous-word)      ; F13 (LF)
-    (define-key map "26~" 'tpu-toggle-overwrite-mode)     ; F14
-    (define-key map "28~" 'tpu-help)                      ; HELP
-    (define-key map "29~" 'execute-extended-command)      ; DO
-    (define-key map "31~" 'tpu-goto-breadcrumb)           ; F17
-    (define-key map "32~" 'nil)                           ; F18
-    (define-key map "33~" 'nil)                           ; F19
-    (define-key map "34~" 'nil)                           ; F20
-    map)
-  "Maps the CSI function keys on the VT100 keyboard.
-CSI is DEC's name for the sequence <ESC>[.")
 
-(defvar GOLD-CSI-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map "A" 'tpu-move-to-beginning)      ; up-arrow
-    (define-key map "B" 'tpu-move-to-end)            ; down-arrow
-    (define-key map "C" 'end-of-line)                ; right-arrow
-    (define-key map "D" 'beginning-of-line)          ; left-arrow
-
-    (define-key map "1~" 'nil)                       ; Find
-    (define-key map "2~" 'nil)                       ; Insert Here
-    (define-key map "3~" 'tpu-store-text)            ; Remove
-    (define-key map "4~" 'tpu-unselect)              ; Select
-    (define-key map "5~" 'tpu-previous-window)       ; Prev Screen
-    (define-key map "6~" 'tpu-next-window)           ; Next Screen
-
-    (define-key map "11~" 'nil)                      ; F1
-    (define-key map "12~" 'nil)                      ; F2
-    (define-key map "13~" 'nil)                      ; F3
-    (define-key map "14~" 'nil)                      ; F4
-    (define-key map "16~" 'nil)                      ; F5
-    (define-key map "17~" 'nil)                      ; F6
-    (define-key map "18~" 'nil)                      ; F7
-    (define-key map "19~" 'nil)                      ; F8
-    (define-key map "20~" 'nil)                      ; F9
-    (define-key map "21~" 'nil)                      ; F10
-    (define-key map "23~" 'nil)                      ; F11
-    (define-key map "24~" 'nil)                      ; F12
-    (define-key map "25~" 'nil)                      ; F13
-    (define-key map "26~" 'nil)                      ; F14
-    (define-key map "28~" 'describe-bindings)        ; HELP
-    (define-key map "29~" 'nil)                      ; DO
-    (define-key map "31~" 'tpu-drop-breadcrumb)      ; F17
-    (define-key map "32~" 'nil)                      ; F18
-    (define-key map "33~" 'nil)                      ; F19
-    (define-key map "34~" 'nil)                      ; F20
-    map)
-  "Maps the function keys on the VT100 keyboard preceded by GOLD-CSI.")
-
-(defvar GOLD-SS3-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map "A" 'tpu-move-to-beginning)      ; up-arrow
-    (define-key map "B" 'tpu-move-to-end)            ; down-arrow
-    (define-key map "C" 'end-of-line)                ; right-arrow
-    (define-key map "D" 'beginning-of-line)          ; left-arrow
-
-    (define-key map "P" 'keyboard-quit)              ; PF1
-    (define-key map "Q" 'help-for-help)              ; PF2
-    (define-key map "R" 'tpu-search)                 ; PF3
-    (define-key map "S" 'tpu-undelete-lines)         ; PF4
-    (define-key map "p" 'open-line)                  ; KP0
-    (define-key map "q" 'tpu-change-case)            ; KP1
-    (define-key map "r" 'tpu-delete-to-eol)          ; KP2
-    (define-key map "s" 'tpu-special-insert)         ; KP3
-    (define-key map "t" 'tpu-move-to-end)            ; KP4
-    (define-key map "u" 'tpu-move-to-beginning)      ; KP5
-    (define-key map "v" 'tpu-paste)                  ; KP6
-    (define-key map "w" 'execute-extended-command)   ; KP7
-    (define-key map "x" 'tpu-fill)                   ; KP8
-    (define-key map "y" 'tpu-replace)                ; KP9
-    (define-key map "m" 'tpu-undelete-words)         ; KP-
-    (define-key map "l" 'tpu-undelete-char)          ; KP,
-    (define-key map "n" 'tpu-unselect)               ; KP.
-    (define-key map "M" 'tpu-substitute)             ; KPenter
-    map)
-  "Maps the function keys on the VT100 keyboard preceded by GOLD-SS3.")
-
-(defvar GOLD-map
+(defvar tpu-gold-map
   (let ((map (make-keymap)))
-    (define-key map "\e[" GOLD-CSI-map)                  ; GOLD-CSI map
-    (define-key map "\eO" GOLD-SS3-map)                  ; GOLD-SS3 map
+    ;; Previously we used escape sequences here.  We now instead presume
+    ;; that term/*.el does its job to map the escape sequence to the right
+    ;; key-symbol.
+
+    (define-key map [up]    'tpu-move-to-beginning)  ; up-arrow
+    (define-key map [down]  'tpu-move-to-end)        ; down-arrow
+    (define-key map [right] 'end-of-line)            ; right-arrow
+    (define-key map [left]  'beginning-of-line)      ; left-arrow
+
+    (define-key map [find]   'nil)                   ; Find
+    (define-key map [insert] 'nil)                   ; Insert Here
+    (define-key map [delete] 'tpu-store-text)        ; Remove
+    (define-key map [select] 'tpu-unselect)          ; Select
+    (define-key map [prior]  'tpu-previous-window)   ; Prev Screen
+    (define-key map [next]   'tpu-next-window)       ; Next Screen
+
+    (define-key map [f1] 'nil)                       ; F1
+    (define-key map [f2] 'nil)                       ; F2
+    (define-key map [f3] 'nil)                       ; F3
+    (define-key map [f4] 'nil)                       ; F4
+    (define-key map [f5] 'nil)                       ; F5
+    (define-key map [f6] 'nil)                       ; F6
+    (define-key map [f7] 'nil)                       ; F7
+    (define-key map [f8] 'nil)                       ; F8
+    (define-key map [f9] 'nil)                       ; F9
+    (define-key map [f10] 'nil)                      ; F10
+    (define-key map [f11] 'nil)                      ; F11
+    (define-key map [f12] 'nil)                      ; F12
+    (define-key map [f13] 'nil)                      ; F13
+    (define-key map [f14] 'nil)                      ; F14
+    (define-key map [help] 'describe-bindings)       ; HELP
+    (define-key map [menu] 'nil)                     ; DO
+    (define-key map [f17] 'tpu-drop-breadcrumb)      ; F17
+    (define-key map [f18] 'nil)                      ; F18
+    (define-key map [f19] 'nil)                      ; F19
+    (define-key map [f20] 'nil)                      ; F20
+
+    (define-key map [kp-f1] 'keyboard-quit)          ; PF1
+    (define-key map [kp-f2] 'help-for-help)          ; PF2
+    (define-key map [kp-f3] 'tpu-search)             ; PF3
+    (define-key map [kp-f4] 'tpu-undelete-lines)     ; PF4
+    (define-key map [kp-0] 'open-line)               ; KP0
+    (define-key map [kp-1] 'tpu-change-case)         ; KP1
+    (define-key map [kp-2] 'tpu-delete-to-eol)       ; KP2
+    (define-key map [kp-3] 'tpu-special-insert)      ; KP3
+    (define-key map [kp-4] 'tpu-move-to-end)         ; KP4
+    (define-key map [kp-5] 'tpu-move-to-beginning)   ; KP5
+    (define-key map [kp-6] 'tpu-paste)               ; KP6
+    (define-key map [kp-7] 'execute-extended-command) ; KP7
+    (define-key map [kp-8] 'tpu-fill)                ; KP8
+    (define-key map [kp-9] 'tpu-replace)             ; KP9
+    (define-key map [kp-subtract] 'tpu-undelete-words) ; KP-
+    (define-key map [kp-separator] 'tpu-undelete-char) ; KP,
+    (define-key map [kp-decimal] 'tpu-unselect)      ; KP.
+    (define-key map [kp-enter] 'tpu-substitute)      ; KPenter
+
     ;;
     (define-key map "\C-A" 'tpu-toggle-overwrite-mode)   ; ^A
     (define-key map "\C-B" 'nil)                         ; ^B
@@ -553,48 +495,72 @@ CSI is DEC's name for the sequence <ESC>[.")
     map)
   "Maps the function keys on the VT100 keyboard preceded by PF1.
 GOLD is the ASCII 7-bit escape sequence <ESC>OP.")
+(define-obsolete-variable-alias 'GOLD-map 'tpu-gold-map "23.1")
 
-(defvar SS3-map
+(defvar tpu-global-map
   (let ((map (make-sparse-keymap)))
-    (define-key map "P" GOLD-map)                         ; GOLD map
+
+    ;; Previously defined in CSI-map.  We now presume that term/*.el does
+    ;; its job to map the escape sequence to the right key-symbol.
+    (define-key map [find]   'tpu-search)                 ; Find
+    (define-key map [insert] 'tpu-paste)                  ; Insert Here
+    (define-key map [delete] 'tpu-cut)                    ; Remove
+    (define-key map [select] 'tpu-select)                 ; Select
+    (define-key map [prior]  'tpu-scroll-window-down)     ; Prev Screen
+    (define-key map [next]   'tpu-scroll-window-up)       ; Next Screen
+
+    (define-key map [f1] 'nil)                            ; F1
+    (define-key map [f2] 'nil)                            ; F2
+    (define-key map [f3] 'nil)                            ; F3
+    (define-key map [f4] 'nil)                            ; F4
+    (define-key map [f5] 'nil)                            ; F5
+    (define-key map [f6] 'nil)                            ; F6
+    (define-key map [f7] 'nil)                            ; F7
+    (define-key map [f8] 'nil)                            ; F8
+    (define-key map [f9] 'nil)                            ; F9
+    (define-key map [f10] 'tpu-exit)                      ; F10
+    (define-key map [f11] 'tpu-insert-escape)             ; F11 (ESC)
+    (define-key map [f12] 'tpu-next-beginning-of-line)    ; F12 (BS)
+    (define-key map [f13] 'tpu-delete-previous-word)      ; F13 (LF)
+    (define-key map [f14] 'tpu-toggle-overwrite-mode)     ; F14
+    (define-key map [help] 'tpu-help)                     ; HELP
+    (define-key map [menu] 'execute-extended-command)     ; DO
+    (define-key map [f17] 'tpu-goto-breadcrumb)           ; F17
+    (define-key map [f18] 'nil)                           ; F18
+    (define-key map [f19] 'nil)                           ; F19
+    (define-key map [f20] 'nil)                           ; F20
+
+
+    ;; Previously defined in SS3-map.  We now presume that term/*.el does
+    ;; its job to map the escape sequence to the right key-symbol.
+    (define-key map [kp-f1] tpu-gold-map)                 ; GOLD map
     ;;
-    (define-key map "A" 'tpu-previous-line)               ; up
-    (define-key map "B" 'tpu-next-line)                   ; down
-    (define-key map "C" 'tpu-forward-char)                ; right
-    (define-key map "D" 'tpu-backward-char)               ; left
-
-    (define-key map "Q" 'tpu-help)                        ; PF2
-    (define-key map "R" 'tpu-search-again)                ; PF3
-    (define-key map "S" 'tpu-delete-current-line)         ; PF4
-    (define-key map "p" 'tpu-line)                        ; KP0
-    (define-key map "q" 'tpu-word)                        ; KP1
-    (define-key map "r" 'tpu-end-of-line)                 ; KP2
-    (define-key map "s" 'tpu-char)                        ; KP3
-    (define-key map "t" 'tpu-advance-direction)           ; KP4
-    (define-key map "u" 'tpu-backup-direction)            ; KP5
-    (define-key map "v" 'tpu-cut)                         ; KP6
-    (define-key map "w" 'tpu-page)                        ; KP7
-    (define-key map "x" 'tpu-scroll-window)               ; KP8
-    (define-key map "y" 'tpu-append-region)               ; KP9
-    (define-key map "m" 'tpu-delete-current-word)         ; KP-
-    (define-key map "l" 'tpu-delete-current-char)         ; KP,
-    (define-key map "n" 'tpu-select)                      ; KP.
-    (define-key map "M" 'newline)                         ; KPenter
-    map)
-  "Maps the SS3 function keys on the VT100 keyboard.
-SS3 is DEC's name for the sequence <ESC>O.")
+    (define-key map [up]    'tpu-previous-line)           ; up
+    (define-key map [down]  'tpu-next-line)               ; down
+    (define-key map [right] 'tpu-forward-char)            ; right
+    (define-key map [left]  'tpu-backward-char)           ; left
+
+    (define-key map [kp-f2] 'tpu-help)                    ; PF2
+    (define-key map [kp-f3] 'tpu-search-again)            ; PF3
+    (define-key map [kp-f4] 'tpu-delete-current-line)     ; PF4
+    (define-key map [kp-0] 'tpu-line)                     ; KP0
+    (define-key map [kp-1] 'tpu-word)                     ; KP1
+    (define-key map [kp-2] 'tpu-end-of-line)              ; KP2
+    (define-key map [kp-3] 'tpu-char)                     ; KP3
+    (define-key map [kp-4] 'tpu-advance-direction)        ; KP4
+    (define-key map [kp-5] 'tpu-backup-direction)         ; KP5
+    (define-key map [kp-6] 'tpu-cut)                      ; KP6
+    (define-key map [kp-7] 'tpu-page)                     ; KP7
+    (define-key map [kp-8] 'tpu-scroll-window)            ; KP8
+    (define-key map [kp-9] 'tpu-append-region)            ; KP9
+    (define-key map [kp-subtract] 'tpu-delete-current-word) ; KP-
+    (define-key map [kp-separator] 'tpu-delete-current-char) ; KP,
+    (define-key map [kp-decimal] 'tpu-select)             ; KP.
+    (define-key map [kp-enter] 'newline)                  ; KPenter
 
-(defvar tpu-global-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map "\e[" CSI-map)
-    (define-key map "\eO" SS3-map)
     map)
   "TPU-edt global keymap.")
 
-(and (not (boundp 'minibuffer-local-ns-map))
-     (defvar minibuffer-local-ns-map (make-sparse-keymap)
-       "Hack to give Lucid Emacs the same maps as ordinary Emacs."))
-
 
 ;;;
 ;;;  Global Variables
@@ -697,7 +663,7 @@ SS3 is DEC's name for the sequence <ESC>O.")
   (setq tpu-mark-flag (if transient-mark-mode "" (if (tpu-mark) " @" "  ")))
   (force-mode-line-update))
 
-(cond (tpu-lucid-emacs-p
+(cond ((featurep 'xemacs)
        (add-hook 'zmacs-deactivate-region-hook 'tpu-update-mode-line)
        (add-hook 'zmacs-activate-region-hook 'tpu-update-mode-line))
       (t
@@ -778,7 +744,7 @@ Otherwise sets the tpu-match markers to nil and returns nil."
   "TPU-edt version of the mark function.
 Return the appropriate value of the mark for the current
 version of Emacs."
-  (cond (tpu-lucid-emacs-p (mark (not zmacs-regions)))
+  (cond ((featurep 'xemacs) (mark (not zmacs-regions)))
        (t (and mark-active (mark (not transient-mark-mode))))))
 
 (defun tpu-set-mark (pos)
@@ -2362,7 +2328,7 @@ If FILE is nil, try to load a default file.  The default file names are
         (setq file (expand-file-name file)))
        (tpu-xkeys-file
         (setq file (expand-file-name tpu-xkeys-file)))
-       (tpu-lucid-emacs-p
+       ((featurep 'xemacs)
         (setq file (convert-standard-filename
                     (expand-file-name "~/.tpu-lucid-keys"))))
        (t
@@ -2378,34 +2344,11 @@ If FILE is nil, try to load a default file.  The default file names are
   (cond ((file-readable-p file)
         (load-file file))
        (t
-        (switch-to-buffer "*scratch*")
-        (erase-buffer)
-        (insert "
-
-     Ack!!  You're running TPU-edt under X-windows without loading an
-     X  key definition file.   To create a  TPU-edt X  key definition
-     file, run the tpu-mapper.el program.  It  came with TPU-edt.  It
-     even includes directions on how to  use it!   Perhaps it's lying
-     around here someplace.  ")
-        (let ((file "tpu-mapper.el")
-              (found nil)
-              (path nil)
-              (search-list (append (list (expand-file-name ".")) load-path)))
-          (while (and (not found) search-list)
-            (setq path (concat (car search-list)
-                               (if (string-match "/$" (car search-list)) "" "/")
-                               file))
-            (if (and (file-exists-p path) (not (file-directory-p path)))
-                (setq found t))
-            (setq search-list (cdr search-list)))
-          (cond (found
-                 (insert (format
-                          "Ah yes, there it is, in \n\n       %s \n\n" path))
-                 (if (tpu-y-or-n-p "Do you want to run it now? ")
-                     (load-file path)))
-                (t
-                 (insert "Nope, I can't seem to find it.  :-(\n\n")
-                 (sit-for 120)))))))
+         ;; FIXME: This used to force the user to build `file'.  With the
+         ;; new code, such a file is not even necessary, but we'll keep
+         ;; a warning message.
+         (message "%s not found: use tpu-mapper.el to create it"
+                  (abbreviate-file-name file)))))
 
 (defun tpu-copy-keyfile (oldname newname)
   "Copy the TPU-edt X key definitions file to the new default name."
index 7f84396..3e5af7a 100644 (file)
   (setq tpu-key (concat "[" (format "%s" tpu-key-seq) "]"))
   (cond ((not (equal tpu-key tpu-return))
         (set-buffer "Keys")
-        (insert (format"(global-set-key %s %s)\n" tpu-key func))
+        (insert (format"(define-key tpu-global-map %s %s)\n" tpu-key func))
         (set-buffer "Gold-Keys")
-        (insert (format "(define-key GOLD-map %s %s)\n" tpu-key gold-func))
+        (insert (format "(define-key tpu-gold-map %s %s)\n" tpu-key gold-func))
         (set-buffer "Directions"))
        ;; bogosity to get next prompt to come up, if the user hits <CR>!
        ;; check periodically to see if this is still needed...
 ")
 (goto-char (point-min))
 
-;;; arch-tag: bab5872f-cd3a-4c1c-aedb-047b67646f6c
+;; arch-tag: bab5872f-cd3a-4c1c-aedb-047b67646f6c
 ;;; tpu-mapper.el ends here
index 9c1ccf3..8dd22e9 100644 (file)
 ;; define viper-charpair-command-p
 (viper-test-com-defun viper-charpair-command)
 
-(defconst viper-movement-commands '(?b ?B ?e ?E ?f ?F ?G ?h ?H ?j ?k ?l
+(defconst viper-movement-commands '(?b ?B ?e ?E ?f ?F ?G ?h ?j ?k ?l
                                     ?H ?M ?L ?n ?t ?T ?w ?W ?$ ?%
                                     ?^ ?( ?) ?- ?+ ?| ?{ ?} ?[ ?] ?' ?`
                                     ?\; ?, ?0 ?? ?/ ?\  ?\C-m
@@ -1321,10 +1321,10 @@ as a Meta key and any number of multiple escapes is allowed."
          (setq last-command-event
                (viper-copy-event
                 (if viper-xemacs-p (character-to-event char) char)))
-         (condition-case nil
+         (condition-case err
              (funcall cmd-to-exec-at-end cmd-info)
            (error
-            (error "")))))
+            (error "%s" (error-message-string err))))))
     ))
 
 (defun viper-describe-arg (arg)
@@ -1902,7 +1902,7 @@ With prefix argument, find next destructive command."
        (setq viper-intermediate-command
              'repeating-display-destructive-command)
       ;; first search through command history--set temp ring
-      (setq viper-temp-command-ring (copy-list viper-command-ring)))
+      (setq viper-temp-command-ring (copy-sequence viper-command-ring)))
     (setq cmd (if next
                  (viper-special-ring-rotate1 viper-temp-command-ring 1)
                (viper-special-ring-rotate1 viper-temp-command-ring -1)))
@@ -1936,7 +1936,7 @@ to in the global map, instead of cycling through the insertion ring."
                 (length viper-last-inserted-string-from-insertion-ring))))
          )
       ;;first search through insertion history
-      (setq viper-temp-insertion-ring (copy-list viper-insertion-ring)))
+      (setq viper-temp-insertion-ring (copy-sequence viper-insertion-ring)))
     (setq this-command 'viper-insert-from-insertion-ring)
     ;; so that things will be undone properly
     (setq buffer-undo-list (cons nil buffer-undo-list))
index dc68177..2b0e886 100644 (file)
   :tag "Is it VMS?"
   :group 'viper-misc)
 
+(defcustom viper-suppress-input-method-change-message nil
+  "If t, the message notifying about changes in the input method is not displayed.
+Normally, a message is displayed each time on enters the vi, insert or replace
+state."
+  :type 'boolean
+  :group 'viper-misc)
+
 (defcustom viper-force-faces nil
   "If t, Viper will think that it is running on a display that supports faces.
 This is provided as a temporary relief for users of graphics-capable terminals
@@ -326,7 +333,8 @@ Use `M-x viper-set-expert-level' to change this.")
     ;; turn off special input methods in vi-state
     (if (eq viper-current-state 'vi-state)
        (viper-set-input-method nil))
-    (if (memq viper-current-state '(vi-state insert-state replace-state))
+    (if (and (memq viper-current-state '(vi-state insert-state replace-state))
+            (not viper-suppress-input-method-change-message))
        (message "Viper special input method%s: on"
                 (if (or current-input-method default-input-method)
                     (format " %S"
@@ -339,7 +347,8 @@ Use `M-x viper-set-expert-level' to change this.")
   (if (null viper-mule-hook-flag)
       ()
     (setq viper-special-input-method nil)
-    (if (memq viper-current-state '(vi-state insert-state replace-state))
+    (if (and (memq viper-current-state '(vi-state insert-state replace-state))
+            (not viper-suppress-input-method-change-message))
        (message "Viper special input method%s: off"
                 (if (or current-input-method default-input-method)
                     (format " %S"
@@ -369,7 +378,7 @@ Use `M-x viper-set-expert-level' to change this.")
 ;; Set quail-mode to ARG
 (defun viper-set-input-method (arg)
   (setq viper-mule-hook-flag t) ; just a precaution
-  (let (viper-mule-hook-flag) ; temporarily inactivate viper mule hooks
+  (let (viper-mule-hook-flag) ; temporarily deactivate viper mule hooks
     (cond ((and arg (> (prefix-numeric-value arg) 0) default-input-method)
           ;; activate input method
           (viper-activate-input-method))
index 086605d..ac7231a 100644 (file)
@@ -339,8 +339,8 @@ If running in a terminal, [(escape)] is not understood, so must use \"\\e\"."
 (define-key viper-vi-basic-map "\C-m" 'viper-next-line-at-bol)
 (define-key viper-vi-basic-map "\C-u" 'viper-scroll-down)
 (define-key viper-vi-basic-map "\C-y" 'viper-scroll-down-one)
-(define-key viper-vi-basic-map "\C-s" 'viper-isearch-forward)
-(define-key viper-vi-basic-map "\C-r" 'viper-isearch-backward)
+;;(define-key viper-vi-basic-map "\C-s" 'viper-isearch-forward)
+;;(define-key viper-vi-basic-map "\C-r" 'viper-isearch-backward)
 (define-key viper-vi-basic-map "\C-c/" 'viper-toggle-search-style)
 (define-key viper-vi-basic-map "\C-c\C-g" 'viper-info-on-file)
 
index 82e9025..eebf09a 100644 (file)
 
 (defun viper-set-cursor-color-according-to-state (&optional frame)
   (cond ((eq viper-current-state 'replace-state)
-        (viper-change-cursor-color viper-replace-state-cursor-color frame))
+        (viper-change-cursor-color viper-replace-overlay-cursor-color frame))
        ((and (eq viper-current-state 'emacs-state)
              viper-emacs-state-cursor-color)
         (viper-change-cursor-color viper-emacs-state-cursor-color frame))
 ;; Sit for VAL milliseconds.  XEmacs doesn't support the millisecond arg
 ;; in sit-for, so this function smoothes out the differences.
 (defsubst viper-sit-for-short (val &optional nodisp)
-  (if viper-xemacs-p
-      (sit-for (/ val 1000.0) nodisp)
-    (sit-for 0 val nodisp)))
+  (sit-for (/ val 1000.0) nodisp))
 
 ;; EVENT may be a single event of a sequence of events
 (defsubst viper-ESC-event-p (event)
index d03e85d..63cafb4 100644 (file)
@@ -9,7 +9,7 @@
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;; Keywords: emulations
 
-(defconst viper-version "3.13.1 of October 23, 2006"
+(defconst viper-version "3.14 of June 14, 2007"
   "The current version of Viper")
 
 ;; This file is part of GNU Emacs.
 ;;; Code:
 
 (require 'advice)
-(require 'cl)
 (require 'ring)
 
 ;; compiler pacifier
@@ -457,6 +456,7 @@ unless it is coming up in a wrong Viper state."
 (defcustom viper-insert-state-mode-list
   '(internal-ange-ftp-mode
     comint-mode
+    gud-mode
     inferior-emacs-lisp-mode
     erc-mode
     eshell-mode
@@ -481,6 +481,7 @@ unless it is coming up in a wrong Viper state."
   '((help-mode emacs-state viper-slash-and-colon-map)
     (comint-mode insert-state viper-comint-mode-modifier-map)
     (comint-mode vi-state viper-comint-mode-modifier-map)
+    (gud-mode insert-state viper-comint-mode-modifier-map)
     (shell-mode insert-state viper-comint-mode-modifier-map)
     (inferior-emacs-lisp-mode insert-state viper-comint-mode-modifier-map)
     (shell-mode vi-state viper-comint-mode-modifier-map)
@@ -1025,48 +1026,63 @@ It also can't undo some Viper settings."
       (setq global-mode-string
            (append '("" viper-mode-string) (cdr global-mode-string))))
 
-  (defadvice describe-key (before viper-describe-key-ad protect activate)
-    "Force to read key via `viper-read-key-sequence'."
-    (interactive (let (key)
-                  (setq key (viper-read-key-sequence
-                             "Describe key (or click or menu item): "))
-                  (list key
-                        (prefix-numeric-value current-prefix-arg)
-                        ;; If KEY is a down-event, read also the
-                        ;; corresponding up-event.
-                        (and (vectorp key)
-                             (let ((last-idx (1- (length key))))
-                               (and (eventp (aref key last-idx))
-                                    (memq 'down (event-modifiers
-                                                 (aref key last-idx)))))
-                             (or (and (eventp (aref key 0))
-                                      (memq 'down (event-modifiers
-                                                   (aref key 0)))
-                                      ;; For the C-down-mouse-2 popup
-                                      ;; menu, there is no subsequent up-event.
-                                      (= (length key) 1))
-                                 (and (> (length key) 1)
-                                      (eventp (aref key 1))
-                                      (memq 'down (event-modifiers (aref key 1)))))
-                             (read-event))))))
-
-  (defadvice describe-key-briefly
-    (before viper-describe-key-briefly-ad protect activate)
-    "Force to read key via `viper-read-key-sequence'."
-    (interactive (let (key)
-                  (setq key (viper-read-key-sequence
-                             "Describe key (or click or menu item): "))
-                  ;; If KEY is a down-event, read and discard the
-                  ;; corresponding up-event.
-                  (and (vectorp key)
-                       (let ((last-idx (1- (length key))))
-                         (and (eventp (aref key last-idx))
-                              (memq 'down (event-modifiers (aref key last-idx)))))
-                       (read-event))
-                  (list key
-                        (if current-prefix-arg
-                            (prefix-numeric-value current-prefix-arg))
-                        1))))
+  (viper-cond-compile-for-xemacs-or-emacs
+   ;; XEmacs
+   (defadvice describe-key (before viper-describe-key-ad protect activate)
+     "Force to read key via `viper-read-key-sequence'."
+     (interactive (list (viper-read-key-sequence "Describe key: "))))
+   ;; Emacs
+   (defadvice describe-key (before viper-describe-key-ad protect activate)
+     "Force to read key via `viper-read-key-sequence'."
+     (interactive (let (key)
+                   (setq key (viper-read-key-sequence
+                              "Describe key (or click or menu item): "))
+                   (list key
+                         (prefix-numeric-value current-prefix-arg)
+                         ;; If KEY is a down-event, read also the
+                         ;; corresponding up-event.
+                         (and (vectorp key)
+                              (let ((last-idx (1- (length key))))
+                                (and (eventp (aref key last-idx))
+                                     (memq 'down (event-modifiers
+                                                  (aref key last-idx)))))
+                              (or (and (eventp (aref key 0))
+                                       (memq 'down (event-modifiers
+                                                    (aref key 0)))
+                                       ;; For the C-down-mouse-2 popup menu,
+                                       ;; there is no subsequent up-event
+                                       (= (length key) 1))
+                                  (and (> (length key) 1)
+                                       (eventp (aref key 1))
+                                       (memq 'down (event-modifiers (aref key 1)))))
+                              (read-event))))))
+   ) ; viper-cond-compile-for-xemacs-or-emacs
+
+  (viper-cond-compile-for-xemacs-or-emacs
+   ;; XEmacs
+   (defadvice describe-key-briefly
+     (before viper-describe-key-briefly-ad protect activate)
+     "Force to read key via `viper-read-key-sequence'."
+     (interactive (list (viper-read-key-sequence "Describe key briefly: "))))
+   ;; Emacs
+   (defadvice describe-key-briefly
+     (before viper-describe-key-briefly-ad protect activate)
+     "Force to read key via `viper-read-key-sequence'."
+     (interactive (let (key)
+                   (setq key (viper-read-key-sequence
+                              "Describe key (or click or menu item): "))
+                   ;; If KEY is a down-event, read and discard the
+                   ;; corresponding up-event.
+                   (and (vectorp key)
+                        (let ((last-idx (1- (length key))))
+                          (and (eventp (aref key last-idx))
+                               (memq 'down (event-modifiers (aref key last-idx)))))
+                        (read-event))
+                   (list key
+                         (if current-prefix-arg
+                             (prefix-numeric-value current-prefix-arg))
+                         1))))
+   ) ;; viper-cond-compile-for-xemacs-or-emacs
 
   (defadvice find-file (before viper-add-suffix-advice activate)
     "Use `read-file-name' for reading arguments."
index d72d472..43f4c23 100644 (file)
 
        * Relicense all FSF files to GPLv3 or later.
 
-2007-06-07  Juanma Barranquero  <lekktu@gmail.com>
+2007-06-14  Juanma Barranquero  <lekktu@gmail.com>
 
-       * erc.el (erc-startup-file-list): Fix typo in docstring.
+       * erc-goodies.el (erc-scroll-to-bottom): Remove redundant check.
 
 2007-06-06  Juanma Barranquero  <lekktu@gmail.com>
 
-       * erc.el (erc-show-channel-key-p): Fix typo in docstring.
+       * erc.el (erc-show-channel-key-p, erc-startup-file-list):
+       Fix typo in docstring.
 
 2007-04-01  Michael Olson  <mwolson@gnu.org>
 
index 7d995eb..49a0451 100644 (file)
@@ -77,7 +77,7 @@ You can control which line is recentered to by customizing the
 variable `erc-input-line-position'.
 
 DISPLAY-START is ignored."
-  (if (and window (window-live-p window))
+  (if (window-live-p window)
       ;; Temporarily bind resize-mini-windows to nil so that users who have it
       ;; set to a non-nil value will not suffer from premature minibuffer
       ;; shrinkage due to the below recenter call.  I have no idea why this
index daf5f39..2369245 100644 (file)
@@ -222,11 +222,12 @@ Value is FACE."
 
 (defun face-id (face &optional frame)
   "Return the internal ID of face with name FACE.
+If FACE is a face-alias, return the ID of the target face.
 The optional argument FRAME is ignored, since the internal face ID
 of a face name is the same for all frames."
   (check-face face)
-  (get face 'face))
-
+  (or (get face 'face)
+      (face-id (get face 'face-alias))))
 
 (defun face-equal (face1 face2 &optional frame)
   "Non-nil if faces FACE1 and FACE2 are equal.
index e9ef3e1..80b94a4 100644 (file)
@@ -1793,7 +1793,11 @@ ffap most of the time."
   ;; Extra complication for the temporary highlighting.
   (unwind-protect
       (ffap-read-file-or-url
-       (if ffap-url-regexp "Dired file or URL: " "Dired file: ")
+       (cond
+       ((eq ffap-directory-finder 'list-directory)
+        "List directory (brief): ")
+       (ffap-url-regexp "Dired file or URL: ")
+       (t "Dired file: "))
        (prog1
           (setq guess (or guess
                            (let ((guess (ffap-guesser)))
index 8ade456..94a8c38 100644 (file)
@@ -711,6 +711,28 @@ PATH-AND-SUFFIXES is a pair of lists, (DIRECTORIES . SUFFIXES)."
        ((null action) (try-completion string names))
        (t (test-completion string names))))))
 
+(defun locate-dominating-file (file regexp)
+  "Look up the directory hierarchy from FILE for a file matching REGEXP."
+  (while (and file (not (file-directory-p file)))
+    (setq file (file-name-directory (directory-file-name file))))
+  (catch 'found
+    (let ((user (nth 2 (file-attributes file)))
+          ;; Abbreviate, so as to stop when we cross ~/.
+          (dir (abbreviate-file-name (file-name-as-directory file)))
+          files)
+      ;; As a heuristic, we stop looking up the hierarchy of directories as
+      ;; soon as we find a directory belonging to another user.  This should
+      ;; save us from looking in things like /net and /afs.  This assumes
+      ;; that all the files inside a project belong to the same user.
+      (while (and dir (equal user (nth 2 (file-attributes dir))))
+        (if (setq files (directory-files dir 'full regexp))
+            (throw 'found (car files))
+          (if (equal dir
+                     (setq dir (file-name-directory
+                                (directory-file-name dir))))
+              (setq dir nil))))
+      nil)))
+
 (defun executable-find (command)
   "Search for COMMAND in `exec-path' and return the absolute file name.
 Return nil if COMMAND is not found anywhere in `exec-path'."
@@ -727,17 +749,28 @@ This is an interface to the function `load'."
                          (cons load-path (get-load-suffixes)))))
   (load library))
 
-(defun file-remote-p (file)
+(defun file-remote-p (file &optional identification connected)
   "Test whether FILE specifies a location on a remote system.
 Return an identification of the system if the location is indeed
 remote.  The identification of the system may comprise a method
 to access the system and its hostname, amongst other things.
 
 For example, the filename \"/user@host:/foo\" specifies a location
-on the system \"/user@host:\"."
+on the system \"/user@host:\".
+
+IDENTIFICATION specifies which part of the identification shall
+be returned as string.  IDENTIFICATION can be the symbol
+`method', `user' or `host'; any other value is handled like nil
+and means to return the complete identification string.
+
+If CONNECTED is non-nil, the function returns an identification only
+if FILE is located on a remote system, and a connection is established
+to that remote system.
+
+`file-remote-p' will never open a connection on its own."
   (let ((handler (find-file-name-handler file 'file-remote-p)))
     (if handler
-       (funcall handler 'file-remote-p file)
+       (funcall handler 'file-remote-p file identification connected)
       nil)))
 
 (defun file-local-copy (file)
@@ -1051,6 +1084,12 @@ Recursive uses of the minibuffer will not be affected."
             ,@body)
         (remove-hook 'minibuffer-setup-hook ,hook)))))
 
+(defcustom find-file-confirm-nonexistent-file nil
+  "If non-nil, `find-file' requires confirmation before visiting a new file."
+  :group 'find-file
+  :version "23.1"
+  :type 'boolean)
+
 (defun find-file-read-args (prompt mustmatch)
   (list (let ((find-file-default
               (and buffer-file-name
@@ -1074,7 +1113,9 @@ suppress wildcard expansion by setting `find-file-wildcards' to nil.
 
 To visit a file without any kind of conversion and without
 automatically choosing a major mode, use \\[find-file-literally]."
-  (interactive (find-file-read-args "Find file: " nil))
+  (interactive
+   (find-file-read-args "Find file: "
+                        (if find-file-confirm-nonexistent-file 'confirm-only)))
   (let ((value (find-file-noselect filename nil nil wildcards)))
     (if (listp value)
        (mapcar 'switch-to-buffer (nreverse value))
@@ -1091,7 +1132,9 @@ type M-n to pull it into the minibuffer.
 
 Interactively, or if WILDCARDS is non-nil in a call from Lisp,
 expand wildcards (if any) and visit multiple files."
-  (interactive (find-file-read-args "Find file in other window: " nil))
+  (interactive
+   (find-file-read-args "Find file in other window: "
+                        (if find-file-confirm-nonexistent-file 'confirm-only)))
   (let ((value (find-file-noselect filename nil nil wildcards)))
     (if (listp value)
        (progn
@@ -1111,7 +1154,9 @@ type M-n to pull it into the minibuffer.
 
 Interactively, or if WILDCARDS is non-nil in a call from Lisp,
 expand wildcards (if any) and visit multiple files."
-  (interactive (find-file-read-args "Find file in other frame: " nil))
+  (interactive
+   (find-file-read-args "Find file in other frame: "
+                        (if find-file-confirm-nonexistent-file 'confirm-only)))
   (let ((value (find-file-noselect filename nil nil wildcards)))
     (if (listp value)
        (progn
@@ -1134,7 +1179,9 @@ file names with wildcards."
   "Edit file FILENAME but don't allow changes.
 Like \\[find-file] but marks buffer as read-only.
 Use \\[toggle-read-only] to permit editing."
-  (interactive (find-file-read-args "Find file read-only: " nil))
+  (interactive
+   (find-file-read-args "Find file read-only: "
+                        (if find-file-confirm-nonexistent-file 'confirm-only)))
   (unless (or (and wildcards find-file-wildcards
                   (not (string-match "\\`/:" filename))
                   (string-match "[[*?]" filename))
@@ -1149,7 +1196,9 @@ Use \\[toggle-read-only] to permit editing."
   "Edit file FILENAME in another window but don't allow changes.
 Like \\[find-file-other-window] but marks buffer as read-only.
 Use \\[toggle-read-only] to permit editing."
-  (interactive (find-file-read-args "Find file read-only other window: " nil))
+  (interactive
+   (find-file-read-args "Find file read-only other window: "
+                        (if find-file-confirm-nonexistent-file 'confirm-only)))
   (unless (or (and wildcards find-file-wildcards
                   (not (string-match "\\`/:" filename))
                   (string-match "[[*?]" filename))
@@ -1164,7 +1213,9 @@ Use \\[toggle-read-only] to permit editing."
   "Edit file FILENAME in another frame but don't allow changes.
 Like \\[find-file-other-frame] but marks buffer as read-only.
 Use \\[toggle-read-only] to permit editing."
-  (interactive (find-file-read-args "Find file read-only other frame: " nil))
+  (interactive
+   (find-file-read-args "Find file read-only other frame: "
+                        (if find-file-confirm-nonexistent-file 'confirm-only)))
   (unless (or (and wildcards find-file-wildcards
                   (not (string-match "\\`/:" filename))
                   (string-match "[[*?]" filename))
@@ -2440,6 +2491,7 @@ asking you for confirmation."
        mode-line-mule-info
        mode-line-position
        mode-line-process
+       mode-line-remote
        mode-name
        outline-level
        overriding-local-map
@@ -4027,6 +4079,8 @@ or multiple mail buffers, etc."
 
 (defun make-directory (dir &optional parents)
   "Create the directory DIR and any nonexistent parent dirs.
+If DIR already exists as a directory, do nothing.
+
 Interactively, the default choice of directory to create
 is the current default directory for file names.
 That is useful when you have visited a file in a nonexistent directory.
@@ -4398,6 +4452,14 @@ This command is used in the special Dired buffer created by
            (message "No files can be recovered from this session now")))
       (kill-buffer buffer))))
 
+(defun kill-buffer-ask (buffer)
+  "Kill buffer if confirmed."
+  (when (yes-or-no-p
+         (format "Buffer %s %s.  Kill? " (buffer-name buffer)
+                 (if (buffer-modified-p buffer)
+                     "HAS BEEN EDITED" "is unmodified")))
+    (kill-buffer buffer)))
+
 (defun kill-some-buffers (&optional list)
   "Kill some buffers.  Asks the user whether to kill each one of them.
 Non-interactively, if optional argument LIST is non-nil, it
@@ -4412,13 +4474,20 @@ specifies the list of buffers to kill, asking for approval for each one."
                                        ; if we killed the base buffer.
           (not (string-equal name ""))
           (/= (aref name 0) ?\s)
-          (yes-or-no-p
-           (format "Buffer %s %s.  Kill? "
-                   name
-                   (if (buffer-modified-p buffer)
-                       "HAS BEEN EDITED" "is unmodified")))
-          (kill-buffer buffer)))
+          (kill-buffer-ask buffer)))
     (setq list (cdr list))))
+
+(defun kill-matching-buffers (regexp &optional internal-too)
+  "Kill buffers whose name matches the specified regexp.
+The optional second argument indicates whether to kill internal buffers too."
+  (interactive "sKill buffers matching this regular expression: \nP")
+  (dolist (buffer (buffer-list))
+    (let ((name (buffer-name buffer)))
+      (when (and name (not (string-equal name ""))
+                 (or internal-too (/= (aref name 0) ?\s))
+                 (string-match regexp name))
+        (kill-buffer-ask buffer)))))
+
 \f
 (defun auto-save-mode (arg)
   "Toggle auto-saving of contents of current buffer.
index 5554e26..ae605e6 100644 (file)
@@ -354,7 +354,7 @@ See `add-submenu' for documentation."
 (defcustom filesets-menu-cache-file
   (if filesets-running-xemacs
       "~/.xemacs/filesets-cache.el"
-      "~/.emacs.d/filesets-cache.el")
+    (concat user-emacs-directory "filesets-cache.el"))
   "*File to be used for saving the filesets menu between sessions.
 Set this to \"\", to disable caching of menus.
 Don't forget to check out `filesets-menu-ensure-use-cached'."
index 598db2e..87663fa 100644 (file)
@@ -336,123 +336,45 @@ After that, changing the prefix key requires manipulating keymaps."
     ;; the look and feel of Follow mode.)
     (define-key mainmap [remap end-of-buffer] 'follow-end-of-buffer)
 
-    ;;
-    ;; The menu.
-    ;;
-
-    (if (not (featurep 'xemacs))
-
-       ;;
-       ;; Emacs
-       ;;
-       (let ((menumap (funcall (symbol-function 'make-sparse-keymap)
-                                "Follow"))
-             (count 0)
-             id)
-         (mapcar
-          (function
-           (lambda (item)
-             (setq id
-                   (or (cdr item)
-                       (progn
-                         (setq count (+ count 1))
-                         (intern (format "separator-%d" count)))))
-             (define-key menumap (vector id) item)
-             (or (eq id 'follow-mode)
-                 (put id 'menu-enable 'follow-mode))))
-          ;; In reverse order:
-          '(("Toggle Follow mode" . follow-mode)
-            ("--")
-            ("Recenter"           . follow-recenter)
-            ("--")
-            ("Previous Window"    . follow-previous-window)
-            ("Next Windows"       . follow-next-window)
-            ("Last Window"        . follow-last-window)
-            ("First Window"       . follow-first-window)
-            ("--")
-            ("Switch To Buffer (all windows)"
-              . follow-switch-to-buffer-all)
-            ("Switch To Buffer"   . follow-switch-to-buffer)
-            ("--")
-            ("Delete Other Windows and Split"
-              . follow-delete-other-windows-and-split)
-            ("--")
-            ("Scroll Down"        . follow-scroll-down)
-            ("Scroll Up"          . follow-scroll-up)))
-
-         ;; If there is a `tools' menu, we use it.  However, we can't add a
-         ;; minor-mode specific item to it (it's broken), so we make the
-         ;; contents ghosted when not in use, and add ourselves to the
-         ;; global map.  If no `tools' menu is present, just make a
-         ;; top-level menu visible when the mode is activated.
-
-         (let ((tools-map (lookup-key (current-global-map) [menu-bar tools]))
-               (last nil))
-           (if (sequencep tools-map)
-               (progn
-                 ;; Find the last entry in the menu and store it in `last'.
-                 (mapcar (function
-                          (lambda (x)
-                            (setq last (or (cdr-safe
-                                            (cdr-safe
-                                             (cdr-safe x)))
-                                           last))))
-                         tools-map)
-                 (if last
-                     (progn
-                       (funcall (symbol-function 'define-key-after)
-                                 tools-map [separator-follow] '("--") last)
-                       (funcall (symbol-function 'define-key-after)
-                                tools-map [follow] (cons "Follow" menumap)
-                                'separator-follow))
-                   ;; Didn't find the last item, Adding to the top of
-                   ;; tools.  (This will probably never happend...)
-                   (define-key (current-global-map) [menu-bar tools follow]
-                     (cons "Follow" menumap))))
-             ;; No tools menu, add "Follow" to the menubar.
-             (define-key mainmap [menu-bar follow]
-               (cons "Follow" menumap)))))
-
-      ;;
-      ;; XEmacs.
-      ;;
-
-      ;; place the menu in the `Tools' menu.
-      (let ((menu '("Follow"
-                   :filter follow-menu-filter
-                   ["Scroll Up" follow-scroll-up t]
-                   ["Scroll Down" follow-scroll-down t]
-                   ["Delete Other Windows and Split"
-                    follow-delete-other-windows-and-split t]
-                   ["Switch To Buffer" follow-switch-to-buffer t]
-                   ["Switch To Buffer (all windows)"
-                    follow-switch-to-buffer-all t]
-                   ["First Window" follow-first-window t]
-                   ["Last Window" follow-last-window t]
-                   ["Next Windows" follow-next-window t]
-                   ["Previous Window" follow-previous-window t]
-                   ["Recenter" follow-recenter t]
-                   ["Deactivate" follow-mode t])))
-
-       ;; Why not just `(set-buffer-menubar current-menubar)'?  The
-       ;; question is a very good question.  The reason is that under
-       ;; Emacs, neither `set-buffer-menubar' nor
-       ;; `current-menubar' is defined, hence the byte-compiler will
-       ;; warn.
-       (funcall (symbol-function 'set-buffer-menubar)
-                (symbol-value 'current-menubar))
-       (funcall (symbol-function 'add-submenu) '("Tools") menu))
-
-      ;; When the mode is not activated, only one item is visible:
-      ;; "Activate".
-      (defun follow-menu-filter (menu)
-       (if follow-mode
-           menu
-         '(["Activate          " follow-mode t]))))
-
     mainmap)
   "Minor mode keymap for Follow mode.")
 
+;; When the mode is not activated, only one item is visible to activate
+;; the mode.
+(defun follow-menu-filter (menu)
+  (if (bound-and-true-p 'follow-mode)
+      menu
+    '(["Follow mode    "       follow-mode
+       :style toggle :selected follow-mode])))
+
+;; If there is a `tools' menu, we use it.  However, we can't add a
+;; minor-mode specific item to it (it's broken), so we make the
+;; contents ghosted when not in use, and add ourselves to the
+;; global map.
+(easy-menu-add-item nil '("Tools")
+  '("Follow"
+    ;; The Emacs code used to just grey out operations when follow-mode was
+    ;; not enabled, whereas the XEmacs code used to remove it altogether.
+    ;; Not sure which is preferable, but clearly the preference should not
+    ;; depend on the flavor.
+    :filter follow-menu-filter
+    ["Scroll Up"       follow-scroll-up        follow-mode]
+    ["Scroll Down"     follow-scroll-down      follow-mode]
+    "--"
+    ["Delete Other Windows and Split" follow-delete-other-windows-and-split follow-mode]
+    "--"
+    ["Switch To Buffer"        follow-switch-to-buffer follow-mode]
+    ["Switch To Buffer (all windows)" follow-switch-to-buffer-all follow-mode]
+    "--"
+    ["First Window"    follow-first-window     follow-mode]
+    ["Last Window"     follow-last-window      follow-mode]
+    ["Next Window"     follow-next-window      follow-mode]
+    ["Previous Window" follow-previous-window  follow-mode]
+    "--"
+    ["Recenter"                follow-recenter         follow-mode]
+    "--"
+    ["Follow mode"     follow-mode :style toggle :selected follow-mode]))
+
 ;;}}}
 
 (defcustom follow-mode-line-text " Follow"
@@ -553,14 +475,12 @@ Used by `follow-window-size-change'.")
 ;;;###autoload
 (defun turn-on-follow-mode ()
   "Turn on Follow mode.  Please see the function `follow-mode'."
-  (interactive)
   (follow-mode 1))
 
 
 ;;;###autoload
 (defun turn-off-follow-mode ()
   "Turn off Follow mode.  Please see the function `follow-mode'."
-  (interactive)
   (follow-mode -1))
 
 (put 'follow-mode 'permanent-local t)
@@ -912,7 +832,7 @@ of the way from the true end."
   "Return all windows displaying the same buffer as the TESTWIN.
 The list contains only windows displayed in the same frame as TESTWIN.
 If TESTWIN is nil the selected window is used."
-  (or (and testwin (window-live-p testwin))
+  (or (window-live-p testwin)
       (setq testwin (selected-window)))
   (let* ((top (frame-first-window (window-frame testwin)))
         (win top)
@@ -1968,7 +1888,7 @@ report this using the `report-emacs-bug' function."
     ;; If we're in follow mode, do our stuff.  Select a new window and
     ;; redisplay.  (Actually, it is redundant to check `buf', but I
     ;; feel it's more correct.)
-    (if (and buf win (window-live-p win))
+    (if (and buf (window-live-p win))
        (progn
          (set-buffer buf)
          (if (and (boundp 'follow-mode) follow-mode)
@@ -2109,12 +2029,12 @@ report this using the `report-emacs-bug' function."
                      (setq windows (follow-all-followers win))
                      (if (memq orig-window windows)
                          (progn
-                           ;; Make sure we're redrawing around the
-                           ;; selected window.
-                           ;;
-                           ;; We must be really careful not to do this
-                           ;; when we are (indirectly) called by
-                           ;; `post-command-hook'.
+                            ;; Make sure we're redrawing around the
+                            ;; selected window.
+                            ;;
+                            ;; We must be really careful not to do this
+                            ;; when we are (indirectly) called by
+                            ;; `post-command-hook'.
                            (select-window orig-window)
                            (follow-post-command-hook)
                            (setq orig-window (selected-window)))
index 6bc5fd8..b74547d 100644 (file)
@@ -2287,7 +2287,7 @@ other modes in which C preprocessor directives are used. e.g. `asm-mode' and
             ;; that do not occur in strings.  The associated regexp matches one
             ;; of `\\\\' `\\(' `\\(?:' `\\|' `\\)'.  `\\\\' has been included to
             ;; avoid highlighting, for example, `\\(' in `\\\\('.
-            (while (re-search-forward "\\(\\\\\\\\\\)\\(?:\\(\\\\\\\\\\)\\|\\((\\(?:\\?:\\)?\\|[|)]\\)\\)" bound t)
+            (while (re-search-forward "\\(\\\\\\\\\\)\\(?:\\(\\\\\\\\\\)\\|\\((\\(?:\\?[0-9]*:\\)?\\|[|)]\\)\\)" bound t)
               (unless (match-beginning 2)
                 (let ((face (get-text-property (1- (point)) 'face)))
                   (when (or (and (listp face)
index d029e3d..35e47ef 100644 (file)
@@ -429,13 +429,34 @@ a list (ABSOLUTE-FILE-NAME SIZE)."
          (fmt (format-read (format "Read file `%s' in format: "
                                    (file-name-nondirectory file)))))
      (list file fmt)))
-  (let (value size)
-    (let ((format-alist nil))
-      (setq value (insert-file-contents filename nil beg end))
-      (setq size (nth 1 value)))
-    (if format
-       (setq size (format-decode format size)
-             value (list (car value) size)))
+  (let (value size old-undo)
+    ;; Record only one undo entry for the insertion.  Inhibit point-motion and
+    ;; modification hooks as with `insert-file-contents'.
+    (let ((inhibit-point-motion-hooks t)
+         (inhibit-modification-hooks t))
+      ;; Don't bind `buffer-undo-list' to t here to assert that
+      ;; `insert-file-contents' may record whether the buffer was unmodified
+      ;; before.
+      (let ((format-alist nil))
+       (setq value (insert-file-contents filename nil beg end))
+       (setq size (nth 1 value)))
+      (when (consp buffer-undo-list)
+       (let ((head (car buffer-undo-list)))
+         (when (and (consp head)
+                    (equal (car head) (point))
+                    (equal (cdr head) (+ (point) size)))
+           ;; Remove first entry from `buffer-undo-list', we shall insert
+           ;; another one below.
+           (setq old-undo (cdr buffer-undo-list)))))
+      (when format
+       (let ((buffer-undo-list t))
+         (setq size (format-decode format size)
+               value (list (car value) size)))
+       (unless (eq buffer-undo-list t)
+         (setq buffer-undo-list
+               (cons (cons (point) (+ (point) size)) old-undo)))))
+    (unless inhibit-modification-hooks
+      (run-hook-with-args 'after-change-functions (point) (+ (point) size) 0))
     value))
 
 (defun format-read (&optional prompt)
index 97133de..3246efc 100644 (file)
@@ -226,10 +226,9 @@ Pass it BUFFER as first arg, and (cdr ARGS) gives the rest of the args."
        (setq frame-creation-function
              (if (fboundp 'tty-create-frame-with-faces)
                  'tty-create-frame-with-faces
-               (function
-                (lambda (parameters)
-                  (error
-                   "Can't create multiple frames without a window system"))))))))
+                (lambda (parameters)
+                  (error
+                   "Can't create multiple frames without a window system")))))))
 
 (defvar frame-notice-user-settings t
   "Non-nil means function `frame-notice-user-settings' wasn't run yet.")
@@ -424,12 +423,12 @@ React to settings of `default-frame-alist', `initial-frame-alist' there."
            ;; variable must be handled similarly.
            (let ((users-of-initial
                   (filtered-frame-list
-                   (function (lambda (frame)
-                               (and (not (eq frame frame-initial-frame))
-                                    (eq (window-frame
-                                         (minibuffer-window frame))
-                                        frame-initial-frame)))))))
-             (if (or users-of-initial
+                    (lambda (frame)
+                      (and (not (eq frame frame-initial-frame))
+                           (eq (window-frame
+                                (minibuffer-window frame))
+                               frame-initial-frame))))))
+              (if (or users-of-initial
                      (eq default-minibuffer-frame frame-initial-frame))
 
                  ;; Choose an appropriate frame.  Prefer frames which
@@ -437,11 +436,10 @@ React to settings of `default-frame-alist', `initial-frame-alist' there."
                  (let* ((new-surrogate
                          (car
                           (or (filtered-frame-list
-                               (function
-                                (lambda (frame)
-                                  (eq (cdr (assq 'minibuffer
-                                                 (frame-parameters frame)))
-                                      'only))))
+                                (lambda (frame)
+                                  (eq (cdr (assq 'minibuffer
+                                                 (frame-parameters frame)))
+                                      'only)))
                               (minibuffer-frame-list))))
                         (new-minibuffer (minibuffer-window new-surrogate)))
 
@@ -450,14 +448,11 @@ React to settings of `default-frame-alist', `initial-frame-alist' there."
 
                    ;; Wean the frames using frame-initial-frame as
                    ;; their minibuffer frame.
-                   (mapcar
-                    (function
-                     (lambda (frame)
-                       (modify-frame-parameters
-                        frame (list (cons 'minibuffer new-minibuffer)))))
-                    users-of-initial))))
-
-          ;; Redirect events enqueued at this frame to the new frame.
+                   (dolist (frame users-of-initial)
+                      (modify-frame-parameters
+                       frame (list (cons 'minibuffer new-minibuffer)))))))
+
+            ;; Redirect events enqueued at this frame to the new frame.
            ;; Is this a good idea?
            (redirect-frame-focus frame-initial-frame new)
 
@@ -574,6 +569,36 @@ The optional second argument PARAMETERS specifies additional frame parameters."
       (error "Invalid display, not HOST:SERVER or HOST:SERVER.SCREEN"))
   (make-frame (cons (cons 'display display) parameters)))
 
+(defun close-display-connection (display)
+  "Close the connection to a display, deleting all its associated frames.
+For DISPLAY, specify either a frame or a display name (a string).
+If DISPLAY is nil, that stands for the selected frame's display."
+  (interactive
+   (list
+    (let* ((default (frame-parameter nil 'display))
+           (display (completing-read
+                     (format "Close display (default %s): " default)
+                     (delete-dups
+                      (mapcar (lambda (frame)
+                                (frame-parameter frame 'display))
+                              (frame-list)))
+                     nil t nil nil
+                     default)))
+      (if (zerop (length display)) default display))))
+  (let ((frames (delq nil
+                      (mapcar (lambda (frame)
+                                (if (equal display
+                                           (frame-parameter frame 'display))
+                                    frame))
+                              (frame-list)))))
+    (if (and (consp frames)
+             (not (y-or-n-p (if (cdr frames)
+                                (format "Delete %s frames? " (length frames))
+                              (format "Delete %s ? " (car frames))))))
+        (error "Abort!")
+      (mapc 'delete-frame frames)
+      (x-close-connection display))))
+
 (defun make-frame-command ()
   "Make a new frame, and select it if the terminal displays only one frame."
   (interactive)
@@ -639,8 +664,8 @@ setup is for focus to follow the pointer."
 (defun minibuffer-frame-list ()
   "Return a list of all frames with their own minibuffers."
   (filtered-frame-list
-   (function (lambda (frame)
-              (eq frame (window-frame (minibuffer-window frame)))))))
+   (lambda (frame)
+     (eq frame (window-frame (minibuffer-window frame))))))
 
 (defun frames-on-display-list (&optional display)
   "Return a list of all frames on DISPLAY.
@@ -787,11 +812,10 @@ where
   ALIST is an association list specifying some of FRAME's parameters, and
   WINDOW-CONFIG is a window configuration object for FRAME."
   (cons 'frame-configuration
-       (mapcar (function
-                (lambda (frame)
-                  (list frame
-                        (frame-parameters frame)
-                        (current-window-configuration frame))))
+       (mapcar (lambda (frame)
+                  (list frame
+                        (frame-parameters frame)
+                        (current-window-configuration frame)))
                (frame-list))))
 
 (defun set-frame-configuration (configuration &optional nodelete)
@@ -808,29 +832,28 @@ is given and non-nil, the unwanted frames are iconified instead."
              (list 'frame-configuration-p configuration)))
   (let ((config-alist (cdr configuration))
        frames-to-delete)
-    (mapcar (function
-            (lambda (frame)
-              (let ((parameters (assq frame config-alist)))
-                (if parameters
-                    (progn
-                      (modify-frame-parameters
-                       frame
-                       ;; Since we can't set a frame's minibuffer status,
-                       ;; we might as well omit the parameter altogether.
-                       (let* ((parms (nth 1 parameters))
-                              (mini (assq 'minibuffer parms)))
-                         (if mini (setq parms (delq mini parms)))
-                         parms))
-                      (set-window-configuration (nth 2 parameters)))
-                  (setq frames-to-delete (cons frame frames-to-delete))))))
-           (frame-list))
-    (if nodelete
-       ;; Note: making frames invisible here was tried
-       ;; but led to some strange behavior--each time the frame
-       ;; was made visible again, the window manager asked afresh
-       ;; for where to put it.
-       (mapcar 'iconify-frame frames-to-delete)
-      (mapcar 'delete-frame frames-to-delete))))
+    (dolist (frame (frame-list))
+      (let ((parameters (assq frame config-alist)))
+        (if parameters
+            (progn
+              (modify-frame-parameters
+               frame
+               ;; Since we can't set a frame's minibuffer status,
+               ;; we might as well omit the parameter altogether.
+               (let* ((parms (nth 1 parameters))
+                      (mini (assq 'minibuffer parms)))
+                 (if mini (setq parms (delq mini parms)))
+                 parms))
+              (set-window-configuration (nth 2 parameters)))
+          (setq frames-to-delete (cons frame frames-to-delete)))))
+    (mapc (if nodelete
+              ;; Note: making frames invisible here was tried
+              ;; but led to some strange behavior--each time the frame
+              ;; was made visible again, the window manager asked afresh
+              ;; for where to put it.
+              'iconify-frame
+            'delete-frame)
+          frames-to-delete)))
 \f
 ;;;; Convenience functions for accessing and interactively changing
 ;;;; frame parameters.
@@ -858,12 +881,11 @@ pixels) is kept by adjusting the numbers of the lines and columns."
   (interactive
    (let* ((completion-ignore-case t)
          (font (completing-read "Font name: "
-                        (mapcar #'list
                                 ;; x-list-fonts will fail with an error
                                 ;; if this frame doesn't support fonts.
-                                (x-list-fonts "*" nil (selected-frame)))
-                        nil nil nil nil
-                        (frame-parameter nil 'font))))
+                                (x-list-fonts "*" nil (selected-frame))
+                                 nil nil nil nil
+                                 (frame-parameter nil 'font))))
      (list font current-prefix-arg)))
   (let (fht fwd)
     (if keep-size
index 807a853..7fd187a 100644 (file)
@@ -1,3 +1,17 @@
+2007-08-10  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * nntp.el (nntp-xref-number-is-evil): New server variable.
+       (nntp-find-group-and-number): If it is non-nil, don't trust article
+       numbers in the Xref header.
+
+2007-08-06  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-ems.el (gnus-x-splash): Bind inhibit-read-only to t.
+
+2007-08-04  Reiner Steib  <Reiner.Steib@gmx.de>
+
+       * gnus-art.el (article-hide-headers): Bind inhibit-read-only to t.
+
 2007-08-08  Glenn Morris  <rgm@gnu.org>
 
        * gmm-utils.el, gnus-async.el, gnus-msg.el, gnus-score.el
index 40de101..6ccba3b 100644 (file)
@@ -1743,7 +1743,7 @@ Initialized from `text-mode-syntax-table.")
   (interactive)
   ;; This function might be inhibited.
   (unless gnus-inhibit-hiding
-    (let ((inhibit-read-only nil)
+    (let ((inhibit-read-only t)
          (case-fold-search t)
          (max (1+ (length gnus-sorted-header-list)))
          (inhibit-point-motion-hooks t)
index bacf558..88190b8 100644 (file)
                                                    (interactive-p))
                                                "*gnus-x-splash*"
                                              gnus-group-buffer)))
-  (let ((inhibit-read-only nil)
+  (let ((inhibit-read-only t)
        (file (nnheader-find-etc-directory "images/gnus/x-splash" t))
        pixmap fcw fch width height fringes sbars left yoffset top ls)
     (erase-buffer)
index 869213c..2623df5 100644 (file)
@@ -183,6 +183,14 @@ by one.")
 If the gap between two consecutive articles is bigger than this
 variable, split the XOVER request into two requests.")
 
+(defvoo nntp-xref-number-is-evil nil
+  "*If non-nil, Gnus never trusts article numbers in the Xref header.
+Some news servers, e.g., ones running Diablo, run multiple engines
+having the same articles but article numbers are not kept synchronized
+between them.  If you connect to such a server, set this to a non-nil
+value, and Gnus never uses article numbers (that appear in the Xref
+header and vary by which engine is chosen) to refer to articles.")
+
 (defvoo nntp-prepare-server-hook nil
   "*Hook run before a server is opened.
 If can be used to set up a server remotely, for instance.  Say you
@@ -1632,7 +1640,8 @@ password contained in '~/.nntp-authinfo'."
                    (match-string 1 xref))
                   (t "")))
          (cond
-          ((and (setq xref (mail-fetch-field "xref"))
+          ((and (not nntp-xref-number-is-evil)
+                (setq xref (mail-fetch-field "xref"))
                 (string-match
                  (if group
                      (concat "\\(" (regexp-quote group) "\\):\\([0-9]+\\)")
index d84a861..04b3598 100644 (file)
@@ -232,6 +232,23 @@ face (according to `face-differs-from-default-p')."
              libname)
          file))))
 
+(defun find-source-lisp-file (file-name)
+  (let* ((elc-file (locate-file (concat file-name
+                                (if (string-match "\\.el" file-name)
+                                    "c"
+                                  ".elc"))
+                                load-path))
+        (str (if (and elc-file (file-readable-p elc-file))
+                 (with-temp-buffer 
+                   (insert-file-contents-literally elc-file nil 0 256)
+                   (buffer-string))))
+        (src-file (and str
+                       (string-match ";;; from file \\(.*\\.el\\)" str)
+                       (match-string 1 str))))
+    (if (and src-file (file-readable-p src-file))
+       src-file
+      file-name)))
+
 ;;;###autoload
 (defun describe-function-1 (function)
   (let* ((def (if (symbolp function)
@@ -309,6 +326,10 @@ face (according to `face-differs-from-default-p')."
       ;; but that's completely wrong when the user used load-file.
       (princ (if (eq file-name 'C-source) "C source code" file-name))
       (princ "'")
+      ;; See if lisp files are present where they where installed from.
+      (if (not (eq file-name 'C-source))
+         (setq file-name (find-source-lisp-file file-name)))
+
       ;; Make a hyperlink to the library.
       (with-current-buffer standard-output
         (save-excursion
index 74daa9b..1435eb0 100644 (file)
@@ -40,6 +40,7 @@
 
 (define-key help-mode-map [mouse-2] 'help-follow-mouse)
 (define-key help-mode-map "\C-c\C-b" 'help-go-back)
+(define-key help-mode-map "\C-c\C-f" 'help-go-forward)
 (define-key help-mode-map "\C-c\C-c" 'help-follow-symbol)
 ;; Documentation only, since we use minor-mode-overriding-map-alist.
 (define-key help-mode-map "\r" 'help-follow)
@@ -52,13 +53,28 @@ To use the element, do (apply FUNCTION ARGS) then goto the point.")
 (put 'help-xref-stack 'permanent-local t)
 (make-variable-buffer-local 'help-xref-stack)
 
+(defvar help-xref-forward-stack nil
+  "The stack of used to navigate help forwards  after using the back button.
+Used by `help-follow' and `help-xref-go-forward'.
+An element looks like (POSITION FUNCTION ARGS...).
+To use the element, do (apply FUNCTION ARGS) then goto the point.")
+(put 'help-xref-forward-stack 'permanent-local t)
+(make-variable-buffer-local 'help-xref-forward-stack)
+
 (defvar help-xref-stack-item nil
   "An item for `help-follow' in this buffer to push onto `help-xref-stack'.
 The format is (FUNCTION ARGS...).")
 (put 'help-xref-stack-item 'permanent-local t)
 (make-variable-buffer-local 'help-xref-stack-item)
 
+(defvar help-xref-stack-forward-item nil
+  "An item for `help-go-back' to push onto `help-xref-forward-stack'.
+The format is (FUNCTION ARGS...).")
+(put 'help-xref-stack-forward-item 'permanent-local t)
+(make-variable-buffer-local 'help-xref-stack-forward-item)
+
 (setq-default help-xref-stack nil help-xref-stack-item nil)
+(setq-default help-xref-forward-stack nil help-xref-forward-stack-item nil)
 
 (defcustom help-mode-hook nil
   "Hook run by `help-mode'."
@@ -123,6 +139,11 @@ The format is (FUNCTION ARGS...).")
   'help-function #'help-xref-go-back
   'help-echo (purecopy "mouse-2, RET: go back to previous help buffer"))
 
+(define-button-type 'help-forward
+  :supertype 'help-xref
+  'help-function #'help-xref-go-forward
+  'help-echo (purecopy "mouse-2, RET: move forward to next help buffer"))
+
 (define-button-type 'help-info
   :supertype 'help-xref
   'help-function #'info
@@ -242,6 +263,9 @@ Commands:
 (defvar help-back-label (purecopy "[back]")
   "Label to use by `help-make-xrefs' for the go-back reference.")
 
+(defvar help-forward-label (purecopy "[forward]")
+  "Label to use by `help-make-xrefs' for the go-forward reference.")
+
 (defconst help-xref-symbol-regexp
   (purecopy (concat "\\(\\<\\(\\(variable\\|option\\)\\|"  ; Link to var
                    "\\(function\\|command\\)\\|"          ; Link to function
@@ -286,7 +310,8 @@ because we want to record the \"previous\" position of point so we can
 restore it properly when going back."
   (with-current-buffer (help-buffer)
     (when help-xref-stack-item
-      (push (cons (point) help-xref-stack-item) help-xref-stack))
+      (push (cons (point) help-xref-stack-item) help-xref-stack)
+      (setq help-xref-forward-stack nil))
     (when interactive-p
       (let ((tail (nthcdr 10 help-xref-stack)))
        ;; Truncate the stack.
@@ -477,11 +502,19 @@ that."
        (while (and (not (bobp)) (bolp))
          (delete-char -1))
         (insert "\n")
+       (when (or help-xref-stack help-xref-forward-stack)
+          (insert "\n"))
         ;; Make a back-reference in this buffer if appropriate.
         (when help-xref-stack
-         (insert "\n")
          (help-insert-xref-button help-back-label 'help-back
-                                  (current-buffer))
+                                  (current-buffer)))
+        ;; Make a forward-reference in this buffer if appropriate.
+        (when help-xref-forward-stack
+         (when help-xref-stack
+           (insert "\t"))
+         (help-insert-xref-button help-forward-label 'help-forward
+                                  (current-buffer)))
+       (when (or help-xref-stack help-xref-forward-stack)
           (insert "\n")))
       ;; View mode steals RET from us.
       (set (make-local-variable 'minor-mode-overriding-map-alist)
@@ -600,6 +633,7 @@ help buffer."
   "From BUFFER, go back to previous help buffer text using `help-xref-stack'."
   (let (item position method args)
     (with-current-buffer buffer
+      (push (cons (point) help-xref-stack-item) help-xref-forward-stack)
       (when help-xref-stack
        (setq item (pop help-xref-stack)
              ;; Clear the current item so that it won't get pushed
@@ -615,12 +649,39 @@ help buffer."
          (set-window-point (get-buffer-window buffer) position)
        (goto-char position)))))
 
+(defun help-xref-go-forward (buffer)
+  "From BUFFER, go forward to next help buffer."
+  (let (item position method args)
+    (with-current-buffer buffer
+      (push (cons (point) help-xref-stack-item) help-xref-stack)
+      (when help-xref-forward-stack
+       (setq item (pop help-xref-forward-stack)
+             ;; Clear the current item so that it won't get pushed
+             ;; by the function we're about to call.  TODO: We could also
+             ;; push it onto a "forward" stack and add a `forw' button.
+             help-xref-stack-item nil
+             position (car item)
+             method (cadr item)
+             args (cddr item))))
+    (apply method args)
+    (with-current-buffer buffer
+      (if (get-buffer-window buffer)
+         (set-window-point (get-buffer-window buffer) position)
+       (goto-char position)))))
 (defun help-go-back ()
   "Go back to previous topic in this help buffer."
   (interactive)
   (if help-xref-stack
       (help-xref-go-back (current-buffer))
     (error "No previous help buffer")))
+(defun help-go-forward ()
+  "Go back to next topic in this help buffer."
+  (interactive)
+  (if help-xref-forward-stack
+      (help-xref-go-forward (current-buffer))
+    (error "No next help buffer")))
 
 (defun help-do-xref (pos function args)
   "Call the help cross-reference function FUNCTION with args ARGS.
index 65ee12a..c2c2a14 100644 (file)
   :prefix "image-dired-"
   :group 'multimedia)
 
-(defcustom image-dired-dir "~/.emacs.d/image-dired/"
+(defcustom image-dired-dir (concat user-emacs-directory "image-dired/")
   "Directory where thumbnail images are stored."
   :type 'string
   :group 'image-dired)
@@ -187,17 +187,20 @@ that allows sharing of thumbnails across different programs."
                  (const :tag "Per-directory" per-directory))
   :group 'image-dired)
 
-(defcustom image-dired-db-file "~/.emacs.d/image-dired/.image-dired_db"
+(defcustom image-dired-db-file
+  (concat user-emacs-directory "image-dired/.image-dired_db")
   "Database file where file names and their associated tags are stored."
   :type 'string
   :group 'image-dired)
 
-(defcustom image-dired-temp-image-file "~/.emacs.d/image-dired/.image-dired_temp"
+(defcustom image-dired-temp-image-file
+  (concat user-emacs-directory "image-dired/.image-dired_temp")
   "Name of temporary image file used by various commands."
   :type 'string
   :group 'image-dired)
 
-(defcustom image-dired-gallery-dir "~/.emacs.d/image-dired/.image-dired_gallery"
+(defcustom image-dired-gallery-dir
+  (concat user-emacs-directory "image-dired/.image-dired_gallery")
   "Directory to store generated gallery html pages.
 This path needs to be \"shared\" to the public so that it can access
 the index.html page that image-dired creates."
@@ -342,7 +345,7 @@ original image file name and %t which is replaced by
   :group 'image-dired)
 
 (defcustom image-dired-temp-rotate-image-file
-  "~/.emacs.d/image-dired/.image-dired_rotate_temp"
+  (concat user-emacs-directory "image-dired/.image-dired_rotate_temp")
   "Temporary file for rotate operations."
   :type 'string
   :group 'image-dired)
index 7604d29..d4a6938 100644 (file)
@@ -51,13 +51,14 @@ Stop if the right edge of the image is reached."
   (interactive "p")
   (cond ((= n 0) nil)
        ((< n 0)
-        (set-window-hscroll nil (max 0 (+ (window-hscroll) n))))
+        (set-window-hscroll (selected-window)
+                            (max 0 (+ (window-hscroll) n))))
        (t
         (let* ((image (get-text-property 1 'display))
-               (img-width (ceiling (car (image-size image))))
                (edges (window-inside-edges))
-               (win-width (- (nth 2 edges) (nth 0 edges))))
-          (set-window-hscroll nil
+               (win-width (- (nth 2 edges) (nth 0 edges)))
+               (img-width (ceiling (car (image-size image)))))
+          (set-window-hscroll (selected-window)
                               (min (max 0 (- img-width win-width))
                                    (+ n (window-hscroll))))))))
 
@@ -73,13 +74,14 @@ Stop if the bottom edge of the image is reached."
   (interactive "p")
   (cond ((= n 0) nil)
        ((< n 0)
-        (set-window-vscroll nil (max 0 (+ (window-vscroll) n))))
+        (set-window-vscroll (selected-window)
+                            (max 0 (+ (window-vscroll) n))))
        (t
         (let* ((image (get-text-property 1 'display))
-               (img-height (ceiling (cdr (image-size image))))
                (edges (window-inside-edges))
-               (win-height (- (nth 3 edges) (nth 1 edges))))
-          (set-window-vscroll nil
+               (win-height (- (nth 3 edges) (nth 1 edges)))
+               (img-height (ceiling (cdr (image-size image)))))
+          (set-window-vscroll (selected-window)
                               (min (max 0 (- img-height win-height))
                                    (+ n (window-vscroll))))))))
 
@@ -312,9 +314,9 @@ and showing the image as an image."
               nil t)))
           (props
            `(display ,image
-                     intangible ,image
-                     rear-nonsticky (display intangible)
-                     read-only t front-sticky (read-only)))
+             intangible ,image
+             rear-nonsticky (display intangible)
+             read-only t front-sticky (read-only)))
           (inhibit-read-only t)
           (buffer-undo-list t)
           (modified (buffer-modified-p)))
index 480b561..6763cf1 100644 (file)
@@ -292,43 +292,28 @@ be determined."
   "Determine the type of image file FILE from its name.
 Value is a symbol specifying the image type, or nil if type cannot
 be determined."
-  (let ((types image-type-file-name-regexps)
-       type)
-    (while types
-      (if (string-match (car (car types)) file)
-         (setq type (cdr (car types))
-               types nil)
-       (setq types (cdr types))))
-    type))
+  (assoc-default file image-type-file-name-regexps 'string-match))
 
 
 ;;;###autoload
-(defun image-type (file-or-data &optional type data-p)
+(defun image-type (source &optional type data-p)
   "Determine and return image type.
-FILE-OR-DATA is an image file name or image data.
+SOURCE is an image file name or image data.
 Optional TYPE is a symbol describing the image type.  If TYPE is omitted
 or nil, try to determine the image type from its first few bytes
-of image data.  If that doesn't work, and FILE-OR-DATA is a file name,
+of image data.  If that doesn't work, and SOURCE is a file name,
 use its file extension as image type.
-Optional DATA-P non-nil means FILE-OR-DATA is a string containing image data."
-  (when (and (not data-p) (not (stringp file-or-data)))
-    (error "Invalid image file name `%s'" file-or-data))
-  (cond ((null data-p)
-        ;; FILE-OR-DATA is a file name.
-        (unless (or type
-                    (setq type (image-type-from-file-header file-or-data)))
-          (let ((extension (file-name-extension file-or-data)))
-            (unless extension
-              (error "Cannot determine image type"))
-            (setq type (intern extension)))))
-       (t
-        ;; FILE-OR-DATA contains image data.
-        (unless type
-          (setq type (image-type-from-data file-or-data)))))
+Optional DATA-P non-nil means SOURCE is a string containing image data."
+  (when (and (not data-p) (not (stringp source)))
+    (error "Invalid image file name `%s'" source))
   (unless type
-    (error "Cannot determine image type"))
-  (unless (symbolp type)
-    (error "Invalid image type `%s'" type))
+    (setq type (if data-p
+                  (image-type-from-data source)
+                (or (image-type-from-file-header source)
+                    (image-type-from-file-name source))))
+    (or type (error "Cannot determine image type")))
+  (or (memq type image-types)
+      (error "Invalid image type `%s'" type))
   type)
 
 
@@ -350,7 +335,7 @@ its beginning matches an image type in `image-type-header-regexps',
 and that image type is present in `image-type-auto-detectable'."
   (let* ((type (image-type-from-buffer))
         (auto (and type (cdr (assq type image-type-auto-detectable)))))
-    (and auto
+    (and type
         (or (eq auto t) (image-type-available-p type)))))
 
 
index a005abe..b580e3a 100644 (file)
@@ -50,8 +50,8 @@ Don't rebind TAB unless you really need to.")
   "*Controls the operation of the TAB key.
 If t, hitting TAB always just indents the current line.
 If nil, hitting TAB indents the current line if point is at the left margin
-or in the line's indentation, otherwise it insert a \"real\" TAB character.
-Most programming language modes have their own variable to control this,
+or in the line's indentation, otherwise it inserts a \"real\" TAB character.
+Some programming language modes have their own variable to control this,
 e.g., `c-tab-always-indent', and do not respect this variable."
   :group 'indent
   :type '(choice (const nil) (const t) (const always)))
index e77aeab..3253ae0 100644 (file)
@@ -4074,7 +4074,8 @@ the variable `Info-file-list-for-emacs'."
       ;; Fontify http and ftp references
       (goto-char (point-min))
       (when not-fontified-p
-        (while (re-search-forward "\\(https?\\|ftp\\)://[^ \t\n\"`({<>})']+" nil t)
+        (while (re-search-forward "\\(https?\\|ftp\\)://[^ \t\n\"`({<>})']+"
+                                  nil t)
           (add-text-properties (match-beginning 0) (match-end 0)
                                '(font-lock-face info-xref
                                                 mouse-face highlight
index f9f4976..cddcf98 100644 (file)
@@ -55,7 +55,7 @@
 
 ;;; Code:
 
-(require 'help-mode)
+(eval-when-compile (require 'help-mode))
 
 (defgroup quail nil
   "Quail: multilingual input method."
@@ -2431,22 +2431,27 @@ should be made by `quail-build-decode-map' (which see)."
        (insert ?\n))
       (insert ?\n))))
 
-(define-button-type 'quail-keyboard-layout-button
-  :supertype 'help-xref
-  'help-function '(lambda (layout)
-                   (help-setup-xref `(quail-keyboard-layout-button ,layout) nil)
-                   (quail-show-keyboard-layout layout))
-  'help-echo (purecopy "mouse-2, RET: show keyboard layout"))
-
-(define-button-type 'quail-keyboard-customize-button
-  :supertype 'help-customize-variable
-  'help-echo (purecopy "mouse-2, RET: customize keyboard layout"))
+(defun quail-help-init ()
+  (unless (featurep 'help-mode)
+    (require 'help-mode)
+    (define-button-type 'quail-keyboard-layout-button
+      :supertype 'help-xref
+      'help-function '(lambda (layout)
+                       (help-setup-xref `(quail-keyboard-layout-button ,layout)
+                                        nil)
+                       (quail-show-keyboard-layout layout))
+      'help-echo (purecopy "mouse-2, RET: show keyboard layout"))
+
+    (define-button-type 'quail-keyboard-customize-button
+      :supertype 'help-customize-variable
+      'help-echo (purecopy "mouse-2, RET: customize keyboard layout"))))
 
 (defun quail-help (&optional package)
   "Show brief description of the current Quail package.
 Optional arg PACKAGE specifies the name of alternative Quail
 package to describe."
   (interactive)
+  (quail-help-init)
   (let ((help-xref-mule-regexp help-xref-mule-regexp-template)
        (default-enable-multibyte-characters enable-multibyte-characters)
        (package-def
@@ -2629,7 +2634,7 @@ KEY BINDINGS FOR CONVERSION
 ;; it is not yet stored.  As a result, the element is a string or a
 ;; list of strings.
 
-(defsubst quail-store-decode-map-key (table char key)
+(defun quail-store-decode-map-key (table char key)
   (let ((elt (aref table char)))
     (if elt
        (if (consp elt)
index 681d245..39dd323 100644 (file)
@@ -991,16 +991,20 @@ Also compose particular scripts if `utf-8-compose-scripts' is non-nil."
            (set-buffer-multibyte nil)))
 
       (when (and utf-8-compose-scripts (> length 1))
-       ;; These currently have definitions which cover the relevant
-       ;; unicodes.  We could avoid loading thai-util &c by checking
-       ;; whether the region contains any characters with the appropriate
-       ;; categories.  There aren't yet Unicode-based rules for Tibetan.
-       (diacritic-compose-region (point-max) (point-min))
-       (thai-compose-region (point-max) (point-min))
-       (lao-compose-region (point-max) (point-min))
-       (devanagari-compose-region (point-max) (point-min))
-       (malayalam-compose-region (point-max) (point-min))
-       (tamil-compose-region (point-max) (point-min)))
+       ;; This let-binding avoids recursive auto-loading.  And, we
+       ;; anyway don't have to run the following code while
+       ;; auto-loading.
+       (let ((utf-8-compose-scripts nil))
+         ;; These currently have definitions which cover the relevant
+         ;; unicodes.  We could avoid loading thai-util &c by checking
+         ;; whether the region contains any characters with the appropriate
+         ;; categories.  There aren't yet Unicode-based rules for Tibetan.
+         (diacritic-compose-region (point-max) (point-min))
+         (thai-compose-region (point-max) (point-min))
+         (lao-compose-region (point-max) (point-min))
+         (devanagari-compose-region (point-max) (point-min))
+         (malayalam-compose-region (point-max) (point-min))
+         (tamil-compose-region (point-max) (point-min))))
       (- (point-max) (point-min)))))
 
 (defun utf-8-pre-write-conversion (beg end)
index cc68ee2..af8a40c 100644 (file)
@@ -164,6 +164,10 @@ is non-nil if the user quit the search.")
 (defvar isearch-mode-end-hook-quit nil
   "Non-nil while running `isearch-mode-end-hook' if user quit the search.")
 
+(defvar isearch-message-function nil
+  "Function to call to display the search prompt.
+If nil, use `isearch-message'.")
+
 (defvar isearch-wrap-function nil
   "Function to call to wrap the search when search is failed.
 If nil, move point to the beginning of the buffer for a forward search,
@@ -715,7 +719,9 @@ is treated as a regexp.  See \\[isearch-forward] for more info."
           (null executing-kbd-macro))
       (progn
         (if (not (input-pending-p))
-            (isearch-message))
+           (if isearch-message-function
+               (funcall isearch-message-function)
+             (isearch-message)))
         (if (and isearch-slow-terminal-mode
                  (not (or isearch-small-window
                           (pos-visible-in-window-p))))
@@ -2035,7 +2041,9 @@ Can be changed via `isearch-search-fun-function' for special needs."
 
 (defun isearch-search ()
   ;; Do the search with the current search string.
-  (isearch-message nil t)
+  (if isearch-message-function
+      (funcall isearch-message-function nil t)
+    (isearch-message nil t))
   (if (and (eq isearch-case-fold-search t) search-upper-case)
       (setq isearch-case-fold-search
            (isearch-no-upper-case-p isearch-string isearch-regexp)))
index c9c5066..096d35b 100644 (file)
@@ -606,8 +606,11 @@ An argument of zero means repeat until error."
   (unless executing-kbd-macro
     (end-kbd-macro arg #'kmacro-loop-setup-function)
     (when (and last-kbd-macro (= (length last-kbd-macro) 0))
+      (setq last-kbd-macro nil)
       (message "Ignore empty macro")
-      (kmacro-pop-ring))))
+      ;; Don't call `kmacro-ring-empty-p' to avoid its messages.
+      (while (and (null last-kbd-macro) kmacro-ring)
+       (kmacro-pop-ring1)))))
 
 
 ;;;###autoload
index c8ee5db..5c2cf98 100644 (file)
@@ -590,25 +590,23 @@ The return value looks like this:
   (LOGBUFFER (ENTRYSTART . ENTRYEND) ...)
 where LOGBUFFER is the name of the ChangeLog buffer, and each
 \(ENTRYSTART . ENTRYEND\) pair is a buffer region."
-  (save-excursion
-    (let ((changelog-file-name
-          (let ((default-directory
-                  (file-name-directory (expand-file-name file)))
-                (visiting-buffer (find-buffer-visiting file)))
-            ;; If there is a buffer visiting FILE, and it has a local
-            ;; value for `change-log-default-name', use that.
-            (if (and visiting-buffer
-                     (local-variable-p 'change-log-default-name
-                                       visiting-buffer))
-                (save-excursion
-                  (set-buffer visiting-buffer)
-                  change-log-default-name)
-              ;; `find-change-log' uses `change-log-default-name' if set
-              ;; and sets it before exiting, so we need to work around
-              ;; that memoizing which is undesired here
-              (setq change-log-default-name nil)
-              (find-change-log)))))
-      (set-buffer (find-file-noselect changelog-file-name))
+  (let ((changelog-file-name
+         (let ((default-directory
+                 (file-name-directory (expand-file-name file)))
+               (visiting-buffer (find-buffer-visiting file)))
+           ;; If there is a buffer visiting FILE, and it has a local
+           ;; value for `change-log-default-name', use that.
+           (if (and visiting-buffer
+                    (local-variable-p 'change-log-default-name
+                                      visiting-buffer))
+               (with-current-buffer visiting-buffer
+                 change-log-default-name)
+             ;; `find-change-log' uses `change-log-default-name' if set
+             ;; and sets it before exiting, so we need to work around
+             ;; that memoizing which is undesired here
+             (setq change-log-default-name nil)
+             (find-change-log)))))
+    (with-current-buffer (find-file-noselect changelog-file-name)
       (unless (eq major-mode 'change-log-mode) (change-log-mode))
       (goto-char (point-min))
       (if (looking-at "\\s-*\n") (goto-char (match-end 0)))
index 41e689f..51861da 100644 (file)
 (put 'log-view-message-face 'face-alias 'log-view-message)
 (defvar log-view-message-face 'log-view-message)
 
-(defconst log-view-file-re
-  (concat "^\\(?:Working file: \\(.+\\)"                ;RCS and CVS.
-          "\\|\\(?:SCCS/s\\.\\|Changes to \\)\\(.+\\):" ;SCCS and Darcs.
-         "\\)\n"))                   ;Include the \n for font-lock reasons.
-
-(defconst log-view-message-re
-  (concat "^\\(?:revision \\([.0-9]+\\)\\(?:\t.*\\)?" ; RCS and CVS.
-          "\\|r\\([0-9]+\\) | .* | .*"                ; Subversion.
-          "\\|D \\([.0-9]+\\) .*"                     ; SCCS.
+(defvar log-view-file-re
+  (concat "^\\(?:Working file: \\(?1:.+\\)"                ;RCS and CVS.
+          ;; Subversion has no such thing??
+          "\\|\\(?:SCCS/s\\.\\|Changes to \\)\\(?1:.+\\):" ;SCCS and Darcs.
+         "\\)\n")                    ;Include the \n for font-lock reasons.
+  "Regexp matching the text identifying the file.
+The match group number 1 should match the file name itself.")
+
+(defvar log-view-message-re
+  (concat "^\\(?:revision \\(?1:[.0-9]+\\)\\(?:\t.*\\)?" ; RCS and CVS.
+          "\\|r\\(?1:[0-9]+\\) | .* | .*"                ; Subversion.
+          "\\|D \\(?1:[.0-9]+\\) .*"                     ; SCCS.
           ;; Darcs doesn't have revision names.  VC-darcs uses patch names
           ;; instead.  Darcs patch names are hashcodes, which do not appear
           ;; in the log output :-(, but darcs accepts any prefix of the log
           ;; First loosely match the date format.
           (concat "\\|[^ \n].*[^0-9\n][0-9][0-9]:[0-9][0-9][^0-9\n].*[^ \n]"
                   ;;Email of user and finally Msg, used as revision name.
-                  "  .*@.*\n\\(?:  \\* \\(.*\\)\\)?")
+                  "  .*@.*\n\\(?:  \\* \\(?1:.*\\)\\)?")
           "\\)$")
-  "Regexp matching the text identifying a revision.")
+  "Regexp matching the text identifying a revision.
+The match group number 1 should match the revision number itself.")
 
 (defvar log-view-font-lock-keywords
   ;; We use `eval' so as to use the buffer-local value of log-view-file-re
   ;; and log-view-message-re, if applicable.
   '((eval . `(,log-view-file-re
-              (1 (if (boundp 'cvs-filename-face) cvs-filename-face) nil t)
-              (2 (if (boundp 'cvs-filename-face) cvs-filename-face) nil t)
+              (1 (if (boundp 'cvs-filename-face) cvs-filename-face))
               (0 log-view-file-face append)))
     (eval . `(,log-view-message-re . log-view-message-face))))
 
     (forward-line 1)
     (or (re-search-backward log-view-file-re nil t)
        (re-search-forward log-view-file-re))
-    (let* ((file (or (match-string 1) (match-string 2)))
+    (let* ((file (match-string 1))
           (cvsdir (and (re-search-backward log-view-dir-re nil t)
                        (match-string 1)))
           (pcldir (and (boundp 'cvs-pcl-cvs-dirchange-re)
     (forward-line 1)
     (let ((pt (point)))
       (when (re-search-backward log-view-message-re nil t)
-        (let (rev)
-          ;; Find the subgroup that matched.
-          (dotimes (i (/ (length (match-data 'integers)) 2))
-            (setq rev (or rev (match-string (1+ i)))))
+       (let ((rev (match-string 1)))
          (unless (re-search-forward log-view-file-re pt t)
            rev))))))
 
index 94a95cd..209b1de 100644 (file)
@@ -876,14 +876,14 @@ consing a string.)"
              ;; Do `(forward-word 1)', recognizing non-ASCII characters
              ;; except Latin-1 nbsp as words.
              (while (progn
-                      (skip-chars-forward "^\000-\177 ")
+                      (skip-chars-forward "^\000-\177 ")
                       (and (not (eobp))
                            (eq ?w (char-syntax (char-after)))
                            (progn
                              (forward-word 1)
                              (and (not (eobp))
                                   (> (char-after) ?\177)
-                                  (not (eq (char-after) ? )))))))))
+                                  (not (eq (char-after) ? )))))))))
            (or (eq char ?\()
                ;; At the end of first address of a multiple address header.
                (and (eq char ?,)
diff --git a/lisp/mb-depth.el b/lisp/mb-depth.el
new file mode 100644 (file)
index 0000000..1d125e4
--- /dev/null
@@ -0,0 +1,72 @@
+;;; mb-depth.el --- Indicate minibuffer-depth in prompt
+;;
+;; Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+;;
+;; Author: Miles Bader <miles@gnu.org>
+;; Keywords: convenience
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+;;
+;; Defines the minor mode `minibuffer-indicate-depth-mode'.
+;;
+;; When active, any recursive use of the minibuffer will show
+;; the recursion depth in the minibuffer prompt.  This is only
+;; useful if `enable-recursive-minibuffers' is non-nil.
+
+;;; Code:
+
+;; An overlay covering the prompt.  This is a buffer-local variable in
+;; each affected minibuffer.
+;;
+(defvar minibuf-depth-overlay)
+(make-variable-buffer-local 'minibuf-depth-overlay)
+
+;; This function goes on minibuffer-setup-hook
+(defun minibuf-depth-setup-minibuffer ()
+  "Set up a minibuffer for `minibuffer-indicate-depth-mode'.
+The prompt should already have been inserted."
+  (when (> (minibuffer-depth) 1)
+    (setq minibuf-depth-overlay (make-overlay (point-min) (1+ (point-min))))
+    (overlay-put minibuf-depth-overlay 'before-string
+                (propertize (format "[%d]" (minibuffer-depth))
+                            'face 'highlight))
+    (overlay-put minibuf-depth-overlay 'evaporate t)))
+
+;;;###autoload
+(define-minor-mode minibuffer-indicate-depth-mode
+  "Toggle Minibuffer Indicate Depth mode.
+When active, any recursive use of the minibuffer will show
+the recursion depth in the minibuffer prompt.  This is only
+useful if `enable-recursive-minibuffers' is non-nil.
+
+With prefix argument ARG, turn on if positive, otherwise off.
+Returns non-nil if the new state is enabled."
+  :global t
+  :group 'minibuffer
+  (if minibuffer-indicate-depth-mode
+      ;; Enable the mode
+      (add-hook 'minibuffer-setup-hook 'minibuf-depth-setup-minibuffer)
+    ;; Disable the mode
+    (remove-hook 'minibuffer-setup-hook 'minibuf-depth-setup-minibuffer)))
+
+(provide 'mb-depth)
+
+;; arch-tag: 50224089-5bf5-46f8-803d-18f018c5eacf
+;;; mb-depth.el ends here
index 0c9ff96..8bc0bd8 100644 (file)
@@ -1161,10 +1161,23 @@ mail status in mode line"))
   '("--"))
 
 (defvar vc-menu-map (make-sparse-keymap "Version Control"))
+(defalias 'vc-menu-map vc-menu-map)
 (define-key menu-bar-tools-menu [pcl-cvs]
   '(menu-item "PCL-CVS" cvs-global-menu))
 (define-key menu-bar-tools-menu [vc]
-  (list 'menu-item "Version Control" vc-menu-map))
+  (list 'menu-item "Version Control" vc-menu-map
+  :filter 'menu-bar-vc-filter))
+
+(defun menu-bar-vc-filter (orig-binding)
+  (let ((ext-binding
+   (if vc-mode (vc-call-backend (vc-backend buffer-file-name) 'extra-menu))))
+    ;; Give the VC backend a chance to add menu entries
+    ;; specific for that backend.
+    (if (null ext-binding)
+    orig-binding
+      (append orig-binding
+             '((ext-menu-separator "---"))
+                   ext-binding))))
 
 (define-key menu-bar-tools-menu [separator-compare]
   '("--"))
index f8134b0..b7fe48c 100644 (file)
@@ -7,6 +7,11 @@
 
        * Relicense all FSF files to GPLv3 or later.
 
+2007-07-11  Bill Wohler  <wohler@newt.com>
+
+       * mh-compat.el (mh-display-color-cells): Fix on XEmacs 21.5b28.
+       Thanks to Henrique Martins for the help (closes SF #1749774).
+
 2007-06-06  Juanma Barranquero  <lekktu@gmail.com>
 
        * mh-mime.el (mh-mh-directive-present-p):
index 988ebc4..58c52a5 100644 (file)
@@ -77,13 +77,17 @@ introduced in Emacs 22."
       'cancel-timer
     'delete-itimer))
 
-(defun-mh mh-display-color-cells display-color-cells (&optional display)
+(defun mh-display-color-cells (&optional display)
   "Return the number of color cells supported by DISPLAY.
-This function is used by XEmacs to return 2 when
-`device-color-cells' returns nil. This happens when compiling or
+This function is used by XEmacs to return 2 when `device-color-cells'
+or `display-color-cells' returns nil. This happens when compiling or
 running on a tty and causes errors since `display-color-cells' is
 expected to return an integer."
-  (or (device-color-cells display) 2))
+  (cond ((fboundp 'display-color-cells) ; GNU Emacs, XEmacs 21.5b28
+         (or (display-color-cells display) 2))
+        ((fboundp 'device-color-cells)  ; XEmacs 21.4
+         (or (device-color-cells display) 2))
+        (t 2)))
 
 (defmacro mh-display-completion-list (completions &optional common-substring)
   "Display the list of COMPLETIONS.
index e35bea8..27c5dd9 100644 (file)
@@ -1631,7 +1631,10 @@ regardless of where you click."
   ;; Give temporary modes such as isearch a chance to turn off.
   (run-hooks 'mouse-leave-buffer-hook)
   (or mouse-yank-at-point (mouse-set-point click))
-  (insert (x-get-selection 'SECONDARY)))
+  (let ((secondary (x-get-selection 'SECONDARY)))
+    (if secondary
+        (insert (x-get-selection 'SECONDARY))
+      (error "No secondary selection"))))
 
 (defun mouse-kill-secondary ()
   "Kill the text in the secondary selection.
@@ -1811,27 +1814,23 @@ and selects that window."
   (mouse-minibuffer-check event)
   (let ((buffers (buffer-list))  alist menu split-by-major-mode sum-of-squares)
     ;; Make an alist of elements that look like (MENU-ITEM . BUFFER).
-    (let ((tail buffers))
-      (while tail
-       ;; Divide all buffers into buckets for various major modes.
-       ;; Each bucket looks like (MODE NAMESTRING BUFFERS...).
-       (with-current-buffer (car tail)
-         (let* ((adjusted-major-mode major-mode) elt)
-           (let ((tail mouse-buffer-menu-mode-groups))
-             (while tail
-               (if (string-match (car (car tail)) mode-name)
-                   (setq adjusted-major-mode (cdr (car tail))))
-               (setq tail (cdr tail))))
-           (setq elt (assoc adjusted-major-mode split-by-major-mode))
-           (if (null elt)
-               (setq elt (list adjusted-major-mode
-                               (if (stringp adjusted-major-mode)
-                                   adjusted-major-mode
-                                 mode-name))
-                     split-by-major-mode (cons elt split-by-major-mode)))
-           (or (memq (car tail) (cdr (cdr elt)))
-               (setcdr (cdr elt) (cons (car tail) (cdr (cdr elt)))))))
-       (setq tail (cdr tail))))
+    (dolist (buf buffers)
+      ;; Divide all buffers into buckets for various major modes.
+      ;; Each bucket looks like (MODE NAMESTRING BUFFERS...).
+      (with-current-buffer buf
+        (let* ((adjusted-major-mode major-mode) elt)
+          (dolist (group mouse-buffer-menu-mode-groups)
+            (when (string-match (car group) (format-mode-line mode-name))
+              (setq adjusted-major-mode (cdr group))))
+          (setq elt (assoc adjusted-major-mode split-by-major-mode))
+          (unless elt
+            (setq elt (list adjusted-major-mode
+                            (if (stringp adjusted-major-mode)
+                                adjusted-major-mode
+                                mode-name))
+                  split-by-major-mode (cons elt split-by-major-mode)))
+          (or (memq buf (cdr (cdr elt)))
+              (setcdr (cdr elt) (cons buf (cdr (cdr elt))))))))
     ;; Compute the sum of squares of sizes of the major-mode buckets.
     (let ((tail split-by-major-mode))
       (setq sum-of-squares 0)
index 67835c2..2f06344 100644 (file)
@@ -4132,8 +4132,19 @@ directory, so that Emacs will know its current contents."
                                       (format "Getting %s" fn1))
          tmp1))))
 
-(defun ange-ftp-file-remote-p (file)
-  (ange-ftp-replace-name-component file ""))
+(defun ange-ftp-file-remote-p (file &optional identification connected)
+  (let* ((parsed (ange-ftp-ftp-name file))
+        (host (nth 0 parsed))
+        (user (nth 1 parsed)))
+    (and (or (not connected)
+            (let ((proc (get-process (ange-ftp-ftp-process-buffer host user))))
+              (and proc (processp proc)
+                   (memq (process-status proc) '(run open)))))
+        (cond
+         ((eq identification 'method) (and parsed "ftp"))
+         ((eq identification 'user) user)
+         ((eq identification 'host) host)
+         (t (ange-ftp-replace-name-component file ""))))))
 
 (defun ange-ftp-load (file &optional noerror nomessage nosuffix)
   (if (ange-ftp-ftp-name file)
@@ -4365,7 +4376,10 @@ NEWNAME should be the name to give the new compressed or uncompressed file.")
 ;; This returns nil for any file name as argument.
 (put 'vc-registered 'ange-ftp 'null)
 
-(put 'dired-call-process 'ange-ftp 'ange-ftp-dired-call-process)
+;; We can handle process-file in a restricted way (just for chown).
+;; Nothing possible for start-file-process.
+(put 'process-file 'ange-ftp 'ange-ftp-process-file)
+(put 'start-file-process 'ange-ftp 'ignore)
 (put 'shell-command 'ange-ftp 'ange-ftp-shell-command)
 \f
 ;;; Define ways of getting at unmodified Emacs primitives,
@@ -4528,8 +4542,8 @@ NEWNAME should be the name to give the new compressed or uncompressed file.")
       ;; default-directory is in ange-ftp syntax for remote file names.
       (ange-ftp-real-shell-command command output-buffer error-buffer))))
 
-;;; This is the handler for call-process.
-(defun ange-ftp-dired-call-process (program discard &rest arguments)
+;;; This is the handler for process-file.
+(defun ange-ftp-process-file (program infile buffer display &rest arguments)
   ;; PROGRAM is always one of those below in the cond in dired.el.
   ;; The ARGUMENTS are (nearly) always files.
   (if (ange-ftp-ftp-name default-directory)
@@ -4549,7 +4563,7 @@ NEWNAME should be the name to give the new compressed or uncompressed file.")
                   1)
        (error (insert (format "%s\n" (nth 1 oops)))
               1))
-    (apply 'call-process program nil (not discard) nil arguments)))
+    (apply 'call-process program infile buffer display arguments)))
 
 ;; Handle an attempt to run chmod on a remote file
 ;; by using the ftp chmod command.
index 66786a4..14fda44 100644 (file)
   :link '(custom-manual "(rcirc)")
   :group 'applications)
 
-(defcustom rcirc-default-server "irc.freenode.net"
-  "The default server to connect to."
-  :type 'string
+(defcustom rcirc-server-alist
+  '(("irc.freenode.net" :channels ("#rcirc")))
+  "An alist of IRC connections to establish when running `rcirc'.
+Each element looks like (SERVER-NAME PARAMETERS).
+
+SERVER-NAME is a string describing the server to connect
+to.
+
+The optional PARAMETERS come in pairs PARAMETER VALUE.
+
+The following parameters are recognized:
+
+`:nick'
+
+VALUE must be a string.  If absent, `rcirc-default-nick' is used
+for this connection.
+
+`:port'
+
+VALUE must be a number or string.  If absent,
+`rcirc-default-port' is used.
+
+`:user-name'
+
+VALUE must be a string.  If absent, `rcirc-default-user-name' is
+used.
+
+`:full-name'
+
+VALUE must be a string.  If absent, `rcirc-default-full-name' is
+used.
+
+`:channels'
+
+VALUE must be a list of strings describing which channels to join
+when connecting to this server.  If absent, no channels will be
+connected to automatically."
+  :type '(alist :key-type string
+               :value-type (plist :options ((nick string)
+                                            (port integer)
+                                            (user-name string)
+                                            (full-name string)
+                                            (channels (repeat string)))))
   :group 'rcirc)
 
 (defcustom rcirc-default-port 6667
   :type 'string
   :group 'rcirc)
 
-(defcustom rcirc-default-user-full-name (if (string= (user-full-name) "")
-                                           rcirc-default-user-name
-                                         (user-full-name))
+(defcustom rcirc-default-full-name (if (string= (user-full-name) "")
+                                      rcirc-default-user-name
+                                    (user-full-name))
   "The full name sent to the server when connecting."
   :type 'string
   :group 'rcirc)
 
-(defcustom rcirc-startup-channels-alist '(("^irc.freenode.net$" "#rcirc"))
-  "Alist of channels to join at startup.
-Each element looks like (SERVER-REGEXP . CHANNEL-LIST)."
-  :type '(alist :key-type string :value-type (repeat string))
-  :group 'rcirc)
-
 (defcustom rcirc-fill-flag t
   "*Non-nil means line-wrap messages printed in channel buffers."
   :type 'boolean
@@ -95,11 +129,9 @@ Each element looks like (SERVER-REGEXP . CHANNEL-LIST)."
 
 (defcustom rcirc-fill-column nil
   "*Column beyond which automatic line-wrapping should happen.
-If nil, use value of `fill-column'.
-If `window-width', use the window's width as maximum.
-If `frame-width', use the frame's width as maximum."
+If nil, use value of `fill-column'.  If 'frame-width, use the
+maximum frame width."
   :type '(choice (const :tag "Value of `fill-column'")
-                (const :tag "Full window width" window-width)
                 (const :tag "Full frame width" frame-width)
                 (integer :tag "Number of columns"))
   :group 'rcirc)
@@ -120,6 +152,11 @@ underneath each nick."
   "If non-nil, activity in this buffer is considered low priority.")
 (make-variable-buffer-local 'rcirc-low-priority-flag)
 
+(defvar rcirc-omit-mode nil
+  "Non-nil if Rcirc-Omit mode is enabled.
+Use the command `rcirc-omit-mode' to change this variable.")
+(make-variable-buffer-local 'rcirc-omit-mode)
+
 (defcustom rcirc-time-format "%H:%M "
   "*Describes how timestamps are printed.
 Used as the first arg to `format-time-string'."
@@ -145,7 +182,8 @@ number.  If zero or nil, no truncating is done."
   :group 'rcirc)
 
 (defcustom rcirc-scroll-show-maximum-output t
-  "*If non-nil, scroll buffer to keep the point at the bottom of the window."
+  "*If non-nil, scroll buffer to keep the point at the bottom of
+the window."
   :type 'boolean
   :group 'rcirc)
 
@@ -319,36 +357,69 @@ and the cdr part is used for encoding."
 (defconst rcirc-id-string (concat "rcirc on GNU Emacs " emacs-version))
 \f
 (defvar rcirc-startup-channels nil)
+
 ;;;###autoload
 (defun rcirc (arg)
-  "Connect to IRC.
-If ARG is non-nil, prompt for a server to connect to."
+  "Connect to all servers in `rcirc-server-alist'.
+
+Do not connect to a server if it is already connected.
+
+If ARG is non-nil, instead prompt for connection parameters."
   (interactive "P")
   (if arg
-      (let* ((server (read-string "IRC Server: " rcirc-default-server))
-            (port (read-string "IRC Port: " (number-to-string rcirc-default-port)))
-            (nick (read-string "IRC Nick: " rcirc-default-nick))
+      (let* ((server (completing-read "IRC Server: "
+                                     rcirc-server-alist
+                                     nil nil
+                                     (caar rcirc-server-alist)))
+            (server-plist (cdr (assoc-string server rcirc-server-alist)))
+            (port (read-string "IRC Port: "
+                               (number-to-string
+                                (or (plist-get server-plist 'port)
+                                    rcirc-default-port))))
+            (nick (read-string "IRC Nick: "
+                               (or (plist-get server-plist 'nick)
+                                   rcirc-default-nick)))
             (channels (split-string
                        (read-string "IRC Channels: "
-                                    (mapconcat 'identity (rcirc-startup-channels server) " "))
+                                    (mapconcat 'identity
+                                               (plist-get server-plist
+                                                          'channels)
+                                               " "))
                        "[, ]+" t)))
-       (rcirc-connect server port nick rcirc-default-user-name rcirc-default-user-full-name
+       (rcirc-connect server port nick rcirc-default-user-name
+                      rcirc-default-full-name
                       channels))
-    ;; make new connection using defaults unless already connected to
-    ;; the default rcirc-server
-    (let (connected)
-      (dolist (p (rcirc-process-list))
-       (when (string= rcirc-default-server (process-name p))
-         (setq connected p)))
-      (if (not connected)
-         (rcirc-connect rcirc-default-server rcirc-default-port
-                        rcirc-default-nick rcirc-default-user-name
-                        rcirc-default-user-full-name
-                        (rcirc-startup-channels rcirc-default-server))
-       (switch-to-buffer (process-buffer connected))
-       (message "Connected to %s"
-                (process-contact (get-buffer-process (current-buffer))
-                                 :host))))))
+    ;; connect to servers in `rcirc-server-alist'
+    (let (connected-servers)
+      (dolist (c rcirc-server-alist)
+       (let ((server (car c))
+             (nick (or (plist-get (cdr c) :nick) rcirc-default-nick))
+             (port (or (plist-get (cdr c) :port) rcirc-default-port))
+             (user-name (or (plist-get (cdr c) :user-name)
+                            rcirc-default-user-name))
+             (full-name (or (plist-get (cdr c) :full-name)
+                            rcirc-default-full-name))
+             (channels (plist-get (cdr c) :channels)))
+         (when server
+           (let (connected)
+             (dolist (p (rcirc-process-list))
+               (when (string= server (process-name p))
+                 (setq connected p)))
+             (if (not connected)
+                 (condition-case e
+                     (rcirc-connect server port nick user-name
+                                    full-name channels)
+                   (quit (message "Quit connecting to %s" server)))
+               (with-current-buffer (process-buffer connected)
+                 (setq connected-servers
+                       (cons (process-contact (get-buffer-process
+                                               (current-buffer)) :host)
+                             connected-servers))))))))
+      (when connected-servers
+       (message "Already connected to %s"
+                (concat (mapconcat 'identity (butlast connected-servers) ", ")
+                        ", and " (car (last connected-servers))))))))
+
 ;;;###autoload
 (defalias 'irc 'rcirc)
 
@@ -365,7 +436,8 @@ If ARG is non-nil, prompt for a server to connect to."
 (defvar rcirc-process nil)
 
 ;;;###autoload
-(defun rcirc-connect (&optional server port nick user-name full-name startup-channels)
+(defun rcirc-connect (server &optional port nick user-name full-name
+                            startup-channels)
   (save-excursion
     (message "Connecting to %s..." server)
     (let* ((inhibit-eol-conversion)
@@ -374,10 +446,9 @@ If ARG is non-nil, prompt for a server to connect to."
                                (string-to-number port)
                              port)
                          rcirc-default-port))
-          (server (or server rcirc-default-server))
           (nick (or nick rcirc-default-nick))
           (user-name (or user-name rcirc-default-user-name))
-          (full-name (or full-name rcirc-default-user-full-name))
+          (full-name (or full-name rcirc-default-full-name))
           (startup-channels startup-channels)
            (process (make-network-process :name server :host server :service port-number)))
       ;; set up process
@@ -412,6 +483,8 @@ If ARG is non-nil, prompt for a server to connect to."
       (make-local-variable 'rcirc-connecting)
       (setq rcirc-connecting t)
 
+      (add-hook 'auto-save-hook 'rcirc-log-write)
+
       ;; identify
       (rcirc-send-string process (concat "NICK " nick))
       (rcirc-send-string process (concat "USER " user-name
@@ -446,12 +519,21 @@ last ping."
       (mapc (lambda (process)
              (with-rcirc-process-buffer process
                (when (not rcirc-connecting)
-                 (rcirc-send-string process (concat "PING " (rcirc-server-name process))))))
+                 (rcirc-send-string process
+                                    (format "PRIVMSG %s :\C-aKEEPALIVE %f\C-a"
+                                            rcirc-nick
+                                            (time-to-seconds
+                                             (current-time)))))))
             (rcirc-process-list))
     ;; no processes, clean up timer
     (cancel-timer rcirc-keepalive-timer)
     (setq rcirc-keepalive-timer nil)))
 
+(defun rcirc-handler-ctcp-KEEPALIVE (process target sender message)
+  (with-rcirc-process-buffer process
+    (setq header-line-format (format "%f" (- (time-to-seconds (current-time))
+                                            (string-to-number message))))))
+
 (defvar rcirc-debug-buffer " *rcirc debug*")
 (defvar rcirc-debug-flag nil
   "If non-nil, write information to `rcirc-debug-buffer'.")
@@ -461,14 +543,13 @@ Debug text is written to `rcirc-debug-buffer' if `rcirc-debug-flag'
 is non-nil."
   (when rcirc-debug-flag
     (save-excursion
-      (save-window-excursion
-        (set-buffer (get-buffer-create rcirc-debug-buffer))
-        (goto-char (point-max))
-        (insert (concat
-                 "["
-                 (format-time-string "%Y-%m-%dT%T ") (process-name process)
-                 "] "
-                 text))))))
+      (set-buffer (get-buffer-create rcirc-debug-buffer))
+      (goto-char (point-max))
+      (insert (concat
+              "["
+              (format-time-string "%Y-%m-%dT%T ") (process-name process)
+              "] "
+              text)))))
 
 (defvar rcirc-sentinel-hooks nil
   "Hook functions called when the process sentinel is called.
@@ -486,12 +567,16 @@ Functions are called with PROCESS and SENTINEL arguments.")
                               (process-name process)
                               sentinel
                               (process-status process)) (not rcirc-target))
-         ;; remove the prompt from buffers
-         (let ((inhibit-read-only t))
-           (delete-region rcirc-prompt-start-marker
-                          rcirc-prompt-end-marker))))
+         (rcirc-disconnect-buffer)))
       (run-hook-with-args 'rcirc-sentinel-hooks process sentinel))))
 
+(defun rcirc-disconnect-buffer (&optional buffer)
+  (with-current-buffer (or buffer (current-buffer))
+    ;; set rcirc-target to nil for each channel so cleanup
+    ;; doesnt happen when we reconnect
+    (setq rcirc-target nil)
+    (setq mode-line-process ":disconnected")))
+
 (defun rcirc-process-list ()
   "Return a list of rcirc processes."
   (let (ps)
@@ -530,7 +615,6 @@ Function is called with PROCESS, COMMAND, SENDER, ARGS and LINE.")
                                               process))))))
 
 (defun rcirc-delete-process (process)
-  (message "delete process %S" process)
   (delete-process process))
 
 (defvar rcirc-trap-errors-flag t)
@@ -593,7 +677,8 @@ With no argument or nil as argument, use the current buffer."
 (defun rcirc-server-name (process)
   "Return PROCESS server name, given by the 001 response."
   (with-rcirc-process-buffer process
-    (or rcirc-server-name rcirc-default-server)))
+    (or rcirc-server-name
+       (warn "server name for process %S unknown" process))))
 
 (defun rcirc-nick (process)
   "Return PROCESS nick."
@@ -610,9 +695,10 @@ With no argument or nil as argument, use the current buffer."
 (defvar rcirc-max-message-length 420
   "Messages longer than this value will be split.")
 
-(defun rcirc-send-message (process target message &optional noticep)
+(defun rcirc-send-message (process target message &optional noticep silent)
   "Send TARGET associated with PROCESS a privmsg with text MESSAGE.
-If NOTICEP is non-nil, send a notice instead of privmsg."
+If NOTICEP is non-nil, send a notice instead of privmsg.
+If SILENT is non-nil, do not print the message in any irc buffer."
   ;; max message length is 512 including CRLF
   (let* ((response (if noticep "NOTICE" "PRIVMSG"))
          (oversize (> (length message) rcirc-max-message-length))
@@ -625,8 +711,9 @@ If NOTICEP is non-nil, send a notice instead of privmsg."
          (more (if oversize
                    (substring message rcirc-max-message-length))))
     (rcirc-get-buffer-create process target)
-    (rcirc-print process (rcirc-nick process) response target text)
     (rcirc-send-string process (concat response " " target " :" text))
+    (unless silent
+      (rcirc-print process (rcirc-nick process) response target text))
     (when more (rcirc-send-message process target more noticep))))
 
 (defvar rcirc-input-ring nil)
@@ -711,7 +798,7 @@ If NOTICEP is non-nil, send a notice instead of privmsg."
 (define-key rcirc-mode-map (kbd "C-c C-d") 'rcirc-cmd-mode)
 (define-key rcirc-mode-map (kbd "C-c C-m") 'rcirc-cmd-msg)
 (define-key rcirc-mode-map (kbd "C-c C-r") 'rcirc-cmd-nick) ; rename
-(define-key rcirc-mode-map (kbd "C-c C-o") 'rcirc-cmd-oper)
+(define-key rcirc-mode-map (kbd "C-c C-o") 'rcirc-omit-mode)
 (define-key rcirc-mode-map (kbd "C-c C-p") 'rcirc-cmd-part)
 (define-key rcirc-mode-map (kbd "C-c C-q") 'rcirc-cmd-query)
 (define-key rcirc-mode-map (kbd "C-c C-t") 'rcirc-cmd-topic)
@@ -737,6 +824,10 @@ If NOTICEP is non-nil, send a notice instead of privmsg."
 
 (defvar rcirc-last-post-time nil)
 
+(defvar rcirc-log-alist nil
+  "Alist of lines to log to disk when `rcirc-log-flag' is non-nil.
+Each element looks like (FILENAME . TEXT).")
+
 (defun rcirc-mode (process target)
   "Major mode for IRC channel buffers.
 
@@ -745,6 +836,7 @@ If NOTICEP is non-nil, send a notice instead of privmsg."
   (use-local-map rcirc-mode-map)
   (setq mode-name "rcirc")
   (setq major-mode 'rcirc-mode)
+  (setq mode-line-process nil)
 
   (make-local-variable 'rcirc-input-ring)
   (setq rcirc-input-ring (make-ring rcirc-input-ring-size))
@@ -756,6 +848,8 @@ If NOTICEP is non-nil, send a notice instead of privmsg."
   (setq rcirc-topic nil)
   (make-local-variable 'rcirc-last-post-time)
   (setq rcirc-last-post-time (current-time))
+  (make-local-variable 'fill-paragraph-function)
+  (setq fill-paragraph-function 'rcirc-fill-paragraph)
 
   (make-local-variable 'rcirc-short-buffer-name)
   (setq rcirc-short-buffer-name nil)
@@ -785,6 +879,8 @@ If NOTICEP is non-nil, send a notice instead of privmsg."
   (setq overlay-arrow-position (make-marker))
   (set-marker overlay-arrow-position nil)
 
+  (setq buffer-invisibility-spec '(rcirc-ignored-user))
+
   ;; if the user changes the major mode or kills the buffer, there is
   ;; cleanup work to do
   (add-hook 'change-major-mode-hook 'rcirc-change-major-mode-hook nil t)
@@ -873,14 +969,16 @@ If ALL is non-nil, update prompts in all IRC buffers."
        (when rcirc-target
          (rcirc-remove-nick-channel (rcirc-buffer-process)
                                     (rcirc-buffer-nick)
-                                    rcirc-target))))))
+                                    rcirc-target))))
+    (setq rcirc-target nil)))
 
 (defun rcirc-generate-new-buffer-name (process target)
   "Return a buffer name based on PROCESS and TARGET.
 This is used for the initial name given to IRC buffers."
-  (if target
-      (concat target "@" (process-name process))
-    (concat "*" (process-name process) "*")))
+  (substring-no-properties
+   (if target
+       (concat target "@" (process-name process))
+     (concat "*" (process-name process) "*"))))
 
 (defun rcirc-get-buffer (process target &optional server)
   "Return the buffer associated with the PROCESS and TARGET.
@@ -902,14 +1000,14 @@ Create the buffer if it doesn't exist."
          (when (not rcirc-target)
            (setq rcirc-target target))
          buffer)
-       ;; create the buffer
-       (with-rcirc-process-buffer process
-         (let ((new-buffer (get-buffer-create
-                            (rcirc-generate-new-buffer-name process target))))
-           (with-current-buffer new-buffer
-             (rcirc-mode process target))
-           (rcirc-put-nick-channel process (rcirc-nick process) target)
-           new-buffer)))))
+      ;; create the buffer
+      (with-rcirc-process-buffer process
+       (let ((new-buffer (get-buffer-create
+                          (rcirc-generate-new-buffer-name process target))))
+         (with-current-buffer new-buffer
+           (rcirc-mode process target))
+         (rcirc-put-nick-channel process (rcirc-nick process) target)
+         new-buffer)))))
 
 (defun rcirc-send-input ()
   "Send input to target associated with the current buffer."
@@ -943,6 +1041,14 @@ Create the buffer if it doesn't exist."
          (ring-insert rcirc-input-ring input)
          (setq rcirc-input-ring-index 0))))))
 
+(defun rcirc-fill-paragraph (&optional arg)
+  (interactive "p")
+  (when (> (point) rcirc-prompt-end-marker)
+    (save-restriction
+      (narrow-to-region rcirc-prompt-end-marker (point-max))
+      (let ((fill-column rcirc-max-message-length))
+       (fill-region (point-min) (point-max))))))
+
 (defun rcirc-process-input-line (line)
   (if (string-match "^/\\([^ ]+\\) ?\\(.*\\)$" line)
       (rcirc-process-command (match-string 1 line)
@@ -1021,7 +1127,6 @@ Create the buffer if it doesn't exist."
 (defun rcirc-multiline-minor-submit ()
   "Send the text in buffer back to parent buffer."
   (interactive)
-  (assert rcirc-parent-buffer)
   (untabify (point-min) (point-max))
   (let ((text (buffer-substring (point-min) (point-max)))
         (buffer (current-buffer))
@@ -1052,12 +1157,12 @@ Create the buffer if it doesn't exist."
        (process-buffer process)))))
 
 (defcustom rcirc-response-formats
-  '(("PRIVMSG" . "%T<%N> %m")
-    ("NOTICE"  . "%T-%N- %m")
-    ("ACTION"  . "%T[%N %m]")
-    ("COMMAND" . "%T%m")
-    ("ERROR"   . "%T%fw!!! %m")
-    (t         . "%T%fp*** %fs%n %r %m"))
+  '(("PRIVMSG" . "<%N> %m")
+    ("NOTICE"  . "-%N- %m")
+    ("ACTION"  . "[%N %m]")
+    ("COMMAND" . "%m")
+    ("ERROR"   . "%fw!!! %m")
+    (t         . "%fp*** %fs%n %r %m"))
   "An alist of formats used for printing responses.
 The format is looked up using the response-type as a key;
 if no match is found, the default entry (with a key of `t') is used.
@@ -1069,7 +1174,6 @@ the of the following escape sequences replaced by the described values:
   %n        The sender's nick
   %N        The sender's nick (with face `rcirc-my-nick' or `rcirc-other-nick')
   %r        The response-type
-  %T        The timestamp (with face `rcirc-timestamp')
   %t        The target
   %fw       Following text uses the face `font-lock-warning-face'
   %fp       Following text uses the face `rcirc-server-prefix'
@@ -1082,92 +1186,67 @@ the of the following escape sequences replaced by the described values:
                :value-type string)
   :group 'rcirc)
 
+(defcustom rcirc-omit-responses
+  '("JOIN" "PART" "QUIT")
+  "Responses which will be hidden when `rcirc-omit-mode' is enabled."
+  :type '(repeat string)
+  :group 'rcirc)
+
 (defun rcirc-format-response-string (process sender response target text)
   "Return a nicely-formatted response string, incorporating TEXT
 \(and perhaps other arguments).  The specific formatting used
 is found by looking up RESPONSE in `rcirc-response-formats'."
-  (let ((chunks
-        (split-string (or (cdr (assoc response rcirc-response-formats))
-                          (cdr (assq t rcirc-response-formats)))
-                      "%"))
-       (sender (or sender ""))
-       (result "")
-       (face nil)
-       key face-key repl)
-    (when (equal (car chunks) "")
-      (pop chunks))
-    (dolist (chunk chunks)
-      (if (equal chunk "")
-         (setq key ?%)
-       (setq key (aref chunk 0))
-       (setq chunk (substring chunk 1)))
-      (setq repl
-           (cond ((eq key ?%)
-                  ;; %% -- literal % character
-                  "%")
-                 ((or (eq key ?n) (eq key ?N))
-                  ;; %n/%N -- nick
-                  (let ((nick (concat (if (string= (rcirc-server-name process)
-                                                   sender)
-                                          ""
-                                        sender)
-                                      (and target (concat "," target)))))
-                    (rcirc-facify nick
-                                  (if (eq key ?n)
-                                      face
-                                    (cond ((string= sender (rcirc-nick process))
-                                           'rcirc-my-nick)
-                                          ((and rcirc-bright-nicks
-                                                (string-match
-                                                 (regexp-opt rcirc-bright-nicks)
-                                                 sender))
-                                           'rcirc-bright-nick)
-                                          ((and rcirc-dim-nicks
-                                                (string-match
-                                                 (regexp-opt rcirc-dim-nicks)
-                                                 sender))
-                                           'rcirc-dim-nick)
-                                          (t
-                                           'rcirc-other-nick))))))
-                  ((eq key ?T)
-                  ;; %T -- timestamp
-                  (rcirc-facify
-                   (format-time-string rcirc-time-format (current-time))
-                   'rcirc-timestamp))
-                 ((eq key ?m)
-                  ;; %m -- message text
-                  (rcirc-markup-text process sender response (rcirc-facify text face)))
-                 ((eq key ?t)
-                  ;; %t -- target
-                  (rcirc-facify (or rcirc-target "") face))
-                 ((eq key ?r)
-                  ;; %r -- response
-                  (rcirc-facify response face))
-                 ((eq key ?f)
-                  ;; %f -- change face
-                  (setq face-key (aref chunk 0))
-                  (setq chunk (substring chunk 1))
-                  (cond ((eq face-key ?w)
-                         ;; %fw -- warning face
-                         (setq face 'font-lock-warning-face))
-                        ((eq face-key ?p)
-                         ;; %fp -- server-prefix face
-                         (setq face 'rcirc-server-prefix))
-                        ((eq face-key ?s)
-                         ;; %fs -- warning face
-                         (setq face 'rcirc-server))
-                        ((eq face-key ?-)
-                         ;; %fs -- warning face
-                         (setq face nil))
-                        ((and (eq face-key ?\[)
-                              (string-match "^\\([^]]*\\)[]]" chunk)
-                              (facep (match-string 1 chunk)))
-                         ;; %f[...] -- named face
-                         (setq face (intern (match-string 1 chunk)))
-                         (setq chunk (substring chunk (match-end 0)))))
-                  "")))
-      (setq result (concat result repl (rcirc-facify chunk face))))
-    result))
+  (with-temp-buffer
+    (insert (or (cdr (assoc response rcirc-response-formats))
+               (cdr (assq t rcirc-response-formats))))
+    (goto-char (point-min))
+    (let ((start (point-min))
+         (sender (if (or (not sender)
+                         (string= (rcirc-server-name process) sender))
+                     ""
+                   sender))
+         face)
+      (while (re-search-forward "%\\(\\(f\\(.\\)\\)\\|\\(.\\)\\)" nil t)
+       (rcirc-add-face start (match-beginning 0) face)
+       (setq start (match-beginning 0))
+       (replace-match
+        (case (aref (match-string 1) 0)
+           (?f (setq face
+                     (case (string-to-char (match-string 3))
+                       (?w 'font-lock-warning-face)
+                       (?p 'rcirc-server-prefix)
+                       (?s 'rcirc-server)
+                       (t nil)))
+               "")
+           (?n sender)
+           (?N (let ((my-nick (rcirc-nick process)))
+                 (save-match-data
+                   (with-syntax-table rcirc-nick-syntax-table
+                     (rcirc-facify sender
+                                   (cond ((string= sender my-nick)
+                                          'rcirc-my-nick)
+                                         ((and rcirc-bright-nicks
+                                               (string-match
+                                                (regexp-opt rcirc-bright-nicks
+                                                            'words)
+                                                sender))
+                                          'rcirc-bright-nick)
+                                         ((and rcirc-dim-nicks
+                                               (string-match
+                                                (regexp-opt rcirc-dim-nicks
+                                                            'words)
+                                                sender))
+                                          'rcirc-dim-nick)
+                                         (t
+                                          'rcirc-other-nick)))))))
+           (?m (propertize text 'rcirc-text text))
+           (?r response)
+           (?t (or target ""))
+           (t (concat "UNKNOWN CODE:" (match-string 0))))
+        t t nil 0)
+       (rcirc-add-face (match-beginning 0) (match-end 0) face))
+      (rcirc-add-face start (match-beginning 0) face))
+      (buffer-substring (point-min) (point-max))))
 
 (defun rcirc-target-buffer (process sender response target text)
   "Return a buffer to print the server response."
@@ -1177,7 +1256,8 @@ is found by looking up RESPONSE in `rcirc-response-formats'."
           (rcirc-any-buffer process))
          ((not (rcirc-channel-p target))
           ;; message from another user
-          (if (string= response "PRIVMSG")
+          (if (or (string= response "PRIVMSG")
+                  (string= response "ACTION"))
               (rcirc-get-buffer-create process (if (string= sender rcirc-nick)
                                                    target
                                                  sender))
@@ -1190,16 +1270,28 @@ is found by looking up RESPONSE in `rcirc-response-formats'."
 (defvar rcirc-last-sender nil)
 (make-variable-buffer-local 'rcirc-last-sender)
 
+(defcustom rcirc-log-directory "~/.emacs.d/rcirc-log"
+  "Directory to keep IRC logfiles."
+  :type 'directory
+  :group 'rcirc)
+
+(defcustom rcirc-log-flag nil
+  "Non-nil means log IRC activity to disk.
+Logfiles are kept in `rcirc-log-directory'."
+  :type 'boolean
+  :group 'rcirc)
+
 (defun rcirc-print (process sender response target text &optional activity)
   "Print TEXT in the buffer associated with TARGET.
 Format based on SENDER and RESPONSE.  If ACTIVITY is non-nil,
 record activity."
   (or text (setq text ""))
-  (unless (or (member sender rcirc-ignore-list)
-             (member (with-syntax-table rcirc-nick-syntax-table
-                       (when (string-match "^\\([^/]\\w*\\)[:,]" text)
-                         (match-string 1 text)))
-                     rcirc-ignore-list))
+  (unless (and (or (member sender rcirc-ignore-list)
+                  (member (with-syntax-table rcirc-nick-syntax-table
+                            (when (string-match "^\\([^/]\\w*\\)[:,]" text)
+                              (match-string 1 text)))
+                          rcirc-ignore-list))
+              (not (string= sender (rcirc-nick process))))
     (let* ((buffer (rcirc-target-buffer process sender response target text))
           (inhibit-read-only t))
       (with-current-buffer buffer
@@ -1212,7 +1304,8 @@ record activity."
            (setq text (decode-coding-string text rcirc-decode-coding-system))
            ;; mark the line with overlay arrow
            (unless (or (marker-position overlay-arrow-position)
-                       (get-buffer-window (current-buffer)))
+                       (get-buffer-window (current-buffer))
+                       (member response rcirc-omit-responses))
              (set-marker overlay-arrow-position
                          (marker-position rcirc-prompt-start-marker))))
 
@@ -1222,44 +1315,40 @@ record activity."
          (set-marker-insertion-type rcirc-prompt-start-marker t)
          (set-marker-insertion-type rcirc-prompt-end-marker t)
 
-         (let ((fmted-text
-                (rcirc-format-response-string process sender response nil
-                                              text)))
-
-           (insert fmted-text (propertize "\n" 'hard t))
-           (set-marker-insertion-type rcirc-prompt-start-marker nil)
-           (set-marker-insertion-type rcirc-prompt-end-marker nil)
-
-           (let ((text-start (make-marker)))
-             (set-marker text-start
-                         (or (next-single-property-change fill-start
-                                                          'rcirc-text)
-                             rcirc-prompt-end-marker))
-             ;; squeeze spaces out of text before rcirc-text
-             (fill-region fill-start (1- text-start))
-
-             ;; fill the text we just inserted, maybe
-             (when (and rcirc-fill-flag
-                        (not (string= response "372"))) ;/motd
-               (let ((fill-prefix
-                      (or rcirc-fill-prefix
-                          (make-string (- text-start fill-start) ?\s)))
-                     (fill-column (cond ((eq rcirc-fill-column 'frame-width)
-                                         (1- (frame-width)))
-                                        ((eq rcirc-fill-column 'window-width)
-                                         (1- (window-width)))
-                                        (rcirc-fill-column
-                                         rcirc-fill-column)
-                                        (t fill-column))))
-                 (fill-region fill-start rcirc-prompt-start-marker 'left t)))))
-
-         ;; set inserted text to be read-only
-         (when rcirc-read-only-flag
-           (put-text-property rcirc-prompt-start-marker fill-start 'read-only t)
-           (let ((inhibit-read-only t))
-             (put-text-property rcirc-prompt-start-marker fill-start
-                                'front-sticky t)
-             (put-text-property (1- (point)) (point) 'rear-nonsticky t)))
+         (let ((start (point)))
+           (insert (rcirc-format-response-string process sender response nil
+                                                 text)
+                   (propertize "\n" 'hard t))
+
+           ;; squeeze spaces out of text before rcirc-text
+           (fill-region fill-start
+                        (1- (or (next-single-property-change fill-start
+                                                             'rcirc-text)
+                                rcirc-prompt-end-marker)))
+
+           ;; run markup functions
+           (save-excursion
+             (save-restriction
+               (narrow-to-region start rcirc-prompt-start-marker)
+               (goto-char (or (next-single-property-change start 'rcirc-text)
+                              (point)))
+               (when (rcirc-buffer-process)
+                 (save-excursion (rcirc-markup-timestamp sender response))
+                 (dolist (fn rcirc-markup-text-functions)
+                   (save-excursion (funcall fn sender response)))
+                 (save-excursion (rcirc-markup-fill sender response)))
+
+               (when rcirc-read-only-flag
+                 (add-text-properties (point-min) (point-max)
+                                      '(read-only t front-sticky t))))
+             ;; make text omittable
+             (when (and (member response rcirc-omit-responses)
+                        (> start (point-min)))
+               (put-text-property (1- start) (1- rcirc-prompt-start-marker)
+                                  'invisible 'rcirc-omit))))
+
+         (set-marker-insertion-type rcirc-prompt-start-marker nil)
+         (set-marker-insertion-type rcirc-prompt-end-marker nil)
 
          ;; truncate buffer if it is very long
          (save-excursion
@@ -1275,27 +1364,26 @@ record activity."
                                         (window-buffer w))
                                     (>= (window-point w)
                                         rcirc-prompt-end-marker))
-                           (set-window-point w (point-max))))
+                             (set-window-point w (point-max))))
                        nil t)
 
          ;; restore the point
          (goto-char (if moving rcirc-prompt-end-marker old-point))
 
-        ;; keep window on bottom line if it was already there
+         ;; keep window on bottom line if it was already there
          (when rcirc-scroll-show-maximum-output
            (walk-windows (lambda (w)
                            (when (eq (window-buffer w) (current-buffer))
                              (with-current-buffer (window-buffer w)
                                (when (eq major-mode 'rcirc-mode)
                                  (with-selected-window w
-                                   (when (<= (- (window-height)
-                                                (count-screen-lines
-                                                 (window-point)
-                                                 (window-start))
+                                   (when (<= (- (window-height)
+                                                (count-screen-lines (window-point)
+                                                                    (window-start))
                                                 1)
                                              0)
                                      (recenter -1)))))))
-                         nil t))
+                                 nil t))
 
          ;; flush undo (can we do something smarter here?)
          (buffer-disable-undo)
@@ -1305,22 +1393,45 @@ record activity."
        (when (and activity
                   (not rcirc-ignore-buffer-activity-flag)
                   (not (and rcirc-dim-nicks sender
-                            (string-match (regexp-opt rcirc-dim-nicks) sender))))
+                            (string-match (regexp-opt rcirc-dim-nicks) sender)
+                            (rcirc-channel-p target))))
              (rcirc-record-activity (current-buffer)
                                     (when (not (rcirc-channel-p rcirc-target))
                                       'nick)))
 
+       (when rcirc-log-flag
+         (rcirc-log process sender response target text))
+
        (sit-for 0)                     ; displayed text before hook
        (run-hook-with-args 'rcirc-print-hooks
                            process sender response target text)))))
 
-(defun rcirc-startup-channels (server)
-  "Return the list of startup channels for SERVER."
-  (let (channels)
-    (dolist (i rcirc-startup-channels-alist)
-      (if (string-match (car i) server)
-          (setq channels (append channels (cdr i)))))
-    channels))
+(defun rcirc-log (process sender response target text)
+  "Record line in `rcirc-log', to be later written to disk."
+  (let* ((filename (rcirc-generate-new-buffer-name process target))
+        (cell (assoc-string filename rcirc-log-alist))
+        (line (concat (format-time-string rcirc-time-format)
+                      (substring-no-properties
+                       (rcirc-format-response-string process sender
+                                                     response target text))
+                      "\n")))
+    (if cell
+       (setcdr cell (concat (cdr cell) line))
+      (setq rcirc-log-alist
+           (cons (cons filename line) rcirc-log-alist)))))
+
+(defun rcirc-log-write ()
+  "Flush `rcirc-log-alist' data to disk.
+
+Log data is written to `rcirc-log-directory'."
+  (make-directory rcirc-log-directory t)
+  (dolist (cell rcirc-log-alist)
+    (with-temp-buffer
+      (insert (cdr cell))
+      (write-region (point-min) (point-max)
+                   (concat rcirc-log-directory "/" (car cell))
+                   t 'quiet)))
+  (setq rcirc-log-alist nil))
 
 (defun rcirc-join-channels (process channels)
   "Join CHANNELS."
@@ -1437,6 +1548,9 @@ if NICK is also on `rcirc-ignore-list-automatic'."
 (or (assq 'rcirc-low-priority-flag minor-mode-alist)
     (setq minor-mode-alist
           (cons '(rcirc-low-priority-flag " LowPri") minor-mode-alist)))
+(or (assq 'rcirc-omit-mode minor-mode-alist)
+    (setq minor-mode-alist
+          (cons '(rcirc-omit-mode " Omit") minor-mode-alist)))
 
 (defun rcirc-toggle-ignore-buffer-activity ()
   "Toggle the value of `rcirc-ignore-buffer-activity-flag'."
@@ -1458,48 +1572,59 @@ if NICK is also on `rcirc-ignore-list-automatic'."
             "Activity in this buffer is normal priority"))
   (force-mode-line-update))
 
-(defvar rcirc-switch-to-buffer-function 'switch-to-buffer
-  "Function to use when switching buffers.
-Possible values are `switch-to-buffer', `pop-to-buffer', and
-`display-buffer'.")
+(defun rcirc-omit-mode ()
+  "Toggle the Rcirc-Omit mode.
+If enabled, \"uninteresting\" lines are not shown.
+Uninteresting lines are those whose responses are listed in
+`rcirc-omit-responses'."
+  (interactive)
+  (setq rcirc-omit-mode (not rcirc-omit-mode))
+  (let ((line (1- (count-screen-lines (point) (window-start)))))
+    (if rcirc-omit-mode
+       (progn
+         (add-to-invisibility-spec 'rcirc-omit)
+         (message "Rcirc-Omit mode enabled"))
+      (remove-from-invisibility-spec 'rcirc-omit)
+      (message "Rcirc-Omit mode disabled"))
+    (recenter line))
+  (force-mode-line-update))
 
 (defun rcirc-switch-to-server-buffer ()
   "Switch to the server buffer associated with current channel buffer."
   (interactive)
-  (funcall rcirc-switch-to-buffer-function rcirc-server-buffer))
+  (switch-to-buffer rcirc-server-buffer))
 
 (defun rcirc-jump-to-first-unread-line ()
   "Move the point to the first unread line in this buffer."
   (interactive)
-  (when (marker-position overlay-arrow-position)
-    (goto-char overlay-arrow-position)))
-
-(defvar rcirc-last-non-irc-buffer nil
-  "The buffer to switch to when there is no more activity.")
+  (if (marker-position overlay-arrow-position)
+      (goto-char overlay-arrow-position)
+    (message "No unread messages")))
+
+(defun rcirc-non-irc-buffer ()
+  (let ((buflist (buffer-list))
+       buffer)
+    (while (and buflist (not buffer))
+      (with-current-buffer (car buflist)
+       (unless (or (eq major-mode 'rcirc-mode)
+                   (= ?\s (aref (buffer-name) 0)) ; internal buffers
+                   (get-buffer-window (current-buffer)))
+         (setq buffer (current-buffer))))
+      (setq buflist (cdr buflist)))
+    buffer))
 
 (defun rcirc-next-active-buffer (arg)
-  "Go to the next rcirc buffer with activity.
-With prefix ARG, go to the next low priority buffer with activity.
-The function given by `rcirc-switch-to-buffer-function' is used to
-show the buffer."
+  "Switch to the next rcirc buffer with activity.
+With prefix ARG, go to the next low priority buffer with activity."
   (interactive "P")
   (let* ((pair (rcirc-split-activity rcirc-activity))
         (lopri (car pair))
         (hipri (cdr pair)))
     (if (or (and (not arg) hipri)
            (and arg lopri))
-       (progn
-         (unless (eq major-mode 'rcirc-mode)
-           (setq rcirc-last-non-irc-buffer (current-buffer)))
-         (funcall rcirc-switch-to-buffer-function
-                  (car (if arg lopri hipri))))
+       (switch-to-buffer (car (if arg lopri hipri)) t)
       (if (eq major-mode 'rcirc-mode)
-         (if (not (and rcirc-last-non-irc-buffer
-                       (buffer-live-p rcirc-last-non-irc-buffer)))
-             (message "No IRC activity.  Start something.")
-           (message "No more IRC activity.  Go back to work.")
-           (funcall rcirc-switch-to-buffer-function rcirc-last-non-irc-buffer)
-           (setq rcirc-last-non-irc-buffer nil))
+         (switch-to-buffer (rcirc-non-irc-buffer))
        (message (concat
                  "No IRC activity."
                  (when lopri
@@ -1518,23 +1643,33 @@ activity.  Only run if the buffer is not visible and
 (defun rcirc-record-activity (buffer &optional type)
   "Record BUFFER activity with TYPE."
   (with-current-buffer buffer
-    (when (not (get-buffer-window (current-buffer) t))
-      (setq rcirc-activity
-           (sort (add-to-list 'rcirc-activity (current-buffer))
-                 (lambda (b1 b2)
-                   (let ((t1 (with-current-buffer b1 rcirc-last-post-time))
-                         (t2 (with-current-buffer b2 rcirc-last-post-time)))
-                     (time-less-p t2 t1)))))
-      (pushnew type rcirc-activity-types)
-      (rcirc-update-activity-string)))
+    (let ((old-activity rcirc-activity)
+         (old-types rcirc-activity-types))
+      (when (not (get-buffer-window (current-buffer) t))
+       (setq rcirc-activity
+             (sort (add-to-list 'rcirc-activity (current-buffer))
+                   (lambda (b1 b2)
+                     (let ((t1 (with-current-buffer b1 rcirc-last-post-time))
+                           (t2 (with-current-buffer b2 rcirc-last-post-time)))
+                       (time-less-p t2 t1)))))
+       (pushnew type rcirc-activity-types)
+       (unless (and (equal rcirc-activity old-activity)
+                    (member type old-types))
+         (rcirc-update-activity-string)))))
   (run-hook-with-args 'rcirc-activity-hooks buffer))
 
 (defun rcirc-clear-activity (buffer)
   "Clear the BUFFER activity."
-  (setq rcirc-activity (delete buffer rcirc-activity))
+  (setq rcirc-activity (remove buffer rcirc-activity))
   (with-current-buffer buffer
     (setq rcirc-activity-types nil)))
 
+(defun rcirc-clear-unread (buffer)
+  "Erase the last read message arrow from BUFFER."
+  (when (buffer-live-p buffer)
+    (with-current-buffer buffer
+      (set-marker overlay-arrow-position nil))))
+
 (defun rcirc-split-activity (activity)
   "Return a cons cell with ACTIVITY split into (lopri . hipri)."
   (let (lopri hipri)
@@ -1546,6 +1681,9 @@ activity.  Only run if the buffer is not visible and
          (add-to-list 'hipri buf t))))
     (cons lopri hipri)))
 
+(defvar rcirc-update-activity-string-hook nil
+  "Hook run whenever the activity string is updated.")
+
 ;; TODO: add mouse properties
 (defun rcirc-update-activity-string ()
   "Update mode-line string."
@@ -1554,19 +1692,18 @@ activity.  Only run if the buffer is not visible and
         (hipri (cdr pair)))
     (setq rcirc-activity-string
          (cond ((or hipri lopri)
-                (concat "-"
-                        (and hipri "[")
+                (concat (and hipri "[")
                         (rcirc-activity-string hipri)
                         (and hipri lopri ",")
                         (and lopri
                              (concat "("
                                      (rcirc-activity-string lopri)
                                      ")"))
-                        (and hipri "]")
-                        "-"))
+                        (and hipri "]")))
                ((not (null (rcirc-process-list)))
-                "-[]-")
-               (t "")))))
+                "[]")
+               (t "[]")))
+    (run-hooks 'rcirc-update-activity-string-hook)))
 
 (defun rcirc-activity-string (buffers)
   (mapconcat (lambda (b)
@@ -1586,33 +1723,47 @@ activity.  Only run if the buffer is not visible and
   (with-current-buffer buffer
     (or rcirc-short-buffer-name (buffer-name))))
 
-(defvar rcirc-current-buffer nil)
-(defun rcirc-window-configuration-change ()
-  "Go through visible windows and remove buffers from activity list.
-Also, clear the overlay arrow if the current buffer is now hidden."
-  (let ((current-now-hidden t))
+(defun rcirc-visible-buffers ()
+  "Return a list of the visible buffers that are in rcirc-mode."
+  (let (acc)
     (walk-windows (lambda (w)
-                   (let ((buf (window-buffer w)))
-                     (with-current-buffer buf
-                       (when (eq major-mode 'rcirc-mode)
-                         (rcirc-clear-activity buf)))
-                       (when (eq buf rcirc-current-buffer)
-                         (setq current-now-hidden nil)))))
-    ;; add overlay arrow if the buffer isn't displayed
-    (when (and current-now-hidden
-              rcirc-current-buffer
-              (buffer-live-p rcirc-current-buffer))
-      (with-current-buffer rcirc-current-buffer
-       (when (and (eq major-mode 'rcirc-mode)
-                  (marker-position overlay-arrow-position))
-         (set-marker overlay-arrow-position nil)))))
-
-  ;; remove any killed buffers from list
-  (setq rcirc-activity
-       (delq nil (mapcar (lambda (buf) (when (buffer-live-p buf) buf))
-                         rcirc-activity)))
-  (rcirc-update-activity-string)
-  (setq rcirc-current-buffer (current-buffer)))
+                   (with-current-buffer (window-buffer w)
+                     (when (eq major-mode 'rcirc-mode)
+                       (push (current-buffer) acc)))))
+    acc))
+
+(defvar rcirc-visible-buffers nil)
+(defun rcirc-window-configuration-change ()
+  (unless (minibuffer-window-active-p (minibuffer-window))
+    ;; delay this until command has finished to make sure window is
+    ;; actually visible before clearing activity
+    (add-hook 'post-command-hook 'rcirc-window-configuration-change-1)))
+
+(defun rcirc-window-configuration-change-1 ()
+  ;; clear activity and overlay arrows
+  (let* ((old-activity rcirc-activity)
+        (hidden-buffers rcirc-visible-buffers))
+
+    (setq rcirc-visible-buffers (rcirc-visible-buffers))
+
+    (dolist (vbuf rcirc-visible-buffers)
+      (setq hidden-buffers (delq vbuf hidden-buffers))
+      ;; clear activity for all visible buffers
+      (rcirc-clear-activity vbuf))
+
+    ;; clear unread arrow from recently hidden buffers
+    (dolist (hbuf hidden-buffers)
+      (rcirc-clear-unread hbuf))
+
+    ;; remove any killed buffers from list
+    (setq rcirc-activity
+         (delq nil (mapcar (lambda (buf) (when (buffer-live-p buf) buf))
+                           rcirc-activity)))
+    ;; update the mode-line string
+    (unless (equal old-activity rcirc-activity)
+      (rcirc-update-activity-string)))
+
+  (remove-hook 'post-command-hook 'rcirc-window-configuration-change-1))
 
 \f
 ;;; buffer name abbreviation
@@ -1722,8 +1873,9 @@ Also, clear the overlay arrow if the current buffer is now hidden."
                                          (car (split-string channel)))))
     (rcirc-send-string process (concat "JOIN " channel))
     (when (not (eq (selected-window) (minibuffer-window)))
-      (funcall rcirc-switch-to-buffer-function buffer))))
+      (switch-to-buffer buffer))))
 
+;; TODO: /part #channel reason, or consider removing #channel altogether
 (defun-rcirc-command part (channel)
   "Part CHANNEL."
   (interactive "sPart channel: ")
@@ -1902,7 +2054,7 @@ keywords when no KEYWORD is given."
                  word-boundary))
         (optional
          (and "/"
-              (1+ (char "-a-zA-Z0-9_=!?#$\@~`%&*+|\\/:;.,{}[]()"))
+              (1+ (char "-a-zA-Z0-9_='!?#$\@~`%&*+|\\/:;.,{}[]()"))
               (char "-a-zA-Z0-9_=#$\@~`%&*+|\\/:;{}[]()")))))
   "Regexp matching URLs.  Set to nil to disable URL features in rcirc.")
 
@@ -1932,38 +2084,25 @@ keywords when no KEYWORD is given."
 
 \f
 (defvar rcirc-markup-text-functions
-  '(rcirc-markup-body-text
-    rcirc-markup-attributes
+  '(rcirc-markup-attributes
     rcirc-markup-my-nick
     rcirc-markup-urls
     rcirc-markup-keywords
-    rcirc-markup-bright-nicks)
-  "List of functions used to manipulate text before it is printed.
+    rcirc-markup-bright-nicks
+    rcirc-markup-fill)
 
-Each function takes three arguments, PROCESS, SENDER, RESPONSE
-and CHANNEL-BUFFER.  The current buffer is temporary buffer that
-contains the text to manipulate.  Each function works on the text
-in this buffer.")
+  "List of functions used to manipulate text before it is printed.
 
-(defun rcirc-markup-text (process sender response text)
-  "Return TEXT with properties added based on various patterns."
-  (let ((channel-buffer (current-buffer)))
-    (with-temp-buffer
-      (insert text)
-      (goto-char (point-min))
-      (dolist (fn rcirc-markup-text-functions)
-       (save-excursion
-         (funcall fn process sender response channel-buffer)))
-      (buffer-substring (point-min) (point-max)))))
+Each function takes two arguments, SENDER, RESPONSE.  The buffer
+is narrowed with the text to be printed and the point is at the
+beginning of the `rcirc-text' propertized text.")
 
-(defun rcirc-markup-body-text (process sender response channel-buffer)
-  ;; We add the text property `rcirc-text' to identify this as the
-  ;; body text.
-  (add-text-properties (point-min) (point-max)
-                      (list 'rcirc-text (buffer-substring-no-properties
-                                         (point-min) (point-max)))))
+(defun rcirc-markup-timestamp (sender response)
+  (goto-char (point-min))
+  (insert (rcirc-facify (format-time-string rcirc-time-format)
+                       'rcirc-timestamp)))
 
-(defun rcirc-markup-attributes (process sender response channel-buffer)
+(defun rcirc-markup-attributes (sender response)
   (while (re-search-forward "\\([\C-b\C-_\C-v]\\).*?\\(\\1\\|\C-o\\)" nil t)
     (rcirc-add-face (match-beginning 0) (match-end 0)
                    (case (char-after (match-beginning 1))
@@ -1979,19 +2118,21 @@ in this buffer.")
   (while (re-search-forward "\C-o+" nil t)
     (delete-region (match-beginning 0) (match-end 0))))
 
-(defun rcirc-markup-my-nick (process sender response channel-buffer)
+(defun rcirc-markup-my-nick (sender response)
   (with-syntax-table rcirc-nick-syntax-table
     (while (re-search-forward (concat "\\b"
-                                     (regexp-quote (rcirc-nick process))
+                                     (regexp-quote (rcirc-nick
+                                                    (rcirc-buffer-process)))
                                      "\\b")
                              nil t)
       (rcirc-add-face (match-beginning 0) (match-end 0)
                      'rcirc-nick-in-message)
       (when (string= response "PRIVMSG")
-       (rcirc-add-face (point-min) (point-max) 'rcirc-nick-in-message-full-line)
-       (rcirc-record-activity channel-buffer 'nick)))))
+       (rcirc-add-face (point-min) (point-max)
+                       'rcirc-nick-in-message-full-line)
+       (rcirc-record-activity (current-buffer) 'nick)))))
 
-(defun rcirc-markup-urls (process sender response channel-buffer)
+(defun rcirc-markup-urls (sender response)
   (while (re-search-forward rcirc-url-regexp nil t)
     (let ((start (match-beginning 0))
          (end (match-end 0)))
@@ -1999,30 +2140,41 @@ in this buffer.")
       (add-text-properties start end (list 'mouse-face 'highlight
                                           'keymap rcirc-browse-url-map))
       ;; record the url
-      (let ((url (buffer-substring-no-properties start end)))
-       (with-current-buffer channel-buffer
-         (push url rcirc-urls))))))
-
-(defun rcirc-markup-keywords (process sender response channel-buffer)
-  (let* ((target (with-current-buffer channel-buffer (or rcirc-target "")))
-        (keywords (delq nil (mapcar (lambda (keyword)
-                                     (when (not (string-match keyword target))
-                                       keyword))
-                                   rcirc-keywords))))
-    (when keywords
-      (while (re-search-forward (regexp-opt keywords 'words) nil t)
-       (rcirc-add-face (match-beginning 0) (match-end 0) 'rcirc-keyword)
-       (when (and (string= response "PRIVMSG")
-                  (not (string= sender (rcirc-nick process))))
-         (rcirc-record-activity channel-buffer 'keyword))))))
-
-(defun rcirc-markup-bright-nicks (process sender response channel-buffer)
+      (push (buffer-substring-no-properties start end) rcirc-urls))))
+
+(defun rcirc-markup-keywords (sender response)
+  (when (and (string= response "PRIVMSG")
+            (not (string= sender (rcirc-nick (rcirc-buffer-process)))))
+    (let* ((target (or rcirc-target ""))
+          (keywords (delq nil (mapcar (lambda (keyword)
+                                        (when (not (string-match keyword
+                                                                 target))
+                                          keyword))
+                                      rcirc-keywords))))
+      (when keywords
+       (while (re-search-forward (regexp-opt keywords 'words) nil t)
+         (rcirc-add-face (match-beginning 0) (match-end 0) 'rcirc-keyword)
+         (rcirc-record-activity (current-buffer) 'keyword))))))
+
+(defun rcirc-markup-bright-nicks (sender response)
   (when (and rcirc-bright-nicks
             (string= response "NAMES"))
     (with-syntax-table rcirc-nick-syntax-table
       (while (re-search-forward (regexp-opt rcirc-bright-nicks 'words) nil t)
        (rcirc-add-face (match-beginning 0) (match-end 0)
                        'rcirc-bright-nick)))))
+
+(defun rcirc-markup-fill (sender response)
+  (when (not (string= response "372"))         ; /motd
+    (let ((fill-prefix
+          (or rcirc-fill-prefix
+              (make-string (- (point) (line-beginning-position)) ?\s)))
+         (fill-column (cond ((eq rcirc-fill-column 'frame-width)
+                             (1- (frame-width)))
+                            (rcirc-fill-column
+                             rcirc-fill-column)
+                            (t fill-column))))
+      (fill-region (point) (point-max) nil t))))
 \f
 ;;; handlers
 ;; these are called with the server PROCESS, the SENDER, which is a
@@ -2099,8 +2251,7 @@ in this buffer.")
     ;; if the buffer is still around, make it inactive
     (let ((buffer (rcirc-get-buffer process channel)))
       (when buffer
-       (with-current-buffer buffer
-         (setq rcirc-target nil))))))
+       (rcirc-disconnect-buffer buffer)))))
 
 (defun rcirc-handler-PART (process sender args text)
   (let* ((channel (car args))
@@ -2169,7 +2320,7 @@ in this buffer.")
         (when rcirc-auto-authenticate-flag (rcirc-authenticate))))))
 
 (defun rcirc-handler-PING (process sender args text)
-  (rcirc-send-string process (concat "PONG " (car args))))
+  (rcirc-send-string process (concat "PONG :" (car args))))
 
 (defun rcirc-handler-PONG (process sender args text)
   ;; do nothing
@@ -2289,7 +2440,7 @@ Passwords are stored in `rcirc-authinfo' (which see)."
                  process
                  (concat
                   "PRIVMSG chanserv :identify "
-                  (cadr args) " " (car args))))
+                  (car args) " " (cadr args))))
                ((equal method 'bitlbee)
                 (rcirc-send-string
                  process
@@ -2314,7 +2465,8 @@ Passwords are stored in `rcirc-authinfo' (which see)."
                          (format "%s sent unsupported ctcp: %s" sender text)
                         t)
           (funcall handler process target sender args)
-          (if (not (string= request "ACTION"))
+          (unless (or (string= request "ACTION")
+                     (string= request "KEEPALIVE"))
               (rcirc-print process sender "CTCP" target
                           (format "%s" text) t))))))
 
index 0a5b2c8..52c2a20 100644 (file)
@@ -188,8 +188,7 @@ See \\[compile]."
       (when (featurep 'tramp)
        (set (make-local-variable 'comint-file-name-prefix)
             (funcall (symbol-function 'tramp-make-tramp-file-name)
-             nil ;; multi-method.  To be removed with Tramp 2.1.
-             nil
+             nil ;; method.
              remote-compile-user
              remote-compile-host
              ""))))))
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
new file mode 100644 (file)
index 0000000..db08fe3
--- /dev/null
@@ -0,0 +1,315 @@
+;;; tramp-cache.el --- file information caching for Tramp
+
+;; Copyright (C) 2000, 2005, 2006, 2007 by Free Software Foundation, Inc.
+
+;; Author: Daniel Pittman <daniel@inanna.danann.net>
+;;         Michael Albinus <michael.albinus@gmx.de>
+;; Keywords: comm, processes
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, see
+;; <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; An implementation of information caching for remote files.
+
+;; Each connection, identified by a vector [method user host
+;; localname] or by a process, has a unique cache. We distinguish 3
+;; kind of caches, depending on the key:
+;;
+;; - localname is NIL.  This are reusable properties.  Examples:
+;;   "remote-shell" identifies the POSIX shell to be called on the
+;;   remote host, or "perl" is the command to be called on the remote
+;;   host, when starting a Perl script.  These properties are saved in
+;;   the file `tramp-persistency-file-name'.
+;;
+;; - localname is a string.  This are temporary properties, which are
+;;   related to the file localname is referring to.  Examples:
+;;   "file-exists-p" is t or nile, depending on the file existence, or
+;;   "file-attributes" caches the result of the function
+;;  `file-attributes'.
+;;
+;; - The key is a process.  This are temporary properties related to
+;;   an open connection.  Examples: "scripts" keeps shell script
+;;   definitions already sent to the remote shell, "last-cmd-time" is
+;;   the time stamp a command has been sent to the remote process.
+
+;;; Code:
+
+;; Pacify byte-compiler.
+(eval-when-compile
+  (require 'cl)
+  (autoload 'tramp-message "tramp")
+  (autoload 'tramp-tramp-file-p "tramp")
+  ;; We cannot autoload macro `with-parsed-tramp-file-name', it
+  ;; results in problems of byte-compiled code.
+  (autoload 'tramp-dissect-file-name "tramp")
+  (autoload 'tramp-file-name-method "tramp")
+  (autoload 'tramp-file-name-user "tramp")
+  (autoload 'tramp-file-name-host "tramp")
+  (autoload 'tramp-file-name-localname "tramp")
+  (autoload 'time-stamp-string "time-stamp"))
+
+;;; -- Cache --
+
+(defvar tramp-cache-data (make-hash-table :test 'equal)
+  "Hash table for remote files properties.")
+
+(defcustom tramp-persistency-file-name
+  (cond
+   ;; GNU Emacs.
+   ((and (boundp 'user-emacs-directory)
+        (stringp (symbol-value 'user-emacs-directory))
+        (file-directory-p (symbol-value 'user-emacs-directory)))
+    (expand-file-name "tramp" (symbol-value 'user-emacs-directory)))
+   ((and (not (featurep 'xemacs)) (file-directory-p "~/.emacs.d/"))
+    "~/.emacs.d/tramp")
+   ;; XEmacs.
+   ((and (boundp 'user-init-directory)
+        (stringp (symbol-value 'user-init-directory))
+        (file-directory-p (symbol-value 'user-init-directory)))
+    (expand-file-name "tramp" (symbol-value 'user-init-directory)))
+   ((and (featurep 'xemacs) (file-directory-p "~/.xemacs/"))
+    "~/.xemacs/tramp")
+   ;; For users without `~/.emacs.d/' or `~/.xemacs/'.
+   (t "~/.tramp"))
+  "File which keeps connection history for Tramp connections."
+  :group 'tramp
+  :type 'file)
+
+(defun tramp-get-file-property (vec file property default)
+  "Get the PROPERTY of FILE from the cache context of VEC.
+Returns DEFAULT if not set."
+  ;; Unify localname.
+  (setq vec (copy-sequence vec))
+  (aset vec 3 (directory-file-name file))
+  (let* ((hash (or (gethash vec tramp-cache-data)
+                  (puthash vec (make-hash-table :test 'equal)
+                           tramp-cache-data)))
+        (value (if (hash-table-p hash)
+                   (gethash property hash default)
+                 default)))
+    (tramp-message vec 8 "%s %s %s" file property value)
+    value))
+
+(defun tramp-set-file-property (vec file property value)
+  "Set the PROPERTY of FILE to VALUE, in the cache context of VEC.
+Returns VALUE."
+  ;; Unify localname.
+  (setq vec (copy-sequence vec))
+  (aset vec 3 (directory-file-name file))
+  (let ((hash (or (gethash vec tramp-cache-data)
+                 (puthash vec (make-hash-table :test 'equal)
+                          tramp-cache-data))))
+    (puthash property value hash)
+    (tramp-message vec 8 "%s %s %s" file property value)
+    value))
+
+(defun tramp-flush-file-property (vec file)
+  "Remove all properties of FILE in the cache context of VEC."
+  ;; Unify localname.
+  (setq vec (copy-sequence vec))
+  (aset vec 3 (directory-file-name file))
+  (tramp-message vec 8 "%s" file)
+  (remhash vec tramp-cache-data))
+
+(defun tramp-flush-directory-property (vec directory)
+  "Remove all properties of DIRECTORY in the cache context of VEC.
+Remove also properties of all files in subdirectories."
+  (let ((directory (directory-file-name directory)))
+  (tramp-message vec 8 "%s" directory)
+    (maphash
+     '(lambda (key value)
+       (when (and (stringp key)
+                  (string-match directory (tramp-file-name-localname key)))
+         (remhash key tramp-cache-data)))
+     tramp-cache-data)))
+
+(defun tramp-cache-print (table)
+  "Prints hash table TABLE."
+  (when (hash-table-p table)
+    (let (result tmp)
+      (maphash
+       '(lambda (key value)
+         (setq tmp (format
+                    "(%s %s)"
+                    (if (processp key)
+                        (prin1-to-string (prin1-to-string key))
+                      (prin1-to-string key))
+                    (if (hash-table-p value)
+                        (tramp-cache-print value)
+                      (if (bufferp value)
+                          (prin1-to-string (prin1-to-string value))
+                        (prin1-to-string value))))
+               result (if result (concat result " " tmp) tmp)))
+       table)
+      result)))
+
+;; Reverting or killing a buffer should also flush file properties.
+;; They could have been changed outside Tramp.
+(defun tramp-flush-file-function ()
+  "Flush all Tramp cache properties from buffer-file-name."
+  (let ((bfn (buffer-file-name)))
+    (when (and (stringp bfn) (tramp-tramp-file-p bfn))
+      (let* ((v (tramp-dissect-file-name bfn))
+            (localname (tramp-file-name-localname v)))
+       (tramp-flush-file-property v localname)))))
+
+(add-hook 'before-revert-hook 'tramp-flush-file-function)
+(add-hook 'kill-buffer-hook 'tramp-flush-file-function)
+(add-hook 'tramp-cache-unload-hook
+         '(lambda ()
+            (remove-hook 'before-revert-hook
+                         'tramp-flush-file-function)
+            (remove-hook 'kill-buffer-hook
+                         'tramp-flush-file-function)))
+
+;;; -- Properties --
+
+(defun tramp-get-connection-property (key property default)
+  "Get the named PROPERTY for the connection.
+KEY identifies the connection, it is either a process or a vector.
+If the value is not set for the connection, returns DEFAULT."
+  ;; Unify key by removing localname from vector.  Work with a copy in
+  ;; order to avoid side effects.
+  (when (vectorp key)
+    (setq key (copy-sequence key))
+    (aset key 3 nil))
+  (let* ((hash (gethash key tramp-cache-data))
+        (value (if (hash-table-p hash)
+                  (gethash property hash default)
+                default)))
+    (tramp-message key 7 "%s %s" property value)
+    value))
+
+(defun tramp-set-connection-property (key property value)
+  "Set the named PROPERTY of a connection to VALUE.
+KEY identifies the connection, it is either a process or a vector.
+PROPERTY is set persistent when KEY is a vector."
+  ;; Unify key by removing localname from vector.  Work with a copy in
+  ;; order to avoid side effects.
+  (when (vectorp key)
+    (setq key (copy-sequence key))
+    (aset key 3 nil))
+  (let ((hash (or (gethash key tramp-cache-data)
+                 (puthash key (make-hash-table :test 'equal)
+                           tramp-cache-data))))
+    (puthash property value hash)
+    ;; This function is called also during initialization of
+    ;; tramp-cache.el.  `tramp-message´ is not defined yet at this
+    ;; time, so we ignore the corresponding error.
+    (condition-case nil
+       (tramp-message key 7 "%s %s" property value)
+      (error nil))
+    value))
+
+(defun tramp-flush-connection-property (key event)
+  "Remove all properties identified by KEY.
+KEY identifies the connection, it is either a process or a
+vector.  EVENT is not used, it is just applied because this
+function is intended to run also as process sentinel."
+  ;; Unify key by removing localname from vector.  Work with a copy in
+  ;; order to avoid side effects.
+  (when (vectorp key)
+    (setq key (copy-sequence key))
+    (aset key 3 nil))
+;  (tramp-message key 7 "%s" event)
+  (remhash key tramp-cache-data))
+
+(defun tramp-dump-connection-properties ()
+"Writes persistent connection properties into file
+`tramp-persistency-file-name'."
+  ;; We shouldn't fail, otherwise (X)Emacs might not be able to be closed.
+  (condition-case nil
+      (when (and (hash-table-p tramp-cache-data)
+                (not (zerop (hash-table-count tramp-cache-data)))
+                (stringp tramp-persistency-file-name))
+       (let ((cache (copy-hash-table tramp-cache-data)))
+         ;; Remove temporary data.
+         (maphash
+          '(lambda (key value)
+             (if (and (vectorp key) (not (tramp-file-name-localname key)))
+                 (progn
+                   (remhash "process-name" value)
+                   (remhash "process-buffer" value))
+               (remhash key cache)))
+          cache)
+         ;; Dump it.
+         (with-temp-buffer
+           (insert
+            ";; -*- emacs-lisp -*-"
+            ;; `time-stamp-string' might not exist in all (X)Emacs flavors.
+            (condition-case nil
+                (progn
+                  (format
+                   " <%s %s>\n"
+                   (time-stamp-string "%02y/%02m/%02d %02H:%02M:%02S")
+                   tramp-persistency-file-name))
+              (error "\n"))
+            ";; Tramp connection history.  Don't change this file.\n"
+            ";; You can delete it, forcing Tramp to reapply the checks.\n\n"
+            (with-output-to-string
+              (pp (read (format "(%s)" (tramp-cache-print cache))))))
+           (write-region
+            (point-min) (point-max) tramp-persistency-file-name))))
+    (error nil)))
+
+(add-hook 'kill-emacs-hook 'tramp-dump-connection-properties)
+(add-hook 'tramp-cache-unload-hook
+         '(lambda ()
+            (remove-hook 'kill-emacs-hook
+                         'tramp-dump-connection-properties)))
+
+(defun tramp-parse-connection-properties (method)
+  "Return a list of (user host) tuples allowed to access for METHOD.
+This function is added always in `tramp-get-completion-function'
+for all methods.  Resulting data are derived from connection
+history."
+  (let (res)
+    (maphash
+     '(lambda (key value)
+       (if (and (vectorp key)
+                (string-equal method (tramp-file-name-method key))
+                (not (tramp-file-name-localname key)))
+           (push (list (tramp-file-name-user key)
+                       (tramp-file-name-host key))
+                 res)))
+     tramp-cache-data)
+    res))
+
+;; Read persistent connection history.
+(when (zerop (hash-table-count tramp-cache-data))
+  (condition-case err
+      (with-temp-buffer
+       (insert-file-contents tramp-persistency-file-name)
+       (let ((list (read (current-buffer)))
+             element key item)
+         (while (setq element (pop list))
+           (setq key (pop element))
+           (while (setq item (pop element))
+             (tramp-set-connection-property key (pop item) (car item))))))
+    (file-error
+     ;; Most likely because the file doesn't exist yet.  No message.
+     (clrhash tramp-cache-data))
+    (error
+     ;; File is corrupted.
+     (message "%s" (error-message-string err))
+     (clrhash tramp-cache-data))))
+
+(provide 'tramp-cache)
+
+;; arch-tag: ee1739b7-7628-408c-9b96-d11a74b05d26
+;;; tramp-cache.el ends here
diff --git a/lisp/net/tramp-fish.el b/lisp/net/tramp-fish.el
new file mode 100644 (file)
index 0000000..f0db302
--- /dev/null
@@ -0,0 +1,1184 @@
+;;; tramp-fish.el --- Tramp access functions for FISH protocol
+
+;; Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+
+;; Author: Michael Albinus <michael.albinus@gmx.de>
+;; Keywords: comm, processes
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, see
+;; <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Access functions for FIles transferred over SHell protocol from Tramp.
+
+;; FISH is a protocol developped for the GNU Midnight Commander
+;; <https://savannah.gnu.org/projects/mc>.  A client connects to a
+;; remote host via ssh (or rsh, shall be configurable), and starts
+;; there a fish server via the command "start_fish_server".  All
+;; commands from the client have the form "#FISH_COMMAND\n" (always
+;; one line), followed by equivalent shell commands in case there is
+;; no fish server running.
+
+;; The fish server (or the equivalent shell commands) must return the
+;; response, which is finished by a line "### xxx  <optional text>\n".
+;; "xxx" stands for 3 digits, representing a return code.  Return
+;; codes "# 000" and "# 001" are reserved for fallback implementation
+;; with native shell commands; they are not used inside the server.  See
+;; <http://cvs.savannah.gnu.org/viewcvs/mc/vfs/README.fish?root=mc&view=markup>
+;; for details of original specification.
+
+;; The GNU Midnight Commander implements the original fish protocol
+;; version 0.0.2.  The KDE Konqueror has its own implementation, which
+;; can be found at
+;; <http://websvn.kde.org/branches/KDE/3.5/kdebase/kioslave/fish>.  It
+;; implements an extended protocol version 0.0.3.  Additionally, it
+;; provides a fish server implementation in Perl (which is the only
+;; implementation I've heard of).  The following command reference is
+;; based on that implementation.
+
+;; All commands return either "### 2xx\n" (OK) or "### 5xx <optional text>\n"
+;; (NOK).  Return codes are mentioned only if they are different from this.
+;; Spaces in any parameter must be escaped by "\ ".
+
+;; Command/Return Code                 Comment
+;;
+;; #FISH                               initial connection, not used
+;;                                     in .fishsrv.pl
+;; ### 100 transfer fish server                missing server, or wrong checksum
+;;                                     version 0.0.3 only
+
+;; #VER a.b.c <commands requested>
+;; VER x.y.z <commands offered>                .fishsrv.pl response is not uptodate
+
+;; #PWD
+;; /path/to/file
+
+;; #CWD /some/path
+
+;; #COPY /path/a /path/b               version 0.0.3 only
+
+;; #RENAME /path/a /path/b
+
+;; #SYMLINK /path/a /path/b
+
+;; #LINK /path/a /path/b
+
+;; #DELE /some/path
+
+;; #MKD /some/path
+
+;; #RMD /some/path
+
+;; #CHOWN user /file/name
+
+;; #CHGRP group /file/name
+
+;; #CHMOD 1234 file
+
+;; #READ <offset> <size> /path/and/filename
+;; ### 291                             successful exit when reading
+;;                                     ended at eof
+;; ### 292                             successful exit when reading
+;;                                     did not end at eof
+
+;; #WRITE <offset> <size> /path/and/filename
+
+;; #APPEND <size> /path/and/filename   version 0.0.3 only
+
+;; #LIST /directory
+;; <number of entries>                 version 0.0.3 only
+;; ### 100                             version 0.0.3 only
+;; P<unix permissions> <owner>.<group>
+;; S<size>
+;; d<3-letters month name> <day> <year or HH:MM>
+;; D<year> <month> <day> <hour> <minute> <second>[.1234]
+;; E<major-of-device>,<minor>
+;; :<filename>
+;; L<filename symlink points to>
+;; M<mimetype>                         version 0.0.3 only
+;; <blank line to separate items>
+
+;; #STAT /file                         version 0.0.3 only
+;;                                     like #LIST except for directories
+;; <number of entries>
+;; ### 100
+;; P<unix permissions> <owner>.<group>
+;; S<size>
+;; d<3-letters month name> <day> <year or HH:MM>
+;; D<year> <month> <day> <hour> <minute> <second>[.1234]
+;; E<major-of-device>,<minor>
+;; :<filename>
+;; L<filename symlink points to>
+;; <blank line to separate items>
+
+;; #RETR /some/name
+;; <filesize>
+;; ### 100
+;; <binary data>                       exactly filesize bytes
+;; ### 200                             with no preceding newline
+
+;; #STOR <size> /file/name
+;; ### 100
+;; <data>                              exactly size bytes
+;; ### 001                             partial success
+
+;; #EXEC <command> <tmpfile>           version 0.0.3 only
+;; <tmpfile> must not exists.  It contains the output of <command>.
+;; It can be retrieved afterwards.  Last line is
+;; ###RESULT: <returncode>
+
+;; This implementation is meant as proof of the concept, whether there
+;; is a better performance compared with the native ssh method.  It
+;; looks like the file information retrieval is slower, especially the
+;; #LIST command.  On the other hand, the file contents transmission
+;; seems to perform better than other inline methods, because there is
+;; no need for data encoding/decoding, and it supports the APPEND
+;; parameter of `write-region'.  Transfer of binary data fails due to
+;; Emacs' process input/output handling.
+
+
+;;; Code:
+
+(require 'tramp)
+(require 'tramp-cache)
+
+;; Pacify byte-compiler
+(eval-when-compile
+  (require 'cl)
+  (require 'custom))
+
+;; Avoid byte-compiler warnings if the byte-compiler supports this.
+;; Currently, XEmacs supports this.
+(eval-when-compile
+  (when (featurep 'xemacs)
+      (byte-compiler-options (warnings (- unused-vars)))))
+
+;; `directory-sep-char' is an obsolete variable in Emacs.  But it is
+;; used in XEmacs, so we set it here and there.  The following is needed
+;; to pacify Emacs byte-compiler.
+(eval-when-compile
+  (unless (boundp 'byte-compile-not-obsolete-var)
+    (defvar byte-compile-not-obsolete-var nil))
+  (setq byte-compile-not-obsolete-var 'directory-sep-char))
+
+;; Define FISH method ...
+(defcustom tramp-fish-method "fish"
+  "*Method to connect via FISH protocol."
+  :group 'tramp
+  :type 'string)
+
+;; ... and add it to the method list.
+(add-to-list 'tramp-methods (cons tramp-fish-method nil))
+
+;; Add a default for `tramp-default-user-alist'. Default is the local user.
+(add-to-list 'tramp-default-user-alist
+            `(,tramp-fish-method nil ,(user-login-name)))
+
+;; Add completion function for FISH method.
+(tramp-set-completion-function
+ tramp-fish-method tramp-completion-function-alist-ssh)
+
+(defconst tramp-fish-continue-prompt-regexp "^### 100.*\n"
+  "FISH return code OK.")
+
+;; It cannot be a defconst, occasionally we bind it locally.
+(defvar tramp-fish-ok-prompt-regexp "^### 200\n"
+  "FISH return code OK.")
+
+(defconst tramp-fish-error-prompt-regexp "^### \\(4\\|5\\)[0-9]+.*\n"
+  "Regexp for possible error strings of FISH servers.
+Used instead of analyzing error codes of commands.")
+
+(defcustom tramp-fish-start-fish-server-command
+  (concat "stty intr \"\" quit \"\" erase \"\" kill \"\" eof \"\" eol \"\" eol2 \"\" swtch \"\" start \"\" stop \"\" susp \"\" rprnt \"\" werase \"\" lnext \"\" flush \"\"; "
+         "perl .fishsrv.pl "
+           "`grep 'ARGV\\[0\\]' .fishsrv.pl | "
+           "sed -e 's/^[^\"]*\"//' -e 's/\"[^\"]*$//'`; "
+         "exit")
+  "*Command to connect via FISH protocol."
+  :group 'tramp
+  :type 'string)
+
+;; New handlers should be added here.
+(defconst tramp-fish-file-name-handler-alist
+  '(
+    ;; `access-file' performed by default handler
+    (add-name-to-file . tramp-fish-handle-add-name-to-file)
+    ;; `byte-compiler-base-file-name' performed by default handler
+    (copy-file . tramp-fish-handle-copy-file)
+    (delete-directory . tramp-fish-handle-delete-directory)
+    (delete-file . tramp-fish-handle-delete-file)
+    ;; `diff-latest-backup-file' performed by default handler
+    (directory-file-name . tramp-handle-directory-file-name)
+    (directory-files . tramp-handle-directory-files)
+    (directory-files-and-attributes . tramp-fish-handle-directory-files-and-attributes)
+    ;; `dired-call-process' performed by default handler
+    ;; `dired-compress-file' performed by default handler
+    ;; `dired-uncache' performed by default handler
+    (expand-file-name . tramp-fish-handle-expand-file-name)
+    ;; `file-accessible-directory-p' performed by default handler
+    (file-attributes . tramp-fish-handle-file-attributes)
+    (file-directory-p .  tramp-fish-handle-file-directory-p)
+    (file-executable-p . tramp-fish-handle-file-executable-p)
+    (file-exists-p . tramp-fish-handle-file-exists-p)
+    (file-local-copy . tramp-fish-handle-file-local-copy)
+    (file-remote-p . tramp-handle-file-remote-p)
+    (file-modes . tramp-handle-file-modes)
+    (file-name-all-completions . tramp-fish-handle-file-name-all-completions)
+    ;; `file-name-as-directory' performed by default handler
+    (file-name-completion . tramp-handle-file-name-completion)
+    (file-name-directory . tramp-handle-file-name-directory)
+    (file-name-nondirectory . tramp-handle-file-name-nondirectory)
+    ;; `file-name-sans-versions' performed by default handler
+    (file-newer-than-file-p . tramp-fish-handle-file-newer-than-file-p)
+    (file-ownership-preserved-p . ignore)
+    (file-readable-p . tramp-fish-handle-file-readable-p)
+    (file-regular-p . tramp-handle-file-regular-p)
+    (file-symlink-p . tramp-handle-file-symlink-p)
+    ;; `file-truename' performed by default handler
+    (file-writable-p . tramp-fish-handle-file-writable-p)
+    (find-backup-file-name . tramp-handle-find-backup-file-name)
+    ;; `find-file-noselect' performed by default handler
+    ;; `get-file-buffer' performed by default handler
+    (insert-directory . tramp-fish-handle-insert-directory)
+    (insert-file-contents . tramp-fish-handle-insert-file-contents)
+    (load . tramp-handle-load)
+    (make-directory . tramp-fish-handle-make-directory)
+    (make-directory-internal . tramp-fish-handle-make-directory-internal)
+    (make-symbolic-link . tramp-fish-handle-make-symbolic-link)
+    (rename-file . tramp-fish-handle-rename-file)
+    (set-file-modes . tramp-fish-handle-set-file-modes)
+    (set-file-times . tramp-fish-handle-set-file-times)
+    (set-visited-file-modtime . ignore)
+    (shell-command . tramp-handle-shell-command)
+    (substitute-in-file-name . tramp-handle-substitute-in-file-name)
+    (unhandled-file-name-directory . tramp-handle-unhandled-file-name-directory)
+    (vc-registered . ignore)
+    (verify-visited-file-modtime . ignore)
+    (write-region . tramp-fish-handle-write-region)
+    (executable-find . tramp-fish-handle-executable-find)
+    (start-file-process . ignore)
+    (process-file . tramp-fish-handle-process-file)
+)
+  "Alist of handler functions for Tramp FISH method.
+Operations not mentioned here will be handled by the default Emacs primitives.")
+
+(defun tramp-fish-file-name-p (filename)
+  "Check if it's a filename for FISH protocol."
+  (let ((v (tramp-dissect-file-name filename)))
+    (string= (tramp-file-name-method v) tramp-fish-method)))
+
+(defun tramp-fish-file-name-handler (operation &rest args)
+  "Invoke the FISH related OPERATION.
+First arg specifies the OPERATION, second arg is a list of arguments to
+pass to the OPERATION."
+  (let ((fn (assoc operation tramp-fish-file-name-handler-alist)))
+    (if fn
+       (save-match-data (apply (cdr fn) args))
+      (tramp-run-real-handler operation args))))
+
+(add-to-list 'tramp-foreign-file-name-handler-alist
+            (cons 'tramp-fish-file-name-p 'tramp-fish-file-name-handler))
+
+
+;; File name primitives
+
+(defun tramp-fish-handle-add-name-to-file
+  (filename newname &optional ok-if-already-exists)
+  "Like `add-name-to-file' for Tramp files."
+  (unless (tramp-equal-remote filename newname)
+    (with-parsed-tramp-file-name
+       (if (tramp-tramp-file-p filename) filename newname) nil
+      (tramp-error
+       v 'file-error
+       "add-name-to-file: %s"
+       "only implemented for same method, same user, same host")))
+  (with-parsed-tramp-file-name filename v1
+    (with-parsed-tramp-file-name newname v2
+      (when (and (not ok-if-already-exists)
+                (file-exists-p newname)
+                (not (numberp ok-if-already-exists))
+                (y-or-n-p
+                 (format
+                  "File %s already exists; make it a new name anyway? "
+                  newname)))
+       (tramp-error
+        v2 'file-error
+        "add-name-to-file: file %s already exists" newname))
+      (tramp-flush-file-property v2 v2-localname)
+      (unless (tramp-fish-send-command-and-check
+              v1 (format "#LINK %s %s" v1-localname v2-localname))
+       (tramp-error
+        v1 'file-error "Error with add-name-to-file %s" newname)))))
+
+(defun tramp-fish-handle-copy-file
+  (filename newname &optional ok-if-already-exists keep-date)
+  "Like `copy-file' for Tramp files."
+  (tramp-fish-do-copy-or-rename-file
+   'copy filename newname ok-if-already-exists keep-date))
+
+(defun tramp-fish-handle-delete-directory (directory)
+  "Like `delete-directory' for Tramp files."
+  (when (file-exists-p directory)
+    (with-parsed-tramp-file-name
+       (directory-file-name (expand-file-name directory)) nil
+      (tramp-flush-directory-property v localname)
+      (tramp-fish-send-command-and-check v (format "#RMD %s" localname)))))
+
+(defun tramp-fish-handle-delete-file (filename)
+  "Like `delete-file' for Tramp files."
+  (when (file-exists-p filename)
+    (with-parsed-tramp-file-name (expand-file-name filename) nil
+      (tramp-flush-file-property v localname)
+      (tramp-fish-send-command-and-check v (format "#DELE %s" localname)))))
+
+(defun tramp-fish-handle-directory-files-and-attributes
+  (directory &optional full match nosort id-format)
+  "Like `directory-files-and-attributes' for Tramp files."
+  (mapcar
+   (lambda (x)
+     ;; We cannot call `file-attributes' for backward compatibility reasons.
+     ;; Its optional parameter ID-FORMAT is introduced with Emacs 22.
+     (cons x (tramp-fish-handle-file-attributes
+       (if full x (expand-file-name x directory)) id-format)))
+   (directory-files directory full match nosort)))
+
+(defun tramp-fish-handle-expand-file-name (name &optional dir)
+  "Like `expand-file-name' for Tramp files."
+  ;; If DIR is not given, use DEFAULT-DIRECTORY or "/".
+  (setq dir (or dir default-directory "/"))
+  ;; Unless NAME is absolute, concat DIR and NAME.
+  (unless (file-name-absolute-p name)
+    (setq name (concat (file-name-as-directory dir) name)))
+  ;; If NAME is not a tramp file, run the real handler
+  (if (or (tramp-completion-mode) (not (tramp-tramp-file-p name)))
+      (tramp-drop-volume-letter
+       (tramp-run-real-handler 'expand-file-name (list name nil)))
+    ;; Dissect NAME.
+    (with-parsed-tramp-file-name name nil
+      (unless (file-name-absolute-p localname)
+       (setq localname (concat "~/" localname)))
+      ;; Tilde expansion if necessary.
+      (when (string-match "\\`\\(~[^/]*\\)\\(.*\\)\\'" localname)
+       (let ((uname (match-string 1 localname))
+             (fname (match-string 2 localname)))
+         ;; We cannot apply "~user/", because this is not supported
+         ;; by the FISH protocol.
+         (unless (string-equal uname "~")
+           (tramp-error
+            v 'file-error "Tilde expansion not supported for %s" name))
+         (setq uname
+           (with-connection-property v uname
+             (tramp-fish-send-command-and-check v "#PWD")
+             (with-current-buffer (tramp-get-buffer v)
+               (goto-char (point-min))
+               (buffer-substring (point) (tramp-line-end-position)))))
+         (setq localname (concat uname fname))))
+      ;; There might be a double slash, for example when "~/"
+      ;; expands to "/". Remove this.
+      (while (string-match "//" localname)
+       (setq localname (replace-match "/" t t localname)))
+      ;; No tilde characters in file name, do normal
+      ;; expand-file-name (this does "/./" and "/../").  We bind
+      ;; `directory-sep-char' here for XEmacs on Windows, which
+      ;; would otherwise use backslash.  `default-directory' is
+      ;; bound, because on Windows there would be problems with UNC
+      ;; shares or Cygwin mounts.
+      (tramp-let-maybe directory-sep-char ?/
+       (let ((default-directory (tramp-temporary-file-directory)))
+         (tramp-make-tramp-file-name
+          method user host
+          (tramp-drop-volume-letter
+           (tramp-run-real-handler 'expand-file-name
+                                   (list localname)))))))))
+
+(defun tramp-fish-handle-file-attributes (filename &optional id-format)
+  "Like `file-attributes' for Tramp files."
+  (with-parsed-tramp-file-name (expand-file-name filename) nil
+    (with-file-property v localname (format "file-attributes-%s" id-format)
+      (cdr (car (tramp-fish-get-file-entries v localname nil))))))
+
+(defun tramp-fish-handle-file-directory-p (filename)
+  "Like `file-directory-p' for Tramp files."
+  (let ((attributes (file-attributes filename)))
+    (and attributes
+        (or (string-match "d" (nth 8 attributes))
+            (and (file-symlink-p filename)
+                 (with-parsed-tramp-file-name filename nil
+                   (file-directory-p
+                    (tramp-make-tramp-file-name
+                     method user host (nth 0 attributes))))))
+        t)))
+
+(defun tramp-fish-handle-file-exists-p (filename)
+  "Like `file-exists-p' for Tramp files."
+  (and (file-attributes filename) t))
+
+(defun tramp-fish-handle-file-executable-p (filename)
+  "Like `file-executable-p' for Tramp files."
+  (with-parsed-tramp-file-name (expand-file-name filename) nil
+    (with-file-property v localname "file-executable-p"
+      (when (file-exists-p filename)
+       (let ((mode-chars (string-to-vector (nth 8 (file-attributes filename))))
+             (home-directory
+              (tramp-make-tramp-file-name
+               method user host
+               (tramp-get-connection-property v "home-directory" nil))))
+         (or (and (char-equal (aref mode-chars 3) ?x)
+                  (equal (nth 2 (file-attributes filename))
+                         (nth 2 (file-attributes home-directory))))
+             (and (char-equal (aref mode-chars 6) ?x)
+                  (equal (nth 3 (file-attributes filename))
+                         (nth 3 (file-attributes home-directory))))
+             (char-equal (aref mode-chars 9) ?x)))))))
+
+(defun tramp-fish-handle-file-readable-p (filename)
+  "Like `file-readable-p' for Tramp files."
+  (with-parsed-tramp-file-name (expand-file-name filename) nil
+    (with-file-property v localname "file-readable-p"
+      (when (file-exists-p filename)
+       (let ((mode-chars (string-to-vector (nth 8 (file-attributes filename))))
+             (home-directory
+              (tramp-make-tramp-file-name
+               method user host
+               (tramp-get-connection-property v "home-directory" nil))))
+         (or (and (char-equal (aref mode-chars 1) ?r)
+                  (equal (nth 2 (file-attributes filename))
+                         (nth 2 (file-attributes home-directory))))
+             (and (char-equal (aref mode-chars 4) ?r)
+                  (equal (nth 3 (file-attributes filename))
+                         (nth 3 (file-attributes home-directory))))
+             (char-equal (aref mode-chars 7) ?r)))))))
+
+(defun tramp-fish-handle-file-writable-p (filename)
+  "Like `file-writable-p' for Tramp files."
+  (with-parsed-tramp-file-name (expand-file-name filename) nil
+    (with-file-property v localname "file-writable-p"
+      (if (not (file-exists-p filename))
+         ;; If file doesn't exist, check if directory is writable.
+         (and (file-directory-p (file-name-directory filename))
+              (file-writable-p (file-name-directory filename)))
+       ;; Existing files must be writable.
+       (let ((mode-chars (string-to-vector (nth 8 (file-attributes filename))))
+             (home-directory
+              (tramp-make-tramp-file-name
+               method user host
+               (tramp-get-connection-property v "home-directory" nil))))
+         (or (and (char-equal (aref mode-chars 2) ?w)
+                  (equal (nth 2 (file-attributes filename))
+                         (nth 2 (file-attributes home-directory))))
+             (and (char-equal (aref mode-chars 5) ?w)
+                  (equal (nth 3 (file-attributes filename))
+                         (nth 3 (file-attributes home-directory))))
+             (char-equal (aref mode-chars 8) ?w)))))))
+
+(defun tramp-fish-handle-file-local-copy (filename)
+  "Like `file-local-copy' for Tramp files."
+  (with-parsed-tramp-file-name (expand-file-name filename) nil
+    (unless (file-exists-p filename)
+      (tramp-error
+       v 'file-error
+       "Cannot make local copy of non-existing file `%s'" filename))
+    (let ((tmpfil (tramp-make-temp-file filename)))
+      (tramp-message v 4 "Fetching %s to tmp file %s..." filename tmpfil)
+      (when (tramp-fish-retrieve-data v)
+       ;; Save file
+       (with-current-buffer (tramp-get-buffer v)
+         (write-region (point-min) (point-max) tmpfil))
+       (tramp-message v 4 "Fetching %s to tmp file %s...done" filename tmpfil)
+       tmpfil))))
+
+;; This function should return "foo/" for directories and "bar" for
+;; files.
+(defun tramp-fish-handle-file-name-all-completions (filename directory)
+  "Like `file-name-all-completions' for Tramp files."
+  (all-completions
+   filename
+   (with-parsed-tramp-file-name (expand-file-name directory) nil
+     (with-file-property v localname "file-name-all-completions"
+       (save-match-data
+        (let ((entries
+               (with-file-property v localname "file-entries"
+                 (tramp-fish-get-file-entries v localname t))))
+          (mapcar
+           (lambda (x)
+             (list
+              (if (string-match "d" (nth 9 x))
+                  (file-name-as-directory (nth 0 x))
+                (nth 0 x))))
+           entries)))))))
+
+(defun tramp-fish-handle-file-newer-than-file-p (file1 file2)
+  "Like `file-newer-than-file-p' for Tramp files."
+  (cond
+   ((not (file-exists-p file1)) nil)
+   ((not (file-exists-p file2)) t)
+   (t (tramp-time-less-p (nth 5 (file-attributes file2))
+                        (nth 5 (file-attributes file1))))))
+
+(defun tramp-fish-handle-insert-directory
+  (filename switches &optional wildcard full-directory-p)
+  "Like `insert-directory' for Tramp files.
+WILDCARD and FULL-DIRECTORY-P are not handled."
+  (setq filename (expand-file-name filename))
+  (when (file-directory-p filename)
+    ;; This check is a little bit strange, but in `dired-add-entry'
+    ;; this function is called with a non-directory ...
+    (setq filename (file-name-as-directory filename)))
+
+  (with-parsed-tramp-file-name filename nil
+    (tramp-flush-file-property v localname)
+    (save-match-data
+      (let ((entries
+            (with-file-property v localname "file-entries"
+              (tramp-fish-get-file-entries v localname t))))
+
+       ;; Sort entries
+       (setq entries
+             (sort
+              entries
+              (lambda (x y)
+                (if (string-match "t" switches)
+                    ;; Sort by date.
+                    (tramp-time-less-p (nth 6 y) (nth 6 x))
+                  ;; Sort by name.
+                  (string-lessp (nth 0 x) (nth 0 y))))))
+
+       ;; Print entries.
+       (mapcar
+        (lambda (x)
+          (insert
+           (format
+            "%10s %3d %-8s %-8s %8s %s %s%s\n"
+            (nth 9 x) ; mode
+            1         ; hardlinks
+            (nth 3 x) ; uid
+            (nth 4 x) ; gid
+            (nth 8 x) ; size
+            (format-time-string
+             (if (tramp-time-less-p
+                  (tramp-time-subtract (current-time) (nth 6 x))
+                  tramp-half-a-year)
+                 "%b %e %R"
+               "%b %e  %Y")
+             (nth 6 x)) ; date
+            (nth 0 x) ; file name
+            (if (stringp (nth 1 x)) (format " -> %s" (nth 1 x)) "")))
+          (forward-line)
+          (beginning-of-line))
+        entries)))))
+
+(defun tramp-fish-handle-insert-file-contents
+  (filename &optional visit beg end replace)
+  "Like `insert-file-contents' for Tramp files."
+  (barf-if-buffer-read-only)
+  (when visit
+    (setq buffer-file-name (expand-file-name filename))
+    (set-visited-file-modtime)
+    (set-buffer-modified-p nil))
+
+  (with-parsed-tramp-file-name filename nil
+    (if (not (file-exists-p filename))
+       (tramp-error
+        v 'file-error "File %s not found on remote host" filename)
+
+      (let ((point (point))
+           size)
+       (tramp-message v 4 "Fetching file %s..." filename)
+       (when (tramp-fish-retrieve-data v)
+         ;; Insert file
+         (insert
+          (with-current-buffer (tramp-get-buffer v)
+            (let ((beg (or beg (point-min)))
+                  (end (min (or end (point-max)) (point-max))))
+              (setq size (- end beg))
+              (buffer-substring beg end))))
+         (goto-char point))
+       (tramp-message v 4 "Fetching file %s...done" filename)
+
+       (list (expand-file-name filename) size)))))
+
+(defun tramp-fish-handle-make-directory (dir &optional parents)
+  "Like `make-directory' for Tramp files."
+  (setq dir (directory-file-name (expand-file-name dir)))
+  (unless (file-name-absolute-p dir)
+    (setq dir (expand-file-name dir default-directory)))
+  (with-parsed-tramp-file-name dir nil
+    (save-match-data
+      (let ((ldir (file-name-directory dir)))
+       ;; Make missing directory parts
+       (when (and parents (not (file-directory-p ldir)))
+         (make-directory ldir parents))
+       ;; Just do it
+       (when (file-directory-p ldir)
+         (make-directory-internal dir))
+       (unless (file-directory-p dir)
+         (tramp-error v 'file-error "Couldn't make directory %s" dir))))))
+
+(defun tramp-fish-handle-make-directory-internal (directory)
+  "Like `make-directory-internal' for Tramp files."
+  (setq directory (directory-file-name (expand-file-name directory)))
+  (unless (file-name-absolute-p directory)
+    (setq directory (expand-file-name directory default-directory)))
+  (when (file-directory-p (file-name-directory directory))
+    (with-parsed-tramp-file-name directory nil
+      (save-match-data
+       (unless
+           (tramp-fish-send-command-and-check v (format "#MKD %s" localname))
+         (tramp-error
+          v 'file-error "Couldn't make directory %s" directory))))))
+
+(defun tramp-fish-handle-make-symbolic-link
+  (filename linkname &optional ok-if-already-exists)
+  "Like `make-symbolic-link' for Tramp files.
+If LINKNAME is a non-Tramp file, it is used verbatim as the target of
+the symlink.  If LINKNAME is a Tramp file, only the localname component is
+used as the target of the symlink.
+
+If LINKNAME is a Tramp file and the localname component is relative, then
+it is expanded first, before the localname component is taken.  Note that
+this can give surprising results if the user/host for the source and
+target of the symlink differ."
+  (with-parsed-tramp-file-name linkname nil
+    ;; Do the 'confirm if exists' thing.
+    (when (file-exists-p linkname)
+      ;; What to do?
+      (if (or (null ok-if-already-exists) ; not allowed to exist
+             (and (numberp ok-if-already-exists)
+                  (not (yes-or-no-p
+                        (format
+                         "File %s already exists; make it a link anyway? "
+                         localname)))))
+         (tramp-error
+          v 'file-already-exists "File %s already exists" localname)
+       (delete-file linkname)))
+
+    ;; If FILENAME is a Tramp name, use just the localname component.
+    (when (tramp-tramp-file-p filename)
+      (setq filename (tramp-file-name-localname
+                     (tramp-dissect-file-name (expand-file-name filename)))))
+
+    ;; Right, they are on the same host, regardless of user, method, etc.
+    ;; We now make the link on the remote machine. This will occur as the user
+    ;; that FILENAME belongs to.
+    (unless
+       (tramp-fish-send-command-and-check
+        v (format "#SYMLINK %s %s" filename localname))
+      (tramp-error v 'file-error "Error creating symbolic link %s" linkname))))
+
+(defun tramp-fish-handle-rename-file
+  (filename newname &optional ok-if-already-exists)
+  "Like `rename-file' for Tramp files."
+  (tramp-fish-do-copy-or-rename-file
+   'rename filename newname ok-if-already-exists t))
+
+(defun tramp-fish-handle-set-file-modes (filename mode)
+  "Like `set-file-modes' for Tramp files."
+  (with-parsed-tramp-file-name filename nil
+    (tramp-flush-file-property v localname)
+    (unless (tramp-fish-send-command-and-check
+            v (format "#CHMOD %s %s"
+                      (tramp-decimal-to-octal mode)
+                      (tramp-shell-quote-argument localname)))
+      (tramp-error
+       v 'file-error "Error while changing file's mode %s" filename))))
+
+(defun tramp-fish-handle-set-file-times (filename &optional time)
+  "Like `set-file-times' for Tramp files."
+  (with-parsed-tramp-file-name filename nil
+    (let ((time (if (or (null time) (equal time '(0 0))) (current-time) time)))
+      (zerop (process-file
+             "touch" nil nil nil "-t"
+             (format-time-string "%Y%m%d%H%M.%S" time)
+             (tramp-shell-quote-argument localname))))))
+
+(defun tramp-fish-handle-write-region
+  (start end filename &optional append visit lockname confirm)
+  "Like `write-region' for Tramp files."
+  (setq filename (expand-file-name filename))
+  (with-parsed-tramp-file-name filename nil
+    ;; XEmacs takes a coding system as the seventh argument, not `confirm'
+    (when (and (not (featurep 'xemacs))
+              confirm (file-exists-p filename))
+      (unless (y-or-n-p (format "File %s exists; overwrite anyway? "
+                               filename))
+       (tramp-error v 'file-error "File not overwritten")))
+
+    (tramp-flush-file-property v localname)
+
+    ;; Send command
+    (let ((tramp-fish-ok-prompt-regexp
+          (concat
+           tramp-fish-ok-prompt-regexp "\\|"
+           tramp-fish-continue-prompt-regexp)))
+      (tramp-fish-send-command
+       v (format "%s %d %s\n### 100"
+                (if append "#APPEND" "#STOR") (- end start) localname)))
+
+    ;; Send data, if there are any.
+    (when (> end start)
+      (tramp-fish-send-command v (buffer-substring-no-properties start end)))
+
+    (when (eq visit t)
+      (set-visited-file-modtime))))
+
+(defun tramp-fish-handle-executable-find (command)
+  "Like `executable-find' for Tramp files."
+  (with-temp-buffer
+    (if (zerop (process-file "which" nil t nil command))
+       (progn
+         (goto-char (point-min))
+         (buffer-substring (point-min) (tramp-line-end-position))))))
+
+(defun tramp-fish-handle-process-file
+  (program &optional infile destination display &rest args)
+  "Like `process-file' for Tramp files."
+  ;; The implementation is not complete yet.
+  (when (and (numberp destination) (zerop destination))
+    (error "Implementation does not handle immediate return"))
+
+  (with-parsed-tramp-file-name default-directory nil
+    (let ((temp-name-prefix (tramp-make-tramp-temp-file v))
+         command input output stderr outbuf tmpfil ret)
+      ;; Compute command.
+      (setq command (mapconcat 'tramp-shell-quote-argument
+                              (cons program args) " "))
+      ;; Determine input.
+      (if (null infile)
+         (setq input "/dev/null")
+       (setq infile (expand-file-name infile))
+       (if (tramp-equal-remote default-directory infile)
+           ;; INFILE is on the same remote host.
+           (setq input (with-parsed-tramp-file-name infile nil localname))
+         ;; INFILE must be copied to remote host.
+         (setq input (concat temp-name-prefix ".in"))
+         (copy-file
+          infile
+          (tramp-make-tramp-file-name method user host input)
+          t)))
+      (when input (setq command (format "%s <%s" command input)))
+
+      ;; Determine output.
+      (setq output (concat temp-name-prefix ".out"))
+      (cond
+       ;; Just a buffer
+       ((bufferp destination)
+       (setq outbuf destination))
+       ;; A buffer name
+       ((stringp destination)
+       (setq outbuf (get-buffer-create destination)))
+       ;; (REAL-DESTINATION ERROR-DESTINATION)
+       ((consp destination)
+       ;; output
+       (cond
+        ((bufferp (car destination))
+         (setq outbuf (car destination)))
+        ((stringp (car destination))
+         (setq outbuf (get-buffer-create (car destination)))))
+       ;; stderr
+       (cond
+        ((stringp (cadr destination))
+         (setcar (cdr destination) (expand-file-name (cadr destination)))
+         (if (tramp-equal-remote default-directory (cadr destination))
+             ;; stderr is on the same remote host.
+             (setq stderr (with-parsed-tramp-file-name
+                              (cadr destination) nil localname))
+           ;; stderr must be copied to remote host.  The temporary
+           ;; file must be deleted after execution.
+           (setq stderr (concat temp-name-prefix ".err"))))
+        ;; stderr to be discarded
+        ((null (cadr destination))
+         (setq stderr "/dev/null"))))
+       ;; 't
+       (destination
+       (setq outbuf (current-buffer))))
+      (when stderr (setq command (format "%s 2>%s" command stderr)))
+
+      ;; If we have a temporary file, it must be removed after operation.
+      (when (and input (string-match temp-name-prefix input))
+       (setq command (format "%s; rm %s" command input)))
+      ;; Goto working directory.
+      (unless
+         (tramp-fish-send-command-and-check
+          v (format "#CWD %s" (tramp-shell-quote-argument localname)))
+       (tramp-error v 'file-error "No such directory: %s" default-directory))
+      ;; Send the command.  It might not return in time, so we protect it.
+      (condition-case nil
+         (unwind-protect
+             (unless (tramp-fish-send-command-and-check
+                      v (format
+                         "#EXEC %s %s"
+                         (tramp-shell-quote-argument command) output))
+               (error))
+           ;; Check return code.
+           (setq tmpfil (file-local-copy
+                         (tramp-make-tramp-file-name method user host output)))
+           (with-temp-buffer
+             (insert-file-contents tmpfil)
+             (goto-char (point-max))
+             (forward-line -1)
+             (looking-at "^###RESULT: \\([0-9]+\\)")
+             (setq ret (string-to-number (match-string 1)))
+             (delete-region (point) (point-max))
+             (write-region (point-min) (point-max) tmpfil))
+           ;; We should show the output anyway.
+           (when outbuf
+             (with-current-buffer outbuf (insert-file-contents tmpfil))
+             (when display (display-buffer outbuf)))
+           ;; Remove output file.
+           (delete-file (tramp-make-tramp-file-name method user host output)))
+       ;; When the user did interrupt, we should do it also.
+       (error (setq ret 1)))
+      (unless ret
+       ;; Provide error file.
+       (when (and stderr (string-match temp-name-prefix stderr))
+         (rename-file (tramp-make-tramp-file-name method user host stderr)
+                      (cadr destination) t)))
+      ;; Return exit status.
+      ret)))
+
+
+;; Internal file name functions
+
+(defun tramp-fish-do-copy-or-rename-file
+  (op filename newname &optional ok-if-already-exists keep-date)
+  "Copy or rename a remote file.
+OP must be `copy' or `rename' and indicates the operation to
+perform.  FILENAME specifies the file to copy or rename, NEWNAME
+is the name of the new file (for copy) or the new name of the
+file (for rename).  OK-IF-ALREADY-EXISTS means don't barf if
+NEWNAME exists already.  KEEP-DATE means to make sure that
+NEWNAME has the same timestamp as FILENAME.
+
+This function is invoked by `tramp-fish-handle-copy-file' and
+`tramp-fish-handle-rename-file'.  It is an error if OP is neither
+of `copy' and `rename'.  FILENAME and NEWNAME must be absolute
+file names."
+  (unless (memq op '(copy rename))
+    (error "Unknown operation `%s', must be `copy' or `rename'" op))
+  (let ((t1 (tramp-tramp-file-p filename))
+       (t2 (tramp-tramp-file-p newname)))
+
+    (unless ok-if-already-exists
+      (when (and t2 (file-exists-p newname))
+       (with-parsed-tramp-file-name newname nil
+         (tramp-error
+          v 'file-already-exists "File %s already exists" newname))))
+
+    (prog1
+       (cond
+        ;; Both are Tramp files.
+        ((and t1 t2)
+         (cond
+          ;; Shortcut: if method, host, user are the same for both
+          ;; files, we invoke `cp' or `mv' on the remote host
+          ;; directly.
+          ((tramp-equal-remote filename newname)
+           (tramp-fish-do-copy-or-rename-file-directly
+            op filename newname keep-date))
+          ;; No shortcut was possible.  So we copy the
+          ;; file first.  If the operation was `rename', we go
+          ;; back and delete the original file (if the copy was
+          ;; successful).  The approach is simple-minded: we
+          ;; create a new buffer, insert the contents of the
+          ;; source file into it, then write out the buffer to
+          ;; the target file.  The advantage is that it doesn't
+          ;; matter which filename handlers are used for the
+          ;; source and target file.
+          (t
+           (tramp-do-copy-or-rename-file-via-buffer
+            op filename newname keep-date))))
+
+        ;; One file is a Tramp file, the other one is local.
+        ((or t1 t2)
+         ;; Use the generic method via a Tramp buffer.
+         (tramp-do-copy-or-rename-file-via-buffer
+          op filename newname keep-date))
+
+        (t
+         ;; One of them must be a Tramp file.
+         (error "Tramp implementation says this cannot happen")))
+      ;; When newname did exist, we have wrong cached values.
+      (when t2
+       (with-parsed-tramp-file-name newname nil
+         (tramp-flush-file-property v localname)
+         (tramp-flush-file-property v (file-name-directory localname)))))))
+
+(defun tramp-fish-do-copy-or-rename-file-directly
+  (op filename newname keep-date)
+  "Invokes `COPY' or `RENAME' on the remote system.
+OP must be one of `copy' or `rename', indicating `cp' or `mv',
+respectively.  VEC specifies the connection.  LOCALNAME1 and
+LOCALNAME2 specify the two arguments of `cp' or `mv'.  If
+KEEP-DATE is non-nil, preserve the time stamp when copying."
+  (with-parsed-tramp-file-name filename v1
+    (with-parsed-tramp-file-name newname v2
+      (tramp-fish-send-command
+       v1
+       (format "%s %s %s"
+              (if (eq op 'copy) "#COPY" "#RENAME")
+              (tramp-shell-quote-argument v1-localname)
+              (tramp-shell-quote-argument v2-localname)))))
+  ;; KEEP-DATE handling.
+  (when (and keep-date (functionp 'set-file-times))
+    (apply 'set-file-times (list newname (nth 5 (file-attributes filename)))))
+  ;; Set the mode.
+  (set-file-modes newname (file-modes filename)))
+
+(defun tramp-fish-get-file-entries (vec localname list)
+  "Read entries returned by FISH server.
+When LIST is true, a #LIST command will be sent, including all entries
+of a directory.  Otherwise, #STAT is sent for just one entry.
+Result is a list of (LOCALNAME LINK COUNT UID GID ATIME MTIME CTIME
+SIZE MODE WEIRD INODE DEVICE)."
+  (block nil
+    (with-current-buffer (tramp-get-buffer vec)
+      ;; #LIST does not work properly with trailing "/", at least in
+      ;; .fishsrv.pl.
+      (when (string-match "/$" localname)
+       (setq localname (concat localname ".")))
+
+      (let ((command (format "%s %s" (if list "#LIST" "#STAT") localname))
+           buffer-read-only num res)
+
+       ;; Send command
+       (tramp-fish-send-command vec command)
+
+       ;; Read number of entries
+       (goto-char (point-min))
+       (condition-case nil
+           (unless (integerp (setq num (read (current-buffer)))) (error))
+         (error (return nil)))
+       (forward-line)
+       (delete-region (point-min) (point))
+
+       ;; Read return code
+       (goto-char (point-min))
+       (condition-case nil
+           (unless (looking-at tramp-fish-continue-prompt-regexp) (error))
+         (error (return nil)))
+       (forward-line)
+       (delete-region (point-min) (point))
+
+       ;; Loop the listing
+       (dotimes (i num)
+         (let ((item (tramp-fish-read-file-entry)))
+           ;; Add inode and device.
+           (add-to-list
+            'res (append item
+                         (list (tramp-get-inode vec)
+                               (tramp-get-device vec))))))
+
+       ;; Read return code
+       (goto-char (point-min))
+       (condition-case nil
+           (unless (looking-at tramp-fish-ok-prompt-regexp) (error))
+         (error (tramp-error
+                 vec 'file-error
+                 "`%s' does not return a valid Lisp expression: `%s'"
+                 command (buffer-string))))
+       (forward-line)
+       (delete-region (point-min) (point))
+
+       res))))
+
+(defun tramp-fish-read-file-entry ()
+  "Parse entry in output buffer.
+Result is the list (LOCALNAME LINK COUNT UID GID ATIME MTIME CTIME
+SIZE MODE WEIRD)."
+  ;; We are called from `tramp-fish-get-file-entries', which sets the
+  ;; current buffer.
+  (let (buffer-read-only localname link uid gid mtime size mode)
+    (block nil
+      (while t
+       (cond
+        ;; P<unix permissions> <owner>.<group>
+        ((looking-at "^P\\(.+\\)\\s-\\(.+\\)\\.\\(.+\\)$")
+         (setq mode (match-string 1))
+         (setq uid (match-string 2))
+         (setq gid (match-string 3))
+         (when (string-match "^d" mode) (setq link t)))
+        ;; S<size>
+        ((looking-at "^S\\([0-9]+\\)$")
+         (setq size (string-to-number (match-string 1))))
+        ;; D<year> <month> <day> <hour> <minute> <second>[.1234]
+        ((looking-at
+          "^D\\([0-9]+\\)\\s-\\([0-9]+\\)\\s-\\([0-9]+\\)\\s-\\([0-9]+\\)\\s-\\([0-9]+\\)\\s-\\(\\S-+\\)$")
+         (setq mtime
+               (encode-time
+                (string-to-number (match-string 6))
+                (string-to-number (match-string 5))
+                (string-to-number (match-string 4))
+                (string-to-number (match-string 3))
+                (string-to-number (match-string 2))
+                (string-to-number (match-string 1)))))
+        ;; d<3-letters month name> <day> <year or HH:MM>
+        ((looking-at "^d") nil)
+        ;; E<major-of-device>,<minor>
+        ((looking-at "^E") nil)
+        ;; :<filename>
+        ((looking-at "^:\\(.+\\)$")
+         (setq localname (match-string 1)))
+        ;; L<filename symlink points to>
+        ((looking-at "^L\\(.+\\)$")
+         (setq link (match-string 1)))
+        ;; M<mimetype>
+        ((looking-at "^M\\(.+\\)$") nil)
+        ;; last line
+        ((looking-at "^$")
+         (return)))
+       ;; delete line
+       (forward-line)
+       (delete-region (point-min) (point))))
+
+    ;; delete trailing empty line
+    (forward-line)
+    (delete-region (point-min) (point))
+
+    ;; Return entry in file-attributes format
+    (list localname link -1 uid gid '(0 0) mtime '(0 0) size mode nil)))
+
+(defun tramp-fish-retrieve-data (vec)
+  "Reads remote data for FISH protocol.
+The data are left in the connection buffer of VEC for further processing.
+Returns the size of the data."
+  (block nil
+    (with-current-buffer (tramp-get-buffer vec)
+      ;; The retrieved data might be in binary format, without
+      ;; trailing newline.  Therefore, the OK prompt might not start
+      ;; at the beginning of a line.
+      (let ((tramp-fish-ok-prompt-regexp "### 200\n")
+           size)
+
+       ;; Send command
+       (tramp-fish-send-command
+        vec (format "#RETR %s" (tramp-file-name-localname vec)))
+
+       ;; Read filesize
+       (goto-char (point-min))
+       (condition-case nil
+           (unless (integerp (setq size (read (current-buffer)))) (error))
+         (error (return nil)))
+       (forward-line)
+       (delete-region (point-min) (point))
+
+       ;; Read return code
+       (goto-char (point-min))
+       (condition-case nil
+           (unless (looking-at tramp-fish-continue-prompt-regexp) (error))
+         (error (return nil)))
+       (forward-line)
+       (delete-region (point-min) (point))
+
+       ;; The received data might contain the OK prompt already, so
+       ;; there might be outstanding data.
+       (while (/= (+ size (length tramp-fish-ok-prompt-regexp))
+                  (- (point-max) (point-min)))
+         (tramp-wait-for-regexp
+          (tramp-get-connection-process vec) nil
+          (concat tramp-fish-ok-prompt-regexp "$")))
+
+       ;; Read return code
+       (goto-char (+ (point-min) size))
+       (condition-case nil
+           (unless (looking-at tramp-fish-ok-prompt-regexp) (error))
+         (error (return nil)))
+       (delete-region (+ (point-min) size) (point-max))
+       size))))
+
+
+;; Connection functions
+
+(defun tramp-fish-maybe-open-connection (vec)
+  "Maybe open a connection VEC.
+Does not do anything if a connection is already open, but re-opens the
+connection if a previous connection has died for some reason."
+  (let ((process-connection-type tramp-process-connection-type)
+       (p (get-buffer-process (tramp-get-buffer vec))))
+
+    ;; New connection must be opened.
+    (unless (and p (processp p) (memq (process-status p) '(run open)))
+
+      ;; Set variables for computing the prompt for reading password.
+      (setq tramp-current-method (tramp-file-name-method vec)
+           tramp-current-user (tramp-file-name-user vec)
+           tramp-current-host (tramp-file-name-host vec))
+
+      ;; Start new process.
+      (when (and p (processp p))
+       (delete-process p))
+      (setenv "TERM" tramp-terminal-type)
+      (setenv "PS1" "$ ")
+      (tramp-message
+       vec 3 "Opening connection for %s@%s using %s..."
+       tramp-current-user tramp-current-host tramp-current-method)
+
+      (let* ((process-connection-type tramp-process-connection-type)
+            (inhibit-eol-conversion nil)
+            (coding-system-for-read 'binary)
+            (coding-system-for-write 'binary)
+            ;; This must be done in order to avoid our file name handler.
+            (p (let ((default-directory (tramp-temporary-file-directory)))
+                 (start-process
+                  (or (tramp-get-connection-property vec "process-name" nil)
+                      (tramp-buffer-name vec))
+                  (tramp-get-connection-buffer vec)
+                  "ssh" "-l"
+                  (tramp-file-name-user vec)
+                  (tramp-file-name-host vec)))))
+       (tramp-message vec 6 "%s" (mapconcat 'identity (process-command p) " "))
+
+       ;; Check whether process is alive.
+       (set-process-sentinel p 'tramp-flush-connection-property)
+       (tramp-set-process-query-on-exit-flag p nil)
+
+       (tramp-process-actions p vec tramp-actions-before-shell 60)
+       (tramp-fish-send-command vec tramp-fish-start-fish-server-command)
+       (tramp-message
+        vec 3
+        "Found remote shell prompt on `%s'" (tramp-file-name-host vec))))))
+
+(defun tramp-fish-send-command (vec command)
+  "Send the COMMAND to connection VEC."
+  (tramp-fish-maybe-open-connection vec)
+  (tramp-message vec 6 "%s" command)
+  (tramp-send-string vec command)
+  (tramp-wait-for-regexp
+   (tramp-get-connection-process vec) nil
+   (concat tramp-fish-ok-prompt-regexp "\\|" tramp-fish-error-prompt-regexp)))
+
+(defun tramp-fish-send-command-and-check (vec command)
+  "Send the COMMAND to connection VEC.
+Returns nil if there has been an error message."
+
+  ;; Send command.
+  (tramp-fish-send-command vec command)
+
+  ;; Read return code.
+  (with-current-buffer (tramp-get-buffer vec)
+    (goto-char (point-min))
+    (looking-at tramp-fish-ok-prompt-regexp)))
+
+(provide 'tramp-fish)
+;
+;;;; TODO:
+;
+;; * Evaluate the MIME information with #LIST or #STAT.
+;
+
+;; arch-tag: a66df7df-5f29-42a7-a921-643ceb29db49
+;;;; tramp-fish.el ends here
index 0ccae33..f3d7a3a 100644 (file)
@@ -1,4 +1,4 @@
-;;; tramp-ftp.el --- Tramp convenience functions for Ange-FTP -*- coding: iso-8859-1; -*-
+;;; tramp-ftp.el --- Tramp convenience functions for Ange-FTP
 
 ;; Copyright (C) 2002, 2003, 2004, 2005, 2006,
 ;;   2007 Free Software Foundation, Inc.
@@ -19,9 +19,8 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs; see the file COPYING.  If not, see
+;; <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
@@ -110,10 +109,13 @@ present for backward compatibility."
             (list "" "\\`\\(anonymous\\|ftp\\)\\'" tramp-ftp-method))
 
 ;; Add completion function for FTP method.
-(unless (memq system-type '(windows-nt))
-  (tramp-set-completion-function
-   tramp-ftp-method
-   '((tramp-parse-netrc "~/.netrc"))))
+(tramp-set-completion-function
+ tramp-ftp-method
+ '((tramp-parse-netrc "~/.netrc")))
+
+;; If there is URL syntax, `substitute-in-file-name' needs special
+;; handling.
+(put 'substitute-in-file-name 'ange-ftp 'tramp-handle-substitute-in-file-name)
 
 (defun tramp-ftp-file-name-handler (operation &rest args)
   "Invoke the Ange-FTP handler for OPERATION.
@@ -152,13 +154,7 @@ pass to the OPERATION."
 (defun tramp-ftp-file-name-p (filename)
   "Check if it's a filename that should be forwarded to Ange-FTP."
   (let ((v (tramp-dissect-file-name filename)))
-    (string=
-     (tramp-find-method
-      (tramp-file-name-multi-method v)
-      (tramp-file-name-method v)
-      (tramp-file-name-user v)
-      (tramp-file-name-host v))
-     tramp-ftp-method)))
+    (string= (tramp-file-name-method v) tramp-ftp-method)))
 
 (add-to-list 'tramp-foreign-file-name-handler-alist
             (cons 'tramp-ftp-file-name-p 'tramp-ftp-file-name-handler))
@@ -172,8 +168,6 @@ pass to the OPERATION."
 ;;   pretended in `tramp-file-name-handler' otherwise.
 ;;   Furthermore, there are no backup files on FTP hosts.
 ;;   Worth further investigations.
-;; * Map /multi:ssh:out@gate:ftp:kai@real.host:/path/to.file
-;;   on Ange-FTP gateways.
 
 ;;; arch-tag: 759fb338-5c63-4b99-bd36-b4d59db91cff
 ;;; tramp-ftp.el ends here
diff --git a/lisp/net/tramp-gw.el b/lisp/net/tramp-gw.el
new file mode 100644 (file)
index 0000000..3ac496d
--- /dev/null
@@ -0,0 +1,323 @@
+;;; tramp-gw.el --- Tramp utility functions for HTTP tunnels and SOCKS gateways
+
+;; Copyright (C) 2007 Free Software Foundation, Inc.
+
+;; Author: Michael Albinus <michael.albinus@gmx.de>
+;; Keywords: comm, processes
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, see
+;; <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Access functions for HTTP tunnels and SOCKS gateways from Tramp.
+;; SOCKS functionality is implemented by socks.el from the w3 package.
+;; HTTP tunnels are partly implemented in socks.el and url-http.el;
+;; both implementations are not complete.  Therefore, it is
+;; implemented in this package.
+
+;;; Code:
+
+(require 'tramp)
+
+;; Pacify byte-compiler
+(eval-when-compile
+  (require 'cl)
+  (require 'custom))
+
+;; Autoload the socks library.  It is used only when we access a SOCKS server.
+(autoload 'socks-open-network-stream "socks")
+(defvar socks-username (user-login-name))
+(defvar socks-server (list "Default server" "socks" 1080 5))
+
+;; Avoid byte-compiler warnings if the byte-compiler supports this.
+;; Currently, XEmacs supports this.
+(eval-when-compile
+  (when (featurep 'xemacs)
+      (byte-compiler-options (warnings (- unused-vars)))))
+
+;; Define HTTP tunnel method ...
+(defvar tramp-gw-tunnel-method "tunnel"
+  "*Method to connect HTTP gateways.")
+
+;; ... and port.
+(defvar tramp-gw-default-tunnel-port 8080
+  "*Default port for HTTP gateways.")
+
+;; Define SOCKS method ...
+(defvar tramp-gw-socks-method "socks"
+  "*Method to connect SOCKS servers.")
+
+;; ... and port.
+(defvar tramp-gw-default-socks-port 1080
+  "*Default port for SOCKS servers.")
+
+;; Add a default for `tramp-default-user-alist'.  Default is the local user.
+(add-to-list 'tramp-default-user-alist
+            `(,tramp-gw-tunnel-method nil ,(user-login-name)))
+(add-to-list 'tramp-default-user-alist
+            `(,tramp-gw-socks-method nil ,(user-login-name)))
+
+;; Internal file name functions and variables.
+
+(defvar tramp-gw-vector nil
+  "Keeps the remote host identification.  Needed for Tramp messages.")
+
+(defvar tramp-gw-gw-vector nil
+  "Current gateway identification vector.")
+
+(defvar tramp-gw-gw-proc nil
+  "Current gateway process.")
+
+;; This variable keeps the listening process, in order to reuse it for
+;; new processes.
+(defvar tramp-gw-aux-proc nil
+  "Process listening on local port, as mediation between SSH and the gateway.")
+
+(defun tramp-gw-gw-proc-sentinel (proc event)
+  "Delete auxiliary process when we are deleted."
+  (unless (memq (process-status proc) '(run open))
+    (tramp-message
+     tramp-gw-vector 4 "Deleting auxiliary process `%s'" tramp-gw-gw-proc)
+    (let* (tramp-verbose
+          (p (tramp-get-connection-property proc "process" nil)))
+      (when (processp p) (delete-process p)))))
+
+(defun tramp-gw-aux-proc-sentinel (proc event)
+  "Activate the different filters for involved gateway and auxiliary processes."
+  (when (memq (process-status proc) '(run open))
+    ;; A new process has been spawned from `tramp-gw-aux-proc'.
+    (tramp-message
+     tramp-gw-vector 4
+     "Opening auxiliary process `%s', speaking with process `%s'"
+     proc tramp-gw-gw-proc)
+    (tramp-set-process-query-on-exit-flag proc nil)
+    ;; We don't want debug messages, because the corresponding debug
+    ;; buffer might be undecided.
+    (let (tramp-verbose)
+      (tramp-set-connection-property tramp-gw-gw-proc "process" proc)
+      (tramp-set-connection-property proc "process" tramp-gw-gw-proc))
+    ;; Set the process-filter functions for both processes.
+    (set-process-filter proc 'tramp-gw-process-filter)
+    (set-process-filter tramp-gw-gw-proc 'tramp-gw-process-filter)
+    ;; There might be already some output from the gateway process.
+    (with-current-buffer (process-buffer tramp-gw-gw-proc)
+      (unless (= (point-min) (point-max))
+       (let ((s (buffer-string)))
+         (delete-region (point) (point-max))
+         (tramp-gw-process-filter tramp-gw-gw-proc s))))))
+
+(defun tramp-gw-process-filter (proc string)
+  (let (tramp-verbose)
+    (process-send-string
+     (tramp-get-connection-property proc "process" nil) string)))
+
+(defun tramp-gw-open-connection (vec gw-vec target-vec)
+  "Open a remote connection to VEC (see `tramp-file-name' structure).
+Take GW-VEC as SOCKS or HTTP gateway, i.e. its method must be a
+gateway method.  TARGET-VEC identifies where to connect to via
+the gateway, it can be different from VEC when there are more
+hops to be applied.
+
+It returns a string like \"localhost#port\", which must be used
+instead of the host name declared in TARGET-VEC."
+
+  ;; Remember vectors for property retrieval.
+  (setq tramp-gw-vector vec
+       tramp-gw-gw-vector gw-vec)
+
+  ;; Start listening auxiliary process.
+  (unless (and (processp tramp-gw-aux-proc)
+              (memq (process-status tramp-gw-aux-proc) '(listen)))
+    (let ((aux-vec
+          (vector "aux" (tramp-file-name-user gw-vec)
+                  (tramp-file-name-host gw-vec) nil)))
+      (setq tramp-gw-aux-proc
+           (make-network-process
+            :name (tramp-buffer-name aux-vec) :buffer nil :host 'local
+            :server t :noquery t :service t :coding 'binary))
+      (set-process-sentinel tramp-gw-aux-proc 'tramp-gw-aux-proc-sentinel)
+      (tramp-set-process-query-on-exit-flag tramp-gw-aux-proc nil)
+      (tramp-message
+       vec 4 "Opening auxiliary process `%s', listening on port %d"
+       tramp-gw-aux-proc (process-contact tramp-gw-aux-proc :service))))
+
+  (let* ((gw-method
+         (intern
+          (tramp-find-method
+           (tramp-file-name-method gw-vec)
+           (tramp-file-name-user gw-vec)
+           (tramp-file-name-host gw-vec))))
+        (socks-username
+         (tramp-find-user
+          (tramp-file-name-method gw-vec)
+          (tramp-file-name-user gw-vec)
+          (tramp-file-name-host gw-vec)))
+        ;; Declare the SOCKS server to be used.
+        (socks-server
+         (list "Tramp tempory socks server list"
+               ;; Host name.
+               (tramp-file-name-real-host gw-vec)
+               ;; Port number.
+               (or (tramp-file-name-port gw-vec)
+                   (case gw-method
+                     (tunnel tramp-gw-default-tunnel-port)
+                     (socks tramp-gw-default-socks-port)))
+               ;; Type.  We support only http and socks5, NO socks4.
+               ;; 'http could be used when HTTP tunnel works in socks.el.
+               5))
+        ;; The function to be called.
+        (socks-function
+         (case gw-method
+           (tunnel 'tramp-gw-open-network-stream)
+           (socks 'socks-open-network-stream)))
+        socks-noproxy)
+
+    ;; Open SOCKS process.
+    (setq tramp-gw-gw-proc
+         (funcall
+          socks-function
+          (tramp-buffer-name gw-vec)
+          (tramp-get-buffer gw-vec)
+          (tramp-file-name-real-host target-vec)
+          (tramp-file-name-port target-vec)))
+    (set-process-sentinel tramp-gw-gw-proc 'tramp-gw-gw-proc-sentinel)
+    (tramp-set-process-query-on-exit-flag tramp-gw-gw-proc nil)
+    (tramp-message
+     vec 4 "Opened %s process `%s'"
+     (case gw-method ('tunnel "HTTP tunnel") ('socks "SOCKS"))
+     tramp-gw-gw-proc)
+
+    ;; Return the new host for gateway access.
+    (format "localhost#%d" (process-contact tramp-gw-aux-proc :service))))
+
+(defun tramp-gw-open-network-stream (name buffer host service)
+  "Open stream to proxy server HOST:SERVICE.
+Resulting process has name NAME and buffer BUFFER.  If
+authentication is requested from proxy server, provide it."
+  (let ((command (format (concat
+                         "CONNECT %s:%d HTTP/1.1\r\n"
+                         "Host: %s:%d\r\n"
+                         "Connection: keep-alive\r\n"
+                         "User-Agent: Tramp/%s\r\n")
+                        host service host service tramp-version))
+       (authentication "")
+       (first t)
+       found proc)
+
+    (while (not found)
+      ;; Clean up.
+      (when (processp proc) (delete-process proc))
+      (with-current-buffer buffer (erase-buffer))
+      ;; Open network stream.
+      (setq proc (open-network-stream
+                 name buffer (nth 1 socks-server) (nth 2 socks-server)))
+      (set-process-coding-system proc 'binary 'binary)
+      (tramp-set-process-query-on-exit-flag proc nil)
+      ;; Send CONNECT command.
+      (process-send-string proc (format "%s%s\r\n" command authentication))
+      (tramp-message
+       tramp-gw-vector 6 "\n%s"
+       (format
+       "%s%s\r\n" command
+       (replace-regexp-in-string ;; no password in trace!
+        "Basic [^\r\n]+" "Basic xxxxx" authentication t)))
+      (with-current-buffer buffer
+       ;; Trap errors to be traced in the right trace buffer.  Often,
+       ;; proxies have a timeout of 60".  We wait 65" in order to
+       ;; receive an answer this case.
+       (condition-case nil
+           (let (tramp-verbose)
+             (tramp-wait-for-regexp proc 65 "\r?\n\r?\n"))
+         (error nil))
+       ;; Check return code.
+       (goto-char (point-min))
+       (narrow-to-region
+        (point-min)
+        (or (search-forward-regexp "\r?\n\r?\n" nil t) (point-max)))
+       (tramp-message tramp-gw-vector 6 "\n%s" (buffer-string))
+       (goto-char (point-min))
+       (search-forward-regexp "^HTTP/[1-9]\\.[0-9]" nil t)
+       (case (condition-case nil (read (current-buffer)) (error))
+         ;; Connected.
+         (200 (setq found t))
+         ;; We need basic authentication.
+         (401 (setq authentication (tramp-gw-basic-authentication nil first)))
+         ;; Target host not found.
+         (404 (tramp-error-with-buffer
+               (current-buffer) tramp-gw-vector 'file-error
+               "Host %s not found." host))
+         ;; We need basic proxy authentication.
+         (407 (setq authentication (tramp-gw-basic-authentication t first)))
+         ;; Connection failed.
+         (503 (tramp-error-with-buffer
+               (current-buffer) tramp-gw-vector 'file-error
+               "Connection to %s:%d failed." host service))
+         ;; That doesn't work at all.
+         (t (tramp-error-with-buffer
+             (current-buffer) tramp-gw-vector 'file-error
+             "Access to HTTP server %s:%d failed."
+             (nth 1 socks-server) (nth 2 socks-server))))
+       ;; Remove HTTP headers.
+       (delete-region (point-min) (point-max))
+       (widen)
+       (setq first nil)))
+    ;; Return the process.
+    proc))
+
+(defun tramp-gw-basic-authentication (proxy pw-cache)
+  "Return authentication header for CONNECT, based on server request.
+PROXY is an indication whether we need a Proxy-Authorization header
+or an Authorization header.  If PW-CACHE is non-nil, check for
+password in password cache.  This is done for the first try only."
+
+  ;; `tramp-current-*' must be set for `tramp-read-passwd' and
+  ;; `tramp-clear-passwd'.
+  (let ((tramp-current-method (tramp-file-name-method tramp-gw-gw-vector))
+       (tramp-current-user (tramp-file-name-user tramp-gw-gw-vector))
+       (tramp-current-host (tramp-file-name-host tramp-gw-gw-vector)))
+    (unless pw-cache (tramp-clear-passwd))
+    ;; We are already in the right buffer.
+    (tramp-message
+     tramp-gw-vector 5 "%s required"
+     (if proxy "Proxy authentication" "Authentication"))
+    ;; Search for request header.  We accept only basic authentication.
+    (goto-char (point-min))
+    (search-forward-regexp
+     "^\\(Proxy\\|WWW\\)-Authenticate:\\s-*Basic\\s-+realm=")
+    ;; Return authentication string.
+    (format
+     "%s: Basic %s\r\n"
+     (if proxy "Proxy-Authorization" "Authorization")
+     (base64-encode-string
+      (format
+       "%s:%s"
+       socks-username
+       (tramp-read-passwd
+       proc
+       (format
+        "Password for %s@[%s]: " socks-username (read (current-buffer)))))))))
+
+
+(provide 'tramp-gw)
+
+;;; TODO:
+
+;; * Provide descriptive Commentary.
+;; * Enable it for several gateway processes in parallel.
+
+;; arch-tag: 277e3a81-fdee-40cf-9e6b-59626292a5e0
+;;; tramp-gw.el ends here
index a3cf522..5dbf129 100644 (file)
@@ -1,6 +1,7 @@
-;;; tramp-smb.el --- Tramp access functions for SMB servers -*- coding: iso-8859-1; -*-
+;;; tramp-smb.el --- Tramp access functions for SMB servers
 
-;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004, 2005, 2006,
+;;   2007 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
@@ -18,9 +19,8 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs; see the file COPYING.  If not, see
+;; <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
@@ -29,6 +29,7 @@
 ;;; Code:
 
 (require 'tramp)
+(require 'tramp-cache)
 
 ;; Pacify byte-compiler
 (eval-when-compile (require 'custom))
 ;; Avoid byte-compiler warnings if the byte-compiler supports this.
 ;; Currently, XEmacs supports this.
 (eval-when-compile
-  (when (fboundp 'byte-compiler-options)
-    (let (unused-vars) ; Pacify Emacs byte-compiler
-      (defalias 'warnings 'identity) ; Pacify Emacs byte-compiler
-      (byte-compiler-options (warnings (- unused-vars))))))
+  (when (featurep 'xemacs)
+      (byte-compiler-options (warnings (- unused-vars)))))
 
 ;; Define SMB method ...
 (defcustom tramp-smb-method "smb"
 ;; Add a default for `tramp-default-method-alist'. Rule: If there is
 ;; a domain in USER, it must be the SMB method.
 (add-to-list 'tramp-default-method-alist
-            (list "" "%" tramp-smb-method))
+            `(nil "%" ,tramp-smb-method))
+
+;; Add a default for `tramp-default-user-alist'. Rule: For the SMB method,
+;; the anonymous user is chosen.
+(add-to-list 'tramp-default-user-alist
+            `(,tramp-smb-method nil ""))
 
 ;; Add completion function for SMB method.
 (tramp-set-completion-function
   "Regexp used as prompt in smbclient.")
 
 (defconst tramp-smb-errors
+  ;; `regexp-opt' not possible because of first string.
   (mapconcat
    'identity
-   '(; Connection error
+   '(;; Connection error / timeout
      "Connection to \\S-+ failed"
-     ; Samba
+     "Read from server failed, maybe it closed the connection"
+     ;; Samba
      "ERRDOS"
      "ERRSRV"
      "ERRbadfile"
      "ERRnoaccess"
      "ERRnomem"
      "ERRnosuchshare"
-     ; Windows NT 4.0, Windows 5.0 (Windows 2000), Windows 5.1 (Windows XP)
+     ;; Windows 4.0 (Windows NT), Windows 5.0 (Windows 2000),
+     ;; Windows 5.1 (Windows XP), Windows 5.2 (Windows Server 2003)
      "NT_STATUS_ACCESS_DENIED"
      "NT_STATUS_ACCOUNT_LOCKED_OUT"
      "NT_STATUS_BAD_NETWORK_NAME"
      "NT_STATUS_CANNOT_DELETE"
+     "NT_STATUS_DIRECTORY_NOT_EMPTY"
+     "NT_STATUS_DUPLICATE_NAME"
+     "NT_STATUS_FILE_IS_A_DIRECTORY"
      "NT_STATUS_LOGON_FAILURE"
      "NT_STATUS_NETWORK_ACCESS_DENIED"
      "NT_STATUS_NO_SUCH_FILE"
+     "NT_STATUS_OBJECT_NAME_COLLISION"
      "NT_STATUS_OBJECT_NAME_INVALID"
      "NT_STATUS_OBJECT_NAME_NOT_FOUND"
      "NT_STATUS_SHARING_VIOLATION"
+     "NT_STATUS_TRUSTED_RELATIONSHIP_FAILURE"
      "NT_STATUS_WRONG_PASSWORD")
    "\\|")
   "Regexp for possible error strings of SMB servers.
 Used instead of analyzing error codes of commands.")
 
-(defvar tramp-smb-share nil
-  "Holds the share name for the current buffer.
-This variable is local to each buffer.")
-(make-variable-buffer-local 'tramp-smb-share)
+(defconst tramp-smb-actions-with-share
+  '((tramp-smb-prompt tramp-action-succeed)
+    (tramp-password-prompt-regexp tramp-action-password)
+    (tramp-wrong-passwd-regexp tramp-action-permission-denied)
+    (tramp-smb-errors tramp-action-permission-denied)
+    (tramp-process-alive-regexp tramp-action-process-alive))
+  "List of pattern/action pairs.
+This list is used for login to SMB servers.
+
+See `tramp-actions-before-shell' for more info.")
 
-(defvar tramp-smb-share-cache nil
-  "Caches the share names accessible to host related to the current buffer.
-This variable is local to each buffer.")
-(make-variable-buffer-local 'tramp-smb-share-cache)
+(defconst tramp-smb-actions-without-share
+  '((tramp-password-prompt-regexp tramp-action-password)
+    (tramp-wrong-passwd-regexp tramp-action-permission-denied)
+    (tramp-smb-errors tramp-action-permission-denied)
+    (tramp-process-alive-regexp tramp-action-out-of-band))
+  "List of pattern/action pairs.
+This list is used for login to SMB servers.
 
-(defvar tramp-smb-inodes nil
-  "Keeps virtual inodes numbers for SMB files.")
+See `tramp-actions-before-shell' for more info.")
 
 ;; New handlers should be added here.
 (defconst tramp-smb-file-name-handler-alist
@@ -124,8 +144,8 @@ This variable is local to each buffer.")
     (directory-file-name . tramp-handle-directory-file-name)
     (directory-files . tramp-smb-handle-directory-files)
     (directory-files-and-attributes . tramp-smb-handle-directory-files-and-attributes)
-    (dired-call-process . tramp-smb-not-handled)
-    (dired-compress-file . tramp-smb-not-handled)
+    (dired-call-process . ignore)
+    (dired-compress-file . ignore)
     ;; `dired-uncache' performed by default handler
     ;; `expand-file-name' not necessary because we cannot expand "~/"
     (file-accessible-directory-p . tramp-smb-handle-file-directory-p)
@@ -143,10 +163,10 @@ This variable is local to each buffer.")
     (file-name-nondirectory . tramp-handle-file-name-nondirectory)
     ;; `file-name-sans-versions' performed by default handler
     (file-newer-than-file-p . tramp-smb-handle-file-newer-than-file-p)
-    (file-ownership-preserved-p . tramp-smb-not-handled)
+    (file-ownership-preserved-p . ignore)
     (file-readable-p . tramp-smb-handle-file-exists-p)
     (file-regular-p . tramp-handle-file-regular-p)
-    (file-symlink-p . tramp-smb-not-handled)
+    (file-symlink-p . tramp-handle-file-symlink-p)
     ;; `file-truename' performed by default handler
     (file-writable-p . tramp-smb-handle-file-writable-p)
     (find-backup-file-name . tramp-handle-find-backup-file-name)
@@ -157,15 +177,15 @@ This variable is local to each buffer.")
     (load . tramp-handle-load)
     (make-directory . tramp-smb-handle-make-directory)
     (make-directory-internal . tramp-smb-handle-make-directory-internal)
-    (make-symbolic-link . tramp-smb-not-handled)
+    (make-symbolic-link . ignore)
     (rename-file . tramp-smb-handle-rename-file)
-    (set-file-modes . tramp-smb-not-handled)
-    (set-visited-file-modtime . tramp-smb-not-handled)
-    (shell-command . tramp-smb-not-handled)
+    (set-file-modes . ignore)
+    (set-visited-file-modtime . ignore)
+    (shell-command . ignore)
     (substitute-in-file-name . tramp-smb-handle-substitute-in-file-name)
     (unhandled-file-name-directory . tramp-handle-unhandled-file-name-directory)
-    (vc-registered . tramp-smb-not-handled)
-    (verify-visited-file-modtime . tramp-smb-not-handled)
+    (vc-registered . ignore)
+    (verify-visited-file-modtime . ignore)
     (write-region . tramp-smb-handle-write-region)
 )
   "Alist of handler functions for Tramp SMB method.
@@ -174,13 +194,7 @@ Operations not mentioned here will be handled by the default Emacs primitives.")
 (defun tramp-smb-file-name-p (filename)
   "Check if it's a filename for SMB servers."
   (let ((v (tramp-dissect-file-name filename)))
-    (string=
-     (tramp-find-method
-      (tramp-file-name-multi-method v)
-      (tramp-file-name-method v)
-      (tramp-file-name-user v)
-      (tramp-file-name-host v))
-     tramp-smb-method)))
+    (string= (tramp-file-name-method v) tramp-smb-method)))
 
 (defun tramp-smb-file-name-handler (operation &rest args)
   "Invoke the SMB related OPERATION.
@@ -188,9 +202,7 @@ First arg specifies the OPERATION, second arg is a list of arguments to
 pass to the OPERATION."
   (let ((fn (assoc operation tramp-smb-file-name-handler-alist)))
     (if fn
-       (if (eq (cdr fn) 'tramp-smb-not-handled)
-           (apply (cdr fn) operation args)
-         (save-match-data (apply (cdr fn) args)))
+       (save-match-data (apply (cdr fn) args))
       (tramp-run-real-handler operation args))))
 
 (add-to-list 'tramp-foreign-file-name-handler-alist
@@ -199,14 +211,9 @@ pass to the OPERATION."
 
 ;; File name primitives
 
-(defun tramp-smb-not-handled (operation &rest args)
-  "Default handler for all functions which are disrecarded."
-  (tramp-message 10 "Won't be handled: %s %s" operation args)
-  nil)
-
 (defun tramp-smb-handle-copy-file
   (filename newname &optional ok-if-already-exists keep-date)
-  "Like `copy-file' for tramp files.
+  "Like `copy-file' for Tramp files.
 KEEP-DATE is not handled in case NEWNAME resides on an SMB server."
   (setq filename (expand-file-name filename)
        newname (expand-file-name newname))
@@ -214,199 +221,187 @@ KEEP-DATE is not handled in case NEWNAME resides on an SMB server."
   (let ((tmpfile (file-local-copy filename)))
 
     (if tmpfile
-       ;; remote filename
+       ;; Remote filename.
        (rename-file tmpfile newname ok-if-already-exists)
 
-      ;; remote newname
+      ;; Remote newname.
       (when (file-directory-p newname)
        (setq newname (expand-file-name
                       (file-name-nondirectory filename) newname)))
-      (when (and (not ok-if-already-exists)
-                (file-exists-p newname))
-       (error "copy-file: file %s already exists" newname))
 
       (with-parsed-tramp-file-name newname nil
-       (save-excursion
-         (let ((share (tramp-smb-get-share localname))
-               (file (tramp-smb-get-localname localname t)))
-           (unless share
-             (error "Target `%s' must contain a share name" filename))
-           (tramp-smb-maybe-open-connection user host share)
-           (tramp-message-for-buffer
-            nil tramp-smb-method user host
-            5 "Copying file %s to file %s..." filename newname)
-           (if (tramp-smb-send-command
-                user host (format "put %s \"%s\"" filename file))
-               (tramp-message-for-buffer
-                nil tramp-smb-method user host
-                5 "Copying file %s to file %s...done" filename newname)
-             (error "Cannot copy `%s'" filename))))))))
+       (when (and (not ok-if-already-exists)
+                  (file-exists-p newname))
+         (tramp-error v 'file-already-exists newname))
+
+       ;; We must also flush the cache of the directory, because
+       ;; file-attributes reads the values from there.
+       (tramp-flush-file-property v (file-name-directory localname))
+       (tramp-flush-file-property v localname)
+       (let ((share (tramp-smb-get-share localname))
+             (file (tramp-smb-get-localname localname t)))
+         (unless share
+           (tramp-error
+            v 'file-error "Target `%s' must contain a share name" newname))
+         (tramp-message v 0 "Copying file %s to file %s..." filename newname)
+         (if (tramp-smb-send-command
+              v (format "put %s \"%s\"" filename file))
+             (tramp-message
+              v 0 "Copying file %s to file %s...done" filename newname)
+           (tramp-error v 'file-error "Cannot copy `%s'" filename)))))))
 
 (defun tramp-smb-handle-delete-directory (directory)
-  "Like `delete-directory' for tramp files."
+  "Like `delete-directory' for Tramp files."
   (setq directory (directory-file-name (expand-file-name directory)))
   (when (file-exists-p directory)
     (with-parsed-tramp-file-name directory nil
-      (save-excursion
-       (let ((share (tramp-smb-get-share localname))
-             (dir (tramp-smb-get-localname (file-name-directory localname) t))
-             (file (file-name-nondirectory localname)))
-         (tramp-smb-maybe-open-connection user host share)
-         (if (and
-              (tramp-smb-send-command user host (format "cd \"%s\"" dir))
-              (tramp-smb-send-command user host (format "rmdir \"%s\"" file)))
-             ;; Go Home
-             (tramp-smb-send-command user host (format "cd \\"))
-           ;; Error
-           (tramp-smb-send-command user host (format "cd \\"))
-           (error "Cannot delete directory `%s'" directory)))))))
+      ;; We must also flush the cache of the directory, because
+      ;; file-attributes reads the values from there.
+      (tramp-flush-file-property v (file-name-directory localname))
+      (tramp-flush-directory-property v localname)
+      (let ((dir (tramp-smb-get-localname (file-name-directory localname) t))
+           (file (file-name-nondirectory localname)))
+       (unwind-protect
+           (unless (and
+                    (tramp-smb-send-command v (format "cd \"%s\"" dir))
+                    (tramp-smb-send-command v (format "rmdir \"%s\"" file)))
+             ;; Error
+             (with-current-buffer (tramp-get-connection-buffer v)
+               (goto-char (point-min))
+               (search-forward-regexp tramp-smb-errors nil t)
+               (tramp-error
+                v 'file-error "%s `%s'" (match-string 0) directory)))
+         ;; Always go home
+         (tramp-smb-send-command v (format "cd \\")))))))
 
 (defun tramp-smb-handle-delete-file (filename)
-  "Like `delete-file' for tramp files."
+  "Like `delete-file' for Tramp files."
   (setq filename (expand-file-name filename))
   (when (file-exists-p filename)
     (with-parsed-tramp-file-name filename nil
-      (save-excursion
-       (let ((share (tramp-smb-get-share localname))
-             (dir (tramp-smb-get-localname (file-name-directory localname) t))
-             (file (file-name-nondirectory localname)))
-         (tramp-smb-maybe-open-connection user host share)
-         (if (and
-              (tramp-smb-send-command user host (format "cd \"%s\"" dir))
-              (tramp-smb-send-command user host (format "rm \"%s\"" file)))
-             ;; Go Home
-             (tramp-smb-send-command user host (format "cd \\"))
-           ;; Error
-           (tramp-smb-send-command user host (format "cd \\"))
-           (error "Cannot delete file `%s'" filename)))))))
+      ;; We must also flush the cache of the directory, because
+      ;; file-attributes reads the values from there.
+      (tramp-flush-file-property v (file-name-directory localname))
+      (tramp-flush-file-property v localname)
+      (let ((dir (tramp-smb-get-localname (file-name-directory localname) t))
+           (file (file-name-nondirectory localname)))
+       (unwind-protect
+           (unless (and
+                    (tramp-smb-send-command v (format "cd \"%s\"" dir))
+                    (tramp-smb-send-command v (format "rm \"%s\"" file)))
+             ;; Error
+             (with-current-buffer (tramp-get-connection-buffer v)
+               (goto-char (point-min))
+               (search-forward-regexp tramp-smb-errors nil t)
+               (tramp-error
+                v 'file-error "%s `%s'" (match-string 0) filename)))
+         ;; Always go home
+         (tramp-smb-send-command v (format "cd \\")))))))
 
 (defun tramp-smb-handle-directory-files
   (directory &optional full match nosort)
-  "Like `directory-files' for tramp files."
-  (setq directory (directory-file-name (expand-file-name directory)))
-  (with-parsed-tramp-file-name directory nil
-    (save-excursion
-      (let* ((share (tramp-smb-get-share localname))
-            (file (tramp-smb-get-localname localname nil))
-            (entries (tramp-smb-get-file-entries user host share file)))
-       ;; Just the file names are needed
-       (setq entries (mapcar 'car entries))
-       ;; Discriminate with regexp
-       (when match
-         (setq entries
-               (delete nil
-                       (mapcar (lambda (x) (when (string-match match x) x))
-                               entries))))
-       ;; Make absolute localnames if necessary
-       (when full
-         (setq entries
-               (mapcar (lambda (x)
-                         (concat (file-name-as-directory directory) x))
-                       entries)))
-       ;; Sort them if necessary
-       (unless nosort (setq entries (sort entries 'string-lessp)))
-       ;; That's it
-       entries))))
+  "Like `directory-files' for Tramp files."
+  (let ((result (mapcar 'directory-file-name
+                       (file-name-all-completions "" directory))))
+    ;; Discriminate with regexp
+    (when match
+      (setq result
+           (delete nil
+                   (mapcar (lambda (x) (when (string-match match x) x))
+                           result))))
+    ;; Append directory
+    (when full
+      (setq result
+           (mapcar
+            (lambda (x) (expand-file-name x directory))
+            result)))
+    ;; Sort them if necessary
+    (unless nosort (setq result (sort result 'string-lessp)))
+    ;; That's it
+    result))
 
 (defun tramp-smb-handle-directory-files-and-attributes
   (directory &optional full match nosort id-format)
-  "Like `directory-files-and-attributes' for tramp files."
+  "Like `directory-files-and-attributes' for Tramp files."
   (mapcar
    (lambda (x)
      ;; We cannot call `file-attributes' for backward compatibility reasons.
      ;; Its optional parameter ID-FORMAT is introduced with Emacs 22.
      (cons x (tramp-smb-handle-file-attributes
-       (if full x (concat (file-name-as-directory directory) x)) id-format)))
+       (if full x (expand-file-name x directory)) id-format)))
    (directory-files directory full match nosort)))
 
 (defun tramp-smb-handle-file-attributes (filename &optional id-format)
-  "Like `file-attributes' for tramp files."
+  "Like `file-attributes' for Tramp files."
+  ;; Reading just the filename entry via "dir localname" is not
+  ;; possible, because when filename is a directory, some smbclient
+  ;; versions return the content of the directory, and other versions
+  ;; don't.  Therefore, the whole content of the upper directory is
+  ;; retrieved, and the entry of the filename is extracted from.
   (with-parsed-tramp-file-name filename nil
-    (save-excursion
-      (let* ((share (tramp-smb-get-share localname))
-            (file (tramp-smb-get-localname localname nil))
-            (entries (tramp-smb-get-file-entries user host share file))
+    (with-file-property v localname (format "file-attributes-%s" id-format)
+      (let* ((entries (tramp-smb-get-file-entries
+                      (file-name-directory filename)))
             (entry (and entries
-                        (assoc (file-name-nondirectory file) entries)))
+                        (assoc (file-name-nondirectory filename) entries)))
             (uid (if (and id-format (equal id-format 'string)) "nobody" -1))
             (gid (if (and id-format (equal id-format 'string)) "nogroup" -1))
-            (inode (tramp-smb-get-inode share file))
-            (device (tramp-get-device nil tramp-smb-method user host)))
+            (inode (tramp-get-inode v))
+            (device (tramp-get-device v)))
 
-       ; check result
+        ;; Check result.
        (when entry
          (list (and (string-match "d" (nth 1 entry))
-                    t)         ;0 file type
-               -1              ;1 link count
-               uid             ;2 uid
-               gid             ;3 gid
-               '(0 0)          ;4 atime
-               (nth 3 entry)   ;5 mtime
-               '(0 0)          ;6 ctime
-               (nth 2 entry)   ;7 size
-               (nth 1 entry)   ;8 mode
-               nil             ;9 gid weird
-               inode           ;10 inode number
-               device))))))    ;11 file system number
+                    t)       ;0 file type
+               -1            ;1 link count
+               uid           ;2 uid
+               gid           ;3 gid
+               '(0 0)        ;4 atime
+               (nth 3 entry) ;5 mtime
+               '(0 0)        ;6 ctime
+               (nth 2 entry) ;7 size
+               (nth 1 entry) ;8 mode
+               nil           ;9 gid weird
+               inode         ;10 inode number
+               device))))))  ;11 file system number
 
 (defun tramp-smb-handle-file-directory-p (filename)
-  "Like `file-directory-p' for tramp files."
-  (with-parsed-tramp-file-name filename nil
-    (save-excursion
-      (let* ((share (tramp-smb-get-share localname))
-            (file (tramp-smb-get-localname localname nil))
-            (entries (tramp-smb-get-file-entries user host share file))
-            (entry (and entries
-                        (assoc (file-name-nondirectory file) entries))))
-       (and entry
-            (string-match "d" (nth 1 entry))
-            t)))))
+  "Like `file-directory-p' for Tramp files."
+  (and (file-exists-p filename)
+       (eq ?d (aref (nth 8 (file-attributes filename)) 0))))
 
 (defun tramp-smb-handle-file-exists-p (filename)
-  "Like `file-exists-p' for tramp files."
-  (with-parsed-tramp-file-name filename nil
-    (save-excursion
-      (let* ((share (tramp-smb-get-share localname))
-            (file (tramp-smb-get-localname localname nil))
-            (entries (tramp-smb-get-file-entries user host share file)))
-       (and entries
-            (member (file-name-nondirectory file) (mapcar 'car entries))
-            t)))))
+  "Like `file-exists-p' for Tramp files."
+  (not (null (file-attributes filename))))
 
 (defun tramp-smb-handle-file-local-copy (filename)
-  "Like `file-local-copy' for tramp files."
+  "Like `file-local-copy' for Tramp files."
   (with-parsed-tramp-file-name filename nil
-    (save-excursion
-      (let ((share (tramp-smb-get-share localname))
-           (file (tramp-smb-get-localname localname t))
-           (tmpfil (tramp-make-temp-file filename)))
-       (unless (file-exists-p filename)
-         (error "Cannot make local copy of non-existing file `%s'" filename))
-       (tramp-message-for-buffer
-        nil tramp-smb-method user host
-        5 "Fetching %s to tmp file %s..." filename tmpfil)
-       (tramp-smb-maybe-open-connection user host share)
-       (if (tramp-smb-send-command
-            user host (format "get \"%s\" %s" file tmpfil))
-           (tramp-message-for-buffer
-            nil tramp-smb-method user host
-            5 "Fetching %s to tmp file %s...done" filename tmpfil)
-         (error "Cannot make local copy of file `%s'" filename))
-       tmpfil))))
+    (let ((file (tramp-smb-get-localname localname t))
+         (tmpfil (tramp-make-temp-file filename)))
+      (unless (file-exists-p filename)
+       (tramp-error
+        v 'file-error
+        "Cannot make local copy of non-existing file `%s'" filename))
+      (tramp-message v 4 "Fetching %s to tmp file %s..." filename tmpfil)
+      (if (tramp-smb-send-command v (format "get \"%s\" %s" file tmpfil))
+         (tramp-message
+          v 4 "Fetching %s to tmp file %s...done" filename tmpfil)
+       (tramp-error
+        v 'file-error
+        "Cannot make local copy of file `%s'" filename))
+      tmpfil)))
 
 ;; This function should return "foo/" for directories and "bar" for
 ;; files.
 (defun tramp-smb-handle-file-name-all-completions (filename directory)
-  "Like `file-name-all-completions' for tramp files."
-  (with-parsed-tramp-file-name directory nil
-    (save-match-data
-      (save-excursion
-       (let* ((share (tramp-smb-get-share localname))
-              (file (tramp-smb-get-localname localname nil))
-              (entries (tramp-smb-get-file-entries user host share file)))
-
-         (all-completions
-          filename
+  "Like `file-name-all-completions' for Tramp files."
+  (all-completions
+   filename
+   (with-parsed-tramp-file-name directory nil
+     (with-file-property v localname "file-name-all-completions"
+       (save-match-data
+        (let ((entries (tramp-smb-get-file-entries directory)))
           (mapcar
            (lambda (x)
              (list
@@ -416,51 +411,59 @@ KEEP-DATE is not handled in case NEWNAME resides on an SMB server."
            entries)))))))
 
 (defun tramp-smb-handle-file-newer-than-file-p (file1 file2)
-  "Like `file-newer-than-file-p' for tramp files."
+  "Like `file-newer-than-file-p' for Tramp files."
   (cond
    ((not (file-exists-p file1)) nil)
    ((not (file-exists-p file2)) t)
-   (t (tramp-smb-time-less-p (file-attributes file2)
-                            (file-attributes file1)))))
+   (t (tramp-time-less-p (nth 5 (file-attributes file2))
+                        (nth 5 (file-attributes file1))))))
 
 (defun tramp-smb-handle-file-writable-p (filename)
-  "Like `file-writable-p' for tramp files."
-  (if (not (file-exists-p filename))
-      (let ((dir (file-name-directory filename)))
-       (and (file-exists-p dir)
-            (file-writable-p dir)))
-    (with-parsed-tramp-file-name filename nil
-      (save-excursion
-       (let* ((share (tramp-smb-get-share localname))
-              (file (tramp-smb-get-localname localname nil))
-              (entries (tramp-smb-get-file-entries user host share file))
-              (entry (and entries
-                          (assoc (file-name-nondirectory file) entries))))
-         (and share entry
-              (string-match "w" (nth 1 entry))
-              t))))))
+  "Like `file-writable-p' for Tramp files."
+  (if (file-exists-p filename)
+      (string-match "w" (or (nth 8 (file-attributes filename)) ""))
+    (let ((dir (file-name-directory filename)))
+      (and (file-exists-p dir)
+          (file-writable-p dir)))))
 
 (defun tramp-smb-handle-insert-directory
   (filename switches &optional wildcard full-directory-p)
-  "Like `insert-directory' for tramp files.
-WILDCARD and FULL-DIRECTORY-P are not handled."
+  "Like `insert-directory' for Tramp files."
   (setq filename (expand-file-name filename))
-  (when (file-directory-p filename)
-    ;; This check is a little bit strange, but in `dired-add-entry'
-    ;; this function is called with a non-directory ...
+  (when full-directory-p
+    ;; Called from `dired-add-entry'.
     (setq filename (file-name-as-directory filename)))
   (with-parsed-tramp-file-name filename nil
+    (tramp-flush-file-property v (file-name-directory localname))
     (save-match-data
-      (let* ((share (tramp-smb-get-share localname))
-            (file (tramp-smb-get-localname localname nil))
-            (entries (tramp-smb-get-file-entries user host share file)))
-
-       ;; Delete dummy "" entry, useless entries
+      (let ((base (file-name-nondirectory filename))
+           ;; We should not destroy the cache entry.
+           (entries (copy-sequence
+                     (tramp-smb-get-file-entries
+                      (file-name-directory filename)))))
+
+       (when wildcard
+         (string-match "\\." base)
+         (setq base (replace-match "\\\\." nil nil base))
+         (string-match "\\*" base)
+         (setq base (replace-match ".*" nil nil base))
+         (string-match "\\?" base)
+         (setq base (replace-match ".?" nil nil base)))
+
+       ;; Filter entries.
        (setq entries
-             (if (file-directory-p filename)
-                 (delq (assoc "" entries) entries)
-               ;; We just need the only and only entry FILENAME.
-               (list (assoc (file-name-nondirectory filename) entries))))
+             (delq
+              nil
+              (if (or wildcard (zerop (length base)))
+                  ;; Check for matching entries.
+                  (mapcar
+                   (lambda (x)
+                     (when (string-match
+                            (format "^%s" base) (nth 0 x))
+                       x))
+                   entries)
+                ;; We just need the only and only entry FILENAME.
+                (list (assoc base entries)))))
 
        ;; Sort entries
        (setq entries
@@ -468,37 +471,38 @@ WILDCARD and FULL-DIRECTORY-P are not handled."
               entries
               (lambda (x y)
                 (if (string-match "t" switches)
-                    ; sort by date
-                    (tramp-smb-time-less-p (nth 3 y) (nth 3 x))
-                  ; sort by name
+                    ;; Sort by date.
+                    (tramp-time-less-p (nth 3 y) (nth 3 x))
+                  ;; Sort by name.
                   (string-lessp (nth 0 x) (nth 0 y))))))
 
-       ;; Print entries
+       ;; Print entries.
        (mapcar
         (lambda (x)
-          (insert
-           (format
-            "%10s %3d %-8s %-8s %8s %s %s\n"
-            (nth 1 x) ; mode
-            1 "nobody" "nogroup"
-            (nth 2 x) ; size
-            (format-time-string
-             (if (tramp-smb-time-less-p
-                  (tramp-smb-time-subtract (current-time) (nth 3 x))
-                  tramp-smb-half-a-year)
-                 "%b %e %R"
-               "%b %e  %Y")
-             (nth 3 x)) ; date
-            (nth 0 x))) ; file name
-          (forward-line)
-          (beginning-of-line))
-        entries)))))
+          (when (not (zerop (length (nth 0 x))))
+            (insert
+             (format
+              "%10s %3d %-8s %-8s %8s %s %s\n"
+              (nth 1 x) ; mode
+              1 "nobody" "nogroup"
+              (nth 2 x) ; size
+              (format-time-string
+               (if (tramp-time-less-p
+                    (tramp-time-subtract (current-time) (nth 3 x))
+                    tramp-half-a-year)
+                   "%b %e %R"
+                 "%b %e  %Y")
+               (nth 3 x)) ; date
+              (nth 0 x))) ; file name
+            (forward-line)
+            (beginning-of-line)))
+          entries)))))
 
 (defun tramp-smb-handle-make-directory (dir &optional parents)
-  "Like `make-directory' for tramp files."
+  "Like `make-directory' for Tramp files."
   (setq dir (directory-file-name (expand-file-name dir)))
   (unless (file-name-absolute-p dir)
-    (setq dir (concat default-directory dir)))
+    (setq dir (expand-file-name dir default-directory)))
   (with-parsed-tramp-file-name dir nil
     (save-match-data
       (let* ((share (tramp-smb-get-share localname))
@@ -510,26 +514,28 @@ WILDCARD and FULL-DIRECTORY-P are not handled."
        (when (file-directory-p ldir)
          (make-directory-internal dir))
        (unless (file-directory-p dir)
-         (error "Couldn't make directory %s" dir))))))
+         (tramp-error v 'file-error "Couldn't make directory %s" dir))))))
 
 (defun tramp-smb-handle-make-directory-internal (directory)
-  "Like `make-directory-internal' for tramp files."
+  "Like `make-directory-internal' for Tramp files."
   (setq directory (directory-file-name (expand-file-name directory)))
   (unless (file-name-absolute-p directory)
-    (setq directory (concat default-directory directory)))
+    (setq directory (expand-file-name directory default-directory)))
   (with-parsed-tramp-file-name directory nil
     (save-match-data
-      (let* ((share (tramp-smb-get-share localname))
-            (file (tramp-smb-get-localname localname nil)))
+      (let* ((file (tramp-smb-get-localname localname t)))
        (when (file-directory-p (file-name-directory directory))
-         (tramp-smb-maybe-open-connection user host share)
-         (tramp-smb-send-command user host (format "mkdir \"%s\"" file)))
+         (tramp-smb-send-command v (format "mkdir \"%s\"" file))
+         ;; We must also flush the cache of the directory, because
+         ;; file-attributes reads the values from there.
+         (tramp-flush-file-property v (file-name-directory localname)))
        (unless (file-directory-p directory)
-         (error "Couldn't make directory %s" directory))))))
+         (tramp-error
+          v 'file-error "Couldn't make directory %s" directory))))))
 
 (defun tramp-smb-handle-rename-file
   (filename newname &optional ok-if-already-exists)
-  "Like `rename-file' for tramp files."
+  "Like `rename-file' for Tramp files."
   (setq filename (expand-file-name filename)
        newname (expand-file-name newname))
 
@@ -543,29 +549,26 @@ WILDCARD and FULL-DIRECTORY-P are not handled."
       (when (file-directory-p newname)
        (setq newname (expand-file-name
                      (file-name-nondirectory filename) newname)))
-      (when (and (not ok-if-already-exists)
-                (file-exists-p newname))
-         (error "rename-file: file %s already exists" newname))
 
       (with-parsed-tramp-file-name newname nil
-       (save-excursion
-         (let ((share (tramp-smb-get-share localname))
-               (file (tramp-smb-get-localname localname t)))
-           (tramp-smb-maybe-open-connection user host share)
-           (tramp-message-for-buffer
-            nil tramp-smb-method user host
-            5 "Copying file %s to file %s..." filename newname)
-           (if (tramp-smb-send-command
-                user host (format "put %s \"%s\"" filename file))
-               (tramp-message-for-buffer
-                nil tramp-smb-method user host
-                5 "Copying file %s to file %s...done" filename newname)
-             (error "Cannot rename `%s'" filename)))))))
+       (when (and (not ok-if-already-exists)
+                  (file-exists-p newname))
+         (tramp-error v 'file-already-exists newname))
+       ;; We must also flush the cache of the directory, because
+       ;; file-attributes reads the values from there.
+       (tramp-flush-file-property v (file-name-directory localname))
+       (tramp-flush-file-property v localname)
+       (let ((file (tramp-smb-get-localname localname t)))
+         (tramp-message v 0 "Copying file %s to file %s..." filename newname)
+         (if (tramp-smb-send-command v (format "put %s \"%s\"" filename file))
+             (tramp-message
+              v 0 "Copying file %s to file %s...done" filename newname)
+           (tramp-error v 'file-error "Cannot rename `%s'" filename))))))
 
   (delete-file filename))
 
 (defun tramp-smb-handle-substitute-in-file-name (filename)
-  "Like `handle-substitute-in-file-name' for tramp files.
+  "Like `handle-substitute-in-file-name' for Tramp files.
 Catches errors for shares like \"C$/\", which are common in Microsoft Windows."
   (condition-case nil
       (tramp-run-real-handler 'substitute-in-file-name (list filename))
@@ -573,50 +576,49 @@ Catches errors for shares like \"C$/\", which are common in Microsoft Windows."
 
 (defun tramp-smb-handle-write-region
   (start end filename &optional append visit lockname confirm)
-  "Like `write-region' for tramp files."
-  (unless (eq append nil)
-    (error "Cannot append to file using tramp (`%s')" filename))
+  "Like `write-region' for Tramp files."
   (setq filename (expand-file-name filename))
-  ;; XEmacs takes a coding system as the seventh argument, not `confirm'
-  (when (and (not (featurep 'xemacs))
-            confirm (file-exists-p filename))
-    (unless (y-or-n-p (format "File %s exists; overwrite anyway? "
-                              filename))
-      (error "File not overwritten")))
   (with-parsed-tramp-file-name filename nil
-    (save-excursion
-      (let ((share (tramp-smb-get-share localname))
-           (file (tramp-smb-get-localname localname t))
-           (curbuf (current-buffer))
-           tmpfil)
-       ;; Write region into a tmp file.
-       (setq tmpfil (tramp-make-temp-file filename))
-       ;; We say `no-message' here because we don't want the visited file
-       ;; modtime data to be clobbered from the temp file.  We call
-       ;; `set-visited-file-modtime' ourselves later on.
-       (tramp-run-real-handler
-        'write-region
-        (if confirm ; don't pass this arg unless defined for backward compat.
-            (list start end tmpfil append 'no-message lockname confirm)
-          (list start end tmpfil append 'no-message lockname)))
-
-       (tramp-smb-maybe-open-connection user host share)
-       (tramp-message-for-buffer
-        nil tramp-smb-method user host
-        5 "Writing tmp file %s to file %s..." tmpfil filename)
-       (if (tramp-smb-send-command
-            user host (format "put %s \"%s\"" tmpfil file))
-           (tramp-message-for-buffer
-            nil tramp-smb-method user host
-            5 "Writing tmp file %s to file %s...done" tmpfil filename)
-         (error "Cannot write `%s'" filename))
-
-       (delete-file tmpfil)
-       (unless (equal curbuf (current-buffer))
-         (error "Buffer has changed from `%s' to `%s'"
-                curbuf (current-buffer)))
-       (when (eq visit t)
-         (set-visited-file-modtime))))))
+    (unless (eq append nil)
+      (tramp-error
+        v 'file-error "Cannot append to file using tramp (`%s')" filename))
+    ;; XEmacs takes a coding system as the seventh argument, not `confirm'
+    (when (and (not (featurep 'xemacs))
+              confirm (file-exists-p filename))
+      (unless (y-or-n-p (format "File %s exists; overwrite anyway? "
+                               filename))
+       (tramp-error v 'file-error "File not overwritten")))
+    ;; We must also flush the cache of the directory, because
+    ;; file-attributes reads the values from there.
+    (tramp-flush-file-property v (file-name-directory localname))
+    (tramp-flush-file-property v localname)
+    (let ((file (tramp-smb-get-localname localname t))
+         (curbuf (current-buffer))
+         tmpfil)
+      ;; Write region into a tmp file.
+      (setq tmpfil (tramp-make-temp-file filename))
+      ;; We say `no-message' here because we don't want the visited file
+      ;; modtime data to be clobbered from the temp file.  We call
+      ;; `set-visited-file-modtime' ourselves later on.
+      (tramp-run-real-handler
+       'write-region
+       (if confirm ; don't pass this arg unless defined for backward compat.
+          (list start end tmpfil append 'no-message lockname confirm)
+        (list start end tmpfil append 'no-message lockname)))
+
+      (tramp-message v 5 "Writing tmp file %s to file %s..." tmpfil filename)
+      (if (tramp-smb-send-command v (format "put %s \"%s\"" tmpfil file))
+         (tramp-message
+          v 5 "Writing tmp file %s to file %s...done" tmpfil filename)
+       (tramp-error v 'file-error "Cannot write `%s'" filename))
+
+      (delete-file tmpfil)
+      (unless (equal curbuf (current-buffer))
+       (tramp-error
+        v 'file-error
+        "Buffer has changed from `%s' to `%s'" curbuf (current-buffer)))
+      (when (eq visit t)
+       (set-visited-file-modtime)))))
 
 
 ;; Internal file name functions
@@ -652,51 +654,53 @@ If CONVERT is non-nil exchange \"/\" by \"\\\\\"."
 
 ;; Share names of a host are cached. It is very unlikely that the
 ;; shares do change during connection.
-(defun tramp-smb-get-file-entries (user host share localname)
-  "Read entries which match LOCALNAME.
+(defun tramp-smb-get-file-entries (directory)
+  "Read entries which match DIRECTORY.
 Either the shares are listed, or the `dir' command is executed.
-Only entries matching the localname are returned.
 Result is a list of (LOCALNAME MODE SIZE MONTH DAY TIME YEAR)."
-  (save-excursion
-    (save-match-data
-      (let ((base (or (and (> (length localname) 0)
-                          (string-match "\\([^/]+\\)$" localname)
-                          (regexp-quote (match-string 1 localname)))
-                     ""))
-           res entry)
-       (set-buffer (tramp-get-buffer nil tramp-smb-method user host))
-       (if (and (not share) tramp-smb-share-cache)
-           ;; Return cached shares
-           (setq res tramp-smb-share-cache)
-         ;; Read entries
-         (tramp-smb-maybe-open-connection user host share)
-         (when share
-           (tramp-smb-send-command
-            user host
-            (format "dir %s"
-                    (if (zerop (length localname)) "" (concat "\"" localname "*\"")))))
-         (goto-char (point-min))
-         ;; Loop the listing
-         (unless (re-search-forward tramp-smb-errors nil t)
-           (while (not (eobp))
-             (setq entry (tramp-smb-read-file-entry share))
-             (forward-line)
-             (when entry (add-to-list 'res entry))))
-         (unless share
+  (with-parsed-tramp-file-name directory nil
+    (setq localname (or localname "/"))
+    (with-file-property v localname "file-entries"
+      (with-current-buffer (tramp-get-buffer v)
+       (let* ((share (tramp-smb-get-share localname))
+              (file (tramp-smb-get-localname localname nil))
+              (cache (tramp-get-connection-property v "share-cache" nil))
+              res entry)
+
+         (if (and (not share) cache)
+             ;; Return cached shares
+             (setq res cache)
+
+           ;; Read entries
+           (setq file (file-name-as-directory file))
+           (when (string-match "^\\./" file)
+             (setq file (substring file 1)))
+           (if share
+               (tramp-smb-send-command v (format "dir \"%s*\"" file))
+             ;; `tramp-smb-maybe-open-connection' lists also the share names
+             (tramp-smb-maybe-open-connection v))
+
+           ;; Loop the listing
+           (goto-char (point-min))
+           (unless (re-search-forward tramp-smb-errors nil t)
+             (while (not (eobp))
+               (setq entry (tramp-smb-read-file-entry share))
+               (forward-line)
+               (when entry (add-to-list 'res entry))))
+
            ;; Cache share entries
-           (setq tramp-smb-share-cache res)))
+           (unless share
+             (tramp-set-connection-property v "share-cache" res)))
 
-       ;; Add directory itself
-       (add-to-list 'res '("" "drwxrwxrwx" 0 (0 0)))
+         ;; Add directory itself
+         (add-to-list 'res '("" "drwxrwxrwx" 0 (0 0)))
 
-       ;; There's a very strange error (debugged with XEmacs 21.4.14)
-       ;; If there's no short delay, it returns nil.  No idea about
-       (when (featurep 'xemacs) (sleep-for 0.01))
+         ;; There's a very strange error (debugged with XEmacs 21.4.14)
+         ;; If there's no short delay, it returns nil.  No idea about.
+         (when (featurep 'xemacs) (sleep-for 0.01))
 
-       ;; Check for matching entries
-       (delq nil (mapcar
-                  (lambda (x) (and (string-match base (nth 0 x)) x))
-                  res))))))
+         ;; Return entries
+         (delq nil res))))))
 
 ;; Return either a share name (if SHARE is nil), or a file name
 ;;
@@ -721,7 +725,7 @@ Result is a list of (LOCALNAME MODE SIZE MONTH DAY TIME YEAR)."
 ;; \s-                                    - space delimeter
 ;; \w\{3,3\}                              - month
 ;; \s-                                    - space delimeter
-;; [ 19][0-9]                             - day
+;; [ 12][0-9]                             - day
 ;; \s-                                    - space delimeter
 ;; [0-9]\{2,2\}:[0-9]\{2,2\}:[0-9]\{2,2\} - time
 ;; \s-                                    - space delimeter
@@ -756,18 +760,20 @@ Result is a list of (LOCALNAME MODE SIZE MONTH DAY TIME YEAR)."
   "Parse entry in SMB output buffer.
 If SHARE is result, entries are of type dir. Otherwise, shares are listed.
 Result is the list (LOCALNAME MODE SIZE MTIME)."
-  (let ((line (buffer-substring (point) (tramp-point-at-eol)))
+;; We are called from `tramp-smb-get-file-entries', which sets the
+;; current buffer.
+  (let ((line (buffer-substring (point) (tramp-line-end-position)))
        localname mode size month day hour min sec year mtime)
 
     (if (not share)
 
-       ; Read share entries
-       (when (string-match "^\\s-+\\(\\S-+\\)\\s-+Disk" line)
+       ;; Read share entries.
+       (when (string-match "^\\s-+\\(\\S-\\(.*\\S-\\)?\\)\\s-+Disk" line)
          (setq localname (match-string 1 line)
                mode "dr-xr-xr-x"
                size 0))
 
-      ; Real listing
+      ;; Real listing.
       (block nil
 
        ;; year
@@ -833,219 +839,186 @@ Result is the list (LOCALNAME MODE SIZE MTIME)."
            (if (and sec min hour day month year)
                (encode-time
                 sec min hour day
-                (cdr (assoc (downcase month) tramp-smb-parse-time-months))
+                (cdr (assoc (downcase month) tramp-parse-time-months))
                 year)
              '(0 0)))
       (list localname mode size mtime))))
 
-;; Inodes don't exist for SMB files.  Therefore we must generate virtual ones.
-;; Used in `find-buffer-visiting'.
-;; The method applied might be not so efficient (Ange-FTP uses hashes). But
-;; performance isn't the major issue given that file transfer will take time.
-
-(defun tramp-smb-get-inode (share file)
-  "Returns the virtual inode number.
-If it doesn't exist, generate a new one."
-  (let ((string (concat share "/" (directory-file-name file))))
-    (unless (assoc string tramp-smb-inodes)
-      (add-to-list 'tramp-smb-inodes
-                  (list string (length tramp-smb-inodes))))
-    (nth 1 (assoc string tramp-smb-inodes))))
-
 
 ;; Connection functions
 
-(defun tramp-smb-send-command (user host command)
-  "Send the COMMAND to USER at HOST (logged into an SMB session).
-Erases temporary buffer before sending the command.  Returns nil if
-there has been an error message from smbclient."
-  (save-excursion
-    (set-buffer (tramp-get-buffer nil tramp-smb-method user host))
-    (erase-buffer)
-    (tramp-send-command nil tramp-smb-method user host command nil t)
-    (tramp-smb-wait-for-output user host)))
-
-(defun tramp-smb-maybe-open-connection (user host share)
-  "Maybe open a connection to HOST, logging in as USER, using `tramp-smb-program'.
+(defun tramp-smb-send-command (vec command)
+  "Send the COMMAND to connection VEC.
+Returns nil if there has been an error message from smbclient."
+  (tramp-smb-maybe-open-connection vec)
+  (tramp-message vec 6 "%s" command)
+  (tramp-send-string vec command)
+  (tramp-smb-wait-for-output vec))
+
+(defun tramp-smb-maybe-open-connection (vec)
+  "Maybe open a connection to HOST, log in as USER, using `tramp-smb-program'.
 Does not do anything if a connection is already open, but re-opens the
 connection if a previous connection has died for some reason."
-  (let ((process-connection-type tramp-process-connection-type)
-       (p (get-buffer-process
-           (tramp-get-buffer nil tramp-smb-method user host))))
-    (save-excursion
-      (set-buffer (tramp-get-buffer nil tramp-smb-method user host))
-      ;; Check whether it is still the same share
-      (unless (and p (processp p) (string-equal tramp-smb-share share))
-       (when (and p (processp p))
-         (delete-process p)
-         (setq p nil)))
-      ;; If too much time has passed since last command was sent, look
-      ;; whether process is still alive.  If it isn't, kill it.
-      (when (and tramp-last-cmd-time
-                (> (tramp-time-diff (current-time) tramp-last-cmd-time) 60)
-                p (processp p) (memq (process-status p) '(run open)))
-       (unless (and p (processp p) (memq (process-status p) '(run open)))
-         (delete-process p)
-         (setq p nil))))
-    (unless (and p (processp p) (memq (process-status p) '(run open)))
-      (when (and p (processp p))
-        (delete-process p))
-      (tramp-smb-open-connection user host share))))
-
-(defun tramp-smb-open-connection (user host share)
-  "Open a connection using `tramp-smb-program'.
-This starts the command `smbclient //HOST/SHARE -U USER', then waits
-for a remote password prompt.  It queries the user for the password,
-then sends the password to the remote host.
-
-Domain names in USER and port numbers in HOST are acknowledged."
-
-  (when (and (fboundp 'executable-find)
-            (not (funcall 'executable-find tramp-smb-program)))
-    (error "Cannot find command %s in %s" tramp-smb-program exec-path))
+  (let* ((share (tramp-smb-get-share (tramp-file-name-localname vec)))
+        (buf (tramp-get-buffer vec))
+        (p (get-buffer-process buf)))
 
-  (save-match-data
-    (let* ((buffer (tramp-get-buffer nil tramp-smb-method user host))
-          (real-user user)
-          (real-host host)
-          domain port args)
-
-      ; Check for domain ("user%domain") and port ("host#port")
-      (when (and user (string-match "\\(.+\\)%\\(.+\\)" user))
-       (setq real-user (or (match-string 1 user) user)
-             domain (match-string 2 user)))
-
-      (when (and host (string-match "\\(.+\\)#\\(.+\\)" host))
-       (setq real-host (or (match-string 1 host) host)
-             port (match-string 2 host)))
-
-      (if share
-         (setq args (list (concat "//" real-host "/" share)))
-       (setq args (list "-L" real-host )))
-
-      (if real-user
-         (setq args (append args (list "-U" real-user)))
-       (setq args (append args (list "-N"))))
-
-      (when domain (setq args (append args (list "-W" domain))))
-      (when port   (setq args (append args (list "-p" port))))
-
-      ; OK, let's go
-      (tramp-pre-connection nil tramp-smb-method user host tramp-chunksize)
-      (tramp-message 7 "Opening connection for //%s@%s/%s..."
-                    user host (or share ""))
-
-      (let* ((default-directory (tramp-temporary-file-directory))
-            ;; If we omit the conditional here, then we would use
-            ;; `undecided-dos' in some cases.  With the conditional,
-            ;; we use nil in these cases.  Which one is right?
-            (coding-system-for-read (unless (and (not (featurep 'xemacs))
-                                                 (> emacs-major-version 20))
-                                      tramp-dos-coding-system))
-            (p (apply #'start-process (buffer-name buffer) buffer
-                      tramp-smb-program args)))
-
-       (tramp-message 9 "Started process %s" (process-command p))
-       (tramp-set-process-query-on-exit-flag p nil)
-       (set-buffer buffer)
-       (setq tramp-smb-share share)
-
-        ; send password
-       (when real-user
-         (let ((pw-prompt "Password:"))
-           (tramp-message 9 "Sending password")
-           (tramp-enter-password p pw-prompt user host)))
-
-       (unless (tramp-smb-wait-for-output user host)
-         (tramp-clear-passwd user host)
-         (error "Cannot open connection //%s@%s/%s"
-                user host (or share "")))))))
+    ;; If too much time has passed since last command was sent, look
+    ;; whether has been an error message; maybe due to connection timeout.
+    (with-current-buffer buf
+      (goto-char (point-min))
+      (when (and (> (tramp-time-diff
+                    (current-time)
+                    (tramp-get-connection-property
+                     p "last-cmd-time" '(0 0 0)))
+                   60)
+                p (processp p) (memq (process-status p) '(run open))
+                (re-search-forward tramp-smb-errors nil t))
+       (delete-process p)
+       (setq p nil)))
+
+    ;; Check whether it is still the same share.
+    (unless
+       (and p (processp p) (memq (process-status p) '(run open))
+            (string-equal
+             share
+             (tramp-get-connection-property p "smb-share" "")))
+
+      (save-match-data
+       ;; There might be unread output from checking for share names.
+       (when buf (with-current-buffer buf (erase-buffer)))
+       (when (and p (processp p)) (delete-process p))
+
+       (unless (let ((default-directory
+                       (tramp-temporary-file-directory)))
+                 (executable-find tramp-smb-program))
+         (error "Cannot find command %s in %s" tramp-smb-program exec-path))
+
+       (let* ((user (tramp-file-name-user vec))
+              (host (tramp-file-name-host vec))
+              (real-user user)
+              (real-host host)
+              domain port args)
+
+         ;; Check for domain ("user%domain") and port ("host#port").
+         (when (and user (string-match "\\(.+\\)%\\(.+\\)" user))
+           (setq real-user (or (match-string 1 user) user)
+                 domain (match-string 2 user)))
+
+         (when (and host (string-match "\\(.+\\)#\\(.+\\)" host))
+           (setq real-host (or (match-string 1 host) host)
+                 port (match-string 2 host)))
+
+         (if share
+             (setq args (list (concat "//" real-host "/" share)))
+           (setq args (list "-L" real-host )))
+
+         (if (not (zerop (length real-user)))
+             (setq args (append args (list "-U" real-user)))
+           (setq args (append args (list "-N"))))
+
+         (when domain (setq args (append args (list "-W" domain))))
+         (when port   (setq args (append args (list "-p" port))))
+         (setq args (append args (list "-s" "/dev/null")))
+
+         ;; OK, let's go.
+         (tramp-message
+          vec 3 "Opening connection for //%s%s/%s..."
+          (if (not (zerop (length user))) (concat user "@") "")
+          host (or share ""))
+
+         (let* ((coding-system-for-read nil)
+                (process-connection-type tramp-process-connection-type)
+                (p (let ((default-directory (tramp-temporary-file-directory)))
+                     (apply #'start-process
+                            (tramp-buffer-name vec) (tramp-get-buffer vec)
+                            tramp-smb-program args))))
+
+           (tramp-message
+            vec 6 "%s" (mapconcat 'identity (process-command p) " "))
+           (set-process-sentinel p 'tramp-flush-connection-property)
+           (tramp-set-process-query-on-exit-flag p nil)
+           (tramp-set-connection-property p "smb-share" share)
+
+           ;; Set variables for computing the prompt for reading password.
+           (setq tramp-current-method tramp-smb-method
+                 tramp-current-user user
+                 tramp-current-host host)
+
+           ;; Set chunksize.  Otherwise, `tramp-send-string' might
+           ;; try it itself.
+           (tramp-set-connection-property p "chunksize" tramp-chunksize)
+
+           ;; Play login scenario.
+           (tramp-process-actions
+            p vec
+            (if share
+                tramp-smb-actions-with-share
+              tramp-smb-actions-without-share))
+
+           (tramp-message
+            vec 3 "Opening connection for //%s%s/%s...done"
+            (if (not (zerop (length user))) (concat user "@") "")
+            host (or share ""))))))))
 
 ;; We don't use timeouts.  If needed, the caller shall wrap around.
-(defun tramp-smb-wait-for-output (user host)
+(defun tramp-smb-wait-for-output (vec)
   "Wait for output from smbclient command.
 Returns nil if an error message has appeared."
-  (let ((proc (get-buffer-process (current-buffer)))
-       (found (progn (goto-char (point-min))
-                     (re-search-forward tramp-smb-prompt nil t)))
-       (err   (progn (goto-char (point-min))
-                     (re-search-forward tramp-smb-errors nil t))))
-
-    ;; Algorithm: get waiting output.  See if last line contains
-    ;; tramp-smb-prompt sentinel or tramp-smb-errors strings.
-    ;; If not, wait a bit and again get waiting output.
-    (while (not found)
-
-      ;; Accept pending output.
-      (tramp-accept-process-output proc)
-
-      ;; Search for prompt.
-      (goto-char (point-min))
-      (setq found (re-search-forward tramp-smb-prompt nil t))
-
-      ;; Search for errors.
-      (goto-char (point-min))
-      (setq err (re-search-forward tramp-smb-errors nil t)))
+  (with-current-buffer (tramp-get-buffer vec)
+    (let ((p (get-buffer-process (current-buffer)))
+         (found (progn (goto-char (point-min))
+                       (re-search-forward tramp-smb-prompt nil t)))
+         (err   (progn (goto-char (point-min))
+                       (re-search-forward tramp-smb-errors nil t))))
 
-    ;; Add output to debug buffer if appropriate.
-    (when tramp-debug-buffer
-      (append-to-buffer
-       (tramp-get-debug-buffer nil tramp-smb-method user host)
-       (point-min) (point-max)))
+      ;; Algorithm: get waiting output.  See if last line contains
+      ;; tramp-smb-prompt sentinel or tramp-smb-errors strings.
+      ;; If not, wait a bit and again get waiting output.
+      (while (and (not found) (not err))
 
-    ;; Return value is whether no error message has appeared.
-    (not err)))
+       ;; Accept pending output.
+       (tramp-accept-process-output p)
 
+       ;; Search for prompt.
+       (goto-char (point-min))
+       (setq found (re-search-forward tramp-smb-prompt nil t))
 
-;; Snarfed code from time-date.el and parse-time.el
+       ;; Search for errors.
+       (goto-char (point-min))
+       (setq err (re-search-forward tramp-smb-errors nil t)))
 
-(defconst tramp-smb-half-a-year '(241 17024)
-"Evaluated by \"(days-to-time 183)\".")
+      ;; When the process is still alive, read pending output.
+      (while (and (not found) (memq (process-status p) '(run open)))
 
-(defconst tramp-smb-parse-time-months '(("jan" . 1) ("feb" . 2) ("mar" . 3)
-                           ("apr" . 4) ("may" . 5) ("jun" . 6)
-                           ("jul" . 7) ("aug" . 8) ("sep" . 9)
-                           ("oct" . 10) ("nov" . 11) ("dec" . 12))
-"Alist mapping month names to integers.")
+       ;; Accept pending output.
+       (tramp-accept-process-output p)
 
-(defun tramp-smb-time-less-p (t1 t2)
-  "Say whether time value T1 is less than time value T2."
-  (unless t1 (setq t1 '(0 0)))
-  (unless t2 (setq t2 '(0 0)))
-  (or (< (car t1) (car t2))
-      (and (= (car t1) (car t2))
-          (< (nth 1 t1) (nth 1 t2)))))
+       ;; Search for prompt.
+       (goto-char (point-min))
+       (setq found (re-search-forward tramp-smb-prompt nil t)))
 
-(defun tramp-smb-time-subtract (t1 t2)
-  "Subtract two time values.
-Return the difference in the format of a time value."
-  (unless t1 (setq t1 '(0 0)))
-  (unless t2 (setq t2 '(0 0)))
-  (let ((borrow (< (cadr t1) (cadr t2))))
-    (list (- (car t1) (car t2) (if borrow 1 0))
-         (- (+ (if borrow 65536 0) (cadr t1)) (cadr t2)))))
+      ;; Return value is whether no error message has appeared.
+      (tramp-message vec 6 "\n%s" (buffer-string))
+      (not err))))
 
 
 (provide 'tramp-smb)
 
 ;;; TODO:
 
-;; * Provide a local smb.conf. The default one might not be readable.
 ;; * Error handling in case password is wrong.
 ;; * Read password from "~/.netrc".
 ;; * Return more comprehensive file permission string.  Think whether it is
 ;;   possible to implement `set-file-modes'.
-;; * Handle WILDCARD and FULL-DIRECTORY-P in
-;;   `tramp-smb-handle-insert-directory'.
 ;; * Handle links (FILENAME.LNK).
 ;; * Maybe local tmp files should have the same extension like the original
 ;;   files.  Strange behaviour with jka-compr otherwise?
-;; * Copy files in dired from SMB to another method doesn't work.
 ;; * Try to remove the inclusion of dummy "" directory.  Seems to be at
 ;;   several places, especially in `tramp-smb-handle-insert-directory'.
-;; * Provide variables for debug.
 ;; * (RMS) Use unwind-protect to clean up the state so as to make the state
 ;;   regular again.
+;; * Make it multi-hop capable.
 
 ;;; arch-tag: fcc9dbec-7503-4d73-b638-3c8aa59575f5
 ;;; tramp-smb.el ends here
diff --git a/lisp/net/tramp-util.el b/lisp/net/tramp-util.el
deleted file mode 100644 (file)
index f4b23fe..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-;;; -*- coding: iso-2022-7bit; -*-
-;;; tramp-util.el --- Misc utility functions to use with Tramp
-
-;; Copyright (C) 2001, 2002, 2003, 2004, 2005,
-;;   2006, 2007 Free Software Foundation, Inc.
-
-;; Author: kai.grossjohann@gmx.net
-;; Keywords: comm, extensions, processes
-
-;; This file is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-
-;; This file is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;; Some misc. utility functions that might go nicely with Tramp.
-;; Mostly, these are kluges awaiting real solutions later on.
-
-;;; Code:
-
-(require 'compile)
-(require 'tramp)
-(add-hook 'tramp-util-unload-hook
-         '(lambda ()
-            (when (featurep 'tramp)
-              (unload-feature 'tramp 'force))))
-
-;; Define a Tramp minor mode. It's intention is to redefine some keys for Tramp
-;; specific functions, like compilation.
-;; The key remapping works since Emacs 22 only. Unknown for XEmacs.
-
-;; Pacify byte-compiler
-(eval-when-compile
-  (unless (fboundp 'define-minor-mode)
-      (defalias 'define-minor-mode 'identity)
-      (defvar tramp-minor-mode))
-  (unless (featurep 'xemacs)
-    (defalias 'add-menu-button 'ignore)))
-
-(defvar tramp-minor-mode-map (make-sparse-keymap)
-  "Keymap for Tramp minor mode.")
-
-(define-minor-mode tramp-minor-mode "Tramp minor mode for utility functions."
-  :group 'tramp
-  :global nil
-  :init-value nil
-  :lighter " Tramp"
-  :keymap tramp-minor-mode-map
-  (setq tramp-minor-mode
-       (and tramp-minor-mode (tramp-tramp-file-p default-directory))))
-
-(add-hook 'find-file-hooks 'tramp-minor-mode t)
-(add-hook 'tramp-util-unload-hook
-         '(lambda ()
-            (remove-hook 'find-file-hooks 'tramp-minor-mode)))
-
-(add-hook 'dired-mode-hook 'tramp-minor-mode t)
-(add-hook 'tramp-util-unload-hook
-         '(lambda ()
-            (remove-hook 'dired-mode-hook 'tramp-minor-mode)))
-
-(defun tramp-remap-command (old-command new-command)
-  "Replaces bindings of OLD-COMMAND by NEW-COMMAND.
-If remapping functionality for keymaps is defined, this happens for all
-bindings.  Otherwise, only bindings active during invocation are taken
-into account.  XEmacs menubar bindings are not changed by this."
-  (if (functionp 'command-remapping)
-      ;; Emacs 22
-      (eval
-       `(define-key tramp-minor-mode-map [remap ,old-command] new-command))
-    ;; previous Emacs versions.
-    (mapcar
-     '(lambda (x)
-       (define-key tramp-minor-mode-map x new-command))
-     (where-is-internal old-command))))
-
-(tramp-remap-command 'compile 'tramp-compile)
-(tramp-remap-command 'recompile 'tramp-recompile)
-
-;; XEmacs has an own mimic for menu entries
-(when (fboundp 'add-menu-button)
-  (funcall 'add-menu-button
-   '("Tools" "Compile")
-   ["Compile..."
-    (command-execute (if tramp-minor-mode 'tramp-compile 'compile))
-    :active (fboundp 'compile)])
-  (funcall 'add-menu-button
-   '("Tools" "Compile")
-   ["Repeat Compilation"
-    (command-execute (if tramp-minor-mode 'tramp-recompile 'recompile))
-    :active (fboundp 'compile)]))
-
-;; Utility functions.
-
-(defun tramp-compile (command)
-  "Compile on remote host."
-  (interactive
-   (if (or compilation-read-command current-prefix-arg)
-       (list (read-from-minibuffer "Compile command: "
-                                   compile-command nil nil
-                                   '(compile-history . 1)))
-     (list compile-command)))
-  (setq compile-command command)
-  (save-some-buffers (not compilation-ask-about-save) nil)
-  (let ((d default-directory))
-    (save-excursion
-      (pop-to-buffer (get-buffer-create "*Compilation*") t)
-      (erase-buffer)
-      (setq default-directory d)))
-  (tramp-handle-shell-command command (get-buffer "*Compilation*"))
-  (pop-to-buffer (get-buffer "*Compilation*"))
-  (tramp-minor-mode 1)
-  (compilation-minor-mode 1))
-
-(defun tramp-recompile ()
-  "Re-compile on remote host."
-  (interactive)
-  (save-some-buffers (not compilation-ask-about-save) nil)
-  (tramp-handle-shell-command compile-command (get-buffer "*Compilation*"))
-  (pop-to-buffer (get-buffer "*Compilation*"))
-  (tramp-minor-mode 1)
-  (compilation-minor-mode 1))
-
-(provide 'tramp-util)
-
-;;; arch-tag: 500f9992-a44e-46d0-83a7-980799251808
-;;; tramp-util.el ends here
index a12c9ad..c399a0b 100644 (file)
@@ -1,10 +1,10 @@
-;;; -*- coding: iso-2022-7bit; -*-
+;;; -*- coding: utf-8; -*-
 ;;; tramp-uu.el --- uuencode in Lisp
 
 ;; Copyright (C) 2002, 2003, 2004, 2005, 2006,
 ;;   2007 Free Software Foundation, Inc.
 
-;; Author: Kai Gro\e,A_\e(Bjohann <kai.grossjohann@gmx.net>
+;; Author: Kai Großjohann <kai.grossjohann@gmx.net>
 ;; Keywords: comm, terminals
 
 ;; This file is free software; you can redistribute it and/or modify
@@ -18,9 +18,8 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs; see the file COPYING.  If not, see
+;; <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
diff --git a/lisp/net/tramp-vc.el b/lisp/net/tramp-vc.el
deleted file mode 100644 (file)
index 1aea7b0..0000000
+++ /dev/null
@@ -1,536 +0,0 @@
-;;; tramp-vc.el --- Version control integration for TRAMP.el
-
-;; Copyright (C) 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007 Free Software Foundation, Inc.
-
-;; Author: Daniel Pittman <daniel@danann.net>
-;; Keywords: comm, processes
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;; See the main module, 'tramp.el' for discussion of the purpose of TRAMP.
-;; This module provides integration between remote files accessed by TRAMP and
-;; the Emacs version control system.
-
-;;; Code:
-
-(require 'vc)
-;; Old VC defines vc-rcs-release in vc.el, new VC requires extra module.
-(unless (boundp 'vc-rcs-release)
-  (require 'vc-rcs))
-(require 'tramp)
-
-;; Avoid byte-compiler warnings if the byte-compiler supports this.
-;; Currently, XEmacs supports this.
-(eval-when-compile
-  (when (fboundp 'byte-compiler-options)
-    (let (unused-vars) ; Pacify Emacs byte-compiler
-      (defalias 'warnings 'identity) ; Pacify Emacs byte-compiler
-      (byte-compiler-options (warnings (- unused-vars))))))
-
-;; -- vc --
-
-;; This used to blow away the file-name-handler-alist and reinstall
-;; TRAMP into it. This was intended to let VC work remotely. It didn't,
-;; at least not in my XEmacs 21.2 install.
-;;
-;; In any case, tramp-run-real-handler now deals correctly with disabling
-;; the things that should be, making this a no-op.
-;;
-;; I have removed it from the tramp-file-name-handler-alist because the
-;; shortened version does nothing. This is for reference only now.
-;;
-;; Daniel Pittman <daniel@danann.net>
-;;
-;; (defun tramp-handle-vc-registered (file)
-;;   "Like `vc-registered' for tramp files."
-;;   (tramp-run-real-handler 'vc-registered (list file)))
-
-;; `vc-do-command'
-;; This function does not deal well with remote files, so we define
-;; our own version and make a backup of the original function and
-;; call our version for tramp files and the original version for
-;; normal files.
-
-;; The following function is pretty much copied from vc.el, but
-;; the part that actually executes a command is changed.
-;; CCC: this probably works for Emacs 21, too.
-(defun tramp-vc-do-command (buffer okstatus command file last &rest flags)
-  "Like `vc-do-command' but invoked for tramp files.
-See `vc-do-command' for more information."
-  (save-match-data
-    (and file (setq file (expand-file-name file)))
-    (if (not buffer) (setq buffer "*vc*"))
-    (if vc-command-messages
-       (message "Running `%s' on `%s'..." command file))
-    (let ((obuf (current-buffer)) (camefrom (current-buffer))
-         (squeezed nil)
-         (olddir default-directory)
-         vc-file status)
-      (let* ((v (tramp-dissect-file-name (expand-file-name file)))
-            (multi-method (tramp-file-name-multi-method v))
-            (method (tramp-file-name-method v))
-            (user (tramp-file-name-user v))
-            (host (tramp-file-name-host v))
-            (localname (tramp-file-name-localname v)))
-       (set-buffer (get-buffer-create buffer))
-       (set (make-local-variable 'vc-parent-buffer) camefrom)
-       (set (make-local-variable 'vc-parent-buffer-name)
-            (concat " from " (buffer-name camefrom)))
-       (setq default-directory olddir)
-
-       (erase-buffer)
-
-       (mapcar
-        (function
-         (lambda (s) (and s (setq squeezed (append squeezed (list s))))))
-        flags)
-       (if (and (eq last 'MASTER) file
-                (setq vc-file (vc-name file)))
-           (setq squeezed
-                 (append squeezed
-                         (list (tramp-file-name-localname
-                                (tramp-dissect-file-name vc-file))))))
-       (if (and file (eq last 'WORKFILE))
-           (progn
-             (let* ((pwd (expand-file-name default-directory))
-                    (preflen (length pwd)))
-               (if (string= (substring file 0 preflen) pwd)
-                   (setq file (substring file preflen))))
-             (setq squeezed (append squeezed (list file)))))
-       ;; Unless we (save-window-excursion) the layout of windows in
-       ;; the current frame changes. This is painful, at best.
-       ;;
-       ;; As a point of note, (save-excursion) is still here only because
-       ;; it preserves (point) in the current buffer. (save-window-excursion)
-       ;; does not, at least under XEmacs 21.2.
-       ;;
-       ;; I trust that the FSF support this as well. I can't find useful
-       ;; documentation to check :(
-       ;;
-       ;; Daniel Pittman <daniel@danann.net>
-       (save-excursion
-         (save-window-excursion
-           ;; Actually execute remote command
-           ;; `shell-command' cannot be used; it isn't magic in XEmacs.
-           (tramp-handle-shell-command
-            (mapconcat 'tramp-shell-quote-argument
-                       (cons command squeezed) " ") t)
-           ;;(tramp-wait-for-output)
-           ;; Get status from command
-           (tramp-send-command multi-method method user host "echo $?")
-           (tramp-wait-for-output)
-           ;; Make sure to get status from last line of output.
-           (goto-char (point-max)) (forward-line -1)
-           (setq status (read (current-buffer)))
-           (message "Command %s returned status %d." command status)))
-       (goto-char (point-max))
-       (set-buffer-modified-p nil)
-       (forward-line -1)
-       (if (or (not (integerp status))
-               (and (integerp okstatus) (< okstatus status)))
-           (progn
-             (pop-to-buffer buffer)
-             (goto-char (point-min))
-             (shrink-window-if-larger-than-buffer)
-             (error "Running `%s'...FAILED (%s)" command
-                    (if (integerp status)
-                        (format "status %d" status)
-                      status))
-             )
-         (if vc-command-messages
-             (message "Running %s...OK" command))
-         )
-       (set-buffer obuf)
-       status))
-    ))
-
-;; Following code snarfed from Emacs 21 vc.el and slightly tweaked.
-(defun tramp-vc-do-command-new (buffer okstatus command file &rest flags)
-  "Like `vc-do-command' but for TRAMP files.
-This function is for the new VC which comes with Emacs 21.
-Since TRAMP doesn't do async commands yet, this function doesn't, either."
-  (and file (setq file (expand-file-name file)))
-  (if vc-command-messages
-      (message "Running %s on %s..." command file))
-  (save-current-buffer
-    (unless (eq buffer t)
-      ; Pacify byte-compiler
-      (funcall (symbol-function 'vc-setup-buffer) buffer))
-    (let ((squeezed nil)
-         (inhibit-read-only t)
-         (status 0))
-      (let* ((v (when file (tramp-dissect-file-name file)))
-             (multi-method (when file (tramp-file-name-multi-method v)))
-             (method (when file (tramp-file-name-method v)))
-             (user (when file (tramp-file-name-user v)))
-             (host (when file (tramp-file-name-host v)))
-             (localname (when file (tramp-file-name-localname v))))
-      (setq squeezed (delq nil (copy-sequence flags)))
-      (when file
-       (setq squeezed (append squeezed (list (file-relative-name
-                                              file default-directory)))))
-      (let ((w32-quote-process-args t))
-        (when (eq okstatus 'async)
-          (message "Tramp doesn't do async commands, running synchronously."))
-       ;; `shell-command' cannot be used; it isn't magic in XEmacs.
-        (setq status (tramp-handle-shell-command
-                      (mapconcat 'tramp-shell-quote-argument
-                                 (cons command squeezed) " ") t))
-        (when (or (not (integerp status))
-                 (and (integerp okstatus) (< okstatus status)))
-          (pop-to-buffer (current-buffer))
-          (goto-char (point-min))
-          (shrink-window-if-larger-than-buffer)
-          (error "Running %s...FAILED (%s)" command
-                 (if (integerp status) (format "status %d" status) status))))
-      (if vc-command-messages
-          (message "Running %s...OK" command))
-      ; Pacify byte-compiler
-      (funcall (symbol-function 'vc-exec-after)
-              `(run-hook-with-args
-                'vc-post-command-functions ',command ',localname ',flags))
-      status))))
-
-
-;; The context for a VC command is the current buffer.
-;; That makes a test on the buffers file more reliable than a test on the
-;; arguments.
-;; This is needed to handle remote VC correctly - else we test against the
-;; local VC system and get things wrong...
-;; Daniel Pittman <daniel@danann.net>
-;;-(if (fboundp 'vc-call-backend)
-;;-    () ;; This is the new VC for which we don't have an appropriate advice yet
-;;-)
-(unless (fboundp 'process-file)
-  (if (fboundp 'vc-call-backend)
-      (defadvice vc-do-command
-       (around tramp-advice-vc-do-command
-               (buffer okstatus command file &rest flags)
-               activate)
-       "Invoke tramp-vc-do-command for tramp files."
-       (let ((file (symbol-value 'file)))    ;pacify byte-compiler
-         (if (or (and (stringp file)     (tramp-tramp-file-p file))
-                 (and (buffer-file-name) (tramp-tramp-file-p (buffer-file-name))))
-             (setq ad-return-value
-                   (apply 'tramp-vc-do-command-new buffer okstatus command
-                          file ;(or file (buffer-file-name))
-                          flags))
-           ad-do-it)))
-    (defadvice vc-do-command
-      (around tramp-advice-vc-do-command
-             (buffer okstatus command file last &rest flags)
-             activate)
-      "Invoke tramp-vc-do-command for tramp files."
-      (let ((file (symbol-value 'file)))  ;pacify byte-compiler
-       (if (or (and (stringp file)     (tramp-tramp-file-p file))
-               (and (buffer-file-name) (tramp-tramp-file-p (buffer-file-name))))
-           (setq ad-return-value
-                 (apply 'tramp-vc-do-command buffer okstatus command
-                        (or file (buffer-file-name)) last flags))
-         ad-do-it))))
-
-  (add-hook 'tramp-unload-hook
-           '(lambda () (ad-unadvise 'vc-do-command))))
-
-
-;; XEmacs uses this to do some of its work. Like vc-do-command, we
-;; need to enhance it to make VC work via TRAMP-mode.
-;;
-;; Like the previous function, this is a cut-and-paste job from the VC
-;; file. It's based on the vc-do-command code.
-;; CCC: this isn't used in Emacs 21, so do as before.
-(defun tramp-vc-simple-command (okstatus command file &rest args)
-  ;; Simple version of vc-do-command, for use in vc-hooks only.
-  ;; Don't switch to the *vc-info* buffer before running the
-  ;; command, because that would change its default directory
-  (save-match-data
-    (let* ((v (tramp-dissect-file-name (expand-file-name file)))
-          (multi-method (tramp-file-name-multi-method v))
-          (method (tramp-file-name-method v))
-          (user (tramp-file-name-user v))
-          (host (tramp-file-name-host v))
-          (localname (tramp-file-name-localname v)))
-      (save-excursion (set-buffer (get-buffer-create "*vc-info*"))
-                     (erase-buffer))
-      (let ((exec-path (append vc-path exec-path)) exec-status
-           ;; Add vc-path to PATH for the execution of this command.
-           (process-environment
-            (cons (concat "PATH=" (getenv "PATH")
-                          path-separator
-                          (mapconcat 'identity vc-path path-separator))
-                  process-environment)))
-       ;; Call the actual process. See tramp-vc-do-command for discussion of
-       ;; why this does both (save-window-excursion) and (save-excursion).
-       ;;
-       ;; As a note, I don't think that the process-environment stuff above
-       ;; has any effect on the remote system. This is a hard one though as
-       ;; there is no real reason to expect local and remote paths to be
-       ;; identical...
-       ;;
-       ;; Daniel Pittman <daniel@danann.net>
-       (save-excursion
-         (save-window-excursion
-           ;; Actually execute remote command
-           ;; `shell-command' cannot be used; it isn't magic in XEmacs.
-           (tramp-handle-shell-command
-            (mapconcat 'tramp-shell-quote-argument
-                       (append (list command) args (list localname)) " ")
-            (get-buffer-create"*vc-info*"))
-                                       ;(tramp-wait-for-output)
-           ;; Get status from command
-           (tramp-send-command multi-method method user host "echo $?")
-           (tramp-wait-for-output)
-           (setq exec-status (read (current-buffer)))
-           (message "Command %s returned status %d." command exec-status)))
-
-       ;; Maybe okstatus can be `async' here.  But then, maybe the
-       ;; async thing is new in Emacs 21, but this function is only
-       ;; used in Emacs 20.
-       (cond ((> exec-status okstatus)
-              (switch-to-buffer (get-file-buffer file))
-              (shrink-window-if-larger-than-buffer
-               (display-buffer "*vc-info*"))
-              (error "Couldn't find version control information")))
-       exec-status))))
-
-;; This function does not exist any more in Emacs-21's VC
-(defadvice vc-simple-command
-  (around tramp-advice-vc-simple-command
-         (okstatus command file &rest args)
-         activate)
-  "Invoke tramp-vc-simple-command for tramp files."
-  (let ((file (symbol-value 'file)))    ;pacify byte-compiler
-    (if (or (and (stringp file)     (tramp-tramp-file-p file))
-            (and (buffer-file-name) (tramp-tramp-file-p (buffer-file-name))))
-        (setq ad-return-value
-              (apply 'tramp-vc-simple-command okstatus command
-                     (or file (buffer-file-name)) args))
-      ad-do-it)))
-
-(add-hook 'tramp-unload-hook
-         '(lambda () (ad-unadvise 'vc-simple-command)))
-
-
-;; `vc-workfile-unchanged-p'
-;; This function does not deal well with remote files, so we do the
-;; same as for `vc-do-command'.
-
-;; `vc-workfile-unchanged-p' checks the modification time, we cannot
-;; do that for remote files, so here's a version which relies on diff.
-;; CCC: this one probably works for Emacs 21, too.
-(defun tramp-vc-workfile-unchanged-p
-  (filename &optional want-differences-if-changed)
-  (if (fboundp 'vc-backend-diff)
-      ;; Old VC.  Call `vc-backend-diff'.
-      (let ((status (funcall (symbol-function 'vc-backend-diff)
-                             filename nil nil
-                             (not want-differences-if-changed))))
-        (zerop status))
-    ;; New VC.  Call `vc-default-workfile-unchanged-p'.
-      (funcall (symbol-function 'vc-default-workfile-unchanged-p)
-              (vc-backend filename) filename)))
-
-(defadvice vc-workfile-unchanged-p
-  (around tramp-advice-vc-workfile-unchanged-p
-          (filename &optional want-differences-if-changed)
-          activate)
-  "Invoke tramp-vc-workfile-unchanged-p for tramp files."
-  (if (and (stringp filename)
-          (tramp-tramp-file-p filename)
-          (not
-           (let ((v    (tramp-dissect-file-name filename)))
-             ;; The following check is probably to test whether
-             ;; file-attributes returns correct last modification
-             ;; times.  This check needs to be changed.
-             (tramp-get-remote-perl (tramp-file-name-multi-method v)
-                                  (tramp-file-name-method v)
-                                  (tramp-file-name-user v)
-                                  (tramp-file-name-host v)))))
-      (setq ad-return-value
-            (tramp-vc-workfile-unchanged-p filename want-differences-if-changed))
-    ad-do-it))
-
-(add-hook 'tramp-unload-hook
-         '(lambda () (ad-unadvise 'vc-workfile-unchanged-p)))
-
-
-;; Redefine a function from vc.el -- allow tramp files.
-;; `save-match-data' seems not to be required -- it isn't in
-;; the original version, either.
-;; CCC: this might need some work -- how does the Emacs 21 version
-;; work, anyway?  Does it work over ange-ftp?  Hm.
-(if (not (fboundp 'vc-backend-checkout))
-    () ;; our replacement won't work and is unnecessary anyway
-(defun vc-checkout (filename &optional writable rev)
-  "Retrieve a copy of the latest version of the given file."
-  ;; If ftp is on this system and the name matches the ange-ftp format
-  ;; for a remote file, the user is trying something that won't work.
-  (funcall (symbol-function 'vc-backend-checkout) filename writable rev)
-  (vc-resynch-buffer filename t t))
-)
-
-
-;; Do we need to advise the vc-user-login-name function anyway?
-;; This will return the correct login name for the owner of a
-;; file. It does not deal with the default remote user name...
-;;
-;; That is, when vc calls (vc-user-login-name), we return the
-;; local login name, something that may be different to the remote
-;; default.
-;;
-;; The remote VC operations will occur as the user that we logged
-;; in with however - not always the same as the local user.
-;;
-;; In the end, I did advise the function. This is because, well,
-;; the thing didn't work right otherwise ;)
-;;
-;; Daniel Pittman <daniel@danann.net>
-
-(defun tramp-handle-vc-user-login-name (&optional uid)
-  "Return the default user name on the remote machine.
-Whenever VC calls this function, `file' is bound to the file name
-in question.  If no uid is provided or the uid is equal to the uid
-owning the file, then we return the user name given in the file name.
-
-This should only be called when `file' is bound to the
-filename we are thinking about..."
-  ;; Pacify byte-compiler; this symbol is bound in the calling
-  ;; function.  CCC: Maybe it would be better to move the
-  ;; boundness-checking into this function?
-  (let* ((file (symbol-value 'file))
-        (remote-uid
-         ;; With Emacs 22, `file-attributes' has got an optional parameter
-         ;; ID-FORMAT. Handle this case backwards compatible.
-         (if (and (functionp 'subr-arity)
-                  (= 2 (cdr (funcall (symbol-function 'subr-arity)
-                                     (symbol-function 'file-attributes)))))
-             (nth 2 (file-attributes file 'integer))
-           (nth 2 (file-attributes file)))))
-    (if (and uid (/= uid remote-uid))
-       (error "tramp-handle-vc-user-login-name cannot map a uid to a name")
-      (let* ((v (tramp-dissect-file-name (expand-file-name file)))
-            (u (tramp-file-name-user v)))
-       (cond ((stringp u) u)
-             ((vectorp u) (elt u (1- (length u))))
-             ((null    u) (user-login-name))
-             (t           (error "tramp-handle-vc-user-login-name cannot cope!")))))))
-
-
-;; The following defadvice is no longer necessary after changes in VC
-;; on 2006-01-25, Andre.
-
-(unless (fboundp 'process-file)
-  (defadvice vc-user-login-name
-    (around tramp-vc-user-login-name activate)
-    "Support for files on remote machines accessed by TRAMP."
-    ;; We rely on the fact that `file' is bound when this is called.
-    ;; This appears to be the case everywhere in vc.el and vc-hooks.el
-    ;; as of Emacs 20.5.
-    ;;
-    ;; With Emacs 22, the definition of `vc-user-login-name' has been
-    ;; changed.  It doesn't need to be adviced any longer.
-    (let ((file (when (boundp 'file)
-                 (symbol-value 'file))))    ;pacify byte-compiler
-      (or (and (stringp file)
-              (tramp-tramp-file-p file)        ; tramp file
-              (setq ad-return-value
-                    (save-match-data
-                      (tramp-handle-vc-user-login-name uid)))) ; get the owner name
-         ad-do-it)))                     ; else call the original
-
-  (add-hook 'tramp-unload-hook
-           '(lambda () (ad-unadvise 'vc-user-login-name))))
-
-
-;; Determine the name of the user owning a file.
-(defun tramp-file-owner (filename)
-  "Return who owns FILE (user name, as a string)."
-  (let ((v (tramp-dissect-file-name
-           (expand-file-name filename))))
-    (if (not (file-exists-p filename))
-        nil                             ; file cannot be opened
-      ;; file exists, find out stuff
-      (save-excursion
-        (tramp-send-command
-         (tramp-file-name-multi-method v) (tramp-file-name-method v)
-         (tramp-file-name-user v) (tramp-file-name-host v)
-         (format "%s -Lld %s"
-                 (tramp-get-ls-command (tramp-file-name-multi-method v)
-                                     (tramp-file-name-method v)
-                                     (tramp-file-name-user v)
-                                     (tramp-file-name-host v))
-                 (tramp-shell-quote-argument (tramp-file-name-localname v))))
-        (tramp-wait-for-output)
-        ;; parse `ls -l' output ...
-        ;; ... file mode flags
-        (read (current-buffer))
-        ;; ... number links
-        (read (current-buffer))
-        ;; ... uid (as a string)
-        (symbol-name (read (current-buffer)))))))
-
-;; Wire ourselves into the VC infrastructure...
-;; This function does not exist any more in Emacs-21's VC
-;; CCC: it appears that no substitute is needed for Emacs 21.
-(defadvice vc-file-owner
-  (around tramp-vc-file-owner activate)
-  "Support for files on remote machines accessed by TRAMP."
-  (let ((filename (ad-get-arg 0)))
-    (or (and (tramp-file-name-p filename) ; tramp file
-             (setq ad-return-value
-                  (save-match-data
-                    (tramp-file-owner filename)))) ; get the owner name
-        ad-do-it)))                     ; else call the original
-
-(add-hook 'tramp-unload-hook
-         '(lambda () (ad-unadvise 'vc-file-owner)))
-
-
-;; We need to make the version control software backend version
-;; information local to the current buffer. This is because each TRAMP
-;; buffer can (theoretically) have a different VC version and I am
-;; *way* too lazy to try and push the correct value into each new
-;; buffer.
-;;
-;; Remote VC costs will just have to be paid, at least for the moment.
-;; Well, at least, they will right until I feel guilty about doing a
-;; botch job here and fix it. :/
-;;
-;; Daniel Pittman <daniel@danann.net>
-;; CCC: this is probably still needed for Emacs 21.
-(defun tramp-vc-setup-for-remote ()
-  "Make the backend release variables buffer local.
-This makes remote VC work correctly at the cost of some processing time."
-  (when (and (buffer-file-name)
-             (tramp-tramp-file-p (buffer-file-name)))
-    (make-local-variable 'vc-rcs-release)
-    (setq vc-rcs-release nil)))
-
-(add-hook 'find-file-hooks 'tramp-vc-setup-for-remote t)
-(add-hook 'tramp-unload-hook
-         '(lambda ()
-            (remove-hook 'find-file-hooks 'tramp-vc-setup-for-remote)))
-
-;; No need to load this again if anyone asks.
-(provide 'tramp-vc)
-
-;;; arch-tag: 27cc42ce-da19-468d-ad5c-a2690558db60
-;;; tramp-vc.el ends here
index 3302645..1070d61 100644 (file)
@@ -1,4 +1,4 @@
-;;; -*- mode: Emacs-Lisp; coding: iso-2022-7bit; -*-
+;;; -*- mode: Emacs-Lisp; coding: utf-8; -*-
 ;;; tramp.el --- Transparent Remote Access, Multiple Protocol
 
 ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
@@ -6,7 +6,7 @@
 
 ;; (copyright statements below in code to be updated with the above notice)
 
-;; Author: Kai Gro\e,A_\e(Bjohann <kai.grossjohann@gmx.net>
+;; Author: Kai Großjohann <kai.grossjohann@gmx.net>
 ;;         Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
 
@@ -23,9 +23,8 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs; see the file COPYING.  If not, see
+;; <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
 ;; Notes:
 ;; -----
 ;;
-;; This package only works for Emacs 20 and higher, and for XEmacs 21
-;; and higher.  (XEmacs 20 is missing the `with-timeout' macro.  Emacs
-;; 19 is reported to have other problems.  For XEmacs 21, you need the
-;; package `fsf-compat' for the `with-timeout' macro.)
+;; This package only works for Emacs 21.1 and higher, and for XEmacs 21.4
+;; and higher.  For XEmacs 21, you need the package `fsf-compat' for
+;; the `with-timeout' macro.)
 ;;
 ;; This version might not work with pre-Emacs 21 VC unless VC is
 ;; loaded before tramp.el.  Could you please test this and tell me about
@@ -74,6 +72,8 @@
             (when (featurep 'trampver)
               (unload-feature 'trampver 'force))))
 
+(require 'custom)
+
 (if (featurep 'xemacs)
     (require 'timer-funcs)
   (require 'timer))
     (load "password" 'noerror)
   (require 'password nil 'noerror))     ;from No Gnus, also in tar ball
 
-;; The explicit check is not necessary in Emacs, which provides the
-;; feature even if implemented in C, but it appears to be necessary
-;; in XEmacs.
-(unless (and (fboundp 'base64-encode-region)
-            (fboundp 'base64-decode-region))
-  (require 'base64))                       ;for the mimencode methods
 (require 'shell)
 (require 'advice)
 
+;; Requiring 'tramp-cache results in an endless loop.
+(autoload 'tramp-get-file-property "tramp-cache")
+(autoload 'tramp-set-file-property "tramp-cache")
+(autoload 'tramp-flush-file-property "tramp-cache")
+(autoload 'tramp-flush-directory-property "tramp-cache")
+(autoload 'tramp-cache-print "tramp-cache")
+(autoload 'tramp-get-connection-property "tramp-cache")
+(autoload 'tramp-set-connection-property "tramp-cache")
+(autoload 'tramp-flush-connection-property "tramp-cache")
+(autoload 'tramp-parse-connection-properties "tramp-cache")
+(add-hook 'tramp-unload-hook
+         '(lambda ()
+            (when (featurep 'tramp-cache)
+              (unload-feature 'tramp-cache 'force))))
+
 (autoload 'tramp-uuencode-region "tramp-uu"
   "Implementation of `uuencode' in Lisp.")
 (add-hook 'tramp-unload-hook
             (when (featurep 'tramp-uu)
               (unload-feature 'tramp-uu 'force))))
 
-(unless (fboundp 'uudecode-decode-region)
-  (autoload 'uudecode-decode-region "uudecode"))
+(autoload 'uudecode-decode-region "uudecode")
 
-;; XEmacs is distributed with few Lisp packages.  Further packages are
-;; installed using EFS.  If we use a unified filename format, then
-;; Tramp is required in addition to EFS.  (But why can't Tramp just
-;; disable EFS when Tramp is loaded?  Then XEmacs can ship with EFS
-;; just like before.)  Another reason for using a separate filename
-;; syntax on XEmacs is that EFS hooks into XEmacs in many places, but
-;; Tramp only knows how to deal with `file-name-handler-alist', not
-;; the other places.
-;;;###autoload
-(defvar tramp-unified-filenames (not (featurep 'xemacs))
-  "Non-nil means to use unified Ange-FTP/Tramp filename syntax.
-Otherwise, use a separate filename syntax for Tramp.")
-
-;; Load foreign methods.  Because they do require Tramp internally, this
-;; must be done with the `eval-after-load' trick.
-
-;; tramp-ftp supports Ange-FTP only.  Not suited for XEmacs therefore.
-(unless (featurep 'xemacs)
-  (eval-after-load "tramp"
-    '(progn
-       (require 'tramp-ftp)
-       (add-hook 'tramp-unload-hook
-                '(lambda ()
-                   (when (featurep 'tramp-ftp)
-                     (unload-feature 'tramp-ftp 'force)))))))
-(when (and tramp-unified-filenames (featurep 'xemacs))
-  (eval-after-load "tramp"
-    '(progn
-       (require 'tramp-efs)
+;; The following Tramp packages must be loaded after Tramp, because
+;; they require Tramp as well.
+(eval-after-load "tramp"
+  '(progn
+
+     ;; Load foreign FTP method.
+     (let ((feature (if (featurep 'xemacs) 'tramp-efs 'tramp-ftp)))
+       (require feature)
        (add-hook 'tramp-unload-hook
-                '(lambda ()
-                   (when (featurep 'tramp-efs)
-                     (unload-feature 'tramp-efs 'force)))))))
-
-;; tramp-smb uses "smbclient" from Samba.
-;; Not available under Cygwin and Windows, because they don't offer
-;; "smbclient".  And even not necessary there, because Emacs supports
-;; UNC file names like "//host/share/localname".
-(unless (memq system-type '(cygwin windows-nt))
-  (eval-after-load "tramp"
-    '(progn
+                `(lambda ()
+                   (when (featurep ,feature)
+                     (unload-feature ,feature 'force)))))
+
+     ;; tramp-smb uses "smbclient" from Samba.  Not available under
+     ;; Cygwin and Windows, because they don't offer "smbclient".  And
+     ;; even not necessary there, because Emacs supports UNC file names
+     ;; like "//host/share/localname".
+     (unless (memq system-type '(cygwin windows-nt))
        (require 'tramp-smb)
        (add-hook 'tramp-unload-hook
                 '(lambda ()
                    (when (featurep 'tramp-smb)
-                     (unload-feature 'tramp-smb 'force)))))))
+                     (unload-feature 'tramp-smb 'force)))))
 
-(require 'custom)
-
-(unless (boundp 'custom-print-functions)
-  (defvar custom-print-functions nil)) ; not autoloaded before Emacs 20.4
+     ;; Load foreign FISH method.
+     (require 'tramp-fish)
+     (add-hook 'tramp-unload-hook
+              '(lambda ()
+                 (when (featurep 'tramp-fish)
+                   (unload-feature 'tramp-fish 'force))))
+
+     ;; Load gateways.  It needs `make-network-process' from Emacs 22.
+     (if (functionp 'make-network-process)
+        (progn
+          (require 'tramp-gw)
+          (add-hook 'tramp-unload-hook
+                    '(lambda ()
+                       (when (featurep 'tramp-gw)
+                         (unload-feature 'tramp-gw 'force)))))
+       ;; We need to declare used tramp-gw-* symbols at least.
+       (setq tramp-gw-tunnel-method ""
+            tramp-gw-socks-method "")
+       (defalias 'tramp-gw-open-connection 'ignore))
+
+     ;; tramp-util offers integration into other (X)Emacs packages like
+     ;; compile.el, gud.el etc.  Not necessary in Emacs 23.
+     (unless (functionp 'start-file-process)
+       (require 'tramp-util)
+       (add-hook 'tramp-unload-hook
+                '(lambda ()
+                   (when (featurep 'tramp-util)
+                     (unload-feature 'tramp-util 'force)))))))
 
 ;; Avoid byte-compiler warnings if the byte-compiler supports this.
 ;; Currently, XEmacs supports this.
 (eval-when-compile
   (when (featurep 'xemacs)
-    (let (unused-vars) ; Pacify Emacs byte-compiler
-      (defalias 'warnings 'identity) ; Pacify Emacs byte-compiler
-      (byte-compiler-options (warnings (- unused-vars))))))
+    (byte-compiler-options (warnings (- unused-vars)))))
+
+;; `last-coding-system-used' is unknown in XEmacs.
+(eval-when-compile
+  (unless (boundp 'last-coding-system-used)
+    (defvar last-coding-system-used nil)))
 
 ;; `directory-sep-char' is an obsolete variable in Emacs.  But it is
 ;; used in XEmacs, so we set it here and there.  The following is needed
 ;; to pacify Emacs byte-compiler.
 (eval-when-compile
-  (when (boundp 'byte-compile-not-obsolete-var)
-    (setq byte-compile-not-obsolete-var 'directory-sep-char)))
+  (unless (boundp 'byte-compile-not-obsolete-var)
+    (defvar byte-compile-not-obsolete-var nil))
+  (setq byte-compile-not-obsolete-var 'directory-sep-char))
+
+;; `with-temp-message' does not exists in XEmacs.
+(eval-and-compile
+  (condition-case nil
+      (with-temp-message (current-message) nil)
+    (error (defmacro with-temp-message (message &rest body) `(progn ,@body)))))
 
 ;; `set-buffer-multibyte' comes from Emacs Leim.
 (eval-and-compile
@@ -183,16 +202,23 @@ Otherwise, use a separate filename syntax for Tramp.")
   :group 'files
   :version "22.1")
 
-(defcustom tramp-verbose 9
-  "*Verbosity level for tramp.el.  0 means be silent, 10 is most verbose."
+(defcustom tramp-verbose 3
+  "*Verbosity level for tramp.
+Any level x includes messages for all levels 1 .. x-1.  The levels are
+
+ 0  silent (no tramp messages at all)
+ 1  errors
+ 2  warnings
+ 3  connection to remote hosts (default level)
+ 4  activities
+ 5  internal
+ 6  sent and received strings
+ 7  file caching
+ 8  connection properties
+10  traces (huge)."
   :group 'tramp
   :type 'integer)
 
-(defcustom tramp-debug-buffer nil
-  "*Whether to send all commands and responses to a debug buffer."
-  :group 'tramp
-  :type 'boolean)
-
 ;; Emacs case
 (eval-and-compile
   (when (boundp 'backup-directory-alist)
@@ -201,7 +227,7 @@ Otherwise, use a separate filename syntax for Tramp.")
 Each element looks like (REGEXP . DIRECTORY), with the same meaning like
 in `backup-directory-alist'.  If a Tramp file is backed up, and DIRECTORY
 is a local file name, the backup directory is prepended with Tramp file
-name prefix \(multi-method, method, user, host\) of file.
+name prefix \(method, user, host\) of file.
 
 \(setq tramp-backup-directory-alist backup-directory-alist\)
 
@@ -220,7 +246,7 @@ policy for local files."
 It has the same meaning like `bkup-backup-directory-info' from package
 `backup-dir'.  If a Tramp file is backed up, and BACKUP-DIR is a local
 file name, the backup directory is prepended with Tramp file name prefix
-\(multi-method, method, user, host\) of file.
+\(method, user, host\) of file.
 
 \(setq tramp-bkup-backup-directory-info bkup-backup-directory-info\)
 
@@ -240,8 +266,7 @@ policy for local files."
   "*Put auto-save files in this directory, if set.
 The idea is to use a local directory so that auto-saving is faster."
   :group 'tramp
-  :type '(choice (const nil)
-                 string))
+  :type '(choice (const nil) string))
 
 (defcustom tramp-encoding-shell
   (if (memq system-type '(windows-nt))
@@ -258,9 +283,7 @@ For encoding and deocding, commands like the following are executed:
     /bin/sh -c COMMAND < INPUT > OUTPUT
 
 This variable can be used to change the \"/bin/sh\" part.  See the
-variable `tramp-encoding-command-switch' for the \"-c\" part.  Also, see the
-variable `tramp-encoding-reads-stdin' to specify whether the commands read
-standard input or a file.
+variable `tramp-encoding-command-switch' for the \"-c\" part.
 
 Note that this variable is not used for remote commands.  There are
 mechanisms in tramp.el which automatically determine the right shell to
@@ -277,286 +300,314 @@ See the variable `tramp-encoding-shell' for more information."
   :group 'tramp
   :type 'string)
 
-(defcustom tramp-encoding-reads-stdin t
-  "*If non-nil, encoding commands read from standard input.
-If nil, the filename is the last argument.
-
-Note that the commands always must write to standard output."
+(defcustom tramp-copy-size-limit 10240
+  "*The maximum file size where inline copying is preferred over an out-of-the-band copy."
   :group 'tramp
-  :type 'boolean)
-
-(defcustom tramp-multi-sh-program
-  tramp-encoding-shell
-  "*Use this program for bootstrapping multi-hop connections.
-This variable is similar to `tramp-encoding-shell', but it is only used
-when initializing a multi-hop connection.  Therefore, the set of
-commands sent to this shell is quite restricted, and if you are
-careful it works to use CMD.EXE under Windows (instead of a Bourne-ish
-shell which does not normally exist on Windows anyway).
-
-To use multi-hop methods from Windows, you also need suitable entries
-in `tramp-multi-connection-function-alist' for the first hop.
+  :type 'integer)
 
-This variable defaults to the value of `tramp-encoding-shell'."
+(defcustom tramp-terminal-type "dumb"
+  "*Value of TERM environment variable for logging in to remote host.
+Because Tramp wants to parse the output of the remote shell, it is easily
+confused by ANSI color escape sequences and suchlike.  Often, shell init
+files conditionalize this setup based on the TERM environment variable."
   :group 'tramp
-  :type '(file :must-match t))
+  :type 'string)
 
-;; CCC I have changed all occurrences of comint-quote-filename with
-;; tramp-shell-quote-argument, except in tramp-handle-expand-many-files.
-;; There, comint-quote-filename was removed altogether.  If it turns
-;; out to be necessary there, something will need to be done.
-;;-(defcustom tramp-file-name-quote-list
-;;-  '(?] ?[ ?\| ?& ?< ?> ?\( ?\) ?\; ?\  ?\* ?\? ?\! ?\" ?\' ?\` ?# ?\@ ?\+ )
-;;-  "*Protect these characters from the remote shell.
-;;-Any character in this list is quoted (preceded with a backslash)
-;;-because it means something special to the shell.  This takes effect
-;;-when sending file and directory names to the remote shell.
-;;-
-;;-See `comint-file-name-quote-list' for details."
-;;-  :group 'tramp
-;;-  :type '(repeat character))
-
-(defcustom tramp-methods
-  '( ("rcp"   (tramp-connection-function  tramp-open-connection-rsh)
-              (tramp-login-program        "rsh")
-              (tramp-copy-program         "rcp")
-              (tramp-remote-sh            "/bin/sh")
-              (tramp-login-args           nil)
-              (tramp-copy-args            nil)
-              (tramp-copy-keep-date-arg   "-p")
-             (tramp-password-end-of-line nil))
-     ("scp"   (tramp-connection-function  tramp-open-connection-rsh)
-              (tramp-login-program        "ssh")
-              (tramp-copy-program         "scp")
-              (tramp-remote-sh            "/bin/sh")
-              (tramp-login-args           ("-e" "none"))
-              (tramp-copy-args            nil)
-              (tramp-copy-keep-date-arg   "-p")
-             (tramp-password-end-of-line nil))
-     ("scp1"  (tramp-connection-function  tramp-open-connection-rsh)
-              (tramp-login-program        "ssh")
-              (tramp-copy-program         "scp")
-              (tramp-remote-sh            "/bin/sh")
-              (tramp-login-args           ("-1" "-e" "none"))
-              (tramp-copy-args            ("-1"))
-              (tramp-copy-keep-date-arg   "-p")
-             (tramp-password-end-of-line nil))
-     ("scp2"  (tramp-connection-function  tramp-open-connection-rsh)
-              (tramp-login-program        "ssh")
-              (tramp-copy-program         "scp")
-              (tramp-remote-sh            "/bin/sh")
-              (tramp-login-args           ("-2" "-e" "none"))
-              (tramp-copy-args            ("-2"))
-              (tramp-copy-keep-date-arg   "-p")
-             (tramp-password-end-of-line nil))
-     ("scp1_old"
-              (tramp-connection-function  tramp-open-connection-rsh)
-              (tramp-login-program        "ssh1")
-              (tramp-copy-program         "scp1")
-              (tramp-remote-sh            "/bin/sh")
-              (tramp-login-args           ("-e" "none"))
-              (tramp-copy-args            nil)
-              (tramp-copy-keep-date-arg   "-p")
-             (tramp-password-end-of-line nil))
-     ("scp2_old"
-              (tramp-connection-function  tramp-open-connection-rsh)
-              (tramp-login-program        "ssh2")
-              (tramp-copy-program         "scp2")
-              (tramp-remote-sh            "/bin/sh")
-              (tramp-login-args           ("-e" "none"))
-              (tramp-copy-args            nil)
-              (tramp-copy-keep-date-arg   "-p")
-             (tramp-password-end-of-line nil))
-     ("rsync" (tramp-connection-function  tramp-open-connection-rsh)
-              (tramp-login-program        "ssh")
-              (tramp-copy-program         "rsync")
-              (tramp-remote-sh            "/bin/sh")
-              (tramp-login-args           ("-e" "none"))
-              (tramp-copy-args            ("-e" "ssh"))
-              (tramp-copy-keep-date-arg   "-t")
-             (tramp-password-end-of-line nil))
-     ("remcp" (tramp-connection-function  tramp-open-connection-rsh)
-              (tramp-login-program        "remsh")
-              (tramp-copy-program         "rcp")
-              (tramp-remote-sh            "/bin/sh")
-              (tramp-login-args           nil)
-              (tramp-copy-args            nil)
-              (tramp-copy-keep-date-arg   "-p")
-             (tramp-password-end-of-line nil))
-     ("rsh"   (tramp-connection-function  tramp-open-connection-rsh)
-              (tramp-login-program        "rsh")
-              (tramp-copy-program         nil)
-              (tramp-remote-sh            "/bin/sh")
-              (tramp-login-args           nil)
-              (tramp-copy-args            nil)
-              (tramp-copy-keep-date-arg   nil)
-             (tramp-password-end-of-line nil))
-     ("ssh"   (tramp-connection-function  tramp-open-connection-rsh)
-              (tramp-login-program        "ssh")
-              (tramp-copy-program         nil)
-              (tramp-remote-sh            "/bin/sh")
-              (tramp-login-args           ("-e" "none"))
-              (tramp-copy-args            nil)
-              (tramp-copy-keep-date-arg   nil)
-             (tramp-password-end-of-line nil))
-     ("ssh1"  (tramp-connection-function  tramp-open-connection-rsh)
-              (tramp-login-program        "ssh")
-              (tramp-copy-program         nil)
-              (tramp-remote-sh            "/bin/sh")
-              (tramp-login-args           ("-1" "-e" "none"))
-              (tramp-copy-args            ("-1"))
-              (tramp-copy-keep-date-arg   nil)
-             (tramp-password-end-of-line nil))
-     ("ssh2"  (tramp-connection-function  tramp-open-connection-rsh)
-              (tramp-login-program        "ssh")
-              (tramp-copy-program         nil)
-              (tramp-remote-sh            "/bin/sh")
-              (tramp-login-args           ("-2" "-e" "none"))
-              (tramp-copy-args            ("-2"))
-              (tramp-copy-keep-date-arg   nil)
-             (tramp-password-end-of-line nil))
-     ("ssh1_old"
-              (tramp-connection-function  tramp-open-connection-rsh)
-              (tramp-login-program        "ssh1")
-              (tramp-copy-program         nil)
-              (tramp-remote-sh            "/bin/sh")
-              (tramp-login-args           ("-e" "none"))
-              (tramp-copy-args            nil)
-              (tramp-copy-keep-date-arg   nil)
-             (tramp-password-end-of-line nil))
-     ("ssh2_old"
-              (tramp-connection-function  tramp-open-connection-rsh)
-              (tramp-login-program        "ssh2")
-              (tramp-copy-program         nil)
-              (tramp-remote-sh            "/bin/sh")
-              (tramp-login-args           ("-e" "none"))
-              (tramp-copy-args            nil)
-              (tramp-copy-keep-date-arg   nil)
-             (tramp-password-end-of-line nil))
-     ("remsh" (tramp-connection-function  tramp-open-connection-rsh)
-              (tramp-login-program        "remsh")
-              (tramp-copy-program         nil)
-              (tramp-remote-sh            "/bin/sh")
-              (tramp-login-args           nil)
-              (tramp-copy-args            nil)
-              (tramp-copy-keep-date-arg   nil)
-             (tramp-password-end-of-line nil))
-     ("telnet"
-              (tramp-connection-function  tramp-open-connection-telnet)
-              (tramp-login-program        "telnet")
-              (tramp-copy-program         nil)
-              (tramp-remote-sh            "/bin/sh")
-              (tramp-login-args           nil)
-              (tramp-copy-args            nil)
-              (tramp-copy-keep-date-arg   nil)
-             (tramp-password-end-of-line nil))
-     ("su"    (tramp-connection-function  tramp-open-connection-su)
-              (tramp-login-program        "su")
-              (tramp-copy-program         nil)
-              (tramp-remote-sh            "/bin/sh")
-              (tramp-login-args           ("-" "%u"))
-              (tramp-copy-args            nil)
-              (tramp-copy-keep-date-arg   nil)
-             (tramp-password-end-of-line nil))
-     ("sudo"  (tramp-connection-function  tramp-open-connection-su)
-              (tramp-login-program        "sudo")
-              (tramp-copy-program         nil)
-              (tramp-remote-sh            "/bin/sh")
-              (tramp-login-args           ("-u" "%u" "-s"
-                                          "-p" "Password:"))
-              (tramp-copy-args            nil)
-              (tramp-copy-keep-date-arg   nil)
-             (tramp-password-end-of-line nil))
-     ("multi" (tramp-connection-function  tramp-open-connection-multi)
-              (tramp-login-program        nil)
-              (tramp-copy-program         nil)
-              (tramp-remote-sh            "/bin/sh")
-              (tramp-login-args           nil)
-              (tramp-copy-args            nil)
-              (tramp-copy-keep-date-arg   nil)
-             (tramp-password-end-of-line nil))
-     ("scpc"  (tramp-connection-function  tramp-open-connection-rsh)
-              (tramp-login-program        "ssh")
-              (tramp-copy-program         "scp")
-              (tramp-remote-sh            "/bin/sh")
-              (tramp-login-args           ("-o" "ControlPath=%t.%%r@%%h:%%p"
-                                          "-o" "ControlMaster=yes"
-                                          "-e" "none"))
-              (tramp-copy-args            ("-o" "ControlPath=%t.%%r@%%h:%%p"
-                                          "-o" "ControlMaster=auto"))
-              (tramp-copy-keep-date-arg   "-p")
-             (tramp-password-end-of-line nil))
-     ("scpx"  (tramp-connection-function  tramp-open-connection-rsh)
-              (tramp-login-program        "ssh")
-              (tramp-copy-program         "scp")
-              (tramp-remote-sh            "/bin/sh")
-              (tramp-login-args           ("-e" "none" "-t" "-t" "/bin/sh"))
-              (tramp-copy-args            nil)
-              (tramp-copy-keep-date-arg   "-p")
-             (tramp-password-end-of-line nil))
-     ("sshx"  (tramp-connection-function  tramp-open-connection-rsh)
-              (tramp-login-program        "ssh")
-              (tramp-copy-program         nil)
-              (tramp-remote-sh            "/bin/sh")
-              (tramp-login-args           ("-e" "none" "-t" "-t" "/bin/sh"))
-              (tramp-copy-args            nil)
-              (tramp-copy-keep-date-arg   nil)
-             (tramp-password-end-of-line nil))
-     ("krlogin"
-              (tramp-connection-function  tramp-open-connection-rsh)
-             (tramp-login-program        "krlogin")
-             (tramp-copy-program         nil)
-             (tramp-remote-sh            "/bin/sh")
-             (tramp-login-args           ("-x"))
-             (tramp-copy-args            nil)
-             (tramp-copy-keep-date-arg   nil)
-             (tramp-password-end-of-line nil))
-     ("plink"
-              (tramp-connection-function  tramp-open-connection-rsh)
-             (tramp-login-program        "plink")
-             (tramp-copy-program         nil)
-             (tramp-remote-sh            "/bin/sh")
-             (tramp-login-args           ("-ssh")) ;optionally add "-v"
-             (tramp-copy-args            nil)
-             (tramp-copy-keep-date-arg   nil)
-             (tramp-password-end-of-line "xy")) ;see docstring for "xy"
-     ("plink1"
-              (tramp-connection-function  tramp-open-connection-rsh)
-             (tramp-login-program        "plink")
-             (tramp-copy-program         nil)
-             (tramp-remote-sh            "/bin/sh")
-             (tramp-login-args           ("-1" "-ssh")) ;optionally add "-v"
-             (tramp-copy-args            nil)
-             (tramp-copy-keep-date-arg   nil)
-             (tramp-password-end-of-line "xy")) ;see docstring for "xy"
-     ("pscp"
-              (tramp-connection-function  tramp-open-connection-rsh)
-             (tramp-login-program        "plink")
-             (tramp-copy-program         "pscp")
-             (tramp-remote-sh            "/bin/sh")
-             (tramp-login-args           ("-ssh"))
-             (tramp-copy-args            nil)
-             (tramp-copy-keep-date-arg   "-p")
-             (tramp-password-end-of-line "xy")) ;see docstring for "xy"
-     ("fcp"
-             (tramp-connection-function  tramp-open-connection-rsh)
-              (tramp-login-program        "fsh")
-              (tramp-copy-program         "fcp")
-              (tramp-remote-sh            "/bin/sh -i")
-              (tramp-login-args           ("sh" "-i"))
-              (tramp-copy-args            nil)
-              (tramp-copy-keep-date-arg   "-p")
-             (tramp-password-end-of-line nil))
-     )
+(defvar tramp-methods
+  `(("rcp"   (tramp-login-program        "rsh")
+             (tramp-login-args           (("%h") ("-l" "%u")))
+            (tramp-remote-sh            "/bin/sh")
+            (tramp-copy-program         "rcp")
+            (tramp-copy-args            (("-p" "%k")))
+            (tramp-copy-keep-date       t)
+            (tramp-password-end-of-line nil))
+    ("scp"   (tramp-login-program        "ssh")
+             (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p")
+                                         ("-e" "none")))
+            (tramp-remote-sh            "/bin/sh")
+            (tramp-copy-program         "scp")
+            (tramp-copy-args            (("-P" "%p") ("-p" "%k") ("-q")))
+            (tramp-copy-keep-date       t)
+            (tramp-password-end-of-line nil)
+            (tramp-gw-args              (("-o"
+                                          "GlobalKnownHostsFile=/dev/null")
+                                         ("-o" "UserKnownHostsFile=/dev/null")
+                                         ("-o" "StrictHostKeyChecking=no")))
+            (tramp-default-port         22))
+    ("scp1"  (tramp-login-program        "ssh")
+             (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p")
+                                         ("-1" "-e" "none")))
+            (tramp-remote-sh            "/bin/sh")
+            (tramp-copy-program         "scp")
+            (tramp-copy-args            (("-1") ("-P" "%p") ("-p" "%k")
+                                         ("-q")))
+            (tramp-copy-keep-date       t)
+            (tramp-password-end-of-line nil)
+            (tramp-gw-args              (("-o"
+                                          "GlobalKnownHostsFile=/dev/null")
+                                         ("-o" "UserKnownHostsFile=/dev/null")
+                                         ("-o" "StrictHostKeyChecking=no")))
+            (tramp-default-port         22))
+    ("scp2"  (tramp-login-program        "ssh")
+             (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p")
+                                         ("-2" "-e" "none")))
+            (tramp-remote-sh            "/bin/sh")
+            (tramp-copy-program         "scp")
+            (tramp-copy-args            (("-2") ("-P" "%p") ("-p" "%k")
+                                         ("-q")))
+            (tramp-copy-keep-date       t)
+            (tramp-password-end-of-line nil)
+            (tramp-gw-args              (("-o"
+                                          "GlobalKnownHostsFile=/dev/null")
+                                         ("-o" "UserKnownHostsFile=/dev/null")
+                                         ("-o" "StrictHostKeyChecking=no")))
+            (tramp-default-port         22))
+    ("scp1_old"
+             (tramp-login-program        "ssh1")
+            (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p")
+                                         ("-e" "none")))
+            (tramp-remote-sh            "/bin/sh")
+            (tramp-copy-program         "scp1")
+            (tramp-copy-args            (("-p" "%k")))
+            (tramp-copy-keep-date       t)
+            (tramp-password-end-of-line nil))
+    ("scp2_old"
+             (tramp-login-program        "ssh2")
+            (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p")
+                                         ("-e" "none")))
+            (tramp-remote-sh            "/bin/sh")
+            (tramp-copy-program         "scp2")
+            (tramp-copy-args            (("-p" "%k")))
+            (tramp-copy-keep-date       t)
+            (tramp-password-end-of-line nil))
+    ("sftp"  (tramp-login-program        "ssh")
+             (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p")
+                                         ("-e" "none")))
+            (tramp-remote-sh            "/bin/sh")
+            (tramp-copy-program         "sftp")
+            (tramp-copy-args            nil)
+            (tramp-copy-keep-date       nil)
+            (tramp-password-end-of-line nil))
+    ("rsync" (tramp-login-program        "ssh")
+             (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p")
+                                         ("-e" "none")))
+            (tramp-remote-sh            "/bin/sh")
+            (tramp-copy-program         "rsync")
+            (tramp-copy-args            (("-e" "ssh") ("-t" "%k")))
+            (tramp-copy-keep-date       t)
+            (tramp-password-end-of-line nil))
+    ("remcp" (tramp-login-program        "remsh")
+             (tramp-login-args           (("%h") ("-l" "%u")))
+            (tramp-remote-sh            "/bin/sh")
+            (tramp-copy-program         "rcp")
+            (tramp-copy-args            (("-p" "%k")))
+            (tramp-copy-keep-date       t)
+            (tramp-password-end-of-line nil))
+    ("rsh"   (tramp-login-program        "rsh")
+             (tramp-login-args           (("%h") ("-l" "%u")))
+            (tramp-remote-sh            "/bin/sh")
+            (tramp-copy-program         nil)
+            (tramp-copy-args            nil)
+            (tramp-copy-keep-date       nil)
+            (tramp-password-end-of-line nil))
+    ("ssh"   (tramp-login-program        "ssh")
+             (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p")
+                                         ("-e" "none")))
+            (tramp-remote-sh            "/bin/sh")
+            (tramp-copy-program         nil)
+            (tramp-copy-args            nil)
+            (tramp-copy-keep-date       nil)
+            (tramp-password-end-of-line nil)
+            (tramp-gw-args              (("-o"
+                                          "GlobalKnownHostsFile=/dev/null")
+                                         ("-o" "UserKnownHostsFile=/dev/null")
+                                         ("-o" "StrictHostKeyChecking=no")))
+            (tramp-default-port         22))
+    ("ssh1"  (tramp-login-program        "ssh")
+             (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p")
+                                         ("-1" "-e" "none")))
+            (tramp-remote-sh            "/bin/sh")
+            (tramp-copy-program         nil)
+            (tramp-copy-args            nil)
+            (tramp-copy-keep-date       nil)
+            (tramp-password-end-of-line nil)
+            (tramp-gw-args              (("-o"
+                                          "GlobalKnownHostsFile=/dev/null")
+                                         ("-o" "UserKnownHostsFile=/dev/null")
+                                         ("-o" "StrictHostKeyChecking=no")))
+            (tramp-default-port         22))
+    ("ssh2"  (tramp-login-program        "ssh")
+             (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p")
+                                         ("-2" "-e" "none")))
+            (tramp-remote-sh            "/bin/sh")
+            (tramp-copy-program         nil)
+            (tramp-copy-args            nil)
+            (tramp-copy-keep-date       nil)
+            (tramp-password-end-of-line nil)
+            (tramp-gw-args              (("-o"
+                                          "GlobalKnownHostsFile=/dev/null")
+                                         ("-o" "UserKnownHostsFile=/dev/null")
+                                         ("-o" "StrictHostKeyChecking=no")))
+            (tramp-default-port         22))
+    ("ssh1_old"
+             (tramp-login-program        "ssh1")
+            (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p")
+                                         ("-e" "none")))
+            (tramp-remote-sh            "/bin/sh")
+            (tramp-copy-program         nil)
+            (tramp-copy-args            nil)
+            (tramp-copy-keep-date       nil)
+            (tramp-password-end-of-line nil))
+    ("ssh2_old"
+             (tramp-login-program        "ssh2")
+            (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p")
+                                         ("-e" "none")))
+            (tramp-remote-sh            "/bin/sh")
+            (tramp-copy-program         nil)
+            (tramp-copy-args            nil)
+            (tramp-copy-keep-date       nil)
+            (tramp-password-end-of-line nil))
+    ("remsh" (tramp-login-program        "remsh")
+             (tramp-login-args           (("%h") ("-l" "%u")))
+            (tramp-remote-sh            "/bin/sh")
+            (tramp-copy-program         nil)
+            (tramp-copy-args            nil)
+            (tramp-copy-keep-date       nil)
+            (tramp-password-end-of-line nil))
+    ("telnet"
+             (tramp-login-program        "telnet")
+            (tramp-login-args           (("%h") ("%p")))
+            (tramp-remote-sh            "/bin/sh")
+            (tramp-copy-program         nil)
+            (tramp-copy-args            nil)
+            (tramp-copy-keep-date       nil)
+            (tramp-password-end-of-line nil)
+            (tramp-default-port         23))
+    ("su"    (tramp-login-program        "su")
+             (tramp-login-args           (("-") ("%u")))
+            (tramp-remote-sh            "/bin/sh")
+            (tramp-copy-program         nil)
+            (tramp-copy-args            nil)
+            (tramp-copy-keep-date       nil)
+            (tramp-password-end-of-line nil))
+    ("sudo"  (tramp-login-program        "sudo")
+             (tramp-login-args           (("-u" "%u")
+                                         ("-s" "-p" "Password:")))
+            (tramp-remote-sh            "/bin/sh")
+            (tramp-copy-program         nil)
+            (tramp-copy-args            nil)
+            (tramp-copy-keep-date       nil)
+            (tramp-password-end-of-line nil))
+    ("scpc"  (tramp-login-program        "ssh")
+             (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p")
+                                         ("-o" "ControlPath=%t.%%r@%%h:%%p")
+                                         ("-o" "ControlMaster=yes")
+                                         ("-e" "none")))
+            (tramp-remote-sh            "/bin/sh")
+            (tramp-copy-program         "scp")
+            (tramp-copy-args            (("-P" "%p") ("-p" "%k") ("-q")
+                                         ("-o" "ControlPath=%t.%%r@%%h:%%p")
+                                         ("-o" "ControlMaster=auto")))
+            (tramp-copy-keep-date       t)
+            (tramp-password-end-of-line nil)
+            (tramp-gw-args              (("-o"
+                                          "GlobalKnownHostsFile=/dev/null")
+                                         ("-o" "UserKnownHostsFile=/dev/null")
+                                         ("-o" "StrictHostKeyChecking=no")))
+            (tramp-default-port         22))
+    ("scpx"  (tramp-login-program        "ssh")
+             (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p")
+                                         ("-e" "none" "-t" "-t" "/bin/sh")))
+            (tramp-remote-sh            "/bin/sh")
+            (tramp-copy-program         "scp")
+            (tramp-copy-args            (("-p" "%k")))
+            (tramp-copy-keep-date       t)
+            (tramp-password-end-of-line nil)
+            (tramp-gw-args              (("-o"
+                                          "GlobalKnownHostsFile=/dev/null")
+                                         ("-o" "UserKnownHostsFile=/dev/null")
+                                         ("-o" "StrictHostKeyChecking=no")))
+            (tramp-default-port         22))
+    ("sshx"  (tramp-login-program        "ssh")
+             (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p")
+                                         ("-e" "none" "-t" "-t" "/bin/sh")))
+            (tramp-remote-sh            "/bin/sh")
+            (tramp-copy-program         nil)
+            (tramp-copy-args            nil)
+            (tramp-copy-keep-date       nil)
+            (tramp-password-end-of-line nil)
+            (tramp-gw-args              (("-o"
+                                          "GlobalKnownHostsFile=/dev/null")
+                                         ("-o" "UserKnownHostsFile=/dev/null")
+                                         ("-o" "StrictHostKeyChecking=no")))
+            (tramp-default-port         22))
+    ("krlogin"
+            (tramp-login-program        "krlogin")
+            (tramp-login-args           (("%h") ("-l" "%u") ("-x")))
+            (tramp-remote-sh            "/bin/sh")
+            (tramp-copy-program         nil)
+            (tramp-copy-args            nil)
+            (tramp-copy-keep-date       nil)
+            (tramp-password-end-of-line nil))
+    ("plink" (tramp-login-program        "plink")
+            (tramp-login-args           (("%h") ("-l" "%u") ("-P" "%p")
+                                         ("-ssh")))
+            (tramp-remote-sh            "/bin/sh")
+            (tramp-copy-program         nil)
+            (tramp-copy-args            nil)
+            (tramp-copy-keep-date       nil)
+            (tramp-password-end-of-line "xy") ;see docstring for "xy"
+            (tramp-default-port         22))
+    ("plink1"
+            (tramp-login-program        "plink")
+            (tramp-login-args           (("%h") ("-l" "%u") ("-P" "%p")
+                                         ("-1" "-ssh")))
+            (tramp-remote-sh            "/bin/sh")
+            (tramp-copy-program         nil)
+            (tramp-copy-args            nil)
+            (tramp-copy-keep-date       nil)
+            (tramp-password-end-of-line "xy") ;see docstring for "xy"
+            (tramp-default-port         22))
+    ("plinkx"
+             (tramp-login-program        "plink")
+            (tramp-login-args           (("-load" "%h") ("-t")
+                                         (,(format
+                                            "env 'TERM=%s' 'PROMPT_COMMAND=' 'PS1=$ '"
+                                            tramp-terminal-type))
+                                         ("/bin/sh")))
+            (tramp-remote-sh            "/bin/sh")
+            (tramp-copy-program         nil)
+            (tramp-copy-args            nil)
+            (tramp-copy-keep-date       nil)
+            (tramp-password-end-of-line nil))
+    ("pscp"  (tramp-login-program        "plink")
+            (tramp-login-args           (("%h") ("-l" "%u") ("-P" "%p")
+                                         ("-ssh")))
+            (tramp-remote-sh            "/bin/sh")
+            (tramp-copy-program         "pscp")
+            (tramp-copy-args            (("-scp") ("-p" "%k")))
+            (tramp-copy-keep-date       t)
+            (tramp-password-end-of-line "xy") ;see docstring for "xy"
+            (tramp-default-port         22))
+    ("psftp" (tramp-login-program        "plink")
+            (tramp-login-args           (("%h") ("-l" "%u") ("-P" "%p")
+                                         ("-ssh")))
+            (tramp-remote-sh            "/bin/sh")
+            (tramp-copy-program         "pscp")
+            (tramp-copy-args            (("-psftp") ("-p" "%k")))
+            (tramp-copy-keep-date       t)
+            (tramp-password-end-of-line "xy")) ;see docstring for "xy"
+    ("fcp"   (tramp-login-program        "fsh")
+             (tramp-login-args           (("%h") ("-l" "%u") ("sh" "-i")))
+            (tramp-remote-sh            "/bin/sh -i")
+            (tramp-copy-program         "fcp")
+            (tramp-copy-args            (("-p" "%k")))
+            (tramp-copy-keep-date       t)
+            (tramp-password-end-of-line nil)))
   "*Alist of methods for remote files.
 This is a list of entries of the form (NAME PARAM1 PARAM2 ...).
 Each NAME stands for a remote access method.  Each PARAM is a
 pair of the form (KEY VALUE).  The following KEYs are defined:
- * `tramp-connection-function'
-    This specifies the function to use to connect to the remote host.
-    Currently, `tramp-open-connection-rsh', `tramp-open-connection-telnet'
-    and `tramp-open-connection-su' are defined.  See the documentation
-    of these functions for more details.
   * `tramp-remote-sh'
     This specifies the Bourne shell to use on the remote host.  This
     MUST be a Bourne-like shell.  It is normally not necessary to set
@@ -566,21 +617,22 @@ pair of the form (KEY VALUE).  The following KEYs are defined:
     the value that you decide to use.  You Have Been Warned.
   * `tramp-login-program'
     This specifies the name of the program to use for logging in to the
-    remote host.  Depending on `tramp-connection-function', this may be
-    the name of rsh or a workalike program (when
-    `tramp-connection-function' is `tramp-open-connection-rsh'), or the
-    name of telnet or a workalike (for `tramp-open-connection-telnet'),
-    or the name of su or a workalike (for `tramp-open-connection-su').
+    remote host.  This may be the name of rsh or a workalike program,
+    or the name of telnet or a workalike, or the name of su or a workalike.
   * `tramp-login-args'
     This specifies the list of arguments to pass to the above
-    mentioned program.  Please note that this is a list of arguments,
+    mentioned program.  Please note that this is a list of list of arguments,
     that is, normally you don't want to put \"-a -b\" or \"-f foo\"
-    here.  Instead, you want two list elements, one for \"-a\" and one
-    for \"-b\", or one for \"-f\" and one for \"foo\".
-    If `tramp-connection-function' is `tramp-open-connection-su', then
-    \"%u\" in this list is replaced by the user name, and \"%%\" can
-    be used to obtain a literal percent character.
-    \"%t\" is replaced by the temporary file name for `scp'-like methods.
+    here.  Instead, you want a list (\"-a\" \"-b\"), or (\"-f\" \"foo\").
+    There are some patterns: \"%h\" in this list is replaced by the host
+    name, \"%u\" is replaced by the user name, \"%p\" is replaced by the
+    port number, and \"%%\" can be used to obtain a literal percent character.
+    If a list containing \"%h\", \"%u\" or \"%p\" is unchanged during
+    expansion (i.e. no host or no user specified), this list is not used as
+    argument.  By this, arguments like (\"-l\" \"%u\") are optional.
+    \"%t\" is replaced by the temporary file name produced with
+    `tramp-make-tramp-temp-file'.  \"%k\" indicates the keep-date
+    parameter of a program, if exists.
   * `tramp-copy-program'
     This specifies the name of the program to use for remotely copying
     the file; this might be the absolute filename of rcp or the name of
@@ -588,10 +640,16 @@ pair of the form (KEY VALUE).  The following KEYs are defined:
   * `tramp-copy-args'
     This specifies the list of parameters to pass to the above mentioned
     program, the hints for `tramp-login-args' also apply here.
-  * `tramp-copy-keep-date-arg'
-    This specifies the parameter to use for the copying program when the
-    timestamp of the original file should be kept.  For `rcp', use `-p', for
-    `rsync', use `-t'.
+  * `tramp-copy-keep-date'
+    This specifies whether the copying program when the preserves the
+    timestamp of the original file.
+  * `tramp-default-port'
+    The default port of a method is needed in case of gateway connections.
+    Additionally, it is used as indication which method is prepared for
+    passing gateways.
+  * `tramp-gw-args'
+    As the attribute name says, additional arguments are specified here
+    when a method is applied via a gateway.
   * `tramp-password-end-of-line'
     This specifies the string to use for terminating the line after
     submitting the password.  If this method parameter is nil, then the
@@ -613,78 +671,22 @@ file is passed through the same buffer used by `tramp-login-program'.  In
 this case, the file contents need to be protected since the
 `tramp-login-program' might use escape codes or the connection might not
 be eight-bit clean.  Therefore, file contents are encoded for transit.
-See the variable `tramp-coding-commands' for details.
+See the variables `tramp-local-coding-commands' and
+`tramp-remote-coding-commands' for details.
 
 So, to summarize: if the method is an out-of-band method, then you
 must specify `tramp-copy-program' and `tramp-copy-args'.  If it is an
-inline method, then these two parameters should be nil.  Every method,
-inline or out of band, must specify `tramp-connection-function' plus
-the associated arguments (for example, the login program if you chose
-`tramp-open-connection-telnet').
+inline method, then these two parameters should be nil.  Methods which
+are fit for gateways must have `tramp-default-port' at least.
 
 Notes:
 
-When using `tramp-open-connection-su' the phrase `open connection to a
-remote host' sounds strange, but it is used nevertheless, for
-consistency.  No connection is opened to a remote host, but `su' is
-started on the local host.  You are not allowed to specify a remote
-host other than `localhost' or the name of the local host."
-  :group 'tramp
-  :type '(repeat
-          (cons string
-                (set (list (const tramp-connection-function) function)
-                     (list (const tramp-login-program)
-                          (choice (const nil) string))
-                     (list (const tramp-copy-program)
-                          (choice (const nil) string))
-                     (list (const tramp-remote-sh)
-                          (choice (const nil) string))
-                     (list (const tramp-login-args) (repeat string))
-                     (list (const tramp-copy-args) (repeat string))
-                     (list (const tramp-copy-keep-date-arg)
-                          (choice (const nil) string))
-                     (list (const tramp-encoding-command)
-                          (choice (const nil) string))
-                     (list (const tramp-decoding-command)
-                          (choice (const nil) string))
-                     (list (const tramp-encoding-function)
-                          (choice (const nil) function))
-                     (list (const tramp-decoding-function)
-                          (choice (const nil) function))
-                    (list (const tramp-password-end-of-line)
-                          (choice (const nil) string))))))
-
-(defcustom tramp-multi-methods '("multi" "multiu")
-  "*List of multi-hop methods.
-Each entry in this list should be a method name as mentioned in the
-variable `tramp-methods'."
-  :group 'tramp
-  :type '(repeat string))
-
-(defcustom tramp-multi-connection-function-alist
-  '(("telnet" tramp-multi-connect-telnet "telnet %h%n")
-    ("rsh"    tramp-multi-connect-rlogin "rsh %h -l %u%n")
-    ("remsh"  tramp-multi-connect-rlogin "remsh %h -l %u%n")
-    ("ssh"    tramp-multi-connect-rlogin "ssh %h -l %u%n")
-    ("ssht"   tramp-multi-connect-rlogin "ssh %h -e none -t -t -l %u%n")
-    ("su"     tramp-multi-connect-su     "su - %u%n")
-    ("sudo"   tramp-multi-connect-su     "sudo -u %u -s -p Password:%n"))
-  "*List of connection functions for multi-hop methods.
-Each list item is a list of three items (METHOD FUNCTION COMMAND),
-where METHOD is the name as used in the file name, FUNCTION is the
-function to be executed, and COMMAND is the shell command used for
-connecting.
-
-COMMAND may contain percent escapes.  `%u' will be replaced with the
-user name, `%h' will be replaced with the host name, and `%n' will be
-replaced with an end-of-line character, as specified in the variable
-`tramp-rsh-end-of-line'.  Use `%%' for a literal percent character.
-Note that the interpretation of the percent escapes also depends on
-the FUNCTION.  For example, the `%u' escape is forbidden with the
-function `tramp-multi-connect-telnet'.  See the documentation of the
-various functions for details."
-  :group 'tramp
-  :type '(repeat (list string function string)))
+When using `su' or `sudo' the phrase `open connection to a remote
+host' sounds strange, but it is used nevertheless, for consistency.
+No connection is opened to a remote host, but `su' or `sudo' is
+started on the local host.  You should specify a remote host
+`localhost' or the name of the local host.  Another host name is
+useful only in combination with `tramp-default-proxies-alist'.")
 
 (defcustom tramp-default-method
   ;; An external copy method seems to be preferred, because it is much
@@ -696,30 +698,26 @@ various functions for details."
   ;; another good choice because of the "ControlMaster" option, but
   ;; this is a more modern alternative in OpenSSH 4, which cannot be
   ;; taken as default.
-  (let ((e-f (fboundp 'executable-find)))
-    (cond
-     ;; PuTTY is installed.
-     ((and e-f (funcall 'executable-find "pscp"))
-      (if (or (fboundp 'password-read)
-             ;; Pageant is running.
-             (and (fboundp 'w32-window-exists-p)
-                  (funcall 'w32-window-exists-p "Pageant" "Pageant")))
-         "pscp"
-       "plink"))
-     ;; There is an ssh installation.
-     ((and e-f (funcall 'executable-find "scp"))
-      (if (or (fboundp 'password-read)
-             ;; ssh-agent is running.
-             (getenv "SSH_AUTH_SOCK")
-             (getenv "SSH_AGENT_PID"))
-         "scp"
-       "ssh"))
-     ;; Under Emacs 20, `executable-find' does not exists.  So we
-     ;; couldn't check whether there is an ssh implementation.  Let's
-     ;; hope the best.
-     ((not e-f) "ssh")
-     ;; Fallback.
-     (t "ftp")))
+  (cond
+   ;; PuTTY is installed.
+   ((executable-find "pscp")
+    (if        (or (fboundp 'password-read)
+           ;; Pageant is running.
+           (and (fboundp 'w32-window-exists-p)
+                (funcall (symbol-function 'w32-window-exists-p)
+                         "Pageant" "Pageant")))
+       "pscp"
+      "plink"))
+   ;; There is an ssh installation.
+   ((executable-find "scp")
+    (if        (or (fboundp 'password-read)
+           ;; ssh-agent is running.
+           (getenv "SSH_AUTH_SOCK")
+           (getenv "SSH_AGENT_PID"))
+       "scp"
+      "ssh"))
+   ;; Fallback.
+   (t "ftp"))
   "*Default method to use for transferring files.
 See `tramp-methods' for possibilities.
 Also see `tramp-default-method-alist'."
@@ -728,7 +726,7 @@ Also see `tramp-default-method-alist'."
 
 (defcustom tramp-default-method-alist
   '(("\\`localhost\\'" "\\`root\\'" "su"))
-  "*Default method to use for specific user/host pairs.
+  "*Default method to use for specific host/user pairs.
 This is an alist of items (HOST USER METHOD).  The first matching item
 specifies the method to use for a file name which does not specify a
 method.  HOST and USER are regular expressions or nil, which is
@@ -744,42 +742,90 @@ See `tramp-methods' for a list of possibilities for METHOD."
                       (regexp :tag "User regexp")
                       (string :tag "Method"))))
 
-;; Default values for non-Unices seeked
+(defcustom tramp-default-user
+  nil
+  "*Default user to use for transferring files.
+It is nil by default; otherwise settings in configuration files like
+\"~/.ssh/config\" would be overwritten.  Also see `tramp-default-user-alist'.
+
+This variable is regarded as obsolete, and will be removed soon."
+  :group 'tramp
+  :type '(choice (const nil) string))
+
+(defcustom tramp-default-user-alist
+  `(("\\`su\\(do\\)?\\'" nil "root")
+    ("\\`r\\(em\\)?\\(cp\\|sh\\)\\|telnet\\|plink1?\\'"
+     nil ,(user-login-name)))
+  "*Default user to use for specific method/host pairs.
+This is an alist of items (METHOD HOST USER).  The first matching item
+specifies the user to use for a file name which does not specify a
+user.  METHOD and USER are regular expressions or nil, which is
+interpreted as a regular expression which always matches.  If no entry
+matches, the variable `tramp-default-user' takes effect.
+
+If the file name does not specify the method, lookup is done using the
+empty string for the method name."
+  :group 'tramp
+  :type '(repeat (list (regexp :tag "Method regexp")
+                      (regexp :tag "Host regexp")
+                      (string :tag "User"))))
+
+(defcustom tramp-default-host
+  (system-name)
+  "*Default host to use for transferring files.
+Useful for su and sudo methods mostly."
+  :group 'tramp
+  :type 'string)
+
+(defcustom tramp-default-proxies-alist nil
+  "*Route to be followed for specific host/user pairs.
+This is an alist of items (HOST USER PROXY).  The first matching
+item specifies the proxy to be passed for a file name located on
+a remote target matching USER@HOST.  HOST and USER are regular
+expressions or nil, which is interpreted as a regular expression
+which always matches.  PROXY must be a Tramp filename without a
+localname part.  Method and user name on PROXY are optional,
+which is interpreted with the default values.  PROXY can contain
+the patterns %h and %u, which are replaced by the strings
+matching HOST or USER, respectively."
+  :group 'tramp
+  :type '(repeat (list (regexp :tag "Host regexp")
+                      (regexp :tag "User regexp")
+                      (string :tag "Proxy remote name"))))
+
 (defconst tramp-completion-function-alist-rsh
-  (unless (memq system-type '(windows-nt))
-    '((tramp-parse-rhosts "/etc/hosts.equiv")
-      (tramp-parse-rhosts "~/.rhosts")))
+  '((tramp-parse-rhosts "/etc/hosts.equiv")
+    (tramp-parse-rhosts "~/.rhosts"))
   "Default list of (FUNCTION FILE) pairs to be examined for rsh methods.")
 
-;; Default values for non-Unices seeked
 (defconst tramp-completion-function-alist-ssh
-  (unless (memq system-type '(windows-nt))
-    '((tramp-parse-rhosts      "/etc/hosts.equiv")
-      (tramp-parse-rhosts      "/etc/shosts.equiv")
-      (tramp-parse-shosts      "/etc/ssh_known_hosts")
-      (tramp-parse-sconfig     "/etc/ssh_config")
-      (tramp-parse-shostkeys   "/etc/ssh2/hostkeys")
-      (tramp-parse-sknownhosts "/etc/ssh2/knownhosts")
-      (tramp-parse-rhosts      "~/.rhosts")
-      (tramp-parse-rhosts      "~/.shosts")
-      (tramp-parse-shosts      "~/.ssh/known_hosts")
-      (tramp-parse-sconfig     "~/.ssh/config")
-      (tramp-parse-shostkeys   "~/.ssh2/hostkeys")
-      (tramp-parse-sknownhosts "~/.ssh2/knownhosts")))
+  '((tramp-parse-rhosts      "/etc/hosts.equiv")
+    (tramp-parse-rhosts      "/etc/shosts.equiv")
+    (tramp-parse-shosts      "/etc/ssh_known_hosts")
+    (tramp-parse-sconfig     "/etc/ssh_config")
+    (tramp-parse-shostkeys   "/etc/ssh2/hostkeys")
+    (tramp-parse-sknownhosts "/etc/ssh2/knownhosts")
+    (tramp-parse-rhosts      "~/.rhosts")
+    (tramp-parse-rhosts      "~/.shosts")
+    (tramp-parse-shosts      "~/.ssh/known_hosts")
+    (tramp-parse-sconfig     "~/.ssh/config")
+    (tramp-parse-shostkeys   "~/.ssh2/hostkeys")
+    (tramp-parse-sknownhosts "~/.ssh2/knownhosts"))
   "Default list of (FUNCTION FILE) pairs to be examined for ssh methods.")
 
-;; Default values for non-Unices seeked
 (defconst tramp-completion-function-alist-telnet
-  (unless (memq system-type '(windows-nt))
-    '((tramp-parse-hosts "/etc/hosts")))
+  '((tramp-parse-hosts "/etc/hosts"))
   "Default list of (FUNCTION FILE) pairs to be examined for telnet methods.")
 
-;; Default values for non-Unices seeked
 (defconst tramp-completion-function-alist-su
-  (unless (memq system-type '(windows-nt))
-    '((tramp-parse-passwd "/etc/passwd")))
+  '((tramp-parse-passwd "/etc/passwd"))
   "Default list of (FUNCTION FILE) pairs to be examined for su methods.")
 
+(defconst tramp-completion-function-alist-putty
+  '((tramp-parse-putty
+     "HKEY_CURRENT_USER\\Software\\SimonTatham\\PuTTY\\Sessions"))
+  "Default list of (FUNCTION REGISTRY) pairs to be examined for putty methods.")
+
 (defvar tramp-completion-function-alist nil
   "*Alist of methods for remote files.
 This is a list of entries of the form (NAME PAIR1 PAIR2 ...).
@@ -795,6 +841,7 @@ names from FILE for completion.  The following predefined FUNCTIONs exists:
  * `tramp-parse-hosts'       for \"/etc/hosts\" like files,
  * `tramp-parse-passwd'      for \"/etc/passwd\" like files.
  * `tramp-parse-netrc'       for \"~/.netrc\" like files.
+ * `tramp-parse-putty'       for PuTTY registry keys.
 
 FUNCTION can also be a customer defined function.  For more details see
 the info pages.")
@@ -837,8 +884,6 @@ the info pages.")
       "su" tramp-completion-function-alist-su)
      (tramp-set-completion-function
       "sudo" tramp-completion-function-alist-su)
-     (tramp-set-completion-function
-      "multi" nil)
      (tramp-set-completion-function
       "scpx" tramp-completion-function-alist-ssh)
      (tramp-set-completion-function
@@ -849,11 +894,27 @@ the info pages.")
       "plink" tramp-completion-function-alist-ssh)
      (tramp-set-completion-function
       "plink1" tramp-completion-function-alist-ssh)
+     (tramp-set-completion-function
+      "plinkx" tramp-completion-function-alist-putty)
      (tramp-set-completion-function
       "pscp" tramp-completion-function-alist-ssh)
      (tramp-set-completion-function
       "fcp" tramp-completion-function-alist-ssh)))
 
+(defconst tramp-echo-mark "_echo\b\b\b\b\b"
+  "String mark to be transmitted around shell commands.
+Used to separate their echo from the output they produce.  This
+will only be used if we cannot disable remote echo via stty.
+This string must have no effect on the remote shell except for
+producing some echo which can later be detected by
+`tramp-echoed-echo-mark-regexp'.  Using some characters followed
+by an equal number of backspaces to erase them will usually
+suffice.")
+
+(defconst tramp-echoed-echo-mark-regexp "_echo\\(\b\\( \b\\)?\\)\\{5\\}"
+  "Regexp which matches `tramp-echo-mark' as it gets echoed by
+the remote shell.")
+
 (defcustom tramp-rsh-end-of-line "\n"
   "*String used for end of line in rsh connections.
 I don't think this ever needs to be changed, so please tell me about it
@@ -878,17 +939,53 @@ The default value is to use the same value as `tramp-rsh-end-of-line'."
   :group 'tramp
   :type 'string)
 
+;; "getconf PATH" yields:
+;; HP-UX: /usr/bin:/usr/ccs/bin:/opt/ansic/bin:/opt/langtools/bin:/opt/fortran/bin
+;; Solaris: /usr/xpg4/bin:/usr/ccs/bin:/usr/bin:/opt/SUNWspro/bin
+;; Linux (Debian, Suse): /bin:/usr/bin
+;; FreeBSD: /usr/bin:/bin:/usr/sbin:/sbin: - beware trailing ":"!
 (defcustom tramp-remote-path
-  ;; "/usr/xpg4/bin" has been placed first, because on Solaris a POSIX
-  ;; compatible "id" is needed.
-  '("/usr/xpg4/bin" "/bin" "/usr/bin" "/usr/sbin" "/usr/local/bin"
-    "/usr/ccs/bin" "/local/bin" "/local/freeware/bin" "/local/gnu/bin"
+  '(tramp-default-remote-path "/usr/sbin" "/usr/local/bin"
+    "/local/bin" "/local/freeware/bin" "/local/gnu/bin"
     "/usr/freeware/bin" "/usr/pkg/bin" "/usr/contrib/bin")
   "*List of directories to search for executables on remote host.
-Please notify me about other semi-standard directories to include here.
+For every remote host, this variable will be set buffer local,
+keeping the list of existing directories on that host.
 
 You can use `~' in this list, but when searching for a shell which groks
-tilde expansion, all directory names starting with `~' will be ignored."
+tilde expansion, all directory names starting with `~' will be ignored.
+
+`Default Directories' represent the list of directories given by
+the command \"getconf PATH\".  It is recommended to use this
+entry on top of this list, because these are the default
+directories for POSIX compatible commands."
+  :group 'tramp
+  :type '(repeat (choice
+                 (const :tag "Default Directories" tramp-default-remote-path)
+                 (string :tag "Directory"))))
+
+(defcustom tramp-terminal-type "dumb"
+  "*Value of TERM environment variable for logging in to remote host.
+Because Tramp wants to parse the output of the remote shell, it is easily
+confused by ANSI color escape sequences and suchlike.  Often, shell init
+files conditionalize this setup based on the TERM environment variable."
+  :group 'tramp
+  :type 'string)
+
+(defcustom tramp-remote-process-environment
+  `("HISTFILE=$HOME/.tramp_history" "HISTSIZE=1" "LC_TIME=C"
+    ,(concat "TERM=" tramp-terminal-type)
+    "CDPATH=" "HISTORY=" "MAIL=" "MAILCHECK=" "MAILPATH="
+    "autocorrect=" "correct=")
+
+  "*List of environment variables to be set on the remote host.
+
+Each element should be a string of the form ENVVARNAME=VALUE.  An
+entry ENVVARNAME= diables the corresponding environment variable,
+which might have been set in the init files like ~/.profile.
+
+Special handling is applied to the PATH environment, which should
+not be set here. Instead of, it should be set via `tramp-remote-path'."
   :group 'tramp
   :type '(repeat string))
 
@@ -915,7 +1012,7 @@ which should work well in many cases."
   :type 'regexp)
 
 (defcustom tramp-password-prompt-regexp
-  "^.*\\([pP]assword\\|passphrase\\).*:\^@? *"
+  "^.*\\([pP]assword\\|[pP]assphrase\\).*:\^@? *"
   "*Regexp matching password-like prompts.
 The regexp should match at end of buffer.
 
@@ -933,7 +1030,9 @@ The `sudo' program appears to insert a `^@' character into the prompt."
                        "Connection closed"
                        "Sorry, try again."
                        "Name or service not known"
-                       "Host key verification failed.") t)
+                       "Host key verification failed."
+                       "No supported authentication methods left to try!"
+                       "Tramp connection closed") t)
          ".*"
          "\\|"
          "^.*\\("
@@ -1006,7 +1105,7 @@ be ignored safely."
 In fact this expression is empty by intention, it will be used only to
 check regularly the status of the associated process.
 The answer will be provided by `tramp-action-process-alive',
-`tramp-multi-action-process-alive' and`tramp-action-out-of-band', which see."
+`tramp-action-out-of-band', which see."
   :group 'tramp
   :type 'regexp)
 
@@ -1020,12 +1119,6 @@ part, though."
   :group 'tramp
   :type 'string)
 
-(defcustom tramp-discard-garbage nil
-  "*If non-nil, try to discard garbage sent by remote shell.
-Some shells send such garbage upon connection setup."
-  :group 'tramp
-  :type 'boolean)
-
 (defcustom tramp-sh-extra-args '(("/bash\\'" . "-norc -noprofile"))
   "*Alist specifying extra arguments to pass to the remote shell.
 Entries are (REGEXP . ARGS) where REGEXP is a regular expression
@@ -1042,139 +1135,134 @@ shell from reading its init file."
            '(alist :key-type string :value-type string)
          '(repeat (cons string string))))
 
-(defcustom tramp-prefix-format
-  (if tramp-unified-filenames "/" "/[")
-  "*String matching the very beginning of tramp file names.
-Used in `tramp-make-tramp-file-name' and `tramp-make-tramp-multi-file-name'."
+;; XEmacs is distributed with few Lisp packages.  Further packages are
+;; installed using EFS.  If we use a unified filename format, then
+;; Tramp is required in addition to EFS.  (But why can't Tramp just
+;; disable EFS when Tramp is loaded?  Then XEmacs can ship with EFS
+;; just like before.)  Another reason for using a separate filename
+;; syntax on XEmacs is that EFS hooks into XEmacs in many places, but
+;; Tramp only knows how to deal with `file-name-handler-alist', not
+;; the other places.
+
+;; Currently, we have the choice between 'ftp, 'sep, and 'url.
+;;;###autoload
+(defcustom tramp-syntax
+  (if (featurep 'xemacs) 'sep 'ftp)
+  "Tramp filename syntax to be used.
+
+It can have the following values:
+
+  'ftp -- Ange-FTP respective EFS like syntax (GNU Emacs default)
+  'sep -- Syntax as defined for XEmacs (not available yet for GNU Emacs)
+  'url -- URL-like syntax."
   :group 'tramp
-  :type 'string)
+  :type (if (featurep 'xemacs)
+           '(choice (const :tag "EFS"    ftp)
+                    (const :tag "XEmacs" sep)
+                    (const :tag "URL"    url))
+         '(choice (const :tag "Ange-FTP" ftp)
+                  (const :tag "URL"      url))))
+
+(defconst tramp-prefix-format
+  (cond ((equal tramp-syntax 'ftp) "/")
+       ((equal tramp-syntax 'sep) "/[")
+       ((equal tramp-syntax 'url) "/")
+       (t (error "Wrong `tramp-syntax' defined")))
+  "*String matching the very beginning of tramp file names.
+Used in `tramp-make-tramp-file-name'.")
 
-(defcustom tramp-prefix-regexp
+(defconst tramp-prefix-regexp
   (concat "^" (regexp-quote tramp-prefix-format))
   "*Regexp matching the very beginning of tramp file names.
-Should always start with \"^\". Derived from `tramp-prefix-format'."
-  :group 'tramp
-  :type 'regexp)
+Should always start with \"^\". Derived from `tramp-prefix-format'.")
 
-(defcustom tramp-method-regexp
+(defconst tramp-method-regexp
   "[a-zA-Z_0-9-]+"
-  "*Regexp matching methods identifiers."
-  :group 'tramp
-  :type 'regexp)
-
-;; It is a little bit annoying that in XEmacs case this delimeter is different
-;; for single-hop and multi-hop cases.
-(defcustom tramp-postfix-single-method-format
-  (if tramp-unified-filenames ":" "/")
-  "*String matching delimeter between method and user or host names.
-Applicable for single-hop methods.
-Used in `tramp-make-tramp-file-name'."
-  :group 'tramp
-  :type 'string)
-
-(defcustom tramp-postfix-single-method-regexp
-  (regexp-quote tramp-postfix-single-method-format)
-  "*Regexp matching delimeter between method and user or host names.
-Applicable for single-hop methods.
-Derived from `tramp-postfix-single-method-format'."
-  :group 'tramp
-  :type 'regexp)
+  "*Regexp matching methods identifiers.")
 
-(defcustom tramp-postfix-multi-method-format
-  ":"
+(defconst tramp-postfix-method-format
+  (cond ((equal tramp-syntax 'ftp) ":")
+       ((equal tramp-syntax 'sep) "/")
+       ((equal tramp-syntax 'url) "://")
+       (t (error "Wrong `tramp-syntax' defined")))
   "*String matching delimeter between method and user or host names.
-Applicable for multi-hop methods.
-Used in `tramp-make-tramp-multi-file-name'."
-  :group 'tramp
-  :type 'string)
+Used in `tramp-make-tramp-file-name'.")
 
-(defcustom tramp-postfix-multi-method-regexp
-  (regexp-quote tramp-postfix-multi-method-format)
+(defconst tramp-postfix-method-regexp
+  (regexp-quote tramp-postfix-method-format)
   "*Regexp matching delimeter between method and user or host names.
-Applicable for multi-hop methods.
-Derived from `tramp-postfix-multi-method-format'."
-  :group 'tramp
-  :type 'regexp)
-
-(defcustom tramp-postfix-multi-hop-format
-  (if tramp-unified-filenames ":" "/")
-  "*String matching delimeter between host and next method.
-Applicable for multi-hop methods.
-Used in `tramp-make-tramp-multi-file-name'."
-  :group 'tramp
-  :type 'string)
-
-(defcustom tramp-postfix-multi-hop-regexp
-  (regexp-quote tramp-postfix-multi-hop-format)
-  "*Regexp matching delimeter between host and next method.
-Applicable for multi-hop methods.
-Derived from `tramp-postfix-multi-hop-format'."
-  :group 'tramp
-  :type 'regexp)
+Derived from `tramp-postfix-method-format'.")
 
-(defcustom tramp-user-regexp
-  "[^:/ \t]*"
-  "*Regexp matching user names."
-  :group 'tramp
-  :type 'regexp)
+(defconst tramp-user-regexp
+  "[^:/ \t]+"
+  "*Regexp matching user names.")
 
-(defcustom tramp-postfix-user-format
+(defconst tramp-postfix-user-format
   "@"
   "*String matching delimeter between user and host names.
-Used in `tramp-make-tramp-file-name' and `tramp-make-tramp-multi-file-name'."
-  :group 'tramp
-  :type 'string)
+Used in `tramp-make-tramp-file-name'.")
 
-(defcustom tramp-postfix-user-regexp
+(defconst tramp-postfix-user-regexp
   (regexp-quote tramp-postfix-user-format)
   "*Regexp matching delimeter between user and host names.
-Derived from `tramp-postfix-user-format'."
-  :group 'tramp
-  :type 'regexp)
-
-(defcustom tramp-host-regexp
-  "[a-zA-Z0-9_.-]*"
-  "*Regexp matching host names."
-  :group 'tramp
-  :type 'regexp)
-
-(defcustom tramp-host-with-port-regexp
-  "[a-zA-Z0-9_.#-]*"
-  "*Regexp matching host names."
-  :group 'tramp
-  :type 'regexp)
-
-(defcustom tramp-postfix-host-format
-  (if tramp-unified-filenames ":" "]")
+Derived from `tramp-postfix-user-format'.")
+
+(defconst tramp-host-regexp
+  "[a-zA-Z0-9_.-]+"
+  "*Regexp matching host names.")
+
+(defconst tramp-prefix-port-format
+  (cond ((equal tramp-syntax 'ftp) "#")
+       ((equal tramp-syntax 'sep) "#")
+       ((equal tramp-syntax 'url) ":")
+       (t (error "Wrong `tramp-syntax' defined")))
+  "*String matching delimeter between host names and port numbers.")
+
+(defconst tramp-prefix-port-regexp
+  (regexp-quote tramp-prefix-port-format)
+  "*Regexp matching delimeter between host names and port numbers.
+Derived from `tramp-prefix-port-format'.")
+
+(defconst tramp-port-regexp
+  "[0-9]+"
+  "*Regexp matching port numbers.")
+
+(defconst tramp-host-with-port-regexp
+  (concat "\\(" tramp-host-regexp "\\)"
+               tramp-prefix-port-regexp
+         "\\(" tramp-port-regexp "\\)")
+  "*Regexp matching host names with port numbers.")
+
+(defconst tramp-postfix-host-format
+  (cond ((equal tramp-syntax 'ftp) ":")
+       ((equal tramp-syntax 'sep) "]")
+       ((equal tramp-syntax 'url) "")
+       (t (error "Wrong `tramp-syntax' defined")))
   "*String matching delimeter between host names and localnames.
-Used in `tramp-make-tramp-file-name' and `tramp-make-tramp-multi-file-name'."
-  :group 'tramp
-  :type 'string)
+Used in `tramp-make-tramp-file-name'.")
 
-(defcustom tramp-postfix-host-regexp
+(defconst tramp-postfix-host-regexp
   (regexp-quote tramp-postfix-host-format)
   "*Regexp matching delimeter between host names and localnames.
-Derived from `tramp-postfix-host-format'."
-  :group 'tramp
-  :type 'regexp)
+Derived from `tramp-postfix-host-format'.")
 
-(defcustom tramp-localname-regexp
+(defconst tramp-localname-regexp
   ".*$"
-  "*Regexp matching localnames."
-  :group 'tramp
-  :type 'regexp)
+  "*Regexp matching localnames.")
 
 ;; File name format.
 
-(defcustom tramp-file-name-structure
+(defconst tramp-file-name-structure
   (list
    (concat
     tramp-prefix-regexp
-    "\\(" "\\(" tramp-method-regexp "\\)" tramp-postfix-single-method-regexp "\\)?"
-    "\\(" "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp   "\\)?"
-          "\\(" tramp-host-with-port-regexp "\\)" tramp-postfix-host-regexp
-         "\\(" tramp-localname-regexp "\\)")
-   2 4 5 6)
+    "\\(" "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp "\\)?"
+    "\\(" "\\(" tramp-user-regexp "\\)"   tramp-postfix-user-regexp   "\\)?"
+    "\\(" tramp-host-regexp
+          "\\(" tramp-prefix-port-regexp  tramp-port-regexp "\\)?" "\\)?"
+    tramp-postfix-host-regexp
+    "\\(" tramp-localname-regexp "\\)")
+   2 4 5 7)
 
   "*List of five elements (REGEXP METHOD USER HOST FILE), detailing \
 the tramp file name structure.
@@ -1190,69 +1278,81 @@ but for the host name.  The fifth element FILE is for the file name.
 These numbers are passed directly to `match-string', which see.  That
 means the opening parentheses are counted to identify the pair.
 
-See also `tramp-file-name-regexp'."
-  :group 'tramp
-  :type '(list (regexp :tag "File name regexp")
-               (integer :tag "Paren pair for method name")
-               (integer :tag "Paren pair for user name  ")
-               (integer :tag "Paren pair for host name  ")
-               (integer :tag "Paren pair for file name  ")))
+See also `tramp-file-name-regexp'.")
 
 ;;;###autoload
 (defconst tramp-file-name-regexp-unified
   "\\`/[^/:]+:"
   "Value for `tramp-file-name-regexp' for unified remoting.
 Emacs (not XEmacs) uses a unified filename syntax for Ange-FTP and
-Tramp.  See `tramp-file-name-structure-unified' for more explanations.")
+Tramp.  See `tramp-file-name-structure' for more explanations.")
 
 ;;;###autoload
 (defconst tramp-file-name-regexp-separate
   "\\`/\\[.*\\]"
   "Value for `tramp-file-name-regexp' for separate remoting.
 XEmacs uses a separate filename syntax for Tramp and EFS.
-See `tramp-file-name-structure-separate' for more explanations.")
+See `tramp-file-name-structure' for more explanations.")
 
 ;;;###autoload
-(defcustom tramp-file-name-regexp
-  (if tramp-unified-filenames
-      tramp-file-name-regexp-unified
-    tramp-file-name-regexp-separate)
+(defconst tramp-file-name-regexp-url
+  "\\`/[^/:]+://"
+  "Value for `tramp-file-name-regexp' for URL-like remoting.
+See `tramp-file-name-structure' for more explanations.")
+
+;;;###autoload
+(defconst tramp-file-name-regexp
+  (cond ((equal tramp-syntax 'ftp) tramp-file-name-regexp-unified)
+       ((equal tramp-syntax 'sep) tramp-file-name-regexp-separate)
+       ((equal tramp-syntax 'url) tramp-file-name-regexp-url)
+       (t (error "Wrong `tramp-syntax' defined")))
   "*Regular expression matching file names handled by tramp.
 This regexp should match tramp file names but no other file names.
 \(When tramp.el is loaded, this regular expression is prepended to
 `file-name-handler-alist', and that is searched sequentially.  Thus,
 if the tramp entry appears rather early in the `file-name-handler-alist'
 and is a bit too general, then some files might be considered tramp
-files which are not really tramp files.
+files which are not really Tramp files.
 
 Please note that the entry in `file-name-handler-alist' is made when
 this file (tramp.el) is loaded.  This means that this variable must be set
 before loading tramp.el.  Alternatively, `file-name-handler-alist' can be
 updated after changing this variable.
 
-Also see `tramp-file-name-structure'."
-  :group 'tramp
-  :type 'regexp)
+Also see `tramp-file-name-structure'.")
 
 ;;;###autoload
 (defconst tramp-completion-file-name-regexp-unified
-  "^/$\\|^/[^/:][^/]*$"
+  (if (memq system-type '(cygwin windows-nt))
+      "^\\([a-zA-Z]:\\)?/$\\|^\\([a-zA-Z]:\\)?/[^/:][^/]*$"
+    "^/$\\|^/[^/:][^/]*$")
   "Value for `tramp-completion-file-name-regexp' for unified remoting.
 Emacs (not XEmacs) uses a unified filename syntax for Ange-FTP and
-Tramp.  See `tramp-file-name-structure-unified' for more explanations.")
+Tramp.  See `tramp-file-name-structure' for more explanations.")
 
 ;;;###autoload
 (defconst tramp-completion-file-name-regexp-separate
-  "^/\\([[][^]]*\\)?$"
+  (if (memq system-type '(cygwin windows-nt))
+      "^\\([a-zA-Z]:\\)?/\\([[][^]]*\\)?$"
+    "^/\\([[][^]]*\\)?$")
   "Value for `tramp-completion-file-name-regexp' for separate remoting.
 XEmacs uses a separate filename syntax for Tramp and EFS.
-See `tramp-file-name-structure-separate' for more explanations.")
+See `tramp-file-name-structure' for more explanations.")
 
 ;;;###autoload
-(defcustom tramp-completion-file-name-regexp
-  (if tramp-unified-filenames
-      tramp-completion-file-name-regexp-unified
-    tramp-completion-file-name-regexp-separate)
+(defconst tramp-completion-file-name-regexp-url
+  (if (memq system-type '(cygwin windows-nt))
+      "^\\([a-zA-Z]:\\)?/$\\|^\\([a-zA-Z]:\\)?/[^/:]+\\(:\\(/\\(/[^/]*\\)?\\)?\\)?$"
+    "^/$\\|^/[^/:]+\\(:\\(/\\(/[^/]*\\)?\\)?\\)?$")
+  "Value for `tramp-completion-file-name-regexp' for URL-like remoting.
+See `tramp-file-name-structure' for more explanations.")
+
+;;;###autoload
+(defconst tramp-completion-file-name-regexp
+  (cond ((equal tramp-syntax 'ftp) tramp-completion-file-name-regexp-unified)
+       ((equal tramp-syntax 'sep) tramp-completion-file-name-regexp-separate)
+       ((equal tramp-syntax 'url) tramp-completion-file-name-regexp-url)
+       (t (error "Wrong `tramp-syntax' defined")))
   "*Regular expression matching file names handled by tramp completion.
 This regexp should match partial tramp file names only.
 
@@ -1261,121 +1361,14 @@ this file (tramp.el) is loaded.  This means that this variable must be set
 before loading tramp.el.  Alternatively, `file-name-handler-alist' can be
 updated after changing this variable.
 
-Also see `tramp-file-name-structure'."
-  :group 'tramp
-  :type 'regexp)
-
-(defcustom tramp-multi-file-name-structure
-  (list
-   (concat
-    tramp-prefix-regexp
-    "\\(" "\\(" tramp-method-regexp "\\)" "\\)?"
-    "\\(" "\\(" tramp-postfix-multi-hop-regexp "%s" "\\)+" "\\)?"
-    tramp-postfix-host-regexp "\\(" tramp-localname-regexp "\\)")
-   2 3 -1)
-  "*Describes the file name structure of `multi' files.
-Multi files allow you to contact a remote host in several hops.
-This is a list of four elements (REGEXP METHOD HOP LOCALNAME).
-
-The first element, REGEXP, gives a regular expression to match against
-the file name.  In this regular expression, `%s' is replaced with the
-value of `tramp-multi-file-name-hop-structure'.  (Note: in order to
-allow multiple hops, you normally want to use something like
-\"\\\\(\\\\(%s\\\\)+\\\\)\" in the regular expression.  The outer pair
-of parentheses is used for the HOP element, see below.)
-
-All remaining elements are numbers.  METHOD gives the number of the
-paren pair which matches the method name.  HOP gives the number of the
-paren pair which matches the hop sequence.  LOCALNAME gives the number of
-the paren pair which matches the localname (pathname) on the remote host.
-
-LOCALNAME can also be negative, which means to count from the end.  Ie, a
-value of -1 means the last paren pair.
-
-I think it would be good if the regexp matches the whole of the
-string, but I haven't actually tried what happens if it doesn't..."
-  :group 'tramp
-  :type '(list (regexp :tag "File name regexp")
-               (integer :tag "Paren pair for method name")
-               (integer :tag "Paren pair for hops")
-               (integer :tag "Paren pair to match localname")))
-
-(defcustom tramp-multi-file-name-hop-structure
-  (list
-   (concat
-    "\\(" tramp-method-regexp "\\)" tramp-postfix-multi-method-regexp
-    "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp
-    "\\(" tramp-host-with-port-regexp "\\)")
-   1 2 3)
-  "*Describes the structure of a hop in multi files.
-This is a list of four elements (REGEXP METHOD USER HOST).  First
-element REGEXP is used to match against the hop.  Pair number METHOD
-matches the method of one hop, pair number USER matches the user of
-one hop, pair number HOST matches the host of one hop.
-
-This regular expression should match exactly all of one hop."
-  :group 'tramp
-  :type '(list (regexp :tag "Hop regexp")
-               (integer :tag "Paren pair for method name")
-               (integer :tag "Paren pair for user name")
-               (integer :tag "Paren pair for host name")))
-
-(defcustom tramp-make-multi-tramp-file-format
-  (list
-   (concat tramp-prefix-format "%m")
-   (concat tramp-postfix-multi-hop-format
-    "%m" tramp-postfix-multi-method-format
-    "%u" tramp-postfix-user-format
-    "%h")
-   (concat tramp-postfix-host-format "%p"))
-  "*Describes how to construct a `multi' file name.
-This is a list of three elements PREFIX, HOP and LOCALNAME.
-
-The first element PREFIX says how to construct the prefix, the second
-element HOP specifies what each hop looks like, and the final element
-LOCALNAME says how to construct the localname (pathname).
+Also see `tramp-file-name-structure'.")
 
-In PREFIX, `%%' means `%' and `%m' means the method name.
-
-In HOP, `%%' means `%' and `%m', `%u', `%h' mean the hop method, hop
-user and hop host, respectively.
-
-In LOCALNAME, `%%' means `%' and `%p' means the localname.
-
-The resulting file name always contains one copy of PREFIX and one
-copy of LOCALNAME, but there is one copy of HOP for each hop in the file
-name.
-
-Note: the current implementation requires the prefix to contain the
-method name, followed by all the hops, and the localname must come
-last."
-  :group 'tramp
-  :type '(list string string string))
-
-(defcustom tramp-terminal-type "dumb"
-  "*Value of TERM environment variable for logging in to remote host.
-Because Tramp wants to parse the output of the remote shell, it is easily
-confused by ANSI color escape sequences and suchlike.  Often, shell init
-files conditionalize this setup based on the TERM environment variable."
-  :group 'tramp
-  :type 'string)
-
-(defcustom tramp-completion-without-shell-p nil
-  "*If nil, use shell wildcards for completion, else rely on Lisp only.
-Using shell wildcards for completions has the advantage that it can be
-fast even in large directories, but completion is always
-case-sensitive.  Relying on Lisp only means that case-insensitive
-completion is possible (subject to the variable `completion-ignore-case'),
-but it might be slow on large directories."
-  :group 'tramp
-  :type 'boolean)
-
-(defcustom tramp-actions-before-shell
-  '((tramp-password-prompt-regexp tramp-action-password)
-    (tramp-login-prompt-regexp tramp-action-login)
+(defconst tramp-actions-before-shell
+  '((tramp-login-prompt-regexp tramp-action-login)
+    (tramp-password-prompt-regexp tramp-action-password)
+    (tramp-wrong-passwd-regexp tramp-action-permission-denied)
     (shell-prompt-pattern tramp-action-succeed)
     (tramp-shell-prompt-pattern tramp-action-succeed)
-    (tramp-wrong-passwd-regexp tramp-action-permission-denied)
     (tramp-yesno-prompt-regexp tramp-action-yesno)
     (tramp-yn-prompt-regexp tramp-action-yn)
     (tramp-terminal-prompt-regexp tramp-action-terminal)
@@ -1390,51 +1383,19 @@ regexp must match at the end of the buffer, \"\\'\" is implicitly
 appended to it.
 
 The ACTION should also be a symbol, but a function.  When the
-corresponding PATTERN matches, the ACTION function is called."
-  :group 'tramp
-  :type '(repeat (list variable function)))
+corresponding PATTERN matches, the ACTION function is called.")
 
-(defcustom tramp-actions-copy-out-of-band
+(defconst tramp-actions-copy-out-of-band
   '((tramp-password-prompt-regexp tramp-action-password)
     (tramp-wrong-passwd-regexp tramp-action-permission-denied)
-    (tramp-copy-failed-regexp tramp-action-copy-failed)
+    (tramp-copy-failed-regexp tramp-action-permission-denied)
     (tramp-process-alive-regexp tramp-action-out-of-band))
   "List of pattern/action pairs.
 This list is used for copying/renaming with out-of-band methods.
-See `tramp-actions-before-shell' for more info."
-  :group 'tramp
-  :type '(repeat (list variable function)))
-
-(defcustom tramp-multi-actions
-  '((tramp-password-prompt-regexp tramp-multi-action-password)
-    (tramp-login-prompt-regexp tramp-multi-action-login)
-    (shell-prompt-pattern tramp-multi-action-succeed)
-    (tramp-shell-prompt-pattern tramp-multi-action-succeed)
-    (tramp-wrong-passwd-regexp tramp-multi-action-permission-denied)
-    (tramp-process-alive-regexp tramp-multi-action-process-alive))
-  "List of pattern/action pairs.
-This list is used for each hop in multi-hop connections.
-See `tramp-actions-before-shell' for more info."
-  :group 'tramp
-  :type '(repeat (list variable function)))
-
-(defcustom tramp-initial-commands
-  '("unset HISTORY"
-    "unset correct"
-    "unset autocorrect")
-  "List of commands to send to the first remote shell that we see.
-These commands will be sent to any shell, and thus they should be
-designed to work in such circumstances.  Also, restrict the commands
-to the bare necessity for getting the remote shell into a state
-where it is possible to execute the Bourne-ish shell.
-
-At the moment, the command to execute the Bourne-ish shell uses strange
-quoting which `tcsh' tries to correct, so we send the command \"unset
-autocorrect\" to the remote host."
-  :group 'tramp
-  :type '(repeat string))
 
-;; Chunked sending kluge.  We set this to 500 for black-listed constellations
+See `tramp-actions-before-shell' for more info.")
+
+;; Chunked sending kludge.  We set this to 500 for black-listed constellations
 ;; known to have a bug in `process-send-string'; some ssh connections appear
 ;; to drop bytes when data is sent too quickly.  There is also a connection
 ;; buffer local variable, which is computed depending on remote host properties
@@ -1490,16 +1451,16 @@ You will see the number of bytes sent successfully to the remote host.
 If that number exceeds 1000, you can stop the execution by hitting
 C-g, because your Emacs is likely clean.
 
-If your Emacs is buggy, the code stops and gives you an indication
-about the value `tramp-chunksize' should be set.  Maybe you could just
-experiment a bit, e.g. changing the values of `init' and `step'
-in the third line of the code.
-
 When it is necessary to set `tramp-chunksize', you might consider to
 use an out-of-the-band method (like \"scp\") instead of an internal one
 \(like \"ssh\"), because setting `tramp-chunksize' to non-nil decreases
 performance.
 
+If your Emacs is buggy, the code stops and gives you an indication
+about the value `tramp-chunksize' should be set.  Maybe you could just
+experiment a bit, e.g. changing the values of `init' and `step'
+in the third line of the code.
+
 Please raise a bug report via \"M-x tramp-bug\" if your system needs
 this variable to be set as well."
   :group 'tramp
@@ -1518,144 +1479,25 @@ opening a connection to a remote host."
 
 ;;; Internal Variables:
 
-(defvar tramp-buffer-file-attributes nil
-  "Holds the `ls -ild' output for the current buffer.
-This variable is local to each buffer.  It is not used if the remote
-machine groks Perl.  If it is used, it's used as an emulation for
-the visited file modtime.")
-(make-variable-buffer-local 'tramp-buffer-file-attributes)
-
-(defvar tramp-md5-function
-  (cond ((and (require 'md5) (fboundp 'md5)) 'md5)
-       ((fboundp 'md5-encode)
-        (lambda (x) (base64-encode-string
-                     (funcall (symbol-function 'md5-encode) x))))
-       (t (error "Couldn't find an `md5' function")))
-  "Function to call for running the MD5 algorithm.")
-
 (defvar tramp-end-of-output
-  (concat "///"
-         (funcall tramp-md5-function
-                  (concat
-                   (prin1-to-string process-environment)
-                   (current-time-string)
-;;                 (prin1-to-string
-;;                  (if (fboundp 'directory-files-and-attributes)
-;;                      (funcall 'directory-files-and-attributes
-;;                               (or (getenv "HOME")
-;;                                   (tramp-temporary-file-directory)))
-;;                    (mapcar
-;;                     (lambda (x)
-;;                       (cons x (file-attributes x)))
-;;                     (directory-files (or (getenv "HOME")
-;;                                          (tramp-temporary-file-directory))
-;;                                      t))))
-                   )))
+  (concat
+   "///" (md5 (concat
+              (prin1-to-string process-environment) (current-time-string))))
   "String used to recognize end of output.")
 
-(defvar tramp-connection-function nil
-  "This internal variable holds a parameter for `tramp-methods'.
-In the connection buffer, this variable has the value of the like-named
-method parameter, as specified in `tramp-methods' (which see).")
-
-(defvar tramp-remote-sh nil
-  "This internal variable holds a parameter for `tramp-methods'.
-In the connection buffer, this variable has the value of the like-named
-method parameter, as specified in `tramp-methods' (which see).")
-
-(defvar tramp-login-program nil
-  "This internal variable holds a parameter for `tramp-methods'.
-In the connection buffer, this variable has the value of the like-named
-method parameter, as specified in `tramp-methods' (which see).")
-
-(defvar tramp-login-args nil
-  "This internal variable holds a parameter for `tramp-methods'.
-In the connection buffer, this variable has the value of the like-named
-method parameter, as specified in `tramp-methods' (which see).")
-
-(defvar tramp-copy-program nil
-  "This internal variable holds a parameter for `tramp-methods'.
-In the connection buffer, this variable has the value of the like-named
-method parameter, as specified in `tramp-methods' (which see).")
-
-(defvar tramp-copy-args nil
-  "This internal variable holds a parameter for `tramp-methods'.
-In the connection buffer, this variable has the value of the like-named
-method parameter, as specified in `tramp-methods' (which see).")
-
-(defvar tramp-copy-keep-date-arg nil
-  "This internal variable holds a parameter for `tramp-methods'.
-In the connection buffer, this variable has the value of the like-named
-method parameter, as specified in `tramp-methods' (which see).")
-
-(defvar tramp-encoding-command nil
-  "This internal variable holds a parameter for `tramp-methods'.
-In the connection buffer, this variable has the value of the like-named
-method parameter, as specified in `tramp-methods' (which see).")
-
-(defvar tramp-decoding-command nil
-  "This internal variable holds a parameter for `tramp-methods'.
-In the connection buffer, this variable has the value of the like-named
-method parameter, as specified in `tramp-methods' (which see).")
-
-(defvar tramp-encoding-function nil
-  "This internal variable holds a parameter for `tramp-methods'.
-In the connection buffer, this variable has the value of the like-named
-method parameter, as specified in `tramp-methods' (which see).")
-
-(defvar tramp-decoding-function nil
-  "This internal variable holds a parameter for `tramp-methods'.
-In the connection buffer, this variable has the value of the like-named
-method parameter, as specified in `tramp-methods' (which see).")
-
-(defvar tramp-password-end-of-line nil
-  "This internal variable holds a parameter for `tramp-methods'.
-In the connection buffer, this variable has the value of the like-named
-method parameter, as specified in `tramp-methods' (which see).")
-
-;; CCC `local in each buffer'?
-(defvar tramp-ls-command nil
-  "This command is used to get a long listing with numeric user and group ids.
-This variable is automatically made buffer-local to each rsh process buffer
-upon opening the connection.")
-
-(defvar tramp-current-multi-method nil
-  "Name of `multi' connection method for this *tramp* buffer, or nil if not multi.
-This variable is automatically made buffer-local to each rsh process buffer
-upon opening the connection.")
-
 (defvar tramp-current-method nil
-  "Connection method for this *tramp* buffer.
-This variable is automatically made buffer-local to each rsh process buffer
-upon opening the connection.")
+  "Connection method for this *tramp* buffer.")
 
 (defvar tramp-current-user nil
-  "Remote login name for this *tramp* buffer.
-This variable is automatically made buffer-local to each rsh process buffer
-upon opening the connection.")
+  "Remote login name for this *tramp* buffer.")
 
 (defvar tramp-current-host nil
-  "Remote host for this *tramp* buffer.
-This variable is automatically made buffer-local to each rsh process buffer
-upon opening the connection.")
-
-(defvar tramp-test-groks-nt nil
-  "Whether the `test' command groks the `-nt' switch.
-\(`test A -nt B' tests if file A is newer than file B.)
-This variable is automatically made buffer-local to each rsh process buffer
-upon opening the connection.")
-
-(defvar tramp-file-exists-command nil
-  "Command to use for checking if a file exists.
-This variable is automatically made buffer-local to each rsh process buffer
-upon opening the connection.")
-
-(defconst tramp-uudecode "\
-tramp_uudecode () {
-\(echo begin 600 /tmp/tramp.$$; tail +2) | uudecode
+  "Remote host for this *tramp* buffer.")
+
+(defconst tramp-uudecode
+  "(echo begin 600 /tmp/tramp.$$; tail +2) | uudecode
 cat /tmp/tramp.$$
-rm -f /tmp/tramp.$$
-}"
+rm -f /tmp/tramp.$$"
   "Shell function to implement `uudecode' to standard output.
 Many systems support `uudecode -o /dev/stdout' or `uudecode -o -'
 for this or `uudecode -p', but some systems don't, and for them
@@ -1667,7 +1509,8 @@ we have this shell function.")
 ;; end.
 ;; The device number is returned as "-1", because there will be a virtual
 ;; device number set in `tramp-handle-file-attributes'
-(defconst tramp-perl-file-attributes "\
+(defconst tramp-perl-file-attributes
+  "%s -e '
 @stat = lstat($ARGV[0]);
 if (($stat[2] & 0170000) == 0120000)
 {
@@ -1685,7 +1528,7 @@ else
 $uid = ($ARGV[1] eq \"integer\") ? $stat[4] : \"\\\"\" . getpwuid($stat[4]) . \"\\\"\";
 $gid = ($ARGV[1] eq \"integer\") ? $stat[5] : \"\\\"\" . getgrgid($stat[5]) . \"\\\"\";
 printf(
-    \"(%s %u %s %s (%u %u) (%u %u) (%u %u) %u %u t (%u . %u) -1)\\n\",
+    \"(%%s %%u %%s %%s (%%u %%u) (%%u %%u) (%%u %%u) %%u.0 %%u t (%%u . %%u) -1)\\n\",
     $type,
     $stat[3],
     $uid,
@@ -1700,11 +1543,14 @@ printf(
     $stat[2],
     $stat[1] >> 16 & 0xffff,
     $stat[1] & 0xffff
-);"
+);' \"$1\" \"$2\" \"$3\" 2>/dev/null"
   "Perl script to produce output suitable for use with `file-attributes'
-on the remote file system.")
+on the remote file system.
+Escape sequence %s is replaced with name of Perl binary.
+This string is passed to `format', so percent characters need to be doubled.")
 
-(defconst tramp-perl-directory-files-and-attributes "\
+(defconst tramp-perl-directory-files-and-attributes
+  "%s -e '
 chdir($ARGV[0]) or printf(\"\\\"Cannot change to $ARGV[0]: $''!''\\\"\\n\"), exit();
 opendir(DIR,\".\") or printf(\"\\\"Cannot open directory $ARGV[0]: $''!''\\\"\\n\"), exit();
 @list = readdir(DIR);
@@ -1731,7 +1577,7 @@ for($i = 0; $i < $n; $i++)
     $uid = ($ARGV[1] eq \"integer\") ? $stat[4] : \"\\\"\" . getpwuid($stat[4]) . \"\\\"\";
     $gid = ($ARGV[1] eq \"integer\") ? $stat[5] : \"\\\"\" . getgrgid($stat[5]) . \"\\\"\";
     printf(
-        \"(\\\"%s\\\" %s %u %s %s (%u %u) (%u %u) (%u %u) %u %u t (%u . %u) (%u %u))\\n\",
+        \"(\\\"%%s\\\" %%s %%u %%s %%s (%%u %%u) (%%u %%u) (%%u %%u) %%u.0 %%u t (%%u . %%u) (%%u %%u))\\n\",
         $filename,
         $type,
         $stat[3],
@@ -1750,9 +1596,11 @@ for($i = 0; $i < $n; $i++)
         $stat[0] >> 16 & 0xffff,
         $stat[0] & 0xffff);
 }
-printf(\")\\n\");"
+printf(\")\\n\");' \"$1\" \"$2\" \"$3\" 2>/dev/null"
   "Perl script implementing `directory-files-attributes' as Lisp `read'able
-output.")
+output.
+Escape sequence %s is replaced with name of Perl binary.
+This string is passed to `format', so percent characters need to be doubled.")
 
 ;; ;; These two use uu encoding.
 ;; (defvar tramp-perl-encode "%s -e'\
@@ -1775,25 +1623,25 @@ output.")
 ;; Escape sequence %s is replaced with name of Perl binary.")
 
 ;; These two use base64 encoding.
-(defvar tramp-perl-encode-with-module
-  "perl -MMIME::Base64 -0777 -ne 'print encode_base64($_)'"
+(defconst tramp-perl-encode-with-module
+  "%s -MMIME::Base64 -0777 -ne 'print encode_base64($_)' 2>/dev/null"
   "Perl program to use for encoding a file.
 Escape sequence %s is replaced with name of Perl binary.
 This string is passed to `format', so percent characters need to be doubled.
 This implementation requires the MIME::Base64 Perl module to be installed
 on the remote host.")
 
-(defvar tramp-perl-decode-with-module
-  "perl -MMIME::Base64 -0777 -ne 'print decode_base64($_)'"
+(defconst tramp-perl-decode-with-module
+  "%s -MMIME::Base64 -0777 -ne 'print decode_base64($_)' 2>/dev/null"
   "Perl program to use for decoding a file.
 Escape sequence %s is replaced with name of Perl binary.
 This string is passed to `format', so percent characters need to be doubled.
 This implementation requires the MIME::Base64 Perl module to be installed
 on the remote host.")
 
-(defvar tramp-perl-encode
+(defconst tramp-perl-encode
   "%s -e '
-# This script contributed by Juanma Barranquero <lektu@terra.es>.
+# This script is contributed by Juanma Barranquero <lektu@terra.es>.
 # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007
 #   Free Software Foundation, Inc.
 use strict;
@@ -1828,15 +1676,14 @@ while (my $data = <STDIN>) {
             (substr(unpack(q(B*), $data) . q(00000), 0, 432) =~ /....../g)),
               $pad,
                 qq(\\n);
-}
-'"
+}' 2>/dev/null"
   "Perl program to use for encoding a file.
 Escape sequence %s is replaced with name of Perl binary.
 This string is passed to `format', so percent characters need to be doubled.")
 
-(defvar tramp-perl-decode
+(defconst tramp-perl-decode
   "%s -e '
-# This script contributed by Juanma Barranquero <lektu@terra.es>.
+# This script is contributed by Juanma Barranquero <lektu@terra.es>.
 # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007
 #   Free Software Foundation, Inc.
 use strict;
@@ -1874,8 +1721,7 @@ while (my $data = <STDIN>) {
         ((join q(), map {$trans{$_} || q()} split //, $chunk) =~ /......../g);
 
     last if $finished;
-}
-'"
+}' 2>/dev/null"
   "Perl program to use for decoding a file.
 Escape sequence %s is replaced with name of Perl binary.
 This string is passed to `format', so percent characters need to be doubled.")
@@ -1898,44 +1744,12 @@ This string is passed to `format', so percent characters need to be doubled.")
   "A list of file types returned from the `stat' system call.
 This is used to map a mode number to a permission string.")
 
-(defvar tramp-dos-coding-system
-  (if (and (fboundp 'coding-system-p)
-           (funcall 'coding-system-p '(dos)))
-      'dos
-    'undecided-dos)
-  "Some Emacsen know the `dos' coding system, others need `undecided-dos'.")
-
-(defvar tramp-last-cmd nil
-  "Internal Tramp variable recording the last command sent.
-This variable is buffer-local in every buffer.")
-(make-variable-buffer-local 'tramp-last-cmd)
-
-(defvar tramp-process-echoes nil
-  "Whether to process echoes from the remote shell.")
-
-(defvar tramp-last-cmd-time nil
-  "Internal Tramp variable recording the time when the last cmd was sent.
-This variable is buffer-local in every buffer.")
-(make-variable-buffer-local 'tramp-last-cmd-time)
-
-;; This variable does not have the right value in XEmacs.  What should
-;; I use instead of find-operation-coding-system in XEmacs?
-(defvar tramp-feature-write-region-fix
-  (when (fboundp 'find-operation-coding-system)
-    (let ((file-coding-system-alist '(("test" emacs-mule))))
-      (funcall (symbol-function 'find-operation-coding-system)
-              'write-region 0 0 "" nil "test")))
-    "Internal variable to say if `write-region' chooses the right coding.
-Older versions of Emacs chose the coding system for `write-region' based
-on the FILENAME argument, even if VISIT was a string.")
-
 ;; New handlers should be added here.  The following operations can be
 ;; handled using the normal primitives: file-name-as-directory,
 ;; file-name-directory, file-name-nondirectory,
 ;; file-name-sans-versions, get-file-buffer.
 (defconst tramp-file-name-handler-alist
-  '(
-    (load . tramp-handle-load)
+  '((load . tramp-handle-load)
     (make-symbolic-link . tramp-handle-make-symbolic-link)
     (file-name-directory . tramp-handle-file-name-directory)
     (file-name-nondirectory . tramp-handle-file-name-nondirectory)
@@ -1943,7 +1757,6 @@ on the FILENAME argument, even if VISIT was a string.")
     (file-exists-p . tramp-handle-file-exists-p)
     (file-directory-p . tramp-handle-file-directory-p)
     (file-executable-p . tramp-handle-file-executable-p)
-    (file-accessible-directory-p . tramp-handle-file-accessible-directory-p)
     (file-readable-p . tramp-handle-file-readable-p)
     (file-regular-p . tramp-handle-file-regular-p)
     (file-symlink-p . tramp-handle-file-symlink-p)
@@ -1960,14 +1773,19 @@ on the FILENAME argument, even if VISIT was a string.")
     (copy-file . tramp-handle-copy-file)
     (rename-file . tramp-handle-rename-file)
     (set-file-modes . tramp-handle-set-file-modes)
+    (set-file-times . tramp-handle-set-file-times)
     (make-directory . tramp-handle-make-directory)
     (delete-directory . tramp-handle-delete-directory)
     (delete-file . tramp-handle-delete-file)
     (directory-file-name . tramp-handle-directory-file-name)
-    (shell-command . tramp-handle-shell-command)
+    ;; `executable-find' is not official yet.
+    (executable-find . tramp-handle-executable-find)
+    (start-file-process . tramp-handle-start-file-process)
     (process-file . tramp-handle-process-file)
+    (shell-command . tramp-handle-shell-command)
     (insert-directory . tramp-handle-insert-directory)
     (expand-file-name . tramp-handle-expand-file-name)
+    (substitute-in-file-name . tramp-handle-substitute-in-file-name)
     (file-local-copy . tramp-handle-file-local-copy)
     (file-remote-p . tramp-handle-file-remote-p)
     (insert-file-contents . tramp-handle-insert-file-contents)
@@ -1976,7 +1794,6 @@ on the FILENAME argument, even if VISIT was a string.")
     (make-auto-save-file-name . tramp-handle-make-auto-save-file-name)
     (unhandled-file-name-directory . tramp-handle-unhandled-file-name-directory)
     (dired-compress-file . tramp-handle-dired-compress-file)
-    (dired-call-process . tramp-handle-dired-call-process)
     (dired-recursive-delete-directory
      . tramp-handle-dired-recursive-delete-directory)
     (set-visited-file-modtime . tramp-handle-set-visited-file-modtime)
@@ -2006,37 +1823,115 @@ calling HANDLER.")
 
 ;;; Internal functions which must come first.
 
-(defsubst tramp-message (level fmt-string &rest args)
+(defsubst tramp-debug-message (vec fmt-string &rest args)
+  "Append message to debug buffer.
+Message is formatted with FMT-STRING as control string and the remaining
+ARGS to actually emit the message (if applicable)."
+  (when (get-buffer (tramp-buffer-name vec))
+    (with-current-buffer (tramp-get-debug-buffer vec)
+      (goto-char (point-max))
+      (unless (bolp)
+       (insert "\n"))
+      ;; Timestamp
+      (insert (format-time-string "%T "))
+      ;; Calling function
+      (let ((btn 1) btf fn)
+       (while (not fn)
+         (setq btf (nth 1 (backtrace-frame btn)))
+         (if (not btf)
+             (setq fn "")
+           (when (symbolp btf)
+             (setq fn (symbol-name btf))
+             (unless (and (string-match "^tramp" fn)
+                          (not (string-match
+                                "^tramp\\(-debug\\)?\\(-message\\|-error\\)$"
+                                fn)))
+               (setq fn nil)))
+           (setq btn (1+ btn))))
+       ;; The following code inserts filename and line number.
+       ;; Should be deactivated by default, because it is time
+       ;; consuming.
+;      (let ((ffn (find-function-noselect (intern fn))))
+;        (insert
+;         (format
+;          "%s:%d: "
+;          (file-name-nondirectory (buffer-file-name (car ffn)))
+;          (with-current-buffer (car ffn)
+;            (1+ (count-lines (point-min) (cdr ffn)))))))
+       (insert (format "%s " fn)))
+      ;; The message
+      (insert (apply 'format fmt-string args)))))
+
+(defsubst tramp-message (vec-or-proc level fmt-string &rest args)
   "Emit a message depending on verbosity level.
-First arg LEVEL says to be quiet if `tramp-verbose' is less than LEVEL.  The
-message is emitted only if `tramp-verbose' is greater than or equal to LEVEL.
-Calls function `message' with FMT-STRING as control string and the remaining
-ARGS to actually emit the message (if applicable).
-
-This function expects to be called from the tramp buffer only!"
-  (when (<= level tramp-verbose)
-    (apply #'message (concat "tramp: " fmt-string) args)
-    (when tramp-debug-buffer
-      (save-excursion
-        (set-buffer
-         (tramp-get-debug-buffer
-         tramp-current-multi-method tramp-current-method
-         tramp-current-user tramp-current-host))
-        (goto-char (point-max))
-       (unless (bolp)
-         (insert "\n"))
-       (tramp-insert-with-face
-         'italic
-         (concat "# " (apply #'format fmt-string args) "\n"))))))
-
-(defun tramp-message-for-buffer
-  (multi-method method user host level fmt-string &rest args)
-  "Like `tramp-message' but temporarily switches to the tramp buffer.
-First three args METHOD, USER, and HOST identify the tramp buffer to use,
-remaining args passed to `tramp-message'."
-  (save-excursion
-    (set-buffer (tramp-get-buffer multi-method method user host))
-    (apply 'tramp-message level fmt-string args)))
+VEC-OR-PROC identifies the tramp buffer to use.  It can be either a
+vector or a process.  LEVEL says to be quiet if `tramp-verbose' is
+less than LEVEL.  The message is emitted only if `tramp-verbose' is
+greater than or equal to LEVEL.
+
+The message is also logged into the debug buffer when `tramp-verbose'
+is greater than or equal 4.
+
+Calls functions `message' and `tramp-debug-message' with FMT-STRING as
+control string and the remaining ARGS to actually emit the message (if
+applicable)."
+  (condition-case nil
+      (when (<= level tramp-verbose)
+       ;; Match data must be preserved!
+       (save-match-data
+         ;; Display only when there is a minimum level.
+         (when (<= level 3)
+           (apply 'message
+                  (concat
+                   (cond
+                    ((= level 0) "")
+                    ((= level 1) "")
+                    ((= level 2) "Warning: ")
+                    (t           "Tramp: "))
+                   fmt-string)
+                  args))
+         ;; Log only when there is a minimum level.
+         (when (>= tramp-verbose 4)
+           (when (and vec-or-proc
+                      (processp vec-or-proc)
+                      (buffer-name (process-buffer vec-or-proc)))
+             (with-current-buffer (process-buffer vec-or-proc)
+               ;; Translate proc to vec.
+               (setq vec-or-proc (tramp-dissect-file-name default-directory))))
+           (when (and vec-or-proc (vectorp vec-or-proc))
+             (apply 'tramp-debug-message
+                    vec-or-proc
+                    (concat (format "(%d) # " level) fmt-string)
+                    args)))))
+    ;; Suppress all errors.
+    (error nil)))
+
+(defsubst tramp-error (vec-or-proc signal fmt-string &rest args)
+  "Emit an error.
+VEC-OR-PROC identifies the connection to use, SIGNAL is the
+signal identifier to be raised, remaining args passed to
+`tramp-message'.  Finally, signal SIGNAL is raised."
+  (tramp-message
+   vec-or-proc 1 "%s"
+   (error-message-string
+    (list signal (get signal 'error-message) (apply 'format fmt-string args))))
+  (signal signal (list (apply 'format fmt-string args))))
+
+(defsubst tramp-error-with-buffer
+  (buffer vec-or-proc signal fmt-string &rest args)
+  "Emit an error, and show BUFFER.
+If BUFFER is nil, show the connection buffer.  Wait for 30\", or until
+an input event arrives.  The other arguments are passed to `tramp-error'."
+  (save-window-excursion
+    (unwind-protect
+       (apply 'tramp-error vec-or-proc signal fmt-string args)
+      (when (and vec-or-proc (not (zerop tramp-verbose)))
+       (let ((enable-recursive-minibuffers t))
+         (pop-to-buffer
+          (or (and (bufferp buffer) buffer)
+              (and (processp vec-or-proc) (process-buffer vec-or-proc))
+              (tramp-get-buffer vec-or-proc)))
+         (sit-for 30))))))
 
 (defsubst tramp-line-end-position nil
   "Return point at end of line.
@@ -2054,18 +1949,15 @@ First arg FILENAME is evaluated and dissected into its components.
 Second arg VAR is a symbol.  It is used as a variable name to hold
 the filename structure.  It is also used as a prefix for the variables
 holding the components.  For example, if VAR is the symbol `foo', then
-`foo' will be bound to the whole structure, `foo-multi-method' will
-be bound to the multi-method component, and so on for `foo-method',
-`foo-user', `foo-host', `foo-localname'.
+`foo' will be bound to the whole structure, `foo-method' will be bound to
+the method component, and so on for `foo-user', `foo-host', `foo-localname'.
 
 Remaining args are Lisp expressions to be evaluated (inside an implicit
 `progn').
 
-If VAR is nil, then we bind `v' to the structure and `multi-method',
-`method', `user', `host', `localname' to the components."
+If VAR is nil, then we bind `v' to the structure and `method', `user',
+`host', `localname' to the components."
   `(let* ((,(or var 'v) (tramp-dissect-file-name ,filename))
-         (,(if var (intern (concat (symbol-name var) "-multi-method")) 'multi-method)
-          (tramp-file-name-multi-method ,(or var 'v)))
          (,(if var (intern (concat (symbol-name var) "-method")) 'method)
           (tramp-file-name-method ,(or var 'v)))
          (,(if var (intern (concat (symbol-name var) "-user")) 'user)
@@ -2077,15 +1969,45 @@ If VAR is nil, then we bind `v' to the structure and `multi-method',
      ,@body))
 
 (put 'with-parsed-tramp-file-name 'lisp-indent-function 2)
+(put 'with-parsed-tramp-file-name 'edebug-form-spec '(form symbolp body))
 ;; Enable debugging.
-(eval-and-compile
-  (when (featurep 'edebug)
-    (def-edebug-spec with-parsed-tramp-file-name (form symbolp body))))
+;(eval-and-compile
+;  (when (featurep 'edebug)
+;    (def-edebug-spec with-parsed-tramp-file-name (form symbolp body))))
 ;; Highlight as keyword.
 (when (functionp 'font-lock-add-keywords)
   (funcall 'font-lock-add-keywords
           'emacs-lisp-mode '("\\<with-parsed-tramp-file-name\\>")))
 
+(defmacro with-file-property (vec file property &rest body)
+  "Check in Tramp cache for PROPERTY, otherwise execute BODY and set cache.
+FILE must be a local file name on a connection identified via VEC."
+  `(if (file-name-absolute-p ,file)
+      (let ((value (tramp-get-file-property ,vec ,file ,property 'undef)))
+       (when (eq value 'undef)
+         ;; We cannot pass @body as parameter to
+         ;; `tramp-set-file-property' because it mangles our
+         ;; debug messages.
+         (setq value (progn ,@body))
+         (tramp-set-file-property ,vec ,file ,property value))
+       value)
+     ,@body))
+(put 'with-file-property 'lisp-indent-function 3)
+(put 'with-file-property 'edebug-form-spec t)
+
+(defmacro with-connection-property (key property &rest body)
+  "Checks in Tramp for property PROPERTY, otherwise executes BODY and set."
+  `(let ((value (tramp-get-connection-property ,key ,property 'undef)))
+    (when (eq value 'undef)
+      ;; We cannot pass ,@body as parameter to
+      ;; `tramp-set-connection-property' because it mangles our debug
+      ;; messages.
+      (setq value (progn ,@body))
+      (tramp-set-connection-property ,key ,property value))
+    value))
+(put 'with-connection-property 'lisp-indent-function 2)
+(put 'with-connection-property 'edebug-form-spec t)
+
 (defmacro tramp-let-maybe (variable value &rest body)
   "Let-bind VARIABLE to VALUE in BODY, but only if VARIABLE is not obsolete.
 BODY is executed whether or not the variable is obsolete.
@@ -2122,12 +2044,17 @@ Example:
                  tramp-completion-function-alist))
 
     (while v
-      ;; Remove double entries
+      ;; Remove double entries.
       (when (member (car v) (cdr v))
        (setcdr v (delete (car v) (cdr v))))
-      ;; Check for function and file
+      ;; Check for function and file or registry key.
       (unless (and (functionp (nth 0 (car v)))
-                  (file-exists-p (nth 1 (car v))))
+                  (if (string-match "^HKEY_CURRENT_USER" (nth 1 (car v)))
+                      ;; Windows registry.
+                      (and (memq system-type '(cygwin windows-nt))
+                           (zerop (call-process "reg" nil nil nil "query" (nth 1 (car v)))))
+                    ;; Configuration file.
+                    (file-exists-p (nth 1 (car v)))))
        (setq r (delete (car v) r)))
       (setq v (cdr v)))
 
@@ -2136,15 +2063,19 @@ Example:
                   (cons method r)))))
 
 (defun tramp-get-completion-function (method)
-  "Returns list of completion functions for METHOD.
+  "Returns list of completion functions for METHOD.
 For definition of that list see `tramp-set-completion-function'."
-  (cdr (assoc method tramp-completion-function-alist)))
+  (cons
+   ;; Hosts visited once shall be remembered.
+   `(tramp-parse-connection-properties ,method)
+   ;; The method related defaults.
+   (cdr (assoc method tramp-completion-function-alist))))
 
 ;;; File Name Handler Functions:
 
 (defun tramp-handle-make-symbolic-link
   (filename linkname &optional ok-if-already-exists)
-  "Like `make-symbolic-link' for tramp files.
+  "Like `make-symbolic-link' for Tramp files.
 If LINKNAME is a non-Tramp file, it is used verbatim as the target of
 the symlink.  If LINKNAME is a Tramp file, only the localname component is
 used as the target of the symlink.
@@ -2154,12 +2085,12 @@ it is expanded first, before the localname component is taken.  Note that
 this can give surprising results if the user/host for the source and
 target of the symlink differ."
   (with-parsed-tramp-file-name linkname l
-    (let ((ln (tramp-get-remote-ln l-multi-method l-method l-user l-host))
+    (let ((ln (tramp-get-remote-ln l))
          (cwd (file-name-directory l-localname)))
       (unless ln
-       (signal 'file-error
-               (list "Making a symbolic link."
-                     "ln(1) does not exist on the remote host.")))
+       (tramp-error
+        l 'file-error
+        "Making a symbolic link. ln(1) does not exist on the remote host."))
 
       ;; Do the 'confirm if exists' thing.
       (when (file-exists-p linkname)
@@ -2170,7 +2101,8 @@ target of the symlink differ."
                           (format
                            "File %s already exists; make it a link anyway? "
                            l-localname)))))
-           (signal 'file-already-exists (list "File already exists" l-localname))
+           (tramp-error
+            l 'file-already-exists "File %s already exists" l-localname)
          (delete-file linkname)))
 
       ;; If FILENAME is a Tramp name, use just the localname component.
@@ -2184,19 +2116,12 @@ target of the symlink differ."
       ;; that FILENAME belongs to.
       (zerop
        (tramp-send-command-and-check
-       l-multi-method l-method l-user l-host
-       (format "cd %s && %s -sf %s %s"
-               cwd ln
-               filename
-               l-localname)
-       t)))))
+       l (format "cd %s && %s -sf %s %s" cwd ln filename l-localname) t)))))
 
 
 (defun tramp-handle-load (file &optional noerror nomessage nosuffix must-suffix)
-  "Like `load' for tramp files.  Not implemented!"
-  (unless (file-name-absolute-p file)
-    (error "Tramp cannot `load' files without absolute file name"))
-  (with-parsed-tramp-file-name file nil
+  "Like `load' for Tramp files."
+  (with-parsed-tramp-file-name (expand-file-name file) nil
     (unless nosuffix
       (cond ((file-exists-p (concat file ".elc"))
             (setq file (concat file ".elc")))
@@ -2207,138 +2132,138 @@ target of the symlink differ."
       ;; Included for safety's sake.
       (unless (or (file-name-directory file)
                  (string-match "\\.elc?\\'" file))
-       (error "File `%s' does not include a `.el' or `.elc' suffix"
-              file)))
+       (tramp-error
+        v 'file-error
+        "File `%s' does not include a `.el' or `.elc' suffix" file)))
     (unless noerror
       (when (not (file-exists-p file))
-       (error "Cannot load nonexistent file `%s'" file)))
+       (tramp-error v 'file-error "Cannot load nonexistent file `%s'" file)))
     (if (not (file-exists-p file))
        nil
-      (unless nomessage
-       (message "Loading %s..." file))
+      (unless nomessage (tramp-message v 0 "Loading %s..." file))
       (let ((local-copy (file-local-copy file)))
        ;; MUST-SUFFIX doesn't exist on XEmacs, so let it default to nil.
        (load local-copy noerror t t)
        (delete-file local-copy))
-      (unless nomessage
-       (message "Loading %s...done" file))
+      (unless nomessage (tramp-message v 0 "Loading %s...done" file))
       t)))
 
 ;; Localname manipulation functions that grok TRAMP localnames...
 (defun tramp-handle-file-name-directory (file)
-  "Like `file-name-directory' but aware of TRAMP files."
+  "Like `file-name-directory' but aware of Tramp files."
   ;; Everything except the last filename thing is the directory.
   (with-parsed-tramp-file-name file nil
     ;; Run the command on the localname portion only.
     (tramp-make-tramp-file-name
-     multi-method method user host (file-name-directory (or localname "")))))
+     method user host (file-name-directory (or localname "")))))
 
 (defun tramp-handle-file-name-nondirectory (file)
-  "Like `file-name-nondirectory' but aware of TRAMP files."
+  "Like `file-name-nondirectory' but aware of Tramp files."
   (with-parsed-tramp-file-name file nil
     (file-name-nondirectory localname)))
 
 (defun tramp-handle-file-truename (filename &optional counter prev-dirs)
-  "Like `file-truename' for tramp files."
+  "Like `file-truename' for Tramp files."
   (with-parsed-tramp-file-name (expand-file-name filename) nil
-    (let* ((steps        (tramp-split-string localname "/"))
-          (localnamedir (tramp-let-maybe directory-sep-char ?/ ;for XEmacs
-                          (file-name-as-directory localname)))
-          (is-dir (string= localname localnamedir))
-          (thisstep nil)
-          (numchase 0)
-          ;; Don't make the following value larger than necessary.
-          ;; People expect an error message in a timely fashion when
-          ;; something is wrong; otherwise they might think that Emacs
-          ;; is hung.  Of course, correctness has to come first.
-          (numchase-limit 20)
-          (result nil)                 ;result steps in reverse order
-          symlink-target)
-      (tramp-message-for-buffer
-       multi-method method user host
-       10 "Finding true name for `%s'" filename)
-      (while (and steps (< numchase numchase-limit))
-       (setq thisstep (pop steps))
-       (tramp-message-for-buffer
-        multi-method method user host
-        10 "Check %s"
-        (mapconcat 'identity
-                   (append '("") (reverse result) (list thisstep))
-                   "/"))
-       (setq symlink-target
-             (nth 0 (file-attributes
-                     (tramp-make-tramp-file-name
-                      multi-method method user host
-                      (mapconcat 'identity
-                                 (append '("")
-                                         (reverse result)
-                                         (list thisstep))
-                                 "/")))))
-       (cond ((string= "." thisstep)
-              (tramp-message-for-buffer multi-method method user host
-                                        10 "Ignoring step `.'"))
-             ((string= ".." thisstep)
-              (tramp-message-for-buffer multi-method method user host
-                                        10 "Processing step `..'")
-              (pop result))
-             ((stringp symlink-target)
-              ;; It's a symlink, follow it.
-              (tramp-message-for-buffer
-               multi-method method user host
-               10 "Follow symlink to %s" symlink-target)
-              (setq numchase (1+ numchase))
-              (when (file-name-absolute-p symlink-target)
-                (setq result nil))
-              ;; If the symlink was absolute, we'll get a string like
-              ;; "/user@host:/some/target"; extract the
-              ;; "/some/target" part from it.
-              (when (tramp-tramp-file-p symlink-target)
-                (with-parsed-tramp-file-name symlink-target sym
-                  (unless (equal (list multi-method method user host)
-                                 (list sym-multi-method sym-method
-                                       sym-user sym-host))
-                    (error "Symlink target `%s' on wrong host"
-                           symlink-target))
-                  (setq symlink-target localname)))
-              (setq steps
-                    (append (tramp-split-string symlink-target "/") steps)))
-             (t
-              ;; It's a file.
-              (setq result (cons thisstep result)))))
-      (when (>= numchase numchase-limit)
-       (error "Maximum number (%d) of symlinks exceeded" numchase-limit))
-      (setq result (reverse result))
-      ;; Combine list to form string.
-      (setq result
-           (if result
-               (mapconcat 'identity (cons "" result) "/")
-             "/"))
-      (when (and is-dir (or (string= "" result)
-                           (not (string= (substring result -1) "/"))))
-       (setq result (concat result "/")))
-      (tramp-message-for-buffer
-       multi-method method user host
-       10 "True name of `%s' is `%s'" filename result)
-      (tramp-make-tramp-file-name
-       multi-method method user host result))))
+    (with-file-property v localname "file-truename"
+      (let* ((steps        (tramp-split-string localname "/"))
+            (localnamedir (tramp-let-maybe directory-sep-char ?/ ;for XEmacs
+                            (file-name-as-directory localname)))
+            (is-dir (string= localname localnamedir))
+            (thisstep nil)
+            (numchase 0)
+            ;; Don't make the following value larger than necessary.
+            ;; People expect an error message in a timely fashion when
+            ;; something is wrong; otherwise they might think that Emacs
+            ;; is hung.  Of course, correctness has to come first.
+            (numchase-limit 20)
+            (result nil)                       ;result steps in reverse order
+            symlink-target)
+       (tramp-message v 4 "Finding true name for `%s'" filename)
+       (while (and steps (< numchase numchase-limit))
+         (setq thisstep (pop steps))
+         (tramp-message
+          v 5 "Check %s"
+          (mapconcat 'identity
+                     (append '("") (reverse result) (list thisstep))
+                     "/"))
+         (setq symlink-target
+               (nth 0 (file-attributes
+                       (tramp-make-tramp-file-name
+                        method user host
+                        (mapconcat 'identity
+                                   (append '("")
+                                           (reverse result)
+                                           (list thisstep))
+                                   "/")))))
+         (cond ((string= "." thisstep)
+                (tramp-message v 5 "Ignoring step `.'"))
+               ((string= ".." thisstep)
+                (tramp-message v 5 "Processing step `..'")
+                (pop result))
+               ((stringp symlink-target)
+                ;; It's a symlink, follow it.
+                (tramp-message v 5 "Follow symlink to %s" symlink-target)
+                (setq numchase (1+ numchase))
+                (when (file-name-absolute-p symlink-target)
+                  (setq result nil))
+                ;; If the symlink was absolute, we'll get a string like
+                ;; "/user@host:/some/target"; extract the
+                ;; "/some/target" part from it.
+                (when (tramp-tramp-file-p symlink-target)
+                  (unless (tramp-equal-remote filename symlink-target)
+                    (tramp-error
+                     v 'file-error
+                     "Symlink target `%s' on wrong host" symlink-target))
+                  (setq symlink-target localname))
+                (setq steps
+                      (append (tramp-split-string symlink-target "/")
+                              steps)))
+               (t
+                ;; It's a file.
+                (setq result (cons thisstep result)))))
+       (when (>= numchase numchase-limit)
+         (tramp-error
+          v 'file-error
+          "Maximum number (%d) of symlinks exceeded" numchase-limit))
+       (setq result (reverse result))
+       ;; Combine list to form string.
+       (setq result
+             (if result
+                 (mapconcat 'identity (cons "" result) "/")
+               "/"))
+       (when (and is-dir (or (string= "" result)
+                             (not (string= (substring result -1) "/"))))
+         (setq result (concat result "/")))
+       (tramp-message v 4 "True name of `%s' is `%s'" filename result)
+       (tramp-make-tramp-file-name method user host result)))))
 
 ;; Basic functions.
 
 (defun tramp-handle-file-exists-p (filename)
-  "Like `file-exists-p' for tramp files."
+  "Like `file-exists-p' for Tramp files."
   (with-parsed-tramp-file-name filename nil
-    (save-excursion
+    (with-file-property v localname "file-exists-p"
       (zerop (tramp-send-command-and-check
-             multi-method method user host
+             v
              (format
-              (tramp-get-file-exists-command multi-method method user host)
+              "%s %s"
+              (tramp-get-file-exists-command v)
               (tramp-shell-quote-argument localname)))))))
 
+;; Inodes don't exist for some file systems.  Therefore we must
+;; generate virtual ones.  Used in `find-buffer-visiting'.  The method
+;; applied might be not so efficient (Ange-FTP uses hashes). But
+;; performance isn't the major issue given that file transfer will
+;; take time.
+(defvar tramp-inodes nil
+  "Keeps virtual inodes numbers.")
+
 ;; Devices must distinguish physical file systems.  The device numbers
 ;; provided by "lstat" aren't unique, because we operate on different hosts.
 ;; So we use virtual device numbers, generated by Tramp.  Both Ange-FTP and
 ;; EFS use device number "-1".  In order to be different, we use device number
-;; (-1 x), whereby "x" is unique for a given (multi-method method user host).
+;; (-1 x), whereby "x" is unique for a given (method user host).
 (defvar tramp-devices nil
   "Keeps virtual device numbers.")
 
@@ -2346,123 +2271,133 @@ target of the symlink differ."
 ;;      when something goes wrong.
 ;; Daniel Pittman <daniel@danann.net>
 (defun tramp-handle-file-attributes (filename &optional id-format)
-  "Like `file-attributes' for tramp files."
-  (when (file-exists-p filename)
-    ;; file exists, find out stuff
-    (unless id-format (setq id-format 'integer))
-    (with-parsed-tramp-file-name filename nil
-      (save-excursion
-        (tramp-convert-file-attributes
-         multi-method method user host
-         (if (tramp-get-remote-perl multi-method method user host)
-             (tramp-handle-file-attributes-with-perl multi-method method user host
-                                                     localname id-format)
-           (tramp-handle-file-attributes-with-ls multi-method method user host
-                                                 localname id-format)))))))
-
-(defun tramp-handle-file-attributes-with-ls
-  (multi-method method user host localname &optional id-format)
-  "Implement `file-attributes' for tramp files using the ls(1) command."
+  "Like `file-attributes' for Tramp files."
+  (unless id-format (setq id-format 'integer))
+  (with-parsed-tramp-file-name (expand-file-name filename) nil
+    (with-file-property v localname (format "file-attributes-%s" id-format)
+      (when (file-exists-p filename)
+       ;; file exists, find out stuff
+       (save-excursion
+         (tramp-convert-file-attributes
+          v
+          (if (tramp-get-remote-stat v)
+              (tramp-handle-file-attributes-with-stat v localname id-format)
+            (if (tramp-get-remote-perl v)
+                (tramp-handle-file-attributes-with-perl v localname id-format)
+              (tramp-handle-file-attributes-with-ls
+               v localname id-format)))))))))
+
+(defun tramp-handle-file-attributes-with-ls (vec localname &optional id-format)
+  "Implement `file-attributes' for Tramp files using the ls(1) command."
   (let (symlinkp dirp
                 res-inode res-filemodes res-numlinks
                 res-uid res-gid res-size res-symlink-target)
-    (tramp-message-for-buffer multi-method method user host 10
-                             "file attributes with ls: %s"
-                             (tramp-make-tramp-file-name
-                              multi-method method user host localname))
+    (tramp-message vec 5 "file attributes with ls: %s" localname)
     (tramp-send-command
-     multi-method method user host
+     vec
      (format "%s %s %s"
-            (tramp-get-ls-command multi-method method user host)
+            (tramp-get-ls-command vec)
             (if (eq id-format 'integer) "-ildn" "-ild")
             (tramp-shell-quote-argument localname)))
-    (tramp-wait-for-output)
     ;; parse `ls -l' output ...
-    ;; ... inode
-    (setq res-inode
-         (condition-case err
-             (read (current-buffer))
-           (invalid-read-syntax
-            (when (and (equal (cadr err)
-                              "Integer constant overflow in reader")
-                       (string-match
-                        "^[0-9]+\\([0-9][0-9][0-9][0-9][0-9]\\)\\'"
-                        (car (cddr err))))
-              (let* ((big (read (substring (car (cddr err)) 0
-                                           (match-beginning 1))))
-                     (small (read (match-string 1 (car (cddr err)))))
-                     (twiddle (/ small 65536)))
-                (cons (+ big twiddle)
-                      (- small (* twiddle 65536))))))))
-    ;; ... file mode flags
-    (setq res-filemodes (symbol-name (read (current-buffer))))
-    ;; ... number links
-    (setq res-numlinks (read (current-buffer)))
-    ;; ... uid and gid
-    (setq res-uid (read (current-buffer)))
-    (setq res-gid (read (current-buffer)))
-    (when (eq id-format 'integer)
-      (unless (numberp res-uid) (setq res-uid -1))
-      (unless (numberp res-gid) (setq res-gid -1)))
-    ;; ... size
-    (setq res-size (read (current-buffer)))
-    ;; From the file modes, figure out other stuff.
-    (setq symlinkp (eq ?l (aref res-filemodes 0)))
-    (setq dirp (eq ?d (aref res-filemodes 0)))
-    ;; if symlink, find out file name pointed to
-    (when symlinkp
-      (search-forward "-> ")
-      (setq res-symlink-target
-           (buffer-substring (point)
-                             (tramp-line-end-position))))
-    ;; return data gathered
-    (list
-     ;; 0. t for directory, string (name linked to) for symbolic
-     ;; link, or nil.
-     (or dirp res-symlink-target nil)
-     ;; 1. Number of links to file.
-     res-numlinks
-     ;; 2. File uid.
-     res-uid
-     ;; 3. File gid.
-     res-gid
-     ;; 4. Last access time, as a list of two integers. First
-     ;; integer has high-order 16 bits of time, second has low 16
-     ;; bits.
-     ;; 5. Last modification time, likewise.
-     ;; 6. Last status change time, likewise.
-     '(0 0) '(0 0) '(0 0)              ;CCC how to find out?
-     ;; 7. Size in bytes (-1, if number is out of range).
-     res-size
-     ;; 8. File modes, as a string of ten letters or dashes as in ls -l.
-     res-filemodes
-     ;; 9. t if file's gid would change if file were deleted and
-     ;; recreated.  Will be set in `tramp-convert-file-attributes'
-     t
-     ;; 10. inode number.
-     res-inode
-     ;; 11. Device number.  Will be replaced by a virtual device number.
-     -1
-     )))
+    (with-current-buffer (tramp-get-buffer vec)
+      (goto-char (point-min))
+      ;; ... inode
+      (setq res-inode
+           (condition-case err
+               (read (current-buffer))
+             (invalid-read-syntax
+              (when (and (equal (cadr err)
+                                "Integer constant overflow in reader")
+                         (string-match
+                          "^[0-9]+\\([0-9][0-9][0-9][0-9][0-9]\\)\\'"
+                          (car (cddr err))))
+                (let* ((big (read (substring (car (cddr err)) 0
+                                             (match-beginning 1))))
+                       (small (read (match-string 1 (car (cddr err)))))
+                       (twiddle (/ small 65536)))
+                  (cons (+ big twiddle)
+                        (- small (* twiddle 65536))))))))
+      ;; ... file mode flags
+      (setq res-filemodes (symbol-name (read (current-buffer))))
+      ;; ... number links
+      (setq res-numlinks (read (current-buffer)))
+      ;; ... uid and gid
+      (setq res-uid (read (current-buffer)))
+      (setq res-gid (read (current-buffer)))
+      (if (eq id-format 'integer)
+         (progn
+           (unless (numberp res-uid) (setq res-uid -1))
+           (unless (numberp res-gid) (setq res-gid -1)))
+       (progn
+         (unless (stringp res-uid) (setq res-uid (symbol-name res-uid)))
+         (unless (stringp res-gid) (setq res-gid (symbol-name res-gid)))))
+      ;; ... size
+      (setq res-size (read (current-buffer)))
+      ;; From the file modes, figure out other stuff.
+      (setq symlinkp (eq ?l (aref res-filemodes 0)))
+      (setq dirp (eq ?d (aref res-filemodes 0)))
+      ;; if symlink, find out file name pointed to
+      (when symlinkp
+       (search-forward "-> ")
+       (setq res-symlink-target
+             (buffer-substring (point) (tramp-line-end-position))))
+      ;; return data gathered
+      (list
+       ;; 0. t for directory, string (name linked to) for symbolic
+       ;; link, or nil.
+       (or dirp res-symlink-target)
+       ;; 1. Number of links to file.
+       res-numlinks
+       ;; 2. File uid.
+       res-uid
+       ;; 3. File gid.
+       res-gid
+       ;; 4. Last access time, as a list of two integers. First
+       ;; integer has high-order 16 bits of time, second has low 16
+       ;; bits.
+       ;; 5. Last modification time, likewise.
+       ;; 6. Last status change time, likewise.
+       '(0 0) '(0 0) '(0 0)            ;CCC how to find out?
+       ;; 7. Size in bytes (-1, if number is out of range).
+       res-size
+       ;; 8. File modes, as a string of ten letters or dashes as in ls -l.
+       res-filemodes
+       ;; 9. t iff file's gid would change if file were deleted and
+       ;; recreated.  Will be set in `tramp-convert-file-attributes'
+       t
+       ;; 10. inode number.
+       res-inode
+       ;; 11. Device number.  Will be replaced by a virtual device number.
+       -1
+       ))))
 
 (defun tramp-handle-file-attributes-with-perl
-  (multi-method method user host localname &optional id-format)
-  "Implement `file-attributes' for tramp files using a Perl script."
-  (tramp-message-for-buffer multi-method method user host 10
-                           "file attributes with perl: %s"
-                           (tramp-make-tramp-file-name
-                            multi-method method user host localname))
-  (tramp-maybe-send-perl-script multi-method method user host
-                               tramp-perl-file-attributes
-                                "tramp_file_attributes")
-  (tramp-send-command multi-method method user host
-                      (format "tramp_file_attributes %s %s"
-                              (tramp-shell-quote-argument localname) id-format))
-  (tramp-wait-for-output)
-  (read (current-buffer)))
+  (vec localname &optional id-format)
+  "Implement `file-attributes' for Tramp files using a Perl script."
+  (tramp-message vec 5 "file attributes with perl: %s" localname)
+  (tramp-maybe-send-script
+   vec tramp-perl-file-attributes "tramp_perl_file_attributes")
+  (tramp-send-command-and-read
+   vec
+   (format "tramp_perl_file_attributes %s %s"
+          (tramp-shell-quote-argument localname) id-format)))
+
+(defun tramp-handle-file-attributes-with-stat
+  (vec localname &optional id-format)
+  "Implement `file-attributes' for Tramp files using stat(1) command."
+  (tramp-message vec 5 "file attributes with stat: %s" localname)
+  (tramp-send-command-and-read
+   vec
+   (format
+    "%s -c '((\"%%N\") %%h %s %s %%X.0 %%Y.0 %%Z.0 %%s.0 \"%%A\" t %%i.0 -1)' %s"
+    (tramp-get-remote-stat vec)
+    (if (eq id-format 'integer) "%u" "\"%U\"")
+    (if (eq id-format 'integer) "%g" "\"%G\"")
+    (tramp-shell-quote-argument localname))))
 
 (defun tramp-handle-set-visited-file-modtime (&optional time-list)
-  "Like `set-visited-file-modtime' for tramp files."
+  "Like `set-visited-file-modtime' for Tramp files."
   (unless (buffer-file-name)
     (error "Can't set-visited-file-modtime: buffer `%s' not visiting a file"
           (buffer-name)))
@@ -2480,16 +2415,16 @@ target of the symlink differ."
          ;; `tramp-handle-file-attributes-with-ls'.
          (if (not (equal modtime '(0 0)))
              (tramp-run-real-handler 'set-visited-file-modtime (list modtime))
-           (save-excursion
+           (progn
              (tramp-send-command
-              multi-method method user host
+              v
               (format "%s -ild %s"
-                      (tramp-get-ls-command multi-method method user host)
+                      (tramp-get-ls-command v)
                       (tramp-shell-quote-argument localname)))
-             (tramp-wait-for-output)
              (setq attr (buffer-substring (point)
                                           (progn (end-of-line) (point)))))
-           (setq tramp-buffer-file-attributes attr))
+           (tramp-set-file-property
+            v localname "visited-file-modtime-ild" attr))
          (when (boundp 'last-coding-system-used)
            (set 'last-coding-system-used coding-system-used))
          nil)))))
@@ -2499,7 +2434,7 @@ target of the symlink differ."
 ;; This function makes the same assumption as
 ;; `tramp-handle-set-visited-file-modtime'.
 (defun tramp-handle-verify-visited-file-modtime (buf)
-  "Like `verify-visited-file-modtime' for tramp files.
+  "Like `verify-visited-file-modtime' for Tramp files.
 At the time `verify-visited-file-modtime' calls this function, we
 already know that the buffer is visiting a file and that
 `visited-file-modtime' does not return 0.  Do not call this
@@ -2513,6 +2448,7 @@ of."
        t
       (let ((f (buffer-file-name)))
        (with-parsed-tramp-file-name f nil
+         (tramp-flush-file-property v localname)
          (let* ((attr (file-attributes f))
                 (modtime (nth 5 attr))
                 (mt (visited-file-modtime)))
@@ -2531,53 +2467,82 @@ of."
                 2))
             ;; modtime has the don't know value.
             (attr
-             (save-excursion
-               (tramp-send-command
-                multi-method method user host
-                (format "%s -ild %s"
-                        (tramp-get-ls-command multi-method method user host)
-                        (tramp-shell-quote-argument localname)))
-               (tramp-wait-for-output)
+             (tramp-send-command
+              v
+              (format "%s -ild %s"
+                      (tramp-get-ls-command v)
+                      (tramp-shell-quote-argument localname)))
+             (with-current-buffer (tramp-get-buffer v)
                (setq attr (buffer-substring
                            (point) (progn (end-of-line) (point)))))
-             (equal tramp-buffer-file-attributes attr))
+             (equal
+              attr
+              (tramp-get-file-property
+               v localname "visited-file-modtime-ild" "")))
             ;; If file does not exist, say it is not modified
             ;; if and only if that agrees with the buffer's record.
             (t (equal mt '(-1 65535))))))))))
 
 (defun tramp-handle-set-file-modes (filename mode)
-  "Like `set-file-modes' for tramp files."
+  "Like `set-file-modes' for Tramp files."
   (with-parsed-tramp-file-name filename nil
-    (save-excursion
-      (unless (zerop (tramp-send-command-and-check
-                     multi-method method user host
-                     (format "chmod %s %s"
-                             (tramp-decimal-to-octal mode)
-                             (tramp-shell-quote-argument localname))))
-       (signal 'file-error
-               (list "Doing chmod"
-                     ;; FIXME: extract the proper text from chmod's stderr.
-                     "error while changing file's mode"
-                     filename))))))
+    (tramp-flush-file-property v localname)
+    (unless (zerop (tramp-send-command-and-check
+                   v
+                   (format "chmod %s %s"
+                           (tramp-decimal-to-octal mode)
+                           (tramp-shell-quote-argument localname))))
+      ;; FIXME: extract the proper text from chmod's stderr.
+      (tramp-error
+       v 'file-error "Error while changing file's mode %s" filename))))
+
+(defun tramp-handle-set-file-times (filename &optional time)
+  "Like `set-file-times' for Tramp files."
+  (zerop
+   (if (file-remote-p filename)
+       (with-parsed-tramp-file-name filename nil
+        (let ((time (if (or (null time) (equal time '(0 0)))
+                        (current-time)
+                      time))
+              (utc
+               ;; With GNU Emacs, `format-time-string' has an
+               ;; optional parameter UNIVERSAL.  This is preferred,
+               ;; because we could handle the case when the remote
+               ;; host is located in a different time zone as the
+               ;; local host.
+               (and (functionp 'subr-arity)
+                    (subrp (symbol-function 'format-time-string))
+                    (= 3 (cdr (funcall (symbol-function 'subr-arity)
+                                       (symbol-function
+                                        'format-time-string)))))))
+          (tramp-send-command-and-check
+           v (format "%s touch -t %s %s"
+                     (if utc "TZ=UTC; export TZ;" "")
+                     (if utc
+                         (format-time-string "%Y%m%d%H%M.%S" time t)
+                       (format-time-string "%Y%m%d%H%M.%S" time))
+                     (tramp-shell-quote-argument localname)))))
+     ;; We handle also the local part, because in older Emacsen,
+     ;; without `set-file-times', this function is an alias for this.
+     ;; We are local, so we don't need the UTC settings.
+     (call-process
+      "touch" nil nil nil "-t"
+      (format-time-string "%Y%m%d%H%M.%S" time)
+      (tramp-shell-quote-argument filename)))))
 
 ;; Simple functions using the `test' command.
 
 (defun tramp-handle-file-executable-p (filename)
-  "Like `file-executable-p' for tramp files."
+  "Like `file-executable-p' for Tramp files."
   (with-parsed-tramp-file-name filename nil
-    (zerop (tramp-run-test "-x" filename))))
+    (with-file-property v localname "file-executable-p"
+      (zerop (tramp-run-test "-x" filename)))))
 
 (defun tramp-handle-file-readable-p (filename)
-  "Like `file-readable-p' for tramp files."
-  (with-parsed-tramp-file-name filename nil
-    (zerop (tramp-run-test "-r" filename))))
-
-(defun tramp-handle-file-accessible-directory-p (filename)
-  "Like `file-accessible-directory-p' for tramp files."
+  "Like `file-readable-p' for Tramp files."
   (with-parsed-tramp-file-name filename nil
-    (and (zerop (tramp-run-test "-d" filename))
-        (zerop (tramp-run-test "-r" filename))
-        (zerop (tramp-run-test "-x" filename)))))
+    (with-file-property v localname "file-readable-p"
+      (zerop (tramp-run-test "-r" filename)))))
 
 ;; When the remote shell is started, it looks for a shell which groks
 ;; tilde expansion.  Here, we assume that all shells which grok tilde
@@ -2585,7 +2550,7 @@ of."
 ;; newer than).  If this breaks, tell me about it and I'll try to do
 ;; something smarter about it.
 (defun tramp-handle-file-newer-than-file-p (file1 file2)
-  "Like `file-newer-than-file-p' for tramp files."
+  "Like `file-newer-than-file-p' for Tramp files."
   (cond ((not (file-exists-p file1))
          nil)
         ((not (file-exists-p file2))
@@ -2606,44 +2571,27 @@ of."
               ;; However, this only works if both files are Tramp
               ;; files and both have the same method, same user, same
               ;; host.
-              (unless (and (tramp-tramp-file-p file1)
-                           (tramp-tramp-file-p file2))
-                (signal
-                 'file-error
-                 (list
-                  "Cannot check if Tramp file is newer than non-Tramp file"
-                  file1 file2)))
-              (with-parsed-tramp-file-name file1 v1
-                (with-parsed-tramp-file-name file2 v2
-                  (unless (and (equal v1-multi-method v2-multi-method)
-                               (equal v1-method v2-method)
-                               (equal v1-user v2-user)
-                               (equal v1-host v2-host))
-                    (signal 'file-error
-                            (list "Files must have same method, user, host"
-                                  file1 file2)))
-                  (unless (and (tramp-tramp-file-p file1)
-                               (tramp-tramp-file-p file2))
-                    (signal 'file-error
-                            (list "Files must be tramp files on same host"
-                                  file1 file2)))
-                  (if (tramp-get-test-groks-nt
-                       v1-multi-method v1-method v1-user v1-host)
-                      (zerop (tramp-run-test2 "test" file1 file2 "-nt"))
-                    (zerop (tramp-run-test2
-                            "tramp_test_nt" file1 file2)))))))))))
+              (unless (tramp-equal-remote file1 file2)
+                (with-parsed-tramp-file-name
+                    (if (tramp-tramp-file-p file1) file1 file2) nil
+                  (tramp-error
+                   v 'file-error
+                   "Files %s and %s must have same method, user, host"
+                   file1 file2)))
+              (with-parsed-tramp-file-name file1 nil
+                (zerop (tramp-run-test2
+                        (tramp-get-test-nt-command v) file1 file2)))))))))
 
 ;; Functions implemented using the basic functions above.
 
 (defun tramp-handle-file-modes (filename)
-  "Like `file-modes' for tramp files."
-  (with-parsed-tramp-file-name filename nil
-    (when (file-exists-p filename)
-      (tramp-mode-string-to-int
-       (nth 8 (file-attributes filename))))))
+  "Like `file-modes' for Tramp files."
+  (when (file-exists-p filename)
+    (tramp-mode-string-to-int
+     (nth 8 (file-attributes filename)))))
 
 (defun tramp-handle-file-directory-p (filename)
-  "Like `file-directory-p' for tramp files."
+  "Like `file-directory-p' for Tramp files."
   ;; Care must be taken that this function returns `t' for symlinks
   ;; pointing to directories.  Surely the most obvious implementation
   ;; would be `test -d', but that returns false for such symlinks.
@@ -2653,78 +2601,52 @@ of."
   ;;
   ;; Alternatives: `cd %s', `test -d %s'
   (with-parsed-tramp-file-name filename nil
-    (save-excursion
-      (zerop
-       (tramp-send-command-and-check
-       multi-method method user host
-       (format "test -d %s"
-               (tramp-shell-quote-argument localname))
-       t)))))                          ;run command in subshell
+    (with-file-property v localname "file-directory-p"
+      (zerop (tramp-run-test "-d" filename)))))
 
 (defun tramp-handle-file-regular-p (filename)
-  "Like `file-regular-p' for tramp files."
-  (with-parsed-tramp-file-name filename nil
-    (and (file-exists-p filename)
-        (eq ?- (aref (nth 8 (file-attributes filename)) 0)))))
+  "Like `file-regular-p' for Tramp files."
+  (and (file-exists-p filename)
+       (eq ?- (aref (nth 8 (file-attributes filename)) 0))))
 
 (defun tramp-handle-file-symlink-p (filename)
-  "Like `file-symlink-p' for tramp files."
+  "Like `file-symlink-p' for Tramp files."
   (with-parsed-tramp-file-name filename nil
     (let ((x (car (file-attributes filename))))
       (when (stringp x)
        ;; When Tramp is running on VMS, then `file-name-absolute-p'
        ;; might do weird things.
        (if (file-name-absolute-p x)
-           (tramp-make-tramp-file-name
-            multi-method method user host x)
+           (tramp-make-tramp-file-name method user host x)
          x)))))
 
 (defun tramp-handle-file-writable-p (filename)
-  "Like `file-writable-p' for tramp files."
+  "Like `file-writable-p' for Tramp files."
   (with-parsed-tramp-file-name filename nil
-    (if (file-exists-p filename)
-       ;; Existing files must be writable.
-       (zerop (tramp-run-test "-w" filename))
-      ;; If file doesn't exist, check if directory is writable.
-      (and (zerop (tramp-run-test
-                  "-d" (file-name-directory filename)))
-          (zerop (tramp-run-test
-                  "-w" (file-name-directory filename)))))))
+    (with-file-property v localname "file-writable-p"
+      (if (file-exists-p filename)
+         ;; Existing files must be writable.
+         (zerop (tramp-run-test "-w" filename))
+       ;; If file doesn't exist, check if directory is writable.
+       (and (zerop (tramp-run-test
+                    "-d" (file-name-directory filename)))
+            (zerop (tramp-run-test
+                    "-w" (file-name-directory filename))))))))
 
 (defun tramp-handle-file-ownership-preserved-p (filename)
-  "Like `file-ownership-preserved-p' for tramp files."
+  "Like `file-ownership-preserved-p' for Tramp files."
   (with-parsed-tramp-file-name filename nil
-    (let ((attributes (file-attributes filename)))
-      ;; Return t if the file doesn't exist, since it's true that no
-      ;; information would be lost by an (attempted) delete and create.
-      (or (null attributes)
-         (= (nth 2 attributes)
-            (tramp-get-remote-uid multi-method method user host))))))
+    (with-file-property v localname "file-ownership-preserved-p"
+      (let ((attributes (file-attributes filename)))
+       ;; Return t if the file doesn't exist, since it's true that no
+       ;; information would be lost by an (attempted) delete and create.
+       (or (null attributes)
+           (= (nth 2 attributes) (tramp-get-remote-uid v 'integer)))))))
 
 ;; Other file name ops.
 
-;; ;; Matthias K\e,Av\e(Bppe <mkoeppe@mail.math.uni-magdeburg.de>
-;; (defun tramp-handle-directory-file-name (directory)
-;;   "Like `directory-file-name' for tramp files."
-;;   (if (and (eq (aref directory (- (length directory) 1)) ?/)
-;;        (not (eq (aref directory (- (length directory) 2)) ?:)))
-;;       (substring directory 0 (- (length directory) 1))
-;;     directory))
-
-;; ;; Philippe Troin <phil@fifi.org>
-;; (defun tramp-handle-directory-file-name (directory)
-;;   "Like `directory-file-name' for tramp files."
-;;   (with-parsed-tramp-file-name directory nil
-;;     (let ((directory-length-1 (1- (length directory))))
-;;       (save-match-data
-;;     (if (and (eq (aref directory directory-length-1) ?/)
-;;              (eq (string-match tramp-file-name-regexp directory) 0)
-;;              (/= (match-end 0) directory-length-1))
-;;         (substring directory 0 directory-length-1)
-;;       directory)))))
-
 (defun tramp-handle-directory-file-name (directory)
-  "Like `directory-file-name' for tramp files."
+  "Like `directory-file-name' for Tramp files."
   ;; If localname component of filename is "/", leave it unchanged.
   ;; Otherwise, remove any trailing slash from localname component.
   ;; Method, host, etc, are unchanged.  Does it make sense to try
@@ -2738,145 +2660,137 @@ of."
 
 ;; Directory listings.
 
-(defun tramp-handle-directory-files (directory
-                                    &optional full match nosort files-only)
-  "Like `directory-files' for tramp files."
-  (with-parsed-tramp-file-name directory nil
-    (let (result x)
-      (save-excursion
-       (tramp-barf-unless-okay
-        multi-method method user host
-        (concat "cd " (tramp-shell-quote-argument localname))
-        nil
-        'file-error
-        "tramp-handle-directory-files: couldn't `cd %s'"
-        (tramp-shell-quote-argument localname))
-       (tramp-send-command
-        multi-method method user host
-        (concat (tramp-get-ls-command multi-method method user host)
-                " -a | cat"))
-       (tramp-wait-for-output)
-       (goto-char (point-max))
-       (while (zerop (forward-line -1))
-         (setq x (buffer-substring (point)
-                                   (tramp-line-end-position)))
-         (when (or (not match) (string-match match x))
-           (if full
-               (push (concat (file-name-as-directory directory)
-                             x)
-                     result)
-             (push x result))))
-       (tramp-send-command multi-method method user host "cd")
-       (tramp-wait-for-output)
-       ;; Remove non-files or non-directories if necessary.  Using
-       ;; the remote shell for this would probably be way faster.
-       ;; Maybe something could be adapted from
-       ;; tramp-handle-file-name-all-completions.
-       (when files-only
-         (let ((temp (nreverse result))
-               item)
-           (setq result nil)
-           (if (equal files-only t)
-               ;; files only
-               (while temp
-                 (setq item (pop temp))
-                 (when (file-regular-p item)
-                   (push item result)))
-             ;; directories only
-             (while temp
-               (setq item (pop temp))
-               (when (file-directory-p item)
-                 (push item result)))))))
+(defun tramp-handle-directory-files
+  (directory &optional full match nosort files-only)
+  "Like `directory-files' for Tramp files."
+  ;; FILES-ONLY is valid for XEmacs only.
+  (when (file-directory-p directory)
+    (setq directory (expand-file-name directory))
+    (let ((temp (nreverse (file-name-all-completions "" directory)))
+         result item)
+
+      (while temp
+       (setq item (directory-file-name (pop temp)))
+       (when (and (or (null match) (string-match match item))
+                  (or (null files-only)
+                      ;; files only
+                      (and (equal files-only t) (file-regular-p item))
+                      ;; directories only
+                      (file-directory-p item)))
+         (push (if full (expand-file-name item directory) item)
+               result)))
       result)))
 
 (defun tramp-handle-directory-files-and-attributes
   (directory &optional full match nosort id-format)
-  "Like `directory-files-and-attributes' for tramp files."
-  (when (tramp-handle-file-exists-p directory)
-    (save-excursion
-      (setq directory (tramp-handle-expand-file-name directory))
-      (with-parsed-tramp-file-name directory nil
-        (tramp-maybe-send-perl-script multi-method method user host
-                                     tramp-perl-directory-files-and-attributes
-                                      "tramp_directory_files_and_attributes")
-        (tramp-send-command multi-method method user host
-                            (format "tramp_directory_files_and_attributes %s %s"
-                                    (tramp-shell-quote-argument localname)
-                                    (or id-format 'integer)))
-        (tramp-wait-for-output)
-        (let* ((root (cons nil (let ((object (read (current-buffer))))
-                                 (when (stringp object)
-                                   (error object))
-                                 object)))
-               (cell root))
-          (while (cdr cell)
-            (if (and match (not (string-match match (car (cadr cell)))))
-                ;; Remove from list
-                (setcdr cell (cddr cell))
-              ;; Include in list
-              (setq cell (cdr cell))
-              (let ((l (car cell)))
-                (tramp-convert-file-attributes multi-method method user host
-                                               (cdr l))
-                ;; If FULL, make file name absolute
-                (when full (setcar l (concat directory "/" (car l)))))))
-          (if nosort
-              (cdr root)
-            (sort (cdr root) (lambda (x y) (string< (car x) (car y))))))))))
+  "Like `directory-files-and-attributes' for Tramp files."
+  (unless id-format (setq id-format 'integer))
+  (when (file-directory-p directory)
+    (setq directory (expand-file-name directory))
+    (let* ((temp
+           (copy-tree
+            (with-parsed-tramp-file-name directory nil
+              (with-file-property
+                  v localname
+                  (format "directory-files-and-attributes-%s" id-format)
+                (save-excursion
+                  (mapcar
+                   '(lambda (x)
+                      (cons (car x)
+                            (tramp-convert-file-attributes v (cdr x))))
+                   (if (tramp-get-remote-stat v)
+                       (tramp-handle-directory-files-and-attributes-with-stat
+                        v localname id-format)
+                     (if (tramp-get-remote-perl v)
+                         (tramp-handle-directory-files-and-attributes-with-perl
+                          v localname id-format)))))))))
+          result item)
+
+      (while temp
+       (setq item (pop temp))
+       (when (or (null match) (string-match match (car item)))
+         (when full
+           (setcar item (expand-file-name (car item) directory)))
+         (push item result)))
+
+      (if nosort
+         result
+       (sort result (lambda (x y) (string< (car x) (car y))))))))
+
+(defun tramp-handle-directory-files-and-attributes-with-perl
+  (vec localname &optional id-format)
+  "Implement `directory-files-and-attributes' for Tramp files using a Perl script."
+  (tramp-message vec 5 "directory-files-and-attributes with perl: %s" localname)
+  (tramp-maybe-send-script
+   vec tramp-perl-directory-files-and-attributes
+   "tramp_perl_directory_files_and_attributes")
+  (let ((object
+        (tramp-send-command-and-read
+         vec
+         (format "tramp_perl_directory_files_and_attributes %s %s"
+                 (tramp-shell-quote-argument localname) id-format))))
+    (when (stringp object) (tramp-error vec 'file-error object))
+    object))
+
+(defun tramp-handle-directory-files-and-attributes-with-stat
+  (vec localname &optional id-format)
+  "Implement `directory-files-and-attributes' for Tramp files using stat(1) command."
+  (tramp-message vec 5 "directory-files-and-attributes with stat: %s" localname)
+  (tramp-send-command-and-read
+   vec
+   (format
+    (concat
+     "cd %s; echo \"(\"; (%s -ab | xargs "
+     "%s -c '(\"%%n\" (\"%%N\") %%h %s %s %%X.0 %%Y.0 %%Z.0 %%s.0 \"%%A\" t %%i.0 -1)'); "
+     "echo \")\"")
+    (tramp-shell-quote-argument localname)
+    (tramp-get-ls-command vec)
+    (tramp-get-remote-stat vec)
+    (if (eq id-format 'integer) "%u" "\"%U\"")
+    (if (eq id-format 'integer) "%g" "\"%G\""))))
 
 ;; This function should return "foo/" for directories and "bar" for
-;; files.  We use `ls -ad' to get a list of files (including
-;; directories), and `find . -type d \! -name . -prune' to get a list
-;; of directories.
+;; files.
 (defun tramp-handle-file-name-all-completions (filename directory)
-  "Like `file-name-all-completions' for tramp files."
-  (with-parsed-tramp-file-name directory nil
-    (unless (save-match-data (string-match "/" filename))
-      (let* ((nowild tramp-completion-without-shell-p)
-            result)
-       (save-excursion
-         (tramp-barf-unless-okay
-          multi-method method user host
-          (format "cd %s" (tramp-shell-quote-argument localname))
-          nil 'file-error
-          "tramp-handle-file-name-all-completions: Couldn't `cd %s'"
-          (tramp-shell-quote-argument localname))
-
-         ;; Get a list of directories and files, including reliably
-         ;; tagging the directories with a trailing '/'.  Because I
-         ;; rock.  --daniel@danann.net
-         (tramp-send-command
-          multi-method method user host
-          (format (concat "%s -a %s 2>/dev/null | while read f; do "
-                          "if test -d \"$f\" 2>/dev/null; "
-                          "then echo \"$f/\"; else echo \"$f\"; fi; done")
-                  (tramp-get-ls-command multi-method method user host)
-                  (if (or nowild (zerop (length filename)))
-                      ""
-                    (format "-d %s*"
-                            (tramp-shell-quote-argument filename)))))
-
-         ;; Now grab the output.
-         (tramp-wait-for-output)
-         (goto-char (point-max))
-         (while (zerop (forward-line -1))
-           (push (buffer-substring (point)
-                                   (tramp-line-end-position))
-                 result))
-
-         (tramp-send-command multi-method method user host "cd")
-         (tramp-wait-for-output)
-
-         ;; Return the list.
-         (if nowild
-             (all-completions filename (mapcar 'list result))
-           result))))))
-
+  "Like `file-name-all-completions' for Tramp files."
+  (unless (save-match-data (string-match "/" filename))
+    (with-parsed-tramp-file-name directory nil
+      (all-completions
+       filename
+       (mapcar
+       'list
+       (with-file-property v localname "file-name-all-completions"
+         (let (result)
+          (tramp-barf-unless-okay
+           v
+           (format "cd %s" (tramp-shell-quote-argument localname))
+           "tramp-handle-file-name-all-completions: Couldn't `cd %s'"
+           (tramp-shell-quote-argument localname))
+
+          ;; Get a list of directories and files, including reliably
+          ;; tagging the directories with a trailing '/'.  Because I
+          ;; rock.  --daniel@danann.net
+          (tramp-send-command
+           v
+           (format (concat "%s -ab 2>/dev/null | while read f; do "
+                           "if %s -d \"$f\" 2>/dev/null; "
+                           "then echo \"$f/\"; else echo \"$f\"; fi; done")
+                   (tramp-get-ls-command v)
+                   (tramp-get-test-command v)))
+
+          ;; Now grab the output.
+          (with-current-buffer (tramp-get-buffer v)
+            (goto-char (point-max))
+            (while (zerop (forward-line -1))
+              (push (buffer-substring (point)  (tramp-line-end-position))
+                    result)))
+
+          result)))))))
 
 ;; The following isn't needed for Emacs 20 but for 19.34?
 (defun tramp-handle-file-name-completion
   (filename directory &optional predicate)
-  "Like `file-name-completion' for tramp files."
+  "Like `file-name-completion' for Tramp files."
   (unless (tramp-tramp-file-p directory)
     (error
      "tramp-handle-file-name-completion invoked on non-tramp directory `%s'"
@@ -2891,18 +2805,17 @@ of."
 
 (defun tramp-handle-add-name-to-file
   (filename newname &optional ok-if-already-exists)
-  "Like `add-name-to-file' for tramp files."
+  "Like `add-name-to-file' for Tramp files."
+  (unless (tramp-equal-remote filename newname)
+    (with-parsed-tramp-file-name
+       (if (tramp-tramp-file-p filename) filename newname) nil
+      (tramp-error
+       v 'file-error
+       "add-name-to-file: %s"
+       "only implemented for same method, same user, same host")))
   (with-parsed-tramp-file-name filename v1
     (with-parsed-tramp-file-name newname v2
-      (let ((ln (when v1 (tramp-get-remote-ln
-                         v1-multi-method v1-method v1-user v1-host))))
-       (unless (and v1-method v2-method v1-user v2-user v1-host v2-host
-                    (equal v1-multi-method v2-multi-method)
-                    (equal v1-method v2-method)
-                    (equal v1-user v2-user)
-                    (equal v1-host v2-host))
-         (error "add-name-to-file: %s"
-                "only implemented for same method, same user, same host"))
+      (let ((ln (when v1 (tramp-get-remote-ln v1))))
        (when (and (not ok-if-already-exists)
                   (file-exists-p newname)
                   (not (numberp ok-if-already-exists))
@@ -2910,18 +2823,20 @@ of."
                    (format
                     "File %s already exists; make it a new name anyway? "
                     newname)))
-         (error "add-name-to-file: file %s already exists" newname))
+         (tramp-error
+          v2 'file-error
+          "add-name-to-file: file %s already exists" newname))
+       (tramp-flush-file-property v2 v2-localname)
        (tramp-barf-unless-okay
-        v1-multi-method v1-method v1-user v1-host
+        v1
         (format "%s %s %s" ln (tramp-shell-quote-argument v1-localname)
                 (tramp-shell-quote-argument v2-localname))
-        nil 'file-error
         "error with add-name-to-file, see buffer `%s' for details"
         (buffer-name))))))
 
 (defun tramp-handle-copy-file
   (filename newname &optional ok-if-already-exists keep-date)
-  "Like `copy-file' for tramp files."
+  "Like `copy-file' for Tramp files."
   ;; Check if both files are local -- invoke normal copy-file.
   ;; Otherwise, use tramp from local system.
   (setq filename (expand-file-name filename))
@@ -2932,12 +2847,11 @@ of."
       (tramp-do-copy-or-rename-file
        'copy filename newname ok-if-already-exists keep-date)
     (tramp-run-real-handler
-     'copy-file
-     (list filename newname ok-if-already-exists keep-date))))
+     'copy-file (list filename newname ok-if-already-exists keep-date))))
 
 (defun tramp-handle-rename-file
   (filename newname &optional ok-if-already-exists)
-  "Like `rename-file' for tramp files."
+  "Like `rename-file' for Tramp files."
   ;; Check if both files are local -- invoke normal rename-file.
   ;; Otherwise, use tramp from local system.
   (setq filename (expand-file-name filename))
@@ -2946,9 +2860,9 @@ of."
   (if (or (tramp-tramp-file-p filename)
           (tramp-tramp-file-p newname))
       (tramp-do-copy-or-rename-file
-       'rename filename newname ok-if-already-exists)
-    (tramp-run-real-handler 'rename-file
-                          (list filename newname ok-if-already-exists))))
+       'rename filename newname ok-if-already-exists t)
+    (tramp-run-real-handler
+     'rename-file (list filename newname ok-if-already-exists))))
 
 (defun tramp-do-copy-or-rename-file
   (op filename newname &optional ok-if-already-exists keep-date)
@@ -2965,169 +2879,146 @@ This function is invoked by `tramp-handle-copy-file' and
 and `rename'.  FILENAME and NEWNAME must be absolute file names."
   (unless (memq op '(copy rename))
     (error "Unknown operation `%s', must be `copy' or `rename'" op))
-  (unless ok-if-already-exists
-    (when (file-exists-p newname)
-      (signal 'file-already-exists
-              (list "File already exists" newname))))
   (let ((t1 (tramp-tramp-file-p filename))
-       (t2 (tramp-tramp-file-p newname))
-       v1-multi-method v1-method v1-user v1-host v1-localname
-       v2-multi-method v2-method v2-user v2-host v2-localname)
-
-    ;; Check which ones of source and target are Tramp files.
-    ;; We cannot invoke `with-parsed-tramp-file-name';
-    ;; it fails if the file isn't a Tramp file name.
-    (if t1
-       (with-parsed-tramp-file-name filename l
-         (setq v1-multi-method l-multi-method
-               v1-method l-method
-               v1-user l-user
-               v1-host l-host
-               v1-localname l-localname))
-      (setq v1-localname filename))
-    (if t2
-       (with-parsed-tramp-file-name newname l
-         (setq v2-multi-method l-multi-method
-               v2-method l-method
-               v2-user l-user
-               v2-host l-host
-               v2-localname l-localname))
-      (setq v2-localname newname))
+       (t2 (tramp-tramp-file-p newname)))
 
-    (cond
-     ;; Both are Tramp files.
-     ((and t1 t2)
-      (cond
-       ;; Shortcut: if method, host, user are the same for both
-       ;; files, we invoke `cp' or `mv' on the remote host
-       ;; directly.
-       ((and (equal v1-multi-method v2-multi-method)
-            (equal v1-method v2-method)
-            (equal v1-user v2-user)
-            (equal v1-host v2-host))
-       (tramp-do-copy-or-rename-file-directly
-        op v1-multi-method v1-method v1-user v1-host
-        v1-localname v2-localname keep-date))
-       ;; If both source and target are Tramp files,
-       ;; both are using the same copy-program, then we
-       ;; can invoke rcp directly.  Note that
-       ;; default-directory should point to a local
-       ;; directory if we want to invoke rcp.
-       ((and (not v1-multi-method)
-            (not v2-multi-method)
-            (equal v1-method v2-method)
-            (tramp-method-out-of-band-p
-             v1-multi-method v1-method v1-user v1-host)
-            (not (string-match "\\([^#]*\\)#\\(.*\\)" v1-host))
-            (not (string-match "\\([^#]*\\)#\\(.*\\)" v2-host)))
-       (tramp-do-copy-or-rename-file-out-of-band
-        op filename newname keep-date))
-       ;; No shortcut was possible.  So we copy the
-       ;; file first.  If the operation was `rename', we go
-       ;; back and delete the original file (if the copy was
-       ;; successful).  The approach is simple-minded: we
-       ;; create a new buffer, insert the contents of the
-       ;; source file into it, then write out the buffer to
-       ;; the target file.  The advantage is that it doesn't
-       ;; matter which filename handlers are used for the
-       ;; source and target file.
-       (t
-       (tramp-do-copy-or-rename-file-via-buffer
-        op filename newname keep-date))))
-
-     ;; One file is a Tramp file, the other one is local.
-     ((or t1 t2)
-      ;; If the Tramp file has an out-of-band method, the corresponding
-      ;; copy-program can be invoked.
-      (if (and (not v1-multi-method)
-              (not v2-multi-method)
-              (or (and t1 (tramp-method-out-of-band-p
-                            v1-multi-method v1-method v1-user v1-host))
-                  (and t2 (tramp-method-out-of-band-p
-                            v2-multi-method v2-method v2-user v2-host))))
-         (tramp-do-copy-or-rename-file-out-of-band
-          op filename newname keep-date)
-       ;; Use the generic method via a Tramp buffer.
-       (tramp-do-copy-or-rename-file-via-buffer
-        op filename newname keep-date)))
+    (unless ok-if-already-exists
+      (when (and t2 (file-exists-p newname))
+       (with-parsed-tramp-file-name newname nil
+         (tramp-error
+          v 'file-already-exists "File %s already exists" newname))))
 
-     (t
-      ;; One of them must be a Tramp file.
-      (error "Tramp implementation says this cannot happen")))))
+    (prog1
+       (cond
+        ;; Both are Tramp files.
+        ((and t1 t2)
+         (with-parsed-tramp-file-name filename v1
+           (with-parsed-tramp-file-name newname v2
+             (cond
+              ;; Shortcut: if method, host, user are the same for both
+              ;; files, we invoke `cp' or `mv' on the remote host
+              ;; directly.
+              ((tramp-equal-remote filename newname)
+               (tramp-do-copy-or-rename-file-directly
+                op v1 v1-localname v2-localname keep-date))
+              ;; If both source and target are Tramp files,
+              ;; both are using the same copy-program, then we
+              ;; can invoke rcp directly.  Note that
+              ;; default-directory should point to a local
+              ;; directory if we want to invoke rcp.
+              ((and (equal v1-method v2-method)
+                    (tramp-method-out-of-band-p v1)
+                    (> (nth 7 (file-attributes filename))
+                       tramp-copy-size-limit))
+               (tramp-do-copy-or-rename-file-out-of-band
+                op filename newname keep-date))
+              ;; No shortcut was possible.  So we copy the
+              ;; file first.  If the operation was `rename', we go
+              ;; back and delete the original file (if the copy was
+              ;; successful).  The approach is simple-minded: we
+              ;; create a new buffer, insert the contents of the
+              ;; source file into it, then write out the buffer to
+              ;; the target file.  The advantage is that it doesn't
+              ;; matter which filename handlers are used for the
+              ;; source and target file.
+              (t
+               (tramp-do-copy-or-rename-file-via-buffer
+                op filename newname keep-date))))))
+
+        ;; One file is a Tramp file, the other one is local.
+        ((or t1 t2)
+         (with-parsed-tramp-file-name (if t1 filename newname) nil
+           ;; If the Tramp file has an out-of-band method, the corresponding
+           ;; copy-program can be invoked.
+           (if (and (tramp-method-out-of-band-p v)
+                    (> (nth 7 (file-attributes filename))
+                       tramp-copy-size-limit))
+               (tramp-do-copy-or-rename-file-out-of-band
+                op filename newname keep-date)
+             ;; Use the generic method via a Tramp buffer.
+             (tramp-do-copy-or-rename-file-via-buffer
+              op filename newname keep-date))))
+
+        (t
+         ;; One of them must be a Tramp file.
+         (error "Tramp implementation says this cannot happen")))
+      ;; When newname did exist, we have wrong cached values.
+      (when t2
+       (with-parsed-tramp-file-name newname nil
+         (tramp-flush-file-property v localname))))))
 
 (defun tramp-do-copy-or-rename-file-via-buffer (op filename newname keep-date)
   "Use an Emacs buffer to copy or rename a file.
 First arg OP is either `copy' or `rename' and indicates the operation.
 FILENAME is the source file, NEWNAME the target file.
 KEEP-DATE is non-nil if NEWNAME should have the same timestamp as FILENAME."
-  (let ((trampbuf (get-buffer-create "*tramp output*"))
-       (modtime (nth 5 (file-attributes filename))))
-    (when (and keep-date (or (null modtime) (equal modtime '(0 0))))
-      (tramp-message
-       1 (concat "Warning: cannot preserve file time stamp"
-                " with inline copying across machines")))
-    (save-excursion
-      (set-buffer trampbuf) (erase-buffer)
-      (insert-file-contents-literally filename)
-      ;; We don't want the target file to be compressed, so we let-bind
-      ;; `jka-compr-inhibit' to t.
-      (let ((coding-system-for-write 'binary)
-           (jka-compr-inhibit t))
-       (write-region (point-min) (point-max) newname))
-      ;; KEEP-DATE handling.
-      (when keep-date
-       (when (and (not (null modtime))
-                  (not (equal modtime '(0 0))))
-         (tramp-touch newname modtime)))
-      ;; Set the mode.
-      (set-file-modes newname (file-modes filename)))
+  (let ((modtime (nth 5 (file-attributes filename))))
+    (unwind-protect
+       (with-temp-buffer
+         (let ((coding-system-for-read 'binary))
+           (insert-file-contents-literally filename))
+         ;; We don't want the target file to be compressed, so we
+         ;; let-bind `jka-compr-inhibit' to t.
+         (let ((coding-system-for-write 'binary)
+               (jka-compr-inhibit t))
+           (write-region (point-min) (point-max) newname))))
+    ;; KEEP-DATE handling.
+    (when (and keep-date (functionp 'set-file-times))
+      (apply 'set-file-times (list newname modtime)))
+    ;; Set the mode.
+    (set-file-modes newname (file-modes filename))
     ;; If the operation was `rename', delete the original file.
     (unless (eq op 'copy)
       (delete-file filename))))
 
 (defun tramp-do-copy-or-rename-file-directly
-  (op multi-method method user host localname1 localname2 keep-date)
+  (op vec localname1 localname2 keep-date)
   "Invokes `cp' or `mv' on the remote system.
 OP must be one of `copy' or `rename', indicating `cp' or `mv',
-respectively.  METHOD, USER, and HOST specify the connection.
-LOCALNAME1 and LOCALNAME2 specify the two arguments of `cp' or `mv'.
-If KEEP-DATE is non-nil, preserve the time stamp when copying."
+respectively.  VEC specifies the connection.  LOCALNAME1 and
+LOCALNAME2 specify the two arguments of `cp' or `mv'.  If
+KEEP-DATE is non-nil, preserve the time stamp when copying."
   ;; CCC: What happens to the timestamp when renaming?
   (let ((cmd (cond ((and (eq op 'copy) keep-date) "cp -f -p")
                    ((eq op 'copy) "cp -f")
                    ((eq op 'rename) "mv -f")
-                   (t (error
+                   (t (tramp-error
+                      vec 'file-error
                        "Unknown operation `%s', must be `copy' or `rename'"
                        op)))))
-    (save-excursion
-      (tramp-send-command
-       multi-method method user host
-       (format "%s %s %s"
-               cmd
-               (tramp-shell-quote-argument localname1)
-               (tramp-shell-quote-argument localname2)))
-      (tramp-wait-for-output)
+    (tramp-send-command
+     vec
+     (format "%s %s %s"
+            cmd
+            (tramp-shell-quote-argument localname1)
+            (tramp-shell-quote-argument localname2)))
+    (with-current-buffer (tramp-get-buffer vec)
       (goto-char (point-min))
       (unless
          (or
           (and (eq op 'copy) keep-date
                ;; Mask cp -f error.
                (re-search-forward tramp-operation-not-permitted-regexp nil t))
-          (zerop (tramp-send-command-and-check
-                  multi-method method user host nil nil)))
-       (pop-to-buffer (current-buffer))
-       (signal 'file-error
-               (format "Copying directly failed, see buffer `%s' for details."
-                       (buffer-name)))))
+          (zerop (tramp-send-command-and-check vec nil)))
+       (tramp-error-with-buffer
+        nil vec 'file-error
+        "Copying directly failed, see buffer `%s' for details."
+        (buffer-name))))
     ;; Set the mode.
     ;; CCC: Maybe `chmod --reference=localname1 localname2' could be used
     ;;      where available?
     (unless (or (eq op 'rename) keep-date)
       (set-file-modes
-       (tramp-make-tramp-file-name multi-method method user host localname2)
-       (file-modes
-       (tramp-make-tramp-file-name
-        multi-method method user host localname1))))))
+       (tramp-make-tramp-file-name
+       (tramp-file-name-method vec)
+       (tramp-file-name-user vec)
+       (tramp-file-name-host vec)
+       localname2)
+       (file-modes (tramp-make-tramp-file-name
+                   (tramp-file-name-method vec)
+                   (tramp-file-name-user vec)
+                   (tramp-file-name-host vec)
+                   localname1))))))
 
 (defun tramp-do-copy-or-rename-file-out-of-band (op filename newname keep-date)
   "Invoke rcp program to copy.
@@ -3135,176 +3026,138 @@ One of FILENAME and NEWNAME must be a Tramp name, the other must
 be a local filename.  The method used must be an out-of-band method."
   (let ((t1 (tramp-tramp-file-p filename))
        (t2 (tramp-tramp-file-p newname))
-       v1-multi-method v1-method v1-user v1-host v1-localname
-       v2-multi-method v2-method v2-user v2-host v2-localname
-       multi-method method user host copy-program copy-args
-       source target trampbuf)
-
-    ;; Check which ones of source and target are Tramp files.
-    ;; We cannot invoke `with-parsed-tramp-file-name';
-    ;; it fails if the file isn't a Tramp file name.
-    (if t1
-       (with-parsed-tramp-file-name filename l
-         (setq v1-multi-method l-multi-method
-               v1-method l-method
-               v1-user l-user
-               v1-host l-host
-               v1-localname l-localname
-               multi-method l-multi-method
-               method (tramp-find-method
-                       v1-multi-method v1-method v1-user v1-host)
-               user l-user
-               host l-host
-               copy-program (tramp-get-method-parameter
-                             v1-multi-method method
-                             v1-user v1-host 'tramp-copy-program)
-               copy-args (tramp-get-method-parameter
-                                v1-multi-method method
-                                v1-user v1-host 'tramp-copy-args)))
-      (setq v1-localname filename))
-
-    (if t2
-       (with-parsed-tramp-file-name newname l
-         (setq v2-multi-method l-multi-method
-               v2-method l-method
-               v2-user l-user
-               v2-host l-host
-               v2-localname l-localname
-               multi-method l-multi-method
-               method (tramp-find-method
-                       v2-multi-method v2-method v2-user v2-host)
-               user l-user
-               host l-host
-               copy-program (tramp-get-method-parameter
-                             v2-multi-method method
-                             v2-user v2-host 'tramp-copy-program)
-               copy-args (tramp-get-method-parameter
-                                v2-multi-method method
-                                v2-user v2-host 'tramp-copy-args)))
-      (setq v2-localname newname))
-
-    ;; The following should be changed.  We need a more general
-    ;; mechanism to parse extra host args.
-    (if (not t1)
-       (setq source v1-localname)
-      (when (string-match "\\([^#]*\\)#\\(.*\\)" v1-host)
-       (setq copy-args (cons "-P" (cons (match-string 2 v1-host) copy-args)))
-       (setq v1-host (match-string 1 v1-host)))
-      (setq source
-            (tramp-make-copy-program-file-name
-             v1-user v1-host
-             (tramp-shell-quote-argument v1-localname))))
-
-    (if (not t2)
-       (setq target v2-localname)
-      (when (string-match "\\([^#]*\\)#\\(.*\\)" v2-host)
-       (setq copy-args (cons "-P" (cons (match-string 2 v2-host) copy-args)))
-       (setq v2-host (match-string 1 v2-host)))
-      (setq target
-            (tramp-make-copy-program-file-name
-             v2-user v2-host
-             (tramp-shell-quote-argument v2-localname))))
-
-    ;; Handle ControlMaster/ControlPath
-    (setq copy-args
-         (mapcar
-          (lambda (x)
-            (format-spec
-             x `((?t . ,(format "/tmp/%s" tramp-temp-name-prefix)))))
-          copy-args))
-
-    ;; Handle keep-date argument
-    (when keep-date
-      (if t1
-         (setq copy-args
-               (cons (tramp-get-method-parameter
-                      v1-multi-method method
-                      v1-user v1-host 'tramp-copy-keep-date-arg)
-                     copy-args))
-       (setq copy-args
-             (cons (tramp-get-method-parameter
-                    v2-multi-method method
-                    v2-user v2-host 'tramp-copy-keep-date-arg)
-                   copy-args))))
-
-    (setq copy-args (append copy-args (list source target))
-         trampbuf (generate-new-buffer
-                   (tramp-buffer-name multi-method method user host)))
-
-    ;; Use an asynchronous process.  By this, password can be handled.
-    (save-excursion
+       copy-program copy-args copy-keep-date port spec
+       source target)
+
+    (with-parsed-tramp-file-name (if t1 filename newname) nil
+
+      ;; Expand hops.  Might be necessary for gateway methods.
+      (setq v (car (tramp-compute-multi-hops v)))
+      (aset v 3 localname)
+
+      ;; Check which ones of source and target are Tramp files.
+      (setq source (if t1 (tramp-make-copy-program-file-name v) filename)
+           target (if t2 (tramp-make-copy-program-file-name v) newname))
+
+      ;; Check for port number.  Until now, there's no need for handling
+      ;; like method, user, host.
+      (setq host (tramp-file-name-real-host v)
+           port (tramp-file-name-port v)
+           port (or (and port (number-to-string port)) ""))
+
+      ;; Compose copy command.
+      (setq spec `((?h . ,host) (?u . ,user) (?p . ,port)
+                  (?t . ,(tramp-make-tramp-temp-file v))
+                  (?k . ,(if keep-date " " "")))
+           copy-program (tramp-get-method-parameter
+                         method 'tramp-copy-program)
+           copy-keep-date (tramp-get-method-parameter
+                           method 'tramp-copy-keep-date)
+           copy-args
+           (delq
+            nil
+            (mapcar
+             '(lambda (x)
+                (setq
+                 ;; " " is indication for keep-date argument.
+                 x (delete " " (mapcar '(lambda (y) (format-spec y spec)) x)))
+                (unless (member "" x) (mapconcat 'identity x " ")))
+             (tramp-get-method-parameter
+              method 'tramp-copy-args))))
 
       ;; Check for program.
       (when (and (fboundp 'executable-find)
-                (not (executable-find copy-program)))
-       (error "Cannot find copy program: %s" copy-program))
+                (not (let ((default-directory
+                             (tramp-temporary-file-directory)))
+                       (executable-find copy-program))))
+       (tramp-error
+        v 'file-error "Cannot find copy program: %s" copy-program))
 
-      (set-buffer trampbuf)
-      (setq tramp-current-multi-method multi-method
-           tramp-current-method method
-           tramp-current-user user
-           tramp-current-host host)
-      (message "Transferring %s to %s..." filename newname)
+      (tramp-message v 0 "Transferring %s to %s..." filename newname)
 
-      ;; Use rcp-like program for file transfer.
       (unwind-protect
-          (let* ((default-directory
-                  (if (and (stringp default-directory)
-                           (file-accessible-directory-p default-directory))
-                      default-directory
-                    (tramp-temporary-file-directory)))
-                (p (apply 'start-process (buffer-name trampbuf) trampbuf
-                          copy-program copy-args)))
-            (tramp-set-process-query-on-exit-flag p nil)
-            (tramp-process-actions p multi-method method user host
-                                   tramp-actions-copy-out-of-band))
-        (kill-buffer trampbuf))
-      (message "Transferring %s to %s...done" filename newname)
+         (with-temp-buffer
+           ;; The default directory must be remote.
+           (let ((default-directory
+                   (file-name-directory (if t1 filename newname))))
+             ;; Set the transfer process properties.
+             (tramp-set-connection-property
+              v "process-name" (buffer-name (current-buffer)))
+             (tramp-set-connection-property
+              v "process-buffer" (current-buffer))
+
+             ;; Use an asynchronous process.  By this, password can
+             ;; be handled.  The default directory must be local, in
+             ;; order to apply the correct `copy-program'.  We don't
+             ;; set a timeout, because the copying of large files can
+             ;; last longer than 60 secs.
+             (let ((p (let ((default-directory
+                              (tramp-temporary-file-directory)))
+                        (apply 'start-process
+                               (tramp-get-connection-property
+                                v "process-name" nil)
+                               (tramp-get-connection-property
+                                v "process-buffer" nil)
+                               copy-program
+                               (append copy-args (list source target))))))
+               (tramp-message
+                v 6 "%s" (mapconcat 'identity (process-command p) " "))
+               (set-process-sentinel p 'tramp-flush-connection-property)
+               (tramp-set-process-query-on-exit-flag p nil)
+               (tramp-process-actions p v tramp-actions-copy-out-of-band))))
+
+       ;; Reset the transfer process properties.
+       (tramp-set-connection-property v "process-name" nil)
+       (tramp-set-connection-property v "process-buffer" nil))
+
+      (tramp-message v 0 "Transferring %s to %s...done" filename newname)
+
+      ;; Handle KEEP-DATE argument.
+      (when (and keep-date (not copy-keep-date) (functionp 'set-file-times))
+       (apply 'set-file-times
+              (list newname (nth 5 (file-attributes filename)))))
 
       ;; Set the mode.
-      (unless keep-date
+      (unless (and keep-date copy-keep-date)
        (set-file-modes newname (file-modes filename))))
 
     ;; If the operation was `rename', delete the original file.
     (unless (eq op 'copy)
       (delete-file filename))))
 
-;; mkdir
 (defun tramp-handle-make-directory (dir &optional parents)
-  "Like `make-directory' for tramp files."
+  "Like `make-directory' for Tramp files."
   (setq dir (expand-file-name dir))
   (with-parsed-tramp-file-name dir nil
     (save-excursion
       (tramp-barf-unless-okay
-       multi-method method user host
+       v
        (format " %s %s"
               (if parents "mkdir -p" "mkdir")
               (tramp-shell-quote-argument localname))
-       nil 'file-error
        "Couldn't make directory %s" dir))))
 
-;; CCC error checking?
 (defun tramp-handle-delete-directory (directory)
-  "Like `delete-directory' for tramp files."
+  "Like `delete-directory' for Tramp files."
   (setq directory (expand-file-name directory))
   (with-parsed-tramp-file-name directory nil
-    (save-excursion
-      (tramp-send-command
-       multi-method method user host
-       (format "rmdir %s ; echo ok"
-              (tramp-shell-quote-argument localname)))
-      (tramp-wait-for-output))))
+    (tramp-flush-directory-property v localname)
+    (unless (zerop (tramp-send-command-and-check
+                   v
+                   (format "rmdir %s"
+                           (tramp-shell-quote-argument localname))))
+      (tramp-error v 'file-error "Couldn't delete %s" directory))))
 
 (defun tramp-handle-delete-file (filename)
-  "Like `delete-file' for tramp files."
+  "Like `delete-file' for Tramp files."
   (setq filename (expand-file-name filename))
   (with-parsed-tramp-file-name filename nil
-    (save-excursion
-      (unless (zerop (tramp-send-command-and-check
-                     multi-method method user host
-                     (format "rm -f %s"
-                             (tramp-shell-quote-argument localname))))
-       (signal 'file-error "Couldn't delete Tramp file")))))
+    (tramp-flush-file-property v localname)
+    (unless (zerop (tramp-send-command-and-check
+                   v
+                   (format "rm -f %s"
+                           (tramp-shell-quote-argument localname))))
+      (tramp-error v 'file-error "Couldn't delete %s" filename))))
 
 ;; Dired.
 
@@ -3312,57 +3165,33 @@ be a local filename.  The method used must be an out-of-band method."
 ;;      we try and delete two directories under TRAMP :/
 (defun tramp-handle-dired-recursive-delete-directory (filename)
   "Recursively delete the directory given.
-This is like `dired-recursive-delete-directory' for tramp files."
+This is like `dired-recursive-delete-directory' for Tramp files."
   (with-parsed-tramp-file-name filename nil
-    ;; run a shell command 'rm -r <localname>'
+    (tramp-flush-directory-property v filename)
+    ;; Run a shell command 'rm -r <localname>'
     ;; Code shamelessly stolen for the dired implementation and, um, hacked :)
-    (or (file-exists-p filename)
-       (signal
-        'file-error
-        (list "Removing old file name" "no such directory" filename)))
+    (unless (file-exists-p filename)
+      (tramp-error v 'file-error "No such directory: %s" filename))
     ;; Which is better, -r or -R? (-r works for me <daniel@danann.net>)
-    (tramp-send-command multi-method method user host
-                       (format "rm -r %s" (tramp-shell-quote-argument localname)))
+    (tramp-send-command
+     v
+     (format "rm -r %s" (tramp-shell-quote-argument localname))
+     ;; Don't read the output, do it explicitely.
+     nil t)
     ;; Wait for the remote system to return to us...
     ;; This might take a while, allow it plenty of time.
-    (tramp-wait-for-output 120)
+    (tramp-wait-for-output (tramp-get-connection-process v) 120)
     ;; Make sure that it worked...
     (and (file-exists-p filename)
-        (error "Failed to recursively delete %s" filename))))
-
-(defun tramp-handle-dired-call-process (program discard &rest arguments)
-  "Like `dired-call-process' for tramp files."
-  (with-parsed-tramp-file-name default-directory nil
-    (save-excursion
-      (tramp-barf-unless-okay
-       multi-method method user host
-       (format "cd %s" (tramp-shell-quote-argument localname))
-       nil 'file-error
-       "tramp-handle-dired-call-process: Couldn't `cd %s'"
-       (tramp-shell-quote-argument localname))
-      (tramp-send-command
-       multi-method method user host
-       (mapconcat #'tramp-shell-quote-argument (cons program arguments) " "))
-      (tramp-wait-for-output))
-    (unless discard
-      ;; We cannot use `insert-buffer' because the tramp buffer
-      ;; changes its contents before insertion due to calling
-      ;; `expand-file' and alike.
-      (insert
-       (with-current-buffer
-          (tramp-get-buffer multi-method method user host)
-        (buffer-string))))
-    (save-excursion
-      (prog1
-         (tramp-send-command-and-check multi-method method user host nil)
-       (tramp-send-command multi-method method user host "cd")
-       (tramp-wait-for-output)))))
+        (tramp-error
+         v 'file-error "Failed to recursively delete %s" filename))))
 
 (defun tramp-handle-dired-compress-file (file &rest ok-flag)
-  "Like `dired-compress-file' for tramp files."
+  "Like `dired-compress-file' for Tramp files."
   ;; OK-FLAG is valid for XEmacs only, but not implemented.
   ;; Code stolen mainly from dired-aux.el.
   (with-parsed-tramp-file-name file nil
+    (tramp-flush-file-property v localname)
     (save-excursion
       (let ((suffixes
             (if (not (featurep 'xemacs))
@@ -3388,11 +3217,10 @@ This is like `dired-recursive-delete-directory' for tramp files."
               nil)
              ((and suffix (nth 2 suffix))
               ;; We found an uncompression rule.
-              (message "Uncompressing %s..." file)
+              (tramp-message v 0 "Uncompressing %s..." file)
               (when (zerop (tramp-send-command-and-check
-                            multi-method method user host
-                            (concat (nth 2 suffix) " " localname)))
-                (message "Uncompressing %s...done" file)
+                            v (concat (nth 2 suffix) " " localname)))
+                (tramp-message v 0 "Uncompressing %s...done" file)
                 ;; `dired-remove-file' is not defined in XEmacs
                 (funcall (symbol-function 'dired-remove-file) file)
                 (string-match (car suffix) file)
@@ -3400,11 +3228,10 @@ This is like `dired-recursive-delete-directory' for tramp files."
              (t
               ;; We don't recognize the file as compressed, so compress it.
               ;; Try gzip.
-              (message "Compressing %s..." file)
+              (tramp-message v 0 "Compressing %s..." file)
               (when (zerop (tramp-send-command-and-check
-                            multi-method method user host
-                            (concat "gzip -f " localname)))
-                (message "Compressing %s...done" file)
+                            v (concat "gzip -f " localname)))
+                (tramp-message v 0 "Compressing %s...done" file)
                 ;; `dired-remove-file' is not defined in XEmacs
                 (funcall (symbol-function 'dired-remove-file) file)
                 (cond ((file-exists-p (concat file ".gz"))
@@ -3428,21 +3255,21 @@ This is like `dired-recursive-delete-directory' for tramp files."
 
 (defun tramp-handle-insert-directory
   (filename switches &optional wildcard full-directory-p)
-  "Like `insert-directory' for tramp files."
-  (if (and (featurep 'ls-lisp)
-           (not (symbol-value 'ls-lisp-use-insert-directory-program)))
-      (tramp-run-real-handler
-       'insert-directory (list filename switches wildcard full-directory-p))
-    ;; For the moment, we assume that the remote "ls" program does not
-    ;; grok "--dired".  In the future, we should detect this on
-    ;; connection setup.
-    (when (string-match "^--dired\\s-+" switches)
-      (setq switches (replace-match "" nil t switches)))
-    (setq filename (expand-file-name filename))
-    (with-parsed-tramp-file-name filename nil
-      (tramp-message-for-buffer
-       multi-method method user host 10
-       "Inserting directory `ls %s %s', wildcard %s, fulldir %s"
+  "Like `insert-directory' for Tramp files."
+  (setq filename (expand-file-name filename))
+  (with-parsed-tramp-file-name filename nil
+    (tramp-flush-file-property v localname)
+    (if (and (featurep 'ls-lisp)
+            (not (symbol-value 'ls-lisp-use-insert-directory-program)))
+       (tramp-run-real-handler
+        'insert-directory (list filename switches wildcard full-directory-p))
+      ;; For the moment, we assume that the remote "ls" program does not
+      ;; grok "--dired".  In the future, we should detect this on
+      ;; connection setup.
+      (when (string-match "^--dired\\s-+" switches)
+       (setq switches (replace-match "" nil t switches)))
+      (tramp-message
+       v 4 "Inserting directory `ls %s %s', wildcard %s, fulldir %s"
        switches filename (if wildcard "yes" "no")
        (if full-directory-p "yes" "no"))
       (when wildcard
@@ -3454,80 +3281,44 @@ This is like `dired-recursive-delete-directory' for tramp files."
         (setq switches (concat "-d " switches)))
       (when wildcard
         (setq switches (concat switches " " wildcard)))
-      (save-excursion
-        ;; If `full-directory-p', we just say `ls -l FILENAME'.
-        ;; Else we chdir to the parent directory, then say `ls -ld BASENAME'.
-        (if full-directory-p
-            (tramp-send-command
-             multi-method method user host
-             (format "%s %s %s"
-                     (tramp-get-ls-command multi-method method user host)
-                     switches
-                     (if wildcard
-                         localname
-                       (tramp-shell-quote-argument (concat localname ".")))))
-          (tramp-barf-unless-okay
-           multi-method method user host
-           (format "cd %s" (tramp-shell-quote-argument
-                            (file-name-directory localname)))
-           nil 'file-error
-           "Couldn't `cd %s'"
-           (tramp-shell-quote-argument (file-name-directory localname)))
-          (tramp-send-command
-           multi-method method user host
-           (format "%s %s %s"
-                   (tramp-get-ls-command multi-method method user host)
-                   switches
-                   (if wildcard
-                       localname
-                    (if (zerop (length (file-name-nondirectory localname)))
-                        ""
-                      (tramp-shell-quote-argument
-                       (file-name-nondirectory localname)))))))
-        (sit-for 1)                    ;needed for rsh but not ssh?
-        (tramp-wait-for-output))
-      ;; The following let-binding is used by code that's commented
-      ;; out.  Let's leave the let-binding in for a while to see
-      ;; that the commented-out code is really not needed.  Commenting-out
-      ;; happened on 2003-03-13.
-      (let ((old-pos (point)))
-       ;; We cannot use `insert-buffer' because the tramp buffer
-       ;; changes its contents before insertion due to calling
-       ;; `expand-file' and alike.
-       (insert
-        (with-current-buffer
-            (tramp-get-buffer multi-method method user host)
-          (buffer-string)))
-        ;; On XEmacs, we want to call (exchange-point-and-mark t), but
-        ;; that doesn't exist on Emacs, so we use this workaround instead.
-        ;; Since zmacs-region-stays doesn't exist in Emacs, this ought to
-        ;; be safe.  Thanks to Daniel Pittman <daniel@danann.net>.
-        ;;     (let ((zmacs-region-stays t))
-        ;;       (exchange-point-and-mark))
-        (save-excursion
-          (tramp-send-command multi-method method user host "cd")
-          (tramp-wait-for-output))
-        ;; For the time being, the XEmacs kludge is commented out.
-        ;; Please test it on various XEmacs versions to see if it works.
-        ;;       ;; Another XEmacs specialty follows.  What's the right way to do
-        ;;       ;; it?
-        ;;       (when (and (featurep 'xemacs)
-        ;;              (eq major-mode 'dired-mode))
-        ;;     (save-excursion
-        ;;       (require 'dired)
-        ;;       (dired-insert-set-properties old-pos (point))))
-        ))))
-
-;; Continuation of kluge to pacify byte-compiler.
-;;(eval-when-compile
-;;  (when (eq (symbol-function 'dired-insert-set-properties) 'ignore)
-;;    (fmakunbound 'dired-insert-set-properties)))
+      ;; If `full-directory-p', we just say `ls -l FILENAME'.
+      ;; Else we chdir to the parent directory, then say `ls -ld BASENAME'.
+      (if full-directory-p
+         (tramp-send-command
+          v
+          (format "%s %s %s"
+                  (tramp-get-ls-command v)
+                  switches
+                  (if wildcard
+                      localname
+                    (tramp-shell-quote-argument (concat localname ".")))))
+       (tramp-barf-unless-okay
+        v
+        (format "cd %s" (tramp-shell-quote-argument
+                         (file-name-directory localname)))
+        "Couldn't `cd %s'"
+        (tramp-shell-quote-argument (file-name-directory localname)))
+       (tramp-send-command
+        v
+        (format "%s %s %s"
+                (tramp-get-ls-command v)
+                switches
+                (if (or wildcard
+                        (zerop (length (file-name-nondirectory localname))))
+                    ""
+                  (tramp-shell-quote-argument
+                   (file-name-nondirectory localname))))))
+      ;; We cannot use `insert-buffer-substring' because the tramp buffer
+      ;; changes its contents before insertion due to calling
+      ;; `expand-file' and alike.
+      (insert
+       (with-current-buffer (tramp-get-buffer v)
+        (buffer-string))))))
 
 ;; CCC is this the right thing to do?
 (defun tramp-handle-unhandled-file-name-directory (filename)
-  "Like `unhandled-file-name-directory' for tramp files."
-  (with-parsed-tramp-file-name filename nil
-    (expand-file-name "~/")))
+  "Like `unhandled-file-name-directory' for Tramp files."
+  (expand-file-name "~/"))
 
 ;; Canonicalization of file names.
 
@@ -3548,7 +3339,7 @@ Doesn't do anything if the NAME does not start with a drive letter."
     name))
 
 (defun tramp-handle-expand-file-name (name &optional dir)
-  "Like `expand-file-name' for tramp files.
+  "Like `expand-file-name' for Tramp files.
 If the localname part of the given filename starts with \"/../\" then
 the result will be a local, non-Tramp, filename."
   ;; If DIR is not given, use DEFAULT-DIRECTORY or "/".
@@ -3556,223 +3347,107 @@ the result will be a local, non-Tramp, filename."
   ;; Unless NAME is absolute, concat DIR and NAME.
   (unless (file-name-absolute-p name)
     (setq name (concat (file-name-as-directory dir) name)))
-  ;; If NAME is not a tramp file, run the real handler
+  ;; If NAME is not a Tramp file, run the real handler.
   (if (not (tramp-tramp-file-p name))
-      (tramp-run-real-handler 'expand-file-name
-                              (list name nil))
+      (tramp-run-real-handler 'expand-file-name (list name nil))
     ;; Dissect NAME.
     (with-parsed-tramp-file-name name nil
       (unless (file-name-absolute-p localname)
        (setq localname (concat "~/" localname)))
-      (save-excursion
-       ;; Tilde expansion if necessary.  This needs a shell which
-       ;; groks tilde expansion!  The function `tramp-find-shell' is
-       ;; supposed to find such a shell on the remote host.  Please
-       ;; tell me about it when this doesn't work on your system.
-       (when (string-match "\\`\\(~[^/]*\\)\\(.*\\)\\'" localname)
-         (let ((uname (match-string 1 localname))
-               (fname (match-string 2 localname)))
-           ;; We cannot simply apply "~/", because under sudo "~/" is
-           ;; expanded to the local user home directory but to the
-           ;; root home directory.  On the other hand, using always
-           ;; the default user name for tilde expansion is not
-           ;; appropriate either, because ssh and companions might
-           ;; use a user name from the config file.
-           (when (and (string-equal uname "~")
-                      (string-match
-                       "\\`su\\(do\\)?\\'"
-                       (tramp-find-method multi-method method user host)))
-             (setq uname (concat uname (or user "root"))))
-           ;; CCC fanatic error checking?
-           (set-buffer (tramp-get-buffer multi-method method user host))
-           (erase-buffer)
-           (tramp-send-command
-            multi-method method user host
-            (format "cd %s; pwd" uname)
-            t)
-           (tramp-wait-for-output)
-           (goto-char (point-min))
-           (setq uname (buffer-substring (point) (tramp-line-end-position)))
-           (setq localname (concat uname fname))
-           (erase-buffer)))
-       ;; There might be a double slash, for example when "~/"
-       ;; expands to "/". Remove this.
-       (while (string-match "//" localname)
-         (setq localname (replace-match "/" t t localname)))
-       ;; No tilde characters in file name, do normal
-       ;; expand-file-name (this does "/./" and "/../").  We bind
-       ;; directory-sep-char here for XEmacs on Windows, which would
-       ;; otherwise use backslash.  `default-directory' is bound to
-       ;; "/", because on Windows there would be problems with UNC
-       ;; shares or Cygwin mounts.
-       (tramp-let-maybe directory-sep-char ?/
-         (let ((default-directory "/"))
-           (tramp-make-tramp-file-name
-            multi-method (or method (tramp-find-default-method user host))
-            user host
-            (tramp-drop-volume-letter
-             (tramp-run-real-handler 'expand-file-name
-                                     (list localname))))))))))
-
-;; old version follows.  it uses ".." to cross file handler
-;; boundaries.
-;;     ;; Look if localname starts with "/../" construct.  If this is
-;;     ;; the case, then we return a local name instead of a remote name.
-;;     (if (string-match "^/\\.\\./" localname)
-;;         (expand-file-name (substring localname 3))
-;;       ;; No tilde characters in file name, do normal
-;;       ;; expand-file-name (this does "/./" and "/../").  We bind
-;;       ;; directory-sep-char here for XEmacs on Windows, which
-;;       ;; would otherwise use backslash.
-;;       (let ((directory-sep-char ?/))
-;;         (tramp-make-tramp-file-name
-;;          multi-method method user host
-;;          (tramp-drop-volume-letter
-;;           (tramp-run-real-handler 'expand-file-name
-;;                                   (list localname))))))))))
-
-;; Remote commands.
-
-(defvar tramp-async-proc nil
-  "Global variable keeping asynchronous process object.
-Used in `tramp-handle-shell-command'")
-
-(defvar tramp-display-shell-command-buffer t
-  "Whether to display output buffer of `shell-command'.
-This is necessary for handling DISPLAY of `process-file'.")
-
-(defun tramp-handle-shell-command (command &optional output-buffer error-buffer)
-  "Like `shell-command' for tramp files.
-This will break if COMMAND prints a newline, followed by the value of
-`tramp-end-of-output', followed by another newline."
-  ;; Asynchronous processes are far from being perfect.  But it works at least
-  ;; for `find-grep-dired' and `find-name-dired' in Emacs 22.
-  (if (tramp-tramp-file-p default-directory)
-      (with-parsed-tramp-file-name default-directory nil
-       (let ((curbuf (current-buffer))
-             (asynchronous (string-match "[ \t]*&[ \t]*\\'" command))
-             status)
-         (unless output-buffer
-           (setq output-buffer
-                 (get-buffer-create
-                  (if asynchronous
-                      "*Async Shell Command*"
-                    "*Shell Command Output*")))
-           (set-buffer output-buffer)
-           (erase-buffer))
-         (unless (bufferp output-buffer)
-           (setq output-buffer (current-buffer)))
-         (set-buffer output-buffer)
-         ;; Tramp doesn't handle the asynchronous case by an asynchronous
-         ;; process.  Instead of, another asynchronous process is opened
-         ;; which gets the output of the (synchronous) Tramp process
-         ;; via process-filter.  ERROR-BUFFER is disabled.
-         (when asynchronous
-           (setq command (substring command 0 (match-beginning 0))
-                 error-buffer nil
-                 tramp-async-proc (start-process (buffer-name output-buffer)
-                                                 output-buffer "cat")))
-         (save-excursion
-           (tramp-barf-unless-okay
-            multi-method method user host
-            (format "cd %s" (tramp-shell-quote-argument localname))
-            nil 'file-error
-            "tramp-handle-shell-command: Couldn't `cd %s'"
-            (tramp-shell-quote-argument localname))
-           ;; Define the process filter
-           (when asynchronous
-             (set-process-filter
-              (get-buffer-process
-               (tramp-get-buffer multi-method method user host))
-              '(lambda (process string)
-                 ;; Write the output into the Tramp Process
-                 (save-current-buffer
-                   (set-buffer (process-buffer process))
-                   (goto-char (point-max))
-                   (insert string))
-                 ;; Hand-over output to asynchronous process.
-                 (let ((end
-                        (string-match
-                         (regexp-quote tramp-end-of-output) string)))
-                   (when end
-                     (setq string
-                           (substring string 0 (1- (match-beginning 0)))))
-                   (process-send-string tramp-async-proc string)
-                   (when end
-                     (set-process-filter process nil)
-                     (process-send-eof tramp-async-proc))))))
-           ;; Send the command
-           (tramp-send-command
-            multi-method method user host
-            (if error-buffer
-                (format "( %s ) 2>/tmp/tramp.$$.err; tramp_old_status=$?"
-                        command)
-              (format "%s; tramp_old_status=$?" command)))
-           (unless asynchronous
-             (tramp-wait-for-output)))
-         (unless asynchronous
-           ;; We cannot use `insert-buffer' because the tramp buffer
-           ;; changes its contents before insertion due to calling
-           ;; `expand-file' and alike.
-           (insert
-            (with-current-buffer
-                (tramp-get-buffer multi-method method user host)
-              (buffer-string))))
-         (when error-buffer
-           (save-excursion
-             (unless (bufferp error-buffer)
-               (setq error-buffer (get-buffer-create error-buffer)))
-             (tramp-send-command
-              multi-method method user host
-              "cat /tmp/tramp.$$.err")
-             (tramp-wait-for-output)
-             (set-buffer error-buffer)
-             ;; Same comment as above
-             (insert
-              (with-current-buffer
-                  (tramp-get-buffer multi-method method user host)
-                (buffer-string)))
-             (tramp-send-command-and-check
-              multi-method method user host "rm -f /tmp/tramp.$$.err")))
-         (save-excursion
-           (tramp-send-command multi-method method user host "cd")
-           (unless asynchronous
-             (tramp-wait-for-output))
-           (tramp-send-command
-            multi-method method user host
-            (concat "tramp_set_exit_status $tramp_old_status;"
-                    " echo tramp_exit_status $?"))
-           (unless asynchronous
-             (tramp-wait-for-output)
-             (goto-char (point-max))
-             (unless (search-backward "tramp_exit_status " nil t)
-               (error "Couldn't find exit status of `%s'" command))
-             (skip-chars-forward "^ ")
-             (setq status (read (current-buffer)))))
-         (unless (zerop (buffer-size))
-           (when tramp-display-shell-command-buffer
-             (display-buffer output-buffer)))
-         (set-buffer curbuf)
-         status))
-    ;; The following is only executed if something strange was
-    ;; happening.  Emit a helpful message and do it anyway.
-    (message "tramp-handle-shell-command called with non-tramp directory: `%s'"
-            default-directory)
-    (tramp-run-real-handler 'shell-command
-                           (list command output-buffer error-buffer))))
-
-(defun tramp-handle-process-file (program &optional infile buffer display &rest args)
-  "Like `process-file' for Tramp files."
-  (when infile (error "Implementation does not handle input from file"))
-  (when (and (numberp buffer) (zerop buffer))
-    (error "Implementation does not handle immediate return"))
-  (when (consp buffer) (error "Implementation does not handle error files"))
-  (let ((tramp-display-shell-command-buffer display))
-    (shell-command
-     (mapconcat 'tramp-shell-quote-argument (cons program args) " ")
-     buffer)))
-
-;; File Editing.
+      ;; Tilde expansion if necessary.  This needs a shell which
+      ;; groks tilde expansion!  The function `tramp-find-shell' is
+      ;; supposed to find such a shell on the remote host.  Please
+      ;; tell me about it when this doesn't work on your system.
+      (when (string-match "\\`\\(~[^/]*\\)\\(.*\\)\\'" localname)
+       (let ((uname (match-string 1 localname))
+             (fname (match-string 2 localname)))
+         ;; We cannot simply apply "~/", because under sudo "~/" is
+         ;; expanded to the local user home directory but to the
+         ;; root home directory.  On the other hand, using always
+         ;; the default user name for tilde expansion is not
+         ;; appropriate either, because ssh and companions might
+         ;; use a user name from the config file.
+         (when (and (string-equal uname "~")
+                    (string-match "\\`su\\(do\\)?\\'" method))
+           (setq uname (concat uname user)))
+         (setq uname
+           (with-connection-property v uname
+             (tramp-send-command v (format "cd %s; pwd" uname))
+             (with-current-buffer (tramp-get-buffer v)
+               (goto-char (point-min))
+               (buffer-substring (point) (tramp-line-end-position)))))
+         (setq localname (concat uname fname))))
+      ;; There might be a double slash, for example when "~/"
+      ;; expands to "/". Remove this.
+      (while (string-match "//" localname)
+       (setq localname (replace-match "/" t t localname)))
+      ;; No tilde characters in file name, do normal
+      ;; expand-file-name (this does "/./" and "/../").  We bind
+      ;; `directory-sep-char' here for XEmacs on Windows, which
+      ;; would otherwise use backslash.  `default-directory' is
+      ;; bound, because on Windows there would be problems with UNC
+      ;; shares or Cygwin mounts.
+      (tramp-let-maybe directory-sep-char ?/
+       (let ((default-directory (tramp-temporary-file-directory)))
+         (tramp-make-tramp-file-name
+          method user host
+          (tramp-drop-volume-letter
+           (tramp-run-real-handler 'expand-file-name
+                                   (list localname)))))))))
+
+(defun tramp-handle-substitute-in-file-name (filename)
+  "Like `substitute-in-file-name' for Tramp files.
+\"//\" and \"/~\" substitute only in the local filename part.
+If the URL Tramp syntax is chosen, \"//\" as method delimeter and \"/~\" at
+beginning of local filename are not substituted."
+  (with-parsed-tramp-file-name filename nil
+    (if (equal tramp-syntax 'url)
+       ;; We need to check localname only.  The other parts cannot contain
+       ;; "//" or "/~".
+       (if (and (> (length localname) 1)
+                (or (string-match "//" localname)
+                    (string-match "/~" localname 1)))
+           (tramp-run-real-handler 'substitute-in-file-name (list filename))
+         (tramp-make-tramp-file-name
+          (when method (substitute-in-file-name method))
+          (when user (substitute-in-file-name user))
+          (when host (substitute-in-file-name host))
+          (when localname (substitute-in-file-name localname))))
+      ;; Ignore in LOCALNAME everything before "//" or "/~".
+      (when (and (stringp localname) (string-match ".+?/\\(/\\|~\\)" localname))
+       (setq filename
+             (tramp-make-tramp-file-name
+              method user host (replace-match "\\1" nil nil localname)))
+       ;; "/m:h:~" does not work for completion.  We use "/m:h:~/".
+       (when (string-match "~$" filename)
+         (setq filename (concat filename "/"))))
+      (tramp-run-real-handler 'substitute-in-file-name (list filename)))))
+
+;; In XEmacs, electricity is implemented via a key map for ?/ and ?~,
+;; which calls corresponding functions (see minibuf.el).
+(when (fboundp 'minibuffer-electric-separator)
+  (mapcar
+   '(lambda (x)
+      (eval
+       `(defadvice ,x
+         (around ,(intern (format "tramp-advice-%s" x)) activate)
+         "Invoke `substitute-in-file-name' for Tramp files."
+         (if (and (symbol-value 'minibuffer-electric-file-name-behavior)
+                  (tramp-tramp-file-p (buffer-substring)))
+             ;; We don't need to handle `last-input-event', because
+             ;; due to the key map we know it must be ?/ or ?~.
+             (let ((s (concat (buffer-substring (point-min) (point))
+                              (string last-command-char))))
+               (delete-region (point-min) (point))
+               (insert (substitute-in-file-name s))
+               (setq ad-return-value last-command-char))
+           ad-do-it))))
+
+   '(minibuffer-electric-separator
+     minibuffer-electric-tilde)))
+
+
+;;; Remote commands.
 
 (defsubst tramp-make-temp-file (filename)
   (concat
@@ -3781,91 +3456,276 @@ This will break if COMMAND prints a newline, followed by the value of
                              (tramp-temporary-file-directory)))
    (file-name-extension filename t)))
 
+(defsubst tramp-make-tramp-temp-file (vec)
+  (format
+   "/tmp/%s%s"
+   tramp-temp-name-prefix
+   (if (get-buffer-process (tramp-get-connection-buffer vec))
+       (process-id (get-buffer-process (tramp-get-connection-buffer vec)))
+     (emacs-pid))))
+
+(defun tramp-handle-executable-find (command)
+  "Like `executable-find' for Tramp files."
+  (with-parsed-tramp-file-name default-directory nil
+    (tramp-find-executable v command tramp-remote-path t)))
+
+;; We use BUFFER also as connection buffer during setup. Because of
+;; this, its original contents must be saved, and restored once
+;; connection has been setup.
+(defun tramp-handle-start-file-process (name buffer program &rest args)
+  "Like `start-file-process' for Tramp files."
+  (with-parsed-tramp-file-name default-directory nil
+    (unwind-protect
+       (progn
+         ;; Set the new process properties.
+         (tramp-set-connection-property v "process-name" name)
+         (tramp-set-connection-property
+          v "process-buffer"
+          ;; BUFFER can be nil.
+          (get-buffer-create (or buffer (current-buffer))))
+         ;; Activate narrowing in order to save BUFFER contents.
+         (with-current-buffer (tramp-get-connection-buffer v)
+           (narrow-to-region (point-max) (point-max)))
+         ;; Goto working directory.  `tramp-send-command' opens a new
+         ;; connection.
+         (tramp-send-command
+          v (format "cd %s" (tramp-shell-quote-argument localname)))
+         ;; Send the command.
+         (tramp-send-command
+          v
+          (format "%s; exit"
+                  (mapconcat 'tramp-shell-quote-argument
+                             (cons program args) " "))
+          nil t) ; nooutput
+         ;; Return process.
+         (tramp-get-connection-process v))
+      ;; Save exit.
+      (with-current-buffer (tramp-get-connection-buffer v)
+       (widen)
+       (goto-char (point-max)))
+      (tramp-set-connection-property v "process-name" nil)
+      (tramp-set-connection-property v "process-buffer" nil))))
+
+(defun tramp-handle-process-file
+  (program &optional infile destination display &rest args)
+  "Like `process-file' for Tramp files."
+  ;; The implementation is not complete yet.
+  (when (and (numberp destination) (zerop destination))
+    (error "Implementation does not handle immediate return"))
+
+  (with-parsed-tramp-file-name default-directory nil
+    (let ((temp-name-prefix (tramp-make-tramp-temp-file v))
+         command input stderr outbuf ret)
+      ;; Compute command.
+      (setq command (mapconcat 'tramp-shell-quote-argument
+                              (cons program args) " "))
+      ;; Determine input.
+      (if (null infile)
+         (setq input "/dev/null")
+       (setq infile (expand-file-name infile))
+       (if (tramp-equal-remote default-directory infile)
+           ;; INFILE is on the same remote host.
+           (setq input (with-parsed-tramp-file-name infile nil localname))
+         ;; INFILE must be copied to remote host.
+         (setq input (concat temp-name-prefix ".in"))
+         (copy-file
+          infile
+          (tramp-make-tramp-file-name method user host input)
+          t)))
+      (when input (setq command (format "%s <%s" command input)))
+
+      ;; Determine output.
+      (cond
+       ;; Just a buffer
+       ((bufferp destination)
+       (setq outbuf destination))
+       ;; A buffer name
+       ((stringp destination)
+       (setq outbuf (get-buffer-create destination)))
+       ;; (REAL-DESTINATION ERROR-DESTINATION)
+       ((consp destination)
+       ;; output
+       (cond
+        ((bufferp (car destination))
+         (setq outbuf (car destination)))
+        ((stringp (car destination))
+         (setq outbuf (get-buffer-create (car destination)))))
+       ;; stderr
+       (cond
+        ((stringp (cadr destination))
+         (setcar (cdr destination) (expand-file-name (cadr destination)))
+         (if (tramp-equal-remote default-directory (cadr destination))
+             ;; stderr is on the same remote host.
+             (setq stderr (with-parsed-tramp-file-name
+                              (cadr destination) nil localname))
+           ;; stderr must be copied to remote host.  The temporary
+           ;; file must be deleted after execution.
+           (setq stderr (concat temp-name-prefix ".err"))))
+        ;; stderr to be discarded
+        ((null (cadr destination))
+         (setq stderr "/dev/null"))))
+       ;; 't
+       (destination
+       (setq outbuf (current-buffer))))
+      (when stderr (setq command (format "%s 2>%s" command stderr)))
+
+      ;; If we have a temporary file, it must be removed after operation.
+      (when (and input (string-match temp-name-prefix input))
+       (setq command (format "%s; rm %s" command input)))
+      ;; Goto working directory.
+      (tramp-send-command
+       v (format "cd %s" (tramp-shell-quote-argument localname)))
+      ;; Send the command.  It might not return in time, so we protect it.
+      (condition-case nil
+         (unwind-protect
+             (tramp-send-command v command)
+           ;; We should show the output anyway.
+           (when outbuf
+             (let ((output-string
+                    (with-current-buffer (tramp-get-connection-buffer v)
+                      (buffer-substring (point-min) (point-max)))))
+               (with-current-buffer outbuf
+                 (insert output-string)))
+             (when display (display-buffer outbuf))))
+       ;; When the user did interrupt, we should do it also.
+       (error
+        (kill-buffer (tramp-get-connection-buffer v))
+        (setq ret 1)))
+      (unless ret
+       ;; Check return code.
+       (setq ret (tramp-send-command-and-check v nil))
+       ;; Provide error file.
+       (when (and stderr (string-match temp-name-prefix stderr))
+         (rename-file (tramp-make-tramp-file-name method user host stderr)
+                      (cadr destination) t)))
+      ;; Return exit status.
+      ret)))
+
+(defun tramp-handle-call-process-region
+  (start end program &optional delete buffer display &rest args)
+  "Like `call-process-region' for Tramp files."
+  (let ((tmpfile (tramp-make-temp-file "")))
+    (write-region start end tmpfile)
+    (when delete (delete-region start end))
+    (unwind-protect
+       (apply 'call-process program tmpfile buffer display args)
+      (delete-file tmpfile))))
+
+(defun tramp-handle-shell-command
+  (command &optional output-buffer error-buffer)
+  "Like `shell-command' for Tramp files."
+  (let* ((asynchronous (string-match "[ \t]*&[ \t]*\\'" command))
+        (args (split-string (substring command 0 asynchronous) " "))
+        (output-buffer
+         (cond
+          ((bufferp output-buffer) output-buffer)
+          ((stringp output-buffer) (get-buffer-create output-buffer))
+          (output-buffer (current-buffer))
+          (t (generate-new-buffer
+              (if asynchronous
+                  "*Async Shell Command*"
+                "*Shell Command Output*")))))
+        (error-buffer
+         (cond
+          ((bufferp error-buffer) error-buffer)
+          ((stringp error-buffer) (get-buffer-create error-buffer))))
+        (buffer
+         (if (and (not asynchronous) error-buffer)
+             (with-parsed-tramp-file-name default-directory nil
+               (list output-buffer (tramp-make-tramp-temp-file v)))
+           output-buffer)))
+
+    (prog1
+       ;; Run the process.  We cannot use `process-file' and
+       ;; `start-file-process', because these functions might not
+       ;; exist in older Emacsen.
+       (if (integerp asynchronous)
+           (apply 'tramp-handle-start-file-process
+                  "*Async Shell*" buffer args)
+         (apply 'tramp-handle-process-file
+                (car args) nil buffer nil (cdr args)))
+      ;; Insert error messages if they were separated.
+      (when (listp buffer)
+       (with-current-buffer error-buffer
+         (insert-file-contents (cadr buffer)))
+       (delete-file (buffer-file-name (cadr buffer))))
+      ;; There's some output, display it.
+      (when (with-current-buffer output-buffer (> (point-max) (point-min)))
+       (display-message-or-buffer output-buffer)))))
+
+;; File Editing.
+
+(defvar tramp-handle-file-local-copy-hook nil
+  "Normal hook to be run at the end of `tramp-handle-file-local-copy'.")
+
 (defun tramp-handle-file-local-copy (filename)
-  "Like `file-local-copy' for tramp files."
+  "Like `file-local-copy' for Tramp files."
   (with-parsed-tramp-file-name filename nil
-    (let ((tramp-buf (tramp-get-buffer multi-method method user host))
-         ;; We used to bind the following as late as possible.
-         ;; loc-enc and loc-dec were bound directly before the if
-         ;; statement that checks them.  But the functions
-         ;; tramp-get-* might invoke the "are you awake" check in
-         ;; tramp-maybe-open-connection, which is an unfortunate time
-         ;; since we rely on the buffer contents at that spot.
-         (rem-enc (tramp-get-remote-encoding multi-method method user host))
-         (rem-dec (tramp-get-remote-decoding multi-method method user host))
-         (loc-enc (tramp-get-local-encoding multi-method method user host))
-         (loc-dec (tramp-get-local-decoding multi-method method user host))
+    (let (;; We used to bind the following as late as possible.
+         ;; loc-dec was bound directly before the if statement that
+         ;; checks them.  But the functions tramp-get-* might invoke
+         ;; the "are you awake" check in `tramp-maybe-open-connection',
+         ;; which is an unfortunate time since we rely on the buffer
+         ;; contents at that spot.
+         (rem-enc (tramp-get-remote-coding v "remote-encoding"))
+         (loc-dec (tramp-get-local-coding v "local-decoding"))
          tmpfil)
       (unless (file-exists-p filename)
-       (error "Cannot make local copy of non-existing file `%s'"
-              filename))
+       (tramp-error
+        v 'file-error
+        "Cannot make local copy of non-existing file `%s'" filename))
       (setq tmpfil (tramp-make-temp-file filename))
 
-      (cond ((tramp-method-out-of-band-p multi-method method user host)
+      (cond ((and (tramp-method-out-of-band-p v)
+                 (> (nth 7 (file-attributes filename))
+                    tramp-copy-size-limit))
             ;; `copy-file' handles out-of-band methods
             (copy-file filename tmpfil t t))
 
-           ((and rem-enc rem-dec)
+           (rem-enc
             ;; Use inline encoding for file transfer.
             (save-excursion
-              ;; Following line for setting tramp-current-method,
-              ;; tramp-current-user, tramp-current-host.
-              (set-buffer tramp-buf)
-              (tramp-message 5 "Encoding remote file %s..." filename)
+              (tramp-message v 5 "Encoding remote file %s..." filename)
               (tramp-barf-unless-okay
-               multi-method method user host
+               v
                (concat rem-enc " < " (tramp-shell-quote-argument localname))
-               nil 'file-error
-               "Encoding remote file failed, see buffer `%s' for details"
-               tramp-buf)
-              ;; Remove trailing status code
-              (goto-char (point-max))
-              (delete-region (point) (progn (forward-line -1) (point)))
-
-              (tramp-message 5 "Decoding remote file %s..." filename)
+               "Encoding remote file failed")
 
-              ;; Here is where loc-enc and loc-dec used to be let-bound.
+              (tramp-message v 5 "Decoding remote file %s..." filename)
+              ;; Here is where loc-dec used to be let-bound.
               (if (and (symbolp loc-dec) (fboundp loc-dec))
                   ;; If local decoding is a function, we call it.  We
                   ;; must disable multibyte, because
                   ;; `uudecode-decode-region' doesn't handle it
                   ;; correctly.
-                  (let ((tmpbuf (get-buffer-create " *tramp tmp*")))
-                    (set-buffer tmpbuf)
-                    (erase-buffer)
-                    (set-buffer-multibyte nil)
-                    (insert-buffer-substring tramp-buf)
-                    (tramp-message-for-buffer
-                     multi-method method user host
-                     6 "Decoding remote file %s with function %s..."
-                     filename loc-dec)
-                    (set-buffer tmpbuf)
-                    ;; Douglas Gray Stephens <DGrayStephens@slb.com>
-                    ;; says that we need to strip tramp_exit_status
-                    ;; line from the output here.  Go to point-max,
-                    ;; search backward for tramp_exit_status, delete
-                    ;; between point and point-max if found.
-                    (let ((coding-system-for-write 'binary))
-                      (funcall loc-dec (point-min) (point-max))
-                      (write-region (point-min) (point-max) tmpfil))
-                    (kill-buffer tmpbuf))
+                  (unwind-protect
+                      (with-temp-buffer
+                        (set-buffer-multibyte nil)
+                        (insert-buffer-substring (tramp-get-buffer v))
+                        (tramp-message
+                         v 5 "Decoding remote file %s with function %s..."
+                         filename loc-dec)
+                        (funcall loc-dec (point-min) (point-max))
+                        (let ((coding-system-for-write 'binary))
+                          (write-region (point-min) (point-max) tmpfil))))
                 ;; If tramp-decoding-function is not defined for this
                 ;; method, we invoke tramp-decoding-command instead.
                 (let ((tmpfil2 (tramp-make-temp-file filename)))
-                  (write-region (point-min) (point-max) tmpfil2)
+                  (let ((coding-system-for-write 'binary))
+                    (write-region (point-min) (point-max) tmpfil2))
                   (tramp-message
-                   6 "Decoding remote file %s with command %s..."
+                   v 5 "Decoding remote file %s with command %s..."
                    filename loc-dec)
                   (tramp-call-local-coding-command
                    loc-dec tmpfil2 tmpfil)
                   (delete-file tmpfil2)))
-              (tramp-message-for-buffer
-               multi-method method user host
-               5 "Decoding remote file %s...done" filename)
+              (tramp-message v 5 "Decoding remote file %s...done" filename)
               ;; Set proper permissions.
               (set-file-modes tmpfil (file-modes filename))))
 
-           (t (error "Wrong method specification for `%s'" method)))
+           (t (tramp-error
+               v 'file-error "Wrong method specification for `%s'" method)))
+      (run-hooks 'tramp-handle-file-local-copy-hook)
       tmpfil)))
 
 (defun tramp-handle-file-remote-p (filename &optional identification connected)
@@ -3873,19 +3733,17 @@ This will break if COMMAND prints a newline, followed by the value of
   (when (tramp-tramp-file-p filename)
     (with-parsed-tramp-file-name filename nil
       (and (or (not connected)
-              (let ((p (get-buffer-process
-                        (tramp-get-buffer multi-method method user host))))
+              (let ((p (tramp-get-connection-process v)))
                 (and p (processp p) (memq (process-status p) '(run open)))))
           (cond
            ((eq identification 'method) method)
            ((eq identification 'user) user)
            ((eq identification 'host) host)
-           (t (tramp-make-tramp-file-name
-               multi-method method user host "")))))))
+           (t (tramp-make-tramp-file-name method user host "")))))))
 
 (defun tramp-handle-insert-file-contents
   (filename &optional visit beg end replace)
-  "Like `insert-file-contents' for tramp files."
+  "Like `insert-file-contents' for Tramp files."
   (barf-if-buffer-read-only)
   (setq filename (expand-file-name filename))
   (with-parsed-tramp-file-name filename nil
@@ -3895,8 +3753,8 @@ This will break if COMMAND prints a newline, followed by the value of
            (setq buffer-file-name filename)
            (set-visited-file-modtime)
            (set-buffer-modified-p nil))
-         (signal 'file-error
-                 (format "File `%s' not found on remote host" filename))
+         (tramp-error
+          v 'file-error "File %s not found on remote host" filename)
          (list (expand-file-name filename) 0))
       ;; `insert-file-contents-literally' takes care to avoid calling
       ;; jka-compr.  By let-binding inhibit-file-name-operation, we
@@ -3908,9 +3766,7 @@ This will break if COMMAND prints a newline, followed by the value of
                      'file-local-copy)))
               (file-local-copy filename)))
            coding-system-used result)
-       (tramp-message-for-buffer
-        multi-method method user host
-        9 "Inserting local temp file `%s'..." local-copy)
+       (tramp-message v 4 "Inserting local temp file `%s'..." local-copy)
        (setq result (insert-file-contents local-copy nil beg end replace))
        (when visit
          (setq buffer-file-name filename)
@@ -3919,9 +3775,7 @@ This will break if COMMAND prints a newline, followed by the value of
        ;; Now `last-coding-system-used' has right value.  Remember it.
        (when (boundp 'last-coding-system-used)
          (setq coding-system-used (symbol-value 'last-coding-system-used)))
-       (tramp-message-for-buffer
-        multi-method method user host
-        9 "Inserting local temp file `%s'...done" local-copy)
+       (tramp-message v 4 "Inserting local temp file `%s'...done" local-copy)
        (delete-file local-copy)
        (when (boundp 'last-coding-system-used)
          (set 'last-coding-system-used coding-system-used))
@@ -3930,7 +3784,7 @@ This will break if COMMAND prints a newline, followed by the value of
 
 
 (defun tramp-handle-find-backup-file-name (filename)
-  "Like `find-backup-file-name' for tramp files."
+  "Like `find-backup-file-name' for Tramp files."
   (with-parsed-tramp-file-name filename nil
     ;; We set both variables. It doesn't matter whether it is
     ;; Emacs or XEmacs
@@ -3945,8 +3799,7 @@ This will break if COMMAND prints a newline, followed by the value of
                      (if (and (stringp (cdr x))
                               (file-name-absolute-p (cdr x))
                               (not (tramp-file-name-p (cdr x))))
-                         (tramp-make-tramp-file-name
-                          multi-method method user host (cdr x))
+                         (tramp-make-tramp-file-name method user host (cdr x))
                        (cdr x))))
                  (symbol-value 'tramp-backup-directory-alist))
               (symbol-value 'backup-directory-alist))))
@@ -3964,7 +3817,7 @@ This will break if COMMAND prints a newline, followed by the value of
                                (file-name-absolute-p (car (cdr x)))
                                (not (tramp-file-name-p (car (cdr x)))))
                           (tramp-make-tramp-file-name
-                           multi-method method user host (car (cdr x)))
+                           method user host (car (cdr x)))
                         (car (cdr x))))
                      (cdr (cdr x))))
                  (symbol-value 'tramp-bkup-backup-directory-info))
@@ -3973,9 +3826,18 @@ This will break if COMMAND prints a newline, followed by the value of
       (tramp-run-real-handler 'find-backup-file-name (list filename)))))
 
 (defun tramp-handle-make-auto-save-file-name ()
-  "Like `make-auto-save-file-name' for tramp files.
+  "Like `make-auto-save-file-name' for Tramp files.
 Returns a file name in `tramp-auto-save-directory' for autosaving this file."
-  (let ((tramp-auto-save-directory tramp-auto-save-directory))
+  (let ((tramp-auto-save-directory tramp-auto-save-directory)
+       (buffer-file-name
+        (tramp-subst-strs-in-string
+         '(("_" . "|")
+           ("/" . "_a")
+           (":" . "_b")
+           ("|" . "__")
+           ("[" . "_l")
+           ("]" . "_r"))
+         (buffer-file-name))))
     ;; File name must be unique.  This is ensured with Emacs 22 (see
     ;; UNIQUIFY element of `auto-save-file-name-transforms'); but for
     ;; all other cases we must do it ourselves.
@@ -3990,68 +3852,49 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file."
        (symbol-value 'auto-save-file-name-transforms)))
     ;; Create directory.
     (when tramp-auto-save-directory
+      (setq buffer-file-name
+           (expand-file-name buffer-file-name tramp-auto-save-directory))
       (unless (file-exists-p tramp-auto-save-directory)
        (make-directory tramp-auto-save-directory t)))
-    ;; jka-compr doesn't like auto-saving, so by appending "~" to the
-    ;; file name we make sure that jka-compr isn't used for the
-    ;; auto-save file.
-    (let ((buffer-file-name
-          (if tramp-auto-save-directory
-              (expand-file-name
-               (tramp-subst-strs-in-string
-                '(("_" . "|")
-                  ("/" . "_a")
-                  (":" . "_b")
-                  ("|" . "__")
-                  ("[" . "_l")
-                  ("]" . "_r"))
-                (buffer-file-name))
-               tramp-auto-save-directory)
-            (buffer-file-name))))
-      ;; Run plain `make-auto-save-file-name'.  There might be an advice when
-      ;; it is not a magic file name operation (since Emacs 22).
-      ;; We must deactivate it temporarily.
-      (if (not (ad-is-active 'make-auto-save-file-name))
-         (tramp-run-real-handler
-          'make-auto-save-file-name nil)
-       ;; else
-       (ad-deactivate 'make-auto-save-file-name)
-       (prog1
-           (tramp-run-real-handler
-            'make-auto-save-file-name nil)
-         (ad-activate 'make-auto-save-file-name))))))
-
-
-;; CCC grok APPEND, LOCKNAME, CONFIRM
+    ;; Run plain `make-auto-save-file-name'.  There might be an advice when
+    ;; it is not a magic file name operation (since Emacs 22).
+    ;; We must deactivate it temporarily.
+    (if (not (ad-is-active 'make-auto-save-file-name))
+       (tramp-run-real-handler 'make-auto-save-file-name nil)
+      ;; else
+      (ad-deactivate 'make-auto-save-file-name)
+      (prog1
+       (tramp-run-real-handler 'make-auto-save-file-name nil)
+       (ad-activate 'make-auto-save-file-name)))))
+
+(defvar tramp-handle-write-region-hook nil
+  "Normal hook to be run at the end of `tramp-handle-write-region'.")
+
+;; CCC grok APPEND, LOCKNAME
 (defun tramp-handle-write-region
   (start end filename &optional append visit lockname confirm)
-  "Like `write-region' for tramp files."
-  (unless (eq append nil)
-    (error "Cannot append to file using tramp (`%s')" filename))
+  "Like `write-region' for Tramp files."
   (setq filename (expand-file-name filename))
-  ;; Following part commented out because we don't know what to do about
-  ;; file locking, and it does not appear to be a problem to ignore it.
-  ;; Ange-ftp ignores it, too.
-  ;;  (when (and lockname (stringp lockname))
-  ;;    (setq lockname (expand-file-name lockname)))
-  ;;  (unless (or (eq lockname nil)
-  ;;              (string= lockname filename))
-  ;;    (error
-  ;;     "tramp-handle-write-region: LOCKNAME must be nil or equal FILENAME"))
-  ;; XEmacs takes a coding system as the seventh argument, not `confirm'
-  (when (and (not (featurep 'xemacs))
-            confirm (file-exists-p filename))
-    (unless (y-or-n-p (format "File %s exists; overwrite anyway? "
-                              filename))
-      (error "File not overwritten")))
   (with-parsed-tramp-file-name filename nil
-    (let ((curbuf (current-buffer))
-         (rem-enc (tramp-get-remote-encoding multi-method method user host))
-         (rem-dec (tramp-get-remote-decoding multi-method method user host))
-         (loc-enc (tramp-get-local-encoding multi-method method user host))
-         (loc-dec (tramp-get-local-decoding multi-method method user host))
-         (trampbuf (get-buffer-create "*tramp output*"))
-         (modes (file-modes filename))
+    (unless (null append)
+      (tramp-error
+       v 'file-error "Cannot append to file using Tramp (`%s')" filename))
+    ;; Following part commented out because we don't know what to do about
+    ;; file locking, and it does not appear to be a problem to ignore it.
+    ;; Ange-ftp ignores it, too.
+    ;;  (when (and lockname (stringp lockname))
+    ;;    (setq lockname (expand-file-name lockname)))
+    ;;  (unless (or (eq lockname nil)
+    ;;              (string= lockname filename))
+    ;;    (error
+    ;;     "tramp-handle-write-region: LOCKNAME must be nil or equal FILENAME"))
+    ;; XEmacs takes a coding system as the seventh argument, not `confirm'
+    (when (and (not (featurep 'xemacs)) confirm (file-exists-p filename))
+      (unless (y-or-n-p (format "File %s exists; overwrite anyway? " filename))
+       (tramp-error v 'file-error "File not overwritten")))
+    (let ((rem-dec (tramp-get-remote-coding v "remote-decoding"))
+         (loc-enc (tramp-get-local-coding v "local-encoding"))
+         (modes (save-excursion (file-modes filename)))
          ;; We use this to save the value of `last-coding-system-used'
          ;; after writing the tmp file.  At the end of the function,
          ;; we set `last-coding-system-used' to this saved value.
@@ -4059,14 +3902,10 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file."
          ;; talking to the remote shell or suchlike won't hose this
          ;; variable.  This approach was snarfed from ange-ftp.el.
          coding-system-used
-         tmpfil)
-      ;; Write region into a tmp file.  This isn't really needed if we
-      ;; use an encoding function, but currently we use it always
-      ;; because this makes the logic simpler.
-      (setq tmpfil (tramp-make-temp-file filename))
-      ;; Set current buffer.  If connection wasn't open, `file-modes' has
-      ;; changed it accidently.
-      (set-buffer curbuf)
+         ;; Write region into a tmp file.  This isn't really needed if we
+         ;; use an encoding function, but currently we use it always
+         ;; because this makes the logic simpler.
+         (tmpfil (tramp-make-temp-file filename)))
       ;; We say `no-message' here because we don't want the visited file
       ;; modtime data to be clobbered from the temp file.  We call
       ;; `set-visited-file-modtime' ourselves later on.
@@ -4089,96 +3928,106 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file."
       ;; decoding command must be specified.  However, if the method
       ;; _also_ specifies an encoding function, then that is used for
       ;; encoding the contents of the tmp file.
-      (cond ((tramp-method-out-of-band-p multi-method method user host)
+      (cond ((and (tramp-method-out-of-band-p v)
+                 (integerp start)
+                 (> (- end start) tramp-copy-size-limit))
             ;; `copy-file' handles out-of-band methods
             (copy-file tmpfil filename t t))
 
-           ((and rem-enc rem-dec)
+           (rem-dec
             ;; Use inline file transfer
-            (let ((tmpbuf (get-buffer-create " *tramp file transfer*")))
-              (save-excursion
-                ;; Encode tmpfil into tmpbuf
-                (tramp-message-for-buffer multi-method method user host
-                                          5 "Encoding region...")
-                (set-buffer tmpbuf)
-                (erase-buffer)
-                ;; Use encoding function or command.
-                (if (and (symbolp loc-enc) (fboundp loc-enc))
-                    (progn
-                      (tramp-message-for-buffer
-                       multi-method method user host
-                       6 "Encoding region using function `%s'..."
-                       (symbol-name loc-enc))
-                      (insert-file-contents-literally tmpfil)
-                      ;; CCC.  The following `let' is a workaround for
-                      ;; the base64.el that comes with pgnus-0.84.  If
-                      ;; both of the following conditions are
-                      ;; satisfied, it tries to write to a local file
-                      ;; in default-directory, but at this point,
-                      ;; default-directory is remote.
-                      ;; (CALL-PROCESS-REGION can't write to remote
-                      ;; files, it seems.)  The file in question is a
-                      ;; tmp file anyway.
-                      (let ((default-directory
-                              (tramp-temporary-file-directory)))
-                        (funcall loc-enc (point-min) (point-max)))
-                      (goto-char (point-max))
-                      (unless (bolp)
-                        (newline)))
-                  (tramp-message-for-buffer
-                   multi-method method user host
-                   6 "Encoding region using command `%s'..." loc-enc)
-                  (unless (equal 0 (tramp-call-local-coding-command
-                                    loc-enc tmpfil t))
-                    (pop-to-buffer trampbuf)
-                    (error (concat "Cannot write to `%s', local encoding"
-                                   " command `%s' failed")
-                           filename loc-enc)))
-                ;; Send tmpbuf into remote decoding command which
-                ;; writes to remote file.  Because this happens on the
-                ;; remote host, we cannot use the function.
-                (tramp-message-for-buffer
-                 multi-method method user host
-                 5 "Decoding region into remote file %s..." filename)
-                (tramp-send-command
-                 multi-method method user host
-                 (format "%s >%s <<'EOF'"
-                         rem-dec
-                         (tramp-shell-quote-argument localname)))
-                (set-buffer tmpbuf)
-                (tramp-message-for-buffer
-                 multi-method method user host
-                 6 "Sending data to remote host...")
-                (tramp-send-string multi-method method user host
-                                   (buffer-string))
-                ;; wait for remote decoding to complete
-                (tramp-message-for-buffer
-                 multi-method method user host
-                 6 "Sending end of data token...")
-                (tramp-send-command
-                 multi-method method user host "EOF" nil t)
-                (tramp-message-for-buffer
-                 multi-method method user host 6
-                 "Waiting for remote host to process data...")
-                (set-buffer (tramp-get-buffer multi-method method user host))
-                (tramp-wait-for-output)
-                (tramp-barf-unless-okay
-                 multi-method method user host nil nil 'file-error
-                 (concat "Couldn't write region to `%s',"
-                         " decode using `%s' failed")
-                 filename rem-dec)
-                (tramp-message 5 "Decoding region into remote file %s...done"
-                               filename)
-                (kill-buffer tmpbuf))))
+            ;; Encode tmpfil
+            (tramp-message v 5 "Encoding region...")
+            (unwind-protect
+                (with-temp-buffer
+                  ;; Use encoding function or command.
+                  (if (and (symbolp loc-enc) (fboundp loc-enc))
+                      (progn
+                        (tramp-message
+                         v 5 "Encoding region using function `%s'..."
+                         (symbol-name loc-enc))
+                        (let ((coding-system-for-read 'binary))
+                          (insert-file-contents-literally tmpfil))
+                        ;; CCC.  The following `let' is a workaround for
+                        ;; the base64.el that comes with pgnus-0.84.  If
+                        ;; both of the following conditions are
+                        ;; satisfied, it tries to write to a local file
+                        ;; in default-directory, but at this point,
+                        ;; default-directory is remote.
+                        ;; (CALL-PROCESS-REGION can't write to remote
+                        ;; files, it seems.)  The file in question is a
+                        ;; tmp file anyway.
+                        (let ((default-directory
+                                (tramp-temporary-file-directory)))
+                          (funcall loc-enc (point-min) (point-max))))
+
+                    (tramp-message
+                     v 5 "Encoding region using command `%s'..." loc-enc)
+                    (unless (equal 0 (tramp-call-local-coding-command
+                                      loc-enc tmpfil t))
+                      (tramp-error
+                       v 'file-error
+                       (concat "Cannot write to `%s', local encoding"
+                               " command `%s' failed")
+                       filename loc-enc)))
+
+                  ;; Send buffer into remote decoding command which
+                  ;; writes to remote file.  Because this happens on the
+                  ;; remote host, we cannot use the function.
+                  (goto-char (point-max))
+                  (unless (bolp) (newline))
+                  (tramp-message
+                   v 5 "Decoding region into remote file %s..." filename)
+                  (tramp-send-command
+                   v
+                   (format
+                    "%s >%s <<'EOF'\n%sEOF"
+                    rem-dec
+                    (tramp-shell-quote-argument localname)
+                    (buffer-string)))
+                  (tramp-barf-unless-okay
+                   v nil
+                   (concat "Couldn't write region to `%s',"
+                           " decode using `%s' failed")
+                   filename rem-dec)
+                  ;; When `file-precious-flag' is set, the region is
+                  ;; written to a temporary file.  Check that the
+                  ;; checksum is equal to that from the local tmpfil.
+                  (when file-precious-flag
+                    (erase-buffer)
+                    (and
+                     ;; cksum runs locally
+                     (let ((default-directory
+                             (tramp-temporary-file-directory)))
+                       (zerop (call-process "cksum" tmpfil t)))
+                     ;; cksum runs remotely
+                     (zerop
+                      (tramp-send-command-and-check
+                       v
+                       (format
+                        "cksum <%s"
+                        (tramp-shell-quote-argument localname))))
+                     ;; ... they are different
+                     (not
+                      (string-equal
+                       (buffer-string)
+                       (with-current-buffer (tramp-get-buffer v)
+                         (buffer-string))))
+                     (tramp-error
+                      v 'file-error
+                      (concat "Couldn't write region to `%s',"
+                              " decode using `%s' failed")
+                      filename rem-dec)))
+                  (tramp-message
+                   v 5 "Decoding region into remote file %s...done" filename)
+                  (tramp-flush-file-property v localname))))
            (t
-            (error
+            (tramp-error
+             v 'file-error
              (concat "Method `%s' should specify both encoding and "
                      "decoding command or an rcp program")
              method)))
       (delete-file tmpfil)
-      (unless (equal curbuf (current-buffer))
-       (error "Buffer has changed from `%s' to `%s'"
-              curbuf (current-buffer)))
       (when (or (eq visit t) (stringp visit))
        (set-visited-file-modtime
         ;; We must pass modtime explicitely, because filename can be different
@@ -4187,41 +4036,9 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file."
       ;; Make `last-coding-system-used' have the right value.
       (when (boundp 'last-coding-system-used)
        (set 'last-coding-system-used coding-system-used))
-      (when (or (eq visit t)
-               (eq visit nil)
-               (stringp visit))
-       (message "Wrote %s" filename)))))
-
-;; Call down to the real handler.
-;; Because EFS does not play nicely with TRAMP (both systems match a
-;; TRAMP file name) it is needed to disable efs as well as tramp for the
-;; operation.
-;;
-;; Other than that, this is the canon file-handler code that the doco
-;; says should be used here. Which is nice.
-;;
-;; Under XEmacs current, EFS also hooks in as
-;; efs-sifn-handler-function to handle any filename with environment
-;; variables. This has two implications:
-;; 1) That EFS may not be completely dead (yet) for TRAMP filenames
-;; 2) That TRAMP might want to do the same thing.
-;; Details as they come in.
-;;
-;; Daniel Pittman <daniel@danann.net>
-
-;; (defun tramp-run-real-handler (operation args)
-;;   "Invoke normal file name handler for OPERATION.
-;; This inhibits EFS and Ange-FTP, too, because they conflict with tramp.
-;; First arg specifies the OPERATION, remaining ARGS are passed to the
-;; OPERATION."
-;;   (let ((inhibit-file-name-handlers
-;;          (list 'tramp-file-name-handler
-;;            'efs-file-handler-function
-;;                'ange-ftp-hook-function
-;;                (and (eq inhibit-file-name-operation operation)
-;;                     inhibit-file-name-handlers)))
-;;         (inhibit-file-name-operation operation))
-;;     (apply operation args)))
+      (when (or (eq visit t) (null visit) (stringp visit))
+       (tramp-message v 0 "Wrote %s" filename))
+      (run-hooks 'tramp-handle-write-region-hook))))
 
 ;;;###autoload
 (progn (defun tramp-run-real-handler (operation args)
@@ -4239,10 +4056,6 @@ pass to the OPERATION."
         (inhibit-file-name-operation operation))
     (apply operation args))))
 
-;; This function is used from `tramp-completion-file-name-handler' functions
-;; only, if `tramp-completion-mode' is true. But this cannot be checked here
-;; because the check is based on a full filename, not available for all
-;; basic I/O operations.
 ;;;###autoload
 (progn (defun tramp-completion-run-real-handler (operation args)
   "Invoke `tramp-file-name-handler' for OPERATION.
@@ -4287,6 +4100,8 @@ ARGS are the arguments OPERATION has been called with."
                  'load 'make-directory 'make-directory-internal
                  'set-file-modes 'substitute-in-file-name
                  'unhandled-file-name-directory 'vc-registered
+                 ; Emacs 22 only
+                 'set-file-times
                  ; XEmacs only
                  'abbreviate-file-name 'create-file-buffer
                  'dired-file-modtime 'dired-make-compressed-filename
@@ -4315,28 +4130,37 @@ ARGS are the arguments OPERATION has been called with."
     (nth 2 args))
    ; BUF
    ((member operation
-           (list 'make-auto-save-file-name
-                 'set-visited-file-modtime 'verify-visited-file-modtime
-                 ; XEmacs only
+           (list 'set-visited-file-modtime 'verify-visited-file-modtime
+                  ; Emacs 22 only
+                 'make-auto-save-file-name
+                 ; XEmacs only
                  'backup-buffer))
     (buffer-file-name
      (if (bufferp (nth 0 args)) (nth 0 args) (current-buffer))))
    ; COMMAND
    ((member operation
-           (list 'dired-call-process
+           (list ; not in Emacs 23
+                 'dired-call-process
                   ; Emacs only
                  'shell-command
-                  ; Emacs 22 only
+                  ; since Emacs 22 only
                   'process-file
+                  ; since Emacs 23 only
+                  'start-file-process
                  ; XEmacs only
-                 'dired-print-file 'dired-shell-call-process))
+                 'dired-print-file 'dired-shell-call-process
+                 ; nowhere yet
+                 'executable-find 'start-process 'call-process))
     default-directory)
    ; unknown file primitive
    (t (error "unknown file I/O primitive: %s" operation))))
 
 (defun tramp-find-foreign-file-name-handler (filename)
   "Return foreign file name handler if exists."
-  (when (tramp-tramp-file-p filename)
+  (when (and (stringp filename) (tramp-tramp-file-p filename)
+            (or (not (tramp-completion-mode))
+                (not (string-match
+                      tramp-completion-file-name-regexp filename))))
     (let (elt
          res
          (handler-alist tramp-foreign-file-name-handler-alist))
@@ -4353,15 +4177,13 @@ ARGS are the arguments OPERATION has been called with."
 (defun tramp-file-name-handler (operation &rest args)
   "Invoke Tramp file name handler.
 Falls back to normal file name handler if no tramp file name handler exists."
-;;  (setq edebug-trace t)
-;;  (edebug-trace "%s" (with-output-to-string (backtrace)))
   (save-match-data
     (let* ((filename (apply 'tramp-file-name-for-operation operation args))
-          (completion (tramp-completion-mode filename))
+          (completion (tramp-completion-mode))
           (foreign (tramp-find-foreign-file-name-handler filename)))
       (with-parsed-tramp-file-name filename nil
        (cond
-        ;; When we are in completion mode, some operations shouldn' be
+        ;; When we are in completion mode, some operations shouldn't be
         ;; handled by backend.
         ((and completion (zerop (length localname))
               (memq operation '(file-exists-p file-directory-p)))
@@ -4369,12 +4191,15 @@ Falls back to normal file name handler if no tramp file name handler exists."
         ((and completion (zerop (length localname))
               (memq operation '(file-name-as-directory)))
          filename)
-        ;; Call the backend function.
-        (foreign (apply foreign operation args))
+        ;; Call the backend function.  Set a connection property
+        ;; first, it will be reused for user/host name completion.
+        (foreign
+         (unless (zerop (length localname))
+           (tramp-set-connection-property v "started" nil))
+         (apply foreign operation args))
         ;; Nothing to do for us.
         (t (tramp-run-real-handler operation args)))))))
 
-
 ;; In Emacs, there is some concurrency due to timers.  If a timer
 ;; interrupts Tramp and wishes to use the same connection buffer as
 ;; the "main" Emacs, then garbage might occur in the connection
@@ -4406,7 +4231,7 @@ preventing reentrant calls of Tramp.")
   "Invoke remote-shell Tramp file name handler.
 Fall back to normal file name handler if no Tramp handler exists."
   (when (and tramp-locked (not tramp-locker))
-    (signal 'file-error "Forbidden reentrant call of Tramp"))
+    (signal 'file-error (list "Forbidden reentrant call of Tramp")))
   (let ((tl tramp-locked))
     (unwind-protect
        (progn
@@ -4425,6 +4250,11 @@ Fall back to normal file name handler if no Tramp handler exists."
 Falls back to normal file name handler if no tramp file name handler exists."
 ;;  (setq edebug-trace t)
 ;;  (edebug-trace "%s" (with-output-to-string (backtrace)))
+
+;;  (mapcar 'trace-function-background
+;;       (mapcar 'intern
+;;               (all-completions "tramp-" obarray 'functionp)))
+
   (let ((fn (assoc operation tramp-completion-file-name-handler-alist)))
     (if fn
        (save-match-data (apply (cdr fn) args))
@@ -4433,6 +4263,11 @@ Falls back to normal file name handler if no tramp file name handler exists."
 ;;;###autoload
 (defsubst tramp-register-file-name-handler ()
   "Add tramp file name handler to `file-name-handler-alist'."
+  ;; Remove autoloaded handler from file name handler alist.  Useful,
+  ;; if `tramp-syntax' has been changed.
+  (let ((a1 (rassq 'tramp-file-name-handler file-name-handler-alist)))
+    (setq file-name-handler-alist (delete a1 file-name-handler-alist)))
+  ;; Add the handler.
   (add-to-list 'file-name-handler-alist
               (cons tramp-file-name-regexp 'tramp-file-name-handler))
   ;; If jka-compr is already loaded, move it to the front of
@@ -4442,9 +4277,20 @@ Falls back to normal file name handler if no tramp file name handler exists."
       (setq file-name-handler-alist
            (cons jka (delete jka file-name-handler-alist))))))
 
+;; `tramp-file-name-handler' must be registered before evaluation of
+;; site-start and init files, because there might exist remote files
+;; already, f.e. files kept via recentf-mode.
+;;;###autoload(tramp-register-file-name-handler)
+(tramp-register-file-name-handler)
+
 ;;;###autoload
 (defsubst tramp-register-completion-file-name-handler ()
   "Add tramp completion file name handler to `file-name-handler-alist'."
+  ;; Remove autoloaded handler from file name handler alist.  Useful,
+  ;; if `tramp-syntax' has been changed.
+  (let ((a1 (rassq
+            'tramp-completion-file-name-handler file-name-handler-alist)))
+    (setq file-name-handler-alist (delete a1 file-name-handler-alist)))
   ;; `partial-completion-mode' is unknown in XEmacs.  So we should
   ;; load it unconditionally there.  In the GNU Emacs case, method/
   ;; user/host name completion shall be bound to `partial-completion-mode'.
@@ -4462,17 +4308,12 @@ Falls back to normal file name handler if no tramp file name handler exists."
       (setq file-name-handler-alist
            (cons jka (delete jka file-name-handler-alist))))))
 
-;; `tramp-file-name-handler' must be registered before evaluation of
-;; site-start and init files, because there might exist remote files
-;; already, f.e. files kept via recentf-mode.
-;;;###autoload(tramp-register-file-name-handler)
 ;; During autoload, it shall be checked whether
 ;; `partial-completion-mode' is active.  Therefore registering of
 ;; `tramp-completion-file-name-handler' will be delayed.
 ;;;###autoload(add-hook
 ;;;###autoload 'after-init-hook
 ;;;###autoload '(lambda () (tramp-register-completion-file-name-handler)))
-(tramp-register-file-name-handler)
 (tramp-register-completion-file-name-handler)
 
 ;;;###autoload
@@ -4486,20 +4327,19 @@ Falls back to normal file name handler if no tramp file name handler exists."
 
 (add-hook 'tramp-unload-hook 'tramp-unload-file-name-handlers)
 
-
 ;;; Interactions with other packages:
 
 ;; -- complete.el --
 
 ;; This function contributed by Ed Sabol
 (defun tramp-handle-expand-many-files (name)
-  "Like `PC-expand-many-files' for tramp files."
+  "Like `PC-expand-many-files' for Tramp files."
   (with-parsed-tramp-file-name name nil
     (save-match-data
       (if (or (string-match "\\*" name)
              (string-match "\\?" name)
              (string-match "\\[.*\\]" name))
-         (save-excursion
+         (progn
            (let (bufstr)
              ;; CCC: To do it right, we should quote certain characters
              ;; in the file name, but since the echo command is going to
@@ -4509,37 +4349,34 @@ Falls back to normal file name handler if no tramp file name handler exists."
              ;;-       (set-difference tramp-file-name-quote-list
              ;;-                       '(?\* ?\? ?[ ?]))))
              ;;-  (tramp-send-command
-             ;;-   multi-method method user host
-             ;;-   (format "echo %s" (comint-quote-filename localname)))
-             ;;-  (tramp-wait-for-output))
-             (tramp-send-command multi-method method user host
-                                 (format "echo %s" localname))
-             (tramp-wait-for-output)
+             ;;-   method user host
+             ;;-   (format "echo %s" (comint-quote-filename localname))))
+             (tramp-send-command v (format "echo %s" localname))
              (setq bufstr (buffer-substring (point-min)
                                             (tramp-line-end-position)))
-             (goto-char (point-min))
-             (if (string-equal localname bufstr)
-                 nil
-               (insert "(\"")
-               (while (search-forward " " nil t)
-                 (delete-backward-char 1)
-                 (insert "\" \""))
-               (goto-char (point-max))
-               (delete-backward-char 1)
-               (insert "\")")
+             (with-current-buffer (tramp-get-buffer v)
                (goto-char (point-min))
-               (mapcar
-                (function (lambda (x)
-                            (tramp-make-tramp-file-name multi-method method
-                                                        user host x)))
-                (read (current-buffer))))))
+               (if (string-equal localname bufstr)
+                   nil
+                 (insert "(\"")
+                 (while (search-forward " " nil t)
+                   (delete-backward-char 1)
+                   (insert "\" \""))
+                 (goto-char (point-max))
+                 (delete-backward-char 1)
+                 (insert "\")")
+                 (goto-char (point-min))
+                 (mapcar
+                  (function (lambda (x)
+                              (tramp-make-tramp-file-name method user host x)))
+                  (read (current-buffer)))))))
        (list (expand-file-name name))))))
 
 (eval-after-load "complete"
   '(progn
      (defadvice PC-expand-many-files
        (around tramp-advice-PC-expand-many-files (name) activate)
-       "Invoke `tramp-handle-expand-many-files' for tramp files."
+       "Invoke `tramp-handle-expand-many-files' for Tramp files."
        (if (tramp-tramp-file-p name)
           (setq ad-return-value (tramp-handle-expand-many-files name))
         ad-do-it))
@@ -4548,142 +4385,118 @@ Falls back to normal file name handler if no tramp file name handler exists."
 
 ;;; File name handler functions for completion mode
 
-(defvar tramp-completion-mode nil
-  "If non-nil, we are in file name completion mode.")
-
 ;; Necessary because `tramp-file-name-regexp-unified' and
-;; `tramp-completion-file-name-regexp-unified' aren't different.
-;; If nil, `tramp-completion-run-real-handler' is called (i.e. forwarding to
-;; `tramp-file-name-handler'). Otherwise, it takes `tramp-run-real-handler'.
-;; Using `last-input-event' is a little bit risky, because completing a file
-;; might require loading other files, like "~/.netrc", and for them it
-;; shouldn't be decided based on that variable. On the other hand, those files
-;; shouldn't have partial tramp file name syntax. Maybe another variable should
-;; be introduced overwriting this check in such cases. Or we change tramp
-;; file name syntax in order to avoid ambiguities, like in XEmacs ...
-;; In case of non unified file names it can be always true (and wouldn't be
-;; necessary, because there are different regexp).
-(defun tramp-completion-mode (file)
+;; `tramp-completion-file-name-regexp-unified' aren't different.  If
+;; nil, `tramp-completion-run-real-handler' is called (i.e. forwarding
+;; to `tramp-file-name-handler'). Otherwise, it takes
+;; `tramp-run-real-handler'.  Using `last-input-event' is a little bit
+;; risky, because completing a file might require loading other files,
+;; like "~/.netrc", and for them it shouldn't be decided based on that
+;; variable. On the other hand, those files shouldn't have partial
+;; tramp file name syntax. Maybe another variable should be introduced
+;; overwriting this check in such cases. Or we change tramp file name
+;; syntax in order to avoid ambiguities, like in XEmacs ...
+(defun tramp-completion-mode ()
   "Checks whether method / user name / host name completion is active."
-  (cond
-   (tramp-completion-mode t)
-   ((string-match "^/.*:.*:$" file) nil)
-   ((string-match
-     (concat tramp-prefix-regexp
-      "\\(" tramp-method-regexp  "\\)" tramp-postfix-single-method-regexp "$")
-     file)
-    (member (match-string 1 file) (mapcar 'car tramp-methods)))
-   ((or (equal last-input-event 'tab)
-       ;; Emacs
-       (and (natnump last-input-event)
-            (or
-             ;; ?\t has event-modifier 'control
-             (char-equal last-input-event ?\t)
-             (and (not (event-modifiers last-input-event))
-                  (or (char-equal last-input-event ?\?)
-                      (char-equal last-input-event ?\ )))))
-       ;; XEmacs
-       (and (featurep 'xemacs)
-            ;; `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)
-            (or
-             ;; ?\t has event-modifier 'control
-             (char-equal
-              (funcall (symbol-function 'event-to-character)
-                       last-input-event) ?\t)
-             (and (not (event-modifiers last-input-event))
-                  (or (char-equal
-                       (funcall (symbol-function 'event-to-character)
-                                last-input-event) ?\?)
-                      (char-equal
-                       (funcall (symbol-function 'event-to-character)
-                                last-input-event) ?\ ))))))
-    t)))
+  (or (equal last-input-event 'tab)
+      ;; Emacs
+      (and (natnump last-input-event)
+          (or
+           ;; ?\t has event-modifier 'control
+           (char-equal last-input-event ?\t)
+           (and (not (event-modifiers last-input-event))
+                (or (char-equal last-input-event ?\?)
+                    (char-equal last-input-event ?\ )))))
+      ;; XEmacs
+      (and (featurep 'xemacs)
+          ;; `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)
+          (or
+           ;; ?\t has event-modifier 'control
+           (char-equal
+            (funcall (symbol-function 'event-to-character)
+                     last-input-event) ?\t)
+           (and (not (event-modifiers last-input-event))
+                (or (char-equal
+                     (funcall (symbol-function 'event-to-character)
+                              last-input-event) ?\?)
+                    (char-equal
+                     (funcall (symbol-function 'event-to-character)
+                              last-input-event) ?\ )))))))
 
 ;; Method, host name and user name completion.
 ;; `tramp-completion-dissect-file-name' returns a list of
 ;; tramp-file-name structures. For all of them we return possible completions.
 ;;;###autoload
 (defun tramp-completion-handle-file-name-all-completions (filename directory)
-  "Like `file-name-all-completions' for partial tramp files."
+  "Like `file-name-all-completions' for partial Tramp files."
 
-  (unwind-protect
-      ;; We need to reset `tramp-completion-mode'.
-      (progn
-       (setq tramp-completion-mode t)
-       (let*
-           ((fullname (concat directory filename))
-            ;; possible completion structures
-            (v (tramp-completion-dissect-file-name fullname))
-            result result1)
-
-         (while v
-           (let* ((car (car v))
-                  (multi-method (tramp-file-name-multi-method car))
-                  (method (tramp-file-name-method car))
-                  (user (tramp-file-name-user car))
-                  (host (tramp-file-name-host car))
-                  (localname (tramp-file-name-localname car))
-                  (m (tramp-find-method multi-method method user host))
-                  (tramp-current-user user) ; see `tramp-parse-passwd'
-                  all-user-hosts)
-
-             (unless (or multi-method ;; Not handled (yet).
-                         localname)   ;; Nothing to complete
-
-               (if (or user host)
-
-                   ;; Method dependent user / host combinations
-                   (progn
-                     (mapcar
-                      (lambda (x)
-                        (setq all-user-hosts
-                              (append all-user-hosts
-                                      (funcall (nth 0 x) (nth 1 x)))))
-                      (tramp-get-completion-function m))
-
-                     (setq result (append result
-                       (mapcar
-                        (lambda (x)
-                          (tramp-get-completion-user-host
-                           method user host (nth 0 x) (nth 1 x)))
-                        (delq nil all-user-hosts)))))
-
-                 ;; Possible methods
-                 (setq result
-                       (append result (tramp-get-completion-methods m)))))
-
-             (setq v (cdr v))))
-
-         ;; unify list, remove nil elements
-         (while result
-           (let ((car (car result)))
-             (when car (add-to-list
-                        'result1 (substring car (length directory))))
-             (setq result (cdr result))))
-
-         ;; Complete local parts
-         (append
-          result1
-          (condition-case nil
-              (if result1
-                  ;; "/ssh:" does not need to be expanded as hostname.
-                  (tramp-run-real-handler
-                   'file-name-all-completions (list filename directory))
-                ;; No method/user/host found to be expanded.
-                (tramp-completion-run-real-handler
-                 'file-name-all-completions (list filename directory)))
-            (error nil)))))
-    ;; unwindform
-    (setq tramp-completion-mode nil)))
+  (let* ((fullname (tramp-drop-volume-letter
+                   (expand-file-name filename directory)))
+        ;; Possible completion structures.
+        (v (tramp-completion-dissect-file-name fullname))
+        result result1)
+
+    (while v
+      (let* ((car (car v))
+            (method (tramp-file-name-method car))
+            (user (tramp-file-name-user car))
+            (host (tramp-file-name-host car))
+            (localname (tramp-file-name-localname car))
+            (m (tramp-find-method method user host))
+            (tramp-current-user user) ; see `tramp-parse-passwd'
+            all-user-hosts)
+
+       (unless localname        ;; Nothing to complete.
+
+         (if (or user host)
+
+             ;; Method dependent user / host combinations.
+             (progn
+               (mapcar
+                (lambda (x)
+                  (setq all-user-hosts
+                        (append all-user-hosts
+                                (funcall (nth 0 x) (nth 1 x)))))
+                (tramp-get-completion-function m))
+
+               (setq result (append result
+                 (mapcar
+                  (lambda (x)
+                    (tramp-get-completion-user-host
+                     method user host (nth 0 x) (nth 1 x)))
+                  (delq nil all-user-hosts)))))
+
+           ;; Possible methods.
+           (setq result
+                 (append result (tramp-get-completion-methods m)))))
+
+       (setq v (cdr v))))
+
+    ;; Unify list, remove nil elements.
+    (while result
+      (let ((car (car result)))
+       (when car
+         (add-to-list
+          'result1
+          (substring car (length (tramp-drop-volume-letter directory)))))
+       (setq result (cdr result))))
+
+    ;; Complete local parts.
+    (append
+     result1
+     (condition-case nil
+        (tramp-completion-run-real-handler
+         'file-name-all-completions (list filename directory))
+       (error nil)))))
 
 ;; Method, host name and user name completion for a file.
 ;;;###autoload
 (defun tramp-completion-handle-file-name-completion
   (filename directory &optional predicate)
-  "Like `file-name-completion' for tramp files."
+  "Like `file-name-completion' for Tramp files."
   (try-completion
    filename
    (mapcar 'list (file-name-all-completions filename directory))
@@ -4693,26 +4506,26 @@ Falls back to normal file name handler if no tramp file name handler exists."
 ;; I misuse a little bit the tramp-file-name structure in order to handle
 ;; completion possibilities for partial methods / user names / host names.
 ;; Return value is a list of tramp-file-name structures according to possible
-;; completions. If "multi-method" or "localname" is non-nil it means there
+;; completions. If "localname" is non-nil it means there
 ;; shouldn't be a completion anymore.
 
 ;; Expected results:
 
-;; "/x" "/[x"               "/x@" "/[x@"             "/x@y" "/[x@y"
-;; [nil nil nil "x" nil]    [nil nil "x" nil nil]    [nil nil "x" "y" nil]
-;; [nil nil "x" nil nil]
-;; [nil "x" nil nil nil]
-
-;; "/x:"                    "/x:y"                   "/x:y:"
-;; [nil nil nil "x" ""]     [nil nil nil "x" "y"]    [nil "x" nil "y" ""]
-;;       "/[x/"                   "/[x/y"
-;; [nil "x" nil "" nil]     [nil "x" nil "y" nil]
-;; [nil "x" "" nil nil]     [nil "x" "y" nil nil]
-
-;; "/x:y@"                  "/x:y@z"                 "/x:y@z:"
-;; [nil nil nil "x" "y@"]   [nil nil nil "x" "y@z"]  [nil "x" "y" "z" ""]
-;;       "/[x/y@"                 "/[x/y@z"
-;; [nil "x" nil "y" nil]    [nil "x" "y" "z" nil]
+;; "/x" "/[x"           "/x@" "/[x@"         "/x@y" "/[x@y"
+;; [nil nil "x" nil]    [nil "x" nil nil]    [nil "x" "y" nil]
+;; [nil "x" nil nil]
+;; ["x" nil nil nil]
+
+;; "/x:"                "/x:y"               "/x:y:"
+;; [nil nil "x" ""]     [nil nil "x" "y"]    ["x" nil "y" ""]
+;; "/[x/"               "/[x/y"
+;; ["x" nil "" nil]     ["x" nil "y" nil]
+;; ["x" "" nil nil]     ["x" "y" nil nil]
+
+;; "/x:y@"              "/x:y@z"             "/x:y@z:"
+;; [nil nil "x" "y@"]   [nil nil "x" "y@z"]  ["x" "y" "z" ""]
+;; "/[x/y@"             "/[x/y@z"
+;; ["x" nil "y" nil]    ["x" "y" "z" nil]
 (defun tramp-completion-dissect-file-name (name)
   "Returns a list of `tramp-file-name' structures.
 They are collected by `tramp-completion-dissect-file-name1'."
@@ -4737,25 +4550,49 @@ They are collected by `tramp-completion-dissect-file-name1'."
                        "\\(" tramp-user-regexp "\\)"   tramp-postfix-user-regexp
                        "\\(" tramp-host-regexp x-nil   "\\)$")
                nil 1 2 nil))
-        ;; "/method:user" "/[method/user"
+        ;; "/method:user" "/[method/user" "/method://user"
         (tramp-completion-file-name-structure5
          (list (concat tramp-prefix-regexp
-                       "\\(" tramp-method-regexp "\\)" tramp-postfix-single-method-regexp
+                       "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp
                        "\\(" tramp-user-regexp x-nil   "\\)$")
                1 2 nil nil))
-        ;; "/method:host" "/[method/host"
+        ;; "/method:host" "/[method/host" "/method://host"
         (tramp-completion-file-name-structure6
          (list (concat tramp-prefix-regexp
-                       "\\(" tramp-method-regexp "\\)" tramp-postfix-single-method-regexp
+                       "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp
                        "\\(" tramp-host-regexp x-nil   "\\)$")
                1 nil 2 nil))
-        ;; "/method:user@host" "/[method/user@host"
+        ;; "/method:user@host" "/[method/user@host" "/method://user@host"
         (tramp-completion-file-name-structure7
          (list (concat tramp-prefix-regexp
-                       "\\(" tramp-method-regexp "\\)" tramp-postfix-single-method-regexp
+                       "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp
                        "\\(" tramp-user-regexp "\\)"   tramp-postfix-user-regexp
                        "\\(" tramp-host-regexp x-nil   "\\)$")
-               1 2 3 nil)))
+               1 2 3 nil))
+        ;; "/method: "/method:/"
+        (tramp-completion-file-name-structure8
+         (list
+          (if (equal tramp-syntax 'url)
+              (concat tramp-prefix-regexp
+                      "\\(" tramp-method-regexp "\\)"
+                      "\\(" (substring tramp-postfix-method-regexp 0 1)
+                      "\\|" (substring tramp-postfix-method-regexp 1 2) "\\)"
+                      "\\(" "\\)$")
+            ;; Should not match if not URL syntax.
+            (concat tramp-prefix-regexp "/$"))
+          1 3 nil nil))
+        ;; "/method: "/method:/"
+        (tramp-completion-file-name-structure9
+         (list
+          (if (equal tramp-syntax 'url)
+              (concat tramp-prefix-regexp
+                      "\\(" tramp-method-regexp "\\)"
+                      "\\(" (substring tramp-postfix-method-regexp 0 1)
+                      "\\|" (substring tramp-postfix-method-regexp 1 2) "\\)"
+                      "\\(" "\\)$")
+            ;; Should not match if not URL syntax.
+            (concat tramp-prefix-regexp "/$"))
+          1 nil 3 nil)))
 
     (mapcar (lambda (regexp)
       (add-to-list 'result
@@ -4768,30 +4605,28 @@ They are collected by `tramp-completion-dissect-file-name1'."
        tramp-completion-file-name-structure5
        tramp-completion-file-name-structure6
        tramp-completion-file-name-structure7
+       tramp-completion-file-name-structure8
+       tramp-completion-file-name-structure9
        tramp-file-name-structure))
 
     (delq nil result)))
 
 (defun tramp-completion-dissect-file-name1 (structure name)
   "Returns a `tramp-file-name' structure matching STRUCTURE.
-The structure consists of multi-method, remote method, remote user,
+The structure consists of remote method, remote user,
 remote host and localname (filename on remote host)."
 
-  (let (method)
-    (save-match-data
-      (when (string-match (nth 0 structure) name)
-       (setq method (and (nth 1 structure)
-                         (match-string (nth 1 structure) name)))
-       (if (and method (member method tramp-multi-methods))
-           ;; Not handled (yet).
-           (vector method nil nil nil nil)
-         (let ((user   (and (nth 2 structure)
-                            (match-string (nth 2 structure) name)))
-               (host   (and (nth 3 structure)
-                            (match-string (nth 3 structure) name)))
-               (localname   (and (nth 4 structure)
-                            (match-string (nth 4 structure) name))))
-           (vector nil method user host localname)))))))
+  (save-match-data
+    (when (string-match (nth 0 structure) name)
+      (let ((method    (and (nth 1 structure)
+                           (match-string (nth 1 structure) name)))
+           (user      (and (nth 2 structure)
+                           (match-string (nth 2 structure) name)))
+           (host      (and (nth 3 structure)
+                           (match-string (nth 3 structure) name)))
+           (localname (and (nth 4 structure)
+                           (match-string (nth 4 structure) name))))
+       (vector method user host localname)))))
 
 ;; This function returns all possible method completions, adding the
 ;; trailing method delimeter.
@@ -4801,8 +4636,8 @@ remote host and localname (filename on remote host)."
    (lambda (method)
      (and method
          (string-match (concat "^" (regexp-quote partial-method)) method)
-         (tramp-make-tramp-file-name nil method nil nil nil)))
-   (delete "multi" (mapcar 'car tramp-methods))))
+         (tramp-completion-make-tramp-file-name method nil nil nil)))
+   (mapcar 'car tramp-methods)))
 
 ;; Compares partial user and host names with possible completions.
 (defun tramp-get-completion-user-host (method partial-user partial-host user host)
@@ -4834,13 +4669,15 @@ PARTIAL-USER must match USER, PARTIAL-HOST must match HOST."
            host nil)))
 
   (unless (zerop (+ (length user) (length host)))
-    (tramp-make-tramp-file-name nil method user host nil)))
+    (tramp-completion-make-tramp-file-name method user host nil)))
 
 (defun tramp-parse-rhosts (filename)
   "Return a list of (user host) tuples allowed to access.
 Either user or host may be nil."
-
-  (let (res)
+  ;; On Windows, there are problems in completion when
+  ;; `default-directory' is remote.
+  (let ((default-directory (tramp-temporary-file-directory))
+       res)
     (when (file-readable-p filename)
       (with-temp-buffer
        (insert-file-contents filename)
@@ -4849,24 +4686,15 @@ Either user or host may be nil."
          (push (tramp-parse-rhosts-group) res))))
     res))
 
-;; Taken from gnus/netrc.el
-(eval-and-compile
-  (defalias 'tramp-point-at-eol
-    (if (fboundp 'point-at-eol)
-       'point-at-eol
-      'line-end-position)))
-
 (defun tramp-parse-rhosts-group ()
    "Return a (user host) tuple allowed to access.
 Either user or host may be nil."
-
    (let ((result)
         (regexp
          (concat
           "^\\(" tramp-host-regexp "\\)"
           "\\([ \t]+" "\\(" tramp-user-regexp "\\)" "\\)?")))
-
-     (narrow-to-region (point) (tramp-point-at-eol))
+     (narrow-to-region (point) (tramp-line-end-position))
      (when (re-search-forward regexp nil t)
        (setq result (append (list (match-string 3) (match-string 1)))))
      (widen)
@@ -4876,8 +4704,10 @@ Either user or host may be nil."
 (defun tramp-parse-shosts (filename)
   "Return a list of (user host) tuples allowed to access.
 User is always nil."
-
-  (let (res)
+  ;; On Windows, there are problems in completion when
+  ;; `default-directory' is remote.
+  (let ((default-directory (tramp-temporary-file-directory))
+       res)
     (when (file-readable-p filename)
       (with-temp-buffer
        (insert-file-contents filename)
@@ -4889,11 +4719,9 @@ User is always nil."
 (defun tramp-parse-shosts-group ()
    "Return a (user host) tuple allowed to access.
 User is always nil."
-
    (let ((result)
         (regexp (concat "^\\(" tramp-host-regexp "\\)")))
-
-     (narrow-to-region (point) (tramp-point-at-eol))
+     (narrow-to-region (point) (tramp-line-end-position))
      (when (re-search-forward regexp nil t)
        (setq result (list nil (match-string 1))))
      (widen)
@@ -4905,8 +4733,10 @@ User is always nil."
 (defun tramp-parse-sconfig (filename)
   "Return a list of (user host) tuples allowed to access.
 User is always nil."
-
-  (let (res)
+  ;; On Windows, there are problems in completion when
+  ;; `default-directory' is remote.
+  (let ((default-directory (tramp-temporary-file-directory))
+       res)
     (when (file-readable-p filename)
       (with-temp-buffer
        (insert-file-contents filename)
@@ -4918,11 +4748,9 @@ User is always nil."
 (defun tramp-parse-sconfig-group ()
    "Return a (user host) tuple allowed to access.
 User is always nil."
-
    (let ((result)
         (regexp (concat "^[ \t]*Host[ \t]+" "\\(" tramp-host-regexp "\\)")))
-
-     (narrow-to-region (point) (tramp-point-at-eol))
+     (narrow-to-region (point) (tramp-line-end-position))
      (when (re-search-forward regexp nil t)
        (setq result (list nil (match-string 1))))
      (widen)
@@ -4934,11 +4762,12 @@ User is always nil."
 (defun tramp-parse-shostkeys (dirname)
   "Return a list of (user host) tuples allowed to access.
 User is always nil."
-
-  (let ((regexp (concat "^key_[0-9]+_\\(" tramp-host-regexp "\\)\\.pub$"))
-       (files (when (file-directory-p dirname) (directory-files dirname)))
-       result)
-
+  ;; On Windows, there are problems in completion when
+  ;; `default-directory' is remote.
+  (let* ((default-directory (tramp-temporary-file-directory))
+        (regexp (concat "^key_[0-9]+_\\(" tramp-host-regexp "\\)\\.pub$"))
+        (files (when (file-directory-p dirname) (directory-files dirname)))
+        result)
     (while files
       (when (string-match regexp (car files))
        (push (list nil (match-string 1 (car files))) result))
@@ -4948,12 +4777,13 @@ User is always nil."
 (defun tramp-parse-sknownhosts (dirname)
   "Return a list of (user host) tuples allowed to access.
 User is always nil."
-
-  (let ((regexp (concat "^\\(" tramp-host-regexp
-                       "\\)\\.ssh-\\(dss\\|rsa\\)\\.pub$"))
-       (files (when (file-directory-p dirname) (directory-files dirname)))
-       result)
-
+  ;; On Windows, there are problems in completion when
+  ;; `default-directory' is remote.
+  (let* ((default-directory (tramp-temporary-file-directory))
+        (regexp (concat "^\\(" tramp-host-regexp
+                        "\\)\\.ssh-\\(dss\\|rsa\\)\\.pub$"))
+        (files (when (file-directory-p dirname) (directory-files dirname)))
+        result)
     (while files
       (when (string-match regexp (car files))
        (push (list nil (match-string 1 (car files))) result))
@@ -4963,8 +4793,10 @@ User is always nil."
 (defun tramp-parse-hosts (filename)
   "Return a list of (user host) tuples allowed to access.
 User is always nil."
-
-  (let (res)
+  ;; On Windows, there are problems in completion when
+  ;; `default-directory' is remote.
+  (let ((default-directory (tramp-temporary-file-directory))
+       res)
     (when (file-readable-p filename)
       (with-temp-buffer
        (insert-file-contents filename)
@@ -4976,11 +4808,9 @@ User is always nil."
 (defun tramp-parse-hosts-group ()
    "Return a (user host) tuple allowed to access.
 User is always nil."
-
    (let ((result)
         (regexp (concat "^\\(" tramp-host-regexp "\\)")))
-
-     (narrow-to-region (point) (tramp-point-at-eol))
+     (narrow-to-region (point) (tramp-line-end-position))
      (when (re-search-forward regexp nil t)
        (unless (char-equal (or (char-after) ?\n) ?:) ; no IPv6
         (setq result (list nil (match-string 1)))))
@@ -4992,13 +4822,15 @@ User is always nil."
 
 ;; For su-alike methods it would be desirable to return "root@localhost"
 ;; as default.  Unfortunately, we have no information whether any user name
-;; has been typed already.  So we (mis-)use tramp-current-user as indication,
+;; has been typed already.  So we use `tramp-current-user' as indication,
 ;; assuming it is set in `tramp-completion-handle-file-name-all-completions'.
 (defun tramp-parse-passwd (filename)
   "Return a list of (user host) tuples allowed to access.
 Host is always \"localhost\"."
-
-  (let (res)
+  ;; On Windows, there are problems in completion when
+  ;; `default-directory' is remote.
+  (let ((default-directory (tramp-temporary-file-directory))
+       res)
     (if (zerop (length tramp-current-user))
        '(("root" nil))
       (when (file-readable-p filename)
@@ -5012,11 +4844,9 @@ Host is always \"localhost\"."
 (defun tramp-parse-passwd-group ()
    "Return a (user host) tuple allowed to access.
 Host is always \"localhost\"."
-
    (let ((result)
         (regexp (concat "^\\(" tramp-user-regexp "\\):")))
-
-     (narrow-to-region (point) (tramp-point-at-eol))
+     (narrow-to-region (point) (tramp-line-end-position))
      (when (re-search-forward regexp nil t)
        (setq result (list (match-string 1) "localhost")))
      (widen)
@@ -5026,8 +4856,10 @@ Host is always \"localhost\"."
 (defun tramp-parse-netrc (filename)
   "Return a list of (user host) tuples allowed to access.
 User may be nil."
-
-  (let (res)
+  ;; On Windows, there are problems in completion when
+  ;; `default-directory' is remote.
+  (let ((default-directory (tramp-temporary-file-directory))
+       res)
     (when (file-readable-p filename)
       (with-temp-buffer
        (insert-file-contents filename)
@@ -5039,49 +4871,63 @@ User may be nil."
 (defun tramp-parse-netrc-group ()
    "Return a (user host) tuple allowed to access.
 User may be nil."
-
    (let ((result)
         (regexp
          (concat
           "^[ \t]*machine[ \t]+" "\\(" tramp-host-regexp "\\)"
           "\\([ \t]+login[ \t]+" "\\(" tramp-user-regexp "\\)" "\\)?")))
-
-     (narrow-to-region (point) (tramp-point-at-eol))
+     (narrow-to-region (point) (tramp-line-end-position))
      (when (re-search-forward regexp nil t)
        (setq result (list (match-string 3) (match-string 1))))
      (widen)
      (forward-line 1)
      result))
 
+(defun tramp-parse-putty (registry)
+  "Return a list of (user host) tuples allowed to access.
+User is always nil."
+  ;; On Windows, there are problems in completion when
+  ;; `default-directory' is remote.
+  (let ((default-directory (tramp-temporary-file-directory))
+       res)
+    (with-temp-buffer
+      (when (zerop (call-process "reg" nil t nil "query" registry))
+       (goto-char (point-min))
+       (while (not (eobp))
+         (push (tramp-parse-putty-group registry) res))))
+    res))
+
+(defun tramp-parse-putty-group (registry)
+   "Return a (user host) tuple allowed to access.
+User is always nil."
+   (let ((result)
+        (regexp (concat (regexp-quote registry) "\\\\\\(.+\\)")))
+     (narrow-to-region (point) (tramp-line-end-position))
+     (when (re-search-forward regexp nil t)
+       (setq result (list nil (match-string 1))))
+     (widen)
+     (forward-line 1)
+     result))
+
 ;;; Internal Functions:
 
-(defun tramp-maybe-send-perl-script (multi-method method user host script name)
-  "Define in remote shell function NAME implemented as perl SCRIPT.
-Only send the definition if it has not already been done.
-Function may have 0-3 parameters."
-  (let ((remote-perl (tramp-get-remote-perl multi-method method user host)))
-    (unless remote-perl (error "No remote perl"))
-    (let ((perl-scripts (tramp-get-connection-property "perl-scripts" nil
-                                                       multi-method method user host)))
-      (unless (memq name perl-scripts)
-        (with-current-buffer (tramp-get-buffer multi-method method user host)
-          (tramp-message 5 (concat "Sending the Perl script `" name "'..."))
-          (tramp-send-string multi-method method user host
-                             (concat name
-                                     " () {\n"
-                                     remote-perl
-                                     " -e '"
-                                     script
-                                     "' \"$1\" \"$2\" \"$3\" 2>/dev/null\n}"))
-          (tramp-wait-for-output)
-          (tramp-set-connection-property "perl-scripts" (cons name perl-scripts)
-                                         multi-method method user host)
-          (tramp-message 5 (concat "Sending the Perl script `" name "'...done.")))))))
+(defun tramp-maybe-send-script (vec script name)
+  "Define in remote shell function NAME implemented as SCRIPT.
+Only send the definition if it has not already been done."
+  (let* ((p (tramp-get-connection-process vec))
+        (scripts (tramp-get-connection-property p "scripts" nil)))
+    (unless (memq name scripts)
+      (tramp-message vec 5 "Sending script `%s'..." name)
+      ;; The script could contain a call of Perl.  This is masked with `%s'.
+      (tramp-send-command-and-check
+       vec
+       (format "%s () {\n%s\n}" name
+              (format script (tramp-get-remote-perl vec))))
+      (tramp-set-connection-property p "scripts" (cons name scripts))
+      (tramp-message vec 5 "Sending script `%s'...done." name))))
 
 (defun tramp-set-auto-save ()
-  (when (and (buffer-file-name)
-             (tramp-tramp-file-p (buffer-file-name))
-            ;; ange-ftp has its own auto-save mechanism
+  (when (and ;; ange-ftp has its own auto-save mechanism
             (eq (tramp-find-foreign-file-name-handler (buffer-file-name))
                 'tramp-sh-file-name-handler)
              auto-save-default)
@@ -5094,340 +4940,314 @@ Function may have 0-3 parameters."
 (defun tramp-run-test (switch filename)
   "Run `test' on the remote system, given a SWITCH and a FILENAME.
 Returns the exit code of the `test' program."
-  (let ((v (tramp-dissect-file-name filename)))
-    (save-excursion
-      (tramp-send-command-and-check
-       (tramp-file-name-multi-method v) (tramp-file-name-method v)
-       (tramp-file-name-user v) (tramp-file-name-host v)
-       (format "test %s %s" switch
-               (tramp-shell-quote-argument (tramp-file-name-localname v)))))))
-
-(defun tramp-run-test2 (program file1 file2 &optional switch)
-  "Run `test'-like PROGRAM on the remote system, given FILE1, FILE2.
-The optional SWITCH is inserted between the two files.
-Returns the exit code of the `test' PROGRAM.  Barfs if the methods,
+  (with-parsed-tramp-file-name filename nil
+    (tramp-send-command-and-check
+     v
+     (format
+      "%s %s %s"
+      (tramp-get-test-command v)
+      switch
+      (tramp-shell-quote-argument localname)))))
+
+(defun tramp-run-test2 (format-string file1 file2)
+  "Run `test'-like program on the remote system, given FILE1, FILE2.
+FORMAT-STRING contains the program name, switches, and place holders.
+Returns the exit code of the `test' program.  Barfs if the methods,
 hosts, or files, disagree."
-  (let* ((v1 (tramp-dissect-file-name file1))
-         (v2 (tramp-dissect-file-name file2))
-         (mmethod1 (tramp-file-name-multi-method v1))
-         (mmethod2 (tramp-file-name-multi-method v2))
-         (method1 (tramp-file-name-method v1))
-         (method2 (tramp-file-name-method v2))
-         (user1 (tramp-file-name-user v1))
-         (user2 (tramp-file-name-user v2))
-         (host1 (tramp-file-name-host v1))
-         (host2 (tramp-file-name-host v2))
-         (localname1 (tramp-file-name-localname v1))
-         (localname2 (tramp-file-name-localname v2)))
-    (unless (and method1 method2 host1 host2
-                 (equal mmethod1 mmethod2)
-                 (equal method1 method2)
-                 (equal user1 user2)
-                 (equal host1 host2))
-      (error "tramp-run-test2: %s"
-             "only implemented for same method, same user, same host"))
-    (save-excursion
+  (unless (tramp-equal-remote file1 file2)
+    (with-parsed-tramp-file-name (if (tramp-tramp-file-p file1) file1 file2) nil
+      (tramp-error
+       v 'file-error
+       "tramp-run-test2 only implemented for same method, user, host")))
+  (with-parsed-tramp-file-name file1 v1
+    (with-parsed-tramp-file-name file1 v2
       (tramp-send-command-and-check
-       mmethod1 method1 user1 host1
-       (format "%s %s %s %s"
-               program
-               (tramp-shell-quote-argument localname1)
-               (or switch "")
-               (tramp-shell-quote-argument localname2))))))
-
-(defun tramp-touch (file time)
-  "Set the last-modified timestamp of the given file.
-TIME is an Emacs internal time value as returned by `current-time'."
-  (let* ((utc
-         ;; With GNU Emacs, `format-time-string' has an optional
-         ;; parameter UNIVERSAL.  This is preferred.
-         (and (functionp 'subr-arity)
-              (= 3 (cdr (funcall (symbol-function 'subr-arity)
-                                 (symbol-function 'format-time-string))))))
-        (touch-time
-         (if utc
-             (format-time-string "%Y%m%d%H%M.%S" time t)
-           (format-time-string "%Y%m%d%H%M.%S" time))))
-    (if (tramp-tramp-file-p file)
-       (with-parsed-tramp-file-name file nil
-         (let ((buf (tramp-get-buffer multi-method method user host)))
-           (unless (zerop (tramp-send-command-and-check
-                           multi-method method user host
-                           (format "%s touch -t %s %s"
-                                   (if utc "TZ=UTC; export TZ;" "")
-                                   touch-time
-                                   (tramp-shell-quote-argument localname))
-                           t))
-             (pop-to-buffer buf)
-             (error "tramp-touch: touch failed, see buffer `%s' for details"
-                    buf))))
-      ;; It's a local file
-      (with-temp-buffer
-       (unless (zerop (call-process
-                       "touch" nil (current-buffer) nil "-t" touch-time file))
-             (pop-to-buffer (current-buffer))
-             (error "tramp-touch: touch failed"))))))
-
-(defun tramp-buffer-name (multi-method method user host)
-  "A name for the connection buffer for USER at HOST using METHOD."
-  (if multi-method
-      (tramp-buffer-name-multi-method "tramp" multi-method method user host)
-    (let ((method (tramp-find-method multi-method method user host)))
-      (if user
-         (format "*tramp/%s %s@%s*" method user host)
-       (format "*tramp/%s %s*" method host)))))
-
-(defun tramp-buffer-name-multi-method (prefix multi-method method user host)
-  "A name for the multi method connection buffer.
-MULTI-METHOD gives the multi method, METHOD the array of methods,
-USER the array of user names, HOST the array of host names."
-  (unless (and (= (length method) (length user))
-               (= (length method) (length host)))
-    (error "Syntax error in multi method (implementation error)"))
-  (let ((len (length method))
-        (i 0)
-        string-list)
-    (while (< i len)
-      (setq string-list
-            (cons (if (aref user i)
-                      (format "%s#%s@%s:" (aref method i)
-                              (aref user i) (aref host i))
-                    (format "%s@%s:" (aref method i) (aref host i)))
-                  string-list))
-      (setq i (1+ i)))
-    (format "*%s/%s %s*"
-            prefix multi-method
-            (apply 'concat (reverse string-list)))))
-
-(defun tramp-get-buffer (multi-method method user host)
-  "Get the connection buffer to be used for USER at HOST using METHOD."
+       v1
+       (format format-string
+              (tramp-shell-quote-argument v1-localname)
+              (tramp-shell-quote-argument v2-localname))))))
+
+(defun tramp-buffer-name (vec)
+  "A name for the connection buffer VEC."
+  ;; We must use `tramp-file-name-real-host', because for gateway
+  ;; methods the default port will be expanded later on, which would
+  ;; tamper the name.
+  (let ((method (tramp-file-name-method vec))
+       (user   (tramp-file-name-user vec))
+       (host   (tramp-file-name-real-host vec)))
+    (if (not (zerop (length user)))
+       (format "*tramp/%s %s@%s*" method user host)
+      (format "*tramp/%s %s*" method host))))
+
+(defun tramp-get-buffer (vec)
+  "Get the connection buffer to be used for VEC."
+  (or (get-buffer (tramp-buffer-name vec))
+      (with-current-buffer (get-buffer-create (tramp-buffer-name vec))
+       (setq buffer-undo-list t)
+       (setq default-directory
+             (tramp-make-tramp-file-name
+              (tramp-file-name-method vec)
+              (tramp-file-name-user vec)
+              (tramp-file-name-host vec)
+              "/"))
+       (current-buffer))))
+
+(defun tramp-get-connection-buffer (vec)
+  "Get the connection buffer to be used for VEC.
+In case a second asynchronous communication has been started, it is different
+from `tramp-get-buffer'."
+  (or (tramp-get-connection-property vec "process-buffer" nil)
+      (tramp-get-buffer vec)))
+
+(defun tramp-get-connection-process (vec)
+  "Get the connection process to be used for VEC.
+In case a second asynchronous communication has been started, it is different
+from the default one."
+  (get-process
+   (or (tramp-get-connection-property vec "process-name" nil)
+       (tramp-buffer-name vec))))
+
+(defun tramp-debug-buffer-name (vec)
+  "A name for the debug buffer for VEC."
+  ;; We must use `tramp-file-name-real-host', because for gateway
+  ;; methods the default port will be expanded later on, which would
+  ;; tamper the name.
+  (let ((method (tramp-file-name-method vec))
+       (user   (tramp-file-name-user vec))
+       (host   (tramp-file-name-real-host vec)))
+    (if (not (zerop (length user)))
+       (format "*debug tramp/%s %s@%s*" method user host)
+      (format "*debug tramp/%s %s*" method host))))
+
+(defun tramp-get-debug-buffer (vec)
+  "Get the debug buffer for VEC."
   (with-current-buffer
-      (get-buffer-create (tramp-buffer-name multi-method method user host))
-    (setq buffer-undo-list t)
+      (get-buffer-create (tramp-debug-buffer-name vec))
+    (when (bobp)
+      (setq buffer-undo-list t)
+      ;; Activate outline-mode
+      (make-local-variable 'outline-regexp)
+      (make-local-variable 'outline-level)
+      ;; This runs `text-mode-hook' and `outline-mode-hook'.  We must
+      ;; prevent that local processes die.  Yes: I've seen
+      ;; `flyspell-mode', which starts "ispell" ...
+      (let ((default-directory (tramp-temporary-file-directory)))
+       (outline-mode))
+      (setq outline-regexp "[0-9]+:[0-9]+:[0-9]+ [a-z0-9-]+ (\\([0-9]+\\)) #")
+;      (setq outline-regexp "[a-z.-]+:[0-9]+: [a-z0-9-]+ (\\([0-9]+\\)) #")
+      (setq outline-level 'tramp-outline-level))
     (current-buffer)))
 
-(defun tramp-debug-buffer-name (multi-method method user host)
-  "A name for the debug buffer for USER at HOST using METHOD."
-  (if multi-method
-      (tramp-buffer-name-multi-method "debug tramp"
-                                     multi-method method user host)
-    (let ((method (tramp-find-method multi-method method user host)))
-      (if user
-         (format "*debug tramp/%s %s@%s*" method user host)
-       (format "*debug tramp/%s %s*" method host)))))
-
-(defun tramp-get-debug-buffer (multi-method method user host)
-  "Get the debug buffer for USER at HOST using METHOD."
-  (with-current-buffer
-      (get-buffer-create
-       (tramp-debug-buffer-name multi-method method user host))
-    (setq buffer-undo-list t)
-    (current-buffer)))
+(defun tramp-outline-level ()
+  "Return the depth to which a statement is nested in the outline.
+Point must be at the beginning of a header line.
 
-(defun tramp-find-executable (multi-method method user host
-                                         progname dirlist ignore-tilde)
-  "Searches for PROGNAME in all directories mentioned in DIRLIST.
-First args METHOD, USER and HOST specify the connection, PROGNAME
-is the program to search for, and DIRLIST gives the list of directories
-to search.  If IGNORE-TILDE is non-nil, directory names starting
-with `~' will be ignored.
+The outline level is equal to the verbosity of the Tramp message."
+  (1+ (string-to-number (match-string 1))))
+
+(defun tramp-find-executable
+  (vec progname dirlist &optional ignore-tilde ignore-path)
+  "Searches for PROGNAME in $PATH and all directories mentioned in DIRLIST.
+First arg VEC specifies the connection, PROGNAME is the program
+to search for, and DIRLIST gives the list of directories to
+search.  If IGNORE-TILDE is non-nil, directory names starting
+with `~' will be ignored. If IGNORE-PATH is non-nil, searches
+only in DIRLIST.
 
 Returns the absolute file name of PROGNAME, if found, and nil otherwise.
 
 This function expects to be in the right *tramp* buffer."
-  (let (result)
-    (when ignore-tilde
-      ;; Remove all ~/foo directories from dirlist.  In Emacs 20,
-      ;; `remove' is in CL, and we want to avoid CL dependencies.
-      (let (newdl d)
-        (while dirlist
-          (setq d (car dirlist))
-          (setq dirlist (cdr dirlist))
-          (unless (char-equal ?~ (aref d 0))
-            (setq newdl (cons d newdl))))
-        (setq dirlist (nreverse newdl))))
-    (tramp-send-command
-     multi-method method user host
-     (format (concat "while read d; "
-                     "do if test -x $d/%s -a -f $d/%s; "
-                     "then echo tramp_executable $d/%s; "
-                     "break; fi; done <<'EOF'")
-             progname progname progname))
-    (mapcar (lambda (d)
-              (tramp-send-command multi-method method user host d))
-            dirlist)
-    (tramp-send-command multi-method method user host "EOF")
-    (tramp-wait-for-output)
-    (goto-char (point-max))
-    (when (search-backward "tramp_executable " nil t)
-      (skip-chars-forward "^ ")
-      (skip-chars-forward " ")
-      (buffer-substring (point) (tramp-line-end-position)))))
-
-(defun tramp-set-remote-path (multi-method method user host var dirlist)
-  "Sets the remote environment VAR to existing directories from DIRLIST.
-I.e., for each directory in DIRLIST, it is tested whether it exists and if
-so, it is added to the environment variable VAR."
-  (let ((existing-dirs
-         (mapcar
-          (lambda (x)
-            (when (and
-                   (file-exists-p
-                    (tramp-make-tramp-file-name multi-method method user host x))
-                   (file-directory-p
-                    (tramp-make-tramp-file-name multi-method method user host x)))
-              x))
-          dirlist)))
+  (with-current-buffer (tramp-get-buffer vec)
+    (let (result)
+      ;; Check whether the executable is in $PATH. "which(1)" does not
+      ;; report always a correct error code; therefore we check the
+      ;; number of words it returns.
+      (unless ignore-path
+       (tramp-send-command vec (format "which \\%s | wc -w" progname))
+       (goto-char (point-min))
+       (if (looking-at "^1$")
+           (setq result (concat "\\" progname))))
+      (unless result
+       (when ignore-tilde
+         ;; Remove all ~/foo directories from dirlist.  In Emacs 20,
+         ;; `remove' is in CL, and we want to avoid CL dependencies.
+         (let (newdl d)
+           (while dirlist
+             (setq d (car dirlist))
+             (setq dirlist (cdr dirlist))
+             (unless (char-equal ?~ (aref d 0))
+               (setq newdl (cons d newdl))))
+           (setq dirlist (nreverse newdl))))
+       (tramp-send-command
+        vec
+        (format (concat "while read d; "
+                        "do if test -x $d/%s -a -f $d/%s; "
+                        "then echo tramp_executable $d/%s; "
+                        "break; fi; done <<'EOF'\n"
+                        "%s\nEOF")
+                progname progname progname (mapconcat 'identity dirlist "\n")))
+       (goto-char (point-max))
+       (when (search-backward "tramp_executable " nil t)
+         (skip-chars-forward "^ ")
+         (skip-chars-forward " ")
+         (setq result (buffer-substring (point) (tramp-line-end-position)))))
+    result)))
+
+(defun tramp-set-remote-path (vec)
+  "Sets the remote environment PATH to existing directories.
+I.e., for each directory in `tramp-remote-path', it is tested
+whether it exists and if so, it is added to the environment
+variable PATH."
+  (tramp-message vec 5 (format "Setting $PATH environment variable"))
+
+  (with-current-buffer (tramp-get-connection-buffer vec)
+    (set (make-local-variable 'tramp-remote-path)
+        (copy-tree tramp-remote-path))
+    (let* ((elt (memq 'tramp-default-remote-path tramp-remote-path))
+          (tramp-default-remote-path
+           (with-connection-property vec "default-remote-path"
+             (when elt
+               (condition-case nil
+                   (symbol-name
+                    (tramp-send-command-and-read vec "getconf PATH"))
+                 ;; Default if "getconf" is not available.
+                 (error
+                  (tramp-message
+                   vec 3
+                   "`getconf PATH' not successful, using default value \"%s\"."
+                   "/bin:/usr/bin")
+                  "/bin:/usr/bin"))))))
+      (when elt
+       ;; Replace place holder `tramp-default-remote-path'.
+       (setcdr elt
+               (append
+                (tramp-split-string tramp-default-remote-path ":")
+                (cdr elt)))
+       (setq tramp-remote-path
+             (delq 'tramp-default-remote-path tramp-remote-path))))
+
+    ;; Check for existence of directories.
+    (setq tramp-remote-path
+         (delq
+          nil
+          (mapcar
+           (lambda (x)
+             (and
+              (with-connection-property vec x
+                (file-directory-p
+                 (tramp-make-tramp-file-name
+                  (tramp-file-name-method vec)
+                  (tramp-file-name-user vec)
+                  (tramp-file-name-host vec)
+                  x)))
+              x))
+           tramp-remote-path)))
     (tramp-send-command
-     multi-method method user host
-     (concat var "="
-             (mapconcat 'identity (delq nil existing-dirs) ":")
-             "; export " var))
-  (tramp-wait-for-output)))
+     vec
+     (format "PATH=%s; export PATH"
+            (mapconcat 'identity tramp-remote-path ":")))))
 
 ;; -- communication with external shell --
 
-(defun tramp-find-file-exists-command (multi-method method user host)
+(defun tramp-find-file-exists-command (vec)
   "Find a command on the remote host for checking if a file exists.
 Here, we are looking for a command which has zero exit status if the
 file exists and nonzero exit status otherwise."
-  (make-local-variable 'tramp-file-exists-command)
-  (tramp-message 9 "Finding command to check if file exists")
-  (let ((existing
-         (tramp-make-tramp-file-name
-          multi-method method user host
-          "/"))                         ;assume this file always exists
+  (let ((existing "/")
         (nonexisting
-         (tramp-make-tramp-file-name
-          multi-method method user host
-          "/ this file does not exist "))) ;assume this never exists
+        (tramp-shell-quote-argument "/ this file does not exist "))
+       result)
     ;; The algorithm is as follows: we try a list of several commands.
     ;; For each command, we first run `$cmd /' -- this should return
     ;; true, as the root directory always exists.  And then we run
-    ;; `$cmd /this\ file\ does\ not\ exist', hoping that the file indeed
+    ;; `$cmd /this\ file\ does\ not\ exist ', hoping that the file indeed
     ;; does not exist.  This should return false.  We use the first
     ;; command we find that seems to work.
     ;; The list of commands to try is as follows:
-    ;; `ls -d'          This works on most systems, but NetBSD 1.4
-    ;;                  has a bug: `ls' always returns zero exit
-    ;;                  status, even for files which don't exist.
-    ;; `test -e'        Some Bourne shells have a `test' builtin
-    ;;                  which does not know the `-e' option.
-    ;; `/bin/test -e'   For those, the `test' binary on disk normally
-    ;;                  provides the option.  Alas, the binary
-    ;;                  is sometimes `/bin/test' and sometimes it's
-    ;;                  `/usr/bin/test'.
-    ;; `/usr/bin/test -e'       In case `/bin/test' does not exist.
+    ;; `ls -d'            This works on most systems, but NetBSD 1.4
+    ;;                    has a bug: `ls' always returns zero exit
+    ;;                    status, even for files which don't exist.
+    ;; `test -e'          Some Bourne shells have a `test' builtin
+    ;;                    which does not know the `-e' option.
+    ;; `/bin/test -e'     For those, the `test' binary on disk normally
+    ;;                    provides the option.  Alas, the binary
+    ;;                    is sometimes `/bin/test' and sometimes it's
+    ;;                    `/usr/bin/test'.
+    ;; `/usr/bin/test -e' In case `/bin/test' does not exist.
     (unless (or
-             (and (setq tramp-file-exists-command "test -e %s")
-                  (file-exists-p existing)
-                  (not (file-exists-p nonexisting)))
-             (and (setq tramp-file-exists-command "/bin/test -e %s")
-                  (file-exists-p existing)
-                  (not (file-exists-p nonexisting)))
-             (and (setq tramp-file-exists-command "/usr/bin/test -e %s")
-                  (file-exists-p existing)
-                  (not (file-exists-p nonexisting)))
-             (and (setq tramp-file-exists-command "ls -d %s")
-                  (file-exists-p existing)
-                  (not (file-exists-p nonexisting))))
-      (error "Couldn't find command to check if file exists"))))
+             (and (setq result (format "%s -e" (tramp-get-test-command vec)))
+                 (zerop (tramp-send-command-and-check
+                         vec (format "%s %s" result existing)))
+                  (not (zerop (tramp-send-command-and-check
+                              vec (format "%s %s" result nonexisting)))))
+             (and (setq result "/bin/test -e")
+                 (zerop (tramp-send-command-and-check
+                         vec (format "%s %s" result existing)))
+                  (not (zerop (tramp-send-command-and-check
+                              vec (format "%s %s" result nonexisting)))))
+             (and (setq result "/usr/bin/test -e")
+                 (zerop (tramp-send-command-and-check
+                         vec (format "%s %s" result existing)))
+                  (not (zerop (tramp-send-command-and-check
+                              vec (format "%s %s" result nonexisting)))))
+             (and (setq result (format "%s -d" (tramp-get-ls-command vec)))
+                 (zerop (tramp-send-command-and-check
+                         vec (format "%s %s" result existing)))
+                  (not (zerop (tramp-send-command-and-check
+                              vec (format "%s %s" result nonexisting))))))
+      (tramp-error
+       vec 'file-error "Couldn't find command to check if file exists"))
+    result))
 
 
 ;; CCC test ksh or bash found for tilde expansion?
-(defun tramp-find-shell (multi-method method user host)
-  "Find a shell on the remote host which groks tilde expansion."
-  (let ((shell nil))
-    (tramp-send-command multi-method method user host "echo ~root")
-    (tramp-wait-for-output)
-    (cond
-     ((string-match "^~root$" (buffer-string))
-      (setq shell
-            (or (tramp-find-executable multi-method method user host
-                                      "bash"  tramp-remote-path t)
-                (tramp-find-executable multi-method method user host
-                                      "ksh" tramp-remote-path t)))
-      (unless shell
-        (error "Couldn't find a shell which groks tilde expansion"))
-      ;; Find arguments for this shell.
-      (let ((alist tramp-sh-extra-args)
-           item extra-args)
-       (while (and alist (null extra-args))
-         (setq item (pop alist))
-         (when (string-match (car item) shell)
-           (setq extra-args (cdr item))))
-       (when extra-args (setq shell (concat shell " " extra-args))))
-      (tramp-message
-       5 "Starting remote shell `%s' for tilde expansion..." shell)
-      (tramp-send-command
-       multi-method method user host
-       (concat "PROMPT_COMMAND='' PS1='$ ' exec " shell)) ;
-      (tramp-barf-if-no-shell-prompt
-       (get-buffer-process (current-buffer))
-       60 "Couldn't find remote `%s' prompt" shell)
-      (tramp-message
-       9 "Setting remote shell prompt...")
-      ;; Douglas Gray Stephens <DGrayStephens@slb.com> says that we
-      ;; must use "\n" here, not tramp-rsh-end-of-line.  Kai left the
-      ;; last tramp-rsh-end-of-line, Douglas wanted to replace that,
-      ;; as well.
-      (process-send-string
-       nil (format "PROMPT_COMMAND=''; PS1='%s%s%s'; PS2=''; PS3=''%s"
+(defun tramp-find-shell (vec)
+  "Opens a shell on the remote host which groks tilde expansion."
+  (unless (tramp-get-connection-property vec "remote-shell" nil)
+    (let (shell)
+      (with-current-buffer (tramp-get-buffer vec)
+       (tramp-send-command vec "echo ~root")
+       (cond
+        ((string-match "^~root$" (buffer-string))
+         (setq shell
+               (or (tramp-find-executable vec "bash" tramp-remote-path t)
+                   (tramp-find-executable vec "ksh" tramp-remote-path t)))
+         (unless shell
+           (tramp-error
+            vec 'file-error
+            "Couldn't find a shell which groks tilde expansion"))
+         ;; Find arguments for this shell.
+         (let ((alist tramp-sh-extra-args)
+               item extra-args)
+           (while (and alist (null extra-args))
+             (setq item (pop alist))
+             (when (string-match (car item) shell)
+               (setq extra-args (cdr item))))
+           (when extra-args (setq shell (concat shell " " extra-args))))
+         (tramp-message
+          vec 5 "Starting remote shell `%s' for tilde expansion..." shell)
+         (tramp-send-command-internal
+          vec (concat "PROMPT_COMMAND='' PS1='$ ' exec " shell))
+         (tramp-message vec 5 "Setting remote shell prompt...")
+         ;; Douglas Gray Stephens <DGrayStephens@slb.com> says that we
+         ;; must use "\n" here, not tramp-rsh-end-of-line.  Kai left the
+         ;; last tramp-rsh-end-of-line, Douglas wanted to replace that,
+         ;; as well.
+         (tramp-send-command
+          vec
+          (format "PROMPT_COMMAND=''; PS1='%s%s%s'; PS2=''; PS3=''"
                   tramp-rsh-end-of-line
                   tramp-end-of-output
-                  tramp-rsh-end-of-line
                   tramp-rsh-end-of-line))
-      (tramp-wait-for-output)
-      (tramp-message
-       9 "Setting remote shell prompt...done")
-      )
-     (t (tramp-message 5 "Remote `%s' groks tilde expansion, good"
-                      (tramp-get-method-parameter
-                       multi-method method user host 'tramp-remote-sh))))))
-
-(defun tramp-check-ls-command (multi-method method user host cmd)
-  "Checks whether the given `ls' executable groks `-n'.
-METHOD, USER and HOST specify the connection, CMD (the absolute file name of)
-the `ls' executable.  Returns t if CMD supports the `-n' option, nil
-otherwise."
-  (tramp-message 9 "Checking remote `%s' command for `-n' option" cmd)
-  (when (file-executable-p
-         (tramp-make-tramp-file-name multi-method method user host cmd))
-    (let ((result nil))
-      (tramp-message 7 "Testing remote command `%s' for -n..." cmd)
-      (setq result
-            (tramp-send-command-and-check
-             multi-method method user host
-             (format "%s -lnd / >/dev/null"
-                     cmd)))
-      (tramp-message 7 "Testing remote command `%s' for -n...%s"
-                   cmd
-                   (if (zerop result) "okay" "failed"))
-      (zerop result))))
-
-(defun tramp-check-ls-commands (multi-method method user host cmd dirlist)
-  "Checks whether the given `ls' executable in one of the dirs groks `-n'.
-Returns nil if none was found, else the command is returned."
-  (let ((dl dirlist)
-        (result nil))
-    (tramp-let-maybe directory-sep-char ?/ ;for XEmacs
-      ;; It would be better to use the CL function `find', but
-      ;; we don't want run-time dependencies on CL.
-      (while (and dl (not result))
-       (let ((x (concat (file-name-as-directory (car dl)) cmd)))
-         (when (tramp-check-ls-command multi-method method user host x)
-           (setq result x)))
-       (setq dl (cdr dl)))
-      result)))
-
-(defun tramp-find-ls-command (multi-method method user host)
-  "Finds an `ls' command which groks the `-n' option, returning nil if failed.
-\(This option prints numeric user and group ids in a long listing.)"
-  (tramp-message 9 "Finding a suitable `ls' command")
-  (or
-   (tramp-check-ls-commands multi-method method user host "ls" tramp-remote-path)
-   (tramp-check-ls-commands multi-method method user host "gnuls" tramp-remote-path)
-   (tramp-check-ls-commands multi-method method user host "gls" tramp-remote-path)))
+         (tramp-message vec 5 "Setting remote shell prompt...done"))
+        (t (tramp-message
+            vec 5 "Remote `%s' groks tilde expansion, good"
+            (tramp-get-method-parameter
+             (tramp-file-name-method vec) 'tramp-remote-sh))
+           (tramp-set-connection-property
+            vec "remote-shell"
+            (tramp-get-method-parameter
+             (tramp-file-name-method vec) 'tramp-remote-sh))))))))
 
 ;; ------------------------------------------------------------
 ;; -- Functions for establishing connection --
@@ -5437,639 +5257,208 @@ Returns nil if none was found, else the command is returned."
 ;; prompts from the remote host.  See the variable
 ;; `tramp-actions-before-shell' for usage of these functions.
 
-(defun tramp-action-login (p multi-method method user host)
+(defun tramp-action-login (proc vec)
   "Send the login name."
-  (tramp-message 9 "Sending login name `%s'"
-                (or user (user-login-name)))
-  (erase-buffer)
-  (process-send-string nil (concat (or user (user-login-name))
-                                  tramp-rsh-end-of-line)))
-
-(defun tramp-action-password (p multi-method method user host)
+  (when (not (stringp tramp-current-user))
+    (save-window-excursion
+      (let ((enable-recursive-minibuffers t))
+       (pop-to-buffer (tramp-get-connection-buffer vec))
+       (setq tramp-current-user (read-string (match-string 0))))))
+  (tramp-message vec 3 "Sending login name `%s'" tramp-current-user)
+  (with-current-buffer (tramp-get-connection-buffer vec)
+    (tramp-message vec 6 "\n%s" (buffer-string)))
+  (tramp-send-string vec tramp-current-user))
+
+(defun tramp-action-password (proc vec)
   "Query the user for a password."
-  (let ((pw-prompt
-        (format "Password for %s "
-                (tramp-make-tramp-file-name
-                 nil method user host ""))))
-    (tramp-message 9 "Sending password")
-    (tramp-enter-password p pw-prompt user host)))
-
-(defun tramp-action-succeed (p multi-method method user host)
+  (tramp-message vec 3 "Sending password")
+  (tramp-enter-password proc))
+
+(defun tramp-action-succeed (proc vec)
   "Signal success in finding shell prompt."
-  (tramp-message 9 "Found remote shell prompt.")
-  (erase-buffer)
   (throw 'tramp-action 'ok))
 
-(defun tramp-action-permission-denied (p multi-method method user host)
+(defun tramp-action-permission-denied (proc vec)
   "Signal permission denied."
-  (pop-to-buffer (tramp-get-buffer multi-method method user host))
-  (tramp-message 9 "Permission denied by remote host.")
-  (kill-process p)
+  (kill-process proc)
   (throw 'tramp-action 'permission-denied))
 
-(defun tramp-action-copy-failed (p multi-method method user host)
-  "Signal copy failed."
-  (kill-process p)
-  (error "%s" (match-string 1)))
-
-(defun tramp-action-yesno (p multi-method method user host)
+(defun tramp-action-yesno (proc vec)
   "Ask the user for confirmation using `yes-or-no-p'.
 Send \"yes\" to remote process on confirmation, abort otherwise.
 See also `tramp-action-yn'."
   (save-window-excursion
-    (pop-to-buffer (tramp-get-buffer multi-method method user host))
-    (unless (yes-or-no-p (match-string 0))
-      (kill-process p)
-      (erase-buffer)
-      (throw 'tramp-action 'permission-denied))
-    (process-send-string p (concat "yes" tramp-rsh-end-of-line))
-    (erase-buffer)))
-
-(defun tramp-action-yn (p multi-method method user host)
+    (let ((enable-recursive-minibuffers t))
+      (save-match-data (pop-to-buffer (tramp-get-connection-buffer vec)))
+      (unless (yes-or-no-p (match-string 0))
+       (kill-process proc)
+       (throw 'tramp-action 'permission-denied))
+      (with-current-buffer (tramp-get-connection-buffer vec)
+       (tramp-message vec 6 "\n%s" (buffer-string)))
+      (tramp-send-string vec "yes"))))
+
+(defun tramp-action-yn (proc vec)
   "Ask the user for confirmation using `y-or-n-p'.
 Send \"y\" to remote process on confirmation, abort otherwise.
 See also `tramp-action-yesno'."
   (save-window-excursion
-    (pop-to-buffer (tramp-get-buffer multi-method method user host))
-    (unless (y-or-n-p (match-string 0))
-      (kill-process p)
-      (throw 'tramp-action 'permission-denied))
-    (erase-buffer)
-    (process-send-string p (concat "y" tramp-rsh-end-of-line))))
-
-(defun tramp-action-terminal (p multi-method method user host)
+    (let ((enable-recursive-minibuffers t))
+      (save-match-data (pop-to-buffer (tramp-get-connection-buffer vec)))
+      (unless (y-or-n-p (match-string 0))
+       (kill-process proc)
+       (throw 'tramp-action 'permission-denied))
+      (with-current-buffer (tramp-get-connection-buffer vec)
+       (tramp-message vec 6 "\n%s" (buffer-string)))
+      (tramp-send-string vec "y"))))
+
+(defun tramp-action-terminal (proc vec)
   "Tell the remote host which terminal type to use.
 The terminal type can be configured with `tramp-terminal-type'."
-  (tramp-message 9 "Setting `%s' as terminal type."
-                tramp-terminal-type)
-  (erase-buffer)
-  (process-send-string nil (concat tramp-terminal-type
-                                  tramp-rsh-end-of-line)))
+  (tramp-message vec 5 "Setting `%s' as terminal type." tramp-terminal-type)
+  (tramp-send-string vec tramp-terminal-type))
 
-(defun tramp-action-process-alive (p multi-method method user host)
+(defun tramp-action-process-alive (proc vec)
   "Check whether a process has finished."
-  (unless (memq (process-status p) '(run open))
+  (unless (memq (process-status proc) '(run open))
     (throw 'tramp-action 'process-died)))
 
-(defun tramp-action-out-of-band (p multi-method method user host)
+(defun tramp-action-out-of-band (proc vec)
   "Check whether an out-of-band copy has finished."
-  (cond ((and (memq (process-status p) '(stop exit))
-             (zerop (process-exit-status p)))
-        (tramp-message 9 "Process has finished.")
+  (cond ((and (memq (process-status proc) '(stop exit))
+             (zerop (process-exit-status proc)))
+        (tramp-message vec 3 "Process has finished.")
         (throw 'tramp-action 'ok))
-       ((or (and (memq (process-status p) '(stop exit))
-                 (not (zerop (process-exit-status p))))
-            (memq (process-status p) '(signal)))
+       ((or (and (memq (process-status proc) '(stop exit))
+                 (not (zerop (process-exit-status proc))))
+            (memq (process-status proc) '(signal)))
         ;; `scp' could have copied correctly, but set modes could have failed.
         ;; This can be ignored.
-        (goto-char (point-min))
-        (if (re-search-forward tramp-operation-not-permitted-regexp nil t)
-            (progn
-              (tramp-message 10 "'set mode' error ignored.")
-              (tramp-message 9 "Process has finished.")
-              (throw 'tramp-action 'ok))
-          (tramp-message 9 "Process has died.")
-          (throw 'tramp-action 'process-died)))
+        (with-current-buffer (process-buffer proc)
+          (goto-char (point-min))
+          (if (re-search-forward tramp-operation-not-permitted-regexp nil t)
+              (progn
+                (tramp-message vec 5 "'set mode' error ignored.")
+                (tramp-message vec 3 "Process has finished.")
+                (throw 'tramp-action 'ok))
+            (tramp-message vec 3 "Process has died.")
+            (throw 'tramp-action 'process-died))))
        (t nil)))
 
-;; The following functions are specifically for multi connections.
-
-(defun tramp-multi-action-login (p method user host)
-  "Send the login name."
-  (tramp-message 9 "Sending login name `%s'" user)
-  (erase-buffer)
-  (process-send-string p (concat user tramp-rsh-end-of-line)))
-
-(defun tramp-multi-action-password (p method user host)
-  "Query the user for a password."
-  (let ((pw-prompt
-        (format "Password for %s "
-                (tramp-make-tramp-file-name
-                 nil method user host ""))))
-    (tramp-message 9 "Sending password")
-    (tramp-enter-password p pw-prompt user host)))
-
-(defun tramp-multi-action-succeed (p method user host)
-  "Signal success in finding shell prompt."
-  (tramp-message 9 "Found shell prompt on `%s'" host)
-  (erase-buffer)
-  (throw 'tramp-action 'ok))
-
-(defun tramp-multi-action-permission-denied (p method user host)
-  "Signal permission denied."
-  (tramp-message 9 "Permission denied by remote host `%s'" host)
-  (kill-process p)
-  (erase-buffer)
-  (throw 'tramp-action 'permission-denied))
-
-(defun tramp-multi-action-process-alive (p method user host)
-  "Check whether a process has finished."
-  (unless (memq (process-status p) '(run open))
-    (throw 'tramp-action 'process-died)))
-
 ;; Functions for processing the actions.
 
-(defun tramp-process-one-action (p multi-method method user host actions)
+(defun tramp-process-one-action (proc vec actions)
   "Wait for output from the shell and perform one action."
-  (let (found item pattern action todo)
-    (erase-buffer)
-    (tramp-message 9 "Waiting 60s for prompt from remote shell")
+  (let (found todo item pattern action)
     (while (not found)
-      (tramp-accept-process-output p 1)
-      (goto-char (point-min))
+      ;; Reread output once all actions have been performed.
+      ;; Obviously, the output was not complete.
+      (tramp-accept-process-output proc 1)
       (setq todo actions)
       (while todo
-       (goto-char (point-min))
        (setq item (pop todo))
-       (setq pattern (symbol-value (nth 0 item)))
+       (setq pattern (concat (symbol-value (nth 0 item)) "\\'"))
        (setq action (nth 1 item))
-       (tramp-message 10 "Looking for regexp \"%s\" from remote shell"
-                      pattern)
-       (when (re-search-forward (concat pattern "\\'") nil t)
-         (setq found (funcall action p multi-method method user host)))))
+       (tramp-message
+        vec 5 "Looking for regexp \"%s\" from remote shell" pattern)
+       (when (tramp-check-for-regexp proc pattern)
+         (tramp-message vec 5 "Call `%s'" (symbol-name action))
+         (setq found (funcall action proc vec)))))
     found))
 
-(defun tramp-process-actions
-  (p multi-method method user host actions &optional timeout)
+(defun tramp-process-actions (proc vec actions &optional timeout)
   "Perform actions until success or TIMEOUT."
-  (tramp-message 10 "%s" (mapconcat 'identity (process-command p) " "))
   (let (exit)
     (while (not exit)
-      (tramp-message 9 "Waiting for prompts from remote shell")
+      (tramp-message proc 3 "Waiting for prompts from remote shell")
       (setq exit
            (catch 'tramp-action
              (if timeout
                  (with-timeout (timeout)
-                   (tramp-process-one-action
-                    p multi-method method user host actions))
-               (tramp-process-one-action
-                p multi-method method user host actions))
-             nil)))
-    (unless (eq exit 'ok)
-      (tramp-clear-passwd user host)
-      (error "Login failed"))))
-
-;; For multi-actions.
-
-(defun tramp-process-one-multi-action (p method user host actions)
-  "Wait for output from the shell and perform one action."
-  (let (found item pattern action todo)
-    (erase-buffer)
-    (tramp-message 9 "Waiting 60s for prompt from remote shell")
-    (with-timeout (60 (throw 'tramp-action 'timeout))
-      (while (not found)
-       (tramp-accept-process-output p 1)
-       (setq todo actions)
-       (goto-char (point-min))
-       (while todo
-         (goto-char (point-min))
-         (setq item (pop todo))
-         (setq pattern (symbol-value (nth 0 item)))
-         (setq action (nth 1 item))
-         (tramp-message 10 "Looking for regexp \"%s\" from remote shell"
-                        pattern)
-         (when (re-search-forward (concat pattern "\\'") nil t)
-           (setq found (funcall action p method user host)))))
-      found)))
-
-(defun tramp-process-multi-actions (p method user host actions)
-  "Perform actions until success."
-  (let (exit)
-    (while (not exit)
-      (tramp-message 9 "Waiting for prompts from remote shell")
-      (setq exit
-           (catch 'tramp-action
-             (tramp-process-one-multi-action p method user host actions)
-             nil)))
+                   (tramp-process-one-action proc vec actions))
+               (tramp-process-one-action proc vec actions)))))
+    (with-current-buffer (tramp-get-connection-buffer vec)
+      (tramp-message vec 6 "\n%s" (buffer-string)))
     (unless (eq exit 'ok)
-      (tramp-clear-passwd user host)
-      (error "Login failed"))))
-
-;; Functions to execute when we have seen the remote shell prompt but
-;; before we exec the Bourne-ish shell.  Note that these commands
-;; might be sent to any shell, not just a Bourne-ish shell.  This
-;; means that the commands need to work in all shells.  (It is also
-;; okay for some commands to just fail with an error message, but
-;; please make sure that they at least don't crash the odd shell people
-;; might be running...)
-(defun tramp-process-initial-commands (p
-                                      multi-method method user host
-                                      commands)
-  "Send list of commands to remote host, in order."
-  (let (cmd)
-    (while commands
-      (setq cmd (pop commands))
-      (erase-buffer)
-      (tramp-message 10 "Sending command to remote shell: %s"
-                    cmd)
-      (tramp-send-command multi-method method user host cmd nil t)
-      (tramp-barf-if-no-shell-prompt
-       p 60 "Remote shell command failed: %s" cmd))
-    (erase-buffer)))
-
-;; The actual functions for opening connections.
-
-(defun tramp-open-connection-telnet (multi-method method user host)
-  "Open a connection using a telnet METHOD.
-This starts the command `telnet HOST ARGS'[*], then waits for a remote
-login prompt, then sends the user name USER, then waits for a remote
-password prompt.  It queries the user for the password, then sends the
-password to the remote host.
-
-If USER is nil, uses value returned by `(user-login-name)' instead.
-
-Recognition of the remote shell prompt is based on the variables
-`shell-prompt-pattern' and `tramp-shell-prompt-pattern' which must be
-set up correctly.
-
-Please note that it is NOT possible to use this connection method
-together with an out-of-band transfer method!  You must use an inline
-transfer method.
-
-Maybe the different regular expressions need to be tuned.
-
-* Actually, the telnet program as well as the args to be used can be
-  specified in the method parameters, see the variable `tramp-methods'."
-  (save-match-data
-    (when (tramp-method-out-of-band-p multi-method method user host)
-      (error "Cannot use out-of-band method `%s' with telnet connection method"
-             method))
-    (when multi-method
-      (error "Cannot multi-connect using telnet connection method"))
-    (tramp-pre-connection multi-method method user host tramp-chunksize)
-    (tramp-message 7 "Opening connection for %s@%s using %s..."
-                  (or user (user-login-name)) host method)
-    (let ((process-environment (copy-sequence process-environment)))
-      (setenv "TERM" tramp-terminal-type)
-      (setenv "PROMPT_COMMAND")
-      (setenv "PS1" "$ ")
-      (let* ((default-directory (tramp-temporary-file-directory))
-            ;; If we omit the conditional here, then we would use
-            ;; `undecided-dos' in some cases.  With the conditional,
-            ;; we use nil in these cases.  Which one is right?
-             (coding-system-for-read (unless (and (not (featurep 'xemacs))
-                                                  (> emacs-major-version 20))
-                                       tramp-dos-coding-system))
-             (p (apply 'start-process
-                       (tramp-buffer-name multi-method method user host)
-                       (tramp-get-buffer multi-method method user host)
-                      (tramp-get-method-parameter
-                       multi-method
-                       (tramp-find-method multi-method method user host)
-                       user host 'tramp-login-program)
-                       host
-                      (tramp-get-method-parameter
-                       multi-method
-                       (tramp-find-method multi-method method user host)
-                       user host 'tramp-login-args)))
-             (found nil)
-             (pw nil))
-        (tramp-set-process-query-on-exit-flag p nil)
-       (set-buffer (tramp-get-buffer multi-method method user host))
-       (erase-buffer)
-       (tramp-process-actions p multi-method method user host
-                              tramp-actions-before-shell 60)
-        (tramp-open-connection-setup-interactive-shell
-         p multi-method method user host)
-        (tramp-post-connection multi-method method user host)))))
-
-
-(defun tramp-open-connection-rsh (multi-method method user host)
-  "Open a connection using an rsh METHOD.
-This starts the command `rsh HOST -l USER'[*], then waits for a remote
-password or shell prompt.  If a password prompt is seen, the user is
-queried for a password, this function sends the password to the remote
-host and waits for a shell prompt.
-
-If USER is nil, start the command `rsh HOST'[*] instead
-
-Recognition of the remote shell prompt is based on the variables
-`shell-prompt-pattern' and `tramp-shell-prompt-pattern' which must be
-set up correctly.
-
-Kludgy feature: if HOST has the form \"xx#yy\", then yy is assumed to
-be a port number for ssh, and \"-p yy\" will be added to the list of
-arguments, and xx will be used as the host name to connect to.
-
-* Actually, the rsh program to be used can be specified in the
-  method parameters, see the variable `tramp-methods'."
-  (save-match-data
-    (when multi-method
-      (error "Cannot multi-connect using rsh connection method"))
-    (tramp-pre-connection multi-method method user host tramp-chunksize)
-    (if (and user (not (string= user "")))
-       (tramp-message 7 "Opening connection for %s@%s using %s..."
-                      user host method)
-      (tramp-message 7 "Opening connection at %s using %s..." host method))
-    (let ((process-environment (copy-sequence process-environment))
-         (bufnam (tramp-buffer-name multi-method method user host))
-         (buf (tramp-get-buffer multi-method method user host))
-         (login-program (tramp-get-method-parameter
-                       multi-method
-                       (tramp-find-method multi-method method user host)
-                       user host 'tramp-login-program))
-         (login-args (mapcar
-                      (lambda (x)
-                        (format-spec
-                         x `((?t . ,(format "/tmp/%s" tramp-temp-name-prefix)))))
-                      (tramp-get-method-parameter
-                       multi-method
-                       (tramp-find-method multi-method method user host)
-                       user host 'tramp-login-args)))
-         (real-host host))
-      ;; The following should be changed.  We need a more general
-      ;; mechanism to parse extra host args.
-      (when (string-match "\\([^#]*\\)#\\(.*\\)" host)
-       (setq login-args (cons "-p" (cons (match-string 2 host) login-args)))
-       (setq real-host (match-string 1 host)))
-      (setenv "TERM" tramp-terminal-type)
-      (setenv "PROMPT_COMMAND")
-      (setenv "PS1" "$ ")
-      (let* ((default-directory (tramp-temporary-file-directory))
-            ;; If we omit the conditional, we would use
-            ;; `undecided-dos' in some cases.  With the conditional,
-            ;; we use nil in these cases.  Which one is right?
-             (coding-system-for-read (unless (and (not (featurep 'xemacs))
-                                                  (> emacs-major-version 20))
-                                       tramp-dos-coding-system))
-             (p (if (and user (not (string= user "")))
-                    (apply #'start-process bufnam buf login-program
-                           real-host "-l" user login-args)
-                  (apply #'start-process bufnam buf login-program
-                         real-host login-args)))
-             (found nil))
-        (tramp-set-process-query-on-exit-flag p nil)
-
-       (set-buffer buf)
-       (tramp-process-actions p multi-method method user host
-                              tramp-actions-before-shell 60)
-        (tramp-message 7 "Initializing remote shell")
-        (tramp-open-connection-setup-interactive-shell
-         p multi-method method user host)
-        (tramp-post-connection multi-method method user host)))))
-
-(defun tramp-open-connection-su (multi-method method user host)
-  "Open a connection using the `su' program with METHOD.
-This starts `su - USER', then waits for a password prompt.  The HOST
-name must be equal to the local host name or to `localhost'.
-
-If USER is nil, uses value returned by user-login-name instead.
-
-Recognition of the remote shell prompt is based on the variables
-`shell-prompt-pattern' and `tramp-shell-prompt-pattern' which must be
-set up correctly.  Note that the other user may have a different shell
-prompt than you do, so it is not at all unlikely that the variable
-`shell-prompt-pattern' is set up wrongly!"
-  (save-match-data
-    (when (tramp-method-out-of-band-p multi-method method user host)
-      (error "Cannot use out-of-band method `%s' with `su' connection method"
-             method))
-    (unless (or (string-match (concat "^" (regexp-quote host))
-                              (system-name))
-                (string= "localhost" host)
-               (string= "" host))
-      (error
-       "Cannot connect to different host `%s' with `su' connection method"
-       host))
-    (tramp-pre-connection multi-method method user host tramp-chunksize)
-    (tramp-message 7 "Opening connection for `%s' using `%s'..."
-                  (or user "<root>") method)
-    (let ((process-environment (copy-sequence process-environment)))
-      (setenv "TERM" tramp-terminal-type)
-      (setenv "PROMPT_COMMAND")
-      (setenv "PS1" "$ ")
-      (let* ((default-directory (tramp-temporary-file-directory))
-            ;; If we omit the conditional, we use `undecided-dos' in
-            ;; some cases.  With the conditional, we use nil in these
-            ;; cases.  What's the difference?  Which one is right?
-             (coding-system-for-read (unless (and (not (featurep 'xemacs))
-                                                  (> emacs-major-version 20))
-                                       tramp-dos-coding-system))
-             (p (apply 'start-process
-                       (tramp-buffer-name multi-method method user host)
-                       (tramp-get-buffer multi-method method user host)
-                      (tramp-get-method-parameter
-                       multi-method
-                       (tramp-find-method multi-method method user host)
-                       user host 'tramp-login-program)
-                       (mapcar
-                        (lambda (x)
-                         (format-spec x `((?u . ,(or user "root")))))
-                        (tramp-get-method-parameter
-                        multi-method
-                        (tramp-find-method multi-method method user host)
-                        user host 'tramp-login-args))))
-             (found nil)
-             (pw nil))
-        (tramp-set-process-query-on-exit-flag p nil)
-       (set-buffer (tramp-get-buffer multi-method method user host))
-       (tramp-process-actions p multi-method method user host
-                              tramp-actions-before-shell 60)
-        (tramp-open-connection-setup-interactive-shell
-         p multi-method method user host)
-        (tramp-post-connection multi-method method
-                               user host)))))
-
-;; HHH: Not Changed.  Multi method.  It is not clear to me how this can
-;;      handle not giving a user name in the "file name".
-;;
-;;      This is more difficult than for the single-hop method.  In the
-;;      multi-hop-method, the desired behaviour should be that the
-;;      user must specify names for the telnet hops of which the user
-;;      name is different than the "original" name (or different from
-;;      the previous hop.
-(defun tramp-open-connection-multi (multi-method method user host)
-  "Open a multi-hop connection using METHOD.
-This uses a slightly changed file name syntax.  The idea is to say
-    [multi/telnet:u1@h1/rsh:u2@h2]/path/to/file
-This will use telnet to log in as u1 to h1, then use rsh from there to
-log in as u2 to h2."
-  (save-match-data
-    (unless multi-method
-      (error "Multi-hop open connection function called on non-multi method"))
-    (when (tramp-method-out-of-band-p multi-method method user host)
-      (error "No out of band multi-hop connections"))
-    (unless (and (arrayp method) (not (stringp method)))
-      (error "METHOD must be an array of strings for multi methods"))
-    (unless (and (arrayp user) (not (stringp user)))
-      (error "USER must be an array of strings for multi methods"))
-    (unless (and (arrayp host) (not (stringp host)))
-      (error "HOST must be an array of strings for multi methods"))
-    (unless (and (= (length method) (length user))
-                 (= (length method) (length host)))
-      (error "Arrays METHOD, USER, HOST must have equal length"))
-    (tramp-pre-connection multi-method method user host tramp-chunksize)
-    (tramp-message 7 "Opening `%s' connection..." multi-method)
-    (let ((process-environment (copy-sequence process-environment)))
-      (setenv "TERM" tramp-terminal-type)
-      (setenv "PROMPT_COMMAND")
-      (setenv "PS1" "$ ")
-      (let* ((default-directory (tramp-temporary-file-directory))
-            ;; If we omit the conditional, we use `undecided-dos' in
-            ;; some cases.  With the conditional, we use nil in these
-            ;; cases.  What's the difference?  Which one is right?
-             (coding-system-for-read (unless (and (not (featurep 'xemacs))
-                                                  (> emacs-major-version 20))
-                                       tramp-dos-coding-system))
-             (p (start-process (tramp-buffer-name multi-method method user host)
-                               (tramp-get-buffer multi-method method user host)
-                               tramp-multi-sh-program))
-             (num-hops (length method))
-             (i 0))
-        (tramp-set-process-query-on-exit-flag p nil)
-        (tramp-message 9 "Waiting 60s for local shell to come up...")
-        (unless (tramp-wait-for-regexp
-                p 60 (format "\\(%s\\)\\'\\|\\(%s\\)\\'"
-                             shell-prompt-pattern tramp-shell-prompt-pattern))
-          (pop-to-buffer (buffer-name))
-          (kill-process p)
-          (error "Couldn't find local shell prompt"))
-        ;; Now do all the connections as specified.
-        (while (< i num-hops)
-          (let* ((m (aref method i))
-                 (u (aref user i))
-                 (h (aref host i))
-                 (entry (assoc m tramp-multi-connection-function-alist))
-                 (multi-func (nth 1 entry))
-                 (command (nth 2 entry)))
-           ;; The multi-funcs don't need to do save-match-data, as that
-            ;; is done here.
-            (funcall multi-func p m u h command)
-            (erase-buffer)
-            (setq i (1+ i))))
-        (tramp-open-connection-setup-interactive-shell
-         p multi-method method user host)
-        (tramp-post-connection multi-method method user host)))))
-
-;; HHH: Changed.  Multi method.  Don't know how to handle this in the case
-;;      of no user name provided.  Hack to make it work as it did before:
-;;      changed `user' to `(or user (user-login-name))' in the places where
-;;      the value is actually used.
-(defun tramp-multi-connect-telnet (p method user host command)
-  "Issue `telnet' command.
-Uses shell COMMAND to issue a `telnet' command to log in as USER to
-HOST.  You can use percent escapes in COMMAND: `%h' is replaced with
-the host name, and `%n' is replaced with an end of line character, as
-set in `tramp-rsh-end-of-line'.  Use `%%' if you want a literal percent
-character.
-
-If USER is nil, uses the return value of (user-login-name) instead."
-  (let ((cmd (format-spec command
-                         `((?h . ,host) (?n . ,tramp-rsh-end-of-line))))
-        (cmd1 (format-spec command `((?h . ,host) (?n . ""))))
-        found pw)
-    (erase-buffer)
-    (tramp-message 9 "Sending telnet command `%s'" cmd1)
-    (process-send-string p cmd)
-    (tramp-process-multi-actions p method user host
-                                tramp-multi-actions)))
-
-;; HHH: Changed.  Multi method.  Don't know how to handle this in the case
-;;      of no user name provided.  Hack to make it work as it did before:
-;;      changed `user' to `(or user (user-login-name))' in the places where
-;;      the value is actually used.
-(defun tramp-multi-connect-rlogin (p method user host command)
-  "Issue `rlogin' command.
-Uses shell COMMAND to issue an `rlogin' command to log in as USER to
-HOST.  You can use percent escapes in COMMAND.  `%u' will be replaced
-with the user name, `%h' will be replaced with the host name, and `%n'
-will be replaced with the value of `tramp-rsh-end-of-line'.  You can use
-`%%' if you want to use a literal percent character.
-
-If USER is nil, uses the return value of (user-login-name) instead."
-  (let ((cmd (format-spec command `((?h . ,host)
-                                   (?u . ,(or user (user-login-name)))
-                                   (?n . ,tramp-rsh-end-of-line))))
-        (cmd1 (format-spec command `((?h . ,host)
-                                    (?u . ,(or user (user-login-name)))
-                                    (?n . ""))))
-        found)
-    (erase-buffer)
-    (tramp-message 9 "Sending rlogin command `%s'" cmd1)
-    (process-send-string p cmd)
-    (tramp-process-multi-actions p method user host
-                                tramp-multi-actions)))
-
-;; HHH: Changed.  Multi method.  Don't know how to handle this in the case
-;;      of no user name provided.  Hack to make it work as it did before:
-;;      changed `user' to `(or user (user-login-name))' in the places where
-;;      the value is actually used.
-(defun tramp-multi-connect-su (p method user host command)
-  "Issue `su' command.
-Uses shell COMMAND to issue a `su' command to log in as USER on
-HOST.  The HOST name is ignored, this just changes the user id on the
-host currently logged in to.
-
-If USER is nil, uses the return value of (user-login-name) instead.
-
-You can use percent escapes in the COMMAND.  `%u' is replaced with the
-user name, and `%n' is replaced with the value of
-`tramp-rsh-end-of-line'.  Use `%%' if you want a literal percent
-character."
-  (let ((cmd (format-spec command `((?u . ,(or user (user-login-name)))
-                                   (?n . ,tramp-rsh-end-of-line))))
-        (cmd1 (format-spec command `((?u . ,(or user (user-login-name)))
-                                    (?n . ""))))
-        found)
-    (erase-buffer)
-    (tramp-message 9 "Sending su command `%s'" cmd1)
-    (process-send-string p cmd)
-    (tramp-process-multi-actions p method user host
-                                tramp-multi-actions)))
+      (tramp-clear-passwd)
+      (tramp-error-with-buffer
+       nil vec 'file-error
+       (cond
+       ((eq exit 'permission-denied) "Permission denied")
+       ((eq exit 'process-died) "Process died")
+       (t "Login failed"))))))
 
 ;; Utility functions.
 
-(defun tramp-accept-process-output
-  (&optional process timeout timeout-msecs)
+(defun tramp-accept-process-output (&optional proc timeout timeout-msecs)
   "Like `accept-process-output' for Tramp processes.
 This is needed in order to hide `last-coding-system-used', which is set
 for process communication also."
-  (let (last-coding-system-used)
-    (accept-process-output process timeout timeout-msecs)))
+  (with-current-buffer (process-buffer proc)
+    (tramp-message proc 10 "%s %s" proc (process-status proc))
+    (let (buffer-read-only last-coding-system-used)
+      ;; Under Windows XP, accept-process-output doesn't return
+      ;; sometimes.  So we add an additional timeout.
+      (with-timeout ((or timeout 1))
+       (accept-process-output proc timeout timeout-msecs)))
+    (tramp-message proc 10 "\n%s" (buffer-string))))
+
+(defun tramp-check-for-regexp (proc regexp)
+  "Check whether REGEXP is contained in process buffer of PROC.
+Erase echoed commands if exists."
+  (with-current-buffer (process-buffer proc)
+    (goto-char (point-min))
+    ;; Check whether we need to remove echo output.
+    (when (and (tramp-get-connection-property proc "check-remote-echo" nil)
+              (re-search-forward tramp-echoed-echo-mark-regexp nil t))
+      (let ((begin (match-beginning 0)))
+       (when (re-search-forward tramp-echoed-echo-mark-regexp nil t)
+         ;; Discard echo from remote output.
+         (tramp-set-connection-property proc "check-remote-echo" nil)
+         (tramp-message proc 5 "echo-mark found")
+         (forward-line)
+         (delete-region begin (point))
+         (goto-char (point-min)))))
+    ;; No echo to be handled, now we can look for the regexp.
+    (when (not (tramp-get-connection-property proc "check-remote-echo" nil))
+      (re-search-forward regexp nil t))))
 
 (defun tramp-wait-for-regexp (proc timeout regexp)
   "Wait for a REGEXP to appear from process PROC within TIMEOUT seconds.
 Expects the output of PROC to be sent to the current buffer.  Returns
 the string that matched, or nil.  Waits indefinitely if TIMEOUT is
 nil."
-  (let ((found nil)
-        (start-time (current-time)))
-    (cond (timeout
-           ;; Work around a bug in XEmacs 21, where the timeout
-           ;; expires faster than it should.  This degenerates
-           ;; to polling for buggy XEmacsen, but oh, well.
-           (while (and (not found)
-                       (< (tramp-time-diff (current-time) start-time)
-                          timeout))
-             (with-timeout (timeout)
-               (while (not found)
-                 (tramp-accept-process-output proc 1)
-                (unless (memq (process-status proc) '(run open))
-                  (error "Process has died"))
-                 (goto-char (point-min))
-                 (setq found (re-search-forward regexp nil t))))))
-          (t
-           (while (not found)
-             (tramp-accept-process-output proc 1)
-            (unless (memq (process-status proc) '(run open))
-              (error "Process has died"))
-             (goto-char (point-min))
-             (setq found (re-search-forward regexp nil t)))))
-    (when tramp-debug-buffer
-      (append-to-buffer
-       (tramp-get-debug-buffer tramp-current-multi-method tramp-current-method
-                             tramp-current-user tramp-current-host)
-       (point-min) (point-max))
+  (with-current-buffer (process-buffer proc)
+    (let ((found (tramp-check-for-regexp proc regexp))
+         (start-time (current-time)))
+      (cond (timeout
+            ;; Work around a bug in XEmacs 21, where the timeout
+            ;; expires faster than it should.  This degenerates
+            ;; to polling for buggy XEmacsen, but oh, well.
+            (while (and (not found)
+                        (< (tramp-time-diff (current-time) start-time)
+                           timeout))
+              (with-timeout (timeout)
+                (while (not found)
+                  (tramp-accept-process-output proc 1)
+                  (unless (memq (process-status proc) '(run open))
+                    (tramp-error-with-buffer
+                     nil proc 'file-error "Process has died"))
+                  (setq found (tramp-check-for-regexp proc regexp))))))
+           (t
+            (while (not found)
+              (tramp-accept-process-output proc 1)
+              (unless (memq (process-status proc) '(run open))
+                (tramp-error-with-buffer
+                 nil proc 'file-error "Process has died"))
+              (setq found (tramp-check-for-regexp proc regexp)))))
+      (tramp-message proc 6 "\n%s" (buffer-string))
       (when (not found)
-        (save-excursion
-          (set-buffer
-           (tramp-get-debug-buffer tramp-current-multi-method tramp-current-method
-                             tramp-current-user tramp-current-host))
-          (goto-char (point-max))
-          (insert "[[Regexp `" regexp "' not found"
-                  (if timeout (format " in %d secs" timeout) "")
-                  "]]"))))
-    found))
+       (if timeout
+           (tramp-error
+            proc 'file-error "[[Regexp `%s' not found in %d secs]]"
+            regexp timeout)
+         (tramp-error proc 'file-error "[[Regexp `%s' not found]]" regexp)))
+      found)))
 
 (defun tramp-wait-for-shell-prompt (proc timeout)
   "Wait for the shell prompt to appear from process PROC within TIMEOUT seconds.
@@ -6086,51 +5475,23 @@ and `tramp-shell-prompt-pattern'."
 Looks at process PROC to see if a shell prompt appears in TIMEOUT
 seconds.  If not, it produces an error message with the given ERROR-ARGS."
   (unless (tramp-wait-for-shell-prompt proc timeout)
-    (pop-to-buffer (buffer-name))
-    (apply 'error error-args)))
-
-(defun tramp-enter-password (p prompt user host)
-  "Prompt for a password and send it to the remote end.
-Uses PROMPT as a prompt and sends the password to process P."
-  (let ((pw (tramp-read-passwd user host prompt)))
-    (erase-buffer)
-    (process-send-string
-     p (concat pw
-              (or (tramp-get-method-parameter
-                   tramp-current-multi-method
-                   tramp-current-method
-                   tramp-current-user
-                   tramp-current-host
-                   'tramp-password-end-of-line)
-                  tramp-default-password-end-of-line)))))
-
-;; HHH: Not Changed.  This might handle the case where USER is not
-;;      given in the "File name" very poorly.  Then, the local
-;;      variable tramp-current-user will be set to nil.
-(defun tramp-pre-connection (multi-method method user host chunksize)
-  "Do some setup before actually logging in.
-METHOD, USER and HOST specify the connection."
-  (set-buffer (tramp-get-buffer multi-method method user host))
-  (set (make-local-variable 'tramp-current-multi-method) multi-method)
-  (set (make-local-variable 'tramp-current-method) method)
-  (set (make-local-variable 'tramp-current-user)   user)
-  (set (make-local-variable 'tramp-current-host)   host)
-  (set (make-local-variable 'tramp-chunksize)      chunksize)
-  (set (make-local-variable 'inhibit-eol-conversion) nil)
-  (erase-buffer))
-
-(defun tramp-open-connection-setup-interactive-shell
-  (p multi-method method user host)
+    (apply 'tramp-error-with-buffer nil proc 'file-error error-args)))
+
+;; We don't call `tramp-send-string' in order to hide the password from the
+;; debug buffer, and because end-of-line handling of the string.
+(defun tramp-enter-password (p)
+  "Prompt for a password and send it to the remote end."
+  (process-send-string
+   p (concat (tramp-read-passwd p)
+            (or (tramp-get-method-parameter
+                 tramp-current-method
+                 'tramp-password-end-of-line)
+                tramp-default-password-end-of-line))))
+
+(defun tramp-open-connection-setup-interactive-shell (proc vec)
   "Set up an interactive shell.
-Mainly sets the prompt and the echo correctly.  P is the shell process
-to set up.  METHOD, USER and HOST specify the connection."
-  ;; Wait a bit in case the remote end feels like sending a little
-  ;; junk first.  It seems that fencepost.gnu.org does this when doing
-  ;; a Kerberos login.
-  (sit-for 1)
-  (tramp-discard-garbage-erase-buffer p multi-method method user host)
-  (tramp-process-initial-commands p multi-method method user host
-                                 tramp-initial-commands)
+Mainly sets the prompt and the echo correctly.  PROC is the shell
+process to set up.  VEC specifies the connection."
   ;; It is useful to set the prompt in the following command because
   ;; some people have a setting for $PS1 which /bin/sh doesn't know
   ;; about and thus /bin/sh will display a strange prompt.  For
@@ -6145,116 +5506,84 @@ to set up.  METHOD, USER and HOST specify the connection."
   ;; clobbering $PS1.  $PROMP_COMMAND is another way to set the prompt
   ;; in /bin/bash, it must be discarded as well.
   (tramp-send-command-internal
-   multi-method method user host
+   vec
    (format "exec env 'ENV=' 'PROMPT_COMMAND=' 'PS1=$ ' %s"
           (tramp-get-method-parameter
-           multi-method method user host 'tramp-remote-sh))
-   (format "remote `%s' to come up"
-          (tramp-get-method-parameter
-           multi-method method user host 'tramp-remote-sh)))
-  (tramp-barf-if-no-shell-prompt
-   p 30
-   "Remote `%s' didn't come up.  See buffer `%s' for details"
-   (tramp-get-method-parameter multi-method method user host 'tramp-remote-sh)
-   (buffer-name))
-  (tramp-message 8 "Setting up remote shell environment")
-  (tramp-discard-garbage-erase-buffer p multi-method method user host)
-  (tramp-send-command-internal multi-method method user host
-                              "stty -inlcr -echo kill '^U'")
-  (erase-buffer)
-  ;; Ignore garbage after stty command.
-  (tramp-send-command-internal multi-method method user host
-                              "echo foo")
-  (erase-buffer)
-  (tramp-send-command-internal multi-method method user host
-                              "TERM=dumb; export TERM")
-  (erase-buffer)
-  ;; Check whether the remote host suffers from buggy `send-process-string'.
-  ;; This is known for FreeBSD (see comment in `send_process', file process.c).
-  ;; I've tested sending 624 bytes successfully, sending 625 bytes failed.
-  ;; Emacs makes a hack when this host type is detected locally.  It cannot
-  ;; handle remote hosts, though.
-  (when (or (not tramp-chunksize) (zerop tramp-chunksize))
-    (tramp-message 9 "Checking remote host type for `send-process-string' bug")
-    (tramp-send-command-internal multi-method method user host
-                                "(uname -sr) 2>/dev/null")
+           (tramp-file-name-method vec) 'tramp-remote-sh)))
+  (tramp-message vec 5 "Setting up remote shell environment")
+  (tramp-send-command-internal vec "stty -inlcr -echo kill '^U' erase '^H'")
+  ;; Check whether the echo has really been disabled.  Some
+  ;; implementations, like busybox of embedded GNU/Linux, don't
+  ;; support disabling.
+  (tramp-send-command-internal vec "echo foo")
+  (with-current-buffer (process-buffer proc)
     (goto-char (point-min))
-    (when (looking-at "FreeBSD")
-      (setq tramp-chunksize 500)))
-
+    (when (looking-at "echo foo")
+      (tramp-set-connection-property vec "remote-echo" t)
+      (tramp-message vec 5 "Remote echo still on. Ok.")
+      ;; Make sure backspaces and their echo are enabled and no line
+      ;; width magic interferes with them.
+      (tramp-send-command-internal vec "stty icanon erase ^H cols 32767")))
   ;; Try to set up the coding system correctly.
   ;; CCC this can't be the right way to do it.  Hm.
-  (save-excursion
-    (erase-buffer)
-    (tramp-message 9 "Determining coding system")
-    (tramp-send-command-internal multi-method method user host
-                                "echo foo ; echo bar")
+  (tramp-message vec 5 "Determining coding system")
+  (tramp-send-command-internal vec "echo foo ; echo bar")
+  (with-current-buffer (process-buffer proc)
     (goto-char (point-min))
     (if (featurep 'mule)
-        ;; Use MULE to select the right EOL convention for communicating
-        ;; with the process.
-        (let* ((cs (or (process-coding-system p) (cons 'undecided 'undecided)))
-               cs-decode cs-encode)
-          (when (symbolp cs) (setq cs (cons cs cs)))
-          (setq cs-decode (car cs))
-          (setq cs-encode (cdr cs))
-          (unless cs-decode (setq cs-decode 'undecided))
-          (unless cs-encode (setq cs-encode 'undecided))
-          (setq cs-encode (tramp-coding-system-change-eol-conversion
-                           cs-encode 'unix))
-          (when (search-forward "\r" nil t)
-            (setq cs-decode (tramp-coding-system-change-eol-conversion
-                             cs-decode 'dos)))
-          (set-buffer-process-coding-system cs-decode cs-encode))
+       ;; Use MULE to select the right EOL convention for communicating
+       ;; with the process.
+       (let* ((cs (or (process-coding-system proc)
+                      (cons 'undecided 'undecided)))
+              cs-decode cs-encode)
+         (when (symbolp cs) (setq cs (cons cs cs)))
+         (setq cs-decode (car cs))
+         (setq cs-encode (cdr cs))
+         (unless cs-decode (setq cs-decode 'undecided))
+         (unless cs-encode (setq cs-encode 'undecided))
+         (setq cs-encode (tramp-coding-system-change-eol-conversion
+                          cs-encode 'unix))
+         (when (search-forward "\r" nil t)
+           (setq cs-decode (tramp-coding-system-change-eol-conversion
+                            cs-decode 'dos)))
+         (set-buffer-process-coding-system cs-decode cs-encode))
       ;; Look for ^M and do something useful if found.
       (when (search-forward "\r" nil t)
-        ;; We have found a ^M but cannot frob the process coding system
-        ;; because we're running on a non-MULE Emacs.  Let's try
-        ;; stty, instead.
-       (erase-buffer)
-        (tramp-message 9 "Trying `stty -onlcr'")
-       (tramp-send-command-internal multi-method method user host
-                                    "stty -onlcr"))))
-  (erase-buffer)
-  (tramp-message
-   9 "Waiting 30s for `HISTFILE=$HOME/.tramp_history; HISTSIZE=1; export HISTFILE; export HISTSIZE'")
-  (tramp-send-command-internal
-   multi-method method user host
-   "HISTFILE=$HOME/.tramp_history; HISTSIZE=1; export HISTFILE; export HISTSIZE")
-  (erase-buffer)
-  (tramp-message 9 "Waiting 30s for `set +o vi +o emacs'")
-  (tramp-send-command-internal multi-method method user host
-                              "set +o vi +o emacs")
-  (erase-buffer)
-  (tramp-message 9 "Waiting 30s for `unset MAIL MAILCHECK MAILPATH'")
-  (tramp-send-command-internal
-   multi-method method user host
-   "unset MAIL MAILCHECK MAILPATH 1>/dev/null 2>/dev/null")
-  (erase-buffer)
-  (tramp-message 9 "Waiting 30s for `unset CDPATH'")
-  (tramp-send-command-internal multi-method method user host
-                              "unset CDPATH")
-  (erase-buffer)
-  (tramp-message 9 "Setting shell prompt")
+       ;; We have found a ^M but cannot frob the process coding system
+       ;; because we're running on a non-MULE Emacs.  Let's try
+       ;; stty, instead.
+       (tramp-send-command-internal vec "stty -onlcr"))))
+  (tramp-send-command-internal vec "set +o vi +o emacs")
+  (tramp-message vec 5 "Setting shell prompt")
   ;; Douglas Gray Stephens <DGrayStephens@slb.com> says that we must
   ;; use "\n" here, not tramp-rsh-end-of-line.  We also manually frob
-  ;; the last time we sent a command, to avoid tramp-send-command to send
-  ;; "echo are you awake".
-  (setq tramp-last-cmd-time (current-time))
+  ;; the last time we sent a command, to avoid `tramp-send-command' to
+  ;; send "echo are you awake".
   (tramp-send-command
-   multi-method method user host
+   vec
    (format "PROMPT_COMMAND=''; PS1='%s%s%s'; PS2=''; PS3=''"
           tramp-rsh-end-of-line
            tramp-end-of-output
           tramp-rsh-end-of-line))
-  (tramp-wait-for-output))
-
-(defun tramp-post-connection (multi-method method user host)
-  "Prepare a remote shell before being able to work on it.
-METHOD, USER and HOST specify the connection.
-Among other things, this finds a shell which groks tilde expansion,
-tries to find an `ls' command which groks the `-n' option, sets the
-locale to C and sets up the remote shell search path."
+  ;; Check whether the remote host suffers from buggy `send-process-string'.
+  ;; This is known for FreeBSD (see comment in `send_process', file process.c).
+  ;; I've tested sending 624 bytes successfully, sending 625 bytes failed.
+  ;; Emacs makes a hack when this host type is detected locally.  It cannot
+  ;; handle remote hosts, though.
+  (with-connection-property proc "chunksize"
+    (cond
+     ((and (integerp tramp-chunksize) (> tramp-chunksize 0))
+      tramp-chunksize)
+     (t
+      (tramp-message
+       vec 5 "Checking remote host type for `send-process-string' bug")
+      (if (string-match
+          "^FreeBSD"
+          (with-connection-property vec "uname"
+            (tramp-send-command-and-read vec "echo \\\"`uname -sr`\\\"")))
+         500 0))))
+  ;; Set remote PATH variable.
+  (tramp-set-remote-path vec)
   ;; Search for a good shell before searching for a command which
   ;; checks if a file exists. This is done because Tramp wants to use
   ;; "test foo; echo $?" to check if various conditions hold, and
@@ -6263,168 +5592,23 @@ locale to C and sets up the remote shell search path."
   ;; the Solaris /bin/sh is a problem.  I'm betting that all systems
   ;; with buggy /bin/sh implementations will have a working bash or
   ;; ksh.  Whee...
-  (tramp-find-shell multi-method method user host)
-  ;; Without (sit-for 0.1) at least, my machine will almost always blow
-  ;; up on 'not numberp /root' - a race that causes the 'echo ~root'
-  ;; output of (tramp-find-shell) to show up along with the output of
-  ;; (tramp-find-ls-command) testing.
-  ;;
-  ;; I can't work out why this is a problem though. The (tramp-wait-for-output)
-  ;; call in (tramp-find-shell) *should* make this not happen, I thought.
-  ;;
-  ;; After much debugging I couldn't find any problem with the implementation
-  ;; of that function though. The workaround stays for me at least. :/
-  ;;
-  ;; Daniel Pittman <daniel@danann.net>
-  (sleep-for 1)
-  (erase-buffer)
-  (tramp-find-file-exists-command multi-method method user host)
-  (make-local-variable 'tramp-ls-command)
-  (setq tramp-ls-command (tramp-find-ls-command multi-method method user host))
-  (unless tramp-ls-command
-    (tramp-message
-     1
-     "Danger!  Couldn't find ls which groks -n.  Muddling through anyway")
-    (setq tramp-ls-command
-          (tramp-find-executable multi-method method user host
-                               "ls" tramp-remote-path nil)))
-  (unless tramp-ls-command
-    (error "Fatal error: Couldn't find remote executable `ls'"))
-  (tramp-message 5 "Using remote command `%s' for getting directory listings"
-               tramp-ls-command)
-  (tramp-send-command multi-method method user host
-                    (concat "tramp_set_exit_status () {" tramp-rsh-end-of-line
-                            "return $1" tramp-rsh-end-of-line
-                            "}"))
-  (tramp-wait-for-output)
-  ;; Set remote PATH variable.
-  (tramp-set-remote-path multi-method method user host "PATH" tramp-remote-path)
-  ;; Tell remote shell to use standard time format, needed for
-  ;; parsing `ls -l' output.
-  (tramp-send-command multi-method method user host
-                    "LC_TIME=C; export LC_TIME; echo huhu")
-  (tramp-wait-for-output)
-  (tramp-send-command multi-method method user host
-                    "mesg n; echo huhu")
-  (tramp-wait-for-output)
-  (tramp-send-command multi-method method user host
-                    "biff n ; echo huhu")
-  (tramp-wait-for-output)
-  ;; Unalias ls(1) to work around issues with those silly people who make it
-  ;; spit out ANSI escapes or whatever.
-  (tramp-send-command multi-method method user host
-                    "unalias ls; echo huhu")
-  (tramp-wait-for-output)
-  ;; Does `test A -nt B' work?  Use abominable `find' construct if it
-  ;; doesn't.  BSD/OS 4.0 wants the parentheses around the command,
-  ;; for otherwise the shell crashes.
-  (erase-buffer)
-  (make-local-variable 'tramp-test-groks-nt)
-  (tramp-send-command multi-method method user host
-                    "( test / -nt / )")
-  (tramp-wait-for-output)
-  (goto-char (point-min))
-  (setq tramp-test-groks-nt
-        (looking-at (format "\n%s\r?\n" (regexp-quote tramp-end-of-output))))
-  (unless tramp-test-groks-nt
-    (tramp-send-command
-     multi-method method user host
-     (concat "tramp_test_nt () {" tramp-rsh-end-of-line
-             "test -n \"`find $1 -prune -newer $2 -print`\"" tramp-rsh-end-of-line
-             "}")))
-  (tramp-wait-for-output)
-  ;; Send the fallback `uudecode' script.
-  (erase-buffer)
-  (tramp-send-string multi-method method user host tramp-uudecode)
-  (tramp-wait-for-output)
-  ;; Find a `perl'.
-  (erase-buffer)
-  (tramp-set-connection-property "perl-scripts" nil multi-method method user host)
-  (let ((tramp-remote-perl
-        (or (tramp-find-executable multi-method method user host
-                                   "perl5" tramp-remote-path nil)
-            (tramp-find-executable multi-method method user host
-                                   "perl" tramp-remote-path nil))))
-    (when tramp-remote-perl
-      (tramp-set-connection-property "perl" tramp-remote-perl
-                                    multi-method method user host)
-      (unless (tramp-method-out-of-band-p multi-method method user host)
-        (tramp-message 5 "Sending the Perl `mime-encode' implementations.")
-        (tramp-send-string
-         multi-method method user host
-         (concat "tramp_encode () {\n"
-                 (format tramp-perl-encode tramp-remote-perl)
-                 " 2>/dev/null"
-                 "\n}"))
-        (tramp-wait-for-output)
-        (tramp-send-string
-         multi-method method user host
-         (concat "tramp_encode_with_module () {\n"
-                 (format tramp-perl-encode-with-module tramp-remote-perl)
-                 " 2>/dev/null"
-                 "\n}"))
-        (tramp-wait-for-output)
-        (tramp-message 5 "Sending the Perl `mime-decode' implementations.")
-        (tramp-send-string
-         multi-method method user host
-         (concat "tramp_decode () {\n"
-                 (format tramp-perl-decode tramp-remote-perl)
-                 " 2>/dev/null"
-                 "\n}"))
-        (tramp-wait-for-output)
-        (tramp-send-string
-         multi-method method user host
-         (concat "tramp_decode_with_module () {\n"
-                 (format tramp-perl-decode-with-module tramp-remote-perl)
-                 " 2>/dev/null"
-                 "\n}"))
-        (tramp-wait-for-output))))
-  ;; Find ln(1)
-  (erase-buffer)
-  (let ((ln (tramp-find-executable multi-method method user host
-                                  "ln" tramp-remote-path nil)))
-    (when ln
-      (tramp-set-connection-property "ln" ln multi-method method user host)))
-  ;; Set uid and gid.
-  (erase-buffer)
-  (tramp-send-command multi-method method user host "id -u; id -g")
-  (tramp-wait-for-output)
-  (goto-char (point-min))
-  (tramp-set-connection-property
-   "uid" (read (current-buffer)) multi-method method user host)
-  (tramp-set-connection-property
-   "gid" (read (current-buffer)) multi-method method user host)
-  ;; Find the right encoding/decoding commands to use.
-  (erase-buffer)
-  (unless (tramp-method-out-of-band-p multi-method method user host)
-    (tramp-find-inline-encoding multi-method method user host))
-  ;; If encoding/decoding command are given, test to see if they work.
-  ;; CCC: Maybe it would be useful to run the encoder both locally and
-  ;; remotely to see if they produce the same result.
-  (let ((rem-enc (tramp-get-remote-encoding multi-method method user host))
-       (rem-dec (tramp-get-remote-decoding multi-method method user host))
-       (magic-string "xyzzy"))
-    (when (and (or rem-dec rem-enc) (not (and rem-dec rem-enc)))
-      (tramp-kill-process multi-method method user host)
-      ;; Improve error message and/or error check.
-      (error
-       "Must give both decoding and encoding command in method definition"))
-    (when (and rem-enc rem-dec)
-      (tramp-message
-       5
-       "Checking to see if encoding/decoding commands work on remote host...")
+  (tramp-find-shell vec)
+  ;; Disable unexpected output.
+  (tramp-send-command vec "mesg n; biff n")
+  ;; Set the environment.
+  (tramp-message vec 5 "Setting default environment")
+  (let ((env (copy-sequence tramp-remote-process-environment))
+       unset item)
+    (while env
+      (setq item (split-string (car env) "="))
+      (if (and (stringp (cadr item)) (not (string-equal (cadr item) "")))
+         (tramp-send-command
+          vec (format "%s=%s; export %s" (car item) (cadr item) (car item)))
+       (push (car item) unset))
+      (setq env (cdr env)))
+    (when unset
       (tramp-send-command
-       multi-method method user host
-       (format "echo %s | %s | %s"
-              (tramp-shell-quote-argument magic-string) rem-enc rem-dec))
-      (tramp-wait-for-output)
-      (unless (looking-at (regexp-quote magic-string))
-       (tramp-kill-process multi-method method user host)
-       (error "Remote host cannot execute de/encoding commands.  See buffer `%s' for details"
-              (buffer-name)))
-      (erase-buffer)
-      (tramp-message
-       5 "Checking to see if encoding/decoding commands work on remote host...done"))))
+       vec (format "unset %s" (mapconcat 'identity unset " "))))))
 
 ;; CCC: We should either implement a Perl version of base64 encoding
 ;; and decoding.  Then we just use that in the last item.  The other
@@ -6444,38 +5628,22 @@ locale to C and sets up the remote shell search path."
 ;;
 ;; For Irix, no solution is known yet.
 
-(defvar tramp-coding-commands
-  '(("mimencode -b" "mimencode -u -b"
-     base64-encode-region base64-decode-region)
-    ("mmencode -b" "mmencode -u -b"
-     base64-encode-region base64-decode-region)
-    ("recode data..base64" "recode base64..data"
-     base64-encode-region base64-decode-region)
-    ("uuencode xxx" "uudecode -o /dev/stdout"
-     tramp-uuencode-region uudecode-decode-region)
-    ("uuencode xxx" "uudecode -o -"
-     tramp-uuencode-region uudecode-decode-region)
-    ("uuencode xxx" "uudecode -p"
-     tramp-uuencode-region uudecode-decode-region)
-    ("uuencode xxx" "tramp_uudecode"
-     tramp-uuencode-region uudecode-decode-region)
-    ("tramp_encode_with_module" "tramp_decode_with_module"
-     base64-encode-region base64-decode-region)
-    ("tramp_encode" "tramp_decode"
-     base64-encode-region base64-decode-region))
-  "List of coding commands for inline transfer.
+(defconst tramp-local-coding-commands
+  '((b64 base64-encode-region base64-decode-region)
+    (uu  tramp-uuencode-region uudecode-decode-region)
+    (pack
+     "perl -e 'binmode STDIN; binmode STDOUT; print pack(q{u*}, join q{}, <>)'"
+     "perl -e 'binmode STDIN; binmode STDOUT; print unpack(q{u*}, join q{}, <>)'"))
+  "List of local coding commands for inline transfer.
 Each item is a list that looks like this:
 
-\(REMOTE-ENCODING REMOTE-DECODING LOCAL-ENCODING LOCAL-DECODING)
+\(FORMAT ENCODING DECODING)
 
-The REMOTE-ENCODING should be a string, giving a command accepting a
-plain file on standard input and writing the encoded file to standard
-output.  The REMOTE-DECODING should also be a string, giving a command
-accepting an encoded file on standard input and writing the decoded
-file to standard output.
+FORMAT is  symbol describing the encoding/decoding format.  It can be
+`b64' for base64 encoding, `uu' for uu encoding, or `pack' for simple packing.
 
-LOCAL-ENCODING and LOCAL-DECODING can be strings, giving commands, or
-symbols, giving functions.  If they are strings, then they can contain
+ENCODING and DECODING can be strings, giving commands, or symbols,
+giving functions.  If they are strings, then they can contain
 the \"%s\" format specifier.  If that specifier is present, the input
 filename will be put into the command line at that spot.  If the
 specifier is not present, the input should be read from standard
@@ -6485,83 +5653,139 @@ If they are functions, they will be called with two arguments, start
 and end of region, and are expected to replace the region contents
 with the encoded or decoded results, respectively.")
 
-(defun tramp-find-inline-encoding (multi-method method user host)
+(defconst tramp-remote-coding-commands
+  '((b64 "mimencode -b" "mimencode -u -b")
+    (b64 "mmencode -b" "mmencode -u -b")
+    (b64 "recode data..base64" "recode base64..data")
+    (b64 tramp-perl-encode-with-module tramp-perl-decode-with-module)
+    (b64 tramp-perl-encode tramp-perl-decode)
+    (uu  "uuencode xxx" "uudecode -o /dev/stdout")
+    (uu  "uuencode xxx" "uudecode -o -")
+    (uu  "uuencode xxx" "uudecode -p")
+    (uu  "uuencode xxx" tramp-uudecode)
+    (pack
+     "perl -e 'binmode STDIN; binmode STDOUT; print pack(q{u*}, join q{}, <>)'"
+     "perl -e 'binmode STDIN; binmode STDOUT; print unpack(q{u*}, join q{}, <>)'"))
+  "List of remote coding commands for inline transfer.
+Each item is a list that looks like this:
+
+\(FORMAT ENCODING DECODING)
+
+FORMAT is  symbol describing the encoding/decoding format.  It can be
+`b64' for base64 encoding, `uu' for uu encoding, or `pack' for simple packing.
+
+ENCODING and DECODING can be strings, giving commands, or symbols,
+giving variables.  If they are strings, then they can contain
+the \"%s\" format specifier.  If that specifier is present, the input
+filename will be put into the command line at that spot.  If the
+specifier is not present, the input should be read from standard
+input.
+
+If they are variables, this variable is a string containing a Perl
+implementation for this functionality.  This Perl program will be transferred
+to the remote host, and it is avalible as shell function with the same name.")
+
+(defun tramp-find-inline-encoding (vec)
   "Find an inline transfer encoding that works.
-Goes through the list `tramp-coding-commands'."
-  (let ((commands tramp-coding-commands)
-       (magic "xyzzy")
-       item found)
-    (while (and commands (null found))
-      (setq item (pop commands))
-      (catch 'wont-work
-       (let ((rem-enc (nth 0 item))
-             (rem-dec (nth 1 item))
-             (loc-enc (nth 2 item))
-             (loc-dec (nth 3 item)))
-         ;; Check if remote encoding and decoding commands can be
-         ;; called remotely with null input and output.  This makes
-         ;; sure there are no syntax errors and the command is really
-         ;; found.  Note that we do not redirect stdout to /dev/null,
-         ;; for two reaons: when checking the decoding command, we
-         ;; actually check the output it gives.  And also, when
-         ;; redirecting "mimencode" output to /dev/null, then as root
-         ;; it might change the permissions of /dev/null!
-         (tramp-message-for-buffer
-          multi-method method user host 9
-          "Checking remote encoding command `%s' for sanity" rem-enc)
-         (unless (zerop (tramp-send-command-and-check
-                         multi-method method user host
-                         (format "%s </dev/null" rem-enc) t))
-           (throw 'wont-work nil))
-         (tramp-message-for-buffer
-          multi-method method user host 9
-          "Checking remote decoding command `%s' for sanity" rem-dec)
-         (unless (zerop (tramp-send-command-and-check
-                         multi-method method user host
-                         (format "echo %s | %s | %s"
-                                 magic rem-enc rem-dec) t))
-           (throw 'wont-work nil))
-         (save-excursion
-           (goto-char (point-min))
-           (unless (looking-at (regexp-quote magic))
-             (throw 'wont-work nil)))
-         ;; If the local encoder or decoder is a string, the
-         ;; corresponding command has to work locally.
-         (when (stringp loc-enc)
-           (tramp-message-for-buffer
-            multi-method method user host 9
-            "Checking local encoding command `%s' for sanity" loc-enc)
-           (unless (zerop (tramp-call-local-coding-command
-                           loc-enc nil nil))
-             (throw 'wont-work nil)))
-         (when (stringp loc-dec)
-           (tramp-message-for-buffer
-            multi-method method user host 9
-            "Checking local decoding command `%s' for sanity" loc-dec)
-           (unless (zerop (tramp-call-local-coding-command
-                           loc-dec nil nil))
-             (throw 'wont-work nil)))
-         ;; CCC: At this point, maybe we should check that the output
-         ;; of the commands is correct.  But for the moment we will
-         ;; assume that commands working on empty input will also
-         ;; work in practice.
-         (setq found item))))
-    ;; Did we find something?  If not, issue error.  If so,
-    ;; set connection properties.
-    (unless found
-      (error "Couldn't find an inline transfer encoding"))
-    (let ((rem-enc (nth 0 found))
-         (rem-dec (nth 1 found))
-         (loc-enc (nth 2 found))
-         (loc-dec (nth 3 found)))
-      (tramp-message 10 "Using remote encoding %s" rem-enc)
-      (tramp-set-remote-encoding multi-method method user host rem-enc)
-      (tramp-message 10 "Using remote decoding %s" rem-dec)
-      (tramp-set-remote-decoding multi-method method user host rem-dec)
-      (tramp-message 10 "Using local encoding %s" loc-enc)
-      (tramp-set-local-encoding multi-method method user host loc-enc)
-      (tramp-message 10 "Using local decoding %s" loc-dec)
-      (tramp-set-local-decoding multi-method method user host loc-dec))))
+Goes through the list `tramp-local-coding-commands' and
+`tramp-remote-coding-commands'."
+  (save-excursion
+    (let ((local-commands tramp-local-coding-commands)
+         (magic "xyzzy")
+         loc-enc loc-dec rem-enc rem-dec litem ritem found)
+      (while (and local-commands (not found))
+       (setq litem (pop local-commands))
+       (catch 'wont-work-local
+         (let ((format (nth 0 litem))
+               (remote-commands tramp-remote-coding-commands))
+           (setq loc-enc (nth 1 litem))
+           (setq loc-dec (nth 2 litem))
+           ;; If the local encoder or decoder is a string, the
+           ;; corresponding command has to work locally.
+           (if (not (stringp loc-enc))
+               (tramp-message
+                vec 5 "Checking local encoding function `%s'" loc-enc)
+             (tramp-message
+              vec 5 "Checking local encoding command `%s' for sanity" loc-enc)
+             (unless (zerop (tramp-call-local-coding-command
+                             loc-enc nil nil))
+               (throw 'wont-work-local nil)))
+           (if (not (stringp loc-dec))
+               (tramp-message
+                vec 5 "Checking local decoding function `%s'" loc-dec)
+             (tramp-message
+              vec 5 "Checking local decoding command `%s' for sanity" loc-dec)
+             (unless (zerop (tramp-call-local-coding-command
+                             loc-dec nil nil))
+               (throw 'wont-work-local nil)))
+           ;; Search for remote coding commands with the same format
+           (while (and remote-commands (not found))
+             (setq ritem (pop remote-commands))
+             (catch 'wont-work-remote
+               (when (equal format (nth 0 ritem))
+                 (setq rem-enc (nth 1 ritem))
+                 (setq rem-dec (nth 2 ritem))
+                 ;; Check if remote encoding and decoding commands can be
+                 ;; called remotely with null input and output.  This makes
+                 ;; sure there are no syntax errors and the command is really
+                 ;; found.  Note that we do not redirect stdout to /dev/null,
+                 ;; for two reasons: when checking the decoding command, we
+                 ;; actually check the output it gives.  And also, when
+                 ;; redirecting "mimencode" output to /dev/null, then as root
+                 ;; it might change the permissions of /dev/null!
+                 (when (not (stringp rem-enc))
+                   (let ((name (symbol-name rem-enc)))
+                     (while (string-match (regexp-quote "-") name)
+                       (setq name (replace-match "_" nil t name)))
+                     (tramp-maybe-send-script vec (symbol-value rem-enc) name)
+                     (setq rem-enc name)))
+                 (tramp-message
+                  vec 5
+                  "Checking remote encoding command `%s' for sanity" rem-enc)
+                 (unless (zerop (tramp-send-command-and-check
+                                 vec (format "%s </dev/null" rem-enc) t))
+                   (throw 'wont-work-remote nil))
+
+                 (when (not (stringp rem-dec))
+                   (let ((name (symbol-name rem-dec)))
+                     (while (string-match (regexp-quote "-") name)
+                       (setq name (replace-match "_" nil t name)))
+                     (tramp-maybe-send-script vec (symbol-value rem-dec) name)
+                     (setq rem-dec name)))
+                 (tramp-message
+                  vec 5
+                  "Checking remote decoding command `%s' for sanity" rem-dec)
+                 (unless (zerop (tramp-send-command-and-check
+                                 vec
+                                 (format "echo %s | %s | %s"
+                                         magic rem-enc rem-dec) t))
+                   (throw 'wont-work-remote nil))
+
+                 (with-current-buffer (tramp-get-buffer vec)
+                   (goto-char (point-min))
+                   (unless (looking-at (regexp-quote magic))
+                     (throw 'wont-work-remote nil)))
+
+                 ;; `rem-enc' and `rem-dec' could be a string meanwhile.
+                 (setq rem-enc (nth 1 ritem))
+                 (setq rem-dec (nth 2 ritem))
+                 (setq found t)))))))
+
+      ;; Did we find something?  If not, issue an error.
+      (unless found
+       (kill-process (tramp-get-connection-process vec))
+       (tramp-error
+        vec 'file-error "Couldn't find an inline transfer encoding"))
+
+      ;; Set connection properties.
+      (tramp-message vec 5 "Using local encoding `%s'" loc-enc)
+      (tramp-set-connection-property vec "local-encoding" loc-enc)
+      (tramp-message vec 5 "Using local decoding `%s'" loc-dec)
+      (tramp-set-connection-property vec "local-decoding" loc-dec)
+      (tramp-message vec 5 "Using remote encoding `%s'" rem-enc)
+      (tramp-set-connection-property vec "remote-encoding" rem-enc)
+      (tramp-message vec 5 "Using remote decoding `%s'" rem-dec)
+      (tramp-set-connection-property vec "remote-decoding" rem-dec))))
 
 (defun tramp-call-local-coding-command (cmd input output)
   "Call the local encoding or decoding command.
@@ -6571,25 +5795,114 @@ INPUT can also be nil which means `/dev/null'.
 OUTPUT can be a string (which specifies a filename), or t (which
 means standard output and thus the current buffer), or nil (which
 means discard it)."
-  (call-process
-   tramp-encoding-shell                        ;program
-   (when (and input (not (string-match "%s" cmd)))
-     input)                            ;input
-   (if (eq output t) t nil)            ;output
-   nil                                 ;redisplay
-   tramp-encoding-command-switch
-   ;; actual shell command
-   (concat
-    (if (string-match "%s" cmd) (format cmd input) cmd)
-    (if (stringp output) (concat "> " output) ""))))
-
-(defun tramp-maybe-open-connection (multi-method method user host)
-  "Maybe open a connection to HOST, logging in as USER, using METHOD.
+  (let ((default-directory (tramp-temporary-file-directory)))
+    (call-process
+     tramp-encoding-shell              ;program
+     (when (and input (not (string-match "%s" cmd)))
+       input)                          ;input
+     (if (eq output t) t nil)          ;output
+     nil                               ;redisplay
+     tramp-encoding-command-switch
+     ;; actual shell command
+     (concat
+      (if (string-match "%s" cmd) (format cmd input) cmd)
+      (if (stringp output) (concat "> " output) "")))))
+
+(defun tramp-compute-multi-hops (vec)
+  "Expands VEC according to `tramp-default-proxies-alist'.
+Gateway hops are already opened."
+  (let ((target-alist `(,vec))
+       (choices tramp-default-proxies-alist)
+       item proxy)
+
+    ;; Look for proxy hosts to be passed.
+    (while choices
+      (setq item (pop choices)
+           proxy (nth 2 item))
+      (when (and
+            ;; host
+            (string-match (or (nth 0 item) "")
+                          (or (tramp-file-name-host (car target-alist)) ""))
+            ;; user
+            (string-match (or (nth 1 item) "")
+                          (or (tramp-file-name-user (car target-alist)) "")))
+       (if (null proxy)
+           ;; No more hops needed.
+           (setq choices nil)
+         ;; Replace placeholders.
+         (setq proxy
+               (format-spec
+                proxy
+                `((?u . ,(or (tramp-file-name-user (car target-alist)) ""))
+                  (?h . ,(or (tramp-file-name-host (car target-alist)) "")))))
+         (with-parsed-tramp-file-name proxy l
+           ;; Add the hop.
+           (add-to-list 'target-alist l)
+           ;; Start next search.
+           (setq choices tramp-default-proxies-alist)))))
+
+    ;; Handle gateways.
+    (when (string-match (format
+                        "^\\(%s\\|%s\\)$"
+                        tramp-gw-tunnel-method tramp-gw-socks-method)
+                       (tramp-file-name-method (car target-alist)))
+      (let ((gw (pop target-alist))
+           (hop (pop target-alist)))
+       ;; Is the method prepared for gateways?
+       (unless (tramp-get-method-parameter
+                (tramp-file-name-method hop) 'tramp-default-port)
+         (tramp-error
+          vec 'file-error
+          "Method `%s' is not supported for gateway access."
+          (tramp-file-name-method hop)))
+       ;; Add default port if needed.
+       (unless
+           (string-match
+            tramp-host-with-port-regexp (tramp-file-name-host hop))
+         (aset hop 2
+               (concat
+                (tramp-file-name-host hop) tramp-prefix-port-format
+                (number-to-string
+                 (tramp-get-method-parameter
+                  (tramp-file-name-method hop) 'tramp-default-port)))))
+       ;; Open the gateway connection.
+       (add-to-list
+        'target-alist
+        (vector
+         (tramp-file-name-method hop) (tramp-file-name-user hop)
+         (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
+       ;; be persistent.  And we have no started process yet either.
+       (tramp-set-file-property (car target-alist) "" "gateway" hop)))
+
+    ;; Foreign and out-of-band methods are not supported for multi-hops.
+    (when (cdr target-alist)
+      (setq choices target-alist)
+      (while choices
+       (setq item (pop choices))
+       (when
+           (or
+            (not
+             (tramp-get-method-parameter
+              (tramp-file-name-method item) 'tramp-login-program))
+            (tramp-get-method-parameter
+             (tramp-file-name-method item) 'tramp-copy-program))
+         (tramp-error
+          vec 'file-error
+          "Method `%s' is not supported for multi-hops."
+          (tramp-file-name-method item)))))
+
+    ;; Result.
+    target-alist))
+
+(defun tramp-maybe-open-connection (vec)
+  "Maybe open a connection VEC.
 Does not do anything if a connection is already open, but re-opens the
 connection if a previous connection has died for some reason."
-  (let ((p (get-buffer-process
-           (tramp-get-buffer multi-method method user host)))
-       last-cmd-time)
+  (let ((p (tramp-get-connection-process vec)))
+
     ;; If too much time has passed since last command was sent, look
     ;; whether process is still alive.  If it isn't, kill it.  When
     ;; using ssh, it can sometimes happen that the remote end has hung
@@ -6597,239 +5910,278 @@ connection if a previous connection has died for some reason."
     ;; tries to send some data to the remote end.  So that's why we
     ;; try to send a command from time to time, then look again
     ;; whether the process is really alive.
-    (save-excursion
-      (set-buffer (tramp-get-buffer multi-method method user host))
-      (when (and tramp-last-cmd-time
-                (> (tramp-time-diff (current-time) tramp-last-cmd-time) 60)
-                p (processp p) (memq (process-status p) '(run open)))
-       (tramp-send-command
-        multi-method method user host "echo are you awake" nil t)
-       (unless (and (memq (process-status p) '(run open))
-                     (tramp-wait-for-output 10))
-         (delete-process p)
-         (setq p nil))
-       (erase-buffer)))
+    (when (and (> (tramp-time-diff
+                  (current-time)
+                  (tramp-get-connection-property p "last-cmd-time" '(0 0 0)))
+                 60)
+              p (processp p) (memq (process-status p) '(run open)))
+      (tramp-send-command vec "echo are you awake" t t)
+      (unless (and (memq (process-status p) '(run open))
+                  (tramp-wait-for-output p 10))
+       (delete-process p)
+       (setq p nil)))
+
+    ;; New connection must be opened.
     (unless (and p (processp p) (memq (process-status p) '(run open)))
+
+      ;; We call `tramp-get-buffer' in order to get a debug buffer for
+      ;; messages from the beginning.
+      (tramp-get-buffer vec)
+      (if (zerop (length (tramp-file-name-user vec)))
+         (tramp-message
+          vec 3 "Opening connection for %s using %s..."
+          (tramp-file-name-host vec)
+          (tramp-file-name-method vec))
+       (tramp-message
+        vec 3 "Opening connection for %s@%s using %s..."
+        (tramp-file-name-user vec)
+        (tramp-file-name-host vec)
+        (tramp-file-name-method vec)))
+
+      ;; Start new process.
       (when (and p (processp p))
-        (delete-process p))
-      (let ((process-connection-type tramp-process-connection-type))
-       (funcall (tramp-get-method-parameter
-                 multi-method
-                 (tramp-find-method multi-method method user host)
-                 user host 'tramp-connection-function)
-                multi-method method user host)))))
-
-(defun tramp-send-command
-  (multi-method method user host command &optional noerase neveropen)
-  "Send the COMMAND to USER at HOST (logged in using METHOD).
-Erases temporary buffer before sending the command (unless NOERASE
-is true).
-If optional seventh arg NEVEROPEN is non-nil, never try to open the
-connection.  This is meant to be used from
-`tramp-maybe-open-connection' only."
-  (or neveropen
-      (tramp-maybe-open-connection multi-method method user host))
-  (setq tramp-last-cmd-time (current-time))
-  (setq tramp-last-cmd command)
-  (when tramp-debug-buffer
-    (save-excursion
-      (set-buffer (tramp-get-debug-buffer multi-method method user host))
-      (goto-char (point-max))
-      (tramp-insert-with-face 'bold (format "$ %s\n" command))))
-  (let ((proc nil))
-    (set-buffer (tramp-get-buffer multi-method method user host))
-    (unless noerase (erase-buffer))
-    (setq proc (get-buffer-process (current-buffer)))
-    (process-send-string proc
-                         (concat command tramp-rsh-end-of-line))))
-
-(defun tramp-send-command-internal
-  (multi-method method user host command &optional msg)
+       (delete-process p))
+      (setenv "TERM" tramp-terminal-type)
+      (setenv "PROMPT_COMMAND")
+      (setenv "PS1" "$ ")
+      (let* ((target-alist (tramp-compute-multi-hops vec))
+            (process-environment (copy-sequence process-environment))
+            (process-connection-type tramp-process-connection-type)
+            (coding-system-for-read nil)
+            ;; This must be done in order to avoid our file name handler.
+            (p (let ((default-directory (tramp-temporary-file-directory)))
+                 (start-process
+                  (or (tramp-get-connection-property vec "process-name" nil)
+                      (tramp-buffer-name vec))
+                  (tramp-get-connection-buffer vec)
+                  tramp-encoding-shell)))
+            (first-hop t))
+
+       (tramp-message
+        vec 6 "%s" (mapconcat 'identity (process-command p) " "))
+
+       ;; Check whether process is alive.
+       (set-process-sentinel p 'tramp-flush-connection-property)
+       (tramp-set-process-query-on-exit-flag p nil)
+       (tramp-message vec 3 "Waiting 60s for local shell to come up...")
+       (tramp-barf-if-no-shell-prompt
+        p 60 "Couldn't find local shell prompt %s" tramp-encoding-shell)
+
+       ;; Now do all the connections as specified.
+       (while target-alist
+         (let* ((hop (car target-alist))
+                (l-method (tramp-file-name-method hop))
+                (l-user (tramp-file-name-user hop))
+                (l-host (tramp-file-name-host hop))
+                (l-port nil)
+                (login-program
+                 (tramp-get-method-parameter l-method 'tramp-login-program))
+                (login-args
+                 (tramp-get-method-parameter l-method 'tramp-login-args))
+                (gw-args
+                 (tramp-get-method-parameter l-method 'tramp-gw-args))
+                (gw (tramp-get-file-property hop "" "gateway" nil))
+                (g-method (and gw (tramp-file-name-method gw)))
+                (g-user (and gw (tramp-file-name-user gw)))
+                (g-host (and gw (tramp-file-name-host gw)))
+                (command login-program)
+                spec)
+
+           ;; Add gateway arguments if necessary.
+           (when (and gw gw-args)
+             (setq login-args (append login-args gw-args)))
+
+           ;; Check for port number.  Until now, there's no need for handling
+           ;; like method, user, host.
+           (when (string-match tramp-host-with-port-regexp l-host)
+             (setq l-port (match-string 2 l-host)
+                   l-host (match-string 1 l-host)))
+
+           ;; Set variables for computing the prompt for reading password.
+           ;; They can also be derived from a gatewy.
+           (setq tramp-current-method (or g-method l-method)
+                 tramp-current-user   (or g-user   l-user)
+                 tramp-current-host   (or g-host   l-host))
+
+           ;; Replace login-args place holders.
+           (setq
+            l-host (or l-host "")
+            l-user (or l-user "")
+            l-port (or l-port "")
+            spec `((?h . ,l-host) (?u . ,l-user) (?p . ,l-port)
+                   (?t . ,(tramp-make-tramp-temp-file vec)))
+            command
+            (concat
+             command " "
+             (mapconcat
+              '(lambda (x)
+                 (setq x (mapcar '(lambda (y) (format-spec y spec)) x))
+                 (unless (member "" x) (mapconcat 'identity x " ")))
+              login-args " ")
+             ;; String to detect failed connection.  Every single word must
+             ;; be enclosed with '\"'; otherwise it is detected
+             ;; during connection setup.
+             ;; Local shell could be a Windows COMSPEC.  It doesn't know
+             ;; the ";" syntax, but we must exit always for `start-process'.
+             ;; "exec" does not work either.
+             (if first-hop
+                 " && exit || exit"
+               "; echo \"Tramp\" \"connection\" \"closed\"; sleep 1"))
+            ;; We don't reach a Windows shell.  Could be initial only.
+            first-hop nil)
+
+           ;; Send the command.
+           (tramp-message vec 3 "Sending command `%s'" command)
+           (tramp-send-command vec command t t)
+           (tramp-process-actions p vec tramp-actions-before-shell 60)
+           (tramp-message vec 3 "Found remote shell prompt on `%s'" l-host))
+         ;; Next hop.
+         (setq target-alist (cdr target-alist)))
+
+       ;; Make initial shell settings.
+       (tramp-open-connection-setup-interactive-shell p vec)))))
+
+(defun tramp-send-command (vec command &optional neveropen nooutput)
+  "Send the COMMAND to connection VEC.
+Erases temporary buffer before sending the command.  If optional
+arg NEVEROPEN is non-nil, never try to open the connection.  This
+is meant to be used from `tramp-maybe-open-connection' only.  The
+function waits for output unless NOOUTPUT is set."
+  (unless neveropen (tramp-maybe-open-connection vec))
+  (let ((p (tramp-get-connection-process vec)))
+    (when (tramp-get-connection-property vec "remote-echo" nil)
+      ;; We mark the command string that it can be erased in the output buffer.
+      (tramp-set-connection-property p "check-remote-echo" t)
+      (setq command (format "%s%s%s" tramp-echo-mark command tramp-echo-mark)))
+    (tramp-message vec 6 "%s" command)
+    (tramp-send-string vec command)
+    (unless nooutput (tramp-wait-for-output p))))
+
+(defun tramp-send-command-internal (vec command)
   "Send command to remote host and wait for success.
 Sends COMMAND, then waits 30 seconds for shell prompt."
-  (tramp-send-command multi-method method user host command t t)
-  (when msg
-    (tramp-message 9 "Waiting 30s for %s..." msg))
-  (tramp-barf-if-no-shell-prompt
-   nil 30
-   "Couldn't `%s', see buffer `%s'" command (buffer-name)))
-
-(defun tramp-wait-for-output (&optional timeout)
+  (let ((p (tramp-get-connection-process vec)))
+    (when (tramp-get-connection-property vec "remote-echo" nil)
+      ;; We mark the command string that it can be erased in the output buffer.
+      (tramp-set-connection-property p "check-remote-echo" t)
+      (setq command (format "%s%s%s" tramp-echo-mark command tramp-echo-mark)))
+    (tramp-message vec 6 "%s" command)
+    (tramp-send-string vec command)
+    (tramp-barf-if-no-shell-prompt
+     p 30 "Couldn't `%s', see buffer `%s'" command (buffer-name))))
+
+(defun tramp-wait-for-output (proc &optional timeout)
   "Wait for output from remote rsh command."
-  (let ((proc (get-buffer-process (current-buffer)))
-        (found nil)
-        (start-time (current-time))
-       (start-point (point))
-        (end-of-output (concat "^"
-                               (regexp-quote tramp-end-of-output)
-                               "\r?$")))
-    ;; Algorithm: get waiting output.  See if last line contains
-    ;; end-of-output sentinel.  If not, wait a bit and again get
-    ;; waiting output.  Repeat until timeout expires or end-of-output
-    ;; sentinel is seen.  Will hang if timeout is nil and
-    ;; end-of-output sentinel never appears.
-    (save-match-data
-      (cond (timeout
-             ;; Work around an XEmacs bug, where the timeout expires
-             ;; faster than it should.  This degenerates into polling
-             ;; for buggy XEmacsen, but oh, well.
-             (while (and (not found)
-                         (< (tramp-time-diff (current-time) start-time)
-                            timeout))
-               (with-timeout (timeout)
-                 (while (not found)
-                   (tramp-accept-process-output proc 1)
-                  (unless (memq (process-status proc) '(run open))
-                    (error "Process has died"))
-                   (goto-char (point-max))
-                   (forward-line -1)
-                   (setq found (looking-at end-of-output))))))
-            (t
-             (while (not found)
-               (tramp-accept-process-output proc 1)
-              (unless (memq (process-status proc) '(run open))
-                (error "Process has died"))
-               (goto-char (point-max))
-               (forward-line -1)
-               (setq found (looking-at end-of-output))))))
-    ;; At this point, either the timeout has expired or we have found
-    ;; the end-of-output sentinel.
-    (when found
-      (goto-char (point-max))
-      (forward-line -2)
-      (delete-region (point) (point-max)))
-    ;; If processing echoes, look for it in the first line and delete.
-    (when tramp-process-echoes
-      (save-excursion
-       (goto-char start-point)
-       (when (looking-at (regexp-quote tramp-last-cmd))
-         (delete-region (point) (progn (forward-line 1) (point))))))
-    ;; Add output to debug buffer if appropriate.
-    (when tramp-debug-buffer
-      (append-to-buffer
-       (tramp-get-debug-buffer tramp-current-multi-method tramp-current-method
-                             tramp-current-user tramp-current-host)
-       (point-min) (point-max))
-      (when (not found)
-        (save-excursion
-          (set-buffer
-           (tramp-get-debug-buffer tramp-current-multi-method tramp-current-method
-                                 tramp-current-user tramp-current-host))
-          (goto-char (point-max))
-          (insert "[[Remote prompt `" end-of-output "' not found"
-                  (if timeout (format " in %d secs" timeout) "")
-                  "]]"))))
-    (goto-char (point-min))
-    ;; Return value is whether end-of-output sentinel was found.
-    found))
+  (with-current-buffer (process-buffer proc)
+    (let ((found
+          (tramp-wait-for-regexp
+           proc timeout
+           (format "^%s\r?$" (regexp-quote tramp-end-of-output)))))
+      (if found
+         (let (buffer-read-only)
+           (goto-char (point-max))
+           (forward-line -2)
+           (delete-region (point) (point-max)))
+       (if timeout
+           (tramp-error
+            proc 'file-error
+            "[[Remote prompt `%s' not found in %d secs]]"
+            tramp-end-of-output timeout)
+         (tramp-error
+          proc 'file-error
+          "[[Remote prompt `%s' not found]]" tramp-end-of-output)))
+      ;; Return value is whether end-of-output sentinel was found.
+      found)))
 
-(defun tramp-send-command-and-check (multi-method method user host command
-                                                  &optional subshell)
+(defun tramp-send-command-and-check (vec command &optional subshell)
   "Run COMMAND and check its exit status.
-MULTI-METHOD and METHOD specify how to log in (as USER) to the remote HOST.
 Sends `echo $?' along with the COMMAND for checking the exit status.  If
 COMMAND is nil, just sends `echo $?'.  Returns the exit status found.
 
 If the optional argument SUBSHELL is non-nil, the command is executed in
 a subshell, ie surrounded by parentheses."
-  (tramp-send-command multi-method method user host
-                      (concat (if subshell "( " "")
-                              command
-                              (if command " 2>/dev/null; " "")
-                              "echo tramp_exit_status $?"
-                              (if subshell " )" " ")))
-  (tramp-wait-for-output)
-  (goto-char (point-max))
-  (unless (search-backward "tramp_exit_status " nil t)
-    (error "Couldn't find exit status of `%s'" command))
-  (skip-chars-forward "^ ")
-  (read (current-buffer)))
-
-(defun tramp-barf-unless-okay (multi-method method user host command subshell
-                                            signal fmt &rest args)
+  (tramp-send-command
+   vec
+   (concat (if subshell "( " "")
+          command
+          (if command " 2>/dev/null; " "")
+          "echo tramp_exit_status $?"
+          (if subshell " )" " ")))
+  (with-current-buffer (tramp-get-connection-buffer vec)
+    (goto-char (point-max))
+    (unless (re-search-backward "tramp_exit_status [0-9]+" nil t)
+      (tramp-error
+       vec 'file-error "Couldn't find exit status of `%s'" command))
+    (skip-chars-forward "^ ")
+    (prog1
+     (read (current-buffer))
+     (let (buffer-read-only) (delete-region (match-beginning 0) (point-max))))))
+
+(defun tramp-barf-unless-okay (vec command fmt &rest args)
   "Run COMMAND, check exit status, throw error if exit status not okay.
 Similar to `tramp-send-command-and-check' but accepts two more arguments
 FMT and ARGS which are passed to `error'."
-  (unless (zerop (tramp-send-command-and-check
-                  multi-method method user host command subshell))
-    ;; CCC: really pop-to-buffer?  Maybe it's appropriate to be more
-    ;; silent.
-    (pop-to-buffer (current-buffer))
-    (funcall 'signal signal (apply 'format fmt args))))
+  (unless (zerop (tramp-send-command-and-check vec command))
+    (apply 'tramp-error vec 'file-error fmt args)))
+
+(defun tramp-send-command-and-read (vec command)
+  "Run COMMAND and return the output, which must be a Lisp expression.
+In case there is no valid Lisp expression, it raises an error"
+  (tramp-barf-unless-okay vec command "`%s' returns with error" command)
+  (with-current-buffer (tramp-get-connection-buffer vec)
+    ;; Read the expression.
+    (goto-char (point-min))
+    (condition-case nil
+       (prog1 (read (current-buffer))
+         ;; Error handling.
+         (when (re-search-forward "\\S-" (tramp-line-end-position) t)
+           (error)))
+      (error (tramp-error
+             vec 'file-error
+             "`%s' does not return a valid Lisp expression: `%s'"
+             command (buffer-string))))))
 
 ;; It seems that Tru64 Unix does not like it if long strings are sent
 ;; to it in one go.  (This happens when sending the Perl
 ;; `file-attributes' implementation, for instance.)  Therefore, we
-;; have this function which waits a bit at each line.
-(defun tramp-send-string
-  (multi-method method user host string)
-  "Send the STRING to USER at HOST using METHOD.
+;; have this function which sends the string in chunks.
+(defun tramp-send-string (vec string)
+  "Send the STRING via connection VEC.
 
 The STRING is expected to use Unix line-endings, but the lines sent to
 the remote host use line-endings as defined in the variable
-`tramp-rsh-end-of-line'."
-  (let ((proc (get-buffer-process
-               (tramp-get-buffer multi-method method user host))))
-    (unless proc
-      (error "Can't send string to remote host -- not logged in"))
-    ;; debug message
-    (when tramp-debug-buffer
-      (save-excursion
-       (set-buffer (tramp-get-debug-buffer multi-method method user host))
-       (goto-char (point-max))
-       (tramp-insert-with-face 'bold (format "$ %s\n" string))))
-    ;; replace "\n" by `tramp-rsh-end-of-line'
-    (setq string
-         (mapconcat 'identity
-                    (split-string string "\n")
-                    tramp-rsh-end-of-line))
-    (unless (or (string= string "")
-               (string-equal (substring string -1) tramp-rsh-end-of-line))
-      (setq string (concat string tramp-rsh-end-of-line)))
-    ;; send the string
-    (if (and tramp-chunksize (not (zerop tramp-chunksize)))
-       (let ((pos 0)
-             (end (length string)))
-         (while (< pos end)
-           (tramp-message-for-buffer
-            multi-method method user host 10
-            "Sending chunk from %s to %s"
-            pos (min (+ pos tramp-chunksize) end))
-           (process-send-string
-            proc (substring string pos (min (+ pos tramp-chunksize) end)))
-           (setq pos (+ pos tramp-chunksize))
-           (sleep-for 0.1)))
-      (process-send-string proc string))))
-
-(defun tramp-send-eof (multi-method method user host)
-  "Send EOF to the remote end.
-METHOD, HOST and USER specify the connection."
-  (let ((proc (get-buffer-process
-               (tramp-get-buffer multi-method method user host))))
-    (unless proc
-      (error "Can't send EOF to remote host -- not logged in"))
-    (process-send-eof proc)))
-;    (process-send-string proc "\^D")))
-
-(defun tramp-kill-process (multi-method method user host)
-  "Kill the connection process used by Tramp.
-MULTI-METHOD, METHOD, USER, and HOST specify the connection."
-  (let ((proc (get-buffer-process
-              (tramp-get-buffer multi-method method user host))))
-    (kill-process proc)))
-
-(defun tramp-discard-garbage-erase-buffer (p multi-method method user host)
-  "Erase buffer, then discard subsequent garbage.
-If `tramp-discard-garbage' is nil, just erase buffer."
-  (if (not tramp-discard-garbage)
-      (erase-buffer)
-    (while (prog1 (erase-buffer) (tramp-accept-process-output p 0.25))
-      (when tramp-debug-buffer
-        (save-excursion
-          (set-buffer (tramp-get-debug-buffer multi-method method user host))
-          (goto-char (point-max))
-          (tramp-insert-with-face
-           'bold (format "Additional characters detected\n")))))))
+`tramp-rsh-end-of-line'.  The communication buffer is erased before sending."
+  (let* ((p (tramp-get-connection-process vec))
+        (chunksize (tramp-get-connection-property p "chunksize" nil)))
+    (unless p
+      (tramp-error
+       vec 'file-error "Can't send string to remote host -- not logged in"))
+    (tramp-set-connection-property p "last-cmd-time" (current-time))
+    (tramp-message vec 10 "%s" string)
+    (with-current-buffer (tramp-get-connection-buffer vec)
+      ;; Clean up the buffer.  We cannot call `erase-buffer' because
+      ;; narrowing might be in effect.
+      (let (buffer-read-only) (delete-region (point-min) (point-max)))
+      ;; Replace "\n" by `tramp-rsh-end-of-line'.
+      (setq string
+           (mapconcat 'identity
+                      (split-string string "\n")
+                      tramp-rsh-end-of-line))
+      (unless (or (string= string "")
+                 (string-equal (substring string -1) tramp-rsh-end-of-line))
+       (setq string (concat string tramp-rsh-end-of-line)))
+      ;; Send the string.
+      (if (and chunksize (not (zerop chunksize)))
+         (let ((pos 0)
+               (end (length string)))
+           (while (< pos end)
+             (tramp-message
+              vec 10 "Sending chunk from %s to %s"
+              pos (min (+ pos chunksize) end))
+             (process-send-string
+              p (substring string pos (min (+ pos chunksize) end)))
+             (setq pos (+ pos chunksize))))
+       (process-send-string p string)))))
 
 (defun tramp-mode-string-to-int (mode-string)
   "Converts a ten-letter `drwxrwxrwx'-style mode string into mode bits."
@@ -6902,27 +6254,82 @@ If `tramp-discard-garbage' is nil, just erase buffer."
        (t (error "Tenth char `%c' must be one of `xtT-'"
                  other-execute-or-sticky)))))))
 
-(defun tramp-convert-file-attributes (multi-method method user host attr)
-  "Convert file-attributes ATTR generated by perl script or ls.
+(defun tramp-convert-file-attributes (vec attr)
+  "Convert file-attributes ATTR generated by perl script, stat or ls.
 Convert file mode bits to string and set virtual device number.
 Return ATTR."
+  ;; Convert last access time.
+  (unless (listp (nth 4 attr))
+    (setcar (nthcdr 4 attr)
+           (list (floor (nth 4 attr) 65536)
+                 (floor (mod (nth 4 attr) 65536)))))
+  ;; Convert last modification time.
+  (unless (listp (nth 5 attr))
+    (setcar (nthcdr 5 attr)
+           (list (floor (nth 5 attr) 65536)
+                 (floor (mod (nth 5 attr) 65536)))))
+  ;; Convert last status change time.
+  (unless (listp (nth 6 attr))
+    (setcar (nthcdr 6 attr)
+           (list (floor (nth 6 attr) 65536)
+                 (floor (mod (nth 6 attr) 65536)))))
+  ;; Convert file size.
+  (when (< (nth 7 attr) 0)
+    (setcar (nthcdr 7 attr) -1))
+  (when (and (floatp (nth 7 attr)) (<= (nth 7 attr) most-positive-fixnum))
+    (setcar (nthcdr 7 attr) (round (nth 7 attr))))
   ;; Convert file mode bits to string.
   (unless (stringp (nth 8 attr))
     (setcar (nthcdr 8 attr) (tramp-file-mode-from-int (nth 8 attr))))
-  ;; Set file's gid change bit.  Possible only when id-format is 'integer.
-  (when (numberp (nth 3 attr))
-    (setcar (nthcdr 9 attr)
-           (not (eql (nth 3 attr)
-                     (tramp-get-remote-gid multi-method method user host)))))
+  ;; Convert directory indication bit.
+  (if (string-match "^d" (nth 8 attr))
+      (setcar attr t)
+    (if (and (listp (car attr)) (stringp (caar attr))
+            (string-match ".+ -> .\\(.+\\)." (caar attr)))
+       (setcar attr (match-string 1 (caar attr)))
+      (setcar attr nil)))
+  ;; Set file's gid change bit.
+  (setcar (nthcdr 9 attr)
+         (if (numberp (nth 3 attr))
+             (not (= (nth 3 attr)
+                     (tramp-get-remote-gid vec 'integer)))
+           (not (string-equal
+                 (nth 3 attr)
+                 (tramp-get-remote-gid vec 'string)))))
+  ;; Convert inode.
+  (unless (listp (nth 10 attr))
+    (setcar (nthcdr 10 attr)
+           (condition-case nil
+               (list (floor (nth 10 attr) 65536)
+                     (floor (mod (nth 10 attr) 65536)))
+             ;; Inodes can be incredible huge.  We must hide this.
+             (error (tramp-get-inode vec)))))
   ;; Set virtual device number.
   (setcar (nthcdr 11 attr)
-          (tramp-get-device multi-method method user host))
+          (tramp-get-device vec))
   attr)
 
-(defun tramp-get-device (multi-method method user host)
+(defun tramp-get-inode (vec)
+  "Returns the virtual inode number.
+If it doesn't exist, generate a new one."
+  (let ((string (tramp-make-tramp-file-name
+                (tramp-file-name-method vec)
+                (tramp-file-name-user vec)
+                (tramp-file-name-host vec)
+                "")))
+    (unless (assoc string tramp-inodes)
+      (add-to-list 'tramp-inodes
+                  (list string (length tramp-inodes))))
+    (nth 1 (assoc string tramp-inodes))))
+
+(defun tramp-get-device (vec)
   "Returns the virtual device number.
 If it doesn't exist, generate a new one."
-  (let ((string (tramp-make-tramp-file-name multi-method method user host "")))
+  (let ((string (tramp-make-tramp-file-name
+                (tramp-file-name-method vec)
+                (tramp-file-name-user vec)
+                (tramp-file-name-host vec)
+                "")))
     (unless (assoc string tramp-devices)
       (add-to-list 'tramp-devices
                   (list string (length tramp-devices))))
@@ -6942,7 +6349,6 @@ If it doesn't exist, generate a new one."
     (setq other (tramp-file-mode-permissions other sticky "t"))
     (concat type user group other)))
 
-
 (defun tramp-file-mode-permissions (perm suid suid-text)
   "Convert a permission bitset into a string.
 This is used internally by `tramp-file-mode-from-int'."
@@ -6955,7 +6361,6 @@ This is used internally by `tramp-file-mode-from-int'."
                (and suid (upcase suid-text)) ; suid, !execute
                (and x "x") "-"))))     ; !suid
 
-
 (defun tramp-decimal-to-octal (i)
   "Return a string consisting of the octal digits of I.
 Not actually used.  Use `(format \"%o\" i)' instead?"
@@ -6966,16 +6371,6 @@ Not actually used.  Use `(format \"%o\" i)' instead?"
                    (number-to-string (% i 8))))))
 
 
-;;(defun tramp-octal-to-decimal (ostr)
-;;  "Given a string of octal digits, return a decimal number."
-;;  (cond ((null ostr) 0)
-;;        ((string= "" ostr) 0)
-;;        (t (let ((last (aref ostr (1- (length ostr))))
-;;                 (rest (substring ostr 0 (1- (length ostr)))))
-;;             (unless (and (>= last ?0)
-;;                          (<= last ?7))
-;;               (error "Not an octal digit: %c" last))
-;;             (+ (- last ?0) (* 8 (tramp-octal-to-decimal rest)))))))
 ;; Kudos to Gerd Moellmann for this suggestion.
 (defun tramp-octal-to-decimal (ostr)
   "Given a string of octal digits, return a decimal number."
@@ -7003,289 +6398,367 @@ Not actually used.  Use `(format \"%o\" i)' instead?"
 ;; internal data structure.  Convenience functions for internal
 ;; data structure.
 
-(defun tramp-file-name-p (obj)
-  "Check whether TRAMP-FILE-NAME is a Tramp object."
-  (and (vectorp obj) (= 5 (length obj))))
-
-(defun tramp-file-name-multi-method (obj)
-  "Return MULTI-METHOD component of TRAMP-FILE-NAME."
-  (and (tramp-file-name-p obj) (aref obj 0)))
-
-(defun tramp-file-name-method (obj)
-  "Return METHOD component of TRAMP-FILE-NAME."
-  (and (tramp-file-name-p obj) (aref obj 1)))
-
-(defun tramp-file-name-user (obj)
-  "Return USER component of TRAMP-FILE-NAME."
-  (and (tramp-file-name-p obj) (aref obj 2)))
-
-(defun tramp-file-name-host (obj)
-  "Return HOST component of TRAMP-FILE-NAME."
-  (and (tramp-file-name-p obj) (aref obj 3)))
-
-(defun tramp-file-name-localname (obj)
-  "Return LOCALNAME component of TRAMP-FILE-NAME."
-  (and (tramp-file-name-p obj) (aref obj 4)))
+(defun tramp-file-name-p (vec)
+  "Check whether VEC is a Tramp object."
+  (and (vectorp vec) (= 4 (length vec))))
+
+(defun tramp-file-name-method (vec)
+  "Return method component of VEC."
+  (and (tramp-file-name-p vec) (aref vec 0)))
+
+(defun tramp-file-name-user (vec)
+  "Return user component of VEC."
+  (and (tramp-file-name-p vec) (aref vec 1)))
+
+(defun tramp-file-name-host (vec)
+  "Return host component of VEC."
+  (and (tramp-file-name-p vec) (aref vec 2)))
+
+(defun tramp-file-name-localname (vec)
+  "Return localname component of VEC."
+  (and (tramp-file-name-p vec) (aref vec 3)))
+
+;; The host part of a Tramp file name vector can be of kind
+;; "host#port".  Sometimes, we must extract these parts.
+(defsubst tramp-file-name-real-host (vec)
+  "Return the host name of VEC without port."
+  (let ((host (tramp-file-name-host vec)))
+    (if (and (stringp host)
+            (string-match tramp-host-with-port-regexp host))
+       (match-string 1 host)
+      host)))
+
+(defsubst tramp-file-name-port (vec)
+  "Return the port number of VEC."
+  (let ((host (tramp-file-name-host vec)))
+    (and (stringp host)
+        (string-match tramp-host-with-port-regexp host)
+        (string-to-number (match-string 2 host)))))
 
 (defun tramp-tramp-file-p (name)
-  "Return t if NAME is a tramp file."
+  "Return t iff NAME is a tramp file."
   (save-match-data
     (string-match tramp-file-name-regexp name)))
 
-;; HHH: Changed.  Used to assign the return value of (user-login-name)
-;;      to the `user' part of the structure if a user name was not
-;;      provided, now it assigns nil.
+(defsubst tramp-find-method (method user host)
+  "Return the right method string to use.
+This is METHOD, if non-nil. Otherwise, do a lookup in
+`tramp-default-method-alist'."
+  (or method
+      (let ((choices tramp-default-method-alist)
+           lmethod item)
+       (while choices
+         (setq item (pop choices))
+         (when (and (string-match (or (nth 0 item) "") (or host ""))
+                    (string-match (or (nth 1 item) "") (or user "")))
+           (setq lmethod (nth 2 item))
+           (setq choices nil)))
+       lmethod)
+      tramp-default-method))
+
+(defsubst tramp-find-user (method user host)
+  "Return the right user string to use.
+This is USER, if non-nil. Otherwise, do a lookup in
+`tramp-default-user-alist'."
+  (or user
+      (let ((choices tramp-default-user-alist)
+           luser item)
+       (while choices
+         (setq item (pop choices))
+         (when (and (string-match (or (nth 0 item) "") (or method ""))
+                    (string-match (or (nth 1 item) "") (or host "")))
+           (setq luser (nth 2 item))
+           (setq choices nil)))
+       luser)
+      tramp-default-user))
+
+(defsubst tramp-find-host (method user host)
+  "Return the right host string to use.
+This is HOST, if non-nil. Otherwise, it is `tramp-default-host'."
+  (or (and (> (length host) 0) host)
+      tramp-default-host))
+
 (defun tramp-dissect-file-name (name)
-  "Return an `tramp-file-name' structure.
+  "Return a `tramp-file-name' structure.
 The structure consists of remote method, remote user, remote host and
 localname (file name on remote host)."
   (save-match-data
-    (let* ((match (string-match (nth 0 tramp-file-name-structure) name))
-          (method
-           ; single-hop
-           (if match (match-string (nth 1 tramp-file-name-structure) name)
-             ; maybe multi-hop
-             (string-match
-              (format (nth 0 tramp-multi-file-name-structure)
-                      (nth 0 tramp-multi-file-name-hop-structure)) name)
-             (match-string (nth 1 tramp-multi-file-name-structure) name))))
-      (if (and method (member method tramp-multi-methods))
-          ;; If it's a multi method, the file name structure contains
-          ;; arrays of method, user and host.
-          (tramp-dissect-multi-file-name name)
-        ;; Normal method.  First, find out default method.
-       (unless match (error "Not a tramp file name: %s" name))
-       (let ((user (match-string (nth 2 tramp-file-name-structure) name))
-             (host (match-string (nth 3 tramp-file-name-structure) name))
-             (localname (match-string (nth 4 tramp-file-name-structure) name)))
-         (vector nil method (or user nil) host localname))))))
-
-(defun tramp-find-default-method (user host)
-  "Look up the right method to use in `tramp-default-method-alist'."
-  (let ((choices tramp-default-method-alist)
-       (method tramp-default-method)
-       item)
-    (while choices
-      (setq item (pop choices))
-      (when (and (string-match (or (nth 0 item) "") (or host ""))
-                (string-match (or (nth 1 item) "") (or user "")))
-       (setq method (nth 2 item))
-       (setq choices nil)))
-    method))
-
-(defun tramp-find-method (multi-method method user host)
-  "Return the right method string to use.
-This is MULTI-METHOD, if non-nil.  Otherwise, it is METHOD, if non-nil.
-If both MULTI-METHOD and METHOD are nil, do a lookup in
-`tramp-default-method-alist'."
-  (or multi-method method (tramp-find-default-method user host)))
-
-;; HHH: Not Changed.  Multi method.  Will probably not handle the case where
-;;      a user name is not provided in the "file name" very well.
-(defun tramp-dissect-multi-file-name (name)
-  "Not implemented yet."
-  (let ((regexp           (nth 0 tramp-multi-file-name-structure))
-        (method-index     (nth 1 tramp-multi-file-name-structure))
-        (hops-index       (nth 2 tramp-multi-file-name-structure))
-        (localname-index       (nth 3 tramp-multi-file-name-structure))
-        (hop-regexp       (nth 0 tramp-multi-file-name-hop-structure))
-        (hop-method-index (nth 1 tramp-multi-file-name-hop-structure))
-        (hop-user-index   (nth 2 tramp-multi-file-name-hop-structure))
-        (hop-host-index   (nth 3 tramp-multi-file-name-hop-structure))
-        method hops len hop-methods hop-users hop-hosts localname)
-    (unless (string-match (format regexp hop-regexp) name)
-      (error "Not a multi tramp file name: %s" name))
-    (setq method (match-string method-index name))
-    (setq hops (match-string hops-index name))
-    (setq len (/ (length (match-data t)) 2))
-    (when (< localname-index 0) (setq localname-index (+ localname-index len)))
-    (setq localname (match-string localname-index name))
-    (let ((index 0))
-      (while (string-match hop-regexp hops index)
-        (setq index (match-end 0))
-        (setq hop-methods
-              (cons (match-string hop-method-index hops) hop-methods))
-        (setq hop-users
-              (cons (match-string hop-user-index hops) hop-users))
-        (setq hop-hosts
-              (cons (match-string hop-host-index hops) hop-hosts))))
-    (vector
-     method
-     (apply 'vector (reverse hop-methods))
-     (apply 'vector (reverse hop-users))
-     (apply 'vector (reverse hop-hosts))
-     localname)))
-
-(defun tramp-make-tramp-file-name (multi-method method user host localname)
-  "Constructs a tramp file name from METHOD, USER, HOST and LOCALNAME."
-  (if multi-method
-      (tramp-make-tramp-multi-file-name multi-method method user host localname)
-    (format-spec
-     (concat tramp-prefix-format
-      (when method (concat "%m" tramp-postfix-single-method-format))
-      (when user   (concat "%u" tramp-postfix-user-format))
-      (when host   (concat "%h" tramp-postfix-host-format))
-      (when localname   (concat "%p")))
-    `((?m . ,method) (?u . ,user) (?h . ,host) (?p . ,localname)))))
-
-;; CCC: Henrik Holm: Not Changed.  Multi Method.  What should be done
-;; with this when USER is nil?
-(defun tramp-make-tramp-multi-file-name (multi-method method user host localname)
-  "Constructs a tramp file name for a multi-hop method."
-  (unless tramp-make-multi-tramp-file-format
-    (error "`tramp-make-multi-tramp-file-format' is nil"))
-  (let* ((prefix-format (nth 0 tramp-make-multi-tramp-file-format))
-         (hop-format    (nth 1 tramp-make-multi-tramp-file-format))
-         (localname-format   (nth 2 tramp-make-multi-tramp-file-format))
-         (prefix (format-spec prefix-format `((?m . ,multi-method))))
-         (hops "")
-         (localname (format-spec localname-format `((?p . ,localname))))
-         (i 0)
-         (len (length method)))
-    (while (< i len)
-      (let ((m (aref method i)) (u (aref user i)) (h (aref host i)))
-        (setq hops (concat hops (format-spec hop-format
-                                            `((?m . ,m) (?u . ,u) (?h . ,h)))))
-        (setq i (1+ i))))
-    (concat prefix hops localname)))
-
-(defun tramp-make-copy-program-file-name (user host localname)
-  "Create a file name suitable to be passed to `rcp' and workalikes."
-  (if user
-      (format "%s@%s:%s" user host localname)
-    (format "%s:%s" host localname)))
+    (let ((match (string-match (nth 0 tramp-file-name-structure) name)))
+      (unless match (error "Not a tramp file name: %s" name))
+      (let ((method    (match-string (nth 1 tramp-file-name-structure) name))
+           (user      (match-string (nth 2 tramp-file-name-structure) name))
+           (host      (match-string (nth 3 tramp-file-name-structure) name))
+           (localname (match-string (nth 4 tramp-file-name-structure) name)))
+       (vector
+        (tramp-find-method method user host)
+        (tramp-find-user   method user host)
+        (tramp-find-host   method user host)
+        localname)))))
+
+(defun tramp-equal-remote (file1 file2)
+  "Checks, whether the remote parts of FILE1 and FILE2 are identical.
+The check depends on method, user and host name of the files.  If
+one of the components is missing, the default values are used.
+The local file name parts of FILE1 and FILE2 are not taken into
+account.
+
+Example:
 
-(defun tramp-method-out-of-band-p (multi-method method user host)
+  (tramp-equal-remote \"/ssh::/etc\" \"/<your host name>:/home\")
+
+would yield `t'.  On the other hand, the following check results in nil:
+
+  (tramp-equal-remote \"/sudo::/etc\" \"/su::/etc\")"
+  (and (stringp (file-remote-p file1))
+       (stringp (file-remote-p file2))
+       (string-equal (file-remote-p file1) (file-remote-p file2))))
+
+(defun tramp-make-tramp-file-name (method user host localname)
+  "Constructs a Tramp file name from METHOD, USER, HOST and LOCALNAME."
+  (concat tramp-prefix-format
+         (when (not (zerop (length method)))
+           (concat method tramp-postfix-method-format))
+         (when (not (zerop (length user)))
+           (concat user tramp-postfix-user-format))
+         (when host host) tramp-postfix-host-format
+         (when localname localname)))
+
+(defun tramp-completion-make-tramp-file-name (method user host localname)
+  "Constructs a Tramp file name from METHOD, USER, HOST and LOCALNAME.
+It must not be a complete Tramp file name, but as long as there are
+necessary only.  This function will be used in file name completion."
+  (concat tramp-prefix-format
+         (when (not (zerop (length method)))
+           (concat method tramp-postfix-method-format))
+         (when (not (zerop (length user)))
+           (concat user tramp-postfix-user-format))
+         (when (not (zerop (length host)))
+           (concat host tramp-postfix-host-format))
+         (when localname localname)))
+
+(defun tramp-make-copy-program-file-name (vec)
+  "Create a file name suitable to be passed to `rcp' and workalikes."
+  (let ((user (tramp-file-name-user vec))
+       (host (car (split-string
+                   (tramp-file-name-host vec) tramp-prefix-port-regexp)))
+       (localname (tramp-shell-quote-argument
+                   (tramp-file-name-localname vec))))
+    (if (not (zerop (length user)))
+        (format "%s@%s:%s" user host localname)
+      (format "%s:%s" host localname))))
+
+(defun tramp-method-out-of-band-p (vec)
   "Return t if this is an out-of-band method, nil otherwise."
-  (tramp-get-method-parameter
-   multi-method
-   (tramp-find-method multi-method method user host)
-   user host 'tramp-copy-program))
+  (tramp-get-method-parameter (tramp-file-name-method vec) 'tramp-copy-program))
 
 ;; Variables local to connection.
 
-(defun tramp-get-ls-command (multi-method method user host)
-  (or
-   (save-excursion
-     (tramp-maybe-open-connection multi-method method user host)
-     (set-buffer (tramp-get-buffer multi-method method user host))
-     tramp-ls-command)
-   (error "Couldn't find remote `ls' command")))
-
-(defun tramp-get-test-groks-nt (multi-method method user host)
-  (save-excursion
-    (tramp-maybe-open-connection multi-method method user host)
-    (set-buffer (tramp-get-buffer multi-method method user host))
-    tramp-test-groks-nt))
-
-(defun tramp-get-file-exists-command (multi-method method user host)
-  (or
-   (save-excursion
-     (tramp-maybe-open-connection multi-method method user host)
-     (set-buffer (tramp-get-buffer multi-method method user host))
-     tramp-file-exists-command)
-   (error "Couldn't find remote `test -e' command")))
+(defun tramp-get-ls-command (vec)
+  (with-connection-property vec "ls"
+    (with-current-buffer (tramp-get-buffer vec)
+      (tramp-message vec 5 "Finding a suitable `ls' command")
+      (or
+       (catch 'ls-found
+        (dolist (cmd '("ls" "gnuls" "gls"))
+          (let ((dl tramp-remote-path)
+                result)
+            (while
+                (and
+                 dl
+                 (setq result
+                       (tramp-find-executable vec cmd dl t t)))
+              ;; Check parameter.
+              (when (zerop (tramp-send-command-and-check
+                            vec (format "%s -lnd /" result)))
+                (throw 'ls-found result))
+              ;; Remove unneeded directories from path.
+              (while
+                  (and
+                   dl
+                   (not
+                    (string-equal result (expand-file-name cmd (car dl)))))
+                (setq dl (cdr dl)))
+              (setq dl (cdr dl))))))
+       (tramp-error vec 'file-error "Couldn't find a proper `ls' command")))))
+
+(defun tramp-get-test-command (vec)
+  (with-connection-property vec "test"
+    (with-current-buffer (tramp-get-buffer vec)
+      (tramp-message vec 5 "Finding a suitable `test' command")
+      (if (zerop (tramp-send-command-and-check vec "test 0"))
+         "test"
+       (tramp-find-executable vec "test" tramp-remote-path)))))
+
+(defun tramp-get-test-nt-command (vec)
+  ;; Does `test A -nt B' work?  Use abominable `find' construct if it
+  ;; doesn't.  BSD/OS 4.0 wants the parentheses around the command,
+  ;; for otherwise the shell crashes.
+  (with-connection-property vec "test-nt"
+    (or
+     (progn
+       (tramp-send-command
+       vec (format "( %s / -nt / )" (tramp-get-test-command vec)))
+       (with-current-buffer (tramp-get-buffer vec)
+        (goto-char (point-min))
+        (when (looking-at
+               (format "\n%s\r?\n" (regexp-quote tramp-end-of-output)))
+          (format "%s %%s -nt %%s" (tramp-get-test-command vec)))))
+     (progn
+       (tramp-send-command
+       vec
+       (format
+        "tramp_test_nt () {\n%s -n \"`find $1 -prune -newer $2 -print`\"\n}"
+        (tramp-get-test-command vec)))
+       "tramp_test_nt %s %s"))))
+
+(defun tramp-get-file-exists-command (vec)
+  (with-connection-property vec "file-exists"
+    (with-current-buffer (tramp-get-buffer vec)
+      (tramp-message vec 5 "Finding command to check if file exists")
+      (tramp-find-file-exists-command vec))))
+
+(defun tramp-get-remote-ln (vec)
+  (with-connection-property vec "ln"
+    (with-current-buffer (tramp-get-buffer vec)
+      (tramp-message vec 5 "Finding a suitable `ln' command")
+      (tramp-find-executable vec "ln" tramp-remote-path))))
+
+(defun tramp-get-remote-perl (vec)
+  (with-connection-property vec "perl"
+    (with-current-buffer (tramp-get-buffer vec)
+      (tramp-message vec 5 "Finding a suitable `perl' command")
+      (or (tramp-find-executable vec "perl5" tramp-remote-path)
+         (tramp-find-executable vec "perl" tramp-remote-path)))))
+
+(defun tramp-get-remote-stat (vec)
+  (with-connection-property vec "stat"
+    (with-current-buffer (tramp-get-buffer vec)
+      (tramp-message vec 5 "Finding a suitable `stat' command")
+      (let ((result (tramp-find-executable vec "stat" tramp-remote-path))
+           tmp)
+       ;; Check whether stat(1) returns usable syntax.
+       (when result
+         (setq tmp
+               ;; We don't want to display an error message.
+               (with-temp-message (or (current-message) "")
+                 (condition-case nil
+                     (tramp-send-command-and-read
+                      vec (format "%s -c '(\"%%N\")' /" result))
+                   (error nil))))
+         (unless (and (listp tmp) (stringp (car tmp))
+                      (string-match "^./.$" (car tmp)))
+           (setq result nil)))
+       result))))
 
-(defun tramp-get-remote-perl (multi-method method user host)
-  (tramp-get-connection-property "perl" nil multi-method method user host))
+(defun tramp-get-remote-id (vec)
+  (with-connection-property vec "id"
+    (with-current-buffer (tramp-get-buffer vec)
+      (tramp-message vec 5 "Finding POSIX `id' command")
+      (or
+       (catch 'id-found
+        (let ((dl tramp-remote-path)
+              result)
+          (while
+              (and
+               dl
+               (setq result
+                     (tramp-find-executable vec "id" dl t t)))
+            ;; Check POSIX parameter.
+            (when (zerop (tramp-send-command-and-check
+                          vec (format "%s -u" result)))
+              (throw 'id-found result))
+            ;; Remove unneeded directories from path.
+            (while
+                (and
+                 dl
+                 (not
+                  (string-equal
+                   result
+                   (concat (file-name-as-directory (car dl)) "id"))))
+              (setq dl (cdr dl)))
+            (setq dl (cdr dl)))))
+       (tramp-error vec 'file-error "Couldn't find a POSIX `id' command")))))
+
+(defun tramp-get-remote-uid (vec id-format)
+  (with-connection-property vec (format "uid-%s" id-format)
+    (let ((res (tramp-send-command-and-read
+               vec
+               (format "%s -u%s %s"
+                       (tramp-get-remote-id vec)
+                       (if (equal id-format 'integer) "" "n")
+                       (if (equal id-format 'integer)
+                           "" "| sed -e s/^/\\\"/ -e s/\$/\\\"/")))))
+      ;; The command might not always return a number.
+      (if (and (equal id-format 'integer) (not (integerp res))) -1 res))))
+
+(defun tramp-get-remote-gid (vec id-format)
+  (with-connection-property vec (format "gid-%s" id-format)
+    (let ((res (tramp-send-command-and-read
+               vec
+               (format "%s -g%s %s"
+                       (tramp-get-remote-id vec)
+                       (if (equal id-format 'integer) "" "n")
+                       (if (equal id-format 'integer)
+                           "" "| sed -e s/^/\\\"/ -e s/\$/\\\"/")))))
+      ;; The command might not always return a number.
+      (if (and (equal id-format 'integer) (not (integerp res))) -1 res))))
 
-(defun tramp-get-remote-ln (multi-method method user host)
+;; Some predefined connection properties.
+(defun tramp-get-remote-coding (vec prop)
+  ;; Local coding handles properties like remote coding.  So we could
+  ;; call it without pain.
+  (let ((ret (tramp-get-local-coding vec prop)))
+    ;; The connection property might have been cached.  So we must send
+    ;; the script - maybe.
+    (when (not (stringp ret))
+      (let ((name (symbol-name ret)))
+       (while (string-match (regexp-quote "-") name)
+         (setq name (replace-match "_" nil t name)))
+       (tramp-maybe-send-script vec (symbol-value ret) name)
+       (setq ret name)))
+    ;; Return the value.
+    ret))
+
+(defun tramp-get-local-coding (vec prop)
   (or
-   (tramp-get-connection-property "ln" nil multi-method method user host)
-   (error "Couldn't find remote `ln' command")))
-
-(defun tramp-get-remote-uid (multi-method method user host)
-  (tramp-get-connection-property "uid" nil multi-method method user host))
-
-(defun tramp-get-remote-gid (multi-method method user host)
-  (tramp-get-connection-property "gid" nil multi-method method user host))
-
-;; Get a property of a TRAMP connection.
-(defun tramp-get-connection-property
-  (property default multi-method method user host)
-  "Get the named property for the connection.
-If the value is not set for the connection, return `default'"
-  (tramp-maybe-open-connection multi-method method user host)
-  (with-current-buffer (tramp-get-buffer multi-method method user host)
-    (let (error)
-      (condition-case nil
-         (symbol-value (intern (concat "tramp-connection-property-" property)))
-       (error default)))))
-
-;; Set a property of a TRAMP connection.
-(defun tramp-set-connection-property
-  (property value multi-method method user host)
-  "Set the named property of a TRAMP connection."
-  (tramp-maybe-open-connection multi-method method user host)
-  (with-current-buffer (tramp-get-buffer multi-method method user host)
-    (set (make-local-variable
-         (intern (concat "tramp-connection-property-" property)))
-         value)))
+   (tramp-get-connection-property vec prop nil)
+   (progn
+     (tramp-find-inline-encoding vec)
+     (tramp-get-connection-property vec prop nil))))
 
-;; Some predefined connection properties.
-(defun tramp-set-remote-encoding (multi-method method user host rem-enc)
-  (tramp-set-connection-property "remote-encoding" rem-enc
-                                multi-method method user host))
-(defun tramp-get-remote-encoding (multi-method method user host)
-  (tramp-get-connection-property "remote-encoding" nil
-                                multi-method method user host))
-
-(defun tramp-set-remote-decoding (multi-method method user host rem-dec)
-  (tramp-set-connection-property "remote-decoding" rem-dec
-                                multi-method method user host))
-(defun tramp-get-remote-decoding (multi-method method user host)
-  (tramp-get-connection-property "remote-decoding" nil
-                                multi-method method user host))
-
-(defun tramp-set-local-encoding (multi-method method user host loc-enc)
-  (tramp-set-connection-property "local-encoding" loc-enc
-                                multi-method method user host))
-(defun tramp-get-local-encoding (multi-method method user host)
-  (tramp-get-connection-property "local-encoding" nil
-                                multi-method method user host))
-
-(defun tramp-set-local-decoding (multi-method method user host loc-dec)
-  (tramp-set-connection-property "local-decoding" loc-dec
-                                multi-method method user host))
-(defun tramp-get-local-decoding (multi-method method user host)
-  (tramp-get-connection-property "local-decoding" nil
-                                multi-method method user host))
-
-(defun tramp-get-method-parameter (multi-method method user host param)
+(defun tramp-get-method-parameter (method param)
   "Return the method parameter PARAM.
-If the `tramp-methods' entry does not exist, use the variable PARAM
-as default."
-  (unless (boundp param)
-    (error "Non-existing method parameter `%s'" param))
-  (let ((entry (assoc param
-                     (assoc (tramp-find-method multi-method method user host)
-                            tramp-methods))))
-    (if entry
-       (cadr entry)
-      (symbol-value param))))
-
+If the `tramp-methods' entry does not exist, return NIL."
+  (let ((entry (assoc param (assoc method tramp-methods))))
+    (when entry (cadr entry))))
 
 ;; Auto saving to a special directory.
 
 (defun tramp-exists-file-name-handler (operation &rest args)
-  (let ((buffer-file-name "/")
-       (fnha file-name-handler-alist)
-       (check-file-name-operation operation)
-       (file-name-handler-alist
-        (list
-         (cons "/"
-               '(lambda (operation &rest args)
-                  "Returns OPERATION if it is the one to be checked"
-                  (if (equal check-file-name-operation operation)
-                      operation
-                    (let ((file-name-handler-alist fnha))
-                      (apply operation args))))))))
-    (eq (apply operation args) operation)))
+  "Checks whether OPERATION runs a file name handler."
+  ;; The file name handler is determined on base of either an
+  ;; argument, `buffer-file-name', or `default-directory'.
+  (condition-case nil
+      (let* ((buffer-file-name "/")
+            (default-directory "/")
+            (fnha file-name-handler-alist)
+            (check-file-name-operation operation)
+            (file-name-handler-alist
+             (list
+              (cons "/"
+                    '(lambda (operation &rest args)
+                       "Returns OPERATION if it is the one to be checked."
+                       (if (equal check-file-name-operation operation)
+                           operation
+                         (let ((file-name-handler-alist fnha))
+                           (apply operation args))))))))
+       (equal (apply operation args) operation))
+    (error nil)))
 
 (unless (tramp-exists-file-name-handler 'make-auto-save-file-name)
   (defadvice make-auto-save-file-name
     (around tramp-advice-make-auto-save-file-name () activate)
-    "Invoke `tramp-handle-make-auto-save-file-name' for tramp files."
+    "Invoke `tramp-handle-make-auto-save-file-name' for Tramp files."
     (if (and (buffer-file-name) (tramp-tramp-file-p (buffer-file-name)))
        (setq ad-return-value (tramp-handle-make-auto-save-file-name))
       ad-do-it))
@@ -7332,12 +6805,6 @@ ALIST is of the form ((FROM . TO) ...)."
         (setq alist (cdr alist))))
     string))
 
-(defun tramp-insert-with-face (face string)
-  "Insert text with a specific face."
-  (let ((start (point)))
-    (insert string)
-    (add-text-properties start (point) (list 'face face))))
-
 ;; ------------------------------------------------------------
 ;; -- Compatibility functions section --
 ;; ------------------------------------------------------------
@@ -7361,28 +6828,63 @@ this is the function `temp-directory'."
                             "`temp-directory' is defined -- using /tmp."))
            (file-name-as-directory "/tmp"))))
 
-(defun tramp-read-passwd (user host prompt)
+(defun tramp-read-passwd (proc &optional prompt)
   "Read a password from user (compat function).
 Invokes `password-read' if available, `read-passwd' else."
-  (if (functionp 'password-read)
-      (let* ((key (concat (or user (user-login-name)) "@" host))
-            (password (apply #'password-read (list prompt key))))
-       (apply #'password-cache-add (list key password))
-       password)
-    (read-passwd prompt)))
-
-(defun tramp-clear-passwd (&optional user host)
-  "Clear password cache for connection related to current-buffer."
+  (let* ((key (tramp-make-tramp-file-name
+              tramp-current-method tramp-current-user
+              tramp-current-host ""))
+        (pw-prompt
+         (or prompt
+             (with-current-buffer (process-buffer proc)
+               (tramp-check-for-regexp proc tramp-password-prompt-regexp)
+               (format "%s for %s " (capitalize (match-string 1)) key)))))
+    (if (functionp 'password-read)
+       (let ((password (apply #'password-read  (list pw-prompt key))))
+         (apply #'password-cache-add (list key password))
+         password)
+      (read-passwd pw-prompt))))
+
+(defun tramp-clear-passwd ()
+  "Clear password cache for connection related to current-buffer.
+If METHOD, USER or HOST is given, take then for computing the key."
   (interactive)
-  (let ((filename (or buffer-file-name list-buffers-directory "")))
-    (when (and (functionp 'password-cache-remove)
-              (or (and user host) (tramp-tramp-file-p filename)))
-      (let* ((v (when (tramp-tramp-file-p filename)
-                 (tramp-dissect-file-name filename)))
-            (luser (or user (tramp-file-name-user v) (user-login-name)))
-            (lhost (or host (tramp-file-name-host v) (system-name)))
-            (key (concat luser "@" lhost)))
-       (apply #'password-cache-remove (list key))))))
+  (when (functionp 'password-cache-remove)
+    (apply #'password-cache-remove
+          (list (tramp-make-tramp-file-name
+                 tramp-current-method
+                 tramp-current-user
+                 tramp-current-host
+                 "")))))
+
+;; Snarfed code from time-date.el and parse-time.el
+
+(defconst tramp-half-a-year '(241 17024)
+"Evaluated by \"(days-to-time 183)\".")
+
+(defconst tramp-parse-time-months
+  '(("jan" . 1) ("feb" . 2) ("mar" . 3)
+    ("apr" . 4) ("may" . 5) ("jun" . 6)
+    ("jul" . 7) ("aug" . 8) ("sep" . 9)
+    ("oct" . 10) ("nov" . 11) ("dec" . 12))
+  "Alist mapping month names to integers.")
+
+(defun tramp-time-less-p (t1 t2)
+  "Say whether time value T1 is less than time value T2."
+  (unless t1 (setq t1 '(0 0)))
+  (unless t2 (setq t2 '(0 0)))
+  (or (< (car t1) (car t2))
+      (and (= (car t1) (car t2))
+          (< (nth 1 t1) (nth 1 t2)))))
+
+(defun tramp-time-subtract (t1 t2)
+  "Subtract two time values.
+Return the difference in the format of a time value."
+  (unless t1 (setq t1 '(0 0)))
+  (unless t2 (setq t2 '(0 0)))
+  (let ((borrow (< (cadr t1) (cadr t2))))
+    (list (- (car t1) (car t2) (if borrow 1 0))
+         (- (+ (if borrow 65536 0) (cadr t1)) (cadr t2)))))
 
 (defun tramp-time-diff (t1 t2)
   "Return the difference between the two times, in seconds.
@@ -7401,11 +6903,7 @@ T1 and T2 are time values (as returned by `current-time' for example)."
                  (if (< (length t1) 3) (append t1 '(0)) t1)
                  (if (< (length t2) 3) (append t2 '(0)) t2)))
         (t
-         ;; snarfed from Emacs 21 time-date.el; combining
-        ;; time-to-seconds and subtract-time
-        (let ((time  (let ((borrow (< (cadr t1) (cadr t2))))
-                 (list (- (car t1) (car t2) (if borrow 1 0))
-                       (- (+ (if borrow 65536 0) (cadr t1)) (cadr t2))))))
+        (let ((time (tramp-time-subtract t1 t2)))
           (+ (* (car time) 65536.0)
              (cadr time)
              (/ (or (nth 2 time) 0) 1000000.0))))))
@@ -7444,11 +6942,9 @@ it does the right thing."
   "Specify if query is needed for process when Emacs is exited.
 If the second argument flag is non-nil, Emacs will query the user before
 exiting if process is running."
- (funcall
   (if (fboundp 'set-process-query-on-exit-flag)
-      (symbol-function 'set-process-query-on-exit-flag)
-    (symbol-function 'process-kill-without-query))
-  process flag))
+      (funcall (symbol-function 'set-process-query-on-exit-flag) process flag)
+    (funcall (symbol-function 'process-kill-without-query) process flag)))
 
 
 ;; ------------------------------------------------------------
@@ -7495,29 +6991,6 @@ Only works for Bourne-like shells."
                                      t t result)))
        result))))
 
-;; ;; EFS hooks itself into the file name handling stuff in more places
-;; ;; than just `file-name-handler-alist'. The following tells EFS to stay
-;; ;; away from tramp.el file names.
-;; ;;
-;; ;; This is needed because EFS installs (efs-dired-before-readin) into
-;; ;; 'dired-before-readin-hook'. This prevents EFS from opening an FTP
-;; ;; connection to help it's dired process. Not that I have any real
-;; ;; idea *why* this is helpful to dired.
-;; ;;
-;; ;; Anyway, this advice fixes the problem (with a sledgehammer :)
-;; ;;
-;; ;; Daniel Pittman <daniel@danann.net>
-;; ;;
-;; ;; CCC: when the other defadvice calls have disappeared, make sure
-;; ;; not to call defadvice unless it's necessary.  How do we find out whether
-;; ;; it is necessary?  (featurep 'efs) is surely the wrong way --
-;; ;; EFS might nicht be loaded yet.
-;; (defadvice efs-ftp-path (around dont-match-tramp-localname activate protect)
-;;   "Cause efs-ftp-path to fail when the path is a TRAMP localname."
-;;   (if (tramp-tramp-file-p (ad-get-arg 0))
-;;       nil
-;;     ad-do-it))
-
 ;; We currently (sometimes) use "[" and "]" in the filename format.
 ;; This means that Emacs wants to expand wildcards if
 ;; `find-file-wildcards' is non-nil, and then barfs because no
@@ -7568,10 +7041,6 @@ Only works for Bourne-like shells."
        (format "tramp (%s)" tramp-version) ; package name and version
        (delq nil
             `(;; Current state
-              tramp-ls-command
-              tramp-test-groks-nt
-              tramp-file-exists-command
-              tramp-current-multi-method
               tramp-current-method
               tramp-current-user
               tramp-current-host
@@ -7579,6 +7048,11 @@ Only works for Bourne-like shells."
               ;; System defaults
               tramp-auto-save-directory        ; vars to dump
               tramp-default-method
+              tramp-default-method-alist
+              tramp-default-host
+              tramp-default-proxies-alist
+              tramp-default-user
+              tramp-default-user-alist
               tramp-rsh-end-of-line
               tramp-default-password-end-of-line
               tramp-remote-path
@@ -7592,24 +7066,21 @@ Only works for Bourne-like shells."
               tramp-temp-name-prefix
               tramp-file-name-structure
               tramp-file-name-regexp
-              tramp-multi-file-name-structure
-              tramp-multi-file-name-hop-structure
-              tramp-multi-methods
-              tramp-multi-connection-function-alist
               tramp-methods
               tramp-end-of-output
-              tramp-coding-commands
+              tramp-local-coding-commands
+              tramp-remote-coding-commands
               tramp-actions-before-shell
               tramp-actions-copy-out-of-band
-              tramp-multi-actions
               tramp-terminal-type
               ;; Mask non-7bit characters
               (tramp-shell-prompt-pattern . tramp-reporter-dump-variable)
-              tramp-chunksize
               ,(when (boundp 'tramp-backup-directory-alist)
                  'tramp-backup-directory-alist)
               ,(when (boundp 'tramp-bkup-backup-directory-info)
                  'tramp-bkup-backup-directory-info)
+              ;; Dump cache.
+              (tramp-cache-data . tramp-reporter-dump-variable)
 
               ;; Non-tramp variables of interest
               ;; Mask non-7bit characters
@@ -7632,18 +7103,21 @@ Only works for Bourne-like shells."
        'tramp-load-report-modules      ; pre-hook
        'tramp-append-tramp-buffers     ; post-hook
        "\
-Enter your bug report in this message, including as much detail as you
-possibly can about the problem, what you did to cause it and what the
-local and remote machines are.
+Enter your bug report in this message, including as much detail
+as you possibly can about the problem, what you did to cause it
+and what the local and remote machines are.
 
-If you can give a simple set of instructions to make this bug happen
-reliably, please include those.  Thank you for helping kill bugs in
-TRAMP.
+If you can give a simple set of instructions to make this bug
+happen reliably, please include those.  Thank you for helping
+kill bugs in TRAMP.
 
-Another useful thing to do is to put (setq tramp-debug-buffer t) in
-the ~/.emacs file and to repeat the bug.  Then, include the contents
-of the *tramp/foo* buffer and the *debug tramp/foo* buffer in your bug
-report.
+Another useful thing to do is to put
+
+  (setq tramp-verbose 8)
+
+in the ~/.emacs file and to repeat the bug.  Then, include the
+contents of the *tramp/foo* buffer and the *debug tramp/foo*
+buffer in your bug report.
 
 --bug report follows this line--
 "))))
@@ -7655,29 +7129,32 @@ Used for non-7bit chars in strings."
         (val (with-current-buffer reporter-eval-buffer
                (symbol-value varsym))))
 
-    ;; There are characters to be masked.
-    (when (and (boundp 'mm-7bit-chars)
-              (string-match
-               (concat "[^" (symbol-value 'mm-7bit-chars) "]") val))
-      (with-current-buffer reporter-eval-buffer
-       (set varsym (concat "(base64-decode-string \""
-                           (base64-encode-string val)
-                           "\")"))))
+    (if (hash-table-p val)
+       ;; Pretty print the cache.
+       (set varsym (read (format "(%s)" (tramp-cache-print val))))
+      ;; There are characters to be masked.
+      (when (and (boundp 'mm-7bit-chars)
+                (string-match
+                 (concat "[^" (symbol-value 'mm-7bit-chars) "]") val))
+       (with-current-buffer reporter-eval-buffer
+         (set varsym (format "(base64-decode-string \"%s\""
+                             (base64-encode-string val))))))
 
     ;; Dump variable.
     (funcall (symbol-function 'reporter-dump-variable) varsym mailbuf)
 
-    ;; Remove string quotation.
-    (forward-line -1)
-    (when (looking-at
-          (concat "\\(^.*\\)" "\""                       ;; \1 "
-                  "\\((base64-decode-string \\)" "\\\\"  ;; \2 \
-                  "\\(\".*\\)" "\\\\"                    ;; \3 \
-                  "\\(\")\\)" "\"$"))                    ;; \4 "
-      (replace-match "\\1\\2\\3\\4")
-      (beginning-of-line)
-      (insert " ;; variable encoded due to non-printable characters\n"))
-    (forward-line 1)
+    (unless (hash-table-p val)
+      ;; Remove string quotation.
+      (forward-line -1)
+      (when (looking-at
+            (concat "\\(^.*\\)" "\""                       ;; \1 "
+                    "\\((base64-decode-string \\)" "\\\\"  ;; \2 \
+                    "\\(\".*\\)" "\\\\"                    ;; \3 \
+                    "\\(\")\\)" "\"$"))                    ;; \4 "
+       (replace-match "\\1\\2\\3\\4")
+       (beginning-of-line)
+       (insert " ;; variable encoded due to non-printable characters\n"))
+      (forward-line 1))
 
     ;; Reset VARSYM to old value.
     (with-current-buffer reporter-eval-buffer
@@ -7699,8 +7176,39 @@ Used for non-7bit chars in strings."
     (funcall (symbol-function 'mml-mode) t)))
 
 (defun tramp-append-tramp-buffers ()
-  "Append Tramp buffers into the bug report."
+  "Append Tramp buffers and buffer local variables into the bug report."
 
+  (goto-char (point-max))
+
+  ;; Dump buffer local variables.
+  (dolist (buffer
+          (delq nil
+                (mapcar
+                 '(lambda (b)
+                    (when (string-match "\\*tramp/" (buffer-name b)) b))
+                 (buffer-list))))
+    (let ((reporter-eval-buffer buffer)
+         (buffer-name (buffer-name buffer))
+         (elbuf (get-buffer-create " *tmp-reporter-buffer*")))
+      (with-current-buffer elbuf
+       (emacs-lisp-mode)
+       (erase-buffer)
+       (insert "\n(setq\n")
+       (lisp-indent-line)
+       (funcall (symbol-function '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)))))
+       (lisp-indent-line)
+       (insert ")\n"))
+      (insert-buffer-substring elbuf)))
+
+  ;; Append buffers only when we are in message mode.
   (when (and
         (eq major-mode 'message-mode)
         (boundp 'mml-mode)
@@ -7721,24 +7229,26 @@ Used for non-7bit chars in strings."
        (setq buffer-read-only nil)
        (goto-char (point-min))
        (while (not (eobp))
-         (if (re-search-forward tramp-buf-regexp (tramp-point-at-eol) t)
+         (if (re-search-forward tramp-buf-regexp (tramp-line-end-position) t)
              (forward-line 1)
            (forward-line 0)
            (let ((start (point)))
              (forward-line 1)
              (kill-region start (point)))))
        (insert "
-The buffer(s) above will be appended to this message.  If you don't want
-to append a buffer because it contains sensitive data, or because the buffer
-is too large, you should delete the respective buffer.  The buffer(s) will
-contain user and host names.  Passwords will never be included there.")
+The buffer(s) above will be appended to this message.  If you
+don't want to append a buffer because it contains sensitive data,
+or because the buffer is too large, you should delete the
+respective buffer.  The buffer(s) will contain user and host
+names.  Passwords will never be included there.")
 
-       (when (and tramp-debug-buffer (> tramp-verbose 9))
+       (when (>= tramp-verbose 6)
          (insert "\n\n")
          (let ((start (point)))
            (insert "\
-Please note that you have set `tramp-verbose' to a value greater than 9.
-Therefore, the contents of files might be included in the debug buffer(s).")
+Please note that you have set `tramp-verbose' to a value of at
+least 6.  Therefore, the contents of files might be included in
+the debug buffer(s).")
            (add-text-properties start (point) (list 'face 'italic))))
 
        (set-buffer-modified-p nil)
@@ -7751,7 +7261,10 @@ Therefore, the contents of files might be included in the debug buffer(s).")
              (kill-buffer nil)
              (switch-to-buffer curbuf)
              (goto-char (point-max))
-             (insert "\n\n")
+             (insert "\n\
+This is a special notion of the `gnus/message' package.  If you
+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"
@@ -7782,9 +7295,9 @@ Therefore, the contents of files might be included in the debug buffer(s).")
   ;; ange-ftp settings must be enabled.
   (when (functionp 'tramp-ftp-enable-ange-ftp)
     (funcall (symbol-function 'tramp-ftp-enable-ange-ftp)))
-  ;; `tramp-util' unloads also `tramp'.
-  (condition-case nil ;; maybe its not loaded yet.
-      (unload-feature (if (featurep 'tramp-util) 'tramp-util 'tramp) 'force)
+  ;; Maybe its not loaded yet.
+  (condition-case nil
+      (unload-feature 'tramp 'force)
     (error nil)))
 
 (provide 'tramp)
@@ -7792,9 +7305,9 @@ Therefore, the contents of files might be included in the debug buffer(s).")
 ;; Make sure that we get integration with the VC package.
 ;; When it is loaded, we need to pull in the integration module.
 ;; This must come after (provide 'tramp) because tramp-vc.el
-;; requires tramp.
+;; requires tramp.  Not necessary in Emacs 23.
 (eval-after-load "vc"
-  '(progn
+  '(unless (functionp 'start-file-process)
      (require 'tramp-vc)
      (add-hook 'tramp-unload-hook
               '(lambda ()
@@ -7811,6 +7324,12 @@ Therefore, the contents of files might be included in the debug buffer(s).")
 ;;   Another approach is to read a netrc file like ~/.authinfo
 ;;   from Gnus.
 ;; * Handle nonlocal exits such as C-g.
+;; * But it would probably be better to use with-local-quit at the
+;;   place where it's actually needed: around any potentially
+;;   indefinitely blocking piece of code.  In this case it would be
+;;   within Tramp around one of its calls to accept-process-output (or
+;;   around one of the loops that calls accept-process-output)
+;;   (Stefann Monnier).
 ;; * Autodetect if remote `ls' groks the "--dired" switch.
 ;; * Add fallback for inline encodings.  This should be used
 ;;   if the remote end doesn't support mimencode or a similar program.
@@ -7824,9 +7343,6 @@ Therefore, the contents of files might be included in the debug buffer(s).")
 ;;   two commands to write a null byte:
 ;;   dd if=/dev/zero bs=1 count=1
 ;;   echo | tr '\n' '\000'
-;; * Separate local `tramp-coding-commands' from remote ones.  Connect
-;;   the two via a format which can be `uu' or `b64'.  Then we can search
-;;   for the right local commands and the right remote commands separately.
 ;; * Cooperate with PCL-CVS.  It uses start-process, which doesn't
 ;;   work for remote files.
 ;; * Rewrite `tramp-shell-quote-argument' to abstain from using
@@ -7846,43 +7362,27 @@ Therefore, the contents of files might be included in the debug buffer(s).")
 ;; * Don't use globbing for directories with many files, as this is
 ;;   likely to produce long command lines, and some shells choke on
 ;;   long command lines.
-;; * Find out about the new auto-save mechanism in Emacs 21 and
-;;   do the right thing.
 ;; * `vc-directory' does not work.  It never displays any files, even
 ;;   if it does show files when run locally.
 ;; * Allow correction of passwords, if the remote end allows this.
 ;;   (Mark Hershberger)
 ;; * How to deal with MULE in `insert-file-contents' and `write-region'?
-;; * Do asynchronous `shell-command's.
 ;; * Grok `append' parameter for `write-region'.
 ;; * Test remote ksh or bash for tilde expansion in `tramp-find-shell'?
 ;; * abbreviate-file-name
 ;; * grok ~ in tramp-remote-path  (Henrik Holm <henrikh@tele.ntnu.no>)
-;; * Also allow to omit user names when doing multi-hop.  Not sure yet
-;;   what the user names should default to, though.
 ;; * better error checking.  At least whenever we see something
 ;;   strange when doing zerop, we should kill the process and start
 ;;   again.  (Greg Stark)
-;; * Add caching for filename completion.  (Greg Stark)
-;;   Of course, this has issues with usability (stale cache bites)
-;;      -- <daniel@danann.net>
 ;; * Provide a local cache of old versions of remote files for the rsync
 ;;   transfer method to use.  (Greg Stark)
 ;; * Remove unneeded parameters from methods.
 ;; * Invoke rsync once for copying a whole directory hierarchy.
-;;   (Francesco Potort\e,Al\e(B)
-;; * Should we set PATH ourselves or should we rely on the remote end
-;;   to do it?
-;; * Make it work for XEmacs 20, which is missing `with-timeout'.
+;;   (Francesco Potortì)
 ;; * Make it work for different encodings, and for different file name
 ;;   encodings, too.  (Daniel Pittman)
-;; * Change applicable functions to pass a struct tramp-file-name rather
-;;   than the individual items MULTI-METHOD, METHOD, USER, HOST, LOCALNAME.
-;; * Implement asynchronous shell commands.
 ;; * Clean up unused *tramp/foo* buffers after a while.  (Pete Forman)
 ;; * Progress reports while copying files.  (Michael Kifer)
-;; * `Smart' connection method that uses inline for small and out of
-;;   band for large files.  (Michael Kifer)
 ;; * Don't search for perl5 and perl.  Instead, only search for perl and
 ;;   then look if it's the right version (with `perl -v').
 ;; * When editing a remote CVS controlled file as a different user, VC
@@ -7895,19 +7395,49 @@ Therefore, the contents of files might be included in the debug buffer(s).")
 ;;   about Tramp, it does not do the right thing if the target file
 ;;   name is a Tramp name.
 ;; * Username and hostname completion.
-;; ** If `partial-completion-mode' isn't loaded, "/foo:bla" tries to
-;;    connect to host "blabla" already if that host is unique. No idea
-;;    how to suppress. Maybe not an essential problem.
 ;; ** Try to avoid usage of `last-input-event' in `tramp-completion-mode'.
-;; ** Extend `tramp-get-completion-su' for NIS and shadow passwords.
 ;; ** Unify `tramp-parse-{rhosts,shosts,sconfig,hosts,passwd,netrc}'.
 ;;    Code is nearly identical.
-;; ** Decide whiche files to take for searching user/host names depending on
-;;    operating system (windows-nt) in `tramp-completion-function-alist'.
-;; ** Enhance variables for debug.
-;; ** Implement "/multi:" completion.
-;; ** Add a learning mode for completion. Make results persistent.
 ;; * Allow out-of-band methods as _last_ multi-hop.
+;; * WIBNI if we had a command "trampclient"?  If I was editing in
+;;   some shell with root priviledges, it would be nice if I could
+;;   just call
+;;     trampclient filename.c
+;;   as an editor, and the _current_ shell would connect to an Emacs
+;;   server and would be used in an existing non-priviledged Emacs
+;;   session for doing the editing in question.
+;;   That way, I need not tell Emacs my password again and be afraid
+;;   that it makes it into core dumps or other ugly stuff (I had Emacs
+;;   once display a just typed password in the context of a keyboard
+;;   sequence prompt for a question immediately following in a shell
+;;   script run within Emacs -- nasty).
+;;   And if I have some ssh session running to a different computer,
+;;   having the possibility of passing a local file there to a local
+;;   Emacs session (in case I can arrange for a connection back) would
+;;   be nice.
+;;   Likely the corresponding tramp server should not allow the
+;;   equivalent of the emacsclient -eval option in order to make this
+;;   reasonably unproblematic.  And maybe trampclient should have some
+;;   way of passing credentials, like by using an SSL socket or
+;;   something. (David Kastrup)
+;; * Could Tramp reasonably look for a prompt after ^M rather than
+;;   only after ^J ? (Stefan Monnier)
+;; * WIBNI there was an interactive command prompting for tramp
+;;   method, hostname, username and filename and translates the user
+;;   input into the correct filename syntax (depending on the Emacs
+;;   flavor) (Reiner Steib)
+;; * Let the user edit the connection properties interactively.
+;;   Something like `gnus-server-edit-server' in Gnus' *Server* buffer.
+;; * Reconnect directly to a compliant shell without first going
+;;   through the user's default shell. (Pete Forman)
+;; * It's just that when I come to Customize `tramp-default-user-alist'
+;;   I'm presented with a mismatch and raw lisp for a value.  It is my
+;;   understanding that a variable declared with defcustom is a User
+;;   Option and should not be modified by the code.  add-to-list is
+;;   called in several places. One way to handle that is to have a new
+;;   ordinary variable that gets its initial value from
+;;   tramp-default-user-alist and then is added to. (Pete Forman)
+;; * Make `tramp-default-user' obsolete.
 
 ;; Functions for file-name-handler-alist:
 ;; diff-latest-backup-file -- in diff.el
index 5734b5c..f10f08e 100644 (file)
@@ -1,10 +1,10 @@
-;;; -*- mode: Emacs-Lisp; coding: iso-2022-7bit; -*-
+;;; -*- mode: Emacs-Lisp; coding: utf-8; -*-
 ;;; trampver.el --- Transparent Remote Access, Multiple Protocol
 ;;; lisp/trampver.el.  Generated from trampver.el.in by configure.
 
 ;; Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 
-;; Author: Kai Gro\e,A_\e(Bjohann <kai.grossjohann@gmx.net>
+;; Author: Kai Großjohann <kai.grossjohann@gmx.net>
 ;; Keywords: comm, processes
 
 ;; This file is part of GNU Emacs.
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs; see the file COPYING.  If not, see
+;; <http://www.gnu.org/licenses/>.
 
 ;;; Code:
 
 ;; In the Tramp CVS repository, the version numer and the bug report address
 ;; are auto-frobbed from configure.ac, so you should edit that file and run
-;; "autoconf && ./configure" to change them.
+;; "autoconf && ./configure" to change them.  (X)Emacs version check is defined
+;; in macro AC_EMACS_INFO of aclocal.m4; should be changed only there.
 
-(defconst tramp-version "2.0.57-pre"
+(defconst tramp-version "2.1.11-pre"
   "This version of Tramp.")
 
 (defconst tramp-bug-report-address "tramp-devel@gnu.org"
   "Email address to send bug reports to.")
 
+;; Check for (X)Emacs version.
+(let ((x (if (or (< emacs-major-version 21)    (and (featurep 'xemacs)      (< emacs-minor-version 4)))    (format "Tramp 2.1.11-pre is not fit for %s"            (when (string-match "^.*$" (emacs-version))       (match-string 0 (emacs-version))))    "ok")))
+  (unless (string-match "\\`ok\\'" x) (error x)))
+
 (provide 'trampver)
 
 ;;; arch-tag: 443576ca-f8f1-4bb1-addc-5c70861e93b1
index 77aa760..fea2857 100644 (file)
     ("Yahoo" .
      [simple-query "www.yahoo.com" "search.yahoo.com/search?p=" ""])
     ("Yahoo: Reference" . "www.yahoo.com/Reference/")
-
     ("Wikipedia" .
      [simple-query "wikipedia.org" "wikipedia.org/wiki/" ""])
 
@@ -452,14 +451,12 @@ Please submit bug reports and other feedback to the author, Neil W. Van Dyke
 
 (defun webjump-url-encode (str)
   (mapconcat '(lambda (c)
-               (cond ((= c 32) "+")
-                     ((or (and (>= c ?a) (<= c ?z))
-                          (and (>= c ?A) (<= c ?Z))
-                          (and (>= c ?0) (<= c ?9)))
-                      (char-to-string c))
-                     (t (upcase (format "%%%02x" c)))))
-            str
-            ""))
+                (let ((s (char-to-string c)))
+                  (cond ((string= s " ") "+")
+                        ((string-match "[a-zA-Z_.-/]" s) s)
+                        (t (upcase (format "%%%02x" c))))))
+             (encode-coding-string str 'utf-8)
+             ""))
 
 (defun webjump-url-fix (url)
   (if (webjump-null-or-blank-string-p url)
index 63ceacb..71522cd 100644 (file)
@@ -97,10 +97,10 @@ Major modes should set this variable.")
 ;;;###autoload
 (defcustom comment-column 32
   "Column to indent right-margin comments to.
-Each mode establishes a different default value for this variable; you
+Each mode may establish a different default value for this variable; you
 can set the value for a particular mode using that mode's hook.
-Comments might be indented to a value smaller than this in order
-not to go beyond `comment-fill-column'."
+Comments might be indented to a different value in order not to go beyond
+`comment-fill-column' or in order to align them with surrounding comments."
   :type 'integer
   :group 'comment)
 (make-variable-buffer-local 'comment-column)
@@ -491,16 +491,24 @@ Point is assumed to be just at the end of a comment."
         (goto-char (point-min))
         (re-search-forward (concat comment-end-skip "\\'") nil t))
       (goto-char (match-beginning 0)))
-     ;; comment-end-skip not found.  Maybe we're at EOB which implicitly
-     ;; closes the comment.
-     ((eobp) (skip-syntax-backward " "))
-     (t
-      ;; else comment-end-skip was not found probably because it was not
-      ;; set right.  Since \\s> should catch the single-char case, we'll
-      ;; blindly assume we're at the end of a two-char comment-end.
+     ;; comment-end-skip not found probably because it was not set
+     ;; right.  Since \\s> should catch the single-char case, let's
+     ;; check that we're looking at a two-char comment ender.
+     ((not (or (<= (- (point-max) (line-beginning-position)) 1)
+               (zerop (logand (car (syntax-after (- (point) 1)))
+                              ;; Here we take advantage of the fact that
+                              ;; the syntax class " " is encoded to 0,
+                              ;; so "  4" gives us just the 4 bit.
+                              (car (string-to-syntax "  4"))))
+               (zerop (logand (car (syntax-after (- (point) 2)))
+                              (car (string-to-syntax "  3"))))))
       (backward-char 2)
       (skip-chars-backward (string (char-after)))
-      (skip-syntax-backward " ")))))
+      (skip-syntax-backward " "))
+     ;; No clue what's going on: maybe we're really not right after the
+     ;; end of a comment.  Maybe we're at the "end" because of EOB rather
+     ;; than because of a marker.
+     (t (skip-syntax-backward " ")))))
 
 ;;;;
 ;;;; Commands
@@ -516,6 +524,58 @@ Point is assumed to be just at the end of a comment."
              (and (> comment-add 0) (looking-at "\\s<\\(\\S<\\|\\'\\)")))
       comment-column)))
 
+(defun comment-choose-indent (&optional indent)
+  "Choose the indentation to use for a right-hand-side comment.
+The criteria are (in this order):
+- try to keep the comment's text within `comment-fill-column'.
+- try to align with surrounding comments.
+- prefer INDENT (or `comment-column' if nil).
+Point is expected to be at the start of the comment."
+  (unless indent (setq indent comment-column))
+  ;; Avoid moving comments past the fill-column.
+  (let ((max (+ (current-column)
+                (- (or comment-fill-column fill-column)
+                   (save-excursion (end-of-line) (current-column)))))
+        (other nil)
+        (min (save-excursion (skip-chars-backward " \t")
+                             (1+ (current-column)))))
+    ;; Fix up the range.
+    (if (< max min) (setq max min))
+    ;; Don't move past the fill column.
+    (if (<= max indent) (setq indent max))
+    ;; We can choose anywhere between min..max.
+    ;; Let's try to align to a comment on the previous line.
+    (save-excursion
+      (when (and (zerop (forward-line -1))
+                 (setq other (comment-search-forward
+                              (line-end-position) t)))
+        (goto-char other) (setq other (current-column))))
+    (if (and other (<= other max) (>= other min))
+        ;; There is a comment and it's in the range: bingo!
+        other
+      ;; Can't align to a previous comment: let's try to align to comments
+      ;; on the following lines, then.  These have not been re-indented yet,
+      ;; so we can't directly align ourselves with them.  All we do is to try
+      ;; and choose an indentation point with which they will be able to
+      ;; align themselves.
+      (save-excursion
+        (while (and (zerop (forward-line 1))
+                    (setq other (comment-search-forward
+                                 (line-end-position) t)))
+          (goto-char other)
+          (let ((omax (+ (current-column)
+                         (- (or comment-fill-column fill-column)
+                            (save-excursion (end-of-line) (current-column)))))
+                (omin (save-excursion (skip-chars-backward " \t")
+                                      (1+ (current-column)))))
+            (if (and (>= omax min) (<= omin max))
+                (progn (setq min (max omin min))
+                       (setq max (min omax max)))
+              ;; Can't align with this anyway, so exit the loop.
+              (goto-char (point-max))))))
+      ;; Return the closest point to indent within min..max.
+      (max min (min max indent)))))
+
 ;;;###autoload
 (defun comment-indent (&optional continue)
   "Indent this line's comment to `comment-column', or insert an empty comment.
@@ -569,38 +629,9 @@ If CONTINUE is non-nil, use the `comment-continue' markers if any."
       (if (not indent)
          ;; comment-indent-function refuses: delegate to line-indent.
          (indent-according-to-mode)
-       ;; If the comment is at the left of code, adjust the indentation.
+       ;; If the comment is at the right of code, adjust the indentation.
        (unless (save-excursion (skip-chars-backward " \t") (bolp))
-         ;; Avoid moving comments past the fill-column.
-         (let ((max (+ (current-column)
-                       (- (or comment-fill-column fill-column)
-                          (save-excursion (end-of-line) (current-column))))))
-           (if (<= max indent)
-               (setq indent max)       ;Don't move past the fill column.
-             ;; We can choose anywhere between indent..max.
-             ;; Let's try to align to a comment on the previous line.
-             (let ((other nil)
-                   (min (max indent
-                             (save-excursion (skip-chars-backward " \t")
-                                             (1+ (current-column))))))
-               (save-excursion
-                 (when (and (zerop (forward-line -1))
-                            (setq other (comment-search-forward
-                                        (line-end-position) t)))
-                   (goto-char other) (setq other (current-column))))
-               (if (and other (<= other max) (>= other min))
-                   ;; There is a comment and it's in the range: bingo.
-                   (setq indent other)
-                 ;; Let's try to align to a comment on the next line, then.
-                 (let ((other nil))
-                   (save-excursion
-                     (when (and (zerop (forward-line 1))
-                                (setq other (comment-search-forward
-                                            (line-end-position) t)))
-                       (goto-char other) (setq other (current-column))))
-                   (if (and other (<= other max) (> other min))
-                       ;; There is a comment and it's in the range: bingo.
-                       (setq indent other))))))))
+          (setq indent (comment-choose-indent indent)))
        ;; Update INDENT to leave at least one space
        ;; after other nonwhite text on the line.
        (save-excursion
index c547b47..bbb7fa6 100644 (file)
@@ -88,8 +88,9 @@ n   to cancel--don't try the command, and it remains disabled.
 SPC to try the command just this once, but leave it disabled.
 !   to try it, and enable all disabled commands for this session only.")
        (save-excursion
-       (set-buffer standard-output)
-       (help-mode)))
+        (set-buffer standard-output)
+        (help-mode)))
+     (fit-window-to-buffer (get-buffer-window "*Disabled Command*"))
      (message "Type y, n, ! or SPC (the space bar): ")
      (let ((cursor-in-echo-area t))
        (while (progn (setq char (read-event))
index 206fb7b..79b2698 100644 (file)
@@ -711,6 +711,7 @@ If PREDICATE is non-nil, it will also be used to refine the match
 If no directory information can be extracted from the completed
 component, `default-directory' is used as the basis for completion."
   (let* ((name (substitute-env-vars pcomplete-stub))
+         (completion-ignore-case pcomplete-ignore-case)
         (default-directory (expand-file-name
                             (or (file-name-directory name)
                                 default-directory)))
@@ -934,7 +935,7 @@ generate the completions list.  This means that the hook
   (if pcomplete-last-window-config
       (let* ((cbuf (get-buffer "*Completions*"))
             (cwin (and cbuf (get-buffer-window cbuf))))
-       (when (and cwin (window-live-p cwin))
+       (when (window-live-p cwin)
          (bury-buffer cbuf)
          (set-window-configuration pcomplete-last-window-config))))
   (setq pcomplete-last-window-config nil
index 6db3ed3..21cfd5b 100644 (file)
@@ -2355,7 +2355,7 @@ The exact behavior is determined also by `cvs-dired-use-hook'."
 
 (add-hook 'vc-post-command-functions 'cvs-vc-command-advice)
 
-(defun cvs-vc-command-advice (command file flags)
+(defun cvs-vc-command-advice (command files flags)
   (when (and (equal command "cvs")
             (progn
               (while (and (stringp (car flags))
@@ -2384,9 +2384,10 @@ The exact behavior is determined also by `cvs-dired-use-hook'."
              (when (and (equal (car flags) "add")
                         (goto-char (point-min))
                         (looking-at ".*to add this file permanently\n\\'"))
-               (insert "cvs add: scheduling file `"
-                       (file-name-nondirectory file)
-                       "' for addition\n"))
+                (dolist (file (if (listp files) files (list file)))
+                  (insert "cvs add: scheduling file `"
+                          (file-name-nondirectory file)
+                          "' for addition\n")))
              ;; VC never (?) does `cvs -n update' so dcd=nil
              ;; should probably always be the right choice.
              (cvs-parse-process nil subdir))))))))
index 6cccb7b..74158e7 100644 (file)
@@ -66,7 +66,8 @@
 (defvar gamegrid-score-file-length 50
   "Number of high scores to keep")
 
-(defvar gamegrid-user-score-file-directory "~/.emacs.d/games"
+(defvar gamegrid-user-score-file-directory
+  (concat user-emacs-directory "games")
   "A directory for game scores which can't be shared.
 If Emacs was built without support for shared game scores, then this
 directory will be used.")
index 412f0b3..a4b4c42 100644 (file)
@@ -6,11 +6,11 @@
 ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Keywords: wp, print, PostScript
-;; Version: 6.8.4
+;; Version: 6.9.1
 ;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre
 
-(defconst pr-version "6.8.4"
-  "printing.el, v 6.8.4 <2005/06/11 vinicius>
+(defconst pr-version "6.9.1"
+  "printing.el, v 6.9.1 <2007/08/02 vinicius>
 
 Please send all bug fixes and enhancements to
        Vinicius Jose Latorre <viniciusjl@ig.com.br>
@@ -1093,46 +1093,457 @@ If SUFFIX is non-nil, add that at the end of the file name."
          (set-default-file-modes umask)))))
 
 
-;; GNU Emacs
-(defalias 'pr-e-frame-char-height    'frame-char-height)
-(defalias 'pr-e-frame-char-width     'frame-char-width)
-(defalias 'pr-e-mouse-pixel-position 'mouse-pixel-position)
-;; XEmacs
-(defalias 'pr-x-add-submenu             'add-submenu)
-(defalias 'pr-x-event-function          'event-function)
-(defalias 'pr-x-event-object            'event-object)
-(defalias 'pr-x-find-menu-item          'find-menu-item)
-(defalias 'pr-x-font-height             'font-height)
-(defalias 'pr-x-font-width              'font-width)
-(defalias 'pr-x-get-popup-menu-response 'get-popup-menu-response)
-(defalias 'pr-x-make-event              'make-event)
-(defalias 'pr-x-misc-user-event-p       'misc-user-event-p)
-(defalias 'pr-x-relabel-menu-item       'relabel-menu-item)
-(defalias 'pr-x-event-x-pixel           'event-x-pixel)
-(defalias 'pr-x-event-y-pixel           'event-y-pixel)
+\f
+;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; XEmacs Definitions
+
 
 (cond
  ((featurep 'xemacs)                   ; XEmacs
-  (defvar current-menubar     nil)
-  (defvar current-mouse-event nil)
-  (defvar zmacs-region-stays  nil)
+  ;; XEmacs
   (defalias 'pr-f-set-keymap-parents 'set-keymap-parents)
   (defalias 'pr-f-set-keymap-name    'set-keymap-name)
+
+  ;; XEmacs
   (defun pr-f-read-string (prompt initial history default)
     (let ((str (read-string prompt initial)))
       (if (and str (not (string= str "")))
          str
        default)))
+
+  ;; XEmacs
+  (defvar zmacs-region-stays  nil)
+
+  ;; XEmacs
   (defun pr-keep-region-active ()
-    (setq zmacs-region-stays t)))
+    (setq zmacs-region-stays t))
+
+  ;; XEmacs
+  (defun pr-region-active-p ()
+    (and pr-auto-region (not zmacs-region-stays) (ps-mark-active-p)))
+
+  ;; XEmacs
+  (defun pr-menu-char-height ()
+    (font-height (face-font 'default)))
+
+  ;; XEmacs
+  (defun pr-menu-char-width ()
+    (font-width (face-font 'default)))
+
+  ;; XEmacs
+  (defmacro pr-xemacs-global-menubar (&rest body)
+    `(save-excursion
+       (let ((temp (get-buffer-create (make-temp-name " *Temp"))))
+        ;; be sure to access global menubar
+        (set-buffer temp)
+        ,@body
+        (kill-buffer temp))))
+
+  ;; XEmacs
+  (defun pr-global-menubar (pr-menu-spec)
+    ;; Menu binding
+    (pr-xemacs-global-menubar
+     (add-submenu nil (cons "Printing" pr-menu-spec) "Apps"))
+    (setq pr-menu-print-item nil))
+
+  ;; XEmacs
+  (defvar current-mouse-event nil)
+  (defun pr-menu-position (entry index horizontal)
+    (make-event
+     'button-release
+     (list 'button 1
+          'x (- (event-x-pixel current-mouse-event) ; X
+                (* horizontal pr-menu-char-width))
+          'y (- (event-y-pixel current-mouse-event) ; Y
+                (* (pr-menu-index entry index) pr-menu-char-height)))))
+
+  (defvar pr-menu-position nil)
+  (defvar pr-menu-state nil)
+
+  ;; XEmacs
+  (defvar current-menubar nil)         ; to avoid compilation gripes
+  (defun pr-menu-lookup (path)
+    (car (find-menu-item current-menubar (cons "Printing" path))))
+
+  ;; XEmacs
+  (defun pr-menu-lock (entry index horizontal state path)
+    (when pr-menu-lock
+      (or (and pr-menu-position (eq state pr-menu-state))
+         (setq pr-menu-position (pr-menu-position entry index horizontal)
+               pr-menu-state    state))
+      (let* ((menu   (pr-menu-lookup path))
+            (result (get-popup-menu-response menu pr-menu-position)))
+       (and (misc-user-event-p result)
+            (funcall (event-function result)
+                     (event-object result))))
+      (setq pr-menu-position nil)))
+
+  ;; XEmacs
+  (defalias 'pr-update-mode-line 'set-menubar-dirty-flag)
+
+  ;; XEmacs
+  (defvar pr-ps-name-old     "PostScript Printers")
+  (defvar pr-txt-name-old    "Text Printers")
+  (defvar pr-ps-utility-old  "PostScript Utility")
+  (defvar pr-even-or-odd-old "Print All Pages")
+
+  ;; XEmacs
+  (defun pr-do-update-menus (&optional force)
+    (pr-menu-alist pr-ps-printer-alist
+                  'pr-ps-name
+                  'pr-menu-set-ps-title
+                  '("Printing")
+                  'pr-ps-printer-menu-modified
+                  force
+                  pr-ps-name-old
+                  'postscript 2)
+    (pr-menu-alist pr-txt-printer-alist
+                  'pr-txt-name
+                  'pr-menu-set-txt-title
+                  '("Printing")
+                  'pr-txt-printer-menu-modified
+                  force
+                  pr-txt-name-old
+                  'text 2)
+    (let ((save-var pr-ps-utility-menu-modified))
+      (pr-menu-alist pr-ps-utility-alist
+                    'pr-ps-utility
+                    'pr-menu-set-utility-title
+                    '("Printing" "PostScript Print" "File")
+                    'save-var
+                    force
+                    pr-ps-utility-old
+                    nil 1))
+    (pr-menu-alist pr-ps-utility-alist
+                  'pr-ps-utility
+                  'pr-menu-set-utility-title
+                  '("Printing" "PostScript Preview" "File")
+                  'pr-ps-utility-menu-modified
+                  force
+                  pr-ps-utility-old
+                  nil 1)
+    (pr-even-or-odd-pages ps-even-or-odd-pages force))
+
+  ;; XEmacs
+  (defun pr-menu-alist (alist var-sym fun menu-path modified-sym force name
+                             entry index)
+    (when (and alist (or force (symbol-value modified-sym)))
+      (pr-xemacs-global-menubar
+       (add-submenu menu-path
+                   (pr-menu-create name alist var-sym
+                                   fun entry index)))
+      (funcall fun (symbol-value var-sym))
+      (set modified-sym nil)))
+
+  ;; XEmacs
+  (defun pr-relabel-menu-item (newname var-sym)
+    (pr-xemacs-global-menubar
+     (relabel-menu-item
+      (list "Printing" (symbol-value var-sym))
+      newname)
+     (set var-sym newname)))
+
+  ;; XEmacs
+  (defun pr-menu-set-ps-title (value &optional item entry index)
+    (pr-relabel-menu-item (format "PostScript Printer: %s" value)
+                         'pr-ps-name-old)
+    (pr-ps-set-printer value)
+    (and index
+        (pr-menu-lock entry index 12 'toggle nil)))
+
+  ;; XEmacs
+  (defun pr-menu-set-txt-title (value &optional item entry index)
+    (pr-relabel-menu-item (format "Text Printer: %s" value)
+                         'pr-txt-name-old)
+    (pr-txt-set-printer value)
+    (and index
+        (pr-menu-lock entry index 12 'toggle nil)))
+
+  ;; XEmacs
+  (defun pr-menu-set-utility-title (value &optional item entry index)
+    (pr-xemacs-global-menubar
+     (let ((newname (format "%s" value)))
+       (relabel-menu-item
+       (list "Printing" "PostScript Print" "File" pr-ps-utility-old)
+       newname)
+       (relabel-menu-item
+       (list "Printing" "PostScript Preview" "File" pr-ps-utility-old)
+       newname)
+       (setq pr-ps-utility-old newname)))
+    (pr-ps-set-utility value)
+    (and index
+        (pr-menu-lock entry index 5 nil '("PostScript Print" "File"))))
+
+  ;; XEmacs
+  (defun pr-even-or-odd-pages (value &optional no-lock)
+    (pr-relabel-menu-item (cdr (assq value pr-even-or-odd-alist))
+                         'pr-even-or-odd-old)
+    (setq ps-even-or-odd-pages value)
+    (or no-lock
+       (pr-menu-lock 'postscript-options 8 12 'toggle nil)))
 
+  )
  (t                                    ; GNU Emacs
-  (defvar deactivate-mark nil)
+  ;; Do nothing
+  ))                                   ; end cond featurep
+
+
+\f
+;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; GNU Emacs Definitions
+
+
+(cond
+ ((featurep 'xemacs)                   ; XEmacs
+  ;; Do nothing
+  )
+ (t                                    ; GNU Emacs
+  ;; GNU Emacs
   (defalias 'pr-f-set-keymap-parents 'set-keymap-parent)
   (defalias 'pr-f-set-keymap-name    'ignore)
   (defalias 'pr-f-read-string        'read-string)
+
+  ;; GNU Emacs
+  (defvar deactivate-mark)
+
+  ;; GNU Emacs
   (defun pr-keep-region-active ()
-    (setq deactivate-mark nil))))
+    (setq deactivate-mark nil))
+
+  ;; GNU Emacs
+  (defun pr-region-active-p ()
+    (and pr-auto-region transient-mark-mode mark-active))
+
+  ;; GNU Emacs
+  (defun pr-menu-char-height ()
+    (frame-char-height))
+
+  ;; GNU Emacs
+  (defun pr-menu-char-width ()
+    (frame-char-width))
+
+  ;; GNU Emacs
+  ;; Menu binding
+  ;; Replace existing "print" item by "Printing" item.
+  ;; If you're changing this file, you'll load it a second,
+  ;; third... time, but "print" item exists only in the first load.
+  (eval-and-compile
+    (cond
+     ;; GNU Emacs 20
+     ((< emacs-major-version 21)
+      (defun pr-global-menubar (pr-menu-spec)
+       (require 'easymenu)
+       (easy-menu-change '("tools") "Printing" pr-menu-spec pr-menu-print-item)
+       (when pr-menu-print-item
+         (easy-menu-remove-item nil '("tools") pr-menu-print-item)
+         (setq pr-menu-print-item nil
+               pr-menu-bar (vector 'menu-bar 'tools
+                                   (pr-get-symbol "Printing")))))
+      )
+     ;; GNU Emacs 21 & 22
+     (t
+      (defun pr-global-menubar (pr-menu-spec)
+       (require 'easymenu)
+       (let ((menu-file (if (= emacs-major-version 21)
+                            '("menu-bar" "files") ; GNU Emacs 21
+                          '("menu-bar" "file")))) ; GNU Emacs 22 or higher
+         (cond
+          (pr-menu-print-item
+           (easy-menu-add-item global-map menu-file
+                               (easy-menu-create-menu "Print" pr-menu-spec)
+                               "print-buffer")
+           (dolist (item '("print-buffer"          "print-region"
+                           "ps-print-buffer-faces" "ps-print-region-faces"
+                           "ps-print-buffer"       "ps-print-region"))
+             (easy-menu-remove-item global-map menu-file item))
+           (setq pr-menu-print-item nil
+                 pr-menu-bar (vector 'menu-bar
+                                     (pr-get-symbol (nth 1 menu-file))
+                                     (pr-get-symbol "Print"))))
+          (t
+           (easy-menu-add-item global-map menu-file
+                               (easy-menu-create-menu "Print" pr-menu-spec)))
+          )))
+      )))
+
+  (eval-and-compile
+    (cond
+     (ps-windows-system
+      ;; GNU Emacs for Windows 9x/NT
+      (defun pr-menu-position (entry index horizontal)
+       (let ((pos (cdr (mouse-pixel-position))))
+         (list
+          (list (or (car pos) 0)       ; X
+                (- (or (cdr pos) 0)    ; Y
+                   (* (pr-menu-index entry index) pr-menu-char-height)))
+          (selected-frame))))          ; frame
+      )
+     (t
+      ;; GNU Emacs
+      (defun pr-menu-position (entry index horizontal)
+       (let ((pos (cdr (mouse-pixel-position))))
+         (list
+          (list (- (or (car pos) 0)    ; X
+                   (* horizontal pr-menu-char-width))
+                (- (or (cdr pos) 0)    ; Y
+                   (* (pr-menu-index entry index) pr-menu-char-height)))
+          (selected-frame))))          ; frame
+      )))
+
+  (defvar pr-menu-position nil)
+  (defvar pr-menu-state nil)
+
+  ;; GNU Emacs
+  (defun pr-menu-lookup (path)
+    (lookup-key global-map
+               (if path
+                   (vconcat pr-menu-bar
+                            (mapcar 'pr-get-symbol
+                                    (if (listp path)
+                                        path
+                                      (list path))))
+                 pr-menu-bar)))
+
+  ;; GNU Emacs
+  (defun pr-menu-lock (entry index horizontal state path)
+    (when pr-menu-lock
+      (or (and pr-menu-position (eq state pr-menu-state))
+         (setq pr-menu-position (pr-menu-position entry index horizontal)
+               pr-menu-state    state))
+      (let* ((menu   (pr-menu-lookup path))
+            (result (x-popup-menu pr-menu-position menu)))
+       (and result
+            (let ((command (lookup-key menu (vconcat result))))
+              (if (fboundp command)
+                  (funcall command)
+                (eval command)))))
+      (setq pr-menu-position nil)))
+
+  ;; GNU Emacs
+  (defalias 'pr-update-mode-line 'force-mode-line-update)
+
+  ;; GNU Emacs
+  (defun pr-do-update-menus (&optional force)
+    (pr-menu-alist pr-ps-printer-alist
+                  'pr-ps-name
+                  'pr-menu-set-ps-title
+                  "PostScript Printers"
+                  'pr-ps-printer-menu-modified
+                  force
+                  "PostScript Printers"
+                  'postscript 2)
+    (pr-menu-alist pr-txt-printer-alist
+                  'pr-txt-name
+                  'pr-menu-set-txt-title
+                  "Text Printers"
+                  'pr-txt-printer-menu-modified
+                  force
+                  "Text Printers"
+                  'text 2)
+    (let ((save-var pr-ps-utility-menu-modified))
+      (pr-menu-alist pr-ps-utility-alist
+                    'pr-ps-utility
+                    'pr-menu-set-utility-title
+                    '("PostScript Print" "File" "PostScript Utility")
+                    'save-var
+                    force
+                    "PostScript Utility"
+                    nil 1))
+    (pr-menu-alist pr-ps-utility-alist
+                  'pr-ps-utility
+                  'pr-menu-set-utility-title
+                  '("PostScript Preview" "File" "PostScript Utility")
+                  'pr-ps-utility-menu-modified
+                  force
+                  "PostScript Utility"
+                  nil 1)
+    (pr-even-or-odd-pages ps-even-or-odd-pages force))
+
+  ;; GNU Emacs
+  (defun pr-menu-get-item (name-list)
+    ;; NAME-LIST is a string or a list of strings.
+    (or (listp name-list)
+       (setq name-list (list name-list)))
+    (and name-list
+        (let* ((reversed (reverse name-list))
+               (name (pr-get-symbol (car reversed)))
+               (path (nreverse (cdr reversed)))
+               (menu (lookup-key
+                      global-map
+                      (vconcat pr-menu-bar
+                               (mapcar 'pr-get-symbol path)))))
+          (assq name (nthcdr 2 menu)))))
+
+  ;; GNU Emacs
+  (defvar pr-temp-menu nil)
+
+  ;; GNU Emacs
+  (defun pr-menu-alist (alist var-sym fun menu-path modified-sym force name
+                             entry index)
+    (when (and alist (or force (symbol-value modified-sym)))
+      (easy-menu-define pr-temp-menu nil ""
+       (pr-menu-create name alist var-sym fun entry index))
+      (let ((item (pr-menu-get-item menu-path)))
+       (and item
+            (let* ((binding     (nthcdr 3 item))
+                   (key-binding (cdr binding)))
+              (setcar binding pr-temp-menu)
+              (and key-binding (listp (car key-binding))
+                   (setcdr binding (cdr key-binding))) ; skip KEY-BINDING
+              (funcall fun (symbol-value var-sym) item))))
+      (set modified-sym nil)))
+
+  ;; GNU Emacs
+  (defun pr-menu-set-item-name (item name)
+    (and item
+        (setcar (nthcdr 2 item) name))) ; ITEM-NAME
+
+  ;; GNU Emacs
+  (defun pr-menu-set-ps-title (value &optional item entry index)
+    (pr-menu-set-item-name (or item
+                              (pr-menu-get-item "PostScript Printers"))
+                          (format "PostScript Printer: %s" value))
+    (pr-ps-set-printer value)
+    (and index
+        (pr-menu-lock entry index 12 'toggle nil)))
+
+  ;; GNU Emacs
+  (defun pr-menu-set-txt-title (value &optional item entry index)
+    (pr-menu-set-item-name (or item
+                              (pr-menu-get-item "Text Printers"))
+                          (format "Text Printer: %s" value))
+    (pr-txt-set-printer value)
+    (and index
+        (pr-menu-lock entry index 12 'toggle nil)))
+
+  ;; GNU Emacs
+  (defun pr-menu-set-utility-title (value &optional item entry index)
+    (let ((name (symbol-name value)))
+      (if item
+         (pr-menu-set-item-name item name)
+       (pr-menu-set-item-name
+        (pr-menu-get-item
+         '("PostScript Print"   "File" "PostScript Utility"))
+        name)
+       (pr-menu-set-item-name
+        (pr-menu-get-item
+         '("PostScript Preview" "File" "PostScript Utility"))
+        name)))
+    (pr-ps-set-utility value)
+    (and index
+        (pr-menu-lock entry index 5 nil '("PostScript Print" "File"))))
+
+  ;; GNU Emacs
+  (defun pr-even-or-odd-pages (value &optional no-lock)
+    (pr-menu-set-item-name (pr-menu-get-item "Print All Pages")
+                          (cdr (assq value pr-even-or-odd-alist)))
+    (setq ps-even-or-odd-pages value)
+    (or no-lock
+       (pr-menu-lock 'postscript-options 8 12 'toggle nil)))
+
+  ))                                   ; end cond featurep
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -1592,7 +2003,7 @@ DEFAULT           It's a way to set default values when this entry is selected.
 
                   (VARIABLE . VALUE)
 
-               That associates VARIABLE with VALUE.  when this entry is
+               Which associates VARIABLE with VALUE.  When this entry is
                selected, it's executed the following command:
 
                   (set VARIABLE (eval VALUE))
@@ -2147,7 +2558,7 @@ DEFAULT           It's a way to set default values when this entry is selected.
 
                   (VARIABLE-SYM . VALUE)
 
-               That associates VARIABLE-SYM with VALUE.  when this entry is
+               Which associates VARIABLE-SYM with VALUE.  When this entry is
                selected, it's executed the following command:
 
                   (set (make-local-variable VARIABLE-SYM) (eval VALUE))
@@ -2327,7 +2738,7 @@ DEFAULT           It's a way to set default values when this entry is selected.
 
                   (VARIABLE . VALUE)
 
-               That associates VARIABLE with VALUE.  when this entry is
+               Which associates VARIABLE with VALUE.  When this entry is
                selected, it's executed the following command:
 
                   (set VARIABLE (eval VALUE))
@@ -2452,11 +2863,7 @@ See also `pr-menu-char-height' and `pr-menu-char-width'."
   :group 'printing)
 
 
-(defcustom pr-menu-char-height
-  (cond ((featurep 'xemacs)            ; XEmacs
-        (pr-x-font-height (face-font 'default)))
-       (t                              ; GNU Emacs
-        (pr-e-frame-char-height)))
+(defcustom pr-menu-char-height (pr-menu-char-height)
   "*Specify menu char height in pixels.
 
 This variable is used to guess which vertical position should be locked the
@@ -2468,11 +2875,7 @@ See also `pr-menu-lock' and `pr-menu-char-width'."
   :group 'printing)
 
 
-(defcustom pr-menu-char-width
-  (cond ((featurep 'xemacs)            ; XEmacs
-        (pr-x-font-width (face-font 'default)))
-       (t                              ; GNU Emacs
-        (pr-e-frame-char-width)))
+(defcustom pr-menu-char-width (pr-menu-char-width)
   "*Specify menu char width in pixels.
 
 This variable is used to guess which horizontal position should be locked the
@@ -2544,7 +2947,7 @@ SETTING           It's a cons like:
 
                   (VARIABLE . VALUE)
 
-               That associates VARIABLE with VALUE.  when this entry is
+               Which associates VARIABLE with VALUE.  When this entry is
                selected, it's executed the following command:
 
                  * If LOCAL is non-nil:
@@ -2772,15 +3175,6 @@ See `pr-ps-printer-alist'.")
 ;; Keys & Menus
 
 
-(defmacro pr-xemacs-global-menubar (&rest body)
-  `(save-excursion
-     (let ((temp (get-buffer-create (make-temp-name " *Temp"))))
-       ;; be sure to access global menubar
-       (set-buffer temp)
-       ,@body
-       (kill-buffer temp))))
-
-
 (defsubst pr-visible-p (key)
   (memq key pr-visible-entry-list))
 
@@ -2802,16 +3196,6 @@ See `pr-ps-printer-alist'.")
       'easy-menu-intern
     (lambda (s) (if (stringp s) (intern s) s))))
 
-(cond
- ((featurep 'xemacs)                   ; XEmacs
-  (defvar zmacs-region-stays nil)      ; to avoid compilation gripes
-  (defun pr-region-active-p ()
-    (and pr-auto-region (not zmacs-region-stays) (ps-mark-active-p))))
-
- (t                                    ; GNU Emacs
-  (defun pr-region-active-p ()
-    (and pr-auto-region transient-mark-mode mark-active))))
-
 
 (defconst pr-menu-spec
   ;; Menu mapping:
@@ -3070,51 +3454,7 @@ menu.
 
 Calls `pr-update-menus' to adjust menus."
   (interactive)
-  (cond
-   ((featurep 'xemacs)                 ; XEmacs
-    ;; Menu binding
-    (pr-xemacs-global-menubar
-     (pr-x-add-submenu nil (cons "Printing" pr-menu-spec) "Apps"))
-    (setq pr-menu-print-item nil))
-
-
-   (t                                  ; GNU Emacs
-    ;; Menu binding
-    (require 'easymenu)
-    ;; Replace existing "print" item by "Printing" item.
-    ;; If you're changing this file, you'll load it a second,
-    ;; third... time, but "print" item exists only in the first load.
-    (cond
-     ;; Emacs 20
-     ((< emacs-major-version 21)
-      (easy-menu-change '("tools") "Printing" pr-menu-spec pr-menu-print-item)
-      (when pr-menu-print-item
-       (easy-menu-remove-item nil '("tools") pr-menu-print-item)
-       (setq pr-menu-print-item nil
-             pr-menu-bar (vector 'menu-bar 'tools
-                                 (pr-get-symbol "Printing")))))
-     ;; Emacs 21 & 22
-     (t
-      (let ((menu-file (if (= emacs-major-version 21)
-                          '("menu-bar" "files") ; Emacs 21
-                        '("menu-bar" "file")))) ; Emacs 22 or higher
-       (cond
-        (pr-menu-print-item
-         (easy-menu-add-item global-map menu-file
-                             (easy-menu-create-menu "Print" pr-menu-spec)
-                             "print-buffer")
-         (dolist (item '("print-buffer"          "print-region"
-                         "ps-print-buffer-faces" "ps-print-region-faces"
-                         "ps-print-buffer"       "ps-print-region"))
-           (easy-menu-remove-item global-map menu-file item))
-         (setq pr-menu-print-item nil
-               pr-menu-bar (vector 'menu-bar
-                                   (pr-get-symbol (nth 1 menu-file))
-                                   (pr-get-symbol "Print"))))
-        (t
-         (easy-menu-add-item global-map menu-file
-                             (easy-menu-create-menu "Print" pr-menu-spec)))
-        ))))))
+  (pr-global-menubar pr-menu-spec)
   (pr-update-menus t))
 
 
@@ -4815,118 +5155,30 @@ Each element has the form:
 
    (MENU-PART . NUMBER-OF-ITEMS)
 
-See `pr-visible-entry-alist'.")
-
-
-(defun pr-menu-index (entry index)
-  (let ((base-list
-        (cond ((eq entry 'text)
-               '(postscript))
-              ((eq entry 'postscript-options)
-               '(postscript text))
-              ((eq entry 'postscript-process)
-               '(postscript text postscript-options))
-              ((eq entry 'printing)
-               '(postscript text postscript-options postscript-process))
-              (t
-               nil)
-              ))
-       key)
-    (while base-list
-      (setq key       (car base-list)
-           base-list (cdr base-list))
-      (and (pr-visible-p key)
-          (setq index (+ index
-                         (cdr (assq key pr-menu-entry-alist)))))))
-  (+ index 2))
-
-
-(defvar pr-menu-position nil)
-(defvar pr-menu-state nil)
-
-
-(cond
- ((featurep 'xemacs)
-  ;; XEmacs
-  (defvar current-mouse-event nil)     ; to avoid compilation gripes
-  (defun pr-menu-position (entry index horizontal)
-    (pr-x-make-event
-     'button-release
-     (list 'button 1
-          'x (- (pr-x-event-x-pixel current-mouse-event) ; X
-                (* horizontal pr-menu-char-width))
-          'y (- (pr-x-event-y-pixel current-mouse-event) ; Y
-                (* (pr-menu-index entry index) pr-menu-char-height)))))
-  )
- (ps-windows-system
-  ;; GNU Emacs for Windows 9x/NT
-  (defun pr-menu-position (entry index horizontal)
-    (let ((pos (cdr (pr-e-mouse-pixel-position))))
-      (list
-       (list (or (car pos) 0)          ; X
-            (- (or (cdr pos) 0)        ; Y
-               (* (pr-menu-index entry index) pr-menu-char-height)))
-       (selected-frame))))             ; frame
-  )
- (t
-  ;; GNU Emacs
-  (defun pr-menu-position (entry index horizontal)
-    (let ((pos (cdr (pr-e-mouse-pixel-position))))
-      (list
-       (list (- (or (car pos) 0)       ; X
-               (* horizontal pr-menu-char-width))
-            (- (or (cdr pos) 0)        ; Y
-               (* (pr-menu-index entry index) pr-menu-char-height)))
-       (selected-frame))))             ; frame
-  ))
-
-(cond
- ((featurep 'xemacs)
-  ;; XEmacs
-  (defvar current-menubar nil)         ; to avoid compilation gripes
-  (defun pr-menu-lookup (path)
-    (car (pr-x-find-menu-item current-menubar (cons "Printing" path))))
-
-  ;; XEmacs
-  (defun pr-menu-lock (entry index horizontal state path)
-    (when pr-menu-lock
-      (or (and pr-menu-position (eq state pr-menu-state))
-         (setq pr-menu-position (pr-menu-position entry index horizontal)
-               pr-menu-state    state))
-      (let* ((menu   (pr-menu-lookup path))
-            (result (pr-x-get-popup-menu-response menu pr-menu-position)))
-       (and (pr-x-misc-user-event-p result)
-            (funcall (pr-x-event-function result)
-                     (pr-x-event-object result))))
-      (setq pr-menu-position nil))))
-
-
- (t
-  ;; GNU Emacs
-  (defun pr-menu-lookup (path)
-    (lookup-key global-map
-               (if path
-                   (vconcat pr-menu-bar
-                            (mapcar 'pr-get-symbol
-                                    (if (listp path)
-                                        path
-                                      (list path))))
-                 pr-menu-bar)))
-
-  ;; GNU Emacs
-  (defun pr-menu-lock (entry index horizontal state path)
-    (when pr-menu-lock
-      (or (and pr-menu-position (eq state pr-menu-state))
-         (setq pr-menu-position (pr-menu-position entry index horizontal)
-               pr-menu-state    state))
-      (let* ((menu   (pr-menu-lookup path))
-            (result (x-popup-menu pr-menu-position menu)))
-       (and result
-            (let ((command (lookup-key menu (vconcat result))))
-              (if (fboundp command)
-                  (funcall command)
-                (eval command)))))
-      (setq pr-menu-position nil)))))
+See `pr-visible-entry-alist'.")
+
+
+(defun pr-menu-index (entry index)
+  (let ((base-list
+        (cond ((eq entry 'text)
+               '(postscript))
+              ((eq entry 'postscript-options)
+               '(postscript text))
+              ((eq entry 'postscript-process)
+               '(postscript text postscript-options))
+              ((eq entry 'printing)
+               '(postscript text postscript-options postscript-process))
+              (t
+               nil)
+              ))
+       key)
+    (while base-list
+      (setq key       (car base-list)
+           base-list (cdr base-list))
+      (and (pr-visible-p key)
+          (setq index (+ index
+                         (cdr (assq key pr-menu-entry-alist)))))))
+  (+ index 2))
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -4991,237 +5243,6 @@ If menu binding was not done, calls `pr-menu-bind'."
         alist)))
 
 
-(cond
- ((featurep 'xemacs)
-  ;; XEmacs
-  (defalias 'pr-update-mode-line 'set-menubar-dirty-flag)
-
-  ;; XEmacs
-  (defvar pr-ps-name-old     "PostScript Printers")
-  (defvar pr-txt-name-old    "Text Printers")
-  (defvar pr-ps-utility-old  "PostScript Utility")
-  (defvar pr-even-or-odd-old "Print All Pages")
-
-  ;; XEmacs
-  (defun pr-do-update-menus (&optional force)
-    (pr-menu-alist pr-ps-printer-alist
-                  'pr-ps-name
-                  'pr-menu-set-ps-title
-                  '("Printing")
-                  'pr-ps-printer-menu-modified
-                  force
-                  pr-ps-name-old
-                  'postscript 2)
-    (pr-menu-alist pr-txt-printer-alist
-                  'pr-txt-name
-                  'pr-menu-set-txt-title
-                  '("Printing")
-                  'pr-txt-printer-menu-modified
-                  force
-                  pr-txt-name-old
-                  'text 2)
-    (let ((save-var pr-ps-utility-menu-modified))
-      (pr-menu-alist pr-ps-utility-alist
-                    'pr-ps-utility
-                    'pr-menu-set-utility-title
-                    '("Printing" "PostScript Print"   "File")
-                    'save-var
-                    force
-                    pr-ps-utility-old
-                    nil 1))
-    (pr-menu-alist pr-ps-utility-alist
-                  'pr-ps-utility
-                  'pr-menu-set-utility-title
-                  '("Printing" "PostScript Preview" "File")
-                  'pr-ps-utility-menu-modified
-                  force
-                  pr-ps-utility-old
-                  nil 1)
-    (pr-even-or-odd-pages ps-even-or-odd-pages force))
-
-  ;; XEmacs
-  (defun pr-menu-alist (alist var-sym fun menu-path modified-sym force name
-                             entry index)
-    (when (and alist (or force (symbol-value modified-sym)))
-      (pr-xemacs-global-menubar
-       (pr-x-add-submenu menu-path
-                        (pr-menu-create name alist var-sym
-                                        fun entry index)))
-      (funcall fun (symbol-value var-sym))
-      (set modified-sym nil)))
-
-  ;; XEmacs
-  (defun pr-relabel-menu-item (newname var-sym)
-    (pr-xemacs-global-menubar
-     (pr-x-relabel-menu-item
-      (list "Printing" (symbol-value var-sym))
-      newname)
-     (set var-sym newname)))
-
-  ;; XEmacs
-  (defun pr-menu-set-ps-title (value &optional item entry index)
-    (pr-relabel-menu-item (format "PostScript Printer: %s" value)
-                         'pr-ps-name-old)
-    (pr-ps-set-printer value)
-    (and index
-        (pr-menu-lock entry index 12 'toggle nil)))
-
-  ;; XEmacs
-  (defun pr-menu-set-txt-title (value &optional item entry index)
-    (pr-relabel-menu-item (format "Text Printer: %s" value)
-                         'pr-txt-name-old)
-    (pr-txt-set-printer value)
-    (and index
-        (pr-menu-lock entry index 12 'toggle nil)))
-
-  ;; XEmacs
-  (defun pr-menu-set-utility-title (value &optional item entry index)
-    (pr-xemacs-global-menubar
-     (let ((newname (format "%s" value)))
-       (pr-x-relabel-menu-item
-       (list "Printing" "PostScript Print" "File" pr-ps-utility-old)
-       newname)
-       (pr-x-relabel-menu-item
-       (list "Printing" "PostScript Preview" "File" pr-ps-utility-old)
-       newname)
-       (setq pr-ps-utility-old newname)))
-    (pr-ps-set-utility value)
-    (and index
-        (pr-menu-lock entry index 5 nil '("PostScript Print" "File"))))
-
-  ;; XEmacs
-  (defun pr-even-or-odd-pages (value &optional no-lock)
-    (pr-relabel-menu-item (cdr (assq value pr-even-or-odd-alist))
-                         'pr-even-or-odd-old)
-    (setq ps-even-or-odd-pages value)
-    (or no-lock
-       (pr-menu-lock 'postscript-options 8 12 'toggle nil))))
-
-
- (t
-  ;; GNU Emacs
-  (defalias 'pr-update-mode-line 'force-mode-line-update)
-
-  ;; GNU Emacs
-  (defun pr-do-update-menus (&optional force)
-    (pr-menu-alist pr-ps-printer-alist
-                  'pr-ps-name
-                  'pr-menu-set-ps-title
-                  "PostScript Printers"
-                  'pr-ps-printer-menu-modified
-                  force
-                  "PostScript Printers"
-                  'postscript 2)
-    (pr-menu-alist pr-txt-printer-alist
-                  'pr-txt-name
-                  'pr-menu-set-txt-title
-                  "Text Printers"
-                  'pr-txt-printer-menu-modified
-                  force
-                  "Text Printers"
-                  'text 2)
-    (let ((save-var pr-ps-utility-menu-modified))
-      (pr-menu-alist pr-ps-utility-alist
-                    'pr-ps-utility
-                    'pr-menu-set-utility-title
-                    '("PostScript Print"   "File" "PostScript Utility")
-                    'save-var
-                    force
-                    "PostScript Utility"
-                    nil 1))
-    (pr-menu-alist pr-ps-utility-alist
-                  'pr-ps-utility
-                  'pr-menu-set-utility-title
-                  '("PostScript Preview" "File" "PostScript Utility")
-                  'pr-ps-utility-menu-modified
-                  force
-                  "PostScript Utility"
-                  nil 1)
-    (pr-even-or-odd-pages ps-even-or-odd-pages force))
-
-  ;; GNU Emacs
-  (defun pr-menu-get-item (name-list)
-    ;; NAME-LIST is a string or a list of strings.
-    (or (listp name-list)
-       (setq name-list (list name-list)))
-    (and name-list
-        (let* ((reversed (reverse name-list))
-               (name (pr-get-symbol (car reversed)))
-               (path (nreverse (cdr reversed)))
-               (menu (lookup-key
-                      global-map
-                      (vconcat pr-menu-bar
-                               (mapcar 'pr-get-symbol path)))))
-          (assq name (nthcdr 2 menu)))))
-
-  ;; GNU Emacs
-  (defvar pr-temp-menu nil)
-
-  ;; GNU Emacs
-  (defun pr-menu-alist (alist var-sym fun menu-path modified-sym force name
-                             entry index)
-    (when (and alist (or force (symbol-value modified-sym)))
-      (easy-menu-define pr-temp-menu nil ""
-       (pr-menu-create name alist var-sym fun entry index))
-      (let ((item (pr-menu-get-item menu-path)))
-       (and item
-            (let* ((binding     (nthcdr 3 item))
-                   (key-binding (cdr binding)))
-              (setcar binding pr-temp-menu)
-              (and key-binding (listp (car key-binding))
-                   (setcdr binding (cdr key-binding))) ; skip KEY-BINDING
-              (funcall fun (symbol-value var-sym) item))))
-      (set modified-sym nil)))
-
-  ;; GNU Emacs
-  (defun pr-menu-set-item-name (item name)
-    (and item
-        (setcar (nthcdr 2 item) name))) ; ITEM-NAME
-
-  ;; GNU Emacs
-  (defun pr-menu-set-ps-title (value &optional item entry index)
-    (pr-menu-set-item-name (or item
-                              (pr-menu-get-item "PostScript Printers"))
-                          (format "PostScript Printer: %s" value))
-    (pr-ps-set-printer value)
-    (and index
-        (pr-menu-lock entry index 12 'toggle nil)))
-
-  ;; GNU Emacs
-  (defun pr-menu-set-txt-title (value &optional item entry index)
-    (pr-menu-set-item-name (or item
-                              (pr-menu-get-item "Text Printers"))
-                          (format "Text Printer: %s" value))
-    (pr-txt-set-printer value)
-    (and index
-        (pr-menu-lock entry index 12 'toggle nil)))
-
-  ;; GNU Emacs
-  (defun pr-menu-set-utility-title (value &optional item entry index)
-    (let ((name (symbol-name value)))
-      (if item
-         (pr-menu-set-item-name item name)
-       (pr-menu-set-item-name
-        (pr-menu-get-item
-         '("PostScript Print"   "File" "PostScript Utility"))
-        name)
-       (pr-menu-set-item-name
-        (pr-menu-get-item
-         '("PostScript Preview" "File" "PostScript Utility"))
-        name)))
-    (pr-ps-set-utility value)
-    (and index
-        (pr-menu-lock entry index 5 nil '("PostScript Print" "File"))))
-
-  ;; GNU Emacs
-  (defun pr-even-or-odd-pages (value &optional no-lock)
-    (pr-menu-set-item-name (pr-menu-get-item "Print All Pages")
-                          (cdr (assq value pr-even-or-odd-alist)))
-    (setq ps-even-or-odd-pages value)
-    (or no-lock
-       (pr-menu-lock 'postscript-options 8 12 'toggle nil)))))
-
-
 (defun pr-ps-set-utility (value)
   (let ((item (cdr (assq value pr-ps-utility-alist))))
     (or item
@@ -5997,9 +6018,10 @@ COMMAND.exe, COMMAND.bat and COMMAND.com in this order."
 ;; Printing Interface (inspired on ps-print-interface.el)
 
 
-(require 'widget)
-(require 'wid-edit)
-(require 'cus-edit)
+(eval-when-compile
+  (require 'cus-edit)
+  (require 'wid-edit)
+  (require 'widget))
 
 
 (defvar pr-i-window-configuration nil)
index fcb20ed..805ed3c 100644 (file)
 ;; LINE will be nil for a message that doesn't contain them.  Then the
 ;; location refers to a indented beginning of line or beginning of file.
 ;; Once any location in some file has been jumped to, the list is extended to
-;; (COLUMN LINE FILE-STRUCTURE MARKER . VISITED) for all LOCs pertaining to
-;; that file.
+;; (COLUMN LINE FILE-STRUCTURE MARKER TIMESTAMP . VISITED)
+;; for all LOCs pertaining to that file.
 ;; MARKER initially points to LINE and COLUMN in a buffer visiting that file.
 ;; Being a marker it sticks to some text, when the buffer grows or shrinks
 ;; before that point.  VISITED is t if we have jumped there, else nil.
+;; TIMESTAMP is necessary because of "incremental compilation": `omake -P'
+;; polls filesystem for changes and recompiles when a file is modified
+;; using the same *compilation* buffer. this necessitates re-parsing markers.
 
 ;;   FILE-STRUCTURE is a list of
 ;;   ((FILENAME . DIRECTORY) FORMATS (LINE LOC ...) ...)
 
 ;;;###autoload
 (defcustom compilation-mode-hook nil
-  "*List of hook functions run by `compilation-mode' (see `run-mode-hooks')."
+  "List of hook functions run by `compilation-mode' (see `run-mode-hooks')."
   :type 'hook
   :group 'compilation)
 
 ;;;###autoload
 (defcustom compilation-window-height nil
-  "*Number of lines in a compilation window.  If nil, use Emacs default."
+  "Number of lines in a compilation window.  If nil, use Emacs default."
   :type '(choice (const :tag "Default" nil)
                 integer)
   :group 'compilation)
@@ -164,6 +167,10 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
      "^[ \t]*\\[[^] \n]+\\][ \t]*\\([^: \n]+\\):\\([0-9]+\\):\\(?:\\([0-9]+\\):[0-9]+:[0-9]+:\\)?\
 \\( warning\\)?" 1 2 3 (4))
 
+    (maven
+     ;; Maven is a popular build tool for Java.  Maven is Free Software.
+     "\\(.*?\\):\\[\\([0-9]+\\),\\([0-9]+\\)\\]" 1 2 3)
+
     (bash
      "^\\([^: \n\t]+\\): line \\([0-9]+\\):" 1 2)
 
@@ -439,7 +446,7 @@ Highlight entire line if t; don't highlight source lines if nil.")
   "Overlay used to temporarily highlight compilation matches.")
 
 (defcustom compilation-error-screen-columns t
-  "*If non-nil, column numbers in error messages are screen columns.
+  "If non-nil, column numbers in error messages are screen columns.
 Otherwise they are interpreted as character positions, with
 each character occupying one column.
 The default is to use screen columns, which requires that the compilation
@@ -450,21 +457,21 @@ especially the TAB character."
   :version "20.4")
 
 (defcustom compilation-read-command t
-  "*Non-nil means \\[compile] reads the compilation command to use.
+  "Non-nil means \\[compile] reads the compilation command to use.
 Otherwise, \\[compile] just uses the value of `compile-command'."
   :type 'boolean
   :group 'compilation)
 
 ;;;###autoload
 (defcustom compilation-ask-about-save t
-  "*Non-nil means \\[compile] asks which buffers to save before compiling.
+  "Non-nil means \\[compile] asks which buffers to save before compiling.
 Otherwise, it saves all modified buffers without asking."
   :type 'boolean
   :group 'compilation)
 
 ;;;###autoload
 (defcustom compilation-search-path '(nil)
-  "*List of directories to search for source files named in error messages.
+  "List of directories to search for source files named in error messages.
 Elements should be directory names, not file names of directories.
 The value nil as an element means to try the default directory."
   :type '(repeat (choice (const :tag "Default" nil)
@@ -473,7 +480,7 @@ The value nil as an element means to try the default directory."
 
 ;;;###autoload
 (defcustom compile-command "make -k "
-  "*Last shell command used to do a compilation; default for next compilation.
+  "Last shell command used to do a compilation; default for next compilation.
 
 Sometimes it is useful for files to supply local values for this variable.
 You might also use mode hooks to specify it in certain modes, like this:
@@ -491,7 +498,7 @@ You might also use mode hooks to specify it in certain modes, like this:
 
 ;;;###autoload
 (defcustom compilation-disable-input nil
-  "*If non-nil, send end-of-file as compilation process input.
+  "If non-nil, send end-of-file as compilation process input.
 This only affects platforms that support asynchronous processes (see
 `start-process'); synchronous compilation processes never accept input."
   :type 'boolean
@@ -602,6 +609,16 @@ Faces `compilation-error-face', `compilation-warning-face',
 (defvar compilation-error-list nil)
 (defvar compilation-old-error-list nil)
 
+(defcustom compilation-auto-jump-to-first-error nil
+  "If non-nil, automatically jump to the first error after `compile'."
+  :type 'boolean
+  :group 'compilation
+  :version "23.1")
+
+(defvar compilation-auto-jump-to-next nil
+  "If non-nil, automatically jump to the next error encountered.")
+(make-variable-buffer-local 'compilation-auto-jump-to-next)
+
 (defun compilation-face (type)
   (or (and (car type) (match-end (car type)) compilation-warning-face)
       (and (cdr type) (match-end (cdr type)) compilation-info-face)
@@ -649,13 +666,18 @@ Faces `compilation-error-face', `compilation-warning-face',
              l2
            (setcdr l1 (cons (list ,key) l2)))))))
 
+(defun compilation-auto-jump (buffer pos)
+  (with-current-buffer buffer
+    (goto-char pos)
+    (compile-goto-error)))
 
 ;; This function is the central driver, called when font-locking to gather
 ;; all information needed to later jump to corresponding source code.
 ;; Return a property list with all meta information on this error location.
 
 (defun compilation-error-properties (file line end-line col end-col type fmt)
-  (unless (< (next-single-property-change (match-beginning 0) 'directory nil (point))
+  (unless (< (next-single-property-change (match-beginning 0)
+                                          'directory nil (point))
             (point))
     (if file
        (if (functionp file)
@@ -707,6 +729,13 @@ Faces `compilation-error-face', `compilation-warning-face',
        (setq type (or (and (car type) (match-end (car type)) 1)
                       (and (cdr type) (match-end (cdr type)) 0)
                       2)))
+
+    (when (and compilation-auto-jump-to-next
+               (>= type compilation-skip-threshold))
+      (kill-local-variable 'compilation-auto-jump-to-next)
+      (run-with-timer 0 nil 'compilation-auto-jump
+                      (current-buffer) (match-beginning 0)))
+
     (compilation-internal-error-properties file line end-line col end-col type fmt)))
 
 (defun compilation-move-to-column (col screen)
@@ -913,7 +942,7 @@ to a function that generates a unique name."
   (unless (equal command (eval compile-command))
     (setq compile-command command))
   (save-some-buffers (not compilation-ask-about-save) nil)
-  (setq compilation-directory default-directory)
+  (setq-default compilation-directory default-directory)
   (compilation-start command comint))
 
 ;; run compile with the default command line
@@ -923,15 +952,12 @@ If this is run in a Compilation mode buffer, re-use the arguments from the
 original use.  Otherwise, recompile using `compile-command'."
   (interactive)
   (save-some-buffers (not compilation-ask-about-save) nil)
-  (let ((default-directory
-          (or (and (not (eq major-mode (nth 1 compilation-arguments)))
-                   compilation-directory)
-              default-directory)))
+  (let ((default-directory (or compilation-directory default-directory)))
     (apply 'compilation-start (or compilation-arguments
                                  `(,(eval compile-command))))))
 
 (defcustom compilation-scroll-output nil
-  "*Non-nil to scroll the *compilation* buffer window as output appears.
+  "Non-nil to scroll the *compilation* buffer window as output appears.
 
 Setting it causes the Compilation mode commands to put point at the
 end of their output window so that the end of the output is always
@@ -953,8 +979,7 @@ Otherwise, construct a buffer name from MODE-NAME."
         (funcall name-function mode-name))
        (compilation-buffer-name-function
         (funcall compilation-buffer-name-function mode-name))
-       ((and (eq mode-command major-mode)
-             (eq major-mode (nth 1 compilation-arguments)))
+       ((eq mode-command major-mode)
         (buffer-name))
        (t
         (concat "*" (downcase mode-name) "*"))))
@@ -1006,7 +1031,7 @@ Returns the compilation buffer created."
     (with-current-buffer
        (setq outbuf
              (get-buffer-create
-              (compilation-buffer-name name-of-mode mode name-function)))
+               (compilation-buffer-name name-of-mode mode name-function)))
       (let ((comp-proc (get-buffer-process (current-buffer))))
        (if comp-proc
            (if (or (not (eq (process-status comp-proc) 'run))
@@ -1024,12 +1049,17 @@ Returns the compilation buffer created."
       (buffer-disable-undo (current-buffer))
       ;; first transfer directory from where M-x compile was called
       (setq default-directory thisdir)
+      ;; Remember the original dir, so we can use it when we recompile.
+      ;; default-directory' can't be used reliably for that because it may be
+      ;; affected by the special handling of "cd ...;".
+      (set (make-local-variable 'compilation-directory) thisdir)
       ;; Make compilation buffer read-only.  The filter can still write it.
       ;; Clear out the compilation buffer.
       (let ((inhibit-read-only t)
            (default-directory thisdir))
-       ;; Then evaluate a cd command if any, but don't perform it yet, else start-command
-       ;; would do it again through the shell: (cd "..") AND sh -c "cd ..; make"
+       ;; Then evaluate a cd command if any, but don't perform it yet, else
+       ;; start-command would do it again through the shell: (cd "..") AND
+       ;; sh -c "cd ..; make"
        (cd (if (string-match "^\\s *cd\\(?:\\s +\\(\\S +?\\)\\)?\\s *[;&\n]" command)
                (if (match-end 1)
                    (substitute-env-vars (match-string 1 command))
@@ -1045,6 +1075,8 @@ Returns the compilation buffer created."
        (if highlight-regexp
            (set (make-local-variable 'compilation-highlight-regexp)
                 highlight-regexp))
+        (if compilation-auto-jump-to-first-error
+            (set (make-local-variable 'compilation-auto-jump-to-next) t))
        ;; Output a mode setter, for saving and later reloading this buffer.
        (insert "-*- mode: " name-of-mode
                "; default-directory: " (prin1-to-string default-directory)
@@ -1093,53 +1125,31 @@ Returns the compilation buffer created."
            (funcall compilation-process-setup-function))
        (compilation-set-window-height outwin)
        ;; Start the compilation.
-       (if (fboundp 'start-process)
-           (let ((proc (if (eq mode t)
-                           (get-buffer-process
-                            (with-no-warnings
-                             (comint-exec outbuf (downcase mode-name)
-                                          shell-file-name nil `("-c" ,command))))
-                         (start-process-shell-command (downcase mode-name)
-                                                      outbuf command))))
-             ;; Make the buffer's mode line show process state.
-             (setq mode-line-process '(":%s"))
-             (set-process-sentinel proc 'compilation-sentinel)
-             (set-process-filter proc 'compilation-filter)
-             (set-marker (process-mark proc) (point) outbuf)
-             (when compilation-disable-input
-                (condition-case nil
-                    (process-send-eof proc)
-                  ;; The process may have exited already.
-                  (error nil)))
-             (setq compilation-in-progress
-                   (cons proc compilation-in-progress)))
-         ;; No asynchronous processes available.
-         (message "Executing `%s'..." command)
-         ;; Fake modeline display as if `start-process' were run.
-         (setq mode-line-process ":run")
-         (force-mode-line-update)
-         (sit-for 0)                   ; Force redisplay
-         (let* ((buffer-read-only nil) ; call-process needs to modify outbuf
-                (status (call-process shell-file-name nil outbuf nil "-c"
-                                      command)))
-           (cond ((numberp status)
-                  (compilation-handle-exit 'exit status
-                                           (if (zerop status)
-                                               "finished\n"
-                                             (format "\
-exited abnormally with code %d\n"
-                                                     status))))
-                 ((stringp status)
-                  (compilation-handle-exit 'signal status
-                                           (concat status "\n")))
-                 (t
-                  (compilation-handle-exit 'bizarre status status))))
-         ;; Without async subprocesses, the buffer is not yet
-         ;; fontified, so fontify it now.
-         (let ((font-lock-verbose nil)) ; shut up font-lock messages
-           (font-lock-fontify-buffer))
-         (set-buffer-modified-p nil)
-         (message "Executing `%s'...done" command)))
+       (let ((proc
+              (if (eq mode t)
+                  ;; comint uses `start-file-process'.
+                  (get-buffer-process
+                   (with-no-warnings
+                     (comint-exec
+                      outbuf (downcase mode-name)
+                      (if (file-remote-p default-directory)
+                          "/bin/sh"
+                        shell-file-name)
+                      nil `("-c" ,command))))
+                (start-file-process-shell-command (downcase mode-name)
+                                                  outbuf command))))
+         ;; Make the buffer's mode line show process state.
+         (setq mode-line-process '(":%s"))
+         (set-process-sentinel proc 'compilation-sentinel)
+         (set-process-filter proc 'compilation-filter)
+         (set-marker (process-mark proc) (point) outbuf)
+         (when compilation-disable-input
+           (condition-case nil
+               (process-send-eof proc)
+             ;; The process may have exited already.
+             (error nil)))
+         (setq compilation-in-progress
+               (cons proc compilation-in-progress))))
       ;; Now finally cd to where the shell started make/grep/...
       (setq default-directory thisdir))
     (if (buffer-local-value 'compilation-scroll-output outbuf)
@@ -1260,7 +1270,7 @@ exited abnormally with code %d\n"
   "*If non-nil, skip multiple error messages for the same source location.")
 
 (defcustom compilation-skip-threshold 1
-  "*Compilation motion commands skip less important messages.
+  "Compilation motion commands skip less important messages.
 The value can be either 2 -- skip anything less than error, 1 --
 skip anything less than warning or 0 -- don't skip any messages.
 Note that all messages not positively identified as warning or
@@ -1272,7 +1282,7 @@ info, are considered errors."
   :version "22.1")
 
 (defcustom compilation-skip-visited nil
-  "*Compilation motion commands skip visited messages if this is t.
+  "Compilation motion commands skip visited messages if this is t.
 Visited messages are ones for which the file, line and column have been jumped
 to from the current content in the current compilation buffer, even if it was
 from a different message."
@@ -1373,6 +1383,8 @@ Optional argument MINOR indicates this is called from
   ;; with the next-error function in simple.el, and it's only
   ;; coincidentally named similarly to compilation-next-error.
   (setq next-error-function 'compilation-next-error-function)
+  (set (make-local-variable 'comint-file-name-prefix)
+       (or (file-remote-p default-directory) ""))
   (set (make-local-variable 'font-lock-extra-managed-props)
        '(directory message help-echo mouse-face debug))
   (set (make-local-variable 'compilation-locs)
@@ -1521,7 +1533,7 @@ Just inserts the text, but uses `insert-before-markers'."
               (eq (prog1 last (setq last (nth 2 (car msg))))
                   last))
           (if compilation-skip-visited
-              (nthcdr 4 (car msg)))
+              (nthcdr 5 (car msg)))
           (if compilation-skip-to-next-location
               (eq (car msg) loc))
           ;; count this message only if none of the above are true
@@ -1626,7 +1638,7 @@ This is the value of `next-error-function' in Compilation buffers."
   (when reset
     (setq compilation-current-error nil))
   (let* ((columns compilation-error-screen-columns) ; buffer's local value
-        (last 1)
+        (last 1) timestamp
         (loc (compilation-next-error (or n 1) nil
                                      (or compilation-current-error
                                          compilation-messages-start
@@ -1639,10 +1651,17 @@ This is the value of `next-error-function' in Compilation buffers."
                compilation-current-error
              (copy-marker (line-beginning-position)))
          loc (car loc))
-    ;; If loc contains no marker, no error in that file has been visited.  If
-    ;; the marker is invalid the buffer has been killed.  So, recalculate all
-    ;; markers for that file.
-    (unless (and (nth 3 loc) (marker-buffer (nth 3 loc)))
+    ;; If loc contains no marker, no error in that file has been visited.
+    ;; If the marker is invalid the buffer has been killed.
+    ;; If the file is newer than the timestamp, it has been modified
+    ;; (`omake -P' polls filesystem for changes and recompiles when needed
+    ;;  in the same process and buffer).
+    ;; So, recalculate all markers for that file.
+    (unless (and (nth 3 loc) (marker-buffer (nth 3 loc))
+                 (equal (nth 4 loc)
+                        (setq timestamp
+                              (with-current-buffer (marker-buffer (nth 3 loc))
+                                (visited-file-modtime)))))
       (with-current-buffer (compilation-find-file marker (caar (nth 2 loc))
                                                  (cadr (car (nth 2 loc))))
        (save-restriction
@@ -1665,7 +1684,8 @@ This is the value of `next-error-function' in Compilation buffers."
                  (set-marker (nth 3 col) (point))
                (setcdr (nthcdr 2 col) `(,(point-marker)))))))))
     (compilation-goto-locus marker (nth 3 loc) (nth 3 end-loc))
-    (setcdr (nthcdr 3 loc) t)))                ; Set this one as visited.
+    (setcdr (nthcdr 3 loc) (list timestamp))
+    (setcdr (nthcdr 4 loc) t)))                ; Set this one as visited.
 
 (defvar compilation-gcpro nil
   "Internal variable used to keep some values from being GC'd.")
@@ -1868,7 +1888,24 @@ Pop up the buffer containing MARKER and scroll to MARKER if we ask the user."
           (let* ((name (read-file-name
                         (format "Find this %s in (default %s): "
                                 compilation-error filename)
-                        spec-dir filename t nil))
+                        spec-dir filename t nil
+                        ;; The predicate below is fine when called from
+                        ;; minibuffer-complete-and-exit, but it's too
+                        ;; restrictive otherwise, since it also prevents the
+                        ;; user from completing "fo" to "foo/" when she
+                        ;; wants to enter "foo/bar".
+                        ;;
+                        ;; Try to make sure the user can only select
+                        ;; a valid answer.  This predicate may be ignored,
+                        ;; tho, so we still have to double-check afterwards.
+                        ;; TODO: We should probably fix read-file-name so
+                        ;; that it never ignores this predicate, even when
+                        ;; using popup dialog boxes.
+                        ;; (lambda (name)
+                        ;;   (if (file-directory-p name)
+                        ;;       (setq name (expand-file-name filename name)))
+                        ;;   (file-exists-p name))
+                        ))
                  (origname name))
             (cond
              ((not (file-exists-p name))
@@ -2019,9 +2056,9 @@ The file-structure looks like this:
   ;; compilation-error-list) to point-min, but that was only meaningful for
   ;; the internal uses of compilation-forget-errors: all calls from external
   ;; packages seem to be followed by a move of compilation-parsing-end to
-  ;; something equivalent to point-max.  So we speculatively move
+  ;; something equivalent to point-max.  So we heuristically move
   ;; compilation-current-error to point-max (since the external package
-  ;; won't know that it should do it).  --stef
+  ;; won't know that it should do it).  --Stef
   (setq compilation-current-error nil)
   (let* ((proc (get-buffer-process (current-buffer)))
         (mark (if proc (process-mark proc)))
@@ -2032,7 +2069,12 @@ The file-structure looks like this:
          ;; we need to put ours just before the insertion point rather
          ;; than at the insertion point.  If that's not possible, then
          ;; don't use a marker.  --Stef
-         (if (> pos (point-min)) (copy-marker (1- pos)) pos))))
+         (if (> pos (point-min)) (copy-marker (1- pos)) pos)))
+  ;; Again, since this command is used in buffers that contain several
+  ;; compilations, to set the beginning of "this compilation", it's a good
+  ;; place to reset compilation-auto-jump-to-next.
+  (set (make-local-variable 'compilation-auto-jump-to-next)
+       compilation-auto-jump-to-first-error))
 
 ;;;###autoload
 (add-to-list 'auto-mode-alist '("\\.gcov\\'" . compilation-mode))
index 5e0d4b4..44034bd 100644 (file)
@@ -6,7 +6,7 @@
 ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Keywords: wp, ebnf, PostScript
-;; Version: 1.1
+;; Version: 1.2
 
 ;; This file is part of GNU Emacs.
 
@@ -589,6 +589,12 @@ See documentation for variable `ebnf-abn-lex'."
    ;; close EPS file
    ((and ebnf-eps-executing (= (following-char) ?\]))
     (ebnf-eps-remove-context (ebnf-abn-eps-filename)))
+   ;; EPS header
+   ((and ebnf-eps-executing (= (following-char) ?H))
+    (ebnf-eps-header-comment (ebnf-abn-eps-filename)))
+   ;; EPS footer
+   ((and ebnf-eps-executing (= (following-char) ?F))
+    (ebnf-eps-footer-comment (ebnf-abn-eps-filename)))
    ;; any other action in comment
    (t
     (setq ebnf-action (aref ebnf-comment-table (following-char)))
index 6ade2fd..8f6ecd9 100644 (file)
@@ -6,7 +6,7 @@
 ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Keywords: wp, ebnf, PostScript
-;; Version: 1.9
+;; Version: 1.10
 
 ;; This file is part of GNU Emacs.
 
@@ -537,6 +537,12 @@ See documentation for variable `ebnf-bnf-lex'."
    ;; close EPS file
    ((and ebnf-eps-executing (= (following-char) ?\]))
     (ebnf-eps-remove-context (ebnf-bnf-eps-filename)))
+   ;; EPS header
+   ((and ebnf-eps-executing (= (following-char) ?H))
+    (ebnf-eps-header-comment (ebnf-bnf-eps-filename)))
+   ;; EPS footer
+   ((and ebnf-eps-executing (= (following-char) ?F))
+    (ebnf-eps-footer-comment (ebnf-bnf-eps-filename)))
    ;; any other action in comment
    (t
     (setq ebnf-action (aref ebnf-comment-table (following-char)))
index 36fb314..855dd38 100644 (file)
@@ -6,7 +6,7 @@
 ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Keywords: wp, ebnf, PostScript
-;; Version: 1.0
+;; Version: 1.1
 
 ;; This file is part of GNU Emacs.
 
@@ -1306,6 +1306,12 @@ See documentation for variable `ebnf-dtd-lex'."
    ;; close EPS file
    ((and ebnf-eps-executing (= (following-char) ?\]))
     (ebnf-eps-remove-context (ebnf-dtd-eps-filename)))
+   ;; EPS header
+   ((and ebnf-eps-executing (= (following-char) ?H))
+    (ebnf-eps-header-comment (ebnf-dtd-eps-filename)))
+   ;; EPS footer
+   ((and ebnf-eps-executing (= (following-char) ?F))
+    (ebnf-eps-footer-comment (ebnf-dtd-eps-filename)))
    ;; any other action in comment
    (t
     (setq ebnf-action (aref ebnf-comment-table (following-char))))
index cca85a1..90acb3b 100644 (file)
@@ -6,7 +6,7 @@
 ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Keywords: wp, ebnf, PostScript
-;; Version: 1.1
+;; Version: 1.2
 
 ;; This file is part of GNU Emacs.
 
@@ -539,6 +539,12 @@ See documentation for variable `ebnf-ebx-lex'."
    ;; close EPS file
    ((and ebnf-eps-executing (= (following-char) ?\]))
     (ebnf-eps-remove-context (ebnf-ebx-eps-filename)))
+   ;; EPS header
+   ((and ebnf-eps-executing (= (following-char) ?H))
+    (ebnf-eps-header-comment (ebnf-ebx-eps-filename)))
+   ;; EPS footer
+   ((and ebnf-eps-executing (= (following-char) ?F))
+    (ebnf-eps-footer-comment (ebnf-ebx-eps-filename)))
    ;; any other action in comment
    (t
     (setq ebnf-action (aref ebnf-comment-table (following-char))))
index 802cf01..9b670b4 100644 (file)
@@ -1,12 +1,12 @@
 ;;; ebnf-iso.el --- parser for ISO EBNF
 
 ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
-;; Free Software Foundation, Inc.
+;;   Free Software Foundation, Inc.
 
 ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Keywords: wp, ebnf, PostScript
-;; Version: 1.8
+;; Version: 1.9
 
 ;; This file is part of GNU Emacs.
 
@@ -504,6 +504,12 @@ See documentation for variable `ebnf-iso-lex'."
    ;; close EPS file
    ((and ebnf-eps-executing (= (following-char) ?\]))
     (ebnf-eps-remove-context (ebnf-iso-eps-filename)))
+   ;; EPS header
+   ((and ebnf-eps-executing (= (following-char) ?H))
+    (ebnf-eps-header-comment (ebnf-iso-eps-filename)))
+   ;; EPS footer
+   ((and ebnf-eps-executing (= (following-char) ?F))
+    (ebnf-eps-footer-comment (ebnf-iso-eps-filename)))
    ;; any other action in comment
    (t
     (setq ebnf-action (aref ebnf-comment-table (following-char))))
index 829494c..c1b00bd 100644 (file)
@@ -6,7 +6,7 @@
 ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Keywords: wp, ebnf, PostScript
-;; Version: 1.3
+;; Version: 1.4
 
 ;; This file is part of GNU Emacs.
 
@@ -459,6 +459,12 @@ See documentation for variable `ebnf-yac-lex'."
    ;; close EPS file
    ((and ebnf-eps-executing (= (following-char) ?\]))
     (ebnf-eps-remove-context (ebnf-yac-eps-filename)))
+   ;; EPS header
+   ((and ebnf-eps-executing (= (following-char) ?H))
+    (ebnf-eps-header-comment (ebnf-yac-eps-filename)))
+   ;; EPS footer
+   ((and ebnf-eps-executing (= (following-char) ?F))
+    (ebnf-eps-footer-comment (ebnf-yac-eps-filename)))
    ;; any other action in comment
    (t
     (setq ebnf-action (aref ebnf-comment-table (following-char))))
index 75fc250..be25293 100644 (file)
@@ -1,12 +1,12 @@
 ;;; ebnf2ps.el --- translate an EBNF to a syntactic chart on PostScript
 
 ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
-;; Free Software Foundation, Inc.
+;;   Free Software Foundation, Inc.
 
 ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Keywords: wp, ebnf, PostScript
-;; Version: 4.3
+;; Version: 4.4
 ;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre
 
 ;; This file is part of GNU Emacs.
@@ -26,8 +26,8 @@
 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 ;; Boston, MA 02110-1301, USA.
 
-(defconst ebnf-version "4.3"
-  "ebnf2ps.el, v 4.3 <2006/09/26 vinicius>
+(defconst ebnf-version "4.4"
+  "ebnf2ps.el, v 4.4 <2007/02/12 vinicius>
 
 Vinicius's last change version.  When reporting bugs, please also
 report the version of Emacs, if any, that ebnf2ps was running with.
@@ -448,6 +448,24 @@ Please send all bug fixes and enhancements to
 ;;             `ebnf-eps-region' execution.
 ;;             It's an error to try to close a not opened EPS file.
 ;;
+;;    ;Hheader generate a header in current EPS file.  The header string can
+;;             have the following formats:
+;;
+;;             %%      prints a % character.
+;;
+;;             %H      prints the `ebnf-eps-header' (which see) value.
+;;
+;;             %F      prints the `ebnf-eps-footer' (which see) value.
+;;
+;;             Any  other format is ignored, that is, if, for example, it's
+;;             used %s then %s characters are stripped out from the header.
+;;             If header is an empty string, no header is generated until a
+;;             non-empty header is specified or `ebnf-eps-header' has a
+;;             non-empty string value.
+;;
+;;    ;Ffooter generate a footer in current EPS file.  Similar to ;H action
+;;             comment.
+;;
 ;; So if you have:
 ;;
 ;;    (setq ebnf-horizontal-orientation nil)
@@ -546,6 +564,16 @@ Please send all bug fixes and enhancements to
 ;; The production A is generated in both files ebnf--AA.eps and ebnf--BB.eps.
 ;;
 ;;
+;; Log Messages
+;; ------------
+;;
+;; The buffer *Ebnf2ps Log* is where the ebnf2ps log messages are inserted.
+;; These messages are intended to help debugging ebnf2ps.
+;;
+;; The log messages are enabled by `ebnf-log' option (which see).  The default
+;; value is nil, that is, no log messages are generated.
+;;
+;;
 ;; Utilities
 ;; ---------
 ;;
@@ -723,6 +751,14 @@ Please send all bug fixes and enhancements to
 ;;
 ;; `ebnf-eps-prefix'                   Specify EPS prefix file name.
 ;;
+;; `ebnf-eps-header-font'              Specify EPS header font.
+;;
+;; `ebnf-eps-header'                   Specify EPS header.
+;;
+;; `ebnf-eps-footer-font'              Specify EPS footer font.
+;;
+;; `ebnf-eps-footer'                   Specify EPS footer.
+;;
 ;; `ebnf-use-float-format'             Non-nil means use `%f' float format.
 ;;
 ;; `ebnf-stop-on-error'                        Non-nil means signal error and stop.
@@ -735,6 +771,8 @@ Please send all bug fixes and enhancements to
 ;; `ebnf-optimize'                     Non-nil means optimize syntactic chart
 ;;                                     of rules.
 ;;
+;; `ebnf-log'                          Non-nil means generate log messages.
+;;
 ;; To set the above options you may:
 ;;
 ;; a) insert the code in your ~/.emacs, like:
@@ -787,6 +825,9 @@ Please send all bug fixes and enhancements to
 ;; To help to handle this situation, ebnf2ps has the following commands to
 ;; handle styles:
 ;;
+;; `ebnf-find-style'   Return style definition if NAME is already defined;
+;;                     otherwise, return nil.
+;;
 ;; `ebnf-insert-style' Insert a new style NAME with inheritance INHERITS and
 ;;                     values VALUES.
 ;;
@@ -1879,6 +1920,126 @@ See `ebnf-eps-buffer' and `ebnf-eps-region' commands."
   :group 'ebnf2ps)
 
 
+(defcustom ebnf-eps-header-font '(11 Helvetica "Black" "White" bold)
+  "*Specify EPS header font.
+
+See documentation for `ebnf-production-font'.
+
+See `ebnf-eps-buffer' and `ebnf-eps-region' commands."
+  :type '(list :tag "EPS Header Font"
+              (number :tag "Font Size")
+              (symbol :tag "Font Name")
+              (choice :tag "Foreground Color"
+                      (string :tag "Name")
+                      (other :tag "Default" nil))
+              (choice :tag "Background Color"
+                      (string :tag "Name")
+                      (other :tag "Default" nil))
+              (repeat :tag "Font Attributes" :inline t
+                      (choice (const bold)      (const italic)
+                              (const underline) (const strikeout)
+                              (const overline)  (const shadow)
+                              (const box)       (const outline))))
+  :version "22"
+  :group 'ebnf2ps)
+
+
+(defcustom ebnf-eps-header nil
+  "*Specify EPS header.
+
+The value should be a string, a symbol or nil.
+
+String is inserted unchanged.
+
+For symbol bounded to a function, the function is called and should return a
+string.  For symbol bounded to a value, the value should be a string.
+
+If symbol is unbounded, it is silently ignored.
+
+Empty string or nil mean that no header will be generated.
+
+Note that when the header action comment (;H in EBNF syntax) is specified, the
+string in the header action comment is processed and, if it returns a non-empty
+string, it's used to generate the header.  The header action comment accepts
+the following formats:
+
+   %%  prints a % character.
+
+   %H  prints the `ebnf-eps-header' value.
+
+   %F  prints the `ebnf-eps-footer' (which see) value.
+
+Any other format is ignored, that is, if, for example, it's used %s then %s
+characters are stripped out from the header.  If header action comment is an
+empty string, no header is generated until a non-empty header is specified or
+`ebnf-eps-header' has a non-empty string value."
+  :type '(repeat (choice :menu-tag "EPS Header"
+                        :tag "EPS Header"
+                        string symbol (const :tag "No Header" nil )))
+  :version "22"
+  :group 'ebnf2ps)
+
+
+(defcustom ebnf-eps-footer-font '(7 Helvetica "Black" "White" bold)
+  "*Specify EPS footer font.
+
+See documentation for `ebnf-production-font'.
+
+See `ebnf-eps-buffer' and `ebnf-eps-region' commands."
+  :type '(list :tag "EPS Footer Font"
+              (number :tag "Font Size")
+              (symbol :tag "Font Name")
+              (choice :tag "Foreground Color"
+                      (string :tag "Name")
+                      (other :tag "Default" nil))
+              (choice :tag "Background Color"
+                      (string :tag "Name")
+                      (other :tag "Default" nil))
+              (repeat :tag "Font Attributes" :inline t
+                      (choice (const bold)      (const italic)
+                              (const underline) (const strikeout)
+                              (const overline)  (const shadow)
+                              (const box)       (const outline))))
+  :version "22"
+  :group 'ebnf2ps)
+
+
+(defcustom ebnf-eps-footer nil
+  "*Specify EPS footer.
+
+The value should be a string, a symbol or nil.
+
+String is inserted unchanged.
+
+For symbol bounded to a function, the function is called and should return a
+string.  For symbol bounded to a value, the value should be a string.
+
+If symbol is unbounded, it is silently ignored.
+
+Empty string or nil mean that no footer will be generated.
+
+Note that when the footer action comment (;F in EBNF syntax) is specified, the
+string in the footer action comment is processed and, if it returns a non-empty
+string, it's used to generate the footer.  The footer action comment accepts
+the following formats:
+
+   %%  prints a % character.
+
+   %H  prints the `ebnf-eps-header' (which see) value.
+
+   %F  prints the `ebnf-eps-footer' value.
+
+Any other format is ignored, that is, if, for example, it's used %s then %s
+characters are stripped out from the footer.  If footer action comment is an
+empty string, no footer is generated until a non-empty footer is specified or
+`ebnf-eps-footer' has a non-empty string value."
+  :type '(repeat (choice :menu-tag "EPS Footer"
+                        :tag "EPS Footer"
+                        string symbol (const :tag "No Footer" nil )))
+  :version "22"
+  :group 'ebnf2ps)
+
+
 (defcustom ebnf-entry-percentage 0.5   ; middle
   "*Specify entry height on alternatives.
 
@@ -2019,6 +2180,16 @@ The above optimizations are specially useful when `ebnf-syntax' is `yacc'."
   :version "20"
   :group 'ebnf-optimization)
 
+
+(defcustom ebnf-log nil
+  "*Non-nil means generate log messages.
+
+The log messages are generated into the buffer *Ebnf2ps Log*.
+These messages are intended to help debugging ebnf2ps."
+  :type 'boolean
+  :version "22"
+  :group 'ebnf2ps)
+
 \f
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; To make this file smaller, some commands go in a separate file.
@@ -2063,6 +2234,7 @@ See also `ebnf-print-buffer'."
   (interactive
    (list (read-file-name "Directory containing EBNF files (print): "
                         nil default-directory)))
+  (ebnf-log-header "(ebnf-print-directory %S)" directory)
   (ebnf-directory 'ebnf-print-buffer directory))
 
 
@@ -2075,6 +2247,7 @@ killed after process termination.
 
 See also `ebnf-print-buffer'."
   (interactive "fEBNF file to generate PostScript and print from: ")
+  (ebnf-log-header "(ebnf-print-file %S %S)" file do-not-kill-buffer-when-done)
   (ebnf-file 'ebnf-print-buffer file do-not-kill-buffer-when-done))
 
 
@@ -2091,6 +2264,7 @@ is nil, send the image to the printer.  If FILENAME is a string, save
 the PostScript image in a file with that name.  If FILENAME is a
 number, prompt the user for the name of the file to save in."
   (interactive (list (ps-print-preprint current-prefix-arg)))
+  (ebnf-log-header "(ebnf-print-buffer %S)" filename)
   (ebnf-print-region (point-min) (point-max) filename))
 
 
@@ -2099,6 +2273,7 @@ number, prompt the user for the name of the file to save in."
   "Generate and print a PostScript syntactic chart image of the region.
 Like `ebnf-print-buffer', but prints just the current region."
   (interactive (list (point) (mark) (ps-print-preprint current-prefix-arg)))
+  (ebnf-log-header "(ebnf-print-region %S %S %S)" from to filename)
   (run-hooks 'ebnf-hook)
   (or (ebnf-spool-region from to)
       (ps-do-despool filename)))
@@ -2117,6 +2292,7 @@ See also `ebnf-spool-buffer'."
   (interactive
    (list (read-file-name "Directory containing EBNF files (spool): "
                         nil default-directory)))
+  (ebnf-log-header "(ebnf-spool-directory %S)" directory)
   (ebnf-directory 'ebnf-spool-buffer directory))
 
 
@@ -2129,6 +2305,7 @@ killed after process termination.
 
 See also `ebnf-spool-buffer'."
   (interactive "fEBNF file to generate PostScript and spool from: ")
+  (ebnf-log-header "(ebnf-spool-file %S %S)" file do-not-kill-buffer-when-done)
   (ebnf-file 'ebnf-spool-buffer file do-not-kill-buffer-when-done))
 
 
@@ -2140,6 +2317,7 @@ local buffer to be sent to the printer later.
 
 Use the command `ebnf-despool' to send the spooled images to the printer."
   (interactive)
+  (ebnf-log-header "(ebnf-spool-buffer)")
   (ebnf-spool-region (point-min) (point-max)))
 
 
@@ -2150,6 +2328,7 @@ Like `ebnf-spool-buffer', but spools just the current region.
 
 Use the command `ebnf-despool' to send the spooled images to the printer."
   (interactive "r")
+  (ebnf-log-header "(ebnf-spool-region %S)" from to)
   (ebnf-generate-region from to 'ebnf-generate))
 
 
@@ -2166,6 +2345,7 @@ See also `ebnf-eps-buffer'."
   (interactive
    (list (read-file-name "Directory containing EBNF files (EPS): "
                         nil default-directory)))
+  (ebnf-log-header "(ebnf-eps-directory %S)" directory)
   (ebnf-directory 'ebnf-eps-buffer directory))
 
 
@@ -2178,6 +2358,7 @@ killed after EPS generation.
 
 See also `ebnf-eps-buffer'."
   (interactive "fEBNF file to generate EPS file from: ")
+  (ebnf-log-header "(ebnf-eps-file %S %S)" file do-not-kill-buffer-when-done)
   (ebnf-file 'ebnf-eps-buffer file do-not-kill-buffer-when-done))
 
 
@@ -2200,8 +2381,9 @@ The EPS file name has the following form:
             file name used in this case will be \"ebnf--A_B_+_C.eps\".
 
 WARNING: This function does *NOT* ask any confirmation to override existing
-         files."
+        files."
   (interactive)
+  (ebnf-log-header "(ebnf-eps-buffer)")
   (ebnf-eps-region (point-min) (point-max)))
 
 
@@ -2224,8 +2406,9 @@ The EPS file name has the following form:
             file name used in this case will be \"ebnf--A_B_+_C.eps\".
 
 WARNING: This function does *NOT* ask any confirmation to override existing
-         files."
+        files."
   (interactive "r")
+  (ebnf-log-header "(ebnf-eps-region %S %S)" from to)
   (let ((ebnf-eps-executing t))
     (ebnf-generate-region from to 'ebnf-generate-eps)))
 
@@ -2247,6 +2430,7 @@ See also `ebnf-syntax-buffer'."
   (interactive
    (list (read-file-name "Directory containing EBNF files (syntax): "
                         nil default-directory)))
+  (ebnf-log-header "(ebnf-syntax-directory %S)" directory)
   (ebnf-directory 'ebnf-syntax-buffer directory))
 
 
@@ -2259,6 +2443,7 @@ killed after syntax checking.
 
 See also `ebnf-syntax-buffer'."
   (interactive "fEBNF file to check syntax: ")
+  (ebnf-log-header "(ebnf-syntax-file %S %S)" file do-not-kill-buffer-when-done)
   (ebnf-file 'ebnf-syntax-buffer file do-not-kill-buffer-when-done))
 
 
@@ -2266,13 +2451,15 @@ See also `ebnf-syntax-buffer'."
 (defun ebnf-syntax-buffer ()
   "Do a syntactic analysis of the current buffer."
   (interactive)
+  (ebnf-log-header "(ebnf-syntax-buffer)")
   (ebnf-syntax-region (point-min) (point-max)))
 
 
 ;;;###autoload
 (defun ebnf-syntax-region (from to)
-  "Do a syntactic analysis of region."
+  "Do a syntactic analysis of region."
   (interactive "r")
+  (ebnf-log-header "(ebnf-syntax-region %S %S)" from to)
   (ebnf-generate-region from to nil))
 
 \f
@@ -2287,6 +2474,8 @@ See also `ebnf-syntax-buffer'."
    "
 ;;; ebnf2ps.el version %s
 
+;;; Emacs version %S
+
 \(setq ebnf-special-show-delimiter      %S
       ebnf-special-font                %s
       ebnf-special-shape               %s
@@ -2333,20 +2522,28 @@ See also `ebnf-syntax-buffer'."
       ebnf-iso-normalize-p             %S
       ebnf-file-suffix-regexp          %S
       ebnf-eps-prefix                  %S
+      ebnf-eps-header-font             %s
+      ebnf-eps-header                  %s
+      ebnf-eps-footer-font             %s
+      ebnf-eps-footer                  %s
       ebnf-entry-percentage            %S
       ebnf-color-p                     %S
       ebnf-line-width                  %S
       ebnf-line-color                  %S
+      ebnf-arrow-extra-width           %S
+      ebnf-arrow-scale                 %S
       ebnf-debug-ps                    %S
       ebnf-use-float-format            %S
       ebnf-stop-on-error               %S
       ebnf-yac-ignore-error-recovery   %S
       ebnf-ignore-empty-rule           %S
-      ebnf-optimize                    %S)
+      ebnf-optimize                    %S
+      ebnf-log                         %S)
 
 ;;; ebnf2ps.el - end of settings
 "
    ebnf-version
+   emacs-version
    ebnf-special-show-delimiter
    (ps-print-quote ebnf-special-font)
    (ps-print-quote ebnf-special-shape)
@@ -2393,16 +2590,23 @@ See also `ebnf-syntax-buffer'."
    ebnf-iso-normalize-p
    ebnf-file-suffix-regexp
    ebnf-eps-prefix
+   (ps-print-quote ebnf-eps-header-font)
+   (ps-print-quote ebnf-eps-header)
+   (ps-print-quote ebnf-eps-footer-font)
+   (ps-print-quote ebnf-eps-footer)
    ebnf-entry-percentage
    ebnf-color-p
    ebnf-line-width
    ebnf-line-color
+   ebnf-arrow-extra-width
+   ebnf-arrow-scale
    ebnf-debug-ps
    ebnf-use-float-format
    ebnf-stop-on-error
    ebnf-yac-ignore-error-recovery
    ebnf-ignore-empty-rule
-   ebnf-optimize))
+   ebnf-optimize
+   ebnf-log))
 
 \f
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -2465,6 +2669,10 @@ See also `ebnf-syntax-buffer'."
     ebnf-iso-normalize-p
     ebnf-file-suffix-regexp
     ebnf-eps-prefix
+    ebnf-eps-header-font
+    ebnf-eps-header
+    ebnf-eps-footer-font
+    ebnf-eps-footer
     ebnf-entry-percentage
     ebnf-color-p
     ebnf-line-width
@@ -2528,6 +2736,10 @@ See also `ebnf-syntax-buffer'."
       (ebnf-iso-normalize-p             . nil)
       (ebnf-file-suffix-regexp          . "\.[Bb][Nn][Ff]$")
       (ebnf-eps-prefix                  . "ebnf--")
+      (ebnf-eps-header-font             . '(11 Helvetica "Black" "White" bold))
+      (ebnf-eps-header                  . nil)
+      (ebnf-eps-footer-font             . '(7 Helvetica "Black" "White" bold))
+      (ebnf-eps-footer                  . nil)
       (ebnf-entry-percentage            . 0.5)
       (ebnf-color-p   . (or (fboundp 'x-color-values) ; Emacs
                            (fboundp 'color-instance-rgb-components))) ; XEmacs
@@ -2600,6 +2812,15 @@ Don't use this variable directly.  Use functions `ebnf-insert-style',
 ;; Style commands
 
 
+;;;###autoload
+(defun ebnf-find-style (name)
+  "Return style definition if NAME is already defined; otherwise, return nil.
+
+See `ebnf-style-database' documentation."
+  (interactive "SStyle name: ")
+  (assoc name ebnf-style-database))
+
+
 ;;;###autoload
 (defun ebnf-insert-style (name inherits &rest values)
   "Insert a new style NAME with inheritance INHERITS and values VALUES.
@@ -2735,18 +2956,20 @@ See `ebnf-style-database' documentation."
 ;; Internal variables
 
 
-(defvar ebnf-eps-buffer-name " *EPS*")
-(defvar ebnf-parser-func     nil)
-(defvar ebnf-eps-executing   nil)
-(defvar ebnf-eps-upper-x     0.0)
+(defvar ebnf-eps-buffer-name    " *EPS*")
+(defvar ebnf-parser-func        nil)
+(defvar ebnf-eps-executing      nil)
+(defvar ebnf-eps-header-comment nil)
+(defvar ebnf-eps-footer-comment nil)
+(defvar ebnf-eps-upper-x        0.0)
 (make-variable-buffer-local 'ebnf-eps-upper-x)
-(defvar ebnf-eps-upper-y     0.0)
+(defvar ebnf-eps-upper-y        0.0)
 (make-variable-buffer-local 'ebnf-eps-upper-y)
-(defvar ebnf-eps-prod-width  0.0)
+(defvar ebnf-eps-prod-width     0.0)
 (make-variable-buffer-local 'ebnf-eps-prod-width)
-(defvar ebnf-eps-max-height 0.0)
+(defvar ebnf-eps-max-height     0.0)
 (make-variable-buffer-local 'ebnf-eps-max-height)
-(defvar ebnf-eps-max-width  0.0)
+(defvar ebnf-eps-max-width      0.0)
 (make-variable-buffer-local 'ebnf-eps-max-width)
 
 
@@ -2756,6 +2979,23 @@ See `ebnf-style-database' documentation."
 See section \"Actions in Comments\" in ebnf2ps documentation.")
 
 
+(defvar ebnf-eps-file-alist nil
+"Alist associating file name with EPS header and footer.
+
+Each element has the following form:
+
+   (EPS-FILENAME HEADER FOOTER)
+
+EPS-FILENAME is the EPS file name.
+HEADER is the header string or nil.
+FOOTER is the footer string or nil.
+
+It's generated during parsing and used during EPS generation.
+
+See `ebnf-eps-context' and section \"Actions in Comments\" in ebnf2ps
+documentation.")
+
+
 (defvar ebnf-eps-production-list nil
   "Alist associating production name with EPS file name list.
 
@@ -2800,41 +3040,43 @@ See documentation for `ebnf-terminal-shape', `ebnf-non-terminal-shape' and
 `ebnf-chart-shape'.")
 
 
-(defvar ebnf-limit            nil)
-(defvar ebnf-action           nil)
-(defvar ebnf-action-list      nil)
+(defvar ebnf-limit          nil)
+(defvar ebnf-action         nil)
+(defvar ebnf-action-list    nil)
 
 
-(defvar ebnf-default-p        nil)
+(defvar ebnf-default-p      nil)
 
 
-(defvar ebnf-font-height-P    0)
-(defvar ebnf-font-height-T    0)
-(defvar ebnf-font-height-NT   0)
-(defvar ebnf-font-height-S    0)
-(defvar ebnf-font-height-E    0)
-(defvar ebnf-font-height-R    0)
-(defvar ebnf-font-width-P     0)
-(defvar ebnf-font-width-T     0)
-(defvar ebnf-font-width-NT    0)
-(defvar ebnf-font-width-S     0)
-(defvar ebnf-font-width-E     0)
-(defvar ebnf-font-width-R     0)
-(defvar ebnf-space-T          0)
-(defvar ebnf-space-NT         0)
-(defvar ebnf-space-S          0)
-(defvar ebnf-space-E          0)
-(defvar ebnf-space-R          0)
+(defvar ebnf-font-height-P  0)
+(defvar ebnf-font-height-T  0)
+(defvar ebnf-font-height-NT 0)
+(defvar ebnf-font-height-S  0)
+(defvar ebnf-font-height-E  0)
+(defvar ebnf-font-height-R  0)
+(defvar ebnf-font-width-P   0)
+(defvar ebnf-font-width-T   0)
+(defvar ebnf-font-width-NT  0)
+(defvar ebnf-font-width-S   0)
+(defvar ebnf-font-width-E   0)
+(defvar ebnf-font-width-R   0)
+(defvar ebnf-space-T        0)
+(defvar ebnf-space-NT       0)
+(defvar ebnf-space-S        0)
+(defvar ebnf-space-E        0)
+(defvar ebnf-space-R        0)
 
 
-(defvar ebnf-basic-width      0)
-(defvar ebnf-basic-height     0)
-(defvar ebnf-vertical-space   0)
-(defvar ebnf-horizontal-space 0)
+(defvar ebnf-basic-width-extra  0)
+(defvar ebnf-basic-width        0)
+(defvar ebnf-basic-height       0)
+(defvar ebnf-basic-empty-height 0)
+(defvar ebnf-vertical-space     0)
+(defvar ebnf-horizontal-space   0)
 
 
-(defvar ebnf-settings         nil)
-(defvar ebnf-fonts-required   nil)
+(defvar ebnf-settings       nil)
+(defvar ebnf-fonts-required nil)
 
 
 (defconst ebnf-debug
@@ -3179,8 +3421,8 @@ See documentation for `ebnf-terminal-shape', `ebnf-non-terminal-shape' and
 
 % --- Flow Stuff
 
-% height prepare_height |- line_height corner_height corner_height
-/prepare_height
+% height prepare-height |- line_height corner_height corner_height
+/prepare-height
 {dup 0 gt
  {T sub hT}
  {T add hT neg}ifelse
@@ -3206,7 +3448,7 @@ See documentation for `ebnf-terminal-shape', `ebnf-non-terminal-shape' and
   {0.5 mul dup
    1 corner_RA
    0 corner_RD}
-  {prepare_height
+  {prepare-height
    1 corner_RA
    exch 0 exch rlineto
    0 corner_RD
@@ -3227,7 +3469,7 @@ See documentation for `ebnf-terminal-shape', `ebnf-non-terminal-shape' and
 %  \\
 %   -
 /LLoop
-{prepare_height
+{prepare-height
  3 corner_LA
  exch 0 exch rlineto
  0 corner_RD
@@ -3252,7 +3494,7 @@ See documentation for `ebnf-terminal-shape', `ebnf-non-terminal-shape' and
   {0.5 mul dup
    1 corner_LA
    0 corner_LD}
-  {prepare_height
+  {prepare-height
    1 corner_LA
    exch 0 exch rlineto
    0 corner_LD
@@ -3273,7 +3515,7 @@ See documentation for `ebnf-terminal-shape', `ebnf-non-terminal-shape' and
 %   /
 %  -
 /RLoop
-{prepare_height
+{prepare-height
  1 corner_RA
  exch 0 exch rlineto
  0 corner_LD
@@ -4063,6 +4305,113 @@ end
   "EBNF EPS end")
 
 \f
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Header & Footer
+
+
+(defun ebnf-eps-header-footer (value)
+  ;; evaluate header/footer value
+  ;; return a string or nil
+  (let ((tmp (if (symbolp value)
+                (cond ((fboundp value) (funcall value))
+                      ((boundp value)  (symbol-value value))
+                      (t               nil))
+              value)))
+    (and (stringp tmp) tmp)))
+
+
+(defun ebnf-eps-header ()
+  ;; evaluate header value
+  (ebnf-eps-header-footer ebnf-eps-header))
+
+
+(defun ebnf-eps-footer ()
+  ;; evaluate footer value
+  (ebnf-eps-header-footer ebnf-eps-footer))
+
+
+;; hacked fom `ps-output-string-prim' (ps-print.el)
+(defun ebnf-eps-string (string)
+  (let* ((str   (string-as-unibyte string))
+        (len   (length str))
+        (index 0)
+        (new   "(")                    ; insert start-string delimiter
+        start special)
+    ;; Find and quote special characters as necessary for PS
+    ;; This skips everything except control chars, non-ASCII chars, (, ) and \.
+    (while (setq start (string-match "[^]-~ -'*-[]" str index))
+      (setq special (aref str start)
+           new     (concat new
+                           (substring str index start)
+                           (if (and (<= 0 special) (<= special 255))
+                               (aref ps-string-escape-codes special)
+                             ;; insert hexadecimal representation if character
+                             ;; code is out of range
+                             (format "\\%04X" special)))
+           index   (1+ start)))
+    (concat new
+           (and (< index len)
+                (substring str index len))
+           ")")))                      ; insert end-string delimiter
+
+
+(defun ebnf-eps-header-footer-comment (str)
+  ;; parse header/footer comment string
+  (let ((len   (1- (length str)))
+       (index 0)
+       new start fmt)
+    (while (setq start (string-match "%" str index))
+      (setq fmt   (if (< start len) (aref str (1+ start)) ?\?)
+           new   (concat new
+                         (substring str index start)
+                         (cond ((= fmt ?%) "%")
+                               ((= fmt ?H) (ebnf-eps-header))
+                               ((= fmt ?F) (ebnf-eps-footer))
+                               (t nil)
+                               ))
+           index (+ start 2)))
+    (ebnf-eps-string (concat new
+                            (and (<= index len)
+                                 (substring str index (1+ len)))))))
+
+
+(defun ebnf-eps-header-footer-p (value)
+  ;; return t if value is non-nil and is not an empty string
+  (not (or (null value)
+          (and (stringp value) (string= value "")))))
+
+
+(defun ebnf-eps-header-comment (str)
+  ;; set header comment if header is on
+  (when (ebnf-eps-header-footer-p ebnf-eps-header)
+    (setq ebnf-eps-header-comment (ebnf-eps-header-footer-comment str))))
+
+
+(defun ebnf-eps-footer-comment (str)
+  ;; set footer comment if footer is on
+  (when (ebnf-eps-header-footer-p ebnf-eps-footer)
+    (setq ebnf-eps-footer-comment (ebnf-eps-header-footer-comment str))))
+
+
+(defun ebnf-eps-header-footer-file (filename)
+  ;; associate header and footer with a filename
+  (let ((filehf (assoc filename ebnf-eps-file-alist))
+       (header (or ebnf-eps-header-comment (ebnf-eps-header)))
+       (footer (or ebnf-eps-footer-comment (ebnf-eps-footer))))
+    (if (null filehf)
+       (setq ebnf-eps-file-alist (cons (list filename header footer)
+                                       ebnf-eps-file-alist))
+      (setcar (nthcdr 1 filehf) header)
+      (setcar (nthcdr 2 filehf) footer))))
+
+
+(defun ebnf-eps-header-footer-set (filename)
+  ;; set header and footer from a filename
+  (let ((header-footer (assoc filename ebnf-eps-file-alist)))
+    (setq ebnf-eps-header-comment (nth 1 header-footer)
+         ebnf-eps-footer-comment (nth 2 header-footer))))
+
+\f
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Formatting
 
@@ -4513,7 +4862,9 @@ end
     (if sep
        (let ((ebnf-direction "L"))
          (ebnf-node-generation sep))
-      (ebnf-empty-alternative (- width ebnf-horizontal-space))))
+      (ebnf-empty-alternative (- width
+                                ebnf-horizontal-space
+                                ebnf-basic-width-extra))))
   (ps-output "EOS\n"))
 
 
@@ -4528,7 +4879,7 @@ end
                        (if node-sep
                            (- (ebnf-node-height node-sep)
                               (ebnf-node-entry node-sep))
-                         0))))
+                         ebnf-basic-empty-height))))
     (ps-output (ebnf-format-float entry
                                  (+ (- (ebnf-node-height node-list)
                                        list-entry)
@@ -4540,7 +4891,9 @@ end
     (if (ebnf-node-separator zero-or-more)
        (let ((ebnf-direction "L"))
          (ebnf-node-generation (ebnf-node-separator zero-or-more)))
-      (ebnf-empty-alternative (- width ebnf-horizontal-space))))
+      (ebnf-empty-alternative (- width
+                                ebnf-horizontal-space
+                                ebnf-basic-width-extra))))
   (ps-output "EOS\n"))
 
 
@@ -4662,7 +5015,9 @@ killed after process termination."
 (defun ebnf-eps-filename (str)
   (let* ((len  (length str))
         (stri 0)
-        (new  (make-string len ?\s)))
+        ;; to keep compatibility with Emacs 20 & 21:
+        ;; DO NOT REPLACE `?\ ' BY `?\s'
+        (new  (make-string len ?\ )))
     (while (< stri len)
       (aset new stri (aref ebnf-map-name (aref str stri)))
       (setq stri (1+ stri)))
@@ -4723,6 +5078,7 @@ killed after process termination."
 
 
 (defun ebnf-parse-and-sort (start)
+  (ebnf-log "(ebnf-parse-and-sort %S)" start)
   (ebnf-begin-job)
   (let ((tree (funcall ebnf-parser-func start)))
     (if ebnf-sort-production
@@ -4861,7 +5217,10 @@ killed after process termination."
        ebnf-action              nil
        ebnf-default-p           nil
        ebnf-eps-context         nil
+       ebnf-eps-file-alist      nil
        ebnf-eps-production-list nil
+       ebnf-eps-header-comment  nil
+       ebnf-eps-footer-comment  nil
        ebnf-eps-upper-x         0.0
        ebnf-eps-upper-y         0.0
        ebnf-font-height-P       (ebnf-font-height ebnf-production-font)
@@ -4882,10 +5241,14 @@ killed after process termination."
        ebnf-space-E             (* ebnf-font-height-E 0.5)
        ebnf-space-R             (* ebnf-font-height-R 0.5))
   (let ((basic (+ ebnf-font-height-T ebnf-font-height-NT)))
-    (setq ebnf-basic-width      (* basic 0.5)
-         ebnf-horizontal-space (+ basic basic)
-         ebnf-basic-height     ebnf-basic-width
-         ebnf-vertical-space   ebnf-basic-width)
+    (setq ebnf-basic-width        (* basic 0.5)
+         ebnf-horizontal-space   (+ basic basic)
+         ebnf-basic-empty-height (* ebnf-basic-width 0.5)
+         ebnf-basic-height       ebnf-basic-width
+         ebnf-vertical-space     ebnf-basic-width
+         ebnf-basic-width-extra  (- ebnf-basic-width
+                                    ebnf-arrow-extra-width
+                                    0.1)) ; error factor
     ;; ensures value is greater than zero
     (or (and (numberp ebnf-production-horizontal-space)
             (> ebnf-production-horizontal-space 0.0))
@@ -4893,7 +5256,18 @@ killed after process termination."
     ;; ensures value is greater than zero
     (or (and (numberp ebnf-production-vertical-space)
             (> ebnf-production-vertical-space 0.0))
-       (setq ebnf-production-vertical-space basic))))
+       (setq ebnf-production-vertical-space basic)))
+  (ebnf-log "(ebnf-begin-job)")
+  (ebnf-log "   ebnf-arrow-extra-width ............ : %7.3f"      ebnf-arrow-extra-width)
+  (ebnf-log "   ebnf-arrow-scale .................. : %7.3f"      ebnf-arrow-scale)
+  (ebnf-log "   ebnf-basic-width-extra ............ : %7.3f"      ebnf-basic-width-extra)
+  (ebnf-log "   ebnf-basic-width .................. : %7.3f (T)"  ebnf-basic-width)
+  (ebnf-log "   ebnf-horizontal-space ............. : %7.3f (4T)" ebnf-horizontal-space)
+  (ebnf-log "   ebnf-basic-empty-height ........... : %7.3f (hT)" ebnf-basic-empty-height)
+  (ebnf-log "   ebnf-basic-height ................. : %7.3f (T)"  ebnf-basic-height)
+  (ebnf-log "   ebnf-vertical-space ............... : %7.3f (T)"  ebnf-vertical-space)
+  (ebnf-log "   ebnf-production-horizontal-space .. : %7.3f (2T)" ebnf-production-horizontal-space)
+  (ebnf-log "   ebnf-production-vertical-space .... : %7.3f (2T)" ebnf-production-vertical-space))
 
 
 (defsubst ebnf-shape-value (sym alist)
@@ -4916,6 +5290,7 @@ killed after process termination."
         (progn
           ;; adjust creator comment
           (end-of-line)
+          ;; (backward-char)
           (insert " & ebnf2ps v" ebnf-version)
           ;; insert ebnf settings & engine
           (goto-char (point-max))
@@ -4928,6 +5303,7 @@ killed after process termination."
   (when (buffer-modified-p buffer)
     (save-excursion
       (set-buffer buffer)
+      (ebnf-eps-header-footer-set filename)
       (setq ebnf-eps-upper-x (max ebnf-eps-upper-x ebnf-eps-max-width)
            ebnf-eps-upper-y (if (zerop ebnf-eps-upper-y)
                                 ebnf-eps-max-height
@@ -4954,7 +5330,9 @@ killed after process termination."
                                           ebnf-non-terminal-font
                                           ebnf-special-font
                                           ebnf-except-font
-                                          ebnf-repeat-font)))
+                                          ebnf-repeat-font
+                                          ebnf-eps-header-font
+                                          ebnf-eps-footer-font)))
                            "\n%%+ font ")))
        "\n%%Pages: 0\n%%EndComments\n\n%%BeginProlog\n"
        ebnf-eps-prologue)
@@ -4980,6 +5358,42 @@ killed after process termination."
        (setq ebnf-settings
             (concat
              "\n\n% === begin EBNF settings\n\n"
+             (format "/Header        %s def\n"
+                     (or ebnf-eps-header-comment "()"))
+             (format "/Footer        %s def\n"
+                     (or ebnf-eps-footer-comment "()"))
+             ;; header
+             (format "/ShowHeader    %s def\n"
+                     (ebnf-boolean
+                      (ebnf-eps-header-footer-p ebnf-eps-header)))
+             (format "/fH            %s /%s DefFont\n"
+                     (ebnf-format-float
+                      (ebnf-font-size ebnf-eps-header-font))
+                     (ebnf-font-name-select ebnf-eps-header-font))
+             (ebnf-format-color "/ForegroundH   %s def %% %s\n"
+                                (ebnf-font-foreground ebnf-eps-header-font)
+                                "Black")
+             (ebnf-format-color "/BackgroundH   %s def %% %s\n"
+                                (ebnf-font-background ebnf-eps-header-font)
+                                "White")
+             (format "/EffectH       %d def\n"
+                     (ebnf-font-attributes ebnf-eps-header-font))
+             ;; footer
+             (format "/ShowFooter    %s def\n"
+                     (ebnf-boolean
+                      (ebnf-eps-header-footer-p ebnf-eps-footer)))
+             (format "/fF            %s /%s DefFont\n"
+                     (ebnf-format-float
+                      (ebnf-font-size ebnf-eps-footer-font))
+                     (ebnf-font-name-select ebnf-eps-footer-font))
+             (ebnf-format-color "/ForegroundF   %s def %% %s\n"
+                                (ebnf-font-foreground ebnf-eps-footer-font)
+                                "Black")
+             (ebnf-format-color "/BackgroundF   %s def %% %s\n"
+                                (ebnf-font-background ebnf-eps-footer-font)
+                                "White")
+             (format "/EffectF       %d def\n"
+                     (ebnf-font-attributes ebnf-eps-footer-font))
              ;; production
              (format "/fP            %s /%s DefFont\n"
                      (ebnf-format-float (ebnf-font-size ebnf-production-font))
@@ -5136,6 +5550,7 @@ killed after process termination."
 
 
 (defun ebnf-dimensions (tree)
+  (ebnf-log "(ebnf-dimensions tree)")
   (let ((ebnf-total (length tree))
        (ebnf-nprod 0))
     (mapcar 'ebnf-production-dimension tree))
@@ -5149,6 +5564,7 @@ killed after process termination."
 
 ;; [production width-fun dim-fun entry height width name production action]
 (defun ebnf-production-dimension (production)
+  (ebnf-log "(ebnf-production-dimension production)")
   (ebnf-message-info "Calculating dimensions")
   (ebnf-node-dimension-func (ebnf-node-production production))
   (let* ((prod   (ebnf-node-production production))
@@ -5162,11 +5578,17 @@ killed after process termination."
     (ebnf-node-height production height)
     (ebnf-node-width  production (+ (ebnf-node-width prod)
                                    ebnf-line-width
-                                   ebnf-horizontal-space))))
+                                   ebnf-horizontal-space
+                                   ebnf-basic-width-extra)))
+  (ebnf-log "   production name   : %S"    (ebnf-node-name   production))
+  (ebnf-log "   production entry  : %7.3f" (ebnf-node-entry  production))
+  (ebnf-log "   production height : %7.3f" (ebnf-node-height production))
+  (ebnf-log "   production width  : %7.3f" (ebnf-node-width  production)))
 
 
 ;; [terminal width-fun dim-fun entry height width name]
 (defun ebnf-terminal-dimension (terminal)
+  (ebnf-log "(ebnf-terminal-dimension terminal)")
   (ebnf-terminal-dimension1 terminal
                            ebnf-font-height-T
                            ebnf-font-width-T
@@ -5175,6 +5597,7 @@ killed after process termination."
 
 ;; [non-terminal width-fun dim-fun entry height width name]
 (defun ebnf-non-terminal-dimension (non-terminal)
+  (ebnf-log "(ebnf-non-terminal-dimension non-terminal)")
   (ebnf-terminal-dimension1 non-terminal
                            ebnf-font-height-NT
                            ebnf-font-width-NT
@@ -5183,6 +5606,7 @@ killed after process termination."
 
 ;; [special width-fun dim-fun entry height width name]
 (defun ebnf-special-dimension (special)
+  (ebnf-log "(ebnf-special-dimension special)")
   (ebnf-terminal-dimension1 special
                            ebnf-font-height-S
                            ebnf-font-width-S
@@ -5194,9 +5618,16 @@ killed after process termination."
        (len    (length (ebnf-node-name node))))
     (ebnf-node-entry  node (* height 0.5))
     (ebnf-node-height node height)
-    (ebnf-node-width  node (+ ebnf-basic-width ebnf-arrow-extra-width space
+    (ebnf-node-width  node (+ ebnf-basic-width
+                             ebnf-arrow-extra-width
+                             space
                              (* len font-width)
-                             space ebnf-basic-width))))
+                             space
+                             ebnf-basic-width)))
+  (ebnf-log "   name   : %S"    (ebnf-node-name   node))
+  (ebnf-log "   entry  : %7.3f" (ebnf-node-entry  node))
+  (ebnf-log "   height : %7.3f" (ebnf-node-height node))
+  (ebnf-log "   width  : %7.3f" (ebnf-node-width  node)))
 
 
 (defconst ebnf-null-vector (vector t t t 0.0 0.0 0.0))
@@ -5204,6 +5635,7 @@ killed after process termination."
 
 ;; [repeat width-fun dim-fun entry height width times element]
 (defun ebnf-repeat-dimension (repeat)
+  (ebnf-log "(ebnf-repeat-dimension repeat)")
   (let ((times   (ebnf-node-name repeat))
        (element (ebnf-node-separator repeat)))
     (if element
@@ -5218,11 +5650,15 @@ killed after process termination."
                                ebnf-arrow-extra-width
                                ebnf-space-R ebnf-space-R ebnf-space-R
                                ebnf-horizontal-space
-                               (* (length times) ebnf-font-width-R)))))
+                               (* (length times) ebnf-font-width-R))))
+  (ebnf-log "   repeat entry  : %7.3f" (ebnf-node-entry  repeat))
+  (ebnf-log "   repeat height : %7.3f" (ebnf-node-height repeat))
+  (ebnf-log "   repeat width  : %7.3f" (ebnf-node-width  repeat)))
 
 
 ;; [except width-fun dim-fun entry height width element element]
 (defun ebnf-except-dimension (except)
+  (ebnf-log "(ebnf-except-dimension except)")
   (let ((factor  (ebnf-node-list except))
        (element (ebnf-node-separator except)))
     (ebnf-node-dimension-func factor)
@@ -5241,11 +5677,15 @@ killed after process termination."
                                ebnf-space-E ebnf-space-E
                                ebnf-space-E ebnf-space-E
                                ebnf-font-width-E
-                               ebnf-horizontal-space))))
+                               ebnf-horizontal-space)))
+  (ebnf-log "   except entry  : %7.3f" (ebnf-node-entry  except))
+  (ebnf-log "   except height : %7.3f" (ebnf-node-height except))
+  (ebnf-log "   except width  : %7.3f" (ebnf-node-width  except)))
 
 
 ;; [alternative width-fun dim-fun entry height width list]
 (defun ebnf-alternative-dimension (alternative)
+  (ebnf-log "(ebnf-alternative-dimension alternative)")
   (let ((body (ebnf-node-list alternative))
        (lis  (ebnf-node-list alternative)))
     (while lis
@@ -5270,23 +5710,33 @@ killed after process termination."
                                           (- (ebnf-node-height tail)
                                              (ebnf-node-entry tail))))))
       (ebnf-node-height alternative height)
-      (ebnf-node-width  alternative (+ width ebnf-horizontal-space))
-      (ebnf-node-list   alternative body))))
+      (ebnf-node-width  alternative (+ width
+                                      ebnf-horizontal-space
+                                      ebnf-basic-width-extra))
+      (ebnf-node-list   alternative body)))
+  (ebnf-log "   alternative entry  : %7.3f" (ebnf-node-entry  alternative))
+  (ebnf-log "   alternative height : %7.3f" (ebnf-node-height alternative))
+  (ebnf-log "   alternative width  : %7.3f" (ebnf-node-width  alternative)))
 
 
 ;; [optional width-fun dim-fun entry height width element]
 (defun ebnf-optional-dimension (optional)
+  (ebnf-log "(ebnf-optional-dimension optional)")
   (let ((body (ebnf-node-list optional)))
     (ebnf-node-dimension-func body)
     (ebnf-node-entry  optional (ebnf-node-entry body))
     (ebnf-node-height optional (+ (ebnf-node-height body)
                                  ebnf-vertical-space))
     (ebnf-node-width  optional (+ (ebnf-node-width body)
-                                 ebnf-horizontal-space))))
+                                 ebnf-horizontal-space)))
+  (ebnf-log "   optional entry  : %7.3f" (ebnf-node-entry  optional))
+  (ebnf-log "   optional height : %7.3f" (ebnf-node-height optional))
+  (ebnf-log "   optional width  : %7.3f" (ebnf-node-width  optional)))
 
 
 ;; [one-or-more width-fun dim-fun entry height width element separator]
 (defun ebnf-one-or-more-dimension (or-more)
+  (ebnf-log "(ebnf-one-or-more-dimension or-more)")
   (let ((list-part (ebnf-node-list or-more))
        (sep-part  (ebnf-node-separator or-more)))
     (ebnf-node-dimension-func list-part)
@@ -5294,7 +5744,7 @@ killed after process termination."
         (ebnf-node-dimension-func sep-part))
     (let ((height (+ (if sep-part
                         (ebnf-node-height sep-part)
-                      0.0)
+                      ebnf-basic-empty-height)
                     ebnf-vertical-space
                     (ebnf-node-height list-part)))
          (width  (max (if sep-part
@@ -5304,14 +5754,21 @@ killed after process termination."
       (when sep-part
        (ebnf-adjust-width list-part width)
        (ebnf-adjust-width sep-part width))
-      (ebnf-node-entry  or-more (+ (- height (ebnf-node-height list-part))
+      (ebnf-node-entry  or-more (+ (- height
+                                     (ebnf-node-height list-part))
                                   (ebnf-node-entry list-part)))
       (ebnf-node-height or-more height)
-      (ebnf-node-width  or-more (+ width ebnf-horizontal-space)))))
+      (ebnf-node-width  or-more (+ width
+                                  ebnf-horizontal-space
+                                  ebnf-basic-width-extra))))
+  (ebnf-log "   one-or-more entry  : %7.3f" (ebnf-node-entry  or-more))
+  (ebnf-log "   one-or-more height : %7.3f" (ebnf-node-height or-more))
+  (ebnf-log "   one-or-more width  : %7.3f" (ebnf-node-width  or-more)))
 
 
 ;; [zero-or-more width-fun dim-fun entry height width element separator]
 (defun ebnf-zero-or-more-dimension (or-more)
+  (ebnf-log "(ebnf-zero-or-more-dimension or-more)")
   (let ((list-part (ebnf-node-list or-more))
        (sep-part  (ebnf-node-separator or-more)))
     (ebnf-node-dimension-func list-part)
@@ -5319,7 +5776,7 @@ killed after process termination."
         (ebnf-node-dimension-func sep-part))
     (let ((height (+ (if sep-part
                         (ebnf-node-height sep-part)
-                      0.0)
+                      ebnf-basic-empty-height)
                     ebnf-vertical-space
                     (ebnf-node-height list-part)
                     ebnf-vertical-space))
@@ -5332,11 +5789,17 @@ killed after process termination."
        (ebnf-adjust-width sep-part width))
       (ebnf-node-entry  or-more height)
       (ebnf-node-height or-more height)
-      (ebnf-node-width  or-more (+ width ebnf-horizontal-space)))))
+      (ebnf-node-width  or-more (+ width
+                                  ebnf-horizontal-space
+                                  ebnf-basic-width-extra))))
+  (ebnf-log "   zero-or-more entry  : %7.3f" (ebnf-node-entry  or-more))
+  (ebnf-log "   zero-or-more height : %7.3f" (ebnf-node-height or-more))
+  (ebnf-log "   zero-or-more width  : %7.3f" (ebnf-node-width  or-more)))
 
 
 ;; [sequence width-fun dim-fun entry height width list]
 (defun ebnf-sequence-dimension (sequence)
+  (ebnf-log "(ebnf-sequence-dimension sequence)")
   (let ((above 0.0)
        (below 0.0)
        (width 0.0)
@@ -5352,7 +5815,10 @@ killed after process termination."
            width (+ width (ebnf-node-width node))))
     (ebnf-node-entry  sequence above)
     (ebnf-node-height sequence (+ above below))
-    (ebnf-node-width  sequence width)))
+    (ebnf-node-width  sequence width))
+  (ebnf-log "   sequence entry  : %7.3f" (ebnf-node-entry  sequence))
+  (ebnf-log "   sequence height : %7.3f" (ebnf-node-height sequence))
+  (ebnf-log "   sequence width  : %7.3f" (ebnf-node-width  sequence)))
 
 \f
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -5494,7 +5960,8 @@ killed after process termination."
   (let ((filename (ebnf-eps-filename name)))
     (if (member filename ebnf-eps-context)
        (error "Try to open an already opened EPS file: %s" filename)
-      (setq ebnf-eps-context (cons filename ebnf-eps-context)))))
+      (setq ebnf-eps-context (cons filename ebnf-eps-context)))
+    (ebnf-eps-header-footer-file filename)))
 
 
 (defun ebnf-eps-remove-context (name)
@@ -5505,14 +5972,16 @@ killed after process termination."
 
 
 (defun ebnf-eps-add-production (header)
-  (and ebnf-eps-executing
-       ebnf-eps-context
-       (let ((prod (assoc header ebnf-eps-production-list)))
-        (if prod
-            (setcdr prod (append ebnf-eps-context (cdr prod)))
-          (setq ebnf-eps-production-list
-                (cons (cons header (ebnf-dup-list ebnf-eps-context))
-                      ebnf-eps-production-list))))))
+  (when ebnf-eps-executing
+    (if ebnf-eps-context
+       (let ((prod (assoc header ebnf-eps-production-list)))
+         (if prod
+             (setcdr prod (ebnf-dup-list
+                           (append ebnf-eps-context (cdr prod))))
+           (setq ebnf-eps-production-list
+                 (cons (cons header (ebnf-dup-list ebnf-eps-context))
+                       ebnf-eps-production-list))))
+      (ebnf-eps-header-footer-file (ebnf-eps-filename header)))))
 
 
 (defun ebnf-dup-list (old)
@@ -5567,7 +6036,9 @@ killed after process termination."
 (defun ebnf-trim-right (str)
   (let* ((len   (1- (length str)))
         (index len))
-    (while (and (> index 0) (= (aref str index) ?\s))
+    ;; to keep compatibility with Emacs 20 & 21:
+    ;; DO NOT REPLACE `?\ ' BY `?\s'
+    (while (and (> index 0) (= (aref str index) ?\ ))
       (setq index (1- index)))
     (if (= index len)
        str
@@ -5579,12 +6050,12 @@ killed after process termination."
 
 
 (defun ebnf-make-empty (&optional width)
-  (vector 'ebnf-generate-empty
-         'ignore
-         'ignore
-         0.0
-         0.0
-         (or width ebnf-horizontal-space)))
+  (vector 'ebnf-generate-empty         ; 0 generator
+         'ignore                       ; 1 width fun
+         'ignore                       ; 2 dimension fun
+         0.0                           ; 3 entry
+         0.0                           ; 4 height
+         (or width ebnf-horizontal-space))) ; 5 width
 
 
 (defun ebnf-make-terminal (name)
@@ -5606,19 +6077,19 @@ killed after process termination."
 
 
 (defun ebnf-make-terminal1 (name gen-func dim-func)
-  (vector gen-func
-         'ignore
-         dim-func
-         0.0
-         0.0
-         0.0
-         (let ((len (length name)))
+  (vector gen-func                     ; 0 generatore
+         'ignore                       ; 1 width fun
+         dim-func                      ; 2 dimension fun
+         0.0                           ; 3 entry
+         0.0                           ; 4 height
+         0.0                           ; 5 width
+         (let ((len (length name)))    ; 6 name
            (cond ((> len 3) name)
                  ((= len 3) (concat name " "))
                  ((= len 2) (concat " " name " "))
                  ((= len 1) (concat " " name "  "))
                  (t         "    ")))
-         ebnf-default-p))
+         ebnf-default-p))              ; 7 is default?
 
 
 (defun ebnf-make-one-or-more (list-part &optional sep-part)
@@ -5636,70 +6107,71 @@ killed after process termination."
 
 
 (defun ebnf-make-or-more1 (gen-func dim-func list-part sep-part)
-  (vector gen-func
-         'ebnf-element-width
-         dim-func
-         0.0
-         0.0
-         0.0
-         (if (listp list-part)
+  (vector gen-func                     ; 0 generator
+         'ebnf-element-width           ; 1 width fun
+         dim-func                      ; 2 dimension fun
+         0.0                           ; 3 entry
+         0.0                           ; 4 height
+         0.0                           ; 5 width
+         (if (listp list-part)         ; 6 element
              (ebnf-make-sequence list-part)
            list-part)
-         (if (and sep-part (listp sep-part))
+         (if (and sep-part (listp sep-part)) ; 7 separator
              (ebnf-make-sequence sep-part)
            sep-part)))
 
 
 (defun ebnf-make-production (name prod action)
-  (vector 'ebnf-generate-production
-         'ignore
-         'ebnf-production-dimension
-         0.0
-         0.0
-         0.0
-         name
-         prod
-         action))
+  (vector 'ebnf-generate-production    ; 0 generator
+         'ignore                       ; 1 width fun
+         'ebnf-production-dimension    ; 2 dimension fun
+         0.0                           ; 3 entry
+         0.0                           ; 4 height
+         0.0                           ; 5 width
+         name                          ; 6 production name
+         prod                          ; 7 production body
+         action))                      ; 8 production action
 
 
 (defun ebnf-make-alternative (body)
-  (vector 'ebnf-generate-alternative
-         'ebnf-alternative-width
-         'ebnf-alternative-dimension
-         0.0
-         0.0
-         0.0
-         body))
+  (vector 'ebnf-generate-alternative   ; 0 generator
+         'ebnf-alternative-width       ; 1 width fun
+         'ebnf-alternative-dimension   ; 2 dimension fun
+         0.0                           ; 3 entry
+         0.0                           ; 4 height
+         0.0                           ; 5 width
+         body))                        ; 6 alternative list
 
 
 (defun ebnf-make-optional (body)
-  (vector 'ebnf-generate-optional
-         'ebnf-alternative-width
-         'ebnf-optional-dimension
-         0.0
-         0.0
-         0.0
-         body))
+  (vector 'ebnf-generate-optional      ; 0 generator
+         'ebnf-alternative-width       ; 1 width fun
+         'ebnf-optional-dimension      ; 2 dimension fun
+         0.0                           ; 3 entry
+         0.0                           ; 4 height
+         0.0                           ; 5 width
+         body))                        ; 6 optional element
 
 
 (defun ebnf-make-except (factor exception)
-  (vector 'ebnf-generate-except
-         'ignore
-         'ebnf-except-dimension
-         0.0
-         0.0
-         0.0
-         factor
-         exception))
+  (vector 'ebnf-generate-except                ; 0 generator
+         'ignore                       ; 1 width fun
+         'ebnf-except-dimension        ; 2 dimension fun
+         0.0                           ; 3 entry
+         0.0                           ; 4 height
+         0.0                           ; 5 width
+         factor                        ; 6 base element
+         exception))                   ; 7 exception element
 
 
 (defun ebnf-make-repeat (times primary &optional upper)
-  (vector 'ebnf-generate-repeat
-         'ignore
-         'ebnf-repeat-dimension
-         0.0
-         0.0
-         0.0
+  (vector 'ebnf-generate-repeat                ; 0 generator
+         'ignore                       ; 1 width fun
+         'ebnf-repeat-dimension        ; 2 dimension fun
+         0.0                           ; 3 entry
+         0.0                           ; 4 height
+         0.0                           ; 5 width
+                                       ; 6 times
          (cond ((and times upper)      ; L * U, L * L
                 (if (string= times upper)
                     (if (string= times "")
@@ -5712,27 +6184,27 @@ killed after process termination."
                 (concat "* " upper))
                (t                      ; *
                 " * "))
-         primary))
+         primary))                     ; 7 element
 
 
 (defun ebnf-make-sequence (seq)
-  (vector 'ebnf-generate-sequence
-         'ebnf-sequence-width
-         'ebnf-sequence-dimension
-         0.0
-         0.0
-         0.0
-         seq))
+  (vector 'ebnf-generate-sequence      ; 0 generator
+         'ebnf-sequence-width          ; 1 width fun
+         'ebnf-sequence-dimension      ; 2 dimension fun
+         0.0                           ; 3 entry
+         0.0                           ; 4 height
+         0.0                           ; 5 width
+         seq))                         ; 6 sequence
 
 
 (defun ebnf-make-dup-sequence (node seq)
-  (vector 'ebnf-generate-sequence
-         'ebnf-sequence-width
-         'ebnf-sequence-dimension
-          (ebnf-node-entry node)
-          (ebnf-node-height node)
-          (ebnf-node-width node)
-          seq))
+  (vector 'ebnf-generate-sequence      ; 0 generator
+         'ebnf-sequence-width          ; 1 width fun
+         'ebnf-sequence-dimension      ; 2 dimension fun
+         (ebnf-node-entry node)        ; 3 entry
+         (ebnf-node-height node)       ; 4 height
+         (ebnf-node-width node)        ; 5 width
+         seq))                         ; 6 sequence
 
 \f
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -5819,13 +6291,17 @@ killed after process termination."
 (defun ebnf-token-alternative (body sequence)
   (if (null body)
       (if (cdr sequence)
+         ;; no alternative
          sequence
-       (cons (car sequence)
+       ;; empty element
+       (cons (car sequence)            ; token
              (ebnf-make-empty)))
-    (cons (car sequence)
+    (cons (car sequence)               ; token
          (let ((seq (cdr sequence)))
            (if (and (= (length body) 1) (null seq))
+               ;; alternative with one element
                (car body)
+             ;; a real alternative
              (ebnf-make-alternative (nreverse (if seq
                                                   (cons seq body)
                                                 body))))))))
@@ -5859,6 +6335,28 @@ killed after process termination."
   "Vector used to map characters to a special comment token.")
 
 \f
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Log message
+
+
+(defun ebnf-log-header (format-str &rest args)
+  (when ebnf-log
+    (apply
+     'ebnf-log
+     (concat
+      "\n\n===============================================================\n\n"
+      format-str)
+     args)))
+
+
+(defun ebnf-log (format-str &rest args)
+  (when ebnf-log
+    (save-excursion
+      (set-buffer (get-buffer-create "*Ebnf2ps Log*"))
+      (goto-char (point-max))
+      (insert (apply 'format format-str args) "\n"))))
+
+\f
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; To make this file smaller, some commands go in a separate file.
 ;; But autoload them here to make the separation invisible.
index 99e5fb5..5538bd8 100644 (file)
@@ -325,11 +325,6 @@ Return nil if we cannot, non-nil if we can."
   (or (nth 2 (flymake-get-file-name-mode-and-masks file-name))
       'flymake-get-real-file-name))
 
-(defcustom flymake-buildfile-dirs '("." ".." "../.." "../../.." "../../../.." "../../../../.." "../../../../../.." "../../../../../../.." "../../../../../../../.." "../../../../../../../../.." "../../../../../../../../../.." "../../../../../../../../../../..")
-  "Dirs to look for buildfile."
-  :group 'flymake
-  :type '(repeat (string)))
-
 (defvar flymake-find-buildfile-cache (flymake-makehash 'equal))
 
 (defun flymake-get-buildfile-from-cache (dir-name)
@@ -346,19 +341,15 @@ Return nil if we cannot, non-nil if we can."
 Buildfile includes Makefile, build.xml etc.
 Return its file name if found, or nil if not found."
   (or (flymake-get-buildfile-from-cache source-dir-name)
-      (let* ((dirs flymake-buildfile-dirs)
-             (buildfile-dir          nil)
-             (found                  nil))
-        (while (and (not found) dirs)
-          (setq buildfile-dir (concat source-dir-name (car dirs)))
-          (when (file-exists-p (expand-file-name buildfile-name buildfile-dir))
-            (setq found t))
-          (setq dirs (cdr dirs)))
-        (if found
+      (let* ((file (locate-dominating-file
+                    source-dir-name
+                    (concat "\\`" (regexp-quote buildfile-name) "\\'"))))
+        (if file
             (progn
-              (flymake-log 3 "found buildfile at %s/%s" buildfile-dir buildfile-name)
-              (flymake-add-buildfile-to-cache source-dir-name buildfile-dir)
-              buildfile-dir)
+              (flymake-log 3 "found buildfile at %s" file)
+              (setq file (file-name-directory file))
+              (flymake-add-buildfile-to-cache source-dir-name file)
+              file)
           (progn
             (flymake-log 3 "buildfile for %s not found" source-dir-name)
             nil)))))
index 16992c5..bcb571f 100644 (file)
@@ -1,7 +1,8 @@
 ;;; fortran.el --- Fortran mode for GNU Emacs
 
 ;; Copyright (C) 1986, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001,
-;;               2002, 2003, 2004, 2005, 2006, 2007  Free Software Foundation, Inc.
+;;               2002, 2003, 2004, 2005, 2006, 2007
+;;               Free Software Foundation, Inc.
 
 ;; Author: Michael D. Prange <prange@erl.mit.edu>
 ;; Maintainer: Glenn Morris <rgm@gnu.org>
   :group  'fortran)
 
 
-;;;###autoload
 (defcustom fortran-tab-mode-default nil
-  "*Default tabbing/carriage control style for empty files in Fortran mode.
+  "Default tabbing/carriage control style for empty files in Fortran mode.
 A non-nil value specifies tab-digit style of continuation control.
 A value of nil specifies that continuation lines are marked
 with a character in column 6."
   :type  'boolean
   :group 'fortran-indent)
 
-(defcustom fortran-tab-mode-string "/t"
-  "*String to appear in mode line in TAB format buffers."
+;; TODO add more detail of what tab mode is to doc string.
+(defcustom fortran-tab-mode-string
+  (propertize "/t" 'help-echo "This buffer is in Fortran TAB mode"
+              'mouse-face 'mode-line-highlight
+              'local-map
+              (make-mode-line-mouse-map 'mouse-1
+                                        (lambda ()
+                                          (interactive)
+                                          (describe-variable
+                                           'fortran-tab-mode-string))))
+  "String to appear in mode line in TAB format buffers."
   :type  'string
   :group 'fortran-indent)
 
+(put 'fortran-tab-mode-string 'risky-local-variable t)
+
 (defcustom fortran-do-indent 3
-  "*Extra indentation applied to DO blocks."
+  "Extra indentation applied to DO blocks."
   :type  'integer
   :group 'fortran-indent)
 
 (defcustom fortran-if-indent 3
-  "*Extra indentation applied to IF, SELECT CASE and WHERE blocks."
+  "Extra indentation applied to IF, SELECT CASE and WHERE blocks."
   :type  'integer
   :group 'fortran-indent)
 
 (defcustom fortran-structure-indent 3
-  "*Extra indentation applied to STRUCTURE, UNION, MAP and INTERFACE blocks."
+  "Extra indentation applied to STRUCTURE, UNION, MAP and INTERFACE blocks."
   :type  'integer
   :group 'fortran-indent)
 
 (defcustom fortran-continuation-indent 5
-  "*Extra indentation applied to continuation lines."
+  "Extra indentation applied to continuation lines."
   :type  'integer
   :group 'fortran-indent)
 
 (defcustom fortran-comment-indent-style 'fixed
-  "*How to indent comments.
+  "How to indent comments.
 nil forces comment lines not to be touched;
 `fixed' indents to `fortran-comment-line-extra-indent' columns beyond
   `fortran-minimum-statement-indent-fixed' (if `indent-tabs-mode' nil), or
@@ -124,13 +135,13 @@ nil forces comment lines not to be touched;
   :group 'fortran-indent)
 
 (defcustom fortran-comment-line-extra-indent 0
-  "*Amount of extra indentation for text within full-line comments."
+  "Amount of extra indentation for text within full-line comments."
   :type  'integer
   :group 'fortran-indent
   :group 'fortran-comment)
 
 (defcustom fortran-comment-line-start "C"
-  "*Delimiter inserted to start new full-line comment.
+  "Delimiter inserted to start new full-line comment.
 You might want to change this to \"*\", for instance."
   :version "21.1"
   :type    'string
@@ -147,7 +158,7 @@ You might want to change this to \"*\", for instance."
 
 (defcustom fortran-directive-re
   "^[ \t]*#.*"
-  "*Regexp to match a directive line.
+  "Regexp to match a directive line.
 The matching text will be fontified with `font-lock-keyword-face'.
 The matching line will be given zero indentation."
   :version "22.1"
@@ -155,12 +166,12 @@ The matching line will be given zero indentation."
   :group   'fortran-indent)
 
 (defcustom fortran-minimum-statement-indent-fixed 6
-  "*Minimum statement indentation for fixed format continuation style."
+  "Minimum statement indentation for fixed format continuation style."
   :type  'integer
   :group 'fortran-indent)
 
 (defcustom fortran-minimum-statement-indent-tab (max tab-width 6)
-  "*Minimum statement indentation for TAB format continuation style."
+  "Minimum statement indentation for TAB format continuation style."
   :type  'integer
   :group 'fortran-indent)
 
@@ -168,30 +179,30 @@ The matching line will be given zero indentation."
 ;; of length one rather than a single character.
 ;; The code in this file accepts either format for compatibility.
 (defcustom fortran-comment-indent-char " "
-  "*Single-character string inserted for Fortran comment indentation.
+  "Single-character string inserted for Fortran comment indentation.
 Normally a space."
   :type  'string
   :group 'fortran-comment)
 
 (defcustom fortran-line-number-indent 1
-  "*Maximum indentation for Fortran line numbers.
+  "Maximum indentation for Fortran line numbers.
 5 means right-justify them within their five-column field."
   :type  'integer
   :group 'fortran-indent)
 
 (defcustom fortran-check-all-num-for-matching-do nil
-  "*Non-nil causes all numbered lines to be treated as possible DO loop ends."
+  "Non-nil causes all numbered lines to be treated as possible DO loop ends."
   :type  'boolean
   :group 'fortran)
 
 (defcustom fortran-blink-matching-if nil
-  "*Non-nil causes \\[fortran-indent-line] on ENDIF to blink on matching IF.
+  "Non-nil causes \\[fortran-indent-line] on ENDIF to blink on matching IF.
 Also, from an ENDDO statement blink on matching DO [WHILE] statement."
   :type  'boolean
   :group 'fortran)
 
 (defcustom fortran-continuation-string "$"
-  "*Single-character string used for Fortran continuation lines.
+  "Single-character string used for Fortran continuation lines.
 In fixed format continuation style, this character is inserted in
 column 6 by \\[fortran-split-line] to begin a continuation line.
 Also, if \\[fortran-indent-line] finds this at the beginning of a
@@ -201,16 +212,17 @@ appropriate style. Normally $."
   :group 'fortran)
 
 (defcustom fortran-comment-region "c$$$"
-  "*String inserted by \\[fortran-comment-region] at start of each \
+  "String inserted by \\[fortran-comment-region] at start of each \
 line in region."
   :type  'string
   :group 'fortran-comment)
 
 (defcustom fortran-electric-line-number t
-  "*Non-nil causes line numbers to be moved to the correct column as typed."
+  "Non-nil causes line numbers to be moved to the correct column as typed."
   :type  'boolean
   :group 'fortran)
 
+;; TODO use fortran-line-length, somehow.
 (defcustom fortran-column-ruler-fixed
   "0   4 6  10        20        30        40        5\
 0        60        70\n\
@@ -222,6 +234,7 @@ See the variable `fortran-column-ruler-tab' for TAB format mode."
   :type  'string
   :group 'fortran)
 
+;; TODO use fortran-line-length, somehow.
 (defcustom fortran-column-ruler-tab
   "0       810        20        30        40        5\
 0        60        70\n\
@@ -239,11 +252,38 @@ See the variable `fortran-column-ruler-fixed' for fixed format mode."
   :group 'fortran)
 
 (defcustom fortran-break-before-delimiters t
-  "*Non-nil causes filling to break lines before delimiters.
+  "Non-nil causes filling to break lines before delimiters.
 Delimiters are characters matching the regexp `fortran-break-delimiters-re'."
   :type  'boolean
   :group 'fortran)
 
+;; TODO 0 as no-limit, as per g77.
+(defcustom fortran-line-length 72
+  "Maximum number of characters in a line of fixed-form Fortran code.
+Characters beyond this point are treated as comments.  Setting
+this variable directly (after fortran mode is loaded) does not
+take effect.  Use either \\[customize] (which affects all Fortran
+buffers and the default) or the function
+`fortran-line-length' (which can also operate on just the current
+buffer).  This corresponds to the g77 compiler option
+`-ffixed-line-length-N'."
+  :type 'integer
+  :initialize 'custom-initialize-default
+  :set (lambda (symbol value)
+         ;; Do all fortran buffers, and the default.
+         (fortran-line-length value t))
+  :version "23.1"
+  :group 'fortran)
+
+(put 'fortran-line-length 'safe-local-variable 'integerp)
+(make-variable-buffer-local 'fortran-line-length)
+
+(defcustom fortran-mode-hook nil
+  "Hook run when entering Fortran mode."
+  :type  'hook
+  :group 'fortran)
+
+\f
 (defconst fortran-break-delimiters-re "[-+*/><=, \t]"
   "Regexp matching delimiter characters at which lines may be broken.
 There are certain tokens comprised entirely of characters
@@ -259,22 +299,16 @@ characters matching the regexp `fortran-break-delimiters-re' that should
 not be split by filling.  Each element is assumed to be two
 characters long.")
 
-(defcustom fortran-mode-hook nil
-  "Hook run when entering Fortran mode."
-  :type  'hook
-  :group 'fortran)
-
-\f
-(defvar fortran-if-start-re "\\(\\(\\sw\\|\\s_\\)+:[ \t]*\\)?if[ \t]*("
+(defconst fortran-if-start-re "\\(\\(\\sw\\|\\s_\\)+:[ \t]*\\)?if[ \t]*("
   "Regexp matching the start of an IF statement.")
 
-(defvar fortran-end-prog-re1
+(defconst fortran-end-prog-re1
   "end\
 \\([ \t]*\\(program\\|subroutine\\|function\\|block[ \t]*data\\)\\>\
 \\([ \t]*\\(\\sw\\|\\s_\\)+\\)?\\)?"
   "Regexp possibly matching the end of a subprogram.")
 
-(defvar fortran-end-prog-re
+(defconst fortran-end-prog-re
   (concat "^[ \t0-9]*" fortran-end-prog-re1)
   "Regexp possibly matching the end of a subprogram, from the line start.
 See also `fortran-end-prog-re1'.")
@@ -402,11 +436,13 @@ Consists of level 3 plus all other intrinsics not already highlighted.")
 ;; (We can do so for F90-style).  Therefore an unmatched quote in a
 ;; standard comment will throw fontification off on the wrong track.
 ;; So we do syntactic fontification with regexps.
-(defvar fortran-font-lock-syntactic-keywords
-  '(("^[cd\\*]" 0 (11))
-    ("^[^cd\\*\t\n].\\{71\\}\\([^\n]+\\)" 1 (11)))
-  "`font-lock-syntactic-keywords' for Fortran.
-These get fixed-format comments fontified.")
+(defun fortran-font-lock-syntactic-keywords ()
+  "Return a value for `font-lock-syntactic-keywords' in Fortran mode.
+This varies according to the value of `fortran-line-length'.
+This is used to fontify fixed-format Fortran comments."
+  `(("^[cd\\*]" 0 (11))
+    (,(format "^[^cd\\*\t\n].\\{%d\\}\\([^\n]+\\)" (1- fortran-line-length))
+     1 (11))))
 
 (defvar fortran-font-lock-keywords fortran-font-lock-keywords-1
   "Default expressions to highlight in Fortran mode.")
@@ -582,6 +618,8 @@ Used in the Fortran entry in `hs-special-modes-alist'.")
         ["Widen" widen t]
         "--"
         ["Temporary column ruler" fortran-column-ruler  t]
+        ;; May not be '72', depending on fortran-line-length, but this
+        ;; seems ok for a menu item.
         ["72-column window"       fortran-window-create t]
         ["Full Width Window"
          (enlarge-window-horizontally (- (frame-width) (window-width)))
@@ -780,7 +818,7 @@ with no args, if that value is non-nil."
   (set (make-local-variable 'normal-auto-fill-function) 'fortran-auto-fill)
   (set (make-local-variable 'indent-tabs-mode) (fortran-analyze-file-format))
   (setq mode-line-process '(indent-tabs-mode fortran-tab-mode-string))
-  (set (make-local-variable 'fill-column) 72)
+  (set (make-local-variable 'fill-column) fortran-line-length)
   (set (make-local-variable 'fill-paragraph-function) 'fortran-fill-paragraph)
   (set (make-local-variable 'font-lock-defaults)
        '((fortran-font-lock-keywords
@@ -791,7 +829,7 @@ with no args, if that value is non-nil."
          nil t ((?/ . "$/") ("_$" . "w"))
          fortran-beginning-of-subprogram))
   (set (make-local-variable 'font-lock-syntactic-keywords)
-       fortran-font-lock-syntactic-keywords)
+       (fortran-font-lock-syntactic-keywords))
   (set (make-local-variable 'imenu-case-fold-search) t)
   (set (make-local-variable 'imenu-generic-expression)
        fortran-imenu-generic-expression)
@@ -804,9 +842,38 @@ with no args, if that value is non-nil."
        #'fortran-current-defun)
   (set (make-local-variable 'dabbrev-case-fold-search) 'case-fold-search)
   (set (make-local-variable 'gud-find-expr-function) 'fortran-gud-find-expr)
+  (add-hook 'hack-local-variables-hook 'fortran-hack-local-variables nil t)
   (run-mode-hooks 'fortran-mode-hook))
 
 \f
+(defun fortran-line-length (nchars &optional global)
+  "Set the length of fixed-form Fortran lines to NCHARS.
+This normally only affects the current buffer, which must be in
+Fortran mode.  If the optional argument GLOBAL is non-nil, it
+affects all Fortran buffers, and also the default."
+  (interactive "p")
+  (let (new)
+    (mapcar (lambda (buff)
+              (with-current-buffer buff
+                (when (eq major-mode 'fortran-mode)
+                  (setq fortran-line-length nchars
+                        fill-column fortran-line-length
+                        new (fortran-font-lock-syntactic-keywords))
+                  ;; Refontify only if necessary.
+                  (unless (equal new font-lock-syntactic-keywords)
+                    (setq font-lock-syntactic-keywords
+                          (fortran-font-lock-syntactic-keywords))
+                    (if font-lock-mode (font-lock-mode 1))))))
+            (if global
+                (buffer-list)
+              (list (current-buffer))))
+    (if global
+        (setq-default fortran-line-length nchars))))
+
+(defun fortran-hack-local-variables ()
+  "Fortran mode adds this to `hack-local-variables-hook'."
+  (fortran-line-length fortran-line-length))
+
 (defun fortran-gud-find-expr ()
   ;; Consider \n as punctuation (end of expression).
   (with-syntax-table fortran-gud-syntax-table
@@ -940,7 +1007,7 @@ The next key typed is executed unless it is SPC."
    nil "Type SPC or any command to erase ruler."))
 
 (defun fortran-window-create ()
-  "Make the window 72 columns wide.
+  "Make the window `fortran-line-length' (default 72) columns wide.
 See also `fortran-window-create-momentarily'."
   (interactive)
   (let ((window-min-width 2))
@@ -951,13 +1018,13 @@ See also `fortran-window-create-momentarily'."
           (scroll-bar-width (- (nth 2 window-edges)
                                (car window-edges)
                                (window-width))))
-      (split-window-horizontally (+ 72 scroll-bar-width)))
+      (split-window-horizontally (+ fortran-line-length scroll-bar-width)))
     (other-window 1)
     (switch-to-buffer " fortran-window-extra" t)
     (select-window (previous-window))))
 
 (defun fortran-window-create-momentarily (&optional arg)
-  "Momentarily make the window 72 columns wide.
+  "Momentarily make the window `fortran-line-length' (default 72) columns wide.
 Optional ARG non-nil and non-unity disables the momentary feature.
 See also `fortran-window-create'."
   (interactive "p")
@@ -1065,7 +1132,8 @@ Auto-indent does not happen if a numeric ARG is used."
     (string-match "^\\s-*\\(\\'\\|\\s<\\)"
                  (buffer-substring (match-end 0)
                                    (min (line-end-position)
-                                        (+ 72 (line-beginning-position)))))))
+                                        (+ fortran-line-length
+                                            (line-beginning-position)))))))
 
 ;; Note that you can't just check backwards for `subroutine' &c in
 ;; case of un-marked main programs not at the start of the file.
@@ -1996,13 +2064,15 @@ Always returns non-nil (to prevent `fill-paragraph' being called)."
     (fortran-indent-line)))
 
 (defun fortran-strip-sequence-nos (&optional do-space)
-  "Delete all text in column 72 and up (assumed to be sequence numbers).
-Normally also deletes trailing whitespace after stripping such text.
-Supplying prefix arg DO-SPACE prevents stripping the whitespace."
+  "Delete all text in column `fortran-line-length' (default 72) and up.
+This is assumed to be sequence numbers.  Normally also deletes
+trailing whitespace after stripping such text.  Supplying prefix
+arg DO-SPACE prevents stripping the whitespace."
   (interactive "*p")
   (save-excursion
     (goto-char (point-min))
-    (while (re-search-forward "^.\\{72\\}\\(.*\\)" nil t)
+    (while (re-search-forward (format "^.\\{%d\\}\\(.*\\)" fortran-line-length)
+                              nil t)
       (replace-match "" nil nil nil 1)
       (unless do-space (delete-horizontal-space)))))
 
index 716b791..c4d1446 100644 (file)
@@ -1132,10 +1132,10 @@ This filter may simply queue input for a later time."
          (let ((item (concat string "\n")))
            (if gdb-enable-debug (push (cons 'send item) gdb-debug-log))
            (process-send-string proc item)))
-      (if (string-match "\\\\\\'" string)
+      (if (and (string-match "\\\\$" string)
+              (not comint-input-sender-no-newline)) ;;Try to catch C-d.
          (setq gdb-continuation (concat gdb-continuation string "\n"))
-       (let ((item (concat gdb-continuation string
-                        (if (not comint-input-sender-no-newline) "\n"))))
+       (let ((item (concat gdb-continuation string "\n")))
          (gdb-enqueue-input item)
          (setq gdb-continuation nil)))))
 
index baa59c7..bafe42b 100644 (file)
@@ -343,6 +343,12 @@ This variable's value takes effect when `grep-compute-defaults' is called.")
 (defvar grep-regexp-history nil)
 (defvar grep-files-history '("ch" "el"))
 
+(defvar grep-host-defaults-alist nil
+  "Default values depending on target host.
+`grep-compute-defaults' returns default values for every local or
+remote host `grep' runs.  These values can differ from host to
+host.  Once computed, the default values are kept here in order
+to avoid computing them again.")
 
 ;;;###autoload
 (defun grep-process-setup ()
@@ -371,92 +377,153 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'."
 
 (defun grep-probe (command args &optional func result)
   (equal (condition-case nil
-            (apply (or func 'call-process) command args)
+            (apply (or func 'process-file) command args)
           (error nil))
         (or result 0)))
 
 ;;;###autoload
 (defun grep-compute-defaults ()
-  (unless (or (not grep-use-null-device) (eq grep-use-null-device t))
-    (setq grep-use-null-device
-         (with-temp-buffer
-           (let ((hello-file (expand-file-name "HELLO" data-directory)))
-             (not
-              (and (if grep-command
-                       ;; `grep-command' is already set, so
-                       ;; use that for testing.
-                       (grep-probe grep-command
-                                   `(nil t nil "^English" ,hello-file)
-                                   #'call-process-shell-command)
-                     ;; otherwise use `grep-program'
-                     (grep-probe grep-program
-                                 `(nil t nil "-nH" "^English" ,hello-file)))
-                   (progn
-                     (goto-char (point-min))
-                     (looking-at
-                      (concat (regexp-quote hello-file)
-                              ":[0-9]+:English")))))))))
-  (unless (and grep-command grep-find-command
-              grep-template grep-find-template)
-    (let ((grep-options
-          (concat (if grep-use-null-device "-n" "-nH")
-                  (if (grep-probe grep-program
-                                  `(nil nil nil "-e" "foo" ,null-device)
-                                  nil 1)
-                      " -e"))))
-      (unless grep-command
-       (setq grep-command
-             (format "%s %s " grep-program grep-options)))
-      (unless grep-template
-       (setq grep-template
-             (format "%s <C> %s <R> <F>" grep-program grep-options)))
-      (unless grep-find-use-xargs
-       (setq grep-find-use-xargs
-             (cond
-              ((and
-                (grep-probe find-program `(nil nil nil ,null-device "-print0"))
-                (grep-probe "xargs" `(nil nil nil "-0" "-e" "echo")))
-               'gnu)
-              (t
-               'exec))))
-      (unless grep-find-command
-       (setq grep-find-command
-             (cond ((eq grep-find-use-xargs 'gnu)
-                    (format "%s . -type f -print0 | xargs -0 -e %s"
-                            find-program grep-command))
-                   ((eq grep-find-use-xargs 'exec)
-                    (let ((cmd0 (format "%s . -type f -exec %s"
-                                        find-program grep-command)))
-                      (cons
-                       (format "%s {} %s %s"
-                               cmd0 null-device
-                               (shell-quote-argument ";"))
-                       (1+ (length cmd0)))))
-                   (t
-                    (format "%s . -type f -print | xargs %s"
-                            find-program grep-command)))))
-      (unless grep-find-template
-       (setq grep-find-template
-             (let ((gcmd (format "%s <C> %s <R>"
-                                 grep-program grep-options)))
+  ;; Keep default values.
+  (unless grep-host-defaults-alist
+    (add-to-list
+     'grep-host-defaults-alist
+     (cons nil
+          `((grep-command ,grep-command)
+            (grep-template ,grep-template)
+            (grep-use-null-device ,grep-use-null-device)
+            (grep-find-command ,grep-find-command)
+            (grep-find-template ,grep-find-template)
+            (grep-find-use-xargs ,grep-find-use-xargs)
+            (grep-highlight-matches ,grep-highlight-matches)))))
+  (let* ((host-id
+         (intern (or (file-remote-p default-directory 'host) "localhost")))
+        (host-defaults (assq host-id grep-host-defaults-alist))
+        (defaults (assq nil grep-host-defaults-alist)))
+    ;; There are different defaults on different hosts.  They must be
+    ;; computed for every host once.
+    (setq grep-command
+         (or (cadr (assq 'grep-command host-defaults))
+             (cadr (assq 'grep-command defaults)))
+
+         grep-template
+          (or (cadr (assq 'grep-template host-defaults))
+             (cadr (assq 'grep-template defaults)))
+
+         grep-use-null-device
+         (or (cadr (assq 'grep-use-null-device host-defaults))
+             (cadr (assq 'grep-use-null-device defaults)))
+
+         grep-find-command
+         (or (cadr (assq 'grep-find-command host-defaults))
+             (cadr (assq 'grep-find-command defaults)))
+
+         grep-find-template
+         (or (cadr (assq 'grep-find-template host-defaults))
+             (cadr (assq 'grep-find-template defaults)))
+
+         grep-find-use-xargs
+         (or (cadr (assq 'grep-find-use-xargs host-defaults))
+             (cadr (assq 'grep-find-use-xargs defaults)))
+
+         grep-highlight-matches
+         (or (cadr (assq 'grep-highlight-matches host-defaults))
+             (cadr (assq 'grep-highlight-matches defaults))))
+
+    (unless (or (not grep-use-null-device) (eq grep-use-null-device t))
+      (setq grep-use-null-device
+           (with-temp-buffer
+             (let ((hello-file (expand-file-name "HELLO" data-directory)))
+               (not
+                (and (if grep-command
+                         ;; `grep-command' is already set, so
+                         ;; use that for testing.
+                         (grep-probe grep-command
+                                     `(nil t nil "^English" ,hello-file)
+                                     #'call-process-shell-command)
+                       ;; otherwise use `grep-program'
+                       (grep-probe grep-program
+                                   `(nil t nil "-nH" "^English" ,hello-file)))
+                     (progn
+                       (goto-char (point-min))
+                       (looking-at
+                        (concat (regexp-quote hello-file)
+                                ":[0-9]+:English")))))))))
+    (unless (and grep-command grep-find-command
+                grep-template grep-find-template)
+      (let ((grep-options
+            (concat (if grep-use-null-device "-n" "-nH")
+                    (if (grep-probe grep-program
+                                    `(nil nil nil "-e" "foo" ,null-device)
+                                    nil 1)
+                        " -e"))))
+       (unless grep-command
+         (setq grep-command
+               (format "%s %s " grep-program grep-options)))
+       (unless grep-template
+         (setq grep-template
+               (format "%s <C> %s <R> <F>" grep-program grep-options)))
+       (unless grep-find-use-xargs
+         (setq grep-find-use-xargs
+               (cond
+                ((and
+                  (grep-probe find-program `(nil nil nil ,null-device "-print0"))
+                  (grep-probe "xargs" `(nil nil nil "-0" "-e" "echo")))
+                 'gnu)
+                (t
+                 'exec))))
+       (unless grep-find-command
+         (setq grep-find-command
                (cond ((eq grep-find-use-xargs 'gnu)
-                      (format "%s . <X> -type f <F> -print0 | xargs -0 -e %s"
-                              find-program gcmd))
+                      (format "%s . -type f -print0 | xargs -0 -e %s"
+                              find-program grep-command))
                      ((eq grep-find-use-xargs 'exec)
-                      (format "%s . <X> -type f <F> -exec %s {} %s %s"
-                              find-program gcmd null-device
-                              (shell-quote-argument ";")))
+                      (let ((cmd0 (format "%s . -type f -exec %s"
+                                          find-program grep-command)))
+                        (cons
+                         (format "%s {} %s %s"
+                                 cmd0 null-device
+                                 (shell-quote-argument ";"))
+                         (1+ (length cmd0)))))
                      (t
-                      (format "%s . <X> -type f <F> -print | xargs %s"
-                              find-program gcmd))))))))
-  (unless (or (not grep-highlight-matches) (eq grep-highlight-matches t))
-    (setq grep-highlight-matches
-         (with-temp-buffer
-           (and (grep-probe grep-program '(nil t nil "--help"))
-                (progn
-                  (goto-char (point-min))
-                  (search-forward "--color" nil t))
-                t)))))
+                      (format "%s . -type f -print | xargs %s"
+                              find-program grep-command)))))
+       (unless grep-find-template
+         (setq grep-find-template
+               (let ((gcmd (format "%s <C> %s <R>"
+                                   grep-program grep-options)))
+                 (cond ((eq grep-find-use-xargs 'gnu)
+                        (format "%s . <X> -type f <F> -print0 | xargs -0 -e %s"
+                                find-program gcmd))
+                       ((eq grep-find-use-xargs 'exec)
+                        (format "%s . <X> -type f <F> -exec %s {} %s %s"
+                                find-program gcmd null-device
+                                (shell-quote-argument ";")))
+                       (t
+                        (format "%s . <X> -type f <F> -print | xargs %s"
+                                find-program gcmd))))))))
+    (unless (or (not grep-highlight-matches) (eq grep-highlight-matches t))
+      (setq grep-highlight-matches
+           (with-temp-buffer
+             (and (grep-probe grep-program '(nil t nil "--help"))
+                  (progn
+                    (goto-char (point-min))
+                    (search-forward "--color" nil t))
+                  t))))
+
+    ;; Save defaults for this host.
+    (setq grep-host-defaults-alist
+         (delete (assq host-id grep-host-defaults-alist)
+                 grep-host-defaults-alist))
+    (add-to-list
+     'grep-host-defaults-alist
+     (cons host-id
+          `((grep-command ,grep-command)
+            (grep-template ,grep-template)
+            (grep-use-null-device ,grep-use-null-device)
+            (grep-find-command ,grep-find-command)
+            (grep-find-template ,grep-find-template)
+            (grep-find-use-xargs ,grep-find-use-xargs)
+            (grep-highlight-matches ,grep-highlight-matches))))))
 
 (defun grep-tag-default ()
   (or (and transient-mark-mode mark-active
index d5632ff..4b0dec7 100644 (file)
@@ -59,7 +59,7 @@
 (defgroup gud nil
   "Grand Unified Debugger mode for gdb and other debuggers under Emacs.
 Supported debuggers include gdb, sdb, dbx, xdb, perldb, pdb (Python), jdb."
-  :group 'unix
+  :group 'processes
   :group 'tools)
 
 
@@ -237,7 +237,7 @@ Used to grey out relevant toolbar icons.")
        ([menu-bar run] menu-item
        ,(propertize "run" 'face 'font-lock-doc-face) gud-run
        :visible (memq gud-minor-mode '(gdbmi gdb dbx jdb)))
-       ([menu-bar go] menu-item 
+       ([menu-bar go] menu-item
        ,(propertize " go " 'face 'font-lock-doc-face) gud-go
        :visible (and (not gud-running)
                      (eq gud-minor-mode 'gdba)))
@@ -292,6 +292,11 @@ Used to grey out relevant toolbar icons.")
 (defun gud-file-name (f)
   "Transform a relative file name to an absolute file name.
 Uses `gud-<MINOR-MODE>-directories' to find the source files."
+  ;; When `default-directory' is a remote file name, prepend its
+  ;; remote part to f, which is the local file name.  Fortunately,
+  ;; `file-remote-p' returns exactly this remote file name part (or
+  ;; nil otherwise).
+  (setq f (concat (or (file-remote-p default-directory) "") f))
   (if (file-exists-p f) (expand-file-name f)
     (let ((directories (gud-val 'directories))
          (result nil))
@@ -2510,7 +2515,10 @@ comint mode, which see."
       (while (and w (not (eq (car w) t)))
        (setq w (cdr w)))
       (if w
-         (setcar w file)))
+         (setcar w
+                 (if (file-remote-p default-directory)
+                     (setq file (file-name-nondirectory file))
+                   file))))
     (apply 'make-comint (concat "gud" filepart) program nil
           (if massage-args (funcall massage-args file args) args))
     ;; Since comint clobbered the mode, we don't set it until now.
@@ -3114,7 +3122,7 @@ class of the file (using s to separate nested class ids)."
                              'syntax-table (eval-when-compile
                                              (string-to-syntax "> b")))
           ;; Make sure that rehighlighting the previous line won't erase our
-          ;; syntax-table property.  
+          ;; syntax-table property.
           (put-text-property (1- (match-beginning 0)) (match-end 0)
                              'font-lock-multiline t)
           nil)))))
index fb990d6..83167ba 100644 (file)
@@ -508,8 +508,8 @@ Original match data is restored upon return."
 (defun hs-hide-comment-region (beg end &optional repos-end)
   "Hide a region from BEG to END, marking it as a comment.
 Optional arg REPOS-END means reposition at end."
-  (let ((beg-eol (progn (goto-char beg) (end-of-line) (point)))
-        (end-eol (progn (goto-char end) (end-of-line) (point))))
+  (let ((beg-eol (progn (goto-char beg) (line-end-position)))
+        (end-eol (progn (goto-char end) (line-end-position))))
     (hs-discard-overlays beg-eol end-eol)
     (hs-make-overlay beg-eol end-eol 'comment beg end))
   (goto-char (if repos-end end beg)))
@@ -536,8 +536,7 @@ and then further adjusted to be at the end of the line."
                                         'identity)
                                     pure-p))
                 ;; whatever the adjustment, we move to eol
-                (end-of-line)
-                (point)))
+                (line-end-position)))
              (q
               ;; `q' is the point at the end of the block
               (progn (hs-forward-sexp mdata 1)
@@ -705,7 +704,7 @@ and `case-fold-search' are both t."
       (if (and c-reg (nth 0 c-reg))
           ;; point is inside a comment, and that comment is hidable
           (goto-char (nth 0 c-reg))
-       (end-of-line)
+        (end-of-line)
         (when (and (not c-reg)
                    (hs-find-block-beginning)
                    (looking-at hs-block-start-regexp))
@@ -734,12 +733,12 @@ Move point to the beginning of the line, and run the normal hook
 If `hs-hide-comments-when-hiding-all' is non-nil, also hide the comments."
   (interactive)
   (hs-life-goes-on
-   (message "Hiding all blocks ...")
    (save-excursion
      (unless hs-allow-nesting
        (hs-discard-overlays (point-min) (point-max)))
      (goto-char (point-min))
-     (let ((count 0)
+     (let ((spew (make-progress-reporter "Hiding all blocks..."
+                                         (point-min) (point-max)))
            (re (concat "\\("
                        hs-block-start-regexp
                        "\\)"
@@ -765,9 +764,9 @@ If `hs-hide-comments-when-hiding-all' is non-nil, also hide the comments."
                (if (> (count-lines (car c-reg) (nth 1 c-reg)) 1)
                    (hs-hide-block-at-point t c-reg)
                  (goto-char (nth 1 c-reg))))))
-         (message "Hiding ... %d" (setq count (1+ count))))))
+         (progress-reporter-update spew (point)))
+       (progress-reporter-done spew)))
    (beginning-of-line)
-   (message "Hiding all blocks ... done")
    (run-hooks 'hs-hide-hook)))
 
 (defun hs-show-all ()
@@ -806,7 +805,7 @@ See documentation for functions `hs-hide-block' and `run-hooks'."
   (hs-life-goes-on
    (or
     ;; first see if we have something at the end of the line
-    (let ((ov (hs-overlay-at (save-excursion (end-of-line) (point))))
+    (let ((ov (hs-overlay-at (line-end-position)))
           (here (point)))
       (when ov
         (goto-char
@@ -906,9 +905,9 @@ Key bindings:
       (progn
         (hs-grok-mode-type)
         ;; Turn off this mode if we change major modes.
-       (add-hook 'change-major-mode-hook
-                 'turn-off-hideshow
-                 nil t)
+        (add-hook 'change-major-mode-hook
+                  'turn-off-hideshow
+                  nil t)
         (easy-menu-add hs-minor-mode-menu)
         (set (make-local-variable 'line-move-ignore-invisible) t)
         (add-to-invisibility-spec '(hs . t)))
index 7c1abaf..462445f 100644 (file)
@@ -883,10 +883,13 @@ On a comment line, go to end of line."
                           nil)
                          ((eq 'string (syntax-ppss-context s))
                           ;; Go to start of string and skip it.
-                          (goto-char (nth 8 s))
-                          (condition-case () ; beware invalid syntax
-                              (progn (forward-sexp) t)
-                            (error (end-of-line))))
+                           (let ((pos (point)))
+                             (goto-char (nth 8 s))
+                             (condition-case () ; beware invalid syntax
+                                 (progn (forward-sexp) t)
+                               ;; If there's a mismatched string, make sure
+                               ;; we still overall move *forward*.
+                               (error (goto-char pos) (end-of-line)))))
                          ((python-skip-out t s))))
             (end-of-line))
           (unless comment
@@ -981,15 +984,11 @@ don't move and return nil.  Otherwise return t."
                       (_ (if (python-comment-line-p)
                              (python-skip-comments/blanks t)))
                       (ci (current-indentation))
-                      (open (python-open-block-statement-p))
-                      opoint)
+                      (open (python-open-block-statement-p)))
                  (if (and (zerop ci) (not open))
                      (not (goto-char point))
                    (catch 'done
-                     (setq opoint (point))
-                     (while (and (zerop (python-next-statement))
-                                 (not (= opoint (point))))
-                       (setq opoint (point))
+                      (while (zerop (python-next-statement))
                        (when (or (and open (<= (current-indentation) ci))
                                  (< (current-indentation) ci))
                          (python-skip-comments/blanks t)
@@ -997,7 +996,16 @@ don't move and return nil.  Otherwise return t."
                          (throw 'done t)))))))
       (setq arg (1- arg)))
     (zerop arg)))
-\f
+
+(defvar python-which-func-length-limit 40
+  "Non-strict length limit for `python-which-func' output.")
+
+(defun python-which-func ()
+  (let ((function-name (python-current-defun python-which-func-length-limit)))
+    (set-text-properties 0 (length function-name) nil function-name)
+    function-name))
+
+
 ;;;; Imenu.
 
 (defvar python-recursing)
@@ -1815,22 +1823,34 @@ of current line."
   (1+ (/ (current-indentation) python-indent)))
 
 ;; Fixme: Consider top-level assignments, imports, &c.
-(defun python-current-defun ()
+(defun python-current-defun (&optional length-limit)
   "`add-log-current-defun-function' for Python."
   (save-excursion
     ;; Move up the tree of nested `class' and `def' blocks until we
     ;; get to zero indentation, accumulating the defined names.
-    (let ((start t)
-         accum)
-      (while (or start (> (current-indentation) 0))
-       (setq start nil)
-       (python-beginning-of-block)
-       (end-of-line)
-       (beginning-of-defun)
-       (if (looking-at (rx (0+ space) (or "def" "class") (1+ space)
-                           (group (1+ (or word (syntax symbol))))))
-           (push (match-string 1) accum)))
-      (if accum (mapconcat 'identity accum ".")))))
+    (let ((accum)
+         (length -1))
+      (catch 'done
+       (while (or (null length-limit)
+                  (null (cdr accum))
+                  (< length length-limit))
+         (setq start nil)
+         (let ((started-from (point)))
+           (python-beginning-of-block)
+           (end-of-line)
+           (beginning-of-defun)
+           (when (= (point) started-from)
+             (throw 'done nil)))
+         (when (looking-at (rx (0+ space) (or "def" "class") (1+ space)
+                               (group (1+ (or word (syntax symbol))))))
+           (push (match-string 1) accum)
+           (setq length (+ length 1 (length (car accum)))))
+         (when (= (current-indentation) 0)
+           (throw 'done nil))))
+      (when accum
+       (when (and length-limit (> length length-limit))
+         (setcar accum ".."))
+       (mapconcat 'identity accum ".")))))
 
 (defun python-mark-block ()
   "Mark the block around point.
@@ -1926,7 +1946,7 @@ Repeating the command scrolls the completion window."
   (interactive)
   (let ((window (get-buffer-window "*Completions*")))
     (if (and (eq last-command this-command)
-            window (window-live-p window) (window-buffer window)
+            (window-live-p window) (window-buffer window)
             (buffer-name (window-buffer window)))
        (with-current-buffer (window-buffer window)
          (if (pos-visible-in-window-p (point-max) window)
@@ -2249,6 +2269,7 @@ with skeleton expansions for compound statement templates.
   (set (make-local-variable 'beginning-of-defun-function)
        'python-beginning-of-defun)
   (set (make-local-variable 'end-of-defun-function) 'python-end-of-defun)
+  (add-hook 'which-func-functions 'python-which-func nil t)
   (setq imenu-create-index-function #'python-imenu-create-index)
   (set (make-local-variable 'eldoc-documentation-function)
        #'python-eldoc-function)
index 959c168..c394828 100644 (file)
 
 (defgroup sh nil
   "Shell programming utilities."
-  :group 'unix
   :group 'languages)
 
 (defgroup sh-script nil
     (wsh . sh)
     (zsh . ksh88)
     (rpm . sh))
-  "*Alist showing the direct ancestor of various shells.
+  "Alist showing the direct ancestor of various shells.
 This is the basis for `sh-feature'.  See also `sh-alias-alist'.
 By default we have the following three hierarchies:
 
@@ -276,7 +275,7 @@ sh          Bourne Shell
         '((ksh . ksh88)
            (bash2 . bash)
           (sh5 . sh)))
-  "*Alist for transforming shell names to what they really are.
+  "Alist for transforming shell names to what they really are.
 Use this where the name of the executable doesn't correspond to the type of
 shell it really is."
   :type '(repeat (cons symbol symbol))
@@ -302,7 +301,7 @@ shell it really is."
            (file-name-sans-extension (downcase shell)))))
    (getenv "SHELL")
    "/bin/sh")
-  "*The executable file name for the shell being programmed."
+  "The executable file name for the shell being programmed."
   :type 'string
   :group 'sh-script)
 
@@ -321,7 +320,7 @@ shell it really is."
     (wksh)
     ;; -f means don't run .zshrc.
     (zsh . "-f"))
-  "*Single argument string for the magic number.  See `sh-feature'."
+  "Single argument string for the magic number.  See `sh-feature'."
   :type '(repeat (cons (symbol :tag "Shell")
                       (choice (const :tag "No Arguments" nil)
                               (string :tag "Arguments")
@@ -330,8 +329,8 @@ shell it really is."
 
 (defcustom sh-imenu-generic-expression
   `((sh
-     . ((nil "^\\s-*\\(function\\s-+\\)?\\([A-Za-z_][A-Za-z_0-9]+\\)\\s-*()" 2))))
-  "*Alist of regular expressions for recognizing shell function definitions.
+     . ((nil "^\\s-*\\(function\\s-+\\)?\\([[:alpha:]_][[:alnum:]_]+\\)\\s-*()" 2))))
+  "Alist of regular expressions for recognizing shell function definitions.
 See `sh-feature' and `imenu-generic-expression'."
   :type '(alist :key-type (symbol :tag "Shell")
                :value-type (alist :key-type (choice :tag "Title"
@@ -507,7 +506,7 @@ This is buffer-local in every such buffer.")
   '(shell-dynamic-complete-environment-variable
     shell-dynamic-complete-command
     comint-dynamic-complete-filename)
-  "*Functions for doing TAB dynamic completion."
+  "Functions for doing TAB dynamic completion."
   :type '(repeat function)
   :group 'sh-script)
 
@@ -515,7 +514,7 @@ This is buffer-local in every such buffer.")
 (defcustom sh-require-final-newline
   '((csh . t)
     (pdksh . t))
-  "*Value of `require-final-newline' in Shell-Script mode buffers.
+  "Value of `require-final-newline' in Shell-Script mode buffers.
 \(SHELL . t) means use the value of `mode-require-final-newline' for SHELL.
 See `sh-feature'."
   :type '(repeat (cons (symbol :tag "Shell")
@@ -525,12 +524,12 @@ See `sh-feature'."
 
 
 (defcustom sh-assignment-regexp
-  '((csh . "\\<\\([a-zA-Z0-9_]+\\)\\(\\[.+\\]\\)?[ \t]*[-+*/%^]?=")
+  '((csh . "\\<\\([[:alnum:]_]+\\)\\(\\[.+\\]\\)?[ \t]*[-+*/%^]?=")
     ;; actually spaces are only supported in let/(( ... ))
-    (ksh88 . "\\<\\([a-zA-Z0-9_]+\\)\\(\\[.+\\]\\)?[ \t]*\\([-+*/%&|~^]\\|<<\\|>>\\)?=")
-    (rc . "\\<\\([a-zA-Z0-9_*]+\\)[ \t]*=")
-    (sh . "\\<\\([a-zA-Z0-9_]+\\)="))
-  "*Regexp for the variable name and what may follow in an assignment.
+    (ksh88 . "\\<\\([[:alnum:]_]+\\)\\(\\[.+\\]\\)?[ \t]*\\([-+*/%&|~^]\\|<<\\|>>\\)?=")
+    (rc . "\\<\\([[:alnum:]_*]+\\)[ \t]*=")
+    (sh . "\\<\\([[:alnum:]_]+\\)="))
+  "Regexp for the variable name and what may follow in an assignment.
 First grouping matches the variable name.  This is upto and including the `='
 sign.  See `sh-feature'."
   :type '(repeat (cons (symbol :tag "Shell")
@@ -546,7 +545,7 @@ sign.  See `sh-feature'."
 
 
 (defcustom sh-remember-variable-min 3
-  "*Don't remember variables less than this length for completing reads."
+  "Don't remember variables less than this length for completing reads."
   :type 'integer
   :group 'sh-script)
 
@@ -557,16 +556,16 @@ That command is also used for setting this variable.")
 
 
 (defcustom sh-beginning-of-command
-  "\\([;({`|&]\\|\\`\\|[^\\]\n\\)[ \t]*\\([/~a-zA-Z0-9:]\\)"
-  "*Regexp to determine the beginning of a shell command.
+  "\\([;({`|&]\\|\\`\\|[^\\]\n\\)[ \t]*\\([/~[:alnum:]:]\\)"
+  "Regexp to determine the beginning of a shell command.
 The actual command starts at the beginning of the second \\(grouping\\)."
   :type 'regexp
   :group 'sh-script)
 
 
 (defcustom sh-end-of-command
-  "\\([/~a-zA-Z0-9:]\\)[ \t]*\\([;#)}`|&]\\|$\\)"
-  "*Regexp to determine the end of a shell command.
+  "\\([/~[:alnum:]:]\\)[ \t]*\\([;#)}`|&]\\|$\\)"
+  "Regexp to determine the end of a shell command.
 The actual command ends at the end of the first \\(grouping\\)."
   :type 'regexp
   :group 'sh-script)
@@ -653,6 +652,7 @@ removed when closing the here document."
     (shell "cd" "echo" "eval" "set" "shift" "umask" "unset" "wait")
 
     (wksh sh-append ksh88
+          ;; FIXME: This looks too much like a regexp.  --Stef
          "Xt[A-Z][A-Za-z]*")
 
     (zsh sh-append ksh88
@@ -662,7 +662,7 @@ removed when closing the here document."
         "readonly" "rehash" "sched" "setopt" "source" "suspend" "true"
         "ttyctl" "type" "unfunction" "unhash" "unlimit" "unsetopt" "vared"
         "which"))
-  "*List of all shell builtins for completing read and fontification.
+  "List of all shell builtins for completing read and fontification.
 Note that on some systems not all builtins are available or some are
 implemented as aliases.  See `sh-feature'."
   :type '(repeat (cons (symbol :tag "Shell")
@@ -683,7 +683,7 @@ implemented as aliases.  See `sh-feature'."
     (rc "else")
 
     (sh "!" "do" "elif" "else" "if" "then" "trap" "type" "until" "while"))
-  "*List of keywords that may be immediately followed by a builtin or keyword.
+  "List of keywords that may be immediately followed by a builtin or keyword.
 Given some confusion between keywords and builtins depending on shell and
 system, the distinction here has been based on whether they influence the
 flow of control or syntax.  See `sh-feature'."
@@ -722,7 +722,7 @@ flow of control or syntax.  See `sh-feature'."
 
     (zsh sh-append bash
         "select"))
-  "*List of keywords not in `sh-leading-keywords'.
+  "List of keywords not in `sh-leading-keywords'.
 See `sh-feature'."
   :type '(repeat (cons (symbol :tag "Shell")
                       (choice (repeat string)
@@ -843,18 +843,18 @@ See `sh-feature'.")
 
 (defvar sh-font-lock-keywords-var
   '((csh sh-append shell
-        ("\\${?[#?]?\\([A-Za-z_][A-Za-z0-9_]*\\|0\\)" 1
+        ("\\${?[#?]?\\([[:alpha:]_][[:alnum:]_]*\\|0\\)" 1
           font-lock-variable-name-face))
 
     (es sh-append executable-font-lock-keywords
-       ("\\$#?\\([A-Za-z_][A-Za-z0-9_]*\\|[0-9]+\\)" 1
+       ("\\$#?\\([[:alpha:]_][[:alnum:]_]*\\|[0-9]+\\)" 1
          font-lock-variable-name-face))
 
     (rc sh-append es)
     (bash sh-append shell ("\\$(\\(\\sw+\\)" (1 'sh-quoted-exec t) ))
     (sh sh-append shell
        ;; Variable names.
-       ("\\$\\({#?\\)?\\([A-Za-z_][A-Za-z0-9_]*\\|[-#?@!]\\)" 2
+       ("\\$\\({#?\\)?\\([[:alpha:]_][[:alnum:]_]*\\|[-#?@!]\\)" 2
          font-lock-variable-name-face)
        ;; Function names.
        ("^\\(\\sw+\\)[ \t]*(" 1 font-lock-function-name-face)
@@ -867,8 +867,8 @@ See `sh-feature'.")
     (shell
            ;; Using font-lock-string-face here confuses sh-get-indent-info.
            ("\\(^\\|[^\\]\\)\\(\\\\\\\\\\)*\\(\\\\\\)$" 3 'sh-escaped-newline)
-          ("\\\\[^A-Za-z0-9]" 0 font-lock-string-face)
-          ("\\${?\\([A-Za-z_][A-Za-z0-9_]*\\|[0-9]+\\|[$*_]\\)" 1
+          ("\\\\[^[:alnum:]]" 0 font-lock-string-face)
+          ("\\${?\\([[:alpha:]_][[:alnum:]_]*\\|[0-9]+\\|[$*_]\\)" 1
             font-lock-variable-name-face))
     (rpm sh-append rpm2
         ("%{?\\(\\sw+\\)"  1 font-lock-keyword-face))
@@ -985,7 +985,7 @@ Point is at the beginning of the next line."
   ;; This looks silly, but it's because `sh-here-doc-re' keeps changing.
   (re-search-forward sh-here-doc-re limit t))
 
-(defun sh-quoted-subshell (limit)
+(defun sh-font-lock-quoted-subshell (limit)
   "Search for a subshell embedded in a string.
 Find all the unescaped \" characters within said subshell, remembering that
 subshells can nest."
@@ -997,46 +997,39 @@ subshells can nest."
             (eq ?\" (nth 3 (syntax-ppss))))
     ;; bingo we have a $( or a ` inside a ""
     (let ((char (char-after (point)))
-          (continue t)
-          (pos (point))
-          (data nil)      ;; value to put into match-data (and return)
-          (last nil)      ;; last char seen
-          (bq  (equal (match-string 1) "`")) ;; ` state flip-flop
-          (seen nil)                         ;; list of important positions
-          (nest 1))                          ;; subshell nesting level
-      (while (and continue char (<= pos limit))
-        ;; unescaped " inside a $( ... ) construct.
-        ;; state machine time...
-        ;; \ => ignore next char;
-        ;; ` => increase or decrease nesting level based on bq flag
-        ;; ) [where nesting > 0] => decrease nesting
-        ;; ( [where nesting > 0] => increase nesting
-        ;; ( [preceeded by $ ]   => increase nesting
-        ;; " [nesting <= 0 ]     => terminate, we're done.
-        ;; " [nesting >  0 ]     => remember this, it's not a proper "
-        ;; FIXME: don't count parens that appear within quotes.
-        (cond
-         ((eq ?\\ last) nil)
-         ((eq ?\` char) (setq nest (+ nest (if bq -1 1)) bq (not bq)))
-         ((and (> nest 0) (eq ?\) char))   (setq nest (1- nest)))
-         ((and (eq ?$ last) (eq ?\( char)) (setq nest (1+ nest)))
-         ((and (> nest 0) (eq ?\( char))   (setq nest (1+ nest)))
-         ((eq char ?\")
-          (if (>= 0 nest) (setq continue nil) (push pos seen))))
-        ;;(message "POS: %d [%d]" pos nest)
-        (setq last char
-              pos  (1+ pos)
-              char (char-after pos)) )
-      ;; FIXME: why construct a costly match data to pass to
-      ;; sh-apply-quoted-subshell rather than apply the highlight
-      ;; directly here?  -- Stef
-      (when seen
-        ;;(message "SEEN: %S" seen)
-        (setq data (list (current-buffer)))
-        (dolist(P seen)
-          (setq data (cons P (cons (1+ P) data))))
-        (store-match-data data))
-      data) ))
+          ;; `state' can be: double-quote, backquote, code.
+          (state (if (eq (char-before) ?`) 'backquote 'code))
+          ;; Stacked states in the context.
+          (states '(double-quote)))
+      (while (and state (progn (skip-chars-forward "^'\\\"`$()" limit)
+                               (< (point) limit)))
+        ;; unescape " inside a $( ... ) construct.
+        (case (char-after)
+          (?\' (skip-chars-forward "^'" limit))
+          (?\\ (forward-char 1))
+          (?\" (case state
+                 (double-quote (setq state (pop states)))
+                 (t (push state states) (setq state 'double-quote)))
+               (if state (put-text-property (point) (1+ (point))
+                                            'syntax-table '(1))))
+          (?\` (case state
+                 (backquote (setq state (pop states)))
+                 (t (push state states) (setq state 'backquote))))
+          (?\$ (if (not (eq (char-after (1+ (point))) ?\())
+                   nil
+                 (forward-char 1)
+                 (case state
+                   (t (push state states) (setq state 'code)))))
+          (?\( (case state
+                 (double-quote nil)
+                 (t (push state states) (setq state 'code))))
+          (?\) (case state
+                 (double-quote nil)
+                 (t (setq state (pop states)))))
+          (t (error "Internal error in sh-font-lock-quoted-subshell")))
+        (forward-char 1)))
+    t))
+            
 
 (defun sh-is-quoted-p (pos)
   (and (eq (char-before pos) ?\\)
@@ -1092,17 +1085,6 @@ subshells can nest."
   (goto-char limit)
   nil)
 
-(defun sh-apply-quoted-subshell ()
-  "Apply the `sh-st-punc' syntax to all the matches in `match-data'.
-This is used to flag quote characters in subshell constructs inside strings
-\(which should therefore not be treated as normal quote characters\)"
-  (let ((m (match-data)) a b)
-    (while m
-      (setq a (car  m)
-            b (cadr m)
-            m (cddr m))
-      (put-text-property a b 'syntax-table sh-st-punc))) sh-st-punc)
-
 (defconst sh-font-lock-syntactic-keywords
   ;; A `#' begins a comment when it is unquoted and at the beginning of a
   ;; word.  In the shell, words are separated by metacharacters.
@@ -1129,8 +1111,7 @@ This is used to flag quote characters in subshell constructs inside strings
     (")" 0 (sh-font-lock-paren (match-beginning 0)))
     ;; highlight (possibly nested) subshells inside "" quoted regions correctly.
     ;; This should be at the very end because it uses syntax-ppss.
-    (sh-quoted-subshell
-     (1 (sh-apply-quoted-subshell) t t))))
+    (sh-font-lock-quoted-subshell)))
 
 (defun sh-font-lock-syntactic-face-function (state)
   (let ((q (nth 3 state)))
@@ -1151,17 +1132,17 @@ and command `sh-reset-indent-vars-to-global-values'."
 
 
 (defcustom sh-set-shell-hook nil
-  "*Hook run by `sh-set-shell'."
+  "Hook run by `sh-set-shell'."
   :type 'hook
   :group 'sh-script)
 
 (defcustom sh-mode-hook nil
-  "*Hook run by `sh-mode'."
+  "Hook run by `sh-mode'."
   :type 'hook
   :group 'sh-script)
 
 (defcustom sh-learn-basic-offset nil
-  "*When `sh-guess-basic-offset' should learn `sh-basic-offset'.
+  "When `sh-guess-basic-offset' should learn `sh-basic-offset'.
 
 nil mean:              never.
 t means:               only if there seems to be an obvious value.
@@ -1173,7 +1154,7 @@ Anything else means:   whenever we have a \"good guess\" as to the value."
   :group 'sh-indentation)
 
 (defcustom sh-popup-occur-buffer nil
-  "*Controls when  `sh-learn-buffer-indent' pops the `*indent*' buffer.
+  "Controls when  `sh-learn-buffer-indent' pops the `*indent*' buffer.
 If t it is always shown.  If nil, it is shown only when there
 are conflicts."
   :type '(choice
@@ -1182,7 +1163,7 @@ are conflicts."
   :group 'sh-indentation)
 
 (defcustom sh-blink t
-  "*If non-nil, `sh-show-indent' shows the line indentation is relative to.
+  "If non-nil, `sh-show-indent' shows the line indentation is relative to.
 The position on the line is not necessarily meaningful.
 In some cases the line will be the matching keyword, but this is not
 always the case."
@@ -1190,7 +1171,7 @@ always the case."
   :group 'sh-indentation)
 
 (defcustom sh-first-lines-indent 0
-  "*The indentation of the first non-blank non-comment line.
+  "The indentation of the first non-blank non-comment line.
 Usually 0 meaning first column.
 Can be set to a number, or to nil which means leave it as is."
   :type '(choice
@@ -1201,13 +1182,13 @@ Can be set to a number, or to nil which means leave it as is."
 
 
 (defcustom sh-basic-offset 4
-  "*The default indentation increment.
+  "The default indentation increment.
 This value is used for the `+' and `-' symbols in an indentation variable."
   :type 'integer
   :group 'sh-indentation)
 
 (defcustom sh-indent-comment nil
-  "*How a comment line is to be indented.
+  "How a comment line is to be indented.
 nil means leave it as it is;
 t  means indent it as a normal line, aligning it to previous non-blank
    non-comment line;
@@ -1246,7 +1227,7 @@ a number means align to that column, e.g. 0 means fist column."
           :menu-tag "/   Indent left  half sh-basic-offset")))
 
 (defcustom sh-indent-for-else 0
-  "*How much to indent an `else' relative to its `if'.  Usually 0."
+  "How much to indent an `else' relative to its `if'.  Usually 0."
   :type `(choice
          (integer :menu-tag "A number (positive=>indent right)"
                   :tag "A number")
@@ -1262,41 +1243,41 @@ a number means align to that column, e.g. 0 means fist column."
          sh-symbol-list))
 
 (defcustom sh-indent-for-fi 0
-  "*How much to indent a `fi' relative to its `if'.  Usually 0."
+  "How much to indent a `fi' relative to its `if'.  Usually 0."
   :type `(choice ,@ sh-number-or-symbol-list )
   :group 'sh-indentation)
 
 (defcustom sh-indent-for-done 0
-  "*How much to indent a `done' relative to its matching stmt.  Usually 0."
+  "How much to indent a `done' relative to its matching stmt.  Usually 0."
   :type `(choice ,@ sh-number-or-symbol-list )
   :group 'sh-indentation)
 
 (defcustom sh-indent-after-else '+
-  "*How much to indent a statement after an `else' statement."
+  "How much to indent a statement after an `else' statement."
   :type `(choice ,@ sh-number-or-symbol-list )
   :group 'sh-indentation)
 
 (defcustom sh-indent-after-if '+
-  "*How much to indent a statement after an `if' statement.
+  "How much to indent a statement after an `if' statement.
 This includes lines after `else' and `elif' statements, too, but
 does not affect the `else', `elif' or `fi' statements themselves."
   :type `(choice ,@ sh-number-or-symbol-list )
   :group 'sh-indentation)
 
 (defcustom sh-indent-for-then 0
-  "*How much to indent a `then' relative to its `if'."
+  "How much to indent a `then' relative to its `if'."
   :type `(choice ,@ sh-number-or-symbol-list )
   :group 'sh-indentation)
 
 (defcustom sh-indent-for-do 0
-  "*How much to indent a `do' statement.
+  "How much to indent a `do' statement.
 This is relative to the statement before the `do', typically a
 `while', `until', `for', `repeat' or `select' statement."
   :type `(choice ,@ sh-number-or-symbol-list)
   :group 'sh-indentation)
 
 (defcustom sh-indent-after-do '+
-  "*How much to indent a line after a `do' statement.
+  "How much to indent a line after a `do' statement.
 This is used when the `do' is the first word of the line.
 This is relative to the statement before the `do', typically a
 `while', `until', `for', `repeat' or `select' statement."
@@ -1304,7 +1285,7 @@ This is relative to the statement before the `do', typically a
   :group 'sh-indentation)
 
 (defcustom sh-indent-after-loop-construct '+
-  "*How much to indent a statement after a loop construct.
+  "How much to indent a statement after a loop construct.
 
 This variable is used when the keyword `do' is on the same line as the
 loop statement (e.g., `until', `while' or `for').
@@ -1314,7 +1295,7 @@ If the `do' is on a line by itself, then `sh-indent-after-do' is used instead."
 
 
 (defcustom sh-indent-after-done 0
-  "*How much to indent a statement after a `done' keyword.
+  "How much to indent a statement after a `done' keyword.
 Normally this is 0, which aligns the `done' to the matching
 looping construct line.
 Setting it non-zero allows you to have the `do' statement on a line
@@ -1323,55 +1304,55 @@ by itself and align the done under to do."
   :group 'sh-indentation)
 
 (defcustom sh-indent-for-case-label '+
-  "*How much to indent a case label statement.
+  "How much to indent a case label statement.
 This is relative to the line containing the `case' statement."
   :type `(choice ,@ sh-number-or-symbol-list)
   :group 'sh-indentation)
 
 (defcustom sh-indent-for-case-alt '++
-  "*How much to indent statements after the case label.
+  "How much to indent statements after the case label.
 This is relative to the line containing the `case' statement."
   :type `(choice ,@ sh-number-or-symbol-list)
   :group 'sh-indentation)
 
 
 (defcustom sh-indent-for-continuation '+
-  "*How much to indent for a continuation statement."
+  "How much to indent for a continuation statement."
   :type `(choice ,@ sh-number-or-symbol-list)
   :group 'sh-indentation)
 
 (defcustom sh-indent-after-open '+
-  "*How much to indent after a line with an opening parenthesis or brace.
+  "How much to indent after a line with an opening parenthesis or brace.
 For an open paren after a function, `sh-indent-after-function' is used."
   :type `(choice ,@ sh-number-or-symbol-list)
   :group 'sh-indentation)
 
 (defcustom sh-indent-after-function '+
-  "*How much to indent after a function line."
+  "How much to indent after a function line."
   :type `(choice ,@ sh-number-or-symbol-list)
   :group 'sh-indentation)
 
 ;; These 2 are for the rc shell:
 
 (defcustom sh-indent-after-switch '+
-  "*How much to indent a `case' statement relative to the `switch' statement.
+  "How much to indent a `case' statement relative to the `switch' statement.
 This is for the rc shell."
   :type `(choice ,@ sh-number-or-symbol-list)
   :group 'sh-indentation)
 
 (defcustom sh-indent-after-case '+
-  "*How much to indent a statement relative to the `case' statement.
+  "How much to indent a statement relative to the `case' statement.
 This is for the rc shell."
   :type `(choice ,@ sh-number-or-symbol-list)
   :group 'sh-indentation)
 
 (defcustom sh-backslash-column 48
-  "*Column in which `sh-backslash-region' inserts backslashes."
+  "Column in which `sh-backslash-region' inserts backslashes."
   :type 'integer
   :group 'sh)
 
 (defcustom sh-backslash-align t
-  "*If non-nil, `sh-backslash-region' will align backslashes."
+  "If non-nil, `sh-backslash-region' will align backslashes."
   :type 'boolean
   :group 'sh)
 
@@ -1381,7 +1362,7 @@ This is for the rc shell."
   "Make a regexp which matches WORD as a word.
 This specifically excludes an occurrence of WORD followed by
 punctuation characters like '-'."
-  (concat word "\\([^-a-z0-9_]\\|$\\)"))
+  (concat word "\\([^-[:alnum:]_]\\|$\\)"))
 
 (defconst sh-re-done (sh-mkword-regexpr "done"))
 
@@ -2268,6 +2249,7 @@ STRING         This is ignored for the purposes of calculating
                      (setq align-point (point))))
                (or (bobp)
                    (forward-char -1))
+                ;; FIXME: This charset looks too much like a regexp.  --Stef
                (skip-chars-forward "[a-z0-9]*?")
                )
               ((string-match "[])}]" x)
@@ -2476,7 +2458,7 @@ we go to the end of the previous line and do not check for continuations."
        (if (looking-at "[\"'`]")
            (sh-safe-forward-sexp)
          ;; (> (skip-chars-forward "^ \t\n\"'`") 0)
-         (> (skip-chars-forward "-_a-zA-Z$0-9") 0)
+         (> (skip-chars-forward "-_$[:alnum:]") 0)
          ))
     (buffer-substring start (point))
     ))
index 6479fa3..9aaee22 100644 (file)
@@ -48,7 +48,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Documentation
 
-;; See comment string of function `vera-mode' or type `C-c C-h' in Emacs.
+;; See comment string of function `vera-mode' or type `C-h m' in Emacs.
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Installation
@@ -122,37 +122,37 @@ If nil, TAB always indents current line."
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Key bindings
 
-(defvar vera-mode-map ()
+(defvar vera-mode-map
+  (let ((map (make-sparse-keymap)))
+    ;; Backspace/delete key bindings.
+    (define-key map [backspace] 'backward-delete-char-untabify)
+    (unless (boundp 'delete-key-deletes-forward) ; XEmacs variable
+      (define-key map [delete]       'delete-char)
+      (define-key map [(meta delete)] 'kill-word))
+    ;; Standard key bindings.
+    (define-key map "\M-e"     'vera-forward-statement)
+    (define-key map "\M-a"     'vera-backward-statement)
+    (define-key map "\M-\C-e"  'vera-forward-same-indent)
+    (define-key map "\M-\C-a"  'vera-backward-same-indent)
+    ;; Mode specific key bindings.
+    (define-key map "\C-c\t"   'indent-according-to-mode)
+    (define-key map "\M-\C-\\" 'vera-indent-region)
+    (define-key map "\C-c\C-c" 'vera-comment-uncomment-region)
+    (define-key map "\C-c\C-f" 'vera-fontify-buffer)
+    (define-key map "\C-c\C-v" 'vera-version)
+    (define-key map "\M-\t"    'tab-to-tab-stop)
+    ;; Electric key bindings.
+    (define-key map "\t"       'vera-electric-tab)
+    (define-key map "\r"       'vera-electric-return)
+    (define-key map " "        'vera-electric-space)
+    (define-key map "{"        'vera-electric-opening-brace)
+    (define-key map "}"        'vera-electric-closing-brace)
+    (define-key map "#"        'vera-electric-pound)
+    (define-key map "*"        'vera-electric-star)
+    (define-key map "/"        'vera-electric-slash)
+    map)
   "Keymap for Vera Mode.")
 
-(setq vera-mode-map (make-sparse-keymap))
-;; backspace/delete key bindings
-(define-key vera-mode-map [backspace] 'backward-delete-char-untabify)
-(unless (boundp 'delete-key-deletes-forward) ; XEmacs variable
-  (define-key vera-mode-map [delete]       'delete-char)
-  (define-key vera-mode-map [(meta delete)] 'kill-word))
-;; standard key bindings
-(define-key vera-mode-map "\M-e"     'vera-forward-statement)
-(define-key vera-mode-map "\M-a"     'vera-backward-statement)
-(define-key vera-mode-map "\M-\C-e"  'vera-forward-same-indent)
-(define-key vera-mode-map "\M-\C-a"  'vera-backward-same-indent)
-;; mode specific key bindings
-(define-key vera-mode-map "\C-c\t"   'indent-according-to-mode)
-(define-key vera-mode-map "\M-\C-\\" 'vera-indent-region)
-(define-key vera-mode-map "\C-c\C-c" 'vera-comment-uncomment-region)
-(define-key vera-mode-map "\C-c\C-f" 'vera-fontify-buffer)
-(define-key vera-mode-map "\C-c\C-v" 'vera-version)
-(define-key vera-mode-map "\M-\t"    'tab-to-tab-stop)
-;; electric key bindings
-(define-key vera-mode-map "\t"       'vera-electric-tab)
-(define-key vera-mode-map "\r"       'vera-electric-return)
-(define-key vera-mode-map " "        'vera-electric-space)
-(define-key vera-mode-map "{"        'vera-electric-opening-brace)
-(define-key vera-mode-map "}"        'vera-electric-closing-brace)
-(define-key vera-mode-map "#"        'vera-electric-pound)
-(define-key vera-mode-map "*"        'vera-electric-star)
-(define-key vera-mode-map "/"        'vera-electric-slash)
-
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Menu
 
@@ -844,21 +844,19 @@ This function does not modify point or mark."
 
 (defsubst vera-re-search-forward (regexp &optional bound noerror)
   "Like `re-search-forward', but skips over matches in literals."
-  (store-match-data '(nil nil))
-  (while (and (re-search-forward regexp bound noerror)
-             (vera-skip-forward-literal)
-             (progn (store-match-data '(nil nil))
-                    (if bound (< (point) bound) t))))
-  (match-end 0))
+  (let (ret)
+    (while (and (setq ret (re-search-forward regexp bound noerror))
+                (vera-skip-forward-literal)
+                (if bound (< (point) bound) t)))
+    ret))
 
 (defsubst vera-re-search-backward (regexp &optional bound noerror)
   "Like `re-search-backward', but skips over matches in literals."
-  (store-match-data '(nil nil))
-  (while (and (re-search-backward regexp bound noerror)
-             (vera-skip-backward-literal)
-             (progn (store-match-data '(nil nil))
-                    (if bound (> (point) bound) t))))
-  (match-end 0))
+  (let (ret)
+    (while (and (setq ret (re-search-backward regexp bound noerror))
+                (vera-skip-backward-literal)
+                (if bound (> (point) bound) t)))
+    ret))
 
 (defun vera-forward-syntactic-ws (&optional lim skip-directive)
   "Forward skip of syntactic whitespace."
index 7d953be..5307445 100644 (file)
@@ -76,8 +76,8 @@
   :version "20.3")
 
 (defcustom which-func-modes
-  '(emacs-lisp-mode c-mode c++-mode perl-mode cperl-mode makefile-mode
-                   sh-mode fortran-mode f90-mode ada-mode)
+  '(emacs-lisp-mode c-mode c++-mode perl-mode cperl-mode python-mode
+                   makefile-mode sh-mode fortran-mode f90-mode ada-mode)
   "List of major modes for which Which Function mode should be used.
 For other modes it is disabled.  If this is equal to t,
 then Which Function mode is enabled in any major mode that supports it."
index 2c3eb72..fcad2c8 100644 (file)
 ;;
 ;; Valid values for `ps-multibyte-buffer' are:
 ;;
-;;  nil                     This is the value to use the default settings which
-;;                         is by default for printing buffer with only ASCII
-;;                         and Latin characters.   The default setting can be
-;;                         changed by setting the variable
+;;  nil                            This is the value to use the default settings;
+;;                         by default, this only works to print buffers with
+;;                         only ASCII and Latin characters.   But this default
+;;                         setting can be changed by setting the variable
 ;;                         `ps-mule-font-info-database-default' differently.
 ;;                         The initial value of this variable is
 ;;                         `ps-mule-font-info-database-latin' (see
 ;;                         documentation).
 ;;
-;;  `non-latin-printer'     This is the value to use when you have a japanese
+;;  `non-latin-printer'            This is the value to use when you have a japanese
 ;;                         or korean PostScript printer and want to print
 ;;                         buffer with ASCII, Latin-1, Japanese (JISX0208 and
 ;;                         JISX0201-Kana) and Korean characters.  At present,
-;;                         it was not tested the Korean characters printing.
-;;                         If you have a korean PostScript printer, please,
-;;                         test it.
+;;                         it was not tested with the Korean characters
+;;                         printing.  If you have a korean PostScript printer,
+;;                         please, test it.
 ;;
-;;  `bdf-font'              This is the value to use when you want to print
+;;  `bdf-font'             This is the value to use when you want to print
 ;;                         buffer with BDF fonts.  BDF fonts include both latin
 ;;                         and non-latin fonts.  BDF (Bitmap Distribution
 ;;                         Format) is a format used for distributing X's font
@@ -75,7 +75,7 @@
 ;;                         `bdf-directory-list' appropriately (see ps-bdf.el
 ;;                         for documentation of this variable).
 ;;
-;;  `bdf-font-except-latin' This is like `bdf-font' except that it is used
+;;  `bdf-font-except-latin' This is like `bdf-font' except that it uses
 ;;                         PostScript default fonts to print ASCII and Latin-1
 ;;                         characters.  This is convenient when you want or
 ;;                         need to use both latin and non-latin characters on
 
 Valid values are:
 
-  nil                     This is the value to use the default settings which
-                         is by default for printing buffer with only ASCII
-                         and Latin characters.   The default setting can be
-                         changed by setting the variable
+  nil                    This is the value to use the default settings;
+                         by default, this only works to print buffers with
+                         only ASCII and Latin characters.   But this default
+                         setting can be changed by setting the variable
                          `ps-mule-font-info-database-default' differently.
                          The initial value of this variable is
                          `ps-mule-font-info-database-latin' (see
                          documentation).
 
-  `non-latin-printer'     This is the value to use when you have a Japanese
+  `non-latin-printer'    This is the value to use when you have a Japanese
                          or Korean PostScript printer and want to print
                          buffer with ASCII, Latin-1, Japanese (JISX0208 and
                          JISX0201-Kana) and Korean characters.  At present,
-                         it was not tested the Korean characters printing.
-                         If you have a korean PostScript printer, please,
-                         test it.
+                         it was not tested with the Korean characters
+                         printing.  If you have a korean PostScript printer,
+                         please, test it.
 
-  `bdf-font'              This is the value to use when you want to print
+  `bdf-font'             This is the value to use when you want to print
                          buffer with BDF fonts.  BDF fonts include both latin
                          and non-latin fonts.  BDF (Bitmap Distribution
                          Format) is a format used for distributing X's font
@@ -200,7 +200,7 @@ Valid values are:
                          `bdf-directory-list' appropriately (see ps-bdf.el for
                          documentation of this variable).
 
-  `bdf-font-except-latin' This is like `bdf-font' except that it is used
+  `bdf-font-except-latin' This is like `bdf-font' except that it uses
                          PostScript default fonts to print ASCII and Latin-1
                          characters.  This is convenient when you want or
                          need to use both latin and non-latin characters on
@@ -417,22 +417,26 @@ See also `ps-mule-font-info-database-bdf'.")
 
 (defun ps-mule-encode-bit (string delta)
   (let* ((dim (charset-dimension (char-charset (string-to-char string))))
-        (len (* (length string) dim))
-        (str (make-string len 0))
-        (i 0)
+        (len (length string))
+        (str (make-string (* len dim) 0))
         (j 0))
     (if (= dim 1)
-       (while (< j len)
-         (aset str j
-               (+ (nth 1 (split-char (aref string i))) delta))
-         (setq i (1+ i)
-               j (1+ j)))
-      (while (< j len)
+        ;; (apply 'string
+        ;;        (mapcar (lambda (c) (+ (nth 1 (split-char c)) delta))
+        ;;                string))
+       (dotimes (i len)
+         (aset str i
+               (+ (nth 1 (split-char (aref string i))) delta)))
+      ;; (mapconcat (lambda (c)
+      ;;              (let ((split (split-char c)))
+      ;;                (string (+ (nth 1 split) delta)
+      ;;                        (+ (nth 2 split) delta))))
+      ;;            string "")
+      (dotimes (i len)
        (let ((split (split-char (aref string i))))
          (aset str j (+ (nth 1 split) delta))
          (aset str (1+ j) (+ (nth 2 split) delta))
-         (setq i (1+ i)
-               j (+ j 2)))))
+         (setq j (+ j 2)))))
     str))
 
 ;; Special encoding function for Ethiopic.
@@ -455,31 +459,29 @@ See also `ps-mule-font-info-database-bdf'.")
   ;; to avoid compilation gripes
   (defvar ccl-encode-ethio-unicode nil))
 
-(if (boundp 'mule-version)
-    ;; bound mule-version
-    (defun ps-mule-encode-ethiopic (string)
-      (ccl-execute-on-string (symbol-value 'ccl-encode-ethio-unicode)
-                            (make-vector 9 nil)
-                            string))
-  ;; unbound mule-version
-  (defun ps-mule-encode-ethiopic (string)
-    string))
+(defalias 'ps-mule-encode-ethiopic
+  (if (boundp 'mule-version)
+      ;; Bound mule-version.
+      (lambda (string)
+        (ccl-execute-on-string (symbol-value 'ccl-encode-ethio-unicode)
+                               (make-vector 9 nil)
+                               string))
+    ;; Unbound mule-version.
+    #'identity))
 
 ;; Special encoding for mule-unicode-* characters.
 (defun ps-mule-encode-ucs2 (string)
   (let* ((len (length string))
         (str (make-string (* 2 len) 0))
-        (i 0)
         (j 0)
         ch hi lo)
-    (while (< i len)
+    (dotimes (i len)
       (setq ch (encode-char (aref string i) 'ucs)
            hi (lsh ch -8)
            lo (logand ch 255))
       (aset str j hi)
       (aset str (1+ j) lo)
-      (setq i (1+ i)
-           j (+ j 2)))
+      (setq j (+ j 2)))
     str))
 
 ;; A charset which we are now processing.
@@ -518,16 +520,17 @@ element of the list."
 (defconst ps-mule-external-libraries
   '((builtin nil nil
             nil nil nil)
-    (bdf ps-bdf nil
-        bdf-generate-prologue bdf-generate-font bdf-generate-glyphs)
-    (pcf nil nil
-        pcf-generate-prologue pcf-generate-font pcf-generate-glyphs)
-    (vflib nil nil
-          vflib-generate-prologue vflib-generate-font vflib-generate-glyphs))
-  "Alist of information of external libraries to support PostScript printing.
+    (bdf     ps-bdf nil
+            bdf-generate-prologue bdf-generate-font bdf-generate-glyphs)
+    (pcf     nil nil
+            pcf-generate-prologue pcf-generate-font pcf-generate-glyphs)
+    (vflib   nil nil
+            vflib-generate-prologue vflib-generate-font vflib-generate-glyphs))
+  "Alist of external libraries information to support PostScript printing.
 Each element has the form:
 
-    (FONT-SRC FEATURE INITIALIZED-P PROLOGUE-FUNC FONT-FUNC GLYPHS-FUNC)
+    (FONT-SRC FEATURE INITIALIZED-P
+     PROLOGUE-FUNC FONT-FUNC GLYPHS-FUNC)
 
 FONT-SRC is the font source: builtin, bdf, pcf, or vflib.
 
@@ -541,8 +544,8 @@ PROLOGUE-FUNC is a function to generate PostScript code which define several
 PostScript procedures that will be called by FONT-FUNC and GLYPHS-FUNC.  It is
 called with no argument, and should return a list of strings.
 
-FONT-FUNC is a function to generate PostScript code which define a new font.  It
-is called with one argument FONT-SPEC, and should return a list of strings.
+FONT-FUNC is a function to generate PostScript code which define a new font.
+It is called with one argument FONT-SPEC, and should return a list of strings.
 
 GLYPHS-FUNC is a function to generate PostScript code which define glyphs of
 characters.  It is called with three arguments FONT-SPEC, CODE-LIST, and BYTES,
@@ -906,11 +909,8 @@ the sequence."
 ;; The latter form is used if we much change font for the character.
 
 (defun ps-mule-prepare-font-for-components (components font-type)
-  (let ((len (length components))
-       (i 0)
-       elt)
-    (while (< i len)
-      (setq elt (aref components i))
+  (dotimes (i (length components))
+    (let ((elt (aref components i)))
       (if (consp elt)
          ;; ELT is a composition rule.
          (setq elt (encode-composition-rule elt))
@@ -930,8 +930,7 @@ the sequence."
          (if (stringp font)
              (setq elt (cons font str) ps-last-font font)
            (setq elt str))))
-      (aset components i elt)
-      (setq i (1+ i))))
+      (aset components i elt)))
   components)
 
 (defun ps-mule-plot-components (components tail)
@@ -1363,12 +1362,10 @@ FONTTAG should be a string \"/h0\" or \"/h1\"."
     (if (eq (car ps-mule-header-charsets) 'latin-iso8859-1)
        ;; Latin1 characters can be printed by the standard PostScript
        ;; font.  Converts the other non-ASCII characters to `?'.
-       (let ((len (length string))
-             (i 0))
-         (while (< i len)
+       (let ((len (length string)))
+         (dotimes (i len)
            (or (memq (char-charset (aref string i)) '(ascii latin-iso8859-1))
-               (aset string i ??))
-           (setq i (1+ i)))
+               (aset string i ??)))
          (setq string (encode-coding-string string 'iso-latin-1)))
       ;; We must prepare a font for the first non-ASCII and non-Latin1
       ;; character in STRING.
@@ -1383,21 +1380,17 @@ FONTTAG should be a string \"/h0\" or \"/h1\"."
            ;; We don't have a proper font, or we can't print them on
            ;; header because this kind of charset is not ASCII
            ;; compatible.
-           (let ((len (length string))
-                 (i 0))
-             (while (< i len)
+           (let ((len (length string)))
+             (dotimes (i len)
                (or (memq (char-charset (aref string i))
                          '(ascii latin-iso8859-1))
-                   (aset string i ??))
-               (setq i (1+ i)))
+                   (aset string i ??)))
              (setq string (encode-coding-string string 'iso-latin-1)))
          (let ((charsets (list 'ascii (car ps-mule-header-charsets)))
-               (len (length string))
-               (i 0))
-           (while (< i len)
+               (len (length string)))
+           (dotimes (i len)
              (or (memq (char-charset (aref string i)) charsets)
-                 (aset string i ??))
-             (setq i (1+ i))))
+                 (aset string i ??))))
          (setq string (ps-mule-string-encoding font-spec string nil t))))))
   string)
 
@@ -1446,7 +1439,7 @@ FONTTAG should be a string \"/h0\" or \"/h1\"."
 or \\[universal-argument] \\[what-cursor-position] will give information about them.\n"))))
 
        (with-category-table table
-         (let (string-list idx)
+         (let (string-list)
            (dolist (elt header-footer-list)
              (when (stringp elt)
                (when (string-match "\\cu+" elt)
@@ -1466,7 +1459,7 @@ or \\[universal-argument] \\[what-cursor-position] will give information about t
 ;;;###autoload
 (defun ps-mule-begin-job (from to)
   "Start printing job for multi-byte chars between FROM and TO.
-This checks if all multi-byte characters in the region are printable or not."
+It checks if all multi-byte characters in the region are printable or not."
   (setq ps-mule-charset-list nil
        ps-mule-header-charsets nil
        ps-mule-font-info-database
@@ -1541,14 +1534,12 @@ This checks if all multi-byte characters in the region are printable or not."
        (progn
          (ps-mule-prologue-generated)
          (ps-mule-init-external-library font-spec)
-         (let ((font (ps-font-alist 'ps-font-for-text))
-               (ps-current-font 0))
-           (while font
+         (let ((ps-current-font 0))
+           (dolist (font (ps-font-alist 'ps-font-for-text))
              ;; Be sure to download a glyph for SPACE in advance.
-             (ps-mule-prepare-font (ps-mule-get-font-spec 'ascii (car font))
+             (ps-mule-prepare-font (ps-mule-get-font-spec 'ascii font)
                                    " " 'ascii 'no-setfont)
-             (setq font (cdr font)
-                   ps-current-font (1+ ps-current-font)))))))
+             (setq ps-current-font (1+ ps-current-font)))))))
 
   ;; If the header contains non-ASCII and non-Latin1 characters, prepare a font
   ;; and glyphs for the first occurrence of such characters.
@@ -1581,5 +1572,9 @@ This checks if all multi-byte characters in the region are printable or not."
 
 (provide 'ps-mule)
 
-;;; arch-tag: bca017b2-66a7-4e59-8584-103e749eadbe
+;; Local Variables:
+;; generated-autoload-file: "ps-print.el"
+;; End:
+
+;; arch-tag: bca017b2-66a7-4e59-8584-103e749eadbe
 ;;; ps-mule.el ends here
index 4f5f67f..f7abe47 100644 (file)
@@ -7041,16 +7041,71 @@ If FACE is not a valid face name, use default face."
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; To make this file smaller, some commands go in a separate file.
 ;; But autoload them here to make the separation invisible.
+\f
+;;;### (autoloads (ps-mule-begin-page ps-mule-begin-job ps-mule-encode-header-string
+;;;;;;  ps-mule-initialize ps-mule-plot-composition ps-mule-plot-string
+;;;;;;  ps-mule-set-ascii-font ps-mule-prepare-ascii-font ps-multibyte-buffer)
+;;;;;;  "ps-mule" "ps-mule.el" "586d0a4deeb89be9b80cc01def34481c")
+;;; Generated autoloads from ps-mule.el
 
-(autoload 'ps-mule-prepare-ascii-font "ps-mule"
-  "Setup special ASCII font for STRING.
-STRING should contain only ASCII characters.")
+(defvar ps-multibyte-buffer nil "\
+*Specifies the multi-byte buffer handling.
 
-(autoload 'ps-mule-set-ascii-font     "ps-mule"
-  "Adjust current font if current charset is not ASCII.")
+Valid values are:
 
-(autoload 'ps-mule-plot-string        "ps-mule"
-  "Generate PostScript code for plotting characters in the region FROM and TO.
+  nil                    This is the value to use the default settings;
+                         by default, this only works to print buffers with
+                         only ASCII and Latin characters.   But this default
+                         setting can be changed by setting the variable
+                         `ps-mule-font-info-database-default' differently.
+                         The initial value of this variable is
+                         `ps-mule-font-info-database-latin' (see
+                         documentation).
+
+  `non-latin-printer'    This is the value to use when you have a Japanese
+                         or Korean PostScript printer and want to print
+                         buffer with ASCII, Latin-1, Japanese (JISX0208 and
+                         JISX0201-Kana) and Korean characters.  At present,
+                         it was not tested with the Korean characters
+                         printing.  If you have a korean PostScript printer,
+                         please, test it.
+
+  `bdf-font'             This is the value to use when you want to print
+                         buffer with BDF fonts.  BDF fonts include both latin
+                         and non-latin fonts.  BDF (Bitmap Distribution
+                         Format) is a format used for distributing X's font
+                         source file.  BDF fonts are included in
+                         `intlfonts-1.2' which is a collection of X11 fonts
+                         for all characters supported by Emacs.  In order to
+                         use this value, be sure to have installed
+                         `intlfonts-1.2' and set the variable
+                         `bdf-directory-list' appropriately (see ps-bdf.el for
+                         documentation of this variable).
+
+  `bdf-font-except-latin' This is like `bdf-font' except that it uses
+                         PostScript default fonts to print ASCII and Latin-1
+                         characters.  This is convenient when you want or
+                         need to use both latin and non-latin characters on
+                         the same buffer.  See `ps-font-family',
+                         `ps-header-font-family' and `ps-font-info-database'.
+
+Any other value is treated as nil.")
+
+(custom-autoload (quote ps-multibyte-buffer) "ps-mule" t)
+
+(autoload (quote ps-mule-prepare-ascii-font) "ps-mule" "\
+Setup special ASCII font for STRING.
+STRING should contain only ASCII characters.
+
+\(fn STRING)" nil nil)
+
+(autoload (quote ps-mule-set-ascii-font) "ps-mule" "\
+Not documented
+
+\(fn)" nil nil)
+
+(autoload (quote ps-mule-plot-string) "ps-mule" "\
+Generate PostScript code for plotting characters in the region FROM and TO.
 
 It is assumed that all characters in this region belong to the same charset.
 
@@ -7061,23 +7116,50 @@ Returns the value:
        (ENDPOS . RUN-WIDTH)
 
 Where ENDPOS is the end position of the sequence and RUN-WIDTH is the width of
-the sequence.")
+the sequence.
+
+\(fn FROM TO &optional BG-COLOR)" nil nil)
+
+(autoload (quote ps-mule-plot-composition) "ps-mule" "\
+Generate PostScript code for plotting composition in the region FROM and TO.
+
+It is assumed that all characters in this region belong to the same
+composition.
+
+Optional argument BG-COLOR specifies background color.
+
+Returns the value:
+
+       (ENDPOS . RUN-WIDTH)
+
+Where ENDPOS is the end position of the sequence and RUN-WIDTH is the width of
+the sequence.
+
+\(fn FROM TO &optional BG-COLOR)" nil nil)
+
+(autoload (quote ps-mule-initialize) "ps-mule" "\
+Initialize global data for printing multi-byte characters.
+
+\(fn)" nil nil)
+
+(autoload (quote ps-mule-encode-header-string) "ps-mule" "\
+Generate PostScript code for ploting STRING by font FONTTAG.
+FONTTAG should be a string \"/h0\" or \"/h1\".
 
-(autoload 'ps-mule-initialize         "ps-mule"
-  "Initialize global data for printing multi-byte characters.")
+\(fn STRING FONTTAG)" nil nil)
 
-(autoload 'ps-mule-begin-job          "ps-mule"
-  "Start printing job for multi-byte chars between FROM and TO.
-This checks if all multi-byte characters in the region are printable or not.")
+(autoload (quote ps-mule-begin-job) "ps-mule" "\
+Start printing job for multi-byte chars between FROM and TO.
+It checks if all multi-byte characters in the region are printable or not.
 
-(autoload 'ps-mule-begin-page         "ps-mule"
-  "Initialize multi-byte charset for printing current page.")
+\(fn FROM TO)" nil nil)
 
-(autoload 'ps-mule-encode-header-string "ps-mule"
-  "Generate PostScript code for plotting characters in header STRING.
+(autoload (quote ps-mule-begin-page) "ps-mule" "\
+Not documented
 
-It is assumed that the length of STRING is not zero.")
+\(fn)" nil nil)
 
+;;;***
 \f
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
index 86263ae..85f00b2 100644 (file)
@@ -89,7 +89,7 @@ file.  See also the function `set-file-modes'."
   :group 'recentf
   :type '(choice (const :tag "Don't change" nil)
           integer))
-  
+
 (defcustom recentf-exclude nil
   "*List of regexps and predicates for filenames excluded from the recent list.
 When a filename matches any of the regexps or satisfies any of the
@@ -99,19 +99,27 @@ must return non-nil to exclude it."
   :group 'recentf
   :type '(repeat (choice regexp function)))
 
+(defun recentf-keep-default-predicate (file)
+  "Return non-nil if FILE should be kept in the recent list.
+It handles the case of remote files as well."
+  (cond
+   ((file-remote-p file nil t) (file-readable-p file))
+   ((file-remote-p file))
+   ((file-readable-p file))))
+
 (defcustom recentf-keep
-  '(file-readable-p)
+  '(recentf-keep-default-predicate)
   "*List of regexps and predicates for filenames kept in the recent list.
 Regexps and predicates are tried in the specified order.
 When nil all filenames are kept in the recent list.
 When a filename matches any of the regexps or satisfies any of the
 predicates it is kept in the recent list.
-The default is to keep readable files.
+The default is to keep readable files.  Remote files are checked
+for readability only in case a connection is established to that
+remote system, otherwise they are kept in the recent list without
+checking their readability.
 A predicate is a function that is passed a filename to check and that
-must return non-nil to keep it.  For example, you can add the
-`file-remote-p' predicate in front of this list to keep remote file
-names in the recent list without checking their readability through a
-remote access."
+must return non-nil to keep it."
   :group 'recentf
   :type '(repeat (choice regexp function)))
 
index 8d8d9fc..5fe8ad4 100644 (file)
@@ -1408,38 +1408,36 @@ make, or the user didn't cancel the call."
   (or map (setq map query-replace-map))
   (and query-flag minibuffer-auto-raise
        (raise-frame (window-frame (minibuffer-window))))
-  (let ((nocasify (not (and case-fold-search case-replace
-                           (string-equal from-string
-                                         (downcase from-string)))))
-       (case-fold-search (and case-fold-search
-                              (string-equal from-string
-                                            (downcase from-string))))
-       (literal (or (not regexp-flag) (eq regexp-flag 'literal)))
-       (search-function (if regexp-flag 're-search-forward 'search-forward))
-       (search-string from-string)
-       (real-match-data nil)           ; the match data for the current match
-       (next-replacement nil)
-       ;; This is non-nil if we know there is nothing for the user
-       ;; to edit in the replacement.
-       (noedit nil)
-       (keep-going t)
-       (stack nil)
-       (replace-count 0)
-       (nonempty-match nil)
-
-       ;; If non-nil, it is marker saying where in the buffer to stop.
-       (limit nil)
-
-       ;; Data for the next match.  If a cons, it has the same format as
-       ;; (match-data); otherwise it is t if a match is possible at point.
-       (match-again t)
-
-       (message
-        (if query-flag
-            (apply 'propertize
-                   (substitute-command-keys
-                    "Query replacing %s with %s: (\\<query-replace-map>\\[help] for help) ")
-                   minibuffer-prompt-properties))))
+  (let* ((case-fold-search
+          (and case-fold-search
+               (isearch-no-upper-case-p from-string regexp-flag)))
+         (nocasify (not (and case-replace case-fold-search)))
+         (literal (or (not regexp-flag) (eq regexp-flag 'literal)))
+         (search-function (if regexp-flag 're-search-forward 'search-forward))
+         (search-string from-string)
+         (real-match-data nil)       ; The match data for the current match.
+         (next-replacement nil)
+         ;; This is non-nil if we know there is nothing for the user
+         ;; to edit in the replacement.
+         (noedit nil)
+         (keep-going t)
+         (stack nil)
+         (replace-count 0)
+         (nonempty-match nil)
+
+         ;; If non-nil, it is marker saying where in the buffer to stop.
+         (limit nil)
+
+         ;; Data for the next match.  If a cons, it has the same format as
+         ;; (match-data); otherwise it is t if a match is possible at point.
+         (match-again t)
+
+         (message
+          (if query-flag
+              (apply 'propertize
+                     (substitute-command-keys
+                      "Query replacing %s with %s: (\\<query-replace-map>\\[help] for help) ")
+                     minibuffer-prompt-properties))))
 
     ;; If region is active, in Transient Mark mode, operate on region.
     (when start
index 83b46e5..0b531b3 100644 (file)
@@ -101,8 +101,8 @@ minibuffer histories, such as `compile-command' or `kill-ring'."
   (cond
    ;; Backward compatibility with previous versions of savehist.
    ((file-exists-p "~/.emacs-history") "~/.emacs-history")
-   ((and (not (featurep 'xemacs)) (file-directory-p "~/.emacs.d/"))
-    "~/.emacs.d/history")
+   ((and (not (featurep 'xemacs)) (file-directory-p user-emacs-directory))
+    (concat user-emacs-directory "history"))
    ((and (featurep 'xemacs) (file-directory-p "~/.xemacs/"))
     "~/.xemacs/history")
    ;; For users without `~/.emacs.d/' or `~/.xemacs/'.
index 8f7f778..89756fd 100644 (file)
@@ -105,7 +105,7 @@ If set, the server accepts remote connections; otherwise it is local."
   :version "22.1")
 (put 'server-host 'risky-local-variable t)
 
-(defcustom server-auth-dir "~/.emacs.d/server/"
+(defcustom server-auth-dir (concat user-emacs-directory "server/")
   "Directory for server authentication files."
   :group 'server
   :type 'directory
@@ -736,8 +736,7 @@ Arg NEXT-BUFFER is a suggestion; if it is a live buffer, use it."
                 (select-window win)
                 (set-buffer next-buffer))
            ;; Otherwise, let's find an appropriate window.
-           (cond ((and (windowp server-window)
-                       (window-live-p server-window))
+           (cond ((window-live-p server-window)
                   (select-window server-window))
                  ((framep server-window)
                   (unless (frame-live-p server-window)
index d43fcdc..03fbf46 100644 (file)
@@ -5,7 +5,7 @@
 
 ;; Author: Olin Shivers <shivers@cs.cmu.edu>
 ;;     Simon Marshall <simon@gnu.org>
-;; Maintainer: FSF
+;; Maintainer: FSF <emacs-devel@gnu.org>
 ;; Keywords: processes
 
 ;; This file is part of GNU Emacs.
 
 ;;; Commentary:
 
-;; Please send me bug reports, bug fixes, and extensions, so that I can
-;; merge them into the master source.
-;;     - Olin Shivers (shivers@cs.cmu.edu)
-;;     - Simon Marshall (simon@gnu.org)
-
 ;; This file defines a shell-in-a-buffer package (shell mode) built on
 ;; top of comint mode.  This is actually cmushell with things renamed
 ;; to replace its counterpart in Emacs 18.  cmushell is more
@@ -557,7 +552,7 @@ Otherwise, one argument `-i' is passed to the shell.
           (startfile (concat "~/.emacs_" name))
           (xargs-name (intern-soft (concat "explicit-" name "-args"))))
       (unless (file-exists-p startfile)
-       (setq startfile (concat "~/.emacs.d/init_" name ".sh")))
+       (setq startfile (concat user-emacs-directory "init_" name ".sh")))
       (apply 'make-comint-in-buffer "shell" buffer prog
             (if (file-exists-p startfile) startfile)
             (if (and xargs-name (boundp xargs-name))
index b71dffd..c838111 100644 (file)
@@ -156,6 +156,15 @@ If `fringe-arrow', indicate the locus by the fringe arrow."
   :group 'next-error
   :version "22.1")
 
+(defcustom next-error-recenter nil
+  "*Display the line in the visited source file recentered as specified.
+If non-nil, the value is passed directly to `recenter'."
+  :type '(choice (integer :tag "Line to recenter to")
+                 (const :tag "Center of window" (4))
+                 (const :tag "No recentering" nil))
+  :group 'next-error
+  :version "23.1")
+
 (defcustom next-error-hook nil
   "*List of hook functions run by `next-error' after visiting source file."
   :type 'hook
@@ -305,6 +314,8 @@ See variables `compilation-parse-errors-function' and
     ;; we know here that next-error-function is a valid symbol we can funcall
     (with-current-buffer next-error-last-buffer
       (funcall next-error-function (prefix-numeric-value arg) reset)
+      (when next-error-recenter
+        (recenter next-error-recenter))
       (run-hooks 'next-error-hook))))
 
 (defun next-error-internal ()
@@ -313,6 +324,8 @@ See variables `compilation-parse-errors-function' and
   ;; we know here that next-error-function is a valid symbol we can funcall
   (with-current-buffer next-error-last-buffer
     (funcall next-error-function 0 nil)
+    (when next-error-recenter
+      (recenter next-error-recenter))
     (run-hooks 'next-error-hook)))
 
 (defalias 'goto-next-locus 'next-error)
@@ -1287,55 +1300,61 @@ makes the search case-sensitive."
 
 (defvar minibuffer-temporary-goal-position nil)
 
+(defun goto-history-element (nabs)
+  "Puts element of the minibuffer history in the minibuffer.
+The argument NABS specifies the absolute history position."
+  (interactive "p")
+  (let ((minimum (if minibuffer-default -1 0))
+       elt minibuffer-returned-to-present)
+    (if (and (zerop minibuffer-history-position)
+            (null minibuffer-text-before-history))
+       (setq minibuffer-text-before-history
+             (minibuffer-contents-no-properties)))
+    (if (< nabs minimum)
+       (if minibuffer-default
+           (error "End of history; no next item")
+         (error "End of history; no default available")))
+    (if (> nabs (length (symbol-value minibuffer-history-variable)))
+       (error "Beginning of history; no preceding item"))
+    (unless (memq last-command '(next-history-element
+                                previous-history-element))
+      (let ((prompt-end (minibuffer-prompt-end)))
+       (set (make-local-variable 'minibuffer-temporary-goal-position)
+            (cond ((<= (point) prompt-end) prompt-end)
+                  ((eobp) nil)
+                  (t (point))))))
+    (goto-char (point-max))
+    (delete-minibuffer-contents)
+    (setq minibuffer-history-position nabs)
+    (cond ((= nabs -1)
+          (setq elt minibuffer-default))
+         ((= nabs 0)
+          (setq elt (or minibuffer-text-before-history ""))
+          (setq minibuffer-returned-to-present t)
+          (setq minibuffer-text-before-history nil))
+         (t (setq elt (nth (1- minibuffer-history-position)
+                           (symbol-value minibuffer-history-variable)))))
+    (insert
+     (if (and (eq minibuffer-history-sexp-flag (minibuffer-depth))
+             (not minibuffer-returned-to-present))
+        (let ((print-level nil))
+          (prin1-to-string elt))
+       elt))
+    (goto-char (or minibuffer-temporary-goal-position (point-max)))))
+
 (defun next-history-element (n)
   "Puts next element of the minibuffer history in the minibuffer.
 With argument N, it uses the Nth following element."
   (interactive "p")
   (or (zerop n)
-      (let ((narg (- minibuffer-history-position n))
-           (minimum (if minibuffer-default -1 0))
-           elt minibuffer-returned-to-present)
-       (if (and (zerop minibuffer-history-position)
-                (null minibuffer-text-before-history))
-           (setq minibuffer-text-before-history
-                 (minibuffer-contents-no-properties)))
-       (if (< narg minimum)
-           (if minibuffer-default
-               (error "End of history; no next item")
-             (error "End of history; no default available")))
-       (if (> narg (length (symbol-value minibuffer-history-variable)))
-           (error "Beginning of history; no preceding item"))
-       (unless (memq last-command '(next-history-element
-                                    previous-history-element))
-         (let ((prompt-end (minibuffer-prompt-end)))
-           (set (make-local-variable 'minibuffer-temporary-goal-position)
-                (cond ((<= (point) prompt-end) prompt-end)
-                      ((eobp) nil)
-                      (t (point))))))
-       (goto-char (point-max))
-       (delete-minibuffer-contents)
-       (setq minibuffer-history-position narg)
-       (cond ((= narg -1)
-              (setq elt minibuffer-default))
-             ((= narg 0)
-              (setq elt (or minibuffer-text-before-history ""))
-              (setq minibuffer-returned-to-present t)
-              (setq minibuffer-text-before-history nil))
-             (t (setq elt (nth (1- minibuffer-history-position)
-                               (symbol-value minibuffer-history-variable)))))
-       (insert
-        (if (and (eq minibuffer-history-sexp-flag (minibuffer-depth))
-                 (not minibuffer-returned-to-present))
-            (let ((print-level nil))
-              (prin1-to-string elt))
-          elt))
-       (goto-char (or minibuffer-temporary-goal-position (point-max))))))
+      (goto-history-element (- minibuffer-history-position n))))
 
 (defun previous-history-element (n)
   "Puts previous element of the minibuffer history in the minibuffer.
 With argument N, it uses the Nth previous element."
   (interactive "p")
-  (next-history-element (- n)))
+  (or (zerop n)
+      (goto-history-element (+ minibuffer-history-position n))))
 
 (defun next-complete-history-element (n)
   "Get next history element which completes the minibuffer before the point.
@@ -1368,6 +1387,137 @@ Return 0 if current buffer is not a minibuffer."
   ;; the buffer; this should be 0 for normal buffers.
   (1- (minibuffer-prompt-end)))
 \f
+;; isearch minibuffer history
+(add-hook 'minibuffer-setup-hook 'minibuffer-history-isearch-setup)
+
+(defvar minibuffer-history-isearch-message-overlay)
+(make-variable-buffer-local 'minibuffer-history-isearch-message-overlay)
+
+(defun minibuffer-history-isearch-setup ()
+  "Set up a minibuffer for using isearch to search the minibuffer history.
+Intended to be added to `minibuffer-setup-hook'."
+  (set (make-local-variable 'isearch-search-fun-function)
+       'minibuffer-history-isearch-search)
+  (set (make-local-variable 'isearch-message-function)
+       'minibuffer-history-isearch-message)
+  (set (make-local-variable 'isearch-wrap-function)
+       'minibuffer-history-isearch-wrap)
+  (set (make-local-variable 'isearch-push-state-function)
+       'minibuffer-history-isearch-push-state)
+  (add-hook 'isearch-mode-end-hook 'minibuffer-history-isearch-end nil t))
+
+(defun minibuffer-history-isearch-end ()
+  "Clean up the minibuffer after terminating isearch in the minibuffer."
+  (if minibuffer-history-isearch-message-overlay
+      (delete-overlay minibuffer-history-isearch-message-overlay)))
+
+(defun minibuffer-history-isearch-search ()
+  "Return the proper search function, for isearch in minibuffer history."
+  (cond
+   (isearch-word
+    (if isearch-forward 'word-search-forward 'word-search-backward))
+   (t
+    (lambda (string bound noerror)
+      (let ((search-fun
+            ;; Use standard functions to search within minibuffer text
+             (cond
+              (isearch-regexp
+               (if isearch-forward 're-search-forward 're-search-backward))
+              (t
+               (if isearch-forward 'search-forward 'search-backward))))
+           found)
+       ;; Avoid lazy-highlighting matches in the minibuffer prompt when
+       ;; searching forward.  Lazy-highlight calls this lambda with the
+       ;; bound arg, so skip the minibuffer prompt.
+       (if (and bound isearch-forward (< (point) (minibuffer-prompt-end)))
+           (goto-char (minibuffer-prompt-end)))
+        (or
+        ;; 1. First try searching in the initial minibuffer text
+        (funcall search-fun string
+                 (if isearch-forward bound (minibuffer-prompt-end))
+                 noerror)
+        ;; 2. If the above search fails, start putting next/prev history
+        ;; elements in the minibuffer successively, and search the string
+        ;; in them.  Do this only when bound is nil (i.e. not while
+        ;; lazy-highlighting search strings in the current minibuffer text).
+        (unless bound
+          (condition-case nil
+              (progn
+                (while (not found)
+                  (cond (isearch-forward
+                         (next-history-element 1)
+                         (goto-char (minibuffer-prompt-end)))
+                        (t
+                         (previous-history-element 1)
+                         (goto-char (point-max))))
+                  (setq isearch-barrier (point) isearch-opoint (point))
+                  ;; After putting the next/prev history element, search
+                  ;; the string in them again, until next-history-element
+                  ;; or previous-history-element raises an error at the
+                  ;; beginning/end of history.
+                  (setq found (funcall search-fun string
+                                       (unless isearch-forward
+                                         ;; For backward search, don't search
+                                         ;; in the minibuffer prompt
+                                         (minibuffer-prompt-end))
+                                       noerror)))
+                ;; Return point of the new search result
+                (point))
+            ;; Return nil when next(prev)-history-element fails
+            (error nil)))))))))
+
+(defun minibuffer-history-isearch-message (&optional c-q-hack ellipsis)
+  "Display the minibuffer history search prompt.
+If there are no search errors, this function displays an overlay with
+the isearch prompt which replaces the original minibuffer prompt.
+Otherwise, it displays the standard isearch message returned from
+`isearch-message'."
+  (if (not (and (minibufferp) isearch-success (not isearch-error)))
+      ;; Use standard function `isearch-message' when not in the minibuffer,
+      ;; or search fails, or has an error (like incomplete regexp).
+      ;; This function overwrites minibuffer text with isearch message,
+      ;; so it's possible to see what is wrong in the search string.
+      (isearch-message c-q-hack ellipsis)
+    ;; Otherwise, put the overlay with the standard isearch prompt over
+    ;; the initial minibuffer prompt.
+    (if (overlayp minibuffer-history-isearch-message-overlay)
+       (move-overlay minibuffer-history-isearch-message-overlay
+                     (point-min) (minibuffer-prompt-end))
+      (setq minibuffer-history-isearch-message-overlay
+           (make-overlay (point-min) (minibuffer-prompt-end)))
+      (overlay-put minibuffer-history-isearch-message-overlay 'evaporate t))
+    (overlay-put minibuffer-history-isearch-message-overlay
+                'display (isearch-message-prefix c-q-hack ellipsis))
+    ;; And clear any previous isearch message.
+    (message "")))
+
+(defun minibuffer-history-isearch-wrap ()
+  "Wrap the minibuffer history search when search is failed.
+Move point to the first history element for a forward search,
+or to the last history element for a backward search."
+  (unless isearch-word
+    ;; When `minibuffer-history-isearch-search' fails on reaching the
+    ;; beginning/end of the history, wrap the search to the first/last
+    ;; minibuffer history element.
+    (if isearch-forward
+       (goto-history-element (length (symbol-value minibuffer-history-variable)))
+      (goto-history-element 0))
+    (setq isearch-success t))
+  (goto-char (if isearch-forward (minibuffer-prompt-end) (point-max))))
+
+(defun minibuffer-history-isearch-push-state ()
+  "Save a function restoring the state of minibuffer history search.
+Save `minibuffer-history-position' to the additional state parameter
+in the search status stack."
+  `(lambda (cmd)
+     (minibuffer-history-isearch-pop-state cmd ,minibuffer-history-position)))
+
+(defun minibuffer-history-isearch-pop-state (cmd hist-pos)
+  "Restore the minibuffer history search state.
+Go to the history element by the absolute history position `hist-pos'."
+  (goto-history-element hist-pos))
+
+\f
 ;Put this on C-x u, so we can force that rather than C-_ into startup msg
 (defalias 'advertised-undo 'undo)
 
@@ -2189,6 +2339,18 @@ value passed."
       (when stderr-file (delete-file stderr-file))
       (when lc (delete-file lc)))))
 
+(defun start-file-process (name buffer program &rest program-args)
+  "Start a program in a subprocess.  Return the process object for it.
+Similar to `start-process', but may invoke a file handler based on
+`default-directory'.  The current working directory of the
+subprocess is `default-directory'.
+
+PROGRAM and PROGRAM-ARGS might be file names.  They are not
+objects of file handler invocation."
+  (let ((fh (find-file-name-handler default-directory 'start-file-process)))
+    (if fh (apply fh 'start-file-process name buffer program program-args)
+      (apply 'start-process name buffer program program-args))))
+
 
 \f
 (defvar universal-argument-map
@@ -4167,13 +4329,6 @@ If optional arg REALLY-WORD is non-nil, it finds just a word."
                 regexp)
   :group 'fill)
 
-(defvar comment-line-break-function 'comment-indent-new-line
-  "*Mode-specific function which line breaks and continues a comment.
-
-This function is only called during auto-filling of a comment section.
-The function should take a single optional argument, which is a flag
-indicating whether it should use soft newlines.")
-
 ;; This function is used as the auto-fill-function of a buffer
 ;; when Auto-Fill mode is enabled.
 ;; It returns t if it really did any work.
@@ -4247,10 +4402,10 @@ indicating whether it should use soft newlines.")
              (if (save-excursion
                    (skip-chars-backward " \t")
                    (= (point) fill-point))
-                 (funcall comment-line-break-function t)
+                 (default-indent-new-line t)
                (save-excursion
                  (goto-char fill-point)
-                 (funcall comment-line-break-function t)))
+                 (default-indent-new-line t)))
              ;; Now do justification, if required
              (if (not (eq justify 'left))
                  (save-excursion
@@ -4265,6 +4420,43 @@ indicating whether it should use soft newlines.")
       (justify-current-line justify t t)
       t)))
 
+(defvar comment-line-break-function 'comment-indent-new-line
+  "*Mode-specific function which line breaks and continues a comment.
+This function is called during auto-filling when a comment syntax
+is defined.
+The function should take a single optional argument, which is a flag
+indicating whether it should use soft newlines.")
+
+(defun default-indent-new-line (&optional soft)
+  "Break line at point and indent.
+If a comment syntax is defined, call `comment-indent-new-line'.
+
+The inserted newline is marked hard if variable `use-hard-newlines' is true,
+unless optional argument SOFT is non-nil."
+  (interactive)
+  (if comment-start
+      (funcall comment-line-break-function soft)
+    ;; Insert the newline before removing empty space so that markers
+    ;; get preserved better.
+    (if soft (insert-and-inherit ?\n) (newline 1))
+    (save-excursion (forward-char -1) (delete-horizontal-space))
+    (delete-horizontal-space)
+
+    (if (and fill-prefix (not adaptive-fill-mode))
+       ;; Blindly trust a non-adaptive fill-prefix.
+       (progn
+         (indent-to-left-margin)
+         (insert-before-markers-and-inherit fill-prefix))
+
+      (cond
+       ;; If there's an adaptive prefix, use it unless we're inside
+       ;; a comment and the prefix is not a comment starter.
+       (fill-prefix
+       (indent-to-left-margin)
+       (insert-and-inherit fill-prefix))
+       ;; If we're not inside a comment, just try to indent.
+       (t (indent-according-to-mode))))))
+
 (defvar normal-auto-fill-function 'do-auto-fill
   "The function to use for `auto-fill-function' if Auto Fill mode is turned on.
 Some major modes set this.")
@@ -5246,10 +5438,10 @@ PREFIX is the string that represents this modifier in an event type symbol."
 \f
 ;;;; Keypad support.
 
-;;; Make the keypad keys act like ordinary typing keys.  If people add
-;;; bindings for the function key symbols, then those bindings will
-;;; override these, so this shouldn't interfere with any existing
-;;; bindings.
+;; Make the keypad keys act like ordinary typing keys.  If people add
+;; bindings for the function key symbols, then those bindings will
+;; override these, so this shouldn't interfere with any existing
+;; bindings.
 
 ;; Also tell read-char how to handle these keys.
 (mapc
index 19ef664..db39e6d 100644 (file)
@@ -263,9 +263,9 @@ init file is read, in case it sets `mail-host-address'."
 (defcustom auto-save-list-file-prefix
   (cond ((eq system-type 'ms-dos)
         ;; MS-DOS cannot have initial dot, and allows only 8.3 names
-        "~/_emacs.d/auto-save.list/_s")
+        (concat user-emacs-directory "auto-save.list/_s"))
        (t
-        "~/.emacs.d/auto-save-list/.saves-"))
+        (concat user-emacs-directory "auto-save-list/.saves-")))
   "Prefix for generating `auto-save-list-file-name'.
 This is used after reading your `.emacs' file to initialize
 `auto-save-list-file-name', by appending Emacs's pid and the system name,
@@ -1055,7 +1055,10 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
   (if (get-buffer "*scratch*")
       (with-current-buffer "*scratch*"
        (if (eq major-mode 'fundamental-mode)
-           (funcall initial-major-mode))))
+           (funcall initial-major-mode))
+       ;; Don't lose text that users type in *scratch*.
+       (setq buffer-offer-save t)
+       (auto-save-mode 1)))
 
   ;; Load library for our terminal type.
   ;; User init file can set term-file-prefix to nil to prevent this.
@@ -1311,7 +1314,7 @@ using the mouse.\n\n")
                         (emacs-version)
                         "\n"
                         :face '(variable-pitch :height 0.5)
-                        "Copyright (C) 2007 Free Software Foundation, Inc.")
+                        emacs-copyright)
     (and auto-save-list-file-prefix
         ;; Don't signal an error if the
         ;; directory for auto-save-list files
@@ -1560,8 +1563,7 @@ Getting New Versions      How to obtain the latest version of Emacs
 More Manuals / Ordering Manuals    How to order printed manuals from the FSF
 ")
                 (insert "\n\n" (emacs-version)
-                        "
-Copyright (C) 2007 Free Software Foundation, Inc."))
+                        "\n" emacs-copyright))
 
             ;; No mouse menus, so give help using kbd commands.
 
@@ -1608,8 +1610,7 @@ Activate menubar     \\[tmm-menubar]")))
 If you have no Meta key, you may instead type ESC followed by the character.)")
 
             (insert "\n\n" (emacs-version)
-                    "
-Copyright (C) 2007 Free Software Foundation, Inc.")
+                    "\n" emacs-copyright)
 
             (if (and (eq (key-binding "\C-h\C-c") 'describe-copying)
                      (eq (key-binding "\C-h\C-d") 'describe-distribution)
index 8de09b0..0a1466a 100644 (file)
@@ -510,6 +510,7 @@ Don't call this function; it is for internal use only."
                               (if (integerp b) (< a b)
                                 t)
                             (if (integerp b) t
+                               ;; string< also accepts symbols.
                               (string< a b))))))
        (dolist (p list)
          (funcall function (car p) (cdr p))))
@@ -1219,7 +1220,8 @@ if it is empty or a duplicate."
 Execution is delayed if `delay-mode-hooks' is non-nil.
 If `delay-mode-hooks' is nil, run `after-change-major-mode-hook'
 after running the mode hooks.
-Major mode functions should use this."
+Major mode functions should use this instead of `run-hooks' when running their
+FOO-mode-hook."
   (if delay-mode-hooks
       ;; Delaying case.
       (dolist (hook hooks)
@@ -2041,6 +2043,15 @@ On other systems, this variable is normally always nil.")
 (put 'cl-assertion-failed 'error-conditions '(error))
 (put 'cl-assertion-failed 'error-message "Assertion failed")
 
+(defconst user-emacs-directory
+  (if (eq system-type 'ms-dos)
+      ;; MS-DOS cannot have initial dot.
+      "~/_emacs.d/"
+    "~/.emacs.d/")
+  "Directory beneath which additional per-user Emacs-specific files are placed.
+Various programs in Emacs store information in this directory.
+Note that this should end with a directory separator.")
+
 \f
 ;;;; Misc. useful functions.
 
@@ -2299,6 +2310,15 @@ Wildcards and redirection are handled as usual in the shell.
     (start-process name buffer shell-file-name shell-command-switch
                   (mapconcat 'identity args " ")))))
 
+(defun start-file-process-shell-command (name buffer &rest args)
+  "Start a program in a subprocess.  Return the process object for it.
+Similar to `start-process-shell-command', but calls `start-file-process'."
+  (start-file-process
+   name buffer
+   (if (file-remote-p default-directory) "/bin/sh" shell-file-name)
+   (if (file-remote-p default-directory) "-c" shell-command-switch)
+   (mapconcat 'identity args " ")))
+
 (defun call-process-shell-command (command &optional infile buffer display
                                           &rest args)
   "Execute the shell command COMMAND synchronously in separate process.
@@ -2330,6 +2350,16 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again."
                  infile buffer display
                  shell-command-switch
                  (mapconcat 'identity (cons command args) " ")))))
+
+(defun process-file-shell-command (command &optional infile buffer display
+                                          &rest args)
+  "Process files synchronously in a separate process.
+Similar to `call-process-shell-command', but calls `process-file'."
+  (process-file
+   (if (file-remote-p default-directory) "/bin/sh" shell-file-name)
+   infile buffer display
+   (if (file-remote-p default-directory) "-c" shell-command-switch)
+   (mapconcat 'identity (cons command args) " ")))
 \f
 ;;;; Lisp macros to do various things temporarily.
 
@@ -2475,6 +2505,29 @@ If BODY finishes, `while-no-input' returns whatever value BODY produced."
           (or (input-pending-p)
               ,@body))))))
 
+(defmacro condition-case-no-debug (var bodyform &rest handlers)
+  "Like `condition-case' except that it does not catch anything when debugging.
+More specifically if `debug-on-error' is set, then it does not catch any signal."
+  (declare (debug condition-case) (indent 2))
+  (let ((bodysym (make-symbol "body")))
+    `(let ((,bodysym (lambda () ,bodyform)))
+       (if debug-on-error
+           (funcall ,bodysym)
+         (condition-case ,var
+             (funcall ,bodysym)
+           ,@handlers)))))
+
+(defmacro with-demoted-errors (&rest body)
+  "Run BODY and demote any errors to simple messages.
+If `debug-on-error' is non-nil, run BODY without catching its errors.
+This is to be used around code which is not expected to signal an error
+but which should be robust in the unexpected case that an error is signalled."
+  (declare (debug t) (indent 0))
+  (let ((err (make-symbol "err")))
+    `(condition-case-no-debug ,err
+         (progn ,@body)
+       (error (message "Error: %s" ,err) nil))))
+
 (defmacro combine-after-change-calls (&rest body)
   "Execute BODY, but don't call the after-change functions till the end.
 If BODY makes changes in the buffer, they are recorded
@@ -2509,6 +2562,20 @@ The value returned is the value of the last form in BODY."
 \f
 ;;;; Constructing completion tables.
 
+(defun complete-with-action (action table string pred)
+  "Perform completion ACTION.
+STRING is the string to complete.
+TABLE is the completion table, which should not be a function.
+PRED is a completion predicate.
+ACTION can be one of nil, t or `lambda'."
+  ;; (assert (not (functionp table)))
+  (funcall
+   (cond
+    ((null action) 'try-completion)
+    ((eq action t) 'all-completions)
+    (t 'test-completion))
+   string table pred))
+
 (defmacro dynamic-completion-table (fun)
   "Use function FUN as a dynamic completion table.
 FUN is called with one argument, the string for which completion is required,
@@ -2530,10 +2597,7 @@ that can be used as the ALIST argument to `try-completion' and
        (with-current-buffer (let ((,win (minibuffer-selected-window)))
                               (if (window-live-p ,win) (window-buffer ,win)
                                 (current-buffer)))
-         (cond
-          ((eq ,mode t) (all-completions ,string (,fun ,string) ,predicate))
-          ((not ,mode) (try-completion ,string (,fun ,string) ,predicate))
-          (t (test-completion ,string (,fun ,string) ,predicate)))))))
+         (complete-with-action ,mode (,fun ,string) ,string ,predicate)))))
 
 (defmacro lazy-completion-table (var fun)
   ;; We used to have `&rest args' where `args' were evaluated late (at the
@@ -2658,6 +2722,18 @@ of a match for REGEXP."
            (looking-at (concat "\\(?:"  regexp "\\)\\'")))))
     (not (null pos))))
 
+(defsubst looking-at-p (regexp)
+  "\
+Same as `looking-at' except this function does not change the match data."
+  (let ((inhibit-changing-match-data t))
+    (looking-at regexp)))
+
+(defsubst string-match-p (regexp string &optional start)
+  "\
+Same as `string-match' except this function does not change the match data."
+  (let ((inhibit-changing-match-data t))
+    (string-match regexp string start)))
+
 (defun subregexp-context-p (regexp pos &optional start)
   "Return non-nil if POS is in a normal subregexp context in REGEXP.
 A subregexp context is one where a sub-regexp can appear.
dissimilarity index 87%
index 99e42fe..821bad4 100644 (file)
-;;; t-mouse.el --- mouse support within the text terminal
-
-;; Authors: Alessandro Rubini and Ian T Zimmerman
-;; Maintainer: Nick Roberts <nickrob@gnu.org>
-;; Keywords: mouse gpm linux
-
-;; Copyright (C) 1994, 1995, 1998, 2006, 2007 Free Software Foundation, Inc.
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;; This package provides access to mouse event as reported by the
-;; gpm-Linux package.  It uses the program "mev" to get mouse events.
-;; It tries to reproduce the functionality offered by Emacs under X.
-;; The "gpm" server runs under Linux, so this package is rather
-;; Linux-dependent.
-
-;; Modified by Nick Roberts for Emacs 22.  In particular, the mode-line is
-;; now position sensitive.
-
-(defvar t-mouse-process nil
-  "Embeds the process which passes mouse events to Emacs.
-It is used by the program t-mouse.")
-
-(defvar t-mouse-filter-accumulator ""
-  "Accumulates input from the mouse reporting process.")
-
-(defvar t-mouse-debug-buffer nil
-  "Events normally posted to command queue are printed here in debug mode.
-See `t-mouse-start-debug'.")
-
-(defvar t-mouse-current-xy '(0 . 0)
-  "Stores the last mouse position t-mouse has been told about.")
-
-(defvar t-mouse-drag-start nil
-  "Whenever a drag starts in a special part of a window
-\(not the text), the `translated' starting coordinates including the
-window and part involved are saved here.  This is necessary lest they
-get re-translated when the button goes up, at which time window
-configuration may have changed.")
-
-(defvar t-mouse-prev-set-selection-function 'x-set-selection)
-(defvar t-mouse-prev-get-selection-function 'x-get-selection)
-
-(defvar t-mouse-swap-alt-keys nil
-  "When set, Emacs will handle mouse events with the right Alt
-\(a.k.a.  Alt-Ger) modifier, not with the regular left Alt modifier.
-Useful for people who play strange games with their keyboard tables.")
-
-(defvar t-mouse-fix-21 nil
-  "Enable brain-dead chords for 2 button mice.")
-
-\f
-;;; Code:
-
-;; get the number of the current virtual console
-
-(defun t-mouse-tty ()
-  "Return number of virtual terminal Emacs is running on, as a string.
-For example, \"2\" for /dev/tty2."
-  (with-temp-buffer
-    (call-process "ps" nil t nil "h" (format "%s" (emacs-pid)))
-    (goto-char (point-min))
-    (if (or
-        ;; Many versions of "ps", all different....
-        (re-search-forward " +tty\\(.?[0-9a-f]\\)" nil t)
-        (re-search-forward "p \\([0-9a-f]\\)" nil t)
-        (re-search-forward "v0\\([0-9a-f]\\)" nil t)
-        (re-search-forward "[0-9]+ +\\([0-9]+\\)" nil t)
-        (re-search-forward "[\\t ]*[0-9]+[\\t ]+\\([0-9]+\\)" nil t)
-        (re-search-forward " +vc/\\(.?[0-9a-f]\\)" nil t)
-        (re-search-forward " +pts/\\(.?[0-9a-f]\\)" nil t))
-       (buffer-substring (match-beginning 1) (match-end 1)))))
-
-\f
-;; due to a horrible kludge in Emacs' keymap handler
-;; (read_key_sequence) mouse clicks on funny parts of windows generate
-;; TWO events, the first being a dummy of the sort '(mode-line).
-;; That's why Per Abrahamsen's code in xt-mouse.el doesn't work for
-;; the modeline, for instance.
-
-;; now get this:  the Emacs C code that generates these fake events
-;; depends on certain things done by the very lowest level input
-;; handlers; namely the symbols for the events (for instance
-;; 'C-S-double-mouse-2) must have an 'event-kind property, set to
-;; 'mouse-click.  Since events from unread-command-events do not pass
-;; through the low level handlers, they don't get this property unless
-;; I set it myself.  I imagine this has caused innumerable attempts by
-;; hackers to do things similar to t-mouse to lose.
-
-;; The next page of code is devoted to fixing this ugly problem.
-
-;; WOW! a fully general powerset generator
-;; (C) Ian Zimmerman Mon Mar 23 12:00:16 PST 1998 :-)
-(defun t-mouse-powerset (l)
-  (if (null l) '(nil)
-    (let ((l1 (t-mouse-powerset (cdr l)))
-          (first (nth 0 l)))
-      (append
-       (mapcar (function (lambda (l) (cons first l))) l1) l1))))
-
-;; and a slightly less general cartesian product
-(defun t-mouse-cartesian (l1 l2)
-  (if (null l1) l2
-    (append (mapcar (function (lambda (x) (append (nth 0 l1) x))) l2)
-            (t-mouse-cartesian (cdr l1) l2))))
-
-(let* ((modifier-sets (t-mouse-powerset '(control meta shift)))
-       (typed-sets (t-mouse-cartesian '((down) (drag))
-                                      '((mouse-1) (mouse-2) (mouse-3))))
-       (multipled-sets (t-mouse-cartesian '((double) (triple)) typed-sets))
-       (all-sets (t-mouse-cartesian modifier-sets multipled-sets)))
-  (while all-sets
-    (let ((event-sym (event-convert-list (nth 0 all-sets))))
-      (if (not (get event-sym 'event-kind))
-          (put event-sym 'event-kind 'mouse-click)))
-    (setq all-sets (cdr all-sets))))
-
-(defun t-mouse-make-event-element (x-dot-y-avec-time)
-  (let* ((x-dot-y (nth 0 x-dot-y-avec-time))
-        (time (nth 1 x-dot-y-avec-time))
-         (x (car x-dot-y))
-         (y (cdr x-dot-y))
-         (w (window-at x y))
-         (ltrb (window-edges w))
-         (left (nth 0 ltrb))
-         (top (nth 1 ltrb))
-        (event (if w
-                   (posn-at-x-y (- x left) (- y top) w t)
-                 (append (list nil 'menu-bar)
-                         (nthcdr 2 (posn-at-x-y x y))))))
-    (setcar (nthcdr 3 event) time)
-    event))
-
-;;; This fun is partly Copyright (C) 1994 Per Abrahamsen <abraham@iesd.auc.dk>
-(defun t-mouse-make-event ()
-  "Make a Lisp style event from the contents of mouse input accumulator.
-Also trim the accumulator by all the data used to build the event."
-  (let (ob (ob-pos (condition-case nil
-                      (progn
-                        ;; this test is just needed for Fedora Core 3
-                        (if (string-match "STILL RUNNING_1\n"
-                                          t-mouse-filter-accumulator)
-                            (setq t-mouse-filter-accumulator
-                                  (substring
-                                   t-mouse-filter-accumulator (match-end 0))))
-                        (read-from-string t-mouse-filter-accumulator))
-                     (error nil))))
-    ;; this test is just needed for Fedora Core 3
-    (if (or (eq (car ob-pos) 'STILL) (eq (car ob-pos) '***) (not ob-pos))
-       nil
-      (setq ob (car ob-pos))
-      (if (string-match "mev:$" (prin1-to-string ob))
-         (error "Can't open mouse connection"))
-      (setq t-mouse-filter-accumulator
-            (substring t-mouse-filter-accumulator (cdr ob-pos)))
-
-      ;;now the real work
-
-      (let ((event-type (nth 0 ob))
-            (current-xy-avec-time (nth 1 ob))
-            (type-switch (length ob)))
-       (if t-mouse-fix-21
-            (let
-                ;;Acquire the event's symbol's name.
-                ((event-name-string (symbol-name event-type))
-                 end-of-root-event-name
-                 new-event-name-string)
-
-              (if (string-match "-\\(21\\|\\12\\)$" event-name-string)
-
-                  ;;Transform the name to what it should have been.
-                  (progn
-                    (setq end-of-root-event-name (match-beginning 0))
-                    (setq new-event-name-string
-                          (concat (substring
-                                   event-name-string 0
-                                   end-of-root-event-name) "-3"))
-
-                    ;;Change the event to the symbol that corresponds to the
-                    ;;name we made. The proper symbol already exists.
-                    (setq event-type
-                          (intern new-event-name-string))))))
-
-        ;;store current position for mouse-position
-
-        (setq t-mouse-current-xy (nth 0 current-xy-avec-time))
-
-        ;;events have many types but fortunately they differ in length
-
-        (cond
-         ((= type-switch 4)             ;must be drag
-          (let ((count (nth 2 ob))
-                (start-element
-                 (or t-mouse-drag-start
-                     (t-mouse-make-event-element (nth 3 ob))))
-                (end-element
-                 (t-mouse-make-event-element current-xy-avec-time)))
-            (setq t-mouse-drag-start nil)
-            (list event-type start-element end-element count)))
-         ((= type-switch 3)             ;down or up
-          (let ((count (nth 2 ob))
-                (element
-                 (t-mouse-make-event-element current-xy-avec-time)))
-            (if (and (not t-mouse-drag-start)
-                     (symbolp (nth 1 element)))
-                ;; OUCH! GOTCHA! emacs uses setc[ad]r on these!
-                (setq t-mouse-drag-start (copy-sequence element))
-              (setq t-mouse-drag-start nil))
-            (list event-type element count)))
-         ((= type-switch 2)             ;movement
-          (list (if (eq 'vertical-scroll-bar
-                        (nth 1 t-mouse-drag-start)) 'scroll-bar-movement
-                  'mouse-movement)
-                (t-mouse-make-event-element current-xy-avec-time))))))))
-
-(defun t-mouse-process-filter (proc string)
-  (setq t-mouse-filter-accumulator
-        (concat t-mouse-filter-accumulator string))
-  (let ((event (t-mouse-make-event)))
-    (while event
-      (if (or track-mouse
-              (not (eq 'mouse-movement (event-basic-type event))))
-          (setq unread-command-events
-                (nconc unread-command-events (list event))))
-      (if t-mouse-debug-buffer
-          (print unread-command-events t-mouse-debug-buffer))
-      (setq event (t-mouse-make-event)))))
-
-(defun t-mouse-mouse-position-function (pos)
-  "Return the t-mouse-position unless running with a window system.
-The (secret) scrollbar interface is not implemented yet."
-  (setcdr pos t-mouse-current-xy)
-  pos)
-
-;; It should be possible to just send SIGTSTP to the inferior with
-;; stop-process.  That doesn't work; mev receives the signal fine but
-;; is not really stopped: instead it returns from
-;; kill(getpid(), SIGTSTP) immediately.  I don't understand what's up
-;; itz Tue Mar 24 14:27:38 PST 1998.
-
-(add-hook 'suspend-hook
-          (function (lambda ()
-                      (and t-mouse-process
-                           ;(stop-process t-mouse-process)
-                           (process-send-string
-                            t-mouse-process "push -enone -dall -Mnone\n")))))
-
-(add-hook 'suspend-resume-hook
-          (function (lambda ()
-                      (and t-mouse-process
-                           ;(continue-process t-mouse-process)
-                           (process-send-string t-mouse-process "pop\n")))))
-
-;;;###autoload
-(define-minor-mode t-mouse-mode
-  "Toggle t-mouse mode to use the mouse in Linux consoles.
-With prefix arg, turn t-mouse mode on if arg is positive, otherwise turn it
-off.
-
-This allows the use of the mouse when operating on a Linux console, in the
-same way as you can use the mouse under X11.
-It requires the `mev' program, part of the `gpm' utilities."
-  nil " Mouse" nil :global t
-  (if t-mouse-mode
-      ;; Turn it on
-      (unless window-system
-        ;; Starts getting a stream of mouse events from an asynchronous process.
-        ;; Only works if Emacs is running on a virtual terminal without a window system.
-       (progn
-        (setq mouse-position-function #'t-mouse-mouse-position-function)
-        (let ((tty (t-mouse-tty))
-              (process-connection-type t))
-          (if (not (stringp tty))
-              (error "Cannot find a virtual terminal"))
-          (setq t-mouse-process
-                (start-process "t-mouse" nil
-                               "mev" "-i" "-E" "-C" tty
-                               (if t-mouse-swap-alt-keys
-                                   "-M-leftAlt" "-M-rightAlt")
-                               "-e-move"
-                               "-dall" "-d-hard"
-                               "-f")))
-        (setq t-mouse-filter-accumulator "")
-        (set-process-filter t-mouse-process 't-mouse-process-filter)
-        (set-process-query-on-exit-flag t-mouse-process nil)))
-    ;; Turn it off
-    (setq mouse-position-function nil)
-    (delete-process t-mouse-process)
-    (setq t-mouse-process nil)))
-
-(provide 't-mouse)
-
-;; arch-tag: a63163b3-bfbe-4eb2-ab4f-201cd164b05d
-;;; t-mouse.el ends here
+;;; t-mouse.el --- mouse support within the text terminal
+
+;; Author: Nick Roberts <nickrob@gnu.org>
+;; Maintainer: FSF
+;; Keywords: mouse gpm linux
+
+;; Copyright (C) 1994, 1995, 1998, 2006, 2007 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;; This package provides access to mouse event as reported by the gpm-Linux
+;; package. It tries to reproduce the functionality offered by Emacs under X.
+;; The "gpm" server runs under Linux, so this package is rather
+;; Linux-dependent.
+
+;; The file, t-mouse.el was originally written by Alessandro Rubini and Ian T
+;; Zimmerman, and Emacs communicated with gpm through a client program called
+;; mev.  Now the interface with gpm is directly through a Unix socket, so this
+;; file is reduced to a single minor mode macro call.
+
+;; 
+\f
+;;; Code:
+
+;;;###autoload
+(define-minor-mode t-mouse-mode
+  "Toggle t-mouse mode to use the mouse in Linux consoles.
+With prefix arg, turn t-mouse mode on if arg is positive, otherwise turn it
+off.
+
+This allows the use of the mouse when operating on a Linux console, in the
+same way as you can use the mouse under X11.
+It requires the `mev' program, part of the `gpm' utilities."
+  :global t :group 'mouse
+  (if window-system
+      (error "t-mouse only works in the console on GNU/Linux")
+    (if t-mouse-mode
+       (progn
+         (unless (fboundp 'term-open-connection)
+           (progn
+             (setq t-mouse-mode nil)
+             (error "Emacs must be built with Gpm to use this mode")))
+         (unless (term-open-connection)
+           (progn
+             (setq t-mouse-mode nil)
+             (error "Can't open mouse connection"))))
+      ;; Turn it off
+      (term-close-connection))))
+
+(provide 't-mouse)
+
+;; arch-tag: a63163b3-bfbe-4eb2-ab4f-201cd164b05d
+;;; t-mouse.el ends here
index 77b62a1..944694b 100644 (file)
@@ -750,9 +750,7 @@ appear on disk when you save the tar-file's buffer."
                             ;; that the file's contents' encoding and
                             ;; EOL format are auto-detected.
                             (let ((file-name-handler-alist
-                                   (if (featurep 'dos-w32)
-                                       '(("" . tar-file-name-handler))
-                                     file-name-handler-alist)))
+                                   '(("" . tar-file-name-handler))))
                               (car (find-operation-coding-system
                                     'insert-file-contents
                                     (cons name (current-buffer)) t)))))
index 370f643..523d206 100644 (file)
 
 (defgroup term nil
   "General command interpreter in a window."
-  :group 'processes
-  :group 'unix)
+  :group 'processes)
 
 \f
 ;;; Buffer Local Variables:
@@ -3723,12 +3722,12 @@ all pending output has been dealt with."))
 (defun term-erase-in-display (kind)
   "Erases (that is blanks out) part of the window.
 If KIND is 0, erase from (point) to (point-max);
-if KIND is 1, erase from home to point; else erase from home to point-max.
-Should only be called when point is at the start of a screen line."
+if KIND is 1, erase from home to point; else erase from home to point-max."
   (term-handle-deferred-scroll)
   (cond ((eq term-terminal-parameter 0)
-        (delete-region (point) (point-max))
-        (term-unwrap-line))
+        (let ((need-unwrap (bolp)))
+          (delete-region (point) (point-max))
+          (when need-unwrap (term-unwrap-line))))
        ((let ((row (term-current-row))
              (col (term-horizontal-column))
              (start-region term-home-marker)
index 7fa9a96..84de596 100644 (file)
@@ -9,6 +9,9 @@
   ;; It can't really display underlines.
   (tty-no-underline)
 
+  (condition-case nil (t-mouse-mode 1)
+    (error nil))
+
   ;; Make Latin-1 input characters work, too.
   ;; Meta will continue to work, because the kernel
   ;; turns that into Escape.
index 2e03b85..44f8f70 100644 (file)
@@ -1710,6 +1710,19 @@ in `selection-converter-alist', which see."
              (setq modifiers (cons (car modifier-mask) modifiers)))))
     modifiers))
 
+(defun mac-ae-reopen-application (event)
+  "Show some frame in response to the Apple event EVENT.
+The frame to be shown is chosen from visible or iconified frames
+if possible.  If there's no such frame, a new frame is created."
+  (interactive "e")
+  (unless (frame-visible-p (selected-frame))
+    (let ((frame (or (car (visible-frame-list))
+                    (car (filtered-frame-list 'frame-visible-p)))))
+      (if frame
+         (select-frame frame)
+       (switch-to-buffer-other-frame "*scratch*"))))
+  (select-frame-set-input-focus (selected-frame)))
+
 (defun mac-ae-open-documents (event)
   "Open the documents specified by the Apple event EVENT."
   (interactive "e")
@@ -1766,9 +1779,9 @@ Currently the `mailto' scheme is supported."
 (define-key mac-apple-event-map [core-event open-application] 0)
 
 ;; Received when a dock or application icon is clicked and Emacs is
-;; already running.  Simply ignored.  Another idea is to make a new
-;; frame if all frames are invisible.
-(define-key mac-apple-event-map [core-event reopen-application] 'ignore)
+;; already running.
+(define-key mac-apple-event-map [core-event reopen-application]
+  'mac-ae-reopen-application)
 
 (define-key mac-apple-event-map [core-event open-documents]
   'mac-ae-open-documents)
@@ -2252,7 +2265,7 @@ See also `mac-dnd-known-types'."
         (handler (cdr type-info))
         (w (posn-window (event-start event))))
     (when handler
-      (if (and (windowp w) (window-live-p w)
+      (if (and (window-live-p w)
               (not (window-minibuffer-p w))
               (not (window-dedicated-p w)))
          ;; If dropping in an ordinary window which we could use,
index a3fad58..43fc37c 100644 (file)
@@ -266,7 +266,7 @@ See also `emacs-session-save'.")
 If the directory ~/.emacs.d exists, we make a filename in there, otherwise
 a file in the home directory."
   (let ((basename (concat "session." session-id))
-       (emacs-dir "~/.emacs.d/"))
+       (emacs-dir user-emacs-directory))
     (expand-file-name (if (file-directory-p emacs-dir)
                          (concat emacs-dir basename)
                        (concat "~/.emacs-" basename)))))
index f7c3f92..5eb1d8b 100644 (file)
     ;; Do it!
     (xterm-register-default-colors)
     ;; This recomputes all the default faces given the colors we've just set up.
-    (tty-set-up-initial-frame-faces)))
+    (tty-set-up-initial-frame-faces)
+
+    ;; Try to turn on the modifyOtherKeys feature on modern xterms.
+    ;; When it is turned on much more key bindings work: things like
+    ;; C-. C-, etc.
+    ;; To do that we need to find out if the current terminal supports
+    ;; modifyOtherKeys. At this time only xterm does.
+    (let ((coding-system-for-read 'binary)
+         (chr nil)
+         (str nil))
+      ;; Try to find out the type of terminal by sending a "Secondary
+      ;; Device Attributes (DA)" query.
+      (send-string-to-terminal "\e[>0c")
+
+      ;; The reply should be of the form: \e [ > NUMBER1 ; NUMBER2 ; NUMBER3 c
+      (when (equal (read-event nil nil 0.1) ?\e)
+       (when (equal (read-event nil nil 0.1) ?\[)
+         (while (not (equal (setq chr (read-event nil nil 0.1)) ?c))
+           (setq str (concat str (string chr))))
+         (when (string-match ">0;\\([0-9]+\\);0" str)
+           ;; NUMBER2 is the xterm version number, look for something
+           ;; greater than 216, the version when modifyOtherKeys was
+           ;; introduced.
+           (when (>= (string-to-number 
+                      (substring str (match-beginning 1) (match-end 1))) 216)
+             ;; Make sure that the modifyOtherKeys state is restored when
+             ;; suspending, resuming and exiting.
+             (add-hook 'suspend-hook 'xterm-turn-off-modify-other-keys)
+             (add-hook 'suspend-resume-hook 'xterm-turn-on-modify-other-keys)
+             (add-hook 'kill-emacs-hook 'xterm-turn-off-modify-other-keys)
+             (xterm-turn-on-modify-other-keys))))))))
 
 ;; Set up colors, for those versions of xterm that support it.
 (defvar xterm-standard-colors
@@ -518,5 +548,13 @@ versions of xterm."
     ;; right colors, so clear them.
     (clear-face-cache)))
 
+(defun xterm-turn-on-modify-other-keys ()
+  "Turn on the modifyOtherKeys feature of xterm."
+  (send-string-to-terminal "\e[>4;1m"))
+
+(defun xterm-turn-off-modify-other-keys ()
+  "Turn off the modifyOtherKeys feature of xterm."
+  (send-string-to-terminal "\e[>4m"))
+
 ;; arch-tag: 12e7ebdd-1e6c-4b25-b0f9-35ace25e855a
 ;;; xterm.el ends here
index 639bdd6..6d2d8ae 100644 (file)
@@ -34,7 +34,7 @@
 ;;  Major mode for editing and validating BibTeX files.
 
 ;;  Usage:
-;;  See documentation for function bibtex-mode or type "\M-x describe-mode"
+;;  See documentation for `bibtex-mode' or type "M-x describe-mode"
 ;;  when you are in BibTeX mode.
 
 ;;  Todo:
@@ -112,6 +112,7 @@ required-fields     Signal an error if a required field is missing.
 numerical-fields    Delete delimiters around numeral fields.
 page-dashes         Change double dashes in page field to single dash
                       (for scribe compatibility).
+whitespace          Delete whitespace at the beginning and end of fields.
 inherit-booktitle   If entry contains a crossref field and the booktitle
                       field is empty, set the booktitle field to the content
                       of the title field of the crossreferenced entry.
@@ -123,6 +124,10 @@ last-comma          Add or delete comma on end of last field in entry,
 delimiters          Change delimiters according to variables
                       `bibtex-field-delimiters' and `bibtex-entry-delimiters'.
 unify-case          Change case of entry and field names.
+braces              Enclose parts of field entries by braces according to
+                      `bibtex-field-braces-alist'.
+strings             Replace parts of field entries by string constants
+                      according to `bibtex-field-strings-alist'.
 
 The value t means do all of the above formatting actions.
 The value nil means do no formatting at all."
@@ -134,11 +139,35 @@ The value nil means do no formatting at all."
                       (const required-fields)
                       (const numerical-fields)
                       (const page-dashes)
+                      (const whitespace)
                       (const inherit-booktitle)
                       (const realign)
                       (const last-comma)
                       (const delimiters)
-                      (const unify-case))))
+                      (const unify-case)
+                      (const braces)
+                      (const strings))))
+
+(defcustom bibtex-field-braces-alist nil
+ "Alist of field regexps that \\[bibtex-clean-entry] encloses by braces.
+Each element has the form (FIELDS REGEXP), where FIELDS is a list
+of BibTeX field names and REGEXP is a regexp.
+Whitespace in REGEXP will be replaced by \"[ \\t\\n]+\"."
+  :group 'bibtex
+  :type '(repeat (list (repeat (string :tag "field name"))
+                       (choice (regexp :tag "regexp")
+                               (sexp :tag "sexp")))))
+
+(defcustom bibtex-field-strings-alist nil
+ "Alist of regexps that \\[bibtex-clean-entry] replaces by string constants.
+Each element has the form (FIELDS REGEXP TO-STR), where FIELDS is a list
+of BibTeX field names.  In FIELDS search for REGEXP, which are replaced
+by the BibTeX string constant TO-STR.
+Whitespace in REGEXP will be replaced by \"[ \\t\\n]+\"."
+  :group 'bibtex
+  :type '(repeat (list (repeat (string :tag "field name"))
+                       (regexp :tag "From regexp")
+                       (regexp :tag "To string constant"))))
 
 (defcustom bibtex-clean-entry-hook nil
   "List of functions to call when entry has been cleaned.
@@ -899,6 +928,17 @@ The following is a complex example, see http://link.aps.org/linkfaq.html.
                                       (function :tag "Filter"))))))))
 (put 'bibtex-generate-url-list 'risky-local-variable t)
 
+(defcustom bibtex-cite-matcher-alist
+  '(("\\\\cite[ \t\n]*{\\([^}]+\\)}" . 1))
+  "Alist of rules to identify cited keys in a BibTeX entry.
+Each rule should be of the form (REGEXP . SUBEXP), where SUBEXP
+specifies which parenthesized expression in REGEXP is a cited key.
+Case is significant.
+Used by `bibtex-find-crossref' and for font-locking."
+  :group 'bibtex
+  :type '(repeat (cons (regexp :tag "Regexp")
+                       (integer :tag "Number"))))
+
 (defcustom bibtex-expand-strings nil
   "If non-nil, expand strings when extracting the content of a BibTeX field."
   :group 'bibtex
@@ -1070,6 +1110,17 @@ The following is a complex example, see http://link.aps.org/linkfaq.html.
 \f
 ;; Internal Variables
 
+(defvar bibtex-field-braces-opt nil
+  "Optimized value of `bibtex-field-braces-alist'.
+Created by `bibtex-field-re-init'.
+It is a an alist with elements (FIELD . REGEXP).")
+
+(defvar bibtex-field-strings-opt nil
+  "Optimized value of `bibtex-field-strings-alist'.
+Created by `bibtex-field-re-init'.
+It is a an alist with elements (FIELD RULE1 RULE2 ...),
+where each RULE is (REGEXP . TO-STR).")
+
 (defvar bibtex-pop-previous-search-point nil
   "Next point where `bibtex-pop-previous' starts looking for a similar entry.")
 
@@ -1215,7 +1266,11 @@ The CDRs of the elements are t for header keys and nil for crossref keys.")
     (,(concat "^[ \t]*\\(" bibtex-field-name "\\)[ \t]*=")
      1 font-lock-variable-name-face)
     ;; url
-    (bibtex-font-lock-url) (bibtex-font-lock-crossref))
+    (bibtex-font-lock-url) (bibtex-font-lock-crossref)
+    ;; cite
+    ,@(mapcar (lambda (matcher)
+                `((lambda (bound) (bibtex-font-lock-cite ',matcher bound))))
+              bibtex-cite-matcher-alist))
   "*Default expressions to highlight in BibTeX mode.")
 
 (defvar bibtex-font-lock-url-regexp
@@ -1223,7 +1278,7 @@ The CDRs of the elements are t for header keys and nil for crossref keys.")
   (concat "^[ \t]*"
           (regexp-opt (delete-dups (mapcar 'caar bibtex-generate-url-list)) t)
           "[ \t]*=[ \t]*")
-  "Regexp for `bibtex-font-lock-url'.")
+  "Regexp for `bibtex-font-lock-url' derived from `bibtex-generate-url-list'.")
 
 (defvar bibtex-string-empty-key nil
   "If non-nil, `bibtex-parse-string' accepts empty key.")
@@ -1553,7 +1608,7 @@ If EMPTY-KEY is non-nil, key may be empty.  Do not move point."
         bounds))))
 
 (defun bibtex-reference-key-in-string (bounds)
-  "Return the key part of a BibTeX string defined via BOUNDS"
+  "Return the key part of a BibTeX string defined via BOUNDS."
   (buffer-substring-no-properties (nth 1 (car bounds))
                                   (nth 2 (car bounds))))
 
@@ -1626,8 +1681,8 @@ of the entry, see regexp `bibtex-entry-head'."
                    (if (save-excursion
                          (goto-char (match-end bibtex-type-in-head))
                          (looking-at "[ \t]*("))
-                       ",?[ \t\n]*)" ;; entry opened with `('
-                     ",?[ \t\n]*}")) ;; entry opened with `{'
+                       ",?[ \t\n]*)" ; entry opened with `('
+                     ",?[ \t\n]*}")) ; entry opened with `{'
                   bounds)
               (skip-chars-forward " \t\n")
               ;; loop over all BibTeX fields
@@ -1736,7 +1791,7 @@ If FLAG is nil, a message is echoed if point was incremented at least
                  (< (point) pnt))
         (goto-char (match-beginning bibtex-type-in-head))
         (if (pos-visible-in-window-p (point))
-            (sit-for 1)
+            (sit-for blink-matching-delay)
           (message "%s%s" prompt (buffer-substring-no-properties
                                   (point) (match-end bibtex-key-in-head))))))))
 
@@ -1801,21 +1856,19 @@ Optional arg BEG is beginning of entry."
   "Reinsert the Nth stretch of killed BibTeX text (field or entry).
 Optional arg COMMA is as in `bibtex-enclosing-field'."
   (unless bibtex-last-kill-command (error "BibTeX kill ring is empty"))
-  (let ((fun (lambda (kryp kr) ;; adapted from `current-kill'
+  (let ((fun (lambda (kryp kr) ; adapted from `current-kill'
                (car (set kryp (nthcdr (mod (- n (length (eval kryp)))
                                            (length kr)) kr))))))
     (if (eq bibtex-last-kill-command 'field)
         (progn
           ;; insert past the current field
           (goto-char (bibtex-end-of-field (bibtex-enclosing-field comma)))
-          (set-mark (point))
-          (message "Mark set")
+          (push-mark)
           (bibtex-make-field (funcall fun 'bibtex-field-kill-ring-yank-pointer
                                       bibtex-field-kill-ring) t nil t))
       ;; insert past the current entry
       (bibtex-skip-to-valid-entry)
-      (set-mark (point))
-      (message "Mark set")
+      (push-mark)
       (insert (funcall fun 'bibtex-entry-kill-ring-yank-pointer
                        bibtex-entry-kill-ring)))))
 
@@ -1835,6 +1888,15 @@ Formats current entry according to variable `bibtex-entry-format'."
             crossref-key bounds alternatives-there non-empty-alternative
             entry-list req-field-list field-list)
 
+        ;; Initialize `bibtex-field-braces-opt' and `bibtex-field-strings-opt'
+        ;; if necessary.
+        (unless bibtex-field-braces-opt
+          (setq bibtex-field-braces-opt
+                (bibtex-field-re-init bibtex-field-braces-alist 'braces)))
+        (unless bibtex-field-strings-opt
+          (setq bibtex-field-strings-opt
+                (bibtex-field-re-init bibtex-field-strings-alist 'strings)))
+
         ;; identify entry type
         (goto-char (point-min))
         (or (re-search-forward bibtex-entry-type nil t)
@@ -1904,7 +1966,7 @@ Formats current entry according to variable `bibtex-entry-format'."
                  deleted)
 
             ;; We have more elegant high-level functions for several
-            ;; tasks done by bibtex-format-entry.  However, they contain
+            ;; tasks done by `bibtex-format-entry'.  However, they contain
             ;; quite some redundancy compared with what we need to do
             ;; anyway.  So for speed-up we avoid using them.
 
@@ -1957,6 +2019,59 @@ Formats current entry according to variable `bibtex-entry-format'."
                                "\\([\"{][0-9]+\\)[ \t\n]*--?[ \t\n]*\\([0-9]+[\"}]\\)")))
                   (replace-match "\\1-\\2"))
 
+              ;; remove whitespace at beginning and end of field
+              (when (memq 'whitespace format)
+                (goto-char beg-text)
+                (if (looking-at "\\([{\"]\\)[ \t\n]+")
+                    (replace-match "\\1"))
+                (goto-char end-text)
+                (if (looking-back "[ \t\n]+\\([}\"]\\)" beg-text t)
+                    (replace-match "\\1")))
+
+              ;; enclose field text by braces according to
+              ;; `bibtex-field-braces-alist'.
+              (let (case-fold-search temp) ; Case-sensitive search
+                (when (and (memq 'braces format)
+                           (setq temp (cdr (assoc-string field-name
+                                                         bibtex-field-braces-opt t))))
+                  (goto-char beg-text)
+                  (while (re-search-forward temp end-text t)
+                    (let ((beg (match-beginning 0))
+                          (bounds (bibtex-find-text-internal nil t)))
+                      (unless (or (nth 4 bounds) ; string constant
+                                  ;; match already surrounded by braces
+                                  ;; (braces are inside field delimiters)
+                                  (and (< (point) (1- (nth 2 bounds)))
+                                       (< (1+ (nth 1 bounds)) beg)
+                                       (looking-at "}")
+                                       (save-excursion (goto-char (1- beg))
+                                                       (looking-at "{"))))
+                        (insert "}")
+                        (goto-char beg)
+                        (insert "{")))))
+
+                ;; replace field text by BibTeX string constants according to
+                ;; `bibtex-field-strings-alist'.
+                (when (and (memq 'strings format)
+                           (setq temp (cdr (assoc-string field-name
+                                                         bibtex-field-strings-opt t))))
+                  (goto-char beg-text)
+                  (dolist (re temp)
+                    (while (re-search-forward (car re) end-text t)
+                      (let ((bounds (save-match-data
+                                      (bibtex-find-text-internal nil t))))
+                        (unless (nth 4 bounds)
+                          ;; if match not at right subfield boundary...
+                          (if (< (match-end 0) (1- (nth 2 bounds)))
+                              (insert " # " (bibtex-field-left-delimiter))
+                            (delete-char 1))
+                          (replace-match (cdr re))
+                          (goto-char (match-beginning 0))
+                          ;; if match not at left subfield boundary...
+                          (if (< (1+ (nth 1 bounds)) (match-beginning 0))
+                              (insert (bibtex-field-right-delimiter) " # ")
+                            (delete-backward-char 1))))))))
+
               ;; use book title of crossref'd entry
               (if (and (memq 'inherit-booktitle format)
                        empty-field
@@ -2047,6 +2162,31 @@ Formats current entry according to variable `bibtex-entry-format'."
         (if (memq 'realign format)
             (bibtex-fill-entry))))))
 
+(defun bibtex-field-re-init (regexp-alist type)
+  "Calculate optimized value for bibtex-regexp-TYPE-opt.
+This value is based on bibtex-regexp-TYPE-alist.  TYPE is 'braces or 'strings.
+Return optimized value to be used by `bibtex-format-entry'."
+  (setq regexp-alist
+        (mapcar (lambda (e)
+                  (list (car e)
+                        (replace-regexp-in-string "[ \t\n]+" "[ \t\n]+" (nth 1 e))
+                        (nth 2 e))) ; nil for 'braces'.
+                regexp-alist))
+  (let (opt-list)
+    ;; Loop over field names
+    (dolist (field (delete-dups (apply 'append (mapcar 'car regexp-alist))))
+      (let (rules)
+        ;; Collect all matches we have for this field name
+        (dolist (e regexp-alist)
+          (if (assoc-string field (car e) t)
+              (push (cons (nth 1 e) (nth 2 e)) rules)))
+        (if (eq type 'braces)
+            ;; concatenate all regexps to a single regexp
+            (setq rules (concat "\\(?:" (mapconcat 'car rules "\\|") "\\)")))
+        ;; create list of replacement rules.
+        (push (cons field rules) opt-list)))
+    opt-list))
+
 \f
 (defun bibtex-autokey-abbrev (string len)
   "Return an abbreviation of STRING with at least LEN characters.
@@ -2099,7 +2239,7 @@ and `bibtex-autokey-names-stretch'."
                     (<= (length name-list)
                         (+ bibtex-autokey-names
                            bibtex-autokey-names-stretch)))
-          ;; Take bibtex-autokey-names elements from beginning of name-list
+          ;; Take `bibtex-autokey-names' elements from beginning of name-list
           (setq name-list (nreverse (nthcdr (- (length name-list)
                                                bibtex-autokey-names)
                                             (nreverse name-list)))
@@ -2161,7 +2301,7 @@ Return the result as a string"
         (setq word (match-string 0 titlestring)
               titlestring (substring titlestring (match-end 0)))
         ;; Ignore words matched by one of the elements of
-        ;; bibtex-autokey-titleword-ignore
+        ;; `bibtex-autokey-titleword-ignore'
         (unless (let ((lst bibtex-autokey-titleword-ignore))
                   (while (and lst
                               (not (string-match (concat "\\`\\(?:" (car lst)
@@ -2173,9 +2313,9 @@ Return the result as a string"
                   (<= counter bibtex-autokey-titlewords))
               (push word titlewords)
             (push word titlewords-extra))))
-      ;; Obey bibtex-autokey-titlewords-stretch:
+      ;; Obey `bibtex-autokey-titlewords-stretch':
       ;; If by now we have processed all words in titlestring, we include
-      ;; titlewords-extra in titlewords. Otherwise, we ignore titlewords-extra.
+      ;; titlewords-extra in titlewords.  Otherwise, we ignore titlewords-extra.
       (unless (string-match "\\b\\w+" titlestring)
         (setq titlewords (append titlewords-extra titlewords)))
       (mapconcat 'bibtex-autokey-demangle-title (nreverse titlewords)
@@ -2343,7 +2483,7 @@ for parsing BibTeX keys.  If parsing fails, try to set this variable to nil."
                              (push (cons key t) ref-keys)))))))
 
             (let (;; ignore @String entries because they are handled
-                  ;; separately by bibtex-parse-strings
+                  ;; separately by `bibtex-parse-strings'
                   (bibtex-sort-ignore-string-entries t)
                   bounds)
               (bibtex-map-entries
@@ -2399,7 +2539,7 @@ Return alist of strings if parsing was completed, `aborted' otherwise."
           (setq bibtex-strings strings))))))
 
 (defun bibtex-strings ()
-  "Return `bibtex-strings'. Initialize this variable if necessary."
+  "Return `bibtex-strings'.  Initialize this variable if necessary."
   (if (listp bibtex-strings) bibtex-strings
     (bibtex-parse-strings (bibtex-string-files-init))))
 
@@ -2456,10 +2596,10 @@ Parsing initializes `bibtex-reference-keys' and `bibtex-strings'."
                           bibtex-buffer-last-parsed-tick)))
             (save-restriction
               (widen)
-              ;; Output no progress messages in bibtex-parse-keys
-              ;; because when in y-or-n-p that can hide the question.
+              ;; Output no progress messages in `bibtex-parse-keys'
+              ;; because when in `y-or-n-p' that can hide the question.
               (if (and (listp (bibtex-parse-keys t))
-                       ;; update bibtex-strings
+                       ;; update `bibtex-strings'
                        (listp (bibtex-parse-strings strings-init t)))
 
                   ;; remember that parsing was successful
@@ -2519,28 +2659,35 @@ already set."
 COMPLETIONS is an alist of strings.  If point is not after the part
 of a word, all strings are listed.  Return completion."
   ;; Return value is used by cleanup functions.
+  ;; Code inspired by `lisp-complete-symbol'.
   (let* ((case-fold-search t)
          (beg (save-excursion
                 (re-search-backward "[ \t{\"]")
                 (forward-char)
                 (point)))
          (end (point))
-         (part-of-word (buffer-substring-no-properties beg end))
-         (completion (try-completion part-of-word completions)))
+         (pattern (buffer-substring-no-properties beg end))
+         (completion (try-completion pattern completions)))
     (cond ((not completion)
-           (error "Can't find completion for `%s'" part-of-word))
+           (error "Can't find completion for `%s'" pattern))
           ((eq completion t)
-           part-of-word)
-          ((not (string= part-of-word completion))
+           pattern)
+          ((not (string= pattern completion))
            (delete-region beg end)
            (insert completion)
+           ;; Don't leave around a completions buffer that's out of date.
+           (let ((win (get-buffer-window "*Completions*" 0)))
+             (if win (with-selected-window win (bury-buffer))))
            completion)
           (t
-           (message "Making completion list...")
-           (with-output-to-temp-buffer "*Completions*"
-             (display-completion-list (all-completions part-of-word completions)
-                                     part-of-word))
-           (message "Making completion list...done")
+           (let ((minibuf-is-in-use
+                  (eq (minibuffer-window) (selected-window))))
+             (unless minibuf-is-in-use (message "Making completion list..."))
+             (with-output-to-temp-buffer "*Completions*"
+               (display-completion-list
+                (sort (all-completions pattern completions) 'string<) pattern))
+             (unless minibuf-is-in-use
+               (message "Making completion list...done")))
            nil))))
 
 (defun bibtex-complete-string-cleanup (str compl)
@@ -2562,20 +2709,25 @@ Use `bibtex-summary-function' to generate summary."
              (bibtex-find-entry key t))
         (message "Ref: %s" (funcall bibtex-summary-function)))))
 
-(defun bibtex-copy-summary-as-kill ()
+(defun bibtex-copy-summary-as-kill (&optional arg)
   "Push summery of current BibTeX entry to kill ring.
-Use `bibtex-summary-function' to generate summary."
-  (interactive)
-  (save-excursion
-    (bibtex-beginning-of-entry)
-    (if (looking-at bibtex-entry-maybe-empty-head)
-        (kill-new (message "%s" (funcall bibtex-summary-function)))
-      (error "No entry found"))))
+Use `bibtex-summary-function' to generate summary.
+If prefix ARG is non-nil push BibTeX entry's URL to kill ring
+that is generated by calling `bibtex-url'."
+  (interactive "P")
+  (if arg (let ((url (bibtex-url nil t)))
+            (if url (kill-new (message "%s" url))
+              (message "No URL known")))
+    (save-excursion
+      (bibtex-beginning-of-entry)
+      (if (looking-at bibtex-entry-maybe-empty-head)
+          (kill-new (message "%s" (funcall bibtex-summary-function)))
+        (error "No entry found")))))
 
 (defun bibtex-summary ()
   "Return summary of current BibTeX entry.
 Used as default value of `bibtex-summary-function'."
-  ;; It would be neat to customize this function.  How?
+  ;; It would be neat to make this function customizable.  How?
   (if (looking-at bibtex-entry-maybe-empty-head)
       (let* ((bibtex-autokey-name-case-convert-function 'identity)
              (bibtex-autokey-name-length 'infty)
@@ -2664,16 +2816,17 @@ begins at the beginning of a line.  We use this function for font-locking."
     (unless (looking-at field-reg)
       (re-search-backward field-reg nil t))))
 
-(defun bibtex-font-lock-url (bound)
-  "Font-lock for URLs.  BOUND limits the search."
+(defun bibtex-font-lock-url (bound &optional no-button)
+  "Font-lock for URLs.  BOUND limits the search.
+If NO-BUTTON is non-nil do not generate buttons."
   (let ((case-fold-search t)
         (pnt (point))
-        field bounds start end found)
+        name bounds start end found)
     (bibtex-beginning-of-field)
     (while (and (not found)
                 (<= (point) bound)
                (prog1 (re-search-forward bibtex-font-lock-url-regexp bound t)
-                 (setq field (match-string-no-properties 1)))
+                 (setq name (match-string-no-properties 1)))
                (setq bounds (bibtex-parse-field-text))
                 (progn
                   (setq start (car bounds) end (nth 1 bounds))
@@ -2682,17 +2835,18 @@ begins at the beginning of a line.  We use this function for font-locking."
                       (setq end (1- end)))
                   (if (memq (char-after start) '(?\{ ?\"))
                       (setq start (1+ start)))
-                  (>= bound start)))
-      (let ((lst bibtex-generate-url-list) url)
-        (goto-char start)
-       (while (and (not found)
-                   (setq url (car (pop lst))))
-         (setq found (and (bibtex-string= field (car url))
-                           (re-search-forward (cdr url) end t)
-                           (>= (match-beginning 0) pnt)))))
-      (goto-char end))
-    (if found (bibtex-button (match-beginning 0) (match-end 0)
-                             'bibtex-url (match-beginning 0)))
+                  (if (< start pnt) (setq start (min pnt end)))
+                  (<= start bound)))
+      (if (<= pnt start)
+          (let ((lst bibtex-generate-url-list) url)
+            (while (and (not found) (setq url (car (pop lst))))
+              (goto-char start)
+              (setq found (and (bibtex-string= name (car url))
+                               (re-search-forward (cdr url) end t))))))
+      (unless found (goto-char end)))
+    (if (and found (not no-button))
+        (bibtex-button (match-beginning 0) (match-end 0)
+                       'bibtex-url (match-beginning 0)))
     found))
 
 (defun bibtex-font-lock-crossref (bound)
@@ -2713,6 +2867,19 @@ begins at the beginning of a line.  We use this function for font-locking."
                              start t))
     found))
 
+(defun bibtex-font-lock-cite (matcher bound)
+  "Font-lock for cited keys.
+MATCHER identifies the cited key, see `bibtex-cite-matcher-alist'.
+BOUND limits the search."
+  (let (case-fold-search)
+    (if (re-search-forward (car matcher) bound t)
+        (let ((start (match-beginning (cdr matcher)))
+              (end (match-end (cdr matcher))))
+          (bibtex-button start end 'bibtex-find-crossref
+                         (buffer-substring-no-properties start end)
+                         start t t)
+          t))))
+
 (defun bibtex-button-action (button)
   "Call BUTTON's BibTeX function."
   (apply (button-get button 'bibtex-function)
@@ -2831,7 +2998,7 @@ if that value is non-nil.
         (list (list nil bibtex-entry-head bibtex-key-in-head))
         imenu-case-fold-search t)
   (make-local-variable 'choose-completion-string-functions)
-  ;; XEmacs needs easy-menu-add, Emacs does not care
+  ;; XEmacs needs `easy-menu-add', Emacs does not care
   (easy-menu-add bibtex-edit-menu)
   (easy-menu-add bibtex-entry-menu)
   (run-mode-hooks 'bibtex-mode-hook))
@@ -3125,7 +3292,7 @@ Return the new location of point."
            (goto-char (bibtex-end-of-string bounds)))
           ((looking-at bibtex-any-valid-entry-type)
            ;; Parsing of entry failed
-           (error "Syntactically incorrect BibTeX entry starts here."))
+           (error "Syntactically incorrect BibTeX entry starts here"))
           (t (if (interactive-p) (message "Not on a known BibTeX entry."))
              (goto-char pnt)))
     (point)))
@@ -3163,7 +3330,7 @@ Otherwise display the beginning of entry."
 (defun bibtex-mark-entry ()
   "Put mark at beginning, point at end of current BibTeX entry."
   (interactive)
-  (set-mark (bibtex-beginning-of-entry))
+  (push-mark (bibtex-beginning-of-entry))
   (bibtex-end-of-entry))
 
 (defun bibtex-count-entries (&optional count-string-entries)
@@ -3227,6 +3394,7 @@ of the head of the entry found.  Return nil if no entry found."
             (list key nil entry-name))))))
 
 (defun bibtex-init-sort-entry-class-alist ()
+  "Initialize `bibtex-sort-entry-class-alist' (buffer-local)."
   (unless (local-variable-p 'bibtex-sort-entry-class-alist)
     (set (make-local-variable 'bibtex-sort-entry-class-alist)
          (let ((i -1) alist)
@@ -3283,27 +3451,49 @@ are ignored."
              nil                           ; ENDKEY function
              'bibtex-lessp))               ; PREDICATE
 
-(defun bibtex-find-crossref (crossref-key &optional pnt split)
+(defun bibtex-find-crossref (crossref-key &optional pnt split noerror)
   "Move point to the beginning of BibTeX entry CROSSREF-KEY.
 If `bibtex-files' is non-nil, search all these files.
 Otherwise the search is limited to the current buffer.
 Return position of entry if CROSSREF-KEY is found or nil otherwise.
 If CROSSREF-KEY is in the same buffer like current entry but before it
-an error is signaled.  Optional arg PNT is the position of the referencing
-entry. It defaults to position of point.  If optional arg SPLIT is non-nil,
-split window so that both the referencing and the crossrefed entry are
-displayed.
-If called interactively, CROSSREF-KEY defaults to crossref key of current
-entry and SPLIT is t."
+an error is signaled.  If NOERRER is non-nil this error is suppressed.
+Optional arg PNT is the position of the referencing entry.  It defaults
+to position of point.  If optional arg SPLIT is non-nil, split window
+so that both the referencing and the crossrefed entry are displayed.
+
+If called interactively, CROSSREF-KEY defaults to either the crossref key
+of current entry or a key matched by `bibtex-cite-matcher-alist',
+whatever is nearer to the position of point.  SPLIT is t.  NOERROR is nil
+for a crossref key, t otherwise."
   (interactive
-   (let ((crossref-key
-          (save-excursion
-            (bibtex-beginning-of-entry)
-            (let ((bounds (bibtex-search-forward-field "crossref" t)))
-              (if bounds
-                  (bibtex-text-in-field-bounds bounds t))))))
-     (list (bibtex-read-key "Find crossref key: " crossref-key t)
-           (point) t)))
+   (save-excursion
+     (let* ((pnt (point))
+            (_ (bibtex-beginning-of-entry))
+            (end (cdr (bibtex-valid-entry t)))
+            (_ (unless end (error "Not inside valid entry")))
+            (beg (match-end 0)) ; set by `bibtex-valid-entry'
+            (bounds (bibtex-search-forward-field "crossref" end))
+            case-fold-search best temp crossref-key)
+       (if bounds
+           (setq crossref-key (bibtex-text-in-field-bounds bounds t)
+                 best (cons (bibtex-dist pnt (bibtex-end-of-field bounds)
+                                         (bibtex-start-of-field bounds))
+                            crossref-key)))
+       (dolist (matcher bibtex-cite-matcher-alist)
+         (goto-char beg)
+         (while (re-search-forward (car matcher) end t)
+           (setq temp (bibtex-dist pnt (match-end (cdr matcher))
+                                   (match-beginning (cdr matcher))))
+           ;; Accept the key closest to the position of point.
+           (if (or (not best) (< temp (car best)))
+               (setq best (cons temp (match-string-no-properties
+                                      (cdr matcher)))))))
+       (goto-char pnt)
+       (setq temp (bibtex-read-key "Find crossref key: " (cdr best) t))
+       (list temp (point) t (not (and crossref-key
+                                      (string= temp crossref-key)))))))
+
   (let (buffer pos eqb)
     (save-excursion
       (setq pos (bibtex-find-entry crossref-key t)
@@ -3314,13 +3504,15 @@ entry and SPLIT is t."
           (split ; called (quasi) interactively
            (unless pnt (setq pnt (point)))
            (goto-char pnt)
-           (if eqb (select-window (split-window))
-             (pop-to-buffer buffer))
-           (goto-char pos)
-           (bibtex-reposition-window)
-           (beginning-of-line)
-           (if (and eqb (> pnt pos))
-               (error "The referencing entry must precede the crossrefed entry!")))
+           (if (and eqb (= pos (save-excursion (bibtex-beginning-of-entry))))
+               (message "Key `%s' is current entry" crossref-key)
+             (if eqb (select-window (split-window))
+               (pop-to-buffer buffer))
+             (goto-char pos)
+             (bibtex-reposition-window)
+             (beginning-of-line)
+             (if (and eqb (> pnt pos) (not noerror))
+                 (error "The referencing entry must precede the crossrefed entry!"))))
           ;; `bibtex-find-crossref' is called noninteractively during
           ;; clean-up of an entry.  Then it is not possible to check
           ;; whether the current entry and the crossrefed entry have
@@ -3329,6 +3521,12 @@ entry and SPLIT is t."
           (t (set-buffer buffer) (goto-char pos)))
     pos))
 
+(defun bibtex-dist (pos beg end)
+  "Return distance between POS and region delimited by BEG and END."
+  (cond ((and (<= beg pos) (<= pos end)) 0)
+        ((< pos beg) (- beg pos))
+        (t (- pos end))))
+
 (defun bibtex-find-entry (key &optional global start display)
   "Move point to the beginning of BibTeX entry named KEY.
 Return position of entry if KEY is found or nil if not found.
@@ -3394,7 +3592,7 @@ Return t if preparation was successful or nil if entry KEY already exists."
           ;; if key-exist is non-nil due to the previous cond clause
           ;; then point will be at beginning of entry named key.
           (key-exist)
-          (t             ; bibtex-maintain-sorted-entries is non-nil
+          (t             ; `bibtex-maintain-sorted-entries' is non-nil
            (let* ((case-fold-search t)
                   (left (save-excursion (bibtex-beginning-of-first-entry)))
                   (bounds (save-excursion (goto-char (point-max))
@@ -3576,7 +3774,7 @@ Return t if test was successful, nil otherwise."
             (delete-region (point-min) (point-max))
             (insert "BibTeX mode command `bibtex-validate'\n"
                     (if syntax-error
-                        "Maybe undetected errors due to syntax errors. Correct and validate again.\n"
+                        "Maybe undetected errors due to syntax errors.  Correct and validate again.\n"
                       "\n"))
             (dolist (err error-list)
               (insert (format "%s:%d: %s\n" file (car err) (cdr err))))
@@ -3737,7 +3935,7 @@ Optional arg COMMA is as in `bibtex-enclosing-field'."
                        end-text (or (match-end bibtex-key-in-head)
                                (match-end 0))
                        end end-text
-                       no-sub t) ;; subfields do not make sense
+                       no-sub t) ; subfields do not make sense
                (setq failure t)))
             (t (setq failure t)))
       (when (and subfield (not failure))
@@ -3926,8 +4124,8 @@ begin on separate lines prior to calling `bibtex-clean-entry' or if
 Don't call `bibtex-clean-entry' on @Preamble entries.
 At end of the cleaning process, the functions in
 `bibtex-clean-entry-hook' are called with region narrowed to entry."
-  ;; Opt. arg called-by-reformat is t if bibtex-clean-entry
-  ;; is called by bibtex-reformat
+  ;; Opt. arg CALLED-BY-REFORMAT is t if `bibtex-clean-entry'
+  ;; is called by `bibtex-reformat'
   (interactive "P")
   (let ((case-fold-search t)
         (start (bibtex-beginning-of-entry))
@@ -3946,7 +4144,7 @@ At end of the cleaning process, the functions in
     ;; set key
     (when (or new-key (not key))
       (setq key (bibtex-generate-autokey))
-      ;; Sometimes bibtex-generate-autokey returns an empty string
+      ;; Sometimes `bibtex-generate-autokey' returns an empty string
       (if (or bibtex-autokey-edit-before-use (string= "" key))
           (setq key (if (eq entry-type 'string)
                         (bibtex-read-string-key key)
@@ -4027,7 +4225,7 @@ If optional arg MOVE is non-nil move point to end of field."
     (if (not justify)
         (goto-char (bibtex-start-of-text-in-field bounds))
       (goto-char (bibtex-start-of-field bounds))
-      (forward-char) ;; leading comma
+      (forward-char) ; leading comma
       (bibtex-delete-whitespace)
       (open-line 1)
       (forward-char)
@@ -4045,7 +4243,7 @@ If optional arg MOVE is non-nil move point to end of field."
       (if bibtex-align-at-equal-sign
           (insert " ")
         (indent-to-column bibtex-text-indentation)))
-    ;; Paragraphs within fields are not preserved. Bother?
+    ;; Paragraphs within fields are not preserved.  Bother?
     (fill-region-as-paragraph (line-beginning-position) end-field
                               default-justification nil (point))
     (if move (goto-char end-field))))
@@ -4130,15 +4328,19 @@ If mark is active reformat entries in region, if not in whole buffer."
                                    (,(concat (if bibtex-comma-after-last-field "Insert" "Remove")
                                              " comma at end of entry? ") . 'last-comma)
                                    ("Replace double page dashes by single ones? " . 'page-dashes)
+                                   ("Delete whitespace at the beginning and end of fields? " . 'whitespace)
                                    ("Inherit booktitle? " . 'inherit-booktitle)
                                    ("Force delimiters? " . 'delimiters)
-                                   ("Unify case of entry types and field names? " . 'unify-case))))))
+                                   ("Unify case of entry types and field names? " . 'unify-case)
+                                   ("Enclose parts of field entries by braces? " . 'braces)
+                                   ("Replace parts of field entries by string constants? " . 'strings))))))
                 ;; Do not include required-fields because `bibtex-reformat'
                 ;; cannot handle the error messages of `bibtex-format-entry'.
                 ;; Use `bibtex-validate' to check for required fields.
                 ((eq t bibtex-entry-format)
                  '(realign opts-or-alts numerical-fields delimiters
-                           last-comma page-dashes unify-case inherit-booktitle))
+                           last-comma page-dashes unify-case inherit-booktitle
+                           whitespace braces strings))
                 (t
                  (remove 'required-fields (push 'realign bibtex-entry-format)))))
          (reformat-reference-keys
@@ -4178,7 +4380,7 @@ entries from minibuffer."
   (message "Starting to validate buffer...")
   (sit-for 1 nil t)
   (bibtex-realign)
-  (deactivate-mark)  ; So bibtex-validate works on the whole buffer.
+  (deactivate-mark)  ; So `bibtex-validate' works on the whole buffer.
   (if (not (let (bibtex-maintain-sorted-entries)
              (bibtex-validate)))
       (message "Correct errors and call `bibtex-convert-alien' again")
@@ -4186,7 +4388,7 @@ entries from minibuffer."
     (sit-for 2 nil t)
     (bibtex-reformat read-options)
     (goto-char (point-max))
-    (message "Buffer is now parsable. Please save it.")))
+    (message "Buffer is now parsable.  Please save it.")))
 
 (defun bibtex-complete ()
   "Complete word fragment before point according to context.
@@ -4249,7 +4451,7 @@ An error is signaled if point is outside key or BibTeX field."
            ;;
            ;; If we quit the *Completions* buffer without requesting
            ;; a completion, `choose-completion-string-functions' is still
-           ;; non-nil. Therefore, `choose-completion-string-functions' is
+           ;; non-nil.  Therefore, `choose-completion-string-functions' is
            ;; always set (either to non-nil or nil) when a new completion
            ;; is requested.
            (let (completion-ignore-case)
@@ -4276,7 +4478,7 @@ An error is signaled if point is outside key or BibTeX field."
                       (setq choose-completion-string-functions nil)
                       (choose-completion-string choice buffer base-size)
                       (bibtex-complete-string-cleanup choice ',compl)
-                      t)) ; needed by choose-completion-string-functions
+                      t)) ; needed by `choose-completion-string-functions'
              (bibtex-complete-string-cleanup (bibtex-complete-internal compl)
                                              compl)))
 
@@ -4391,44 +4593,94 @@ An error is signaled if point is outside key or BibTeX field."
   "Browse a URL for the BibTeX entry at point.
 Optional POS is the location of the BibTeX entry.
 The URL is generated using the schemes defined in `bibtex-generate-url-list'
-\(see there\).  Then the URL is passed to `browse-url' unless NO-BROWSE is nil.
+\(see there\).  If multiple schemes match for this entry, or the same scheme
+matches more than once, use the one for which the first step's match is the
+closest to POS.  The URL is passed to `browse-url' unless NO-BROWSE is t.
 Return the URL or nil if none can be generated."
   (interactive)
+  (unless pos (setq pos (point)))
   (save-excursion
-    (if pos (goto-char pos))
+    (goto-char pos)
     (bibtex-beginning-of-entry)
-    ;; Always remove field delimiters
-    (let ((fields-alist (bibtex-parse-entry t))
+    (let ((end (save-excursion (bibtex-end-of-entry)))
+          (fields-alist (save-excursion (bibtex-parse-entry t)))
           ;; Always ignore case,
           (case-fold-search t)
-          (lst bibtex-generate-url-list)
-          field url scheme obj fmt)
-      (while (setq scheme (pop lst))
-        (when (and (setq field (cdr (assoc-string (caar scheme)
-                                                 fields-alist t)))
-                   (string-match (cdar scheme) field))
-          (setq lst nil
-                scheme (cdr scheme)
-                url (if (null scheme) (match-string 0 field)
-                      (if (stringp (car scheme))
-                          (setq fmt (pop scheme)))
-                      (dolist (step scheme)
-                        (setq field (cdr (assoc-string (car step) fields-alist t)))
-                        (if (string-match (nth 1 step) field)
-                            (push (cond ((functionp (nth 2 step))
-                                         (funcall (nth 2 step) field))
-                                        ((numberp (nth 2 step))
-                                         (match-string (nth 2 step) field))
-                                        (t
-                                         (replace-match (nth 2 step) t nil field)))
-                                  obj)
-                          ;; If the scheme is set up correctly,
-                          ;; we should never reach this point
-                          (error "Match failed: %s" field)))
-                      (if fmt (apply 'format fmt (nreverse obj))
-                        (apply 'concat (nreverse obj)))))
-          (if (interactive-p) (message "%s" url))
-          (unless no-browse (browse-url url))))
+          text url scheme obj fmt fl-match step)
+      ;; The return value of `bibtex-parse-entry' (i.e., FIELDS-ALIST)
+      ;; is always used to generate the URL.  However, if the BibTeX
+      ;; entry contains more than one URL, we have multiple matches
+      ;; for the first step defining the generation of the URL.
+      ;; Therefore, we try to initiate the generation of the URL
+      ;; based on the match of `bibtex-font-lock-url' that is the
+      ;; closest to POS.  If that fails (no match found) we try to
+      ;; initiate the generation of the URL based on the properly
+      ;; concatenated CONTENT of the field as returned by
+      ;; `bibtex-text-in-field-bounds'.  The latter approach can
+      ;; differ from the former because `bibtex-font-lock-url' uses
+      ;; the buffer itself.
+      (while (bibtex-font-lock-url end t)
+        (push (list (bibtex-dist pos (match-beginning 0) (match-end 0))
+                    (match-beginning 0)
+                    (buffer-substring-no-properties
+                     (match-beginning 0) (match-end 0)))
+              fl-match)
+        ;; `bibtex-font-lock-url' moves point to end of match.
+        (forward-char))
+      (when fl-match
+        (setq fl-match (car (sort fl-match (lambda (x y) (< (car x) (car y))))))
+        (goto-char (nth 1 fl-match))
+        (bibtex-beginning-of-field) (re-search-backward ",")
+        (let* ((bounds (bibtex-parse-field))
+               (name (bibtex-name-in-field bounds))
+               (content (bibtex-text-in-field-bounds bounds t))
+               (lst bibtex-generate-url-list))
+          ;; This match can fail when CONTENT differs from text in buffer.
+          (when (string-match (regexp-quote (nth 2 fl-match)) content)
+            ;; TEXT is the part of CONTENT that starts with the match
+            ;; of `bibtex-font-lock-url' we are looking for.
+            (setq text (substring content (match-beginning 0)))
+            (while (and (not url) (setq scheme (pop lst)))
+              ;; Verify the match of `bibtex-font-lock-url' by
+              ;; comparing with TEXT.
+              (when (and (bibtex-string= (caar scheme) name)
+                         (string-match (cdar scheme) text))
+                (setq url t scheme (cdr scheme)))))))
+
+      ;; If the match of `bibtex-font-lock-url' was not approved
+      ;; parse FIELDS-ALIST, i.e., the output of `bibtex-parse-entry'.
+      (unless url
+        (let ((lst bibtex-generate-url-list))
+          (while (and (not url) (setq scheme (pop lst)))
+            (when (and (setq text (cdr (assoc-string (caar scheme)
+                                                      fields-alist t)))
+                       (string-match (cdar scheme) text))
+              (setq url t scheme (cdr scheme))))))
+
+      (when url
+        (setq url (if (null scheme) (match-string 0 text)
+                    (if (stringp (car scheme))
+                        (setq fmt (pop scheme)))
+                    (dotimes (i (length scheme))
+                      (setq step (nth i scheme))
+                      ;; The first step shall use TEXT as obtained earlier.
+                      (unless (= i 0)
+                        (setq text (cdr (assoc-string (car step) fields-alist t))))
+                      (if (string-match (nth 1 step) text)
+                          (push (cond ((functionp (nth 2 step))
+                                       (funcall (nth 2 step) text))
+                                      ((numberp (nth 2 step))
+                                       (match-string (nth 2 step) text))
+                                      (t
+                                       (replace-match (nth 2 step) t nil text)))
+                                obj)
+                        ;; If SCHEME is set up correctly,
+                        ;; we should never reach this point
+                        (error "Match failed: %s" text)))
+                    (if fmt (apply 'format fmt (nreverse obj))
+                      (apply 'concat (nreverse obj)))))
+        (if (interactive-p) (message "%s" url))
+        (unless no-browse (browse-url url)))
       (if (and (not url) (interactive-p)) (message "No URL known."))
       url)))
 
index f686215..b00fc35 100644 (file)
     (map-char-table (lambda (c v)
                       ;; Turn punctuation (code = 1) into symbol (code = 1).
                       (if (eq (car-safe v) 1)
-                          (aset st c (cons 3 (cdr v)))))
+                          (set-char-table-range st c (cons 3 (cdr v)))))
                     st)
     st))
 
index 1815607..31ec234 100644 (file)
@@ -66,6 +66,8 @@
     ;; ' used otherwise).
     (modify-syntax-entry ?\" "\"  2" st)
     ;; Comments are delimited by \" and newline.
+    ;; And in groff also \# to newline.
+    (modify-syntax-entry ?# ".  2"  st)
     (modify-syntax-entry ?\\ "\\  1" st)
     (modify-syntax-entry ?\n ">" st)
     st)
@@ -92,7 +94,7 @@
         (mapconcat 'identity
                    '("[f*n]*\\[.+?]" ; some groff extensions
                      "(.."           ; two chars after (
-                     "[^(\"]"        ; single char escape
+                     "[^(\"#]"       ; single char escape
                      ) "\\|")
         "\\)")
    )
@@ -127,7 +129,7 @@ closing requests for requests that are used in matched pairs."
        (concat "[.']\\|" paragraph-separate))
   ;; comment syntax added by mit-erl!gildea 18 Apr 86
   (set (make-local-variable 'comment-start) "\\\" ")
-  (set (make-local-variable 'comment-start-skip) "\\\\\"[ \t]*")
+  (set (make-local-variable 'comment-start-skip) "\\\\[\"#][ \t]*")
   (set (make-local-variable 'comment-column) 24)
   (set (make-local-variable 'comment-indent-function) 'nroff-comment-indent)
   (set (make-local-variable 'imenu-generic-expression) nroff-imenu-expression))
diff --git a/lisp/textmodes/org-publish.el b/lisp/textmodes/org-publish.el
new file mode 100644 (file)
index 0000000..5a2a146
--- /dev/null
@@ -0,0 +1,601 @@
+;;; org-publish.el --- publish related org-mode files as a website
+
+;; Copyright (C) 2006, 2007  Free Software Foundation, Inc.
+
+;; Author: David O'Toole <dto@gnu.org>
+;; Keywords: hypermedia, outlines
+;; Version: 1.80
+
+;; This file is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; This file is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;; This file is part of GNU Emacs.
+
+;;; Commentary:
+
+;; Requires at least version 4.27 of org.el
+;;
+;; The official org-mode website:
+;; http://staff.science.uva.nl/~dominik/Tools/org/
+;;
+;; Home page for org-publish.el:
+;; http://dto.freeshell.org/notebook/OrgMode.html
+
+;; This program extends the HTML publishing support of Emacs Org-mode
+;; to allow configurable publishing of related sets of files as a
+;; complete website.
+;;
+;; org-publish.el can do the following:
+;;
+;; + Publish all one's org-files to html
+;; + Upload html, images, attachments and other files to a web server
+;; + Exclude selected private pages from publishing
+;; + Publish a clickable index of pages
+;; + Manage local timestamps, for publishing only changed files
+;; + Accept plugin functions to extend range of publishable content
+;;
+;; Special thanks to the org-mode maintainer Carsten Dominik for his
+;; ideas, enthusiasm, and cooperation.
+
+;;; Installation:
+
+;; Put org-publish.el in your load path, byte-compile it, and then add
+;; the following lines to your emacs initialization file:
+
+;; (autoload 'org-publish "org-publish" nil t)
+;; (autoload 'org-publish "org-publish-all" nil t)
+;; (autoload 'org-publish "org-publish-current-file" nil t)
+;; (autoload 'org-publish "org-publish-current-project" nil t)
+
+;; NOTE: When org-publish.el is included with org.el, those forms are
+;; already in the file org-install.el, and hence don't need to be put
+;; in your emacs initialization file in this case.
+
+;;; Usage:
+;;
+;; The program's main configuration variable is
+;; `org-publish-project-alist'. See below for example configurations
+;; with commentary.
+
+;; The main interactive functions are:
+;;
+;; M-x org-publish
+;; M-x org-publish-all
+;; M-x org-publish-current-file
+;; M-x org-publish-current-project
+
+;;;; Simple example configuration:
+
+;; (setq org-publish-project-alist
+;;       (list
+;;        '("org" . (:base-directory "~/org/"
+;;                  :base-extension "org"
+;;                  :publishing-directory "~/public_html"
+;;                   :with-section-numbers nil
+;;                  :table-of-contents nil
+;;                  :style "<link rel=stylesheet href=\"../other/mystyle.css\" type=\"text/css\">")))
+
+;;;; More complex example configuration:
+
+;; Imagine your *.org files are kept in ~/org, your images in
+;; ~/images, and stylesheets in ~/other. Now imagine you want to
+;; publish the files through an ssh connection to a remote host, via
+;; Tramp-mode. To maintain relative links from *.org files to /images
+;; and /other, we should replicate the same directory structure in
+;; your web server account's designated html root (in this case,
+;; assumed to be ~/html)
+
+;; Once you've done created the proper directories, you can adapt the
+;; following example configuration to your specific paths, run M-x
+;; org-publish-all, and it should publish the files to the correct
+;; directories on the web server, transforming the *.org files into
+;; HTML, and leaving other files alone.
+
+;; (setq org-publish-project-alist
+;;       (list
+;;        '("orgfiles" :base-directory "~/org/"
+;;                    :base-extension "org"
+;;                    :publishing-directory "/ssh:user@host:~/html/notebook/"
+;;                    :publishing-function org-publish-org-to-html
+;;                    :exclude "PrivatePage.org"   ;; regexp
+;;                    :headline-levels 3
+;;                     :with-section-numbers nil
+;;                    :table-of-contents nil
+;;                    :style "<link rel=stylesheet href=\"../other/mystyle.css\" type=\"text/css\">"
+;;                    :auto-preamble t
+;;                    :auto-postamble nil)
+;;
+;;         ("images" :base-directory "~/images/"
+;;                  :base-extension "jpg\\|gif\\|png"
+;;                  :publishing-directory "/ssh:user@host:~/html/images/"
+;;                  :publishing-function org-publish-attachment)
+;;
+;;         ("other"  :base-directory "~/other/"
+;;                  :base-extension "css"
+;;                  :publishing-directory "/ssh:user@host:~/html/other/"
+;;                  :publishing-function org-publish-attachment)
+;;         ("website" :components ("orgfiles" "images" "other"))))
+
+;; For more information, see the documentation for the variable
+;; `org-publish-project-alist'.
+
+;; Of course, you don't have to publish to remote directories from
+;; within emacs. You can always just publish to local folders, and
+;; then use the synchronization/upload tool of your choice.
+
+
+;;; List of user-visible changes since version 1.27
+
+;; 1.78: Allow list-valued :publishing-function
+;; 1.77: Added :preparation-function, this allows you to use GNU Make etc.
+;; 1.65: Remove old "composite projects". They're redundant.
+;; 1.64: Allow meta-projects with :components
+;; 1.57: Timestamps flag is now called "org-publish-use-timestamps-flag"
+;; 1.52: Properly set default for :index-filename
+;; 1.48: Composite projects allowed.
+;;       :include keyword allowed.
+;; 1.43: Index no longer includes itself in the index.
+;; 1.42: Fix "function definition is void" error
+;;       when :publishing-function not set in org-publish-current-file.
+;; 1.41: Fixed bug where index isn't published on first try.
+;; 1.37: Added interactive function "org-publish". Prompts for particular
+;;       project name to publish.
+;; 1.34: Added force-publish option to all interactive functions.
+;; 1.32: Fixed "index.org has changed on disk" error during index publishing.
+;; 1.30: Fixed startup error caused by (require 'em-unix)
+
+;;; Code:
+
+
+(eval-when-compile
+  (require 'cl))
+
+
+(defgroup org-publish nil
+       "Options for publishing a set of Org-mode and related files."
+   :tag "Org Publishing"
+   :group 'org)
+
+
+(defcustom org-publish-project-alist nil
+  "Association list to control publishing behavior.
+Each element of the alist is a publishing 'project.'  The CAR of
+each element is a string, uniquely identifying the project. The
+CDR of each element is in one of the following forms:
+
+  (:property value :property value ... )
+
+OR,
+
+  (:components (\"project-1\" \"project-2\" ...))
+
+When the CDR of an element of org-publish-project-alist is in
+this second form, the elements of the list after :components are
+taken to be components of the project, which group together files
+requiring different publishing options. When you publish such a
+project with M-x org-publish, the components all publish.
+
+When a property is given a value in org-publish-project-alist, its
+setting overrides the value of the corresponding user variable
+ (if any) during publishing. However, options set within a file
+override everything.
+
+Most properties are optional, but some should always be set:
+
+    :base-directory        Directory containing publishing source files
+    :base-extension        Extension (without the dot!) of source files.
+                             This can be a regular expression.
+    :publishing-directory  Directory (possibly remote) where output
+                             files will be published
+
+The :exclude property may be used to prevent certain files from
+being published. Its value may be a string or regexp matching
+file names you don't want to be published.
+
+The :include property may be used to include extra files. Its
+value may be a list of filenames to include. The filenames are
+considered relative to the publishing directory.
+
+When both :include and :exclude properties are given values, the
+exclusion step happens first.
+
+One special property controls which back-end function to use for
+publishing files in the project. This can be used to extend the
+set of file types publishable by org-publish, as well as the set
+of output formats.
+
+    :publishing-function     Function to publish file. The default is
+                             org-publish-org-to-html, but other
+                             values are possible. May also be a
+                             list of functions, in which case 
+                             each function in the list is invoked
+                             in turn.
+
+Another property allows you to insert code that prepares a
+project for publishing. For example, you could call GNU Make on a
+certain makefile, to ensure published files are built up to date. 
+
+    :preparation-function   Function to be called before publishing
+                              this project.
+
+Some properties control details of the Org publishing process,
+and are equivalent to the corresponding user variables listed in
+the right column. See the documentation for those variables to
+learn more about their use and default values.
+
+    :language              org-export-default-language
+    :headline-levels       org-export-headline-levels
+    :section-numbers       org-export-with-section-numbers
+    :table-of-contents     org-export-with-toc
+    :emphasize             org-export-with-emphasize
+    :sub-superscript       org-export-with-sub-superscripts
+    :TeX-macros            org-export-with-TeX-macros
+    :fixed-width           org-export-with-fixed-width
+    :tables                org-export-with-tables
+    :table-auto-headline   org-export-highlight-first-table-line
+    :style                 org-export-html-style
+    :convert-org-links     org-export-html-link-org-files-as-html
+    :inline-images         org-export-html-inline-images
+    :expand-quoted-html    org-export-html-expand
+    :timestamp             org-export-html-with-timestamp
+    :publishing-directory  org-export-publishing-directory
+    :preamble              org-export-html-preamble
+    :postamble             org-export-html-postamble
+    :auto-preamble         org-export-html-auto-preamble
+    :auto-postamble        org-export-html-auto-postamble
+    :author                user-full-name
+    :email                 user-mail-address
+
+The following properties may be used to control publishing of an
+index of files or summary page for a given project.
+
+    :auto-index            Whether to publish an index during
+                           org-publish-current-project or org-publish-all.
+    :index-filename        Filename for output of index. Defaults
+                           to 'index.org' (which becomes 'index.html')
+    :index-title           Title of index page. Defaults to name of file.
+    :index-function        Plugin function to use for generation of index.
+                           Defaults to 'org-publish-org-index', which
+                           generates a plain list of links to all files
+                           in the project.
+"
+  :group 'org-publish
+  :type 'alist)
+
+
+(defcustom org-publish-use-timestamps-flag t
+  "When non-nil, use timestamp checking to publish only changed files.
+When nil, do no timestamp checking and always publish all
+files."
+  :group 'org-publish
+  :type 'boolean)
+
+
+(defcustom org-publish-timestamp-directory "~/.org-timestamps/"
+  "Name of directory in which to store publishing timestamps."
+  :group 'org-publish
+  :type 'string)
+
+
+;;;; Timestamp-related functions
+
+
+(defun org-publish-timestamp-filename (filename)
+  "Return path to timestamp file for filename FILENAME."
+  (while (string-match "~\\|/" filename)
+    (setq filename (replace-match "_" nil t filename)))
+  (concat org-publish-timestamp-directory filename ".timestamp"))
+
+
+(defun org-publish-needed-p (filename)
+  "Check whether file should be published.
+If org-publish-use-timestamps-flag is set to nil, this function always
+returns t. Otherwise, check the timestamps folder to determine
+whether file should be published."
+  (if org-publish-use-timestamps-flag
+      (progn
+       ;;
+       ;; create folder if needed
+       (if (not (file-exists-p org-publish-timestamp-directory))
+           (make-directory org-publish-timestamp-directory)
+         (if (not (file-directory-p org-publish-timestamp-directory))
+             (error "org-publish-timestamp-directory must be a directory.")))
+       ;;
+       ;; check timestamp. ok if timestamp file doesn't exist
+       (let* ((timestamp (org-publish-timestamp-filename filename))
+              (rtn (file-newer-than-file-p filename timestamp)))
+         (if rtn
+             ;; handle new timestamps
+             (if (not (file-exists-p timestamp))
+                 ;; create file
+                 (with-temp-buffer
+                   (make-directory (file-name-directory timestamp) :parents)
+                   (write-file timestamp)
+                   (kill-buffer (current-buffer)))))
+         rtn))
+    t))
+
+
+(defun org-publish-update-timestamp (filename)
+  "Update publishing timestamp for file FILENAME."
+  (let ((timestamp (org-publish-timestamp-filename filename)))
+    ;; Emacs 21 doesn't have set-file-times
+    (if (fboundp 'set-file-times)
+        (set-file-times timestamp)
+      (call-process "touch" nil 0 nil timestamp))))
+
+
+;;;; A hash mapping files to project names
+
+
+(defvar org-publish-files (make-hash-table :test 'equal) "Hash
+table mapping file names to project names.")
+
+
+;;;; Checking filenames against this hash
+
+
+(defun org-publish-validate-link (link &optional directory)
+  (gethash (file-truename (expand-file-name link directory))
+          org-publish-files))
+
+
+;;;; Getting project information out of org-publish-project-alist
+
+
+(defun org-publish-get-plists (&optional project-name)
+ "Return a list of property lists for project PROJECT-NAME.
+When argument is not given, return all property lists for all projects."
+ (let ((alist (if project-name
+                  (list (assoc project-name org-publish-project-alist))
+                org-publish-project-alist))
+       (project nil)
+       (plists nil)
+       (single nil)
+       (components nil))
+
+   ;;
+   ;;
+   (while (setq project (pop alist))
+     ;; what kind of project is it?
+     (if (setq components (plist-get (cdr project) :components))
+         ;; meta project. annotate each plist with name of enclosing project
+         (setq single
+               (apply 'append
+                      (mapcar 'org-publish-get-plists components)))
+       ;; normal project
+       (setq single (list (cdr project))))
+     ;;
+     (setq plists (append plists single))
+     (dolist (p single)
+       (let* ((exclude (plist-get p :exclude))
+              (files (org-publish-get-base-files p exclude)))
+         (dolist (f files)
+           (puthash (file-truename f) (car project) org-publish-files)))))
+   plists))
+
+
+
+(defun org-publish-get-base-files (plist &optional exclude-regexp)
+  "Return a list of all files in project defined by PLIST.
+If EXCLUDE-REGEXP is set, this will be used to filter out
+matching filenames."
+  (let* ((dir (file-name-as-directory (plist-get plist :base-directory)))
+        (include-list (plist-get plist :include))
+        (extension (or (plist-get plist :base-extension) "org"))
+        (regexp (concat "^[^\\.].*\\.\\(" extension "\\)$"))
+        (allfiles (directory-files dir t regexp)))
+    ;;
+    ;; exclude files
+    (setq allfiles
+         (if (not exclude-regexp)
+             allfiles
+           (delq nil
+                 (mapcar (lambda (x)
+                           (if (string-match exclude-regexp x) nil x))
+                         allfiles))))
+    ;;
+    ;; include extra files
+    (let ((inc nil))
+      (while (setq inc (pop include-list))
+       (setq allfiles (cons (expand-file-name inc dir) allfiles))))
+
+    allfiles))
+
+
+(defun org-publish-get-project-from-filename (filename)
+  "Figure out which project a given FILENAME belongs to, if any.
+Filename should contain full path. Returns name of project, or
+nil if not found."
+  (org-publish-get-plists)
+  (gethash (file-truename filename) org-publish-files))
+
+
+(defun org-publish-get-plist-from-filename (filename)
+  "Return publishing configuration plist for file FILENAME."
+  (let ((found nil))
+    (mapcar
+     (lambda (plist)
+       (let ((files (org-publish-get-base-files plist)))
+        (if (member (expand-file-name filename) files)
+            (setq found plist))))
+     (org-publish-get-plists))
+    found))
+
+
+
+;;;; Pluggable publishing back-end functions
+
+
+(defun org-publish-org-to-html (plist filename)
+  "Publish an org file to HTML.
+PLIST is the property list for the given project.
+FILENAME is the filename of the org file to be published."
+  (require 'org)
+  (let* ((arg (plist-get plist :headline-levels)))
+    (progn
+      (find-file filename)
+      (org-export-as-html arg nil plist)
+      ;; get rid of HTML buffer
+      (kill-buffer (current-buffer)))))
+
+
+(defun org-publish-attachment (plist filename)
+  "Publish a file with no transformation of any kind.
+PLIST is the property list for the given project.
+FILENAME is the filename of the file to be published."
+  ;; make sure eshell/cp code is loaded
+  (require 'eshell)
+  (require 'esh-maint)
+  (require 'em-unix)
+  (let ((destination (file-name-as-directory (plist-get plist :publishing-directory))))
+    (eshell/cp filename destination)))
+
+
+;;;; Publishing files, sets of files, and indices
+
+
+(defun org-publish-file (filename)
+  "Publish file FILENAME."
+  (let* ((project-name (org-publish-get-project-from-filename filename))
+        (plist (org-publish-get-plist-from-filename filename))
+        (publishing-function (or (plist-get plist :publishing-function) 'org-publish-org-to-html)))
+    (if (not project-name)
+       (error (format "File %s is not part of any known project." filename)))
+    (when (org-publish-needed-p filename)
+      (if (listp publishing-function)
+         ;; allow chain of publishing functions
+         (mapc (lambda (f)
+                 (funcall f plist filename)) 
+               publishing-function)
+       (funcall publishing-function plist filename))
+      (org-publish-update-timestamp filename))))
+
+
+(defun org-publish-plist (plist)
+  "Publish all files in set defined by PLIST.
+ If :auto-index is set, publish the index too."
+  (let* ((exclude-regexp (plist-get plist :exclude))
+        (publishing-function (or (plist-get plist :publishing-function) 'org-publish-org-to-html))
+        (index-p (plist-get plist :auto-index))
+         (index-filename (or (plist-get plist :index-filename) "index.org"))
+        (index-function (or (plist-get plist :index-function) 'org-publish-org-index))
+        (preparation-function (plist-get plist :preparation-function))
+        (f nil))
+    ;;
+    (when preparation-function
+      (funcall preparation-function))
+    (if index-p
+       (funcall index-function plist index-filename))
+    (let ((files (org-publish-get-base-files plist exclude-regexp)))
+      (while (setq f (pop files))
+       ;; check timestamps
+       (when (org-publish-needed-p f)
+         (if (listp publishing-function)
+             ;; allow chain of publishing functions
+             (mapc (lambda (func)
+                     (funcall func plist f)) 
+                   publishing-function)
+           (funcall publishing-function plist f))
+         (org-publish-update-timestamp f))))))
+
+
+(defun org-publish-org-index (plist &optional index-filename)
+  "Create an index of pages in set defined by PLIST.
+Optionally set the filename of the index with INDEX-FILENAME;
+default is 'index.org'."
+  (let* ((dir (file-name-as-directory (plist-get plist :base-directory)))
+        (exclude-regexp (plist-get plist :exclude))
+        (files (org-publish-get-base-files plist exclude-regexp))
+        (index-filename (concat dir (or index-filename "index.org")))
+        (index-buffer (find-buffer-visiting index-filename))
+        (ifn (file-name-nondirectory index-filename))
+        (f nil))
+    ;;
+    ;; if buffer is already open, kill it to prevent error message
+    (if index-buffer
+       (kill-buffer index-buffer))
+    (with-temp-buffer
+      (while (setq f (pop files))
+       (let ((fn (file-name-nondirectory f)))
+         (unless (string= fn ifn) ;; index shouldn't index itself
+           (insert (concat " + [[file:" fn "]["
+                           (file-name-sans-extension fn)
+                           "]]\n")))))
+      (write-file index-filename)
+      (kill-buffer (current-buffer)))))
+
+
+;(defun org-publish-meta-index (meta-plist &optional index-filename)
+;  "Create an index for a metaproject."
+;  (let* ((plists (
+
+
+;;;; Interactive publishing functions
+
+
+;;;###autoload
+(defun org-publish (project-name &optional force)
+  "Publish the project PROJECT-NAME."
+  (interactive (list (completing-read "Project name: " org-publish-project-alist
+                                     nil t)
+                    current-prefix-arg))
+  (save-window-excursion
+    (let ((org-publish-use-timestamps-flag (if force nil t))
+         (plists (org-publish-get-plists project-name)))
+      (mapcar 'org-publish-plist plists))))
+
+
+;;;###autoload
+(defun org-publish-current-project (&optional force)
+  "Publish the project associated with the current file.
+With prefix argument, force publishing all files in project."
+  (interactive "P")
+  (save-window-excursion
+    (let* ((project-name (org-publish-get-project-from-filename (buffer-file-name)))
+          (org-publish-use-timestamps-flag (if force nil t)))
+      (if (not project-name)
+         (error (format "File %s is not part of any known project." (buffer-file-name))))
+      (org-publish project-name))))
+
+
+;;;###autoload
+(defun org-publish-current-file (&optional force)
+  "Publish the current file.
+With prefix argument, force publish the file."
+  (interactive "P")
+  (save-window-excursion
+    (let ((org-publish-use-timestamps-flag
+          (if force nil t)))
+      (org-publish-file (buffer-file-name)))))
+
+
+;;;###autoload
+(defun org-publish-all (&optional force)
+  "Publish all projects.
+With prefix argument, force publish all files."
+  (interactive "P")
+  (save-window-excursion
+    (let ((org-publish-use-timestamps-flag
+          (if force nil t))
+         (plists (org-publish-get-plists)))
+      (mapcar 'org-publish-plist plists))))
+
+
+
+(provide 'org-publish)
+
+;; arch-tag: 72807f3c-8af0-4a6b-8dca-c3376eb25adb
+;;; org-publish.el ends here
index b3ddb45..35591cb 100644 (file)
@@ -1,11 +1,11 @@
-;;;; org.el --- Outline-based notes management and organize
+;;; org.el --- Outline-based notes management and organizer
 ;; Carstens outline-mode for keeping track of everything.
 ;; Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 ;;
 ;; Author: Carsten Dominik <dominik at science dot uva dot nl>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/
-;; Version: 4.67d
+;; Version: 5.03b
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -83,7 +83,7 @@
 
 ;;; Version
 
-(defvar org-version "4.67c"
+(defconst org-version "5.03b"
   "The version number of the file org.el.")
 (defun org-version ()
   (interactive)
     (get-text-property 0 'test (format "%s" x)))
   "Does format transport text properties?")
 
+(defmacro org-unmodified (&rest body)
+  "Execute body without changing buffer-modified-p."
+  `(set-buffer-modified-p
+    (prog1 (buffer-modified-p) ,@body)))
+
+(defmacro org-re (s)
+  "Replace posix classes in regular expression."
+  (if (featurep 'xemacs)
+      (let ((ss s))
+       (save-match-data
+         (while (string-match "\\[:alnum:\\]" ss)
+           (setq ss (replace-match "a-zA-Z0-9" t t ss)))
+         ss))
+    s))
+
+(defmacro org-preserve-lc (&rest body)
+  `(let ((_line (org-current-line))
+        (_col (current-column)))
+     (unwind-protect
+        (progn ,@body)
+       (goto-line _line)
+       (move-to-column _col))))     
+
 ;;; The custom variables
 
 (defgroup org nil
@@ -153,21 +176,13 @@ has been set."
   :group 'org-startup
   :type 'boolean)
 
-(defcustom org-CUA-compatible nil
-  "Non-nil means use alternative key bindings for S-<cursor movement>.
-Org-mode used S-<cursor movement> for changing timestamps and priorities.
-S-<cursor movement> is also used for example by `CUA-mode' to select text.
-If you want to use Org-mode together with `CUA-mode', Org-mode needs to use
-alternative bindings.  Setting this variable to t will replace the following
-keys both in Org-mode and in the Org-agenda buffer.
-
-S-RET   -> C-S-RET
-S-up    -> M-p
-S-down  -> M-n
-S-left  -> M--
-S-right -> M-+
-
-If you do not like the alternative keys, take a look at the variable
+(defcustom org-replace-disputed-keys nil
+  "Non-nil means use alternative key bindings for some keys.
+Org-mode uses S-<cursor> keys for changing timestamps and priorities.
+These keys are also used by other packages like `CUA-mode' or `windmove.el'.
+If you want to use Org-mode together with one of these other modes,
+or more generally if you would like to move some Org-mode commands to
+other keys, set this variable and configure the keys with the variable
 `org-disputed-keys'.
 
 This option is only relevant at load-time of Org-mode, and must be set
@@ -176,21 +191,47 @@ become effective."
   :group 'org-startup
   :type 'boolean)
 
-(defvar org-disputed-keys
-  '((S-up     [(shift up)]      [(meta ?p)])
-    (S-down   [(shift down)]    [(meta ?n)])
-    (S-left   [(shift left)]    [(meta ?-)])
-    (S-right  [(shift right)]   [(meta ?+)])
-    (S-return [(shift return)]  [(control shift return)]))
+(if (fboundp 'defvaralias)
+    (defvaralias 'org-CUA-compatible 'org-replace-disputed-keys))
+
+(defcustom org-disputed-keys
+  '(([(shift up)]              . [(meta p)])
+    ([(shift down)]            . [(meta n)])
+    ([(shift left)]            . [(meta -)])
+    ([(shift right)]           . [(meta +)])
+    ([(control shift right)]   . [(meta shift +)])
+    ([(control shift left)]    . [(meta shift -)]))
   "Keys for which Org-mode and other modes compete.
-This is an alist, cars are symbols for lookup, 1st element is the default key,
-second element will be used when `org-CUA-compatible' is t.")
+This is an alist, cars are the default keys, second element specifies
+the alternative to use when `org-replace-disputed-keys' is t.
+
+Keys can be specified in any syntax supported by `define-key'.
+The value of this option takes effect only at Org-mode's startup,
+therefore you'll have to restart Emacs to apply it after changing."
+  :group 'org-startup
+  :type 'alist)
 
 (defun org-key (key)
-  "Select a key according to `org-CUA-compatible'."
-  (nth (if org-CUA-compatible 2 1)
-       (or (assq key org-disputed-keys)
-          (error "Invalid Key %s in `org-key'" key))))
+  "Select key according to `org-replace-disputed-keys' and `org-disputed-keys'.
+Or return the original if not disputed."
+  (if org-replace-disputed-keys
+      (let* ((nkey (key-description key))
+            (x (org-find-if (lambda (x)
+                              (equal (key-description (car x)) nkey))
+                            org-disputed-keys)))
+       (if x (cdr x) key))
+    key))
+
+(defun org-find-if (predicate seq)
+  (catch 'exit
+    (while seq
+      (if (funcall predicate (car seq))
+         (throw 'exit (car seq))
+       (pop seq)))))
+
+(defun org-defkey (keymap key def)
+  "Define a key, possibly translated, as returned by `org-key'."
+  (define-key keymap (org-key key) def))
 
 (defcustom org-ellipsis nil
   "The ellipsis to use in the Org-mode outline.
@@ -233,6 +274,11 @@ Changes become only effective after restarting Emacs."
   :group 'org-keywords
   :type 'string)
 
+(defcustom org-archived-string "ARCHIVED:"
+  "String used as the prefix for timestamps logging archiving a TODO entry."
+  :group 'org-keywords
+  :type 'string)
+
 (defcustom org-clock-string "CLOCK:"
   "String used as prefix for timestamps clocking work hours on an item."
   :group 'org-keywords
@@ -255,7 +301,9 @@ An entry can be toggled between QUOTE and normal with
   :group 'org-keywords
   :type 'string)
 
-(defvar org-repeat-re "\\<REPEAT(\\([-+ 0-9dwmy]+\\))"
+(defconst org-repeat-re
+  (concat "\\(?:\\<\\(?:" org-scheduled-string "\\|" org-deadline-string "\\)"
+         " +<[0-9]\\{4\\}-[0-9][0-9]-[0-9][0-9] [^>\n]*\\)\\(\\+[0-9]+[dwmy]\\)")
   "Regular expression for specifying repeated events.
 After a match, group 1 contains the repeat expression.")
 
@@ -304,7 +352,7 @@ contexts.  Valid contexts are
                    (const default))
                   (boolean)))))
 
-(defcustom org-show-following-heading '((default . t))
+(defcustom org-show-following-heading '((default . nil))
   "Non-nil means, show following heading when revealing a location.
 Org-mode often shows locations in an org-mode file which might have
 been invisible before.  When this is set, the heading following the
@@ -368,6 +416,18 @@ contexts.  See `org-show-hierarchy-above' for valid contexts."
   :tag "Org Cycle"
   :group 'org-structure)
 
+(defcustom org-drawers '("PROPERTIES")
+  "Names of drawers.  Drawers are not opened by cycling on the headline above.
+Drawers only open with a TAB on the drawer line itself.  A drawer looks like
+this:
+   :DRAWERNAME:
+   .....
+   :END:
+The drawer \"PROPERTIES\" is special for capturing properties through
+the property API."
+  :group 'org-structure
+  :type '(repeat (string :tag "Drawer Name")))
+
 (defcustom org-cycle-global-at-bob t
   "Cycle globally if cursor is at beginning of buffer and not at a headline.
 This makes it possible to do global cycling without having to use S-TAB or
@@ -386,6 +446,7 @@ nil         Never
 white       Only in completely white lines
 whitestart  Only at the beginning of lines, before the first non-white char.
 t           Everywhere except in headlines
+exc-hl-bol  Everywhere except at the start of a headline
 If TAB is used in a place where it does not emulate TAB, the current subtree
 visibility is cycled."
   :group 'org-cycle
@@ -393,9 +454,26 @@ visibility is cycled."
                 (const :tag "Only in completely white lines" white)
                 (const :tag "Before first char in a line" whitestart)
                 (const :tag "Everywhere except in headlines" t)
+                (const :tag "Everywhere except at bol in headlines" exc-hl-bol)
                 ))
 
+(defcustom org-cycle-separator-lines 2
+  "Number of empty lines needed to keep an empty line between collapsed trees.
+If you leave an empty line between the end of a subtree and the following
+headline, this empty line is hidden when the subtree is folded.
+Org-mode will leave (exactly) one empty line visible if the number of
+empty lines is equal or larger to the number given in this variable.
+So the default 2 means, at least 2 empty lines after the end of a subtree
+are needed to produce free space between a collapsed subtree and the
+following headline.
+
+Special case: when 0, never leave empty lines in collapsed view."
+  :group 'org-cycle
+  :type 'integer)
+
 (defcustom org-cycle-hook '(org-cycle-hide-archived-subtrees
+                           org-cycle-hide-drawers
+                           org-cycle-show-empty-lines
                            org-optimize-window-after-visibility-change)
   "Hook that is run after `org-cycle' has changed the buffer visibility.
 The function(s) in this hook must accept a single argument which indicates
@@ -406,12 +484,27 @@ the values `folded', `children', or `subtree'."
   :group 'org-cycle
   :type 'hook)
 
-
 (defgroup org-edit-structure nil
   "Options concerning structure editing in Org-mode."
   :tag "Org Edit Structure"
   :group 'org-structure)
 
+
+(defcustom org-special-ctrl-a/e nil
+  "Non-nil means `C-a' and `C-e' behave specially in headlines.
+When set, `C-a' will bring back the cursor to the beginning of the
+headline text, i.e. after the stars and after a possible TODO keyword.
+When the cursor is already at that position, another `C-a' will bring
+it to the beginning of the line.
+`C-e' will jump to the end of the headline, ignoring the presence of tags
+in the headline.  A second `C-e' will then jump to the true end of the
+line, after any tags."
+  :group 'org-edit-structure
+  :type 'boolean)
+
+(if (fboundp 'defvaralias)
+    (defvaralias 'org-special-ctrl-a 'org-special-ctrl-a/e))
+
 (defcustom org-odd-levels-only nil
   "Non-nil means, skip even levels and only use odd levels for the outline.
 This has the effect that two stars are being added/taken away in
@@ -611,10 +704,7 @@ line like
   :type 'boolean)
 
 (defcustom org-archive-stamp-time t
-  "Non-nil means, add a time stamp to entries moved to an archive file.
-The time stamp will be added directly after the TODO state keyword in the
-first line, so it is probably best to use this in combinations with
-`org-archive-mark-done'."
+  "Non-nil means, add a time stamp to entries moved to an archive file."
   :group 'org-archive
   :type 'boolean)
 
@@ -783,6 +873,18 @@ calls `table-recognize-table'."
   :tag "Org Table Calculation"
   :group 'org-table)
 
+(defcustom org-table-use-standard-references t
+  "Should org-mode work with table refrences like B3 instead of @3$2?
+Possible values are:
+nil     never use them
+from    accept as input, do not present for editing
+t:      accept as input and present for editing"
+  :group 'org-table-calculation
+  :type '(choice
+         (const :tag "Never, don't even check unser input for them" nil)
+         (const :tag "Always, both as user input, and when editing" t)
+         (const :tag "Convert user input, don't offer during editing" 'from)))
+
 (defcustom org-table-copy-increment t
   "Non-nil means, increment when copying current field with \\[org-table-copy-down]."
   :group 'org-table-calculation
@@ -815,9 +917,6 @@ the command \\[org-table-eval-formula]."
   :group 'org-table-calculation
   :type 'boolean)
 
-;; FIXME this is also a variable that makes Org-mode files non-portable
-;; Maybe I should have a #+ options for constants?
-;; How about the SI/cgs issue?
 (defcustom org-table-formula-use-constants t
   "Non-nil means, interpret constants in formulas in tables.
 A constant looks like `$c' or `$Grav' and will be replaced before evaluation
@@ -834,12 +933,20 @@ speed of light in a formula, you would configure
 
   (setq org-table-formula-constants '((\"c\" . \"299792458.\")))
 
-and then use it in an equation like `$1*$c'."
+and then use it in an equation like `$1*$c'.
+
+Constants can also be defined on a per-file basis using a line like
+
+#+CONSTANTS: c=299792458. pi=3.14 eps=2.4e-6"
   :group 'org-table-calculation
   :type '(repeat
          (cons (string :tag "name")
                (string :tag "value"))))
 
+(defvar org-table-formula-constants-local nil
+  "Local version of `org-table-formula-constants'.")
+(make-variable-buffer-local 'org-table-formula-constants-local)
+
 (defcustom org-table-allow-automatic-line-recalculation t
   "Non-nil means, lines marked with |#| or |*| will be recomputed automatically.
 Automatically means, when TAB or RET or C-c C-c are pressed in the line."
@@ -852,7 +959,7 @@ Automatically means, when TAB or RET or C-c C-c are pressed in the line."
   :group 'org)
 
 (defvar org-link-abbrev-alist-local nil
-  "buffer-local version of `org-link-abbrev-alist', which see.
+  "Buffer-local version of `org-link-abbrev-alist', which see.
 The value of this is taken from the #+LINK lines.")
 (make-variable-buffer-local 'org-link-abbrev-alist-local)
 
@@ -917,6 +1024,7 @@ Changing this variable requires a restart of Emacs to become effective."
              (const :tag "plain text links" plain)
              (const :tag "Radio target matches" radio)
              (const :tag "Tags" tag)
+             (const :tag "Tags" target)
              (const :tag "Timestamps" date)))
 
 (defgroup org-link-store nil
@@ -1243,7 +1351,7 @@ When not nil, this is a list of 4-element lists.  In each entry, the first
 element is a character, a unique key to select this template.
 The second element is the template.  The third element is optional and can
 specify a destination file for remember items created with this template.
-The default file is given by `org-default-notes-file'.  An optional third
+The default file is given by `org-default-notes-file'.  An optional forth
 element can specify the headline in that file that should be offered
 first when the user is asked to file the entry.  The default headline is
 given in the variable `org-remember-default-headline'.
@@ -1318,30 +1426,64 @@ When nil, new notes will be filed to the end of a file or entry."
   :tag "Org Progress"
   :group 'org-time)
 
-(defcustom org-todo-keywords '("TODO" "DONE")
-  "List of TODO entry keywords.
-\\<org-mode-map>By default, this is '(\"TODO\" \"DONE\").  The last entry in the list is
-considered to mean that the entry is \"done\".  All the other mean that
-action is required, and will make the entry show up in todo lists, diaries
-etc.
-The command \\[org-todo] cycles an entry through these states, and an
+(defcustom org-todo-keywords '((sequence "TODO" "DONE"))
+  "List of TODO entry keyword sequences and their interpretation.
+\\<org-mode-map>This is a list of sequences.
+
+Each sequence starts with a symbol, either `sequence' or `type',
+indicating if the keywords should be interpreted as a sequence of
+action steps, or as different types of TODO items.  The first
+keywords are states requiring action - these states will select a headline
+for inclusion into the global TODO list Org-mode produces.  If one of
+the \"keywords\" is the vertical bat \"|\" the remaining keywords
+signify that no further action is necessary.  If \"|\" is not found,
+the last keyword is treated as the only DONE state of the sequence.
+
+The command \\[org-todo] cycles an entry through these states, and one
 additional state where no keyword is present.  For details about this
-cycling, see also the variable `org-todo-interpretation'
-Changes become only effective after restarting Emacs."
+cycling, see the manual.
+
+TODO keywords and interpretation can also be set on a per-file basis with
+the special #+SEQ_TODO and #+TYP_TODO lines.
+
+For backward compatibility, this variable may also be just a list
+of keywords - in this case the interptetation (sequence or type) will be
+taken from the (otherwise obsolete) variable `org-todo-interpretation'."
   :group 'org-todo
   :group 'org-keywords
-  :type '(repeat (string :tag "Keyword")))
+  :type '(choice
+         (repeat :tag "Old syntax, just keywords"
+                 (string :tag "Keyword"))
+         (repeat :tag "New syntax"
+                 (cons
+                  (choice
+                   :tag "Interpretation"
+                   (const :tag "Sequence (cycling hits every state)" sequence)
+                   (const :tag "Type     (cycling directly to DONE)" type))
+                  (repeat
+                   (string :tag "Keyword"))))))
+
+(defvar org-todo-keywords-1 nil)
+(make-variable-buffer-local 'org-todo-keywords-1)
+(defvar org-todo-keywords-for-agenda nil)
+(defvar org-done-keywords-for-agenda nil)
+(defvar org-not-done-keywords nil)
+(make-variable-buffer-local 'org-not-done-keywords)
+(defvar org-done-keywords nil)
+(make-variable-buffer-local 'org-done-keywords)
+(defvar org-todo-heads nil)
+(make-variable-buffer-local 'org-todo-heads)
+(defvar org-todo-sets nil)
+(make-variable-buffer-local 'org-todo-sets)
+(defvar org-todo-kwd-alist nil)
+(make-variable-buffer-local 'org-todo-kwd-alist)
 
 (defcustom org-todo-interpretation 'sequence
   "Controls how TODO keywords are interpreted.
-This variable is only relevant if `org-todo-keywords' contains more than two
-states.  \\<org-mode-map>Possible values are `sequence' and `type'.
-
-When `sequence', \\[org-todo] will always switch to the next state in the
-`org-todo-keywords' list. When `type', \\[org-todo] only cycles from state
-to state when executed several times in direct succession.  Otherwise, it
-switches directly to DONE from any state.
-See the manual for more information."
+This variable is in principle obsolete and is only used for
+backward compatibility, if the interpretation of todo keywords is
+not given already in `org-todo-keywords'.  See that variable for
+more information."
   :group 'org-todo
   :group 'org-keywords
   :type '(choice (const sequence)
@@ -1393,6 +1535,12 @@ the following lines anywhere in the buffer:
               (const :tag "when TODO state changes" state)
               (const :tag "when clocking out" clock-out))))
 
+(defcustom org-log-done-with-time t
+  "Non-nil means, the CLOSED time stamp will contain date and time.
+When nil, only the date will be recorded."
+  :group 'org-progress
+  :type 'boolean)
+
 (defcustom org-log-note-headings
   '((done . "CLOSING NOTE %t")
     (state . "State %-12s %t")
@@ -1414,11 +1562,9 @@ empty string.
                       state) string)
          (cons (const :tag "Heading when clocking out" clock-out) string)))
 
-(defcustom org-allow-auto-repeat t
-  "Non-nil means, find REPEAT cookies in entries and apply them.
-A repeat cookie looks like REPEAT(+1m) and causes deadlines and schedules
-to repeat themselves shifted by a certain amount of time, each time an
-entry is marked DONE."
+(defcustom org-log-repeat t
+  "Non-nil means, prompt for a note when REPEAT is resetting a TODO entry.
+When nil, no note will be taken."
   :group 'org-todo
   :group 'org-progress
   :type 'boolean)
@@ -1428,14 +1574,21 @@ entry is marked DONE."
   :tag "Org Priorities"
   :group 'org-todo)
 
-(defcustom org-default-priority ?B
-  "The default priority of TODO items.
-This is the priority an item get if no explicit priority is given."
+(defcustom org-highest-priority ?A
+  "The highest priority of TODO items.  A character like ?A, ?B etc.
+Must have a smaller ASCII number than `org-lowest-priority'."
   :group 'org-priorities
   :type 'character)
 
 (defcustom org-lowest-priority ?C
-  "The lowest priority of TODO items.  A character like ?A, ?B etc."
+  "The lowest priority of TODO items.  A character like ?A, ?B etc.
+Must have a larger ASCII number than `org-highest-priority'."
+  :group 'org-priorities
+  :type 'character)
+
+(defcustom org-default-priority ?B
+  "The default priority of TODO items.
+This is the priority an item get if no explicit priority is given."
   :group 'org-priorities
   :type 'character)
 
@@ -1479,7 +1632,8 @@ To turn this on on a per-file basis, insert anywhere in the file:
   '("<%m/%d/%y %a>" . "<%m/%d/%y %a %H:%M>") ; american
   "Custom formats for time stamps.  See `format-time-string' for the syntax.
 These are overlayed over the default ISO format if the variable
-`org-display-custom-times' is set."
+`org-display-custom-times' is set.  Time like %H:%M should be at the
+end of the second format."
   :group 'org-time
   :type 'sexp)
 
@@ -1603,6 +1757,28 @@ make sure all corresponding TODO items find their way into the list."
 (defvar org-last-tags-completion-table nil
   "The last used completion table for tags.")
 
+(defgroup org-properties nil
+  "Options concerning properties in Org-mode."
+  :tag "Org Properties"
+  :group 'org)
+
+(defcustom org-property-format "%-10s %s"
+  "How property key/value pairs should be formatted by `indent-line'.
+When `indent-line' hits a property definition, it will format the line
+according to this format, mainly to make sure that the values are
+lined-up with respect to each other."
+  :group 'org-properties
+  :type 'string)
+
+(defcustom org-columns-default-format "%25ITEM %TODO %3PRIORITY %TAGS"
+  "The default column format, if no other format has been defined.
+This variable can be set on the per-file basis by inserting a line
+
+#+COLUMNS: %25ITEM ....."
+  :group 'org-properties
+  :type 'string)
+
+
 (defgroup org-agenda nil
   "Options concerning agenda views in Org-mode."
   :tag "Org Agenda"
@@ -1612,7 +1788,7 @@ make sure all corresponding TODO items find their way into the list."
   "Variable used by org files to set a category for agenda display.
 Such files should use a file variable to set it, for example
 
-   -*- mode: org; org-category: \"ELisp\"
+#   -*- mode: org; org-category: \"ELisp\"
 
 or contain a special line
 
@@ -1654,17 +1830,75 @@ forth between agenda and calendar."
   :group 'org-agenda
   :type 'sexp)
 
+(defgroup org-agenda-export nil
+ "Options concerning exporting agenda views in Org-mode."
+ :tag "Org Agenda Export"
+ :group 'org-agenda)
+
+(defcustom org-agenda-with-colors t
+  "Non-nil means, use colors in agenda views."
+  :group 'org-agenda-export
+  :type 'boolean)
+
+(defcustom org-agenda-exporter-settings nil
+  "Alist of variable/value pairs that should be active during agenda export.
+This is a good place to set uptions for ps-print and for htmlize."
+  :group 'org-agenda-export
+  :type '(repeat
+         (list
+          (variable)
+          (sexp :tag "Value"))))
+
+(defcustom org-agenda-export-html-style ""
+  "The style specification for exported HTML Agenda files.
+If this variable contains a string, it will replace the default <style>
+section as produced by `htmlize'.
+Since there are different ways of setting style information, this variable
+needs to contain the full HTML structure to provide a style, including the
+surrounding HTML tags.  The style specifications should include definitions
+the fonts used by the agenda, here is an example:
+
+   <style type=\"text/css\">
+       p { font-weight: normal; color: gray; }
+       .org-agenda-structure {
+          font-size: 110%;
+          color: #003399;
+          font-weight: 600;
+       }
+       .org-todo {
+          color: #cc6666;Week-agenda:
+          font-weight: bold;
+       }
+       .org-done {
+          color: #339933;
+       }
+       .title { text-align: center; }
+       .todo, .deadline { color: red; }
+       .done { color: green; }
+    </style>
+
+or, if you want to keep the style in a file,
+
+   <link rel=\"stylesheet\" type=\"text/css\" href=\"mystyles.css\">
+
+As the value of this option simply gets inserted into the HTML <head> header,
+you can \"misuse\" it to also add other text to the header.  However,
+<style>...</style> is required, if not present the variable will be ignored."
+  :group 'org-agenda-export
+  :group 'org-export-html
+  :type 'string)
+
 (defgroup org-agenda-custom-commands nil
  "Options concerning agenda views in Org-mode."
  :tag "Org Agenda Custom Commands"
  :group 'org-agenda)
 
-(defcustom org-agenda-custom-commands '(("w" todo "WAITING"))
+(defcustom org-agenda-custom-commands nil
   "Custom commands for the agenda.
 These commands will be offered on the splash screen displayed by the
 agenda dispatcher \\[org-agenda].  Each entry is a list like this:
 
-   (key type match options)
+   (key type match options files)
 
 key     The key (a single char as a string) to be associated with the command.
 type    The command type, any of the following symbols:
@@ -1680,11 +1914,16 @@ match   What to search for:
          - a regular expression for occur searches
 options  A list of option setttings, similar to that in a let form, so like
          this: ((opt1 val1) (opt2 val2) ...)
+files    A list of files file to write the produced agenda buffer to
+         with the command `org-store-agenda-views'.
+         If a file name ends in \".html\", an HTML version of the buffer
+         is written out.  If it ends in \".ps\", a postscript version is
+         produced.  Otherwide, only the plain text is written to the file.
 
 You can also define a set of commands, to create a composite agenda buffer.
 In this case, an entry looks like this:
 
-  (key desc (cmd1 cmd2 ...) general-options)
+  (key desc (cmd1 cmd2 ...) general-options file)
 
 where
 
@@ -1695,19 +1934,22 @@ cmd    An agenda command, similar to the above.  However, tree commands
        (agenda)
        (alltodo)
        (stuck)
-       (todo \"match\" options)
-       (tags \"match\" options )
-       (tags-todo \"match\" options)
+       (todo \"match\" options files)
+       (tags \"match\" options files)
+       (tags-todo \"match\" options files)
 
 Each command can carry a list of options, and another set of options can be
 given for the whole set of commands.  Individual command options take
 precedence over the general options."
   :group 'org-agenda-custom-commands
   :type '(repeat
-         (choice
+         (choice :value ("a" tags "" nil)
           (list :tag "Single command"
                 (string :tag "Key")
                 (choice
+                 (const :tag "Agenda" agenda)
+                 (const :tag "TODO list" alltodo)
+                 (const :tag "Stuck projects" stuck)
                  (const :tag "Tags search (all agenda files)" tags)
                  (const :tag "Tags search of TODO entries (all agenda files)" tags-todo)
                  (const :tag "TODO keyword search (all agenda files)" todo)
@@ -1717,7 +1959,8 @@ precedence over the general options."
                  (symbol :tag "Other, user-defined function"))
                 (string :tag "Match")
                 (repeat :tag "Local options"
-                        (list (variable :tag "Option") (sexp :tag "Value"))))
+                        (list (variable :tag "Option") (sexp :tag "Value")))
+                (option (repeat :tag "Export" (file :tag "Export to"))))
           (list :tag "Command series, all agenda files"
                 (string :tag "Key")
                 (string :tag "Description")
@@ -1756,20 +1999,24 @@ precedence over the general options."
 
                 (repeat :tag "General options"
                         (list (variable :tag "Option")
-                              (sexp :tag "Value")))))))
+                              (sexp :tag "Value")))
+                (option (repeat :tag "Export" (file :tag "Export to")))))))
 
 (defcustom org-stuck-projects
-  '("+LEVEL=2/-DONE" ("TODO" "NEXT" "NEXTACTION") nil)
+  '("+LEVEL=2/-DONE" ("TODO" "NEXT" "NEXTACTION") nil "")
   "How to identify stuck projects.
-This is a list of three items:
+This is a list of four items:
 1. A tags/todo matcher string that is used to identify a project.
-   The entire tree below a headline matched by this is considered a project.
-2. A list of TODO keywords itentifying non-stuck projects.
+   The entire tree below a headline matched by this is considered one project.
+2. A list of TODO keywords identifying non-stuck projects.
    If the project subtree contains any headline with one of these todo
-   keywords, the project is consitered to be not stuck.
+   keywords, the project is considered to be not stuck.  If you specify
+   \"*\" as a keyword, any TODO keyword will mark the project unstuck.
 3. A list of tags identifying non-stuck projects.
    If the project subtree contains any headline with one of these tags,
-   the project is consitered to be not stuck.
+   the project is considered to be not stuck.  If you specify \"*\" as
+   a tag, any tag will mark the project unstuck.
+4. An arbitrary regular expression matching non-stuck projects.
 
 After defining this variable, you may use \\[org-agenda-list-stuck-projects]
 or `C-c a #' to produce the list."
@@ -1777,7 +2024,8 @@ or `C-c a #' to produce the list."
   :type '(list
          (string :tag "Tags/TODO match to identify a project")
          (repeat :tag "Projects are *not* stuck if they have an entry with TODO keyword any of" (string))
-         (repeat :tag "Projects are *not* stuck if they have an entry with TAG being any of" (string))))
+         (repeat :tag "Projects are *not* stuck if they have an entry with TAG being any of" (string))
+         (regexp :tag "Projects are *not* stuck if this regexp matches\ninside the subtree")))
 
 
 (defgroup org-agenda-skip nil
@@ -1815,6 +2063,14 @@ This is relevant for the daily/weekly agenda, not for the TODO list."
   :group 'org-agenda-skip
   :type 'boolean)
 
+(defcustom org-agenda-skip-deadline-if-done nil
+  "Non-nil means don't show deadines when the corresponding item is done.
+When nil, the deadline is still shown and should give you a happy feeling.
+
+This is relevant for the daily/weekly agenda."
+  :group 'org-agenda-skip
+  :type 'boolean)
+
 (defcustom org-timeline-show-empty-dates 3
   "Non-nil means, `org-timeline' also shows dates without an entry.
 When nil, only the days which actually have entries are shown.
@@ -1846,7 +2102,7 @@ Needs to be set before org.el is loaded."
   :type 'boolean)
 
 (defcustom org-agenda-start-with-follow-mode nil
-  "The initial value of follwo-mode in a newly created agenda window."
+  "The initial value of follow-mode in a newly created agenda window."
   :group 'org-agenda-startup
   :type 'boolean)
 
@@ -2006,7 +2262,7 @@ a grid line."
   (defcustom org-agenda-sorting-strategy
     '((agenda time-up category-keep priority-down)
       (todo category-keep priority-down)
-      (tags category-keep))
+      (tags category-keep priority-down))
     "Sorting structure for the agenda items of a single day.
 This is a list of symbols which will be used in sequence to determine
 if an entry should be listed before another entry.  The following
@@ -2113,7 +2369,7 @@ the prefix, you could use:
   (setq org-agenda-prefix-format \"  %-11:c% s\")
 
 See also the variables `org-agenda-remove-times-when-in-prefix' and
-`org-agenda-remove-tags-when-in-prefix'."
+`org-agenda-remove-tags'."
   :type '(choice
          (string :tag "General format")
          (list :greedy t :tag "View dependent"
@@ -2144,7 +2400,18 @@ the headline/diary entry."
          (const :tag "Never" nil)
          (const :tag "When at beginning of entry" beg)))
 
-(defcustom org-agenda-remove-tags-when-in-prefix nil
+
+(defcustom org-agenda-default-appointment-duration nil
+  "Default duration for appointments that only have a starting time.
+When nil, no duration is specified in such cases.
+When non-nil, this must be the number of minutes, e.g. 60 for one hour."
+  :group 'org-agenda-prefix
+  :type '(choice
+         (integer :tag "Minutes")
+         (const :tag "No default duration")))
+
+
+(defcustom org-agenda-remove-tags nil
   "Non-nil means, remove the tags from the headline copy in the agenda.
 When this is the symbol `prefix', only remove tags when
 `org-agenda-prefix-format' contains a `%T' specifier."
@@ -2154,6 +2421,10 @@ When this is the symbol `prefix', only remove tags when
          (const :tag "Never" nil)
          (const :tag "When prefix format contains %T" prefix)))
 
+(if (fboundp 'defvaralias)
+    (defvaralias 'org-agenda-remove-tags-when-in-prefix
+      'org-agenda-remove-tags))
+
 (defcustom org-agenda-align-tags-to-column 65
   "Shift tags in agenda items to this column."
   :group 'org-agenda-prefix
@@ -2165,13 +2436,18 @@ When this is the symbol `prefix', only remove tags when
   :group 'org)
 
 (defcustom org-format-latex-options
-  '(:foreground "Black" :background "Transparent" :scale 1.0
-               :matchers ("begin" "$" "$$" "\\(" "\\["))
+  '(:foreground default :background default :scale 1.0
+    :html-foreground "Black" :html-background "Transparent" :html-scale 1.0
+    :matchers ("begin" "$" "$$" "\\(" "\\["))
   "Options for creating images from LaTeX fragments.
 This is a property list with the following properties:
-:foreground  the foreground color, for example \"Black\".
+:foreground  the foreground color for images embedded in emacs, e.g. \"Black\".
+             `default' means use the forground of the default face.
 :background  the background color, or \"Transparent\".
+             `default' means use the background of the default face.
 :scale       a scaling factor for the size of the images
+:html-foreground, :html-background, :html-scale
+             The same numbers for HTML export.
 :matchers    a list indicating which matchers should be used to
              find LaTeX fragments.  Valid members of this list are:
              \"begin\"  find environments
@@ -2182,6 +2458,18 @@ This is a property list with the following properties:
   :group 'org-latex
   :type 'plist)
 
+(defcustom org-format-latex-header "\\documentclass{article}
+\\usepackage{fullpage}         % do not remove
+\\usepackage{amssymb}
+\\usepackage[usenames]{color}
+\\usepackage{amsmath}
+\\usepackage{latexsym}
+\\usepackage[mathscr]{eucal}
+\\pagestyle{empty}             % do not remove"
+  "The document header used for processing LaTeX fragments."
+  :group 'org-latex
+  :type 'string)
+
 (defgroup org-export nil
   "Options for exporting org-listings."
   :tag "Org Export"
@@ -2237,6 +2525,12 @@ This should have an association in `org-export-language-setup'."
   :group 'org-export-general
   :type 'string)
 
+(defcustom org-export-skip-text-before-1st-heading t
+  "Non-nil means, skip all text before the first headline when exporting.
+When nil, that text is exported as well."
+  :group 'org-export-general
+  :type 'boolean)
+
 (defcustom org-export-headline-levels 3
   "The last level which is still exported as a headline.
 Inferior levels will produce itemize lists when exported.
@@ -2323,6 +2617,14 @@ contents entries, but still be shown in the headlines of the document."
          (const :tag "Not in TOC" not-in-toc)
          (const :tag "On" t)))
 
+(defcustom org-export-with-property-drawer nil
+  "Non-nil means, export property drawers.
+When nil, these drawers are removed before export.
+
+This option can also be set with the +OPTIONS line, e.g. \"p:t\"."
+  :group 'org-export-general
+  :type 'boolean)
+
 (defgroup org-export-translation nil
   "Options for translating special ascii sequences for the export backends."
   :tag "Org Export Translation"
@@ -2339,6 +2641,14 @@ This option can also be set with the +OPTIONS line, e.g. \"*:nil\"."
   :group 'org-export-translation
   :type 'boolean)
 
+(defcustom org-export-with-footnotes t
+  "If nil, export [1] as a footnote marker.
+Lines starting with [1] will be formatted as footnotes.
+
+This option can also be set with the +OPTIONS line, e.g. \"f:nil\"."
+  :group 'org-export-translation
+  :type 'boolean)
+
 (defcustom org-export-with-sub-superscripts t
   "Non-nil means, interpret \"_\" and \"^\" for export.
 When this option is turned on, you can use TeX-like syntax for sub- and
@@ -2354,12 +2664,19 @@ sub- or superscripts.
  x_{i^2} or   x^(2-i)    braces or parenthesis do grouping.
 
 Still, ambiguity is possible - so when in doubt use {} to enclose the
-sub/superscript.
+sub/superscript.  If you set this variable to the symbol `{}',
+the braces are *required* in order to trigger interpretations as
+sub/superscript.  This can be helpful in documents that need \"_\"
+frequently in plain text.
+
 Not all export backends support this, but HTML does.
 
 This option can also be set with the +OPTIONS line, e.g. \"^:nil\"."
   :group 'org-export-translation
-  :type 'boolean)
+  :type '(choice
+         (const :tag "Always interpret" t)
+         (const :tag "Only with braces" {})
+         (const :tag "Never interpret" nil)))
 
 (defcustom org-export-with-TeX-macros t
   "Non-nil means, interpret simple TeX-like macros when exporting.
@@ -2467,7 +2784,7 @@ In the given sequence, these characters will be used for level 1, 2, ..."
 
 (defcustom org-export-ascii-bullets '(?* ?+ ?-)
   "Bullet characters for headlines converted to lists in ASCII export.
-The first character is used for the first lest level generated in this
+The first character is is used for the first lest level generated in this
 way, and so on.  If there are more levels than characters given here,
 the list will be repeated.
 Note that plain lists will keep the same bullets as the have in the
@@ -2485,6 +2802,11 @@ Org-mode file."
   :tag "Org Export HTML"
   :group 'org-export)
 
+(defcustom org-export-html-coding-system nil
+  ""
+  :group 'org-export-html
+  :type 'coding-system)
+
 (defcustom org-export-html-style
 "<style type=\"text/css\">
   html {
@@ -2534,6 +2856,7 @@ you can \"misuse\" it to add arbitrary text to the header."
   :group 'org-export-html
   :type 'string)
 
+
 (defcustom org-export-html-title-format "<h1 class=\"title\">%s</h1>\n"
   "Format for typesetting the document title in HTML export."
   :group 'org-export-html
@@ -2579,12 +2902,24 @@ This option can also be set with the +OPTIONS line, e.g. \"@:nil\"."
 
 (defcustom org-export-html-table-tag
   "<table border=\"2\" cellspacing=\"0\" cellpadding=\"6\" rules=\"groups\" frame=\"hsides\">"
-  "The HTML tag used to start a table.
+  "The HTML tag that is used to start a table.
 This must be a <table> tag, but you may change the options like
 borders and spacing."
   :group 'org-export-html
   :type 'string)
 
+(defcustom org-export-table-header-tags '("<th>" . "</th>")
+  "The opening tag for table header fields.
+This is customizable so that alignment options can be specified."
+  :group 'org-export-tables
+  :type '(cons (string :tag "Opening tag") (string :tag "Closing tag")))
+
+(defcustom org-export-table-data-tags '("<td>" . "</td>")
+  "The opening tag for table data fields.
+This is customizable so that alignment options can be specified."
+  :group 'org-export-tables
+  :type '(cons (string :tag "Opening tag") (string :tag "Closing tag")))
+
 (defcustom org-export-html-with-timestamp nil
   "If non-nil, write `org-export-html-html-helper-timestamp'
 into the exported HTML text.  Otherwise, the buffer will just be saved
@@ -2618,6 +2953,12 @@ The file name should be absolute."
          (const :tag "Unfinished" t)
          (const :tag "All" all)))
 
+(defcustom org-icalendar-include-sexps t
+  "Non-nil means, export to iCalendar files should also cover sexp entries.
+These are entries like in the diary, but directly in an Org-mode file."
+  :group 'org-export-icalendar
+  :type 'boolean)
+
 (defcustom org-icalendar-combined-name "OrgMode"
   "Calendar name for the combined iCalendar representing all agenda files."
   :group 'org-export-icalendar
@@ -2690,8 +3031,6 @@ Changing this variable requires a restart of Emacs to take effect."
          (setq markers (concat (replace-match "" t t markers) "^")))
       (if (string-match "-" markers)
          (setq markers (concat (replace-match "" t t markers) "-")))
-;      (while (>= (setq nl (1- nl)) 0) (setq body1 (concat body1 "\n?" body "*?")))
-;      (while (>= (setq nl (1- nl)) 0) (setq body1 (concat body1 "\\(?:\n?" body "*?\\)?")))
       (if (> nl 0)
           (setq body1 (concat body1 "\\(?:\n" body "*?\\)\\{0,"
                               (int-to-string nl) "\\}")))
@@ -2701,15 +3040,15 @@ Changing this variable requires a restart of Emacs to take effect."
                    "\\("
                    "\\([" markers "]\\)"
                    "\\("
-                   "[^" border markers "]"
+                   "[^" border (if (and nil stacked) markers) "]"
                    body1
-                   "[^" border markers "]"
+                   "[^" border (if (and nil stacked) markers) "]"
                    "\\)"
                    "\\3\\)"
                    "\\([" post (if stacked markers) "]\\|$\\)")))))
 
 (defcustom org-emphasis-regexp-components
-  '(" \t('\"" " \t.,?;'\")" " \t\r\n," "." 1 nil)
+  '(" \t('\"" "- \t.,:?;'\")" " \t\r\n,\"'" "." 1 nil)
   "Components used to build the reqular expression for emphasis.
 This is a list with 6 entries.  Terminology:  In an emphasis string
 like \" *strong word* \", we call the initial space PREMATCH, the final
@@ -2719,8 +3058,7 @@ specify what is allowed/forbidden in each part:
 
 pre          Chars allowed as prematch.  Beginning of line will be allowed too.
 post         Chars allowed as postmatch.  End of line will be allowed too.
-border       The chars *forbidden* as border characters.  In addition to the
-             characters given here, all marker characters are forbidden too.
+border       The chars *forbidden* as border characters.
 body-regexp  A regexp like \".\" to match a body character.  Don't use
              non-shy groups here, and don't allow newline here.
 newline      The maximum number of newlines allowed in an emphasis exp.
@@ -2745,11 +3083,11 @@ Use customize to modify this, or restart Emacs after changing it."
     ("_" underline "<u>" "</u>")
     ("=" shadow "<code>" "</code>")
     ("+" (:strike-through t) "<del>" "</del>")
-)
+    )
 "Special syntax for emphasized text.
 Text starting and ending with a special character will be emphasized, for
 example *bold*, _underlined_ and /italic/.  This variable sets the marker
-characters, the face to bbe used by font-lock for highlighting in Org-mode
+characters, the face to be used by font-lock for highlighting in Org-mode
 Emacs buffers, and the HTML tags to be used for this.
 Use customize to modify this, or restart Emacs after changing it."
   :group 'org-font-lock
@@ -2770,6 +3108,8 @@ Use customize to modify this, or restart Emacs after changing it."
   :tag "Org Faces"
   :group 'org-font-lock)
 
+;; FIXME: convert that into a macro?  Not critical, because this
+;;        is only executed a few times at load time.
 (defun org-compatible-face (specs)
   "Make a compatible face specification.
 XEmacs and Emacs 21 do not know about the `min-colors' attribute.
@@ -2884,6 +3224,39 @@ color of the frame."
   "Face used for special keywords."
   :group 'org-faces)
 
+(defface org-drawer ;; font-lock-function-name-face
+  (org-compatible-face
+   '((((class color) (min-colors 88) (background light)) (:foreground "Blue1"))
+     (((class color) (min-colors 88) (background dark)) (:foreground "LightSkyBlue"))
+     (((class color) (min-colors 16) (background light)) (:foreground "Blue"))
+     (((class color) (min-colors 16) (background dark)) (:foreground "LightSkyBlue"))
+     (((class color) (min-colors 8)) (:foreground "blue" :bold t))
+     (t (:bold t))))
+  "Face used for drawers."
+  :group 'org-faces)
+
+(defface org-property-value nil
+  "Face used for the value of a property."
+  :group 'org-faces)
+
+(defface org-column
+  (org-compatible-face
+   '((((class color) (min-colors 16) (background light))
+      (:background "grey90"))
+     (((class color) (min-colors 16) (background dark))
+      (:background "grey30"))
+     (((class color) (min-colors 8))
+      (:background "cyan" :foreground "black"))
+     (t (:inverse-video t))))
+  "Face for column display of entry properties."
+  :group 'org-faces)
+
+(when (fboundp 'set-face-attribute)
+  ;; Make sure that a fixed-width face is used when we have a column table.
+  (set-face-attribute 'org-column nil
+                     :height (face-attribute 'default :height)
+                     :family (face-attribute 'default :family)))  
+
 (defface org-warning ;; font-lock-warning-face
   (org-compatible-face
    '((((class color) (min-colors 16) (background light)) (:foreground "Red1" :bold t))
@@ -2894,15 +3267,6 @@ color of the frame."
   "Face for deadlines and TODO keywords."
   :group 'org-faces)
 
-(defface org-headline-done ;; font-lock-string-face
-  (org-compatible-face
-   '((((class color) (min-colors 16) (background light)) (:foreground "RosyBrown"))
-     (((class color) (min-colors 16) (background dark)) (:foreground "LightSalmon"))
-     (((class color) (min-colors 8)  (background light)) (:bold nil))))
-  "Face used to indicate that a headline is DONE.
-This face is only used if `org-fontify-done-headline' is set."
-  :group 'org-faces)
-
 (defface org-archived    ; similar to shadow
   (org-compatible-face
    '((((class color grayscale) (min-colors 88) (background light))
@@ -2923,6 +3287,13 @@ This face is only used if `org-fontify-done-headline' is set."
   "Face for links."
   :group 'org-faces)
 
+(defface org-target
+  '((((class color) (background light)) (:underline t))
+    (((class color) (background dark)) (:underline t))
+    (t (:underline t)))
+  "Face for links."
+  :group 'org-faces)
+
 (defface org-date
   '((((class color) (background light)) (:foreground "Purple" :underline t))
     (((class color) (background dark)) (:foreground "Cyan" :underline t))
@@ -2930,6 +3301,13 @@ This face is only used if `org-fontify-done-headline' is set."
   "Face for links."
   :group 'org-faces)
 
+(defface org-sexp-date
+  '((((class color) (background light)) (:foreground "Purple"))
+    (((class color) (background dark)) (:foreground "Cyan"))
+    (t (:underline t)))
+  "Face for links."
+  :group 'org-faces)
+
 (defface org-tag
   '((t (:bold t)))
   "Face for tags."
@@ -2951,7 +3329,17 @@ This face is only used if `org-fontify-done-headline' is set."
      (((class color) (min-colors 16) (background dark)) (:foreground "PaleGreen" :bold t))
      (((class color) (min-colors 8)) (:foreground "green"))
      (t (:bold t))))
-  "Face used for DONE."
+  "Face used for todo keywords that indicate DONE items."
+  :group 'org-faces)
+
+(defface org-headline-done ;; font-lock-string-face
+  (org-compatible-face
+   '((((class color) (min-colors 16) (background light)) (:foreground "RosyBrown"))
+     (((class color) (min-colors 16) (background dark)) (:foreground "LightSalmon"))
+     (((class color) (min-colors 8)  (background light)) (:bold nil))))
+  "Face used to indicate that a headline is DONE.
+This face is only used if `org-fontify-done-headline' is set.  If applies
+to the part of the headline after the DONE keyword."
   :group 'org-faces)
 
 (defface org-table ;; font-lock-function-name-face
@@ -2975,6 +3363,17 @@ This face is only used if `org-fontify-done-headline' is set."
   "Face for formulas."
   :group 'org-faces)
 
+(defface org-agenda-structure ;; font-lock-function-name-face
+  (org-compatible-face
+   '((((class color) (min-colors 88) (background light)) (:foreground "Blue1"))
+     (((class color) (min-colors 88) (background dark)) (:foreground "LightSkyBlue"))
+     (((class color) (min-colors 16) (background light)) (:foreground "Blue"))
+     (((class color) (min-colors 16) (background dark)) (:foreground "LightSkyBlue"))
+     (((class color) (min-colors 8)) (:foreground "blue" :bold t))
+     (t (:bold t))))
+  "Face used in agenda for captions and dates."
+  :group 'org-faces)
+
 (defface org-scheduled-today
   (org-compatible-face
    '((((class color) (min-colors 88) (background light)) (:foreground "DarkGreen"))
@@ -3016,14 +3415,19 @@ This face is only used if `org-fontify-done-headline' is set."
   '(org-level-1 org-level-2 org-level-3 org-level-4
     org-level-5 org-level-6 org-level-7 org-level-8
     ))
-(defconst org-n-levels (length org-level-faces))
 
+(defcustom org-n-level-faces (length org-level-faces)
+  "The number different faces to be used for headlines.
+Org-mode defines 8 different headline faces, so this can be at most 8.
+If it is less than 8, the level-1 face gets re-used for level N+1 etc."
+  :type 'number
+  :group 'org-faces)
 
 ;;; Variables for pre-computed regular expressions, all buffer local
 
-(defvar org-done-string nil
-  "The last string in `org-todo-keywords', indicating an item is DONE.")
-(make-variable-buffer-local 'org-done-string)
+(defvar org-drawer-regexp nil
+  "Matches first line of a hidden block.")
+(make-variable-buffer-local 'org-drawer-regexp)
 (defvar org-todo-regexp nil
   "Matches any of the TODO state keywords.")
 (make-variable-buffer-local 'org-todo-regexp)
@@ -3043,12 +3447,6 @@ Also put tags into group 4 if tags are present.")
 (defvar org-looking-at-done-regexp nil
   "Matches the DONE keyword a point.")
 (make-variable-buffer-local 'org-looking-at-done-regexp)
-(defvar org-todo-kwd-priority-p nil
-  "Do TODO items have priorities?")
-(make-variable-buffer-local 'org-todo-kwd-priority-p)
-(defvar org-todo-kwd-max-priority nil
-  "Maximum priority of TODO items.")
-(make-variable-buffer-local 'org-todo-kwd-max-priority)
 (defvar org-ds-keyword-length 12
   "Maximum length of the Deadline and SCHEDULED keywords.")
 (make-variable-buffer-local 'org-ds-keyword-length)
@@ -3080,6 +3478,9 @@ Also put tags into group 4 if tags are present.")
 (defvar org-maybe-keyword-time-regexp nil
   "Matches a timestamp, possibly preceeded by a keyword.")
 (make-variable-buffer-local 'org-maybe-keyword-time-regexp)
+(defvar org-planning-or-clock-line-re nil
+  "Matches a line with planning or clock info.")
+(make-variable-buffer-local 'org-planning-or-clock-line-re)
 
 (defconst org-rm-props '(invisible t face t keymap t intangible t mouse-face t
                                   rear-nonsticky t mouse-map t fontified t)
@@ -3093,7 +3494,9 @@ Also put tags into group 4 if tags are present.")
     (match-string-no-properties num string)))
 
 (defsubst org-no-properties (s)
-  (remove-text-properties 0 (length s) org-rm-props s)
+  (if (fboundp 'set-text-properties)
+      (set-text-properties 0 (length s) nil s)
+    (remove-text-properties 0 (length s) org-rm-props s))
   s)
 
 (defsubst org-get-alist-option (option key)
@@ -3102,6 +3505,12 @@ Also put tags into group 4 if tags are present.")
        ((assoc key option) (cdr (assoc key option)))
        (t (cdr (assq 'default option)))))
 
+(defsubst org-inhibit-invisibility ()
+  "Modified `buffer-invisibility-spec' for Emacs 21.
+Some ops with invisible text do not work correctly on Emacs 21.  For these
+we turn off invisibility temporarily.  Use this in a `let' form."
+  (if (< emacs-major-version 22) nil buffer-invisibility-spec))
+
 (defsubst org-set-local (var value)
   "Make VAR local in current buffer and set it to VALUE."
   (set (make-variable-buffer-local var) value))
@@ -3139,7 +3548,11 @@ Also put tags into group 4 if tags are present.")
     ("nologging" org-log-done nil)
     ("lognotedone" org-log-done done push)
     ("lognotestate" org-log-done state push)
-    ("lognoteclock-out" org-log-done clock-out push))
+    ("lognoteclock-out" org-log-done clock-out push)
+    ("logrepeat" org-log-repeat t)
+    ("nologrepeat" org-log-repeat nil)
+    ("constcgs" constants-unit-system cgs)
+    ("constSI" constants-unit-system SI))
   "Variable associated with STARTUP options for org-mode.
 Each element is a list of three items: The startup options as written
 in the #+STARTUP line, the corresponding variable, and the value to
@@ -3149,11 +3562,17 @@ means to push this value onto the list in the variable.")
 (defun org-set-regexps-and-options ()
   "Precompute regular expressions for current buffer."
   (when (org-mode-p)
+    (org-set-local 'org-todo-kwd-alist nil)
+    (org-set-local 'org-todo-keywords-1 nil)
+    (org-set-local 'org-done-keywords nil)
+    (org-set-local 'org-todo-heads nil)
+    (org-set-local 'org-todo-sets nil)
     (let ((re (org-make-options-regexp
-              '("CATEGORY" "SEQ_TODO" "PRI_TODO" "TYP_TODO"
-                "STARTUP" "ARCHIVE" "TAGS" "LINK")))
+              '("CATEGORY" "SEQ_TODO" "PRI_TODO" "TYP_TODO" "COLUMNS"
+                "STARTUP" "ARCHIVE" "TAGS" "LINK" "PRIORITIES"
+                "CONSTANTS")))
          (splitre "[ \t]+")
-         kwds int key value cat arch tags links)
+         kwds key value cat arch tags const links hw dws tail sep kws1 prio)
       (save-excursion
        (save-restriction
          (widen)
@@ -3166,32 +3585,34 @@ means to push this value onto the list in the variable.")
                  (setq value (replace-match "" t t value)))
              (setq cat (intern value)))
             ((equal key "SEQ_TODO")
-             (setq int 'sequence
-                   kwds (append kwds (org-split-string value splitre))))
-            ((equal key "PRI_TODO")
-             (setq int 'priority
-                   kwds (append kwds (org-split-string value splitre))))
+             (push (cons 'sequence (org-split-string value splitre)) kwds))
             ((equal key "TYP_TODO")
-             (setq int 'type
-                   kwds (append kwds (org-split-string value splitre))))
+             (push (cons 'type (org-split-string value splitre)) kwds))
             ((equal key "TAGS")
              (setq tags (append tags (org-split-string value splitre))))
+            ((equal key "COLUMNS")
+             (org-set-local 'org-columns-default-format value))
             ((equal key "LINK")
              (when (string-match "^\\(\\S-+\\)[ \t]+\\(.+\\)" value)
                (push (cons (match-string 1 value)
                            (org-trim (match-string 2 value)))
                      links)))
+            ((equal key "PRIORITIES")
+             (setq prio (org-split-string value " +")))
+            ((equal key "CONSTANTS")
+             (setq const (append const (org-split-string value splitre))))
             ((equal key "STARTUP")
              (let ((opts (org-split-string value splitre))
                    l var val)
-               (while (setq l (assoc (pop opts) org-startup-options))
-                 (setq var (nth 1 l) val (nth 2 l))
-                 (if (not (nth 3 l))
-                     (set (make-local-variable var) val)
-                   (if (not (listp (symbol-value var)))
-                       (set (make-local-variable var) nil))
-                   (set (make-local-variable var) (symbol-value var))
-                   (add-to-list var val)))))
+               (while (setq l (pop opts))
+                 (when (setq l (assoc l org-startup-options))
+                   (setq var (nth 1 l) val (nth 2 l))
+                   (if (not (nth 3 l))
+                       (set (make-local-variable var) val)
+                     (if (not (listp (symbol-value var)))
+                         (set (make-local-variable var) nil))
+                     (set (make-local-variable var) (symbol-value var))
+                     (add-to-list var val))))))
             ((equal key "ARCHIVE")
              (string-match " *$" value)
              (setq arch (replace-match "" t t value))
@@ -3199,17 +3620,53 @@ means to push this value onto the list in the variable.")
                                      '(face t fontified t) arch)))
            )))
       (and cat (org-set-local 'org-category cat))
-      (and kwds (org-set-local 'org-todo-keywords kwds))
+      (when prio
+       (if (< (length prio) 3) (setq prio '("A" "C" "B")))
+       (setq prio (mapcar 'string-to-char prio))
+       (org-set-local 'org-highest-priority (nth 0 prio))
+       (org-set-local 'org-lowest-priority  (nth 1 prio))
+       (org-set-local 'org-default-priority (nth 2 prio)))
       (and arch (org-set-local 'org-archive-location arch))
-      (and int (org-set-local 'org-todo-interpretation int))
       (and links (setq org-link-abbrev-alist-local (nreverse links)))
+      ;; Process the TODO keywords
+      (unless kwds
+       ;; Use the global values as if they had been given locally.
+       (setq kwds (default-value 'org-todo-keywords))
+       (if (stringp (car kwds))
+           (setq kwds (list (cons org-todo-interpretation
+                                  (default-value 'org-todo-keywords)))))
+       (setq kwds (reverse kwds)))
+      (setq kwds (nreverse kwds))
+      (let (inter kws)
+       (while (setq kws (pop kwds))
+         (setq inter (pop kws) sep (member "|" kws)
+               kws1 (delete "|" (copy-sequence kws))
+               hw (car kws1)
+               dws (if sep (cdr sep) (last kws1))
+               tail (list inter hw (car dws) (org-last dws)))
+         (add-to-list 'org-todo-heads hw 'append)
+         (push kws1 org-todo-sets)
+         (setq org-done-keywords (append org-done-keywords dws nil))
+         (mapc (lambda (x) (push (cons x tail) org-todo-kwd-alist)) kws1)
+         (setq org-todo-keywords-1 (append org-todo-keywords-1 kws1 nil)))
+       (setq org-todo-sets (nreverse org-todo-sets)
+             org-todo-kwd-alist (nreverse org-todo-kwd-alist)))
+      ;; Process the constants
+      (when const
+       (let (e cst)
+         (while (setq e (pop const))
+           (if (string-match "^\\([a-zA-Z0][_a-zA-Z0-9]*\\)=\\(.*\\)" e)
+               (push (cons (match-string 1 e) (match-string 2 e)) cst)))
+         (setq org-table-formula-constants-local cst)))
+
+      ;; Process the tags.
       (when tags
        (let (e tgs)
          (while (setq e (pop tags))
            (cond
             ((equal e "{") (push '(:startgroup) tgs))
             ((equal e "}") (push '(:endgroup) tgs))
-            ((string-match "^\\([0-9a-zA-Z_@]+\\)(\\(.\\))$" e)
+            ((string-match (org-re "^\\([[:alnum:]_@]+\\)(\\(.\\))$") e)
              (push (cons (match-string 1 e)
                          (string-to-char (match-string 2 e)))
                    tgs))
@@ -3221,32 +3678,40 @@ means to push this value onto the list in the variable.")
                (push e org-tag-alist))))))
 
     ;; Compute the regular expressions and other local variables
-    (setq org-todo-kwd-priority-p (equal org-todo-interpretation 'priority)
-         org-todo-kwd-max-priority (1- (length org-todo-keywords))
-         org-ds-keyword-length (+ 2 (max (length org-deadline-string)
+    (if (not org-done-keywords)
+       (setq org-done-keywords (list (org-last org-todo-keywords-1))))
+    (setq org-ds-keyword-length (+ 2 (max (length org-deadline-string)
                                          (length org-scheduled-string)))
-         org-done-string
-         (nth (1- (length org-todo-keywords)) org-todo-keywords)
+         org-drawer-regexp
+         (concat "^[ \t]*:\\("
+                 (mapconcat 'regexp-quote org-drawers "\\|")
+                 "\\):[ \t]*$")
+         org-not-done-keywords
+         (org-delete-all org-done-keywords (copy-sequence org-todo-keywords-1))
          org-todo-regexp
-         (concat "\\<\\(" (mapconcat 'regexp-quote org-todo-keywords
+         (concat "\\<\\(" (mapconcat 'regexp-quote org-todo-keywords-1
                                      "\\|") "\\)\\>")
          org-not-done-regexp
          (concat "\\<\\("
-                 (mapconcat 'regexp-quote
-                            (nreverse (cdr (reverse org-todo-keywords)))
-                            "\\|")
+                 (mapconcat 'regexp-quote org-not-done-keywords "\\|")
                  "\\)\\>")
          org-todo-line-regexp
-         (concat "^\\(\\*+\\)[ \t]*\\(?:\\("
-                 (mapconcat 'regexp-quote org-todo-keywords "\\|")
-                 "\\)\\>\\)? *\\(.*\\)")
+         (concat "^\\(\\*+\\)[ \t]+\\(?:\\("
+                 (mapconcat 'regexp-quote org-todo-keywords-1 "\\|")
+                 "\\)\\>\\)?[ \t]*\\(.*\\)")
          org-nl-done-regexp
-         (concat "[\r\n]\\*+[ \t]+" org-done-string "\\>")
+         (concat "\n\\*+[ \t]+"
+                 "\\(?:" (mapconcat 'regexp-quote org-done-keywords "\\|")
+                 "\\)" "\\>")
          org-todo-line-tags-regexp
-         (concat "^\\(\\*+\\)[ \t]*\\(?:\\("
-                 (mapconcat 'regexp-quote org-todo-keywords "\\|")
-                 "\\)\\>\\)? *\\(.*?\\([ \t]:[a-zA-Z0-9:_@]+:[ \t]*\\)?$\\)")
-         org-looking-at-done-regexp (concat "^" org-done-string "\\>")
+         (concat "^\\(\\*+\\)[ \t]+\\(?:\\("
+                 (mapconcat 'regexp-quote org-todo-keywords-1 "\\|")
+                 (org-re
+                  "\\)\\>\\)? *\\(.*?\\([ \t]:[[:alnum:]:_@]+:[ \t]*\\)?$\\)"))
+         org-looking-at-done-regexp
+         (concat "^" "\\(?:"
+                 (mapconcat 'regexp-quote org-done-keywords "\\|") "\\)"
+                 "\\>")
          org-deadline-regexp (concat "\\<" org-deadline-string)
          org-deadline-time-regexp
          (concat "\\<" org-deadline-string " *<\\([^>]+\\)>")
@@ -3262,19 +3727,29 @@ means to push this value onto the list in the variable.")
          (concat "\\<\\(" org-scheduled-string
                  "\\|" org-deadline-string
                  "\\|" org-closed-string
+                 "\\|" org-archived-string
                  "\\|" org-clock-string "\\)"
                  " *[[<]\\([^]>]+\\)[]>]")
          org-keyword-time-not-clock-regexp
          (concat "\\<\\(" org-scheduled-string
                  "\\|" org-deadline-string
-                 "\\|" org-closed-string "\\)"
+                 "\\|" org-closed-string
+                 "\\|" org-archived-string
+                 "\\)"
                  " *[[<]\\([^]>]+\\)[]>]")
          org-maybe-keyword-time-regexp
          (concat "\\(\\<\\(" org-scheduled-string
                  "\\|" org-deadline-string
                  "\\|" org-closed-string
+                 "\\|" org-archived-string
                  "\\|" org-clock-string "\\)\\)?"
-                 " *\\([[<][0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}[^]\r\n>]*?[]>]\\)"))
+                 " *\\([[<][0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [^]\r\n>]*?[]>]\\|<%%([^\r\n>]*>\\)")
+         org-planning-or-clock-line-re
+         (concat "\\(?:^[ \t]*\\(" org-scheduled-string
+                 "\\|" org-deadline-string
+                 "\\|" org-closed-string "\\|" org-clock-string
+                 "\\|" org-archived-string "\\)\\>\\)")
+         )
 
     (org-set-font-lock-defaults)))
 
@@ -3325,6 +3800,7 @@ This is for getting out of special buffers like remember.")
 (defvar annotation) ; from remember.el, dynamically scoped in `remember-mode'
 (defvar initial)    ; from remember.el, dynamically scoped in `remember-mode'
 (defvar org-latex-regexps)
+(defvar constants-unit-system)
 
 (defvar original-date) ; dynamically scoped in calendar.el does scope this
 
@@ -3394,6 +3870,7 @@ This is for getting out of special buffers like remember.")
     (overlay-get ovl prop)))
 (defun org-overlays-at (pos)
   (if (featurep 'xemacs) (extents-at pos) (overlays-at pos)))
+;; FIXME: this is currently not used
 (defun org-overlays-in (&optional start end)
   (if (featurep 'xemacs)
       (extent-list nil start end)
@@ -3402,6 +3879,7 @@ This is for getting out of special buffers like remember.")
   (if (featurep 'xemacs) (extent-start-position o) (overlay-start o)))
 (defun org-overlay-end (o)
   (if (featurep 'xemacs) (extent-end-position o) (overlay-end o)))
+;; FIXME: this is currently not used
 (defun org-find-overlays (prop &optional pos delete)
   "Find all overlays specifying PROP at POS or point.
 If DELETE is non-nil, delete all those overlays."
@@ -3455,6 +3933,7 @@ that can be added."
        (setq buffer-invisibility-spec
              (delete arg buffer-invisibility-spec)))))
 
+;; FIXME: this is currently not used
 (defun org-in-invisibility-spec-p (arg)
   "Is ARG a member of `buffer-invisibility-spec'?"
   (if (consp buffer-invisibility-spec)
@@ -3477,6 +3956,7 @@ This variable is set by `org-before-change-function'.
 (defvar org-mode-hook nil)
 (defvar org-inhibit-startup nil)        ; Dynamically-scoped param.
 (defvar org-agenda-keep-modes nil)      ; Dynamically-scoped param.
+(defvar org-table-buffer-is-an nil)
 
 
 ;;;###autoload
@@ -3520,8 +4000,7 @@ The following commands are available:
   (org-add-to-invisibility-spec '(org-cwidth))
   (when (featurep 'xemacs)
     (org-set-local 'line-move-ignore-invisible t))
-  (setq outline-regexp "\\*+")
-  ;;(setq outline-regexp "\\(?:\\*+\\|[ \t]*\\(?:[-+*]\\|[0-9]+[.)]\\) \\)")
+  (setq outline-regexp "\\*+ ")
   (setq outline-level 'org-outline-level)
   (when (and org-ellipsis (stringp org-ellipsis)
              (fboundp 'set-display-table-slot) (boundp 'buffer-display-table))
@@ -3534,6 +4013,7 @@ The following commands are available:
   ;; Calc embedded
   (org-set-local 'calc-embedded-open-mode "# ")
   (modify-syntax-entry ?# "<")
+  (modify-syntax-entry ?@ "w")
   (if org-startup-truncated (setq truncate-lines t))
   (org-set-local 'font-lock-unfontify-region-function
                 'org-unfontify-region)
@@ -3545,6 +4025,7 @@ The following commands are available:
   (org-add-hook 'kill-buffer-hook 'org-check-running-clock nil 'local)
   ;; Paragraphs and auto-filling
   (org-set-autofill-regexps)
+  (setq indent-line-function 'org-indent-line-function)
   (org-update-radio-target-regexp)
 
   ;; Comment characters
@@ -3564,7 +4045,7 @@ The following commands are available:
   (if (and org-insert-mode-line-in-empty-file
           (interactive-p)
           (= (point-min) (point-max)))
-      (insert "    -*- mode: org -*-\n\n"))
+      (insert "#    -*- mode: org -*-\n\n"))
 
   (unless org-inhibit-startup
     (when org-startup-align-all-tables
@@ -3578,6 +4059,8 @@ The following commands are available:
       (let ((this-command 'org-cycle) (last-command 'org-cycle))
        (org-cycle '(4)) (org-cycle '(4)))))))
 
+(put 'org-mode 'flyspell-mode-predicate 'org-mode-flyspell-verify)
+
 (defsubst org-call-with-arg (command arg)
   "Call COMMAND interactively, but pretend prefix are was ARG."
   (let ((current-prefix-arg arg)) (call-interactively command)))
@@ -3610,23 +4093,23 @@ that will be added to PLIST.  Returns the string that was modified."
 ;;;; Font-Lock stuff, including the activators
 
 (defvar org-mouse-map (make-sparse-keymap))
-(define-key org-mouse-map
+(org-defkey org-mouse-map
   (if (featurep 'xemacs) [button2] [mouse-2]) 'org-open-at-mouse)
-(define-key org-mouse-map
+(org-defkey org-mouse-map
   (if (featurep 'xemacs) [button3] [mouse-3]) 'org-find-file-at-mouse)
 (when org-mouse-1-follows-link
-  (define-key org-mouse-map [follow-link] 'mouse-face))
+  (org-defkey org-mouse-map [follow-link] 'mouse-face))
 (when org-tab-follows-link
-  (define-key org-mouse-map [(tab)] 'org-open-at-point)
-  (define-key org-mouse-map "\C-i" 'org-open-at-point))
+  (org-defkey org-mouse-map [(tab)] 'org-open-at-point)
+  (org-defkey org-mouse-map "\C-i" 'org-open-at-point))
 (when org-return-follows-link
-  (define-key org-mouse-map [(return)] 'org-open-at-point)
-  (define-key org-mouse-map "\C-m" 'org-open-at-point))
+  (org-defkey org-mouse-map [(return)] 'org-open-at-point)
+  (org-defkey org-mouse-map "\C-m" 'org-open-at-point))
 
 (require 'font-lock)
 
 (defconst org-non-link-chars "]\t\n\r<>")
-(defconst org-link-types '("https?" "ftp" "mailto" "file" "news" "bbdb" "vm"
+(defconst org-link-types '("http" "https" "ftp" "mailto" "file" "news" "bbdb" "vm"
                           "wl" "mhe" "rmail" "gnus" "shell" "info" "elisp"))
 (defconst org-link-re-with-space
   (concat
@@ -3658,7 +4141,7 @@ that will be added to PLIST.  Returns the string that was modified."
    "Matches plain link, without spaces.")
 
 (defconst org-bracket-link-regexp
-  "\\[\\[\\([^]]+\\)\\]\\(\\[\\([^]]+\\)\\]\\)?\\]"
+  "\\[\\[\\([^][]+\\)\\]\\(\\[\\([^][]+\\)\\]\\)?\\]"
   "Matches a link in double brackets.")
 
 (defconst org-bracket-link-analytic-regexp
@@ -3681,19 +4164,18 @@ that will be added to PLIST.  Returns the string that was modified."
          org-plain-link-re "\\)")
   "Regular expression matching any link.")
 
-(defconst org-ts-lengths
-  (cons (length (format-time-string (car org-time-stamp-formats)))
-       (length (format-time-string (cdr org-time-stamp-formats))))
-  "This holds the lengths of the two different time formats.")
-(defconst org-ts-regexp "<\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}[^\r\n>]*?\\)>"
+(defconst org-ts-regexp "<\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [^\r\n>]*?\\)>"
   "Regular expression for fast time stamp matching.")
-(defconst org-ts-regexp-both "[[<]\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}[^\r\n>]*?\\)[]>]"
+(defconst org-ts-regexp-both "[[<]\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [^\r\n>]*?\\)[]>]"
   "Regular expression for fast time stamp matching.")
-(defconst org-ts-regexp1 "\\(\\([0-9]\\{4\\}\\)-\\([0-9]\\{2\\}\\)-\\([0-9]\\{2\\}\\)\\([^]0-9>\r\n]*\\)\\(\\([0-9]\\{2\\}\\):\\([0-9]\\{2\\}\\)\\)?\\)"
+(defconst org-ts-regexp0 "\\(\\([0-9]\\{4\\}\\)-\\([0-9]\\{2\\}\\)-\\([0-9]\\{2\\}\\)\\([^]0-9>\r\n]*\\)\\(\\([0-9]\\{2\\}\\):\\([0-9]\\{2\\}\\)\\)?\\)"
+  "Regular expression matching time strings for analysis.
+This one does not require the space after the date.")
+(defconst org-ts-regexp1 "\\(\\([0-9]\\{4\\}\\)-\\([0-9]\\{2\\}\\)-\\([0-9]\\{2\\}\\) \\([^]0-9>\r\n]*\\)\\(\\([0-9]\\{2\\}\\):\\([0-9]\\{2\\}\\)\\)?\\)"
   "Regular expression matching time strings for analysis.")
-(defconst org-ts-regexp2 (concat "<" org-ts-regexp1 ">")
+(defconst org-ts-regexp2 (concat "<" org-ts-regexp1 "[^>\n]\\{0,11\\}>")
   "Regular expression matching time stamps, with groups.")
-(defconst org-ts-regexp3 (concat "[[<]" org-ts-regexp1 "[]>]")
+(defconst org-ts-regexp3 (concat "[[<]" org-ts-regexp1 "[^]>\n]\\{0,11\\}[]>]")
   "Regular expression matching time stamps (also [..]), with groups.")
 (defconst org-tr-regexp (concat org-ts-regexp "--?-?" org-ts-regexp)
   "Regular expression matching a time stamp range.")
@@ -3712,27 +4194,87 @@ The time stamps may be either active or inactive.")
 
 (defun org-do-emphasis-faces (limit)
   "Run through the buffer and add overlays to links."
-  (if (re-search-forward org-emph-re limit t)
-      (progn
-       (font-lock-prepend-text-property (match-beginning 2) (match-end 2)
-                                        'face
-                                        (nth 1 (assoc (match-string 3)
-                                                      org-emphasis-alist)))
-       (add-text-properties (match-beginning 2) (match-end 2)
-                            '(font-lock-multiline t))
-       (backward-char 1)
-       t)))
+  (let (rtn)
+    (while (and (not rtn) (re-search-forward org-emph-re limit t))
+      (if (not (= (char-after (match-beginning 3))
+                 (char-after (match-beginning 4))))
+         (progn
+           (setq rtn t)
+           (font-lock-prepend-text-property (match-beginning 2) (match-end 2)
+                                            'face
+                                            (nth 1 (assoc (match-string 3)
+                                                          org-emphasis-alist)))
+           (add-text-properties (match-beginning 2) (match-end 2)
+                                '(font-lock-multiline t))
+           (backward-char 1))))
+    rtn))
+
+(defun org-emphasize (&optional char)
+  "Insert or change an emphasis, i.e. a font like bold or italic.
+If there is an active region, change that region to a new emphasis.
+If there is no region, just insert the marker characters and position
+the cursor between them.
+CHAR should be either the marker character, or the first character of the
+HTML tag associated with that emphasis.  If CHAR is a space, the means
+to remove the emphasis of the selected region.
+If char is not given (for example in an interactive call) it
+will be prompted for."
+  (interactive)
+  (let ((eal org-emphasis-alist) e det
+       (erc org-emphasis-regexp-components)
+       (prompt "")
+       (string "") beg end move tag c s)
+    (if (org-region-active-p)
+       (setq beg (region-beginning) end (region-end)
+             string (buffer-substring beg end))
+      (setq move t))
+
+    (while (setq e (pop eal))
+      (setq tag (car (org-split-string (nth 2 e) "[ <>/]+"))
+           c (aref tag 0))
+      (push (cons c (string-to-char (car e))) det)
+      (setq prompt (concat prompt (format " [%s%c]%s" (car e) c
+                                         (substring tag 1)))))
+    (unless char
+      (message "%s" (concat "Emphasis marker or tag:" prompt))
+      (setq char (read-char-exclusive)))
+    (setq char (or (cdr (assoc char det)) char))
+    (if (equal char ?\ )
+       (setq s "" move nil)
+      (unless (assoc (char-to-string char) org-emphasis-alist)
+       (error "No such emphasis marker: \"%c\"" char))
+      (setq s (char-to-string char)))
+    (while (and (> (length string) 1)
+               (equal (substring string 0 1) (substring string -1))
+               (assoc (substring string 0 1) org-emphasis-alist))
+      (setq string (substring string 1 -1)))
+    (setq string (concat s string s))
+    (if beg (delete-region beg end))
+    (unless (or (bolp)
+               (string-match (concat "[" (nth 0 erc) "\n]")
+                             (char-to-string (char-before (point)))))
+      (insert " "))
+    (unless (string-match (concat "[" (nth 1 erc) "\n]")
+                         (char-to-string (char-after (point))))
+      (insert " ") (backward-char 1))
+    (insert string)
+    (and move (backward-char 1))))
 
 (defun org-activate-plain-links (limit)
   "Run through the buffer and add overlays to links."
-  (if (re-search-forward org-plain-link-re limit t)
-      (progn
-       (add-text-properties (match-beginning 0) (match-end 0)
-                            (list 'mouse-face 'highlight
-                                  'rear-nonsticky t
-                                  'keymap org-mouse-map
-                                  ))
-       t)))
+  (catch 'exit
+    (let (f)
+      (while (re-search-forward org-plain-link-re limit t)
+       (setq f (get-text-property (match-beginning 0) 'face))
+       (if (or (eq f 'org-tag)
+               (and (listp f) (memq 'org-tag f)))
+           nil
+         (add-text-properties (match-beginning 0) (match-end 0)
+                              (list 'mouse-face 'highlight
+                                    'rear-nonsticky t
+                                    'keymap org-mouse-map
+                                    ))
+         (throw 'exit t))))))
 
 (defun org-activate-angle-links (limit)
   "Run through the buffer and add overlays to links."
@@ -3805,7 +4347,9 @@ We use a macro so that the test can happen at compilation time."
 (defvar org-target-regexp "<<\\([^<>\n\r]+\\)>>"
   "Regular expression matching a link target.")
 (defvar org-radio-target-regexp "<<<\\([^<>\n\r]+\\)>>>"
-  "Regular expression matching a link target.")
+  "Regular expression matching a radio target.")
+(defvar org-any-target-regexp "<<<?\\([^<>\n\r]+\\)>>>?" ; FIXME, not exact, would match <<<aaa>>  as a radio target.
+  "Regular expression matching any target.")
 
 (defun org-activate-target-links (limit)
   "Run through the buffer and add overlays to target matches."
@@ -3873,7 +4417,7 @@ between words."
        "\\)\\>")))
 
 (defun org-activate-tags (limit)
-  (if (re-search-forward "[ \t]\\(:[A-Za-z_@0-9:]+:\\)[ \r\n]" limit t)
+  (if (re-search-forward (org-re "[ \t]\\(:[[:alnum:]_@:]+:\\)[ \r\n]") limit t)
       (progn
        (add-text-properties (match-beginning 1) (match-end 1)
                             (list 'mouse-face 'highlight
@@ -3881,48 +4425,47 @@ between words."
                                   'keymap org-mouse-map))
        t)))
 
-(defun org-font-lock-level ()
-  (save-excursion
-    (org-back-to-heading t)
-    (- (match-end 0) (match-beginning 0))))
-
 (defun org-outline-level ()
   (save-excursion
     (looking-at outline-regexp)
     (if (match-beginning 1)
        (+ (org-get-string-indentation (match-string 1)) 1000)
-      (- (match-end 0) (match-beginning 0)))))
+      (1- (- (match-end 0) (match-beginning 0))))))
 
 (defvar org-font-lock-keywords nil)
 
+(defconst org-property-re "^[ \t]*\\(:\\([a-zA-Z_0-9]+\\):\\)[ \t]*\\(\\S-.*\\)"
+  "Regular expression matching a property line.")
+
 (defun org-set-font-lock-defaults ()
   (let* ((em org-fontify-emphasized-text)
         (lk org-activate-links)
         (org-font-lock-extra-keywords
          ;; Headlines
          (list
-          '("^\\(\\**\\)\\(\\*\\)\\(.*\\)" (1 (org-get-level-face 1))
+          '("^\\(\\**\\)\\(\\* \\)\\(.*\\)" (1 (org-get-level-face 1))
             (2 (org-get-level-face 2)) (3 (org-get-level-face 3)))
           '("^[ \t]*\\(\\(|\\|\\+-[-+]\\).*\\S-\\)"
             (1 'org-table))
           ;; Links
+          (if (memq 'tag lk) '(org-activate-tags (1 'org-tag prepend)))
           (if (memq 'angle lk) '(org-activate-angle-links (0 'org-link t)))
           (if (memq 'plain lk) '(org-activate-plain-links (0 'org-link t)))
           (if (memq 'bracket lk) '(org-activate-bracket-links (0 'org-link t)))
           (if (memq 'radio lk) '(org-activate-target-links (0 'org-link t)))
           (if (memq 'date lk) '(org-activate-dates (0 'org-date t)))
-          (if (memq 'tag lk) '(org-activate-tags (1 'org-tag prepend)))
+          '("^&?%%(.*\\|<%%([^>\n]*?>" (0 'org-sexp-date t))
           '(org-hide-wide-columns (0 nil append))
           ;; TODO lines
-          (list (concat "^\\*+[ \t]*" org-not-done-regexp)
+          (list (concat "^\\*+[ \t]+" org-not-done-regexp)
                 '(1 'org-todo t))
           ;; Priorities
-          (list (concat "\\[#[A-Z]\\]") '(0 'org-special-keyword t))
+          (list (concat "\\[#[A-Z0-9]\\]") '(0 'org-special-keyword t))
           ;; Special keywords
-          (list org-repeat-re  '(0 'org-special-keyword t))
           (list (concat "\\<" org-deadline-string) '(0 'org-special-keyword t))
           (list (concat "\\<" org-scheduled-string) '(0 'org-special-keyword t))
           (list (concat "\\<" org-closed-string) '(0 'org-special-keyword t))
+          (list (concat "\\<" org-archived-string) '(0 'org-special-keyword t))
           (list (concat "\\<" org-clock-string) '(0 'org-special-keyword t))
           ;; Emphasis
           (if em
@@ -3930,26 +4473,41 @@ between words."
                    '(org-do-emphasis-faces (0 nil append))
                  '(org-do-emphasis-faces)))
           ;; Checkboxes, similar to Frank Ruell's org-checklet.el
-          '("^[ \t]*\\([-+*]\\|[0-9]+[.)]\\) +\\(\\[[ X]\\]\\)"
+          '("^[ \t]*\\([-+*]\\|[0-9]+[.)]\\) +\\(\\[[- X]\\]\\)"
             2 'bold prepend)
           (if org-provide-checkbox-statistics
               '("\\[\\([0-9]*%\\)\\]\\|\\[\\([0-9]*\\)/\\([0-9]*\\)\\]"
                 (0 (org-get-checkbox-statistics-face) t)))
           ;; COMMENT
-          (list (concat "^\\*+[ \t]*\\<\\(" org-comment-string
+          (list (concat "^\\*+[ \t]+\\<\\(" org-comment-string
                         "\\|" org-quote-string "\\)\\>")
                 '(1 'org-special-keyword t))
           '("^#.*" (0 'font-lock-comment-face t))
           ;; DONE
           (if org-fontify-done-headline
-              (list (concat "^[*]+ +\\<\\(" org-done-string "\\)\\(.*\\)\\>")
+              (list (concat "^[*]+ +\\<\\("
+                            (mapconcat 'regexp-quote org-done-keywords "\\|")
+                            "\\)\\(.*\\)")
                     '(1 'org-done t) '(2 'org-headline-done t))
-            (list (concat "^[*]+ +\\<\\(" org-done-string "\\)\\>")
+            (list (concat "^[*]+ +\\<\\("
+                          (mapconcat 'regexp-quote org-done-keywords "\\|")
+                          "\\)\\>")
                   '(1 'org-done t)))
           ;; Table stuff
           '("^[ \t]*\\(:.*\\)" (1 'org-table t))
           '("| *\\(:?=[^|\n]*\\)" (1 'org-formula t))
-          '("^[ \t]*| *\\([#!$*_^]\\) *|" (1 'org-formula t))
+;         '("^[ \t]*| *\\([#!$*_^/]\\) *|" (1 'org-formula t))
+          '("^[ \t]*| *\\([#*]\\) *|" (1 'org-formula t))
+          '("^[ \t]*|\\( *\\([$!_^/]\\) *|.*\\)|" (1 'org-formula t))
+          ;; Drawers
+;         (list org-drawer-regexp '(0 'org-drawer t))
+;         (list "^[ \t]*:END:" '(0 'org-drawer t))
+          (list org-drawer-regexp '(0 'org-special-keyword t))
+          (list "^[ \t]*:END:" '(0 'org-special-keyword t))
+          ;; Properties
+          (list org-property-re
+                '(1 'org-special-keyword t)
+                '(3 'org-property-value t))
           (if org-format-transports-properties-p
               '("| *\\(<[0-9]+>\\) *" (1 'org-formula t)))
           '("^\\*+ \\(.*:ARCHIVE:.*\\)" (1 'org-archived prepend))
@@ -3966,10 +4524,9 @@ between words."
 (defvar org-f nil)
 (defun org-get-level-face (n)
   "Get the right face for match N in font-lock matching of healdines."
-  (setq org-l (- (match-end 2) (match-beginning 1)))
+  (setq org-l (- (match-end 2) (match-beginning 1) 1))
   (if org-odd-levels-only (setq org-l (1+ (/ org-l 2))))
-;  (setq org-f (nth (1- (% org-l org-n-levels)) org-level-faces))
-  (setq org-f (nth (% (1- org-l) org-n-levels) org-level-faces))
+  (setq org-f (nth (% (1- org-l) org-n-level-faces) org-level-faces))
   (cond
    ((eq n 1) (if org-hide-leading-stars 'org-hide org-f))
    ((eq n 2) org-f)
@@ -4022,12 +4579,12 @@ between words."
   `indent-relative', like TAB normally does.  See the option
   `org-cycle-emulate-tab' for details.
 
-- Special case: if point is the beginning of the buffer and there is no
-  headline in line 1, this function will act as if called with prefix arg."
+- Special case: if point is at the beginning of the buffer and there is
+  no headline in line 1, this function will act as if called with prefix arg."
   (interactive "P")
   (let* ((outline-regexp
          (if (and (org-mode-p) org-cycle-include-plain-lists)
-             "\\(?:\\*+\\|\\([ \t]*\\)\\([-+*]\\|[0-9]+[.)]\\) \\)"
+             "\\(?:\\*+ \\|\\([ \t]*\\)\\([-+*]\\|[0-9]+[.)]\\) \\)"
            outline-regexp))
         (bob-special (and org-cycle-global-at-bob (bobp)
                           (not (looking-at outline-regexp))))
@@ -4080,6 +4637,14 @@ between words."
        (setq org-cycle-global-status 'overview)
        (run-hook-with-args 'org-cycle-hook 'overview))))
 
+     ((and org-drawers
+          (save-excursion
+            (beginning-of-line 1)
+            (looking-at org-drawer-regexp)))
+      ;; Toggle block visibility
+      (org-flag-drawer
+       (not (get-char-property (match-end 0) 'invisible))))
+
      ((integerp arg)
       ;; Show-subtree, ARG levels up from here.
       (save-excursion
@@ -4088,7 +4653,8 @@ between words."
                              (- (funcall outline-level) arg)))
        (org-show-subtree)))
 
-     ((save-excursion (beginning-of-line 1) (looking-at outline-regexp))
+     ((and (save-excursion (beginning-of-line 1) (looking-at outline-regexp))
+          (or (bolp) (not (eq org-cycle-emulate-tab 'exc-hl-bol))))
       ;; At a heading: rotate between three different views
       (org-back-to-heading)
       (let ((goal-column 0) eoh eol eos)
@@ -4102,20 +4668,30 @@ between words."
              (beginning-of-line 2)) (setq eol (point)))
          (outline-end-of-heading)   (setq eoh (point))
          (org-end-of-subtree t)
-         (skip-chars-forward " \t\n")
-         (beginning-of-line 1) ; in case this is an item
+         (unless (eobp)
+           (skip-chars-forward " \t\n")
+           (beginning-of-line 1) ; in case this is an item
+           )
          (setq eos (1- (point))))
        ;; Find out what to do next and set `this-command'
        (cond
         ((= eos eoh)
          ;; Nothing is hidden behind this heading
          (message "EMPTY ENTRY")
-         (setq org-cycle-subtree-status nil))
+         (setq org-cycle-subtree-status nil)
+         (save-excursion
+           (goto-char eos)
+           (outline-next-heading)
+           (if (org-invisible-p) (org-flag-heading nil))))
         ((>= eol eos)
          ;; Entire subtree is hidden in one line: open it
          (org-show-entry)
          (show-children)
          (message "CHILDREN")
+         (save-excursion
+           (goto-char eos)
+           (outline-next-heading)
+           (if (org-invisible-p) (org-flag-heading nil)))
          (setq org-cycle-subtree-status 'children)
          (run-hook-with-args 'org-cycle-hook 'children))
         ((and (eq last-command this-command)
@@ -4137,6 +4713,11 @@ between words."
 
      ((org-try-cdlatex-tab))
 
+     ((and (eq org-cycle-emulate-tab 'exc-hl-bol)
+          (or (not (bolp))
+              (not (looking-at outline-regexp))))
+      (call-interactively (global-key-binding "\t")))
+
      ((if (and (memq org-cycle-emulate-tab '(white whitestart))
               (save-excursion (beginning-of-line 1) (looking-at "[ \t]*"))
               (or (and (eq org-cycle-emulate-tab 'white)
@@ -4151,7 +4732,7 @@ between words."
          (progn
            (beginning-of-line 1)
            (and (looking-at "[ \t]+") (replace-match ""))))
-      (indent-relative))
+      (call-interactively (global-key-binding "\t")))
 
      (t (save-excursion
          (org-back-to-heading)
@@ -4177,13 +4758,13 @@ of the first headline in the buffer.  This is important, because if the
 first headline is not level one, then (hide-sublevels 1) gives confusing
 results."
   (interactive)
-  (hide-sublevels (save-excursion
-                   (goto-char (point-min))
-                   (if (re-search-forward (concat "^" outline-regexp) nil t)
-                       (progn
-                         (goto-char (match-beginning 0))
-                         (funcall outline-level))
-                     1))))
+  (let ((level (save-excursion
+                (goto-char (point-min))
+                (if (re-search-forward (concat "^" outline-regexp) nil t)
+                    (progn
+                      (goto-char (match-beginning 0))
+                      (funcall outline-level))))))
+    (and level (hide-sublevels level))))
 
 (defun org-content (&optional arg)
   "Show all headlines in the buffer, like a table of contents.
@@ -4210,13 +4791,53 @@ With numerical argument N, show content up to level N."
 This function is the default value of the hook `org-cycle-hook'."
   (when (get-buffer-window (current-buffer))
     (cond
-     ((eq state 'overview) (org-first-headline-recenter 1))
+;     ((eq state 'overview) (org-first-headline-recenter 1))
+;     ((eq state 'overview) (org-beginning-of-line))
      ((eq state 'content)  nil)
      ((eq state 'all)      nil)
      ((eq state 'folded)   nil)
      ((eq state 'children) (or (org-subtree-end-visible-p) (recenter 1)))
      ((eq state 'subtree)  (or (org-subtree-end-visible-p) (recenter 1))))))
 
+
+(defun org-cycle-show-empty-lines (state)
+  "Show empty lines above all visible headlines.
+The region to be covered depends on STATE when called through
+`org-cycle-hook'.  Lisp program can use t for STATE to get the
+entire buffer covered.  Note that an empty line is only shown if there
+are at least `org-cycle-separator-lines' empty lines before the headeline."
+  (when (> org-cycle-separator-lines 0)
+    (save-excursion
+      (let* ((n org-cycle-separator-lines)
+            (re (cond
+                 ((= n 1) "\\(\n[ \t]*\n\\*+\\) ")
+                 ((= n 2) "^[ \t]*\\(\n[ \t]*\n\\*+\\) ")
+                 (t (let ((ns (number-to-string (- n 2))))
+                      (concat "^\\(?:[ \t]*\n\\)\\{" ns "," ns "\\}"
+                              "[ \t]*\\(\n[ \t]*\n\\*+\\) ")))))
+            beg end)
+       (cond
+        ((memq state '(overview contents t))
+         (setq beg (point-min) end (point-max)))
+        ((memq state '(children folded))
+         (setq beg (point) end (progn (org-end-of-subtree t t)
+                                      (beginning-of-line 2)
+                                      (point)))))
+       (when beg
+         (goto-char beg)
+         (while (re-search-forward re end t)
+           (if (not (get-char-property (match-end 1) 'invisible))
+               (outline-flag-region
+                (match-beginning 1) (match-end 1) nil)))))))
+  ;; Never hide empty lines at the end of the file.
+  (save-excursion
+    (goto-char (point-max))
+    (outline-previous-heading)
+    (outline-end-of-heading)
+    (if (and (looking-at "[ \t\n]+")
+            (= (match-end 0) (point-max)))
+       (outline-flag-region (point) (match-end 0) nil))))
+
 (defun org-subtree-end-visible-p ()
   "Is the end of the current subtree visible?"
   (pos-visible-in-window-p
@@ -4238,27 +4859,27 @@ Optional argument N means, put the headline into the Nth line of the window."
 (let ((cmds '(isearch-forward isearch-backward)) cmd)
   (while (setq cmd (pop cmds))
     (substitute-key-definition cmd cmd org-goto-map global-map)))
-(define-key org-goto-map "\C-m"     'org-goto-ret)
-(define-key org-goto-map [(left)]   'org-goto-left)
-(define-key org-goto-map [(right)]  'org-goto-right)
-(define-key org-goto-map [(?q)]     'org-goto-quit)
-(define-key org-goto-map [(control ?g)] 'org-goto-quit)
-(define-key org-goto-map "\C-i" 'org-cycle)
-(define-key org-goto-map [(tab)] 'org-cycle)
-(define-key org-goto-map [(down)] 'outline-next-visible-heading)
-(define-key org-goto-map [(up)] 'outline-previous-visible-heading)
-(define-key org-goto-map "n" 'outline-next-visible-heading)
-(define-key org-goto-map "p" 'outline-previous-visible-heading)
-(define-key org-goto-map "f" 'outline-forward-same-level)
-(define-key org-goto-map "b" 'outline-backward-same-level)
-(define-key org-goto-map "u" 'outline-up-heading)
-(define-key org-goto-map "\C-c\C-n" 'outline-next-visible-heading)
-(define-key org-goto-map "\C-c\C-p" 'outline-previous-visible-heading)
-(define-key org-goto-map "\C-c\C-f" 'outline-forward-same-level)
-(define-key org-goto-map "\C-c\C-b" 'outline-backward-same-level)
-(define-key org-goto-map "\C-c\C-u" 'outline-up-heading)
+(org-defkey org-goto-map "\C-m"     'org-goto-ret)
+(org-defkey org-goto-map [(left)]   'org-goto-left)
+(org-defkey org-goto-map [(right)]  'org-goto-right)
+(org-defkey org-goto-map [(?q)]     'org-goto-quit)
+(org-defkey org-goto-map [(control ?g)] 'org-goto-quit)
+(org-defkey org-goto-map "\C-i" 'org-cycle)
+(org-defkey org-goto-map [(tab)] 'org-cycle)
+(org-defkey org-goto-map [(down)] 'outline-next-visible-heading)
+(org-defkey org-goto-map [(up)] 'outline-previous-visible-heading)
+(org-defkey org-goto-map "n" 'outline-next-visible-heading)
+(org-defkey org-goto-map "p" 'outline-previous-visible-heading)
+(org-defkey org-goto-map "f" 'outline-forward-same-level)
+(org-defkey org-goto-map "b" 'outline-backward-same-level)
+(org-defkey org-goto-map "u" 'outline-up-heading)
+(org-defkey org-goto-map "\C-c\C-n" 'outline-next-visible-heading)
+(org-defkey org-goto-map "\C-c\C-p" 'outline-previous-visible-heading)
+(org-defkey org-goto-map "\C-c\C-f" 'outline-forward-same-level)
+(org-defkey org-goto-map "\C-c\C-b" 'outline-backward-same-level)
+(org-defkey org-goto-map "\C-c\C-u" 'outline-up-heading)
 (let ((l '(1 2 3 4 5 6 7 8 9 0)))
-  (while l (define-key org-goto-map (int-to-string (pop l)) 'digit-argument)))
+  (while l (org-defkey org-goto-map (int-to-string (pop l)) 'digit-argument)))
 
 (defconst org-goto-help
 "Select a location to jump to, press RET
@@ -4474,10 +5095,13 @@ the current headline."
             pos)
        (cond
         ((and (org-on-heading-p) (bolp)
-              (save-excursion (backward-char 1) (not (org-invisible-p))))
+              (or (bobp)
+                  (save-excursion (backward-char 1) (not (org-invisible-p)))))
          (open-line (if blank 2 1)))
-        ((and (bolp) (save-excursion
-                       (backward-char 1) (not (org-invisible-p))))
+        ((and (bolp)
+              (or (bobp)
+                  (save-excursion
+                    (backward-char 1) (not (org-invisible-p)))))
          nil)
         (t (newline (if blank 2 1))))
        (insert head) (just-one-space)
@@ -4500,8 +5124,8 @@ state (TODO by default).  Also with prefix arg, force first state."
       (looking-at org-todo-line-regexp))
     (if (or arg
            (not (match-beginning 2))
-           (equal (match-string 2) org-done-string))
-       (insert (car org-todo-keywords) " ")
+           (member (match-string 2) org-done-keywords))
+       (insert (car org-todo-keywords-1) " ")
       (insert (match-string 2) " "))))
 
 ;;; Promotion and Demotion
@@ -4556,6 +5180,9 @@ in the region."
            ((eolp) (insert " "))
            ((equal (char-after) ?\ ) (forward-char 1))))))
 
+(defun org-reduced-level (l)
+  (if org-odd-levels-only (1+ (floor (/ l 2))) l))
+
 (defun org-get-legal-level (level &optional change)
   "Rectify a level change under the influence of `org-odd-levels-only'
 LEVEL is a current level, CHANGE is by how much the level should be
@@ -4573,8 +5200,8 @@ If the region is active in `transient-mark-mode', promote all headings
 in the region."
   (org-back-to-heading t)
   (let* ((level (save-match-data (funcall outline-level)))
-        (up-head (make-string (org-get-legal-level level -1) ?*))
-        (diff (abs (- level (length up-head)))))
+        (up-head (concat (make-string (org-get-legal-level level -1) ?*) " "))
+        (diff (abs (- level (length up-head) -1))))
     (if (= level 1) (error "Cannot promote to level 0. UNDO to recover if necessary"))
     (replace-match up-head nil t)
     ;; Fixup tag positioning
@@ -4587,8 +5214,8 @@ If the region is active in `transient-mark-mode', demote all headings
 in the region."
   (org-back-to-heading t)
   (let* ((level (save-match-data (funcall outline-level)))
-        (down-head (make-string (org-get-legal-level level 1) ?*))
-        (diff (abs (- level (length down-head)))))
+        (down-head (concat (make-string (org-get-legal-level level 1) ?*) " "))
+        (diff (abs (- level (length down-head) -1))))
     (replace-match down-head nil t)
     ;; Fixup tag positioning
     (and org-auto-align-tags (org-set-tags nil t))
@@ -4649,8 +5276,8 @@ level 5 etc."
     (let ((org-odd-levels-only nil) n)
       (save-excursion
        (goto-char (point-min))
-       (while (re-search-forward "^\\*\\*+" nil t)
-         (setq n (1- (length (match-string 0))))
+       (while (re-search-forward "^\\*\\*+ " nil t)
+         (setq n (- (length (match-string 0)) 2))
          (while (>= (setq n (1- n)) 0)
            (org-demote))
          (end-of-line 1))))))
@@ -4664,15 +5291,15 @@ is signaled in this case."
   (interactive)
   (goto-char (point-min))
   ;; First check if there are no even levels
-  (when (re-search-forward "^\\(\\*\\*\\)+[^*]" nil t)
+  (when (re-search-forward "^\\(\\*\\*\\)+ " nil t)
     (org-show-context t)
     (error "Not all levels are odd in this file.  Conversion not possible."))
   (when (yes-or-no-p "Are you sure you want to globally change levels to odd-even? ")
     (let ((org-odd-levels-only nil) n)
       (save-excursion
        (goto-char (point-min))
-       (while (re-search-forward "^\\*\\*+" nil t)
-         (setq n (/ (length (match-string 0)) 2))
+       (while (re-search-forward "^\\*\\*+ " nil t)
+         (setq n (/ (length (1- (match-string 0))) 2))
          (while (>= (setq n (1- n)) 0)
            (org-promote))
          (end-of-line 1))))))
@@ -4724,6 +5351,7 @@ is signaled in this case."
     (setq txt (buffer-substring beg end))
     (delete-region beg end)
     (insert txt)
+    (or (bolp) (insert "\n"))
     (goto-char ins-point)
     (if folded (hide-subtree))
     (move-marker ins-point nil)))
@@ -4749,7 +5377,9 @@ This is a short-hand for marking the subtree and then copying it.
 If CUT is non-nil, actually cut the subtree."
   (interactive)
   (let (beg end folded)
-    (org-back-to-heading)
+    (if (interactive-p)
+       (org-back-to-heading nil) ; take what looks like a subtree
+      (org-back-to-heading t)) ; take what is really there
     (setq beg (point))
     (save-match-data
       (save-excursion (outline-end-of-heading)
@@ -4794,7 +5424,7 @@ If optional TREE is given, use this text instead of the kill ring."
         (^re_ (concat "\\(" outline-regexp "\\)[  \t]*"))
 
         (old-level (if (string-match ^re txt)
-                       (- (match-end 0) (match-beginning 0))
+                       (- (match-end 0) (match-beginning 0) 1)
                      -1))
         (force-level (cond (level (prefix-numeric-value level))
                            ((string-match
@@ -4888,7 +5518,7 @@ If optional TXT is given, check this string instead of the current kill."
   (save-excursion
     (narrow-to-region
      (progn (org-back-to-heading) (point))
-     (progn (org-end-of-subtree t) (point)))))
+     (progn (org-end-of-subtree t t) (point)))))
 
 
 ;;; Outline Sorting
@@ -5036,7 +5666,6 @@ If WITH-CASE is non-nil, the sorting will be case-sensitive."
        ((= llt ?\)) "\\([ \t]*\\([-+]\\|\\([0-9]+)\\)\\)\\|[ \t]+\\*\\)\\( \\|$\\)")
        (t (error "Invalid value of `org-plain-list-ordered-item-terminator'")))))))
 
-
 (defun org-in-item-p ()
   "It the cursor inside a plain list item.
 Does not have to be the first line."
@@ -5089,7 +5718,7 @@ Return t when things worked, nil when we are not in an item."
        (save-excursion
         (goto-char (match-end 0))
         (skip-chars-forward " \t")
-        (looking-at "\\[[ X]\\]"))))
+        (looking-at "\\[[- X]\\]"))))
 
 (defun org-toggle-checkbox (&optional arg)
   "Toggle the checkbox in the current line."
@@ -5103,7 +5732,11 @@ Return t when things worked, nil when we are not in an item."
        (setq beg (point) end (save-excursion (outline-next-heading) (point))))
        ((org-at-item-checkbox-p)
        (save-excursion
-         (replace-match (if (equal (match-string 0) "[ ]") "[X]" "[ ]") t t))
+         (replace-match
+          (cond (arg "[-]")
+                ((member (match-string 0) '("[ ]" "[-]")) "[X]")
+                (t "[ ]"))
+          t t))
        (throw 'exit t))
        (t (error "Not at a checkbox or heading, and no active region")))
       (save-excursion
@@ -5130,12 +5763,14 @@ with the current numbers.  With optional prefix argument ALL, do this for
 the whole buffer."
   (interactive "P")
   (save-excursion
-    (let* ((buffer-invisibility-spec nil) ; Emacs 21 compatibility
-          (beg (progn (outline-back-to-heading) (point)))
+    (let* ((buffer-invisibility-spec (org-inhibit-invisibility)) ; Emacs 21
+          (beg (condition-case nil
+                   (progn (outline-back-to-heading) (point))
+                 (error (point-min))))
           (end (move-marker (make-marker)
                             (progn (outline-next-heading) (point))))
           (re "\\(\\[[0-9]*%\\]\\)\\|\\(\\[[0-9]*/[0-9]*\\]\\)")
-          (re-box "^[ \t]*\\([-+*]\\|[0-9]+[.)]\\) +\\(\\[[ X]\\]\\)")
+          (re-box "^[ \t]*\\([-+*]\\|[0-9]+[.)]\\) +\\(\\[[- X]\\]\\)")
           b1 e1 f1 c-on c-off lim (cstat 0))
       (when all
        (goto-char (point-min))
@@ -5155,7 +5790,7 @@ the whole buffer."
        (goto-char e1)
        (when lim
          (while (re-search-forward re-box lim t)
-           (if (equal (match-string 2) "[ ]")
+           (if (member (match-string 2) '("[ ]" "[-]"))
                (setq c-off (1+ c-off))
              (setq c-on (1+ c-on))))
          (delete-region b1 e1)
@@ -5214,13 +5849,24 @@ leave it alone.  If it is larger than ind, set it to the target."
        (concat (make-string i1 ?\ ) l)
       l)))
 
+(defcustom org-empty-line-terminates-plain-lists nil
+  "Non-nil means, an empty line ends all plain list levels.
+When nil, empty lines are part of the preceeding item."
+  :group 'org-plain-lists
+  :type 'boolean)
+
 (defun org-beginning-of-item ()
   "Go to the beginning of the current hand-formatted item.
 If the cursor is not in an item, throw an error."
   (interactive)
   (let ((pos (point))
-       (limit (save-excursion (org-back-to-heading)
-                              (beginning-of-line 2) (point)))
+       (limit (save-excursion
+                (condition-case nil
+                    (progn
+                      (org-back-to-heading)
+                      (beginning-of-line 2) (point))
+                  (error (point-min)))))
+       (ind-empty (if org-empty-line-terminates-plain-lists 0 10000))
        ind ind1)
     (if (org-at-item-p)
        (beginning-of-line 1)
@@ -5230,12 +5876,14 @@ If the cursor is not in an item, throw an error."
       (if (catch 'exit
            (while t
              (beginning-of-line 0)
-             (if (< (point) limit) (throw 'exit nil))
-             (unless (looking-at "[ \t]*$")
+             (if (or (bobp) (< (point) limit)) (throw 'exit nil))
+
+             (if (looking-at "[ \t]*$")
+                 (setq ind1 ind-empty)
                (skip-chars-forward " \t")
-               (setq ind1 (current-column))
-               (if (< ind1 ind)
-                   (throw 'exit (org-at-item-p))))))
+               (setq ind1 (current-column)))
+             (if (< ind1 ind)
+                 (progn (beginning-of-line 1) (throw 'exit (org-at-item-p))))))
          nil
        (goto-char pos)
        (error "Not in an item")))))
@@ -5244,22 +5892,27 @@ If the cursor is not in an item, throw an error."
   "Go to the end of the current hand-formatted item.
 If the cursor is not in an item, throw an error."
   (interactive)
-  (let ((pos (point))
-       (limit (save-excursion (outline-next-heading) (point)))
-       (ind (save-excursion
-              (org-beginning-of-item)
-              (skip-chars-forward " \t")
-              (current-column)))
-       ind1)
-    (if (catch 'exit
-         (while t
-           (beginning-of-line 2)
-           (if (>= (point) limit) (throw 'exit t))
-           (unless (looking-at "[ \t]*$")
-             (skip-chars-forward " \t")
-             (setq ind1 (current-column))
-             (if (<= ind1 ind) (throw 'exit t)))))
-       (beginning-of-line 1)
+  (let* ((pos (point))
+        ind1
+        (ind-empty (if org-empty-line-terminates-plain-lists 0 10000))
+        (limit (save-excursion (outline-next-heading) (point)))
+        (ind (save-excursion
+               (org-beginning-of-item)
+               (skip-chars-forward " \t")
+               (current-column)))
+        (end (catch 'exit
+               (while t
+                 (beginning-of-line 2)
+                 (if (eobp) (throw 'exit (point)))
+                 (if (>= (point) limit) (throw 'exit (point-at-bol)))
+                 (if (looking-at "[ \t]*$")
+                     (setq ind1 ind-empty)
+                   (skip-chars-forward " \t")
+                   (setq ind1 (current-column)))
+                 (if (<= ind1 ind)
+                     (throw 'exit (point-at-bol)))))))
+    (if end
+       (goto-char end)
       (goto-char pos)
       (error "Not in an item"))))
 
@@ -5278,9 +5931,9 @@ Error if not at a plain list, or if this is the last item in the list."
 
 (defun org-previous-item ()
   "Move to the beginning of the previous item in the current plain list.
-Error if not at a plain list, or if this is the last item in the list."
+Error if not at a plain list, or if this is the first item in the list."
   (interactive)
-  (let (beg ind (pos (point)))
+  (let (beg ind ind1 (pos (point)))
     (org-beginning-of-item)
     (setq beg (point))
     (setq ind (org-get-indentation))
@@ -5290,10 +5943,13 @@ Error if not at a plain list, or if this is the last item in the list."
        (beginning-of-line 0)
        (if (looking-at "[ \t]*$")
            nil
-         (if (<= (org-get-indentation) ind)
+         (if (<= (setq ind1 (org-get-indentation)) ind)
              (throw 'exit t)))))
     (condition-case nil
-       (org-beginning-of-item)
+       (if (or (not (org-at-item-p))
+               (< ind1 (1- ind)))
+           (error "")
+         (org-beginning-of-item))
       (error (goto-char pos)
             (error "On first item")))))
 
@@ -5338,7 +5994,11 @@ so this really moves item trees."
       (while t
        (beginning-of-line 0)
        (if (looking-at "[ \t]*$")
-           nil
+           (if org-empty-line-terminates-plain-lists
+               (progn
+                 (goto-char pos)
+                 (error "Cannot move this item further up"))
+             nil)
          (if (<= (setq ind1 (org-get-indentation)) ind)
              (throw 'exit t)))))
     (condition-case nil
@@ -5362,10 +6022,45 @@ so this really moves item trees."
   "Renumber the ordered list at point if setup allows it.
 This tests the user option `org-auto-renumber-ordered-lists' before
 doing the renumbering."
-  (and org-auto-renumber-ordered-lists
-       (org-at-item-p)
-       (match-beginning 3)
-       (org-renumber-ordered-list 1)))
+  (interactive)
+  (when (and org-auto-renumber-ordered-lists
+            (org-at-item-p))
+    (if (match-beginning 3)
+       (org-renumber-ordered-list 1)
+      (org-fix-bullet-type 1))))
+
+(defun org-maybe-renumber-ordered-list-safe ()
+  (condition-case nil
+      (save-excursion
+       (org-maybe-renumber-ordered-list))
+    (error nil)))
+
+(defun org-cycle-list-bullet (&optional which)
+  "Cycle through the different itemize/enumerate bullets.
+This cycle the entire list level through the sequence:
+
+   `-'  ->  `+'  ->  `*'  ->  `1.'  ->  `1)'
+
+If WHICH is a string, use that as the new bullet.  If WHICH is an integer,
+0 meand `-', 1 means `+' etc."
+  (interactive "P")
+  (org-preserve-lc
+   (org-beginning-of-item-list)
+   (org-at-item-p)
+   (beginning-of-line 1)
+   (let ((current (match-string 0)) new)
+     (setq new (cond
+               ((and which (nth (1- which) '("-" "+" "*" "1." "1)"))))
+               ((string-match "-" current) "+")
+               ((string-match "\\+" current)
+                (if (looking-at "\\S-") "1." "*"))
+               ((string-match "\\*" current) "1.")
+               ((string-match "\\." current) "1)")
+               ((string-match ")" current) "-")
+               (t (error "This should not happen"))))
+     (and (looking-at "\\([ \t]*\\)\\S-+") (replace-match (concat "\\1" new)))
+     (org-fix-bullet-type 1)
+     (org-maybe-renumber-ordered-list))))
 
 (defun org-get-string-indentation (s)
   "What indentation has S due to SPACE and TAB at the beginning of the string?"
@@ -5391,19 +6086,14 @@ with something like \"1.\" or \"2)\"."
        (ind (org-get-string-indentation
              (buffer-substring (point-at-bol) (match-beginning 3))))
        ;; (term (substring (match-string 3) -1))
-       ind1 (n (1- arg)))
+       ind1 (n (1- arg))
+       fmt)
     ;; find where this list begins
-    (catch 'exit
-      (while t
-       (catch 'next
-         (beginning-of-line 0)
-         (if (looking-at "[ \t]*$") (throw 'next t))
-         (skip-chars-forward " \t") (setq ind1 (current-column))
-         (if (or (< ind1 ind)
-                 (and (= ind1 ind)
-                      (not (org-at-item-p))))
-             (throw 'exit t)))))
-    ;; Walk forward and replace these numbers
+    (org-beginning-of-item-list)
+    (looking-at "[ \t]*[0-9]+\\([.)]\\)")
+    (setq fmt (concat "%d" (match-string 1)))
+    (beginning-of-line 0)
+    ;; walk forward and replace these numbers
     (catch 'exit
       (while t
        (catch 'next
@@ -5414,14 +6104,68 @@ with something like \"1.\" or \"2)\"."
          (if (> ind1 ind) (throw 'next t))
          (if (< ind1 ind) (throw 'exit t))
          (if (not (org-at-item-p)) (throw 'exit nil))
-         (if (not (match-beginning 3))
-             (error "unordered bullet in ordered list.  Press \\[undo] to recover"))
-         (delete-region (match-beginning 3) (1- (match-end 3)))
-         (goto-char (match-beginning 3))
-         (insert (format "%d" (setq n (1+ n)))))))
+         (delete-region (match-beginning 2) (match-end 2))
+         (goto-char (match-beginning 2))
+         (insert (format fmt (setq n (1+ n)))))))
     (goto-line line)
     (move-to-column col)))
 
+(defun org-fix-bullet-type (arg)
+  "Make sure all items in this list have the same bullet."
+  (interactive "p")
+  (unless (org-at-item-p) (error "This is not a list"))
+  (let ((line (org-current-line))
+       (col (current-column))
+       (ind (current-indentation))
+       ind1 bullet)
+    ;; find where this list begins
+    (org-beginning-of-item-list)
+    (beginning-of-line 1)
+    ;; find out what the bullet type is
+    (looking-at "[ \t]*\\(\\S-+\\)")
+    (setq bullet (match-string 1))
+    ;; walk forward and replace these numbers
+    (beginning-of-line 0)
+    (catch 'exit
+      (while t
+       (catch 'next
+         (beginning-of-line 2)
+         (if (eobp) (throw 'exit nil))
+         (if (looking-at "[ \t]*$") (throw 'next nil))
+         (skip-chars-forward " \t") (setq ind1 (current-column))
+         (if (> ind1 ind) (throw 'next t))
+         (if (< ind1 ind) (throw 'exit t))
+         (if (not (org-at-item-p)) (throw 'exit nil))
+         (skip-chars-forward " \t")
+         (looking-at "\\S-+")
+         (replace-match bullet))))
+    (goto-line line)
+    (move-to-column col)
+    (if (string-match "[0-9]" bullet)
+       (org-renumber-ordered-list 1))))
+
+(defun org-beginning-of-item-list ()
+  "Go to the beginning of the current item list.
+I.e. to the first item in this list."
+  (interactive)
+  (org-beginning-of-item)
+  (let ((pos (point-at-bol))
+        (ind (org-get-indentation))
+       ind1)
+    ;; find where this list begins
+    (catch 'exit
+      (while t
+       (catch 'next
+         (beginning-of-line 0)
+         (if (looking-at "[ \t]*$") (throw 'next t))
+         (skip-chars-forward " \t") (setq ind1 (current-column))
+         (if (or (< ind1 ind)
+                 (and (= ind1 ind)
+                      (not (org-at-item-p))))
+             (throw 'exit t)
+           (when (org-at-item-p) (setq pos (point-at-bol)))))))
+    (goto-char pos)))
+
 (defvar org-last-indent-begin-marker (make-marker))
 (defvar org-last-indent-end-marker (make-marker))
 
@@ -5436,7 +6180,7 @@ with something like \"1.\" or \"2)\"."
   (unless (org-at-item-p)
     (error "Not on an item"))
   (save-excursion
-    (let (beg end ind ind1)
+    (let (beg end ind ind1 tmp delta ind-down ind-up)
       (if (memq last-command '(org-shiftmetaright org-shiftmetaleft))
          (setq beg org-last-indent-begin-marker
                end org-last-indent-end-marker)
@@ -5445,14 +6189,227 @@ with something like \"1.\" or \"2)\"."
        (org-end-of-item)
        (setq end (move-marker org-last-indent-end-marker (point))))
       (goto-char beg)
-      (skip-chars-forward " \t") (setq ind (current-column))
-      (if (< (+ arg ind) 0) (error "Cannot outdent beyond margin"))
+      (setq tmp (org-item-indent-positions)
+           ind (car tmp)
+           ind-down (nth 2 tmp)
+           ind-up (nth 1 tmp)
+           delta (if (> arg 0)
+                     (if ind-down (- ind-down ind) (+ 2 ind))
+                   (if ind-up (- ind-up ind) (- ind 2))))
+      (if (< (+ delta ind) 0) (error "Cannot outdent beyond margin"))
       (while (< (point) end)
        (beginning-of-line 1)
        (skip-chars-forward " \t") (setq ind1 (current-column))
        (delete-region (point-at-bol) (point))
-       (indent-to-column (+ ind1 arg))
-       (beginning-of-line 2)))))
+       (or (eolp) (indent-to-column (+ ind1 delta)))
+       (beginning-of-line 2))))
+  (org-maybe-renumber-ordered-list-safe)
+  (save-excursion
+    (beginning-of-line 0)
+    (condition-case nil (org-beginning-of-item) (error nil))
+    (org-maybe-renumber-ordered-list-safe)))
+
+
+(defun org-item-indent-positions ()
+  "Assumes cursor in item line. FIXME"
+  (let* ((bolpos (point-at-bol))
+        (ind (org-get-indentation))
+        ind-down ind-up pos)
+    (save-excursion
+      (org-beginning-of-item-list)
+      (skip-chars-backward "\n\r \t")
+      (when (org-in-item-p)
+       (org-beginning-of-item)
+       (setq ind-up (org-get-indentation))))
+    (setq pos (point))
+    (save-excursion
+      (cond
+       ((and (condition-case nil (progn (org-previous-item) t)
+              (error nil))
+            (or (forward-char 1) t)
+            (re-search-forward "^\\([ \t]*\\([-+]\\|\\([0-9]+[.)]\\)\\)\\|[ \t]+\\*\\)\\( \\|$\\)" bolpos t))
+       (setq ind-down (org-get-indentation)))
+       ((and (goto-char pos)
+            (org-at-item-p))
+       (goto-char (match-end 0))
+       (skip-chars-forward " \t")
+       (setq ind-down (current-column)))))
+    (list ind ind-up ind-down)))
+
+;;; The orgstruct minor mode
+
+;; Define a minor mode which can be used in other modes in order to
+;; integrate the org-mode structure editing commands.
+
+;; This is really a hack, because the org-mode structure commands use
+;; keys which normally belong to the major mode.  Here is how it
+;; works: The minor mode defines all the keys necessary to operate the
+;; structure commands, but wraps the commands into a function which
+;; tests if the cursor is currently at a headline or a plain list
+;; item.  If that is the case, the structure command is used,
+;; temporarily setting many Org-mode variables like regular
+;; expressions for filling etc.  However, when any of those keys is
+;; used at a different location, function uses `key-binding' to look
+;; up if the key has an associated command in another currently active
+;; keymap (minor modes, major mode, global), and executes that
+;; command.  There might be problems if any of the keys is otherwise
+;; used as a prefix key.
+
+;; Another challenge is that the key binding for TAB can be tab or \C-i,
+;; likewise the binding for RET can be return or \C-m.  Orgtbl-mode
+;; addresses this by checking explicitly for both bindings.
+
+(defvar orgstruct-mode-map (make-sparse-keymap)
+  "Keymap for the minor `org-cdlatex-mode'.")
+
+;;;###autoload
+(define-minor-mode orgstruct-mode
+  "Toggle the minor more `orgstruct-mode'.
+This mode is for using Org-mode structure commands in other modes.
+The following key behave as if Org-mode was active, if the cursor
+is on a headline, or on a plain list item (both in the definition
+of Org-mode).
+
+M-up        Move entry/item up
+M-down     Move entry/item down
+M-left     Promote
+M-right            Demote
+M-S-up     Move entry/item up
+M-S-down    Move entry/item down
+M-S-left    Promote subtree
+M-S-right   Demote subtree
+M-q        Fill paragraph and items like in Org-mode
+C-c ^      Sort entries
+C-c -      Cycle list bullet
+TAB         Cycle item visibility
+M-RET       Insert new heading/item
+S-M-RET     Insert new TODO heading / Chekbox item
+C-c C-c     Set tags / toggle checkbox"
+  nil " OrgStruct" nil
+  (and (orgstruct-setup) (defun orgstruct-setup () nil)))
+
+;;;###autoload
+(defun turn-on-orgstruct ()
+  "Unconditionally turn on `orgstruct-mode'."
+  (orgstruct-mode 1))
+
+(defun orgstruct-error ()
+  "Error when there is no default binding for a structure key."
+  (interactive)
+  (error "This key is has no function outside structure elements"))
+
+(defvar org-local-vars nil
+  "List of local variables, for use by `orgstruct-mode'")
+
+(defun orgstruct-setup ()
+  "Setup orgstruct keymaps."
+  (let ((nfunc 0)
+       (bindings
+        (list
+         '([(meta up)]           org-metaup)
+         '([(meta down)]         org-metadown)
+         '([(meta left)]         org-metaleft)
+         '([(meta right)]        org-metaright)
+         '([(meta shift up)]     org-shiftmetaup)
+         '([(meta shift down)]   org-shiftmetadown)
+         '([(meta shift left)]   org-shiftmetaleft)
+         '([(meta shift right)]  org-shiftmetaright)
+         '([(shift up)]          org-shiftup)
+         '([(shift down)]        org-shiftdown)
+         '("\M-q"                fill-paragraph)
+         '("\C-c^"               org-sort)
+         '("\C-c-"               org-cycle-list-bullet)))
+       elt key fun cmd)
+    (while (setq elt (pop bindings))
+      (setq nfunc (1+ nfunc))
+      (setq key (org-key (car elt))
+           fun (nth 1 elt)
+           cmd (orgstruct-make-binding fun nfunc key))
+      (org-defkey orgstruct-mode-map key cmd))
+
+    ;; Special treatment needed for TAB and RET
+    (org-defkey orgstruct-mode-map [(tab)]
+               (orgstruct-make-binding 'org-cycle 102 [(tab)] "\C-i"))
+    (org-defkey orgstruct-mode-map "\C-i"
+               (orgstruct-make-binding 'org-cycle 103 "\C-i" [(tab)]))
+    
+    (org-defkey orgstruct-mode-map "\M-\C-m"
+               (orgstruct-make-binding 'org-insert-heading 105
+                                    "\M-\C-m" [(meta return)]))
+    (org-defkey orgstruct-mode-map [(meta return)]
+               (orgstruct-make-binding 'org-insert-heading 106
+                                    [(meta return)] "\M-\C-m"))
+
+    (org-defkey orgstruct-mode-map [(shift meta return)]
+               (orgstruct-make-binding 'org-insert-todo-heading 107
+                                    [(meta return)] "\M-\C-m"))
+    
+    (org-defkey orgstruct-mode-map "\C-c\C-c" 'org-ctrl-c-ctrl-c)
+    (setq org-local-vars (org-get-local-variables))
+    
+    t))
+
+(defun orgstruct-make-binding (fun n &rest keys)
+  "Create a function for binding in the structure minor mode.
+FUN is the command to call inside a table.  N is used to create a unique
+command name.  KEYS are keys that should be checked in for a command
+to execute outside of tables."
+  (eval
+   (list 'defun
+        (intern (concat "orgstruct-hijacker-command-" (int-to-string n)))
+        '(arg)
+        (concat "In Structure, run `" (symbol-name fun) "'.\n"
+                "Outside of structure, run the binding of `"
+                (mapconcat (lambda (x) (format "%s" x)) keys "' or `")
+                "'.")
+        '(interactive "p")
+        (list 'if
+              '(org-context-p 'headline 'item)
+              (list 'org-run-like-in-org-mode (list 'quote fun))
+              (list 'let '(orgstruct-mode)
+                    (list 'call-interactively
+                          (append '(or)
+                                  (mapcar (lambda (k)
+                                            (list 'key-binding k))
+                                          keys)
+                                  '('orgstruct-error))))))))
+
+(defun org-context-p (&rest contexts)
+  "FIXME:"
+  (let ((pos (point)))
+    (goto-char (point-at-bol))
+    (prog1 (or (and (memq 'table contexts)
+                   (looking-at "[ \t]*|"))
+              (and (memq 'headline contexts)
+                   (looking-at "\\*+"))
+              (and (memq 'item contexts)
+                   (looking-at "[ \t]*\\([-+*] \\|[0-9]+[.)] \\)")))
+      (goto-char pos))))
+
+(defun org-get-local-variables ()
+  "Return a list of all local variables in an org-mode buffer."
+  (let (varlist)
+    (with-current-buffer (get-buffer-create "*Org tmp*")
+      (erase-buffer)
+      (org-mode)
+      (setq varlist (buffer-local-variables)))
+    (kill-buffer "*Org tmp*")
+    (delq nil
+         (mapcar
+          (lambda (x) 
+            (setq x
+                  (if (symbolp x)
+                      (list x)
+                    (list (car x) (list 'quote (cdr x)))))
+            (if (string-match
+                 "^\\(org-\\|orgtbl-\\|outline-\\|comment-\\|paragraph-\\|auto-fill\\|fill-paragraph\\|adaptive-fill\\|indent-\\)"
+                 (symbol-name (car x)))
+                x nil))
+          varlist))))
+
+(defun org-run-like-in-org-mode (cmd)
+  (eval (list 'let org-local-vars
+             (list 'call-interactively (list 'quote cmd)))))
 
 ;;;; Archiving
 
@@ -5468,16 +6425,16 @@ When called with prefix argument FIND-DONE, find whole trees without any
 open TODO items and archive them (after getting confirmation from the user).
 If the cursor is not at a headline when this comand is called, try all level
 1 trees.  If the cursor is on a headline, only try the direct children of
-this heading. "
+this heading."
   (interactive "P")
   (if find-done
       (org-archive-all-done)
     ;; Save all relevant TODO keyword-relatex variables
 
     (let ((tr-org-todo-line-regexp org-todo-line-regexp) ; keep despite compiler
-         (tr-org-todo-keywords org-todo-keywords)
-         (tr-org-todo-interpretation org-todo-interpretation)
-         (tr-org-done-string org-done-string)
+         (tr-org-todo-keywords-1 org-todo-keywords-1)
+         (tr-org-todo-kwd-alist org-todo-kwd-alist)
+         (tr-org-done-keywords org-done-keywords)
          (tr-org-todo-regexp org-todo-regexp)
          (tr-org-todo-line-regexp org-todo-line-regexp)
          (tr-org-odd-levels-only org-odd-levels-only)
@@ -5488,8 +6445,10 @@ this heading. "
 
       ;; Try to find a local archive location
       (save-excursion
-       (if (or (re-search-backward re nil t) (re-search-forward re nil t))
-           (setq org-archive-location (match-string 1))))
+       (save-restriction
+         (widen)
+         (if (or (re-search-backward re nil t) (re-search-forward re nil t))
+             (setq org-archive-location (match-string 1)))))
 
       (if (string-match "\\(.*\\)::\\(.*\\)" org-archive-location)
          (progn
@@ -5516,7 +6475,8 @@ this heading. "
        ;; Enforce org-mode for the archive buffer
        (if (not (org-mode-p))
            ;; Force the mode for future visits.
-           (let ((org-insert-mode-line-in-empty-file t))
+           (let ((org-insert-mode-line-in-empty-file t)
+                 (org-inhibit-startup t))
              (call-interactively 'org-mode)))
        (when newfile-p
          (goto-char (point-max))
@@ -5524,21 +6484,21 @@ this heading. "
                          (buffer-file-name this-buffer))))
        ;; Force the TODO keywords of the original buffer
        (let ((org-todo-line-regexp tr-org-todo-line-regexp)
-             (org-todo-keywords tr-org-todo-keywords)
-             (org-todo-interpretation tr-org-todo-interpretation)
-             (org-done-string tr-org-done-string)
+             (org-todo-keywords-1 tr-org-todo-keywords-1)
+             (org-todo-kwd-alist tr-org-todo-kwd-alist)
+             (org-done-keywords tr-org-done-keywords)
              (org-todo-regexp tr-org-todo-regexp)
              (org-todo-line-regexp tr-org-todo-line-regexp)
              (org-odd-levels-only
-              (if (local-variable-p 'org-odd-levels-only)
+              (if (local-variable-p 'org-odd-levels-only (current-buffer))
                   org-odd-levels-only
                 tr-org-odd-levels-only)))
          (goto-char (point-min))
          (if heading
              (progn
                (if (re-search-forward
-                    (concat "\\(^\\|\r\\)"
-                            (regexp-quote heading) "[ \t]*\\(:[a-zA-Z0-9_@:]+:\\)?[ \t]*\\($\\|\r\\)")
+                    (concat "^" (regexp-quote heading)
+                            (org-re "[ \t]*\\(:[[:alnum:]_@:]+:\\)?[ \t]*\\($\\|\r\\)"))
                     nil t)
                    (goto-char (match-end 0))
                  ;; Heading not found, just insert it at the end
@@ -5556,16 +6516,17 @@ this heading. "
            (goto-char (point-max)) (insert "\n"))
          ;; Paste
          (org-paste-subtree (org-get-legal-level level 1))
-         ;; Mark the entry as done, i.e. set to last work in org-todo-keywords
-         (if org-archive-mark-done
-             (let (org-log-done)
-               (org-todo (length org-todo-keywords))))
+         ;; Mark the entry as done, i.e. set to last word in org-todo-keywords-1 FIXME: not right anymore!!!!!!!
+         (when (and org-archive-mark-done
+                    (looking-at org-todo-line-regexp)
+                    (or (not (match-end 3))
+                        (not (member (match-string 3) org-done-keywords))))
+           (let (org-log-done)
+             (org-todo (car org-done-keywords))))
+
          ;; Move cursor to right after the TODO keyword
          (when org-archive-stamp-time
-           (beginning-of-line 1)
-           (looking-at org-todo-line-regexp)
-           (goto-char (or (match-end 2) (match-beginning 3)))
-           (org-insert-time-stamp (org-current-time) t t "(" ")"))
+           (org-add-planning-info 'archived (org-current-time)))
          ;; Save the buffer, if it is not the same buffer.
          (if (not (eq this-buffer buffer)) (save-buffer))))
       ;; Here we are back in the original buffer.  Everything seems to have
@@ -5620,6 +6581,28 @@ When TAG is non-nil, don't move trees, but mark them with the ARCHIVE tag."
            (goto-char end)))))
     (message "%d trees archived" cntarch)))
 
+(defun org-cycle-hide-drawers (state)
+  "Re-hide all archived subtrees after a visibility state change."
+  (when (not (memq state '(overview folded)))
+    (save-excursion
+      (let* ((globalp (memq state '(contents all)))
+             (beg (if globalp (point-min) (point)))
+             (end (if globalp (point-max) (org-end-of-subtree t))))
+       (goto-char beg)
+       (while (re-search-forward org-drawer-regexp end t)
+         (org-flag-drawer t))))))
+
+(defun org-flag-drawer (flag)
+  (save-excursion
+    (beginning-of-line 1)
+    (when (looking-at "^[ \t]*:[a-zA-Z][a-zA-Z0-9]*:")
+      (let ((b (match-end 0)))
+       (if (re-search-forward
+            "^[ \t]*:END:"
+            (save-excursion (outline-next-heading) (point)) t)
+           (outline-flag-region b (point-at-eol) flag)
+         (error ":END: line missing"))))))
+
 (defun org-cycle-hide-archived-subtrees (state)
   "Re-hide all archived subtrees after a visibility state change."
   (when (and (not org-cycle-open-archived-trees)
@@ -5653,11 +6636,11 @@ When TAG is non-nil, don't move trees, but mark them with the ARCHIVE tag."
 (defun org-toggle-tag (tag &optional onoff)
   "Toggle the tag TAG for the current line.
 If ONOFF is `on' or `off', don't toggle but set to this state."
-  (unless (org-on-heading-p) (error "Not on headling"))
+  (unless (org-on-heading-p t) (error "Not on headling"))
   (let (res current)
     (save-excursion
       (beginning-of-line)
-      (if (re-search-forward "[ \t]:\\([a-zA-Z0-9_@:]+\\):[ \t]*$"
+      (if (re-search-forward (org-re "[ \t]:\\([[:alnum:]_@:]+\\):[ \t]*$")
                             (point-at-eol) t)
          (progn
            (setq current (match-string 1))
@@ -5749,6 +6732,8 @@ outside the table.")
   "Table row types, non-nil only for the duration of a comand.")
 (defvar org-table-current-begin-line nil
   "Table begin line, non-nil only for the duration of a comand.")
+(defvar org-table-current-begin-pos nil
+  "Table begin position, non-nil only for the duration of a comand.")
 (defvar org-table-dlines nil
   "Vector of data line line numbers in the current table.")
 (defvar org-table-hlines nil
@@ -5760,11 +6745,17 @@ outside the table.")
   "Regular expression for matching ranges in formulas.")
 
 (defconst org-table-range-regexp2
-   "@\\([-+]?I*[-+]?[0-9]*\\)?\\(\\$[-+]?[a-zA-Z0-9]+\\)?\\(\\.\\.@?\\([-+]?I*[-+]?[0-9]*\\)?\\(\\$[-+]?[a-zA-Z0-9]+\\)?\\)?\\|\\$[a-zA-Z0-9]+\\.\\.\\$[a-zA-Z0-9]+"
-  "Regular expression to recognize ranges in formulas for highlighting.")
+  (concat
+   "\\(" "@[-0-9I$&]+" "\\|" "[a-zA-Z]\\{1,2\\}\\([0-9]+\\|&\\)" "\\|" "\\$[a-zA-Z0-9]+" "\\)"
+   "\\.\\."
+   "\\(" "@?[-0-9I$&]+" "\\|" "[a-zA-Z]\\{1,2\\}\\([0-9]+\\|&\\)" "\\|" "\\$[a-zA-Z0-9]+" "\\)")
+  "Match a range for reference display.")
 
-(defvar org-inhibit-highlight-removal nil)
+(defconst org-table-translate-regexp
+  (concat "\\(" "@[-0-9I$]+" "\\|" "[a-zA-Z]\\{1,2\\}\\([0-9]+\\|&\\)" "\\)")
+  "Match a reference that needs translation, for reference display.")
 
+(defvar org-inhibit-highlight-removal nil) ; dynamically scoped param
 
 (defun org-table-create-with-table.el ()
   "Use the table.el package to insert a new table.
@@ -5783,8 +6774,9 @@ and table.el tables."
 
 (defun org-table-create-or-convert-from-region (arg)
   "Convert region to table, or create an empty table.
-If there is an active region, convert it to a table.  If there is no such
-region, create an empty table."
+If there is an active region, convert it to a table, using the function
+`org-table-convert-region'.
+If there is no such region, create an empty table with `org-table-create'."
   (interactive "P")
   (if (org-region-active-p)
       (org-table-convert-region (region-beginning) (region-end) arg)
@@ -5827,7 +6819,9 @@ SIZE is a string Columns x Rows like for example \"3x2\"."
 The region goes from BEG0 to END0, but these borders will be moved
 slightly, to make sure a beginning of line in the first line is included.
 When NSPACE is non-nil, it indicates the minimum number of spaces that
-separate columns (default: just one space)."
+separate columns.  By default, the function first checks if every line
+contains at lease one TAB.  If yes, it assumes that the material is TAB
+separated.  If not, it assumes a single space as separator."
   (interactive "rP")
   (let* ((beg (min beg0 end0))
         (end (max beg0 end0))
@@ -6167,7 +7161,7 @@ Optional argument NEW may specify text to replace the current field content."
                    (setq n (concat new "|") org-table-may-need-update t)))
              (or (equal n o)
                  (let (org-table-may-need-update)
-                   (replace-match n))))
+                   (replace-match n t t))))
          (setq org-table-may-need-update t))
        (goto-char pos))))))
 
@@ -6249,9 +7243,13 @@ If the current field is not empty, it is copied down to the next row, and
 the cursor is moved with it.  Therefore, repeating this command causes the
 column to be filled row-by-row.
 If the variable `org-table-copy-increment' is non-nil and the field is an
-integer, it will be incremented while copying."
+integer or a timestamp, it will be incremented while copying.  In the case of
+a timestamp, if the cursor is on the year, change the year.  If it is on the
+month or the day, change that.  Point will stay on the current date field
+in order to easily repeat the interval."
   (interactive "p")
   (let* ((colpos (org-table-current-column))
+        (col (current-column))
         (field (org-table-get-field))
         (non-empty (string-match "[^ \t]" field))
         (beg (org-table-begin))
@@ -6279,8 +7277,12 @@ integer, it will be incremented while copying."
                   (string-match "^[0-9]+$" txt))
              (setq txt (format "%d" (+ (string-to-number txt) 1))))
          (insert txt)
-         (org-table-maybe-recalculate-line)
-         (org-table-align))
+         (move-to-column col)
+         (if (and org-table-copy-increment (org-at-timestamp-p t))
+             (org-timestamp-up 1)
+           (org-table-maybe-recalculate-line))
+         (org-table-align)
+         (move-to-column col))
       (error "No non-empty field found"))))
 
 (defun org-table-check-inside-data-field ()
@@ -6330,7 +7332,6 @@ is always the old value."
        val)
     (forward-char 1) ""))
 
-
 (defun org-table-field-info (arg)
   "Show info about the current field, and highlight any reference at point."
   (interactive "P")
@@ -6344,21 +7345,26 @@ is always the old value."
           (eql (org-table-get-stored-formulas))
           (dline (org-table-current-dline))
           (ref (format "@%d$%d" dline col))
+          (ref1 (org-table-convert-refs-to-an ref))
           (fequation (or (assoc name eql) (assoc ref eql)))
-          (cequation (assoc (int-to-string col) eql)))
+          (cequation (assoc (int-to-string col) eql))
+          (eqn (or fequation cequation)))
       (goto-char pos)
       (condition-case nil
-         (org-show-reference 'local)
+         (org-table-show-reference 'local)
        (error nil))
-      (message "line @%d, col $%s%s, ref @%d$%d%s%s"
+      (message "line @%d, col $%s%s, ref @%d$%d or %s%s%s"
               dline col
               (if cname (concat " or $" cname) "")
-              dline col
+              dline col ref1
               (if name (concat " or $" name) "")
               ;; FIXME: formula info not correct if special table line
-              (if (or fequation cequation)
-                  (concat ", " (if fequation "field" "column")
-                          " formula applies" "")
+              (if eqn
+                  (concat ", formula: "
+                          (org-table-formula-to-user
+                           (concat
+                            (if (string-match "^[$@]"(car eqn)) "" "$")
+                            (car eqn) "=" (cdr eqn))))
                 "")))))
 
 (defun org-table-current-column ()
@@ -6635,9 +7641,9 @@ With prefix ARG, insert below the current line."
         (org-table-align))
     (org-table-fix-formulas "@" nil (1- (org-table-current-dline)) 1)))
 
-(defun org-table-insert-hline (&optional arg)
+(defun org-table-insert-hline (&optional above)
   "Insert a horizontal-line below the current line into the table.
-With prefix ARG, insert above the current line."
+With prefix ABOVE, insert above the current line."
   (interactive "P")
   (if (not (org-at-table-p))
       (error "Not at a table"))
@@ -6649,12 +7655,25 @@ With prefix ARG, insert above the current line."
                  (concat "+" (make-string (- (match-end 1) (match-beginning 1))
                                           ?-) "|") t t line)))
     (and (string-match "\\+" line) (setq line (replace-match "|" t t line)))
-    (beginning-of-line (if arg 1 2))
+    (beginning-of-line (if above 1 2))
     (insert line "\n")
-    (beginning-of-line (if arg 1 -1))
+    (beginning-of-line (if above 1 -1))
     (move-to-column col)
     (and org-table-overlay-coordinates (org-table-align))))
 
+(defun org-table-hline-and-move (&optional same-column)
+  "Insert a hline and move to the row below that line."
+  (interactive "P")
+  (let ((col (org-table-current-column)))
+    (org-table-maybe-eval-formula)
+    (org-table-maybe-recalculate-line)
+    (org-table-insert-hline)
+    (end-of-line 2)
+    (if (looking-at "\n[ \t]*|-")
+       (progn (insert "\n|") (org-table-align))
+      (org-table-next-field))
+    (if same-column (org-table-goto-column col))))
+
 (defun org-table-clean-line (s)
   "Convert a table line S into a string with only \"|\" and space.
 In particular, this does handle wide and invisible characters."
@@ -6733,7 +7752,7 @@ should be done in reverse order."
        (setq beg (point-at-bol 1)))
       (goto-char pos)
       (if (re-search-forward org-table-hline-regexp tend t)
-         (setq beg (point-at-bol 0))
+         (setq end (point-at-bol 1))
        (goto-char tend)
        (setq end (point-at-bol))))
     (setq beg (move-marker (make-marker) beg)
@@ -6959,15 +7978,14 @@ it can be edited in place."
       (switch-to-buffer-other-window "*Org tmp*")
       (erase-buffer)
       (insert "#\n# Edit field and finish with C-c C-c\n#\n")
-      (org-mode)
+      (let ((org-inhibit-startup t)) (org-mode))
       (goto-char (setq p (point-max)))
       (insert (org-trim field))
       (remove-text-properties p (point-max)
                              '(invisible t org-cwidth t display t
                                          intangible t))
       (goto-char p)
-      (org-set-local 'org-finish-function
-                    'org-table-finish-edit-field)
+      (org-set-local 'org-finish-function 'org-table-finish-edit-field)
       (org-set-local 'org-window-configuration cw)
       (org-set-local 'org-field-marker pos)
       (message "Edit and finish with C-c C-c"))))
@@ -6997,8 +8015,8 @@ the table and kill the editing buffer."
 
 (defun org-trim (s)
   "Remove whitespace at beginning and end of string."
-  (if (string-match "^[ \t]+" s) (setq s (replace-match "" t t s)))
-  (if (string-match "[ \t]+$" s) (setq s (replace-match "" t t s)))
+  (if (string-match "^[ \t\n\r]+" s) (setq s (replace-match "" t t s)))
+  (if (string-match "[ \t\n\r]+$" s) (setq s (replace-match "" t t s)))
   s)
 
 (defun org-wrap (string &optional width lines)
@@ -7159,21 +8177,25 @@ If NLAST is a number, only the NLAST fields will actually be summed."
      ((equal n 0)                             nil)
      (t n))))
 
-(defun org-table-current-field-formula ()
+(defun org-table-current-field-formula (&optional key noerror)
   "Return the formula active for the current field.
-Assumes that specials are in place."
+Assumes that specials are in place.
+If KEY is given, return the key to this formula.
+Otherwise return the formula preceeded with \"=\" or \":=\"."
   (let* ((name (car (rassoc (list (org-current-line)
                                  (org-table-current-column))
                            org-table-named-field-locations)))
         (col (org-table-current-column))
         (scol (int-to-string col))
         (ref (format "@%d$%d" (org-table-current-dline) col))
-        (stored-list (org-table-get-stored-formulas))
+        (stored-list (org-table-get-stored-formulas noerror))
         (ass (or (assoc name stored-list)
                  (assoc ref stored-list)
                  (assoc scol stored-list))))
-    (if ass (concat (if (string-match "^[0-9]+$" (car ass)) "=" ":=")
-                   (cdr ass)))))
+    (if key
+       (car ass)
+      (if ass (concat (if (string-match "^[0-9]+$" (car ass)) "=" ":=")
+                     (cdr ass))))))
 
 (defun org-table-get-formula (&optional equation named)
   "Read a formula from the minibuffer, offer stored formula as default.
@@ -7199,11 +8221,16 @@ When NAMED is non-nil, look for a named equation."
               stored)
              ((stringp equation)
               equation)
-             (t (read-string
-                 (format "%s formula $%s=" (if named "Field" "Column") scol)
-                 (or stored "") 'org-table-formula-history
-                 ;stored
-                 ))))
+             (t (org-table-formula-from-user
+                 (read-string
+                  (org-table-formula-to-user
+                   (format "%s formula %s%s="
+                           (if named "Field" "Column")
+                           (if (member (string-to-char scol) '(?$ ?@)) "" "$")
+                           scol))
+                  (if stored (org-table-formula-to-user stored) "")
+                  'org-table-formula-history
+                  )))))
         mustsave)
     (when (not (string-match "\\S-" eq))
       ;; remove formula
@@ -7225,7 +8252,7 @@ When NAMED is non-nil, look for a named equation."
 
 (defun org-table-store-formulas (alist)
   "Store the list of formulas below the current table."
-  (setq alist (sort alist (lambda (a b) (string< (car a) (car b)))))
+  (setq alist (sort alist 'org-table-formula-less-p))
   (save-excursion
     (goto-char (org-table-end))
     (if (looking-at "\\([ \t]*\n\\)*#\\+TBLFM:\\(.*\n?\\)")
@@ -7242,7 +8269,20 @@ When NAMED is non-nil, look for a named equation."
                       alist "::")
            "\n")))
 
-(defun org-table-get-stored-formulas ()
+(defsubst org-table-formula-make-cmp-string (a)
+  (when (string-match "^\\(@\\([0-9]+\\)\\)?\\(\\$?\\([0-9]+\\)\\)?\\(\\$?[a-zA-Z0-9]+\\)?" a)
+    (concat
+     (if (match-end 2) (format "@%05d" (string-to-number (match-string 2 a))) "")
+     (if (match-end 4) (format "$%05d" (string-to-number (match-string 4 a))) "")
+     (if (match-end 5) (concat "@@" (match-string 5 a))))))
+
+(defun org-table-formula-less-p (a b)
+  "Compare two formulas for sorting."
+  (let ((as (org-table-formula-make-cmp-string (car a)))
+       (bs (org-table-formula-make-cmp-string (car b))))
+    (and as bs (string< as bs))))
+
+(defun org-table-get-stored-formulas (&optional noerror)
   "Return an alist with the stored formulas directly after current table."
   (interactive)
   (let (scol eq eq-alist strings string seen)
@@ -7258,7 +8298,12 @@ When NAMED is non-nil, look for a named equation."
                  eq (match-string 3 string)
                  eq-alist (cons (cons scol eq) eq-alist))
            (if (member scol seen)
-               (error "Double definition `$%s=' in TBLFM line, please fix by hand" scol)
+                (if noerror
+                    (progn
+                      (message "Double definition `$%s=' in TBLFM line, please fix by hand" scol)
+                      (ding)
+                      (sit-for 2))
+                  (error "Double definition `$%s=' in TBLFM line, please fix by hand" scol))
              (push scol seen))))))
     (nreverse eq-alist)))
 
@@ -7297,6 +8342,7 @@ For all numbers larger than LIMIT, shift them by DELTA."
            org-table-local-parameters nil
            org-table-named-field-locations nil
            org-table-current-begin-line nil
+           org-table-current-begin-pos nil
            org-table-current-line-types nil)
       (goto-char beg)
       (when (re-search-forward "^[ \t]*| *! *\\(|.*\\)" end t)
@@ -7313,7 +8359,7 @@ For all numbers larger than LIMIT, shift them by DELTA."
       (while (re-search-forward "^[ \t]*| *\\$ *\\(|.*\\)" end t)
        (setq fields (org-split-string (match-string 1) " *| *"))
        (while (setq field (pop fields))
-         (if (string-match "^\\([a-zA-Z][a-zA-Z0-9]*\\|%\\) *= *\\(.*\\)" field)
+         (if (string-match "^\\([a-zA-Z][_a-zA-Z0-9]*\\|%\\) *= *\\(.*\\)" field)
              (push (cons (match-string 1 field) (match-string 2 field))
                    org-table-local-parameters))))
       (goto-char beg)
@@ -7334,6 +8380,7 @@ For all numbers larger than LIMIT, shift them by DELTA."
       ;; Analyse the line types
       (goto-char beg)
       (setq org-table-current-begin-line (org-current-line)
+           org-table-current-begin-pos (point)
            l org-table-current-begin-line)
       (while (looking-at "[ \t]*|\\(-\\)?")
        (push (if (match-end 1) 'hline 'dline) types)
@@ -7344,13 +8391,6 @@ For all numbers larger than LIMIT, shift them by DELTA."
            org-table-dlines (apply 'vector (cons nil (nreverse dlines)))
            org-table-hlines (apply 'vector (cons nil (nreverse hlines)))))))
 
-(defun org-this-word ()
-  ;; Get the current word
-  (save-excursion
-    (let ((beg (progn (skip-chars-backward "^ \t\n") (point)))
-         (end (progn (skip-chars-forward "^ \t\n") (point))))
-      (buffer-substring-no-properties beg end))))
-
 (defun org-table-maybe-eval-formula ()
   "Check if the current field starts with \"=\" or \":=\".
 If yes, store the formula and apply it."
@@ -7364,7 +8404,8 @@ If yes, store the formula and apply it."
              eq (match-string 1 field))
        (if (or (fboundp 'calc-eval)
                (equal (substring eq 0 (min 2 (length eq))) "'("))
-           (org-table-eval-formula (if named '(4) nil) eq)
+           (org-table-eval-formula (if named '(4) nil)
+                                   (org-table-formula-from-user eq))
          (error "Calc does not seem to be installed, and is needed to evaluate the formula"))))))
 
 (defvar org-recalc-commands nil
@@ -7485,7 +8526,7 @@ formula is installed as valid in only this specific field.
 
 When called with two `C-u' prefixes, insert the active equation
 for the field back into the current field, so that it can be
-edited there.  This is useful in order to use \\[org-show-reference]
+edited there.  This is useful in order to use \\[org-table-show-reference]
 to check the referenced fields.
 
 When called, the command first prompts for a formula, which is read in
@@ -7527,7 +8568,7 @@ not overwrite the stored one."
           (modes (copy-sequence org-calc-default-modes))
           (numbers nil) ; was a variable, now fixed default
           (keep-empty nil)
-          n form form0 bw fmt x ev orig c lispp)
+          n form form0 bw fmt x ev orig c lispp literal)
       ;; Parse the format string.  Since we have a lot of modes, this is
       ;; a lot of work.  However, I think calc still uses most of the time.
       (if (string-match ";" formula)
@@ -7549,6 +8590,9 @@ not overwrite the stored one."
            (if (string-match "[NT]" fmt)
                (setq numbers (equal (match-string 0 fmt) "N")
                      fmt (replace-match "" t t fmt)))
+           (if (string-match "L" fmt)
+               (setq literal t
+                     fmt (replace-match "" t t fmt)))
            (if (string-match "E" fmt)
                (setq keep-empty t
                      fmt (replace-match "" t t fmt)))
@@ -7565,13 +8609,14 @@ not overwrite the stored one."
                      (org-no-properties
                       (buffer-substring (point-at-bol) (point-at-eol)))
                      " *| *"))
-       (if numbers
+       (if (eq numbers t)
            (setq fields (mapcar
                          (lambda (x) (number-to-string (string-to-number x)))
                          fields)))
        (setq ndown (1- ndown))
        (setq form (copy-sequence formula)
              lispp (and (> (length form) 2)(equal (substring form 0 2) "'(")))
+       (if (and lispp literal) (setq lispp 'literal))
        ;; Check for old vertical references
        (setq form (org-rewrite-old-row-references form))
        ;; Insert complex ranges
@@ -7596,17 +8641,16 @@ not overwrite the stored one."
                 t t form)))
        (setq form0 form)
        ;; Insert the references to fields in same row
-       (while (string-match "\\$\\([0-9]+\\)?" form)
-         (setq n (if (match-beginning 1)
-                     (string-to-number (match-string 1 form))
-                   n0)
-               x (nth (1- n) fields))
+       (while (string-match "\\$\\([0-9]+\\)" form)
+         (setq n (string-to-number (match-string 1 form))
+               x (nth (1- (if (= n 0) n0 n)) fields))
          (unless x (error "Invalid field specifier \"%s\""
                           (match-string 0 form)))
          (setq form (replace-match
                      (save-match-data
                        (org-table-make-reference x nil numbers lispp))
                      t t form)))
+
        (if lispp
            (setq ev (condition-case nil
                         (eval (eval (read form)))
@@ -7649,6 +8693,12 @@ $1->    %s\n" orig formula form0 form))
       (or suppress-align (and org-table-may-need-update
                              (org-table-align))))))
 
+(defun org-table-put-field-property (prop value)
+  (save-excursion
+    (put-text-property (progn (skip-chars-backward "^|") (point))
+                      (progn (skip-chars-forward "^|") (point))
+                      prop value)))
+
 (defun org-table-get-range (desc &optional tbeg col highlight)
   "Get a calc vector from a column, accorting to descriptor DESC.
 Optional arguments TBEG and COL can give the beginning of the table and
@@ -7688,7 +8738,7 @@ HIGHLIGHT means, just highlight the range."
            (goto-line r1)
            (while (not (looking-at org-table-dataline-regexp))
              (beginning-of-line 2))
-           (prog1 (org-table-get-field c1)
+           (prog1 (org-trim (org-table-get-field c1))
              (if highlight (org-table-highlight-rectangle (point) (point)))))
        ;; A range, return a vector
        ;; First sort the numbers to get a regular ractangle
@@ -7708,7 +8758,8 @@ HIGHLIGHT means, just highlight the range."
            (org-table-highlight-rectangle
             beg (progn (skip-chars-forward "^|\n") (point))))
        ;; return string representation of calc vector
-       (apply 'append (org-table-copy-region beg end))))))
+       (mapcar 'org-trim
+               (apply 'append (org-table-copy-region beg end)))))))
 
 (defun org-table-get-descriptor-line (desc &optional cline bline table)
   "Analyze descriptor DESC and retrieve the corresponding line number.
@@ -7738,7 +8789,7 @@ and TABLE is a vector with line types."
            (setq i 0 hdir "+")
            (if (eq (aref table 0) 'hline) (setq hn (1- hn)))))
       (if (and (not hn) on (not odir))
-         (error "should never happen");;(aref org-table-dlines on) FIXME
+         (error "should never happen");;(aref org-table-dlines on)
        (if (and hn (> hn 0))
            (setq i (org-find-row-type table i 'hline (equal hdir "-") nil hn)))
        (if on
@@ -7771,7 +8822,9 @@ NUMBERS indicates that everything should be converted to numbers.
 LISPP means to return something appropriate for a Lisp list."
   (if (stringp elements) ; just a single val
       (if lispp
-         (prin1-to-string (if numbers (string-to-number elements) elements))
+         (if (eq lispp 'literal)
+             elements
+           (prin1-to-string (if numbers (string-to-number elements) elements)))
        (if (equal elements "") (setq elements "0"))
        (if numbers (number-to-string (string-to-number elements)) elements))
     (unless keep-empty
@@ -7781,9 +8834,12 @@ LISPP means to return something appropriate for a Lisp list."
                          elements))))
     (setq elements (or elements '("0")))
     (if lispp
-       (mapconcat 'prin1-to-string
-                  (if numbers (mapcar 'string-to-number elements) elements)
-                  " ")
+       (mapconcat
+        (lambda (x)
+          (if (eq lispp 'literal)
+              x
+            (prin1-to-string (if numbers (string-to-number x) x))))
+        " ")
       (concat "[" (mapconcat
                   (lambda (x)
                     (if numbers (number-to-string (string-to-number x)) x))
@@ -7806,7 +8862,7 @@ With prefix arg ALL, do this for all lines in the table."
           (line-re org-table-dataline-regexp)
           (thisline (org-current-line))
           (thiscol (org-table-current-column))
-          beg end entry eqlnum eqlname eql (cnt 0) eq a name)
+          beg end entry eqlnum eqlname eqlname1 eql (cnt 0) eq a name)
       ;; Insert constants in all formulas
       (setq eqlist
            (mapcar (lambda (x)
@@ -7836,8 +8892,32 @@ With prefix arg ALL, do this for all lines in the table."
              end (move-marker (make-marker) (1+ (point-at-eol)))))
       (goto-char beg)
       (and all (message "Re-applying formulas to full table..."))
+
+      ;; First find the named fields, and mark them untouchanble
+      (remove-text-properties beg end '(org-untouchable t))
+      (while (setq eq (pop eqlname))
+       (setq name (car eq)
+             a (assoc name org-table-named-field-locations))
+       (and (not a)
+            (string-match "@\\([0-9]+\\)\\$\\([0-9]+\\)" name)
+            (setq a (list name
+                          (aref org-table-dlines
+                                (string-to-number (match-string 1 name)))
+                          (string-to-number (match-string 2 name)))))
+       (when (and a (or all (equal (nth 1 a) thisline)))
+         (message "Re-applying formula to field: %s" name)
+         (goto-line (nth 1 a))
+         (org-table-goto-column (nth 2 a))
+         (push (append a (list (cdr eq))) eqlname1)
+;; FIXME         (org-table-eval-formula nil (cdr eq) 'noalign 'nocst
+;; FIXME                                 'nostore 'noanalysis)
+         (org-table-put-field-property :org-untouchable t)))
+
+      ;; Now evauluate the column formulas, but skip fields covered by
+      ;; field formulas
+      (goto-char beg)
       (while (re-search-forward line-re end t)
-       (unless (string-match "^ *[_^!$] *$" (org-table-get-field 1))
+       (unless (string-match "^ *[_^!$/] *$" (org-table-get-field 1))
          ;; Unprotected line, recalculate
          (and all (message "Re-applying formulas to full table...(line %d)"
                            (setq cnt (1+ cnt))))
@@ -7846,30 +8926,24 @@ With prefix arg ALL, do this for all lines in the table."
          (while (setq entry (pop eql))
            (goto-line org-last-recalc-line)
            (org-table-goto-column (string-to-number (car entry)) nil 'force)
-           (org-table-eval-formula nil (cdr entry)
-                                   'noalign 'nocst 'nostore 'noanalysis))))
+           (unless (get-text-property (point) :org-untouchable)
+             (org-table-eval-formula nil (cdr entry)
+                                     'noalign 'nocst 'nostore 'noanalysis)))))
+
+      ;; Now evaluate the field formulas
+      (while (setq eq (pop eqlname1))
+       (message "Re-applying formula to field: %s" (car eq))
+       (goto-line (nth 1 eq))
+       (org-table-goto-column (nth 2 eq))
+       (org-table-eval-formula nil (nth 3 eq) 'noalign 'nocst
+                               'nostore 'noanalysis))
+
       (goto-line thisline)
       (org-table-goto-column thiscol)
+      (remove-text-properties (point-min) (point-max) '(org-untouchable t))
       (or noalign (and org-table-may-need-update (org-table-align))
          (and all (message "Re-applying formulas to %d lines...done" cnt)))
-      ;; Now do the named fields
-      (while (setq eq (pop eqlname))
-       (setq name (car eq)
-             a (assoc name org-table-named-field-locations))
-       (and (not a)
-            (string-match "@\\([0-9]+\\)\\$\\([0-9]+\\)" name)
-            (setq a
-                  (list
-                   name
-                   (aref org-table-dlines
-                         (string-to-number (match-string 1 name)))
-                   (string-to-number (match-string 2 name)))))
-       (when (and a (or all (equal (nth 1 a) thisline)))
-         (message "Re-applying formula to field: %s" name)
-         (goto-line (nth 1 a))
-         (org-table-goto-column (nth 2 a))
-         (org-table-eval-formula nil (cdr eq) 'noalign 'nocst
-                                 'nostore 'noanalysis)))
+
       ;; back to initial position
       (message "Re-applying formulas...done")
       (goto-line thisline)
@@ -7907,7 +8981,7 @@ With prefix arg ALL, do this for all lines in the table."
       (setq f (replace-match (concat "$" (cdr a)) t t f)))
     ;; Parameters and constants
     (setq start 0)
-    (while (setq start (string-match "\\$\\([a-zA-Z][a-zA-Z0-9]*\\)" f start))
+    (while (setq start (string-match "\\$\\([a-zA-Z][_a-zA-Z0-9]*\\)" f start))
       (setq start (1+ start))
       (if (setq a (save-match-data
                    (org-table-get-constant (match-string 1 f))))
@@ -7920,36 +8994,81 @@ With prefix arg ALL, do this for all lines in the table."
   "Find the value for a parameter or constant in a formula.
 Parameters get priority."
   (or (cdr (assoc const org-table-local-parameters))
+      (cdr (assoc const org-table-formula-constants-local))
       (cdr (assoc const org-table-formula-constants))
       (and (fboundp 'constants-get) (constants-get const))
+      (and (string= (substring const 0 (min 5 (length const))) "PROP_")
+          (org-entry-get nil (substring const 5) 'inherit))
       "#UNDEFINED_NAME"))
 
-(defvar org-edit-formulas-map (make-sparse-keymap))
-(define-key org-edit-formulas-map "\C-c\C-c"      'org-finish-edit-formulas)
-(define-key org-edit-formulas-map "\C-c\C-q"      'org-abort-edit-formulas)
-(define-key org-edit-formulas-map "\C-c?"         'org-show-reference)
-(define-key org-edit-formulas-map [(shift up)]    'org-table-edit-line-up)
-(define-key org-edit-formulas-map [(shift down)]  'org-table-edit-line-down)
-(define-key org-edit-formulas-map [(shift left)] 'org-table-edit-backward-field)
-(define-key org-edit-formulas-map [(shift right)] 'org-table-edit-next-field)
-(define-key org-edit-formulas-map [(meta up)]     'org-table-edit-scroll-down)
-(define-key org-edit-formulas-map [(meta down)]   'org-table-edit-scroll)
-(define-key org-edit-formulas-map [(meta tab)]    'lisp-complete-symbol)
-(define-key org-edit-formulas-map "\M-\C-i"       'lisp-complete-symbol)
-(define-key org-edit-formulas-map [(tab)]         'org-edit-formula-lisp-indent)
-(define-key org-edit-formulas-map "\C-i"          'org-edit-formula-lisp-indent)
+(defvar org-table-fedit-map (make-sparse-keymap))
+(org-defkey org-table-fedit-map "\C-x\C-s"      'org-table-fedit-finish)
+(org-defkey org-table-fedit-map "\C-c\C-s"      'org-table-fedit-finish)
+(org-defkey org-table-fedit-map "\C-c\C-c"      'org-table-fedit-finish)
+(org-defkey org-table-fedit-map "\C-c\C-q"      'org-table-fedit-abort)
+(org-defkey org-table-fedit-map "\C-c?"         'org-table-show-reference)
+(org-defkey org-table-fedit-map [(meta shift up)]    'org-table-fedit-line-up)
+(org-defkey org-table-fedit-map [(meta shift down)]  'org-table-fedit-line-down)
+(org-defkey org-table-fedit-map [(shift up)]    'org-table-fedit-ref-up)
+(org-defkey org-table-fedit-map [(shift down)]  'org-table-fedit-ref-down)
+(org-defkey org-table-fedit-map [(shift left)]  'org-table-fedit-ref-left)
+(org-defkey org-table-fedit-map [(shift right)] 'org-table-fedit-ref-right)
+(org-defkey org-table-fedit-map [(meta up)]     'org-table-fedit-scroll-down)
+(org-defkey org-table-fedit-map [(meta down)]   'org-table-fedit-scroll)
+(org-defkey org-table-fedit-map [(meta tab)]    'lisp-complete-symbol)
+(org-defkey org-table-fedit-map "\M-\C-i"       'lisp-complete-symbol)
+(org-defkey org-table-fedit-map [(tab)]         'org-table-fedit-lisp-indent)
+(org-defkey org-table-fedit-map "\C-i"          'org-table-fedit-lisp-indent)
+(org-defkey org-table-fedit-map "\C-c\C-r" 'org-table-fedit-toggle-ref-type)
+(org-defkey org-table-fedit-map "\C-c}"    'org-table-fedit-toggle-coordinates)
+
+(easy-menu-define org-table-fedit-menu org-table-fedit-map "Org Edit Formulas Menu"
+  '("Edit-Formulas"
+    ["Finish and Install" org-table-fedit-finish t]
+    ["Finish, Install, and Apply" (org-table-fedit-finish t) :keys "C-u C-c C-c"]
+    ["Abort" org-table-fedit-abort t]
+    "--"
+    ["Pretty-Print Lisp Formula" org-table-fedit-lisp-indent t]
+    ["Complete Lisp Symbol" lisp-complete-symbol t]
+    "--"
+    "Shift Reference at Point"
+    ["Up" org-table-fedit-ref-up t]
+    ["Down" org-table-fedit-ref-down t]
+    ["Left" org-table-fedit-ref-left t]
+    ["Right" org-table-fedit-ref-right t]
+    "-"
+    "Change Test Row for Column Formulas"
+    ["Up" org-table-fedit-line-up t]
+    ["Down" org-table-fedit-line-down t]
+    "--"
+    ["Scroll Table Window" org-table-fedit-scroll t]
+    ["Scroll Table Window down" org-table-fedit-scroll-down t]
+    ["Show Table Grid" org-table-fedit-toggle-coordinates
+     :style toggle :selected (with-current-buffer (marker-buffer org-pos)
+                              org-table-overlay-coordinates)]
+    "--"
+    ["Standard Refs (B3 instead of @3$2)" org-table-fedit-toggle-ref-type
+     :style toggle :selected org-table-buffer-is-an]))
 
 (defvar org-pos)
 
 (defun org-table-edit-formulas ()
   "Edit the formulas of the current table in a separate buffer."
   (interactive)
+  (when (save-excursion (beginning-of-line 1) (looking-at "#\\+TBLFM"))
+    (beginning-of-line 0))
   (unless (org-at-table-p) (error "Not at a table"))
   (org-table-get-specials)
-  (let ((eql (org-table-get-stored-formulas))
+  (let ((key (org-table-current-field-formula 'key 'noerror))
+       (eql (sort (org-table-get-stored-formulas 'noerror)
+                   'org-table-formula-less-p))
        (pos (move-marker (make-marker) (point)))
+       (startline 1)
        (wc (current-window-configuration))
-       entry s)
+       (titles '((column . "# Column Formulas\n")
+                 (field . "# Field Formulas\n")
+                 (named . "# Named Field Formulas\n")))
+       entry s type title)
     (switch-to-buffer-other-window "*Edit Formulas*")
     (erase-buffer)
     ;; Keep global-font-lock-mode from turning on font-lock-mode
@@ -7958,38 +9077,226 @@ Parameters get priority."
     (org-set-local 'font-lock-global-modes (list 'not major-mode))
     (org-set-local 'org-pos pos)
     (org-set-local 'org-window-configuration wc)
-    (use-local-map org-edit-formulas-map)
-    (org-add-hook 'post-command-hook 'org-table-edit-formulas-post-command t t)
-    (setq s "# `C-c C-c' to finish, `C-u C-c C-c' to also apply, `C-c C-q' to abort.
-# `TAB' to pretty-print Lisp expressions, `M-TAB' to complete List symbols
-# `M-up/down' to scroll table, `S-up/down' to change line for column formulas\n\n")
-
-    (put-text-property 0 (length s) 'face 'font-lock-comment-face s)
-    (insert s)
+    (use-local-map org-table-fedit-map)
+    (org-add-hook 'post-command-hook 'org-table-fedit-post-command t t)
+    (easy-menu-add org-table-fedit-menu)
+    (setq startline (org-current-line))
     (while (setq entry (pop eql))
+      (setq type (cond
+                 ((equal (string-to-char (car entry)) ?@) 'field)
+                 ((string-match "^[0-9]" (car entry)) 'column)
+                 (t 'named)))
+      (when (setq title (assq type titles))
+       (or (bobp) (insert "\n"))
+       (insert (org-add-props (cdr title) nil 'face font-lock-comment-face))
+       (setq titles (delq title titles)))
+      (if (equal key (car entry)) (setq startline (org-current-line)))
       (setq s (concat (if (equal (string-to-char (car entry)) ?@) "" "$")
                      (car entry) " = " (cdr entry) "\n"))
       (remove-text-properties 0 (length s) '(face nil) s)
       (insert s))
-    (goto-char (point-min))
-    (message "Edit formulas and finish with `C-c C-c'.")))
+    (if (eq org-table-use-standard-references t)
+       (org-table-fedit-toggle-ref-type))
+    (goto-line startline)
+    (message "Edit formulas and finish with `C-c C-c'.  See menu for more commands.")))
 
-(defun org-table-edit-formulas-post-command ()
+(defun org-table-fedit-post-command ()
   (when (not (memq this-command '(lisp-complete-symbol)))
     (let ((win (selected-window)))
       (save-excursion
        (condition-case nil
-           (org-show-reference)
+           (org-table-show-reference)
          (error nil))
        (select-window win)))))
 
-(defun org-finish-edit-formulas (&optional arg)
+(defun org-table-formula-to-user (s)
+  "Convert a formula from internal to user representation."
+  (if (eq org-table-use-standard-references t)
+      (org-table-convert-refs-to-an s)
+    s))
+
+(defun org-table-formula-from-user (s)
+  "Convert a formula from user to internal representation."
+  (if org-table-use-standard-references
+      (org-table-convert-refs-to-rc s)
+    s))
+
+(defun org-table-convert-refs-to-rc (s)
+  "Convert spreadsheet references from AB7 to @7$28.
+Works for single references, but also for entire formulas and even the
+full TBLFM line."
+  (let ((start 0))
+    (while (string-match "\\<\\([a-zA-Z]+\\)\\([0-9]+\\>\\|&\\)\\|\\(;[^\r\n:]+\\)" s start)
+      (cond
+       ((match-end 3)
+       ;; format match, just advance
+       (setq start (match-end 0)))
+       ((and (> (match-beginning 0) 0)
+            (equal ?. (aref s (max (1- (match-beginning 0)) 0))))
+       ;; 3.e5 or something like this.  FIXME: is this ok????
+       (setq start (match-end 0)))
+       (t
+       (setq start (match-beginning 0)
+             s (replace-match
+                (if (equal (match-string 2 s) "&")
+                    (format "$%d" (org-letters-to-number (match-string 1 s)))
+                  (format "@%d$%d"
+                          (string-to-number (match-string 2 s))
+                          (org-letters-to-number (match-string 1 s))))
+                t t s)))))
+    s))
+
+(defun org-table-convert-refs-to-an (s)
+  "Convert spreadsheet references from to @7$28 to AB7.
+Works for single references, but also for entire formulas and even the
+full TBLFM line."
+  (while (string-match "@\\([0-9]+\\)$\\([0-9]+\\)" s)
+    (setq s (replace-match
+            (format "%s%d"
+                    (org-number-to-letters
+                     (string-to-number (match-string 2 s)))
+                    (string-to-number (match-string 1 s)))
+            t t s)))
+  (while (string-match "\\(^\\|[^0-9a-zA-Z]\\)\\$\\([0-9]+\\)" s)
+    (setq s (replace-match (concat "\\1"
+                                  (org-number-to-letters
+                                   (string-to-number (match-string 2 s))) "&")
+                          t nil s)))
+  s)
+
+(defun org-letters-to-number (s)
+  "Convert a base 26 number represented by letters into an integer.
+For example:  AB -> 28."
+  (let ((n 0))
+    (setq s (upcase s))
+    (while (> (length s) 0)
+         (setq n (+ (* n 26) (string-to-char s) (- ?A) 1)
+               s (substring s 1)))
+    n))
+
+(defun org-number-to-letters (n)
+  "Convert an integer into a base 26 number represented by letters.
+For example:  28 -> AB."
+  (let ((s ""))
+    (while (> n 0)
+      (setq s (concat (char-to-string (+ (mod (1- n) 26) ?A)) s)
+           n (/ (1- n) 26)))
+    s))
+
+(defun org-table-fedit-convert-buffer (function)
+  "Convert all references in this buffer, using FUNTION."
+  (let ((line (org-current-line)))
+    (goto-char (point-min))
+    (while (not (eobp))
+      (insert (funcall function (buffer-substring (point) (point-at-eol))))
+      (delete-region (point) (point-at-eol))
+      (or (eobp) (forward-char 1)))
+    (goto-line line)))
+
+(defun org-table-fedit-toggle-ref-type ()
+  "Convert all references in the buffer from B3 to @3$2 and back."
+  (interactive)
+  (org-set-local 'org-table-buffer-is-an (not org-table-buffer-is-an))
+  (org-table-fedit-convert-buffer
+   (if org-table-buffer-is-an
+       'org-table-convert-refs-to-an 'org-table-convert-refs-to-rc))
+  (message "Reference type switched to %s"
+          (if org-table-buffer-is-an "A1 etc" "@row$column")))
+
+(defun org-table-fedit-ref-up ()
+  "Shift the reference at point one row/hline up."
+  (interactive)
+  (org-table-fedit-shift-reference 'up))
+(defun org-table-fedit-ref-down ()
+  "Shift the reference at point one row/hline down."
+  (interactive)
+  (org-table-fedit-shift-reference 'down))
+(defun org-table-fedit-ref-left ()
+  "Shift the reference at point one field to the left."
+  (interactive)
+  (org-table-fedit-shift-reference 'left))
+(defun org-table-fedit-ref-right ()
+  "Shift the reference at point one field to the right."
+  (interactive)
+  (org-table-fedit-shift-reference 'right))
+
+(defun org-table-fedit-shift-reference (dir)
+  (cond
+   ((org-at-regexp-p "\\(\\<[a-zA-Z]\\)&")
+    (if (memq dir '(left right))
+       (org-rematch-and-replace 1 (eq dir 'left))
+      (error "Cannot shift reference in this direction")))
+   ((org-at-regexp-p "\\(\\<[a-zA-Z]\\{1,2\\}\\)\\([0-9]+\\)")
+    ;; A B3-like reference
+    (if (memq dir '(up down))
+       (org-rematch-and-replace 2 (eq dir 'up))
+      (org-rematch-and-replace 1 (eq dir 'left))))
+   ((org-at-regexp-p
+     "\\(@\\|\\.\\.\\)\\([-+]?\\(I+\\>\\|[0-9]+\\)\\)\\(\\$\\([-+]?[0-9]+\\)\\)?")
+    ;; An internal reference
+    (if (memq dir '(up down))
+       (org-rematch-and-replace 2 (eq dir 'up) (match-end 3))
+      (org-rematch-and-replace 5 (eq dir 'left))))))
+
+(defun org-rematch-and-replace (n &optional decr hline)
+  "Re-match the group N, and replace it with the shifted refrence."
+  (or (match-end n) (error "Cannot shift reference in this direction"))
+  (goto-char (match-beginning n))
+  (and (looking-at (regexp-quote (match-string n)))
+       (replace-match (org-shift-refpart (match-string 0) decr hline)
+                     t t)))
+
+(defun org-shift-refpart (ref &optional decr hline)
+  "Shift a refrence part REF.
+If DECR is set, decrease the references row/column, else increase.
+If HLINE is set, this may be a hline reference, it certainly is not
+a translation reference."
+  (save-match-data
+    (let* ((sign (string-match "^[-+]" ref)) n)
+
+      (if sign (setq sign (substring ref 0 1) ref (substring ref 1)))
+      (cond
+       ((and hline (string-match "^I+" ref))
+       (setq n (string-to-number (concat sign (number-to-string (length ref)))))
+       (setq n (+ n (if decr -1 1)))
+       (if (= n 0) (setq n (+ n (if decr -1 1))))
+       (if sign
+           (setq sign (if (< n 0) "-" "+") n (abs n))
+         (setq n (max 1 n)))
+       (concat sign (make-string n ?I)))
+
+       ((string-match "^[0-9]+" ref)
+       (setq n (string-to-number (concat sign ref)))
+       (setq n (+ n (if decr -1 1)))
+       (if sign
+           (concat (if (< n 0) "-" "+") (number-to-string (abs n)))
+         (number-to-string (max 1 n))))
+
+       ((string-match "^[a-zA-Z]+" ref)
+       (org-number-to-letters
+        (max 1 (+ (org-letters-to-number ref) (if decr -1 1)))))
+
+       (t (error "Cannot shift reference"))))))
+
+(defun org-table-fedit-toggle-coordinates ()
+  "Toggle the display of coordinates in the refrenced table."
+  (interactive)
+  (let ((pos (marker-position org-pos)))
+    (with-current-buffer (marker-buffer org-pos)
+      (save-excursion
+       (goto-char pos)
+       (org-table-toggle-coordinate-overlays)))))
+
+(defun org-table-fedit-finish (&optional arg)
   "Parse the buffer for formula definitions and install them.
 With prefix ARG, apply the new formulas to the table."
   (interactive "P")
   (org-table-remove-rectangle-highlight)
+  (if org-table-use-standard-references
+      (progn
+       (org-table-fedit-convert-buffer 'org-table-convert-refs-to-rc)
+       (setq org-table-buffer-is-an nil)))
   (let ((pos org-pos) eql var form)
-    (setq org-pos nil)
     (goto-char (point-min))
     (while (re-search-forward
            "^\\(@[0-9]+\\$[0-9]+\\|\\$\\([a-zA-Z0-9]+\\)\\) *= *\\(.*\\(\n[ \t]+.*$\\)*\\)"
@@ -7997,9 +9304,13 @@ With prefix ARG, apply the new formulas to the table."
       (setq var (if (match-end 2) (match-string 2) (match-string 1))
            form (match-string 3))
       (setq form (org-trim form))
-      (while (string-match "[ \t]*\n[ \t]*" form)
-       (setq form (replace-match " " t t form)))
-      (push (cons var form) eql))
+      (when (not (equal form ""))
+       (while (string-match "[ \t]*\n[ \t]*" form)
+         (setq form (replace-match " " t t form)))
+       (when (assoc var eql)
+         (error "Double formulas for %s" var))
+       (push (cons var form) eql)))
+    (setq org-pos nil)
     (set-window-configuration org-window-configuration)
     (select-window (get-buffer-window (marker-buffer pos)))
     (goto-char pos)
@@ -8012,7 +9323,7 @@ With prefix ARG, apply the new formulas to the table."
        (org-table-recalculate 'all)
       (message "New formulas installed - press C-u C-c C-c to apply."))))
 
-(defun org-abort-edit-formulas ()
+(defun org-table-fedit-abort ()
   "Abort editing formulas, without installing the changes."
   (interactive)
   (org-table-remove-rectangle-highlight)
@@ -8023,7 +9334,7 @@ With prefix ARG, apply the new formulas to the table."
     (move-marker pos nil)
     (message "Formula editing aborted without installing changes")))
 
-(defun org-edit-formula-lisp-indent ()
+(defun org-table-fedit-lisp-indent ()
   "Pretty-print and re-indent Lisp expressions in the Formula Editor."
   (interactive)
   (let ((pos (point)) beg end ind)
@@ -8032,10 +9343,10 @@ With prefix ARG, apply the new formulas to the table."
      ((looking-at "[ \t]")
       (goto-char pos)
       (call-interactively 'lisp-indent-line))
-     ((looking-at "[$@0-9a-zA-Z]+ *= *[^ \t\n']") (goto-char pos))
+     ((looking-at "[$&@0-9a-zA-Z]+ *= *[^ \t\n']") (goto-char pos))
      ((not (fboundp 'pp-buffer))
       (error "Cannot pretty-print.  Command `pp-buffer' is not available."))
-     ((looking-at "[$@0-9a-zA-Z]+ *= *'(")
+     ((looking-at "[$&@0-9a-zA-Z]+ *= *'(")
       (goto-char (- (match-end 0) 2))
       (setq beg (point))
       (setq ind (make-string (current-column) ?\ ))
@@ -8064,7 +9375,7 @@ With prefix ARG, apply the new formulas to the table."
 
 (defvar org-show-positions nil)
 
-(defun org-show-reference (&optional local)
+(defun org-table-show-reference (&optional local)
   "Show the location/value of the $ expression at point."
   (interactive)
   (org-table-remove-rectangle-highlight)
@@ -8077,12 +9388,18 @@ With prefix ARG, apply the new formulas to the table."
          var name e what match dest)
       (if local (org-table-get-specials))
       (setq what (cond
-                 ((org-at-regexp-p org-table-range-regexp2) 'range)
+                 ((or (org-at-regexp-p org-table-range-regexp2)
+                      (org-at-regexp-p org-table-translate-regexp)
+                      (org-at-regexp-p org-table-range-regexp))
+                  (setq match
+                        (save-match-data
+                          (org-table-convert-refs-to-rc (match-string 0))))
+                  'range)
                  ((org-at-regexp-p "\\$[a-zA-Z][a-zA-Z0-9]*") 'name)
                  ((org-at-regexp-p "\\$[0-9]+") 'column)
                  ((not local) nil)
                  (t (error "No reference at point")))
-           match (and what (match-string 0)))
+           match (and what (or match (match-string 0))))
       (when (and  match (not (equal (match-beginning 0) (point-at-bol))))
        (org-table-add-rectangle-overlay (match-beginning 0) (match-end 0)
                                         'secondary-selection))
@@ -8094,9 +9411,13 @@ With prefix ARG, apply the new formulas to the table."
        (setq match (org-table-formula-substitute-names match)))
       (unless local
        (save-excursion
+         (end-of-line 1)
+         (re-search-backward "^\\S-" nil t)
          (beginning-of-line 1)
-         (when (looking-at "\\(\\$[0-9a-zA-Z]+\\|@[0-9]+\\$[0-9]+\\)=")
-           (setq dest (match-string 1))
+         (when (looking-at "\\(\\$[0-9a-zA-Z]+\\|@[0-9]+\\$[0-9]+\\|[a-zA-Z]+\\([0-9]+\\|&\\)\\) *=")
+           (setq dest
+                 (save-match-data
+                   (org-table-convert-refs-to-rc (match-string 1))))
            (org-table-add-rectangle-overlay
             (match-beginning 1) (match-end 1) face2))))
       (if (and (markerp pos) (marker-buffer pos))
@@ -8161,22 +9482,27 @@ With prefix ARG, apply the new formulas to the table."
        (t
        (cond
         ((not var) (error "No reference at point"))
+        ((setq e (assoc var org-table-formula-constants-local))
+         (message "Local Constant: $%s=%s in #+CONSTANTS line."
+                  var (cdr e)))
         ((setq e (assoc var org-table-formula-constants))
          (message "Constant: $%s=%s in `org-table-formula-constants'."
                   var (cdr e)))
         ((setq e (and (fboundp 'constants-get) (constants-get var)))
-         (message "Constant: $%s=%s, retrieved from `constants.el'." var e))
+         (message "Constant: $%s=%s, from `constants.el'%s."
+                  var e (format " (%s units)" constants-unit-system)))
         (t (error "Undefined name $%s" var)))))
       (goto-char pos)
-      (when org-show-positions
+      (when (and org-show-positions
+                 (not (memq this-command '(org-table-fedit-scroll
+                                           org-table-fedit-scroll-down))))
        (push pos org-show-positions)
+       (push org-table-current-begin-pos org-show-positions)
        (let ((min (apply 'min org-show-positions))
              (max (apply 'max org-show-positions)))
-         (when (or (not (pos-visible-in-window-p min))
-                   (not (pos-visible-in-window-p max)))
-           (goto-char min)
-           (set-window-start (selected-window) (point-at-bol))
-           (goto-char pos))))
+          (goto-char min) (recenter 0)
+          (goto-char max)
+          (or (pos-visible-in-window-p max) (recenter -1))))
       (select-window win))))
 
 (defun org-table-force-dataline ()
@@ -8193,27 +9519,17 @@ With prefix ARG, apply the new formulas to the table."
            ((or p1 p2) (goto-char (or p1 p2)))
            (t (error "No table dataline around here"))))))
 
-(defun org-table-edit-line-up ()
+(defun org-table-fedit-line-up ()
   "Move cursor one line up in the window showing the table."
   (interactive)
-  (org-table-edit-move 'previous-line))
+  (org-table-fedit-move 'previous-line))
 
-(defun org-table-edit-line-down ()
+(defun org-table-fedit-line-down ()
   "Move cursor one line down in the window showing the table."
   (interactive)
- (org-table-edit-move 'next-line))
-
-(defun org-table-edit-backward-field ()
-  "Move cursor one field backward in the window showing the table."
-  (interactive)
-  (org-table-edit-move 'org-table-previous-field))
+ (org-table-fedit-move 'next-line))
 
-(defun org-table-edit-next-field ()
-  "Move cursor one field forward in the window showing the table."
-  (interactive)
-  (org-table-edit-move 'org-table-next-field))
-
-(defun org-table-edit-move (command)
+(defun org-table-fedit-move (command)
   "Move the cursor in the window shoinw the table.
 Use COMMAND to do the motion, repeat if necessary to end up in a data line."
   (let ((org-table-allow-automatic-line-recalculation nil)
@@ -8228,14 +9544,14 @@ Use COMMAND to do the motion, repeat if necessary to end up in a data line."
     (move-marker pos (point))
     (select-window win)))
 
-(defun org-table-edit-scroll (N)
+(defun org-table-fedit-scroll (N)
   (interactive "p")
   (let ((other-window-scroll-buffer (marker-buffer org-pos)))
     (scroll-other-window N)))
 
-(defun org-table-edit-scroll-down (N)
+(defun org-table-fedit-scroll-down (N)
   (interactive "p")
-  (org-table-edit-scroll (- N)))
+  (org-table-fedit-scroll (- N)))
 
 (defvar org-table-rectangle-overlays nil)
 
@@ -8290,7 +9606,7 @@ Use COMMAND to do the motion, repeat if necessary to end up in a data line."
   (mapc 'org-delete-overlay org-table-coordinate-overlays)
   (setq org-table-coordinate-overlays nil)
   (save-excursion
-    (let ((id 0) (ih 0) hline eol str ic ov beg)
+    (let ((id 0) (ih 0) hline eol s1 s2 str ic ov beg)
       (goto-char (org-table-begin))
       (while (org-at-table-p)
        (setq eol (point-at-eol))
@@ -8299,15 +9615,18 @@ Use COMMAND to do the motion, repeat if necessary to end up in a data line."
        (setq hline (looking-at org-table-hline-regexp))
        (setq str (if hline (format "I*%-2d" (setq ih (1+ ih)))
                    (format "%4d" (setq id (1+ id)))))
-       (org-overlay-before-string ov str 'org-formula 'evaporate)
+       (org-overlay-before-string ov str 'org-special-keyword 'evaporate)
        (when hline
          (setq ic 0)
-         (while (re-search-forward "[+|]-+" eol t)
+         (while (re-search-forward "[+|]\\(-+\\)" eol t)
            (setq beg (1+ (match-beginning 0))
-                 str (concat "$" (int-to-string (setq ic (1+ ic)))))
+                 ic (1+ ic)
+                 s1 (concat "$" (int-to-string ic))
+                 s2 (org-number-to-letters ic)
+                 str (if (eq org-table-use-standard-references t) s2 s1))
            (setq ov (org-make-overlay beg (+ beg (length str))))
            (push ov org-table-coordinate-overlays)
-           (org-overlay-display ov str 'org-formula 'evaporate)))
+           (org-overlay-display ov str 'org-special-keyword 'evaporate)))
        (beginning-of-line 2)))))
 
 (defun org-table-toggle-coordinate-overlays ()
@@ -8492,7 +9811,7 @@ to execute outside of tables."
          '("\C-c}"              org-table-toggle-coordinate-overlays)
          '("\C-c{"              org-table-toggle-formula-debugger)
          '("\C-m"               org-table-next-row)
-         (list (org-key 'S-return) 'org-table-copy-down)
+         '([(shift return)]     org-table-copy-down)
          '("\C-c\C-q"           org-table-wrap-region)
          '("\C-c?"              org-table-field-info)
          '("\C-c "              org-table-blank-field)
@@ -8507,34 +9826,34 @@ to execute outside of tables."
        elt key fun cmd)
     (while (setq elt (pop bindings))
       (setq nfunc (1+ nfunc))
-      (setq key (car elt)
+      (setq key (org-key (car elt))
            fun (nth 1 elt)
            cmd (orgtbl-make-binding fun nfunc key))
-      (define-key orgtbl-mode-map key cmd))
+      (org-defkey orgtbl-mode-map key cmd))
 
     ;; Special treatment needed for TAB and RET
-    (define-key orgtbl-mode-map [(return)]
+    (org-defkey orgtbl-mode-map [(return)]
       (orgtbl-make-binding 'orgtbl-ret 100 [(return)] "\C-m"))
-    (define-key orgtbl-mode-map "\C-m"
+    (org-defkey orgtbl-mode-map "\C-m"
       (orgtbl-make-binding 'orgtbl-ret 101 "\C-m" [(return)]))
 
-    (define-key orgtbl-mode-map [(tab)]
+    (org-defkey orgtbl-mode-map [(tab)]
       (orgtbl-make-binding 'orgtbl-tab 102 [(tab)] "\C-i"))
-    (define-key orgtbl-mode-map "\C-i"
+    (org-defkey orgtbl-mode-map "\C-i"
       (orgtbl-make-binding 'orgtbl-tab 103 "\C-i" [(tab)]))
 
-    (define-key orgtbl-mode-map [(shift tab)]
+    (org-defkey orgtbl-mode-map [(shift tab)]
       (orgtbl-make-binding 'org-table-previous-field 104
                           [(shift tab)] [(tab)] "\C-i"))
 
-    (define-key orgtbl-mode-map "\M-\C-m"
+    (org-defkey orgtbl-mode-map "\M-\C-m"
       (orgtbl-make-binding 'org-table-wrap-region 105
                           "\M-\C-m" [(meta return)]))
-    (define-key orgtbl-mode-map [(meta return)]
+    (org-defkey orgtbl-mode-map [(meta return)]
       (orgtbl-make-binding 'org-table-wrap-region 106
                           [(meta return)] "\M-\C-m"))
 
-    (define-key orgtbl-mode-map "\C-c\C-c" 'orgtbl-ctrl-c-ctrl-c)
+    (org-defkey orgtbl-mode-map "\C-c\C-c" 'orgtbl-ctrl-c-ctrl-c)
     (when orgtbl-optimized
       ;; If the user wants maximum table support, we need to hijack
       ;; some standard editing functions
@@ -8542,7 +9861,7 @@ to execute outside of tables."
                 'self-insert-command 'orgtbl-self-insert-command
                 'delete-char 'org-delete-char
                 'delete-backward-char 'org-delete-backward-char)
-      (define-key orgtbl-mode-map "|" 'org-force-self-insert))
+      (org-defkey orgtbl-mode-map "|" 'org-force-self-insert))
     (easy-menu-define orgtbl-mode-menu orgtbl-mode-map "OrgTbl menu"
       '("OrgTbl"
        ["Align" org-ctrl-c-ctrl-c :active (org-at-table-p) :keys "C-c C-c"]
@@ -8678,7 +9997,31 @@ overwritten, and the table is not marked as requiring realignment."
 (defvar orgtbl-exp-regexp "^\\([-+]?[0-9][0-9.]*\\)[eE]\\([-+]?[0-9]+\\)$"
   "Regula expression matching exponentials as produced by calc.")
 
-(defvar org-table-clean-did-remove-column-1 nil)
+(defvar org-table-clean-did-remove-column nil)
+
+(defun orgtbl-export (table target)
+  (let ((func (intern (concat "orgtbl-to-" (symbol-name target))))
+       (lines (org-split-string table "[ \t]*\n[ \t]*"))
+       org-table-last-alignment org-table-last-column-widths
+       maxcol column)
+    (if (not (fboundp func))
+       (error "Cannot export orgtbl table to %s" target))
+    (setq lines (org-table-clean-before-export lines))
+    (setq table
+         (mapcar
+          (lambda (x)
+            (if (string-match org-table-hline-regexp x)
+                'hline
+              (org-split-string (org-trim x) "\\s-*|\\s-*")))
+          lines))
+    (setq maxcol (apply 'max (mapcar (lambda (x) (if (listp x) (length x) 0))
+                                    table)))
+    (loop for i from (1- maxcol) downto 0 do
+         (setq column (mapcar (lambda (x) (if (listp x) (nth i x) nil)) table))
+         (setq column (delq nil column))
+         (push (apply 'max (mapcar 'string-width column)) org-table-last-column-widths)
+         (push (> (/ (apply '+ (mapcar (lambda (x) (if (string-match org-table-number-regexp x) 1 0)) column)) maxcol) org-table-number-fraction) org-table-last-alignment))
+    (funcall func table nil)))
 
 (defun orgtbl-send-table (&optional maybe)
   "Send a tranformed version of this table to the receiver position.
@@ -8706,7 +10049,7 @@ this table."
                 (org-table-begin) (org-table-end)))
           (lines (nthcdr (or skip 0) (org-split-string txt "[ \t]*\n[ \t]*")))
           (lines (org-table-clean-before-export lines))
-          (i0 (if org-table-clean-did-remove-column-1 2 1))
+          (i0 (if org-table-clean-did-remove-column 2 1))
           (table (mapcar
                   (lambda (x)
                     (if (string-match org-table-hline-regexp x)
@@ -9037,7 +10380,7 @@ For file links, arg negates `org-context-in-file-links'."
 
      ((eq major-mode 'bbdb-mode)
       (let ((name (bbdb-record-name (bbdb-current-record)))
-           (company (bbdb-record-company (bbdb-current-record))))
+           (company (bbdb-record-getprop (bbdb-current-record) 'company)))
        (setq cpltxt (concat "bbdb:" (or name company))
              link (org-make-link cpltxt))
        (org-store-link-props :type "bbdb" :name name :company company)))
@@ -9306,7 +10649,7 @@ according to FMT (default from `org-email-link-description-format')."
       ;; We are using a headline, clean up garbage in there.
       (if (string-match org-todo-regexp s)
          (setq s (replace-match "" t t s)))
-      (if (string-match ":[a-zA-Z_@0-9:]+:[ \t]*$" s)
+      (if (string-match (org-re ":[[:alnum:]_@:]+:[ \t]*$") s)
          (setq s (replace-match "" t t s)))
       (setq s (org-trim s))
       (if (string-match (concat "^\\(" org-quote-string "\\|"
@@ -9430,7 +10773,8 @@ is in the current directory or below.
 With three \\[universal-argument] prefixes, negate the meaning of
 `org-keep-stored-link-after-insertion'."
   (interactive "P")
-  (let ((region (if (org-region-active-p)
+  (let ((wcf (current-window-configuration))
+       (region (if (org-region-active-p)
                    (prog1 (buffer-substring (region-beginning) (region-end))
                      (delete-region (region-beginning) (region-end)))))
         tmphist ; byte-compile incorrectly complains about this
@@ -9469,13 +10813,32 @@ With three \\[universal-argument] prefixes, negate the meaning of
         (t (setq link (org-make-link "file:" file))))))
      (t
       ;; Read link, with completion for stored links.
-      ;; Fake a link history
+      (with-output-to-temp-buffer "*Org Links*"
+       (princ "Insert a link.  Use TAB to complete valid link prefixes.\n")
+       (when org-stored-links
+         (princ "\nStored links are available with <up>/<down> (most recent with RET):\n\n")
+         (princ (mapconcat 'car (reverse org-stored-links) "\n"))))
+      (let ((cw (selected-window)))
+       (select-window (get-buffer-window "*Org Links*"))
+       (shrink-window-if-larger-than-buffer)
+       (setq truncate-lines t)
+       (select-window cw))
+      ;; Fake a link history, containing the stored links.
       (setq tmphist (append (mapcar 'car org-stored-links)
                            org-insert-link-history))
-      (setq link (org-completing-read
-                 "Link: " org-stored-links nil nil nil
-                 'tmphist
-                 (or (car (car org-stored-links)))))
+      (unwind-protect
+         (setq link (org-completing-read
+                     "Link: "
+                     (append
+                      (mapcar (lambda (x) (list (concat (car x) ":")))
+                              (append org-link-abbrev-alist-local org-link-abbrev-alist))
+                      (mapcar (lambda (x) (list (concat x ":")))
+                              org-link-types))
+                     nil nil nil
+                     'tmphist
+                     (or (car (car org-stored-links)))))
+       (set-window-configuration wcf)
+       (kill-buffer "*Org Links*"))
       (setq entry (assoc link org-stored-links))
       (or entry (push link org-insert-link-history))
       (if (funcall (if (equal complete-file '(64)) 'not 'identity)
@@ -9531,7 +10894,7 @@ With three \\[universal-argument] prefixes, negate the meaning of
 (defun org-completing-read (&rest args)
   (let ((minibuffer-local-completion-map
         (copy-keymap minibuffer-local-completion-map)))
-    (define-key minibuffer-local-completion-map " " 'self-insert-command)
+    (org-defkey minibuffer-local-completion-map " " 'self-insert-command)
     (apply 'completing-read args)))
 
 ;;; Opening/following a link
@@ -9636,8 +10999,12 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file."
                    (org-in-regexp org-plain-link-re))
            (setq type (match-string 1) path (match-string 2))
            (throw 'match t)))
+       (when (org-in-regexp "\\<\\([^><\n]+\\)\\>")
+         (setq type "tree-match"
+               path (match-string 1))
+         (throw 'match t))
        (save-excursion
-         (when (org-in-regexp "\\(:[A-Za-z_@0-9:]+\\):[ \t\r\n]")
+         (when (org-in-regexp (org-re "\\(:[[:alnum:]_@:]+\\):[ \t]*$"))
            (setq type "tags"
                  path (match-string 1))
            (while (string-match ":" path)
@@ -9679,12 +11046,17 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file."
            (switch-to-buffer-other-window
             (org-get-buffer-for-internal-link (current-buffer)))
          (org-mark-ring-push))
-       (org-link-search
-        path
-        (cond ((equal in-emacs '(4)) 'occur)
-              ((equal in-emacs '(16)) 'org-occur)
-              (t nil))
-        pos))
+       (let ((cmd `(org-link-search
+                    ,path
+                    ,(cond ((equal in-emacs '(4)) 'occur)
+                           ((equal in-emacs '(16)) 'org-occur)
+                           (t nil))
+                    ,pos)))
+         (condition-case nil (eval cmd)
+           (error (progn (widen) (eval cmd))))))
+
+       ((string= type "tree-match")
+       (org-occur (concat "\\[" (regexp-quote path) "\\]")))
 
        ((string= type "file")
        (if (string-match "::\\([0-9]+\\)\\'" path)
@@ -9830,6 +11202,10 @@ If the current buffer is in `dired-mode', grep will be used to search
 in all files.  If AVOID-POS is given, ignore matches near that position."
   (let ((case-fold-search t)
        (s0 (mapconcat 'identity (org-split-string s "[ \t\r\n]+") " "))
+       (markers (concat "\\(?:" (mapconcat (lambda (x) (regexp-quote (car x)))
+                                           (append '(("") (" ") ("\t") ("\n"))
+                                                   org-emphasis-alist)
+                                           "\\|") "\\)"))
        (pos (point))
        (pre "") (post "")
        words re0 re1 re2 re3 re4 re5 re2a reall)
@@ -9854,11 +11230,11 @@ in all files.  If AVOID-POS is given, ignore matches near that position."
        ;; (grep (concat "grep -n -e '" (match-string 1 s) "' *")))
        (t (org-do-occur (match-string 1 s)))))
      (t
-      ;; A normal search string
+      ;; A normal search strings
       (when (equal (string-to-char s) ?*)
        ;; Anchor on headlines, post may include tags.
-       (setq pre "^\\*+[ \t]*\\(?:\\sw+\\)?[ \t]*"
-             post "[ \t]*\\(?:[ \t]+:[a-zA-Z_@0-9:+]:[ \t]*\\)?$"
+       (setq pre "^\\*+[ \t]+\\(?:\\sw+\\)?[ \t]*"
+             post (org-re "[ \t]*\\(?:[ \t]+:[[:alnum:]_@:+]:[ \t]*\\)?$")
              s (substring s 1)))
       (remove-text-properties
        0 (length s)
@@ -9866,7 +11242,8 @@ in all files.  If AVOID-POS is given, ignore matches near that position."
       ;; Make a series of regular expressions to find a match
       (setq words (org-split-string s "[ \n\r\t]+")
            re0 (concat "\\(<<" (regexp-quote s0) ">>\\)")
-           re2 (concat "[ \t\r\n]\\(" (mapconcat 'downcase words "[ \t]+") "\\)[ \t\r\n]")
+           re2 (concat markers "\\(" (mapconcat 'downcase words "[ \t]+")
+                       "\\)" markers)
            re2a (concat "[ \t\r\n]\\(" (mapconcat 'downcase words "[ \t\r\n]+") "\\)[ \t\r\n]")
            re4 (concat "[^a-zA-Z_]\\(" (mapconcat 'downcase words "[^a-zA-Z_\r\n]+") "\\)[^a-zA-Z_]")
            re1 (concat pre re2 post)
@@ -9908,16 +11285,18 @@ enclose the position of `org-open-link-marker'."
   (let ((m org-open-link-marker))
     (catch 'exit
       (while (apply 're-search-forward args)
-       (goto-char (match-end group))
-       (if (and (or (not (eq (marker-buffer m) (current-buffer)))
-                    (> (match-beginning 0) (marker-position m))
-                    (< (match-end 0) (marker-position m)))
-                (save-match-data
-                  (or (not (org-in-regexp org-bracket-link-analytic-regexp 1))
-                      (not (match-end 4))  ; no description
-                      (and (<= (match-beginning 4) (point))
-                           (>= (match-end 4) (point))))))
-                (throw 'exit (point)))))))
+       (unless (get-text-property (match-end group) 'intangible) ; Emacs 21
+         (goto-char (match-end group))
+         (if (and (or (not (eq (marker-buffer m) (current-buffer)))
+                      (> (match-beginning 0) (marker-position m))
+                      (< (match-end 0) (marker-position m)))
+                  (save-match-data
+                    (or (not (org-in-regexp
+                              org-bracket-link-analytic-regexp 1))
+                        (not (match-end 4))  ; no description
+                        (and (<= (match-beginning 4) (point))
+                             (>= (match-end 4) (point))))))
+             (throw 'exit (point))))))))
 
 (defun org-get-buffer-for-internal-link (buffer)
   "Return a buffer to be used for displaying the link target of internal links."
@@ -10065,7 +11444,7 @@ onto the ring."
   (funcall (cdr (assq 'gnus org-link-frame-setup)))
   (if gnus-other-frame-object (select-frame gnus-other-frame-object))
   (cond ((and group article)
-        (gnus-group-read-group 0 nil group)
+        (gnus-group-read-group 1 nil group)
         (gnus-summary-goto-article (string-to-number article) nil t))
        (group (gnus-group-jump-to-group group))))
 
@@ -10346,7 +11725,7 @@ If the file does not exist, an error is thrown."
        (if (stringp command)
            (setq cmd command)
          (setq cmd 'emacs))))
-    (if (and (not (eq cmd 'emacs)) ; Emacs has not problems with non-ex files
+    (if (and (not (eq cmd 'emacs)) ; Emacs has no problems with non-ex files
             (not (file-exists-p file))
             (not org-open-non-existing-files))
        (error "No such file: %s" file))
@@ -10361,6 +11740,7 @@ If the file does not exist, an error is thrown."
      ((or (stringp cmd)
          (eq cmd 'emacs))
       (funcall (cdr (assq 'file org-link-frame-setup)) file)
+      (widen)
       (if line (goto-line line)
        (if search (org-link-search search))))
      ((consp cmd)
@@ -10380,10 +11760,6 @@ If the file does not exist, an error is thrown."
     org-file-apps-defaults-windowsnt)
    (t org-file-apps-defaults-gnu)))
 
-(defun org-expand-file-name (path)
-  "Replace special path abbreviations and expand the file name."
-  (expand-file-name path))
-
 (defvar ange-ftp-name-format) ; to silence the XEmacs compiler.
 (defun org-file-remote-p (file)
   "Test whether FILE specifies a location on a remote system.
@@ -10449,9 +11825,10 @@ to be run from that hook to fucntion properly."
             (v-a (if (equal annotation "[[]]") "" annotation)) ; likewise
             (v-n user-full-name)
             (org-startup-folded nil)
-            org-time-was-given x prompt char time)
+            org-time-was-given org-end-time-was-given x prompt char time)
        (setq org-store-link-plist
-             (append (list :annotation v-a :initial v-i)))
+             (append (list :annotation v-a :initial v-i)
+                     org-store-link-plist))
        (unless tpl (setq tpl "")       (message "No template") (ding))
        (erase-buffer)
        (insert (substitute-command-keys
@@ -10490,20 +11867,38 @@ to be run from that hook to fucntion properly."
            (org-set-local 'org-remember-default-headline headline))
        ;; Interactive template entries
        (goto-char (point-min))
-       (while (re-search-forward "%^\\({\\([^}]*\\)}\\)?\\([uUtT]\\)?" nil t)
+       (while (re-search-forward "%^\\({\\([^}]*\\)}\\)?\\([guUtT]\\)?" nil t)
          (setq char (if (match-end 3) (match-string 3))
                prompt (if (match-end 2) (match-string 2)))
          (goto-char (match-beginning 0))
          (replace-match "")
-         (if char
-             (progn
-               (setq org-time-was-given (equal (upcase char) char))
-               (setq time (org-read-date (equal (upcase char) "U") t nil
-                                         prompt))
-               (org-insert-time-stamp time org-time-was-given
-                                      (member char '("u" "U"))))
+         (cond
+          ((member char '("G" "g"))
+           (let* ((org-last-tags-completion-table
+                   (org-global-tags-completion-table
+                    (if (equal char "G") (org-agenda-files) (and file (list file)))))
+                  (org-add-colon-after-tag-completion t)
+                  (ins (completing-read
+                        (if prompt (concat prompt ": ") "Tags: ")
+                        'org-tags-completion-function nil nil nil
+                        'org-tags-history)))
+             (setq ins (mapconcat 'identity
+                                 (org-split-string ins (org-re "[^[:alnum:]]+"))
+                                 ":"))
+             (when (string-match "\\S-" ins)
+               (or (equal (char-before) ?:) (insert ":"))
+               (insert ins)
+               (or (equal (char-after) ?:) (insert ":")))))            
+          (char
+           (setq org-time-was-given (equal (upcase char) char))
+           (setq time (org-read-date (equal (upcase char) "U") t nil
+                                     prompt))
+           (org-insert-time-stamp time org-time-was-given
+                                  (member char '("u" "U"))
+                                  nil nil (list org-end-time-was-given)))
+          (t
            (insert (read-string
-                    (if prompt (concat prompt ": ") "Enter string")))))
+                    (if prompt (concat prompt ": ") "Enter string"))))))
        (goto-char (point-min))
        (if (re-search-forward "%\\?" nil t)
            (replace-match "")
@@ -10569,7 +11964,7 @@ See also the variable `org-reverse-note-order'."
     (replace-match ""))
   (catch 'quit
     (let* ((txt (buffer-substring (point-min) (point-max)))
-          (fastp current-prefix-arg)
+          (fastp (equal current-prefix-arg '(4)))
           (file (if fastp org-default-notes-file (org-get-org-file)))
           (heading org-remember-default-headline)
           (visiting (org-find-base-buffer-visiting file))
@@ -10577,12 +11972,13 @@ See also the variable `org-reverse-note-order'."
           (org-startup-align-all-tables nil)
           (org-goto-start-pos 1)
           spos level indent reversed)
+      (setq current-prefix-arg nil)
       ;; Modify text so that it becomes a nice subtree which can be inserted
       ;; into an org tree.
       (let* ((lines (split-string txt "\n"))
             first)
        (setq first (car lines) lines (cdr lines))
-       (if (string-match "^\\*+" first)
+       (if (string-match "^\\*+ " first)
            ;; Is already a headline
            (setq indent nil)
          ;; We need to add a headline:  Use time and first buffer line
@@ -10597,20 +11993,20 @@ See also the variable `org-reverse-note-order'."
       ;; Find the file
       (if (not visiting) (find-file-noselect file))
       (with-current-buffer (or visiting (get-file-buffer file))
-       (save-excursion (and (goto-char (point-min))
-                            (not (re-search-forward "^\\* " nil t))
-                            (insert "\n* Notes\n")))
-       (setq reversed (org-notes-order-reversed-p))
        (save-excursion
          (save-restriction
            (widen)
+           (and (goto-char (point-min))
+                (not (re-search-forward "^\\* " nil t))
+                (insert "\n* Notes\n"))
+           (setq reversed (org-notes-order-reversed-p))
 
            ;; Find the default location
            (when (and heading (stringp heading) (string-match "\\S-" heading))
              (goto-char (point-min))
              (if (re-search-forward
                   (concat "^\\*+[ \t]+" (regexp-quote heading)
-                          "\\([ \t]+:[@a-zA-Z0-9_:]*\\)?[ \t]*$")
+                          (org-re "\\([ \t]+:[[:alnum:]@_:]*\\)?[ \t]*$"))
                   nil t)
                  (setq org-goto-start-pos (match-beginning 0))))
 
@@ -10619,7 +12015,7 @@ See also the variable `org-reverse-note-order'."
                           org-goto-start-pos
                         (org-get-location (current-buffer) org-remember-help)))
            (if (not spos) (throw 'quit nil)) ; return nil to show we did
-                                             ; not handle this note
+                                       ; not handle this note
            (goto-char spos)
            (cond ((and (bobp) (not reversed))
                   ;; Put it at the end, one level below level 1
@@ -10633,15 +12029,15 @@ See also the variable `org-reverse-note-order'."
                   (save-restriction
                     (widen)
                     (goto-char (point-min))
-                    (re-search-forward "^\\*" nil t)
+                    (re-search-forward "^\\*" nil t)
                     (beginning-of-line 1)
                     (org-paste-subtree 1 txt)))
-                 ((and (org-on-heading-p nil) (not current-prefix-arg))
+                 ((and (org-on-heading-p t) (not current-prefix-arg))
                   ;; Put it below this entry, at the beg/end of the subtree
                   (org-back-to-heading t)
                   (setq level (funcall outline-level))
                   (if reversed
-                      (outline-end-of-heading)
+                      (outline-next-heading)
                     (org-end-of-subtree t))
                   (if (not (bolp)) (newline))
                   (beginning-of-line 1)
@@ -10649,7 +12045,9 @@ See also the variable `org-reverse-note-order'."
                  (t
                   ;; Put it right there, with automatic level determined by
                   ;; org-paste-subtree or from prefix arg
-                  (org-paste-subtree current-prefix-arg txt)))
+                  (org-paste-subtree
+                   (if (numberp current-prefix-arg) current-prefix-arg)
+                   txt)))
            (when remember-save-after-remembering
              (save-buffer)
              (if (not visiting) (kill-buffer (current-buffer)))))))))
@@ -10802,14 +12200,17 @@ At all other locations, this simply calls `ispell-complete-word'."
   (catch 'exit
     (let* ((end (point))
           (beg1 (save-excursion
-                  (skip-chars-backward "a-zA-Z_@0-9")
+                  (skip-chars-backward (org-re "[:alnum:]_@"))
                   (point)))
           (beg (save-excursion
                  (skip-chars-backward "a-zA-Z0-9_:$")
                  (point)))
           (confirm (lambda (x) (stringp (car x))))
           (searchhead (equal (char-before beg) ?*))
-          (tag (equal (char-before beg1) ?:))
+          (tag (and (equal (char-before beg1) ?:)
+                    (equal (char-after (point-at-bol)) ?*)))
+          (prop (and (equal (char-before beg1) ?:)
+                     (not (equal (char-after (point-at-bol)) ?*))))
           (texp (equal (char-before beg) ?\\))
           (link (equal (char-before beg) ?\[))
           (opt (equal (buffer-substring (max (point-at-bol) (- beg 2))
@@ -10835,10 +12236,10 @@ At all other locations, this simply calls `ispell-complete-word'."
                   (texp
                    (setq type :tex)
                    org-html-entities)
-                  ((string-match "\\`\\*+[ \t]*\\'"
+                  ((string-match "\\`\\*+[ \t]+\\'"
                                  (buffer-substring (point-at-bol) beg))
                    (setq type :todo)
-                   (mapcar 'list org-todo-keywords))
+                   (mapcar 'list org-todo-keywords-1))
                   (searchhead
                    (setq type :searchhead)
                    (save-excursion
@@ -10851,6 +12252,8 @@ At all other locations, this simply calls `ispell-complete-word'."
                    tbl)
                   (tag (setq type :tag beg beg1)
                        (or org-tag-alist (org-get-buffer-tags)))
+                  (prop (setq type :prop beg beg1)
+                        (mapcar 'list (org-buffer-property-keys)))
                   (t (progn (ispell-complete-word arg) (throw 'exit nil)))))
           (pattern (buffer-substring-no-properties beg end))
           (completion (try-completion pattern table confirm)))
@@ -10858,7 +12261,7 @@ At all other locations, this simply calls `ispell-complete-word'."
             (if (equal type :opt)
                 (insert (substring (cdr (assoc (upcase pattern) table))
                                    (length pattern)))
-              (if (equal type :tag) (insert ":"))))
+              (if (memq type '(:tag :prop)) (insert ":"))))
            ((null completion)
             (message "Can't find completion for \"%s\"" pattern)
             (ding))
@@ -10871,7 +12274,7 @@ At all other locations, this simply calls `ispell-complete-word'."
                 (delete-window (get-buffer-window "*Completions*")))
             (if (assoc completion table)
                 (if (eq type :todo) (insert " ")
-                  (if (eq type :tag) (insert ":"))))
+                  (if (memq type '(:tag :prop)) (insert ":"))))
             (if (and (equal type :opt) (assoc completion table))
                 (message "%s" (substitute-command-keys
                                "Press \\[org-complete] again to insert example settings"))))
@@ -10894,12 +12297,12 @@ At all other locations, this simply calls `ispell-complete-word'."
   (save-excursion
     (org-back-to-heading)
     (if (looking-at (concat outline-regexp
-                           "\\( +\\<" org-comment-string "\\>\\)"))
+                           "\\( *\\<" org-comment-string "\\>\\)"))
        (replace-match "" t t nil 1)
       (if (looking-at outline-regexp)
          (progn
            (goto-char (match-end 0))
-           (insert " " org-comment-string))))))
+           (insert org-comment-string " "))))))
 
 (defvar org-last-todo-state-is-todo nil
   "This is non-nil when the last TODO state change led to a TODO state.
@@ -10926,61 +12329,87 @@ For calling through lisp, arg is also interpreted in the following way:
 'none             -> empty state
 \"\"(empty string)  -> switch to empty state
 'done             -> switch to DONE
+'nextset          -> switch to the next set of keywords
+'previousset      -> switch to the previous set of keywords
 \"WAITING\"         -> switch to the specified keyword, but only if it
                      really is a member of `org-todo-keywords'."
   (interactive "P")
   (save-excursion
     (org-back-to-heading)
-    (if (looking-at outline-regexp) (goto-char (match-end 0)))
+    (if (looking-at outline-regexp) (goto-char (1- (match-end 0))))
     (or (looking-at (concat " +" org-todo-regexp " *"))
        (looking-at " *"))
     (let* ((this (match-string 1))
+          (head (org-get-todo-sequence-head this))
+          (ass (assoc head org-todo-kwd-alist))
+          (interpret (nth 1 ass))
+          (done-word (nth 3 ass))
+          (final-done-word (nth 4 ass))
           (last-state (or this ""))
           (completion-ignore-case t)
-          (member (member this org-todo-keywords))
+          (member (member this org-todo-keywords-1))
           (tail (cdr member))
           (state (cond
                   ((equal arg '(4))
                    ;; Read a state with completion
                    (completing-read "State: " (mapcar (lambda(x) (list x))
-                                                      org-todo-keywords)
+                                                      org-todo-keywords-1)
                                     nil t))
                   ((eq arg 'right)
                    (if this
                        (if tail (car tail) nil)
-                     (car org-todo-keywords)))
+                     (car org-todo-keywords-1)))
                   ((eq arg 'left)
-                   (if (equal member org-todo-keywords)
+                   (if (equal member org-todo-keywords-1)
                        nil
                      (if this
-                         (nth (- (length org-todo-keywords) (length tail) 2)
-                              org-todo-keywords)
-                       org-done-string)))
+                         (nth (- (length org-todo-keywords-1) (length tail) 2)
+                              org-todo-keywords-1)
+                       (org-last org-todo-keywords-1))))
                   (arg
-                   ;; user requests a specific state
+                   ;; user or caller requests a specific state
                    (cond
                     ((equal arg "") nil)
                     ((eq arg 'none) nil)
-                    ((eq arg 'done) (org-last org-todo-keywords))
-                    ((car (member arg org-todo-keywords)))
+                    ((eq arg 'done) (or done-word (car org-done-keywords)))
+                    ((eq arg 'nextset)
+                     (or (car (cdr (member head org-todo-heads)))
+                         (car org-todo-heads)))
+                    ((eq arg 'previousset)
+                     (let ((org-todo-heads (reverse org-todo-heads)))
+                       (or (car (cdr (member head org-todo-heads)))
+                           (car org-todo-heads))))
+                    ((car (member arg org-todo-keywords-1)))
                     ((nth (1- (prefix-numeric-value arg))
-                            org-todo-keywords))))
-                  ((null member) (car org-todo-keywords))
+                            org-todo-keywords-1))))
+                  ((null member) (or head (car org-todo-keywords-1)))
+                  ((equal this final-done-word) nil) ;; -> make empty
                   ((null tail) nil) ;; -> first entry
-                  ((eq org-todo-interpretation 'sequence)
+                  ((eq interpret 'sequence)
                    (car tail))
-                  ((memq org-todo-interpretation '(type priority))
+                  ((memq interpret '(type priority))
                    (if (eq this-command last-command)
                        (car tail)
-                     (if (> (length tail) 0) org-done-string nil)))
+                     (if (> (length tail) 0)
+                         (or done-word (car org-done-keywords))
+                       nil)))
                   (t nil)))
           (next (if state (concat " " state " ") " "))
           dostates)
       (replace-match next t t)
+      (unless head
+       (setq head (org-get-todo-sequence-head state)
+             ass (assoc head org-todo-kwd-alist)
+             interpret (nth 1 ass)
+             done-word (nth 3 ass)
+             final-done-word (nth 4 ass)))
+      (when (memq arg '(nextset previousset))
+       (message "Keyword set: %s"
+                (mapconcat 'identity (assoc state org-todo-sets) " ")))
       (setq org-last-todo-state-is-todo
-           (not (equal state org-done-string)))
-      (when org-log-done
-       (setq dostates (and (eq org-todo-interpretation 'sequence)
+           (not (member state org-done-keywords)))
+      (when (and org-log-done (not (memq arg '(nextset previousset))))
+       (setq dostates (and (eq interpret 'sequence)
                            (listp org-log-done) (memq 'state org-log-done)))
        (cond
         ((and state (not this))
@@ -10988,7 +12417,7 @@ For calling through lisp, arg is also interpreted in the following way:
          (and dostates (org-add-log-maybe 'state state 'findpos)))
         ((and state dostates)
          (org-add-log-maybe 'state state 'findpos))
-        ((equal state org-done-string)
+        ((member state org-done-keywords)
          ;; Planning info calls the note-setting command.
          (org-add-planning-info 'closed (org-current-time)
                                 (if (org-get-repeat) nil 'scheduled))
@@ -10996,8 +12425,10 @@ For calling through lisp, arg is also interpreted in the following way:
       ;; Fixup tag positioning
       (and org-auto-align-tags (org-set-tags nil t))
       (run-hooks 'org-after-todo-state-change-hook)
-      (and (equal state org-done-string) (org-auto-repeat-maybe))
-      ))
+      (and (member state org-done-keywords) (org-auto-repeat-maybe))
+      (if (and arg (not (member state org-done-keywords)))
+         (setq head (org-get-todo-sequence-head state)))
+      (put-text-property (point-at-bol) (point-at-eol) 'org-todo-head head)))
   ;; Fixup cursor location if close to the keyword
   (if (and (outline-on-heading-p)
           (not (bolp))
@@ -11008,8 +12439,24 @@ For calling through lisp, arg is also interpreted in the following way:
        (goto-char (or (match-end 2) (match-end 1)))
        (just-one-space))))
 
+(defun org-get-todo-sequence-head (kwd)
+  "Return the head of the TODO sequence to which KWD belongs.
+If KWD is not set, check if there is a text property remembering the
+right sequence."
+  (let (p)
+    (cond
+     ((not kwd)
+      (or (get-text-property (point-at-bol) 'org-todo-head)
+         (progn
+           (setq p (next-single-property-change (point-at-bol) 'org-todo-head
+                                                nil (point-at-eol)))
+           (get-text-property p 'org-todo-head))))
+     ((not (member kwd org-todo-keywords-1))
+      (car org-todo-keywords-1))
+     (t (nth 2 (assoc kwd org-todo-kwd-alist))))))
+
 (defun org-get-repeat ()
-  "Return the REPEAT statement of this entry."
+  "Check if tere is a deadline/schedule with repeater in this entry."
   (save-match-data
     (save-excursion
       (org-back-to-heading t)
@@ -11020,24 +12467,29 @@ For calling through lisp, arg is also interpreted in the following way:
 (defvar org-last-changed-timestamp)
 (defvar org-log-post-message)
 (defun org-auto-repeat-maybe ()
-  "Check if the current headline contains a REPEAT key.
-If yes, set TODO state back to what it was and change any SCHEDULED
-or DEADLINE times the new date.
+  "Check if the current headline contains a repeated deadline/schedule.
+If yes, set TODO state back to what it was and change the base date
+of repeating deadline/scheduled time stamps to new date.
 This function should be run in the `org-after-todo-state-change-hook'."
   ;; last-state is dynamically scoped into this function
-  (let ((repeat (org-get-repeat))
-       (whata '(("d" . day) ("m" . month) ("y" . year)))
-       (msg "Entry repeats: ")
-       (org-log-done)
-       re type n what start)
+  (let* ((repeat (org-get-repeat))
+        (aa (assoc last-state org-todo-kwd-alist))
+        (interpret (nth 1 aa))
+        (head (nth 2 aa))
+        (done-word (nth 3 aa))
+        (whata '(("d" . day) ("m" . month) ("y" . year)))
+        (msg "Entry repeats: ")
+        (org-log-done)
+        re type n what ts)
     (when repeat
-      (org-todo (if (eq 'org-todo-interpretation 'type)
-                   last-state
-                 (car org-todo-keywords)))
-      (unless (memq 'org-add-log-note (default-value 'post-command-hook))
+      (org-todo (if (eq interpret 'type) last-state head))
+      (when (and org-log-repeat
+                (not (memq 'org-add-log-note
+                           (default-value 'post-command-hook))))
        ;; Make sure a note is taken
        (let ((org-log-done '(done)))
-         (org-add-log-maybe 'done org-done-string 'findpos)))
+         (org-add-log-maybe 'done (or done-word (car org-done-keywords))
+                            'findpos)))
       (org-back-to-heading t)
       (org-add-planning-info nil nil 'closed)
       (setq re (concat "\\(" org-scheduled-time-regexp "\\)\\|\\("
@@ -11045,11 +12497,10 @@ This function should be run in the `org-after-todo-state-change-hook'."
       (while (re-search-forward
              re (save-excursion (outline-next-heading) (point)) t)
        (setq type (if (match-end 1) org-scheduled-string org-deadline-string)
-             start 0)
-       (while (string-match "\\([-+]?[0-9]+\\)\\([dwmy]\\)" repeat start)
-         (setq start (match-end 0)
-               n (string-to-number (match-string 1 repeat))
-               what (match-string 2 repeat))
+             ts (match-string (if (match-end 2) 2 4)))
+       (when (string-match "\\([-+]?[0-9]+\\)\\([dwmy]\\)" ts)
+         (setq n (string-to-number (match-string 1 ts))
+               what (match-string 2 ts))
          (if (equal what "w") (setq n (* n 7) what "d"))
          (org-timestamp-change n (cdr (assoc what whata))))
        (setq msg (concat msg type org-last-changed-timestamp " ")))
@@ -11062,18 +12513,23 @@ The tree will show the lines where the regexp matches, and all higher
 headlines above the match.
 With \\[universal-argument] prefix, also show the DONE entries.
 With a numeric prefix N, construct a sparse tree for the Nth element
-of `org-todo-keywords'."
+of `org-todo-keywords-1'."
   (interactive "P")
   (let ((case-fold-search nil)
        (kwd-re
         (cond ((null arg) org-not-done-regexp)
-              ((equal arg '(4)) org-todo-regexp)
-              ((<= (prefix-numeric-value arg) (length org-todo-keywords))
+              ((equal arg '(4))
+               (let ((kwd (completing-read "Keyword (or KWD1|KWD2|...): "
+                                           (mapcar 'list org-todo-keywords-1))))
+                 (concat "\\("
+                         (mapconcat 'identity (org-split-string kwd "|") "\\|")
+                         "\\)\\>")))
+              ((<= (prefix-numeric-value arg) (length org-todo-keywords-1))
                (regexp-quote (nth (1- (prefix-numeric-value arg))
-                                  org-todo-keywords)))
+                                  org-todo-keywords-1)))
               (t (error "Invalid prefix argument: %s" arg)))))
     (message "%d TODO entries found"
-            (org-occur (concat "^" outline-regexp " +" kwd-re )))))
+            (org-occur (concat "^" outline-regexp " *" kwd-re )))))
 
 (defun org-deadline ()
   "Insert the DEADLINE: string to make a deadline.
@@ -11096,13 +12552,14 @@ If non is given, the user is prompted for a date.
 REMOVE indicates what kind of entries to remove.  An old WHAT entry will also
 be removed."
   (interactive)
-  (let (org-time-was-given)
+  (let (org-time-was-given org-end-time-was-given)
     (when what (setq time (or time (org-read-date nil 'to-time))))
     (when (and org-insert-labeled-timestamps-at-point
               (member what '(scheduled deadline)))
       (insert
        (if (eq what 'scheduled) org-scheduled-string org-deadline-string) " ")
-      (org-insert-time-stamp time org-time-was-given)
+      (org-insert-time-stamp time org-time-was-given
+                            nil nil nil (list org-end-time-was-given))
       (setq what nil))
     (save-excursion
       (save-restriction
@@ -11111,7 +12568,13 @@ be removed."
          (looking-at (concat outline-regexp "\\( *\\)[^\r\n]*"))
          (goto-char (match-end 1))
          (setq col (current-column))
-         (goto-char (1+ (match-end 0)))
+         (goto-char (match-end 0))
+         (if (eobp) (insert "\n"))
+         (forward-char 1)
+         (when (looking-at "[ \t]*:PROPERTIES:[ \t]*$")
+           (goto-char (match-end 0))
+           (if (eobp) (insert "\n"))
+           (forward-char 1))
          (if (and (not (looking-at outline-regexp))
                   (looking-at (concat "[^\r\n]*?" org-keyword-time-regexp
                                       "[^\r\n]*"))
@@ -11141,11 +12604,15 @@ be removed."
             (if (not (equal (char-before) ?\ )) " " "")
             (cond ((eq what 'scheduled) org-scheduled-string)
                   ((eq what 'deadline) org-deadline-string)
-                  ((eq what 'closed) org-closed-string))
+                  ((eq what 'closed) org-closed-string)
+                  ((eq what 'archived) org-archived-string))
             " ")
-           (org-insert-time-stamp time
-                                  (or org-time-was-given (eq what 'closed))
-                                  (eq what 'closed))
+           (org-insert-time-stamp
+            time
+            (or org-time-was-given
+                (and (eq what 'closed) org-log-done-with-time))
+            (eq what 'closed)
+            nil nil (list org-end-time-was-given))
            (end-of-line 1))
          (goto-char (point-min))
          (widen)
@@ -11163,6 +12630,7 @@ be removed."
 The auto-repeater uses this.")
 
 (defun org-add-log-maybe (&optional purpose state findpos)
+  "Set up the post command hook to take a note."
   (save-excursion
     (when (and (listp org-log-done)
               (memq purpose org-log-done))
@@ -11221,17 +12689,18 @@ The auto-repeater uses this.")
                                "")))))
       (if lines (setq note (concat note " \\\\")))
       (push note lines))
-    (save-excursion
-      (set-buffer (marker-buffer org-log-note-marker))
+    (when lines
       (save-excursion
-       (goto-char org-log-note-marker)
-       (move-marker org-log-note-marker nil)
-       (end-of-line 1)
-       (if (not (bolp)) (insert "\n")) (indent-relative nil)
-       (setq ind (concat (buffer-substring (point-at-bol) (point)) "    "))
-       (insert "  - " (pop lines))
-       (while lines
-         (insert "\n" ind (pop lines))))))
+       (set-buffer (marker-buffer org-log-note-marker))
+       (save-excursion
+         (goto-char org-log-note-marker)
+         (move-marker org-log-note-marker nil)
+         (end-of-line 1)
+         (if (not (bolp)) (insert "\n")) (indent-relative nil)
+         (setq ind (concat (buffer-substring (point-at-bol) (point)) "    "))
+         (insert "  - " (pop lines))
+         (while lines
+           (insert "\n" ind (pop lines)))))))
   (set-window-configuration org-log-note-window-configuration)
   (with-current-buffer (marker-buffer org-log-note-return-to)
     (goto-char org-log-note-return-to))
@@ -11264,7 +12733,8 @@ that the match should indeed be shown."
        (when (or (not callback)
                  (save-match-data (funcall callback)))
          (setq cnt (1+ cnt))
-         (org-highlight-new-match (match-beginning 0) (match-end 0))
+         (when org-highlight-sparse-tree-matches
+           (org-highlight-new-match (match-beginning 0) (match-end 0)))
          (org-show-context 'occur-tree))))
     (when org-remove-highlights-with-change
       (org-add-hook 'before-change-functions 'org-remove-occur-highlights
@@ -11342,7 +12812,7 @@ from the `before-change-functions' in the current buffer."
 
 ;;;; Priorities
 
-(defvar org-priority-regexp ".*?\\(\\[#\\([A-Z]\\)\\] ?\\)"
+(defvar org-priority-regexp ".*?\\(\\[#\\([A-Z0-9]\\)\\] ?\\)"
   "Regular expression matching the priority indicator.")
 
 (defvar org-remove-priority-next-time nil)
@@ -11359,7 +12829,7 @@ from the `before-change-functions' in the current buffer."
 
 (defun org-priority (&optional action)
   "Change the priority of an item by ARG.
-ACTION can be set, up, or down."
+ACTION can be `set', `up', `down', or a character."
   (interactive)
   (setq action (or action 'set))
   (let (current new news have remove)
@@ -11370,19 +12840,21 @@ ACTION can be set, up, or down."
                have t)
        (setq current org-default-priority))
       (cond
-       ((eq action 'set)
-       (message "Priority A-%c, SPC to remove: " org-lowest-priority)
-       (setq new (read-char-exclusive))
+       ((or (eq action 'set) (integerp action))
+       (if (integerp action)
+           (setq new action)
+         (message "Priority %c-%c, SPC to remove: " org-highest-priority org-lowest-priority)
+         (setq new (read-char-exclusive)))
        (cond ((equal new ?\ ) (setq remove t))
-             ((or (< (upcase new) ?A) (> (upcase new) org-lowest-priority))
+             ((or (< (upcase new) org-highest-priority) (> (upcase new) org-lowest-priority))
               (error "Priority must be between `%c' and `%c'"
-                     ?A org-lowest-priority))))
+                     org-highest-priority org-lowest-priority))))
        ((eq action 'up)
        (setq new (1- current)))
        ((eq action 'down)
        (setq new (1+ current)))
        (t (error "Invalid action")))
-      (setq new (min (max ?A (upcase new)) org-lowest-priority))
+      (setq new (min (max org-highest-priority (upcase new)) org-lowest-priority))
       (setq news (format "%c" new))
       (if have
          (if remove
@@ -11397,6 +12869,7 @@ ACTION can be set, up, or down."
                (insert " [#" news "]"))
            (goto-char (match-beginning 3))
            (insert "[#" news "] ")))))
+    (org-preserve-lc (org-set-tags nil 'align))
     (if remove
        (message "Priority removed")
       (message "Priority of current item set to %s" news))))
@@ -11419,15 +12892,15 @@ evaluated, testing if a given set of tags qualifies a headline for
 inclusion.  When TODO-ONLY is non-nil, only lines with a TODO keyword
 are included in the output."
   (let* ((re (concat "[\n\r]" outline-regexp " *\\(\\<\\("
-                    (mapconcat 'regexp-quote
-                               (nreverse (cdr (reverse org-todo-keywords)))
-                               "\\|")
-                    "\\>\\)\\)? *\\(.*?\\)\\(:[A-Za-z_@0-9:]+:\\)?[ \t]*$"))
+                    (mapconcat 'regexp-quote org-todo-keywords-1 "\\|")
+                    (org-re
+                     "\\>\\)\\)? *\\(.*?\\)\\(:[[:alnum:]_@:]+:\\)?[ \t]*$")))
         (props (list 'face nil
                      'done-face 'org-done
                      'undone-face nil
                      'mouse-face 'highlight
                      'org-not-done-regexp org-not-done-regexp
+                     'org-todo-regexp org-todo-regexp
                      'keymap org-agenda-keymap
                      'help-echo
                      (format "mouse-2 or RET jump to org file %s"
@@ -11435,7 +12908,7 @@ are included in the output."
         (case-fold-search nil)
          lspos
         tags tags-list tags-alist (llast 0) rtn level category i txt
-        todo marker entry)
+        todo marker entry priority)
     (save-excursion
       (goto-char (point-min))
       (when (eq action 'sparse-tree) (org-overview))
@@ -11444,7 +12917,7 @@ are included in the output."
          (setq todo (if (match-end 1) (match-string 2))
                tags (if (match-end 4) (match-string 4)))
          (goto-char (setq lspos (1+ (match-beginning 0))))
-         (setq level (funcall outline-level)
+         (setq level (org-reduced-level (funcall outline-level))
                category (org-get-category))
          (setq i llast llast level)
          ;; remove tag lists from same and sublevels
@@ -11462,7 +12935,7 @@ are included in the output."
                (if org-use-tag-inheritance
                    (apply 'append (mapcar 'cdr tags-alist))
                  tags))
-         (when (and (or (not todo-only) todo)
+         (when (and (or (not todo-only) (member todo org-not-done-keywords))
                     (eval matcher)
                     (or (not org-agenda-skip-archived-trees)
                         (not (member org-archive-tag tags-list))))
@@ -11477,11 +12950,13 @@ are included in the output."
                          (if org-tags-match-list-sublevels
                              (make-string (1- level) ?.) "")
                          (org-get-heading))
-                        category tags-list))
+                        category tags-list)
+                   priority (org-get-priority txt))
              (goto-char lspos)
              (setq marker (org-agenda-new-marker))
              (org-add-props txt props
-               'org-marker marker 'org-hd-marker marker 'org-category category)
+               'org-marker marker 'org-hd-marker marker 'org-category category
+               'priority priority 'type "tagsmatch")
              (push txt rtn))
            ;; if we are to skip sublevels, jump to end of subtree
            (or org-tags-match-list-sublevels (org-end-of-subtree t))))))
@@ -11501,25 +12976,43 @@ also TODO lines."
   (interactive "P")
   (org-scan-tags 'sparse-tree (cdr (org-make-tags-matcher match)) todo-only))
 
+(defvar org-cached-props nil)
+(defun org-cached-entry-get (pom property)
+  (cdr (assoc property (or org-cached-props
+                          (setq org-cached-props
+                                (org-entry-properties pom))))))
+
+(defun org-global-tags-completion-table (&optional files)
+  "Return the list of all tags in all agenda buffer/files."
+  (save-excursion
+    (org-uniquify
+     (apply 'append
+           (mapcar
+            (lambda (file)
+              (set-buffer (find-file-noselect file))
+              (org-get-buffer-tags))
+            (if (and files (car files))
+                files
+              (org-agenda-files)))))))
+
 (defun org-make-tags-matcher (match)
   "Create the TAGS//TODO matcher form for the selection string MATCH."
   ;; todo-only is scoped dynamically into this function, and the function
   ;; may change it it the matcher asksk for it.
   (unless match
     ;; Get a new match request, with completion
-    (setq org-last-tags-completion-table
-         (or org-tag-alist
-             org-last-tags-completion-table))
-    (setq match (completing-read
-                "Match: " 'org-tags-completion-function nil nil nil
-                'org-tags-history)))
-
+    (let ((org-last-tags-completion-table
+          (org-global-tags-completion-table)))
+      (setq match (completing-read
+                  "Match: " 'org-tags-completion-function nil nil nil
+                  'org-tags-history))))
+  
   ;; Parse the string and create a lisp form
   (let ((match0 match)
-       (re "^&?\\([-+:]\\)?\\({[^}]+}\\|LEVEL=\\([0-9]+\\)\\|[A-Za-z_@0-9]+\\)")
+       (re (org-re "^&?\\([-+:]\\)?\\({[^}]+}\\|LEVEL=\\([0-9]+\\)\\|\\([[:alnum:]]+\\)=\\({[^}]+}\\|\"[^\"]+\"\\)\\|[[:alnum:]_@]+\\)"))
        minus tag mm
        tagsmatch todomatch tagsmatcher todomatcher kwd matcher
-       orterms term orlist re-p level-p)
+       orterms term orlist re-p level-p prop-p pn pv)
     (if (string-match "/+" match)
        ;; match contains also a todo-matching request
        (progn
@@ -11545,10 +13038,19 @@ also TODO lines."
                tag (match-string 2 term)
                re-p (equal (string-to-char tag) ?{)
                level-p (match-end 3)
+               prop-p (match-end 4)
                mm (cond
                    (re-p `(org-match-any-p ,(substring tag 1 -1) tags-list))
                    (level-p `(= level ,(string-to-number
                                         (match-string 3 term))))
+                   (prop-p
+                    (setq pn (match-string 4 term)
+                          pv (match-string 5 term)
+                          re-p (equal (string-to-char pv) ?{)
+                          pv (substring pv 1 -1))
+                    (if re-p
+                        `(string-match ,pv (org-cached-entry-get nil ,pn))
+                      `(equal ,pv (org-cached-entry-get nil ,pn))))
                    (t `(member ,(downcase tag) tags-list)))
                mm (if minus (list 'not mm) mm)
                term (substring term (match-end 0)))
@@ -11558,7 +13060,9 @@ also TODO lines."
                (car tagsmatcher))
              orlist)
        (setq tagsmatcher nil))
-      (setq tagsmatcher (if (> (length orlist) 1) (cons 'or orlist) (car orlist))))
+      (setq tagsmatcher (if (> (length orlist) 1) (cons 'or orlist) (car orlist)))
+      (setq tagsmatcher
+           (list 'progn '(setq org-cached-props nil) tagsmatcher)))
 
     ;; Make the todo matcher
     (if (or (not todomatch) (not (string-match "\\S-" todomatch)))
@@ -11599,6 +13103,29 @@ also TODO lines."
 (defvar org-tags-overlay (org-make-overlay 1 1))
 (org-detach-overlay org-tags-overlay)
 
+(defun org-align-tags-here (to-col)
+  ;; Assumes that this is a headline
+  (let ((pos (point)) (col (current-column)) tags)
+    (beginning-of-line 1)
+    (if        (and (looking-at (org-re ".*?\\([ \t]+\\)\\(:[[:alnum:]_@:]+:\\)[ \t]*$"))
+            (< pos (match-beginning 2)))
+       (progn
+         (setq tags (match-string 2))
+         (goto-char (match-beginning 1))
+         (insert " ")
+         (delete-region (point) (1+ (match-end 0)))
+         (backward-char 1)
+         (move-to-column
+          (max (1+ (current-column))
+               (1+ col)
+               (if (> to-col 0)
+                   to-col
+                 (- (abs to-col) (length tags))))
+          t)
+         (insert tags)
+         (move-to-column (min (current-column) col) t))
+      (goto-char pos))))
+
 (defun org-set-tags (&optional arg just-align)
   "Set the tags for the current headline.
 With prefix ARG, realign all tags in headings in the current buffer."
@@ -11610,7 +13137,7 @@ With prefix ARG, realign all tags in headings in the current buffer."
     (if arg
        (save-excursion
          (goto-char (point-min))
-         (let (buffer-invisibility-spec)  ; Emacs 21 compatibility
+         (let ((buffer-invisibility-spec (org-inhibit-invisibility)))
            (while (re-search-forward re nil t)
              (org-set-tags nil t)
              (end-of-line 1)))
@@ -11637,29 +13164,31 @@ With prefix ARG, realign all tags in headings in the current buffer."
        (while (string-match "[-+&]+" tags)
          ;; No boolean logic, just a list
          (setq tags (replace-match ":" t t tags))))
+      
       (if (string-match "\\`[\t ]*\\'" tags)
           (setq tags "")
        (unless (string-match ":$" tags) (setq tags (concat tags ":")))
        (unless (string-match "^:" tags) (setq tags (concat ":" tags))))
-
+      
       ;; Insert new tags at the correct column
       (beginning-of-line 1)
-      (if (re-search-forward
-          (concat "\\([ \t]*" (regexp-quote current) "\\)[ \t]*$")
-          (point-at-eol) t)
-         (progn
-           (if (equal tags "")
-               (setq rpl "")
-             (goto-char (match-beginning 0))
-             (setq c0 (current-column) p0 (point)
-                   c1 (max (1+ c0) (if (> org-tags-column 0)
-                                       org-tags-column
-                                     (- (- org-tags-column) (length tags))))
-                   rpl (concat (make-string (max 0 (- c1 c0)) ?\ ) tags)))
-           (replace-match rpl t t)
-           (and (not (featurep 'xemacs)) c0 (tabify p0 (point)))
-           tags)
-       (error "Tags alignment failed")))))
+      (cond
+       ((and (equal current "") (equal tags "")))
+       ((re-search-forward
+        (concat "\\([ \t]*" (regexp-quote current) "\\)[ \t]*$")
+        (point-at-eol) t)
+       (if (equal tags "")
+           (setq rpl "")
+         (goto-char (match-beginning 0))
+         (setq c0 (current-column) p0 (point)
+               c1 (max (1+ c0) (if (> org-tags-column 0)
+                                   org-tags-column
+                                 (- (- org-tags-column) (length tags))))
+               rpl (concat (make-string (max 0 (- c1 c0)) ?\ ) tags)))
+       (replace-match rpl t t)
+       (and (not (featurep 'xemacs)) c0 (tabify p0 (point)))
+       tags)
+       (t (error "Tags alignment failed"))))))
 
 (defun org-tags-completion-function (string predicate &optional flag)
   (let (s1 s2 rtn (ctable org-last-tags-completion-table)
@@ -11673,11 +13202,12 @@ With prefix ARG, realign all tags in headings in the current buffer."
       ;; try completion
       (setq rtn (try-completion s2 ctable confirm))
       (if (stringp rtn)
-         (concat s1 s2 (substring rtn (length s2))
-                 (if (and org-add-colon-after-tag-completion
-                          (assoc rtn ctable))
-                     ":" "")))
-      )
+         (setq rtn
+               (concat s1 s2 (substring rtn (length s2))
+                       (if (and org-add-colon-after-tag-completion
+                                (assoc rtn ctable))
+                           ":" ""))))
+      rtn)
      ((eq flag t)
       ;; all-completions
       (all-completions s2 ctable confirm)
@@ -11728,14 +13258,15 @@ Returns the new tags string, or nil to not change the current settings."
         (fwidth (+ maxlen 3 1 3))
         (ncol (/ (- (window-width) 4) fwidth))
         (i-face 'org-done)
-        (c-face 'org-tag)
+        (c-face 'org-todo)
         tg cnt e c char c1 c2 ntable tbl rtn
         ov-start ov-end ov-prefix
         (exit-after-next org-fast-tag-selection-single-key)
         groups ingroup)
     (save-excursion
       (beginning-of-line 1)
-      (if (looking-at ".*[ \t]\\(:[A-Za-z_@0-9:]+:\\)[ \t]*\\(\r\\|$\\)")
+      (if (looking-at
+          (org-re ".*[ \t]\\(:[[:alnum:]_@:]+:\\)[ \t]*$"))
          (setq ov-start (match-beginning 1)
                ov-end (match-end 1)
                ov-prefix "")
@@ -11870,7 +13401,8 @@ Returns the new tags string, or nil to not change the current settings."
                (delete-region (point) (point-at-eol))
                (org-fast-tag-insert "Current" current c-face)
                (org-set-current-tags-overlay current ov-prefix)
-               (while (re-search-forward "\\[.\\] \\([a-zA-Z0-9_@]+\\)" nil t)
+               (while (re-search-forward
+                       (org-re "\\[.\\] \\([[:alnum:]_@]+\\)") nil t)
                  (setq tg (match-string 1))
                  (add-text-properties (match-beginning 1) (match-end 1)
                                       (list 'face
@@ -11890,7 +13422,7 @@ Returns the new tags string, or nil to not change the current settings."
     (error "Not on a heading"))
   (save-excursion
     (beginning-of-line 1)
-    (if (looking-at ".*[ \t]\\(:[A-Za-z_@0-9:]+:\\)[ \t]*\\(\r\\|$\\)")
+    (if (looking-at (org-re ".*[ \t]\\(:[[:alnum:]_@:]+:\\)[ \t]*$"))
        (org-match-string-no-properties 1)
       "")))
 
@@ -11899,48 +13431,1123 @@ Returns the new tags string, or nil to not change the current settings."
   (let (tags)
     (save-excursion
       (goto-char (point-min))
-      (while (re-search-forward "[ \t]:\\([A-Za-z_@0-9:]+\\):[ \t\r\n]" nil t)
-       (mapc (lambda (x) (add-to-list 'tags x))
-             (org-split-string (org-match-string-no-properties 1) ":"))))
+      (while (re-search-forward 
+             (org-re "[ \t]:\\([[:alnum:]_@:]+\\):[ \t\r\n]") nil t)
+       (when (equal (char-after (point-at-bol 0)) ?*)
+         (mapc (lambda (x) (add-to-list 'tags x))
+               (org-split-string (org-match-string-no-properties 1) ":")))))
     (mapcar 'list tags)))
 
-;;;; Timestamps
 
-(defvar org-last-changed-timestamp nil)
-(defvar org-time-was-given) ; dynamically scoped parameter
-(defvar org-ts-what) ; dynamically scoped parameter
+;;;; Properties
 
-(defun org-time-stamp (arg)
-  "Prompt for a date/time and insert a time stamp.
-If the user specifies a time like HH:MM, or if this command is called
-with a prefix argument, the time stamp will contain date and time.
-Otherwise, only the date will be included.  All parts of a date not
-specified by the user will be filled in from the current date/time.
-So if you press just return without typing anything, the time stamp
-will represent the current date/time.  If there is already a timestamp
-at the cursor, it will be modified."
-  (interactive "P")
-  (let (org-time-was-given time)
+;;; Setting and retrieving properties
+
+(defconst org-special-properties
+  '("TODO" "TAGS" "ALLTAGS" "DEADLINE" "SCHEDULED"
+    "CLOCK" "PRIORITY")
+  "The special properties valid in Org-mode.
+
+These are properties that are not defined in the property drawer,
+but in some other way.")
+
+(defconst org-property-start-re "^[ \t]*:PROPERTIES:[ \t]*$"
+  "Regular expression matching the first line of a property drawer.")
+
+(defconst org-property-end-re "^[ \t]*:END:[ \t]*$"
+  "Regular expression matching the first line of a property drawer.")
+
+(defun org-property-action ()
+  "Do an action on properties."
+  (interactive)
+  (let (c prop)
+    (org-at-property-p)
+    (setq prop (match-string 2))
+    (message "Property Action:  [s]et  [d]elete  [D]delete globally")
+    (setq c (read-char-exclusive))
     (cond
-     ((and (org-at-timestamp-p)
-          (eq last-command 'org-time-stamp)
-          (eq this-command 'org-time-stamp))
-      (insert "--")
-      (setq time (let ((this-command this-command))
-                 (org-read-date arg 'totime)))
-      (org-insert-time-stamp time (or org-time-was-given arg)))
+     ((equal c ?s)
+      (call-interactively 'org-set-property))
+     ((equal c ?d)
+      (call-interactively 'org-delete-property))
+     ((equal c ?D)
+      (call-interactively 'org-delete-property-globally))
+     (t (error "No such property action %c" c)))))
+
+(defun org-at-property-p ()
+  "Is the cursor in a property line?"
+  ;; FIXME: Does not check if we are actually in the drawer.
+  ;; FIXME: also returns true on any drawers.....
+  ;; This is used by C-c C-c for property action.
+  (save-excursion
+    (beginning-of-line 1)
+    (looking-at "^[ \t]*\\(:\\([a-zA-Z_0-9]+\\):\\)[ \t]*\\(.*\\)")))
+
+(defmacro org-with-point-at (pom &rest body)
+  "Move to buffer and point of point-or-marker POM for the duration of BODY."
+  (declare (indent 1) (debug t))
+  `(save-excursion
+     (if (markerp pom) (set-buffer (marker-buffer pom)))
+     (save-excursion
+       (goto-char (or pom (point)))
+       ,@body)))
+
+(defun org-get-property-block (&optional beg end force)
+  "Return the (beg . end) range of the body of the property drawer.
+BEG and END can be beginning and end of subtree, if not given
+they will be found.
+If the drawer does not exist and FORCE is non-nil, create the drawer."
+  (catch 'exit
+    (save-excursion
+      (let* ((beg (or beg (progn (org-back-to-heading t) (point))))
+            (end (or end (progn (outline-next-heading) (point)))))
+       (goto-char beg)
+       (if (re-search-forward org-property-start-re end t)
+           (setq beg (1+ (match-end 0)))
+         (if force
+             (save-excursion
+               (org-insert-property-drawer)
+               (setq end (progn (outline-next-heading) (point))))
+           (throw 'exit nil))
+         (goto-char beg)
+         (if (re-search-forward org-property-start-re end t)
+             (setq beg (1+ (match-end 0)))))
+       (if (re-search-forward org-property-end-re end t)
+           (setq end (match-beginning 0))
+         (or force (throw 'exit nil))
+         (goto-char beg)
+         (setq end beg)
+         (org-indent-line-function)
+         (insert ":END:\n"))
+       (cons beg end)))))
+
+(defun org-entry-properties (&optional pom which)
+  "Get all properties of the entry at point-or-marker POM.
+This includes the TODO keyword, the tags, time strings for deadline,
+scheduled, and clocking, and any additional properties defined in the
+entry.  The return value is an alist, keys may occur multiple times
+if the property key was used several times.
+POM may also be nil, in which case the current entry is used.
+If WHICH is nil or `all', get all properties.  If WHICH is
+`special' or `standard', only get that subclass."
+  (setq which (or which 'all))
+  (org-with-point-at pom
+    (let ((clockstr (substring org-clock-string 0 -1))
+         (excluded '("TODO" "TAGS" "ALLTAGS" "PRIORITY"))
+         beg end range props sum-props key value)
+      (save-excursion
+       (when (condition-case nil (org-back-to-heading t) (error nil))
+         (setq beg (point))
+         (setq sum-props (get-text-property (point) 'org-summaries))
+         (outline-next-heading)
+         (setq end (point))
+         (when (memq which '(all special))
+           ;; Get the special properties, like TODO and tags
+           (goto-char beg)
+           (when (and (looking-at org-todo-line-regexp) (match-end 2))
+             (push (cons "TODO" (org-match-string-no-properties 2)) props))
+           (when (looking-at org-priority-regexp)
+             (push (cons "PRIORITY" (org-match-string-no-properties 2)) props))
+           (when (and (setq value (org-get-tags)) (string-match "\\S-" value))
+             (push (cons "TAGS" value) props))
+           (when (setq value (org-get-tags-at))
+             (push (cons "ALLTAGS" (concat ":" (mapconcat 'identity value ":") ":"))
+                   props))
+           (while (re-search-forward org-keyword-time-regexp end t)
+             (setq key (substring (org-match-string-no-properties 1) 0 -1))
+             (unless (member key excluded) (push key excluded))
+             (push (cons key
+                         (if (equal key clockstr)
+                             (org-no-properties
+                              (org-trim
+                               (buffer-substring
+                                (match-beginning 2) (point-at-eol))))
+                           (org-match-string-no-properties 2)))
+                   props)))
+         (when (memq which '(all standard))
+           ;; Get the standard properties, like :PORP: ...
+           (setq range (org-get-property-block beg end))
+           (when range
+             (goto-char (car range))
+             (while (re-search-forward
+                     "^[ \t]*:\\([a-zA-Z][a-zA-Z_0-9]*\\):[ \t]*\\(\\S-.*\\)?"
+                     (cdr range) t)
+               (setq key (org-match-string-no-properties 1)
+                     value (org-trim (or (org-match-string-no-properties 2) "")))
+               (unless (member key excluded)
+                 (push (cons key (or value "")) props)))))
+         (append sum-props (nreverse props)))))))
+  
+(defun org-entry-get (pom property &optional inherit)
+  "Get value of PROPERTY for entry at point-or-marker POM.
+If INHERIT is non-nil and the entry does not have the property,
+then also check higher levels of the hierarchy.
+If the property is present but empty, the return value is the empty string.
+If the property is not present at all, nil is returned."
+  (org-with-point-at pom
+    (if inherit
+       (org-entry-get-with-inheritance property)
+      (if (member property org-special-properties)
+         ;; We need a special property.  Use brute force, get all properties.
+         (cdr (assoc property (org-entry-properties nil 'special)))
+       (let ((range (org-get-property-block)))
+         (if (and range
+                  (goto-char (car range))
+                  (re-search-forward
+                   (concat "^[ \t]*:" property ":[ \t]*\\(.*\\S-\\)?")
+                   (cdr range) t))
+             ;; Found the property, return it.
+             (if (match-end 1)
+                 (org-match-string-no-properties 1)
+               "")))))))
+
+(defun org-entry-delete (pom property)
+  "Delete the property PROPERTY from entry at point-or-marker POM."
+  (org-with-point-at pom
+    (if (member property org-special-properties)
+       nil ; cannot delete these properties.
+      (let ((range (org-get-property-block)))
+       (if (and range
+                (goto-char (car range))
+                (re-search-forward
+                 (concat "^[ \t]*:" property ":[ \t]*\\(.*\\S-\\)")
+                 (cdr range) t))
+           (progn
+             (delete-region (match-beginning 0) (1+ (point-at-eol)))
+             t)
+         nil)))))
+
+(defvar org-entry-property-inherited-from (make-marker))
+
+(defun org-entry-get-with-inheritance (property)
+  "Get entry property, and search higher levels if not present."
+  (let (tmp)
+    (save-excursion
+      (catch 'ex
+       (while t
+         (when (setq tmp (org-entry-get nil property))
+           (org-back-to-heading t)
+           (move-marker org-entry-property-inherited-from (point))
+           (throw 'ex tmp))
+         (condition-case nil
+             (org-up-heading-all 1)
+           (error (throw 'ex nil))))))))
+
+(defun org-entry-put (pom property value)
+  "Set PROPERTY to VALUE for entry at point-or-marker POM."
+  (org-with-point-at pom
+    (org-back-to-heading t)
+    (let ((beg (point)) (end (save-excursion (outline-next-heading) (point)))
+         range)
+      (cond
+       ((equal property "TODO")
+       (when (and (stringp value) (string-match "\\S-" value)
+                  (not (member value org-todo-keywords-1)))
+         (error "\"%s\" is not a valid TODO state" value))
+       (if (or (not value)
+               (not (string-match "\\S-" value)))
+           (setq value 'none))
+       (org-todo value)
+       (org-set-tags nil 'align))
+       ((equal property "PRIORITY")
+       (org-priority (if (and value (stringp value) (string-match "\\S-" value))
+                              (string-to-char value) ?\ ))
+       (org-set-tags nil 'align))
+       ((member property org-special-properties)
+       (error "The %s property can not yet be set with `org-entry-put'"
+              property))
+       (t ; a non-special property
+       (setq range (org-get-property-block beg end 'force))
+       (goto-char (car range))
+       (if (re-search-forward
+            (concat "^[ \t]*:" property ":\\(.*\\)") (cdr range) t)
+           (progn
+             (delete-region (match-beginning 1) (match-end 1))
+             (goto-char (match-beginning 1)))
+         (goto-char (cdr range))
+         (insert "\n")
+         (backward-char 1)
+         (org-indent-line-function)
+         (insert ":" property ":"))
+       (and value (insert " " value))
+       (org-indent-line-function))))))
+
+(defun org-buffer-property-keys (&optional include-specials)
+  "Get all property keys in the current buffer."
+  (let (rtn range)
+    (save-excursion
+      (save-restriction
+       (widen)
+       (goto-char (point-min))
+       (while (re-search-forward org-property-start-re nil t)
+         (setq range (org-get-property-block))
+         (goto-char (car range))
+         (while (re-search-forward "^[ \t]*:\\([a-zA-Z0-9]+\\):" (cdr range) t)
+           (add-to-list 'rtn (org-match-string-no-properties 1)))
+         (outline-next-heading))))
+    (when include-specials
+      (setq rtn (append org-special-properties rtn)))
+    (sort rtn (lambda (a b) (string< (upcase a) (upcase b))))))
+
+(defun org-insert-property-drawer ()
+  "Insert a property drawer into the current entry."
+  (interactive)
+  (org-back-to-heading t)
+  (let ((beg (point))
+       (re (concat "^[ \t]*" org-keyword-time-regexp))
+       end hiddenp)
+    (outline-next-heading)
+    (setq end (point))
+    (goto-char beg)
+    (while (re-search-forward re end t))
+    (setq hiddenp (org-invisible-p))
+    (end-of-line 1)
+    (insert "\n:PROPERTIES:\n:END:")
+    (beginning-of-line 0)
+    (org-indent-line-function)
+    (beginning-of-line 2)
+    (org-indent-line-function)
+    (beginning-of-line 0)
+    (if hiddenp
+       (save-excursion
+         (org-back-to-heading t)
+         (hide-entry))
+      (org-flag-drawer t))))
+
+(defun org-set-property (property value)
+  "In the current entry, set PROPERTY to VALUE."
+  (interactive
+   (let* ((prop        (completing-read "Property: " 
+                                (mapcar 'list (org-buffer-property-keys))))
+         (cur (org-entry-get nil prop))
+         (allowed (org-property-get-allowed-values nil prop 'table))
+         (val (if allowed
+                  (completing-read "Value: " allowed nil 'req-match)
+                (read-string
+                 (concat "Value" (if (and cur (string-match "\\S-" cur))
+                                     (concat "[" cur "]") "")
+                         ": ")
+                 "" cur))))
+     (list prop (if (equal val "") cur val))))
+  (unless (equal (org-entry-get nil property) value)
+    (org-entry-put nil property value)))
+
+(defun org-delete-property (property)
+  "In the current entry, delete PROPERTY."
+  (interactive
+   (let* ((prop (completing-read
+                "Property: " (org-entry-properties nil 'standard))))
+     (list prop)))
+  (message (concat "Property " property 
+                  (if (org-entry-delete nil property)
+                      " deleted"
+                    " was not present in the entry"))))
+
+(defun org-delete-property-globally (property)
+  "Remove PROPERTY globally, from all entries."
+  (interactive
+   (let* ((prop (completing-read
+                "Globally remove property: " 
+                (mapcar 'list (org-buffer-property-keys)))))
+     (list prop)))
+  (save-excursion
+    (save-restriction
+      (widen)
+      (goto-char (point-min))
+      (let ((cnt 0))
+       (while (re-search-forward
+               (concat "^[ \t]*:" (regexp-quote property) ":.*\n?")
+               nil t)
+         (setq cnt (1+ cnt))
+         (replace-match ""))
+       (message "Property \"%s\" removed from %d entries" property cnt)))))
+
+(defun org-property-get-allowed-values (pom property &optional table)
+  "Get allowed values for the property PROPERTY.
+When TABLE is non-nil, return an alist that can directly be used for
+completion."
+  (let (vals)
+    (cond
+     ((equal property "TODO")
+      (setq vals (org-with-point-at pom 
+                  (append org-todo-keywords-1 '("")))))
+     ((equal property "PRIORITY")
+      (let ((n org-lowest-priority))
+       (while (>= n org-highest-priority)
+         (push (char-to-string n) vals)
+         (setq n (1- n)))))
+     ((member property org-special-properties))
+     (t
+      (setq vals (org-entry-get pom (concat property "_ALL") 'inherit))
+      (when (and vals (string-match "\\S-" vals))
+       (setq vals (car (read-from-string (concat "(" vals ")"))))
+       (setq vals (mapcar (lambda (x)
+                            (cond ((stringp x) x)
+                                  ((numberp x) (number-to-string x))
+                                  ((symbolp x) (symbol-name x))
+                                  (t "???")))
+                          vals)))))
+    (if table (mapcar 'list vals) vals)))
+
+;;; Column View
+
+(defvar org-columns-overlays nil
+  "Holds the list of current column overlays.")
+
+(defvar org-columns-current-fmt nil
+  "Local variable, holds the currently active column format.")
+(defvar org-columns-current-fmt-compiled nil
+  "Local variable, holds the currently active column format.
+This is the compiled version of the format.")
+(defvar org-columns-current-maxwidths nil
+  "Loval variable, holds the currently active maximum column widths.")
+(defvar org-columns-begin-marker (make-marker)
+  "Points to the position where last a column creation command was called.")
+(defvar org-columns-top-level-marker (make-marker)
+  "Points to the position where current columns region starts.")
+
+(defvar org-columns-map (make-sparse-keymap)
+  "The keymap valid in column display.")
+
+(defun org-columns-content ()
+  "Switch to contents view while in columns view."
+  (interactive)
+  (org-overview)
+  (org-content))
+
+(org-defkey org-columns-map "c" 'org-columns-content)
+(org-defkey org-columns-map "o" 'org-overview)
+(org-defkey org-columns-map "e" 'org-columns-edit-value)
+(org-defkey org-columns-map "v" 'org-columns-show-value)
+(org-defkey org-columns-map "q" 'org-columns-quit)
+(org-defkey org-columns-map "r" 'org-columns-redo)
+(org-defkey org-columns-map [left] 'backward-char)
+(org-defkey org-columns-map "a" 'org-columns-edit-allowed)
+(org-defkey org-columns-map "s" 'org-columns-edit-attributes)
+(org-defkey org-columns-map [right] 'forward-char)
+(org-defkey org-columns-map [(shift right)] 'org-columns-next-allowed-value)
+(org-defkey org-columns-map "\C-c\C-c" 'org-columns-next-allowed-value)
+(org-defkey org-columns-map "n" 'org-columns-next-allowed-value)
+(org-defkey org-columns-map [(shift left)] 'org-columns-previous-allowed-value)
+(org-defkey org-columns-map "p" 'org-columns-previous-allowed-value)
+(org-defkey org-columns-map "<" 'org-columns-narrow)
+(org-defkey org-columns-map ">" 'org-columns-widen)
+(org-defkey org-columns-map [(meta right)] 'org-columns-move-right)
+(org-defkey org-columns-map [(meta left)] 'org-columns-move-left)
+(org-defkey org-columns-map [(shift meta right)] 'org-columns-new)
+(org-defkey org-columns-map [(shift meta left)] 'org-columns-delete)
+
+(easy-menu-define org-columns-menu org-columns-map "Org Column Menu"
+  '("Column"
+    ["Edit property" org-columns-edit-value t]
+    ["Next allowed value" org-columns-next-allowed-value t]
+    ["Previous allowed value" org-columns-previous-allowed-value t]
+    ["Show full value" org-columns-show-value t]
+    ["Edit allowed" org-columns-edit-allowed t]
+    "--"
+    ["Edit column attributes" org-columns-edit-attributes t]
+    ["Increase column width" org-columns-widen t]
+    ["Decrease column width" org-columns-narrow t]
+    "--"
+    ["Move column right" org-columns-move-right t]
+    ["Move column left" org-columns-move-left t]
+    ["Add column" org-columns-new t]
+    ["Delete column" org-columns-delete t]
+    "--"
+    ["CONTENTS" org-columns-content t]
+    ["OVERVIEW" org-overview t]
+    ["Refresh columns display" org-columns-redo t]
+    "--"
+    ["Quit" org-columns-quit t]))
+
+(defun org-columns-new-overlay (beg end &optional string face)
+  "Create a new column overlay and add it to the list."
+  (let ((ov (org-make-overlay beg end)))
+    (org-overlay-put ov 'face (or face 'secondary-selection))
+    (org-overlay-display ov string face)
+    (push ov org-columns-overlays)
+    ov))
+
+(defun org-columns-display-here (&optional props)
+  "Overlay the current line with column display."
+  (interactive)
+  (let* ((fmt org-columns-current-fmt-compiled)
+        (beg (point-at-bol))
+        (level-face (save-excursion
+                      (beginning-of-line 1)
+                      (looking-at "\\(\\**\\)\\(\\* \\)")
+                      (org-get-level-face 2)))
+        (color (list :foreground 
+                     (face-attribute (or level-face 'default) :foreground)))
+        props pom property ass width f string ov column)
+    ;; Check if the entry is in another buffer.
+    (unless props
+      (if (eq major-mode 'org-agenda-mode)
+         (setq pom (or (get-text-property (point) 'org-hd-marker)
+                       (get-text-property (point) 'org-marker))
+               props (if pom (org-entry-properties pom) nil))
+       (setq props (org-entry-properties nil))))
+    ;; Walk the format
+    (while (setq column (pop fmt))
+      (setq property (car column)
+           ass (if (equal property "ITEM")
+                   (cons "ITEM"
+                         (save-match-data
+                           (org-no-properties
+                            (org-remove-tabs
+                             (buffer-substring-no-properties
+                              (point-at-bol) (point-at-eol))))))
+                 (assoc property props))
+           width (or (cdr (assoc property org-columns-current-maxwidths))
+                     (nth 2 column))
+           f (format "%%-%d.%ds | " width width)
+           string (format f (or (cdr ass) "")))
+      ;; Create the overlay
+      (org-unmodified
+       (setq ov (org-columns-new-overlay
+                beg (setq beg (1+ beg)) string
+                (list color 'org-column)))
+;;;       (list (get-text-property (point-at-bol) 'face) 'org-column)))
+       (org-overlay-put ov 'keymap org-columns-map)
+       (org-overlay-put ov 'org-columns-key property)
+       (org-overlay-put ov 'org-columns-value (cdr ass))
+       (org-overlay-put ov 'org-columns-pom pom)
+       (org-overlay-put ov 'org-columns-format f))
+      (if (or (not (char-after beg))
+             (equal (char-after beg) ?\n))
+         (let ((inhibit-read-only t))
+           (save-excursion
+             (goto-char beg)
+             (insert " ")))))
+    ;; Make the rest of the line disappear.
+    (org-unmodified
+     (setq ov (org-columns-new-overlay beg (point-at-eol)))
+     (org-overlay-put ov 'invisible t)
+     (org-overlay-put ov 'keymap org-columns-map)
+     (push ov org-columns-overlays)
+     (setq ov (org-make-overlay (1- (point-at-eol)) (1+ (point-at-eol))))
+     (org-overlay-put ov 'keymap org-columns-map)
+     (push ov org-columns-overlays)
+     (let ((inhibit-read-only t))
+       (put-text-property (1- (point-at-bol)) 
+                         (min (point-max) (1+ (point-at-eol)))
+                         'read-only "Type `e' to edit property")))))
+
+(defvar org-previous-header-line-format nil
+  "The header line format before column view was turned on.")
+(defvar org-columns-inhibit-recalculation nil
+  "Inhibit recomputing of columns on column view startup.")
+
+(defvar header-line-format)
+(defun org-columns-display-here-title ()
+  "Overlay the newline before the current line with the table title."
+  (interactive)
+  (let ((fmt org-columns-current-fmt-compiled)
+       string (title "")
+       property width f column str)
+    (while (setq column (pop fmt))
+      (setq property (car column)
+           str (or (nth 1 column) property)
+           width (or (cdr (assoc property org-columns-current-maxwidths))
+                     (nth 2 column))
+           f (format "%%-%d.%ds | " width width)
+           string (format f str)
+           title (concat title string)))
+    (setq title (concat
+                (org-add-props " " nil 'display '(space :align-to 0))
+                (org-add-props title nil 'face '(:weight bold :underline t))))
+    (org-set-local 'org-previous-header-line-format header-line-format)
+    (setq header-line-format title)))
+
+(defun org-columns-remove-overlays ()
+  "Remove all currently active column overlays."
+  (interactive)
+  (when (marker-buffer org-columns-begin-marker)
+    (with-current-buffer (marker-buffer org-columns-begin-marker)
+      (when (local-variable-p 'org-previous-header-line-format)
+       (setq header-line-format org-previous-header-line-format)
+       (kill-local-variable 'org-previous-header-line-format))
+      (move-marker org-columns-begin-marker nil)
+      (move-marker org-columns-top-level-marker nil)
+      (org-unmodified
+       (mapc 'org-delete-overlay org-columns-overlays)
+       (setq org-columns-overlays nil)
+       (let ((inhibit-read-only t))
+        (remove-text-properties (point-min) (point-max) '(read-only t)))))))
+
+(defun org-columns-show-value ()
+  "Show the full value of the property."
+  (interactive)
+  (let ((value (get-char-property (point) 'org-columns-value)))
+    (message "Value is: %s" (or value ""))))
+
+(defun org-columns-quit ()
+  "Remove the column overlays and in this way exit column editing."
+  (interactive)
+  (org-unmodified
+   (org-columns-remove-overlays)
+   (let ((inhibit-read-only t))
+     ;; FIXME: is this safe???
+     ;; or are there other reasons why there may be a read-only property????
+     (remove-text-properties (point-min) (point-max) '(read-only t))))
+  (when (eq major-mode 'org-agenda-mode)
+    (message "Modification not yet reflected in Agenda buffer, use `r' to refresh")))
+
+(defun org-columns-edit-value ()
+  "Edit the value of the property at point in column view.
+Where possible, use the standard interface for changing this line."
+  (interactive)
+  (let* ((col (current-column))
+        (key (get-char-property (point) 'org-columns-key))
+        (value (get-char-property (point) 'org-columns-value))
+        (bol (point-at-bol)) (eol (point-at-eol))
+        (pom (or (get-text-property bol 'org-hd-marker)
+                 (point))) ; keep despite of compiler waring
+        (line-overlays
+         (delq nil (mapcar (lambda (x)
+                             (and (eq (overlay-buffer x) (current-buffer))
+                                  (>= (overlay-start x) bol)
+                                  (<= (overlay-start x) eol)
+                                  x))
+                           org-columns-overlays)))
+        nval eval allowed)
+    (when (equal key "ITEM")
+      (error "Cannot edit item headline from here"))
+    
+    (cond
+     ((equal key "TODO")
+      (setq eval '(org-with-point-at pom
+                   (let ((current-prefix-arg '(4))) (org-todo '(4))))))
+     ((equal key "PRIORITY")
+      (setq eval '(org-with-point-at pom
+                   (call-interactively 'org-priority))))
+     ((equal key "TAGS")
+      (setq eval '(org-with-point-at pom
+                   (let ((org-fast-tag-selection-single-key
+                          (if (eq org-fast-tag-selection-single-key 'expert)
+                              t org-fast-tag-selection-single-key)))
+                     (call-interactively 'org-set-tags)))))
+     ((equal key "DEADLINE")
+      (setq eval '(org-with-point-at pom
+                   (call-interactively 'org-deadline))))
+     ((equal key "SCHEDULED")
+      (setq eval '(org-with-point-at pom
+                   (call-interactively 'org-deadline))))
+     (t
+      (setq allowed (org-property-get-allowed-values pom key 'table))
+      (if allowed
+         (setq nval (completing-read "Value: " allowed nil t))
+       (setq nval (read-string "Edit: " value)))
+      (setq nval (org-trim nval))
+      (when (not (equal nval value))
+       (setq eval '(org-entry-put pom key nval)))))
+    (when eval
+      (let ((inhibit-read-only t))
+       (remove-text-properties (1- bol) eol '(read-only t))
+       (unwind-protect
+           (progn
+             (setq org-columns-overlays 
+                   (org-delete-all line-overlays org-columns-overlays))
+             (mapc 'org-delete-overlay line-overlays)
+             (org-columns-eval eval))
+         (org-columns-display-here))))
+    (move-to-column col)
+    (if (nth 3 (assoc key org-columns-current-fmt-compiled))
+       (org-columns-update key))))
+
+(defun org-columns-edit-allowed ()
+  "Edit the list of allowed values for the current property."
+  (interactive)
+  (let* ((col (current-column))
+        (key (get-char-property (point) 'org-columns-key))
+        (key1 (concat key "_ALL"))
+        (value (get-char-property (point) 'org-columns-value))
+        (allowed (org-entry-get (point) key1 t))
+        nval)
+    (setq nval (read-string "Allowed: " allowed))
+    (org-entry-put 
+     (cond ((marker-position org-entry-property-inherited-from)
+           org-entry-property-inherited-from)
+          ((marker-position org-columns-top-level-marker)
+           org-columns-top-level-marker))
+     key1 nval)))
+
+(defun org-columns-eval (form)
+  (let (hidep)
+    (save-excursion
+      (beginning-of-line 1)
+      (next-line 1)
+      (setq hidep (org-on-heading-p 1)))
+    (eval form)
+    (and hidep (hide-entry))))
+
+(defun org-columns-previous-allowed-value ()
+  "Switch to the previous allowed value for this column."
+  (interactive)
+  (org-columns-next-allowed-value t))
+
+(defun org-columns-next-allowed-value (&optional previous)
+  "Switch to the next allowed value for this column."
+  (interactive)
+  (let* ((col (current-column))
+        (key (get-char-property (point) 'org-columns-key))
+        (value (get-char-property (point) 'org-columns-value))
+        (bol (point-at-bol)) (eol (point-at-eol))
+        (pom (or (get-text-property bol 'org-hd-marker)
+                 (point))) ; keep despite of compiler waring
+        (line-overlays
+         (delq nil (mapcar (lambda (x)
+                             (and (eq (overlay-buffer x) (current-buffer))
+                                  (>= (overlay-start x) bol)
+                                  (<= (overlay-start x) eol)
+                                  x))
+                           org-columns-overlays)))
+        (allowed (or (org-property-get-allowed-values pom key)
+                     (and (equal
+                           (nth 4 (assoc key org-columns-current-fmt-compiled))
+                           'checkbox) '("[ ]" "[X]"))))
+        nval)
+    (when (equal key "ITEM")
+      (error "Cannot edit item headline from here"))
+    (unless allowed
+      (error "Allowed values for this property have not been defined"))
+    (if previous (setq allowed (reverse allowed)))
+    (if (member value allowed)
+       (setq nval (car (cdr (member value allowed)))))
+    (setq nval (or nval (car allowed)))
+    (if (equal nval value)
+       (error "Only one allowed value for this property"))
+    (let ((inhibit-read-only t))
+      (remove-text-properties (1- bol) eol '(read-only t))
+      (unwind-protect
+         (progn
+           (setq org-columns-overlays 
+                 (org-delete-all line-overlays org-columns-overlays))
+           (mapc 'org-delete-overlay line-overlays)
+           (org-columns-eval '(org-entry-put pom key nval)))
+       (org-columns-display-here)))
+    (move-to-column col)
+    (if (nth 3 (assoc key org-columns-current-fmt-compiled))
+       (org-columns-update key))))
+
+(defun org-verify-version (task)
+  (cond
+   ((eq task 'columns)
+    (if (or (featurep 'xemacs)
+           (< emacs-major-version 22))
+       (error "Emacs 22 is required for the columns feature")))))
+
+(defun org-columns ()
+  "Turn on column view on an org-mode file."
+  (interactive)
+  (org-verify-version 'columns)
+  (org-columns-remove-overlays)
+  (move-marker org-columns-begin-marker (point))
+  (let (beg end fmt cache maxwidths)
+    (when (condition-case nil (org-back-to-heading) (error nil))
+      (move-marker org-entry-property-inherited-from nil)
+      (setq fmt (org-entry-get nil "COLUMNS" t)))
+    (setq fmt (or fmt org-columns-default-format))
+    (org-set-local 'org-columns-current-fmt fmt)
+    (org-columns-compile-format fmt)
+    (save-excursion
+      (if (marker-position org-entry-property-inherited-from)
+         (goto-char org-entry-property-inherited-from))
+      (setq beg (point))
+      (move-marker org-columns-top-level-marker (point))
+      (unless org-columns-inhibit-recalculation
+       (org-columns-compute-all))
+      (setq end (or (condition-case nil (org-end-of-subtree t t) (error nil))
+                   (point-max)))
+      (goto-char beg)
+      ;; Get and cache the properties
+      (while (re-search-forward (concat "^" outline-regexp) end t)
+       (push (cons (org-current-line) (org-entry-properties)) cache))
+      (when cache
+       (setq maxwidths (org-columns-get-autowidth-alist fmt cache))
+       (org-set-local 'org-columns-current-maxwidths maxwidths)
+       (goto-line (car (org-last cache)))
+       (org-columns-display-here-title)
+       (mapc (lambda (x)
+               (goto-line (car x))
+               (org-columns-display-here (cdr x)))
+             cache)))))
+
+(defun org-columns-new (&optional prop title width op fmt)
+  "Insert a new column, to the leeft o the current column."
+  (interactive)
+  (let ((editp (and prop (assoc prop org-columns-current-fmt-compiled)))
+       cell)
+    (setq prop (completing-read
+               "Property: " (mapcar 'list (org-buffer-property-keys t))
+               nil nil prop))
+    (setq title (read-string (concat "Column title [" prop "]: ") (or title prop)))
+    (setq width (read-string "Column width: " (if width (number-to-string width))))
+    (if (string-match "\\S-" width)
+       (setq width (string-to-number width))
+      (setq width nil))
+    (setq fmt (completing-read "Summary [none]: "
+                              '(("none") ("add_numbers") ("add_times") ("checkbox"))
+                              nil t))
+    (if (string-match "\\S-" fmt)
+       (setq fmt (intern fmt))
+      (setq fmt nil))
+    (if (eq fmt 'none) (setq fmt nil))
+    (if editp
+       (progn
+         (setcar editp prop)
+         (setcdr editp (list title width nil fmt)))
+      (setq cell (nthcdr (1- (current-column))
+                        org-columns-current-fmt-compiled))
+      (setcdr cell (cons (list prop title width nil fmt)
+                        (cdr cell))))
+    (org-columns-store-format)
+    (org-columns-redo)))
+
+(defun org-columns-delete ()
+  "Delete the column at point from columns view."
+  (interactive)
+  (let* ((n (current-column))
+        (title (nth 1 (nth n org-columns-current-fmt-compiled))))
+    (when (y-or-n-p
+          (format "Are you sure you want to remove column \"%s\"? " title))
+      (setq org-columns-current-fmt-compiled
+           (delq (nth n org-columns-current-fmt-compiled)
+                 org-columns-current-fmt-compiled))
+      (org-columns-store-format)
+      (org-columns-redo)
+      (if (>= (current-column) (length org-columns-current-fmt-compiled))
+         (backward-char 1)))))
+
+(defun org-columns-edit-attributes ()
+  "Edit the attributes of the current column."
+  (interactive)
+  (let* ((n (current-column))
+        (info (nth n org-columns-current-fmt-compiled)))
+    (apply 'org-columns-new info)))
+
+(defun org-columns-widen (arg)
+  "Make the column wider by ARG characters."
+  (interactive "p")
+  (let* ((n (current-column))
+        (entry (nth n org-columns-current-fmt-compiled))
+        (width (or (nth 2 entry)
+                   (cdr (assoc (car entry) org-columns-current-maxwidths)))))
+    (setq width (max 1 (+ width arg)))
+    (setcar (nthcdr 2 entry) width)
+    (org-columns-store-format)
+    (org-columns-redo)))
+
+(defun org-columns-narrow (arg)
+  "Make the column nrrower by ARG characters."
+  (interactive "p")
+  (org-columns-widen (- arg)))
+
+(defun org-columns-move-right ()
+  "Swap this column with the one to the right."
+  (interactive)
+  (let* ((n (current-column))
+        (cell (nthcdr n org-columns-current-fmt-compiled))
+        e)
+    (when (>= n (1- (length org-columns-current-fmt-compiled)))
+      (error "Cannot shift this column further to the right"))
+    (setq e (car cell))
+    (setcar cell (car (cdr cell)))
+    (setcdr cell (cons e (cdr (cdr cell))))
+    (org-columns-store-format)
+    (org-columns-redo)
+    (forward-char 1)))
+
+(defun org-columns-move-left ()
+  "Swap this column with the one to the left."
+  (interactive)
+  (let* ((n (current-column)))
+    (when (= n 0)
+      (error "Cannot shift this column further to the left"))
+    (backward-char 1)
+    (org-columns-move-right)
+    (backward-char 1)))    
+
+(defun org-columns-store-format ()
+  "Store the text version of the current columns format in appropriate place.
+This is either in the COLUMNS property of the node starting the current column
+display, or in the #+COLUMNS line of the current buffer."
+  (let (fmt)
+    (setq fmt (org-columns-uncompile-format org-columns-current-fmt-compiled))
+    (if (marker-position org-columns-top-level-marker)
+       (save-excursion
+         (goto-char org-columns-top-level-marker)
+         (if (org-entry-get nil "COLUMNS")
+             (org-entry-put nil "COLUMNS" fmt)
+           (goto-char (point-min))
+           (while (re-search-forward "^#\\+COLUMNS:.*" nil t)
+             (replace-match (concat "#+COLUMNS: " fmt t t)))))
+      (setq org-columns-current-fmt fmt))))
+
+(defvar org-overriding-columns-format nil
+  "When set, overrides any other definition.")
+(defvar org-agenda-view-columns-initially nil
+  "When set, switch to columns view immediately after creating the agenda.")
+
+(defun org-agenda-columns ()
+  "Turn on column view in the agenda."
+  (interactive)
+  (org-verify-version 'columns)
+  (org-columns-remove-overlays)
+  (move-marker org-columns-begin-marker (point))
+  (let (fmt cache maxwidths m)
+    (cond
+     ((and (local-variable-p 'org-overriding-columns-format)
+          org-overriding-columns-format)
+      (setq fmt org-overriding-columns-format))
+     ((setq m (get-text-property (point-at-bol) 'org-hd-marker))
+      (setq fmt (org-entry-get m "COLUMNS" t)))
+     ((and (boundp 'org-columns-current-fmt)
+          (local-variable-p 'org-columns-current-fmt)
+          org-columns-current-fmt)
+      (setq fmt org-columns-current-fmt))
+     ((setq m (next-single-property-change (point-min) 'org-hd-marker))
+      (setq m (get-text-property m 'org-hd-marker))
+      (setq fmt (org-entry-get m "COLUMNS" t))))
+    (setq fmt (or fmt org-columns-default-format))
+    (org-set-local 'org-columns-current-fmt fmt)
+    (org-columns-compile-format fmt)
+    (save-excursion
+      ;; Get and cache the properties
+      (goto-char (point-min))
+      (while (not (eobp))
+       (when (setq m (or (get-text-property (point) 'org-hd-marker)
+                         (get-text-property (point) 'org-marker)))
+         (push (cons (org-current-line) (org-entry-properties m)) cache))
+       (beginning-of-line 2))
+      (when cache
+       (setq maxwidths (org-columns-get-autowidth-alist fmt cache))
+       (org-set-local 'org-columns-current-maxwidths maxwidths)
+       (goto-line (car (org-last cache)))
+       (org-columns-display-here-title)
+       (mapc (lambda (x)
+               (goto-line (car x))
+               (org-columns-display-here (cdr x)))
+             cache)))))
+
+(defun org-columns-get-autowidth-alist (s cache)
+  "Derive the maximum column widths from the format and the cache."
+  (let ((start 0) rtn)
+    (while (string-match "%\\([a-zA-Z]\\S-*\\)" s start)
+      (push (cons (match-string 1 s) 1) rtn)
+      (setq start (match-end 0)))
+    (mapc (lambda (x)
+           (setcdr x (apply 'max
+                            (mapcar
+                             (lambda (y)
+                               (length (or (cdr (assoc (car x) (cdr y))) " ")))
+                             cache))))
+         rtn)
+    rtn))
+
+(defun org-columns-compute-all ()
+  "Compute all columns that have operators defined."
+  (remove-text-properties (point-min) (point-max) '(org-summaries t))
+  (let ((columns org-columns-current-fmt-compiled) col)
+    (while (setq col (pop columns))
+      (when (nth 3 col)
+       (save-excursion
+         (org-columns-compute (car col)))))))
+
+(defun org-columns-update (property)
+  "Recompute PROPERTY, and update the columns display for it."
+  (org-columns-compute property)
+  (let (fmt val pos)
+    (save-excursion
+      (mapc (lambda (ov)
+             (when (equal (org-overlay-get ov 'org-columns-key) property)
+               (setq pos (org-overlay-start ov))
+               (goto-char pos)
+               (when (setq val (cdr (assoc property
+                                           (get-text-property (point-at-bol) 'org-summaries))))
+                 (setq fmt (org-overlay-get ov 'org-columns-format))
+                 (org-overlay-put ov 'display (format fmt val)))))
+           org-columns-overlays))))
+
+(defun org-columns-compute (property)
+  "Sum the values of property PROPERTY hierarchically, for the entire buffer."
+  (interactive)
+  (let* ((re (concat "^" outline-regexp))
+        (lmax 30) ; Does anyone use deeper levels???
+        (lsum (make-vector lmax 0))
+        (level 0)
+        (ass (assoc property org-columns-current-fmt-compiled))
+        (format (nth 4 ass))
+        (beg org-columns-top-level-marker)
+        last-level val end sumpos sum-alist sum str)
+    (save-excursion
+      ;; Find the region to compute
+      (goto-char beg)
+      (setq end (condition-case nil (org-end-of-subtree t) (error (point-max))))
+      (goto-char end)
+      ;; Walk the tree from the back and do the computations
+      (while (re-search-backward re beg t)
+       (setq sumpos (match-beginning 0)
+             last-level level
+             level (org-outline-level)
+             val (org-entry-get nil property))
+       (cond
+        ((< level last-level)
+         ;; put the sum of lower levels here as a property
+         (setq sum (aref lsum last-level)
+               str (org-column-number-to-string sum format)
+               sum-alist (get-text-property sumpos 'org-summaries))
+         (if (assoc property sum-alist)
+             (setcdr (assoc property sum-alist) str)
+           (push (cons property str) sum-alist)
+           (add-text-properties sumpos (1+ sumpos)
+                                (list 'org-summaries sum-alist)))
+         (when val
+           (org-entry-put nil property str))
+         ;; add current to current  level accumulator
+         (aset lsum level (+ (aref lsum level) sum))
+         ;; clear accumulators for deeper levels
+         (loop for l from (1+ level) to (1- lmax) do (aset lsum l 0)))
+        ((>= level last-level)
+         ;; add what we have here to the accumulator for this level
+         (aset lsum level (+ (aref lsum level)
+                               (org-column-string-to-number (or val "0") format))))
+        (t (error "This should not happen")))))))
+
+(defun org-columns-redo ()
+  "Construct the column display again."
+  (interactive)
+  (message "Recomputing columns...")
+  (save-excursion
+    (if (marker-position org-columns-begin-marker)
+       (goto-char org-columns-begin-marker))
+    (org-columns-remove-overlays)
+    (if (org-mode-p)
+       (call-interactively 'org-columns)
+      (call-interactively 'org-agenda-columns)))
+  (message "Recomputing columns...done"))
+
+(defun org-columns-not-in-agenda ()
+  (if (eq major-mode 'org-agenda-mode)
+      (error "This command is only allowed in Org-mode buffers")))
+
+
+(defun org-string-to-number (s)
+  "Convert string to number, and interpret hh:mm:ss."
+  (if (not (string-match ":" s))
+      (string-to-number s)
+    (let ((l (nreverse (org-split-string s ":"))) (sum 0.0))
+      (while l
+       (setq sum (+ (string-to-number (pop l)) (/ sum 60))))
+      sum)))
+
+(defun org-column-number-to-string (n fmt)
+  "Convert a computed column number to a string value, according to FMT."
+  (cond
+   ((eq fmt 'add_times)
+    (let* ((h (floor n)) (m (floor (+ 0.5 (* 60 (- n h))))))
+      (format "%d:%02d" h m)))
+   ((eq fmt 'checkbox)
+    (cond ((= n (floor n)) "[X]")
+         ((> n 1.) "[-]")
+         (t "[ ]")))
+   (t (number-to-string n))))
+
+(defun org-column-string-to-number (s fmt)
+  "Convert a column value to a number that can be used for column computing."
+  (cond
+   ((string-match ":" s)
+    (let ((l (nreverse (org-split-string s ":"))) (sum 0.0))
+      (while l
+       (setq sum (+ (string-to-number (pop l)) (/ sum 60))))
+      sum))
+   ((eq fmt 'checkbox)
+    (if (equal s "[X]") 1. 0.000001))
+   (t (string-to-number s))))
+
+(defun org-columns-uncompile-format (cfmt)
+  "Turn the compiled columns format back into a string representation."
+  (let ((rtn "") e s prop title op width fmt)
+    (while (setq e (pop cfmt))
+      (setq prop (car e)
+           title (nth 1 e)
+           width (nth 2 e)
+           op (nth 3 e)
+           fmt (nth 4 e))
+      (cond
+       ((eq fmt 'add_times) (setq op ":"))
+       ((eq fmt 'checkbox) (setq op "X"))
+       ((eq fmt 'add_numbers) (setq op "+")))
+      (if (equal title prop) (setq title nil))
+      (setq s (concat "%" (if width (number-to-string width))
+                     prop
+                     (if title (concat "(" title ")"))
+                     (if op (concat "{" op "}"))))
+      (setq rtn (concat rtn " " s)))
+    (org-trim rtn)))
+
+(defun org-columns-compile-format (fmt)
+  "FIXME"
+  (let ((start 0) width prop title op f)
+    (setq org-columns-current-fmt-compiled nil)
+    (while (string-match "%\\([0-9]+\\)?\\([a-zA-Z_0-9]+\\)\\(?:(\\([^)]+\\))\\)?\\(?:{\\([^}]+\\)}\\)?\\s-*"
+                        fmt start)
+      (setq start (match-end 0)
+           width (match-string 1 fmt)
+           prop (match-string 2 fmt)
+           title (or (match-string 3 fmt) prop)
+           op (match-string 4 fmt)
+           f nil)
+      (if width (setq width (string-to-number width)))
+      (cond
+       ((equal op "+") (setq f 'add_numbers))
+       ((equal op ":") (setq f 'add_times))
+       ((equal op "X") (setq f 'checkbox)))
+      (push (list prop title width op f) org-columns-current-fmt-compiled))
+    (setq org-columns-current-fmt-compiled
+         (nreverse org-columns-current-fmt-compiled))))
+
+;;;; Timestamps
+
+(defvar org-last-changed-timestamp nil)
+(defvar org-time-was-given) ; dynamically scoped parameter
+(defvar org-end-time-was-given) ; dynamically scoped parameter
+(defvar org-ts-what) ; dynamically scoped parameter
+
+(defun org-time-stamp (arg)
+  "Prompt for a date/time and insert a time stamp.
+If the user specifies a time like HH:MM, or if this command is called
+with a prefix argument, the time stamp will contain date and time.
+Otherwise, only the date will be included.  All parts of a date not
+specified by the user will be filled in from the current date/time.
+So if you press just return without typing anything, the time stamp
+will represent the current date/time.  If there is already a timestamp
+at the cursor, it will be modified."
+  (interactive "P")
+  (let (org-time-was-given org-end-time-was-given time)
+    (cond
+     ((and (org-at-timestamp-p)
+          (eq last-command 'org-time-stamp)
+          (eq this-command 'org-time-stamp))
+      (insert "--")
+      (setq time (let ((this-command this-command))
+                 (org-read-date arg 'totime)))
+      (org-insert-time-stamp time (or org-time-was-given arg)))
      ((org-at-timestamp-p)
       (setq time (let ((this-command this-command))
                   (org-read-date arg 'totime)))
       (when (org-at-timestamp-p) ; just to get the match data
        (replace-match "")
        (setq org-last-changed-timestamp
-             (org-insert-time-stamp time (or org-time-was-given arg))))
+             (org-insert-time-stamp
+              time (or org-time-was-given arg)
+              nil nil nil (list org-end-time-was-given))))
       (message "Timestamp updated"))
      (t
       (setq time (let ((this-command this-command))
                   (org-read-date arg 'totime)))
-      (org-insert-time-stamp time (or org-time-was-given arg))))))
+      (org-insert-time-stamp time (or org-time-was-given arg)
+                            nil nil nil (list org-end-time-was-given))))))      
 
 (defun org-time-stamp-inactive (&optional arg)
   "Insert an inactive time stamp.
@@ -11949,9 +14556,10 @@ brackets.  It is inactive in the sense that it does not trigger agenda entries,
 does not link to the calendar and cannot be changed with the S-cursor keys.
 So these are more for recording a certain time/date."
   (interactive "P")
-  (let (org-time-was-given time)
+  (let (org-time-was-given org-end-time-was-given time)
     (setq time (org-read-date arg 'totime))
-    (org-insert-time-stamp time (or org-time-was-given arg) 'inactive)))
+    (org-insert-time-stamp time (or org-time-was-given arg) 'inactive
+                          nil nil (list org-end-time-was-given))))
 
 (defvar org-date-ovl (org-make-overlay 1 1))
 (org-overlay-put org-date-ovl 'face 'org-warning)
@@ -11960,6 +14568,7 @@ So these are more for recording a certain time/date."
 (defvar org-ans1) ; dynamically scoped parameter
 (defvar org-ans2) ; dynamically scoped parameter
 
+(defvar org-plain-time-of-day-regexp) ; defined below
 (defun org-read-date (&optional with-time to-time from-string prompt)
   "Read a date and make things smooth for the user.
 The prompt will suggest to enter an ISO date, but you can also enter anything
@@ -12014,9 +14623,9 @@ used to insert the time stamp into the buffer to include the time."
         (timestr (format-time-string
                   (if with-time "%Y-%m-%d %H:%M" "%Y-%m-%d") default-time))
         (prompt (concat (if prompt (concat prompt " ") "")
-                        (format "YYYY-MM-DD [%s]: " timestr)))
+                        (format "Date and/or time (default [%s]): " timestr)))
         ans (org-ans0 "") org-ans1 org-ans2 (deltadays 0)
-        second minute hour day month year tl wday wday1)
+        second minute hour day month year tl wday wday1 pm)
 
     (cond
      (from-string (setq ans from-string))
@@ -12027,44 +14636,43 @@ used to insert the time stamp into the buffer to include the time."
          (calendar-forward-day (- (time-to-days default-time)
                                   (calendar-absolute-from-gregorian
                                    (calendar-current-date))))
-         (org-eval-in-calendar nil)
+         (org-eval-in-calendar nil t)
          (let* ((old-map (current-local-map))
                 (map (copy-keymap calendar-mode-map))
                 (minibuffer-local-map (copy-keymap minibuffer-local-map)))
-           (define-key map (kbd "RET") 'org-calendar-select)
-           (define-key map (if (featurep 'xemacs) [button1] [mouse-1])
+           (org-defkey map (kbd "RET") 'org-calendar-select)
+           (org-defkey map (if (featurep 'xemacs) [button1] [mouse-1])
              'org-calendar-select-mouse)
-           (define-key map (if (featurep 'xemacs) [button2] [mouse-2])
+           (org-defkey map (if (featurep 'xemacs) [button2] [mouse-2])
              'org-calendar-select-mouse)
-           (define-key minibuffer-local-map [(meta shift left)]
+           (org-defkey minibuffer-local-map [(meta shift left)]
              (lambda () (interactive)
                (org-eval-in-calendar '(calendar-backward-month 1))))
-           (define-key minibuffer-local-map [(meta shift right)]
+           (org-defkey minibuffer-local-map [(meta shift right)]
              (lambda () (interactive)
                (org-eval-in-calendar '(calendar-forward-month 1))))
-           (define-key minibuffer-local-map [(shift up)]
+           (org-defkey minibuffer-local-map [(shift up)]
              (lambda () (interactive)
                (org-eval-in-calendar '(calendar-backward-week 1))))
-           (define-key minibuffer-local-map [(shift down)]
+           (org-defkey minibuffer-local-map [(shift down)]
              (lambda () (interactive)
                (org-eval-in-calendar '(calendar-forward-week 1))))
-           (define-key minibuffer-local-map [(shift left)]
+           (org-defkey minibuffer-local-map [(shift left)]
              (lambda () (interactive)
                (org-eval-in-calendar '(calendar-backward-day 1))))
-           (define-key minibuffer-local-map [(shift right)]
+           (org-defkey minibuffer-local-map [(shift right)]
              (lambda () (interactive)
                (org-eval-in-calendar '(calendar-forward-day 1))))
-           (define-key minibuffer-local-map ">"
+           (org-defkey minibuffer-local-map ">"
              (lambda () (interactive)
                (org-eval-in-calendar '(scroll-calendar-left 1))))
-           (define-key minibuffer-local-map "<"
+           (org-defkey minibuffer-local-map "<"
              (lambda () (interactive)
                (org-eval-in-calendar '(scroll-calendar-right 1))))
            (unwind-protect
                (progn
                  (use-local-map map)
                  (setq org-ans0 (read-string prompt "" nil nil))
-;                (if (not (string-match "\\S-" org-ans0)) (setq org-ans0 nil))
                  ;; org-ans0: from prompt
                  ;; org-ans1: from mouse click
                  ;; org-ans2: from calendar motion
@@ -12077,17 +14685,39 @@ used to insert the time stamp into the buffer to include the time."
     (if (string-match "^[ \t]*[-+][0-9]+[ \t]*$" org-ans0)
        (setq deltadays (string-to-number ans) ans ""))
 
-    (if (string-match
-        "^ *\\(\\([0-9]+\\)-\\)?\\([0-1]?[0-9]\\)-\\([0-3]?[0-9]\\)\\([^-0-9]\\|$\\)" ans)
-       (progn
-         (setq year (if (match-end 2)
-                        (string-to-number (match-string 2 ans))
-                      (string-to-number (format-time-string "%Y")))
-               month (string-to-number (match-string 3 ans))
-               day (string-to-number (match-string 4 ans)))
-         (if (< year 100) (setq year (+ 2000 year)))
-         (setq ans (replace-match (format "%04d-%02d-%02d\\5" year month day)
-                                  t nil ans))))
+    ;; Help matching ISO dates with single digit month ot day, like 2006-8-11.
+    (when (string-match
+          "^ *\\(\\([0-9]+\\)-\\)?\\([0-1]?[0-9]\\)-\\([0-3]?[0-9]\\)\\([^-0-9]\\|$\\)" ans)
+      (setq year (if (match-end 2)
+                    (string-to-number (match-string 2 ans))
+                  (string-to-number (format-time-string "%Y")))
+           month (string-to-number (match-string 3 ans))
+           day (string-to-number (match-string 4 ans)))
+      (if (< year 100) (setq year (+ 2000 year)))
+      (setq ans (replace-match (format "%04d-%02d-%02d\\5" year month day)
+                              t nil ans)))
+    ;; Help matching am/pm times, because `parse-time-string' does not do that.
+    ;; If there is a time with am/pm, and *no* time without it, we convert
+    ;; so that matching will be successful.
+    ;; FIXME: make this replace twice, so that we catch the end time.
+    (when (and (not (string-match "[012]?[0-9]:[0-9][0-9]\\([ \t\n]\\|$\\)" ans))
+              (string-match "\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)?\\(am\\|AM\\|pm\\|PM\\)\\>" ans))
+      (setq hour (string-to-number (match-string 1 ans))
+           minute (if (match-end 3) (string-to-number (match-string 3 ans)) 0)
+           pm (equal ?p (string-to-char (downcase (match-string 4 ans)))))
+      (if (and (= hour 12) (not pm))
+         (setq hour 0)
+       (if (and pm (< hour 12)) (setq hour (+ 12 hour))))
+      (setq ans (replace-match (format "%02d:%02d" hour minute) t t ans)))
+
+    ;; Check if there is a time range
+    (when (and (boundp 'org-end-time-was-given)
+              (string-match org-plain-time-of-day-regexp ans)
+              (match-end 8))
+      (setq org-end-time-was-given (match-string 8 ans))
+      (setq ans (concat (substring ans 0 (match-beginning 7))
+                       (substring ans (match-end 7)))))
+
     (setq tl (parse-time-string ans)
          year (or (nth 5 tl) (string-to-number (format-time-string "%Y" ct)))
          month (or (nth 4 tl) (string-to-number (format-time-string "%m" ct)))
@@ -12113,18 +14743,28 @@ used to insert the time stamp into the buffer to include the time."
          (format "%04d-%02d-%02d %02d:%02d" year month day hour minute)
        (format "%04d-%02d-%02d" year month day)))))
 
-(defun org-eval-in-calendar (form)
+(defun org-eval-in-calendar (form &optional keepdate)
   "Eval FORM in the calendar window and return to current window.
 Also, store the cursor date in variable org-ans2."
   (let ((sw (selected-window)))
     (select-window (get-buffer-window "*Calendar*"))
     (eval form)
-    (when (calendar-cursor-to-date)
+    (when (and (not keepdate) (calendar-cursor-to-date))
       (let* ((date (calendar-cursor-to-date))
             (time (encode-time 0 0 0 (nth 1 date) (nth 0 date) (nth 2 date))))
        (setq org-ans2 (format-time-string "%Y-%m-%d" time))))
     (org-move-overlay org-date-ovl (1- (point)) (1+ (point)) (current-buffer))
-    (select-window sw)))
+    (select-window sw)
+    ;; Update the prompt to show new default date
+    (save-excursion
+      (goto-char (point-min))
+      (when (and org-ans2
+                (re-search-forward "\\[[-0-9]+\\]" nil t)
+                (get-text-property (match-end 0) 'field))
+       (let ((inhibit-read-only t))
+         (replace-match (concat "[" org-ans2 "]") t t)
+         (add-text-properties (point-min) (1+ (match-end 0))
+                              (text-properties-at (1+ (point-min)))))))))
 
 (defun org-calendar-select ()
   "Return to `org-read-date' with the date currently selected.
@@ -12136,7 +14776,7 @@ This is used by `org-read-date' in a temporary keymap for the calendar buffer."
       (setq org-ans1 (format-time-string "%Y-%m-%d" time)))
     (if (active-minibuffer-window) (exit-minibuffer))))
 
-(defun org-insert-time-stamp (time &optional with-hm inactive pre post)
+(defun org-insert-time-stamp (time &optional with-hm inactive pre post extra)
   "Insert a date stamp for the date given by the internal TIME.
 WITH-HM means, use the stamp format that includes the time of the day.
 INACTIVE means use square brackets instead of angular ones, so that the
@@ -12149,6 +14789,18 @@ The command returns the inserted time stamp."
     (if inactive (setq fmt (concat "[" (substring fmt 1 -1) "]")))
     (insert (or pre ""))
     (insert (setq stamp (format-time-string fmt time)))
+    (when (listp extra)
+      (setq extra (car extra))
+      (if (and (stringp extra)
+              (string-match "\\([0-9]+\\):\\([0-9]+\\)" extra))
+         (setq extra (format "-%02d:%02d"
+                             (string-to-number (match-string 1 extra))
+                             (string-to-number (match-string 2 extra))))
+       (setq extra nil)))
+    (when extra
+      (backward-char 1)
+      (insert extra)
+      (forward-char 1))
     (insert (or post ""))
     stamp))
 
@@ -12175,17 +14827,22 @@ The command returns the inserted time stamp."
 
 (defun org-display-custom-time (beg end)
   "Overlay modified time stamp format over timestamp between BED and END."
-  (let* ((t1 (save-match-data
-              (org-parse-time-string (buffer-substring beg end) t)))
-        (w1 (- end beg))
-        (with-hm (and (nth 1 t1) (nth 2 t1)))
-        (tf (funcall (if with-hm 'cdr 'car) org-time-stamp-custom-formats))
-        (time (org-fix-decoded-time t1))
-        (str (org-add-props
+  (let* ((ts (buffer-substring beg end))
+        t1 w1 with-hm tf time str w2 (off 0))
+    (save-match-data
+      (setq t1 (org-parse-time-string ts t))
+      (if (string-match "\\(-[0-9]+:[0-9]+\\)?\\( \\+[0-9]+[dwmy]\\)?\\'" ts)
+         (setq off (- (match-end 0) (match-beginning 0)))))
+    (setq end (- end off))
+    (setq w1 (- end beg)
+         with-hm (and (nth 1 t1) (nth 2 t1))
+         tf (funcall (if with-hm 'cdr 'car) org-time-stamp-custom-formats)
+         time (org-fix-decoded-time t1)
+         str (org-add-props
                  (format-time-string
                   (substring tf 1 -1) (apply 'encode-time time))
-                 nil 'mouse-face 'highlight))
-        (w2 (length str)))
+                 nil 'mouse-face 'highlight)
+         w2 (length str))
     (if (not (= w2 w1))
        (add-text-properties (1+ beg) (+ 2 beg)
                             (list 'org-dwidth t 'org-dwidth-n (- w1 w2))))
@@ -12349,12 +15006,139 @@ days in order to avoid rounding problems."
 (defun org-time-string-to-time (s)
   (apply 'encode-time (org-parse-time-string s)))
 
+(defun org-time-string-to-absolute (s &optional daynr)
+  "Convert a time stamp to an absolute day number.
+If there is a specifyer for a cyclic time stamp, get the closest date to
+DATE."
+  (cond
+   ((and daynr (string-match "\\`%%\\((.*)\\)" s))
+    (if (org-diary-sexp-entry (match-string 1 s) "" date)
+       daynr
+      (+ daynr 1000)))
+   ((and daynr (string-match "\\+[0-9]+[dwmy]" s))
+    (org-closest-date s (if (and (boundp 'daynr) (integerp daynr)) daynr
+                         (time-to-days (current-time))) (match-string 0 s)))
+   (t (time-to-days (apply 'encode-time (org-parse-time-string s))))))
+
+(defun org-calendar-holiday ()
+  "List of holidays, for Diary display in Org-mode."
+  (let ((hl (check-calendar-holidays date)))
+    (if hl (mapconcat 'identity hl "; "))))
+
+(defun org-diary-sexp-entry (sexp entry date)
+  "Process a SEXP diary ENTRY for DATE."
+  (let ((result (if calendar-debug-sexp
+                    (let ((stack-trace-on-error t))
+                      (eval (car (read-from-string sexp))))
+                  (condition-case nil
+                      (eval (car (read-from-string sexp)))
+                    (error
+                     (beep)
+                     (message "Bad sexp at line %d in %s: %s"
+                             (org-current-line)
+                             (buffer-file-name) sexp)
+                     (sleep-for 2))))))
+    (cond ((stringp result) result)
+         ((and (consp result)
+               (stringp (cdr result))) (cdr result))
+         (result entry)
+          (t nil))))
+
+(defun org-diary-to-ical-string (frombuf)
+  "FIXME"
+  (let* ((tmpdir (if (featurep 'xemacs)
+                    (temp-directory)
+                  temporary-file-directory))
+        (tmpfile (make-temp-name
+                  (expand-file-name "orgics" tmpdir)))
+        buf rtn b e)
+    (save-excursion
+      (set-buffer frombuf)
+      (icalendar-export-region (point-min) (point-max) tmpfile)
+      (setq buf (find-buffer-visiting tmpfile))
+      (set-buffer buf)
+      (goto-char (point-min))
+      (if (re-search-forward "^BEGIN:VEVENT" nil t)
+         (setq b (match-beginning 0)))
+      (goto-char (point-max))
+      (if (re-search-backward "^END:VEVENT" nil t)
+         (setq e (match-end 0)))
+      (setq rtn (if (and b e) (concat (buffer-substring b e) "\n") "")))
+    (kill-buffer buf)
+    (kill-buffer frombuf)
+    (delete-file tmpfile)
+    rtn))
+
+(defun org-closest-date (start current change)
+  "Find the date closest to CURRENT that is consistent with START and CHANGE."
+  ;; Make the proper lists from the dates
+  (catch 'exit
+    (let ((a1 '(("d" . day) ("w" . week) ("m" . month) ("y" . year)))
+         dn dw sday cday n1 n2
+         d m y y1 y2 date1 date2 nmonths nm ny m2)
+
+      (setq start (org-date-to-gregorian start)
+           current (org-date-to-gregorian current)
+           sday (calendar-absolute-from-gregorian start)
+           cday  (calendar-absolute-from-gregorian current))
+
+      (if (<= cday sday) (throw 'exit sday))
+
+      (if (string-match "\\(\\+[0-9]+\\)\\([dwmy]\\)" change)
+         (setq dn (string-to-number (match-string 1 change))
+               dw (cdr (assoc (match-string 2 change) a1)))
+       (error "Invalid change specifyer: %s" change))
+      (if (eq dw 'week) (setq dw 'day dn (* 7 dn)))
+      (cond
+       ((eq dw 'day)
+       (setq n1 (+ sday (* dn (floor (/ (- cday sday) dn))))
+             n2 (+ n1 dn)))
+       ((eq dw 'year)
+       (setq d (nth 1 start) m (car start) y1 (nth 2 start) y2 (nth 2 current))
+       (setq y1 (+ (* (floor (/ (- y2 y1) dn)) dn) y1))
+       (setq date1 (list m d y1)
+             n1 (calendar-absolute-from-gregorian date1)
+             date2 (list m d (+ y1 (* (if (< n1 cday) 1 -1) dn)))
+             n2 (calendar-absolute-from-gregorian date2)))
+       ((eq dw 'month)
+       ;; approx number of month between the tow dates
+       (setq nmonths (floor (/ (- cday sday) 30.436875)))
+       ;; How often does dn fit in there?
+       (setq d (nth 1 start) m (car start) y (nth 2 start)
+             nm (* dn (max 0 (1- (floor (/ nmonths dn)))))
+             m (+ m nm)
+             ny (floor (/ m 12))
+             y (+ y ny)
+             m (- m (* ny 12)))
+       (while (> m 12) (setq m (- m 12) y (1+ y)))
+       (setq n1 (calendar-absolute-from-gregorian (list m d y)))
+       (setq m2 (+ m dn) y2 y)
+       (if (> m2 12) (setq y2 (1+ y2) m2 (- m2 12)))
+       (setq n2 (calendar-absolute-from-gregorian (list m2 d y2)))
+       (while (< n2 cday)
+         (setq n1 n2 m m2 y y2)
+         (setq m2 (+ m dn) y2 y)
+         (if (> m2 12) (setq y2 (1+ y2) m2 (- m2 12)))
+         (setq n2 (calendar-absolute-from-gregorian (list m2 d y2))))))
+
+      (if (> (abs (- cday n1)) (abs (- cday n2))) n2 n1))))
+
+(defun org-date-to-gregorian (date)
+  "Turn any specification of DATE into a gregorian date for the calendar."
+  (cond ((integerp date) (calendar-gregorian-from-absolute date))
+       ((and (listp date) (= (length date) 3)) date)
+       ((stringp date)
+        (setq date (org-parse-time-string date))
+        (list (nth 4 date) (nth 3 date) (nth 5 date)))
+       ((listp date)
+        (list (nth 4 date) (nth 3 date) (nth 5 date)))))
+
 (defun org-parse-time-string (s &optional nodefault)
   "Parse the standard Org-mode time string.
 This should be a lot faster than the normal `parse-time-string'.
 If time is not given, defaults to 0:00.  However, with optional NODEFAULT,
 hour and minute fields will be nil if not given."
-  (if (string-match org-ts-regexp1 s)
+  (if (string-match org-ts-regexp0 s)
       (list 0
            (if (or (match-beginning 8) (not nodefault))
                (string-to-number (or (match-string 8 s) "0")))
@@ -12425,6 +15209,9 @@ With prefix ARG, change that many days."
               ((org-pos-in-match-range pos 8)      'minute)
               ((or (org-pos-in-match-range pos 4)
                    (org-pos-in-match-range pos 5)) 'day)
+              ((and (> pos (or (match-end 8) (match-end 5)))
+                    (< pos (match-end 0)))
+               (- pos (or (match-end 8) (match-end 5))))
               (t 'day))))
     ans))
 
@@ -12436,6 +15223,7 @@ in the timestamp determines what will be changed."
   (let ((pos (point))
        with-hm inactive
        org-ts-what
+       extra
        ts time time0)
     (if (not (org-at-timestamp-p t))
        (error "Not at a timestamp"))
@@ -12445,12 +15233,15 @@ in the timestamp determines what will be changed."
             (not (get-text-property (1- (point)) 'display)))
        (setq org-ts-what 'day))
     (setq org-ts-what (or what org-ts-what)
-         with-hm (<= (abs (- (cdr org-ts-lengths)
-                             (- (match-end 0) (match-beginning 0))))
-                     1)
          inactive (= (char-after (match-beginning 0)) ?\[)
          ts (match-string 0))
     (replace-match "")
+    (if (string-match
+        "\\(\\(-[012][0-9]:[0-5][0-9]\\)?\\( \\+[0-9]+[dwmy]\\)?\\)[]>]"
+        ts)
+       (setq extra (match-string 1 ts)))
+    (if (string-match "^.\\{10\\}.*?[0-9]+:[0-9][0-9]" ts)
+       (setq with-hm t))
     (setq time0 (org-parse-time-string ts))
     (setq time
          (apply 'encode-time
@@ -12462,6 +15253,8 @@ in the timestamp determines what will be changed."
                  (list (+ (if (eq org-ts-what 'month) n 0)  (nth 4 time0)))
                  (list (+ (if (eq org-ts-what 'year) n 0)   (nth 5 time0)))
                  (nthcdr 6 time0))))
+    (when (integerp org-ts-what)
+      (setq extra (org-modify-ts-extra extra org-ts-what n)))
     (if (eq what 'calendar)
        (let ((cal-date
               (save-excursion
@@ -12476,7 +15269,7 @@ in the timestamp determines what will be changed."
          (setcar (nthcdr 2 time0) (or (nth 1 time0) 0))
          (setq time (apply 'encode-time time0))))
     (setq org-last-changed-timestamp
-         (org-insert-time-stamp time with-hm inactive))
+         (org-insert-time-stamp time with-hm inactive nil nil extra))
     (org-clock-update-time-maybe)
     (goto-char pos)
     ;; Try to recenter the calendar window, if any
@@ -12485,6 +15278,35 @@ in the timestamp determines what will be changed."
             (memq org-ts-what '(day month year)))
        (org-recenter-calendar (time-to-days time)))))
 
+(defun org-modify-ts-extra (s pos n)
+  "FIXME"
+  (let ((idx '(("d" . 0) ("w" . 1) ("m" . 2) ("y" . 3) ("d" . -1) ("y" . 4)))
+       ng h m new)
+    (when (string-match "\\(-\\([012][0-9]\\):\\([0-5][0-9]\\)\\)?\\( \\+\\([0-9]+\\)\\([dmwy]\\)\\)?" s)
+      (cond
+       ((or (org-pos-in-match-range pos 2)
+           (org-pos-in-match-range pos 3))
+       (setq m (string-to-number (match-string 3 s))
+             h (string-to-number (match-string 2 s)))
+       (if (org-pos-in-match-range pos 2)
+           (setq h (+ h n))
+         (setq m (+ m n)))
+       (if (< m 0) (setq m (+ m 60) h (1- h)))
+       (if (> m 59) (setq m (- m 60) h (1+ h)))
+       (setq h (min 24 (max 0 h)))
+       (setq ng 1 new (format "-%02d:%02d" h m)))
+       ((org-pos-in-match-range pos 6)
+       (setq ng 6 new (car (rassoc (+ n (cdr (assoc (match-string 6 s) idx))) idx))))
+       ((org-pos-in-match-range pos 5)
+       (setq ng 5 new (format "%d" (max 1 (+ n (string-to-number (match-string 5 s))))))))
+       
+      (when ng
+       (setq s (concat
+                (substring s 0 (match-beginning ng))
+                new
+                (substring s (match-end ng))))))
+    s))
+
 (defun org-recenter-calendar (date)
   "If the calendar is visible, recenter it to DATE."
   (let* ((win (selected-window))
@@ -12525,8 +15347,27 @@ If there is already a time stamp at the cursor position, update it."
 
 ;;; The clock for measuring work time.
 
+(defvar org-mode-line-string "")
+(put 'org-mode-line-string 'risky-local-variable t)
+
+(defvar org-mode-line-timer nil)
+(defvar org-clock-heading "")
+(defvar org-clock-start-time "")
+
+(defun org-update-mode-line ()
+  (let* ((delta (- (time-to-seconds (current-time))
+                   (time-to-seconds org-clock-start-time)))
+        (h (floor delta 3600))
+        (m (floor (- delta (* 3600 h)) 60)))
+    (setq org-mode-line-string
+         (propertize (format "-[%d:%02d (%s)]" h m org-clock-heading)
+                     'help-echo "Org-mode clock is running"))
+    (force-mode-line-update)))
+
 (defvar org-clock-marker (make-marker)
   "Marker recording the last clock-in.")
+(defvar org-clock-mode-line-entry nil
+  "Information for the modeline about the running clock.")
 
 (defun org-clock-in ()
   "Start the clock on the current item.
@@ -12536,6 +15377,10 @@ If necessary, clock-out of the currently active clock."
   (let (ts)
     (save-excursion
       (org-back-to-heading t)
+      (if (looking-at org-todo-line-regexp)
+         (setq org-clock-heading (match-string 3))
+       (setq org-clock-heading "???"))
+      (setq org-clock-heading (propertize org-clock-heading 'face nil))
       (beginning-of-line 2)
       (when (and (looking-at (concat "[ \t]*" org-keyword-time-regexp))
                 (not (equal (match-string 1) org-clock-string)))
@@ -12545,8 +15390,15 @@ If necessary, clock-out of the currently active clock."
       (insert "\n") (backward-char 1)
       (indent-relative)
       (insert org-clock-string " ")
+      (setq org-clock-start-time (current-time))
       (setq ts (org-insert-time-stamp (current-time) 'with-hm 'inactive))
       (move-marker org-clock-marker (point) (buffer-base-buffer))
+      (or global-mode-string (setq global-mode-string '("")))
+      (or (memq 'org-mode-line-string global-mode-string)
+         (setq global-mode-string
+               (append global-mode-string '(org-mode-line-string))))
+      (org-update-mode-line)
+      (setq org-mode-line-timer (run-with-timer 60 60 'org-update-mode-line))
       (message "Clock started at %s" ts))))
 
 (defun org-clock-out (&optional fail-quietly)
@@ -12565,7 +15417,8 @@ If there is no running clock, throw an error, unless FAIL-QUIETLY is set."
               (equal (match-string 1) org-clock-string))
          (setq ts (match-string 2))
        (if fail-quietly (throw 'exit nil) (error "Clock start time is gone")))
-      (goto-char org-clock-marker)
+      (goto-char (match-end 0))
+      (delete-region (point) (point-at-eol))
       (insert "--")
       (setq te (org-insert-time-stamp (current-time) 'with-hm 'inactive))
       (setq s (- (time-to-seconds (apply 'encode-time (org-parse-time-string te)))
@@ -12577,6 +15430,12 @@ If there is no running clock, throw an error, unless FAIL-QUIETLY is set."
       (insert " => " (format "%2d:%02d" h m))
       (move-marker org-clock-marker nil)
       (org-add-log-maybe 'clock-out)
+      (when org-mode-line-timer
+       (cancel-timer org-mode-line-timer)
+       (setq org-mode-line-timer nil))
+      (setq global-mode-string
+           (delq 'org-mode-line-string global-mode-string))
+      (force-mode-line-update)
       (message "Clock stopped at %s after HH:MM = %d:%02d" te h m)))))
 
 (defun org-clock-cancel ()
@@ -12601,7 +15460,7 @@ Puts the resulting times in minutes as a text property on each headline."
   (let* ((bmp (buffer-modified-p))
         (re (concat "^\\(\\*+\\)[ \t]\\|^[ \t]*"
                     org-clock-string
-                    "[ \t]*\\(\\[.*?\\]\\)-+\\(\\[.*?\\]\\)"))
+                    "[ \t]*\\(?:\\(\\[.*?\\]\\)-+\\(\\[.*?\\]\\)\\|=>[ \t]+\\([0-9]+\\):\\([0-9]+\\)\\)"))
         (lmax 30)
         (ltimes (make-vector lmax 0))
         (t1 0)
@@ -12612,19 +15471,24 @@ Puts the resulting times in minutes as a text property on each headline."
     (save-excursion
       (goto-char (point-max))
       (while (re-search-backward re nil t)
-       (if (match-end 2)
-           ;; A time
-           (setq ts (match-string 2)
-                 te (match-string 3)
-                 ts (time-to-seconds
-                     (apply 'encode-time (org-parse-time-string ts)))
-                 te (time-to-seconds
-                     (apply 'encode-time (org-parse-time-string te)))
-                 ts (if tstart (max ts tstart) ts)
-                 te (if tend (min te tend) te)
-                 dt (- te ts)
-                 t1 (if (> dt 0) (+ t1 (floor (/ dt 60))) t1))
-         ;; A headline
+       (cond
+        ((match-end 2)
+         ;; Two time stamps
+         (setq ts (match-string 2)
+               te (match-string 3)
+               ts (time-to-seconds
+                   (apply 'encode-time (org-parse-time-string ts)))
+               te (time-to-seconds
+                   (apply 'encode-time (org-parse-time-string te)))
+               ts (if tstart (max ts tstart) ts)
+               te (if tend (min te tend) te)
+               dt (- te ts)
+               t1 (if (> dt 0) (+ t1 (floor (/ dt 60))) t1)))
+        ((match-end 4)
+         ;; A naket time
+         (setq t1 (+ t1 (string-to-number (match-string 5))
+                     (* 60 (string-to-number (match-string 4))))))
+        (t ;; A headline
          (setq level (- (match-end 1) (match-beginning 1)))
          (when (or (> t1 0) (> (aref ltimes level) 0))
            (loop for l from 0 to level do
@@ -12633,7 +15497,7 @@ Puts the resulting times in minutes as a text property on each headline."
            (loop for l from level to (1- lmax) do
                  (aset ltimes l 0))
            (goto-char (match-beginning 0))
-           (put-text-property (point) (point-at-eol) :org-clock-minutes time))))
+           (put-text-property (point) (point-at-eol) :org-clock-minutes time)))))
       (setq org-clock-file-total-minutes (aref ltimes 0)))
     (set-buffer-modified-p bmp)))
 
@@ -12704,7 +15568,7 @@ from the `before-change-functions' in the current buffer."
 (defun org-clock-out-if-current ()
   "Clock out if the current entry contains the running clock.
 This is used to stop the clock after a TODO entry is marked DONE."
-  (when (and (equal state org-done-string)
+  (when (and (member state org-done-keywords)
             (equal (marker-buffer org-clock-marker) (current-buffer))
             (< (point) org-clock-marker)
             (> (save-excursion (outline-next-heading) (point))
@@ -12861,7 +15725,7 @@ the returned times will be formatted strings."
       (when (setq time (get-text-property p :org-clock-minutes))
        (save-excursion
          (beginning-of-line 1)
-         (when (and (looking-at "\\(\\*+\\)[ \t]+\\(.*?\\)\\([ \t]+:[0-9a-zA-Z_@:]+:\\)?[ \t]*$")
+         (when (and (looking-at (org-re "\\(\\*+\\)[ \t]+\\(.*?\\)\\([ \t]+:[[:alnum:]_@:]+:\\)?[ \t]*$"))
                     (setq level (- (match-end 1) (match-beginning 1)))
                     (<= level maxlevel))
            (setq hlc (if emph (or (cdr (assoc level hlchars)) "") "")
@@ -12984,86 +15848,91 @@ The following commands are available:
 
 (substitute-key-definition 'undo 'org-agenda-undo
                           org-agenda-mode-map global-map)
-(define-key org-agenda-mode-map "\C-i"     'org-agenda-goto)
-(define-key org-agenda-mode-map [(tab)]    'org-agenda-goto)
-(define-key org-agenda-mode-map "\C-m"     'org-agenda-switch-to)
-(define-key org-agenda-mode-map "\C-k"     'org-agenda-kill)
-(define-key org-agenda-mode-map "\C-c$"    'org-agenda-archive)
-(define-key org-agenda-mode-map "\C-c\C-x\C-s" 'org-agenda-archive)
-(define-key org-agenda-mode-map "$"        'org-agenda-archive)
-(define-key org-agenda-mode-map "\C-c\C-o" 'org-agenda-open-link)
-(define-key org-agenda-mode-map " "        'org-agenda-show)
-(define-key org-agenda-mode-map "\C-c\C-t" 'org-agenda-todo)
-(define-key org-agenda-mode-map "\C-c\C-xb" 'org-agenda-tree-to-indirect-buffer)
-(define-key org-agenda-mode-map "b"        'org-agenda-tree-to-indirect-buffer)
-(define-key org-agenda-mode-map "o"        'delete-other-windows)
-(define-key org-agenda-mode-map "L"        'org-agenda-recenter)
-(define-key org-agenda-mode-map "t"        'org-agenda-todo)
-(define-key org-agenda-mode-map "a"        'org-agenda-toggle-archive-tag)
-(define-key org-agenda-mode-map ":"        'org-agenda-set-tags)
-(define-key org-agenda-mode-map "."        'org-agenda-goto-today)
-(define-key org-agenda-mode-map "d"        'org-agenda-day-view)
-(define-key org-agenda-mode-map "w"        'org-agenda-week-view)
-(define-key org-agenda-mode-map (org-key 'S-right) 'org-agenda-date-later)
-(define-key org-agenda-mode-map (org-key 'S-left) 'org-agenda-date-earlier)
-(define-key org-agenda-mode-map [?\C-c ?\C-x (right)] 'org-agenda-date-later)
-(define-key org-agenda-mode-map [?\C-c ?\C-x (left)] 'org-agenda-date-earlier)
-
-(define-key org-agenda-mode-map ">" 'org-agenda-date-prompt)
-(define-key org-agenda-mode-map "\C-c\C-s" 'org-agenda-schedule)
-(define-key org-agenda-mode-map "\C-c\C-d" 'org-agenda-deadline)
+(org-defkey org-agenda-mode-map "\C-i"     'org-agenda-goto)
+(org-defkey org-agenda-mode-map [(tab)]    'org-agenda-goto)
+(org-defkey org-agenda-mode-map "\C-m"     'org-agenda-switch-to)
+(org-defkey org-agenda-mode-map "\C-k"     'org-agenda-kill)
+(org-defkey org-agenda-mode-map "\C-c$"    'org-agenda-archive)
+(org-defkey org-agenda-mode-map "\C-c\C-x\C-s" 'org-agenda-archive)
+(org-defkey org-agenda-mode-map "$"        'org-agenda-archive)
+(org-defkey org-agenda-mode-map "\C-c\C-o" 'org-agenda-open-link)
+(org-defkey org-agenda-mode-map " "        'org-agenda-show)
+(org-defkey org-agenda-mode-map "\C-c\C-t" 'org-agenda-todo)
+(org-defkey org-agenda-mode-map [(control shift right)] 'org-agenda-todo-nextset)
+(org-defkey org-agenda-mode-map [(control shift left)]  'org-agenda-todo-previousset)
+(org-defkey org-agenda-mode-map "\C-c\C-xb" 'org-agenda-tree-to-indirect-buffer)
+(org-defkey org-agenda-mode-map "b"        'org-agenda-tree-to-indirect-buffer)
+(org-defkey org-agenda-mode-map "o"        'delete-other-windows)
+(org-defkey org-agenda-mode-map "L"        'org-agenda-recenter)
+(org-defkey org-agenda-mode-map "t"        'org-agenda-todo)
+(org-defkey org-agenda-mode-map "a"        'org-agenda-toggle-archive-tag)
+(org-defkey org-agenda-mode-map ":"        'org-agenda-set-tags)
+(org-defkey org-agenda-mode-map "."        'org-agenda-goto-today)
+(org-defkey org-agenda-mode-map "d"        'org-agenda-day-view)
+(org-defkey org-agenda-mode-map "w"        'org-agenda-week-view)
+(org-defkey org-agenda-mode-map "m"        'org-agenda-month-view)
+(org-defkey org-agenda-mode-map "y"        'org-agenda-year-view)
+(org-defkey org-agenda-mode-map [(shift right)] 'org-agenda-date-later)
+(org-defkey org-agenda-mode-map [(shift left)] 'org-agenda-date-earlier)
+(org-defkey org-agenda-mode-map [?\C-c ?\C-x (right)] 'org-agenda-date-later)
+(org-defkey org-agenda-mode-map [?\C-c ?\C-x (left)] 'org-agenda-date-earlier)
+
+(org-defkey org-agenda-mode-map ">" 'org-agenda-date-prompt)
+(org-defkey org-agenda-mode-map "\C-c\C-s" 'org-agenda-schedule)
+(org-defkey org-agenda-mode-map "\C-c\C-d" 'org-agenda-deadline)
 (let ((l '(1 2 3 4 5 6 7 8 9 0)))
-  (while l (define-key org-agenda-mode-map
+  (while l (org-defkey org-agenda-mode-map
             (int-to-string (pop l)) 'digit-argument)))
 
-(define-key org-agenda-mode-map "f" 'org-agenda-follow-mode)
-(define-key org-agenda-mode-map "l" 'org-agenda-log-mode)
-(define-key org-agenda-mode-map "D" 'org-agenda-toggle-diary)
-(define-key org-agenda-mode-map "g" 'org-agenda-toggle-time-grid)
-(define-key org-agenda-mode-map "r" 'org-agenda-redo)
-(define-key org-agenda-mode-map "q" 'org-agenda-quit)
-(define-key org-agenda-mode-map "x" 'org-agenda-exit)
-(define-key org-agenda-mode-map "s" 'org-save-all-org-buffers)
-(define-key org-agenda-mode-map "P" 'org-agenda-show-priority)
-(define-key org-agenda-mode-map "T" 'org-agenda-show-tags)
-(define-key org-agenda-mode-map "n" 'next-line)
-(define-key org-agenda-mode-map "p" 'previous-line)
-(define-key org-agenda-mode-map "\C-n" 'org-agenda-next-date-line)
-(define-key org-agenda-mode-map "\C-p" 'org-agenda-previous-date-line)
-(define-key org-agenda-mode-map "," 'org-agenda-priority)
-(define-key org-agenda-mode-map "\C-c," 'org-agenda-priority)
-(define-key org-agenda-mode-map "i" 'org-agenda-diary-entry)
-(define-key org-agenda-mode-map "c" 'org-agenda-goto-calendar)
+(org-defkey org-agenda-mode-map "f" 'org-agenda-follow-mode)
+(org-defkey org-agenda-mode-map "l" 'org-agenda-log-mode)
+(org-defkey org-agenda-mode-map "D" 'org-agenda-toggle-diary)
+(org-defkey org-agenda-mode-map "g" 'org-agenda-toggle-time-grid)
+(org-defkey org-agenda-mode-map "r" 'org-agenda-redo)
+(org-defkey org-agenda-mode-map "q" 'org-agenda-quit)
+(org-defkey org-agenda-mode-map "x" 'org-agenda-exit)
+(org-defkey org-agenda-mode-map "\C-x\C-w" 'org-write-agenda)
+(org-defkey org-agenda-mode-map "s" 'org-save-all-org-buffers)
+(org-defkey org-agenda-mode-map "P" 'org-agenda-show-priority)
+(org-defkey org-agenda-mode-map "T" 'org-agenda-show-tags)
+(org-defkey org-agenda-mode-map "n" 'next-line)
+(org-defkey org-agenda-mode-map "p" 'previous-line)
+(org-defkey org-agenda-mode-map "\C-n" 'org-agenda-next-date-line)
+(org-defkey org-agenda-mode-map "\C-p" 'org-agenda-previous-date-line)
+(org-defkey org-agenda-mode-map "," 'org-agenda-priority)
+(org-defkey org-agenda-mode-map "\C-c," 'org-agenda-priority)
+(org-defkey org-agenda-mode-map "i" 'org-agenda-diary-entry)
+(org-defkey org-agenda-mode-map "c" 'org-agenda-goto-calendar)
 (eval-after-load "calendar"
-  '(define-key calendar-mode-map org-calendar-to-agenda-key
+  '(org-defkey calendar-mode-map org-calendar-to-agenda-key
      'org-calendar-goto-agenda))
-(define-key org-agenda-mode-map "C" 'org-agenda-convert-date)
-(define-key org-agenda-mode-map "m" 'org-agenda-phases-of-moon)
-(define-key org-agenda-mode-map "M" 'org-agenda-phases-of-moon)
-(define-key org-agenda-mode-map "S" 'org-agenda-sunrise-sunset)
-(define-key org-agenda-mode-map "h" 'org-agenda-holidays)
-(define-key org-agenda-mode-map "H" 'org-agenda-holidays)
-(define-key org-agenda-mode-map "+" 'org-agenda-priority-up)
-(define-key org-agenda-mode-map "I" 'org-agenda-clock-in)
-(define-key org-agenda-mode-map "O" 'org-agenda-clock-out)
-(define-key org-agenda-mode-map "X" 'org-agenda-clock-cancel)
-(define-key org-agenda-mode-map "-" 'org-agenda-priority-down)
-(define-key org-agenda-mode-map (org-key 'S-up) 'org-agenda-priority-up)
-(define-key org-agenda-mode-map (org-key 'S-down) 'org-agenda-priority-down)
-(define-key org-agenda-mode-map [?\C-c ?\C-x (up)] 'org-agenda-priority-up)
-(define-key org-agenda-mode-map [?\C-c ?\C-x (down)] 'org-agenda-priority-down)
-(define-key org-agenda-mode-map [(right)] 'org-agenda-later)
-(define-key org-agenda-mode-map [(left)] 'org-agenda-earlier)
-(define-key org-agenda-mode-map "\C-c\C-x\C-c" 'org-export-icalendar-combine-agenda-files)
+(org-defkey org-agenda-mode-map "C" 'org-agenda-convert-date)
+(org-defkey org-agenda-mode-map "M" 'org-agenda-phases-of-moon)
+(org-defkey org-agenda-mode-map "S" 'org-agenda-sunrise-sunset)
+(org-defkey org-agenda-mode-map "h" 'org-agenda-holidays)
+(org-defkey org-agenda-mode-map "H" 'org-agenda-holidays)
+(org-defkey org-agenda-mode-map "I" 'org-agenda-clock-in)
+(org-defkey org-agenda-mode-map "O" 'org-agenda-clock-out)
+(org-defkey org-agenda-mode-map "X" 'org-agenda-clock-cancel)
+(org-defkey org-agenda-mode-map "+" 'org-agenda-priority-up)
+(org-defkey org-agenda-mode-map "-" 'org-agenda-priority-down)
+(org-defkey org-agenda-mode-map [(shift up)] 'org-agenda-priority-up)
+(org-defkey org-agenda-mode-map [(shift down)] 'org-agenda-priority-down)
+(org-defkey org-agenda-mode-map [?\C-c ?\C-x (up)] 'org-agenda-priority-up)
+(org-defkey org-agenda-mode-map [?\C-c ?\C-x (down)] 'org-agenda-priority-down)
+(org-defkey org-agenda-mode-map [(right)] 'org-agenda-later)
+(org-defkey org-agenda-mode-map [(left)] 'org-agenda-earlier)
+(org-defkey org-agenda-mode-map "\C-c\C-x\C-c" 'org-agenda-columns)
+
 (defvar org-agenda-keymap (copy-keymap org-agenda-mode-map)
   "Local keymap for agenda entries from Org-mode.")
 
-(define-key org-agenda-keymap
+(org-defkey org-agenda-keymap
   (if (featurep 'xemacs) [(button2)] [(mouse-2)]) 'org-agenda-goto-mouse)
-(define-key org-agenda-keymap
+(org-defkey org-agenda-keymap
   (if (featurep 'xemacs) [(button3)] [(mouse-3)]) 'org-agenda-show-mouse)
 (when org-agenda-mouse-1-follows-link
-  (define-key org-agenda-keymap [follow-link] 'mouse-face))
+  (org-defkey org-agenda-keymap [follow-link] 'mouse-face))
 (easy-menu-define org-agenda-menu org-agenda-mode-map "Agenda menu"
   '("Agenda"
     ("Agenda Files")
@@ -13083,16 +15952,18 @@ The following commands are available:
     ["Next Dates" org-agenda-later (org-agenda-check-type nil 'agenda)]
     ["Previous Dates" org-agenda-earlier (org-agenda-check-type nil 'agenda)]
     "--"
-    ("Tags"
+    ("Tags and Properties"
      ["Show all Tags" org-agenda-show-tags t]
-     ["Set Tags" org-agenda-set-tags t])
+     ["Set Tags" org-agenda-set-tags t]
+     "--"
+     ["Column View" org-columns t])
     ("Date/Schedule"
      ["Schedule" org-agenda-schedule t]
      ["Set Deadline" org-agenda-deadline t]
      "--"
-     ["Change date +1 day" org-agenda-date-later (org-agenda-check-type nil 'agenda 'timeline)]
-     ["Change date -1 day" org-agenda-date-earlier (org-agenda-check-type nil 'agenda 'timeline)]
-     ["Change date to ..." org-agenda-date-prompt (org-agenda-check-type nil 'agenda 'timeline)])
+     ["Change Date +1 day" org-agenda-date-later (org-agenda-check-type nil 'agenda 'timeline)]
+     ["Change Date -1 day" org-agenda-date-earlier (org-agenda-check-type nil 'agenda 'timeline)]
+     ["Change Date to ..." org-agenda-date-prompt (org-agenda-check-type nil 'agenda 'timeline)])
     ("Priority"
      ["Set Priority" org-agenda-priority t]
      ["Increase Priority" org-agenda-priority-up t]
@@ -13113,6 +15984,10 @@ The following commands are available:
       :style radio :selected (equal org-agenda-ndays 1)]
      ["Week View" org-agenda-week-view :active (org-agenda-check-type nil 'agenda)
       :style radio :selected (equal org-agenda-ndays 7)]
+     ["Month View" org-agenda-month-view :active (org-agenda-check-type nil 'agenda)
+      :style radio :selected (member org-agenda-ndays '(28 29 30 31))]
+     ["Year View" org-agenda-year-view :active (org-agenda-check-type nil 'agenda)
+      :style radio :selected (member org-agenda-ndays '(365 366))]
      "--"
      ["Show Logbook entries" org-agenda-log-mode
       :style toggle :selected org-agenda-show-log :active (org-agenda-check-type nil 'agenda 'timeline)]
@@ -13120,6 +15995,7 @@ The following commands are available:
       :style toggle :selected org-agenda-include-diary :active (org-agenda-check-type nil 'agenda)]
      ["Use Time Grid" org-agenda-toggle-time-grid
       :style toggle :selected org-agenda-use-time-grid :active (org-agenda-check-type nil 'agenda)])
+    ["Write view to file" org-write-agenda t]
     ["Rebuild buffer" org-agenda-redo t]
     ["Save all Org-mode Buffers" org-save-all-org-buffers t]
     "--"
@@ -13230,7 +16106,8 @@ T     Call `org-todo-list' to display the global todo list, select only
 m     Call `org-tags-view' to display headlines with tags matching
       a condition  (the user is prompted for the condition).
 M     Like `m', but select only TODO entries, no ordinary headlines.
-l     Create a timeeline for the current buffer.
+l     Create a timeline for the current buffer.
+e     Export views to associated files.
 
 More commands can be added by configuring the variable
 `org-agenda-custom-commands'.  In particular, specific tags and TODO keyword
@@ -13261,7 +16138,7 @@ next use of \\[org-agenda]) restricted to the current file."
                  (let ((header
 "Press key for an agenda command:
 --------------------------------         C   Configure custom agenda commands
-a   Agenda for current week or day
+a   Agenda for current week or day       e   Export agenda views
 t   List of all TODO entries             T   Entries with special TODO kwd
 m   Match a TAGS query                   M   Like m, but only TODO entries
 L   Timeline for current buffer          #   List stuck projects (!=configure)
@@ -13279,6 +16156,9 @@ L   Timeline for current buffer          #   List stuck projects (!=configure)
                              '(face bold))
                          (cond
                           ((stringp type) type)
+                          ((eq type 'agenda) "Agenda for current week or day")
+                          ((eq type 'alltodo) "List of all TODO entries")
+                          ((eq type 'stuck) "List of stuck projects")
                           ((eq type 'todo) "TODO keyword")
                           ((eq type 'tags) "Tags query")
                           ((eq type 'tags-todo) "Tags (TODO)")
@@ -13333,6 +16213,13 @@ L   Timeline for current buffer          #   List stuck projects (!=configure)
              (setq type (nth 1 entry) match (nth 2 entry) lprops (nth 3 entry)
                    lprops (nth 3 entry))
              (cond
+              ((eq type 'agenda)
+               (org-let lprops '(org-agenda-list current-prefix-arg)))
+              ((eq type 'alltodo)
+               (org-let lprops '(org-todo-list current-prefix-arg)))
+              ((eq type 'stuck)
+               (org-let lprops '(org-agenda-list-stuck-projects
+                                 current-prefix-arg)))
               ((eq type 'tags)
                (org-let lprops '(org-tags-view current-prefix-arg match)))
               ((eq type 'tags-todo)
@@ -13353,13 +16240,14 @@ L   Timeline for current buffer          #   List stuck projects (!=configure)
               ((fboundp type)
                (org-let lprops '(funcall type match)))
               (t (error "Invalid custom agenda command type %s" type))))
-         (org-run-agenda-series (cddr entry))))
+         (org-run-agenda-series (nth 1 entry) (cddr entry))))
        ((equal c ?C) (customize-variable 'org-agenda-custom-commands))
        ((equal c ?a) (call-interactively 'org-agenda-list))
        ((equal c ?t) (call-interactively 'org-todo-list))
        ((equal c ?T) (org-call-with-arg 'org-todo-list (or arg '(4))))
        ((equal c ?m) (call-interactively 'org-tags-view))
        ((equal c ?M) (org-call-with-arg 'org-tags-view (or arg '(4))))
+       ((equal c ?e) (call-interactively 'org-store-agenda-views))
        ((equal c ?L)
        (unless restrict-ok
          (error "This is not an Org-mode file"))
@@ -13368,10 +16256,10 @@ L   Timeline for current buffer          #   List stuck projects (!=configure)
        ((equal c ?!) (customize-variable 'org-stuck-projects))
        (t (error "Invalid key"))))))
 
-(defun org-run-agenda-series (series)
-  (org-prepare-agenda)
+(defun org-run-agenda-series (name series)
+  (org-prepare-agenda name)
   (let* ((org-agenda-multi t)
-        (redo (list 'org-run-agenda-series (list 'quote series)))
+        (redo (list 'org-run-agenda-series name (list 'quote series)))
         (cmds (car series))
         (gprops (nth 1 series))
         match ;; The byte compiler incorrectly complains about this.  Keep it!
@@ -13380,11 +16268,14 @@ L   Timeline for current buffer          #   List stuck projects (!=configure)
       (setq type (car cmd) match (nth 1 cmd) lprops (nth 2 cmd))
       (cond
        ((eq type 'agenda)
-       (call-interactively 'org-agenda-list))
+       (org-let2 gprops lprops
+         '(call-interactively 'org-agenda-list)))
        ((eq type 'alltodo)
-       (call-interactively 'org-todo-list))
+       (org-let2 gprops lprops
+         '(call-interactively 'org-todo-list)))
        ((eq type 'stuck)
-       (call-interactively 'org-agenda-list-stuck-projects))
+       (org-let2 gprops lprops
+         '(call-interactively 'org-agenda-list-stuck-projects)))
        ((eq type 'tags)
        (org-let2 gprops lprops
                  '(org-tags-view current-prefix-arg match)))
@@ -13405,17 +16296,210 @@ L   Timeline for current buffer          #   List stuck projects (!=configure)
 
 ;;;###autoload
 (defmacro org-batch-agenda (cmd-key &rest parameters)
-  "Run an agenda command in batch mode, send result to STDOUT.
-CMD-KEY is a string that is also a key in `org-agenda-custom-commands'.
+  "Run an agenda command in batch mode and send the result to STDOUT.
+If CMD-KEY is a string of length 1, it is used as a key in
+`org-agenda-custom-commands' and triggers this command.  If it is a
+longer string is is used as a tags/todo match string.
 Paramters are alternating variable names and values that will be bound
 before running the agenda command."
   (let (pars)
     (while parameters
       (push (list (pop parameters) (if parameters (pop parameters))) pars))
-    (flet ((read-char-exclusive () (string-to-char cmd-key)))
-      (eval (list 'let (nreverse pars) '(org-agenda nil))))
+    (if (> (length cmd-key) 1)
+       (eval (list 'let (nreverse pars)
+                   (list 'org-tags-view nil cmd-key)))
+      (flet ((read-char-exclusive () (string-to-char cmd-key)))
+       (eval (list 'let (nreverse pars) '(org-agenda nil)))))
+    (set-buffer "*Org Agenda*")
+    (princ (org-encode-for-stdout (buffer-string)))))
+
+(defun org-encode-for-stdout (string)
+  (if (fboundp 'encode-coding-string)
+      (encode-coding-string string buffer-file-coding-system)
+    string))
+
+(defvar org-agenda-info nil)
+
+;;;###autoload
+(defmacro org-batch-agenda-csv (cmd-key &rest parameters)
+  "Run an agenda command in batch mode and send the result to STDOUT.
+If CMD-KEY is a string of length 1, it is used as a key in
+`org-agenda-custom-commands' and triggers this command.  If it is a
+longer string is is used as a tags/todo match string.
+Paramters are alternating variable names and values that will be bound
+before running the agenda command.
+
+The output gives a line for each selected agenda item.  Each
+item is a list of comma-separated values, like this:
+
+category,head,type,todo,tags,date,time,extra,priority-l,priority-n
+
+category     The category of the item
+head         The headline, without TODO kwd, TAGS and PRIORITY
+type         The type of the agenda entry, can be
+                todo               selected in TODO match
+                tagsmatch          selected in tags match
+                diary              imported from diary
+                deadline           a deadline on given date
+                scheduled          scheduled on given date
+                timestamp          entry has timestamp on given date
+                closed             entry was closed on given date
+                upcoming-deadline  warning about deadline
+                past-scheduled     forwarded scheduled item
+                block              entry has date block including g. date
+todo         The todo keyword, if any
+tags         All tags including inherited ones, separated by colons
+date         The relevant date, like 2007-2-14
+time         The time, like 15:00-16:50
+extra        Sting with extra planning info
+priority-l   The priority letter if any was given
+priority-n   The computed numerical priority
+agenda-day   The day in the agenda where this is listed"
+
+  (let (pars)
+    (while parameters
+      (push (list (pop parameters) (if parameters (pop parameters))) pars))
+    (push (list 'org-agenda-remove-tags t) pars)
+    (if (> (length cmd-key) 1)
+       (eval (list 'let (nreverse pars)
+                   (list 'org-tags-view nil cmd-key)))
+      (flet ((read-char-exclusive () (string-to-char cmd-key)))
+       (eval (list 'let (nreverse pars) '(org-agenda nil)))))
     (set-buffer "*Org Agenda*")
-    (princ (buffer-string))))
+    (let* ((lines (org-split-string (buffer-string) "\n"))
+          line)
+      (while (setq line (pop lines))
+       (catch 'next
+         (if (not (get-text-property 0 'org-category line)) (throw 'next nil))
+         (setq org-agenda-info
+               (org-fix-agenda-info (text-properties-at 0 line)))
+         (princ
+          (org-encode-for-stdout
+           (mapconcat 'org-agenda-export-csv-mapper
+                      '(org-category txt type todo tags date time-of-day extra
+                                     priority-letter priority agenda-day)
+                     ",")))
+         (princ "\n"))))))
+
+(defun org-fix-agenda-info (props)
+  "FIXME"
+  (let (tmp re)
+    (when (setq tmp (plist-get props 'tags))
+      (setq props (plist-put props 'tags (mapconcat 'identity tmp ":"))))
+    (when (setq tmp (plist-get props 'date))
+      (if (integerp tmp) (setq tmp (calendar-gregorian-from-absolute tmp)))
+      (let ((calendar-date-display-form '(year "-" month "-" day)))
+       '((format "%4d, %9s %2s, %4s" dayname monthname day year))
+
+       (setq tmp (calendar-date-string tmp)))
+      (setq props (plist-put props 'date tmp)))
+    (when (setq tmp (plist-get props 'day))
+      (if (integerp tmp) (setq tmp (calendar-gregorian-from-absolute tmp)))
+      (let ((calendar-date-display-form '(year "-" month "-" day)))
+       (setq tmp (calendar-date-string tmp)))
+      (setq props (plist-put props 'day tmp))
+      (setq props (plist-put props 'agenda-day tmp)))
+    (when (setq tmp (plist-get props 'txt))
+      (when (string-match "\\[#\\([A-Z0-9]\\)\\] ?" tmp)
+       (plist-put props 'priority-letter (match-string 1 tmp))
+       (setq tmp (replace-match "" t t tmp)))
+      (when (and (setq re (plist-get props 'org-todo-regexp))
+                (setq re (concat "\\`\\.*" re " ?"))
+                (string-match re tmp))
+       (plist-put props 'todo (match-string 1 tmp))
+       (setq tmp (replace-match "" t t tmp)))
+      (plist-put props 'txt tmp)))
+  props)
+
+(defun org-agenda-export-csv-mapper (prop)
+  (let ((res (plist-get org-agenda-info prop)))
+    (setq res
+         (cond
+          ((not res) "")
+          ((stringp res) res)
+          (t (prin1-to-string res))))
+    (while (string-match "," res)
+      (setq res (replace-match ";" t t res)))
+    (org-trim res)))
+
+
+;;;###autoload
+(defun org-store-agenda-views (&rest parameters)
+  (interactive)
+  (eval (list 'org-batch-store-agenda-views)))
+
+(defvar org-agenda-buffer-name)
+
+;; FIXME, why is this a macro?????
+;;;###autoload
+(defmacro org-batch-store-agenda-views (&rest parameters)
+  "Run all custom agenda commands that have a file argument."
+  (let ((cmds org-agenda-custom-commands)
+       (dir (default-directory))
+       pars cmd thiscmdkey files opts)
+    (while parameters
+      (push (list (pop parameters) (if parameters (pop parameters))) pars))
+    (setq pars (reverse pars))
+    (save-window-excursion
+      (while cmds
+       (setq cmd (pop cmds)
+             thiscmdkey (car cmd)
+             opts (nth 3 cmd)
+             files (org-last cmd))
+       (if (stringp files) (setq files (list files)))
+       (when files
+         (flet ((read-char-exclusive () (string-to-char thiscmdkey)))
+           (eval (list 'let (append org-agenda-exporter-settings opts pars)
+                       '(org-agenda nil))))
+         (set-buffer "*Org Agenda*")
+         (while files
+           (eval (list 'let (append org-agenda-exporter-settings opts pars)
+                       (list 'org-write-agenda
+                             (expand-file-name (pop files) dir) t)))))
+       (kill-buffer org-agenda-buffer-name)))))
+
+(defun org-write-agenda (file &optional nosettings)
+  "Write the current buffer (an agenda view) as a file.
+Depending on the extension of the file name, plain text (.txt),
+HTML (.html or .htm) or Postscript (.ps) is produced.
+If NOSETTINGS is given, do not scope the settings of
+`org-agenda-exporter-settings' into the export commands.  This is used when
+the settings have already been scoped and we do not wish to overrule other,
+higher priority settings."
+  (interactive "FWrite agenda to file: ")
+  (if (not (file-writable-p file))
+      (error "Cannot write agenda to file %s" file))
+  (cond
+   ((string-match "\\.html?\\'" file) (require 'htmlize))
+   ((string-match "\\.ps\\'" file) (require 'ps-print)))
+  (org-let (if nosettings nil org-agenda-exporter-settings)
+    '(save-excursion
+       (save-window-excursion
+        (cond
+         ((string-match "\\.html?\\'" file)
+          (set-buffer (htmlize-buffer (current-buffer)))
+
+          (when (and org-agenda-export-html-style
+                     (string-match "<style>" org-agenda-export-html-style))
+            ;; replace <style> section with org-agenda-export-html-style
+            (goto-char (point-min))
+            (kill-region (- (search-forward "<style") 6)
+                         (search-forward "</style>"))
+            (insert org-agenda-export-html-style))
+          (write-file file)
+          (kill-buffer (current-buffer))
+          (message "HTML written to %s" file))
+         ((string-match "\\.ps\\'" file)
+          (ps-print-buffer-with-faces file)
+          (message "Postscript written to %s" file))
+         (t
+          (let ((bs (buffer-string)))
+            (find-file file)
+            (insert bs)
+            (save-buffer 0)
+            (kill-buffer (current-buffer))
+            (message "Plain text written to %s" file))))))
+    (set-buffer org-agenda-buffer-name)))
 
 (defmacro org-no-read-only (&rest body)
   "Inhibit read-only for BODY."
@@ -13508,13 +16592,6 @@ If the current buffer does not, find the first agenda file."
       (find-file (car fs)))
     (if (buffer-base-buffer) (switch-to-buffer (buffer-base-buffer)))))
 
-(defun org-agenda-file-to-end ()
-  "Move/add the current file to the end of the agenda file list.
-If the file is not present in the list, it is appended to the list.  If it is
-present, it is moved there."
-  (interactive)
-  (org-agenda-file-to-front 'to-end))
-
 (defun org-agenda-file-to-front (&optional to-end)
   "Move/add the current file to the top of the agenda file list.
 If the file is not present in the list, it is added to the front.  If it is
@@ -13578,7 +16655,10 @@ Optional argument FILE means, use this file instead of the current."
 (defvar org-agenda-multi nil)  ; dynammically scoped
 (defvar org-agenda-buffer-name "*Org Agenda*")
 (defvar org-pre-agenda-window-conf nil)
-(defun org-prepare-agenda ()
+(defvar org-agenda-name nil)
+(defun org-prepare-agenda (&optional name)
+  (setq org-todo-keywords-for-agenda nil)
+  (setq org-done-keywords-for-agenda nil)
   (if org-agenda-multi
       (progn
        (setq buffer-read-only nil)
@@ -13588,6 +16668,10 @@ Optional argument FILE means, use this file instead of the current."
        (narrow-to-region (point) (point-max)))
     (org-agenda-maybe-reset-markers 'force)
     (org-prepare-agenda-buffers (org-agenda-files))
+    (setq org-todo-keywords-for-agenda
+         (org-uniquify org-todo-keywords-for-agenda))
+    (setq org-done-keywords-for-agenda
+         (org-uniquify org-done-keywords-for-agenda))
     (let* ((abuf (get-buffer-create org-agenda-buffer-name))
           (awin (get-buffer-window abuf)))
       (cond
@@ -13605,19 +16689,30 @@ Optional argument FILE means, use this file instead of the current."
        (switch-to-buffer-other-window abuf))))
     (setq buffer-read-only nil)
     (erase-buffer)
-    (org-agenda-mode))
+    (org-agenda-mode)
+    (and name (not org-agenda-name)
+        (org-set-local 'org-agenda-name name)))
   (setq buffer-read-only nil))
 
 (defun org-finalize-agenda ()
   "Finishing touch for the agenda buffer, called just before displaying it."
   (unless org-agenda-multi
-    (org-agenda-align-tags)
     (save-excursion
       (let ((buffer-read-only))
        (goto-char (point-min))
        (while (org-activate-bracket-links (point-max))
          (add-text-properties (match-beginning 0) (match-end 0)
-                              '(face org-link))))
+                              '(face org-link)))
+       (org-agenda-align-tags)
+       (unless org-agenda-with-colors
+         (remove-text-properties (point-min) (point-max) '(face nil))))
+      (if (and (boundp 'org-overriding-columns-format)
+              org-overriding-columns-format)
+         (org-set-local 'org-overriding-columns-format
+                        org-overriding-columns-format))
+      (if (and (boundp 'org-agenda-view-columns-initially)
+              org-agenda-view-columns-initially)
+         (org-agenda-columns))
       (run-hooks 'org-finalize-agenda-hook))))
 
 (defun org-prepare-agenda-buffers (files)
@@ -13635,6 +16730,10 @@ Optional argument FILE means, use this file instead of the current."
          (set-buffer (org-get-agenda-file-buffer file))
          (widen)
          (setq bmp (buffer-modified-p))
+         (setq org-todo-keywords-for-agenda
+               (append org-todo-keywords-for-agenda org-todo-keywords-1))
+         (setq org-done-keywords-for-agenda
+               (append org-done-keywords-for-agenda org-done-keywords))
          (save-excursion
            (remove-text-properties (point-min) (point-max) pall)
            (when org-agenda-skip-archived-trees
@@ -13733,9 +16832,13 @@ When a buffer is unmodified, it is just killed.  When modified, it is saved
   "Get the table of categories and positions in current buffer."
   (let (tbl)
     (save-excursion
-      (goto-char (point-min))
-      (while (re-search-forward "\\(^\\|\r\\)#\\+CATEGORY:[ \t]*\\(.*\\)" nil t)
-       (push (cons (point) (org-trim (match-string 2))) tbl)))
+      (save-restriction
+       (widen)
+       (goto-char (point-min))
+       (while (re-search-forward "^#\\+CATEGORY:[ \t]*\\(.*\\)"
+                                 nil t)
+         (push (cons (match-beginning 1)
+                     (org-trim (match-string 1))) tbl))))
     tbl))
 
 (defun org-get-category (&optional pos)
@@ -13792,16 +16895,18 @@ dates."
        (setq day-numbers (delq nil (mapcar (lambda(x)
                                              (if (>= x today) x nil))
                                            day-numbers))))
-    (org-prepare-agenda)
+    (org-prepare-agenda (concat "Timeline "
+                               (file-name-nondirectory buffer-file-name)))
     (if doclosed (push :closed args))
     (push :timestamp args)
+    (push :sexp args)
     (if dotodo (push :todo args))
     (while (setq d (pop day-numbers))
       (if (and (listp d) (eq (car d) :omitted))
          (progn
            (setq s (point))
            (insert (format "\n[... %d empty days omitted]\n\n" (cdr d)))
-           (put-text-property s (1- (point)) 'face 'org-level-3))
+           (put-text-property s (1- (point)) 'face 'org-agenda-structure))
        (if (listp d) (setq d (car d) emptyp t) (setq emptyp nil))
        (if (and (>= d today)
                 dopast
@@ -13824,7 +16929,7 @@ dates."
 ;            (insert (format-time-string org-agenda-date-format
 ;                                        (calendar-time-from-absolute d 0))
 ;                    "\n")
-             (put-text-property s (1- (point)) 'face 'org-level-3)
+             (put-text-property s (1- (point)) 'face 'org-agenda-structure)
              (put-text-property s (1- (point)) 'org-date-line t)
              (if (equal d today)
                  (put-text-property s (1- (point)) 'org-today t))
@@ -13880,9 +16985,11 @@ When EMPTY is non-nil, also include days without any entries."
 ;;; Agenda Daily/Weekly
 
 (defvar org-agenda-overriding-arguments nil) ; dynamically scoped parameter
+(defvar org-agenda-start-day nil) ; dynamically scoped parameter
 (defvar org-agenda-last-arguments nil
   "The arguments of the previous call to org-agenda")
 (defvar org-starting-day nil) ; local variable in the agenda buffer
+(defvar org-agenda-span nil) ; local variable in the agenda buffer
 (defvar org-include-all-loc nil) ; local variable
 
 
@@ -13900,18 +17007,22 @@ START-DAY defaults to TODAY, or to the most recent match for the weekday
 given in `org-agenda-start-on-weekday'.
 NDAYS defaults to `org-agenda-ndays'."
   (interactive "P")
+  (setq ndays (or ndays org-agenda-ndays)
+       start-day (or start-day org-agenda-start-day))
   (if org-agenda-overriding-arguments
       (setq include-all (car org-agenda-overriding-arguments)
            start-day (nth 1 org-agenda-overriding-arguments)
            ndays (nth 2 org-agenda-overriding-arguments)))
+  (if (stringp start-day)
+      ;; Convert to an absolute day number
+      (setq start-day (time-to-days (org-read-date nil t start-day))))
   (setq org-agenda-last-arguments (list include-all start-day ndays))
   (org-compile-prefix-format 'agenda)
   (org-set-sorting-strategy 'agenda)
   (require 'calendar)
   (let* ((org-agenda-start-on-weekday
-         (if (or (equal ndays 1)
-                 (and (null ndays) (equal 1 org-agenda-ndays)))
-             nil org-agenda-start-on-weekday))
+         (if (or (equal ndays 7) (and (null ndays) (equal 7 org-agenda-ndays)))
+             org-agenda-start-on-weekday nil))
         (thefiles (org-agenda-files))
         (files thefiles)
         (today (time-to-days (current-time)))
@@ -13936,9 +17047,11 @@ NDAYS defaults to `org-agenda-ndays'."
       (push (1+ (car day-numbers)) day-numbers)
       (setq ndays (1- ndays)))
     (setq day-numbers (nreverse day-numbers))
-    (org-prepare-agenda)
+    (org-prepare-agenda "Day/Week")
     (org-set-local 'org-starting-day (car day-numbers))
     (org-set-local 'org-include-all-loc include-all)
+    (org-set-local 'org-agenda-span
+                  (org-agenda-ndays-to-span nd))
     (when (and (or include-all org-agenda-include-all-todo)
               (member today day-numbers))
       (setq files thefiles
@@ -13953,11 +17066,13 @@ NDAYS defaults to `org-agenda-ndays'."
       (when rtnall
        (insert "ALL CURRENTLY OPEN TODO ITEMS:\n")
        (add-text-properties (point-min) (1- (point))
-                            (list 'face 'org-level-3))
+                            (list 'face 'org-agenda-structure))
        (insert (org-finalize-agenda-entries rtnall) "\n")))
     (setq s (point))
-    (insert (if (= nd 7) "Week-" "Day-") "agenda:\n")
-    (add-text-properties s (1- (point)) (list 'face 'org-level-3))
+    (insert (capitalize (symbol-name (org-agenda-ndays-to-span nd)))
+           "-agenda:\n")
+    (add-text-properties s (1- (point)) (list 'face 'org-agenda-structure
+                                             'org-date-line t))
     (while (setq d (pop day-numbers))
       (setq date (calendar-gregorian-from-absolute d)
            s (point))
@@ -13974,10 +17089,10 @@ NDAYS defaults to `org-agenda-ndays'."
          (if org-agenda-show-log
              (setq rtn (org-agenda-get-day-entries
                         file date
-                        :deadline :scheduled :timestamp :closed))
+                        :deadline :scheduled :timestamp :sexp :closed))
            (setq rtn (org-agenda-get-day-entries
                       file date
-                      :deadline :scheduled :timestamp)))
+                      :deadline :scheduled :sexp :timestamp)))
          (setq rtnall (append rtnall rtn))))
       (if org-agenda-include-diary
          (progn
@@ -13994,7 +17109,7 @@ NDAYS defaults to `org-agenda-ndays'."
 ; FIXME: this gives a timezone problem
 ;          (insert (format-time-string org-agenda-date-format
 ;                                      (calendar-time-from-absolute d 0)) "\n")
-           (put-text-property s (1- (point)) 'face 'org-level-3)
+           (put-text-property s (1- (point)) 'face 'org-agenda-structure)
            (put-text-property s (1- (point)) 'org-date-line t)
            (if todayp (put-text-property s (1- (point)) 'org-today t))
            (if rtnall (insert
@@ -14019,6 +17134,9 @@ NDAYS defaults to `org-agenda-ndays'."
     (setq buffer-read-only t)
     (message "")))
 
+(defun org-agenda-ndays-to-span (n)
+  (cond ((< n 7) 'day) ((= n 7) 'week) ((< n 32) 'month) (t 'year)))
+
 ;;; Agenda TODO list
 
 (defvar org-select-this-todo-keyword nil)
@@ -14030,28 +17148,27 @@ NDAYS defaults to `org-agenda-ndays'."
 The prefix arg can be used to select a specific TODO keyword and limit
 the list to these.  When using \\[universal-argument], you will be prompted
 for a keyword.  A numeric prefix directly selects the Nth keyword in
-`org-todo-keywords'."
+`org-todo-keywords-1'."
   (interactive "P")
   (require 'calendar)
   (org-compile-prefix-format 'todo)
   (org-set-sorting-strategy 'todo)
+  (org-prepare-agenda "TODO")
   (let* ((today (time-to-days (current-time)))
         (date (calendar-gregorian-from-absolute today))
-        (kwds org-todo-keywords)
+        (kwds org-todo-keywords-for-agenda)
         (completion-ignore-case t)
         (org-select-this-todo-keyword
          (if (stringp arg) arg
            (and arg (integerp arg) (> arg 0)
-                 (nth (1- arg) org-todo-keywords))))
+                 (nth (1- arg) kwds))))
         rtn rtnall files file pos)
     (when (equal arg '(4))
       (setq org-select-this-todo-keyword
-           (completing-read "Keyword: " (mapcar 'list org-todo-keywords)
-                            nil t)))
+           (completing-read "Keyword (or KWD1|K2D2|...): "
+                            (mapcar 'list kwds) nil nil)))
     (and (equal 0 arg) (setq org-select-this-todo-keyword nil))
-    (org-prepare-agenda)
     (org-set-local 'org-last-arg arg)
-    (org-set-local 'org-todo-keywords kwds)
     (setq org-agenda-redo-command
          '(org-todo-list (or current-prefix-arg org-last-arg)))
     (setq files (org-agenda-files)
@@ -14063,23 +17180,25 @@ for a keyword.  A numeric prefix directly selects the Nth keyword in
        (setq rtnall (append rtnall rtn))))
     (if org-agenda-overriding-header
        (insert (org-add-props (copy-sequence org-agenda-overriding-header)
-                   nil 'face 'org-level-3) "\n")
+                   nil 'face 'org-agenda-structure) "\n")
       (insert "Global list of TODO items of type: ")
       (add-text-properties (point-min) (1- (point))
-                          (list 'face 'org-level-3))
+                          (list 'face 'org-agenda-structure))
       (setq pos (point))
       (insert (or org-select-this-todo-keyword "ALL") "\n")
       (add-text-properties pos (1- (point)) (list 'face 'org-warning))
       (setq pos (point))
       (unless org-agenda-multi
-       (insert
-        "Available with `N r': (0)ALL "
-        (let ((n 0))
-          (mapconcat (lambda (x)
-                       (format "(%d)%s" (setq n (1+ n)) x))
-                     org-todo-keywords " "))
-        "\n"))
-      (add-text-properties pos (1- (point)) (list 'face 'org-level-3)))
+       (insert "Available with `N r': (0)ALL")
+       (let ((n 0) s)
+         (mapc (lambda (x)
+                 (setq s (format "(%d)%s" (setq n (1+ n)) x))
+                 (if (> (+ (current-column) (string-width s) 1) (frame-width))
+                     (insert "\n                     "))
+                 (insert " " s))
+               kwds))
+       (insert "\n"))
+      (add-text-properties pos (1- (point)) (list 'face 'org-agenda-structure)))
     (when rtnall
       (insert (org-finalize-agenda-entries rtnall) "\n"))
     (goto-char (point-min))
@@ -14104,7 +17223,7 @@ The prefix arg TODO-ONLY limits the search to TODO entries."
         buffer)
     (setq matcher (org-make-tags-matcher match)
          match (car matcher) matcher (cdr matcher))
-    (org-prepare-agenda)
+    (org-prepare-agenda (concat "TAGS " match))
     (setq org-agenda-redo-command
          (list 'org-tags-view (list 'quote todo-only)
                (list 'if 'current-prefix-arg nil match)))
@@ -14135,17 +17254,17 @@ The prefix arg TODO-ONLY limits the search to TODO entries."
                (setq rtnall (append rtnall rtn))))))))
     (if org-agenda-overriding-header
        (insert (org-add-props (copy-sequence org-agenda-overriding-header)
-                   nil 'face 'org-level-3) "\n")
+                   nil 'face 'org-agenda-structure) "\n")
       (insert "Headlines with TAGS match: ")
       (add-text-properties (point-min) (1- (point))
-                          (list 'face 'org-level-3))
+                          (list 'face 'org-agenda-structure))
       (setq pos (point))
       (insert match "\n")
       (add-text-properties pos (1- (point)) (list 'face 'org-warning))
       (setq pos (point))
       (unless org-agenda-multi
        (insert "Press `C-u r' to search again with new search string\n"))
-      (add-text-properties pos (1- (point)) (list 'face 'org-level-3)))
+      (add-text-properties pos (1- (point)) (list 'face 'org-agenda-structure)))
     (when rtnall
       (insert (org-finalize-agenda-entries rtnall) "\n"))
     (goto-char (point-min))
@@ -14187,21 +17306,34 @@ MATCH is being ignored."
         (org-agenda-overriding-header "List of stuck projects: ")
         (matcher (nth 0 org-stuck-projects))
         (todo (nth 1 org-stuck-projects))
-        (tags (nth 2 org-stuck-projects))
+        (todo-wds (if (member "*" todo)
+                      (progn
+                        (org-prepare-agenda-buffers (org-agenda-files))
+                        (org-delete-all
+                         org-done-keywords-for-agenda
+                         (copy-sequence org-todo-keywords-for-agenda)))
+                    todo))
         (todo-re (concat "^\\*+[ \t]+\\("
-                         (mapconcat 'identity todo "\\|")
+                         (mapconcat 'identity todo-wds "\\|")
                          "\\)\\>"))
-        (tags-re (concat "^\\*+.*:\\("
-                         (mapconcat 'identity tags "\\|")
-                         "\\):[a-zA-Z0-9_@:]*[ \t]*$")))
-
+        (tags (nth 2 org-stuck-projects))
+        (tags-re (if (member "*" tags)
+                     (org-re "^\\*+ .*:[[:alnum:]_@]+:[ \t]*$")
+                   (concat "^\\*+ .*:\\("
+                           (mapconcat 'identity tags "\\|")
+                           (org-re "\\):[[:alnum:]_@:]*[ \t]*$"))))
+        (gen-re (nth 3 org-stuck-projects))
+        (re-list
+         (delq nil
+               (list
+                (if todo todo-re)
+                (if tags tags-re)
+                (and gen-re (stringp gen-re) (string-match "\\S-" gen-re)
+                     gen-re)))))
     (setq org-agenda-skip-regexp
-         (cond
-          ((and todo tags)
-           (concat todo-re "\\|" tags-re))
-          (todo todo-re)
-          (tags tags-re)
-          (t (error "No information how to identify unstuck projects"))))
+         (if re-list
+             (mapconcat 'identity re-list "\\|")
+           (error "No information how to identify unstuck projects")))
     (org-tags-view nil matcher)
     (with-current-buffer org-agenda-buffer-name
       (setq org-agenda-redo-command
@@ -14247,7 +17379,8 @@ MATCH is being ignored."
             (lambda (x)
               (setq x (org-format-agenda-item "" x "Diary" nil 'time))
               ;; Extend the text properties to the beginning of the line
-              (org-add-props x (text-properties-at (1- (length x)) x)))
+              (org-add-props x (text-properties-at (1- (length x)) x)
+                'type "diary" 'date date))
             entries)))))
 
 (defun org-agenda-cleanup-fancy-diary ()
@@ -14289,8 +17422,10 @@ date.  It also removes lines that contain only whitespace."
   (org-add-props string nil
     'mouse-face 'highlight
     'keymap org-agenda-keymap
-    'help-echo (format "mouse-2 or RET jump to diary file %s"
-                      (abbreviate-file-name buffer-file-name))
+    'help-echo (if buffer-file-name
+                  (format "mouse-2 or RET jump to diary file %s"
+                          (abbreviate-file-name buffer-file-name))
+                "")
     'org-agenda-diary-link t
     'org-marker (org-agenda-new-marker (point-at-bol))))
 
@@ -14316,6 +17451,8 @@ items should be listed.  The following arguments are allowed:
                 date range matching the selected date.  Deadlines will
                 also be listed, on the expiration day.
 
+   :sexp         FIXME
+
    :deadline     List any deadlines past due, or due within
                 `org-deadline-warning-days'.  The listing occurs only
                 in the diary for *today*, not at any other date.  If
@@ -14340,10 +17477,10 @@ all files listed in `org-agenda-files' will be checked automatically:
    &%%(org-diary)
 
 If you don't give any arguments (as in the example above), the default
-arguments (:deadline :scheduled :timestamp) are used.  So the example above may
-also be written as
+arguments (:deadline :scheduled :timestamp :sexp) are used.
+So the example above may also be written as
 
-   &%%(org-diary :deadline :timestamp :scheduled)
+   &%%(org-diary :deadline :timestamp :sexp :scheduled)
 
 The function expects the lisp variables `entry' and `date' to be provided
 by the caller, because this is how the calendar works.  Don't use this
@@ -14351,11 +17488,12 @@ function from a program - use `org-agenda-get-day-entries' instead."
   (org-agenda-maybe-reset-markers)
   (org-compile-prefix-format 'agenda)
   (org-set-sorting-strategy 'agenda)
-  (setq args (or args '(:deadline :scheduled :timestamp)))
+  (setq args (or args '(:deadline :scheduled :timestamp :sexp)))
   (let* ((files (if (and entry (stringp entry) (string-match "\\S-" entry))
                    (list entry)
                  (org-agenda-files t)))
         file rtn results)
+    (org-prepare-agenda-buffers files)
     ;; If this is called during org-agenda, don't return any entries to
     ;; the calendar.  Org Agenda will list these entries itself.
     (if org-disable-agenda-to-diary (setq files nil))
@@ -14373,7 +17511,7 @@ FILE is the path to a file to be checked for entries.  DATE is date like
 the one returned by `calendar-current-date'.  ARGS are symbols indicating
 which kind of entries should be extracted.  For details about these, see
 the documentation of `org-diary'."
-  (setq args (or args '(:deadline :scheduled :timestamp)))
+  (setq args (or args '(:deadline :scheduled :timestamp :sexp)))
   (let* ((org-startup-folded nil)
         (org-startup-align-all-tables nil)
         (buffer (if (file-exists-p file)
@@ -14406,6 +17544,9 @@ the documentation of `org-diary'."
                  (setq results (append results rtn))
                  (setq rtn (org-agenda-get-timestamps))
                  (setq results (append results rtn)))
+                ((eq arg :sexp)
+                 (setq rtn (org-agenda-get-sexps))
+                 (setq results (append results rtn)))
                 ((eq arg :scheduled)
                  (setq rtn (org-agenda-get-scheduled))
                  (setq results (append results rtn)))
@@ -14418,10 +17559,12 @@ the documentation of `org-diary'."
                  (setq results (append results rtn))))))))
        results))))
 
+;; FIXME: this works only if the cursor is not at the
+;; beginning of the entry
 (defun org-entry-is-done-p ()
   "Is the current entry marked DONE?"
   (save-excursion
-    (and (re-search-backward "[\r\n]\\*" nil t)
+    (and (re-search-backward "[\r\n]\\* " nil t)
         (looking-at org-nl-done-regexp))))
 
 (defun org-at-date-range-p (&optional inactive-ok)
@@ -14447,15 +17590,20 @@ the documentation of `org-diary'."
   (let* ((props (list 'face nil
                      'done-face 'org-done
                      'org-not-done-regexp org-not-done-regexp
+                     'org-todo-regexp org-todo-regexp
                      'mouse-face 'highlight
                      'keymap org-agenda-keymap
                      'help-echo
                      (format "mouse-2 or RET jump to org file %s"
                              (abbreviate-file-name buffer-file-name))))
-        (regexp (concat "[\n\r]\\*+ *\\("
+        ;; FIXME: get rid of the \n at some point  but watch out
+        (regexp (concat "\n\\*+[ \t]+\\("
                         (if org-select-this-todo-keyword
-                            (concat "\\<\\(" org-select-this-todo-keyword
-                                    "\\)\\>")
+                            (if (equal org-select-this-todo-keyword "*")
+                                org-todo-regexp
+                              (concat "\\<\\("
+                                      (mapconcat 'identity (org-split-string org-select-this-todo-keyword "|") "\\|")
+                                    "\\)\\>"))
                           org-not-done-regexp)
                         "[^\n\r]*\\)"))
         marker priority category tags
@@ -14481,16 +17629,11 @@ the documentation of `org-diary'."
              category (org-get-category)
              tags (org-get-tags-at (point))
              txt (org-format-agenda-item "" (match-string 1) category tags)
-             priority
-             (+ (org-get-priority txt)
-                (if org-todo-kwd-priority-p
-                    (- org-todo-kwd-max-priority -2
-                       (length
-                        (member (match-string 2) org-todo-keywords)))
-                    1)))
+             priority (1+ (org-get-priority txt)))
        (org-add-props txt props
          'org-marker marker 'org-hd-marker marker
-         'priority priority 'org-category category)
+         'priority priority 'org-category category
+         'type "todo")
        (push txt ee)
        (if org-agenda-todo-list-sublevels
            (goto-char (match-end 1))
@@ -14504,48 +17647,71 @@ the documentation of `org-diary'."
   "Return the date stamp information for agenda display."
   (let* ((props (list 'face nil
                      'org-not-done-regexp org-not-done-regexp
+                     'org-todo-regexp org-todo-regexp
                      'mouse-face 'highlight
                      'keymap org-agenda-keymap
                      'help-echo
                      (format "mouse-2 or RET jump to org file %s"
                              (abbreviate-file-name buffer-file-name))))
-        (regexp (regexp-quote
-                 (substring
-                  (format-time-string
-                   (car org-time-stamp-formats)
-                   (apply 'encode-time  ; DATE bound by calendar
-                          (list 0 0 0 (nth 1 date) (car date) (nth 2 date))))
-                  0 11)))
+;????   (regexp (regexp-quote
+;                (substring
+;                 (format-time-string
+;                  (car org-time-stamp-formats)
+;                  (apply 'encode-time  ; DATE bound by calendar
+;                         (list 0 0 0 (nth 1 date) (car date) (nth 2 date))))
+;                 0 11)))
+        (d1 (calendar-absolute-from-gregorian date))
+        (regexp
+         (concat
+          (regexp-quote
+           (substring
+            (format-time-string
+             (car org-time-stamp-formats)
+             (apply 'encode-time  ; DATE bound by calendar
+                    (list 0 0 0 (nth 1 date) (car date) (nth 2 date))))
+            0 11))
+          "\\|\\(<[0-9]+-[0-9]+-[0-9]+[^>\n]+?\\+[0-9]+[dwmy]>\\)"
+          "\\|\\(<%%\\(([^>\n]+)\\)>\\)"))
         marker hdmarker deadlinep scheduledp donep tmp priority category
-        ee txt timestr tags)
+        ee txt timestr tags b0 b3 e3)
     (goto-char (point-min))
     (while (re-search-forward regexp nil t)
+      (setq b0 (match-beginning 0)
+           b3 (match-beginning 3) e3 (match-end 3))
       (catch :skip
-       (and (save-match-data (org-at-date-range-p)) (throw :skip nil))
+       (and (org-at-date-range-p) (throw :skip nil))
        (org-agenda-skip)
-       (setq marker (org-agenda-new-marker (match-beginning 0))
-             category (org-get-category (match-beginning 0))
+       (if (and (match-end 1)
+                (not (= d1 (org-time-string-to-absolute (match-string 1) d1))))
+           (throw :skip nil))
+       (if (and e3
+                (not (org-diary-sexp-entry (buffer-substring b3 e3) "" date)))
+           (throw :skip nil))
+       (setq marker (org-agenda-new-marker b0)
+             category (org-get-category b0)
              tmp (buffer-substring (max (point-min)
-                                        (- (match-beginning 0)
-                                           org-ds-keyword-length))
-                                   (match-beginning 0))
-             timestr (buffer-substring (match-beginning 0) (point-at-eol))
+                                        (- b0 org-ds-keyword-length))
+                                   b0)
+             timestr (if b3 "" (buffer-substring b0 (point-at-eol)))
              deadlinep (string-match org-deadline-regexp tmp)
              scheduledp (string-match org-scheduled-regexp tmp)
              donep (org-entry-is-done-p))
        (and org-agenda-skip-scheduled-if-done
             scheduledp donep
             (throw :skip t))
+       (and org-agenda-skip-deadline-if-done
+            deadlinep donep
+            (throw :skip t))
        (if (string-match ">" timestr)
            ;; substring should only run to end of time stamp
            (setq timestr (substring timestr 0 (match-end 0))))
        (save-excursion
-         (if (re-search-backward "\\(^\\|\r\\)\\*+" nil t)
+         (if (re-search-backward "^\\*+ " nil t)
              (progn
-               (goto-char (match-end 1))
+               (goto-char (match-beginning 0))
                (setq hdmarker (org-agenda-new-marker)
                      tags (org-get-tags-at))
-               (looking-at "\\*+[ \t]*\\([^\r\n]+\\)")
+               (looking-at "\\*+[ \t]+\\([^\r\n]+\\)")
                (setq txt (org-format-agenda-item
                           (format "%s%s"
                                   (if deadlinep  "Deadline:  " "")
@@ -14558,22 +17724,68 @@ the documentation of `org-diary'."
          (if deadlinep
              (org-add-props txt nil
                'face (if donep 'org-done 'org-warning)
+               'type "deadline" 'date date
                'undone-face 'org-warning 'done-face 'org-done
                'org-category category 'priority (+ 100 priority))
            (if scheduledp
                (org-add-props txt nil
                  'face 'org-scheduled-today
+                 'type "scheduled" 'date date
                  'undone-face 'org-scheduled-today 'done-face 'org-done
                  'org-category category 'priority (+ 99 priority))
-             (org-add-props txt nil 'priority priority 'org-category category)))
+             (org-add-props txt nil 'priority priority
+                            'org-category category 'date date
+                            'type "timestamp")))
          (push txt ee))
        (outline-next-heading)))
     (nreverse ee)))
 
+(defun org-agenda-get-sexps ()
+  "Return the sexp information for agenda display."
+  (require 'diary-lib)
+  (let* ((props (list 'face nil
+                     'mouse-face 'highlight
+                     'keymap org-agenda-keymap
+                     'help-echo
+                     (format "mouse-2 or RET jump to org file %s"
+                             (abbreviate-file-name buffer-file-name))))
+        (regexp "^&?%%(")
+        marker category ee txt tags entry result beg b sexp sexp-entry)
+    (goto-char (point-min))
+    (while (re-search-forward regexp nil t)
+      (catch :skip
+       (org-agenda-skip)
+       (setq beg (match-beginning 0))
+       (goto-char (1- (match-end 0)))
+       (setq b (point))
+       (forward-sexp 1)
+       (setq sexp (buffer-substring b (point)))
+       (setq sexp-entry (if (looking-at "[ \t]*\\(\\S-.*\\)")
+                            (org-trim (match-string 1))
+                          ""))
+       (setq result (org-diary-sexp-entry sexp sexp-entry date))
+       (when result
+         (setq marker (org-agenda-new-marker beg)
+               category (org-get-category beg))
+
+         (if (string-match "\\S-" result)
+             (setq txt result)
+           (setq txt "SEXP entry returned empty string"))
+
+         (setq txt (org-format-agenda-item
+                     "" txt category tags 'time))
+         (org-add-props txt props 'org-marker marker)
+         (org-add-props txt nil
+           'org-category category 'date date
+           'type "sexp")
+         (push txt ee))))
+    (nreverse ee)))
+
 (defun org-agenda-get-closed ()
   "Return the logged TODO entries for agenda display."
   (let* ((props (list 'mouse-face 'highlight
                      'org-not-done-regexp org-not-done-regexp
+                     'org-todo-regexp org-todo-regexp
                      'keymap org-agenda-keymap
                      'help-echo
                      (format "mouse-2 or RET jump to org file %s"
@@ -14603,12 +17815,12 @@ the documentation of `org-diary'."
            ;; substring should only run to end of time stamp
            (setq timestr (substring timestr 0 (match-end 0))))
        (save-excursion
-         (if (re-search-backward "\\(^\\|\r\\)\\*+" nil t)
+         (if (re-search-backward "^\\*+ " nil t)
              (progn
-               (goto-char (match-end 1))
+               (goto-char (match-beginning 0))
                (setq hdmarker (org-agenda-new-marker)
                      tags (org-get-tags-at))
-               (looking-at "\\*+[ \t]*\\([^\r\n]+\\)")
+               (looking-at "\\*+[ \t]+\\([^\r\n]+\\)")
                (setq txt (org-format-agenda-item
                           (if closedp "Closed:    " "Clocked:   ")
                           (match-string 1) category tags timestr)))
@@ -14617,6 +17829,7 @@ the documentation of `org-diary'."
          (org-add-props txt props
            'org-marker marker 'org-hd-marker hdmarker 'face 'org-done
            'priority priority 'org-category category
+           'type "closed" 'date date
            'undone-face 'org-warning 'done-face 'org-done)
          (push txt ee))
        (outline-next-heading)))
@@ -14627,6 +17840,7 @@ the documentation of `org-diary'."
   (let* ((wdays org-deadline-warning-days)
         (props (list 'mouse-face 'highlight
                      'org-not-done-regexp org-not-done-regexp
+                     'org-todo-regexp org-todo-regexp
                      'keymap org-agenda-keymap
                      'help-echo
                      (format "mouse-2 or RET jump to org file %s"
@@ -14641,8 +17855,9 @@ the documentation of `org-diary'."
       (catch :skip
        (org-agenda-skip)
        (setq pos (1- (match-beginning 1))
-             d2 (time-to-days
-                 (org-time-string-to-time (match-string 1)))
+;???         d2 (time-to-days
+;???             (org-time-string-to-time (match-string 1)))
+             d2 (org-time-string-to-absolute (match-string 1) d1)
              diff (- d2 d1))
        ;; When to show a deadline in the calendar:
        ;; If the expiration is within wdays warning time.
@@ -14650,10 +17865,10 @@ the documentation of `org-diary'."
        (if (and (< diff wdays) todayp (not (= diff 0)))
            (save-excursion
              (setq category (org-get-category))
-             (if (re-search-backward "\\(^\\|\r\\)\\*+[ \t]*" nil t)
+             (if (re-search-backward "^\\*+[ \t]+" nil t)
                  (progn
                    (goto-char (match-end 0))
-                   (setq pos1 (match-end 1))
+                   (setq pos1 (match-beginning 0))
                    (setq tags (org-get-tags-at pos1))
                    (setq head (buffer-substring-no-properties
                                (point)
@@ -14673,6 +17888,7 @@ the documentation of `org-diary'."
                  'org-hd-marker (org-agenda-new-marker pos1)
                  'priority (+ (- 10 diff) (org-get-priority txt))
                  'org-category category
+                 'type "upcoming-deadline" 'date d2
                  'face face 'undone-face face 'done-face 'org-done)
                (push txt ee))))))
     ee))
@@ -14681,6 +17897,7 @@ the documentation of `org-diary'."
   "Return the scheduled information for agenda display."
   (let* ((props (list 'face 'org-scheduled-previously
                      'org-not-done-regexp org-not-done-regexp
+                     'org-todo-regexp org-todo-regexp
                      'undone-face 'org-scheduled-previously
                      'done-face 'org-done
                      'mouse-face 'highlight
@@ -14698,18 +17915,19 @@ the documentation of `org-diary'."
       (catch :skip
        (org-agenda-skip)
        (setq pos (1- (match-beginning 1))
-             d2 (time-to-days
-                 (org-time-string-to-time (match-string 1)))
+             d2 (org-time-string-to-absolute (match-string 1) d1)
+;???         d2 (time-to-days
+;???             (org-time-string-to-time (match-string 1)))
              diff (- d2 d1))
        ;; When to show a scheduled item in the calendar:
        ;; If it is on or past the date.
        (if (and (< diff 0) todayp)
            (save-excursion
              (setq category (org-get-category))
-             (if (re-search-backward "\\(^\\|\r\\)\\*+[ \t]*" nil t)
+             (if (re-search-backward "^\\*+[ \t]+" nil t)
                  (progn
                    (goto-char (match-end 0))
-                   (setq pos1 (match-end 1))
+                   (setq pos1 (match-beginning 0))
                    (setq tags (org-get-tags-at))
                    (setq head (buffer-substring-no-properties
                                (point)
@@ -14724,6 +17942,7 @@ the documentation of `org-diary'."
                (org-add-props txt props
                  'org-marker (org-agenda-new-marker pos)
                  'org-hd-marker (org-agenda-new-marker pos1)
+                 'type "past-scheduled" 'date d2
                  'priority (+ (- 5 diff) (org-get-priority txt))
                  'org-category category)
                (push txt ee))))))
@@ -14733,6 +17952,7 @@ the documentation of `org-diary'."
   "Return the date-range information for agenda display."
   (let* ((props (list 'face nil
                      'org-not-done-regexp org-not-done-regexp
+                     'org-todo-regexp org-todo-regexp
                      'mouse-face 'highlight
                      'keymap org-agenda-keymap
                      'help-echo
@@ -14757,12 +17977,12 @@ the documentation of `org-diary'."
            (save-excursion
              (setq marker (org-agenda-new-marker (point)))
              (setq category (org-get-category))
-             (if (re-search-backward "\\(^\\|\r\\)\\*+" nil t)
+             (if (re-search-backward "^\\*+ " nil t)
                  (progn
-                   (setq hdmarker (org-agenda-new-marker (match-end 1)))
-                   (goto-char (match-end 1))
+                   (goto-char (match-beginning 0))
+                   (setq hdmarker (org-agenda-new-marker (point)))
                    (setq tags (org-get-tags-at))
-                   (looking-at "\\*+[ \t]*\\([^\r\n]+\\)")
+                   (looking-at "\\*+[ \t]+\\([^\r\n]+\\)")
                    (setq txt (org-format-agenda-item
                               (format (if (= d1 d2) "" "(%d/%d): ")
                                       (1+ (- d0 d1)) (1+ (- d2 d1)))
@@ -14771,6 +17991,7 @@ the documentation of `org-diary'."
                (setq txt org-agenda-no-heading-message))
              (org-add-props txt props
                'org-marker marker 'org-hd-marker hdmarker
+               'type "block" 'date date
                'priority (org-get-priority txt) 'org-category category)
              (push txt ee)))
        (goto-char pos)))
@@ -14779,7 +18000,6 @@ the documentation of `org-diary'."
 
 ;;; Agenda presentation and sorting
 
-;; FIXME: should I allow spaces around the dash?
 (defconst org-plain-time-of-day-regexp
   (concat
    "\\(\\<[012]?[0-9]"
@@ -14798,7 +18018,7 @@ groups carry important information:
 (defconst org-stamp-time-of-day-regexp
   (concat
    "<\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} +\\sw+ +\\)"
-   "\\([012][0-9]:[0-5][0-9]\\)>"
+   "\\([012][0-9]:[0-5][0-9]\\(-\\([012][0-9]:[0-5][0-9]\\)\\)?[^\n\r>]*?\\)>"
    "\\(--?"
    "<\\1\\([012][0-9]:[0-5][0-9]\\)>\\)?")
   "Regular expression to match a timestamp time or time range.
@@ -14841,14 +18061,15 @@ only the correctly processes TXT should be returned - this is used by
           time    ; time and tag are needed for the eval of the prefix format
           (ts (if dotime (concat (if (stringp dotime) dotime "") txt)))
           (time-of-day (and dotime (org-get-time-of-day ts)))
-          stamp plain s0 s1 s2 rtn)
+          stamp plain s0 s1 s2 rtn srp)
       (when (and dotime time-of-day org-prefix-has-time)
        ;; Extract starting and ending time and move them to prefix
        (when (or (setq stamp (string-match org-stamp-time-of-day-regexp ts))
                  (setq plain (string-match org-plain-time-of-day-regexp ts)))
          (setq s0 (match-string 0 ts)
+               srp (and stamp (match-end 3))
                s1 (match-string (if plain 1 2) ts)
-               s2 (match-string (if plain 8 4) ts))
+               s2 (match-string (if plain 8 (if srp 4 6)) ts))
 
          ;; If the times are in TXT (not in DOTIMES), and the prefix will list
          ;; them, we might want to remove them there to avoid duplication.
@@ -14863,10 +18084,20 @@ only the correctly processes TXT should be returned - this is used by
        (if s1 (setq s1 (org-get-time-of-day s1 'string t)))
        (if s2 (setq s2 (org-get-time-of-day s2 'string t))))
 
-      (when (string-match "\\([ \t]+\\)\\(:[a-zA-Z_@0-9:]+:\\)[ \t]*$" txt)
+      (when (and s1 (not s2) org-agenda-default-appointment-duration
+                (string-match "\\([0-9]+\\):\\([0-9]+\\)" s1))
+       (let ((m (+ (string-to-number (match-string 2 s1))
+                   (* 60 (string-to-number (match-string 1 s1)))
+                   org-agenda-default-appointment-duration))
+             h)
+         (setq h (/ m 60) m (- m (* h 60)))
+         (setq s2 (format "%02d:%02d" h m))))
+
+      (when (string-match (org-re "\\([ \t]+\\)\\(:[[:alnum:]_@:]+:\\)[ \t]*$")
+                         txt)
        ;; Tags are in the string
-       (if (or (eq org-agenda-remove-tags-when-in-prefix t)
-               (and org-agenda-remove-tags-when-in-prefix
+       (if (or (eq org-agenda-remove-tags t)
+               (and org-agenda-remove-tags
                     org-prefix-has-tag))
            (setq txt (replace-match "" t t txt))
          (setq txt (replace-match
@@ -14891,9 +18122,12 @@ only the correctly processes TXT should be returned - this is used by
        'org-category (downcase category) 'tags tags
        'prefix-length (- (length rtn) (length txt))
        'time-of-day time-of-day
+       'txt txt
+       'time time
+       'extra extra
        'dotime dotime))))
 
-(defvar org-agenda-sorting-strategy)
+(defvar org-agenda-sorting-strategy) ;; FIXME: can be removed?
 (defvar org-agenda-sorting-strategy-selected nil)
 
 (defun org-agenda-add-time-grid-maybe (list ndays todayp)
@@ -15034,8 +18268,8 @@ HH:MM."
 
 (defsubst org-cmp-category (a b)
   "Compare the string values of categories of strings A and B."
-  (let ((ca (or (get-text-property 1 'category a) ""))
-       (cb (or (get-text-property 1 'category b) "")))
+  (let ((ca (or (get-text-property 1 'org-category a) ""))
+       (cb (or (get-text-property 1 'org-category b) "")))
     (cond ((string-lessp ca cb) -1)
          ((string-lessp cb ca) +1)
          (t nil))))
@@ -15093,7 +18327,8 @@ If ERROR is non-nil, throw an error, otherwise just return nil."
   (let ((buf (current-buffer)))
     (if (not (one-window-p)) (delete-window))
     (kill-buffer buf)
-    (org-agenda-maybe-reset-markers 'force))
+    (org-agenda-maybe-reset-markers 'force)
+    (org-columns-remove-overlays))
   ;; Maybe restore the pre-agenda window configuration.
   (and org-agenda-restore-windows-after-quit
        (not (eq org-agenda-window-setup 'other-frame))
@@ -15139,8 +18374,11 @@ When this is the global TODO list, a prefix argument will be interpreted."
     (cond
      (tdpos (goto-char tdpos))
      ((eq org-agenda-type 'agenda)
-      (let ((org-agenda-overriding-arguments org-agenda-last-arguments))
-       (setf (nth 1 org-agenda-overriding-arguments) nil)
+      (let* ((sd (time-to-days (current-time)))
+            (comp (org-agenda-compute-time-span sd org-agenda-span))
+            (org-agenda-overriding-arguments org-agenda-last-arguments))
+       (setf (nth 1 org-agenda-overriding-arguments) (car comp))
+       (setf (nth 2 org-agenda-overriding-arguments) (cdr comp))
        (org-agenda-redo)
        (org-agenda-find-today-or-agenda)))
      (t (error "Cannot find today")))))
@@ -15152,62 +18390,109 @@ When this is the global TODO list, a prefix argument will be interpreted."
        (point-min))))
 
 (defun org-agenda-later (arg)
-  "Go forward in time by `org-agenda-ndays' days.
-With prefix ARG, go forward that many times `org-agenda-ndays'."
+  "Go forward in time by thee current span.
+With prefix ARG, go forward that many times the current span."
   (interactive "p")
   (org-agenda-check-type t 'agenda)
-  (let ((org-agenda-overriding-arguments
-        (list (car org-agenda-last-arguments)
-              (+ org-starting-day (* arg org-agenda-ndays))
-              nil t)))
+  (let* ((span org-agenda-span)
+        (sd org-starting-day)
+        (greg (calendar-gregorian-from-absolute sd))
+        greg2 nd)
+    (cond
+     ((eq span 'day)
+      (setq sd (+ arg sd) nd 1))
+     ((eq span 'week)
+      (setq sd (+ (* 7 arg) sd) nd 7))
+     ((eq span 'month)
+      (setq greg2 (list (+ (car greg) arg) (nth 1 greg) (nth 2 greg))
+           sd (calendar-absolute-from-gregorian greg2))
+      (setcar greg2 (1+ (car greg2)))
+      (setq nd (- (calendar-absolute-from-gregorian greg2) sd)))
+     ((eq span 'year)
+      (setq greg2 (list (car greg) (nth 1 greg) (+ arg (nth 2 greg)))
+           sd (calendar-absolute-from-gregorian greg2))
+      (setcar (nthcdr 2 greg2) (1+ (nth 2 greg2)))
+      (setq nd (- (calendar-absolute-from-gregorian greg2) sd))))
+    (let ((org-agenda-overriding-arguments
+          (list (car org-agenda-last-arguments) sd nd t)))
     (org-agenda-redo)
-    (org-agenda-find-today-or-agenda)))
-
+    (org-agenda-find-today-or-agenda))))
 (defun org-agenda-earlier (arg)
-  "Go back in time by `org-agenda-ndays' days.
-With prefix ARG, go back that many times `org-agenda-ndays'."
+  "Go backward in time by the current span.
+With prefix ARG, go backward that many times the current span."
   (interactive "p")
-  (org-agenda-check-type t 'agenda)
-  (let ((org-agenda-overriding-arguments
-        (list (car org-agenda-last-arguments)
-              (- org-starting-day (* arg org-agenda-ndays))
-              nil t)))
-    (org-agenda-redo)
-    (org-agenda-find-today-or-agenda)))
+  (org-agenda-later (- arg)))
 
+(defun org-agenda-day-view ()
+  "Switch to daily view for agenda."
+  (interactive)
+  (setq org-agenda-ndays 1)
+  (org-agenda-change-time-span 'day))
 (defun org-agenda-week-view ()
-  "Switch to weekly view for agenda."
+  "Switch to daily view for agenda."
   (interactive)
-  (org-agenda-check-type t 'agenda)
-  (if (= org-agenda-ndays 7)
-      (error "This is already the week view"))
   (setq org-agenda-ndays 7)
-  (let ((org-agenda-overriding-arguments
-        (list (car org-agenda-last-arguments)
-              (or (get-text-property (point) 'day)
-                      org-starting-day)
-              nil t)))
-    (org-agenda-redo)
-    (org-agenda-find-today-or-agenda))
-  (org-agenda-set-mode-name)
-  (message "Switched to week view"))
-
-(defun org-agenda-day-view ()
+  (org-agenda-change-time-span 'week))
+(defun org-agenda-month-view ()
+  "Switch to daily view for agenda."
+  (interactive)
+  (org-agenda-change-time-span 'month))
+(defun org-agenda-year-view ()
   "Switch to daily view for agenda."
   (interactive)
+  (if (y-or-n-p "Are you sure you want to compute the agenda for an entire year? ")
+      (org-agenda-change-time-span 'year)
+    (error "Abort")))
+
+(defun org-agenda-change-time-span (span)
+  "Change the agenda view to SPAN.
+SPAN may be `day', `week', `month', `year'."
   (org-agenda-check-type t 'agenda)
-  (if (= org-agenda-ndays 1)
-      (error "This is already the day view"))
-  (setq org-agenda-ndays 1)
-  (let ((org-agenda-overriding-arguments
-        (list (car org-agenda-last-arguments)
-              (or (get-text-property (point) 'day)
-                      org-starting-day)
-              nil t)))
+  (if (equal org-agenda-span span)
+      (error "Viewing span is already \"%s\"" span))
+  (let* ((sd (or (get-text-property (point) 'day)
+               org-starting-day))
+        (computed (org-agenda-compute-time-span sd span))
+        (org-agenda-overriding-arguments
+         (list (car org-agenda-last-arguments)
+               (car computed) (cdr computed) t)))
     (org-agenda-redo)
     (org-agenda-find-today-or-agenda))
   (org-agenda-set-mode-name)
-  (message "Switched to day view"))
+  (message "Switched to %s view" span))
+
+(defun org-agenda-compute-time-span (sd span)
+  "Compute starting date and number of days for agenda.
+SPAN may be `day', `week', `month', `year'.  The return value
+is a cons cell with the starting date and the number of days,
+so that the date SD will be in that range."
+  (let* ((greg (calendar-gregorian-from-absolute sd))
+        nd)
+    (cond
+     ((eq span 'day)
+      (setq nd 1))
+     ((eq span 'week)
+      (let* ((nt (calendar-day-of-week
+                 (calendar-gregorian-from-absolute sd)))
+            (d (if org-agenda-start-on-weekday
+                   (- nt org-agenda-start-on-weekday)
+                 0)))
+       (setq sd (- sd (+ (if (< d 0) 7 0) d)))
+       (setq nd 7)))
+     ((eq span 'month)
+      (setq sd (calendar-absolute-from-gregorian
+               (list (car greg) 1 (nth 2 greg)))
+           nd (- (calendar-absolute-from-gregorian
+                  (list (1+ (car greg)) 1 (nth 2 greg)))
+                 sd)))
+     ((eq span 'year)
+      (setq sd (calendar-absolute-from-gregorian
+               (list 1 1 (nth 2 greg)))
+           nd (- (calendar-absolute-from-gregorian
+                  (list 1 1 (1+ (nth 2 greg))))
+                 sd))))
+    (cons sd nd)))
 
 ;; FIXME: this no longer works if user make date format that starts with a blank
 (defun org-agenda-next-date-line (&optional arg)
@@ -15243,6 +18528,7 @@ With prefix ARG, go back that many times `org-agenda-ndays'."
   "Detach overlay INDEX."
   (funcall (if (featurep 'xemacs) 'detach-extent 'delete-overlay) org-hl))
 
+;; FIXME this is currently not used.
 (defun org-highlight-until-next-command (beg end &optional buffer)
   (org-highlight beg end buffer)
   (add-hook 'pre-command-hook 'org-unhighlight-once))
@@ -15350,12 +18636,13 @@ and by additional input from the age of a schedules or deadline entry."
                     (org-agenda-error)))
         (buffer (marker-buffer marker))
         (pos (marker-position marker))
+        (type (get-text-property (point) 'type))
         dbeg dend (n 0) conf)
     (org-with-remote-undo buffer
      (with-current-buffer buffer
        (save-excursion
         (goto-char pos)
-        (if (org-mode-p)
+        (if (and (org-mode-p) (not (member type '("sexp"))))
             (setq dbeg (progn (org-back-to-heading t) (point))
                   dend (org-end-of-subtree t))
           (setq dbeg (point-at-bol)
@@ -15502,6 +18789,16 @@ dedicated frame)."
   "Marker pointing to the headline that last changed its TODO state
 by a remote command from the agenda.")
 
+(defun org-agenda-todo-nextset ()
+  "Switch TODO entry to next sequence."
+  (interactive)
+  (org-agenda-todo 'nextset))
+
+(defun org-agenda-todo-previousset ()
+  "Switch TODO entry to previous sequence."
+  (interactive)
+  (org-agenda-todo 'previousset))
+
 (defun org-agenda-todo (&optional arg)
   "Cycle TODO state of line at point, also in Org-mode file.
 This changes the line at point, all other lines in the agenda referring to
@@ -15587,7 +18884,7 @@ the new TODO state."
   (let ((buffer-read-only))
     (save-excursion
       (goto-char (if line (point-at-bol) (point-min)))
-      (while (re-search-forward "\\([ \t]+\\):[a-zA-Z0-9_@:]+:[ \t]*$"
+      (while (re-search-forward (org-re "\\([ \t]+\\):[[:alnum:]_@:]+:[ \t]*$")
                                (if line (point-at-eol) nil) t)
        (delete-region (match-beginning 1) (match-end 1))
        (goto-char (match-beginning 1))
@@ -15648,7 +18945,7 @@ the tags of the current headline come last."
          (org-back-to-heading t)
          (condition-case nil
              (while t
-               (if (looking-at "[^\r\n]+?:\\([a-zA-Z_@0-9:]+\\):[ \t]*\\([\n\r]\\|\\'\\)")
+               (if (looking-at (org-re "[^\r\n]+?:\\([[:alnum:]_@:]+\\):[ \t]*$"))
                    (setq tags (append (org-split-string
                                        (org-match-string-no-properties 1) ":")
                                       tags)))
@@ -15673,10 +18970,12 @@ the tags of the current headline come last."
       (with-current-buffer buffer
        (widen)
        (goto-char pos)
-       (org-show-context 'agenda)
+       (save-excursion
+         (org-show-context 'agenda))
        (save-excursion
          (and (outline-next-heading)
               (org-flag-heading nil)))   ; show the next heading
+       (goto-char pos)
        (call-interactively 'org-set-tags)
        (end-of-line 1)
        (setq newhead (org-get-heading)))
@@ -15992,11 +19291,11 @@ This is a command that has to be installed in `calendar-mode-map'."
 (defvar org-cdlatex-mode-map (make-sparse-keymap)
   "Keymap for the minor `org-cdlatex-mode'.")
 
-(define-key org-cdlatex-mode-map "_" 'org-cdlatex-underscore-caret)
-(define-key org-cdlatex-mode-map "^" 'org-cdlatex-underscore-caret)
-(define-key org-cdlatex-mode-map "`" 'cdlatex-math-symbol)
-(define-key org-cdlatex-mode-map "'" 'org-cdlatex-math-modify)
-(define-key org-cdlatex-mode-map "\C-c{" 'cdlatex-environment)
+(org-defkey org-cdlatex-mode-map "_" 'org-cdlatex-underscore-caret)
+(org-defkey org-cdlatex-mode-map "^" 'org-cdlatex-underscore-caret)
+(org-defkey org-cdlatex-mode-map "`" 'cdlatex-math-symbol)
+(org-defkey org-cdlatex-mode-map "'" 'org-cdlatex-math-modify)
+(org-defkey org-cdlatex-mode-map "\C-c{" 'cdlatex-environment)
 
 (defvar org-cdlatex-texmathp-advice-is-done nil
   "Flag remembering if we have applied the advice to texmathp already.")
@@ -16064,7 +19363,7 @@ looks only before point, not after."
        (while (string-match re str start)
          (cond
           ((= (match-end 0) (length str))
-           (throw 'exit (cons "$" (+ lim (match-beginning 0)))))
+           (throw 'exit (cons "$" (+ lim (match-beginning 0) 1))))
           ((= (match-end 0) (- (length str) 5))
            (throw 'exit nil))
           (t (setq start (match-end 0))))))
@@ -16156,11 +19455,12 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]."
                      "Creating images for entry...%s"))))
        (message msg "")
        (narrow-to-region beg end)
+       (goto-char beg)
        (org-format-latex
         (concat "ltxpng/" (file-name-sans-extension
                            (file-name-nondirectory
                             buffer-file-name)))
-        default-directory 'overlays msg at)
+        default-directory 'overlays msg at 'forbuffer)
       (message msg "done.  Use `C-c C-c' to remove images.")))))
 
 (defvar org-latex-regexps
@@ -16173,7 +19473,7 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]."
     ("$$" "\\$\\$[^\000]*?\\$\\$" 0 t))
   "Regular expressions for matching embedded LaTeX.")
 
-(defun org-format-latex (prefix &optional dir overlays msg at)
+(defun org-format-latex (prefix &optional dir overlays msg at forbuffer)
   "Replace LaTeX fragments with links to an image, and produce images."
   (if (and overlays (fboundp 'clear-image-cache)) (clear-image-cache))
   (let* ((prefixnodir (file-name-nondirectory prefix))
@@ -16210,7 +19510,7 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]."
              (setq checkdir t)
              (or (file-directory-p todir) (make-directory todir)))
            (org-create-formula-image
-            txt movefile opt)
+            txt movefile opt forbuffer)
            (if overlays
                (progn
                  (setq ov (org-make-overlay beg end))
@@ -16229,31 +19529,27 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]."
              (insert link))))))))
 
 ;; This function borrows from Ganesh Swami's latex2png.el
-(defun org-create-formula-image (string tofile options)
+(defun org-create-formula-image (string tofile options buffer)
   (let* ((tmpdir (if (featurep 'xemacs)
                     (temp-directory)
                   temporary-file-directory))
         (texfilebase (make-temp-name
                       (expand-file-name "orgtex" tmpdir)))
-
-;(texfilebase (make-temp-file "orgtex"))
-;       (dummy (delete-file texfilebase))
         (texfile (concat texfilebase ".tex"))
         (dvifile (concat texfilebase ".dvi"))
         (pngfile (concat texfilebase ".png"))
-        (scale (number-to-string (* 1000 (or (plist-get options :scale) 1.0))))
-        (fg (or (plist-get options :foreground) "Black"))
-        (bg (or (plist-get options :background) "Transparent")))
+        (fnh (face-attribute 'default :height nil))
+        (scale (or (plist-get options (if buffer :scale :html-scale)) 1.0))
+        (dpi (number-to-string (* scale (floor (* 0.9 (if buffer fnh 140.))))))
+        (fg (or (plist-get options (if buffer :foreground :html-foreground))
+                "Black"))
+        (bg (or (plist-get options (if buffer :background :html-background))
+                "Transparent")))
+    (if (eq fg 'default) (setq fg (org-dvipng-color :foreground)))
+    (if (eq bg 'default) (setq bg (org-dvipng-color :background)))
     (with-temp-file texfile
-      (insert "\\documentclass{article}
-\\usepackage{fullpage}
-\\usepackage{amssymb}
-\\usepackage[usenames]{color}
-\\usepackage{amsmath}
-\\usepackage{latexsym}
-\\usepackage[mathscr]{eucal}
-\\pagestyle{empty}
-\\begin{document}\n" string "\n\\end{document}\n"))
+      (insert org-format-latex-header
+             "\n\\begin{document}\n" string "\n\\end{document}\n"))
     (let ((dir default-directory))
       (condition-case nil
          (progn
@@ -16265,7 +19561,9 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]."
        (progn (message "Failed to create dvi file from %s" texfile) nil)
       (call-process "dvipng" nil nil nil
                    "-E" "-fg" fg "-bg" bg
-                   "-x" scale "-y" scale "-T" "tight"
+                    "-D" dpi
+                   ;;"-x" scale "-y" scale
+                   "-T" "tight"
                    "-o" pngfile
                    dvifile)
       (if (not (file-exists-p pngfile))
@@ -16276,6 +19574,16 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]."
              (delete-file (concat texfilebase e)))
        pngfile))))
 
+(defun org-dvipng-color (attr)
+  "Return an rgb color specification for dvipng."
+  (apply 'format "rgb %s %s %s"
+        (mapcar 'org-normalize-color
+                (color-values (face-attribute 'default attr nil)))))
+
+(defun org-normalize-color (value)
+  "Return string to be used as color value for an RGB component."
+  (format "%g" (/ value 65535.0)))
+
 ;;;; Exporting
 
 ;;; Variables, constants, and parameter plists
@@ -16300,16 +19608,21 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]."
     (:headline-levels      . org-export-headline-levels)
     (:section-numbers      . org-export-with-section-numbers)
     (:table-of-contents    . org-export-with-toc)
+    (:preserve-breaks      . org-export-preserve-breaks)
     (:archived-trees       . org-export-with-archived-trees)
     (:emphasize            . org-export-with-emphasize)
     (:sub-superscript      . org-export-with-sub-superscripts)
+    (:footnotes            . org-export-with-footnotes)
+    (:property-drawer      . org-export-with-property-drawer)
     (:TeX-macros           . org-export-with-TeX-macros)
     (:LaTeX-fragments      . org-export-with-LaTeX-fragments)
+    (:skip-before-1st-heading . org-export-skip-text-before-1st-heading)
     (:fixed-width          . org-export-with-fixed-width)
     (:timestamps           . org-export-with-timestamps)
     (:tables               . org-export-with-tables)
     (:table-auto-headline  . org-export-highlight-first-table-line)
     (:style                . org-export-html-style)
+    (:agenda-style         . org-agenda-export-html-style) ;; FIXME: Does this work????
     (:convert-org-links    . org-export-html-link-org-files-as-html)
     (:inline-images        . org-export-html-inline-images)
     (:expand-quoted-html   . org-export-html-expand)
@@ -16357,9 +19670,12 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]."
                    (":"     . :fixed-width)
                    ("|"     . :tables)
                    ("^"     . :sub-superscript)
+                   ("f"     . :footnotes)
+                   ("p"     . :property-drawer)
                    ("*"     . :emphasize)
                    ("TeX"   . :TeX-macros)
-                   ("LaTeX" . :LaTeX-fragments)))
+                   ("LaTeX" . :LaTeX-fragments)
+                   ("skip"  . :skip-before-1st-heading)))
              o)
          (while (setq o (pop op))
            (if (string-match (concat (regexp-quote (car o))
@@ -16377,19 +19693,11 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]."
                val)))
     dir))
 
-(defun org-export-find-first-heading-line (list)
-  "Remove all lines from LIST which are before the first headline."
-  (let ((orig-list list)
-       (re (concat "^" outline-regexp)))
-    (while (and list
-               (not (string-match re (car list))))
-      (pop list))
-    (or list orig-list)))
-
 (defun org-skip-comments (lines)
   "Skip lines starting with \"#\" and subtrees starting with COMMENT."
   (let ((re1 (concat "^\\(\\*+\\)[ \t]+" org-comment-string))
        (re2 "^\\(\\*+\\)[ \t\n\r]")
+       (case-fold-search nil)
        rtn line level)
     (while (setq line (pop lines))
       (cond
@@ -16420,6 +19728,7 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]."
 
 \[a] export as ASCII
 \[h] export as HTML
+\[H] export as HTML to temporary buffer
 \[b] export as HTML and browse immediately
 \[x] export as XOXO
 
@@ -16437,6 +19746,8 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]."
           (?a . org-export-as-ascii)
           (?h . org-export-as-html)
           (?b . org-export-as-html-and-open)
+          (?H . org-export-as-html-to-buffer)
+          (?R . org-export-region-as-html)
           (?x . org-export-as-xoxo)
           (?i . org-export-icalendar-this-file)
           (?I . org-export-icalendar-all-agenda-files)
@@ -16465,6 +19776,7 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]."
     ("curren")
     ("yen")
     ("brvbar")
+    ("vert" . "&#124;")
     ("sect")
     ("uml")
     ("copy")
@@ -16766,26 +20078,51 @@ translations.  There is currently no way for users to extend this.")
         (re-angle-link (concat "\\([^[]\\)" org-angle-link-re))
         (re-archive (concat ":" org-archive-tag ":"))
         (re-quote (concat "^\\*+[ \t]+" org-quote-string "\\>"))
-        (htmlp (memq :for-html parameters))
-        (outline-regexp "\\*+")
-        rtn)
+        (htmlp (plist-get parameters :for-html))
+        (inhibit-read-only t)
+        (outline-regexp "\\*+ ")
+        a b
+        rtn p)
     (save-excursion
       (set-buffer (get-buffer-create " org-mode-tmp"))
       (erase-buffer)
       (insert string)
+      ;; Remove license-to-kill stuff
+      (while (setq p (text-property-any (point-min) (point-max)
+                                       :org-license-to-kill t))
+       (delete-region p (next-single-property-change p :org-license-to-kill)))
+
       (let ((org-inhibit-startup t)) (org-mode))
       (untabify (point-min) (point-max))
 
+      ;; Get the correct stuff before the first headline
+      (when (plist-get parameters :skip-before-1st-heading)
+       (goto-char (point-min))
+       (when (re-search-forward "^\\*+[ \t]" nil t)
+         (delete-region (point-min) (match-beginning 0))
+         (goto-char (point-min))
+         (insert "\n")))
+      (when (plist-get parameters :add-text)
+       (goto-char (point-min))
+       (insert (plist-get parameters :add-text) "\n"))
+
       ;; Get rid of archived trees
       (when (not (eq org-export-with-archived-trees t))
        (goto-char (point-min))
        (while (re-search-forward re-archive nil t)
-         (if (not (org-on-heading-p))
+         (if (not (org-on-heading-p t))
              (org-end-of-subtree t)
            (beginning-of-line 1)
-           (delete-region
-            (if org-export-with-archived-trees (1+ (point-at-eol)) (point))
-            (org-end-of-subtree t)))))
+           (setq a (if org-export-with-archived-trees
+                       (1+ (point-at-eol)) (point))
+                 b (org-end-of-subtree t))
+           (if (> b a) (delete-region a b)))))
+
+      ;; Get rid of property drawers
+      (unless org-export-with-property-drawer
+       (goto-char (point-min))
+       (while (re-search-forward "^[ \t]*:PROPERTIES:[ \t]*\n\\([^@]*?\n\\)?[ \t]*:END:[ \t]*\n" nil t)
+         (replace-match "")))
 
       ;; Protect stuff from HTML processing
       (goto-char (point-min))
@@ -16801,7 +20138,7 @@ translations.  There is currently no way for users to extend this.")
           '(org-protected t))))
       (goto-char (point-min))
       (while (re-search-forward
-             "^#\\+BEGIN_HTML\\>.*\\(\n.*\\)*?\n#\\+END_HTML\\>.*\n?" nil t)
+             "^#\\+BEGIN_HTML\\>.*\\(\\(\n.*\\)*?\n\\)#\\+END_HTML\\>.*\n?" nil t)
        (if htmlp
            (add-text-properties (match-beginning 1) (1+ (match-end 1))
                                 '(org-protected t))
@@ -16839,7 +20176,7 @@ translations.  There is currently no way for users to extend this.")
         (goto-char (match-beginning 0))))
 
       ;; Convert LaTeX fragments to images
-      (when (memq :LaTeX-fragments parameters)
+      (when (plist-get parameters :LaTeX-fragments)
        (org-format-latex
         (concat "ltxpng/" (file-name-sans-extension
                            (file-name-nondirectory
@@ -16851,6 +20188,7 @@ translations.  There is currently no way for users to extend this.")
       ;; Expand link abbreviations
       (goto-char (point-min))
       (while (re-search-forward re-plain-link nil t)
+       (goto-char (1- (match-end 0)))
        (org-if-unprotected
         (replace-match
          (concat
@@ -16858,6 +20196,7 @@ translations.  There is currently no way for users to extend this.")
          t t)))
       (goto-char (point-min))
       (while (re-search-forward re-angle-link nil t)
+       (goto-char (1- (match-end 0)))
        (org-if-unprotected
         (replace-match
          (concat
@@ -16877,17 +20216,35 @@ translations.  There is currently no way for users to extend this.")
          t t)))
 
       ;; Find multiline emphasis and put them into single line
-      (when (memq :emph-multiline parameters)
+      (when (plist-get  parameters :emph-multiline)
        (goto-char (point-min))
        (while (re-search-forward org-emph-re nil t)
-         (org-if-unprotected
-          (subst-char-in-region (match-beginning 0) (match-end 0) ?\n ?\  t)
-          (goto-char (1- (match-end 0))))))
+         (if (not (= (char-after (match-beginning 3))
+                     (char-after (match-beginning 4))))
+             (org-if-unprotected
+              (subst-char-in-region (match-beginning 0) (match-end 0)
+                                    ?\n ?\  t)
+              (goto-char (1- (match-end 0))))
+           (goto-char (1+ (match-beginning 0))))))
 
       (setq rtn (buffer-string)))
     (kill-buffer " org-mode-tmp")
     rtn))
 
+(defun org-export-grab-title-from-buffer ()
+  "Get a title for the current document, from looking at the buffer."
+  (let (buffer-read-only)
+    (save-excursion
+      (goto-char (point-min))
+      (let ((end (save-excursion (outline-next-heading) (point))))
+       (when (re-search-forward "^[ \t]*[^|# \t\r\n].*\n" end t)
+         ;; Mark the line so that it will not be exported as normal text.
+         (org-unmodified
+          (add-text-properties (match-beginning 0) (match-end 0)
+                               (list :org-license-to-kill t)))
+         ;; Return the title string
+         (org-trim (match-string 0)))))))
+
 (defun org-solidify-link-text (s &optional alist)
   "Take link text and make a safe target out of it."
   (save-match-data
@@ -16959,16 +20316,7 @@ underlined headlines.  The default is 3."
   (setq-default org-todo-line-regexp org-todo-line-regexp)
   (let* ((opt-plist (org-combine-plists (org-default-export-plist)
                                        (org-infile-export-plist)))
-        (region
-         (buffer-substring
-          (if (org-region-active-p) (region-beginning) (point-min))
-          (if (org-region-active-p) (region-end) (point-max))))
         (custom-times org-display-custom-times)
-        (lines (org-export-find-first-heading-line
-                (org-skip-comments
-                 (org-split-string
-                  (org-cleaned-string-for-export region)
-                  "[\r\n]"))))
         (org-ascii-current-indentation '(0 . 0))
         (level 0) line txt
         (umax nil)
@@ -16986,15 +20334,36 @@ underlined headlines.  The default is 3."
         (time  (format-time-string "%X" (org-current-time)))
         (author      (plist-get opt-plist :author))
         (title       (or (plist-get opt-plist :title)
+                         (and (not
+                               (plist-get opt-plist :skip-before-1st-heading))
+                              (org-export-grab-title-from-buffer))
                          (file-name-sans-extension
                           (file-name-nondirectory buffer-file-name))))
         (email       (plist-get opt-plist :email))
         (language    (plist-get opt-plist :language))
         (quote-re0   (concat "^[ \t]*" org-quote-string "\\>"))
 ;       (quote-re    (concat "^\\(\\*+\\)\\([ \t]*" org-quote-string "\\>\\)"))
-        (text        nil)
         (todo nil)
-        (lang-words nil))
+        (lang-words nil)
+        (region
+         (buffer-substring
+          (if (org-region-active-p) (region-beginning) (point-min))
+          (if (org-region-active-p) (region-end) (point-max))))
+        (lines (org-skip-comments
+                (org-split-string
+                 (org-cleaned-string-for-export
+                  region
+                  :skip-before-1st-heading
+                  (plist-get opt-plist :skip-before-1st-heading)
+                  :add-text (plist-get opt-plist :text))
+                 "[\r\n]"))) ;; FIXME: why \r here???/
+        thetoc have-headings first-heading-pos
+        table-open table-buffer)
+
+    (let (buffer-read-only)
+      (org-unmodified
+       (remove-text-properties (point-min) (point-max)
+                              '(:org-license-to-kill t))))
 
     (setq org-last-level 1)
     (org-init-section-numbers)
@@ -17028,27 +20397,27 @@ underlined headlines.  The default is 3."
                        "\n")))
     (if (and date time)
        (insert (concat (nth 2 lang-words) ": " date " " time "\n")))
-    (if text (insert (concat (org-html-expand-for-ascii text) "\n\n")))
 
     (insert "\n\n")
 
     (if org-export-with-toc
        (progn
-         (insert (nth 3 lang-words) "\n"
-                 (make-string (length (nth 3 lang-words)) ?=) "\n")
+         (push (concat (nth 3 lang-words) "\n") thetoc)
+         (push (concat (make-string (length (nth 3 lang-words)) ?=) "\n") thetoc)
          (mapcar '(lambda (line)
                     (if (string-match org-todo-line-regexp
                                       line)
                         ;; This is a headline
                         (progn
+                          (setq have-headings t)
                           (setq level (- (match-end 1) (match-beginning 1))
                                 level (org-tr-level level)
                                 txt (match-string 3 line)
                                 todo
                                 (or (and org-export-mark-todo-in-toc
                                          (match-beginning 2)
-                                         (not (equal (match-string 2 line)
-                                                     org-done-string)))
+                                         (not (member (match-string 2 line)
+                                                      org-done-keywords)))
                                        ; TODO, not DONE
                                     (and org-export-mark-todo-in-toc
                                          (= level umax-toc)
@@ -17057,7 +20426,9 @@ underlined headlines.  The default is 3."
                           (setq txt (org-html-expand-for-ascii txt))
 
                           (if (and (memq org-export-with-tags '(not-in-toc nil))
-                                   (string-match "[ \t]+:[a-zA-Z0-9_@:]+:[ \t]*$" txt))
+                                   (string-match
+                                    (org-re "[ \t]+:[[:alnum:]_@:]+:[ \t]*$")
+                                    txt))
                               (setq txt (replace-match "" t t txt)))
                           (if (string-match quote-re0 txt)
                               (setq txt (replace-match "" t t txt)))
@@ -17067,12 +20438,15 @@ underlined headlines.  The default is 3."
                                                 " " txt)))
                           (if (<= level umax-toc)
                               (progn
-                                (insert
-                                 (make-string (* (1- level) 4) ?\ )
-                                 (format (if todo "%s (*)\n" "%s\n") txt))
+                                (push
+                                 (concat
+                                  (make-string (* (1- level) 4) ?\ )
+                                  (format (if todo "%s (*)\n" "%s\n") txt))
+                                 thetoc)
                                 (setq org-last-level level))
                             ))))
-                 lines)))
+                 lines)
+         (setq thetoc (if have-headings (nreverse thetoc) nil))))
 
     (org-init-section-numbers)
     (while (setq line (pop lines))
@@ -17089,14 +20463,51 @@ underlined headlines.  The default is 3."
       (when custom-times
        (setq line (org-translate-time line)))
       (cond
-       ((string-match "^\\(\\*+\\)[ \t]*\\(.*\\)" line)
+       ((string-match "^\\(\\*+\\)[ \t]+\\(.*\\)" line)
        ;; a Headline
+       (setq first-heading-pos (or first-heading-pos (point)))
        (setq level (org-tr-level (- (match-end 1) (match-beginning 1)))
              txt (match-string 2 line))
        (org-ascii-level-start level txt umax lines))
+
+       ((and org-export-with-tables
+            (string-match "^\\([ \t]*\\)\\(|\\|\\+-+\\+\\)" line))
+       (if (not table-open)
+           ;; New table starts
+           (setq table-open t table-buffer nil))
+       ;; Accumulate lines
+       (setq table-buffer (cons line table-buffer))
+       (when (or (not lines)
+                 (not (string-match "^\\([ \t]*\\)\\(|\\|\\+-+\\+\\)"
+                                    (car lines))))
+         (setq table-open nil
+               table-buffer (nreverse table-buffer))
+         (insert (mapconcat
+                  (lambda (x)
+                    (org-fix-indentation x org-ascii-current-indentation))
+                  (org-format-table-ascii table-buffer)
+                  "\n") "\n")))
        (t
-       (insert (org-fix-indentation line org-ascii-current-indentation) "\n"))))
+       (setq line (org-fix-indentation line org-ascii-current-indentation))
+       (if (and org-export-with-fixed-width
+                (string-match "^\\([ \t]*\\)\\(:\\)" line))
+           (setq line (replace-match "\\1" nil nil line)))
+       (insert line "\n"))))
+
     (normal-mode)
+
+    ;; insert the table of contents
+    (when thetoc
+      (goto-char (point-min))
+      (if (re-search-forward "^[ \t]*\\[TABLE-OF-CONTENTS\\][ \t]*$" nil t)
+         (progn
+           (goto-char (match-beginning 0))
+           (replace-match ""))
+       (goto-char first-heading-pos))
+      (mapc 'insert thetoc)
+      (or (looking-at "[ \t]*\n[ \t]*\n")
+         (insert "\n\n")))
+
     (save-buffer)
     ;; remove display and invisible chars
     (let (beg end)
@@ -17124,8 +20535,8 @@ underlined headlines.  The default is 3."
            (progn
              (setq lv (- (match-end 1) (match-beginning 1))
                    todo (and (match-beginning 2)
-                             (not (equal (match-string 2 line)
-                                         org-done-string))))
+                             (not (member (match-string 2 line)
+                                         org-done-keywords))))
                                        ; TODO, not DONE
              (if (<= lv level) (throw 'exit nil))
              (if todo (throw 'exit t))))))))
@@ -17159,7 +20570,7 @@ underlined headlines.  The default is 3."
          ;; find the indentation of the next non-empty line
          (catch 'stop
            (while lines
-             (if (string-match "^\\*" (car lines)) (throw 'stop nil))
+             (if (string-match "^\\* " (car lines)) (throw 'stop nil))
              (if (string-match "^\\([ \t]*\\)\\S-" (car lines))
                  (throw 'stop (setq ind (org-get-indentation (car lines)))))
              (pop lines)))
@@ -17169,7 +20580,7 @@ underlined headlines.  The default is 3."
          (insert "\n"))
       (setq char (nth (- umax level) (reverse org-export-ascii-underline)))
       (unless org-export-with-tags
-       (if (string-match "[ \t]+\\(:[a-zA-Z0-9_@:]+:\\)[ \t]*$" title)
+       (if (string-match (org-re "[ \t]+\\(:[[:alnum:]_@:]+:\\)[ \t]*$") title)
            (setq title (replace-match "" t t title))))
       (if org-export-with-section-numbers
          (setq title (concat (org-section-number level) " " title)))
@@ -17187,7 +20598,7 @@ continue to use it.  The prefix arg ARG is passed through to the exporting
 command."
   (interactive
    (list (progn
-          (message "Export visible: [a]SCII  [h]tml  [b]rowse HTML  [x]OXO  [ ]keep buffer")
+          (message "Export visible: [a]SCII  [h]tml  [b]rowse HTML [H/R]uffer with HTML  [x]OXO  [ ]keep buffer")
           (read-char-exclusive))
         current-prefix-arg))
   (if (not (member type '(?a ?\C-a ?b ?\C-b ?h ?x ?\ )))
@@ -17198,6 +20609,8 @@ command."
                                (?b . org-export-as-html-and-open)
                                (?\C-b . org-export-as-html-and-open)
                                (?h . org-export-as-html)
+                               (?H . org-export-as-html-to-buffer)
+                               (?R . org-export-region-as-html)
                                (?x . org-export-as-xoxo)))))
         (keepp (equal type ?\ ))
         (file buffer-file-name)
@@ -17253,10 +20666,11 @@ Does include HTML export options as well as TODO and CATEGORY stuff."
 #+EMAIL:     %s
 #+LANGUAGE:  %s
 #+TEXT:      Some descriptive text to be emitted.  Several lines OK.
-#+OPTIONS:   H:%d num:%s toc:%s \\n:%s @:%s ::%s |:%s ^:%s *:%s TeX:%s LaTeX:%s
+#+OPTIONS:   H:%d num:%s toc:%s \\n:%s @:%s ::%s |:%s ^:%s f:%s *:%s TeX:%s LaTeX:%s skip:%s p:%s
 #+CATEGORY:  %s
 #+SEQ_TODO:  %s
 #+TYP_TODO:  %s
+#+PRIORITIES: %c %c %c
 #+STARTUP:   %s %s %s %s %s
 #+TAGS:      %s
 #+ARCHIVE:   %s
@@ -17271,16 +20685,16 @@ Does include HTML export options as well as TODO and CATEGORY stuff."
    org-export-with-fixed-width
    org-export-with-tables
    org-export-with-sub-superscripts
+   org-export-with-footnotes
    org-export-with-emphasize
    org-export-with-TeX-macros
    org-export-with-LaTeX-fragments
+   org-export-skip-text-before-1st-heading
+   org-export-with-property-drawer
    (file-name-nondirectory buffer-file-name)
-   (if (equal org-todo-interpretation 'sequence)
-       (mapconcat 'identity org-todo-keywords " ")
-     "TODO FEEDBACK VERIFY DONE")
-   (if (equal org-todo-interpretation 'type)
-       (mapconcat 'identity org-todo-keywords " ")
-     "Me Jason Marie DONE")
+   "TODO FEEDBACK VERIFY DONE"
+   "Me Jason Marie DONE"
+   org-highest-priority org-lowest-priority org-default-priority
    (cdr (assoc org-startup-folded
               '((nil . "showall") (t . "overview") (content . "content"))))
    (if org-odd-levels-only "odd" "oddeven")
@@ -17348,12 +20762,12 @@ this line is also exported in fixed-width font."
       (save-excursion
        (org-back-to-heading)
        (if (looking-at (concat outline-regexp
-                               "\\( +\\<" org-quote-string "\\>\\)"))
+                               "\\( *\\<" org-quote-string "\\>\\)"))
            (replace-match "" t t nil 1)
          (if (looking-at outline-regexp)
              (progn
                (goto-char (match-end 0))
-               (insert " " org-quote-string))))))))
+               (insert org-quote-string " "))))))))
 
 (defun org-export-as-html-and-open (arg)
   "Export the outline as HTML and immediately open it with a browser.
@@ -17372,19 +20786,96 @@ emacs         --batch
        --visit=MyFile --funcall org-export-as-html-batch"
   (org-export-as-html org-export-headline-levels 'hidden))
 
-(defun org-export-as-html (arg &optional hidden ext-plist)
+(defun org-export-as-html-to-buffer (arg)
+  "Call `org-exort-as-html` with output to a temporary buffer.
+No file is created.  The prefix ARG is passed through to `org-export-as-html'."
+  (interactive "P")
+  (org-export-as-html arg nil nil "*Org HTML Export*")
+  (switch-to-buffer-other-window "*Org HTML Export*"))
+
+(defun org-replace-region-by-html (beg end)
+  "Assume the current region has org-mode syntax, and convert it to HTML.
+This can be used in any buffer.  For example, you could write an
+itemized list in org-mode syntax in an HTML buffer and then use this
+command to convert it."
+  (interactive "r")
+  (let (reg html buf)
+    (if (org-mode-p)
+       (setq html (org-export-region-as-html
+                   beg end t 'string))
+      (setq reg (buffer-substring beg end)
+           buf (get-buffer-create "*Org tmp*"))
+      (save-excursion
+       (set-buffer buf)
+       (erase-buffer)
+       (insert reg)
+       (org-mode)
+       (setq html (org-export-region-as-html
+                   (point-min) (point-max) t 'string)))
+      (kill-buffer buf))
+    (delete-region beg end)
+    (insert html)))
+
+(defun org-export-region-as-html (beg end &optional body-only buffer)
+  "Convert region from BEG to END in org-mode buffer to HTML.
+If prefix arg BODY-ONLY is set, omit file header, footer, and table of
+contents, and only produce the region of converted text, useful for
+cut-and-paste operations.
+If BUFFER is a buffer or a string, use/create that buffer as a target
+of the converted HTML.  If BUFFER is the symbol `string', return the
+produced HTML as a string and leave not buffer behind.  For example,
+a Lisp program could call this function in the following way:
+
+  (setq html (org-export-region-as-html beg end t 'string))
+
+When called interactively, the output buffer is selected, and shown
+in a window.  A non-interactive call will only retunr the buffer."
+  (interactive "r\nP")
+  (when (interactive-p)
+    (setq buffer "*Org HTML EXPORT*"))
+  (let ((transient-mark-mode t) (zmacs-regions t)
+       rtn)
+    (goto-char end)
+    (set-mark (point)) ;; to activate the region
+    (goto-char beg)
+    (setq rtn (org-export-as-html
+              nil nil nil
+              buffer body-only))
+    (if (fboundp 'deactivate-mark) (deactivate-mark))
+    (if (and (interactive-p) (bufferp rtn))
+       (switch-to-buffer-other-window rtn)
+      rtn)))
+
+(defun org-export-as-html (arg &optional hidden ext-plist
+                              to-buffer body-only)
   "Export the outline as a pretty HTML file.
-If there is an active region, export only the region.
-The prefix ARG specifies how many levels of the outline should become
-headlines.  The default is 3.  Lower levels will become bulleted lists.
-When HIDDEN is non-nil, don't display the HTML buffer.
+If there is an active region, export only the region.  The prefix
+ARG specifies how many levels of the outline should become
+headlines.  The default is 3.  Lower levels will become bulleted
+lists.  When HIDDEN is non-nil, don't display the HTML buffer.
 EXT-PLIST is a property list with external parameters overriding
-org-mode's default settings, but still inferior to file-local settings."
+org-mode's default settings, but still inferior to file-local
+settings.  When TO-BUFFER is non-nil, create a buffer with that
+name and export to that buffer.  If TO-BUFFER is the symbol `string',
+don't leave any buffer behind but just return the resulting HTML as
+a string.  When BODY-ONLY is set, don't produce the file header and footer,
+simply return the content of <body>...</body>, without even
+the body tags themselves."
   (interactive "P")
+
+  ;; Make sure we have a file name when we need it.
+  (when (and (not (or to-buffer body-only))
+            (not buffer-file-name))
+    (if (buffer-base-buffer)
+       (org-set-local 'buffer-file-name
+                      (with-current-buffer (buffer-base-buffer)
+                        buffer-file-name))
+      (error "Need a file name to be able to export.")))
+
   (message "Exporting...")
   (setq-default org-todo-line-regexp org-todo-line-regexp)
   (setq-default org-deadline-line-regexp org-deadline-line-regexp)
-  (setq-default org-done-string org-done-string)
+  (setq-default org-done-keywords org-done-keywords)
   (setq-default org-maybe-keyword-time-regexp org-maybe-keyword-time-regexp)
   (let* ((opt-plist (org-combine-plists (org-default-export-plist)
                                        ext-plist
@@ -17392,44 +20883,44 @@ org-mode's default settings, but still inferior to file-local settings."
 
         (style (plist-get opt-plist :style))
         (link-validate (plist-get opt-plist :link-validation-function))
-        valid
+        valid thetoc have-headings first-heading-pos
         (odd org-odd-levels-only)
         (region-p (org-region-active-p))
-         (region
-          (buffer-substring
-           (if region-p (region-beginning) (point-min))
-           (if region-p (region-end) (point-max))))
         ;; The following two are dynamically scoped into other
         ;; routines below.
         (org-current-export-dir (org-export-directory :html opt-plist))
         (org-current-export-file buffer-file-name)
-         (all_lines
-          (org-skip-comments (org-split-string
-                             (org-cleaned-string-for-export
-                              region :emph-multiline :for-html
-                              (if (plist-get opt-plist :LaTeX-fragments)
-                                  :LaTeX-fragments))
-                             "[\r\n]")))
-         (lines (org-export-find-first-heading-line all_lines))
          (level 0) (line "") (origline "") txt todo
          (umax nil)
          (umax-toc nil)
-         (filename (concat (file-name-as-directory
-                           (org-export-directory :html opt-plist))
-                          (file-name-sans-extension
-                           (file-name-nondirectory buffer-file-name))
-                          ".html"))
-        (current-dir (file-name-directory buffer-file-name))
-         (buffer (find-file-noselect filename))
+         (filename (if to-buffer nil
+                    (concat (file-name-as-directory
+                             (org-export-directory :html opt-plist))
+                            (file-name-sans-extension
+                             (file-name-nondirectory buffer-file-name))
+                            ".html")))
+        (current-dir (if buffer-file-name
+                         (file-name-directory buffer-file-name)
+                       default-directory))
+        (buffer (if to-buffer
+                    (cond
+                     ((eq to-buffer 'string) (get-buffer-create "*Org HTML Export*"))
+                     (t (get-buffer-create  to-buffer)))
+                  (find-file-noselect filename)))
          (org-levels-open (make-vector org-level-max nil))
         (date (format-time-string "%Y/%m/%d" (current-time)))
         (time  (format-time-string "%X" (org-current-time)))
          (author      (plist-get opt-plist :author))
         (title       (or (plist-get opt-plist :title)
-                         (file-name-sans-extension
-                          (file-name-nondirectory buffer-file-name))))
+                         (and (not
+                               (plist-get opt-plist :skip-before-1st-heading))
+                              (org-export-grab-title-from-buffer))
+                         (and buffer-file-name
+                              (file-name-sans-extension
+                               (file-name-nondirectory buffer-file-name)))
+                         "UNTITLED"))
         (quote-re0   (concat "^[ \t]*" org-quote-string "\\>"))
-        (quote-re    (concat "^\\(\\*+\\)\\([ \t]*" org-quote-string "\\>\\)"))
+        (quote-re    (concat "^\\(\\*+\\)\\([ \t]+" org-quote-string "\\>\\)"))
         (inquote     nil)
         (infixed     nil)
         (in-local-list nil)
@@ -17438,23 +20929,48 @@ org-mode's default settings, but still inferior to file-local settings."
         (llt org-plain-list-ordered-item-terminator)
         (email       (plist-get opt-plist :email))
          (language    (plist-get opt-plist :language))
-        (text        (plist-get opt-plist :text))
         (lang-words  nil)
         (target-alist nil) tg
         (head-count  0) cnt
         (start       0)
         (coding-system (and (boundp 'buffer-file-coding-system)
                             buffer-file-coding-system))
-        (coding-system-for-write coding-system)
-        (save-buffer-coding-system coding-system)
-        (charset (and coding-system
+        (coding-system-for-write (or org-export-html-coding-system
+                                     coding-system))
+        (save-buffer-coding-system (or org-export-html-coding-system
+                                       coding-system))
+        (charset (and coding-system-for-write
                       (fboundp 'coding-system-get)
-                      (coding-system-get coding-system 'mime-charset)))
+                      (coding-system-get coding-system-for-write
+                                         'mime-charset)))
+         (region
+          (buffer-substring
+           (if region-p (region-beginning) (point-min))
+           (if region-p (region-end) (point-max))))
+         (lines
+          (org-skip-comments (org-split-string
+                             (org-cleaned-string-for-export
+                              region
+                              :emph-multiline t
+                              :for-html t
+                              :skip-before-1st-heading
+                              (plist-get opt-plist :skip-before-1st-heading)
+                              :add-text
+                              (plist-get opt-plist :text)
+                              :LaTeX-fragments
+                              (plist-get opt-plist :LaTeX-fragments))
+                             "[\r\n]")))
         table-open type
         table-buffer table-orig-buffer
-        ind start-is-num starter
+        ind start-is-num starter didclose
         rpl path desc descp desc1 desc2 link
         )
+
+    (let (buffer-read-only)
+      (org-unmodified
+       (remove-text-properties (point-min) (point-max)
+                              '(:org-license-to-kill t))))
+
     (message "Exporting...")
 
     (setq org-last-level 1)
@@ -17465,9 +20981,7 @@ org-mode's default settings, but still inferior to file-local settings."
                          (assoc "en" org-export-language-setup)))
 
     ;; Switch to the output buffer
-    (if (or hidden t)
-        (set-buffer buffer)
-      (switch-to-buffer-other-window buffer))
+    (set-buffer buffer)
     (erase-buffer)
     (fundamental-mode)
     (let ((case-fold-search nil)
@@ -17483,10 +20997,10 @@ org-mode's default settings, but still inferior to file-local settings."
       (setq umax-toc (if (integerp org-export-with-toc)
                         (min org-export-with-toc umax)
                       umax))
-
-      ;; File header
-      (insert (format
-               "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
+      (unless body-only
+       ;; File header
+       (insert (format
+                "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
                \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">
 <html xmlns=\"http://www.w3.org/1999/xhtml\"
 lang=\"%s\" xml:lang=\"%s\">
@@ -17499,94 +21013,98 @@ lang=\"%s\" xml:lang=\"%s\">
 %s
 </head><body>
 "
-              language language (org-html-expand title) (or charset "iso-8859-1")
-              date time author style))
-
+                language language (org-html-expand title)
+                (or charset "iso-8859-1") date time author style))
 
-      (insert (or (plist-get opt-plist :preamble) ""))
+       (insert (or (plist-get opt-plist :preamble) ""))
 
-      (when (plist-get opt-plist :auto-preamble)
-       (if title     (insert (format org-export-html-title-format
-                                     (org-html-expand title))))
-       (if text      (insert "<p>\n" (org-html-expand text) "</p>")))
+       (when (plist-get opt-plist :auto-preamble)
+         (if title (insert (format org-export-html-title-format
+                                   (org-html-expand title))))))
 
-      (if org-export-with-toc
+      (if (and org-export-with-toc (not body-only))
          (progn
-           (insert (format "<h%d>%s</h%d>\n"
-                           org-export-html-toplevel-hlevel
-                           (nth 3 lang-words)
-                           org-export-html-toplevel-hlevel))
-           (insert "<ul>\n<li>")
+           (push (format "<h%d>%s</h%d>\n"
+                         org-export-html-toplevel-hlevel
+                         (nth 3 lang-words)
+                         org-export-html-toplevel-hlevel)
+                 thetoc)
+           (push "<ul>\n<li>" thetoc)
            (setq lines
-           (mapcar '(lambda (line)
-                      (if (string-match org-todo-line-regexp line)
-                          ;; This is a headline
-                          (progn
-                            (setq level (- (match-end 1) (match-beginning 1))
-                                  level (org-tr-level level)
-                                  txt (save-match-data
-                                        (org-html-expand
-                                         (org-export-cleanup-toc-line
-                                          (match-string 3 line))))
-                                  todo
-                                  (or (and org-export-mark-todo-in-toc
-                                           (match-beginning 2)
-                                           (not (equal (match-string 2 line)
-                                                       org-done-string)))
+                 (mapcar '(lambda (line)
+                   (if (string-match org-todo-line-regexp line)
+                       ;; This is a headline
+                       (progn
+                         (setq have-headings t)
+                         (setq level (- (match-end 1) (match-beginning 1))
+                               level (org-tr-level level)
+                               txt (save-match-data
+                                     (org-html-expand
+                                      (org-export-cleanup-toc-line
+                                       (match-string 3 line))))
+                               todo
+                               (or (and org-export-mark-todo-in-toc
+                                        (match-beginning 2)
+                                        (not (member (match-string 2 line)
+                                                     org-done-keywords)))
                                        ; TODO, not DONE
-                                      (and org-export-mark-todo-in-toc
-                                           (= level umax-toc)
-                                           (org-search-todo-below
-                                            line lines level))))
-                            (if (and (memq org-export-with-tags '(not-in-toc nil))
-                                     (string-match "[ \t]+:[a-zA-Z0-9_@:]+:[ \t]*$" txt))
-                                (setq txt (replace-match "" t t txt)))
-                            (if (string-match quote-re0 txt)
-                                (setq txt (replace-match "" t t txt)))
-                            (if org-export-with-section-numbers
-                                (setq txt (concat (org-section-number level)
-                                                  " " txt)))
-                            (if (<= level umax-toc)
-                                (progn
-                                  (setq head-count (+ head-count 1))
-                                  (if (> level org-last-level)
-                                      (progn
-                                        (setq cnt (- level org-last-level))
-                                        (while (>= (setq cnt (1- cnt)) 0)
-                                          (insert "\n<ul>\n<li>"))
-                                        (insert "\n")))
-                                  (if (< level org-last-level)
-                                      (progn
-                                        (setq cnt (- org-last-level level))
-                                        (while (>= (setq cnt (1- cnt)) 0)
-                                          (insert "</li>\n</ul>"))
-                                        (insert "\n")))
-                                  ;; Check for targets
-                                  (while (string-match org-target-regexp line)
-                                    (setq tg (match-string 1 line)
-                                          line (replace-match
-                                                (concat "@<span class=\"target\">" tg "@</span> ")
-                                                t t line))
-                                    (push (cons (org-solidify-link-text tg)
-                                                (format "sec-%d" head-count))
-                                          target-alist))
-                                  (while (string-match "&lt;\\(&lt;\\)+\\|&gt;\\(&gt;\\)+" txt)
-                                    (setq txt (replace-match "" t t txt)))
-                                  (insert
-                                   (format
-                                    (if todo
-                                        "</li>\n<li><a href=\"#sec-%d\"><span class=\"todo\">%s</span></a>"
-                                      "</li>\n<li><a href=\"#sec-%d\">%s</a>")
-                                    head-count txt))
-
-                                  (setq org-last-level level))
-                              )))
-                      line)
-                   lines))
+                                   (and org-export-mark-todo-in-toc
+                                        (= level umax-toc)
+                                        (org-search-todo-below
+                                         line lines level))))
+                         (if (and (memq org-export-with-tags '(not-in-toc nil))
+                                  (string-match
+                                   (org-re "[ \t]+:[[:alnum:]_@:]+:[ \t]*$")
+                                   txt))
+                             (setq txt (replace-match "" t t txt)))
+                         (if (string-match quote-re0 txt)
+                             (setq txt (replace-match "" t t txt)))
+                         (if org-export-with-section-numbers
+                             (setq txt (concat (org-section-number level)
+                                               " " txt)))
+                         (if (<= level (max umax umax-toc))
+                             (setq head-count (+ head-count 1)))
+                         (if (<= level umax-toc)
+                             (progn
+                               (if (> level org-last-level)
+                                   (progn
+                                     (setq cnt (- level org-last-level))
+                                     (while (>= (setq cnt (1- cnt)) 0)
+                                       (push "\n<ul>\n<li>" thetoc))
+                                     (push "\n" thetoc)))
+                               (if (< level org-last-level)
+                                   (progn
+                                     (setq cnt (- org-last-level level))
+                                     (while (>= (setq cnt (1- cnt)) 0)
+                                       (push "</li>\n</ul>" thetoc))
+                                     (push "\n" thetoc)))
+                               ;; Check for targets
+                               (while (string-match org-target-regexp line)
+                                 (setq tg (match-string 1 line)
+                                       line (replace-match
+                                             (concat "@<span class=\"target\">" tg "@</span> ")
+                                             t t line))
+                                 (push (cons (org-solidify-link-text tg)
+                                             (format "sec-%d" head-count))
+                                       target-alist))
+                               (while (string-match "&lt;\\(&lt;\\)+\\|&gt;\\(&gt;\\)+" txt)
+                                 (setq txt (replace-match "" t t txt)))
+                               (push
+                                (format
+                                 (if todo
+                                     "</li>\n<li><a href=\"#sec-%d\"><span class=\"todo\">%s</span></a>"
+                                   "</li>\n<li><a href=\"#sec-%d\">%s</a>")
+                                 head-count txt) thetoc)
+
+                               (setq org-last-level level))
+                           )))
+                   line)
+                         lines))
            (while (> org-last-level 0)
              (setq org-last-level (1- org-last-level))
-             (insert "</li>\n</ul>\n"))
-           ))
+             (push "</li>\n</ul>\n" thetoc))
+           (setq thetoc (if have-headings (nreverse thetoc) nil))))
+
       (setq head-count 0)
       (org-init-section-numbers)
 
@@ -17594,7 +21112,7 @@ lang=\"%s\" xml:lang=\"%s\">
        (catch 'nextline
 
          ;; end of quote section?
-         (when (and inquote (string-match "^\\*+" line))
+         (when (and inquote (string-match "^\\*+ " line))
            (insert "</pre>\n")
            (setq inquote nil))
          ;; inside a quote section?
@@ -17618,7 +21136,16 @@ lang=\"%s\" xml:lang=\"%s\">
 
          ;; Protected HTML
          (when (get-text-property 0 'org-protected line)
-           (insert line "\n")
+           (let (par)
+             (when (re-search-backward
+                    "\\(<p>\\)\\([ \t\r\n]*\\)\\=" (- (point) 100) t)
+               (setq par (match-string 1))
+               (replace-match "\\2\n"))
+             (insert line "\n")
+             (while (and lines
+                         (get-text-property 0 'org-protected (car lines)))
+               (insert (pop lines) "\n"))
+             (and par (insert "<p>\n")))
            (throw 'nextline nil))
 
          ;; Horizontal line
@@ -17676,7 +21203,8 @@ lang=\"%s\" xml:lang=\"%s\">
              (setq rpl
                    (concat
                     "<a href=\"#"
-                    (org-solidify-link-text path target-alist)
+                    (org-solidify-link-text
+                     (save-match-data (org-link-unescape path)) target-alist)
                     "\">" desc "</a>")))
             ((member type '("http" "https")) ; FIXME: need to test this.
              ;; standard URL, just check if we need to inline an image
@@ -17735,24 +21263,40 @@ lang=\"%s\" xml:lang=\"%s\">
                                "&gt;</i>"))))
            (setq line (replace-match rpl t t line)
                  start (+ start (length rpl))))
+
          ;; TODO items
          (if (and (string-match org-todo-line-regexp line)
                   (match-beginning 2))
-             (if (equal (match-string 2 line) org-done-string)
-                 (setq line (replace-match
-                             "<span class=\"done\">\\2</span>"
-                             t nil line 2))
-               (setq line (replace-match "<span class=\"todo\">\\2</span>"
-                                         t nil line 2))))
+
+              (setq line 
+                    (concat (substring line 0 (match-beginning 2))
+                            "<span class=\""
+                            (if (member (match-string 2 line)
+                                        org-done-keywords)
+                                "done" "todo")
+                            "\">" (match-string 2 line)
+                            "</span>" (substring line (match-end 2)))))
+
+         ;; Does this contain a reference to a footnote?
+         (when org-export-with-footnotes
+           (while (string-match "\\([^* \t].*?\\)\\[\\([0-9]+\\)\\]" line)
+             (let ((n (match-string 2 line)))
+               (setq line
+                     (replace-match
+                      (format
+                       "%s<sup><a class=\"footref\" name=\"fnr.%s\" href=\"#fn.%s\">%s</a></sup>"
+                       (match-string 1 line) n n n)
+                      t t line)))))
 
          (cond
-          ((string-match "^\\(\\*+\\)[ \t]*\\(.*\\)" line)
+          ((string-match "^\\(\\*+\\)[ \t]+\\(.*\\)" line)
            ;; This is a headline
            (setq level (org-tr-level (- (match-end 1) (match-beginning 1)))
                  txt (match-string 2 line))
            (if (string-match quote-re0 txt)
                (setq txt (replace-match "" t t txt)))
-           (if (<= level umax) (setq head-count (+ head-count 1)))
+           (if (<= level (max umax umax-toc))
+               (setq head-count (+ head-count 1)))
            (when in-local-list
              ;; Close any local lists before inserting a new header line
              (while local-list-num
@@ -17761,6 +21305,7 @@ lang=\"%s\" xml:lang=\"%s\">
                (pop local-list-num))
              (setq local-list-indent nil
                    in-local-list nil))
+           (setq first-heading-pos (or first-heading-pos (point)))
            (org-html-level-start level txt umax
                                  (and org-export-with-toc (<= level umax))
                                  head-count)
@@ -17801,11 +21346,15 @@ lang=\"%s\" xml:lang=\"%s\">
                    line (substring line (match-beginning 5)))
              (unless (string-match "[^ \t]" line)
                ;; empty line.  Pretend indentation is large.
-               (setq ind (1+ (or (car local-list-indent) 1))))
+               (setq ind (if org-empty-line-terminates-plain-lists
+                             0
+                           (1+ (or (car local-list-indent) 1)))))
+             (setq didclose nil)
              (while (and in-local-list
                          (or (and (= ind (car local-list-indent))
                                   (not starter))
                              (< ind (car local-list-indent))))
+               (setq didclose t)
                (org-close-li)
                (insert (if (car local-list-num) "</ol>\n" "</ul>"))
                (pop local-list-num) (pop local-list-indent)
@@ -17814,7 +21363,7 @@ lang=\"%s\" xml:lang=\"%s\">
               ((and starter
                     (or (not in-local-list)
                         (> ind (car local-list-indent))))
-               ;; Start new (level of ) list
+               ;; Start new (level of) list
                (org-close-par-maybe)
                (insert (if start-is-num "<ol>\n<li>\n" "<ul>\n<li>\n"))
                (push start-is-num local-list-num)
@@ -17823,7 +21372,10 @@ lang=\"%s\" xml:lang=\"%s\">
               (starter
                ;; continue current list
                (org-close-li)
-               (insert "<li>\n")))
+               (insert "<li>\n"))
+              (didclose
+               ;; we did close a list, normal text follows: need <p>
+               (org-open-par)))
              (if (string-match "^[ \t]*\\[\\([X ]\\)\\]" line)
                  (setq line
                        (replace-match
@@ -17837,6 +21389,14 @@ lang=\"%s\" xml:lang=\"%s\">
            ;; also start a new paragraph.
            (if (string-match "^ [-+*]-\\|^[ \t]*$" line) (org-open-par))
 
+           ;; Is this the start of a footnote?
+           (when org-export-with-footnotes
+             (when (string-match "^[ \t]*\\[\\([0-9]+\\)\\]" line)
+               (org-close-par-maybe)
+               (let ((n (match-string 1 line)))
+                 (setq line (replace-match
+                             (format "<p class=\"footnote\"><sup><a class=\"footnum\" name=\"fn.%s\" href=\"#fnr.%s\">%s</a></sup>" n n n) t t line)))))
+
            ;; Check if the line break needs to be conserved
            (cond
             ((string-match "\\\\\\\\[ \t]*$" line)
@@ -17860,24 +21420,43 @@ lang=\"%s\" xml:lang=\"%s\">
                            (and org-export-with-toc (<= level umax))
                            head-count)
 
-      (when (plist-get opt-plist :auto-postamble)
-       (when author
-         (insert "<p class=\"author\"> "
-                 (nth 1 lang-words) ": " author "\n")
-         (when email
-           (insert "<a href=\"mailto:" email "\">&lt;"
-                   email "&gt;</a>\n"))
-         (insert "</p>\n"))
-       (when (and date time)
-         (insert "<p class=\"date\"> "
-                 (nth 2 lang-words) ": "
-                 date " " time "</p>\n")))
-
-      (if org-export-html-with-timestamp
-         (insert org-export-html-html-helper-timestamp))
-      (insert (or (plist-get opt-plist :postamble) ""))
-      (insert "</body>\n</html>\n")
+      (unless body-only
+       (when (plist-get opt-plist :auto-postamble)
+         (when author
+           (insert "<p class=\"author\"> "
+                   (nth 1 lang-words) ": " author "\n")
+           (when email
+             (insert "<a href=\"mailto:" email "\">&lt;"
+                     email "&gt;</a>\n"))
+           (insert "</p>\n"))
+         (when (and date time)
+           (insert "<p class=\"date\"> "
+                   (nth 2 lang-words) ": "
+                   date " " time "</p>\n")))
+
+       (if org-export-html-with-timestamp
+           (insert org-export-html-html-helper-timestamp))
+       (insert (or (plist-get opt-plist :postamble) ""))
+       (insert "</body>\n</html>\n"))
+
       (normal-mode)
+      (if (eq major-mode default-major-mode) (html-mode))
+
+      ;; insert the table of contents
+      (goto-char (point-min))
+      (when thetoc
+       (if (or (re-search-forward
+                "<p>\\s-*\\[TABLE-OF-CONTENTS\\]\\s-*</p>" nil t)
+               (re-search-forward
+                "\\[TABLE-OF-CONTENTS\\]" nil t))
+           (progn
+             (goto-char (match-beginning 0))
+             (replace-match ""))
+         (goto-char first-heading-pos)
+         (when (looking-at "\\s-*</p>")
+           (goto-char (match-end 0))
+           (insert "\n")))
+       (mapc 'insert thetoc))
       ;; remove empty paragraphs and lists
       (goto-char (point-min))
       (while (re-search-forward "<p>[ \r\n\t]*</p>" nil t)
@@ -17885,13 +21464,62 @@ lang=\"%s\" xml:lang=\"%s\">
       (goto-char (point-min))
       (while (re-search-forward "<li>[ \r\n\t]*</li>\n?" nil t)
        (replace-match ""))
-      (save-buffer)
+      (or to-buffer (save-buffer))
       (goto-char (point-min))
-      (message "Exporting... done"))))
+      (message "Exporting... done")
+      (if (eq to-buffer 'string)
+         (prog1 (buffer-substring (point-min) (point-max))
+           (kill-buffer (current-buffer)))
+       (current-buffer)))))
+
+(defvar org-table-colgroup-info nil) ;; FIXME: mode to a better place
+(defun org-format-table-ascii (lines)
+  "Format a table for ascii export."
+  (if (stringp lines)
+      (setq lines (org-split-string lines "\n")))
+  (if (not (string-match "^[ \t]*|" (car lines)))
+      ;; Table made by table.el - test for spanning
+      lines
+
+    ;; A normal org table
+    ;; Get rid of hlines at beginning and end
+    (if (string-match "^[ \t]*|-" (car lines)) (setq lines (cdr lines)))
+    (setq lines (nreverse lines))
+    (if (string-match "^[ \t]*|-" (car lines)) (setq lines (cdr lines)))
+    (setq lines (nreverse lines))
+    (when org-export-table-remove-special-lines
+      ;; Check if the table has a marking column.  If yes remove the
+      ;; column and the special lines
+      (setq lines (org-table-clean-before-export lines)))
+    ;; Get rid of the vertical lines except for grouping
+    (let ((vl (org-colgroup-info-to-vline-list org-table-colgroup-info))
+         rtn line vl1 start)
+      (while (setq line (pop lines))
+       (if (string-match org-table-hline-regexp line)
+           (and (string-match "|\\(.*\\)|" line)
+                (setq line (replace-match " \\1" t nil line)))
+         (setq start 0 vl1 vl)
+         (while (string-match "|" line start)
+           (setq start (match-end 0))
+           (or (pop vl1) (setq line (replace-match " " t t line)))))
+       (push line rtn))
+      (nreverse rtn))))
+
+(defun org-colgroup-info-to-vline-list (info)
+  (let (vl new last)
+    (while info
+      (setq last new new (pop info))
+      (if (or (memq last '(:end :startend))
+             (memq new  '(:start :startend)))
+         (push t vl)
+       (push nil vl)))
+    (setq vl (cons nil (nreverse vl)))))
 
 
 (defun org-format-table-html (lines olines)
   "Find out which HTML converter to use and return the HTML code."
+  (if (stringp lines)
+      (setq lines (org-split-string lines "\n")))
   (if (string-match "^[ \t]*|" (car lines))
       ;; A normal org table
       (org-format-org-table-html lines)
@@ -17931,7 +21559,7 @@ lang=\"%s\" xml:lang=\"%s\">
                              (lambda (x) (string-match "^[ \t]*|-" x))
                              (cdr lines)))))
        (nlines 0) fnum i
-       tbopen line fields html)
+       tbopen line fields html gr colgropen)
     (if splice (setq head nil))
     (unless splice (push (if head "<thead>" "<tbody>") html))
     (setq tbopen t)
@@ -17957,8 +21585,10 @@ lang=\"%s\" xml:lang=\"%s\">
                                  (string-match org-table-number-regexp x))
                             (incf (aref fnum i)))
                         (if head
-                            (concat "<th>" x "</th>")
-                          (concat "<td>" x "</td>")))
+                            (concat (car org-export-table-header-tags) x
+                                    (cdr org-export-table-header-tags))
+                          (concat (car org-export-table-data-tags) x
+                                  (cdr org-export-table-data-tags))))
                       fields "")
                      "</tr>")
              html)))
@@ -17969,45 +21599,73 @@ lang=\"%s\" xml:lang=\"%s\">
       ;; Put in COL tags with the alignment (unfortuntely often ignored...)
       (push (mapconcat
             (lambda (x)
-              (format "<COL align=\"%s\">"
+              (setq gr (pop org-table-colgroup-info))
+              (format "%s<COL align=\"%s\"></COL>%s"
+                      (if (memq gr '(:start :startend)) 
+                          (prog1
+                              (if colgropen "</colgroup>\n<colgroup>" "<colgroup>")
+                            (setq colgropen t))
+                        "")
                       (if (> (/ (float x) nlines) org-table-number-fraction)
-                          "right" "left")))
+                          "right" "left")
+                      (if (memq gr '(:end :startend)) 
+                          (progn (setq colgropen nil) "</colgroup>")
+                        "")))
             fnum "")
            html)
+      (if colgropen (setq html (cons (car html) (cons "</colgroup>" (cdr html)))))
       (push org-export-html-table-tag html))
     (concat (mapconcat 'identity html "\n") "\n")))
 
 (defun org-table-clean-before-export (lines)
   "Check if the table has a marking column.
 If yes remove the column and the special lines."
+  (setq org-table-colgroup-info nil)
   (if (memq nil
            (mapcar
             (lambda (x) (or (string-match "^[ \t]*|-" x)
                             (string-match "^[ \t]*| *\\([#!$*_^ /]\\) *|" x)))
             lines))
       (progn
-       (setq org-table-clean-did-remove-column-1 nil)
-       lines)
-    (setq org-table-clean-did-remove-column-1 t)
+       (setq org-table-clean-did-remove-column nil)
+       (delq nil
+             (mapcar
+              (lambda (x)
+                (cond
+                 ((string-match  "^[ \t]*| */ *|" x)
+                  (setq org-table-colgroup-info
+                        (mapcar (lambda (x)
+                                  (cond ((member x '("<" "&lt;")) :start)
+                                        ((member x '(">" "&gt;")) :end)
+                                        ((member x '("<>" "&lt;&gt;")) :startend)
+                                        (t nil)))
+                                (org-split-string x "[ \t]*|[ \t]*")))
+                  nil)
+                 (t x)))
+              lines)))
+    (setq org-table-clean-did-remove-column t)
     (delq nil
          (mapcar
-          (lambda (x) (if (string-match "^[ \t]*| *[!_^/] *|" x)
-                          nil ; ignore this line
-                        (and (or (string-match "^[ \t]*|-+\\+" x)
-                                 (string-match "^[ \t]*|[^|]*|" x))
-                             (replace-match "|" t t x))))
+          (lambda (x)
+            (cond
+             ((string-match  "^[ \t]*| */ *|" x)
+              (setq org-table-colgroup-info
+                    (mapcar (lambda (x)
+                              (cond ((member x '("<" "&lt;")) :start)
+                                    ((member x '(">" "&gt;")) :end)
+                                    ((member x '("<>" "&lt;&gt;")) :startend)
+                                    (t nil)))
+                            (cdr (org-split-string x "[ \t]*|[ \t]*"))))
+              nil)
+             ((string-match "^[ \t]*| *[!_^/] *|" x)
+              nil) ; ignore this line
+             ((or (string-match "^\\([ \t]*\\)|-+\\+" x)
+                  (string-match "^\\([ \t]*\\)|[^|]*|" x))
+              ;; remove the first column
+              (replace-match "\\1|" t nil x))
+             (t (error "This should not happen"))))
           lines))))
 
-(defun org-fake-empty-table-line (line)
-  "Replace everything except \"|\" with spaces."
-  (let ((i (length line))
-       (newstr (copy-sequence line)))
-    (while (> i 0)
-      (setq i (1- i))
-      (if (not (eq (aref newstr i) ?|))
-         (aset newstr i ?\ )))
-    newstr))
-
 (defun org-format-table-table-html (lines)
   "Format a table generated by table.el into HTML.
 This conversion does *not* use `table-generate-source' from table.el.
@@ -18024,17 +21682,21 @@ But it has the disadvantage, that no cell- or row-spanning is allowed."
            (progn
              (if field-buffer
                  (progn
-                   (setq html (concat
-                               html
-                               "<tr>"
-                               (mapconcat
-                                (lambda (x)
-                                  (if (equal x "") (setq x empty))
-                                  (if head
-                                      (concat "<th>" x "</th>\n")
-                                    (concat "<td>" x "</td>\n")))
-                                field-buffer "\n")
-                               "</tr>\n"))
+                   (setq
+                    html
+                    (concat
+                     html
+                     "<tr>"
+                     (mapconcat
+                      (lambda (x)
+                        (if (equal x "") (setq x empty))
+                        (if head
+                            (concat (car org-export-table-header-tags) x
+                                    (cdr org-export-table-header-tags))
+                          (concat (car org-export-table-data-tags) x
+                                  (cdr org-export-table-data-tags))))
+                      field-buffer "\n")
+                     "</tr>\n"))
                    (setq head nil)
                    (setq field-buffer nil)))
              ;; Ignore this line
@@ -18110,11 +21772,14 @@ But it has the disadvantage, that Org-mode's HTML conversions cannot be used."
 
 (defun org-export-cleanup-toc-line (s)
   "Remove tags and time staps from lines going into the toc."
-  (if (string-match " +:[a-zA-Z0-9_@:]+: *$" s)
+  (if (string-match (org-re " +:[[:alnum:]_@:]+: *$") s)
       (setq s (replace-match "" t t s)))
   (when org-export-remove-timestamps-from-toc
     (while (string-match org-maybe-keyword-time-regexp s)
       (setq s (replace-match "" t t s))))
+  (while (string-match org-bracket-link-regexp s)
+    (setq s (replace-match (match-string (if (match-end 3) 3 1) s)
+                          t t s)))
   s)
 
 (defun org-html-expand (string)
@@ -18179,27 +21844,42 @@ stacked delimiters is N.  Escaping delimiters is not possible."
    "\\(\\(?:\\*\\|[-+]?[^-+*!@#$%^_ \t\r\n,:\"?<>~;./{}=()]+\\)\\)\\)")
   "The regular expression matching a sub- or superscript.")
 
+;(let ((s "a\\_b"))
+;  (and (string-match org-match-substring-regexp s)
+;       (conca      t (match-string 1 s) ":::" (match-string 2 s))))
+
 (defun org-export-html-convert-sub-super (string)
   "Convert sub- and superscripts in STRING to HTML."
-  (let (key c)
-    (while (string-match org-match-substring-regexp string)
-      (setq key (if (string= (match-string 2 string) "_") "sub" "sup"))
-      (setq c (or (match-string 8 string)
-                 (match-string 6 string)
-                 (match-string 5 string)))
-      (setq string (replace-match
-                   (concat (match-string 1 string)
-                           "<" key ">" c "</" key ">")
-                   t t string)))
+  (let (key c (s 0) (requireb (eq org-export-with-sub-superscripts '{})))
+    (while (string-match org-match-substring-regexp string s)
+      (if (and requireb (match-end 8))
+         (setq s (match-end 2))
+       (setq s (match-end 1)
+             key (if (string= (match-string 2 string) "_") "sub" "sup")
+             c (or (match-string 8 string)
+                   (match-string 6 string)
+                   (match-string 5 string))
+             string (replace-match
+                     (concat (match-string 1 string)
+                             "<" key ">" c "</" key ">")
+                     t t string))))
     (while (string-match "\\\\\\([_^]\\)" string)
-      (setq string (replace-match (match-string 1 string) t t string))))
-  string)
+      (setq string (replace-match (match-string 1 string) t t string)))
+    string))
 
 (defun org-export-html-convert-emphasize (string)
   "Apply emphasis."
-  (while (string-match org-emph-re string)
-    (setq string (replace-match (concat "\\1" (nth 2 (assoc (match-string 3 string) org-emphasis-alist)) "\\4" (nth 3 (assoc (match-string 3 string) org-emphasis-alist)) "\\5") t nil string)))
-  string)
+  (let ((s 0))
+    (while (string-match org-emph-re string s)
+      (if (not (equal
+               (substring string (match-beginning 3) (1+ (match-beginning 3)))
+               (substring string (match-beginning 4) (1+ (match-beginning 4)))))
+         (setq string (replace-match
+                       (concat "\\1" (nth 2 (assoc (match-string 3 string) org-emphasis-alist))
+                               "\\4" (nth 3 (assoc (match-string 3 string) org-emphasis-alist))
+                               "\\5") t nil string))
+       (setq s (1+ s))))
+    string))
 
 (defvar org-par-open nil)
 (defun org-open-par ()
@@ -18216,11 +21896,8 @@ stacked delimiters is N.  Escaping delimiters is not possible."
   "Close <li> if necessary."
   (org-close-par-maybe)
   (insert "</li>\n"))
-;  (when (save-excursion
-;        (re-search-backward "</?\\(ul\\|ol\\|li\\|[hH][0-9]\\)>" nil t))
-;    (if (member (match-string 0) '("</ul>" "</ol>" "<li>"))
-;      (insert "</li>"))))
 
+(defvar body-only) ; dynamically scoped into this.
 (defun org-html-level-start (level title umax with-toc head-count)
   "Insert a new level in HTML export.
 When TITLE is nil, just close all open levels."
@@ -18235,7 +21912,7 @@ When TITLE is nil, just close all open levels."
     (when title
       ;; If title is nil, this means this function is called to close
       ;; all levels, so the rest is done only if title is given
-       (when (string-match "\\(:[a-zA-Z0-9_@:]+:\\)[ \t]*$" title)
+       (when (string-match (org-re "\\(:[[:alnum:]_@:]+:\\)[ \t]*$") title)
          (setq title (replace-match
                       (if org-export-with-tags
                           (save-match-data
@@ -18256,11 +21933,11 @@ When TITLE is nil, just close all open levels."
              (aset org-levels-open (1- level) t)
              (org-close-par-maybe)
              (insert "<ul>\n<li>" title "<br/>\n")))
-       (if org-export-with-section-numbers
+       (if (and org-export-with-section-numbers (not body-only))
            (setq title (concat (org-section-number level) " " title)))
        (setq level (+ level org-export-html-toplevel-hlevel -1))
        (if with-toc
-           (insert (format "\n<h%d><a name=\"sec-%d\">%s</a></h%d>\n"
+           (insert (format "\n<h%d id=\"sec-%d\">%s</h%d>\n"
                            level head-count title level))
          (insert (format "\n<h%d>%s</h%d>\n" level title level)))
        (org-open-par)))))
@@ -18268,7 +21945,7 @@ When TITLE is nil, just close all open levels."
 (defun org-html-level-close (&rest args)
   "Terminate one level in HTML export."
   (org-close-li)
-  (insert "</ul>"))
+  (insert "</ul>\n"))
 
 ;;; iCalendar export
 
@@ -18300,11 +21977,13 @@ The file is stored under the name `org-combined-agenda-icalendar-file'."
 If COMBINE is non-nil, combine all calendar entries into a single large
 file and store it under the name `org-combined-agenda-icalendar-file'."
   (save-excursion
+    (org-prepare-agenda-buffers files)
     (let* ((dir (org-export-directory
                 :ical (list :publishing-directory
                             org-export-publishing-directory)))
           file ical-file ical-buffer category started org-agenda-new-buffers)
 
+      (and (get-buffer "*ical-tmp*") (kill-buffer "*ical-tmp*"))
       (when combine
        (setq ical-file
              (if (file-name-absolute-p org-combined-agenda-icalendar-file)
@@ -18349,70 +22028,116 @@ the iCalendar file.")
 (defun org-print-icalendar-entries (&optional combine)
   "Print iCalendar entries for the current Org-mode file to `standard-output'.
 When COMBINE is non nil, add the category to each line."
-  (let ((re2 (concat "--?-?\\(" org-ts-regexp "\\)"))
+  (let ((re1 (concat org-ts-regexp "\\|<%%([^>\n]+>"))
+       (re2 (concat "--?-?\\(" org-ts-regexp "\\)"))
        (org-category-table (org-get-category-table))
        (dts (org-ical-ts-to-string
              (format-time-string (cdr org-time-stamp-formats) (current-time))
              "DTSTART"))
-       hd ts ts2 state status (inc t) pos
-       scheduledp deadlinep tmp pri category)
+       hd ts ts2 state status (inc t) pos b sexp rrule
+       scheduledp deadlinep tmp pri category
+       (sexp-buffer (get-buffer-create "*ical-tmp*")))
     (save-excursion
       (goto-char (point-min))
-      (while (re-search-forward org-ts-regexp nil t)
-       (setq pos (match-beginning 0)
-             ts (match-string 0)
-             inc t
-             hd (org-get-heading)
-             category (org-get-category))
-       (if (looking-at re2)
-           (progn
-             (goto-char (match-end 0))
-             (setq ts2 (match-string 1) inc nil))
-         (setq ts2 ts
-               tmp (buffer-substring (max (point-min)
+      (while (re-search-forward re1 nil t)
+       (catch :skip
+         (org-agenda-skip)
+         (setq pos (match-beginning 0)
+               ts (match-string 0)
+               inc t
+               hd (org-get-heading)
+               category (org-get-category))
+         (if (looking-at re2)
+             (progn
+               (goto-char (match-end 0))
+               (setq ts2 (match-string 1) inc nil))
+           (setq tmp (buffer-substring (max (point-min)
                                             (- pos org-ds-keyword-length))
-                                     pos)
-               deadlinep (string-match org-deadline-regexp tmp)
-               scheduledp (string-match org-scheduled-regexp tmp)
-               ;; donep (org-entry-is-done-p)
-                ))
-       (if (or (string-match org-tr-regexp hd)
-               (string-match org-ts-regexp hd))
-           (setq hd (replace-match "" t t hd)))
-       (if (string-match org-bracket-link-regexp hd)
-           (setq hd (replace-match (if (match-end 3) (match-string 3 hd)
-                                     (match-string 1 hd))
-                                   t t hd)))
-       (if deadlinep (setq hd (concat "DL: " hd)))
-       (if scheduledp (setq hd (concat "S: " hd)))
-       (princ (format "BEGIN:VEVENT
-%s
+                                       pos)
+                 ts2 (if (string-match "[0-9]\\{1,2\\}:[0-9][0-9]-\\([0-9]\\{1,2\\}:[0-9][0-9]\\)" ts)
+                         (progn
+                           (setq inc nil)
+                           (replace-match "\\1" t nil ts))
+                       ts)
+                 deadlinep (string-match org-deadline-regexp tmp)
+                 scheduledp (string-match org-scheduled-regexp tmp)
+                 ;; donep (org-entry-is-done-p)
+                 ))
+         (if (or (string-match org-tr-regexp hd)
+                 (string-match org-ts-regexp hd))
+             (setq hd (replace-match "" t t hd)))
+         (if (string-match "\\+\\([0-9]+\\)\\([dwmy]\\)>" ts)
+             (setq rrule
+                   (concat "\nRRULE:FREQ="
+                           (cdr (assoc
+                                 (match-string 2 ts)
+                                 '(("d" . "DAILY")("w" . "WEEKLY")
+                                   ("m" . "MONTHLY")("y" . "YEARLY"))))
+                           ";INTERVAL=" (match-string 1 ts)))
+           (setq rrule ""))
+         (if (string-match org-bracket-link-regexp hd)
+             (setq hd (replace-match (if (match-end 3) (match-string 3 hd)
+                                       (match-string 1 hd))
+                                     t t hd)))
+         (if deadlinep (setq hd (concat "DL: " hd)))
+         (if scheduledp (setq hd (concat "S: " hd)))
+         (if (string-match "\\`<%%" ts)
+             (with-current-buffer sexp-buffer
+               (insert (substring ts 1 -1) " " hd "\n"))
+           (princ (format "BEGIN:VEVENT
 %s
+%s%s
 SUMMARY:%s
 CATEGORIES:%s
 END:VEVENT\n"
-                      (org-ical-ts-to-string ts "DTSTART")
-                      (org-ical-ts-to-string ts2 "DTEND" inc)
-                      hd category)))
+                          (org-ical-ts-to-string ts "DTSTART")
+                          (org-ical-ts-to-string ts2 "DTEND" inc)
+                          rrule hd category)))))
+
+      (when (and org-icalendar-include-sexps
+                (condition-case nil (require 'icalendar) (error nil))
+                (fboundp 'icalendar-export-region))
+       ;; Get all the literal sexps
+       (goto-char (point-min))
+       (while (re-search-forward "^&?%%(" nil t)
+         (catch :skip
+           (org-agenda-skip)
+           (setq b (match-beginning 0))
+           (goto-char (1- (match-end 0)))
+           (forward-sexp 1)
+           (end-of-line 1)
+           (setq sexp (buffer-substring b (point)))
+           (with-current-buffer sexp-buffer
+             (insert sexp "\n"))
+           (princ (org-diary-to-ical-string sexp-buffer)))))
+
       (when org-icalendar-include-todo
        (goto-char (point-min))
        (while (re-search-forward org-todo-line-regexp nil t)
-         (setq state (match-string 2))
-         (setq status (if (equal state org-done-string)
-                          "COMPLETED" "NEEDS-ACTION"))
-         (when (and state
-                    (or (not (equal state org-done-string))
-                        (eq org-icalendar-include-todo 'all)))
-           (setq hd (match-string 3))
-           (if (string-match org-priority-regexp hd)
-               (setq pri (string-to-char (match-string 2 hd))
-                     hd (concat (substring hd 0 (match-beginning 1))
-                                (substring hd (match-end 1))))
-             (setq pri org-default-priority))
-           (setq pri (floor (1+ (* 8. (/ (float (- org-lowest-priority pri))
-                                         (- org-lowest-priority ?A))))))
-
-           (princ (format "BEGIN:VTODO
+         (catch :skip
+           (org-agenda-skip)
+           (setq state (match-string 2))
+           (setq status (if (member state org-done-keywords)
+                            "COMPLETED" "NEEDS-ACTION"))
+           (when (and state
+                      (or (not (member state org-done-keywords))
+                          (eq org-icalendar-include-todo 'all))
+                      (not (member org-archive-tag (org-get-tags-at)))
+                      )
+             (setq hd (match-string 3))
+             (if (string-match org-bracket-link-regexp hd)
+                 (setq hd (replace-match (if (match-end 3) (match-string 3 hd)
+                                           (match-string 1 hd))
+                                         t t hd)))
+             (if (string-match org-priority-regexp hd)
+                 (setq pri (string-to-char (match-string 2 hd))
+                       hd (concat (substring hd 0 (match-beginning 1))
+                                  (substring hd (match-end 1))))
+               (setq pri org-default-priority))
+             (setq pri (floor (1+ (* 8. (/ (float (- org-lowest-priority pri))
+                                           (- org-lowest-priority org-highest-priority))))))
+
+             (princ (format "BEGIN:VTODO
 %s
 SUMMARY:%s
 CATEGORIES:%s
@@ -18420,7 +22145,7 @@ SEQUENCE:1
 PRIORITY:%d
 STATUS:%s
 END:VTODO\n"
-                          dts hd category pri status))))))))
+                            dts hd category pri status)))))))))
 
 (defun org-start-icalendar-file (name)
   "Start an iCalendar file by inserting the header."
@@ -18487,7 +22212,7 @@ The XOXO buffer is named *xoxo-<source buffer name>*"
       (with-current-buffer out (erase-buffer))
       ;; Kick off the output
       (org-export-as-xoxo-insert-into out "<ol class='xoxo'>\n")
-      (while (re-search-forward "^\\(\\*+\\) \\(.+\\)" (point-max) 't)
+      (while (re-search-forward "^\\(\\*+\\)[ \t]+\\(.+\\)" (point-max) 't)
         (let* ((hd (match-string-no-properties 1))
                (level (length hd))
                (text (concat
@@ -18545,47 +22270,44 @@ The XOXO buffer is named *xoxo-<source buffer name>*"
 
 ;;;; Key bindings
 
-;; - Bindings in Org-mode map are currently
-;;   0123456789abcdefghijklmnopqrstuvwxyz!?@#$%^&-+*/=()_{}[]:;"|,.<>~`'\t  the alphabet
-;;             abcd fgh j lmnopqrstuvwxyz!? #$ ^ -+*/=     [] ; |,.<>~ '\t  necessary bindings
-;;                 e                                                        (?) useful from outline-mode
-;;                     i k                 @                                expendable from outline-mode
-;;   0123456789                               % &     ()_{}    "      `     free
-
 ;; Make `C-c C-x' a prefix key
-(define-key org-mode-map "\C-c\C-x" (make-sparse-keymap))
+(org-defkey org-mode-map "\C-c\C-x" (make-sparse-keymap))
 
 ;; TAB key with modifiers
-(define-key org-mode-map "\C-i"       'org-cycle)
-(define-key org-mode-map [(tab)]      'org-cycle)
-(define-key org-mode-map [(control tab)] 'org-force-cycle-archived)
-(define-key org-mode-map [(meta tab)] 'org-complete)
-(define-key org-mode-map "\M-\t" 'org-complete)
-(define-key org-mode-map "\M-\C-i"      'org-complete)
+(org-defkey org-mode-map "\C-i"       'org-cycle)
+(org-defkey org-mode-map [(tab)]      'org-cycle)
+(org-defkey org-mode-map [(control tab)] 'org-force-cycle-archived)
+(org-defkey org-mode-map [(meta tab)] 'org-complete)
+(org-defkey org-mode-map "\M-\t" 'org-complete)
+(org-defkey org-mode-map "\M-\C-i"      'org-complete)
 ;; The following line is necessary under Suse GNU/Linux
 (unless (featurep 'xemacs)
-  (define-key org-mode-map [S-iso-lefttab]  'org-shifttab))
-(define-key org-mode-map [(shift tab)]    'org-shifttab)
+  (org-defkey org-mode-map [S-iso-lefttab]  'org-shifttab))
+(org-defkey org-mode-map [(shift tab)]    'org-shifttab)
+(define-key org-mode-map (kbd "<backtab>") 'org-shifttab)
 
-(define-key org-mode-map (org-key 'S-return)   'org-table-copy-down)
-(define-key org-mode-map [(meta shift return)] 'org-insert-todo-heading)
-(define-key org-mode-map [(meta return)]       'org-meta-return)
+(org-defkey org-mode-map [(shift return)]   'org-table-copy-down)
+(org-defkey org-mode-map [(meta shift return)] 'org-insert-todo-heading)
+(org-defkey org-mode-map [(meta return)]       'org-meta-return)
 
 ;; Cursor keys with modifiers
-(define-key org-mode-map [(meta left)]  'org-metaleft)
-(define-key org-mode-map [(meta right)] 'org-metaright)
-(define-key org-mode-map [(meta up)]    'org-metaup)
-(define-key org-mode-map [(meta down)]  'org-metadown)
+(org-defkey org-mode-map [(meta left)]  'org-metaleft)
+(org-defkey org-mode-map [(meta right)] 'org-metaright)
+(org-defkey org-mode-map [(meta up)]    'org-metaup)
+(org-defkey org-mode-map [(meta down)]  'org-metadown)
+
+(org-defkey org-mode-map [(meta shift left)]   'org-shiftmetaleft)
+(org-defkey org-mode-map [(meta shift right)]  'org-shiftmetaright)
+(org-defkey org-mode-map [(meta shift up)]     'org-shiftmetaup)
+(org-defkey org-mode-map [(meta shift down)]   'org-shiftmetadown)
 
-(define-key org-mode-map [(meta shift left)]   'org-shiftmetaleft)
-(define-key org-mode-map [(meta shift right)]  'org-shiftmetaright)
-(define-key org-mode-map [(meta shift up)]     'org-shiftmetaup)
-(define-key org-mode-map [(meta shift down)]   'org-shiftmetadown)
+(org-defkey org-mode-map [(shift up)]          'org-shiftup)
+(org-defkey org-mode-map [(shift down)]        'org-shiftdown)
+(org-defkey org-mode-map [(shift left)]        'org-shiftleft)
+(org-defkey org-mode-map [(shift right)]       'org-shiftright)
 
-(define-key org-mode-map (org-key 'S-up)       'org-shiftup)
-(define-key org-mode-map (org-key 'S-down)     'org-shiftdown)
-(define-key org-mode-map (org-key 'S-left)     'org-shiftleft)
-(define-key org-mode-map (org-key 'S-right)    'org-shiftright)
+(org-defkey org-mode-map [(control shift right)] 'org-shiftcontrolright)
+(org-defkey org-mode-map [(control shift left)]  'org-shiftcontrolleft)
 
 ;;; Extra keys for tty access.
 ;;  We only set them when really needed because otherwise the
@@ -18593,102 +22315,107 @@ The XOXO buffer is named *xoxo-<source buffer name>*"
 
 (when (or (featurep 'xemacs)   ;; because XEmacs supports multi-device stuff
          (not window-system))
-  (define-key org-mode-map "\C-c\C-xc"    'org-table-copy-down)
-  (define-key org-mode-map "\C-c\C-xM"    'org-insert-todo-heading)
-  (define-key org-mode-map "\C-c\C-xm"    'org-meta-return)
-  (define-key org-mode-map [?\e (return)] 'org-meta-return)
-  (define-key org-mode-map [?\e (left)]   'org-metaleft)
-  (define-key org-mode-map "\C-c\C-xl"    'org-metaleft)
-  (define-key org-mode-map [?\e (right)]  'org-metaright)
-  (define-key org-mode-map "\C-c\C-xr"    'org-metaright)
-  (define-key org-mode-map [?\e (up)]     'org-metaup)
-  (define-key org-mode-map "\C-c\C-xu"    'org-metaup)
-  (define-key org-mode-map [?\e (down)]   'org-metadown)
-  (define-key org-mode-map "\C-c\C-xd"    'org-metadown)
-  (define-key org-mode-map "\C-c\C-xL"    'org-shiftmetaleft)
-  (define-key org-mode-map "\C-c\C-xR"    'org-shiftmetaright)
-  (define-key org-mode-map "\C-c\C-xU"    'org-shiftmetaup)
-  (define-key org-mode-map "\C-c\C-xD"    'org-shiftmetadown)
-  (define-key org-mode-map [?\C-c ?\C-x (up)]    'org-shiftup)
-  (define-key org-mode-map [?\C-c ?\C-x (down)]  'org-shiftdown)
-  (define-key org-mode-map [?\C-c ?\C-x (left)]  'org-shiftleft)
-  (define-key org-mode-map [?\C-c ?\C-x (right)] 'org-shiftright))
+  (org-defkey org-mode-map "\C-c\C-xc"    'org-table-copy-down)
+  (org-defkey org-mode-map "\C-c\C-xM"    'org-insert-todo-heading)
+  (org-defkey org-mode-map "\C-c\C-xm"    'org-meta-return)
+  (org-defkey org-mode-map [?\e (return)] 'org-meta-return)
+  (org-defkey org-mode-map [?\e (left)]   'org-metaleft)
+  (org-defkey org-mode-map "\C-c\C-xl"    'org-metaleft)
+  (org-defkey org-mode-map [?\e (right)]  'org-metaright)
+  (org-defkey org-mode-map "\C-c\C-xr"    'org-metaright)
+  (org-defkey org-mode-map [?\e (up)]     'org-metaup)
+  (org-defkey org-mode-map "\C-c\C-xu"    'org-metaup)
+  (org-defkey org-mode-map [?\e (down)]   'org-metadown)
+  (org-defkey org-mode-map "\C-c\C-xd"    'org-metadown)
+  (org-defkey org-mode-map "\C-c\C-xL"    'org-shiftmetaleft)
+  (org-defkey org-mode-map "\C-c\C-xR"    'org-shiftmetaright)
+  (org-defkey org-mode-map "\C-c\C-xU"    'org-shiftmetaup)
+  (org-defkey org-mode-map "\C-c\C-xD"    'org-shiftmetadown)
+  (org-defkey org-mode-map [?\C-c (up)]    'org-shiftup)
+  (org-defkey org-mode-map [?\C-c (down)]  'org-shiftdown)
+  (org-defkey org-mode-map [?\C-c (left)]  'org-shiftleft)
+  (org-defkey org-mode-map [?\C-c (right)] 'org-shiftright)
+  (org-defkey org-mode-map [?\C-c ?\C-x (right)] 'org-shiftcontrolright)
+  (org-defkey org-mode-map [?\C-c ?\C-x (left)] 'org-shiftcontrolleft))
 
   ;; All the other keys
 
-(define-key org-mode-map "\C-c\C-a" 'show-all)  ; in case allout messed up.
-(define-key org-mode-map "\C-c\C-r" 'org-reveal)
-(define-key org-mode-map "\C-xns" 'org-narrow-to-subtree)
-(define-key org-mode-map "\C-c$"    'org-archive-subtree)
-(define-key org-mode-map "\C-c\C-x\C-s" 'org-advertized-archive-subtree)
-(define-key org-mode-map "\C-c\C-x\C-a" 'org-toggle-archive-tag)
-(define-key org-mode-map "\C-c\C-xb" 'org-tree-to-indirect-buffer)
-(define-key org-mode-map "\C-c\C-j" 'org-goto)
-(define-key org-mode-map "\C-c\C-t" 'org-todo)
-(define-key org-mode-map "\C-c\C-s" 'org-schedule)
-(define-key org-mode-map "\C-c\C-d" 'org-deadline)
-(define-key org-mode-map "\C-c;"    'org-toggle-comment)
-(define-key org-mode-map "\C-c\C-v" 'org-show-todo-tree)
-(define-key org-mode-map "\C-c\C-w" 'org-check-deadlines)
-(define-key org-mode-map "\C-c/"    'org-occur)   ; Minor-mode reserved
-(define-key org-mode-map "\C-c\\"   'org-tags-sparse-tree) ; Minor-mode res.
-(define-key org-mode-map "\C-c\C-m" 'org-insert-heading)
-(define-key org-mode-map "\M-\C-m"  'org-insert-heading)
-(define-key org-mode-map "\C-c\C-x\C-n" 'org-next-link)
-(define-key org-mode-map "\C-c\C-x\C-p" 'org-previous-link)
-(define-key org-mode-map "\C-c\C-l" 'org-insert-link)
-(define-key org-mode-map "\C-c\C-o" 'org-open-at-point)
-(define-key org-mode-map "\C-c%"    'org-mark-ring-push)
-(define-key org-mode-map "\C-c&"    'org-mark-ring-goto)
-(define-key org-mode-map "\C-c\C-z" 'org-time-stamp)  ; Alternative binding
-(define-key org-mode-map "\C-c."    'org-time-stamp)  ; Minor-mode reserved
-(define-key org-mode-map "\C-c!"    'org-time-stamp-inactive) ; Minor-mode r.
-(define-key org-mode-map "\C-c,"    'org-priority)    ; Minor-mode reserved
-(define-key org-mode-map "\C-c\C-y" 'org-evaluate-time-range)
-(define-key org-mode-map "\C-c>"    'org-goto-calendar)
-(define-key org-mode-map "\C-c<"    'org-date-from-calendar)
-(define-key org-mode-map [(control ?,)]     'org-cycle-agenda-files)
-(define-key org-mode-map [(control ?\')]     'org-cycle-agenda-files)
-(define-key org-mode-map "\C-c["    'org-agenda-file-to-front)
-(define-key org-mode-map "\C-c]"    'org-remove-file)
-(define-key org-mode-map "\C-c-"    'org-table-insert-hline)
-(define-key org-mode-map "\C-c^"    'org-sort)
-(define-key org-mode-map "\C-c\C-c" 'org-ctrl-c-ctrl-c)
-(define-key org-mode-map "\C-c#"    'org-update-checkbox-count)
-(define-key org-mode-map "\C-m"     'org-return)
-(define-key org-mode-map "\C-c?"    'org-table-field-info)
-(define-key org-mode-map "\C-c "    'org-table-blank-field)
-(define-key org-mode-map "\C-c+"    'org-table-sum)
-(define-key org-mode-map "\C-c="    'org-table-eval-formula)
-(define-key org-mode-map "\C-c'"    'org-table-edit-formulas)
-(define-key org-mode-map "\C-c`"    'org-table-edit-field)
-(define-key org-mode-map "\C-c|"    'org-table-create-or-convert-from-region)
-(define-key org-mode-map "\C-c*"    'org-table-recalculate)
-(define-key org-mode-map [(control ?#)] 'org-table-rotate-recalc-marks)
-(define-key org-mode-map "\C-c~"    'org-table-create-with-table.el)
-(define-key org-mode-map "\C-c\C-q" 'org-table-wrap-region)
-(define-key org-mode-map "\C-c}"    'org-table-toggle-coordinate-overlays)
-(define-key org-mode-map "\C-c{"    'org-table-toggle-formula-debugger)
-(define-key org-mode-map "\C-c\C-e" 'org-export)
-(define-key org-mode-map "\C-c:"    'org-toggle-fixed-width-section)
-
-(define-key org-mode-map "\C-c\C-x\C-k" 'org-cut-special)
-(define-key org-mode-map "\C-c\C-x\C-w" 'org-cut-special)
-(define-key org-mode-map "\C-c\C-x\M-w" 'org-copy-special)
-(define-key org-mode-map "\C-c\C-x\C-y" 'org-paste-special)
-
-(define-key org-mode-map "\C-c\C-x\C-t" 'org-toggle-time-stamp-overlays)
-(define-key org-mode-map "\C-c\C-x\C-i" 'org-clock-in)
-(define-key org-mode-map "\C-c\C-x\C-o" 'org-clock-out)
-(define-key org-mode-map "\C-c\C-x\C-x" 'org-clock-cancel)
-(define-key org-mode-map "\C-c\C-x\C-d" 'org-clock-display)
-(define-key org-mode-map "\C-c\C-x\C-r" 'org-clock-report)
-(define-key org-mode-map "\C-c\C-x\C-u" 'org-dblock-update)
-(define-key org-mode-map "\C-c\C-x\C-l" 'org-preview-latex-fragment)
-(define-key org-mode-map "\C-c\C-x\C-b" 'org-toggle-checkbox)
+(org-defkey org-mode-map "\C-c\C-a" 'show-all)  ; in case allout messed up.
+(org-defkey org-mode-map "\C-c\C-r" 'org-reveal)
+(org-defkey org-mode-map "\C-xns" 'org-narrow-to-subtree)
+(org-defkey org-mode-map "\C-c$"    'org-archive-subtree)
+(org-defkey org-mode-map "\C-c\C-x\C-s" 'org-advertized-archive-subtree)
+(org-defkey org-mode-map "\C-c\C-x\C-a" 'org-toggle-archive-tag)
+(org-defkey org-mode-map "\C-c\C-xb" 'org-tree-to-indirect-buffer)
+(org-defkey org-mode-map "\C-c\C-j" 'org-goto)
+(org-defkey org-mode-map "\C-c\C-t" 'org-todo)
+(org-defkey org-mode-map "\C-c\C-s" 'org-schedule)
+(org-defkey org-mode-map "\C-c\C-d" 'org-deadline)
+(org-defkey org-mode-map "\C-c;"    'org-toggle-comment)
+(org-defkey org-mode-map "\C-c\C-v" 'org-show-todo-tree)
+(org-defkey org-mode-map "\C-c\C-w" 'org-check-deadlines)
+(org-defkey org-mode-map "\C-c/"    'org-occur)   ; Minor-mode reserved
+(org-defkey org-mode-map "\C-c\\"   'org-tags-sparse-tree) ; Minor-mode res.
+(org-defkey org-mode-map "\C-c\C-m" 'org-ctrl-c-ret)
+(org-defkey org-mode-map "\M-\C-m"  'org-insert-heading)
+(org-defkey org-mode-map "\C-c\C-x\C-n" 'org-next-link)
+(org-defkey org-mode-map "\C-c\C-x\C-p" 'org-previous-link)
+(org-defkey org-mode-map "\C-c\C-l" 'org-insert-link)
+(org-defkey org-mode-map "\C-c\C-o" 'org-open-at-point)
+(org-defkey org-mode-map "\C-c%"    'org-mark-ring-push)
+(org-defkey org-mode-map "\C-c&"    'org-mark-ring-goto)
+(org-defkey org-mode-map "\C-c\C-z" 'org-time-stamp)  ; Alternative binding
+(org-defkey org-mode-map "\C-c."    'org-time-stamp)  ; Minor-mode reserved
+(org-defkey org-mode-map "\C-c!"    'org-time-stamp-inactive) ; Minor-mode r.
+(org-defkey org-mode-map "\C-c,"    'org-priority)    ; Minor-mode reserved
+(org-defkey org-mode-map "\C-c\C-y" 'org-evaluate-time-range)
+(org-defkey org-mode-map "\C-c>"    'org-goto-calendar)
+(org-defkey org-mode-map "\C-c<"    'org-date-from-calendar)
+(org-defkey org-mode-map [(control ?,)]     'org-cycle-agenda-files)
+(org-defkey org-mode-map [(control ?\')]     'org-cycle-agenda-files)
+(org-defkey org-mode-map "\C-c["    'org-agenda-file-to-front)
+(org-defkey org-mode-map "\C-c]"    'org-remove-file)
+(org-defkey org-mode-map "\C-c-"    'org-ctrl-c-minus)
+(org-defkey org-mode-map "\C-c^"    'org-sort)
+(org-defkey org-mode-map "\C-c\C-c" 'org-ctrl-c-ctrl-c)
+(org-defkey org-mode-map "\C-c#"    'org-update-checkbox-count)
+(org-defkey org-mode-map "\C-m"     'org-return)
+(org-defkey org-mode-map "\C-c?"    'org-table-field-info)
+(org-defkey org-mode-map "\C-c "    'org-table-blank-field)
+(org-defkey org-mode-map "\C-c+"    'org-table-sum)
+(org-defkey org-mode-map "\C-c="    'org-table-eval-formula)
+(org-defkey org-mode-map "\C-c'"    'org-table-edit-formulas)
+(org-defkey org-mode-map "\C-c`"    'org-table-edit-field)
+(org-defkey org-mode-map "\C-c|"    'org-table-create-or-convert-from-region)
+(org-defkey org-mode-map "\C-c*"    'org-table-recalculate)
+(org-defkey org-mode-map [(control ?#)] 'org-table-rotate-recalc-marks)
+(org-defkey org-mode-map "\C-c~"    'org-table-create-with-table.el)
+(org-defkey org-mode-map "\C-c\C-q" 'org-table-wrap-region)
+(org-defkey org-mode-map "\C-c}"    'org-table-toggle-coordinate-overlays)
+(org-defkey org-mode-map "\C-c{"    'org-table-toggle-formula-debugger)
+(org-defkey org-mode-map "\C-c\C-e" 'org-export)
+(org-defkey org-mode-map "\C-c:"    'org-toggle-fixed-width-section)
+(org-defkey org-mode-map "\C-c\C-x\C-f" 'org-emphasize)
+
+(org-defkey org-mode-map "\C-c\C-x\C-k" 'org-cut-special)
+(org-defkey org-mode-map "\C-c\C-x\C-w" 'org-cut-special)
+(org-defkey org-mode-map "\C-c\C-x\M-w" 'org-copy-special)
+(org-defkey org-mode-map "\C-c\C-x\C-y" 'org-paste-special)
+
+(org-defkey org-mode-map "\C-c\C-x\C-t" 'org-toggle-time-stamp-overlays)
+(org-defkey org-mode-map "\C-c\C-x\C-i" 'org-clock-in)
+(org-defkey org-mode-map "\C-c\C-x\C-o" 'org-clock-out)
+(org-defkey org-mode-map "\C-c\C-x\C-x" 'org-clock-cancel)
+(org-defkey org-mode-map "\C-c\C-x\C-d" 'org-clock-display)
+(org-defkey org-mode-map "\C-c\C-x\C-r" 'org-clock-report)
+(org-defkey org-mode-map "\C-c\C-x\C-u" 'org-dblock-update)
+(org-defkey org-mode-map "\C-c\C-x\C-l" 'org-preview-latex-fragment)
+(org-defkey org-mode-map "\C-c\C-x\C-b" 'org-toggle-checkbox)
+
+(define-key org-mode-map "\C-c\C-x\C-c" 'org-columns)
 
 (when (featurep 'xemacs)
-  (define-key org-mode-map 'button3   'popup-mode-menu))
+  (org-defkey org-mode-map 'button3   'popup-mode-menu))
 
 (defsubst org-table-p () (org-at-table-p))
 
@@ -18717,7 +22444,13 @@ overwritten, and the table is not marked as requiring realignment."
        (goto-char (match-beginning 0))
        (self-insert-command N))
     (setq org-table-may-need-update t)
-    (self-insert-command N)))
+    (self-insert-command N)
+    (org-fix-tags-on-the-fly)))
+
+(defun org-fix-tags-on-the-fly ()
+  (when (and (equal (char-after (point-at-bol)) ?*)
+            (org-on-heading-p))
+    (org-align-tags-here org-tags-column)))
 
 (defun org-delete-backward-char (N)
   "Like `delete-backward-char', insert whitespace at field end in tables.
@@ -18740,7 +22473,8 @@ because, in this case the deletion might narrow the column."
        ;; noalign: if there were two spaces at the end, this field
        ;; does not determine the width of the column.
        (if noalign (setq org-table-may-need-update c)))
-    (backward-delete-char N)))
+    (backward-delete-char N)
+    (org-fix-tags-on-the-fly)))
 
 (defun org-delete-char (N)
   "Like `delete-char', but insert whitespace at field end in tables.
@@ -18765,7 +22499,8 @@ because, in this case the deletion might narrow the column."
            ;; does not determine the width of the column.
            (if noalign (setq org-table-may-need-update c)))
        (delete-char N))
-    (delete-char N)))
+    (delete-char N)
+    (org-fix-tags-on-the-fly)))
 
 ;; Make `delete-selection-mode' work with org-mode and orgtbl-mode
 (put 'org-self-insert-command 'delete-selection t)
@@ -18779,7 +22514,6 @@ because, in this case the deletion might narrow the column."
 (put 'org-delete-char 'flyspell-delayed t)
 (put 'org-delete-backward-char 'flyspell-delayed t)
 
-
 ;; How to do this: Measure non-white length of current string
 ;; If equal to column width, we should realign.
 
@@ -18790,7 +22524,7 @@ COMMANDS is a list of alternating OLDDEF NEWDEF command names."
     (while commands
       (setq old (pop commands) new (pop commands))
       (if (fboundp 'command-remapping)
-         (define-key map (vector 'remap old) new)
+         (org-defkey map (vector 'remap old) new)
        (substitute-key-definition old new map global-map)))))
 
 (when (eq org-enable-table-editor 'optimized)
@@ -18800,7 +22534,7 @@ COMMANDS is a list of alternating OLDDEF NEWDEF command names."
             'self-insert-command 'org-self-insert-command
             'delete-char 'org-delete-char
             'delete-backward-char 'org-delete-backward-char)
-  (define-key org-mode-map "|" 'org-force-self-insert))
+  (org-defkey org-mode-map "|" 'org-force-self-insert))
 
 (defun org-shiftcursor-error ()
   "Throw an error because Shift-Cursor command was applied in wrong context."
@@ -18821,7 +22555,8 @@ See the individual commands for more information."
 
 (defun org-shiftmetaleft ()
   "Promote subtree or delete table column.
-Calls `org-promote-subtree' or `org-table-delete-column', depending on context.
+Calls `org-promote-subtree', `org-outdent-item',
+or `org-table-delete-column', depending on context.
 See the individual commands for more information."
   (interactive)
   (cond
@@ -18832,7 +22567,8 @@ See the individual commands for more information."
 
 (defun org-shiftmetaright ()
   "Demote subtree or insert table column.
-Calls `org-demote-subtree' or `org-table-insert-column', depending on context.
+Calls `org-demote-subtree', `org-indent-item',
+or `org-table-insert-column', depending on context.
 See the individual commands for more information."
   (interactive)
   (cond
@@ -18916,8 +22652,8 @@ commands for more information."
 
 (defun org-shiftup (&optional arg)
   "Increase item in timestamp or increase priority of current headline.
-Calls `org-timestamp-up' or `org-priority-up', depending on context.
-See the individual commands for more information."
+Calls `org-timestamp-up' or `org-priority-up', or `org-previous-item',
+depending on context.  See the individual commands for more information."
   (interactive "P")
   (cond
    ((org-at-timestamp-p t) (call-interactively 'org-timestamp-up))
@@ -18927,8 +22663,8 @@ See the individual commands for more information."
 
 (defun org-shiftdown (&optional arg)
   "Decrease item in timestamp or decrease priority of current headline.
-Calls `org-timestamp-down' or `org-priority-down', depending on context.
-See the individual commands for more information."
+Calls `org-timestamp-down' or `org-priority-down', or `org-next-item'
+depending on context.  See the individual commands for more information."
   (interactive "P")
   (cond
    ((org-at-timestamp-p t) (call-interactively 'org-timestamp-down))
@@ -18941,6 +22677,7 @@ See the individual commands for more information."
   (cond
    ((org-at-timestamp-p t) (call-interactively 'org-timestamp-up-day))
    ((org-on-heading-p) (org-call-with-arg 'org-todo 'right))
+   ((org-at-property-p) (call-interactively 'org-property-next-allowed-value))
    (t (org-shiftcursor-error))))
 
 (defun org-shiftleft ()
@@ -18949,8 +22686,31 @@ See the individual commands for more information."
   (cond
    ((org-at-timestamp-p t) (call-interactively 'org-timestamp-down-day))
    ((org-on-heading-p) (org-call-with-arg 'org-todo 'left))
+   ((org-at-property-p)
+    (call-interactively 'org-property-previous-allowed-value))
+   (t (org-shiftcursor-error))))
+
+(defun org-shiftcontrolright ()
+  "Switch to next TODO set."
+  (interactive)
+  (cond
+   ((org-on-heading-p) (org-call-with-arg 'org-todo 'nextset))
+   (t (org-shiftcursor-error))))
+
+(defun org-shiftcontrolleft ()
+  "Switch to previous TODO set."
+  (interactive)
+  (cond
+   ((org-on-heading-p) (org-call-with-arg 'org-todo 'previousset))
    (t (org-shiftcursor-error))))
 
+(defun org-ctrl-c-ret ()
+  "Call `org-table-hline-and-move' or `org-insert-heading' dep. on context."
+  (interactive)
+  (cond
+   ((org-at-table-p) (call-interactively 'org-table-hline-and-move))
+   (t (call-interactively 'org-insert-heading))))
+
 (defun org-copy-special ()
   "Copy region in table or copy current subtree.
 Calls `org-table-copy' or `org-copy-subtree', depending on context.
@@ -19020,6 +22780,8 @@ This command does many different things, depending on context:
      ((and (local-variable-p 'org-finish-function (current-buffer))
           (fboundp org-finish-function))
       (funcall org-finish-function))
+     ((org-at-property-p)
+      (call-interactively 'org-property-action))
      ((org-on-target-p) (call-interactively 'org-update-radio-target-regexp))
      ((org-on-heading-p) (call-interactively 'org-set-tags))
      ((org-at-table.el-p)
@@ -19036,7 +22798,7 @@ This command does many different things, depending on context:
      ((org-at-item-checkbox-p)
       (call-interactively 'org-toggle-checkbox))
      ((org-at-item-p)
-      (call-interactively 'org-renumber-ordered-list))
+      (call-interactively 'org-maybe-renumber-ordered-list))
      ((save-excursion (beginning-of-line 1) (looking-at "#\\+\\([A-Z]+\\)"))
       (cond
        ((equal (match-string 1) "TBLFM")
@@ -19063,11 +22825,24 @@ Calls `org-table-next-row' or `newline', depending on context.
 See the individual commands for more information."
   (interactive)
   (cond
+   ((bobp) (newline))
    ((org-at-table-p)
     (org-table-justify-field-maybe)
     (call-interactively 'org-table-next-row))
    (t (newline))))
 
+(defun org-ctrl-c-minus ()
+  "Insert separator line in table or modify bullet type in list.
+Calls `org-table-insert-hline' or `org-cycle-list-bullet',
+depending on context."
+  (interactive)
+  (cond
+   ((org-at-table-p)
+    (call-interactively 'org-table-insert-hline))
+   ((org-in-item-p)
+    (call-interactively 'org-cycle-list-bullet))
+   (t (error "`C-c -' does have no function here."))))
+
 (defun org-meta-return (&optional arg)
   "Insert a new heading or wrap a region in a table.
 Calls `org-insert-heading' or `org-table-wrap-region', depending on context.
@@ -19104,7 +22879,7 @@ See the individual commands for more information."
      ["Insert Row" org-shiftmetadown (org-at-table-p)]
      ["Sort lines in region" org-table-sort-lines (org-at-table-p)]
      "--"
-     ["Insert Hline" org-table-insert-hline (org-at-table-p)])
+     ["Insert Hline" org-ctrl-c-minus (org-at-table-p)])
     ("Rectangle"
      ["Copy Rectangle" org-copy-special (org-at-table-p)]
      ["Cut Rectangle" org-cut-special (org-at-table-p)]
@@ -19159,7 +22934,11 @@ See the individual commands for more information."
      ["Next Same Level" outline-forward-same-level t]
      ["Previous Same Level" outline-backward-same-level t]
      "--"
-     ["Jump" org-goto t])
+     ["Jump" org-goto t]
+     "--"
+     ["C-a/e find headline start/end"
+      (setq org-special-ctrl-a/e (not org-special-ctrl-a/e))
+      :style toggle :selected org-special-ctrl-a/e])
     ("Edit Structure"
      ["Move Subtree Up" org-shiftmetaup (not (org-at-table-p))]
      ["Move Subtree Down" org-shiftmetadown (not (org-at-table-p))]
@@ -19177,6 +22956,8 @@ See the individual commands for more information."
      "--"
      ["Convert to odd levels" org-convert-to-odd-levels t]
      ["Convert to odd/even levels" org-convert-to-oddeven-levels t])
+    ("Editing"
+     ["Emphasis..." org-emphasize t])
     ("Archive"
      ["Toggle ARCHIVE tag" org-toggle-archive-tag t]
 ;     ["Check and Tag Children" (org-toggle-archive-tag (4))
@@ -19202,22 +22983,18 @@ See the individual commands for more information."
      ("Select keyword"
       ["Next keyword" org-shiftright (org-on-heading-p)]
       ["Previous keyword" org-shiftleft (org-on-heading-p)]
-      ["Complete Keyword" org-complete (assq :todo-keyword (org-context))])
+      ["Complete Keyword" org-complete (assq :todo-keyword (org-context))]
+      ["Next keyword set" org-shiftcontrolright (and (> (length org-todo-sets) 1) (org-on-heading-p))]
+      ["Previous keyword set" org-shiftcontrolright (and (> (length org-todo-sets) 1) (org-on-heading-p))])
      ["Show TODO Tree" org-show-todo-tree t]
      ["Global TODO list" org-todo-list t]
      "--"
      ["Set Priority" org-priority t]
      ["Priority Up" org-shiftup t]
-     ["Priority Down" org-shiftdown t]
-     "--"
-;     ["Insert Checkbox" org-insert-todo-heading (org-in-item-p)]
-;     ["Toggle Checkbox" org-ctrl-c-ctrl-c (org-at-item-checkbox-p)]
-;     ["Insert [n/m] cookie" (progn (insert "[/]") (org-update-checkbox-count))
-;      (or (org-on-heading-p) (org-at-item-p))]
-;     ["Insert [%] cookie" (progn (insert "[%]") (org-update-checkbox-count))
-;      (or (org-on-heading-p) (org-at-item-p))]
-;     ["Update Statistics" org-update-checkbox-count t]
-     )
+     ["Priority Down" org-shiftdown t])
+    ("TAGS and Properties"
+     ["Set Tags" 'org-ctrl-c-ctrl-c (org-at-heading-p)]
+     ["Column view of properties" org-columns t])
     ("Dates and Scheduling"
      ["Timestamp" org-time-stamp t]
      ["Timestamp (inactive)" org-time-stamp-inactive t]
@@ -19245,7 +23022,7 @@ See the individual commands for more information."
      ["Record DONE time"
       (progn (setq org-log-done (not org-log-done))
             (message "Switching to %s will %s record a timestamp"
-                     org-done-string
+                     (car org-done-keywords)
                      (if org-log-done "automatically" "not")))
       :style toggle :selected org-log-done])
     "--"
@@ -19297,15 +23074,6 @@ See the individual commands for more information."
     ["Refresh setup" org-mode-restart t]
     ))
 
-(defun org-toggle-log-option (type)
-  (if (not (listp org-log-done)) (setq org-log-done nil))
-  (if (memq type org-log-done)
-      (setq org-log-done (delq type org-log-done))
-    (add-to-list 'org-log-done type)))
-
-(defun org-check-log-option (type)
-  (and (listp org-log-done) (memq type org-log-done)))
-
 (defun org-info (&optional node)
   "Read documentation for Org-mode in the info system.
 With optional NODE, go directly to that node."
@@ -19394,7 +23162,7 @@ and :keyword."
         (p (point)) clist o)
     ;; First the large context
     (cond
-     ((org-on-heading-p)
+     ((org-on-heading-p t)
       (push (list :headline (point-at-bol) (point-at-eol)) clist)
       (when (progn
              (beginning-of-line 1)
@@ -19404,7 +23172,7 @@ and :keyword."
        (push (org-point-in-group p 4 :tags) clist))
       (goto-char p)
       (skip-chars-backward "^[\n\r \t") (or (eobp) (backward-char 1))
-      (if (looking-at "\\[#[A-Z]\\]")
+      (if (looking-at "\\[#[A-Z0-9]\\]")
          (push (org-point-in-group p 0 :priority) clist)))
 
      ((org-at-item-p)
@@ -19459,6 +23227,7 @@ and :keyword."
     (setq clist (nreverse (delq nil clist)))
     clist))
 
+;; FIXME Compare with at-regexp-p
 (defun org-in-regexp (re &optional nlines visually)
   "Check if point is inside a match of regexp.
 Normally only the current line is checked, but you can include NLINES extra
@@ -19476,6 +23245,30 @@ really on, so that the block visually is on the match."
                   (>= (+ inc (match-end 0)) pos))
              (throw 'exit (cons (match-beginning 0) (match-end 0)))))))))
 
+(defun org-at-regexp-p (regexp)
+  "Is point inside a match of REGEXP in the current line?"
+  (catch 'exit
+    (save-excursion
+      (let ((pos (point)) (end (point-at-eol)))
+       (beginning-of-line 1)
+       (while (re-search-forward regexp end t)
+         (if (and (<= (match-beginning 0) pos)
+                  (>= (match-end 0) pos))
+             (throw 'exit t)))
+       nil))))
+
+(defun org-uniquify (list)
+  "Remove duplicate elements from LIST."
+  (let (res)
+    (mapc (lambda (x) (add-to-list 'res x 'append)) list)
+    res))
+
+(defun org-delete-all (elts list)
+  "Remove all elements in ELTS from LIST."
+  (while elts
+    (setq list (delete (pop elts) list)))
+  list)
+
 (defun org-point-in-group (point group &optional context)
   "Check if POINT is in match-group GROUP.
 If CONTEXT is non-nil, return a list with CONTEXT and the boundaries of the
@@ -19555,27 +23348,82 @@ Counting starts at 1."
       (setq c (1+ c)))
     (nreverse rtn)))
 
-(defun org-at-regexp-p (regexp)
-  "Is point inside a match of REGEXP in the current line?"
-  (catch 'exit
-    (save-excursion
-      (let ((pos (point)) (end (point-at-eol)))
-       (beginning-of-line 1)
-       (while (re-search-forward regexp end t)
-         (if (and (<= (match-beginning 0) pos)
-                  (>= (match-end 0) pos))
-             (throw 'exit t)))
-       nil))))
-
 (defun org-find-base-buffer-visiting (file)
   "Like `find-buffer-visiting' but alway return the base buffer and
 not an indirect buffer"
   (let ((buf (find-buffer-visiting file)))
     (or (buffer-base-buffer buf) buf)))
 
+(defun org-image-file-name-regexp ()
+  "Return regexp matching the file names of images."
+  (if (fboundp 'image-file-name-regexp)
+      (image-file-name-regexp)
+    (let ((image-file-name-extensions
+          '("png" "jpeg" "jpg" "gif" "tiff" "tif"
+            "xbm" "xpm" "pbm" "pgm" "ppm")))
+      (concat "\\."
+             (regexp-opt (nconc (mapcar 'upcase
+                                        image-file-name-extensions)
+                                image-file-name-extensions)
+                         t)
+             "\\'"))))
+
+(defun org-file-image-p (file)
+  "Return non-nil if FILE is an image."
+  (save-match-data
+    (string-match (org-image-file-name-regexp) file)))
+
 ;;; Paragraph filling stuff.
 ;; We want this to be just right, so use the full arsenal.
-;; FIXME: configure filladapt for XEmacs
+
+(defun org-indent-line-function ()
+  "Indent line like previous, but further if previous was headline or item."
+  (interactive)
+  (let* ((pos (point))
+        (itemp (org-at-item-p))
+        column bpos bcol tpos tcol bullet btype bullet-type)
+    ;; Find the previous relevant line
+    (beginning-of-line 1)
+    (cond
+     ((looking-at "#") (setq column 0))
+     ((looking-at "\\*+ ") (setq column 0))
+     (t
+      (beginning-of-line 0)
+      (while (and (not (bobp)) (looking-at "[ \t]*[\n:#|]"))
+       (beginning-of-line 0))
+      (cond
+       ((looking-at "\\*+[ \t]+")
+       (goto-char (match-end 0))
+       (setq column (current-column)))
+       ((org-in-item-p)
+       (org-beginning-of-item)
+       (looking-at "[ \t]*\\(\\S-+\\)[ \t]*")
+       (setq bpos (match-beginning 1) tpos (match-end 0)
+             bcol (progn (goto-char bpos) (current-column))
+             tcol (progn (goto-char tpos) (current-column))
+             bullet (match-string 1)
+             bullet-type (if (string-match "[0-9]" bullet) "n" bullet))
+       (if (not itemp)
+           (setq column tcol)
+         (goto-char pos)
+         (beginning-of-line 1)
+         (looking-at "[ \t]*\\(\\S-+\\)[ \t]*")
+         (setq bullet (match-string 1)
+               btype (if (string-match "[0-9]" bullet) "n" bullet))
+         (setq column (if (equal btype bullet-type) bcol tcol))))
+       (t (setq column (org-get-indentation))))))
+    (goto-char pos)
+    (if (<= (current-column) (current-indentation))
+       (indent-line-to column)
+      (save-excursion (indent-line-to column)))
+    (setq column (current-column))
+    (beginning-of-line 1)
+    (if (looking-at
+        "\\([ \t]+\\)\\(:[0-9a-zA-Z]+:\\)[ \t]*\\(\\S-.*\\(\\S-\\|$\\)\\)")
+       (replace-match (concat "\\1" (format org-property-format
+                                            (match-string 2) (match-string 3)))
+                      t nil))
+    (move-to-column column)))
 
 (defun org-set-autofill-regexps ()
   (interactive)
@@ -19583,15 +23431,16 @@ not an indirect buffer"
   ;; text in a line directly attached to a headline would otherwise
   ;; fill the headline as well.
   (org-set-local 'comment-start-skip "^#+[ \t]*")
-  (org-set-local 'paragraph-separate "\f\\|\\*\\|[     ]*$\\|[ \t]*[:|]")
+  (org-set-local 'paragraph-separate "\f\\|\\*+ \\|[   ]*$\\|[ \t]*[:|]")
+;; FIXME!!!!!!!  (org-set-local 'paragraph-separate "\f\\|[    ]*$")
   ;; The paragraph starter includes hand-formatted lists.
   (org-set-local 'paragraph-start
-                "\f\\|[        ]*$\\|\\([*\f]+\\)\\|[ \t]*\\([-+*][ \t]+\\|[0-9]+[.)][ \t]+\\)\\|[ \t]*[:|]")
+                "\f\\|[        ]*$\\|\\*+ \\|\f\\|[ \t]*\\([-+*][ \t]+\\|[0-9]+[.)][ \t]+\\)\\|[ \t]*[:|]")
   ;; Inhibit auto-fill for headers, tables and fixed-width lines.
   ;; But only if the user has not turned off tables or fixed-width regions
   (org-set-local
    'auto-fill-inhibit-regexp
-   (concat "\\*\\|#\\+"
+   (concat "\\*\\|#\\+"
           "\\|[ \t]*" org-keyword-time-regexp
           (if (or org-enable-table-editor org-enable-fixed-width-editor)
               (concat
@@ -19627,49 +23476,60 @@ In particular, this makes sure hanging paragraphs for hand-formatted lists
 work correctly."
   (cond ((looking-at "#[ \t]+")
         (match-string 0))
-       ((looking-at " *\\([-*+] \\|[0-9]+[.)] \\)?")
-        (make-string (- (match-end 0) (match-beginning 0)) ?\ ))
+       ((looking-at "[ \t]*\\([-*+] \\|[0-9]+[.)] \\)?")
+        (save-excursion
+          (goto-char (match-end 0))
+          (make-string (current-column) ?\ )))
        (t nil)))
 
-
-(defun org-image-file-name-regexp ()
-  "Return regexp matching the file names of images."
-  (if (fboundp 'image-file-name-regexp)
-      (image-file-name-regexp)
-    (let ((image-file-name-extensions
-          '("png" "jpeg" "jpg" "gif" "tiff" "tif"
-            "xbm" "xpm" "pbm" "pgm" "ppm")))
-      (concat "\\."
-             (regexp-opt (nconc (mapcar 'upcase
-                                        image-file-name-extensions)
-                                image-file-name-extensions)
-                         t)
-             "\\'"))))
-
-(defun org-file-image-p (file)
-  "Return non-nil if FILE is an image."
-  (save-match-data
-    (string-match (org-image-file-name-regexp) file)))
-
 ;;;; Functions extending outline functionality
 
 ;; C-a should go to the beginning of a *visible* line, also in the
 ;; new outline.el.  I guess this should be patched into Emacs?
-(defun org-beginning-of-line ()
+(defun org-beginning-of-line (&optional arg)
   "Go to the beginning of the current line.  If that is invisible, continue
-to a visible line beginning.  This makes the function of C-a more intuitive."
-  (interactive)
-  (beginning-of-line 1)
-  (if (bobp)
-      nil
-    (backward-char 1)
-    (if (org-invisible-p)
-       (while (and (not (bobp)) (org-invisible-p))
-         (backward-char 1)
-         (beginning-of-line 1))
-      (forward-char 1))))
+to a visible line beginning.  This makes the function of C-a more intuitive.
+If this is a headline, and `org-special-ctrl-a/e' is set, ignore tags on the
+first attempt, and only move to after the tags when the cursor is already
+beyond the end of the headline."
+  (interactive "P")
+  (let ((pos (point)))
+    (beginning-of-line 1)
+    (if (bobp)
+       nil
+      (backward-char 1)
+      (if (org-invisible-p)
+         (while (and (not (bobp)) (org-invisible-p))
+           (backward-char 1)
+           (beginning-of-line 1))
+       (forward-char 1)))
+    (when (and org-special-ctrl-a/e (looking-at org-todo-line-regexp)
+              (= (char-after (match-end 1)) ?\ ))
+      (goto-char
+       (cond ((> pos (match-beginning 3)) (match-beginning 3))
+            ((= pos (point)) (match-beginning 3))
+            (t (point)))))))
+
+(defun org-end-of-line (&optional arg)
+  "Go to the end of the line.
+If this is a headline, and `org-special-ctrl-a/e' is set, ignore tags on the
+first attempt, and only move to after the tags when the cursor is already
+beyond the end of the headline."
+  (interactive "P")
+  (if (or (not org-special-ctrl-a/e)
+         (not (org-on-heading-p)))
+      (end-of-line arg)
+    (let ((pos (point)))
+      (beginning-of-line 1)
+      (if (looking-at (org-re ".*?\\([ \t]*\\)\\(:[[:alnum:]_@:]+:\\)[ \t]*$"))
+         (if (or (< pos (match-beginning 1))
+                 (= pos (match-end 0)))
+             (goto-char (match-beginning 1))
+           (goto-char (match-end 0)))
+       (end-of-line arg)))))
 
 (define-key org-mode-map "\C-a" 'org-beginning-of-line)
+(define-key org-mode-map "\C-e" 'org-end-of-line)
 
 (defun org-invisible-p ()
   "Check if point is at a character currently not visible."
@@ -19689,6 +23549,9 @@ to a visible line beginning.  This makes the function of C-a more intuitive."
 
 (defalias 'org-back-to-heading 'outline-back-to-heading)
 (defalias 'org-on-heading-p 'outline-on-heading-p)
+(defalias 'org-at-heading-p 'outline-on-heading-p)
+(defun org-at-heading-or-item-p ()
+  (or (org-on-heading-p) (org-at-item-p)))
 
 (defun org-on-target-p ()
   (or (org-in-regexp org-radio-target-regexp)
@@ -19711,16 +23574,16 @@ move point."
        (pos (point))
        (re (concat "^" outline-regexp))
        level l)
-    (org-back-to-heading t)
-    (setq level (funcall outline-level))
-    (catch 'exit
-      (or previous (forward-char 1))
-      (while (funcall fun re nil t)
-       (setq l (funcall outline-level))
-       (when (< l level) (goto-char pos) (throw 'exit nil))
-       (when (= l level) (goto-char (match-beginning 0)) (throw 'exit t)))
-      (goto-char pos)
-      nil)))
+    (when (condition-case nil (org-back-to-heading t) (error nil))
+      (setq level (funcall outline-level))
+      (catch 'exit
+       (or previous (forward-char 1))
+       (while (funcall fun re nil t)
+         (setq l (funcall outline-level))
+         (when (< l level) (goto-char pos) (throw 'exit nil))
+         (when (= l level) (goto-char (match-beginning 0)) (throw 'exit t)))
+       (goto-char pos)
+       nil))))
 
 (defun org-show-siblings ()
   "Show all siblings of the current headline."
@@ -19751,7 +23614,7 @@ When ENTRY is non-nil, show the entire entry."
                           (save-excursion (outline-end-of-heading) (point))
                           flag))))
 
-(defun org-end-of-subtree (&optional invisible-OK)
+(defun org-end-of-subtree (&optional invisible-OK to-heading)
   ;; This is an exact copy of the original function, but it uses
   ;; `org-back-to-heading', to make it work also in invisible
   ;; trees.  And is uses an invisible-OK argument.
@@ -19763,13 +23626,14 @@ When ENTRY is non-nil, show the entire entry."
                (or first (> (funcall outline-level) level)))
       (setq first nil)
       (outline-next-heading))
-    (if (memq (preceding-char) '(?\n ?\^M))
-       (progn
-         ;; Go to end of line before heading
-         (forward-char -1)
-         (if (memq (preceding-char) '(?\n ?\^M))
-             ;; leave blank line before heading
-             (forward-char -1)))))
+    (unless to-heading
+      (if (memq (preceding-char) '(?\n ?\^M))
+         (progn
+           ;; Go to end of line before heading
+           (forward-char -1)
+           (if (memq (preceding-char) '(?\n ?\^M))
+               ;; leave blank line before heading
+               (forward-char -1))))))
   (point))
 
 (defun org-show-subtree ()
@@ -19824,7 +23688,13 @@ Show the heading too, if it is currently invisible."
   (remove-hook 'post-command-hook 'org-isearch-post-command 'local)
   (org-show-context 'isearch))
 
-;;;; Repair problems with some other packages
+
+;;;; Address problems with some other packages
+
+;; Make flyspell not check words in links, to not mess up our keymap
+(defun org-mode-flyspell-verify ()
+  "Don't let flyspell put overlays at active buttons."
+  (not (get-text-property (point) 'keymap)))
 
 ;; Make `bookmark-jump' show the jump location if it was hidden.
 (eval-after-load "bookmark"
@@ -19850,6 +23720,74 @@ Show the heading too, if it is currently invisible."
 
 ;;;; Experimental code
 
+(defun org-closed-in-range ()
+  "Sparse tree of items closed in a certain time range.
+Still experimental, may disappear in the furture."
+  (interactive)
+  ;; Get the time interval from the user.
+  (let* ((time1 (time-to-seconds
+                 (org-read-date nil 'to-time nil "Starting date: ")))
+         (time2 (time-to-seconds
+                 (org-read-date nil 'to-time nil "End date:")))
+         ;; callback function
+         (callback (lambda ()
+                     (let ((time
+                            (time-to-seconds
+                             (apply 'encode-time
+                                    (org-parse-time-string
+                                     (match-string 1))))))
+                       ;; check if time in interval
+                       (and (>= time time1) (<= time time2))))))
+    ;; make tree, check each match with the callback
+    (org-occur "CLOSED: +\\[\\(.*?\\)\\]" nil callback)))
+
+(defun org-fill-paragraph-experimental (&optional justify)
+  "Re-align a table, pass through to fill-paragraph if no table."
+  (let ((table-p (org-at-table-p))
+       (table.el-p (org-at-table.el-p)))
+    (cond ((equal (char-after (point-at-bol)) ?*) t) ; skip headlines
+         (table.el-p t)                             ; skip table.el tables
+         (table-p (org-table-align) t)              ; align org-mode tables
+         ((save-excursion
+            (let ((pos (1+ (point-at-eol))))
+              (backward-paragraph 1)
+              (re-search-forward "\\\\\\\\[ \t]*$" pos t)))
+          (save-excursion
+            (save-restriction
+              (narrow-to-region (1+ (match-end 0)) (point-max))
+              (fill-paragraph nil)
+              t)))
+         (t nil))))                                 ; call paragraph-fill
+
+(defun org-property-previous-allowed-value (&optional previous)
+  "Switch to the next allowed value for this property."
+  (interactive)
+  (org-property-next-allowed-value t))
+
+(defun org-property-next-allowed-value (&optional previous)
+  "Switch to the next allowed value for this property."
+  (interactive)
+  (unless (org-at-property-p)
+    (error "Not at a property"))
+  (let* ((key (match-string 2))
+        (value (match-string 3))
+        (allowed (or (org-property-get-allowed-values (point) key)
+                     (and (member value  '("[ ]" "[-]" "[X]"))
+                          '("[ ]" "[X]"))))
+        nval)
+    (unless allowed
+      (error "Allowed values for this property have not been defined"))
+    (if previous (setq allowed (reverse allowed)))
+    (if (member value allowed)
+       (setq nval (car (cdr (member value allowed)))))
+    (setq nval (or nval (car allowed)))
+    (if (equal nval value)
+       (error "Only one allowed value for this property"))
+    (org-at-property-p)
+    (replace-match (concat " :" key ": " nval))
+    (org-indent-line-function)
+    (beginning-of-line 1)
+    (skip-chars-forward " \t")))
 
 ;;;; Finish up
 
index 9da49fc..245ffc4 100644 (file)
   :group 'languages)
 
 (defcustom sgml-basic-offset 2
-  "*Specifies the basic indentation level for `sgml-indent-line'."
+  "Specifies the basic indentation level for `sgml-indent-line'."
   :type 'integer
   :group 'sgml)
 
 (defcustom sgml-transformation-function 'identity
-  "*Default value for `skeleton-transformation-function' in SGML mode."
+  "Default value for `skeleton-transformation-function' in SGML mode."
   :type 'function
   :group 'sgml)
 
@@ -166,7 +166,7 @@ This takes effect when first loading the `sgml-mode' library.")
   "Syntax table used to parse SGML tags.")
 
 (defcustom sgml-name-8bit-mode nil
-  "*When non-nil, insert non-ASCII characters as named entities."
+  "When non-nil, insert non-ASCII characters as named entities."
   :type 'boolean
   :group 'sgml)
 
@@ -225,7 +225,7 @@ Currently, only Latin-1 characters are supported.")
 ;; The -s option suppresses output.
 
 (defcustom sgml-validate-command "nsgmls -s" ; replaced old `sgmls'
-  "*The command to validate an SGML document.
+  "The command to validate an SGML document.
 The file name of current buffer file name will be appended to this,
 separated by a space."
   :type 'string
@@ -238,7 +238,7 @@ separated by a space."
 ;; I doubt that null end tags are used much for large elements,
 ;; so use a small distance here.
 (defcustom sgml-slash-distance 1000
-  "*If non-nil, is the maximum distance to search for matching `/'."
+  "If non-nil, is the maximum distance to search for matching `/'."
   :type '(choice (const nil) integer)
   :group 'sgml)
 
@@ -281,8 +281,8 @@ Any terminating `>' or `/' is not matched.")
       . (cons (concat "<"
                      (regexp-opt (mapcar 'car sgml-tag-face-alist) t)
                      "\\([ \t][^>]*\\)?>\\([^<]+\\)</\\1>")
-             '(3 (cdr (assoc (downcase (match-string 1))
-                             sgml-tag-face-alist)) prepend))))))
+             '(3 (cdr (assoc-string (match-string 1) sgml-tag-face-alist t))
+               prepend))))))
 
 ;; for font-lock, but must be defvar'ed after
 ;; sgml-font-lock-keywords-1 and sgml-font-lock-keywords-2 above
@@ -318,7 +318,7 @@ When more these are fontified together with `sgml-font-lock-keywords'.")
     ("!doctype")
     ("!element")
     ("!entity"))
-  "*Alist of tag names for completing read and insertion rules.
+  "Alist of tag names for completing read and insertion rules.
 This alist is made up as
 
   ((\"tag\" . TAGRULE)
@@ -348,15 +348,14 @@ an optional alist of possible values."
     ("!doctype" . "Document type (DTD) declaration")
     ("!element" . "Tag declaration")
     ("!entity" . "Entity (macro) declaration"))
-  "*Alist of tag name and short description."
+  "Alist of tag name and short description."
   :type '(repeat (cons (string :tag "Tag Name")
                       (string :tag "Description")))
   :group 'sgml)
 
 (defcustom sgml-xml-mode nil
-  "*When non-nil, tag insertion functions will be XML-compliant.
-If this variable is customized, the custom value is used always.
-Otherwise, it is set to be buffer-local when the file has
+  "When non-nil, tag insertion functions will be XML-compliant.
+It is set to be buffer-local when the file has
 a DOCTYPE or an XML declaration."
   :type 'boolean
   :version "22.1"
@@ -369,20 +368,19 @@ a DOCTYPE or an XML declaration."
   "List of tags whose !ELEMENT definition says the end-tag is optional.")
 
 (defun sgml-xml-guess ()
-  "Guess whether the current buffer is XML."
+  "Guess whether the current buffer is XML.  Return non-nil if so."
   (save-excursion
     (goto-char (point-min))
-    (when (or (string= "xml" (file-name-extension (or buffer-file-name "")))
-             (looking-at "\\s-*<\\?xml")
-             (when (re-search-forward
-                    (eval-when-compile
+    (or (string= "xml" (file-name-extension (or buffer-file-name "")))
+       (looking-at "\\s-*<\\?xml")
+       (when (re-search-forward
+              (eval-when-compile
                 (mapconcat 'identity
                            '("<!DOCTYPE" "\\(\\w+\\)" "\\(\\w+\\)"
-                                   "\"\\([^\"]+\\)\"" "\"\\([^\"]+\\)\"")
-                                 "\\s-+"))
-                    nil t)
-               (string-match "X\\(HT\\)?ML" (match-string 3))))
-      (set (make-local-variable 'sgml-xml-mode) t))))
+                             "\"\\([^\"]+\\)\"" "\"\\([^\"]+\\)\"")
+                           "\\s-+"))
+              nil t)
+         (string-match "X\\(HT\\)?ML" (match-string 3))))))
 
 (defvar v2)                            ; free for skeleton
 
@@ -410,7 +408,7 @@ a DOCTYPE or an XML declaration."
         (eq (char-before) ?<))))
 
 ;;;###autoload
-(define-derived-mode sgml-mode text-mode "SGML"
+(define-derived-mode sgml-mode text-mode '(sgml-xml-mode "XML" "SGML")
   "Major mode for editing SGML documents.
 Makes > match <.
 Keys <, &, SPC within <>, \", / and ' can be electric depending on
@@ -462,9 +460,9 @@ Do \\[describe-key] on the following bindings to discover what they do.
           . sgml-font-lock-syntactic-keywords)))
   (set (make-local-variable 'facemenu-add-face-function)
        'sgml-mode-facemenu-add-face-function)
-  (sgml-xml-guess)
+  (set (make-local-variable 'sgml-xml-mode) (sgml-xml-guess))
   (if sgml-xml-mode
-      (setq mode-name "XML")
+      ()
     (set (make-local-variable 'skeleton-transformation-function)
          sgml-transformation-function))
   ;; This will allow existing comments within declarations to be
@@ -737,22 +735,93 @@ With prefix argument, only self insert."
 
 (defun sgml-skip-tag-backward (arg)
   "Skip to beginning of tag or matching opening tag if present.
-With prefix argument ARG, repeat this ARG times."
+With prefix argument ARG, repeat this ARG times.
+Return non-nil if we skipped over matched tags."
   (interactive "p")
   ;; FIXME: use sgml-get-context or something similar.
-  (while (>= arg 1)
-    (search-backward "<" nil t)
-    (if (looking-at "</\\([^ \n\t>]+\\)")
-       ;; end tag, skip any nested pairs
-       (let ((case-fold-search t)
-             (re (concat "</?" (regexp-quote (match-string 1))
-                         ;; Ignore empty tags like <foo/>.
-                         "\\([^>]*[^/>]\\)?>")))
-         (while (and (re-search-backward re nil t)
-                     (eq (char-after (1+ (point))) ?/))
-           (forward-char 1)
-           (sgml-skip-tag-backward 1))))
-    (setq arg (1- arg))))
+  (let ((return t))
+    (while (>= arg 1)
+      (search-backward "<" nil t)
+      (if (looking-at "</\\([^ \n\t>]+\\)")
+          ;; end tag, skip any nested pairs
+          (let ((case-fold-search t)
+                (re (concat "</?" (regexp-quote (match-string 1))
+                            ;; Ignore empty tags like <foo/>.
+                            "\\([^>]*[^/>]\\)?>")))
+            (while (and (re-search-backward re nil t)
+                        (eq (char-after (1+ (point))) ?/))
+              (forward-char 1)
+              (sgml-skip-tag-backward 1)))
+        (setq return nil))
+      (setq arg (1- arg)))
+    return))
+
+(defvar sgml-electric-tag-pair-overlays nil)
+(defvar sgml-electric-tag-pair-timer nil)
+
+(defun sgml-electric-tag-pair-before-change-function (beg end)
+  (condition-case err
+  (save-excursion
+    (goto-char end)
+    (skip-chars-backward "[:alnum:]-_.:")
+    (if (and ;; (<= (point) beg) ; This poses problems for downcase-word.
+             (or (eq (char-before) ?<)
+                 (and (eq (char-before) ?/)
+                      (eq (char-before (1- (point))) ?<)))
+             (null (get-char-property (point) 'text-clones)))
+        (let* ((endp (eq (char-before) ?/))
+               (cl-start (point))
+               (cl-end (progn (skip-chars-forward "[:alnum:]-_.:") (point)))
+               (match
+                (if endp
+                    (when (sgml-skip-tag-backward 1) (forward-char 1) t)
+                  (with-syntax-table sgml-tag-syntax-table
+                    (up-list -1)
+                    (when (sgml-skip-tag-forward 1)
+                      (backward-sexp 1)
+                      (forward-char 2)
+                      t))))
+               (clones (get-char-property (point) 'text-clones)))
+          (when (and match
+                     (/= cl-end cl-start)
+                     (equal (buffer-substring cl-start cl-end)
+                            (buffer-substring (point)
+                                              (save-excursion
+                                                (skip-chars-forward "[:alnum:]-_.:")
+                                                (point))))
+                     (or (not endp) (eq (char-after cl-end) ?>)))
+            (when clones
+              (message "sgml-electric-tag-pair-before-change-function: deleting old OLs")
+              (mapc 'delete-overlay clones))
+            (message "sgml-electric-tag-pair-before-change-function: new clone")
+            (text-clone-create cl-start cl-end 'spread "[[:alnum:]-_.:]+")
+            (setq sgml-electric-tag-pair-overlays
+                  (append (get-char-property (point) 'text-clones)
+                          sgml-electric-tag-pair-overlays))))))
+  (scan-error nil)
+  (error (message "Error in sgml-electric-pair-mode: %s" err))))
+
+(defun sgml-electric-tag-pair-flush-overlays ()
+  (while sgml-electric-tag-pair-overlays
+    (delete-overlay (pop sgml-electric-tag-pair-overlays))))
+
+(define-minor-mode sgml-electric-tag-pair-mode
+  "Automatically update the closing tag when editing the opening one."
+  :lighter "/e"
+  (if sgml-electric-tag-pair-mode
+      (progn
+        (add-hook 'before-change-functions
+                  'sgml-electric-tag-pair-before-change-function
+                  nil t)
+        (unless sgml-electric-tag-pair-timer
+          (setq sgml-electric-tag-pair-timer
+                (run-with-idle-timer 5 'repeat 'sgml-electric-tag-pair-flush-overlays))))
+    (remove-hook 'before-change-functions
+                 'sgml-electric-tag-pair-before-change-function
+                 t)
+    ;; We leave the timer running for other buffers.
+    ))
+
 
 (defun sgml-skip-tag-forward (arg)
   "Skip to end of tag or matching closing tag if present.
@@ -940,7 +1009,7 @@ and move to the line in the SGML document that caused it."
 (defun sgml-lexical-context (&optional limit)
   "Return the lexical context at point as (TYPE . START).
 START is the location of the start of the lexical element.
-TYPE is one of `string', `comment', `tag', `cdata', or `text'.
+TYPE is one of `string', `comment', `tag', `cdata', `pi', or `text'.
 
 Optional argument LIMIT is the position to start parsing from.
 If nil, start from a preceding tag at indentation."
@@ -967,12 +1036,19 @@ If nil, start from a preceding tag at indentation."
                   (let ((cdata-start (point)))
                     (unless (search-forward "]]>" pos 'move)
                       (list 0 nil nil 'cdata nil nil nil nil cdata-start))))
+                 ((and sgml-xml-mode (looking-at "<\\?"))
+                  ;; Processing Instructions.
+                  ;; In SGML, it's basically a normal tag of the form
+                  ;; <?NAME ...> but in XML, it takes the form <? ... ?>.
+                  (let ((pi-start (point)))
+                    (unless (search-forward "?>" pos 'move)
+                      (list 0 nil nil 'pi nil nil nil nil pi-start))))
                  (t
                   ;; We've reached a tag.  Parse it.
                   ;; FIXME: Handle net-enabling start-tags
                   (parse-partial-sexp (point) pos 0))))))
       (cond
-       ((eq (nth 3 state) 'cdata) (cons 'cdata (nth 8 state)))
+       ((memq (nth 3 state) '(cdata pi)) (cons (nth 3 state) (nth 8 state)))
        ((nth 3 state) (cons 'string (nth 8 state)))
        ((nth 4 state) (cons 'comment (nth 8 state)))
        ((and state (> (nth 0 state) 0)) (cons 'tag (nth 1 state)))
@@ -1006,8 +1082,10 @@ See `sgml-tag-alist' for info about attribute rules."
              (insert alist ?\")
            (delete-backward-char 2)))
       (insert "=\"")
-      (when alist
-        (insert (skeleton-read '(completing-read "Value: " alist))))
+      (if (cdr alist)
+          (insert (skeleton-read '(completing-read "Value: " alist)))
+        (when (null alist)
+          (insert (skeleton-read '(read-string "Value: ")))))
       (insert ?\"))))
 
 (defun sgml-quote (start end &optional unquotep)
@@ -1096,9 +1174,15 @@ Leave point at the beginning of the tag."
       (when (eq (char-after) ?<)
        ;; Oops!! Looks like we were not in a textual context after all!.
        ;; Let's try to recover.
+        ;; Remember the tag-start so we don't need to look for it later.
+       ;; This is not just an optimization but also makes sure we don't get
+       ;; stuck in infloops in cases where "looking back for <" would not go
+       ;; back far enough.
+        (setq tag-start (point))
        (with-syntax-table sgml-tag-syntax-table
          (let ((pos (point)))
            (condition-case nil
+                ;; FIXME: This does not correctly skip over PI an CDATA tags.
                (forward-sexp)
              (scan-error
               ;; This < seems to be just a spurious one, let's ignore it.
@@ -1113,33 +1197,41 @@ Leave point at the beginning of the tag."
       (cond
        ((sgml-looking-back-at "--")    ; comment
        (setq tag-type 'comment
-             tag-start (search-backward "<!--" nil t)))
+             tag-start (or tag-start (search-backward "<!--" nil t))))
        ((sgml-looking-back-at "]]")    ; cdata
        (setq tag-type 'cdata
-             tag-start (re-search-backward "<!\\[[A-Z]+\\[" nil t)))
+             tag-start (or tag-start
+                            (re-search-backward "<!\\[[A-Z]+\\[" nil t))))
+       ((sgml-looking-back-at "?")      ; XML processing-instruction
+        (setq tag-type 'pi
+              ;; IIUC: SGML processing instructions take the form <?foo ...>
+              ;; i.e. a "normal" tag, handled below.  In XML this is changed
+              ;; to <?foo ... ?> where "..." can contain < and > and even <?
+              ;; but not ?>.  This means that when parsing backward, there's
+              ;; no easy way to make sure that we find the real beginning of
+              ;; the PI.
+             tag-start (or tag-start (search-backward "<?" nil t))))
        (t
-       (setq tag-start
-             (with-syntax-table sgml-tag-syntax-table
-               (goto-char tag-end)
-               (condition-case nil
-                   (backward-sexp)
-                 (scan-error
-                  ;; This > isn't really the end of a tag. Skip it.
-                  (goto-char (1- tag-end))
-                  (throw 'found (sgml-parse-tag-backward limit))))
-               (point)))
+        (unless tag-start
+          (setq tag-start
+                (with-syntax-table sgml-tag-syntax-table
+                  (goto-char tag-end)
+                  (condition-case nil
+                      (backward-sexp)
+                    (scan-error
+                     ;; This > isn't really the end of a tag. Skip it.
+                     (goto-char (1- tag-end))
+                     (throw 'found (sgml-parse-tag-backward limit))))
+                  (point))))
        (goto-char (1+ tag-start))
        (case (char-after)
-         (?!                           ; declaration
-          (setq tag-type 'decl))
-         (??                           ; processing-instruction
-          (setq tag-type 'pi))
+         (?! (setq tag-type 'decl))    ; declaration
+         (?? (setq tag-type 'pi))      ; processing-instruction
+         (?% (setq tag-type 'jsp))     ; JSP tags
          (?/                           ; close-tag
           (forward-char 1)
           (setq tag-type 'close
                 name (sgml-parse-tag-name)))
-         (?%                           ; JSP tags
-          (setq tag-type 'jsp))
          (t                            ; open or empty tag
           (setq tag-type 'open
                 name (sgml-parse-tag-name))
@@ -1198,7 +1290,7 @@ not the case, the first tag returned is the one inside which we are."
        ((eq (sgml-tag-type tag-info) 'open)
        (cond
         ((null stack)
-         (if (member-ignore-case (sgml-tag-name tag-info) ignore)
+         (if (assoc-string (sgml-tag-name tag-info) ignore t)
              ;; There was an implicit end-tag.
              nil
            (push tag-info context)
@@ -1283,12 +1375,13 @@ the current start-tag or the current comment or the current cdata, ..."
 (defun sgml-empty-tag-p (tag-name)
   "Return non-nil if TAG-NAME is an implicitly empty tag."
   (and (not sgml-xml-mode)
-       (member-ignore-case tag-name sgml-empty-tags)))
+       (assoc-string tag-name sgml-empty-tags 'ignore-case)))
 
 (defun sgml-unclosed-tag-p (tag-name)
   "Return non-nil if TAG-NAME is a tag for which an end-tag is optional."
   (and (not sgml-xml-mode)
-       (member-ignore-case tag-name sgml-unclosed-tags)))
+       (assoc-string tag-name sgml-unclosed-tags 'ignore-case)))
+
 
 (defun sgml-calculate-indent (&optional lcon)
   "Calculate the column to which this line should be indented.
@@ -1334,6 +1427,8 @@ LCON is the lexical context, if any."
 
     ;; We don't know how to indent it.  Let's be honest about it.
     (cdata nil)
+    ;; We don't know how to indent it.  Let's be honest about it.
+    (pi nil)
 
     (tag
      (goto-char (1+ (cdr lcon)))
@@ -1352,8 +1447,8 @@ LCON is the lexical context, if any."
      (let* ((here (point))
            (unclosed (and ;; (not sgml-xml-mode)
                       (looking-at sgml-tag-name-re)
-                      (member-ignore-case (match-string 1)
-                                          sgml-unclosed-tags)
+                      (assoc-string (match-string 1)
+                                    sgml-unclosed-tags 'ignore-case)
                       (match-string 1)))
            (context
             ;; If possible, align on the previous non-empty text line.
@@ -1791,11 +1886,11 @@ This takes effect when first loading the library.")
     ("ul" . "Unordered list")
     ("var" . "Math variable face")
     ("wbr" . "Enable <br> within <nobr>"))
-"*Value of `sgml-tag-help' for HTML mode.")
+  "*Value of `sgml-tag-help' for HTML mode.")
 
 \f
 ;;;###autoload
-(define-derived-mode html-mode sgml-mode "HTML"
+(define-derived-mode html-mode sgml-mode '(sgml-xml-mode "XHTML" "HTML")
   "Major mode based on SGML mode for editing HTML documents.
 This allows inserting skeleton constructs used in hypertext documents with
 completion.  See below for an introduction to HTML.  Use
@@ -1849,7 +1944,6 @@ To work around that, do:
        outline-level (lambda ()
                        (char-before (match-end 0))))
   (setq imenu-create-index-function 'html-imenu-index)
-  (when sgml-xml-mode (setq mode-name "XHTML"))
   (set (make-local-variable 'sgml-empty-tags)
        ;; From HTML-4.01's loose.dtd, parsed with `sgml-parse-dtd',
        ;; plus manual addition of "wbr".
index c8476b0..44bc31d 100644 (file)
@@ -243,6 +243,19 @@ Normally set to either `plain-tex-mode' or `latex-mode'."
   :options '("''" "\">" "\"'" ">>" "»")
   :group 'tex)
 
+(defcustom tex-fontify-script t
+  "If non-nil, fontify subscript and superscript strings."
+  :type 'boolean
+  :group 'tex)
+(put 'tex-fontify-script 'safe-local-variable 'booleanp)
+
+(defcustom tex-font-script-display '(-0.2 0.2)
+  "Display specification for subscript and superscript content.
+The first is used for subscript, the second is used for superscripts."
+  :group 'tex
+  :type '(list (float :tag "Subscript")
+               (float :tag "Superscript")))
+
 (defvar tex-last-temp-file nil
   "Latest temporary file generated by \\[tex-region] and \\[tex-buffer].
 Deleted when the \\[tex-region] or \\[tex-buffer] is next run, or when the
@@ -527,6 +540,8 @@ An alternative value is \" . \", if you use a font with a narrow period."
            (citations (regexp-opt
                        '("label" "ref" "pageref" "vref" "eqref"
                          "cite" "nocite" "index" "glossary" "bibitem"
+                          ;; natbib's two variants of \cite:
+                          "citep" "citet"
                          ;; These are text, rather than citations.
                          ;; "caption" "footnote" "footnotemark" "footnotetext"
                          )
@@ -591,13 +606,14 @@ An alternative value is \" . \", if you use a font with a narrow period."
                  (setq pos (1- pos) odd (not odd)))
                odd))
     (if (eq (char-after pos) ?_)
-       '(face subscript display (raise -0.3))
-      '(face superscript display (raise +0.3)))))
+       `(face subscript display (raise ,(car tex-font-script-display)))
+      `(face superscript display (raise ,(cadr tex-font-script-display))))))
 
 (defun tex-font-lock-match-suscript (limit)
   "Match subscript and superscript patterns up to LIMIT."
-  (when (re-search-forward "[_^] *\\([^\n\\{}]\\|\
-\\\\\\([a-zA-Z@]+\\|[^ \t\n]\\)\\|\\({\\)\\)" limit t)
+  (when (and tex-fontify-script
+            (re-search-forward "[_^] *\\([^\n\\{}]\\|\
+\\\\\\([a-zA-Z@]+\\|[^ \t\n]\\)\\|\\({\\)\\)" limit t))
     (when (match-end 3)
       (let ((beg (match-beginning 3))
            (end (save-restriction
@@ -619,26 +635,31 @@ An alternative value is \" . \", if you use a font with a narrow period."
 
 (defvar tex-verbatim-environments
   '("verbatim" "verbatim*"))
+(put 'tex-verbatim-environments 'safe-local-variable
+     (lambda (x) (require 'cl) (every 'stringp x)))
 
 (defvar tex-font-lock-syntactic-keywords
-  (let ((verbs (regexp-opt tex-verbatim-environments t)))
-    `((,(concat "^\\\\begin *{" verbs "}.*\\(\n\\)") 2 "|")
-      ;; Technically, we'd like to put the "|" property on the \n preceding
-      ;; the \end, but this would have 2 disadvantages:
-      ;; 1 - it's wrong if the verbatim env is empty (the same \n is used to
-      ;;     start and end the fenced-string).
-      ;; 2 - font-lock considers the preceding \n as being part of the
-      ;;     preceding line, so things gets screwed every time the previous
-      ;;     line is re-font-locked on its own.
-      ;; There's a hack in tex-font-lock-keywords-1 to remove the verbatim
-      ;; face from the \ but C-M-f still jumps to the wrong spot :-(  --Stef
-      (,(concat "^\\(\\\\\\)end *{" verbs "}\\(.?\\)") (1 "|") (3 "<"))
-      ;; ("^\\(\\\\\\)begin *{comment}" 1 "< b")
-      ;; ("^\\\\end *{comment}.*\\(\n\\)" 1 "> b")
-      ("\\\\verb\\**\\([^a-z@*]\\)"
-       ;; Do it last, because it uses syntax-ppss which needs the
-       ;; syntax-table properties of previous entries.
-       1 (tex-font-lock-verb (match-end 1))))))
+  '((eval . `(,(concat "^\\\\begin *{"
+                       (regexp-opt tex-verbatim-environments t)
+                       "}.*\\(\n\\)") 2 "|"))
+    ;; Technically, we'd like to put the "|" property on the \n preceding
+    ;; the \end, but this would have 2 disadvantages:
+    ;; 1 - it's wrong if the verbatim env is empty (the same \n is used to
+    ;;     start and end the fenced-string).
+    ;; 2 - font-lock considers the preceding \n as being part of the
+    ;;     preceding line, so things gets screwed every time the previous
+    ;;     line is re-font-locked on its own.
+    ;; There's a hack in tex-font-lock-keywords-1 to remove the verbatim
+    ;; face from the \ but C-M-f still jumps to the wrong spot :-(  --Stef
+    (eval . `(,(concat "^\\(\\\\\\)end *{"
+                       (regexp-opt tex-verbatim-environments t)
+                       "}\\(.?\\)") (1 "|") (3 "<")))
+    ;; ("^\\(\\\\\\)begin *{comment}" 1 "< b")
+    ;; ("^\\\\end *{comment}.*\\(\n\\)" 1 "> b")
+    ("\\\\verb\\**\\([^a-z@*]\\)"
+     ;; Do it last, because it uses syntax-ppss which needs the
+     ;; syntax-table properties of previous entries.
+     1 (tex-font-lock-verb (match-end 1)))))
 
 (defun tex-font-lock-unfontify-region (beg end)
   (font-lock-default-unfontify-region beg end)
@@ -646,17 +667,17 @@ An alternative value is \" . \", if you use a font with a narrow period."
     (let ((next (next-single-property-change beg 'display nil end))
          (prop (get-text-property beg 'display)))
       (if (and (eq (car-safe prop) 'raise)
-              (member (car-safe (cdr prop)) '(-0.3 +0.3))
+              (member (car-safe (cdr prop)) tex-font-script-display)
               (null (cddr prop)))
          (put-text-property beg next 'display nil))
       (setq beg next))))
 
 (defface superscript
-  '((t :height 0.8)) ;; :raise 0.3
+  '((t :height 0.8)) ;; :raise 0.2
   "Face used for superscripts."
   :group 'tex)
 (defface subscript
-  '((t :height 0.8)) ;; :raise -0.3
+  '((t :height 0.8)) ;; :raise -0.2
   "Face used for subscripts."
   :group 'tex)
 
index 9e4f9ca..07b7ba6 100644 (file)
@@ -57,8 +57,6 @@ If optional argument HERE is non-nil, insert info at point."
 (require 'texinfo)          ; So `texinfo-footnote-style' is defined.
 (require 'texnfo-upd)       ; So `texinfo-section-types-regexp' is defined.
 
-(defvar texinfo-format-syntax-table nil)
-
 (defvar texinfo-vindex)
 (defvar texinfo-findex)
 (defvar texinfo-cindex)
@@ -81,27 +79,80 @@ If optional argument HERE is non-nil, insert info at point."
 (defvar texinfo-short-index-format-cmds-alist)
 (defvar texinfo-format-filename)
 (defvar texinfo-footnote-number)
-(defvar texinfo-start-of-header)
-(defvar texinfo-end-of-header)
-(defvar texinfo-raisesections-alist)
-(defvar texinfo-lowersections-alist)
+
+(defvar texinfo-raisesections-alist
+  '((@chapter . @chapter)             ; Cannot go higher
+    (@unnumbered . @unnumbered)
+    (@centerchap . @unnumbered)
+
+    (@majorheading . @majorheading)
+    (@chapheading . @chapheading)
+    (@appendix . @appendix)
+
+    (@section . @chapter)
+    (@unnumberedsec . @unnumbered)
+    (@heading . @chapheading)
+    (@appendixsec . @appendix)
+
+    (@subsection . @section)
+    (@unnumberedsubsec . @unnumberedsec)
+    (@subheading . @heading)
+    (@appendixsubsec . @appendixsec)
+
+    (@subsubsection . @subsection)
+    (@unnumberedsubsubsec . @unnumberedsubsec)
+    (@subsubheading . @subheading)
+    (@appendixsubsubsec . @appendixsubsec))
+  "*An alist of next higher levels for chapters, sections, etc...
+For example, section to chapter, subsection to section.
+Used by `texinfo-raise-lower-sections'.
+The keys specify types of section; the values correspond to the next
+higher types.")
+
+(defvar texinfo-lowersections-alist
+  '((@chapter . @section)
+    (@unnumbered . @unnumberedsec)
+    (@centerchap . @unnumberedsec)
+    (@majorheading . @heading)
+    (@chapheading . @heading)
+    (@appendix . @appendixsec)
+
+    (@section . @subsection)
+    (@unnumberedsec . @unnumberedsubsec)
+    (@heading . @subheading)
+    (@appendixsec . @appendixsubsec)
+
+    (@subsection . @subsubsection)
+    (@unnumberedsubsec . @unnumberedsubsubsec)
+    (@subheading . @subsubheading)
+    (@appendixsubsec . @appendixsubsubsec)
+
+    (@subsubsection . @subsubsection) ; Cannot go lower.
+    (@unnumberedsubsubsec . @unnumberedsubsubsec)
+    (@subsubheading . @subsubheading)
+    (@appendixsubsubsec . @appendixsubsubsec))
+  "*An alist of next lower levels for chapters, sections, etc...
+For example, chapter to section, section to subsection.
+Used by `texinfo-raise-lower-sections'.
+The keys specify types of section; the values correspond to the next
+lower types.")
 \f
 ;;; Syntax table
 
-(if texinfo-format-syntax-table
-    nil
-  (setq texinfo-format-syntax-table (make-syntax-table))
-  (modify-syntax-entry ?\" " " texinfo-format-syntax-table)
-  (modify-syntax-entry ?\\ " " texinfo-format-syntax-table)
-  (modify-syntax-entry ?@ "\\" texinfo-format-syntax-table)
-  (modify-syntax-entry ?\^q "\\" texinfo-format-syntax-table)
-  (modify-syntax-entry ?\[ "." texinfo-format-syntax-table)
-  (modify-syntax-entry ?\] "." texinfo-format-syntax-table)
-  (modify-syntax-entry ?\( "." texinfo-format-syntax-table)
-  (modify-syntax-entry ?\) "." texinfo-format-syntax-table)
-  (modify-syntax-entry ?{ "(}" texinfo-format-syntax-table)
-  (modify-syntax-entry ?} "){" texinfo-format-syntax-table)
-  (modify-syntax-entry ?\' "." texinfo-format-syntax-table))
+(defvar texinfo-format-syntax-table
+  (let ((st (make-syntax-table)))
+    (modify-syntax-entry ?\" " " st)
+    (modify-syntax-entry ?\\ " " st)
+    (modify-syntax-entry ?@ "\\" st)
+    (modify-syntax-entry ?\^q "\\" st)
+    (modify-syntax-entry ?\[ "." st)
+    (modify-syntax-entry ?\] "." st)
+    (modify-syntax-entry ?\( "." st)
+    (modify-syntax-entry ?\) "." st)
+    (modify-syntax-entry ?{ "(}" st)
+    (modify-syntax-entry ?} "){" st)
+    (modify-syntax-entry ?\' "." st)
+    st))
 
 \f
 ;;; Top level buffer and region formatting functions
@@ -113,8 +164,8 @@ The Info file output is generated in a buffer visiting the Info file
 name specified in the @setfilename command.
 
 Non-nil argument (prefix, if interactive) means don't make tag table
-and don't split the file if large.  You can use Info-tagify and
-Info-split to do these manually."
+and don't split the file if large.  You can use `Info-tagify' and
+`Info-split' to do these manually."
   (interactive "P")
   (let ((lastmessage "Formatting Info file...")
        (coding-system-for-write buffer-file-coding-system))
@@ -329,7 +380,7 @@ is automatically removed when the Info file is created.  The original
 Texinfo source buffer is not changed.
 
 Non-nil argument (prefix, if interactive) means don't split the file
-if large.  You can use Info-split to do this manually."
+if large.  You can use `Info-split' to do this manually."
   (interactive "P")
   (let ((temp-buffer (concat  "*--" (buffer-name) "--temporary-buffer*" )))
     (message "First updating nodes and menus, then creating Info file.")
@@ -764,64 +815,6 @@ commands."
               (setq count (1+ count)))
             (kill-word 1)
             (insert (symbol-name new-level))))))))))
-
-(defvar texinfo-raisesections-alist
-  '((@chapter . @chapter)             ; Cannot go higher
-    (@unnumbered . @unnumbered)
-    (@centerchap . @unnumbered)
-
-    (@majorheading . @majorheading)
-    (@chapheading . @chapheading)
-    (@appendix . @appendix)
-
-    (@section . @chapter)
-    (@unnumberedsec . @unnumbered)
-    (@heading . @chapheading)
-    (@appendixsec . @appendix)
-
-    (@subsection . @section)
-    (@unnumberedsubsec . @unnumberedsec)
-    (@subheading . @heading)
-    (@appendixsubsec . @appendixsec)
-
-    (@subsubsection . @subsection)
-    (@unnumberedsubsubsec . @unnumberedsubsec)
-    (@subsubheading . @subheading)
-    (@appendixsubsubsec . @appendixsubsec))
-  "*An alist of next higher levels for chapters, sections. etc.
-For example, section to chapter, subsection to section.
-Used by `texinfo-raise-lower-sections'.
-The keys specify types of section; the values correspond to the next
-higher types.")
-
-(defvar texinfo-lowersections-alist
-  '((@chapter . @section)
-    (@unnumbered . @unnumberedsec)
-    (@centerchap . @unnumberedsec)
-    (@majorheading . @heading)
-    (@chapheading . @heading)
-    (@appendix . @appendixsec)
-
-    (@section . @subsection)
-    (@unnumberedsec . @unnumberedsubsec)
-    (@heading . @subheading)
-    (@appendixsec . @appendixsubsec)
-
-    (@subsection . @subsubsection)
-    (@unnumberedsubsec . @unnumberedsubsubsec)
-    (@subheading . @subsubheading)
-    (@appendixsubsec . @appendixsubsubsec)
-
-    (@subsubsection . @subsubsection) ; Cannot go lower.
-    (@unnumberedsubsubsec . @unnumberedsubsubsec)
-    (@subsubheading . @subsubheading)
-    (@appendixsubsubsec . @appendixsubsubsec))
-  "*An alist of next lower levels for chapters, sections. etc.
-For example, chapter to section, section to subsection.
-Used by `texinfo-raise-lower-sections'.
-The keys specify types of section; the values correspond to the next
-lower types.")
-
 \f
 ;;; Perform those texinfo-to-info conversions that apply to the whole input
 ;;; uniformly.
@@ -1077,8 +1070,8 @@ Leave point after argument."
       (forward-char -1)
       (skip-chars-backward " ")
       (setq end (point))
-      (setq args (cons (if (> end beg) (buffer-substring-no-properties beg end))
-                       args))
+      (push (if (> end beg) (buffer-substring-no-properties beg end))
+            args)
       (goto-char next)
       (skip-chars-forward " "))
     (if (eolp) (forward-char 1))
@@ -1110,8 +1103,8 @@ Leave point after argument."
              (goto-char beg)
              (while (search-forward "\n" end t)
                (replace-match " "))))
-      (setq args (cons (if (> end beg) (buffer-substring-no-properties beg end))
-                       args))
+      (push (if (> end beg) (buffer-substring-no-properties beg end))
+            args)
       (goto-char next))
     ;;(if (eolp) (forward-char 1))
     (setq texinfo-command-end (point))
@@ -1140,7 +1133,7 @@ Leave point after argument."
                (re-search-forward "[\n ]")
                (forward-char -1)
                (setq end (point))))
-        (setq args (cons (buffer-substring-no-properties beg end) args))
+        (push (buffer-substring-no-properties beg end) args)
         (skip-chars-forward " "))
       (forward-char 1)
       (nreverse args))))
@@ -1184,7 +1177,7 @@ Leave point after argument."
     (let ((tem (if texinfo-fold-nodename-case (downcase name) name)))
       (if (assoc tem texinfo-node-names)
           (error "Duplicate node name: %s" name)
-        (setq texinfo-node-names (cons (list tem) texinfo-node-names))))
+        (push (list tem) texinfo-node-names)))
     (setq texinfo-footnote-number 0)
     ;; insert "\n\^_" unconditionally since this is what info is looking for
     (insert "\n\^_\nFile: " texinfo-format-filename
@@ -1494,8 +1487,6 @@ If used within a line, follow `@br' with braces."
 Argument is either end or separate."
   (setq texinfo-footnote-style (texinfo-parse-arg-discard)))
 
-(defvar texinfo-footnote-number)
-
 (put 'footnote 'texinfo-format 'texinfo-format-footnote)
 (defun texinfo-format-footnote ()
   "Format a footnote in either end of node or separate node style.
@@ -1601,9 +1592,8 @@ Used by @refill indenting command to avoid indenting within lists, etc.")
 
 (defun texinfo-push-stack (check arg)
   (setq texinfo-stack-depth (1+ texinfo-stack-depth))
-  (setq texinfo-stack
-        (cons (list check arg texinfo-command-start)
-              texinfo-stack)))
+  (push (list check arg texinfo-command-start)
+        texinfo-stack))
 
 (defun texinfo-pop-stack (check)
   (setq texinfo-stack-depth (1- texinfo-stack-depth))
@@ -1974,7 +1964,7 @@ Or else:
     @end multitable
 
 where the fractions specify the width of each column as a percent
-of the current width of the text (i.e., of the fill-column).
+of the current width of the text (i.e., of the `fill-column').
 
 Long lines of text are filled within columns.
 
@@ -2028,12 +2018,10 @@ commands that are defined in texinfo.tex for printed output.
      ((looking-at "@columnfractions")
       (forward-word 1)
       (while (not (eolp))
-        (setq texinfo-multitable-width-list
-              (cons
-               (truncate
-                (1-
-                 (* fill-column (read (get-buffer (current-buffer))))))
-               texinfo-multitable-width-list))))
+        (push (truncate
+               (1-
+                (* fill-column (read (get-buffer (current-buffer))))))
+              texinfo-multitable-width-list)))
      ;;
      ;; Case 2: {Column 1 template} {Column 2} {Column 3 example}
      ((looking-at "{")
@@ -2044,9 +2032,8 @@ commands that are defined in texinfo.tex for printed output.
                  (end-of-template
                  ;; forward-sexp works with braces in Texinfo mode
                   (progn (forward-sexp 1) (1- (point)))))
-            (setq texinfo-multitable-width-list
-                  (cons (- end-of-template start-of-template)
-                        texinfo-multitable-width-list))
+            (push (- end-of-template start-of-template)
+                  texinfo-multitable-width-list)
             ;; Remove carriage return from within a template, if any.
             ;; This helps those those who want to use more than
             ;; one line's worth of words in @multitable line.
@@ -2417,13 +2404,11 @@ Use only the FILENAME arg; for Info, ignore the other arguments to @image."
          (beginning-delimiter (or (nth 1 args) ""))
          (end-delimiter (or (nth 2 args) "")))
     (texinfo-discard-command)
-    (setq texinfo-enclosure-list
-        (cons
-         (list command-name
-               (list
-                beginning-delimiter
-                end-delimiter))
-         texinfo-enclosure-list))))
+    (push (list command-name
+                (list
+                 beginning-delimiter
+                 end-delimiter))
+          texinfo-enclosure-list)))
 
 \f
 ;;; @alias
@@ -2436,12 +2421,10 @@ Use only the FILENAME arg; for Info, ignore the other arguments to @image."
     (save-excursion (end-of-line) (setq texinfo-command-end (point)))
     (if (not (looking-at "\\([^=]+\\)=\\(.*\\)"))
        (error "Invalid alias command")
-      (setq texinfo-alias-list
-           (cons
-            (cons
-             (match-string-no-properties 1)
-             (match-string-no-properties 2))
-            texinfo-alias-list))
+      (push (cons
+             (match-string-no-properties 1)
+             (match-string-no-properties 2))
+            texinfo-alias-list)
       (texinfo-discard-command))
     )
   )
@@ -2570,8 +2553,7 @@ If used within a line, follow `@bullet' with braces."
    "lisp\\|"
    "smalllisp"
    "\\)")
-  "Regexp specifying environments in which @kbd does not put `...'
-  around argument.")
+  "Regexp matching environments in which @kbd does not put `...' around arg.")
 
 (defvar texinfo-format-kbd-end-regexp
   (concat
@@ -2584,7 +2566,7 @@ If used within a line, follow `@bullet' with braces."
    "smalllisp"
    "\\)")
   "Regexp specifying end of environments in which @kbd does not put `...'
-  around argument. (See `texinfo-format-kbd-regexp')")
+around argument. (See `texinfo-format-kbd-regexp')")
 
 (put 'kbd 'texinfo-format 'texinfo-format-kbd)
 (defun texinfo-format-kbd ()
@@ -2793,8 +2775,8 @@ If used within a line, follow `@minus' with braces."
 \f
 ;;; Refilling and indenting:  @refill, @paragraphindent, @noindent
 
-;;; Indent only those paragraphs that are refilled as a result of an
-;;; @refill command.
+;; Indent only those paragraphs that are refilled as a result of an
+;; @refill command.
 
 ;;    * If the value is `asis', do not change the existing indentation at
 ;;      the starts of paragraphs.
@@ -2804,8 +2786,8 @@ If used within a line, follow `@minus' with braces."
 ;;    * If the value is greater than zero, indent each paragraph by that
 ;;      number of spaces.
 
-;;; But do not refill paragraphs with an @refill command that are
-;;; preceded by @noindent or are part of a table, list, or deffn.
+;; But do not refill paragraphs with an @refill command that are
+;; preceded by @noindent or are part of a table, list, or deffn.
 
 (defvar texinfo-paragraph-indent "asis"
   "Number of spaces for @refill to indent a paragraph; else to leave as is.")
@@ -2822,7 +2804,7 @@ Default is to leave the number of spaces as is."
 
 (put 'refill 'texinfo-format 'texinfo-format-refill)
 (defun texinfo-format-refill ()
-  "Refill paragraph. Also, indent first line as set by @paragraphindent.
+  "Refill paragraph.  Also, indent first line as set by @paragraphindent.
 Default is to leave paragraph indentation as is."
   (texinfo-discard-command)
   (let ((position (point-marker)))
@@ -2941,11 +2923,9 @@ Default is to leave paragraph indentation as is."
 
     ;; eg: "aa" . texinfo-aaindex
     (or (assoc index-name texinfo-indexvar-alist)
-        (setq texinfo-indexvar-alist
-              (cons
-               (cons index-name
-                     index-alist-name)
-               texinfo-indexvar-alist)))
+        (push (cons index-name
+                    index-alist-name)
+              texinfo-indexvar-alist))
 
     (fset index-formatting-command
           (list 'lambda 'nil
@@ -4024,7 +4004,7 @@ The command  `@value{foo}'  expands to the value."
 (put 'ifset 'texinfo-end 'texinfo-discard-command)
 (put 'ifset 'texinfo-format 'texinfo-if-set)
 (defun texinfo-if-set ()
-  "If set, continue formatting; else do not format region up to @end ifset"
+  "If set, continue formatting; else do not format region up to @end ifset."
   (let ((arg (texinfo-parse-arg-discard)))
     (cond
      ((eq (get (car (read-from-string arg)) 'texinfo-whether-setp)
@@ -4045,7 +4025,7 @@ The command  `@value{foo}'  expands to the value."
 (put 'ifclear 'texinfo-end 'texinfo-discard-command)
 (put 'ifclear 'texinfo-format 'texinfo-if-clear)
 (defun texinfo-if-clear ()
-  "If clear, continue formatting; if set, do not format up to @end ifset"
+  "If clear, continue formatting; if set, do not format up to @end ifset."
   (let ((arg (texinfo-parse-arg-discard)))
     (cond
      ((eq (get (car (read-from-string arg)) 'texinfo-whether-setp)
@@ -4291,7 +4271,7 @@ the @ifeq command."
 ;;; Batch formatting
 
 (defun batch-texinfo-format ()
-  "Runs  texinfo-format-buffer  on the files remaining on the command line.
+  "Run `texinfo-format-buffer' on the files remaining on the command line.
 Must be used only with -batch, and kills Emacs on completion.
 Each file will be processed even if an error occurred previously.
 For example, invoke
@@ -4317,8 +4297,8 @@ For example, invoke
                      (nconc (directory-files file)
                             (cdr command-line-args-left))))
               (t
-               (setq files (cons file files)
-                     command-line-args-left (cdr command-line-args-left)))))
+               (push file files)
+               (setq command-line-args-left (cdr command-line-args-left)))))
       (while files
         (setq file (car files)
               files (cdr files))
@@ -4354,5 +4334,5 @@ For example, invoke
 ;;; Place `provide' at end of file.
 (provide 'texinfmt)
 
-;;; arch-tag: 1e8d9a2d-bca0-40a0-ac6c-dab01bc6f725
+;; arch-tag: 1e8d9a2d-bca0-40a0-ac6c-dab01bc6f725
 ;;; texinfmt.el ends here
index 35b60e4..ce26344 100644 (file)
@@ -67,7 +67,7 @@
   "Determine the start and end buffer locations for the THING at point.
 THING is a symbol which specifies the kind of syntactic entity you want.
 Possibilities include `symbol', `list', `sexp', `defun', `filename', `url',
-`word', `sentence', `whitespace', `line', `page' and others.
+`email', `word', `sentence', `whitespace', `line', `page' and others.
 
 See the file `thingatpt.el' for documentation on how to define
 a symbol as a valid THING.
@@ -124,7 +124,7 @@ of the textual entity that was found."
   "Return the THING at point.
 THING is a symbol which specifies the kind of syntactic entity you want.
 Possibilities include `symbol', `list', `sexp', `defun', `filename', `url',
-`word', `sentence', `whitespace', `line', `page' and others.
+`email', `word', `sentence', `whitespace', `line', `page' and others.
 
 See the file `thingatpt.el' for documentation on how to define
 a symbol as a valid THING."
@@ -340,6 +340,33 @@ point."
              (goto-char (car bounds))
            (error "No URL here")))))
 
+;;   Email addresses
+(defvar thing-at-point-email-regexp
+  "<?[-+_.~a-zA-Z][-+_.~:a-zA-Z0-9]*@[-.a-zA-Z0-9]+>?"
+  "A regular expression probably matching an email address.
+This does not match the real name portion, only the address, optionally
+with angle brackets.")
+
+;; Haven't set 'forward-op on 'email nor defined 'forward-email' because
+;; not sure they're actually needed, and URL seems to skip them too.
+;; Note that (end-of-thing 'email) and (beginning-of-thing 'email)
+;; work automagically, though.
+
+(put 'email 'bounds-of-thing-at-point
+     (lambda ()
+       (let ((thing (thing-at-point-looking-at thing-at-point-email-regexp)))
+         (if thing
+             (let ((beginning (match-beginning 0))
+                   (end (match-end 0)))
+               (cons beginning end))))))
+
+(put 'email 'thing-at-point
+     (lambda ()
+       (let ((boundary-pair (bounds-of-thing-at-point 'email)))
+         (if boundary-pair
+             (buffer-substring-no-properties
+              (car boundary-pair) (cdr boundary-pair))))))
+
 ;;  Whitespace
 
 (defun forward-whitespace (arg)
index 6aa8126..9d8b289 100644 (file)
@@ -67,7 +67,7 @@
   :version "22.1"
   :group 'multimedia)
 
-(defcustom thumbs-thumbsdir "~/.emacs.d/thumbs"
+(defcustom thumbs-thumbsdir (concat user-emacs-directory "thumbs")
   "*Directory to store thumbnails."
   :type 'directory
   :group 'thumbs)
index bfa7f42..df71ea9 100644 (file)
@@ -155,9 +155,9 @@ options:
                           " RET instead."))
               (insert "\n\nWith your current key bindings"
                       " you can use "
-                      (if (string-equal "the menus" where)
+                      (if (string-match "^the .*menus?$" where)
                           ""
-                        "the key ")
+                        "the key")
                       where
                       " to get the function `"
                       (format "%s" db)
@@ -406,7 +406,7 @@ where
   WHERE       is a text describing the key sequences to which DEF-FUN is
               bound now (or, if it is remapped, a key sequence
               for the function it is remapped to)
-  REMARK      is a list with info about rebinding.  It has either of
+  REMARK      is a list with info about rebinding. It has either of
               these formats:
 
                 \(TEXT cua-mode)
@@ -439,15 +439,27 @@ where
                          (if (eq def-fun 'Control-X-prefix)
                              (lookup-key global-map [24])
                            (key-binding key))))
-              (where (where-is-internal (if rem-fun rem-fun def-fun))))
+              (where (where-is-internal (if rem-fun rem-fun def-fun)))
+              cwhere)
 
          (if where
              (progn
-               (setq where (key-description (car where)))
+               (setq cwhere (car where)
+                     where (key-description cwhere))
                (when (and (< 10 (length where))
                           (string= (substring where 0 (length "<menu-bar>"))
                                    "<menu-bar>"))
-                 (setq where "the menus")))
+                 (setq where
+                       (if (and (vectorp cwhere)
+                                (setq cwhere (elt cwhere 1))
+                                (setq cwhere
+                                      (cadr
+                                       (assoc cwhere
+                                              (lookup-key global-map
+                                                          [menu-bar]))))
+                                (stringp cwhere))
+                           (format "the `%s' menu" cwhere)
+                         "the menus"))))
            (setq where ""))
          (setq remark nil)
          (unless
@@ -617,8 +629,7 @@ with some explanatory links."
 
 (defun tutorial--saved-dir ()
   "Directory to which tutorials are saved."
-  (expand-file-name "tutorial"
-                   (if (eq system-type 'ms-dos) "~/_emacs.d/" "~/.emacs.d/")))
+  (expand-file-name "tutorial" user-emacs-directory))
 
 (defun tutorial--saved-file ()
   "File name in which to save tutorials."
@@ -921,7 +932,7 @@ See `get-lang-string' for more information.")
 In certain places Emacs can replace a string shown to the user with
 a language specific string.  This function retrieves such strings.
 
-LANG is the language specification.  It should be one of those
+LANG is the language specification. It should be one of those
 strings that can be returned by `read-language-name'.  STRINGID
 is a symbol that specifies the string to retrieve.
 
index 1c00d1e..1f5e640 100644 (file)
@@ -28,7 +28,7 @@
 ;;; Commentary:
 
 ;; Emacs's standard method for making buffer names unique adds <2>, <3>,
-;; etc. to the end of (all but one of) the buffers.  This file replaces
+;; etc.. to the end of (all but one of) the buffers.  This file replaces
 ;; that behavior, for buffers visiting files and dired buffers, with a
 ;; uniquification that adds parts of the file name until the buffer names
 ;; are unique.  For instance, buffers visiting /u/mernst/tmp/Makefile and
@@ -95,7 +95,7 @@
 
 
 (defcustom uniquify-buffer-name-style nil
-  "*If non-nil, buffer names are uniquified with parts of directory name.
+  "If non-nil, buffer names are uniquified with parts of directory name.
 The value determines the buffer name style and is one of `forward',
 `reverse', `post-forward', or `post-forward-angle-brackets'.
 For example, files `/foo/bar/mumble/name' and `/baz/quux/mumble/name'
@@ -104,7 +104,9 @@ would have the following buffer names in the various styles:
   reverse        name\\mumble\\bar  name\\mumble\\quux
   post-forward   name|bar/mumble  name|quux/mumble
   post-forward-angle-brackets   name<bar/mumble>  name<quux/mumble>
-  nil            name  name<2>"
+  nil            name  name<2>
+Of course, the \"mumble\" part may be stripped as well, depending on the setting
+of `uniquify-strip-common-suffix'."
   :type '(radio (const forward)
                (const reverse)
                (const post-forward)
@@ -119,7 +121,7 @@ would have the following buffer names in the various styles:
   :group 'uniquify)
 
 (defcustom uniquify-ask-about-buffer-names-p nil
-  "*If non-nil, permit user to choose names for buffers with same base file.
+  "If non-nil, permit user to choose names for buffers with same base file.
 If the user chooses to name a buffer, uniquification is preempted and no
 other buffer names are changed."
   :type 'boolean
@@ -127,7 +129,7 @@ other buffer names are changed."
 
 ;; The default value matches certain Gnus buffers.
 (defcustom uniquify-ignore-buffers-re nil
-  "*Regular expression matching buffer names that should not be uniquified.
+  "Regular expression matching buffer names that should not be uniquified.
 For instance, set this to \"^draft-[0-9]+$\" to avoid having uniquify rename
 draft buffers even if `uniquify-after-kill-buffer-p' is non-nil and the
 visited file name isn't the same as that of the buffer."
@@ -135,12 +137,12 @@ visited file name isn't the same as that of the buffer."
   :group 'uniquify)
 
 (defcustom uniquify-min-dir-content 0
-  "*Minimum number of directory name components included in buffer name."
+  "Minimum number of directory name components included in buffer name."
   :type 'integer
   :group 'uniquify)
 
 (defcustom uniquify-separator nil
-  "*String separator for buffer name components.
+  "String separator for buffer name components.
 When `uniquify-buffer-name-style' is `post-forward', separates
 base file name from directory part in buffer names (default \"|\").
 When `uniquify-buffer-name-style' is `reverse', separates all
@@ -149,7 +151,7 @@ file name components (default \"\\\")."
   :group 'uniquify)
 
 (defcustom uniquify-trailing-separator-p nil
-  "*If non-nil, add a file name separator to dired buffer names.
+  "If non-nil, add a file name separator to dired buffer names.
 If `uniquify-buffer-name-style' is `forward', add the separator at the end;
 if it is `reverse', add the separator at the beginning; otherwise, this
 variable is ignored."
@@ -255,7 +257,7 @@ in `uniquify-list-buffers-directory-modes', otherwise returns nil."
           (directory-file-name filename))))))))
 
 (defun uniquify-rerationalize-w/o-cb (fix-list)
-  "Re-rationalize the buffers in FIX-LIST, but ignoring current-buffer."
+  "Re-rationalize the buffers in FIX-LIST, but ignoring `current-buffer'."
   (let ((new-fix-list nil))
     (dolist (item fix-list)
       (let ((buf (uniquify-item-buffer item)))
index da5410f..46a2bb6 100644 (file)
@@ -7,11 +7,26 @@
 
        * Relicense all FSF files to GPLv3 or later.
 
+2007-06-12  Tom Tromey  <tromey@redhat.com>
+
+       * url.el (url-configuration-directory): Use user-emacs-directory.
+
+2007-06-12  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * url-cookie.el (url-cookie-name, url-cookie-value)
+       (url-cookie-expires, url-cookie-localpart, url-cookie-domain)
+       (url-cookie-secure, url-cookie-set-name, url-cookie-set-value)
+       (url-cookie-set-expires, url-cookie-set-localpart)
+       (url-cookie-set-domain, url-cookie-set-secure)
+       (url-cookie-retrieve-arg, url-cookie-create, url-cookie-p): Remove.
+       (url-cookie): New struct.
+       (url-cookie-store): Use setf instead of url-cookie-set-*.
+
 2007-05-29  Chong Yidong  <cyd@stupidchicken.com>
 
        * url-mailto.el (url-mailto): Insert body after
        mail-header-separator if present, so that it is before signature.
-       Bug reported by Leo <sdl.web@gmail.com>.
+       Suggested by Leo <sdl.web@gmail.com>.
 
 2007-04-15  Chong Yidong  <cyd@stupidchicken.com>
 
index cdca651..368c34e 100644 (file)
 
 ;; See http://home.netscape.com/newsref/std/cookie_spec.html for the
 ;; 'open standard' defining this crap.
-;;
-;; A cookie is stored internally as a vector of 7 slots
-;; [ cookie NAME VALUE EXPIRES LOCALPART DOMAIN SECURE ]
-
-(defsubst url-cookie-name    (cookie) (aref cookie 1))
-(defsubst url-cookie-value   (cookie) (aref cookie 2))
-(defsubst url-cookie-expires (cookie) (aref cookie 3))
-(defsubst url-cookie-localpart    (cookie) (aref cookie 4))
-(defsubst url-cookie-domain  (cookie) (aref cookie 5))
-(defsubst url-cookie-secure  (cookie) (aref cookie 6))
-
-(defsubst url-cookie-set-name    (cookie val) (aset cookie 1 val))
-(defsubst url-cookie-set-value   (cookie val) (aset cookie 2 val))
-(defsubst url-cookie-set-expires (cookie val) (aset cookie 3 val))
-(defsubst url-cookie-set-localpart (cookie val) (aset cookie 4 val))
-(defsubst url-cookie-set-domain  (cookie val) (aset cookie 5 val))
-(defsubst url-cookie-set-secure  (cookie val) (aset cookie 6 val))
-(defsubst url-cookie-retrieve-arg (key args) (nth 1 (memq key args)))
-
-(defsubst url-cookie-create (&rest args)
-  "Create a cookie vector object from keyword-value pairs ARGS.
-The keywords allowed are
-  :name NAME
-  :value VALUE
-  :expires TIME
-  :localpart LOCALPAR
-  :domain DOMAIN
-  :secure ???
-Could someone fill in more information?"
-  (let ((retval (make-vector 7 nil)))
-    (aset retval 0 'cookie)
-    (url-cookie-set-name retval (url-cookie-retrieve-arg :name args))
-    (url-cookie-set-value retval (url-cookie-retrieve-arg :value args))
-    (url-cookie-set-expires retval (url-cookie-retrieve-arg :expires args))
-    (url-cookie-set-localpart retval (url-cookie-retrieve-arg :localpart args))
-    (url-cookie-set-domain retval (url-cookie-retrieve-arg :domain args))
-    (url-cookie-set-secure retval (url-cookie-retrieve-arg :secure args))
-    retval))
-
-(defun url-cookie-p (obj)
-  "Return non-nil if OBJ is a cookie vector object.
-These objects represent cookies in the URL package.
-A cookie vector object is a vector of 7 slots:
- [cookie NAME VALUE EXPIRES LOCALPART DOMAIN SECURE]."
-  (and (vectorp obj) (= (length obj) 7) (eq (aref obj 0) 'cookie)))
 
 (defgroup url-cookie nil
   "URL cookies."
@@ -85,6 +40,20 @@ A cookie vector object is a vector of 7 slots:
   :prefix "url-cookie-"
   :group 'url)
 
+;; A cookie is stored internally as a vector of 7 slots
+;; [ cookie NAME VALUE EXPIRES LOCALPART DOMAIN SECURE ]
+
+(defstruct (url-cookie
+            (:constructor url-cookie-create)
+            (:copier nil)
+            ;; For compatibility with a previous version which did not use
+            ;; defstruct, and also in order to make sure that the printed
+            ;; representation does not depend on CL internals, we use an
+            ;; explicitly managed tag.
+            (:type vector))
+  (tag 'cookie :read-only t)
+  name value expires localpart domain secure)
+
 (defvar url-cookie-storage nil         "Where cookies are stored.")
 (defvar url-cookie-secure-storage nil  "Where secure cookies are stored.")
 (defcustom url-cookie-file nil
@@ -199,8 +168,8 @@ telling Microsoft that."
            (if (and (equal localpart (url-cookie-localpart cur))
                     (equal name (url-cookie-name cur)))
                (progn
-                 (url-cookie-set-expires cur expires)
-                 (url-cookie-set-value cur value)
+                 (setf (url-cookie-expires cur) expires)
+                 (setf (url-cookie-value cur) value)
                  (setq tmp t))))
          (if (not tmp)
              ;; New cookie
index 1af016f..3b292b4 100644 (file)
@@ -50,7 +50,8 @@
 (defvar url-configuration-directory
   (cond
    ((file-directory-p "~/.url") "~/.url")
-   ((file-directory-p "~/.emacs.d") "~/.emacs.d/url")
+   ((file-directory-p user-emacs-directory)
+    (concat user-emacs-directory "url"))
    (t "~/.url")))
 
 (defun url-do-setup ()
index 68a1b1b..9052a7b 100644 (file)
@@ -62,7 +62,7 @@
 ;;;
 
 (defvar vc-arch-command
-  (let ((candidates '("tla")))
+  (let ((candidates '("tla" "baz")))
     (while (and candidates (not (executable-find (car candidates))))
       (setq candidates (cdr candidates)))
     (or (car candidates) "tla")))
   (comment-normalize-vars)
   (goto-char (point-max))
   (forward-comment -1)
-  (unless (bolp) (insert "\n"))
+  (skip-chars-forward " \t\n")
+  (cond
+   ((not (bolp)) (insert "\n\n"))
+   ((not (eq ?\n (char-before (1- (point))))) (insert "\n")))
   (let ((beg (point))
        (idfile (and buffer-file-name
                     (expand-file-name
@@ -195,16 +198,17 @@ Only the value `maybe' can be trusted :-(."
        ;; creates a {arch} directory somewhere.
        file 'arch-root (vc-find-root file "{arch}/=tagging-method"))))
 
-(defun vc-arch-register (file &optional rev comment)
+(defun vc-arch-register (files &optional rev comment)
   (if rev (error "Explicit initial revision not supported for Arch"))
-  (let ((tagmet (vc-arch-tagging-method file)))
-    (if (and (memq tagmet '(tagline implicit)) comment-start)
-       (with-current-buffer (find-file-noselect file)
-         (if (buffer-modified-p)
-             (error "Save %s first" (buffer-name)))
-         (vc-arch-add-tagline)
-         (save-buffer))
-      (vc-arch-command nil 0 file "add"))))
+  (dolist (file files)
+    (let ((tagmet (vc-arch-tagging-method file)))
+      (if (and (memq tagmet '(tagline implicit)) comment-start)
+         (with-current-buffer (find-file-noselect file)
+           (if (buffer-modified-p)
+               (error "Save %s first" (buffer-name)))
+           (vc-arch-add-tagline)
+           (save-buffer)))))
+  (vc-arch-command nil 0 files "add"))
 
 (defun vc-arch-registered (file)
   ;; Don't seriously check whether it's source or not.  Checking would
@@ -368,42 +372,49 @@ Return non-nil if FILE is unchanged."
 
 (defun vc-arch-checkout-model (file) 'implicit)
 
-(defun vc-arch-checkin (file rev comment)
+(defun vc-arch-checkin (files rev comment)
   (if rev (error "Committing to a specific revision is unsupported"))
-  (let ((summary (file-relative-name file (vc-arch-root file))))
+  ;; FIXME: This implementation probably only works for singleton filesets
+  (let ((summary (file-relative-name (car file) (vc-arch-root (car files)))))
     ;; Extract a summary from the comment.
     (when (or (string-match "\\`Summary:[ \t]*\\(.*[^ \t\n]\\)\\([ \t]*\n\\)*" comment)
              (string-match "\\`[ \t]*\\(.*[^ \t\n]\\)[ \t]*\\(\n?\\'\\|\n\\([ \t]*\n\\)+\\)" comment))
       (setq summary (match-string 1 comment))
       (setq comment (substring comment (match-end 0))))
-    (vc-arch-command nil 0 file "commit" "-s" summary "-L" comment "--"
+    (vc-arch-command nil 0 files "commit" "-s" summary "-L" comment "--"
                     (vc-switches 'Arch 'checkin))))
 
-(defun vc-arch-diff (file &optional oldvers newvers buffer)
-  "Get a difference report using Arch between two versions of FILE."
-  (if (and newvers
-          (vc-up-to-date-p file)
-          (equal newvers (vc-workfile-version file)))
-      ;; Newvers is the base revision and the current file is unchanged,
-      ;; so we can diff with the current file.
-      (setq newvers nil))
-  (if newvers
-      (error "Diffing specific revisions not implemented")
-    (let* ((async (and (not vc-disable-async-diff) (fboundp 'start-process)))
-          ;; Run the command from the root dir.
-          (default-directory (vc-arch-root file))
-          (status
-           (vc-arch-command
-            (or buffer "*vc-diff*")
-            (if async 'async 1)
-            nil "file-diffs"
-            ;; Arch does not support the typical flags.
-            ;; (vc-switches 'Arch 'diff)
-            (file-relative-name file)
-            (if (equal oldvers (vc-workfile-version file))
-                nil
-              oldvers))))
-      (if async 1 status))))          ; async diff, pessimistic assumption.
+(defun vc-arch-diff (files &optional oldvers newvers buffer)
+  "Get a difference report using Arch between two versions of FILES."
+  ;; FIXME: This implementation only works for singleton filesets.  To make
+  ;; it work for more cases, we have to either call `file-diffs' manually on
+  ;; each and every `file' in the fileset, or use `changes --diffs' (and
+  ;; variants) and maybe filter the output with `filterdiff' to only include
+  ;; the files in which we're interested.
+  (let ((file (car files)))
+    (if (and newvers
+             (vc-up-to-date-p file)
+             (equal newvers (vc-workfile-version file)))
+        ;; Newvers is the base revision and the current file is unchanged,
+        ;; so we can diff with the current file.
+        (setq newvers nil))
+    (if newvers
+        (error "Diffing specific revisions not implemented")
+      (let* ((async (and (not vc-disable-async-diff) (fboundp 'start-process)))
+             ;; Run the command from the root dir.
+             (default-directory (vc-arch-root file))
+             (status
+              (vc-arch-command
+               (or buffer "*vc-diff*")
+               (if async 'async 1)
+               nil "file-diffs"
+               ;; Arch does not support the typical flags.
+               ;; (vc-switches 'Arch 'diff)
+               (file-relative-name file)
+               (if (equal oldvers (vc-workfile-version file))
+                   nil
+                 oldvers))))
+        (if async 1 status)))))               ; async diff, pessimistic assumption.
 
 (defun vc-arch-delete-file (file)
   (vc-arch-command nil 0 file "rm"))
@@ -444,6 +455,104 @@ Return non-nil if FILE is unchanged."
              (table (vc-arch--version-completion-table root string)))
        (complete-with-action action table string pred)))))
 
+;;; Trimming revision libraries.
+
+;; This code is not directly related to VC and there are many variants of
+;; this functionality available as scripts, but I like this version better,
+;; so maybe others will like it too.
+
+(defun vc-arch-trim-find-least-useful-rev (revs)
+  (let* ((first (pop revs))
+         (second (pop revs))
+         (third (pop revs))
+         ;; We try to give more importance to recent revisions.  The idea is
+         ;; that it's OK if checking out a revision 1000-patch-old is ten
+         ;; times slower than checking out a revision 100-patch-old.  But at
+         ;; the same time a 2-patch-old rev isn't really ten times more
+         ;; important than a 20-patch-old, so we use an arbitrary constant
+         ;; "100" to reduce this effect for recent revisions.  Making this
+         ;; constant a float has the side effect of causing the subsequent
+         ;; computations to be done as floats as well.
+         (max (+ 100.0 (car (or (car (last revs)) third))))
+         (cost (lambda () (/ (- (car third) (car first)) (- max (car second)))))
+         (minrev second)
+         (mincost (funcall cost)))
+    (while revs
+      (setq first second)
+      (setq second third)
+      (setq third (pop revs))
+      (when (< (funcall cost) mincost)
+        (setq minrev second)
+        (setq mincost (funcall cost))))
+    minrev))
+
+(defun vc-arch-trim-make-sentinel (revs)
+  (if (null revs) (lambda (proc msg) (message "VC-Arch trimming ... done"))
+    `(lambda (proc msg)
+       (message "VC-Arch trimming %s..." ',(file-name-nondirectory (car revs)))
+       (rename-file ,(car revs) ,(concat (car revs) "*rm*"))
+       (setq proc (start-process "vc-arch-trim" nil
+                                 "rm" "-rf" ',(concat (car revs) "*rm*")))
+       (set-process-sentinel proc (vc-arch-trim-make-sentinel ',(cdr revs))))))
+
+(defun vc-arch-trim-one-revlib (dir)
+  "Delete half of the revisions in the revision library."
+  (interactive "Ddirectory: ")
+  (let ((revs
+         (sort (delq nil
+                     (mapcar
+                      (lambda (f)
+                        (when (string-match "-\\([0-9]+\\)\\'" f)
+                          (cons (string-to-number (match-string 1 f)) f)))
+                      (directory-files dir nil nil 'nosort)))
+               'car-less-than-car))
+        (subdirs nil))
+    (when (cddr revs)
+      (dotimes (i (/ (length revs) 2))
+        (let ((minrev (vc-arch-trim-find-least-useful-rev revs)))
+          (setq revs (delq minrev revs))
+          (push minrev subdirs)))
+      (funcall (vc-arch-trim-make-sentinel
+                (mapcar (lambda (x) (expand-file-name (cdr x) dir)) subdirs))
+               nil nil))))
+
+(defun vc-arch-trim-revlib ()
+  "Delete half of the revisions in the revision library."
+  (interactive)
+  (let ((rl-dir (with-output-to-string
+                  (call-process vc-arch-command nil standard-output nil
+                                "my-revision-library"))))
+    (while (string-match "\\(.*\\)\n" rl-dir)
+      (let ((dir (match-string 1 rl-dir)))
+        (setq rl-dir
+              (if (and (file-directory-p dir) (file-writable-p dir))
+                  dir
+                (substring rl-dir (match-end 0))))))
+    (unless (file-writable-p rl-dir)
+      (error "No writable revlib directory found"))
+    (message "Revlib at %s" rl-dir)
+    (let* ((archives (directory-files rl-dir 'full "[^.]\\|..."))
+           (categories
+            (apply 'append
+                   (mapcar (lambda (dir)
+                             (when (file-directory-p dir)
+                               (directory-files dir 'full "[^.]\\|...")))
+                           archives)))
+           (branches
+            (apply 'append
+                   (mapcar (lambda (dir)
+                             (when (file-directory-p dir)
+                               (directory-files dir 'full "[^.]\\|...")))
+                           categories)))
+           (versions
+            (apply 'append
+                   (mapcar (lambda (dir)
+                             (when (file-directory-p dir)
+                               (directory-files dir 'full "--.*--")))
+                           branches))))
+      (mapc 'vc-arch-trim-one-revlib versions))
+    ))
+    
 ;;; Less obvious implementations.
 
 (defun vc-arch-find-version (file rev buffer)
index a11aa2e..20a9ca9 100644 (file)
@@ -92,6 +92,7 @@ Invoke the bzr command adding `BZR_PROGRESS_BAR=none' to the environment."
     (apply 'vc-do-command buffer okstatus vc-bzr-program
            file-or-list bzr-command (append vc-bzr-program-args args))))
 
+
 ;;;###autoload
 (defconst vc-bzr-admin-dirname ".bzr"    ; FIXME: "_bzr" on w32?
   "Name of the directory containing Bzr repository status files.")
index a0eb260..f90f698 100644 (file)
 
 (eval-when-compile (require 'cl) (require 'vc))
 
+;; Clear up the cache to force vc-call to check again and discover
+;; new functions when we reload this file.
+(put 'CVS 'vc-functions nil)
+
 ;;;
 ;;; Customization options
 ;;;
@@ -254,14 +258,25 @@ See also variable `vc-cvs-sticky-date-format-string'."
 Compared to the default implementation, this function does two things:
 Handle the special case of a CVS file that is added but not yet
 committed and support display of sticky tags."
-  (let ((sticky-tag (vc-file-getprop file 'vc-cvs-sticky-tag))
-       (string (if (string= (vc-workfile-version file) "0")
-                   ;; A file that is added but not yet committed.
-                   "CVS @@"
-                 (vc-default-mode-line-string 'CVS file))))
-    (if (zerop (length sticky-tag))
-       string
-      (concat string "[" sticky-tag "]"))))
+  (let* ((sticky-tag (vc-file-getprop file 'vc-cvs-sticky-tag))
+        help-echo
+        (string 
+         (if (string= (vc-workfile-version file) "0")
+             ;; A file that is added but not yet committed.
+             (progn
+               (setq help-echo "Added file (needs commit) under CVS")
+               "CVS @@")
+           (let ((def-ml (vc-default-mode-line-string 'CVS file)))
+             (setq help-echo 
+                   (get-text-property 0 'help-echo def-ml))
+             def-ml))))
+    (propertize 
+     (if (zerop (length sticky-tag))
+        string
+       (setq help-echo (format "%s on the '%s' branch" 
+                              help-echo sticky-tag))
+       (concat string "[" sticky-tag "]"))
+     'help-echo help-echo)))
 
 (defun vc-cvs-dired-state-info (file)
   "CVS-specific version of `vc-dired-state-info'."
@@ -277,21 +292,21 @@ committed and support display of sticky tags."
 ;;; State-changing functions
 ;;;
 
-(defun vc-cvs-register (file &optional rev comment)
-  "Register FILE into the CVS version-control system.
-COMMENT can be used to provide an initial description of FILE.
+(defun vc-cvs-register (files &optional rev comment)
+  "Register FILES into the CVS version-control system.
+COMMENT can be used to provide an initial description of FILES.
 
 `vc-register-switches' and `vc-cvs-register-switches' are passed to
 the CVS command (in that order)."
   (when (and (not (vc-cvs-responsible-p file))
-            (vc-cvs-could-register file))
-    ;; Register the directory if needed.
-    (vc-cvs-register (directory-file-name (file-name-directory file))))
-  (apply 'vc-cvs-command nil 0 file
-        "add"
-        (and comment (string-match "[^\t\n ]" comment)
-             (concat "-m" comment))
-        (vc-switches 'CVS 'register)))
+              (vc-cvs-could-register file))
+      ;; Register the directory if needed.
+      (vc-cvs-register (directory-file-name (file-name-directory file))))
+    (apply 'vc-cvs-command nil 0 files
+          "add"
+          (and comment (string-match "[^\t\n ]" comment)
+               (concat "-m" comment))
+          (vc-switches 'CVS 'register)))
 
 (defun vc-cvs-responsible-p (file)
   "Return non-nil if CVS thinks it is responsible for FILE."
@@ -313,17 +328,18 @@ its parents."
                     t (directory-file-name dir))))
     (eq dir t)))
 
-(defun vc-cvs-checkin (file rev comment)
+(defun vc-cvs-checkin (files rev comment)
   "CVS-specific version of `vc-backend-checkin'."
   (unless (or (not rev) (vc-cvs-valid-version-number-p rev))
     (if (not (vc-cvs-valid-symbolic-tag-name-p rev))
        (error "%s is not a valid symbolic tag name" rev)
       ;; If the input revison is a valid symbolic tag name, we create it
       ;; as a branch, commit and switch to it.
-      (apply 'vc-cvs-command nil 0 file "tag" "-b" (list rev))
-      (apply 'vc-cvs-command nil 0 file "update" "-r" (list rev))
-      (vc-file-setprop file 'vc-cvs-sticky-tag rev)))
-  (let ((status (apply 'vc-cvs-command nil 1 file
+      (apply 'vc-cvs-command nil 0 files "tag" "-b" (list rev))
+      (apply 'vc-cvs-command nil 0 files "update" "-r" (list rev))
+      (mapc (lambda (file) (vc-file-setprop file 'vc-cvs-sticky-tag rev))
+           files)))
+  (let ((status (apply 'vc-cvs-command nil 1 files
                       "ci" (if rev (concat "-r" rev))
                       (concat "-m" comment)
                       (vc-switches 'CVS 'checkin))))
@@ -333,7 +349,8 @@ its parents."
       ;; Check checkin problem.
       (cond
        ((re-search-forward "Up-to-date check failed" nil t)
-        (vc-file-setprop file 'vc-state 'needs-merge)
+       (mapc (lambda (file) (vc-file-setprop file 'vc-state 'needs-merge))
+             files)
         (error (substitute-command-keys
                 (concat "Up-to-date check failed: "
                         "type \\[vc-next-action] to merge in changes"))))
@@ -342,20 +359,25 @@ its parents."
         (goto-char (point-min))
         (shrink-window-if-larger-than-buffer)
         (error "Check-in failed"))))
-    ;; Update file properties
-    (vc-file-setprop
-     file 'vc-workfile-version
-     (vc-parse-buffer "^\\(new\\|initial\\) revision: \\([0-9.]+\\)" 2))
-    ;; Forget the checkout model of the file, because we might have
+    ;; Single-file commit?  Then update the version by parsing the buffer.
+    ;; Otherwise we can't necessarily tell what goes with what; clear
+    ;; its properties so they have to be refetched.
+    (if (= (length files) 1)
+       (vc-file-setprop
+        (car files) 'vc-workfile-version
+        (vc-parse-buffer "^\\(new\\|initial\\) revision: \\([0-9.]+\\)" 2))
+      (mapc (lambda (file) (vc-file-clearprops file)) files))
+    ;; Anyway, forget the checkout model of the file, because we might have
     ;; guessed wrong when we found the file.  After commit, we can
     ;; tell it from the permissions of the file (see
     ;; vc-cvs-checkout-model).
-    (vc-file-setprop file 'vc-checkout-model nil)
+    (mapc (lambda (file) (vc-file-setprop file 'vc-checkout-model nil))
+         files)
 
     ;; if this was an explicit check-in (does not include creation of
     ;; a branch), remove the sticky tag.
     (if (and rev (not (vc-cvs-valid-symbolic-tag-name-p rev)))
-       (vc-cvs-command nil 0 file "update" "-A"))))
+       (vc-cvs-command nil 0 files "update" "-A"))))
 
 (defun vc-cvs-find-version (file rev buffer)
   (apply 'vc-cvs-command
@@ -367,99 +389,45 @@ its parents."
         "-p"
         (vc-switches 'CVS 'checkout)))
 
-(defun vc-cvs-checkout (file &optional editable rev workfile)
-  "Retrieve a revision of FILE into a WORKFILE.
+(defun vc-cvs-checkout (file &optional editable rev)
+  "Checkout a revision of FILE into the working area.
 EDITABLE non-nil means that the file should be writable.
-REV is the revision to check out into WORKFILE."
-  (let ((filename (or workfile file))
-       (file-buffer (get-file-buffer file))
-       switches)
-    (message "Checking out %s..." filename)
-    (save-excursion
-      ;; Change buffers to get local value of vc-checkout-switches.
-      (if file-buffer (set-buffer file-buffer))
-      (setq switches (vc-switches 'CVS 'checkout))
-      ;; Save this buffer's default-directory
-      ;; and use save-excursion to make sure it is restored
-      ;; in the same buffer it was saved in.
-      (let ((default-directory default-directory))
-       (save-excursion
-         ;; Adjust the default-directory so that the check-out creates
-         ;; the file in the right place.
-         (setq default-directory (file-name-directory filename))
-         (if workfile
-             (let ((failed t)
-                    (backup-name (if (string= file workfile)
-                                     (car (find-backup-file-name filename)))))
-                (when backup-name
-                  (copy-file filename backup-name
-                             'ok-if-already-exists 'keep-date)
-                  (unless (file-writable-p filename)
-                    (set-file-modes filename
-                                    (logior (file-modes filename) 128))))
-               (unwind-protect
-                   (progn
-                      (let ((coding-system-for-read 'no-conversion)
-                            (coding-system-for-write 'no-conversion))
-                        (with-temp-file filename
-                          (apply 'vc-cvs-command
-                                 (current-buffer) 0 file
-                                 "-Q"  ; suppress diagnostic output
-                                 "update"
-                                 (and (stringp rev)
-                                      (not (string= rev ""))
-                                      (concat "-r" rev))
-                                 "-p"
-                                 switches)))
-                     (setq failed nil))
-                 (if failed
-                      (if backup-name
-                          (rename-file backup-name filename
-                                       'ok-if-already-exists)
-                        (if (file-exists-p filename)
-                            (delete-file filename)))
-                    (and backup-name
-                         (not vc-make-backup-files)
-                         (delete-file backup-name)))))
-           (if (and (file-exists-p file) (not rev))
-               ;; If no revision was specified, just make the file writable
-               ;; if necessary (using `cvs-edit' if requested).
-               (and editable (not (eq (vc-cvs-checkout-model file) 'implicit))
-                     (if vc-cvs-use-edit
-                         (vc-cvs-command nil 0 file "edit")
-                       (set-file-modes file (logior (file-modes file) 128))
-                       (if file-buffer (toggle-read-only -1))))
-              ;; Check out a particular version (or recreate the file).
-              (vc-file-setprop file 'vc-workfile-version nil)
-              (apply 'vc-cvs-command nil 0 file
-                     (and editable
-                          (or (not (file-exists-p file))
-                              (not (eq (vc-cvs-checkout-model file)
-                                       'implicit)))
-                          "-w")
-                     "update"
-                     (when rev
-                       (unless (eq rev t)
-                         ;; default for verbose checkout: clear the
-                         ;; sticky tag so that the actual update will
-                         ;; get the head of the trunk
-                         (if (string= rev "")
-                             "-A"
-                           (concat "-r" rev))))
-                     switches))))
-       (vc-mode-line file)
-       (message "Checking out %s...done" filename)))))
+REV is the revision to check out."
+  (message "Checking out %s..." file)
+  ;; Change buffers to get local value of vc-checkout-switches.
+  (with-current-buffer (or (get-file-buffer file) (current-buffer))
+    (if (and (file-exists-p file) (not rev))
+        ;; If no revision was specified, just make the file writable
+        ;; if necessary (using `cvs-edit' if requested).
+        (and editable (not (eq (vc-cvs-checkout-model file) 'implicit))
+             (if vc-cvs-use-edit
+                 (vc-cvs-command nil 0 file "edit")
+               (set-file-modes file (logior (file-modes file) 128))
+               (if (equal file buffer-file-name) (toggle-read-only -1))))
+      ;; Check out a particular version (or recreate the file).
+      (vc-file-setprop file 'vc-workfile-version nil)
+      (apply 'vc-cvs-command nil 0 file
+             (and editable "-w")
+             "update"
+             (when rev
+               (unless (eq rev t)
+                 ;; default for verbose checkout: clear the
+                 ;; sticky tag so that the actual update will
+                 ;; get the head of the trunk
+                 (if (string= rev "")
+                     "-A"
+                   (concat "-r" rev))))
+             (vc-switches 'CVS 'checkout)))
+    (vc-mode-line file))
+  (message "Checking out %s...done" file))
 
 (defun vc-cvs-delete-file (file)
   (vc-cvs-command nil 0 file "remove" "-f")
   (vc-cvs-command nil 0 file "commit" "-mRemoved."))
 
 (defun vc-cvs-revert (file &optional contents-done)
-  "Revert FILE to the version it was based on."
-  (unless contents-done
-    ;; Check out via standard output (caused by the final argument
-    ;; FILE below), so that no sticky tag is set.
-    (vc-cvs-checkout file nil (vc-workfile-version file) file))
+  "Revert FILE to the version on which it was based."
+  (vc-default-revert 'CVS file contents-done)
   (unless (eq (vc-checkout-model file) 'implicit)
     (if vc-cvs-use-edit
         (vc-cvs-command nil 0 file "unedit")
@@ -531,37 +499,30 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
 ;;; History functions
 ;;;
 
-(defun vc-cvs-print-log (file &optional buffer)
+(defun vc-cvs-print-log (files &optional buffer)
   "Get change log associated with FILE."
   (vc-cvs-command
    buffer
-   (if (and (vc-stay-local-p file) (fboundp 'start-process)) 'async 0)
-   file "log"))
+   (if (and (vc-stay-local-p files) (fboundp 'start-process)) 'async 0)
+   files "log"))
+
+(defun vc-cvs-wash-log ()
+  "Remove all non-comment information from log output."
+  (vc-call-backend 'RCS 'wash-log)
+  nil)
 
-(defun vc-cvs-diff (file &optional oldvers newvers buffer)
+(defun vc-cvs-diff (files &optional oldvers newvers buffer)
   "Get a difference report using CVS between two versions of FILE."
-  (if (string= (vc-workfile-version file) "0")
-      ;; This file is added but not yet committed; there is no master file.
-      (if (or oldvers newvers)
-         (error "No revisions of %s exist" file)
-       ;; We regard this as "changed".
-       ;; Diff it against /dev/null.
-       ;; Note: this is NOT a "cvs diff".
-       (apply 'vc-do-command (or buffer "*vc-diff*")
-              1 "diff" file
-              (append (vc-switches nil 'diff) '("/dev/null")))
-       ;; Even if it's empty, it's locally modified.
-       1)
-    (let* ((async (and (not vc-disable-async-diff)
-                       (vc-stay-local-p file)
-                       (fboundp 'start-process)))
+    (let* ((async (and (not vc-disable-async-diff) 
+                      (vc-stay-local-p files)
+                      (fboundp 'start-process)))
           (status (apply 'vc-cvs-command (or buffer "*vc-diff*")
                          (if async 'async 1)
-                         file "diff"
+                         files "diff"
                          (and oldvers (concat "-r" oldvers))
                          (and newvers (concat "-r" newvers))
                          (vc-switches 'CVS 'diff))))
-      (if async 1 status))))           ; async diff, pessimistic assumption
+      (if async 1 status)))            ; async diff, pessimistic assumption
 
 (defun vc-cvs-diff-tree (dir &optional rev1 rev2)
   "Diff all files at and below DIR."
@@ -587,14 +548,36 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
                (and rev2 (concat "-r" rev2))
                (vc-switches 'CVS 'diff))))))
 
+(defconst vc-cvs-annotate-first-line-re "^[0-9]")
+
+(defun vc-cvs-annotate-process-filter (process string)
+  (setq string (concat (process-get process 'output) string))
+  (if (not (string-match vc-cvs-annotate-first-line-re string))
+      ;; Still waiting for the first real line.
+      (process-put process 'output string)
+    (let ((vc-filter (process-get process 'vc-filter)))
+      (set-process-filter process vc-filter)
+      (funcall vc-filter process (substring string (match-beginning 0))))))
+
 (defun vc-cvs-annotate-command (file buffer &optional version)
   "Execute \"cvs annotate\" on FILE, inserting the contents in BUFFER.
 Optional arg VERSION is a version to annotate from."
-  (vc-cvs-command buffer 0 file "annotate" (if version (concat "-r" version)))
-  (with-current-buffer buffer
-    (goto-char (point-min))
-    (re-search-forward "^[0-9]")
-    (delete-region (point-min) (1- (point)))))
+  (vc-cvs-command buffer
+                  (if (and (vc-stay-local-p file) (fboundp 'start-process))
+                     'async 0)
+                  file "annotate"
+                  (if version (concat "-r" version)))
+  ;; Strip the leading few lines.
+  (let ((proc (get-buffer-process buffer)))
+    (if proc
+        ;; If running asynchronously, use a process filter.
+        (progn
+          (process-put proc 'vc-filter (process-filter proc))
+          (set-process-filter proc 'vc-cvs-annotate-process-filter))
+      (with-current-buffer buffer
+        (goto-char (point-min))
+        (re-search-forward vc-cvs-annotate-first-line-re)
+        (delete-region (point-min) (1- (point)))))))
 
 (defun vc-cvs-annotate-current-time ()
   "Return the current time, based at midnight of the current day, and
@@ -711,11 +694,11 @@ If UPDATE is non-nil, then update (resynch) any affected buffers."
 ;;; Internal functions
 ;;;
 
-(defun vc-cvs-command (buffer okstatus file &rest flags)
+(defun vc-cvs-command (buffer okstatus files &rest flags)
   "A wrapper around `vc-do-command' for use in vc-cvs.el.
 The difference to vc-do-command is that this function always invokes `cvs',
 and that it passes `vc-cvs-global-switches' to it before FLAGS."
-  (apply 'vc-do-command buffer okstatus "cvs" file
+  (apply 'vc-do-command buffer okstatus "cvs" files
          (if (stringp vc-cvs-global-switches)
              (cons vc-cvs-global-switches flags)
            (append vc-cvs-global-switches
@@ -988,5 +971,5 @@ is non-nil."
 
 (provide 'vc-cvs)
 
-;;; arch-tag: 60e1402a-aa53-4607-927a-cf74f144b432
+;; arch-tag: 60e1402a-aa53-4607-927a-cf74f144b432
 ;;; vc-cvs.el ends here
index 8dd6562..156b286 100644 (file)
@@ -87,7 +87,7 @@
 ;; - comment-history (file)                       ??
 ;; - update-changelog (files)                     COULD BE SUPPORTED
 ;; * diff (file &optional rev1 rev2 buffer)       OK
-;; - revision-completion-table (file)             NOT SUPPORTED in emacs-22.x
+;; - revision-completion-table (file)             NEEDED?
 ;; - diff-tree (dir &optional rev1 rev2)          OK
 ;; - annotate-command (file buf &optional rev)    OK
 ;; - annotate-time ()                             OK
index a7c10ee..1415f8d 100644 (file)
@@ -38,6 +38,9 @@
 ;; beginning of vc.el. The current status is:
 
 ;; FUNCTION NAME                               STATUS
+;; BACKEND PROPERTIES
+;; * revision-granularity                      OK
+;; STATE-QUERYING FUNCTIONS
 ;; * registered (file)                         OK
 ;; * state (file)                              OK
 ;; - state-heuristic (file)                    ?? PROBABLY NOT NEEDED
 ;; - mode-line-string (file)                   NOT NEEDED
 ;; - dired-state-info (file)                   OK
 ;; STATE-CHANGING FUNCTIONS
-;; * register (file &optional rev comment)     OK
+;; * register (files &optional rev comment)    OK
+;; * create-repo ()                            OK
 ;; - init-version ()                           NOT NEEDED
 ;; - responsible-p (file)                      OK
 ;; - could-register (file)                     OK
 ;; - receive-file (file rev)                   ?? PROBABLY NOT NEEDED
 ;; - unregister (file)                         COMMENTED OUT, MAY BE INCORRECT
-;; * checkin (file rev comment)                OK
+;; * checkin (files rev comment)               OK
 ;; * find-version (file rev buffer)            OK
 ;; * checkout (file &optional editable rev)    OK
 ;; * revert (file &optional contents-done)     OK
-;; - cancel-version (file editable)            ?? PROBABLY NOT NEEDED   
+;; - rollback (files)                          ?? PROBABLY NOT NEEDED   
 ;; - merge (file rev1 rev2)                    NEEDED
 ;; - merge-news (file)                         NEEDED
 ;; - steal-lock (file &optional version)       NOT NEEDED
 ;; HISTORY FUNCTIONS
-;; * print-log (file &optional buffer)         OK
+;; * print-log (files &optional buffer)        OK
 ;; - log-view-mode ()                          OK
 ;; - show-log-entry (version)                  NOT NEEDED, DEFAULT IS GOOD
 ;; - wash-log (file)                           ??
 ;; - logentry-check ()                         NOT NEEDED
 ;; - comment-history (file)                    NOT NEEDED
 ;; - update-changelog (files)                  NOT NEEDED
-;; * diff (file &optional rev1 rev2 buffer)    OK
+;; * diff (files &optional rev1 rev2 buffer)   OK
 ;; - revision-completion-table (file)          COMMENTED OUT AS A WORKAROUND FOR A BUG
 ;; - diff-tree (dir &optional rev1 rev2)       TEST IT
 ;; - annotate-command (file buf &optional rev) OK
   :version "22.2"
   :group 'vc)
 
+\f
+;;; Properties of the backend
+
+(defun vc-hg-revision-granularity ()
+     'repository)
+
 ;;; State querying functions
 
 ;;;###autoload (defun vc-hg-registered (file)
 
 ;;; History functions
 
-(defun vc-hg-print-log(file &optional buffer)
-  "Get change log associated with FILE."
+(defun vc-hg-print-log(files &optional buffer)
+  "Get change log associated with FILES."
   ;; `log-view-mode' needs to have the file name in order to function
   ;; correctly. "hg log" does not print it, so we insert it here by
   ;; hand.
   ;; If the buffer exists from a previous invocation it might be
   ;; read-only.
   (let ((inhibit-read-only t))
-    (with-current-buffer
-       buffer
-      (insert "File:        " (file-name-nondirectory file) "\n")))
-  (vc-hg-command
-   buffer
-   (if (and (vc-stay-local-p file) (fboundp 'start-process)) 'async 0)
-   file "log"))
+    ;; We need to loop and call "hg log" on each file separately. 
+    ;; "hg log" with multiple file arguments mashes all the logs
+    ;; together.
+    (dolist (file files)
+      (with-current-buffer
+         buffer
+       (insert "File:        " (file-name-nondirectory file) "\n"))
+      (vc-hg-command buffer 0 file "log"))))
 
 (defvar log-view-message-re)
 (defvar log-view-file-re)
          ("^date: \\(.+\\)" (1 'change-log-date))
          ("^summary:[ \t]+\\(.+\\)" (1 'log-view-message))))))
 
-(defun vc-hg-diff (file &optional oldvers newvers buffer)
-  "Get a difference report using hg between two versions of FILE."
-  (let ((working (vc-workfile-version file)))
+(defun vc-hg-diff (files &optional oldvers newvers buffer)
+  "Get a difference report using hg between two versions of FILES."
+  (let ((working (vc-workfile-version (car files))))
     (if (and (equal oldvers working) (not newvers))
        (setq oldvers nil))
     (if (and (not oldvers) newvers)
        (setq oldvers working))
     (apply #'vc-hg-command (or buffer "*vc-diff*") nil
-          (file-name-nondirectory file)
-          "--cwd" (file-name-directory file) 
+          (mapcar (lambda (file) (file-name-nondirectory file)) files)
+          "--cwd" (file-name-directory (car files))
           "diff"
           (append
            (if oldvers
                  table (lambda () (vc-hg-revision-table file))))
     table))
 
-(defalias 'vc-hg-diff-tree 'vc-hg-diff)
+(defun vc-hg-diff-tree (file &optional oldvers newvers buffer)
+  (vc-hg-diff (list file) oldvers newvers buffer))
 
 (defun vc-hg-annotate-command (file buffer &optional version)
   "Execute \"hg annotate\" on FILE, inserting the contents in BUFFER.
@@ -358,11 +370,15 @@ Optional arg VERSION is a version to annotate from."
   "Rename file from OLD to NEW using `hg mv'."
   (vc-hg-command nil 0 new old "mv"))
 
-(defun vc-hg-register (file &optional rev comment)
-  "Register FILE under hg.
+(defun vc-hg-register (files &optional rev comment)
+  "Register FILES under hg.
 REV is ignored.
 COMMENT is ignored."
-  (vc-hg-command nil 0 file "add"))
+  (vc-hg-command nil 0 files "add"))
+
+(defun vc-hg-create-repo ()
+  "Create a new Mercurial repository."
+  (vc-hg-command nil 0 nil "init"))
 
 (defalias 'vc-hg-responsible-p 'vc-hg-root)
 
@@ -382,10 +398,10 @@ COMMENT is ignored."
 ;;   "Unregister FILE from hg."
 ;;   (vc-hg-command nil nil file "remove"))
 
-(defun vc-hg-checkin (file rev comment)
+(defun vc-hg-checkin (files rev comment)
   "Hg-specific version of `vc-backend-checkin'.
 REV is ignored."
-  (vc-hg-command nil 0 file  "commit" "-m" comment))
+  (vc-hg-command nil 0 files  "commit" "-m" comment))
 
 (defun vc-hg-find-version (file rev buffer)
   (let ((coding-system-for-read 'binary)
@@ -429,11 +445,11 @@ REV is the revision to check out into WORKFILE."
 
 ;;; Internal functions
 
-(defun vc-hg-command (buffer okstatus file &rest flags)
+(defun vc-hg-command (buffer okstatus file-or-list &rest flags)
   "A wrapper around `vc-do-command' for use in vc-hg.el.
 The difference to vc-do-command is that this function always invokes `hg',
 and that it passes `vc-hg-global-switches' to it before FLAGS."
-  (apply 'vc-do-command buffer okstatus "hg" file
+  (apply 'vc-do-command buffer okstatus "hg" file-or-list
          (if (stringp vc-hg-global-switches)
              (cons vc-hg-global-switches flags)
            (append vc-hg-global-switches
index 0356e10..aa12145 100644 (file)
@@ -65,33 +65,33 @@ interpreted as hostnames."
 (defcustom vc-handled-backends '(RCS CVS SVN SCCS Bzr Git Hg Arch MCVS)
   ;; Bzr, Git, Hg, Arch and MCVS come last because they are per-tree
   ;; rather than per-dir.
-  "*List of version control backends for which VC will be used.
+  "List of version control backends for which VC will be used.
 Entries in this list will be tried in order to determine whether a
 file is under that sort of version control.
 Removing an entry from the list prevents VC from being activated
 when visiting a file managed by that backend.
 An empty list disables VC altogether."
   :type '(repeat symbol)
-  :version "22.2"
+  :version "23.1"
   :group 'vc)
 
 (defcustom vc-path
   (if (file-directory-p "/usr/sccs")
       '("/usr/sccs")
     nil)
-  "*List of extra directories to search for version control commands."
+  "List of extra directories to search for version control commands."
   :type '(repeat directory)
   :group 'vc)
 
 (defcustom vc-make-backup-files nil
-  "*If non-nil, backups of registered files are made as with other files.
+  "If non-nil, backups of registered files are made as with other files.
 If nil (the default), files covered by version control don't get backups."
   :type 'boolean
   :group 'vc
   :group 'backup)
 
 (defcustom vc-follow-symlinks 'ask
-  "*What to do if visiting a symbolic link to a file under version control.
+  "What to do if visiting a symbolic link to a file under version control.
 Editing such a file through the link bypasses the version control system,
 which is dangerous and probably not what you want.
 
@@ -105,26 +105,26 @@ visited and a warning displayed."
   :group 'vc)
 
 (defcustom vc-display-status t
-  "*If non-nil, display revision number and lock status in modeline.
+  "If non-nil, display revision number and lock status in modeline.
 Otherwise, not displayed."
   :type 'boolean
   :group 'vc)
 
 
 (defcustom vc-consult-headers t
-  "*If non-nil, identify work files by searching for version headers."
+  "If non-nil, identify work files by searching for version headers."
   :type 'boolean
   :group 'vc)
 
 (defcustom vc-keep-workfiles t
-  "*If non-nil, don't delete working files after registering changes.
+  "If non-nil, don't delete working files after registering changes.
 If the back-end is CVS, workfiles are always kept, regardless of the
 value of this flag."
   :type 'boolean
   :group 'vc)
 
 (defcustom vc-mistrust-permissions nil
-  "*If non-nil, don't assume permissions/ownership track version-control status.
+  "If non-nil, don't assume permissions/ownership track version-control status.
 If nil, do rely on the permissions.
 See also variable `vc-consult-headers'."
   :type 'boolean
@@ -138,7 +138,7 @@ See also variable `vc-consult-headers'."
                    (vc-backend-subdirectory-name file)))))
 
 (defcustom vc-stay-local t
-  "*Non-nil means use local operations when possible for remote repositories.
+  "Non-nil means use local operations when possible for remote repositories.
 This avoids slow queries over the network and instead uses heuristics
 and past information to determine the current status of a file.
 
@@ -159,32 +159,36 @@ by these regular expressions."
 
 (defun vc-stay-local-p (file)
   "Return non-nil if VC should stay local when handling FILE.
-This uses the `repository-hostname' backend operation."
-  (let* ((backend (vc-backend file))
-        (sym (vc-make-backend-sym backend 'stay-local))
-        (stay-local (if (boundp sym) (symbol-value sym) t)))
-    (if (eq stay-local t) (setq stay-local vc-stay-local))
-    (if (symbolp stay-local) stay-local
-      (let ((dirname (if (file-directory-p file)
-                        (directory-file-name file)
-                      (file-name-directory file))))
-       (eq 'yes
-           (or (vc-file-getprop dirname 'vc-stay-local-p)
-               (vc-file-setprop
-                dirname 'vc-stay-local-p
-                (let ((hostname (vc-call-backend
-                                 backend 'repository-hostname dirname)))
-                  (if (not hostname)
-                      'no
-                    (let ((default t))
-                      (if (eq (car-safe stay-local) 'except)
-                          (setq default nil stay-local (cdr stay-local)))
-                      (when (consp stay-local)
-                        (setq stay-local
-                              (mapconcat 'identity stay-local "\\|")))
-                      (if (if (string-match stay-local hostname)
-                              default (not default))
-                          'yes 'no)))))))))))
+This uses the `repository-hostname' backend operation.
+If FILE is a list of files, return non-nil if any of them
+individually should stay local."
+  (if (listp file)
+      (delq nil (mapcar 'vc-stay-local-p file))
+    (let* ((backend (vc-backend file))
+          (sym (vc-make-backend-sym backend 'stay-local))
+          (stay-local (if (boundp sym) (symbol-value sym) t)))
+      (if (eq stay-local t) (setq stay-local vc-stay-local))
+      (if (symbolp stay-local) stay-local
+       (let ((dirname (if (file-directory-p file)
+                          (directory-file-name file)
+                        (file-name-directory file))))
+         (eq 'yes
+             (or (vc-file-getprop dirname 'vc-stay-local-p)
+                 (vc-file-setprop
+                  dirname 'vc-stay-local-p
+                  (let ((hostname (vc-call-backend
+                                   backend 'repository-hostname dirname)))
+                    (if (not hostname)
+                        'no
+                      (let ((default t))
+                        (if (eq (car-safe stay-local) 'except)
+                            (setq default nil stay-local (cdr stay-local)))
+                        (when (consp stay-local)
+                          (setq stay-local
+                                (mapconcat 'identity stay-local "\\|")))
+                        (if (if (string-match stay-local hostname)
+                                default (not default))
+                            'yes 'no))))))))))))
 
 ;;; This is handled specially now.
 ;; Tell Emacs about this new kind of minor mode
@@ -275,7 +279,10 @@ It is usually called via the `vc-call' macro."
      (t                (apply f args)))))
 
 (defmacro vc-call (fun file &rest args)
-  ;; BEWARE!! `file' is evaluated twice!!
+  "A convenience macro for calling VC backend functions.
+Functions called by this macro must accept FILE as the first argument.
+ARGS specifies any additional arguments. FUN should be unquoted.
+BEWARE!! `file' is evaluated twice!!"
   `(vc-call-backend (vc-backend ,file) ',fun ,file ,@args))
 \f
 (defsubst vc-parse-buffer (pattern i)
@@ -376,20 +383,26 @@ backend is tried first."
         (vc-file-setprop file 'vc-backend 'none)
         nil)))))
 
-(defun vc-backend (file)
-  "Return the version control type of FILE, nil if it is not registered."
+(defun vc-backend (file-or-list)
+  "Return the version control type of FILE-OR-LIST, nil if it's not registered.
+If the argument is a list, the files must all have the same back end."
   ;; `file' can be nil in several places (typically due to the use of
   ;; code like (vc-backend buffer-file-name)).
-  (when (stringp file)
-    (let ((property (vc-file-getprop file 'vc-backend)))
-      ;; Note that internally, Emacs remembers unregistered
-      ;; files by setting the property to `none'.
-      (cond ((eq property 'none) nil)
-           (property)
-           ;; vc-registered sets the vc-backend property
-           (t (if (vc-registered file)
-                  (vc-file-getprop file 'vc-backend)
-                nil))))))
+  (cond ((stringp file-or-list)
+        (let ((property (vc-file-getprop file-or-list 'vc-backend)))
+          ;; Note that internally, Emacs remembers unregistered
+          ;; files by setting the property to `none'.
+          (cond ((eq property 'none) nil)
+                (property)
+                ;; vc-registered sets the vc-backend property
+                (t (if (vc-registered file-or-list)
+                       (vc-file-getprop file-or-list 'vc-backend)
+                     nil)))))
+       ((and file-or-list (listp file-or-list))
+        (vc-backend (car file-or-list)))
+       (t
+        nil)))
+
 
 (defun vc-backend-subdirectory-name (file)
   "Return where the master and lock FILEs for the current directory are kept."
@@ -483,7 +496,7 @@ For registered files, the value returned is one of:
   ;; - `removed'
   ;; - `copied' and `moved' (might be handled by `removed' and `added')
   (or (vc-file-getprop file 'vc-state)
-      (if (vc-backend file)
+      (if (and (> (length file) 0) (vc-backend file))
           (vc-file-setprop file 'vc-state
                            (vc-call state-heuristic file)))))
 
@@ -521,7 +534,7 @@ Return non-nil if FILE is unchanged."
   (zerop (condition-case err
              ;; If the implementation supports it, let the output
              ;; go to *vc*, not *vc-diff*, since this is an internal call.
-             (vc-call diff file nil nil "*vc*")
+             (vc-call diff (list file) nil nil "*vc*")
            (wrong-number-of-arguments
             ;; If this error came from the above call to vc-BACKEND-diff,
             ;; try again without the optional buffer argument (for
@@ -532,10 +545,10 @@ Return non-nil if FILE is unchanged."
                                                         'diff))))
                     (not (eq (caddr err) 4)))
                 (signal (car err) (cdr err))
-              (vc-call diff file))))))
+              (vc-call diff (list file)))))))
 
 (defun vc-workfile-version (file)
-  "Return the version level of the current workfile FILE.
+  "Return the repository version from which FILE was checked out.
 If FILE is not registered, this function always returns nil."
   (or (vc-file-getprop file 'vc-workfile-version)
       (if (vc-backend file)
@@ -706,6 +719,11 @@ Before doing that, check if there are any old backups and get rid of them."
             ;; any VC Dired buffer to synchronize.
             (vc-dired-resynch-file file)))))
 
+(defconst vc-mode-line-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map [mode-line down-mouse-1] 'vc-menu-map)
+    map))
+
 (defun vc-mode-line (file)
   "Set `vc-mode' to display type of version control for FILE.
 The value is set in the current buffer, which should be the buffer
@@ -714,9 +732,22 @@ visiting FILE."
   (let ((backend (vc-backend file)))
     (if (not backend)
        (setq vc-mode nil)
-      (setq vc-mode (concat " " (if vc-display-status
-                                   (vc-call mode-line-string file)
-                                 (symbol-name backend))))
+      (let* ((ml-string (vc-call mode-line-string file))
+             (ml-echo (get-text-property 0 'help-echo ml-string)))
+        (setq vc-mode
+              (concat
+               " "
+               (if (null vc-display-status)
+                   (symbol-name backend)
+                 (propertize
+                  ml-string
+                  'mouse-face 'mode-line-highlight
+                  'help-echo 
+                  (concat (or ml-echo
+                              (format "File under the %s version control system"
+                                      backend))
+                          "\nmouse-1: Version Control menu")
+                  'local-map vc-mode-line-map)))))
       ;; If the file is locked by some other user, make
       ;; the buffer read-only.  Like this, even root
       ;; cannot modify a file that someone else has locked.
@@ -746,17 +777,24 @@ Format:
 This function assumes that the file is registered."
   (setq backend (symbol-name backend))
   (let ((state   (vc-state file))
+       (state-echo nil)
        (rev     (vc-workfile-version file)))
-    (cond ((or (eq state 'up-to-date)
-              (eq state 'needs-patch))
-          (concat backend "-" rev))
-          ((stringp state)
-          (concat backend ":" state ":" rev))
-          (t
-           ;; Not just for the 'edited state, but also a fallback
-           ;; for all other states.  Think about different symbols
-           ;; for 'needs-patch and 'needs-merge.
-           (concat backend ":" rev)))))
+    (propertize
+     (cond ((or (eq state 'up-to-date)
+               (eq state 'needs-patch))
+           (setq state-echo "Up to date file")
+           (concat backend "-" rev))
+          ((stringp state)
+           (setq state-echo (concat "File locked by" state))
+           (concat backend ":" state ":" rev))
+          (t
+           ;; Not just for the 'edited state, but also a fallback
+           ;; for all other states.  Think about different symbols
+           ;; for 'needs-patch and 'needs-merge.
+           (setq state-echo "Locally modified file")
+           (concat backend ":" rev)))
+     'help-echo (concat state-echo " under the " backend
+                       " version control system"))))
 
 (defun vc-follow-link ()
   "If current buffer visits a symbolic link, visit the real file.
@@ -787,7 +825,7 @@ current, and kill the buffer that visits the link."
   (when buffer-file-name
     (vc-file-clearprops buffer-file-name)
     (cond
-     ((ignore-errors (vc-backend buffer-file-name))
+     ((with-demoted-errors (vc-backend buffer-file-name))
       ;; Compute the state and put it in the modeline.
       (vc-mode-line buffer-file-name)
       (unless vc-make-backup-files
@@ -862,7 +900,7 @@ Used in `find-file-not-found-functions'."
   (let ((map (make-sparse-keymap)))
     (define-key map "a" 'vc-update-change-log)
     (define-key map "b" 'vc-switch-backend)
-    (define-key map "c" 'vc-cancel-version)
+    (define-key map "c" 'vc-rollback)
     (define-key map "d" 'vc-directory)
     (define-key map "g" 'vc-annotate)
     (define-key map "h" 'vc-insert-headers)
@@ -871,8 +909,9 @@ Used in `find-file-not-found-functions'."
     (define-key map "m" 'vc-merge)
     (define-key map "r" 'vc-retrieve-snapshot)
     (define-key map "s" 'vc-create-snapshot)
-    (define-key map "u" 'vc-revert-buffer)
+    (define-key map "u" 'vc-revert)
     (define-key map "v" 'vc-next-action)
+    (define-key map "+" 'vc-update)
     (define-key map "=" 'vc-diff)
     (define-key map "~" 'vc-version-other-window)
     map))
@@ -902,14 +941,17 @@ Used in `find-file-not-found-functions'."
   (define-key vc-menu-map [separator2] '("----"))
   (define-key vc-menu-map [vc-insert-header]
     '("Insert Header" . vc-insert-headers))
-  (define-key vc-menu-map [undo] '("Undo Last Check-In" . vc-cancel-version))
-  (define-key vc-menu-map [vc-revert-buffer]
-    '("Revert to Base Version" . vc-revert-buffer))
+  (define-key vc-menu-map [undo] '("Undo Last Check-In" . vc-rollback))
+  (define-key vc-menu-map [vc-revert]
+    '("Revert to Base Version" . vc-revert))
   (define-key vc-menu-map [vc-update]
     '("Update to Latest Version" . vc-update))
   (define-key vc-menu-map [vc-next-action] '("Check In/Out" . vc-next-action))
   (define-key vc-menu-map [vc-register] '("Register" . vc-register)))
 
+(defun vc-default-extra-menu (backend)
+  nil)
+
 ;; These are not correct and it's not currently clear how doing it
 ;; better (with more complicated expressions) might slow things down
 ;; on older systems.
@@ -921,8 +963,8 @@ Used in `find-file-not-found-functions'."
 ;;(put 'vc-update-change-log 'menu-enable
 ;;     '(member (vc-buffer-backend) '(RCS CVS)))
 ;;(put 'vc-print-log 'menu-enable 'vc-mode)
-;;(put 'vc-cancel-version 'menu-enable 'vc-mode)
-;;(put 'vc-revert-buffer 'menu-enable 'vc-mode)
+;;(put 'vc-rollback 'menu-enable 'vc-mode)
+;;(put 'vc-revert 'menu-enable 'vc-mode)
 ;;(put 'vc-insert-headers 'menu-enable 'vc-mode)
 ;;(put 'vc-next-action 'menu-enable 'vc-mode)
 ;;(put 'vc-register 'menu-enable '(and buffer-file-name (not vc-mode)))
index 0007aa4..766daf3 100644 (file)
@@ -109,6 +109,11 @@ This is only meaningful if you don't use the implicit checkout model
   :version "22.1"
   :group 'vc)
 
+;;; Properties of the backend
+
+(defun vc-mcvs-revision-granularity ()
+     'file)
+
 ;;;
 ;;; State-querying functions
 ;;;
@@ -202,13 +207,16 @@ This is only meaningful if you don't use the implicit checkout model
 ;;; State-changing functions
 ;;;
 
-(defun vc-mcvs-register (file &optional rev comment)
-  "Register FILE into the Meta-CVS version-control system.
+(defun vc-mcvs-register (files &optional rev comment)
+  "Register FILES into the Meta-CVS version-control system.
 COMMENT can be used to provide an initial description of FILE.
 
 `vc-register-switches' and `vc-mcvs-register-switches' are passed to
 the Meta-CVS command (in that order)."
-  (let* ((filename (file-name-nondirectory file))
+  ;; FIXME: multiple-file case should be made to work
+  (if (> (length files) 1) (error "Registering filesets is not yet supported."))
+  (let* ((file (car files)) 
+        (filename (file-name-nondirectory file))
         (extpos (string-match "\\." filename))
         (ext (if extpos (substring filename (1+ extpos))))
         (root (vc-mcvs-root file))
@@ -257,7 +265,7 @@ the Meta-CVS command (in that order)."
   "Return non-nil if FILE could be registered in Meta-CVS.
 This is only possible if Meta-CVS is responsible for FILE's directory.")
 
-(defun vc-mcvs-checkin (file rev comment)
+(defun vc-mcvs-checkin (files rev comment)
   "Meta-CVS-specific version of `vc-backend-checkin'."
   (unless (or (not rev) (vc-mcvs-valid-version-number-p rev))
     (if (not (vc-mcvs-valid-symbolic-tag-name-p rev))
@@ -267,14 +275,15 @@ This is only possible if Meta-CVS is responsible for FILE's directory.")
       ;; This file-specific form of branching is deprecated.
       ;; We can't use `mcvs branch' and `mcvs switch' because they cannot
       ;; be applied just to this one file.
-      (apply 'vc-mcvs-command nil 0 file "tag" "-b" (list rev))
-      (apply 'vc-mcvs-command nil 0 file "update" "-r" (list rev))
-      (vc-file-setprop file 'vc-mcvs-sticky-tag rev)
+      (apply 'vc-mcvs-command nil 0 files "tag" "-b" (list rev))
+      (apply 'vc-mcvs-command nil 0 files "update" "-r" (list rev))
+      (mapcar (lambda (file) (vc-file-setprop file 'vc-mcvs-sticky-tag rev))
+             files)
       (setq rev nil)))
   ;; This commit might cvs-commit several files (e.g. MAP and TYPES)
   ;; so using numbered revs here is dangerous and somewhat meaningless.
   (when rev (error "Cannot commit to a specific revision number"))
-  (let ((status (apply 'vc-mcvs-command nil 1 file
+  (let ((status (apply 'vc-mcvs-command nil 1 files
                       "ci" "-m" comment
                       (vc-switches 'MCVS 'checkin))))
     (set-buffer "*vc*")
@@ -283,7 +292,8 @@ This is only possible if Meta-CVS is responsible for FILE's directory.")
       ;; Check checkin problem.
       (cond
        ((re-search-forward "Up-to-date check failed" nil t)
-        (vc-file-setprop file 'vc-state 'needs-merge)
+       (mapcar (lambda (file) (vc-file-setprop file 'vc-state 'needs-merge))
+             files)
         (error (substitute-command-keys
                 (concat "Up-to-date check failed: "
                         "type \\[vc-next-action] to merge in changes"))))
@@ -292,20 +302,25 @@ This is only possible if Meta-CVS is responsible for FILE's directory.")
         (goto-char (point-min))
         (shrink-window-if-larger-than-buffer)
         (error "Check-in failed"))))
-    ;; Update file properties
-    (vc-file-setprop
-     file 'vc-workfile-version
-     (vc-parse-buffer "^\\(new\\|initial\\) revision: \\([0-9.]+\\)" 2))
-    ;; Forget the checkout model of the file, because we might have
+    ;; Single-file commit?  Then update the version by parsing the buffer.
+    ;; Otherwise we can't necessarily tell what goes with what; clear
+    ;; its properties so they have to be refetched.
+    (if (= (length files) 1)
+       (vc-file-setprop
+        (car files) 'vc-workfile-version
+        (vc-parse-buffer "^\\(new\\|initial\\) revision: \\([0-9.]+\\)" 2))
+      (mapc (lambda (file) (vc-file-clearprops file)) files))
+    ;; Anyway, forget the checkout model of the file, because we might have
     ;; guessed wrong when we found the file.  After commit, we can
     ;; tell it from the permissions of the file (see
     ;; vc-mcvs-checkout-model).
-    (vc-file-setprop file 'vc-checkout-model nil)
+    (mapc (lambda (file) (vc-file-setprop file 'vc-checkout-model nil))
+           files)
 
     ;; if this was an explicit check-in (does not include creation of
     ;; a branch), remove the sticky tag.
     (if (and rev (not (vc-mcvs-valid-symbolic-tag-name-p rev)))
-       (vc-mcvs-command nil 0 file "update" "-A"))))
+       (vc-mcvs-command nil 0 files "update" "-A"))))
 
 (defun vc-mcvs-find-version (file rev buffer)
   (apply 'vc-mcvs-command
@@ -421,44 +436,32 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
 ;;; History functions
 ;;;
 
-(defun vc-mcvs-print-log (file &optional buffer)
-  "Get change log associated with FILE."
-  (let ((default-directory (vc-mcvs-root file)))
+(defun vc-mcvs-print-log (files &optional buffer)
+  "Get change log associated with FILES."
+  (let ((default-directory (vc-mcvs-root (car files))))
     ;; Run the command from the root dir so that `mcvs filt' returns
     ;; valid relative names.
     (vc-mcvs-command
      buffer
-     (if (and (vc-stay-local-p file) (fboundp 'start-process)) 'async 0)
-     file "log")))
-
-(defun vc-mcvs-diff (file &optional oldvers newvers buffer)
-  "Get a difference report using Meta-CVS between two versions of FILE."
-  (if (string= (vc-workfile-version file) "0")
-      ;; This file is added but not yet committed; there is no master file.
-      (if (or oldvers newvers)
-         (error "No revisions of %s exist" file)
-       ;; We regard this as "changed".
-       ;; Diff it against /dev/null.
-       ;; Note: this is NOT a "mcvs diff".
-       (apply 'vc-do-command (or buffer "*vc-diff*")
-              1 "diff" file
-              (append (vc-switches nil 'diff) '("/dev/null")))
-       ;; Even if it's empty, it's locally modified.
-       1)
+     (if (and (vc-stay-local-p files) (fboundp 'start-process)) 'async 0)
+     files "log")))
+
+(defun vc-mcvs-diff (files &optional oldvers newvers buffer)
+  "Get a difference report using Meta-CVS between two versions of FILES."
     (let* ((async (and (not vc-disable-async-diff)
-                       (vc-stay-local-p file)
+                       (vc-stay-local-p files)
                        (fboundp 'start-process)))
           ;; Run the command from the root dir so that `mcvs filt' returns
           ;; valid relative names.
-          (default-directory (vc-mcvs-root file))
+          (default-directory (vc-mcvs-root (car files)))
           (status
            (apply 'vc-mcvs-command (or buffer "*vc-diff*")
                   (if async 'async 1)
-                  file "diff"
+                  files "diff"
                   (and oldvers (concat "-r" oldvers))
                   (and newvers (concat "-r" newvers))
                   (vc-switches 'MCVS 'diff))))
-      (if async 1 status))))          ; async diff, pessimistic assumption.
+      (if async 1 status)))           ; async diff, pessimistic assumption.
 
 (defun vc-mcvs-diff-tree (dir &optional rev1 rev2)
   "Diff all files at and below DIR."
index b341f82..1cda884 100644 (file)
 
 ;; See vc.el
 
+;; TODO:
+;; - remove call to vc-expand-dirs by implementing our own (which can just
+;;   list the RCS subdir instead).
+
 ;;; Code:
 
 ;;;
@@ -96,6 +100,11 @@ For a description of possible values, see `vc-check-master-templates'."
   :group 'vc)
 
 \f
+;;; Properties of the backend
+
+(defun vc-rcs-revision-granularity ()
+     'file)
+
 ;;;
 ;;; State-querying functions
 ;;;
@@ -238,17 +247,23 @@ When VERSION is given, perform check for that version."
 ;;; State-changing functions
 ;;;
 
-(defun vc-rcs-register (file &optional rev comment)
-  "Register FILE into the RCS version-control system.
-REV is the optional revision number for the file.  COMMENT can be used
-to provide an initial description of FILE.
+(defun vc-rcs-create-repo ()
+  "Create a new RCS repository."
+  ;; RCS is totally file-oriented, so all we have to do is make the directory
+  (make-directory "RCS"))
+
+(defun vc-rcs-register (files &optional rev comment)
+  "Register FILES into the RCS version-control system.
+REV is the optional revision number for the files.  COMMENT can be used
+to provide an initial description for each FILES.
 
 `vc-register-switches' and `vc-rcs-register-switches' are passed to
 the RCS command (in that order).
 
 Automatically retrieve a read-only version of the file with keywords
 expanded if `vc-keep-workfiles' is non-nil, otherwise, delete the workfile."
-    (let ((subdir (expand-file-name "RCS" (file-name-directory file))))
+  (let ((subdir (expand-file-name "RCS" (file-name-directory file))))
+    (dolist (file files)
       (and (not (file-exists-p subdir))
           (not (directory-files (file-name-directory file)
                                 nil ".*,v$" t))
@@ -281,7 +296,7 @@ expanded if `vc-keep-workfiles' is non-nil, otherwise, delete the workfile."
                          (if (re-search-forward
                               "^initial revision: \\([0-9.]+\\).*\n"
                               nil t)
-                             (match-string 1))))))
+                             (match-string 1)))))))
 
 (defun vc-rcs-responsible-p (file)
   "Return non-nil if RCS thinks it would be responsible for registering FILE."
@@ -315,55 +330,57 @@ whether to remove it."
         (yes-or-no-p (format "Directory %s is empty; remove it? " dir))
         (delete-directory dir))))
 
-(defun vc-rcs-checkin (file rev comment)
+(defun vc-rcs-checkin (files rev comment)
   "RCS-specific version of `vc-backend-checkin'."
   (let ((switches (vc-switches 'RCS 'checkin)))
-    (let ((old-version (vc-workfile-version file)) new-version
-         (default-branch (vc-file-getprop file 'vc-rcs-default-branch)))
-      ;; Force branch creation if an appropriate
-      ;; default branch has been set.
-      (and (not rev)
-          default-branch
-          (string-match (concat "^" (regexp-quote old-version) "\\.")
-                        default-branch)
-          (setq rev default-branch)
-          (setq switches (cons "-f" switches)))
-      (if (and (not rev) old-version)
-          (setq rev (vc-branch-part old-version)))
-      (apply 'vc-do-command nil 0 "ci" (vc-name file)
-            ;; if available, use the secure check-in option
-            (and (vc-rcs-release-p "5.6.4") "-j")
-            (concat (if vc-keep-workfiles "-u" "-r") rev)
-            (concat "-m" comment)
-            switches)
-      (vc-file-setprop file 'vc-workfile-version nil)
-
-      ;; determine the new workfile version
-      (set-buffer "*vc*")
-      (goto-char (point-min))
-      (when (or (re-search-forward
-                "new revision: \\([0-9.]+\\);" nil t)
-               (re-search-forward
-                "reverting to previous revision \\([0-9.]+\\)" nil t))
-       (setq new-version (match-string 1))
-       (vc-file-setprop file 'vc-workfile-version new-version))
-
-      ;; if we got to a different branch, adjust the default
-      ;; branch accordingly
-      (cond
-       ((and old-version new-version
-            (not (string= (vc-branch-part old-version)
-                          (vc-branch-part new-version))))
-       (vc-rcs-set-default-branch file
-                                  (if (vc-trunk-p new-version) nil
-                                    (vc-branch-part new-version)))
-       ;; If this is an old RCS release, we might have
-       ;; to remove a remaining lock.
-       (if (not (vc-rcs-release-p "5.6.2"))
-           ;; exit status of 1 is also accepted.
-           ;; It means that the lock was removed before.
-           (vc-do-command nil 1 "rcs" (vc-name file)
-                          (concat "-u" old-version))))))))
+    ;; Now operate on the files
+    (dolist (file files)
+      (let ((old-version (vc-workfile-version file)) new-version
+           (default-branch (vc-file-getprop file 'vc-rcs-default-branch)))
+       ;; Force branch creation if an appropriate
+       ;; default branch has been set.
+       (and (not rev)
+            default-branch
+            (string-match (concat "^" (regexp-quote old-version) "\\.")
+                          default-branch)
+            (setq rev default-branch)
+            (setq switches (cons "-f" switches)))
+       (if (and (not rev) old-version)
+           (setq rev (vc-branch-part old-version)))
+       (apply 'vc-do-command nil 0 "ci" (vc-name file)
+              ;; if available, use the secure check-in option
+              (and (vc-rcs-release-p "5.6.4") "-j")
+              (concat (if vc-keep-workfiles "-u" "-r") rev)
+              (concat "-m" comment)
+              switches)
+       (vc-file-setprop file 'vc-workfile-version nil)
+
+       ;; determine the new workfile version
+       (set-buffer "*vc*")
+       (goto-char (point-min))
+       (when (or (re-search-forward
+                  "new revision: \\([0-9.]+\\);" nil t)
+                 (re-search-forward
+                  "reverting to previous revision \\([0-9.]+\\)" nil t))
+         (setq new-version (match-string 1))
+         (vc-file-setprop file 'vc-workfile-version new-version))
+
+       ;; if we got to a different branch, adjust the default
+       ;; branch accordingly
+       (cond
+        ((and old-version new-version
+              (not (string= (vc-branch-part old-version)
+                            (vc-branch-part new-version))))
+         (vc-rcs-set-default-branch file
+                                    (if (vc-trunk-p new-version) nil
+                                      (vc-branch-part new-version)))
+         ;; If this is an old RCS release, we might have
+         ;; to remove a remaining lock.
+         (if (not (vc-rcs-release-p "5.6.2"))
+             ;; exit status of 1 is also accepted.
+             ;; It means that the lock was removed before.
+             (vc-do-command nil 1 "rcs" (vc-name file)
+                            (concat "-u" old-version)))))))))
 
 (defun vc-rcs-find-version (file rev buffer)
   (apply 'vc-do-command
@@ -435,41 +452,48 @@ whether to remove it."
                    new-version)))))
        (message "Checking out %s...done" file)))))
 
+(defun vc-rcs-rollback (files)
+  "Roll back, undoing the most recent checkins of FILES."
+  (if (not files)
+      (error "RCS backend doesn't support directory-level rollback."))
+  (dolist (file files)
+         (let* ((discard (vc-workfile-version file))
+                (previous (if (vc-trunk-p discard) "" (vc-branch-part discard)))
+                (config (current-window-configuration))
+                (done nil))
+           (if (null (yes-or-no-p (format "Remove version %s from %s history? " 
+                                          discard file)))
+               (error "Aborted"))
+           (message "Removing revision %s from %s." discard file)
+           (vc-do-command nil 0 "rcs" (vc-name file) (concat "-o" discard))
+           ;; Check out the most recent remaining version.  If it
+           ;; fails, because the whole branch got deleted, do a
+           ;; double-take and check out the version where the branch
+           ;; started.
+           (while (not done)
+             (condition-case err
+                 (progn
+                   (vc-do-command nil 0 "co" (vc-name file) "-f"
+                                  (concat "-u" previous))
+                   (setq done t))
+               (error (set-buffer "*vc*")
+                      (goto-char (point-min))
+                      (if (search-forward "no side branches present for" nil t)
+                          (progn (setq previous (vc-branch-part previous))
+                                 (vc-rcs-set-default-branch file previous)
+                                 ;; vc-do-command popped up a window with
+                                 ;; the error message.  Get rid of it, by
+                                 ;; restoring the old window configuration.
+                                 (set-window-configuration config))
+                        ;; No, it was some other error: re-signal it.
+                        (signal (car err) (cdr err)))))))))
+
 (defun vc-rcs-revert (file &optional contents-done)
   "Revert FILE to the version it was based on."
   (vc-do-command nil 0 "co" (vc-name file) "-f"
                  (concat (if (eq (vc-state file) 'edited) "-u" "-r")
                          (vc-workfile-version file))))
 
-(defun vc-rcs-cancel-version (file editable)
-  "Undo the most recent checkin of FILE.
-EDITABLE non-nil means previous version should be locked."
-  (let* ((target (vc-workfile-version file))
-        (previous (if (vc-trunk-p target) "" (vc-branch-part target)))
-        (config (current-window-configuration))
-        (done nil))
-    (vc-do-command nil 0 "rcs" (vc-name file) (concat "-o" target))
-    ;; Check out the most recent remaining version.  If it fails, because
-    ;; the whole branch got deleted, do a double-take and check out the
-    ;; version where the branch started.
-    (while (not done)
-      (condition-case err
-         (progn
-           (vc-do-command nil 0 "co" (vc-name file) "-f"
-                          (concat (if editable "-l" "-u") previous))
-           (setq done t))
-       (error (set-buffer "*vc*")
-              (goto-char (point-min))
-              (if (search-forward "no side branches present for" nil t)
-                  (progn (setq previous (vc-branch-part previous))
-                         (vc-rcs-set-default-branch file previous)
-                         ;; vc-do-command popped up a window with
-                         ;; the error message.  Get rid of it, by
-                         ;; restoring the old window configuration.
-                         (set-window-configuration config))
-                ;; No, it was some other error: re-signal it.
-                (signal (car err) (cdr err))))))))
-
 (defun vc-rcs-merge (file first-version &optional second-version)
   "Merge changes into current working copy of FILE.
 The changes are between FIRST-VERSION and SECOND-VERSION."
@@ -492,19 +516,38 @@ Needs RCS 5.6.2 or later for -M."
 ;;; History functions
 ;;;
 
-(defun vc-rcs-print-log (file &optional buffer)
+(defun vc-rcs-print-log (files &optional buffer)
   "Get change log associated with FILE."
-  (vc-do-command buffer 0 "rlog" (vc-name file)))
+  (vc-do-command buffer 0 "rlog" (mapcar 'vc-name files)))
 
-(defun vc-rcs-diff (file &optional oldvers newvers buffer)
-  "Get a difference report using RCS between two versions of FILE."
-  (if (not oldvers) (setq oldvers (vc-workfile-version file)))
-  (apply 'vc-do-command (or buffer "*vc-diff*") 1 "rcsdiff" file
+(defun vc-rcs-diff (files &optional oldvers newvers buffer)
+  "Get a difference report using RCS between two sets of files."
+  (apply 'vc-do-command (or buffer "*vc-diff*") 
+        1              ;; Always go synchronous, the repo is local
+        "rcsdiff" (vc-expand-dirs files)
          (append (list "-q"
-                       (concat "-r" oldvers)
+                       (and oldvers (concat "-r" oldvers))
                        (and newvers (concat "-r" newvers)))
                  (vc-switches 'RCS 'diff))))
 
+(defun vc-rcs-wash-log ()
+  "Remove all non-comment information from log output."
+  (let ((separator (concat "^-+\nrevision [0-9.]+\ndate: .*\n"
+                          "\\(branches: .*;\n\\)?"
+                          "\\(\\*\\*\\* empty log message \\*\\*\\*\n\\)?")))
+    (goto-char (point-max)) (forward-line -1)
+    (while (looking-at "=*\n")
+      (delete-char (- (match-end 0) (match-beginning 0)))
+      (forward-line -1))
+    (goto-char (point-min))
+    (if (looking-at "[\b\t\n\v\f\r ]+")
+       (delete-char (- (match-end 0) (match-beginning 0))))
+    (goto-char (point-min))
+    (re-search-forward separator nil t)
+    (delete-region (point-min) (point))
+    (while (re-search-forward separator nil t)
+      (delete-region (match-beginning 0) (match-end 0)))))
+
 (defun vc-rcs-annotate-command (file buffer &optional revision)
   "Annotate FILE, inserting the results in BUFFER.
 Optional arg REVISION is a revision to annotate from."
@@ -674,7 +717,6 @@ Optional arg REVISION is a revision to annotate from."
                              "  "
                              (aref rda 0)
                              ls)
-                      :vc-annotate-prefix t
                       :vc-rcs-r/d/a rda)))
         (maphash
          (if all-me
index f7a0f02..2389cb3 100644 (file)
 
 ;;; Commentary:
 
+;; TODO:
+;; - remove call to vc-expand-dirs by implementing our own (which can just
+;;   list the SCCS subdir instead).
+
 ;;; Code:
 
 (eval-when-compile
@@ -85,6 +89,11 @@ For a description of possible values, see `vc-check-master-templates'."
 (defconst vc-sccs-name-assoc-file "VC-names")
 
 \f
+;;; Properties of the backend
+
+(defun vc-sccs-revision-granularity ()
+     'file)
+
 ;;;
 ;;; State-querying functions
 ;;;
@@ -161,16 +170,22 @@ For a description of possible values, see `vc-check-master-templates'."
 ;;; State-changing functions
 ;;;
 
-(defun vc-sccs-register (file &optional rev comment)
-  "Register FILE into the SCCS version-control system.
+(defun vc-sccs-create-repo ()
+  "Create a new SCCS repository."
+  ;; SCCS is totally file-oriented, so all we have to do is make the directory
+  (make-directory "SCCS"))
+
+(defun vc-sccs-register (files &optional rev comment)
+  "Register FILES into the SCCS version-control system.
 REV is the optional revision number for the file.  COMMENT can be used
-to provide an initial description of FILE.
+to provide an initial description of FILES.
 
 `vc-register-switches' and `vc-sccs-register-switches' are passed to
 the SCCS command (in that order).
 
-Automatically retrieve a read-only version of the file with keywords
+Automatically retrieve a read-only version of the files with keywords
 expanded if `vc-keep-workfiles' is non-nil, otherwise, delete the workfile."
+  (dolist (file files)
     (let* ((dirname (or (file-name-directory file) ""))
           (basename (file-name-nondirectory file))
           (project-file (vc-sccs-search-project-dir dirname basename)))
@@ -178,14 +193,14 @@ expanded if `vc-keep-workfiles' is non-nil, otherwise, delete the workfile."
             (or project-file
                 (format (car vc-sccs-master-templates) dirname basename))))
        (apply 'vc-do-command nil 0 "admin" vc-name
-              (and rev (concat "-r" rev))
+              (and rev (not (string= rev "")) (concat "-r" rev))
               "-fb"
               (concat "-i" (file-relative-name file))
               (and comment (concat "-y" comment))
               (vc-switches 'SCCS 'register)))
       (delete-file file)
       (if vc-keep-workfiles
-         (vc-do-command nil 0 "get" (vc-name file)))))
+         (vc-do-command nil 0 "get" (vc-name file))))))
 
 (defun vc-sccs-responsible-p (file)
   "Return non-nil if SCCS thinks it would be responsible for registering FILE."
@@ -194,14 +209,15 @@ expanded if `vc-keep-workfiles' is non-nil, otherwise, delete the workfile."
       (stringp (vc-sccs-search-project-dir (or (file-name-directory file) "")
                                           (file-name-nondirectory file)))))
 
-(defun vc-sccs-checkin (file rev comment)
+(defun vc-sccs-checkin (files rev comment)
   "SCCS-specific version of `vc-backend-checkin'."
-  (apply 'vc-do-command nil 0 "delta" (vc-name file)
-        (if rev (concat "-r" rev))
-        (concat "-y" comment)
-        (vc-switches 'SCCS 'checkin))
-  (if vc-keep-workfiles
-      (vc-do-command nil 0 "get" (vc-name file))))
+  (dolist (file files)
+    (apply 'vc-do-command nil 0 "delta" (vc-name file)
+          (if rev (concat "-r" rev))
+          (concat "-y" comment)
+          (vc-switches 'SCCS 'checkin))
+    (if vc-keep-workfiles
+       (vc-do-command nil 0 "get" (vc-name file)))))
 
 (defun vc-sccs-find-version (file rev buffer)
   (apply 'vc-do-command
@@ -242,6 +258,19 @@ locked.  REV is the revision to check out."
                 switches))))
     (message "Checking out %s...done" file)))
 
+(defun vc-sccs-cancel-version (files)
+  "Roll back, undoing the most recent checkins of FILES."
+  (if (not files)
+      (error "SCCS backend doesn't support directory-level rollback."))
+  (dolist (file files)
+         (let ((discard (vc-workfile-version file)))
+           (if (null (yes-or-no-p (format "Remove version %s from %s history? " 
+                                          discard file)))
+               (error "Aborted"))
+           (message "Removing revision %s from %s..." discard file)
+           (vc-do-command nil 0 "rmdel" (vc-name file) (concat "-r" discard))
+           (vc-do-command nil 0 "get" (vc-name file) nil))))
+
 (defun vc-sccs-revert (file &optional contents-done)
   "Revert FILE to the version it was based on."
   (vc-do-command nil 0 "unget" (vc-name file))
@@ -251,16 +280,6 @@ locked.  REV is the revision to check out."
   ;; vc-workfile-version is cleared here so that it gets recomputed.
   (vc-file-setprop file 'vc-workfile-version nil))
 
-(defun vc-sccs-cancel-version (file editable)
-  "Undo the most recent checkin of FILE.
-EDITABLE non-nil means previous version should be locked."
-  (vc-do-command nil 0 "rmdel"
-                (vc-name file)
-                (concat "-r" (vc-workfile-version file)))
-  (vc-do-command nil 0 "get"
-                (vc-name file)
-                (if editable "-e")))
-
 (defun vc-sccs-steal-lock (file &optional rev)
   "Steal the lock on the current workfile for FILE and revision REV."
   (vc-do-command nil 0 "unget" (vc-name file) "-n" (if rev (concat "-r" rev)))
@@ -271,9 +290,14 @@ EDITABLE non-nil means previous version should be locked."
 ;;; History functions
 ;;;
 
-(defun vc-sccs-print-log (file &optional buffer)
-  "Get change log associated with FILE."
-  (vc-do-command buffer 0 "prs" (vc-name file)))
+(defun vc-sccs-print-log (files &optional buffer)
+  "Get change log associated with FILES."
+  (vc-do-command buffer 0 "prs" (mapcar 'vc-name files)))
+
+(defun vc-sccs-wash-log ()
+  "Remove all non-comment information from log output."
+  ;; FIXME: not implemented for SCCS
+  nil)
 
 (defun vc-sccs-logentry-check ()
   "Check that the log entry in the current buffer is acceptable for SCCS."
@@ -281,11 +305,12 @@ EDITABLE non-nil means previous version should be locked."
     (goto-char 512)
     (error "Log must be less than 512 characters; point is now at pos 512")))
 
-(defun vc-sccs-diff (file &optional oldvers newvers buffer)
-  "Get a difference report using SCCS between two versions of FILE."
+(defun vc-sccs-diff (files &optional oldvers newvers buffer)
+  "Get a difference report using SCCS between two filesets."
   (setq oldvers (vc-sccs-lookup-triple file oldvers))
   (setq newvers (vc-sccs-lookup-triple file newvers))
-  (apply 'vc-do-command (or buffer "*vc-diff*") 1 "vcdiff" (vc-name file)
+  (apply 'vc-do-command (or buffer "*vc-diff*") 
+        1 "vcdiff" (mapcar 'vc-name (vc-expand-dirs files))
          (append (list "-q"
                        (and oldvers (concat "-r" oldvers))
                        (and newvers (concat "-r" newvers)))
index ceb1df5..ddecb89 100644 (file)
@@ -96,6 +96,10 @@ If you want to force an empty list of arguments, use t."
        (t ".svn"))
   "The name of the \".svn\" subdirectory or its equivalent.")
 
+;;; Properties of the backend
+
+(defun vc-svn-revision-granularity ()
+     'repository)
 ;;;
 ;;; State-querying functions
 ;;;
@@ -206,13 +210,19 @@ If you want to force an empty list of arguments, use t."
 ;;; State-changing functions
 ;;;
 
-(defun vc-svn-register (file &optional rev comment)
-  "Register FILE into the SVN version-control system.
-COMMENT can be used to provide an initial description of FILE.
+(defun vc-svn-create-repo ()
+  "Create a new SVN repository."
+  (vc-do-command nil 0 "svnadmin" '("create" "SVN"))
+  (vc-do-command nil 0 "svn" '(".") 
+                "checkout" (concat "file://" default-directory "SVN")))
+
+(defun vc-svn-register (files &optional rev comment)
+  "Register FILES into the SVN version-control system.
+The COMMENT argument is ignored  This does an add but not a commit.
 
 `vc-register-switches' and `vc-svn-register-switches' are passed to
 the SVN command (in that order)."
-  (apply 'vc-svn-command nil 0 file "add" (vc-switches 'SVN 'register)))
+  (apply 'vc-svn-command nil 0 files "add" (vc-switches 'SVN 'register)))
 
 (defun vc-svn-responsible-p (file)
   "Return non-nil if SVN thinks it is responsible for FILE."
@@ -225,10 +235,11 @@ the SVN command (in that order)."
   "Return non-nil if FILE could be registered in SVN.
 This is only possible if SVN is responsible for FILE's directory.")
 
-(defun vc-svn-checkin (file rev comment)
+(defun vc-svn-checkin (files rev comment)
   "SVN-specific version of `vc-backend-checkin'."
+  (if rev (error "Committing to a specific revision is unsupported in SVN."))
   (let ((status (apply
-                 'vc-svn-command nil 1 file "ci"
+                 'vc-svn-command nil 1 files "ci"
                  (nconc (list "-m" comment) (vc-switches 'SVN 'checkin)))))
     (set-buffer "*vc*")
     (goto-char (point-min))
@@ -236,7 +247,8 @@ This is only possible if SVN is responsible for FILE's directory.")
       ;; Check checkin problem.
       (cond
        ((search-forward "Transaction is out of date" nil t)
-        (vc-file-setprop file 'vc-state 'needs-merge)
+        (mapc (lambda (file) (vc-file-setprop file 'vc-state 'needs-merge))
+             files)
         (error (substitute-command-keys
                 (concat "Up-to-date check failed: "
                         "type \\[vc-next-action] to merge in changes"))))
@@ -252,6 +264,7 @@ This is only possible if SVN is responsible for FILE's directory.")
     ))
 
 (defun vc-svn-find-version (file rev buffer)
+  "SVN-specific retrieval of a specified version into a buffer."
   (apply 'vc-svn-command
         buffer 0 file
         "cat"
@@ -362,53 +375,41 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
 ;;; History functions
 ;;;
 
-(defun vc-svn-print-log (file &optional buffer)
-  "Get change log associated with FILE."
+(defun vc-svn-print-log (files &optional buffer)
+  "Get change log(s) associated with FILES."
   (save-current-buffer
     (vc-setup-buffer buffer)
     (let ((inhibit-read-only t))
       (goto-char (point-min))
       ;; Add a line to tell log-view-mode what file this is.
-      (insert "Working file: " (file-relative-name file) "\n"))
+      (insert "Working file(s): " (vc-delistify (mapcar 'file-relative-name files)) "\n"))
     (vc-svn-command
      buffer
-     (if (and (vc-stay-local-p file) (fboundp 'start-process)) 'async 0)
-     file "log"
+     (if (and (= (length files) 1) (vc-stay-local-p (car files)) (fboundp 'start-process)) 'async 0)
+     files "log"
      ;; By default Subversion only shows the log upto the working version,
      ;; whereas we also want the log of the subsequent commits.  At least
      ;; that's what the vc-cvs.el code does.
      "-rHEAD:0")))
 
-(defun vc-svn-diff (file &optional oldvers newvers buffer)
-  "Get a difference report using SVN between two versions of FILE."
-  (unless buffer (setq buffer "*vc-diff*"))
-  (if (and oldvers (equal oldvers (vc-workfile-version file)))
-      ;; Use nil rather than the current revision because svn handles it
-      ;; better (i.e. locally).
-      (setq oldvers nil))
-  (if (string= (vc-workfile-version file) "0")
-      ;; This file is added but not yet committed; there is no master file.
-      (if (or oldvers newvers)
-         (error "No revisions of %s exist" file)
-       ;; We regard this as "changed".
-       ;; Diff it against /dev/null.
-       ;; Note: this is NOT a "svn diff".
-       (apply 'vc-do-command buffer
-              1 "diff" file
-              (append (vc-switches nil 'diff) '("/dev/null")))
-       ;; Even if it's empty, it's locally modified.
-       1)
-    (let* ((switches
+(defun vc-svn-wash-log ()
+  "Remove all non-comment information from log output."
+  ;; FIXME: not implemented for SVN
+  nil)
+
+(defun vc-svn-diff (files &optional oldvers newvers buffer)
+  "Get a difference report using SVN between two versions of fileset FILES."
+  (let* ((switches
            (if vc-svn-diff-switches
                (vc-switches 'SVN 'diff)
              (list "-x" (mapconcat 'identity (vc-switches nil 'diff) " "))))
           (async (and (not vc-disable-async-diff)
-                       (vc-stay-local-p file)
+                       (vc-stay-local-p files)
                       (or oldvers newvers) ; Svn diffs those locally.
                       (fboundp 'start-process))))
       (apply 'vc-svn-command buffer
             (if async 'async 0)
-            file "diff"
+            files "diff"
             (append
              switches
              (when oldvers
@@ -417,7 +418,7 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
       (if async 1                    ; async diff => pessimistic assumption
        ;; For some reason `svn diff' does not return a useful
        ;; status w.r.t whether the diff was empty or not.
-       (buffer-size (get-buffer buffer))))))
+       (buffer-size (get-buffer buffer)))))
 
 (defun vc-svn-diff-tree (dir &optional rev1 rev2)
   "Diff all files at and below DIR."
@@ -464,11 +465,16 @@ NAME is assumed to be a URL."
 ;;; Internal functions
 ;;;
 
-(defun vc-svn-command (buffer okstatus file &rest flags)
+(defcustom vc-svn-program "svn"
+  "Name of the svn executable."
+  :type 'string
+  :group 'vc)
+
+(defun vc-svn-command (buffer okstatus file-or-list &rest flags)
   "A wrapper around `vc-do-command' for use in vc-svn.el.
 The difference to vc-do-command is that this function always invokes `svn',
 and that it passes `vc-svn-global-switches' to it before FLAGS."
-  (apply 'vc-do-command buffer okstatus "svn" file
+  (apply 'vc-do-command buffer okstatus vc-svn-program file-or-list
          (if (stringp vc-svn-global-switches)
              (cons vc-svn-global-switches flags)
            (append vc-svn-global-switches
@@ -487,7 +493,9 @@ and that it passes `vc-svn-global-switches' to it before FLAGS."
           ;; Old `svn' used name="svn:this_dir", newer use just name="".
           (concat "name=\"\\(?:svn:this_dir\\)?\"[\n\t ]*"
                   "\\(?:[-a-z]+=\"[^\"]*\"[\n\t ]*\\)*?"
-                  "url=\"\\([^\"]+\\)\"") nil t)
+                  "url=\"\\(?1:[^\"]+\\)\""
+                   ;; Yet newer ones don't use XML any more.
+                   "\\|^\ndir\n[0-9]+\n\\(?1:.*\\)") nil t)
       ;; This is not a hostname but a URL.  This may actually be considered
       ;; as a feature since it allows vc-svn-stay-local to specify different
       ;; behavior for different modules on the same server.
index 9065b2d..3fc3784 100644 (file)
@@ -46,8 +46,9 @@
 
 ;; This mode is fully documented in the Emacs user's manual.
 ;;
-;; Supported version-control systems presently include CVS, RCS, GNU Arch,
-;; Subversion, Meta-CVS, and SCCS (or its free replacement, CSSC).
+;; Supported version-control systems presently include CVS, RCS, GNU
+;; Arch, Subversion, Bzr, Mercurial, Meta-CVS, and SCCS (or its free
+;; replacement, CSSC).
 ;;
 ;; Some features will not work with old RCS versions.  Where
 ;; appropriate, VC finds out which version you have, and allows or
 ;; with `vc-sys-'.  Some of the functions are mandatory (marked with a
 ;; `*'), others are optional (`-').
 ;;
+;; BACKEND PROPERTIES
+;;
+;; * revision-granularity
+;;
+;;   Takes no arguments.  Returns either 'file or 'repository.
+;;
 ;; STATE-QUERYING FUNCTIONS
 ;;
 ;; * registered (file)
 ;;
 ;; - mode-line-string (file)
 ;;
-;;   If provided, this function should return the VC-specific mode line
-;;   string for FILE.  The default implementation deals well with all
-;;   states that `vc-state' can return.
+;;   If provided, this function should return the VC-specific mode
+;;   line string for FILE. The returned string should have a
+;;   `help-echo' property which is the text to be displayed as a
+;;   tooltip when the mouse hovers over the VC entry on the mode-line.
+;;   The default implementation deals well with all states that
+;;   `vc-state' can return.
 ;;
 ;; - dired-state-info (file)
 ;;
 ;;
 ;; STATE-CHANGING FUNCTIONS
 ;;
-;; * register (file &optional rev comment)
+;; * create-repo ()
 ;;
-;;   Register FILE in this backend.  Optionally, an initial revision REV
-;;   and an initial description of the file, COMMENT, may be specified.
+;;   Create an empty repository in the current directory and initialize 
+;;   it so VC mode can add files to it.  For file-oriented systems, this 
+;;   need do no more than create a subdirectory with the right name.
+;;
+;; * register (files &optional rev comment)
+;;
+;;   Register FILES in this backend.  Optionally, an initial revision REV
+;;   and an initial description of the file, COMMENT, may be specified,
+;;   but it is not guaranteed that the backend will do anything with this.
 ;;   The implementation should pass the value of vc-register-switches
-;;   to the backend command.
+;;   to the backend command.  (Note: in older versions of VC, this 
+;;   command took a single file argument and not a list.)
 ;;
 ;; - init-version (file)
 ;;
 ;;   Unregister FILE from this backend.  This is only needed if this
 ;;   backend may be used as a "more local" backend for temporary editing.
 ;;
-;; * checkin (file rev comment)
+;; * checkin (files rev comment)
 ;;
-;;   Commit changes in FILE to this backend.  If REV is non-nil, that
-;;   should become the new revision number.  COMMENT is used as a
-;;   check-in comment.  The implementation should pass the value of
-;;   vc-checkin-switches to the backend command.
+;;   Commit changes in FILES to this backend.  If REV is non-nil, that
+;;   should become the new revision number (not all backends do
+;;   anything with it).  COMMENT is used as a check-in comment.  The
+;;   implementation should pass the value of vc-checkin-switches to
+;;   the backend command. (Note: in older versions of VC, this 
+;;   command took a single file argument and not a list.)
 ;;
 ;; * find-version (file rev buffer)
 ;;
 ;;   already been reverted from a version backup, and this function
 ;;   only needs to update the status of FILE within the backend.
 ;;
-;; - cancel-version (file editable)
+;; - rollback (files)
 ;;
-;;   Cancel the current workfile version of FILE, i.e. remove it from the
-;;   master.  EDITABLE non-nil means that FILE should be writable
-;;   afterwards, and if locking is used for FILE, then a lock should also
-;;   be set.  If this function is not provided, trying to cancel a
-;;   version is caught as an error.
+;;   Remove the tip version of each of FILES from the repository.  If
+;;   this function is not provided, trying to cancel a version is
+;;   caught as an error.  (Most backends don't provide it.)  (Also
+;;   note that older versions of this backend command were called
+;;   'cancel-version' and took a single file arg, not a list of
+;;   files.)
 ;;
 ;; - merge (file rev1 rev2)
 ;;
 ;;
 ;; HISTORY FUNCTIONS
 ;;
-;; * print-log (file &optional buffer)
+;; * print-log (files &optional buffer)
 ;;
-;;   Insert the revision log of FILE into BUFFER, or the *vc* buffer
-;;   if BUFFER is nil.
+;;   Insert the revision log for FILES into BUFFER, or the *vc* buffer
+;;   if BUFFER is nil.  (Note: older versions of this function expected
+;;   only a single file argument.)
 ;;
 ;; - log-view-mode ()
 ;;
 ;;
 ;;   Only required if `annotate-command' is defined for the backend,
 ;;   AND you'd like the current time considered to be anything besides
-;;   (vs-annotate-convert-time (current-time)) -- i.e. the current
+;;   (vc-annotate-convert-time (current-time)) -- i.e. the current
 ;;   time with hours, minutes, and seconds included.  Probably safe to
 ;;   ignore.  Return the current-time, in units of fractional days.
 ;;
 ;;
 ;;   Operation called in current buffer when opening a file.  This can
 ;;   be used by the backend to setup some local variables it might need.
-;
+;;
 ;; - find-file-not-found-hook ()
 ;;
 ;;   Operation called in current buffer when opening a non-existing file.
 ;;   By default, this asks the user if she wants to check out the file.
+;;
+;; - extra-menu ()
+;;
+;;   Return a menu keymap, the items in the keymap will appear at the
+;;   end of the Version Control menu.  The goal is to allow backends
+;;   to specify extra menu items that appear in the VC menu.  This way
+;;   you can provide menu entries for functionality that is specific
+;;   to your backend and which does not map to any of the VC generic
+;;   concepts.
 
 ;;; Code:
 
@@ -565,7 +596,7 @@ These are passed to the checkin program by \\[vc-register]."
   :version "20.3")
 
 (defcustom vc-directory-exclusion-list '("SCCS" "RCS" "CVS" "MCVS" ".svn" 
-                                        ".git" ".hg" "{arch}")
+                                        ".git" ".hg" ".bzr" "{arch}")
   "List of directory names to be ignored when walking directory trees."
   :type '(repeat string)
   :group 'vc)
@@ -593,7 +624,7 @@ to use -L and sets this variable to remember whether it worked."
   :group 'vc)
 
 (defcustom vc-allow-async-revert nil
-  "Specifies whether the diff during \\[vc-revert-buffer] may be asynchronous.
+  "Specifies whether the diff during \\[vc-revert] may be asynchronous.
 Enabling this option means that you can confirm a revert operation even
 if the local changes in the file have not been found and displayed yet."
   :type '(choice (const :tag "No" nil)
@@ -957,6 +988,8 @@ Else, add CODE to the process' sentinel."
      ;; lost.  Terminated processes get deleted automatically
      ;; anyway. -- cyd
      ((or (null proc) (eq (process-status proc) 'exit))
+      ;; Make sure we've read the process's output before going further.
+      (if proc (accept-process-output proc))
       (eval code))
      ;; If a process is running, add CODE to the sentinel
      ((eq (process-status proc) 'run)
@@ -964,12 +997,13 @@ Else, add CODE to the process' sentinel."
        (set-process-sentinel proc
          `(lambda (p s)
             (with-current-buffer ',(current-buffer)
-              (goto-char (process-mark p))
-              ,@(append (cdr (cdr (cdr ;strip off `with-current-buffer buf
-                                        ;             (goto-char...)'
-                          (car (cdr (cdr ;strip off `lambda (p s)'
-                           sentinel))))))
-                        (list `(vc-exec-after ',code))))))))
+               (save-excursion
+                (goto-char (process-mark p))
+               ,@(append (cdr (cdr (car   ;Strip off (save-exc (goto-char...)
+                           (cdr (cdr       ;Strip off (with-current-buffer buf
+                           (car (cdr (cdr ;Strip off (lambda (p s)
+                             sentinel))))))))
+                         (list `(vc-exec-after ',code)))))))))
      (t (error "Unexpected process state"))))
   nil)
 
@@ -978,9 +1012,13 @@ Else, add CODE to the process' sentinel."
 Each function is called inside the buffer in which the command was run
 and is passed 3 arguments: the COMMAND, the FILE and the FLAGS.")
 
+(defun vc-delistify (filelist)
+  "Smash a FILELIST into a file list string suitable for info messages."
+  (if (not filelist) "."  (mapconcat 'identity filelist " ")))
+
 (defvar w32-quote-process-args)
 ;;;###autoload
-(defun vc-do-command (buffer okstatus command file &rest flags)
+(defun vc-do-command (buffer okstatus command file-or-list &rest flags)
   "Execute a VC command, notifying user and checking for errors.
 Output from COMMAND goes to BUFFER, or *vc* if BUFFER is nil or the
 current buffer if BUFFER is t.  If the destination buffer is not
@@ -988,65 +1026,69 @@ already current, set it up properly and erase it.  The command is
 considered successful if its exit status does not exceed OKSTATUS (if
 OKSTATUS is nil, that means to ignore error status, if it is `async', that
 means not to wait for termination of the subprocess; if it is t it means to
-ignore all execution errors).  FILE is the
-name of the working file (may also be nil, to execute commands that
-don't expect a file name).  If an optional list of FLAGS is present,
+ignore all execution errors).  FILE-OR-LIST is the name of a working file;
+it may be a list of files or be nil (to execute commands that don't expect 
+a file name or set of files).  If an optional list of FLAGS is present,
 that is inserted into the command line before the filename."
-  (and file (setq file (expand-file-name file)))
-  (if vc-command-messages
-      (message "Running %s on %s..." command file))
-  (save-current-buffer
-    (unless (or (eq buffer t)
-                (and (stringp buffer)
-                     (string= (buffer-name) buffer))
-                (eq buffer (current-buffer)))
-      (vc-setup-buffer buffer))
-    (let ((squeezed (remq nil flags))
-         (inhibit-read-only t)
-         (status 0))
-      (when file
-       ;; FIXME: file-relative-name can return a bogus result because
-       ;; it doesn't look at the actual file-system to see if symlinks
-       ;; come into play.
-       (setq squeezed (append squeezed (list (file-relative-name file)))))
-      (let ((exec-path (append vc-path exec-path))
-           ;; Add vc-path to PATH for the execution of this command.
-           (process-environment
-            (cons (concat "PATH=" (getenv "PATH")
-                          path-separator
-                          (mapconcat 'identity vc-path path-separator))
-                  process-environment))
-           (w32-quote-process-args t))
-       (if (and (eq okstatus 'async) (file-remote-p default-directory))
-           ;; start-process does not support remote execution
-           (setq okstatus nil))
-       (if (eq okstatus 'async)
-           (let ((proc
-                  (let ((process-connection-type nil))
-                    (apply 'start-process command (current-buffer) command
-                           squeezed))))
-              (unless (active-minibuffer-window)
-                (message "Running %s in the background..." command))
-             ;;(set-process-sentinel proc (lambda (p msg) (delete-process p)))
-             (set-process-filter proc 'vc-process-filter)
-             (vc-exec-after
-              `(unless (active-minibuffer-window)
-                  (message "Running %s in the background... done" ',command))))
-         (let ((buffer-undo-list t))
-            (setq status (apply 'process-file command nil t nil squeezed)))
-         (when (and (not (eq t okstatus))
-                     (or (not (integerp status))
-                         (and okstatus (< okstatus status))))
-           (pop-to-buffer (current-buffer))
-           (goto-char (point-min))
-           (shrink-window-if-larger-than-buffer)
-           (error "Running %s...FAILED (%s)" command
-                  (if (integerp status) (format "status %d" status) status))))
-       (if vc-command-messages
-           (message "Running %s...OK" command)))
-      (vc-exec-after
-       `(run-hook-with-args 'vc-post-command-functions ',command ',file ',flags))
-      status)))
+  ;; FIXME: file-relative-name can return a bogus result because
+  ;; it doesn't look at the actual file-system to see if symlinks
+  ;; come into play.
+  (let* ((files
+         (mapcar (lambda (f) (file-relative-name (expand-file-name f)))
+                 (if (listp file-or-list) file-or-list (list file-or-list))))
+         (full-command
+         (concat command " " (vc-delistify flags) " " (vc-delistify files))))
+    (if vc-command-messages
+       (message "Running %s..." full-command))
+    (save-current-buffer
+      (unless (or (eq buffer t)
+                 (and (stringp buffer)
+                      (string= (buffer-name) buffer))
+                 (eq buffer (current-buffer)))
+       (vc-setup-buffer buffer))
+      (let ((squeezed (remq nil flags))
+           (inhibit-read-only t)
+           (status 0))
+       (when files
+         (setq squeezed (nconc squeezed files)))
+       (let ((exec-path (append vc-path exec-path))
+             ;; Add vc-path to PATH for the execution of this command.
+             (process-environment
+              (cons (concat "PATH=" (getenv "PATH")
+                            path-separator
+                            (mapconcat 'identity vc-path path-separator))
+                    process-environment))
+             (w32-quote-process-args t))
+         (if (and (eq okstatus 'async) (file-remote-p default-directory))
+             ;; start-process does not support remote execution
+             (setq okstatus nil))
+         (if (eq okstatus 'async)
+             (let ((proc
+                    (let ((process-connection-type nil))
+                      (apply 'start-process command (current-buffer) command
+                             squeezed))))
+               (unless (active-minibuffer-window)
+                 (message "Running %s in the background..." full-command))
+               ;;(set-process-sentinel proc (lambda (p msg) (delete-process p)))
+               (set-process-filter proc 'vc-process-filter)
+               (vc-exec-after
+                `(unless (active-minibuffer-window)
+                   (message "Running %s in the background... done" ',full-command))))
+           (let ((buffer-undo-list t))
+             (setq status (apply 'process-file command nil t nil squeezed)))
+           (when (and (not (eq t okstatus))
+                      (or (not (integerp status))
+                          (and okstatus (< okstatus status))))
+             (pop-to-buffer (current-buffer))
+             (goto-char (point-min))
+             (shrink-window-if-larger-than-buffer)
+             (error "Running %s...FAILED (%s)" full-command
+                    (if (integerp status) (format "status %d" status) status))))
+         (if vc-command-messages
+             (message "Running %s...OK" full-command)))
+       (vc-exec-after
+        `(run-hook-with-args 'vc-post-command-functions ',command ',file-or-list ',flags))
+       status))))
 
 (defun vc-position-context (posn)
   "Save a bit of the text around POSN in the current buffer.
@@ -1276,7 +1318,7 @@ If VERBOSE is non-nil, query the user rather than using default parameters."
          ;; DO NOT revert the file without asking the user!
          (if (not visited) (find-file-other-window file))
          (if (yes-or-no-p "Revert to master version? ")
-             (vc-revert-buffer)))
+             (vc-revert)))
         (t ;; normal action
          (if (not verbose)
              (vc-checkin file nil comment)
@@ -1466,7 +1508,7 @@ first backend that could register the file is used."
                    (message "Registering %s... " file)
                    (let ((backend (vc-responsible-backend file t)))
                      (vc-file-clearprops file)
-                     (vc-call-backend backend 'register file rev comment)
+                     (vc-call-backend backend 'register (list file) rev comment)
                      (vc-file-setprop file 'vc-backend backend)
                      (unless vc-make-backup-files
                        (make-local-variable 'backup-inhibited)
@@ -1522,6 +1564,16 @@ The default is to return nil always."
 The default implementation returns t for all files."
   t)
 
+(defun vc-expand-dirs (file-or-dir-list)
+  "Expands directories in a file list specification.
+Only files already under version control are noticed."
+  ;; FIXME: Kill this function.
+  (let ((flattened '()))
+    (dolist (node file-or-dir-list)
+      (vc-file-tree-walk
+       node (lambda (f) (if (vc-backend f) (push f flattened)))))
+    (nreverse flattened)))
+
 (defun vc-resynch-window (file &optional keep noquery)
   "If FILE is in the current buffer, either revert or unvisit it.
 The choice between revert (to see expanded keywords) and unvisit depends on
@@ -1678,7 +1730,7 @@ Runs the normal hook `vc-checkin-hook'."
       ;; Change buffers to get local value of vc-checkin-switches.
       (with-current-buffer (or (get-file-buffer file) (current-buffer))
        (progn
-         (vc-call checkin file rev comment)
+         (vc-call checkin (list file) rev comment)
          (vc-delete-automatic-version-backups file)))
       `((vc-state . up-to-date)
        (vc-checkout-time . ,(nth 5 (file-attributes file)))
@@ -1785,7 +1837,7 @@ versions of all registered files in or below it."
       ;; if the file is not locked, use last and previous version as default
       (t
        (setq rev1-default (vc-call previous-version file
-                                   (vc-workfile-version file)))
+                                  (vc-workfile-version file)))
        (if (string= rev1-default "") (setq rev1-default nil))
        (setq rev2-default (vc-workfile-version file))))
      ;; construct argument list
@@ -1898,7 +1950,7 @@ actually call the backend, but performs a local diff."
                 (error "diff failed"))
             (if (not vc-diff-knows-L) (setq vc-diff-knows-L 'yes)))
           status)
-      (vc-call diff file rev1 rev2))))
+      (vc-call diff (list file) rev1 rev2 "*vc-diff*"))))
 
 (defun vc-switches (backend op)
   (let ((switches
@@ -2130,7 +2182,7 @@ See Info node `Merging'."
     (define-key vmap "t" 'vc-dired-toggle-terse-mode)
     map))
 
-(define-derived-mode vc-dired-mode dired-mode "Dired under VC"
+(define-derived-mode vc-dired-mode dired-mode "Dired under "
   "The major mode used in VC directory buffers.
 
 It works like Dired, but lists only files under version control, with
@@ -2190,6 +2242,13 @@ There is a special command, `*l', to mark all files currently locked."
        (set (make-local-variable 'dired-actual-switches)
             vc-dired-switches))
   (set (make-local-variable 'vc-dired-terse-mode) vc-dired-terse-display)
+  (let ((backend-name (symbol-name (vc-responsible-backend
+                                   default-directory))))
+    (setq mode-name (concat mode-name backend-name))
+    ;; Add menu after `vc-dired-mode-map' has `dired-mode-map' as the parent.
+    (let ((vc-dire-menu-map (copy-keymap vc-menu-map)))
+      (define-key-after (lookup-key vc-dired-mode-map [menu-bar]) [vc] 
+       (cons backend-name vc-dire-menu-map) 'subdir)))
   (setq vc-dired-mode t))
 
 (defun vc-dired-toggle-terse-mode ()
@@ -2239,7 +2298,7 @@ This code, like dired, assumes UNIX -l format."
   "Reformat the listing according to version control.
 Called by dired after any portion of a vc-dired buffer has been read in."
   (message "Getting version information... ")
-  (let (subdir filename (buffer-read-only nil))
+  (let (subdir filename (inhibit-read-only t))
     (goto-char (point-min))
     (while (not (eobp))
       (cond
@@ -2248,7 +2307,9 @@ Called by dired after any portion of a vc-dired buffer has been read in."
        ;; if the backend supports it, get the state
        ;; of all files in this directory at once
        (let ((backend (vc-responsible-backend subdir)))
-         (if (vc-find-backend-function backend 'dir-state)
+         ;; check `backend' can really handle `subdir'.
+         (if (and (vc-call-backend backend 'responsible-p subdir)
+                  (vc-find-backend-function backend 'dir-state))
              (vc-call-backend backend 'dir-state subdir)))
         (forward-line 1)
         ;; erase (but don't remove) the "total" line
@@ -2465,7 +2526,7 @@ If FOCUS-REV is non-nil, leave the point at that revision."
     ;; buffer can be accessed by the command.
     (condition-case err
         (progn
-          (vc-call print-log file "*vc-change-log*")
+          (vc-call print-log (list file) "*vc-change-log*")
           (set-buffer "*vc-change-log*"))
       (wrong-number-of-arguments
        ;; If this error came from the above call to print-log, try again
@@ -2478,7 +2539,7 @@ If FOCUS-REV is non-nil, leave the point at that revision."
                (not (eq (caddr err) 2)))
            (signal (car err) (cdr err))
          ;; for backward compatibility
-         (vc-call print-log file)
+         (vc-call print-log (list file))
          (set-buffer "*vc*"))))
     (pop-to-buffer (current-buffer))
     (vc-exec-after
@@ -2507,7 +2568,7 @@ If FOCUS-REV is non-nil, leave the point at that revision."
   "Return a string with all log entries stored in BACKEND for FILE."
   (if (vc-find-backend-function backend 'print-log)
       (with-current-buffer "*vc*"
-       (vc-call print-log file)
+       (vc-call print-log (list file))
        (vc-call wash-log file)
        (buffer-string))))
 
@@ -2532,7 +2593,7 @@ it if their logs are not in RCS format."
       (delete-region (match-beginning 0) (match-end 0)))))
 
 ;;;###autoload
-(defun vc-revert-buffer ()
+(defun vc-revert ()
   "Revert the current buffer's file to the version it was based on.
 This asks for confirmation if the buffer contents are not identical
 to that version.  This function does not automatically pick up newer
@@ -2574,6 +2635,9 @@ changes found in the master file; use \\[universal-argument] \\[vc-next-action]
     (vc-revert-file file)
     (message "Reverting %s...done" file)))
 
+;;;###autoload
+(define-obsolete-function-alias 'vc-revert-buffer 'vc-revert "23.1")
+
 ;;;###autoload
 (defun vc-update ()
   "Update the current buffer's file to the latest version on its branch.
@@ -2591,7 +2655,7 @@ the current branch are merged into the working file."
           (if (eq (vc-state file) 'edited)
               (error
                (substitute-command-keys
-           "File is locked--type \\[vc-revert-buffer] to discard changes"))
+           "File is locked--type \\[vc-revert] to discard changes"))
             (error
              (substitute-command-keys
            "Unexpected file state (%s)--type \\[vc-next-action] to correct")
@@ -2657,7 +2721,7 @@ return its name; otherwise return nil."
   (vc-resynch-buffer file t t))
 
 ;;;###autoload
-(defun vc-cancel-version (norevert)
+(defun vc-rollback (&optional norevert)
   "Get rid of most recently checked in version of this file.
 A prefix argument NOREVERT means do not revert the buffer afterwards."
   (interactive "P")
@@ -2666,12 +2730,12 @@ A prefix argument NOREVERT means do not revert the buffer afterwards."
         (backend (vc-backend file))
          (target (vc-workfile-version file)))
     (cond
-     ((not (vc-find-backend-function backend 'cancel-version))
+     ((not (vc-find-backend-function backend 'rollback))
       (error "Sorry, canceling versions is not supported under %s" backend))
      ((not (vc-call latest-on-branch-p file))
       (error "This is not the latest version; VC cannot cancel it"))
      ((not (vc-up-to-date-p file))
-      (error "%s" (substitute-command-keys "File is not up to date; use \\[vc-revert-buffer] to discard changes"))))
+      (error "%s" (substitute-command-keys "File is not up to date; use \\[vc-revert] to discard changes"))))
     (if (null (yes-or-no-p (format "Remove version %s from master? " target)))
        (error "Aborted")
       (setq norevert (or norevert (not
@@ -2680,7 +2744,7 @@ A prefix argument NOREVERT means do not revert the buffer afterwards."
       (message "Removing last change from %s..." file)
       (with-vc-properties
        file
-       (vc-call cancel-version file norevert)
+       (vc-call rollback (list file))
        `((vc-state . ,(if norevert 'edited 'up-to-date))
         (vc-checkout-time . ,(if norevert
                                0
@@ -2944,7 +3008,11 @@ log entries should be gathered."
   (vc-call-backend (vc-responsible-backend default-directory)
                    'update-changelog args))
 
-(defun vc-default-update-changelog (backend files)
+(defalias 'vc-cvs-update-changelog 'vc-update-changelog-rcs2log)
+(defalias 'vc-rcs-update-changelog 'vc-update-changelog-rcs2log)
+;; FIXME: This should probably be moved to vc-rcs.el and replaced in
+;; vc-cvs.el by code using cvs2cl.
+(defun vc-update-changelog-rcs2log (files)
   "Default implementation of update-changelog.
 Uses `rcs2log' which only works for RCS and CVS."
   ;; FIXME: We (c|sh)ould add support for cvs2cl
@@ -2985,9 +3053,7 @@ Uses `rcs2log' which only works for RCS and CVS."
                                     (mapcar
                                      (lambda (f)
                                        (file-relative-name
-                                        (if (file-name-absolute-p f)
-                                            f
-                                          (concat odefault f))))
+                                        (expand-file-name f odefault)))
                                      files)))
                        "done"
                     (pop-to-buffer (get-buffer-create "*vc*"))
@@ -3055,13 +3121,13 @@ cover the range from the oldest annotation to the newest."
     ;; Run through this file and find the oldest and newest dates annotated.
     (save-excursion
       (goto-char (point-min))
-      (while (setq date (prog1 (vc-call-backend vc-annotate-backend
-                                                'annotate-time)
-                          (forward-line 1)))
-       (if (> date newest)
-           (setq newest date))
-       (if (< date oldest)
-           (setq oldest date))))
+      (while (not (eobp))
+        (when (setq date (vc-call-backend vc-annotate-backend 'annotate-time))
+          (if (> date newest)
+              (setq newest date))
+          (if (< date oldest)
+              (setq oldest date)))
+        (forward-line 1)))
     (vc-annotate-display
      (/ (- (if full newest current) oldest)
         (vc-annotate-oldest-in-map vc-annotate-color-map))
@@ -3126,9 +3192,9 @@ use; you may override this using the second optional arg MODE."
         (vc-annotate-display-default (or vc-annotate-ratio 1.0)))
         ;; One of the auto-scaling modes
        ((eq vc-annotate-display-mode 'scale)
-        (vc-annotate-display-autoscale))
+        (vc-exec-after `(vc-annotate-display-autoscale)))
        ((eq vc-annotate-display-mode 'fullscale)
-        (vc-annotate-display-autoscale t))
+        (vc-exec-after `(vc-annotate-display-autoscale t)))
        ((numberp vc-annotate-display-mode) ; A fixed number of days lookback
         (vc-annotate-display-default
          (/ vc-annotate-display-mode
@@ -3205,9 +3271,20 @@ colors. `vc-annotate-background' specifies the background color."
         (set (make-local-variable 'vc-annotate-parent-rev) rev)
         (set (make-local-variable 'vc-annotate-parent-display-mode)
              display-mode)))
-    (when current-line
-      (goto-line current-line temp-buffer-name))
-    (message "Annotating... done")))
+
+    (with-current-buffer temp-buffer-name
+      (vc-exec-after
+       `(progn
+          ;; Ideally, we'd rather not move point if the user has already
+          ;; moved it elsewhere, but really point here is not the position
+          ;; of the user's cursor :-(
+          (when ,current-line           ;(and (bobp))
+            (let ((win (get-buffer-window (current-buffer) 0)))
+              (when win
+                (with-selected-window win
+                  (goto-line ,current-line)))))
+          (unless (active-minibuffer-window)
+            (message "Annotating... done")))))))
 
 (defun vc-annotate-prev-version (prefix)
   "Visit the annotation of the version previous to this one.
@@ -3382,30 +3459,30 @@ The annotations are relative to the current time, unless overridden by OFFSET."
   (font-lock-mode 1))
 
 (defun vc-annotate-lines (limit)
-  (let (difference)
-    (while (and (< (point) limit)
-               (setq difference (vc-annotate-difference vc-annotate-offset)))
-      (let* ((color (or (vc-annotate-compcar difference vc-annotate-color-map)
-                       (cons nil vc-annotate-very-old-color)))
-            ;; substring from index 1 to remove any leading `#' in the name
-            (face-name (concat "vc-annotate-face-"
-                               (if (string-equal
-                                    (substring (cdr color) 0 1) "#")
-                                   (substring (cdr color) 1)
-                                 (cdr color))))
-            ;; Make the face if not done.
-            (face (or (intern-soft face-name)
-                      (let ((tmp-face (make-face (intern face-name))))
-                        (set-face-foreground tmp-face (cdr color))
-                        (if vc-annotate-background
-                            (set-face-background tmp-face
-                                                 vc-annotate-background))
-                        tmp-face)))    ; Return the face
-            (point (point)))
-       (forward-line 1)
-       (put-text-property point (point) 'face face)))
-    ;; Pretend to font-lock there were no matches.
-    nil))
+  (while (< (point) limit)
+    (let ((difference (vc-annotate-difference vc-annotate-offset))
+          (start (point))
+          (end (progn (forward-line 1) (point))))
+      (when difference
+        (let* ((color (or (vc-annotate-compcar difference vc-annotate-color-map)
+                          (cons nil vc-annotate-very-old-color)))
+               ;; substring from index 1 to remove any leading `#' in the name
+               (face-name (concat "vc-annotate-face-"
+                                  (if (string-equal
+                                       (substring (cdr color) 0 1) "#")
+                                      (substring (cdr color) 1)
+                                    (cdr color))))
+               ;; Make the face if not done.
+               (face (or (intern-soft face-name)
+                         (let ((tmp-face (make-face (intern face-name))))
+                           (set-face-foreground tmp-face (cdr color))
+                           (if vc-annotate-background
+                               (set-face-background tmp-face
+                                                    vc-annotate-background))
+                           tmp-face))))        ; Return the face
+          (put-text-property start end 'face face)))))
+  ;; Pretend to font-lock there were no matches.
+  nil)
 \f
 ;; Collect back-end-dependent stuff here
 
@@ -3445,6 +3522,7 @@ The annotations are relative to the current time, unless overridden by OFFSET."
 (defun vc-file-tree-walk (dirname func &rest args)
   "Walk recursively through DIRNAME.
 Invoke FUNC f ARGS on each VC-managed file f underneath it."
+  ;; FIXME: Kill this function.
   (vc-file-tree-walk-internal (expand-file-name dirname) func args)
   (message "Traversing directory %s...done" dirname))
 
@@ -3455,13 +3533,13 @@ Invoke FUNC f ARGS on each VC-managed file f underneath it."
     (let ((dir (file-name-as-directory file)))
       (mapcar
        (lambda (f) (or
-                   (string-equal f ".")
-                   (string-equal f "..")
-                   (member f vc-directory-exclusion-list)
-                   (let ((dirf (expand-file-name f dir)))
-                     (or
-                      (file-symlink-p dirf);; Avoid possible loops
-                      (vc-file-tree-walk-internal dirf func args)))))
+               (string-equal f ".")
+               (string-equal f "..")
+               (member f vc-directory-exclusion-list)
+               (let ((dirf (expand-file-name f dir)))
+                 (or
+                  (file-symlink-p dirf) ;; Avoid possible loops.
+                  (vc-file-tree-walk-internal dirf func args)))))
        (directory-files dir)))))
 
 (provide 'vc)
index 1657dc0..9b6f06f 100644 (file)
@@ -27,6 +27,9 @@
 
 ;;; Code:
 
+(defconst emacs-copyright "Copyright (C) 2007 Free Software Foundation, Inc."
+  "Short copyright string for this version of Emacs.")
+
 (defconst emacs-version "22.1.50" "\
 Version numbers of this version of Emacs.")
 
index 37dc73d..960d899 100644 (file)
 (eval-when-compile (require 'cl))
 (require 'dired)
 (autoload 'dired-do-create-files-regexp "dired-aux")
-(autoload 'dired-call-process "dired-aux")
 
 (defgroup wdired nil
   "Mode to rename files by editing their names in dired buffers."
@@ -176,6 +175,7 @@ program `dired-chmod-program', which must exist."
     (define-key map "\C-c\C-c" 'wdired-finish-edit)
     (define-key map "\C-c\C-k" 'wdired-abort-changes)
     (define-key map "\C-c\C-[" 'wdired-abort-changes)
+    (define-key map "\C-x\C-q" 'wdired-exit)
     (define-key map "\C-m"     'ignore)
     (define-key map "\C-j"     'ignore)
     (define-key map "\C-o"     'ignore)
@@ -424,6 +424,22 @@ non-nil means return old filename."
   (set-buffer-modified-p nil)
   (setq buffer-undo-list nil))
 
+(defun wdired-exit ()
+  "Exit wdired and return to dired mode.
+Just return to dired mode if there are no changes.  Otherwise,
+ask a yes-or-no question whether to save or cancel changes,
+and proceed depending on the answer."
+  (interactive)
+  (if (buffer-modified-p)
+      (if (y-or-n-p (format "Buffer %s modified; save changes? "
+                           (current-buffer)))
+         (wdired-finish-edit)
+       (wdired-abort-changes))
+    (wdired-change-to-dired-mode)
+    (set-buffer-modified-p nil)
+    (setq buffer-undo-list nil)
+    (message "(No changes need to be saved)")))
+
 ;; Rename a file, searching it in a modified dired buffer, in order
 ;; to be able to use `dired-do-create-files-regexp' and get its
 ;; "benefits".
@@ -684,7 +700,7 @@ Like original function but it skips read-only words."
        (new-bit "-")
        (pos-prop (- (point) (- (current-column) wdired-col-perm))))
     (if (eq (char-after (point)) ?-)
-       (setq new-bit   
+       (setq new-bit
              (if (= (% (- (current-column) wdired-col-perm) 3) 0) "r"
                (if (= (% (- (current-column) wdired-col-perm) 3) 1) "w"
                  "x"))))
@@ -744,8 +760,8 @@ Like original function but it skips read-only words."
             (progn
               (setq perm-tmp
                     (int-to-string (wdired-perms-to-number perms-new)))
-              (unless (equal 0 (dired-call-process dired-chmod-program
-                                                   t perm-tmp filename))
+              (unless (equal 0 (process-file dired-chmod-program
+                                            nil nil nil perm-tmp filename))
                 (setq errors (1+ errors))
                 (dired-log (concat dired-chmod-program " " perm-tmp
                                    " `" filename "' failed\n\n"))))
index 6725144..6025244 100644 (file)
@@ -1491,6 +1491,8 @@ If that does not exists, call the value of `widget-complete-field'."
                      (delete-backward-char 1))
                    (insert ?\n)
                    (setq doc-end (point)))))
+              ((eq escape ?h)
+               (widget-add-documentation-string-button widget))
               ((eq escape ?v)
                (if (and button-begin (not button-end))
                    (widget-apply widget :value-create)
@@ -1516,44 +1518,7 @@ If that does not exists, call the value of `widget-complete-field'."
   (widget-clear-undo))
 
 (defun widget-default-format-handler (widget escape)
-  ;; We recognize the %h escape by default.
-  (let* ((buttons (widget-get widget :buttons)))
-    (cond ((eq escape ?h)
-          (let* ((doc-property (widget-get widget :documentation-property))
-                 (doc-try (cond ((widget-get widget :doc))
-                                ((functionp doc-property)
-                                 (funcall doc-property
-                                          (widget-get widget :value)))
-                                ((symbolp doc-property)
-                                 (documentation-property
-                                  (widget-get widget :value)
-                                  doc-property))))
-                 (doc-text (and (stringp doc-try)
-                                (> (length doc-try) 1)
-                                doc-try))
-                 (doc-indent (widget-get widget :documentation-indent)))
-            (when doc-text
-              (and (eq (preceding-char) ?\n)
-                   (widget-get widget :indent)
-                   (insert-char ?\s (widget-get widget :indent)))
-              ;; The `*' in the beginning is redundant.
-              (when (eq (aref doc-text  0) ?*)
-                (setq doc-text (substring doc-text 1)))
-              ;; Get rid of trailing newlines.
-              (when (string-match "\n+\\'" doc-text)
-                (setq doc-text (substring doc-text 0 (match-beginning 0))))
-              (push (widget-create-child-and-convert
-                     widget 'documentation-string
-                     :indent (cond ((numberp doc-indent )
-                                    doc-indent)
-                                   ((null doc-indent)
-                                    nil)
-                                   (t 0))
-                     doc-text)
-                    buttons))))
-         (t
-          (error "Unknown escape `%c'" escape)))
-    (widget-put widget :buttons buttons)))
+  (error "Unknown escape `%c'" escape))
 
 (defun widget-default-button-face-get (widget)
   ;; Use :button-face or widget-button-face
@@ -1665,13 +1630,32 @@ If that does not exists, call the value of `widget-complete-field'."
   (widget-default-action widget event))
 
 (defun widget-default-prompt-value (widget prompt value unbound)
-  "Read an arbitrary value.  Stolen from `set-variable'."
-;; (let ((initial (if unbound
-;; nil
-;; It would be nice if we could do a `(cons val 1)' here.
-;; (prin1-to-string (custom-quote value))))))
+  "Read an arbitrary value."
   (eval-minibuffer prompt))
 
+(defun widget-docstring (widget)
+  "Return the documentation string specificied by WIDGET, or nil if none.
+If WIDGET has a `:doc' property, that specifies the documentation string.
+Otherwise, try the `:documentation-property' property.  If this
+is a function, call it with the widget's value as an argument; if
+it is a symbol, use this symbol together with the widget's value
+as the argument to `documentation-property'."
+  (let ((doc (or (widget-get widget :doc)
+                (let ((doc-prop (widget-get widget :documentation-property))
+                      (value (widget-get widget :value)))
+                  (cond ((functionp doc-prop)
+                         (funcall doc-prop value))
+                        ((symbolp doc-prop)
+                         (documentation-property value doc-prop)))))))
+    (when (and (stringp doc) (> (length doc) 0))
+      ;; Remove any redundant `*' in the beginning.
+      (when (eq (aref doc 0) ?*)
+       (setq doc (substring doc 1)))
+      ;; Remove trailing newlines.
+      (when (string-match "\n+\\'" doc)
+       (setq doc (substring doc 0 (match-beginning 0))))
+      doc)))
+
 ;;; The `item' Widget.
 
 (define-widget 'item 'default
@@ -2913,7 +2897,8 @@ link for that string."
   "A documentation string."
   :format "%v"
   :action 'widget-documentation-string-action
-  :value-create 'widget-documentation-string-value-create)
+  :value-create 'widget-documentation-string-value-create
+  :visibility-widget 'visibility)
 
 (defun widget-documentation-string-value-create (widget)
   ;; Insert documentation string.
@@ -2925,11 +2910,13 @@ link for that string."
        (let ((before (substring doc 0 (match-beginning 0)))
              (after (substring doc (match-beginning 0)))
              button)
+         (when (and indent (not (zerop indent)))
+           (insert-char ?\s indent))
          (insert before ?\s)
          (widget-documentation-link-add widget start (point))
          (setq button
                (widget-create-child-and-convert
-                widget 'visibility
+                widget (widget-get widget :visibility-widget)
                 :help-echo "Show or hide rest of the documentation."
                 :on "Hide Rest"
                 :off "More"
@@ -2943,6 +2930,8 @@ link for that string."
            (insert after)
            (widget-documentation-link-add widget start (point)))
          (widget-put widget :buttons (list button)))
+      (when (and indent (not (zerop indent)))
+       (insert-char ?\s indent))
       (insert doc)
       (widget-documentation-link-add widget start (point))))
   (insert ?\n))
@@ -2954,6 +2943,29 @@ link for that string."
                (not (widget-get parent :documentation-shown))))
   ;; Redraw.
   (widget-value-set widget (widget-value widget)))
+
+(defun widget-add-documentation-string-button (widget &rest args)
+  "Insert a new `documentation-string' widget based on WIDGET.
+The new widget becomes a child of WIDGET, and is also added to
+its `:buttons' list.  The documentation string is found from
+WIDGET using the function `widget-docstring'.
+Optional ARGS specifies additional keyword arguments for the
+`documentation-string' widget."
+  (let ((doc (widget-docstring widget))
+       (indent (widget-get widget :indent))
+       (doc-indent (widget-get widget :documentation-indent)))
+    (when doc
+      (and (eq (preceding-char) ?\n)
+          indent
+          (insert-char ?\s indent))
+      (unless (or (numberp doc-indent) (null doc-indent))
+       (setq doc-indent 0))
+      (widget-put widget :buttons
+                 (cons (apply 'widget-create-child-and-convert
+                              widget 'documentation-string
+                              :indent doc-indent
+                              (nconc args (list doc)))
+                       (widget-get widget :buttons))))))
 \f
 ;;; The Sexp Widgets.
 
index 7a64588..26d1bdc 100644 (file)
@@ -57,15 +57,15 @@ BODY remains selected."
         ;; select-window changes frame-selected-window for whatever
         ;; frame that window is in.
         (save-selected-window-alist
-         (mapcar (lambda (frame) (list frame (frame-selected-window frame)))
+         (mapcar (lambda (frame) (cons frame (frame-selected-window frame)))
                  (frame-list))))
      (save-current-buffer
        (unwind-protect
           (progn ,@body)
         (dolist (elt save-selected-window-alist)
           (and (frame-live-p (car elt))
-               (window-live-p (cadr elt))
-               (set-frame-selected-window (car elt) (cadr elt))))
+               (window-live-p (cdr elt))
+               (set-frame-selected-window (car elt) (cdr elt))))
         (if (window-live-p save-selected-window-window)
             (select-window save-selected-window-window))))))
 
@@ -396,11 +396,15 @@ subtree is balanced."
 (defun bw-adjust-window (window delta horizontal)
   "Wrapper around `adjust-window-trailing-edge' with error checking.
 Arguments WINDOW, DELTA and HORIZONTAL are passed on to that function."
-  (condition-case err
-      (adjust-window-trailing-edge window delta horizontal)
-    (error
-     ;;(message "adjust: %s" (error-message-string err))
-     )))
+  ;; `adjust-window-trailing-edge' may fail if delta is too large.
+  (while (>= (abs delta) 1)
+    (condition-case err
+        (progn
+          (adjust-window-trailing-edge window delta horizontal)
+          (setq delta 0))
+      (error
+       ;;(message "adjust: %s" (error-message-string err))
+       (setq delta (/ delta 2))))))
 
 (defun bw-balance-sub (wt w h)
   (setq wt (bw-refresh-edges wt))
@@ -423,6 +427,99 @@ Arguments WINDOW, DELTA and HORIZONTAL are passed on to that function."
       (dolist (c childs)
           (bw-balance-sub c cw ch)))))
 
+;;; A different solution to balance-windows
+
+(defun window-fixed-size-p (&optional window direction)
+  "Non-nil if WINDOW cannot be resized in DIRECTION.
+DIRECTION can be nil (i.e. any), `height' or `width'."
+  (with-current-buffer (window-buffer window)
+    (let ((fixed (and (boundp 'window-size-fixed) window-size-fixed)))
+      (when fixed
+       (not (and direction
+                 (member (cons direction window-size-fixed)
+                         '((height . width) (width . height)))))))))
+
+(defvar window-area-factor 1
+  "Factor by which the window area should be over-estimated.
+This is used by `balance-windows-area'.
+Changing this globally has no effect.")
+
+(defun balance-windows-area ()
+  "Make all visible windows the same area (approximately).
+See also `window-area-factor' to change the relative size of specific buffers."
+  (interactive)
+  (let* ((unchanged 0) (carry 0) (round 0)
+         ;; Remove fixed-size windows.
+         (wins (delq nil (mapcar (lambda (win)
+                                   (if (not (window-fixed-size-p win)) win))
+                                 (window-list nil 'nomini))))
+         (changelog nil)
+         next)
+    ;; Resizing a window changes the size of surrounding windows in complex
+    ;; ways, so it's difficult to balance them all.  The introduction of
+    ;; `adjust-window-trailing-edge' made it a bit easier, but it is still
+    ;; very difficult to do.  `balance-window' above takes an off-line
+    ;; approach: get the whole window tree, then balance it, then try to
+    ;; adjust the windows so they fit the result.
+    ;; Here, instead, we take a "local optimization" approach, where we just
+    ;; go through all the windows several times until nothing needs to be
+    ;; changed.  The main problem with this approach is that it's difficult
+    ;; to make sure it terminates, so we use some heuristic to try and break
+    ;; off infinite loops.
+    ;; After a round without any change, we allow a second, to give a chance
+    ;; to the carry to propagate a minor imbalance from the end back to
+    ;; the beginning.
+    (while (< unchanged 2)
+      ;; (message "New round")
+      (setq unchanged (1+ unchanged) round (1+ round))
+      (dolist (win wins)
+        (setq next win)
+        (while (progn (setq next (next-window next))
+                      (window-fixed-size-p next)))
+        ;; (assert (eq next (or (cadr (member win wins)) (car wins))))
+        (let* ((horiz
+                (< (car (window-edges win)) (car (window-edges next))))
+               (areadiff (/ (- (* (window-height next) (window-width next)
+                                  (buffer-local-value 'window-area-factor
+                                                      (window-buffer next)))
+                               (* (window-height win) (window-width win)
+                                  (buffer-local-value 'window-area-factor
+                                                      (window-buffer win))))
+                            (max (buffer-local-value 'window-area-factor
+                                                     (window-buffer win))
+                                 (buffer-local-value 'window-area-factor
+                                                     (window-buffer next)))))
+               (edgesize (if horiz
+                             (+ (window-height win) (window-height next))
+                           (+ (window-width win) (window-width next))))
+               (diff (/ areadiff edgesize)))
+          (when (zerop diff)
+            ;; Maybe diff is actually closer to 1 than to 0.
+            (setq diff (/ (* 3 areadiff) (* 2 edgesize))))
+          (when (and (zerop diff) (not (zerop areadiff)))
+            (setq diff (/ (+ areadiff carry) edgesize))
+            ;; Change things smoothly.
+            (if (or (> diff 1) (< diff -1)) (setq diff (/ diff 2))))
+          (if (zerop diff)
+              ;; Make sure negligible differences don't accumulate to
+              ;; become significant.
+              (setq carry (+ carry areadiff))
+            (bw-adjust-window win diff horiz)
+            ;; (sit-for 0.5)
+            (let ((change (cons win (window-edges win))))
+              ;; If the same change has been seen already for this window,
+              ;; we're most likely in an endless loop, so don't count it as
+              ;; a change.
+              (unless (member change changelog)
+                (push change changelog)
+                (setq unchanged 0 carry 0)))))))
+    ;; We've now basically balanced all the windows.
+    ;; But there may be some minor off-by-one imbalance left over,
+    ;; so let's do some fine tuning.
+    ;; (bw-finetune wins)
+    ;; (message "Done in %d rounds" round)
+    ))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 \f
 ;; I think this should be the default; I think people will prefer it--rms.
@@ -645,10 +742,7 @@ header-line."
          ;; desired-height lines, constrained by MIN-HEIGHT and MAX-HEIGHT.
          (- (max (min desired-height max-height)
                  (or min-height window-min-height))
-            window-height))
-        ;; We do our own height checking, so avoid any restrictions due to
-        ;; window-min-height.
-        (window-min-height 1))
+            window-height)))
 
     ;; Don't try to redisplay with the cursor at the end
     ;; on its own line--that would force a scroll and spoil things.
index 08fca38..1c29669 100644 (file)
@@ -171,7 +171,7 @@ FRAME-OR-WINDOW is the frame or window that the mouse is over."
 WINDOW is the window the mouse is over.  ACTION is the suggested
 action from the source.  If nothing has changed, return the last
 action and type we got from `x-dnd-test-function'."
-  (let ((buffer (when (and (windowp window) (window-live-p window))
+  (let ((buffer (when (window-live-p window)
                  (window-buffer window)))
        (current-state (x-dnd-get-state-for-frame window)))
     (when (or (not (equal buffer (aref current-state 0)))
@@ -206,9 +206,7 @@ EXTRA-DATA is data needed for a specific protocol."
     (when types (aset current-state 2 types))
     (when extra-data (aset current-state 6 extra-data))
     (aset current-state 1 window)
-    (aset current-state 0 (if (and (windowp window)
-                                  (window-live-p window))
-                             (window-buffer window) nil))
+    (aset current-state 0 (and (window-live-p window) (window-buffer window)))
     (setcdr (x-dnd-get-state-cons-for-frame window) current-state)))
 
 
@@ -319,7 +317,7 @@ nil if not."
         (action (aref state 5))
         (w (posn-window (event-start event))))
     (when handler
-      (if (and (windowp w) (window-live-p w)
+      (if (and (window-live-p w)
               (not (window-minibuffer-p w))
               (not (window-dedicated-p w)))
          ;; If dropping in an ordinary window which we could use,
index d14c9c8..8ce93e2 100644 (file)
@@ -43,6 +43,8 @@
 
 ;;; Code:
 
+(defvar xterm-mouse-debug-buffer nil)
+
 (define-key function-key-map "\e[M" 'xterm-mouse-translate)
 
 (defvar xterm-mouse-last)
@@ -95,6 +97,8 @@
                       (list (intern (format "drag-mouse-%d"
                                             (+ 1 xterm-mouse-last)))
                             down-data click-data)))))
+           (if xterm-mouse-debug-buffer
+               (print unread-command-events xterm-mouse-debug-buffer))
            (if (and (symbolp down-where)
                     (consp down-where))
                (vector (list down-where down-data) down)
             (fdiff (- f (* 1.0 maxwrap dbig))))
        (+ (truncate fdiff) (* maxwrap dbig))))))
 
-
 (defun xterm-mouse-event ()
   "Convert XTerm mouse event to Emacs mouse event."
   (let* ((type (- (xterm-mouse-event-read) #o40))
         ;; Emulate timestamp information.  This is accurate enough
         ;; for default value of mouse-1-click-follows-link (450msec).
         (timestamp (xterm-mouse-truncate-wrap
-                    (* 1000
-                       (- (float-time)
-                          (or xt-mouse-epoch
-                              (setq xt-mouse-epoch (float-time)))))))
-        (mouse (intern
+                     (* 1000
+                        (- (float-time)
+                           (or xt-mouse-epoch
+                               (setq xt-mouse-epoch (float-time)))))))
+         (mouse (intern
                 ;; For buttons > 3, the release-event looks
                 ;; differently (see xc/programs/xterm/button.c,
                 ;; function EditorButton), and there seems to come in
index 2452be8..33c4faa 100644 (file)
@@ -1,3 +1,8 @@
+2007-07-30  Robert J. Chassell  <bob@rattlesnake.com>
+
+       * emacs-lisp-intro.texi: Fix typo on line 5173, change `thee' to
+       `these'.
+
 2007-07-25  Glenn Morris  <rgm@gnu.org>
 
        * Relicense all FSF files to GPLv3 or later.
index 0318ac5..a08d7a6 100644 (file)
@@ -5170,7 +5170,7 @@ Function Interactive}.)  The expression reads as follows:
 
 @noindent
 This expression is not one with letters standing for parts, as
-described earlier.  Instead, it starts a list with thee parts.
+described earlier.  Instead, it starts a list with these parts:
 
 The first part of the list is an expression to read the name of a
 buffer and return it as a string.  That is @code{read-buffer}.  The
index 25bd07b..75d40db 100644 (file)
 
        * Relicense all FSF files to GPLv3 or later.
 
+2007-07-24  Michael Albinus  <michael.albinus@gmx.de>
+
+       * processes.texi (Synchronous Processes): Add
+       `process-file-shell-command',
+       (Asynchronous Processes): Mention restricted use of
+       `process-filter' and `process-sentinel' in
+       `start-file-process'.  Add `start-file-process-shell-command'.
+
+2007-07-17  Michael Albinus  <michael.albinus@gmx.de>
+
+       * files.texi (Magic File Names): Introduce optional parameter
+       IDENTIFICATION for `file-remote-p'.
+
 2007-07-16  Richard Stallman  <rms@gnu.org>
 
        * display.texi (Defining Faces): Fix previous change.
 
+2007-07-14  Richard Stallman  <rms@gnu.org>
+
+       * control.texi (Handling Errors): Document `debug' in handler list.
+
 2007-07-10  Richard Stallman  <rms@gnu.org>
 
        * display.texi (Defining Faces): Explain C-M-x feature for defface.
 
-2007-06-24  Karl Berry  <karl@tug.org>
+2007-07-09  Richard Stallman  <rms@gnu.org>
+
+       * files.texi (Magic File Names): Rewrite previous change.
+
+2007-07-08  Michael Albinus  <michael.albinus@gmx.de>
+
+       * files.texi (Magic File Names): Introduce optional parameter
+       CONNECTED for `file-remote-p'.
+
+2007-07-07  Michael Albinus  <michael.albinus@gmx.de>
+
+       * processes.texi (Asynchronous Processes):
+       * files.texi (Magic File Names): Add `start-file-process'.
+
+2007-06-27  Richard Stallman  <rms@gnu.org>
+
+       * files.texi (Format Conversion Piecemeal): Clarify
+       `after-insert-file-functions' calling convention.
+
+2007-06-27  Michael Albinus  <michael.albinus@gmx.de>
+
+       * files.texi (Magic File Names): Remove `dired-call-process'.  Add
+       `process-file'.
+
+2007-06-27  Kenichi Handa  <handa@m17n.org>
+
+       * text.texi (Special Properties): Fix description about
+       `compostion' property.
+
+2007-06-26  Kenichi Handa  <handa@m17n.org>
+
+       * nonascii.texi (Default Coding Systems): Document about the
+       return value `undecided'.
+
+2007-06-25  David Kastrup  <dak@gnu.org>
+
+       * keymaps.texi (Active Keymaps): Document new POSITION argument of
+       `current-active-maps'.
+
+2007-06-24  Karl Berry  <karl@gnu.org>
 
        * elisp.texi, vol1.texi, vol2.texi: new Back-Cover Text.
 
+2007-06-15  Juanma Barranquero  <lekktu@gmail.com>
+
+       * display.texi (Overlay Arrow): Doc fix.
+
 2007-06-14  Karl Berry  <karl@tug.org>
 
-       * anti.texi (Antinews): typo.
+       * anti.texi (Antinews): Typo.
+
+2007-06-14  Chong Yidong  <cyd@stupidchicken.com>
+
+       * display.texi (Image Cache): Document image-refresh.
 
 2007-06-12  Karl Berry  <karl@gnu.org>
 
-       * vol1.texi, vol2.texi, two-volume-cross-refs.txt: update.
-       * two-volume.make: new file.
-       * .cvsignore: ignore two-volume files.
+       * vol1.texi, vol2.texi, two-volume-cross-refs.txt: Update.
+       * two-volume.make: New file.
+       * .cvsignore: Ignore two-volume files.
+
+2007-06-12  Tom Tromey  <tromey@redhat.com>
+
+       * os.texi (Init File): Document user-emacs-directory.
+
+2007-06-03  Nick Roberts  <nickrob@snap.net.nz>
+
+       * commands.texi (Click Events): Describe width and height when
+       object is nil.
+
+2007-05-30  Nick Roberts  <nickrob@snap.net.nz>
+
+       * commands.texi (Click Events): Layout more logically.  Describe
+       width and height.
+       (Drag Events, Motion Events): Update to new format for position.
 
 2007-06-02  Richard Stallman  <rms@gnu.org>
 
 
        * modes.texi (Auto Major Mode): Document file-start-mode-alist.
 
+2007-05-10  Thien-Thi Nguyen  <ttn@gnuvola.org>
+
+       * elisp.texi (Top): Remove "Saving Properties" from detailed menu.
+       * files.texi (Format Conversion): Expand intro; add menu.
+       (Format Conversion Overview, Format Conversion Round-Trip)
+       (Format Conversion Piecemeal): New nodes/subsections.
+       * hooks.texi: Xref "Format Conversion" , not "Saving Properties".
+       * text.texi (Text Properties): Remove "Saving Properties" from menu.
+       (Saving Properties): Delete node/subsection.
+
+2007-05-07  Karl Berry  <karl@gnu.org>
+
+       * elisp.texi (EMACSVER): Back to 22.
+
 2007-05-06  Richard Stallman  <rms@gnu.org>
 
        * processes.texi (Accepting Output): Revert most of previous change.
        * tips.texi (Documentation Tips): Rearrange items to place the
        more important ones first.  Add an index entry for hyperlinks.
 
-2007-05-03  Karl Berry  <karl@tug.org>
+2007-05-03  Karl Berry  <karl@gnu.org>
 
        * elisp.texi (\urlcolor, \linkcolor) [smallbook]: \Black for printing.
-        (EMACSVER) [smallbook]: 22 for printed version.
+       (EMACSVER) [smallbook]: 22 for printed version.
 
        * control.texi (Signaling Errors) <signal>: texinfo.tex is fixed,
        so restore anchor to normal position after defun.  Found by Kevin Ryde.
 
+2007-04-26  Glenn Morris  <rgm@gnu.org>
+
+       * elisp.texi (EMACSVER): Increase to 22.1.50.
+
 2007-04-28  Karl Berry  <karl@gnu.org>
 
        * elisp.texi: Improve line breaks on copyright page,
 
 2007-04-11  Karl Berry  <karl@gnu.org>
 
-       * anti.texi (Antinews),
-       * display.texi (Overlay Properties) and (Defining Images),
-       * processes.texi (Synchronous Processes) and (Sentinels),
-       * syntax.texi (Syntax Table Internals),
-       * searching.texi (Regexp Special),
-       * nonascii.texi (Default Coding Systems),
-       * text.texi (Special Properties),
+       * anti.texi (Antinews):
+       * display.texi (Overlay Properties, Defining Images):
+       * processes.texi (Synchronous Processes, Sentinels):
+       * syntax.texi (Syntax Table Internals):
+       * searching.texi (Regexp Special):
+       * nonascii.texi (Default Coding Systems):
+       * text.texi (Special Properties):
        * minibuf.texi (Basic Completion): Wording to improve breaks in
        8.5x11 format.
-       * elisp.texi (smallbook): new @set to more easily switch between
+       * elisp.texi (smallbook): New @set to more easily switch between
        smallbook and 8.5x11.
 
 2007-04-11  Richard Stallman  <rms@gnu.org>
 
 2007-04-01  Karl Berry  <karl@gnu.org>
 
-       * processes.texi (Low-Level Network): typo.
-       * loading.texi (Hooks for Loading): avoid double "the".
-       * keymaps.texi (Key Sequences): no double "and".
-       (Changing Key Bindings): shorten to improve line break.
+       * processes.texi (Low-Level Network): Typo.
+       * loading.texi (Hooks for Loading): Avoid double "the".
+       * keymaps.texi (Key Sequences): No double "and".
+       (Changing Key Bindings): Shorten to improve line break.
 
 2007-03-31  Glenn Morris  <rgm@gnu.org>
 
 
        * loading.texi (How Programs Do Loading): Fix anchor position at
        load-read-function definition doc. (tiny change)
-       
+
 2007-02-21  Kim F. Storm  <storm@cua.dk>
 
        * strings.texi (Text Comparison): Mention that assoc-string
index 8354346..fabe38f 100644 (file)
@@ -1196,12 +1196,7 @@ describe events by their types; thus, if there is a key binding for
 @item @var{position}
 This is the position where the mouse click occurred.  The actual
 format of @var{position} depends on what part of a window was clicked
-on.  The various formats are described below.
-
-@item @var{click-count}
-This is the number of rapid repeated presses so far of the same mouse
-button.  @xref{Repeat Events}.
-@end table
+on.
 
 For mouse click events in the text area, mode line, header line, or in
 the marginal areas, @var{position} has this form:
@@ -1223,8 +1218,14 @@ which the click occurred.  It is one of the symbols @code{mode-line},
 @code{header-line}, @code{vertical-line}, @code{left-margin},
 @code{right-margin}, @code{left-fringe}, or @code{right-fringe}.
 
+In one special case, @var{pos-or-area} is a list containing a symbol (one
+of the symbols listed above) instead of just the symbol.  This happens
+after the imaginary prefix keys for the event are inserted into the
+input stream.  @xref{Key Sequence Input}.
+
+
 @item @var{x}, @var{y}
-These are the pixel-denominated coordinates of the click, relative to
+These are the pixel coordinates of the click, relative to
 the top left corner of @var{window}, which is @code{(0 . 0)}.
 For the mode or header line, @var{y} does not have meaningful data.
 For the vertical line, @var{x} does not have meaningful data.
@@ -1238,6 +1239,7 @@ This is the object on which the click occurred.  It is either
 (@var{string} . @var{string-pos}) when there is a string-type text
 property at the click position.
 
+@table @asis
 @item @var{string}
 This is the string on which the click occurred, including any
 properties.
@@ -1245,6 +1247,7 @@ properties.
 @item @var{string-pos}
 This is the position in the string on which the click occurred,
 relevant if properties at the click need to be looked up.
+@end table
 
 @item @var{text-pos}
 For clicks on a marginal area or on a fringe, this is the buffer
@@ -1263,12 +1266,17 @@ This is the image object on which the click occurred.  It is either
 an image object as returned by @code{find-image} if click was in an image.
 
 @item @var{dx}, @var{dy}
-These are the pixel-denominated coordinates of the click, relative to
+These are the pixel coordinates of the click, relative to
 the top left corner of @var{object}, which is @code{(0 . 0)}.  If
 @var{object} is @code{nil}, the coordinates are relative to the top
 left corner of the character glyph clicked on.
-@end table
 
+@item @var{width}, @var{height}
+These are the pixel width and height of @var{object} or, if this is
+@code{nil}, those of the character glyph clicked on.
+@end table
+@sp 1
 For mouse clicks on a scroll-bar, @var{position} has this form:
 
 @example
@@ -1299,10 +1307,10 @@ of the symbols @code{above-handle}, @code{handle}, @code{below-handle},
 @code{up}, @code{down}, @code{top}, @code{bottom}, and @code{end-scroll}.
 @end table
 
-In one special case, @var{buffer-pos} is a list containing a symbol (one
-of the symbols listed above) instead of just the symbol.  This happens
-after the imaginary prefix keys for the event are inserted into the
-input stream.  @xref{Key Sequence Input}.
+@item @var{click-count}
+This is the number of rapid repeated presses so far of the same mouse
+button.  @xref{Repeat Events}.
+@end table
 
 @node Drag Events
 @subsection Drag Events
@@ -1318,19 +1326,18 @@ position and the final position, like this:
 
 @example
 (@var{event-type}
- (@var{window1} @var{buffer-pos1} (@var{x1} . @var{y1}) @var{timestamp1})
- (@var{window2} @var{buffer-pos2} (@var{x2} . @var{y2}) @var{timestamp2})
- @var{click-count})
+ (@var{window1} START-POSITION)
+ (@var{window2} END-POSITION))
 @end example
 
 For a drag event, the name of the symbol @var{event-type} contains the
-prefix @samp{drag-}.  For example, dragging the mouse with button 2 held
-down generates a @code{drag-mouse-2} event.  The second and third
-elements of the event give the starting and ending position of the drag.
-Aside from that, the data have the same meanings as in a click event
-(@pxref{Click Events}).  You can access the second element of any mouse
-event in the same way, with no need to distinguish drag events from
-others.
+prefix @samp{drag-}.  For example, dragging the mouse with button 2
+held down generates a @code{drag-mouse-2} event.  The second and third
+elements of the event give the starting and ending position of the
+drag.  They have the same form as @var{position} in a click event
+(@pxref{Click Events}) that is not on the scroll bar part of the
+window.  You can access the second element of any mouse event in the
+same way, with no need to distinguish drag events from others.
 
 The @samp{drag-} prefix follows the modifier key prefixes such as
 @samp{C-} and @samp{M-}.
@@ -1470,7 +1477,7 @@ of the mouse without any button activity.  Mouse motion events are
 represented by lists that look like this:
 
 @example
-(mouse-movement (@var{window} @var{buffer-pos} (@var{x} . @var{y}) @var{timestamp}))
+(mouse-movement (POSITION))
 @end example
 
 The second element of the list describes the current position of the
index 4c469a1..e99a632 100644 (file)
@@ -893,6 +893,12 @@ establishing an error handler, with the special form
 This deletes the file named @var{filename}, catching any error and
 returning @code{nil} if an error occurs.
 
+  The @code{condition-case} construct is often used to trap errors that
+are predictable, such as failure to open a file in a call to
+@code{insert-file-contents}.  It is also used to trap errors that are
+totally unpredictable, such as when the program evaluates an expression
+read from the user.
+
   The second argument of @code{condition-case} is called the
 @dfn{protected form}.  (In the example above, the protected form is a
 call to @code{delete-file}.)  The error handlers go into effect when
@@ -920,15 +926,33 @@ the two gets to handle it.
   If an error is handled by some @code{condition-case} form, this
 ordinarily prevents the debugger from being run, even if
 @code{debug-on-error} says this error should invoke the debugger.
-@xref{Error Debugging}.  If you want to be able to debug errors that are
-caught by a @code{condition-case}, set the variable
-@code{debug-on-signal} to a non-@code{nil} value.
 
-  When an error is handled, control returns to the handler.  Before this
-happens, Emacs unbinds all variable bindings made by binding constructs
-that are being exited and executes the cleanups of all
-@code{unwind-protect} forms that are exited.  Once control arrives at
-the handler, the body of the handler is executed.
+  If you want to be able to debug errors that are caught by a
+@code{condition-case}, set the variable @code{debug-on-signal} to a
+non-@code{nil} value.  You can also specify that a particular handler
+should let the debugger run first, by writing @code{debug} among the
+conditions, like this:
+
+@example
+@group
+(condition-case nil
+    (delete-file filename)
+  ((debug error) nil))
+@end group
+@end example
+
+@noindent
+The effect of @code{debug} here is only to prevent
+@code{condition-case} from suppressing the call to the debugger.  Any
+given error will invoke the debugger only if @code{debug-on-error} and
+the other usual filtering mechanisms say it should.  @xref{Error Debugging}.
+
+  Once Emacs decides that a certain handler handles the error, it
+returns control to that handler.  To do so, Emacs unbinds all variable
+bindings made by binding constructs that are being exited, and
+executes the cleanups of all @code{unwind-protect} forms that are
+being exited.  Once control arrives at the handler, the body of the
+handler executes normally.
 
   After execution of the handler body, execution returns from the
 @code{condition-case} form.  Because the protected form is exited
@@ -937,12 +961,6 @@ execution at the point of the error, nor can it examine variable
 bindings that were made within the protected form.  All it can do is
 clean up and proceed.
 
-  The @code{condition-case} construct is often used to trap errors that
-are predictable, such as failure to open a file in a call to
-@code{insert-file-contents}.  It is also used to trap errors that are
-totally unpredictable, such as when the program evaluates an expression
-read from the user.
-
   Error signaling and handling have some resemblance to @code{throw} and
 @code{catch} (@pxref{Catch and Throw}), but they are entirely separate
 facilities.  An error cannot be caught by a @code{catch}, and a
@@ -960,7 +978,8 @@ error occurs during @var{protected-form}.
 
 Each of the @var{handlers} is a list of the form @code{(@var{conditions}
 @var{body}@dots{})}.  Here @var{conditions} is an error condition name
-to be handled, or a list of condition names; @var{body} is one or more
+to be handled, or a list of condition names (which can include @code{debug}
+to allow the debugger to run before the handler); @var{body} is one or more
 Lisp expressions to be executed when this handler handles an error.
 Here are examples of handlers:
 
index 9c3d9d3..84c9ba8 100644 (file)
@@ -3108,7 +3108,7 @@ overwritten.
 
 The overlay-arrow string is displayed in any given buffer if the value
 of @code{overlay-arrow-position} in that buffer points into that
-buffer.  Thus, it works to can display multiple overlay arrow strings
+buffer.  Thus, it is possible to display multiple overlay arrow strings
 by creating buffer-local bindings of @code{overlay-arrow-position}.
 However, it is usually cleaner to use
 @code{overlay-arrow-variable-list} to achieve this result.
index 79c9bda..7b57b8a 100644 (file)
@@ -1064,8 +1064,6 @@ Text Properties
 * Format Properties::       Properties for representing formatting of text.
 * Sticky Properties::       How inserted text gets properties from
                               neighboring text.
-* Saving Properties::       Saving text properties in files, and reading
-                              them back.
 * Lazy Properties::         Computing text properties in a lazy fashion
                               only when text is examined.
 * Clickable Text::          Using text properties to make regions of text
index 0353d44..bfcbe47 100644 (file)
@@ -374,8 +374,7 @@ buffer name instead.
 @end deffn
 
   Saving a buffer runs several hooks.  It also performs format
-conversion (@pxref{Format Conversion}), and may save text properties in
-``annotations'' (@pxref{Saving Properties}).
+conversion (@pxref{Format Conversion}).
 
 @defvar write-file-functions
 The value of this variable is a list of functions to be called before
@@ -496,9 +495,9 @@ and the length of the data inserted.  An error is signaled if
 
 The function @code{insert-file-contents} checks the file contents
 against the defined file formats, and converts the file contents if
-appropriate.  @xref{Format Conversion}.  It also calls the functions in
-the list @code{after-insert-file-functions}; see @ref{Saving
-Properties}.  Normally, one of the functions in the
+appropriate and also calls the functions in
+the list @code{after-insert-file-functions}.  @xref{Format Conversion}.
+Normally, one of the functions in the
 @code{after-insert-file-functions} list determines the coding system
 (@pxref{Coding Systems}) used for decoding the file's contents,
 including end-of-line conversion.
@@ -620,9 +619,10 @@ file name to use for purposes of locking and unlocking, overriding
 @var{filename} and @var{visit} for that purpose.
 
 The function @code{write-region} converts the data which it writes to
-the appropriate file formats specified by @code{buffer-file-format}.
-@xref{Format Conversion}.  It also calls the functions in the list
-@code{write-region-annotate-functions}; see @ref{Saving Properties}.
+the appropriate file formats specified by @code{buffer-file-format}
+and also calls the functions in the list
+@code{write-region-annotate-functions}.
+@xref{Format Conversion}.
 
 Normally, @code{write-region} displays the message @samp{Wrote
 @var{filename}} in the echo area.  If @var{visit} is neither @code{t}
@@ -2587,7 +2587,6 @@ first, before handlers for jobs such as remote file access.
 @code{directory-file-name},
 @code{directory-files},
 @code{directory-files-and-attributes},
-@code{dired-call-process},
 @code{dired-compress-file}, @code{dired-uncache},@*
 @code{expand-file-name},
 @code{file-accessible-directory-p},
@@ -2614,8 +2613,10 @@ first, before handlers for jobs such as remote file access.
 @code{make-directory},
 @code{make-directory-internal},
 @code{make-symbolic-link},@*
+@code{process-file},
 @code{rename-file}, @code{set-file-modes}, @code{set-file-times},
 @code{set-visited-file-modtime}, @code{shell-command},
+@code{start-file-process},
 @code{substitute-in-file-name},@*
 @code{unhandled-file-name-directory},
 @code{vc-registered},
@@ -2633,7 +2634,6 @@ first, before handlers for jobs such as remote file access.
 @code{directory-file-name},
 @code{directory-files},
 @code{directory-files-and-at@discretionary{}{}{}tributes},
-@code{dired-call-process},
 @code{dired-compress-file}, @code{dired-uncache},
 @code{expand-file-name},
 @code{file-accessible-direc@discretionary{}{}{}tory-p},
@@ -2658,8 +2658,10 @@ first, before handlers for jobs such as remote file access.
 @code{load}, @code{make-direc@discretionary{}{}{}tory},
 @code{make-direc@discretionary{}{}{}tory-internal},
 @code{make-symbolic-link},
+@code{process-file},
 @code{rename-file}, @code{set-file-modes},
 @code{set-visited-file-modtime}, @code{shell-command},
+@code{start-file-process},
 @code{substitute-in-file-name},
 @code{unhandled-file-name-directory},
 @code{vc-regis@discretionary{}{}{}tered},
@@ -2766,7 +2768,7 @@ nothing and returns @code{nil}.  Otherwise it returns the file name
 of the local copy file.
 @end defun
 
-@defun file-remote-p filename
+@defun file-remote-p filename &optional identification connected
 This function tests whether @var{filename} is a remote file.  If
 @var{filename} is local (not remote), the return value is @code{nil}.
 If @var{filename} is indeed remote, the return value is a string that
@@ -2775,7 +2777,7 @@ identifies the remote system.
 This identifier string can include a host name and a user name, as
 well as characters designating the method used to access the remote
 system.  For example, the remote identifier string for the filename
-@code{/ssh:user@@host:/some/file} is @code{/ssh:user@@host:}.
+@code{/sudo::/some/file} is @code{/sudo:root@@localhost:}.
 
 If @code{file-remote-p} returns the same identifier for two different
 filenames, that means they are stored on the same file system and can
@@ -2783,6 +2785,18 @@ be accessed locally with respect to each other.  This means, for
 example, that it is possible to start a remote process accessing both
 files at the same time.  Implementors of file handlers need to ensure
 this principle is valid.
+
+@var{identification} specifies which part of the identifier shall be
+returned as string.  @var{identification} can be the symbol
+@code{method}, @code{user} or @code{host}; any other value is handled
+like @code{nil} and means to return the complete identifier string.
+In the example above, the remote @code{user} identifier string would
+be @code{root}.
+
+If @var{connected} is non-@code{nil}, this function returns @code{nil}
+even if @var{filename} is remote, if Emacs has no network connection
+to its host.  This is useful when you want to avoid the delay of
+making connections when they don't exist.
 @end defun
 
 @defun unhandled-file-name-directory filename
@@ -2802,23 +2816,70 @@ is a good way to come up with one.
 @cindex file format conversion
 @cindex encoding file formats
 @cindex decoding file formats
-  The variable @code{format-alist} defines a list of @dfn{file formats},
-which describe textual representations used in files for the data (text,
-text-properties, and possibly other information) in an Emacs buffer.
-Emacs performs format conversion if appropriate when reading and writing
-files.
+@cindex text properties in files
+@cindex saving text properties
+  Emacs performs several steps to convert the data in a buffer (text,
+text properties, and possibly other information) to and from a
+representation suitable for storing into a file.  This section describes
+the fundamental functions that perform this @dfn{format conversion},
+namely @code{insert-file-contents} for reading a file into a buffer,
+and @code{write-region} for writing a buffer into a file.
+
+@menu
+* Overview: Format Conversion Overview.     @code{insert-file-contents} and @code{write-region}
+* Round-Trip: Format Conversion Round-Trip. Using @code{format-alist}.
+* Piecemeal: Format Conversion Piecemeal.   Specifying non-paired conversion.
+@end menu
+
+@node Format Conversion Overview
+@subsection Overview
+@noindent
+The function @code{insert-file-contents}:
+
+@itemize
+@item initially, inserts bytes from the file into the buffer;
+@item decodes bytes to characters as appropriate;
+@item processes formats as defined by entries in @code{format-alist}; and
+@item calls functions in @code{after-insert-file-functions}.
+@end itemize
+
+@noindent
+The function @code{write-region}:
+
+@itemize
+@item initially, calls functions in @code{write-region-annotate-functions};
+@item processes formats as defined by entries in @code{format-alist};
+@item encodes characters to bytes as appropriate; and
+@item modifies the file with the bytes.
+@end itemize
+
+  This shows the symmetry of the lowest-level operations; reading and
+writing handle things in opposite order.  The rest of this section
+describes the two facilities surrounding the three variables named
+above, as well as some related functions.  @ref{Coding Systems}, for
+details on character encoding and decoding.
+
+@node Format Conversion Round-Trip
+@subsection Round-Trip Specification
+
+  The most general of the two facilities is controlled by the variable
+@code{format-alist}, a list of @dfn{file format} specifications, which
+describe textual representations used in files for the data in an Emacs
+buffer.  The descriptions for reading and writing are paired, which is
+why we call this ``round-trip'' specification
+(@pxref{Format Conversion Piecemeal}, for non-paired specification).
 
 @defvar format-alist
 This list contains one format definition for each defined file format.
-@end defvar
-
-@cindex format definition
 Each format definition is a list of this form:
 
 @example
 (@var{name} @var{doc-string} @var{regexp} @var{from-fn} @var{to-fn} @var{modify} @var{mode-fn})
 @end example
+@end defvar
 
+@cindex format definition
+@noindent
 Here is what the elements in a format definition mean:
 
 @table @var
@@ -2957,6 +3018,91 @@ regular save in the same buffer.  This variable is always buffer-local
 in all buffers.
 @end defvar
 
+@node Format Conversion Piecemeal
+@subsection Piecemeal Specification
+
+  In contrast to the round-trip specification described in the previous
+subsection (@pxref{Format Conversion Round-Trip}), you can use the variables
+@code{after-insert-file-functions} and @code{write-region-annotate-functions}
+to separately control the respective reading and writing conversions.
+
+  Conversion starts with one representation and produces another
+representation.  When there is only one conversion to do, there is no
+conflict about what to start with.  However, when there are multiple
+conversions involved, conflict may arise when two conversions need to
+start with the same data.
+
+  This situation is best understood in the context of converting text
+properties during @code{write-region}.  For example, the character at
+position 42 in a buffer is @samp{X} with a text property @code{foo}.  If
+the conversion for @code{foo} is done by inserting into the buffer, say,
+@samp{FOO:}, then that changes the character at position 42 from
+@samp{X} to @samp{F}.  The next conversion will start with the wrong
+data straight away.
+
+  To avoid conflict, cooperative conversions do not modify the buffer,
+but instead specify @dfn{annotations}, a list of elements of the form
+@code{(@var{position} . @var{string})}, sorted in order of increasing
+@var{position}.
+
+  If there is more than one conversion, @code{write-region} merges their
+annotations destructively into one sorted list.  Later, when the text
+from the buffer is actually written to the file, it intermixes the
+specified annotations at the corresponding positions.  All this takes
+place without modifying the buffer.
+
+@c ??? What about ``overriding'' conversions like those allowed
+@c ??? for `write-region-annotate-functions', below?  --ttn
+
+  In contrast, when reading, the annotations intermixed with the text
+are handled immediately.  @code{insert-file-contents} sets point to the
+beginning of some text to be converted, then calls the conversion
+functions with the length of that text.  These functions should always
+return with point at the beginning of the inserted text.  This approach
+makes sense for reading because annotations removed by the first
+converter can't be mistakenly processed by a later converter.
+
+  Each conversion function should scan for the annotations it
+recognizes, remove the annotation, modify the buffer text (to set a text
+property, for example), and return the updated length of the text, as it
+stands after those changes.  The value returned by one function becomes
+the argument to the next function.
+
+@defvar write-region-annotate-functions
+A list of functions for @code{write-region} to call.  Each function in
+the list is called with two arguments: the start and end of the region
+to be written.  These functions should not alter the contents of the
+buffer.  Instead, they should return annotations.
+
+@c ??? Following adapted from comment in `build_annotations' (fileio.c).
+@c ??? Perhaps this is intended for internal use only?
+@c ??? Someone who understands this, please reword it. --ttn
+As a special case, if a function returns with a different buffer
+current, Emacs takes it to mean the current buffer contains altered text
+to be output, and discards all previous annotations because they should
+have been dealt with by this function.
+@end defvar
+
+@defvar after-insert-file-functions
+Each function in this list is called by @code{insert-file-contents}
+with one argument, the number of characters inserted, and with point
+at the beginning of the inserted text.  Each function should leave
+point unchanged, and return the new character count describing the
+inserted text as modified by the function.
+@c ??? The docstring mentions a handler from `file-name-handler-alist'
+@c     "intercepting" `insert-file-contents'.  Hmmm.  --ttn
+@end defvar
+
+  We invite users to write Lisp programs to store and retrieve text
+properties in files, using these hooks, and thus to experiment with
+various data formats and find good ones.  Eventually we hope users
+will produce good, general extensions we can install in Emacs.
+
+  We suggest not trying to handle arbitrary Lisp objects as text property
+names or values---because a program that general is probably difficult
+to write, and slow.  Instead, choose a set of possible data types that
+are reasonably flexible, and not too hard to encode.
+
 @ignore
    arch-tag: 141f74ce-6ae3-40dc-a6c4-ef83fc4ec35c
 @end ignore
index 019777f..572d3b7 100644 (file)
@@ -48,7 +48,7 @@ or their values are used). The variables whose names end in
 @xref{Init File}.
 
 @item after-insert-file-functions
-@xref{Saving Properties}.
+@xref{Format Conversion}.
 
 @item after-make-frame-functions
 @xref{Creating Frames}.
@@ -330,7 +330,7 @@ Manual}.
 @xref{Saving Buffers}.
 
 @item write-region-annotate-functions
-@xref{Saving Properties}.
+@xref{Format Conversion}.
 @end table
 
 @ignore
index 400a2c3..bf20680 100644 (file)
@@ -655,12 +655,15 @@ events within @code{read-key-sequence}.  @xref{Translation Keymaps}.
 
   @xref{Standard Keymaps}, for a list of standard keymaps.
 
-@defun current-active-maps &optional olp
+@defun current-active-maps &optional olp position
 This returns the list of active keymaps that would be used by the
 command loop in the current circumstances to look up a key sequence.
 Normally it ignores @code{overriding-local-map} and
-@code{overriding-terminal-local-map}, but if @var{olp} is
-non-@code{nil} then it pays attention to them.
+@code{overriding-terminal-local-map}, but if @var{olp} is non-@code{nil}
+then it pays attention to them.  @var{position} can optionally be either
+an event position as returned by @code{event-start} or a buffer
+position, and may change the keymaps as described for
+@code{key-binding}.
 @end defun
 
 @defun key-binding key &optional accept-defaults no-remap position
index dd0f15c..a8f45e9 100644 (file)
@@ -1031,6 +1031,9 @@ argument, a list of all arguments passed to
 @code{find-operation-coding-system}.  It must return a coding system
 or a cons cell containing two coding systems.  This value has the same
 meaning as described above.
+
+If @var{coding} (or what returned by the above function) is
+@code{undecided}, the normal code-detection is performed.
 @end defvar
 
 @defvar process-coding-system-alist
index 498cc85..08f94b4 100644 (file)
@@ -258,6 +258,11 @@ actual init file loaded is a compiled file, such as @file{.emacs.elc},
 the value refers to the corresponding source file.
 @end defvar
 
+@defvar user-emacs-directory
+This variable holds the name of the @file{.emacs.d} directory.  It is
+ordinarily @file{~/.emacs.d}, but differs on some platforms.
+@end defvar
+
 @node Terminal-Specific
 @subsection Terminal-Specific Initialization
 @cindex terminal-specific initialization
index 81cac3e..535c8c3 100644 (file)
@@ -432,6 +432,12 @@ arguments to add at the end of @var{command}.  The other arguments
 are handled as in @code{call-process}.
 @end defun
 
+@defun process-file-shell-command command &optional infile destination display &rest args
+This function is like @code{call-process-shell-command}, but uses
+@code{process-file} internally.  Depending on @code{default-directory},
+@var{command} can be executed also on remote hosts.
+@end defun
+
 @defun shell-command-to-string command
 This function executes @var{command} (a string) as a shell command,
 then returns the command's output as a string.
@@ -495,6 +501,27 @@ Process my-process finished
 @end smallexample
 @end defun
 
+@defun start-file-process name buffer-or-name program &rest args
+Like @code{start-process}, this function starts a new asynchronous
+subprocess running @var{program} in it.  The corresponding process
+object is returned.
+
+If @code{default-directory} corresponds to a file handler, that
+handler is invoked.  @var{program} runs then on a remote host which is
+identified by @code{default-directory}.  The local part of
+@code{default-directory} is the working directory of the subprocess.
+
+@var{program} and @var{program-args} might be file names.  They are not
+objects of file handler invocation.
+
+Depending on the implementation of the file handler, it might not be
+possible to apply @code{process-filter} or @code{process-sentinel} to
+the resulting process object (@pxref{Filter Functions}, @pxref{Sentinels}).
+
+Some file handlers may not support @code{start-file-process} (for
+example @code{ange-ftp-hook-function}).  It returns then @code{nil}.
+@end defun
+
 @defun start-process-shell-command name buffer-or-name command &rest command-args
 This function is like @code{start-process} except that it uses a shell
 to execute the specified command.  The argument @var{command} is a shell
@@ -511,6 +538,12 @@ characters do @emph{not} have their special shell meanings.  @xref{Shell
 Arguments}.
 @end defun
 
+@defun start-file-process-shell-command name buffer-or-name command &rest command-args
+This function is like @code{start-process-shell-command}, but uses
+@code{start-file-process} internally.  By this, @var{command} can be
+executed also on remote hosts, depending on @code{default-directory}.
+@end defun
+
 @defvar process-connection-type
 @cindex pipes
 @cindex @acronym{PTY}s
@@ -1309,7 +1342,7 @@ latter specifies one measured in milliseconds.  The two time periods
 thus specified are added together, and @code{accept-process-output}
 returns after that much time, whether or not there has been any
 subprocess output.
-  
+
 The argument @var{millisec} is semi-obsolete nowadays because
 @var{seconds} can be a floating point number to specify waiting a
 fractional number of seconds.  If @var{seconds} is 0, the function
index 10e8c67..7092647 100644 (file)
@@ -650,6 +650,16 @@ Shy groups are particularly useful for mechanically-constructed regular
 expressions because they can be added automatically without altering the
 numbering of any ordinary, non-shy groups.
 
+@item \(?@var{num}: @dots{} \)
+is the @dfn{explicitly numbered group} construct.  Normal groups get
+their number implicitly, based on their position, which can be
+inconvenient.  This construct allows you to force a particular group
+number.  There is no particular restriction on the numbering,
+e.g.@: you can have several groups with the same number in which case
+the last one to match (i.e.@: the rightmost match) will win.
+Implicitly numbered groups always get the smallest integer larger than
+the one of any previous group.
+
 @item \@var{digit}
 matches the same text that matched the @var{digit}th occurrence of a
 grouping (@samp{\( @dots{} \)}) construct.
index 4448e1c..b3cd6cb 100644 (file)
@@ -2574,8 +2574,6 @@ along with the characters; this includes such diverse functions as
 * Format Properties::      Properties for representing formatting of text.
 * Sticky Properties::      How inserted text gets properties from
                              neighboring text.
-* Saving Properties::      Saving text properties in files, and reading
-                             them back.
 * Lazy Properties::        Computing text properties in a lazy fashion
                              only when text is examined.
 * Clickable Text::         Using text properties to make regions of text
@@ -3258,25 +3256,10 @@ Manual}) provides an example.
 @item composition
 @kindex composition @r{(text property)}
 This text property is used to display a sequence of characters as a
-single glyph composed from components.  For instance, in Thai a base
-consonant is composed with the following combining vowel as a single
-glyph.  The value should be a character or a sequence (vector, list,
-or string) of integers.
+single glyph composed from components.  But the value of the property
+itself is completely internal to Emacs and should not be manipulated
+directly by, for instance, @code{put-text-property}.
 
-@itemize @bullet
-@item
-If it is a character, it means to display that character instead of
-the text in the region.
-
-@item
-If it is a string, it means to display that string's contents instead
-of the text in the region.
-
-@item
-If it is a vector or list, the elements are characters interleaved
-with internal codes specifying how to compose the following character
-with the previous one.
-@end itemize
 @end table
 
 @node Format Properties
@@ -3392,75 +3375,6 @@ adjoining text.
   @xref{Insertion}, for the ordinary insertion functions which do not
 inherit.
 
-@node Saving Properties
-@subsection Saving Text Properties in Files
-@cindex text properties in files
-@cindex saving text properties
-
-  You can save text properties in files (along with the text itself),
-and restore the same text properties when visiting or inserting the
-files, using these two hooks:
-
-@defvar write-region-annotate-functions
-This variable's value is a list of functions for @code{write-region} to
-run to encode text properties in some fashion as annotations to the text
-being written in the file.  @xref{Writing to Files}.
-
-Each function in the list is called with two arguments: the start and
-end of the region to be written.  These functions should not alter the
-contents of the buffer.  Instead, they should return lists indicating
-annotations to write in the file in addition to the text in the
-buffer.
-
-Each function should return a list of elements of the form
-@code{(@var{position} . @var{string})}, where @var{position} is an
-integer specifying the relative position within the text to be written,
-and @var{string} is the annotation to add there.
-
-Each list returned by one of these functions must be already sorted in
-increasing order by @var{position}.  If there is more than one function,
-@code{write-region} merges the lists destructively into one sorted list.
-
-When @code{write-region} actually writes the text from the buffer to the
-file, it intermixes the specified annotations at the corresponding
-positions.  All this takes place without modifying the buffer.
-@end defvar
-
-@defvar after-insert-file-functions
-This variable holds a list of functions for @code{insert-file-contents}
-to call after inserting a file's contents.  These functions should scan
-the inserted text for annotations, and convert them to the text
-properties they stand for.
-
-Each function receives one argument, the length of the inserted text;
-point indicates the start of that text.  The function should scan that
-text for annotations, delete them, and create the text properties that
-the annotations specify.  The function should return the updated length
-of the inserted text, as it stands after those changes.  The value
-returned by one function becomes the argument to the next function.
-
-These functions should always return with point at the beginning of
-the inserted text.
-
-The intended use of @code{after-insert-file-functions} is for converting
-some sort of textual annotations into actual text properties.  But other
-uses may be possible.
-@end defvar
-
-We invite users to write Lisp programs to store and retrieve text
-properties in files, using these hooks, and thus to experiment with
-various data formats and find good ones.  Eventually we hope users
-will produce good, general extensions we can install in Emacs.
-
-We suggest not trying to handle arbitrary Lisp objects as text property
-names or values---because a program that general is probably difficult
-to write, and slow.  Instead, choose a set of possible data types that
-are reasonably flexible, and not too hard to encode.
-
-@xref{Format Conversion}, for a related feature.
-
-@c ??? In next edition, merge this info Format Conversion.
-
 @node Lazy Properties
 @subsection Lazy Computation of Text Properties
 
index 1ff2a14..6079a3a 100644 (file)
@@ -4,6 +4,10 @@
 
        * COPYING: Switch to GPLv3.
 
+2007-06-13  Chong Yidong  <cyd@stupidchicken.com>
+
+       * lwlib-Xaw.c, lwlib.c: Link to xaw3d if available.
+
 2007-06-02  Chong Yidong  <cyd@stupidchicken.com>
 
        * Version 22.1 released.
index be1990e..4ef2d3f 100644 (file)
@@ -35,12 +35,21 @@ Boston, MA 02110-1301, USA.  */
 #include <X11/CoreP.h>
 #include <X11/Shell.h>
 
+#ifdef HAVE_XAW3D
+#include <X11/Xaw3d/Scrollbar.h>
+#include <X11/Xaw3d/Paned.h>
+#include <X11/Xaw3d/Dialog.h>
+#include <X11/Xaw3d/Form.h>
+#include <X11/Xaw3d/Command.h>
+#include <X11/Xaw3d/Label.h>
+#else /* !HAVE_XAW3D */
 #include <X11/Xaw/Scrollbar.h>
 #include <X11/Xaw/Paned.h>
 #include <X11/Xaw/Dialog.h>
 #include <X11/Xaw/Form.h>
 #include <X11/Xaw/Command.h>
 #include <X11/Xaw/Label.h>
+#endif /* HAVE_XAW3D */
 
 #include <X11/Xatom.h>
 
index bd5d9ad..542b3ba 100644 (file)
@@ -48,7 +48,11 @@ Boston, MA 02110-1301, USA.  */
 #endif /* not USE_MOTIF && USE_LUCID */
 #endif
 #if defined (USE_XAW)
+#ifdef HAVE_XAW3D
+#include <X11/Xaw3d/Paned.h>
+#else /* !HAVE_XAW3D */
 #include <X11/Xaw/Paned.h>
+#endif /* HAVE_XAW3D */
 #include "lwlib-Xaw.h"
 #endif
 
index 742e200..c25d89a 100644 (file)
        * INSTALL: Fix description about using colors in terminal.
        Fix typos (/Application -> /Applications).
 
+2007-04-26  Glenn Morris  <rgm@gnu.org>
+
+       * Emacs.app/Contents/Resources/English.lproj/InfoPlist.strings:
+       * src/Emacs.r: Increase version to 22.1.50.
+
 2007-04-09  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
        * make-package (compver): Don't hardcode processor type.
index 3989524..2395e82 100644 (file)
@@ -1,3 +1,7 @@
+2007-08-10  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus.texi (NNTP): Mention nntp-xref-number-is-evil.
+
 2007-08-08  Glenn Morris  <rgm@gnu.org>
 
        * glossary.texi (Glossary): Deprecate `iff'.
        * files.texi (File Conveniences): Document point motion keys in Image
        mode.
 
+2007-08-03  Jay Belanger  <jay.p.belanger@gmail.com>
+
+       * calc.texi (Basic Graphics): Mention the graphing of error
+       forms.
+       (Graphics Options): Mention how `g s' handles error forms.
+       (Curve Fitting): Mention plotting the curves.
+       (Standard Nonlinear Models): Add additional models.
+       (Curve Fitting Details): Mention the Levenberg-Marquardt method.
+       (Linear Fits): Correct result.
+
 2007-08-01  Alan Mackenzie  <acm@muc.de>
 
        * cc-mode.texi (Mailing Lists and Bug Reports): Correct "-no-site-file"
        to "--no-site-file".
 
-2007-07-30  Dan Nicolaescu  <dann@ics.uci.edu>
-
-       * vc2-xtra.texi (Customizing VC): Add GIT and HG.
+2007-07-29  Michael Albinus  <michael.albinus@gmx.de>
 
-2007-07-28  Nick Roberts  <nickrob@snap.net.nz>
+       * tramp.texi (Frequently Asked Questions): Point to mode line
+       extension in Emacs 23.1.
 
-       * building.texi (GDB Graphical Interface): Qualify use of "M-x gdba".
+       * trampver.texi: Update release number.
 
 2007-07-27  Glenn Morris  <rgm@gnu.org>
 
        * gpl.texi: New file with text of GPL.
        * Makefile.in (EMACSSOURCES): Add gpl.texi.
 
+2007-07-26  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * vc2-xtra.texi (Customizing VC): Add GIT and HG.
+
+       * dired.texi (Wdired): Mention C-x C-q key binding.
+
+2007-07-28  Nick Roberts  <nickrob@snap.net.nz>
+
+       * building.texi (GDB Graphical Interface): Qualify use of "M-x gdba".
+
 2007-07-25  Glenn Morris  <rgm@gnu.org>
 
        * calc.texi (Copying)
        * calendar.texi (Writing Calendar Files): cal-tex-diary etc only work
        for some calendars.
 
+2007-07-23  Nick Roberts  <nickrob@snap.net.nz>
+
+       * screen.texi (Mode Line): Describe new mode-line flag that shows if
+       default-directory for the current buffer is on a remote machine.
+
+2007-07-22  Michael Albinus  <michael.albinus@gmx.de>
+
+       Sync with Tramp 2.1.10.
+
+       * tramp.texi (trampfn): Expand macro implementation in order to handle
+       empty arguments.
+       (trampfnmhl, trampfnuhl, trampfnhl): Remove macros.  Replace all
+       occurencies by trampfn.
+       (Frequently Asked Questions): Extend example code for host
+       identification in the modeline. Add bbdb to approaches shortening Tramp
+       file names to be typed.
+
+       * trampver.texi: Update release number.
+
+2007-07-21  Eli Zaretskii  <eliz@gnu.org>
+
+       * vc2-xtra.texi (Customizing VC) <vc-handled-backends>: Update the
+       default value.
+
+2007-07-21  Richard Stallman  <rms@gnu.org>
+
+       * files.texi (Why Version Control?): Improve previous change.
+
+2007-07-18  Eric S. Raymond  <esr@snark.thyrsus.com>
+
+       * files.texi (Why Version Control?): New node.
+
+2007-07-17  Michael Albinus  <michael.albinus@gmx.de>
+
+       * tramp.texi: Move @setfilename ../info/tramp up, outside the header
+       section.  Reported by <poti@potis.org>.
+       (Remote processes): Arguments of the program to be debugged are taken
+       literally.
+       (Frequently Asked Questions): Simplify recentf example.
+
+2007-07-14  Karl Berry  <karl@gnu.org>
+
+       * info.texi (@copying): New Back-Cover Text.
+
+       * info.texi (Quitting Info): Move to proper place in source.
+       (Reported by Benno Schulenberg.)
+
 2007-07-13  Eli Zaretskii  <eliz@gnu.org>
 
        * Makefile.in (../info/emacs-mime): Use --enable-encoding.
 
        * emacs-mime.texi: Add @documentencoding directive.
 
+2007-07-12  Nick Roberts  <nickrob@snap.net.nz>
+
+       * tramp.texi (Remote processes): Add an anchor to the subsection
+       "Running a debugger on a remote host".
+
+       * building.texi (Starting GUD): Add xref to this anchor.
+
+2007-07-12  Michael Albinus  <michael.albinus@gmx.de>
+
+       * tramp.texi (Remote processes): Don't call it "experimental" any
+       longer.  Add subsection about running a debugger on a remote host.
+
+2007-07-10  Carsten Dominik  <dominik@science.uva.nl>
+
+       * org.texi (Properties and columns): Chapter rewritten.
+
+2007-07-08  Michael Albinus  <michael.albinus@gmx.de>
+
+       * tramp.texi:
+       * trampver.texi: Migrate to Tramp 2.1.
+
+2007-07-02  Carsten Dominik  <dominik@science.uva.nl>
+
+       * org.texi (Properties): New chapter.
+
 2007-07-02  Reiner Steib  <Reiner.Steib@gmx.de>
 
        * gnus-faq.texi ([3.2]): Fix locating of environment variables in the
 
        * gnus.texi (Asynchronous Fetching): Fix typo.
 
-2007-06-24  Karl Berry  <karl@tug.org>
+2007-06-24  Karl Berry  <karl@gnu.org>
 
        * emacs.texi: new Back-Cover Text.
 
-2007-06-07  Michael Albinus  <michael.albinus@gmx.de>
+2007-06-20  Jay Belanger  <jay.p.belanger@gmail.com>
 
-       Sync with Tramp 2.0.56.
+       * calc.texi:Change ifinfo to ifnottex (as appropriate) throughout.
+       (About This Manual): Remove redundant information.
+       (Getting Started): Mention author.
+       (Basic Arithmetic, Customizing Calc): Make description of the
+       variable `calc-multiplication-has-precedence' match its new effect.
 
-       * tramp.texi (Frequently Asked Questions): Improve ~/.zshrc
-       settings.  Reported by Ted Zlatanov <tzz@lifelogs.com>.
+2007-06-19  Jay Belanger  <jay.p.belanger@gmail.com>
+
+       * calc.texi (Basic Arithmetic, Customizing Calc): Mention
+       the variable `calc-multiplication-has-precedence'.
+
+2007-06-19  Carsten Dominik  <dominik@science.uva.nl>
+
+       * org.texi (Tag): Section swapped with node Timestamps.
+       (Formula syntax for Lisp): Document new `L' flag.
+
+2007-06-06  Andreas Seltenreich  <andreas@gate450.dyndns.org>
+
+       * gnus.texi (Misc Group Stuff, Summary Buffer)
+       (Server Commands, Article Keymap): Fix typo.  s/function/command/.
 
 2007-06-07  Alan Mackenzie  <acm@muc.de>
 
        * message.texi (Message Headers):
        * mh-e.texi (HTML): Fix typos.
 
+2007-06-07  Michael Albinus  <michael.albinus@gmx.de>
+
+       Sync with Tramp 2.0.56.
+
+       * tramp.texi (Frequently Asked Questions): Improve ~/.zshrc
+       settings.  Reported by Ted Zlatanov <tzz@lifelogs.com>.
+
 2007-06-02  Chong Yidong  <cyd@stupidchicken.com>
 
        * Version 22.1 released.
 
        * erc.texi (Modules): Fix references to completion modules.
 
-2007-05-10  Reiner Steib  <Reiner.Steib@gmx.de>
+2007-05-09  Reiner Steib  <Reiner.Steib@gmx.de>
 
        * gnus.texi (Running NNDiary): Use ~/.gnus.el instead of gnusrc.
 
-2007-05-10  Didier Verna  <didier@xemacs.org>
+2007-05-09  Didier Verna  <didier@xemacs.org>
 
        * gnus.texi (Email Based Diary): New.  Proper documentation for the
        nndiary back end and the gnus-diary library.
 
+2007-05-07  Karl Berry  <karl@gnu.org>
+
+       * emacs.texi (EMACSVER): Back to 22.
+
+2007-05-06  Richard Stallman  <rms@gnu.org>
+
+       * maintaining.texi (Create Tags Table): Clean up previous change.
+
 2007-05-05  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * maintaining.texi (Create Tags Table): Add text about the dangers of
-       making symbolic links to tags files.  (Clarified by RMS.)
+       making symbolic links to tags files.
 
-2007-05-04  Karl Berry  <karl@tug.org>
+2007-05-04  Karl Berry  <karl@gnu.org>
 
        * emacs.texi (EMACSVER) [smallbook]: 22.1 for printed version, not 22.
 
-2007-05-03  Karl Berry  <karl@tug.org>
+2007-05-03  Karl Berry  <karl@gnu.org>
 
        * emacs.texi (EMACSVER) [smallbook]: 22 for printed version.
 
 
        * cmdargs.texi (Initial Options): Under --batch, mention --eval.
 
+2007-04-30  Reiner Steib  <Reiner.Steib@gmx.de>
+
+       * gnus.texi (Article Highlighting): Clarify gnus-cite-parse-max-size.
+
 2007-04-28  Glenn Morris  <rgm@gnu.org>
 
        * ack.texi (Acknowledgments):
 
        * files.texi (File Names): Fixes to ~ description on MS systems.
 
-2007-04-28  Karl Berry  <karl@gnu.org>
+2007-04-27  J.D. Smith  <jdsmith@as.arizona.edu>
+
+       * idlwave.texi: Minor updates for IDLWAVE 6.1.
+
+2007-04-26  Glenn Morris  <rgm@gnu.org>
+
+       * emacs.texi (EMACSVER): Increase to 22.1.50.
+
+2007-04-25  Karl Berry  <karl@gnu.org>
 
        * emacs.texi: Improve line breaks on copyright page,
        similar layout to lispref, 8.5x11 by default.
 
        * dired.texi (Image-Dired): Improve line break, fix typo.
 
-2007-04-27  J.D. Smith  <jdsmith@as.arizona.edu>
-
-       * idlwave.texi: Minor updates for IDLWAVE 6.1.
-
 2007-04-24  Chong Yidong  <cyd@stupidchicken.com>
 
        * programs.texi (Program Modes):
index 56d8560..62e5f7b 100644 (file)
@@ -527,6 +527,10 @@ debugger supports.  However, shell wildcards and variables are not
 allowed.  GUD assumes that the first argument not starting with a
 @samp{-} is the executable file name.
 
+Tramp provides a facility to debug programs on remote hosts.
+@xref{Running a debugger on a remote host, Running a debugger on a remote host,, tramp, The Tramp Manual}.
+@c Running a debugger on a remote host
+
 @node Debugger Operation
 @subsection Debugger Operation
 
index e7aa34f..e13dd90 100644 (file)
@@ -124,28 +124,32 @@ Copyright @copyright{} 1990, 1991, 2001, 2002, 2003, 2004,
 @end titlepage
 
 @c [begin]
-@ifinfo
+@ifnottex
 @node Top, Getting Started, (dir), (dir)
 @chapter The GNU Emacs Calculator
 
 @noindent
 @dfn{Calc} is an advanced desk calculator and mathematical tool
-that runs as part of the GNU Emacs environment.
+written by Dave Gillespie that runs as part of the GNU Emacs environment.
 
-This manual is divided into three major parts: ``Getting Started,''
-the ``Calc Tutorial,'' and the ``Calc Reference.''  The Tutorial
-introduces all the major aspects of Calculator use in an easy,
-hands-on way.  The remainder of the manual is a complete reference to
-the features of the Calculator.
+This manual, also written (mostly) by Dave Gillespie, is divided into
+three major parts: ``Getting Started,'' the ``Calc Tutorial,'' and the
+``Calc Reference.''  The Tutorial introduces all the major aspects of
+Calculator use in an easy, hands-on way.  The remainder of the manual is
+a complete reference to the features of the Calculator.
+@end ifnottex
 
+@ifinfo
 For help in the Emacs Info system (which you are using to read this
 file), type @kbd{?}.  (You can also type @kbd{h} to run through a
 longer Info tutorial.)
-
 @end ifinfo
+
 @menu
 * Getting Started::       General description and overview.
+@ifinfo
 * Interactive Tutorial::
+@end ifinfo
 * Tutorial::              A step-by-step introduction for beginners.
 
 * Introduction::          Introduction to the Calc reference manual.
@@ -179,7 +183,12 @@ longer Info tutorial.)
 * Lisp Function Index::   Internal Lisp math functions.
 @end menu
 
+@ifinfo
 @node Getting Started, Interactive Tutorial, Top, Top
+@end ifinfo
+@ifnotinfo
+@node Getting Started, Tutorial, Top, Top
+@end ifnotinfo
 @chapter Getting Started
 @noindent
 This chapter provides a general overview of Calc, the GNU Emacs
@@ -267,12 +276,6 @@ experience with GNU Emacs in order to get the most out of Calc,
 this manual ought to be readable even if you don't know or use Emacs
 regularly.
 
-@ifinfo
-The manual is divided into three major parts:@: the ``Getting
-Started'' chapter you are reading now, the Calc tutorial (chapter 2),
-and the Calc reference manual (the remaining chapters and appendices).
-@end ifinfo
-@iftex
 The manual is divided into three major parts:@: the ``Getting
 Started'' chapter you are reading now, the Calc tutorial (chapter 2),
 and the Calc reference manual (the remaining chapters and appendices).
@@ -280,7 +283,6 @@ and the Calc reference manual (the remaining chapters and appendices).
 @c This manual has been printed in two volumes, the @dfn{Tutorial} and the
 @c @dfn{Reference}.  Both volumes include a copy of the ``Getting Started''
 @c chapter.
-@end iftex
 
 If you are in a hurry to use Calc, there is a brief ``demonstration''
 below which illustrates the major features of Calc in just a couple of
@@ -321,6 +323,7 @@ you can also go to the part of the manual describing any Calc key,
 function, or variable using @w{@kbd{h k}}, @kbd{h f}, or @kbd{h v},
 respectively.  @xref{Help Commands}.
 
+@ifnottex
 The Calc manual can be printed, but because the manual is so large, you
 should only make a printed copy if you really need it.  To print the
 manual, you will need the @TeX{} typesetting program (this is a free
@@ -347,7 +350,7 @@ or
 @example
 dvips calc.dvi
 @end example
-
+@end ifnottex
 @c Printed copies of this manual are also available from the Free Software
 @c Foundation.
 
@@ -543,13 +546,13 @@ system.  Type @kbd{d N} to return to normal notation.
 Type @kbd{7.5}, then @kbd{s l a @key{RET}} to let @expr{a = 7.5} in these formulas.
 (That's a letter @kbd{l}, not a numeral @kbd{1}.)
 
-@iftex
+@ifnotinfo
 @strong{Help functions.}  You can read about any command in the on-line
 manual.  Type @kbd{C-x * c} to return to Calc after each of these
 commands: @kbd{h k t N} to read about the @kbd{t N} command,
 @kbd{h f sqrt @key{RET}} to read about the @code{sqrt} function, and
 @kbd{h s} to read the Calc summary.
-@end iftex
+@end ifnotinfo
 @ifinfo
 @strong{Help functions.}  You can read about any command in the on-line
 manual.  Remember to type the letter @kbd{l}, then @kbd{C-x * c}, to
@@ -1251,9 +1254,12 @@ Press @kbd{1} now to enter the first section of the Tutorial.
 @menu
 * Tutorial::
 @end menu
-@end ifinfo
 
 @node Tutorial, Introduction, Interactive Tutorial, Top
+@end ifinfo
+@ifnotinfo
+@node Tutorial, Introduction, Getting Started, Top
+@end ifnotinfo
 @chapter Tutorial
 
 @noindent
@@ -1272,32 +1278,22 @@ The Quick mode and Keypad mode interfaces are fairly
 self-explanatory.  @xref{Embedded Mode}, for a description of
 the Embedded mode interface.
 
-@ifinfo
-The easiest way to read this tutorial on-line is to have two windows on
-your Emacs screen, one with Calc and one with the Info system.  (If you
-have a printed copy of the manual you can use that instead.)  Press
-@kbd{C-x * c} to turn Calc on or to switch into the Calc window, and
-press @kbd{C-x * i} to start the Info system or to switch into its window.
-Or, you may prefer to use the tutorial in printed form.
-@end ifinfo
-@iftex
 The easiest way to read this tutorial on-line is to have two windows on
 your Emacs screen, one with Calc and one with the Info system.  (If you
 have a printed copy of the manual you can use that instead.)  Press
 @kbd{C-x * c} to turn Calc on or to switch into the Calc window, and
 press @kbd{C-x * i} to start the Info system or to switch into its window.
-@end iftex
 
 This tutorial is designed to be done in sequence.  But the rest of this
 manual does not assume you have gone through the tutorial.  The tutorial
 does not cover everything in the Calculator, but it touches on most
 general areas.
 
-@ifinfo
+@ifnottex
 You may wish to print out a copy of the Calc Summary and keep notes on
 it as you learn Calc.  @xref{About This Manual}, to see how to make a
 printed summary.  @xref{Summary}.
-@end ifinfo
+@end ifnottex
 @iftex
 The Calc Summary at the end of the reference manual includes some blank
 space for your own use.  You may wish to keep notes there as you learn
@@ -1334,13 +1330,13 @@ to control various modes of the Calculator.
 @subsection RPN Calculations and the Stack
 
 @cindex RPN notation
-@ifinfo
+@ifnottex
 @noindent
 Calc normally uses RPN notation.  You may be familiar with the RPN
 system from Hewlett-Packard calculators, FORTH, or PostScript.
 (Reverse Polish Notation, RPN, is named after the Polish mathematician
 Jan Lukasiewicz.)
-@end ifinfo
+@end ifnottex
 @tex
 \noindent
 Calc normally uses RPN notation.  You may be familiar with the RPN
@@ -1769,7 +1765,7 @@ is equivalent to
 @noindent
 or, in large mathematical notation,
 
-@ifinfo
+@ifnottex
 @example
 @group
     3 * 4 * 5
@@ -1778,7 +1774,7 @@ or, in large mathematical notation,
      6 * 7
 @end group
 @end example
-@end ifinfo
+@end ifnottex
 @tex
 \turnoffactive
 \beforedisplay
@@ -3325,7 +3321,7 @@ We can multiply these two matrices in either order to get an identity.
 Matrix inverses are related to systems of linear equations in algebra.
 Suppose we had the following set of equations:
 
-@ifinfo
+@ifnottex
 @group
 @example
     a + 2b + 3c = 6
@@ -3333,7 +3329,7 @@ Suppose we had the following set of equations:
    7a + 6b      = 3
 @end example
 @end group
-@end ifinfo
+@end ifnottex
 @tex
 \turnoffactive
 \beforedisplayh
@@ -3352,7 +3348,7 @@ $$
 @noindent
 This can be cast into the matrix equation,
 
-@ifinfo
+@ifnottex
 @group
 @example
    [ [ 1, 2, 3 ]     [ [ a ]     [ [ 6 ]
@@ -3360,7 +3356,7 @@ This can be cast into the matrix equation,
      [ 7, 6, 0 ] ]     [ c ] ]     [ 3 ] ]
 @end example
 @end group
-@end ifinfo
+@end ifnottex
 @tex
 \turnoffactive
 \beforedisplay
@@ -3425,14 +3421,14 @@ vectors and matrices that include variables.  Solve the following
 system of equations to get expressions for @expr{x} and @expr{y}
 in terms of @expr{a} and @expr{b}.
 
-@ifinfo
+@ifnottex
 @group
 @example
    x + a y = 6
    x + b y = 10
 @end example
 @end group
-@end ifinfo
+@end ifnottex
 @tex
 \turnoffactive
 \beforedisplay
@@ -3456,9 +3452,9 @@ you can't solve @expr{A X = B} directly because the matrix @expr{A}
 is not square for an over-determined system.  Matrix inversion works
 only for square matrices.  One common trick is to multiply both sides
 on the left by the transpose of @expr{A}:
-@ifinfo
+@ifnottex
 @samp{trn(A)*A*X = trn(A)*B}.
-@end ifinfo
+@end ifnottex
 @tex
 \turnoffactive
 $A^T A \, X = A^T B$, where $A^T$ is the transpose \samp{trn(A)}.
@@ -3472,7 +3468,7 @@ solution, which can be regarded as the ``closest'' solution to the set
 of equations.  Use Calc to solve the following over-determined
 system:
 
-@ifinfo
+@ifnottex
 @group
 @example
     a + 2b + 3c = 6
@@ -3481,7 +3477,7 @@ system:
    2a + 4b + 6c = 11
 @end example
 @end group
-@end ifinfo
+@end ifnottex
 @tex
 \turnoffactive
 \beforedisplayh
@@ -3749,11 +3745,11 @@ stored value from the stack.)
 
 In a least squares fit, the slope @expr{m} is given by the formula
 
-@ifinfo
+@ifnottex
 @example
 m = (N sum(x y) - sum(x) sum(y)) / (N sum(x^2) - sum(x)^2)
 @end example
-@end ifinfo
+@end ifnottex
 @tex
 \turnoffactive
 \beforedisplay
@@ -3790,12 +3786,12 @@ this formula uses.
 @end group
 @end smallexample
 
-@ifinfo
+@ifnottex
 @noindent
 These are @samp{sum(x)}, @samp{sum(x^2)}, @samp{sum(y)}, and @samp{sum(x y)},
 respectively.  (We could have used @kbd{*} to compute @samp{sum(x^2)} and
 @samp{sum(x y)}.)
-@end ifinfo
+@end ifnottex
 @tex
 \turnoffactive
 These are $\sum x$, $\sum x^2$, $\sum y$, and $\sum x y$,
@@ -3845,11 +3841,11 @@ Now we grind through the formula:
 That gives us the slope @expr{m}.  The y-intercept @expr{b} can now
 be found with the simple formula,
 
-@ifinfo
+@ifnottex
 @example
 b = (sum(y) - m sum(x)) / N
 @end example
-@end ifinfo
+@end ifnottex
 @tex
 \turnoffactive
 \beforedisplay
@@ -3987,14 +3983,14 @@ The @kbd{C-x * g} command accepts numbers separated by spaces or commas,
 with or without surrounding vector brackets.
 @xref{List Answer 3, 3}. (@bullet{})
 
-@ifinfo
+@ifnottex
 As another example, a theorem about binomial coefficients tells
 us that the alternating sum of binomial coefficients
 @var{n}-choose-0 minus @var{n}-choose-1 plus @var{n}-choose-2, and so
 on up to @var{n}-choose-@var{n},
 always comes out to zero.  Let's verify this
 for @expr{n=6}.
-@end ifinfo
+@end ifnottex
 @tex
 As another example, a theorem about binomial coefficients tells
 us that the alternating sum of binomial coefficients
@@ -5193,12 +5189,12 @@ to be a better approximation than stairsteps.  A third method is
 that the steps are not required to be flat.  Simpson's rule boils
 down to the formula,
 
-@ifinfo
+@ifnottex
 @example
 (h/3) * (f(a) + 4 f(a+h) + 2 f(a+2h) + 4 f(a+3h) + ...
               + 2 f(a+(n-2)*h) + 4 f(a+(n-1)*h) + f(a+n*h))
 @end example
-@end ifinfo
+@end ifnottex
 @tex
 \turnoffactive
 \beforedisplay
@@ -5215,12 +5211,12 @@ is the width of each slice.  These are 10 and 0.1 in our example.
 For reference, here is the corresponding formula for the stairstep
 method:
 
-@ifinfo
+@ifnottex
 @example
 h * (f(a) + f(a+h) + f(a+2h) + f(a+3h) + ...
           + f(a+(n-2)*h) + f(a+(n-1)*h))
 @end example
-@end ifinfo
+@end ifnottex
 @tex
 \turnoffactive
 \beforedisplay
@@ -5657,11 +5653,11 @@ so that @expr{2 - 3 (x + y) + x y} is a sum of three terms.)
 infinite series that exactly equals the value of that function at
 values of @expr{x} near zero.
 
-@ifinfo
+@ifnottex
 @example
 cos(x) = 1 - x^2 / 2! + x^4 / 4! - x^6 / 6! + ...
 @end example
-@end ifinfo
+@end ifnottex
 @tex
 \turnoffactive
 \beforedisplay
@@ -5675,11 +5671,11 @@ Calc represents the truncated Taylor series as a polynomial in @expr{x}.
 Mathematicians often write a truncated series using a ``big-O'' notation
 that records what was the lowest term that was truncated.
 
-@ifinfo
+@ifnottex
 @example
 cos(x) = 1 - x^2 / 2! + O(x^3)
 @end example
-@end ifinfo
+@end ifnottex
 @tex
 \turnoffactive
 \beforedisplay
@@ -6204,11 +6200,11 @@ equations numerically is @dfn{Newton's Method}.  Given the equation
 @expr{x_0} which is reasonably close to the desired solution, apply
 this formula over and over:
 
-@ifinfo
+@ifnottex
 @example
 new_x = x - f(x)/f'(x)
 @end example
-@end ifinfo
+@end ifnottex
 @tex
 \beforedisplay
 $$ x_{\rm new} = x - {f(x) \over f'(x)} $$
@@ -6242,11 +6238,11 @@ is defined as the derivative of
 @infoline @expr{ln(gamma(z))}.  
 For large values of @expr{z}, it can be approximated by the infinite sum
 
-@ifinfo
+@ifnottex
 @example
 psi(z) ~= ln(z) - 1/2z - sum(bern(2 n) / 2 n z^(2 n), n, 1, inf)
 @end example
-@end ifinfo
+@end ifnottex
 @tex
 \beforedisplay
 $$ \psi(z) \approx \ln z - {1\over2z} -
@@ -6305,13 +6301,13 @@ a way to convert from this form back to the standard algebraic form.
 (@bullet{}) @strong{Exercise 11.}  The @dfn{Stirling numbers of the
 first kind} are defined by the recurrences,
 
-@ifinfo
+@ifnottex
 @example
 s(n,n) = 1   for n >= 0,
 s(n,0) = 0   for n > 0,
 s(n+1,m) = s(n,m-1) - n s(n,m)   for n >= m >= 1.
 @end example
-@end ifinfo
+@end ifnottex
 @tex
 \turnoffactive
 \beforedisplay
@@ -6843,14 +6839,14 @@ get the row sum.  Similarly, use @kbd{[1 1] r 4 *} to get the column sum.
 @node Matrix Answer 2, Matrix Answer 3, Matrix Answer 1, Answers to Exercises
 @subsection Matrix Tutorial Exercise 2
 
-@ifinfo
+@ifnottex
 @example
 @group
    x + a y = 6
    x + b y = 10
 @end group
 @end example
-@end ifinfo
+@end ifnottex
 @tex
 \turnoffactive
 \beforedisplay
@@ -6905,7 +6901,7 @@ now, we have a system
 @infoline @expr{A2 * X = B2} 
 which we can solve using Calc's @samp{/} command.
 
-@ifinfo
+@ifnottex
 @example
 @group
     a + 2b + 3c = 6
@@ -6914,7 +6910,7 @@ which we can solve using Calc's @samp{/} command.
    2a + 4b + 6c = 11
 @end group
 @end example
-@end ifinfo
+@end ifnottex
 @tex
 \turnoffactive
 \beforedisplayh
@@ -7045,11 +7041,11 @@ vector.
 Given @expr{x} and @expr{y} vectors in quick variables 1 and 2 as before,
 the first job is to form the matrix that describes the problem.
 
-@ifinfo
+@ifnottex
 @example
    m*x + b*1 = y
 @end example
-@end ifinfo
+@end ifnottex
 @tex
 \turnoffactive
 \beforedisplay
@@ -7836,11 +7832,11 @@ Why does this work?  Think about a two-step computation:
 subtracting off enough 511's to put the result in the desired range.
 So the result when we take the modulo after every step is,
 
-@ifinfo
+@ifnottex
 @example
 3 (3 a + b - 511 m) + c - 511 n
 @end example
-@end ifinfo
+@end ifnottex
 @tex
 \turnoffactive
 \beforedisplay
@@ -7852,11 +7848,11 @@ $$ 3 (3 a + b - 511 m) + c - 511 n $$
 for some suitable integers @expr{m} and @expr{n}.  Expanding out by
 the distributive law yields
 
-@ifinfo
+@ifnottex
 @example
 9 a + 3 b + c - 511*3 m - 511 n
 @end example
-@end ifinfo
+@end ifnottex
 @tex
 \turnoffactive
 \beforedisplay
@@ -7870,11 +7866,11 @@ contribution it makes could just as easily be made by the @expr{n}
 term.  So we can take it out to get an equivalent formula with
 @expr{n' = 3m + n},
 
-@ifinfo
+@ifnottex
 @example
 9 a + 3 b + c - 511 n'
 @end example
-@end ifinfo
+@end ifnottex
 @tex
 \turnoffactive
 \beforedisplay
@@ -11285,7 +11281,7 @@ from 1 to 8.  Interval arithmetic is used to get a worst-case estimate
 of the possible range of values a computation will produce, given the
 set of possible values of the input.
 
-@ifinfo
+@ifnottex
 Calc supports several varieties of intervals, including @dfn{closed}
 intervals of the type shown above, @dfn{open} intervals such as
 @samp{(2 ..@: 4)}, which represents the range of numbers from 2 to 4
@@ -11296,7 +11292,7 @@ terms,
 @samp{[2 ..@: 4)} represents @expr{2 <= x < 4},
 @samp{(2 ..@: 4]} represents @expr{2 < x <= 4}, and
 @samp{(2 ..@: 4)} represents @expr{2 < x < 4}.
-@end ifinfo
+@end ifnottex
 @tex
 Calc supports several varieties of intervals, including \dfn{closed}
 intervals of the type shown above, \dfn{open} intervals such as
@@ -11929,14 +11925,14 @@ commands, @kbd{t h} works only when Calc Trail is the selected window.
 @pindex calc-trail-isearch-forward
 @kindex t r
 @pindex calc-trail-isearch-backward
-@ifinfo
+@ifnottex
 The @kbd{t s} (@code{calc-trail-isearch-forward}) and @kbd{t r}
 (@code{calc-trail-isearch-backward}) commands perform an incremental
 search forward or backward through the trail.  You can press @key{RET}
 to terminate the search; the trail pointer moves to the current line.
 If you cancel the search with @kbd{C-g}, the trail pointer stays where
 it was when the search began.
-@end ifinfo
+@end ifnottex
 @tex
 The @kbd{t s} (@code{calc-trail-isearch-forward}) and @kbd{t r}
 (@code{calc-trail-isearch-backward}) com\-mands perform an incremental
@@ -14237,10 +14233,10 @@ font information.
 Also, the ``discretionary multiplication sign'' @samp{\*} is read
 the same as @samp{*}.
 
-@ifinfo
+@ifnottex
 The @TeX{} version of this manual includes some printed examples at the
 end of this section.
-@end ifinfo
+@end ifnottex
 @iftex
 Here are some examples of how various Calc formulas are formatted in @TeX{}:
 
@@ -15975,9 +15971,28 @@ whereas @w{@samp{[-2 ..@: 3] ^ 2}} is @samp{[0 ..@: 9]}.
 @mindex @null
 @end ignore
 @tindex /
-The @kbd{/} (@code{calc-divide}) command divides two numbers.  Note that
-when using algebraic entry, @samp{/} has lower precedence than @samp{*}, 
-so that @samp{a/b*c} is interpreted as @samp{a/(b*c)}.
+The @kbd{/} (@code{calc-divide}) command divides two numbers.  
+
+When combining multiplication and division in an algebraic formula, it
+is good style to use parentheses to distinguish between possible
+interpretations; the expression @samp{a/b*c} should be written
+@samp{(a/b)*c} or @samp{a/(b*c)}, as appropriate.  Without the
+parentheses, Calc will interpret @samp{a/b*c} as @samp{a/(b*c)}, since
+in algebraic entry Calc gives division a lower precedence than
+multiplication. (This is not standard across all computer languages, and
+Calc may change the precedence depending on the language mode being used.  
+@xref{Language Modes}.)  This default ordering can be changed by setting
+the customizable variable @code{calc-multiplication-has-precedence} to
+@code{nil} (@pxref{Customizing Calc}); this will give multiplication and
+division equal precedences.  Note that Calc's default choice of
+precedence allows @samp{a b / c d} to be used as a shortcut for
+@smallexample
+@group
+a b
+---.
+c d
+@end group
+@end smallexample
 
 When dividing a scalar @expr{B} by a square matrix @expr{A}, the
 computation performed is @expr{B} times the inverse of @expr{A}.  This
@@ -17637,7 +17652,7 @@ formulas below for symbolic arguments only when you use the @kbd{a "}
 (@code{calc-expand-formula}) command, or when taking derivatives or
 integrals or solving equations involving the functions.
 
-@ifinfo
+@ifnottex
 These formulas are shown using the conventions of Big display
 mode (@kbd{d B}); for example, the formula for @code{fv} written
 linearly is @samp{pmt * ((1 + rate)^n) - 1) / rate}.
@@ -17717,7 +17732,7 @@ syd(cost, salv, life, per) = --------------------------------
 ddb(cost, salv, life, per) = --------,  book = cost - depreciation so far
                                life
 @end example
-@end ifinfo
+@end ifnottex
 @tex
 \turnoffactive
 $$ \code{fv}(r, n, p) = p { (1 + r)^n - 1 \over r } $$
@@ -18366,14 +18381,14 @@ some authors, is computed by the @kbd{I f G} [@code{gammaQ}] command.
 You can think of this as taking the other half of the integral, from
 @expr{x} to infinity.
 
-@ifinfo
+@ifnottex
 The functions corresponding to the integrals that define @expr{P(a,x)}
 and @expr{Q(a,x)} but without the normalizing @expr{1/gamma(a)}
 factor are called @expr{g(a,x)} and @expr{G(a,x)}, respectively
 (where @expr{g} and @expr{G} represent the lower- and upper-case Greek
 letter gamma).  You can obtain these using the @kbd{H f G} [@code{gammag}]
 and @kbd{H I f G} [@code{gammaG}] commands.
-@end ifinfo
+@end ifnottex
 @tex
 \turnoffactive
 The functions corresponding to the integrals that define $P(a,x)$
@@ -18889,10 +18904,10 @@ real numbers by
 @kindex H k c
 @pindex calc-perm
 @tindex perm
-@ifinfo
+@ifnottex
 The @kbd{H k c} (@code{calc-perm}) [@code{perm}] command computes the
 number-of-permutations function @expr{N! / (N-M)!}.
-@end ifinfo
+@end ifnottex
 @tex
 The \kbd{H k c} (\code{calc-perm}) [\code{perm}] command computes the
 number-of-perm\-utations function $N! \over (N-M)!\,$.
@@ -23132,13 +23147,13 @@ integral of the expression on top of the stack.  In this case, the
 command will again prompt for an integration variable, then prompt for a
 lower limit and an upper limit.
 
-@ifinfo
+@ifnottex
 If you use the @code{integ} function directly in an algebraic formula,
 you can also write @samp{integ(f,x,v)} which expresses the resulting
 indefinite integral in terms of variable @code{v} instead of @code{x}.
 With four arguments, @samp{integ(f(x),x,a,b)} represents a definite
 integral from @code{a} to @code{b}.
-@end ifinfo
+@end ifnottex
 @tex
 If you use the @code{integ} function directly in an algebraic formula,
 you can also write @samp{integ(f,x,v)} which expresses the resulting
@@ -23947,7 +23962,13 @@ such as @expr{y = m x + b} where @expr{m} and @expr{b} are parameters
 to be determined.  For a typical set of measured data there will be
 no single @expr{m} and @expr{b} that exactly fit the data; in this
 case, Calc chooses values of the parameters that provide the closest
-possible fit.
+possible fit.  The model formula can be entered in various ways after
+the key sequence @kbd{a F} is pressed.  
+
+If the letter @kbd{P} is pressed after @kbd{a F} but before the model
+description is entered, the data as well as the model formula will be
+plotted after the formula is determined.  This will be indicated by a
+``P'' in the minibuffer after the help message.
 
 @menu
 * Linear Fits::
@@ -24019,14 +24040,14 @@ name only those and let the parameters use default names.
 
 For example, suppose the data matrix
 
-@ifinfo
+@ifnottex
 @example
 @group
 [ [ 1, 2, 3, 4,  5  ]
   [ 5, 7, 9, 11, 13 ] ]
 @end group
 @end example
-@end ifinfo
+@end ifnottex
 @tex
 \turnoffactive
 \turnoffactive
@@ -24040,7 +24061,7 @@ $$
 @noindent
 is on the stack and we wish to do a simple linear fit.  Type
 @kbd{a F}, then @kbd{1} for the model, then @key{RET} to use
-the default names.  The result will be the formula @expr{3 + 2 x}
+the default names.  The result will be the formula @expr{3. + 2. x}
 on the stack.  Calc has created the model expression @kbd{a + b x},
 then found the optimal values of @expr{a} and @expr{b} to fit the
 data.  (In this case, it was able to find an exact fit.)  Calc then
@@ -24083,11 +24104,11 @@ Calc has chosen a line that best approximates the data points using
 the method of least squares.  The idea is to define the @dfn{chi-square}
 error measure
 
-@ifinfo
+@ifnottex
 @example
 chi^2 = sum((y_i - (a + b x_i))^2, i, 1, N)
 @end example
-@end ifinfo
+@end ifnottex
 @tex
 \turnoffactive
 \beforedisplay
@@ -24230,6 +24251,8 @@ case, the model might be @expr{a x + b y + c z}; and in the polynomial
 case, the model could be @expr{a x + b x^2 + c x^3}.  You can get
 a homogeneous linear or multilinear model by pressing the letter
 @kbd{h} followed by a regular model key, like @kbd{1} or @kbd{2}.
+This will be indicated by an ``h'' in the minibuffer after the help
+message.
 
 It is certainly possible to have other constrained linear models,
 like @expr{2.3 + a x} or @expr{a - 4 x}.  While there is no single
@@ -24272,11 +24295,11 @@ then the
 @infoline @expr{chi^2}
 statistic is now,
 
-@ifinfo
+@ifnottex
 @example
 chi^2 = sum(((y_i - (a + b x_i)) / sigma_i)^2, i, 1, N)
 @end example
-@end ifinfo
+@end ifnottex
 @tex
 \turnoffactive
 \beforedisplay
@@ -24439,6 +24462,18 @@ Quadratic.  @mathit{a + b (x-c)^2 + d (x-e)^2}.
 Gaussian.  
 @texline @math{{a \over b \sqrt{2 \pi}} \exp\left( -{1 \over 2} \left( x - c \over b \right)^2 \right)}.
 @infoline @mathit{(a / b sqrt(2 pi)) exp(-0.5*((x-c)/b)^2)}.
+@item s
+Logistic @emph{s} curve.
+@texline @math{a/(1+e^{b(x-c)})}.
+@infoline @mathit{a/(1 + exp(b (x - c)))}.
+@item b
+Logistic bell curve.
+@texline @math{ae^{b(x-c)}/(1+e^{b(x-c)})^2}.
+@infoline @mathit{a exp(b (x - c))/(1 + exp(b (x - c)))^2}.
+@item o
+Hubbert linearization.
+@texline @math{{y \over x} = a(1-x/b)}.
+@infoline @mathit{(y/x) = a (1 - x/b)}.
 @end table
 
 All of these models are used in the usual way; just press the appropriate
@@ -24447,8 +24482,9 @@ result will be a formula as shown in the above table, with the best-fit
 values of the parameters substituted.  (You may find it easier to read
 the parameter values from the vector that is placed in the trail.)
 
-All models except Gaussian and polynomials can generalize as shown to any
-number of independent variables.  Also, all the built-in models have an
+All models except Gaussian, logistics, Hubbert and polynomials can
+generalize as shown to any number of independent variables.  Also, all
+the built-in models except for the logistic and Hubbert curves have an 
 additive or multiplicative parameter shown as @expr{a} in the above table
 which can be replaced by zero or one, as appropriate, by typing @kbd{h}
 before the model key.
@@ -24588,7 +24624,7 @@ to convert the model into this form.  For example, if the model
 is @expr{a + b x + c x^2}, then @expr{f(x) = 1}, @expr{g(x) = x},
 and @expr{h(x) = x^2} are suitable functions.
 
-For other models, Calc uses a variety of algebraic manipulations
+For most other models, Calc uses a variety of algebraic manipulations
 to try to put the problem into the form
 
 @smallexample
@@ -24647,7 +24683,12 @@ The Gaussian model looks quite complicated, but a closer examination
 shows that it's actually similar to the quadratic model but with an
 exponential that can be brought to the top and moved into @expr{Y}.
 
-An example of a model that cannot be put into general linear
+The logistic models cannot be put into general linear form.  For these
+models, and the Hubbert linearization, Calc computes a rough
+approximation for the parameters, then uses the Levenberg-Marquardt
+iterative method to refine the approximations.
+
+Another model that cannot be put into general linear
 form is a Gaussian with a constant background added on, i.e.,
 @expr{d} + the regular Gaussian formula.  If you have a model like
 this, your best bet is to replace enough of your parameters with
@@ -27594,9 +27635,9 @@ The unit @code{A} stands for Amperes; the name @code{Ang} is used
 @tex
 for \AA ngstroms.
 @end tex
-@ifinfo
+@ifnottex
 for Angstroms.
-@end ifinfo
+@end ifnottex
 
 The unit @code{pt} stands for pints; the name @code{point} stands for
 a typographical point, defined by @samp{72 point = 1 in}.  This is
@@ -28402,7 +28443,10 @@ variables.
 
 The ``x'' and ``y'' values for the data points (as pulled from the vectors,
 calculated from the formulas, or interpolated from the intervals) should
-be real numbers (integers, fractions, or floats).  If either the ``x''
+be real numbers (integers, fractions, or floats).  One exception to this
+is that the ``y'' entry can consist of a vector of numbers combined with
+error forms, in which case the points will be plotted with the
+appropriate error bars.  Other than this, if either the ``x''
 value or the ``y'' value of a given data point is not a real number, that
 data point will be omitted from the graph.  The points on either side
 of the invalid point will @emph{not} be connected by a line.
@@ -28800,7 +28844,9 @@ available for any device.
 The @kbd{g S} (@code{calc-graph-point-style}) command similarly turns
 the symbols at the data points on or off, or sets the point style.
 If you turn both lines and points off, the data points will show as
-tiny dots.
+tiny dots.  If the ``y'' values being plotted contain error forms and 
+the connecting lines are turned off, then this command will also turn 
+the error bars on or off.
 
 @cindex @code{LineStyles} variable
 @cindex @code{PointStyles} variable
@@ -34510,10 +34556,9 @@ See @ref{Graphics}.@*
 The variable @code{calc-gnuplot-name} should be the name of the
 GNUPLOT program (a string).  If you have GNUPLOT installed on your
 system but Calc is unable to find it, you may need to set this
-variable.  (@pxref{Customizing Calc})
-You may also need to set some Lisp variables to show Calc how to run
-GNUPLOT on your system, see @ref{Devices, ,Graphical Devices} .  The default value
-of @code{calc-gnuplot-name} is @code{"gnuplot"}.
+variable.  You may also need to set some Lisp variables to show Calc how
+to run GNUPLOT on your system, see @ref{Devices, ,Graphical Devices} .
+The default value of @code{calc-gnuplot-name} is @code{"gnuplot"}.
 @end defvar
 
 @defvar  calc-gnuplot-plot-command
@@ -34769,6 +34814,18 @@ should also be added to @code{calc-embedded-announce-formula-alist}
 and @code{calc-embedded-open-close-plain-alist}.
 @end defvar
 
+@defvar calc-multiplication-has-precedence
+The variable @code{calc-multiplication-has-precedence} determines
+whether multiplication has precedence over division in algebraic formulas
+in normal language modes.  If @code{calc-multiplication-has-precedence}
+is non-@code{nil}, then multiplication has precedence, and so for
+example @samp{a/b*c} will be interpreted as @samp{a/(b*c)}. If
+@code{calc-multiplication-has-precedence} is @code{nil}, then
+multiplication has the same precedence as division, and so for example
+@samp{a/b*c} will be interpreted as @samp{(a/b)*c}.  The default value
+of @code{calc-multiplication-has-precedence} is @code{t}.
+@end defvar
+
 @node Reporting Bugs, Summary, Customizing Calc, Top
 @appendix Reporting Bugs
 
index 5088be2..3dda3f5 100644 (file)
@@ -1152,7 +1152,7 @@ and erases all flags and marks.
 @findex wdired-change-to-wdired-mode
   Wdired is a special mode that allows you to perform file operations
 by editing the Dired buffer directly (the ``W'' in ``Wdired'' stands
-for ``writable.'')  To enter Wdired mode, type @kbd{M-x
+for ``writable.'')  To enter Wdired mode, type @kbd{C-x C-q} or @kbd{M-x
 wdired-change-to-wdired-mode} while in a Dired buffer.  Alternatively,
 use @samp{Edit File Names} in the @samp{Immediate} menu bar menu.
 
index 5fc84d0..7e1adb1 100644 (file)
@@ -51,7 +51,7 @@ developing GNU and promoting software freedom.''
 @tex
 @ifset smallbook
 @fonttextsize 10
-@set EMACSVER 22.1
+@set EMACSVER 22
 \global\let\urlcolor=\Black % don't print links in grayscale
 \global\let\linkcolor=\Black
 @end ifset
index dd2b445..7ba3691 100644 (file)
@@ -1258,11 +1258,32 @@ this section if you are already familiar with the version control system
 you want to use.
 
 @menu
+* Why Version Control?:: Understanding the problems it addresses
 * Version Systems::  Supported version control back-end systems.
 * VC Concepts::      Words and concepts related to version control.
 * Types of Log File::    The per-file VC log in contrast to the ChangeLog.
 @end menu
 
+@node Why Version Control?
+@subsubsection Understanding the problems it addresses
+
+  Version control systems provide you with three important capabilities: 
+reversibility, concurrency, and history.
+
+  The most basic capability you get from a version-control system is
+reversibility, the ability to back up to a saved, known-good state when
+you discover that some modification you did was a mistake or a bad idea.
+
+  Version-control systems also support concurrency, the ability to
+have many people modifying the same collection of code or documents
+knowing that conflicting modifications can be detected and resolved.
+
+  Version-control systems give you the capability to attach a history
+to your data, explanatory comments about the intention behind each 
+change to it.  Even for a programmer working solo change histories
+are an important aid to memory; for a multi-person project they 
+become a vitally important form of communication among developers.
+
 @node Version Systems
 @subsubsection Supported Version Control Systems
 
@@ -1351,34 +1372,97 @@ After you are done with a set of changes, you @dfn{check the file in},
 which records the changes in the master file, along with a log entry for
 them.
 
-  With CVS, there are usually multiple work files corresponding to a
-single master file---often each user has his own copy.  It is also
-possible to use RCS in this way, but this is not the usual way to use
-RCS.
+  To go beyond these basic concepts, you will need to understand three
+ways in which version-control systems can differ from each other.  They
+can be locking or merging; they can be file-based or changeset-based;
+and they can be centralized or decentralized.  VC handles all these
+choices, but they lead to differing behaviors which you will need
+to understand as you use it.
 
-@cindex locking and version control
+@cindex locking versus merging
   A version control system typically has some mechanism to coordinate
 between users who want to change the same file.  One method is
 @dfn{locking} (analogous to the locking that Emacs uses to detect
-simultaneous editing of a file, but distinct from it).  The other method
-is to merge your changes with other people's changes when you check them
-in.
+simultaneous editing of a file, but distinct from it).  In a locking
+system, such as SCCS, you must @dfn{lock} a file before you start to
+edit it.  The other method is @dfn{merging}; the system tries to 
+merge your changes with other people's changes when you check them in.
 
   With version control locking, work files are normally read-only so
 that you cannot change them.  You ask the version control system to make
 a work file writable for you by locking it; only one user can do
 this at any given time.  When you check in your changes, that unlocks
 the file, making the work file read-only again.  This allows other users
-to lock the file to make further changes.  SCCS always uses locking, and
-RCS normally does.
-
-  The other alternative for RCS is to let each user modify the work file
-at any time.  In this mode, locking is not required, but it is
-permitted; check-in is still the way to record a new version.
+to lock the file to make further changes.
+
+  By contrast, a merging system lets each user check out and modify a
+work file at any time.  When you check in a a file, the system will
+attempt to merge your changes with any others checked into the
+repository since you checked out the file.
+
+  Both locking and merging systems can have problems when multiple users
+try to modify the same file at the same time.  Locking systems have
+@dfn{lock conflicts}; a user may try to check a file out and be unable
+to because it is locked.  In merging systems, @dfn{merge conflicts}
+happen when you check in a change to a file that conflicts with a change
+checked in by someone else after your checkout.  Both kinds of conflict
+have to be resolved by human judgment and communication.
+
+  SCCS always uses locking. RCS is lock-based by default but can be told
+to operate in a merging style.  CVS is merge-based by default but can
+be told to operate in a locking mode.  Most later version-control
+systems, such as Subversion and GNU Arch, have been fundamentally
+merging-based rather than locking-based.  This is because experience
+has shown that the merging-based approach is generally superior to
+the locking one, both in convenience to developers and in minimizing
+the number and severity of conflicts that actually occur.
+
+   While it is rather unlikely that anyone will ever again build a
+fundamentally locking-based rather than merging-based version-control
+system in the future, merging-based version-systems sometimes have locks
+retrofitted onto them for reasons having nothing to do with technology.
+@footnote{Usually the control-freak instincts of managers.}  For this
+reason, and to support older systems still in use, VC mode supports
+both locking and merging version control and tries to hide the differences
+between them as much as possible.
+
+@cindex files versus changesets.
+  On SCCS, RCS, CVS, and other early version-control systems, checkins
+and other operations are @dfn{file-based}; each file has its own
+@dfn{master file} with its own comment- and revision history separate
+from that of all other files in the system.  Later systems, beginning
+with Subversion, are @dfn{changeset-based}; a checkin may include
+changes to several files and that change set is treated as a unit by the
+system.  Any comment associated with the change doesn't belong to any
+one file, but is attached to the changeset itself.
+
+  Changeset-based version control is in general both more flexible and
+more powerful than file-based version control; usually, when a change to
+multiple files has to be backed out, it's good to be able to easily
+identify and remove all of it.
+
+@cindex centralized vs. decentralized
+  Early version-control systems were designed around a @dfn{centralized}
+model in which each project has only one repository used by all
+developers.  SCCS, RCS, CVS, and Subversion share this kind of model.
+It has two important problems. One is that a single repository is a
+single point of failure---if the repository server is down all work
+stops.  The other is that you need to be connected live to the server to
+do checkins and checkouts; if you're offline, you can't work.
+
+  Newer version-control systems like GNU Arch are @dfn{decentralized}.
+A project may have several different repositories, and these systems
+support a sort of super-merge between repositories that tries to
+reconcile their change histories.  At the limit, each developer has
+his/her own repository, and repository merges replace checkin/commit
+operations.
+
+  VC's job is to help you manage the traffic between your personal
+workfiles and a repository.  Whether that repository is a single master
+or one of a network of peer repositories is not something VC has to care
+about.  Thus, the difference between a centralized and a decentralized
+version-control system is invisible to VC mode.
 
-  CVS normally allows each user to modify his own copy of the work file
-at any time, but requires merging with changes from other users at
-check-in time.  However, CVS can also be set up to require locking.
 @iftex
 (@pxref{CVS Options,,,emacs-xtra, Specialized Emacs Features}).
 @end iftex
index ff8371d..94144b6 100644 (file)
@@ -12945,6 +12945,34 @@ network is fast, setting this variable to a really small number means
 that fetching will probably be slower.  If this variable is @code{nil},
 @code{nntp} will never split requests.  The default is 5.
 
+@item nntp-xref-number-is-evil
+@vindex nntp-xref-number-is-evil
+When Gnus refers to an article having the @code{Message-ID} that a user
+specifies or having the @code{Message-ID} of the parent article of the
+current one (@pxref{Finding the Parent}), Gnus sends a @code{HEAD}
+command to the @acronym{NNTP} server to know where it is, and the server
+returns the data containing the pairs of a group and an article number
+in the @code{Xref} header.  Gnus normally uses the article number to
+refer to the article if the data shows that that article is in the
+current group, while it uses the @code{Message-ID} otherwise.  However,
+some news servers, e.g., ones running Diablo, run multiple engines
+having the same articles but article numbers are not kept synchronized
+between them.  In that case, the article number that appears in the
+@code{Xref} header varies by which engine is chosen, so you cannot refer
+to the parent article that is in the current group, for instance.  If
+you connect to such a server, set this variable to a non-@code{nil}
+value, and Gnus never uses article numbers.  For example:
+
+@lisp
+(setq gnus-select-method
+      '(nntp "newszilla"
+             (nntp-address "newszilla.example.com")
+             (nntp-xref-number-is-evil t)
+             @dots{}))
+@end lisp
+
+The default value of this server variable is @code{nil}.
+
 @item nntp-prepare-server-hook
 @vindex nntp-prepare-server-hook
 A hook run before attempting to connect to an @acronym{NNTP} server.
index 1781ca0..285ef09 100644 (file)
@@ -26,9 +26,10 @@ Manual,'' and with the Back-Cover Texts as in (a) below.  A copy of the
 license is included in the section entitled ``GNU Free Documentation
 License'' in the Emacs manual.
 
-(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
-this GNU Manual, like GNU software.  Copies published by the Free
-Software Foundation raise funds for GNU development.''
+(a) The FSF's Back-Cover Text is: ``You have freedom to copy and
+modify this GNU Manual, like GNU software.  Buying copies from GNU
+Press supports the FSF in developing GNU and promoting software
+freedom.''
 
 This document is part of a collection distributed under the GNU Free
 Documentation License.  If you want to distribute this document
@@ -900,6 +901,39 @@ is @code{Info-top-node}.
 @c If a menu appears at the end of this node, remove it.
 @c It is an accident of the menu updating command.
 
+@node Help-Q,  , Help-Int, Getting Started
+@comment  node-name,  next,  previous,  up
+@section Quitting Info
+
+@kindex q @r{(Info mode)}
+@findex Info-exit
+@cindex quitting Info mode
+  To get out of Info, back to what you were doing before, type @kbd{q}
+for @dfn{Quit}.  This runs @code{Info-exit} in Emacs.
+
+  This is the end of the basic course on using Info.  You have learned
+how to move in an Info document, and how to follow menus and cross
+references.  This makes you ready for reading manuals top to bottom,
+as new users should do when they learn a new package.
+
+  Another set of Info commands is useful when you need to find
+something quickly in a manual---that is, when you need to use a manual
+as a reference rather than as a tutorial.  We urge you to learn
+these search commands as well.  If you want to do that now, follow this
+cross reference to @ref{Advanced}.
+
+Yet another set of commands are meant for experienced users; you can
+find them by looking in the Directory node for documentation on Info.
+Finding them will be a good exercise in using Info in the usual
+manner.
+
+@format
+>> Type @kbd{d} to go to the Info directory node; then type
+   @kbd{mInfo} and Return, to get to the node about Info and
+   see what other help is available.
+@end format
+
+
 @node Advanced
 @chapter Advanced Info Commands
 
@@ -926,6 +960,7 @@ an actual @samp{?} character, the simplest way is to insert it using
 * Emacs Info Variables:: Variables modifying the behavior of Emacs Info.
 @end menu
 
+
 @node Search Text, Search Index,  , Advanced
 @comment  node-name,  next,  previous,  up
 @section How to search Info documents
@@ -1390,39 +1425,6 @@ cannot expect this node to have a @samp{Next}, @samp{Previous} or
 >> Type @kbd{l} to return to the node where the cross reference was.
 @end format
 
-@node Help-Q,  , Help-Int, Getting Started
-@comment  node-name,  next,  previous,  up
-@section Quitting Info
-
-@kindex q @r{(Info mode)}
-@findex Info-exit
-@cindex quitting Info mode
-  To get out of Info, back to what you were doing before, type @kbd{q}
-for @dfn{Quit}.  This runs @code{Info-exit} in Emacs.
-
-  This is the end of the basic course on using Info.  You have learned
-how to move in an Info document, and how to follow menus and cross
-references.  This makes you ready for reading manuals top to bottom,
-as new users should do when they learn a new package.
-
-  Another set of Info commands is useful when you need to find
-something quickly in a manual---that is, when you need to use a manual
-as a reference rather than as a tutorial.  We urge you to learn
-these search commands as well.  If you want to do that now, follow this
-cross reference to @ref{Advanced}.
-
-Yet another set of commands are meant for experienced users; you can
-find them by looking in the Directory node for documentation on Info.
-Finding them will be a good exercise in using Info in the usual
-manner.
-
-@format
->> Type @kbd{d} to go to the Info directory node; then type
-   @kbd{mInfo} and Return, to get to the node about Info and
-   see what other help is available.
-@end format
-
-
 @node Tags, Checking, Cross-refs, Expert Info
 @comment  node-name,  next,  previous,  up
 @section Tags Tables for Info Files
index aacc292..6be2a16 100644 (file)
@@ -3,8 +3,8 @@
 @setfilename ../info/org
 @settitle Org Mode Manual
 
-@set VERSION 4.67
-@set DATE February 2007
+@set VERSION 5.03
+@set DATE July 2007
 
 @dircategory Emacs
 @direntry
@@ -80,8 +80,9 @@ Software Foundation raise funds for GNU development.''
 * Tables::                      Pure magic for quick formatting
 * Hyperlinks::                  Notes in context
 * TODO items::                  Every tree branch can be a TODO item
-* Timestamps::                  Assign date and time to items
 * Tags::                        Tagging headlines and matching sets of tags
+* Properties and columns::      
+* Timestamps::                  Assign date and time to items
 * Agenda views::                Collecting information into views
 * Embedded LaTeX::              LaTeX fragments and formulas
 * Exporting::                   Sharing and publishing of notes
@@ -89,7 +90,6 @@ Software Foundation raise funds for GNU development.''
 * Miscellaneous::               All the rest which did not fit elsewhere
 * Extensions and Hacking::      It is possible to write add-on code
 * History and Acknowledgments::  How Org-mode came into being 
-* GNU Free Documentation License:: The license for this documentation.
 * Index::                       The fast road to specific information
 * Key Index::                   Key bindings and where they are described
 
@@ -113,6 +113,8 @@ Document Structure
 * Archiving::                   Move done task trees to a different place
 * Sparse trees::                Matches embedded in context
 * Plain lists::                 Additional structure within an entry
+* Drawers::                     Tucking stuff away
+* orgstruct-mode::              Structure editing outside Org-mode
 
 Archiving
 
@@ -123,6 +125,7 @@ Tables
 
 * Built-in table editor::       Simple tables
 * Narrow columns::              Stop wasting space in tables   
+* Column groups::               Grouping to trigger vertical lines
 * orgtbl-mode::                 The table editor as minor mode
 * The spreadsheet::             The table editor has spreadsheet capabilities.
 
@@ -163,26 +166,56 @@ TODO items
 * TODO basics::                 Marking and displaying TODO entries
 * TODO extensions::             Workflow and assignments
 * Priorities::                  Some things are more important than others
-* Breaking down tasks::         Splitting a task into managable pieces
+* Breaking down tasks::         Splitting a task into manageable pieces
 * Checkboxes::                  Tick-off lists
 
 Extended use of TODO keywords
 
 * Workflow states::             From TODO to DONE in steps
 * TODO types::                  I do this, Fred the rest
+* Multiple sets in one file::   Mixing it all, and still finding your way
 * Per file keywords::           Different files, different requirements
 
+Tags
+
+* Tag inheritance::             Tags use the tree structure of the outline
+* Setting tags::                How to assign tags to a headline
+* Tag searches::                Searching for combinations of tags
+
+Properties and Columns
+
+* Property syntax::             How properties are spelled out
+* Special properties::          Access to other Org-mode features
+* Property searches::           Matching property values
+* Column view::                 Tabular viewing and editing
+* Property API::                Properties for Lisp programmers
+
+Column View
+
+* Defining columns::            The COLUMNS format property
+* Using column view::           How to create and use column view
+
+Defining Columns
+
+* Scope of column definitions:: 
+* Column attributes::           
+
 Timestamps
 
 * Time stamps::                 Assigning a time to a tree entry
 * Creating timestamps::         Commands which insert timestamps
-* Custom time format::          If you cannot work with the ISO format
-* Repeating items::             Deadlines that come back again and again
+* Deadlines and scheduling::    Planning your work
 * Progress logging::            Documenting when what work was done.
 
 Creating timestamps
 
 * The date/time prompt::        How org-mode helps you entering date and time
+* Custom time format::          Making dates look differently
+
+Deadlines and Scheduling
+
+* Inserting deadline/schedule::  
+* Repeated tasks::              
 
 Progress Logging
 
@@ -190,12 +223,6 @@ Progress Logging
 * Tracking TODO state changes::  When did the status change?
 * Clocking work time::          When exactly did you work on this item?
 
-Tags
-
-* Tag inheritance::             Tags use the tree structure of the outline
-* Setting tags::                How to assign tags to a headline
-* Tag searches::                Searching for combinations of tags
-
 Agenda Views
 
 * Agenda files::                Files being searched for agenda information
@@ -209,7 +236,7 @@ The built-in agenda views
 
 * Weekly/Daily agenda::         The calendar page with current tasks
 * Global TODO list::            All unfinished action items
-* Matching headline tags::      Structured information with fine-tuned search
+* Matching tags and properties::  Structured information with fine-tuned search
 * Timeline::                    Time-sorted view for single file
 * Stuck projects::              Find projects you need to review
 
@@ -224,7 +251,8 @@ Custom agenda views
 * Storing searches::            Type once, use often
 * Block agenda::                All the stuff you need in a single buffer
 * Setting Options::             Changing the rules
-* Batch processing::            Agenda views from the command line
+* Exporting Agenda Views::      Writing agendas to files.
+* Extracting Agenda Information for other programs::  
 
 Embedded LaTeX
 
@@ -244,7 +272,7 @@ Exporting
 
 HTML export
 
-* Export commands::             How to invode HTML export
+* Export commands::             How to invoke HTML export
 * Quoting HTML tags::           Using direct HTML in Org-mode
 * Links::                       How hyperlinks get transferred to HTML
 * Images::                      To inline or not to inline?
@@ -253,6 +281,8 @@ HTML export
 Text interpretation by the exporter
 
 * Comment lines::               Some lines will not be exported
+* Initial text::                Text before the first headline
+* Footnotes::                   Numbers like [1]
 * Enhancing text::              Subscripts, symbols and more
 * Export options::              How to influence the export settings
 
@@ -299,6 +329,7 @@ Extensions, Hooks and Hacking
 * Tables in arbitrary syntax::  Orgtbl for LaTeX and other programs
 * Dynamic blocks::              Automatically filled blocks
 * Special agenda views::        Customized views
+* Using the property API::      Writing programs that use entry properties
 
 Tables in arbitrary syntax
 
@@ -324,7 +355,7 @@ Tables in arbitrary syntax
 @section Summary
 @cindex summary
 
-Org-mode is a mode for keeping notes, maintaining ToDo lists, and doing
+Org-mode is a mode for keeping notes, maintaining TODO lists, and doing
 project planning with a fast and effective plain-text system.
 
 Org-mode develops organizational tasks around NOTES files that contain
@@ -332,7 +363,7 @@ lists or information about projects as plain text.  Org-mode is
 implemented on top of outline-mode, which makes it possible to keep the
 content of large files well structured.  Visibility cycling and
 structure editing help to work with the tree.  Tables are easily created
-with a built-in table editor.  Org-mode supports ToDo items, deadlines,
+with a built-in table editor.  Org-mode supports TODO items, deadlines,
 time stamps, and scheduling.  It dynamically compiles entries into an
 agenda that utilizes and smoothly integrates much of the Emacs calendar
 and diary.  Plain text URL-like links connect to websites, emails,
@@ -354,7 +385,7 @@ tags etc are created dynamically when you need them.
 Org-mode keeps simple things simple.  When first fired up, it should
 feel like a straightforward, easy to use outliner.  Complexity is not
 imposed, but a large amount of functionality is available when you need
-it.  Org-mode can be used on different levels and in different ways, for
+it.  Org-mode is a toolbox and can be used in different ways, for
 example as:
 
 @example
@@ -364,6 +395,7 @@ example as:
 @r{@bullet{} TODO list editor}
 @r{@bullet{} full agenda and planner with deadlines and work scheduling}
 @r{@bullet{} environment to implement David Allen's GTD system}
+@r{@bullet{} a basic database application}
 @r{@bullet{} simple hypertext system, with HTML export}
 @r{@bullet{} publishing tool to create a set of interlinked webpages}
 @end example
@@ -371,7 +403,9 @@ example as:
 Org-mode's automatic, context sensitive table editor with spreadsheet
 capabilities can be integrated into any major mode by activating the
 minor Orgtbl-mode.  Using a translation step, it can be used to maintain
-tables in arbitray file types, for example in LaTeX.
+tables in arbitrary file types, for example in LaTeX.  The structure
+editing and list creation capabilities can be used outside Org-mode with
+the minor Orgstruct-mode.
 
 @cindex FAQ
 There is a website for Org-mode which provides links to the newest
@@ -443,9 +477,10 @@ make install-info
 
 @iftex
 @b{Important:} @i{If you use copy-and-paste to copy lisp code from the
-PDF documentation to your .emacs file, the single quote character comes
-out incorrectly and the code will not work.  You need to fix the single
-quotes by hand, or copy from Info documentation.}
+PDF documentation as viewed by Acrobat reader to your .emacs file, the
+single quote character comes out incorrectly and the code will not work.
+You need to fix the single quotes by hand, or copy from Info
+documentation.}
 @end iftex
 
 Add the following lines to your @file{.emacs} file.  The last two lines
@@ -555,6 +590,8 @@ edit the structure of the document.
 * Archiving::                   Move done task trees to a different place
 * Sparse trees::                Matches embedded in context
 * Plain lists::                 Additional structure within an entry
+* Drawers::                     Tucking stuff away
+* orgstruct-mode::              Structure editing outside Org-mode
 @end menu
 
 @node Outlines, Headlines, Document structure, Document structure
@@ -578,8 +615,9 @@ key.
 @cindex outline tree
 
 Headlines define the structure of an outline tree.  The headlines in
-Org-mode start with one or more stars, on the left margin.  For
-example:
+Org-mode start with one or more stars, on the left margin@footnote{See
+the variable @code{org-special-ctrl-a/e} to configure special behavior
+of @kbd{C-a} and @kbd{C-e} in headlines.}.  For example:
 
 @example
 * Top level headline
@@ -588,6 +626,7 @@ example:
     some text
 *** 3rd level
     more text
+
 * Another top level headline
 @end example
 
@@ -595,6 +634,12 @@ example:
 outline that has whitespace followed by a single star as headline
 starters.  @ref{Clean view} describes a setup to realize this.
 
+An empty line after the end of a subtree is considered part of it and
+will be hidden when the subtree is folded.  However, if you leave at
+least two empty lines, one empty line will remain visible after folding
+the subtree, in order to structure the collapsed view.  See the
+variable @code{org-cycle-separator-lines} for modifying this behavior.
+
 @node Visibility cycling, Motion, Headlines, Document structure
 @section Visibility cycling
 @cindex cycling, visibility
@@ -615,7 +660,7 @@ Org-mode uses just two commands, bound to @key{TAB} and
 @table @kbd
 @kindex @key{TAB}
 @item @key{TAB}
-@emph{Subtree cycling}: Rotate current subtree between the states
+@emph{Subtree cycling}: Rotate current subtree among the states
 
 @example
 ,-> FOLDED -> CHILDREN -> SUBTREE --.
@@ -637,7 +682,7 @@ argument (@kbd{C-u @key{TAB}}), global cycling is invoked.
 @kindex S-@key{TAB}
 @item S-@key{TAB}
 @itemx C-u @key{TAB}
-@emph{Global cycling}: Rotate the entire buffer between the states
+@emph{Global cycling}: Rotate the entire buffer among the states
 
 @example
 ,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
@@ -662,13 +707,19 @@ level, all sibling headings.
 @kindex C-c C-x b
 @item C-c C-x b
 Show the current subtree in an indirect buffer@footnote{The indirect
-buffer (@pxref{Indirect Buffers,Indirect Buffers,Indirect
-Buffers,emacs,GNU Emacs Manual}) will contain the entire buffer, but
-will be narrowed to the current tree.  Editing the indirect buffer will
-also change the original buffer, but without affecting visibility in
-that buffer.}.  With numerical prefix ARG, go up to this level and then
-take that tree.  If ARG is negative, go up that many levels.  With
-@kbd{C-u} prefix, do not remove the previously used indirect buffer.
+buffer
+@ifinfo
+(@pxref{Indirect Buffers,,,emacs,GNU Emacs Manual})
+@end ifinfo
+@ifnotinfo
+(see the Emacs manual for more information about indirect buffers)
+@end ifnotinfo
+will contain the entire buffer, but will be narrowed to the current
+tree.  Editing the indirect buffer will also change the original buffer,
+but without affecting visibility in that buffer.}.  With numerical
+prefix ARG, go up to this level and then take that tree.  If ARG is
+negative, go up that many levels.  With @kbd{C-u} prefix, do not remove
+the previously used indirect buffer.
 @end table
 
 When Emacs first visits an Org-mode file, the global state is set to
@@ -710,10 +761,16 @@ Backward to higher level heading.
 @item C-c C-j
 Jump to a different place without changing the current outline
 visibility.  Shows the document structure in a temporary buffer, where
-you can use visibility cycling (@key{TAB}) to find your destination.
-After pressing @key{RET}, the cursor moves to the selected location in
-the original buffer, and the headings hierarchy above it is made
-visible.
+you can use the following keys to find your destination:
+@example
+@key{TAB}         @r{Cycle visibility.}
+@key{down} / @key{up}   @r{Next/previous visible headline.}
+n / p        @r{Next/previous visible headline.}
+f / b        @r{Next/previous headline same level.}
+u            @r{One level up.}
+0-9          @r{Digit argument.}
+@key{RET}         @r{Select this location.}
+@end example
 @end table
 
 @node Structure editing, Archiving, Motion, Document structure
@@ -962,7 +1019,7 @@ XEmacs uses selective display for outlining, not text properties.}.
 Or you can use the command @kbd{C-c C-e v} to export only the visible
 part of the document and print the resulting file.
 
-@node Plain lists,  , Sparse trees, Document structure
+@node Plain lists, Drawers, Sparse trees, Document structure
 @section Plain lists
 @cindex plain lists
 @cindex lists, plain
@@ -980,14 +1037,17 @@ bullet, lines must be indented or they will be seen as top-level
 headlines.  Also, when you are hiding leading stars to get a clean
 outline view, plain list items starting with a star are visually
 indistinguishable from true headlines.  In short: even though @samp{*}
-is supported, it may be better not to use it for plain list items} as
+is supported, it may be better not to use it for plain list items.} as
 bullets.  Ordered list items start with @samp{1.} or @samp{1)}.  Items
 belonging to the same list must have the same indentation on the first
 line.  In particular, if an ordered list reaches number @samp{10.}, then
 the 2--digit numbers must be written left-aligned with the other numbers
 in the list.  Indentation also determines the end of a list item.  It
 ends before the next line that is indented like the bullet/number, or
-less.  For example:
+less.  Empty lines are part of the previous item, so you can have
+several paragraphs in one item.  If you would like an empty line to
+terminate all currently open plain lists, configure the variable
+@code{org-empty-line-terminates-plain-lists}.  Here is an example:
 
 @example
 @group
@@ -1008,10 +1068,7 @@ Org-mode supports these lists by tuning filling and wrapping commands to
 deal with them correctly@footnote{Org-mode only changes the filling
 settings for Emacs.  For XEmacs, you should use Kyle E. Jones'
 @file{filladapt.el}.  To turn this on,  put into @file{.emacs}:
-@example
-(require 'filladapt)
-@end example
-}.
+@code{(require 'filladapt)}}. 
 
 The following commands act on items when the cursor is in the first line
 of an item (the line with the bullet or number).
@@ -1024,6 +1081,9 @@ Items can be folded just like headline levels if you set the variable
 given by the indentation of the bullet/number.  Items are always
 subordinate to real headlines, however; the hierarchies remain
 completely separated.
+
+If @code{org-cycle-include-plain-lists} has not been set, @key{TAB}
+fixes the indentation of the curent line in a heuristic way.
 @kindex M-@key{RET}
 @item M-@key{RET}
 Insert new item at current level.  With prefix arg, force a new heading
@@ -1062,10 +1122,64 @@ the command chain with a cursor motion or so.
 @kindex C-c C-c
 @item C-c C-c
 If there is a checkbox (@pxref{Checkboxes}) in the item line, toggle the
-state of the checkbox.  Otherwise, if this is an ordered list, renumber
-the ordered list at the cursor.
+state of the checkbox.  If not, make this command makes sure that all
+the items on this list level use the same bullet.  Furthermore, if this
+is an ordered list, make sure the numbering is ok.
+@kindex C-c -
+@item C-c -
+Cycle the entire list level through the different itemize/enumerate
+bullets (@samp{-}, @samp{+}, @samp{*}, @samp{1.}, @samp{1)}).
+With prefix arg, select the nth bullet from this list.
 @end table
 
+@node Drawers, orgstruct-mode, Plain lists, Document structure
+@section Drawers
+@cindex drawers
+@cindex visibility cycling, drawers
+
+Sometimes you want to keep information associated with an entry, but you
+normally don't want to see it.  For this, Org-mode has @emph{drawers}.
+Drawers need to be configured with the variable @code{org-drawers}, and
+look like this:
+
+@example
+** This is a headline
+   Still outside the drawer
+   :DRAWERNAME:
+      This is inside the drawer.
+   :END:
+   After the drawer.
+@end example
+
+Visibility cycling (@pxref{Visibility cycling}) on the headline will
+hide and show the entry, but keep the drawer collapsed to a single line.
+In order to look inside the drawer, you need to move the cursor to the
+drawer line and press @key{TAB} there.  Org-mode uses a drawer for
+storing properties (@pxref{Properties and columns}).
+
+@node orgstruct-mode,  , Drawers, Document structure
+@section The Orgstruct minor mode
+@cindex orgstruct-mode
+@cindex minor mode for structure editing
+
+If you like the intuitive way the Org-mode structure editing and list
+formatting works, you might want to use these commands in other modes
+like text-mode or mail-mode as well.  The minor mode Orgstruct-mode
+makes this possible.  You can always toggle the mode with @kbd{M-x
+orgstruct-mode}.  To turn it on by default, for example in mail mode,
+use
+
+@lisp
+(add-hook 'mail-mode-hook 'turn-on-orgstruct)
+@end lisp
+
+When this mode is active and the cursor is on a line that looks to
+Org-mode like a headline of the first line of a list item, most
+structure editing commands will work, even if the same keys normally
+have different functionality in the major mode you are using.  If the
+cursor is not in one of those special lines, Orgstruct-mode lurks
+silently in the shadow.
+
 @node Tables, Hyperlinks, Document structure, Top
 @chapter Tables
 @cindex tables
@@ -1078,6 +1192,7 @@ Emacs @file{calc} package.
 @menu
 * Built-in table editor::       Simple tables
 * Narrow columns::              Stop wasting space in tables   
+* Column groups::               Grouping to trigger vertical lines
 * orgtbl-mode::                 The table editor as minor mode
 * The spreadsheet::             The table editor has spreadsheet capabilities.
 @end menu
@@ -1141,16 +1256,16 @@ table.  But it's easier just to start typing, like
 @kindex C-c C-c
 @item C-c C-c
 Re-align the table without moving the cursor.
-
+@c
 @kindex @key{TAB}
 @item @key{TAB}
 Re-align the table, move to the next field.  Creates a new row if
 necessary.
-
+@c
 @kindex S-@key{TAB}
 @item S-@key{TAB}
 Re-align, move to previous field.
-
+@c
 @kindex @key{RET}
 @item @key{RET}
 Re-align the table and move down to next row.  Creates a new row if
@@ -1163,34 +1278,34 @@ NEWLINE, so it can be used to split a table.
 @item M-@key{left}
 @itemx M-@key{right}
 Move the current column left/right.
-
+@c
 @kindex M-S-@key{left}
 @item M-S-@key{left}
 Kill the current column.
-
+@c
 @kindex M-S-@key{right}
 @item M-S-@key{right}
 Insert a new column to the left of the cursor position.
-
+@c
 @kindex M-@key{up}
 @kindex M-@key{down}
 @item M-@key{up}
 @itemx M-@key{down}
 Move the current row up/down.
-
+@c
 @kindex M-S-@key{up}
 @item M-S-@key{up}
 Kill the current row or horizontal line.
-
+@c
 @kindex M-S-@key{down}
 @item M-S-@key{down}
 Insert a new row above (with arg: below) the current row.
-
+@c
 @kindex C-c -
 @item C-c -
 Insert a horizontal line below current row. With prefix arg, the line
 is created above the current line.
-
+@c
 @kindex C-c ^
 @item C-c ^
 Sort the table lines in the region.  The position of point indicates the
@@ -1209,10 +1324,12 @@ argument, alphabetic sorting will be case-sensitive.
 Copy a rectangular region from a table to a special clipboard.  Point
 and mark determine edge fields of the rectangle.  The process ignores
 horizontal separator lines.
+@c
 @kindex C-c C-x C-w
 @item C-c C-x C-w
 Copy a rectangular region from a table to a special clipboard, and
 blank all fields in the rectangle.  So this is the ``cut'' operation.
+@c
 @kindex C-c C-x C-y
 @item C-c C-x C-y
 Paste a rectangular region into a table.
@@ -1220,6 +1337,7 @@ The upper right corner ends up in the current field.  All involved fields
 will be overwritten.  If the rectangle does not fit into the present table,
 the table is enlarged as needed.  The process ignores horizontal separator
 lines.
+@c
 @kindex C-c C-q
 @item C-c C-q
 Wrap several fields in a column like a paragraph.  If there is an active
@@ -1235,7 +1353,6 @@ above.
 @tsubheading{Calculations}
 @cindex formula, in tables
 @cindex calculations, in tables
-
 @cindex region, active
 @cindex active region
 @cindex transient-mark-mode
@@ -1244,7 +1361,7 @@ above.
 Sum the numbers in the current column, or in the rectangle defined by
 the active region.  The result is shown in the echo area and can
 be inserted with @kbd{C-y}.
-
+@c
 @kindex S-@key{RET}
 @item S-@key{RET}
 When current field is empty, copy from first non-empty field above.
@@ -1261,12 +1378,12 @@ Edit the current field in a separate window.  This is useful for fields
 that are not fully visible (@pxref{Narrow columns}).  When called with a
 @kbd{C-u} prefix, just make the full field visible, so that it can be
 edited in place.
-
+@c
 @kindex C-c @key{TAB}
 @item C-c @key{TAB}
 This is an alias for @kbd{C-u C-c `} to make the current field fully
 visible.
-
+@c
 @item M-x org-table-import
 Import a file as a table.  The table should be TAB- or whitespace
 separated.  Useful, for example, to import an Excel table or data from a
@@ -1274,11 +1391,14 @@ database, because these programs generally can write TAB-separated text
 files.  This command works by inserting the file into the buffer and
 then converting the region to a table.  Any prefix argument is passed on
 to the converter, which uses it to determine the separator.
-
+@item C-c |
+Tables can also be imported by pasting tabular text into the org-mode
+buffer, selecting the pasted text with @kbd{C-x C-x} and then using the
+@kbd{C-c |} command (see above under @i{Creation and conversion}.
+@c
 @item M-x org-table-export
 Export the table as a TAB-separated file.  Useful for data exchange with,
 for example, Excel or database programs.
-
 @end table
 
 If you don't like the automatic table editor because it gets in your
@@ -1292,7 +1412,7 @@ it off with
 @noindent Then the only table command that still works is
 @kbd{C-c C-c} to do a manual re-align.
 
-@node Narrow columns, orgtbl-mode, Built-in table editor, Tables
+@node Narrow columns, Column groups, Built-in table editor, Tables
 @section Narrow columns
 @cindex narrow columns in tables
 
@@ -1320,7 +1440,7 @@ value.
 @noindent
 Fields that are wider become clipped and end in the string @samp{=>}.
 Note that the full text is still in the buffer, it is only invisible.
-To see the full text, hold the mouse over the field - a tooltip window
+To see the full text, hold the mouse over the field - a tool-tip window
 will show the full content.  To edit such a field, use the command
 @kbd{C-c `} (that is @kbd{C-c} followed by the backquote).  This will
 open a new window with the full field.  Edit it and finish with @kbd{C-c
@@ -1338,7 +1458,42 @@ on a per-file basis with:
 #+STARTUP: noalign
 @end example
 
-@node orgtbl-mode, The spreadsheet, Narrow columns, Tables
+@node Column groups, orgtbl-mode, Narrow columns, Tables
+@section Column groups
+@cindex grouping columns in tables
+
+When Org-mode exports tables, it does so by default without vertical
+lines because that is visually more satisfying in general.  Occasionally
+however, vertical lines can be useful to structure a table into groups
+of columns, much like horizontal lines can do for groups of rows.  In
+order to specify column groups, you can use a special row where the
+first field contains only @samp{/}.  The further fields can either
+contain @samp{<} to indicate that this column should start a group,
+@samp{>} to indicate the end of a column, or @samp{<>} to make a column
+a group of its own.  Boundaries between colum groups will upon export be
+marked with vertical lines.  Here is an example:
+
+@example
+|   |  N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
+|---+----+-----+-----+-----+---------+------------|
+| / | <> |   < |     |   > |       < |          > |
+| # |  1 |   1 |   1 |   1 |       1 |          1 |
+| # |  2 |   4 |   8 |  16 |  1.4142 |     1.1892 |
+| # |  3 |   9 |  27 |  81 |  1.7321 |     1.3161 |
+|---+----+-----+-----+-----+---------+------------|
+#+TBLFM: $3=$2^2::$4=$2^3::$5=$2^4::$6=sqrt($2)::$7=sqrt(sqrt(($2))
+@end example
+
+It is also sufficient to just insert the colum group starters after
+every vertical line you'd like to have:
+
+@example
+|  N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
+|----+-----+-----+-----+---------+------------|
+| /  | <   |     |     | <       |            |
+@end example
+
+@node orgtbl-mode, The spreadsheet, Column groups, Tables
 @section The Orgtbl minor mode
 @cindex orgtbl-mode
 @cindex minor mode for tables
@@ -1356,7 +1511,7 @@ example in mail mode, use
 Furthermore, with some special setup, it is possible to maintain tables
 in arbitrary syntax with Orgtbl-mode.  For example, it is possible to
 construct LaTeX tables with the underlying ease and power of
-Orgtbl-mode, including spreadsheet capabulities.  For details, see
+Orgtbl-mode, including spreadsheet capabilities.  For details, see
 @ref{Tables in arbitrary syntax}.
 
 @node The spreadsheet,  , orgtbl-mode, Tables
@@ -1367,7 +1522,12 @@ Orgtbl-mode, including spreadsheet capabulities.  For details, see
 
 The table editor makes use of the Emacs @file{calc} package to implement
 spreadsheet-like capabilities.  It can also evaluate Emacs Lisp forms to
-derive fields from other fields.
+derive fields from other fields.  While fully featured, Org-mode's
+implementation is not identical to other spreadsheets.  For example,
+Org-mode knows the concept of a @emph{column formula} that will be
+applied to all non-header fields in a column without having to copy the
+formula to each relevant field.
+
 @menu
 * References::                  How to refer to another field or range
 * Formula syntax for Calc::     Using Calc to compute stuff
@@ -1387,17 +1547,26 @@ To compute fields in the table from other fields, formulas must
 reference other fields or ranges.  In Org-mode, fields can be referenced
 by name, by absolute coordinates, and by relative coordinates.  To find
 out what the coordinates of a field are, press @kbd{C-c ?} in that
-field.
+field, or press @kbd{C-c @}} to toggle the display of a grid.
 
 @subsubheading Field references
 @cindex field references
 @cindex references, to fields
 
-Formulas can reference the value of another field with the operator
+Formulas can reference the value of another field in two ways.  Like in
+any other spreadsheet, you may reference fields with a letter/number
+combination like @code{B3}, meaning the 2nd field in the 3rd row.
+@c Such references are always fixed to that field, they don't change
+@c when you copy and paste a formula to a different field.  So
+@c Org-mode's @code{B3} behaves like @code{$B$3} in other spreadsheets.
+
+@noindent
+Org-mode also uses another, more general operator that looks like this:
 @example
 @@row$column
 @end example
 
+@noindent
 Column references can be absolute like @samp{1}, @samp{2},...@samp{N},
 or relative to the current column like @samp{+1} or @samp{-2}.
 
@@ -1417,18 +1586,20 @@ directly at the hline is used.
 either the column or the row part of the reference, the current
 row/column is implied. 
 
-Org-mode's references with @emph{positive} numbers correspond to fixed
-references in other spreadsheet programs.  For example, @code{@@3$28}
-corresponds to @code{$AB$3}.  Org-mode's references with @emph{negative}
-numbers behave similar to non-fixed references in other spreadsheet
-programs, because when the same formula is used in several fields,
-different fields are referenced each time.
+Org-mode's references with @emph{unsigned} numbers are fixed references
+in the sense that if you use the same reference in the formula for two
+different fields, the same field will be referenced each time.
+Org-mode's references with @emph{signed} numbers are floating
+references because the same reference operator can reference different
+fields depending on the field being calculated by the formula.
 
 Here are a few examples:
 
 @example
 @@2$3      @r{2nd row, 3rd column}
+C2        @r{same as previous}
 $5        @r{column 5 in the current row}
+E&        @r{same as previous}
 @@2        @r{current column, row 2}
 @@-1$-3    @r{the field one row up, three columns to the left}
 @@-I$2     @r{field just under hline above current row, column 2}
@@ -1449,6 +1620,7 @@ format at least for the first field (i.e the reference must start with
 $1..$3        @r{First three fields in the current row.}
 $P..$Q        @r{Range, using column names (see under Advanced)}
 @@2$1..@@4$3    @r{6 fields between these two fields.}
+A2..C4        @r{Same as above.}
 @@-1$-2..@@-1   @r{3 numbers from the column to the left, 2 up to current row}
 @end example
 
@@ -1466,12 +1638,29 @@ see the @samp{E} mode switch below).  If there are no non-empty fields,
 
 @samp{$name} is interpreted as the name of a column, parameter or
 constant.  Constants are defined globally through the variable
-@code{org-table-formula-constants}.  If you have the
-@file{constants.el} package, it will also be used to resolve
-constants, including natural constants like @samp{$h} for Planck's
-constant, and units like @samp{$km} for kilometers.  Column names and
-parameters can be specified in special table lines.  These are
-described below, see @ref{Advanced features}.
+@code{org-table-formula-constants}, and locally (for the file) through a
+line like
+
+@example
+#+CONSTANTS: c=299792458. pi=3.14 eps=2.4e-6
+@end example
+
+@noindent
+Also properties (@pxref{Properties and columns}) can be used as
+constants in table formulas: For a property @samp{:XYZ:} use the name
+@samp{$PROP_XYZ}, and the property will be searched in the current
+outline entry and in the hierarchy above it.  If you have the
+@file{constants.el} package, it will also be used to resolve constants,
+including natural constants like @samp{$h} for Planck's constant, and
+units like @samp{$km} for kilometers@footnote{@file{Constant.el} can
+supply the values of constants in two different unit systems, @code{SI}
+and @code{cgs}.  Which one is used depends on the value of the variable
+@code{constants-unit-system}.  You can use the @code{#+STARTUP} options
+@code{constSI} and @code{constcgs} to set this value for the current
+buffer.}.  Column names and parameters can be specified in special table
+lines.  These are described below, see @ref{Advanced features}.  All
+names must start with a letter, and further consist of letters and
+numbers.
 
 @node Formula syntax for Calc, Formula syntax for Lisp, References, The spreadsheet
 @subsection Formula syntax for Calc
@@ -1485,6 +1674,7 @@ non-standard convention that @samp{/} has lower precedence than
 evaluation by @code{calc-eval} (@pxref{Calling Calc from
 Your Programs,calc-eval,Calling calc from Your Lisp Programs,calc,GNU
 Emacs Calc Manual}),
+@c FIXME:  The link to the calc manual in HTML does not work.
 variable substitution takes place according to the rules described above.
 @cindex vectors, in table calculations
 The range vectors can be directly fed into the calc vector functions
@@ -1518,7 +1708,7 @@ reformat the final result.  A few examples:
 $1+$2                @r{Sum of first and second field}
 $1+$2;%.2f           @r{Same, format result to two decimals}
 exp($2)+exp($1)      @r{Math functions can be used}
-$;%.1f               @r{Reformat current cell to 1 decimal}
+$0;%.1f              @r{Reformat current cell to 1 decimal}
 ($3-32)*5/9          @r{Degrees F -> C conversion}
 $c/$1/$cm            @r{Hz -> cm conversion, using @file{constants.el}}
 tan($1);Dp3s1        @r{Compute in degrees, precision 3, display SCI 1}
@@ -1528,21 +1718,34 @@ vmean($2..$7);EN     @r{Same, but treat empty fields as 0}
 taylor($3,x=7,2)     @r{taylor series of $3, at x=7, second degree}
 @end example
 
+Calc also contains a complete set of logical operations.  For example
+
+@example
+if($1<20,teen,string(""))  @r{``teen'' if age $1 less than 20, else empty}
+@end example
+
 @node Formula syntax for Lisp, Field formulas, Formula syntax for Calc, The spreadsheet
 @subsection Emacs Lisp forms as formulas
 @cindex Lisp forms, as table formulas
 
 It is also possible to write a formula in Emacs Lisp; this can be useful
-for string manipulation and control structures.  If a formula starts
-with a single quote followed by an opening parenthesis, then it is
-evaluated as a lisp form.  The evaluation should return either a string
-or a number.  Just as with @file{calc} formulas, you can specify modes
-and a printf format after a semicolon.  A reference will be replaced
-with a string (in double quotes) containing the field.  If you provide
-the @samp{N} mode switch, all referenced elements will be numbers.
-Ranges are inserted as space-separated fields, so you can embed them in
-list or vector syntax.  A few examples, note how the @samp{N} mode is
-used when we do computations in lisp.
+for string manipulation and control structures, if the Calc's
+functionality is not enough.  If a formula starts with a single quote
+followed by an opening parenthesis, then it is evaluated as a lisp form.
+The evaluation should return either a string or a number.  Just as with
+@file{calc} formulas, you can specify modes and a printf format after a
+semicolon.  With Emacs Lisp forms, you need to be concious about the way
+field references are interpolated into the form.  By default, a
+reference will be interpolated as a Lisp string (in double quotes)
+containing the field.  If you provide the @samp{N} mode switch, all
+referenced elements will be numbers (non-number fields will be zero) and
+interpolated as Lisp numbers, without quotes.  If you provide the
+@samp{L} flag, all fields will be interpolated literally, without quotes.
+I.e., if you want a reference to be interpreted as a string by the Lisp
+form, enclode the reference operator itself in double quotes, like
+@code{"$3"}.  Ranges are inserted as space-separated fields, so you can
+embed them in list or vector syntax.  A few examples, note how the
+@samp{N} mode is used when we do computations in lisp.
 
 @example
 @r{Swap the first two characters of the content of column 1}
@@ -1567,12 +1770,11 @@ evaluated, and the current field replaced with the result.
 Formulas are stored in a special line starting with @samp{#+TBLFM:}
 directly below the table.  If you typed the equation in the 4th field of
 the 3rd data line in the table, the formula will look like
-@samp{@@3$2=$1+$2}.  When inserting/deleting/swapping column and rows
+@samp{@@3$4=$1+$2}.  When inserting/deleting/swapping column and rows
 with the appropriate commands, @i{absolute references} (but not relative
-ones) in stored formulas are modified in order to
-still reference the same field.  Of cause this is not true if you edit
-the table structure with normal editing commands - then you must go and
-fix equations yourself.
+ones) in stored formulas are modified in order to still reference the
+same field.  Of cause this is not true if you edit the table structure
+with normal editing commands - then you must fix the equations yourself.
 
 Instead of typing an equation into the field, you may also use the
 following command
@@ -1593,7 +1795,9 @@ it to the current field and stores it.
 Often in a table, the same formula should be used for all fields in a
 particular column.  Instead of having to copy the formula to all fields
 in that column, org-mode allows to assign a single formula to an entire
-column.
+column.  If the table contains horizontal separator hlines, everything
+before the first such line is considered part of the table @emph{header}
+and will not be modified by column formulas.
 
 To assign a formula to a column, type it directly into any field in the
 column, preceded by an equal sign, like @samp{=$1+$2}.  When you press
@@ -1626,7 +1830,11 @@ will apply it to that many consecutive fields in the current column.
 
 You can edit individual formulas in the minibuffer or directly in the
 field.  Org-mode can also prepare a special buffer with all active
-formulas of a table.
+formulas of a table.  When offering a formula for editing, Org-mode
+converts references to the standard format (like @code{B3} or @code{D&})
+if possible.  If you prefer to only work with the internal format (like
+@code{@@3$2} or @code{$4}), configure the variable
+@code{org-table-use-standard-references}.
 
 @table @kbd
 @kindex C-c =
@@ -1645,21 +1853,36 @@ minibuffer is that you can use the command @kbd{C-c ?}.
 @item C-c ?
 While editing a formula in a table field, highlight the field(s)
 referenced by the reference at the cursor position in the formula.
+@kindex C-c @}
+@item C-c @}
+Toggle the display of row and column numbers for a table, using
+overlays.  These are updated each time the table is aligned, you can
+force it with @kbd{C-c C-c}.
+@kindex C-c @{
+@item C-c @{
+Toggle the formula debugger on and off.  See below.
 @kindex C-c '
 @item C-c '
 Edit all formulas for the current table in a special buffer, where the
-formulas will be displayed one per line. 
+formulas will be displayed one per line.  If the current field has an
+active formula, the cursor in the formula editor will mark it.
 While inside the special buffer, Org-mode will automatically highlight
 any field or range reference at the cursor position.  You may edit,
 remove and add formulas, and use the following commands:
 @table @kbd
 @kindex C-c C-c
+@kindex C-x C-s
 @item C-c C-c
-Exit the buffer and store the modified formulas.  With @kbd{C-u} prefix,
-also apply the new formulas to the entire table.
+@itemx C-x C-s
+Exit the formula editor and store the modified formulas.  With @kbd{C-u}
+prefix, also apply the new formulas to the entire table.
 @kindex C-c C-q
 @item C-c C-q
-Exit the buffer without installing changes.
+Exit the formula editor without installing changes.
+@kindex C-c C-r
+@item C-c C-r
+Toggle all references in the formula editor between standard (like
+@code{B3}) and internal (like @code{@@3$2}).
 @kindex @key{TAB}
 @item @key{TAB}
 Pretty-print or indent lisp formula at point.  When in a line containing
@@ -1671,23 +1894,25 @@ formula, @key{TAB} re-indents just like in Emacs-lisp-mode.
 Complete Lisp symbols, just like in Emacs-lisp-mode.
 @kindex S-@key{up}
 @kindex S-@key{down}
-@item S-@key{up}/@key{down}
-Move the reference line in the Org-mode buffer up and down.  This is
-important for highlighting the references of column formulas for
-different rows.
+@kindex S-@key{left}
+@kindex S-@key{right}
+@item S-@key{up}/@key{down}/@key{left}/@key{right}
+Shift the reference at point.  For example, if the reference is
+@code{B3} and you press @kbd{S-@key{right}}, it will become @code{C3}.
+This also works for relative references, and for hline references.
+@kindex M-S-@key{up}
+@kindex M-S-@key{down}
+@item M-S-@key{up}/@key{down}
+Move the test line for column formulas in the Org-mode buffer up and
+down.
 @kindex M-@key{up}
 @kindex M-@key{down}
 @item M-@key{up}/@key{down}
 Scroll the window displaying the table.
-@end table
 @kindex C-c @}
 @item C-c @}
-Toggle the display of row and column numbers for a table, using
-overlays.  These are uptated each time the table is aligned, you can
-force it with @kbd{C-c C-c}.
-@kindex C-c @{
-@item C-c @{
-Toggle the formula debugger on and off.  See below.
+Turn the coordinate grid in the table on and off.
+@end table
 @end table
 
 Making a table field blank does not remove the formula associated with
@@ -1708,8 +1933,8 @@ When the evaluation of a formula leads to an error, the field content
 becomes the string @samp{#ERROR}.  If you would like see what is going
 on during variable substitution and calculation in order to find a bug,
 turn on formula debugging in the @code{Tbl} menu and repeat the
-calculation, for example by pressing @kbd{C-c = @key{RET}} in a field.
-Detailed information will be displayed.
+calculation, for example by pressing @kbd{C-u C-u C-c = @key{RET}} in a
+field.  Detailed information will be displayed.
 
 @node Updating the table, Advanced features, Editing and debugging formulas, The spreadsheet
 @subsection Updating the Table
@@ -1728,14 +1953,14 @@ following commands:
 @item C-c *
 Recalculate the current row by first applying the stored column formulas
 from left to right, and all field formulas in the current row.
-
+@c
 @kindex C-u C-c *
 @item C-u C-c *
 @kindex C-u C-c C-c
 @itemx C-u C-c C-c
 Recompute the entire table, line by line.  Any lines before the first
 hline are left alone, assuming that these are part of the table header.
-
+@c
 @kindex C-u C-u C-c *
 @item C-u C-u C-c *
 Iterate the table by recomputing it until no further changes occur.
@@ -1743,7 +1968,6 @@ This may be necessary if some computed fields use the value of other
 fields that are computed @i{later} in the calculation sequence.
 @end table
 
-
 @node Advanced features,  , Updating the table, The spreadsheet
 @subsection Advanced features
 
@@ -1917,8 +2141,8 @@ convenient to put them into a comment line. For example
 
 @noindent In HTML export (@pxref{HTML export}), such targets will become
 named anchors for direct access through @samp{http} links@footnote{Note
-that text before the first headline will never be exported, so the first
-such target must be after the first headline.}.
+that text before the first headline is usually not exported, so the
+first such target should be after the first headline.}.
 
 If no dedicated target exists, Org-mode will search for the words in the
 link.  In the above example the search would be for @samp{my target}.
@@ -2058,7 +2282,7 @@ automatically created link is not working correctly or accurately
 enough, you can write custom functions to select the search string and
 to do the search for particular file types - see @ref{Custom searches}.
 The key binding @kbd{C-c l} is only a suggestion - see @ref{Installation}.
-
+@c
 @kindex C-c C-l
 @cindex link completion
 @cindex completion, of links
@@ -2068,24 +2292,26 @@ Insert a link.  This prompts for a link to be inserted into the buffer.
 You can just type a link, using text for an internal link, or one of the
 link type prefixes mentioned in the examples above.  All links stored
 during the current session are part of the history for this prompt, so
-you can access them with @key{up} and @key{down}, or with
-completion@footnote{After insertion of a stored link, the link will be
-removed from the list of stored links.  To keep it in the list later
+you can access them with @key{up} and @key{down}.  Completion, on the
+other hand, will help you to insert valid link prefixes like
+@samp{http:} or @samp{ftp:}, including the prefixes defined through link
+abbreviations (@pxref{Link abbreviations}).  The link will be inserted
+into the buffer@footnote{After insertion of a stored link, the link will
+be removed from the list of stored links.  To keep it in the list later
 use, use a triple @kbd{C-u} prefix to @kbd{C-c C-l}, or configure the
-option @code{org-keep-stored-link-after-insertion}.}.  The link will be
-inserted into the buffer, along with a descriptive text.  If some text
-was selected when this command is called, the selected text becomes the
-default description.@* Note that you don't have to use this command to
-insert a link.  Links in Org-mode are plain text, and you can type or
-paste them straight into the buffer.  By using this command, the links
-are automatically enclosed in double brackets, and you will be asked for
-the optional descriptive text.
-
+option @code{org-keep-stored-link-after-insertion}.}, along with a
+descriptive text.  If some text was selected when this command is
+called, the selected text becomes the default description.@* Note that
+you don't have to use this command to insert a link.  Links in Org-mode
+are plain text, and you can type or paste them straight into the buffer.
+By using this command, the links are automatically enclosed in double
+brackets, and you will be asked for the optional descriptive text.
+@c
 @c  If the link is a @samp{file:} link and
 @c the linked file is located in the same directory as the current file or
 @c a subdirectory of it, the path of the file will be inserted relative to
 @c the current directory.
-
+@c
 @kindex C-u C-c C-l
 @cindex file name completion
 @cindex completion, of file names
@@ -2098,11 +2324,11 @@ directory or in a subdirectory of it, or if the path is written relative
 to the current directory using @samp{../}.  Otherwise an absolute path
 is used, if possible with @samp{~/} for your home directory.  You can
 force an absolute path with two @kbd{C-u} prefixes.
-
-@item C-c C-l @r{with cursor on existing link}
+@c
+@item C-c C-l @r{(with cursor on existing link)}
 When the cursor is on an existing link, @kbd{C-c C-l} allows you to edit the
 link and description parts of the link.
-
+@c
 @cindex following links
 @kindex C-c C-o
 @item C-c C-o
@@ -2118,26 +2344,26 @@ suitable application for local non-text files.  Classification of files
 is based on file extension only.  See option @code{org-file-apps}.  If
 you want to override the default application and visit the file with
 Emacs, use a @kbd{C-u} prefix.
-
+@c
 @kindex mouse-2
 @kindex mouse-1
 @item mouse-2
 @itemx mouse-1
 On links, @kbd{mouse-2} will open the link just as @kbd{C-c C-o}
 would.  Under Emacs 22, also @kbd{mouse-1} will follow a link.
-
+@c
 @kindex mouse-3
 @item mouse-3
 Like @kbd{mouse-2}, but force file links to be opened with Emacs, and
 internal links to be displayed in another window@footnote{See the
 variable @code{org-display-internal-link-with-indirect-buffer}}.
-
+@c
 @cindex mark ring
 @kindex C-c %
 @item C-c %
 Push the current position onto the mark ring, to be able to return
 easily. Commands following an internal link do this automatically.
-
+@c
 @cindex links, returning to
 @kindex C-c &
 @item C-c &
@@ -2145,7 +2371,7 @@ Jump back to a recorded position.  A position is recorded by the
 commands following internal links, and by @kbd{C-c %}.  Using this
 command several times in direct succession moves through a ring of
 previously recorded positions.
-
+@c
 @kindex C-c C-x C-n
 @kindex C-c C-x C-p
 @cindex links, finding next/previous
@@ -2341,8 +2567,8 @@ use:
 @noindent In these entries, the character specifies how to select the
 template.  The first string specifies the template.  Two more (optional)
 strings give the file in which, and the headline under which the new
-note should be stored.  The file defaults to
-@code{org-default-notes-file}, the heading to
+note should be stored.  The file defaults (if not present or @code{nil})
+to @code{org-default-notes-file}, the heading to
 @code{org-remember-default-headline}.  Both defaults help to get to the
 storing location quickly, but you can change the location interactively
 while storing the note.
@@ -2377,6 +2603,8 @@ insertion of content:
 %a          @r{annotation, normally the link created with @code{org-store-link}}
 %i          @r{initial content, the region when remember is called with C-u.}
             @r{The entire text will be indented like @code{%i} itself.}
+%^g         @r{prompt for tags, with completion on tags in target file.}
+%^G         @r{prompt for tags, with completion all tags in all agenda files.}
 %:keyword   @r{specific information for certain link types, see below}
 @end example
 
@@ -2398,8 +2626,7 @@ calendar           |  %:date"
 @end example
 
 @noindent
-If you would like to have the cursor in a specific position after the
-template has been expanded:
+To place the cursor after template expansion use:
 
 @example
 %?          @r{After completing the template, position cursor here.}
@@ -2408,7 +2635,7 @@ template has been expanded:
 @noindent
 If you change you mind about which template to use, call
 @code{org-remember} in the remember buffer.  You may then select a new
-template that will be filled with the previoous context information.
+template that will be filled with the previous context information.
 
 @node Storing notes,  , Remember templates, Remember
 @subsection Storing notes
@@ -2419,20 +2646,27 @@ target file - if you press @key{RET}, the value specified for the
 template is used.  Then the command offers the headings tree of the
 selected file, with the cursor position at the default headline (if you
 had specified one in the template).  You can either immediately press
-@key{RET} to get the note placed there.  Or you can use vertical cursor
-motion (@key{up} and @key{down}) and visibility cycling (@key{TAB}) to
-find a better place.  Pressing @key{RET} or @key{left} or @key{right}
+@key{RET} to get the note placed there.  Or you can use the following
+keys to find a better location:
+@example
+@key{TAB}         @r{Cycle visibility.}
+@key{down} / @key{up}   @r{Next/previous visible headline.}
+n / p        @r{Next/previous visible headline.}
+f / b        @r{Next/previous headline same level.}
+u            @r{One level up.}
+@c 0-9          @r{Digit argument.}
+@end example
+@noindent
+Pressing @key{RET} or @key{left} or @key{right}
 then leads to the following result.
 
-@multitable @columnfractions 0.2 0.1 0.7
+@multitable @columnfractions 0.2 0.15 0.65
 @item @b{Cursor position} @tab @b{Key} @tab @b{Note gets inserted}
 @item buffer-start @tab @key{RET} @tab as level 2 heading at end of file
 @item on headline @tab @key{RET} @tab as sublevel of the heading at cursor
-@item             @tab @key{left}  @tab as same level, before current heading
-@item             @tab @key{right} @tab as same level, after current heading
+@item             @tab @key{left}/@key{right} @tab as same level, before/after current heading
 @item not on headline @tab @key{RET}
       @tab at cursor position, level taken from context.
-           Or use prefix arg to specify level manually.
 @end multitable
 
 So a fast way to store the note to its default location is to press
@@ -2448,7 +2682,7 @@ non-nil, the entire text is also indented so that it starts in the
 same column as the headline (after the asterisks).
 
 
-@node TODO items, Timestamps, Hyperlinks, Top
+@node TODO items, Tags, Hyperlinks, Top
 @chapter TODO items
 @cindex TODO items
 
@@ -2467,7 +2701,7 @@ things you have to do.
 * TODO basics::                 Marking and displaying TODO entries
 * TODO extensions::             Workflow and assignments
 * Priorities::                  Some things are more important than others
-* Breaking down tasks::         Splitting a task into managable pieces
+* Breaking down tasks::         Splitting a task into manageable pieces
 * Checkboxes::                  Tick-off lists
 @end menu
 
@@ -2488,7 +2722,7 @@ The most important commands to work with TODO entries are:
 @kindex C-c C-t
 @cindex cycling, of TODO states
 @item C-c C-t
-Rotate the TODO state of the current item between
+Rotate the TODO state of the current item among
 
 @example
 ,-> (unmarked) -> TODO -> DONE --.
@@ -2508,9 +2742,11 @@ useful if more than two TODO states are possible (@pxref{TODO extensions}).
 @item C-c C-v
 View TODO items in a @emph{sparse tree} (@pxref{Sparse trees}).  Folds
 the entire buffer, but shows all TODO items and the headings hierarchy
-above them.  With prefix arg, show also the DONE entries.  With
-numerical prefix N, show the tree for the Nth keyword in the variable
-@code{org-todo-keywords}.
+above them.  With prefix arg, search for a specific TODO.  You will be
+prompted for the keyword, and you can also give a list of keywords like
+@code{kwd1|kwd2|...}.  With numerical prefix N, show the tree for the
+Nth keyword in the variable @code{org-todo-keywords}.  With two prefix
+args, find all TODO and DONE entries.
 @kindex C-c a t
 @item C-c a t
 Show the global TODO list.  This collects the TODO items from all
@@ -2521,18 +2757,19 @@ the TODO entries directly from that buffer (@pxref{Agenda commands}).
 @c @item @code{org-agenda-include-all-todo}
 @c If you would like to have all your TODO items listed as part of your
 @c agenda, customize the variable @code{org-agenda-include-all-todo}.
+@kindex S-M-@key{RET}
+@item S-M-@key{RET}
+Insert a new TODO entry below the current one.
 @end table
 
-
 @node TODO extensions, Priorities, TODO basics, TODO items
 @section Extended use of TODO keywords
 @cindex extended TODO keywords
 
 The default implementation of TODO entries is just two states: TODO and
-DONE.  You can, however, use the TODO feature for more complicated
-things by configuring the variables @code{org-todo-keywords} and
-@code{org-todo-interpretation}.  Using special setup, you can even use
-TODO keywords in different ways in different org files.
+DONE.  You can use the TODO feature for more complicated things by
+configuring the variable @code{org-todo-keywords}.  With special setup,
+the TODO keyword system can work differently in different files.
 
 Note that @i{tags} are another way to classify headlines in general and
 TODO items in particular (@pxref{Tags}).
@@ -2540,6 +2777,7 @@ TODO items in particular (@pxref{Tags}).
 @menu
 * Workflow states::             From TODO to DONE in steps
 * TODO types::                  I do this, Fred the rest
+* Multiple sets in one file::   Mixing it all, and still finding your way
 * Per file keywords::           Different files, different requirements
 @end menu
 
@@ -2548,103 +2786,149 @@ TODO items in particular (@pxref{Tags}).
 @cindex TODO workflow
 @cindex workflow states as TODO keywords
 
-You can use TODO keywords to indicate different states in the process
-of working on an item, for example:
+You can use TODO keywords to indicate different @emph{sequential} states
+in the process of working on an item, for example@footnote{Changing
+this variable only becomes effective after restarting Org-mode in a
+buffer.}:
 
 @lisp
-(setq org-todo-keywords '("TODO" "FEEDBACK" "VERIFY" "DONE")
-      org-todo-interpretation 'sequence)
+(setq org-todo-keywords
+  '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))
 @end lisp
 
+The vertical bar separates the TODO keywords (states that @emph{need
+action}) from the DONE states (which need @emph{no further action}.  If
+you don't provide the separator bar, the last state is used as the DONE
+state.
 @cindex completion, of TODO keywords
-Changing these variables only becomes effective in a new Emacs session.
-With this setup, the command @kbd{C-c C-t} will cycle an entry from
-TODO to FEEDBACK, then to VERIFY, and finally to DONE.  You may also
-use a prefix argument to quickly select a specific state.  For example
-@kbd{C-3 C-c C-t} will change the state immediately to VERIFY.
+With this setup, the command @kbd{C-c C-t} will cycle an entry from TODO
+to FEEDBACK, then to VERIFY, and finally to DONE and DELEGATED.  You may
+also use a prefix argument to quickly select a specific state.  For
+example @kbd{C-3 C-c C-t} will change the state immediately to VERIFY.
 If you define many keywords, you can use in-buffer completion (see
-@ref{Completion}) to insert these words into the buffer.  Changing a todo
-state can be logged with a timestamp, see @ref{Tracking TODO state
+@ref{Completion}) to insert these words into the buffer.  Changing a
+todo state can be logged with a timestamp, see @ref{Tracking TODO state
 changes} for more information.
 
-@node TODO types, Per file keywords, Workflow states, TODO extensions
+@node TODO types, Multiple sets in one file, Workflow states, TODO extensions
 @subsection TODO keywords as types
 @cindex TODO types
 @cindex names as TODO keywords
 @cindex types as TODO keywords
 
 The second possibility is to use TODO keywords to indicate different
-types of action items.  For example, you might want to indicate that
-items are for ``work'' or ``home''.  If you are into David Allen's
-@emph{Getting Things DONE}, you might want to use todo types
-@samp{NEXTACTION}, @samp{WAITING}, @samp{MAYBE}.  Or, when you work
-with several people on a single project, you might want to assign
-action items directly to persons, by using their names as TODO
-keywords.  This would be set up like this:
+@emph{types} of action items.  For example, you might want to indicate
+that items are for ``work'' or ``home''.  Or, when you work with several
+people on a single project, you might want to assign action items
+directly to persons, by using their names as TODO keywords.  This would
+be set up like this:
+
+@lisp
+(setq org-todo-keywords '((type "Fred" "Sara" "Lucy" "|" "DONE")))
+@end lisp
+
+In this case, different keywords do not indicate a sequence, but rather
+different types.  So the normal work flow would be to assign a task to a
+person, and later to mark it DONE.  Org-mode supports this style by
+adapting the workings of the command @kbd{C-c C-t}@footnote{This is also
+true for the @kbd{t} command in the timeline and agenda buffers.}.  When
+used several times in succession, it will still cycle through all names,
+in order to first select the right type for a task.  But when you return
+to the item after some time and execute @kbd{C-c C-t} again, it will
+switch from any name directly to DONE.  Use prefix arguments or
+completion to quickly select a specific name.  You can also review the
+items of a specific TODO type in a sparse tree by using a numeric prefix
+to @kbd{C-c C-v}.  For example, to see all things Lucy has to do, you
+would use @kbd{C-3 C-c C-v}.  To collect Lucy's items from all agenda
+files into a single buffer, you would use the prefix arg as well when
+creating the global todo list: @kbd{C-3 C-c t}.
+
+@node Multiple sets in one file, Per file keywords, TODO types, TODO extensions
+@subsection Multiple keyword sets in one file
+@cindex todo keyword sets
+
+Sometimes you may want to use different sets of TODO keywords in
+parallel.  For example, you may want to have the basic
+@code{TODO}/@code{DONE}, but also a workflow for bug fixing, and a
+separate state indicating that an item has been canceled (so it is not
+DONE, but also does not require action).  Your setup would then look
+like this:
 
 @lisp
-(setq org-todo-keywords '("Fred" "Sara" "Lucy" "Mike" "DONE")
-      org-todo-interpretation 'type)
+(setq org-todo-keywords
+      '((sequence "TODO" "|" "DONE")
+        (sequence "REPORT" "BUG" "KNOWNCAUSE" "|" "FIXED")
+        (sequence "|" "CANCELED")))
 @end lisp
 
-In this case, different keywords do not indicate a sequence, but
-rather different types.  So it is normally not useful to change from
-one type to another.  Therefore, in this case the behavior of the
-command @kbd{C-c C-t} is changed slightly@footnote{This is also true
-for the @kbd{t} command in the timeline and agenda buffers.}.  When
-used several times in succession, it will still cycle through all
-names.  But when you return to the item after some time and execute
-@kbd{C-c C-t} again, it will switch from each name directly to DONE.
-Use prefix arguments or completion to quickly select a specific name.
-You can also review the items of a specific TODO type in a sparse tree
-by using a numeric prefix to @kbd{C-c C-v}.  For example, to see all
-things Lucy has to do, you would use @kbd{C-3 C-c C-v}.  To collect
-Lucy's items from all agenda files into a single buffer, you
-would use the prefix arg as well when creating the global todo list:
-@kbd{C-3 C-c t}.
-
-@node Per file keywords,  , TODO types, TODO extensions
-@subsection Setting up TODO keywords for individual files
+The keywords should all be different, this helps Org-mode to keep track
+of which subsequence should be used for a given entry.  In this setup,
+@kbd{C-c C-t} only operates within a subsequence, so it switches from
+@code{DONE} to (nothing) to @code{TODO}, and from @code{FIXED} to
+(nothing) to @code{REPORT}.  Therefore you need a mechanism to initially
+select the correct sequence.  Besides the obvious ways like typing a
+keyword or using completion, you may also apply the following commands:
+
+@table @kbd
+@kindex C-S-@key{right}
+@kindex C-S-@key{left}
+@item C-S-@key{right}
+@itemx C-S-@key{left}
+These keys jump from one TODO subset to the next.  In the above example,
+@kbd{C-S-@key{right}} would jump from @code{TODO} or @code{DONE} to
+@code{REPORT}, and any of the words in the second row to @code{CANCELED}.
+@kindex S-@key{right}
+@kindex S-@key{left}
+@item S-@key{right}
+@itemx S-@key{left}
+@kbd{S-@key{<left>}} and @kbd{S-@key{<right>}} and walk through
+@emph{all} keywords from all sets, so for example @kbd{S-@key{<right>}}
+would switch from @code{DONE} to @code{REPORT} in the example above.
+@end table
+
+@node Per file keywords,  , Multiple sets in one file, TODO extensions
+@subsection Setting up keywords for individual files
 @cindex keyword options
 @cindex per file keywords
 
-It can be very useful to use different aspects of the TODO mechanism
-in different files, which is not possible with the global settings
-described above.  For file-local settings, you need to add special
-lines to the file which set the keywords and interpretation for that
-file only.  For example, to set one of the two examples discussed
-above, you need one of the following lines, starting in column zero
-anywhere in the file:
+It can be very useful to use different aspects of the TODO mechanism in
+different files.  For file-local settings, you need to add special lines
+to the file which set the keywords and interpretation for that file
+only.  For example, to set one of the two examples discussed above, you
+need one of the following lines, starting in column zero anywhere in the
+file:
+
+@example
+#+SEQ_TODO: TODO FEEDBACK VERIFY | DONE CANCELED
+@end example
+or
+@example
+#+TYP_TODO: Fred Sara Lucy Mike | DONE
+@end example
+
+A setup for using several sets in parallel would be:
 
 @example
-#+SEQ_TODO: TODO FEEDBACK VERIFY DONE
-#+TYP_TODO: Fred Sara Lucy Mike DONE
+#+SEQ_TODO: "TODO" "|" "DONE"
+#+SEQ_TODO: "REPORT" "BUG" "KNOWNCAUSE" "|" "FIXED"
+#+SEQ_TODO: "|" "CANCELED"
 @end example
 
+
 @cindex completion, of option keywords
 @kindex M-@key{TAB}
 @noindent To make sure you are using the correct keyword, type
 @samp{#+} into the buffer and then use @kbd{M-@key{TAB}} completion.
 
 @cindex DONE, final TODO keyword
-Remember that the last keyword must always mean that the item is DONE
-(although you may use a different word).  Also note that in each file,
-only one of the two aspects of TODO keywords can be used.  After
-changing one of these lines, use @kbd{C-c C-c} with the cursor still
-in the line to make the changes known to Org-mode@footnote{Org-mode
-parses these lines only when Org-mode is activated after visiting a
-file.  @kbd{C-c C-c} with the cursor in a line starting with @samp{#+}
-is simply restarting Org-mode for the current buffer.}.
-
-If you want to use very many keywords, for example when working with a
-large group of people, you may split the names over several lines:
-
-@example
-#+TYP_TODO: Fred Sara Lucy Mike
-#+TYP_TODO: Luis George Jules Jessica
-#+TYP_TODO: Kim Arnold Peter
-#+TYP_TODO: DONE
-@end example
+Remember that the keywords after the vertical bar (or the last keyword
+if no bar is there) must always mean that the item is DONE (although you
+may use a different word).  After changing one of these lines, use
+@kbd{C-c C-c} with the cursor still in the line to make the changes
+known to Org-mode@footnote{Org-mode parses these lines only when
+Org-mode is activated after visiting a file.  @kbd{C-c C-c} with the
+cursor in a line starting with @samp{#+} is simply restarting Org-mode
+for the current buffer.}.
 
 @node Priorities, Breaking down tasks, TODO extensions, TODO items
 @section Priorities
@@ -2673,7 +2957,7 @@ priority character @samp{A}, @samp{B} or @samp{C}.  When you press
 @key{SPC} instead, the priority cookie is removed from the headline.
 The priorities can also be changed ``remotely'' from the timeline and
 agenda buffer with the @kbd{,} command (@pxref{Agenda commands}).
-
+@c
 @kindex S-@key{up}
 @kindex S-@key{down}
 @item S-@key{up}
@@ -2683,11 +2967,22 @@ are also used to modify time stamps (@pxref{Creating timestamps}).
 Furthermore, these keys are also used by CUA-mode (@pxref{Conflicts}).
 @end table
 
+You can change the range of allowed priorities by setting the variables
+@code{org-highest-priority}, @code{org-lowest-priority}, and
+@code{org-default-priority}.  For an individual buffer, you may set
+these values (highest, lowest, default) like this (please make sure that
+the highest priority is earlier in the alphabet than the lowest
+priority):
+
+@example
+#+PRIORITIES: A C B
+@end example
+
 @node Breaking down tasks, Checkboxes, Priorities, TODO items
 @section Breaking tasks down into subtasks
 @cindex tasks, breaking down
 
-It is often advisable to break down large tasks into smaller, managable
+It is often advisable to break down large tasks into smaller, manageable
 subtasks.  You can do this by creating an outline tree below a TODO
 item, with detailed subtasks on the tree@footnote{To keep subtasks out
 of the global TODO list, see the
@@ -2738,7 +3033,8 @@ percentage of checkboxes checked (in the above example, this would be
 @table @kbd
 @kindex C-c C-c
 @item C-c C-c
-Toggle checkbox at point.
+Toggle checkbox at point.  With prefix argument, set it to @samp{[-]},
+which is considered to be an intermediate state.
 @kindex C-c C-x C-b
 @item C-c C-x C-b
 Toggle checkbox at point.
@@ -2769,122 +3065,664 @@ delete boxes or add/change them by hand, use this command to get things
 back into synch.  Or simply toggle any checkbox twice with @kbd{C-c C-c}.
 @end table
 
-@node Timestamps, Tags, TODO items, Top
-@chapter Timestamps
-@cindex time stamps
-@cindex date stamps
 
-Items can be labeled with timestamps to make them useful for project
-planning.
+@node Tags, Properties and columns, TODO items, Top
+@chapter Tags
+@cindex tags
+@cindex headline tagging
+@cindex matching, tags
+@cindex sparse tree, tag based
 
-@menu
-* Time stamps::                 Assigning a time to a tree entry
-* Creating timestamps::         Commands which insert timestamps
-* Custom time format::          If you cannot work with the ISO format
-* Repeating items::             Deadlines that come back again and again
-* Progress logging::            Documenting when what work was done.
-@end menu
+If you wish to implement a system of labels and contexts for
+cross-correlating information, an excellent way is to assign @i{tags} to
+headlines.  Org-mode has extensive support for using tags.
 
+Every headline can contain a list of tags, at the end of the headline.
+Tags are normal words containing letters, numbers, @samp{_}, and
+@samp{@@}.  Tags must be preceded and followed by a single colon; like
+@samp{:WORK:}.  Several tags can be specified like @samp{:WORK:URGENT:}.
 
-@node Time stamps, Creating timestamps, Timestamps, Timestamps
-@section Time stamps, deadlines and scheduling
-@cindex time stamps
-@cindex ranges, time
-@cindex date stamps
-@cindex deadlines
-@cindex scheduling
+@menu
+* Tag inheritance::             Tags use the tree structure of the outline
+* Setting tags::                How to assign tags to a headline
+* Tag searches::                Searching for combinations of tags
+@end menu
 
-A time stamp is a specification of a date (possibly with time) in a
-special format, either @samp{<2003-09-16 Tue>} or @samp{<2003-09-16 Tue
-09:39>}@footnote{This is the standard ISO date/time format.  If you
-cannot get used to these, see @ref{Custom time format}}.  A time stamp
-can appear anywhere in the headline or body of an org-tree entry.  Its
-presence allows entries to be shown on specific dates in the agenda
-(@pxref{Weekly/Daily agenda}).  We distinguish:
+@node Tag inheritance, Setting tags, Tags, Tags
+@section Tag inheritance
+@cindex inheritance, of tags
+@cindex sublevels, inclusion into tags match
 
-@table @var
-@item Plain time stamp
-@cindex timestamp
-A simple time stamp just assigns a date/time to an item.  This is just
-like writing down an appointment in a paper agenda, or like writing down
-an event in a diary, when you want to take note of when something
-happened.  In the timeline and agenda displays, the headline of an entry
-associated with a plain time stamp will be shown exactly on that date.
+@i{Tags} make use of the hierarchical structure of outline trees.  If a
+heading has a certain tag, all subheadings will inherit the tag as
+well.  For example, in the list
 
 @example
-* Meet Peter at the movies <2006-11-01 Wed 19:15>
+* Meeting with the French group      :WORK:
+** Summary by Frank                  :BOSS:NOTES:
+*** TODO Prepare slides for him      :ACTION:
 @end example
 
-@item Inactive time stamp
-@cindex timestamp, inactive
-@cindex inactive timestamp
-Just like a plain time stamp, but with square brackets instead of
-angular ones.  These time stamps are inactive in the sense that they do
-@emph{not} trigger an entry to show up in the agenda.
+@noindent
+the final heading will have the tags @samp{:WORK:}, @samp{:BOSS:},
+@samp{:NOTES:}, and @samp{:ACTION:}.  When executing tag searches and
+Org-mode finds that a certain headline matches the search criterion, it
+will not check any sublevel headline, assuming that these likely also
+match, and that the list of matches can become very long.  This may
+not be what you want, however, and you can influence inheritance and
+searching using the variables @code{org-use-tag-inheritance} and
+@code{org-tags-match-list-sublevels}.
 
-@example
-* Gillian comes late for the fifth time [2006-11-01 Wed]
-@end example
+@node Setting tags, Tag searches, Tag inheritance, Tags
+@section Setting tags
+@cindex setting tags
+@cindex tags, setting
 
-@item Time stamp range
-@cindex timerange
-Two time stamps connected by @samp{--} denote a time range.  The
-headline will be shown on the first and last day of the range, and on
-any dates that are displayed and fall in the range.  Here is an
-example:
+@kindex M-@key{TAB}
+Tags can simply be typed into the buffer at the end of a headline.
+After a colon, @kbd{M-@key{TAB}} offers completion on tags.  There is
+also a special command for inserting tags:
+
+@table @kbd
+@kindex C-c C-c
+@item C-c C-c
+@cindex completion, of tags
+Enter new tags for the current headline.  Org-mode will either offer
+completion or a special single-key interface for setting tags, see
+below.  After pressing @key{RET}, the tags will be inserted and aligned
+to @code{org-tags-column}.  When called with a @kbd{C-u} prefix, all
+tags in the current buffer will be aligned to that column, just to make
+things look nice.  TAGS are automatically realigned after promotion,
+demotion, and TODO state changes (@pxref{TODO basics}).
+@end table
+
+Org will support tag insertion based on a @emph{list of tags}.  By
+default this list is constructed dynamically, containing all tags
+currently used in the buffer.  You may also globally specify a hard list
+of tags with the variable @code{org-tag-alist}.  Finally you can set
+the default tags for a given file with lines like
 
 @example
-** Meeting in Amsterdam
-   <2004-08-23 Mon>--<2004-08-26 Thu>
+#+TAGS: @@WORK @@HOME @@TENNISCLUB
+#+TAGS: Laptop Car PC Sailboat
 @end example
 
-@item Time stamp with SCHEDULED keyword
-@cindex SCHEDULED keyword
-If a time stamp is preceded by the word @samp{SCHEDULED:}, it means you
-are planning to start working on that task on the given date. So this is
-not about recording an event, but about planning your work.  The
-headline will be listed under the given date@footnote{It will still be
-listed on that date after it has been marked DONE.  If you don't like
-this, set the variable @code{org-agenda-skip-scheduled-if-done}.}.  In
-addition, a reminder that the scheduled date has passed will be present
-in the compilation for @emph{today}, until the entry is marked DONE.
-I.e., the task will automatically be forwarded until completed.
+If you have globally defined your preferred set of tags using the
+variable @code{org-tag-alist}, but would like to use a dynamic tag list
+in a specific file: Just add an empty TAGS option line to that file:
 
 @example
-*** TODO Call Trillian for a date on New Years Eve.
-    SCHEDULED: <2004-12-25 Sat>
+#+TAGS:
 @end example
 
-@item Time stamp with DEADLINE keyword
-@cindex DEADLINE keyword
-If a time stamp is preceded by the word @samp{DEADLINE:}, the task
-(most likely a TODO item) is supposed to be finished on that date, and
-it will be listed then.  In addition, the compilation for @emph{today}
-will carry a warning about the approaching or missed deadline,
-starting @code{org-deadline-warning-days} before the due date, and
-continuing until the entry is marked DONE.  An example:
+The default support method for entering tags is minibuffer completion.
+However, Org-mode also implements a much better method: @emph{fast tag
+selection}.  This method allows to select and deselect tags with a
+single key per tag.  To function efficiently, you should assign unique
+keys to most tags.  This can be done globally with
+
+@lisp
+(setq org-tag-alist '(("@@WORK" . ?w) ("@@HOME" . ?h) ("Laptop" . ?l)))
+@end lisp
+
+@noindent or on a per-file basis with
 
 @example
-*** TODO write article about the Earth for the Guide
-    The editor in charge is [[bbdb:Ford Prefect]]
-    DEADLINE: <2004-02-29 Sun>
+#+TAGS: @@WORK(w)  @@HOME(h)  @@TENNISCLUB(t)  Laptop(l)  PC(p)
+@end example
+
+@noindent
+You can also group together tags that are mutually exclusive.  With
+curly braces@footnote{In @code{org-mode-alist} use
+@code{'(:startgroup)} and @code{'(:endgroup)}, respectively.  Several
+groups are allowed.}
+
+@example
+#+TAGS: @{ @@WORK(w)  @@HOME(h)  @@TENNISCLUB(t) @}  Laptop(l)  PC(p)
 @end example
-@item Time stamp with CLOSED keyword
-@cindex CLOSED keyword
-When @code{org-log-done} is non-nil, Org-mode will automatically insert
-a special time stamp each time a TODO entry is marked done
-(@pxref{Progress logging}).  This time stamp is enclosed in square
-brackets instead of angular brackets.
-
-@item Time range with CLOCK keyword
-@cindex CLOCK keyword
-When using the clock to time the work that is being done on specific
-items, time ranges preceded by the CLOCK keyword are inserted
-automatically into the file.  The time stamps are enclosed in square
-brackets instead of angular brackets.  @xref{Clocking work time}.
+
+@noindent you indicate that at most one of @samp{@@WORK}, @samp{@@HOME},
+and @samp{@@TENNISCLUB} should be selected.
+
+@noindent Don't forget to press @kbd{C-c C-c} with the cursor in one of
+these lines to activate any changes.
+
+If at least one tag has a selection key, pressing @kbd{C-c C-c} will
+automatically present you with a special interface, listing inherited
+tags, the tags of the current headline, and a list of all legal tags
+with corresponding keys@footnote{Keys will automatically be assigned to
+tags which have no configured keys.}.  In this interface, you can use
+the following keys:
+
+@table @kbd
+@item a-z...
+Pressing keys assigned to tags will add or remove them from the list of
+tags in the current line.  Selecting a tag in a group of mutually
+exclusive tags will turn off any other tags from that group.
+@kindex @key{TAB}
+@item @key{TAB}
+Enter a tag in the minibuffer, even if the tag is not in the predefined
+list.  You will be able to complete on all tags present in the buffer.
+@kindex @key{SPC}
+@item @key{SPC}
+Clear all tags for this line.
+@kindex @key{RET}
+@item @key{RET}
+Accept the modified set.
+@item C-g
+Abort without installing changes.
+@item q
+If @kbd{q} is not assigned to a tag, it aborts like @kbd{C-g}.
+@item !
+Turn off groups of mutually exclusive tags.  Use this to (as an
+exception) assign several tags from such a group.
+@item C-c
+Toggle auto-exit after the next change (see below).
+If you are using expert mode, the first @kbd{C-c} will display the
+selection window.
+@end table
+
+@noindent
+This method lets you assign tags to a headline with very few keys.  With
+the above setup, you could clear the current tags and set @samp{@@HOME},
+@samp{Laptop} and @samp{PC} tags with just the following keys: @kbd{C-c
+C-c @key{SPC} h l p @key{RET}}.  Switching from @samp{@@HOME} to
+@samp{@@WORK} would be done with @kbd{C-c C-c w @key{RET}} or
+alternatively with @kbd{C-c C-c C-c w}.  Adding the non-predefined tag
+@samp{Sarah} could be done with @kbd{C-c C-c @key{TAB} S a r a h
+@key{RET} @key{RET}}.
+
+If you find that most of the time, you need only a single keypress to
+modify your list of tags, set the variable
+@code{org-fast-tag-selection-single-key}.  Then you no longer have to
+press @key{RET} to exit fast tag selection - it will immediately exit
+after the first change.  If you then occasionally need more keys, press
+@kbd{C-c} to turn off auto-exit for the current tag selection process
+(in effect: start selection with @kbd{C-c C-c C-c} instead of @kbd{C-c
+C-c}).  If you set the variable to the value @code{expert}, the special
+window is not even shown for single-key tag selection, it comes up only
+when you press an extra @kbd{C-c}.
+
+@node Tag searches,  , Setting tags, Tags
+@section Tag searches
+@cindex tag searches
+@cindex searching for tags
+
+Once a tags system has been set up, it can be used to collect related
+information into special lists.
+
+@table @kbd
+@kindex C-c \
+@item C-c \
+Create a sparse tree with all headlines matching a tags search.  With a
+@kbd{C-u} prefix argument, ignore headlines that are not a TODO line.
+@kindex C-c a m
+@item C-c a m
+Create a global list of tag matches from all agenda files.
+@xref{Matching tags and properties}.
+@kindex C-c a M
+@item C-c a M
+Create a global list of tag matches from all agenda files, but check
+only TODO items and force checking subitems (see variable
+@code{org-tags-match-list-sublevels}).
 @end table
 
-@node Creating timestamps, Custom time format, Time stamps, Timestamps
+@cindex Boolean logic, for tag searches
+A @i{tags} search string can use Boolean operators @samp{&} for AND and
+@samp{|} for OR.  @samp{&} binds more strongly than @samp{|}.
+Parenthesis are currently not implemented.  A tag may also be preceded
+by @samp{-}, to select against it, and @samp{+} is syntactic sugar for
+positive selection.  The AND operator @samp{&} is optional when @samp{+}
+or @samp{-} is present.  Examples:
+
+@table @samp
+@item +WORK-BOSS
+Select headlines tagged @samp{:WORK:}, but discard those also tagged
+@samp{:BOSS:}.
+@item WORK|LAPTOP
+Selects lines tagged @samp{:WORK:} or @samp{:LAPTOP:}.
+@item WORK|LAPTOP&NIGHT
+Like before, but require the @samp{:LAPTOP:} lines to be tagged also
+@samp{NIGHT}.
+@end table
+
+@cindex TODO keyword matching, with tags search
+If you are using multi-state TODO keywords (@pxref{TODO extensions}), it
+can be useful to also match on the TODO keyword.  This can be done by
+adding a condition after a slash to a tags match.  The syntax is similar
+to the tag matches, but should be applied with consideration: For
+example, a positive selection on several TODO keywords can not
+meaningfully be combined with boolean AND.  However, @emph{negative
+selection} combined with AND can be meaningful.  To make sure that only
+lines are checked that actually have any TODO keyword, use @kbd{C-c a
+M}, or equivalently start the todo part after the slash with @samp{!}.
+Examples:
+
+@table @samp
+@item WORK/WAITING
+Select @samp{:WORK:}-tagged TODO lines with the specific TODO
+keyword @samp{WAITING}.
+@item WORK/!-WAITING-NEXT
+Select @samp{:WORK:}-tagged TODO lines that are neither @samp{WAITING}
+nor @samp{NEXT}
+@item WORK/+WAITING|+NEXT
+Select @samp{:WORK:}-tagged TODO lines that are either @samp{WAITING} or
+@samp{NEXT}.
+@end table
+
+@cindex regular expressions, with tags search
+Any element of the tag/todo match can be a regular expression - in this
+case it must be enclosed in curly braces.  For example,
+@samp{WORK+@{^BOSS.*@}} matches headlines that contain the tag
+@samp{WORK} and any tag @i{starting} with @samp{BOSS}.
+
+@cindex level, require for tags match
+You can also require a headline to be of a certain level, by writing
+instead of any TAG an expression like @samp{LEVEL=3}.  For example, a
+search @samp{+LEVEL=3+BOSS/-DONE} lists all level three headlines that
+have the tag BOSS and are @emph{not} marked with the todo keyword DONE.
+
+@node Properties and columns, Timestamps, Tags, Top
+@chapter Properties and Columns
+@cindex properties
+
+Properties are a set of key-value pairs associated with an entry.  There
+are two main applications for properties in Org-mode.  First, properties
+are like tags, but with a value.  For example, in a file where you
+document bugs and plan releases of a piece of software, instead of using
+tags like @code{:release_1:}, @code{:release_2:}, it can be more
+efficient to use a property @code{RELEASE} with a value @code{1.0} or
+@code{2.0}.  Second, you can use properties to implement (very basic)
+database capabilities in an Org-mode buffer, for example to create a
+list of Music CD's you own.  You can edit and view properties
+conveniently in column view (@pxref{Column view}).
+
+@menu
+* Property syntax::             How properties are spelled out
+* Special properties::          Access to other Org-mode features
+* Property searches::           Matching property values
+* Column view::                 Tabular viewing and editing
+* Property API::                Properties for Lisp programmers
+@end menu
+
+@node Property syntax, Special properties, Properties and columns, Properties and columns
+@section Property Syntax
+@cindex property syntax
+@cindex drawer, for properties
+
+Properties are key-value pairs.  They need to be inserted into a special
+drawer (@pxref{Drawers}) with the name @code{PROPERTIES}.  Each property
+is specified on a single line, with the key (surrounded by colons)
+first, and the value after it.  Here is an example:
+
+@example
+* CD collection
+** Classic
+*** Goldberg Variations
+    :PROPERTIES:
+    :Title:     Goldberg Variations
+    :Composer:  J.S. Bach
+    :Artist:    Glen Gould 
+    :Publisher: Deutsche Grammphon
+    :NDisks:    1
+    :END:       
+@end example
+
+You may define the allowed values for a particular property @samp{XYZ}
+by setting a property @samp{XYZ_ALL}.  This special property is
+@emph{inherited}, so if you set it in a level 1 entry, it will apply to
+the entire tree.  When allowed values are defined, setting the
+corresponding property becomes easier and is less prone to typing
+errors.  For the example with the CD collection, we can predefine
+publishers and the number of disks in a box like this:
+
+@example
+* CD collection
+  :PROPERTIES:
+  :NDisks_ALL:  1 2 3 4
+  :Publisher_ALL: "Deutsche Grammophon" Phillips EMI
+  :END:
+@end example
+
+@noindent
+The following commands help to work with properties:
+
+@table @kbd
+@kindex M-@key{TAB}
+@item M-@key{TAB}
+After an initial colon in a line, complete property keys.  All keys used
+in the current file will be offered as possible completions.
+@item M-x org-insert-property-drawer
+Insert a property drawer into the current entry.  The drawer will be
+inserted early in the entry, but after the lines with planning
+information like deadlines.
+@kindex C-c C-c
+@item C-c C-c
+With the cursor in a property drawer, this executes property commands.
+@item C-c C-c s
+Set a property in the current entry.  Both the property and the value
+can be inserted using completion.
+@kindex S-@key{right}
+@kindex S-@key{left}
+@item S-@key{left}/@key{right}
+Switch property at point to the next/previous allowed value.
+@item C-c C-c d
+Remove a property from the current entry.
+@item C-c C-c D
+Globally remove a property, from all entries in the current file.
+@end table
+
+@node Special properties, Property searches, Property syntax, Properties and columns
+@section Special Properties
+@cindex properties, special
+
+Special properties provide alternative access method to Org-mode
+features discussed in the previous chapters, like the TODO state or the
+priority of an entry.  This interface exists so that you can include
+these states into columns view (@pxref{Column view}).  The following
+property names are special and should not be used as keys in the
+properties drawer:
+
+@example
+TODO         @r{The TODO keyword of the entry.}
+TAGS         @r{The tags defined directly in the headline.}
+ALLTAGS      @r{All tags, including inherited ones.}
+PRIORITY     @r{The priority of the entry, a string with a single letter.}
+DEADLINE     @r{The deadline time string, without the angular brackets.}
+SCHEDULED    @r{The scheduling time stamp, without the angular brackets.}
+@end example
+
+@node Property searches, Column view, Special properties, Properties and columns
+@section Property searches
+@cindex properties, searching
+
+To create sparse trees and special lists with selection based on
+properties, the same commands are used as for tag searches (@pxref{Tag
+searches}), and the same logic applies.  For example, a search string
+
+@example
++WORK-BOSS+PRIORITY="A"+coffee="unlimited"+with=@{Sarah\|Denny@}
+@end example
+
+@noindent
+finds entries tagged @samp{:WORK:} but not @samp{:BOSS:}, which
+also have a priority value @samp{A}, a @samp{:coffee:} property with the
+value @samp{unlimited}, and a @samp{:with:} property that is matched by
+the regular expression @samp{Sarah\|Denny}.
+
+@node Column view, Property API, Property searches, Properties and columns
+@section Column View
+
+A great way to view and edit properties in an outline tree is
+@emph{column view}.  In column view, each outline item is turned into a
+table row.  Columns in this table provide access to properties of the
+entries.  Org-mode implements columns by overlaying a tabular structure
+over the headline of each item.  While the headlines have been turned
+into a table row, you can still change the visibility of the outline
+tree.  For example, you get a compact table by switching to CONTENTS
+view (@kbd{S-@key{TAB} S-@key{TAB}}, or simply @kbd{c} while column view
+is active), but you can still open, read, and edit the entry below each
+headline.  Or, you can switch to column view after executing a sparse
+tree command and in this way get a table only for the selected items.
+Column view also works in agenda buffers (@pxref{Agenda views}) where
+queries have collected selected items, possibly from a number of files.
+
+@menu
+* Defining columns::            The COLUMNS format property
+* Using column view::           How to create and use column view
+@end menu
+
+@node Defining columns, Using column view, Column view, Column view
+@subsection Defining Columns
+@cindex column view, for properties
+@cindex properties, column view
+
+Setting up a column view first requires defining the columns.  This is
+done by defining a column format line.
+
+@menu
+* Scope of column definitions::  Where defined, where valid?
+* Column attributes::           Appearance and content of a column
+@end menu
+
+@node Scope of column definitions, Column attributes, Defining columns, Defining columns
+@subsubsection Scope of column definitions
+
+To define a column format for an entire file, use a line like
+
+@example
+#+COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
+@end example
+
+To specify a format that only applies to a specific tree, add a COLUMNS
+property to the top node of that tree, for example
+@example
+** Top node for columns view
+   :PROPERTIES:
+   :COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
+   :END:
+@end example
+
+If a @code{COLUMNS} property is present in an entry, it defines columns
+for the entry itself, and for the entire subtree below it.  Since the
+column definition is part of the hierarchical structure of the document,
+you can define columns on level 1 that are general enough for all
+sublevels, and more specific columns further down, when you edit a
+deeper part of the tree.
+
+@node Column attributes,  , Scope of column definitions, Defining columns
+@subsubsection Column attributes
+A column definition sets the attributes of a column.  The general
+definition looks like this:
+
+@example
+ %[width]property[(title)][@{summary-type@}]
+@end example
+
+@noindent
+Except for the percent sign and the property name, all items are
+optional.  The individual parts have the following meaning:
+
+@example
+width           @r{An integer specifying the width of the column in characters.}
+                @r{If omitted, the width will be determined automatically.}
+property        @r{The property that should be edited in this column.}
+(title)         @r{The header text for the column. If omitted, the}
+                @r{property name is used.}
+@{summary-type@}  @r{The summary type.  If specified, the column values for}
+                @r{parent nodes are computed from the children.}
+                @r{Supported summary types are:}
+                @{+@}  @r{Sum numbers in this column.}
+                @{:@}  @r{Sum times, HH:MM:SS, plain numbers are hours.}
+                @{X@}  @r{Checkbox status, [X] if all children are [X].}
+@end example
+
+@noindent
+Here is an example for a complete columns definition, along with allowed
+values.
+
+@example
+:COLUMNS:  %20ITEM %9Approved(Approved?)@{X@} %Owner %11Status %10Time_Spent@{:@}
+:Owner_ALL:    Tammy Mark Karl Lisa Don
+:Status_ALL:   "In progress" "Not started yet" "Finished" ""
+:Approved_ALL: "[ ]" "[X]"
+@end example
+
+The first column, @samp{%25ITEM}, means the first 25 characters of the
+item itself, i.e. of the headline.  You probably always should start the
+column definition with the ITEM specifier.  The other specifiers create
+columns @samp{Owner} with a list of names as allowed values, for
+@samp{Status} with four different possible values, and for a checkbox
+field @samp{Approved}.  When no width is given after the @samp{%}
+character, the column will be exactly as wide as it needs to be in order
+to fully display all values.  The @samp{Approved} column does have a
+modified title (@samp{Approved?}, with a question mark).  Summaries will
+be created for the @samp{Time_Spent} column by adding time duration
+expressions like HH:MM, and for the @samp{Approved} column, by providing
+an @samp{[X]} status if all children have been checked.
+
+@node Using column view,  , Defining columns, Column view
+@subsection Using Column View
+
+@table @kbd
+@tsubheading{Turning column view on and off}
+@kindex C-c C-x C-c
+@item C-c C-x C-c
+Create the column view for the local environment.  This command searches
+the hierarchy, up from point, for a @code{COLUMNS} property that defines
+a format.  When one is found, the column view table is established for
+the entire tree, starting from the entry that contains the @code{COLUMNS}
+property.  If none is found, the format is taken from the @code{#+COLUMNS}
+line or from the variable @code{org-columns-default-format}, and column
+view is established for the current entry and its subtree.
+@kindex q
+@item q
+Exit column view.
+@tsubheading{Editing values}
+@item @key{left} @key{right} @key{up} @key{down}
+Move through the column view from field to field.
+@kindex S-@key{left}
+@kindex S-@key{right}
+@item  S-@key{left}/@key{right}
+Switch to the next/previous allowed value of the field.  For this, you
+have to have specified allowed values for a property.
+@kindex n
+@kindex p
+@itemx  n / p
+Same as @kbd{S-@key{left}/@key{right}}
+@kindex e
+@item e
+Edit the property at point.  For the special properties, this will
+invoke the same interface that you normally use to change that
+property.  For example, when editing a TAGS property, the tag completion
+or fast selection interface will pop up.
+@kindex v
+@item v
+View the full value of this property.  This is useful if the width of
+the column is smaller than that of the value.
+@kindex a
+@item a
+Edit the list of allowed values for this property.  If the list is found
+in the hierarchy, the modified values is stored there.  If no list is
+found, the new value is stored in the first entry that is part of the
+current column view.
+@tsubheading{Modifying the table structure}
+@kindex <
+@kindex >
+@item < / >
+Make the column narrower/wider by one character.
+@kindex S-M-@key{right}
+@item S-M-@key{right}
+Insert a new column, to the right of the current column.
+@kindex S-M-@key{left}
+@item S-M-@key{left}
+Delete the current column.
+@end table
+
+@node Property API,  , Column view, Properties and columns
+@section The Property API
+@cindex properties, API
+@cindex API, for properties
+
+There is a full API for accessing and changing properties.  This API can
+be used by Emacs Lisp programs to work with properties and to implement
+features based on them.  For more information see @ref{Using the
+property API}.
+
+@node Timestamps, Agenda views, Properties and columns, Top
+@chapter Timestamps
+@cindex time stamps
+@cindex date stamps
+
+Items can be labeled with timestamps to make them useful for project
+planning.
+
+@menu
+* Time stamps::                 Assigning a time to a tree entry
+* Creating timestamps::         Commands which insert timestamps
+* Deadlines and scheduling::    Planning your work
+* Progress logging::            Documenting when what work was done.
+@end menu
+
+
+@node Time stamps, Creating timestamps, Timestamps, Timestamps
+@section Time stamps, deadlines and scheduling
+@cindex time stamps
+@cindex ranges, time
+@cindex date stamps
+@cindex deadlines
+@cindex scheduling
+
+A time stamp is a specification of a date (possibly with time or a range
+of times) in a special format, either @samp{<2003-09-16 Tue>} or
+@samp{<2003-09-16 Tue 09:39>} or @samp{<2003-09-16 Tue
+12:00-12:30>}@footnote{This is the standard ISO date/time format.  If
+you cannot get used to these, see @ref{Custom time format}}.  A time
+stamp can appear anywhere in the headline or body of an org-tree entry.
+Its presence causes entries to be shown on specific dates in the agenda
+(@pxref{Weekly/Daily agenda}).  We distinguish:
+
+@table @var
+@item Plain time stamp
+@cindex timestamp
+A simple time stamp just assigns a date/time to an item.  This is just
+like writing down an appointment in a paper agenda, or like writing down
+an event in a diary, when you want to take note of when something
+happened.  In the timeline and agenda displays, the headline of an entry
+associated with a plain time stamp will be shown exactly on that date.
+
+@example
+* Meet Peter at the movies <2006-11-01 Wed 19:15>
+* Discussion on climate change <2006-11-02 Thu 20:00-22:00>
+@end example
+
+@item Time stamp with repeater interval
+@cindex timestamp, with repeater interval
+A time stamp may contain a @emph{repeater interval}, indicating that it
+applies not only on the given date, but again and again after a certain
+interval of N days (d), weeks (w), months(m), or years(y).  The
+following will show up in the agenda every Wednesday:
+
+@example
+* Pick up Sam at school <2007-05-16 Wed 12:30 +1w>
+@end example
+
+@item Diary-style sexp entries
+For more complex date specifications, Org-mode supports using the
+special sexp diary entries implemented in the Emacs calendar/diary
+package.  For example
+
+@example
+* The nerd meeting on every 2nd Thursday of the month
+  <%%(diary-float t 4 2)>
+@end example
+
+@item Time/Date range
+@cindex timerange
+@cindex date range
+Two time stamps connected by @samp{--} denote a range.  The headline
+will be shown on the first and last day of the range, and on any dates
+that are displayed and fall in the range.  Here is an example:
+
+@example
+** Meeting in Amsterdam
+   <2004-08-23 Mon>--<2004-08-26 Thu>
+@end example
+
+@item Inactive time stamp
+@cindex timestamp, inactive
+@cindex inactive timestamp
+Just like a plain time stamp, but with square brackets instead of
+angular ones.  These time stamps are inactive in the sense that they do
+@emph{not} trigger an entry to show up in the agenda.
+
+@example
+* Gillian comes late for the fifth time [2006-11-01 Wed]
+@end example
+
+@end table
+
+@node Creating timestamps, Deadlines and scheduling, Time stamps, Timestamps
 @section Creating timestamps
 @cindex creating timestamps
 @cindex timestamps, creating
@@ -2899,61 +3737,40 @@ format.
 Prompt for a date and insert a corresponding time stamp.  When the
 cursor is at a previously used time stamp, it is updated to NOW.  When
 this command is used twice in succession, a time range is inserted.
-
+@c
 @kindex C-u C-c .
 @item C-u C-c .
 Like @kbd{C-c .}, but use the alternative format which contains date
 and time.  The default time can be rounded to multiples of 5 minutes,
 see the option @code{org-time-stamp-rounding-minutes}.
-
+@c
 @kindex C-c !
 @item C-c !
-Like @kbd{C-c .}, but insert an inactive time stamp not triggering the
-agenda.
-
+Like @kbd{C-c .}, but insert an inactive time stamp that will not cause
+an agenda entry.
+@c
 @kindex C-c <
 @item C-c <
 Insert a time stamp corresponding to the cursor date in the Calendar.
-
+@c
 @kindex C-c >
 @item C-c >
 Access the Emacs calendar for the current date.  If there is a
 timestamp in the current line, goto the corresponding date
 instead.
-
+@c
 @kindex C-c C-o
 @item C-c C-o
 Access the agenda for the date given by the time stamp or -range at
 point (@pxref{Weekly/Daily agenda}).
-
-@kindex C-c C-d
-@item C-c C-d
-Insert @samp{DEADLINE} keyword along with a stamp.  The insertion will
-happen in the line directly following the headline.  
-@c FIXME Any CLOSED timestamp will be removed.????????
-
-@kindex C-c C-w
-@cindex sparse tree, for deadlines
-@item C-c C-w
-Create a sparse tree with all deadlines that are either past-due, or
-which will become due within @code{org-deadline-warning-days}.
-With @kbd{C-u} prefix, show all deadlines in the file.  With a numeric
-prefix, check that many days.  For example, @kbd{C-1 C-c C-w} shows
-all deadlines due tomorrow.
-
-@kindex C-c C-s
-@item C-c C-s
-Insert @samp{SCHEDULED} keyword along with a stamp.  The insertion will
-happen in the line directly following the headline.  Any CLOSED
-timestamp will be removed.
-
+@c
 @kindex S-@key{left}
 @kindex S-@key{right}
 @item S-@key{left}
 @itemx S-@key{right}
 Change date at cursor by one day.  These key bindings conflict with
 CUA-mode (@pxref{Conflicts}).
-
+@c
 @kindex S-@key{up}
 @kindex S-@key{down}
 @item S-@key{up}
@@ -2963,8 +3780,7 @@ year, month, day, hour or minute.  Note that if the cursor is in a
 headline and not at a time stamp, these same keys modify the priority of
 an item.  (@pxref{Priorities}). The key bindings also conflict with
 CUA-mode (@pxref{Conflicts}).
-
-
+@c
 @kindex C-c C-y
 @cindex evaluate time range
 @item C-c C-y
@@ -2976,9 +3792,10 @@ into the following column).
 
 @menu
 * The date/time prompt::        How org-mode helps you entering date and time
+* Custom time format::          Making dates look differently
 @end menu
 
-@node The date/time prompt,  , Creating timestamps, Creating timestamps
+@node The date/time prompt, Custom time format, Creating timestamps, Creating timestamps
 @subsection The date/time prompt
 @cindex date, reading in minibuffer
 @cindex time, reading in minibuffer
@@ -3047,8 +3864,8 @@ One month back.
 Choose date in calendar (only if nothing was typed into minibuffer).
 @end table
 
-@node Custom time format, Repeating items, Creating timestamps, Timestamps
-@section Custom time format
+@node Custom time format,  , The date/time prompt, Creating timestamps
+@subsection Custom time format
 @cindex custom date/time format
 @cindex time format, custom
 @cindex date format, custom
@@ -3081,6 +3898,9 @@ the stamp, @kbd{S-@key{up}/@key{down}} will change the stamp by one day,
 just like @kbd{S-@key{left}/@key{right}}.  At the end of the stamp, the
 time will be changed by one minute.
 @item
+If the time stamp contains a range of clock times or a repeater, these
+will not be overlayed, but remain in the buffer as they were.
+@item
 When you delete a time stamp character-by-character, it will only
 disappear from the buffer after @emph{all} (invisible) characters
 belonging to the ISO timestamp have been removed.
@@ -3090,48 +3910,119 @@ using dates in tables, table alignment will be messed up.  If the custom
 format is shorter, things do work as expected.
 @end itemize
 
-@node Repeating items, Progress logging, Custom time format, Timestamps
-@section Repeating items
-@cindex TODO items, repeating
-@cindex deadlines, repeating
-@cindex scheduling, repeating
 
-Org-mode integrates with the Emacs calendar and diary to display cyclic
-appointments, anniversaries and other special entries in the agenda
-(@pxref{Weekly/Daily agenda}).  However, it can be useful to have
-certain deadlines and scheduling items to auto-repeat.  The advantage of
-a deadline or scheduled item is that the they produce warnings ahead of
-time and automatically forward themselves in the agenda until they are
-done.  The abstract difference is therefore between cyclic
-@i{appointments} and cyclic @i{action items}.  For appointments you
-should use the diary, for actions you can uses an org-mode deadline or
-scheduling time stamp together with a REPEAT cookie.  For example:
+@node Deadlines and scheduling, Progress logging, Creating timestamps, Timestamps
+@section Deadlines and Scheduling
+
+A time stamp may be preceded by special keywords to facilitate planning
+of work:
+
+@table @var
+@item DEADLINE
+@cindex DEADLINE keyword
+The task (most likely a TODO item) is supposed to be finished on that
+date, and it will be listed then.  In addition, the compilation for
+@emph{today} will carry a warning about the approaching or missed
+deadline, starting @code{org-deadline-warning-days} before the due date,
+and continuing until the entry is marked DONE.  An example:
+
+@example
+*** TODO write article about the Earth for the Guide
+    The editor in charge is [[bbdb:Ford Prefect]]
+    DEADLINE: <2004-02-29 Sun>
+@end example
+
+@item SCHEDULED
+@cindex SCHEDULED keyword
+You are planning to start working on that task on the given date. The
+headline will be listed under the given date@footnote{It will still be
+listed on that date after it has been marked DONE.  If you don't like
+this, set the variable @code{org-agenda-skip-scheduled-if-done}.}.  In
+addition, a reminder that the scheduled date has passed will be present
+in the compilation for @emph{today}, until the entry is marked DONE.
+I.e., the task will automatically be forwarded until completed.
+
+@example
+*** TODO Call Trillian for a date on New Years Eve.
+    SCHEDULED: <2004-12-25 Sat>
+@end example
+@end table
+
+@menu
+* Inserting deadline/schedule::  
+* Repeated tasks::              
+@end menu
+
+@node Inserting deadline/schedule, Repeated tasks, Deadlines and scheduling, Deadlines and scheduling
+@subsection Inserting deadline/schedule
+
+The following commands allow to quickly insert a deadline or to schedule
+an item:
+
+@table @kbd
+@c
+@kindex C-c C-d
+@item C-c C-d
+Insert @samp{DEADLINE} keyword along with a stamp.  The insertion will
+happen in the line directly following the headline.
+@c FIXME Any CLOSED timestamp will be removed.????????
+@c
+@kindex C-c C-w
+@cindex sparse tree, for deadlines
+@item C-c C-w
+Create a sparse tree with all deadlines that are either past-due, or
+which will become due within @code{org-deadline-warning-days}.
+With @kbd{C-u} prefix, show all deadlines in the file.  With a numeric
+prefix, check that many days.  For example, @kbd{C-1 C-c C-w} shows
+all deadlines due tomorrow.
+@c
+@kindex C-c C-s
+@item C-c C-s
+Insert @samp{SCHEDULED} keyword along with a stamp.  The insertion will
+happen in the line directly following the headline.  Any CLOSED
+timestamp will be removed.
+@end table
+
+@node Repeated tasks,  , Inserting deadline/schedule, Deadlines and scheduling
+@subsection Repeated Tasks
 
+Some tasks need to be repeated again and again, and Org-mode therefore
+allows to use a repeater in a DEADLINE or SCHEDULED time stamp, for
+example:
 @example
-* TODO Replace batteries in smoke detector REPEAT(+18m)
-  SCHEDULED: <2007-01-01 Mon>
+** TODO Pay the rent
+   DEADLINE: <2005-10-01 Sat +1m>
+@end example
 
-* TODO Get dentist appointment REPEAT(+6m)
-  SCHEDULED: <2006-12-19 Tue>
+Deadlines and scheduled items produce entries in the agenda when they
+are over-due, so it is important to be able to mark such an entry as
+completed once you have done so.  When you mark a DEADLINE or a SCHEDULE
+with the todo keyword DONE, it will no longer produce entries in the
+agenda. The problem with this is, however, that then also the
+@emph{next} instance of the repeated entry will not be active.  Org-mode
+deals with this in the following way: When you try to mark such an entry
+DONE (using @kbd{C-c C-t}), it will shift the base date of the repeating
+time stamp by the repeater interval, and immediately set the entry state
+back to TODO.  In the example above, setting the state to DONE would
+actually switch the date like this:
 
-* TODO Tax report to IRS REPEAT(+1y)
-  DEADLINE: <2007-04-01 Sun>
+@example
+** TODO Pay the rent
+   DEADLINE: <2005-11-01 Tue +1m>
 @end example
 
-Each time you try to mark one of these entries DONE using @kbd{C-c C-t},
-they will automatically switch back to the state TODO, and the
-deadline/scheduling will be shifted accordingly.  The time units
-recognized by org-mode are year (y), month (m), week (w), and day (d).
-Org-mode will also prompt you for a note and record the fact that you
-have closed this item in a note under the headline.
+You will also be prompted for a note that will be put under the DEADLINE
+line to keep a record that you actually acted on the previous instance
+of this deadline.
 
-One unusual property of these repeating items is that only one instance
-of each exist at any given time.  So if you look back or ahead in the
-agenda, you will not find past and future instances, only the current
-one will show up.  Use a cyclic diary entry if you need all past and
-future instances to be visible in the agenda.
+As a consequence of shifting the base date, this entry will no longer be
+visible in the agenda when checking past dates, but all future instances
+will be visible.
 
-@node Progress logging,  , Repeating items, Timestamps
+You may have both scheduling and deadline information for a specific
+task - just make sure that the repeater intervals on both are the same.
+
+@node Progress logging,  , Deadlines and scheduling, Timestamps
 @section Progress Logging
 @cindex progress logging
 @cindex logging, of progress
@@ -3199,6 +4090,7 @@ these into a separate file that starts with:
 #+STARTUP: lognotestate
 @end example
 
+
 @node Clocking work time,  , Tracking TODO state changes, Progress logging
 @subsection Clocking work time
 
@@ -3269,284 +4161,28 @@ So to get a clock summary for the current day, you could write
 @example
 #+BEGIN: clocktable :maxlevel 2 :block today
 
-#+END: clocktable
-@end example
-and to use a specific time range you could write@footnote{Note that all
-parameters must be specified in a single line - the line is broken here
-only to fit it onto the manual.}
-@example
-#+BEGIN: clocktable :tstart "<2006-08-10 Thu 10:00>" 
-                    :tend "<2006-08-10 Thu 12:00>"
-
-#+END: clocktable
-@end example
-@kindex C-u C-c C-x C-u
-@item C-u C-c C-x C-u
-Update all dynamic blocks (@pxref{Dynamic blocks}).  This is useful if
-you have several clocktable blocks in a buffer.
-@end table
-
-The @kbd{l} key may be used in the timeline (@pxref{Timeline}) and in
-the agenda (@pxref{Weekly/Daily agenda}) to show which tasks have been
-worked on or closed during a day.
-
-@node Tags, Agenda views, Timestamps, Top
-@chapter Tags
-@cindex tags
-@cindex headline tagging
-@cindex matching, tags
-@cindex sparse tree, tag based
-
-If you wish to implement a system of labels and contexts for
-cross-correlating information, an excellent way is to assign @i{tags} to
-headlines.  Org-mode has extensive support for using tags.
-
-Every headline can contain a list of tags, at the end of the headline.
-Tags are normal words containing letters, numbers, @samp{_}, and
-@samp{@@}.  Tags must be preceded and followed by a single colon; like
-@samp{:WORK:}.  Several tags can be specified like @samp{:WORK:URGENT:}.
-
-@menu
-* Tag inheritance::             Tags use the tree structure of the outline
-* Setting tags::                How to assign tags to a headline
-* Tag searches::                Searching for combinations of tags
-@end menu
-
-@node Tag inheritance, Setting tags, Tags, Tags
-@section Tag inheritance
-@cindex inheritance, of tags
-@cindex sublevels, inclusion into tags match
-
-@i{Tags} make use of the hierarchical structure of outline trees.  If a
-heading has a certain tag, all subheadings will inherit the tag as
-well.  For example, in the list
-
-@example
-* Meeting with the French group      :WORK:
-** Summary by Frank                  :BOSS:NOTES:
-*** TODO Prepare slides for him      :ACTION:
-@end example
-
-@noindent
-the final heading will have the tags @samp{:WORK:}, @samp{:BOSS:},
-@samp{:NOTES:}, and @samp{:ACTION:}.  When executing tag searches and
-Org-mode finds that a certain headline matches the search criterion, it
-will not check any sublevel headline, assuming that these likely also
-match, and that the list of matches can become very long.  This may
-not be what you want, however, and you can influence inheritance and
-searching using the variables @code{org-use-tag-inheritance} and
-@code{org-tags-match-list-sublevels}.
-
-@node Setting tags, Tag searches, Tag inheritance, Tags
-@section Setting tags
-@cindex setting tags
-@cindex tags, setting
-
-@kindex M-@key{TAB}
-Tags can simply be typed into the buffer at the end of a headline.
-After a colon, @kbd{M-@key{TAB}} offers completion on tags.  There is
-also a special command for inserting tags:
-
-@table @kbd
-@kindex C-c C-c
-@item C-c C-c
-@cindex completion, of tags
-Enter new tags for the current headline.  Org-mode will either offer
-completion or a special single-key interface for setting tags, see
-below.  After pressing @key{RET}, the tags will be inserted and aligned
-to @code{org-tags-column}.  When called with a @kbd{C-u} prefix, all
-tags in the current buffer will be aligned to that column, just to make
-things look nice.  TAGS are automatically realigned after promotion,
-demotion, and TODO state changes (@pxref{TODO basics}).
-@end table
-
-Org will support tag insertion based on a @emph{list of tags}.  By
-default this list is constructed dynamically, containing all tags
-currently used in the buffer.  You may also globally specify a hard list
-of tags with the variable @code{org-tag-alist}.  Finally you can set
-the default tags for a given file with lines like
-
-@example
-#+TAGS: @@WORK @@HOME @@TENNISCLUB
-#+TAGS: Laptop Car PC Sailboat
-@end example
-
-If you have globally defined your preferred set of tags using the
-variable @code{org-tag-alist}, but would like to use a dynamic tag list
-in a specific file: Just add an empty TAGS option line to that file:
-
-@example
-#+TAGS:
-@end example
-
-The default support method for entering tags is minibuffer completion.
-However, Org-mode also implements a much better method: @emph{fast tag
-selection}.  This method allows to select and deselect tags with a
-single key per tag.  To function efficiently, you should assign unique
-keys to most tags.  This can be done globally with
-
-@lisp
-(setq org-tag-alist '(("@@WORK" . ?w) ("@@HOME" . ?h) ("Laptop" . ?l)))
-@end lisp
-
-@noindent or on a per-file basis with
-
-@example
-#+TAGS: @@WORK(w)  @@HOME(h)  @@TENNISCLUB(t)  Laptop(l)  PC(p)
-@end example
-
-@noindent
-You can also group together tags that are mutually exclusive.  With
-curly braces@footnote{In @code{org-mode-alist} use
-@code{'(:startgroup)} and @code{'(:endgroup)}, respectively.  Several
-groups are allowed.}
-
-@example
-#+TAGS: @{ @@WORK(w)  @@HOME(h)  @@TENNISCLUB(t) @}  Laptop(l)  PC(p)
-@end example
-
-@noindent you indicate that at most one of @samp{@@WORK}, @samp{@@HOME},
-and @samp{@@TENNISCLUB} should be selected.
-
-@noindent Don't forget to press @kbd{C-c C-c} with the cursor in one of
-these lines to activate any changes.
-
-If at least one tag has a selection key, pressing @kbd{C-c C-c} will
-automatically present you with a special interface, listing inherited
-tags, the tags of the current headline, and a list of all legal tags
-with corresponding keys@footnote{Keys will automatically be assigned to
-tags which have no configured keys.}.  In this interface, you can use
-the following keys:
-
-@table @kbd
-@item a-z...
-Pressing keys assigned to tags will add or remove them from the list of
-tags in the current line.  Selecting a tag in a group of mutually
-exclusive tags will turn off any other tags from that group.
-@kindex @key{TAB}
-@item @key{TAB}
-Enter a tag in the minibuffer, even if the tag is not in the predefined
-list.  You will be able to complete on all tags present in the buffer.
-@kindex @key{SPC}
-@item @key{SPC}
-Clear all tags for this line.
-@kindex @key{RET}
-@item @key{RET}
-Accept the modified set.
-@item C-g
-Abort without installing changes.
-@item q
-If @kbd{q} is not assigned to a tag, it aborts like @kbd{C-g}.
-@item !
-Turn off groups of mutually exclusive tags.  Use this to (as an
-exception) assign several tags from such a group.
-@item C-c
-Toggle auto-exit after the next change (see below).
-If you are using expert mode, the first @kbd{C-c} will display the
-selection window.
-@end table
-
-@noindent
-This method lets you assign tags to a headline with very few keys.  With
-the above setup, you could clear the current tags and set @samp{@@HOME},
-@samp{Laptop} and @samp{PC} tags with just the following keys: @kbd{C-c
-C-c @key{SPC} h l p @key{RET}}.  Switching from @samp{@@HOME} to
-@samp{@@WORK} would be done with @kbd{C-c C-c w @key{RET}} or
-alternatively with @kbd{C-c C-c C-c w}.  Adding the non-predefined tag
-@samp{Sarah} could be done with @kbd{C-c C-c @key{TAB} S a r a h
-@key{RET} @key{RET}}.
-
-If you find that most of the time, you need only a single keypress to
-modify your list of tags, set the variable
-@code{org-fast-tag-selection-single-key}.  Then you no longer have to
-press @key{RET} to exit fast tag selection - it will immediately exit
-after the first change.  If you then occasionally need more keys, press
-@kbd{C-c} to turn off auto-exit for the current tag selection process
-(in effect: start selection with @kbd{C-c C-c C-c} instead of @kbd{C-c
-C-c}).  If you set the variable to the value @code{expert}, the special
-window is not even shown for single-key tag selection, it comes up only
-when you press an extra @kbd{C-c}.
-
-@node Tag searches,  , Setting tags, Tags
-@section Tag searches
-@cindex tag searches
-@cindex searching for tags
-
-Once a tags system has been set up, it can be used to collect related
-information into special lists.
-
-@table @kbd
-@kindex C-c \
-@item C-c \
-Create a sparse tree with all headlines matching a tags search.  With a
-@kbd{C-u} prefix argument, ignore headlines that are not a TODO line.
-@kindex C-c a m
-@item C-c a m
-Create a global list of tag matches from all agenda files.
-@xref{Matching headline tags}.
-@kindex C-c a M
-@item C-c a M
-Create a global list of tag matches from all agenda files, but check
-only TODO items and force checking subitems (see variable
-@code{org-tags-match-list-sublevels}).
-@end table
-
-@cindex Boolean logic, for tag searches
-A @i{tags} search string can use Boolean operators @samp{&} for AND and
-@samp{|} for OR.  @samp{&} binds more strongly than @samp{|}.
-Parenthesis are currently not implemented.  A tag may also be preceded
-by @samp{-}, to select against it, and @samp{+} is syntactic sugar for
-positive selection.  The AND operator @samp{&} is optional when @samp{+}
-or @samp{-} is present.  Examples:
-
-@table @samp
-@item +WORK-BOSS
-Select headlines tagged @samp{:WORK:}, but discard those also tagged
-@samp{:BOSS:}.
-@item WORK|LAPTOP
-Selects lines tagged @samp{:WORK:} or @samp{:LAPTOP:}.
-@item WORK|LAPTOP&NIGHT
-Like before, but require the @samp{:LAPTOP:} lines to be tagged also
-@samp{NIGHT}.
-@end table
-
-@cindex TODO keyword matching, with tags search
-If you are using multi-state TODO keywords (@pxref{TODO extensions}), it
-can be useful to also match on the TODO keyword.  This can be done by
-adding a condition after a slash to a tags match.  The syntax is similar
-to the tag matches, but should be applied with consideration: For
-example, a positive selection on several TODO keywords can not
-meaningfully be combined with boolean AND.  However, @emph{negative
-selection} combined with AND can be meaningful.  To make sure that only
-lines are checked that actually have any TODO keyword, use @kbd{C-c a
-M}, or equivalently start the todo part after the slash with @samp{!}.
-Examples:
+#+END: clocktable
+@end example
+and to use a specific time range you could write@footnote{Note that all
+parameters must be specified in a single line - the line is broken here
+only to fit it onto the manual.}
+@example
+#+BEGIN: clocktable :tstart "<2006-08-10 Thu 10:00>" 
+                    :tend "<2006-08-10 Thu 12:00>"
 
-@table @samp
-@item WORK/WAITING
-Select @samp{:WORK:}-tagged TODO lines with the specific TODO
-keyword @samp{WAITING}.
-@item WORK/!-WAITING-NEXT
-Select @samp{:WORK:}-tagged TODO lines that are neither @samp{WAITING}
-nor @samp{NEXT}
-@item WORK/+WAITING|+NEXT
-Select @samp{:WORK:}-tagged TODO lines that are either @samp{WAITING} or
-@samp{NEXT}.
+#+END: clocktable
+@end example
+@kindex C-u C-c C-x C-u
+@item C-u C-c C-x C-u
+Update all dynamic blocks (@pxref{Dynamic blocks}).  This is useful if
+you have several clocktable blocks in a buffer.
 @end table
 
-@cindex regular expressions, with tags search
-Any element of the tag/todo match can be a regular expression - in this
-case it must be enclosed in curly braces.  For example,
-@samp{WORK+@{^BOSS.*@}} matches headlines that contain the tag
-@samp{WORK} and any tag @i{starting} with @samp{BOSS}.
-
-@cindex level, require for tags match
-You can also require a headline to be of a certain level, by writing
-instead of any TAG an expression like @samp{LEVEL=3}.  For example, a
-search @samp{+LEVEL=3+BOSS/-DONE} lists all level three headlines that
-have the tag BOSS and are @emph{not} marked with the todo keyword DONE.
+The @kbd{l} key may be used in the timeline (@pxref{Timeline}) and in
+the agenda (@pxref{Weekly/Daily agenda}) to show which tasks have been
+worked on or closed during a day.
 
-@node Agenda views, Embedded LaTeX, Tags, Top
+@node Agenda views, Embedded LaTeX, Timestamps, Top
 @chapter Agenda Views
 @cindex agenda views
 
@@ -3654,7 +4290,7 @@ Create the calendar-like agenda (@pxref{Weekly/Daily agenda}).
 Create a list of all TODO items (@pxref{Global TODO list}).
 @item m @r{/} M
 Create a list of headlines matching a TAGS expression (@pxref{Matching
-headline tags}).
+tags and properties}).
 @item L
 Create the timeline view for the current buffer (@pxref{Timeline}).
 @item # @r{/} !
@@ -3683,7 +4319,7 @@ In this section we describe the built-in views.
 @menu
 * Weekly/Daily agenda::         The calendar page with current tasks
 * Global TODO list::            All unfinished action items
-* Matching headline tags::      Structured information with fine-tuned search
+* Matching tags and properties::  Structured information with fine-tuned search
 * Timeline::                    Time-sorted view for single file
 * Stuck projects::              Find projects you need to review
 @end menu
@@ -3743,8 +4379,25 @@ Sunrise/Sunset times, show lunar phases and to convert to other
 calendars, respectively.  @kbd{c} can be used to switch back and forth
 between calendar and agenda.
 
+If you are using the diary only for sexp entries and holidays, it is
+faster to not use the above setting, but instead to copy or even move
+the entries into an Org-mode file. Org-mode evaluates diary-style sexp
+entries, and does it faster because there is no overhead for first
+creating the diary display.  Note that the sexp entries must start at
+the left margin, no white space is allowed before them.  For example,
+the following segment of an Org-mode file will be processed and entries
+will be made in the agenda:
+
+@example
+* Birthdays and similar stuff
+#+CATEGORY: Holiday
+%%(org-calendar-holiday)   ; special function for holiday names
+#+CATEGORY: Ann
+%%(diary-anniversary 14  5 1956) Arthur Dent is %d years old
+%%(diary-anniversary  2 10 1869) Mahatma Gandhi would be %d years old
+@end example
 
-@node Global TODO list, Matching headline tags, Weekly/Daily agenda, Built-in agenda views
+@node Global TODO list, Matching tags and properties, Weekly/Daily agenda, Built-in agenda views
 @subsection The global TODO list
 @cindex global TODO list
 @cindex TODO list, global
@@ -3762,10 +4415,12 @@ the TODO entries directly from that buffer (@pxref{Agenda commands}).
 @kindex C-c a T
 @item C-c a T
 @cindex TODO keyword matching
-Like the above, but allows selection of a specific TODO keyword.  You can
-also do this by specifying a prefix argument to @kbd{C-c a t}.  With a
-@kbd{C-u} prefix you are prompted for a keyword.  With a numeric
-prefix, the Nth keyword in @code{org-todo-keywords} is selected.
+Like the above, but allows selection of a specific TODO keyword.  You
+can also do this by specifying a prefix argument to @kbd{C-c a t}.  With
+a @kbd{C-u} prefix you are prompted for a keyword, and you may also
+specify several keywords by separating them with @samp{|} as boolean OR
+operator.  With a numeric prefix, the Nth keyword in
+@code{org-todo-keywords} is selected.
 @kindex r
 The @kbd{r} key in the agenda buffer regenerates it, and you can give
 a prefix argument to this command to change the selected TODO keyword,
@@ -3796,9 +4451,10 @@ and omit the sublevels from the global list.  Configure the variable
 @code{org-agenda-todo-list-sublevels} to get this behavior.
 @end itemize
 
-@node Matching headline tags, Timeline, Global TODO list, Built-in agenda views
-@subsection Matching headline tags
+@node Matching tags and properties, Timeline, Global TODO list, Built-in agenda views
+@subsection Matching Tags and Properties
 @cindex matching, of tags
+@cindex matching, of properties
 @cindex tags view
 
 If headlines in the agenda files are marked with @emph{tags}
@@ -3824,7 +4480,7 @@ together with a tags match is also possible, see @ref{Tag searches}.
 The commands available in the tags list are described in @ref{Agenda
 commands}.
 
-@node Timeline, Stuck projects, Matching headline tags, Built-in agenda views
+@node Timeline, Stuck projects, Matching tags and properties, Built-in agenda views
 @subsection Timeline for a single file
 @cindex timeline, single file
 @cindex time-sorted view
@@ -3834,7 +4490,7 @@ file in a @emph{time-sorted view}.  The main purpose of this command is
 to give an overview over events in a project.
 
 @table @kbd
-@kindex C-a a L
+@kindex C-c a L
 @item C-c a L
 Show a time-sorted view of the org file, with all time-stamped items.
 When called with a @kbd{C-u} prefix, all unfinished TODO entries
@@ -3875,16 +4531,18 @@ Lets assume that you, in your own way of using Org-mode, identify
 projects with a tag PROJECT, and that you use a todo keyword MAYBE to
 indicate a project that should not be considered yet.  Lets further
 assume that the todo keyword DONE marks finished projects, and that NEXT
-and TODO indicate next actions.  Finally, the tag @@SHOP indicates
-shopping and is a next action even without the NEXT tag.  In this case
-you would start by identifying eligible projects with a tags/todo match
-@samp{+PROJECT/-MAYBE-DONE}, and then check for TODO, NEXT and @@SHOP in
-the subtree to identify projects that are not stuck.  The correct
-customization for this is
+and TODO indicate next actions.  The tag @@SHOP indicates shopping and
+is a next action even without the NEXT tag.  Finally, if the project
+contains the special word IGNORE anywhere, it should not be listed
+either.  In this case you would start by identifying eligible projects
+with a tags/todo match @samp{+PROJECT/-MAYBE-DONE}, and then check for
+TODO, NEXT, @@SHOP, and IGNORE in the subtree to identify projects that
+are not stuck.  The correct customization for this is
 
 @lisp
 (setq org-stuck-projects
-      ("+PROJECT/-MAYBE-DONE" ("NEXT" "TODO") ("@@SHOP")))
+      '("+PROJECT/-MAYBE-DONE" ("NEXT" "TODO") ("@@SHOP")
+                               "\\<IGNORE\\>"))
 @end lisp
 
 
@@ -4031,11 +4689,11 @@ Previous line (same as @key{down}).
 @item mouse-3
 @itemx @key{SPC}
 Display the original location of the item in another window.
-
+@c
 @kindex L
 @item L
 Display original location and recenter that window.
-
+@c
 @kindex mouse-2
 @kindex mouse-1
 @kindex @key{TAB}
@@ -4044,11 +4702,11 @@ Display original location and recenter that window.
 @itemx @key{TAB}
 Go to the original location of the item in another window.  Under Emacs
 22, @kbd{mouse-1} will also works for this.
-
+@c
 @kindex @key{RET}
 @itemx @key{RET}
 Go to the original location of the item and delete other windows.
-
+@c
 @kindex f
 @item f
 Toggle Follow mode.  In Follow mode, as you move the cursor through
@@ -4056,14 +4714,14 @@ the agenda buffer, the other window always shows the corresponding
 location in the org file.  The initial setting for this mode in new
 agenda buffers can be set with the variable
 @code{org-agenda-start-with-follow-mode}.
-
+@c
 @kindex b
 @item b
 Display the entire subtree of the current item in an indirect buffer.
 With numerical prefix ARG, go up to this level and then take that tree.
 If ARG is negative, go up that many levels.  With @kbd{C-u} prefix, do
 not remove the previously used indirect buffer.
-
+@c
 @kindex l
 @item l
 Toggle Logbook mode.  In Logbook mode, entries that where marked DONE while
@@ -4075,24 +4733,25 @@ as are entries that have been clocked on that day.
 @kindex o
 @item o
 Delete other windows.
-
-@kindex w
-@item w
-Switch to weekly view (7 days displayed together).
-
+@c
 @kindex d
-@item d
-Switch to daily view (just one day displayed).
-
+@kindex w
+@kindex m
+@kindex y
+@item d w m y
+Switch to day/week/month/year view.  When switching to day or week view,
+this setting becomes the default for subseqent agenda commands.  Since
+month and year views are slow to create, the do not become the default.
+@c
 @kindex D
 @item D
 Toggle the inclusion of diary entries.  See @ref{Weekly/Daily agenda}.
-
+@c
 @kindex g
 @item g
 Toggle the time grid on and off.  See also the variables
 @code{org-agenda-use-time-grid} and @code{org-agenda-time-grid}.
-
+@c
 @kindex r
 @item r
 Recreate the agenda buffer, for example to reflect the changes
@@ -4100,21 +4759,21 @@ after modification of the time stamps of items with S-@key{left} and
 S-@key{right}.  When the buffer is the global todo list, a prefix
 argument is interpreted to create a selective list for a specific TODO
 keyword.
-
+@c
 @kindex s
 @item s
 Save all Org-mode buffers in the current Emacs session.
-
+@c
 @kindex @key{right}
 @item @key{right}
 Display the following @code{org-agenda-ndays} days.  For example, if
 the display covers a week, switch to the following week.  With prefix
 arg, go forward that many times @code{org-agenda-ndays} days.
-
+@c
 @kindex @key{left}
 @item @key{left}
 Display the previous dates.
-
+@c
 @kindex .
 @item .
 Goto today.
@@ -4124,53 +4783,53 @@ Goto today.
 
 @item 0-9
 Digit argument.
-
+@c
 @cindex undoing remote-editing events
 @cindex remote editing, undo
 @kindex C-_
 @item C-_
 Undo a change due to a remote editing command.  The change is undone
 both in the agenda buffer and in the remote buffer.
-
+@c
 @kindex t
 @item t
 Change the TODO state of the item, both in the agenda and in the
 original org file.
-
+@c
 @kindex C-k
 @item C-k
 Delete the current agenda item along with the entire subtree belonging
 to it in the original Org-mode file.  If the text to be deleted remotely
 is longer than one line, the kill needs to be confirmed by the user.  See
 variable @code{org-agenda-confirm-kill}.
-
+@c
 @kindex $
 @item $
 Archive the subtree corresponding to the current headline.
-
+@c
 @kindex T
 @item T
 Show all tags associated with the current item.  Because of
 inheritance, this may be more than the tags listed in the line itself.
-
+@c
 @kindex :
 @item :
 Set tags for the current headline.
-
+@c
 @kindex a
 @item a
 Toggle the ARCHIVE tag for the current headline.
-
+@c
 @kindex ,
 @item ,
 Set the priority for the current item.  Org-mode prompts for the
 priority character. If you reply with @key{SPC}, the priority cookie
 is removed from the entry.
-
+@c
 @kindex P
 @item P
 Display weighted priority of current item.
-
+@c
 @kindex +
 @kindex S-@key{up}
 @item +
@@ -4178,21 +4837,21 @@ Display weighted priority of current item.
 Increase the priority of the current item.  The priority is changed in
 the original buffer, but the agenda is not resorted.  Use the @kbd{r}
 key for this.
-
+@c
 @kindex -
 @kindex S-@key{down}
 @item -
 @itemx S-@key{down}
 Decrease the priority of the current item.
-
+@c
 @kindex C-c C-s
 @item C-c C-s
 Schedule this item
-
+@c
 @kindex C-c C-d
 @item C-c C-d
 Set a deadline for this item.
-
+@c
 @kindex S-@key{right}
 @item S-@key{right}
 Change the time stamp associated with the current line by one day into
@@ -4201,25 +4860,27 @@ example, @kbd{3 6 5 S-@key{right}} will change it by a year.  The
 stamp is changed in the original org file, but the change is not
 directly reflected in the agenda buffer.  Use the
 @kbd{r} key to update the buffer.
-
+@c
 @kindex S-@key{left}
 @item S-@key{left}
 Change the time stamp associated with the current line by one day
 into the past.
-
+@c
 @kindex >
 @item >
 Change the time stamp associated with the current line to today.
 The key @kbd{>} has been chosen, because it is the same as @kbd{S-.}
 on my keyboard.
-
+@c
 @kindex I
 @item I
 Start the clock on the current item.  If a clock is running already, it
 is stopped first.
+@c
 @kindex O
 @item O
 Stop the previously started clock.
+@c
 @kindex X
 @item X
 Cancel the currently running clock.
@@ -4229,11 +4890,11 @@ Cancel the currently running clock.
 @kindex c
 @item c
 Open the Emacs calendar and move to the date at the agenda cursor.
-
+@c
 @item c
 When in the calendar, compute and show the Org-mode agenda for the
 date at the cursor.
-
+@c
 @cindex diary entries, creating from agenda
 @kindex i
 @item i
@@ -4241,42 +4902,53 @@ Insert a new entry into the diary.  Prompts for the type of entry
 (day, weekly, monthly, yearly, anniversary, cyclic) and creates a new
 entry in the diary, just as @kbd{i d} etc. would do in the calendar.
 The date is taken from the cursor position.
-
+@c
 @kindex M
 @item M
 Show the phases of the moon for the three months around current date.
-
+@c
 @kindex S
 @item S
 Show sunrise and sunset times.  The geographical location must be set
 with calendar variables, see documentation of the Emacs calendar.
-
+@c
 @kindex C
 @item C
 Convert the date at cursor into many other cultural and historic
 calendars.
-
+@c
 @kindex H
 @item H
 Show holidays for three month around the cursor date.
-
+@c
 @c FIXME:  This should be a different key.
 @kindex C-c C-x C-c
 @item C-c C-x C-c
 Export a single iCalendar file containing entries from all agenda files.
 
+@tsubheading{Exporting to a file}
+@kindex C-x C-w
+@item C-x C-w
+@cindex exporting agenda views
+@cindex agenda views, exporting
+Write the agenda view to a file.  Depending on the extension of the
+selected file name, the view will be exported as HTML (extension
+@file{.html} or @file{.htm}), Postscript (extension @file{.ps}), or
+plain text (any other extension).  Use the variable
+@code{org-agenda-exporter-settings} to set options for @file{ps-print}
+and for @file{htmlize} to be used during export.
+
 @tsubheading{Quit and Exit}
 @kindex q
 @item q
 Quit agenda, remove the agenda buffer.
-
+@c
 @kindex x
 @cindex agenda files, removing buffers
 @item x
 Exit agenda, remove the agenda buffer and all buffers loaded by Emacs
 for the compilation of the agenda.  Buffers created by the user to
 visit org files will not be removed.
-
 @end table
 
 
@@ -4294,7 +4966,8 @@ dispatcher (@pxref{Agenda dispatcher}), just like the default commands.
 * Storing searches::            Type once, use often
 * Block agenda::                All the stuff you need in a single buffer
 * Setting Options::             Changing the rules
-* Batch processing::            Agenda views from the command line
+* Exporting Agenda Views::      Writing agendas to files.
+* Extracting Agenda Information for other programs::  
 @end menu
 
 @node Storing searches, Block agenda, Custom agenda views, Custom agenda views
@@ -4386,7 +5059,7 @@ your agenda for the current week, all TODO items that carry the tag
 command @kbd{C-c a o} provides a similar view for office tasks.
 
 
-@node Setting Options, Batch processing, Block agenda, Custom agenda views
+@node Setting Options, Exporting Agenda Views, Block agenda, Custom agenda views
 @subsection Setting Options for custom commands
 @cindex options, for custom agenda views
 
@@ -4434,7 +5107,8 @@ the results for GARDEN tags query in the opposite order,
       '(("h" "Agenda and Home-related tasks"
          ((agenda)
           (tags-todo "HOME")
-          (tags "GARDEN" ((org-agenda-sorting-strategy '(priority-up)))))
+          (tags "GARDEN"
+                ((org-agenda-sorting-strategy '(priority-up)))))
          ((org-agenda-sorting-strategy '(priority-down))))
         ("o" "Agenda and Office-related tasks"
          ((agenda)
@@ -4450,36 +5124,234 @@ this interface, the @emph{values} are just lisp expressions.  So if the
 value is a string, you need to add the double quotes around the value
 yourself.
 
-@node Batch processing,  , Setting Options, Custom agenda views
-@subsection Creating agenda views in batch processing
-@cindex agenda, batch production
 
-If you want to print or otherwise reprocess agenda views, it can be
-useful to create an agenda from the command line.  This is the purpose
-of the function @code{org-batch-agenda}.  It takes as a parameter one of
-the strings that are the keys in @code{org-agenda-custom-commands}.  For
-example, to directly print the current TODO list, you could use
+@node Exporting Agenda Views, Extracting Agenda Information for other programs, Setting Options, Custom agenda views
+@subsection Exporting Agenda Views
+@cindex agenda views, exporting
+
+If you are away from your computer, it can be very useful to have a
+printed version of some agenda views to carry around.  Org-mode can
+export custom agenda views as plain text, HTML@footnote{You need to
+install Hrvoje Niksic' @file{htmlize.el}.} and postscript.  If you want
+to do this only occasionally, use the commend
+
+@table @kbd
+@kindex C-x C-w
+@item C-x C-w
+@cindex exporting agenda views
+@cindex agenda views, exporting
+Write the agenda view to a file.  Depending on the extension of the
+selected file name, the view will be exported as HTML (extension
+@file{.html} or @file{.htm}), Postscript (extension @file{.ps}), or
+plain text (any other extension).  Use the variable
+@code{org-agenda-exporter-settings} to set options for @file{ps-print}
+and for @file{htmlize} to be used during export, for example
+@lisp
+(setq org-agenda-exporter-settings
+      '((ps-number-of-columns 2)
+        (ps-landscape-mode t)
+        (htmlize-output-type 'css)))
+@end lisp
+@end table
+
+If you need to export certain agenda views frequently, you can associate
+any custom agenda command with a list of output file names
+@footnote{If you want to store standard views like the weekly agenda
+or the global TODO list as well, you need to define custom commands for
+them in order to be able to specify filenames.}.  Here is an example
+that first does define custom commands for the agenda and the global
+todo list, together with a number of files to which to export them.
+Then we define two block agenda commands and specify filenames for them
+as well.  File names can be relative to the current working directory,
+or absolute.
+
+@lisp
+@group
+(setq org-agenda-custom-commands
+      '(("X" agenda "" nil ("agenda.html" "agenda.ps"))
+        ("Y" alltodo "" nil ("todo.html" "todo.txt" "todo.ps"))
+        ("h" "Agenda and Home-related tasks"
+         ((agenda)
+          (tags-todo "HOME")
+          (tags "GARDEN"))
+         nil
+         ("~/views/home.html"))
+        ("o" "Agenda and Office-related tasks"
+         ((agenda)
+          (tags-todo "WORK")
+          (tags "OFFICE"))
+         nil
+         ("~/views/office.ps"))))
+@end group
+@end lisp
+
+The extension of the file name determines the type of export.  If it is
+@file{.html}, Org-mode will use the @file{htmlize.el} package to convert
+the buffer to HTML and save it to this file name.  If the extension is
+@file{.ps}, @code{ps-print-buffer-with-faces} is used to produce
+postscript output.  Any other extension produces a plain ASCII file.
+
+The export files are @emph{not} created when you use one of those
+commands interactively.  Instead, there is a special command to produce
+@emph{all} specified files in one step:
+
+@table @kbd
+@kindex C-c a e
+@item C-c a e
+Export all agenda views that have export filenames associated with
+them.
+@end table
+
+You can use the options section of the custom agenda commands to also
+set options for the export commands.  For example:
+
+@lisp
+(setq org-agenda-custom-commands
+      '(("X" agenda ""
+         ((ps-number-of-columns 2)
+          (ps-landscape-mode t)
+          (org-agenda-prefix-format " [ ] ")
+          (org-agenda-with-colors nil)
+          (org-agenda-remove-tags t))
+         ("theagenda.ps"))))
+@end lisp
+
+@noindent
+This command sets two options for the postscript exporter, to make it
+print in two columns in landscape format - the resulting page can be cut
+in two and then used in a paper agenda.  The remaining settings modify
+the agenda prefix to omit category and scheduling information, and
+instead include a checkbox to check off items.  We also remove the tags
+to make the lines compact, and we don't want to use colors for the
+black-and-white printer.  Settings specified in
+@code{org-agenda-exporter-settings} will also apply, but the settings
+in @code{org-agenda-custom-commands} take precedence.
+
+@noindent
+From the command line you may also use
+@example
+emacs -f org-batch-store-agenda-views -kill
+@end example
+@noindent
+or, if you need to modify some parameters
+@example
+emacs -eval '(org-batch-store-agenda-views                      \
+              org-agenda-ndays 30                               \
+              org-agenda-include-diary nil                      \
+              org-agenda-files (quote ("~/org/project.org")))'  \
+      -kill
+@end example
+@noindent
+which will create the agenda views restricted to the file
+@file{~/org/project.org}, without diary entries and with 30 days
+extent. 
+
+@node Extracting Agenda Information for other programs,  , Exporting Agenda Views, Custom agenda views
+@subsection Extracting Agenda Information for other programs
+@cindex agenda, pipe
+@cindex Scripts, for agenda processing
+
+Org-mode provides commands to access agenda information for the command
+line in emacs batch mode.  This extracted information can be sent
+directly to a printer, or it can be read by a program that does further
+processing of the data.  The first of these commands is the function
+@code{org-batch-agenda}, that produces an agenda view and sends it as
+ASCII text to STDOUT.  The command takes a single string as parameter.
+If the string has length 1, it is used as a key to one of the commands
+you have configured in @code{org-agenda-custom-commands}, basically any
+key you can use after @kbd{C-c a}.  For example, to directly print the
+current TODO list, you could use
 
 @example
 emacs -batch -l ~/.emacs -eval '(org-batch-agenda "t")' | lpr
 @end example
 
+If the parameter is a string with 2 or more characters, it is used as a
+tags/todo match string.  For example, to print your local shopping list
+(all items with the tag @samp{shop}, but excluding the tag
+@samp{NewYork}), you could use
+
+@example
+emacs -batch -l ~/.emacs                                      \       
+      -eval '(org-batch-agenda "+shop-NewYork")' | lpr
+@end example
+
 @noindent
 You may also modify parameters on the fly like this:
 
 @example
 emacs -batch -l ~/.emacs                                      \
    -eval '(org-batch-agenda "a"                               \
-            org-agenda-ndays 300                              \
+            org-agenda-ndays 30                               \
             org-agenda-include-diary nil                      \
             org-agenda-files (quote ("~/org/project.org")))'  \
    | lpr
 @end example
 
 @noindent
-which will produce a 300 day agenda, fully restricted to the Org file
+which will produce a 30 day agenda, fully restricted to the Org file
 @file{~/org/projects.org}, not even including the diary.
 
+If you want to process the agenda data in more sophisticated ways, you
+can use the command @code{org-batch-agenda-csv} to get a comma-separated
+list of values for each agenda item.  Each line in the output will
+contain a number of fields separated by commas.  The fields in a line
+are:
+
+@example
+category     @r{The category of the item}
+head         @r{The headline, without TODO kwd, TAGS and PRIORITY}
+type         @r{The type of the agenda entry, can be}
+                todo               @r{selected in TODO match}
+                tagsmatch          @r{selected in tags match}
+                diary              @r{imported from diary}
+                deadline           @r{a deadline}
+                scheduled          @r{scheduled}
+                timestamp          @r{appointment, selected by timestamp}
+                closed             @r{entry was closed on date}
+                upcoming-deadline  @r{warning about nearing deadline}
+                past-scheduled     @r{forwarded scheduled item}
+                block              @r{entry has date block including date}
+todo         @r{The todo keyword, if any}
+tags         @r{All tags including inherited ones, separated by colons}
+date         @r{The relevant date, like 2007-2-14}
+time         @r{The time, like 15:00-16:50}
+extra        @r{String with extra planning info}
+priority-l   @r{The priority letter if any was given}
+priority-n   @r{The computed numerical priority}
+@end example
+
+@noindent
+Time and date will only be given if a timestamp (or deadline/scheduled)
+lead to the selection of the item.
+
+A CSV list like this is very easy to use in a post processing script.
+For example, here is a Perl program that gets the TODO list from
+Emacs/org-mode and prints all the items, preceded by a checkbox:
+
+@example
+@group
+#!/usr/bin/perl
+
+# define the Emacs command to run
+$cmd = "emacs -batch -l ~/.emacs -eval '(org-batch-agenda-csv \"t\")'";
+
+# run it and capture the output
+$agenda = qx@{$cmd 2>/dev/null@};
+
+# loop over all lines
+foreach $line (split(/\n/,$agenda)) @{
+
+  # get the individual values
+  ($category,$head,$type,$todo,$tags,$date,$time,$extra,
+   $priority_l,$priority_n) = split(/,/,$line);
+
+  # proccess and print
+  print "[ ] $head\n";
+@}
+@end group
+@end example
+
 @node Embedded LaTeX, Exporting, Agenda views, Top
 @chapter Embedded LaTeX
 @cindex @TeX{} interpretation
@@ -4566,7 +5438,9 @@ preview the typeset result of these fragments, and upon export to HTML,
 all fragments will be converted to images and inlined into the HTML
 document.  For this to work you need to be on a system with a working
 La@TeX{} installation.  You also need the @file{dvipng} program,
-available at @url{http://sourceforge.net/projects/dvipng/}.
+available at @url{http://sourceforge.net/projects/dvipng/}.  The LaTeX
+header that will be used when processing a fragment can be configured
+with the variable @code{org-format-latex-header}.
 
 La@TeX{} fragments don't need any special marking at all.  The following
 snippets will be identified as LaTeX source code:
@@ -4773,7 +5647,7 @@ HTML formatting, in ways similar to John Grubers @emph{markdown}
 language, but with additional support for tables.
 
 @menu
-* Export commands::             How to invode HTML export
+* Export commands::             How to invoke HTML export
 * Quoting HTML tags::           Using direct HTML in Org-mode
 * Links::                       How hyperlinks get transferred to HTML
 * Images::                      To inline or not to inline?
@@ -4793,11 +5667,27 @@ Export as HTML file @file{myfile.html}.
 @kindex C-c C-e b
 @item C-c C-e b
 Export as HTML file and open it with a browser.
+@kindex C-c C-e H
+@item C-c C-e H
+Export to a temporary buffer, do not create a file.
+@kindex C-c C-e R
+@item C-c C-e H
+Export the active region to a temporary buffer.  With prefix arg, do not
+produce file header and foot, but just the plain HTML section for the
+region.  This is good for cut-and-paste operations.
 @kindex C-c C-e v h
 @kindex C-c C-e v b
+@kindex C-c C-e v H
+@kindex C-c C-e v R
 @item C-c C-e v h
 @item C-c C-e v b
+@item C-c C-e v H
+@item C-c C-e v R
 Export only the visible part of the document.
+@item M-x org-export-region-as-html
+Convert the region to HTML under the assumption that it was org-mode
+syntax before.  This is a global command that can be invoked in any
+buffer.
 @end table
 
 @cindex headline levels, for exporting
@@ -4975,19 +5865,20 @@ in order to produce better output.
 
 @menu
 * Comment lines::               Some lines will not be exported
+* Initial text::                Text before the first headline
+* Footnotes::                   Numbers like [1]
 * Enhancing text::              Subscripts, symbols and more
 * Export options::              How to influence the export settings
 @end menu
 
-@node Comment lines, Enhancing text, Text interpretation, Text interpretation
+@node Comment lines, Initial text, Text interpretation, Text interpretation
 @subsection Comment lines
 @cindex comment lines
 @cindex exporting, not
 
 Lines starting with @samp{#} in column zero are treated as comments
 and will never be exported.  Also entire subtrees starting with the
-word @samp{COMMENT} will never be exported.  Finally, any text before
-the first headline will not be exported either.
+word @samp{COMMENT} will never be exported.
 
 @table @kbd
 @kindex C-c ;
@@ -4995,7 +5886,70 @@ the first headline will not be exported either.
 Toggle the COMMENT keyword at the beginning of an entry.
 @end table
 
-@node Enhancing text, Export options, Comment lines, Text interpretation
+@node Initial text, Footnotes, Comment lines, Text interpretation
+@subsection Text before the first headline
+
+Org-mode normally ignores any text before the first headline when
+exporting, leaving this region for internal links to speed up navigation
+etc.  However, in publishing-oriented files, you might want to have some
+text before the first headline, like a small introduction, special HTML
+code with a navigation bar, etc.  You can ask to have this part of the
+file exported as well by setting the variable
+@code{org-export-skip-text-before-1st-heading} to @code{nil}.  On a
+per-file basis, you can get the same effect with
+
+@example
+#+OPTIONS: skip:nil
+@end example
+
+The text before the first headline will be fully processed
+(@pxref{Enhancing text}), and the first non-comment line becomes the
+title of the exported document.  If you need to include literal HTML,
+use the special constructs described in @ref{Quoting HTML tags}.  The
+table of contents is normally inserted directly before the first
+headline of the file.  If you would like to get it to a different
+location, insert the string @code{[TABLE-OF-CONTENTS]} on a line by
+itself at the desired location.
+
+Finally, if you want to use the space before the first headline for
+internal purposes, but @emph{still} want to place something before the
+first headline when exporting the file, you can use the @code{#+TEXT}
+construct:
+
+@example
+#+OPTIONS: skip:t
+#+TEXT: This text will go before the *first* headline.
+#+TEXT: We place the table of contents here:
+#+TEXT: [TABLE-OF-CONTENTS]
+#+TEXT: This goes between the table of contents and the first headline
+@end example
+
+@node Footnotes, Enhancing text, Initial text, Text interpretation
+@subsection Footnotes
+@cindex footnotes
+@cindex @file{footnote.el}
+
+Numbers in square brackets are treated as footnotes, so that you can use
+the Emacs package @file{footnote.el} to create footnotes.  For example:
+
+@example
+The org-mode homepage[1] clearly needs help from
+a good web designer.
+
+[1] The link is: http://www.astro.uva.nl/~dominik/Tools/org
+@end example
+
+@noindent
+@kindex C-c !
+Note that the @file{footnote} package uses @kbd{C-c !} to invoke its
+commands.  This binding conflicts with the org-mode command for
+inserting inactive time stamps.  You could use the variable
+@code{footnote-prefix} to switch footnotes commands to another key.  Or,
+if you are too used to this binding, you could use
+@code{org-replace-disputed-keys} and @code{org-disputed-keys} to change
+the settings in Org-mode.
+
+@node Enhancing text, Export options, Footnotes, Text interpretation
 @subsection Enhancing text for export
 @cindex enhancing text
 @cindex richer text
@@ -5019,7 +5973,9 @@ backend supports lists.  See @xref{Plain lists}.
 @cindex italic text
 @item
 You can make words @b{*bold*}, @i{/italic/}, _underlined_,
-@code{=code=}, and @samp{+strikethrough+}.
+@code{=code=}, and even @samp{+strikethrough+}@footnote{but remember
+that strikethrough is typographically evil and should @i{never} be
+used.}.
 
 @cindex horizontal rules, in exported files
 @item
@@ -5042,8 +5998,8 @@ separator line will be formatted as table header fields.
 @item
 If a headline starts with the word @samp{QUOTE}, the text below the
 headline will be typeset as fixed-width, to allow quoting of computer
-codes etc.  Lines starting with @samp{:} are also typeset in
-fixed-width font.
+codes etc.  Lines starting with @samp{:} are also typeset in fixed-width
+font. 
 @table @kbd
 @kindex C-c :
 @item C-c :
@@ -5057,7 +6013,7 @@ this position.
 @end itemize
 
 If these conversions conflict with your habits of typing ASCII text,
-they can all be turned off with corresponding variables (see the
+they can all be turned off with corresponding variables.  See the
 customization group @code{org-export-general}, and the following section
 which explains how to set export options with special lines in a
 buffer.
@@ -5088,7 +6044,7 @@ Insert template with export options, see example below.
 #+LANGUAGE:  language for HTML, e.g. @samp{en} (@code{org-export-default-language})
 #+TEXT:      Some descriptive text to be inserted at the beginning.
 #+TEXT:      Several lines may be given.
-#+OPTIONS:   H:2 num:t toc:t \n:nil @@:t ::t |:t ^:t *:nil TeX:t LaTeX:t
+#+OPTIONS:   H:2 num:t toc:t \n:nil @@:t ::t |:t ^:t f:t *:nil TeX:t LaTeX:t skip:t
 @end example
 
 @noindent
@@ -5102,6 +6058,7 @@ you can:
 @cindex fixed-width sections
 @cindex tables
 @cindex @TeX{}-like syntax for sub- and superscripts
+@cindex footnotes
 @cindex emphasized text
 @cindex @TeX{} macros
 @cindex La@TeX{} fragments
@@ -5113,26 +6070,29 @@ toc:    @r{turn on/off table of contents, or set level limit (integer)}
 @@:      @r{turn on/off quoted HTML tags}
 ::      @r{turn on/off fixed-width sections}
 |:      @r{turn on/off tables}
-^:      @r{turn on/off @TeX{}-like syntax for sub- and superscripts.}
+^:      @r{turn on/off @TeX{}-like syntax for sub- and superscripts.  If}
+        @r{you write "^:@{@}", @code{a_@{b@}} will be interpreted, but}
+        @r{the simple @code{a_b} will be left as it is.}
+f:      @r{turn on/off foototes like this[1].}
 *:      @r{turn on/off emphasized text (bold, italic, underlined)}
 TeX:    @r{turn on/off simple @TeX{} macros in plain text}
 LaTeX:  @r{turn on/off La@TeX{} fragments}
+skip:   @r{turn on/off skipping the text before the first heading}
 @end example
 
 @node Publishing, Miscellaneous, Exporting, Top
 @chapter Publishing
 @cindex publishing
 
-Org-mode includes@footnote{@file{org-publish.el} is not yet part of
-Emacs, so if you are using @file{org.el} as it comes with Emacs, you
-need to download this file separately.  Also make sure org.el is at
-least version 4.27.} a publishing management system
-that allows you to configure automatic HTML conversion of
-@emph{projects} composed of interlinked org files.  This system is
-called @emph{org-publish}.  You can also configure org-publish to
-automatically upload your exported HTML pages and related attachments,
-such as images and source code files, to a web server.  Org-publish turns
-org-mode into a web-site authoring tool.
+Org-mode includes@footnote{@file{org-publish.el} is not distributed with
+Emacs 21, if you are still using Emacs 21, you need you need to download
+this file separately.} a publishing management system that allows you to
+configure automatic HTML conversion of @emph{projects} composed of
+interlinked org files.  This system is called @emph{org-publish}.  You
+can also configure org-publish to automatically upload your exported
+HTML pages and related attachments, such as images and source code
+files, to a web server.  Org-publish turns org-mode into a web-site
+authoring tool.
 
 Org-publish has been contributed to Org-mode by David O'Toole.
 
@@ -5294,7 +6254,7 @@ respective variable for details.
 
 When a property is given a value in org-publish-project-alist, its
 setting overrides the value of the corresponding user variable (if any)
-during publishing.  options set within a file (@pxref{Export
+during publishing.  Options set within a file (@pxref{Export
 options}), however, override everything.
 
 @node Publishing links, Project page index, Publishing options, Configuration
@@ -5444,13 +6404,13 @@ Once org-publish is properly configured, you can publish with the
 following functions: 
 
 @table @kbd
-@item C-c C-e c
+@item C-c C-e C
 Prompt for a specific project and publish all files that belong to it.
-@item C-c C-e p
+@item C-c C-e P
 Publish the project containing the current file.
-@item C-c C-e f
+@item C-c C-e F
 Publish only the current file.
-@item C-c C-e a
+@item C-c C-e A
 Publish all projects.
 @end table
 
@@ -5479,6 +6439,7 @@ force publishing of all files by giving a prefix argument.
 @cindex completion, of dictionary words
 @cindex completion, of option keywords
 @cindex completion, of tags
+@cindex completion, of property keys
 @cindex completion, of link abbreviations
 @cindex @TeX{} symbol completion
 @cindex TODO keywords completion
@@ -5504,10 +6465,14 @@ After @samp{\}, complete @TeX{} symbols supported by the exporter.
 After @samp{*}, complete headlines in the current buffer so that they
 can be used in search links like @samp{[[*find this headline]]}.
 @item
-After @samp{:}, complete tags.  The list of tags is taken from the
-variable @code{org-tag-alist} (possibly set through the @samp{#+TAGS}
-in-buffer option, @pxref{Setting tags}), or it is created dynamically
-from all tags used in the current buffer.
+After @samp{:} in a headline, complete tags.  The list of tags is taken
+from the variable @code{org-tag-alist} (possibly set through the
+@samp{#+TAGS} in-buffer option, @pxref{Setting tags}), or it is created
+dynamically from all tags used in the current buffer.
+@item
+After @samp{:} and not in a headline, complete property keys.  The list
+of keys is constructed dynamically from all keys used in the current
+buffer.
 @item
 After @samp{[}, complete link abbreviations (@pxref{Link abbreviations}).
 @item
@@ -5553,6 +6518,32 @@ activate the changes immediately.  Otherwise they become effective only
 when the file is visited again in a new Emacs session.
 
 @table @kbd
+@item #+ARCHIVE: %s_done::
+This line sets the archive location for the agenda file.  It applies for
+all subsequent lines until the next @samp{#+CATEGORY} line, or the end
+of the file.  The first such line also applies to any entries before it.
+The corresponding variable is @code{org-archive-location}.
+@item #+CATEGORY:
+This line sets the category for the agenda file.  The category applies
+for all subsequent lines until the next @samp{#+CATEGORY} line, or the
+end of the file.  The first such line also applies to any entries before it.
+@item #+COLUMNS: %25ITEM .....
+Set the default format for columns view.  This format applies when
+columns view is invoked in location where no COLUMNS property applies.
+@item #+CONSTANTS: name1=value1 ...
+Set file-local values for constants to be used in table formulas.  This
+line set the local variable @code{org-table-formula-constants-local}.
+The global version of theis variable is
+@code{org-table-formula-constants}.
+corresponding 
+@item #+LINK:  linkword replace
+These lines (several are allowed) specify link abbreviations.
+@xref{Link abbreviations}.  The corresponding variable is
+@code{org-link-abbrev-alist}.
+@item #+PRIORITIES: highest lowest default
+This line sets the limits and the default for the priorities.  All three
+must be either letters A-Z or numbers 0-9.  The highest priority must
+have a lower ASCII number that the lowest priority.
 @item #+STARTUP:
 This line sets options to be used at startup of org-mode, when an
 Org-mode file is being visited.  The first set of options deals with the
@@ -5584,11 +6575,15 @@ Logging TODO state changes and clock intervals (variable
 @cindex @code{lognotedone}, STARTUP keyword
 @cindex @code{lognoteclock-out}, STARTUP keyword
 @cindex @code{lognotestate}, STARTUP keyword
+@cindex @code{logrepeat}, STARTUP keyword
+@cindex @code{nologrepeat}, STARTUP keyword
 @example
 logging          @r{record a timestamp when an item is marked DONE}
 nologging        @r{don't record when items are marked DONE}
 lognotedone      @r{record timestamp and a note when DONE}
-lognotestate     @r{record timestamp, note when TODO state changes}
+lognotestate     @r{record timestamp and a note when TODO state changes}
+logrepeat        @r{record a note when re-instating a repeating item}
+nologrepeat      @r{do not record when re-instating repeating item}
 lognoteclock-out @r{record timestamp and a note when clocking out}
 @end example
 Here are the options for hiding leading stars in outline headings.  The
@@ -5612,32 +6607,27 @@ To turn on custom format overlays over time stamps (variables
 @example
 customtime @r{overlay custom time format}
 @end example
-@item #+SEQ_TODO:   #+TYP_TODO:
-These lines set the TODO keywords and their interpretation in the
-current file.  The corresponding variables are @code{org-todo-keywords}
-and @code{org-todo-interpretation}.
+The following options influence the table spreadsheet (variable
+@code{constants-unit-system}).
+@cindex @code{constcgs}, STARTUP keyword
+@cindex @code{constSI}, STARTUP keyword
+@example
+constcgs   @r{@file{constants.el} should use the c-g-s unit system}
+constSI    @r{@file{constants.el} should use the SI unit system}
+@end example
 @item #+TAGS:  TAG1(c1) TAG2(c2)
 These lines (several such lines are allowed) specify the legal tags in
 this file, and (potentially) the corresponding @emph{fast tag selection}
 keys.  The corresponding variable is @code{org-tag-alist}.
-@item #+LINK:  linkword replace
-These lines (several are allowed) specify link abbreviations.
-@xref{Link abbreviations}.  The corresponding variable is
-@code{org-link-abbrev-alist}.
-@item #+CATEGORY:
-This line sets the category for the agenda file.  The category applies
-for all subsequent lines until the next @samp{#+CATEGORY} line, or the
-end of the file.  The first such line also applies to any entries before it.
-@item #+ARCHIVE: %s_done::
-This line sets the archive location for the agenda file.  It applies for
-all subsequent lines until the next @samp{#+CATEGORY} line, or the end
-of the file.  The first such line also applies to any entries before it.
-The corresponding variable is @code{org-archive-location}.
 @item #+TBLFM:
 This line contains the formulas for the table directly above the line.
 @item #+TITLE:, #+AUTHOR:, #+EMAIL:, #+LANGUAGE:, #+TEXT:, #+OPTIONS:
 These lines provide settings for exporting files.  For more details see
 @ref{Export options}.
+@item #+SEQ_TODO:   #+TYP_TODO:
+These lines set the TODO keywords and their interpretation in the
+current file.  The corresponding variables are @code{org-todo-keywords}
+and @code{org-todo-interpretation}.
 @end table
 
 @node The very busy C-c C-c key, Clean view, In-buffer settings, Miscellaneous
@@ -5677,6 +6667,9 @@ default location.
 If the cursor is on a @code{<<<target>>>}, update radio targets and
 corresponding links in this buffer.
 @item
+If the cursor is in a property line or at the start or end of a property
+drawer, offer property commands.
+@item
 If the cursor is in a plain list item with a checkbox, toggle the status
 of the checkbox.
 @item
@@ -5816,10 +6809,12 @@ rather use @kbd{C-c .}  to re-insert the timestamp.
 @item @kbd{S-@key{RET}}     @tab @kbd{C-c C-x c}           @tab
 @item @kbd{M-@key{RET}}     @tab @kbd{C-c C-x m}           @tab @kbd{@key{Esc} @key{RET}}
 @item @kbd{M-S-@key{RET}}   @tab @kbd{C-c C-x M}           @tab
-@item @kbd{S-@key{left}}    @tab @kbd{C-c C-x @key{left}}  @tab
-@item @kbd{S-@key{right}}   @tab @kbd{C-c C-x @key{right}} @tab
-@item @kbd{S-@key{up}}      @tab @kbd{C-c C-x @key{up}}    @tab
-@item @kbd{S-@key{down}}    @tab @kbd{C-c C-x @key{down}}  @tab
+@item @kbd{S-@key{left}}    @tab @kbd{C-c @key{left}}      @tab
+@item @kbd{S-@key{right}}   @tab @kbd{C-c @key{right}}     @tab
+@item @kbd{S-@key{up}}      @tab @kbd{C-c @key{up}}        @tab
+@item @kbd{S-@key{down}}    @tab @kbd{C-c @key{down}}      @tab
+@item @kbd{C-S-@key{left}}  @tab @kbd{C-c C-x @key{left}}  @tab
+@item @kbd{C-S-@key{right}} @tab @kbd{C-c C-x @key{right}} @tab
 @end multitable
 
 @node Interaction, Bugs, TTY keys, Miscellaneous
@@ -5887,7 +6882,7 @@ to execute Org-mode-related commands, leave the table.
 @item C-c C-c
 Recognize @file{table.el} table.  Works when the cursor is in a
 table.el table.
-
+@c
 @kindex C-c ~
 @item C-c ~
 Insert a table.el table.  If there is already a table at point, this
@@ -5897,6 +6892,10 @@ format.  See the documentation string of the command
 possible.
 @end table
 @file{table.el} is part of Emacs 22.
+@cindex @file{footnote.el}
+@item @file{footnote.el} by Steven L. Baur
+Org-mode recognizes numerical footnotes as provided by this package
+(@pxref{Footnotes}).
 @end table
 
 @node Conflicts,  , Cooperation, Interaction
@@ -5927,7 +6926,6 @@ during date selection).
 @example
 S-UP    -> M-p             S-DOWN  -> M-n
 S-LEFT  -> M--             S-RIGHT -> M-+
-S-RET   -> C-S-RET
 @end example
 
 Yes, these are unfortunately more difficult to remember.  If you want
@@ -5937,6 +6935,16 @@ to have other replacement keys, look at the variable
 @cindex @file{windmove.el}
 Also this package uses the @kbd{S-<cursor>} keys, so everything written
 in the paragraph above about CUA mode also applies here.
+
+@cindex @file{footnote.el}
+@item @file{footnote.el} by Steven L. Baur
+Org-mode supports the syntax of the footnote package, but only the
+numerical footnote markers.  Also, the default key for footnote
+commands, @kbd{C-c !} is already used by org-mode.  You could use the
+variable @code{footnote-prefix} to switch footnotes commands to another
+key.  Or, you could use @code{org-replace-disputed-keys} and
+@code{org-disputed-keys} to change the settings in Org-mode.
+
 @end table
 
 
@@ -5990,6 +6998,7 @@ Org-mode.
 * Tables in arbitrary syntax::  Orgtbl for LaTeX and other programs
 * Dynamic blocks::              Automatically filled blocks
 * Special agenda views::        Customized views
+* Using the property API::      Writing programs that use entry properties
 @end menu
 
 @node Extensions, Tables in arbitrary syntax, Extensions and Hacking, Extensions and Hacking
@@ -6363,7 +7372,7 @@ you could add the function @code{org-update-all-dblocks} to a hook, for
 example @code{before-save-hook}.  @code{org-update-all-dblocks} is
 written in a way that is does nothing in buffers that are not in Org-mode.
 
-@node Special agenda views,  , Dynamic blocks, Extensions and Hacking
+@node Special agenda views, Using the property API, Dynamic blocks, Extensions and Hacking
 @section Special Agenda Views
 @cindex agenda views, user-defined
 
@@ -6416,8 +7425,47 @@ MATCH is being ignored."
     (org-todo-list "PROJECT")))
 @end lisp
 
-
-@node History and Acknowledgments, GNU Free Documentation License, Extensions and Hacking, Top
+@node Using the property API,  , Special agenda views, Extensions and Hacking
+@section Using the property API
+@cindex API, for properties
+@cindex properties, API
+
+Here is a description of the functions that can be used to work with
+properties.
+
+@defun org-entry-properties &optional pom which
+Get all properties of the entry at point-or-marker POM.
+This includes the TODO keyword, the tags, time strings for deadline,
+scheduled, and clocking, and any additional properties defined in the
+entry.  The return value is an alist, keys may occur multiple times
+if the property key was used several times.
+POM may also be nil, in which case the current entry is used.
+If WHICH is nil or `all', get all properties.  If WHICH is
+`special' or `standard', only get that subclass.
+@end defun
+@defun org-entry-get pom property &optional inherit
+Get value of PROPERTY for entry at point-or-marker POM.
+If INHERIT is non-nil and the entry does not have the property,
+then also check higher levels of the hierarchy.
+@end defun
+
+@defun org-entry-delete pom property
+Delete the property PROPERTY from entry at point-or-marker POM.
+@end defun
+
+@defun org-entry-put pom property value
+Set PROPERTY to VALUE for entry at point-or-marker POM.
+@end defun
+
+@defun org-buffer-property-keys &optional include-specials
+Get all property keys in the current buffer.
+@end defun
+
+@defun org-insert-property-drawer
+Insert a property drawer at point.
+@end defun
+
+@node History and Acknowledgments, Index, Extensions and Hacking, Top
 @appendix History and Acknowledgments
 @cindex acknowledgments
 @cindex history
@@ -6440,7 +7488,7 @@ goals that Org-mode still has today: To create a new, outline-based,
 plain text mode with innovative and intuitive editing features, and to
 incorporate project planning functionality directly into a notes file.
 
-Since the first release, hundreds of emails to me or on
+Since the first release, literally thousands of emails to me or on
 @code{emacs-orgmode@@gnu.org} have provided a constant stream of bug
 reports, feedback, new ideas, and sometimes patches and add-on code.
 Many thanks to everyone who has helped to improve this package.  I am
@@ -6451,6 +7499,8 @@ let me know.
 
 @itemize @bullet
 
+@item
+@i{Russel Adams} came up with the idea for drawers.
 @item
 @i{Thomas Baumann} contributed the code for links to the MH-E email
 system.
@@ -6469,7 +7519,9 @@ calculations and improved XEmacs compatibility, in particular by porting
 @item
 @i{Sacha Chua} suggested to copy some linking code from Planner.
 @item
-@i{Eddward DeVilla} proposed and tested checkbox statistics.
+@i{Eddward DeVilla} proposed and tested checkbox statistics.  He also
+came up with the idea of properties, and that there should be an API for
+them.
 @item
 @i{Kees Dullemond} used to edit projects lists directly in HTML and so
 inspired some of the early development, including HTML export.  He also
@@ -6478,6 +7530,9 @@ asked for a way to narrow wide table columns.
 @i{Christian Egli} converted the documentation into TeXInfo format,
 patched CSS formatting into the HTML exporter, and inspired the agenda.
 @item
+@i{David Emery} provided a patch for custom CSS support in exported
+HTML agendas.
+@item
 @i{Nic Ferrier} contributed mailcap and XOXO support.
 @item
 @i{John Foerch} figured out how to make incremental search show context
@@ -6490,13 +7545,22 @@ translated David O'Toole's tutorial into French.
 @item
 @i{Kai Grossjohann} pointed out key-binding conflicts with other packages.
 @item
-@i{Shidai Liu} (``Leo'') provided extensive feedback and some patches.
+@i{Scott Jaderholm} proposed footnotes, control over whitespace between
+folded entries, and column view for properties.
 @item
-@i{Leon Liu} asked for embedded LaTeX and tested it.
+@i{Shidai Liu} ("Leo") asked for embedded LaTeX and tested it.  He also
+provided frequent feedback and some patches.
+@item
+@i{Jason F. McBrayer} suggested agenda export to CSV format.
+@item
+@i{Dmitri Minaev} sent a patch to set priority limits on a per-file
+basis.
 @item
 @i{Stefan Monnier} provided a patch to keep the Emacs-Lisp compiler
 happy.
 @item
+@i{Rick Moynihan} proposed to allow multiple TODO sequences in a file.
+@item
 @i{Todd Neal} provided patches for links to Info files and elisp forms.
 @item
 @i{Tim O'Callaghan} suggested in-file links, search options for general
@@ -6568,12 +7632,8 @@ work on a tty.
 and contributed various ideas and code snippets.
 @end itemize
 
-@node GNU Free Documentation License, Index, History and Acknowledgments, Top
-@appendix GNU Free Documentation License
-@include doclicense.texi
-
 
-@node Index, Key Index, GNU Free Documentation License, Top
+@node Index, Key Index, History and Acknowledgments, Top
 @unnumbered Index
 
 @printindex cp
index 87b0378..90ec645 100644 (file)
@@ -197,7 +197,7 @@ more information.
   Normally, the mode line looks like this:
 
 @example
--@var{cs}:@var{ch}-@var{fr}  @var{buf}      @var{pos} @var{line}   (@var{major} @var{minor})------
+-@var{cs}:@var{ch}@var{R}-@var{fr}  @var{buf}      @var{pos} @var{line}   (@var{major} @var{minor})------
 @end example
 
 @noindent
@@ -211,6 +211,9 @@ been edited (the buffer is ``modified''), or @samp{--} if the buffer has
 not been edited.  For a read-only buffer, it is @samp{%*} if the buffer
 is modified, and @samp{%%} otherwise.
 
+  @var{R} is @samp{@@} if the default-directory for the current buffer
+is on a remote machine, or a hyphen otherwise.
+
   @var{fr} gives the selected frame name (@pxref{Frames}).  It appears
 only on text-only terminals.  The initial frame's name is @samp{F1}.
 
index d3107f9..fe6285b 100644 (file)
@@ -3,7 +3,7 @@
 % Load plain if necessary, i.e., if running under initex.
 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
 %
-\def\texinfoversion{2007-06-24.23}
+\def\texinfoversion{2007-07-09.21}
 %
 % Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
 % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
index 67b0647..fc425c8 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo   @c -*-texinfo-*-
-@c %**start of header
 @setfilename ../info/tramp
+@c %**start of header
 @settitle TRAMP User Manual
 @setchapternewpage odd
 @c %**end of header
 
 @include trampver.texi
 
-@c Macros for formatting a filename.
-@c trampfn is for a full filename, trampfnmhp means method, host, localname
-@c were given, and so on.
-@macro trampfn(method, user, host, localname)
-@value{prefix}@value{method}@value{user}@@@value{host}@value{postfix}@value{localname}
+@c Macro for formatting a filename according to the repective syntax.
+@c xxx and yyy are auxiliary macros in order to omit leading and
+@c trailing whitespace.  Not very elegant, but I don't know it better.
+
+@macro xxx {one}@c
+@set \one\@c
+@end macro
+
+@macro yyy {one, two}@c
+@xxx{x\one\}@c
+@ifclear x@c
+\one\@w{}\two\@c
+@end ifclear
+@clear x\one\@c
+@end macro
+
+@macro trampfn {method, user, host, localname}@c
+@value{prefix}@yyy{\method\,@value{postfixhop}}@yyy{\user\,@@}\host\@value{postfix}\localname\@c
 @end macro
 
 @copying
-Copyright @copyright{} 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
-Free Software Foundation, Inc.
+Copyright @copyright{} 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+2007 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
@@ -157,6 +170,7 @@ For the developer:
 
 * Version Control::             The inner workings of remote version control.
 * Files directories and localnames::  How file names, directories and localnames are mangled and managed.
+* Traces and Profiles::         How to Customize Traces.
 * Issues::                      Debatable Issues and What Was Decided.
 
 * GNU Free Documentation License:: The license for this documentation.
@@ -178,11 +192,17 @@ Configuring @value{tramp} for use
 * Connection types::            Types of connections made to remote machines.
 * Inline methods::              Inline methods.
 * External transfer methods::   External transfer methods.
-* Multi-hop Methods::           Connecting to a remote host using multiple hops.
+@ifset emacsgw
+* Gateway methods::             Gateway methods.
+@end ifset
 * Default Method::              Selecting a default method.
+* Default User::                Selecting a default user.
+* Default Host::                Selecting a default host.
+* Multi-hops::                  Connecting to a remote host using multiple hops.
 * Customizing Methods::         Using Non-Standard Methods.
 * Customizing Completion::      Selecting config files for user/host name completion.
 * Password caching::            Reusing passwords for several connections.
+* Connection caching::          Reusing connection related information.
 * Remote Programs::             How @value{tramp} finds and uses programs on the remote machine.
 * Remote shell setup::          Remote shell setup hints.
 * Windows setup hints::         Issues with Cygwin ssh.
@@ -191,10 +211,9 @@ Configuring @value{tramp} for use
 Using @value{tramp}
 
 * Filename Syntax::             @value{tramp} filename conventions.
-* Multi-hop filename syntax::   Multi-hop filename conventions.
+* Alternative Syntax::          URL-like filename syntax.
 * Filename completion::         Filename completion.
-* Dired::                       Dired.
-* Compilation::                 Compile remote files.
+* Remote processes::            Integration with other @value{emacsname} packages.
 
 The inner workings of remote version control
 
@@ -220,10 +239,10 @@ How file names, directories and localnames are mangled and managed
 @chapter An overview of @value{tramp}
 @cindex overview
 
-After the installation of @value{tramp} into your @value{emacsname},
-you will be able to access files on remote machines as though they
-were local.  Access to the remote file system for editing files,
-version control, and @code{dired} are transparently enabled.
+After the installation of @value{tramp} into your @value{emacsname}, you
+will be able to access files on remote machines as though they were
+local.  Access to the remote file system for editing files, version
+control, and @code{dired} are transparently enabled.
 
 Your access to the remote machine can be with the @command{rsh},
 @command{rlogin}, @command{telnet} programs or with any similar
@@ -380,7 +399,7 @@ behind the scenes when you open a file with @value{tramp}.
 
 @value{tramp} is freely available on the Internet and the latest
 release may be downloaded from
-@uref{ftp://ftp.gnu.org/gnu/tramp/}. This release includes the full
+@uref{ftp://ftp.gnu.org/gnu/tramp/}.  This release includes the full
 documentation and code for @value{tramp}, suitable for installation.
 But GNU Emacs (22 or later) includes @value{tramp} already, and there
 is a @value{tramp} package for XEmacs, as well.  So maybe it is easier
@@ -389,7 +408,7 @@ on@dots{...}
 
 For the especially brave, @value{tramp} is available from CVS.  The CVS
 version is the latest version of the code and may contain incomplete
-features or new issues. Use these versions at your own risk.
+features or new issues.  Use these versions at your own risk.
 
 Instructions for obtaining the latest development version of @value{tramp}
 from CVS can be found by going to the Savannah project page at the
@@ -410,7 +429,7 @@ Or follow the example session below:
 
 @noindent
 You should now have a directory @file{~/@value{emacsdir}/tramp}
-containing the latest version of @value{tramp}. You can fetch the latest
+containing the latest version of @value{tramp}.  You can fetch the latest
 updates from the repository by issuing the command:
 
 @example
@@ -429,6 +448,11 @@ script:
 ] @strong{autoconf}
 @end example
 
+People who have no direct CVS access (maybe because sitting behind a
+blocking firewall), can try the
+@uref{http://savannah.gnu.org/cvs-backup/tramp-sources.tar.gz, Nightly
+CVS Tree Tarball} instead of.
+
 
 @node History
 @chapter History of @value{tramp}
@@ -445,7 +469,19 @@ file contents were added.  Support for VC was added.
 
 The most recent addition of major features were the multi-hop methods
 added in April 2000 and the unification of @value{tramp} and Ange-FTP
-filenames in July 2002.
+filenames in July 2002.  In July 2004, multi-hop methods have been
+replaced by proxy hosts.  Running commands on remote hosts was
+introduced in December 2005.
+@ifset emacsgw
+Support of gateways exists since April 2007.
+@end ifset
+
+In December 2001, @value{tramp} has been added to the XEmacs package
+repository.  Being part of the GNU Emacs repository happened in June
+2002, the first release including @value{tramp} was GNU Emacs 22.1.
+
+@value{tramp} is also a GNU/Linux Debian package since February 2001.
+
 
 @c Installation chapter is necessary only in case of standalone
 @c installation.  Text taken from trampinst.texi.
@@ -462,7 +498,7 @@ filenames in July 2002.
 installed.  It is initially configured to use the @command{scp}
 program to connect to the remote host.  So in the easiest case, you
 just type @kbd{C-x C-f} and then enter the filename
-@file{@value{prefix}@var{user}@@@var{machine}@value{postfix}@var{/path/to.file}}.
+@file{@trampfn{, user, machine, /path/to.file}}.
 
 On some hosts, there are problems with opening a connection.  These are
 related to the behavior of the remote shell.  See @xref{Remote shell
@@ -482,14 +518,20 @@ Method}.
 * Connection types::            Types of connections made to remote machines.
 * Inline methods::              Inline methods.
 * External transfer methods::   External transfer methods.
-* Multi-hop Methods::           Connecting to a remote host using multiple hops.
+@ifset emacsgw
+* Gateway methods::             Gateway methods.
+@end ifset
 * Default Method::              Selecting a default method.
                                   Here we also try to help those who
                                   don't have the foggiest which method
                                   is right for them.
+* Default User::                Selecting a default user.
+* Default Host::                Selecting a default host.
+* Multi-hops::                  Connecting to a remote host using multiple hops.
 * Customizing Methods::         Using Non-Standard Methods.
 * Customizing Completion::      Selecting config files for user/host name completion.
 * Password caching::            Reusing passwords for several connections.
+* Connection caching::          Reusing connection related information.
 * Remote Programs::             How @value{tramp} finds and uses programs on the remote machine.
 * Remote shell setup::          Remote shell setup hints.
 * Windows setup hints::         Issues with Cygwin ssh.
@@ -508,7 +550,7 @@ remote shell access program such as @command{rsh}, @command{ssh} or
 
 This connection is used to perform many of the operations that @value{tramp}
 requires to make the remote file system transparently accessible from
-the local machine. It is only when visiting files that the methods
+the local machine.  It is only when visiting files that the methods
 differ.
 
 @cindex inline methods
@@ -519,7 +561,7 @@ differ.
 @cindex methods, external transfer
 @cindex methods, out-of-band
 Loading or saving a remote file requires that the content of the file
-be transfered between the two machines. The content of the file can be
+be transfered between the two machines.  The content of the file can be
 transfered over the same connection used to log in to the remote
 machine or the file can be transfered through another connection using
 a remote copy program such as @command{rcp}, @command{scp} or
@@ -539,16 +581,10 @@ startup may drown out the improvement in file transfer times.
 
 External transfer methods should be configured such a way that they
 don't require a password (with @command{ssh-agent}, or such alike).
-If it isn't possible, you should consider @ref{Password caching},
-otherwise you will be prompted for a password every copy action.
-
-@cindex multi-hop methods
-@cindex methods, multi-hop
-A variant of the inline methods are the @dfn{multi-hop methods}.
-These methods allow you to connect a remote host using a number `hops',
-each of which connects to a different host.  This is useful if you are
-in a secured network where you need to go through a bastion host to
-connect to the outside world.
+Modern @command{scp} implementations offer options to reuse existing
+@command{ssh} connections, see method @command{scpc}.  If it isn't
+possible, you should consider @ref{Password caching}, otherwise you
+will be prompted for a password every copy action.
 
 
 @node Inline methods
@@ -635,6 +671,8 @@ as the @option{rsh} method.
 
 This method does not connect to a remote host at all, rather it uses
 the @command{su} program to allow you to edit files as another user.
+With other words, a specified host name in the file name is silently
+ignored.
 
 
 @item @option{sudo}
@@ -682,7 +720,7 @@ This supports the @samp{-p} kludge.
 
 @item @option{krlogin}
 @cindex method krlogin
-@cindex km krlogin
+@cindex krlogin method
 @cindex Kerberos (with krlogin method)
 
 This method is also similar to @option{ssh}.  It only uses the
@@ -697,18 +735,43 @@ This method is mostly interesting for Windows users using the PuTTY
 implementation of SSH.  It uses @samp{plink -ssh} to log in to the
 remote host.
 
-Additionally, the method @option{plink1} is provided, which calls
-@samp{plink -1 -ssh} in order to use SSH protocol version 1
-explicitly.
+This supports the @samp{-P} kludge.
+
+Additionally, the methods @option{plink1} and @option{plink2} are
+provided, which call @samp{plink -1 -ssh} or @samp{plink -2 -ssh} in
+order to use SSH protocol version 1 or 2 explicitly.
 
 CCC: Do we have to connect to the remote host once from the command
 line to accept the SSH key?  Maybe this can be made automatic?
 
-CCC: Does @command{plink} support the @samp{-p} option?  @value{tramp} will
-support that, anyway.
+CCC: Say something about the first shell command failing.  This might
+be due to a wrong setting of @code{tramp-rsh-end-of-line}.
 
-@end table
 
+@item @option{plinkx}
+@cindex method plinkx
+@cindex plinkx method
+
+Another method using PuTTY on Windows.  Instead of host names, it
+expects PuTTY session names, calling @samp{plink -load @var{session}
+-t"}.  User names are relevant only in case the corresponding session
+hasn't defined a user name.  Different port numbers must be defined in
+the session.
+
+
+@item @option{fish}
+@cindex method fish
+@cindex fish method
+
+This is an experimental implementation of the fish protocol, known from
+the GNU Midnight Commander or the KDE Konqueror.  @value{tramp} expects
+the fish server implementation from the KDE kioslave.  That means, the
+file @file{~/.fishsrv.pl} is expected to reside on the remote host.
+
+The implementation lacks good performance.  The code is offered anyway,
+maybe somebody can improve the performance.
+
+@end table
 
 
 @node External transfer methods
@@ -725,21 +788,10 @@ transfers to an external transfer utility.
 This saves the overhead of encoding and decoding that multiplexing the
 transfer through the one connection has with the inline methods.
 
-If you want to use an external transfer method you should be able to
-execute the transfer utility to copy files to and from the remote
-machine without any interaction.
-
-@cindex ssh-agent
-This means that you will need to use @command{ssh-agent} if you use the
-@command{scp} program for transfers, or maybe your version of
-@command{scp} accepts a password on the command line.@footnote{PuTTY's
-@command{pscp} allows you to specify the password on the command line.}
-If you use @command{rsync} via @command{ssh} then the same rule must
-apply to that connection.
-
-If you cannot get an external method to run without asking for a
-password you should consider @ref{Password caching}.
-
+Since external transfer methods need their own overhead opening a new
+channel, all files which are smaller than @var{tramp-copy-size-limit}
+are still transferred with the corresponding inline method.  It should
+provide a fair trade-off between both approaches.
 
 @table @asis
 @item @option{rcp}  ---  @command{rsh} and @command{rcp}
@@ -767,7 +819,7 @@ Using @command{ssh} to connect to the remote host and @command{scp} to
 transfer files between the machines is the best method for securely
 connecting to a remote machine and accessing files.
 
-The performance of this option is also quite good. It may be slower than
+The performance of this option is also quite good.  It may be slower than
 the inline methods when you often open and close small files however.
 The cost of the cryptographic handshake at the start of an @command{scp}
 session can begin to absorb the advantage that the lack of encoding and
@@ -787,7 +839,24 @@ know what these are, you do not need these options.
 All the @command{ssh} based methods support the kludgy @samp{-p}
 feature where you can specify a port number to connect to in the host
 name.  For example, the host name @file{host#42} tells @value{tramp} to
-specify @samp{-p 42} in the argument list for @command{ssh}.
+specify @samp{-p 42} in the argument list for @command{ssh}, and to
+specify @samp{-P 42} in the argument list for @command{scp}.
+
+
+@item @option{sftp}  ---  @command{ssh} and @command{sftp}
+@cindex method sftp
+@cindex sftp method
+@cindex sftp (with sftp method)
+@cindex ssh (with sftp method)
+
+That is mostly the same method as @option{scp}, but using
+@command{sftp} as transfer command.  So the same remarks are valid.
+
+This command does not work like @value{ftppackagename}, where
+@command{ftp} is called interactively, and all commands are send from
+within this session.  Instead of, @command{ssh} is used for login.
+
+This method supports the @samp{-p} hack.
 
 
 @item @option{rsync}  ---  @command{ssh} and @command{rsync}
@@ -805,7 +874,7 @@ transferring files that exist on both hosts, this advantage is lost if
 the file exists only on one side of the connection.
 
 The @command{rsync} based method may be considerably faster than the
-@command{rcp} based methods when writing to the remote system. Reading
+@command{rcp} based methods when writing to the remote system.  Reading
 files to the local machine is no faster than with a direct copy.
 
 This method supports the @samp{-p} hack.
@@ -866,7 +935,22 @@ This method is similar to @option{scp}, but it uses the
 @command{pscp} for transferring the files.  These programs are part
 of PuTTY, an SSH implementation for Windows.
 
-CCC: Does @command{plink} support the @samp{-p} hack?
+This method supports the @samp{-P} hack.
+
+
+@item @option{psftp} --- @command{plink} and @command{psftp}
+@cindex method psftp
+@cindex psftp method
+@cindex psftp (with psftp method)
+@cindex plink (with psftp method)
+@cindex PuTTY (with psftp method)
+
+As you would expect, this method is similar to @option{sftp}, but it
+uses the @command{plink} command to connect to the remote host, and it
+uses @command{psftp} for transferring the files.  These programs are
+part of PuTTY, an SSH implementation for Windows.
+
+This method supports the @samp{-P} hack.
 
 
 @item @option{fcp} --- @command{fsh} and @command{fcp}
@@ -901,7 +985,7 @@ anyway.
 @cindex method ftp
 @cindex ftp method
 
-This is not a native @value{tramp} method. Instead of, it forwards all
+This is not a native @value{tramp} method.  Instead of, it forwards all
 requests to @value{ftppackagename}.
 @ifset xemacs
 This works only for unified filenames, see @ref{Issues}.
@@ -935,8 +1019,15 @@ specify a user name which looks like @code{user%domain} (the real user
 name, then a percent sign, then the domain name).  So, to connect to
 the machine @code{melancholia} as user @code{daniel} of the domain
 @code{BIZARRE}, and edit @file{.emacs} in the home directory (share
-@code{daniel$}) I would specify the filename
-@file{@value{prefix}smb@value{postfixsinglehop}daniel%BIZARRE@@melancholia@value{postfix}/daniel$$/.emacs}.
+@code{daniel$}) I would specify the filename @file{@trampfn{smb,
+daniel%BIZARRE, melancholia, /daniel$$/.emacs}}.
+
+Depending on the Windows domain configuration, a Windows user might be
+considered as domain user per default.  In order to connect as local
+user, the WINS name of that machine must be given as domain name.
+Usually, it is the machine name in capital letters.  In the example
+above, the local user @code{daniel} would be specified as
+@file{@trampfn{smb, daniel%MELANCHOLIA, melancholia, /daniel$$/.emacs}}.
 
 The domain name as well as the user name are optional.  If no user
 name is specified at all, the anonymous user (without password
@@ -953,97 +1044,56 @@ name.
 
 @end table
 
-@node Multi-hop Methods
-@section Connecting to a remote host using multiple hops
-@cindex multi-hop methods
-@cindex methods, multi-hop
 
-Sometimes, the methods described before are not sufficient.  Sometimes,
-it is not possible to connect to a remote host using a simple command.
-For example, if you are in a secured network, you might have to log in
-to a `bastion host' first before you can connect to the outside world.
-Of course, the target host may also require a bastion host.  The format
-of multi-hop filenames is slightly different than the format of normal
-@value{tramp} methods.
-
-@cindex method multi
-@cindex multi method
-A multi-hop file name specifies a method, a number of hops, and a
-localname (path name on the remote system).  The method name is always
-@option{multi}.
-
-Each hop consists of a @dfn{hop method} specification, a user name and
-a host name.  The hop method can be an inline method only.  The
-following hop methods are (currently) available:
-
-@table @option
-@item telnet
-@cindex hop method telnet
-@cindex telnet hop method
-
-Uses the well-known @command{telnet} program to connect to the host.
-Whereas user name and host name are supplied in the file name, the
-user is queried for the password.
-
-@item rsh
-@cindex hop method rsh
-@cindex rsh hop method
-
-This uses @command{rsh} to connect to the host.  You do not need to
-enter a password unless @command{rsh} explicitly asks for it.
-
-The variant @option{remsh} uses the @command{remsh} command.  It
-should be applied on machines where @command{remsh} is used instead of
-@command{rsh}.
-
-@item ssh
-@cindex hop method ssh
-@cindex ssh hop method
-
-This uses @command{ssh} to connect to the host.  You might have to enter
-a password or a pass phrase.
-
-@item su
-@cindex hop method su
-@cindex su hop method
-
-This method does not actually contact a different host, but it allows
-you to become a different user on the host you're currently on.  This
-might be useful if you want to edit files as root, but the remote host
-does not allow remote root logins.  In this case you can use
-@option{telnet}, @option{rsh} or @option{ssh} to connect to the
-remote host as a non-root user, then use an @option{su} hop to become
-root.  But @option{su} need not be the last hop in a sequence, you could
-also use it somewhere in the middle, if the need arises.
-
-Even though you @emph{must} specify both user and host with an
-@option{su} hop, the host name is ignored and only the user name is
-used.
-
-@item sudo
-@cindex hop method sudo
-@cindex sudo hop method
-
-This is similar to the @option{su} hop, except that it uses
-@command{sudo} rather than @command{su} to become a different user.
+@ifset emacsgw
+@node Gateway methods
+@section Gateway methods
+@cindex methods, gateway
+@cindex gateway methods
 
-@end table
+Gateway methods are not methods to access a remote host directly.
+These methods are intended to pass firewalls or proxy servers.
+Therefore, they can be used for proxy host declarations
+(@pxref{Multi-hops}) only.
 
-Some people might wish to use port forwarding with @command{ssh} or
-maybe they have to use a nonstandard port.  This can be accomplished
-by putting a stanza in @file{~/.ssh/config} for the account which
-specifies a different port number for a certain host name.  But it can
-also be accomplished within @value{tramp}, by adding a multi-hop method.
-For example:
+A gateway method must come always along with a method who supports
+port setting (referred to as @samp{-p} kludge).  This is because
+@value{tramp} targets the accompanied method to
+@file{localhost#random_port}, from where the firewall or proxy server
+is accessed to.
+
+Gateway methods support user name and password declarations.  These
+are used to authenticate towards the corresponding firewall or proxy
+server.  They can be passed only if your friendly administrator has
+granted your access.
+
+@table @asis
+@item @option{tunnel}
+@cindex method tunnel
+@cindex tunnel method
+
+This method implements an HTTP tunnel via the @command{CONNECT}
+command (see RFC 2616, 2817).  Any HTTP 1.1 compliant (proxy) server
+shall support this command.
+
+As authentication method, only @option{Basic Authentication} (see RFC
+2617) is implemented so far.  If no port number is given in the
+declaration, port @option{8080} is used for the proxy server.
 
-@lisp
-(add-to-list
- 'tramp-multi-connection-function-alist
- '("sshf" tramp-multi-connect-rlogin "ssh %h -l %u -p 4400%n"))
-@end lisp
 
-Now you can use an @option{sshf} hop which connects to port 4400 instead of
-the standard port.
+@item @option{socks}
+@cindex method socks
+@cindex socks method
+
+The @command{socks} method provides access to SOCKSv5 servers (see
+RFC 1928).  @option{Username/Password Authentication} according to RFC
+1929 is supported.
+
+The default port number of the socks server is @option{1080}, if not
+specified otherwise.
+
+@end table
+@end ifset
 
 
 @node Default Method
@@ -1085,7 +1135,6 @@ methods, giving better performance.
 
 @xref{Inline methods}.
 @xref{External transfer methods}.
-@xref{Multi-hop Methods}.
 
 Another consideration with the selection of transfer methods is the
 environment you will use them in and, especially when used over the
@@ -1098,7 +1147,7 @@ read from other machines.
 
 If you need to connect to remote systems that are accessible from the
 Internet, you should give serious thought to using @option{ssh} based
-methods to connect. These provide a much higher level of security,
+methods to connect.  These provide a much higher level of security,
 making it a non-trivial exercise for someone to obtain your password
 or read the content of the files you are editing.
 
@@ -1119,9 +1168,9 @@ to edit mostly small files.
 
 I guess that these days, most people can access a remote machine by
 using @command{ssh}.  So I suggest that you use the @option{ssh}
-method.  So, type @kbd{C-x C-f
-@value{prefix}ssh@value{postfixsinglehop}root@@otherhost@value{postfix}/etc/motd
-@key{RET}} to edit the @file{/etc/motd} file on the other host.
+method.  So, type @kbd{C-x C-f @trampfn{ssh, root, otherhost,
+/etc/motd} @key{RET}} to edit the @file{/etc/motd} file on the other
+host.
 
 If you can't use @option{ssh} to log in to the remote host, then
 select a method that uses a program that works.  For instance, Windows
@@ -1132,9 +1181,9 @@ implementation of @command{ssh}.  Or you use Kerberos and thus like
 For the special case of editing files on the local host as another
 user, see the @option{su} or @option{sudo} methods.  They offer
 shortened syntax for the @samp{root} account, like
-@file{@value{prefix}su@value{postfixsinglehop}@value{postfix}/etc/motd}.
+@file{@trampfn{su, , , /etc/motd}}.
 
-People who edit large files may want to consider @option{scp} instead
+People who edit large files may want to consider @option{scpc} instead
 of @option{ssh}, or @option{pscp} instead of @option{plink}.  These
 out-of-band methods are faster than inline methods for large files.
 Note, however, that out-of-band methods suffer from some limitations.
@@ -1143,6 +1192,205 @@ from using an out-of-band method!  Maybe even for large files, inline
 methods are fast enough.
 
 
+@node Default User
+@section Selecting a default user
+@cindex default user
+
+The user part of a @value{tramp} file name can be omitted.  Usually,
+it is replaced by the user name you are logged in.  Often, this is not
+what you want.  A typical use of @value{tramp} might be to edit some
+files with root permissions on the local host.  This case, you should
+set the variable @code{tramp-default-user} to reflect that choice.
+For example:
+
+@lisp
+(setq tramp-default-user "root")
+@end lisp
+
+@code{tramp-default-user} is regarded as obsolete, and will be removed
+soon.
+
+@vindex tramp-default-user-alist
+You can also specify different users for certain method/host
+combinations, via the variable @code{tramp-default-user-alist}.  For
+example, if you always have to use the user @samp{john} in the domain
+@samp{somewhere.else}, you can specify the following:
+
+@lisp
+(add-to-list 'tramp-default-user-alist
+             '("ssh" ".*\\.somewhere\\.else\\'" "john"))
+@end lisp
+
+@noindent
+See the documentation for the variable
+@code{tramp-default-user-alist} for more details.
+
+One trap to fall in must be known.  If @value{tramp} finds a default
+user, this user will be passed always to the connection command as
+parameter (for example @samp{ssh here.somewhere.else -l john}.  If you
+have specified another user for your command in its configuration
+files, @value{tramp} cannot know it, and the remote access will fail.
+If you have specified in the given example in @file{~/.ssh/config} the
+lines
+
+@example
+Host here.somewhere.else
+     User lily
+@end example
+
+@noindent
+than you must discard selecting a default user by @value{tramp}.  This
+will be done by setting it to @code{nil} (or @samp{lily}, likewise):
+
+@lisp
+(add-to-list 'tramp-default-user-alist
+             '("ssh" "\\`here\\.somewhere\\.else\\'" nil))
+@end lisp
+
+The last entry in @code{tramp-default-user-alist} could be your
+default user you'll apply predominantly.  You shall @emph{append} it
+to that list at the end:
+
+@lisp
+(add-to-list 'tramp-default-user-alist '(nil nil "jonas") t)
+@end lisp
+
+
+@node Default Host
+@section Selecting a default host
+@cindex default host
+
+@vindex tramp-default-host
+Finally, it is even possible to omit the host name part of a
+@value{tramp} file name.  This case, the value of the variable
+@code{tramp-default-host} is used.  Per default, it is initialized
+with the host name your local @value{emacsname} is running.
+
+If you, for example, use @value{tramp} mainly to contact the host
+@samp{target} as user @samp{john}, you can specify:
+
+@lisp
+(setq tramp-default-user "john"
+      tramp-default-host "target")
+@end lisp
+
+Then the simple file name @samp{@trampfn{ssh, , ,}} will connect you
+to John's home directory on target.
+@ifset emacs
+Note, however, that the most simplification @samp{/::} won't work,
+because @samp{/:} is the prefix for quoted file names.
+@end ifset
+
+
+@node Multi-hops
+@section Connecting to a remote host using multiple hops
+@cindex multi-hop
+@cindex proxy hosts
+
+Sometimes, the methods described before are not sufficient.  Sometimes,
+it is not possible to connect to a remote host using a simple command.
+For example, if you are in a secured network, you might have to log in
+to a `bastion host' first before you can connect to the outside world.
+Of course, the target host may also require a bastion host.
+
+@vindex tramp-default-proxies-alist
+In order to specify such multiple hops, it is possible to define a proxy
+host to pass through, via the variable
+@code{tramp-default-proxies-alist}.  This variable keeps a list of
+triples (@var{host} @var{user} @var{proxy}).
+
+ The first matching item specifies the proxy host to be passed for a
+file name located on a remote target matching @var{user}@@@var{host}.
+@var{host} and @var{user} are regular expressions or @code{nil}, which
+is interpreted as a regular expression which always matches.
+
+@var{proxy} must be a Tramp filename which localname part is ignored.
+Method and user name on @var{proxy} are optional, which is interpreted
+with the default values.
+@ifset emacsgw
+The method must be an inline or gateway method (@pxref{Inline
+methods}, @pxref{Gateway methods}).
+@end ifset
+@ifclear emacsgw
+The method must be an inline method (@pxref{Inline methods}).
+@end ifclear
+If @var{proxy} is @code{nil}, no additional hop is required reaching
+@var{user}@@@var{host}.
+
+If you, for example, must pass the host @samp{bastion.your.domain} as
+user @samp{bird} for any remote host which is not located in your local
+domain, you can set
+
+@lisp
+(add-to-list 'tramp-default-proxies-alist
+             '("\\." nil "@trampfn{ssh, bird, bastion.your.domain,}"))
+(add-to-list 'tramp-default-proxies-alist
+             '("\\.your\\.domain\\'" nil nil))
+@end lisp
+
+Please note the order of the code.  @code{add-to-list} adds elements at the
+beginning of a list.  Therefore, most relevant rules must be added last.
+
+Proxy hosts can be cascaded.  If there is another host called
+@samp{jump.your.domain}, which is the only one in your local domain who
+is allowed connecting @samp{bastion.your.domain}, you can add another
+rule:
+
+@lisp
+(add-to-list 'tramp-default-proxies-alist
+             '("\\`bastion\\.your\\.domain\\'"
+               "\\`bird\\'"
+               "@trampfn{ssh, , jump.your.domain,}"))
+@end lisp
+
+@var{proxy} can contain the patterns @code{%h} or @code{%u}.  These
+patterns are replaced by the strings matching @var{host} or
+@var{user}, respectively.
+
+If you, for example, wants to work as @samp{root} on hosts in the
+domain @samp{your.domain}, but login as @samp{root} is disabled for
+non-local access, you might add the following rule:
+
+@lisp
+(add-to-list 'tramp-default-proxies-alist
+             '("\\.your\\.domain\\'" "\\`root\\'" "@trampfn{ssh, , %h,}"))
+@end lisp
+
+Opening @file{@trampfn{sudo, , randomhost.your.domain,}} would connect
+first @samp{randomhost.your.domain} via @code{ssh} under your account
+name, and perform @code{sudo -u root} on that host afterwards.  It is
+important to know that the given method is applied on the host which
+has been reached so far.  @code{sudo -u root}, applied on your local
+host, wouldn't be useful here.
+
+This is the recommended configuration to work as @samp{root} on remote
+Ubuntu hosts.
+
+@ifset emacsgw
+Finally, @code{tramp-default-proxies-alist} can be used to pass
+firewalls or proxy servers.  Imagine your local network has a host
+@samp{proxy.your.domain} which is used on port 3128 as HTTP proxy to
+the outer world.  Your friendly administrator has granted you access
+under your user name to @samp{host.other.domain} on that proxy
+server.@footnote{HTTP tunnels are intended for secure SSL/TLS
+communication.  Therefore, many proxy server restrict the tunnels to
+related target ports.  You might need to run your ssh server on your
+target host @samp{host.other.domain} on such a port, like 443 (https).
+See @uref{http://savannah.gnu.org/maintenance/CvsFromBehindFirewall}
+for discussion of ethical issues.}  You would need to add the
+following rule:
+
+@lisp
+(add-to-list 'tramp-default-proxies-alist
+             '("\\`host\\.other\\.domain\\'" nil
+               "@trampfn{tunnel, , proxy.your.domain#3128,}"))
+@end lisp
+
+Gateway methods can be declared as first hop only in a multiple hop
+chain.
+@end ifset
+
+
 @node Customizing Methods
 @section Using Non-Standard Methods
 @cindex customizing methods
@@ -1263,8 +1511,8 @@ you might provide such a function as well.  This function must meet
 the following conventions:
 
 @defun my-tramp-parse file
-@var{file} must be either a file name on your host, or @code{nil}. The
-function must return a list of (@var{user} @var{host}), which are
+@var{file} must be either a file name on your host, or @code{nil}.
+The function must return a list of (@var{user} @var{host}), which are
 taken as candidates for user and host name completion.
 
 Example:
@@ -1309,16 +1557,44 @@ can be disabled totally by customizing the variable
 @code{password-cache} (setting it to @code{nil}).
 
 Implementation Note: password caching is based on the package
-password.el in No Gnus.  For the time being, it is activated only when
-this package is seen in the @code{load-path} while loading @value{tramp}.
+@file{password.el} in No Gnus.  For the time being, it is activated
+only when this package is seen in the @code{load-path} while loading
+@value{tramp}.
 @ifset installchapter
-If you don't use No Gnus, you can take password.el from the @value{tramp}
-@file{contrib} directory, see @ref{Installation parameters}.
+If you don't use No Gnus, you can take @file{password.el} from the
+@value{tramp} @file{contrib} directory, see @ref{Installation
+parameters}.
 @end ifset
 It will be activated mandatory once No Gnus has found its way into
 @value{emacsname}.
 
 
+@node Connection caching
+@section Reusing connection related information.
+@cindex caching
+
+@vindex tramp-persistency-file-name
+In order to reduce initial connection time, @value{tramp} stores
+connection related information persistently.  The variable
+@code{tramp-persistency-file-name} keeps the file name where these
+information are written.  Its default value is
+@ifset emacs
+@file{~/.emacs.d/tramp}.
+@end ifset
+@ifset xemacs
+@file{~/.xemacs/tramp}.
+@end ifset
+It is recommended to choose a local file name.
+
+@value{tramp} reads this file during startup, and writes it when
+exiting @value{emacsname}.  You can simply remove this file if
+@value{tramp} shall be urged to recompute these information next
+@value{emacsname} startup time.
+
+Using such persistent information can be disabled by setting
+@code{tramp-persistency-file-name} to @code{nil}.
+
+
 @node Remote Programs
 @section How @value{tramp} finds and uses programs on the remote machine.
 
@@ -1327,25 +1603,32 @@ function, including @command{ls}, @command{test}, @command{find} and
 @command{cat}.
 
 In addition to these required tools, there are various tools that may be
-required based on the connection method. See @ref{Inline methods} and
+required based on the connection method.  See @ref{Inline methods} and
 @ref{External transfer methods} for details on these.
 
 Certain other tools, such as @command{perl} (or @command{perl5}) and
-@command{grep} will be used if they can be found. When they are
+@command{grep} will be used if they can be found.  When they are
 available, they are used to improve the performance and accuracy of
 remote file access.
 
 @vindex tramp-remote-path
 When @value{tramp} connects to the remote machine, it searches for the
-programs that it can use. The variable @var{tramp-remote-path} controls
-the directories searched on the remote machine.
+programs that it can use.  The variable @code{tramp-remote-path}
+controls the directories searched on the remote machine.
 
 By default, this is set to a reasonable set of defaults for most
-machines. It is possible, however, that your local (or remote ;) system
+machines.  The symbol @code{tramp-default-remote-path} is a place
+holder, it is replaced by the list of directories received via the
+command @command{getconf PATH} on your remote machine.  For example,
+on GNU Debian this is @file{/bin:/usr/bin}, whereas on Solaris this is
+@file{/usr/xpg4/bin:/usr/ccs/bin:/usr/bin:/opt/SUNWspro/bin}.  It is
+recommended to apply this symbol on top of @code{tramp-remote-path}.
+
+It is possible, however, that your local (or remote ;) system
 administrator has put the tools you want in some obscure local
 directory.
 
-In this case, you can still use them with @value{tramp}. You simply need to
+In this case, you can still use them with @value{tramp}.  You simply need to
 add code to your @file{.emacs} to add the directory to the remote path.
 This will then be searched by @value{tramp} when you connect and the software
 found.
@@ -1433,20 +1716,37 @@ circumstances.
 
 Some people invoke the @command{tset} program from their shell startup
 scripts which asks the user about the terminal type of the shell.
-Maybe some shells ask other questions when they are started.  @value{tramp}
-does not know how to answer these questions.  There are two approaches
-for dealing with this problem.  One approach is to take care that the
-shell does not ask any questions when invoked from @value{tramp}.  You can
-do this by checking the @code{TERM} environment variable, it will be
-set to @code{dumb} when connecting.
+Maybe some shells ask other questions when they are started.
+@value{tramp} does not know how to answer these questions.  There are
+two approaches for dealing with this problem.  One approach is to take
+care that the shell does not ask any questions when invoked from
+@value{tramp}.  You can do this by checking the @code{TERM}
+environment variable, it will be set to @code{dumb} when connecting.
 
 @vindex tramp-terminal-type
 The variable @code{tramp-terminal-type} can be used to change this value
 to @code{dumb}.
 
+@vindex tramp-actions-before-shell
 The other approach is to teach @value{tramp} about these questions.  See
-the variables @code{tramp-actions-before-shell} and
-@code{tramp-multi-actions} (for multi-hop connections).
+the variable @code{tramp-actions-before-shell}.  Example:
+
+@lisp
+(defconst my-tramp-prompt-regexp
+  (concat (regexp-opt '("Enter the birth date of your mother:") t)
+          "\\s-*")
+  "Regular expression matching my login prompt question.")
+
+(defun my-tramp-action (proc vec)
+  "Enter \"19000101\" in order to give a correct answer."
+  (save-window-excursion
+    (with-current-buffer (tramp-get-connection-buffer vec)
+      (tramp-message vec 6 "\n%s" (buffer-string))
+      (tramp-send-string vec "19000101"))))
+
+(add-to-list 'tramp-actions-before-shell
+             '(my-tramp-prompt-regexp my-tramp-action))
+@end lisp
 
 
 @item Environment variables named like users in @file{.profile}
@@ -1484,10 +1784,10 @@ of the single character tilde, strange things will happen.
 
 What can you do about this?
 
-Well, one possibility is to make sure that everything in @file{~/.shrc}
-and @file{~/.profile} on all remote hosts is Bourne-compatible.  In the
-above example, instead of @command{export FOO=bar}, you might use
-@command{FOO=bar; export FOO} instead.
+Well, one possibility is to make sure that everything in
+@file{~/.shrc} and @file{~/.profile} on all remote hosts is
+Bourne-compatible.  In the above example, instead of @command{export
+FOO=bar}, you might use @command{FOO=bar; export FOO} instead.
 
 The other possibility is to put your non-Bourne shell setup into some
 other files.  For example, bash reads the file @file{~/.bash_profile}
@@ -1528,13 +1828,13 @@ variable
 @ifset xemacs
 @code{bkup-backup-directory-info}.
 @end ifset
-In connection with @value{tramp}, this can have unexpected side effects.
-Suppose that you specify that all backups should go to the directory
-@file{~/.emacs.d/backups/}, and then you edit the file
-@file{@value{prefix}su@value{postfixsinglehop}root@@localhost@value{postfix}/etc/secretfile}.
-The effect is that the backup file will be owned by you and not by
-root, thus possibly enabling others to see it even if they were not
-intended to see it.
+In connection with @value{tramp}, this can have unexpected side
+effects.  Suppose that you specify that all backups should go to the
+directory @file{~/.emacs.d/backups/}, and then you edit the file
+@file{@trampfn{su, root, localhost, /etc/secretfile}}.  The effect is
+that the backup file will be owned by you and not by root, thus
+possibly enabling others to see it even if they were not intended to
+see it.
 
 When
 @ifset emacs
@@ -1608,14 +1908,15 @@ Example:
 @end ifset
 
 @noindent
-The backup file name of
-@file{@value{prefix}su@value{postfixsinglehop}root@@localhost@value{postfix}/etc/secretfile}
-would be
+The backup file name of @file{@trampfn{su, root, localhost,
+/etc/secretfile}} would be
 @ifset emacs
-@file{@value{prefix}su@value{postfixsinglehop}root@@localhost@value{postfix}~/.emacs.d/backups/!su:root@@localhost:!etc!secretfile~}
+@file{@trampfn{su, root, localhost,
+~/.emacs.d/backups/!su:root@@localhost:!etc!secretfile~}}
 @end ifset
 @ifset xemacs
-@file{@value{prefix}su@value{postfixsinglehop}root@@localhost@value{postfix}~/.emacs.d/backups/![su!root@@localhost]!etc!secretfile~}
+@file{@trampfn{su, root, localhost,
+~/.emacs.d/backups/![su!root@@localhost]!etc!secretfile~}}
 @end ifset
 
 The same problem can happen with auto-saving files.
@@ -1669,8 +1970,8 @@ can find information about setting up Cygwin in their FAQ at
 If you wish to use the @option{scpx} connection method, then you might
 have the problem that @value{emacsname} calls @command{scp} with a
 Windows filename such as @code{c:/foo}.  The Cygwin version of
-@command{scp} does not know about Windows filenames and interprets this
-as a remote filename on the host @code{c}.
+@command{scp} does not know about Windows filenames and interprets
+this as a remote filename on the host @code{c}.
 
 One possible workaround is to write a wrapper script for @option{scp}
 which converts the Windows filename to a Cygwinized filename.
@@ -1696,9 +1997,9 @@ know anything at all about Windows@dots{}
 @chapter Using @value{tramp}
 @cindex using @value{tramp}
 
-Once you have installed @value{tramp} it will operate fairly transparently. You
-will be able to access files on any remote machine that you can log in
-to as though they were local.
+Once you have installed @value{tramp} it will operate fairly
+transparently.  You will be able to access files on any remote machine
+that you can log in to as though they were local.
 
 Files are specified to @value{tramp} using a formalized syntax specifying the
 details of the system to connect to.  This is similar to the syntax used
@@ -1717,10 +2018,9 @@ minute you have already forgotten that you hit that key!
 
 @menu
 * Filename Syntax::             @value{tramp} filename conventions.
-* Multi-hop filename syntax::   Multi-hop filename conventions.
+* Alternative Syntax::          URL-like filename syntax.
 * Filename completion::         Filename completion.
-* Dired::                       Dired.
-* Compilation::                 Compile remote files.
+* Remote processes::            Integration with other @value{emacsname} packages.
 @end menu
 
 
@@ -1729,123 +2029,107 @@ minute you have already forgotten that you hit that key!
 @cindex filename syntax
 @cindex filename examples
 
-To access the file @var{localname} on the remote machine @var{machine} you
-would specify the filename
-@file{@value{prefix}@var{machine}@value{postfix}@var{localname}}.
-This will connect to @var{machine} and transfer the file using the
-default method.  @xref{Default Method}.
+To access the file @var{localname} on the remote machine @var{machine}
+you would specify the filename @file{@trampfn{, , @var{machine},
+@var{localname}}}.  This will connect to @var{machine} and transfer
+the file using the default method.  @xref{Default Method}.
 
 Some examples of @value{tramp} filenames are shown below.
 
 @table @file
-@item @value{prefix}melancholia@value{postfix}.emacs
+@item @trampfn{, , melancholia, .emacs}
 Edit the file @file{.emacs} in your home directory on the machine
 @code{melancholia}.
 
-@item @value{prefix}melancholia.danann.net@value{postfix}.emacs
+@item @trampfn{, , melancholia.danann.net, .emacs}
 This edits the same file, using the fully qualified domain name of
 the machine.
 
-@item @value{prefix}melancholia@value{postfix}~/.emacs
+@item @trampfn{, , melancholia, ~/.emacs}
 This also edits the same file --- the @file{~} is expanded to your
 home directory on the remote machine, just like it is locally.
 
-@item @value{prefix}melancholia@value{postfix}~daniel/.emacs
+@item @trampfn{, , melancholia, ~daniel/.emacs}
 This edits the file @file{.emacs} in the home directory of the user
-@code{daniel} on the machine @code{melancholia}. The @file{~<user>}
+@code{daniel} on the machine @code{melancholia}.  The @file{~<user>}
 construct is expanded to the home directory of that user on the remote
 machine.
 
-@item @value{prefix}melancholia@value{postfix}/etc/squid.conf
+@item @trampfn{, , melancholia, /etc/squid.conf}
 This edits the file @file{/etc/squid.conf} on the machine
 @code{melancholia}.
 
 @end table
 
 Unless you specify a different name to use, @value{tramp} will use the
-current local user name as the remote user name to log in with. If you
+current local user name as the remote user name to log in with.  If you
 need to log in as a different user, you can specify the user name as
 part of the filename.
 
 To log in to the remote machine as a specific user, you use the syntax
-@file{@value{prefix}@var{user}@@@var{machine}@value{postfix}/@var{path/to.file}}.
+@file{@trampfn{, @var{user}, @var{machine}, @var{path/to.file}}}.
 That means that connecting to @code{melancholia} as @code{daniel} and
 editing @file{.emacs} in your home directory you would specify
-@file{@value{prefix}daniel@@melancholia@value{postfix}.emacs}.
+@file{@trampfn{, daniel, melancholia, .emacs}}.
 
 It is also possible to specify other file transfer methods
 (@pxref{Default Method}) as part of the filename.
 @ifset emacs
 This is done by putting the method before the user and host name, as
-in
-@file{@value{prefix}@var{method}@value{postfixsinglehop}}
-(Note the trailing colon).
+in @file{@value{prefix}@var{method}@value{postfixhop}} (Note the
+trailing colon).
 @end ifset
 @ifset xemacs
-This is done by replacing the initial
-@file{@value{prefix}} with
-@file{@value{prefix}<method>@value{postfixsinglehop}}.
-(Note the trailing slash!).
+This is done by replacing the initial @file{@value{prefix}} with
+@file{@value{prefix}<method>@value{postfixhop}}.  (Note the trailing
+slash!).
 @end ifset
 The user, machine and file specification remain the same.
 
 So, to connect to the machine @code{melancholia} as @code{daniel},
-using the @option{ssh} method to transfer files, and edit @file{.emacs}
-in my home directory I would specify the filename
-@file{@value{prefix}ssh@value{postfixsinglehop}daniel@@melancholia@value{postfix}.emacs}.
-
+using the @option{ssh} method to transfer files, and edit
+@file{.emacs} in my home directory I would specify the filename
+@file{@trampfn{ssh, daniel, melancholia, .emacs}}.
 
-@node Multi-hop filename syntax
-@section Multi-hop filename conventions
-@cindex filename syntax for multi-hop files
-@cindex multi-hop filename syntax
 
-The syntax of multi-hop file names is necessarily slightly different
-than the syntax of other @value{tramp} file names.  Here's an example
-multi-hop file name:
+@node Alternative Syntax
+@section URL-like filename syntax
+@cindex filename syntax
+@cindex filename examples
 
-@example
-@value{prefix}multi@value{postfixsinglehop}rsh@value{postfixmultihop}out@@gate@value{postfixsinglehop}telnet@value{postfixmultihop}kai@@real.host@value{postfix}/path/to.file
-@end example
+Additionally to the syntax described in the previous chapter, it is
+possible to use a URL-like syntax for @value{tramp}.  This can be
+switched on by customizing the variable @code{tramp-syntax}.  Please
+note that this feature is experimental for the time being.
 
-This is quite a mouthful.  So let's go through it step by step.  The
-file name consists of three parts.
-@ifset emacs
-The parts are separated by colons
-@end ifset
-@ifset xemacs
-The parts are separated by slashes and square brackets.
-@end ifset
-The first part is @file{@value{prefix}multi}, the method
-specification.  The second part is
-@file{rsh@value{postfixmultihop}out@@gate@value{postfixsinglehop}telnet@value{postfixmultihop}kai@@real.host}
-and specifies the hops.  The final part is @file{/path/to.file} and
-specifies the file name on the remote host.
+The variable @code{tramp-syntax} must be set before requiring @value{tramp}:
 
-The first part and the final part should be clear.  See @ref{Multi-hop
-Methods}, for a list of alternatives for the method specification.
+@lisp
+(setq tramp-syntax 'url)
+(require 'tramp)
+@end lisp
 
-The second part can be subdivided again into components, so-called
-hops.  In the above file name, there are two hops,
-@file{rsh@value{postfixmultihop}out@@gate} and
-@file{telnet@value{postfixmultihop}kai@@real.host}.
+Then, a @value{tramp} filename would look like this:
+@file{/@var{method}://@var{user}@@@var{machine}:@var{port}/@var{path/to.file}}.
+@file{/@var{method}://} is mandatory, all other parts are optional.
+@file{:@var{port}} is useful for methods only who support this.
 
-Each hop can @emph{again} be subdivided into (three) components, the
-@dfn{hop method}, the @dfn{user name} and the @dfn{host name}.  The
-meaning of the second and third component should be clear, and the hop
-method says what program to use to perform that hop.
+The last example from the previous section would look like this:
+@file{/ssh://daniel@@melancholia/.emacs}.
 
-The first hop, @file{rsh@value{postfixmultihop}out@@gate},
-says to use @command{rsh} to log in as user @code{out} to the host
-@code{gate}.  Starting at that host, the second hop,
-@file{telnet@value{postfixmultihop}kai@@real.host}, says to
-use @command{telnet} to log in as user @code{kai} to host
-@code{real.host}.
+For the time being, @code{tramp-syntax} can have the following values:
 
-@xref{Multi-hop Methods}, for a list of possible hop method values.
-The variable @code{tramp-multi-connection-function-alist} contains the
-list of possible hop methods and information on how to execute them,
-should you want to add your own.
+@itemize @w{}
+@ifset emacs
+@item @code{ftp} -- That is the default syntax
+@item @code{url} -- URL-like syntax
+@end ifset
+@ifset xemacs
+@item @code{sep} -- That is the default syntax
+@item @code{url} -- URL-like syntax
+@item @code{ftp} -- EFS-like syntax
+@end ifset
+@end itemize
 
 
 @node Filename completion
@@ -1853,10 +2137,20 @@ should you want to add your own.
 @cindex filename completion
 
 Filename completion works with @value{tramp} for completion of method
-names, of user names and of machine names (except multi-hop methods)
-as well as for completion of file names on remote machines.
+names, of user names and of machine names as well as for completion of
+file names on remote machines.
 @ifset emacs
-In order to enable this, Partial Completion mode must be set on.
+In order to enable this, Partial Completion mode must be set
+on@footnote{If you don't use Partial Completion mode, but want to
+keep full completion, load @value{tramp} like this in your
+@file{.emacs}:
+
+@lisp
+;; Preserve Tramp's completion features.
+(let ((partial-completion-mode t))
+  (require 'tramp))
+@end lisp
+}.
 @ifinfo
 @xref{Completion Options, , , @value{emacsdir}}.
 @end ifinfo
@@ -1867,85 +2161,189 @@ If you, for example, type @kbd{C-x C-f @value{prefix}t
 
 @example
 @ifset emacs
-@value{prefixsinglehop}telnet@value{postfixsinglehop}                             tmp/
-@value{prefixsinglehop}toto@value{postfix}
+@value{prefixhop}telnet@value{postfixhop}                        tmp/
+@value{prefixhop}toto@value{postfix}
 @end ifset
 @ifset xemacs
-@value{prefixsinglehop}telnet@value{postfixsinglehop}                             @value{prefixsinglehop}toto@value{postfix}
+@value{prefixhop}telnet@value{postfixhop}                        @value{prefixhop}toto@value{postfix}
 @end ifset
 @end example
 
-@samp{@value{prefixsinglehop}telnet@value{postfixsinglehop}}
+@samp{@value{prefixhop}telnet@value{postfixhop}}
 is a possible completion for the respective method,
 @ifset emacs
 @samp{tmp/} stands for the directory @file{/tmp} on your local
 machine,
 @end ifset
-and @samp{@value{prefixsinglehop}toto@value{postfix}}
+and @samp{@value{prefixhop}toto@value{postfix}}
 might be a host @value{tramp} has detected in your @file{~/.ssh/known_hosts}
 file (given you're using default method @option{ssh}).
 
 If you go on to type @kbd{e @key{TAB}}, the minibuffer is completed to
-@samp{@value{prefix}telnet@value{postfixsinglehop}}.
+@samp{@value{prefix}telnet@value{postfixhop}}.
 Next @kbd{@key{TAB}} brings you all machine names @value{tramp} detects in
 your @file{/etc/hosts} file, let's say
 
 @example
-@value{prefixsinglehop}telnet@value{postfixsinglehop}127.0.0.1@value{postfix}             @value{prefixsinglehop}telnet@value{postfixsinglehop}192.168.0.1@value{postfix}
-@value{prefixsinglehop}telnet@value{postfixsinglehop}localhost@value{postfix}             @value{prefixsinglehop}telnet@value{postfixsinglehop}melancholia.danann.net@value{postfix}
-@value{prefixsinglehop}telnet@value{postfixsinglehop}melancholia@value{postfix}
+@trampfn{telnet, , 127.0.0.1,}             @trampfn{telnet, , 192.168.0.1,}
+@trampfn{telnet, , localhost,}             @trampfn{telnet, , melancholia.danann.net,}
+@trampfn{telnet, , melancholia,}
 @end example
 
 Now you can choose the desired machine, and you can continue to
 complete file names on that machine.
 
-As filename completion needs to fetch the listing of files from the
-remote machine, this feature is sometimes fairly slow.  As @value{tramp}
-does not yet cache the results of directory listing, there is no gain
-in performance the second time you complete filenames.
-
 If the configuration files (@pxref{Customizing Completion}), which
 @value{tramp} uses for analysis of completion, offer user names, those user
 names will be taken into account as well.
 
+Remote machines, which have been visited in the past and kept
+persistently (@pxref{Connection caching}), will be offered too.
 
-@node Dired
-@section Dired
-@cindex dired
+Once the remote machine identification is completed, it comes to
+filename completion on the remote host.  This works pretty much like
+for files on the local host, with the exception that minibuffer
+killing via a double-slash works only on the filename part, except
+that filename part starts with @file{//}.
+@ifinfo
+@xref{Minibuffer File, , , @value{emacsdir}}.
+@end ifinfo
 
-@value{tramp} works transparently with dired, enabling you to use this powerful
-file management tool to manage files on any machine you have access to
-over the Internet.
+@ifset emacs
+As example, @kbd{@trampfn{telnet, , melancholia, /usr/local/bin//etc}
+@key{TAB}} would result in
+@file{@trampfn{telnet, , melancholia, /etc}}, whereas
+@kbd{@trampfn{telnet, , melancholia, //etc} @key{TAB}} reduces the
+minibuffer contents to @file{/etc}.  A triple-slash stands for the
+default behaviour,
+i.e. @kbd{@trampfn{telnet, , melancholia, /usr/local/bin///etc}
+@key{TAB}} expands directly to @file{/etc}.
+@end ifset
 
-If you need to browse a directory tree, Dired is a better choice, at
-present, than filename completion.  Dired has its own cache mechanism
-and will only fetch the directory listing once.
+@ifset xemacs
+As example, @kbd{@trampfn{telnet, , melancholia, /usr/local/bin//}}
+would result in @file{@trampfn{telnet, , melancholia, /}}, whereas
+@kbd{@trampfn{telnet, , melancholia, //}} expands the minibuffer
+contents to @file{/}.
+@end ifset
 
 
-@node Compilation
-@section Compile remote files
+@node Remote processes
+@section Integration with other @value{emacsname} packages.
 @cindex compile
 @cindex recompile
 
-@value{tramp} provides commands for compilation of files on remote
-machines.  In order to get them loaded, you need to require
-@file{tramp-util.el}:
+@value{tramp} supports running processes on a remote host.  This
+allows to exploit @value{emacsname} packages without modification for
+remote file names.  It does not work for the @option{ftp} and
+@option{smb} methods.
+
+Remote processes are started when a corresponding command is executed
+from a buffer belonging to a remote file or directory.  Up to now, the
+packages @file{compile.el} (commands like @code{compile} and
+@code{grep}) and @file{gud.el} (@code{gdb} or @code{perldb}) have been
+integrated.  Integration of further packages is planned, any help for
+this is welcome!
+
+When your program is not found in the default search path
+@value{tramp} sets on the remote machine, you should either use an
+absolute path, or extend @code{tramp-remote-path} (see @ref{Remote
+Programs}):
+
+@lisp
+(add-to-list 'tramp-remote-path "~/bin")
+(add-to-list 'tramp-remote-path "/appli/pub/bin")
+@end lisp
+
+The environment for your program can be adapted by customizing
+@code{tramp-remote-process-environment}.  This variable is a list of
+strings.  It is structured like @code{process-environment}.  Each
+element is a string of the form ENVVARNAME=VALUE.  An entry
+ENVVARNAME= disables the corresponding environment variable, which
+might have been set in your init file like @file{~/.profile}.
+
+@noindent
+Adding an entry can be performed via @code{add-to-list}:
+
+@lisp
+(add-to-list 'tramp-remote-process-environment "JAVA_HOME=/opt/java")
+@end lisp
+
+Changing or removing an existing entry is not encouraged.  The default
+values are chosen for proper @value{tramp} work.  Nevertheless, if for
+example a paranoid system administrator disallows changing the
+@var{$HISTORY} environment variable, you can customize
+@code{tramp-remote-process-environment}, or you can apply the
+following code in your @file{.emacs}:
 
 @lisp
-(require 'tramp-util)
+(let ((process-environment tramp-remote-process-environment))
+  (setenv "HISTORY" nil)
+  (setq tramp-remote-process-environment process-environment))
 @end lisp
 
-Afterwards, you can use the commands @code{tramp-compile} and
-@code{tramp-recompile} instead of @code{compile} and @code{recompile},
-respectively; @inforef{Compilation, ,@value{emacsdir}}.  This does not
-work for the @option{ftp} and @option{smb} methods.
+If you use other @value{emacsname} packages which do not run
+out-of-the-box on a remote host, please let us know.  We will try to
+integrate them as well.  @xref{Bug Reports}.
+
+
+@subsection Running eshell on a remote host
+@cindex eshell
+
+@value{tramp} is integrated into @file{eshell.el}.  That is, you can
+open an interactive shell on your remote host, and run commands there.
+After you have started @code{eshell}, you could perform commands like
+this:
+
+@example
+@b{~ $} cd @trampfn{sudo, , , /etc} @key{RET}
+@b{@trampfn{sudo, root, host, /etc} $} hostname @key{RET}
+host
+@b{@trampfn{sudo, root, host, /etc} $} id @key{RET}
+uid=0(root) gid=0(root) groups=0(root)
+@b{@trampfn{sudo, root, host, /etc} $} find-file shadow @key{RET}
+#<buffer shadow>
+@b{@trampfn{sudo, root, host, /etc} $}
+@end example
+
+
+@anchor{Running a debugger on a remote host}
+@subsection Running a debugger on a remote host
+@cindex gud
+@cindex gdb
+@cindex perldb
+
+@file{gud.el} offers an unified interface to several symbolic
+debuggers
+@ifset emacs
+@ifinfo
+(@ref{Debuggers, , , @value{emacsdir}}).
+@end ifinfo
+@end ifset
+With @value{tramp}, it is possible to debug programs on
+remote hosts.  You can call @code{gdb} with a remote file name:
+
+@example
+@kbd{M-x gdb @key{RET}}
+@b{Run gdb (like this):} gdb --annotate=3 @trampfn{ssh, , host, ~/myprog} @key{RET}
+@end example
+
+The file name can also be relative to a remote default directory.
+Given you are in a buffer that belongs to the remote directory
+@trampfn{ssh, , host, /home/user}, you could call
+
+@example
+@kbd{M-x perldb @key{RET}}
+@b{Run perldb (like this):} perl -d myprog.pl @key{RET}
+@end example
 
-The corresponding key bindings and menu entries calling these commands
-are redefined automatically for buffers associated with remote files.
+It is not possible to use just the absolute local part of a remote
+file name as program to debug, like @kbd{perl -d
+/home/user/myprog.pl}, though.
 
-After finishing the compilation, you can use the usual commands like
-@code{previous-error}, @code{next-error} and @code{first-error} for
-navigation in the @file{*Compilation*} buffer.
+Arguments of the program to be debugged are taken literally.  That
+means file names as arguments must be given as ordinary relative or
+absolute file names, without any remote specification.
 
 
 @node Bug Reports
@@ -1953,7 +2351,7 @@ navigation in the @file{*Compilation*} buffer.
 @cindex bug reports
 
 Bugs and problems with @value{tramp} are actively worked on by the
-development team. Feature requests and suggestions are also more than
+development team.  Feature requests and suggestions are also more than
 welcome.
 
 The @value{tramp} mailing list is a great place to get information on
@@ -1964,16 +2362,16 @@ non-subscribers can post but messages will be delayed, possibly up to
 your message.
 
 The mailing list is at @email{tramp-devel@@gnu.org}.  Messages sent to
-this address go to all the subscribers. This is @emph{not} the address
+this address go to all the subscribers.  This is @emph{not} the address
 to send subscription requests to.
 
 Subscribing to the list is performed via
 @uref{http://lists.gnu.org/mailman/listinfo/tramp-devel/,
 the @value{tramp} Mail Subscription Page}.
 
-To report a bug in @value{tramp}, you should execute @kbd{M-x tramp-bug}. This
-will automatically generate a buffer with the details of your system and
-@value{tramp} version.
+To report a bug in @value{tramp}, you should execute @kbd{M-x
+tramp-bug}.  This will automatically generate a buffer with the details
+of your system and @value{tramp} version.
 
 When submitting a bug report, please try to describe in excruciating
 detail the steps required to reproduce the problem, the setup of the
@@ -1982,8 +2380,20 @@ check that your problem is not described already in @xref{Frequently
 Asked Questions}.
 
 If you can identify a minimal test case that reproduces the problem,
-include that with your bug report. This will make it much easier for the
-development team to analyze and correct the problem.
+include that with your bug report.  This will make it much easier for
+the development team to analyze and correct the problem.
+
+Before reporting the bug, you should set the verbosity level to 6
+(@pxref{Traces and Profiles, Traces}) in the @file{~/.emacs} file and
+repeat the bug.  Then, include the contents of the @file{*tramp/foo*}
+and @file{*debug tramp/foo*} buffers in your bug report.  A verbosity
+level greater than 6 will produce a very huge debug buffer, which is
+mostly not necessary for the analysis.
+
+Please be aware that, with a verbosity level of 6 or greater, the
+contents of files and directories will be included in the debug
+buffer.  Passwords you've typed will never be included there.
+
 
 @node Frequently Asked Questions
 @chapter Frequently Asked Questions
@@ -2009,10 +2419,9 @@ There is also a Savannah project page.
 @item
 Which systems does it work on?
 
-The package has been used successfully on GNU Emacs 20, GNU Emacs 21
-and GNU Emacs 22, as well as XEmacs 21.  XEmacs 20 is more
-problematic, see the notes in @file{tramp.el}.  I don't think anybody
-has really tried it on GNU Emacs 19.
+The package has been used successfully on GNU Emacs 21, GNU Emacs 22
+and XEmacs 21 (starting with 21.4).  Gateway methods are supported for
+GNU Emacs 22 only.
 
 The package was intended to work on Unix, and it really expects a
 Unix-like system on the remote end (except the @option{smb} method),
@@ -2023,13 +2432,41 @@ There is some informations on @value{tramp} on NT at the following URL;
 many thanks to Joe Stoy for providing the information:
 @uref{ftp://ftp.comlab.ox.ac.uk/tmp/Joe.Stoy/}
 
-@c The link is broken. I've contacted Tom for clarification. Michael.
+@c The link is broken.  I've contacted Tom for clarification.  Michael.
 @ignore
 The above mostly contains patches to old ssh versions; Tom Roche has a
 Web page with instructions:
 @uref{http://www4.ncsu.edu/~tlroche/plinkTramp.html}
 @end ignore
 
+@item
+How could I speed up @value{tramp}?
+
+In the backstage, @value{tramp} needs a lot of operations on the
+remote host.  The time for transferring data from and to the remote
+host as well as the time needed to perform the operations there count.
+In order to speed up @value{tramp}, one could either try to avoid some
+of the operations, or one could try to improve their performance.
+
+Use an external transfer method, like @option{scpc}.
+
+Use caching.  This is already enabled by default.  Information about
+the remote host as well as the remote files are cached for reuse.  The
+information about remote hosts is kept in the file specified in
+@code{tramp-persistency-file-name}.  Keep this file.
+
+Disable version control.  If you access remote files which are not
+under version control, a lot of check operations can be avoided by
+disabling VC.  This can be achieved by
+
+@lisp
+(setq vc-handled-backends nil)
+@end lisp
+
+Disable excessive traces.  The default trace level of @value{tramp},
+defined in the variable @code{tramp-verbose}, is 3.  You should
+increase this level only temporarily, hunting bugs.
+
 
 @item
 @value{tramp} does not connect to the remote host
@@ -2048,6 +2485,17 @@ contains unknown characters like escape sequences for coloring.  This
 should be avoided on the remote side.  @xref{Remote shell setup}. for
 setting the regular expression detecting the prompt.
 
+You can check your settings after an unsuccessful connection by
+switching to the @value{tramp} connection buffer @file{*tramp/foo*},
+setting the cursor at the top of the buffer, and applying the expression
+
+@example
+@kbd{M-: (re-search-forward (concat tramp-shell-prompt-pattern "$"))}
+@end example
+
+If it fails, or the cursor is not moved at the end of the buffer, your
+prompt is not recognised correctly.
+
 A special problem is the zsh, which uses left-hand side and right-hand
 side prompts in parallel.  Therefore, it is necessary to disable the
 zsh line editor on the remote host.  You shall add to @file{~/.zshrc}
@@ -2057,15 +2505,34 @@ the following command:
 [ $TERM = "dumb" ] && unsetopt zle && PS1='$ '
 @end example
 
+
 @item
 @value{tramp} doesn't transfer strings with more than 500 characters
 correctly
 
 On some few systems, the implementation of @code{process-send-string}
-seems to be broken for longer strings.  This case, you should
-customize the variable @code{tramp-chunksize} to 500.  For a
-description how to determine whether this is necessary see the
-documentation of @code{tramp-chunksize}.
+seems to be broken for longer strings.  It is reported for HP-UX,
+FreeBSD and Tru64 Unix, for example.  This case, you should customize
+the variable @code{tramp-chunksize} to 500.  For a description how to
+determine whether this is necessary see the documentation of
+@code{tramp-chunksize}.
+
+Additionally, it will be useful to set @code{file-precious-flag} to
+@code{t} for @value{tramp} files.  Then the file contents will be
+written into a temporary file first, which is checked for correct
+checksum.
+@ifinfo
+@pxref{Saving Buffers, , , elisp}
+@end ifinfo
+
+@lisp
+(add-hook
+ 'find-file-hooks
+ '(lambda ()
+    (when (file-remote-p default-directory)
+      (set (make-local-variable 'file-precious-flag) t))))
+@end lisp
+
 @end itemize
 
 
@@ -2117,11 +2584,13 @@ remote host.
  " make tramp beep after writing a file."
  (interactive)
  (beep))
+
 (defadvice tramp-handle-do-copy-or-rename-file
   (after tramp-copy-beep-advice activate)
  " make tramp beep after copying a file."
  (interactive)
  (beep))
+
 (defadvice tramp-handle-insert-file-contents
   (after tramp-copy-beep-advice activate)
  " make tramp beep after copying a file."
@@ -2130,6 +2599,76 @@ remote host.
 @end lisp
 
 
+@ifset emacs
+@item
+I'ld like to see a host indication in the mode line when I'm remote
+
+The following code has been tested with @value{emacsname} 22.1.  You
+should put it into your @file{~/.emacs}:
+
+@lisp
+(defconst my-mode-line-buffer-identification
+  (list
+   '(:eval
+     (let ((host-name
+            (if (file-remote-p default-directory)
+                (tramp-file-name-host
+                 (tramp-dissect-file-name default-directory))
+              (system-name))))
+       (if (string-match "^[^0-9][^.]*\\(\\..*\\)" host-name)
+           (substring host-name 0 (match-beginning 1))
+         host-name)))
+   ": %12b"))
+
+(setq-default
+ mode-line-buffer-identification
+ my-mode-line-buffer-identification)
+
+(add-hook
+ 'dired-mode-hook
+ '(lambda ()
+    (setq
+     mode-line-buffer-identification
+     my-mode-line-buffer-identification)))
+@end lisp
+
+Since @value{emacsname} 23.1, the mode line contains an indication if
+@code{default-directory} for the current buffer is on a remote host.
+The corresponding tooltip includes the name of that host.  If you
+still want the host name as part of the mode line, you can use the
+example above, but the @code{:eval} clause can be simplified:
+
+@lisp
+   '(:eval
+     (let ((host-name
+            (or (file-remote-p default-directory 'host)
+                (system-name))))
+       (if (string-match "^[^0-9][^.]*\\(\\..*\\)" host-name)
+           (substring host-name 0 (match-beginning 1))
+         host-name)))
+@end lisp
+@end ifset
+
+
+@ifset emacs
+@item
+My remote host does not understand default directory listing options
+
+@value{emacsname} computes the @command{dired} options depending on
+the local host you are working.  If your @command{ls} command on the
+remote host does not understand those options, you can change them
+like this:
+
+@lisp
+(add-hook
+ 'dired-before-readin-hook
+ '(lambda ()
+    (when (file-remote-p default-directory)
+      (setq dired-actual-switches "-al"))))
+@end lisp
+@end ifset
+
+
 @item
 There's this @file{~/.sh_history} file on the remote host which keeps
 growing and growing.  What's that?
@@ -2152,6 +2691,252 @@ fi
 @end example
 
 
+@item There are longish file names to type.  How to shorten this?
+
+Let's say you need regularly access to @file{@trampfn{ssh, news,
+news.my.domain, /opt/news/etc}}, which is boring to type again and
+again.  The following approaches can be mixed:
+
+@enumerate
+
+@item Use default values for method and user name:
+
+You can define default methods and user names for hosts,
+(@pxref{Default Method}, @pxref{Default User}):
+
+@lisp
+(setq tramp-default-method "ssh"
+      tramp-default-user "news")
+@end lisp
+
+The file name left to type would be
+@kbd{C-x C-f @trampfn{, , news.my.domain, /opt/news/etc}}.
+
+Note, that there are some useful settings already.  Accessing your
+local host as @samp{root} user, is possible just by @kbd{C-x C-f
+@trampfn{su, , ,}}.
+
+@item Use configuration possibilities of your method:
+
+Several connection methods (i.e. the programs used) offer powerful
+configuration possibilities (@pxref{Customizing Completion}).  In the
+given case, this could be @file{~/.ssh/config}:
+
+@example
+Host xy
+     HostName news.my.domain
+     User news
+@end example
+
+The file name left to type would be @kbd{C-x C-f @trampfn{ssh, , xy,
+/opt/news/etc}}.  Depending on files in your directories, it is even
+possible to complete the hostname with @kbd{C-x C-f
+@value{prefix}ssh@value{postfixhop}x @key{TAB}}.
+
+@item Use environment variables:
+
+File names typed in the minibuffer can be expanded by environment
+variables.  You can set them outside @value{emacsname}, or even with
+Lisp:
+
+@lisp
+(setenv "xy" "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}")
+@end lisp
+
+Then you need simply to type @kbd{C-x C-f $xy @key{RET}}, and here you
+are.  The disadvantage is, that you cannot edit the file name, because
+environment variables are not expanded during editing in the
+minibuffer.
+
+@item Define own keys:
+
+You can define your own key sequences in @value{emacsname}, which can
+be used instead of @kbd{C-x C-f}:
+
+@lisp
+(global-set-key
+ [(control x) (control y)]
+ (lambda ()
+   (interactive)
+   (find-file
+    (read-file-name
+     "Find Tramp file: "
+     "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}"))))
+@end lisp
+
+Simply typing @kbd{C-x C-y} would initialize the minibuffer for
+editing with your beloved file name.
+
+See also @uref{http://www.emacswiki.org/cgi-bin/wiki/TrampMode, the
+Emacs Wiki} for a more comprehensive example.
+
+@item Define own abbreviation (1):
+
+It is possible to define an own abbreviation list for expanding file
+names:
+
+@lisp
+(add-to-list
+ 'directory-abbrev-alist
+ '("^/xy" . "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}"))
+@end lisp
+
+This shortens the file openening command to @kbd{C-x C-f /xy
+@key{RET}}.  The disadvantage is, again, that you cannot edit the file
+name, because the expansion happens after entering the file name only.
+
+@item Define own abbreviation (2):
+
+The @code{abbrev-mode} gives more flexibility for editing the
+minibuffer:
+
+@lisp
+(define-abbrev-table 'my-tramp-abbrev-table
+  '(("xy" "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}")))
+
+(add-hook
+ 'minibuffer-setup-hook
+ '(lambda ()
+    (abbrev-mode 1)
+    (setq local-abbrev-table my-tramp-abbrev-table)))
+
+(defadvice minibuffer-complete
+  (before my-minibuffer-complete activate)
+  (expand-abbrev))
+
+;; If you use partial-completion-mode
+(defadvice PC-do-completion
+  (before my-PC-do-completion activate)
+  (expand-abbrev))
+@end lisp
+
+After entering @kbd{C-x C-f xy @key{TAB}}, the minibuffer is
+expanded, and you can continue editing.
+
+@item Use bookmarks:
+
+Bookmarks can be used to visit Tramp files or directories.
+@ifinfo
+@pxref{Bookmarks, , , @value{emacsdir}}
+@end ifinfo
+
+When you have opened @file{@trampfn{ssh, news, news.my.domain,
+/opt/news/etc/}}, you should save the bookmark via
+@ifset emacs
+@kbd{@key{menu-bar} @key{edit} @key{bookmarks} @key{set}}.
+@end ifset
+@ifset xemacs
+@kbd{@key{menu-bar} @key{view} @key{bookmarks} @key{set}}.
+@end ifset
+
+Later on, you can always navigate to that bookmark via
+@ifset emacs
+@kbd{@key{menu-bar} @key{edit} @key{bookmarks} @key{jump}}.
+@end ifset
+@ifset xemacs
+@kbd{@key{menu-bar} @key{view} @key{bookmarks} @key{jump}}.
+@end ifset
+
+@item Use recent files:
+
+@ifset emacs
+@file{recentf}
+@end ifset
+@ifset xemacs
+@file{recent-files}
+@end ifset
+remembers visited places.
+@ifinfo
+@ifset emacs
+@pxref{File Conveniences, , , @value{emacsdir}}
+@end ifset
+@ifset xemacs
+@pxref{recent-files, , , edit-utils}
+@end ifset
+@end ifinfo
+
+You could keep remote file names in the recent list without checking
+their readability through a remote access:
+
+@lisp
+@ifset emacs
+(recentf-mode 1)
+@end ifset
+@ifset xemacs
+(recent-files-initialize)
+(add-hook
+ 'find-file-hooks
+ (lambda ()
+   (when (file-remote-p (buffer-file-name))
+     (recent-files-make-permanent)))
+ 'append)
+@end ifset
+@end lisp
+
+The list of files opened recently is reachable via
+@ifset emacs
+@kbd{@key{menu-bar} @key{file} @key{Open Recent}}.
+@end ifset
+@ifset xemacs
+@kbd{@key{menu-bar} @key{Recent Files}}.
+@end ifset
+
+@ifset emacs
+@item Use filecache:
+
+@file{filecache} remembers visited places.  Add the directory into
+the cache:
+
+@lisp
+(eval-after-load "filecache"
+  '(file-cache-add-directory
+    "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}"))
+@end lisp
+
+Whenever you want to load a file, you can enter @kbd{C-x C-f
+C-@key{TAB}} in the minibuffer.  The completion is done for the given
+directory.
+@end ifset
+
+@ifset emacs
+@item Use bbdb:
+
+@file{bbdb} has a built-in feature for @value{ftppackagename} files,
+which works also for @value{tramp}.
+@ifinfo
+@pxref{bbdb-ftp, Storing FTP sites in the BBDB, , bbdb}
+@end ifinfo
+
+You need to load @file{bbdb}:
+
+@lisp
+(require 'bbdb)
+(bbdb-initialize)
+@end lisp
+
+Then you can create a BBDB entry via @kbd{M-x bbdb-create-ftp-site}.
+Because BBDB is not prepared for @value{tramp} syntax, you must
+specify a method together with the user name, when needed. Example:
+
+@example
+@kbd{M-x bbdb-create-ftp-site @key{RET}}
+@b{Ftp Site:} news.my.domain @key{RET}
+@b{Ftp Directory:} /opt/news/etc/ @key{RET}
+@b{Ftp Username:} ssh@value{postfixhop}news @key{RET}
+@b{Company:} @key{RET}
+@b{Additional Comments:} @key{RET}
+@end example
+
+When you have opened your BBDB buffer, you can access such an entry by
+pressing the key @key{F}.
+@end ifset
+
+@end enumerate
+
+I would like to thank all @value{tramp} users, who have contributed to
+the different recipes!
+
+
 @item
 How can I disable @value{tramp}?
 
@@ -2180,12 +2965,12 @@ This resets also the @value{ftppackagename} plugins.
 @cindex Version Control
 
 Unlike @value{ftppackagename}, @value{tramp} has full shell access to the
-remote machine. This makes it possible to provide version control for
+remote machine.  This makes it possible to provide version control for
 files accessed under @value{tramp}.
 
 The actual version control binaries must be installed on the remote
 machine, accessible in the directories specified in
-@var{tramp-remote-path}.
+@code{tramp-remote-path}.
 
 This transparent integration with the version control systems is one of
 the most valuable features provided by @value{tramp}, but it is far from perfect.
@@ -2204,7 +2989,7 @@ Work is ongoing to improve the transparency of the system.
 @section Determining if a file is under version control
 
 The VC package uses the existence of on-disk revision control master
-files to determine if a given file is under revision control. These file
+files to determine if a given file is under revision control.  These file
 tests happen on the remote machine through the standard @value{tramp} mechanisms.
 
 
@@ -2212,7 +2997,7 @@ tests happen on the remote machine through the standard @value{tramp} mechanisms
 @section Executing the version control commands on the remote machine
 
 There are no hooks provided by VC to allow intercepting of the version
-control command execution. The calls occur through the
+control command execution.  The calls occur through the
 @code{call-process} mechanism, a function that is somewhat more
 efficient than the @code{shell-command} function but that does not
 provide hooks for remote execution of commands.
@@ -2239,7 +3024,7 @@ workfile and the version control master.
 
 This requires that a shell command be executed remotely, a process that
 is notably heavier-weight than the mtime comparison used for local
-files. Unfortunately, unless a portable solution to the issue is found,
+files.  Unfortunately, unless a portable solution to the issue is found,
 this will remain the cost of remote version control.
 
 
@@ -2247,7 +3032,7 @@ this will remain the cost of remote version control.
 @section Bringing the workfile out of the repository
 
 VC will, by default, check for remote files and refuse to act on them
-when checking out files from the repository. To work around this
+when checking out files from the repository.  To work around this
 problem, the function @code{vc-checkout} knows about @value{tramp} files and
 allows version control to occur.
 
@@ -2266,14 +3051,14 @@ Minor implementation details, &c.
 @node Remote File Ownership
 @subsection How VC determines who owns a workfile
 
-@value{emacsname} provides the @code{user-full-name} function to
+@value{emacsname} provides the @code{user-login-name} function to
 return the login name of the current user as well as mapping from
-arbitrary user id values back to login names. The VC code uses this
+arbitrary user id values back to login names.  The VC code uses this
 functionality to map from the uid of the owner of a workfile to the
 login name in some circumstances.
 
 This will not, for obvious reasons, work if the remote system has a
-different set of logins. As such, it is necessary to delegate to the
+different set of logins.  As such, it is necessary to delegate to the
 remote machine the job of determining the login name associated with a
 uid.
 
@@ -2282,7 +3067,7 @@ as @code{NIS}, @code{NIS+} and @code{NetInfo}, there is no simple,
 reliable and portable method for performing this mapping.
 
 Thankfully, the only place in the VC code that depends on the mapping of
-a uid to a login name is the @code{vc-file-owner} function. This returns
+a uid to a login name is the @code{vc-file-owner} function.  This returns
 the login of the owner of the file as a string.
 
 This function has been advised to use the output of @command{ls} on the
@@ -2304,7 +3089,7 @@ executing a process and parsing its output each time the information is
 needed.
 
 Unfortunately, life is not quite so easy when remote version control
-comes into the picture. Each remote machine may have a different version
+comes into the picture.  Each remote machine may have a different version
 of the version control tools and, while this is painful, we need to
 ensure that unavailable features are not used remotely.
 
@@ -2313,9 +3098,9 @@ approach of making the release values of the revision control tools
 local to each @value{tramp} buffer, forcing VC to determine these values
 again each time a new file is visited.
 
-This has, quite obviously, some performance implications. Thankfully,
+This has, quite obviously, some performance implications.  Thankfully,
 most of the common operations performed by VC do not actually require
-that the remote version be known. This makes the problem far less
+that the remote version be known.  This makes the problem far less
 apparent.
 
 Eventually these values will be captured by @value{tramp} on a system by
@@ -2334,11 +3119,11 @@ system basis and the results cached to improve performance.
 @section Breaking a localname into its components.
 
 @value{tramp} file names are somewhat different, obviously, to ordinary file
-names. As such, the lisp functions @code{file-name-directory} and
+names.  As such, the lisp functions @code{file-name-directory} and
 @code{file-name-nondirectory} are overridden within the @value{tramp}
 package.
 
-Their replacements are reasonably simplistic in their approach. They
+Their replacements are reasonably simplistic in their approach.  They
 dissect the filename, call the original handler on the localname and
 then rebuild the @value{tramp} file name with the result.
 
@@ -2346,6 +3131,77 @@ This allows the platform specific hacks in the original handlers to take
 effect while preserving the @value{tramp} file name information.
 
 
+@node Traces and Profiles
+@chapter How to Customize Traces
+
+All @value{tramp} messages are raised with a verbosity level.  The
+verbosity level can be any number between 0 and 10.  Only messages with
+a verbosity level less than or equal to @code{tramp-verbose} are
+displayed.
+
+The verbosity levels are
+
+          @w{ 0}  silent (no @value{tramp} messages at all)
+@*@indent @w{ 1}  errors
+@*@indent @w{ 2}  warnings
+@*@indent @w{ 3}  connection to remote hosts (default verbosity)
+@*@indent @w{ 4}  activities
+@*@indent @w{ 5}  internal
+@*@indent @w{ 6}  sent and received strings
+@*@indent @w{ 7}  file caching
+@*@indent @w{ 8}  connection properties
+@*@indent @w{10}  traces (huge)
+
+When @code{tramp-verbose} is greater than or equal to 4, the messages
+are also written into a @value{tramp} debug buffer.  This debug buffer
+is useful for analysing problems; sending a @value{tramp} bug report
+should be done with @code{tramp-verbose} set to a verbosity level of at
+least 6 (@pxref{Bug Reports}).
+
+The debug buffer is in
+@ifinfo
+@ref{Outline Mode, , , @value{emacsdir}}.
+@end ifinfo
+@ifnotinfo
+Outline Mode.
+@end ifnotinfo
+That means, you can change the level of messages to be viewed.  If you
+want, for example, see only messages up to verbosity level 5, you must
+enter @kbd{C-u 6 C-c C-q}.
+@ifinfo
+Other keys for navigating are described in
+@ref{Outline Visibility, , , @value{emacsdir}}.
+@end ifinfo
+
+@value{tramp} errors are handled internally in order to raise the
+verbosity level 1 messages.  When you want to get a Lisp backtrace in
+case of an error, you need to set both
+
+@lisp
+(setq debug-on-error t
+      debug-on-signal t)
+@end lisp
+
+Sometimes, it might be even necessary to step through @value{tramp}
+function call traces.  Such traces are enabled by the following code:
+
+@lisp
+(require 'tramp)
+(require 'trace)
+(mapcar 'trace-function-background
+        (mapcar 'intern
+                (all-completions "tramp-" obarray 'functionp)))
+(untrace-function 'tramp-read-passwd)
+(untrace-function 'tramp-gw-basic-authentication)
+@end lisp
+
+The function call traces are inserted in the buffer
+@file{*trace-output*}.  @code{tramp-read-passwd} and
+@code{tramp-gw-basic-authentication} shall be disabled when the
+function call traces are added to @value{tramp}, because both
+functions return password strings, which should not be distributed.
+
+
 @node Issues
 @chapter Debatable Issues and What Was Decided
 
@@ -2368,14 +3224,6 @@ printed and deleted.
 But I have decided that this is too fragile to reliably work, so on some
 systems you'll have to do without the uuencode methods.
 
-@item @value{tramp} does not work on XEmacs 20.
-
-This is because it requires the macro @code{with-timeout} which does not
-appear to exist in XEmacs 20.  I'm somewhat reluctant to add an
-emulation macro to @value{tramp}, but if somebody who uses XEmacs 20 steps
-forward and wishes to implement and test it, please contact me or the
-mailing list.
-
 @item The @value{tramp} filename syntax differs between GNU Emacs and XEmacs.
 
 The GNU Emacs maintainers wish to use a unified filename syntax for
@@ -2402,10 +3250,10 @@ The autoload of the @value{emacsname} @value{tramp} package must be
 disabled.  This can be achieved by setting file permissions @code{000}
 to the files @file{.../xemacs-packages/lisp/tramp/auto-autoloads.el*}.
 
-In case of unified filenames, all @value{emacsname} download sites
-are added to @code{tramp-default-method-alist} with default method
-@option{ftp} @xref{Default Method}.  These settings shouldn't be touched
-for proper working of the @value{emacsname} package system.
+In case of unified filenames, all @value{emacsname} download sites are
+added to @code{tramp-default-method-alist} with default method
+@option{ftp} @xref{Default Method}.  These settings shouldn't be
+touched for proper working of the @value{emacsname} package system.
 
 The syntax for unified filenames is described in the @value{tramp} manual
 for @value{emacsothername}.
@@ -2430,7 +3278,6 @@ for @value{emacsothername}.
 @c   shells.
 @c * Explain how tramp.el works in principle: open a shell on a remote
 @c   host and then send commands to it.
-@c * Mention that bookmarks are a cool feature to go along with Tramp.
 @c * Make terminology "inline" vs "out-of-band" consistent.
 @c   It seems that "external" is also used instead of "out-of-band".
 
index 6c770dc..4ed196a 100644 (file)
@@ -1,27 +1,26 @@
 @c -*-texinfo-*-
 @c texi/trampver.texi.  Generated from trampver.texi.in by configure.
 
-@c This is part of the Emacs manual.
-@c Copyright (C) 2003, 2004, 2005, 2006, 2007
-@c   Free Software Foundation, Inc.
-@c See file emacs.texi for copying conditions.
-
 @c In the Tramp CVS, the version number is auto-frobbed from
 @c configure.ac, so you should edit that file and run
 @c "autoconf && ./configure" to change the version number.
-@set trampver 2.0.56
+@set trampver 2.1.11-pre
 
 @c Other flags from configuration
-@set prefix /usr/local
+@set instprefix /usr/local
 @set lispdir /usr/local/share/emacs/site-lisp
-@set infodir /usr/local/share/info
+@set infodir /usr/local/info
 
 @c Formatting of the tramp program name consistent.
 @set tramp @sc{tramp}
 
+@c Whether or not describe gateway methods.
+@ifclear noemacsgw
+@set emacsgw
+@end ifclear
+
 @c Some flags which make the text independent on the (X)Emacs flavor.
 @c "emacs" resp "xemacs" are set in the Makefile.  Default is "emacs".
-
 @ifclear emacs
 @ifclear xemacs
 @set emacs
 @set emacsdir           emacs
 @set ftppackagename     Ange-FTP
 @set prefix             /
-@set prefixsinglehop
+@set prefixhop
 @set postfix            :
-@set postfixsinglehop   :
-@set postfixmultihop    :
+@set postfixhop         :
 @set emacsothername     XEmacs
 @set emacsotherdir      xemacs
 @set emacsotherfilename tramp-xemacs.html
 @set emacsdir           xemacs
 @set ftppackagename     EFS
 @set prefix             /[
-@set prefixsinglehop    [
+@set prefixhop          [
 @set postfix            ]
-@set postfixsinglehop   /
-@set postfixmultihop    :
+@set postfixhop         /
 @set emacsothername     GNU Emacs
 @set emacsotherdir      emacs
 @set emacsotherfilename tramp-emacs.html
index 5a8d131..83f2808 100644 (file)
@@ -588,12 +588,12 @@ headers.
 @subsection Customizing VC
 
 @vindex vc-handled-backends
-The variable @code{vc-handled-backends} determines which version control
-systems VC should handle.  The default value is @code{(RCS CVS SVN SCCS
-GIT HG Arch MCVS)}, so it contains all six version systems that are
-currently supported.  If you want VC to ignore one or more of these
-systems, exclude its name from the list.  To disable VC entirely, set
-this variable to @code{nil}.
+The variable @code{vc-handled-backends} determines which version
+control systems VC should handle.  The default value is @code{(RCS CVS
+SVN SCCS BZR GIT HG Arch MCVS)}, so it contains all the version systems
+that are currently supported.  If you want VC to ignore one or more of
+these systems, exclude its name from the list.  To disable VC entirely,
+set this variable to @code{nil}.
 
 The order of systems in the list is significant: when you visit a file
 registered in more than one system (@pxref{Local Version Control}), VC
dissimilarity index 81%
index 9e4b309..be98de6 100755 (executable)
-#! /bin/sh
-# mkinstalldirs --- make directory hierarchy
-# Author: Noah Friedman <friedman@prep.ai.mit.edu>
-# Created: 1993-05-16
-# Public domain
-
-errstatus=0
-
-for file
-do
-   set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
-   shift
-
-   pathcomp=
-   for d
-   do
-     pathcomp="$pathcomp$d"
-     case "$pathcomp" in
-       -* ) pathcomp=./$pathcomp ;;
-     esac
-
-     if test ! -d "$pathcomp"; then
-        echo "mkdir $pathcomp" 1>&2
-
-        (mkdir "$pathcomp" && chmod a+rx "$pathcomp") || lasterr=$?
-
-        if test ! -d "$pathcomp"; then
-         errstatus=$lasterr
-        fi
-     fi
-
-     pathcomp="$pathcomp/"
-   done
-done
-
-exit $errstatus
-
-# mkinstalldirs ends here
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+
+scriptversion=2006-05-11.19
+
+# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain.
+#
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+nl='
+'
+IFS=" ""       $nl"
+errstatus=0
+dirmode=
+
+usage="\
+Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
+
+Create each directory DIR (with mode MODE, if specified), including all
+leading file name components.
+
+Report bugs to <bug-automake@gnu.org>."
+
+# process command line arguments
+while test $# -gt 0 ; do
+  case $1 in
+    -h | --help | --h*)         # -h for help
+      echo "$usage"
+      exit $?
+      ;;
+    -m)                         # -m PERM arg
+      shift
+      test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
+      dirmode=$1
+      shift
+      ;;
+    --version)
+      echo "$0 $scriptversion"
+      exit $?
+      ;;
+    --)                         # stop option processing
+      shift
+      break
+      ;;
+    -*)                         # unknown option
+      echo "$usage" 1>&2
+      exit 1
+      ;;
+    *)                          # first non-opt arg
+      break
+      ;;
+  esac
+done
+
+for file
+do
+  if test -d "$file"; then
+    shift
+  else
+    break
+  fi
+done
+
+case $# in
+  0) exit 0 ;;
+esac
+
+# Solaris 8's mkdir -p isn't thread-safe.  If you mkdir -p a/b and
+# mkdir -p a/c at the same time, both will detect that a is missing,
+# one will create a, then the other will try to create a and die with
+# a "File exists" error.  This is a problem when calling mkinstalldirs
+# from a parallel make.  We use --version in the probe to restrict
+# ourselves to GNU mkdir, which is thread-safe.
+case $dirmode in
+  '')
+    if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+      echo "mkdir -p -- $*"
+      exec mkdir -p -- "$@"
+    else
+      # On NextStep and OpenStep, the `mkdir' command does not
+      # recognize any option.  It will interpret all options as
+      # directories to create, and then abort because `.' already
+      # exists.
+      test -d ./-p && rmdir ./-p
+      test -d ./--version && rmdir ./--version
+    fi
+    ;;
+  *)
+    if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
+       test ! -d ./--version; then
+      echo "mkdir -m $dirmode -p -- $*"
+      exec mkdir -m "$dirmode" -p -- "$@"
+    else
+      # Clean up after NextStep and OpenStep mkdir.
+      for d in ./-m ./-p ./--version "./$dirmode";
+      do
+        test -d $d && rmdir $d
+      done
+    fi
+    ;;
+esac
+
+for file
+do
+  case $file in
+    /*) pathcomp=/ ;;
+    *)  pathcomp= ;;
+  esac
+  oIFS=$IFS
+  IFS=/
+  set fnord $file
+  shift
+  IFS=$oIFS
+
+  for d
+  do
+    test "x$d" = x && continue
+
+    pathcomp=$pathcomp$d
+    case $pathcomp in
+      -*) pathcomp=./$pathcomp ;;
+    esac
+
+    if test ! -d "$pathcomp"; then
+      echo "mkdir $pathcomp"
+
+      mkdir "$pathcomp" || lasterr=$?
+
+      if test ! -d "$pathcomp"; then
+       errstatus=$lasterr
+      else
+       if test ! -z "$dirmode"; then
+         echo "chmod $dirmode $pathcomp"
+         lasterr=
+         chmod "$dirmode" "$pathcomp" || lasterr=$?
+
+         if test ! -z "$lasterr"; then
+           errstatus=$lasterr
+         fi
+       fi
+      fi
+    fi
+
+    pathcomp=$pathcomp/
+  done
+done
+
+exit $errstatus
index ea0cda9..deea04b 100644 (file)
@@ -4,12 +4,22 @@
 
        * COPYING: Switch to GPLv3.
 
-2007-07-20  Eli Zaretskii  <eliz@gnu.org>
+2007-07-16  Eli Zaretskii  <eliz@gnu.org>
 
        * makefile.w32-in (bootstrap, bootstrap-nmake, bootstrap-gmake):
        Depend on cmdproxy.
        (cleanall): Don't delete *~.
 
+2007-07-15  Jason Rumney  <jasonr@gnu.org>
+
+       * inc/sys/socket.h (uint16_t): Define if C99 does not appear to
+       be fully supported.
+
+2007-07-14  Jason Rumney  <jasonr@gnu.org>
+
+       * inc/sys/socket.h: Include winsock2.h and ws2tcpip.h instead
+       of winsock.h.
+
 2007-07-11  Jason Rumney  <jasonr@gnu.org>
 
        * gmake.defs (OLE32): New library to link.
 
        * cmdproxy.c (main): Set console codepages to "ANSI".
 
+2007-06-20  Jason Rumney  <jasonr@gnu.org>
+
+       * configure.bat: Complain if image libraries are missing.
+
 2007-06-15  Jason Rumney  <jasonr@gnu.org>
 
        * emacs.manifest: New file.
        * INSTALL: Fix URL of EmacsW32 site where building with image
        support is described.
 
+2007-04-26  Glenn Morris  <rgm@gnu.org>
+
+       * emacs.rc: Increase version to 22.1.50.
+
 2007-03-31  Eli Zaretskii  <eliz@gnu.org>
 
        * INSTALL: Mention the VCVARS32.BAT batch file for VS.NET users.
index 5ff0848..373318d 100755 (executable)
@@ -118,11 +118,11 @@ echo.   --no-opt                disable optimization
 echo.   --no-cygwin             use -mno-cygwin option with GCC\r
 echo.   --cflags FLAG           pass FLAG to compiler\r
 echo.   --ldflags FLAG          pass FLAG to compiler when linking\r
-echo.   --without-png           do not use libpng even if it is installed\r
-echo.   --without-jpeg          do not use jpeg-6b even if it is installed\r
-echo.   --without-gif           do not use libungif even if it is installed\r
-echo.   --without-tiff          do not use libtiff even if it is installed\r
-echo.   --without-xpm           do not use libXpm even if it is installed\r
+echo.   --without-png           do not use libpng\r
+echo.   --without-jpeg          do not use jpeg-6b\r
+echo.   --without-gif           do not use giflib or libungif\r
+echo.   --without-tiff          do not use libtiff\r
+echo.   --without-xpm           do not use libXpm\r
 goto end\r
 rem ----------------------------------------------------------------------\r
 :setprefix\r
@@ -533,6 +533,51 @@ copy subdirs.el ..\site-lisp\subdirs.el
 \r
 :dontUpdateSubdirs\r
 echo.\r
+\r
+rem check that we have all the libraries we need.\r
+set libsOK=1\r
+\r
+if not "(%HAVE_XPM%)" == "()" goto checkpng\r
+if (%xpmsupport%) == (N) goto checkpng\r
+ set libsOK=0\r
+ echo XPM support is missing. It is required for color icons in the toolbar.\r
+ echo   Install libXpm development files or use --without-xpm\r
+\r
+:checkpng\r
+if not "(%HAVE_PNG%)" == "()" goto checkjpeg\r
+if (%pngsupport%) == (N) goto checkjpeg\r
+ set libsOK=0\r
+ echo PNG support is missing.\r
+ echo   Install libpng development files or use --without-png\r
+\r
+:checkjpeg\r
+if not "(%HAVE_JPEG%)" == "()" goto checktiff\r
+if (%jpegsupport%) == (N) goto checktiff\r
+ set libsOK=0\r
+ echo JPEG support is missing.\r
+ echo   Install jpeg development files or use --without-jpeg\r
+\r
+:checktiff\r
+if not "(%HAVE_TIFF%)" == "()" goto checkgif\r
+if (%tiffsupport%) == (N) goto checkgif\r
+ set libsOK=0\r
+ echo TIFF support is missing.\r
+ echo   Install libtiff development files or use --without-tiff\r
+\r
+:checkgif\r
+if not "(%HAVE_GIF%)" == "()" goto donelibchecks\r
+if (%gifsupport%) == (N) goto donelibchecks\r
+ set libsOK=0\r
+ echo GIF support is missing.\r
+ echo   Install giflib or libungif development files or use --without-gif\r
+\r
+:donelibchecks\r
+if (%libsOK%) == (1) goto success\r
+echo.\r
+echo Important libraries are missing. Fix these issues before running make.\r
+goto end\r
+\r
+:success\r
 echo Emacs successfully configured.\r
 echo Emacs successfully configured. >>config.log\r
 echo Run `%MAKECMD%' to build, then run `%MAKECMD% install' to install.\r
index 5050720..f848231 100644 (file)
@@ -51,7 +51,13 @@ Boston, MA 02110-1301, USA.  */
 #define timeval ws_timeval
 #endif
 
-#include <winsock.h>
+#include <winsock2.h>
+#include <ws2tcpip.h>
+/* process.c uses uint16_t (from C99) for IPv6, but
+   apparently it is not defined in some versions of mingw and msvc.  */
+#ifndef UINT16_C
+typedef unsigned short uint16_t;
+#endif
 
 /* redefine select to reference our version */
 #ifdef MUST_REDEF_SELECT
index 3cfec56..e3c2129 100644 (file)
@@ -3,11 +3,26 @@
        * gtkutil.c (update_frame_tool_bar): Use -1 as index
        to gtk_toolbar_insert.
 
+2007-08-13  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * fileio.c (Finsert_file_contents): Yet Another Int/Lisp_Object Mixup.
+
+       * insdel.c (reset_var_on_error): New fun.
+       (signal_before_change, signal_after_change):
+       Use it to reset (after|before)-change-functions to nil in case of error.
+       Bind inhibit-modification-hooks to t.
+       Don't bind (after|before)-change-functions to nil while they run.
+
 2007-08-11  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
        * xterm.c (x_draw_image_glyph_string): Adjust stipple origin when
        filling pixmap with stippled background.
 
+2007-08-10  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * macterm.c [TARGET_API_MAC_CARBON] (mac_handle_window_event):
+       Don't use invisible frame as parent window for repositioning.
+
 2007-08-10  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * print.c (new_backquote_output): Rename from old_backquote_output.
 
        * gmalloc.c (posix_memalign): New function.
 
+       * macterm.c (frame_highlight, frame_unhighlight): Don't call
+       ActivateControl/DeactivateControl here.
+       [USE_MAC_TOOLBAR] (free_frame_tool_bar): Suppress animation when
+       frame-notice-user-settings is non-nil.
+       [USE_MAC_FONT_PANEL] (mac_handle_font_event): Also record parameter
+       for kEventParamFMFontStyle.
+       [TARGET_API_MAC_CARBON] (mac_handle_keyboard_event): Don't check
+       mac_pass_command_to_system and mac_pass_control_to_system here.
+       (XTread_socket): Call ActivateControl/DeactivateControl here.
+       (XTread_socket) [TARGET_API_MAC_CARBON]:
+       Check mac_pass_command_to_system and mac_pass_control_to_system here.
+       (mac_handle_window_event) [USE_MAC_TOOLBAR]: Add further workaround
+       for window repositioning.
+
 2007-08-08  Glenn Morris  <rgm@gnu.org>
 
        * Replace `iff' in doc-strings and comments.
 
 2007-08-07  Chong Yidong  <cyd@stupidchicken.com>
 
-       * dispextern.h (struct image): New members.
-
-       * image.c: Sync to trunk version.
-       (search_image_cache, uncache_image, image-refresh): New functions.
-       Check for fg and bg colors.
-       (lookup_image): Use search_image_cache.  Cache fg and bg colors.
-       (pbm_load): Another check for invalid image data.
-       (png_load): Ignore default background field.
-
        * xdisp.c (move_it_by_lines): Remove incorrect optimization.
 
-2007-08-07  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
-
-       * gmalloc.c (__malloc_initialize): Remove pthread_once.  Not needed.
+2007-08-07  Martin Rudalics  <rudalics@gmx.at>
 
-2007-08-07  Sam Steingold  <sds@gnu.org>
-
-       * gmalloc.c (__morecore): Fix the declaration to comply with the
-       definition.
+       * fileio.c (Finsert_file_contents): Run format-decode and
+       after_insert_file_functions on entire buffer when REPLACE is
+       non-nil and inhibit modification_hooks and point_motion_hooks.
+       For consistency, run after_insert_file_functions iff something
+       got inserted.  Move signal_after_change and update_compositions
+       after code running after_insert_file_functions.  Make sure that
+       undo_list doesn't record intermediate steps of the decoding
+       process.
 
 2007-08-07  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
        * xdisp.c (redisplay_window): When restoring original buffer
        position, make sure it is still valid.
 
-2007-08-06  Martin Rudalics  <rudalics@gmx.at>
+       * image.c (png_load): Ignore png-supplied background color.
 
-       * window.c (window_min_size_2): New function.
-       (window_min_size_1, size_window, Fdisplay_buffer)
-       (Fsplit_window, adjust_window_trailing_edge): Use it to avoid
-       windows without mode- or header-lines when window-min-height is
-       too small.
-       (size_window): Reset nodelete_p after testing it, following an
-       earlier note by Kim F. Storm.
-       (display_buffer): Do not set split_height_threshold to twice the
-       value of window_min_height to avoid changing the value of a
-       customizable variable.  Rather explicitly check whether the
-       height of the window that shall be splitted is at least as large
-       as split_height_threshold.
-       (Fwindow_full_width_p): New defun.
-       (syms_of_window): Defsubr it.
-
-       * window.h: Add EXFUN for Fwindow_full_width_p.
+2007-08-06  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
-2007-08-06  Andreas Schwab  <schwab@suse.de>
+       * mac.c [TARGET_API_MAC_CARBON] (cfdate_to_lisp): Obtain microsec value.
+       Use kCFAbsoluteTimeIntervalSince1970.
 
-       * window.c (Fdisplay_buffer): Use NILP.
-       (Fset_window_scroll_bars): Likewise.
+       * macmenu.c (quit_dialog_event_loop) [TARGET_API_MAC_CARBON]:
+       New variable.
+       [TARGET_API_MAC_CARBON] (mac_handle_dialog_event): Set it if dialog
+       event loop should be quit.
+       [TARGET_API_MAC_CARBON] (create_and_show_dialog) [!MAC_OSX]:
+       Quit dialog event loop if quit_dialog_event_loop is set.
+
+       * macselect.c [!TARGET_API_MAC_CARBON]: Include Scrap.h.
+       (Selection): New typedef.  Use instead of ScrapRef.
+       (mac_get_selection_from_symbol): Rename from get_scrap_from_symbol.
+       (mac_valid_selection_target_p): Rename from valid_scrap_target_type_p.
+       (mac_clear_selection): Rename from clear_scrap.
+       (get_flavor_type_from_symbol): New argument SEL and subsume function of
+       scrap_has_target_type.   All uses changed.
+       (mac_get_selection_ownership_info, mac_valid_selection_value_p)
+       (mac_selection_has_target_p): New functions.
+       (mac_put_selection_value): Rename from put_scrap_string.
+       (mac_get_selection_value): Rename from get_scrap_string.
+       (mac_get_selection_target_list): Rename from get_scrap_target_type_list.
+       (put_scrap_private_timestamp, scrap_has_target_type)
+       (get_scrap_private_timestamp): Remove functions.
+       (SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP): Remove define.
+       (x_own_selection, x_get_local_selection):
+       Use mac_valid_selection_value_p.
+       (x_own_selection): Don't use put_scrap_private_timestamp.
+       Record OWNERSHIP-INFO into Vselection_alist instead.
+       (x_get_local_selection): Don't check type if request is local.
+       (Fx_selection_owner_p): Don't use get_scrap_private_timestamp.
+       Detect ownership change with OWNERSHIP-INFO in Vselection_alist instead.
+
+2007-08-04  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * gtkutil.c (xg_tool_bar_callback): Generate two TOOL_BAR_EVENT:s,
+       add comment explaining why.
 
 2007-08-03  Richard Stallman  <rms@gnu.org>
 
        * mac.c (init_mac_osx_environment): Adjust load-path on self-contained
        build.
 
-2007-07-30  Stefan Monnier  <monnier@iro.umontreal.ca>
+2007-07-31  Stefan Monnier  <monnier@iro.umontreal.ca>
 
-       * eval.c (init_eval_once): Bump max_lisp_eval_depth to 400.
+       * gtkutil.c (xg_tool_bar_callback): Generate a single TOOL_BAR_EVENT.
+
+2007-07-30  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * puresize.h (BASE_PURESIZE): Increase to 1130000.
+
+2007-07-30  Richard Stallman  <rms@gnu.org>
+
+       * lread.c (readevalloop, read1): Treat NBSP as whitespace.
+
+2007-07-29  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * gmalloc.c (__malloc_initialize): Remove pthread_once.  Not needed.
+
+2007-07-28  Nick Roberts  <nickrob@snap.net.nz>
+
+       * xdisp.c (decode_mode_spec): Use '@' instead of 'R' to test for
+       remote default-directory.
+
+       * buffer.c (mode-line-format): Update doc string.
+
+2007-07-27  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * w32term.c (w32_draw_fringe_bitmap): Extend fringe background to
+       scroll bar gap.
+       (x_scroll_bar_create): Set bar->fringe_extended_p.
+       (w32_set_vertical_scroll_bar): Put leftmost/rightmost scroll bars
+       on frame edge.  Check fringe background extension.  Don't clear
+       extended fringe background area.
+
+       * w32term.h (struct scroll_bar): New member fringe_extended_p.
+       (w32_fill_area): Enclose multiple statements with do ... while (0).
+
+       * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
+       Extend fringe background to scroll bar gap.
+       (x_scroll_bar_create) [USE_TOOLKIT_SCROLL_BARS]:
+       Set bar->fringe_extended_p.
+       (XTset_vertical_scroll_bar) [USE_TOOLKIT_SCROLL_BARS]:
+       Put leftmost/rightmost scroll bars on frame edge.  Check fringe
+       background extension.  Don't clear extended fringe background area.
+
+       * xterm.h (struct scroll_bar) [USE_TOOLKIT_SCROLL_BARS]:
+       New member fringe_extended_p.
 
 2007-07-25  Glenn Morris  <rgm@gnu.org>
 
 
        * COPYING: Switch to GPLv3.
 
+2007-07-25  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * eval.c (Fcommandp): Pay attention to the `interactive-form' property.
+
+       * data.c (Finteractive_form): Check for the presence of an
+       `interactive-form' symbol property more thoroughly.
+
+       * data.c (Finteractive_form): Use an `interactive-form' property if
+       present, analogous to the function-documentation property.
+
 2007-07-24  Jason Rumney  <jasonr@gnu.org>
 
        * w32fns.c (x_real_positions): Get real position from OS instead of
 
        * filelock.c (current_lock_owner): Allow for @ sign in username.
 
-2007-07-20  Eli Zaretskii  <eliz@gnu.org>
+2007-07-22  Nick Roberts  <nickrob@snap.net.nz>
 
-       * makefile.w32-in (clean): Don't delete *~.
+       * xdisp.c (decode_mode_spec): Add case 'R' for to test for
+       remote default-directory.
+
+       * buffer.c (mode-line-format): Describe above case in doc string.
+
+2007-07-20  Eli Zaretskii  <eliz@gnu.org>
 
        * w32proc.c (IMAGE_NT_OPTIONAL_HDR32_MAGIC, IMAGE_OPTIONAL_HEADER32):
        Define if not defined.
 
        * w32proc.c (w32_executable_type): Handle 64 bit executables.
 
-2007-07-16  Juanma Barranquero  <lekktu@gmail.com>
+2007-07-18  Richard Stallman  <rms@gnu.org>
+
+       * data.c (Fsetq_default): Doc fix.
+
+       * eval.c (Fsetq): Doc fix.
+
+2007-07-18  Juanma Barranquero  <lekktu@gmail.com>
 
        * coding.c (Ffind_operation_coding_system):
-       * eval.c (For, Fand, Fprogn):
+       * eval.c (For, Fand): Doc fixes.
+       Reported by Johan Bockg\e,Ae\e(Brd.
+
+2007-07-18  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * xfns.c (Fx_focus_frame): Call x_ewmh_activate_frame.
+
+       * xterm.h: Declare x_ewmh_activate_frame.
+
+       * xterm.c (x_ewmh_activate_frame): New function.
+       (XTframe_raise_lower): Move code to x_ewmh_activate_frame.
+
+2007-07-17  Martin Rudalics  <rudalics@gmx.at>
+
+       * window.c (Fdisplay_buffer): If largest or LRU window is the
+       only window, split it even if it is not eligible for splitting.
+       This restores the original behavior broken by the 2007-07-15
+       change.
+
+2007-07-17  Glenn Morris  <rgm@gnu.org>
+
+       * abbrev.c (abbrev_check_chars): New function.
+       (Fdefine_global_abbrev, Fdefine_mode_abbrev): Call
+       abbrev_check_chars to check abbrev characters are word
+       constituents.  Doc fix.
+
+2007-07-17  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * process.c (Fstart_process, Fmake_network_process)
+       (read_process_output): Fix up last changes.
+
+2007-07-16  Eli Zaretskii  <eliz@gnu.org>
+
+       * makefile.w32-in (clean): Don't delete *~.
+
+2007-07-16  Andreas Schwab  <schwab@suse.de>
+
+       * window.c (Fdisplay_buffer): Use NILP.
+       (Fset_window_scroll_bars): Likewise.
+
+2007-07-15  Martin Rudalics  <rudalics@gmx.at>
+
+       * window.c (window_min_size_2): New function.
+       (window_min_size_1, size_window, Fdisplay_buffer)
+       (Fsplit_window, adjust_window_trailing_edge): Use it to avoid
+       windows without mode- or header-lines when window-min-height is
+       too small.
+       (size_window): Reset nodelete_p after testing it, following an
+       earlier note by Kim F. Storm.
+       (display_buffer): Do not set split_height_threshold to twice the
+       value of window_min_height to avoid changing the value of a
+       customizable variable.  Rather explicitly check whether the
+       height of the window that shall be splitted is at least as large
+       as split_height_threshold.
+
+2007-07-14  Jason Rumney  <jasonr@gnu.org>
+
+       * process.c [WINDOWSNT]: Don't undefine AF_INET6.
+
+2007-07-14  Richard Stallman  <rms@gnu.org>
+
+       * eval.c (maybe_call_debugger): New function.
+       (find_handler_clause): Use maybe_call_debugger.
+       Call it when the handler says `debug'.
+       Eliminate DEBUGGER_VALUE_PTR.
+       (Fsignal): Eliminate debugger_value.
+       (Qdebug): New variable.
+       (syms_of_eval): Initialize it.
+
+2007-07-14  Juanma Barranquero  <lekktu@gmail.com>
+
+       * eval.c (Fprogn):
        * keyboard.c (Ftrack_mouse):
        * print.c (Fwith_output_to_temp_buffer):
-       * window.c (Fsave_window_excursion): Doc fixes (some reported
-       by Johan Bockg\e,Ae\e(Brd).
+       * window.c (Fsave_window_excursion): Doc fix.
 
-2007-07-15  Richard Stallman  <rms@gnu.org>
+2007-07-13  Stefan Monnier  <monnier@iro.umontreal.ca>
 
-       * data.c (Fsetq_default): Doc fix.
+       * eval.c (init_eval_once): Bump max_lisp_eval_depth to 400.
 
-       * eval.c (Fsetq): Doc fix.
+2007-07-12  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * process.h (struct Lisp_Process): Turn slots infd, outfd,
+       kill_without_query, pty_flag, tick, update_tick, decoding_carryover,
+       inherit_coding_system_flag, filter_multibyte, adaptive_read_buffering,
+       read_output_delay, and read_output_skip from Lisp_Objects to ints.
+       Remove unused encoding_carryover.
+       * process.c: Adjust all functions accordingly.
+
+2007-07-12  Richard Stallman  <rms@gnu.org>
+
+       * term.c: Include unistd.h only if HAVE_UNISTD_H.
 
 2007-07-11  Jason Rumney  <jasonr@gnu.org>
 
        * w32fns.c (w32_msg_pump) <WM_EMACS_CREATEWINDOW>: Initialize COM.
        (w32_msg_pump) <WM_DESTROY>: Uninitialize COM.
 
+2007-07-11  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * lisp.h (struct Lisp_Hash_Table): Turn next_weak into a bare pointer.
+       * fns.c (weak_hash_tables): Rename from Vweak_hash_tables and turned
+       from a Lisp_Object into a bare pointer.
+       (make_hash_table, copy_hash_table, sweep_weak_hash_tables, init_fns):
+       Adjust the code correspondingly.
+
+       * alloc.c (emacs_blocked_free): Remove unused var `bytes_used_now'.
+
+       * term.c: Include unistd.h for ttyname, used in handle_one_term_event.
+       (term_show_mouse_face): Remove unused var `j'.
+       (handle_one_term_event): Remove unused vars `i' and `j'.
+       Don't cast return value of ttyname since it's not necessary.
+
+2007-07-10  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * alloc.c (mark_maybe_pointer): Enforce mult-of-8 alignment when using
+       USE_LSB_TAG.  Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
+
+       * fns.c (map_char_table): Use an array of int for `indices' rather than
+       an array of Lisp_Objects (which are only ever integers anyway).
+       (Fmap_char_table): Update caller.
+       * lisp.h: Update prototype.
+       * keymap.c (Fset_keymap_parent, map_keymap, Fcopy_keymap):
+       * fontset.c (Ffontset_info):
+       * casetab.c (set_case_table): Update callers.
+
+       * editfns.c (Ftranspose_regions): Use EMACS_INT for positions.
+
+       * keymap.c (struct accessible_keymaps_data)
+       (struct where_is_internal_data): New structures.
+       (accessible_keymaps_1, where_is_internal_1): Use them to change
+       interface to adhere to the one used by map_keymap.
+       (Faccessible_keymaps, where_is_internal): Use map_keymap.
+       (accessible_keymaps_char_table, where_is_internal_2): Remove.
+
+       * keymap.h (map_keymap_function_t): More informative prototype.
+
+2007-07-10  Guanpeng Xu  <herberteuler@hotmail.com>
+
+       * search.c (Vinhibit_changing_match_data, search_regs_1): New vars.
+       (looking_at_1): Don't change search_regs and last_thing_searched
+       if `inhibit-changing-match-data' is non-nil.
+       (string_match_1, search_buffer, set_search_regs): Likewise.
+       (syms_of_search): Add Lisp level definition for
+       `inhibit-changing-match-data' and set it to nil.
+       (boyer_moore): If `inhibit-changing-match-data' is non-nil, compute
+       start and end of the match, instead of using values in search_regs.
+
+2007-07-01  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * minibuf.c (Fcompleting_read): New value `confirm-only'
+       for `require-match'.
+
+2007-06-28  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * fileio.c (Fdo_auto_save): Revert last patch installed unwillingly as
+       part of the 2007-06-27 change to syms_of_fileio.
+
 2007-06-28  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
        * macterm.c [USE_MAC_TSM] (mac_handle_text_input_event):
-       Check WINDOWP before using XWINDOW.
+       Check WINDOWP before using XWINDOW.  Consolidate return statements.
+
+2007-06-27  Richard Stallman  <rms@gnu.org>
+
+       * fileio.c (syms_of_fileio) <after-insert-file-functions>: Doc fix.
 
 2007-06-27  Juanma Barranquero  <lekktu@gmail.com>
 
        Copy hook value to automatic variable before its use.
        (memalign): Copy hook value to automatic variable before its use.
 
+2007-06-26  Kenichi Handa  <handa@m17n.org>
+
+       * coding.c (Ffind_operation_coding_system): Docstring improved.
+       (syms_of_coding): Docstring of `file-coding-system-alist' improved.
+
+2007-06-25  David Kastrup  <dak@gnu.org>
+
+       * keymap.c (Fcurrent_active_maps): Add `position' argument.
+       (Fwhere_is_internal): Adjust call to `current-active-maps' to
+       cater for additional parameter.
+
+       * keymap.h: Adjust number of parameters to `current-active-maps'.
+
+       * doc.c (Fsubstitute_command_keys): Adjust call of
+       `current-active-maps'.
+
+2007-06-25  David Kastrup  <dak@gnu.org>
+
+       * callint.c (Fcall_interactively): Make the parsing of interactive
+       specs somewhat more readable.
+
+2007-06-23  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * macterm.c (x_draw_fringe_bitmap) [MAC_OSX]: Extend fringe background
+       to scroll bar gap also when bitmap fills fringe.  Draw only foreground
+       if extended background has already been filled.
+
+2007-06-22  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * macgui.h (USE_CG_DRAWING): Don't require USE_ATSUI.
+       (USE_MAC_TOOLBAR): Require USE_CG_DRAWING.
+
+       * macmenu.c (mac_dialog_modal_filter, Fx_popup_dialog) [MAC_OSX]:
+       Put special treatment for Fmessage_box, Fyes_or_no_p, and Fy_or_n_p
+       in #if 0 as it is not compatible with y-or-n-p-with-timeout.
+       (timer_check) [TARGET_API_MAC_CARBON]: Add extern.
+       [TARGET_API_MAC_CARBON] (mac_handle_dialog_event): Use QuitEventLoop
+       instead of QuitAppModalLoopForWindow.  Consolidate QuitEventLoop calls.
+       (pop_down_dialog) [TARGET_API_MAC_CARBON]: New function.
+       [TARGET_API_MAC_CARBON] (create_and_show_dialog): Use it for unwind.
+       Run timers during dialog popup.
+       (Fmenu_or_popup_active_p) [TARGET_API_MAC_CARBON]: Use popup_activated.
+
 2007-06-21  Jason Rumney  <jasonr@gnu.org>
 
        * image.c (convert_mono_to_color_image): Swap fore and background.
        * w32bdf.c (w32_BDF_to_x_font): Unmap memory when finished.
        (w32_free_bdf_font): Unmap memory not handle.
 
+2007-06-20  Sam Steingold  <sds@gnu.org>
+
+       * gmalloc.c (__morecore): Fix the declaration to comply with the
+       definition.
+
 2007-06-20  Juanma Barranquero  <lekktu@gmail.com>
 
+       * w32term.c (w32_delete_display): Remove leftover declaration.
+       (w32_define_cursor, w32_initialize): Make static.
+
        * w32.c (_wsa_errlist): Fix typo in error message.
        (init_environment): Ignore any environment variable from the
        registry having a null value.
 
+2007-06-20  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (LIBGIF): Default to -lgif.
+
 2007-06-17  Jason Rumney  <jasonr@gnu.org>
 
        * w32menu.c (add_menu_item): Don't use multibyte string functions on
        unicode strings.
 
-2007-06-17  Juanma Barranquero  <lekktu@gmail.com>
+2007-06-16  Juanma Barranquero  <lekktu@gmail.com>
 
        * xdisp.c (syms_of_xdisp) <auto-resize-tool-bars>:
        Fix typo in docstring.
        * w32menu.c (add_menu_item): Escape `&' characters in menu items
        and their keybindings.
 
+2007-06-15  Chong Yidong  <cyd@stupidchicken.com>
+
+       * composite.c (update_compositions): Fix last fix.
+
+2007-06-14  Jason Rumney  <jasonr@gnu.org>
+
+       * w32.c (get_process_times_fn): New function pointer.
+       (globals_of_w32): Intialize it if present in kernel32.dll.
+       (w32_get_internal_run_time): New function.
+
+       * editfns.c (Fget_internal_run_time) [WINDOWSNT]: Use it.
+
+2007-06-14  Kenichi Handa  <handa@etlken.m17n.org>
+
+       * composite.c (update_compositions): Check the validness of
+       compositions.
+
+2007-06-14  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * frame.h (struct frame) [MAC_OS]: New member external_tool_bar.
+       (FRAME_EXTERNAL_TOOL_BAR) [MAC_OS]: Use it.
+
+       * macfns.c (mac_window) [USE_MAC_TOOLBAR]: Set toolbar_win_gravity.
+       (x_set_tool_bar_lines) [USE_MAC_TOOLBAR]: Set FRAME_EXTERNAL_TOOL_BAR.
+
+       * macgui.h (USE_MAC_TOOLBAR): New define.
+
+       * macmenu.c [TARGET_API_MAC_CARBON] (menu_target_item_handler):
+       Return immediately unless popup is activated.
+
+       * macterm.c (x_draw_fringe_bitmap) [MAC_OSX]: Extend fringe
+       background to scroll bar gap.
+       (x_scroll_bar_create) [MAC_OSX]: Set bar->fringe_extended_p.
+       (XTset_vertical_scroll_bar) [MAC_OSX]: Put leftmost/rightmost
+       scroll bars on frame edge.  Check fringe background extension.
+       Don't clear extended fringe background area.
+       (TOOLBAR_IDENTIFIER, TOOLBAR_ICON_ITEM_IDENTIFIER)
+       (TOOLBAR_ITEM_COMMAND_ID_OFFSET, TOOLBAR_ITEM_COMMAND_ID_P)
+       (TOOLBAR_ITEM_COMMAND_ID_VALUE, TOOLBAR_ITEM_MAKE_COMMAND_ID):
+       [USE_MAC_TOOLBAR]: New macros.
+       (mac_move_window_with_gravity, mac_get_window_origin_with_gravity)
+       (mac_handle_toolbar_event, mac_image_spec_to_cg_image)
+       (mac_create_frame_tool_bar, update_frame_tool_bar, free_frame_tool_bar)
+       (mac_tool_bar_note_mouse_movement, mac_handle_toolbar_command_event)
+       [USE_MAC_TOOLBAR]: New functions.
+       (mac_handle_window_event) [USE_MAC_TOOLBAR]: Reposition window
+       manually if previous repositioning has failed.
+       (mac_handle_keyboard_event): Use precomputed event kind.
+       (XTread_socket) [USE_MAC_TOOLBAR]: Handle click in structure region
+       as tool bar item click.  Handle mouse movement over tool bar items.
+
+       * macterm.h (struct mac_output) [USE_MAC_TOOLBAR]: New member
+       toolbar_win_gravity.
+       (struct scroll_bar) [MAC_OSX]: New member fringe_extended_p.
+       (update_frame_tool_bar, free_frame_tool_bar) [USE_MAC_TOOLBAR]:
+       Add externs.
+
+       * xdisp.c (update_tool_bar, redisplay_tool_bar, redisplay_window)
+       [USE_MAC_TOOLBAR]: Sync with GTK+ tool bar display.
+
 2007-06-14  Chong Yidong  <cyd@stupidchicken.com>
 
-       * composite.c (update_compositions): Check validity of compositions.
+       * image.c (search_image_cache): Remove unused variable.
+
+2007-06-13  Chong Yidong  <cyd@stupidchicken.com>
+
+       * xfns.c, xmenu.c: Link to xaw3d if available.
+
+2007-06-13  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * dispextern.h (struct image) [HAVE_WINDOW_SYSTEM]: New members
+       frame_foreground and frame_background.
+
+       * image.c (lookup_image): Save frame foreground and background colors.
+       (search_image_cache): Check if saved and current frame colors match.
+
+2007-06-12  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * regex.c (regex_compile): Remove the `regnum' counter.
+       Use bufp->re_nsub instead.  Add support for \(?N:RE\).
+
+2007-06-11  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * term.c: Include intervals.h to declare Fget_text_property.
 
 2007-06-10  Jason Rumney  <jasonr@gnu.org>
 
        * w32fns.c (Fx_file_dialog): Take size from struct not pointer.
 
-2007-06-06  Jason Rumney  <jasonr@gnu.org>
+2007-06-08  Juanma Barranquero  <lekktu@gmail.com>
+
+       * callint.c (Fcall_interactively):
+       * editfns.c (Fdelete_and_extract_region):
+       * fileio.c (Fread_file_name):
+       * fns.c (Fmapconcat):
+       * keyboard.c (cmd_error_internal):
+       * keymap.c (Fkey_description):
+       * lread.c (openp):
+       * minibuf.c (read_minibuf):
+       * search.c (wordify):
+       * sunfns.c (sel_read):
+       * xdisp.c (Fformat_mode_line, syms_of_xdisp):
+       * xfns.c (x_default_scroll_bar_color_parameter):
+       * xmenu.c (menu_help_callback):
+       * xselect.c (Fx_get_atom_name):
+       * xterm.c (x_term_init): Use empty_unibyte_string.
+
+2007-06-08  Dmitry Antipov  <dmantipov@yandex.ru>  (tiny change)
+
+       * alloc.c (init_strings): Initialize canonical empty strings.
+       (make_uninit_string, make_uninit_multibyte_string): Return appropriate
+       canonical empty string when the requested size is 0.
+
+       * emacs.c (empty_unibyte_string): Rename from empty_string.
+       (empty_multibyte_string): New canonical empty string.
+       (syms_of_emacs): Don't initialize empty_string.
+
+       * lisp.h (STRING_SET_UNIBYTE): Return the canonical empty unibyte
+       string, if appropriate.
+       (empty_unibyte_string, empty_multibyte_string): New externs.
+       (empty_string): Remove extern.
+
+       * lread.c (syms_of_lread): Use empty_unibyte_string.
+
+2007-06-07  Jason Rumney  <jasonr@gnu.org>
 
        * s/ms-w32.h: Don't define HAVE_TZNAME.
 
+       * editfns.c (Fcurrent_time_zone): Remove hack for Japanese Windows.
+
+2007-06-07  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * mac.c (xrm_get_preference_database): Remove BLOCK_INPUT.
+
+       * macfns.c (mac_get_window_bounds): Move extern to macterm.h.
+       (compute_tip_xy) [TARGET_API_MAC_CARBON]: Use GetGlobalMouse.
+
+       * macmenu.c [TARGET_API_MAC_CARBON] (menu_target_item_handler):
+       Don't call next handler.
+       [TARGET_API_MAC_CARBON] (install_menu_target_item_handler):
+       Remove argument.  Install handler to application.
+       (set_frame_menubar): Don't change deep_p.
+       (mac_menu_show): Use FRAME_OUTER_TO_INNER_DIFF_X and
+       FRAME_OUTER_TO_INNER_DIFF_Y.
+       (DIALOG_BUTTON_COMMAND_ID_OFFSET, DIALOG_BUTTON_COMMAND_ID_P)
+       (DIALOG_BUTTON_COMMAND_ID_VALUE, DIALOG_BUTTON_MAKE_COMMAND_ID)
+       [HAVE_DIALOGS]: New macros.
+       [HAVE_DIALOGS] (mac_handle_dialog_event, create_and_show_dialog):
+       Use them.
+       (fill_menubar) [TARGET_API_MAC_CARBON]: Use CFString.
+
+       * macselect.c [MAC_OSX] (install_service_handler): Rename from
+       init_service_handler.  All callers changed.  Return OSStatus value.
+
+       * macterm.c (mac_begin_cg_clip): New arg F.  Call SetPortWindowPort.
+       All callers changed so as not to call SetPortWindowPort.
+       (mac_begin_cg_clip) [USE_CG_DRAWING]: Call mac_prepare_for_quickdraw.
+       (mac_draw_image_string_atsui) [USE_ATSUI]: New function created from
+       mac_draw_string_common.
+       (mac_draw_image_string_qd): Likewise.
+       (mac_draw_string_common): Use them.  Add INLINE.
+       (XTmouse_position, x_scroll_bar_report_motion) [TARGET_API_MAC_CARBON]:
+       Use FRAME_OUTER_TO_INNER_DIFF_X, FRAME_OUTER_TO_INNER_DIFF_Y, and
+       GetGlobalMouse.
+       (x_set_mouse_pixel_position) [MAC_OSX]: Use FRAME_OUTER_TO_INNER_DIFF_X
+       and FRAME_OUTER_TO_INNER_DIFF_Y.
+       [TARGET_API_MAC_CARBON] (mac_handle_mouse_event): Likewise.
+       [USE_MAC_TSM] (mac_handle_text_input_event): Likewise.
+       (x_make_frame_visible) [TARGET_API_MAC_CARBON]: Move code for
+       repositioning window to mac_handle_window_event.
+       (x_make_frame_invisible) [TARGET_API_MAC_CARBON]: Move code for
+       saving window location to mac_handle_window_event
+       [USE_MAC_FONT_PANEL] (mac_show_hide_font_panel): Install handler here.
+       (install_menu_target_item_handler): Remove argument in extern.
+       [TARGET_API_MAC_CARBON] (mac_event_to_emacs_modifiers):
+       Also accept command events.
+       (do_keystroke): New function created from XTread_socket.
+       (init_command_handler): Remove functions.
+       [TARGET_API_MAC_CARBON] (mac_handle_window_event): Reposition window
+       and save window location by kEventWindowShowing and kEventWindowHiding
+       handlers here.  Don't call next handler for window state change and
+       focus events.
+       (mac_handle_application_event, mac_handle_keyboard_event)
+       [TARGET_API_MAC_CARBON]: New functions.
+       (install_window_handler) [TARGET_API_MAC_CARBON]: Register handlers for
+       kEventWindowShowing and kEventWindowHiding events.  Move installation
+       of mouse, font, text input and menu target item handlers to
+       install_application_handler.
+       (install_application_handler) [TARGET_API_MAC_CARBON]: New function.
+       (mac_handle_cg_display_reconfig) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]:
+       New function.
+       (init_dm_notification_handler) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]:
+       Register it.
+       (XTread_socket) [TARGET_API_MAC_CARBON]:
+       Consolidate SendEventToEventTarget calls.
+       Use FRAME_OUTER_TO_INNER_DIFF_X and FRAME_OUTER_TO_INNER_DIFF_Y.
+       Move application activation handler to mac_handle_application_event.
+       Move keyboard handler to mac_handle_keyboard_event.
+       (XTread_socket) [!TARGET_API_MAC_CARBON]: Use do_keystroke.
+       (mac_initialize) [TARGET_API_MAC_CARBON]: Don't call
+       init_command_handler.  Call install_application_handler.
+
+       * macterm.h (mac_get_window_bounds): Move extern from macfns.c.
+       (FRAME_OUTER_TO_INNER_DIFF_X, FRAME_OUTER_TO_INNER_DIFF_Y): New macros.
+
+2007-06-07  Glenn Morris  <rgm@gnu.org>
+
+       * emacs.c (main): Use `emacs-copyright' in --version output.
+
 2007-06-06  Chong Yidong  <cyd@stupidchicken.com>
 
-       * image.c (xpm_load): Remove spurious call to
-       xpm_init_color_cache.
+       * image.c (xpm_load): Remove spurious call to xpm_init_color_cache.
 
-2007-06-06  Martin Rudalics  <rudalics@gmx.at>
+2007-06-06  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
-       * syntax.c (scan_words): Fix arg to UPDATE_SYNTAX_TABLE_BACKWARD.
+       * macfns.c (mac_window): Replace WindowPtr with WindowRef.
 
-2007-06-05  Dan Nicolaescu  <dann@ics.uci.edu>
+       * macgui.h: Replace WindowPtr with WindowRef.
 
-       * xfaces.c (syms_of_xfaces): Delete stray semicolon.
-       * xdisp.c (next_element_from_buffer):
-       * window.c (delete_window):
-       * term.c (term_mouse_highlight):
-       * msdos.c (getdefdir):
-       * macterm.c (mac_create_bitmap_from_bitmap_data)
-       (init_font_name_table):
-       * fns.c (Fsxhash):
-       * data.c (Fmake_local_variable):
-       * ccl.c (ccl_driver): Likewise.
+       * macmenu.c: Replace MenuHandle and GetMenuHandle with MenuRef and
+       GetMenuRef, respectively.  Replace WindowPtr with WindowRef.
+       Replace ControlHandle with ControlRef.
+       (install_menu_quit_handler): Rename arg MENU_HANDLE to ROOT_MENU.
+
+       * macterm.c: Replace MenuHandle and GetMenuHandle with MenuRef and
+       GetMenuRef, respectively.  Replace WindowPtr with WindowRef.
+       Replace ControlHandle with ControlRef.
+       (USE_CARBON_EVENTS): Remove.  Use TARGET_API_MAC_CARBON instead.
+       [MAC_OS8] (do_get_menus): Rename variable `menu_handle' to `menu'.
 
-2007-06-04  Juanma Barranquero  <lekktu@gmail.com>
+       * macterm.h (struct scroll_bar): Rename member control_handle_low
+       and control_handle_high to control_ref_low and control_ref_high.
+       All uses changed.
+       (SCROLL_BAR_CONTROL_REF, SET_SCROLL_BAR_CONTROL_REF): Rename from
+       SCROLL_BAR_CONTROL_HANDLE and SET_SCROLL_BAR_CONTROL_HANDLE,
+       respectively.  All uses changed.
+       (XCreatePixmap, XCreatePixmapFromBitmapData, XSetWindowBackground)
+       (install_window_handler, remove_window_handler): Replace WindowPtr
+       with WindowRef in externs.
+
+2007-06-05  Juanma Barranquero  <lekktu@gmail.com>
+
+       * xfaces.c (Finternal_lisp_face_p): Signal error for face alias loops.
+
+2007-06-03  Nick Roberts  <nickrob@snap.net.nz>
+
+       * keyboard.c (discard_mouse_events): Add GPM_CLICK_EVENT case.
+
+       * frame.c (Fmouse_position, Fmouse_pixel_position):
+       Condition on HAVE_GPM too.
+
+       * term.c (term_mouse_highlight): Remove unused variables.
+       (Fterm_open_connection): Set gpm_zerobased to 1.
+       (term_mouse_movement, term_mouse_click, handle_one_term_event):
+       Use zero based co-ordinates.
+       (handle_one_term_event): Report a drag as mouse movement too.
+
+       * Makefile.in (MOUSE_SUPPORT): Define for HAVE_GPM.
+
+2007-06-03  Chong Yidong  <cyd@stupidchicken.com>
+
+       * image.c (search_image_cache): New function.  Require background
+       color match if background color is unspecified in the image spec.
+       (uncache_image, lookup_image): Use it.
+
+2007-06-01  Juanma Barranquero  <lekktu@gmail.com>
 
        * window.c (Fshrink_window): Reflow docstring.
 
 
        * Version 22.1 released.
 
-       * xfns.c (x_set_name_internal): Undo last change.
-
 2007-06-01  Richard Stallman  <rms@gnu.org>
 
        * xfns.c (x_encode_text): Add GCPRO.
-       (x_set_name_internal): Separate USE_GTK and non-USE_GTK cases.
 
 2007-06-01  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
 
        * buffer.c (syms_of_buffer): Doc fix.
 
+2007-05-30  Nick Roberts  <nickrob@snap.net.nz>
+
+       * sysdep.c (init_sys_modes): Add rather than replace with
+       O_NONBLOCK.
+
+       * frame.c [HAVE_GPM] (Fset_mouse_pixel_position): Add call to
+       term_mouse_moveto.
+
+       * termhooks.h (term_mouse_moveto): New extern.
+
+       * term.c (mouse_face_window): Rename...
+       (Qmouse_face_window): ...to this.
+       (term_show_mouse_face, term_clear_mouse_face)
+       (term_mouse_highlight): Use Qmouse_face_window.
+       (term_mouse_moveto): New function.
+       (term_mouse_position): Make it work.
+       (syms_of_term): Uncomment assignment to mouse_position_hook.
+       Staticpro Qmouse_face_window.
+
 2007-05-28  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
        * xdisp.c (redisplay_internal): Bind inhibit-point-motion-hooks to t
        around current_column call.
 
-2007-05-24  Chong Yidong  <cyd@stupidchicken.com>
+2007-05-26  Dan Nicolaescu  <dann@ics.uci.edu>
 
-       * xdisp.c (redisplay_window): If first window line is a
-       continuation line, recompute the new window start instead of
-       recentering.
+       * xfaces.c (syms_of_xfaces): Delete stray semicolon.
+       * xdisp.c (next_element_from_buffer):
+       * window.c (delete_window):
+       * term.c (term_mouse_highlight):
+       * msdos.c (getdefdir):
+       * macterm.c (mac_create_bitmap_from_bitmap_data)
+       (init_font_name_table):
+       * fns.c (Fsxhash):
+       * data.c (Fmake_local_variable):
+       * ccl.c (ccl_driver): Likewise.
 
 2007-05-24  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
        * macterm.c [USE_CARBON_EVENTS] (mac_handle_window_event):
        Call mac_wakeup_from_rne on window size change.
 
+2007-05-25  Chong Yidong  <cyd@stupidchicken.com>
+
+       * image.c (uncache_image): Fix typo.
+
+2007-05-23  Johannes Weiner  <hannes@saeurebad.de>  (tiny change)
+
+       * keyboard.c (make_lispy_movement): Condition on HAVE_GPM too.
+
 2007-05-22  Richard Stallman  <rms@gnu.org>
 
        * xterm.c (x_connection_closed): Remove NO_RETURN.
 
+2007-05-22  Martin Rudalics  <rudalics@gmx.at>
+
+       * syntax.c (scan_words): Fix arg to UPDATE_SYNTAX_TABLE_BACKWARD.
+
+2007-05-21  Chong Yidong  <cyd@stupidchicken.com>
+
+       * image.c (uncache_image): New function.
+       (Fimage_refresh): New function.
+
+2007-05-20  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * Makefile.in: Move GPM check outside HAVE_X_WINDOWS.
+
+2007-05-20  Nick Roberts  <nickrob@snap.net.nz>
+
+       * config.in, keyboard.c, Makefile.in, sysdep.c, term.c,
+       * termhooks.h: Use HAVE_GPM instead of HAVE_GPM_H.
+
+2007-05-20  Nick Roberts  <nickrob@snap.net.nz>
+
+       * keyboard.c (make_lispy_event): Make case GPM_CLICK_EVENT
+       conditional on [HAVE_GPM_H].
+
 2007-05-19  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * syntax.c (skip_chars): Update syntax-table only after we checked that
        * macterm.c (x_calc_absolute_position): Add BLOCK_INPUT around
        mac_get_window_bounds.
 
+2007-05-20  Nick Roberts  <nickrob@snap.net.nz>
+
+       * Makefile.in (LIBGPM): Allow it to be set from configure.
+       If set then link Emacs with it.
+
+       * config.in: Regenerate.
+
+       * lisp.h (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
+       New externs.
+
+       * termhooks.h [HAVE_GPM_H] (enum event_kind): Add GPM_CLICK_EVENT.
+       Include gpm.h.
+       (handle_one_term_event, term_gpm): New externs.
+
+       * sysdep.c [HAVE_GPM_H] (init_sys_modes): Make gpm_fd nonblocking
+       and allow it to be interrupted by SIGIO.
+
+       * process.c (gpm_wait_mask, max_gpm_desc): New variables.
+       (wait_reading_process_output): Wait on gpm_fd too.
+       (add_gpm_wait_descriptor, delete_gpm_wait_descriptor)): New functions.
+       (add_gpm_wait_descriptor_called_flag): New variable.
+       (delete_keyboard_wait_descriptor): Check gpm_wait_mask.
+
+       * keyboard.c [HAVE_GPM_H] (Qmouse_fixup_help_message)
+       (make_lispy_movement, tracking_off, Ftrack_mouse, some_mouse_moved)
+       (show_help_echo, readable_events, kbd_buffer_get_event, init_keyboard):
+       Extend HAVE_MOUSE ifdefs to HAVE_GPM_H.
+       (make_lispy_event): Add case GPM_CLICK_EVENT.
+       (read_avail_input): Handle mouse input.
+
+       * term.c (write_glyphs_with_face): New function.
+       [HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
+       (mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
+       (mouse_face_end_col, mouse_face_past_end, mouse_face_window)
+       (mouse_face_face_id, term_gpm, pos_x, pos_y)
+       (last_mouse_x, last_mouse_y): New variables.
+       (term_show_mouse_face, term_clear_mouse_face, fast_find_position)
+       (term_mouse_highlight, term_mouse_movement, term_mouse_position)
+       (term_mouse_click, handle_one_term_event, Fterm_open_connection)
+       (Fterm_close_connection): New functions.
+       (term_init): Initialise mouse_face_window.
+
+2007-05-19  Chong Yidong  <cyd@stupidchicken.com>
+
+       * xdisp.c (redisplay_window): If first window line is a
+       continuation line, recompute the new window start instead of
+       recentering.
+
+2007-05-18  Glenn Morris  <rgm@gnu.org>
+
+       * m/alpha.h (ORDINARY_LINK): No longer define on OpenBSD.
+       Suggested by Alfred M. Szmidt <ams@gnu.org>.
+
 2007-05-17  Glenn Morris  <rgm@gnu.org>
 
        * m/macppc.h (ORDINARY_LINK): No longer define on OpenBSD.
        * macterm.c [USE_CARBON_EVENTS] (mac_convert_event_ref): Also convert
        dead key repeat and up events.
 
+2007-05-14  Chong Yidong  <cyd@stupidchicken.com>
+
+       * image.c (pbm_load): Check image size for monochrome pbm.
+
 2007-05-13  Chong Yidong  <cyd@stupidchicken.com>
 
        * xterm.c (XTread_socket): Revert last change.
 
 2007-05-07  Stefan Monnier  <monnier@iro.umontreal.ca>
 
-       * editfns.c (Ftranspose_regions): Yet another int/Lisp_Object mixup (YAILOM)
+       * editfns.c (Ftranspose_regions): Yet another int/Lisp_Object
+       mixup (YAILOM).
 
-2007-05-06  Richard Stallman  <rms@gnu.org>
+2007-05-07  Andreas Schwab  <schwab@suse.de>
 
-       * process.c: Undo May 3 change.
+       * keymap.c (Flookup_key): Fix typo in last change.
 
-2007-05-03  Per Cederqvist  <ceder@lysator.liu.se>  (tiny change)
+2007-05-07  Stefan Monnier  <monnier@iro.umontreal.ca>
 
-       * process.c (Faccept_process_output): Revert 2006-03-22 change so
-       that the third argument once again is in microseconds (not
-       milliseconds).  This makes it compatible with Emacs 21 and
-       earlier.  Problem found by Henrik Rindl\e,Av\e(Bw.
+       * keymap.c (Fdefine_key, Flookup_key): Only do the 0x80->meta_modifier
+       mapping for unibyte strings.
 
 2007-05-01  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
 
        * insdel.c (replace_range): For undo, record insertion first.
 
+2007-04-29  Andreas Schwab  <schwab@suse.de>
+
+       * lisp.h (VECSIZE): Use OFFSETOF.
+
 2007-04-29  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
        * xdisp.c (try_window_reusing_current_matrix): Fix number of
        disabled lines.
 
+2007-04-28  Richard Stallman  <rms@gnu.org>
+
+       * lread.c (read_escape): In a string, \s is always space.
+
 2007-04-27  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
 
        * xmenu.c (xdialog_show): Call Fredisplay before showing the dialog.
        * gtkutil.c (xg_update_menubar, create_menus): Create empty
        submenu for menu bar items.
 
+2007-04-24  Chong Yidong  <cyd@stupidchicken.com>
+
+       * Branch for 22.1.
+
 2007-04-24  Chong Yidong  <cyd@stupidchicken.com>
 
        * xdisp.c (redisplay_window): Use BEG_UNCHANGED and END_UNCHANGED
        for writing files.  Call gtk_file_chooser_set_current_name to keep
        default filename.
 
-       * minibuf.c (Finternal_complete_buffer): Move after DEFUN:s it calls
+       * minibuf.c (Finternal_complete_buffer): Move after DEFUN:s it calls.
 
 2006-09-02  Jindrich Makovicka  <makovick@gmail.com>  (tiny change)
 
        * xterm.h (struct x_display_info): Add x_dnd_atoms* to keep track
        of drag and drop Atoms.
 
-       * xterm.c (x_term_init): Initialize dpyinfo->x_dnd_atoms*
+       * xterm.c (x_term_init): Initialize dpyinfo->x_dnd_atoms*.
 
 2006-08-10  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
 
 
 2006-05-23  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
 
-       * xterm.c: Remove declarations already in xterm.h
+       * xterm.c: Remove declarations already in xterm.h.
 
        * xterm.h: Add extern declarations for x_clear_errors,
        x_fully_uncatch_errors, x_catching_errors and
 
        * puresize.h (pure_write_error): Mark as NO_RETURN.
 
-       * lisp.h (args_out_of_range, args_out_of_range_3)
+       * lisp.h (args_out_of_range, args_out_of_range_3, Fkill_emacs):
+       Likewise.
 
 2006-04-08  Eli Zaretskii  <eliz@gnu.org>
 
 
        * macterm.c (Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
        (Qpreferences): Remove variables.
-       (syms_of_macterm) : Don't initialize them.
+       (syms_of_macterm): Don't initialize them.
        (Qhicommand) [USE_CARBON_EVENTS]: New variable.
        (syms_of_macterm) [USE_CARBON_EVENTS]: Initialize it.
        (init_required_apple_events, do_ae_open_application)
 
        * mac.c [TARGET_API_MAC_CARBON] (get_cfstring_encoding_from_lisp):
        Allow nil as argument.
-        [TARGET_API_MAC_CARBON] (Fmac_code_convert_string): Regard nil
+       [TARGET_API_MAC_CARBON] (Fmac_code_convert_string): Regard nil
        for encoding arguments as UTF-16 in native byte order, no BOM.
 
        * macfns.c (Fx_create_frame): Add debugging code.
        (cfobject_desc_to_lisp, cfproperty_list_to_lisp): Likewise.
 
        * process.c (init_process): Change `#ifdef DARWIN' to `#if
-       defined (DARWIN) || defined (MAC_OSX)'
+       defined (DARWIN) || defined (MAC_OSX)'.
 
        * s/darwin.h (DARWIN): Don't define.
 
 2005-02-03  Kim F. Storm  <storm@cua.dk>
 
        * dispnew.c (build_frame_matrix_from_leaf_window)
-        [!GLYPH_DEBUG]: Fix xassert.
+       [!GLYPH_DEBUG]: Fix xassert.
 
        * xfaces.c (x_free_gc) [!GLYPH_DEBUG]: Fix xassert.
 
 
 2004-12-20  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
-       * macterm.c (mac_do_list_fonts): Fix memory leak
+       * macterm.c (mac_do_list_fonts): Fix memory leak.
 
 2004-12-20  Richard M. Stallman  <rms@gnu.org>
 
        * Makefile.in (SOME_MACHINE_OBJECTS): Add fringe.o, image.o
        and w32*.o.
        (temacs${EXEEXT}): Generate buildobj.lst when temacs is linked.
-       (mostlyclean): Rm buildobj.lst
+       (mostlyclean): Rm buildobj.lst.
 
        * makefile.w32-in ($(TEMACS)): Generate buildobj.lst when temacs
        is linked.
        (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Increment it when malloc is used.
        (SAFE_FREE): Test it to determine if we need to unwind to free.
        Remove size arg.  All users changed.
-       (SAFE_FREE_LISP) Remove.  All users changed to use SAFE_FREE.
+       (SAFE_FREE_LISP): Remove.  All users changed to use SAFE_FREE.
 
 2004-10-26  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
 
        (single_submenu): Use ENCODE_MENU_STRING
        (mac_menu_show): Use ENCODE_MENU_STRING.  Reset grabbed because
        button release isn't passed to event loop
-       (add_menu_item): Use SetMenuItemWithCFString
+       (add_menu_item): Use SetMenuItemWithCFString.
 
 2004-08-26  Steven Tamm  <steventamm@mac.com>
 
        blocking on event queue only by calling ReceiveNextEvent
        instead of select (since GUI events aren't on an fd).
        (sys_read): Remove function
-       * sysdep.c: Remove redefine of read to sys_read if HAVE_CARBON
+       * sysdep.c: Remove redefine of read to sys_read if HAVE_CARBON.
 
 2004-07-18  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
        * macterm.c (x_make_frame_visible): Comment in polling on
        frame creation.
 
-       * keyboard.c: Undef SIGIO on Carbon
+       * keyboard.c: Undef SIGIO on Carbon.
 
        * atimer.c (alarm_signal_handler): Call alarm handlers after
        scheduling.
 
-       * eval.c (Feval): Remove quit_char test
+       * eval.c (Feval): Remove quit_char test.
 
        * process.c (wait_reading_process_input): Remove clearing
        stdin for select call on process input.
 2004-05-11  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
        * macterm.c (x_flush, XTframe_up_to_date): Use FRAME_MAC_P
-       instead of FRAME_X_P
+       instead of FRAME_X_P.
 
 2004-05-11  Kim F. Storm  <storm@cua.dk>
 
 
 2004-05-01  Jason Rumney  <jasonr@gnu.org>
 
-       * w32term.c (x_draw_hollow_cursor): Sync with xterm.c
+       * w32term.c (x_draw_hollow_cursor): Sync with xterm.c.
 
 2004-04-30  Kim F. Storm  <storm@cua.dk>
 
 
        * cmds.c (Fend_of_line): Doc fix.
 
-2004-02-16  Dmitry Antipov  <dmitry.antipov@mail.ru>  (tiny change)
+2004-02-16  Dmitry Antipov  <dmantipov@yandex.ru>  (tiny change)
 
        * keyboard.c (prev_read): New static variable.
        (read_avail_input): Use it to zero out only those slots in buf[]
 
        * makefile.w32-in (alloca.o): Remove.
        (coding.o): Depend on intervals.h
-       (emacs.o, bytecode.o): Depend on window.h
+       (emacs.o, bytecode.o): Depend on window.h.
 
 2003-09-01  Dave Love  <fx@gnu.org>
 
        * gtkutil.c: Include keyboard.h, charset.h, coding.h.
        (xg_create_frame_widgets): Use ENCODE_UTF_8.
 
-       * xterm.c (Qutf_8): Move to coding.c
+       * xterm.c (Qutf_8): Move to coding.c.
 
        * xmenu.c (ENCODE_MENU_STRING): New.
        (list_of_panes, list_of_items, digest_single_submenu, xmenu_show):
        (redisplay_internal): Add check for USE_GTK and popup_activated.
        (redisplay_window): Add check for USE_GTK and FRAME_EXTERNAL_MENU_BAR.
        (redisplay_window): Add check for USE_GTK and FRAME_EXTERNAL_TOOL_BAR.
-       (display_menu_bar): Add check for USE_GTK
+       (display_menu_bar): Add check for USE_GTK.
 
        * lisp.h (Vx_resource_name): Declare extern.
 
        (best_matching_font, choose_face_font): Add `needs_overstrike'
        argument, and use it to return whether overstriking is desirable
        for this face/font combo.
-       (set_font_frame_param: Pass new argument to choose_face_font.
+       (set_font_frame_param): Pass new argument to choose_face_font.
 
 2002-11-17  Ben Key  <BKey1@tampabay.rr.com>
 
 
        * buffer.c (assoc_ignore_text_properties, Fother_buffer, Fkill_buffer)
        (call_overlay_mod_hooks): Use CONSP and XCAR/XCDR.
-       (Fget_buffer_create, advance_to_char_boundary): Use BEG and BEG_BYTE;
+       (Fget_buffer_create, advance_to_char_boundary): Use BEG and BEG_BYTE.
 
 2002-10-21  Stefan Monnier  <monnier@cs.yale.edu>
 
        * fns.c (Fstring_make_unibyte): Doc fix.
 
        * xselect.c (lisp_data_to_selection_data): If the requested type
-        is STRING, call string_make_unibyte to encode the selected text
-        as a string.
+       is STRING, call string_make_unibyte to encode the selected text
+       as a string.
 
        * window.c (Fset_window_hscroll): Doc fix.
 
index 3bc0123..2740cb9 100644 (file)
@@ -440,7 +440,7 @@ XFT_LIBS=@XFT_LIBS@
 
 #if HAVE_GIF
 #ifndef LIBGIF
-#define LIBGIF -lungif
+#define LIBGIF -lgif
 #endif /* not defined LIBGIF */
 #else /* not HAVE_GIF */
 #define LIBGIF
@@ -457,6 +457,15 @@ LIBX= $(LIBXMENU) LD_SWITCH_X_SITE -lX10 LIBX10_MACHINE LIBX10_SYSTEM
 #else /* not HAVE_X_WINDOWS */
 #endif /* not HAVE_X_WINDOWS */
 
+#if HAVE_GPM
+#ifndef LIBGPM
+#define LIBGPM -lgpm
+#endif /* not defined LIBGPM */
+#else /* not HAVE_GPM */
+#define LIBGPM
+#endif /* not HAVE_GPM */
+
+
 LIBSOUND= @LIBSOUND@
 CFLAGS_SOUND= @CFLAGS_SOUND@
 
@@ -664,8 +673,12 @@ otherobj= $(termcapobj) lastfile.o $(mallocobj) $(allocaobj) $(widgetobj) $(LIBO
 #define MOUSE_SUPPORT ${lispsource}mouse.elc \
   ${lispsource}select.elc ${lispsource}scroll-bar.elc
 #else
+#ifdef HAVE_GPM
+#define MOUSE_SUPPORT ${lispsource}mouse.elc
+#else
 #define MOUSE_SUPPORT
 #endif
+#endif
 
 #ifdef VMS
 #define VMS_SUPPORT ${lispsource}vmsproc.elc ${lispsource}vms-patch.elc
@@ -933,7 +946,7 @@ SOME_MACHINE_LISP = ${dotdot}/lisp/mouse.elc \
    Note that SunOS needs -lm to come before -lc; otherwise, you get
    duplicated symbols.  If the standard libraries were compiled
    with GCC, we might need gnulib again after them.  */
-LIBES = $(LOADLIBES) $(LIBS) $(LIBX) $(LIBSOUND) \
+LIBES = $(LOADLIBES) $(LIBS) $(LIBX) $(LIBSOUND) LIBGPM \
    LIBS_SYSTEM LIBS_MACHINE LIBS_TERMCAP \
    LIBS_DEBUG $(GETLOADAVG_LIBS) $(GNULIB_VAR) LIB_MATH LIB_STANDARD \
    $(GNULIB_VAR)
index bdb8dc6..da1724e 100644 (file)
@@ -172,12 +172,79 @@ overwrite a non-system abbreviation of the same name.  */)
   return name;
 }
 
+/* Check if the characters in ABBREV have word syntax in either the
+ * current (if global == 0) or standard syntax table. */
+static void
+abbrev_check_chars (abbrev, global)
+     Lisp_Object abbrev;
+     int global;
+{
+  int i, i_byte, len, nbad = 0;
+  int j, found, nuniq = 0;
+  char *badchars, *baduniq;
+
+  CHECK_STRING (abbrev);
+  len = SCHARS (abbrev);
+
+  badchars = (char *) alloca (len + 1);
+
+  for (i = 0, i_byte = 0; i < len; )
+    {
+      int c;
+
+      FETCH_STRING_CHAR_ADVANCE (c, abbrev, i, i_byte);
+
+      if (global)
+        {
+          /* Copied from SYNTAX in syntax.h, except using FOLLOW_PARENT. */
+          Lisp_Object syntax_temp
+            = SYNTAX_ENTRY_FOLLOW_PARENT (Vstandard_syntax_table, c);
+          if ( (CONSP (syntax_temp)
+                ? (enum syntaxcode) (XINT (XCAR (syntax_temp)) & 0xff)
+                : Swhitespace) != Sword ) badchars[nbad++] = c;
+        }
+      else if (SYNTAX (c) != Sword)
+        badchars[nbad++] = c;
+    }
+
+  if (nbad == 0) return;
+
+  baduniq = (char *) alloca (nbad + 1);
+
+  for (i = 0; i < nbad; i++)
+    {
+      found = 0;
+
+      for (j = 0; j < nuniq; j++)
+        {
+          if (badchars[i] == baduniq[j])
+            {
+              found = 1;
+              break;
+            }
+        }
+
+      if (found) continue ;
+
+      baduniq[nuniq++] = badchars[i];
+    }
+
+  baduniq[nuniq] = '\0';
+
+  error ("Some abbrev characters (%s) are not word constituents %s",
+         baduniq, global ? "in the standard syntax" : "in this mode" );
+}
+
 DEFUN ("define-global-abbrev", Fdefine_global_abbrev, Sdefine_global_abbrev, 2, 2,
        "sDefine global abbrev: \nsExpansion for %s: ",
-       doc: /* Define ABBREV as a global abbreviation for EXPANSION.  */)
+       doc: /* Define ABBREV as a global abbreviation for EXPANSION.
+The characters in ABBREV must all be word constituents in the standard
+syntax table.  */)
      (abbrev, expansion)
      Lisp_Object abbrev, expansion;
 {
+  abbrev_check_chars (abbrev, 1);
+
   Fdefine_abbrev (Vglobal_abbrev_table, Fdowncase (abbrev),
                  expansion, Qnil, make_number (0), Qnil);
   return abbrev;
@@ -185,13 +252,16 @@ DEFUN ("define-global-abbrev", Fdefine_global_abbrev, Sdefine_global_abbrev, 2,
 
 DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev, Sdefine_mode_abbrev, 2, 2,
        "sDefine mode abbrev: \nsExpansion for %s: ",
-       doc: /* Define ABBREV as a mode-specific abbreviation for EXPANSION.  */)
+       doc: /* Define ABBREV as a mode-specific abbreviation for EXPANSION.
+The characters in ABBREV must all be word-constituents in the current mode.  */)
      (abbrev, expansion)
      Lisp_Object abbrev, expansion;
 {
   if (NILP (current_buffer->abbrev_table))
     error ("Major mode has no abbrev table");
 
+  abbrev_check_chars (abbrev, 0);
+
   Fdefine_abbrev (current_buffer->abbrev_table, Fdowncase (abbrev),
                  expansion, Qnil, make_number (0), Qnil);
   return abbrev;
index 948b878..a69f504 100644 (file)
@@ -1179,8 +1179,6 @@ emacs_blocked_free (ptr, ptr2)
      void *ptr;
      const void *ptr2;
 {
-  EMACS_INT bytes_used_now;
-
   BLOCK_INPUT_ALLOC;
 
 #ifdef GC_MALLOC_CHECK
@@ -1756,6 +1754,8 @@ init_strings ()
   string_blocks = NULL;
   n_string_blocks = 0;
   string_free_list = NULL;
+  empty_unibyte_string = make_pure_string ("", 0, 0, 0);
+  empty_multibyte_string = make_pure_string ("", 0, 0, 1);
 }
 
 
@@ -2479,6 +2479,9 @@ make_uninit_string (length)
      int length;
 {
   Lisp_Object val;
+
+  if (!length)
+    return empty_unibyte_string;
   val = make_uninit_multibyte_string (length, length);
   STRING_SET_UNIBYTE (val);
   return val;
@@ -2497,6 +2500,8 @@ make_uninit_multibyte_string (nchars, nbytes)
 
   if (nchars < 0)
     abort ();
+  if (!nbytes)
+    return empty_multibyte_string;
 
   s = allocate_string ();
   allocate_string_data (s, nchars, nbytes);
@@ -4256,9 +4261,14 @@ mark_maybe_pointer (p)
 {
   struct mem_node *m;
 
-  /* Quickly rule out some values which can't point to Lisp data.  We
-     assume that Lisp data is aligned on even addresses.  */
-  if ((EMACS_INT) p & 1)
+  /* Quickly rule out some values which can't point to Lisp data.  */
+  if ((EMACS_INT) p %
+#ifdef USE_LSB_TAG
+      8 /* USE_LSB_TAG needs Lisp data to be aligned on multiples of 8.  */
+#else
+      2 /* We assume that Lisp data is aligned on even addresses.  */
+#endif
+      )
     return;
 
   m = mem_find (p);
index 554ca14..127bfba 100644 (file)
@@ -5505,6 +5505,8 @@ A string is printed verbatim in the mode line except for %-constructs:
   %z -- print mnemonics of keyboard, terminal, and buffer coding systems.
   %Z -- like %z, but including the end-of-line format.
   %e -- print error message about full memory.
+  %@ -- print @ or hyphen.  @ means that default-directory is on a
+        remote machine.
   %[ -- print one [ for each recursive editing level.  %] similar.
   %% -- print %.   %- -- print infinitely many dashes.
 Decimal digits after the % specify field width to which to pad.  */);
index 9dcc077..9b35354 100644 (file)
@@ -473,16 +473,19 @@ invoke it.  If KEYS is omitted or nil, the return value of
   /* Count the number of arguments the interactive spec would have
      us give to the function.  */
   tem = string;
-  for (j = 0; *tem; j++)
+  for (j = 0; *tem;)
     {
       /* 'r' specifications ("point and mark as 2 numeric args")
         produce *two* arguments.  */
-      if (*tem == 'r') j++;
+      if (*tem == 'r')
+       j += 2;
+      else
+       j++;
       tem = (unsigned char *) index (tem, '\n');
       if (tem)
-       tem++;
+       ++tem;
       else
-       tem = (unsigned char *) "";
+       break;
     }
   count = j;
 
@@ -585,7 +588,7 @@ invoke it.  If KEYS is omitted or nil, the return value of
        case 'G':               /* Possibly nonexistent file name,
                                   default to directory alone. */
          args[i] = Fread_file_name (callint_message,
-                                    Qnil, Qnil, Qnil, build_string (""), Qnil);
+                                    Qnil, Qnil, Qnil, empty_unibyte_string, Qnil);
          break;
 
        case 'i':               /* Ignore an argument -- Does not do I/O */
index a53bb1e..952a320 100644 (file)
@@ -126,7 +126,7 @@ set_case_table (table, standard)
      int standard;
 {
   Lisp_Object up, canon, eqv;
-  Lisp_Object indices[3];
+  int indices[3];
 
   check_case_table (table);
 
index 907521e..7359f02 100644 (file)
@@ -7464,6 +7464,8 @@ They may specify a coding system, a cons of coding systems,
 or a function symbol to call.
 In the last case, we call the function with one argument,
 which is a list of all the arguments given to this function.
+If the function can't decide a coding system, it can return
+`undecided' so that the normal code-detection is performed.
 
 If OPERATION is `insert-file-contents', the argument corresponding to
 TARGET may be a cons (FILENAME . BUFFER).  In that case, FILENAME is a
@@ -7967,7 +7969,9 @@ and the cdr part is used for encoding.
 If VAL is a function symbol, the function must return a coding system
 or a cons of coding systems which are used as above.  The function is
 called with an argument that is a list of the arguments with which
-`find-operation-coding-system' was called.
+`find-operation-coding-system' was called.  If the function can't decide
+a coding system, it can return `undecided' so that the normal
+code-detection is performed.
 
 See also the function `find-operation-coding-system'
 and the variable `auto-coding-alist'.  */);
index 158ae10..70a5b7b 100644 (file)
@@ -228,9 +228,13 @@ Boston, MA 02110-1301, USA.  */
 /* Define to 1 if you have the `get_current_dir_name' function. */
 #undef HAVE_GET_CURRENT_DIR_NAME
 
-/* Define to 1 if you have the ungif library (-lungif). */
+/* Define to 1 if you have a gif library (default -lgif; otherwise specify
+   with LIBGIF). */
 #undef HAVE_GIF
 
+/* Define to 1 if you have the gpm library (-lgpm). */
+#undef HAVE_GPM
+
 /* Define to 1 if you have the `grantpt' function. */
 #undef HAVE_GRANTPT
 
@@ -765,6 +769,9 @@ Boston, MA 02110-1301, USA.  */
    Solaris, for example). */
 #undef LD_SWITCH_X_SITE_AUX
 
+/* Compiler option to link with the gif library (if not -lgif). */
+#undef LIBGIF
+
 /* Define to 1 if localtime caches TZ. */
 #undef LOCALTIME_CACHE
 
index 5e7453e..3f27e38 100644 (file)
@@ -750,7 +750,22 @@ Value, if non-nil, is a list \(interactive SPEC).  */)
      (cmd)
      Lisp_Object cmd;
 {
-  Lisp_Object fun = indirect_function (cmd);
+  Lisp_Object fun = indirect_function (cmd); /* Check cycles.  */
+  
+  if (NILP (fun) || EQ (fun, Qunbound))
+    return Qnil;
+
+  /* Use an `interactive-form' property if present, analogous to the
+     function-documentation property. */
+  fun = cmd;
+  while (SYMBOLP (fun))
+    {
+      Lisp_Object tmp = Fget (fun, intern ("interactive-form"));
+      if (!NILP (tmp))
+       return tmp;
+      else
+       fun = Fsymbol_function (fun);
+    }
 
   if (SUBRP (fun))
     {
index 65c0f21..25f6625 100644 (file)
--- a/src/doc.c
+++ b/src/doc.c
@@ -883,7 +883,7 @@ a new string, without any text properties, is returned.  */)
          struct buffer *oldbuf;
          int start_idx;
          /* This is for computing the SHADOWS arg for describe_map_tree.  */
-         Lisp_Object active_maps = Fcurrent_active_maps (Qnil);
+         Lisp_Object active_maps = Fcurrent_active_maps (Qnil, Qnil);
          Lisp_Object earlier_maps;
 
          changed = 1;
index 6c6742d..dac7eb8 100644 (file)
@@ -84,6 +84,11 @@ extern char **environ;
 
 extern size_t emacs_strftimeu P_ ((char *, size_t, const char *,
                                   const struct tm *, int));
+
+#ifdef WINDOWSNT
+extern Lisp_Object w32_get_internal_run_time ();
+#endif
+
 static int tm_diff P_ ((struct tm *, struct tm *));
 static void find_field P_ ((Lisp_Object, Lisp_Object, Lisp_Object, int *, Lisp_Object, int *));
 static void update_buffer_properties P_ ((int, int));
@@ -1483,9 +1488,13 @@ on systems that do not provide resolution finer than a second.  */)
   return list3 (make_number ((secs >> 16) & 0xffff),
                make_number ((secs >> 0)  & 0xffff),
                make_number (usecs));
-#else
+#else /* ! HAVE_GETRUSAGE  */
+#if WINDOWSNT
+  return w32_get_internal_run_time ();
+#else /* ! WINDOWSNT  */
   return Fcurrent_time ();
-#endif
+#endif /* WINDOWSNT  */
+#endif /* HAVE_GETRUSAGE  */
 }
 \f
 
@@ -1974,6 +1983,7 @@ the data it can't find.  */)
       int offset = tm_diff (t, &gmt);
       char *s = 0;
       char buf[6];
+
 #ifdef HAVE_TM_ZONE
       if (t->tm_zone)
        s = (char *)t->tm_zone;
@@ -1984,19 +1994,6 @@ the data it can't find.  */)
 #endif
 #endif /* not HAVE_TM_ZONE */
 
-#if defined HAVE_TM_ZONE || defined HAVE_TZNAME
-      if (s)
-       {
-         /* On Japanese w32, we can get a Japanese string as time
-            zone name.  Don't accept that.  */
-         char *p;
-         for (p = s; *p && (isalnum ((unsigned char)*p) || *p == ' '); ++p)
-           ;
-         if (p == s || *p)
-           s = NULL;
-       }
-#endif
-
       if (!s)
        {
          /* No local time zone name is available; use "+-NNNN" instead.  */
@@ -2004,6 +2001,7 @@ the data it can't find.  */)
          sprintf (buf, "%c%02d%02d", (offset < 0 ? '-' : '+'), am/60, am%60);
          s = buf;
        }
+
       return Fcons (make_number (offset), Fcons (build_string (s), Qnil));
     }
   else
@@ -3042,7 +3040,7 @@ DEFUN ("delete-and-extract-region", Fdelete_and_extract_region,
 {
   validate_region (&start, &end);
   if (XINT (start) == XINT (end))
-    return build_string ("");
+    return empty_unibyte_string;
   return del_range_1 (XINT (start), XINT (end), 1, 1);
 }
 \f
@@ -4114,9 +4112,9 @@ Transposing beyond buffer boundaries is an error.  */)
      (startr1, endr1, startr2, endr2, leave_markers)
      Lisp_Object startr1, endr1, startr2, endr2, leave_markers;
 {
-  register int start1, end1, start2, end2;
-  int start1_byte, start2_byte, len1_byte, len2_byte;
-  int gap, len1, len_mid, len2;
+  register EMACS_INT start1, end1, start2, end2;
+  EMACS_INT start1_byte, start2_byte, len1_byte, len2_byte;
+  EMACS_INT gap, len1, len_mid, len2;
   unsigned char *start1_addr, *start2_addr, *temp;
 
   INTERVAL cur_intv, tmp_interval1, tmp_interval_mid, tmp_interval2, tmp_interval3;
index b356faa..d67c97a 100644 (file)
@@ -133,8 +133,8 @@ Lisp_Object Vinstallation_directory;
 /* Hook run by `kill-emacs' before it does really anything.  */
 Lisp_Object Vkill_emacs_hook;
 
-/* An empty lisp string.  To avoid having to build any other.  */
-Lisp_Object empty_string;
+/* Empty lisp strings.  To avoid having to build any others.  */
+Lisp_Object empty_unibyte_string, empty_multibyte_string;
 
 /* Search path separator.  */
 Lisp_Object Vpath_separator;
@@ -856,17 +856,23 @@ main (argc, argv
          So ignore --version otherwise.  */
       && initialized)
     {
-      Lisp_Object tem;
+      Lisp_Object tem, tem2;
       tem = Fsymbol_value (intern ("emacs-version"));
+      tem2 = Fsymbol_value (intern ("emacs-copyright"));
       if (!STRINGP (tem))
        {
          fprintf (stderr, "Invalid value of `emacs-version'\n");
          exit (1);
        }
+      if (!STRINGP (tem2))
+       {
+         fprintf (stderr, "Invalid value of `emacs-copyright'\n");
+         exit (1);
+       }
       else
        {
          printf ("GNU Emacs %s\n", SDATA (tem));
-         printf ("Copyright (C) 2007 Free Software Foundation, Inc.\n");
+         printf ("%s\n", SDATA(tem2));
          printf ("GNU Emacs comes with ABSOLUTELY NO WARRANTY.\n");
          printf ("You may redistribute copies of Emacs\n");
          printf ("under the terms of the GNU General Public License.\n");
@@ -2475,9 +2481,6 @@ see `kill-emacs-query-functions' instead.
 The hook is not run in batch mode, i.e., if `noninteractive' is non-nil.  */);
   Vkill_emacs_hook = Qnil;
 
-  empty_string = build_string ("");
-  staticpro (&empty_string);
-
   DEFVAR_INT ("emacs-priority", &emacs_priority,
              doc: /* Priority for Emacs to run at.
 This value is effective only if set before Emacs is dumped,
index 026a337..6ce64bc 100644 (file)
@@ -1586,8 +1586,7 @@ internal_condition_case_2 (bfun, nargs, args, handlers, hfun)
 
 \f
 static Lisp_Object find_handler_clause P_ ((Lisp_Object, Lisp_Object,
-                                           Lisp_Object, Lisp_Object,
-                                           Lisp_Object *));
+                                           Lisp_Object, Lisp_Object));
 
 DEFUN ("signal", Fsignal, Ssignal, 2, 2, 0,
        doc: /* Signal an error.  Args are ERROR-SYMBOL and associated DATA.
@@ -1613,7 +1612,6 @@ See also the function `condition-case'.  */)
   Lisp_Object conditions;
   extern int gc_in_progress;
   extern int waiting_for_input;
-  Lisp_Object debugger_value;
   Lisp_Object string;
   Lisp_Object real_error_symbol;
   struct backtrace *bp;
@@ -1671,7 +1669,7 @@ See also the function `condition-case'.  */)
       register Lisp_Object clause;
 
       clause = find_handler_clause (handlerlist->handler, conditions,
-                                   error_symbol, data, &debugger_value);
+                                   error_symbol, data);
 
       if (EQ (clause, Qlambda))
        {
@@ -1702,7 +1700,7 @@ See also the function `condition-case'.  */)
   handlerlist = allhandlers;
   /* If no handler is present now, try to run the debugger,
      and if that fails, throw to top level.  */
-  find_handler_clause (Qerror, conditions, error_symbol, data, &debugger_value);
+  find_handler_clause (Qerror, conditions, error_symbol, data);
   if (catchlist != 0)
     Fthrow (Qtop_level, Qt);
 
@@ -1854,75 +1852,54 @@ skip_debugger (conditions, data)
     = SIG is nil, and DATA is (SYMBOL . REST-OF-DATA).
        This is for memory-full errors only.
 
-   Store value returned from debugger into *DEBUGGER_VALUE_PTR.
-
    We need to increase max_specpdl_size temporarily around
    anything we do that can push on the specpdl, so as not to get
    a second error here in case we're handling specpdl overflow.  */
 
 static Lisp_Object
-find_handler_clause (handlers, conditions, sig, data, debugger_value_ptr)
+find_handler_clause (handlers, conditions, sig, data)
      Lisp_Object handlers, conditions, sig, data;
-     Lisp_Object *debugger_value_ptr;
 {
   register Lisp_Object h;
   register Lisp_Object tem;
+  int debugger_called = 0;
+  int debugger_considered = 0;
 
-  if (EQ (handlers, Qt))  /* t is used by handlers for all conditions, set up by C code.  */
+  /* t is used by handlers for all conditions, set up by C code.  */
+  if (EQ (handlers, Qt))
     return Qt;
+
+  /* Don't run the debugger for a memory-full error.
+     (There is no room in memory to do that!)  */
+  if (NILP (sig))
+    debugger_considered = 1;
+
   /* error is used similarly, but means print an error message
      and run the debugger if that is enabled.  */
   if (EQ (handlers, Qerror)
       || !NILP (Vdebug_on_signal)) /* This says call debugger even if
                                      there is a handler.  */
     {
-      int debugger_called = 0;
-      Lisp_Object sig_symbol, combined_data;
-      /* This is set to 1 if we are handling a memory-full error,
-        because these must not run the debugger.
-        (There is no room in memory to do that!)  */
-      int no_debugger = 0;
-
-      if (NILP (sig))
-       {
-         combined_data = data;
-         sig_symbol = Fcar (data);
-         no_debugger = 1;
-       }
-      else
-       {
-         combined_data = Fcons (sig, data);
-         sig_symbol = sig;
-       }
-
-      if (wants_debugger (Vstack_trace_on_error, conditions))
+      if (!NILP (sig) && wants_debugger (Vstack_trace_on_error, conditions))
        {
          max_specpdl_size++;
-#ifdef PROTOTYPES
+    #ifdef PROTOTYPES
          internal_with_output_to_temp_buffer ("*Backtrace*",
                                               (Lisp_Object (*) (Lisp_Object)) Fbacktrace,
                                               Qnil);
-#else
+    #else
          internal_with_output_to_temp_buffer ("*Backtrace*",
                                               Fbacktrace, Qnil);
-#endif
+    #endif
          max_specpdl_size--;
        }
-      if (! no_debugger
-         /* Don't try to run the debugger with interrupts blocked.
-            The editing loop would return anyway.  */
-         && ! INPUT_BLOCKED_P
-         && (EQ (sig_symbol, Qquit)
-             ? debug_on_quit
-             : wants_debugger (Vdebug_on_error, conditions))
-         && ! skip_debugger (conditions, combined_data)
-         && when_entered_debugger < num_nonmacro_input_events)
+
+      if (!debugger_considered)
        {
-         *debugger_value_ptr
-           = call_debugger (Fcons (Qerror,
-                                   Fcons (combined_data, Qnil)));
-         debugger_called = 1;
+         debugger_considered = 1;
+         debugger_called = maybe_call_debugger (conditions, sig, data);
        }
+
       /* If there is no handler, return saying whether we ran the debugger.  */
       if (EQ (handlers, Qerror))
        {
@@ -1931,6 +1908,7 @@ find_handler_clause (handlers, conditions, sig, data, debugger_value_ptr)
          return Qt;
        }
     }
+
   for (h = handlers; CONSP (h); h = Fcdr (h))
     {
       Lisp_Object handler, condit;
@@ -1949,18 +1927,55 @@ find_handler_clause (handlers, conditions, sig, data, debugger_value_ptr)
       /* Handle a list of condition names in handler HANDLER.  */
       else if (CONSP (condit))
        {
-         while (CONSP (condit))
+         Lisp_Object tail;
+         for (tail = condit; CONSP (tail); tail = XCDR (tail))
            {
-             tem = Fmemq (Fcar (condit), conditions);
+             tem = Fmemq (Fcar (tail), conditions);
              if (!NILP (tem))
-               return handler;
-             condit = XCDR (condit);
+               {
+                 /* This handler is going to apply.
+                    Does it allow the debugger to run first?  */
+                 if (! debugger_considered && !NILP (Fmemq (Qdebug, condit)))
+                   maybe_call_debugger (conditions, sig, data);
+                 return handler;
+               }
            }
        }
     }
+
   return Qnil;
 }
 
+/* Call the debugger if calling it is currently enabled for CONDITIONS.
+   SIG and DATA describe the signal, as in find_handler_clause.  */
+
+int
+maybe_call_debugger (conditions, sig, data)
+     Lisp_Object conditions, sig, data;
+{
+  Lisp_Object combined_data;
+
+  combined_data = Fcons (sig, data);
+
+  if (
+      /* Don't try to run the debugger with interrupts blocked.
+        The editing loop would return anyway.  */
+      ! INPUT_BLOCKED_P
+      /* Does user wants to enter debugger for this kind of error?  */
+      && (EQ (sig, Qquit)
+         ? debug_on_quit
+         : wants_debugger (Vdebug_on_error, conditions))
+      && ! skip_debugger (conditions, combined_data)
+      /* rms: what's this for? */
+      && when_entered_debugger < num_nonmacro_input_events)
+    {
+      call_debugger (Fcons (Qerror, Fcons (combined_data, Qnil)));
+      return 1;
+    }
+
+  return 0;
+}
+
 /* dump an error message; called like printf */
 
 /* VARARGS 1 */
@@ -2025,42 +2040,49 @@ then strings and vectors are not accepted.  */)
 {
   register Lisp_Object fun;
   register Lisp_Object funcar;
+  Lisp_Object if_prop = Qnil;
 
   fun = function;
 
-  fun = indirect_function (fun);
-  if (EQ (fun, Qunbound))
+  fun = indirect_function (fun); /* Check cycles. */
+  if (NILP (fun) || EQ (fun, Qunbound))
     return Qnil;
 
+  /* Check an `interactive-form' property if present, analogous to the
+     function-documentation property. */
+  fun = function;
+  while (SYMBOLP (fun))
+    {
+      Lisp_Object tmp = Fget (fun, intern ("interactive-form"));
+      if (!NILP (tmp))
+       if_prop = Qt;
+      fun = Fsymbol_function (fun);
+    }
+
   /* Emacs primitives are interactive if their DEFUN specifies an
      interactive spec.  */
   if (SUBRP (fun))
-    {
-      if (XSUBR (fun)->prompt)
-       return Qt;
-      else
-       return Qnil;
-    }
+    return XSUBR (fun)->prompt ? Qt : if_prop;
 
   /* Bytecode objects are interactive if they are long enough to
      have an element whose index is COMPILED_INTERACTIVE, which is
      where the interactive spec is stored.  */
   else if (COMPILEDP (fun))
     return ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) > COMPILED_INTERACTIVE
-           ? Qt : Qnil);
+           ? Qt : if_prop);
 
   /* Strings and vectors are keyboard macros.  */
-  if (NILP (for_call_interactively) && (STRINGP (fun) || VECTORP (fun)))
-    return Qt;
+  if (STRINGP (fun) || VECTORP (fun))
+    return NILP (for_call_interactively) ? Qt : Qnil;
 
   /* Lists may represent commands.  */
   if (!CONSP (fun))
     return Qnil;
   funcar = XCAR (fun);
   if (EQ (funcar, Qlambda))
-    return Fassq (Qinteractive, Fcdr (XCDR (fun)));
+    return !NILP (Fassq (Qinteractive, Fcdr (XCDR (fun)))) ? Qt : if_prop;
   if (EQ (funcar, Qautoload))
-    return Fcar (Fcdr (Fcdr (XCDR (fun))));
+    return !NILP (Fcar (Fcdr (Fcdr (XCDR (fun))))) ? Qt : if_prop;
   else
     return Qnil;
 }
index 26723fa..45eb7d2 100644 (file)
@@ -3690,27 +3690,25 @@ DEFUN ("insert-file-contents", Finsert_file_contents, Sinsert_file_contents,
        1, 5, 0,
        doc: /* Insert contents of file FILENAME after point.
 Returns list of absolute file name and number of characters inserted.
-If second argument VISIT is non-nil, the buffer's visited filename
-and last save file modtime are set, and it is marked unmodified.
-If visiting and the file does not exist, visiting is completed
-before the error is signaled.
-The optional third and fourth arguments BEG and END
-specify what portion of the file to insert.
-These arguments count bytes in the file, not characters in the buffer.
-If VISIT is non-nil, BEG and END must be nil.
-
-If optional fifth argument REPLACE is non-nil,
-it means replace the current buffer contents (in the accessible portion)
-with the file contents.  This is better than simply deleting and inserting
-the whole thing because (1) it preserves some marker positions
-and (2) it puts less data in the undo list.
-When REPLACE is non-nil, the value is the number of characters actually read,
-which is often less than the number of characters to be read.
-
-This does code conversion according to the value of
-`coding-system-for-read' or `file-coding-system-alist',
-and sets the variable `last-coding-system-used' to the coding system
-actually used.  */)
+If second argument VISIT is non-nil, the buffer's visited filename and
+last save file modtime are set, and it is marked unmodified.  If
+visiting and the file does not exist, visiting is completed before the
+error is signaled.
+
+The optional third and fourth arguments BEG and END specify what portion
+of the file to insert.  These arguments count bytes in the file, not
+characters in the buffer.  If VISIT is non-nil, BEG and END must be nil.
+
+If optional fifth argument REPLACE is non-nil, replace the current
+buffer contents (in the accessible portion) with the file contents.
+This is better than simply deleting and inserting the whole thing
+because (1) it preserves some marker positions and (2) it puts less data
+in the undo list.  When REPLACE is non-nil, the second return value is
+the number of characters that replace previous buffer contents.
+
+This function does code conversion according to the value of
+`coding-system-for-read' or `file-coding-system-alist', and sets the
+variable `last-coding-system-used' to the coding system actually used.  */)
      (filename, visit, beg, end, replace)
      Lisp_Object filename, visit, beg, end, replace;
 {
@@ -3720,8 +3718,8 @@ actually used.  */)
   register int how_much;
   register int unprocessed;
   int count = SPECPDL_INDEX ();
-  struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
-  Lisp_Object handler, val, insval, orig_filename;
+  struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
+  Lisp_Object handler, val, insval, orig_filename, old_undo;
   Lisp_Object p;
   int total = 0;
   int not_regular = 0;
@@ -3744,8 +3742,9 @@ actually used.  */)
   val = Qnil;
   p = Qnil;
   orig_filename = Qnil;
+  old_undo = Qnil;
 
-  GCPRO4 (filename, val, p, orig_filename);
+  GCPRO5 (filename, val, p, orig_filename, old_undo);
 
   CHECK_STRING (filename);
   filename = Fexpand_file_name (filename, Qnil);
@@ -4704,24 +4703,103 @@ actually used.  */)
   /* Decode file format */
   if (inserted > 0)
     {
-      int empty_undo_list_p = 0;
+      /* Don't run point motion or modification hooks when decoding. */
+      int count = SPECPDL_INDEX ();
+      specbind (Qinhibit_point_motion_hooks, Qt);
+      specbind (Qinhibit_modification_hooks, Qt);
+
+      /* Save old undo list and don't record undo for decoding. */
+      old_undo = current_buffer->undo_list;
+      current_buffer->undo_list = Qt;
 
-      /* If we're anyway going to discard undo information, don't
-        record it in the first place.  The buffer's undo list at this
-        point is either nil or t when visiting a file.  */
-      if (!NILP (visit))
+      if (NILP (replace))
        {
-         empty_undo_list_p = NILP (current_buffer->undo_list);
-         current_buffer->undo_list = Qt;
+         insval = call3 (Qformat_decode,
+                         Qnil, make_number (inserted), visit);
+         CHECK_NUMBER (insval);
+         inserted = XFASTINT (insval);
+       }
+      else
+       {
+         /* If REPLACE is non-nil and we succeeded in not replacing the
+         beginning or end of the buffer text with the file's contents,
+         call format-decode with `point' positioned at the beginning of
+         the buffer and `inserted' equalling the number of characters
+         in the buffer.  Otherwise, format-decode might fail to
+         correctly analyze the beginning or end of the buffer.  Hence
+         we temporarily save `point' and `inserted' here and restore
+         `point' iff format-decode did not insert or delete any text.
+         Otherwise we leave `point' at point-min. */
+         int opoint = PT;
+         int opoint_byte = PT_BYTE;
+         int oinserted = ZV - BEGV;
+         
+         TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE); 
+         insval = call3 (Qformat_decode,
+                         Qnil, make_number (oinserted), visit);
+         CHECK_NUMBER (insval);
+         if (XINT (insval) == oinserted)
+           SET_PT_BOTH (opoint, opoint_byte);
+         inserted = XFASTINT (insval);
        }
 
-      insval = call3 (Qformat_decode,
-                     Qnil, make_number (inserted), visit);
-      CHECK_NUMBER (insval);
-      inserted = XFASTINT (insval);
+      /* For consistency with format-decode call these now iff inserted > 0
+        (martin 2007-06-28) */
+      p = Vafter_insert_file_functions;
+      while (CONSP (p))
+       {
+         if (NILP (replace))
+           {
+             insval = call1 (XCAR (p), make_number (inserted));
+             if (!NILP (insval))
+               {
+                 CHECK_NUMBER (insval);
+                 inserted = XFASTINT (insval);
+               }
+           }
+         else
+           {
+             /* For the rationale of this see the comment on format-decode above. */
+             int opoint = PT;
+             int opoint_byte = PT_BYTE;
+             int oinserted = ZV - BEGV;
+
+             TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE);
+             insval = call1 (XCAR (p), make_number (oinserted));
+             if (!NILP (insval))
+               {
+                 CHECK_NUMBER (insval);
+                 if (XINT (insval) == oinserted)
+                   SET_PT_BOTH (opoint, opoint_byte);
+                 inserted = XFASTINT (insval);
+               }
+           }
+
+         QUIT;
+         p = XCDR (p);
+       }
+
+      if (NILP (visit))
+       {
+         Lisp_Object lbeg, lend;
+         XSETINT (lbeg, PT);
+         XSETINT (lend, PT + inserted);
+         if (CONSP (old_undo))
+           {
+             Lisp_Object tem = XCAR (old_undo);
+             if (CONSP (tem) && INTEGERP (XCAR (tem)) &&
+                 INTEGERP (XCDR (tem)) && EQ (XCAR (tem), lbeg))
+               /* In the non-visiting case record only the final insertion. */
+               current_buffer->undo_list =
+                 Fcons (Fcons (lbeg, lend), Fcdr (old_undo));
+           }
+       }
+      else
+       /* If undo_list was Qt before, keep it that way.
+          Otherwise start with an empty undo_list. */
+       current_buffer->undo_list = EQ (old_undo, Qt) ? Qt : Qnil;
 
-      if (!NILP (visit))
-       current_buffer->undo_list = empty_undo_list_p ? Qnil : Qt;
+      unbind_to (count, Qnil);
     }
 
   /* Call after-change hooks for the inserted text, aside from the case
@@ -4734,19 +4812,6 @@ actually used.  */)
       update_compositions (PT, PT, CHECK_BORDER);
     }
 
-  p = Vafter_insert_file_functions;
-  while (CONSP (p))
-    {
-      insval = call1 (XCAR (p), make_number (inserted));
-      if (!NILP (insval))
-       {
-         CHECK_NUMBER (insval);
-         inserted = XFASTINT (insval);
-       }
-      QUIT;
-      p = XCDR (p);
-    }
-
   if (!NILP (visit)
       && current_buffer->modtime == -1)
     {
@@ -6428,7 +6493,7 @@ and `read-file-name-function'.  */)
       if (! replace_in_history)
        add_to_history = 1;
 
-      val = empty_string;
+      val = empty_unibyte_string;
     }
 
   unbind_to (count, Qnil);
@@ -6681,8 +6746,9 @@ or local variable spec of the tailing lines with `coding:' tag.  */);
 
   DEFVAR_LISP ("after-insert-file-functions", &Vafter_insert_file_functions,
               doc: /* A list of functions to be called at the end of `insert-file-contents'.
-Each is passed one argument, the number of characters inserted.
-It should return the new character count, and leave point the same.
+Each is passed one argument, the number of characters inserted,
+with point at the start of the inserted text.  Each function
+should leave point the same, and return the new character count.
 If `insert-file-contents' is intercepted by a handler from
 `file-name-handler-alist', that handler is responsible for calling the
 functions in `after-insert-file-functions' if appropriate.  */);
index 59cb2e3..eef6755 100644 (file)
--- a/src/fns.c
+++ b/src/fns.c
@@ -2825,8 +2825,8 @@ DEFUN ("optimize-char-table", Foptimize_char_table, Soptimize_char_table,
 void
 map_char_table (c_function, function, table, subtable, arg, depth, indices)
      void (*c_function) P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
-     Lisp_Object function, table, subtable, arg, *indices;
-     int depth;
+     Lisp_Object function, table, subtable, arg;
+     int depth, *indices;
 {
   int i, to;
   struct gcpro gcpro1, gcpro2,  gcpro3, gcpro4;
@@ -2860,7 +2860,7 @@ map_char_table (c_function, function, table, subtable, arg, depth, indices)
     }
   else
     {
-      int charset = XFASTINT (indices[0]) - 128;
+      int charset = indices[0] - 128;
 
       i = 32;
       to = SUB_CHAR_TABLE_ORDINARY_SLOTS;
@@ -2874,8 +2874,8 @@ map_char_table (c_function, function, table, subtable, arg, depth, indices)
       int charset;
 
       elt = XCHAR_TABLE (subtable)->contents[i];
-      XSETFASTINT (indices[depth], i);
-      charset = XFASTINT (indices[0]) - 128;
+      indices[depth] = i;
+      charset = indices[0] - 128;
       if (depth == 0
          && (!CHARSET_DEFINED_P (charset)
              || charset == CHARSET_8_BIT_CONTROL
@@ -2892,8 +2892,8 @@ map_char_table (c_function, function, table, subtable, arg, depth, indices)
        {
          int c1, c2, c;
 
-         c1 = depth >= 1 ? XFASTINT (indices[1]) : 0;
-         c2 = depth >= 2 ? XFASTINT (indices[2]) : 0;
+         c1 = depth >= 1 ? indices[1] : 0;
+         c2 = depth >= 2 ? indices[2] : 0;
          c = MAKE_CHAR (charset, c1, c2);
 
          if (NILP (elt))
@@ -2927,14 +2927,14 @@ The key is always a possible IDX argument to `aref'.  */)
      Lisp_Object function, char_table;
 {
   /* The depth of char table is at most 3. */
-  Lisp_Object indices[3];
+  int indices[3];
 
   CHECK_CHAR_TABLE (char_table);
 
   /* When Lisp_Object is represented as a union, `call2' cannot directly
      be passed to map_char_table because it returns a Lisp_Object rather
      than returning nothing.
-     Casting leads to crashes on some architectures.  -stef  */
+     Casting leads to crashes on some architectures.  --Stef  */
   map_char_table (void_call2, Qnil, char_table, char_table, function, 0, indices);
   return Qnil;
 }
@@ -3134,7 +3134,7 @@ SEQUENCE may be a list, a vector, a bool-vector, or a string.  */)
   len = Flength (sequence);
   leni = XINT (len);
   nargs = leni + leni - 1;
-  if (nargs < 0) return build_string ("");
+  if (nargs < 0) return empty_unibyte_string;
 
   SAFE_ALLOCA_LISP (args, nargs);
 
@@ -4268,7 +4268,7 @@ base64_decode_1 (from, to, length, multibyte, nchars_return)
 
 /* The list of all weak hash tables.  Don't staticpro this one.  */
 
-Lisp_Object Vweak_hash_tables;
+struct Lisp_Hash_Table *weak_hash_tables;
 
 /* Various symbols.  */
 
@@ -4614,11 +4614,11 @@ make_hash_table (test, size, rehash_size, rehash_threshold, weak,
 
   /* Maybe add this hash table to the list of all weak hash tables.  */
   if (NILP (h->weak))
-    h->next_weak = Qnil;
+    h->next_weak = NULL;
   else
     {
-      h->next_weak = Vweak_hash_tables;
-      Vweak_hash_tables = table;
+      h->next_weak = weak_hash_tables;
+      weak_hash_tables = h;
     }
 
   return table;
@@ -4649,8 +4649,8 @@ copy_hash_table (h1)
   /* Maybe add this hash table to the list of all weak hash tables.  */
   if (!NILP (h2->weak))
     {
-      h2->next_weak = Vweak_hash_tables;
-      Vweak_hash_tables = table;
+      h2->next_weak = weak_hash_tables;
+      weak_hash_tables = h2;
     }
 
   return table;
@@ -4969,13 +4969,12 @@ sweep_weak_table (h, remove_entries_p)
 
 /* Remove elements from weak hash tables that don't survive the
    current garbage collection.  Remove weak tables that don't survive
-   from Vweak_hash_tables.  Called from gc_sweep.  */
+   from weak_hash_tables.  Called from gc_sweep.  */
 
 void
 sweep_weak_hash_tables ()
 {
-  Lisp_Object table, used, next;
-  struct Lisp_Hash_Table *h;
+  struct Lisp_Hash_Table *h, *used, *next;
   int marked;
 
   /* Mark all keys and values that are in use.  Keep on marking until
@@ -4987,9 +4986,8 @@ sweep_weak_hash_tables ()
   do
     {
       marked = 0;
-      for (table = Vweak_hash_tables; !GC_NILP (table); table = h->next_weak)
+      for (h = weak_hash_tables; h; h = h->next_weak)
        {
-         h = XHASH_TABLE (table);
          if (h->size & ARRAY_MARK_FLAG)
            marked |= sweep_weak_table (h, 0);
        }
@@ -4997,9 +4995,8 @@ sweep_weak_hash_tables ()
   while (marked);
 
   /* Remove tables and entries that aren't used.  */
-  for (table = Vweak_hash_tables, used = Qnil; !GC_NILP (table); table = next)
+  for (h = weak_hash_tables, used = NULL; h; h = next)
     {
-      h = XHASH_TABLE (table);
       next = h->next_weak;
 
       if (h->size & ARRAY_MARK_FLAG)
@@ -5010,11 +5007,11 @@ sweep_weak_hash_tables ()
 
          /* Add table to the list of used weak hash tables.  */
          h->next_weak = used;
-         used = table;
+         used = h;
        }
     }
 
-  Vweak_hash_tables = used;
+  weak_hash_tables = used;
 }
 
 
@@ -5915,7 +5912,7 @@ used if both `use-dialog-box' and this variable are non-nil.  */);
 void
 init_fns ()
 {
-  Vweak_hash_tables = Qnil;
+  weak_hash_tables = NULL;
 }
 
 /* arch-tag: 787f8219-5b74-46bd-8469-7e1cc475fa31
index b670e22..9056e2d 100644 (file)
@@ -1437,7 +1437,7 @@ If FRAME is omitted, it defaults to the currently selected frame.  */)
 {
   Lisp_Object fontset;
   FRAME_PTR f;
-  Lisp_Object indices[3];
+  int indices[3];
   Lisp_Object val, tail, elt;
   Lisp_Object *realized;
   struct font_info *fontp = NULL;
index 1fa4818..b29e20a 100644 (file)
@@ -1450,7 +1450,7 @@ and returns whatever that function returns.  */)
   f = SELECTED_FRAME ();
   x = y = Qnil;
 
-#ifdef HAVE_MOUSE
+#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
   /* It's okay for the hook to refrain from storing anything.  */
   if (mouse_position_hook)
     (*mouse_position_hook) (&f, -1,
@@ -1494,7 +1494,7 @@ and nil for X and Y.  */)
   f = SELECTED_FRAME ();
   x = y = Qnil;
 
-#ifdef HAVE_MOUSE
+#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
   /* It's okay for the hook to refrain from storing anything.  */
   if (mouse_position_hook)
     (*mouse_position_hook) (&f, -1,
@@ -1539,6 +1539,13 @@ before calling this function on it, like this.
       Fselect_frame (frame);
       mouse_moveto (XINT (x), XINT (y));
     }
+#else
+#ifdef HAVE_GPM
+    {
+      Fselect_frame (frame);
+      term_mouse_moveto (XINT (x), XINT (y));
+    }
+#endif
 #endif
 #endif
 
@@ -1574,6 +1581,13 @@ before calling this function on it, like this.
       Fselect_frame (frame);
       mouse_moveto (XINT (x), XINT (y));
     }
+#else
+#ifdef HAVE_GPM
+    {
+      Fselect_frame (frame);
+      term_mouse_moveto (XINT (x), XINT (y));
+    }
+#endif
 #endif
 #endif
 
index 1a827e7..d5e9f21 100644 (file)
@@ -214,7 +214,7 @@ struct frame
      be used for output.  */
   unsigned glyphs_initialized_p : 1;
 
-#if defined (USE_GTK)
+#if defined (USE_GTK) || defined (MAC_OS)
   /* Nonzero means using a tool bar that comes from the toolkit.  */
   int external_tool_bar;
 #endif
@@ -549,7 +549,7 @@ typedef struct frame *FRAME_PTR;
 
 /* Nonzero if this frame should display a tool bar
    in a way that does not use any text lines.  */
-#if defined (USE_GTK)
+#if defined (USE_GTK) || defined (MAC_OS)
 #define FRAME_EXTERNAL_TOOL_BAR(f) (f)->external_tool_bar
 #else
 #define FRAME_EXTERNAL_TOOL_BAR(f) 0
index 14e7478..1982362 100644 (file)
@@ -2137,6 +2137,20 @@ prepare_to_modify_buffer (start, end, preserve_ptr)
 #define FETCH_END                              \
   (! NILP (end_marker) ? Fmarker_position (end_marker) : end)
 
+/* Set a variable to nil if an error occurred.
+   VAL is a cons-cell whose car is the variable name, and whose cdr is
+   either nil (to mean that there was indeed an error), or non-nil to mean
+   that the was no error (which thus causes this function to do
+   nothing).  */
+Lisp_Object
+reset_var_on_error (val)
+     Lisp_Object val;
+{
+  if (NILP (XCDR (val)))
+    Fset (XCAR (val), Qnil);
+  return Qnil;
+}
+
 /* Signal a change to the buffer immediately before it happens.
    START_INT and END_INT are the bounds of the text to be changed.
 
@@ -2152,6 +2166,7 @@ signal_before_change (start_int, end_int, preserve_ptr)
   Lisp_Object start_marker, end_marker;
   Lisp_Object preserve_marker;
   struct gcpro gcpro1, gcpro2, gcpro3;
+  int count = SPECPDL_INDEX ();
 
   if (inhibit_modification_hooks)
     return;
@@ -2163,6 +2178,8 @@ signal_before_change (start_int, end_int, preserve_ptr)
   end_marker = Qnil;
   GCPRO3 (preserve_marker, start_marker, end_marker);
 
+  specbind (Qinhibit_modification_hooks, Qt);
+
   /* If buffer is unmodified, run a special hook for that case.  */
   if (SAVE_MODIFF >= MODIFF
       && !NILP (Vfirst_change_hook)
@@ -2177,46 +2194,22 @@ signal_before_change (start_int, end_int, preserve_ptr)
   if (!NILP (Vbefore_change_functions))
     {
       Lisp_Object args[3];
-      Lisp_Object before_change_functions;
-      Lisp_Object after_change_functions;
-      struct gcpro gcpro1, gcpro2;
-      struct buffer *old = current_buffer;
-      struct buffer *new;
+      Lisp_Object rvoe_arg = Fcons (Qbefore_change_functions, Qnil);
 
       PRESERVE_VALUE;
       PRESERVE_START_END;
 
-      /* "Bind" before-change-functions and after-change-functions
-        to nil--but in a way that errors don't know about.
-        That way, if there's an error in them, they will stay nil.  */
-      before_change_functions = Vbefore_change_functions;
-      after_change_functions = Vafter_change_functions;
-      Vbefore_change_functions = Qnil;
-      Vafter_change_functions = Qnil;
-      GCPRO2 (before_change_functions, after_change_functions);
+      /* Mark before-change-functions to be reset to nil in case of error.  */
+      record_unwind_protect (reset_var_on_error, rvoe_arg);
 
       /* Actually run the hook functions.  */
       args[0] = Qbefore_change_functions;
       args[1] = FETCH_START;
       args[2] = FETCH_END;
-      run_hook_list_with_args (before_change_functions, 3, args);
+      Frun_hook_with_args (3, args);
 
-      /* "Unbind" the variables we "bound" to nil.  Beware a
-        buffer-local hook which changes the buffer when run (e.g. W3).  */
-      if (old != current_buffer)
-       {
-         new = current_buffer;
-         set_buffer_internal (old);
-         Vbefore_change_functions = before_change_functions;
-         Vafter_change_functions = after_change_functions;
-         set_buffer_internal (new);
-       }
-      else
-       {
-         Vbefore_change_functions = before_change_functions;
-         Vafter_change_functions = after_change_functions;
-       }
-      UNGCPRO;
+      /* There was no error: unarm the reset_on_error.  */
+      XSETCDR (rvoe_arg, Qt);
     }
 
   if (current_buffer->overlays_before || current_buffer->overlays_after)
@@ -2232,6 +2225,8 @@ signal_before_change (start_int, end_int, preserve_ptr)
     free_marker (end_marker);
   RESTORE_VALUE;
   UNGCPRO;
+
+  unbind_to (count, Qnil);
 }
 
 /* Signal a change immediately after it happens.
@@ -2245,6 +2240,7 @@ void
 signal_after_change (charpos, lendel, lenins)
      int charpos, lendel, lenins;
 {
+  int count = SPECPDL_INDEX ();
   if (inhibit_modification_hooks)
     return;
 
@@ -2275,48 +2271,25 @@ signal_after_change (charpos, lendel, lenins)
   if (!NILP (combine_after_change_list))
     Fcombine_after_change_execute ();
 
+  specbind (Qinhibit_modification_hooks, Qt);
+
   if (!NILP (Vafter_change_functions))
     {
       Lisp_Object args[4];
-      Lisp_Object before_change_functions;
-      Lisp_Object after_change_functions;
-      struct buffer *old = current_buffer;
-      struct buffer *new;
-      struct gcpro gcpro1, gcpro2;
-
-      /* "Bind" before-change-functions and after-change-functions
-        to nil--but in a way that errors don't know about.
-        That way, if there's an error in them, they will stay nil.  */
-      before_change_functions = Vbefore_change_functions;
-      after_change_functions = Vafter_change_functions;
-      Vbefore_change_functions = Qnil;
-      Vafter_change_functions = Qnil;
-      GCPRO2 (before_change_functions, after_change_functions);
+      Lisp_Object rvoe_arg = Fcons (Qafter_change_functions, Qnil);
+
+      /* Mark after-change-functions to be reset to nil in case of error.  */
+      record_unwind_protect (reset_var_on_error, rvoe_arg);
 
       /* Actually run the hook functions.  */
       args[0] = Qafter_change_functions;
       XSETFASTINT (args[1], charpos);
       XSETFASTINT (args[2], charpos + lenins);
       XSETFASTINT (args[3], lendel);
-      run_hook_list_with_args (after_change_functions,
-                              4, args);
+      Frun_hook_with_args (4, args);
 
-      /* "Unbind" the variables we "bound" to nil.  Beware a
-        buffer-local hook which changes the buffer when run (e.g. W3).  */
-      if (old != current_buffer)
-       {
-         new = current_buffer;
-         set_buffer_internal (old);
-         Vbefore_change_functions = before_change_functions;
-         Vafter_change_functions = after_change_functions;
-         set_buffer_internal (new);
-       }
-      else
-       {
-         Vbefore_change_functions = before_change_functions;
-         Vafter_change_functions = after_change_functions;
-       }
-      UNGCPRO;
+      /* There was no error: unarm the reset_on_error.  */
+      XSETCDR (rvoe_arg, Qt);
     }
 
   if (current_buffer->overlays_before || current_buffer->overlays_after)
@@ -2332,6 +2305,8 @@ signal_after_change (charpos, lendel, lenins)
   if (lendel == 0)
     report_interval_modification (make_number (charpos),
                                  make_number (charpos + lenins));
+
+  unbind_to (count, Qnil);
 }
 
 Lisp_Object
index 171f2da..c542d29 100644 (file)
@@ -521,7 +521,7 @@ Lisp_Object Qmake_frame_visible;
 Lisp_Object Qselect_window;
 Lisp_Object Qhelp_echo;
 
-#ifdef HAVE_MOUSE
+#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
 Lisp_Object Qmouse_fixup_help_message;
 #endif
 
@@ -677,7 +677,7 @@ static Lisp_Object read_char_x_menu_prompt ();
 static Lisp_Object read_char_minibuf_menu_prompt P_ ((int, int,
                                                      Lisp_Object *));
 static Lisp_Object make_lispy_event P_ ((struct input_event *));
-#ifdef HAVE_MOUSE
+#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
 static Lisp_Object make_lispy_movement P_ ((struct frame *, Lisp_Object,
                                            enum scroll_bar_part,
                                            Lisp_Object, Lisp_Object,
@@ -1249,7 +1249,7 @@ cmd_error_internal (data, context)
   /* Use user's specified output function if any.  */
   if (!NILP (Vcommand_error_function))
     call3 (Vcommand_error_function, data,
-          build_string (context ? context : ""),
+          context ? build_string (context) : empty_unibyte_string,
           Vsignaling_function);
   /* If the window system or terminal frame hasn't been initialized
      yet, or we're not interactive, write the message to stderr and exit.  */
@@ -1390,7 +1390,7 @@ DEFUN ("abort-recursive-edit", Fabort_recursive_edit, Sabort_recursive_edit, 0,
   return Qnil;
 }
 \f
-#ifdef HAVE_MOUSE
+#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
 
 /* Restore mouse tracking enablement.  See Ftrack_mouse for the only use
    of this function.  */
@@ -1466,7 +1466,7 @@ some_mouse_moved ()
   return 0;
 }
 
-#endif /* HAVE_MOUSE */
+#endif /* HAVE_MOUSE || HAVE_GPM */
 \f
 /* This is the actual command reading loop,
    sans error-handling encapsulation.  */
@@ -2388,7 +2388,7 @@ show_help_echo (help, window, object, pos, ok_to_overwrite_keystroke_echo)
        return;
     }
 
-#ifdef HAVE_MOUSE
+#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
   if (!noninteractive && STRINGP (help))
     {
       /* The mouse-fixup-help-message Lisp function can call
@@ -3640,7 +3640,7 @@ readable_events (flags)
        return 1;
     }
 
-#ifdef HAVE_MOUSE
+#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
   if (!(flags & READABLE_EVENTS_IGNORE_SQUEEZABLES)
       && !NILP (do_mouse_tracking) && some_mouse_moved ())
     return 1;
@@ -3917,6 +3917,9 @@ discard_mouse_events ()
          || sp->kind == WHEEL_EVENT
 #ifdef WINDOWSNT
          || sp->kind == W32_SCROLL_BAR_CLICK_EVENT
+#endif
+#ifdef HAVE_GPM
+         || sp->kind == GPM_CLICK_EVENT
 #endif
          || sp->kind == SCROLL_BAR_CLICK_EVENT)
        {
@@ -3992,7 +3995,7 @@ kbd_buffer_get_event (kbp, used_mouse_menu, end_time)
     {
       if (kbd_fetch_ptr != kbd_store_ptr)
        break;
-#ifdef HAVE_MOUSE
+#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
       if (!NILP (do_mouse_tracking) && some_mouse_moved ())
        break;
 #endif
@@ -4014,7 +4017,7 @@ kbd_buffer_get_event (kbp, used_mouse_menu, end_time)
 #endif /* SIGIO */
       if (kbd_fetch_ptr != kbd_store_ptr)
        break;
-#ifdef HAVE_MOUSE
+#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
       if (!NILP (do_mouse_tracking) && some_mouse_moved ())
        break;
 #endif
@@ -4250,7 +4253,7 @@ kbd_buffer_get_event (kbp, used_mouse_menu, end_time)
            }
        }
     }
-#ifdef HAVE_MOUSE
+#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
   /* Try generating a mouse motion event.  */
   else if (!NILP (do_mouse_tracking) && some_mouse_moved ())
     {
@@ -4291,7 +4294,7 @@ kbd_buffer_get_event (kbp, used_mouse_menu, end_time)
       if (!NILP (x) && NILP (obj))
        obj = make_lispy_movement (f, bar_window, part, x, y, time);
     }
-#endif /* HAVE_MOUSE */
+#endif /* HAVE_MOUSE || HAVE GPM */
   else
     /* We were promised by the above while loop that there was
        something for us to read!  */
@@ -6008,13 +6011,73 @@ make_lispy_event (event)
       }
 #endif
 
+#ifdef HAVE_GPM
+    case GPM_CLICK_EVENT:
+      {
+       FRAME_PTR f = XFRAME (event->frame_or_window);
+       Lisp_Object head, position;
+       Lisp_Object *start_pos_ptr;
+       Lisp_Object start_pos;
+       int button = event->code;
+
+       if (button >= ASIZE (button_down_location))
+         {
+           button_down_location = larger_vector (button_down_location,
+                                                 button + 1, Qnil);
+           mouse_syms = larger_vector (mouse_syms, button + 1, Qnil);
+         }
+
+       start_pos_ptr = &AREF (button_down_location, button);
+       start_pos = *start_pos_ptr;
+
+       position = make_lispy_position (f, &event->x, &event->y,
+                                           event->timestamp);
+
+       if (event->modifiers & down_modifier)
+         *start_pos_ptr = Fcopy_alist (position);
+       else if (event->modifiers & (up_modifier | drag_modifier))
+         {
+           if (!CONSP (start_pos))
+             return Qnil;
+           event->modifiers &= ~up_modifier;
+         }
+
+       head = modify_event_symbol (button,
+                                   event->modifiers,
+                                   Qmouse_click, Vlispy_mouse_stem,
+                                   NULL,
+                                   &mouse_syms,
+                                   XVECTOR (mouse_syms)->size);
+
+       if (event->modifiers & drag_modifier)
+         return Fcons (head,
+                       Fcons (start_pos,
+                              Fcons (position,
+                                     Qnil)));
+       else if (event->modifiers & double_modifier)
+         return Fcons (head,
+                       Fcons (position,
+                              Fcons (make_number (2),
+                                     Qnil)));
+       else if (event->modifiers & triple_modifier)
+         return Fcons (head,
+                       Fcons (position,
+                              Fcons (make_number (3),
+                                     Qnil)));
+       else
+         return Fcons (head,
+                       Fcons (position,
+                              Qnil));
+       }
+#endif /* HAVE_GPM */
+
       /* The 'kind' field of the event is something we don't recognize.  */
     default:
       abort ();
     }
 }
 
-#ifdef HAVE_MOUSE
+#if defined(HAVE_MOUSE) || defined(HAVE_GPM)
 
 static Lisp_Object
 make_lispy_movement (frame, bar_window, part, x, y, time)
@@ -6053,7 +6116,7 @@ make_lispy_movement (frame, bar_window, part, x, y, time)
     }
 }
 
-#endif /* HAVE_MOUSE */
+#endif /* HAVE_MOUSE || HAVE GPM */
 
 /* Construct a switch frame event.  */
 static Lisp_Object
@@ -6865,8 +6928,28 @@ read_avail_input (expected)
       if (n_to_read == 0)
        return 0;
 #else /* not MSDOS */
+#ifdef HAVE_GPM
+      if (term_gpm)
+       {
+         Gpm_Event event;
+         struct input_event hold_quit;
+         int gpm;
+
+         EVENT_INIT (hold_quit);
+         hold_quit.kind = NO_EVENT;
+
+         while (gpm = Gpm_GetEvent (&event), gpm == 1) {
+           nread += handle_one_term_event (&event, &hold_quit);
+         }
+         if (hold_quit.kind != NO_EVENT)
+           kbd_buffer_store_event (&hold_quit);
+         if (nread)
+           return nread;
+       }
+#endif /* HAVE_GPM */
 #ifdef FIONREAD
-      /* Find out how much input is available.  */
+
+     /* Find out how much input is available.  */
       if (ioctl (input_fd, FIONREAD, &n_to_read) < 0)
        /* Formerly simply reported no input, but that sometimes led to
           a failure of Emacs to terminate.
@@ -11045,7 +11128,7 @@ init_keyboard ()
   recent_keys_index = 0;
   kbd_fetch_ptr = kbd_buffer;
   kbd_store_ptr = kbd_buffer;
-#ifdef HAVE_MOUSE
+#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
   do_mouse_tracking = Qnil;
 #endif
   input_pending = 0;
@@ -11235,7 +11318,7 @@ syms_of_keyboard ()
   Qmenu_bar = intern ("menu-bar");
   staticpro (&Qmenu_bar);
 
-#ifdef HAVE_MOUSE
+#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
   Qmouse_fixup_help_message = intern ("mouse-fixup-help-message");
   staticpro (&Qmouse_fixup_help_message);
 #endif
@@ -11367,7 +11450,7 @@ syms_of_keyboard ()
   defsubr (&Sread_key_sequence);
   defsubr (&Sread_key_sequence_vector);
   defsubr (&Srecursive_edit);
-#ifdef HAVE_MOUSE
+#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
   defsubr (&Strack_mouse);
 #endif
   defsubr (&Sinput_pending_p);
index e1e45b1..2c76005 100644 (file)
@@ -429,7 +429,7 @@ Return PARENT.  PARENT should be nil or another keymap.  */)
 
       if (CHAR_TABLE_P (XCAR (list)))
        {
-         Lisp_Object indices[3];
+         int indices[3];
 
          map_char_table (fix_submap_inheritance, Qnil,
                          XCAR (list), XCAR (list),
@@ -728,7 +728,7 @@ map_keymap (map, fun, args, data, autoload)
        }
       else if (CHAR_TABLE_P (binding))
        {
-         Lisp_Object indices[3];
+         int indices[3];
          map_char_table (map_keymap_char_table_item, Qnil, binding, binding,
                          Fcons (make_save_value (fun, 0),
                                 Fcons (make_save_value (data, 0),
@@ -1079,7 +1079,7 @@ is not copied.  */)
       Lisp_Object elt = XCAR (keymap);
       if (CHAR_TABLE_P (elt))
        {
-         Lisp_Object indices[3];
+         int indices[3];
          elt = Fcopy_sequence (elt);
          map_char_table (copy_keymap_1, Qnil, elt, elt, elt, 0, indices);
        }
@@ -1156,7 +1156,8 @@ binding KEY to DEF is added at the front of KEYMAP.  */)
   if (SYMBOLP (def) && !EQ (Vdefine_key_rebound_commands, Qt))
     Vdefine_key_rebound_commands = Fcons (def, Vdefine_key_rebound_commands);
 
-  meta_bit = VECTORP (key) ? meta_modifier : 0x80;
+  meta_bit = (VECTORP (key) || (STRINGP (key) && STRING_MULTIBYTE (key))
+             ? meta_modifier : 0x80);
 
   if (VECTORP (def) && ASIZE (def) > 0 && CONSP (AREF (def, 0)))
     { /* DEF is apparently an XEmacs-style keyboard macro.  */
@@ -1312,7 +1313,7 @@ recognize the default bindings, just as `read-key-sequence' does.  */)
        c = Fevent_convert_list (c);
 
       /* Turn the 8th bit of string chars into a meta modifier.  */
-      if (INTEGERP (c) && XINT (c) & 0x80 && STRINGP (key))
+      if (STRINGP (key) && XINT (c) & 0x80 && !STRING_MULTIBYTE (key))
        XSETINT (c, (XINT (c) | meta_modifier) & ~0x80);
 
       /* Allow string since binding for `menu-bar-select-buffer'
@@ -1540,14 +1541,47 @@ current_minor_maps (modeptr, mapptr)
 }
 
 DEFUN ("current-active-maps", Fcurrent_active_maps, Scurrent_active_maps,
-       0, 1, 0,
+       0, 2, 0,
        doc: /* Return a list of the currently active keymaps.
 OLP if non-nil indicates that we should obey `overriding-local-map' and
-`overriding-terminal-local-map'.  */)
-     (olp)
-     Lisp_Object olp;
+`overriding-terminal-local-map'.  POSITION can specify a click position
+like in the respective argument of `key-binding'. */)
+    (olp, position)
+    Lisp_Object olp, position;
 {
-  Lisp_Object keymaps = Fcons (current_global_map, Qnil);
+  int count = SPECPDL_INDEX ();
+
+  Lisp_Object keymaps;
+
+  /* If a mouse click position is given, our variables are based on
+     the buffer clicked on, not the current buffer.  So we may have to
+     switch the buffer here. */
+  
+  if (CONSP (position))
+    {
+      Lisp_Object window;
+      
+      window = POSN_WINDOW (position);
+         
+      if (WINDOWP (window)
+         && BUFFERP (XWINDOW (window)->buffer)
+         && XBUFFER (XWINDOW (window)->buffer) != current_buffer)
+       {
+         /* Arrange to go back to the original buffer once we're done
+            processing the key sequence.  We don't use
+            save_excursion_{save,restore} here, in analogy to
+            `read-key-sequence' to avoid saving point.  Maybe this
+            would not be a problem here, but it is easier to keep
+            things the same.
+         */
+             
+         record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
+         
+         set_buffer_internal (XBUFFER (XWINDOW (window)->buffer));
+       }
+    }
+
+  keymaps = Fcons (current_global_map, Qnil);  
 
   if (!NILP (olp))
     {
@@ -1561,15 +1595,76 @@ OLP if non-nil indicates that we should obey `overriding-local-map' and
     }
   if (NILP (XCDR (keymaps)))
     {
-      Lisp_Object local;
       Lisp_Object *maps;
       int nmaps, i;
 
-      /* This usually returns the buffer's local map,
-        but that can be overridden by a `local-map' property.  */
-      local = get_local_map (PT, current_buffer, Qlocal_map);
-      if (!NILP (local))
-       keymaps = Fcons (local, keymaps);
+      Lisp_Object keymap, local_map;
+      EMACS_INT pt;
+
+      pt = INTEGERP (position) ? XINT (position)
+       : MARKERP (position) ? marker_position (position)
+       : PT;
+
+      /* Get the buffer local maps, possibly overriden by text or
+        overlay properties */
+
+      local_map = get_local_map (pt, current_buffer, Qlocal_map); 
+      keymap = get_local_map (pt, current_buffer, Qkeymap); 
+
+      if (CONSP (position))
+       {
+         Lisp_Object string;
+
+         /* For a mouse click, get the local text-property keymap
+            of the place clicked on, rather than point.  */
+         
+         if (POSN_INBUFFER_P (position))
+           {
+             Lisp_Object pos;
+
+             pos = POSN_BUFFER_POSN (position);
+             if (INTEGERP (pos)
+                 && XINT (pos) >= BEG && XINT (pos) <= Z)
+               {
+                 local_map = get_local_map (XINT (pos),
+                                            current_buffer, Qlocal_map);
+                 
+                 keymap = get_local_map (XINT (pos),
+                                         current_buffer, Qkeymap);
+               }
+           }
+
+         /* If on a mode line string with a local keymap,
+            or for a click on a string, i.e. overlay string or a
+            string displayed via the `display' property,
+            consider `local-map' and `keymap' properties of
+            that string.  */
+         
+         if (string = POSN_STRING (position),
+             (CONSP (string) && STRINGP (XCAR (string))))
+           {
+             Lisp_Object pos, map;
+             
+             pos = XCDR (string);
+             string = XCAR (string);
+             if (INTEGERP (pos)
+                 && XINT (pos) >= 0
+                 && XINT (pos) < SCHARS (string))
+               {
+                 map = Fget_text_property (pos, Qlocal_map, string);
+                 if (!NILP (map))
+                   local_map = map;
+
+                 map = Fget_text_property (pos, Qkeymap, string);
+                 if (!NILP (map))
+                   keymap = map;
+               }
+           }
+         
+       }
+
+      if (!NILP (local_map))
+       keymaps = Fcons (local_map, keymaps);
 
       /* Now put all the minor mode keymaps on the list.  */
       nmaps = current_minor_maps (0, &maps);
@@ -1578,12 +1673,12 @@ OLP if non-nil indicates that we should obey `overriding-local-map' and
        if (!NILP (maps[i]))
          keymaps = Fcons (maps[i], keymaps);
 
-      /* This returns nil unless there is a `keymap' property.  */
-      local = get_local_map (PT, current_buffer, Qkeymap);
-      if (!NILP (local))
-       keymaps = Fcons (local, keymaps);
+      if (!NILP (keymap))
+       keymaps = Fcons (keymap, keymaps);
     }
 
+  unbind_to (count, Qnil);
+
   return keymaps;
 }
 
@@ -1951,12 +2046,23 @@ DEFUN ("current-minor-mode-maps", Fcurrent_minor_mode_maps, Scurrent_minor_mode_
 \f
 /* Help functions for describing and documenting keymaps.              */
 
+struct accessible_keymaps_data {
+  Lisp_Object maps, tail, thisseq;
+  /* Does the current sequence end in the meta-prefix-char?  */
+  int is_metized;
+};
 
 static void
-accessible_keymaps_1 (key, cmd, maps, tail, thisseq, is_metized)
-     Lisp_Object maps, tail, thisseq, key, cmd;
-     int is_metized;           /* If 1, `key' is assumed to be INTEGERP.  */
+accessible_keymaps_1 (key, cmd, args, data)
+     Lisp_Object key, cmd, args;
+     /* Use void* to be compatible with map_keymap_function_t.  */
+     void *data;
 {
+  struct accessible_keymaps_data *d = data; /* Cast! */
+  Lisp_Object maps = d->maps;
+  Lisp_Object tail = d->tail;
+  Lisp_Object thisseq = d->thisseq;
+  int is_metized = d->is_metized && INTEGERP (key);
   Lisp_Object tem;
 
   cmd = get_keymap (get_keyelt (cmd, 0), 0, 0);
@@ -2010,17 +2116,6 @@ accessible_keymaps_1 (key, cmd, maps, tail, thisseq, is_metized)
     }
 }
 
-static void
-accessible_keymaps_char_table (args, index, cmd)
-     Lisp_Object args, index, cmd;
-{
-  accessible_keymaps_1 (index, cmd,
-                       XCAR (XCAR (args)),
-                       XCAR (XCDR (args)),
-                       XCDR (XCDR (args)),
-                       XINT (XCDR (XCAR (args))));
-}
-
 /* This function cannot GC.  */
 
 DEFUN ("accessible-keymaps", Faccessible_keymaps, Saccessible_keymaps,
@@ -2035,13 +2130,10 @@ then the value includes only maps for prefixes that start with PREFIX.  */)
      Lisp_Object keymap, prefix;
 {
   Lisp_Object maps, tail;
-  int prefixlen = 0;
+  int prefixlen = XINT (Flength (prefix));
 
   /* no need for gcpro because we don't autoload any keymaps.  */
 
-  if (!NILP (prefix))
-    prefixlen = XINT (Flength (prefix));
-
   if (!NILP (prefix))
     {
       /* If a prefix was specified, start with the keymap (if any) for
@@ -2052,7 +2144,9 @@ then the value includes only maps for prefixes that start with PREFIX.  */)
         if the prefix is not defined in this particular map.
         It might even give us a list that isn't a keymap.  */
       tem = get_keymap (tem, 0, 0);
-      if (CONSP (tem))
+      /* If the keymap is autoloaded `tem' is not a cons-cell, but we still
+        want to return it.  */
+      if (!NILP (tem))
        {
          /* Convert PREFIX to a vector now, so that later on
             we don't have to deal with the possibility of a string.  */
@@ -2092,57 +2186,26 @@ then the value includes only maps for prefixes that start with PREFIX.  */)
 
   for (tail = maps; CONSP (tail); tail = XCDR (tail))
     {
-      register Lisp_Object thisseq, thismap;
+      struct accessible_keymaps_data data;
+      register Lisp_Object thismap = Fcdr (XCAR (tail));
       Lisp_Object last;
-      /* Does the current sequence end in the meta-prefix-char?  */
-      int is_metized;
 
-      thisseq = Fcar (Fcar (tail));
-      thismap = Fcdr (Fcar (tail));
-      last = make_number (XINT (Flength (thisseq)) - 1);
-      is_metized = (XINT (last) >= 0
+      data.thisseq = Fcar (XCAR (tail));
+      data.maps = maps;
+      data.tail = tail;
+      last = make_number (XINT (Flength (data.thisseq)) - 1);
+      /* Does the current sequence end in the meta-prefix-char?  */
+      data.is_metized = (XINT (last) >= 0
                    /* Don't metize the last char of PREFIX.  */
                    && XINT (last) >= prefixlen
-                   && EQ (Faref (thisseq, last), meta_prefix_char));
-
-      for (; CONSP (thismap); thismap = XCDR (thismap))
-       {
-         Lisp_Object elt;
-
-         elt = XCAR (thismap);
-
-         QUIT;
-
-         if (CHAR_TABLE_P (elt))
-           {
-             Lisp_Object indices[3];
-
-             map_char_table (accessible_keymaps_char_table, Qnil, elt,
-                             elt, Fcons (Fcons (maps, make_number (is_metized)),
-                                         Fcons (tail, thisseq)),
-                             0, indices);
-           }
-         else if (VECTORP (elt))
-           {
-             register int i;
-
-             /* Vector keymap.  Scan all the elements.  */
-             for (i = 0; i < ASIZE (elt); i++)
-               accessible_keymaps_1 (make_number (i), AREF (elt, i),
-                                     maps, tail, thisseq, is_metized);
+                   && EQ (Faref (data.thisseq, last), meta_prefix_char));
 
-           }
-         else if (CONSP (elt))
-           accessible_keymaps_1 (XCAR (elt), XCDR (elt),
-                                 maps, tail, thisseq,
-                                 is_metized && INTEGERP (XCAR (elt)));
-
-       }
+      /* Since we can't run lisp code, we can't scan autoloaded maps.  */
+      if (CONSP (thismap))
+       map_keymap (thismap, accessible_keymaps_1, Qnil, &data, 0);
     }
-
   return maps;
 }
-\f
 Lisp_Object Qsingle_key_description, Qkey_description;
 
 /* This function cannot GC.  */
@@ -2187,7 +2250,7 @@ spaces are put between sequence elements, etc.  */)
          len += 2;
        }
       else if (len == 0)
-       return empty_string;
+       return empty_unibyte_string;
       return Fconcat (len - 1, args);
     }
 
@@ -2413,7 +2476,7 @@ around function keys and event symbols.  */)
        {
          char buf[256];
 
-         sprintf (buf, "Invalid char code %d", XINT (key));
+         sprintf (buf, "Invalid char code %ld", XINT (key));
          return build_string (buf);
        }
       else if (charset
@@ -2556,8 +2619,8 @@ ascii_sequence_p (seq)
 /* where-is - finding a command in a set of keymaps.                   */
 
 static Lisp_Object where_is_internal ();
-static Lisp_Object where_is_internal_1 ();
-static void where_is_internal_2 ();
+static void where_is_internal_1 P_ ((Lisp_Object key, Lisp_Object binding,
+                                    Lisp_Object args, void *data));
 
 /* Like Flookup_key, but uses a list of keymaps SHADOW instead of a single map.
    Returns the first non-nil binding found in any of those maps.  */
@@ -2586,6 +2649,12 @@ shadow_lookup (shadow, key, flag)
 
 static Lisp_Object Vmouse_events;
 
+struct where_is_internal_data {
+  Lisp_Object definition, noindirect, this, last;
+  int last_is_meta;
+  Lisp_Object sequences;
+};
+
 /* This function can GC if Flookup_key autoloads any keymaps.  */
 
 static Lisp_Object
@@ -2623,6 +2692,7 @@ where_is_internal (definition, keymaps, firstonly, noindirect, no_remap)
     {
       /* Key sequence to reach map, and the map that it reaches */
       register Lisp_Object this, map, tem;
+      struct where_is_internal_data data;
 
       /* In order to fold [META-PREFIX-CHAR CHAR] sequences into
         [M-CHAR] sequences, check if last character of the sequence
@@ -2647,148 +2717,94 @@ where_is_internal (definition, keymaps, firstonly, noindirect, no_remap)
 
       QUIT;
 
-      while (CONSP (map))
-       {
-         /* Because the code we want to run on each binding is rather
-            large, we don't want to have two separate loop bodies for
-            sparse keymap bindings and tables; we want to iterate one
-            loop body over both keymap and vector bindings.
+      data.definition = definition;
+      data.noindirect = noindirect;
+      data.this = this;
+      data.last = last;
+      data.last_is_meta = last_is_meta;
+      data.sequences = Qnil;
 
-            For this reason, if Fcar (map) is a vector, we don't
-            advance map to the next element until i indicates that we
-            have finished off the vector.  */
-         Lisp_Object elt, key, binding;
-         elt = XCAR (map);
-         map = XCDR (map);
+      if (CONSP (map))
+       map_keymap (map, where_is_internal_1, Qnil, &data, 0);
 
-         sequences = Qnil;
+      sequences = data.sequences;
 
-         QUIT;
-
-         /* Set key and binding to the current key and binding, and
-            advance map and i to the next binding.  */
-         if (VECTORP (elt))
+      while (CONSP (sequences))
+       {
+         Lisp_Object sequence, remapped, function;
+         
+         sequence = XCAR (sequences);
+         sequences = XCDR (sequences);
+
+         /* If the current sequence is a command remapping with
+            format [remap COMMAND], find the key sequences
+            which run COMMAND, and use those sequences instead.  */
+         remapped = Qnil;
+         if (NILP (no_remap)
+             && VECTORP (sequence) && XVECTOR (sequence)->size == 2
+             && EQ (AREF (sequence, 0), Qremap)
+             && (function = AREF (sequence, 1), SYMBOLP (function)))
            {
-             Lisp_Object sequence;
-             int i;
-             /* In a vector, look at each element.  */
-             for (i = 0; i < XVECTOR (elt)->size; i++)
+             Lisp_Object remapped1;
+             
+             remapped1 = where_is_internal (function, keymaps, firstonly, noindirect, Qt);
+             if (CONSP (remapped1))
                {
-                 binding = AREF (elt, i);
-                 XSETFASTINT (key, i);
-                 sequence = where_is_internal_1 (binding, key, definition,
-                                                 noindirect, this,
-                                                 last, nomenus, last_is_meta);
-                 if (!NILP (sequence))
-                   sequences = Fcons (sequence, sequences);
+                 /* Verify that this key binding actually maps to the
+                    remapped command (see below).  */
+                 if (!EQ (shadow_lookup (keymaps, XCAR (remapped1), Qnil), function))
+                   continue;
+                 sequence = XCAR (remapped1);
+                 remapped = XCDR (remapped1);
+                 goto record_sequence;
                }
            }
-         else if (CHAR_TABLE_P (elt))
-           {
-             Lisp_Object indices[3];
-             Lisp_Object args;
-
-             args = Fcons (Fcons (Fcons (definition, noindirect),
-                                  Qnil), /* Result accumulator.  */
-                           Fcons (Fcons (this, last),
-                                  Fcons (make_number (nomenus),
-                                         make_number (last_is_meta))));
-             map_char_table (where_is_internal_2, Qnil, elt, elt, args,
-                             0, indices);
-             sequences = XCDR (XCAR (args));
-           }
-         else if (CONSP (elt))
-           {
-             Lisp_Object sequence;
 
-             key = XCAR (elt);
-             binding = XCDR (elt);
+         /* Verify that this key binding is not shadowed by another
+            binding for the same key, before we say it exists.
 
-             sequence = where_is_internal_1 (binding, key, definition,
-                                             noindirect, this,
-                                             last, nomenus, last_is_meta);
-             if (!NILP (sequence))
-               sequences = Fcons (sequence, sequences);
-           }
+            Mechanism: look for local definition of this key and if
+            it is defined and does not match what we found then
+            ignore this key.
 
+            Either nil or number as value from Flookup_key
+            means undefined.  */
+         if (!EQ (shadow_lookup (keymaps, sequence, Qnil), definition))
+           continue;
 
-         while (!NILP (sequences))
+       record_sequence:
+         /* Don't annoy user with strings from a menu such as
+            Select Paste.  Change them all to "(any string)",
+            so that there seems to be only one menu item
+            to report. */
+         if (! NILP (sequence))
            {
-             Lisp_Object sequence, remapped, function;
-
-             sequence = XCAR (sequences);
-             sequences = XCDR (sequences);
-
-             /* If the current sequence is a command remapping with
-                format [remap COMMAND], find the key sequences
-                which run COMMAND, and use those sequences instead.  */
-             remapped = Qnil;
-             if (NILP (no_remap)
-                 && VECTORP (sequence) && XVECTOR (sequence)->size == 2
-                 && EQ (AREF (sequence, 0), Qremap)
-                 && (function = AREF (sequence, 1), SYMBOLP (function)))
-               {
-                 Lisp_Object remapped1;
-
-                 remapped1 = where_is_internal (function, keymaps, firstonly, noindirect, Qt);
-                 if (CONSP (remapped1))
-                   {
-                     /* Verify that this key binding actually maps to the
-                        remapped command (see below).  */
-                     if (!EQ (shadow_lookup (keymaps, XCAR (remapped1), Qnil), function))
-                       continue;
-                     sequence = XCAR (remapped1);
-                     remapped = XCDR (remapped1);
-                     goto record_sequence;
-                   }
-               }
-
-             /* Verify that this key binding is not shadowed by another
-                binding for the same key, before we say it exists.
-
-                Mechanism: look for local definition of this key and if
-                it is defined and does not match what we found then
-                ignore this key.
-
-                Either nil or number as value from Flookup_key
-                means undefined.  */
-             if (!EQ (shadow_lookup (keymaps, sequence, Qnil), definition))
-               continue;
-
-           record_sequence:
-             /* Don't annoy user with strings from a menu such as
-                Select Paste.  Change them all to "(any string)",
-                so that there seems to be only one menu item
-                to report. */
-             if (! NILP (sequence))
-               {
-                 Lisp_Object tem;
-                 tem = Faref (sequence, make_number (XVECTOR (sequence)->size - 1));
-                 if (STRINGP (tem))
-                   Faset (sequence, make_number (XVECTOR (sequence)->size - 1),
-                          build_string ("(any string)"));
-               }
+             Lisp_Object tem;
+             tem = Faref (sequence, make_number (XVECTOR (sequence)->size - 1));
+             if (STRINGP (tem))
+               Faset (sequence, make_number (XVECTOR (sequence)->size - 1),
+                      build_string ("(any string)"));
+           }
 
-             /* It is a true unshadowed match.  Record it, unless it's already
-                been seen (as could happen when inheriting keymaps).  */
-             if (NILP (Fmember (sequence, found)))
-               found = Fcons (sequence, found);
-
-             /* If firstonly is Qnon_ascii, then we can return the first
-                binding we find.  If firstonly is not Qnon_ascii but not
-                nil, then we should return the first ascii-only binding
-                we find.  */
-             if (EQ (firstonly, Qnon_ascii))
-               RETURN_UNGCPRO (sequence);
-             else if (!NILP (firstonly) && ascii_sequence_p (sequence))
-               RETURN_UNGCPRO (sequence);
-
-             if (CONSP (remapped))
-               {
-                 sequence = XCAR (remapped);
-                 remapped = XCDR (remapped);
-                 goto record_sequence;
-               }
+         /* It is a true unshadowed match.  Record it, unless it's already
+            been seen (as could happen when inheriting keymaps).  */
+         if (NILP (Fmember (sequence, found)))
+           found = Fcons (sequence, found);
+
+         /* If firstonly is Qnon_ascii, then we can return the first
+            binding we find.  If firstonly is not Qnon_ascii but not
+            nil, then we should return the first ascii-only binding
+            we find.  */
+         if (EQ (firstonly, Qnon_ascii))
+           RETURN_UNGCPRO (sequence);
+         else if (!NILP (firstonly) && ascii_sequence_p (sequence))
+           RETURN_UNGCPRO (sequence);
+
+         if (CONSP (remapped))
+           {
+             sequence = XCAR (remapped);
+             remapped = XCDR (remapped);
+             goto record_sequence;
            }
        }
     }
@@ -2841,7 +2857,7 @@ remapped command in the returned list.  */)
   else if (!NILP (keymap))
     keymaps = Fcons (keymap, Fcons (current_global_map, Qnil));
   else
-    keymaps = Fcurrent_active_maps (Qnil);
+    keymaps = Fcurrent_active_maps (Qnil, Qnil);
 
   /* Only use caching for the menubar (i.e. called with (def nil t nil).
      We don't really need to check `keymap'.  */
@@ -2907,53 +2923,19 @@ remapped command in the returned list.  */)
   return result;
 }
 
-/* This is the function that Fwhere_is_internal calls using map_char_table.
-   ARGS has the form
-   (((DEFINITION . NOINDIRECT) . (KEYMAP . RESULT))
-    .
-    ((THIS . LAST) . (NOMENUS . LAST_IS_META)))
-   Since map_char_table doesn't really use the return value from this function,
-   we the result append to RESULT, the slot in ARGS.
-
-   This function can GC because it calls where_is_internal_1 which can
-   GC.  */
-
-static void
-where_is_internal_2 (args, key, binding)
-     Lisp_Object args, key, binding;
-{
-  Lisp_Object definition, noindirect, this, last;
-  Lisp_Object result, sequence;
-  int nomenus, last_is_meta;
-  struct gcpro gcpro1, gcpro2, gcpro3;
-
-  GCPRO3 (args, key, binding);
-  result = XCDR (XCAR (args));
-  definition = XCAR (XCAR (XCAR (args)));
-  noindirect = XCDR (XCAR (XCAR (args)));
-  this = XCAR (XCAR (XCDR (args)));
-  last = XCDR (XCAR (XCDR (args)));
-  nomenus = XFASTINT (XCAR (XCDR (XCDR (args))));
-  last_is_meta = XFASTINT (XCDR (XCDR (XCDR (args))));
-
-  sequence = where_is_internal_1 (binding, key, definition, noindirect,
-                                 this, last, nomenus, last_is_meta);
-
-  if (!NILP (sequence))
-    XSETCDR (XCAR (args), Fcons (sequence, result));
-
-  UNGCPRO;
-}
-
-
 /* This function can GC because get_keyelt can.  */
 
-static Lisp_Object
-where_is_internal_1 (binding, key, definition, noindirect, this, last,
-                    nomenus, last_is_meta)
-     Lisp_Object binding, key, definition, noindirect, this, last;
-     int nomenus, last_is_meta;
+static void
+where_is_internal_1 (key, binding, args, data)
+     Lisp_Object key, binding, args;
+     void *data;
 {
+  struct where_is_internal_data *d = data; /* Cast! */
+  Lisp_Object definition = d->definition;
+  Lisp_Object noindirect = d->noindirect;
+  Lisp_Object this = d->this;
+  Lisp_Object last = d->last;
+  int last_is_meta = d->last_is_meta;
   Lisp_Object sequence;
 
   /* Search through indirections unless that's not wanted.  */
@@ -2967,7 +2949,7 @@ where_is_internal_1 (binding, key, definition, noindirect, this, last,
        || EQ (binding, definition)
        || (CONSP (definition) && !NILP (Fequal (binding, definition)))))
     /* Doesn't match.  */
-    return Qnil;
+    return;
 
   /* We have found a match.  Construct the key sequence where we found it.  */
   if (INTEGERP (key) && last_is_meta)
@@ -2982,10 +2964,9 @@ where_is_internal_1 (binding, key, definition, noindirect, this, last,
     {
       Lisp_Object sequences = Fgethash (binding, where_is_cache, Qnil);
       Fputhash (binding, Fcons (sequence, sequences), where_is_cache);
-      return Qnil;
     }
   else
-    return sequence;
+    d->sequences = Fcons (sequence, d->sequences);
 }
 \f
 /* describe-bindings - summarizing all the bindings in a set of keymaps.  */
index 8b92185..1a51de7 100644 (file)
@@ -34,7 +34,7 @@ EXFUN (Fkey_binding, 4);
 EXFUN (Fkey_description, 2);
 EXFUN (Fsingle_key_description, 2);
 EXFUN (Fwhere_is_internal, 5);
-EXFUN (Fcurrent_active_maps, 1);
+EXFUN (Fcurrent_active_maps, 2);
 extern Lisp_Object access_keymap P_ ((Lisp_Object, Lisp_Object, int, int, int));
 extern Lisp_Object get_keyelt P_ ((Lisp_Object, int));
 extern Lisp_Object get_keymap P_ ((Lisp_Object, int, int));
@@ -47,7 +47,7 @@ extern void syms_of_keymap P_ ((void));
 extern void keys_of_keymap P_ ((void));
 
 typedef void (*map_keymap_function_t)
-     P_ ((Lisp_Object, Lisp_Object, Lisp_Object, void*));
+     P_ ((Lisp_Object key, Lisp_Object val, Lisp_Object args, void* data));
 extern void map_keymap P_ ((Lisp_Object map, map_keymap_function_t fun, Lisp_Object largs, void* cargs, int autoload));
 
 #endif
index 7499349..c5d9724 100644 (file)
@@ -56,7 +56,7 @@ Boston, MA 02110-1301, USA.  */
 #ifdef GC_CHECK_CONS_LIST
 #define CHECK_CONS_LIST() check_cons_list()
 #else
-#define CHECK_CONS_LIST() 0
+#define CHECK_CONS_LIST() ((void)0)
 #endif
 
 /* These are default choices for the types to use.  */
@@ -701,7 +701,10 @@ extern int string_bytes P_ ((struct Lisp_String *));
 #endif /* not GC_CHECK_STRING_BYTES */
 
 /* Mark STR as a unibyte string.  */
-#define STRING_SET_UNIBYTE(STR)      (XSTRING (STR)->size_byte = -1)
+#define STRING_SET_UNIBYTE(STR)  \
+  do { if (EQ (STR, empty_multibyte_string))  \
+      (STR) = empty_unibyte_string;  \
+    else XSTRING (STR)->size_byte = -1; } while (0)
 
 /* Get text properties.  */
 #define STRING_INTERVALS(STR)  (XSTRING (STR)->intervals + 0)
@@ -735,9 +738,9 @@ struct Lisp_Vector
 
 /* If a struct is made to look like a vector, this macro returns the length
    of the shortest vector that would hold that struct.  */
-#define VECSIZE(type) ((sizeof (type) - (sizeof (struct Lisp_Vector)  \
-                                         - sizeof (Lisp_Object))      \
-                        + sizeof(Lisp_Object) - 1) /* round up */     \
+#define VECSIZE(type) ((sizeof (type)                                    \
+                       - OFFSETOF (struct Lisp_Vector, contents[0])      \
+                        + sizeof(Lisp_Object) - 1) /* round up */        \
                       / sizeof (Lisp_Object))
 
 /* Like VECSIZE, but used when the pseudo-vector has non-Lisp_Object fields
@@ -1038,16 +1041,16 @@ struct Lisp_Hash_Table
      hash table size to reduce collisions.  */
   Lisp_Object index;
 
-  /* Next weak hash table if this is a weak hash table.  The head
-     of the list is in Vweak_hash_tables.  */
-  Lisp_Object next_weak;
-
   /* User-supplied hash function, or nil.  */
   Lisp_Object user_hash_function;
 
   /* User-supplied key comparison function, or nil.  */
   Lisp_Object user_cmp_function;
 
+  /* Next weak hash table if this is a weak hash table.  The head
+     of the list is in weak_hash_tables.  */
+  struct Lisp_Hash_Table *next_weak;
+
   /* C function to compare two keys.  */
   int (* cmpfn) P_ ((struct Lisp_Hash_Table *, Lisp_Object,
                     unsigned, Lisp_Object, unsigned));
@@ -2425,7 +2428,7 @@ EXFUN (Fstring_lessp, 2);
 extern int char_table_translate P_ ((Lisp_Object, int));
 extern void map_char_table P_ ((void (*) (Lisp_Object, Lisp_Object, Lisp_Object),
                                Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, int,
-                               Lisp_Object *));
+                               int *));
 extern Lisp_Object char_table_ref_and_index P_ ((Lisp_Object, int, int *));
 extern void syms_of_fns P_ ((void));
 
@@ -3060,7 +3063,8 @@ extern void syms_of_frame P_ ((void));
 /* defined in emacs.c */
 extern Lisp_Object decode_env_path P_ ((char *, char *));
 extern Lisp_Object Vinvocation_name, Vinvocation_directory;
-extern Lisp_Object Vinstallation_directory, empty_string;
+extern Lisp_Object Vinstallation_directory;
+extern Lisp_Object empty_unibyte_string, empty_multibyte_string;
 EXFUN (Fkill_emacs, 1);
 #if HAVE_SETLOCALE
 void fixup_locale P_ ((void));
@@ -3096,6 +3100,8 @@ extern int wait_reading_process_output P_ ((int, int, int, int,
                                            int));
 extern void add_keyboard_wait_descriptor P_ ((int));
 extern void delete_keyboard_wait_descriptor P_ ((int));
+extern void add_gpm_wait_descriptor P_ ((int));
+extern void delete_gpm_wait_descriptor P_ ((int));
 extern void close_process_descs P_ ((void));
 extern void init_process P_ ((void));
 extern void syms_of_process P_ ((void));
@@ -3238,6 +3244,7 @@ EXFUN (Fx_file_dialog, 5);
 #endif
 
 /* Defined in xfaces.c */
+EXFUN (Fclear_face_cache, 1);
 extern void syms_of_xfaces P_ ((void));
 
 #ifndef HAVE_GETLOADAVG
@@ -3253,6 +3260,7 @@ extern void syms_of_xfns P_ ((void));
 extern void syms_of_xsmfns P_ ((void));
 
 /* Defined in xselect.c */
+EXFUN (Fx_send_client_event, 6);
 extern void syms_of_xselect P_ ((void));
 
 /* Defined in xterm.c */
index 5037937..282bf1d 100644 (file)
@@ -1199,7 +1199,7 @@ openp (path, str, suffixes, storeptr, predicate)
        fn = (char *) alloca (fn_size = 100 + want_size);
 
       /* Loop over suffixes.  */
-      for (tail = NILP (suffixes) ? Fcons (build_string (""), Qnil) : suffixes;
+      for (tail = NILP (suffixes) ? Fcons (empty_unibyte_string, Qnil) : suffixes;
           CONSP (tail); tail = XCDR (tail))
        {
          int lsuffix = SBYTES (XCAR (tail));
@@ -1501,7 +1501,8 @@ readevalloop (readcharfun, stream, sourcename, evalfun,
        }
 
       /* Ignore whitespace here, so we can detect eof.  */
-      if (c == ' ' || c == '\t' || c == '\n' || c == '\f' || c == '\r')
+      if (c == ' ' || c == '\t' || c == '\n' || c == '\f' || c == '\r'
+         || c == 0x8a0)  /* NBSP */
        goto read_next;
 
       if (!NILP (Vpurify_flag) && c == '(')
@@ -1894,7 +1895,7 @@ read_escape (readcharfun, stringp, byterep)
 
     case 's':
       c = READCHAR;
-      if (c != '-')
+      if (stringp || c != '-')
        {
          UNREAD (c);
          return ' ';
@@ -2693,7 +2694,9 @@ read1 (readcharfun, pch, first_in_list)
       }
     default:
     default_label:
-      if (c <= 040) goto retry;
+      if (c <= 040) goto retry;        
+      if (c == 0x8a0) /* NBSP */
+       goto retry;
       {
        char *p = read_buffer;
        int quoted = 0;
@@ -2702,6 +2705,7 @@ read1 (readcharfun, pch, first_in_list)
          char *end = read_buffer + read_buffer_size;
 
          while (c > 040
+                && c != 0x8a0 /* NBSP */
                 && (c >= 0200
                     || (!index ("\"';()[]#", c)
                         && !(!first_in_list && c == '`')
@@ -4070,8 +4074,7 @@ and, if so, which suffixes they should try to append to the file name
 in order to do so.  However, if you want to customize which suffixes
 the loading functions recognize as compression suffixes, you should
 customize `jka-compr-load-suffixes' rather than the present variable.  */);
-  /* We don't use empty_string because it's not initialized yet.  */
-  Vload_file_rep_suffixes = Fcons (build_string (""), Qnil);
+  Vload_file_rep_suffixes = Fcons (empty_unibyte_string, Qnil);
 
   DEFVAR_BOOL ("load-in-progress", &load_in_progress,
               doc: /* Non-nil if inside of `load'.  */);
index 53fc178..5e46a05 100644 (file)
@@ -99,10 +99,6 @@ NOTE-END
 # endif
 #endif
 
-#if defined(__OpenBSD__)
-#define ORDINARY_LINK
-#endif
-
 #ifdef __ELF__
 #undef UNEXEC
 #define UNEXEC unexelf.o
index a641b07..64af240 100644 (file)
--- a/src/mac.c
+++ b/src/mac.c
@@ -1127,18 +1127,15 @@ Lisp_Object
 cfdate_to_lisp (date)
      CFDateRef date;
 {
-  static const CFGregorianDate epoch_gdate = {1970, 1, 1, 0, 0, 0.0};
-  static CFAbsoluteTime epoch = 0.0, sec;
-  int high, low;
+  CFTimeInterval sec;
+  int high, low, microsec;
 
-  if (epoch == 0.0)
-    epoch = CFGregorianDateGetAbsoluteTime (epoch_gdate, NULL);
-
-  sec = CFDateGetAbsoluteTime (date) - epoch;
+  sec = CFDateGetAbsoluteTime (date) + kCFAbsoluteTimeIntervalSince1970;
   high = sec / 65536.0;
   low = sec - high * 65536.0;
+  microsec = (sec - floor (sec)) * 1000000.0;
 
-  return list3 (make_number (high), make_number (low), make_number (0));
+  return list3 (make_number (high), make_number (low), make_number (microsec));
 }
 
 
@@ -1826,8 +1823,6 @@ xrm_get_preference_database (application)
 
   GCPRO3 (database, quarks, value);
 
-  BLOCK_INPUT;
-
   app_id = kCFPreferencesCurrentApplication;
   if (application)
     {
@@ -1879,8 +1874,6 @@ xrm_get_preference_database (application)
     CFRelease (key_set);
   CFRelease (app_id);
 
-  UNBLOCK_INPUT;
-
   UNGCPRO;
 
   return database;
index 8dff77c..34f8094 100644 (file)
@@ -218,9 +218,6 @@ void x_explicitly_set_name P_ ((struct frame *, Lisp_Object, Lisp_Object));
 void x_set_menu_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object));
 void x_set_title P_ ((struct frame *, Lisp_Object, Lisp_Object));
 void x_set_tool_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object));
-
-extern void mac_get_window_bounds P_ ((struct frame *, Rect *, Rect *));
-
 \f
 
 /* Store the screen positions of frame F into XPTR and YPTR.
@@ -1685,6 +1682,25 @@ x_set_tool_bar_lines (f, value, oldval)
   /* Make sure we redisplay all windows in this frame.  */
   ++windows_or_buffers_changed;
 
+#if USE_MAC_TOOLBAR
+  FRAME_TOOL_BAR_LINES (f) = 0;
+  if (nlines)
+    {
+      FRAME_EXTERNAL_TOOL_BAR (f) = 1;
+      if (FRAME_MAC_P (f) && !IsWindowToolbarVisible (FRAME_MAC_WINDOW (f)))
+       /* Make sure next redisplay shows the tool bar.  */
+       XWINDOW (FRAME_SELECTED_WINDOW (f))->update_mode_line = Qt;
+    }
+  else
+    {
+      if (FRAME_EXTERNAL_TOOL_BAR (f))
+        free_frame_tool_bar (f);
+      FRAME_EXTERNAL_TOOL_BAR (f) = 0;
+    }
+
+  return;
+#endif
+
   delta = nlines - FRAME_TOOL_BAR_LINES (f);
 
   /* Don't resize the tool-bar to more than we have room for.  */
@@ -2263,11 +2279,11 @@ mac_window (f)
          FRAME_MAC_WINDOW (f) = NULL;
        }
     }
-#else
+#else  /* !TARGET_API_MAC_CARBON */
   FRAME_MAC_WINDOW (f)
     = NewCWindow (NULL, &r, "\p", false, zoomDocProc,
-                 (WindowPtr) -1, 1, (long) f->output_data.mac);
-#endif
+                 (WindowRef) -1, 1, (long) f->output_data.mac);
+#endif  /* !TARGET_API_MAC_CARBON */
   /* so that update events can find this mac_output struct */
   f->output_data.mac->mFP = f;  /* point back to emacs frame */
 
@@ -2287,6 +2303,16 @@ mac_window (f)
     XSetWindowBackground (FRAME_MAC_DISPLAY(f), FRAME_MAC_WINDOW (f),
                          FRAME_BACKGROUND_PIXEL (f));
 
+#if USE_MAC_TOOLBAR
+  /* At the moment, the size of the tool bar is not yet known.  We
+     record the gravity value of the newly created window and use it
+     to adjust the position of the window (especially for a negative
+     specification of its vertical position) when the tool bar is
+     first redisplayed.  */
+  if (FRAME_EXTERNAL_TOOL_BAR (f))
+    f->output_data.mac->toolbar_win_gravity = f->win_gravity;
+#endif
+
   validate_x_resource_name ();
 
   /* x_set_name normally ignores requests to set the name if the
@@ -3120,7 +3146,7 @@ If omitted or nil, that stands for the selected frame's display.  */)
       UNBLOCK_INPUT;
     }
 #if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
-  else
+  else                         /* CGDisplayScreenSize == NULL */
 #endif
 #endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030  */
 #if MAC_OS_X_VERSION_MAX_ALLOWED < 1030 || MAC_OS_X_VERSION_MIN_REQUIRED == 1020
@@ -3157,7 +3183,7 @@ If omitted or nil, that stands for the selected frame's display.  */)
       UNBLOCK_INPUT;
     }
 #if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
-  else
+  else                         /* CGDisplayScreenSize == NULL */
 #endif
 #endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030  */
 #if MAC_OS_X_VERSION_MAX_ALLOWED < 1030 || MAC_OS_X_VERSION_MIN_REQUIRED == 1020
@@ -4076,8 +4102,12 @@ compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y)
       Point mouse_pos;
 
       BLOCK_INPUT;
+#if TARGET_API_MAC_CARBON
+      GetGlobalMouse (&mouse_pos);
+#else
       GetMouse (&mouse_pos);
       LocalToGlobal (&mouse_pos);
+#endif
       *root_x = mouse_pos.h;
       *root_y = mouse_pos.v;
       UNBLOCK_INPUT;
index 04f48b0..7a65e58 100644 (file)
@@ -71,7 +71,7 @@ typedef unsigned long Time;
 #undef Z
 #define Z (current_buffer->text->z)
 #else /* not HAVE_CARBON */
-#include <QuickDraw.h>         /* for WindowPtr */
+#include <QuickDraw.h>         /* for WindowRef */
 #include <QDOffscreen.h>       /* for GWorldPtr */
 #include <Appearance.h>                /* for ThemeCursor */
 #include <Windows.h>
@@ -98,7 +98,7 @@ typedef unsigned long Time;
 /* Whether to use Quartz 2D routines for drawing operations other than
    texts.  */
 #ifndef USE_CG_DRAWING
-#if USE_ATSUI && MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
 #define USE_CG_DRAWING 1
 #endif
 #endif
@@ -117,7 +117,14 @@ typedef unsigned long Time;
 #endif
 #endif
 
-typedef WindowPtr Window;
+/* Whether to use HIToolbar.  */
+#ifndef USE_MAC_TOOLBAR
+#if USE_CG_DRAWING && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 && MAC_OS_X_VERSION_MIN_REQUIRED != 1020
+#define USE_MAC_TOOLBAR 1
+#endif
+#endif
+
+typedef WindowRef Window;
 typedef GWorldPtr Pixmap;
 
 #define Cursor ThemeCursor
index b8cfd6a..883a846 100644 (file)
@@ -200,7 +200,7 @@ static void list_of_items P_ ((Lisp_Object));
 
 static void find_and_call_menu_selection P_ ((FRAME_PTR, int, Lisp_Object,
                                              void *));
-static int fill_menu P_ ((MenuHandle, widget_value *, enum mac_menu_kind, int));
+static int fill_menu P_ ((MenuRef, widget_value *, enum mac_menu_kind, int));
 static void fill_menubar P_ ((widget_value *, int));
 static void dispose_menus P_ ((enum mac_menu_kind, int));
 
@@ -882,7 +882,7 @@ no quit occurs and `x-popup-menu' returns nil.  */)
 
 /* Regard ESC and C-g as Cancel even without the Cancel button.  */
 
-#ifdef MAC_OSX
+#if 0 /* defined (MAC_OSX) */
 static Boolean
 mac_dialog_modal_filter (dialog, event, item_hit)
      DialogRef dialog;
@@ -991,7 +991,7 @@ for instance using the window manager, then this produces a quit and
        but I don't want to make one now.  */
     CHECK_WINDOW (window);
 
-#ifdef MAC_OSX
+#if 0 /* defined (MAC_OSX) */
   /* Special treatment for Fmessage_box, Fyes_or_no_p, and Fy_or_n_p.  */
   if (EQ (position, Qt)
       && STRINGP (Fcar (contents))
@@ -1162,7 +1162,7 @@ x_activate_menubar (f)
 #endif
     if (menu_id)
       {
-        MenuHandle menu = GetMenuHandle (menu_id);
+        MenuRef menu = GetMenuRef (menu_id);
 
         if (menu)
           {
@@ -1595,14 +1595,16 @@ menu_target_item_handler (next_handler, event, data)
      EventRef event;
      void *data;
 {
-  OSStatus err, result;
+  OSStatus err;
   MenuRef menu;
   MenuItemIndex menu_item;
   Lisp_Object help;
   GrafPtr port;
   int specpdl_count = SPECPDL_INDEX ();
 
-  result = CallNextEventHandler (next_handler, event);
+  /* Don't be bothered with the overflowed toolbar items menu.  */
+  if (!popup_activated ())
+    return eventNotHandledErr;
 
   err = GetEventParameter (event, kEventParamDirectObject, typeMenuRef,
                           NULL, sizeof (MenuRef), NULL, &menu);
@@ -1626,30 +1628,21 @@ menu_target_item_handler (next_handler, event, data)
   SetPort (port);
   unbind_to (specpdl_count, Qnil);
 
-  return err == noErr ? noErr : result;
+  return err == noErr ? noErr : eventNotHandledErr;
 }
-#endif
 
 OSStatus
-install_menu_target_item_handler (window)
-     WindowPtr window;
+install_menu_target_item_handler ()
 {
-  OSStatus err = noErr;
-#if TARGET_API_MAC_CARBON
   static const EventTypeSpec specs[] =
     {{kEventClassMenu, kEventMenuTargetItem}};
-  static EventHandlerUPP menu_target_item_handlerUPP = NULL;
-
-  if (menu_target_item_handlerUPP == NULL)
-    menu_target_item_handlerUPP =
-      NewEventHandlerUPP (menu_target_item_handler);
 
-  err = InstallWindowEventHandler (window, menu_target_item_handlerUPP,
-                                  GetEventTypeCount (specs), specs,
-                                  NULL, NULL);
-#endif
-  return err;
+  return InstallApplicationEventHandler (NewEventHandlerUPP
+                                        (menu_target_item_handler),
+                                        GetEventTypeCount (specs),
+                                        specs, NULL, NULL);
 }
+#endif  /* TARGET_API_MAC_CARBON */
 
 /* Event handler function that pops down a menu on C-g.  We can only pop
    down menus if CancelMenuTracking is present (OSX 10.3 or later).  */
@@ -1687,15 +1680,15 @@ menu_quit_handler (nextHandler, theEvent, userData)
 }
 #endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 */
 
-/* Add event handler to all menus that belong to KIND so we can detect C-g.
-   MENU_HANDLE is the root menu of the tracking session to dismiss
-   when C-g is detected.  NULL means the menu bar.
-   If CancelMenuTracking isn't available, do nothing.  */
+/* Add event handler to all menus that belong to KIND so we can detect
+   C-g.  ROOT_MENU is the root menu of the tracking session to dismiss
+   when C-g is detected.  NULL means the menu bar.  If
+   CancelMenuTracking isn't available, do nothing.  */
 
 static void
-install_menu_quit_handler (kind, menu_handle)
+install_menu_quit_handler (kind, root_menu)
      enum mac_menu_kind kind;
-     MenuHandle menu_handle;
+     MenuRef root_menu;
 {
 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
   static const EventTypeSpec typesList[] =
@@ -1708,13 +1701,13 @@ install_menu_quit_handler (kind, menu_handle)
 #endif
   for (id = min_menu_id[kind]; id < min_menu_id[kind + 1]; id++)
     {
-      MenuHandle menu = GetMenuHandle (id);
+      MenuRef menu = GetMenuRef (id);
 
       if (menu == NULL)
        break;
       InstallMenuEventHandler (menu, menu_quit_handler,
                               GetEventTypeCount (typesList),
-                              typesList, menu_handle, NULL);
+                              typesList, root_menu, NULL);
     }
 #endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 */
 }
@@ -1738,10 +1731,13 @@ set_frame_menubar (f, first_time, deep_p)
 
   XSETFRAME (Vmenu_updating_frame, f);
 
+  /* This seems to be unnecessary for Carbon.  */
+#if 0
   if (! menubar_widget)
     deep_p = 1;
   else if (pending_menu_activation && !deep_p)
     deep_p = 1;
+#endif
 
   if (deep_p)
     {
@@ -1978,7 +1974,7 @@ pop_down_menu (arg)
 {
   struct Lisp_Save_Value *p = XSAVE_VALUE (arg);
   FRAME_PTR f = p->pointer;
-  MenuHandle menu = GetMenuHandle (min_menu_id[MAC_MENU_POPUP]);
+  MenuRef menu = GetMenuRef (min_menu_id[MAC_MENU_POPUP]);
 
   BLOCK_INPUT;
 
@@ -2024,8 +2020,7 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error)
   int i;
   int menu_item_choice;
   UInt32 menu_item_selection;
-  MenuHandle menu;
-  Point pos;
+  MenuRef menu;
   widget_value *wv, *save_wv = 0, *first_wv = 0, *prev_wv = 0;
   widget_value **submenu_stack
     = (widget_value **) alloca (menu_items_used * sizeof (widget_value *));
@@ -2231,11 +2226,8 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error)
   free_menubar_widget_value_tree (first_wv);
 
   /* Adjust coordinates to be root-window-relative.  */
-  pos.h = x;
-  pos.v = y;
-
-  SetPortWindowPort (FRAME_MAC_WINDOW (f));
-  LocalToGlobal (&pos);
+  x += f->left_pos + FRAME_OUTER_TO_INNER_DIFF_X (f);
+  y += f->top_pos + FRAME_OUTER_TO_INNER_DIFF_Y (f);
 
   /* No selection has been chosen yet.  */
   menu_item_selection = 0;
@@ -2248,13 +2240,13 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error)
 
   /* Display the menu.  */
   popup_activated_flag = 1;
-  menu_item_choice = PopUpMenuSelect (menu, pos.v, pos.h, 0);
+  menu_item_choice = PopUpMenuSelect (menu, y, x, 0);
   popup_activated_flag = 0;
 
   /* Get the refcon to find the correct item */
   if (menu_item_choice)
     {
-      MenuHandle sel_menu = GetMenuHandle (HiWord (menu_item_choice));
+      MenuRef sel_menu = GetMenuRef (HiWord (menu_item_choice));
 
       if (sel_menu)
        GetMenuItemRefCon (sel_menu, LoWord (menu_item_choice),
@@ -2330,13 +2322,24 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error)
 
 #if TARGET_API_MAC_CARBON
 
+#define DIALOG_BUTTON_COMMAND_ID_OFFSET 'Bt\0\0'
+#define DIALOG_BUTTON_COMMAND_ID_P(id)                 \
+  (((id) & ~0xffff) == DIALOG_BUTTON_COMMAND_ID_OFFSET)
+#define DIALOG_BUTTON_COMMAND_ID_VALUE(id)     \
+  ((id) - DIALOG_BUTTON_COMMAND_ID_OFFSET)
+#define DIALOG_BUTTON_MAKE_COMMAND_ID(value)   \
+  ((value) + DIALOG_BUTTON_COMMAND_ID_OFFSET)
+
+extern EMACS_TIME timer_check P_ ((int));
+static int quit_dialog_event_loop;
+
 static pascal OSStatus
 mac_handle_dialog_event (next_handler, event, data)
      EventHandlerCallRef next_handler;
      EventRef event;
      void *data;
 {
-  OSStatus err;
+  OSStatus err, result = eventNotHandledErr;
   WindowRef window = (WindowRef) data;
 
   switch (GetEventClass (event))
@@ -2349,15 +2352,14 @@ mac_handle_dialog_event (next_handler, event, data)
                                 typeHICommand, NULL, sizeof (HICommand),
                                 NULL, &command);
        if (err == noErr)
-         if ((command.commandID & ~0xffff) == 'Bt\0\0')
+         if (DIALOG_BUTTON_COMMAND_ID_P (command.commandID))
            {
              SetWRefCon (window, command.commandID);
-             err = QuitAppModalLoopForWindow (window);
-
-             return err == noErr ? noErr : eventNotHandledErr;
+             quit_dialog_event_loop = 1;
+             break;
            }
 
-       return CallNextEventHandler (next_handler, event);
+       result = CallNextEventHandler (next_handler, event);
       }
       break;
 
@@ -2367,8 +2369,8 @@ mac_handle_dialog_event (next_handler, event, data)
        char char_code;
 
        result = CallNextEventHandler (next_handler, event);
-       if (result == noErr)
-         return noErr;
+       if (result != eventNotHandledErr)
+         break;
 
        err = GetEventParameter (event, kEventParamKeyMacCharCodes,
                                 typeChar, NULL, sizeof (char),
@@ -2377,7 +2379,7 @@ mac_handle_dialog_event (next_handler, event, data)
          switch (char_code)
            {
            case kEscapeCharCode:
-             err = QuitAppModalLoopForWindow (window);
+             quit_dialog_event_loop = 1;
              break;
 
            default:
@@ -2392,23 +2394,26 @@ mac_handle_dialog_event (next_handler, event, data)
                                           typeUInt32, NULL, sizeof (UInt32),
                                           NULL, &key_code);
                if (err == noErr)
-                 {
-                   if (mac_quit_char_key_p (modifiers, key_code))
-                     err = QuitAppModalLoopForWindow (window);
-                   else
-                     err = eventNotHandledErr;
-                 }
+                 if (mac_quit_char_key_p (modifiers, key_code))
+                   quit_dialog_event_loop = 1;
              }
              break;
            }
-
-       return err == noErr ? noErr : result;
       }
       break;
 
     default:
       abort ();
     }
+
+  if (quit_dialog_event_loop)
+    {
+      err = QuitEventLoop (GetCurrentEventLoop ());
+      if (err == noErr)
+       result = noErr;
+    }
+
+  return result;
 }
 
 static OSStatus
@@ -2443,6 +2448,25 @@ install_dialog_event_handler (window)
 #define DIALOG_ICON_LEFT_MARGIN (24)
 #define DIALOG_ICON_TOP_MARGIN (15)
 
+static Lisp_Object
+pop_down_dialog (arg)
+     Lisp_Object arg;
+{
+  struct Lisp_Save_Value *p = XSAVE_VALUE (arg);
+  WindowRef window = p->pointer;
+
+  BLOCK_INPUT;
+
+  if (popup_activated_flag)
+    EndAppModalStateForWindow (window);
+  DisposeWindow (window);
+  popup_activated_flag = 0;
+
+  UNBLOCK_INPUT;
+
+  return Qnil;
+}
+
 static int
 create_and_show_dialog (f, first_wv)
      FRAME_PTR f;
@@ -2456,6 +2480,7 @@ create_and_show_dialog (f, first_wv)
   Rect empty_rect, *rects;
   WindowRef window = NULL;
   ControlRef *buttons, default_button = NULL, text;
+  int specpdl_count = SPECPDL_INDEX ();
 
   dialog_name = first_wv->name;
   nb_buttons = dialog_name[1] - '0';
@@ -2472,8 +2497,11 @@ create_and_show_dialog (f, first_wv)
                         kWindowStandardHandlerAttribute,
                         &empty_rect, &window);
   if (err == noErr)
-    err = SetThemeWindowBackground (window, kThemeBrushMovableModalBackground,
-                                   true);
+    {
+      record_unwind_protect (pop_down_dialog, make_save_value (window, 0));
+      err = SetThemeWindowBackground (window, kThemeBrushMovableModalBackground,
+                                     true);
+    }
   if (err == noErr)
     err = SetWindowTitleWithCFString (window, (dialog_name[0] == 'Q'
                                               ? CFSTR ("Question")
@@ -2518,14 +2546,16 @@ create_and_show_dialog (f, first_wv)
            }
          if (err == noErr)
            {
+             UInt32 command_id;
+
              OffsetRect (&rects[i], -rects[i].left, -rects[i].top);
              if (rects[i].right < DIALOG_BUTTON_MIN_WIDTH)
                rects[i].right = DIALOG_BUTTON_MIN_WIDTH;
              else if (rects[i].right > DIALOG_MAX_INNER_WIDTH)
                rects[i].right = DIALOG_MAX_INNER_WIDTH;
 
-             err = SetControlCommandID (buttons[i],
-                                        'Bt\0\0' + (int) wv->call_data);
+             command_id = DIALOG_BUTTON_MAKE_COMMAND_ID ((int) wv->call_data);
+             err = SetControlCommandID (buttons[i], command_id);
            }
          if (err != noErr)
            break;
@@ -2696,18 +2726,66 @@ create_and_show_dialog (f, first_wv)
       SetWRefCon (window, 0);
       ShowWindow (window);
       BringToFront (window);
-      err = RunAppModalLoopForWindow (window);
+      popup_activated_flag = 1;
+      err = BeginAppModalStateForWindow (window);
+    }
+  if (err == noErr)
+    {
+      EventTargetRef toolbox_dispatcher = GetEventDispatcherTarget ();
+
+      quit_dialog_event_loop = 0;
+      while (1)
+       {
+         EMACS_TIME next_time = timer_check (1);
+         long secs = EMACS_SECS (next_time);
+         long usecs = EMACS_USECS (next_time);
+         EventTimeout timeout;
+         EventRef event;
+
+         if (secs < 0 || (secs == 0 && usecs == 0))
+           {
+             /* Sometimes timer_check returns -1 (no timers) even if
+                there are timers.  So do a timeout anyway.  */
+             secs = 1;
+             usecs = 0;
+           }
+
+         timeout = (secs * kEventDurationSecond
+                    + usecs * kEventDurationMicrosecond);
+         err = ReceiveNextEvent (0, NULL, timeout, kEventRemoveFromQueue,
+                                 &event);
+         if (err == noErr)
+           {
+             SendEventToEventTarget (event, toolbox_dispatcher);
+             ReleaseEvent (event);
+           }
+#ifdef MAC_OSX
+         else if (err != eventLoopTimedOutErr)
+           {
+             if (err == eventLoopQuitErr)
+               err = noErr;
+             break;
+           }
+#else
+         /* The return value of ReceiveNextEvent seems to be
+            unreliable.  Use our own global variable instead.  */
+         if (quit_dialog_event_loop)
+           {
+             err = noErr;
+             break;
+           }
+#endif
+       }
     }
   if (err == noErr)
     {
       UInt32 command_id = GetWRefCon (window);
 
-      if ((command_id & ~0xffff) == 'Bt\0\0')
-       result = command_id - 'Bt\0\0';
+      if (DIALOG_BUTTON_COMMAND_ID_P (command_id))
+       result = DIALOG_BUTTON_COMMAND_ID_VALUE (command_id);
     }
 
-  if (window)
-    DisposeWindow (window);
+  unbind_to (specpdl_count, Qnil);
 
   return result;
 }
@@ -2724,8 +2802,8 @@ mac_dialog (widget_value *wv)
   int i;
   int dialog_width;
   Rect rect;
-  WindowPtr window_ptr;
-  ControlHandle ch;
+  WindowRef window_ptr;
+  ControlRef ch;
   int left;
   EventRecord event_record;
   SInt16 part_code;
@@ -2754,7 +2832,7 @@ mac_dialog (widget_value *wv)
       wv = wv->next;
     }
 
-  window_ptr = GetNewCWindow (DIALOG_WINDOW_RESOURCE, NULL, (WindowPtr) -1);
+  window_ptr = GetNewCWindow (DIALOG_WINDOW_RESOURCE, NULL, (WindowRef) -1);
 
   SetPortWindowPort (window_ptr);
 
@@ -3031,7 +3109,7 @@ name_is_separator (name)
 
 static void
 add_menu_item (menu, pos, wv)
-     MenuHandle menu;
+     MenuRef menu;
      int pos;
      widget_value *wv;
 {
@@ -3108,7 +3186,7 @@ add_menu_item (menu, pos, wv)
 
 static int
 fill_menu (menu, wv, kind, submenu_id)
-     MenuHandle menu;
+     MenuRef menu;
      widget_value *wv;
      enum mac_menu_kind kind;
      int submenu_id;
@@ -3120,7 +3198,7 @@ fill_menu (menu, wv, kind, submenu_id)
       add_menu_item (menu, pos, wv);
       if (wv->contents && submenu_id < min_menu_id[kind + 1])
        {
-         MenuHandle submenu = NewMenu (submenu_id, "\pX");
+         MenuRef submenu = NewMenu (submenu_id, "\pX");
 
          InsertMenu (submenu, -1);
          SetMenuItemHierarchicalID (menu, pos, submenu_id);
@@ -3139,8 +3217,6 @@ fill_menubar (wv, deep_p)
      int deep_p;
 {
   int id, submenu_id;
-  MenuHandle menu;
-  Str255 title;
 #if !TARGET_API_MAC_CARBON
   int title_changed_p = 0;
 #endif
@@ -3162,45 +3238,75 @@ fill_menubar (wv, deep_p)
        wv != NULL && id < min_menu_id[MAC_MENU_MENU_BAR + 1];
        wv = wv->next, id++)
     {
+      OSStatus err = noErr;
+      MenuRef menu;
+#if TARGET_API_MAC_CARBON
+      CFStringRef title;
+
+      title = CFStringCreateWithCString (NULL, wv->name,
+                                        kCFStringEncodingMacRoman);
+#else
+      Str255 title;
+
       strncpy (title, wv->name, 255);
       title[255] = '\0';
       c2pstr (title);
+#endif
 
-      menu = GetMenuHandle (id);
+      menu = GetMenuRef (id);
       if (menu)
        {
 #if TARGET_API_MAC_CARBON
-         Str255 old_title;
+         CFStringRef old_title;
 
-         GetMenuTitle (menu, old_title);
-         if (!EqualString (title, old_title, false, false))
-           SetMenuTitle (menu, title);
+         err = CopyMenuTitleAsCFString (menu, &old_title);
+         if (err == noErr)
+           {
+             if (CFStringCompare (title, old_title, 0) != kCFCompareEqualTo)
+               err = SetMenuTitleWithCFString (menu, title);
+             CFRelease (old_title);
+           }
+         else
+           err = SetMenuTitleWithCFString (menu, title);
 #else  /* !TARGET_API_MAC_CARBON */
          if (!EqualString (title, (*menu)->menuData, false, false))
            {
              DeleteMenu (id);
              DisposeMenu (menu);
              menu = NewMenu (id, title);
-             InsertMenu (menu, GetMenuHandle (id + 1) ? id + 1 : 0);
+             InsertMenu (menu, GetMenuRef (id + 1) ? id + 1 : 0);
              title_changed_p = 1;
            }
 #endif  /* !TARGET_API_MAC_CARBON */
        }
       else
        {
+#if TARGET_API_MAC_CARBON
+         err = CreateNewMenu (id, 0, &menu);
+         if (err == noErr)
+           err = SetMenuTitleWithCFString (menu, title);
+#else
          menu = NewMenu (id, title);
-         InsertMenu (menu, 0);
+#endif
+         if (err == noErr)
+           {
+             InsertMenu (menu, 0);
 #if !TARGET_API_MAC_CARBON
-         title_changed_p = 1;
+             title_changed_p = 1;
 #endif
+           }
        }
+#if TARGET_API_MAC_CARBON
+      CFRelease (title);
+#endif
 
-      if (wv->contents)
-        submenu_id = fill_menu (menu, wv->contents, MAC_MENU_MENU_BAR_SUB,
-                               submenu_id);
+      if (err == noErr)
+       if (wv->contents)
+         submenu_id = fill_menu (menu, wv->contents, MAC_MENU_MENU_BAR_SUB,
+                                 submenu_id);
     }
 
-  if (id < min_menu_id[MAC_MENU_MENU_BAR + 1] && GetMenuHandle (id))
+  if (id < min_menu_id[MAC_MENU_MENU_BAR + 1] && GetMenuRef (id))
     {
       dispose_menus (MAC_MENU_MENU_BAR, id);
 #if !TARGET_API_MAC_CARBON
@@ -3224,7 +3330,7 @@ dispose_menus (kind, id)
 {
   for (id = max (id, min_menu_id[kind]); id < min_menu_id[kind + 1]; id++)
     {
-      MenuHandle menu = GetMenuHandle (id);
+      MenuRef menu = GetMenuRef (id);
 
       if (menu == NULL)
        break;
@@ -3249,9 +3355,13 @@ DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_
        doc: /* Return t if a menu or popup dialog is active.  */)
      ()
 {
+#if TARGET_API_MAC_CARBON
+  return (popup_activated ()) ? Qt : Qnil;
+#else
   /* Always return Qnil since menu selection functions do not return
      until a selection has been made or cancelled.  */
   return Qnil;
+#endif
 }
 \f
 void
index 5bd91a6..9515a57 100644 (file)
@@ -25,22 +25,27 @@ Boston, MA 02110-1301, USA.  */
 #include "blockinput.h"
 #include "keymap.h"
 
-#if !TARGET_API_MAC_CARBON
+#if TARGET_API_MAC_CARBON
+typedef ScrapRef Selection;
+#else  /* !TARGET_API_MAC_CARBON */
+#include <Scrap.h>
 #include <Endian.h>
-typedef int ScrapRef;
-typedef ResType ScrapFlavorType;
+typedef int Selection;
 #endif /* !TARGET_API_MAC_CARBON */
 
-static OSStatus get_scrap_from_symbol P_ ((Lisp_Object, int, ScrapRef *));
-static ScrapFlavorType get_flavor_type_from_symbol P_ ((Lisp_Object));
-static int valid_scrap_target_type_p P_ ((Lisp_Object));
-static OSStatus clear_scrap P_ ((ScrapRef *));
-static OSStatus put_scrap_string P_ ((ScrapRef, Lisp_Object, Lisp_Object));
-static OSStatus put_scrap_private_timestamp P_ ((ScrapRef, unsigned long));
-static ScrapFlavorType scrap_has_target_type P_ ((ScrapRef, Lisp_Object));
-static Lisp_Object get_scrap_string P_ ((ScrapRef, Lisp_Object));
-static OSStatus get_scrap_private_timestamp P_ ((ScrapRef, unsigned long *));
-static Lisp_Object get_scrap_target_type_list P_ ((ScrapRef));
+static OSStatus mac_get_selection_from_symbol P_ ((Lisp_Object, int,
+                                                  Selection *));
+static ScrapFlavorType get_flavor_type_from_symbol P_ ((Lisp_Object,
+                                                       Selection));
+static int mac_valid_selection_target_p P_ ((Lisp_Object));
+static OSStatus mac_clear_selection P_ ((Selection *));
+static Lisp_Object mac_get_selection_ownership_info P_ ((Selection));
+static int mac_valid_selection_value_p P_ ((Lisp_Object, Lisp_Object));
+static OSStatus mac_put_selection_value P_ ((Selection, Lisp_Object,
+                                            Lisp_Object));
+static int mac_selection_has_target_p P_ ((Selection, Lisp_Object));
+static Lisp_Object mac_get_selection_value P_ ((Selection, Lisp_Object));
+static Lisp_Object mac_get_selection_target_list P_ ((Selection));
 static void x_own_selection P_ ((Lisp_Object, Lisp_Object));
 static Lisp_Object x_get_local_selection P_ ((Lisp_Object, Lisp_Object, int));
 static Lisp_Object x_get_foreign_selection P_ ((Lisp_Object,
@@ -56,7 +61,7 @@ void init_service_handler P_ ((void));
 Lisp_Object QPRIMARY, QSECONDARY, QTIMESTAMP, QTARGETS;
 
 static Lisp_Object Vx_lost_selection_functions;
-/* Coding system for communicating with other programs via scrap.  */
+/* Coding system for communicating with other programs via selections.  */
 static Lisp_Object Vselection_coding_system;
 
 /* Coding system for the next communicating with other programs.  */
@@ -70,23 +75,24 @@ static Lisp_Object Qforeign_selection;
 extern unsigned long last_event_timestamp;
 
 /* This is an association list whose elements are of the form
-     ( SELECTION-NAME SELECTION-VALUE SELECTION-TIMESTAMP FRAME)
+     ( SELECTION-NAME SELECTION-VALUE SELECTION-TIMESTAMP FRAME OWNERSHIP-INFO)
    SELECTION-NAME is a lisp symbol.
    SELECTION-VALUE is the value that emacs owns for that selection.
      It may be any kind of Lisp object.
    SELECTION-TIMESTAMP is the time at which emacs began owning this selection,
      as a cons of two 16-bit numbers (making a 32 bit time.)
    FRAME is the frame for which we made the selection.
-   If there is an entry in this alist, and the data for the flavor
-     type SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP in the corresponding scrap
-     (if exists) coincides with SELECTION-TIMESTAMP, then it can be
-     assumed that Emacs owns that selection.
+   OWNERSHIP-INFO is a value saved when emacs owns for that selection.
+     If another application takes the ownership of that selection
+     later, then newly examined ownership info value should be
+     different from the saved one.
+   If there is an entry in this alist, the current ownership info for
+    the selection coincides with OWNERSHIP-INFO, then it can be
+    assumed that Emacs owns that selection.
    The only (eq) parts of this list that are visible from Lisp are the
     selection-values.  */
 static Lisp_Object Vselection_alist;
 
-#define SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP 'Etsp'
-
 /* This is an alist whose CARs are selection-types and whose CDRs are
    the names of Lisp functions to call to convert the given Emacs
    selection value to a string representing the given selection type.
@@ -104,21 +110,22 @@ static Lisp_Object Qmac_scrap_name, Qmac_ostype;
 static Lisp_Object Vmac_service_selection;
 #endif
 \f
-/* Get a reference to the scrap corresponding to the symbol SYM.  The
-   reference is set to *SCRAP, and it becomes NULL if there's no
-   corresponding scrap.  Clear the scrap if CLEAR_P is non-zero.  */
+/* Get a reference to the selection corresponding to the symbol SYM.
+   The reference is set to *SEL, and it becomes NULL if there's no
+   corresponding selection.  Clear the selection if CLEAR_P is
+   non-zero.  */
 
 static OSStatus
-get_scrap_from_symbol (sym, clear_p, scrap)
+mac_get_selection_from_symbol (sym, clear_p, sel)
      Lisp_Object sym;
      int clear_p;
-     ScrapRef *scrap;
+     Selection *sel;
 {
   OSStatus err = noErr;
   Lisp_Object str = Fget (sym, Qmac_scrap_name);
 
   if (!STRINGP (str))
-    *scrap = NULL;
+    *sel = NULL;
   else
     {
 #if TARGET_API_MAC_CARBON
@@ -127,19 +134,19 @@ get_scrap_from_symbol (sym, clear_p, scrap)
       OptionBits options = (clear_p ? kScrapClearNamedScrap
                            : kScrapGetNamedScrap);
 
-      err = GetScrapByName (scrap_name, options, scrap);
+      err = GetScrapByName (scrap_name, options, sel);
       CFRelease (scrap_name);
 #else  /* !MAC_OSX */
       if (clear_p)
        err = ClearCurrentScrap ();
       if (err == noErr)
-       err = GetCurrentScrap (scrap);
+       err = GetCurrentScrap (sel);
 #endif /* !MAC_OSX */
 #else  /* !TARGET_API_MAC_CARBON */
       if (clear_p)
        err = ZeroScrap ();
       if (err == noErr)
-       *scrap = 1;
+       *sel = 1;
 #endif /* !TARGET_API_MAC_CARBON */
     }
 
@@ -147,138 +154,154 @@ get_scrap_from_symbol (sym, clear_p, scrap)
 }
 
 /* Get a scrap flavor type from the symbol SYM.  Return 0 if no
-   corresponding flavor type.  */
+   corresponding flavor type.  If SEL is non-zero, the return value is
+   non-zero only when the SEL has the flavor type.  */
 
 static ScrapFlavorType
-get_flavor_type_from_symbol (sym)
+get_flavor_type_from_symbol (sym, sel)
      Lisp_Object sym;
+     Selection sel;
 {
   Lisp_Object str = Fget (sym, Qmac_ostype);
+  ScrapFlavorType flavor_type;
 
   if (STRINGP (str) && SBYTES (str) == 4)
-    return EndianU32_BtoN (*((UInt32 *) SDATA (str)));
+    flavor_type = EndianU32_BtoN (*((UInt32 *) SDATA (str)));
+  else
+    flavor_type = 0;
+
+  if (flavor_type && sel)
+    {
+#if TARGET_API_MAC_CARBON
+      OSStatus err;
+      ScrapFlavorFlags flags;
+
+      err = GetScrapFlavorFlags (sel, flavor_type, &flags);
+      if (err != noErr)
+       flavor_type = 0;
+#else  /* !TARGET_API_MAC_CARBON */
+      SInt32 size, offset;
+
+      size = GetScrap (NULL, flavor_type, &offset);
+      if (size < 0)
+       flavor_type = 0;
+#endif /* !TARGET_API_MAC_CARBON */
+    }
 
-  return 0;
+  return flavor_type;
 }
 
-/* Check if the symbol SYM has a corresponding scrap flavor type.  */
+/* Check if the symbol SYM has a corresponding selection target type.  */
 
 static int
-valid_scrap_target_type_p (sym)
+mac_valid_selection_target_p (sym)
      Lisp_Object sym;
 {
-  return get_flavor_type_from_symbol (sym) != 0;
+  return get_flavor_type_from_symbol (sym, 0) != 0;
 }
 
-/* Clear the scrap whose reference is *SCRAP. */
+/* Clear the selection whose reference is *SEL.  */
 
-static INLINE OSStatus
-clear_scrap (scrap)
-     ScrapRef *scrap;
+static OSStatus
+mac_clear_selection (sel)
+     Selection *sel;
 {
 #if TARGET_API_MAC_CARBON
 #ifdef MAC_OSX
-  return ClearScrap (scrap);
+  return ClearScrap (sel);
 #else
-  return ClearCurrentScrap ();
+  OSStatus err;
+
+  err = ClearCurrentScrap ();
+  if (err == noErr)
+    err = GetCurrentScrap (sel);
+  return err;
 #endif
 #else  /* !TARGET_API_MAC_CARBON */
   return ZeroScrap ();
 #endif /* !TARGET_API_MAC_CARBON */
 }
 
-/* Put Lisp String STR to the scrap SCRAP.  The target type is
-   specified by TYPE. */
+/* Get ownership information for SEL.  Emacs can detect a change of
+   the ownership by comparing saved and current values of the
+   ownership information.  */
 
-static OSStatus
-put_scrap_string (scrap, type, str)
-     ScrapRef scrap;
-     Lisp_Object type, str;
+static Lisp_Object
+mac_get_selection_ownership_info (sel)
+     Selection sel;
 {
-  ScrapFlavorType flavor_type = get_flavor_type_from_symbol (type);
-
-  if (flavor_type == 0)
-    return noTypeErr;
-
 #if TARGET_API_MAC_CARBON
-  return PutScrapFlavor (scrap, flavor_type, kScrapFlavorMaskNone,
-                        SBYTES (str), SDATA (str));
+  return long_to_cons ((unsigned long) sel);
 #else  /* !TARGET_API_MAC_CARBON */
-  return PutScrap (SBYTES (str), flavor_type, SDATA (str));
+  ScrapStuffPtr scrap_info = InfoScrap ();
+
+  return make_number (scrap_info->scrapCount);
 #endif /* !TARGET_API_MAC_CARBON */
 }
 
-/* Put TIMESTAMP to the scrap SCRAP.  The timestamp is used for
-   checking if the scrap is owned by the process.  */
+/* Return non-zero if VALUE is a valid selection value for TARGET.  */
 
-static INLINE OSStatus
-put_scrap_private_timestamp (scrap, timestamp)
-     ScrapRef scrap;
-     unsigned long timestamp;
+static int
+mac_valid_selection_value_p (value, target)
+     Lisp_Object value, target;
 {
-#if TARGET_API_MAC_CARBON
-  return PutScrapFlavor (scrap, SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP,
-                        kScrapFlavorMaskSenderOnly,
-                        sizeof (timestamp), &timestamp);
-#else  /* !TARGET_API_MAC_CARBON */
-  return PutScrap (sizeof (timestamp), SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP,
-                  &timestamp);
-#endif /* !TARGET_API_MAC_CARBON */
+  return STRINGP (value);
 }
 
-/* Check if data for the target type TYPE is available in SCRAP.  */
+/* Put Lisp Object VALUE to the selection SEL.  The target type is
+   specified by TARGET. */
 
-static ScrapFlavorType
-scrap_has_target_type (scrap, type)
-     ScrapRef scrap;
-     Lisp_Object type;
+static OSStatus
+mac_put_selection_value (sel, target, value)
+     Selection sel;
+     Lisp_Object target, value;
 {
-  OSStatus err;
-  ScrapFlavorType flavor_type = get_flavor_type_from_symbol (type);
+  ScrapFlavorType flavor_type = get_flavor_type_from_symbol (target, 0);
 
-  if (flavor_type)
-    {
-#if TARGET_API_MAC_CARBON
-      ScrapFlavorFlags flags;
+  if (flavor_type == 0 || !STRINGP (value))
+    return noTypeErr;
 
-      err = GetScrapFlavorFlags (scrap, flavor_type, &flags);
-      if (err != noErr)
-       flavor_type = 0;
+#if TARGET_API_MAC_CARBON
+  return PutScrapFlavor (sel, flavor_type, kScrapFlavorMaskNone,
+                        SBYTES (value), SDATA (value));
 #else  /* !TARGET_API_MAC_CARBON */
-      SInt32 size, offset;
-
-      size = GetScrap (NULL, flavor_type, &offset);
-      if (size < 0)
-       flavor_type = 0;
+  return PutScrap (SBYTES (value), flavor_type, SDATA (value));
 #endif /* !TARGET_API_MAC_CARBON */
-    }
+}
 
-  return flavor_type;
+/* Check if data for the target type TARGET is available in SEL.  */
+
+static int
+mac_selection_has_target_p (sel, target)
+     Selection sel;
+     Lisp_Object target;
+{
+  return get_flavor_type_from_symbol (target, sel) != 0;
 }
 
-/* Get data for the target type TYPE from SCRAP and create a Lisp
+/* Get data for the target type TARGET from SEL and create a Lisp
    string.  Return nil if failed to get data.  */
 
 static Lisp_Object
-get_scrap_string (scrap, type)
-     ScrapRef scrap;
-     Lisp_Object type;
+mac_get_selection_value (sel, target)
+     Selection sel;
+     Lisp_Object target;
 {
   OSStatus err;
   Lisp_Object result = Qnil;
-  ScrapFlavorType flavor_type = get_flavor_type_from_symbol (type);
+  ScrapFlavorType flavor_type = get_flavor_type_from_symbol (target, sel);
 #if TARGET_API_MAC_CARBON
   Size size;
 
   if (flavor_type)
     {
-      err = GetScrapFlavorSize (scrap, flavor_type, &size);
+      err = GetScrapFlavorSize (sel, flavor_type, &size);
       if (err == noErr)
        {
          do
            {
              result = make_uninit_string (size);
-             err = GetScrapFlavorData (scrap, flavor_type,
+             err = GetScrapFlavorData (sel, flavor_type,
                                        &size, SDATA (result));
              if (err != noErr)
                result = Qnil;
@@ -308,72 +331,25 @@ get_scrap_string (scrap, type)
   return result;
 }
 
-/* Get timestamp from the scrap SCRAP and set to *TIMPSTAMP.  */
-
-static OSStatus
-get_scrap_private_timestamp (scrap, timestamp)
-     ScrapRef scrap;
-     unsigned long *timestamp;
-{
-  OSStatus err = noErr;
-#if TARGET_API_MAC_CARBON
-  ScrapFlavorFlags flags;
-
-  err = GetScrapFlavorFlags (scrap, SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP, &flags);
-  if (err == noErr)
-    {
-      if (!(flags & kScrapFlavorMaskSenderOnly))
-       err = noTypeErr;
-      else
-       {
-         Size size = sizeof (*timestamp);
-
-         err = GetScrapFlavorData (scrap, SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP,
-                                   &size, timestamp);
-         if (err == noErr && size != sizeof (*timestamp))
-           err = noTypeErr;
-       }
-    }
-#else  /* !TARGET_API_MAC_CARBON */
-  Handle handle;
-  SInt32 size, offset;
-
-  size = GetScrap (NULL, SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP, &offset);
-  if (size == sizeof (*timestamp))
-    {
-      handle = NewHandle (size);
-      HLock (handle);
-      size = GetScrap (handle, SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP, &offset);
-      if (size == sizeof (*timestamp))
-       *timestamp = *((unsigned long *) *handle);
-      DisposeHandle (handle);
-    }
-  if (size != sizeof (*timestamp))
-    err = noTypeErr;
-#endif /* !TARGET_API_MAC_CARBON */
-
-  return err;
-}
-
-/* Get the list of target types in SCRAP.  The return value is a list
-   of target type symbols possibly followed by scrap flavor type
+/* Get the list of target types in SEL.  The return value is a list of
+   target type symbols possibly followed by scrap flavor type
    strings.  */
 
 static Lisp_Object
-get_scrap_target_type_list (scrap)
-     ScrapRef scrap;
+mac_get_selection_target_list (sel)
+     Selection sel;
 {
-  Lisp_Object result = Qnil, rest, target_type;
+  Lisp_Object result = Qnil, rest, target;
 #if TARGET_API_MAC_CARBON
   OSStatus err;
   UInt32 count, i, type;
   ScrapFlavorInfo *flavor_info = NULL;
   Lisp_Object strings = Qnil;
 
-  err = GetScrapFlavorCount (scrap, &count);
+  err = GetScrapFlavorCount (sel, &count);
   if (err == noErr)
     flavor_info = xmalloc (sizeof (ScrapFlavorInfo) * count);
-  err = GetScrapFlavorInfoList (scrap, &count, flavor_info);
+  err = GetScrapFlavorInfoList (sel, &count, flavor_info);
   if (err != noErr)
     {
       xfree (flavor_info);
@@ -387,11 +363,11 @@ get_scrap_target_type_list (scrap)
       ScrapFlavorType flavor_type = 0;
 
       if (CONSP (XCAR (rest))
-         && (target_type = XCAR (XCAR (rest)),
-             SYMBOLP (target_type))
-         && (flavor_type = scrap_has_target_type (scrap, target_type)))
+         && (target = XCAR (XCAR (rest)),
+             SYMBOLP (target))
+         && (flavor_type = get_flavor_type_from_symbol (target, sel)))
        {
-         result = Fcons (target_type, result);
+         result = Fcons (target, result);
 #if TARGET_API_MAC_CARBON
          for (i = 0; i < count; i++)
            if (flavor_info[i].flavorType == flavor_type)
@@ -428,9 +404,9 @@ x_own_selection (selection_name, selection_value)
      Lisp_Object selection_name, selection_value;
 {
   OSStatus err;
-  ScrapRef scrap;
+  Selection sel;
   struct gcpro gcpro1, gcpro2;
-  Lisp_Object rest, handler_fn, value, type;
+  Lisp_Object rest, handler_fn, value, target_type;
   int count;
 
   CHECK_SYMBOL (selection_name);
@@ -439,8 +415,8 @@ x_own_selection (selection_name, selection_value)
 
   BLOCK_INPUT;
 
-  err = get_scrap_from_symbol (selection_name, 1, &scrap);
-  if (err == noErr && scrap)
+  err = mac_get_selection_from_symbol (selection_name, 1, &sel);
+  if (err == noErr && sel)
     {
       /* Don't allow a quit within the converter.
         When the user types C-g, he would be surprised
@@ -451,49 +427,56 @@ x_own_selection (selection_name, selection_value)
       for (rest = Vselection_converter_alist; CONSP (rest); rest = XCDR (rest))
        {
          if (!(CONSP (XCAR (rest))
-               && (type = XCAR (XCAR (rest)),
-                   SYMBOLP (type))
-               && valid_scrap_target_type_p (type)
+               && (target_type = XCAR (XCAR (rest)),
+                   SYMBOLP (target_type))
+               && mac_valid_selection_target_p (target_type)
                && (handler_fn = XCDR (XCAR (rest)),
                    SYMBOLP (handler_fn))))
            continue;
 
          if (!NILP (handler_fn))
            value = call3 (handler_fn, selection_name,
-                          type, selection_value);
+                          target_type, selection_value);
+
+         if (NILP (value))
+           continue;
 
-         if (STRINGP (value))
-           err = put_scrap_string (scrap, type, value);
+         if (mac_valid_selection_value_p (value, target_type))
+           err = mac_put_selection_value (sel, target_type, value);
          else if (CONSP (value)
-                  && EQ (XCAR (value), type)
-                  && STRINGP (XCDR (value)))
-           err = put_scrap_string (scrap, type, XCDR (value));
+                  && EQ (XCAR (value), target_type)
+                  && mac_valid_selection_value_p (XCDR (value), target_type))
+           err = mac_put_selection_value (sel, target_type, XCDR (value));
        }
 
       unbind_to (count, Qnil);
-
-      if (err == noErr)
-       err = put_scrap_private_timestamp (scrap, last_event_timestamp);
     }
 
   UNBLOCK_INPUT;
 
   UNGCPRO;
 
-  if (scrap && err != noErr)
+  if (sel && err != noErr)
     error ("Can't set selection");
 
   /* Now update the local cache */
   {
     Lisp_Object selection_time;
     Lisp_Object selection_data;
+    Lisp_Object ownership_info;
     Lisp_Object prev_value;
 
     selection_time = long_to_cons (last_event_timestamp);
+    if (sel)
+      ownership_info = mac_get_selection_ownership_info (sel);
+    else
+      ownership_info = Qnil;   /* dummy value for local-only selection */
     selection_data = Fcons (selection_name,
                            Fcons (selection_value,
                                   Fcons (selection_time,
-                                         Fcons (selected_frame, Qnil))));
+                                         Fcons (selected_frame,
+                                                Fcons (ownership_info,
+                                                       Qnil)))));
     prev_value = assq_no_quit (selection_name, Vselection_alist);
 
     Vselection_alist = Fcons (selection_data, Vselection_alist);
@@ -574,29 +557,20 @@ x_get_local_selection (selection_symbol, target_type, local_request)
       unbind_to (count, Qnil);
     }
 
+  if (local_request)
+    return value;
+
   /* Make sure this value is of a type that we could transmit
-     to another X client.  */
+     to another application.  */
 
+  type = target_type;
   check = value;
   if (CONSP (value)
       && SYMBOLP (XCAR (value)))
     type = XCAR (value),
     check = XCDR (value);
 
-  if (STRINGP (check)
-      || VECTORP (check)
-      || SYMBOLP (check)
-      || INTEGERP (check)
-      || NILP (value))
-    return value;
-  /* Check for a value that cons_to_long could handle.  */
-  else if (CONSP (check)
-          && INTEGERP (XCAR (check))
-          && (INTEGERP (XCDR (check))
-              ||
-              (CONSP (XCDR (check))
-               && INTEGERP (XCAR (XCDR (check)))
-               && NILP (XCDR (XCDR (check))))))
+  if (NILP (value) || mac_valid_selection_value_p (check, type))
     return value;
 
   signal_error ("Invalid data returned by selection-conversion function",
@@ -676,22 +650,22 @@ x_get_foreign_selection (selection_symbol, target_type, time_stamp)
      Lisp_Object selection_symbol, target_type, time_stamp;
 {
   OSStatus err;
-  ScrapRef scrap;
+  Selection sel;
   Lisp_Object result = Qnil;
 
   BLOCK_INPUT;
 
-  err = get_scrap_from_symbol (selection_symbol, 0, &scrap);
-  if (err == noErr && scrap)
+  err = mac_get_selection_from_symbol (selection_symbol, 0, &sel);
+  if (err == noErr && sel)
     {
       if (EQ (target_type, QTARGETS))
        {
-         result = get_scrap_target_type_list (scrap);
+         result = mac_get_selection_target_list (sel);
          result = Fvconcat (1, &result);
        }
       else
        {
-         result = get_scrap_string (scrap, target_type);
+         result = mac_get_selection_value (sel, target_type);
          if (STRINGP (result))
            Fput_text_property (make_number (0), make_number (SBYTES (result)),
                                Qforeign_selection, target_type, result);
@@ -770,7 +744,7 @@ Disowning it means there is no such selection.  */)
      Lisp_Object time;
 {
   OSStatus err;
-  ScrapRef scrap;
+  Selection sel;
   Lisp_Object local_selection_data;
 
   check_mac ();
@@ -812,9 +786,9 @@ Disowning it means there is no such selection.  */)
 
   BLOCK_INPUT;
 
-  err = get_scrap_from_symbol (selection, 0, &scrap);
-  if (err == noErr && scrap)
-    clear_scrap (&scrap);
+  err = mac_get_selection_from_symbol (selection, 0, &sel);
+  if (err == noErr && sel)
+    mac_clear_selection (&sel);
 
   UNBLOCK_INPUT;
 
@@ -833,7 +807,7 @@ and t is the same as `SECONDARY'.  */)
      Lisp_Object selection;
 {
   OSStatus err;
-  ScrapRef scrap;
+  Selection sel;
   Lisp_Object result = Qnil, local_selection_data;
 
   check_mac ();
@@ -848,15 +822,14 @@ and t is the same as `SECONDARY'.  */)
 
   BLOCK_INPUT;
 
-  err = get_scrap_from_symbol (selection, 0, &scrap);
-  if (err == noErr && scrap)
+  err = mac_get_selection_from_symbol (selection, 0, &sel);
+  if (err == noErr && sel)
     {
-      unsigned long timestamp;
+      Lisp_Object ownership_info;
 
-      err = get_scrap_private_timestamp (scrap, &timestamp);
-      if (err == noErr
-         && (timestamp
-             == cons_to_long (XCAR (XCDR (XCDR (local_selection_data))))))
+      ownership_info = XCAR (XCDR (XCDR (XCDR (XCDR (local_selection_data)))));
+      if (!NILP (Fequal (ownership_info,
+                        mac_get_selection_ownership_info (sel))))
        result = Qt;
     }
   else
@@ -878,7 +851,7 @@ and t is the same as `SECONDARY'.  */)
      Lisp_Object selection;
 {
   OSStatus err;
-  ScrapRef scrap;
+  Selection sel;
   Lisp_Object result = Qnil, rest;
 
   /* It should be safe to call this before we have an Mac frame.  */
@@ -893,12 +866,12 @@ and t is the same as `SECONDARY'.  */)
 
   BLOCK_INPUT;
 
-  err = get_scrap_from_symbol (selection, 0, &scrap);
-  if (err == noErr && scrap)
+  err = mac_get_selection_from_symbol (selection, 0, &sel);
+  if (err == noErr && sel)
     for (rest = Vselection_converter_alist; CONSP (rest); rest = XCDR (rest))
       {
        if (CONSP (XCAR (rest)) && SYMBOLP (XCAR (XCAR (rest)))
-           && scrap_has_target_type (scrap, XCAR (XCAR (rest))))
+           && mac_selection_has_target_p (sel, XCAR (XCAR (rest))))
          {
            result = Qt;
            break;
@@ -1623,16 +1596,19 @@ remove_drag_handler (window)
                        Services menu support
 ***********************************************************************/
 #ifdef MAC_OSX
-void
-init_service_handler ()
+OSStatus
+install_service_handler ()
 {
   static const EventTypeSpec specs[] =
     {{kEventClassService, kEventServiceGetTypes},
      {kEventClassService, kEventServiceCopy},
      {kEventClassService, kEventServicePaste},
      {kEventClassService, kEventServicePerform}};
-  InstallApplicationEventHandler (NewEventHandlerUPP (mac_handle_service_event),
-                                 GetEventTypeCount (specs), specs, NULL, NULL);
+
+  return InstallApplicationEventHandler (NewEventHandlerUPP
+                                        (mac_handle_service_event),
+                                        GetEventTypeCount (specs),
+                                        specs, NULL, NULL);
 }
 
 extern OSStatus mac_store_service_event P_ ((EventRef));
@@ -1697,7 +1673,7 @@ mac_handle_service_event (call_ref, event, data)
   if (!SYMBOLP (Vmac_service_selection))
     err = eventNotHandledErr;
   else
-    err = get_scrap_from_symbol (Vmac_service_selection, 0, &cur_scrap);
+    err = mac_get_selection_from_symbol (Vmac_service_selection, 0, &cur_scrap);
   if (!(err == noErr && cur_scrap))
     return eventNotHandledErr;
 
@@ -1716,7 +1692,7 @@ mac_handle_service_event (call_ref, event, data)
           rest = XCDR (rest))
        if (CONSP (XCAR (rest)) && SYMBOLP (XCAR (XCAR (rest)))
            && (flavor_type =
-               get_flavor_type_from_symbol (XCAR (XCAR (rest)))))
+               get_flavor_type_from_symbol (XCAR (XCAR (rest)), 0)))
          {
            type = CreateTypeStringWithOSType (flavor_type);
            if (type)
@@ -1801,14 +1777,15 @@ mac_handle_service_event (call_ref, event, data)
                                 NULL, sizeof (ScrapRef), NULL,
                                 &specific_scrap);
        if (err == noErr)
-         err = clear_scrap (&cur_scrap);
+         err = mac_clear_selection (&cur_scrap);
        if (err == noErr)
          for (rest = Vselection_converter_alist; CONSP (rest);
               rest = XCDR (rest))
            {
              if (! (CONSP (XCAR (rest)) && SYMBOLP (XCAR (XCAR (rest)))))
                continue;
-             flavor_type = get_flavor_type_from_symbol (XCAR (XCAR (rest)));
+             flavor_type = get_flavor_type_from_symbol (XCAR (XCAR (rest)),
+                                                        specific_scrap);
              if (flavor_type == 0)
                continue;
              err = copy_scrap_flavor_data (specific_scrap, cur_scrap,
index b282bac..9655b09 100644 (file)
@@ -35,12 +35,7 @@ Boston, MA 02110-1301, USA.  */
 #include <alloca.h>
 #endif
 
-#if TARGET_API_MAC_CARBON
-/* USE_CARBON_EVENTS determines if the Carbon Event Manager is used to
-   obtain events from the event queue.  If set to 0, WaitNextEvent is
-   used instead.  */
-#define USE_CARBON_EVENTS 1
-#else /* not TARGET_API_MAC_CARBON */
+#if !TARGET_API_MAC_CARBON
 #include <Quickdraw.h>
 #include <ToolUtils.h>
 #include <Sound.h>
@@ -263,7 +258,7 @@ static void x_scroll_bar_report_motion P_ ((struct frame **, Lisp_Object *,
                                            Lisp_Object *, Lisp_Object *,
                                            unsigned long *));
 
-static int is_emacs_window P_ ((WindowPtr));
+static int is_emacs_window P_ ((WindowRef));
 static XCharStruct *mac_per_char_metric P_ ((XFontStruct *, XChar2b *, int));
 static void XSetFont P_ ((Display *, GC, XFontStruct *));
 
@@ -416,7 +411,8 @@ mac_prepare_for_quickdraw (f)
 static RgnHandle saved_port_clip_region = NULL;
 
 static void
-mac_begin_clip (gc)
+mac_begin_clip (f, gc)
+     struct frame *f;
      GC gc;
 {
   static RgnHandle new_region = NULL;
@@ -426,6 +422,11 @@ mac_begin_clip (gc)
   if (new_region == NULL)
     new_region = NewRgn ();
 
+#if USE_CG_DRAWING
+  mac_prepare_for_quickdraw (f);
+#endif
+  SetPortWindowPort (FRAME_MAC_WINDOW (f));
+
   if (gc->n_clip_rects)
     {
       GetClip (saved_port_clip_region);
@@ -445,15 +446,6 @@ mac_end_clip (gc)
 
 /* X display function emulation */
 
-void
-XFreePixmap (display, pixmap)
-     Display *display;         /* not used */
-     Pixmap pixmap;
-{
-  DisposeGWorld (pixmap);
-}
-
-
 /* Mac version of XDrawLine.  */
 
 static void
@@ -495,11 +487,8 @@ mac_draw_line (f, gc, x1, y1, x2, y2)
        x2--;
     }
 
-  SetPortWindowPort (FRAME_MAC_WINDOW (f));
-
+  mac_begin_clip (f, gc);
   RGBForeColor (GC_FORE_COLOR (gc));
-
-  mac_begin_clip (gc);
   MoveTo (x1, y1);
   LineTo (x2, y2);
   mac_end_clip (gc);
@@ -555,25 +544,25 @@ mac_erase_rectangle (f, gc, x, y, width, height)
      unsigned int width, height;
 {
 #if USE_CG_DRAWING
-  CGContextRef context;
+    {
+      CGContextRef context;
 
-  context = mac_begin_cg_clip (f, gc);
-  CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc);
-  CGContextFillRect (context, CGRectMake (x, y, width, height));
-  mac_end_cg_clip (f);
+      context = mac_begin_cg_clip (f, gc);
+      CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc);
+      CGContextFillRect (context, CGRectMake (x, y, width, height));
+      mac_end_cg_clip (f);
+    }
 #else
-  Rect r;
-
-  SetPortWindowPort (FRAME_MAC_WINDOW (f));
-
-  RGBBackColor (GC_BACK_COLOR (gc));
-  SetRect (&r, x, y, x + width, y + height);
-
-  mac_begin_clip (gc);
-  EraseRect (&r);
-  mac_end_clip (gc);
+    {
+      Rect r;
 
-  RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f)));
+      mac_begin_clip (f, gc);
+      RGBBackColor (GC_BACK_COLOR (gc));
+      SetRect (&r, x, y, x + width, y + height);
+      EraseRect (&r);
+      RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f)));
+      mac_end_clip (gc);
+    }
 #endif
 }
 
@@ -596,15 +585,17 @@ mac_clear_window (f)
      struct frame *f;
 {
 #if USE_CG_DRAWING
-  CGContextRef context;
-  GC gc = FRAME_NORMAL_GC (f);
-
-  context = mac_begin_cg_clip (f, NULL);
-  CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc);
-  CGContextFillRect (context, CGRectMake (0, 0, FRAME_PIXEL_WIDTH (f),
-                                         FRAME_PIXEL_HEIGHT (f)));
-  mac_end_cg_clip (f);
-#else
+  {
+    CGContextRef context;
+    GC gc = FRAME_NORMAL_GC (f);
+
+    context = mac_begin_cg_clip (f, NULL);
+    CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc);
+    CGContextFillRect (context, CGRectMake (0, 0, FRAME_PIXEL_WIDTH (f),
+                                           FRAME_PIXEL_HEIGHT (f)));
+    mac_end_cg_clip (f);
+  }
+#else  /* !USE_CG_DRAWING */
   SetPortWindowPort (FRAME_MAC_WINDOW (f));
 
   RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f)));
@@ -678,13 +669,10 @@ mac_draw_bitmap (f, gc, x, y, width, height, bits, overlay_p)
   bitmap.baseAddr = (char *)bits;
   SetRect (&(bitmap.bounds), 0, 0, width, height);
 
-  SetPortWindowPort (FRAME_MAC_WINDOW (f));
-
+  mac_begin_clip (f, gc);
   RGBForeColor (GC_FORE_COLOR (gc));
   RGBBackColor (GC_BACK_COLOR (gc));
   SetRect (&r, x, y, x + width, y + height);
-
-  mac_begin_clip (gc);
 #if TARGET_API_MAC_CARBON
   {
     CGrafPtr port;
@@ -699,9 +687,8 @@ mac_draw_bitmap (f, gc, x, y, width, height, bits, overlay_p)
   CopyBits (&bitmap, &(FRAME_MAC_WINDOW (f)->portBits), &(bitmap.bounds), &r,
            overlay_p ? srcOr : srcCopy, 0);
 #endif /* not TARGET_API_MAC_CARBON */
-  mac_end_clip (gc);
-
   RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f)));
+  mac_end_clip (gc);
 }
 #endif /* !USE_CG_DRAWING */
 
@@ -752,8 +739,8 @@ mac_free_bitmap (bitmap)
 
 Pixmap
 XCreatePixmap (display, w, width, height, depth)
-     Display *display;         /* not used */
-     WindowPtr w;
+     Display *display;
+     WindowRef w;
      unsigned int width, height;
      unsigned int depth;
 {
@@ -781,8 +768,8 @@ XCreatePixmap (display, w, width, height, depth)
 
 Pixmap
 XCreatePixmapFromBitmapData (display, w, data, width, height, fg, bg, depth)
-     Display *display;         /* not used */
-     WindowPtr w;
+     Display *display;
+     WindowRef w;
      char *data;
      unsigned int width, height;
      unsigned long fg, bg;
@@ -792,7 +779,7 @@ XCreatePixmapFromBitmapData (display, w, data, width, height, fg, bg, depth)
   BitMap bitmap;
   CGrafPtr old_port;
   GDHandle old_gdh;
-  static GC gc = NULL;         /* not reentrant */
+  static GC gc = NULL;
 
   if (gc == NULL)
     gc = XCreateGC (display, w, 0, NULL);
@@ -824,6 +811,15 @@ XCreatePixmapFromBitmapData (display, w, data, width, height, fg, bg, depth)
 }
 
 
+void
+XFreePixmap (display, pixmap)
+     Display *display;
+     Pixmap pixmap;
+{
+  DisposeGWorld (pixmap);
+}
+
+
 /* Mac replacement for XFillRectangle.  */
 
 static void
@@ -843,12 +839,9 @@ mac_fill_rectangle (f, gc, x, y, width, height)
 #else
   Rect r;
 
-  SetPortWindowPort (FRAME_MAC_WINDOW (f));
-
+  mac_begin_clip (f, gc);
   RGBForeColor (GC_FORE_COLOR (gc));
   SetRect (&r, x, y, x + width, y + height);
-
-  mac_begin_clip (gc);
   PaintRect (&r); /* using foreground color of gc */
   mac_end_clip (gc);
 #endif
@@ -875,18 +868,34 @@ mac_draw_rectangle (f, gc, x, y, width, height)
 #else
   Rect r;
 
-  SetPortWindowPort (FRAME_MAC_WINDOW (f));
-
+  mac_begin_clip (f, gc);
   RGBForeColor (GC_FORE_COLOR (gc));
   SetRect (&r, x, y, x + width + 1, y + height + 1);
-
-  mac_begin_clip (gc);
   FrameRect (&r); /* using foreground color of gc */
   mac_end_clip (gc);
 #endif
 }
 
 
+static void
+mac_invert_rectangle (f, x, y, width, height)
+     struct frame *f;
+     int x, y;
+     unsigned int width, height;
+{
+  Rect r;
+
+#if USE_CG_DRAWING
+  mac_prepare_for_quickdraw (f);
+#endif
+  SetPortWindowPort (FRAME_MAC_WINDOW (f));
+
+  SetRect (&r, x, y, x + width, y + height);
+
+  InvertRect (&r);
+}
+
+
 #if USE_ATSUI
 static OSStatus
 atsu_get_text_layout_with_text_ptr (text, text_length, style, text_layout)
@@ -896,7 +905,7 @@ atsu_get_text_layout_with_text_ptr (text, text_length, style, text_layout)
      ATSUTextLayout *text_layout;
 {
   OSStatus err;
-  static ATSUTextLayout saved_text_layout = NULL; /* not reentrant */
+  static ATSUTextLayout saved_text_layout = NULL;
 
   if (saved_text_layout == NULL)
     {
@@ -923,7 +932,6 @@ atsu_get_text_layout_with_text_ptr (text, text_length, style, text_layout)
        err = ATSUSetLayoutControls (saved_text_layout,
                                     sizeof (tags) / sizeof (tags[0]),
                                     tags, sizes, values);
-      /* XXX: Should we do this? */
       if (err == noErr)
        err = ATSUSetTransientFontMatching (saved_text_layout, true);
     }
@@ -942,224 +950,224 @@ atsu_get_text_layout_with_text_ptr (text, text_length, style, text_layout)
     *text_layout = saved_text_layout;
   return err;
 }
-#endif
-
-
-static void
-mac_invert_rectangle (f, x, y, width, height)
-     struct frame *f;
-     int x, y;
-     unsigned int width, height;
-{
-  Rect r;
-
-#if USE_CG_DRAWING
-  mac_prepare_for_quickdraw (f);
-#endif
-  SetPortWindowPort (FRAME_MAC_WINDOW (f));
-
-  SetRect (&r, x, y, x + width, y + height);
-
-  InvertRect (&r);
-}
 
 
 static void
-mac_draw_string_common (f, gc, x, y, buf, nchars, bg_width,
-                       overstrike_p, bytes_per_char)
+mac_draw_image_string_atsui (f, gc, x, y, buf, nchars, bg_width,
+                            overstrike_p, bytes_per_char)
      struct frame *f;
      GC gc;
      int x, y;
      char *buf;
      int nchars, bg_width, overstrike_p, bytes_per_char;
 {
-  SetPortWindowPort (FRAME_MAC_WINDOW (f));
-
-#if USE_ATSUI
-  if (GC_FONT (gc)->mac_style)
-    {
-      OSStatus err;
-      ATSUTextLayout text_layout;
+  OSStatus err;
+  ATSUTextLayout text_layout;
 
-      xassert (bytes_per_char == 2);
+  xassert (bytes_per_char == 2);
 
 #ifndef WORDS_BIG_ENDIAN
-      {
-       int i;
-       UniChar *text = (UniChar *)buf;
+  {
+    int i;
+    UniChar *text = (UniChar *)buf;
 
-       for (i = 0; i < nchars; i++)
-         text[i] = EndianU16_BtoN (text[i]);
-      }
+    for (i = 0; i < nchars; i++)
+      text[i] = EndianU16_BtoN (text[i]);
+  }
 #endif
-      err = atsu_get_text_layout_with_text_ptr ((ConstUniCharArrayPtr)buf,
-                                               nchars,
-                                               GC_FONT (gc)->mac_style,
-                                               &text_layout);
-      if (err != noErr)
-       return;
+  err = atsu_get_text_layout_with_text_ptr ((ConstUniCharArrayPtr)buf,
+                                           nchars,
+                                           GC_FONT (gc)->mac_style,
+                                           &text_layout);
+  if (err != noErr)
+    return;
 #ifdef MAC_OSX
-      if (!mac_use_core_graphics)
-       {
-#endif
-#if USE_CG_DRAWING
-         mac_prepare_for_quickdraw (f);
+  if (!mac_use_core_graphics)
+    {
 #endif
-         mac_begin_clip (gc);
-         RGBForeColor (GC_FORE_COLOR (gc));
-         if (bg_width)
-           {
-             Rect r;
+      mac_begin_clip (f, gc);
+      RGBForeColor (GC_FORE_COLOR (gc));
+      if (bg_width)
+       {
+         Rect r;
 
-             SetRect (&r, x, y - FONT_BASE (GC_FONT (gc)),
-                      x + bg_width, y + FONT_DESCENT (GC_FONT (gc)));
-             RGBBackColor (GC_BACK_COLOR (gc));
-             EraseRect (&r);
-             RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f)));
-           }
-         MoveTo (x, y);
+         SetRect (&r, x, y - FONT_BASE (GC_FONT (gc)),
+                  x + bg_width, y + FONT_DESCENT (GC_FONT (gc)));
+         RGBBackColor (GC_BACK_COLOR (gc));
+         EraseRect (&r);
+         RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f)));
+       }
+      MoveTo (x, y);
+      ATSUDrawText (text_layout,
+                   kATSUFromTextBeginning, kATSUToTextEnd,
+                   kATSUUseGrafPortPenLoc, kATSUUseGrafPortPenLoc);
+      if (overstrike_p)
+       {
+         MoveTo (x + 1, y);
          ATSUDrawText (text_layout,
                        kATSUFromTextBeginning, kATSUToTextEnd,
                        kATSUUseGrafPortPenLoc, kATSUUseGrafPortPenLoc);
-         if (overstrike_p)
-           {
-             MoveTo (x + 1, y);
-             ATSUDrawText (text_layout,
-                           kATSUFromTextBeginning, kATSUToTextEnd,
-                           kATSUUseGrafPortPenLoc, kATSUUseGrafPortPenLoc);
-           }
-         mac_end_clip (gc);
-#ifdef MAC_OSX
        }
-      else
-       {
-         CGrafPtr port;
-         static CGContextRef context;
-         float port_height = FRAME_PIXEL_HEIGHT (f);
-         static const ATSUAttributeTag tags[] = {kATSUCGContextTag};
-         static const ByteCount sizes[] = {sizeof (CGContextRef)};
-         static const ATSUAttributeValuePtr values[] = {&context};
+      mac_end_clip (gc);
+#ifdef MAC_OSX
+    }
+  else
+    {
+      static CGContextRef context;
+      float port_height = FRAME_PIXEL_HEIGHT (f);
+      static const ATSUAttributeTag tags[] = {kATSUCGContextTag};
+      static const ByteCount sizes[] = {sizeof (CGContextRef)};
+      static const ATSUAttributeValuePtr values[] = {&context};
 
 #if USE_CG_DRAWING
-         context = mac_begin_cg_clip (f, gc);
+      context = mac_begin_cg_clip (f, gc);
 #else
-         GetPort (&port);
-         QDBeginCGContext (port, &context);
-         if (gc->n_clip_rects || bg_width)
-           {
-             CGContextTranslateCTM (context, 0, port_height);
-             CGContextScaleCTM (context, 1, -1);
-             if (gc->n_clip_rects)
-               CGContextClipToRects (context, gc->clip_rects,
-                                     gc->n_clip_rects);
-#endif
-             if (bg_width)
-               {
-                 CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc);
-                 CGContextFillRect
-                   (context,
-                    CGRectMake (x, y - FONT_BASE (GC_FONT (gc)),
-                                bg_width, FONT_HEIGHT (GC_FONT (gc))));
-               }
-             CGContextScaleCTM (context, 1, -1);
-             CGContextTranslateCTM (context, 0, -port_height);
-#if !USE_CG_DRAWING
-           }
+      CGrafPtr port;
+
+      GetPort (&port);
+      QDBeginCGContext (port, &context);
+      if (gc->n_clip_rects || bg_width)
+       {
+         CGContextTranslateCTM (context, 0, port_height);
+         CGContextScaleCTM (context, 1, -1);
+         if (gc->n_clip_rects)
+           CGContextClipToRects (context, gc->clip_rects,
+                                 gc->n_clip_rects);
 #endif
-         CG_SET_FILL_COLOR_WITH_GC_FOREGROUND (context, gc);
-         err = ATSUSetLayoutControls (text_layout,
-                                      sizeof (tags) / sizeof (tags[0]),
-                                      tags, sizes, values);
-         if (err == noErr)
+         if (bg_width)
            {
-             ATSUDrawText (text_layout,
-                           kATSUFromTextBeginning, kATSUToTextEnd,
-                           Long2Fix (x), Long2Fix (port_height - y));
-             if (overstrike_p)
-               ATSUDrawText (text_layout,
-                             kATSUFromTextBeginning, kATSUToTextEnd,
-                             Long2Fix (x + 1), Long2Fix (port_height - y));
+             CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc);
+             CGContextFillRect (context,
+                                CGRectMake (x, y - FONT_BASE (GC_FONT (gc)),
+                                            bg_width,
+                                            FONT_HEIGHT (GC_FONT (gc))));
            }
+         CGContextScaleCTM (context, 1, -1);
+         CGContextTranslateCTM (context, 0, -port_height);
+#if !USE_CG_DRAWING
+       }
+#endif
+      CG_SET_FILL_COLOR_WITH_GC_FOREGROUND (context, gc);
+      err = ATSUSetLayoutControls (text_layout,
+                                  sizeof (tags) / sizeof (tags[0]),
+                                  tags, sizes, values);
+      if (err == noErr)
+       {
+         ATSUDrawText (text_layout,
+                       kATSUFromTextBeginning, kATSUToTextEnd,
+                       Long2Fix (x), Long2Fix (port_height - y));
+         if (overstrike_p)
+           ATSUDrawText (text_layout,
+                         kATSUFromTextBeginning, kATSUToTextEnd,
+                         Long2Fix (x + 1), Long2Fix (port_height - y));
+       }
 #if USE_CG_DRAWING
-         mac_end_cg_clip (f);
-         context = NULL;
+      mac_end_cg_clip (f);
+      context = NULL;
 #else
-         CGContextSynchronize (context);
-         QDEndCGContext (port, &context);
+      CGContextSynchronize (context);
+      QDEndCGContext (port, &context);
 #endif
 #if 0
-         /* This doesn't work on Mac OS X 10.1.  */
-         ATSUClearLayoutControls (text_layout,
-                                  sizeof (tags) / sizeof (tags[0]), tags);
+      /* This doesn't work on Mac OS X 10.1.  */
+      ATSUClearLayoutControls (text_layout,
+                              sizeof (tags) / sizeof (tags[0]), tags);
 #else
-         ATSUSetLayoutControls (text_layout,
-                                sizeof (tags) / sizeof (tags[0]),
-                                tags, sizes, values);
+      ATSUSetLayoutControls (text_layout,
+                            sizeof (tags) / sizeof (tags[0]),
+                            tags, sizes, values);
 #endif
-       }
-#endif /* MAC_OSX */
     }
-  else
+#endif /* MAC_OSX */
+}
 #endif /* USE_ATSUI */
-    {
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
-      UInt32 savedFlags;
 
-      if (mac_use_core_graphics)
-       savedFlags = SwapQDTextFlags (kQDUseCGTextRendering);
+
+static void
+mac_draw_image_string_qd (f, gc, x, y, buf, nchars, bg_width,
+                         overstrike_p, bytes_per_char)
+     struct frame *f;
+     GC gc;
+     int x, y;
+     char *buf;
+     int nchars, bg_width, overstrike_p, bytes_per_char;
+{
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
+  UInt32 savedFlags;
 #endif
-#if USE_CG_DRAWING
-      mac_prepare_for_quickdraw (f);
+
+  mac_begin_clip (f, gc);
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
+  if (mac_use_core_graphics)
+    savedFlags = SwapQDTextFlags (kQDUseCGTextRendering);
 #endif
-      mac_begin_clip (gc);
-      RGBForeColor (GC_FORE_COLOR (gc));
+  RGBForeColor (GC_FORE_COLOR (gc));
 #ifdef MAC_OS8
-      if (bg_width)
-       {
-         RGBBackColor (GC_BACK_COLOR (gc));
-         TextMode (srcCopy);
-       }
-      else
-       TextMode (srcOr);
+  if (bg_width)
+    {
+      RGBBackColor (GC_BACK_COLOR (gc));
+      TextMode (srcCopy);
+    }
+  else
+    TextMode (srcOr);
 #else
-      /* We prefer not to use srcCopy text transfer mode on Mac OS X
-        because:
-        - Screen is double-buffered.  (In srcCopy mode, a text is
-          drawn into an offscreen graphics world first.  So
-          performance gain cannot be expected.)
-        - It lowers rendering quality.
-        - Some fonts leave garbage on cursor movement.  */
-      if (bg_width)
-       {
-         Rect r;
+  /* We prefer not to use srcCopy text transfer mode on Mac OS X
+     because:
+     - Screen is double-buffered.  (In srcCopy mode, a text is drawn
+       into an offscreen graphics world first.  So performance gain
+       cannot be expected.)
+     - It lowers rendering quality.
+     - Some fonts leave garbage on cursor movement.  */
+  if (bg_width)
+    {
+      Rect r;
 
-         RGBBackColor (GC_BACK_COLOR (gc));
-         SetRect (&r, x, y - FONT_BASE (GC_FONT (gc)),
-                  x + bg_width, y + FONT_DESCENT (GC_FONT (gc)));
-         EraseRect (&r);
-       }
-      TextMode (srcOr);
+      RGBBackColor (GC_BACK_COLOR (gc));
+      SetRect (&r, x, y - FONT_BASE (GC_FONT (gc)),
+              x + bg_width, y + FONT_DESCENT (GC_FONT (gc)));
+      EraseRect (&r);
+    }
+  TextMode (srcOr);
 #endif
-      TextFont (GC_FONT (gc)->mac_fontnum);
-      TextSize (GC_FONT (gc)->mac_fontsize);
-      TextFace (GC_FONT (gc)->mac_fontface);
-      MoveTo (x, y);
+  TextFont (GC_FONT (gc)->mac_fontnum);
+  TextSize (GC_FONT (gc)->mac_fontsize);
+  TextFace (GC_FONT (gc)->mac_fontface);
+  MoveTo (x, y);
+  DrawText (buf, 0, nchars * bytes_per_char);
+  if (overstrike_p)
+    {
+      TextMode (srcOr);
+      MoveTo (x + 1, y);
       DrawText (buf, 0, nchars * bytes_per_char);
-      if (overstrike_p)
-       {
-         TextMode (srcOr);
-         MoveTo (x + 1, y);
-         DrawText (buf, 0, nchars * bytes_per_char);
-       }
-      if (bg_width)
-       RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f)));
-      mac_end_clip (gc);
+    }
+  if (bg_width)
+    RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f)));
+  mac_end_clip (gc);
 
 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
-      if (mac_use_core_graphics)
-       SwapQDTextFlags(savedFlags);
+  if (mac_use_core_graphics)
+    SwapQDTextFlags(savedFlags);
 #endif
-    }
+}
+
+
+static INLINE void
+mac_draw_string_common (f, gc, x, y, buf, nchars, bg_width,
+                       overstrike_p, bytes_per_char)
+     struct frame *f;
+     GC gc;
+     int x, y;
+     char *buf;
+     int nchars, bg_width, overstrike_p, bytes_per_char;
+{
+#if USE_ATSUI
+  if (GC_FONT (gc)->mac_style)
+    mac_draw_image_string_atsui (f, gc, x, y, buf, nchars, bg_width,
+                                overstrike_p, bytes_per_char);
+  else
+#endif /* USE_ATSUI */
+    mac_draw_image_string_qd (f, gc, x, y, buf, nchars, bg_width,
+                             overstrike_p, bytes_per_char);
 }
 
 
@@ -1376,7 +1384,6 @@ mac_draw_image_string_cg (f, gc, x, y, buf, nchars, bg_width, overstrike_p)
      XChar2b *buf;
      int nchars, bg_width, overstrike_p;
 {
-  CGrafPtr port;
   float port_height, gx, gy;
   int i;
   CGContextRef context;
@@ -1386,7 +1393,6 @@ mac_draw_image_string_cg (f, gc, x, y, buf, nchars, bg_width, overstrike_p)
   if (!mac_use_core_graphics || GC_FONT (gc)->cg_font == NULL)
     return 0;
 
-  port = GetWindowPort (FRAME_MAC_WINDOW (f));
   port_height = FRAME_PIXEL_HEIGHT (f);
   gx = x;
   gy = port_height - y;
@@ -1407,7 +1413,7 @@ mac_draw_image_string_cg (f, gc, x, y, buf, nchars, bg_width, overstrike_p)
 #if USE_CG_DRAWING
   context = mac_begin_cg_clip (f, gc);
 #else
-  QDBeginCGContext (port, &context);
+  QDBeginCGContext (GetWindowPort (FRAME_MAC_WINDOW (f)), &context);
   if (gc->n_clip_rects || bg_width)
     {
       CGContextTranslateCTM (context, 0, port_height);
@@ -1447,7 +1453,7 @@ mac_draw_image_string_cg (f, gc, x, y, buf, nchars, bg_width, overstrike_p)
        }
     }
 #if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
-  else
+  else                  /* CGContextShowGlyphsWithAdvances == NULL */
 #endif
 #endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030  */
 #if MAC_OS_X_VERSION_MAX_ALLOWED < 1030 || MAC_OS_X_VERSION_MIN_REQUIRED == 1020
@@ -1465,7 +1471,7 @@ mac_draw_image_string_cg (f, gc, x, y, buf, nchars, bg_width, overstrike_p)
   mac_end_cg_clip (f);
 #else
   CGContextSynchronize (context);
-  QDEndCGContext (port, &context);
+  QDEndCGContext (GetWindowPort (FRAME_MAC_WINDOW (f)), &context);
 #endif
 
   return 1;
@@ -1487,7 +1493,7 @@ mac_copy_area (src, f, gc, src_x, src_y, width, height, dest_x, dest_y)
 {
   Rect src_r, dest_r;
 
-  SetPortWindowPort (FRAME_MAC_WINDOW (f));
+  mac_begin_clip (f, gc);
 
   SetRect (&src_r, src_x, src_y, src_x + width, src_y + height);
   SetRect (&dest_r, dest_x, dest_y, dest_x + width, dest_y + height);
@@ -1495,7 +1501,6 @@ mac_copy_area (src, f, gc, src_x, src_y, width, height, dest_x, dest_y)
   ForeColor (blackColor);
   BackColor (whiteColor);
 
-  mac_begin_clip (gc);
   LockPixels (GetGWorldPixMap (src));
 #if TARGET_API_MAC_CARBON
   {
@@ -1513,9 +1518,10 @@ mac_copy_area (src, f, gc, src_x, src_y, width, height, dest_x, dest_y)
            &src_r, &dest_r, srcCopy, 0);
 #endif /* not TARGET_API_MAC_CARBON */
   UnlockPixels (GetGWorldPixMap (src));
-  mac_end_clip (gc);
 
   RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f)));
+
+  mac_end_clip (gc);
 }
 
 
@@ -1531,7 +1537,7 @@ mac_copy_area_with_mask (src, mask, f, gc, src_x, src_y,
 {
   Rect src_r, dest_r;
 
-  SetPortWindowPort (FRAME_MAC_WINDOW (f));
+  mac_begin_clip (f, gc);
 
   SetRect (&src_r, src_x, src_y, src_x + width, src_y + height);
   SetRect (&dest_r, dest_x, dest_y, dest_x + width, dest_y + height);
@@ -1539,7 +1545,6 @@ mac_copy_area_with_mask (src, mask, f, gc, src_x, src_y,
   ForeColor (blackColor);
   BackColor (whiteColor);
 
-  mac_begin_clip (gc);
   LockPixels (GetGWorldPixMap (src));
   LockPixels (GetGWorldPixMap (mask));
 #if TARGET_API_MAC_CARBON
@@ -1559,9 +1564,10 @@ mac_copy_area_with_mask (src, mask, f, gc, src_x, src_y,
 #endif /* not TARGET_API_MAC_CARBON */
   UnlockPixels (GetGWorldPixMap (mask));
   UnlockPixels (GetGWorldPixMap (src));
-  mac_end_clip (gc);
 
   RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f)));
+
+  mac_end_clip (gc);
 }
 #endif /* !USE_CG_DRAWING */
 
@@ -1590,9 +1596,9 @@ mac_scroll_area (f, gc, src_x, src_y, width, height, dest_x, dest_y)
   DisposeRgn (dummy);
 #else /* not TARGET_API_MAC_CARBON */
   Rect src_r, dest_r;
-  WindowPtr w = FRAME_MAC_WINDOW (f);
+  WindowRef w = FRAME_MAC_WINDOW (f);
 
-  SetPort (w);
+  mac_begin_clip (f, gc);
 
   SetRect (&src_r, src_x, src_y, src_x + width, src_y + height);
   SetRect (&dest_r, dest_x, dest_y, dest_x + width, dest_y + height);
@@ -1601,11 +1607,11 @@ mac_scroll_area (f, gc, src_x, src_y, width, height, dest_x, dest_y)
      color mapping in CopyBits.  Otherwise, it will be slow.  */
   ForeColor (blackColor);
   BackColor (whiteColor);
-  mac_begin_clip (gc);
   CopyBits (&(w->portBits), &(w->portBits), &src_r, &dest_r, srcCopy, 0);
-  mac_end_clip (gc);
 
   RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f)));
+
+  mac_end_clip (gc);
 #endif /* not TARGET_API_MAC_CARBON */
 }
 
@@ -1850,7 +1856,7 @@ mac_reset_clip_rectangles (display, gc)
 void
 XSetWindowBackground (display, w, color)
      Display *display;
-     WindowPtr w;
+     WindowRef w;
      unsigned long color;
 {
 #if !TARGET_API_MAC_CARBON
@@ -2188,6 +2194,81 @@ x_draw_fringe_bitmap (w, row, p)
   Display *display = FRAME_MAC_DISPLAY (f);
   struct face *face = p->face;
   int rowY;
+  int overlay_p = p->overlay_p;
+
+#ifdef MAC_OSX
+  if (!overlay_p)
+    {
+      int bx = p->bx, by = p->by, nx = p->nx, ny = p->ny;
+
+#if 0  /* MAC_TODO: stipple */
+      /* In case the same realized face is used for fringes and
+        for something displayed in the text (e.g. face `region' on
+        mono-displays, the fill style may have been changed to
+        FillSolid in x_draw_glyph_string_background.  */
+      if (face->stipple)
+       XSetFillStyle (FRAME_X_DISPLAY (f), face->gc, FillOpaqueStippled);
+      else
+       XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->background);
+#endif
+
+      /* If the fringe is adjacent to the left (right) scroll bar of a
+        leftmost (rightmost, respectively) window, then extend its
+        background to the gap between the fringe and the bar.  */
+      if ((WINDOW_LEFTMOST_P (w)
+          && WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w))
+         || (WINDOW_RIGHTMOST_P (w)
+             && WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w)))
+       {
+         int sb_width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w);
+
+         if (sb_width > 0)
+           {
+             int left = WINDOW_SCROLL_BAR_AREA_X (w);
+             int width = (WINDOW_CONFIG_SCROLL_BAR_COLS (w)
+                          * FRAME_COLUMN_WIDTH (f));
+
+             if (bx < 0
+                 && (left + width == p->x
+                     || p->x + p->wd == left))
+               {
+                 /* Bitmap fills the fringe and we need background
+                    extension.  */
+                 int header_line_height = WINDOW_HEADER_LINE_HEIGHT (w);
+
+                 bx = p->x;
+                 nx = p->wd;
+                 by = WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height,
+                                                       row->y));
+                 ny = row->visible_height;
+               }
+
+             if (bx >= 0)
+               {
+                 if (left + width == bx)
+                   {
+                     bx = left + sb_width;
+                     nx += width - sb_width;
+                   }
+                 else if (bx + nx == left)
+                   nx += width - sb_width;
+               }
+           }
+       }
+
+      if (bx >= 0)
+       {
+         mac_erase_rectangle (f, face->gc, bx, by, nx, ny);
+         /* The fringe background has already been filled.  */
+         overlay_p = 1;
+       }
+
+#if 0  /* MAC_TODO: stipple */
+      if (!face->stipple)
+       XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->foreground);
+#endif
+    }
+#endif /* MAC_OSX */
 
   /* Must clip because of partially visible lines.  */
   rowY = WINDOW_TO_FRAME_PIXEL_Y (w, row->y);
@@ -2206,6 +2287,7 @@ x_draw_fringe_bitmap (w, row, p)
   else
     x_clip_to_row (w, row, -1, face->gc);
 
+#ifndef MAC_OSX
   if (p->bx >= 0 && !p->overlay_p)
     {
 #if 0  /* MAC_TODO: stipple */
@@ -2226,6 +2308,7 @@ x_draw_fringe_bitmap (w, row, p)
        XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->foreground);
 #endif
     }
+#endif /* !MAC_OSX */
 
   if (p->which
 #if USE_CG_DRAWING
@@ -2243,10 +2326,10 @@ x_draw_fringe_bitmap (w, row, p)
                       : face->foreground));
 #if USE_CG_DRAWING
       mac_draw_cg_image (fringe_bmp[p->which], f, face->gc, 0, p->dh,
-                        p->wd, p->h, p->x, p->y, p->overlay_p);
+                        p->wd, p->h, p->x, p->y, overlay_p);
 #else
       mac_draw_bitmap (f, face->gc, p->x, p->y,
-                      p->wd, p->h, p->bits + p->dh, p->overlay_p);
+                      p->wd, p->h, p->bits + p->dh, overlay_p);
 #endif
       XSetForeground (display, face->gc, gcv.foreground);
     }
@@ -4251,14 +4334,6 @@ static void
 frame_highlight (f)
      struct frame *f;
 {
-  OSErr err;
-  ControlRef root_control;
-
-  BLOCK_INPUT;
-  err = GetRootControl (FRAME_MAC_WINDOW (f), &root_control);
-  if (err == noErr)
-    ActivateControl (root_control);
-  UNBLOCK_INPUT;
   x_update_cursor (f, 1);
 }
 
@@ -4266,14 +4341,6 @@ static void
 frame_unhighlight (f)
      struct frame *f;
 {
-  OSErr err;
-  ControlRef root_control;
-
-  BLOCK_INPUT;
-  err = GetRootControl (FRAME_MAC_WINDOW (f), &root_control);
-  if (err == noErr)
-    DeactivateControl (root_control);
-  UNBLOCK_INPUT;
   x_update_cursor (f, 1);
 }
 
@@ -4373,7 +4440,7 @@ x_detect_focus_change (dpyinfo, event, bufp)
 {
   struct frame *frame;
 
-  frame = mac_window_to_frame ((WindowPtr) event->message);
+  frame = mac_window_to_frame ((WindowRef) event->message);
   if (! frame)
     return;
 
@@ -4613,8 +4680,14 @@ XTmouse_position (fp, insist, bar_window, part, x, y, time)
             the frame are divided into.  */
          Point mouse_pos;
 
+#if TARGET_API_MAC_CARBON
+         GetGlobalMouse (&mouse_pos);
+         mouse_pos.h -= f1->left_pos + FRAME_OUTER_TO_INNER_DIFF_X (f1);
+         mouse_pos.v -= f1->top_pos + FRAME_OUTER_TO_INNER_DIFF_Y (f1);
+#else
          SetPortWindowPort (FRAME_MAC_WINDOW (f1));
          GetMouse (&mouse_pos);
+#endif
          remember_mouse_glyph (f1, mouse_pos.h, mouse_pos.v,
                                &last_mouse_glyph);
          last_mouse_glyph_frame = f1;
@@ -4644,14 +4717,14 @@ static OSStatus set_scroll_bar_timer P_ ((EventTimerInterval));
 static int control_part_code_to_scroll_bar_part P_ ((ControlPartCode));
 static void construct_scroll_bar_click P_ ((struct scroll_bar *, int,
                                            struct input_event *));
-static OSStatus get_control_part_bounds P_ ((ControlHandle, ControlPartCode,
+static OSStatus get_control_part_bounds P_ ((ControlRef, ControlPartCode,
                                             Rect *));
 static void x_scroll_bar_handle_press P_ ((struct scroll_bar *,
                                           ControlPartCode, Point,
                                           struct input_event *));
 static void x_scroll_bar_handle_release P_ ((struct scroll_bar *,
                                             struct input_event *));
-static void x_scroll_bar_handle_drag P_ ((WindowPtr, struct scroll_bar *,
+static void x_scroll_bar_handle_drag P_ ((WindowRef, struct scroll_bar *,
                                          Point, struct input_event *));
 static void x_set_toolkit_scroll_bar_thumb P_ ((struct scroll_bar *,
                                                int, int, int));
@@ -4744,7 +4817,7 @@ construct_scroll_bar_click (bar, part, bufp)
 
 static OSStatus
 get_control_part_bounds (ch, part_code, rect)
-     ControlHandle ch;
+     ControlRef ch;
      ControlPartCode part_code;
      Rect *rect;
 {
@@ -4774,7 +4847,7 @@ x_scroll_bar_handle_press (bar, part_code, mouse_pos, bufp)
   if (part != scroll_bar_handle)
     {
       construct_scroll_bar_click (bar, part, bufp);
-      HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), part_code);
+      HiliteControl (SCROLL_BAR_CONTROL_REF (bar), part_code);
       set_scroll_bar_timer (SCROLL_BAR_FIRST_DELAY);
       bar->dragging = Qnil;
     }
@@ -4782,7 +4855,7 @@ x_scroll_bar_handle_press (bar, part_code, mouse_pos, bufp)
     {
       Rect r;
 
-      get_control_part_bounds (SCROLL_BAR_CONTROL_HANDLE (bar),
+      get_control_part_bounds (SCROLL_BAR_CONTROL_REF (bar),
                               kControlIndicatorPart, &r);
       XSETINT (bar->dragging, - (mouse_pos.v - r.top) - 1);
     }
@@ -4800,7 +4873,7 @@ x_scroll_bar_handle_release (bar, bufp)
       || (INTEGERP (bar->dragging) && XINT (bar->dragging) >= 0))
     construct_scroll_bar_click (bar, scroll_bar_end_scroll, bufp);
 
-  HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), 0);
+  HiliteControl (SCROLL_BAR_CONTROL_REF (bar), 0);
   set_scroll_bar_timer (kEventDurationForever);
 
   last_scroll_bar_part = -1;
@@ -4810,19 +4883,19 @@ x_scroll_bar_handle_release (bar, bufp)
 
 static void
 x_scroll_bar_handle_drag (win, bar, mouse_pos, bufp)
-     WindowPtr win;
+     WindowRef win;
      struct scroll_bar *bar;
      Point mouse_pos;
      struct input_event *bufp;
 {
-  ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar);
+  ControlRef ch = SCROLL_BAR_CONTROL_REF (bar);
 
   if (last_scroll_bar_part == scroll_bar_handle)
     {
       int top, top_range;
       Rect r;
 
-      get_control_part_bounds (SCROLL_BAR_CONTROL_HANDLE (bar),
+      get_control_part_bounds (SCROLL_BAR_CONTROL_REF (bar),
                               kControlIndicatorPart, &r);
 
       if (INTEGERP (bar->dragging) && XINT (bar->dragging) < 0)
@@ -4870,13 +4943,13 @@ x_scroll_bar_handle_drag (win, bar, mouse_pos, bufp)
        }
 
       if (unhilite_p)
-       HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), 0);
+       HiliteControl (SCROLL_BAR_CONTROL_REF (bar), 0);
       else if (part != last_scroll_bar_part
               || scroll_bar_timer_event_posted_p)
        {
          construct_scroll_bar_click (bar, part, bufp);
          last_scroll_bar_part = part;
-         HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), part_code);
+         HiliteControl (SCROLL_BAR_CONTROL_REF (bar), part_code);
          set_scroll_bar_timer (SCROLL_BAR_CONTINUOUS_DELAY);
        }
     }
@@ -4890,7 +4963,7 @@ x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole)
      struct scroll_bar *bar;
      int portion, position, whole;
 {
-  ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar);
+  ControlRef ch = SCROLL_BAR_CONTROL_REF (bar);
   int value, viewsize, maximum;
 
   if (XINT (bar->track_height) == 0)
@@ -4949,7 +5022,7 @@ x_scroll_bar_create (w, top, left, width, height, disp_top, disp_height)
   struct scroll_bar *bar
     = XSCROLL_BAR (Fmake_vector (make_number (SCROLL_BAR_VEC_SIZE), Qnil));
   Rect r;
-  ControlHandle ch;
+  ControlRef ch;
 
   BLOCK_INPUT;
 
@@ -4973,7 +5046,7 @@ x_scroll_bar_create (w, top, left, width, height, disp_top, disp_height)
   ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", width < disp_height,
                   0, 0, 0, scrollBarProc, (long) bar);
 #endif
-  SET_SCROLL_BAR_CONTROL_HANDLE (bar, ch);
+  SET_SCROLL_BAR_CONTROL_REF (bar, ch);
 
   XSETWINDOW (bar->window, w);
   XSETINT (bar->top, top);
@@ -4983,6 +5056,9 @@ x_scroll_bar_create (w, top, left, width, height, disp_top, disp_height)
   XSETINT (bar->start, 0);
   XSETINT (bar->end, 0);
   bar->dragging = Qnil;
+#ifdef MAC_OSX
+  bar->fringe_extended_p = Qnil;
+#endif
 #ifdef USE_TOOLKIT_SCROLL_BARS
   bar->track_top = Qnil;
   bar->track_height = Qnil;
@@ -5023,7 +5099,7 @@ x_scroll_bar_set_handle (bar, start, end, rebuild)
      int rebuild;
 {
   int dragging = ! NILP (bar->dragging);
-  ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar);
+  ControlRef ch = SCROLL_BAR_CONTROL_REF (bar);
   FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
   int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (f, XINT (bar->height));
   int length = end - start;
@@ -5092,7 +5168,7 @@ x_scroll_bar_remove (bar)
   mac_prepare_for_quickdraw (f);
 #endif
   /* Destroy the Mac scroll bar control  */
-  DisposeControl (SCROLL_BAR_CONTROL_HANDLE (bar));
+  DisposeControl (SCROLL_BAR_CONTROL_REF (bar));
 
   /* Disassociate this scroll bar from its window.  */
   XWINDOW (bar->window)->vertical_scroll_bar = Qnil;
@@ -5115,6 +5191,9 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
   struct scroll_bar *bar;
   int top, height, left, sb_left, width, sb_width, disp_top, disp_height;
   int window_y, window_height;
+#ifdef MAC_OSX
+  int fringe_extended_p;
+#endif
 
   /* Get window dimensions.  */
   window_box (w, -1, 0, &window_y, 0, &window_height);
@@ -5134,9 +5213,9 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
 
   /* Compute the left edge of the scroll bar.  */
   if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))
-    sb_left = left;
+    sb_left = left + (WINDOW_RIGHTMOST_P (w) ? width - sb_width : 0);
   else
-    sb_left = left + width - sb_width;
+    sb_left = left + (WINDOW_LEFTMOST_P (w) ? 0 : width - sb_width);
 
   /* Adjustments according to Inside Macintosh to make it look nice */
   disp_top = top;
@@ -5157,11 +5236,29 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
     sb_left++;
 #endif
 
+#ifdef MAC_OSX
+  if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w))
+    fringe_extended_p = (WINDOW_LEFTMOST_P (w)
+                        && WINDOW_LEFT_FRINGE_WIDTH (w)
+                        && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
+                            || WINDOW_LEFT_MARGIN_COLS (w) == 0));
+  else
+    fringe_extended_p = (WINDOW_RIGHTMOST_P (w)
+                        && WINDOW_RIGHT_FRINGE_WIDTH (w)
+                        && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
+                            || WINDOW_RIGHT_MARGIN_COLS (w) == 0));
+#endif
+
   /* Does the scroll bar exist yet?  */
   if (NILP (w->vertical_scroll_bar))
     {
       BLOCK_INPUT;
-      mac_clear_area (f, left, top, width, height);
+#ifdef MAC_OSX
+      if (fringe_extended_p)
+       mac_clear_area (f, sb_left, top, sb_width, height);
+      else
+#endif
+       mac_clear_area (f, left, top, width, height);
       UNBLOCK_INPUT;
       bar = x_scroll_bar_create (w, top, sb_left, sb_width, height, disp_top,
                                 disp_height);
@@ -5170,10 +5267,10 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
   else
     {
       /* It may just need to be moved and resized.  */
-      ControlHandle ch;
+      ControlRef ch;
 
       bar = XSCROLL_BAR (w->vertical_scroll_bar);
-      ch = SCROLL_BAR_CONTROL_HANDLE (bar);
+      ch = SCROLL_BAR_CONTROL_REF (bar);
 
       BLOCK_INPUT;
 
@@ -5181,11 +5278,20 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
       if (!(XINT (bar->left) == sb_left
            && XINT (bar->top) == top
            && XINT (bar->width) == sb_width
-           && XINT (bar->height) == height))
+           && XINT (bar->height) == height
+#ifdef MAC_OSX
+           && !NILP (bar->fringe_extended_p) == fringe_extended_p
+#endif
+           ))
        {
          /* Since toolkit scroll bars are smaller than the space reserved
             for them on the frame, we have to clear "under" them.  */
-         mac_clear_area (f, left, top, width, height);
+#ifdef MAC_OSX
+         if (fringe_extended_p)
+           mac_clear_area (f, sb_left, top, sb_width, height);
+         else
+#endif
+           mac_clear_area (f, left, top, width, height);
 
 #if USE_CG_DRAWING
          mac_prepare_for_quickdraw (f);
@@ -5214,6 +5320,10 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
       UNBLOCK_INPUT;
     }
 
+#ifdef MAC_OSX
+  bar->fringe_extended_p = fringe_extended_p ? Qt : Qnil;
+#endif
+
 #ifdef USE_TOOLKIT_SCROLL_BARS
   if (NILP (bar->track_top))
     {
@@ -5229,7 +5339,7 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
        }
       else
        {
-         ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar);
+         ControlRef ch = SCROLL_BAR_CONTROL_REF (bar);
          Rect r0, r1;
 
          BLOCK_INPUT;
@@ -5506,19 +5616,24 @@ x_scroll_bar_report_motion (fp, bar_window, part, x, y, time)
      unsigned long *time;
 {
   struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar);
-  ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar);
+  ControlRef ch = SCROLL_BAR_CONTROL_REF (bar);
 #if TARGET_API_MAC_CARBON
-  WindowPtr wp = GetControlOwner (ch);
+  WindowRef wp = GetControlOwner (ch);
 #else
-  WindowPtr wp = (*ch)->contrlOwner;
+  WindowRef wp = (*ch)->contrlOwner;
 #endif
   Point mouse_pos;
   struct frame *f = mac_window_to_frame (wp);
   int win_y, top_range;
 
+#if TARGET_API_MAC_CARBON
+  GetGlobalMouse (&mouse_pos);
+  mouse_pos.h -= f->left_pos + FRAME_OUTER_TO_INNER_DIFF_X (f);
+  mouse_pos.v -= f->top_pos + FRAME_OUTER_TO_INNER_DIFF_Y (f);
+#else
   SetPortWindowPort (wp);
-
   GetMouse (&mouse_pos);
+#endif
 
   win_y = mouse_pos.v - XINT (bar->top);
   top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (f, XINT (bar->height));
@@ -5572,181 +5687,716 @@ x_scroll_bar_clear (f)
 
 \f
 /***********************************************************************
-                            Text Cursor
+                              Tool-bars
  ***********************************************************************/
+#if USE_MAC_TOOLBAR
 
-/* Set clipping for output in glyph row ROW.  W is the window in which
-   we operate.  GC is the graphics context to set clipping in.
-
-   ROW may be a text row or, e.g., a mode line.  Text rows must be
-   clipped to the interior of the window dedicated to text display,
-   mode lines must be clipped to the whole window.  */
-
-static void
-x_clip_to_row (w, row, area, gc)
-     struct window *w;
-     struct glyph_row *row;
-     int area;
-     GC gc;
-{
-  struct frame *f = XFRAME (WINDOW_FRAME (w));
-  Rect clip_rect;
-  int window_x, window_y, window_width;
-
-  window_box (w, area, &window_x, &window_y, &window_width, 0);
-
-  clip_rect.left = window_x;
-  clip_rect.top = WINDOW_TO_FRAME_PIXEL_Y (w, row->y);
-  clip_rect.top = max (clip_rect.top, window_y);
-  clip_rect.right = clip_rect.left + window_width;
-  clip_rect.bottom = clip_rect.top + row->visible_height;
+/* In identifiers such as function/variable names, Emacs tool bar is
+   referred to as `tool_bar', and Carbon HIToolbar as `toolbar'.  */
 
-  mac_set_clip_rectangles (FRAME_MAC_DISPLAY (f), gc, &clip_rect, 1);
-}
+#define TOOLBAR_IDENTIFIER (CFSTR ("org.gnu.Emacs.toolbar"))
+#define TOOLBAR_ICON_ITEM_IDENTIFIER (CFSTR ("org.gnu.Emacs.toolbar.icon"))
 
+#define TOOLBAR_ITEM_COMMAND_ID_OFFSET 'Tb\0\0'
+#define TOOLBAR_ITEM_COMMAND_ID_P(id)                  \
+  (((id) & ~0xffff) == TOOLBAR_ITEM_COMMAND_ID_OFFSET)
+#define TOOLBAR_ITEM_COMMAND_ID_VALUE(id)      \
+  ((id) - TOOLBAR_ITEM_COMMAND_ID_OFFSET)
+#define TOOLBAR_ITEM_MAKE_COMMAND_ID(value)    \
+  ((value) + TOOLBAR_ITEM_COMMAND_ID_OFFSET)
 
-/* Draw a hollow box cursor on window W in glyph row ROW.  */
+static int mac_event_to_emacs_modifiers P_ ((EventRef));
+static void mac_handle_origin_change P_ ((struct frame *));
+static OSStatus mac_handle_toolbar_command_event P_ ((EventHandlerCallRef,
+                                                     EventRef, void *));
 
 static void
-x_draw_hollow_cursor (w, row)
-     struct window *w;
-     struct glyph_row *row;
+mac_move_window_with_gravity (f, win_gravity, left, top)
+     struct frame *f;
+     int win_gravity;
+     short left, top;
 {
-  struct frame *f = XFRAME (WINDOW_FRAME (w));
-  struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
-  Display *dpy = FRAME_MAC_DISPLAY (f);
-  int x, y, wd, h;
-  XGCValues xgcv;
-  struct glyph *cursor_glyph;
-  GC gc;
+  Rect inner, outer;
 
-  /* Get the glyph the cursor is on.  If we can't tell because
-     the current matrix is invalid or such, give up.  */
-  cursor_glyph = get_phys_cursor_glyph (w);
-  if (cursor_glyph == NULL)
-    return;
+  mac_get_window_bounds (f, &inner, &outer);
 
-  /* Compute frame-relative coordinates for phys cursor.  */
-  get_phys_cursor_geometry (w, row, cursor_glyph, &x, &y, &h);
-  wd = w->phys_cursor_width;
+  switch (win_gravity)
+    {
+    case NorthWestGravity:
+    case WestGravity:
+    case SouthWestGravity:
+      left += inner.left - outer.left;
+      break;
 
-  /* The foreground of cursor_gc is typically the same as the normal
-     background color, which can cause the cursor box to be invisible.  */
-  xgcv.foreground = f->output_data.mac->cursor_pixel;
-  if (dpyinfo->scratch_cursor_gc)
-    XChangeGC (dpy, dpyinfo->scratch_cursor_gc, GCForeground, &xgcv);
-  else
-    dpyinfo->scratch_cursor_gc = XCreateGC (dpy, FRAME_MAC_WINDOW (f),
-                                           GCForeground, &xgcv);
-  gc = dpyinfo->scratch_cursor_gc;
+    case NorthGravity:
+    case CenterGravity:
+    case SouthGravity:
+      left += ((inner.left - outer.left) + (inner.right - outer.right)) / 2;
+      break;
 
-  /* Set clipping, draw the rectangle, and reset clipping again.  */
-  x_clip_to_row (w, row, TEXT_AREA, gc);
-  mac_draw_rectangle (f, gc, x, y, wd, h - 1);
-  mac_reset_clip_rectangles (dpy, gc);
-}
+    case NorthEastGravity:
+    case EastGravity:
+    case SouthEastGravity:
+      left += inner.right - outer.right;
+      break;
+    }
 
+  switch (win_gravity)
+    {
+    case NorthWestGravity:
+    case NorthGravity:
+    case NorthEastGravity:
+      top += inner.top - outer.top;
+      break;
 
-/* Draw a bar cursor on window W in glyph row ROW.
+    case WestGravity:
+    case CenterGravity:
+    case EastGravity:
+      top += ((inner.top - outer.top) + (inner.bottom - outer.bottom)) / 2;
+      break;
 
-   Implementation note: One would like to draw a bar cursor with an
-   angle equal to the one given by the font property XA_ITALIC_ANGLE.
-   Unfortunately, I didn't find a font yet that has this property set.
-   --gerd.  */
+    case SouthWestGravity:
+    case SouthGravity:
+    case SouthEastGravity:
+      top += inner.bottom - outer.bottom;
+      break;
+    }
+
+  MoveWindow (FRAME_MAC_WINDOW (f), left, top, false);
+}
 
 static void
-x_draw_bar_cursor (w, row, width, kind)
-     struct window *w;
-     struct glyph_row *row;
-     int width;
-     enum text_cursor_kinds kind;
+mac_get_window_origin_with_gravity (f, win_gravity, left, top)
+     struct frame *f;
+     int win_gravity;
+     short *left, *top;
 {
-  struct frame *f = XFRAME (w->frame);
-  struct glyph *cursor_glyph;
+  Rect inner, outer;
 
-  /* If cursor is out of bounds, don't draw garbage.  This can happen
-     in mini-buffer windows when switching between echo area glyphs
-     and mini-buffer.  */
-  cursor_glyph = get_phys_cursor_glyph (w);
-  if (cursor_glyph == NULL)
-    return;
+  mac_get_window_bounds (f, &inner, &outer);
 
-  /* If on an image, draw like a normal cursor.  That's usually better
-     visible than drawing a bar, esp. if the image is large so that
-     the bar might not be in the window.  */
-  if (cursor_glyph->type == IMAGE_GLYPH)
-    {
-      struct glyph_row *row;
-      row = MATRIX_ROW (w->current_matrix, w->phys_cursor.vpos);
-      draw_phys_cursor_glyph (w, row, DRAW_CURSOR);
-    }
-  else
+  switch (win_gravity)
     {
-      Display *dpy = FRAME_MAC_DISPLAY (f);
-      Window window = FRAME_MAC_WINDOW (f);
-      GC gc = FRAME_MAC_DISPLAY_INFO (f)->scratch_cursor_gc;
-      unsigned long mask = GCForeground | GCBackground;
-      struct face *face = FACE_FROM_ID (f, cursor_glyph->face_id);
-      XGCValues xgcv;
-
-      /* If the glyph's background equals the color we normally draw
-        the bar cursor in, the bar cursor in its normal color is
-        invisible.  Use the glyph's foreground color instead in this
-        case, on the assumption that the glyph's colors are chosen so
-        that the glyph is legible.  */
-      if (face->background == f->output_data.mac->cursor_pixel)
-       xgcv.background = xgcv.foreground = face->foreground;
-      else
-       xgcv.background = xgcv.foreground = f->output_data.mac->cursor_pixel;
+    case NorthWestGravity:
+    case WestGravity:
+    case SouthWestGravity:
+      *left = outer.left;
+      break;
 
-      if (gc)
-       XChangeGC (dpy, gc, mask, &xgcv);
-      else
-       {
-         gc = XCreateGC (dpy, window, mask, &xgcv);
-         FRAME_MAC_DISPLAY_INFO (f)->scratch_cursor_gc = gc;
-       }
+    case NorthGravity:
+    case CenterGravity:
+    case SouthGravity:
+      *left = outer.left + ((outer.right - outer.left)
+                           - (inner.right - inner.left)) / 2;
+      break;
 
-      if (width < 0)
-       width = FRAME_CURSOR_WIDTH (f);
-      width = min (cursor_glyph->pixel_width, width);
+    case NorthEastGravity:
+    case EastGravity:
+    case SouthEastGravity:
+      *left = outer.right - (inner.right - inner.left);
+      break;
+    }
 
-      w->phys_cursor_width = width;
-      x_clip_to_row (w, row, TEXT_AREA, gc);
+  switch (win_gravity)
+    {
+    case NorthWestGravity:
+    case NorthGravity:
+    case NorthEastGravity:
+      *top = outer.top;
+      break;
 
-      if (kind == BAR_CURSOR)
-       mac_fill_rectangle (f, gc,
-                           WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x),
-                           WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y),
-                           width, row->height);
-      else
-       mac_fill_rectangle (f, gc,
-                           WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x),
-                           WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y +
-                                                    row->height - width),
-                           cursor_glyph->pixel_width,
-                           width);
+    case WestGravity:
+    case CenterGravity:
+    case EastGravity:
+      *top = outer.top + ((outer.bottom - outer.top)
+                         - (inner.bottom - inner.top)) / 2;
+      break;
 
-      mac_reset_clip_rectangles (dpy, gc);
+    case SouthWestGravity:
+    case SouthGravity:
+    case SouthEastGravity:
+      *top = outer.bottom - (inner.bottom - inner.top);
+      break;
     }
 }
 
-
-/* RIF: Define cursor CURSOR on frame F.  */
-
-static void
-mac_define_frame_cursor (f, cursor)
-     struct frame *f;
-     Cursor cursor;
+static OSStatus
+mac_handle_toolbar_event (next_handler, event, data)
+     EventHandlerCallRef next_handler;
+     EventRef event;
+     void *data;
 {
-  struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
+  OSStatus err, result = eventNotHandledErr;
 
-  if (dpyinfo->x_focus_frame == f)
-    SetThemeCursor (cursor);
-}
+  switch (GetEventKind (event))
+    {
+    case kEventToolbarGetDefaultIdentifiers:
+      result = noErr;
+      break;
 
+    case kEventToolbarGetAllowedIdentifiers:
+      {
+       CFMutableArrayRef array;
 
-/* RIF: Clear area on frame F.  */
+       GetEventParameter (event, kEventParamMutableArray,
+                          typeCFMutableArrayRef, NULL,
+                          sizeof (CFMutableArrayRef), NULL, &array);
+       CFArrayAppendValue (array, TOOLBAR_ICON_ITEM_IDENTIFIER);
+       result = noErr;
+      }
+      break;
+
+    case kEventToolbarCreateItemWithIdentifier:
+      {
+       CFStringRef identifier;
+       HIToolbarItemRef item = NULL;
+
+       GetEventParameter (event, kEventParamToolbarItemIdentifier,
+                          typeCFStringRef, NULL,
+                          sizeof (CFStringRef), NULL, &identifier);
+
+       if (CFStringCompare (identifier, TOOLBAR_ICON_ITEM_IDENTIFIER, 0)
+           == kCFCompareEqualTo)
+         HIToolbarItemCreate (identifier,
+                              kHIToolbarItemAllowDuplicates
+                              | kHIToolbarItemCantBeRemoved, &item);
+
+       if (item)
+         {
+           SetEventParameter (event, kEventParamToolbarItem,
+                              typeHIToolbarItemRef,
+                              sizeof (HIToolbarItemRef), &item);
+           result = noErr;
+         }
+      }
+      break;
+
+    default:
+      abort ();
+    }
+
+  return result;
+}
+
+static CGImageRef
+mac_image_spec_to_cg_image (f, image)
+     struct frame *f;
+     Lisp_Object image;
+{
+  if (!valid_image_p (image))
+    return NULL;
+  else
+    {
+      int img_id = lookup_image (f, image);
+      struct image *img = IMAGE_FROM_ID (f, img_id);
+
+      prepare_image_for_display (f, img);
+
+      return img->data.ptr_val;
+    }
+}
+
+/* Create a tool bar for frame F.  */
+
+static OSStatus
+mac_create_frame_tool_bar (f)
+     FRAME_PTR f;
+{
+  OSStatus err;
+  HIToolbarRef toolbar;
+
+  err = HIToolbarCreate (TOOLBAR_IDENTIFIER, kHIToolbarNoAttributes,
+                        &toolbar);
+  if (err == noErr)
+    {
+      static const EventTypeSpec specs[] =
+       {{kEventClassToolbar, kEventToolbarGetDefaultIdentifiers},
+        {kEventClassToolbar, kEventToolbarGetAllowedIdentifiers},
+        {kEventClassToolbar, kEventToolbarCreateItemWithIdentifier}};
+
+      err = InstallEventHandler (HIObjectGetEventTarget (toolbar),
+                                mac_handle_toolbar_event,
+                                GetEventTypeCount (specs), specs,
+                                f, NULL);
+    }
+
+  if (err == noErr)
+    err = HIToolbarSetDisplayMode (toolbar, kHIToolbarDisplayModeIconOnly);
+  if (err == noErr)
+    {
+      static const EventTypeSpec specs[] =
+       {{kEventClassCommand, kEventCommandProcess}};
+
+      err = InstallWindowEventHandler (FRAME_MAC_WINDOW (f),
+                                      mac_handle_toolbar_command_event,
+                                      GetEventTypeCount (specs),
+                                      specs, f, NULL);
+    }
+  if (err == noErr)
+    err = SetWindowToolbar (FRAME_MAC_WINDOW (f), toolbar);
+
+  if (toolbar)
+    CFRelease (toolbar);
+
+  return err;
+}
+
+/* Update the tool bar for frame F.  Add new buttons and remove old.  */
+
+void
+update_frame_tool_bar (f)
+     FRAME_PTR f;
+{
+  HIToolbarRef toolbar = NULL;
+  short left, top;
+  CFArrayRef old_items = NULL;
+  CFIndex old_count;
+  int i, pos, win_gravity = f->output_data.mac->toolbar_win_gravity;
+  struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
+
+  BLOCK_INPUT;
+
+  GetWindowToolbar (FRAME_MAC_WINDOW (f), &toolbar);
+  if (toolbar == NULL)
+    {
+      mac_create_frame_tool_bar (f);
+      GetWindowToolbar (FRAME_MAC_WINDOW (f), &toolbar);
+      if (toolbar == NULL)
+       goto out;
+      if (win_gravity >= NorthWestGravity && win_gravity <= SouthEastGravity)
+       mac_get_window_origin_with_gravity (f, win_gravity, &left, &top);
+    }
+
+  HIToolbarCopyItems (toolbar, &old_items);
+  if (old_items == NULL)
+    goto out;
+
+  old_count = CFArrayGetCount (old_items);
+  pos = 0;
+  for (i = 0; i < f->n_tool_bar_items; ++i)
+    {
+#define PROP(IDX) AREF (f->tool_bar_items, i * TOOL_BAR_ITEM_NSLOTS + (IDX))
+
+      int enabled_p = !NILP (PROP (TOOL_BAR_ITEM_ENABLED_P));
+      int selected_p = !NILP (PROP (TOOL_BAR_ITEM_SELECTED_P));
+      int idx;
+      Lisp_Object image;
+      CGImageRef cg_image;
+      CFStringRef label;
+      HIToolbarItemRef item;
+
+      /* If image is a vector, choose the image according to the
+        button state.  */
+      image = PROP (TOOL_BAR_ITEM_IMAGES);
+      if (VECTORP (image))
+       {
+         if (enabled_p)
+           idx = (selected_p
+                  ? TOOL_BAR_IMAGE_ENABLED_SELECTED
+                  : TOOL_BAR_IMAGE_ENABLED_DESELECTED);
+         else
+           idx = (selected_p
+                  ? TOOL_BAR_IMAGE_DISABLED_SELECTED
+                  : TOOL_BAR_IMAGE_DISABLED_DESELECTED);
+
+         xassert (ASIZE (image) >= idx);
+         image = AREF (image, idx);
+       }
+      else
+       idx = -1;
+
+      cg_image = mac_image_spec_to_cg_image (f, image);
+      /* Ignore invalid image specifications.  */
+      if (cg_image == NULL)
+       continue;
+
+      label = cfstring_create_with_string (PROP (TOOL_BAR_ITEM_CAPTION));
+      if (label == NULL)
+       label = CFSTR ("");
+
+      if (pos < old_count)
+       {
+         CGImageRef old_cg_image = NULL;
+         CFStringRef old_label = NULL;
+         Boolean old_enabled_p;
+
+         item = (HIToolbarItemRef) CFArrayGetValueAtIndex (old_items, pos);
+
+         HIToolbarItemCopyImage (item, &old_cg_image);
+         if (cg_image != old_cg_image)
+           HIToolbarItemSetImage (item, cg_image);
+         CGImageRelease (old_cg_image);
+
+         HIToolbarItemCopyLabel (item, &old_label);
+         if (CFStringCompare (label, old_label, 0) != kCFCompareEqualTo)
+           HIToolbarItemSetLabel (item, label);
+         CFRelease (old_label);
+
+         old_enabled_p = HIToolbarItemIsEnabled (item);
+         if ((enabled_p || idx >= 0) != old_enabled_p)
+           HIToolbarItemSetEnabled (item, (enabled_p || idx >= 0));
+       }
+      else
+       {
+         item = NULL;
+         HIToolbarCreateItemWithIdentifier (toolbar,
+                                            TOOLBAR_ICON_ITEM_IDENTIFIER,
+                                            NULL, &item);
+         if (item)
+           {
+             HIToolbarItemSetImage (item, cg_image);
+             HIToolbarItemSetLabel (item, label);
+             HIToolbarItemSetEnabled (item, (enabled_p || idx >= 0));
+             HIToolbarAppendItem (toolbar, item);
+             CFRelease (item);
+           }
+       }
+
+      CFRelease (label);
+      if (item)
+       {
+         HIToolbarItemSetCommandID (item, TOOLBAR_ITEM_MAKE_COMMAND_ID (i));
+         pos++;
+       }
+    }
+
+  CFRelease (old_items);
+
+  while (pos < old_count)
+    HIToolbarRemoveItemAtIndex (toolbar, --old_count);
+
+  ShowHideWindowToolbar (FRAME_MAC_WINDOW (f), true,
+                        !win_gravity && f == mac_focus_frame (dpyinfo));
+  /* Mac OS X 10.3 does not issue kEventWindowBoundsChanged events on
+     toolbar visibility change.  */
+  mac_handle_origin_change (f);
+  if (win_gravity >= NorthWestGravity && win_gravity <= SouthEastGravity)
+    {
+      mac_move_window_with_gravity (f, win_gravity, left, top);
+      /* If the title bar is completely outside the screen, adjust the
+        position. */
+      ConstrainWindowToScreen (FRAME_MAC_WINDOW (f), kWindowTitleBarRgn,
+                              kWindowConstrainMoveRegardlessOfFit
+                              | kWindowConstrainAllowPartial, NULL, NULL);
+      f->output_data.mac->toolbar_win_gravity = 0;
+    }
+
+ out:
+  UNBLOCK_INPUT;
+}
+
+/* Hide the tool bar on frame F.  Unlike the counterpart on GTK+, it
+   doesn't deallocate the resources.  */
+
+void
+free_frame_tool_bar (f)
+     FRAME_PTR f;
+{
+  if (IsWindowToolbarVisible (FRAME_MAC_WINDOW (f)))
+    {
+      struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
+
+      BLOCK_INPUT;
+      ShowHideWindowToolbar (FRAME_MAC_WINDOW (f), false,
+                            (NILP (Fsymbol_value
+                                   (intern ("frame-notice-user-settings")))
+                             && f == mac_focus_frame (dpyinfo)));
+      /* Mac OS X 10.3 does not issue kEventWindowBoundsChanged events
+        on toolbar visibility change.  */
+      mac_handle_origin_change (f);
+      UNBLOCK_INPUT;
+    }
+}
+
+static void
+mac_tool_bar_note_mouse_movement (f, event)
+     struct frame *f;
+     EventRef event;
+{
+  OSStatus err;
+  struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
+  int mouse_down_p;
+  HIViewRef item_view;
+  UInt32 command_id;
+
+  mouse_down_p = (dpyinfo->grabbed
+                 && f == last_mouse_frame
+                 && FRAME_LIVE_P (f));
+  if (mouse_down_p)
+    return;
+
+  err = HIViewGetViewForMouseEvent (HIViewGetRoot (FRAME_MAC_WINDOW (f)),
+                                   event, &item_view);
+  /* This doesn't work on Mac OS X 10.2.  On Mac OS X 10.3 and 10.4, a
+     toolbar item view seems to have the same command ID with that of
+     the toolbar item.  */
+  if (err == noErr)
+    err = GetControlCommandID (item_view, &command_id);
+  if (err == noErr && TOOLBAR_ITEM_COMMAND_ID_P (command_id))
+    {
+      int i = TOOLBAR_ITEM_COMMAND_ID_VALUE (command_id);
+
+      if (i < f->n_tool_bar_items)
+       {
+         HIRect bounds;
+         HIViewRef content_view;
+
+         err = HIViewGetBounds (item_view, &bounds);
+         if (err == noErr)
+           err = HIViewFindByID (HIViewGetRoot (FRAME_MAC_WINDOW (f)),
+                                 kHIViewWindowContentID, &content_view);
+         if (err == noErr)
+           err = HIViewConvertRect (&bounds, item_view, content_view);
+         if (err == noErr)
+           SetRect (&last_mouse_glyph,
+                    CGRectGetMinX (bounds), CGRectGetMinY (bounds),
+                    CGRectGetMaxX (bounds), CGRectGetMaxY (bounds));
+
+         help_echo_object = help_echo_window = Qnil;
+         help_echo_pos = -1;
+         help_echo_string = PROP (TOOL_BAR_ITEM_HELP);
+         if (NILP (help_echo_string))
+           help_echo_string = PROP (TOOL_BAR_ITEM_CAPTION);
+       }
+    }
+}
+
+static OSStatus
+mac_handle_toolbar_command_event (next_handler, event, data)
+     EventHandlerCallRef next_handler;
+     EventRef event;
+     void *data;
+{
+  OSStatus err, result = eventNotHandledErr;
+  struct frame *f = (struct frame *) data;
+  HICommand command;
+
+  err = GetEventParameter (event, kEventParamDirectObject,
+                          typeHICommand, NULL,
+                          sizeof (HICommand), NULL, &command);
+  if (err != noErr)
+    return result;
+
+  switch (GetEventKind (event))
+    {
+    case kEventCommandProcess:
+      if (!TOOLBAR_ITEM_COMMAND_ID_P (command.commandID))
+       result = CallNextEventHandler (next_handler, event);
+      else
+       {
+         int i = TOOLBAR_ITEM_COMMAND_ID_VALUE (command.commandID);
+
+         if (i < f->n_tool_bar_items
+             && !NILP (PROP (TOOL_BAR_ITEM_ENABLED_P)))
+           {
+             Lisp_Object frame;
+             struct input_event buf;
+
+             EVENT_INIT (buf);
+
+             XSETFRAME (frame, f);
+             buf.kind = TOOL_BAR_EVENT;
+             buf.frame_or_window = frame;
+             buf.arg = frame;
+             kbd_buffer_store_event (&buf);
+
+             buf.kind = TOOL_BAR_EVENT;
+             buf.frame_or_window = frame;
+             buf.arg = PROP (TOOL_BAR_ITEM_KEY);
+             buf.modifiers = mac_event_to_emacs_modifiers (event);
+             kbd_buffer_store_event (&buf);
+
+             result = noErr;
+           }
+       }
+      break;
+
+    default:
+      abort ();
+    }
+#undef PROP
+
+  return result;
+}
+#endif /* USE_MAC_TOOLBAR */
+
+\f
+/***********************************************************************
+                            Text Cursor
+ ***********************************************************************/
+
+/* Set clipping for output in glyph row ROW.  W is the window in which
+   we operate.  GC is the graphics context to set clipping in.
+
+   ROW may be a text row or, e.g., a mode line.  Text rows must be
+   clipped to the interior of the window dedicated to text display,
+   mode lines must be clipped to the whole window.  */
+
+static void
+x_clip_to_row (w, row, area, gc)
+     struct window *w;
+     struct glyph_row *row;
+     int area;
+     GC gc;
+{
+  struct frame *f = XFRAME (WINDOW_FRAME (w));
+  Rect clip_rect;
+  int window_x, window_y, window_width;
+
+  window_box (w, area, &window_x, &window_y, &window_width, 0);
+
+  clip_rect.left = window_x;
+  clip_rect.top = WINDOW_TO_FRAME_PIXEL_Y (w, row->y);
+  clip_rect.top = max (clip_rect.top, window_y);
+  clip_rect.right = clip_rect.left + window_width;
+  clip_rect.bottom = clip_rect.top + row->visible_height;
+
+  mac_set_clip_rectangles (FRAME_MAC_DISPLAY (f), gc, &clip_rect, 1);
+}
+
+
+/* Draw a hollow box cursor on window W in glyph row ROW.  */
+
+static void
+x_draw_hollow_cursor (w, row)
+     struct window *w;
+     struct glyph_row *row;
+{
+  struct frame *f = XFRAME (WINDOW_FRAME (w));
+  struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
+  Display *dpy = FRAME_MAC_DISPLAY (f);
+  int x, y, wd, h;
+  XGCValues xgcv;
+  struct glyph *cursor_glyph;
+  GC gc;
+
+  /* Get the glyph the cursor is on.  If we can't tell because
+     the current matrix is invalid or such, give up.  */
+  cursor_glyph = get_phys_cursor_glyph (w);
+  if (cursor_glyph == NULL)
+    return;
+
+  /* Compute frame-relative coordinates for phys cursor.  */
+  get_phys_cursor_geometry (w, row, cursor_glyph, &x, &y, &h);
+  wd = w->phys_cursor_width;
+
+  /* The foreground of cursor_gc is typically the same as the normal
+     background color, which can cause the cursor box to be invisible.  */
+  xgcv.foreground = f->output_data.mac->cursor_pixel;
+  if (dpyinfo->scratch_cursor_gc)
+    XChangeGC (dpy, dpyinfo->scratch_cursor_gc, GCForeground, &xgcv);
+  else
+    dpyinfo->scratch_cursor_gc = XCreateGC (dpy, FRAME_MAC_WINDOW (f),
+                                           GCForeground, &xgcv);
+  gc = dpyinfo->scratch_cursor_gc;
+
+  /* Set clipping, draw the rectangle, and reset clipping again.  */
+  x_clip_to_row (w, row, TEXT_AREA, gc);
+  mac_draw_rectangle (f, gc, x, y, wd, h - 1);
+  mac_reset_clip_rectangles (dpy, gc);
+}
+
+
+/* Draw a bar cursor on window W in glyph row ROW.
+
+   Implementation note: One would like to draw a bar cursor with an
+   angle equal to the one given by the font property XA_ITALIC_ANGLE.
+   Unfortunately, I didn't find a font yet that has this property set.
+   --gerd.  */
+
+static void
+x_draw_bar_cursor (w, row, width, kind)
+     struct window *w;
+     struct glyph_row *row;
+     int width;
+     enum text_cursor_kinds kind;
+{
+  struct frame *f = XFRAME (w->frame);
+  struct glyph *cursor_glyph;
+
+  /* If cursor is out of bounds, don't draw garbage.  This can happen
+     in mini-buffer windows when switching between echo area glyphs
+     and mini-buffer.  */
+  cursor_glyph = get_phys_cursor_glyph (w);
+  if (cursor_glyph == NULL)
+    return;
+
+  /* If on an image, draw like a normal cursor.  That's usually better
+     visible than drawing a bar, esp. if the image is large so that
+     the bar might not be in the window.  */
+  if (cursor_glyph->type == IMAGE_GLYPH)
+    {
+      struct glyph_row *row;
+      row = MATRIX_ROW (w->current_matrix, w->phys_cursor.vpos);
+      draw_phys_cursor_glyph (w, row, DRAW_CURSOR);
+    }
+  else
+    {
+      Display *dpy = FRAME_MAC_DISPLAY (f);
+      Window window = FRAME_MAC_WINDOW (f);
+      GC gc = FRAME_MAC_DISPLAY_INFO (f)->scratch_cursor_gc;
+      unsigned long mask = GCForeground | GCBackground;
+      struct face *face = FACE_FROM_ID (f, cursor_glyph->face_id);
+      XGCValues xgcv;
+
+      /* If the glyph's background equals the color we normally draw
+        the bar cursor in, the bar cursor in its normal color is
+        invisible.  Use the glyph's foreground color instead in this
+        case, on the assumption that the glyph's colors are chosen so
+        that the glyph is legible.  */
+      if (face->background == f->output_data.mac->cursor_pixel)
+       xgcv.background = xgcv.foreground = face->foreground;
+      else
+       xgcv.background = xgcv.foreground = f->output_data.mac->cursor_pixel;
+
+      if (gc)
+       XChangeGC (dpy, gc, mask, &xgcv);
+      else
+       {
+         gc = XCreateGC (dpy, window, mask, &xgcv);
+         FRAME_MAC_DISPLAY_INFO (f)->scratch_cursor_gc = gc;
+       }
+
+      if (width < 0)
+       width = FRAME_CURSOR_WIDTH (f);
+      width = min (cursor_glyph->pixel_width, width);
+
+      w->phys_cursor_width = width;
+      x_clip_to_row (w, row, TEXT_AREA, gc);
+
+      if (kind == BAR_CURSOR)
+       mac_fill_rectangle (f, gc,
+                           WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x),
+                           WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y),
+                           width, row->height);
+      else
+       mac_fill_rectangle (f, gc,
+                           WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x),
+                           WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y +
+                                                    row->height - width),
+                           cursor_glyph->pixel_width,
+                           width);
+
+      mac_reset_clip_rectangles (dpy, gc);
+    }
+}
+
+
+/* RIF: Define cursor CURSOR on frame F.  */
+
+static void
+mac_define_frame_cursor (f, cursor)
+     struct frame *f;
+     Cursor cursor;
+{
+  struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
+
+  if (dpyinfo->x_focus_frame == f)
+    SetThemeCursor (cursor);
+}
+
+
+/* RIF: Clear area on frame F.  */
 
 static void
 mac_clear_frame_area (f, x, y, width, height)
@@ -6146,9 +6796,7 @@ x_set_offset (f, xoff, yoff, change_gravity)
   ConstrainWindowToScreen (FRAME_MAC_WINDOW (f), kWindowTitleBarRgn,
                           kWindowConstrainMoveRegardlessOfFit
                           | kWindowConstrainAllowPartial, NULL, NULL);
-#if USE_CARBON_EVENTS
   if (!NILP (tip_frame) && XFRAME (tip_frame) == f)
-#endif
     mac_handle_origin_change (f);
 #else
   {
@@ -6224,7 +6872,7 @@ x_set_window_size (f, change_gravity, cols, rows)
 
   SizeWindow (FRAME_MAC_WINDOW (f), pixelwidth, pixelheight, 0);
 
-#if USE_CARBON_EVENTS
+#if TARGET_API_MAC_CARBON
   if (!NILP (tip_frame) && f == XFRAME (tip_frame))
 #endif
     mac_handle_size_change (f, pixelwidth, pixelheight);
@@ -6271,17 +6919,11 @@ x_set_mouse_pixel_position (f, pix_x, pix_y)
      int pix_x, pix_y;
 {
 #ifdef MAC_OSX
-  Point p;
-  CGPoint point;
+  pix_x += f->left_pos + FRAME_OUTER_TO_INNER_DIFF_X (f);
+  pix_y += f->top_pos + FRAME_OUTER_TO_INNER_DIFF_Y (f);
 
   BLOCK_INPUT;
-  SetPortWindowPort (FRAME_MAC_WINDOW (f));
-  p.h = pix_x;
-  p.v = pix_y;
-  LocalToGlobal (&p);
-  point.x = p.h;
-  point.y = p.v;
-  CGWarpMouseCursorPosition (point);
+  CGWarpMouseCursorPosition (CGPointMake (pix_x, pix_y));
   UNBLOCK_INPUT;
 #else
 #if 0 /* MAC_TODO: LMSetMouseLocation and CursorDeviceMoveTo are non-Carbon */
@@ -6363,7 +7005,7 @@ static void
 mac_handle_visibility_change (f)
      struct frame *f;
 {
-  WindowPtr wp = FRAME_MAC_WINDOW (f);
+  WindowRef wp = FRAME_MAC_WINDOW (f);
   int visible = 0, iconified = 0;
   struct input_event buf;
 
@@ -6431,32 +7073,7 @@ x_make_frame_visible (f)
         before the window gets really visible.  */
       if (! FRAME_ICONIFIED_P (f)
          && ! f->output_data.mac->asked_for_visible)
-       {
-#if TARGET_API_MAC_CARBON
-         if (!(FRAME_SIZE_HINTS (f)->flags & (USPosition | PPosition)))
-           {
-             struct frame *sf = SELECTED_FRAME ();
-             if (!FRAME_MAC_P (sf))
-               RepositionWindow (FRAME_MAC_WINDOW (f), NULL,
-                                 kWindowCenterOnMainScreen);
-             else
-               RepositionWindow (FRAME_MAC_WINDOW (f),
-                                 FRAME_MAC_WINDOW (sf),
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
-                                 kWindowCascadeStartAtParentWindowScreen
-#else
-                                 kWindowCascadeOnParentWindowScreen
-#endif
-                                 );
-#if USE_CARBON_EVENTS
-             if (!NILP (tip_frame) && f == XFRAME (tip_frame))
-#endif
-               mac_handle_origin_change (f);
-           }
-         else
-#endif
-           x_set_offset (f, f->left_pos, f->top_pos, 0);
-       }
+       x_set_offset (f, f->left_pos, f->top_pos, 0);
 
       f->output_data.mac->asked_for_visible = 1;
 
@@ -6530,18 +7147,20 @@ x_make_frame_invisible (f)
 
   BLOCK_INPUT;
 
+#if !TARGET_API_MAC_CARBON
   /* Before unmapping the window, update the WM_SIZE_HINTS property to claim
      that the current position of the window is user-specified, rather than
      program-specified, so that when the window is mapped again, it will be
      placed at the same location, without forcing the user to position it
      by hand again (they have already done that once for this window.)  */
   x_wm_set_size_hint (f, (long) 0, 1);
+#endif
 
   HideWindow (FRAME_MAC_WINDOW (f));
 
   UNBLOCK_INPUT;
 
-#if !USE_CARBON_EVENTS
+#if !TARGET_API_MAC_CARBON
   mac_handle_visibility_change (f);
 #endif
 }
@@ -6580,7 +7199,7 @@ x_iconify_frame (f)
   if (err != noErr)
     error ("Can't notify window manager of iconification");
 
-#if !USE_CARBON_EVENTS
+#if !TARGET_API_MAC_CARBON
   mac_handle_visibility_change (f);
 #endif
 }
@@ -6593,7 +7212,7 @@ x_free_frame_resources (f)
      struct frame *f;
 {
   struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
-  WindowPtr wp = FRAME_MAC_WINDOW (f);
+  WindowRef wp = FRAME_MAC_WINDOW (f);
 
   BLOCK_INPUT;
 
@@ -8711,33 +9330,112 @@ x_find_ccl_program (fontp)
     }
   if (! NILP (list))
     {
-      struct ccl_program *ccl
-       = (struct ccl_program *) xmalloc (sizeof (struct ccl_program));
+      struct ccl_program *ccl
+       = (struct ccl_program *) xmalloc (sizeof (struct ccl_program));
+
+      if (setup_ccl_program (ccl, XCDR (elt)) < 0)
+       xfree (ccl);
+      else
+       fontp->font_encoder = ccl;
+    }
+}
+
+#if USE_MAC_FONT_PANEL
+/* Whether Font Panel has been shown before.  The first call to font
+   panel functions (FPIsFontPanelVisible, SetFontInfoForSelection) is
+   slow.  This variable is used for deferring such a call as much as
+   possible.  */
+static int font_panel_shown_p = 0;
+
+extern Lisp_Object Qfont;
+static Lisp_Object Qpanel_closed, Qselection;
+
+static OSStatus mac_store_event_ref_as_apple_event P_ ((AEEventClass, AEEventID,
+                                                       Lisp_Object,
+                                                       Lisp_Object,
+                                                       EventRef, UInt32,
+                                                       const EventParamName *,
+                                                       const EventParamType *));
+
+int
+mac_font_panel_visible_p ()
+{
+  return font_panel_shown_p && FPIsFontPanelVisible ();
+}
+
+static pascal OSStatus
+mac_handle_font_event (next_handler, event, data)
+     EventHandlerCallRef next_handler;
+     EventRef event;
+     void *data;
+{
+  OSStatus result, err;
+  Lisp_Object id_key;
+  int num_params;
+  const EventParamName *names;
+  const EventParamType *types;
+  static const EventParamName names_sel[] = {kEventParamATSUFontID,
+                                            kEventParamATSUFontSize,
+                                            kEventParamFMFontFamily,
+                                            kEventParamFMFontStyle,
+                                            kEventParamFMFontSize,
+                                            kEventParamFontColor};
+  static const EventParamType types_sel[] = {typeATSUFontID,
+                                            typeATSUSize,
+                                            typeFMFontFamily,
+                                            typeFMFontStyle,
+                                            typeFMFontSize,
+                                            typeFontColor};
+
+  result = CallNextEventHandler (next_handler, event);
+  if (result != eventNotHandledErr)
+    return result;
+
+  switch (GetEventKind (event))
+    {
+    case kEventFontPanelClosed:
+      id_key = Qpanel_closed;
+      num_params = 0;
+      names = NULL;
+      types = NULL;
+      break;
 
-      if (setup_ccl_program (ccl, XCDR (elt)) < 0)
-       xfree (ccl);
-      else
-       fontp->font_encoder = ccl;
+    case kEventFontSelection:
+      id_key = Qselection;
+      num_params = sizeof (names_sel) / sizeof (names_sel[0]);
+      names = names_sel;
+      types = types_sel;
+      break;
     }
-}
 
-#if USE_MAC_FONT_PANEL
-/* Whether Font Panel has been shown before.  The first call to font
-   panel functions (FPIsFontPanelVisible, SetFontInfoForSelection) is
-   slow.  This variable is used for deferring such a call as much as
-   possible.  */
-static int font_panel_shown_p = 0;
+  err = mac_store_event_ref_as_apple_event (0, 0, Qfont, id_key,
+                                           event, num_params,
+                                           names, types);
+  if (err == noErr)
+    result = noErr;
 
-int
-mac_font_panel_visible_p ()
-{
-  return font_panel_shown_p && FPIsFontPanelVisible ();
+  return result;
 }
 
 OSStatus
 mac_show_hide_font_panel ()
 {
-  font_panel_shown_p = 1;
+  if (!font_panel_shown_p)
+    {
+      OSStatus err;
+
+      static const EventTypeSpec specs[] =
+       {{kEventClassFont, kEventFontPanelClosed},
+        {kEventClassFont, kEventFontSelection}};
+
+      err = InstallApplicationEventHandler (mac_handle_font_event,
+                                           GetEventTypeCount (specs),
+                                           specs, NULL, NULL);
+      if (err != noErr)
+       return err;
+
+      font_panel_shown_p = 1;
+    }
 
   return FPShowHideFontPanel ();
 }
@@ -8853,7 +9551,7 @@ Lisp_Object Vmac_function_modifier;
    a three button mouse */
 Lisp_Object Vmac_emulate_three_button_mouse;
 
-#if USE_CARBON_EVENTS
+#if TARGET_API_MAC_CARBON
 /* Non-zero if the mouse wheel button (i.e. button 4) should map to
    mouse-2, instead of mouse-3.  */
 int mac_wheel_button_is_mouse_2;
@@ -8878,16 +9576,12 @@ static int mac_screen_config_changed = 0;
 Point saved_menu_event_location;
 
 /* Apple Events */
-#if USE_CARBON_EVENTS
+#if TARGET_API_MAC_CARBON
 static Lisp_Object Qhi_command;
 #ifdef MAC_OSX
 extern Lisp_Object Qwindow;
 static Lisp_Object Qtoolbar_switch_mode;
 #endif
-#if USE_MAC_FONT_PANEL
-extern Lisp_Object Qfont;
-static Lisp_Object Qpanel_closed, Qselection;
-#endif
 #if USE_MAC_TSM
 static TSMDocumentID tsm_document_id;
 static Lisp_Object Qtext_input;
@@ -8899,7 +9593,7 @@ static Lisp_Object saved_ts_script_language_on_focus;
 static ScriptLanguageRecord saved_ts_language;
 static Component saved_ts_component;
 #endif
-#endif
+#endif /* TARGET_API_MAC_CARBON */
 extern int mac_ready_for_apple_events;
 extern Lisp_Object Qundefined;
 extern void init_apple_event_handler P_ ((void));
@@ -8912,20 +9606,15 @@ extern OSErr init_coercion_handler P_ ((void));
 extern OSErr install_drag_handler P_ ((WindowRef));
 extern void remove_drag_handler P_ ((WindowRef));
 
+#if TARGET_API_MAC_CARBON
 /* Showing help echo string during menu tracking  */
-extern OSStatus install_menu_target_item_handler P_ ((WindowPtr));
+extern OSStatus install_menu_target_item_handler P_ ((void));
 
-#if USE_CARBON_EVENTS
 #ifdef MAC_OSX
-extern void init_service_handler ();
+extern OSStatus install_service_handler ();
 static Lisp_Object Qservice, Qpaste, Qperform;
 #endif
-
-/* Window Event Handler */
-static pascal OSStatus mac_handle_window_event (EventHandlerCallRef,
-                                               EventRef, void *);
 #endif
-OSStatus install_window_handler (WindowPtr);
 
 extern void init_emacs_passwd_dir ();
 extern int emacs_main (int, char **, char **);
@@ -9009,7 +9698,7 @@ static const unsigned char fn_keycode_to_keycode_table[] = {
 #endif /* MAC_OSX */
 
 static int
-#if USE_CARBON_EVENTS
+#if TARGET_API_MAC_CARBON
 mac_to_emacs_modifiers (UInt32 mods)
 #else
 mac_to_emacs_modifiers (EventModifiers mods)
@@ -9118,17 +9807,19 @@ mac_quit_char_key_p (modifiers, key_code)
 }
 #endif
 
-#if USE_CARBON_EVENTS
+#if TARGET_API_MAC_CARBON
 /* Obtains the event modifiers from the event ref and then calls
    mac_to_emacs_modifiers.  */
 static int
 mac_event_to_emacs_modifiers (EventRef eventRef)
 {
-  UInt32 mods = 0;
+  UInt32 mods = 0, class;
+
   GetEventParameter (eventRef, kEventParamKeyModifiers, typeUInt32, NULL,
                    sizeof (UInt32), NULL, &mods);
+  class = GetEventClass (eventRef);
   if (!NILP (Vmac_emulate_three_button_mouse) &&
-      GetEventClass(eventRef) == kEventClassMouse)
+      (class == kEventClassMouse || class == kEventClassCommand))
     {
       mods &= ~(optionKey | cmdKey);
     }
@@ -9267,7 +9958,7 @@ static void
 do_get_menus (void)
 {
   Handle menubar_handle;
-  MenuHandle menu_handle;
+  MenuRef menu;
 
   menubar_handle = GetNewMBar (128);
   if(menubar_handle == NULL)
@@ -9276,9 +9967,9 @@ do_get_menus (void)
   DrawMenuBar ();
 
 #if !TARGET_API_MAC_CARBON
-  menu_handle = GetMenuHandle (M_APPLE);
-  if(menu_handle != NULL)
-    AppendResMenu (menu_handle,'DRVR');
+  menu = GetMenuRef (M_APPLE);
+  if (menu != NULL)
+    AppendResMenu (menu'DRVR');
   else
     abort ();
 #endif
@@ -9327,7 +10018,7 @@ do_check_ram_size (void)
 #endif /* MAC_OS8 */
 
 static void
-do_window_update (WindowPtr win)
+do_window_update (WindowRef win)
 {
   struct frame *f = mac_window_to_frame (win);
 
@@ -9372,7 +10063,7 @@ do_window_update (WindowPtr win)
 }
 
 static int
-is_emacs_window (WindowPtr win)
+is_emacs_window (WindowRef win)
 {
   Lisp_Object tail, frame;
 
@@ -9485,7 +10176,7 @@ do_apple_menu (SInt16 menu_item)
     NoteAlert (ABOUT_ALERT_ID, NULL);
   else
     {
-      GetMenuItemText (GetMenuHandle (M_APPLE), menu_item, item_name);
+      GetMenuItemText (GetMenuRef (M_APPLE), menu_item, item_name);
       da_driver_refnum = OpenDeskAcc (item_name);
     }
 }
@@ -9496,7 +10187,7 @@ do_apple_menu (SInt16 menu_item)
 
 static void
 do_grow_window (w, e)
-     WindowPtr w;
+     WindowRef w;
      const EventRecord *e;
 {
   Rect limit_rect;
@@ -9548,7 +10239,7 @@ mac_get_ideal_size (f)
      struct frame *f;
 {
   struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
-  WindowPtr w = FRAME_MAC_WINDOW (f);
+  WindowRef w = FRAME_MAC_WINDOW (f);
   Point ideal_size;
   Rect standard_rect;
   int height, width, columns, rows;
@@ -9574,7 +10265,7 @@ mac_get_ideal_size (f)
    wide (DEFAULT_NUM_COLS) and as tall as will fit on the screen.  */
 
 static void
-do_zoom_window (WindowPtr w, int zoom_in_or_out)
+do_zoom_window (WindowRef w, int zoom_in_or_out)
 {
   Rect zoom_rect, port_rect;
   int width, height;
@@ -9637,13 +10328,9 @@ do_zoom_window (WindowPtr w, int zoom_in_or_out)
   SetPort (save_port);
 #endif /* not TARGET_API_MAC_CARBON */
 
-#if !USE_CARBON_EVENTS
+#if !TARGET_API_MAC_CARBON
   /* retrieve window size and update application values */
-#if TARGET_API_MAC_CARBON
-  GetWindowPortBounds (w, &port_rect);
-#else
   port_rect = w->portRect;
-#endif
   height = port_rect.bottom - port_rect.top;
   width = port_rect.right - port_rect.left;
 
@@ -9652,6 +10339,210 @@ do_zoom_window (WindowPtr w, int zoom_in_or_out)
 #endif
 }
 
+static void
+mac_set_unicode_keystroke_event (code, buf)
+     UniChar code;
+     struct input_event *buf;
+{
+  int charset_id, c1, c2;
+
+  if (code < 0x80)
+    {
+      buf->kind = ASCII_KEYSTROKE_EVENT;
+      buf->code = code;
+    }
+  else if (code < 0x100)
+    {
+      if (code < 0xA0)
+       charset_id = CHARSET_8_BIT_CONTROL;
+      else
+       charset_id = charset_latin_iso8859_1;
+      buf->kind = MULTIBYTE_CHAR_KEYSTROKE_EVENT;
+      buf->code = MAKE_CHAR (charset_id, code, 0);
+    }
+  else
+    {
+      if (code < 0x2500)
+       charset_id = charset_mule_unicode_0100_24ff,
+         code -= 0x100;
+      else if (code < 0x33FF)
+       charset_id = charset_mule_unicode_2500_33ff,
+         code -= 0x2500;
+      else if (code >= 0xE000)
+       charset_id = charset_mule_unicode_e000_ffff,
+         code -= 0xE000;
+      c1 = (code / 96) + 32, c2 = (code % 96) + 32;
+      buf->kind = MULTIBYTE_CHAR_KEYSTROKE_EVENT;
+      buf->code = MAKE_CHAR (charset_id, c1, c2);
+    }
+}
+
+static void
+do_keystroke (action, char_code, key_code, modifiers, timestamp, buf)
+     EventKind action;
+     unsigned char char_code;
+     UInt32 key_code, modifiers;
+     unsigned long timestamp;
+     struct input_event *buf;
+{
+  static SInt16 last_key_script = -1;
+  SInt16 current_key_script = GetScriptManagerVariable (smKeyScript);
+  UInt32 mapped_modifiers = mac_mapped_modifiers (modifiers);
+
+#ifdef MAC_OSX
+  if (mapped_modifiers & kEventKeyModifierFnMask
+      && key_code <= 0x7f
+      && fn_keycode_to_keycode_table[key_code])
+    key_code = fn_keycode_to_keycode_table[key_code];
+#endif
+
+  if (key_code <= 0x7f && keycode_to_xkeysym_table[key_code])
+    {
+      buf->kind = NON_ASCII_KEYSTROKE_EVENT;
+      buf->code = 0xff00 | keycode_to_xkeysym_table[key_code];
+#ifdef MAC_OSX
+      if (modifiers & kEventKeyModifierFnMask
+         && key_code <= 0x7f
+         && fn_keycode_to_keycode_table[key_code] == key_code)
+       modifiers &= ~kEventKeyModifierFnMask;
+#endif
+    }
+  else if (mapped_modifiers)
+    {
+      /* translate the keycode back to determine the original key */
+#ifdef MAC_OSX
+      UCKeyboardLayout *uchr_ptr = NULL;
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
+      OSStatus err;
+      KeyboardLayoutRef layout;
+
+      err = KLGetCurrentKeyboardLayout (&layout);
+      if (err == noErr)
+       err = KLGetKeyboardLayoutProperty (layout, kKLuchrData,
+                                          (const void **) &uchr_ptr);
+#else
+      static SInt16 last_key_layout_id = 0;
+      static Handle uchr_handle = (Handle)-1;
+      SInt16 current_key_layout_id =
+       GetScriptVariable (current_key_script, smScriptKeys);
+
+      if (uchr_handle == (Handle)-1
+         || last_key_layout_id != current_key_layout_id)
+       {
+         uchr_handle = GetResource ('uchr', current_key_layout_id);
+         last_key_layout_id = current_key_layout_id;
+       }
+      if (uchr_handle)
+       uchr_ptr = (UCKeyboardLayout *)*uchr_handle;
+#endif
+
+      if (uchr_ptr)
+       {
+         OSStatus status;
+         UInt16 key_action = action - keyDown;
+         UInt32 modifier_key_state = (modifiers & ~mapped_modifiers) >> 8;
+         UInt32 keyboard_type = LMGetKbdType ();
+         SInt32 dead_key_state = 0;
+         UniChar code;
+         UniCharCount actual_length;
+
+         status = UCKeyTranslate (uchr_ptr, key_code, key_action,
+                                  modifier_key_state, keyboard_type,
+                                  kUCKeyTranslateNoDeadKeysMask,
+                                  &dead_key_state,
+                                  1, &actual_length, &code);
+         if (status == noErr && actual_length == 1)
+           mac_set_unicode_keystroke_event (code, buf);
+       }
+#endif /* MAC_OSX */
+
+      if (buf->kind == NO_EVENT)
+       {
+         /* This code comes from Keyboard Resource, Appendix C of IM
+            - Text.  This is necessary since shift is ignored in KCHR
+            table translation when option or command is pressed.  It
+            also does not translate correctly control-shift chars
+            like C-% so mask off shift here also.  */
+         /* Mask off modifier keys that are mapped to some Emacs
+            modifiers.  */
+         int new_modifiers = modifiers & ~mapped_modifiers;
+         /* set high byte of keycode to modifier high byte*/
+         int new_key_code = key_code | new_modifiers;
+         Ptr kchr_ptr = (Ptr) GetScriptManagerVariable (smKCHRCache);
+         unsigned long some_state = 0;
+         UInt32 new_char_code;
+
+         new_char_code = KeyTranslate (kchr_ptr, new_key_code, &some_state);
+         if (new_char_code == 0)
+           /* Seems like a dead key.  Append up-stroke.  */
+           new_char_code = KeyTranslate (kchr_ptr, new_key_code | 0x80,
+                                         &some_state);
+         if (new_char_code)
+           {
+             buf->kind = ASCII_KEYSTROKE_EVENT;
+             buf->code = new_char_code & 0xff;
+           }
+       }
+    }
+
+  if (buf->kind == NO_EVENT)
+    {
+      buf->kind = ASCII_KEYSTROKE_EVENT;
+      buf->code = char_code;
+    }
+
+  buf->modifiers = mac_to_emacs_modifiers (modifiers);
+  buf->modifiers |= (extra_keyboard_modifiers
+                    & (meta_modifier | alt_modifier
+                       | hyper_modifier | super_modifier));
+
+#if TARGET_API_MAC_CARBON
+  if (buf->kind == ASCII_KEYSTROKE_EVENT
+      && buf->code >= 0x80 && buf->modifiers)
+    {
+      OSStatus err;
+      TextEncoding encoding = kTextEncodingMacRoman;
+      TextToUnicodeInfo ttu_info;
+
+      UpgradeScriptInfoToTextEncoding (current_key_script,
+                                      kTextLanguageDontCare,
+                                      kTextRegionDontCare,
+                                      NULL, &encoding);
+      err = CreateTextToUnicodeInfoByEncoding (encoding, &ttu_info);
+      if (err == noErr)
+       {
+         UniChar code;
+         Str255 pstr;
+         ByteCount unicode_len;
+
+         pstr[0] = 1;
+         pstr[1] = buf->code;
+         err = ConvertFromPStringToUnicode (ttu_info, pstr,
+                                            sizeof (UniChar),
+                                            &unicode_len, &code);
+         if (err == noErr && unicode_len == sizeof (UniChar))
+           mac_set_unicode_keystroke_event (code, buf);
+         DisposeTextToUnicodeInfo (&ttu_info);
+       }
+    }
+#endif
+
+  if (buf->kind == ASCII_KEYSTROKE_EVENT
+      && buf->code >= 0x80
+      && last_key_script != current_key_script)
+    {
+      struct input_event event;
+
+      EVENT_INIT (event);
+      event.kind = LANGUAGE_CHANGE_EVENT;
+      event.arg = Qnil;
+      event.code = current_key_script;
+      event.timestamp = timestamp;
+      kbd_buffer_store_event (&event);
+      last_key_script = current_key_script;
+    }
+}
+
 void
 mac_store_apple_event (class, id, desc)
      Lisp_Object class, id;
@@ -9730,54 +10621,49 @@ mac_store_drag_event (window, mouse_pos, modifiers, desc)
   buf.arg = mac_aedesc_to_lisp (desc);
   kbd_buffer_store_event (&buf);
 }
-#endif
 
-#if USE_CARBON_EVENTS
-static pascal OSStatus
-mac_handle_command_event (next_handler, event, data)
-     EventHandlerCallRef next_handler;
+#ifdef MAC_OSX
+OSStatus
+mac_store_service_event (event)
      EventRef event;
-     void *data;
 {
-  OSStatus result, err;
-  HICommand command;
-  static const EventParamName names[] =
-    {kEventParamDirectObject, kEventParamKeyModifiers};
-  static const EventParamType types[] =
-    {typeHICommand, typeUInt32};
-  int num_params = sizeof (names) / sizeof (names[0]);
-
-  result = CallNextEventHandler (next_handler, event);
-  if (result != eventNotHandledErr)
-    return result;
+  OSStatus err;
+  Lisp_Object id_key;
+  int num_params;
+  const EventParamName *names;
+  const EventParamType *types;
+  static const EventParamName names_pfm[] =
+    {kEventParamServiceMessageName, kEventParamServiceUserData};
+  static const EventParamType types_pfm[] =
+    {typeCFStringRef, typeCFStringRef};
 
-  err = GetEventParameter (event, kEventParamDirectObject, typeHICommand,
-                          NULL, sizeof (HICommand), NULL, &command);
+  switch (GetEventKind (event))
+    {
+    case kEventServicePaste:
+      id_key = Qpaste;
+      num_params = 0;
+      names = NULL;
+      types = NULL;
+      break;
 
-  if (err != noErr || command.commandID == 0)
-    return eventNotHandledErr;
+    case kEventServicePerform:
+      id_key = Qperform;
+      num_params = sizeof (names_pfm) / sizeof (names_pfm[0]);
+      names = names_pfm;
+      types = types_pfm;
+      break;
 
-  /* A HI command event is mapped to an Apple event whose event class
-     symbol is `hi-command' and event ID is its command ID.  */
-  err = mac_store_event_ref_as_apple_event (0, command.commandID,
-                                           Qhi_command, Qnil,
-                                           event, num_params, names, types);
-  return err == noErr ? noErr : eventNotHandledErr;
-}
+    default:
+      abort ();
+    }
 
-static OSStatus
-init_command_handler ()
-{
-  static const EventTypeSpec specs[] =
-    {{kEventClassCommand, kEventCommandProcess}};
-  static EventHandlerUPP handle_command_eventUPP = NULL;
+  err = mac_store_event_ref_as_apple_event (0, 0, Qservice, id_key,
+                                           event, num_params,
+                                           names, types);
 
-  if (handle_command_eventUPP == NULL)
-    handle_command_eventUPP = NewEventHandlerUPP (mac_handle_command_event);
-  return InstallApplicationEventHandler (handle_command_eventUPP,
-                                        GetEventTypeCount (specs), specs,
-                                        NULL, NULL);
+  return err;
 }
+#endif /* MAC_OSX */
 
 static pascal OSStatus
 mac_handle_window_event (next_handler, event, data)
@@ -9785,47 +10671,88 @@ mac_handle_window_event (next_handler, event, data)
      EventRef event;
      void *data;
 {
-  WindowPtr wp;
-  OSStatus result, err;
+  WindowRef wp;
+  OSStatus err, result = eventNotHandledErr;
   struct frame *f;
   UInt32 attributes;
   XSizeHints *size_hints;
 
   err = GetEventParameter (event, kEventParamDirectObject, typeWindowRef,
-                          NULL, sizeof (WindowPtr), NULL, &wp);
+                          NULL, sizeof (WindowRef), NULL, &wp);
   if (err != noErr)
     return eventNotHandledErr;
 
   f = mac_window_to_frame (wp);
   switch (GetEventKind (event))
     {
+      /* -- window refresh events -- */
+
     case kEventWindowUpdate:
       result = CallNextEventHandler (next_handler, event);
       if (result != eventNotHandledErr)
-       return result;
+       break;
 
       do_window_update (wp);
-      return noErr;
+      result = noErr;
+      break;
 
-    case kEventWindowGetIdealSize:
-      result = CallNextEventHandler (next_handler, event);
-      if (result != eventNotHandledErr)
-       return result;
+      /* -- window state change events -- */
 
-      {
-       Point ideal_size = mac_get_ideal_size (f);
+    case kEventWindowShowing:
+      size_hints = FRAME_SIZE_HINTS (f);
+      if (!(size_hints->flags & (USPosition | PPosition)))
+       {
+         struct frame *sf = SELECTED_FRAME ();
 
-       err = SetEventParameter (event, kEventParamDimensions,
-                                typeQDPoint, sizeof (Point), &ideal_size);
-       if (err == noErr)
-         return noErr;
-      }
+         if (!(FRAME_MAC_P (sf) && sf->async_visible))
+           RepositionWindow (wp, NULL, kWindowCenterOnMainScreen);
+         else
+           {
+             RepositionWindow (wp, FRAME_MAC_WINDOW (sf),
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
+                               kWindowCascadeStartAtParentWindowScreen
+#else
+                               kWindowCascadeOnParentWindowScreen
+#endif
+                               );
+#if USE_MAC_TOOLBAR
+             /* This is a workaround.  RepositionWindow fails to put
+                a window at the cascading position when its parent
+                window has a Carbon HIToolbar.  */
+             if ((f->left_pos == sf->left_pos
+                  && f->top_pos == sf->top_pos)
+                 || (f->left_pos == sf->left_pos + 10 * 2
+                     && f->top_pos == sf->top_pos + 32 * 2))
+               MoveWindowStructure (wp, sf->left_pos + 10, sf->top_pos + 32);
+#endif
+           }
+         result = noErr;
+       }
+      break;
+
+    case kEventWindowHiding:
+      /* Before unmapping the window, update the WM_SIZE_HINTS
+        property to claim that the current position of the window is
+        user-specified, rather than program-specified, so that when
+        the window is mapped again, it will be placed at the same
+        location, without forcing the user to position it by hand
+        again (they have already done that once for this window.)  */
+      x_wm_set_size_hint (f, (long) 0, 1);
+      result = noErr;
+      break;
+
+    case kEventWindowShown:
+    case kEventWindowHidden:
+    case kEventWindowCollapsed:
+    case kEventWindowExpanded:
+      mac_handle_visibility_change (f);
+      result = noErr;
       break;
 
     case kEventWindowBoundsChanging:
       result = CallNextEventHandler (next_handler, event);
       if (result != eventNotHandledErr)
-       return result;
+       break;
 
       err = GetEventParameter (event, kEventParamAttributes, typeUInt32,
                               NULL, sizeof (UInt32), NULL, &attributes);
@@ -9869,7 +10796,7 @@ mac_handle_window_event (next_handler, event, data)
          bounds.bottom = bounds.top + height;
          SetEventParameter (event, kEventParamCurrentBounds,
                             typeQDRectangle, sizeof (Rect), &bounds);
-         return noErr;
+         result = noErr;
        }
       break;
 
@@ -9900,21 +10827,12 @@ mac_handle_window_event (next_handler, event, data)
       if (attributes & kWindowBoundsChangeOriginChanged)
        mac_handle_origin_change (f);
 
-      return noErr;
-
-    case kEventWindowShown:
-    case kEventWindowHidden:
-    case kEventWindowExpanded:
-    case kEventWindowCollapsed:
-      result = CallNextEventHandler (next_handler, event);
-
-      mac_handle_visibility_change (f);
-      return noErr;
-
+      result = noErr;
       break;
 
+      /* -- window action events -- */
+
     case kEventWindowClose:
-      result = CallNextEventHandler (next_handler, event);
       {
        struct input_event buf;
 
@@ -9924,11 +10842,26 @@ mac_handle_window_event (next_handler, event, data)
        buf.arg = Qnil;
        kbd_buffer_store_event (&buf);
       }
-      return noErr;
+      result = noErr;
+      break;
+
+    case kEventWindowGetIdealSize:
+      result = CallNextEventHandler (next_handler, event);
+      if (result != eventNotHandledErr)
+       break;
+
+      {
+       Point ideal_size = mac_get_ideal_size (f);
+
+       err = SetEventParameter (event, kEventParamDimensions,
+                                typeQDPoint, sizeof (Point), &ideal_size);
+       if (err == noErr)
+         result = noErr;
+      }
+      break;
 
 #ifdef MAC_OSX
     case kEventWindowToolbarSwitchMode:
-      result = CallNextEventHandler (next_handler, event);
       {
        static const EventParamName names[] = {kEventParamDirectObject,
                                               kEventParamWindowMouseLocation,
@@ -9950,23 +10883,184 @@ mac_handle_window_event (next_handler, event, data)
                                                  event, num_params,
                                                  names, types);
       }
-      return err == noErr ? noErr : result;
+      if (err == noErr)
+       result = noErr;
+      break;
 #endif
 
 #if USE_MAC_TSM
+      /* -- window focus events -- */
+
     case kEventWindowFocusAcquired:
-      result = CallNextEventHandler (next_handler, event);
       err = mac_tsm_resume ();
-      return err == noErr ? noErr : result;
+      if (err == noErr)
+       result = noErr;
+      break;
 
     case kEventWindowFocusRelinquish:
-      result = CallNextEventHandler (next_handler, event);
       err = mac_tsm_suspend ();
-      return err == noErr ? noErr : result;
+      if (err == noErr)
+       result = noErr;
+      break;
+#endif
+
+    default:
+      abort ();
+    }
+
+  return result;
+}
+
+static pascal OSStatus
+mac_handle_application_event (next_handler, event, data)
+     EventHandlerCallRef next_handler;
+     EventRef event;
+     void *data;
+{
+  OSStatus err, result = eventNotHandledErr;
+
+  switch (GetEventKind (event))
+    {
+#if USE_MAC_TSM
+    case kEventAppActivated:
+      err = mac_tsm_resume ();
+      break;
+
+    case kEventAppDeactivated:
+      err = mac_tsm_suspend ();
+      break;
+#endif
+
+    default:
+      abort ();
+    }
+
+  if (err == noErr)
+    result = noErr;
+
+  return result;
+}
+
+static pascal OSStatus
+mac_handle_keyboard_event (next_handler, event, data)
+     EventHandlerCallRef next_handler;
+     EventRef event;
+     void *data;
+{
+  OSStatus err, result = eventNotHandledErr;
+  UInt32 event_kind, key_code, modifiers;
+  unsigned char char_code;
+
+  event_kind = GetEventKind (event);
+  switch (event_kind)
+    {
+    case kEventRawKeyDown:
+    case kEventRawKeyRepeat:
+    case kEventRawKeyUp:
+      /* When using Carbon Events, we need to pass raw keyboard events
+        to the TSM ourselves.  If TSM handles it, it will pass back
+        noErr, otherwise it will pass back "eventNotHandledErr" and
+        we can process it normally.  */
+      result = CallNextEventHandler (next_handler, event);
+      if (result != eventNotHandledErr)
+       break;
+
+      if (read_socket_inev == NULL)
+       break;
+
+#if USE_MAC_TSM
+      if (read_socket_inev->kind != NO_EVENT)
+       {
+         result = noErr;
+         break;
+       }
 #endif
+
+      if (event_kind == kEventRawKeyUp)
+       break;
+
+      err = GetEventParameter (event, kEventParamKeyMacCharCodes,
+                              typeChar, NULL,
+                              sizeof (char), NULL, &char_code);
+      if (err != noErr)
+       break;
+
+      err = GetEventParameter (event, kEventParamKeyCode,
+                              typeUInt32, NULL,
+                              sizeof (UInt32), NULL, &key_code);
+      if (err != noErr)
+       break;
+
+      err = GetEventParameter (event, kEventParamKeyModifiers,
+                              typeUInt32, NULL,
+                              sizeof (UInt32), NULL, &modifiers);
+      if (err != noErr)
+       break;
+
+      do_keystroke ((event_kind == kEventRawKeyDown ? keyDown : autoKey),
+                   char_code, key_code, modifiers,
+                   ((unsigned long)
+                    (GetEventTime (event) / kEventDurationMillisecond)),
+                   read_socket_inev);
+      result = noErr;
+      break;
+
+    default:
+      abort ();
+    }
+
+  return result;
+}
+
+static pascal OSStatus
+mac_handle_command_event (next_handler, event, data)
+     EventHandlerCallRef next_handler;
+     EventRef event;
+     void *data;
+{
+  OSStatus err, result = eventNotHandledErr;
+  HICommand command;
+  static const EventParamName names[] =
+    {kEventParamDirectObject, kEventParamKeyModifiers};
+  static const EventParamType types[] =
+    {typeHICommand, typeUInt32};
+  int num_params = sizeof (names) / sizeof (names[0]);
+
+  err = GetEventParameter (event, kEventParamDirectObject, typeHICommand,
+                          NULL, sizeof (HICommand), NULL, &command);
+  if (err != noErr)
+    return eventNotHandledErr;
+
+  switch (GetEventKind (event))
+    {
+    case kEventCommandProcess:
+      result = CallNextEventHandler (next_handler, event);
+      if (result != eventNotHandledErr)
+       break;
+
+      err = GetEventParameter (event, kEventParamDirectObject,
+                              typeHICommand, NULL,
+                              sizeof (HICommand), NULL, &command);
+
+      if (err != noErr || command.commandID == 0)
+       break;
+
+      /* A HI command event is mapped to an Apple event whose event
+        class symbol is `hi-command' and event ID is its command
+        ID.  */
+      err = mac_store_event_ref_as_apple_event (0, command.commandID,
+                                               Qhi_command, Qnil,
+                                               event, num_params,
+                                               names, types);
+      if (err == noErr)
+       result = noErr;
+      break;
+
+    default:
+      abort ();
     }
 
-  return eventNotHandledErr;
+  return result;
 }
 
 static pascal OSStatus
@@ -9975,13 +11069,13 @@ mac_handle_mouse_event (next_handler, event, data)
      EventRef event;
      void *data;
 {
-  OSStatus result, err;
+  OSStatus err, result = eventNotHandledErr;
 
   switch (GetEventKind (event))
     {
     case kEventMouseWheelMoved:
       {
-       WindowPtr wp;
+       WindowRef wp;
        struct frame *f;
        EventMouseWheelAxis axis;
        SInt32 delta;
@@ -9989,15 +11083,14 @@ mac_handle_mouse_event (next_handler, event, data)
 
        result = CallNextEventHandler (next_handler, event);
        if (result != eventNotHandledErr || read_socket_inev == NULL)
-         return result;
+         break;
+
+       f = mac_focus_frame (&one_mac_display_info);
 
        err = GetEventParameter (event, kEventParamWindowRef, typeWindowRef,
                                 NULL, sizeof (WindowRef), NULL, &wp);
-       if (err != noErr)
-         break;
-
-       f = mac_window_to_frame (wp);
-       if (f != mac_focus_frame (&one_mac_display_info))
+       if (err != noErr
+           || wp != FRAME_MAC_WINDOW (f))
          break;
 
        err = GetEventParameter (event, kEventParamMouseWheelAxis,
@@ -10012,8 +11105,8 @@ mac_handle_mouse_event (next_handler, event, data)
        if (err != noErr)
          break;
 
-       SetPortWindowPort (wp);
-       GlobalToLocal (&point);
+       point.h -= f->left_pos + FRAME_OUTER_TO_INNER_DIFF_X (f);
+       point.v -= f->top_pos + FRAME_OUTER_TO_INNER_DIFF_Y (f);
        if (point.h < 0 || point.v < 0
            || EQ (window_from_coordinates (f, point.h, point.v, 0, 0, 0, 1),
                   f->tool_bar_window))
@@ -10034,68 +11127,16 @@ mac_handle_mouse_event (next_handler, event, data)
        XSETINT (read_socket_inev->y, point.v);
        XSETFRAME (read_socket_inev->frame_or_window, f);
 
-       return noErr;
+       result = noErr;
       }
       break;
 
     default:
-      break;
-    }
-
-  return eventNotHandledErr;
-}
-
-#if USE_MAC_FONT_PANEL
-static pascal OSStatus
-mac_handle_font_event (next_handler, event, data)
-     EventHandlerCallRef next_handler;
-     EventRef event;
-     void *data;
-{
-  OSStatus result, err;
-  Lisp_Object id_key;
-  int num_params;
-  const EventParamName *names;
-  const EventParamType *types;
-  static const EventParamName names_sel[] = {kEventParamATSUFontID,
-                                            kEventParamATSUFontSize,
-                                            kEventParamFMFontFamily,
-                                            kEventParamFMFontSize,
-                                            kEventParamFontColor};
-  static const EventParamType types_sel[] = {typeATSUFontID,
-                                            typeATSUSize,
-                                            typeFMFontFamily,
-                                            typeFMFontSize,
-                                            typeFontColor};
-
-  result = CallNextEventHandler (next_handler, event);
-  if (result != eventNotHandledErr)
-    return result;
-
-  switch (GetEventKind (event))
-    {
-    case kEventFontPanelClosed:
-      id_key = Qpanel_closed;
-      num_params = 0;
-      names = NULL;
-      types = NULL;
-      break;
-
-    case kEventFontSelection:
-      id_key = Qselection;
-      num_params = sizeof (names_sel) / sizeof (names_sel[0]);
-      names = names_sel;
-      types = types_sel;
-      break;
+      abort ();
     }
 
-  err = mac_store_event_ref_as_apple_event (0, 0, Qfont, id_key,
-                                           event, num_params,
-                                           names, types);
-
-  return err == noErr ? noErr : eventNotHandledErr;
+  return result;
 }
-#endif
 
 #if USE_MAC_TSM
 static pascal OSStatus
@@ -10104,7 +11145,7 @@ mac_handle_text_input_event (next_handler, event, data)
      EventRef event;
      void *data;
 {
-  OSStatus result, err = noErr;
+  OSStatus err, result;
   Lisp_Object id_key = Qnil;
   int num_params;
   const EventParamName *names;
@@ -10152,6 +11193,8 @@ mac_handle_text_input_event (next_handler, event, data)
      typeUnicodeText};
 
   result = CallNextEventHandler (next_handler, event);
+  if (result != eventNotHandledErr)
+    return result;
 
   switch (GetEventKind (event))
     {
@@ -10163,6 +11206,7 @@ mac_handle_text_input_event (next_handler, event, data)
       SetEventParameter (event, EVENT_PARAM_TEXT_INPUT_SEQUENCE_NUMBER,
                         typeUInt32, sizeof (UInt32), &seqno_uaia);
       seqno_uaia++;
+      result = noErr;
       break;
 
     case kEventTextInputUnicodeForKeyEvent:
@@ -10179,8 +11223,8 @@ mac_handle_text_input_event (next_handler, event, data)
                                   sizeof (UInt32), NULL, &modifiers);
        if (err == noErr && mac_mapped_modifiers (modifiers))
          /* There're mapped modifier keys.  Process it in
-            XTread_socket.  */
-         return eventNotHandledErr;
+            do_keystroke.  */
+         break;
        if (err == noErr)
          err = GetEventParameter (kbd_event, kEventParamKeyUnicodes,
                                   typeUnicodeText, NULL, 0, &actual_size,
@@ -10194,7 +11238,7 @@ mac_handle_text_input_event (next_handler, event, data)
                                     sizeof (UniChar), NULL, &code);
            if (err == noErr && code < 0x80)
              {
-               /* ASCII character.  Process it in XTread_socket.  */
+               /* ASCII character.  Process it in do_keystroke.  */
                if (read_socket_inev && code >= 0x20 && code <= 0x7e)
                  {
                    UInt32 key_code;
@@ -10219,16 +11263,20 @@ mac_handle_text_input_event (next_handler, event, data)
                        XSETFRAME (read_socket_inev->frame_or_window, f);
                      }
                  }
-               return eventNotHandledErr;
+               break;
              }
          }
+       if (err == noErr)
+         {
+           /* Non-ASCII keystrokes without mapped modifiers are
+              processed at the Lisp level.  */
+           id_key = Qunicode_for_key_event;
+           num_params = sizeof (names_ufke) / sizeof (names_ufke[0]);
+           names = names_ufke;
+           types = types_ufke;
+           result = noErr;
+         }
       }
-      /* Non-ASCII keystrokes without mapped modifiers are processed
-        at the Lisp level.  */
-      id_key = Qunicode_for_key_event;
-      num_params = sizeof (names_ufke) / sizeof (names_ufke[0]);
-      names = names_ufke;
-      types = types_ufke;
       break;
 
     case kEventTextInputOffsetToPos:
@@ -10238,34 +11286,35 @@ mac_handle_text_input_event (next_handler, event, data)
        Point p;
 
        if (!OVERLAYP (Vmac_ts_active_input_overlay))
-         return eventNotHandledErr;
+         break;
 
        /* Strictly speaking, this is not always correct because
           previous events may change some states about display.  */
-       if (NILP (Foverlay_get (Vmac_ts_active_input_overlay, Qbefore_string)))
+       if (!NILP (Foverlay_get (Vmac_ts_active_input_overlay, Qbefore_string)))
+         {
+           /* Active input area is displayed around the current point.  */
+           f = SELECTED_FRAME ();
+           w = XWINDOW (f->selected_window);
+         }
+       else if (WINDOWP (echo_area_window))
          {
-           if (!WINDOWP (echo_area_window))
-             return eventNotHandledErr;
-
            /* Active input area is displayed in the echo area.  */
            w = XWINDOW (echo_area_window);
            f = WINDOW_XFRAME (w);
          }
        else
-         {
-           /* Active input area is displayed around the current point.  */
-           f = SELECTED_FRAME ();
-           w = XWINDOW (f->selected_window);
-         }
+         break;
 
        p.h = (WINDOW_TO_FRAME_PIXEL_X (w, w->cursor.x)
-              + WINDOW_LEFT_FRINGE_WIDTH (w));
+              + WINDOW_LEFT_FRINGE_WIDTH (w)
+              + f->left_pos + FRAME_OUTER_TO_INNER_DIFF_X (f));
        p.v = (WINDOW_TO_FRAME_PIXEL_Y (w, w->cursor.y)
-              + FONT_BASE (FRAME_FONT (f)));
-       SetPortWindowPort (FRAME_MAC_WINDOW (f));
-       LocalToGlobal (&p);
+              + FONT_BASE (FRAME_FONT (f))
+              + f->top_pos + FRAME_OUTER_TO_INNER_DIFF_Y (f));
        err = SetEventParameter (event, kEventParamTextInputReplyPoint,
                                 typeQDPoint, sizeof (typeQDPoint), &p);
+       if (err == noErr)
+         result = noErr;
       }
       break;
 
@@ -10277,146 +11326,152 @@ mac_handle_text_input_event (next_handler, event, data)
     err = mac_store_event_ref_as_apple_event (0, 0, Qtext_input, id_key,
                                              event, num_params,
                                              names, types);
-
-  return err == noErr ? noErr : result;
+  return result;
 }
 #endif
+#endif /* TARGET_API_MAC_CARBON */
+
 
-#ifdef MAC_OSX
 OSStatus
-mac_store_service_event (event)
-     EventRef event;
+install_window_handler (window)
+     WindowRef window;
 {
-  OSStatus err;
-  Lisp_Object id_key;
-  int num_params;
-  const EventParamName *names;
-  const EventParamType *types;
-  static const EventParamName names_pfm[] =
-    {kEventParamServiceMessageName, kEventParamServiceUserData};
-  static const EventParamType types_pfm[] =
-    {typeCFStringRef, typeCFStringRef};
+  OSStatus err = noErr;
 
-  switch (GetEventKind (event))
+#if TARGET_API_MAC_CARBON
+  if (err == noErr)
     {
-    case kEventServicePaste:
-      id_key = Qpaste;
-      num_params = 0;
-      names = NULL;
-      types = NULL;
-      break;
-
-    case kEventServicePerform:
-      id_key = Qperform;
-      num_params = sizeof (names_pfm) / sizeof (names_pfm[0]);
-      names = names_pfm;
-      types = types_pfm;
-      break;
+      static const EventTypeSpec specs[] =
+       {
+         /* -- window refresh events -- */
+         {kEventClassWindow, kEventWindowUpdate},
+         /* -- window state change events -- */
+         {kEventClassWindow, kEventWindowShowing},
+         {kEventClassWindow, kEventWindowHiding},
+         {kEventClassWindow, kEventWindowShown},
+         {kEventClassWindow, kEventWindowHidden},
+         {kEventClassWindow, kEventWindowCollapsed},
+         {kEventClassWindow, kEventWindowExpanded},
+         {kEventClassWindow, kEventWindowBoundsChanging},
+         {kEventClassWindow, kEventWindowBoundsChanged},
+         /* -- window action events -- */
+         {kEventClassWindow, kEventWindowClose},
+         {kEventClassWindow, kEventWindowGetIdealSize},
+#ifdef MAC_OSX
+         {kEventClassWindow, kEventWindowToolbarSwitchMode},
+#endif
+#if USE_MAC_TSM
+         /* -- window focus events -- */
+         {kEventClassWindow, kEventWindowFocusAcquired},
+         {kEventClassWindow, kEventWindowFocusRelinquish},
+#endif
+       };
+      static EventHandlerUPP handle_window_eventUPP = NULL;
 
-    default:
-      abort ();
+      if (handle_window_eventUPP == NULL)
+       handle_window_eventUPP = NewEventHandlerUPP (mac_handle_window_event);
+
+      err = InstallWindowEventHandler (window, handle_window_eventUPP,
+                                      GetEventTypeCount (specs),
+                                      specs, NULL, NULL);
     }
+#endif
 
-  err = mac_store_event_ref_as_apple_event (0, 0, Qservice, id_key,
-                                           event, num_params,
-                                           names, types);
+  if (err == noErr)
+    err = install_drag_handler (window);
 
   return err;
 }
-#endif /* MAC_OSX */
-#endif /* USE_CARBON_EVENTS */
 
+void
+remove_window_handler (window)
+     WindowRef window;
+{
+  remove_drag_handler (window);
+}
 
-OSStatus
-install_window_handler (window)
-     WindowPtr window;
+#if TARGET_API_MAC_CARBON
+static OSStatus
+install_application_handler ()
 {
   OSStatus err = noErr;
-#if USE_CARBON_EVENTS
-  static const EventTypeSpec specs_window[] =
-    {{kEventClassWindow, kEventWindowUpdate},
-     {kEventClassWindow, kEventWindowGetIdealSize},
-     {kEventClassWindow, kEventWindowBoundsChanging},
-     {kEventClassWindow, kEventWindowBoundsChanged},
-     {kEventClassWindow, kEventWindowShown},
-     {kEventClassWindow, kEventWindowHidden},
-     {kEventClassWindow, kEventWindowExpanded},
-     {kEventClassWindow, kEventWindowCollapsed},
-     {kEventClassWindow, kEventWindowClose},
-#ifdef MAC_OSX
-     {kEventClassWindow, kEventWindowToolbarSwitchMode},
-#endif
-#if USE_MAC_TSM
-     {kEventClassWindow, kEventWindowFocusAcquired},
-     {kEventClassWindow, kEventWindowFocusRelinquish},
-#endif
-  };
-  static const EventTypeSpec specs_mouse[] =
-    {{kEventClassMouse, kEventMouseWheelMoved}};
-  static EventHandlerUPP handle_window_eventUPP = NULL;
-  static EventHandlerUPP handle_mouse_eventUPP = NULL;
-#if USE_MAC_FONT_PANEL
-  static const EventTypeSpec specs_font[] =
-    {{kEventClassFont, kEventFontPanelClosed},
-     {kEventClassFont, kEventFontSelection}};
-  static EventHandlerUPP handle_font_eventUPP = NULL;
-#endif
-#if USE_MAC_TSM
-  static const EventTypeSpec specs_text_input[] =
-    {{kEventClassTextInput, kEventTextInputUpdateActiveInputArea},
-     {kEventClassTextInput, kEventTextInputUnicodeForKeyEvent},
-     {kEventClassTextInput, kEventTextInputOffsetToPos}};
-  static EventHandlerUPP handle_text_input_eventUPP = NULL;
-#endif
 
-  if (handle_window_eventUPP == NULL)
-    handle_window_eventUPP = NewEventHandlerUPP (mac_handle_window_event);
-  if (handle_mouse_eventUPP == NULL)
-    handle_mouse_eventUPP = NewEventHandlerUPP (mac_handle_mouse_event);
-#if USE_MAC_FONT_PANEL
-  if (handle_font_eventUPP == NULL)
-    handle_font_eventUPP = NewEventHandlerUPP (mac_handle_font_event);
-#endif
+  if (err == noErr)
+    {
+      static const EventTypeSpec specs[] = {
 #if USE_MAC_TSM
-  if (handle_text_input_eventUPP == NULL)
-    handle_text_input_eventUPP =
-      NewEventHandlerUPP (mac_handle_text_input_event);
+       {kEventClassApplication, kEventAppActivated},
+       {kEventClassApplication, kEventAppDeactivated},
 #endif
-  err = InstallWindowEventHandler (window, handle_window_eventUPP,
-                                  GetEventTypeCount (specs_window),
-                                  specs_window, NULL, NULL);
+      };
+
+      err = InstallApplicationEventHandler (NewEventHandlerUPP
+                                           (mac_handle_application_event),
+                                           GetEventTypeCount (specs),
+                                           specs, NULL, NULL);
+    }
+
   if (err == noErr)
-    err = InstallWindowEventHandler (window, handle_mouse_eventUPP,
-                                    GetEventTypeCount (specs_mouse),
-                                    specs_mouse, NULL, NULL);
-#if USE_MAC_FONT_PANEL
+    {
+      static const EventTypeSpec specs[] =
+       {{kEventClassKeyboard, kEventRawKeyDown},
+        {kEventClassKeyboard, kEventRawKeyRepeat},
+        {kEventClassKeyboard, kEventRawKeyUp}};
+
+      err = InstallApplicationEventHandler (NewEventHandlerUPP
+                                           (mac_handle_keyboard_event),
+                                           GetEventTypeCount (specs),
+                                           specs, NULL, NULL);
+    }
+
   if (err == noErr)
-    err = InstallWindowEventHandler (window, handle_font_eventUPP,
-                                    GetEventTypeCount (specs_font),
-                                    specs_font, NULL, NULL);
-#endif
+    {
+      static const EventTypeSpec specs[] =
+       {{kEventClassCommand, kEventCommandProcess}};
+
+      err = InstallApplicationEventHandler (NewEventHandlerUPP
+                                           (mac_handle_command_event),
+                                           GetEventTypeCount (specs),
+                                           specs, NULL, NULL);
+    }
+
+  if (err == noErr)
+    {
+      static const EventTypeSpec specs[] =
+       {{kEventClassMouse, kEventMouseWheelMoved}};
+
+      err = InstallApplicationEventHandler (NewEventHandlerUPP
+                                           (mac_handle_mouse_event),
+                                           GetEventTypeCount (specs),
+                                           specs, NULL, NULL);
+    }
+
 #if USE_MAC_TSM
   if (err == noErr)
-    err = InstallWindowEventHandler (window, handle_text_input_eventUPP,
-                                    GetEventTypeCount (specs_text_input),
-                                    specs_text_input, window, NULL);
-#endif
+    {
+      static const EventTypeSpec spec[] =
+       {{kEventClassTextInput, kEventTextInputUpdateActiveInputArea},
+        {kEventClassTextInput, kEventTextInputUnicodeForKeyEvent},
+        {kEventClassTextInput, kEventTextInputOffsetToPos}};
+
+      err = InstallApplicationEventHandler (NewEventHandlerUPP
+                                           (mac_handle_text_input_event),
+                                           GetEventTypeCount (spec),
+                                           spec, NULL, NULL);
+    }
 #endif
+
   if (err == noErr)
-    err = install_drag_handler (window);
+    err = install_menu_target_item_handler ();
+
+#ifdef MAC_OSX
   if (err == noErr)
-    err = install_menu_target_item_handler (window);
+    err = install_service_handler ();
+#endif
 
   return err;
 }
-
-void
-remove_window_handler (window)
-     WindowPtr window;
-{
-  remove_drag_handler (window);
-}
-
+#endif
 
 static pascal void
 mac_handle_dm_notification (event)
@@ -10425,20 +11480,48 @@ mac_handle_dm_notification (event)
   mac_screen_config_changed = 1;
 }
 
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
+static void
+mac_handle_cg_display_reconfig (display, flags, user_info)
+     CGDirectDisplayID display;
+     CGDisplayChangeSummaryFlags flags;
+     void *user_info;
+{
+  mac_screen_config_changed = 1;
+}
+#endif
+
 static OSErr
 init_dm_notification_handler ()
 {
-  OSErr err;
-  static DMNotificationUPP handle_dm_notificationUPP = NULL;
-  ProcessSerialNumber psn;
+  OSErr err = noErr;
+
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
+#if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
+  if (CGDisplayRegisterReconfigurationCallback != NULL)
+#endif
+    {
+      CGDisplayRegisterReconfigurationCallback (mac_handle_cg_display_reconfig,
+                                               NULL);
+    }
+#if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
+  else         /* CGDisplayRegisterReconfigurationCallback == NULL */
+#endif
+#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 */
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1030 || MAC_OS_X_VERSION_MIN_REQUIRED == 1020
+    {
+      static DMNotificationUPP handle_dm_notificationUPP = NULL;
+      ProcessSerialNumber psn;
 
-  if (handle_dm_notificationUPP == NULL)
-    handle_dm_notificationUPP =
-      NewDMNotificationUPP (mac_handle_dm_notification);
+      if (handle_dm_notificationUPP == NULL)
+       handle_dm_notificationUPP =
+         NewDMNotificationUPP (mac_handle_dm_notification);
 
-  err = GetCurrentProcess (&psn);
-  if (err == noErr)
-    err = DMRegisterNotifyProc (handle_dm_notificationUPP, &psn);
+      err = GetCurrentProcess (&psn);
+      if (err == noErr)
+       err = DMRegisterNotifyProc (handle_dm_notificationUPP, &psn);
+    }
+#endif
 
   return err;
 }
@@ -10583,7 +11666,7 @@ main (void)
 }
 #endif
 
-#if !USE_CARBON_EVENTS
+#if !TARGET_API_MAC_CARBON
 static RgnHandle mouse_region = NULL;
 
 Boolean
@@ -10620,7 +11703,7 @@ mac_wait_next_event (er, sleep_time, dequeue)
     er_buf.what = nullEvent;
   return true;
 }
-#endif /* not USE_CARBON_EVENTS */
+#endif /* not TARGET_API_MAC_CARBON */
 
 #if TARGET_API_MAC_CARBON
 OSStatus
@@ -10654,44 +11737,6 @@ mac_post_mouse_moved_event ()
 
   return err;
 }
-
-static void
-mac_set_unicode_keystroke_event (code, buf)
-     UniChar code;
-     struct input_event *buf;
-{
-  int charset_id, c1, c2;
-
-  if (code < 0x80)
-    {
-      buf->kind = ASCII_KEYSTROKE_EVENT;
-      buf->code = code;
-    }
-  else if (code < 0x100)
-    {
-      if (code < 0xA0)
-       charset_id = CHARSET_8_BIT_CONTROL;
-      else
-       charset_id = charset_latin_iso8859_1;
-      buf->kind = MULTIBYTE_CHAR_KEYSTROKE_EVENT;
-      buf->code = MAKE_CHAR (charset_id, code, 0);
-    }
-  else
-    {
-      if (code < 0x2500)
-       charset_id = charset_mule_unicode_0100_24ff,
-         code -= 0x100;
-      else if (code < 0x33FF)
-       charset_id = charset_mule_unicode_2500_33ff,
-         code -= 0x2500;
-      else if (code >= 0xE000)
-       charset_id = charset_mule_unicode_e000_ffff,
-         code -= 0xE000;
-      c1 = (code / 96) + 32, c2 = (code % 96) + 32;
-      buf->kind = MULTIBYTE_CHAR_KEYSTROKE_EVENT;
-      buf->code = MAKE_CHAR (charset_id, c1, c2);
-    }
-}
 #endif
 
 /* Emacs calls this whenever it wants to read an input event from the
@@ -10703,7 +11748,7 @@ XTread_socket (sd, expected, hold_quit)
 {
   struct input_event inev;
   int count = 0;
-#if USE_CARBON_EVENTS
+#if TARGET_API_MAC_CARBON
   EventRef eventRef;
   EventTargetRef toolbox_dispatcher;
 #endif
@@ -10724,7 +11769,7 @@ XTread_socket (sd, expected, hold_quit)
 
   ++handling_signal;
 
-#if USE_CARBON_EVENTS
+#if TARGET_API_MAC_CARBON
   toolbox_dispatcher = GetEventDispatcherTarget ();
 
   while (
@@ -10733,9 +11778,9 @@ XTread_socket (sd, expected, hold_quit)
 #endif
         !ReceiveNextEvent (0, NULL, kEventDurationNoWait,
                            kEventRemoveFromQueue, &eventRef))
-#else /* !USE_CARBON_EVENTS */
+#else /* !TARGET_API_MAC_CARBON */
   while (mac_wait_next_event (&er, 0, true))
-#endif /* !USE_CARBON_EVENTS */
+#endif /* !TARGET_API_MAC_CARBON */
     {
       int do_help = 0;
       struct frame *f;
@@ -10745,44 +11790,33 @@ XTread_socket (sd, expected, hold_quit)
       inev.kind = NO_EVENT;
       inev.arg = Qnil;
 
-#if USE_CARBON_EVENTS
+#if TARGET_API_MAC_CARBON
       timestamp = GetEventTime (eventRef) / kEventDurationMillisecond;
-#else
-      timestamp = er.when * (1000 / 60); /* ticks to milliseconds */
-#endif
 
-#if USE_CARBON_EVENTS
-      /* Handle new events */
       if (!mac_convert_event_ref (eventRef, &er))
-       {
-         /* There used to be a handler for the kEventMouseWheelMoved
-            event here.  But as of Mac OS X 10.4, this kind of event
-            is not directly posted to the main event queue by
-            two-finger scrolling on the trackpad.  Instead, some
-            private event is posted and it is converted to a wheel
-            event by the default handler for the application target.
-            The converted one can be received by a Carbon event
-            handler installed on a window target.  */
-         read_socket_inev = &inev;
-         SendEventToEventTarget (eventRef, toolbox_dispatcher);
-         read_socket_inev = NULL;
-       }
-      else
-#endif /* USE_CARBON_EVENTS */
+       goto OTHER;
+#else  /* !TARGET_API_MAC_CARBON */
+      timestamp = er.when * (1000 / 60); /* ticks to milliseconds */
+#endif  /* !TARGET_API_MAC_CARBON */
+
       switch (er.what)
        {
        case mouseDown:
        case mouseUp:
          {
-           WindowPtr window_ptr;
+           WindowRef window_ptr;
            ControlPartCode part_code;
            int tool_bar_p = 0;
 
-#if USE_CARBON_EVENTS
+#if TARGET_API_MAC_CARBON
+           OSStatus err;
+
            /* This is needed to send mouse events like aqua window
               buttons to the correct handler.  */
-           if (SendEventToEventTarget (eventRef, toolbox_dispatcher)
-               != eventNotHandledErr)
+           read_socket_inev = &inev;
+           err = SendEventToEventTarget (eventRef, toolbox_dispatcher);
+           read_socket_inev = NULL;
+           if (err != eventNotHandledErr)
              break;
 #endif
            last_mouse_glyph_frame = 0;
@@ -10830,17 +11864,20 @@ XTread_socket (sd, expected, hold_quit)
                else
                  {
                    ControlPartCode control_part_code;
-                   ControlHandle ch;
-                   Point mouse_loc = er.where;
+                   ControlRef ch;
+                   Point mouse_loc;
 #ifdef MAC_OSX
                    ControlKind control_kind;
 #endif
 
                    f = mac_window_to_frame (window_ptr);
                    /* convert to local coordinates of new window */
-                   SetPortWindowPort (window_ptr);
-
-                   GlobalToLocal (&mouse_loc);
+                   mouse_loc.h = (er.where.h
+                                  - (f->left_pos
+                                     + FRAME_OUTER_TO_INNER_DIFF_X (f)));
+                   mouse_loc.v = (er.where.v
+                                  - (f->top_pos
+                                     + FRAME_OUTER_TO_INNER_DIFF_Y (f)));
 #if TARGET_API_MAC_CARBON
                    ch = FindControlUnderMouse (mouse_loc, window_ptr,
                                                &control_part_code);
@@ -10853,7 +11890,7 @@ XTread_socket (sd, expected, hold_quit)
                                                     &ch);
 #endif
 
-#if USE_CARBON_EVENTS
+#if TARGET_API_MAC_CARBON
                    inev.code = mac_get_mouse_btn (eventRef);
                    inev.modifiers = mac_event_to_emacs_modifiers (eventRef);
 #else
@@ -10989,16 +12026,14 @@ XTread_socket (sd, expected, hold_quit)
                DragWindow (window_ptr, er.where, NULL);
 #else /* not TARGET_API_MAC_CARBON */
                DragWindow (window_ptr, er.where, &qd.screenBits.bounds);
-#endif /* not TARGET_API_MAC_CARBON */
                /* Update the frame parameters.  */
-#if !USE_CARBON_EVENTS
                {
                  struct frame *f = mac_window_to_frame (window_ptr);
 
                  if (f && !f->async_iconified)
                    mac_handle_origin_change (f);
                }
-#endif
+#endif /* not TARGET_API_MAC_CARBON */
                break;
 
              case inGoAway:
@@ -11022,41 +12057,38 @@ XTread_socket (sd, expected, hold_quit)
                  do_zoom_window (window_ptr, part_code);
                break;
 
+#if USE_MAC_TOOLBAR
+             case inStructure:
+               {
+                 OSStatus err;
+                 HIViewRef ch;
+
+                 err = HIViewGetViewForMouseEvent (HIViewGetRoot (window_ptr),
+                                                   eventRef, &ch);
+                 /* This doesn't work on Mac OS X 10.2.  */
+                 if (err == noErr)
+                   HIViewClick (ch, eventRef);
+               }
+               break;
+#endif /* USE_MAC_TOOLBAR */
+
              default:
                break;
              }
          }
          break;
 
+#if !TARGET_API_MAC_CARBON
        case updateEvt:
-#if USE_CARBON_EVENTS
-         if (SendEventToEventTarget (eventRef, toolbox_dispatcher)
-             != eventNotHandledErr)
-           break;
-#else
-         do_window_update ((WindowPtr) er.message);
-#endif
+         do_window_update ((WindowRef) er.message);
          break;
+#endif
 
        case osEvt:
-#if USE_CARBON_EVENTS
-         if (SendEventToEventTarget (eventRef, toolbox_dispatcher)
-             != eventNotHandledErr)
-           break;
-#endif
          switch ((er.message >> 24) & 0x000000FF)
            {
-           case suspendResumeMessage:
-#if USE_MAC_TSM
-             if (er.message & resumeFlag)
-               mac_tsm_resume ();
-             else
-               mac_tsm_suspend ();
-#endif
-             break;
-
            case mouseMovedMessage:
-#if !USE_CARBON_EVENTS
+#if !TARGET_API_MAC_CARBON
              SetRectRgn (mouse_region, er.where.h, er.where.v,
                          er.where.h + 1, er.where.v + 1);
 #endif
@@ -11077,13 +12109,15 @@ XTread_socket (sd, expected, hold_quit)
 
              if (f)
                {
-                 WindowPtr wp = FRAME_MAC_WINDOW (f);
-                 Point mouse_pos = er.where;
-
-                 SetPortWindowPort (wp);
-
-                 GlobalToLocal (&mouse_pos);
-
+                 WindowRef wp = FRAME_MAC_WINDOW (f);
+                 Point mouse_pos;
+
+                 mouse_pos.h = (er.where.h
+                                - (f->left_pos
+                                   + FRAME_OUTER_TO_INNER_DIFF_X (f)));
+                 mouse_pos.v = (er.where.v
+                                - (f->top_pos
+                                   + FRAME_OUTER_TO_INNER_DIFF_Y (f)));
                  if (dpyinfo->grabbed && tracked_scroll_bar)
 #ifdef USE_TOOLKIT_SCROLL_BARS
                    x_scroll_bar_handle_drag (wp, tracked_scroll_bar,
@@ -11122,6 +12156,10 @@ XTread_socket (sd, expected, hold_quit)
                        }
                      if (!note_mouse_movement (f, &mouse_pos))
                        help_echo_string = previous_help_echo_string;
+#if USE_MAC_TOOLBAR
+                     else
+                       mac_tool_bar_note_mouse_movement (f, eventRef);
+#endif
                    }
                }
 
@@ -11131,18 +12169,18 @@ XTread_socket (sd, expected, hold_quit)
              if (!NILP (help_echo_string) || !NILP (previous_help_echo_string))
                do_help = 1;
              break;
+
+           default:
+             goto OTHER;
            }
          break;
 
        case activateEvt:
          {
-           WindowPtr window_ptr = (WindowPtr) er.message;
+           WindowRef window_ptr = (WindowRef) er.message;
+           OSErr err;
+           ControlRef root_control;
 
-#if USE_CARBON_EVENTS
-           if (SendEventToEventTarget (eventRef, toolbox_dispatcher)
-               != eventNotHandledErr)
-             break;
-#endif
            if (window_ptr == tip_window)
              {
                HideWindow (tip_window);
@@ -11150,25 +12188,38 @@ XTread_socket (sd, expected, hold_quit)
              }
 
            if (!is_emacs_window (window_ptr))
-             break;
+             goto OTHER;
+
+           f = mac_window_to_frame (window_ptr);
 
            if ((er.modifiers & activeFlag) != 0)
              {
                /* A window has been activated */
-               Point mouse_loc = er.where;
+               Point mouse_loc;
+
+               err = GetRootControl (FRAME_MAC_WINDOW (f), &root_control);
+               if (err == noErr)
+                 ActivateControl (root_control);
 
                x_detect_focus_change (dpyinfo, &er, &inev);
 
-               SetPortWindowPort (window_ptr);
-               GlobalToLocal (&mouse_loc);
+               mouse_loc.h = (er.where.h
+                              - (f->left_pos
+                                 + FRAME_OUTER_TO_INNER_DIFF_X (f)));
+               mouse_loc.v = (er.where.v
+                              - (f->top_pos
+                                 + FRAME_OUTER_TO_INNER_DIFF_Y (f)));
                /* Window-activated event counts as mouse movement,
                   so update things that depend on mouse position.  */
-               note_mouse_movement (mac_window_to_frame (window_ptr),
-                                    &mouse_loc);
+               note_mouse_movement (f, &mouse_loc);
              }
            else
              {
                /* A window has been deactivated */
+               err = GetRootControl (FRAME_MAC_WINDOW (f), &root_control);
+               if (err == noErr)
+                 DeactivateControl (root_control);
+
 #ifdef USE_TOOLKIT_SCROLL_BARS
                if (dpyinfo->grabbed && tracked_scroll_bar)
                  {
@@ -11189,7 +12240,6 @@ XTread_socket (sd, expected, hold_quit)
 
                x_detect_focus_change (dpyinfo, &er, &inev);
 
-               f = mac_window_to_frame (window_ptr);
                if (f == dpyinfo->mouse_face_mouse_frame)
                  {
                    /* If we move outside the frame, then we're
@@ -11212,217 +12262,41 @@ XTread_socket (sd, expected, hold_quit)
        case keyDown:
        case keyUp:
        case autoKey:
+         ObscureCursor ();
+
+         f = mac_focus_frame (dpyinfo);
+         XSETFRAME (inev.frame_or_window, f);
+
+         /* If mouse-highlight is an integer, input clears out mouse
+            highlighting.  */
+         if (!dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)
+             && !EQ (f->tool_bar_window, dpyinfo->mouse_face_window))
+           {
+             clear_mouse_face (dpyinfo);
+             dpyinfo->mouse_face_hidden = 1;
+           }
+
          {
-           int keycode = (er.message & keyCodeMask) >> 8;
-           static SInt16 last_key_script = -1;
-           SInt16 current_key_script;
            UInt32 modifiers = er.modifiers, mapped_modifiers;
 
-#if USE_CARBON_EVENTS && defined (MAC_OSX)
+#ifdef MAC_OSX
            GetEventParameter (eventRef, kEventParamKeyModifiers,
                               typeUInt32, NULL,
                               sizeof (UInt32), NULL, &modifiers);
 #endif
            mapped_modifiers = mac_mapped_modifiers (modifiers);
 
-#if USE_CARBON_EVENTS && (defined (MAC_OSX) || USE_MAC_TSM)
-           /* When using Carbon Events, we need to pass raw keyboard
-              events to the TSM ourselves.  If TSM handles it, it
-              will pass back noErr, otherwise it will pass back
-              "eventNotHandledErr" and we can process it
-              normally.  */
+#if TARGET_API_MAC_CARBON
            if (!(mapped_modifiers
                  & ~(mac_pass_command_to_system ? cmdKey : 0)
                  & ~(mac_pass_control_to_system ? controlKey : 0)))
-             {
-               OSStatus err;
-
-               read_socket_inev = &inev;
-               err = SendEventToEventTarget (eventRef, toolbox_dispatcher);
-               read_socket_inev = NULL;
-               if (err != eventNotHandledErr)
-                 break;
-             }
-#endif
-           if (er.what == keyUp)
-             break;
-
-           ObscureCursor ();
-
-           f = mac_focus_frame (dpyinfo);
-
-           if (!dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)
-               && !EQ (f->tool_bar_window, dpyinfo->mouse_face_window))
-             {
-               clear_mouse_face (dpyinfo);
-               dpyinfo->mouse_face_hidden = 1;
-             }
-
-           current_key_script = GetScriptManagerVariable (smKeyScript);
-           if (last_key_script != current_key_script)
-             {
-               struct input_event event;
-
-               EVENT_INIT (event);
-               event.kind = LANGUAGE_CHANGE_EVENT;
-               event.arg = Qnil;
-               event.code = current_key_script;
-               event.timestamp = timestamp;
-               kbd_buffer_store_event (&event);
-               count++;
-               last_key_script = current_key_script;
-             }
-
-#if USE_MAC_TSM
-           if (inev.kind != NO_EVENT)
-             break;
-#endif
-
-#ifdef MAC_OSX
-           if (mapped_modifiers & kEventKeyModifierFnMask
-               && keycode <= 0x7f
-               && fn_keycode_to_keycode_table[keycode])
-             keycode = fn_keycode_to_keycode_table[keycode];
-#endif
-           if (keycode <= 0x7f && keycode_to_xkeysym_table [keycode])
-             {
-               inev.kind = NON_ASCII_KEYSTROKE_EVENT;
-               inev.code = 0xff00 | keycode_to_xkeysym_table [keycode];
-#ifdef MAC_OSX
-               if (modifiers & kEventKeyModifierFnMask
-                   && keycode <= 0x7f
-                   && fn_keycode_to_keycode_table[keycode] == keycode)
-                 modifiers &= ~kEventKeyModifierFnMask;
-#endif
-             }
-           else if (mapped_modifiers)
-             {
-               /* translate the keycode back to determine the
-                  original key */
-#ifdef MAC_OSX
-               UCKeyboardLayout *uchr_ptr = NULL;
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
-               OSStatus err;
-               KeyboardLayoutRef layout;
-
-               err = KLGetCurrentKeyboardLayout (&layout);
-               if (err == noErr)
-                 KLGetKeyboardLayoutProperty (layout, kKLuchrData,
-                                              (const void **) &uchr_ptr);
-#else
-               static SInt16 last_key_layout_id = 0;
-               static Handle uchr_handle = (Handle)-1;
-               SInt16 current_key_layout_id =
-                 GetScriptVariable (current_key_script, smScriptKeys);
-
-               if (uchr_handle == (Handle)-1
-                   || last_key_layout_id != current_key_layout_id)
-                 {
-                   uchr_handle = GetResource ('uchr', current_key_layout_id);
-                   last_key_layout_id = current_key_layout_id;
-                 }
-               if (uchr_handle)
-                 uchr_ptr = (UCKeyboardLayout *)*uchr_handle;
-#endif
-
-               if (uchr_ptr)
-                 {
-                   OSStatus status;
-                   UInt16 key_action = er.what - keyDown;
-                   UInt32 modifier_key_state =
-                     (modifiers & ~mapped_modifiers) >> 8;
-                   UInt32 keyboard_type = LMGetKbdType ();
-                   SInt32 dead_key_state = 0;
-                   UniChar code;
-                   UniCharCount actual_length;
-
-                   status = UCKeyTranslate (uchr_ptr,
-                                            keycode, key_action,
-                                            modifier_key_state,
-                                            keyboard_type,
-                                            kUCKeyTranslateNoDeadKeysMask,
-                                            &dead_key_state,
-                                            1, &actual_length, &code);
-                   if (status == noErr && actual_length == 1)
-                     mac_set_unicode_keystroke_event (code, &inev);
-                 }
-#endif /* MAC_OSX */
-
-               if (inev.kind == NO_EVENT)
-                 {
-                   /* This code comes from Keyboard Resource,
-                      Appendix C of IM - Text.  This is necessary
-                      since shift is ignored in KCHR table
-                      translation when option or command is pressed.
-                      It also does not translate correctly
-                      control-shift chars like C-% so mask off shift
-                      here also.  */
-                   /* Mask off modifier keys that are mapped to some
-                      Emacs modifiers.  */
-                   int new_modifiers = er.modifiers & ~mapped_modifiers;
-                   /* set high byte of keycode to modifier high byte*/
-                   int new_keycode = keycode | new_modifiers;
-                   Ptr kchr_ptr = (Ptr) GetScriptManagerVariable (smKCHRCache);
-                   unsigned long some_state = 0;
-                   UInt32 new_char_code;
-
-                   new_char_code = KeyTranslate (kchr_ptr, new_keycode,
-                                                 &some_state);
-                   if (new_char_code == 0)
-                     /* Seems like a dead key.  Append up-stroke.  */
-                     new_char_code = KeyTranslate (kchr_ptr,
-                                                   new_keycode | 0x80,
-                                                   &some_state);
-                   if (new_char_code)
-                     {
-                       inev.kind = ASCII_KEYSTROKE_EVENT;
-                       inev.code = new_char_code & 0xff;
-                     }
-                 }
-             }
-
-           if (inev.kind == NO_EVENT)
-             {
-               inev.kind = ASCII_KEYSTROKE_EVENT;
-               inev.code = er.message & charCodeMask;
-             }
-
-           inev.modifiers = mac_to_emacs_modifiers (modifiers);
-           inev.modifiers |= (extra_keyboard_modifiers
-                              & (meta_modifier | alt_modifier
-                                 | hyper_modifier | super_modifier));
-           XSETFRAME (inev.frame_or_window, f);
-
-#if TARGET_API_MAC_CARBON
-           if (inev.kind == ASCII_KEYSTROKE_EVENT
-               && inev.code >= 0x80 && inev.modifiers)
-             {
-               OSStatus err;
-               TextEncoding encoding = kTextEncodingMacRoman;
-               TextToUnicodeInfo ttu_info;
-
-               UpgradeScriptInfoToTextEncoding (current_key_script,
-                                                kTextLanguageDontCare,
-                                                kTextRegionDontCare,
-                                                NULL, &encoding);
-               err = CreateTextToUnicodeInfoByEncoding (encoding, &ttu_info);
-               if (err == noErr)
-                 {
-                   UniChar code;
-                   Str255 pstr;
-                   ByteCount unicode_len;
-
-                   pstr[0] = 1;
-                   pstr[1] = inev.code;
-                   err = ConvertFromPStringToUnicode (ttu_info, pstr,
-                                                      sizeof (UniChar),
-                                                      &unicode_len, &code);
-                   if (err == noErr && unicode_len == sizeof (UniChar))
-                     mac_set_unicode_keystroke_event (code, &inev);
-                   DisposeTextToUnicodeInfo (&ttu_info);
-                 }
-             }
+             goto OTHER;
+           else
 #endif
+             if (er.what != keyUp)
+               do_keystroke (er.what, er.message & charCodeMask,
+                             (er.message & keyCodeMask) >> 8,
+                             modifiers, timestamp, &inev);
          }
          break;
 
@@ -11431,9 +12305,19 @@ XTread_socket (sd, expected, hold_quit)
          break;
 
        default:
+       OTHER:
+#if TARGET_API_MAC_CARBON
+         {
+           OSStatus err;
+
+           read_socket_inev = &inev;
+           err = SendEventToEventTarget (eventRef, toolbox_dispatcher);
+           read_socket_inev = NULL;
+         }
+#endif
          break;
        }
-#if USE_CARBON_EVENTS
+#if TARGET_API_MAC_CARBON
       ReleaseEvent (eventRef);
 #endif
 
@@ -11467,7 +12351,6 @@ XTread_socket (sd, expected, hold_quit)
            }
          count++;
        }
-
     }
 
   /* If the focus was just given to an autoraising frame,
@@ -11485,7 +12368,7 @@ XTread_socket (sd, expected, hold_quit)
       mac_screen_config_changed = 0;
     }
 
-#if !USE_CARBON_EVENTS
+#if !TARGET_API_MAC_CARBON
   /* Check which frames are still visible.  We do this here because
      there doesn't seem to be any direct notification from the Window
      Manager that the visibility of a window has changed (at least,
@@ -11590,7 +12473,7 @@ make_mac_terminal_frame (struct frame *f)
 
   if (!(FRAME_MAC_WINDOW (f) =
        NewCWindow (NULL, &r, "\p", true, dBoxProc,
-                   (WindowPtr) -1, 1, (long) f->output_data.mac)))
+                   (WindowRef) -1, 1, (long) f->output_data.mac)))
     abort ();
   /* so that update events can find this mac_output struct */
   f->output_data.mac->mFP = f;  /* point back to emacs frame */
@@ -11780,7 +12663,6 @@ init_menu_bar ()
                                     &menu, &menu_index);
   if (err == noErr)
     SetMenuItemCommandKey (menu, menu_index, false, 0);
-#if USE_CARBON_EVENTS
   EnableMenuCommand (NULL, kHICommandPreferences);
   err = GetIndMenuItemWithCommandID (NULL, kHICommandPreferences, 1,
                                     &menu, &menu_index);
@@ -11792,10 +12674,9 @@ init_menu_bar ()
       InsertMenuItemTextWithCFString (menu, CFSTR ("About Emacs"),
                                      0, 0, kHICommandAbout);
     }
-#endif /* USE_CARBON_EVENTS */
 #else  /* !MAC_OSX */
-#if USE_CARBON_EVENTS
-  SetMenuItemCommandID (GetMenuHandle (M_APPLE), I_ABOUT, kHICommandAbout);
+#if TARGET_API_MAC_CARBON
+  SetMenuItemCommandID (GetMenuRef (M_APPLE), I_ABOUT, kHICommandAbout);
 #endif
 #endif
 }
@@ -11902,19 +12783,13 @@ mac_initialize ()
 
 #if TARGET_API_MAC_CARBON
 
-#if USE_CARBON_EVENTS
-#ifdef MAC_OSX
-  init_service_handler ();
-#endif /* MAC_OSX */
-
-  init_command_handler ();
+  install_application_handler ();
 
   init_menu_bar ();
 
 #if USE_MAC_TSM
   init_tsm ();
 #endif
-#endif /* USE_CARBON_EVENTS */
 
 #ifdef MAC_OSX
   init_coercion_handler ();
@@ -11964,7 +12839,7 @@ syms_of_macterm ()
   Fput (Qhyper,   Qmodifier_value, make_number (hyper_modifier));
   Fput (Qsuper,   Qmodifier_value, make_number (super_modifier));
 
-#if USE_CARBON_EVENTS
+#if TARGET_API_MAC_CARBON
   Qhi_command   = intern ("hi-command");    staticpro (&Qhi_command);
 #ifdef MAC_OSX
   Qtoolbar_switch_mode = intern ("toolbar-switch-mode");
@@ -12089,7 +12964,7 @@ The symbol `reverse' means that the option-key will register for
 mouse-3 and the command-key will register for mouse-2.  */);
   Vmac_emulate_three_button_mouse = Qnil;
 
-#if USE_CARBON_EVENTS
+#if TARGET_API_MAC_CARBON
   DEFVAR_BOOL ("mac-wheel-button-is-mouse-2", &mac_wheel_button_is_mouse_2,
     doc: /* *Non-nil if the wheel button is mouse-2 and the right click mouse-3.
 Otherwise, the right click will be treated as mouse-2 and the wheel
index 6a68f39..8a85e71 100644 (file)
@@ -333,6 +333,16 @@ struct mac_output
   /* Hints for the size and the position of a window.  */
   XSizeHints *size_hints;
 
+#if USE_MAC_TOOLBAR
+  /* This variable records the gravity value of the window position if
+     the window has an external tool bar when it is created.  The
+     position of the window is adjusted using this information when
+     the tool bar is first redisplayed.  Once the tool bar is
+     redisplayed, it is set to 0 in order to avoid further
+     adjustment.  */
+  int toolbar_win_gravity;
+#endif
+
 #if USE_CG_DRAWING
   /* Quartz 2D graphics context.  */
   CGContextRef cg_context;
@@ -369,6 +379,12 @@ typedef struct mac_output mac_output;
 /* This is the 'font_info *' which frame F has.  */
 #define FRAME_MAC_FONT_TABLE(f) (FRAME_MAC_DISPLAY_INFO (f)->font_table)
 
+/* The difference in pixels between the top left corner of the
+   Emacs window (including possible window manager decorations)
+   and FRAME_MAC_WINDOW (f).  */
+#define FRAME_OUTER_TO_INNER_DIFF_X(f) ((f)->x_pixels_diff)
+#define FRAME_OUTER_TO_INNER_DIFF_Y(f) ((f)->y_pixels_diff)
+
 /* Value is the smallest width of any character in any font on frame F.  */
 
 #define FRAME_SMALLEST_CHAR_WIDTH(F) \
@@ -406,9 +422,9 @@ struct scroll_bar {
   /* The next and previous in the chain of scroll bars in this frame.  */
   Lisp_Object next, prev;
 
-  /* The Mac control handle of this scroll bar.  Since this is a
+  /* The Mac control reference of this scroll bar.  Since this is a
      pointer value, we store it split into two Lisp integers.  */
-  Lisp_Object control_handle_low, control_handle_high;
+  Lisp_Object control_ref_low, control_ref_high;
 
   /* The position and size of the scroll bar in pixels, relative to the
      frame.  */
@@ -435,6 +451,12 @@ struct scroll_bar {
      being dragged, this is Qnil.  */
   Lisp_Object dragging;
 
+#ifdef MAC_OSX
+  /* t if the background of the fringe that is adjacent to a scroll
+     bar is extended to the gap between the fringe and the bar.  */
+  Lisp_Object fringe_extended_p;
+#endif
+
 #ifdef USE_TOOLKIT_SCROLL_BARS
   /* The position and size of the scroll bar handle track area in
      pixels, relative to the frame.  */
@@ -466,14 +488,14 @@ struct scroll_bar {
 
 /* Extract the Mac control handle of the scroll bar from a struct
    scroll_bar.  */
-#define SCROLL_BAR_CONTROL_HANDLE(ptr) \
-  ((ControlHandle) SCROLL_BAR_PACK ((ptr)->control_handle_low, \
-                                    (ptr)->control_handle_high))
+#define SCROLL_BAR_CONTROL_REF(ptr)                            \
+  ((ControlRef) SCROLL_BAR_PACK ((ptr)->control_ref_low,       \
+                                (ptr)->control_ref_high))
 
 /* Store a Mac control handle in a struct scroll_bar.  */
-#define SET_SCROLL_BAR_CONTROL_HANDLE(ptr, handle) \
-  (SCROLL_BAR_UNPACK ((ptr)->control_handle_low, \
-                      (ptr)->control_handle_high, (unsigned long) (handle)))
+#define SET_SCROLL_BAR_CONTROL_REF(ptr, ref)                           \
+  (SCROLL_BAR_UNPACK ((ptr)->control_ref_low,                          \
+                      (ptr)->control_ref_high, (unsigned long) (ref)))
 
 /* Return the inside width of a vertical scroll bar, given the outside
    width.  */
@@ -615,9 +637,9 @@ extern void x_destroy_window P_ ((struct frame *));
 extern void x_wm_set_size_hint P_ ((struct frame *, long, int));
 extern void x_delete_display P_ ((struct x_display_info *));
 extern void mac_initialize P_ ((void));
-extern Pixmap XCreatePixmap P_ ((Display *, WindowPtr, unsigned int,
+extern Pixmap XCreatePixmap P_ ((Display *, WindowRef, unsigned int,
                                 unsigned int, unsigned int));
-extern Pixmap XCreatePixmapFromBitmapData P_ ((Display *, WindowPtr, char *,
+extern Pixmap XCreatePixmapFromBitmapData P_ ((Display *, WindowRef, char *,
                                               unsigned int, unsigned int,
                                               unsigned long, unsigned long,
                                               unsigned int));
@@ -626,7 +648,7 @@ extern GC XCreateGC P_ ((Display *, void *, unsigned long, XGCValues *));
 extern void XFreeGC P_ ((Display *, GC));
 extern void XSetForeground P_ ((Display *, GC, unsigned long));
 extern void XSetBackground P_ ((Display *, GC, unsigned long));
-extern void XSetWindowBackground P_ ((Display *, WindowPtr, unsigned long));
+extern void XSetWindowBackground P_ ((Display *, WindowRef, unsigned long));
 extern void XDrawLine P_ ((Display *, Pixmap, GC, int, int, int, int));
 extern void mac_clear_area P_ ((struct frame *, int, int,
                                unsigned int, unsigned int));
@@ -634,8 +656,8 @@ extern void mac_unload_font P_ ((struct mac_display_info *, XFontStruct *));
 extern int mac_font_panel_visible_p P_ ((void));
 extern OSStatus mac_show_hide_font_panel P_ ((void));
 extern OSStatus mac_set_font_info_for_selection P_ ((struct frame *, int, int));
-extern OSStatus install_window_handler P_ ((WindowPtr));
-extern void remove_window_handler P_ ((WindowPtr));
+extern OSStatus install_window_handler P_ ((WindowRef));
+extern void remove_window_handler P_ ((WindowRef));
 extern OSStatus mac_post_mouse_moved_event P_ ((void));
 #if !TARGET_API_MAC_CARBON
 extern void do_apple_menu P_ ((SInt16));
@@ -643,7 +665,12 @@ extern void do_apple_menu P_ ((SInt16));
 #if USE_CG_DRAWING
 extern void mac_prepare_for_quickdraw P_ ((struct frame *));
 #endif
+extern void mac_get_window_bounds P_ ((struct frame *, Rect *, Rect *));
 extern int mac_quit_char_key_p P_ ((UInt32, UInt32));
+#if USE_MAC_TOOLBAR
+extern void update_frame_tool_bar P_ ((FRAME_PTR f));
+extern void free_frame_tool_bar P_ ((FRAME_PTR f));
+#endif
 
 #define FONT_TYPE_FOR_UNIBYTE(font, ch) 0
 #define FONT_TYPE_FOR_MULTIBYTE(font, ch) 0
index 0a1d737..9c21be3 100644 (file)
@@ -529,7 +529,7 @@ read_minibuf (map, initial, prompt, backup_n, expflag,
   GCPRO5 (map, initial, val, ambient_dir, input_method);
 
   if (!STRINGP (prompt))
-    prompt = empty_string;
+    prompt = empty_unibyte_string;
 
   if (!enable_recursive_minibuffers
       && minibuf_level > 0)
@@ -1717,9 +1717,15 @@ PREDICATE limits completion to a subset of COLLECTION.
 See `try-completion' and `all-completions' for more details
  on completion, COLLECTION, and PREDICATE.
 
-If REQUIRE-MATCH is non-nil, the user is not allowed to exit unless
- the input is (or completes to) an element of COLLECTION or is null.
- If it is also not t, typing RET does not exit if it does non-null completion.
+REQUIRE-MATCH can take the following values:
+- t means that the user is not allowed to exit unless
+  the input is (or completes to) an element of COLLECTION or is null.
+- nil means that the user can exit with any input.
+- `confirm-only' means that the user can exit with any input, but she will
+  need to confirm her choice if the input is not an element of COLLECTION.
+- anything else behaves like t except that typing RET does not exit if it
+  does non-null completion.
+
 If the input is null, `completing-read' returns DEF, or an empty string
  if DEF is nil, regardless of the value of REQUIRE-MATCH.
 
@@ -2230,6 +2236,18 @@ a repetition of this command will exit.  */)
       goto exit;
     }
 
+  if (EQ (Vminibuffer_completion_confirm, intern ("confirm-only")))
+    { /* The user is permitted to exit with an input that's rejected
+        by test-completion, but at the condition to confirm her choice.  */
+      if (EQ (current_kboard->Vlast_command, Vthis_command))
+       goto exit;
+      else
+       {
+         temp_echo_area_glyphs (build_string (" [Confirm]"));
+         return Qnil;
+       }
+    }
+
   /* Call do_completion, but ignore errors.  */
   SET_PT (ZV);
   val = internal_condition_case (complete_and_exit_1, Qerror,
index 97bcba3..4515b7a 100644 (file)
@@ -121,14 +121,6 @@ Boston, MA 02110-1301, USA.  */
 #include <sys/wait.h>
 #endif
 
-/* Disable IPv6 support for w32 until someone figures out how to do it
-   properly.  */
-#ifdef WINDOWSNT
-# ifdef AF_INET6
-#  undef AF_INET6
-# endif
-#endif
-
 #include "lisp.h"
 #include "systime.h"
 #include "systty.h"
@@ -328,14 +320,18 @@ extern int timers_run;
 
 static SELECT_TYPE input_wait_mask;
 
-/* Mask that excludes keyboard input descriptor (s).  */
+/* Mask that excludes keyboard input descriptor(s).  */
 
 static SELECT_TYPE non_keyboard_wait_mask;
 
-/* Mask that excludes process input descriptor (s).  */
+/* Mask that excludes process input descriptor(s).  */
 
 static SELECT_TYPE non_process_wait_mask;
 
+/* Mask for the gpm mouse input descriptor.  */
+
+static SELECT_TYPE gpm_wait_mask;
+
 #ifdef NON_BLOCKING_CONNECT
 /* Mask of bits indicating the descriptors that we wait for connect to
    complete on.  Once they complete, they are removed from this mask
@@ -357,6 +353,9 @@ static int max_process_desc;
 /* The largest descriptor currently in use for keyboard input.  */
 static int max_keyboard_desc;
 
+/* The largest descriptor currently in use for gpm mouse input.  */
+static int max_gpm_desc;
+
 /* Nonzero means delete a process right away if it exits.  */
 static int delete_exited_processes;
 
@@ -386,7 +385,7 @@ struct sockaddr_and_len {
   int len;
 } datagram_address[MAXDESC];
 #define DATAGRAM_CHAN_P(chan)  (datagram_address[chan].sa != 0)
-#define DATAGRAM_CONN_P(proc)  (PROCESSP (proc) && datagram_address[XINT (XPROCESS (proc)->infd)].sa != 0)
+#define DATAGRAM_CONN_P(proc)  (PROCESSP (proc) && datagram_address[XPROCESS (proc)->infd].sa != 0)
 #else
 #define DATAGRAM_CHAN_P(chan)  (0)
 #define DATAGRAM_CONN_P(proc)  (0)
@@ -621,19 +620,19 @@ make_process (name)
 
   p = allocate_process ();
 
-  XSETINT (p->infd, -1);
-  XSETINT (p->outfd, -1);
-  XSETFASTINT (p->tick, 0);
-  XSETFASTINT (p->update_tick, 0);
+  p->infd = -1;
+  p->outfd = -1;
+  p->tick = 0;
+  p->update_tick = 0;
   p->pid = 0;
   p->raw_status_new = 0;
   p->status = Qrun;
   p->mark = Fmake_marker ();
 
 #ifdef ADAPTIVE_READ_BUFFERING
-  p->adaptive_read_buffering = Qnil;
-  XSETFASTINT (p->read_output_delay, 0);
-  p->read_output_skip = Qnil;
+  p->adaptive_read_buffering = 0;
+  p->read_output_delay = 0;
+  p->read_output_skip = 0;
 #endif
 
   /* If name is already in use, modify it until it is unused.  */
@@ -672,8 +671,8 @@ setup_process_coding_systems (process)
      Lisp_Object process;
 {
   struct Lisp_Process *p = XPROCESS (process);
-  int inch = XINT (p->infd);
-  int outch = XINT (p->outfd);
+  int inch = p->infd;
+  int outch = p->outfd;
 
   if (inch < 0 || outch < 0)
     return;
@@ -685,7 +684,7 @@ setup_process_coding_systems (process)
                       proc_decode_coding_system[inch]);
   if (! NILP (p->filter))
     {
-      if (NILP (p->filter_multibyte))
+      if (!p->filter_multibyte)
        setup_raw_text_coding_system (proc_decode_coding_system[inch]);
     }
   else if (BUFFERP (p->buffer))
@@ -808,10 +807,10 @@ nil, indicating the current buffer's process.  */)
   if (NETCONN1_P (p))
     {
       p->status = Fcons (Qexit, Fcons (make_number (0), Qnil));
-      XSETINT (p->tick, ++process_tick);
+      p->tick = ++process_tick;
       status_notify (p);
     }
-  else if (XINT (p->infd) >= 0)
+  else if (p->infd >= 0)
     {
 #ifdef SIGCHLD
       Lisp_Object symbol;
@@ -839,7 +838,7 @@ nil, indicating the current buffer's process.  */)
          /* Do this now, since remove_process will make sigchld_handler do nothing.  */
          p->status
            = Fcons (Qsignal, Fcons (make_number (SIGKILL), Qnil));
-         XSETINT (p->tick, ++process_tick);
+         p->tick = ++process_tick;
          status_notify (p);
        }
     }
@@ -1031,18 +1030,18 @@ The string argument is normally a multibyte string, except:
      (debug)
      (set-process-filter process ...)  */
 
-  if (XINT (p->infd) >= 0)
+  if (p->infd >= 0)
     {
       if (EQ (filter, Qt) && !EQ (p->status, Qlisten))
        {
-         FD_CLR (XINT (p->infd), &input_wait_mask);
-         FD_CLR (XINT (p->infd), &non_keyboard_wait_mask);
+         FD_CLR (p->infd, &input_wait_mask);
+         FD_CLR (p->infd, &non_keyboard_wait_mask);
        }
       else if (EQ (p->filter, Qt)
               && !EQ (p->command, Qt)) /* Network process not stopped. */
        {
-         FD_SET (XINT (p->infd), &input_wait_mask);
-         FD_SET (XINT (p->infd), &non_keyboard_wait_mask);
+         FD_SET (p->infd, &input_wait_mask);
+         FD_SET (p->infd, &non_keyboard_wait_mask);
        }
     }
 
@@ -1104,8 +1103,8 @@ DEFUN ("set-process-window-size", Fset_process_window_size,
   CHECK_NATNUM (height);
   CHECK_NATNUM (width);
 
-  if (XINT (XPROCESS (process)->infd) < 0
-      || set_window_size (XINT (XPROCESS (process)->infd),
+  if (XPROCESS (process)->infd < 0
+      || set_window_size (XPROCESS (process)->infd,
                          XINT (height), XINT (width)) <= 0)
     return Qnil;
   else
@@ -1133,7 +1132,7 @@ for the process which will run.  */)
      register Lisp_Object process, flag;
 {
   CHECK_PROCESS (process);
-  XPROCESS (process)->inherit_coding_system_flag = flag;
+  XPROCESS (process)->inherit_coding_system_flag = !NILP (flag);
   return flag;
 }
 
@@ -1148,7 +1147,7 @@ the process output.  */)
      register Lisp_Object process;
 {
   CHECK_PROCESS (process);
-  return XPROCESS (process)->inherit_coding_system_flag;
+  return XPROCESS (process)->inherit_coding_system_flag ? Qt : Qnil;
 }
 
 DEFUN ("set-process-query-on-exit-flag",
@@ -1161,7 +1160,7 @@ exiting if PROCESS is running.  */)
      register Lisp_Object process, flag;
 {
   CHECK_PROCESS (process);
-  XPROCESS (process)->kill_without_query = Fnull (flag);
+  XPROCESS (process)->kill_without_query = NILP (flag);
   return flag;
 }
 
@@ -1173,7 +1172,7 @@ DEFUN ("process-query-on-exit-flag",
      register Lisp_Object process;
 {
   CHECK_PROCESS (process);
-  return Fnull (XPROCESS (process)->kill_without_query);
+  return (XPROCESS (process)->kill_without_query ? Qnil : Qt);
 }
 
 #ifdef DATAGRAM_SOCKETS
@@ -1348,7 +1347,7 @@ list_processes_1 (query_only)
       p = XPROCESS (proc);
       if (NILP (p->childp))
        continue;
-      if (!NILP (query_only) && !NILP (p->kill_without_query))
+      if (!NILP (query_only) && p->kill_without_query)
        continue;
       if (STRINGP (p->name)
          && ( i = SCHARS (p->name), (i > w_proc)))
@@ -1411,7 +1410,7 @@ list_processes_1 (query_only)
       p = XPROCESS (proc);
       if (NILP (p->childp))
        continue;
-      if (!NILP (query_only) && !NILP (p->kill_without_query))
+      if (!NILP (query_only) && p->kill_without_query)
        continue;
 
       Finsert (1, &p->name);
@@ -1487,7 +1486,7 @@ list_processes_1 (query_only)
          if (NILP (port))
            port = Fformat_network_address (Fplist_get (p->childp, QClocal), Qnil);
          sprintf (tembuf, "(network %s server on %s)\n",
-                  (DATAGRAM_CHAN_P (XINT (p->infd)) ? "datagram" : "stream"),
+                  (DATAGRAM_CHAN_P (p->infd) ? "datagram" : "stream"),
                   (STRINGP (port) ? (char *)SDATA (port) : "?"));
          insert_string (tembuf);
        }
@@ -1505,7 +1504,7 @@ list_processes_1 (query_only)
          if (NILP (host))
            host = Fformat_network_address (Fplist_get (p->childp, QCremote), Qnil);
          sprintf (tembuf, "(network %s connection to %s)\n",
-                  (DATAGRAM_CHAN_P (XINT (p->infd)) ? "datagram" : "stream"),
+                  (DATAGRAM_CHAN_P (p->infd) ? "datagram" : "stream"),
                   (STRINGP (host) ? (char *)SDATA (host) : "?"));
          insert_string (tembuf);
         }
@@ -1636,11 +1635,13 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS)  */)
   XPROCESS (proc)->sentinel = Qnil;
   XPROCESS (proc)->filter = Qnil;
   XPROCESS (proc)->filter_multibyte
-    = buffer_defaults.enable_multibyte_characters;
+    = !NILP (buffer_defaults.enable_multibyte_characters);
   XPROCESS (proc)->command = Flist (nargs - 2, args + 2);
 
 #ifdef ADAPTIVE_READ_BUFFERING
-  XPROCESS (proc)->adaptive_read_buffering = Vprocess_adaptive_read_buffering;
+  XPROCESS (proc)->adaptive_read_buffering
+    = (NILP (Vprocess_adaptive_read_buffering) ? 0
+       : EQ (Vprocess_adaptive_read_buffering, Qt) ? 1 : 2);
 #endif
 
   /* Make the process marker point into the process buffer (if any).  */
@@ -1771,13 +1772,11 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS)  */)
 #endif /* not VMS */
 
   XPROCESS (proc)->decoding_buf = make_uninit_string (0);
-  XPROCESS (proc)->decoding_carryover = make_number (0);
+  XPROCESS (proc)->decoding_carryover = 0;
   XPROCESS (proc)->encoding_buf = make_uninit_string (0);
-  XPROCESS (proc)->encoding_carryover = make_number (0);
 
   XPROCESS (proc)->inherit_coding_system_flag
-    = (NILP (buffer) || !inherit_process_coding_system
-       ? Qnil : Qt);
+    = !(NILP (buffer) || !inherit_process_coding_system);
 
   create_process (proc, (char **) new_argv, current_dir);
 
@@ -1949,15 +1948,15 @@ create_process (process, new_argv, current_dir)
   /* Record this as an active process, with its channels.
      As a result, child_setup will close Emacs's side of the pipes.  */
   chan_process[inchannel] = process;
-  XSETINT (XPROCESS (process)->infd, inchannel);
-  XSETINT (XPROCESS (process)->outfd, outchannel);
+  XPROCESS (process)->infd = inchannel;
+  XPROCESS (process)->outfd = outchannel;
 
   /* Previously we recorded the tty descriptor used in the subprocess.
      It was only used for getting the foreground tty process, so now
      we just reopen the device (see emacs_get_tty_pgrp) as this is
      more portable (see USG_SUBTTY_WORKS above).  */
 
-  XPROCESS (process)->pty_flag = (pty_flag ? Qt : Qnil);
+  XPROCESS (process)->pty_flag = pty_flag;
   XPROCESS (process)->status = Qrun;
   setup_process_coding_systems (process);
 
@@ -2474,7 +2473,7 @@ DEFUN ("process-datagram-address", Fprocess_datagram_address, Sprocess_datagram_
   if (!DATAGRAM_CONN_P (process))
     return Qnil;
 
-  channel = XINT (XPROCESS (process)->infd);
+  channel = XPROCESS (process)->infd;
   return conv_sockaddr_to_lisp (datagram_address[channel].sa,
                                datagram_address[channel].len);
 }
@@ -2494,7 +2493,7 @@ Returns nil upon error setting address, ADDRESS otherwise.  */)
   if (!DATAGRAM_CONN_P (process))
     return Qnil;
 
-  channel = XINT (XPROCESS (process)->infd);
+  channel = XPROCESS (process)->infd;
 
   len = get_lisp_to_sockaddr_size (address, &family);
   if (datagram_address[channel].len != len)
@@ -2659,7 +2658,7 @@ OPTION is not a supported option, return nil instead; otherwise return t.  */)
   if (!NETCONN1_P (p))
     error ("Process is not a network process");
 
-  s = XINT (p->infd);
+  s = p->infd;
   if (s < 0)
     error ("Process is not running");
 
@@ -3413,18 +3412,18 @@ usage: (make-network-process &rest ARGS)  */)
   p->buffer = buffer;
   p->sentinel = sentinel;
   p->filter = filter;
-  p->filter_multibyte = buffer_defaults.enable_multibyte_characters;
+  p->filter_multibyte = !NILP (buffer_defaults.enable_multibyte_characters);
   /* Override the above only if :filter-multibyte is specified.  */
   if (! NILP (Fplist_member (contact, QCfilter_multibyte)))
-    p->filter_multibyte = Fplist_get (contact, QCfilter_multibyte);
+    p->filter_multibyte = !NILP (Fplist_get (contact, QCfilter_multibyte));
   p->log = Fplist_get (contact, QClog);
   if (tem = Fplist_get (contact, QCnoquery), !NILP (tem))
-    p->kill_without_query = Qt;
+    p->kill_without_query = 1;
   if ((tem = Fplist_get (contact, QCstop), !NILP (tem)))
     p->command = Qt;
   p->pid = 0;
-  XSETINT (p->infd, inch);
-  XSETINT (p->outfd, outch);
+  p->infd  = inch;
+  p->outfd = outch;
   if (is_server && socktype == SOCK_STREAM)
     p->status = Qlisten;
 
@@ -3545,13 +3544,11 @@ usage: (make-network-process &rest ARGS)  */)
   setup_process_coding_systems (proc);
 
   p->decoding_buf = make_uninit_string (0);
-  p->decoding_carryover = make_number (0);
+  p->decoding_carryover = 0;
   p->encoding_buf = make_uninit_string (0);
-  p->encoding_carryover = make_number (0);
 
   p->inherit_coding_system_flag
-    = (!NILP (tem) || NILP (buffer) || !inherit_process_coding_system
-       ? Qnil : Qt);
+    = !(!NILP (tem) || NILP (buffer) || !inherit_process_coding_system);
 
   UNGCPRO;
   return proc;
@@ -3814,16 +3811,16 @@ deactivate_process (proc)
   register int inchannel, outchannel;
   register struct Lisp_Process *p = XPROCESS (proc);
 
-  inchannel = XINT (p->infd);
-  outchannel = XINT (p->outfd);
+  inchannel  = p->infd;
+  outchannel = p->outfd;
 
 #ifdef ADAPTIVE_READ_BUFFERING
-  if (XINT (p->read_output_delay) > 0)
+  if (p->read_output_delay > 0)
     {
       if (--process_output_delay_count < 0)
        process_output_delay_count = 0;
-      XSETINT (p->read_output_delay, 0);
-      p->read_output_skip = Qnil;
+      p->read_output_delay = 0;
+      p->read_output_skip = 0;
     }
 #endif
 
@@ -3845,8 +3842,8 @@ deactivate_process (proc)
        emacs_close (outchannel);
 #endif
 
-      XSETINT (p->infd, -1);
-      XSETINT (p->outfd, -1);
+      p->infd  = -1;
+      p->outfd = -1;
 #ifdef DATAGRAM_SOCKETS
       if (DATAGRAM_CHAN_P (inchannel))
        {
@@ -3894,8 +3891,8 @@ close_process_descs ()
       process = chan_process[i];
       if (!NILP (process))
        {
-         int in = XINT (XPROCESS (process)->infd);
-         int out = XINT (XPROCESS (process)->outfd);
+         int in  = XPROCESS (process)->infd;
+         int out = XPROCESS (process)->outfd;
          if (in >= 0)
            emacs_close (in);
          if (out >= 0 && in != out)
@@ -4139,8 +4136,8 @@ server_accept_connection (server, channel)
   p->filter = ps->filter;
   p->command = Qnil;
   p->pid = 0;
-  XSETINT (p->infd, s);
-  XSETINT (p->outfd, s);
+  p->infd  = s;
+  p->outfd = s;
   p->status = Qrun;
 
   /* Client processes for accepted connections are not stopped initially.  */
@@ -4163,12 +4160,11 @@ server_accept_connection (server, channel)
   setup_process_coding_systems (proc);
 
   p->decoding_buf = make_uninit_string (0);
-  p->decoding_carryover = make_number (0);
+  p->decoding_carryover = 0;
   p->encoding_buf = make_uninit_string (0);
-  p->encoding_carryover = make_number (0);
 
   p->inherit_coding_system_flag
-    = (NILP (buffer) ? Qnil : ps->inherit_coding_system_flag);
+    = (NILP (buffer) ? 0 : ps->inherit_coding_system_flag);
 
   if (!NILP (ps->log))
       call3 (ps->log, server, proc,
@@ -4293,7 +4289,7 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
 
   /* If wait_proc is a process to watch, set wait_channel accordingly.  */
   if (wait_proc != NULL)
-    wait_channel = XINT (wait_proc->infd);
+    wait_channel = wait_proc->infd;
 
   record_unwind_protect (wait_reading_process_output_unwind,
                         make_number (waiting_for_user_input_p));
@@ -4446,7 +4442,8 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
          IF_NON_BLOCKING_CONNECT (Ctemp = connect_wait_mask);
 
          EMACS_SET_SECS_USECS (timeout, 0, 0);
-         if ((select (max (max_process_desc, max_keyboard_desc) + 1,
+         if ((select (max (max (max_process_desc, max_keyboard_desc),
+                             max_gpm_desc) + 1,
                       &Atemp,
 #ifdef NON_BLOCKING_CONNECT
                       (num_pending_connects > 0 ? &Ctemp : (SELECT_TYPE *)0),
@@ -4477,9 +4474,9 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
          XSETPROCESS (proc, wait_proc);
 
          /* Read data from the process, until we exhaust it.  */
-         while (XINT (wait_proc->infd) >= 0)
+         while (wait_proc->infd >= 0)
            {
-             nread = read_process_output (proc, XINT (wait_proc->infd));
+             nread = read_process_output (proc, wait_proc->infd);
 
              if (nread == 0)
                break;
@@ -4509,9 +4506,9 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
 
       if (wait_proc && just_wait_proc)
        {
-         if (XINT (wait_proc->infd) < 0)  /* Terminated */
+         if (wait_proc->infd < 0)  /* Terminated */
            break;
-         FD_SET (XINT (wait_proc->infd), &Available);
+         FD_SET (wait_proc->infd, &Available);
          check_delay = 0;
          IF_NON_BLOCKING_CONNECT (check_connect = 0);
        }
@@ -4559,7 +4556,7 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
 
 #ifdef ADAPTIVE_READ_BUFFERING
          /* Set the timeout for adaptive read buffering if any
-            process has non-nil read_output_skip and non-zero
+            process has non-zero read_output_skip and non-zero
             read_output_delay, and we are not reading output for a
             specific wait_channel.  It is not executed if
             Vprocess_adaptive_read_buffering is nil.  */
@@ -4574,16 +4571,16 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
                  if (NILP (proc))
                    continue;
                  /* Find minimum non-zero read_output_delay among the
-                    processes with non-nil read_output_skip.  */
-                 if (XINT (XPROCESS (proc)->read_output_delay) > 0)
+                    processes with non-zero read_output_skip.  */
+                 if (XPROCESS (proc)->read_output_delay > 0)
                    {
                      check_delay--;
-                     if (NILP (XPROCESS (proc)->read_output_skip))
+                     if (!XPROCESS (proc)->read_output_skip)
                        continue;
                      FD_CLR (channel, &Available);
-                     XPROCESS (proc)->read_output_skip = Qnil;
-                     if (XINT (XPROCESS (proc)->read_output_delay) < usecs)
-                       usecs = XINT (XPROCESS (proc)->read_output_delay);
+                     XPROCESS (proc)->read_output_skip = 0;
+                     if (XPROCESS (proc)->read_output_delay < usecs)
+                       usecs = XPROCESS (proc)->read_output_delay;
                    }
                }
              EMACS_SET_SECS_USECS (timeout, 0, usecs);
@@ -4591,7 +4588,8 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
            }
 #endif
 
-         nfds = select (max (max_process_desc, max_keyboard_desc) + 1,
+         nfds = select (max (max (max_process_desc, max_keyboard_desc),
+                             max_gpm_desc) + 1,
                         &Available,
 #ifdef NON_BLOCKING_CONNECT
                         (check_connect ? &Connecting : (SELECT_TYPE *)0),
@@ -4855,7 +4853,7 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
              else
                {
                  /* Preserve status of processes already terminated.  */
-                 XSETINT (XPROCESS (proc)->tick, ++process_tick);
+                 XPROCESS (proc)->tick = ++process_tick;
                  deactivate_process (proc);
                  if (XPROCESS (proc)->raw_status_new)
                    update_status (XPROCESS (proc));
@@ -4907,7 +4905,7 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
 #endif
              if (xerrno)
                {
-                 XSETINT (p->tick, ++process_tick);
+                 p->tick = ++process_tick;
                  p->status = Fcons (Qfailed, Fcons (make_number (xerrno), Qnil));
                  deactivate_process (proc);
                }
@@ -4920,8 +4918,8 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
                  exec_sentinel (proc, build_string ("open\n"));
                  if (!EQ (p->filter, Qt) && !EQ (p->command, Qt))
                    {
-                     FD_SET (XINT (p->infd), &input_wait_mask);
-                     FD_SET (XINT (p->infd), &non_keyboard_wait_mask);
+                     FD_SET (p->infd, &input_wait_mask);
+                     FD_SET (p->infd, &non_keyboard_wait_mask);
                    }
                }
            }
@@ -4995,7 +4993,7 @@ read_process_output (proc, channel)
   register struct Lisp_Process *p = XPROCESS (proc);
   register int opoint;
   struct coding_system *coding = proc_decode_coding_system[channel];
-  int carryover = XINT (p->decoding_carryover);
+  int carryover = p->decoding_carryover;
   int readmax = 4096;
 
 #ifdef VMS
@@ -5048,9 +5046,9 @@ read_process_output (proc, channel)
     {
       nbytes = emacs_read (channel, chars + carryover, readmax);
 #ifdef ADAPTIVE_READ_BUFFERING
-      if (nbytes > 0 && !NILP (p->adaptive_read_buffering))
+      if (nbytes > 0 && p->adaptive_read_buffering)
        {
-         int delay = XINT (p->read_output_delay);
+         int delay = p->read_output_delay;
          if (nbytes < 256)
            {
              if (delay < READ_OUTPUT_DELAY_MAX_MAX)
@@ -5066,10 +5064,10 @@ read_process_output (proc, channel)
              if (delay == 0)
                process_output_delay_count--;
            }
-         XSETINT (p->read_output_delay, delay);
+         p->read_output_delay = delay;
          if (delay)
            {
-             p->read_output_skip = Qt;
+             p->read_output_skip = 1;
              process_output_skip = 1;
            }
        }
@@ -5087,7 +5085,7 @@ read_process_output (proc, channel)
     }
 #endif /* not VMS */
 
-  XSETINT (p->decoding_carryover, 0);
+  p->decoding_carryover = 0;
 
   /* At this point, NBYTES holds number of bytes just received
      (including the one in proc_buffered_char[channel]).  */
@@ -5161,14 +5159,14 @@ read_process_output (proc, channel)
             valid memory because p->outfd will be changed once EOF is
             sent to the process.  */
          if (NILP (p->encode_coding_system)
-             && proc_encode_coding_system[XINT (p->outfd)])
+             && proc_encode_coding_system[p->outfd])
            {
              p->encode_coding_system = coding->symbol;
              setup_coding_system (coding->symbol,
-                                  proc_encode_coding_system[XINT (p->outfd)]);
-             if (proc_encode_coding_system[XINT (p->outfd)]->eol_type
+                                  proc_encode_coding_system[p->outfd]);
+             if (proc_encode_coding_system[p->outfd]->eol_type
                  == CODING_EOL_UNDECIDED)
-               proc_encode_coding_system[XINT (p->outfd)]->eol_type
+               proc_encode_coding_system[p->outfd]->eol_type
                  = system_eol_type;
            }
        }
@@ -5181,9 +5179,9 @@ read_process_output (proc, channel)
        p->decoding_buf = make_uninit_string (carryover);
       bcopy (chars + coding->consumed, SDATA (p->decoding_buf),
             carryover);
-      XSETINT (p->decoding_carryover, carryover);
+      p->decoding_carryover = carryover;
       /* Adjust the multibyteness of TEXT to that of the filter.  */
-      if (NILP (p->filter_multibyte) != ! STRING_MULTIBYTE (text))
+      if (!p->filter_multibyte != !STRING_MULTIBYTE (text))
        text = (STRING_MULTIBYTE (text)
                ? Fstring_as_unibyte (text)
                : Fstring_to_multibyte (text));
@@ -5275,14 +5273,14 @@ read_process_output (proc, channel)
        {
          p->decode_coding_system = coding->symbol;
          if (NILP (p->encode_coding_system)
-             && proc_encode_coding_system[XINT (p->outfd)])
+             && proc_encode_coding_system[p->outfd])
            {
              p->encode_coding_system = coding->symbol;
              setup_coding_system (coding->symbol,
-                                  proc_encode_coding_system[XINT (p->outfd)]);
-             if (proc_encode_coding_system[XINT (p->outfd)]->eol_type
+                                  proc_encode_coding_system[p->outfd]);
+             if (proc_encode_coding_system[p->outfd]->eol_type
                  == CODING_EOL_UNDECIDED)
-               proc_encode_coding_system[XINT (p->outfd)]->eol_type
+               proc_encode_coding_system[p->outfd]->eol_type
                  = system_eol_type;
            }
        }
@@ -5294,7 +5292,7 @@ read_process_output (proc, channel)
        p->decoding_buf = make_uninit_string (carryover);
       bcopy (chars + coding->consumed, SDATA (p->decoding_buf),
             carryover);
-      XSETINT (p->decoding_carryover, carryover);
+      p->decoding_carryover = carryover;
 
       /* Adjust the multibyteness of TEXT to that of the buffer.  */
       if (NILP (current_buffer->enable_multibyte_characters)
@@ -5413,10 +5411,10 @@ send_process (proc, buf, len, object)
     update_status (p);
   if (! EQ (p->status, Qrun))
     error ("Process %s not running", SDATA (p->name));
-  if (XINT (p->outfd) < 0)
+  if (p->outfd < 0)
     error ("Output file descriptor of %s is closed", SDATA (p->name));
 
-  coding = proc_encode_coding_system[XINT (p->outfd)];
+  coding = proc_encode_coding_system[p->outfd];
   Vlast_coding_system_used = coding->symbol;
 
   if ((STRINGP (object) && STRING_MULTIBYTE (object))
@@ -5509,7 +5507,7 @@ send_process (proc, buf, len, object)
   if (pty_max_bytes == 0)
     {
 #if defined (HAVE_FPATHCONF) && defined (_PC_MAX_CANON)
-      pty_max_bytes = fpathconf (XFASTINT (p->outfd), _PC_MAX_CANON);
+      pty_max_bytes = fpathconf (p->outfd, _PC_MAX_CANON);
       if (pty_max_bytes < 0)
        pty_max_bytes = 250;
 #else
@@ -5531,7 +5529,7 @@ send_process (proc, buf, len, object)
 
          /* Decide how much data we can send in one batch.
             Long lines need to be split into multiple batches.  */
-         if (!NILP (p->pty_flag))
+         if (p->pty_flag)
            {
              /* Starting this at zero is always correct when not the first
                  iteration because the previous iteration ended by sending C-d.
@@ -5560,7 +5558,7 @@ send_process (proc, buf, len, object)
          /* Send this batch, using one or more write calls.  */
          while (this > 0)
            {
-             int outfd = XINT (p->outfd);
+             int outfd = p->outfd;
              old_sigpipe = (SIGTYPE (*) ()) signal (SIGPIPE, send_process_trap);
 #ifdef DATAGRAM_SOCKETS
              if (DATAGRAM_CHAN_P (outfd))
@@ -5580,12 +5578,12 @@ send_process (proc, buf, len, object)
                {
                  rv = emacs_write (outfd, (char *) buf, this);
 #ifdef ADAPTIVE_READ_BUFFERING
-                 if (XINT (p->read_output_delay) > 0
-                     && EQ (p->adaptive_read_buffering, Qt))
+                 if (p->read_output_delay > 0
+                     && p->adaptive_read_buffering == 1)
                    {
-                     XSETFASTINT (p->read_output_delay, 0);
+                     p->read_output_delay = 0;
                      process_output_delay_count--;
-                     p->read_output_skip = Qnil;
+                     p->read_output_skip = 0;
                    }
 #endif
                }
@@ -5628,7 +5626,7 @@ send_process (proc, buf, len, object)
                      if (errno == EAGAIN)
                        {
                          int flags = FWRITE;
-                         ioctl (XINT (p->outfd), TIOCFLUSH, &flags);
+                         ioctl (p->outfd, TIOCFLUSH, &flags);
                        }
 #endif /* BROKEN_PTY_READ_AFTER_EAGAIN */
 
@@ -5677,7 +5675,7 @@ send_process (proc, buf, len, object)
 #endif
       p->raw_status_new = 0;
       p->status = Fcons (Qexit, Fcons (make_number (256), Qnil));
-      XSETINT (p->tick, ++process_tick);
+      p->tick = ++process_tick;
       deactivate_process (proc);
 #ifdef VMS
       error ("Error writing to process %s; closed it", SDATA (p->name));
@@ -5729,10 +5727,10 @@ send_process_object (proc, start, end)
        update_status (p);
       if (! EQ (p->status, Qrun))
        error ("Process %s not running", SDATA (p->name));
-      if (XINT (p->outfd) < 0)
+      if (p->outfd < 0)
        error ("Output file descriptor of %s is closed", SDATA (p->name));
 
-      coding = proc_encode_coding_system[XINT (p->outfd)];
+      coding = proc_encode_coding_system[p->outfd];
       if (! EQ (coding->symbol, p->encode_coding_system))
        /* The coding system for encoding was changed to raw-text
           because we sent a unibyte text previously.  Now we are
@@ -5821,7 +5819,7 @@ emacs_get_tty_pgrp (p)
   int gid = -1;
 
 #ifdef TIOCGPGRP
-  if (ioctl (XINT (p->infd), TIOCGPGRP, &gid) == -1 && ! NILP (p->tty_name))
+  if (ioctl (p->infd, TIOCGPGRP, &gid) == -1 && ! NILP (p->tty_name))
     {
       int fd;
       /* Some OS:es (Solaris 8/9) does not allow TIOCGPGRP from the
@@ -5859,7 +5857,7 @@ return t unconditionally.  */)
   if (!EQ (p->childp, Qt))
     error ("Process %s is not a subprocess",
           SDATA (p->name));
-  if (XINT (p->infd) < 0)
+  if (p->infd < 0)
     error ("Process %s is not active",
           SDATA (p->name));
 
@@ -5902,11 +5900,11 @@ process_send_signal (process, signo, current_group, nomsg)
   if (!EQ (p->childp, Qt))
     error ("Process %s is not a subprocess",
           SDATA (p->name));
-  if (XINT (p->infd) < 0)
+  if (p->infd < 0)
     error ("Process %s is not active",
           SDATA (p->name));
 
-  if (NILP (p->pty_flag))
+  if (!p->pty_flag)
     current_group = Qnil;
 
   /* If we are using pgrps, get a pgrp number and make it negative.  */
@@ -5925,7 +5923,7 @@ process_send_signal (process, signo, current_group, nomsg)
       struct termios t;
       cc_t *sig_char = NULL;
 
-      tcgetattr (XINT (p->infd), &t);
+      tcgetattr (p->infd, &t);
 
       switch (signo)
        {
@@ -5965,16 +5963,16 @@ process_send_signal (process, signo, current_group, nomsg)
       switch (signo)
        {
        case SIGINT:
-         ioctl (XINT (p->infd), TIOCGETC, &c);
+         ioctl (p->infd, TIOCGETC, &c);
          send_process (proc, &c.t_intrc, 1, Qnil);
          return;
        case SIGQUIT:
-         ioctl (XINT (p->infd), TIOCGETC, &c);
+         ioctl (p->infd, TIOCGETC, &c);
          send_process (proc, &c.t_quitc, 1, Qnil);
          return;
 #ifdef SIGTSTP
        case SIGTSTP:
-         ioctl (XINT (p->infd), TIOCGLTC, &lc);
+         ioctl (p->infd, TIOCGLTC, &lc);
          send_process (proc, &lc.t_suspc, 1, Qnil);
          return;
 #endif /* ! defined (SIGTSTP) */
@@ -5989,16 +5987,16 @@ process_send_signal (process, signo, current_group, nomsg)
       switch (signo)
        {
        case SIGINT:
-         ioctl (XINT (p->infd), TCGETA, &t);
+         ioctl (p->infd, TCGETA, &t);
          send_process (proc, &t.c_cc[VINTR], 1, Qnil);
          return;
        case SIGQUIT:
-         ioctl (XINT (p->infd), TCGETA, &t);
+         ioctl (p->infd, TCGETA, &t);
          send_process (proc, &t.c_cc[VQUIT], 1, Qnil);
          return;
 #ifdef SIGTSTP
        case SIGTSTP:
-         ioctl (XINT (p->infd), TCGETA, &t);
+         ioctl (p->infd, TCGETA, &t);
          send_process (proc, &t.c_cc[VSWTCH], 1, Qnil);
          return;
 #endif /* ! defined (SIGTSTP) */
@@ -6056,7 +6054,7 @@ process_send_signal (process, signo, current_group, nomsg)
     case SIGCONT:
       p->raw_status_new = 0;
       p->status = Qrun;
-      XSETINT (p->tick, ++process_tick);
+      p->tick = ++process_tick;
       if (!nomsg)
        status_notify (NULL);
       break;
@@ -6076,7 +6074,7 @@ process_send_signal (process, signo, current_group, nomsg)
       sys$forcex (&(p->pid), 0, 1);
       whoosh:
 #endif
-      flush_pending_output (XINT (p->infd));
+      flush_pending_output (p->infd);
       break;
     }
 
@@ -6093,7 +6091,7 @@ process_send_signal (process, signo, current_group, nomsg)
 #ifdef TIOCSIGSEND
   if (!NILP (current_group))
     {
-      if (ioctl (XINT (p->infd), TIOCSIGSEND, signo) == -1)
+      if (ioctl (p->infd, TIOCSIGSEND, signo) == -1)
        EMACS_KILLPG (gid, signo);
     }
   else
@@ -6159,10 +6157,10 @@ If PROCESS is a network process, inhibit handling of incoming traffic.  */)
 
       p = XPROCESS (process);
       if (NILP (p->command)
-         && XINT (p->infd) >= 0)
+         && p->infd >= 0)
        {
-         FD_CLR (XINT (p->infd), &input_wait_mask);
-         FD_CLR (XINT (p->infd), &non_keyboard_wait_mask);
+         FD_CLR (p->infd, &input_wait_mask);
+         FD_CLR (p->infd, &non_keyboard_wait_mask);
        }
       p->command = Qt;
       return process;
@@ -6190,11 +6188,11 @@ If PROCESS is a network process, resume handling of incoming traffic.  */)
 
       p = XPROCESS (process);
       if (EQ (p->command, Qt)
-         && XINT (p->infd) >= 0
+         && p->infd >= 0
          && (!EQ (p->filter, Qt) || EQ (p->status, Qlisten)))
        {
-         FD_SET (XINT (p->infd), &input_wait_mask);
-         FD_SET (XINT (p->infd), &non_keyboard_wait_mask);
+         FD_SET (p->infd, &input_wait_mask);
+         FD_SET (p->infd, &non_keyboard_wait_mask);
        }
       p->command = Qnil;
       return process;
@@ -6391,7 +6389,7 @@ text to PROCESS after you call this function.  */)
     return process;
 
   proc = get_process (process);
-  coding = proc_encode_coding_system[XINT (XPROCESS (proc)->outfd)];
+  coding = proc_encode_coding_system[XPROCESS (proc)->outfd];
 
   /* Make sure the process is really alive.  */
   if (XPROCESS (proc)->raw_status_new)
@@ -6408,7 +6406,7 @@ text to PROCESS after you call this function.  */)
 #ifdef VMS
   send_process (proc, "\032", 1, Qnil);        /* ^z */
 #else
-  if (!NILP (XPROCESS (proc)->pty_flag))
+  if (XPROCESS (proc)->pty_flag)
     send_process (proc, "\004", 1, Qnil);
   else
     {
@@ -6420,18 +6418,18 @@ text to PROCESS after you call this function.  */)
         (In some old system, shutdown to socketpair doesn't work.
         Then we just can't win.)  */
       if (XPROCESS (proc)->pid == 0
-         || XINT (XPROCESS (proc)->outfd) == XINT (XPROCESS (proc)->infd))
-       shutdown (XINT (XPROCESS (proc)->outfd), 1);
+         || XPROCESS (proc)->outfd == XPROCESS (proc)->infd)
+       shutdown (XPROCESS (proc)->outfd, 1);
       /* In case of socketpair, outfd == infd, so don't close it.  */
-      if (XINT (XPROCESS (proc)->outfd) != XINT (XPROCESS (proc)->infd))
-       emacs_close (XINT (XPROCESS (proc)->outfd));
+      if (XPROCESS (proc)->outfd != XPROCESS (proc)->infd)
+       emacs_close (XPROCESS (proc)->outfd);
 #else /* not HAVE_SHUTDOWN */
-      emacs_close (XINT (XPROCESS (proc)->outfd));
+      emacs_close (XPROCESS (proc)->outfd);
 #endif /* not HAVE_SHUTDOWN */
       new_outfd = emacs_open (NULL_DEVICE, O_WRONLY, 0);
       if (new_outfd < 0)
        abort ();
-      old_outfd = XINT (XPROCESS (proc)->outfd);
+      old_outfd = XPROCESS (proc)->outfd;
 
       if (!proc_encode_coding_system[new_outfd])
        proc_encode_coding_system[new_outfd]
@@ -6442,7 +6440,7 @@ text to PROCESS after you call this function.  */)
       bzero (proc_encode_coding_system[old_outfd],
             sizeof (struct coding_system));
 
-      XSETINT (XPROCESS (proc)->outfd, new_outfd);
+      XPROCESS (proc)->outfd = new_outfd;
     }
 #endif /* VMS */
   return process;
@@ -6465,7 +6463,7 @@ kill_buffer_processes (buffer)
        {
          if (NETCONN_P (proc))
            Fdelete_process (proc);
-         else if (XINT (XPROCESS (proc)->infd) >= 0)
+         else if (XPROCESS (proc)->infd >= 0)
            process_send_signal (proc, SIGHUP, Qnil, 1);
        }
     }
@@ -6595,21 +6593,21 @@ sigchld_handler (signo)
          union { int i; WAITTYPE wt; } u;
          int clear_desc_flag = 0;
 
-         XSETINT (p->tick, ++process_tick);
+         p->tick = ++process_tick;
          u.wt = w;
          p->raw_status = u.i;
          p->raw_status_new = 1;
 
          /* If process has terminated, stop waiting for its output.  */
          if ((WIFSIGNALED (w) || WIFEXITED (w))
-             && XINT (p->infd) >= 0)
+             && p->infd >= 0)
            clear_desc_flag = 1;
 
          /* We use clear_desc_flag to avoid a compiler bug in Microsoft C.  */
          if (clear_desc_flag)
            {
-             FD_CLR (XINT (p->infd), &input_wait_mask);
-             FD_CLR (XINT (p->infd), &non_keyboard_wait_mask);
+             FD_CLR (p->infd, &input_wait_mask);
+             FD_CLR (p->infd, &non_keyboard_wait_mask);
            }
 
          /* Tell wait_reading_process_output that it needs to wake up and
@@ -6786,18 +6784,18 @@ status_notify (deleting_process)
       proc = Fcdr (Fcar (tail));
       p = XPROCESS (proc);
 
-      if (XINT (p->tick) != XINT (p->update_tick))
+      if (p->tick != p->update_tick)
        {
-         XSETINT (p->update_tick, XINT (p->tick));
+         p->update_tick = p->tick;
 
          /* If process is still active, read any output that remains.  */
          while (! EQ (p->filter, Qt)
                 && ! EQ (p->status, Qconnect)
                 && ! EQ (p->status, Qlisten)
                 && ! EQ (p->command, Qt)  /* Network process not stopped.  */
-                && XINT (p->infd) >= 0
+                && p->infd >= 0
                 && p != deleting_process
-                && read_process_output (proc, XINT (p->infd)) > 0);
+                && read_process_output (proc, p->infd) > 0);
 
          buffer = p->buffer;
 
@@ -6824,7 +6822,7 @@ status_notify (deleting_process)
             So set p->update_tick again
             so that an error in the sentinel will not cause
             this code to be run again.  */
-         XSETINT (p->update_tick, XINT (p->tick));
+         p->update_tick = p->tick;
          /* Now output the message suitably.  */
          if (!NILP (p->sentinel))
            exec_sentinel (proc, msg);
@@ -6897,9 +6895,9 @@ encode subprocess input.  */)
 
   CHECK_PROCESS (process);
   p = XPROCESS (process);
-  if (XINT (p->infd) < 0)
+  if (p->infd < 0)
     error ("Input file descriptor of %s closed", SDATA (p->name));
-  if (XINT (p->outfd) < 0)
+  if (p->outfd < 0)
     error ("Output file descriptor of %s closed", SDATA (p->name));
   Fcheck_coding_system (decoding);
   Fcheck_coding_system (encoding);
@@ -6936,7 +6934,7 @@ suppressed.  */)
 
   CHECK_PROCESS (process);
   p = XPROCESS (process);
-  p->filter_multibyte = flag;
+  p->filter_multibyte = !NILP (flag);
   setup_process_coding_systems (process);
 
   return Qnil;
@@ -6953,7 +6951,7 @@ DEFUN ("process-filter-multibyte-p", Fprocess_filter_multibyte_p,
   CHECK_PROCESS (process);
   p = XPROCESS (process);
 
-  return (NILP (p->filter_multibyte) ? Qnil : Qt);
+  return (p->filter_multibyte ? Qt : Qnil);
 }
 
 
@@ -6978,6 +6976,21 @@ add_keyboard_wait_descriptor (desc)
     max_keyboard_desc = desc;
 }
 
+static int add_gpm_wait_descriptor_called_flag;
+
+void
+add_gpm_wait_descriptor (desc)
+     int desc;
+{
+  if (! add_gpm_wait_descriptor_called_flag)
+    FD_CLR (0, &input_wait_mask);
+  add_gpm_wait_descriptor_called_flag = 1;
+  FD_SET (desc, &input_wait_mask);
+  FD_SET (desc, &gpm_wait_mask);
+  if (desc > max_gpm_desc)
+    max_gpm_desc = desc;
+}
+
 /* From now on, do not expect DESC to give keyboard input.  */
 
 void
@@ -6993,10 +7006,29 @@ delete_keyboard_wait_descriptor (desc)
   if (desc == max_keyboard_desc)
     for (fd = 0; fd < lim; fd++)
       if (FD_ISSET (fd, &input_wait_mask)
-         && !FD_ISSET (fd, &non_keyboard_wait_mask))
+         && !FD_ISSET (fd, &non_keyboard_wait_mask)
+         && !FD_ISSET (fd, &gpm_wait_mask))
        max_keyboard_desc = fd;
 }
 
+void
+delete_gpm_wait_descriptor (desc)
+     int desc;
+{
+  int fd;
+  int lim = max_gpm_desc;
+
+  FD_CLR (desc, &input_wait_mask);
+  FD_CLR (desc, &non_process_wait_mask);
+
+  if (desc == max_gpm_desc)
+    for (fd = 0; fd < lim; fd++)
+      if (FD_ISSET (fd, &input_wait_mask)
+         && !FD_ISSET (fd, &non_keyboard_wait_mask)
+         && !FD_ISSET (fd, &non_process_wait_mask))
+       max_gpm_desc = fd;
+}
+
 /* Return nonzero if *MASK has a bit set
    that corresponds to one of the keyboard input descriptors.  */
 
index 2502e61..eaed95f 100644 (file)
@@ -36,10 +36,6 @@ struct Lisp_Process
   {
     EMACS_INT size;
     struct Lisp_Vector *v_next;
-    /* Descriptor by which we read from this process */
-    Lisp_Object infd;
-    /* Descriptor by which we write to this process */
-    Lisp_Object outfd;
     /* Name of subprocess terminal.  */
     Lisp_Object tty_name;
     /* Name of this process */
@@ -64,61 +60,65 @@ struct Lisp_Process
     Lisp_Object plist;
     /* Marker set to end of last buffer-inserted output from this process */
     Lisp_Object mark;
-    /* Non-nil means kill silently if Emacs is exited.
-       This is the inverse of the `query-on-exit' flag.  */
-    Lisp_Object kill_without_query;
     /* Symbol indicating status of process.
        This may be a symbol: run, open, or closed.
        Or it may be a list, whose car is stop, exit or signal
        and whose cdr is a pair (EXIT_CODE . COREDUMP_FLAG)
        or (SIGNAL_NUMBER . COREDUMP_FLAG).  */
     Lisp_Object status;
-    /* Non-nil if communicating through a pty.  */
-    Lisp_Object pty_flag;
-    /* Event-count of last event in which this process changed status.  */
-    Lisp_Object tick;
-    /* Event-count of last such event reported.  */
-    Lisp_Object update_tick;
     /* Coding-system for decoding the input from this process.  */
     Lisp_Object decode_coding_system;
     /* Working buffer for decoding.  */
     Lisp_Object decoding_buf;
-    /* Size of carryover in decoding.  */
-    Lisp_Object decoding_carryover;
     /* Coding-system for encoding the output to this process.  */
     Lisp_Object encode_coding_system;
     /* Working buffer for encoding.  */
     Lisp_Object encoding_buf;
-    /* Size of carryover in encoding.  */
-    Lisp_Object encoding_carryover;
-    /* Flag to set coding-system of the process buffer from the
-       coding_system used to decode process output.  */
-    Lisp_Object inherit_coding_system_flag;
-    /* Flat to decide the multibyteness of a string given to the
-       filter (if any).  It is initialized to the value of
-       `default-enable-multibyte-characters' when the process is
-       generated, and can be changed by the function
-       `set-process-fileter-multibyte'. */
-    Lisp_Object filter_multibyte;
-    /* Should we delay reading output from this process.
-       Initialized from `Vprocess_adaptive_read_buffering'.  */
-    Lisp_Object adaptive_read_buffering;
-    /* Hysteresis to try to read process output in larger blocks.
-       On some systems, e.g. GNU/Linux, Emacs is seen as 
-       an interactive app also when reading process output, meaning
-       that process output can be read in as little as 1 byte at a
-       time.  Value is micro-seconds to delay reading output from
-       this process.  Range is 0 .. 50000.  */
-    Lisp_Object read_output_delay;
-    /* Skip reading this process on next read.  */
-    Lisp_Object read_output_skip;
 
     /* After this point, there are no Lisp_Objects any more.  */
+    /* alloc.c assumes that `pid' is the first such non-Lisp slot.  */
 
     /* Number of this process.
        allocate_process assumes this is the first non-Lisp_Object field.
        A value 0 is used for pseudo-processes such as network connections.  */
     pid_t pid;
+    /* Descriptor by which we read from this process */
+    int infd;
+    /* Descriptor by which we write to this process */
+    int outfd;
+    /* Event-count of last event in which this process changed status.  */
+    int tick;
+    /* Event-count of last such event reported.  */
+    int update_tick;
+    /* Size of carryover in decoding.  */
+    int decoding_carryover;
+    /* Hysteresis to try to read process output in larger blocks.
+       On some systems, e.g. GNU/Linux, Emacs is seen as
+       an interactive app also when reading process output, meaning
+       that process output can be read in as little as 1 byte at a
+       time.  Value is micro-seconds to delay reading output from
+       this process.  Range is 0 .. 50000.  */
+    int read_output_delay;
+    /* Should we delay reading output from this process.
+       Initialized from `Vprocess_adaptive_read_buffering'.
+       0 = nil, 1 = t, 2 = other.  */
+    int adaptive_read_buffering : 2;
+    /* Skip reading this process on next read.  */
+    int read_output_skip : 1;
+    /* Non-nil means kill silently if Emacs is exited.
+       This is the inverse of the `query-on-exit' flag.  */
+    int kill_without_query : 1;
+    /* Non-nil if communicating through a pty.  */
+    int pty_flag : 1;
+    /* Flag to set coding-system of the process buffer from the
+       coding_system used to decode process output.  */
+    int inherit_coding_system_flag : 1;
+    /* Flag to decide the multibyteness of a string given to the
+       filter (if any).  It is initialized to the value of
+       `default-enable-multibyte-characters' when the process is
+       generated, and can be changed by the function
+       `set-process-filter-multibyte'. */
+    int filter_multibyte : 1;
     /* Record the process status in the raw form in which it comes from `wait'.
        This is to avoid consing in a signal handler.  The `raw_status_new'
        flag indicates that `raw_status' contains a new status that still
index 49cb9b1..c645673 100644 (file)
@@ -43,7 +43,7 @@ Boston, MA 02110-1301, USA.  */
 #endif
 
 #ifndef BASE_PURESIZE
-#define BASE_PURESIZE (1120000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA)
+#define BASE_PURESIZE (1130000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA)
 #endif
 
 /* Increase BASE_PURESIZE by a ratio depending on the machine's word size.  */
index 6435133..66b84c9 100644 (file)
@@ -2483,11 +2483,6 @@ regex_compile (pattern, size, syntax, bufp)
      last -- ends with a forward jump of this sort.  */
   unsigned char *fixup_alt_jump = 0;
 
-  /* Counts open-groups as they are encountered.  Remembered for the
-     matching close-group on the compile stack, so the same register
-     number is put in the stop_memory as the start_memory.  */
-  regnum_t regnum = 0;
-
   /* Work area for range table of charset.  */
   struct range_table_work_area range_table_work;
 
@@ -3124,28 +3119,54 @@ regex_compile (pattern, size, syntax, bufp)
            handle_open:
              {
                int shy = 0;
+               regnum_t regnum = 0;
                if (p+1 < pend)
                  {
                    /* Look for a special (?...) construct */
                    if ((syntax & RE_SHY_GROUPS) && *p == '?')
                      {
                        PATFETCH (c); /* Gobble up the '?'.  */
-                       PATFETCH (c);
-                       switch (c)
+                       while (!shy)
                          {
-                         case ':': shy = 1; break;
-                         default:
-                           /* Only (?:...) is supported right now. */
-                           FREE_STACK_RETURN (REG_BADPAT);
+                           PATFETCH (c);
+                           switch (c)
+                             {
+                             case ':': shy = 1; break;
+                             case '0':
+                               /* An explicitly specified regnum must start
+                                  with non-0. */
+                               if (regnum == 0)
+                                 FREE_STACK_RETURN (REG_BADPAT);
+                             case '1': case '2': case '3': case '4':
+                             case '5': case '6': case '7': case '8': case '9':
+                               regnum = 10*regnum + (c - '0'); break;
+                             default:
+                               /* Only (?:...) is supported right now. */
+                               FREE_STACK_RETURN (REG_BADPAT);
+                             }
                          }
                      }
                  }
 
                if (!shy)
-                 {
-                   bufp->re_nsub++;
-                   regnum++;
+                 regnum = ++bufp->re_nsub;
+               else if (regnum)
+                 { /* It's actually not shy, but explicitly numbered.  */
+                   shy = 0;
+                   if (regnum > bufp->re_nsub)
+                     bufp->re_nsub = regnum;
+                   else if (regnum > bufp->re_nsub
+                            /* Ideally, we'd want to check that the specified
+                               group can't have matched (i.e. all subgroups
+                               using the same regnum are in other branches of
+                               OR patterns), but we don't currently keep track
+                               of enough info to do that easily.  */
+                            || group_in_compile_stack (compile_stack, regnum))
+                     FREE_STACK_RETURN (REG_BADPAT);
                  }
+               else
+                 /* It's really shy.  */
+                 regnum = - bufp->re_nsub;
 
                if (COMPILE_STACK_FULL)
                  {
@@ -3164,12 +3185,11 @@ regex_compile (pattern, size, syntax, bufp)
                COMPILE_STACK_TOP.fixup_alt_jump
                  = fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0;
                COMPILE_STACK_TOP.laststart_offset = b - bufp->buffer;
-               COMPILE_STACK_TOP.regnum = shy ? -regnum : regnum;
+               COMPILE_STACK_TOP.regnum = regnum;
 
-               /* Do not push a
-                  start_memory for groups beyond the last one we can
-                  represent in the compiled pattern.  */
-               if (regnum <= MAX_REGNUM && !shy)
+               /* Do not push a start_memory for groups beyond the last one
+                  we can represent in the compiled pattern.  */
+               if (regnum <= MAX_REGNUM && regnum > 0)
                  BUF_PUSH_2 (start_memory, regnum);
 
                compile_stack.avail++;
@@ -3214,7 +3234,7 @@ regex_compile (pattern, size, syntax, bufp)
                /* We don't just want to restore into `regnum', because
                   later groups should continue to be numbered higher,
                   as in `(ab)c(de)' -- the second group is #2.  */
-               regnum_t this_group_regnum;
+               regnum_t regnum;
 
                compile_stack.avail--;
                begalt = bufp->buffer + COMPILE_STACK_TOP.begalt_offset;
@@ -3223,7 +3243,7 @@ regex_compile (pattern, size, syntax, bufp)
                    ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1
                    : 0;
                laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset;
-               this_group_regnum = COMPILE_STACK_TOP.regnum;
+               regnum = COMPILE_STACK_TOP.regnum;
                /* If we've reached MAX_REGNUM groups, then this open
                   won't actually generate any code, so we'll have to
                   clear pending_exact explicitly.  */
@@ -3231,8 +3251,8 @@ regex_compile (pattern, size, syntax, bufp)
 
                /* We're at the end of the group, so now we know how many
                   groups were inside this one.  */
-               if (this_group_regnum <= MAX_REGNUM && this_group_regnum > 0)
-                 BUF_PUSH_2 (stop_memory, this_group_regnum);
+               if (regnum <= MAX_REGNUM && regnum > 0)
+                 BUF_PUSH_2 (stop_memory, regnum);
              }
              break;
 
@@ -3558,8 +3578,9 @@ regex_compile (pattern, size, syntax, bufp)
 
                reg = c - '0';
 
-               /* Can't back reference to a subexpression before its end.  */
-               if (reg > regnum || group_in_compile_stack (compile_stack, reg))
+               if (reg > bufp->re_nsub || reg < 1
+                   /* Can't back reference to a subexp before its end.  */
+                   || group_in_compile_stack (compile_stack, reg))
                  FREE_STACK_RETURN (REG_ESUBREG);
 
                laststart = b;
index 3a9fabe..d91110f 100644 (file)
@@ -92,6 +92,11 @@ Lisp_Object Qsearch_failed;
 
 Lisp_Object Vsearch_spaces_regexp;
 
+/* If non-nil, the match data will not be changed during call to
+   searching or matching functions.  This variable is for internal use
+   only.  */
+Lisp_Object Vinhibit_changing_match_data;
+
 static void set_search_regs ();
 static void save_search_regs ();
 static int simple_search ();
@@ -321,7 +326,9 @@ looking_at_1 (string, posix)
     = current_buffer->case_eqv_table;
 
   CHECK_STRING (string);
-  bufp = compile_pattern (string, &search_regs,
+  bufp = compile_pattern (string,
+                         (NILP (Vinhibit_changing_match_data)
+                          ? &search_regs : NULL),
                          (!NILP (current_buffer->case_fold_search)
                           ? current_buffer->case_canon_table : Qnil),
                          posix,
@@ -352,7 +359,9 @@ looking_at_1 (string, posix)
   re_match_object = Qnil;
 
   i = re_match_2 (bufp, (char *) p1, s1, (char *) p2, s2,
-                 PT_BYTE - BEGV_BYTE, &search_regs,
+                 PT_BYTE - BEGV_BYTE,
+                 (NILP (Vinhibit_changing_match_data)
+                  ? &search_regs : NULL),
                  ZV_BYTE - BEGV_BYTE);
   immediate_quit = 0;
 
@@ -360,7 +369,7 @@ looking_at_1 (string, posix)
     matcher_overflow ();
 
   val = (0 <= i ? Qt : Qnil);
-  if (i >= 0)
+  if (NILP (Vinhibit_changing_match_data) && i >= 0)
     for (i = 0; i < search_regs.num_regs; i++)
       if (search_regs.start[i] >= 0)
        {
@@ -369,7 +378,11 @@ looking_at_1 (string, posix)
          search_regs.end[i]
            = BYTE_TO_CHAR (search_regs.end[i] + BEGV_BYTE);
        }
-  XSETBUFFER (last_thing_searched, current_buffer);
+
+  /* Set last_thing_searched only when match data is changed.  */
+  if (NILP (Vinhibit_changing_match_data))
+    XSETBUFFER (last_thing_searched, current_buffer);
+
   return val;
 }
 
@@ -431,7 +444,9 @@ string_match_1 (regexp, string, start, posix)
   XCHAR_TABLE (current_buffer->case_canon_table)->extras[2]
     = current_buffer->case_eqv_table;
 
-  bufp = compile_pattern (regexp, &search_regs,
+  bufp = compile_pattern (regexp,
+                         (NILP (Vinhibit_changing_match_data)
+                          ? &search_regs : NULL),
                          (!NILP (current_buffer->case_fold_search)
                           ? current_buffer->case_canon_table : Qnil),
                          posix,
@@ -442,21 +457,27 @@ string_match_1 (regexp, string, start, posix)
   val = re_search (bufp, (char *) SDATA (string),
                   SBYTES (string), pos_byte,
                   SBYTES (string) - pos_byte,
-                  &search_regs);
+                  (NILP (Vinhibit_changing_match_data)
+                   ? &search_regs : NULL));
   immediate_quit = 0;
-  last_thing_searched = Qt;
+
+  /* Set last_thing_searched only when match data is changed.  */
+  if (NILP (Vinhibit_changing_match_data))
+    last_thing_searched = Qt;
+
   if (val == -2)
     matcher_overflow ();
   if (val < 0) return Qnil;
 
-  for (i = 0; i < search_regs.num_regs; i++)
-    if (search_regs.start[i] >= 0)
-      {
-       search_regs.start[i]
-         = string_byte_to_char (string, search_regs.start[i]);
-       search_regs.end[i]
-         = string_byte_to_char (string, search_regs.end[i]);
-      }
+  if (NILP (Vinhibit_changing_match_data))
+    for (i = 0; i < search_regs.num_regs; i++)
+      if (search_regs.start[i] >= 0)
+       {
+         search_regs.start[i]
+           = string_byte_to_char (string, search_regs.start[i]);
+         search_regs.end[i]
+           = string_byte_to_char (string, search_regs.end[i]);
+       }
 
   return make_number (string_byte_to_char (string, val));
 }
@@ -1074,6 +1095,11 @@ do                                               \
   }                                            \
 while (0)
 
+/* Only used in search_buffer, to record the end position of the match
+   when searching regexps and SEARCH_REGS should not be changed
+   (i.e. Vinhibit_changing_match_data is non-nil).  */
+static struct re_registers search_regs_1;
+
 static int
 search_buffer (string, pos, pos_byte, lim, lim_byte, n,
               RE, trt, inverse_trt, posix)
@@ -1109,7 +1135,10 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n,
       int s1, s2;
       struct re_pattern_buffer *bufp;
 
-      bufp = compile_pattern (string, &search_regs, trt, posix,
+      bufp = compile_pattern (string,
+                             (NILP (Vinhibit_changing_match_data)
+                              ? &search_regs : &search_regs_1),
+                             trt, posix,
                              !NILP (current_buffer->enable_multibyte_characters));
 
       immediate_quit = 1;      /* Quit immediately if user types ^G,
@@ -1142,7 +1171,8 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n,
          int val;
          val = re_search_2 (bufp, (char *) p1, s1, (char *) p2, s2,
                             pos_byte - BEGV_BYTE, lim_byte - pos_byte,
-                            &search_regs,
+                            (NILP (Vinhibit_changing_match_data)
+                             ? &search_regs : &search_regs_1),
                             /* Don't allow match past current point */
                             pos_byte - BEGV_BYTE);
          if (val == -2)
@@ -1151,18 +1181,27 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n,
            }
          if (val >= 0)
            {
-             pos_byte = search_regs.start[0] + BEGV_BYTE;
-             for (i = 0; i < search_regs.num_regs; i++)
-               if (search_regs.start[i] >= 0)
-                 {
-                   search_regs.start[i]
-                     = BYTE_TO_CHAR (search_regs.start[i] + BEGV_BYTE);
-                   search_regs.end[i]
-                     = BYTE_TO_CHAR (search_regs.end[i] + BEGV_BYTE);
-                 }
-             XSETBUFFER (last_thing_searched, current_buffer);
-             /* Set pos to the new position. */
-             pos = search_regs.start[0];
+             if (NILP (Vinhibit_changing_match_data))
+               {
+                 pos_byte = search_regs.start[0] + BEGV_BYTE;
+                 for (i = 0; i < search_regs.num_regs; i++)
+                   if (search_regs.start[i] >= 0)
+                     {
+                       search_regs.start[i]
+                         = BYTE_TO_CHAR (search_regs.start[i] + BEGV_BYTE);
+                       search_regs.end[i]
+                         = BYTE_TO_CHAR (search_regs.end[i] + BEGV_BYTE);
+                     }
+                 XSETBUFFER (last_thing_searched, current_buffer);
+                 /* Set pos to the new position. */
+                 pos = search_regs.start[0];
+               }
+             else
+               {
+                 pos_byte = search_regs_1.start[0] + BEGV_BYTE;
+                 /* Set pos to the new position.  */
+                 pos = BYTE_TO_CHAR (search_regs_1.start[0] + BEGV_BYTE);
+               }
            }
          else
            {
@@ -1176,7 +1215,8 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n,
          int val;
          val = re_search_2 (bufp, (char *) p1, s1, (char *) p2, s2,
                             pos_byte - BEGV_BYTE, lim_byte - pos_byte,
-                            &search_regs,
+                            (NILP (Vinhibit_changing_match_data)
+                             ? &search_regs : &search_regs_1),
                             lim_byte - BEGV_BYTE);
          if (val == -2)
            {
@@ -1184,17 +1224,25 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n,
            }
          if (val >= 0)
            {
-             pos_byte = search_regs.end[0] + BEGV_BYTE;
-             for (i = 0; i < search_regs.num_regs; i++)
-               if (search_regs.start[i] >= 0)
-                 {
-                   search_regs.start[i]
-                     = BYTE_TO_CHAR (search_regs.start[i] + BEGV_BYTE);
-                   search_regs.end[i]
-                     = BYTE_TO_CHAR (search_regs.end[i] + BEGV_BYTE);
-                 }
-             XSETBUFFER (last_thing_searched, current_buffer);
-             pos = search_regs.end[0];
+             if (NILP (Vinhibit_changing_match_data))
+               {
+                 pos_byte = search_regs.end[0] + BEGV_BYTE;
+                 for (i = 0; i < search_regs.num_regs; i++)
+                   if (search_regs.start[i] >= 0)
+                     {
+                       search_regs.start[i]
+                         = BYTE_TO_CHAR (search_regs.start[i] + BEGV_BYTE);
+                       search_regs.end[i]
+                         = BYTE_TO_CHAR (search_regs.end[i] + BEGV_BYTE);
+                     }
+                 XSETBUFFER (last_thing_searched, current_buffer);
+                 pos = search_regs.end[0];
+               }
+             else
+               {
+                 pos_byte = search_regs_1.end[0] + BEGV_BYTE;
+                 pos = BYTE_TO_CHAR (search_regs_1.end[0] + BEGV_BYTE);
+               }
            }
          else
            {
@@ -1926,7 +1974,7 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt,
              cursor += dirlen - i - direction; /* fix cursor */
              if (i + direction == 0)
                {
-                 int position;
+                 int position, start, end;
 
                  cursor -= direction;
 
@@ -1934,11 +1982,24 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt,
                                                       ? 1 - len_byte : 0);
                  set_search_regs (position, len_byte);
 
+                 if (NILP (Vinhibit_changing_match_data))
+                   {
+                     start = search_regs.start[0];
+                     end = search_regs.end[0];
+                   }
+                 else
+                   /* If Vinhibit_changing_match_data is non-nil,
+                      search_regs will not be changed.  So let's
+                      compute start and end here.  */
+                   {
+                     start = BYTE_TO_CHAR (position);
+                     end = BYTE_TO_CHAR (position + len_byte);
+                   }
+
                  if ((n -= direction) != 0)
                    cursor += dirlen; /* to resume search */
                  else
-                   return ((direction > 0)
-                           ? search_regs.end[0] : search_regs.start[0]);
+                   return direction > 0 ? end : start;
                }
              else
                cursor += stride_for_teases; /* <sigh> we lose -  */
@@ -2003,18 +2064,30 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt,
              pos_byte += dirlen - i- direction;
              if (i + direction == 0)
                {
-                 int position;
+                 int position, start, end;
                  pos_byte -= direction;
 
                  position = pos_byte + ((direction > 0) ? 1 - len_byte : 0);
-
                  set_search_regs (position, len_byte);
 
+                 if (NILP (Vinhibit_changing_match_data))
+                   {
+                     start = search_regs.start[0];
+                     end = search_regs.end[0];
+                   }
+                 else
+                   /* If Vinhibit_changing_match_data is non-nil,
+                      search_regs will not be changed.  So let's
+                      compute start and end here.  */
+                   {
+                     start = BYTE_TO_CHAR (position);
+                     end = BYTE_TO_CHAR (position + len_byte);
+                   }
+
                  if ((n -= direction) != 0)
                    pos_byte += dirlen; /* to resume search */
                  else
-                   return ((direction > 0)
-                           ? search_regs.end[0] : search_regs.start[0]);
+                   return direction > 0 ? end : start;
                }
              else
                pos_byte += stride_for_teases;
@@ -2037,6 +2110,9 @@ set_search_regs (beg_byte, nbytes)
 {
   int i;
 
+  if (!NILP (Vinhibit_changing_match_data))
+    return;
+
   /* Make sure we have registers in which to store
      the match position.  */
   if (search_regs.num_regs == 0)
@@ -2095,7 +2171,7 @@ wordify (string)
   if (SYNTAX (prev_c) == Sword)
     word_count++;
   if (!word_count)
-    return empty_string;
+    return empty_unibyte_string;
 
   adjust = - punct_count + 5 * (word_count - 1) + 4;
   if (STRING_MULTIBYTE (string))
@@ -3167,6 +3243,13 @@ or other such regexp constructs are not replaced with this.
 A value of nil (which is the normal value) means treat spaces literally.  */);
   Vsearch_spaces_regexp = Qnil;
 
+  DEFVAR_LISP ("inhibit-changing-match-data", &Vinhibit_changing_match_data,
+      doc: /* Internal use only.
+If non-nil, the match data will not be changed during call to searching or
+matching functions, such as `looking-at', `string-match', `re-search-forward'
+etc.  */);
+  Vinhibit_changing_match_data = Qnil;
+
   defsubr (&Slooking_at);
   defsubr (&Sposix_looking_at);
   defsubr (&Sstring_match);
index 8aedfa0..86e64cb 100644 (file)
@@ -287,7 +287,7 @@ sel_read (sel, file)
   register int i, n;
   register char *cp;
 
-  Current_Selection = make_string ("", 0);
+  Current_Selection = empty_unibyte_string;
   if (sel->sel_items <= 0)
     return (0);
   cp = (char *) malloc(sel->sel_items);
index 408ccf2..f2170da 100644 (file)
@@ -1675,6 +1675,14 @@ init_sys_modes ()
       old_fcntl_owner = fcntl (input_fd, F_GETOWN, 0);
       fcntl (input_fd, F_SETOWN, getpid ());
       init_sigio (input_fd);
+#ifdef HAVE_GPM
+      if (term_gpm)
+       {
+         fcntl (gpm_fd, F_SETOWN, getpid ());
+         fcntl (gpm_fd, F_SETFL, fcntl (gpm_fd, F_GETFL, 0) | O_NONBLOCK);
+         init_sigio (gpm_fd);
+       }
+#endif /* HAVE_GPM */
     }
 #endif /* F_GETOWN */
 #endif /* F_SETOWN_BUG */
index 0648b96..798fc37 100644 (file)
@@ -25,6 +25,9 @@ Boston, MA 02110-1301, USA.  */
 #include <stdio.h>
 #include <ctype.h>
 #include <string.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 
 #include "termchar.h"
 #include "termopts.h"
@@ -39,6 +42,7 @@ Boston, MA 02110-1301, USA.  */
 #include "window.h"
 #include "keymap.h"
 #include "blockinput.h"
+#include "intervals.h"
 
 /* For now, don't try to include termcap.h.  On some systems,
    configure finds a non-standard termcap.h that the main build
@@ -144,25 +148,6 @@ int (*read_socket_hook) P_ ((int, int, struct input_event *));
 
 void (*frame_up_to_date_hook) P_ ((struct frame *));
 
-/* Return the current position of the mouse.
-
-   Set *f to the frame the mouse is in, or zero if the mouse is in no
-   Emacs frame.  If it is set to zero, all the other arguments are
-   garbage.
-
-   If the motion started in a scroll bar, set *bar_window to the
-   scroll bar's window, *part to the part the mouse is currently over,
-   *x to the position of the mouse along the scroll bar, and *y to the
-   overall length of the scroll bar.
-
-   Otherwise, set *bar_window to Qnil, and *x and *y to the column and
-   row of the character cell the mouse is over.
-
-   Set *time to the time the mouse was at the returned position.
-
-   This should clear mouse_moved until the next motion
-   event arrives.  */
-
 void (*mouse_position_hook) P_ ((FRAME_PTR *f, int insist,
                                 Lisp_Object *bar_window,
                                 enum scroll_bar_part *part,
@@ -413,6 +398,9 @@ static int tty_cursor_hidden;
 char *tparam ();
 
 extern char *tgetstr ();
+
+static void term_clear_mouse_face ();
+static void term_mouse_highlight (struct frame *f, int x, int y);
 \f
 
 #ifdef WINDOWSNT
@@ -426,6 +414,28 @@ extern char *tgetstr ();
 #define FRAME_TERMCAP_P(_f_) 0
 #endif /* WINDOWSNT */
 
+#ifdef HAVE_GPM
+#include <sys/fcntl.h>
+#include "buffer.h"
+
+/* Nonzero means mouse is enabled on Linux console.  */
+int term_gpm = 0;
+
+/* These variables describe the range of text currently shown in its
+   mouse-face, together with the window they apply to.  As long as
+   the mouse stays within this range, we need not redraw anything on
+   its account.  Rows and columns are glyph matrix positions in
+   MOUSE_FACE_WINDOW.  */
+static int mouse_face_beg_row, mouse_face_beg_col;
+static int mouse_face_end_row, mouse_face_end_col;
+static int mouse_face_past_end;
+static Lisp_Object Qmouse_face_window;
+static int mouse_face_face_id;
+
+static int pos_x, pos_y;
+static int last_mouse_x, last_mouse_y;
+#endif /* HAVE_GPM */
+
 void
 ring_bell ()
 {
@@ -1010,6 +1020,65 @@ write_glyphs (string, len)
   cmcheckmagic ();
 }
 
+void
+write_glyphs_with_face (string, len, face_id)
+     register struct glyph *string;
+     register int len, face_id;
+{
+  struct frame *sf = XFRAME (selected_frame);
+  struct frame *f = updating_frame ? updating_frame : sf;
+  unsigned char *conversion_buffer;
+  struct coding_system *coding;
+
+  turn_off_insert ();
+  tty_hide_cursor ();
+
+  /* Don't dare write in last column of bottom line, if Auto-Wrap,
+     since that would scroll the whole frame on some terminals.  */
+
+  if (AutoWrap
+      && curY + 1 == FRAME_LINES (sf)
+      && (curX + len) == FRAME_COLS (sf))
+    len --;
+  if (len <= 0)
+    return;
+
+  cmplus (len);
+
+  /* If terminal_coding does any conversion, use it, otherwise use
+     safe_terminal_coding.  We can't use CODING_REQUIRE_ENCODING here
+     because it always return 1 if the member src_multibyte is 1.  */
+  coding = (terminal_coding.common_flags & CODING_REQUIRE_ENCODING_MASK
+           ? &terminal_coding : &safe_terminal_coding);
+  /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at
+     the tail.  */
+  coding->mode &= ~CODING_MODE_LAST_BLOCK;
+
+
+  /* Turn appearance modes of the face.  */
+  highlight_if_desired ();
+  turn_on_face (f, face_id);
+
+  coding->mode |= CODING_MODE_LAST_BLOCK;
+  conversion_buffer = encode_terminal_code (string, len, coding);
+  if (coding->produced > 0)
+    {
+      BLOCK_INPUT;
+      fwrite (conversion_buffer, 1, coding->produced, stdout);
+      if (ferror (stdout))
+       clearerr (stdout);
+      if (termscript)
+       fwrite (conversion_buffer, 1, coding->produced, termscript);
+      UNBLOCK_INPUT;
+    }
+
+  /* Turn appearance modes off.  */
+  turn_off_face (f, face_id);
+  turn_off_highlight ();
+
+  cmcheckmagic ();
+}
+
 /* If start is zero, insert blanks instead of a string at start */
 
 void
@@ -2307,6 +2376,658 @@ set_tty_color_mode (f, val)
 #endif /* !WINDOWSNT */
 
 \f
+/***********************************************************************
+                              Mouse
+ ***********************************************************************/
+
+#ifdef HAVE_GPM
+void
+term_mouse_moveto (int x, int y)
+{
+  /* TODO: how to set mouse position?
+  const char *name;
+  int fd;
+  name = (const char *) ttyname (0);
+  fd = open (name, O_WRONLY);
+     SOME_FUNCTION (x, y, fd);
+  close (fd);
+  last_mouse_x = x;
+  last_mouse_y = y;  */
+}
+
+static void
+term_show_mouse_face (enum draw_glyphs_face draw)
+{
+  struct window *w = XWINDOW (Qmouse_face_window);
+  int save_x, save_y;
+  int i;
+
+  if (/* If window is in the process of being destroyed, don't bother
+        to do anything.  */
+      w->current_matrix != NULL
+      /* Recognize when we are called to operate on rows that don't exist
+        anymore.  This can happen when a window is split.  */
+      && mouse_face_end_row < w->current_matrix->nrows)
+    {
+      /* write_glyphs writes at cursor position, so we need to
+        temporarily move cursor coordinates to the beginning of
+        the highlight region.  */
+      
+      /* Save current cursor co-ordinates */
+      save_y = curY;
+      save_x = curX;
+
+      /* Note that mouse_face_beg_row etc. are window relative.  */
+      for (i = mouse_face_beg_row; i <= mouse_face_end_row; i++)
+       {
+         int start_hpos, end_hpos, nglyphs;
+         struct glyph_row *row = MATRIX_ROW (w->current_matrix, i);
+
+         /* Don't do anything if row doesn't have valid contents.  */
+         if (!row->enabled_p)
+           continue;
+
+         /* For all but the first row, the highlight starts at column 0.  */
+         if (i == mouse_face_beg_row)
+           start_hpos = mouse_face_beg_col;
+         else
+           start_hpos = 0;
+
+         if (i == mouse_face_end_row)
+           end_hpos = mouse_face_end_col;
+         else
+           {
+             end_hpos = row->used[TEXT_AREA];
+             if (draw == DRAW_NORMAL_TEXT)
+               row->fill_line_p = 1; /* Clear to end of line */
+           }
+
+         if (end_hpos <= start_hpos)
+           continue;
+         /* Record that some glyphs of this row are displayed in
+            mouse-face.  */
+         row->mouse_face_p = draw > 0;
+
+         nglyphs = end_hpos - start_hpos;
+
+         if (end_hpos >= row->used[TEXT_AREA])
+           nglyphs = row->used[TEXT_AREA] - start_hpos;
+
+         pos_y = row->y + WINDOW_TOP_EDGE_Y (w);
+         pos_x = row->used[LEFT_MARGIN_AREA] + start_hpos
+           + WINDOW_LEFT_EDGE_X (w);
+         
+         cursor_to (pos_y, pos_x);
+
+         if (draw == DRAW_MOUSE_FACE)
+           {
+             write_glyphs_with_face (row->glyphs[TEXT_AREA] + start_hpos,
+                                     nglyphs, mouse_face_face_id);
+           }
+         else /* draw == DRAW_NORMAL_TEXT */
+           write_glyphs (row->glyphs[TEXT_AREA] + start_hpos, nglyphs);
+       }
+      cursor_to (save_y, save_x);
+    }
+}
+
+static void
+term_clear_mouse_face ()
+{
+  if (!NILP (Qmouse_face_window))
+    term_show_mouse_face (DRAW_NORMAL_TEXT);
+
+  mouse_face_beg_row = mouse_face_beg_col = -1;
+  mouse_face_end_row = mouse_face_end_col = -1;
+  Qmouse_face_window = Qnil;
+}
+
+/* Find the glyph matrix position of buffer position POS in window W.
+   *HPOS and *VPOS are set to the positions found.  W's current glyphs
+   must be up to date.  If POS is above window start return (0, 0).
+   If POS is after end of W, return end of last line in W.
+   - taken from msdos.c */
+static int
+fast_find_position (struct window *w, int pos, int *hpos, int *vpos)
+{
+  int i, lastcol, line_start_position, maybe_next_line_p = 0;
+  int yb = window_text_bottom_y (w);
+  struct glyph_row *row = MATRIX_ROW (w->current_matrix, 0), *best_row = row;
+
+  while (row->y < yb)
+    {
+      if (row->used[TEXT_AREA])
+       line_start_position = row->glyphs[TEXT_AREA]->charpos;
+      else
+       line_start_position = 0;
+
+      if (line_start_position > pos)
+       break;
+      /* If the position sought is the end of the buffer,
+        don't include the blank lines at the bottom of the window.  */
+      else if (line_start_position == pos
+              && pos == BUF_ZV (XBUFFER (w->buffer)))
+       {
+         maybe_next_line_p = 1;
+         break;
+       }
+      else if (line_start_position > 0)
+       best_row = row;
+
+      /* Don't overstep the last matrix row, lest we get into the
+        never-never land... */
+      if (row->y + 1 >= yb)
+       break;
+
+      ++row;
+    }
+
+  /* Find the right column within BEST_ROW.  */
+  lastcol = 0;
+  row = best_row;
+  for (i = 0; i < row->used[TEXT_AREA]; i++)
+    {
+      struct glyph *glyph = row->glyphs[TEXT_AREA] + i;
+      int charpos;
+
+      charpos = glyph->charpos;
+      if (charpos == pos)
+       {
+         *hpos = i;
+         *vpos = row->y;
+         return 1;
+       }
+      else if (charpos > pos)
+       break;
+      else if (charpos > 0)
+       lastcol = i;
+    }
+
+  /* If we're looking for the end of the buffer,
+     and we didn't find it in the line we scanned,
+     use the start of the following line.  */
+  if (maybe_next_line_p)
+    {
+      ++row;
+      lastcol = 0;
+    }
+
+  *vpos = row->y;
+  *hpos = lastcol + 1;
+  return 0;
+}
+
+static void
+term_mouse_highlight (struct frame *f, int x, int y)
+{
+  enum window_part part;
+  Lisp_Object window;
+  struct window *w;
+  struct buffer *b;
+
+  if (NILP (Vmouse_highlight)
+      || !f->glyphs_initialized_p)
+    return;
+
+  /* Which window is that in?  */
+  window = window_from_coordinates (f, x, y, &part, &x, &y, 0);
+
+  /* Not on a window -> return.  */
+  if (!WINDOWP (window))
+    return;
+
+  if (!EQ (window, Qmouse_face_window))
+    term_clear_mouse_face ();
+
+  w = XWINDOW (window);
+
+  /* Are we in a window whose display is up to date?
+     And verify the buffer's text has not changed.  */
+  b = XBUFFER (w->buffer);
+  if (part == ON_TEXT
+      && EQ (w->window_end_valid, w->buffer)
+      && XFASTINT (w->last_modified) == BUF_MODIFF (b)
+      && XFASTINT (w->last_overlay_modified) == BUF_OVERLAY_MODIFF (b))
+    {
+      int pos, i, nrows = w->current_matrix->nrows;
+      struct glyph_row *row;
+      struct glyph *glyph;
+
+      /* Find the glyph under X/Y.  */
+      glyph = NULL;
+      if (y >= 0 && y < nrows)
+       {
+         row = MATRIX_ROW (w->current_matrix, y);
+         /* Give up if some row before the one we are looking for is
+            not enabled.  */
+         for (i = 0; i <= y; i++)
+           if (!MATRIX_ROW (w->current_matrix, i)->enabled_p)
+             break;
+         if (i > y  /* all rows upto and including the one at Y are enabled */
+             && row->displays_text_p
+             && x <  window_box_width (w, TEXT_AREA))
+           {
+             glyph = row->glyphs[TEXT_AREA];
+             if (x >= row->used[TEXT_AREA])
+               glyph = NULL;
+             else
+               {
+                 glyph += x;
+                 if (!BUFFERP (glyph->object))
+                   glyph = NULL;
+               }
+           }
+       }
+
+      /* Clear mouse face if X/Y not over text.  */
+      if (glyph == NULL)
+       {
+         term_clear_mouse_face ();
+         return;
+       }
+
+      if (!BUFFERP (glyph->object))
+       abort ();
+      pos = glyph->charpos;
+
+      /* Check for mouse-face.  */
+      {
+       extern Lisp_Object Qmouse_face;
+       Lisp_Object mouse_face, overlay, position, *overlay_vec;
+       int noverlays, obegv, ozv;
+       struct buffer *obuf;
+
+       /* If we get an out-of-range value, return now; avoid an error.  */
+       if (pos > BUF_Z (b))
+         return;
+
+       /* Make the window's buffer temporarily current for
+          overlays_at and compute_char_face.  */
+       obuf = current_buffer;
+       current_buffer = b;
+       obegv = BEGV;
+       ozv = ZV;
+       BEGV = BEG;
+       ZV = Z;
+
+       /* Is this char mouse-active?  */
+       XSETINT (position, pos);
+
+       /* Put all the overlays we want in a vector in overlay_vec.  */
+       GET_OVERLAYS_AT (pos, overlay_vec, noverlays, NULL, 0);
+       /* Sort overlays into increasing priority order.  */
+       noverlays = sort_overlays (overlay_vec, noverlays, w);
+
+       /* Check mouse-face highlighting.  */
+       if (!(EQ (window, Qmouse_face_window)
+             && y >= mouse_face_beg_row
+             && y <= mouse_face_end_row
+             && (y > mouse_face_beg_row
+                 || x >= mouse_face_beg_col)
+             && (y < mouse_face_end_row
+                 || x < mouse_face_end_col
+                 || mouse_face_past_end)))
+         {
+           /* Clear the display of the old active region, if any.  */
+           term_clear_mouse_face ();
+
+           /* Find the highest priority overlay that has a mouse-face
+              property.  */
+           overlay = Qnil;
+           for (i = noverlays - 1; i >= 0; --i)
+             {
+               mouse_face = Foverlay_get (overlay_vec[i], Qmouse_face);
+               if (!NILP (mouse_face))
+                 {
+                   overlay = overlay_vec[i];
+                   break;
+                 }
+             }
+
+           /* If no overlay applies, get a text property.  */
+           if (NILP (overlay))
+             mouse_face = Fget_text_property (position, Qmouse_face,
+                                              w->buffer);
+
+           /* Handle the overlay case.  */
+           if (!NILP (overlay))
+             {
+               /* Find the range of text around this char that
+                  should be active.  */
+               Lisp_Object before, after;
+               int ignore;
+
+
+               before = Foverlay_start (overlay);
+               after = Foverlay_end (overlay);
+               /* Record this as the current active region.  */
+               fast_find_position (w, XFASTINT (before),
+                                   &mouse_face_beg_col,
+                                   &mouse_face_beg_row);
+
+               mouse_face_past_end
+                 = !fast_find_position (w, XFASTINT (after),
+                                        &mouse_face_end_col,
+                                        &mouse_face_end_row);
+               Qmouse_face_window = window;
+
+               mouse_face_face_id
+                 = face_at_buffer_position (w, pos, 0, 0,
+                                            &ignore, pos + 1, 1);
+
+               /* Display it as active.  */
+               term_show_mouse_face (DRAW_MOUSE_FACE);
+             }
+           /* Handle the text property case.  */
+           else if (!NILP (mouse_face))
+             {
+               /* Find the range of text around this char that
+                  should be active.  */
+               Lisp_Object before, after, beginning, end;
+               int ignore;
+
+               beginning = Fmarker_position (w->start);
+               XSETINT (end, (BUF_Z (b) - XFASTINT (w->window_end_pos)));
+               before
+                 = Fprevious_single_property_change (make_number (pos + 1),
+                                                     Qmouse_face,
+                                                     w->buffer, beginning);
+               after
+                 = Fnext_single_property_change (position, Qmouse_face,
+                                                 w->buffer, end);
+
+               /* Record this as the current active region.  */
+               fast_find_position (w, XFASTINT (before),
+                                   &mouse_face_beg_col,
+                                   &mouse_face_beg_row);
+               mouse_face_past_end
+                 = !fast_find_position (w, XFASTINT (after),
+                                        &mouse_face_end_col,
+                                        &mouse_face_end_row);
+               Qmouse_face_window = window;
+
+               mouse_face_face_id
+                 = face_at_buffer_position (w, pos, 0, 0,
+                                            &ignore, pos + 1, 1);
+
+               /* Display it as active.  */
+               term_show_mouse_face (DRAW_MOUSE_FACE);
+             }
+         }
+
+       /* Look for a `help-echo' property.  */
+       {
+         Lisp_Object help;
+         extern Lisp_Object Qhelp_echo;
+
+         /* Check overlays first.  */
+         help = Qnil;
+         for (i = noverlays - 1; i >= 0 && NILP (help); --i)
+           {
+             overlay = overlay_vec[i];
+             help = Foverlay_get (overlay, Qhelp_echo);
+           }
+
+         if (!NILP (help))
+           {
+             help_echo_string = help;
+             help_echo_window = window;
+             help_echo_object = overlay;
+             help_echo_pos = pos;
+           }
+         /* Try text properties.  */
+         else if (NILP (help)
+                  && ((STRINGP (glyph->object)
+                       && glyph->charpos >= 0
+                       && glyph->charpos < SCHARS (glyph->object))
+                      || (BUFFERP (glyph->object)
+                          && glyph->charpos >= BEGV
+                          && glyph->charpos < ZV)))
+           {
+             help = Fget_text_property (make_number (glyph->charpos),
+                                        Qhelp_echo, glyph->object);
+             if (!NILP (help))
+               {
+                 help_echo_string = help;
+                 help_echo_window = window;
+                 help_echo_object = glyph->object;
+                 help_echo_pos = glyph->charpos;
+               }
+           }
+       }
+
+       BEGV = obegv;
+       ZV = ozv;
+       current_buffer = obuf;
+      }
+    }
+}
+
+static int
+term_mouse_movement (FRAME_PTR frame, Gpm_Event *event)
+{
+  /* Has the mouse moved off the glyph it was on at the last sighting?  */
+  if (event->x != last_mouse_x || event->y != last_mouse_y)
+    {
+      frame->mouse_moved = 1;
+      term_mouse_highlight (frame, event->x, event->y);
+      /* Remember which glyph we're now on.  */
+      last_mouse_x = event->x;
+      last_mouse_y = event->y;
+      return 1;
+    }
+  return 0;
+}
+
+/* Return the current position of the mouse.
+
+   Set *f to the frame the mouse is in, or zero if the mouse is in no
+   Emacs frame.  If it is set to zero, all the other arguments are
+   garbage.
+
+   Set *bar_window to Qnil, and *x and *y to the column and
+   row of the character cell the mouse is over.
+
+   Set *time to the time the mouse was at the returned position.
+
+   This clears mouse_moved until the next motion
+   event arrives.  */
+static void
+term_mouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window,
+                    enum scroll_bar_part *part, Lisp_Object *x,
+                    Lisp_Object *y, unsigned long *time)
+{
+  struct timeval now;
+
+  *fp = SELECTED_FRAME ();
+  (*fp)->mouse_moved = 0;
+
+  *bar_window = Qnil;
+  *part = 0;
+
+  XSETINT (*x, last_mouse_x);
+  XSETINT (*y, last_mouse_y);
+  gettimeofday(&now, 0);
+  *time = (now.tv_sec * 1000) + (now.tv_usec / 1000);
+}
+
+/* Prepare a mouse-event in *RESULT for placement in the input queue.
+
+   If the event is a button press, then note that we have grabbed
+   the mouse.  */
+
+static Lisp_Object
+term_mouse_click (struct input_event *result, Gpm_Event *event,
+                 struct frame *f)
+{
+  struct timeval now;
+  int i, j;
+
+  result->kind = GPM_CLICK_EVENT;
+  for (i = 0, j = GPM_B_LEFT; i < 3; i++, j >>= 1 )
+    {
+      if (event->buttons & j) {
+       result->code = i; /* button number */
+       break;
+      }
+    }
+  gettimeofday(&now, 0);
+  result->timestamp = (now.tv_sec * 1000) + (now.tv_usec / 1000);
+
+  if (event->type & GPM_UP)
+    result->modifiers = up_modifier;
+  else if (event->type & GPM_DOWN)
+    result->modifiers = down_modifier;
+  else
+    result->modifiers = 0;
+  
+  if (event->type & GPM_SINGLE)
+    result->modifiers |= click_modifier;
+  
+  if (event->type & GPM_DOUBLE)
+    result->modifiers |= double_modifier;
+
+  if (event->type & GPM_TRIPLE)
+    result->modifiers |= triple_modifier;
+
+  if (event->type & GPM_DRAG)
+    result->modifiers |= drag_modifier;
+
+  if (!(event->type & (GPM_MOVE | GPM_DRAG))) {
+
+    /* 1 << KG_SHIFT */
+    if (event->modifiers & (1 << 0))
+      result->modifiers |= shift_modifier;
+
+    /* 1 << KG_CTRL */
+    if (event->modifiers & (1 << 2))
+      result->modifiers |= ctrl_modifier;
+
+    /* 1 << KG_ALT || KG_ALTGR */
+    if (event->modifiers & (1 << 3)
+       || event->modifiers & (1 << 1))
+      result->modifiers |= meta_modifier;
+  }
+
+  XSETINT (result->x, event->x);
+  XSETINT (result->y, event->y);
+  XSETFRAME (result->frame_or_window, f);
+  result->arg = Qnil;
+  return Qnil;
+}
+
+int 
+handle_one_term_event (Gpm_Event *event, struct input_event* hold_quit)
+{
+  struct frame *f = SELECTED_FRAME ();
+  int fd;
+  struct input_event ie;
+  int do_help = 0;
+  int count = 0;
+
+  EVENT_INIT (ie);
+  ie.kind = NO_EVENT;
+  ie.arg = Qnil;
+
+  if (event->type & (GPM_MOVE | GPM_DRAG)) {
+    unsigned char buf[6 * sizeof (short)];
+    unsigned short *arg = (unsigned short *) buf + 1;
+    const char *name;
+
+    previous_help_echo_string = help_echo_string;
+    help_echo_string = Qnil;
+
+    /* Display mouse pointer */
+    buf[sizeof(short) - 1] = 2;  /* set selection */
+
+    arg[0] = arg[2] = (unsigned short) event->x + gpm_zerobased;
+    arg[1] = arg[3] = (unsigned short) event->y + gpm_zerobased;
+    arg[4] = (unsigned short) 3;
+    
+    name = ttyname (0);
+    fd = open (name, O_WRONLY);
+    ioctl (fd, TIOCLINUX, buf + sizeof (short) - 1);
+    close (fd);
+
+    if (!term_mouse_movement (f, event))
+      help_echo_string = previous_help_echo_string;
+
+    /* If the contents of the global variable help_echo_string
+       has changed, generate a HELP_EVENT.  */
+    if (!NILP (help_echo_string)
+       || !NILP (previous_help_echo_string))
+      do_help = 1;
+
+    goto done;
+  }
+  else {
+    f->mouse_moved = 0;
+    term_mouse_click (&ie, event, f);
+  }
+
+ done:
+  if (ie.kind != NO_EVENT)
+    {
+      kbd_buffer_store_event_hold (&ie, hold_quit);
+      count++;
+    }
+
+  if (do_help
+      && !(hold_quit && hold_quit->kind != NO_EVENT))
+    {
+      Lisp_Object frame;
+
+      if (f)
+       XSETFRAME (frame, f);
+      else
+       frame = Qnil;
+
+      gen_help_event (help_echo_string, frame, help_echo_window,
+                     help_echo_object, help_echo_pos);
+      count++;
+    }
+
+  return count;
+}
+
+DEFUN ("term-open-connection", Fterm_open_connection, Sterm_open_connection,
+       0, 0, 0,
+       doc: /* Open a connection to Gpm.  */)
+     ()
+{
+  Gpm_Connect connection;
+
+  connection.eventMask = ~0;
+  connection.defaultMask = ~GPM_HARD;
+  connection.maxMod = ~0;
+  connection.minMod = 0;
+  gpm_zerobased = 1;
+
+  if (Gpm_Open (&connection, 0) < 0)
+    return Qnil;
+  else
+    {
+      term_gpm = 1;
+      reset_sys_modes ();
+      init_sys_modes ();
+      add_gpm_wait_descriptor (gpm_fd);
+      return Qt;
+    }
+}
+
+DEFUN ("term-close-connection", Fterm_close_connection, Sterm_close_connection,
+       0, 0, 0,
+       doc: /* Close a connection to Gpm.  */)
+     ()
+{
+   delete_gpm_wait_descriptor (gpm_fd);
+   while (Gpm_Close()); /* close all the stack */
+   term_gpm = 0;
+   return Qnil;
+}
+#endif /* HAVE_GPM */
+
+\f
 /***********************************************************************
                            Initialization
  ***********************************************************************/
@@ -2325,6 +3046,11 @@ term_init (terminal_type)
 
   encode_terminal_bufsize = 0;
 
+#ifdef HAVE_GPM
+  mouse_position_hook = term_mouse_position;
+  Qmouse_face_window = Qnil;
+#endif
+
 #ifdef WINDOWSNT
   initialize_w32_display ();
 
@@ -2772,6 +3498,12 @@ bigger, or it may make it blink, or it may do nothing at all.  */);
   defsubr (&Stty_display_color_p);
   defsubr (&Stty_display_color_cells);
   defsubr (&Stty_no_underline);
+#ifdef HAVE_GPM
+  defsubr (&Sterm_open_connection);
+  defsubr (&Sterm_close_connection);
+
+  staticpro (&Qmouse_face_window);
+#endif /* HAVE_GPM */
 
   fullscreen_hook = NULL;
 }
index 3207825..eb07460 100644 (file)
@@ -340,7 +340,11 @@ enum event_kind
      symbols, respectively.  Member `arg' is a Lisp object converted
      from the received Apple event.  Parameters for non-Apple events
      are converted to those in Apple events.  */
-  MAC_APPLE_EVENT
+  MAC_APPLE_EVENT,
+#endif
+
+#ifdef HAVE_GPM
+  GPM_CLICK_EVENT
 #endif
 };
 
@@ -446,6 +450,15 @@ enum {
   meta_modifier        =  CHAR_META    /* Under X, the XK_Meta_[LR] keysyms.  */
 };
 
+#ifdef HAVE_GPM
+#include <gpm.h>
+extern int handle_one_term_event (Gpm_Event *, struct input_event *);
+extern void term_mouse_moveto (int, int);
+
+/* Nonzero means mouse is enabled on Linux console */
+extern int term_gpm;
+#endif
+
 #endif
 
 /* arch-tag: 33a00ecc-52b5-4186-a410-8801ac9f087d
index eaad690..d7e95aa 100644 (file)
--- a/src/w32.c
+++ b/src/w32.c
@@ -137,6 +137,15 @@ typedef BOOL (WINAPI * GetTokenInformation_Proc) (
     LPVOID TokenInformation,
     DWORD TokenInformationLength,
     PDWORD ReturnLength);
+typedef BOOL (WINAPI * GetProcessTimes_Proc) (
+    HANDLE process_handle,
+    LPFILETIME creation_time,
+    LPFILETIME exit_time,
+    LPFILETIME kernel_time,
+    LPFILETIME user_time);
+
+GetProcessTimes_Proc get_process_times_fn = NULL;
+
 #ifdef _UNICODE
 const char * const LookupAccountSid_Name = "LookupAccountSidW";
 #else
@@ -172,6 +181,46 @@ is_windows_9x ()
   return s_b_ret;
 }
 
+/* Get total user and system times for get-internal-run-time.
+   Returns a list of three integers if the times are provided by the OS
+   (NT derivatives), otherwise it returns the result of current-time. */
+Lisp_Object
+w32_get_internal_run_time ()
+{
+  if (get_process_times_fn)
+    {
+      FILETIME create, exit, kernel, user;
+      HANDLE proc = GetCurrentProcess();
+      if ((*get_process_times_fn) (proc, &create, &exit, &kernel, &user))
+        {
+          LARGE_INTEGER user_int, kernel_int, total;
+          int microseconds;
+          user_int.LowPart = user.dwLowDateTime;
+          user_int.HighPart = user.dwHighDateTime;
+          kernel_int.LowPart = kernel.dwLowDateTime;
+          kernel_int.HighPart = kernel.dwHighDateTime;
+          total.QuadPart = user_int.QuadPart + kernel_int.QuadPart;
+          /* FILETIME is 100 nanosecond increments, Emacs only wants
+             microsecond resolution.  */
+          total.QuadPart /= 10;
+          microseconds = total.QuadPart % 1000000;
+          total.QuadPart /= 1000000;
+
+          /* Sanity check to make sure we can represent the result.  */
+          if (total.HighPart == 0)
+            {
+              int secs = total.LowPart;
+
+              return list3 (make_number ((secs >> 16) & 0xffff),
+                            make_number (secs & 0xffff),
+                            make_number (microseconds));
+            }
+        }
+    }
+
+  return Fcurrent_time ();
+}
+
   /* ** The wrapper functions ** */
 
 BOOL WINAPI open_process_token (
@@ -4146,6 +4195,11 @@ BOOL WINAPI shutdown_handler(DWORD type)
 void
 globals_of_w32 ()
 {
+  HMODULE kernel32 = GetModuleHandle ("kernel32.dll");
+
+  get_process_times_fn = (GetProcessTimes_Proc)
+    GetProcAddress (kernel32, "GetProcessTimes");
+
   g_b_init_is_windows_9x = 0;
   g_b_init_open_process_token = 0;
   g_b_init_get_token_information = 0;
index 0422257..6f97426 100644 (file)
@@ -218,10 +218,9 @@ extern int errno;
 extern EMACS_INT extra_keyboard_modifiers;
 
 static void x_update_window_end P_ ((struct window *, int, int));
-void w32_delete_display P_ ((struct w32_display_info *));
 static void w32_handle_tool_bar_click P_ ((struct frame *,
                                           struct input_event *));
-void w32_define_cursor P_ ((Window, Cursor));
+static void w32_define_cursor P_ ((Window, Cursor));
 
 void x_lower_frame P_ ((struct frame *));
 void x_scroll_bar_clear P_ ((struct frame *));
@@ -230,7 +229,7 @@ void x_raise_frame P_ ((struct frame *));
 void x_set_window_size P_ ((struct frame *, int, int, int));
 void x_wm_set_window_state P_ ((struct frame *, int));
 void x_wm_set_icon_pixmap P_ ((struct frame *, int));
-void w32_initialize P_ ((void));
+static void w32_initialize P_ ((void));
 static void x_font_min_bounds P_ ((XFontStruct *, int *, int *));
 int x_compute_min_glyph_bounds P_ ((struct frame *));
 static void x_update_end P_ ((struct frame *));
@@ -683,6 +682,60 @@ w32_draw_fringe_bitmap (w, row, p)
 
   hdc = get_frame_dc (f);
 
+  if (!p->overlay_p)
+    {
+      int bx = p->bx, by = p->by, nx = p->nx, ny = p->ny;
+
+      /* If the fringe is adjacent to the left (right) scroll bar of a
+        leftmost (rightmost, respectively) window, then extend its
+        background to the gap between the fringe and the bar.  */
+      if ((WINDOW_LEFTMOST_P (w)
+          && WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w))
+         || (WINDOW_RIGHTMOST_P (w)
+             && WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w)))
+       {
+         int sb_width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w);
+
+         if (sb_width > 0)
+           {
+             int left = WINDOW_SCROLL_BAR_AREA_X (w);
+             int width = (WINDOW_CONFIG_SCROLL_BAR_COLS (w)
+                          * FRAME_COLUMN_WIDTH (f));
+
+             if (bx < 0)
+               {
+                 /* Bitmap fills the fringe.  */
+                 if (left + width == p->x)
+                   bx = left + sb_width;
+                 else if (p->x + p->wd == left)
+                   bx = left;
+                 if (bx >= 0)
+                   {
+                     int header_line_height = WINDOW_HEADER_LINE_HEIGHT (w);
+
+                     nx = width - sb_width;
+                     by = WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height,
+                                                           row->y));
+                     ny = row->visible_height;
+                   }
+               }
+             else
+               {
+                 if (left + width == bx)
+                   {
+                     bx = left + sb_width;
+                     nx += width - sb_width;
+                   }
+                 else if (bx + nx == left)
+                   nx += width - sb_width;
+               }
+           }
+       }
+
+      if (bx >= 0 && nx > 0)
+       w32_fill_area (f, hdc, face->background, bx, by, nx, ny);
+    }
+
   /* Must clip because of partially visible lines.  */
   rowY = WINDOW_TO_FRAME_PIXEL_Y (w, row->y);
   if (p->y < rowY)
@@ -700,12 +753,6 @@ w32_draw_fringe_bitmap (w, row, p)
   else
     w32_clip_to_row (w, row, -1, hdc);
 
-  if (p->bx >= 0 && !p->overlay_p)
-    {
-      w32_fill_area (f, hdc, face->background,
-                    p->bx, p->by, p->nx, p->ny);
-    }
-
   if (p->which && p->which < max_fringe_bmp)
     {
       HBITMAP pixmap = fringe_bmp[p->which];
@@ -3278,7 +3325,7 @@ redo_mouse_highlight ()
                          HIWORD (last_mouse_motion_event.lParam));
 }
 
-void
+static void
 w32_define_cursor (window, cursor)
      Window window;
      Cursor cursor;
@@ -3638,6 +3685,7 @@ x_scroll_bar_create (w, top, left, width, height)
   XSETINT (bar->start, 0);
   XSETINT (bar->end, 0);
   bar->dragging = Qnil;
+  bar->fringe_extended_p = Qnil;
 
   /* Requires geometry to be set before call to create the real window */
 
@@ -3701,6 +3749,7 @@ w32_set_vertical_scroll_bar (w, portion, whole, position)
   struct scroll_bar *bar;
   int top, height, left, sb_left, width, sb_width;
   int window_y, window_height;
+  int fringe_extended_p;
 
   /* Get window dimensions.  */
   window_box (w, -1, 0, &window_y, 0, &window_height);
@@ -3720,9 +3769,20 @@ w32_set_vertical_scroll_bar (w, portion, whole, position)
 
   /* Compute the left edge of the scroll bar.  */
   if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))
-    sb_left = left + width - sb_width - (width - sb_width) / 2;
+    sb_left = left + (WINDOW_RIGHTMOST_P (w) ? width - sb_width : 0);
+  else
+    sb_left = left + (WINDOW_LEFTMOST_P (w) ? 0 : width - sb_width);
+
+  if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w))
+    fringe_extended_p = (WINDOW_LEFTMOST_P (w)
+                        && WINDOW_LEFT_FRINGE_WIDTH (w)
+                        && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
+                            || WINDOW_LEFT_MARGIN_COLS (w) == 0));
   else
-    sb_left = left + (width - sb_width) / 2;
+    fringe_extended_p = (WINDOW_RIGHTMOST_P (w)
+                        && WINDOW_RIGHT_FRINGE_WIDTH (w)
+                        && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
+                            || WINDOW_RIGHT_MARGIN_COLS (w) == 0));
 
   /* Does the scroll bar exist yet?  */
   if (NILP (w->vertical_scroll_bar))
@@ -3732,7 +3792,10 @@ w32_set_vertical_scroll_bar (w, portion, whole, position)
       if (width > 0 && height > 0)
        {
          hdc = get_frame_dc (f);
-         w32_clear_area (f, hdc, left, top, width, height);
+         if (fringe_extended_p)
+           w32_clear_area (f, hdc, sb_left, top, sb_width, height);
+         else
+           w32_clear_area (f, hdc, left, top, width, height);
          release_frame_dc (f, hdc);
        }
       UNBLOCK_INPUT;
@@ -3751,7 +3814,8 @@ w32_set_vertical_scroll_bar (w, portion, whole, position)
       if ( XINT (bar->left) == sb_left
            && XINT (bar->top) == top
            && XINT (bar->width) ==  sb_width
-           && XINT (bar->height) == height )
+           && XINT (bar->height) == height
+          && !NILP (bar->fringe_extended_p) == fringe_extended_p )
         {
           /* Redraw after clear_frame. */
           if (!my_show_window (f, hwnd, SW_NORMAL))
@@ -3768,11 +3832,10 @@ w32_set_vertical_scroll_bar (w, portion, whole, position)
              hdc = get_frame_dc (f);
              /* Since Windows scroll bars are smaller than the space reserved
                 for them on the frame, we have to clear "under" them.  */
-             w32_clear_area (f, hdc,
-                             left,
-                             top,
-                             width,
-                             height);
+             if (fringe_extended_p)
+               w32_clear_area (f, hdc, sb_left, top, sb_width, height);
+             else
+               w32_clear_area (f, hdc, left, top, width, height);
              release_frame_dc (f, hdc);
            }
           /* Make sure scroll bar is "visible" before moving, to ensure the
@@ -3802,6 +3865,8 @@ w32_set_vertical_scroll_bar (w, portion, whole, position)
           UNBLOCK_INPUT;
         }
     }
+  bar->fringe_extended_p = fringe_extended_p ? Qt : Qnil;
+
   w32_set_scroll_bar_thumb (bar, portion, position, whole);
 
   XSETVECTOR (w->vertical_scroll_bar, bar);
@@ -6345,7 +6410,7 @@ static struct redisplay_interface w32_redisplay_interface =
   w32_shift_glyphs_for_insert
 };
 
-void
+static void
 w32_initialize ()
 {
   rif = &w32_redisplay_interface;
index acf864d..b73dcfc 100644 (file)
@@ -487,6 +487,10 @@ struct scroll_bar {
      place where the user grabbed it.  If the handle isn't currently
      being dragged, this is Qnil.  */
   Lisp_Object dragging;
+
+  /* t if the background of the fringe that is adjacent to a scroll
+     bar is extended to the gap between the fringe and the bar.  */
+  Lisp_Object fringe_extended_p;
 };
 
 /* The number of elements a vector holding a struct scroll_bar needs.  */
@@ -576,14 +580,14 @@ extern void w32_fill_rect ();
 extern void w32_clear_window ();
 
 #define w32_fill_area(f,hdc,pix,x,y,nx,ny) \
-{ \
+do { \
     RECT rect; \
     rect.left = x; \
     rect.top = y; \
     rect.right = x + nx; \
     rect.bottom = y + ny; \
     w32_fill_rect (f,hdc,pix,&rect); \
-}
+} while (0)
 
 #define w32_clear_rect(f,hdc,lprect) \
 w32_fill_rect (f,hdc,f->output_data.x->background_pixel,lprect)
index a1c027b..b1a837b 100644 (file)
@@ -9369,7 +9369,7 @@ update_tool_bar (f, save_match_data)
      struct frame *f;
      int save_match_data;
 {
-#ifdef USE_GTK
+#if defined (USE_GTK) || USE_MAC_TOOLBAR
   int do_update = FRAME_EXTERNAL_TOOL_BAR (f);
 #else
   int do_update = WINDOWP (f->tool_bar_window)
@@ -9835,7 +9835,7 @@ redisplay_tool_bar (f)
   struct it it;
   struct glyph_row *row;
 
-#ifdef USE_GTK
+#if defined (USE_GTK) || USE_MAC_TOOLBAR
   if (FRAME_EXTERNAL_TOOL_BAR (f))
     update_frame_tool_bar (f);
   return 0;
@@ -12787,7 +12787,7 @@ redisplay_window (window, just_this_one_p)
   int rc;
   int centering_position = -1;
   int last_line_misfit = 0;
-  int save_beg_unchanged, save_end_unchanged;
+  int beg_unchanged, end_unchanged;
 
   SET_TEXT_POS (lpoint, PT, PT_BYTE);
   opoint = lpoint;
@@ -12852,8 +12852,8 @@ redisplay_window (window, just_this_one_p)
   set_buffer_internal_1 (XBUFFER (w->buffer));
   SET_TEXT_POS (opoint, PT, PT_BYTE);
 
-  save_beg_unchanged = BEG_UNCHANGED;
-  save_end_unchanged = END_UNCHANGED;
+  beg_unchanged = BEG_UNCHANGED;
+  end_unchanged = END_UNCHANGED;
 
   current_matrix_up_to_date_p
     = (!NILP (w->window_end_valid)
@@ -13159,16 +13159,16 @@ redisplay_window (window, just_this_one_p)
         than a simple mouse-click.  */
       if (NILP (w->start_at_line_beg)
          && NILP (do_mouse_tracking)
-         && CHARPOS (startp) > BEGV
-         && CHARPOS (startp) > BEG + save_beg_unchanged
-         && CHARPOS (startp) <= Z - save_end_unchanged)
+         && CHARPOS (startp) > BEGV
+         && CHARPOS (startp) > BEG + beg_unchanged
+         && CHARPOS (startp) <= Z - end_unchanged)
        {
          w->force_start = Qt;
          if (XMARKER (w->start)->buffer == current_buffer)
            compute_window_start_on_continuation_line (w);
          SET_TEXT_POS_FROM_MARKER (startp, w->start);
          goto force_start;
-       }
+       }
 
 #if GLYPH_DEBUG
       debug_method_add (w, "same window start");
@@ -13471,7 +13471,7 @@ redisplay_window (window, just_this_one_p)
         display_menu_bar (w);
 
 #ifdef HAVE_WINDOW_SYSTEM
-#ifdef USE_GTK
+#if defined (USE_GTK) || USE_MAC_TOOLBAR
       redisplay_tool_bar_p = FRAME_EXTERNAL_TOOL_BAR (f);
 #else
       redisplay_tool_bar_p = WINDOWP (f->tool_bar_window)
@@ -17349,7 +17349,7 @@ are the selected window and the window's buffer).  */)
   CHECK_BUFFER (buffer);
 
   if (NILP (format))
-    return build_string ("");
+    return empty_unibyte_string;
 
   if (no_props)
     face = Qnil;
@@ -17407,7 +17407,7 @@ are the selected window and the window's buffer).  */)
     {
       mode_line_string_list = Fnreverse (mode_line_string_list);
       str = Fmapconcat (intern ("identity"), mode_line_string_list,
-                       make_string ("", 0));
+                       empty_unibyte_string);
     }
 
   unbind_to (count, Qnil);
@@ -18001,6 +18001,16 @@ decode_mode_spec (w, c, field_width, precision, multibyte)
 #endif
       break;
 
+    case '@':
+      {
+       Lisp_Object val;
+       val = call1 (intern ("file-remote-p"), current_buffer->directory);
+       if (NILP (val))
+         return "-";
+       else
+         return "@";
+      }
+
     case 't':                  /* indicate TEXT or BINARY */
 #ifdef MODE_LINE_BINARY_TEXT
       return MODE_LINE_BINARY_TEXT (b);
@@ -24088,7 +24098,7 @@ and is used only on frames for which no explicit name has been set
     = Vframe_title_format
     = Fcons (intern ("multiple-frames"),
             Fcons (build_string ("%b"),
-                   Fcons (Fcons (empty_string,
+                   Fcons (Fcons (empty_unibyte_string,
                                  Fcons (intern ("invocation-name"),
                                         Fcons (build_string ("@"),
                                                Fcons (intern ("system-name"),
index 31e0337..ffaf2af 100644 (file)
@@ -3935,6 +3935,8 @@ Otherwise check for the existence of a global face.  */)
 {
   Lisp_Object lface;
 
+  face = resolve_face_name (face, 1);
+
   if (!NILP (frame))
     {
       CHECK_LIVE_FRAME (frame);
index 80f2141..0c06abb 100644 (file)
@@ -72,8 +72,13 @@ Boston, MA 02110-1301, USA.  */
 #include <X11/Shell.h>
 
 #ifndef USE_MOTIF
+#ifdef HAVE_XAW3D
+#include <X11/Xaw3d/Paned.h>
+#include <X11/Xaw3d/Label.h>
+#else /* !HAVE_XAW3D */
 #include <X11/Xaw/Paned.h>
 #include <X11/Xaw/Label.h>
+#endif /* HAVE_XAW3D */
 #endif /* USE_MOTIF */
 
 #ifdef USG
@@ -1847,9 +1852,9 @@ x_default_scroll_bar_color_parameter (f, alist, prop, xprop, xclass,
                                    build_string (foreground_p
                                                  ? "foreground"
                                                  : "background"),
-                                   empty_string,
+                                   empty_unibyte_string,
                                    build_string ("verticalScrollBar"),
-                                   empty_string);
+                                   empty_unibyte_string);
       if (!STRINGP (tem))
        {
          /* If nothing has been specified, scroll bars will use a
@@ -3505,6 +3510,7 @@ FRAME nil means use the selected frame.  */)
   x_catch_errors (dpy);
   XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
                  RevertToParent, CurrentTime);
+  x_ewmh_activate_frame (f);
   x_uncatch_errors ();
   UNBLOCK_INPUT;
 
index 723de57..f68f3a4 100644 (file)
@@ -82,7 +82,11 @@ Boston, MA 02110-1301, USA.  */
 #include <X11/StringDefs.h>
 #include <X11/Shell.h>
 #ifdef USE_LUCID
+#ifdef HAVE_XAW3D
+#include <X11/Xaw3d/Paned.h>
+#else /* !HAVE_XAW3D */
 #include <X11/Xaw/Paned.h>
+#endif /* HAVE_XAW3D */
 #endif /* USE_LUCID */
 #include "../lwlib/lwlib.h"
 #else /* not USE_X_TOOLKIT */
@@ -325,7 +329,7 @@ restore_menu_items (saved)
   menu_items_used = XINT (XCAR (saved));
   saved = XCDR (saved);
   menu_items_n_panes = XINT (XCAR (saved));
-  saved = XCDR (saved);  
+  saved = XCDR (saved);
   menu_items_submenu_depth = XINT (XCAR (saved));
   return Qnil;
 }
@@ -3428,7 +3432,7 @@ menu_help_callback (help_string, pane, item)
     pane_name = first_item[MENU_ITEMS_PANE_NAME];
   else if (EQ (first_item[0], Qquote))
     /* This shouldn't happen, see xmenu_show.  */
-    pane_name = empty_string;
+    pane_name = empty_unibyte_string;
   else
     pane_name = first_item[MENU_ITEMS_ITEM_NAME];
 
index fc3659f..33468f0 100644 (file)
@@ -2678,7 +2678,7 @@ If the value is 0 or the atom is not known, return the empty string.  */)
     ret = make_string (name, strlen (name));
 
   if (atom && name) XFree (name);
-  if (NILP (ret)) ret = make_string ("", 0);
+  if (NILP (ret)) ret = empty_unibyte_string;
 
   UNBLOCK_INPUT;
 
index 512fff3..a5bb506 100644 (file)
@@ -720,8 +720,10 @@ x_draw_fringe_bitmap (w, row, p)
   else
     x_clip_to_row (w, row, -1, gc);
 
-  if (p->bx >= 0 && !p->overlay_p)
+  if (!p->overlay_p)
     {
+      int bx = p->bx, by = p->by, nx = p->nx, ny = p->ny;
+
       /* In case the same realized face is used for fringes and
         for something displayed in the text (e.g. face `region' on
         mono-displays, the fill style may have been changed to
@@ -731,8 +733,55 @@ x_draw_fringe_bitmap (w, row, p)
       else
        XSetForeground (display, face->gc, face->background);
 
-      XFillRectangle (display, window, face->gc,
-                     p->bx, p->by, p->nx, p->ny);
+#ifdef USE_TOOLKIT_SCROLL_BARS
+      /* If the fringe is adjacent to the left (right) scroll bar of a
+        leftmost (rightmost, respectively) window, then extend its
+        background to the gap between the fringe and the bar.  */
+      if ((WINDOW_LEFTMOST_P (w)
+          && WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w))
+         || (WINDOW_RIGHTMOST_P (w)
+             && WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w)))
+       {
+         int sb_width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w);
+
+         if (sb_width > 0)
+           {
+             int left = WINDOW_SCROLL_BAR_AREA_X (w);
+             int width = (WINDOW_CONFIG_SCROLL_BAR_COLS (w)
+                          * FRAME_COLUMN_WIDTH (f));
+
+             if (bx < 0)
+               {
+                 /* Bitmap fills the fringe.  */
+                 if (left + width == p->x)
+                   bx = left + sb_width;
+                 else if (p->x + p->wd == left)
+                   bx = left;
+                 if (bx >= 0)
+                   {
+                     int header_line_height = WINDOW_HEADER_LINE_HEIGHT (w);
+
+                     nx = width - sb_width;
+                     by = WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height,
+                                                           row->y));
+                     ny = row->visible_height;
+                   }
+               }
+             else
+               {
+                 if (left + width == bx)
+                   {
+                     bx = left + sb_width;
+                     nx += width - sb_width;
+                   }
+                 else if (bx + nx == left)
+                   nx += width - sb_width;
+               }
+           }
+       }
+#endif
+      if (bx >= 0 && nx > 0)
+       XFillRectangle (display, window, face->gc, bx, by, nx, ny);
 
       if (!face->stipple)
        XSetForeground (display, face->gc, face->foreground);
@@ -4789,6 +4838,9 @@ x_scroll_bar_create (w, top, left, width, height)
   XSETINT (bar->start, 0);
   XSETINT (bar->end, 0);
   bar->dragging = Qnil;
+#ifdef USE_TOOLKIT_SCROLL_BARS
+  bar->fringe_extended_p = Qnil;
+#endif
 
   /* Add bar to its frame's list of scroll bars.  */
   bar->next = FRAME_SCROLL_BARS (f);
@@ -4981,6 +5033,9 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
   struct scroll_bar *bar;
   int top, height, left, sb_left, width, sb_width;
   int window_y, window_height;
+#ifdef USE_TOOLKIT_SCROLL_BARS
+  int fringe_extended_p;
+#endif
 
   /* Get window dimensions.  */
   window_box (w, -1, 0, &window_y, 0, &window_height);
@@ -5001,15 +5056,9 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
   /* Compute the left edge of the scroll bar.  */
 #ifdef USE_TOOLKIT_SCROLL_BARS
   if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))
-    sb_left = (left +
-              (WINDOW_RIGHTMOST_P (w)
-               ? width - sb_width - (width - sb_width) / 2
-               : 0));
+    sb_left = left + (WINDOW_RIGHTMOST_P (w) ? width - sb_width : 0);
   else
-    sb_left = (left +
-              (WINDOW_LEFTMOST_P (w)
-               ? (width - sb_width) / 2
-               : width - sb_width));
+    sb_left = left + (WINDOW_LEFTMOST_P (w) ? 0 : width - sb_width);
 #else
   if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))
     sb_left = left + width - sb_width;
@@ -5017,14 +5066,33 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
     sb_left = left;
 #endif
 
+#ifdef USE_TOOLKIT_SCROLL_BARS
+  if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w))
+    fringe_extended_p = (WINDOW_LEFTMOST_P (w)
+                        && WINDOW_LEFT_FRINGE_WIDTH (w)
+                        && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
+                            || WINDOW_LEFT_MARGIN_COLS (w) == 0));
+  else
+    fringe_extended_p = (WINDOW_RIGHTMOST_P (w)
+                        && WINDOW_RIGHT_FRINGE_WIDTH (w)
+                        && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
+                            || WINDOW_RIGHT_MARGIN_COLS (w) == 0));
+#endif
+
   /* Does the scroll bar exist yet?  */
   if (NILP (w->vertical_scroll_bar))
     {
       if (width > 0 && height > 0)
        {
          BLOCK_INPUT;
-         x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
-                       left, top, width, height, False);
+#ifdef USE_TOOLKIT_SCROLL_BARS
+         if (fringe_extended_p)
+           x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+                         sb_left, top, sb_width, height, False);
+         else
+#endif
+           x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+                         left, top, width, height, False);
          UNBLOCK_INPUT;
        }
 
@@ -5051,13 +5119,19 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
 #ifdef USE_TOOLKIT_SCROLL_BARS
 
       /* Move/size the scroll bar widget.  */
-      if (mask)
+      if (mask || !NILP (bar->fringe_extended_p) != fringe_extended_p)
        {
          /* Since toolkit scroll bars are smaller than the space reserved
             for them on the frame, we have to clear "under" them.  */
          if (width > 0 && height > 0)
-           x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
-                          left, top, width, height, False);
+           {
+             if (fringe_extended_p)
+               x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+                             sb_left, top, sb_width, height, False);
+             else
+               x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+                             left, top, width, height, False);
+           }
 #ifdef USE_GTK
           xg_update_scrollbar_pos (f,
                                    SCROLL_BAR_X_WINDOW (bar),
@@ -5132,6 +5206,8 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
     }
 
 #ifdef USE_TOOLKIT_SCROLL_BARS
+  bar->fringe_extended_p = fringe_extended_p ? Qt : Qnil;
+
   x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole);
 #else /* not USE_TOOLKIT_SCROLL_BARS */
   /* Set the scroll bar's current state, unless we're currently being
@@ -8359,7 +8435,7 @@ wm_supports (f, atomname)
                            prop_atom, 0, max_len, False, target_type,
                            &actual_type, &actual_format, &actual_size,
                            &bytes_remaining, &tmp_data);
-  
+
   if (rc != Success || actual_type != XA_WINDOW || x_had_errors_p (dpy))
     {
       if (tmp_data) XFree (tmp_data);
@@ -8414,7 +8490,7 @@ wm_supports (f, atomname)
   rc = 0;
   want_atom = XInternAtom (dpy, atomname, False);
 
-  for (i = 0; rc == 0 && i < dpyinfo->nr_net_supported_atoms; ++i) 
+  for (i = 0; rc == 0 && i < dpyinfo->nr_net_supported_atoms; ++i)
     rc = dpyinfo->net_supported_atoms[i] == want_atom;
 
   x_uncatch_errors ();
@@ -8855,38 +8931,36 @@ x_lower_frame (f)
     }
 }
 
+/* Activate frame with Extended Window Manager Hints */
+
+void
+x_ewmh_activate_frame (f)
+     FRAME_PTR f;
+{
+  /* See Window Manager Specification/Extended Window Manager Hints at
+     http://freedesktop.org/wiki/Standards_2fwm_2dspec  */
+
+  const char *atom = "_NET_ACTIVE_WINDOW";
+  if (f->async_visible && wm_supports (f, atom))
+    {
+      Lisp_Object frame;
+      XSETFRAME (frame, f);
+      Fx_send_client_event (frame, make_number (0), frame,
+                            make_unibyte_string (atom, strlen (atom)),
+                            make_number (32),
+                            Fcons (make_number (1),
+                                   Fcons (make_number (last_user_time),
+                                          Qnil)));
+    }
+}
+
 static void
 XTframe_raise_lower (f, raise_flag)
      FRAME_PTR f;
      int raise_flag;
 {
   if (raise_flag)
-    {
-      /* The following code is needed for `raise-frame' to work on
-        some versions of metacity; see Window Manager
-        Specification/Extended Window Manager Hints at
-        http://freedesktop.org/wiki/Standards_2fwm_2dspec  */
-
-#if 0
-      /* However, on other versions (metacity 2.17.2-1.fc7), it
-        reportedly causes hangs when resizing frames.  */
-
-      const char *atom = "_NET_ACTIVE_WINDOW";
-      if (f->async_visible && wm_supports (f, atom))
-        {
-          Lisp_Object frame;
-          XSETFRAME (frame, f);
-          Fx_send_client_event (frame, make_number (0), frame,
-                                make_unibyte_string (atom, strlen (atom)),
-                                make_number (32),
-                                Fcons (make_number (1),
-                                       Fcons (make_number (last_user_time),
-                                              Qnil)));
-        }
-      else
-#endif
-        x_raise_frame (f);
-    }
+    x_raise_frame (f);
   else
     x_lower_frame (f);
 }
@@ -10651,7 +10725,7 @@ x_term_init (display_name, xrm_option, resource_name)
            UNBLOCK_INPUT;
            dpyinfo->kboard->Vsystem_key_alist
              = call1 (Qvendor_specific_keysyms,
-                      build_string (vendor ? vendor : ""));
+                      vendor ? build_string (vendor) : empty_unibyte_string);
            BLOCK_INPUT;
          }
 
index ad768e3..edb35c1 100644 (file)
@@ -807,6 +807,12 @@ struct scroll_bar
      place where the user grabbed it.  If the handle isn't currently
      being dragged, this is Qnil.  */
   Lisp_Object dragging;
+
+#ifdef USE_TOOLKIT_SCROLL_BARS
+  /* t if the background of the fringe that is adjacent to a scroll
+     bar is extended to the gap between the fringe and the bar.  */
+  Lisp_Object fringe_extended_p;
+#endif
 };
 
 /* The number of elements a vector holding a struct scroll_bar needs.  */
@@ -988,6 +994,7 @@ extern void x_fully_uncatch_errors P_ ((void));
 extern void x_set_window_size P_ ((struct frame *, int, int, int));
 extern void x_set_mouse_position P_ ((struct frame *, int, int));
 extern void x_set_mouse_pixel_position P_ ((struct frame *, int, int));
+extern void x_ewmh_activate_frame P_ ((struct frame *));
 extern void x_raise_frame P_ ((struct frame *));
 extern void x_lower_frame P_ ((struct frame *));
 extern void x_make_frame_visible P_ ((struct frame *));