changeset 90601:a1a25ac6c88a

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 427-436) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 134-136) - Merge from emacs--devo--0 - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-110
author Miles Bader <miles@gnu.org>
date Thu, 14 Sep 2006 09:24:00 +0000
parents 84dd84b43e1b (current diff) a15bb5250347 (diff)
children b5c13d1564a9
files AUTHORS ChangeLog admin/FOR-RELEASE etc/ChangeLog etc/NEWS etc/PROBLEMS etc/TODO leim/ChangeLog leim/quail/uni-input.el lisp/ChangeLog lisp/bindings.el lisp/calc/calc.el lisp/comint.el lisp/cus-edit.el lisp/cus-start.el lisp/desktop.el lisp/diff-mode.el lisp/dired-aux.el lisp/dired.el lisp/emacs-lisp/bindat.el lisp/emacs-lisp/cl.el lisp/emacs-lisp/eldoc.el lisp/emacs-lisp/timer.el lisp/filecache.el lisp/files.el lisp/frame.el lisp/gnus/ChangeLog lisp/gnus/gnus-art.el lisp/gnus/pop3.el lisp/gnus/rfc2047.el lisp/help.el lisp/ido.el lisp/info.el lisp/locate.el lisp/lpr.el lisp/mail/rmail.el lisp/mail/smtpmail.el lisp/net/ldap.el lisp/net/rcirc.el lisp/novice.el lisp/pcvs-defs.el lisp/play/life.el lisp/progmodes/cfengine.el lisp/progmodes/compile.el lisp/progmodes/idlwave.el lisp/progmodes/prolog.el lisp/progmodes/python.el lisp/simple.el lisp/startup.el lisp/subr.el lisp/term/mac-win.el lisp/textmodes/fill.el lisp/textmodes/flyspell.el lisp/textmodes/org.el lisp/thingatpt.el lisp/window.el lispref/ChangeLog lispref/display.texi lispref/frames.texi lispref/keymaps.texi lispref/objects.texi lispref/processes.texi lispref/windows.texi make-dist man/ChangeLog man/building.texi man/faq.texi man/files.texi man/gnus.texi man/misc.texi man/reftex.texi man/search.texi man/smtpmail.texi src/ChangeLog src/Makefile.in src/casetab.c src/config.in src/dispextern.h src/dispnew.c src/editfns.c src/emacs.c src/eval.c src/gtkutil.c src/keyboard.c src/keymap.c src/mac.c src/macfns.c src/macmenu.c src/macterm.c src/msdos.c src/print.c src/process.c src/process.h src/search.c src/textprop.c src/w32menu.c src/w32term.c src/xdisp.c src/xfns.c src/xmenu.c src/xterm.c src/xterm.h
diffstat 109 files changed, 3137 insertions(+), 1656 deletions(-) [+]
line wrap: on
line diff
--- a/AUTHORS	Wed Sep 06 07:30:39 2006 +0000
+++ b/AUTHORS	Thu Sep 14 09:24:00 2006 +0000
@@ -12,7 +12,7 @@
 Abramo Bagnara: changed term.c
 
 Adrian Aichner: changed erc-log.el erc.el erc-autojoin.el erc-backend.el
-  erc-dcc.el erc-members.el erc-nets.el erc-sound.el
+  erc-dcc.el erc-members.el erc-nets.el erc-sound.el etags.c
 
 Adrian Colley: changed aix3-2.h
 
@@ -46,7 +46,7 @@
 
 Alex Coventry: changed files.el
 
-Alex Ott: changed TUTORIAL.ru ispell.el ru-refcard.ps ru-refcard.tex
+Alex Ott: changed TUTORIAL.ru ru-refcard.tex ispell.el ru-refcard.ps
 
 Alex Rezinsky: wrote which-func.el
 
@@ -56,8 +56,8 @@
 and changed erc.el erc-track.el erc-button.el erc-stamp.el erc-match.el
   erc-autoaway.el erc-nickserv.el Makefile erc-autojoin.el erc-fill.el
   erc-pcomplete.el erc-complete.el erc-ibuffer.el erc-members.el
-  comint.el custom.el erc-bbdb.el erc-chess.el erc-ezbounce.el
-  erc-imenu.el erc-page.el and 24 other files
+  rcirc.texi comint.el custom.el erc-bbdb.el erc-chess.el erc-ezbounce.el
+  erc-imenu.el and 24 other files
 
 Alexander Klimov: changed man.el
 
@@ -80,6 +80,8 @@
 
 Alfred M. Szmidt: changed compile.el html2text.el
 
+Alfredo Finelli: changed TUTORIAL.it
+
 Ami Fischman: changed calendar.el diary-lib.el
 
 Anders Holst: wrote hippie-exp.el
@@ -110,12 +112,13 @@
 Andreas Luik: changed xfns.c xterm.c
 
 Andreas Schwab: changed Makefile.in files.el lisp.h xdisp.c alloc.c
-  configure.in fns.c coding.c dired.el editfns.c info.el eval.c fileio.c
-  print.c simple.el buffer.c minibuf.c xterm.c emacs.c keyboard.c
+  configure.in fns.c coding.c dired.el editfns.c info.el print.c eval.c
+  fileio.c simple.el buffer.c minibuf.c xterm.c emacs.c keyboard.c
   process.c and 443 other files
 
-Andreas Seltenreich: changed nnweb.el gnus-art.el gnus-ml.el gnus.texi
-  url-cookie.el url-http.el
+Andreas Seltenreich: changed nnweb.el gnus-art.el gnus-ml.el gnus-srvr.el
+  gnus-start.el gnus-util.el gnus.el gnus.texi mm-url.el url-cookie.el
+  url-http.el
 
 Andrew Choi: wrote mac-win.el
 and changed macterm.c mac.c macfns.c INSTALL macmenu.c darwin.h macterm.h
@@ -189,6 +192,8 @@
 Benjamin Rutt: changed vc.el diff-mode.el ffap.el nnmbox.el simple.el
   vc-cvs.el
 
+Bill Atkins: changed wdired.el
+
 Bill Burton: changed ptx.h sequent-ptx.h
 
 Bill Carpenter: wrote feedmail.el (public domain)
@@ -304,10 +309,10 @@
 Cheng Gao: changed MORE.STUFF flymake.el tips.texi url-dired.el
   url-file.el url-handlers.el url-http.el url-nfs.el
 
-Chong Yidong: changed custom.el cus-edit.el longlines.el display.texi
-  files.el files.texi simple.el text.texi custom.texi cus-theme.el
-  wid-edit.el xterm.c frames.texi info.el misc.texi mouse.el xfns.c
-  anti.texi dired.texi image.c keymaps.texi and 131 other files
+Chong Yidong: changed cus-edit.el custom.el display.texi longlines.el
+  files.el simple.el text.texi custom.texi files.texi cus-theme.el
+  info.el keyboard.c wid-edit.el xterm.c frames.texi image-mode.el
+  misc.texi mouse.el sendmail.el xfns.c anti.texi and 152 other files
 
 Chris Hanson: changed xscheme.el scheme.el xterm.c hpux.h x11term.c
   hp9000s300.h keyboard.c process.c texinfmt.el emacsclient.c sort.el
@@ -378,10 +383,10 @@
   gnus-group.el gnus-score.el nnmail.el
 
 Dan Nicolaescu: wrote iris-ansi.el romanian.el
-and changed term.el hideshow.el xterm.el isearch.el icon.el cus-edit.el
-  font-lock.el lisp.h sh-script.el eterm-color.ti faces.el rxvt.el
-  vhdl-mode.el bindings.el compile.el dabbrev.el grep.el ibuffer.el
-  imenu.el outline.el replace.el and 153 other files
+and changed term.el xterm.el hideshow.el isearch.el icon.el lisp.h
+  cus-edit.el font-lock.el sh-script.el eterm-color.ti faces.el
+  ibuffer.el rxvt.el vhdl-mode.el xterm.c bindings.el compile.el
+  dabbrev.el grep.el imenu.el outline.el and 159 other files
 
 Daniel Brockman: changed cus-start.el format-spec.el ibuffer.el rcirc.el
 
@@ -542,7 +547,7 @@
   erc-track.el erc-nets.el erc-backend.el erc-list.el erc-nickserv.el
   erc-autoaway.el erc-stamp.el erc-compat.el erc-goodies.el erc-log.el
   Makefile erc-fill.el erc-ibuffer.el erc-notify.el erc-ring.el
-  erc-speak.el erc-speedbar.el and 22 other files
+  erc-speak.el erc-speedbar.el and 25 other files
 
 Dick King: wrote uniquify.el
 
@@ -584,8 +589,8 @@
 
 Edward O'connor: changed erc.el erc-viper.el erc-log.el erc-track.el
   viper.el erc-backend.el erc-chess.el erc-dcc.el erc-ezbounce.el
-  erc-list.el erc-macs.el erc-match.el erc-ring.el erc-stamp.el
-  goto-addr.el
+  erc-goodies.el erc-list.el erc-macs.el erc-match.el erc-ring.el
+  erc-stamp.el goto-addr.el
 
 Edwin Steiner: changed gnus-nocem.el
 
@@ -601,8 +606,8 @@
 Eli Zaretskii: wrote codepage.el rxvt.el tty-colors.el
 and changed msdos.c Makefile.in files.el makefile.w32-in info.el fileio.c
   startup.el mainmake.v2 config.bat menu-bar.el pc-win.el simple.el
-  internal.el msdos.h xfaces.c rmail.el dosfns.c frame.c faces.el emacs.c
-  frame.el and 512 other files
+  internal.el msdos.h xfaces.c frame.c rmail.el dosfns.c faces.el
+  frame.el emacs.c and 514 other files
 
 Emanuele Giaquinta: changed rxvt.el configure.in etags.c frame.el
   sh-script.el text.texi
@@ -628,8 +633,8 @@
 Eric Ding: wrote goto-addr.el
 and changed mh-utils.el mh-e.el mh-comp.el mh-mime.el
 
-Eric Hanchrow: changed TUTORIAL.es abbrev.el autorevert.el dired.el
-  emacsclient.c ispell.el make-dist
+Eric Hanchrow: changed TUTORIAL.es abbrev.el autorevert.el delphi.el
+  dired.el emacsclient.c ispell.el make-dist
 
 Eric M. Ludlam: wrote checkdoc.el dframe.el ezimage.el sb-image.el
   speedbar.el
@@ -686,6 +691,8 @@
 Florian Weimer: changed message.el coding.c gnus-art.el gnus.el gnus.texi
   mm-util.el
 
+Francesc Rocher: changed cus-start.el macterm.c w32term.c xdisp.c xterm.c
+
 Francesco Potort,Al(B: wrote cmacexp.el
 and changed etags.c man.el delta.h undigest.el comint.el configure.in
   uniquify.el etags.1 latin-post.el rmail.el etags.el latin-alt.el
@@ -699,7 +706,7 @@
   erc-button.el erc-goodies.el erc-nets.el erc-ring.el Makefile
   erc-pcomplete.el erc-backend.el erc-ibuffer.el erc-match.el
   erc-nickserv.el erc-page.el erc-speedbar.el keymaps.texi message.el
-  os.texi saveplace.el xterm.c xterm.h
+  os.texi saveplace.el w32term.c and 3 other files
 
 Francois Felix Ingrand: changed gnus-salt.el
 
@@ -824,7 +831,7 @@
 
 Gunnar Horrigmo: changed gnus-sum.el
 
-Gustav H,Ae(Bllberg: changed compile.el
+Gustav H,Ae(Bllberg: changed compile.el rect.el
 
 Guy Geens: changed gnus-score.el
 
@@ -959,9 +966,9 @@
 
 Jan Dj,Ad(Brv: wrote dnd.el x-dnd.el
 and changed gtkutil.c xterm.c xfns.c xmenu.c xterm.h gtkutil.h
-  configure.in Makefile.in config.in configure frames.texi keyboard.c
-  emacs.c x-win.el xselect.c xlwmenu.c alloc.c startup.el xdisp.c
-  xresources.texi fileio.c and 168 other files
+  configure.in keyboard.c Makefile.in config.in configure frames.texi
+  emacs.c x-win.el xselect.c alloc.c xlwmenu.c startup.el xdisp.c
+  xresources.texi fileio.c and 171 other files
 
 Jan Nieuwenhuizen: changed info.el TUTORIAL.nl emacs.c emacsclient.c
   gnus-start.el gud.el nnmh.el server.el startup.el
@@ -983,13 +990,13 @@
 and changed w32fns.c w32term.c w32menu.c w32-win.el w32term.h
   makefile.w32-in w32.c w32bdf.c w32-fns.el w32select.c w32console.c
   w32gui.h w32proc.c keyboard.c mule-cmds.el emacs.c fileio.c w32bdf.h
-  w32inevt.c config.nt configure.bat and 77 other files
+  w32inevt.c config.nt configure.bat and 78 other files
 
 Jay Belanger: changed calc.texi calc.el calc-ext.el calc-embed.el
   calc-aent.el calc-prog.el calc-arith.el calc-help.el calc-lang.el
   calcalg2.el calc-graph.el calc-store.el calc-units.el calc-misc.el
   calc-yank.el calc-alg.el calc-poly.el calccomp.el calc-mode.el
-  calc-vec.el calc-forms.el and 26 other files
+  calc-rewr.el calc-sel.el and 26 other files
 
 Jay K. Adams: wrote jka-cmpr-hook.el jka-compr.el
 
@@ -1056,6 +1063,8 @@
 
 Jim Wilson: changed Makefile.in alloca.c
 
+Jindrich Makovicka: changed eval.c fns.c
+
 Jirka Kosek: changed mule.el
 
 Joakim Hove: wrote html2text.el
@@ -1110,7 +1119,7 @@
 
 John H. Palmieri: changed gnus-fun.el
 
-John Heidemann: wrote mouse-copy.el mouse-drag.el zone-mode.el
+John Heidemann: wrote mouse-copy.el mouse-drag.el
 
 John Hughes: changed term.c
 
@@ -1118,8 +1127,8 @@
 
 John Paul Wallington: changed ibuffer.el ibuf-ext.el subr.el files.el
   help-fns.el thumbs.el fns.c rmail.el bindings.el bytecomp.el
-  cus-theme.el info.el re-builder.el startup.el xfns.c apropos.el
-  arc-mode.el browse-url.el comint.el cus-start.el display.texi
+  cus-theme.el info.el re-builder.el simple.el startup.el xfns.c
+  apropos.el arc-mode.el browse-url.el comint.el cus-start.el
   and 115 other files
 
 John Robinson: wrote bg-mouse.el
@@ -1166,7 +1175,7 @@
   erc-button.el erc-fill.el erc-truncate.el erc-compat.el erc-members.el
   Makefile erc-dcc.el erc-ibuffer.el erc-page.el erc-pcomplete.el
   erc-sound.el erc-bbdb.el erc-imenu.el erc-lang.el erc-list.el
-  erc-macs.el and 8 other files
+  erc-macs.el and 9 other files
 
 Jose E. Marchesi: changed smtpmail.el
 
@@ -1209,7 +1218,7 @@
 Juri Linkov: changed info.el simple.el isearch.el replace.el compile.el
   faces.el display.texi grep.el descr-text.el cus-edit.el dired.el
   dired-aux.el edebug.el files.el lisp-mode.el lisp.el mule.el
-  compare-w.el desktop.el files.texi font-lock.el and 218 other files
+  compare-w.el desktop.el files.texi font-lock.el and 220 other files
 
 Justin Sheehy: changed gnus-sum.el nntp.el
 
@@ -1236,10 +1245,10 @@
   knd-util.el loadup.el makefile.w32-in
 
 Karl Berry: changed info.texi emacs.texi elisp.texi emacs-xtra.texi
-  filelock.c building.texi cmdargs.texi copyright.el dired.c faq.texi
-  gnu.texi help.texi macos.texi msdog.texi mule.texi sending.texi
-  texinfo.el texinfo.tex abbrevs.texi ada-mode.texi anti.texi
-  and 54 other files
+  filelock.c anti.texi building.texi cmdargs.texi copyright.el
+  customize.texi dired.c faq.texi gnu.texi help.texi macos.texi
+  minibuf.texi msdog.texi mule.texi sending.texi texinfo.el texinfo.tex
+  and 64 other files
 
 Karl Chen: changed files.el align.el cc-vars.el gnus-art.el help-mode.el
   jka-cmpr-hook.el make-mode.el perl-mode.el python.el tex-mode.el
@@ -1249,8 +1258,8 @@
   dired.el info.el menu-bar.el midnight.el po.el
 
 Karl Fogel: wrote bookmark.el mail-hist.el saveplace.el
-and changed isearch.el menu-bar.el autogen.sh editfns.c vc-svn.el
-  window.c
+and changed isearch.el menu-bar.el autogen.sh editfns.c nnmail.el
+  vc-svn.el window.c
 
 Karl Heuer: changed keyboard.c lisp.h xdisp.c buffer.c xfns.c xterm.c
   alloc.c files.el frame.c configure.in window.c data.c minibuf.c
@@ -1269,8 +1278,8 @@
 Katsumi Yamaoka: wrote canlock.el
 and changed gnus-art.el message.el gnus-sum.el gnus.texi mm-decode.el
   mm-view.el gnus-util.el gnus-msg.el gnus.el mm-util.el lpath.el
-  gnus-start.el gnus-group.el mm-uu.el dgnushack.el gnus-agent.el nntp.el
-  mml.el nnrss.el rfc2047.el rfc2231.el and 69 other files
+  gnus-start.el gnus-group.el mm-uu.el rfc2047.el dgnushack.el
+  gnus-agent.el nntp.el mml.el nnrss.el nnheader.el and 71 other files
 
 Kaveh R. Ghazi: changed delta88k.h xterm.c
 
@@ -1309,7 +1318,7 @@
 and changed coding.c mule-cmds.el mule.el charset.c fileio.c xterm.c
   fns.c ccl.c mule-conf.el Makefile.in fontset.c charset.h coding.h
   fontset.el mule-diag.el xdisp.c editfns.c process.c insdel.c
-  japanese.el characters.el and 276 other files
+  japanese.el characters.el and 277 other files
 
 Kenneth Stailey: changed alpha.h configure.in ns32000.h openbsd.h pmax.h
   sparc.h unexalpha.c unexelf.c
@@ -1345,17 +1354,17 @@
 
 Kevin Ryde: wrote info-xref.el
 and changed info-look.el info.el gnus-art.el gnus-sum.el mailcap.el
-  text.texi MORE.STUFF cc-align.el cmdargs.texi compile.texi display.texi
-  em-alias.el em-dirs.el em-hist.el em-unix.el emacs-lisp-intro.texi
-  ffap.el frames.texi glossary.texi gnus.texi makeinfo.el
+  os.texi text.texi MORE.STUFF cc-align.el cmdargs.texi compile.texi
+  display.texi em-alias.el em-dirs.el em-hist.el em-unix.el
+  emacs-lisp-intro.texi ffap.el frames.texi glossary.texi gnus.texi
   and 12 other files
 
-Kim F. Storm: wrote animage.el bindat.el cua-base.el cua-gmrk.el
-  cua-rect.el ido.el keypad.el kmacro.el
-and changed xdisp.c dispextern.h simple.el xterm.c process.c window.c
-  keyboard.c w32term.c subr.el dispnew.c fringe.c lisp.h macterm.c
-  display.texi fns.c xfaces.c alloc.c xterm.h info.el xfns.c .gdbinit
-  and 226 other files
+Kim F. Storm: wrote bindat.el cua-base.el cua-gmrk.el cua-rect.el
+  ido.el keypad.el kmacro.el
+and changed xdisp.c dispextern.h simple.el xterm.c window.c keyboard.c
+  process.c w32term.c lisp.h subr.el dispnew.c fringe.c macterm.c
+  display.texi alloc.c fns.c xfaces.c xfns.c xterm.h .gdbinit buffer.c
+  and 235 other files
 
 Kim-Minh Kaplan: changed gnus-picon.el gnus-sum.el gnus-start.el
   gnus-win.el gnus-xmas.el gnus.texi message.el nndraft.el nnml.el
@@ -1389,7 +1398,9 @@
 
 Kyotaro Horiguchi: changed coding.c indent.c
 
-K,Aa(Broly L$,1 q(Brentey: changed keyboard.c coding.c xfns.c xterm.c xterm.h
+K,Aa(Broly L$,1 q(Brentey: changed xfns.c bindings.el keyboard.c HELLO authors.el
+  buff-menu.el buffer.c buffers.texi cmds.c coding.c editfns.c frame.el
+  menu-bar.el print.c simple.el xdisp.c xterm.c xterm.h
 
 Larry Kolodney: wrote cvtmail.c
 
@@ -1440,8 +1451,8 @@
 
 Leigh Stoller: changed emacsclient.c emacsserver.c server.el
 
-Lennart Borgman: changed mouse.el recentf.el texinfmt.el w32term.c
-  w32term.h window.el
+Lennart Borgman: changed window.el mouse.el recentf.el texinfmt.el
+  w32term.c w32term.h
 
 Lennart Staflin: changed dired.el diary-ins.el diary-lib.el tq.el xdisp.c
 
@@ -1461,17 +1472,13 @@
   mailabbrev.el select.el xfaces.c xselect.c
 
 Lute Kamstra: changed modes.texi generic.el debug.el generic-x.el
-  font-lock.el subr.el debugging.texi easy-mmode.el elisp.texi hl-line.el
-  simple.el Makefile.in battery.el bindings.el calc.el cmdargs.texi
-  edebug.texi emacs.texi info.el make-tarball.txt octave-inf.el
-  and 217 other files
+  font-lock.el subr.el Makefile.in debugging.texi easy-mmode.el
+  elisp.texi hl-line.el simple.el battery.el bindings.el calc.el
+  cmdargs.texi edebug.texi emacs.texi info.el make-tarball.txt
+  octave-inf.el and 217 other files
 
 Lynn Slater: wrote help-macro.el
 
-L$,1 q(Brentey K,Aa(Broly: changed bindings.el xfns.c buff-menu.el buffer.c
-  buffers.texi cmds.c editfns.c frame.el menu-bar.el print.c simple.el
-  xdisp.c
-
 MCC: wrote xmenu.c
 and changed emacsclient.c emacsserver.c etags.c lisp.h movemail.c
   rmail.el rmailedit.el rmailkwd.el rmailmsc.el rmailout.el rmailsum.el
@@ -1577,9 +1584,10 @@
 
 Martin Neitzel: changed sc.el
 
-Martin Rudalics: changed cus-edit.el wid-edit.el font-lock.el syntax.c
-  custom.el fileio.c files.el find-func.el hideif.el info.el insdel.c
-  lisp-mode.el midnight.el mouse.el mwheel.el re-builder.el widget.el
+Martin Rudalics: changed cus-edit.el wid-edit.el font-lock.el insdel.c
+  syntax.c buffer.c buffer.h casefiddle.c cus-start.el custom.el
+  editfns.c fileio.c files.el find-func.el hideif.el info.el jit-lock.el
+  lisp-mode.el lisp.h midnight.el mouse.el and 5 other files
 
 Martin Stjernholm: wrote cc-bytecomp.el
 and changed cc-engine.el cc-cmds.el cc-langs.el cc-defs.el cc-mode.el
@@ -1598,7 +1606,7 @@
 and changed etags.el asm-mode.el xdisp.c bindings.el hexl.el man.el
   simple.el wid-edit.el compile.el faces.el pcvs.el register.el
   ruler-mode.el add-log.el buffer.c cus-face.el dired-x.el display.texi
-  font-lock.el gdb-ui.el gud.el and 56 other files
+  etags.c font-lock.el gdb-ui.el and 57 other files
 
 Masayuki Ataka: changed texinfmt.el texinfo.el characters.el make-mode.el
 
@@ -1679,18 +1687,18 @@
   viper-utils.el appt.el desktop.el ediff-meta.el ediff-nult.el
   ediff.texi viper-mouse.el viper.texi
 
-Michael Olson: changed erc.el erc-backend.el Makefile erc-stamp.el
-  erc-track.el erc-dcc.el erc-identd.el erc-match.el erc-notify.el
-  erc.texi erc-ibuffer.el erc-list.el erc-autoaway.el erc-bbdb.el
-  erc-compat.el erc-goodies.el erc-log.el erc-nicklist.el
-  erc-pcomplete.el erc-spelling.el erc-*.el and 39 other files
+Michael Olson: changed erc.el erc-backend.el Makefile erc.texi
+  erc-stamp.el erc-log.el erc-autoaway.el erc-identd.el erc-track.el
+  erc-match.el erc-dcc.el erc-notify.el erc-goodies.el erc-ibuffer.el
+  erc-list.el erc-pcomplete.el erc-spelling.el erc-bbdb.el erc-compat.el
+  erc-nicklist.el erc-*.el and 41 other files
 
 Michael Piotrowski: changed ps-print.el
 
 Michael R. Cook: changed gnus-topic.el gnus-art.el gnus-sum.el
 
-Michael R. Mauger: changed sql.el cua-base.el facemenu.el recentf.el
-  replace.el tramp.el w32fns.c
+Michael R. Mauger: changed sql.el cua-base.el custom.el facemenu.el
+  recentf.el replace.el tramp.el w32fns.c
 
 Michael R. Wolf: changed ange-ftp.el
 
@@ -1712,7 +1720,7 @@
 Michal Jankowski: changed insdel.c keyboard.c
 
 Micha,Ak(Bl Cadilhac: changed ispell.el dispnew.c make-mode.el pong.el
-  print.c process.c
+  print.c process.c startup.el
 
 Michelangelo Grigni: wrote ffap.el
 and changed gnus-score.el
@@ -1779,6 +1787,8 @@
 Nagy Andras: wrote gnus-sieve.el
 and changed imap.el
 
+Nakaji Hiroyuki: changed mm-util.el
+
 Nakamura Toshikazu: changed w32fns.c
 
 NeXT, Inc.: wrote unexnext.c
@@ -1799,10 +1809,10 @@
 Niall Mansfield: changed etags.c
 
 Nick Roberts: wrote gdb-ui.el
-and changed gud.el building.texi tooltip.el speedbar.el thumbs.el
-  cc-mode.el DEBUG subr.el xt-mouse.el .gdbinit comint.el frames.texi
-  bindings.el descr-text.el display.texi gud-display.pbm help-mode.el
-  speedbar.texi tumme.el xdisp.c byte-run.el and 105 other files
+and changed gud.el building.texi tooltip.el speedbar.el thumbs.el DEBUG
+  cc-mode.el frames.texi subr.el xt-mouse.el .gdbinit bindings.el
+  comint.el display.texi help-mode.el descr-text.el gud-display.pbm
+  speedbar.texi tumme.el xdisp.c byte-run.el and 112 other files
 
 Nico Francois: changed w32fns.c w32inevt.c w32menu.c
 
@@ -1976,6 +1986,8 @@
 
 Pmr-Sav: changed mail-utils.el rmail.el
 
+Primoz Peterlin: changed TUTORIAL.sl
+
 R. Bernstein: changed gud.el
 
 Rafael Sep,Az(Blveda: changed TUTORIAL.es
@@ -1993,8 +2005,9 @@
 and changed ffap.el
 
 Ralf Angeli: wrote scroll-lock.el
-and changed tex-mode.el comint.el flow-fill.el gnus-art.el killing.texi
-  mm-view.el pcl-cvs.texi smtpmail.el w32fns.c w32term.c window.c
+and changed w32fns.c tex-mode.el comint.el flow-fill.el frame.el
+  gnus-art.el killing.texi mm-view.el pcl-cvs.texi smtpmail.el w32term.c
+  window.c
 
 Ralf Fassel: changed dabbrev.el files.el fill.el iso-acc.el tar-mode.el
 
@@ -2015,11 +2028,11 @@
 and changed gnus-art.el gnus-msg.el gnus.texi message.el nnmail.el
 
 Reiner Steib: wrote gmm-utils.el
-and changed message.el gnus-art.el gnus.texi gnus-sum.el gnus.el
+and changed gnus-art.el message.el gnus.texi gnus-sum.el gnus.el
   gnus-group.el mml.el gnus-faq.texi gnus-score.el gnus-start.el
   gnus-util.el gnus-msg.el message.texi gnus-agent.el files.el mm-util.el
   spam-report.el nnweb.el spam.el deuglify.el mm-decode.el
-  and 155 other files
+  and 156 other files
 
 Remek Trzaska: changed gnus-ems.el
 
@@ -2029,6 +2042,8 @@
 
 Reto Zimmermann: changed vhdl-mode.el
 
+Richard Bielawski: changed modes.texi
+
 Richard Dawe: changed Makefile.in config.in
 
 Richard G Bielawski: changed paren.el
@@ -2045,8 +2060,8 @@
   easymenu.el font-lock.el image-mode.el menu-bar.el paren.el
 and changed keyboard.c files.el simple.el xterm.c xdisp.c rmail.el
   fileio.c process.c sysdep.c xfns.c buffer.c Makefile.in window.c
-  configure.in subr.el emacs.c sendmail.el startup.el editfns.c info.el
-  dispnew.c and 1322 other files
+  configure.in subr.el editfns.c emacs.c sendmail.el startup.el info.el
+  dispnew.c and 1331 other files
 
 Richard Mlynarik: wrote cl-indent.el ebuff-menu.el ehelp.el env.c
   rfc822.el terminal.el yow.el
@@ -2075,11 +2090,12 @@
 Robert Fenk: changed desktop.el
 
 Robert J. Chassell: wrote makeinfo.el texinfo.el texnfo-upd.el
-and changed texinfmt.el page-ext.el emacs.tex info.el loaddefs.el
-  texinfo-update.el INSTALL case-table.el cl.texinfo
-  emacs-lisp-intro.texi history.el informat.el latin-1.el latin-2.el
-  latin-3.el latin-4.el page.el tex-mode.el texinfo.tex texinfo.texinfo
-  vip.texinfo
+and changed texinfmt.el page-ext.el emacs.tex emacs-lisp-intro.texi
+  info.el loaddefs.el texinfo-update.el texinfo.tex INSTALL case-table.el
+  cl.texinfo history.el informat.el latin-1.el latin-2.el latin-3.el
+  latin-4.el page.el tex-mode.el texinfo.texinfo vip.texinfo
+
+Robert Thorpe: changed cus-start.el
 
 Roderick Schertler: changed dgux.h dgux4.h gud.el sysdep.c
 
@@ -2106,11 +2122,11 @@
 Rolf Ebert: wrote ada-mode.el
 and changed files.el find-file.el
 
-Romain Francoise: changed faq.texi ibuf-ext.el compile.el dired-x.el
+Romain Francoise: changed faq.texi dired-x.el ibuf-ext.el compile.el
   message.el puresize.h replace.el files.texi gnus-fun.el gnus.texi
   help-fns.el make-dist rcirc.el subr.el Makefile.in antlr-mode.el
   bookmark.el buffer.c comint.el diary-lib.el dired.el
-  and 109 other files
+  and 119 other files
 
 Roman Belenov: changed which-func.el
 
@@ -2226,7 +2242,7 @@
 
 Skip Collins: changed w32fns.c w32term.c w32term.h
 
-Slawomir Nowaczyk: changed TUTORIAL.pl flyspell.el ls-lisp.el
+Slawomir Nowaczyk: changed TUTORIAL.pl emacs.py flyspell.el ls-lisp.el
 
 Spencer Thomas: changed dabbrev.el emacsclient.c emacsserver.c gnus.texi
   server.el tcp.c unexec.c
@@ -2238,8 +2254,8 @@
   reveal.el smerge-mode.el
 and changed vc.el font-lock.el pcvs.el newcomment.el subr.el lisp.h
   keyboard.c tex-mode.el fill.el keymap.c alloc.c compile.el
-  easy-mmode.el simple.el info.el regex.c syntax.c files.el vc-hooks.el
-  xdisp.c bytecomp.el and 505 other files
+  easy-mmode.el files.el simple.el info.el regex.c syntax.c vc-hooks.el
+  xdisp.c sh-script.el and 509 other files
 
 Stephan Stahl: changed which-func.el buff-menu.el buffer.c dired-x.texi
   ediff-mult.el
@@ -2286,6 +2302,8 @@
 
 Stewart M. Clamen: wrote cal-mayan.el
 
+Stuart D. Herring: changed minibuf.c
+
 Stuart Herring: changed isearch.el align.el allout.el comint.el edebug.el
   files.el
 
@@ -2300,7 +2318,7 @@
 Sundar Narasimhan: changed rnews.el rnewspost.el
 
 Sven Joachim: changed arc-mode.el de-refcard.tex files.el files.texi
-  help.el sed3v2.inp sh-script.el
+  help.el mule.texi sed3v2.inp sh-script.el
 
 Svend Tollak Munkejord: changed deuglify.el
 
@@ -2342,9 +2360,9 @@
 
 Thien-Thi Nguyen: wrote hideshow.el make-mms-derivative.el
 and changed ewoc.el info.el processes.texi zone.el Makefile.in vc.el
-  fileio.c lisp-mode.el scheme.el dcl-mode.el display.texi files.el
-  pcvs.el sysdep.c MORE.STUFF TUTORIAL.it TUTORIAL.ja bindat.el
-  diary-lib.el diff-mode.el dired.el and 121 other files
+  fileio.c lisp-mode.el scheme.el text.texi bindat.el dcl-mode.el
+  display.texi files.el pcvs.el sysdep.c MORE.STUFF TUTORIAL.it
+  TUTORIAL.ja diary-lib.el diff-mode.el and 125 other files
 
 Thierry Emery: changed kinsoku.el timezone.el url-http.el wid-edit.el
 
@@ -2476,7 +2494,7 @@
 Werner Benger: changed keyboard.c
 
 Werner Lemberg: wrote sisheng.el vntelex.el
-and changed Makefile.in TUTORIAL.de calc.texi chinese.el czech.el
+and changed TUTORIAL.de Makefile.in calc.texi chinese.el czech.el
   european.el idlwave.el reftex-vars.el reftex.el reftex.texi slovak.el
   supercite.el .cvsignore advice.el calc-forms.el calc-sel.el calendar.el
   china-util.el cl-macs.el cl.texi complete.el and 43 other files
@@ -2526,15 +2544,17 @@
 
 Yagi Tatsuya: changed gnus-art.el gnus-start.el
 
-Yamamoto Mitsuharu: changed macterm.c macfns.c mac-win.el mac.c macterm.h
-  macgui.h image.c macmenu.c macselect.c keyboard.c xdisp.c makefile.MPW
+Yamamoto Mitsuharu: changed macterm.c mac-win.el macfns.c mac.c macterm.h
+  macgui.h image.c macmenu.c macselect.c keyboard.c makefile.MPW xdisp.c
   emacs.c macos.texi xfaces.c Makefile.in config.h darwin.h dispextern.h
-  w32term.c Info.plist and 58 other files
+  w32term.c Info.plist and 61 other files
 
 Yann Dirson: changed imenu.el
 
 Yoichi Nakayama: changed browse-url.el finder.el man.el rfc2368.el
 
+Yoni Rabkin Katzenell: changed whitespace.el
+
 Yoshiki Hayashi: changed texinfmt.el nnheader.el
 
 Yoshinori Koseki: changed fontset.el
--- a/ChangeLog	Wed Sep 06 07:30:39 2006 +0000
+++ b/ChangeLog	Thu Sep 14 09:24:00 2006 +0000
@@ -1,3 +1,12 @@
+2006-09-11  Paul Eggert  <eggert@cs.ucla.edu>
+
+	* make-dist (EMACS): Exit and fail if the EMACS environment
+	variable is set to something other than an absolute file name.
+
+2006-09-07  Kim F. Storm  <storm@cua.dk>
+
+	* AUTHORS: Regenerate.
+
 2006-08-16  Andreas Schwab  <schwab@suse.de>
 
 	* configure.in (PKG_CHECK_MODULES): Use AS_MESSAGE_LOG_FD instead
--- a/admin/FOR-RELEASE	Wed Sep 06 07:30:39 2006 +0000
+++ b/admin/FOR-RELEASE	Thu Sep 14 09:24:00 2006 +0000
@@ -49,30 +49,21 @@
 
 * BUGS
 
-** How rcirc puts cursor at bottom.
-
-** rcirc uses member*.
-
 ** Field handling in C-n.
 
-** cursor display on images that don't use :mask.
-
 ** C-g fails to interrupt accept-process-output in Gnus.
   (Is that fixed?)
 
-** Make key-binding use the maps specified by positions given in the events.
+** allout.el patch from Manheimer to be installed.
 
-** Is it necessary to solve in another way the problem that was solved
- by Satyaki Das's removed pgg patches?
-
-** mouse-autoselect-window delay patch
+** regex char class matching needs a call to char-syntax.
 
-** Bug in woman, Juri Linkov, Sep 3.
+** regex char class matching breaks if you change entries
+in the syntax table.
 
-** Problem of passing temp files to GPG thru call-process.
+** Handa's Sep 6 compilation font lock bug report.
 
-** Image scrolling problems reported by David Kastrup.  (KFS working).
-
+** Michael Cadilhac's Sep 7 bug report about set-input-method.
 
 * DOCUMENTATION
 
--- a/etc/ChangeLog	Wed Sep 06 07:30:39 2006 +0000
+++ b/etc/ChangeLog	Thu Sep 14 09:24:00 2006 +0000
@@ -1,3 +1,15 @@
+2006-09-11  Paul Eggert  <eggert@cs.ucla.edu>
+
+	* NEWS: In terminal-oriented subshells, the EMACS environment
+	variable now defaults to Emacs's absolute file name, instead of
+	to "t".
+	* PROBLEMS: Adjust tcsh advice for this.
+
+2006-09-10  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* PROBLEMS (are): Emacs compiled with Gtk+ crashes when closing a
+	display (x-close-connection).
+
 2006-09-02  Juri Linkov  <juri@jurta.org>
 
 	* HELLO: Regroup Europe Non-ASCII examples by similar scripts.
--- a/etc/NEWS	Wed Sep 06 07:30:39 2006 +0000
+++ b/etc/NEWS	Thu Sep 14 09:24:00 2006 +0000
@@ -411,6 +411,10 @@
 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'.
+
+** Adaptive filling misfeature removed.
+It no longer treats `NNN.' or `(NNN)' as a prefix.
+
 
 * Editing Changes in Emacs 22.1
 
@@ -1044,11 +1048,12 @@
 `Info-mode-hook'.
 
 +++
-*** font-lock: in modes like C and Lisp where the fontification assumes that
-an open-paren in column 0 is always outside of any string or comment,
-font-lock now highlights any such open-paren-in-column-zero in bold-red
-if it is inside a string or a comment, to indicate that it can cause
-trouble with fontification and/or indentation.
+*** 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.
 
 +++
 *** New standard font-lock face `font-lock-preprocessor-face'.
@@ -1504,6 +1509,10 @@
 `comint-use-prompt-regexp'.  The old name has been kept as an alias,
 but declared obsolete.
 
++++
+*** The EMACS environment variable now defaults to Emacs's absolute
+file name, instead of to "t".
+
 ** M-x Compile changes:
 
 ---
@@ -1560,6 +1569,10 @@
 no arrow is displayed and a value of nil means display the message at the top
 of the window.
 
++++
+*** The EMACS environment variable now defaults to Emacs's absolute
+file name, instead of to "t".
+
 ** Occur mode changes:
 
 +++
@@ -4981,9 +4994,6 @@
 *** New function `define-fringe-bitmap' can now be used to create new
 fringe bitmaps, as well as change the built-in fringe bitmaps.
 
-To change a built-in bitmap, do (require 'fringe) and use the symbol
-identifying the bitmap such as `left-truncation' or `continued-line'.
-
 *** New function `destroy-fringe-bitmap' deletes a fringe bitmap
 or restores a built-in one to its default value.
 
@@ -5272,6 +5282,11 @@
 *** 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:
 
 +++ (lispref)
--- a/etc/PROBLEMS	Wed Sep 06 07:30:39 2006 +0000
+++ b/etc/PROBLEMS	Thu Sep 14 09:24:00 2006 +0000
@@ -206,6 +206,11 @@
 On platforms such as Solaris, you can also work around this problem by
 configuring your compiler to use the native linker instead of GNU ld.
 
+** Emacs compiled with Gtk+ crashes when closing a display (x-close-connection).
+
+This happens because of bugs in Gtk+.  Gtk+ 2.10 seems to be OK.  See bug
+http://bugzilla.gnome.org/show_bug.cgi?id=85715.
+
 * General runtime problems
 
 ** Lisp problems
@@ -539,7 +544,7 @@
 problem by adding this to your .cshrc file:
 
     if ($?EMACS) then
-        if ($EMACS == "t") then
+        if ("$EMACS" =~ /*) then
             unset edit
             stty  -icrnl -onlcr -echo susp ^Z
         endif
--- a/etc/TODO	Wed Sep 06 07:30:39 2006 +0000
+++ b/etc/TODO	Thu Sep 14 09:24:00 2006 +0000
@@ -48,6 +48,9 @@
   It should not generate :require.  Or :require in defcustom
   should not be recorded in the user's custom-set-variables call.
 
+** Feature to change cursor shape when Emacs is idle (for more than
+  a specified time).
+
 ** The buttons at the top of a custom buffer should not omit
   variables whose values are currently hidden.
 
--- a/leim/ChangeLog	Wed Sep 06 07:30:39 2006 +0000
+++ b/leim/ChangeLog	Thu Sep 14 09:24:00 2006 +0000
@@ -1,3 +1,9 @@
+2006-09-06  Micha,Ak(Bl Cadilhac  <michael.cadilhac@lrde.org>
+
+	* quail/uni-input.el (ucs-input-method): Don't make the action of
+	a key not in [0-9a-zA-Z] when it was expected to be.  Let the Emacs
+	mechanism do it.
+
 2006-07-12  David Kastrup  <dak@gnu.org>
 
 	* quail/greek.el: Change iota subscriptum transliteration in
--- a/leim/quail/uni-input.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/leim/quail/uni-input.el	Thu Sep 14 09:24:00 2006 +0000
@@ -74,11 +74,6 @@
 		      (progn
 			(push key events)
 			(ucs-input-insert-char key))
-		    (let ((last-command-char key)
-			  (current-prefix-arg))
-		      (condition-case err
-			  (call-interactively (key-binding seq))
-			(quail-error (message "%s" (cdr err)) (beep))))
 		    (quail-delete-region)
 		    (throw 'non-digit (append (reverse events)
 					      (listify-key-sequence seq))))))
--- a/lisp/ChangeLog	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/ChangeLog	Thu Sep 14 09:24:00 2006 +0000
@@ -1,3 +1,308 @@
+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,Ak(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,Ak(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,Ak(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,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* dnd.el: Fix bootstrapping.
+
+2006-09-07  Jan Dj,Ad(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)
@@ -66,7 +371,7 @@
 	* mail/feedmail.el (feedmail-buffer-to-sendmail): Look for
 	sendmail in several common directories.
 
-	* mail/sendmail.el (sendmail-program): Moved here from pathe.el.
+	* mail/sendmail.el (sendmail-program): Moved here from paths.el.
 
 	* paths.el (sendmail-program): Removed.
 
@@ -346,7 +651,8 @@
 	* 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.
+	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.
 
@@ -1338,7 +1644,7 @@
 	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,Aa(Broly L,Bu(Brentey  <lorentey@elte.hu>
+2006-07-14  K,Aa(Broly L$,1 q(Brentey  <lorentey@elte.hu>
 
 	* emacs-lisp/authors.el (authors-aliases): Update.
 
@@ -3970,7 +4276,7 @@
 	Sync with Tramp 2.0.53.
 
 	* net/tramp.el (tramp-completion-mode): ?\t has event-modifier
-	'control.  Reported by Matthias F,bv(Brste <slashdevslashnull@gmx.net>.
+	'control.  Reported by Matthias F,Av(Brste <slashdevslashnull@gmx.net>.
 	(tramp-completion-file-name-handler): Add autoload cookie for
 	adding to `file-name-handler-alist'.
 
@@ -8564,7 +8870,7 @@
 	Let term-handle-ansi-terminal-messages override what Bash says about
 	its current directory.
 
-2005-12-16  L$,1 q(Brentey K,Aa(Broly  <lorentey@elte.hu>
+2005-12-16  K,Aa(Broly L$,1 q(Brentey  <lorentey@elte.hu>
 
 	* bindings.el (last-buffer): Move to simple.el.
 	* simple.el (last-buffer): Move here.
@@ -10321,7 +10627,7 @@
 	prompts work for AUTH PLAIN.  Also reported by Steve Allan
 	<seallan@verizon.net>.
 
-2005-12-06  L$,1 q(Brentey K,Aa(Broly  <lorentey@elte.hu>
+2005-12-06  K,Aa(Broly L$,1 q(Brentey  <lorentey@elte.hu>
 
 	* frame.el (set-frame-parameter): Add doc string.
 
@@ -10705,7 +11011,7 @@
 	(flyspell-post-command-hook): Check input-pending-p while processing
 	the potentially long list of buffer changes.
 
-2005-11-28  L$,1 q(Brentey K,Aa(Broly  <lorentey@elte.hu>
+2005-11-28  K,Aa(Broly L$,1 q(Brentey  <lorentey@elte.hu>
 
 	* buff-menu.el (list-buffers-noselect): Display the selected
 	frame's buffer list, not the global one.
@@ -15848,8 +16154,9 @@
 	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.
+	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".
--- a/lisp/bindings.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/bindings.el	Thu Sep 14 09:24:00 2006 +0000
@@ -337,24 +337,22 @@
   (put 'mode-line-position 'standard-value
        (list `(quote ,standard-mode-line-position))))
 
-(defvar mode-line-buffer-identification-keymap nil "\
+(defvar mode-line-buffer-identification-keymap
+  ;; Add menu of buffer operations to the buffer identification part
+  ;; of the mode line.or header line.
+  (let ((map (make-sparse-keymap)))
+    ;; Bind down- events so that the global keymap won't ``shine
+    ;; through''.
+    (define-key map [mode-line mouse-1] 'mode-line-previous-buffer)
+    (define-key map [header-line down-mouse-1] 'ignore)
+    (define-key map [header-line mouse-1] 'mode-line-previous-buffer)
+    (define-key map [header-line down-mouse-3] 'ignore)
+    (define-key map [mode-line mouse-3] 'mode-line-next-buffer)
+    (define-key map [header-line down-mouse-3] 'ignore)
+    (define-key map [header-line mouse-3] 'mode-line-next-buffer)
+    map) "\
 Keymap for what is displayed by `mode-line-buffer-identification'.")
 
-;; Add menu of buffer operations to the buffer identification part
-;; of the mode line.or header line.
-;
-(let ((map (make-sparse-keymap)))
-  ;; Bind down- events so that the global keymap won't ``shine
-  ;; through''.
-  (define-key map [mode-line mouse-1] 'mode-line-previous-buffer)
-  (define-key map [header-line down-mouse-1] 'ignore)
-  (define-key map [header-line mouse-1] 'mode-line-previous-buffer)
-  (define-key map [header-line down-mouse-3] 'ignore)
-  (define-key map [mode-line mouse-3] 'mode-line-next-buffer)
-  (define-key map [header-line down-mouse-3] 'ignore)
-  (define-key map [header-line mouse-3] 'mode-line-next-buffer)
-  (setq mode-line-buffer-identification-keymap map))
-
 (defun propertized-buffer-identification (fmt)
   "Return a list suitable for `mode-line-buffer-identification'.
 FMT is a format specifier such as \"%12b\".  This function adds
--- a/lisp/calc/calc.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/calc/calc.el	Thu Sep 14 09:24:00 2006 +0000
@@ -1101,7 +1101,7 @@
 (defun calc-dispatch (&optional arg)
   "Invoke the GNU Emacs Calculator.  See `calc-dispatch-help' for details."
   (interactive "P")
-  (sit-for echo-keystrokes)
+;  (sit-for echo-keystrokes)
   (condition-case err   ; look for other keys bound to calc-dispatch
       (let ((keys (this-command-keys)))
 	(unless (or (not (stringp keys))
--- a/lisp/comint.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/comint.el	Thu Sep 14 09:24:00 2006 +0000
@@ -765,7 +765,8 @@
 		    (format "COLUMNS=%d" (window-width)))
 	    (list "TERM=emacs"
 		  (format "TERMCAP=emacs:co#%d:tc=unknown:" (window-width))))
-	  (if (getenv "EMACS") nil (list "EMACS=t"))
+	  (unless (getenv "EMACS")
+	    (list (concat "EMACS=" invocation-directory invocation-name)))
 	  process-environment))
 	(default-directory
 	  (if (file-accessible-directory-p default-directory)
--- a/lisp/cus-edit.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/cus-edit.el	Thu Sep 14 09:24:00 2006 +0000
@@ -4395,15 +4395,15 @@
   "Ignoring WIDGET, create a menu entry for customization group SYMBOL."
   `( ,(custom-unlispify-menu-entry symbol t)
      :filter (lambda (&rest junk)
-	       (let* ((deactivate-mark nil)
-		      (menu (custom-menu-create ',symbol)))
+	       (let* ((menu (custom-menu-create ',symbol)))
 		 (if (consp menu) (cdr menu) menu)))))
 
 ;;;###autoload
 (defun custom-menu-create (symbol)
   "Create menu for customization group SYMBOL.
 The menu is in a format applicable to `easy-menu-define'."
-  (let* ((item (vector (custom-unlispify-menu-entry symbol)
+  (let* ((deactivate-mark nil)
+	 (item (vector (custom-unlispify-menu-entry symbol)
 		       `(customize-group ',symbol)
 		       t)))
     (if (and (or (not (boundp 'custom-menu-nesting))
--- a/lisp/cus-start.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/cus-start.el	Thu Sep 14 09:24:00 2006 +0000
@@ -364,6 +364,11 @@
 	     (unibyte-display-via-language-environment mule boolean)
 	     (blink-cursor-alist cursor alist "22.1")
 	     (overline-margin display integer "22.1")
+             (mouse-autoselect-window
+	      display (choice
+		       (const :tag "Off (nil)" :value nil)
+		       (const :tag "Immediate" :value t)
+		       (number :tag "Delay by secs" :value 0.5)) "22.1")
 	     ;; xfaces.c
 	     (scalable-fonts-allowed display boolean)
 	     ;; xfns.c
@@ -373,7 +378,6 @@
 	     (x-gtk-show-hidden-files menu boolean "22.1")
 	     (x-gtk-whole-detached-tool-bar x boolean "22.1")
 	     ;; xterm.c
-	     (mouse-autoselect-window display boolean "22.1")
 	     (x-use-underline-position-properties display boolean "22.1")
 	     (x-underline-at-descent-line display boolean "22.1")
 	     (x-stretch-cursor display boolean "21.1")))
--- a/lisp/desktop.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/desktop.el	Thu Sep 14 09:24:00 2006 +0000
@@ -862,8 +862,10 @@
       ;; Desktop file found, process it.
       (let ((desktop-first-buffer nil)
             (desktop-buffer-ok-count 0)
-            (desktop-buffer-fail-count 0))
-        (setq desktop-lazy-timer nil)
+            (desktop-buffer-fail-count 0)
+            ;; Avoid desktop saving during evaluation of desktop buffer.
+	    (desktop-save nil))
+	(desktop-lazy-abort)
         ;; Evaluate desktop buffer.
         (load (desktop-full-file-name) t t t)
         ;; `desktop-create-buffer' puts buffers at end of the buffer list.
--- a/lisp/diff-mode.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/diff-mode.el	Thu Sep 14 09:24:00 2006 +0000
@@ -1259,6 +1259,7 @@
 		   (t "Hunk %s at offset %d lines"))
 	     msg line-offset)))
 
+(defvar diff-apply-hunk-to-backup-file nil)
 
 (defun diff-apply-hunk (&optional reverse)
   "Apply the current hunk to the source file and go to the next.
@@ -1275,6 +1276,17 @@
     (cond
      ((null line-offset)
       (error "Can't find the text to patch"))
+     ((with-current-buffer buf
+        (and buffer-file-name
+             (backup-file-name-p buffer-file-name)
+             (not diff-apply-hunk-to-backup-file)
+             (not (set (make-local-variable 'diff-apply-hunk-to-backup-file)
+                       (yes-or-no-p (format "Really apply this hunk to %s? "
+                                            (file-name-nondirectory
+                                             buffer-file-name)))))))
+      (error (substitute-command-keys
+              (format "Use %s\\[diff-apply-hunk] to apply it to the other file"
+                      (if (not reverse) "\\[universal-argument] ")))))
      ((and switched
 	   ;; A reversed patch was detected, perhaps apply it in reverse.
 	   (not (save-window-excursion
--- a/lisp/dired-aux.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/dired-aux.el	Thu Sep 14 09:24:00 2006 +0000
@@ -39,6 +39,11 @@
 ;; We need macros in dired.el to compile properly.
 (eval-when-compile (require 'dired))
 
+(defvar dired-create-files-failures nil
+  "Variable where `dired-create-files' records failing file names.
+Functions that operate recursively can store additional names
+into this list; they also should call `dired-log' to log the errors.")
+
 ;;; 15K
 ;;;###begin dired-cmd.el
 ;; Diffing and compressing
@@ -1145,37 +1150,59 @@
 ;;;###autoload
 (defun dired-copy-file (from to ok-flag)
   (dired-handle-overwrite to)
-  (condition-case ()
-      (dired-copy-file-recursive from to ok-flag dired-copy-preserve-time t
-				 dired-recursive-copies)
-    (file-date-error (message "Can't set date")
-		     (sit-for 1))))
+  (dired-copy-file-recursive from to ok-flag dired-copy-preserve-time t
+			     dired-recursive-copies))
 
 (defun dired-copy-file-recursive (from to ok-flag &optional
 				       preserve-time top recursive)
-  (let ((attrs (file-attributes from)))
+  (let ((attrs (file-attributes from))
+	dirfailed)
     (if (and recursive
 	     (eq t (car attrs))
 	     (or (eq recursive 'always)
 		 (yes-or-no-p (format "Recursive copies of %s? " from))))
 	;; This is a directory.
-	(let ((files (directory-files from nil dired-re-no-dot)))
+	(let ((files
+	       (condition-case err
+		   (directory-files from nil dired-re-no-dot)
+		 (file-error
+		  (push (dired-make-relative from)
+			dired-create-files-failures)
+		  (dired-log "Copying error for %s:\n%s\n" from err)
+		  (setq dirfailed t)
+		  nil))))
 	  (if (eq recursive 'top) (setq recursive 'always)) ; Don't ask any more.
-	  (if (file-exists-p to)
-	      (or top (dired-handle-overwrite to))
-	    (make-directory to))
+	  (unless dirfailed
+	    (if (file-exists-p to)
+		(or top (dired-handle-overwrite to))
+	      (condition-case err
+		  (make-directory to)
+		(file-error
+		 (push (dired-make-relative from)
+		       dired-create-files-failures)
+		 (setq files nil)
+		 (dired-log "Copying error for %s:\n%s\n" from err)))))
 	  (while files
 	    (dired-copy-file-recursive
 	     (expand-file-name (car files) from)
 	     (expand-file-name (car files) to)
 	     ok-flag preserve-time nil recursive)
-	    (setq files (cdr files))))
+	    (pop files)))
       ;; Not a directory.
       (or top (dired-handle-overwrite to))
-      (if (stringp (car attrs))
-	  ;; It is a symlink
-	  (make-symbolic-link (car attrs) to ok-flag)
-	(copy-file from to ok-flag dired-copy-preserve-time)))))
+      (condition-case err
+	  (if (stringp (car attrs))
+	      ;; 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 
+	 (push (dired-make-relative from)
+	       dired-create-files-failures)
+	 (dired-log "Can't set date on %s:\n%s\n" from err))
+	(file-error
+	 (push (dired-make-relative from)
+	       dired-create-files-failures)
+	 (dired-log "Copying error for %s:\n%s\n" from err))))))
 
 ;;;###autoload
 (defun dired-rename-file (file newname ok-if-already-exists)
@@ -1297,7 +1324,8 @@
 ;; newfile's entry, or t to use the current marker character if the
 ;; oldfile was marked.
 
-  (let (failures skipped (success-count 0) (total (length fn-list)))
+  (let (dired-create-files-failures failures
+	skipped (success-count 0) (total (length fn-list)))
     (let (to overwrite-query
 	     overwrite-backup-query)	; for dired-handle-overwrite
       (mapcar
@@ -1340,16 +1368,25 @@
 		    (dired-add-file to actual-marker-char))
 		(file-error		; FILE-CREATOR aborted
 		 (progn
-		   (setq failures (cons (dired-make-relative from) failures))
+		   (push (dired-make-relative from)
+			 failures)
 		   (dired-log "%s `%s' to `%s' failed:\n%s\n"
 			      operation from to err))))))))
        fn-list))
     (cond
+     (dired-create-files-failures
+      (setq failures (nconc failures dired-create-files-failures))
+      (dired-log-summary
+       (format "%s failed for %d file%s in %d requests"
+		operation (length failures)
+		(dired-plural-s (length failures))
+		total)
+       failures))
      (failures
       (dired-log-summary
        (format "%s failed for %d of %d file%s"
-		operation (length failures) total
-		(dired-plural-s total))
+		operation (length failures)
+		total (dired-plural-s total))
        failures))
      (skipped
       (dired-log-summary
--- a/lisp/dired.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/dired.el	Thu Sep 14 09:24:00 2006 +0000
@@ -3043,6 +3043,10 @@
 	       (insert "\f\n")))))))
 
 (defun dired-log-summary (string failures)
+  "State a summary of a command's failures, in echo area and log buffer.
+STRING is an overall summary of the failures.
+FAILURES is a list of file names that we failed to operate on,
+or nil if file names are not applicable."
   (if (= (length failures) 1)
       (message "%s"
 	       (with-current-buffer dired-log-buffer
--- a/lisp/dnd.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/dnd.el	Thu Sep 14 09:24:00 2006 +0000
@@ -37,11 +37,11 @@
 
 ;;;###autoload
 (defcustom dnd-protocol-alist
-  '(
-    ("^file:///" . dnd-open-local-file)	; XDND format.
-    ("^file://"  . dnd-open-file)	; URL with host
-    ("^file:"    . dnd-open-local-file)	; Old KDE, Motif, Sun
-    )
+  '(("^file:///"  . dnd-open-local-file)	; XDND format.
+    ("^file://"   . dnd-open-file)		; URL with host
+    ("^file:"     . dnd-open-local-file)	; Old KDE, Motif, Sun
+    ("^\\(https?\\|ftp\\|file\\|nfs\\)://" . dnd-open-file)
+   )
 
   "The functions to call for different protocols when a drop is made.
 This variable is used by `dnd-handle-one-url' and `dnd-handle-file-name'.
@@ -59,6 +59,22 @@
   :group 'dnd)
 
 
+(defcustom dnd-open-remote-file-function
+  (if (eq system-type 'windows-nt)
+      'dnd-open-unc-file
+    'dnd-open-remote-url)
+  "The function to call when opening a file on a remote machine.
+The function will be called with two arguments; URI and ACTION. See
+`dnd-open-file' for details.
+If nil, then dragging remote files into Emacs will result in an error.
+Predefined functions are `dnd-open-unc-file' and `dnd-open-remote-url'.
+`dnd-open-unc-file' attempts to open the file using its UNC name and is the 
+default on MS-Windows.  `dnd-open-remote-url' uses `url-handler-mode' and
+is the default except for MS-Windows."
+  :version "22.1"
+  :type 'function
+  :group 'dnd)
+
 
 (defcustom dnd-open-file-other-window nil
   "If non-nil, always use find-file-other-window to open dropped files."
@@ -158,6 +174,36 @@
 	  'private)
       (error "Can not read %s" uri))))
 
+(defun dnd-open-unc-file (uri action)
+  "Open a remote file using its unc path.
+The file is opened in the current window, or a new window if
+`dnd-open-file-other-window' is set. URI is the url for the file,
+and must have the format file://hostname/file-name. ACTION is ignored.
+//hostname/file-name is the unc path."
+  (let ((unc-file (if (string-match "^file:" uri)
+		      (substring uri 5))))
+    (if (and unc-file (file-readable-p unc-file))
+	(progn
+	  (if dnd-open-file-other-window
+	      (find-file-other-window unc-file)
+	    (find-file unc-file))
+	  'private)
+      (error "Invalid file url"))))
+
+(defun dnd-open-remote-url (uri action)
+  "Open a remote file with `find-file' and `url-handler-mode'.
+Turns `url-handler-mode' on if not on before.  The file is opened in the
+current window, or a new window if `dnd-open-file-other-window' is set.
+URI is the url for the file.  ACTION is ignored."
+  (progn
+    (require 'url-handlers)
+    (or url-handler-mode (url-handler-mode))
+    (if dnd-open-file-other-window
+	(find-file-other-window uri)
+      (find-file uri))
+    'private))
+
+
 (defun dnd-open-file (uri action)
   "Open a local or remote file.
 The file is opened in the current window, or a new window if
@@ -169,7 +215,9 @@
   ;; file.  Otherwise return nil.
   (let ((local-file (dnd-get-local-file-uri uri)))
     (if local-file (dnd-open-local-file local-file action)
-      (error "Remote files not supported"))))
+      (if dnd-open-remote-file-function
+	  (funcall dnd-open-remote-file-function uri action)
+	(error "Remote files not supported")))))
 
 
 (defun dnd-insert-text (window action text)
--- a/lisp/emacs-lisp/bindat.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/emacs-lisp/bindat.el	Thu Sep 14 09:24:00 2006 +0000
@@ -66,13 +66,13 @@
 ;;
 ;;  The corresponding Lisp bindat specification looks like this:
 ;;
-;;  (setq header-spec
+;;  (setq header-bindat-spec
 ;;    '((dest-ip   ip)
 ;;	(src-ip    ip)
 ;;	(dest-port u16)
 ;;	(src-port  u16)))
 ;;
-;;  (setq data-spec
+;;  (setq data-bindat-spec
 ;;    '((type      u8)
 ;;	(opcode	   u8)
 ;;	(length	   u16r)  ;; little endian order
@@ -80,12 +80,12 @@
 ;;	(data	   vec (length))
 ;;	(align     4)))
 ;;
-;;  (setq packet-spec
-;;    '((header    struct header-spec)
+;;  (setq packet-bindat-spec
+;;    '((header    struct header-bindat-spec)
 ;;	(items     u8)
 ;;	(fill      3)
 ;;	(item	   repeat (items)
-;;		   (struct data-spec))))
+;;		   (struct data-bindat-spec))))
 ;;
 ;;
 ;;  A binary data representation may look like
@@ -121,6 +121,9 @@
 ;; Binary Data Structure Specification Format
 ;; ------------------------------------------
 
+;; We recommend using names that end in `-bindat-spec'; such names
+;; are recognized automatically as "risky" variables.
+
 ;; The data specification is formatted as follows:
 
 ;; SPEC    ::= ( ITEM... )
@@ -342,8 +345,8 @@
 
 (defun bindat-unpack (spec bindat-raw &optional bindat-idx)
   "Return structured data according to SPEC for binary data in BINDAT-RAW.
-BINDAT-RAW is a unibyte string or vector.  Optional third arg BINDAT-IDX specifies
-the starting offset in BINDAT-RAW."
+BINDAT-RAW is a unibyte string or vector.
+Optional third arg BINDAT-IDX specifies the starting offset in BINDAT-RAW."
   (when (multibyte-string-p bindat-raw)
     (error "String is multibyte"))
   (unless bindat-idx (setq bindat-idx 0))
--- a/lisp/emacs-lisp/cl.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/emacs-lisp/cl.el	Thu Sep 14 09:24:00 2006 +0000
@@ -149,13 +149,20 @@
   (if (symbolp place) (list 'setq place (list 'cons x place))
     (list 'callf2 'cons x place)))
 
+(defvar pushnew-internal)
+
 (defmacro pushnew (x place &rest keys)
   "(pushnew X PLACE): insert X at the head of the list if not already there.
 Like (push X PLACE), except that the list is unmodified if X is `eql' to
 an element already on the list.
 \nKeywords supported:  :test :test-not :key
 \n(fn X PLACE [KEYWORD VALUE]...)"
-  (if (symbolp place) (list 'setq place (list* 'adjoin x place keys))
+  (if (symbolp place)
+      (if (null keys)
+	  `(let ((pushnew-internal ,place))
+	     (add-to-list 'pushnew-internal ,x nil 'eql)
+	     (setq ,place pushnew-internal))
+	(list 'setq place (list* 'adjoin x place keys)))
     (list* 'callf2 'adjoin x place keys)))
 
 (defun cl-set-elt (seq n val)
--- a/lisp/emacs-lisp/eldoc.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/emacs-lisp/eldoc.el	Thu Sep 14 09:24:00 2006 +0000
@@ -432,7 +432,7 @@
 ;; Prime the command list.
 (eldoc-add-command-completions
  "backward-" "beginning-of-" "move-beginning-of-" "delete-other-windows"
- "delete-window"
+ "delete-window" "handle-select-window"
  "end-of-" "move-end-of-" "exchange-point-and-mark" "forward-"
  "indent-for-tab-command" "goto-" "mark-page" "mark-paragraph"
  "mouse-set-point" "move-" "pop-global-mark" "next-" "other-window"
--- a/lisp/emacs-lisp/timer.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/emacs-lisp/timer.el	Thu Sep 14 09:24:00 2006 +0000
@@ -32,9 +32,11 @@
 ;; Layout of a timer vector:
 ;; [triggered-p high-seconds low-seconds usecs repeat-delay
 ;;  function args idle-delay]
+;; triggered-p is nil if the timer is active (waiting to be triggered),
+;;  t if it is inactive ("already triggered", in theory)
 
 (defun timer-create ()
-  "Create a timer object."
+  "Create a timer object which can be passed to `timer-activate'."
   (let ((timer (make-vector 8 nil)))
     (aset timer 0 t)
     timer))
@@ -173,6 +175,10 @@
 (defun timer-activate (timer &optional triggered-p reuse-cell)
   "Put TIMER on the list of active timers.
 
+If TRIGGERED-P is t, that means to make the timer inactive
+\(put it on the list, but mark it as already triggered).
+To remove from the list, use `cancel-timer'.
+
 REUSE-CELL, if non-nil, is a cons cell to reuse instead
 of allocating a new one."
   (if (and (timerp timer)
@@ -256,10 +262,10 @@
   (setq timer-idle-list (delq timer timer-idle-list))
   nil)
 
-;; Remove TIMER from the list of active timers or idle timers.
-;; Only to be used in this file.  It returns the cons cell
-;; that was removed from the list.
 (defun cancel-timer-internal (timer)
+  "Remove TIMER from the list of active timers or idle timers.
+Only to be used in this file.  It returns the cons cell
+that was removed from the timer list."
   (let ((cell1 (memq timer timer-list))
 	(cell2 (memq timer timer-idle-list)))
     (if cell1
@@ -270,7 +276,9 @@
 
 ;;;###autoload
 (defun cancel-function-timers (function)
-  "Cancel all timers scheduled by `run-at-time' which would run FUNCTION."
+  "Cancel all timers which would run FUNCTION.
+This affects ordinary timers such as are scheduled by `run-at-time',
+and idle timers such as are scheduled by `run-with-idle-timer'."
   (interactive "aCancel timers of function: ")
   (let ((tail timer-list))
     (while tail
@@ -284,9 +292,12 @@
       (setq tail (cdr tail)))))
 
 ;; Record the last few events, for debugging.
-(defvar timer-event-last-2 nil)
-(defvar timer-event-last-1 nil)
-(defvar timer-event-last nil)
+(defvar timer-event-last nil
+  "Last timer that was run.")
+(defvar timer-event-last-1 nil
+  "Next-to-last timer that was run.")
+(defvar timer-event-last-2 nil
+  "Third-to-last timer that was run.")
 
 (defvar timer-max-repeats 10
   "*Maximum number of times to repeat a timer, if real time jumps.")
@@ -440,6 +451,7 @@
     timer))
 
 (defun with-timeout-handler (tag)
+  "This is the timer function used for the timer made by `with-timeout'."
   (throw tag 'timeout))
 
 ;;;###autoload (put 'with-timeout 'lisp-indent-function 1)
--- a/lisp/filecache.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/filecache.el	Thu Sep 14 09:24:00 2006 +0000
@@ -266,6 +266,7 @@
 ;; Functions to add files to the cache
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
+;;;###autoload
 (defun file-cache-add-directory (directory &optional regexp)
   "Add DIRECTORY to the file cache.
 If the optional REGEXP argument is non-nil, only files which match it will
@@ -291,6 +292,7 @@
        dir-files)
       (file-cache-add-file-list dir-files))))
 
+;;;###autoload
 (defun file-cache-add-directory-list (directory-list &optional regexp)
   "Add DIRECTORY-LIST (a list of directory names) to the file cache.
 If the optional REGEXP argument is non-nil, only files which match it
@@ -307,6 +309,8 @@
   (mapcar 'file-cache-add-file file-list))
 
 ;; Workhorse function
+
+;;;###autoload
 (defun file-cache-add-file (file)
   "Add FILE to the file cache."
   (interactive "fAdd File: ")
@@ -333,6 +337,7 @@
 		    file-cache-alist)))
       )))
 
+;;;###autoload
 (defun file-cache-add-directory-using-find (directory)
   "Use the `find' command to add files to the file cache.
 Find is run in DIRECTORY."
@@ -355,6 +360,7 @@
 		  "-print")
     (file-cache-add-from-file-cache-buffer)))
 
+;;;###autoload
 (defun file-cache-add-directory-using-locate (string)
   "Use the `locate' command to add files to the file cache.
 STRING is passed as an argument to the locate command."
@@ -366,6 +372,7 @@
 		string)
   (file-cache-add-from-file-cache-buffer))
 
+;;;###autoload
 (defun file-cache-add-directory-recursively  (dir &optional regexp)
   "Adds DIR and any subdirectories to the file-cache.
 This function does not use any external programs
--- a/lisp/files.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/files.el	Thu Sep 14 09:24:00 2006 +0000
@@ -1310,7 +1310,7 @@
 	  (setq abbreviated-home-dir
 		(let ((abbreviated-home-dir "$foo"))
 		  (concat "^" (abbreviate-file-name (expand-file-name "~"))
-			  "\\(/\\|$\\)"))))
+			  "\\(/\\|\\'\\)"))))
 
       ;; If FILENAME starts with the abbreviated homedir,
       ;; make it start with `~' instead.
@@ -2696,8 +2696,8 @@
 
  * Its name ends with \"hook(s)\", \"function(s)\", \"form(s)\", \"map\",
    \"program\", \"command(s)\", \"predicate(s)\", \"frame-alist\",
-   \"mode-alist\", \"font-lock-(syntactic-)keyword*\", or
-   \"map-alist\"."
+   \"mode-alist\", \"font-lock-(syntactic-)keyword*\",
+   \"map-alist\", or \"bindat-spec\"."
   ;; If this is an alias, check the base name.
   (condition-case nil
       (setq sym (indirect-variable sym))
@@ -2706,7 +2706,7 @@
       (string-match "-hooks?$\\|-functions?$\\|-forms?$\\|-program$\\|\
 -commands?$\\|-predicates?$\\|font-lock-keywords$\\|font-lock-keywords\
 -[0-9]+$\\|font-lock-syntactic-keywords$\\|-frame-alist$\\|-mode-alist$\\|\
--map$\\|-map-alist$" (symbol-name sym))))
+-map$\\|-map-alist$\\|-bindat-spec$" (symbol-name sym))))
 
 (defun hack-one-local-variable-quotep (exp)
   (and (consp exp) (eq (car exp) 'quote) (consp (cdr exp))))
--- a/lisp/frame.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/frame.el	Thu Sep 14 09:24:00 2006 +0000
@@ -1083,17 +1083,43 @@
      (t
       (frame-width (if (framep display) display (selected-frame)))))))
 
+(defcustom display-mm-dimensions-alist nil
+  "Alist for specifying screen dimensions in millimeters.
+The dimensions will be used for `display-mm-height' and
+`display-mm-width' if defined for the respective display.
+
+Each element of the alist has the form (display . (width . height)),
+e.g. (\":0.0\" . (287 . 215)).
+
+If `display' equals t, it specifies dimensions for all graphical
+displays not explicitely specified."
+  :version "22.1"
+  :type '(alist :key-type (choice (string :tag "Display name")
+				  (const :tag "Default" t))
+		:value-type (cons :tag "Dimensions"
+				  (integer :tag "Width")
+				  (integer :tag "Height")))
+  :group 'frames)
+
 (defun display-mm-height (&optional display)
   "Return the height of DISPLAY's screen in millimeters.
+System values can be overriden by `display-mm-dimensions-alist'.
 If the information is unavailable, value is nil."
   (and (memq (framep-on-display display) '(x w32 mac))
-       (x-display-mm-height display)))
+       (or (cddr (assoc (or display (frame-parameter nil 'display))
+			display-mm-dimensions-alist))
+	   (cddr (assoc t display-mm-dimensions-alist))
+	   (x-display-mm-height display))))
 
 (defun display-mm-width (&optional display)
   "Return the width of DISPLAY's screen in millimeters.
+System values can be overriden by `display-mm-dimensions-alist'.
 If the information is unavailable, value is nil."
   (and (memq (framep-on-display display) '(x w32 mac))
-       (x-display-mm-width display)))
+       (or (cadr (assoc (or display (frame-parameter nil 'display))
+			display-mm-dimensions-alist))
+	   (cadr (assoc t display-mm-dimensions-alist))
+	   (x-display-mm-width display))))
 
 (defun display-backing-store (&optional display)
   "Return the backing store capability of DISPLAY's screen.
--- a/lisp/gnus/ChangeLog	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/gnus/ChangeLog	Thu Sep 14 09:24:00 2006 +0000
@@ -1,3 +1,18 @@
+2006-09-09  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* pop3.el (pop3-leave-mail-on-server): Mention problem of duplicate
+	mails in the doc string.  Add some URLs in comment.
+
+2006-09-07  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* rfc2047.el (rfc2047-quote-special-characters-in-quoted-strings): Fix
+	backslashes handling and the way to find boundaries of quoted strings.
+
+2006-09-06  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* gnus-art.el (gnus-button-regexp, gnus-button-marker-list)
+	(gnus-button-last): Move up.  Convert comments into doc strings.
+
 2006-09-04  Chong Yidong  <cyd@stupidchicken.com>
 
 	* message.el (message-send-mail-with-sendmail): Look for sendmail in
@@ -2868,7 +2883,7 @@
 
 	* gnus.el (gnus-group-startup-message): Search for gnus images in
 	etc/images/gnus.
-	* mm-util.el (mm-find-charset-region): Likewise.
+	* mm-util.el (mm-image-load-path): Likewise.
 	* smiley.el (smiley-data-directory): Search for smilies in
 	etc/images/smilies.
 
--- a/lisp/gnus/ChangeLog.2	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/gnus/ChangeLog.2	Thu Sep 14 09:24:00 2006 +0000
@@ -865,13 +865,12 @@
 	key id too (for decryption).
 	(pgg-gpg-sign-region): Likewise.
 
-2003-11-09  Simon Josefsson  <jas@extundo.com>
+2003-11-09  Satyaki Das  <satyakid@stanford.edu>
 
 	* pgg-gpg.el (pgg-gpg-all-secret-keys): New variable.
 	(pgg-gpg-lookup-all-secret-keys): New function.
 	(pgg-gpg-select-matching-key): Likewise.
-	(pgg-gpg-decrypt-region): Use new functions.  From Satyaki Das
-	<satyakid@stanford.edu>.
+	(pgg-gpg-decrypt-region): Use new functions.  
 
 2003-11-07  Teodor Zlatanov  <tzz@lifelogs.com>
 
@@ -4511,7 +4510,6 @@
 	* spam.el: Fix typo.
 
 2003-03-01  Satyaki Das  <satyaki@theforce.stanford.edu>
-	(Trivial patch.)
 
 	* pgg-gpg.el (pgg-gpg-process-region): Insert process status into
 	errors-buffer. This produces a nicer error message in case of
@@ -5036,8 +5034,9 @@
 	* gnus-sum.el (gnus-summary-select-article): Remove blink removal
 	code that only worked under Emacs.
 
-	* pgg-gpg.el (pgg-gpg-process-region): Don't blink.  From Satyaki
-	Das <satyaki@chicory.stanford.edu>.
+2003-02-08  Satyaki Das  <satyaki@chicory.stanford.edu>
+	
+	* pgg-gpg.el (pgg-gpg-process-region): Don't blink.
 
 2003-02-08  Jesper Harder  <harder@ifa.au.dk>
 
--- a/lisp/gnus/gnus-art.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/gnus/gnus-art.el	Thu Sep 14 09:24:00 2006 +0000
@@ -3940,6 +3940,14 @@
   (mm-enable-multibyte)
   (gnus-run-mode-hooks 'gnus-article-mode-hook))
 
+;; Internal variables.  Are `gnus-button-regexp' and `gnus-button-last' used
+;; at all?
+(defvar gnus-button-regexp nil)
+(defvar gnus-button-marker-list nil
+  "Regexp matching any of the regexps from `gnus-button-alist'.")
+(defvar gnus-button-last nil
+  "The value of `gnus-button-alist' when `gnus-button-regexp' was build.")
+
 (defun gnus-article-setup-buffer ()
   "Initialize the article buffer."
   (let* ((name (if gnus-single-article-buffer "*Article*"
@@ -6711,13 +6719,6 @@
 			       :inline t
 			       (integer :tag "Regexp group")))))
 
-(defvar gnus-button-regexp nil)
-(defvar gnus-button-marker-list nil)
-;; Regexp matching any of the regexps from `gnus-button-alist'.
-
-(defvar gnus-button-last nil)
-;; The value of `gnus-button-alist' when `gnus-button-regexp' was build.
-
 ;;; Commands:
 
 (defun gnus-article-push-button (event)
--- a/lisp/gnus/pop3.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/gnus/pop3.el	Thu Sep 14 09:24:00 2006 +0000
@@ -89,8 +89,12 @@
 left on the POP server after fetching.  Note that POP servers
 maintain no state information between sessions, so what the
 client believes is there and what is actually there may not match
-up.  If they do not, then the whole thing can fall apart and
-leave you with a corrupt mailbox."
+up.  If they do not, then you may get duplicate mails or the
+whole thing can fall apart and leave you with a corrupt mailbox."
+  ;; We can't use the UILD support from XEmacs mail-lib or cvs.m17n.org:
+  ;; http://thread.gmane.org/v9lld8fml4.fsf@marauder.physik.uni-ulm.de
+  ;; http://thread.gmane.org/b9yy8hzy9ej.fsf@jpl.org
+  ;; Any volunteer to re-implement this?
   :version "22.1" ;; Oort Gnus
   :type 'boolean
   :group 'pop3)
--- a/lisp/gnus/rfc2047.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/gnus/rfc2047.el	Thu Sep 14 09:24:00 2006 +0000
@@ -178,30 +178,32 @@
 matching ENCODABLE-REGEXP."
   (goto-char (point-min))
   (let ((tspecials (concat "[" ietf-drums-tspecials "]"))
-	beg)
+	beg end)
     (with-syntax-table (standard-syntax-table)
       (while (search-forward "\"" nil t)
-	(unless (eq (char-before) ?\\)
-	  (setq beg (match-end 0))
-	  (goto-char (match-beginning 0))
+	(setq beg (match-beginning 0))
+	(unless (eq (char-before beg) ?\\)
+	  (goto-char beg)
+	  (setq beg (1+ beg))
 	  (condition-case nil
 	      (progn
 		(forward-sexp)
-		(save-restriction
-		  (narrow-to-region beg (1- (point)))
-		  (goto-char beg)
-		  (unless (and encodable-regexp
-			       (re-search-forward encodable-regexp nil t))
+		(setq end (1- (point)))
+		(goto-char beg)
+		(if (and encodable-regexp
+			 (re-search-forward encodable-regexp end t))
+		    (goto-char (1+ end))
+		  (save-restriction
+		    (narrow-to-region beg end)
 		    (while (re-search-forward tspecials nil 'move)
-		      (unless (and (eq (char-before) ?\\) ;; Already quoted.
-				   (looking-at tspecials))
+		      (if (eq (char-before) ?\\)
+			  (if (looking-at tspecials) ;; Already quoted.
+			      (forward-char)
+			    (insert "\\"))
 			(goto-char (match-beginning 0))
-			(unless (or (eq (char-before) ?\\)
-				    (and rfc2047-encode-encoded-words
-					 (eq (char-after) ??)
-					 (eq (char-before) ?=)))
-			  (insert "\\")))
-		      (forward-char)))))
+			(insert "\\")
+			(forward-char))))
+		  (forward-char)))
 	    (error
 	     (goto-char beg))))))))
 
--- a/lisp/help.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/help.el	Thu Sep 14 09:24:00 2006 +0000
@@ -535,28 +535,6 @@
 	  (princ string)))))
   nil)
 
-(defun string-key-binding (key)
-  "Value is the binding of KEY in a string.
-If KEY is an event on a string, and that string has a `local-map'
-or `keymap' property, return the binding of KEY in the string's keymap."
-  (let* ((defn nil)
-	 (start (when (vectorp key)
-		  (if (memq (aref key 0)
-			    '(mode-line header-line left-margin right-margin))
-		      (event-start (aref key 1))
-		    (and (consp (aref key 0))
-			 (event-start (aref key 0))))))
-	 (string-info (and (consp start) (nth 4 start))))
-    (when string-info
-      (let* ((string (car string-info))
-	     (pos (cdr string-info))
-	     (local-map (and (>= pos 0)
-			     (< pos (length string))
-			     (or (get-text-property pos 'local-map string)
-				 (get-text-property pos 'keymap string)))))
-	(setq defn (and local-map (lookup-key local-map key)))))
-    defn))
-
 (defun help-key-description (key untranslated)
   (let ((string (key-description key)))
     (if (or (not untranslated)
@@ -620,8 +598,7 @@
 	    (set-buffer (window-buffer window))
 	    (goto-char position)))
       ;; Ok, now look up the key and name the command.
-      (let ((defn (or (string-key-binding key)
-		      (key-binding key t)))
+      (let ((defn (key-binding key t))
 	    key-desc)
 	;; Handle the case where we faked an entry in "Select and Paste" menu.
 	(if (and (eq defn nil)
@@ -698,7 +675,7 @@
       (when (windowp window)
 	    (set-buffer (window-buffer window))
 	(goto-char position))
-      (let ((defn (or (string-key-binding key) (key-binding key t))))
+      (let ((defn (key-binding key t)))
 	;; Handle the case where we faked an entry in "Select and Paste" menu.
 	(if (and (eq defn nil)
 		 (stringp (aref key (1- (length key))))
@@ -743,8 +720,7 @@
 			((vectorp mouse-1-remapped)
 			 (setcar up-event (elt mouse-1-remapped 0)))
 			(t (setcar up-event 'mouse-2))))
-		(setq defn (or (string-key-binding sequence)
-			       (key-binding sequence)))
+		(setq defn (key-binding sequence))
 		(unless (or (null defn) (integerp defn) (equal defn 'undefined))
 		  (princ (if mouse-1-tricky
 			     "\n\n----------------- up-event (short click) ----------------\n\n"
@@ -761,8 +737,7 @@
 		  (describe-function-1 defn))
 		(when mouse-1-tricky
 		  (setcar up-event 'mouse-1)
-		  (setq defn (or (string-key-binding (vector up-event))
-				 (key-binding (vector up-event))))
+		  (setq defn (key-binding (vector up-event)))
 		  (unless (or (null defn) (integerp defn) (eq defn 'undefined))
 		    (princ (or hdr
 			       "\n\n----------------- up-event (long click) ----------------\n\n"))
--- a/lisp/ido.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/ido.el	Thu Sep 14 09:24:00 2006 +0000
@@ -2112,7 +2112,7 @@
 (defun ido-edit-input ()
   "Edit absolute file name entered so far with ido; terminate by RET."
   (interactive)
-  (setq ido-text-init (if ido-matches (car ido-matches) ido-text))
+  (setq ido-text-init (if ido-matches (ido-name (car ido-matches)) ido-text))
   (setq ido-exit 'edit)
   (exit-minibuffer))
 
@@ -2426,13 +2426,13 @@
      ((and (= 1 (length ido-matches))
 	   (not (and ido-enable-tramp-completion
 		     (string-equal ido-current-directory "/")
-		     (string-match "..[@:]\\'" (car ido-matches)))))
+		     (string-match "..[@:]\\'" (ido-name (car ido-matches))))))
       ;; only one choice, so select it.
       (if (not ido-confirm-unique-completion)
 	  (exit-minibuffer)
 	(setq ido-rescan (not ido-enable-prefix))
 	(delete-region (minibuffer-prompt-end) (point))
-	(insert (car ido-matches))))
+	(insert (ido-name (car ido-matches)))))
 
      (t ;; else there could be some completions
       (setq res ido-common-match-string)
@@ -2814,7 +2814,7 @@
   "Use first matching item as input text."
   (interactive)
   (when ido-matches
-    (setq ido-text-init (car ido-matches))
+    (setq ido-text-init (ido-name (car ido-matches)))
     (setq ido-exit 'refresh)
     (exit-minibuffer)))
 
@@ -2828,7 +2828,7 @@
   "Move to previous directory in file name, push first match on stack."
   (interactive)
   (if ido-matches
-      (setq ido-text (car ido-matches)))
+      (setq ido-text (ido-name (car ido-matches))))
   (setq ido-exit 'push)
   (exit-minibuffer))
 
@@ -3745,7 +3745,7 @@
   "Kill the buffer at the head of `ido-matches'."
   (interactive)
   (let ((enable-recursive-minibuffers t)
-	(buf (car ido-matches)))
+	(buf (ido-name (car ido-matches))))
     (when buf
       (kill-buffer buf)
       ;; Check if buffer still exists.
@@ -3760,7 +3760,7 @@
   "Delete the file at the head of `ido-matches'."
   (interactive)
   (let ((enable-recursive-minibuffers t)
-	(file (car ido-matches)))
+	(file (ido-name (car ido-matches))))
     (if file
 	(setq file (concat ido-current-directory file)))
     (when (and file
@@ -4202,7 +4202,7 @@
 	    ((= (length contents) 2)
 	     "/")
 	    (ido-matches
-	     (concat ido-current-directory (car ido-matches)))
+	     (concat ido-current-directory (ido-name (car ido-matches))))
 	    (t
 	     (concat ido-current-directory (substring contents 0 -1)))))
 	  (setq ido-text-init (substring contents -1))
@@ -4238,12 +4238,12 @@
 		   ido-matches
 		   (or (eq ido-enter-matching-directory 'first)
 		       (null (cdr ido-matches)))
-		   (ido-final-slash (car ido-matches))
+		   (ido-final-slash (ido-name (car ido-matches)))
 		   (or try-single-dir-match
 		       (eq ido-enter-matching-directory t)))
 	  (ido-trace "single match" (car ido-matches))
 	  (ido-set-current-directory
-	   (concat ido-current-directory (car ido-matches)))
+	   (concat ido-current-directory (ido-name (car ido-matches))))
 	  (setq ido-exit 'refresh)
 	  (exit-minibuffer))
 
--- a/lisp/info.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/info.el	Thu Sep 14 09:24:00 2006 +0000
@@ -2792,7 +2792,8 @@
 Give an empty topic name to go to the Index node itself."
   (interactive
    (list
-    (let ((Info-complete-menu-buffer (clone-buffer))
+    (let ((completion-ignore-case t)
+	  (Info-complete-menu-buffer (clone-buffer))
 	  (Info-complete-nodes (Info-index-nodes))
 	  (Info-history-list nil))
       (if (equal Info-current-file "dir")
--- a/lisp/international/latexenc.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/international/latexenc.el	Thu Sep 14 09:24:00 2006 +0000
@@ -63,7 +63,7 @@
     ("cp437" . cp437) ; IBM code page 437: 225 is \beta
     ("cp850" . cp850) ; IBM code page 850
     ("cp852" . cp852) ; IBM code page 852
-    ;; ("cp858" . undecided) ; IBM code page 850 but with a euro symbol
+    ("cp858" . cp858) ; IBM code page 850 but with a euro symbol
     ("cp865" . cp865) ; IBM code page 865
     ;; The DECMultinational charaterset used by the OpenVMS system
     ;; ("decmulti" . undecided)
--- a/lisp/locate.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/locate.el	Thu Sep 14 09:24:00 2006 +0000
@@ -114,6 +114,7 @@
 
 ;; Variables
 
+(defvar locate-current-search nil)
 (defvar locate-current-filter nil)
 
 (defgroup locate nil
@@ -289,29 +290,36 @@
 	 (run-locate-command
 	  (or (and current-prefix-arg (not locate-prompt-for-command))
 	      (and (not current-prefix-arg) locate-prompt-for-command)))
+         locate-buffer
 	 )
 
     ;; Find the Locate buffer
-    (save-window-excursion
-      (set-buffer (get-buffer-create locate-buffer-name))
+    (setq locate-buffer (if (eq major-mode 'locate-mode)
+                            (current-buffer)
+                          (get-buffer-create locate-buffer-name)))
+
+    (save-excursion
+      (set-buffer locate-buffer)
       (locate-mode)
+
       (let ((inhibit-read-only t)
-	    (buffer-undo-list t))
-	(erase-buffer)
-
-	(setq locate-current-filter filter)
+            (buffer-undo-list t))
+        (erase-buffer)
 
-	(if run-locate-command
-	    (shell-command search-string locate-buffer-name)
-	  (apply 'call-process locate-cmd nil t nil locate-cmd-args))
+        (set (make-local-variable 'locate-current-search) search-string)
+        (set (make-local-variable 'locate-current-filter) filter)
+
+        (if run-locate-command
+            (shell-command search-string)
+          (apply 'call-process locate-cmd nil t nil locate-cmd-args))
 
-	(and filter
-	     (locate-filter-output filter))
+        (and filter
+             (locate-filter-output filter))
 
-	(locate-do-setup search-string)
-	))
-    (and (not (string-equal (buffer-name) locate-buffer-name))
-	(switch-to-buffer-other-window locate-buffer-name))
+        (locate-do-setup search-string)))
+
+    (unless (eq (current-buffer) locate-buffer)
+      (switch-to-buffer-other-window locate-buffer))
 
     (run-hooks 'dired-mode-hook)
     (dired-next-line 3)			;move to first matching file.
@@ -461,6 +469,7 @@
         default-directory   "/"
 	buffer-read-only    t
 	selective-display   t)
+  (buffer-disable-undo)
   (dired-alist-add-1 default-directory (point-min-marker))
   (set (make-local-variable 'dired-directory) "/")
   (set (make-local-variable 'dired-subdir-switches) locate-ls-subdir-switches)
@@ -492,11 +501,12 @@
     ;; Nothing returned from locate command?
     (and (eobp)
 	 (progn
-	   (kill-buffer locate-buffer-name)
-	   (if locate-current-filter
-	       (error "Locate: no match for %s in database using filter %s"
-		      search-string locate-current-filter)
-	     (error "Locate: no match for %s in database" search-string))))
+           (let ((filter locate-current-filter)) ; local
+             (kill-buffer (current-buffer))
+             (if filter
+                 (error "Locate: no match for %s in database using filter %s"
+                        search-string filter)
+               (error "Locate: no match for %s in database" search-string)))))
 
     (locate-insert-header search-string)
 
@@ -580,15 +590,14 @@
   "Revert the *Locate* buffer.
 If `locate-update-when-revert' is non-nil, offer to update the
 locate database using the shell command in `locate-update-command'."
-  (let ((str (car locate-history-list)))
-    (and locate-update-when-revert
-	 (yes-or-no-p "Update locate database (may take a few seconds)? ")
-	 ;; `expand-file-name' is used in order to autoload Tramp if
-	 ;; necessary.  It cannot be loaded when `default-directory'
-	 ;; is remote.
-	 (let ((default-directory (expand-file-name locate-update-path)))
-	   (shell-command locate-update-command)))
-    (locate str)))
+  (and locate-update-when-revert
+       (yes-or-no-p "Update locate database (may take a few seconds)? ")
+       ;; `expand-file-name' is used in order to autoload Tramp if
+       ;; necessary.  It cannot be loaded when `default-directory'
+       ;; is remote.
+       (let ((default-directory (expand-file-name locate-update-path)))
+         (shell-command locate-update-command)))
+  (locate locate-current-search locate-current-filter))
 
 ;;; Modified three functions from `dired.el':
 ;;;   dired-find-directory,
--- a/lisp/lpr.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/lpr.el	Thu Sep 14 09:24:00 2006 +0000
@@ -140,8 +140,9 @@
 
 ;; Berkeley systems support -F, and GNU pr supports both -f and -F,
 ;; So it looks like -F is a better default.
-(defcustom lpr-page-header-switches '("-F")
-  "*List of strings to use as options for the page-header-generating program.
+(defcustom lpr-page-header-switches '("-h %s" "-F")
+  "List of strings to use as options for the page-header-generating program.
+If `%s' appears in one of the strings, it is substituted by the page title.
 The variable `lpr-page-header-program' specifies the program to use."
   :type '(repeat string)
   :group 'lpr)
@@ -243,8 +244,8 @@
 	    (let ((new-coords (print-region-new-buffer start end)))
 	      (apply 'call-process-region (car new-coords) (cdr new-coords)
 		     lpr-page-header-program t t nil
-		     (nconc (list "-h" title)
-			    lpr-page-header-switches)))
+		     (mapcar (lambda (e) (format e title))
+			     lpr-page-header-switches)))
 	    (setq start (point-min)
 		  end   (point-max))))
       (apply (or print-region-function 'call-process-region)
--- a/lisp/mail/rmail.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/mail/rmail.el	Thu Sep 14 09:24:00 2006 +0000
@@ -1677,12 +1677,15 @@
 			 (if (and (featurep 'rmail-spam-filter)
 				  rmail-use-spam-filter
 				  (> rsf-number-of-spam 0))
-			     (if (= 1 new-messages)
-				 ", and found to be a spam message"
-			       (if (> rsf-number-of-spam 1)
-				   (format ", %d of which found to be spam messages"
-					   rsf-number-of-spam)
-				 ", one of which found to be a spam message"))
+			     (cond ((= 1 new-messages)
+				    ", and appears to be spam")
+				   ((= rsf-number-of-spam new-messages)
+				    ", and all appear to be spam")
+				   ((> rsf-number-of-spam 1)
+				    (format ", and %d appear to be spam"
+					    rsf-number-of-spam))
+				   (t
+				    ", and 1 appears to be spam"))
 			   ""))
 		(if (and (featurep 'rmail-spam-filter)
 			 rmail-use-spam-filter
@@ -1900,6 +1903,7 @@
 (defun rmail-convert-to-babyl-format ()
   (let ((count 0) start
 	(case-fold-search nil)
+	(buffer-undo-list t)
 	(invalid-input-resync
 	 (function (lambda ()
 		     (message "Invalid Babyl format in inbox!")
@@ -2173,6 +2177,7 @@
 	      ;; may still be in use.  -- rms, 7 May 1993.
 	      ((eolp) (delete-char 1))
 	      (t (error "Cannot convert to babyl format")))))
+    (setq buffer-undo-list nil)
     count))
 
 ;; Delete the "From ..." line, creating various other headers with
--- a/lisp/mail/smtpmail.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/mail/smtpmail.el	Thu Sep 14 09:24:00 2006 +0000
@@ -176,7 +176,12 @@
 (defcustom smtpmail-starttls-credentials '(("" 25 "" ""))
   "Specify STARTTLS keys and certificates for servers.
 This is a list of four-element list with `servername' (a string),
-`port' (an integer), `key' (a filename) and `certificate' (a filename)."
+`port' (an integer), `key' (a filename) and `certificate' (a
+filename).
+If you do not have a certificate/key pair, leave the `key' and
+`certificate' fields as `nil'.  A key/certificate pair is only
+needed if you want to use X.509 client authenticated
+connections."
   :type '(repeat (list (string  :tag "Server")
 		       (integer :tag "Port")
 		       (file    :tag "Key")
--- a/lisp/net/ldap.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/net/ldap.el	Thu Sep 14 09:24:00 2006 +0000
@@ -490,9 +490,11 @@
 for each matching entry. If nil, return all available attributes.
   `attrsonly', if non-nil, indicates that only attributes are retrieved,
 not their associated values.
+  `auth' is one of the symbols `simple', `krbv41' or `krbv42'.
   `base' is the base for the search as described in RFC 1779.
   `scope' is one of the three symbols `sub', `base' or `one'.
   `binddn' is the distinguished name of the user to bind as (in RFC 1779 syntax).
+  `auth' is one of the symbols `simple', `krbv41' or `krbv42'
   `passwd' is the password to use for simple authentication.
   `deref' is one of the symbols `never', `always', `search' or `find'.
   `timelimit' is the timeout limit for the connection in seconds.
@@ -512,6 +514,7 @@
 		  ldap-default-base))
 	(scope (plist-get search-plist 'scope))
 	(binddn (plist-get search-plist 'binddn))
+        (auth (plist-get search-plist 'auth))
 	(passwd (plist-get search-plist 'passwd))
 	(deref (plist-get search-plist 'deref))
 	(timelimit (plist-get search-plist 'timelimit))
@@ -541,6 +544,9 @@
       (if (and binddn
 	       (not (equal "" binddn)))
 	  (setq arglist (nconc arglist (list (format "-D%s" binddn)))))
+      (if (and auth
+	       (equal 'simple auth))
+	  (setq arglist (nconc arglist (list "-x"))))
       (if (and passwd
 	       (not (equal "" passwd)))
 	  (setq arglist (nconc arglist (list (format "-w%s" passwd)))))
--- a/lisp/net/rcirc.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/net/rcirc.el	Thu Sep 14 09:24:00 2006 +0000
@@ -142,7 +142,7 @@
 		 (integer :tag "Number of lines"))
   :group 'rcirc)
 
-(defcustom rcirc-show-maximum-output t
+(defcustom rcirc-scroll-show-maximum-output t
   "*If non-nil, scroll buffer to keep the point at the bottom of
 the window."
   :type 'boolean
@@ -762,8 +762,6 @@
   (add-hook 'change-major-mode-hook 'rcirc-change-major-mode-hook nil t)
   (add-hook 'kill-buffer-hook 'rcirc-kill-buffer-hook nil t)
 
-  (add-hook 'window-scroll-functions 'rcirc-scroll-to-bottom nil t)
-
   ;; add to buffer list, and update buffer abbrevs
   (when target				; skip server buffer
     (let ((buffer (current-buffer)))
@@ -1166,14 +1164,6 @@
 (defvar rcirc-last-sender nil)
 (make-variable-buffer-local 'rcirc-last-sender)
 
-(defun rcirc-scroll-to-bottom (window display-start)
-  "Scroll window to show maximum output if `rcirc-show-maximum-output' is
-non-nil."
-  (when rcirc-show-maximum-output
-    (with-selected-window window
-      (when (>= (window-point) rcirc-prompt-end-marker)
-	(recenter -1)))))
-
 (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,
@@ -1252,17 +1242,33 @@
 
 	  ;; set the window point for buffers show in windows
 	  (walk-windows (lambda (w)
-			  (unless (eq (selected-window) w)
-			    (when (and (eq (current-buffer)
-					   (window-buffer w))
-				       (>= (window-point w)
-					   rcirc-prompt-end-marker))
-			      (set-window-point w (point-max)))))
+			  (when (and (not (eq (selected-window) w))
+				     (eq (current-buffer)
+					 (window-buffer w))
+				     (>= (window-point w)
+					 rcirc-prompt-end-marker))
+			    (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
+	  (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))
+						 1)
+					      0)
+				      (recenter -1)))))))
+			  nil t))
+
 	  ;; flush undo (can we do something smarter here?)
 	  (buffer-disable-undo)
 	  (buffer-enable-undo))
@@ -1545,8 +1551,8 @@
 		   (dolist (type rcirc-activity-types)
 		     (rcirc-add-face 0 (length s)
 				     (case type
-				       ('nick 'rcirc-track-nick)
-				       ('keyword 'rcirc-track-keyword))
+				       (nick 'rcirc-track-nick)
+				       (keyword 'rcirc-track-keyword))
 				     s)))
 		 s))
 	     buffers ","))
--- a/lisp/novice.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/novice.el	Thu Sep 14 09:24:00 2006 +0000
@@ -44,6 +44,8 @@
 ;;;###autoload
 (define-obsolete-variable-alias 'disabled-command-hook 'disabled-command-function "22.1")
 
+;; It is ok here to assume that this-command is a symbol
+;; because we won't get called otherwise.
 ;;;###autoload
 (defun disabled-command-function (&rest ignore)
   (let (char)
--- a/lisp/pcvs-defs.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/pcvs-defs.el	Thu Sep 14 09:24:00 2006 +0000
@@ -98,7 +98,7 @@
 There is no need to set this if $CVSROOT is set to a correct value.")
 
 (defcustom cvs-auto-remove-handled nil
-  "*If up-to-date files should be acknowledged automatically.
+  "If up-to-date files should be acknowledged automatically.
 If T, they will be removed from the *cvs* buffer after every command.
 If DELAYED, they will be removed from the *cvs* buffer before every command.
 If STATUS, they will only be removed after a `cvs-mode-status' command.
@@ -107,24 +107,24 @@
   :type '(choice (const nil) (const status) (const delayed) (const t)))
 
 (defcustom cvs-auto-remove-directories 'handled
-  "*If ALL, directory entries will never be shown.
+  "If ALL, directory entries will never be shown.
 If HANDLED, only non-handled directories will be shown.
 If EMPTY, only non-empty directories will be shown."
   :group 'pcl-cvs
   :type '(choice (const :tag "No" nil) (const all) (const handled) (const empty)))
 
 (defcustom cvs-auto-revert t
-  "*Non-nil if changed files should automatically be reverted."
+  "Non-nil if changed files should automatically be reverted."
   :group 'pcl-cvs
   :type '(boolean))
 
 (defcustom cvs-sort-ignore-file t
-  "*Non-nil if `cvs-mode-ignore' should sort the .cvsignore automatically."
+  "Non-nil if `cvs-mode-ignore' should sort the .cvsignore automatically."
   :group 'pcl-cvs
   :type '(boolean))
 
 (defcustom cvs-force-dir-tag t
-  "*If non-nil, tagging can only be applied to directories.
+  "If non-nil, tagging can only be applied to directories.
 Tagging should generally be applied a directory at a time, but sometimes it is
 useful to be able to tag a single file.  The normal way to do that is to use
 `cvs-mode-force-command' so as to temporarily override the restrictions,"
@@ -132,7 +132,7 @@
   :type '(boolean))
 
 (defcustom cvs-default-ignore-marks nil
-  "*Non-nil if cvs mode commands should ignore any marked files.
+  "Non-nil if cvs mode commands should ignore any marked files.
 Normally they run on the files that are marked (with `cvs-mode-mark'),
 or the file under the cursor if no files are marked.  If this variable
 is set to a non-nil value they will by default run on the file on the
@@ -151,7 +151,7 @@
     (when (and cvs-force-dir-tag (not cvs-default-ignore-marks))
       (push "tag" l))
     l)
-  "*List of cvs commands that invert the default ignore-mark behavior.
+  "List of cvs commands that invert the default ignore-mark behavior.
 Commands in this set will use the opposite default from the one set
 in `cvs-default-ignore-marks'."
   :group 'pcl-cvs
@@ -160,7 +160,7 @@
 	      (const "ignore")))
 
 (defcustom cvs-confirm-removals t
-  "*Ask for confirmation before removing files.
+  "Ask for confirmation before removing files.
 Non-nil means that PCL-CVS will ask confirmation before removing files
 except for files whose content can readily be recovered from the repository.
 A value of `list' means that the list of files to be deleted will be
@@ -171,7 +171,7 @@
 		 (const nil)))
 
 (defcustom cvs-add-default-message nil
-  "*Default message to use when adding files.
+  "Default message to use when adding files.
 If set to nil, `cvs-mode-add' will always prompt for a message."
   :group 'pcl-cvs
   :type '(choice (const :tag "Prompt" nil)
@@ -195,7 +195,7 @@
     ("tree" "*cvs-info*" cvs-status-mode)
     ("message" "*cvs-commit*" nil log-edit)
     ("log" "*cvs-info*" log-view-mode))
-  "*Buffer name and mode to be used for each command.
+  "Buffer name and mode to be used for each command.
 This is a list of elements of the form
 
 	(CMD BUFNAME MODE &optional POSTPROC)
@@ -250,7 +250,7 @@
   (if (fboundp 'ediff)
       '(cvs-ediff-diff . cvs-ediff-merge)
     '(cvs-emerge-diff . cvs-emerge-merge))
-  "*Pair of functions to be used for resp.  diff'ing and merg'ing interactively."
+  "Pair of functions to be used for resp.  diff'ing and merg'ing interactively."
   :group 'pcl-cvs
   :type '(choice (const :tag "Ediff" (cvs-ediff-diff . cvs-ediff-merge))
 		 (const :tag "Emerge" (cvs-emerge-diff . cvs-emerge-merge))))
--- a/lisp/pgg-def.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/pgg-def.el	Thu Sep 14 09:24:00 2006 +0000
@@ -71,6 +71,13 @@
   :group 'pgg
   :type 'integer)
 
+(defcustom pgg-passphrase-coding-system
+  (if (boundp 'locale-coding-system)
+      locale-coding-system)
+  "Coding system to encode passphrase."
+  :group 'pgg
+  :type 'coding-system)
+
 (defvar pgg-messages-coding-system nil
   "Coding system used when reading from a PGP external process.")
 
--- a/lisp/pgg-gpg.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/pgg-gpg.el	Thu Sep 14 09:24:00 2006 +0000
@@ -91,11 +91,11 @@
 	  (set-process-sentinel process #'ignore)
 	  (when passphrase
 	    (setq passphrase-with-newline (concat passphrase "\n"))
-	    (if (boundp 'locale-coding-system)
+	    (if pgg-passphrase-coding-system
 		(progn
 		  (setq encoded-passphrase-with-new-line
 			(encode-coding-string passphrase-with-newline
-					      locale-coding-system))
+					      pgg-passphrase-coding-system))
 		  (pgg-clear-string passphrase-with-newline))
 	      (setq encoded-passphrase-with-new-line passphrase-with-newline
 		    passphrase-with-newline nil))
--- a/lisp/play/life.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/play/life.el	Thu Sep 14 09:24:00 2006 +0000
@@ -269,7 +269,8 @@
   (recenter 0)
 
   ;; Redisplay; if the user has hit a key, exit the loop.
-  (or (eq t (sit-for sleeptime))
+  (or (and (sit-for sleeptime) (< 0 sleeptime))
+      (not (input-pending-p))
       (throw 'life-exit nil)))
 
 (defun life-extinct-quit ()
--- a/lisp/progmodes/cfengine.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/progmodes/cfengine.el	Thu Sep 14 09:24:00 2006 +0000
@@ -85,6 +85,12 @@
     ;; File, acl &c in group:   { token ... }
     ("{[ \t]*\\([^ \t\n]+\\)" 1 font-lock-constant-face)))
 
+(defconst cfengine-font-lock-syntactic-keywords
+  ;; In the main syntax-table, backslash is marked as a punctuation, because
+  ;; of its use in DOS-style directory separators.  Here we try to recognize
+  ;; the cases where backslash is used as an escape inside strings.
+  '(("\\(\\(?:\\\\\\)+\\)\"" . "\\")))
+
 (defvar cfengine-imenu-expression
   `((nil ,(concat "^[ \t]*" (eval-when-compile
 			      (regexp-opt cfengine-actions t))
@@ -218,7 +224,7 @@
   ;; variable substitution:
   (modify-syntax-entry ?$ "." cfengine-mode-syntax-table)
   ;; Doze path separators:
-  (modify-syntax-entry ?\\ "_" cfengine-mode-syntax-table)
+  (modify-syntax-entry ?\\ "." cfengine-mode-syntax-table)
   ;; Otherwise, syntax defaults seem OK to give reasonable word
   ;; movement.
 
@@ -237,7 +243,9 @@
   ;; functions in evaluated classes to string syntax, and then obey
   ;; syntax properties.
   (setq font-lock-defaults
-	'(cfengine-font-lock-keywords nil nil nil beginning-of-line))
+	'(cfengine-font-lock-keywords nil nil nil beginning-of-line
+          (font-lock-syntactic-keywords
+           . cfengine-font-lock-syntactic-keywords)))
   (setq imenu-generic-expression cfengine-imenu-expression)
   (set (make-local-variable 'beginning-of-defun-function)
        #'cfengine-beginning-of-defun)
@@ -249,5 +257,5 @@
 
 (provide 'cfengine)
 
-;;; arch-tag: 6b931be2-1505-4124-afa6-9675971e26d4
+;; arch-tag: 6b931be2-1505-4124-afa6-9675971e26d4
 ;;; cfengine.el ends here
--- a/lisp/progmodes/compile.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/progmodes/compile.el	Thu Sep 14 09:24:00 2006 +0000
@@ -625,7 +625,7 @@
 		   (cons (match-string-no-properties idx) dir))
       mouse-face highlight
       keymap compilation-button-map
-      help-echo "mouse-2: visit current directory")))
+      help-echo "mouse-2: visit this directory")))
 
 ;; Data type `reverse-ordered-alist' retriever.	 This function retrieves the
 ;; KEY element from the ALIST, creating it in the right position if not already
@@ -1068,7 +1068,8 @@
 			      (window-width))))
 	      ;; Set the EMACS variable, but
 	      ;; don't override users' setting of $EMACS.
-	      (unless (getenv "EMACS") '("EMACS=t"))
+	      (unless (getenv "EMACS")
+		(list (concat "EMACS=" invocation-directory invocation-name)))
 	      (copy-sequence process-environment))))
 	(set (make-local-variable 'compilation-arguments)
 	     (list command mode name-function highlight-regexp))
--- a/lisp/progmodes/idlwave.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/progmodes/idlwave.el	Thu Sep 14 09:24:00 2006 +0000
@@ -75,7 +75,7 @@
 ;; of the documentation is available from the maintainers webpage (see
 ;; SOURCE).
 ;;
-;; 
+;;
 ;; ACKNOWLEDGMENTS
 ;; ===============
 ;;
@@ -125,7 +125,7 @@
 ;;   up inserting the character that expanded the abbrev after moving
 ;;   point backward, e.g., "\cl" expanded with a space becomes
 ;;   "LONG( )" with point before the close paren.  This is solved by
-;;   using a temporary function in `post-command-hook' - not pretty, 
+;;   using a temporary function in `post-command-hook' - not pretty,
 ;;   but it works.
 ;;
 ;;   Tabs and spaces are treated equally as whitespace when filling a
@@ -178,13 +178,13 @@
       nil ;; We've got what we needed
     ;; We have the old or no custom-library, hack around it!
     (defmacro defgroup (&rest args) nil)
-    (defmacro defcustom (var value doc &rest args) 
+    (defmacro defcustom (var value doc &rest args)
       `(defvar ,var ,value ,doc))))
 
 (defgroup idlwave nil
   "Major mode for editing IDL .pro files."
   :tag "IDLWAVE"
-  :link '(url-link :tag "Home Page" 
+  :link '(url-link :tag "Home Page"
 		   "http://idlwave.org")
   :link '(emacs-commentary-link :tag "Commentary in idlw-shell.el"
 				"idlw-shell.el")
@@ -298,8 +298,8 @@
 
 (defcustom idlwave-auto-fill-split-string t
   "*If non-nil then auto fill will split strings with the IDL `+' operator.
-When the line end falls within a string, string concatenation with the 
-'+' operator will be used to distribute a long string over lines.  
+When the line end falls within a string, string concatenation with the
+'+' operator will be used to distribute a long string over lines.
 If nil and a string is split then a terminal beep and warning are issued.
 
 This variable is ignored when `idlwave-fill-comment-line-only' is
@@ -418,7 +418,7 @@
 	       (const :tag "When saving a buffer" save-buffer)
 	       (const :tag "After a buffer was killed" kill-buffer)
 	       (const :tag "After a buffer was compiled successfully, update shell info" compile-buffer))))
-	       
+
 (defcustom idlwave-rinfo-max-source-lines 5
   "*Maximum number of source files displayed in the Routine Info window.
 When an integer, it is the maximum number of source files displayed.
@@ -453,7 +453,7 @@
   :type 'directory)
 
 ;; Configuration files
-(defcustom idlwave-config-directory 
+(defcustom idlwave-config-directory
   (convert-standard-filename "~/.idlwave")
   "*Directory for configuration files and user-library catalog."
   :group 'idlwave-routine-info
@@ -469,7 +469,7 @@
 (defcustom idlwave-special-lib-alist nil
   "Alist of regular expressions matching special library directories.
 When listing routine source locations, IDLWAVE gives a short hint where
-the file defining the routine is located.  By default it lists `SystemLib' 
+the file defining the routine is located.  By default it lists `SystemLib'
 for routines in the system library `!DIR/lib' and `Library' for anything
 else.  This variable can define additional types.  The car of each entry
 is a regular expression matching the file name (they normally will match
@@ -480,7 +480,7 @@
 	  (cons regexp string)))
 
 (defcustom idlwave-auto-write-paths t
-  "Write out path (!PATH) and system directory (!DIR) info automatically.  
+  "Write out path (!PATH) and system directory (!DIR) info automatically.
 Path info is needed to locate library catalog files.  If non-nil,
 whenever the path-list changes as a result of shell-query, etc., it is
 written to file.  Otherwise, the menu option \"Write Paths\" can be
@@ -511,7 +511,7 @@
 This variable determines the case (UPPER/lower/Capitalized...) of
 words inserted into the buffer by completion.  The preferred case can
 be specified separately for routine names, keywords, classes and
-methods. 
+methods.
 This alist should therefore have entries for `routine' (normal
 functions and procedures, i.e. non-methods), `keyword', `class', and
 `method'.  Plausible values are
@@ -598,7 +598,7 @@
 for which to assume this can be set here."
   :group 'idlwave-routine-info
   :type '(repeat (regexp :tag "Match method:")))
-  
+
 
 (defcustom idlwave-completion-show-classes 1
   "*Number of classes to show when completing object methods and keywords.
@@ -663,7 +663,7 @@
 specify if the class should be found during method and keyword
 completion, respectively.
 
-The alist may have additional entries specifying exceptions from the 
+The alist may have additional entries specifying exceptions from the
 keyword completion rule for specific methods, like INIT or
 GETPROPERTY.  In order to turn on class specification for the INIT
 method, add an entry (\"INIT\" . t).  The method name must be ALL-CAPS."
@@ -687,7 +687,7 @@
 value of the variable `idlwave-query-class'.
 
 When you specify a class, this information can be stored as a text
-property on the `->' arrow in the source code, so that during the same 
+property on the `->' arrow in the source code, so that during the same
 editing session, IDLWAVE will not have to ask again.  When this
 variable is non-nil, IDLWAVE will store and reuse the class information.
 The class stored can be checked and removed with `\\[idlwave-routine-info]'
@@ -1065,7 +1065,7 @@
   :group 'idlwave-misc
   :type 'boolean)
 
-(defcustom idlwave-default-font-lock-items 
+(defcustom idlwave-default-font-lock-items
   '(pros-and-functions batch-files idlwave-idl-keywords label goto
 		       common-blocks class-arrows)
   "Items which should be fontified on the default fontification level 2.
@@ -1127,25 +1127,25 @@
 ;;; and Carsten Dominik...
 
 ;; The following are the reserved words in IDL.  Maybe we should
-;; highlight some more stuff as well?       
+;; highlight some more stuff as well?
 ;; Procedure declarations.  Fontify keyword plus procedure name.
 (defvar idlwave-idl-keywords
-  ;; To update this regexp, update the list of keywords and 
+  ;; To update this regexp, update the list of keywords and
   ;; evaluate the form.
-  ;;	(insert 
+  ;;	(insert
   ;;	 (prin1-to-string
-  ;;	  (concat 
+  ;;	  (concat
   ;;	   "\\<\\("
-  ;;	   (regexp-opt 
+  ;;	   (regexp-opt
   ;;	    '("||" "&&" "and" "or" "xor" "not"
-  ;;	      "eq" "ge" "gt" "le" "lt" "ne" 
+  ;;	      "eq" "ge" "gt" "le" "lt" "ne"
   ;;	      "for" "do" "endfor"
-  ;;	      "if" "then" "endif" "else" "endelse" 
+  ;;	      "if" "then" "endif" "else" "endelse"
   ;;	      "case" "of" "endcase"
   ;;	      "switch" "break" "continue" "endswitch"
   ;;	      "begin" "end"
   ;;	      "repeat" "until" "endrep"
-  ;;	      "while" "endwhile" 
+  ;;	      "while" "endwhile"
   ;;	      "goto" "return"
   ;;	      "inherits" "mod"
   ;;	      "compile_opt" "forward_function"
@@ -1168,7 +1168,7 @@
 	  (2 font-lock-reference-face nil t)      ; block name
 	  ("[ \t]*\\(\\sw+\\)[ ,]*"
 	   ;; Start with point after block name and comma
-	   (goto-char (match-end 0))  ; needed for XEmacs, could be nil 
+	   (goto-char (match-end 0))  ; needed for XEmacs, could be nil
 	   nil
 	   (1 font-lock-variable-name-face)       ; variable names
 	   )))
@@ -1223,7 +1223,7 @@
        ;; All operators (not used because too noisy)
        (all-operators
 	'("[-*^#+<>/]" (0 font-lock-keyword-face)))
-	
+
        ;; Arrows with text property `idlwave-class'
        (class-arrows
 	'(idlwave-match-class-arrows (0 idlwave-class-arrow-face))))
@@ -1260,14 +1260,14 @@
 
 (defvar idlwave-font-lock-defaults
   '((idlwave-font-lock-keywords
-     idlwave-font-lock-keywords-1 
+     idlwave-font-lock-keywords-1
      idlwave-font-lock-keywords-2
      idlwave-font-lock-keywords-3)
-    nil t 
-    ((?$ . "w") (?_ . "w") (?. . "w") (?| . "w") (?& . "w")) 
+    nil t
+    ((?$ . "w") (?_ . "w") (?. . "w") (?| . "w") (?& . "w"))
     beginning-of-line))
 
-(put 'idlwave-mode 'font-lock-defaults 
+(put 'idlwave-mode 'font-lock-defaults
      idlwave-font-lock-defaults) ; XEmacs
 
 (defconst idlwave-comment-line-start-skip "^[ \t]*;"
@@ -1275,7 +1275,7 @@
 That is the _beginning_ of a line containing a comment delimiter `;' preceded
 only by whitespace.")
 
-(defconst idlwave-begin-block-reg 
+(defconst idlwave-begin-block-reg
   "\\<\\(pro\\|function\\|begin\\|case\\|switch\\)\\>"
   "Regular expression to find the beginning of a block. The case does
 not matter. The search skips matches in comments.")
@@ -1352,17 +1352,17 @@
    '(goto . ("goto\\>" nil))
    '(case . ("case\\>" nil))
    '(switch . ("switch\\>" nil))
-   (cons 'call (list (concat "\\(" idlwave-variable "\\) *= *" 
+   (cons 'call (list (concat "\\(" idlwave-variable "\\) *= *"
 			     "\\(" idlwave-method-call "\\s *\\)?"
 			     idlwave-identifier
 			     "\\s *(") nil))
-   (cons 'call (list (concat 
+   (cons 'call (list (concat
 		      "\\(" idlwave-method-call "\\s *\\)?"
-		      idlwave-identifier 
+		      idlwave-identifier
 		      "\\( *\\($\\|\\$\\)\\|\\s *,\\)") nil))
-   (cons 'assign (list (concat 
+   (cons 'assign (list (concat
 			"\\(" idlwave-variable "\\) *=") nil)))
-  
+
   "Associated list of statement matching regular expressions.
 Each regular expression matches the start of an IDL statement.  The
 first element of each association is a symbol giving the statement
@@ -1385,7 +1385,7 @@
 ;; Note that this is documented in the v18 manuals as being a string
 ;; of length one rather than a single character.
 ;; The code in this file accepts either format for compatibility.
-(defvar idlwave-comment-indent-char ?\ 
+(defvar idlwave-comment-indent-char ?\
   "Character to be inserted for IDL comment indentation.
 Normally a space.")
 
@@ -1557,15 +1557,15 @@
 	 (not (equal idlwave-shell-debug-modifiers '())))
   ;; Bind the debug commands also with the special modifiers.
   (let ((shift (memq 'shift idlwave-shell-debug-modifiers))
-	(mods-noshift (delq 'shift 
+	(mods-noshift (delq 'shift
 			    (copy-sequence idlwave-shell-debug-modifiers))))
-    (define-key idlwave-mode-map 
+    (define-key idlwave-mode-map
       (vector (append mods-noshift (list (if shift ?C ?c))))
       'idlwave-shell-save-and-run)
-    (define-key idlwave-mode-map 
+    (define-key idlwave-mode-map
       (vector (append mods-noshift (list (if shift ?B ?b))))
       'idlwave-shell-break-here)
-    (define-key idlwave-mode-map 
+    (define-key idlwave-mode-map
       (vector (append mods-noshift (list (if shift ?E ?e))))
       'idlwave-shell-run-region)))
 (define-key idlwave-mode-map "\C-c\C-d\C-c" 'idlwave-shell-save-and-run)
@@ -1602,7 +1602,7 @@
 (define-key idlwave-mode-map "\M-\C-i" 'idlwave-complete)
 (define-key idlwave-mode-map "\C-c\C-i" 'idlwave-update-routine-info)
 (define-key idlwave-mode-map "\C-c="    'idlwave-resolve)
-(define-key idlwave-mode-map 
+(define-key idlwave-mode-map
   (if (featurep 'xemacs) [(shift button3)] [(shift mouse-3)])
   'idlwave-mouse-context-help)
 
@@ -1617,7 +1617,7 @@
 ;; to go ahead of > and <, so >= and <= will be treated correctly
 (idlwave-action-and-binding "="  '(idlwave-expand-equal -1 -1))
 
-;; Actions for > and < are complicated by >=, <=, and ->... 
+;; Actions for > and < are complicated by >=, <=, and ->...
 (idlwave-action-and-binding "<"  '(idlwave-custom-ltgtr-surround nil))
 (idlwave-action-and-binding ">"  '(idlwave-custom-ltgtr-surround 'gtr))
 
@@ -1650,7 +1650,7 @@
       (error (apply 'define-abbrev args)))))
 
 (condition-case nil
-    (modify-syntax-entry (string-to-char idlwave-abbrev-start-char) 
+    (modify-syntax-entry (string-to-char idlwave-abbrev-start-char)
 			 "w" idlwave-mode-syntax-table)
   (error nil))
 
@@ -1774,7 +1774,7 @@
 (defvar imenu-extract-index-name-function)
 (defvar imenu-prev-index-position-function)
 ;; defined later - so just make the compiler hush
-(defvar idlwave-mode-menu)  
+(defvar idlwave-mode-menu)
 (defvar idlwave-mode-debug-menu)
 
 ;;;###autoload
@@ -1858,7 +1858,7 @@
    \\i         IF statement template
    \\elif      IF-ELSE statement template
    \\b         BEGIN
-   
+
    For a full list, use \\[idlwave-list-abbrevs].  Some templates also
    have direct keybindings - see the list of keybindings below.
 
@@ -1900,19 +1900,19 @@
 
   (interactive)
   (kill-all-local-variables)
-  
+
   (if idlwave-startup-message
       (message "Emacs IDLWAVE mode version %s." idlwave-mode-version))
   (setq idlwave-startup-message nil)
-  
+
   (setq local-abbrev-table idlwave-mode-abbrev-table)
   (set-syntax-table idlwave-mode-syntax-table)
-  
+
   (set (make-local-variable 'indent-line-function) 'idlwave-indent-and-action)
-  
+
   (make-local-variable idlwave-comment-indent-function)
   (set idlwave-comment-indent-function 'idlwave-comment-hook)
-  
+
   (set (make-local-variable 'comment-start-skip) ";+[ \t]*")
   (set (make-local-variable 'comment-start) ";")
   (set (make-local-variable 'comment-add) 1) ; ";;" for new and regions
@@ -1920,7 +1920,7 @@
   (set (make-local-variable 'abbrev-all-caps) t)
   (set (make-local-variable 'indent-tabs-mode) nil)
   (set (make-local-variable 'completion-ignore-case) t)
-  
+
   (use-local-map idlwave-mode-map)
 
   (when (featurep 'easymenu)
@@ -1930,11 +1930,11 @@
   (setq mode-name "IDLWAVE")
   (setq major-mode 'idlwave-mode)
   (setq abbrev-mode t)
-  
+
   (set (make-local-variable idlwave-fill-function) 'idlwave-auto-fill)
   (setq comment-end "")
   (set (make-local-variable 'comment-multi-line) nil)
-  (set (make-local-variable 'paragraph-separate) 
+  (set (make-local-variable 'paragraph-separate)
        "[ \t\f]*$\\|[ \t]*;+[ \t]*$\\|;+[+=-_*]+$")
   (set (make-local-variable 'paragraph-start) "[ \t\f]\\|[ \t]*;+[ \t]")
   (set (make-local-variable 'paragraph-ignore-fill-prefix) nil)
@@ -1943,7 +1943,7 @@
   ;; Set tag table list to use IDLTAGS as file name.
   (if (boundp 'tag-table-alist)
       (add-to-list 'tag-table-alist '("\\.pro$" . "IDLTAGS")))
-  
+
   ;; Font-lock additions - originally Phil Williams, then Ulrik Dickow
   ;; Following line is for Emacs - XEmacs uses the corresponding property
   ;; on the `idlwave-mode' symbol.
@@ -1968,7 +1968,7 @@
 		     idlwave-end-block-reg
 		     ";"
 		     'idlwave-forward-block nil))
-  
+
 
   ;; Make a local post-command-hook and add our hook to it
   ;; NB: `make-local-hook' needed for older/alternative Emacs compatibility
@@ -2000,16 +2000,16 @@
   (unless idlwave-setup-done
     (if (not (file-directory-p idlwave-config-directory))
 	(make-directory idlwave-config-directory))
-    (setq 
-     idlwave-user-catalog-file (expand-file-name 
-				idlwave-user-catalog-file 
+    (setq
+     idlwave-user-catalog-file (expand-file-name
+				idlwave-user-catalog-file
 				idlwave-config-directory)
-     idlwave-xml-system-rinfo-converted-file 
-     (expand-file-name 
+     idlwave-xml-system-rinfo-converted-file
+     (expand-file-name
       idlwave-xml-system-rinfo-converted-file
       idlwave-config-directory)
-     idlwave-path-file (expand-file-name 
-			idlwave-path-file 
+     idlwave-path-file (expand-file-name
+			idlwave-path-file
 			idlwave-config-directory))
     (idlwave-read-paths)  ; we may need these early
     (setq idlwave-setup-done t)))
@@ -2028,7 +2028,7 @@
 
 ;;
 ;; Code Formatting ----------------------------------------------------
-;; 
+;;
 
 (defun idlwave-hard-tab ()
   "Inserts TAB in buffer in current position."
@@ -2171,7 +2171,7 @@
 	(if (> end-pos eol-pos)
 	    (setq end-pos pos))
 	(goto-char end-pos)
-	(setq end (buffer-substring 
+	(setq end (buffer-substring
 		   (progn
 		     (skip-chars-backward "a-zA-Z")
 		     (point))
@@ -2193,7 +2193,7 @@
 	    (sit-for 1))
 	   (t
 	    (beep)
-	    (message "Warning: Shouldn't this be \"%s\" instead of \"%s\"?" 
+	    (message "Warning: Shouldn't this be \"%s\" instead of \"%s\"?"
 		     end1 end)
 	    (sit-for 1))))))))
   ;;(delete-char 1))
@@ -2205,8 +2205,8 @@
        ((looking-at "pro\\|case\\|switch\\|function\\>")
 	(assoc (downcase (match-string 0)) idlwave-block-matches))
        ((looking-at "begin\\>")
-	(let ((limit (save-excursion 
-		       (idlwave-beginning-of-statement) 
+	(let ((limit (save-excursion
+		       (idlwave-beginning-of-statement)
 		       (point))))
 	  (cond
 	   ((re-search-backward ":[ \t]*\\=" limit t)
@@ -2490,7 +2490,7 @@
         (let ((eos (save-excursion
                      (idlwave-block-jump-out -1 'nomark)
                      (point))))
-          (if (setq status (idlwave-find-key 
+          (if (setq status (idlwave-find-key
 			    idlwave-end-block-reg -1 'nomark eos))
               (idlwave-beginning-of-statement)
             (message "No nested block before beginning of containing block.")))
@@ -2498,7 +2498,7 @@
       (let ((eos (save-excursion
                    (idlwave-block-jump-out 1 'nomark)
                    (point))))
-        (if (setq status (idlwave-find-key 
+        (if (setq status (idlwave-find-key
 			  idlwave-begin-block-reg 1 'nomark eos))
             (idlwave-end-of-statement)
           (message "No nested block before end of containing block."))))
@@ -2512,7 +2512,7 @@
         (here (point)))
     (goto-char (point-max))
     (if (re-search-backward idlwave-doclib-start nil t)
-        (progn 
+        (progn
 	  (setq beg (progn (beginning-of-line) (point)))
 	  (if (re-search-forward idlwave-doclib-end nil t)
 	      (progn
@@ -2545,7 +2545,7 @@
    ((eq major-mode 'idlwave-shell-mode)
     (if (re-search-backward idlwave-shell-prompt-pattern nil t)
 	(goto-char (match-end 0))))
-   (t	
+   (t
     (if (save-excursion (forward-line -1) (idlwave-is-continuation-line))
 	(idlwave-previous-statement)
       (beginning-of-line)))))
@@ -2622,7 +2622,7 @@
   (let ((save-point (point)))
     (when (re-search-forward ".*&" lim t)
       (goto-char (match-end 0))
-      (if (idlwave-quoted) 
+      (if (idlwave-quoted)
 	  (goto-char save-point)
 	(if (eq (char-after (- (point) 2)) ?&) (goto-char save-point))))
     (point)))
@@ -2639,7 +2639,7 @@
   ;; - not in parenthesis (like a[0:3])
   ;; - not followed by another ":" in explicit class, ala a->b::c
   ;; As many in this mode, this function is heuristic and not an exact
-  ;; parser. 
+  ;; parser.
   (let* ((start (point))
 	 (eos (save-excursion (idlwave-end-of-statement) (point)))
 	 (end (idlwave-find-key ":" 1 'nomark eos)))
@@ -2716,7 +2716,7 @@
 `idlwave-pad-keyword' is t then keyword assignment is treated just
 like assignment statements.  When nil, spaces are removed for keyword
 assignment.  Any other value keeps the current space around the `='.
-Limits in for loops are treated as keyword assignment.  
+Limits in for loops are treated as keyword assignment.
 
 Starting with IDL 6.0, a number of op= assignments are available.
 Since ambiguities of the form:
@@ -2733,25 +2733,25 @@
 
 See `idlwave-surround'."
   (if idlwave-surround-by-blank
-      (let 
+      (let
 	  ((non-an-ops "\\(##\\|\\*\\|\\+\\|-\\|/\\|<\\|>\\|\\^\\)\\=")
-	   (an-ops 
+	   (an-ops
 	    "\\s-\\(AND\\|EQ\\|GE\\|GT\\|LE\\|LT\\|MOD\\|NE\\|OR\\|XOR\\)\\=")
 	   (len 1))
-	
-	(save-excursion 
+
+	(save-excursion
 	  (let ((case-fold-search t))
 	    (backward-char)
-	    (if (or 
+	    (if (or
 		 (re-search-backward non-an-ops nil t)
 		 ;; Why doesn't ##? work for both?
-		 (re-search-backward "\\(#\\)\\=" nil t)) 
+		 (re-search-backward "\\(#\\)\\=" nil t))
 		(setq len (1+ (length (match-string 1))))
 	      (when (re-search-backward an-ops nil t)
 		;(setq begin nil) ; won't modify begin
 		(setq len (1+ (length (match-string 1))))))))
-	
-	(if (eq t idlwave-pad-keyword)  
+
+	(if (eq t idlwave-pad-keyword)
 	    ;; Everything gets padded equally
 	    (idlwave-surround before after len)
 	  ;; Treating keywords/for variables specially...
@@ -2762,22 +2762,22 @@
 			(skip-chars-backward "= \t")
 			(nth 2 (idlwave-where)))))
 	    (cond ((or (memq what '(function-keyword procedure-keyword))
-		       (memq (caar st) '(for pdef))) 
-		   (cond 
+		       (memq (caar st) '(for pdef)))
+		   (cond
 		    ((null idlwave-pad-keyword)
 		     (idlwave-surround 0 0)
 		     ) ; remove space
 		    (t))) ; leave any spaces alone
 		  (t (idlwave-surround before after len))))))))
-	      
+
 
 (defun idlwave-indent-and-action (&optional arg)
   "Call `idlwave-indent-line' and do expand actions.
 With prefix ARG non-nil, indent the entire sub-statement."
   (interactive "p")
   (save-excursion
-    (if	(and idlwave-expand-generic-end 
-	     (re-search-backward "\\<\\(end\\)\\s-*\\=" 
+    (if	(and idlwave-expand-generic-end
+	     (re-search-backward "\\<\\(end\\)\\s-*\\="
 				 (max 0 (- (point) 10)) t)
 	     (looking-at "\\(end\\)\\([ \n\t]\\|\\'\\)"))
 	(progn (goto-char (match-end 1))
@@ -2787,7 +2787,7 @@
   (when (and (not arg) current-prefix-arg)
     (setq arg current-prefix-arg)
     (setq current-prefix-arg nil))
-  (if arg 
+  (if arg
       (idlwave-indent-statement)
     (idlwave-indent-line t)))
 
@@ -2922,7 +2922,7 @@
 		(save-excursion
 		  (cond
 		   ;; Beginning of file
-		   ((prog1 
+		   ((prog1
 			(idlwave-previous-statement)
 		      (setq beg-prev-pos (point)))
 		    0)
@@ -2932,7 +2932,7 @@
 		       idlwave-main-block-indent))
 		   ;; Begin block
 		   ((idlwave-look-at idlwave-begin-block-reg t)
-		    (+ (idlwave-min-current-statement-indent) 
+		    (+ (idlwave-min-current-statement-indent)
 		       idlwave-block-indent))
 		   ;; End Block
 		   ((idlwave-look-at idlwave-end-block-reg t)
@@ -2943,7 +2943,7 @@
 		      (idlwave-min-current-statement-indent)))
 		      ;;		      idlwave-end-offset
 		      ;;		      idlwave-block-indent))
-		   
+
 		   ;; Default to current indent
 		   ((idlwave-current-statement-indent))))))
           ;; adjust the indentation based on the current statement
@@ -2959,7 +2959,7 @@
 
 (defun idlwave-calculate-paren-indent (beg-reg end-reg close-exp)
   "Calculate the continuation indent inside a paren group.
-Returns a cons-cell with (open . indent), where open is the 
+Returns a cons-cell with (open . indent), where open is the
 location of the open paren"
   (let ((open (nth 1 (parse-partial-sexp beg-reg end-reg))))
     ;; Found an innermost open paren.
@@ -3000,24 +3000,24 @@
            (end-reg (progn (beginning-of-line) (point)))
 	   (beg-last-statement (save-excursion (idlwave-previous-statement)
 					       (point)))
-           (beg-reg (progn (idlwave-start-of-substatement 'pre) 
+           (beg-reg (progn (idlwave-start-of-substatement 'pre)
 			   (if (eq (line-beginning-position) end-reg)
 			       (goto-char beg-last-statement)
 			     (point))))
 	   (basic-indent (+ (idlwave-min-current-statement-indent end-reg)
 			    idlwave-continuation-indent))
 	   fancy-nonparen-indent fancy-paren-indent)
-      (cond 
+      (cond
        ;; Align then with its matching if, etc.
        ((let ((matchers '(("\\<if\\>" . "[ \t]*then")
 			  ("\\<\\(if\\|end\\(if\\)?\\)\\>" . "[ \t]*else")
 			  ("\\<\\(for\\|while\\)\\>" . "[ \t]*do")
-			  ("\\<\\(repeat\\|end\\(rep\\)?\\)\\>" . 
+			  ("\\<\\(repeat\\|end\\(rep\\)?\\)\\>" .
 			   "[ \t]*until")
 			  ("\\<case\\>" . "[ \t]*of")))
 	      match cont-re)
 	  (goto-char end-reg)
-	  (and 
+	  (and
 	   (setq cont-re
 		 (catch 'exit
 		   (while (setq match (car matchers))
@@ -3026,7 +3026,7 @@
 		     (setq matchers (cdr matchers)))))
 	   (idlwave-find-key cont-re -1 'nomark beg-last-statement)))
 	(if (looking-at "end") ;; that one's special
-	    (- (idlwave-current-indent) 
+	    (- (idlwave-current-indent)
 	       (+ idlwave-block-indent idlwave-end-offset))
 	  (idlwave-current-indent)))
 
@@ -3052,7 +3052,7 @@
 	      (let* ((end-reg end-reg)
 		    (close-exp (progn
 				 (goto-char end-reg)
-				 (skip-chars-forward " \t") 
+				 (skip-chars-forward " \t")
 				 (looking-at "\\s)")))
 		    indent-cons)
 		(catch 'loop
@@ -3086,12 +3086,12 @@
 		   (if (save-match-data (looking-at "[ \t$]*\\(;.*\\)?$"))
 		       nil
 		     (current-column)))
-		  
+
 		  ;; Continued assignment (with =):
 		  ((catch 'assign ;
 		     (while (looking-at "[^=\n\r]*\\(=\\)[ \t]*")
 		       (goto-char (match-end 0))
-		       (if (null (idlwave-what-function beg-reg)) 
+		       (if (null (idlwave-what-function beg-reg))
 			   (throw 'assign t))))
 		   (unless (or
 			    (idlwave-in-quote)
@@ -3153,7 +3153,7 @@
   (let* ((here (point))
          (case-fold-search t)
          (limit (if (>= dir 0) (point-max) (point-min)))
-         (block-limit (if (>= dir 0) 
+         (block-limit (if (>= dir 0)
 			  idlwave-begin-block-reg
 			idlwave-end-block-reg))
          found
@@ -3164,7 +3164,7 @@
 			       (idlwave-find-key
 				idlwave-begin-unit-reg dir t limit)
 			     (end-of-line)
-			     (idlwave-find-key 
+			     (idlwave-find-key
 			      idlwave-end-unit-reg dir t limit)))
 			 limit)))
     (if (>= dir 0) (end-of-line)) ;Make sure we are in current block
@@ -3189,7 +3189,7 @@
 		  (or (null end-reg) (< (point) end-reg)))
 	(unless comm-or-empty (setq min (min min (idlwave-current-indent)))))
       (if (or comm-or-empty (and end-reg (>= (point) end-reg)))
-	  min 
+	  min
 	(min min (idlwave-current-indent))))))
 
 (defun idlwave-current-statement-indent (&optional last-line)
@@ -3216,10 +3216,10 @@
 `$') count as continuations too."
   (let (p)
     (save-excursion
-      (or 
+      (or
        (idlwave-look-at "\\<\\$")
        (catch 'loop
-	 (while (and (looking-at "^[ \t]*\\(;.*\\)?$") 
+	 (while (and (looking-at "^[ \t]*\\(;.*\\)?$")
 		     (eq (forward-line -1) 0))
 	   (if (setq p (idlwave-look-at "\\<\\$")) (throw 'loop p))))))))
 
@@ -3317,7 +3317,7 @@
                                           (beginning-of-line) (point))
                                         (point))))
                "[^;]"))
-	
+
         ;; Mark the beginning and end of the paragraph
         (goto-char bcl)
         (while (and (looking-at fill-prefix-reg)
@@ -3381,7 +3381,7 @@
                       (insert (make-string diff ?\ ))))
                 (forward-line -1))
               )
-	  
+
           ;; No hang. Instead find minimum indentation of paragraph
           ;; after first line.
           ;; For the following while statement, since START is at the
@@ -3413,7 +3413,7 @@
                   t)
                  (current-column))
                indent))
-	
+
         ;; try to keep point at its original place
         (goto-char here)
 
@@ -3462,7 +3462,7 @@
           (current-column)))))
 
 (defun idlwave-auto-fill ()
-  "Called to break lines in auto fill mode.  
+  "Called to break lines in auto fill mode.
 Only fills non-comment lines if `idlwave-fill-comment-line-only' is
 non-nil.  Places a continuation character at the end of the line if
 not in a comment.  Splits strings with IDL concatenation operator `+'
@@ -3613,7 +3613,7 @@
   (insert (current-time-string))
   (insert ", " (user-full-name))
   (if (boundp 'user-mail-address)
-      (insert " <" user-mail-address ">") 
+      (insert " <" user-mail-address ">")
     (insert " <" (user-login-name) "@" (system-name) ">"))
   ;; Remove extra spaces from line
   (idlwave-fill-paragraph)
@@ -3639,7 +3639,7 @@
 	     (setq end (match-end 0)))
 	(progn
 	  (goto-char beg)
-	  (if (re-search-forward 
+	  (if (re-search-forward
 	       (concat idlwave-doc-modifications-keyword ":")
 	       end t)
 	      (end-of-line)
@@ -3737,7 +3737,7 @@
      (not (idlwave-in-quote))
      (save-excursion
        (forward-char)
-       (re-search-backward (concat "\\(" idlwave-idl-keywords 
+       (re-search-backward (concat "\\(" idlwave-idl-keywords
 				   "\\|[[(*+-/=,^><]\\)\\s-*\\*") limit t)))))
 
 
@@ -3783,7 +3783,7 @@
 	  (indent-region beg end nil))
       (if (stringp prompt)
 	  (message prompt)))))
-  
+
 (defun idlwave-rw-case (string)
   "Make STRING have the case required by `idlwave-reserved-word-upcase'."
   (if idlwave-reserved-word-upcase
@@ -3801,7 +3801,7 @@
 (defun idlwave-case ()
   "Build skeleton IDL case statement."
   (interactive)
-  (idlwave-template 
+  (idlwave-template
    (idlwave-rw-case "case")
    (idlwave-rw-case " of\n\nendcase")
    "Selector expression"))
@@ -3809,7 +3809,7 @@
 (defun idlwave-switch ()
   "Build skeleton IDL switch statement."
   (interactive)
-  (idlwave-template 
+  (idlwave-template
    (idlwave-rw-case "switch")
    (idlwave-rw-case " of\n\nendswitch")
    "Selector expression"))
@@ -3817,7 +3817,7 @@
 (defun idlwave-for ()
   "Build skeleton for loop statment."
   (interactive)
-  (idlwave-template 
+  (idlwave-template
    (idlwave-rw-case "for")
    (idlwave-rw-case " do begin\n\nendfor")
    "Loop expression"))
@@ -3832,14 +3832,14 @@
 
 (defun idlwave-procedure ()
   (interactive)
-  (idlwave-template 
+  (idlwave-template
    (idlwave-rw-case "pro")
    (idlwave-rw-case "\n\nreturn\nend")
    "Procedure name"))
 
 (defun idlwave-function ()
   (interactive)
-  (idlwave-template 
+  (idlwave-template
    (idlwave-rw-case "function")
    (idlwave-rw-case "\n\nreturn\nend")
    "Function name"))
@@ -3853,7 +3853,7 @@
 
 (defun idlwave-while ()
   (interactive)
-  (idlwave-template 
+  (idlwave-template
    (idlwave-rw-case "while")
    (idlwave-rw-case " do begin\n\nendwhile")
    "Entry condition"))
@@ -3932,8 +3932,8 @@
 (defun idlwave-count-outlawed-buffers (tag)
   "How many outlawed buffers have tag TAG?"
   (length (delq nil
-		(mapcar 
-		 (lambda (x) (eq (cdr x) tag)) 
+		(mapcar
+		 (lambda (x) (eq (cdr x) tag))
 		 idlwave-outlawed-buffers))))
 
 (defun idlwave-do-kill-autoloaded-buffers (&rest reasons)
@@ -3947,9 +3947,9 @@
 		   (memq (cdr entry) reasons))
 	       (kill-buffer (car entry))
 	       (incf cnt)
-	       (setq idlwave-outlawed-buffers 
+	       (setq idlwave-outlawed-buffers
 		     (delq entry idlwave-outlawed-buffers)))
-	(setq idlwave-outlawed-buffers 
+	(setq idlwave-outlawed-buffers
 	      (delq entry idlwave-outlawed-buffers))))
     (message "%d buffer%s killed" cnt (if (= cnt 1) "" "s"))))
 
@@ -3961,7 +3961,7 @@
 	 (entry (assq buf idlwave-outlawed-buffers)))
     ;; Revoke license
     (if entry
-	(setq idlwave-outlawed-buffers 
+	(setq idlwave-outlawed-buffers
 	      (delq entry idlwave-outlawed-buffers)))
     ;; Remove this function from the hook.
     (remove-hook 'after-save-hook 'idlwave-revoke-license-to-kill 'local)))
@@ -3980,7 +3980,7 @@
 (defun idlwave-expand-lib-file-name (file)
   ;; Find FILE on the scanned lib path and return a buffer visiting it
   ;; This is for, e.g., finding source with no user catalog
-  (cond 
+  (cond
    ((null file) nil)
    ((file-name-absolute-p file) file)
    (t (idlwave-locate-lib-file file))))
@@ -3995,7 +3995,7 @@
   (interactive)
   (let (directory directories cmd append status numdirs dir getsubdirs
 		  buffer save_buffer files numfiles item errbuf)
-    
+
     ;;
     ;; Read list of directories
     (setq directory (read-string "Tag Directories: " "."))
@@ -4047,7 +4047,7 @@
 		    (message "%s" (concat "Tagging " item "..."))
 		    (setq errbuf (get-buffer-create "*idltags-error*"))
 		    (setq status (+ status
-				    (if (eq 0 (call-process 
+				    (if (eq 0 (call-process
 					       "sh" nil errbuf nil "-c"
 					       (concat cmd append item)))
 					0
@@ -4061,13 +4061,13 @@
 		  (setq numfiles (1+ numfiles))
 		  (setq item (nth numfiles files))
 		  )))
-	    
+
 	    (setq numdirs (1+ numdirs))
 	    (setq dir (nth numdirs directories)))
 	(progn
 	  (setq numdirs (1+ numdirs))
 	  (setq dir (nth numdirs directories)))))
-    
+
     (setq errbuf (get-buffer-create "*idltags-error*"))
     (if (= status 0)
 	(kill-buffer errbuf))
@@ -4143,7 +4143,7 @@
   ;; Make sure the hash functions are accessible.
   (if (or (not (fboundp 'gethash))
 	  (not (fboundp 'puthash)))
-      (progn 
+      (progn
 	(require 'cl)
 	(or (fboundp 'puthash)
 	    (defalias 'puthash 'cl-puthash))))
@@ -4162,7 +4162,7 @@
 	      (null (cdr idlwave-sint-routines)))
       (loop for entry in entries
 	for var = (car entry) for size = (nth 1 entry)
-	do (setcdr (symbol-value var) 
+	do (setcdr (symbol-value var)
 		   (make-hash-table ':size size ':test 'equal)))
       (setq idlwave-sint-dirs nil
 	    idlwave-sint-libnames nil))
@@ -4172,7 +4172,7 @@
 	      (null (car idlwave-sint-routines)))
       (loop for entry in entries
 	for var = (car entry) for size = (nth 1 entry)
-	do (setcar (symbol-value var) 
+	do (setcar (symbol-value var)
 		   (make-hash-table ':size size ':test 'equal))))))
 
 (defun idlwave-sintern-routine-or-method (name &optional class set)
@@ -4259,11 +4259,11 @@
 	    (setq class (idlwave-sintern-class class set))
 	    (setq name (idlwave-sintern-method name set)))
 	(setq name (idlwave-sintern-routine name set)))
-      
+
       ;; The source
       (let ((source-type (car source))
 	    (source-file  (nth 1 source))
-	    (source-dir  (if default-dir  
+	    (source-dir  (if default-dir
 			     (file-name-as-directory default-dir)
 			   (nth 2 source)))
 	    (source-lib (nth 3 source)))
@@ -4272,7 +4272,7 @@
 	(if (stringp source-lib)
 	    (setq source-lib (idlwave-sintern-libname source-lib set)))
 	(setq source (list source-type source-file source-dir source-lib)))
-      
+
       ;; The keywords
       (setq kwds (mapcar (lambda (x)
 			   (idlwave-sintern-keyword-list x set))
@@ -4407,15 +4407,15 @@
 	  (not (stringp idlwave-user-catalog-file))
 	  (not (file-regular-p idlwave-user-catalog-file)))
       (error "No catalog has been produced yet"))
-  (let* ((emacs (expand-file-name (invocation-name) (invocation-directory)))
+  (let* ((emacs (concat invocation-directory invocation-name))
 	 (args (list "-batch"
 		     "-l" (expand-file-name "~/.emacs")
 		     "-l" "idlwave"
 		     "-f" "idlwave-rescan-catalog-directories"))
-	 (process (apply 'start-process "idlcat" 
+	 (process (apply 'start-process "idlcat"
 			 nil emacs args)))
     (setq idlwave-catalog-process process)
-    (set-process-sentinel 
+    (set-process-sentinel
      process
      (lambda (pro why)
        (when (string-match "finished" why)
@@ -4432,7 +4432,7 @@
 ;; ("ROUTINE" type class
 ;;  (system) | (lib pro_file dir "LIBNAME") | (user pro_file dir "USERLIB") |
 ;;  (buffer pro_file dir) | (compiled pro_file dir)
-;;   "calling_string" ("HELPFILE" (("KWD1" . link1) ...)) 
+;;   "calling_string" ("HELPFILE" (("KWD1" . link1) ...))
 ;;                    ("HELPFILE2" (("KWD2" . link) ...)) ...)
 ;;
 ;; DIR will be supplied dynamically while loading library catalogs,
@@ -4491,7 +4491,7 @@
 	   ;; The override-idle means, even if the idle timer has done some
 	   ;; preparing work, load and renormalize everything anyway.
 	   (override-idle (or arg idlwave-buffer-case-takes-precedence)))
-      
+
       (setq idlwave-buffer-routines nil
 	    idlwave-compiled-routines nil
 	    idlwave-unresolved-routines nil)
@@ -4502,7 +4502,7 @@
 	(idlwave-reset-sintern (cond (load t)
 				     ((null idlwave-system-routines) t)
 				     (t 'bufsh))))
-      
+
       (if idlwave-buffer-case-takes-precedence
 	  ;; We can safely scan the buffer stuff first
 	  (progn
@@ -4517,9 +4517,9 @@
 				    (idlwave-shell-is-running)))
 	     (ask-shell (and shell-is-running
 			     idlwave-query-shell-for-routine-info)))
-      
+
 	;; Load the library catalogs again, first re-scanning the path
-	(when arg 
+	(when arg
 	  (if shell-is-running
 	      (idlwave-shell-send-command idlwave-shell-path-query
 					  '(progn
@@ -4539,7 +4539,7 @@
 	    ;;    Therefore, we do a concatenation now, even though
 	    ;;    the shell might do it again.
 	    (idlwave-concatenate-rinfo-lists nil 'run-hooks))
-      
+
 	(when ask-shell
 	  ;; Ask the shell about the routines it knows of.
 	  (message "Querying the shell")
@@ -4576,26 +4576,26 @@
   ;; which, if necessary, will be re-created from the XML file on
   ;; disk.  As a last fallback, load the (likely outdated) idlw-rinfo
   ;; file distributed with older IDLWAVE versions (<6.0)
-  (unless (and (load idlwave-xml-system-rinfo-converted-file 
+  (unless (and (load idlwave-xml-system-rinfo-converted-file
 		     'noerror 'nomessage)
 	       (idlwave-xml-system-routine-info-up-to-date))
     ;; See if we can create it from XML source
     (condition-case nil
 	(idlwave-convert-xml-system-routine-info)
-      (error 
-       (unless (load idlwave-xml-system-rinfo-converted-file 
+      (error
+       (unless (load idlwave-xml-system-rinfo-converted-file
 		     'noerror 'nomessage)
 	 (if idlwave-system-routines
-	     (message 
+	     (message
 	      "Failed to load converted routine info, using old conversion.")
-	   (message 
+	   (message
 	    "Failed to convert XML routine info, falling back on idlw-rinfo.")
 	   (if (not (load "idlw-rinfo" 'noerror 'nomessage))
-	       (message 
+	       (message
 		"Could not locate any system routine information."))))))))
 
 (defun idlwave-xml-system-routine-info-up-to-date()
-  (let* ((dir (file-name-as-directory 
+  (let* ((dir (file-name-as-directory
 	       (expand-file-name "help/online_help" (idlwave-sys-dir))))
 	 (catalog-file (expand-file-name "idl_catalog.xml" dir)))
     (file-newer-than-file-p ;converted file is newer than catalog
@@ -4610,15 +4610,15 @@
   "Alist of system variables and their help files.")
 (defvar idlwave-help-special-topic-words nil)
 
-		
+
 (defun idlwave-shorten-syntax (syntax name &optional class)
   ;; From a list of syntax statments, shorten with %s and group with "or"
   (let ((case-fold-search t))
-    (mapconcat 
+    (mapconcat
      (lambda (x)
        (while (string-match name x)
 	 (setq x (replace-match "%s" t t x)))
-       (if class 
+       (if class
 	   (while (string-match class x)
 	     (setq x (replace-match "%s" t t x))))
        x)
@@ -4670,8 +4670,8 @@
 		  (put 'set-props 'matched t)
 		  set-props)
 		 (t nil)))
-	  (setq methods-entry 
-		(nconc (idlwave-xml-create-rinfo-list pelem class extra-kwds) 
+	  (setq methods-entry
+		(nconc (idlwave-xml-create-rinfo-list pelem class extra-kwds)
 		       methods-entry)))
 	 (t)))
       (setq params (cdr params)))
@@ -4681,12 +4681,12 @@
     ;  (message "Failed to match GetProperty in class %s" class))
     ;(unless (get 'set-props 'matched)
     ;  (message "Failed to match SetProperty in class %s" class))
-    (setq class-entry 
-	  (if inherits 
+    (setq class-entry
+	  (if inherits
 	      (list class (append '(inherits) inherits) (list 'link link))
 	    (list class (list 'link link))))
     (cons class-entry methods-entry)))
-    
+
 (defun idlwave-xml-create-rinfo-list (xml-entry &optional class extra-kws)
   ;; Create correctly structured list elements from ROUTINE or METHOD
   ;; XML list structures.  Return a list of list elements, with more
@@ -4722,8 +4722,8 @@
 	  (setq kwd (cdr (assq 'name props))
 		klink (cdr (assq 'link props)))
 	  (if (string-match "^\\[XY\\(Z?\\)\\]" kwd)
-	      (progn 
-		(setq pref-list 
+	      (progn
+		(setq pref-list
 		      (if (match-string 1 kwd) '("X" "Y" "Z") '("X" "Y"))
 		      kwd (substring kwd (match-end 0)))
 		(loop for x in pref-list do
@@ -4732,7 +4732,7 @@
 
 	 (t))); Do nothing for the others
       (setq params (cdr params)))
-    
+
     ;; Debug
 ;    (if (and (null (aref syntax-vec 0))
 ;	     (null (aref syntax-vec 1))
@@ -4749,16 +4749,16 @@
       (setq kwds (idlwave-rinfo-group-keywords kwds link))
       (loop for idx from 0 to 1 do
 	    (if (aref syntax-vec idx)
-		(push (append (list name (if (eq idx 0) 'pro 'fun) 
+		(push (append (list name (if (eq idx 0) 'pro 'fun)
 				    class '(system)
-				    (idlwave-shorten-syntax 
+				    (idlwave-shorten-syntax
 				     (aref syntax-vec idx) name class))
 			      kwds) result)))
       result)))
 
 
 (defun idlwave-rinfo-group-keywords (kwds master-link)
-  ;; Group keywords by link file, as a list with elements 
+  ;; Group keywords by link file, as a list with elements
   ;; (linkfile ( ("KWD1" . link1) ("KWD2" . link2))
   (let (kwd link anchor linkfiles block master-elt)
     (while kwds
@@ -4777,7 +4777,7 @@
 	    linkfiles
  	  (cons master-elt (delq master-elt linkfiles)))
       (push (list master-link) linkfiles))))
-      
+
 (defun idlwave-convert-xml-clean-statement-aliases (aliases)
   ;; Clean up the syntax of routines which are actually aliases by
   ;; removing the "OR" from the statements
@@ -4790,7 +4790,7 @@
 
 (defun idlwave-convert-xml-clean-routine-aliases (aliases)
   ;; Duplicate and trim original routine aliases from rinfo list
-  ;; This if for, e.g. OPENR/OPENW/OPENU 
+  ;; This if for, e.g. OPENR/OPENW/OPENU
   (let (alias remove-list new parts all-parts)
     (loop for x in aliases do
 	  (when (setq parts (split-string (cdr x) "/"))
@@ -4799,7 +4799,7 @@
 	      (setq new (cons (cdr x) parts))
 	      (push new all-parts))
 	    (setcdr new (delete (car x) (cdr new)))))
-    
+
     ;; Add any missing aliases (separate by slashes)
     (loop for x in all-parts do
 	  (if (cdr x)
@@ -4843,7 +4843,7 @@
 	      props (car (cdr pelem)))
 	(cond
 	 ((eq ptype 'FIELD)
-	  (push (cons (cdr (assq 'name props)) 
+	  (push (cons (cdr (assq 'name props))
 		      (cdr
 		       (idlwave-split-link-target (cdr (assq 'link props)))))
 		tags))))
@@ -4857,10 +4857,10 @@
 (defun idlwave-save-routine-info ()
   (if idlwave-xml-routine-info-file
       (with-temp-file idlwave-xml-system-rinfo-converted-file
-	(insert 
+	(insert
 	 (concat ";; *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-;; IDLWAVE Routine Information File (IDLWAVE version " idlwave-mode-version ") 
-;; Automatically generated from source file: 
+;; IDLWAVE Routine Information File (IDLWAVE version " idlwave-mode-version ")
+;; Automatically generated from source file:
 ;;  " idlwave-xml-routine-info-file "
 ;; on " (current-time-string) "
 ;; Do not edit."))
@@ -4886,11 +4886,11 @@
   "Convert XML supplied IDL routine info into internal form.
 Cache to disk for quick recovery."
   (interactive)
-  (let* ((dir (file-name-as-directory 
+  (let* ((dir (file-name-as-directory
 	       (expand-file-name "help/online_help" (idlwave-sys-dir))))
 	 (catalog-file (expand-file-name "idl_catalog.xml" dir))
 	 (elem-cnt 0)
-	 props rinfo msg-cnt elem type nelem class-result alias 
+	 props rinfo msg-cnt elem type nelem class-result alias
 	 routines routine-aliases statement-aliases sysvar-aliases
 	 buf version-string)
     (if (not (file-exists-p catalog-file))
@@ -4898,7 +4898,7 @@
       (if (not (file-readable-p catalog-file))
 	  (error "Cannot read XML routine info file: %s" catalog-file)))
     (require 'xml)
-    (message "Reading XML routine info...")   
+    (message "Reading XML routine info...")
     (unwind-protect
 	(progn
 	  ;; avoid warnings about read-only files
@@ -4909,13 +4909,13 @@
     (setq rinfo (assq 'CATALOG rinfo))
     (unless rinfo (error "Failed to parse XML routine info"))
     ;;(setq rinfo (car rinfo)) ; Skip the catalog stuff.
-    
+
     (setq version-string (cdr (assq 'version (nth 1 rinfo)))
 	  rinfo (cddr rinfo))
 
     (setq nelem (length rinfo)
 	  msg-cnt (/ nelem 20))
-    
+
     (setq idlwave-xml-routine-info-file nil)
     (message "Converting XML routine info...")
     (setq idlwave-system-routines nil
@@ -4932,12 +4932,12 @@
 	(setq type (car elem)
 	      props (car (cdr elem)))
 	(if (= (mod elem-cnt msg-cnt) 0)
-	    (message "Converting XML routine info...%2d%%" 
+	    (message "Converting XML routine info...%2d%%"
 		     (/ (* elem-cnt 100) nelem)))
-	(cond 
+	(cond
 	 ((eq type 'ROUTINE)
 	  (if (setq alias (assq 'alias_to props))
-	      (push (cons (cdr (assq 'name props)) (cdr alias)) 
+	      (push (cons (cdr (assq 'name props)) (cdr alias))
 		    routine-aliases)
 	    (setq routines (idlwave-xml-create-rinfo-list elem))
 	    (if (listp (cdr routines))
@@ -4945,7 +4945,7 @@
 		      (nconc idlwave-system-routines routines))
 	      ;; a cons cell is an executive commands
 	      (push routines idlwave-executive-commands-alist))))
-	 
+
 	 ((eq type 'CLASS)
 	  (setq class-result (idlwave-xml-create-class-method-lists elem))
 	  (push (car class-result) idlwave-system-class-info)
@@ -4963,10 +4963,10 @@
 
 	 ((eq type 'SYSVAR)
 	  (if (setq alias (cdr (assq 'alias_to props)))
-	      (push (cons (substring (cdr (assq 'name props)) 1) 
+	      (push (cons (substring (cdr (assq 'name props)) 1)
 			  (substring alias 1))
 		    sysvar-aliases)
-	    (push (idlwave-xml-create-sysvar-alist elem) 
+	    (push (idlwave-xml-create-sysvar-alist elem)
 		  idlwave-system-variables-alist)))
 	 (t))))
     (idlwave-convert-xml-clean-routine-aliases routine-aliases)
@@ -4976,12 +4976,12 @@
     (setq idlwave-xml-routine-info-file catalog-file)
     (idlwave-save-routine-info)
     (message "Converting XML routine info...done")))
-      
-    
+
+
 ;; ("ROUTINE" type class
 ;;  (system) | (lib pro_file dir "LIBNAME") | (user pro_file dir "USERLIB") |
 ;;  (buffer pro_file dir) | (compiled pro_file dir)
-;;   "calling_string" ("HELPFILE" (("KWD1" . link1) ...)) 
+;;   "calling_string" ("HELPFILE" (("KWD1" . link1) ...))
 ;;                    ("HELPFILE2" (("KWD2" . link) ...)) ...)
 
 
@@ -4996,7 +4996,7 @@
 	    (message "Loading system routine info in idle time...done")
 	    (aset arr 0 t)
 	    (throw 'exit t))
-	  
+
 	  (when (not (aref arr 1))
 	    (message "Normalizing idlwave-system-routines in idle time...")
 	    (idlwave-reset-sintern t)
@@ -5021,7 +5021,7 @@
 		  (progn
 		    (setq idlwave-library-routines nil)
 		    (ding)
-		    (message "Outdated user catalog: %s... recreate" 
+		    (message "Outdated user catalog: %s... recreate"
 			     idlwave-user-catalog-file))
 		(message "Loading user catalog in idle time...done")))
 	    (aset arr 2 t)
@@ -5030,16 +5030,16 @@
 	  (when (not (aref arr 3))
 	    (when idlwave-user-catalog-routines
 	      (message "Normalizing user catalog routines in idle time...")
-	      (setq idlwave-user-catalog-routines 
+	      (setq idlwave-user-catalog-routines
 		    (idlwave-sintern-rinfo-list
 		     idlwave-user-catalog-routines 'sys))
-	      (message 
+	      (message
 	       "Normalizing user catalog routines in idle time...done"))
 	    (aset arr 3 t)
 	    (throw 'exit t))
 
 	  (when (not (aref arr 4))
-	    (idlwave-scan-library-catalogs 
+	    (idlwave-scan-library-catalogs
 	     "Loading and normalizing library catalogs in idle time...")
 	    (aset arr 4 t)
 	    (throw 'exit t))
@@ -5047,7 +5047,7 @@
 	    (message "Finishing initialization in idle time...")
 	    (idlwave-routines)
 	    (message "Finishing initialization in idle time...done")
-	    (aset arr 5 t)	    
+	    (aset arr 5 t)
 	    (throw 'exit nil)))
 	;; restart the timer
 	(if (sit-for 1)
@@ -5082,17 +5082,17 @@
 	(when (or force (not (aref idlwave-load-rinfo-steps-done 2)))
 	  (load-file idlwave-user-catalog-file))
       (error nil))
-    (when (and 
+    (when (and
 	   (boundp 'idlwave-library-routines)
 	   idlwave-library-routines)
       (setq idlwave-library-routines nil)
-      (error "Outdated user catalog: %s... recreate" 
+      (error "Outdated user catalog: %s... recreate"
 	     idlwave-user-catalog-file))
     (setq idlwave-true-path-alist nil)
     (when (or force (not (aref idlwave-load-rinfo-steps-done 3)))
       (message "Normalizing user catalog routines...")
-      (setq idlwave-user-catalog-routines 
-	    (idlwave-sintern-rinfo-list 
+      (setq idlwave-user-catalog-routines
+	    (idlwave-sintern-rinfo-list
 	     idlwave-user-catalog-routines 'sys))
       (message "Normalizing user catalog routines...done")))
 
@@ -5105,11 +5105,11 @@
 
 (defun idlwave-update-buffer-routine-info ()
   (let (res)
-    (cond 
+    (cond
      ((eq idlwave-scan-all-buffers-for-routine-info t)
       ;; Scan all buffers, current buffer last
       (message "Scanning all buffers...")
-      (setq res (idlwave-get-routine-info-from-buffers 
+      (setq res (idlwave-get-routine-info-from-buffers
 		 (reverse (buffer-list)))))
      ((null idlwave-scan-all-buffers-for-routine-info)
       ;; Don't scan any buffers
@@ -5122,12 +5122,12 @@
 	    (setq res (idlwave-get-routine-info-from-buffers
 		       (list (current-buffer))))))))
     ;; Put the result into the correct variable
-    (setq idlwave-buffer-routines 
+    (setq idlwave-buffer-routines
 	  (idlwave-sintern-rinfo-list res 'set))))
 
 (defun idlwave-concatenate-rinfo-lists (&optional quiet run-hook)
   "Put the different sources for routine information together."
-  ;; The sequence here is important because earlier definitions shadow 
+  ;; The sequence here is important because earlier definitions shadow
   ;; later ones.  We assume that if things in the buffers are newer
   ;; then in the shell of the system, they are meant to be different.
   (setcdr idlwave-last-system-routine-info-cons-cell
@@ -5139,7 +5139,7 @@
 
   ;; Give a message with information about the number of routines we have.
   (unless quiet
-    (message 
+    (message
      "Routines Found: buffer(%d) compiled(%d) library(%d) user(%d) system(%d)"
      (length idlwave-buffer-routines)
      (length idlwave-compiled-routines)
@@ -5157,7 +5157,7 @@
 	  (when (and (setq class (nth 2 x))
 		     (not (assq class idlwave-class-alist)))
 	    (push (list class) idlwave-class-alist)))
-	idlwave-class-alist)))      
+	idlwave-class-alist)))
 
 ;; Three functions for the hooks
 (defun idlwave-save-buffer-update ()
@@ -5190,7 +5190,7 @@
 
 (defun idlwave-replace-buffer-routine-info (file new)
   "Cut the part from FILE out of `idlwave-buffer-routines' and add NEW."
-  (let ((list idlwave-buffer-routines) 
+  (let ((list idlwave-buffer-routines)
 	found)
     (while list
       ;; The following test uses eq to make sure it works correctly
@@ -5201,7 +5201,7 @@
 	    (setcar list nil)
 	    (setq found t))
 	(if found
-	    ;; End of that section reached. Jump. 
+	    ;; End of that section reached. Jump.
 	    (setq list nil)))
       (setq list (cdr list)))
     (setq idlwave-buffer-routines
@@ -5233,11 +5233,11 @@
       (save-restriction
 	(widen)
 	(goto-char (point-min))
-	(while (re-search-forward 
+	(while (re-search-forward
 		"^[ \t]*\\(pro\\|function\\)[ \t]" nil t)
 	  (setq string (buffer-substring-no-properties
 			(match-beginning 0)
-			(progn 
+			(progn
 			  (idlwave-end-of-statement)
 			  (point))))
 	  (setq entry (idlwave-parse-definition string))
@@ -5275,7 +5275,7 @@
 	(push (match-string 1 string) args)))
     ;; Normalize and sort.
     (setq args (nreverse args))
-    (setq keywords (sort keywords (lambda (a b) 
+    (setq keywords (sort keywords (lambda (a b)
 				    (string< (downcase a) (downcase b)))))
     ;; Make and return the entry
     ;; We don't know which argument are optional, so this information
@@ -5285,7 +5285,7 @@
 	  class
 	  (cond ((not (boundp 'idlwave-scanning-lib))
 		 (list  'buffer (buffer-file-name)))
-;		((string= (downcase 
+;		((string= (downcase
 ;			   (file-name-sans-extension
 ;			    (file-name-nondirectory (buffer-file-name))))
 ;			  (downcase name))
@@ -5293,7 +5293,7 @@
 ;		(t (cons 'lib (file-name-nondirectory (buffer-file-name))))
 		(t (list 'user (file-name-nondirectory (buffer-file-name))
 			 idlwave-scanning-lib-dir "UserLib")))
-	  (concat 
+	  (concat
 	   (if (string= type "function") "Result = " "")
 	   (if class "Obj ->[%s::]" "")
 	   "%s"
@@ -5339,10 +5339,10 @@
 	       (> (length idlwave-user-catalog-file) 0)
 	       (file-accessible-directory-p
 		(file-name-directory idlwave-user-catalog-file))
-	       (not (string= "" (file-name-nondirectory 
+	       (not (string= "" (file-name-nondirectory
 				 idlwave-user-catalog-file))))
     (error "`idlwave-user-catalog-file' does not point to a file in an accessible directory"))
-  
+
   (cond
     ;; Rescan the known directories
    ((and arg idlwave-path-alist
@@ -5352,13 +5352,13 @@
    ;; Expand the directories from library-path and run the widget
    (idlwave-library-path
     (idlwave-display-user-catalog-widget
-     (if idlwave-true-path-alist 
+     (if idlwave-true-path-alist
 	 ;; Propagate any flags on the existing path-alist
 	 (mapcar (lambda (x)
 		   (let ((path-entry (assoc (file-truename x)
 					    idlwave-true-path-alist)))
 		     (if path-entry
-			 (cons x (cdr path-entry)) 
+			 (cons x (cdr path-entry))
 		       (list x))))
 		 (idlwave-expand-path idlwave-library-path))
        (mapcar 'list (idlwave-expand-path idlwave-library-path)))))
@@ -5383,7 +5383,7 @@
     (idlwave-scan-library-catalogs "Locating library catalogs..." 'no-load)
     (idlwave-display-user-catalog-widget idlwave-path-alist)))
 
-(defconst idlwave-user-catalog-widget-help-string 
+(defconst idlwave-user-catalog-widget-help-string
   "This is the front-end to the creation of the IDLWAVE user catalog.
 Please select the directories on IDL's search path from which you
 would like to extract routine information, to be stored in the file:
@@ -5418,7 +5418,7 @@
   (make-local-variable 'idlwave-widget)
   (widget-insert (format idlwave-user-catalog-widget-help-string
 			 idlwave-user-catalog-file))
-  
+
   (widget-create 'push-button
 		 :notify 'idlwave-widget-scan-user-lib-files
 		 "Scan & Save")
@@ -5428,7 +5428,7 @@
 		 "Delete File")
   (widget-insert "  ")
   (widget-create 'push-button
-		 :notify 
+		 :notify
 		 '(lambda (&rest ignore)
 		    (let ((path-list (widget-get idlwave-widget :path-dirs)))
 		      (mapcar (lambda (x)
@@ -5439,7 +5439,7 @@
 		 "Select All Non-Lib")
   (widget-insert "  ")
   (widget-create 'push-button
-		 :notify 
+		 :notify
 		 '(lambda (&rest ignore)
 		    (let ((path-list (widget-get idlwave-widget :path-dirs)))
 		      (mapcar (lambda (x)
@@ -5455,18 +5455,18 @@
   (widget-insert "\n\n")
 
   (widget-insert "Select Directories: \n")
-  
+
   (setq idlwave-widget
 	(apply 'widget-create
 	       'checklist
-	       :value  (delq nil (mapcar (lambda (x) 
-					   (if (memq 'user (cdr x)) 
+	       :value  (delq nil (mapcar (lambda (x)
+					   (if (memq 'user (cdr x))
 					       (car x)))
 					 dirs-list))
 	       :greedy t
 	       :tag "List of directories"
-	       (mapcar (lambda (x) 
-			 (list 'item 
+	       (mapcar (lambda (x)
+			 (list 'item
 			       (if (memq 'lib (cdr x))
 				   (concat "[LIB] " (car x) )
 				 (car x)))) dirs-list)))
@@ -5476,7 +5476,7 @@
   (widget-setup)
   (goto-char (point-min))
   (delete-other-windows))
-  
+
 (defun idlwave-delete-user-catalog-file (&rest ignore)
   (if (yes-or-no-p
        (format "Delete file %s " idlwave-user-catalog-file))
@@ -5492,7 +5492,7 @@
 	 (this-path-alist path-alist)
 	 dir-entry)
     (while (setq dir-entry (pop this-path-alist))
-      (if (member 
+      (if (member
 	   (if (memq 'lib (cdr dir-entry))
 	       (concat "[LIB] " (car dir-entry))
 	     (car dir-entry))
@@ -5589,7 +5589,7 @@
     ;; Define the variable which knows the value of "!DIR"
     (insert (format "\n(setq idlwave-system-directory \"%s\")\n"
 		    idlwave-system-directory))
-  
+
     ;; Define the variable which contains a list of all scanned directories
     (insert "\n(setq idlwave-path-alist\n    '(")
     (let ((standard-output (current-buffer)))
@@ -5629,7 +5629,7 @@
       (when (file-directory-p dir)
 	(setq files (nreverse (directory-files dir t "[^.]")))
 	(while (setq file (pop files))
-	  (if (file-directory-p file) 
+	  (if (file-directory-p file)
 	      (push (file-name-as-directory file) path)))
 	(push dir path1)))
     path1))
@@ -5641,7 +5641,7 @@
 
 
 (defun idlwave-scan-library-catalogs (&optional message-base no-load)
-  "Scan for library catalog files (.idlwave_catalog) and ingest.  
+  "Scan for library catalog files (.idlwave_catalog) and ingest.
 
 All directories on `idlwave-path-alist' (or `idlwave-library-path'
 instead, if present) are searched.  Print MESSAGE-BASE along with the
@@ -5649,7 +5649,7 @@
 NO-LOAD is non-nil.  The variable `idlwave-use-library-catalogs' can
 be set to nil to disable library catalog scanning."
   (when idlwave-use-library-catalogs
-    (let ((dirs 
+    (let ((dirs
 	   (if idlwave-library-path
 	       (idlwave-expand-path idlwave-library-path)
 	     (mapcar 'car idlwave-path-alist)))
@@ -5658,7 +5658,7 @@
       (if message-base (message message-base))
       (while (setq dir (pop dirs))
 	(catch 'continue
-	  (when (file-readable-p 
+	  (when (file-readable-p
 		 (setq catalog (expand-file-name ".idlwave_catalog" dir)))
 	    (unless no-load
 	      (setq idlwave-library-catalog-routines nil)
@@ -5666,20 +5666,20 @@
 	      (condition-case nil
 		  (load catalog t t t)
 		(error (throw 'continue t)))
-	      (when (and 
-		     message-base 
-		     (not (string= idlwave-library-catalog-libname 
+	      (when (and
+		     message-base
+		     (not (string= idlwave-library-catalog-libname
 				   old-libname)))
-		(message "%s" (concat message-base 
+		(message "%s" (concat message-base
 				      idlwave-library-catalog-libname))
 		(setq old-libname idlwave-library-catalog-libname))
 	      (when idlwave-library-catalog-routines
 		(setq all-routines
-		      (append 
+		      (append
 		       (idlwave-sintern-rinfo-list
 			idlwave-library-catalog-routines 'sys dir)
 		       all-routines))))
-	    
+
 	    ;;  Add a 'lib flag if on path-alist
 	    (when (and idlwave-path-alist
 		       (setq dir-entry (assoc dir idlwave-path-alist)))
@@ -5690,7 +5690,7 @@
 ;;----- Communicating with the Shell -------------------
 
 ;; First, here is the idl program which can be used to query IDL for
-;; defined routines. 
+;; defined routines.
 (defconst idlwave-routine-info.pro
   "
 ;; START OF IDLWAVE SUPPORT ROUTINES
@@ -5708,10 +5708,10 @@
 pro idlwave_print_info_entry,name,func=func,separator=sep
   ;; See if it's an object method
   if name eq '' then return
-  func    = keyword_set(func) 
+  func    = keyword_set(func)
   methsep = strpos(name,'::')
   meth    = methsep ne -1
-  
+
   ;; Get routine info
   pars   = routine_info(name,/parameters,functions=func)
   source = routine_info(name,/source,functions=func)
@@ -5719,12 +5719,12 @@
   nkw    = pars.num_kw_args
   if nargs gt 0 then args = pars.args
   if nkw   gt 0 then kwargs = pars.kw_args
-  
+
   ;; Trim the class, and make the name
-  if meth then begin 
+  if meth then begin
       class = strmid(name,0,methsep)
       name  = strmid(name,methsep+2,strlen(name)-1)
-      if nargs gt 0 then begin 
+      if nargs gt 0 then begin
           ;; remove the self argument
           wh = where(args ne 'SELF',nargs)
           if nargs gt 0 then args = args[wh]
@@ -5733,7 +5733,7 @@
       ;; No class, just a normal routine.
       class = \"\"
   endelse
-   
+
   ;; Calling sequence
   cs = \"\"
   if func then cs = 'Result = '
@@ -5754,9 +5754,9 @@
           kwstring = kwstring + ' ' + kwargs[j]
       endfor
   endif
-  
+
   ret=(['IDLWAVE-PRO','IDLWAVE-FUN'])[func]
-  
+
   print,ret + ': ' + name + sep + class + sep + source[0].path  $
     + sep + cs + sep + kwstring
 end
@@ -5768,19 +5768,19 @@
   all = routine_info()
   fileQ=n_elements(file) ne 0
   if fileQ then file=strtrim(file,2)
-  for i=0L,n_elements(all)-1L do begin 
-     if fileQ then begin 
+  for i=0L,n_elements(all)-1L do begin
+     if fileQ then begin
         if (routine_info(all[i],/SOURCE)).path eq file then $
            idlwave_print_info_entry,all[i],separator=sep
      endif else idlwave_print_info_entry,all[i],separator=sep
-  endfor 
+  endfor
   all = routine_info(/functions)
-  for i=0L,n_elements(all)-1L do begin 
-     if fileQ then begin 
+  for i=0L,n_elements(all)-1L do begin
+     if fileQ then begin
         if (routine_info(all[i],/FUNCTIONS,/SOURCE)).path eq file then $
            idlwave_print_info_entry,all[i],separator=sep,/FUNC
      endif else idlwave_print_info_entry,all[i],separator=sep,/FUNC
-  endfor 
+  endfor
   print,'>>>END OF IDLWAVE ROUTINE INFO'
 end
 
@@ -5806,7 +5806,7 @@
   if res then print,'IDLWAVE-CLASS-TAGS: '+class+' '+strjoin(tags,' ',/single)
 end
 ;; END OF IDLWAVE SUPPORT ROUTINES
-" 
+"
   "The idl programs to get info from the shell.")
 
 (defvar idlwave-idlwave_routine_info-compiled nil
@@ -5824,11 +5824,11 @@
       (erase-buffer)
       (insert idlwave-routine-info.pro)
       (save-buffer 0))
-    (idlwave-shell-send-command 
+    (idlwave-shell-send-command
      (concat ".run \"" idlwave-shell-temp-pro-file "\"")
      nil 'hide wait)
     (idlwave-shell-send-command
-     (format "save,'idlwave_print_safe','idlwave_routine_info','idlwave_print_info_entry','idlwave_get_class_tags','idlwave_get_sysvars',FILE='%s',/ROUTINES" 
+     (format "save,'idlwave_print_safe','idlwave_routine_info','idlwave_print_info_entry','idlwave_get_class_tags','idlwave_get_sysvars',FILE='%s',/ROUTINES"
 	     (idlwave-shell-temp-file 'rinfo))
      nil 'hide)
     (setq idlwave-idlwave_routine_info-compiled t))
@@ -5929,7 +5929,7 @@
 	 (completion-regexp-list
 	  (if (equal arg '(16))
 	      (list (read-string (concat "Completion Regexp: "))))))
-    
+
     (if (and module (string-match "::" module))
 	(setq class (substring module 0 (match-beginning 0))
 	      module (substring module (match-end 0))))
@@ -5950,7 +5950,7 @@
      ;; Check for any special completion functions
      ((and idlwave-complete-special
 	   (idlwave-call-special idlwave-complete-special)))
-     
+
      ((null what)
       (error "Nothing to complete here"))
 
@@ -5967,7 +5967,7 @@
 			      (idlwave-all-class-inherits class-selector)))
 	     (isa (concat "procedure" (if class-selector "-method" "")))
 	     (type-selector 'pro))
-	(setq idlwave-completion-help-info 
+	(setq idlwave-completion-help-info
 	      (list 'routine nil type-selector class-selector nil super-classes))
 	(idlwave-complete-in-buffer
 	 'procedure (if class-selector 'method 'routine)
@@ -5975,8 +5975,8 @@
 	 (format "Select a %s name%s"
 		 isa
 		 (if class-selector
-		     (format " (class is %s)" 
-			     (if (eq class-selector t) 
+		     (format " (class is %s)"
+			     (if (eq class-selector t)
 				 "unknown" class-selector))
 		   ""))
 	 isa
@@ -5990,7 +5990,7 @@
 			      (idlwave-all-class-inherits class-selector)))
 	     (isa (concat "function" (if class-selector "-method" "")))
 	     (type-selector 'fun))
-	(setq idlwave-completion-help-info 
+	(setq idlwave-completion-help-info
 	      (list 'routine nil type-selector class-selector nil super-classes))
 	(idlwave-complete-in-buffer
 	 'function (if class-selector 'method 'routine)
@@ -5998,7 +5998,7 @@
 	 (format "Select a %s name%s"
 		 isa
 		 (if class-selector
-		     (format " (class is %s)" 
+		     (format " (class is %s)"
 			     (if (eq class-selector t)
 				 "unknown" class-selector))
 		   ""))
@@ -6026,18 +6026,18 @@
 	(unless (or entry (eq class t))
 	  (error "Nothing known about procedure %s"
 		 (idlwave-make-full-name class name)))
-	(setq list (idlwave-fix-keywords name 'pro class list 
+	(setq list (idlwave-fix-keywords name 'pro class list
 					 super-classes system))
 	(unless list (error "No keywords available for procedure %s"
 			    (idlwave-make-full-name class name)))
-	(setq idlwave-completion-help-info 
+	(setq idlwave-completion-help-info
 	      (list 'keyword name type-selector class-selector entry super-classes))
 	(idlwave-complete-in-buffer
 	 'keyword 'keyword list nil
 	 (format "Select keyword for procedure %s%s"
 		 (idlwave-make-full-name class name)
 		 (if (or (member '("_EXTRA") list)
-			 (member '("_REF_EXTRA") list))			 
+			 (member '("_REF_EXTRA") list))
 		     " (note _EXTRA)" ""))
 	 isa
 	 'idlwave-attach-keyword-classes)))
@@ -6060,7 +6060,7 @@
 	(unless (or entry (eq class t))
 	  (error "Nothing known about function %s"
 		 (idlwave-make-full-name class name)))
-	(setq list (idlwave-fix-keywords name 'fun class list 
+	(setq list (idlwave-fix-keywords name 'fun class list
 					 super-classes system))
 	;; OBJ_NEW: Messages mention the proper Init method
 	(setq msg-name (if (and (null class)
@@ -6070,13 +6070,13 @@
 			 (idlwave-make-full-name class name)))
 	(unless list (error "No keywords available for function %s"
 			    msg-name))
-	(setq idlwave-completion-help-info 
+	(setq idlwave-completion-help-info
 	      (list 'keyword name type-selector class-selector nil super-classes))
 	(idlwave-complete-in-buffer
 	 'keyword 'keyword list nil
 	 (format "Select keyword for function %s%s" msg-name
 		 (if (or (member '("_EXTRA") list)
-			 (member '("_REF_EXTRA") list))			 
+			 (member '("_REF_EXTRA") list))
 		     " (note _EXTRA)" ""))
 	 isa
 	 'idlwave-attach-keyword-classes)))
@@ -6114,10 +6114,10 @@
 		      ("class")))
 	 (module (idlwave-sintern-routine-or-method module class))
 	 (class (idlwave-sintern-class class))
-	 (what (cond 
+	 (what (cond
 		((equal what 0)
 		 (setq what
-		       (intern (completing-read 
+		       (intern (completing-read
 				"Complete what? " what-list nil t))))
 		((integerp what)
 		 (setq what (intern (car (nth (1- what) what-list)))))
@@ -6139,7 +6139,7 @@
 	     (super-classes nil)
 	     (type-selector 'pro)
 	     (pro (or module
-		      (idlwave-completing-read 
+		      (idlwave-completing-read
 		       "Procedure: " (idlwave-routines) 'idlwave-selector))))
 	(setq pro (idlwave-sintern-routine pro))
 	(list nil-list nil-list 'procedure-keyword
@@ -6153,7 +6153,7 @@
 	     (super-classes nil)
 	     (type-selector 'fun)
 	     (func (or module
-		       (idlwave-completing-read 
+		       (idlwave-completing-read
 			"Function: " (idlwave-routines) 'idlwave-selector))))
 	(setq func (idlwave-sintern-routine func))
 	(list nil-list nil-list 'function-keyword
@@ -6193,7 +6193,7 @@
 
      ((eq what 'class)
       (list nil-list nil-list 'class nil-list nil))
-     
+
      (t (error "Invalid value for WHAT")))))
 
 (defun idlwave-completing-read (&rest args)
@@ -6216,7 +6216,7 @@
 		    (stringp idlwave-shell-default-directory)
 		    (file-directory-p idlwave-shell-default-directory))
 	       idlwave-shell-default-directory
-	     default-directory)))	   
+	     default-directory)))
     (comint-dynamic-complete-filename)))
 
 (defun idlwave-make-full-name (class name)
@@ -6225,7 +6225,7 @@
 
 (defun idlwave-rinfo-assoc (name type class list)
   "Like `idlwave-rinfo-assq', but sintern strings first."
-  (idlwave-rinfo-assq 
+  (idlwave-rinfo-assq
    (idlwave-sintern-routine-or-method name class)
    type (idlwave-sintern-class class) list))
 
@@ -6249,7 +6249,7 @@
 	  (setq classes nil)))
     rtn))
 
-(defun idlwave-best-rinfo-assq (name type class list &optional with-file 
+(defun idlwave-best-rinfo-assq (name type class list &optional with-file
 				     keep-system)
   "Like `idlwave-rinfo-assq', but get all twins and sort, then return first.
 If WITH-FILE is passed, find the best rinfo entry with a file
@@ -6274,7 +6274,7 @@
 				    twins)))))
     (car twins)))
 
-(defun idlwave-best-rinfo-assoc (name type class list &optional with-file 
+(defun idlwave-best-rinfo-assoc (name type class list &optional with-file
 				     keep-system)
   "Like `idlwave-best-rinfo-assq', but sintern strings first."
   (idlwave-best-rinfo-assq
@@ -6365,7 +6365,7 @@
 Must accept two arguments: `apos' and `info'")
 
 (defun idlwave-determine-class (info type)
-  ;; Determine the class of a routine call.  
+  ;; Determine the class of a routine call.
   ;; INFO is the `cw-list' structure as returned by idlwave-where.
   ;; The second element in this structure is the class.  When nil, we
   ;; return nil.  When t, try to get the class from text properties at
@@ -6385,7 +6385,7 @@
 		      (dassoc (cdr dassoc))
 		      (t t)))
 	 (arrow (and apos (string= (buffer-substring apos (+ 2 apos)) "->")))
-	 (is-self 
+	 (is-self
 	  (and arrow
 	       (save-excursion (goto-char apos)
 			       (forward-word -1)
@@ -6406,19 +6406,19 @@
 	  (setq class (or (nth 2 (idlwave-current-routine)) class)))
 
       ;; Before prompting, try any special class determination routines
-      (when (and (eq t class) 
+      (when (and (eq t class)
 		 idlwave-determine-class-special
 		 (not force-query))
-	(setq special-class 
+	(setq special-class
 	      (idlwave-call-special idlwave-determine-class-special apos))
-	(if special-class 
+	(if special-class
 	    (setq class (idlwave-sintern-class special-class)
 		  store idlwave-store-inquired-class)))
-      
+
       ;; Prompt for a class, if we need to
       (when (and (eq class t)
 		 (or force-query query))
-	(setq class-alist 
+	(setq class-alist
 	      (mapcar 'list (idlwave-all-method-classes (car info) type)))
 	(setq class
 	      (idlwave-sintern-class
@@ -6427,9 +6427,9 @@
 		 (error "No classes available with method %s" (car info)))
 		((and (= (length class-alist) 1) (not force-query))
 		 (car (car class-alist)))
-		(t 
+		(t
 		 (setq store idlwave-store-inquired-class)
-		 (idlwave-completing-read 
+		 (idlwave-completing-read
 		  (format "Class%s: " (if (stringp (car info))
 					  (format " for %s method %s"
 						  type (car info))
@@ -6441,9 +6441,9 @@
 	;; We have a real class here
 	(when (and store arrow)
 	  (condition-case ()
-	      (add-text-properties 
-	       apos (+ apos 2) 
-	       `(idlwave-class ,class face ,idlwave-class-arrow-face 
+	      (add-text-properties
+	       apos (+ apos 2)
+	       `(idlwave-class ,class face ,idlwave-class-arrow-face
 			       rear-nonsticky t))
 	    (error nil)))
 	(setf (nth 2 info) class))
@@ -6471,14 +6471,14 @@
 
 
 (defun idlwave-where ()
-  "Find out where we are. 
+  "Find out where we are.
 The return value is a list with the following stuff:
 \(PRO-LIST FUNC-LIST COMPLETE-WHAT CW-LIST LAST-CHAR)
 
 PRO-LIST       (PRO POINT CLASS ARROW)
 FUNC-LIST      (FUNC POINT CLASS ARROW)
 COMPLETE-WHAT  a symbol indicating what kind of completion makes sense here
-CW-LIST        (PRO-OR-FUNC POINT CLASS ARROW)  Like PRO-LIST, for what can 
+CW-LIST        (PRO-OR-FUNC POINT CLASS ARROW)  Like PRO-LIST, for what can
                be completed here.
 LAST-CHAR      last relevant character before point (non-white non-comment,
                not part of current identifier or leading slash).
@@ -6490,7 +6490,7 @@
 CLASS:  What class has the routine (nil=no, t=is method, but class unknown)
 ARROW:  Location of the arrow"
   (idlwave-routines)
-  (let* (;(bos (save-excursion (idlwave-beginning-of-statement) (point))) 
+  (let* (;(bos (save-excursion (idlwave-beginning-of-statement) (point)))
          (bos (save-excursion (idlwave-start-of-substatement 'pre) (point)))
  	 (func-entry (idlwave-what-function bos))
          (func (car func-entry))
@@ -6512,8 +6512,8 @@
      ((string-match "\\`[ \t]*\\(pro\\|function\\)[ \t]+[a-zA-Z0-9_]*\\'"
                     match-string)
       (setq cw 'class))
-     ((string-match 
-       "\\`[ \t]*\\([a-zA-Z][a-zA-Z0-9$_]*\\)?\\'" 
+     ((string-match
+       "\\`[ \t]*\\([a-zA-Z][a-zA-Z0-9$_]*\\)?\\'"
        (if (> pro-point 0)
 	   (buffer-substring pro-point (point))
 	 match-string))
@@ -6524,11 +6524,11 @@
       nil)
      ((string-match "OBJ_NEW([ \t]*['\"]\\([a-zA-Z0-9$_]*\\)?\\'"
 		    match-string)
-      (setq cw 'class))                    
+      (setq cw 'class))
      ((string-match "\\<inherits\\s-+\\([a-zA-Z0-9$_]*\\)?\\'"
 		    match-string)
-      (setq cw 'class))                    
-     ((and func 
+      (setq cw 'class))
+     ((and func
 	   (> func-point pro-point)
 	   (= func-level 1)
 	   (memq last-char '(?\( ?,)))
@@ -6574,7 +6574,7 @@
   ;;    searches to this point.
 
   (catch 'exit
-    (let (pos 
+    (let (pos
 	  func-point
 	  (cnt 0)
 	  func arrow-start class)
@@ -6589,18 +6589,18 @@
 	     (setq pos (point))
 	     (incf cnt)
 	     (when (and (= (following-char) ?\()
-			(re-search-backward 
+			(re-search-backward
 			 "\\(::\\|\\<\\)\\([a-zA-Z][a-zA-Z0-9$_]*\\)[ \t]*\\="
 			 bound t))
 	       (setq func (match-string 2)
 		     func-point (goto-char (match-beginning 2))
 		     pos func-point)
-	       (if (re-search-backward 
+	       (if (re-search-backward
 		    "->[ \t]*\\(\\([a-zA-Z][a-zA-Z0-9$_]*\\)::\\)?\\=" bound t)
 		   (setq arrow-start (copy-marker (match-beginning 0))
 			 class (or (match-string 2) t)))
-	       (throw 
-		'exit 
+	       (throw
+		'exit
 		(list
 		 (idlwave-sintern-routine-or-method func class)
 		 (idlwave-sintern-class class)
@@ -6616,18 +6616,18 @@
   ;;    searches to this point.
   (let ((pos (point)) pro-point
 	pro class arrow-start string)
-    (save-excursion 
+    (save-excursion
       ;;(idlwave-beginning-of-statement)
       (idlwave-start-of-substatement 'pre)
       (setq string (buffer-substring (point) pos))
-      (if (string-match 
+      (if (string-match
 	   "\\`[ \t]*\\([a-zA-Z][a-zA-Z0-9$_]*\\)[ \t]*\\(,\\|\\'\\)" string)
 	  (setq pro (match-string 1 string)
 		pro-point (+ (point) (match-beginning 1)))
 	(if (and (idlwave-skip-object)
 		 (setq string (buffer-substring (point) pos))
-		 (string-match 
-		  "\\`[ \t]*\\(->\\)[ \t]*\\(\\([a-zA-Z][a-zA-Z0-9$_]*\\)::\\)?\\([a-zA-Z][a-zA-Z0-9$_]*\\)?[ \t]*\\(,\\|\\(\\$\\s *\\(;.*\\)?\\)?$\\)" 
+		 (string-match
+		  "\\`[ \t]*\\(->\\)[ \t]*\\(\\([a-zA-Z][a-zA-Z0-9$_]*\\)::\\)?\\([a-zA-Z][a-zA-Z0-9$_]*\\)?[ \t]*\\(,\\|\\(\\$\\s *\\(;.*\\)?\\)?$\\)"
 		  string))
 	    (setq pro (if (match-beginning 4)
 			  (match-string 4 string))
@@ -6671,7 +6671,7 @@
 	      (throw 'exit nil))))
 	(goto-char pos)
       nil)))
-  
+
 (defun idlwave-last-valid-char ()
   "Return the last character before point which is not white or a comment
 and also not part of the current identifier.  Since we do this in
@@ -6761,23 +6761,23 @@
      ((or (eq completion t)
 	  (and (= 1 (length (setq all-completions
 				  (idlwave-uniquify
-				   (all-completions part list 
-						    (or special-selector 
+				   (all-completions part list
+						    (or special-selector
 							selector))))))
 	       (equal dpart dcompletion)))
       ;; This is already complete
       (idlwave-after-successful-completion type slash beg)
       (message "%s is already the complete %s" part isa)
       nil)
-     (t        
+     (t
       ;; We cannot add something - offer a list.
       (message "Making completion list...")
-      
+
       (unless idlwave-completion-help-links ; already set somewhere?
 	(mapcar (lambda (x)  ; Pass link prop through to highlight-linked
 		  (let ((link (get-text-property 0 'link (car x))))
 		    (if link
-			(push (cons (car x) link) 
+			(push (cons (car x) link)
 			      idlwave-completion-help-links))))
 		list))
       (let* ((list all-completions)
@@ -6787,7 +6787,7 @@
 ;	     (completion-fixup-function               ; Emacs
 ;	      (lambda () (and (eq (preceding-char) ?>)
 ;			      (re-search-backward " <" beg t)))))
-	     
+
 	(setq list (sort list (lambda (a b)
 				(string< (downcase a) (downcase b)))))
 	(if prepare-display-function
@@ -6797,7 +6797,7 @@
 		     idlwave-complete-empty-string-as-lower-case)
 		 (not idlwave-completion-force-default-case))
 	    (setq list (mapcar (lambda (x)
-				 (if (listp x) 
+				 (if (listp x)
 				     (setcar x (downcase (car x)))
 				   (setq x (downcase x)))
 				 x)
@@ -6817,19 +6817,19 @@
 	   (re-search-backward "\\<\\(pro\\|function\\)[ \t]+\\="
 			       (- (point) 15) t)
 	   (goto-char (point-min))
-	   (re-search-forward 
+	   (re-search-forward
 	    "^[ \t]*\\(pro\\|function\\)[ \t]+\\([a-zA-Z0-9_]+::\\)" nil t))))
       ;; Yank the full class specification
       (insert (match-string 2))
     ;; Do the completion, using list gathered from `idlwave-routines'
-    (idlwave-complete-in-buffer 
-     'class 'class (idlwave-class-alist) nil 
+    (idlwave-complete-in-buffer
+     'class 'class (idlwave-class-alist) nil
      "Select a class" "class"
      '(lambda (list)  ;; Push it to help-links if system help available
 	(mapcar (lambda (x)
 		  (let* ((entry (idlwave-class-info x))
 			 (link (nth 1 (assq 'link entry))))
-		    (if link (push (cons x link) 
+		    (if link (push (cons x link)
 				   idlwave-completion-help-links))
 		    x))
 		list)))))
@@ -6841,7 +6841,7 @@
   ;; SHOW-CLASSES is the value of `idlwave-completion-show-classes'.
   (if (or (null show-classes)           ; don't want to see classes
 	  (null class-selector)         ; not a method call
-	  (and 
+	  (and
 	   (stringp class-selector) ; the class is already known
 	   (not super-classes)))    ; no possibilities for inheritance
       ;; In these cases, we do not have to do anything
@@ -6856,13 +6856,13 @@
 	   (max (abs show-classes))
 	   (lmax (if do-dots (apply 'max (mapcar 'length list))))
 	  classes nclasses class-info space)
-      (mapcar 
+      (mapcar
        (lambda (x)
 	 ;; get the classes
 	 (if (eq type 'class-tag)
 	     ;; Just one class for tags
 	     (setq classes
-		   (list 
+		   (list
 		    (idlwave-class-or-superclass-with-tag class-selector x)))
 	   ;; Multiple classes for method or method-keyword
 	   (setq classes
@@ -6871,7 +6871,7 @@
 		      method-selector x type-selector)
 		   (idlwave-all-method-classes x type-selector)))
 	   (if inherit
-	       (setq classes 
+	       (setq classes
 		     (delq nil
 			   (mapcar (lambda (x) (if (memq x inherit) x nil))
 				   classes)))))
@@ -6908,7 +6908,7 @@
 (defun idlwave-attach-class-tag-classes (list)
   ;; Call idlwave-attach-classes with class structure tags
   (idlwave-attach-classes list 'class-tag idlwave-completion-show-classes))
-					
+
 
 ;;----------------------------------------------------------------------
 ;;----------------------------------------------------------------------
@@ -6929,7 +6929,7 @@
 	  ((= 1 (length list))
 	   (setq rtn (car list)))
 	  ((featurep 'xemacs)
-	   (if sort (setq list (sort list (lambda (a b) 
+	   (if sort (setq list (sort list (lambda (a b)
 					    (string< (upcase a) (upcase b))))))
 	   (setq menu
 		 (append (list title)
@@ -6940,7 +6940,7 @@
 	   (setq resp (get-popup-menu-response menu))
 	   (funcall (event-function resp) (event-object resp)))
 	  (t
-	   (if sort (setq list (sort list (lambda (a b) 
+	   (if sort (setq list (sort list (lambda (a b)
 					    (string< (upcase a) (upcase b))))))
 	   (setq menu (cons title
 			    (list
@@ -7031,7 +7031,7 @@
     (setq idlwave-before-completion-wconf (current-window-configuration)))
 
   (if (featurep 'xemacs)
-      (idlwave-display-completion-list-xemacs 
+      (idlwave-display-completion-list-xemacs
        list)
     (idlwave-display-completion-list-emacs list))
 
@@ -7112,7 +7112,7 @@
             (mapcar (lambda(x)
                       (princ (nth 1 x))
                       (princ "\n"))
-                    keys-alist))            
+                    keys-alist))
           (setq char (read-char)))
       (setq char (read-char)))
     (message nil)
@@ -7232,7 +7232,7 @@
 (defun idlwave-make-modified-completion-map-emacs (old-map)
   "Replace `choose-completion' and `mouse-choose-completion' in OLD-MAP."
   (let ((new-map (copy-keymap old-map)))
-    (substitute-key-definition 
+    (substitute-key-definition
      'choose-completion 'idlwave-choose-completion new-map)
     (substitute-key-definition
      'mouse-choose-completion 'idlwave-mouse-choose-completion new-map)
@@ -7258,8 +7258,8 @@
 ;;
 ;; - Go again over the documentation how to write a completion
 ;;   plugin.  It is in self.el, but currently still very bad.
-;;   This could be in a separate file in the distribution, or 
-;;   in an appendix for the manual.  
+;;   This could be in a separate file in the distribution, or
+;;   in an appendix for the manual.
 
 (defvar idlwave-struct-skip
   "[ \t]*\\(\\$.*\n\\(^[ \t]*\\(\\$[ \t]*\\)?\\(;.*\\)?\n\\)*\\)?[ \t]*"
@@ -7298,7 +7298,7 @@
 	 (beg (car borders))
 	 (end (cdr borders))
 	 (case-fold-search t))
-    (re-search-forward (concat "\\(^[ \t]*\\|[,{][ \t]*\\)" tag "[ \t]*:") 
+    (re-search-forward (concat "\\(^[ \t]*\\|[,{][ \t]*\\)" tag "[ \t]*:")
 		       end t)))
 
 (defun idlwave-struct-inherits ()
@@ -7313,7 +7313,7 @@
       (goto-char beg)
       (save-restriction
 	(narrow-to-region beg end)
-	(while (re-search-forward 
+	(while (re-search-forward
 		(concat "[{,]"  ;leading comma/brace
 			idlwave-struct-skip ; 4 groups
 			"inherits"    ; The INHERITS tag
@@ -7363,9 +7363,9 @@
 		  (concat "\\<" (regexp-quote (downcase var)) "\\>" ws)
 		"\\(\\)")
 	      "=" ws "\\({\\)"
-	      (if name 
+	      (if name
 		  (if (stringp name)
-		      (concat ws "\\(\\<" (downcase name) "\\)[^a-zA-Z0-9_$]") 
+		      (concat ws "\\(\\<" (downcase name) "\\)[^a-zA-Z0-9_$]")
 		    ;; Just a generic name
 		    (concat ws "\\<\\([a-zA-Z_0-9$]+\\)" ws ","))
 		""))))
@@ -7376,7 +7376,7 @@
 	  (goto-char (match-beginning 3))
 	  (match-string-no-properties 5)))))
 
-(defvar idlwave-class-info nil) 
+(defvar idlwave-class-info nil)
 (defvar idlwave-class-reset nil) ; to reset buffer-local classes
 
 (add-hook 'idlwave-update-rinfo-hook
@@ -7388,13 +7388,13 @@
   (let (list entry)
     (if idlwave-class-info
 	(if idlwave-class-reset
-	    (setq 	    
+	    (setq
 	     idlwave-class-reset nil
 	     idlwave-class-info ; Remove any visited in a buffer
-	     (delq nil (mapcar 
-			(lambda (x) 
-			  (let ((filebuf 
-				 (idlwave-class-file-or-buffer 
+	     (delq nil (mapcar
+			(lambda (x)
+			  (let ((filebuf
+				 (idlwave-class-file-or-buffer
 				  (or (cdr (assq 'found-in x)) (car x)))))
 			    (if (cdr filebuf)
 				nil
@@ -7432,7 +7432,7 @@
 	  (progn
 	    ;; For everything there
 	    (setq end-lim (save-excursion (idlwave-end-of-subprogram) (point)))
-	    (while (setq name 
+	    (while (setq name
 			 (idlwave-find-structure-definition nil t end-lim))
 	      (funcall all-hook name)))
 	(idlwave-find-structure-definition nil (or alt-class class))))))
@@ -7470,11 +7470,11 @@
 	  (insert-file-contents file))
 	(save-excursion
 	  (goto-char 1)
-	  (idlwave-find-class-definition class 
+	  (idlwave-find-class-definition class
 	   ;; Scan all of the structures found there
 	   (lambda (name)
 	     (let* ((this-class (idlwave-sintern-class name))
-		    (entry 
+		    (entry
 		     (list this-class
 			   (cons 'tags (idlwave-struct-tags))
 			   (cons 'inherits (idlwave-struct-inherits)))))
@@ -7499,7 +7499,7 @@
   (condition-case err
       (apply 'append (mapcar 'idlwave-class-tags
 			     (cons class (idlwave-all-class-inherits class))))
-    (error           
+    (error
      (idlwave-class-tag-reset)
      (error "%s" (error-message-string err)))))
 
@@ -7536,24 +7536,24 @@
 	  all-inherits))))))
 
 (defun idlwave-entry-keywords (entry &optional record-link)
-  "Return the flat entry keywords alist from routine-info entry.  
+  "Return the flat entry keywords alist from routine-info entry.
 If RECORD-LINK is non-nil, the keyword text is copied and a text
 property indicating the link is added."
   (let (kwds)
     (mapcar
-     (lambda (key-list) 
+     (lambda (key-list)
        (let ((file (car key-list)))
 	 (mapcar (lambda (key-cons)
 		   (let ((key (car key-cons))
 			 (link (cdr key-cons)))
 		     (when (and record-link file)
 			 (setq key (copy-sequence key))
-			 (put-text-property 
+			 (put-text-property
 			  0 (length key)
-			  'link 
-			  (concat 
-			   file 
-			   (if link 
+			  'link
+			  (concat
+			   file
+			   (if link
 			       (concat idlwave-html-link-sep
 				       (number-to-string link))))
 			  key))
@@ -7566,13 +7566,13 @@
   "Find keyword KEYWORD in entry ENTRY, and return (with link) if set"
   (catch 'exit
     (mapc
-     (lambda (key-list) 
+     (lambda (key-list)
        (let ((file (car key-list))
 	     (kwd (assoc keyword (cdr key-list))))
 	 (when kwd
-	   (setq kwd (cons (car kwd) 
+	   (setq kwd (cons (car kwd)
 			   (if (and file (cdr kwd))
-			       (concat file 
+			       (concat file
 				       idlwave-html-link-sep
 				       (number-to-string (cdr kwd)))
 			     (cdr kwd))))
@@ -7610,14 +7610,14 @@
 	  ;; Check if we need to update the "current" class
 	  (if (not (equal class-selector idlwave-current-tags-class))
 	      (idlwave-prepare-class-tag-completion class-selector))
-	  (setq idlwave-completion-help-info 
+	  (setq idlwave-completion-help-info
 		(list 'idlwave-complete-class-structure-tag-help
-		      (idlwave-sintern-routine 
+		      (idlwave-sintern-routine
 		       (concat class-selector "__define"))
 		      nil))
 	  (let  ((idlwave-cpl-bold idlwave-current-native-class-tags))
 	    (idlwave-complete-in-buffer
-	     'class-tag 'class-tag 
+	     'class-tag 'class-tag
 	     idlwave-current-class-tags nil
 	     (format "Select a tag of class %s" class-selector)
 	     "class tag"
@@ -7663,7 +7663,7 @@
 	     (skip-chars-backward "[a-zA-Z0-9_$]")
 	     (equal (char-before) ?!))
 	   (setq idlwave-completion-help-info '(idlwave-complete-sysvar-help))
-	   (idlwave-complete-in-buffer 'sysvar 'sysvar 
+	   (idlwave-complete-in-buffer 'sysvar 'sysvar
 				       idlwave-system-variables-alist nil
 				       "Select a system variable"
 				       "system variable")
@@ -7682,7 +7682,7 @@
 	     (or tags (error "System variable !%s is not a structure" var))
 	     (setq idlwave-completion-help-info
 		   (list 'idlwave-complete-sysvar-tag-help var))
-	     (idlwave-complete-in-buffer 'sysvartag 'sysvartag 
+	     (idlwave-complete-in-buffer 'sysvartag 'sysvartag
 					 tags nil
 					 "Select a system variable tag"
 					 "system variable tag")
@@ -7711,8 +7711,8 @@
      ((eq mode 'test) ; we can at least link the main
       (and (stringp word) entry main))
      ((eq mode 'set)
-      (if entry 
-	  (setq link 
+      (if entry
+	  (setq link
 		(if (setq target (cdr (assoc word tags)))
 		  (idlwave-substitute-link-target main target)
 		main)))) ;; setting dynamic!!!
@@ -7736,7 +7736,7 @@
 
 ;; Fake help in the source buffer for class structure tags.
 ;; KWD AND NAME ARE GLOBAL-VARIABLES HERE.
-(defvar name) 
+(defvar name)
 (defvar kwd)
 (defvar idlwave-help-do-class-struct-tag nil)
 (defun idlwave-complete-class-structure-tag-help (mode word)
@@ -7745,11 +7745,11 @@
     nil)
    ((eq mode 'set)
     (let (class-with found-in)
-      (when (setq class-with 
-		(idlwave-class-or-superclass-with-tag 
+      (when (setq class-with
+		(idlwave-class-or-superclass-with-tag
 		 idlwave-current-tags-class
 		 word))
-	(if (assq (idlwave-sintern-class class-with) 
+	(if (assq (idlwave-sintern-class class-with)
 		  idlwave-system-class-info)
 	    (error "No help available for system class tags"))
 	(if (setq found-in (idlwave-class-found-in class-with))
@@ -7762,7 +7762,7 @@
 (defun idlwave-class-or-superclass-with-tag (class tag)
   "Find and return the CLASS or one of its superclass with the
 associated TAG, if any."
-  (let ((sclasses (cons class (cdr (assq 'all-inherits 
+  (let ((sclasses (cons class (cdr (assq 'all-inherits
 					 (idlwave-class-info class)))))
 	cl)
    (catch 'exit
@@ -7771,7 +7771,7 @@
        (let ((tags (idlwave-class-tags cl)))
 	 (while tags
 	   (if (eq t (compare-strings tag 0 nil (car tags) 0 nil t))
-	     (throw 'exit cl))	       
+	     (throw 'exit cl))
 	   (setq tags (cdr tags))))))))
 
 
@@ -7794,8 +7794,8 @@
       (setcar entry (idlwave-sintern-sysvar (car entry) 'set))
       (setq tags (assq 'tags entry))
       (if tags
-	  (setcdr tags 
-		  (mapcar (lambda (x) 
+	  (setcdr tags
+		  (mapcar (lambda (x)
 			    (cons (idlwave-sintern-sysvartag (car x) 'set)
 				  (cdr x)))
 			  (cdr tags)))))))
@@ -7812,19 +7812,19 @@
 			 text start)
       (setq start (match-end 0)
 	    var (match-string 1 text)
-	    tags (if (match-end 3) 
+	    tags (if (match-end 3)
 		     (idlwave-split-string (match-string 3 text))))
       ;; Maintain old links, if present
       (setq old-entry (assq (idlwave-sintern-sysvar var) old))
       (setq link (assq 'link old-entry))
       (setq idlwave-system-variables-alist
-	    (cons (list var 
-			(cons 
-			 'tags 
-			 (mapcar (lambda (x) 
-				   (cons x 
-					 (cdr (assq 
-					       (idlwave-sintern-sysvartag x) 
+	    (cons (list var
+			(cons
+			 'tags
+			 (mapcar (lambda (x)
+				   (cons x
+					 (cdr (assq
+					       (idlwave-sintern-sysvartag x)
 					       (cdr (assq 'tags old-entry))))))
 				 tags)) link)
 		  idlwave-system-variables-alist)))
@@ -7846,9 +7846,9 @@
 
 (defun idlwave-uniquify (list)
   (let ((ht (make-hash-table :size (length list) :test 'equal)))
-    (delq nil 
+    (delq nil
 	  (mapcar (lambda (x)
-		    (unless (gethash x ht) 
+		    (unless (gethash x ht)
 		      (puthash x t ht)
 		      x))
 		  list))))
@@ -7876,11 +7876,11 @@
       nil)))
 
   ;; Restore the pre-completion window configuration if this is safe.
-  
-  (if (or (eq verify 'force)                                    ; force 
-	  (and 
+
+  (if (or (eq verify 'force)                                    ; force
+	  (and
 	   (get-buffer-window "*Completions*")                  ; visible
-	   (idlwave-local-value 'idlwave-completion-p 
+	   (idlwave-local-value 'idlwave-completion-p
 				"*Completions*")                ; cib-buffer
 	   (eq (marker-buffer idlwave-completion-mark)
 	       (current-buffer))                                ; buffer OK
@@ -7978,7 +7978,7 @@
     (if (string-match "\\(pro\\|function\\)[ \t]+\\(\\(.*\\)::\\)?\\(.*\\)"
 		      resolve)
 	(setq type (match-string 1 resolve)
-	      class (if (match-beginning 2) 
+	      class (if (match-beginning 2)
 			(match-string 3 resolve)
 		      nil)
 	      name (match-string 4 resolve)))
@@ -7987,15 +7987,15 @@
 
     (cond
      ((null class)
-      (idlwave-shell-send-command 
+      (idlwave-shell-send-command
        (format "resolve_routine,'%s'%s" (downcase name) kwd)
        'idlwave-update-routine-info
        nil t))
      (t
-      (idlwave-shell-send-command 
+      (idlwave-shell-send-command
        (format "resolve_routine,'%s__define'%s" (downcase class) kwd)
-       (list 'idlwave-shell-send-command 
-	     (format "resolve_routine,'%s__%s'%s" 
+       (list 'idlwave-shell-send-command
+	     (format "resolve_routine,'%s__%s'%s"
 		     (downcase class) (downcase name) kwd)
 	     '(idlwave-update-routine-info)
 	     nil t))))))
@@ -8016,19 +8016,19 @@
 	 (this-buffer (equal arg '(4)))
 	 (module (idlwave-fix-module-if-obj_new (idlwave-what-module)))
 	 (default (if module
-		      (concat (idlwave-make-full-name 
+		      (concat (idlwave-make-full-name
 			       (nth 2 module) (car module))
 			      (if (eq (nth 1 module) 'pro) "<p>" "<f>"))
 		    "none"))
-	 (list 
+	 (list
 	  (idlwave-uniquify
 	   (delq nil
-		 (mapcar (lambda (x) 
+		 (mapcar (lambda (x)
 			   (if (eq 'system (car-safe (nth 3 x)))
 			       ;; Take out system routines with no source.
 			       nil
 			     (list
-			      (concat (idlwave-make-full-name 
+			      (concat (idlwave-make-full-name
 				       (nth 2 x) (car x))
 				      (if (eq (nth 1 x) 'pro) "<p>" "<f>")))))
 			 (if this-buffer
@@ -8057,10 +8057,10 @@
 		     (t t)))
     (idlwave-do-find-module name type class nil this-buffer)))
 
-(defun idlwave-do-find-module (name type class 
+(defun idlwave-do-find-module (name type class
 				    &optional force-source this-buffer)
   (let ((name1 (idlwave-make-full-name class name))
-	source buf1 entry 
+	source buf1 entry
 	(buf (current-buffer))
 	(pos (point))
 	file name2)
@@ -8070,11 +8070,11 @@
 	  name2 (if (nth 2 entry)
 		    (idlwave-make-full-name (nth 2 entry) name)
 		  name1))
-    (if source	
+    (if source
 	(setq file (idlwave-routine-source-file source)))
     (unless file  ; Try to find it on the path.
-      (setq file 
-	    (idlwave-expand-lib-file-name 
+      (setq file
+	    (idlwave-expand-lib-file-name
 	     (if class
 		 (format "%s__define.pro" (downcase class))
 	       (format "%s.pro" (downcase name))))))
@@ -8082,14 +8082,14 @@
      ((or (null name) (equal name ""))
       (error "Abort"))
      ((eq (car source) 'system)
-      (error "Source code for system routine %s is not available" 
+      (error "Source code for system routine %s is not available"
 	     name2))
      ((or (not file) (not (file-regular-p file)))
       (error "Source code for routine %s is not available"
 	     name2))
      (t
       (when (not this-buffer)
-	(setq buf1 
+	(setq buf1
 	      (idlwave-find-file-noselect file 'find))
 	(pop-to-buffer buf1 t))
       (goto-char (point-max))
@@ -8099,7 +8099,7 @@
 		     (cond ((eq type 'fun) "function")
 			   ((eq type 'pro) "pro")
 			   (t "\\(pro\\|function\\)"))
-		     "\\>[ \t]+" 
+		     "\\>[ \t]+"
 		     (regexp-quote (downcase name2))
 		     "[^a-zA-Z0-9_$]")
 	     nil t)
@@ -8136,17 +8136,17 @@
       (cond
        ((and (eq cw 'procedure)
 	     (not (equal this-word "")))
-	(setq this-word (idlwave-sintern-routine-or-method 
+	(setq this-word (idlwave-sintern-routine-or-method
 			 this-word (nth 2 (nth 3 where))))
 	(list this-word 'pro
-	      (idlwave-determine-class 
+	      (idlwave-determine-class
 	       (cons this-word (cdr (nth 3 where)))
 	       'pro)))
-       ((and (eq cw 'function) 
+       ((and (eq cw 'function)
 	     (not (equal this-word ""))
 	     (or (eq next-char ?\()	; exclude arrays, vars.
 		 (looking-at "[a-zA-Z0-9_]*[ \t]*(")))
-	(setq this-word (idlwave-sintern-routine-or-method 
+	(setq this-word (idlwave-sintern-routine-or-method
 			 this-word (nth 2 (nth 3 where))))
 	(list this-word 'fun
 	      (idlwave-determine-class
@@ -8183,7 +8183,7 @@
       class)))
 
 (defun idlwave-fix-module-if-obj_new (module)
-  "Check if MODULE points to obj_new.  
+  "Check if MODULE points to obj_new.
 If yes, and if the cursor is in the keyword region, change to the
 appropriate Init method."
   (let* ((name (car module))
@@ -8204,7 +8204,7 @@
 			     (idlwave-sintern-class class)))))
     module))
 
-(defun idlwave-fix-keywords (name type class keywords 
+(defun idlwave-fix-keywords (name type class keywords
 				  &optional super-classes system)
   "Update a list of keywords.
 Translate OBJ_NEW, adding all super-class keywords, or all keywords
@@ -8225,34 +8225,34 @@
 			     string)
 	       (setq class (idlwave-sintern-class (match-string 1 string)))
 	       (setq idlwave-current-obj_new-class class)
-	       (setq keywords 
-		     (append keywords 
+	       (setq keywords
+		     (append keywords
 			     (idlwave-entry-keywords
 			      (idlwave-rinfo-assq
 			       (idlwave-sintern-method "INIT")
 			       'fun
 			       class
 			       (idlwave-routines)) 'do-link))))))
-    
+
     ;; If the class is `t', combine all keywords of all methods NAME
     (when (eq class t)
       (mapc (lambda (entry)
 	      (and
 	       (nth 2 entry)             ; non-nil class
 	       (eq (nth 1 entry) type)   ; correct type
-	       (setq keywords 
-		     (append keywords 
+	       (setq keywords
+		     (append keywords
 			     (idlwave-entry-keywords entry 'do-link)))))
 	    (idlwave-all-assq name (idlwave-routines)))
       (setq keywords (idlwave-uniquify keywords)))
-    
+
     ;; If we have inheritance, add all keywords from superclasses, if
     ;; the user indicated that method in `idlwave-keyword-class-inheritance'
-    (when (and 
+    (when (and
 	   super-classes
 	   idlwave-keyword-class-inheritance
 	   (stringp class)
-	   (or 
+	   (or
 	    system
 	    (assq (idlwave-sintern-keyword "_extra") keywords)
 	    (assq (idlwave-sintern-keyword "_ref_extra") keywords))
@@ -8270,7 +8270,7 @@
 		 (mapcar (lambda (k) (add-to-list 'keywords k))
 			 (idlwave-entry-keywords entry 'do-link))))
       (setq keywords (idlwave-uniquify keywords)))
-    
+
     ;; Return the final list
     keywords))
 
@@ -8295,14 +8295,14 @@
 		    (assq (idlwave-sintern-keyword "_REF_EXTRA") kwd-alist)))
 	 (completion-ignore-case t)
 	 candidates)
-    (cond ((assq kwd kwd-alist) 
+    (cond ((assq kwd kwd-alist)
 	   kwd)
 	  ((setq candidates (all-completions kwd kwd-alist))
 	   (if (= (length candidates) 1)
 	       (car candidates)
 	     candidates))
 	  ((and entry extra)
-	   ;; Inheritance may cause this keyword to be correct 
+	   ;; Inheritance may cause this keyword to be correct
 	   keyword)
 	  (entry
 	   ;; We do know the function, which does not have the keyword.
@@ -8314,13 +8314,13 @@
 
 (defvar idlwave-rinfo-mouse-map (make-sparse-keymap))
 (defvar idlwave-rinfo-map (make-sparse-keymap))
-(define-key idlwave-rinfo-mouse-map 
+(define-key idlwave-rinfo-mouse-map
   (if (featurep 'xemacs) [button2] [mouse-2])
   'idlwave-mouse-active-rinfo)
-(define-key idlwave-rinfo-mouse-map 
+(define-key idlwave-rinfo-mouse-map
   (if (featurep 'xemacs) [(shift button2)] [(shift mouse-2)])
   'idlwave-mouse-active-rinfo-shift)
-(define-key idlwave-rinfo-mouse-map 
+(define-key idlwave-rinfo-mouse-map
   (if (featurep 'xemacs) [button3] [mouse-3])
   'idlwave-mouse-active-rinfo-right)
 (define-key idlwave-rinfo-mouse-map " " 'idlwave-active-rinfo-space)
@@ -8346,7 +8346,7 @@
   (let* ((initial-class (or initial-class class))
 	 (entry (or (idlwave-best-rinfo-assq name type class
 					     (idlwave-routines))
-		    (idlwave-rinfo-assq name type class 
+		    (idlwave-rinfo-assq name type class
 					idlwave-unresolved-routines)))
 	 (name (or (car entry) name))
 	 (class (or (nth 2 entry) class))
@@ -8371,7 +8371,7 @@
 	 (km-prop (if (featurep 'xemacs) 'keymap 'local-map))
 	 (face 'idlwave-help-link)
 	 beg props win cnt total)
-    ;; Fix keywords, but don't add chained super-classes, since these 
+    ;; Fix keywords, but don't add chained super-classes, since these
     ;; are shown separately for that super-class
     (setq keywords (idlwave-fix-keywords name type class keywords))
     (cond
@@ -8413,7 +8413,7 @@
 			  km-prop idlwave-rinfo-mouse-map
 			  'help-echo help-echo-use
 			  'data (cons 'usage data)))
-	(if html-file (setq props (append (list 'face face 'link html-file) 
+	(if html-file (setq props (append (list 'face face 'link html-file)
 					  props)))
 	(insert "Usage:    ")
 	(setq beg (point))
@@ -8422,14 +8422,14 @@
 		  (format calling-seq name name name name))
 		"\n")
 	(add-text-properties beg (point) props)
-	
+
 	(insert "Keywords:")
 	(if (null keywords)
 	    (insert " No keywords accepted.")
 	  (setq col 9)
 	  (mapcar
 	   (lambda (x)
-	     (if (>= (+ col 1 (length (car x))) 
+	     (if (>= (+ col 1 (length (car x)))
 		     (window-width))
 		 (progn
 		   (insert "\n         ")
@@ -8447,7 +8447,7 @@
 	     (add-text-properties beg (point) props)
 	     (setq col (+ col 1 (length (car x)))))
 	   keywords))
-	
+
 	(setq cnt 1 total (length all))
 	;; Here entry is (key file (list of type-conses))
 	(while (setq entry (pop all))
@@ -8460,7 +8460,7 @@
 					  (cdr (car (nth 2 entry))))
 			    'data (cons 'source data)))
 	  (idlwave-insert-source-location
-	   (format "\n%-8s  %s" 
+	   (format "\n%-8s  %s"
 		   (if (equal cnt 1)
 		       (if (> total 1) "Sources:" "Source:")
 		     "")
@@ -8469,7 +8469,7 @@
 	  (incf cnt)
 	  (when (and all (> cnt idlwave-rinfo-max-source-lines))
 	    ;; No more source lines, please
-	    (insert (format 
+	    (insert (format
 		     "\n          Source information truncated to %d entries."
 		     idlwave-rinfo-max-source-lines))
 	    (setq all nil)))
@@ -8483,7 +8483,7 @@
 	      (unwind-protect
 		  (progn
 		    (select-window win)
-		    (enlarge-window (- (/ (frame-height) 2) 
+		    (enlarge-window (- (/ (frame-height) 2)
 				       (window-height)))
 		    (shrink-window-if-larger-than-buffer))
 		(select-window ww)))))))))
@@ -8520,9 +8520,9 @@
      ((and (not file) shell-flag)
       (insert "Unresolved"))
 
-     ((null file)               
+     ((null file)
       (insert "ERROR"))
-     
+
      ((idlwave-syslib-p file)
       (if (string-match "obsolete" (file-name-directory file))
 	  (insert "Obsolete  ")
@@ -8536,7 +8536,7 @@
      ;; Old special syntax: a matching regexp
      ((setq special (idlwave-special-lib-test file))
       (insert (format "%-10s" special)))
-     
+
      ;; Catch-all with file
      ((idlwave-lib-p file)      (insert "Library   "))
 
@@ -8551,7 +8551,7 @@
 	       (if shell-flag "S" "-")
 	       (if buffer-flag "B" "-")
 	       "] ")))
-    (when (> ndupl 1) 
+    (when (> ndupl 1)
       (setq beg (point))
       (insert (format "(%dx) " ndupl))
       (add-text-properties beg (point) (list 'face 'bold)))
@@ -8575,7 +8575,7 @@
 		  alist nil)))
       rtn)
      (t nil))))
-  
+
 (defun idlwave-mouse-active-rinfo-right (ev)
   (interactive "e")
   (idlwave-mouse-active-rinfo ev 'right))
@@ -8594,7 +8594,7 @@
 was pressed."
   (interactive "e")
   (if ev (mouse-set-point ev))
-  (let (data id name type class buf bufwin source link keyword 
+  (let (data id name type class buf bufwin source link keyword
 	     word initial-class)
     (setq data (get-text-property (point) 'data)
 	  source (get-text-property (point) 'source)
@@ -8609,9 +8609,9 @@
 
     (cond ((eq id 'class) ; Switch class being displayed
 	   (if (window-live-p bufwin) (select-window bufwin))
-	   (idlwave-display-calling-sequence 
+	   (idlwave-display-calling-sequence
 	    (idlwave-sintern-method name)
-	    type (idlwave-sintern-class word) 
+	    type (idlwave-sintern-class word)
 	    initial-class))
 	  ((eq id 'usage) ; Online help on this routine
 	   (idlwave-online-help link name type class))
@@ -8652,9 +8652,9 @@
       (setq bwin (get-buffer-window buffer)))
     (if (eq (preceding-char) ?/)
 	(insert keyword)
-      (unless (save-excursion 
+      (unless (save-excursion
 		(re-search-backward
-		 "[(,][ \t]*\\(\\$[ \t]*\\(;.*\\)?\n\\)?[ \t]*\\=" 
+		 "[(,][ \t]*\\(\\$[ \t]*\\(;.*\\)?\n\\)?[ \t]*\\="
 		 (min (- (point) 100) (point-min)) t))
 	(insert ", "))
       (if shift (insert "/"))
@@ -8706,7 +8706,7 @@
 command can be used to detect possible name clashes during this process."
   (idlwave-routines)  ; Make sure everything is loaded.
   (unless (or idlwave-user-catalog-routines idlwave-library-catalog-routines)
-    (or (y-or-n-p 
+    (or (y-or-n-p
 	 "You don't have any user or library catalogs.  Continue anyway? ")
 	(error "Abort")))
   (let* ((routines (append idlwave-system-routines
@@ -8719,7 +8719,7 @@
 	 (keymap (make-sparse-keymap))
 	 (props (list 'mouse-face 'highlight
 		      km-prop keymap
-		      'help-echo "Mouse2: Find source"))      
+		      'help-echo "Mouse2: Find source"))
 	 (nroutines (length (or special-routines routines)))
 	 (step (/ nroutines 100))
 	 (n 0)
@@ -8742,13 +8742,13 @@
     (message "Sorting routines...done")
 
     (define-key keymap (if (featurep 'xemacs) [(button2)] [(mouse-2)])
-      (lambda (ev) 
+      (lambda (ev)
 	(interactive "e")
 	(mouse-set-point ev)
 	(apply 'idlwave-do-find-module
 	       (get-text-property (point) 'find-args))))
     (define-key keymap [(return)]
-      (lambda () 
+      (lambda ()
 	(interactive)
 	(apply 'idlwave-do-find-module
 	       (get-text-property (point) 'find-args))))
@@ -8774,13 +8774,13 @@
 		  (> (idlwave-count-memq 'buffer (nth 2 (car dtwins))) 1))
 	  (incf cnt)
 	  (insert (format "\n%s%s"
-			  (idlwave-make-full-name (nth 2 routine) 
+			  (idlwave-make-full-name (nth 2 routine)
 						  (car routine))
 			  (if (eq (nth 1 routine) 'fun) "()" "")))
 	  (while (setq twin (pop dtwins))
 	    (setq props1 (append (list 'find-args
-				       (list (nth 0 routine) 
-					     (nth 1 routine) 
+				       (list (nth 0 routine)
+					     (nth 1 routine)
 					     (nth 2 routine)))
 				 props))
 	    (idlwave-insert-source-location "\n   - " twin props1))))
@@ -8803,7 +8803,7 @@
 	     (or (not (stringp sfile))
 		 (not (string-match "\\S-" sfile))))
 	(setq stype 'unresolved))
-    (princ (format "      %-10s %s\n" 
+    (princ (format "      %-10s %s\n"
 		   stype
 		   (if sfile sfile "No source code available")))))
 
@@ -8822,20 +8822,20 @@
 	       (eq type (nth 1 candidate))
 	       (eq class (nth 2 candidate)))
 	  (push candidate twins)))
-    (if (setq candidate (idlwave-rinfo-assq name type class 
+    (if (setq candidate (idlwave-rinfo-assq name type class
 					    idlwave-unresolved-routines))
 	(push candidate twins))
     (cons entry (nreverse twins))))
 
 (defun idlwave-study-twins (entries)
-  "Return dangerous twins of first entry in ENTRIES.  
+  "Return dangerous twins of first entry in ENTRIES.
 Dangerous twins are routines with same name, but in different files on
 the load path.  If a file is in the system library and has an entry in
 the `idlwave-system-routines' list, we omit the latter as
 non-dangerous because many IDL routines are implemented as library
 routines, and may have been scanned."
   (let* ((entry (car entries))
-	 (name (car entry))      ; 
+	 (name (car entry))      ;
 	 (type (nth 1 entry))    ; Must be bound for
 	 (class (nth 2 entry))   ;  idlwave-routine-twin-compare
 	 (cnt 0)
@@ -8853,23 +8853,23 @@
 		      (t 'unresolved)))
 
       ;; Check for an entry in the system library
-      (if (and file 
+      (if (and file
 	       (not syslibp)
 	       (idlwave-syslib-p file))
 	  (setq syslibp t))
-      
+
       ;; If there's more than one matching entry for the same file, just
       ;; append the type-cons to the type list.
       (if (setq entry (assoc key alist))
 	  (push type-cons (nth 2 entry))
 	(push (list key file (list type-cons)) alist)))
-    
+
     (setq alist (nreverse alist))
-    
+
     (when syslibp
       ;; File is in system *library* - remove any 'system entry
       (setq alist (delq (assq 'system alist) alist)))
-    
+
     ;; If 'system remains and we've scanned the syslib, it's a builtin
     ;; (rather than a !DIR/lib/.pro file bundled as source).
     (when (and (idlwave-syslib-scanned-p)
@@ -8905,7 +8905,7 @@
      ((not (eq type (nth 1 b)))
       ;; Type decides
       (< (if (eq type 'fun) 1 0) (if (eq (nth 1 b) 'fun) 1 0)))
-     (t	
+     (t
       ;; A and B are twins - so the decision is more complicated.
       ;; Call twin-compare with the proper arguments.
       (idlwave-routine-entry-compare-twins a b)))))
@@ -8957,7 +8957,7 @@
 	 (tpath-alist (idlwave-true-path-alist))
 	 (apathp (and (stringp akey)
 		      (assoc (file-name-directory akey) tpath-alist)))
-	 (bpathp (and (stringp bkey) 
+	 (bpathp (and (stringp bkey)
 		      (assoc (file-name-directory bkey) tpath-alist)))
 	 ;; How early on search path?  High number means early since we
 	 ;; measure the tail of the path list
@@ -8993,7 +8993,7 @@
      (t                                nil))))	; Default
 
 (defun idlwave-routine-source-file (source)
-  (if (nth 2 source) 
+  (if (nth 2 source)
       (expand-file-name (nth 1 source) (nth 2 source))
     (nth 1 source)))
 
@@ -9083,7 +9083,7 @@
   (forward-sexp 2)
   (forward-sexp -1)
   (let ((begin (point)))
-    (re-search-forward 
+    (re-search-forward
      "[a-zA-Z_][a-zA-Z0-9$_]+\\(::[a-zA-Z_][a-zA-Z0-9$_]+\\)?")
     (if (fboundp 'buffer-substring-no-properties)
         (buffer-substring-no-properties begin (point))
@@ -9123,7 +9123,7 @@
   (start-process "idldeclient" nil
 		 idlwave-shell-explicit-file-name "-c" "-e"
                  (buffer-file-name)))
-  
+
 (defvar idlwave-help-use-assistant)
 (defun idlwave-launch-idlhelp ()
   "Start the IDLhelp application."
@@ -9131,7 +9131,7 @@
   (if idlwave-help-use-assistant
       (idlwave-help-assistant-raise)
     (start-process "idlhelp" nil idlwave-help-application)))
- 
+
 ;; Menus - using easymenu.el
 (defvar idlwave-mode-menu-def
   `("IDLWAVE"
@@ -9150,7 +9150,7 @@
      ["Block" idlwave-mark-block t]
      ["Header" idlwave-mark-doclib t])
     ("Format"
-     ["Indent Entire Statement" idlwave-indent-statement 
+     ["Indent Entire Statement" idlwave-indent-statement
       :active t :keys "C-u \\[indent-for-tab-command]" ]
      ["Indent Subprogram" idlwave-indent-subprogram t]
      ["(Un)Comment Region" idlwave-toggle-comment-region t]
@@ -9220,7 +9220,7 @@
     ("Customize"
      ["Browse IDLWAVE Group" idlwave-customize t]
      "--"
-     ["Build Full Customize Menu" idlwave-create-customize-menu 
+     ["Build Full Customize Menu" idlwave-create-customize-menu
       (fboundp 'customize-menu-create)])
     ("Documentation"
      ["Describe Mode" describe-mode t]
@@ -9237,22 +9237,22 @@
   '("Debug"
     ["Start IDL shell" idlwave-shell t]
     ["Save and .RUN buffer" idlwave-shell-save-and-run
-     (and (boundp 'idlwave-shell-automatic-start) 
+     (and (boundp 'idlwave-shell-automatic-start)
 	  idlwave-shell-automatic-start)]))
 
 (if (or (featurep 'easymenu) (load "easymenu" t))
     (progn
-      (easy-menu-define idlwave-mode-menu idlwave-mode-map 
-			"IDL and WAVE CL editing menu" 
+      (easy-menu-define idlwave-mode-menu idlwave-mode-map
+			"IDL and WAVE CL editing menu"
 			idlwave-mode-menu-def)
-      (easy-menu-define idlwave-mode-debug-menu idlwave-mode-map 
-			"IDL and WAVE CL editing menu" 
+      (easy-menu-define idlwave-mode-debug-menu idlwave-mode-map
+			"IDL and WAVE CL editing menu"
 			idlwave-mode-debug-menu-def)))
 
 (defun idlwave-customize ()
   "Call the customize function with idlwave as argument."
   (interactive)
-  ;; Try to load the code for the shell, so that we can customize it 
+  ;; Try to load the code for the shell, so that we can customize it
   ;; as well.
   (or (featurep 'idlw-shell)
       (load "idlw-shell" t))
@@ -9263,11 +9263,11 @@
   (interactive)
   (if (fboundp 'customize-menu-create)
       (progn
-	;; Try to load the code for the shell, so that we can customize it 
+	;; Try to load the code for the shell, so that we can customize it
 	;; as well.
 	(or (featurep 'idlw-shell)
 	    (load "idlw-shell" t))
-	(easy-menu-change 
+	(easy-menu-change
 	 '("IDLWAVE") "Customize"
 	 `(["Browse IDLWAVE group" idlwave-customize t]
 	   "--"
@@ -9315,7 +9315,7 @@
   (let ((table (symbol-value 'idlwave-mode-abbrev-table))
 	abbrevs
 	str rpl func fmt (len-str 0) (len-rpl 0))
-    (mapatoms 
+    (mapatoms
      (lambda (sym)
        (if (symbol-value sym)
 	   (progn
@@ -9341,7 +9341,7 @@
     (with-output-to-temp-buffer "*Help*"
       (if arg
 	  (progn
-	    (princ "Abbreviations and Actions in IDLWAVE-Mode\n") 
+	    (princ "Abbreviations and Actions in IDLWAVE-Mode\n")
 	    (princ "=========================================\n\n")
 	    (princ (format fmt "KEY" "REPLACE" "HOOK"))
 	    (princ (format fmt "---" "-------" "----")))
--- a/lisp/progmodes/prolog.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/progmodes/prolog.el	Thu Sep 14 09:24:00 2006 +0000
@@ -41,27 +41,27 @@
 
 
 (defcustom prolog-program-name
-  (let ((names '("prolog" "gprolog")))
+  (let ((names '("prolog" "gprolog" "swipl")))
     (while (and names
 		(not (executable-find (car names))))
       (setq names (cdr names)))
     (or (car names) "prolog"))
-  "*Program name for invoking an inferior Prolog with `run-prolog'."
+  "Program name for invoking an inferior Prolog with `run-prolog'."
   :type 'string
   :group 'prolog)
 
 (defcustom prolog-consult-string "reconsult(user).\n"
-  "*(Re)Consult mode (for C-Prolog and Quintus Prolog). "
+  "(Re)Consult mode (for C-Prolog and Quintus Prolog). "
   :type 'string
   :group 'prolog)
 
 (defcustom prolog-compile-string "compile(user).\n"
-  "*Compile mode (for Quintus Prolog)."
+  "Compile mode (for Quintus Prolog)."
   :type 'string
   :group 'prolog)
 
 (defcustom prolog-eof-string "end_of_file.\n"
-  "*String that represents end of file for Prolog.
+  "String that represents end of file for Prolog.
 When nil, send actual operating system end of file."
   :type 'string
   :group 'prolog)
@@ -121,7 +121,21 @@
 (defvar prolog-mode-map
   (let ((map (make-sparse-keymap)))
     (define-key map "\e\C-x" 'prolog-consult-region)
+    (define-key map "\C-c\C-l" 'inferior-prolog-load-file)
+    (define-key map "\C-c\C-z" 'switch-to-prolog)
     map))
+ 
+(easy-menu-define prolog-mode-menu prolog-mode-map "Menu for Prolog mode."
+  ;; Mostly copied from scheme-mode's menu.
+  ;; Not tremendously useful, but it's a start.
+  '("Prolog"
+    ["Indent line" indent-according-to-mode t]
+    ["Indent region" indent-region t]
+    ["Comment region" comment-region t]
+    ["Uncomment region" uncomment-region t]
+    "--"
+    ["Run interactive Prolog session" run-prolog t]
+    ))
 
 ;;;###autoload
 (defun prolog-mode ()
@@ -138,29 +152,24 @@
   (setq major-mode 'prolog-mode)
   (setq mode-name "Prolog")
   (prolog-mode-variables)
+  (set (make-local-variable 'comment-add) 1)
   ;; font lock
   (setq font-lock-defaults '(prolog-font-lock-keywords
                              nil nil nil
                              beginning-of-line))
   (run-mode-hooks 'prolog-mode-hook))
 
-(defun prolog-indent-line (&optional whole-exp)
+(defun prolog-indent-line ()
   "Indent current line as Prolog code.
 With argument, indent any additional lines of the same clause
 rigidly along with this one (not yet)."
   (interactive "p")
   (let ((indent (prolog-indent-level))
-	(pos (- (point-max) (point))) beg)
+	(pos (- (point-max) (point))))
     (beginning-of-line)
-    (setq beg (point))
-    (skip-chars-forward " \t")
-    (if (zerop (- indent (current-column)))
-	nil
-      (delete-region beg (point))
-      (indent-to indent))
+    (indent-line-to indent)
     (if (> (- (point-max) pos) (point))
-	(goto-char (- (point-max) pos)))
-    ))
+	(goto-char (- (point-max) pos)))))
 
 (defun prolog-indent-level ()
   "Compute Prolog indentation level."
@@ -224,6 +233,8 @@
   (let ((map (make-sparse-keymap)))
     ;; This map will inherit from `comint-mode-map' when entering
     ;; inferior-prolog-mode.
+    (define-key map [remap self-insert-command]
+      'inferior-prolog-self-insert-command)
     map))
 
 (defvar inferior-prolog-mode-syntax-table prolog-mode-syntax-table)
@@ -256,36 +267,129 @@
   (setq comint-prompt-regexp "^| [ ?][- ] *")
   (prolog-mode-variables))
 
+(defvar inferior-prolog-buffer nil)
+
+(defun inferior-prolog-run (&optional name)
+  (with-current-buffer (make-comint "prolog" (or name prolog-program-name))
+    (inferior-prolog-mode)
+    (setq-default inferior-prolog-buffer (current-buffer))
+    (make-local-variable 'inferior-prolog-buffer)
+    (when (and name (not (equal name prolog-program-name)))
+      (set (make-local-variable 'prolog-program-name) name))
+    (set (make-local-variable 'inferior-prolog-flavor)
+         ;; Force re-detection.
+         (let* ((proc (get-buffer-process (current-buffer)))
+                (pmark (and proc (marker-position (process-mark proc)))))
+           (cond
+            ((null pmark) (1- (point-min)))
+            ;; The use of insert-before-markers in comint.el together with
+            ;; the potential use of comint-truncate-buffer in the output
+            ;; filter, means that it's difficult to reliably keep track of
+            ;; the buffer position where the process's output started.
+            ;; If possible we use a marker at "start - 1", so that
+            ;; insert-before-marker at `start' won't shift it.  And if not,
+            ;; we fall back on using a plain integer.
+            ((> pmark (point-min)) (copy-marker (1- pmark)))
+            (t (1- pmark)))))
+    (add-hook 'comint-output-filter-functions
+              'inferior-prolog-guess-flavor nil t)))
+
+(defun inferior-prolog-process (&optional dontstart)
+  (or (and (buffer-live-p inferior-prolog-buffer)
+           (get-buffer-process inferior-prolog-buffer))
+      (unless dontstart
+        (inferior-prolog-run)
+        ;; Try again.
+        (inferior-prolog-process))))
+
+(defvar inferior-prolog-flavor 'unknown
+  "Either a symbol or a buffer position offset by one.
+If a buffer position, the flavor has not been determined yet and
+it is expected that the process's output has been or will
+be inserted at that position plus one.")
+
+(defun inferior-prolog-guess-flavor (&optional ignored)
+  (save-excursion
+    (goto-char (1+ inferior-prolog-flavor))
+    (setq inferior-prolog-flavor
+          (cond
+           ((looking-at "GNU Prolog") 'gnu)
+           ((looking-at "Welcome to SWI-Prolog") 'swi)
+           ((looking-at ".*\n") 'unknown) ;There's at least one line.
+           (t inferior-prolog-flavor))))
+  (when (symbolp inferior-prolog-flavor)
+    (remove-hook 'comint-output-filter-functions
+                 'inferior-prolog-guess-flavor t)
+    (if (eq inferior-prolog-flavor 'gnu)
+        (set (make-local-variable 'comint-process-echoes) t))))
+
 ;;;###autoload
-(defun run-prolog ()
-  "Run an inferior Prolog process, input and output via buffer *prolog*."
+(defalias 'run-prolog 'switch-to-prolog)
+;;;###autoload
+(defun switch-to-prolog (&optional name)
+  "Run an inferior Prolog process, input and output via buffer *prolog*.
+With prefix argument \\[universal-prefix], prompt for the program to use."
+  (interactive
+   (list (when current-prefix-arg
+           (let ((proc (inferior-prolog-process 'dontstart)))
+             (if proc
+                 (if (yes-or-no-p "Kill current process before starting new one? ")
+                     (kill-process proc)
+                   (error "Abort")))
+             (read-string "Run Prolog: " prolog-program-name)))))
+  (unless (inferior-prolog-process 'dontstart)
+    (inferior-prolog-run name))
+  (pop-to-buffer inferior-prolog-buffer))
+
+(defun inferior-prolog-self-insert-command ()
+  "Insert the char in the buffer or pass it directly to the process."
   (interactive)
-  (require 'comint)
-  (pop-to-buffer (make-comint "prolog" prolog-program-name))
-  (inferior-prolog-mode))
+  (let* ((proc (get-buffer-process (current-buffer)))
+         (pmark (and proc (marker-position (process-mark proc)))))
+    (if (and (eq inferior-prolog-flavor 'gnu)
+             pmark
+             (null current-prefix-arg)
+             (eobp)
+             (eq (point) pmark)
+             (save-excursion
+               (goto-char (- pmark 3))
+               (looking-at " \\? ")))
+        (comint-send-string proc (string last-command-char))
+      (call-interactively 'self-insert-command))))
 
 (defun prolog-consult-region (compile beg end)
   "Send the region to the Prolog process made by \"M-x run-prolog\".
 If COMPILE (prefix arg) is not nil, use compile mode rather than consult mode."
   (interactive "P\nr")
-  (save-excursion
-    (if compile
-	(process-send-string "prolog" prolog-compile-string)
-      (process-send-string "prolog" prolog-consult-string))
-    (process-send-region "prolog" beg end)
-    (process-send-string "prolog" "\n")		;May be unnecessary
+  (let ((proc (inferior-prolog-process)))
+    (comint-send-string proc
+                        (if compile prolog-compile-string
+                          prolog-consult-string))
+    (comint-send-region proc beg end)
+    (comint-send-string proc "\n")		;May be unnecessary
     (if prolog-eof-string
-	(process-send-string "prolog" prolog-eof-string)
-      (process-send-eof "prolog")))) ;Send eof to prolog process.
+        (comint-send-string proc prolog-eof-string)
+      (with-current-buffer (process-buffer proc)
+        (comint-send-eof))))) ;Send eof to prolog process.
 
 (defun prolog-consult-region-and-go (compile beg end)
   "Send the region to the inferior Prolog, and switch to *prolog* buffer.
 If COMPILE (prefix arg) is not nil, use compile mode rather than consult mode."
   (interactive "P\nr")
   (prolog-consult-region compile beg end)
-  (switch-to-buffer "*prolog*"))
+  (pop-to-buffer inferior-prolog-buffer))
+
+(defun inferior-prolog-load-file ()
+  "Pass the current buffer's file to the inferior prolog process."
+  (interactive)
+  (save-buffer)
+  (let ((file buffer-file-name)
+        (proc (inferior-prolog-process)))
+    (with-current-buffer (process-buffer proc)
+      (comint-send-string proc (concat "['" (file-relative-name file) "'].\n"))
+      (pop-to-buffer (current-buffer)))))
 
 (provide 'prolog)
 
-;;; arch-tag: f3ec6748-1272-4ab6-8826-c50cb1607636
+;; arch-tag: f3ec6748-1272-4ab6-8826-c50cb1607636
 ;;; prolog.el ends here
--- a/lisp/progmodes/python.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/progmodes/python.el	Thu Sep 14 09:24:00 2006 +0000
@@ -67,7 +67,8 @@
 (eval-when-compile
   (require 'cl)
   (require 'compile)
-  (require 'comint))
+  (require 'comint)
+  (require 'hippie-exp))
 
 (autoload 'comint-mode "comint")
 
@@ -95,7 +96,9 @@
 	     "import" "in" "is" "lambda" "not" "or" "pass" "print"
 	     "raise" "return" "try" "while" "yield"
 	     ;; Future keywords
-	     "as" "None")
+	     "as" "None"
+             ;; Not real keywords, but close enough to be fontified as such
+             "self" "True" "False")
 	 symbol-end)
     ;; Definitions
     (,(rx symbol-start (group "class") (1+ space) (group (1+ (or word ?_))))
@@ -1424,11 +1427,13 @@
   "Evaluate STRING in inferior Python process."
   (interactive "sPython command: ")
   (comint-send-string (python-proc) string)
-  (comint-send-string (python-proc)
-                      ;; If the string is single-line or if it ends with \n,
-                      ;; only add a single \n, otherwise add 2, so as to
-                      ;; make sure we terminate the multiline instruction.
-                      (if (string-match "\n.+\\'" string) "\n\n" "\n")))
+  (unless (string-match "\n\\'" string)
+    ;; Make sure the text is properly LF-terminated.
+    (comint-send-string (python-proc) "\n"))
+  (when (string-match "\n[ \t].*\n?\\'" string)
+    ;; If the string contains a final indented line, add a second newline so
+    ;; as to make sure we terminate the multiline instruction.
+    (comint-send-string (python-proc) "\n")))
 
 (defun python-send-buffer ()
   "Send the current buffer to the inferior Python process."
--- a/lisp/simple.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/simple.el	Thu Sep 14 09:24:00 2006 +0000
@@ -131,26 +131,26 @@
 (defcustom next-error-highlight 0.1
   "*Highlighting of locations in selected source buffers.
 If number, highlight the locus in `next-error' face for given time in seconds.
-If t, use persistent overlays fontified in `next-error' face.
+If t, highlight the locus indefinitely until some other locus replaces it.
 If nil, don't highlight the locus in the source buffer.
 If `fringe-arrow', indicate the locus by the fringe arrow."
-  :type '(choice (number :tag "Delay")
-                 (const :tag "Persistent overlay" t)
+  :type '(choice (number :tag "Highlight for specified time")
+                 (const :tag "Semipermanent highlighting" t)
                  (const :tag "No highlighting" nil)
-                 (const :tag "Fringe arrow" 'fringe-arrow))
+                 (const :tag "Fringe arrow" fringe-arrow))
   :group 'next-error
   :version "22.1")
 
 (defcustom next-error-highlight-no-select 0.1
   "*Highlighting of locations in non-selected source buffers.
 If number, highlight the locus in `next-error' face for given time in seconds.
-If t, use persistent overlays fontified in `next-error' face.
+If t, highlight the locus indefinitely until some other locus replaces it.
 If nil, don't highlight the locus in the source buffer.
 If `fringe-arrow', indicate the locus by the fringe arrow."
-  :type '(choice (number :tag "Delay")
-                 (const :tag "Persistent overlay" t)
+  :type '(choice (number :tag "Highlight for specified time")
+                 (const :tag "Semipermanent highlighting" t)
                  (const :tag "No highlighting" nil)
-                 (const :tag "Fringe arrow" 'fringe-arrow))
+                 (const :tag "Fringe arrow" fringe-arrow))
   :group 'next-error
   :version "22.1")
 
@@ -3487,28 +3487,27 @@
 	  (set-window-vscroll nil (- vs (frame-char-height)) t)))
 
     ;; Move forward (down).
-    (let* ((ppos (posn-at-point))
-	   (py (cdr (or (posn-actual-col-row ppos)
-			(posn-col-row ppos))))
-	   (vs (window-vscroll nil t))
-	   (evis (or (pos-visible-in-window-p (window-end nil t) nil t)
+    (let* ((evis (or (pos-visible-in-window-p (window-end nil t) nil t)
 		     (pos-visible-in-window-p (1- (window-end nil t)) nil t)))
 	   (rbot (nth 3 evis))
-	   (vpos (nth 5 evis)))
+	   (vpos (nth 5 evis))
+	   ppos py vs)
       (cond
-       ;; (0) Last window line should be visible - fail if not.
+       ;; Last window line should be visible - fail if not.
        ((null evis)
 	nil)
        ;; If last line of window is fully visible, move forward.
        ((null rbot)
 	nil)
        ;; If cursor is not in the bottom scroll margin, move forward.
-       ((< py (min (- (window-text-height) scroll-margin 1)
-		   (1- vpos)))
+       ((< (setq ppos (posn-at-point)
+		 py (cdr (or (posn-actual-col-row ppos)
+			     (posn-col-row ppos))))
+	   (min (- (window-text-height) scroll-margin 1) (1- vpos)))
 	nil)
        ;; When already vscrolled, we vscroll some more if we can,
        ;; or clear vscroll and move forward at end of tall image.
-       ((> vs 0)
+       ((> (setq vs (window-vscroll nil t)) 0)
 	(when (> rbot 0)
 	  (set-window-vscroll nil (+ vs (min rbot (frame-char-height))) t)))
        ;; If cursor just entered the bottom scroll margin, move forward,
--- a/lisp/startup.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/startup.el	Thu Sep 14 09:24:00 2006 +0000
@@ -1390,7 +1390,7 @@
 		    minor-mode-map-alist old-minor-mode-map-alist
 		    emulation-mode-map-alists old-emulation-mode-map-alists)
 	      (kill-buffer splash-buffer)))))
-    ;; If hide-on-input is non-nil, don't hide the buffer on input.
+    ;; If hide-on-input is nil, don't hide the buffer on input.
     (if (or (window-minibuffer-p)
 	    (window-dedicated-p (selected-window)))
 	(pop-to-buffer (current-buffer))
@@ -1590,17 +1590,20 @@
 	  (if (and view-read-only (not view-mode))
 	      (view-mode-enter nil 'kill-buffer))
           (goto-char (point-min))
-	  (if (or (window-minibuffer-p)
-		  (window-dedicated-p (selected-window)))
-	      ;; If hide-on-input is nil, creating a new frame will
-	      ;; generate enough events that the subsequent `sit-for'
-	      ;; will immediately return anyway.
-	      (pop-to-buffer (current-buffer))
-	    (if hide-on-input
+          (if hide-on-input
+              (if (or (window-minibuffer-p)
+                      (window-dedicated-p (selected-window)))
+                  ;; If hide-on-input is nil, creating a new frame will
+                  ;; generate enough events that the subsequent `sit-for'
+                  ;; will immediately return anyway.
+                  nil ;; (pop-to-buffer (current-buffer))
 		(save-window-excursion
-		  (switch-to-buffer (current-buffer))
-		  (sit-for 120))
-	      (switch-to-buffer (current-buffer)))))
+                  (switch-to-buffer (current-buffer))
+		  (sit-for 120)))
+          (condition-case nil
+              (switch-to-buffer (current-buffer))
+            ;; In case the window is dedicated or something.
+            (error (pop-to-buffer (current-buffer))))))
       ;; Unwind ... ensure splash buffer is killed
       (if hide-on-input
 	  (kill-buffer "GNU Emacs")))))
--- a/lisp/subr.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/subr.el	Thu Sep 14 09:24:00 2006 +0000
@@ -1085,9 +1085,10 @@
 	    (kill-local-variable hook)
 	  (set hook hook-value))))))
 
-(defun add-to-list (list-var element &optional append)
+(defun add-to-list (list-var element &optional append compare-fn)
   "Add ELEMENT to the value of LIST-VAR if it isn't there yet.
-The test for presence of ELEMENT is done with `equal'.
+The test for presence of ELEMENT is done with `equal',
+or with COMPARE-FN if that's non-nil.
 If ELEMENT is added, it is added at the beginning of the list,
 unless the optional argument APPEND is non-nil, in which case
 ELEMENT is added at the end.
@@ -1099,7 +1100,13 @@
 into a hook function that will be run only after loading the package.
 `eval-after-load' provides one way to do this.  In some cases
 other hooks, such as major mode hooks, can do the job."
-  (if (member element (symbol-value list-var))
+  (if (if compare-fn
+	  (let (present)
+	    (dolist (elt (symbol-value list-var))
+	      (if (funcall compare-fn element elt)
+		  (setq present t)))
+	    present)
+	(member element (symbol-value list-var)))
       (symbol-value list-var)
     (set list-var
 	 (if append
@@ -1733,13 +1740,20 @@
   (when (or obsolete (numberp nodisp))
     (setq seconds (+ seconds (* 1e-3 nodisp)))
     (setq nodisp obsolete))
-  (if noninteractive
-      (progn (sleep-for seconds) t)
-    (unless nodisp (redisplay))
-    (or (<= seconds 0)
-	(let ((read (read-event nil nil seconds)))
-	  (or (null read)
-	      (progn (push read unread-command-events) nil))))))
+  (cond
+   (noninteractive
+    (sleep-for seconds)
+    t)
+   ((input-pending-p)
+    nil)
+   ((<= seconds 0)
+    (or nodisp (redisplay)))
+   (t
+    (or nodisp (redisplay))
+    (let ((read (read-event nil nil seconds)))
+      (or (null read)
+	  (progn (push read unread-command-events)
+		 nil))))))
 
 ;;; Atomic change groups.
 
@@ -2387,8 +2401,8 @@
     `(with-local-quit
        (catch ',catch-sym
 	 (let ((throw-on-input ',catch-sym))
-	   (or (not (sit-for 0 0 t))
-	     ,@body))))))
+	   (or (input-pending-p)
+	       ,@body))))))
 
 (defmacro combine-after-change-calls (&rest body)
   "Execute BODY, but don't call the after-change functions till the end.
--- a/lisp/term/mac-win.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/term/mac-win.el	Thu Sep 14 09:24:00 2006 +0000
@@ -1583,19 +1583,20 @@
 
 ;;; Event IDs
 ;; kCoreEventClass
-(put 'open-application   'mac-apple-event-id "oapp") ; kAEOpenApplication
-(put 'reopen-application 'mac-apple-event-id "rapp") ; kAEReopenApplication
-(put 'open-documents     'mac-apple-event-id "odoc") ; kAEOpenDocuments
-(put 'print-documents    'mac-apple-event-id "pdoc") ; kAEPrintDocuments
-(put 'open-contents      'mac-apple-event-id "ocon") ; kAEOpenContents
-(put 'quit-application   'mac-apple-event-id "quit") ; kAEQuitApplication
-(put 'application-died   'mac-apple-event-id "obit") ; kAEApplicationDied
-(put 'show-preferences   'mac-apple-event-id "pref") ; kAEShowPreferences
-(put 'autosave-now       'mac-apple-event-id "asav") ; kAEAutosaveNow
+(put 'open-application     'mac-apple-event-id "oapp") ; kAEOpenApplication
+(put 'reopen-application   'mac-apple-event-id "rapp") ; kAEReopenApplication
+(put 'open-documents       'mac-apple-event-id "odoc") ; kAEOpenDocuments
+(put 'print-documents      'mac-apple-event-id "pdoc") ; kAEPrintDocuments
+(put 'open-contents        'mac-apple-event-id "ocon") ; kAEOpenContents
+(put 'quit-application     'mac-apple-event-id "quit") ; kAEQuitApplication
+(put 'application-died     'mac-apple-event-id "obit") ; kAEApplicationDied
+(put 'show-preferences     'mac-apple-event-id "pref") ; kAEShowPreferences
+(put 'autosave-now         'mac-apple-event-id "asav") ; kAEAutosaveNow
 ;; kAEInternetEventClass
-(put 'get-url            'mac-apple-event-id "GURL") ; kAEGetURL
+(put 'get-url              'mac-apple-event-id "GURL") ; kAEGetURL
 ;; Converted HI command events
-(put 'about              'mac-apple-event-id "abou") ; kHICommandAbout
+(put 'about                'mac-apple-event-id "abou") ; kHICommandAbout
+(put 'show-hide-font-panel 'mac-apple-event-id "shfp") ; kHICommandShowHideFontPanel
 
 (defmacro mac-event-spec (event)
   `(nth 1 ,event))
@@ -1851,6 +1852,8 @@
   'mac-handle-font-panel-closed)
 ;; kEventClassFont/kEventFontSelection
 (define-key mac-apple-event-map [font selection] 'mac-handle-font-selection)
+(define-key mac-apple-event-map [hi-command show-hide-font-panel]
+  'mac-font-panel-mode)
 
 (define-key-after menu-bar-showhide-menu [mac-font-panel-mode]
   (menu-bar-make-mm-toggle mac-font-panel-mode
--- a/lisp/textmodes/conf-mode.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/textmodes/conf-mode.el	Thu Sep 14 09:24:00 2006 +0000
@@ -442,6 +442,9 @@
   (setq imenu-generic-expression
 	'(("Parameters" "^[ \t]*\\(.+?\\)[=: \t]" 1))))
 
+(defvar conf-space-keywords-override nil
+  "Value to be put in `conf-space-keywords' after `conf-space-mode'.")
+
 ;;;###autoload
 (define-derived-mode conf-space-mode conf-unix-mode "Conf[Space]"
   "Conf Mode starter for space separated conf files.
@@ -465,26 +468,49 @@
 add /dev/audio		desktop
 add /dev/mixer		desktop"
   (conf-mode-initialize "#" 'conf-space-font-lock-keywords)
-  (set (make-local-variable 'conf-assignment-sign)
-       nil)
-  ;; This doesn't seem right, but the next two depend on conf-space-keywords
-  ;; being set, while after-change-major-mode-hook might set up imenu, needing
-  ;; the following result:
-  (hack-local-variables-prop-line)
-  (hack-local-variables)
+  (make-local-variable 'conf-assignment-sign)
+  (setq conf-assignment-sign nil)
+  (make-local-variable 'conf-space-keywords)
+  (make-local-variable 'conf-space-keywords-override)
+  (setq conf-space-keywords-override nil)
   (cond (current-prefix-arg
-         (set (make-local-variable 'conf-space-keywords)
-              (if (> (prefix-numeric-value current-prefix-arg) 0)
-                  (read-string "Regexp to match keywords: "))))
-        (conf-space-keywords)
+	 ;; By setting conf-space-keywords-override
+	 ;; we arrange for conf-space-mode-internal
+	 ;; to override any value of conf-space-keywords
+	 ;; specified in a local variables list.
+         (setq conf-space-keywords-override
+	       (if (> (prefix-numeric-value current-prefix-arg) 0)
+		   (read-string "Regexp to match keywords: "))))
+	;; If this is already set, don't replace it with the default.
+	(conf-space-keywords)
         (buffer-file-name
-         (set (make-local-variable 'conf-space-keywords)
-              (assoc-default buffer-file-name conf-space-keywords-alist
-                             'string-match))))
-  (set (make-local-variable 'conf-assignment-regexp)
-       (if conf-space-keywords
-	   (concat "\\(?:" conf-space-keywords "\\)[ \t]+.+?\\([ \t]+\\|$\\)")
-	 ".+?\\([ \t]+\\|$\\)"))
+	 ;; By setting conf-space-keywords directly, 
+	 ;; we let a value in the local variables list take precedence.
+	 (make-local-variable 'conf-space-keywords)
+         (setq conf-space-keywords
+	       (assoc-default buffer-file-name conf-space-keywords-alist
+			      'string-match))))
+  (conf-space-mode-internal)
+  ;; In case the local variables list specifies conf-space-keywords,
+  ;; recompute other things from that afterward.
+  (push 'conf-space-mode-internal
+	hack-local-variables-hook))
+
+(defun conf-space-mode-internal ()
+  (when conf-space-keywords-override
+    (setq conf-space-keywords
+	  conf-space-keywords-override))
+  (make-local-variable 'conf-assignment-regexp)
+  (setq conf-assignment-regexp
+	(if conf-space-keywords
+	    (concat "\\(?:" conf-space-keywords "\\)[ \t]+.+?\\([ \t]+\\|$\\)")
+	  ".+?\\([ \t]+\\|$\\)"))
+  ;; If Font Lock is already enabled, reenable it with new
+  ;; conf-assignment-regexp.
+  (when (and font-lock-mode
+	     (boundp 'font-lock-keywords)) ;see `normal-mode'
+    (font-lock-add-keywords nil nil)
+    (font-lock-mode 1))
   (setq imenu-generic-expression
 	`(,@(cdr imenu-generic-expression)
 	  ("Parameters"
--- a/lisp/textmodes/fill.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/textmodes/fill.el	Thu Sep 14 09:24:00 2006 +0000
@@ -89,7 +89,8 @@
 (defcustom adaptive-fill-regexp
   ;; Added `!' for doxygen comments starting with `//!' or `/*!'.
   ;; Added `%' for TeX comments.
-  (purecopy "[ \t]*\\([-!|#%;>*,A7$,1s"s#sC$,2"F(B]+[ \t]*\\|(?[0-9]+[.)][ \t]*\\)*")
+  ;; RMS: deleted the code to match `1.' and `(1)'.
+  "[ \t]*\\([-!|#%;>*,A7$,1s"s#sC$,2"F(B]+[ \t]*\\)*"
   "*Regexp to match text at start of line that constitutes indentation.
 If Adaptive Fill mode is enabled, a prefix matching this pattern
 on the first and second lines of a paragraph is used as the
@@ -292,7 +293,9 @@
 
 (defun fill-single-word-nobreak-p ()
   "Don't break a line after the first or before the last word of a sentence."
-  (or (looking-at (concat "[ \t]*\\sw+" "\\(?:" (sentence-end) "\\)"))
+  ;; Actually, allow breaking before the last word of a sentence, so long as
+  ;; it's not the last word of the paragraph.
+  (or (looking-at (concat "[ \t]*\\sw+" "\\(?:" (sentence-end) "\\)[ \t]*$"))
       (save-excursion
 	(skip-chars-backward " \t")
 	(and (/= (skip-syntax-backward "w") 0)
--- a/lisp/textmodes/flyspell.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/textmodes/flyspell.el	Thu Sep 14 09:24:00 2006 +0000
@@ -992,7 +992,7 @@
     (flyspell-accept-buffer-local-defs)
     (let* ((cursor-location (point))
            (flyspell-word (flyspell-get-word following))
-           start end poss word)
+           start end poss word ispell-filter)
       (if (or (eq flyspell-word nil)
  	      (and (fboundp flyspell-generic-check-word-predicate)
  		   (not (funcall flyspell-generic-check-word-predicate))))
@@ -1050,7 +1050,12 @@
 		       (not (string= "" (car ispell-filter))))))
 	    ;; (ispell-send-string "!\n")
 	    ;; back to terse mode.
+	    ;; Remove leading empty element
 	    (setq ispell-filter (cdr ispell-filter))
+	    ;; ispell process should return something after word is sent.
+	    ;; Tag word as valid (i.e., skip) otherwise
+	    (or ispell-filter
+		(setq ispell-filter '(*)))
 	    (if (consp ispell-filter)
 		(setq poss (ispell-parse-output (car ispell-filter))))
 	    (let ((res (cond ((eq poss t)
@@ -1830,7 +1835,7 @@
 	    (let ((start (car (cdr word)))
 		  (end (car (cdr (cdr word))))
 		  (word (car word))
-		  poss)
+		  poss ispell-filter)
 	      (setq flyspell-auto-correct-word word)
 	      ;; now check spelling of word.
 	      (ispell-send-string "%\n") ;put in verbose mode
@@ -1839,7 +1844,12 @@
               (while (progn
                        (accept-process-output ispell-process)
                        (not (string= "" (car ispell-filter)))))
+	      ;; Remove leading empty element
 	      (setq ispell-filter (cdr ispell-filter))
+	      ;; ispell process should return something after word is sent.
+	      ;; Tag word as valid (i.e., skip) otherwise
+	      (or ispell-filter
+		  (setq ispell-filter '(*)))
 	      (if (consp ispell-filter)
 		  (setq poss (ispell-parse-output (car ispell-filter))))
 	      (cond
@@ -1980,7 +1990,7 @@
 	  (let ((start (car (cdr word)))
 		(end (car (cdr (cdr word))))
 		(word (car word))
-		poss)
+		poss ispell-filter)
 	    ;; now check spelling of word.
 	    (ispell-send-string "%\n") ;put in verbose mode
 	    (ispell-send-string (concat "^" word "\n"))
@@ -1988,7 +1998,12 @@
             (while (progn
                      (accept-process-output ispell-process)
                      (not (string= "" (car ispell-filter)))))
+	    ;; Remove leading empty element
 	    (setq ispell-filter (cdr ispell-filter))
+	    ;; ispell process should return something after word is sent.
+	    ;; Tag word as valid (i.e., skip) otherwise
+	    (or ispell-filter
+		(setq ispell-filter '(*)))
 	    (if (consp ispell-filter)
 		(setq poss (ispell-parse-output (car ispell-filter))))
 	    (cond
--- a/lisp/textmodes/org.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/textmodes/org.el	Thu Sep 14 09:24:00 2006 +0000
@@ -6204,15 +6204,15 @@
     (while (setq p (next-single-property-change (point) :org-clock-minutes))
       (goto-char p)
       (when (setq time (get-text-property p :org-clock-minutes))
-	(beginning-of-line 1)
-	(when (and (looking-at "\\(\\*+\\)[ \t]+\\(.*?\\)\\([ \t]+:[0-9a-zA-Z_@:]+:\\)?[ \t]*$")
-		   (setq level (- (match-end 1) (match-beginning 1)))
-		   (<= level maxlevel))
-	  (setq hlc (if emph (or (cdr (assoc level hlchars)) "") "")
-		hdl (match-string 2)
-		h (/ time 60)
-		m (- time (* 60 h)))
-	  (save-excursion
+	(save-excursion
+	  (beginning-of-line 1)
+	  (when (and (looking-at "\\(\\*+\\)[ \t]+\\(.*?\\)\\([ \t]+:[0-9a-zA-Z_@:]+:\\)?[ \t]*$")
+		     (setq level (- (match-end 1) (match-beginning 1)))
+		     (<= level maxlevel))
+	    (setq hlc (if emph (or (cdr (assoc level hlchars)) "") "")
+		  hdl (match-string 2)
+		  h (/ time 60)
+		  m (- time (* 60 h)))
 	    (goto-char ins)
 	    (if (= level 1) (insert-before-markers "|-\n"))
 	    (insert-before-markers
--- a/lisp/thingatpt.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/thingatpt.el	Thu Sep 14 09:24:00 2006 +0000
@@ -240,7 +240,7 @@
   (let ((strip (thing-at-point-looking-at
 			 thing-at-point-markedup-url-regexp))) ;; (url "") short
     (if (or strip
-`	    (thing-at-point-looking-at thing-at-point-url-regexp)
+	    (thing-at-point-looking-at thing-at-point-url-regexp)
 	    ;; Access scheme omitted?
 	    ;; (setq short (thing-at-point-looking-at
 	    ;;     	 thing-at-point-short-url-regexp))
--- a/lisp/window.el	Wed Sep 06 07:30:39 2006 +0000
+++ b/lisp/window.el	Thu Sep 14 09:24:00 2006 +0000
@@ -777,21 +777,134 @@
     ;; Maybe get rid of the window.
     (and window (not window-handled) (not window-solitary)
 	 (delete-window window))))
+
+(defvar mouse-autoselect-window-timer nil
+  "Timer used by delayed window autoselection.")
+
+(defvar mouse-autoselect-window-position nil
+  "Last mouse position recorded by delayed window autoselection.")
+
+(defvar mouse-autoselect-window-window nil
+  "Last window recorded by delayed window autoselection.")
+
+(defvar mouse-autoselect-window-now nil
+  "When non-nil don't delay autoselection in `handle-select-window'.")
+
+(defun mouse-autoselect-window-cancel (&optional force)
+  "Cancel delayed window autoselection.
+Optional argument FORCE means cancel unconditionally."
+  (unless (and (not force)
+	       ;; Don't cancel while the user drags a scroll bar.
+	       (eq this-command 'scroll-bar-toolkit-scroll)
+	       (memq (nth 4 (event-end last-input-event))
+		     '(handle end-scroll)))
+    (setq mouse-autoselect-window-now nil)
+    (when (timerp mouse-autoselect-window-timer)
+      (cancel-timer mouse-autoselect-window-timer))
+    (remove-hook 'pre-command-hook 'mouse-autoselect-window-cancel)))
+
+(defun mouse-autoselect-window-start (window)
+  "Start delayed window autoselection.
+Called when Emacs detects that the mouse has moved to the non-selected
+window WINDOW and the variable `mouse-autoselect-window' has a numeric,
+non-zero value.  The return value is non-nil iff delayed autoselection
+started successfully.  Delayed window autoselection is canceled when the
+mouse position has stabilized or a command is executed."
+  ;; Cancel any active window autoselection.
+  (mouse-autoselect-window-cancel t)
+  ;; Record current mouse position in `mouse-autoselect-window-position' and
+  ;; WINDOW in `mouse-autoselect-window-window'.
+  (setq mouse-autoselect-window-position (mouse-position))
+  (setq mouse-autoselect-window-window window)
+  ;; Install timer which runs `mouse-autoselect-window-select' every
+  ;; `mouse-autoselect-window' seconds.
+  (setq mouse-autoselect-window-timer
+	(run-at-time
+	 (abs mouse-autoselect-window) (abs mouse-autoselect-window)
+	 'mouse-autoselect-window-select))
+  ;; Executing a command cancels window autoselection.
+  (add-hook 'pre-command-hook 'mouse-autoselect-window-cancel))
+
+(defun mouse-autoselect-window-select ()
+  "Select window with delayed window autoselection.
+If the mouse position has stabilized in a non-selected window, select
+that window.  The minibuffer window is selected iff the minibuffer is
+active.  This function is run by `mouse-autoselect-window-timer'."
+  (condition-case nil
+      (let* ((mouse-position (mouse-position))
+	     (window (window-at (cadr mouse-position) (cddr mouse-position)
+				(car mouse-position))))
+	(cond
+	 ((and window (not (eq window (selected-window)))
+	       (or (not (numberp mouse-autoselect-window))
+		   (and (> mouse-autoselect-window 0)
+			;; If `mouse-autoselect-window' is positive, select
+			;; window if the window is the same as before.
+			(eq window mouse-autoselect-window-window))
+		   ;; Otherwise select window iff the mouse is at the same
+		   ;; position as before.  Observe that the first test after
+		   ;; `mouse-autoselect-window-start' usually fails since the
+		   ;; value of `mouse-autoselect-window-position' recorded there
+		   ;; is the position where the mouse has entered the new window
+		   ;; and not necessarily where the mouse has stopped moving.
+		   (equal mouse-position mouse-autoselect-window-position))
+	       ;; The minibuffer is a candidate window iff it's active.
+	       (or (not (window-minibuffer-p window))
+		   (eq window (active-minibuffer-window))))
+	  ;; Mouse position has stabilized in non-selected window: Cancel window
+	  ;; autoselection and try to select that window.
+	  (mouse-autoselect-window-cancel t)
+	  ;; Select window where mouse appears unless the selected window is the
+	  ;; minibuffer.  Use `unread-command-events' in order to execute pre-
+	  ;; and post-command hooks and trigger idle timers.  To avoid delaying
+	  ;; autoselection again, temporarily set `mouse-autoselect-window-now'
+	  ;; to t.
+	  (unless (window-minibuffer-p (selected-window))
+	    (setq mouse-autoselect-window-now t)
+	    (setq unread-command-events
+		  (cons (list 'select-window (list window))
+			unread-command-events))))
+	 ((or (and window (eq window (selected-window)))
+	      (not (numberp mouse-autoselect-window))
+	      (equal mouse-position mouse-autoselect-window-position))
+	  ;; Mouse position has either stabilized in the selected window or at
+	  ;; `mouse-autoselect-window-position': Cancel window autoselection.
+	  (mouse-autoselect-window-cancel t))
+	 (t
+	  ;; Mouse position has not stabilized yet, record new mouse position in
+	  ;; `mouse-autoselect-window-position' and any window at that position
+	  ;; in `mouse-autoselect-window-window'.
+	  (setq mouse-autoselect-window-position mouse-position)
+	  (setq mouse-autoselect-window-window window))))
+    (error nil)))
 
 (defun handle-select-window (event)
   "Handle select-window events."
   (interactive "e")
   (let ((window (posn-window (event-start event))))
-    (if (and (window-live-p window)
-	     ;; Don't switch if we're currently in the minibuffer.
-	     ;; This tries to work around problems where the minibuffer gets
-	     ;; unselected unexpectedly, and where you then have to move
-	     ;; your mouse all the way down to the minibuffer to select it.
-	     (not (window-minibuffer-p (selected-window)))
-	     ;; Don't switch to a minibuffer window unless it's active.
-	     (or (not (window-minibuffer-p window))
-		 (minibuffer-window-active-p window)))
-	(select-window window))))
+    (when (and (window-live-p window)
+	       ;; Don't switch if we're currently in the minibuffer.
+	       ;; This tries to work around problems where the minibuffer gets
+	       ;; unselected unexpectedly, and where you then have to move
+	       ;; your mouse all the way down to the minibuffer to select it.
+	       (not (window-minibuffer-p (selected-window)))
+	       ;; Don't switch to a minibuffer window unless it's active.
+	       (or (not (window-minibuffer-p window))
+		   (minibuffer-window-active-p window)))
+      (unless (and (numberp mouse-autoselect-window)
+		   (not (zerop mouse-autoselect-window))
+		   (not mouse-autoselect-window-now)
+		   ;; When `mouse-autoselect-window' has a numeric, non-zero
+		   ;; value, delay window autoselection by that value.
+		   ;; `mouse-autoselect-window-start' returns non-nil iff it
+		   ;; successfully installed a timer for this purpose.
+		   (mouse-autoselect-window-start window))
+	;; Re-enable delayed window autoselection.
+	(setq mouse-autoselect-window-now nil)
+	(when mouse-autoselect-window
+	  ;; Run `mouse-leave-buffer-hook' when autoselecting window.
+	  (run-hooks 'mouse-leave-buffer-hook))
+	(select-window window)))))
 
 (define-key ctl-x-map "2" 'split-window-vertically)
 (define-key ctl-x-map "3" 'split-window-horizontally)
--- a/lispref/ChangeLog	Wed Sep 06 07:30:39 2006 +0000
+++ b/lispref/ChangeLog	Thu Sep 14 09:24:00 2006 +0000
@@ -1,3 +1,36 @@
+2006-09-11  Richard Stallman  <rms@gnu.org>
+
+	* display.texi (Display Table Format): Wording clarification.
+	(Glyphs): Clarifications.
+
+2006-09-10  Chong Yidong  <cyd@stupidchicken.com>
+
+	* keymaps.texi (Active Keymaps): Mention that key-binding checks
+	local maps.
+
+2006-09-10  Kim F. Storm  <storm@cua.dk>
+
+	* display.texi (Forcing Redisplay): Document return value of
+	function redisplay.
+
+2006-09-09  Richard Stallman  <rms@gnu.org>
+
+	* windows.texi (Window Hooks): Explain limits of
+	window-scroll-functions.
+
+	* display.texi (Fringe Indicators): Update for last change in
+	indicate-buffer-boundaries.
+
+2006-09-08  Richard Stallman  <rms@gnu.org>
+
+	* processes.texi (Bindat Spec): Suggest names ending in -bindat-spec.
+
+2006-09-06  Kim F. Storm  <storm@cua.dk>
+
+	* frames.texi (Display Feature Testing): display-mm-dimensions-alist.
+
+	* windows.texi (Window Start): Update pos-visible-in-window-p.
+
 2006-09-04  Richard Stallman  <rms@gnu.org>
 
 	* processes.texi (Accepting Output): Explain SECONDS=0 for
--- a/lispref/display.texi	Wed Sep 06 07:30:39 2006 +0000
+++ b/lispref/display.texi	Thu Sep 14 09:24:00 2006 +0000
@@ -119,6 +119,8 @@
 
 If the optional argument @var{force} is non-@code{nil}, it forces an
 immediate and complete redisplay even if input is available.
+
+Returns @code{t} if redisplay was performed, or @code{nil} otherwise.
 @end defun
 
 @node Truncation
@@ -2816,26 +2818,32 @@
 that there is text above the screen, and a down-arrow to show
 there is text below the screen.
 
-There are four kinds of basic values:
+There are three kinds of basic values:
 
 @table @asis
 @item @code{nil}
-Don't display the icons.
+Don't display any of these fringe icons.
 @item @code{left}
-Display them in the left fringe.
+Display the angle icons and arrows in the left fringe.
 @item @code{right}
-Display them in the right fringe.
-@item @var{anything-else}
-Display the icon at the top of the window top in the left fringe, and other
-in the right fringe.
+Display the angle icons and arrows in the right fringe.
+@item any non-alist
+Display the angle icons in the left fringe
+and don't display the arrows.
 @end table
 
-If value is a cons @code{(@var{angles} . @var{arrows})}, @var{angles}
-controls the angle icons, and @var{arrows} controls the arrows.  Both
-@var{angles} and @var{arrows} work according to the table above.
-Thus, @code{(t .  right)} places the top angle icon in the left
-fringe, the bottom angle icon in the right fringe, and both arrows in
-the right fringe.
+Otherwise the value should be an alist that specifies which fringe
+indicators to display and where.  Each element of the alist should
+have the form @code{(@var{indicator} . @var{position})}.  Here,
+@var{indicator} is one of @code{top}, @code{bottom}, @code{up},
+@code{down}, and @code{t} (which covers all the icons not yet
+specified), while @var{position} is one of @code{left}, @code{right}
+and @code{nil}.
+
+For example, @code{((top . left) (t . right))} places the top angle
+bitmap in left fringe, and the bottom angle bitmap as well as both
+arrow bitmaps in right fringe.  To show the angle bitmaps in the left
+fringe, and no arrow bitmaps, use @code{((top .  left) (bottom . left))}.
 @end defvar
 
 @defvar default-indicate-buffer-boundaries
@@ -5110,13 +5118,14 @@
 
   The ordinary elements of the display table are indexed by character
 codes; the element at index @var{c} says how to display the character
-code @var{c}.  The value should be @code{nil} or a vector of glyph
-values (@pxref{Glyphs}).  If an element is @code{nil}, it says to
-display that character according to the usual display conventions
+code @var{c}.  The value should be @code{nil} or a vector of the
+glyphs to be output (@pxref{Glyphs}).  @code{nil} says to display the
+character @var{c} according to the usual display conventions
 (@pxref{Usual Display}).
 
-  If you use the display table to change the display of newline
-characters, the whole buffer will be displayed as one long ``line.''
+  @strong{Warning:} if you use the display table to change the display
+of newline characters, the whole buffer will be displayed as one long
+``line.''
 
   The display table also has six ``extra slots'' which serve special
 purposes.  Here is a table of their meanings; @code{nil} in any slot
@@ -5243,14 +5252,14 @@
   A @dfn{glyph} is a generalization of a character; it stands for an
 image that takes up a single character position on the screen.  Glyphs
 are represented in Lisp as integers, just as characters are.  Normally
-Emacs finds glyphs in the display table (@pxref{Display Tables}).
-
-  A glyph can be @dfn{simple} or it can be defined by the @dfn{glyph
-table}.  A simple glyph is just a way of specifying a character and a
-face to output it in.  The glyph code for a simple glyph, mod 524288,
-is the character to output, and the glyph code divided by 524288
-specifies the face number (@pxref{Face Functions}) to use while
-outputting it.  (524288 is
+glyph come from vectors in the display table (@pxref{Display Tables}).
+
+  A glyph code can be @dfn{simple} or it can be defined by the
+@dfn{glyph table}.  A simple glyph code is just a way of specifying a
+character and a face to output it in.  When a glyph code is simple,
+the code, mod 524288, is the character to output, and the code divided
+by 524288 specifies the face number (@pxref{Face Functions}) to use
+while outputting it.  (524288 is
 @ifnottex
 2**19.)
 @end ifnottex
@@ -5260,35 +5269,35 @@
 @xref{Faces}.
 
   On character terminals, you can set up a @dfn{glyph table} to define
-the meaning of glyph codes.  The glyph codes is the value of the
-variable @code{glyph-table}.
+the meaning of glyph codes.
 
 @defvar glyph-table
-The value of this variable is the current glyph table.  It should be a
-vector; the @var{g}th element defines glyph code @var{g}.
+The value of this variable is the current glyph table.  It should be
+@code{nil} or a vector whose @var{g}th element defines glyph code
+@var{g}.
 
 If a glyph code is greater than or equal to the length of the glyph
-table, that code is automatically simple.  If the value of
-@code{glyph-table} is @code{nil} instead of a vector, then all glyphs
-are simple.  The glyph table is not used on graphical displays, only
-on character terminals.  On graphical displays, all glyphs are simple.
+table, that code is automatically simple.  If @code{glyph-table} is
+@code{nil} then all glyph codes are simple.
+
+The glyph table is used only on character terminals.  On graphical
+displays, all glyph codes are simple.
 @end defvar
 
-  Here are the possible types of elements in the glyph table:
+  Here are the meaningful types of elements in the glyph table:
 
 @table @asis
 @item @var{string}
 Send the characters in @var{string} to the terminal to output
-this glyph.  This alternative is available on character terminals,
-but not on graphical displays.
+this glyph code.
 
 @item @var{integer}
 Define this glyph code as an alias for glyph code @var{integer}.  You
-can use an alias to specify a face code for the glyph and use a small
-number as its code.
+can use such an alias to define a small-numbered glyph code which
+specifies a face.
 
 @item @code{nil}
-This glyph is simple.
+This glyph code is simple.
 @end table
 
 @defun create-glyph string
--- a/lispref/frames.texi	Wed Sep 06 07:30:39 2006 +0000
+++ b/lispref/frames.texi	Thu Sep 14 09:24:00 2006 +0000
@@ -555,7 +555,7 @@
 
 @node Management Parameters
 @subsubsection Window Management Parameters
- 
+
   These frame parameters, meaningful only on window system displays,
 interact with the window manager.
 
@@ -2086,21 +2086,27 @@
 On a character terminal, it gives the height in characters.
 @end defun
 
+@defun display-pixel-width &optional display
+This function returns the width of the screen in pixels.
+On a character terminal, it gives the width in characters.
+@end defun
+
 @defun display-mm-height &optional display
 This function returns the height of the screen in millimeters,
 or @code{nil} if Emacs cannot get that information.
 @end defun
 
-@defun display-pixel-width &optional display
-This function returns the width of the screen in pixels.
-On a character terminal, it gives the width in characters.
-@end defun
-
 @defun display-mm-width &optional display
 This function returns the width of the screen in millimeters,
 or @code{nil} if Emacs cannot get that information.
 @end defun
 
+@defvar display-mm-dimensions-alist
+This variable allows the user to specify the dimensions of graphical
+displays returned by @code{display-mm-height} and
+@code{display-mm-width} in case the system provides incorrect values.
+@end defvar
+
 @defun display-backing-store &optional display
 This function returns the backing store capability of the display.
 Backing store means recording the pixels of windows (and parts of
--- a/lispref/keymaps.texi	Wed Sep 06 07:30:39 2006 +0000
+++ b/lispref/keymaps.texi	Thu Sep 14 09:24:00 2006 +0000
@@ -664,6 +664,10 @@
 The argument @var{accept-defaults} controls checking for default
 bindings, as in @code{lookup-key} (above).
 
+When @var{key} is a vector containing an input event, such as a mouse
+click, @code{key-binding} first looks for the binding in the keymaps
+that would be active at the position where the click was done.
+
 When commands are remapped (@pxref{Remapping Commands}),
 @code{key-binding} normally processes command remappings so as to
 returns the remapped command that will actually be executed.  However,
--- a/lispref/objects.texi	Wed Sep 06 07:30:39 2006 +0000
+++ b/lispref/objects.texi	Thu Sep 14 09:24:00 2006 +0000
@@ -227,9 +227,9 @@
 other words, characters are represented by their character codes.  For
 example, the character @kbd{A} is represented as the @w{integer 65}.
 
-  Individual characters are not often used in programs.  It is far more
-common to work with @emph{strings}, which are sequences composed of
-characters.  @xref{String Type}.
+  Individual characters are used occasionally in programs, but it is
+more common to work with @emph{strings}, which are sequences composed
+of characters.  @xref{String Type}.
 
   Characters in strings, buffers, and files are currently limited to
 the range of 0 to 524287---nineteen bits.  But not all values in that
@@ -239,17 +239,32 @@
 input have a much wider range, to encode modifier keys such as
 Control, Meta and Shift.
 
+  There are special functions for producing a human-readable textual
+description of a character for the sake of messages.  @xref{Describing
+Characters}.
+
+@menu
+* Basic Char Syntax::
+* General Escape Syntax::
+* Ctl-Char Syntax::
+* Meta-Char Syntax::
+* Other Char Bits::
+@end menu
+
+@node Basic Char Syntax
+@subsubsection Basic Char Syntax
 @cindex read syntax for characters
 @cindex printed representation for characters
 @cindex syntax for characters
 @cindex @samp{?} in character constant
 @cindex question mark in character constant
-  Since characters are really integers, the printed representation of a
-character is a decimal number.  This is also a possible read syntax for
-a character, but writing characters that way in Lisp programs is a very
-bad idea.  You should @emph{always} use the special read syntax formats
-that Emacs Lisp provides for characters.  These syntax formats start
-with a question mark.
+
+  Since characters are really integers, the printed representation of
+a character is a decimal number.  This is also a possible read syntax
+for a character, but writing characters that way in Lisp programs is
+not clear programming.  You should @emph{always} use the special read
+syntax formats that Emacs Lisp provides for characters.  These syntax
+formats start with a question mark.
 
   The usual read syntax for alphanumeric characters is a question mark
 followed by the character; thus, @samp{?A} for the character
@@ -315,8 +330,76 @@
 character @key{ESC}.  @samp{\s} is meant for use in character
 constants; in string constants, just write the space.
 
+  A backslash is allowed, and harmless, preceding any character without
+a special escape meaning; thus, @samp{?\+} is equivalent to @samp{?+}.
+There is no reason to add a backslash before most characters.  However,
+you should add a backslash before any of the characters
+@samp{()\|;'`"#.,} to avoid confusing the Emacs commands for editing
+Lisp code.  You can also add a backslash before whitespace characters such as
+space, tab, newline and formfeed.  However, it is cleaner to use one of
+the easily readable escape sequences, such as @samp{\t} or @samp{\s},
+instead of an actual whitespace character such as a tab or a space.
+(If you do write backslash followed by a space, you should write
+an extra space after the character constant to separate it from the
+following text.)
+
+@node General Escape Syntax
+@subsubsection General Escape Syntax
+
+  In addition to the specific excape sequences for special important
+control characters, Emacs provides general categories of escape syntax
+that you can use to specify non-ASCII text characters.
+
+@cindex unicode character escape
+  For instance, you can specify characters by their Unicode values.
+@code{?\u@var{nnnn}} represents a character that maps to the Unicode
+code point @samp{U+@var{nnnn}}.  There is a slightly different syntax
+for specifying characters with code points above @code{#xFFFF};
+@code{\U00@var{nnnnnn}} represents the character whose Unicode code
+point is @samp{U+@var{nnnnnn}}, if such a character is supported by
+Emacs.  If the corresponding character is not supported, Emacs signals
+an error.
+
+  This peculiar and inconvenient syntax was adopted for compatibility
+with other programming languages.  Unlike some other languages, Emacs
+Lisp supports this syntax in only character literals and strings.
+
+@cindex @samp{\} in character constant
+@cindex backslash in character constant
+@cindex octal character code
+  The most general read syntax for a character represents the
+character code in either octal or hex.  To use octal, write a question
+mark followed by a backslash and the octal character code (up to three
+octal digits); thus, @samp{?\101} for the character @kbd{A},
+@samp{?\001} for the character @kbd{C-a}, and @code{?\002} for the
+character @kbd{C-b}.  Although this syntax can represent any
+@acronym{ASCII} character, it is preferred only when the precise octal
+value is more important than the @acronym{ASCII} representation.
+
+@example
+@group
+?\012 @result{} 10         ?\n @result{} 10         ?\C-j @result{} 10
+?\101 @result{} 65         ?A @result{} 65
+@end group
+@end example
+
+  To use hex, write a question mark followed by a backslash, @samp{x},
+and the hexadecimal character code.  You can use any number of hex
+digits, so you can represent any character code in this way.
+Thus, @samp{?\x41} for the character @kbd{A}, @samp{?\x1} for the
+character @kbd{C-a}, and @code{?\x8e0} for the Latin-1 character
+@iftex
+@samp{@`a}.
+@end iftex
+@ifnottex
+@samp{a} with grave accent.
+@end ifnottex
+
+@node Ctl-Char Syntax
+@subsubsection Control-Character Syntax
+
 @cindex control characters
-  Control characters may be represented using yet another read syntax.
+  Control characters can be represented using yet another read syntax.
 This consists of a question mark followed by a backslash, caret, and the
 corresponding non-control character, in either upper or lower case.  For
 example, both @samp{?\^I} and @samp{?\^i} are valid read syntax for the
@@ -363,6 +446,9 @@
 affect the meaning of the program, but may guide the understanding of
 people who read it.
 
+@node Meta-Char Syntax
+@subsubsection Meta-Character Syntax
+
 @cindex meta characters
   A @dfn{meta character} is a character typed with the @key{META}
 modifier key.  The integer that represents such a character has the
@@ -395,6 +481,9 @@
 or as @samp{?\M-\101}.  Likewise, you can write @kbd{C-M-b} as
 @samp{?\M-\C-b}, @samp{?\C-\M-b}, or @samp{?\M-\002}.
 
+@node Other Char Bits
+@subsubsection Other Character Modifier Bits
+
   The case of a graphic character is indicated by its character code;
 for example, @acronym{ASCII} distinguishes between the characters @samp{a}
 and @samp{A}.  But @acronym{ASCII} has no way to represent whether a control
@@ -431,64 +520,6 @@
 bit values are 2**22 for alt, 2**23 for super and 2**24 for hyper.
 @end ifnottex
 
-@cindex unicode character escape
-  Emacs provides a syntax for specifying characters by their Unicode
-code points.  @code{?\u@var{nnnn}} represents a character that maps to
-the Unicode code point @samp{U+@var{nnnn}}.  There is a slightly
-different syntax for specifying characters with code points above
-@code{#xFFFF}; @code{\U00@var{nnnnnn}} represents the character whose
-Unicode code point is @samp{U+@var{nnnnnn}}, if such a character
-is supported by Emacs.  If the corresponding character is not
-supported, Emacs signals an error.
-
-  This peculiar and inconvenient syntax was adopted for compatibility
-with other programming languages.  Unlike some other languages, Emacs
-Lisp supports this syntax in only character literals and strings.
-
-@cindex @samp{\} in character constant
-@cindex backslash in character constant
-@cindex octal character code
-  Finally, the most general read syntax for a character represents the
-character code in either octal or hex.  To use octal, write a question
-mark followed by a backslash and the octal character code (up to three
-octal digits); thus, @samp{?\101} for the character @kbd{A},
-@samp{?\001} for the character @kbd{C-a}, and @code{?\002} for the
-character @kbd{C-b}.  Although this syntax can represent any @acronym{ASCII}
-character, it is preferred only when the precise octal value is more
-important than the @acronym{ASCII} representation.
-
-@example
-@group
-?\012 @result{} 10         ?\n @result{} 10         ?\C-j @result{} 10
-?\101 @result{} 65         ?A @result{} 65
-@end group
-@end example
-
-  To use hex, write a question mark followed by a backslash, @samp{x},
-and the hexadecimal character code.  You can use any number of hex
-digits, so you can represent any character code in this way.
-Thus, @samp{?\x41} for the character @kbd{A}, @samp{?\x1} for the
-character @kbd{C-a}, and @code{?\x8e0} for the Latin-1 character
-@iftex
-@samp{@`a}.
-@end iftex
-@ifnottex
-@samp{a} with grave accent.
-@end ifnottex
-
-  A backslash is allowed, and harmless, preceding any character without
-a special escape meaning; thus, @samp{?\+} is equivalent to @samp{?+}.
-There is no reason to add a backslash before most characters.  However,
-you should add a backslash before any of the characters
-@samp{()\|;'`"#.,} to avoid confusing the Emacs commands for editing
-Lisp code.  You can also add a backslash before whitespace characters such as
-space, tab, newline and formfeed.  However, it is cleaner to use one of
-the easily readable escape sequences, such as @samp{\t} or @samp{\s},
-instead of an actual whitespace character such as a tab or a space.
-(If you do write backslash followed by a space, you should write
-an extra space after the character constant to separate it from the
-following text.)
-
 @node Symbol Type
 @subsection Symbol Type
 
--- a/lispref/processes.texi	Wed Sep 06 07:30:39 2006 +0000
+++ b/lispref/processes.texi	Thu Sep 14 09:24:00 2006 +0000
@@ -2099,7 +2099,9 @@
   To control unpacking and packing, you write a @dfn{data layout
 specification}, a special nested list describing named and typed
 @dfn{fields}.  This specification controls length of each field to be
-processed, and how to pack or unpack it.
+processed, and how to pack or unpack it.  We normally keep bindat specs
+in variables whose names end in @samp{-bindat-spec}; that kind of name
+is automatically recognized as ``risky.''
 
 @cindex endianness
 @cindex big endian
--- a/lispref/windows.texi	Wed Sep 06 07:30:39 2006 +0000
+++ b/lispref/windows.texi	Thu Sep 14 09:24:00 2006 +0000
@@ -1362,13 +1362,16 @@
 
 If @var{position} is visible, @code{pos-visible-in-window-p} returns
 @code{t} if @var{partially} is @code{nil}; if @var{partially} is
-non-@code{nil}, it returns a list of the form @code{(@var{x} @var{y}
-@var{partial})}, where @var{x} and @var{y} are the pixel coordinates
-relative to the top left corner of the window, and @var{partial} is
-@code{nil} if the character after @var{position} is fully visible;
-otherwise it is a cons @code{(@var{rtop} . @var{rbot})} where the
-@var{rtop} and @var{rbot} specify the number of invisible pixels at
-the top and bottom of the row at @var{position}.
+non-@code{nil}, and the character after @var{position} is fully
+visible, it returns a list of the form @code{(@var{x} @var{y})}, where
+@var{x} and @var{y} are the pixel coordinates relative to the top left
+corner of the window; otherwise it returns an extended list of the
+form @code{(@var{x} @var{y} @var{rtop} @var{rbot} @var{rowh}
+@var{vpos})}, where the @var{rtop} and @var{rbot} specify the number
+of invisible pixels at the top and bottom of the row at
+@var{position}, @var{rowh} specifies the visible height of that row,
+and @var{vpos} specifies the vertical position (zero-based row number)
+of that row.
 
 Here is an example:
 
@@ -2344,6 +2347,10 @@
 These functions must be careful in using @code{window-end}
 (@pxref{Window Start}); if you need an up-to-date value, you must use
 the @var{update} argument to ensure you get it.
+
+@strong{Warning:} don't use this feature to alter the way the window
+is scrolled.  It's not designed for that, and such use probably won't
+work.
 @end defvar
 
 @defvar window-size-change-functions
--- a/make-dist	Wed Sep 06 07:30:39 2006 +0000
+++ b/make-dist	Thu Sep 14 09:24:00 2006 +0000
@@ -120,8 +120,7 @@
 fi
 
 ### Find where to run Emacs.
-### (We don't accept EMACS=t as an answer, since that probably only means
-### that the shell is running in an Emacs window.)
+### (Accept only absolute file names.)
 if [ $update = yes ];
 then
   unset EMACS_UNIBYTE
@@ -129,11 +128,15 @@
   then
     EMACS=`pwd`/src/emacs
   else
-    if [ "x$EMACS" = "x" -o "x$EMACS" = "xt" ];
-    then
-      echo You must specify the EMACS environment variable 2>&1
-      exit 1
-    fi
+    case $EMACS in
+      /*) ;;
+      *)
+	if [ ! -f "$EMACS" ]; then
+	  echo "$0: You must specify the EMACS environment variable " \
+	       "to an absolute file name." 2>&1
+	  exit 1
+	fi;;
+    esac
   fi
 fi
 
--- a/man/ChangeLog	Wed Sep 06 07:30:39 2006 +0000
+++ b/man/ChangeLog	Thu Sep 14 09:24:00 2006 +0000
@@ -1,3 +1,40 @@
+2006-09-12  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* files.texi (Visiting): Add index entry "open file".
+
+	* reftex.texi (Citations Outside LaTeX): Simplify lisp example.
+
+2006-09-12  Paul Eggert  <eggert@cs.ucla.edu>
+
+	* faq.texi (Escape sequences in shell output): EMACS is now set
+	to Emacs's absolute file name, not to "t".
+	(^M in the shell buffer): Likewise.
+	* misc.texi (Interactive Shell): Likewise.
+
+2006-09-11  Richard Stallman  <rms@gnu.org>
+
+	* building.texi (Compilation Mode): Clarification.
+	(Grep Searching): Add xref to Compilation Mode.
+
+2006-09-11  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* gnus.texi (Mail Source Specifiers): Mention problem of duplicate
+	mails with pop3-leave-mail-on-server.  Fix wording.
+
+2006-09-11  Simon Josefsson  <jas@extundo.com>
+
+	* smtpmail.texi (Authentication): Explain TLS and SSL better, based on
+	suggested by Phillip Lord <phillip.lord@newcastle.ac.uk>.
+
+2006-09-08  Richard Stallman  <rms@gnu.org>
+
+	* search.texi (Search): Ref multi-file search commands here.
+	(Other Repeating Search): Not here.
+
+2006-09-06  Simon Josefsson  <jas@extundo.com>
+
+	* smtpmail.texi (Authentication): Mention SSL.
+
 2006-09-01  Eli Zaretskii  <eliz@gnu.org>
 
 	* rcirc.texi (Internet Relay Chat, Useful IRC commands): Don't use
--- a/man/building.texi	Wed Sep 06 07:30:39 2006 +0000
+++ b/man/building.texi	Thu Sep 14 09:24:00 2006 +0000
@@ -210,9 +210,9 @@
 backquote or ``grave accent,'' not the single-quote.  This command is
 available in all buffers, not just in @samp{*compilation*}; it
 displays the next error message at the top of one window and source
-location of the error in another window.  It also momentarily
-highlights the relevant source line.  You can change the behavior of
-this highlighting with the variable @code{next-error-highlight}.
+location of the error in another window.  It also temporarily
+highlights the relevant source line, for a period controlled by the
+variable @code{next-error-highlight}.
 
   The first time @w{@kbd{C-x `}} is used after the start of a compilation,
 it moves to the first error's location.  Subsequent uses of @kbd{C-x
@@ -335,9 +335,11 @@
 @section Searching with Grep under Emacs
 
   Just as you can run a compiler from Emacs and then visit the lines
-with compilation errors, you can also run @code{grep} and
-then visit the lines on which matches were found.  This works by
-treating the matches reported by @code{grep} as if they were ``errors.''
+with compilation errors, you can also run @code{grep} and then visit
+the lines on which matches were found.  This works by treating the
+matches reported by @code{grep} as if they were ``errors.''  The
+buffer of matches uses Grep mode, which is a variant of Compilation
+mode (@pxref{Compilation Mode}).
 
 @table @kbd
 @item M-x grep
--- a/man/faq.texi	Wed Sep 06 07:30:39 2006 +0000
+++ b/man/faq.texi	Thu Sep 14 09:24:00 2006 +0000
@@ -2683,7 +2683,8 @@
 @item
 Make the alias conditioned on the @code{EMACS} variable in the
 environment.  When Emacs runs a subsidiary shell, it exports the
-@code{EMACS} variable with the value @code{t} to that shell.  You can
+@code{EMACS} variable to that shell, with value equal to the absolute
+file name of Emacs.  You can
 unalias @code{ls} when that happens, thus limiting the alias to your
 interactive sessions.
 
@@ -2753,7 +2754,7 @@
 
 @example
 if ($?EMACS) then
-    if ("$EMACS" == t) then
+    if ("$EMACS" =~ /*) then
         if ($?tcsh) unset edit
         stty nl
     endif
--- a/man/files.texi	Wed Sep 06 07:30:39 2006 +0000
+++ b/man/files.texi	Thu Sep 14 09:24:00 2006 +0000
@@ -155,6 +155,7 @@
 @node Visiting
 @section Visiting Files
 @cindex visiting files
+@cindex open file
 
 @table @kbd
 @item C-x C-f
--- a/man/gnus.texi	Wed Sep 06 07:30:39 2006 +0000
+++ b/man/gnus.texi	Thu Sep 14 09:24:00 2006 +0000
@@ -6348,9 +6348,9 @@
 @item / n
 @kindex / n (Summary)
 @findex gnus-summary-limit-to-articles
-Limit the summary buffer to the current article
-(@code{gnus-summary-limit-to-articles}).  Uses the process/prefix
-convention (@pxref{Process/Prefix}).
+With prefix @samp{n}, limit the summary buffer to the next @samp{n}
+articles.  If not given a prefix, use the process marked articles
+instead.  (@code{gnus-summary-limit-to-articles}).
 
 @item / w
 @kindex / w (Summary)
@@ -13633,16 +13633,17 @@
 @vindex pop3-movemail
 @vindex pop3-leave-mail-on-server
 If the @code{:program} and @code{:function} keywords aren't specified,
-@code{pop3-movemail} will be used.  If the
-@code{pop3-leave-mail-on-server} is non-@code{nil} the mail is to be
-left on the @acronym{POP} server after fetching when using
-@code{pop3-movemail}.  Note that POP servers maintain no state
-information between sessions, so what the client believes is there and
-what is actually there may not match up.  If they do not, then the whole
-thing can fall apart and leave you with a corrupt mailbox.
-
-Here are some examples.  Fetch from the default @acronym{POP} server,
-using the default user name, and default fetcher:
+@code{pop3-movemail} will be used.  If @code{pop3-leave-mail-on-server}
+is non-@code{nil} the mail is to be left on the @acronym{POP} server
+after fetching when using @code{pop3-movemail}.  Note that POP servers
+maintain no state information between sessions, so what the client
+believes is there and what is actually there may not match up.  If they
+do not, then you may get duplicate mails or the whole thing can fall
+apart and leave you with a corrupt mailbox.
+
+Here are some examples for getting mail from a @acronym{POP} server.
+Fetch from the default @acronym{POP} server, using the default user
+name, and default fetcher:
 
 @lisp
 (pop)
@@ -22183,7 +22184,7 @@
 @code{gnus-article-x-face-command} variable.  If this variable is a
 string, this string will be executed in a sub-shell.  If it is a
 function, this function will be called with the face as the argument.
-If the @code{gnus-article-x-face-too-ugly} (which is a regexp) matches
+If @code{gnus-article-x-face-too-ugly} (which is a regexp) matches
 the @code{From} header, the face will not be shown.
 
 (Note: @code{x-face} is used in the variable/function names, not
--- a/man/misc.texi	Wed Sep 06 07:30:39 2006 +0000
+++ b/man/misc.texi	Thu Sep 14 09:24:00 2006 +0000
@@ -488,7 +488,8 @@
 
 @cindex @env{EMACS} environment variable
   Unless the environment variable @env{EMACS} is already defined,
-Emacs defines it in the subshell, with value @code{t}.  A shell script
+Emacs defines it in the subshell, with value equal to Emacs's absolute
+file name.  A shell script
 can check this variable to determine whether it has been run from an
 Emacs subshell.
 
--- a/man/reftex.texi	Wed Sep 06 07:30:39 2006 +0000
+++ b/man/reftex.texi	Thu Sep 14 09:24:00 2006 +0000
@@ -1929,8 +1929,8 @@
 @lisp
 (add-hook 'mail-setup-hook
           (lambda () (define-key mail-mode-map "\C-c["
-                       (lambda () (interactive)
-                         (require 'reftex)
+                       (lambda ()
+                         (interactive)
                          (let ((reftex-cite-format 'locally))
                            (reftex-citation))))))
 @end lisp
--- a/man/search.texi	Wed Sep 06 07:30:39 2006 +0000
+++ b/man/search.texi	Thu Sep 14 09:24:00 2006 +0000
@@ -16,7 +16,14 @@
   Besides the usual @code{replace-string} command that finds all
 occurrences of one string and replaces them with another, Emacs has a
 more flexible replacement command called @code{query-replace}, which
-asks interactively which occurrences to replace.
+asks interactively which occurrences to replace.  There are also
+commands to find and operate on all matches for a pattern.
+
+  You can also search multiple files under control of a tags
+table (@pxref{Tags Search}) or through the Dired @kbd{A} command
+(@pxref{Operating on Files}), or ask the @code{grep} program to do it
+(@pxref{Grep Searching}).
+
 
 @menu
 * Incremental Search::		Search happens as you type the string.
@@ -1332,11 +1339,6 @@
 If a match is split across lines, this command keeps all those lines.
 @end table
 
-  You can also search multiple files under control of a tags table
-(@pxref{Tags Search}) or through the Dired @kbd{A} command
-(@pxref{Operating on Files}), or ask the @code{grep} program to do it
-(@pxref{Grep Searching}).
-
 @ignore
    arch-tag: fd9d8e77-66af-491c-b212-d80999613e3e
 @end ignore
--- a/man/smtpmail.texi	Wed Sep 06 07:30:39 2006 +0000
+++ b/man/smtpmail.texi	Thu Sep 14 09:24:00 2006 +0000
@@ -209,9 +209,12 @@
 @cindex CRAM-MD5
 @cindex LOGIN
 @cindex STARTTLS
+@cindex TLS
+@cindex SSL
 Many environments require SMTP clients to authenticate themselves
 before they are allowed to route mail via a server.  The two following
 variables contains the authentication information needed for this.
+
 The first variable, @code{smtpmail-auth-credentials}, instructs the
 SMTP library to use a SASL authentication step, currently only the
 CRAM-MD5 and LOGIN mechanisms are supported and will be selected in
@@ -220,10 +223,17 @@
 The second variable, @code{smtpmail-starttls-credentials}, instructs
 the SMTP library to connect to the server using STARTTLS.  This means
 the protocol exchange may be integrity protected and confidential by
-using TLS, and optionally also authentication of the client.  This
-feature uses the elisp package @file{starttls.el} (see it for more
-information on customization), which in turn require that at least one
-of the following external tools are installed:
+using the Transport Layer Security (TLS) protocol, and optionally also
+authentication of the client and server.
+
+TLS is a security protocol that is also known as SSL, although
+strictly speaking, SSL is an older variant of TLS.  TLS is backwards
+compatible with SSL.  In most mundane situations, the two terms are
+equivalent.
+
+The TLS feature uses the elisp package @file{starttls.el} (see it for
+more information on customization), which in turn require that at
+least one of the following external tools are installed:
 
 @enumerate
 @item
--- a/src/ChangeLog	Wed Sep 06 07:30:39 2006 +0000
+++ b/src/ChangeLog	Thu Sep 14 09:24:00 2006 +0000
@@ -1,3 +1,186 @@
+2006-09-13  YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+	* xterm.c (x_initialize): Don't install Xt event timer here.
+	(x_timeout_atimer_activated_flag): New var.
+	(x_activate_timeout_atimer): New function to install Xt timer.
+	(x_send_scroll_bar_event, x_process_timeouts): Use it.
+
+	* xmenu.c (x_menu_set_in_use, popup_activate_callback)
+	(create_and_show_popup_menu, create_and_show_dialog): Use it.
+
+	* xterm.h (x_activate_timeout_atimer): Add prototype.
+
+2006-09-13  Richard Stallman  <rms@gnu.org>
+
+	* print.c (print_string): When printcharfun is t,
+	copy string contents and call strout on the copy.
+
+	* keyboard.c (read_char): If end_time specified, don't put the
+	event into this_command_keys.
+	(read_key_sequence): If Voverriding_terminal_local_map is specified,
+	don't check Voverriding_local_map at all.
+
+2006-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* textprop.c (Fnext_property_change, Fnext_single_property_change)
+	(Fprevious_property_change, Fprevious_single_property_change):
+	Avoid changing limit, so we can correctly catch the case where the
+	property is constant up to limit.
+
+2006-09-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* macfns.c (mac_window) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]:
+	* macterm.c (XTread_socket) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]:
+	Undo 2006-09-08 change.
+
+2006-09-11  Chong Yidong  <cyd@stupidchicken.com>
+
+	* keymap.c (Fkey_binding): Use string position for string objects.
+
+2006-09-11  Kim F. Storm  <storm@cua.dk>
+
+	* keymap.c (Fkey_binding): Fix last change.
+
+	* editfns.c (Fmessage): Recommend using (message "%s" ...).
+
+2006-09-10  Chong Yidong  <cyd@stupidchicken.com>
+
+	* keymap.c (Fkey_binding): Check for local keymap for mouse click
+	events.
+
+2006-09-10  Kim F. Storm  <storm@cua.dk>
+
+	* keyboard.c (Finput_pending_p): Check Vunread_input_method_events
+	and Vunread_post_input_method_events.
+
+	* dispnew.c (Fredisplay): Document return value.
+
+2006-09-10  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* xfns.c (Fx_close_connection): Call xg_display_close when USE_GTK.
+
+	* gtkutil.c (xg_display_close): Always change default display if needed,
+	check for < Gtk+ version 2.10 before calling gdk_display_close.
+
+2006-09-10  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* mac.c [MAC_OSX] (sys_select): Check argument `nfds' more rigidly.
+	Make variable `ofds' static.  Remove variable `maxfd'.
+
+	* macfns.c (Fx_file_dialog): Remove unused variable `f'.  Call
+	check_mac.
+
+	* macmenu.c (Vmenu_updating_frame, syms_of_macmenu):
+	* w32menu.c (Vmenu_updating_frame, syms_of_w32menu): Apply
+	2006-09-08 change for xmenu.c.
+
+	* xfns.c (Fx_file_dialog): Call check_x.
+
+2006-09-10  Kim F. Storm  <storm@cua.dk>
+
+	* xdisp.c (get_window_cursor_type): Use hollow cursor on
+	non-transparent images.
+
+2006-09-09  Eli Zaretskii  <eliz@gnu.org>
+
+	* editfns.c (Fsystem_name): Mention "host" in the doc string.
+	(syms_of_editfns) <system-name>: Likewise.
+
+2006-08-27  Martin Rudalics  <rudalics@gmx.at>
+
+	* xdisp.c (mouse_autoselect_window): Removed.
+	(Vmouse_autoselect_window): New variable.  DEFVAR_LISP it.
+
+	* dispextern.h (mouse_autoselect_window): Remove extern.
+	(Vmouse_autoselect_window): Add extern.
+
+	* macterm.c (XTread_socket): Test Vmouse_autoselect_window
+	instead of mouse_autoselect_window.
+
+	* msdos.c (dos_rawgetc): Likewise.
+
+	* w32term.c (w32_read_socket): Likewise.
+
+	* xterm.c (handle_one_xevent): Likewise.
+
+2006-09-08  Richard Stallman  <rms@gnu.org>
+
+	* xdisp.c (Vmenu_updating_frame): Define here.
+	(syms_of_xdisp): DEFVAR it here.
+	(update_menu_bar): Always return hooks_run.
+	Set Vmenu_updating_frame.
+
+	* xdisp.c (redisplay_internal): Test Vinhibit_redisplay
+	before calculating SELECTED_FRAME.
+
+	* xmenu.c (Vmenu_updating_frame): Don't define here.
+	(syms_of_xmenu): Don't DEFVAR it here.
+
+	* xterm.c (x_error_quitter): For BadName error, just return.
+
+	* eval.c (find_handler_clause): Give up on debugger if INPUT_BLOCKED_P.
+
+	* casetab.c (init_casetab_once): Call set_case_table.
+
+	* emacs.c (shut_down_emacs): Set inhibit_sentinels.
+
+	* process.c (inhibit_sentinels): New variable.
+	(exec_sentinel): Test inhibit_sentinels.
+	(init_process): Initialize it.
+
+	* process.h (inhibit_sentinels): Add decl.
+
+	* search.c (looking_at_1, string_match_1, search_command):
+	Make syntax table's canon table point to eqv table.
+
+2006-09-08  Andreas Schwab  <schwab@suse.de>
+
+	* print.c (strout): Fix whitespace.
+
+2006-09-08  Kim F. Storm  <storm@cua.dk>
+
+	* xterm.c (x_draw_glyph_string): Fix 2006-08-24 change.
+
+2006-09-08  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* mac.c [!MAC_OSX]: Don't include keyboard.h.
+	[!MAC_OSX] (select): Try detect_input_pending before ReceiveNextEvent
+	in the same BLOCK_INPUT block, in case that some input has already
+	been read asynchronously.  Pretend to be interrupted by a signal
+	if some input is available.
+	[MAC_OSX] (select_and_poll_event, sys_select): Likewise.
+	(SELECT_POLLING_PERIOD_USEC) [SELECT_USE_CFSOCKET]: Change to 100000.
+	Now used for ReceiveNextEvent timeout instead of select timeout.
+	(EVENT_CLASS_SOCK) [SELECT_USE_CFSOCKET]: Remove macro.
+	[SELECT_USE_CFSOCKET] (socket_callback): Add non-blocking connect
+	support.  Quit event loop.
+	[MAC_OSX] (sys_select) [SELECT_USE_CFSOCKET]: Add non-blocking
+	connect support.  Reuse previously allocated CFRunLoopSource.
+	(Fmac_process_hi_command) [TARGET_API_MAC_CARBON]: New function.
+	(syms_of_mac) [TARGET_API_MAC_CARBON]: Defsubr it.
+
+	* macfns.c (mac_window) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]:
+	Specify kWindowAsyncDragAttribute.
+
+	* macterm.c (mac_handle_origin_change, mac_handle_size_change)
+	(mac_get_ideal_size): New functions.
+	(x_set_offset, x_set_window_size, x_make_frame_visible)
+	(do_zoom_window, mac_handle_window_event, XTread_socket): Use them.
+	(install_window_handler, mac_handle_window_event)
+	[USE_CARBON_EVENTS]: Handle kEventWindowGetIdealSize and
+	kEventWindowBoundsChanged.
+	(XTread_socket) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: Don't call
+	DragWindow.
+
+2006-09-07  Andreas Schwab  <schwab@suse.de>
+
+	* m/ibms390x.h (START_FILES, LIB_STANDARD): Override to
+	use lib64 instead of lib.
+
+2006-09-06  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* Makefile.in: Avoid double quotes when possible.
+
 2006-09-06  Kenichi Handa  <handa@m17n.org>
 
 	* editfns.c (Fformat_time_string): Use make_unibyte_string to make
@@ -6,8 +189,8 @@
 2006-09-06  Kim F. Storm  <storm@cua.dk>
 
 	* xdisp.c (pos_visible_p): Remove exact_mode_line_heights_p arg;
-	so always calculate heights even when pos-visible-in-window-p is
-	called with partially = t.  Don't overshoot last_visible_y in move_it_to.
+	so calculate heights even when pos-visible-in-window-p is called
+	with partially = t.  Don't overshoot last_visible_y in move_it_to.
 	Return row height and row number in new rowh and vpos args.
 	(cursor_row_fully_visible_p): First line is always "fully visible".
 	(try_window): Don't clear matrix if vscrolled.
@@ -16,13 +199,14 @@
 
 	* window.c (Fpos_visible_in_window_p): Adapt to new pos_visible_p.
 	Return row height and row number for partially visible rows.
-	Modify return value to a 2 element list for fully visible rows
-	and 6 for partially visible row.
+	Modify return value to a 2 element list for fully visible rows and
+	6 for partially visible row.
 	(window_scroll_pixel_based): Use pos_visible_p directly instead of
-	Fpos_visible_in_window_p.  Fix auto vscrolling for partially visible lines.
-	Only vscroll backwards if already vscrolled forwards.  Unconditionally
-	vscroll forwards if PT is first (and only) line.  Set new window start
-	instead of scrolling at start/end of tall line.
+	Fpos_visible_in_window_p.  Fix auto vscrolling for partially
+	visible lines.  Only vscroll backwards if already vscrolled
+	forwards.  Unconditionally vscroll forwards if PT is first (and
+	only) line.  Set new window start instead of scrolling at
+	start/end of tall line.
 
 2006-09-05  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
@@ -1557,13 +1741,13 @@
 
 2006-05-18  Kim F. Storm  <storm@cua.dk>
 
-	* xdisp.c (display_tool_bar_line): Restore entire tool-bar geometry when
-	backtracking in case last image doesn't fit on line.
+	* xdisp.c (display_tool_bar_line): Restore entire tool-bar
+	geometry when backtracking in case last image doesn't fit on line.
 
 2006-05-18  MIYOSHI Masanori <miyoshi@meadowy.org>  (tiny change)
 
-	* xdisp.c (display_tool_bar_line): Don't adjust tool-bar height by more than
-	height of one frame default line.
+	* xdisp.c (display_tool_bar_line): Don't adjust tool-bar height by
+	more than height of one frame default line.
 
 2006-05-17  Richard Stallman  <rms@gnu.org>
 
@@ -2363,10 +2547,11 @@
 	* term.c: Define aliases for append_glyph and produce_stretch_glyph
 	when `static' is defined to avoid name clash with those in xdisp.c.
 
-	* process.c (Faccept_process_output): Fix to comply with lisp reference.
-	Change arg "timeout" to "seconds" and allow both integer and float value.
-	Change arg "timeout-msec" to "millisec" and interpret" as milliseconds
-	rather than microseconds.  Fix doc string accordingly.
+	* process.c (Faccept_process_output): Fix to comply with lisp
+	reference.  Change arg "timeout" to "seconds" and allow both
+	integer and float value.  Change arg "timeout-msec" to "millisec"
+	and interpret" as milliseconds rather than microseconds.  Fix doc
+	string accordingly.
 
 2006-03-21  Ken Raeburn  <raeburn@raeburn.org>
 
@@ -4576,7 +4761,8 @@
 	* xdisp.c (pos_visible_p): Convert w->hscroll to pixels before use.
 	(remember_mouse_glyph): Clear RECT if mouse is over an image glyph.
 
-	* keyboard.c (make_lispy_position): Adjust wx for left margin if ON_TEXT.
+	* keyboard.c (make_lispy_position): Adjust wx for left margin if
+	ON_TEXT.
 	(Fposn_at_x_y): Fix calculation of x coordinate.
 	(Fposn_at_point): Return nil if point is hscrolled out of view.
 
@@ -11069,7 +11255,8 @@
 
 	* search.c (match_limit, Fmatch_data, Fset_match_data): YAILOM.
 
-	* fontset.c (Fset_fontset_font): Remove unused vars `family' and `registry'.
+	* fontset.c (Fset_fontset_font): Remove unused vars `family' and
+	`registry'.
 
 	* Makefile.in (${etc}DOC): Fix file name of make-docfile.
 
@@ -14043,11 +14230,11 @@
 	pointer types.
 	(Qrelative_width, Qalign_to): Remove unused variables.
 	(Vvoid_text_area_pointer): Replace Vshow_text_cursor_in_void.
-	(QCmap, QCpointer, Qrect, Qcircle, Qpoly): New variables for
-	image maps.
-	(x_y_to_hpos_vpos): Return glyph relative coordinates through
-	new dx and dy args.
-	Remove buffer_only_p arg (always 0).  Simplify code accordingly.
+	(QCmap, QCpointer, Qrect, Qcircle, Qpoly): New variables for image
+	maps.
+	(x_y_to_hpos_vpos): Return glyph relative coordinates through new
+	dx and dy args.  Remove buffer_only_p arg (always 0).  Simplify
+	code accordingly.
 	(get_glyph_string_clip_rect): Draw cursor using glyph's rather
 	than row's ascent and height, to get sensible height on tall rows.
 	(build_desired_tool_bar_string): Remove Qimage extern.
@@ -14060,14 +14247,16 @@
 	rectangular, circular, or polygon-shaped image hot-spot,
 	(find_hot_spot): New function to search for image hot-spot.
 	(Flookup_image_map): New defun to search for image hot-spot.
-	(define_frame_cursor1): New aux function to determine frame pointer.
-	(note_mode_line_or_margin_highlight, note_mouse_highlight):
-	Handle `pointer' text property and :pointer image property to
-	control frame pointer shape.  Detect image hot-spots for pointer
-	and help_echo properties.  Use define_frame_cursor1.
-	(note_mouse_highlight):	Use Vvoid_text_area_pointer.
-	(syms_of_xdisp): Defsubr new defun.  Intern and staticpro new variables.
-	DEFVAR_LISP Vvoid_text_area_pointer instead of Vshow_text_cursor_in_void.
+	(define_frame_cursor1): New aux function to determine frame
+	pointer.
+	(note_mode_line_or_margin_highlight, note_mouse_highlight): Handle
+	`pointer' text property and :pointer image property to control
+	frame pointer shape.  Detect image hot-spots for pointer and
+	help_echo properties.  Use define_frame_cursor1.
+	(note_mouse_highlight): Use Vvoid_text_area_pointer.
+	(syms_of_xdisp): Defsubr new defun.  Intern and staticpro new
+	variables.  DEFVAR_LISP Vvoid_text_area_pointer instead of
+	Vshow_text_cursor_in_void.
 
 	* xfaces.c (cache_face): Abort if c->size exceeds MAX_FACE_ID.
 
@@ -14551,8 +14740,8 @@
 	* alloc.c (lisp_align_malloc): If BASE is 0, call memory_full.
 
 	* window.c (Fset_window_margins): Allow only integers as args.
-	(syms_of_window) <special-display-buffer-names, special-display-regexps>:
-	Doc fixes.
+	(syms_of_window) <special-display-buffer-names,
+	special-display-regexps>: Doc fixes.
 
 2003-10-13  Lute Kamstra  <lute@gnu.org>
 
@@ -22355,15 +22544,15 @@
 
 	* process.c (Qlocal, QCname, QCbuffer, QChost, QCservice, QCfamily)
 	(QClocal, QCremote, QCserver, QCdatagram, QCnowait, QCnoquery, QCstop)
-	(QCcoding, QCoptions, QCfilter, QCsentinel, QClog, QCfeature):
-	New variables.
+	(QCcoding, QCoptions, QCfilter, QCsentinel, QClog, QCfeature): New
+	variables.
 	(NETCONN1_P): New macro.
 	(DATAGRAM_SOCKETS): New conditional symbol.
 	(datagram_address): New array.
 	(DATAGRAM_CONN_P, DATAGRAM_CHAN_P): New macros.
 	(status_message): Use concat3.
-	(Fprocess_status): Add `listen' status to doc string.  Return `stop'
-	for a stopped network process.
+	(Fprocess_status): Add `listen' status to doc string.  Return
+	`stop' for a stopped network process.
 	(Fset_process_buffer): Update contact plist for network process.
 	(Fset_process_filter): Ditto.  Don't enable input for stopped
 	network processes.  Server must listen, even if filter is t.
@@ -22373,26 +22562,29 @@
 	(Fprocess_contact): Added KEY argument.  Handle datagrams.
 	(list_processes_1): Optionally show only processes with the query
 	on exit flag set.  Dynamically adjust column widths.  Omit tty
-	column if not needed.  Report stopped network processes.
-	Identify server and datagram network processes.
+	column if not needed.  Report stopped network processes.  Identify
+	server and datagram network processes.
 	(Flist_processes): New optional arg `query-only'.
 	(conv_sockaddr_to_lisp, get_lisp_to_sockaddr_size)
 	(conv_lisp_to_sockaddr, set_socket_options)
-	(network_process_featurep, unwind_request_sigio): New helper functions.
+	(network_process_featurep, unwind_request_sigio): New helper
+	functions.
 	(Fprocess_datagram_address, Fset_process_datagram_address):
 	(Fset_network_process_options): New lisp functions.
 	(Fopen_network_stream): Removed.  Now defined in simple.el.
-	(Fmake_network_process): New lisp function.  Code is based on previous
-	Fopen_network_stream, but heavily reworked with new property list based
-	argument list, support for datagrams, server processes, and local
-	sockets in addition to old client-only functionality.
+	(Fmake_network_process): New lisp function.  Code is based on
+	previous Fopen_network_stream, but heavily reworked with new
+	property list based argument list, support for datagrams, server
+	processes, and local sockets in addition to old client-only
+	functionality.
 	(server_accept_connection): New function.
 	(wait_reading_process_input): Use it to handle incoming connects.
 	Do not enable input on a new connection if process is stopped.
-	(read_process_output): Handle datagram sockets.  Use 2k buffer for them.
+	(read_process_output): Handle datagram sockets.  Use 2k buffer for
+	them.
 	(send_process): Handle datagram sockets.
-	(Fstop_process, Fcontinue_process): Apply to network processes.  A stopped
-	network process is indicated by setting command field to t .
+	(Fstop_process, Fcontinue_process): Apply to network processes.  A
+	stopped network process is indicated by setting command field to t.
 	(Fprocess_send_eof): No-op if datagram connection.
 	(Fstatus_notify): Don't read input for a stream server socket or a
 	stopped network process.
--- a/src/Makefile.in	Wed Sep 06 07:30:39 2006 +0000
+++ b/src/Makefile.in	Thu Sep 14 09:24:00 2006 +0000
@@ -75,13 +75,13 @@
 #define NOT_C_CODE
 #include "config.h"
 
-/* We won''t really call alloca;
-   don''t let the file name alloca.c get messed up.  */
+/* We will not really call alloca;
+   do not let the file name alloca.c get messed up.  */
 #ifdef alloca
 #undef alloca
 #endif
 
-/* Don''t let the file name mktime.c get messed up.  */
+/* Do not let the file name mktime.c get messed up.  */
 #ifdef mktime
 #undef mktime
 #endif
@@ -96,7 +96,7 @@
 #endif
 
 /* On some machines #define register is done in config;
-   don''t let it interfere with this file.  */
+   do not let it interfere with this file.  */
 #undef register
 
 /* On some systems we may not be able to use the system make command. */
@@ -116,7 +116,7 @@
 #endif
 #endif
 
-/* Some machines don''t find the standard C libraries in the usual place.  */
+/* Some machines do not find the standard C libraries in the usual place.  */
 #ifndef ORDINARY_LINK
 #ifndef LIB_STANDARD
 #define LIB_STANDARD -lc
@@ -337,7 +337,7 @@
 
 #else /* not HAVE_MENUS */
 
-/* Otherwise, don''t worry about the menu library at all.  */
+/* Otherwise, do not worry about the menu library at all.  */
 LIBXMENU=
 #endif /* not HAVE_MENUS */
 
@@ -381,7 +381,7 @@
 #ifdef LIBXT_STATIC
 /* We assume the config files have defined STATIC_OPTION
    since that might depend on the operating system.
-   (Don''t forget you need different definitions with and without __GNUC__.)  */
+   (Do not forget you need different definitions with and without __GNUC__.)  */
 LIBXT= STATIC_OPTION $(LIBW) LIBXMU -lXt $(LIBXTR6) -lXext DYNAMIC_OPTION
 #else /* not LIBXT_STATIC */
 LIBXT= $(LIBW) LIBXMU -lXt $(LIBXTR6) -lXext
@@ -474,9 +474,9 @@
 /* Versions of GCC >= 2.0 put their library, libgcc.a, in obscure
    places that are difficult to figure out at make time.  Fortunately,
    these same versions allow you to pass arbitrary flags on to the
-   linker, so there''s no reason not to use it as a linker.
+   linker, so there is no reason not to use it as a linker.
 
-   Well, it''s not quite perfect.  The ``-nostdlib'' keeps GCC from
+   Well, it is not quite perfect.  The "-nostdlib" keeps GCC from
    searching for libraries in its internal directories, so we have to
    ask GCC explicitly where to find libgcc.a.  */
 
@@ -493,9 +493,9 @@
 
 #ifndef LINKER_WAS_SPECIFIED
 /* GCC passes any argument prefixed with -Xlinker directly to the
-   linker.  See prefix-args.c for an explanation of why we don''t do
+   linker.  See prefix-args.c for an explanation of why we do not do
    this with the shell''s ``for'' construct.
-   Note that some people don''t have '.'  in their paths, so we must
+   Note that some people do not have '.'  in their paths, so we must
    use ./prefix-args.  */
 #define YMF_PASS_LDFLAGS(flags) `./prefix-args -Xlinker flags`
 #else
@@ -536,12 +536,12 @@
 #endif /* not ORDINARY_LINK */
 
 /* Flags to pass to LD only for temacs.  */
-/* Don''t split this line with a backslash.  That can cause trouble with
+/* Do not split this line with a backslash.  That can cause trouble with
    some cpps.  */
 TEMACS_LDFLAGS = LD_SWITCH_SYSTEM LD_SWITCH_SYSTEM_TEMACS LD_SWITCH_MACHINE LD_SWITCH_MACHINE_TEMACS LD_SWITCH_SITE
 
 /* A macro which other sections of Makefile can redefine to munge the
-   flags before they''re passed to LD.  This is helpful if you have
+   flags before they are passed to LD.  This is helpful if you have
    redefined LD to something odd, like "gcc".
    (The YMF prefix is a holdover from the old name "ymakefile".)
   */
@@ -728,8 +728,8 @@
 #define TOOLTIP_SUPPORT
 #endif
 
-/* List of Lisp files loaded into the dumped Emacs.  It''s arranged
-   like this because it''s easier to generate it semi-mechanically from
+/* List of Lisp files loaded into the dumped Emacs.  It is arranged
+   like this because it is easier to generate it semi-mechanically from
    loadup.el this way.
 
    Note that this list should not include lisp files which might not
@@ -1003,13 +1003,13 @@
     -o temacs ${STARTFILES} ${obj} ${otherobj}  \
     OBJECTS_MACHINE ${LIBES}
 
-/* We don''t use ALL_LDFLAGS because LD_SWITCH_SYSTEM and LD_SWITCH_MACHINE
+/* We do not use ALL_LDFLAGS because LD_SWITCH_SYSTEM and LD_SWITCH_MACHINE
    often contain options that have to do with using Emacs''s crt0,
    which are only good with temacs.  */
 prefix-args${EXEEXT}: prefix-args.c $(config_h)
 	$(CC) $(ALL_CFLAGS) $(LDFLAGS) ${srcdir}/prefix-args.c -o prefix-args
 
-/* Don''t lose if this was not defined.  */
+/* Do not lose if this was not defined.  */
 #ifndef OLDXMENU_OPTIONS
 #define OLDXMENU_OPTIONS
 #endif
--- a/src/casetab.c	Wed Sep 06 07:30:39 2006 +0000
+++ b/src/casetab.c	Thu Sep 14 09:24:00 2006 +0000
@@ -292,6 +292,9 @@
     }
 
   XCHAR_TABLE (down)->extras[2] = Fcopy_sequence (up);
+
+  /* Fill in what isn't filled in.  */
+  set_case_table (down, 1);
 }
 
 void
--- a/src/config.in	Wed Sep 06 07:30:39 2006 +0000
+++ b/src/config.in	Thu Sep 14 09:24:00 2006 +0000
@@ -124,6 +124,10 @@
    don't. */
 #undef HAVE_DECL_SYS_SIGLIST
 
+/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't.
+   */
+#undef HAVE_DECL_TZNAME
+
 /* Define to 1 if you have the declaration of `__sys_siglist', and to 0 if you
    don't. */
 #undef HAVE_DECL___SYS_SIGLIST
@@ -805,7 +809,7 @@
 
 /* If using the C implementation of alloca, define if you know the
    direction of stack growth for your system; otherwise it will be
-   automatically deduced at run-time.
+   automatically deduced at runtime.
 	STACK_DIRECTION > 0 => grows toward higher addresses
 	STACK_DIRECTION < 0 => grows toward lower addresses
 	STACK_DIRECTION = 0 => direction of growth unknown */
--- a/src/dispextern.h	Wed Sep 06 07:30:39 2006 +0000
+++ b/src/dispextern.h	Thu Sep 14 09:24:00 2006 +0000
@@ -2700,7 +2700,7 @@
 extern int help_echo_pos;
 extern struct frame *last_mouse_frame;
 extern int last_tool_bar_item;
-extern int mouse_autoselect_window;
+extern Lisp_Object Vmouse_autoselect_window;
 extern int unibyte_display_via_language_environment;
 
 extern void reseat_at_previous_visible_line_start P_ ((struct it *));
--- a/src/dispnew.c	Wed Sep 06 07:30:39 2006 +0000
+++ b/src/dispnew.c	Thu Sep 14 09:24:00 2006 +0000
@@ -6536,7 +6536,8 @@
 DEFUN ("redisplay", Fredisplay, Sredisplay, 0, 1, 0,
        doc: /* Perform redisplay if no input is available.
 If optional arg FORCE is non-nil or `redisplay-dont-pause' is non-nil,
-perform a full redisplay even if input is available.  */)
+perform a full redisplay even if input is available.
+Return t if redisplay was performed, nil otherwise.  */)
      (force)
   Lisp_Object force;
 {
--- a/src/editfns.c	Wed Sep 06 07:30:39 2006 +0000
+++ b/src/editfns.c	Thu Sep 14 09:24:00 2006 +0000
@@ -1388,7 +1388,7 @@
 }
 
 DEFUN ("system-name", Fsystem_name, Ssystem_name, 0, 0, 0,
-       doc: /* Return the name of the machine you are running on, as a string.  */)
+       doc: /* Return the host name of the machine you are running on, as a string.  */)
      ()
 {
   return Vsystem_name;
@@ -3310,6 +3310,9 @@
 The first argument is a format control string, and the rest are data
 to be formatted under control of the string.  See `format' for details.
 
+Note: Use (message "%s" VALUE) to print the value of expressions and
+variables to avoid accidentally interpreting `%' as format specifiers.
+
 If the first argument is nil or the empty string, the function clears
 any existing message; this lets the minibuffer contents show.  See
 also `current-message'.
@@ -4514,7 +4517,7 @@
   Vbuffer_access_fontified_property = Qnil;
 
   DEFVAR_LISP ("system-name", &Vsystem_name,
-	       doc: /* The name of the machine Emacs is running on.  */);
+	       doc: /* The host name of the machine Emacs is running on.  */);
 
   DEFVAR_LISP ("user-full-name", &Vuser_full_name,
 	       doc: /* The full name of the user logged in.  */);
--- a/src/emacs.c	Wed Sep 06 07:30:39 2006 +0000
+++ b/src/emacs.c	Thu Sep 14 09:24:00 2006 +0000
@@ -2156,6 +2156,7 @@
 
   stuff_buffered_input (stuff);
 
+  inhibit_sentinels = 1;
   kill_buffer_processes (Qnil);
   Fdo_auto_save (Qt, Qnil);
 
--- a/src/eval.c	Wed Sep 06 07:30:39 2006 +0000
+++ b/src/eval.c	Thu Sep 14 09:24:00 2006 +0000
@@ -1904,6 +1904,9 @@
 	  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))
--- a/src/gtkutil.c	Wed Sep 06 07:30:39 2006 +0000
+++ b/src/gtkutil.c	Thu Sep 14 09:24:00 2006 +0000
@@ -131,14 +131,8 @@
 #ifdef HAVE_GTK_MULTIDISPLAY
   GdkDisplay *gdpy = gdk_x11_lookup_xdisplay (dpy);
 
-  /* GTK 2.2 has a bug that makes gdk_display_close crash (bug
-     http://bugzilla.gnome.org/show_bug.cgi?id=85715).  This way
-     we can continue running, but there will be memory leaks.  */
-
-#if GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION < 4
-
   /* If this is the default display, we must change it before calling
-     dispose, otherwise it will crash.  */
+     dispose, otherwise it will crash on some Gtk+ versions.  */
   if (gdk_display_get_default () == gdpy)
     {
       struct x_display_info *dpyinfo;
@@ -160,10 +154,14 @@
                                                gdpy_new);
     }
 
+  /* GTK 2.2-2.8 has a bug that makes gdk_display_close crash (bug
+     http://bugzilla.gnome.org/show_bug.cgi?id=85715).  This way
+     we can continue running, but there will be memory leaks.  */
+
+#if GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION < 10
   g_object_run_dispose (G_OBJECT (gdpy));
-
 #else
-  /* I hope this will be fixed in GTK 2.4.  It is what bug 85715 says.  */
+  /* This seems to be fixed in GTK 2.10. */
   gdk_display_close (gdpy);
 #endif
 #endif /* HAVE_GTK_MULTIDISPLAY */
--- a/src/keyboard.c	Wed Sep 06 07:30:39 2006 +0000
+++ b/src/keyboard.c	Thu Sep 14 09:24:00 2006 +0000
@@ -3257,8 +3257,9 @@
       goto retry;
     }
 
-  if (! reread || this_command_key_count == 0
-      || this_command_key_count_reset)
+  if ((! reread || this_command_key_count == 0
+       || this_command_key_count_reset)
+      && !end_time)
     {
 
       /* Don't echo mouse motion events.  */
@@ -8765,17 +8766,25 @@
      the initial keymaps from the current buffer.  */
   nmaps = 0;
 
-  if (!NILP (current_kboard->Voverriding_terminal_local_map)
-      || !NILP (Voverriding_local_map))
-    {
-      if (3 > nmaps_allocated)
-	{
-	  submaps = (Lisp_Object *) alloca (3 * sizeof (submaps[0]));
-	  defs    = (Lisp_Object *) alloca (3 * sizeof (defs[0]));
-	  nmaps_allocated = 3;
+  if (!NILP (current_kboard->Voverriding_terminal_local_map))
+    {
+      if (2 > nmaps_allocated)
+	{
+	  submaps = (Lisp_Object *) alloca (2 * sizeof (submaps[0]));
+	  defs    = (Lisp_Object *) alloca (2 * sizeof (defs[0]));
+	  nmaps_allocated = 2;
 	}
       if (!NILP (current_kboard->Voverriding_terminal_local_map))
 	submaps[nmaps++] = current_kboard->Voverriding_terminal_local_map;
+    }
+  else if (!NILP (Voverriding_local_map))
+    {
+      if (2 > nmaps_allocated)
+	{
+	  submaps = (Lisp_Object *) alloca (2 * sizeof (submaps[0]));
+	  defs    = (Lisp_Object *) alloca (2 * sizeof (defs[0]));
+	  nmaps_allocated = 2;
+	}
       if (!NILP (Voverriding_local_map))
 	submaps[nmaps++] = Voverriding_local_map;
     }
@@ -10087,7 +10096,9 @@
 if there is a doubt, the value is t.  */)
      ()
 {
-  if (!NILP (Vunread_command_events) || unread_command_char != -1)
+  if (!NILP (Vunread_command_events) || unread_command_char != -1
+      || !NILP (Vunread_post_input_method_events)
+      || !NILP (Vunread_input_method_events))
     return (Qt);
 
   get_input_pending (&input_pending,
--- a/src/keymap.c	Wed Sep 06 07:30:39 2006 +0000
+++ b/src/keymap.c	Thu Sep 14 09:24:00 2006 +0000
@@ -1609,6 +1609,37 @@
 
   GCPRO1 (key);
 
+#ifdef HAVE_MOUSE
+  if (VECTORP (key) && ASIZE (key) > 0)
+    {
+      Lisp_Object ev, pos;
+      if ((ev = AREF (key, 0), CONSP (ev))
+	  && SYMBOLP (XCAR (ev))
+	  && CONSP (XCDR (ev))
+	  && (pos = XCAR (XCDR (ev)), CONSP (pos))
+	  && XINT (Flength (pos)) == 10
+	  && INTEGERP (XCAR (XCDR (pos))))
+	{
+	  Lisp_Object map, object;
+
+	  object = Fnth (make_number(4), pos);
+
+	  if (CONSP (object))
+	    map = Fget_char_property (XCDR (object), Qkeymap, XCAR (object));
+	  else
+	    map = Fget_char_property (XCAR (XCDR (pos)), Qkeymap,
+				      Fwindow_buffer (XCAR (pos)));
+
+	  if (!NILP (Fkeymapp (map)))
+	    {
+	      value = Flookup_key (map, key, accept_default);
+	      if (! NILP (value) && !INTEGERP (value))
+		goto done;
+	    }
+	}
+    }
+#endif /* HAVE_MOUSE  */
+
   if (!NILP (current_kboard->Voverriding_terminal_local_map))
     {
       value = Flookup_key (current_kboard->Voverriding_terminal_local_map,
--- a/src/m/ibms390x.h	Wed Sep 06 07:30:39 2006 +0000
+++ b/src/m/ibms390x.h	Thu Sep 14 09:24:00 2006 +0000
@@ -159,5 +159,11 @@
 
 #define XPNTR(a) XUINT (a)
 
+#undef START_FILES
+#define START_FILES pre-crt0.o /usr/lib64/crt1.o /usr/lib64/crti.o
+
+#undef LIB_STANDARD
+#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib64/crtn.o
+
 /* arch-tag: 4b87653c-6add-4663-8691-7d9dc17b5519
    (do not change this comment) */
--- a/src/mac.c	Wed Sep 06 07:30:39 2006 +0000
+++ b/src/mac.c	Thu Sep 14 09:24:00 2006 +0000
@@ -2413,75 +2413,69 @@
 }
 
 
-#include "keyboard.h"
-extern Boolean mac_wait_next_event (EventRecord *, UInt32, Boolean);
+extern Boolean mac_wait_next_event P_ ((EventRecord *, UInt32, Boolean));
 
 int
 select (n,  rfds, wfds, efds, timeout)
-  int n;
-  SELECT_TYPE *rfds;
-  SELECT_TYPE *wfds;
-  SELECT_TYPE *efds;
-  struct timeval *timeout;
+     int nfds;
+     SELECT_TYPE *rfds, *wfds, *efds;
+     EMACS_TIME *timeout;
 {
-  OSStatus err;
-#if TARGET_API_MAC_CARBON
-  EventTimeout timeout_sec =
-    (timeout
-     ? (EMACS_SECS (*timeout) * kEventDurationSecond
-	+ EMACS_USECS (*timeout) * kEventDurationMicrosecond)
-     : kEventDurationForever);
-
-  BLOCK_INPUT;
-  err = ReceiveNextEvent (0, NULL, timeout_sec, kEventLeaveInQueue, NULL);
-  UNBLOCK_INPUT;
-#else /* not TARGET_API_MAC_CARBON */
-  EventRecord e;
-  UInt32 sleep_time = EMACS_SECS (*timeout) * 60 +
-    ((EMACS_USECS (*timeout) * 60) / 1000000);
+  OSStatus err = noErr;
 
   /* Can only handle wait for keyboard input.  */
-  if (n > 1 || wfds || efds)
+  if (nfds > 1 || wfds || efds)
     return -1;
 
-  /* Also return true if an event other than a keyDown has occurred.
-     This causes kbd_buffer_get_event in keyboard.c to call
-     read_avail_input which in turn calls XTread_socket to poll for
-     these events.  Otherwise these never get processed except but a
-     very slow poll timer.  */
-  if (mac_wait_next_event (&e, sleep_time, false))
-    err = noErr;
+  /* Try detect_input_pending before ReceiveNextEvent in the same
+     BLOCK_INPUT block, in case that some input has already been read
+     asynchronously.  */
+  BLOCK_INPUT;
+  if (!detect_input_pending ())
+    {
+#if TARGET_API_MAC_CARBON
+      EventTimeout timeoutval =
+	(timeout
+	 ? (EMACS_SECS (*timeout) * kEventDurationSecond
+	    + EMACS_USECS (*timeout) * kEventDurationMicrosecond)
+	 : kEventDurationForever);
+
+      if (timeoutval == 0.0)
+	err = eventLoopTimedOutErr;
+      else
+	err = ReceiveNextEvent (0, NULL, timeoutval,
+				kEventLeaveInQueue, NULL);
+#else /* not TARGET_API_MAC_CARBON */
+      EventRecord e;
+      UInt32 sleep_time = EMACS_SECS (*timeout) * 60 +
+	((EMACS_USECS (*timeout) * 60) / 1000000);
+
+      if (sleep_time == 0)
+	err = -9875;		/* eventLoopTimedOutErr */
+      else
+	{
+	  if (mac_wait_next_event (&e, sleep_time, false))
+	    err = noErr;
+	  else
+	    err = -9875;	/* eventLoopTimedOutErr */
+	}
+#endif /* not TARGET_API_MAC_CARBON */
+    }
+  UNBLOCK_INPUT;
+
+  if (err == noErr)
+    {
+      /* Pretend that `select' is interrupted by a signal.  */
+      detect_input_pending ();
+      errno = EINTR;
+      return -1;
+    }
   else
-    err = -9875;		/* eventLoopTimedOutErr */
-#endif /* not TARGET_API_MAC_CARBON */
-
-  if (FD_ISSET (0, rfds))
-    if (err == noErr)
-      return 1;
-    else
-      {
+    {
+      if (rfds)
 	FD_ZERO (rfds);
-	return 0;
-      }
-  else
-    if (err == noErr)
-      {
-	if (input_polling_used ())
-	  {
-	    /* It could be confusing if a real alarm arrives while
-	       processing the fake one.  Turn it off and let the
-	       handler reset it.  */
-	    extern void poll_for_input_1 P_ ((void));
-	    int old_poll_suppress_count = poll_suppress_count;
-	    poll_suppress_count = 1;
-	    poll_for_input_1 ();
-	    poll_suppress_count = old_poll_suppress_count;
-	  }
-	errno = EINTR;
-	return -1;
-      }
-    else
       return 0;
+    }
 }
 
 
@@ -4904,6 +4898,30 @@
 
   return result;
 }
+
+DEFUN ("mac-process-hi-command", Fmac_process_hi_command, Smac_process_hi_command, 1, 1, 0,
+       doc: /* Send a HI command whose ID is COMMAND-ID to the command chain.
+COMMAND-ID must be a 4-character string.  Some common command IDs are
+defined in the Carbon Event Manager.  */)
+     (command_id)
+     Lisp_Object command_id;
+{
+  OSStatus err;
+  HICommand command;
+
+  bzero (&command, sizeof (HICommand));
+  command.commandID = mac_get_code_from_arg (command_id, 0);
+
+  BLOCK_INPUT;
+  err = ProcessHICommand (&command);
+  UNBLOCK_INPUT;
+
+  if (err != noErr)
+    error ("HI command (command ID: '%s') not handled.", SDATA (command_id));
+
+  return Qnil;
+}
+
 #endif	/* TARGET_API_MAC_CARBON */
 
 
@@ -4944,23 +4962,22 @@
       -> Use `select'.
    2. Sockets are not involved.
       -> Use ReceiveNextEvent.
-   3. [If SELECT_USE_CFSOCKET is defined]
-      Only the window event channel and socket read channels are
+   3. [If SELECT_USE_CFSOCKET is set]
+      Only the window event channel and socket read/write channels are
       involved, and timeout is not too short (greater than
       SELECT_TIMEOUT_THRESHHOLD_RUNLOOP seconds).
       -> Create CFSocket for each socket and add it into the current
-         event RunLoop so that a `ready-to-read' event can be posted
-         to the event queue that is also used for window events.  Then
-         ReceiveNextEvent can wait for both kinds of inputs.
+         event RunLoop so that the current event loop gets quit when
+         the socket becomes ready.  Then ReceiveNextEvent can wait for
+         both kinds of inputs.
    4. Otherwise.
       -> Periodically poll the window input channel while repeatedly
          executing `select' with a short timeout
          (SELECT_POLLING_PERIOD_USEC microseconds).  */
 
-#define SELECT_POLLING_PERIOD_USEC 20000
-#ifdef SELECT_USE_CFSOCKET
+#define SELECT_POLLING_PERIOD_USEC 100000
+#if SELECT_USE_CFSOCKET
 #define SELECT_TIMEOUT_THRESHOLD_RUNLOOP 0.2
-#define EVENT_CLASS_SOCK 'Sock'
 
 static void
 socket_callback (s, type, address, data, info)
@@ -4970,196 +4987,211 @@
      const void *data;
      void *info;
 {
-  EventRef event;
-
-  CreateEvent (NULL, EVENT_CLASS_SOCK, 0, 0, kEventAttributeNone, &event);
-  PostEventToQueue (GetCurrentEventQueue (), event, kEventPriorityStandard);
-  ReleaseEvent (event);
+  int fd = CFSocketGetNative (s);
+  SELECT_TYPE *ofds = (SELECT_TYPE *)info;
+
+  if ((type == kCFSocketReadCallBack && FD_ISSET (fd, &ofds[0]))
+      || (type == kCFSocketConnectCallBack && FD_ISSET (fd, &ofds[1])))
+    QuitEventLoop (GetCurrentEventLoop ());
 }
 #endif	/* SELECT_USE_CFSOCKET */
 
 static int
-select_and_poll_event (n, rfds, wfds, efds, timeout)
-     int n;
-     SELECT_TYPE *rfds;
-     SELECT_TYPE *wfds;
-     SELECT_TYPE *efds;
-     struct timeval *timeout;
+select_and_poll_event (nfds, rfds, wfds, efds, timeout)
+     int nfds;
+     SELECT_TYPE *rfds, *wfds, *efds;
+     EMACS_TIME *timeout;
 {
-  int r;
-  OSStatus err;
-
-  r = select (n, rfds, wfds, efds, timeout);
-  if (r != -1)
+  OSStatus err = noErr;
+  int r = 0;
+
+  /* Try detect_input_pending before ReceiveNextEvent in the same
+     BLOCK_INPUT block, in case that some input has already been read
+     asynchronously.  */
+  BLOCK_INPUT;
+  if (!detect_input_pending ())
     {
-      BLOCK_INPUT;
-      err = ReceiveNextEvent (0, NULL, kEventDurationNoWait,
-			      kEventLeaveInQueue, NULL);
-      UNBLOCK_INPUT;
-      if (err == noErr)
+      EMACS_TIME select_timeout;
+      EventTimeout timeoutval =
+	(timeout
+	 ? (EMACS_SECS (*timeout) * kEventDurationSecond
+	    + EMACS_USECS (*timeout) * kEventDurationMicrosecond)
+	 : kEventDurationForever);
+
+      EMACS_SET_SECS_USECS (select_timeout, 0, 0);
+      r = select (nfds, rfds, wfds, efds, &select_timeout);
+      if (timeoutval == 0.0)
+	err = eventLoopTimedOutErr;
+      else if (r == 0)
 	{
-	  FD_SET (0, rfds);
-	  r++;
+#if USE_CG_DRAWING
+	  mac_prepare_for_quickdraw (NULL);
+#endif
+	  err = ReceiveNextEvent (0, NULL, timeoutval,
+				  kEventLeaveInQueue, NULL);
 	}
     }
-  return r;
+  UNBLOCK_INPUT;
+
+  if (r != 0)
+    return r;
+  else if (err == noErr)
+    {
+      /* Pretend that `select' is interrupted by a signal.  */
+      detect_input_pending ();
+      errno = EINTR;
+      return -1;
+    }
+  else
+    return 0;
 }
 
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1020
-#undef SELECT_INVALIDATE_CFSOCKET
-#endif
-
 int
-sys_select (n, rfds, wfds, efds, timeout)
-     int n;
-     SELECT_TYPE *rfds;
-     SELECT_TYPE *wfds;
-     SELECT_TYPE *efds;
-     struct timeval *timeout;
+sys_select (nfds, rfds, wfds, efds, timeout)
+     int nfds;
+     SELECT_TYPE *rfds, *wfds, *efds;
+     EMACS_TIME *timeout;
 {
-  OSStatus err;
-  int i, r;
+  OSStatus err = noErr;
+  int r;
   EMACS_TIME select_timeout;
+  static SELECT_TYPE ofds[3];
 
   if (inhibit_window_system || noninteractive
-      || rfds == NULL || !FD_ISSET (0, rfds))
-    return select (n, rfds, wfds, efds, timeout);
+      || nfds < 1 || rfds == NULL || !FD_ISSET (0, rfds))
+    return select (nfds, rfds, wfds, efds, timeout);
 
   FD_CLR (0, rfds);
-
-  if (wfds == NULL && efds == NULL)
+  ofds[0] = *rfds;
+
+  if (wfds)
+    ofds[1] = *wfds;
+  else
+    FD_ZERO (&ofds[1]);
+
+  if (efds)
+    ofds[2] = *efds;
+  else
     {
-      int nsocks = 0;
-      SELECT_TYPE orfds = *rfds;
-
-      EventTimeout timeout_sec =
+      EventTimeout timeoutval =
 	(timeout
 	 ? (EMACS_SECS (*timeout) * kEventDurationSecond
 	    + EMACS_USECS (*timeout) * kEventDurationMicrosecond)
 	 : kEventDurationForever);
 
-      for (i = 1; i < n; i++)
-	if (FD_ISSET (i, rfds))
-	  nsocks++;
-
-      if (nsocks == 0)
+      FD_SET (0, rfds);		/* sentinel */
+      do
 	{
-	  BLOCK_INPUT;
-	  err = ReceiveNextEvent (0, NULL, timeout_sec,
-				  kEventLeaveInQueue, NULL);
-	  UNBLOCK_INPUT;
-	  if (err == noErr)
-	    {
-	      FD_SET (0, rfds);
-	      return 1;
-	    }
-	  else
-	    return 0;
+	  nfds--;
 	}
-
-#if USE_CG_DRAWING
-      mac_prepare_for_quickdraw (NULL);
-#endif
+      while (!(FD_ISSET (nfds, rfds) || (wfds && FD_ISSET (nfds, wfds))));
+      nfds++;
+      FD_CLR (0, rfds);
+
+      if (nfds == 1)
+	return select_and_poll_event (nfds, rfds, wfds, efds, timeout);
+
       /* Avoid initial overhead of RunLoop setup for the case that
 	 some input is already available.  */
       EMACS_SET_SECS_USECS (select_timeout, 0, 0);
-      r = select_and_poll_event (n, rfds, wfds, efds, &select_timeout);
-      if (r != 0 || timeout_sec == 0.0)
+      r = select_and_poll_event (nfds, rfds, wfds, efds, &select_timeout);
+      if (r != 0 || timeoutval == 0.0)
 	return r;
 
-      *rfds = orfds;
-
-#ifdef SELECT_USE_CFSOCKET
-      if (timeout_sec > 0 && timeout_sec <= SELECT_TIMEOUT_THRESHOLD_RUNLOOP)
+      *rfds = ofds[0];
+      if (wfds)
+	*wfds = ofds[1];
+
+#if SELECT_USE_CFSOCKET
+      if (timeoutval > 0 && timeoutval <= SELECT_TIMEOUT_THRESHOLD_RUNLOOP)
 	goto poll_periodically;
 
-      {
-	CFRunLoopRef runloop =
-	  (CFRunLoopRef) GetCFRunLoopFromEventLoop (GetCurrentEventLoop ());
-	EventTypeSpec specs[] = {{EVENT_CLASS_SOCK, 0}};
-#ifdef SELECT_INVALIDATE_CFSOCKET
-	CFSocketRef *shead, *s;
-#else
-	CFRunLoopSourceRef *shead, *s;
-#endif
-
-	BLOCK_INPUT;
-
-#ifdef SELECT_INVALIDATE_CFSOCKET
-	shead = xmalloc (sizeof (CFSocketRef) * nsocks);
-#else
-	shead = xmalloc (sizeof (CFRunLoopSourceRef) * nsocks);
-#endif
-	s = shead;
-	for (i = 1; i < n; i++)
-	  if (FD_ISSET (i, rfds))
-	    {
-	      CFSocketRef socket =
-		CFSocketCreateWithNative (NULL, i, kCFSocketReadCallBack,
-					  socket_callback, NULL);
-	      CFRunLoopSourceRef source =
-		CFSocketCreateRunLoopSource (NULL, socket, 0);
-
-#ifdef SELECT_INVALIDATE_CFSOCKET
-	      CFSocketSetSocketFlags (socket, 0);
+      /* Try detect_input_pending before ReceiveNextEvent in the same
+	 BLOCK_INPUT block, in case that some input has already been
+	 read asynchronously.  */
+      BLOCK_INPUT;
+      if (!detect_input_pending ())
+	{
+	  int minfd, fd;
+	  CFRunLoopRef runloop =
+	    (CFRunLoopRef) GetCFRunLoopFromEventLoop (GetCurrentEventLoop ());
+	  static CFSocketContext context = {0, &ofds, NULL, NULL, NULL};
+	  static CFMutableDictionaryRef sources;
+
+	  if (sources == NULL)
+	    sources =
+	      CFDictionaryCreateMutable (NULL, 0, NULL,
+					 &kCFTypeDictionaryValueCallBacks);
+
+	  for (minfd = 1; ; minfd++) /* nfds-1 works as a sentinel.  */
+	    if (FD_ISSET (minfd, rfds) || (wfds && FD_ISSET (minfd, wfds)))
+	      break;
+
+	  for (fd = minfd; fd < nfds; fd++)
+	    if (FD_ISSET (fd, rfds) || (wfds && FD_ISSET (fd, wfds)))
+	      {
+		void *key = (void *) fd;
+		CFRunLoopSourceRef source =
+		  (CFRunLoopSourceRef) CFDictionaryGetValue (sources, key);
+
+		if (source == NULL)
+		  {
+		    CFSocketRef socket =
+		      CFSocketCreateWithNative (NULL, fd,
+						(kCFSocketReadCallBack
+						 | kCFSocketConnectCallBack),
+						socket_callback, &context);
+
+		    if (socket == NULL)
+		      continue;
+		    source = CFSocketCreateRunLoopSource (NULL, socket, 0);
+		    CFRelease (socket);
+		    if (source == NULL)
+		      continue;
+		    CFDictionaryAddValue (sources, key, source);
+		    CFRelease (source);
+		  }
+		CFRunLoopAddSource (runloop, source, kCFRunLoopDefaultMode);
+	      }
+
+#if USE_CG_DRAWING
+	  mac_prepare_for_quickdraw (NULL);
 #endif
-	      CFRunLoopAddSource (runloop, source, kCFRunLoopDefaultMode);
-#ifdef SELECT_INVALIDATE_CFSOCKET
-	      CFRelease (source);
-	      *s = socket;
-#else
-	      CFRelease (socket);
-	      *s = source;
-#endif
-	      s++;
-	    }
-
-	err = ReceiveNextEvent (0, NULL, timeout_sec, kEventLeaveInQueue, NULL);
-
-	do
-	  {
-	    --s;
-#ifdef SELECT_INVALIDATE_CFSOCKET
-	    CFSocketInvalidate (*s);
-#else
-	    CFRunLoopRemoveSource (runloop, *s, kCFRunLoopDefaultMode);
-#endif
-	    CFRelease (*s);
-	  }
-	while (s != shead);
-
-	xfree (shead);
-
-	if (err)
-	  {
-	    FD_ZERO (rfds);
-	    r = 0;
-	  }
-	else
-	  {
-	    FlushEventsMatchingListFromQueue (GetCurrentEventQueue (),
-					      GetEventTypeCount (specs),
-					      specs);
-	    EMACS_SET_SECS_USECS (select_timeout, 0, 0);
-	    r = select_and_poll_event (n, rfds, wfds, efds, &select_timeout);
-	  }
-
-	UNBLOCK_INPUT;
-
-	return r;
-      }
+	  err = ReceiveNextEvent (0, NULL, timeoutval,
+				  kEventLeaveInQueue, NULL);
+
+	  for (fd = minfd; fd < nfds; fd++)
+	    if (FD_ISSET (fd, rfds) || (wfds && FD_ISSET (fd, wfds)))
+	      {
+		void *key = (void *) fd;
+		CFRunLoopSourceRef source =
+		  (CFRunLoopSourceRef) CFDictionaryGetValue (sources, key);
+
+		CFRunLoopRemoveSource (runloop, source, kCFRunLoopDefaultMode);
+	      }
+	}
+      UNBLOCK_INPUT;
+
+      if (err == noErr || err == eventLoopQuitErr)
+	{
+	  EMACS_SET_SECS_USECS (select_timeout, 0, 0);
+	  return select_and_poll_event (nfds, rfds, wfds, efds,
+					&select_timeout);
+	}
+      else
+	{
+	  FD_ZERO (rfds);
+	  if (wfds)
+	    FD_ZERO (wfds);
+	  return 0;
+	}
 #endif	/* SELECT_USE_CFSOCKET */
     }
 
  poll_periodically:
   {
     EMACS_TIME end_time, now, remaining_time;
-    SELECT_TYPE orfds = *rfds, owfds, oefds;
-
-    if (wfds)
-      owfds = *wfds;
-    if (efds)
-      oefds = *efds;
+
     if (timeout)
       {
 	remaining_time = *timeout;
@@ -5172,15 +5204,15 @@
 	EMACS_SET_SECS_USECS (select_timeout, 0, SELECT_POLLING_PERIOD_USEC);
 	if (timeout && EMACS_TIME_LT (remaining_time, select_timeout))
 	  select_timeout = remaining_time;
-	r = select_and_poll_event (n, rfds, wfds, efds, &select_timeout);
+	r = select_and_poll_event (nfds, rfds, wfds, efds, &select_timeout);
 	if (r != 0)
 	  return r;
 
-	*rfds = orfds;
+	*rfds = ofds[0];
 	if (wfds)
-	  *wfds = owfds;
+	  *wfds = ofds[1];
 	if (efds)
-	  *efds = oefds;
+	  *efds = ofds[2];
 
 	if (timeout)
 	  {
@@ -5190,12 +5222,8 @@
       }
     while (!timeout || EMACS_TIME_LT (now, end_time));
 
-    FD_ZERO (rfds);
-    if (wfds)
-      FD_ZERO (wfds);
-    if (efds)
-      FD_ZERO (efds);
-    return 0;
+    EMACS_SET_SECS_USECS (select_timeout, 0, 0);
+    return select_and_poll_event (nfds, rfds, wfds, efds, &select_timeout);
   }
 }
 
@@ -5387,6 +5415,7 @@
 #if TARGET_API_MAC_CARBON
   defsubr (&Smac_get_preference);
   defsubr (&Smac_code_convert_string);
+  defsubr (&Smac_process_hi_command);
 #endif
 
   defsubr (&Smac_set_file_creator);
--- a/src/macfns.c	Wed Sep 06 07:30:39 2006 +0000
+++ b/src/macfns.c	Thu Sep 14 09:24:00 2006 +0000
@@ -4342,13 +4342,14 @@
      (prompt, dir, default_filename, mustmatch, only_dir_p)
      Lisp_Object prompt, dir, default_filename, mustmatch, only_dir_p;
 {
-  struct frame *f = SELECTED_FRAME ();
   Lisp_Object file = Qnil;
   int count = SPECPDL_INDEX ();
   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6;
   char filename[MAXPATHLEN];
   static NavEventUPP mac_nav_event_callbackUPP = NULL;
 
+  check_mac ();
+
   GCPRO6 (prompt, dir, default_filename, mustmatch, file, only_dir_p);
   CHECK_STRING (prompt);
   CHECK_STRING (dir);
--- a/src/macmenu.c	Wed Sep 06 07:30:39 2006 +0000
+++ b/src/macmenu.c	Thu Sep 14 09:24:00 2006 +0000
@@ -158,10 +158,10 @@
 #define FALSE 0
 #endif /* no TRUE */
 
-Lisp_Object Vmenu_updating_frame;
-
 Lisp_Object Qdebug_on_next_call;
 
+extern Lisp_Object Vmenu_updating_frame;
+
 extern Lisp_Object Qmenu_bar, Qmac_apple_event;
 
 extern Lisp_Object QCtoggle, QCradio;
@@ -2630,11 +2630,6 @@
   Qdebug_on_next_call = intern ("debug-on-next-call");
   staticpro (&Qdebug_on_next_call);
 
-  DEFVAR_LISP ("menu-updating-frame", &Vmenu_updating_frame,
-	       doc: /* Frame for which we are updating a menu.
-The enable predicate for a menu command should check this variable.  */);
-  Vmenu_updating_frame = Qnil;
-
   defsubr (&Sx_popup_menu);
 #ifdef HAVE_MENUS
   defsubr (&Sx_popup_dialog);
--- a/src/macterm.c	Wed Sep 06 07:30:39 2006 +0000
+++ b/src/macterm.c	Thu Sep 14 09:24:00 2006 +0000
@@ -5824,6 +5824,57 @@
 #endif /* not TARGET_API_MAC_CARBON */
 }
 
+static void
+mac_handle_origin_change (f)
+     struct frame *f;
+{
+  x_real_positions (f, &f->left_pos, &f->top_pos);
+}
+
+static void
+mac_handle_size_change (f, pixelwidth, pixelheight)
+     struct frame *f;
+     int pixelwidth, pixelheight;
+{
+  int cols, rows;
+
+  cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixelwidth);
+  rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixelheight);
+
+  if (cols != FRAME_COLS (f)
+      || rows != FRAME_LINES (f)
+      || pixelwidth != FRAME_PIXEL_WIDTH (f)
+      || pixelheight != FRAME_PIXEL_HEIGHT (f))
+    {
+      /* We pass 1 for DELAY since we can't run Lisp code inside of
+	 a BLOCK_INPUT.  */
+      change_frame_size (f, rows, cols, 0, 1, 0);
+      FRAME_PIXEL_WIDTH (f) = pixelwidth;
+      FRAME_PIXEL_HEIGHT (f) = pixelheight;
+      SET_FRAME_GARBAGED (f);
+
+      /* If cursor was outside the new size, mark it as off.  */
+      mark_window_cursors_off (XWINDOW (f->root_window));
+
+      /* Clear out any recollection of where the mouse highlighting
+	 was, since it might be in a place that's outside the new
+	 frame size.  Actually checking whether it is outside is a
+	 pain in the neck, so don't try--just let the highlighting be
+	 done afresh with new size.  */
+      cancel_mouse_face (f);
+
+#if TARGET_API_MAC_CARBON
+      if (f->output_data.mac->hourglass_control)
+	{
+#if USE_CG_DRAWING
+	  mac_prepare_for_quickdraw (f);
+#endif
+	  MoveControl (f->output_data.mac->hourglass_control,
+		       pixelwidth - HOURGLASS_WIDTH, 0);
+	}
+#endif
+    }
+}
 
 
 /* Calculate the absolute position in frame F
@@ -5904,7 +5955,10 @@
   ConstrainWindowToScreen (FRAME_MAC_WINDOW (f), kWindowTitleBarRgn,
 			   kWindowConstrainMoveRegardlessOfFit
 			   | kWindowConstrainAllowPartial, NULL, NULL);
-  x_real_positions (f, &f->left_pos, &f->top_pos);
+#if USE_CARBON_EVENTS
+  if (!NILP (tip_frame) && XFRAME (tip_frame) == f)
+#endif
+    mac_handle_origin_change (f);
 #else
   {
     Rect inner, outer, screen_rect, dummy;
@@ -5978,50 +6032,11 @@
   x_wm_set_size_hint (f, (long) 0, 0);
 
   SizeWindow (FRAME_MAC_WINDOW (f), pixelwidth, pixelheight, 0);
-#if TARGET_API_MAC_CARBON
-  if (f->output_data.mac->hourglass_control)
-    {
-#if USE_CG_DRAWING
-      mac_prepare_for_quickdraw (f);
-#endif
-      MoveControl (f->output_data.mac->hourglass_control,
-		   pixelwidth - HOURGLASS_WIDTH, 0);
-    }
-#endif
-
-  /* Now, strictly speaking, we can't be sure that this is accurate,
-     but the window manager will get around to dealing with the size
-     change request eventually, and we'll hear how it went when the
-     ConfigureNotify event gets here.
-
-     We could just not bother storing any of this information here,
-     and let the ConfigureNotify event set everything up, but that
-     might be kind of confusing to the Lisp code, since size changes
-     wouldn't be reported in the frame parameters until some random
-     point in the future when the ConfigureNotify event arrives.
-
-     We pass 1 for DELAY since we can't run Lisp code inside of
-     a BLOCK_INPUT.  */
-  change_frame_size (f, rows, cols, 0, 1, 0);
-  FRAME_PIXEL_WIDTH (f) = pixelwidth;
-  FRAME_PIXEL_HEIGHT (f) = pixelheight;
-
-  /* We've set {FRAME,PIXEL}_{WIDTH,HEIGHT} to the values we hope to
-     receive in the ConfigureNotify event; if we get what we asked
-     for, then the event won't cause the screen to become garbaged, so
-     we have to make sure to do it here.  */
-  SET_FRAME_GARBAGED (f);
-
-  XFlush (FRAME_X_DISPLAY (f));
-
-  /* If cursor was outside the new size, mark it as off.  */
-  mark_window_cursors_off (XWINDOW (f->root_window));
-
-  /* Clear out any recollection of where the mouse highlighting was,
-     since it might be in a place that's outside the new frame size.
-     Actually checking whether it is outside is a pain in the neck,
-     so don't try--just let the highlighting be done afresh with new size.  */
-  cancel_mouse_face (f);
+
+#if USE_CARBON_EVENTS
+  if (!NILP (tip_frame) && f == XFRAME (tip_frame))
+#endif
+    mac_handle_size_change (f, pixelwidth, pixelheight);
 
   UNBLOCK_INPUT;
 }
@@ -6232,7 +6247,10 @@
 				  kWindowCascadeOnParentWindowScreen
 #endif
 				  );
-	      x_real_positions (f, &f->left_pos, &f->top_pos);
+#if USE_CARBON_EVENTS
+	      if (!NILP (tip_frame) && f == XFRAME (tip_frame))
+#endif
+		mac_handle_origin_change (f);
 	    }
 	  else
 #endif
@@ -9186,6 +9204,32 @@
 }
 
 
+#if TARGET_API_MAC_CARBON
+static Point
+mac_get_ideal_size (f)
+     struct frame *f;
+{
+  struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
+  WindowPtr w = FRAME_MAC_WINDOW (f);
+  Point ideal_size;
+  Rect standard_rect;
+  int height, width, columns, rows;
+
+  ideal_size.h = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, DEFAULT_NUM_COLS);
+  ideal_size.v = dpyinfo->height;
+  IsWindowInStandardState (w, &ideal_size, &standard_rect);
+  /* Adjust the standard size according to character boundaries.  */
+  width = standard_rect.right - standard_rect.left;
+  height = standard_rect.bottom - standard_rect.top;
+  columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, width);
+  rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, height);
+  ideal_size.h = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, columns);
+  ideal_size.v = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows);
+
+  return ideal_size;
+}
+#endif
+
 /* Handle clicks in zoom box.  Calculation of "standard state" based
    on code in IM - Window Manager A and code contributed by Ben
    Mesander.  The standard state of an Emacs window is 80-characters
@@ -9195,39 +9239,28 @@
 do_zoom_window (WindowPtr w, int zoom_in_or_out)
 {
   Rect zoom_rect, port_rect;
-  int columns, rows, width, height;
+  int width, height;
   struct frame *f = mac_window_to_frame (w);
-  struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
 #if TARGET_API_MAC_CARBON
-  Point standard_size;
-
-  standard_size.h = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, DEFAULT_NUM_COLS);
-  standard_size.v = dpyinfo->height;
-
-  if (IsWindowInStandardState (w, &standard_size, &zoom_rect))
+  Point ideal_size = mac_get_ideal_size (f);
+
+  GetWindowBounds (w, kWindowContentRgn, &port_rect);
+  if (IsWindowInStandardState (w, &ideal_size, &zoom_rect)
+      && port_rect.left == zoom_rect.left
+      && port_rect.top == zoom_rect.top)
     zoom_in_or_out = inZoomIn;
   else
-    {
-      /* Adjust the standard size according to character boundaries.  */
-
-      columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, zoom_rect.right - zoom_rect.left);
-      rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, zoom_rect.bottom - zoom_rect.top);
-      standard_size.h = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, columns);
-      standard_size.v = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows);
-      GetWindowBounds (w, kWindowContentRgn, &port_rect);
-      if (IsWindowInStandardState (w, &standard_size, &zoom_rect)
-	  && port_rect.left == zoom_rect.left
-	  && port_rect.top == zoom_rect.top)
-	zoom_in_or_out = inZoomIn;
-      else
-	zoom_in_or_out = inZoomOut;
-    }
-
-  ZoomWindowIdeal (w, zoom_in_or_out, &standard_size);
+    zoom_in_or_out = inZoomOut;
+
+#ifdef MAC_OS8
+  mac_clear_window (f);
+#endif
+  ZoomWindowIdeal (w, zoom_in_or_out, &ideal_size);
 #else /* not TARGET_API_MAC_CARBON */
   GrafPtr save_port;
   Point top_left;
-  int w_title_height;
+  int w_title_height, rows;
+  struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
 
   GetPort (&save_port);
 
@@ -9266,6 +9299,7 @@
   SetPort (save_port);
 #endif /* not TARGET_API_MAC_CARBON */
 
+#if !USE_CARBON_EVENTS
   /* retrieve window size and update application values */
 #if TARGET_API_MAC_CARBON
   GetWindowPortBounds (w, &port_rect);
@@ -9275,20 +9309,9 @@
   height = port_rect.bottom - port_rect.top;
   width = port_rect.right - port_rect.left;
 
-  if (width != FRAME_PIXEL_WIDTH (f)
-      || height != FRAME_PIXEL_HEIGHT (f))
-    {
-      rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, height);
-      columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, width);
-
-      change_frame_size (f, rows, columns, 0, 1, 0);
-      SET_FRAME_GARBAGED (f);
-      cancel_mouse_face (f);
-
-      FRAME_PIXEL_WIDTH (f) = width;
-      FRAME_PIXEL_HEIGHT (f) = height;
-    }
-  x_real_positions (f, &f->left_pos, &f->top_pos);
+  mac_handle_size_change (f, width, height);
+  mac_handle_origin_change (f);
+#endif
 }
 
 void
@@ -9427,6 +9450,7 @@
 {
   WindowPtr wp;
   OSStatus result, err;
+  struct frame *f;
   UInt32 attributes;
   XSizeHints *size_hints;
 
@@ -9435,6 +9459,7 @@
   if (err != noErr)
     return eventNotHandledErr;
 
+  f = mac_window_to_frame (wp);
   switch (GetEventKind (event))
     {
     case kEventWindowUpdate:
@@ -9445,6 +9470,21 @@
       do_window_update (wp);
       return noErr;
 
+    case kEventWindowGetIdealSize:
+      result = CallNextEventHandler (next_handler, event);
+      if (result != eventNotHandledErr)
+	return result;
+
+      {
+	Point ideal_size = mac_get_ideal_size (f);
+
+	err = SetEventParameter (event, kEventParamDimensions,
+				 typeQDPoint, sizeof (Point), &ideal_size);
+	if (err == noErr)
+	  return noErr;
+      }
+      break;
+
     case kEventWindowBoundsChanging:
       result = CallNextEventHandler (next_handler, event);
       if (result != eventNotHandledErr)
@@ -9455,7 +9495,7 @@
       if (err != noErr)
 	break;
 
-      size_hints = FRAME_SIZE_HINTS (mac_window_to_frame (wp));
+      size_hints = FRAME_SIZE_HINTS (f);
       if ((attributes & kWindowBoundsChangeUserResize)
 	  && ((size_hints->flags & (PResizeInc | PBaseSize | PMinSize))
 	      == (PResizeInc | PBaseSize | PMinSize)))
@@ -9496,24 +9536,53 @@
 	}
       break;
 
+    case kEventWindowBoundsChanged:
+      err = GetEventParameter (event, kEventParamAttributes, typeUInt32,
+			       NULL, sizeof (UInt32), NULL, &attributes);
+      if (err != noErr)
+	break;
+
+      if (attributes & kWindowBoundsChangeSizeChanged)
+	{
+	  Rect bounds;
+
+	  err = GetEventParameter (event, kEventParamCurrentBounds,
+				   typeQDRectangle, NULL, sizeof (Rect),
+				   NULL, &bounds);
+	  if (err == noErr)
+	    {
+	      int width, height;
+
+	      width = bounds.right - bounds.left;
+	      height = bounds.bottom - bounds.top;
+	      mac_handle_size_change (f, width, height);
+	    }
+	}
+
+      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 (mac_window_to_frame (wp));
+      mac_handle_visibility_change (f);
       return noErr;
 
       break;
 
     case kEventWindowClose:
+      result = CallNextEventHandler (next_handler, event);
       {
 	struct input_event buf;
 
 	EVENT_INIT (buf);
 	buf.kind = DELETE_WINDOW_EVENT;
-	XSETFRAME (buf.frame_or_window, mac_window_to_frame (wp));
+	XSETFRAME (buf.frame_or_window, f);
 	buf.arg = Qnil;
 	kbd_buffer_store_event (&buf);
       }
@@ -9929,7 +9998,9 @@
 #if USE_CARBON_EVENTS
   EventTypeSpec specs_window[] =
     {{kEventClassWindow, kEventWindowUpdate},
+     {kEventClassWindow, kEventWindowGetIdealSize},
      {kEventClassWindow, kEventWindowBoundsChanging},
+     {kEventClassWindow, kEventWindowBoundsChanged},
      {kEventClassWindow, kEventWindowShown},
      {kEventClassWindow, kEventWindowHidden},
      {kEventClassWindow, kEventWindowExpanded},
@@ -10469,12 +10540,14 @@
 		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)
-		    x_real_positions (f, &f->left_pos, &f->top_pos);
+		    mac_handle_origin_change (f);
 		}
+#endif
 		break;
 
 	      case inGoAway:
@@ -10573,7 +10646,7 @@
 		  else
 		    {
 		      /* Generate SELECT_WINDOW_EVENTs when needed.  */
-		      if (mouse_autoselect_window)
+		      if (!NILP (Vmouse_autoselect_window))
 			{
 			  Lisp_Object window;
 
--- a/src/msdos.c	Wed Sep 06 07:30:39 2006 +0000
+++ b/src/msdos.c	Thu Sep 14 09:24:00 2006 +0000
@@ -3381,7 +3381,7 @@
 	    }
 
 	  /* Generate SELECT_WINDOW_EVENTs when needed.  */
-	  if (mouse_autoselect_window)
+	  if (!NILP (Vmouse_autoselect_window))
 	    {
 	      mouse_window = window_from_coordinates (SELECTED_FRAME(),
 						      mouse_last_x,
--- a/src/print.c	Wed Sep 06 07:30:39 2006 +0000
+++ b/src/print.c	Thu Sep 14 09:24:00 2006 +0000
@@ -365,7 +365,10 @@
    print_buffer.  PRINTCHARFUN t means output to the echo area or to
    stdout if non-interactive.  If neither nil nor t, call Lisp
    function PRINTCHARFUN for each character printed.  MULTIBYTE
-   non-zero means PTR contains multibyte characters.  */
+   non-zero means PTR contains multibyte characters.
+
+   In the case where PRINTCHARFUN is nil, it is safe for PTR to point
+   to data in a Lisp string.  Otherwise that is not safe.  */
 
 static void
 strout (ptr, size, size_byte, printcharfun, multibyte)
@@ -414,7 +417,7 @@
       if (size == size_byte)
 	{
 	  for (i = 0; i < size; ++i)
-	    insert_char ((unsigned char )*ptr++);
+	    insert_char ((unsigned char) *ptr++);
 	}
       else
 	{
@@ -502,10 +505,29 @@
       else
 	chars = SBYTES (string);
 
-      /* strout is safe for output to a frame (echo area) or to print_buffer.  */
-      strout (SDATA (string),
-	      chars, SBYTES (string),
-	      printcharfun, STRING_MULTIBYTE (string));
+      if (EQ (printcharfun, Qt))
+	{
+	  /* Output to echo area.  */
+	  int nbytes = SBYTES (string);
+	  char *buffer;
+
+	  /* Copy the string contents so that relocation of STRING by
+	     GC does not cause trouble.  */
+	  USE_SAFE_ALLOCA;
+
+	  SAFE_ALLOCA (buffer, char *, nbytes);
+	  bcopy (SDATA (string), buffer, nbytes);
+
+	  strout (buffer, chars, SBYTES (string),
+		  printcharfun, STRING_MULTIBYTE (string));
+
+	  SAFE_FREE ();
+	}
+      else
+	/* No need to copy, since output to print_buffer can't GC.  */
+	strout (SDATA (string),
+		chars, SBYTES (string),
+		printcharfun, STRING_MULTIBYTE (string));
     }
   else
     {
--- a/src/process.c	Wed Sep 06 07:30:39 2006 +0000
+++ b/src/process.c	Thu Sep 14 09:24:00 2006 +0000
@@ -318,6 +318,12 @@
 #define POLL_FOR_INPUT
 #endif
 
+static Lisp_Object get_process ();
+static void exec_sentinel ();
+
+extern EMACS_TIME timer_check ();
+extern int timers_run;
+
 /* Mask of bits indicating the descriptors that we wait for input on.  */
 
 static SELECT_TYPE input_wait_mask;
@@ -386,15 +392,13 @@
 #define DATAGRAM_CONN_P(proc)	(0)
 #endif
 
-static Lisp_Object get_process ();
-static void exec_sentinel ();
-
-extern EMACS_TIME timer_check ();
-extern int timers_run;
-
 /* Maximum number of bytes to send to a pty without an eof.  */
 static int pty_max_bytes;
 
+/* Nonzero means don't run process sentinels.  This is used
+   when exiting.  */
+int inhibit_sentinels;
+
 #ifdef HAVE_PTYS
 #ifdef HAVE_PTY_H
 #include <pty.h>
@@ -6547,6 +6551,9 @@
   int outer_running_asynch_code = running_asynch_code;
   int waiting = waiting_for_user_input_p;
 
+  if (inhibit_sentinels)
+    return;
+
   /* No need to gcpro these, because all we do with them later
      is test them for EQness, and none of them should be a string.  */
   odeactivate = Vdeactivate_mark;
@@ -6876,6 +6883,8 @@
 {
   register int i;
 
+  inhibit_sentinels = 0;
+
 #ifdef SIGCHLD
 #ifndef CANNOT_DUMP
   if (! noninteractive || initialized)
--- a/src/process.h	Wed Sep 06 07:30:39 2006 +0000
+++ b/src/process.h	Thu Sep 14 09:24:00 2006 +0000
@@ -161,5 +161,9 @@
 #define NULL_DEVICE "/dev/null"
 #endif
 
+/* Nonzero means don't run process sentinels.  This is used
+   when exiting.  */
+extern int inhibit_sentinels;
+
 /* arch-tag: dffedfc4-d7bc-4b58-a26f-c16155449c72
    (do not change this comment) */
--- a/src/search.c	Wed Sep 06 07:30:39 2006 +0000
+++ b/src/search.c	Thu Sep 14 09:24:00 2006 +0000
@@ -134,6 +134,9 @@
   cp->buf.multibyte = STRING_MULTIBYTE (pattern);
   cp->buf.target_multibyte = multibyte;
   cp->whitespace_regexp = Vsearch_spaces_regexp;
+  /* Doing BLOCK_INPUT here has the effect that
+     the debugger won't run if an error occurs.
+     Why is BLOCK_INPUT needed here?  */
   BLOCK_INPUT;
   old = re_set_syntax (RE_SYNTAX_EMACS
 		       | (posix ? 0 : RE_NO_POSIX_BACKTRACKING));
@@ -250,6 +253,10 @@
   if (running_asynch_code)
     save_search_regs ();
 
+  /* This is so set_image_of_range_1 in regex.c can find the EQV table.  */
+  XCHAR_TABLE (current_buffer->case_canon_table)->extras[2]
+    = current_buffer->case_eqv_table;
+
   CHECK_STRING (string);
   bufp = compile_pattern (string, &search_regs,
 			  (!NILP (current_buffer->case_fold_search)
@@ -357,6 +364,10 @@
       pos_byte = string_char_to_byte (string, pos);
     }
 
+  /* This is so set_image_of_range_1 in regex.c can find the EQV table.  */
+  XCHAR_TABLE (current_buffer->case_canon_table)->extras[2]
+    = current_buffer->case_eqv_table;
+
   bufp = compile_pattern (regexp, &search_regs,
 			  (!NILP (current_buffer->case_fold_search)
 			   ? current_buffer->case_canon_table : Qnil),
@@ -896,6 +907,10 @@
 	lim_byte = CHAR_TO_BYTE (lim);
     }
 
+  /* This is so set_image_of_range_1 in regex.c can find the EQV table.  */
+  XCHAR_TABLE (current_buffer->case_canon_table)->extras[2]
+    = current_buffer->case_eqv_table;
+
   np = search_buffer (string, PT, PT_BYTE, lim, lim_byte, n, RE,
 		      (!NILP (current_buffer->case_fold_search)
 		       ? current_buffer->case_canon_table
--- a/src/textprop.c	Wed Sep 06 07:30:39 2006 +0000
+++ b/src/textprop.c	Thu Sep 14 09:24:00 2006 +0000
@@ -1001,17 +1001,16 @@
 	 && (NILP (limit) || next->position < XFASTINT (limit)))
     next = next_interval (next);
 
-  if (NULL_INTERVAL_P (next))
+  if (NULL_INTERVAL_P (next)
+      || (next->position
+	  >= (INTEGERP (limit)
+	      ? XFASTINT (limit)
+	      : (STRINGP (object)
+		 ? SCHARS (object)
+		 : BUF_ZV (XBUFFER (object))))))
     return limit;
-  if (NILP (limit))
-    XSETFASTINT (limit, (STRINGP (object)
-			 ? SCHARS (object)
-			 : BUF_ZV (XBUFFER (object))));
-  if (!(next->position < XFASTINT (limit)))
-    return limit;
-
-  XSETFASTINT (position, next->position);
-  return position;
+  else
+    return make_number (next->position);
 }
 
 /* Return 1 if there's a change in some property between BEG and END.  */
@@ -1083,16 +1082,16 @@
 	 && (NILP (limit) || next->position < XFASTINT (limit)))
     next = next_interval (next);
 
-  if (NULL_INTERVAL_P (next))
+  if (NULL_INTERVAL_P (next)
+      || (next->position
+	  >= (INTEGERP (limit)
+	      ? XFASTINT (limit)
+	      : (STRINGP (object)
+		 ? SCHARS (object)
+		 : BUF_ZV (XBUFFER (object))))))
     return limit;
-  if (NILP (limit))
-    XSETFASTINT (limit, (STRINGP (object)
-			 ? SCHARS (object)
-			 : BUF_ZV (XBUFFER (object))));
-  if (!(next->position < XFASTINT (limit)))
-    return limit;
-
-  return make_number (next->position);
+  else
+    return make_number (next->position);
 }
 
 DEFUN ("previous-property-change", Fprevious_property_change,
@@ -1132,14 +1131,15 @@
 	 && (NILP (limit)
 	     || (previous->position + LENGTH (previous) > XFASTINT (limit))))
     previous = previous_interval (previous);
-  if (NULL_INTERVAL_P (previous))
+
+  if (NULL_INTERVAL_P (previous)
+      || (previous->position + LENGTH (previous)
+	  <= (INTEGERP (limit)
+	      ? XFASTINT (limit)
+	      : (STRINGP (object) ? 0 : BUF_BEGV (XBUFFER (object))))))
     return limit;
-  if (NILP (limit))
-    XSETFASTINT (limit, (STRINGP (object) ? 0 : BUF_BEGV (XBUFFER (object))));
-  if (!(previous->position + LENGTH (previous) > XFASTINT (limit)))
-    return limit;
-
-  return make_number (previous->position + LENGTH (previous));
+  else
+    return make_number (previous->position + LENGTH (previous));
 }
 
 DEFUN ("previous-single-property-change", Fprevious_single_property_change,
@@ -1184,14 +1184,15 @@
 	 && (NILP (limit)
 	     || (previous->position + LENGTH (previous) > XFASTINT (limit))))
     previous = previous_interval (previous);
-  if (NULL_INTERVAL_P (previous))
+
+  if (NULL_INTERVAL_P (previous)
+      || (previous->position + LENGTH (previous)
+	  <= (INTEGERP (limit)
+	      ? XFASTINT (limit)
+	      : (STRINGP (object) ? 0 : BUF_BEGV (XBUFFER (object))))))
     return limit;
-  if (NILP (limit))
-    XSETFASTINT (limit, (STRINGP (object) ? 0 : BUF_BEGV (XBUFFER (object))));
-  if (!(previous->position + LENGTH (previous) > XFASTINT (limit)))
-    return limit;
-
-  return make_number (previous->position + LENGTH (previous));
+  else
+    return make_number (previous->position + LENGTH (previous));
 }
 
 /* Callers note, this can GC when OBJECT is a buffer (or nil).  */
--- a/src/w32menu.c	Wed Sep 06 07:30:39 2006 +0000
+++ b/src/w32menu.c	Thu Sep 14 09:24:00 2006 +0000
@@ -149,9 +149,9 @@
 SetMenuItemInfoA_Proc set_menu_item_info = NULL;
 AppendMenuW_Proc unicode_append_menu = NULL;
 
-Lisp_Object Vmenu_updating_frame;
+Lisp_Object Qdebug_on_next_call;
 
-Lisp_Object Qdebug_on_next_call;
+extern Lisp_Object Vmenu_updating_frame;
 
 extern Lisp_Object Qmenu_bar;
 
@@ -2548,11 +2548,6 @@
   Qdebug_on_next_call = intern ("debug-on-next-call");
   staticpro (&Qdebug_on_next_call);
 
-  DEFVAR_LISP ("menu-updating-frame", &Vmenu_updating_frame,
-	       doc: /* Frame for which we are updating a menu.
-The enable predicate for a menu command should check this variable.  */);
-  Vmenu_updating_frame = Qnil;
-
   defsubr (&Sx_popup_menu);
 #ifdef HAVE_MENUS
   defsubr (&Sx_popup_dialog);
--- a/src/w32term.c	Wed Sep 06 07:30:39 2006 +0000
+++ b/src/w32term.c	Thu Sep 14 09:24:00 2006 +0000
@@ -4449,7 +4449,7 @@
 	  if (f)
 	    {
 	      /* Generate SELECT_WINDOW_EVENTs when needed.  */
-	      if (mouse_autoselect_window)
+	      if (!NILP (Vmouse_autoselect_window))
 		{
 		  Lisp_Object window;
 		  int x = LOWORD (msg.msg.lParam);
--- a/src/xdisp.c	Wed Sep 06 07:30:39 2006 +0000
+++ b/src/xdisp.c	Thu Sep 14 09:24:00 2006 +0000
@@ -263,9 +263,9 @@
 Lisp_Object Vfontification_functions;
 Lisp_Object Qfontification_functions;
 
-/* Non-zero means automatically select any window when the mouse
+/* Non-nil means automatically select any window when the mouse
    cursor moves into it.  */
-int mouse_autoselect_window;
+Lisp_Object Vmouse_autoselect_window;
 
 /* Non-zero means draw tool bar buttons raised when the mouse moves
    over them.  */
@@ -622,6 +622,11 @@
 Lisp_Object Qinhibit_menubar_update;
 int inhibit_menubar_update;
 
+/* When evaluating expressions from menu bar items (enable conditions,
+   for instance), this is the frame they are being processed for.  */
+
+Lisp_Object Vmenu_updating_frame;
+
 /* Maximum height for resizing mini-windows.  Either a float
    specifying a fraction of the available height, or an integer
    specifying a number of lines.  */
@@ -9297,7 +9302,7 @@
      happen when, for instance, an activate-menubar-hook causes a
      redisplay.  */
   if (inhibit_menubar_update)
-    return;
+    return hooks_run;
 
   window = FRAME_SELECTED_WINDOW (f);
   w = XWINDOW (window);
@@ -9368,6 +9373,7 @@
 	      hooks_run = 1;
 	    }
 
+	  XSETFRAME (Vmenu_updating_frame, f);
 	  FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f));
 
 	  /* Redisplay the menu bar in case we changed it.  */
@@ -10949,13 +10955,13 @@
      int preserve_echo_area;
 {
   struct window *w = XWINDOW (selected_window);
-  struct frame *f = XFRAME (w->frame);
+  struct frame *f;
   int pause;
   int must_finish = 0;
   struct text_pos tlbufpos, tlendpos;
   int number_of_visible_frames;
   int count;
-  struct frame *sf = SELECTED_FRAME ();
+  struct frame *sf;
   int polling_stopped_here = 0;
 
   /* Non-zero means redisplay has to consider all windows on all
@@ -10968,8 +10974,16 @@
      initialized, or redisplay is explicitly turned off by setting
      Vinhibit_redisplay.  */
   if (noninteractive
-      || !NILP (Vinhibit_redisplay)
-      || !f->glyphs_initialized_p)
+      || !NILP (Vinhibit_redisplay))
+    return;
+
+  /* Don't examine these until after testing Vinhibit_redisplay.
+     When Emacs is shutting down, perhaps because its connection to
+     X has dropped, we should not look at them at all.  */
+  f = XFRAME (w->frame);
+  sf = SELECTED_FRAME ();
+
+  if (!f->glyphs_initialized_p)
     return;
 
   /* The flag redisplay_performed_directly_p is set by
@@ -21568,14 +21582,16 @@
 	  if (cursor_type == FILLED_BOX_CURSOR)
 	    {
 	      /* Using a block cursor on large images can be very annoying.
-		 So use a hollow cursor for "large" images.  */
+		 So use a hollow cursor for "large" images.
+		 If image is not transparent (no mask), also use hollow cursor.  */
 	      struct image *img = IMAGE_FROM_ID (f, glyph->u.img_id);
 	      if (img != NULL && IMAGEP (img->spec))
 		{
 		  /* Arbitrarily, interpret "Large" as >32x32 and >NxN
 		     where N = size of default frame font size.
 		     This should cover most of the "tiny" icons people may use.  */
-		  if (img->width > max (32, WINDOW_FRAME_COLUMN_WIDTH (w))
+		  if (!img->mask
+		      || img->width > max (32, WINDOW_FRAME_COLUMN_WIDTH (w))
 		      || img->height > max (32, WINDOW_FRAME_LINE_HEIGHT (w)))
 		    cursor_type = HOLLOW_BOX_CURSOR;
 		}
@@ -24339,9 +24355,22 @@
 See `set-window-redisplay-end-trigger'.  */);
   Vredisplay_end_trigger_functions = Qnil;
 
-  DEFVAR_BOOL ("mouse-autoselect-window", &mouse_autoselect_window,
-    doc: /* *Non-nil means autoselect window with mouse pointer.  */);
-  mouse_autoselect_window = 0;
+  DEFVAR_LISP ("mouse-autoselect-window", &Vmouse_autoselect_window,
+     doc: /* *Non-nil means autoselect window with mouse pointer.
+If nil, do not autoselect windows.
+A positive number means delay autoselection by that many seconds: a
+window is autoselected only after the mouse has remained in that
+window for the duration of the delay.
+A negative number has a similar effect, but causes windows to be
+autoselected only after the mouse has stopped moving.  \(Because of
+the way Emacs compares mouse events, you will occasionally wait twice
+that time before the window gets selected.\)
+Any other value means to autoselect window instantaneously when the
+mouse pointer enters it.
+
+Autoselection selects the minibuffer only if it is active, and never
+unselects the minibuffer if it is active.  */);
+  Vmouse_autoselect_window = Qnil;
 
   DEFVAR_BOOL ("auto-resize-tool-bars", &auto_resize_tool_bars_p,
     doc: /* *Non-nil means automatically resize tool-bars.
@@ -24461,6 +24490,11 @@
 whose contents depend on various data.  */);
   Vmenu_bar_update_hook = Qnil;
 
+  DEFVAR_LISP ("menu-updating-frame", &Vmenu_updating_frame,
+	       doc: /* Frame for which we are updating a menu.
+The enable predicate for a menu binding should check this variable.  */);
+  Vmenu_updating_frame = Qnil;
+
   DEFVAR_BOOL ("inhibit-menubar-update", &inhibit_menubar_update,
     doc: /* Non-nil means don't update menu bars.  Internal use only.  */);
   inhibit_menubar_update = 0;
--- a/src/xfns.c	Wed Sep 06 07:30:39 2006 +0000
+++ b/src/xfns.c	Thu Sep 14 09:24:00 2006 +0000
@@ -4123,11 +4123,15 @@
   x_destroy_all_bitmaps (dpyinfo);
   XSetCloseDownMode (dpyinfo->display, DestroyAll);
 
+#ifdef USE_GTK
+  xg_display_close (dpyinfo->display);
+#else
 #ifdef USE_X_TOOLKIT
   XtCloseDisplay (dpyinfo->display);
 #else
   XCloseDisplay (dpyinfo->display);
 #endif
+#endif /* ! USE_GTK */
 
   x_delete_display (dpyinfo);
   UNBLOCK_INPUT;
@@ -5410,6 +5414,8 @@
   int count = SPECPDL_INDEX ();
   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6;
 
+  check_x ();
+
   GCPRO6 (prompt, dir, default_filename, mustmatch, only_dir_p, file);
 
   if (popup_activated ())
@@ -5577,6 +5583,8 @@
   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6;
   char *cdef_file;
 
+  check_x ();
+
   GCPRO6 (prompt, dir, default_filename, mustmatch, only_dir_p, file);
 
   if (popup_activated ())
--- a/src/xmenu.c	Wed Sep 06 07:30:39 2006 +0000
+++ b/src/xmenu.c	Thu Sep 14 09:24:00 2006 +0000
@@ -97,10 +97,10 @@
 #define FALSE 0
 #endif /* no TRUE */
 
-Lisp_Object Vmenu_updating_frame;
-
 Lisp_Object Qdebug_on_next_call;
 
+extern Lisp_Object Vmenu_updating_frame;
+
 extern Lisp_Object Qmenu_bar;
 
 extern Lisp_Object QCtoggle, QCradio;
@@ -1182,6 +1182,10 @@
 {
   menu_items_inuse = in_use ? Qt : Qnil;
   popup_activated_flag = in_use;
+#ifdef USE_X_TOOLKIT
+  if (popup_activated_flag)
+    x_activate_timeout_atimer ();
+#endif
 }
 
 /* Wait for an X event to arrive or for a timer to expire.  */
@@ -1498,6 +1502,9 @@
      XtPointer client_data;
 {
   popup_activated_flag = 1;
+#ifdef USE_X_TOOLKIT
+  x_activate_timeout_atimer ();
+#endif
 }
 #endif
 
@@ -2798,6 +2805,7 @@
   /* Display the menu.  */
   lw_popup_menu (menu, (XEvent *) &dummy);
   popup_activated_flag = 1;
+  x_activate_timeout_atimer ();
 
   {
     int fact = 4 * sizeof (LWLIB_ID);
@@ -3175,6 +3183,7 @@
   /* Display the dialog box.  */
   lw_pop_up_all_widgets (dialog_id);
   popup_activated_flag = 1;
+  x_activate_timeout_atimer ();
 
   /* Process events that apply to the dialog box.
      Also handle timers.  */
@@ -3758,11 +3767,6 @@
   Qdebug_on_next_call = intern ("debug-on-next-call");
   staticpro (&Qdebug_on_next_call);
 
-  DEFVAR_LISP ("menu-updating-frame", &Vmenu_updating_frame,
-	       doc: /* Frame for which we are updating a menu.
-The enable predicate for a menu command should check this variable.  */);
-  Vmenu_updating_frame = Qnil;
-
 #ifdef USE_X_TOOLKIT
   widget_id_tick = (1<<16);
   next_menubar_widget_id = 1;
--- a/src/xterm.c	Wed Sep 06 07:30:39 2006 +0000
+++ b/src/xterm.c	Thu Sep 14 09:24:00 2006 +0000
@@ -2875,24 +2875,25 @@
 	    }
 	  else
 #endif
-          if (x_underline_at_descent_line)
-	    y = s->y + s->height - h;
-          else
-            {
-	      /* Get the underline position.  This is the recommended
-                 vertical offset in pixels from the baseline to the top of
-                 the underline.  This is a signed value according to the
-                 specs, and its default is
-
-	         ROUND ((maximum descent) / 2), with
-	         ROUND(x) = floor (x + 0.5)  */
-
-              if (x_use_underline_position_properties
-                  && XGetFontProperty (s->font, XA_UNDERLINE_POSITION, &tem))
-                y = s->ybase + (long) tem;
-              else if (s->face->font)
-                y = s->ybase + (s->face->font->max_bounds.descent + 1) / 2;
-            }
+	    {
+	      y = s->y + s->height - h;
+	      if (!x_underline_at_descent_line)
+		{
+		  /* Get the underline position.  This is the recommended
+		     vertical offset in pixels from the baseline to the top of
+		     the underline.  This is a signed value according to the
+		     specs, and its default is
+
+		     ROUND ((maximum descent) / 2), with
+		     ROUND(x) = floor (x + 0.5)  */
+
+		  if (x_use_underline_position_properties
+		      && XGetFontProperty (s->font, XA_UNDERLINE_POSITION, &tem))
+		    y = s->ybase + (long) tem;
+		  else if (s->face->font)
+		    y = s->ybase + (s->face->font->max_bounds.descent + 1) / 2;
+		}
+	    }
 
 	  if (s->face->underline_defaulted_p)
 	    XFillRectangle (s->display, s->window, s->gc,
@@ -4335,6 +4336,9 @@
 
   /* Make Xt timeouts work while the scroll bar is active.  */
   toolkit_scroll_bar_interaction = 1;
+#ifdef USE_X_TOOLKIT
+  x_activate_timeout_atimer ();
+#endif
 
   /* Setting the event mask to zero means that the message will
      be sent to the client that created the window, and if that
@@ -6801,7 +6805,7 @@
           {
 
             /* Generate SELECT_WINDOW_EVENTs when needed.  */
-            if (mouse_autoselect_window)
+            if (!NILP (Vmouse_autoselect_window))
               {
                 Lisp_Object window;
 
@@ -7718,7 +7722,7 @@
 static struct x_error_message_stack *x_error_message;
 
 /* An X error handler which stores the error message in
-   x_error_message_string.  This is called from x_error_handler if
+   *x_error_message.  This is called from x_error_handler if
    x_catch_errors is in effect.  */
 
 static void
@@ -7737,7 +7741,7 @@
 
    After calling this function, X protocol errors no longer cause
    Emacs to exit; instead, they are recorded in the string
-   stored in x_error_message_string.
+   stored in *x_error_message.
 
    Calling x_check_errors signals an Emacs error if an X error has
    occurred since the last call to x_catch_errors or x_check_errors.
@@ -7997,7 +8001,7 @@
 
 /* We specifically use it before defining it, so that gcc doesn't inline it,
    otherwise gdb doesn't know how to properly put a breakpoint on it.  */
-static void x_error_quitter P_ ((Display *, XErrorEvent *)) NO_RETURN;
+static void x_error_quitter P_ ((Display *, XErrorEvent *));
 
 /* This is the first-level handler for X protocol errors.
    It calls x_error_quitter or x_error_catcher.  */
@@ -8042,6 +8046,12 @@
 {
   char buf[256], buf1[356];
 
+  /* Ignore BadName errors.  They can happen because of fonts
+     or colors that are not defined.  */
+
+  if (error->error_code == BadName)
+    return;
+
   /* Note that there is no real way portable across R3/R4 to get the
      original error handler.  */
 
@@ -10589,6 +10599,11 @@
   {"-mc",	"*pointerColor", XrmoptionSepArg, (XtPointer) NULL},
   {"-cr",	"*cursorColor", XrmoptionSepArg, (XtPointer) NULL}
 };
+
+/* Whether atimer for Xt timeouts is activated or not.  */
+
+static int x_timeout_atimer_activated_flag;
+
 #endif /* USE_X_TOOLKIT */
 
 static int x_initialized;
@@ -11270,13 +11285,39 @@
 x_process_timeouts (timer)
      struct atimer *timer;
 {
+  BLOCK_INPUT;
+  x_timeout_atimer_activated_flag = 0;
   if (toolkit_scroll_bar_interaction || popup_activated ())
     {
-      BLOCK_INPUT;
       while (XtAppPending (Xt_app_con) & XtIMTimer)
 	XtAppProcessEvent (Xt_app_con, XtIMTimer);
-      UNBLOCK_INPUT;
-    }
+      /* Reactivate the atimer for next time.  */
+      x_activate_timeout_atimer ();
+    }
+  UNBLOCK_INPUT;
+}
+
+/* Install an asynchronous timer that processes Xt timeout events
+   every 0.1s as long as either `toolkit_scroll_bar_interaction' or
+   `popup_activated_flag' (in xmenu.c) is set.  Make sure to call this
+   function whenever these variables are set.  This is necessary
+   because some widget sets use timeouts internally, for example the
+   LessTif menu bar, or the Xaw3d scroll bar.  When Xt timeouts aren't
+   processed, these widgets don't behave normally.  */
+
+void
+x_activate_timeout_atimer ()
+{
+  BLOCK_INPUT;
+  if (!x_timeout_atimer_activated_flag)
+    {
+      EMACS_TIME interval;
+
+      EMACS_SET_SECS_USECS (interval, 0, 100000);
+      start_atimer (ATIMER_RELATIVE, interval, x_process_timeouts, 0);
+      x_timeout_atimer_activated_flag = 1;
+    }
+  UNBLOCK_INPUT;
 }
 
 #endif /* USE_X_TOOLKIT */
@@ -11382,17 +11423,6 @@
 			 XtCacheByDisplay, cvt_pixel_dtor);
 
   XtAppSetFallbackResources (Xt_app_con, Xt_default_resources);
-
-  /* Install an asynchronous timer that processes Xt timeout events
-     every 0.1s.  This is necessary because some widget sets use
-     timeouts internally, for example the LessTif menu bar, or the
-     Xaw3d scroll bar.  When Xt timouts aren't processed, these
-     widgets don't behave normally.  */
-  {
-    EMACS_TIME interval;
-    EMACS_SET_SECS_USECS (interval, 0, 100000);
-    start_atimer (ATIMER_CONTINUOUS, interval, x_process_timeouts, 0);
-  }
 #endif
 
 #ifdef USE_TOOLKIT_SCROLL_BARS
--- a/src/xterm.h	Wed Sep 06 07:30:39 2006 +0000
+++ b/src/xterm.h	Thu Sep 14 09:24:00 2006 +0000
@@ -1012,6 +1012,7 @@
 extern int x_alloc_lighter_color_for_widget __P ((Widget, Display*, Colormap,
 						  unsigned long *,
 						  double, int));
+extern void x_activate_timeout_atimer P_ ((void));
 #endif
 extern void x_query_colors P_ ((struct frame *f, XColor *, int));
 extern void x_query_color P_ ((struct frame *f, XColor *));