Merged from emacs@sv.gnu.org. Last-minute emacsclient rewrites be damned!
authorKaroly Lorentey <lorentey@elte.hu>
Sun, 3 Dec 2006 15:03:30 +0000 (15:03 +0000)
committerKaroly Lorentey <lorentey@elte.hu>
Sun, 3 Dec 2006 15:03:30 +0000 (15:03 +0000)
Patches applied:

 * emacs@sv.gnu.org/emacs--devo--0--patch-490
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-491
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-492
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-493
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-494
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-495
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-496
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-497
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-498
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-499
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-500
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-501
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-502
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-503
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-504
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-505
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-506
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-507
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-508
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-509
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-510
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-511
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-512
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-513
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-514
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-515
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-516
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-517
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-518
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-519
   Update from CVS: etc/TUTORIAL.cn: Updated.

 * emacs@sv.gnu.org/emacs--devo--0--patch-520
   Merge from erc--emacs--22

 * emacs@sv.gnu.org/emacs--devo--0--patch-521
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-522
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-523
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-524
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-525
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-526
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-527
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-528
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-529
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-530
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-531
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-532
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-533
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-534
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-535
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-161
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-162
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-163
   Merge from emacs--devo--0

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-164
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-165
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-166
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-167
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-168
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-169
   Merge from emacs--devo--0

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-170
   Update from CVS

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-588

356 files changed:
AUTHORS
ChangeLog
Makefile.in
README
admin/ChangeLog
admin/FOR-RELEASE
admin/admin.el
admin/make-tarball.txt
configure
configure.in
etc/ChangeLog
etc/DEVEL.HUMOR
etc/ERC-NEWS
etc/MH-E-NEWS
etc/NEWS
etc/PROBLEMS
etc/TODO
etc/TUTORIAL.cn
etc/emacs.py
etc/emacsclient.1
etc/etags.1
etc/orgcard.tex
leim/ChangeLog
leim/Makefile.in
leim/quail/greek.el
lib-src/ChangeLog
lib-src/Makefile.in
lib-src/emacsclient.c
lib-src/etags.c
lib-src/grep-changelog
lib-src/makefile.w32-in
lisp/ChangeLog
lisp/ChangeLog.3
lisp/Makefile.in
lisp/add-log.el
lisp/allout.el
lisp/apropos.el
lisp/autoarg.el
lisp/battery.el
lisp/bindings.el
lisp/bs.el
lisp/calendar/cal-dst.el
lisp/comint.el
lisp/cus-edit.el
lisp/descr-text.el
lisp/diff-mode.el
lisp/dired-aux.el
lisp/dired.el
lisp/disp-table.el
lisp/ebuff-menu.el
lisp/ediff-diff.el
lisp/ediff.el
lisp/ehelp.el
lisp/emacs-lisp/authors.el
lisp/emacs-lisp/bytecomp.el
lisp/emacs-lisp/checkdoc.el
lisp/emacs-lisp/cust-print.el
lisp/emacs-lisp/easy-mmode.el
lisp/emacs-lisp/find-func.el
lisp/emacs-lisp/lisp.el
lisp/emacs-lisp/lselect.el
lisp/emacs-lisp/pp.el
lisp/emacs-lisp/re-builder.el
lisp/emacs-lisp/regexp-opt.el
lisp/emacs-lisp/shadow.el
lisp/emacs-lock.el
lisp/emulation/edt-mapper.el
lisp/emulation/tpu-edt.el
lisp/emulation/vip.el
lisp/emulation/viper-init.el
lisp/emulation/viper-keym.el
lisp/emulation/viper.el
lisp/erc/ChangeLog
lisp/erc/erc-autoaway.el
lisp/erc/erc-backend.el
lisp/erc/erc-compat.el
lisp/erc/erc-dcc.el
lisp/erc/erc-fill.el
lisp/erc/erc-ibuffer.el
lisp/erc/erc-log.el
lisp/erc/erc-menu.el
lisp/erc/erc-networks.el
lisp/erc/erc-nicklist.el
lisp/erc/erc-replace.el
lisp/erc/erc-sound.el
lisp/erc/erc-track.el
lisp/erc/erc-truncate.el
lisp/erc/erc.el
lisp/expand.el
lisp/facemenu.el
lisp/faces.el
lisp/ffap.el
lisp/files.el
lisp/follow.el
lisp/font-core.el
lisp/gnus/ChangeLog
lisp/gnus/gnus-agent.el
lisp/gnus/gnus-art.el
lisp/gnus/gnus-diary.el
lisp/gnus/gnus-group.el
lisp/gnus/gnus-start.el
lisp/gnus/gnus-sum.el
lisp/gnus/gnus-util.el
lisp/gnus/gnus.el
lisp/gnus/html2text.el
lisp/gnus/message.el
lisp/gnus/mm-decode.el
lisp/gnus/mm-util.el
lisp/gnus/mm-uu.el
lisp/gnus/mml.el
lisp/gnus/mml2015.el
lisp/gnus/nndiary.el
lisp/gnus/nneething.el
lisp/gnus/nnslashdot.el
lisp/gnus/nnsoup.el
lisp/help-fns.el
lisp/help-macro.el
lisp/help.el
lisp/hexl.el
lisp/icomplete.el
lisp/ido.el
lisp/iimage.el
lisp/indent.el
lisp/info-look.el
lisp/international/characters.el
lisp/international/fontset.el
lisp/international/ja-dic-cnv.el
lisp/international/mule-cmds.el
lisp/international/mule.el
lisp/kmacro.el
lisp/language/european.el
lisp/language/thai-word.el
lisp/ldefs-boot.el
lisp/ledit.el
lisp/loadhist.el
lisp/locate.el
lisp/longlines.el
lisp/macros.el
lisp/mail/emacsbug.el
lisp/mail/feedmail.el
lisp/mail/rmail-spam-filter.el
lisp/mail/rmail.el
lisp/mail/rmailout.el
lisp/mail/smtpmail.el
lisp/mail/vms-pmail.el
lisp/makefile.w32-in
lisp/menu-bar.el
lisp/mh-e/ChangeLog
lisp/mh-e/mh-e.el
lisp/mh-e/mh-junk.el
lisp/mh-e/mh-xface.el
lisp/misc.el
lisp/mouse-copy.el
lisp/mouse.el
lisp/net/eudc-vars.el
lisp/net/rcirc.el
lisp/net/tramp.el
lisp/newcomment.el
lisp/novice.el
lisp/paren.el
lisp/pcvs.el
lisp/pgg-pgp.el
lisp/play/dunnet.el
lisp/play/gomoku.el
lisp/play/handwrite.el
lisp/play/hanoi.el
lisp/play/landmark.el
lisp/printing.el
lisp/progmodes/ada-mode.el
lisp/progmodes/ada-prj.el
lisp/progmodes/ada-stmt.el
lisp/progmodes/ada-xref.el
lisp/progmodes/cc-align.el
lisp/progmodes/cc-cmds.el
lisp/progmodes/cc-fonts.el
lisp/progmodes/cc-vars.el
lisp/progmodes/compile.el
lisp/progmodes/cperl-mode.el
lisp/progmodes/ebnf2ps.el
lisp/progmodes/f90.el
lisp/progmodes/flymake.el
lisp/progmodes/fortran.el
lisp/progmodes/gdb-ui.el
lisp/progmodes/glasses.el
lisp/progmodes/gud.el
lisp/progmodes/hideshow.el
lisp/progmodes/idlw-help.el
lisp/progmodes/idlw-shell.el
lisp/progmodes/idlw-toolbar.el
lisp/progmodes/idlwave.el
lisp/progmodes/python.el
lisp/progmodes/vhdl-mode.el
lisp/ps-bdf.el
lisp/ps-mule.el
lisp/ps-print.el
lisp/resume.el
lisp/rfn-eshadow.el
lisp/rot13.el
lisp/ruler-mode.el
lisp/scroll-all.el
lisp/server.el
lisp/ses.el
lisp/shadowfile.el
lisp/simple.el
lisp/sort.el
lisp/speedbar.el
lisp/startup.el
lisp/subr.el
lisp/t-mouse.el
lisp/tabify.el
lisp/tar-mode.el
lisp/term.el
lisp/term/x-win.el
lisp/term/xterm.el
lisp/terminal.el
lisp/textmodes/bibtex.el
lisp/textmodes/enriched.el
lisp/textmodes/fill.el
lisp/textmodes/flyspell.el
lisp/textmodes/ispell.el
lisp/textmodes/org.el
lisp/textmodes/reftex-cite.el
lisp/textmodes/table.el
lisp/textmodes/texinfmt.el
lisp/thingatpt.el
lisp/time-stamp.el
lisp/tmm.el
lisp/tutorial.el [new file with mode: 0644]
lisp/url/ChangeLog
lisp/url/url-http.el
lisp/url/url-parse.el
lisp/url/url-util.el
lisp/url/url.el
lisp/userlock.el
lisp/vc-svn.el
lisp/version.el
lisp/vmsproc.el
lisp/vt100-led.el
lisp/whitespace.el
lisp/wid-edit.el
lisp/window.el
lispintro/ChangeLog
lispintro/INSTALL [deleted file]
lispintro/MANIFEST [deleted file]
lispintro/Makefile.in
lispintro/README
lispintro/emacs-lisp-intro.texi
lispintro/makefile.w32-in
lispref/ChangeLog
lispref/customize.texi
lispref/display.texi
lispref/elisp.texi
lispref/frames.texi
lispref/keymaps.texi
lispref/lists.texi
lispref/makefile.w32-in
lispref/modes.texi
lispref/searching.texi
lwlib/ChangeLog
lwlib/Makefile.in
mac/ChangeLog
mac/Emacs.app/Contents/Resources/English.lproj/InfoPlist.strings
mac/INSTALL
mac/inc/config.h
mac/src/Emacs.r
make-dist
man/ChangeLog
man/Makefile.in
man/ack.texi
man/ada-mode.texi
man/anti.texi
man/building.texi
man/emacs.texi
man/erc.texi
man/glossary.texi
man/kmacro.texi
man/makefile.w32-in
man/mh-e.texi
man/misc.texi
man/msdog.texi
man/mule.texi
man/org.texi
man/search.texi
man/texinfo.tex
man/tramp.texi
man/url.texi
man/woman.texi
man/xresmini.texi [deleted file]
man/xresources.texi
msdos/ChangeLog
msdos/sed1v2.inp
nt/ChangeLog
nt/emacs.rc
oldXMenu/ChangeLog
s.diff [new file with mode: 0644]
src/ChangeLog
src/alloc.c
src/buffer.c
src/bytecode.c
src/category.c
src/coding.c
src/config.in
src/data.c
src/dosfns.c
src/editfns.c
src/emacs.c
src/eval.c
src/fileio.c
src/fns.c
src/frame.c
src/gtkutil.c
src/image.c
src/indent.c
src/keyboard.c
src/lread.c
src/m/amdx86-64.h
src/m/ibmrs6000.h
src/m/pfa50.h
src/mac.c
src/macfns.c
src/macmenu.c
src/macselect.c
src/macterm.c
src/macterm.h
src/minibuf.c
src/msdos.c
src/process.c
src/regex.c
src/s/aix4-2.h
src/s/gnu-linux.h
src/s/ms-w32.h
src/s/netbsd.h
src/s/openbsd.h
src/search.c
src/sound.c
src/strftime.c
src/syntax.c
src/sysdep.c
src/term.c
src/termhooks.h
src/unexcw.c
src/unexmacosx.c
src/w16select.c
src/w32fns.c
src/w32menu.c
src/w32proc.c
src/w32term.c
src/window.c
src/xdisp.c
src/xfaces.c
src/xfns.c
src/xmenu.c
src/xselect.c
src/xsmfns.c
src/xterm.c
src/xterm.h

diff --git a/AUTHORS b/AUTHORS
index 29bae40..17cc64f 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -3,6 +3,8 @@ Foundation's distribution of GNU Emacs.  To show our appreciation for
 their public spirit, we list here in alphabetical order a condensed
 list of their contributions.
 
+"\e$,1 a\e(Bukasz Demianiuk": changed erc.el
+
 Aaron Larson: changed bibtex.el
 
 Aaron S. Hawley: changed files.texi files.el isearch.el misc.texi
@@ -35,7 +37,7 @@ Alan Mackenzie: wrote cc-awk.el
 and changed cc-cmds.el cc-mode.el cc-defs.el cc-engine.el cc-vars.el
   cc-langs.el cc-styles.el cc-mode.texi lread.c cc-fonts.el cc-align.el
   cc-subword.el isearch.el programs.texi search.texi subr.el text.texi
-  buffers.texi cc-fix.el cc-mode-19.el ebrowse.el and 14 other files
+  buffers.texi cc-fix.el cc-mode-19.el ebrowse.el and 15 other files
 
 Alan Shutko: changed diary-lib.el calendar.el bindings.el cal-hebrew.el
   easy-mmode.el gnus-sum.el ibuf-ext.el ibuffer.el lunar.el macros.el
@@ -120,11 +122,11 @@ Andreas Luik: changed xfns.c xterm.c
 Andreas Schwab: changed Makefile.in files.el lisp.h xdisp.c alloc.c
   configure.in fns.c print.c coding.c dired.el editfns.c info.el eval.c
   fileio.c simple.el buffer.c minibuf.c xterm.c emacs.c keyboard.c
-  process.c and 444 other files
+  process.c and 446 other files
 
-Andreas Seltenreich: changed nnweb.el gnus.texi gnus-art.el gnus-ml.el
-  gnus-srvr.el gnus-start.el gnus-util.el gnus.el mm-url.el mm-uu.el
-  nnslashdot.el url-cookie.el url-http.el
+Andreas Seltenreich: changed nnweb.el gnus.texi battery.el gnus-art.el
+  gnus-ml.el gnus-srvr.el gnus-start.el gnus-util.el gnus.el mm-url.el
+  mm-uu.el nnslashdot.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
@@ -190,7 +192,7 @@ Ben Harris: changed configure.in
 Ben Key: changed w32.c w32fns.c w32menu.c makefile.w32-in w32.h w32term.c
   emacs.c gmake.defs ms-w32.h nmake.defs sound.c
 
-Ben North: changed fill.el isearch.el lisp-mode.el
+Ben North: changed fill.el isearch.el lisp-mode.el w32term.c xfaces.c
 
 Benjamin Drieu: wrote pong.el
 
@@ -325,9 +327,9 @@ Cheng Gao: changed MORE.STUFF flymake.el tips.texi url-dired.el
 
 Chong Yidong: changed cus-edit.el simple.el custom.el display.texi
   longlines.el files.el text.texi custom.texi files.texi keyboard.c
-  wid-edit.el cus-theme.el frames.texi info.el xterm.c compile.el
-  image-mode.el keymaps.texi misc.texi mouse.el sendmail.el
-  and 162 other files
+  wid-edit.el compile.el cus-theme.el frames.texi info.el misc.texi
+  mouse.el xterm.c image-mode.el keymaps.texi sendmail.el
+  and 176 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
@@ -492,8 +494,8 @@ David J. Mackenzie: changed configure.in etags.c fakemail.c movemail.c
 
 David Kastrup: changed greek.el replace.el search.c ange-ftp.el faq.texi
   help.el mouse.el Makefile.in calc.el desktop.el keymaps.texi
-  meta-mode.el process.c search.texi DEBUG DEVEL.HUMOR MAILINGLISTS
-  autoload.el browse-url.el buffer.c building.texi and 32 other files
+  meta-mode.el process.c search.texi subr.el DEBUG DEVEL.HUMOR
+  MAILINGLISTS autoload.el browse-url.el buffer.c and 32 other files
 
 David K\e,Ae\e(Bgedal: wrote tempo.el
 and changed sendmail.el xmenu.c
@@ -531,8 +533,8 @@ and changed w32menu.c w32term.c close.png close.xpm empty.png empty.xpm
   no-handle.xpm open.png open.xpm and 20 other files
 
 David Reitter: wrote mailclient.el
-and changed commands.h easy-mmode.el emacsbug.el keymap.c macterm.c
-  menu-bar.el minibuf.c sendmail.el url-http.el
+and changed commands.h easy-mmode.el emacsbug.el emacsclient.c keymap.c
+  macterm.c menu-bar.el minibuf.c sendmail.el url-http.el
 
 David Robinson: changed menu-bar.el x-win.el
 
@@ -626,9 +628,9 @@ Eli Tziperman: wrote rmail-spam-filter.el
 
 Eli Zaretskii: wrote codepage.el rxvt.el tty-colors.el
 and changed msdos.c Makefile.in makefile.w32-in files.el info.el fileio.c
-  startup.el mainmake.v2 config.bat menu-bar.el pc-win.el simple.el
-  internal.el msdos.h rmail.el xfaces.c frame.c dosfns.c faces.el
-  frame.el emacs.c and 517 other files
+  startup.el mainmake.v2 config.bat menu-bar.el pc-win.el rmail.el
+  simple.el internal.el msdos.h xfaces.c frame.c dosfns.c faces.el
+  frame.el emacs.c and 518 other files
 
 Emanuele Giaquinta: changed rxvt.el configure.in etags.c frame.el
   sh-script.el text.texi
@@ -826,17 +828,17 @@ Germano Caronni: changed ralloc.c
 
 Gernot Heiser: changed refer.el
 
-Giorgos Keramidas: changed amdx86-64.h apropos.el configure.in
-  display.texi fringe.c fringe.el lisp.h windows.texi
+Giorgos Keramidas: changed configure.in amdx86-64.h apropos.el
+  display.texi fringe.c fringe.el lisp.h windows.texi xmenu.c
 
 Giuseppe Scrivano: changed buffer.c configure configure.in sysdep.c
   xsmfns.c
 
-Glenn Morris: changed f90.el diary-lib.el calendar.el fortran.el
+Glenn Morris: changed f90.el calendar.el diary-lib.el fortran.el
   calendar.texi appt.el sh-script.el timeclock.el cal-menu.el
   cal-hebrew.el cal-islam.el files.el holidays.el programs.texi
   scroll-all.el startup.el cal-coptic.el cal-julian.el cal-move.el
-  cal-tex.el cal-x.el and 37 other files
+  cal-tex.el cal-x.el and 41 other files
 
 Glynn Clements: wrote gamegrid.el snake.el tetris.el
 
@@ -1011,9 +1013,9 @@ and changed bytecode.c mail-extr.el subr.el
 
 Jan Dj\e,Ad\e(Brv: wrote dnd.el x-dnd.el
 and changed gtkutil.c xterm.c xfns.c xmenu.c xterm.h gtkutil.h
-  configure.in keyboard.c Makefile.in config.in frames.texi x-win.el
-  configure xselect.c emacs.c alloc.c xlwmenu.c startup.el xdisp.c
-  xresources.texi cus-start.el and 172 other files
+  configure.in x-win.el Makefile.in frames.texi keyboard.c config.in
+  configure xselect.c emacs.c alloc.c xlwmenu.c xresources.texi frame.c
+  startup.el xdisp.c and 174 other files
 
 Jan Nieuwenhuizen: changed info.el TUTORIAL.nl emacs.c emacsclient.c
   gnus-start.el gud.el nnmh.el server.el startup.el
@@ -1037,7 +1039,7 @@ Jason Rumney: wrote w32-vars.el
 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 79 other files
+  w32inevt.c config.nt configure.bat and 80 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
@@ -1078,6 +1080,8 @@ Jens Toivo Berger Thielemann: changed word-help.el
 
 Jens-Ulrik Holger Petersen: changed cus-edit.el find-func.el gnus.el
 
+Jeramey Crawford: changed amdx86-64.h configure.in
+
 Jeremy Bertram Maitin-Shepard: changed erc.el erc-backend.el
   erc-button.el mml.el
 
@@ -1258,9 +1262,9 @@ Juan Le\e,As\e(Bn Lahoz Garc\e,Am\e(Ba: wrote wdired.el
 and changed files.el perl-mode.el
 
 Juanma Barranquero: changed makefile.w32-in help-fns.el subr.el faces.el
-  files.el w32fns.c cperl-mode.el replace.el simple.el eval.c
-  sh-script.el vhdl-mode.el ada-mode.el comint.el org.el w32-win.el
-  xdisp.c allout.el bs.el desktop.el idlwave.el and 554 other files
+  files.el w32fns.c bs.el cperl-mode.el eval.c org.el replace.el
+  simple.el sh-script.el vhdl-mode.el ada-mode.el allout.el comint.el
+  emacsclient.c idlwave.el process.c w32-win.el and 584 other files
 
 Juergen Hoetzel: changed url-handlers.el
 
@@ -1277,7 +1281,7 @@ Jure Cuhalev: changed ispell.el
 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 modes.texi mule.el
-  compare-w.el desktop.el files.texi and 220 other files
+  compare-w.el desktop.el files.texi and 221 other files
 
 Justin Sheehy: changed gnus-sum.el nntp.el
 
@@ -1341,7 +1345,7 @@ 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 mm-util.el gnus.el lpath.el
   gnus-group.el gnus-start.el rfc2047.el dgnushack.el mm-uu.el
-  gnus-agent.el nntp.el mml.el nnrss.el rfc2231.el and 71 other files
+  gnus-agent.el mml.el nntp.el nnrss.el rfc2231.el and 71 other files
 
 Kaveh R. Ghazi: changed delta88k.h xterm.c
 
@@ -1473,8 +1477,8 @@ Lars Balker Rasmussen: changed gnus-art.el gnus-agent.el message.el
 Lars Brinkhoff: changed building.texi config.in configure configure.in
   editfns.c fns.c os.texi
 
-Lars Hansen: changed desktop.el info.el mh-e.el dired-x.el dired-x.texi
-  dired.el ls-lisp.el rmail.el tramp.el dired.c files.texi grp.h
+Lars Hansen: changed desktop.el info.el mh-e.el tramp.el dired-x.el
+  dired-x.texi dired.el ls-lisp.el rmail.el dired.c files.texi grp.h
   hilit-chg.el misc.texi url-auth.el url-cache.el url-dired.el url-ftp.el
   url-irc.el url-misc.el url-news.el and 39 other files
 
@@ -1518,7 +1522,8 @@ and changed fortran.el ispell.el sendmail.el cmuscheme.el comint.el
 Leigh Stoller: changed emacsclient.c emacsserver.c server.el
 
 Lennart Borgman: changed window.el ada-xref.el filesets.el flymake.el
-  mouse.el recentf.el shell.el texinfmt.el w32term.c w32term.h
+  help-fns.el mouse.el recentf.el shell.el texinfmt.el tutorial.el
+  w32term.c w32term.h
 
 Lennart Staflin: changed dired.el diary-ins.el diary-lib.el tq.el xdisp.c
 
@@ -1554,8 +1559,8 @@ and changed emacsclient.c emacsserver.c etags.c lisp.h movemail.c
 
 Maciek Pasternacki: changed nnrss.el
 
-Magnus Henoch: changed ispell.el url-http.el autoinsert.el rcirc.el
-  url-gw.el url-https.el url-parse.el url.el
+Magnus Henoch: changed url-http.el ispell.el url-gw.el url-parse.el
+  url.el autoinsert.el rcirc.el url-https.el
 
 Manuel Serrano: wrote flyspell.el
 
@@ -1602,6 +1607,8 @@ Mark D. Baushke: changed mh-e.el mh-utils.el mh-mime.el mh-comp.el
   mh-seq.el mh-speed.el mh-funcs.el mh-alias.el MH-E-NEWS etags.c
   mh-junk.el mh-pick.el mh-tool-bar.el mh-xemacs-compat.el
 
+Mark Davies: changed Makefile.in netbsd.h ralloc.c sort.el
+
 Mark Diekhans: changed compile.el
 
 Mark H. Weaver: changed comint.el
@@ -1640,7 +1647,7 @@ and changed cus-edit.el Makefile.in files.el compile.el rmail.el
   mule-cmds.el rmailout.el checkdoc.el configure.in custom.el emacsbug.el
   gnus.el help-fns.el ls-lisp.el mwheel.el and 122 other files
 
-Markus Triska: changed doctor.el
+Markus Triska: changed doctor.el handwrite.el
 
 Marshall T. Vandegrift: changed gnus-fun.el
 
@@ -1660,9 +1667,9 @@ Martin Lorentzon: changed vc.el vc-cvs.el vc-hooks.el vc-rcs.el
 Martin Neitzel: changed sc.el
 
 Martin Rudalics: changed cus-edit.el wid-edit.el flyspell.el cus-start.el
-  files.el font-lock.el insdel.c syntax.c buffer.c buffer.h casefiddle.c
-  cperl-mode.el custom.el dispextern.h dnd.el editfns.c eldoc.el fileio.c
-  find-func.el help-at-pt.el hideif.el and 20 other files
+  files.el font-lock.el insdel.c macmenu.c syntax.c w32menu.c window.el
+  xdisp.c xmenu.c buffer.c buffer.h casefiddle.c cperl-mode.el custom.el
+  dispextern.h dnd.el editfns.c and 25 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
@@ -1731,8 +1738,6 @@ and changed tramp.el tramp.texi tramp-vc.el tramp-util.el ange-ftp.el
 Michael Ben-Gershon: changed acorn.h configure.in riscix1-1.h riscix1-2.h
   unexec.c
 
-Michael Cadilhac: changed blackbox.el rect.el subr.el zone.el
-
 Michael Cook: changed gnus-sum.el
 
 Michael D. Ernst: wrote reposition.el
@@ -1800,9 +1805,9 @@ Michal Jankowski: changed insdel.c keyboard.c
 
 Michal Nazarewicz: changed ispell.el
 
-Micha\e,Ak\e(Bl Cadilhac: changed ido.el ispell.el cus-edit.el dispnew.c info.el
-  life.el lpr.el make-mode.el pong.el print.c process.c startup.el
-  uni-input.el
+Micha\e,Ak\e(Bl Cadilhac: changed ido.el ispell.el battery.el blackbox.el
+  cus-edit.el dispnew.c info.el life.el lpr.el make-mode.el pong.el
+  print.c process.c rect.el startup.el subr.el uni-input.el zone.el
 
 Michelangelo Grigni: wrote ffap.el
 and changed gnus-score.el
@@ -1898,6 +1903,8 @@ and changed gud.el building.texi tooltip.el speedbar.el bindings.el
 
 Nico Francois: changed w32fns.c w32inevt.c w32menu.c
 
+Niimi Satoshi: changed pp.el search.c
+
 Niklas Morberg: changed nnweb.el gnus-art.el nnimap.el spam.el
 
 Noah Friedman: wrote eldoc.el rlogin.el rsz-mini.el type-break.el
@@ -1910,8 +1917,8 @@ Nobuyuki Hikichi: changed news-risc.h
 
 Noel Cragg: changed mh-junk.el
 
-Nozomu Ando: changed buffer.c mips.h pmax.h smtpmail.el sysselect.h
-  unexelf.c unexmacosx.c
+Nozomu Ando: changed unexmacosx.c alloc.c buffer.c mips.h pmax.h
+  smtpmail.el sysselect.h unexelf.c
 
 Nuutti Kotivuori: changed gnus-sum.el flow-fill.el gnus-cache.el
 
@@ -1948,6 +1955,8 @@ Oscar Figueiredo: wrote eudc-bob.el eudc-export.el eudc-hotlist.el
   eudc-vars.el eudc.el eudcb-bbdb.el eudcb-ldap.el eudcb-ph.el ldap.el
 and changed ph.el
 
+\e,bS\e(Bscar Fuentes: changed emacsclient.c
+
 Oystein Viggen: changed dgnushack.el
 
 P. E. Jareth Hein: changed gnus-util.el
@@ -2120,9 +2129,9 @@ and changed gnus-art.el gnus-msg.el gnus.texi message.el nnmail.el
 
 Reiner Steib: wrote gmm-utils.el
 and changed gnus-art.el message.el gnus.texi gnus-sum.el gnus.el
-  gnus-group.el gnus-faq.texi mml.el gnus-start.el gnus-util.el
-  gnus-msg.el gnus-score.el message.texi mm-util.el files.el
-  gnus-agent.el spam-report.el mm-decode.el nnweb.el spam.el deuglify.el
+  gnus-group.el gnus-faq.texi gnus-util.el mml.el gnus-start.el
+  mm-util.el gnus-agent.el gnus-msg.el gnus-score.el message.texi
+  files.el spam-report.el mm-decode.el nnweb.el spam.el deuglify.el
   and 162 other files
 
 Remek Trzaska: changed gnus-ems.el
@@ -2149,7 +2158,7 @@ Richard L. Pieri: wrote pop3.el
 
 Richard M. Heiberger: changed tex-mode.el
 
-Richard M. Stallman: wrote [The original GNU emacs and numerous files]
+Richard M. Stallman: wrote [The original GNU Emacs and numerous files]
   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
@@ -2183,14 +2192,14 @@ Robert Bihlmeyer: changed gnus-score.el gnus-util.el message.el
 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 emacs-lisp-intro.texi
+and changed texinfmt.el emacs-lisp-intro.texi page-ext.el emacs.tex
   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
 
-Roberto Rodr\e,Am\e(Bguez: changed ada-mode.texi widget.texi
+Roberto Rodr\e,Am\e(Bguez: changed ada-mode.texi glossary.texi widget.texi
 
 Roderick Schertler: changed dgux.h dgux4.h gud.el sysdep.c
 
@@ -2217,11 +2226,11 @@ Roland Winkler: changed bibtex.el appt.el artist.el conf-mode.el
 Rolf Ebert: wrote ada-mode.el
 and changed files.el find-file.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
+Romain Francoise: changed faq.texi dired-x.el ibuf-ext.el Makefile.in
+  compile.el message.el puresize.h replace.el subr.el files.texi
+  gnus-fun.el gnus.texi help-fns.el make-dist rcirc.el antlr-mode.el
   bookmark.el buffer.c comint.el diary-lib.el dired.el
-  and 124 other files
+  and 126 other files
 
 Roman Belenov: changed which-func.el
 
@@ -2317,6 +2326,8 @@ Shinichirou Sugou: changed etags.c
 Shuhei Kobayashi: wrote hex-util.el sha1.el
 and changed gnus-group.el message.el nnmail.el
 
+Shun-Ichi Goto: changed url-http.el
+
 Sidney Markowitz: changed doctor.el
 
 Sigbjorn Finne: changed gnus-srvr.el
@@ -2339,12 +2350,12 @@ Simon Marshall: wrote fast-lock.el lazy-lock.el regexp-opt.el
 and changed comint.el font-lock.el shell.el rmail.el fortran.el
   sendmail.el subr.el dired.el sh-script.el texinfo.el add-log.el
   compile.el outline.el help.el menu-bar.el perl-mode.el ps-print.el
-  rmailsum.el bytecomp.el data.c faces.el and 56 other files
+  rmailsum.el bytecomp.el data.c faces.el and 57 other files
 
 Skip Collins: changed w32fns.c w32term.c w32term.h
 
-Slawomir Nowaczyk: changed python.el TUTORIAL.pl emacs.py flyspell.el
-  ls-lisp.el
+Slawomir Nowaczyk: changed emacs.py python.el TUTORIAL.pl flyspell.el
+  ls-lisp.el w32proc.c
 
 Spencer Thomas: changed dabbrev.el emacsclient.c emacsserver.c gnus.texi
   server.el tcp.c unexec.c
@@ -2378,11 +2389,14 @@ and changed diary-lib.el locate.el octave-inf.el replace.el hexl.el
 
 Stephen Gildea: wrote mh-funcs.el mh-pick.el refcard.tex
 and changed time-stamp.el mh-e.el mh-comp.el mh-utils.el mh-customize.el
-  fileio.c files.el fortran.el mh-e.texi mh-junk.el mh-mime.el mwheel.el
+  mh-junk.el fileio.c files.el fortran.el mh-e.texi mh-mime.el mwheel.el
   tex-mode.el
 
 Stephen J. Turnbull: changed ediff-init.el strings.texi subr.el
 
+Stephen Leake: changed ada-mode.el ada-xref.el ada-stmt.el ada-mode.texi
+  ada-prj.el
+
 Steve Fisk: wrote cal-tex.el
 
 Steve Nygard: changed unexnext.c
@@ -2467,6 +2481,8 @@ Terrence Brannon: wrote landmark.el
 
 Terry Jones: wrote shadow.el
 
+Tetsurou Okazaki: changed xterm.c
+
 Theodore Jump: changed w32-win.el w32faces.c
 
 Thien-Thi Nguyen: wrote hideshow.el make-mms-derivative.el
@@ -2503,7 +2519,8 @@ Tijs Van Bakel: changed erc.el
 
 Tim Fleehart: wrote makefile.nt
 
-Tim Van Holder: changed Makefile.in compile.el configure.in which-func.el
+Tim Van Holder: changed emacsclient.c Makefile.in compile.el configure.in
+  which-func.el
 
 Tobias C. Rittweiler: changed font-lock.el
 
@@ -2642,7 +2659,7 @@ and changed latin-pre.el pl-refcard.ps pl-refcard.tex refcard-pl.ps
 
 Wolfgang Glas: changed unexsgi.c
 
-Wolfgang Jenkner: changed conf-mode.el pcvs.el
+Wolfgang Jenkner: changed conf-mode.el gnus-sum.el pcvs.el
 
 Wolfgang Rupprecht: wrote float-sup.el floatfns.c sup-mouse.el
 and changed process.c alloc.c callint.c config.h.in config.in
@@ -2660,15 +2677,15 @@ Xavier Maillard: changed gnus-faq.texi gnus-score.el spam.el
 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
-  emacs.c config.h macos.texi xfaces.c Makefile.in darwin.h dispextern.h
-  dispnew.c w32term.c and 69 other files
+  macgui.h macmenu.c image.c macselect.c keyboard.c xdisp.c makefile.MPW
+  emacs.c config.h macos.texi xfaces.c Makefile.in darwin.h INSTALL
+  dispextern.h dispnew.c and 71 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
+Yoni Rabkin Katzenell: changed faces.el whitespace.el
 
 Yoshiki Hayashi: changed texinfmt.el nnheader.el
 
index 34c6743..d341d02 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,41 @@
+2006-11-27  Chris Moore  <christopher.ian.moore@gmail.com>  (tiny change)
+
+       * Makefile.in: Touch only the parts of the share/emacs directory
+       specific to this version.
+
+2006-11-26  Chong Yidong  <cyd@stupidchicken.com>
+
+       * configure.in (HAVE_X86_64_LIB64_DIR): New test.
+
+       * configure: Regenerate.
+
+2006-11-14  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * configure.in (HAVE_CANCELMENUTRACKING): Remove test.
+
+       * configure: Regenerate.
+
+2006-11-08  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * configure.in: Prefer X11 to Carbon only when some X-specific
+       option is specified (Thanks to Jan Dj\e,Ad\e(Brv and Andreas Schwab).
+
+       * configure: Regenerate.
+
+2006-11-04  Romain Francoise  <romain@orebokech.com>
+
+       * Makefile.in (bootstrap-clean-before): Fix typo.
+       Use new target `bootstrap-clean' in the leim subdirectory.
+
+2006-11-03  Giorgos Keramidas  <keramida@ceid.upatras.gr>  (tiny change)
+
+       * configure.in: Enable sparc64/ia64/powerpc FreeBSD builds.
+
+2006-10-30  Chong Yidong  <cyd@stupidchicken.com>
+
+       * make-dist: Add makefile.w32-in to the man, lispref and lispintro
+       directories.
+
 2006-10-29  Chong Yidong  <cyd@stupidchicken.com>
 
        * configure: Regenerate using autoconf 2.59.
 
        * configure: Regenerate.
 
-2006-10-23  Michael Kifer  <kifer@cs.stonybrook.edu>
-
-       * viper-cmd.el (viper-prefix-arg-com): define gg as G0
-
-       * viper-ex.el (ex-read): quote file argument.
-
-       * ediff-diff.el (ediff-same-file-contents): expand file names.
-
-       * ediff-mult.el (ediff-append-custom-diff): quote shell file arguments.
-
 2006-10-23  Andreas Schwab  <schwab@suse.de>
 
        * configure.in: Make sure x_default_search_path is always set even
@@ -47,7 +75,7 @@
 
 2006-09-30  Eli Zaretskii  <eliz@gnu.org>
 
-       * configure: Regenerated.
+       * configure: Regenerate.
 
 2006-09-28  Kenichi Handa  <handa@m17n.org>
 
 
        * configure.in (PKG_CHECK_MODULES): Redirect the output of
        $PKG_CONFIG --exists "$2" to config.log.
-       * configure: Regenerated.
+       * configure: Regenerate.
 
 2006-07-14  Kim F. Storm  <storm@cua.dk>
 
 
 2006-07-07  Eli Zaretskii  <eliz@gnu.org>
 
-       * CONTRIBUTE: Slight formatting changes and typo fixes.  Add
-       description of NEWS markings.
+       * CONTRIBUTE: Slight formatting changes and typo fixes.
+       Add description of NEWS markings.
 
 2006-07-07  Kim F. Storm  <storm@cua.dk>
 
 
        * info/dir: Remove the Emacs-Xtra entry.
 
-2006-04-20 Ramprasad B <ramprasad_i82@yahoo.com>
+2006-04-20  Ramprasad B  <ramprasad_i82@yahoo.com>
 
        * Copyright (sources/emacs): Update copyright year(s).
 
        Remove the MAXPATHLEN limitations:
 
        * configure.in (AC_CHECK_FUNCS): Check for get_current_dir_name.
-       * configure: Regenerated.
+       * configure: Regenerate.
 
 2005-09-09  Eli Zaretskii  <eliz@gnu.org>
 
        * configure.in <lynxsos*>: Support for LynxOS on PPC.
-       * configure: Regenerated.
+       * configure: Regenerate.
 
 2005-09-05  Paul Eggert  <eggert@cs.ucla.edu>
 
 
        Update FSF's address in GPL notices.
 
-2005-06-19  J\e,bi\e(Br\e,bt\e(Bme Marant  <jerome@marant.org>
+2005-06-19  J\e,Ai\e(Br\e,At\e(Bme Marant  <jerome@marant.org>
 
        * Makefile.in (epaths-force): Protect both lisppath and
        buildlisppath from whitespace.
        * Makefile.in (install-arch-indep, uninstall): Add url and org
        manuals.
 
-2004-12-07  Stefan  <monnier@iro.umontreal.ca>
+2004-12-07  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * configure.in (INLINE, RE_TRANSLATE_P): Move patches mistakenly
        committed to src/config.in.
        * configure.in (HAVE_RANDOM_HEAPSTART): Change AC_MSG_ERROR to
        AC_MSG_WARN.  Move output of warning message to end of configure run.
 
-2004-10-05  Jan Dj\e,Ad\e(Brv.  <jan.h.d@swipnet.se>
+2004-10-05  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
 
        * configure.in (HAVE_RANDOM_HEAPSTART): Rename HAVE_EXECSHIELD.
        Run test to see if heap start address is random.
 
        * configure.in <darwin>: Use fink packages if available.
 
-2004-01-25  Jerome Marant  <jmarant@free.fr>  (tiny change)
+2004-01-25  J\e,Ai\e(Br\e,At\e(Bme Marant  <jmarant@free.fr>  (tiny change)
 
        * make-dist (lispref): Do include lispref/index.texi.
 
 
 2003-01-29  Kim F. Storm  <storm@cua.dk>
 
-       * AUTHORS: Regenerated using new format (after fixing numerous
+       * AUTHORS: Regenerate using new format (after fixing numerous
        formatting errors in the ChangeLog files).
 
 2003-01-22  Andreas Schwab  <schwab@suse.de>
 
        * configure.in (*-sunos5*, *-solaris*): Use sol2-8.
 
-2002-11-14  Francesco Potorti`  <pot@gnu.org>
+2002-11-14  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * configure.in (*-sunos5.8*, *-solaris2.8*): New configurations.
 
 
        These changes make Leim part of the standard distribution:
 
-       * README: Add info about the `leim' directory
+       * README: Add info about the `leim' directory.
 
        * INSTALL: Remove text that describes Leim as a separate package.
 
 2000-08-24  Gerd Moellmann  <gerd@gnu.org>
 
        * configure.in <making srcdir absolute>: Unset CDPATH in case $PWD
-       contains a relative path.  Protect against unusable values of
-       $PWD.
+       contains a relative path.  Protect against unusable values of $PWD.
 
 2000-08-08  Eli Zaretskii  <eliz@is.elta.co.il>
 
 
 2000-08-07  Gerd Moellmann  <gerd@gnu.org>
 
-       * Makefile.in (config.status): Prepend `$(srcdir)/' to
-       `configure'.
+       * Makefile.in (config.status): Prepend `$(srcdir)/' to `configure'.
 
 2000-08-03  Gerd Moellmann  <gerd@gnu.org>
 
 
 1999-08-18  Dave Love  <fx@gnu.org>
 
-       * configure.in: Check for termcap.h.
+       * configure.in: Check for termcap.h.
 
 1999-08-15  Gerd Moellmann  <gerd@gnu.org>
 
 
 1998-12-04  Andreas Schwab  <schwab@delysid.gnu.org>
 
-       * Makefile.in: Don't install customize info file.  Run
-       install-info on viper info file.
+       * Makefile.in: Don't install customize info file.
+       Run install-info on viper info file.
 
 1998-11-29  Richard Stallman  <rms@psilocin.ai.mit.edu>
 
 
 1997-09-30  Karl Eichwalder  <ke@suse.de>
 
-       * Makefile.in (install-arch-indep): install the widget info file.
+       * Makefile.in (install-arch-indep): Install the widget info file.
 
 1997-09-24  Jonathan I. Kamens  <jik@kamens.brookline.ma.us>
 
 
 1997-09-21  Erik Naggum  <erik@naggum.no>
 
-       * make-dist (making links to `src'): Keep timestamp on copied
-       files.
+       * make-dist (making links to `src'): Keep timestamp on copied files.
 
        * make-delta: New script to produce delta distributions.
 
        * make-dist (etc): Really avoid symlinks now.
        (lisp): Don't delete from subdirs the things we never copy.
 
-1997-07-07  Ken'ichi Handa  <handa@psilocin.gnu.ai.mit.edu>
+1997-07-07  Kenichi Handa  <handa@psilocin.gnu.ai.mit.edu>
 
        * Makefile.in (install-arch-indep): Correct the target name.
        The first letter `i' was dropped by the previous change of mine.
 
        * Makefile.in (install-leim): Correct previous change.
 
-1997-07-02  Ken'ichi Handa  <handa@psilocin.gnu.ai.mit.edu>
+1997-07-02  Kenichi Handa  <handa@psilocin.gnu.ai.mit.edu>
 
        * Makefile.in (install-leim): New target.
        (install): Depend on install-leim.
 
-1997-07-01  Ken'ichi Handa  <handa@psilocin.gnu.ai.mit.edu>
+1997-07-01  Kenichi Handa  <handa@psilocin.gnu.ai.mit.edu>
 
        * Makefile.in (SUBDIR): Add leim.
        (SUBDIR_MAKEFILES): Add leim/Makefile.
 
 1997-06-22  Dave Love  <d.love@dl.ac.uk>
 
-       * Makefile.in (lib-src): Depend on src/config.h (e.g. for
-       movemail.o).
-       (src/config.h): New target to re-configure if src/config.in
-       is patched.
+       * Makefile.in (lib-src): Depend on src/config.h (e.g. for movemail.o).
+       (src/config.h): New target to re-configure if src/config.in is patched.
 
 1997-06-18  Richard Stallman  <rms@psilocin.gnu.ai.mit.edu>
 
        * configure.in (shutdown): Check for `shutdown' function.
 
-1997-06-18  Ken'ichi Handa  <handa@psilocin.gnu.ai.mit.edu>
+1997-06-18  Kenichi Handa  <handa@psilocin.gnu.ai.mit.edu>
 
        * update-subdirs: Include the directory "language" in subdirs.
 
 1997-04-09  Marcus G. Daniels  <marcus@cathcart.sysc.pdx.edu>
 
        * configure.in (doug_lea_malloc):  First check for SYSTEM_MALLOC,
-       in case it is desirable to disable the GNU malloc features with
-       glibc.
+       in case it is desirable to disable the GNU malloc features with glibc.
 
 1997-04-08  Marcus G. Daniels  <marcus@cathcart.sysc.pdx.edu>
 
        * configure.in (DOUG_LEA_MALLOC):
        Define if malloc_{get,set}_state exist.
 
-1997-03-05  Ken'ichi Handa  <handa@etl.go.jp>
+1997-03-05  Kenichi Handa  <handa@etl.go.jp>
 
        * make-dist: Make links for files under lisp/language.
 
 
 1996-07-11  Bill Mann  <dvmann@dvncr.praxisint.com>
 
-       * configure.in: Use s/usg5-4-3.h for ncr-i[3456]86-sysv4.3
+       * configure.in: Use s/usg5-4-3.h for ncr-i[3456]86-sysv4.3.
 
 1996-07-07  Karl Heuer  <kwzh@gnu.ai.mit.edu>
 
 
 1995-06-22  Paul Eggert  <eggert@twinsun.com>
 
-       * configure.in: Treat SunOS 4.1.4 like SunOS 4.1.3.
-       (Likewise for SunOS 4.1.5 thorugh 4.1.9, should they ever exist.)
+       * configure.in: Treat SunOS 4.1.4 like SunOS 4.1.3.  (Likewise for
+       SunOS 4.1.5 thorugh 4.1.9, should they ever exist.)
 
 1995-06-22  Paul Eggert  <eggert@twinsun.com>
 
 
 1995-05-22  enami tsugutomo  <enami@sys.ptg.sony.co.jp>
 
-       * configure.in: pass arg to sqrt.
+       * configure.in: Pass arg to sqrt.
 
 1995-05-18  Karl Heuer  <kwzh@hal.gnu.ai.mit.edu>
 
 
 1995-05-09  David J. MacKenzie  <djm@geech.gnu.ai.mit.edu>
 
-       * configure.in: Use sqrt (more portable) instead of fmod in -lm
-       check.
+       * configure.in: Use sqrt (more portable) instead of fmod in -lm check.
 
 1995-05-09  Richard Stallman  <rms@mole.gnu.ai.mit.edu>
 
 
 1995-05-06  David J. MacKenzie  <djm@geech.gnu.ai.mit.edu>
 
-       * configure.in: Make sure CDPATH doesn't mess up PWD check.  Check
-       whether X bitmaps are in X11/bitmaps instead of bitmaps.  Use fmod
-       instead of logb in -lm check.
+       * configure.in: Make sure CDPATH doesn't mess up PWD check.
+       Check whether X bitmaps are in X11/bitmaps instead of bitmaps.
+       Use fmod instead of logb in -lm check.
 
 1995-05-03  Richard Stallman  <rms@mole.gnu.ai.mit.edu>
 
        * configure.in (*-sun-sunos4.1.3*): Use shared libraries,
        since that's what the header file expects.
 
-1995-04-24  Francesco Potorti`  (pot@cnuce.cnr.it)
+1995-04-24  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * configure.in (m68k-motorola-sysv*): Distinguish between 68030
        and 68040 based machines when choosing options for gnucc.
 1995-04-06  Simon Leinen  <simon@lia.di.epfl.ch>
 
        * Makefile.in (install-arch-indep, dist):
-       look for `update-subdir' in $(srcdir).
+       Look for `update-subdir' in $(srcdir).
 
 1995-04-06  Richard Stallman  <rms@mole.gnu.ai.mit.edu>
 
 
 1995-02-02  David J. MacKenzie  <djm@geech.gnu.ai.mit.edu>
 
-       * configure.in: Create a .gdbinit that sources the real one, if
-       using a different build directory.
+       * configure.in: Create a .gdbinit that sources the real one,
+       if using a different build directory.
 
 1995-01-23  Karl Heuer  <kwzh@hal.gnu.ai.mit.edu>
 
 
 ;; Local Variables:
 ;; coding: iso-2022-7bit
+;; add-log-time-zone-rule: t
 ;; End:
 
     Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2006
index 7193bd1..b2ee0ca 100644 (file)
@@ -280,7 +280,7 @@ epaths-force: FRC
          -e 's;/[*] *arch-tag:.*;/*;') &&              \
        ${srcdir}/move-if-change epaths.h.$$$$ src/epaths.h
 
-# For parallel make, src should be build before leim.
+# For parallel make, src should be built before leim.
 # "export PARALLEL=0" is for SGI's Make, to prevent it from
 # running more than 1 process in the leim directory, especially for
 # the $TIT files there.
@@ -518,7 +518,7 @@ install-arch-indep: mkdir info
             ${INSTALL_INFO} --info-dir=$(DESTDIR)${infodir} $(DESTDIR)${infodir}/$$elt); \
          done; \
        else true; fi
-       -chmod -R a+r $(DESTDIR)${datadir}/emacs ${COPYDESTS} $(DESTDIR)${infodir}
+       -chmod -R a+r $(DESTDIR)${datadir}/emacs/${version} $(DESTDIR)${datadir}/emacs/site-lisp ${COPYDESTS} $(DESTDIR)${infodir}
        thisdir=`/bin/pwd`; \
        cd ${srcdir}/etc; \
        for page in emacs emacsclient etags ctags ; do \
@@ -790,6 +790,7 @@ bootstrap-build: FRC
 ### Used for `bootstrap' to avoid deleting existing dumped Emacs executables.
 bootstrap-clean-before: bootstrap-clean-before-fast FRC
        (cd lisp;     $(MAKE) $(MFLAGS) bootstrap-clean)
+       (cd leim;     $(MAKE) $(MFLAGS) bootstrap-clean)
 
 ### Used for `bootfast' to avoid deleting existing dumped Emacs executables
 ### and compiled .elc files.
diff --git a/README b/README
index 91563b1..ebb4224 100644 (file)
--- a/README
+++ b/README
@@ -1,28 +1,29 @@
-This directory tree holds version 22.0.91 of GNU Emacs, the extensible,
+This directory tree holds version 23.0.51 of GNU Emacs, the extensible,
 customizable, self-documenting real-time display editor.
 
-You may encounter bugs in this release.  If you do, please report
-them; your bug reports are valuable contributions to the FSF, since
-they allow us to notice and fix problems on machines we don't have, or
-in code we don't use often.  See the file BUGS for more information on
-how to report bugs.
+The file INSTALL in this directory says how to build and install GNU
+Emacs on various systems, once you have unpacked or checked out the
+entire Emacs file tree.
 
 See the file etc/NEWS for information on new features and other
 user-visible changes in recent versions of Emacs.
 
-The file INSTALL in this directory says how to bring up GNU Emacs on
-various systems, once you have loaded the entire subtree of this
-directory.
-
 The file etc/PROBLEMS contains information on many common problems that
 occur in building, installing and running Emacs.
 
-Reports of bugs in Emacs should be sent to the mailing list
-bug-gnu-emacs@gnu.org.  See the "Bugs" section of the Emacs
-manual for more information on how to report bugs.  (The file `BUGS'
-in this directory explains how you can find and read that section
-using the Info files that come with Emacs.)  See `etc/MAILINGLISTS'
-for more information on mailing lists relating to GNU packages.
+You may encounter bugs in this release.  If you do, please report
+them; your bug reports are valuable contributions to the FSF, since
+they allow us to notice and fix problems on machines we don't have, or
+in code we don't use often.  Please send bug reports for released
+versions of Emacs sent to the mailing list bug-gnu-emacs@gnu.org.
+Please send bug reports for pretest versions of Emacs, and versions
+from the Savannah.gnu.org repository, to emacs-pretest-bugs@gnu.org.
+
+See the "Bugs" section of the Emacs manual for more information on how
+to report bugs.  (The file `BUGS' in this directory explains how you
+can find and read that section using the Info files that come with
+Emacs.)  See `etc/MAILINGLISTS' for more information on mailing lists
+relating to GNU packages.
 
 The `etc' subdirectory contains several other files, named in capital
 letters, which you might consider looking at when installing GNU
@@ -86,20 +87,3 @@ There are several subdirectories:
 that aren't part of the standard distribution of the OS.  The
 platform-specific README files and installation instructions should
 list the required tools.
-
-VMS info:
-
-Emacs 19.x and above do not compile out of the box on OpenVMS.
-Richard Levitte <levitte@lp.se> is distributing and maintaining a
-version of Emacs (currently based on version 19.28, but soon moving to
-19.34 and then 20.1) that compiles and works on OpenVMS 5.5 and above
-on both VAX and Alpha architectures.  For more information see
-
-  http://www.lp.se/gnu-vms/software/released1/emacs.html
-
-There is also some effort going on with Emacs 21.  Source code is
-available at ftp://ftp.nvg.ntnu.no/pub/vms/emacs/.  Look for most
-recent stuff with ls -lta.
-
-It is a working "development" version (editing and much more works).
-More developers are needed; contact roart@nvg.ntnu.no.
index f31e58b..6374f85 100644 (file)
@@ -1,3 +1,13 @@
+2006-11-25  Juanma Barranquero  <lekktu@gmail.com>
+
+       * admin.el (set-version): Set version number in
+       lib-src/makefile.w32-in.
+
+2006-11-06  Reiner Steib  <Reiner.Steib@gmx.de>
+
+       * FOR-RELEASE (BUGS): Remove "Build failure under Suse 10.0" was
+       due to a local miss-configuration.
+
 2006-10-28  Chong Yidong  <cyd@stupidchicken.com>
 
        * make-announcement (OLD): Remove LEIM references in announcement
 
 ;; Local Variables:
 ;; coding: iso-2022-7bit
+;; add-log-time-zone-rule: t
 ;; End:
 
     Copyright (C) 2001 Free Software Foundation, Inc.
index 4e913c8..224a192 100644 (file)
@@ -43,7 +43,19 @@ to the hack introduced on 2005-07-01 to fix some other Cleartype problem.
 
 * BUGS
 
-** david.reitter@gmail.com, Oct 16: url-retrieve may cause hang
+** Document use of gpg-agent
+
+** monnier@iro.umontreal.ca, Nov 24: 
+  gnus-summary-tick-article-forward doesn't work any more?
+
+** jpff@codemist.co.uk, Nov 23: Problem in reading mail
+  Error is Invalid search bound
+
+** rgm@gnu.org, Nov 29: mouse and horizontal scrolling with long lines
+
+** christopher.ian.moore@gmail.com, Nov 30: too much recursion in gnus-sort-threads-1.
+
+** rmg@gnu.org, Nov 29: saved user abbrevs and system abbrevs
 
 * DOCUMENTATION
 
index 6cd090c..b9937ea 100644 (file)
@@ -88,6 +88,9 @@ Root must be the root of an Emacs source tree."
   (set-version-in-file root "lispref/elisp.texi" version
                       (rx (and "EMACSVER" (1+ space)
                                (submatch (1+ (in "0-9."))))))
+  (set-version-in-file root "lib-src/makefile.w32-in" version
+                      (rx (and "VERSION" (0+ space) "=" (0+ space)
+                               (submatch (1+ (in "0-9."))))))
   ;; nt/emacs.rc also contains the version number, but in an awkward
   ;; format. It must contain four components, separated by commas, and
   ;; in two places those commas are followed by space, in two other
index 9b15f8d..e56c265 100644 (file)
@@ -21,11 +21,12 @@ For each step, check for possible errors.
 
 5.   rm configure; make bootstrap
 
-6.  Commit configure, README, AUTHORS, lisp/cus-load.el,
-    lisp/finder-inf.el, lisp/version.el, man/emacs.texi,
-    lispref/elisp.texi.  Copy lisp/loaddefs.el to lisp/ldefs-boot.el
-    and commit lisp/ldefs-boot.el.  For a release, also commit the
-    ChangeLog files in all directories.
+6.  Commit configure, README, AUTHORS, lisp/finder-inf.el,
+    lisp/version.el, man/emacs.texi, lispref/elisp.texi,
+    mac/Emacs.app/Contents/Resources/English.lproj/InfoPlist.strings,
+    mac/src/Emacs.r, nt/emacs.rc.  Copy lisp/loaddefs.el to
+    lisp/ldefs-boot.el and commit lisp/ldefs-boot.el.  For a release,
+    also commit the ChangeLog files in all directories.
 
 7.   make-dist --snapshot.  Check the contents of the new tar with
      admin/diff-tar-files against an older tar file.  Some old pretest
index a070b7c..e746090 100755 (executable)
--- a/configure
+++ b/configure
@@ -2198,6 +2198,9 @@ case "${canonical}" in
     opsys=freebsd
     case "${canonical}" in
       alpha*-*-freebsd*)       machine=alpha ;;
+      ia64-*-freebsd*)         machine=ia64 ;;
+      sparc64-*-freebsd*)      machine=sparc ;;
+      powerpc-*-freebsd*)      machine=macppc ;;
       i[3456]86-*-freebsd*)    machine=intel386 ;;
       amd64-*-freebsd*|x86_64-*-freebsd*) machine=amdx86-64 ;;
     esac
@@ -5776,6 +5779,19 @@ fi
 
 
 
+### The standard library on x86-64 GNU/Linux distributions can
+### be located in either /usr/lib64 or /usr/lib.
+case "${canonical}" in
+  x86_64-*-linux-gnu* )
+    if test -d /usr/lib64; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_X86_64_LIB64_DIR 1
+_ACEOF
+
+fi
+esac
+
 
 
 
@@ -9333,7 +9349,13 @@ fi
 if test "${window_system}" = x11 && test "${HAVE_CARBON}" = yes; then
   if test "${with_carbon+set}" != set \
      && test "${carbon_appdir_x+set}" != set; then
-    HAVE_CARBON=no
+    for var in with_x with_x_toolkit with_gtk with_xim \
+               with_xpm with_jpeg with_tiff with_gif with_png; do
+      if eval test \"\${$var+set}\" = set; then
+        HAVE_CARBON=no
+        break
+      fi
+    done
   fi
 fi
 if test "${HAVE_CARBON}" = yes; then
@@ -13404,104 +13426,6 @@ _ACEOF
   fi
   # We also have mouse menus.
   HAVE_MENUS=yes
-
-  tmp_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -framework Carbon"
-  { echo "$as_me:$LINENO: checking for CancelMenuTracking" >&5
-echo $ECHO_N "checking for CancelMenuTracking... $ECHO_C" >&6; }
-if test "${ac_cv_func_CancelMenuTracking+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define CancelMenuTracking to an innocuous variant, in case <limits.h> declares CancelMenuTracking.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define CancelMenuTracking innocuous_CancelMenuTracking
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char CancelMenuTracking (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef CancelMenuTracking
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char CancelMenuTracking ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_CancelMenuTracking || defined __stub___CancelMenuTracking
-choke me
-#endif
-
-int
-main ()
-{
-return CancelMenuTracking ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_func_CancelMenuTracking=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_cv_func_CancelMenuTracking=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_CancelMenuTracking" >&5
-echo "${ECHO_T}$ac_cv_func_CancelMenuTracking" >&6; }
-if test $ac_cv_func_CancelMenuTracking = yes; then
-  have_cmt=yes
-else
-  have_cmt=no
-fi
-
-  if test "$have_cmt" = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_CANCELMENUTRACKING 1
-_ACEOF
-
-  fi
-  CFLAGS="$tmp_CFLAGS"
 fi
 
 ### Use session management (-lSM -lICE) if available
index 01e5ced..86b4811 100644 (file)
@@ -237,6 +237,9 @@ case "${canonical}" in
     opsys=freebsd
     case "${canonical}" in
       alpha*-*-freebsd*)       machine=alpha ;;
+      ia64-*-freebsd*)         machine=ia64 ;;
+      sparc64-*-freebsd*)      machine=sparc ;;
+      powerpc-*-freebsd*)      machine=macppc ;;
       i[3456]86-*-freebsd*)    machine=intel386 ;;
       amd64-*-freebsd*|x86_64-*-freebsd*) machine=amdx86-64 ;;
     esac
@@ -1482,6 +1485,16 @@ dnl Do this early because it can frob feature test macros for Unix-98 &c.
 AC_SYS_LARGEFILE
 
 
+### The standard library on x86-64 GNU/Linux distributions can 
+### be located in either /usr/lib64 or /usr/lib.
+case "${canonical}" in
+  x86_64-*-linux-gnu* )
+    if test -d /usr/lib64; then
+      AC_DEFINE(HAVE_X86_64_LIB64_DIR, 1,
+        [Define to 1 if the file /usr/lib64 exists.])
+fi
+esac
+
 dnl This function defintion taken from Gnome 2.0
 dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
 dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
@@ -1776,7 +1789,13 @@ fi
 if test "${window_system}" = x11 && test "${HAVE_CARBON}" = yes; then
   if test "${with_carbon+set}" != set \
      && test "${carbon_appdir_x+set}" != set; then
-    HAVE_CARBON=no
+    for var in with_x with_x_toolkit with_gtk with_xim \
+               with_xpm with_jpeg with_tiff with_gif with_png; do
+      if eval test \"\${$var+set}\" = set; then
+        HAVE_CARBON=no
+        break
+      fi
+    done
   fi
 fi
 if test "${HAVE_CARBON}" = yes; then
@@ -2410,15 +2429,6 @@ if test "${HAVE_CARBON}" = "yes"; then
   fi
   # We also have mouse menus.
   HAVE_MENUS=yes
-
-  tmp_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -framework Carbon"
-  AC_CHECK_FUNC(CancelMenuTracking, have_cmt=yes, have_cmt=no)
-  if test "$have_cmt" = yes; then
-    AC_DEFINE(HAVE_CANCELMENUTRACKING, 1,
-              [Define to 1 if CancelMenuTracking is available (Mac OSX).])
-  fi
-  CFLAGS="$tmp_CFLAGS"
 fi
 
 ### Use session management (-lSM -lICE) if available
index 3a04176..4e30b68 100644 (file)
@@ -1,3 +1,53 @@
+2006-12-01  Juanma Barranquero  <lekktu@gmail.com>
+
+       * DEVEL.HUMOR: Another entry.
+
+2006-08-14  Masatake YAMATO  <jet@gyve.org>
+
+       * etags.1: Added / to the end of DEVAR regex.
+
+2006-11-22  Juanma Barranquero  <lekktu@gmail.com>
+
+       * emacsclient.1 (DESCRIPTION): Suggest also `server-mode'.
+       (OPTIONS): Document `-f', `--server-file' and EMACS_SERVER_FILE.
+
+2006-11-20  Michael Olson  <mwolson@gnu.org>
+
+       * NEWS: Change M-x erc-select to M-x erc.
+
+2006-11-20  Sun Yijiang  <sunyijiang@gmail.com>
+
+       * TUTORIAL.cn: Updated.
+
+2006-11-17  Carsten Dominik  <dominik@science.uva.nl>
+
+       * orgcard.tex (section{Agenda Views}): Document `C-k'.
+
+2006-11-13  Carsten Dominik  <dominik@science.uva.nl>
+
+       * orgcard.tex: Version number change.
+
+2006-11-13  Bill Wohler  <wohler@newt.com>
+
+       Release MH-E version 8.0.3.
+
+       * NEWS, MH-E-NEWS: Update for MH-E release 8.0.3.
+
+2006-11-10  Juanma Barranquero  <lekktu@gmail.com>
+
+       * DEVEL.HUMOR: Two more entries.
+
+2006-11-10  Carsten Dominik  <carsten.dominik@gmail.com>
+
+       * orgcard.tex (section{Archiving}): Document C-TAB.
+       (section{TODO Items and Checkboxes}): Checkbox keys moved to this
+       section, added documentation for the key `C-c #'.
+
+2006-11-05  Slawomir Nowaczyk  <slawek@cs.lth.se>  (tiny change)
+
+       * emacs.py (eargs): Provide eldoc message for builtin types.
+         Make sure eargs always outputs sentinel, to avoid Emacs freeze.
+
 2006-10-22  Chong Yidong  <cyd@stupidchicken.com>
 
        * emacs.py (eargs): Return expected _emacs_out string even if
        * PROBLEMS (are): Emacs compiled with Gtk+ crashes when closing a
        display (x-close-connection).
 
+2006-09-03  Diane Murray  <disumu@x3y2z1.net>
+
+       * erc.texi (Getting Started, Connecting): Changed erc-select to
+       erc.
+
 2006-09-02  Juri Linkov  <juri@jurta.org>
 
        * HELLO: Regroup Europe Non-ASCII examples by similar scripts.
 
 ;; Local Variables:
 ;; coding: iso-2022-7bit
+;; add-log-time-zone-rule: t
 ;; End:
 
     Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001
index 94d8640..296d03d 100644 (file)
@@ -136,3 +136,35 @@ without attempting any course of action that requires an advance
 course in divination.
    There'd be quite a sensational market for that, you know."
                                     -- Emilio Lopes and David Kastrup
+
+----------------------------------------------------------------------
+
+  "[T]here may be a good reason since the code explicitly checks for
+this; see keyboard.c:789 [...]"
+  "I think I understand, but I can't find the code in keyboard.c.  Do
+you really mean 'line 789'?  Of which revision?"
+  "Sorry; by 789, I mean 3262 :-P"
+                                   -- Chong Yidong and Stefan Monnier
+
+----------------------------------------------------------------------
+
+  "[...] In my opinion, your change does not either increase or
+decrease readability.  It's a tossup."
+  "Uh, setting tem to '', an artificial empty string, in order to have
+j incremented once again before breaking out of the finished loop is
+readable?
+   Is this kind of 'readable' synonymous to 'comprehensible with
+serious effort', reminiscent of mathematicians' use of 'trivial' as
+synonymous with 'provable with serious effort'?"
+                                              -- RMS and David Kastrup
+
+----------------------------------------------------------------------
+
+Re: New Emacs Icon and Tango
+
+  "What about using the 'happy face' with gnu horns?"
+  "It would make Emacs the object of ridicule until the end of time."
+  "Isn't it already?"
+  "It's the object of ridicule until the end of _tape_.  The jury is
+still out about that end of time thing."
+                 -- Kim F. Storm, Miles Bader, RMS and David Kastrup
index 3a026ee..cce4447 100644 (file)
@@ -1,5 +1,21 @@
 ERC NEWS                                                       -*- outline -*-
 
+* Changes in ERC 5.2 (stable pre-release for Emacs 22)
+
+** M-x erc RET now starts ERC.
+`erc-select' has been changed to `erc'.  `erc-select' still remains as
+an alias of `erc'. Likewise, `erc-select-ssl' has been renamed to
+`erc-ssl' with `erc-select-ssl' as its alias.  The function that was
+known as `erc' is now `erc-open'.
+
+** Changes and additions to modules
+
+*** Channel tracking (erc-track.el)
+
+**** Use mouse-face and help-echo for channel names in the mode-line.
+This helps people using a mouse know that they are buttons and can be
+clicked on.
+
 * Changes in ERC 5.1.4
 
 ** Make find-function and find-variable work in Emacs 22 for
index 061b622..8b353fd 100644 (file)
@@ -6,6 +6,33 @@ Copying and distribution of this file, with or without modification,
 are permitted in any medium without royalty provided the copyright
 notice and this notice are preserved.
 
+* Changes in MH-E 8.0.3
+
+Version 8.0.3 fixes errors in sending messages and in running spam
+filter commands in certain circumstances.
+
+** Bug Fixes in MH-E 8.0.3
+
+*** mh-send-args Cannot Be nil
+
+If `mh-send-uses-spost-flag' was set, an error would prevent the
+sending of messages. This has been fixed (closes SF #1564742).
+
+*** Missing Quotes in sa-learn Command Line
+
+This has been fixed (closes SF #1565460).
+
+*** Errors Associated with mh-junk-background
+
+The Spamassassin filter commands were used inconsistently and
+incorrectly; if `mh-junk-background' were nil, not all of the updating
+would happen correctly. In the other back-ends such as bogofilter and
+SpamProbe, a value of t for `mh-junk-background' would cause the
+commands associated with these filters to fail. These problems have
+been fixed (closes SF #1594802).
+
+\f
+
 * Changes in MH-E 8.0.2
 
 Version 8.0.2 fixes the tool bar and `F n' on XEmacs, and `K a' on GNU
index 94458c1..6d740c3 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -299,7 +299,8 @@ have been moved to C-h F, C-h K and C-h S.
 See below under "incremental search changes".
 
 ---
-** C-x C-f RET, typing nothing in the minibuffer, is no longer a special case.
+** C-x C-f RET (find-file), typing nothing in the minibuffer, is no longer
+a special case.
 
 Since the default input is the current directory, this has the effect
 of specifying the current directory.  Normally that means to visit the
@@ -1033,6 +1034,21 @@ jit-lock-defer-contextually is renamed jit-lock-contextually and
 jit-lock-context-time determines the delay after which contextual
 refontification takes place.
 
+---
+*** lazy-lock is considered obsolete.
+
+The `lazy-lock' package is superseded by `jit-lock' and is considered
+obsolete.  `jit-lock' is activated by default; if you wish to continue
+using `lazy-lock', activate it in your ~/.emacs like this:
+
+  (setq font-lock-support-mode 'lazy-lock-mode)
+
+If you invoke `lazy-lock-mode' directly rather than through
+`font-lock-support-mode', it now issues a warning:
+
+  "Use font-lock-support-mode rather than calling lazy-lock-mode"
+
+
 ** Menu support:
 
 ---
@@ -1184,7 +1200,7 @@ characters instead, depending on how the terminal (or terminal
 emulator) works.  Use `set-keyboard-coding-system' (or customize
 keyboard-coding-system) if you prefer META to work (the old default)
 or if the locale doesn't describe the character set actually generated
-by the keyboard.  See Info node `Single-Byte Character Support'.
+by the keyboard.  See Info node `Unibyte Mode'.
 
 +++
 *** The new command `revert-buffer-with-coding-system' (C-x RET r)
@@ -1454,8 +1470,11 @@ otherwise behaves quite similarly to the bash version.
 but declared obsolete.
 
 +++
-*** The EMACS environment variable now defaults to Emacs's absolute
-file name, instead of to "t".
+*** The new INSIDE_EMACS environment variable is set to "t" in
+subshells running inside Emacs.  This supersedes the EMACS environment
+variable, which will be removed in a future Emacs release.  Programs
+that need to know whether they are started inside Emacs should check
+INSIDE_EMACS instead of EMACS.
 
 ** M-x Compile changes:
 
@@ -1686,8 +1705,8 @@ ERC is a powerful, modular, and extensible IRC client for Emacs.
 To see what modules are available, type
 M-x customize-option erc-modules RET.
 
-To start an IRC session, type M-x erc-select, and follow the prompts
-for server, port, and nick.
+To start an IRC session, type M-x erc, and follow the prompts for
+server, port, and nick.
 
 ---
 ** Rcirc is now part of the Emacs distribution.
@@ -3279,7 +3298,7 @@ See the file GNUS-NEWS or the node "Oort Gnus" in the Gnus manual for details.
 ---
 ** MH-E changes.
 
-Upgraded to MH-E version 8.0.2.  There have been major changes since
+Upgraded to MH-E version 8.0.3.  There have been major changes since
 version 5.0.2; see MH-E-NEWS for details.
 
 ** Calendar changes:
index 7592ba6..c5d0db9 100644 (file)
@@ -1280,6 +1280,11 @@ be carried out at the same time:
    For more about lbxproxy, see:
    http://www.xfree86.org/4.3.0/lbxproxy.1.html
 
+5) If copying and killing is slow, try to disable the interaction with the
+   native system's clipboard by adding these lines to your .emacs file:
+     (setq interprogram-cut-function nil)
+     (setq interprogram-paste-function nil)
+
 *** Emacs gives the error, Couldn't find per display information.
 
 This can result if the X server runs out of memory because Emacs uses
@@ -2322,7 +2327,16 @@ This results from a bug in a VERY old version of GNU Sed.  To solve
 the problem, install the current version of GNU Sed, then rerun
 Emacs's configure script.
 
-*** Building the MS-Windows port with Cygwin GCC can fail.
+*** Building the Cygwin port for MS-Windows can fail with some GCC version
+
+Building Emacs 22 with Cygwin builds of GCC 3.4.4-1 and 3.4.4-2 is
+reported to either fail or cause Emacs to segfault at run time.  In
+addition, the Cygwin GCC 3.4.4-2 has problems with generating debug
+info.  Cygwin users are advised not to use these versions of GCC for
+compiling Emacs.  GCC versions 4.0.3 and 4.1.1 reportedly build a
+working Cygwin binary of Emacs, so we recommend these GCC versions.
+
+*** Building the native MS-Windows port with Cygwin GCC can fail.
 
 Emacs may not build using recent Cygwin builds of GCC, such as Cygwin
 version 1.1.8, using the default configure settings.  It appears to be
index 1f837a3..e8f61b5 100644 (file)
--- a/etc/TODO
+++ b/etc/TODO
@@ -487,6 +487,10 @@ but which can also be used as a modifier).
    <http://lists.gnu.org/archive/html/emacs-devel/2006-02/msg01034.html>.
    [rgm@gnu.org will look at this after 22.1]
 
+** Possibly make cal-dst use the system timezone database directly.
+   See thread
+   <http://lists.gnu.org/archive/html/emacs-pretest-bug/2006-11/msg00060.html>
+
 * Internal changes
 
 ** Replace gmalloc.c with the modified Doug Lea code from the current
index 7ba8d80..3152527 100644 (file)
@@ -17,7 +17,7 @@ META 
 ÖØÒªÌáʾ£ºÒªÍ˳ö Emacs£¬ÇëÓàC-x C-c£¨Á½¸öÁ¬ÐøµÄ×éºÏ¼ü£©¡£ÏÂÎÄÖÐ×ó±ß¶¥
 Ðеġ°>>¡±×ÖÑùÓÃÀ´ÌáʾÄã³¢ÊÔ¼üÅÌÃüÁî¡£±ÈÈ磺
 <<Blank lines inserted around following line by help-with-tutorial>>
-[±¾Ò³µ±ÖÐÌØÒâÁô³öһЩ¿Õ°×ÊdzöÓÚ½ÌѧĿµÄ£¬Çë¼ÌÐøÍùºó¿´]
+[±¾Ò³µ±ÖÐÌØÒâÁô³öһЩ¿Õ°×ÊdzöÓÚ½ÌѧĿµÄ£¬Çë¼ÌÐøÍùºóÔĶÁ]
 >> ÏÖÔÚÊäÈë C-v £¨²é¿´ÏÂÒ»ÆÁÎÄ×Ö£©Òƶ¯µ½ÏÂÒ»ÆÁ¡£
    £¨±ð½ôÕÅ£¬ÔÚÊäÈë×Ö·û v µÄͬʱעÒâÒª°´×¡ CONTROL ¼ü£©
    ´ÓÏÖÔÚ¿ªÊ¼£¬Ã¿¶ÁÍ굱ǰһÆÁÄ㶼ÐèÒªÕâÑù×öÒ»´Î¡£
@@ -129,8 +129,8 @@ P 
         C-f     ÏòÓÒÒƶ¯Ò»¸ö×Ö·û
         C-b     Ïò×óÒƶ¯Ò»¸ö×Ö·û
 
-        M-f     ÏòÓÒÒƶ¯Ò»¸ö´Ê¡¾ÖÐÎÄÊÇÒƶ¯µ½ÏÂÒ»¸ö±êµã·ûºÅ¡¿
-        M-b     Ïò×óÒƶ¯Ò»¸ö´Ê¡¾ÖÐÎÄÊÇÒƶ¯µ½ÉÏÒ»¸ö±êµã·ûºÅ¡¿
+        M-f     ÏòÓÒÒƶ¯Ò»¸ö´Ê¡¾¶ÔÖÐÎÄÊÇÒƶ¯µ½ÏÂÒ»¸ö±êµã·ûºÅ¡¿
+        M-b     Ïò×óÒƶ¯Ò»¸ö´Ê¡¾¶ÔÖÐÎÄÊÇÒƶ¯µ½ÉÏÒ»¸ö±êµã·ûºÅ¡¿
 
         C-n     Òƶ¯µ½ÏÂÒ»ÐÐ
         C-p     Òƶ¯µ½ÉÏÒ»ÐÐ
@@ -212,14 +212,14 @@ C-g 
 
 Èç¹ûÄ㲻СÐÄ°´ÁËһϠ<ESC>£¬ÄãÒ²¿ÉÒÔÓàC-g À´È¡ÏûËü¡£
 ¡¾Õâ¸ö˵·¨ËƺõÓÐÎÊÌ⣬ÒòΪ°´ÕÕÕâ¸ö°´¼ü˳ÐòÊäÈëµÄÓ¦¸ÃÊÇ C-M-g¡£
-  È¡Ïû<ESC> µÄÕýÈ·×ö·¨ÊÇÔÙÁ¬°´Á½´Î <ESC>¡£¡¿
+  È¡Ïû <ESC> µÄÕýÈ·×ö·¨ÊÇÔÙÁ¬°´Á½´Î <ESC>¡£¡¿
 
 
 * ±»½ûÓõÄÃüÁDISABLED COMMANDS£©
 -----------------------------------
 
 ÓÐһЩ Emacs ÃüÁî±»¡°½ûÓá±ÁË£¬ÒÔ±ÜÃâ³õѧÕßÔÚ²»Á˽âÆäÈ·Çй¦ÄܵÄÇé¿öÏÂÎó
-ÓÃËüÃÇ£¬Ôì³ÉÂé·³¡£
+ÓöøÔì³ÉÂé·³¡£
 
 Èç¹ûÄãÓõ½ÁËÒ»¸ö±»½ûÓõÄÃüÁEmacs »áÏÔʾһ¸öÌáʾÏûÏ¢£¬¸æËßÄãÕâ¸öÃüÁî
 µ½µ×ÊǸÉʲôµÄ£¬Ñ¯ÎÊÄãÊÇ·ñÒª¼ÌÐø£¬²¢Ôڵõ½ÄãµÄ¿Ï¶¨Ö®ºóÔÙÖ´ÐÐÕâÃüÁî¡£
@@ -234,10 +234,10 @@ C-g 
 * ´°¸ñ£¨WINDOWS£©
 -----------------
 
-Emacs ¿ÉÒÔÓжà¸ö´°¸ñ£¬Ã¿¸ö´°¸ñ¶¼ÏÔʾ²»Í¬µÄÎÄ×Ö¡£ÎÒÃǺóÃæÔÙ½éÉÜÔõô¶Ô¸¶
-¶à¸ö´°¸ñ£¬ÏÖÔÚÏÈÈÃÎÒÃÇÏȸãÃ÷°×ÈçºÎ¹Øµô¶àÓàµÄ´°¸ñ¡£ÆäʵҲºÜ¼òµ¥£º
+Emacs ¿ÉÒÔÓжà¸ö´°¸ñ£¬Ã¿¸ö´°¸ñÏÔʾ²»Í¬µÄÎÄ×Ö¡£ºóÃæ»á½éÉÜÔõô¶Ô¸¶¶à¸ö´°
+¸ñ£¬ÏÖÔÚÎÒÃÇÏÈѧ»áÈçºÎ¹Øµô¶àÓàµÄ´°¸ñ¡£ÆäʵҲºÜ¼òµ¥£º
 
-        C-x 1   Ö»±£ÁôÒ»¸ö´°¸ñ£¨Ò²¾ÍÊǹصôÆäËûËùÓеĴ°¸ñ£©¡£
+        C-x 1   Ö»±£ÁôÒ»¸ö´°¸ñ£¨Ò²¾ÍÊǹصôÆäËüËùÓд°¸ñ£©¡£
 
 Ò²¾ÍÊÇÏÈ°´ CONTROL-x È»ºóÔÙ°´ 1¡£C-x 1 »á±£Áô¹â±êËùÔڵĴ°¸ñ£¬²¢½«ÆäÀ©´ó
 µ½Õû¸öÆÁÄ»£¬Í¬Ê±¹ØµôËùÓÐÆäËüµÄ´°¸ñ¡£
@@ -245,33 +245,34 @@ Emacs 
 >> °Ñ¹â±êÒƵ½±¾ÐÐÈ»ºóÊäÈë C-u 0 C-l¡£
 
 >> ÊäÈë CONTROL-h k CONTROL-f¡£¹Û²ìµ±Ò»¸öд°¸ñ³öÏÖʱµ±Ç°´°¸ñ£¨ÓÃÀ´ÏÔʾ
-   CONTROL-f ÃüÁîµÄÎĵµ£©ÊÇÈçºÎ±äСµÄ¡£
+   CONTROL-f ÃüÁîµÄÎĵµ£©ÊÇÈçºÎËõСµÄ¡£
 
 >> ÊäÈë C-x 1 ¹ØµôÎĵµ´°¸ñ¡£
 
-Õâ¸öÃüÁî¸úÏÈǰѧµ½µÄÃüÁ̫һÑù£¬ÒòΪËü°üº¬ÁËÁ½¸ö×Ö·û£¬ÒÔ CONTROL-x ¿ª
+Õâ¸öÃüÁî¸úÏÈǰѧ¹ýµÄÃüÁ̫һÑù£¬ÒòΪËü°üº¬ÁËÁ½¸ö×Ö·û£¬ÒÔ CONTROL-x ¿ª
 Ê¼¡£ÓÐһϵÁÐÃüÁÊÇÒÔ CONTROL-x ¿ªÊ¼µÄ£¬ÕâЩÃüÁîÐí¶à¶¼¸ú¡°´°¸ñ¡¢Îļþ¡¢
 »º³åÇø¡¾»º³åÇø£¨buffer£©»áÔÚºóÎÄÏêϸ½éÉÜ¡¿¡±µÈµÈÖîÈç´ËÀàµÄ¶«Î÷Óйأ¬Æä
-ÖÐÓÐЩÃüÁî¿ÉÄÜÓР2 ¸ö¡¢3 ¸ö»òÕß 4 ¸ö×Ö·û³¤¡£
+ÖÐÓÐЩÃüÁî¿ÉÄÜ°üº¬ÁË 2 ¸ö¡¢3 ¸ö»òÕß 4 ¸ö×Ö·û¡£
 
 
 * ²åÈëÓëɾ³ý£¨INSERTING AND DELETING£©
 --------------------------------------
 
-²åÈëÎÄ×ֺܼòµ¥£¬ÇüüÅ̾ÍÐÐÁË¡£ÄãÄÜ¿´µ½µÄ×Ö·û£¬±ÈÈç A¡¢7¡¢* µÈµÈ£¬¶¼±»
-Emacs ÊÓΪÎÄ×Ö²¢ÇÒ¿ÉÒÔÖ±½Ó²åÈë¡£Çà<Return>£¨»Ø³µ¼ü£©»á²åÈëÒ»¸ö»»Ðзû¡£
+²åÈëÎÄ×ֺܼòµ¥£¬Ö±½ÓÇüüÅ̾ͿÉÒÔÁË¡£ÄãÄÜ¿´µ½µÄ×Ö·û£¬±ÈÈç A¡¢7¡¢* µÈµÈ£¬
+¶¼±» Emacs ÊÓΪÎÄ×Ö²¢ÇÒ¿ÉÒÔÖ±½Ó²åÈë¡£Çà<Return>£¨»Ø³µ¼ü£©»á²åÈëÒ»¸ö»»
+Ðзû¡£
 
-Äã¿ÉÒÔÓà<Delback> À´É¾³ý×îºóÊäÈëµÄµÄÒ»¸ö×Ö·û£¬Õâ¸ö¸úÄãÔÚ Emacs Ö®ÍâµÄ
-Ó÷¨Ó¦¸ÃÒ»Ñù¡£Ò»°ãÀ´Ëµ <Delback> ¾ÍÊÇλÓÚ <Return> ¼üÉÏ·½Ä³´¦µÄÒ»¸ö´óºÅ
-¼ü£¬Í¨³£±»±êʾΪ¡°Delete¡±¡¢¡°Del¡±»òÕß¡°Backspace¡±¡£
+Äã¿ÉÒÔÓà<Delback> À´É¾³ý×îºóÊäÈëµÄÒ»¸ö×Ö·û£¬Õâ¸ö¸úÄãÔÚ Emacs Ö®ÍâµÄÓÃ
+·¨Ó¦¸ÃÒ»Ñù¡£Ò»°ãÀ´Ëµ <Delback> ¾ÍÊÇλÓÚ <Return> ¼üÉÏ·½Ä³´¦µÄÒ»¸ö´ó¿éÍ·
+µÄ¼ü£¬Í¨³£±»±êʾΪ¡°Delete¡±¡¢¡°Del¡±»òÕß¡°Backspace¡±¡£
 
-Èç¹ûÄãÕÒµ½ÁË¡°Backspace¡±¼ü£¬ÄÇôËüÓ¦¸Ã¾ÍÊÇ <Delback>£»ÄÄÅÂÄãÓÖÔÚ±ðµÄµØ
-·½ÕÒµ½ÁËÒ»¸ö¡°Del¡±¼ü£¬ÄÇôËüÒ²Ó¦¸Ã²»ÊÇ <Delback>¡£
+Èç¹ûÄãÕÒµ½ÁË¡°Backspace¡±¼ü£¬ÄÇôËüÓ¦¸Ã¾ÍÊÇ <Delback>£»ÕâʱÄÄÅÂÄãÓÖÔÚ±ð
+µÄµØ·½ÕÒµ½ÁËÒ»¸ö¡°Del¡±¼ü£¬ÄÇôËüÒ²Ó¦¸Ã²»ÊÇ <Delback>¡£
 
 Ò»ÖÖ¸üͨÓõÄ˵·¨ÊÇ£¬<Delback> ½«É¾³ýλÓÚ¹â±êÇ°µÄÒ»¸ö×Ö·û¡£
 
->> ÏÖÔÚ¾ÍÊÔÊÔ¡ª¡ªÇõã×Ö£¬È»ºó°´¼¸Ï <Delback> É¾³ýËüÃÇ¡£
-   ²»Óõ£ÐÄÄã»áÐÞ¸ÄÎļþ£¬Äã¸Éʲô¶¼Ã»¹Øϵ£¬ÕâÀï¾ÍÊÇר¸øÄãÁ·Ï°Óõġ£
+>> ÏÖÔÚ¾ÍÀ´ÊÔÊÔ¡ª¡ªÇõã×Ö£¬È»ºó°´¼¸Ï <Delback> É¾³ýËüÃÇ¡£
+   ²»Óõ£ÐÄÎļþ±»Ð޸ģ¬Äã×öʲô¶¼Ã»¹Øϵ£¬ÕâÀï¾ÍÊÇר¸øÄãÁ·Ï°Óõġ£
 
 Èç¹ûÒ»ÐÐÎÄ×ֺܳ¤¡¢³¬³öÁË´°¸ñµÄ¿í¶È£¬ÏÔʾ²»ÏµIJ¿·Ö»áÔÚ½ôÁÚµÄÏÂÒ»ÐмÌÐø
 ÏÔʾ¡£Õâʱ»áÓÐÒ»¸ö·´Ð±Ïߣ¨ÔÚ¿ØÖÆ̨ÏÂÊÇ·´Ð±Ïߣ¬Èç¹ûÄãÓÃͼÐδ°¿Úϵͳ£¬Ôò
@@ -281,7 +282,7 @@ Emacs 
 
 >> Óà<Delback> É¾µôһЩÎÄ×Ö£¬Ö±µ½´ËÐ㤶ÈСÓÚ´°¸ñ¿í¶È£¬½ÓÐøÐоÍÏûʧÁË¡£
 
-»»Ðзû¸úÆäËû×Ö·ûÒ»Ñù¿ÉÒÔ±»É¾³ý¡£Á½ÐÐÖмäµÄ»»Ðзû±»É¾³ýºó£¬ÕâÁ½Ðн«»áºÏ
+»»Ðзû¸úÆäËü×Ö·ûÒ»Ñù¿ÉÒÔ±»É¾³ý¡£Á½ÐÐÖмäµÄ»»Ðзû±»É¾³ýºó£¬ÕâÁ½Ðн«»áºÏ
 ²¢³ÉÒ»ÐС£Èç¹ûºÏ²¢ºóµÄÕâÒ»ÐÐÌ«³¤£¬³¬³öÁË´°¸ñ¿í¶È£¬Ëü¾Í»áÒÔÒ»¸ö½ÓÐøÐÐÀ´
 ÏÔʾ¡£
 
@@ -315,24 +316,24 @@ Emacs 
 ºÍ M-k µÄ¹ØϵÔÚijÖ̶ֳÈÉÏÓë C-e ºÍ M-e Ò»Ñù¡ª¡ªÈç¹û°Ñ¡°Ò»ÐС±ºÍ¡°Ò»¾ä¡±
 ×÷Ò»¸öÀà±ÈµÄ»°¡£
 
-ÄãÒ²¿ÉÒÔÓÃÒ»ÖÖͳһµÄ°ì·¨À´ÒƳý»º³åÇøÀïµÄÈκÎÒ»²¿·Ö£ºÊ×ÏȰѹâ±êÒƶ¯µ½Äã
+ÄãÒ²¿ÉÒÔÓÃÒ»ÖÖͨÓõİ취À´ÒƳý»º³åÇøÀïµÄÈκÎÒ»²¿·Ö£ºÊ×ÏȰѹâ±êÒƶ¯µ½Äã
 ÏëÒªÒƳýµÄÇøÓòµÄÒ»¶Ë£¬È»ºó°´ C-@ »ò C-SPC£¨ÈÎÒ»¼´¿É£¬SPCÖ¸¿Õ¸ñ£©¡¾×¢Ò⣬
 C-SPC ÍùÍù±»ÖÐÎÄÓû§É趨³ÉÊäÈë·¨Èȼü£¬Èç¹ûÕâÑù£¬C-SPC ¾Í±»ÏµÍ³À¹½Ø¶øÎÞ
-·¨ÊäÈë¸ø Emacs ÁË£¬Òò´ËÕâÀﻹÊÇÍƼöʹÓÃC-@¡£¡¿£¬È»ºóÔÙÒƶ¯µ½ÁíÒ»¶Ë£¬ÔÙ
-°´ C-w ¾Í¿ÉÒÔ°ÑλÓÚÕâÁ½µãÖ®¼äµÄËùÓÐÎÄ×ÖÒƳýÁË¡£
+·¨´«µÝ¸ø Emacs ÁË£¬Òò´ËÕâÀﻹÊÇÍƼöʹÓÃC-@¡£¡¿£¬È»ºó½«¹â±êÒƶ¯µ½ÁíÒ»¶Ë£¬
+ÔÙ°´ C-w ¾Í¿ÉÒÔ°ÑλÓÚÕâÁ½µãÖ®¼äµÄËùÓÐÎÄ×ÖÒƳýÁË¡£
 
 >> Òƶ¯¹â±êµ½ÉÏÒ»¶Î¿ªÍ·µÄ¡°Ä㡱×Ö¡£
 >> ÊäÈë C-@ ¡£Emacs Ó¦¸Ã»áÔÚÆÁÄ»µÄÏ·½ÏÔʾһ¸ö¡°Mark set¡±µÄÏûÏ¢¡£
 >> Òƶ¯¹â±êµ½µÚ¶þÐÐÖеġ°¶Ë¡±×Ö¡£
->> ÊäÈë C-w£¬¾Í»á°Ñ´Ó¡°Ä㡱¿ªÊ¼µ½¡°¶Ë¡±Ö®Ç°µÄÎÄ×ÖÈ«²¿ÒƳý¡£
+>> ÊäÈë C-w£¬´Ó¡°Ä㡱¿ªÊ¼µ½¡°¶Ë¡±Ö®Ç°µÄÎÄ×Ö±»È«²¿ÒƳý¡£
 
 ×¢Òâ,¡°ÒƳý£¨kill£©¡±ºÍ¡°É¾³ý£¨delete£©¡±µÄ²»Í¬ÔÚÓÚ±»ÒƳýµÄ¶«Î÷¿ÉÒÔÕÒ»Ø
 À´£¬¶ø±»É¾³ýµÄ¾Í²»ÐÐÁË¡£¡¾Êµ¼ÊÉÏ£¬ÒƳýµôµÄ¶«Î÷ËäÈ»¿´ÆðÀ´¡°Ïûʧ¡±ÁË£¬µ«
 Êµ¼ÊÉϱ» Emacs ¼Ç¼ÁËÏÂÀ´£¬Òò´Ë»¹¿ÉÒÔÕÒ»ØÀ´£»¶øɾ³ýµôµÄ¶«Î÷ËäȻҲ¿ÉÄÜ»¹
 ÔÚÄÚ´æÀµ«ÊÇÒѾ­±» Emacs¡°Å×Æú¡±ÁË£¬ËùÒÔ¾ÍÕÒ²»»ØÀ´ÁË¡£¡¿ÖØвåÈë±»ÒÆ
-³ýµÄÎÄ×Ö³ÆΪ¡°Õٻأ¨yank£©¡±¡£Ò»°ã¶øÑÔ£¬ÄÇЩ»áÈ¥³ýºÜ¶àÎÄ×ÖµÄÃüÁî»á°ÑÈ¥
-³ýµôµÄÎÄ×Ö´¢´æÆðÀ´£¨ËüÃDZ»É趨³ÉÁË¡°¿ÉÕٻء±£©£¬¶øÄÇЩֻÊÇÈ¥³ýÒ»¸ö×Ö·û
-»òÕßÖ»ÊÇÈ¥³ý¿Õ°×µÄÃüÁî¾Í²»»á´¢´æ±»È¥³ýµôµÄ¶«Î÷£¨×ÔÈ»Äã¾ÍÎÞ·¨ÕÙ»ØÁË£©¡£
+³ýµÄÎÄ×Ö³ÆΪ¡°Õٻأ¨yank£©¡±¡£Ò»°ã¶øÑÔ£¬ÄÇЩ¿ÉÄÜÏû³ýºÜ¶àÎÄ×ÖµÄÃüÁî»á°Ñ
+Ïû³ýµôµÄÎÄ×ּǼÏÂÀ´£¨ËüÃDZ»É趨³ÉÁË¡°¿ÉÕٻء±£©£¬¶øÄÇЩֻÏû³ýÒ»¸ö×Ö·û
+»òÕßÖ»Ïû³ý¿Õ°×µÄÃüÁî¾Í²»»á¼Ç¼±»Ïû³ýµÄÄÚÈÝ£¨×ÔÈ»ÄãÒ²¾ÍÎÞ·¨ÕÙ»ØÁË£©¡£
 
 >> Òƶ¯¹â±êµ½Ò»·Ç¿Õ°×ÐеÄÐÐÍ·£¬È»ºóÊäÈë C-k ÒƳýÄÇÒ»ÐÐÉϵÄÎÄ×Ö¡£
 
@@ -344,9 +345,9 @@ C-SPC 
 C-k »á°ÑÁ½ÐÐÒÔ¼°ËüÃǵĻ»ÐзûÒƳý£»¶øÈç¹ûÖ»ÊÇÊäÈë C-k Á½´ÎÏÔÈ»²»ÊÇÕâ¸ö½á
 ¹û¡£
 
-½«±»ÒƳýµÄÎÄ×Ö»Ö¸´µÄ¶¯×÷³ÆΪ¡°Õٻأ¨yanking£©¡±¡££¨¾ÍºÃÏñÄã°Ñ±ðÈË´ÓÄãÉí
-±ßÒÆ×ߵĶ«Î÷ÓÖÃÍÁ¦µØÀ­»ØÀ´¡££©Äã¿ÉÒÔÔÚÄãɾ³ýÎÄ×ֵĵط½Õٻأ¬Ò²¿ÉÒÔÔÚ±ð
ĵØ·½Õٻأ¬»¹¿ÉÒÔ¶à´ÎÕÙ»ØͬÑùµÄÎÄ×ÖÒԵõ½ËüµÄ¶à¸ö¿½±´¡£
+½«±»ÒƳýµÄÎÄ×Ö»Ö¸´µÄ¶¯×÷³ÆΪ¡°Õٻأ¨yanking£©¡±¡££¨¾ÍºÃÏñ°Ñ±ðÈË´ÓÄãÉí±ß
+ÒÆ×ߵĶ«Î÷ÓÖÃÍÁ¦µØÀ­»ØÀ´¡££©Äã¿ÉÒÔÔÚÄãɾ³ýÎÄ×ֵĵط½Õٻأ¬Ò²¿ÉÒÔÔÚ±ðµÄ
+µØ·½Õٻأ¬»¹¿ÉÒÔ¶à´ÎÕÙ»ØͬÑùµÄÎÄ×ÖÒԵõ½ËüµÄ¶à¸ö¿½±´¡£
 
 ÕٻصÄÃüÁîÊÇ C-y¡£Ëü»áÔÚ¹â±êËùÔÚ´¦²åÈëÄã×îºóÒƳýµÄÎÄ×Ö¡£
 
@@ -362,13 +363,13 @@ C-y 
 >> °´ C-y¡£È»ºó°Ñ¹â±êÍùÏÂÒƶ¯¼¸ÐУ¬ÔÙ°´Ò»´Î C-y¡£
    ÏÖÔÚÄãÓ¦¸ÃÖªµÀÔõô¸´ÖÆÎÄ×ÖÁË¡£
 
-C-y ¿ÉÒÔ°Ñ×î½üÒƳýµÄÎÄ×ÖÕٻأ¬µ«Èç¹ûÄãÏëÕٻصĶ«Î÷²»ÊÇ×î½üÒƳýµÄ£¬¸ÃÔõ
´°ìÄØ£¿ËüÃǵ±È»Ã»Óжª£¬Äã¿ÉÒÔÓàM-y À´ÕÙ»ØËüÃÇ¡£ÔÚÓàC-y ÕÙ»Ø×î½üÒƳý
-µÄÎÄ×ÖÖ®ºó£¬½ô½Ó×ÅÔÙÓàM-y ¾Í¿ÉÒÔÕÙ»ØÔÙÇ°Ò»´Î±»ÒƳýµÄÎÄ×Ö£¬ÔÙ°´Ò»´Î
-M-y ÓÖ¿ÉÒÔÕÙ»ØÔÙÉÏÒ»´ÎµÄ£¬Òò´ËÖ»Òª¶à°´¼¸´Î M-y ¾Í¿ÉÒÔÕÒµ½ÄãÏëÒªÕٻصĶ«
-Î÷ÁË¡£ÕÒµ½ÁËÖ®ºó£¬ÄãʲôҲ²»ÓÃ×ö£¬°ÑËüÃÇÁÀÔÚÄÇÀ¼ÌÐøÄãµÄ±à¼­¾ÍÐÐÁË¡£
+C-y ¿ÉÒÔÕÙ»Ø×î½üÒ»´ÎÒƳýµÄÄÚÈÝ£¬ÄÇÈçºÎÕÙ»ØÇ°¼¸´ÎÒƳýµÄÄÚÈÝÄØ£¿ËüÃǵ±È»
»Óжª£¬Äã¿ÉÒÔÓàM-y À´ÕÙ»ØËüÃÇ¡£ÔÚÓàC-y ÕÙ»Ø×î½üÒƳýµÄÎÄ×ÖÖ®ºó£¬½ô½Ó
+×ÅÔÙ°´ M-y ¾Í¿ÉÒÔÕÙ»ØÔÙÇ°Ò»´Î±»ÒƳýµÄÄÚÈÝ£¬ÔÙ°´Ò»´Î M-y ÓÖ¿ÉÒÔÕÙ»ØÔÙÉÏ
+Ò»´ÎµÄ¡­¡­Á¬ÐøʹÓàM-y Ö±µ½ÕÒµ½ÄãÏëÒªÕٻصĶ«Î÷£¬È»ºóʲôҲ²»ÓÃ×ö£¬¼ÌÐø
+±à¼­¾ÍÐÐÁË¡£
 
-Èç¹ûÄãÒ»´Î°´ M-y °´Á˺ܶàÏ£¬Äã¿ÉÄÜ»á»Øµ½Æðʼµã£¬Ò²¾ÍÊÇ×î½üÒƳýµÄÎÄ×Ö¡£
+Èç¹ûÁ¬Ðø°´ M-y ºÜ¶à´Î£¬Äã¿ÉÄÜ»á»Øµ½Æðʼµã£¬Ò²¾ÍÊÇ×î½üÒƳýµÄÎÄ×Ö¡£
 ¡¾¿´µÃ³öÕâʵ¼ÊÉÏÊÇÒ»¸ö»·¡£¡¿
 
 >> ÒƳýÒ»ÐУ¬Òƶ¯Ò»Ï¹â±ê£¬È»ºóÔÙÒƳýÁíÍâÒ»ÐС£
@@ -376,7 +377,7 @@ M-y 
    ½ô½Ó×ÅÔÙ°´ M-y£¬Ëü½«»á±»µÚÒ»´ÎÒƳýµÄÄÇÐÐÈ¡´ú¡£
    ÊÔ×ÅÔÙ°´¼¸Ï M-y ¿´¿´»á·¢Éúʲô¡£
    ÔÙ¼ÌÐø£¬Ö±µ½µÚ¶þÐб»ÕÙ»ØÀ´£¬È»ºóÔÙ×ö¸ö¼¸´Î¡£
-   Èç¹ûÄãÔ¸Ò⣬Äã¿ÉÒÔÊÔןø M-y Ö¸¶¨Ò»¸öÕýµÄ»ò¸ºµÄ²ÎÊý¡£
+   Èç¹û¸ÐÐËȤ£¬Äã¿ÉÒÔÊÔןø M-y Ö¸¶¨Ò»¸öÕýµÄ»ò¸ºµÄ²ÎÊý¡£
 
 
 * ³·Ïú£¨UNDO£©
@@ -405,24 +406,24 @@ C-_ Ҳ
 * Îļþ£¨FILE£©
 --------------
 
-Ïë±£´æ¹¤×÷³É¹û¾ÍÒª¼ÇµÃ´æÅÌ£¬·ñÔòÒ»µ©Í˳ö Emacs Äã±à¼­µÄÎÄ×־Ͷ¼¶ªÁË¡£Òª
+Ïë±£´æ¹¤×÷³É¹û¾ÍÒª¼ÇµÃ´æÅÌ£¬·ñÔòÒ»µ©Í˳ö Emacs Äã±à¼­µÄÎÄ×־ͻᶪʧ¡£Òª
 ´æÅÌ£¬¾ÍÒªÔڱ༭ǰ¡°Ñ°ÕÒ¡±µ½Ò»¸ö´æÅÌÎļþ¡££¨Õâ¸ö¹ý³Ìͨ³£Ò²±»³ÆΪ¡°·ÃÎÊ¡±
 Îļþ¡££©
 
-Ñ°ÕÒµ½Ò»¸öÎļþÒâζ×ÅÄã¿ÉÒÔÔÚ Emacs Àï²é¿´Õâ¸öÎļþµÄÄÚÈÝ¡£´ÓºÜ¶à·½Ãæ½²£¬
-Õâ¾ÍµÈÓÚÄãÔÚÖ±½Ó±à¼­Õâ¸öÎļþ¡£µ«ÊÇÄãËù×öµÄÐÞ¸ÄÖ»ÓÐÔÚ¡°´æÅÌ¡±µÄʱºò²Å»á
-±»Ð´ÈëÎļþ¡£Ò²ÕýÒòΪÈç´Ë£¬Äã¿ÉÒÔ¶ªÆúÒ»¸ö¸Äµ½Ò»°ëµÄÎļþ¶ø²»±Ø°ÑÕâ¸ö²Ðȱ
-ÎļþÒ²±£´æµ½¼ÆËã»úÉÏ¡£×îºó¾ÍËãÄãÕæÕý´æÁËÅÌ£¬Emacs Ò²»á°Ñ´æÅÌÇ°µÄÎļþÖØ
-ÃüÃû±£´æ£¬ÒÔ·ÀÄã¸ÄÍêÖ®ºóÓÖÏë·´»Ú¡£
+Ñ°ÕÒµ½Ò»¸öÎļþÒâζ×ÅÄã¿ÉÒÔÔÚ Emacs Àï²é¿´Õâ¸öÎļþµÄÄÚÈÝ¡£´ÓÐí¶à½Ç¶È¿´£¬
+Õâ¾ÍµÈÓÚÄãÔÚÖ±½Ó±à¼­Õâ¸öÎļþ£¬Ö»ÊÇÄãËù×öµÄÐÞ¸ÄÖ»ÓÐÔÚ¡°´æÅÌ¡±µÄʱºò²Å»á
+±»Ð´ÈëÎļþ¡£Ò²ÕýÒòΪÈç´Ë£¬Äã¿ÉÒÔ¶ªÆúÒ»¸öдµ½Ò»°ëµÄÎļþ¶ø²»±Ø°ÑÕâ¸ö²Ðȱ
+ÎļþÒ²±£´æµ½¼ÆËã»úÉÏ¡£ÔÚ´æÅ̵Äʱºò£¬Emacs »á°Ñ´æÅÌÇ°µÄÎļþÖØÃüÃû±£´æ£¬
+ÒÔ·ÀÄã¸ÄÍêÖ®ºóÓÖÏë·´»Ú¡£
 
-ÔÚÆÁÄ»µÄÏ·½£¬ÄãÓ¦¸ÃÄܹ»¿´µ½Í·Î²¶¼ÊǶÌÏß¡°-¡±µÄÒ»ÐУ¬Æ俪ͷͨ³£¶¼ÊÇÖîÈç
-¡°--:-- TUTORIAL.cn¡±ÕâÑùµÄ¶«Î÷£¬ÕâЩÎÄ×־ʹú±íÁËÄ㵱ǰÕýÔÚ·ÃÎʵÄÎļþ¡£
-ÏÖÔÚÄã·ÃÎʵÄÎļþ½Ð¡°TUTORIAL.cn¡±£¬ËüÖ»ÊǸøÄã¸öÈËÁÙʱʹÓõÄÒ»¸ö¿½±´¡£Ö»
-ÒªÄãÓàEmacs Ñ°ÕÒµ½Ò»¸öÎļþ£¬ÎļþÃû¾Í»á³öÏÖÔÚÉÏÊöλÖá£
+ÔÚÆÁÄ»µÄÏ·½£¬ÄãÓ¦¸ÃÄܹ»¿´µ½Í·Î²¶¼ÊǶÌÏß¡°-¡±µÄÒ»ÐУ¬ÐÐÊ×ͨ³£ÊÇһЩÖîÈç
+¡°--:-- TUTORIAL.cn¡±µÄÎÄ×Ö£¬ÕâЩÎÄ×Ö´ú±íÁËÄ㵱ǰÕýÔÚ·ÃÎʵÄÎļþ¡£±ÈÈçÄã
+ÏÖÔÚÕýÔÚ·ÃÎʵÄÎļþ½Ð¡°TUTORIAL.cn¡±£¬ËüÖ»ÊÇÒ»¸ö¸øÄãÁÙʱʹÓõĿ½±´¡£Ã¿µ±
+Emacs Ñ°ÕÒµ½Ò»¸öÎļþ£¬ÎļþÃû¾Í»á³öÏÖÔÚÕâ¸öλÖá£
 
-Ñ°ÕÒÎļþµÄÃüÁîÓÐÒ»¸öÌرðÖ®´¦£¬ÄǾÍÊÇÄã±ØÐë¸ø³öÎļþÃû¡£ÎÒÃdzÆÕâ¸öÃüÁî
-¡°´ÓÖն˶ÁÈëÁËÒ»¸ö²ÎÊý¡±£¨ÔÚÕâÀÕâ¸ö²ÎÊýÏÔÈ»¾ÍÊÇÎļþÃû£©¡£µ±ÄãÊäÈëÁË
-Õâ¸öÃüÁîÖ®ºó£º
+Ñ°ÕÒÎļþµÄÃüÁîÓÐÒ»¸öÌص㣬ÄǾÍÊÇÄã±ØÐë¸ø³öÎļþÃû¡£ÎÒÃdzÆÕâ¸öÃüÁî¡°´ÓÖÕ
+¶Ë¶ÁÈëÁËÒ»¸ö²ÎÊý¡±£¨ÔÚÕâÀÕâ¸ö²ÎÊýÏÔÈ»¾ÍÊÇÎļþÃû£©¡£ÔÚÄãÊäÈëÕâÌõÃüÁî
+Ö®ºó£º
 
         C-x C-f   Ñ°ÕÒÒ»¸öÎļþ
 
@@ -430,50 +431,51 @@ Emacs 
 Ðб»³ÆΪС»º³å£¨minibuffer£©£¬ÔÚС»º³åÀïÄã¿ÉÒÔʹÓÃͨ³£µÄ Emacs ±à¼­ÃüÁî
 À´±à¼­ÎļþÃû¡£
 
-ÔÚС»º³åÀïÊäÈëÎļþÃû£¨ÆäʵÊäÈë±ðµÄ¶«Î÷Ò²Ò»Ñù£©Ê±¿ÉÒÔÓàC-g È¡Ïû¡£
+ÔÚС»º³åÀïÊäÈëÎļþÃû£¨ÆäʵÊäÈëÆäËü¶«Î÷Ò²Ò»Ñù£©Ê±¿ÉÒÔÓàC-g È¡Ïû¡£
 
 >> ÊäÈë C-x C-f£¬È»ºóÊäÈë C-g
    Õâ»á¹ØµôС»º³å£¬Í¬Ê±Ò²»áÈ¡ÏûʹÓÃС»º³åµÄ C-x C-f ÃüÁî¡£
    µ±È»ÁË£¬ÄãҲûÓÐÕÒÈκÎÎļþ¡£
 
-ÊäÈëÍêÎļþÃûÖ®ºóÓà<Return> ½áÊø£¬È»ºó C-x C-f ÃüÁʼ¹¤×÷²¢ÕÒµ½ÄãÖ¸¶¨
-µÄÎļþ¡£Ð¡»º³åÔÚ C-x C-f ÃüÁî½áÊøÖ®ºóÒ²»áÏûʧ¡£
+Óà<Return> ½áÊøÎļþÃûµÄÊäÈë¡£ÕâÖ®ºó C-x C-f ÃüÁʼ¹¤×÷²¢ÕÒµ½ÄãÖ¸¶¨µÄ
+Îļþ¡£Ð¡»º³åÔÚ C-x C-f ÃüÁî½áÊøÖ®ºóÒ²»áÏûʧ¡£
 
-Õ£ÑÛ¼äÎļþ¾Í»áÏÔʾÔÚÆÁÄ»ÉÏ£¬Äã¿ÉÒÔ¿ªÊ¼±à¼­ÁË¡£´æÅÌÓÃÕâ¸öÃüÁ
+Õ£ÑÛ¼äÎļþ¾Í±»ÏÔʾÔÚÆÁÄ»ÉÏ£¬Äã¿ÉÒÔ¿ªÊ¼±à¼­ÁË¡£´æÅÌÓÃÕâÌõÃüÁ
 
         C-x C-s   ´¢´æÕâ¸öÎļþ
 
-Õâ¸öÃüÁî°Ñ Emacs ÖеÄÎÄ×Ö´æ´¢µ½ÎļþÖС£µÚÒ»´Î´æÅ̵Äʱºò Emacs »á½«Ô­ÎÄ
-¼þÖØÃüÃûÒÔ±£ÁôÔ­ÎÄ¡£ÖØÃüÃûµÄ¹æÔòͨ³£ÊÇÔÚÔ­ÎļþÃûÖ®ºóÌí¼ÓÒ»¸ö¡°~¡±×Ö·û¡£
+ÕâÌõÃüÁî°Ñ Emacs ÖеÄÎÄ×Ö´æ´¢µ½ÎļþÖС£µÚÒ»´Î´æÅ̵Äʱºò Emacs »á½«Ô­ÎÄ
+¼þÖØÃüÃûÒÔ±¸·Ý¡£ÖØÃüÃûµÄ¹æÔòͨ³£ÊÇÔÚÔ­ÎļþÃûÖ®ºóÌí¼ÓÒ»¸ö¡°~¡±×Ö·û¡£
+¡¾¶ÔÐí¶àÈËÀ´Ëµ£¬ÕâÊÇÒ»¸ö·³È˵ÄÌØÐÔ£¬¹ØµôÎļþ±¸·Ý¿ÉÒÔÓÃÈçÏÂÃüÁ
+  M-x customize-variable <Return> make-backup-files <Return>¡¿
 
 ´æÅ̽áÊøºó£¬Emacs »áÏÔʾдÈëÎļþµÄÎļþÃû¡£Äã×îºÃÑø³É¾­³£´æÅ̵ÄÏ°¹ß£¬Õâ
-ÑùÔÚϵͳ±ÀÀ£»òÕßËÀ»úµÄʱºòÄã²»»áËðʧ̫¶à¡£
+¿ÉÒÔ¼õÉÙϵͳ±ÀÀ£ºÍËÀ»ú¸øÄã´øÀ´µÄËðʧ¡£
 
 >> ÊäÈë C-x C-s °Ñ±¾¿ìËÙÖ¸ÄÏ´æÏÂÀ´¡£
-   Äã»á¿´µ½¡°Wrote ...TUTORIAL.cn¡±ÕâÑùµÄÏûÏ¢ÏÔʾÔÚÆÁÄ»µÄÏ·½¡£
+   Äã»áÔÚÆÁÄ»µÄÏ·½¿´µ½Ò»ÌõÏûÏ¢£º¡°Wrote ...TUTORIAL.cn¡±¡£
 
-×¢Ò⣺ʹÓÃijЩÖն˵Äʱºò£¬ÊäÈë C-x C-s »á¶³½áÆÁÄ»¡¾ÆÁĻûÓÐÈκÎÊä³ö¡¿£¬
-ÕâÑùÄã¾Í¿´²»µ½ Emacs µÄÈκα仯¡£ÆäÔ­ÒòÊDzÙ×÷ϵͳµÄ¡°Á÷Á¿¿ØÖÆ¡±¹¦ÄÜ°Ñ
-C-s À¹½ØÁË£¬²¢ÇÒ¶³½áÁËÆÁÄ»£¬Emacs ×ÔȻҲ¾Í¿´²»µ½Õâ¸öÊäÈëÁË¡£ÓàC-q ¿ÉÒÔ
-½â³ýÆÁÄ»¶³½á¡£Òª½â¾öÕâ¸öÎÊÌ⣬Çë²Î¿¼ Emacs ÊÖ²áÀïµÄ¡°Spontaneous Entry
-to Incremental Search¡±Ò»½Ú¡¾Emacs ÊÖ²á¿ÉÄÜ»¹Ã»ÓÐÖÐÎÄ·­Òë¡¿£¬ÄÇÀï¿ÉÄÜÓÐ
-һЩÓÐÓõĽ¨Òé¡£
+×¢Ò⣺ÔÚijЩÖÕ¶ËÏ£¬ÊäÈë C-x C-s »á¶³½áÆÁÄ»¡¾ÆÁĻûÓÐÈκÎÊä³ö¡¿£¬Ê¹Äã¿´
+²»µ½ Emacs µÄÈκα仯¡£ÆäÔ­ÒòÊDzÙ×÷ϵͳµÄ¡°Á÷Á¿¿ØÖÆ¡±¹¦ÄÜÀ¹½ØÁË C-s ²¢
+¶³½áÁËÆÁÄ»¡£ÓàC-q ¿ÉÒÔ½â³ýÆÁÄ»¶³½á¡£Òª½â¾öÕâ¸öÎÊÌ⣬Çë²Î¿¼ Emacs ÊÖ²á
+ÀïµÄ¡°Spontaneous Entry to Incremental Search¡±Ò»½Ú¡¾Emacs ÊÖ²á¿ÉÄÜ»¹Ã»
+ÓÐÖÐÎÄ·­Òë¡¿£¬ÄÇÀïÌṩÁËһЩÓÐÓõĽ¨Òé¡£
 
-Äã¿ÉÒÔÑ°ÕÒÒ»¸öÒÑÓеÄÎļþÈ»ºó²é¿´»òÕ߱༭£¬Ä㻹¿ÉÒÔÑ°ÕÒÒ»¸ö²»´æÔÚµÄÎļþ¡£
-ʵ¼ÊÉÏÕâÕýÊÇÓàEmacs ´´½¨ÐÂÎļþµÄ·½·¨£ºÕÒµ½²»´æÔÚµÄÐÂÎļþ£¬È»ºó´ÓÁ㿪ʼ¡£
-ÔÚ´æÅ̵Äʱºò£¬Emacs ²ÅÕæÕý´´½¨Õâ¸öÎļþÈ»ºóÔÙ´æÅÌ¡£ÔÚÕâÖ®ºóÒ»Çо͸úÄã±à
-¼­Ò»¸öÒÑÓÐÎļþÒ»ÑùÁË¡£
+Äã²»µ«¿ÉÒÔÑ°ÕÒÒ»¸öÒÑÓеÄÎļþÀ´²é¿´»ò±à¼­£¬»¹¿ÉÒÔÑ°ÕÒÒ»¸ö²»´æÔÚµÄÎļþ¡£
+ʵ¼ÊÉÏÕâÕýÊÇ Emacs ´´½¨ÐÂÎļþµÄ·½·¨£ºÕÒµ½²»´æÔÚµÄÐÂÎļþ¡£Ö»ÓÐÔÚ´æÅ̵Äʱ
+ºò£¬Emacs ²Å»áÕæÕý´´½¨Õâ¸öÎļþ¡£¶øÔÚÕâÖ®ºóµÄÒ»Çо͸ú±à¼­Ò»¸öÒÑÓÐÎļþû
+ÓÐÇø±ðÁË¡£
 
 
 * »º³åÇø£¨BUFFER£©
 ------------------
 
-Èç¹ûÄãÓàC-x C-f ÕÒµ½µÚ¶þ¸öÎļþ£¬µÚÒ»¸öÎļþÈÔÈ»»áÔÚ Emacs Àï¡£ÒªÇлصÚ
-Ò»¸öÎļþ£¬Äã¿ÉÒÔ C-x C-f ÔÙ´ÎÑ°ÕÒËü¡£ÕâÑù£¬Äã¿ÉÒÔÔÚ Emacs Àïͬʱ´ò¿ªºÜ
-¶àÎļþ¡£
+Äã¿ÉÒÔÓàC-x C-f ÕÒµ½²¢´ò¿ªµÚ¶þ¸öÎļþ£¬µ«µÚÒ»¸öÎļþÈÔÈ»ÔÚ Emacs ÖС£Òª
+ÇлصÚÒ»¸öÎļþ£¬Ò»ÖÖ°ì·¨ÊÇÔÙÓÃÒ»´Î C-x C-f¡£ÕâÑù£¬Äã¾Í¿ÉÒÔÔÚ Emacs ÖÐͬ
+ʱ´ò¿ª¶à¸öÎļþ¡£
 
 >> ÓàC-x C-f foo <Return> µÄ·½Ê½½¨Á¢Ò»¸öÃûΪ¡°foo¡±µÄÎļþ¡£
-   È»ºóÇÃÈëһЩÎÄ×Ö£¬ÔÙÓàC-x C-s ±£´æÎļþ¡°foo¡±¡£
+   ÊäÈëһЩÎÄ×Ö£¬ÔÙÓàC-x C-s ±£´æÎļþ¡°foo¡±¡£
    ×îºó£¬ÊäÈë C-x C-f TUTORIAL.cn <Return> »Øµ½ÕâÀï¡£
 
 Emacs °Ñÿ¸ö±à¼­ÖеÄÎļþ¶¼·ÅÔÚÒ»¸ö³ÆΪ¡°»º³åÇø£¨buffer£©¡±µÄµØ·½¡£Ã¿Ñ°
@@ -484,40 +486,38 @@ Emacs 
 
 >> ÏÖÔÚ¾ÍÊÔһϠC-x C-b
 
-¹Û²ìһϻº³åÇøÊÇÈçºÎÃüÃûµÄ£¬ËüºÜ¿ÉÄܸúÆä¶ÔÓ¦µÄÎļþͬÃû¡£ÊÂʵÉÏ£¬ÄãÔÚһ
-¸ö Emacs ´°¸ñÀï¿´µ½µÄÈκÎÎÄ×Ö¶¼ÊÇij¸ö»º³åÇøµÄÒ»²¿·Ö¡£
+¹Û²ìһϻº³åÇøÊÇÈçºÎ±»ÃüÃûµÄ£¬ËüºÜ¿ÉÄܸúÓëÆä¶ÔÓ¦µÄÎļþͬÃû¡£Êµ¼ÊÉÏ£¬һ
+¸ö Emacs ´°¸ñÀïµÄÈκÎÎÄ×Ö¶¼ÊÇij¸ö»º³åÇøµÄÒ»²¿·Ö¡£
 
 >> ÊäÈë C-x 1 À뿪»º³åÇøÁбí
 
-²»¹Ü´æÔÚ¶àÉÙ»º³åÇø£¬ÈκÎʱºò¶¼Ö»ÄÜÓÐÒ»¸öÊÇ¡°µ±Ç°¡±»º³åÇø£¬Ò²¾ÍÊÇÄãÕýÔÚ
-±à¼­µÄÕâ¸ö¡£Èç¹ûÄãÏë±à¼­ÁíÍâÒ»¸ö»º³åÇø£¬ÄÇôÄã±ØÐë¡°Çл»¡±¹ýÈ¥¡£ÉÏÃæ½²
-¹ý£¬ÓàC-x C-f ¿ÉÒÔÇл»µ½Ä³¸öÎļþ¶ÔÓ¦µÄ»º³åÇø¡£²»¹ý»¹ÓÐÒ»¸ö¸ü¼òµ¥µãµÄ°ì
-·¨£¬ÄǾÍÊÇÓàC-x b¡£ÓÃÕâ¸öÃüÁÄã±ØÐëÊäÈ뻺³åÇøµÄÃû³Æ¡£
+²»¹Ü´æÔÚ¶àÉÙ»º³åÇø£¬ÈκÎʱºò¶¼Ö»ÄÜÓÐÒ»¸ö¡°µ±Ç°¡±»º³åÇø£¬Ò²¾ÍÊÇÄãÕýÔÚ±à
+¼­µÄÕâ¸ö¡£Èç¹ûÄãÏë±à¼­ÆäËüµÄ»º³åÇø£¬¾Í±ØÐë¡°Çл»¡±¹ýÈ¥¡£ÉÏÃæ½²¹ý£¬ÓÃ
+C-x C-f ÊÇÒ»ÖÖ°ì·¨¡£²»¹ý»¹ÓÐÒ»¸ö¸ü¼òµ¥µÄ°ì·¨£¬ÄǾÍÊÇÓàC-x b¡£ÓÃÕâÌõÃü
+ÁÄã±ØÐëÊäÈ뻺³åÇøµÄÃû³Æ¡£
 
 >> ÊäÈë C-x b foo <Return> ÒԻص½Îļþ¡°foo¡±µÄ»º³åÇø¡£
    È»ºóÊäÈë C-x b TUTORIAL.cn <Return> »Øµ½ÕâÀï¡£
 
-´ó¶àÊýÇé¿öÏ£¬»º³åÇøºÍÓëÆä¶ÔÓ¦µÄÎļþÊÇͬÃûµÄ£¨²»°üÀ¨Ä¿Â¼Ãû£©£¬²»¹ýÕâÒ²
-²»ÊǾø¶ÔµÄ¡£ÓàC-x C-b µÃµ½µÄ»º³åÇøÁбíÖÐÏÔʾµÄ×ÜÊÇ»º³åÇøµÄÃû³Æ¡£
+´ó¶àÊýÇé¿öÏ£¬»º³åÇøÓë¸úÆä¶ÔÓ¦µÄÎļþÊÇͬÃûµÄ£¨²»°üÀ¨Ä¿Â¼Ãû£©£¬²»¹ýÕâÒ²
+²»ÊǾø¶ÔµÄ¡£ÓàC-x C-b µÃµ½µÄ»º³åÇøÁбí×ÜÊÇÏÔʾ»º³åÇøÃû¡£
 
-ÄãÔÚ Emacs ´°¸ñÀï¿´µ½µÄ¡°ÈκΡ±ÎÄ×Ö¶¼Ò»¶¨ÊÇÊôÓÚij¸ö»º³åÇøµÄ¡£Ò²ÓÐЩ»º³å
-Çø²¢Ã»ÓжÔÓ¦Îļþ£º±ÈÈçÏÔʾ»º³åÇøÁбíµÄ»º³åÇø¾ÍÊÇÕâÑù£¬ÔÙ±ÈÈçÒ»¸öÃû½Ð
-¡°*Messages*¡±µÄ»º³åÇøҲûÓжÔÓ¦µÄÎļþ£¬Õâ¸ö»º³åÇøÀï´æ·ÅµÄ¶¼ÊÇÔÚ Emacs
-µ×²¿³öÏÖµÄÏûÏ¢¡£
+ÄãÔÚ Emacs ´°¸ñÀï¿´µ½µÄ¡°ÈκΡ±ÎÄ×Ö¶¼Ò»¶¨ÊôÓÚij¸ö»º³åÇø¡£È»¶ø£¬»º³åÇøδ
+±ØÓжÔÓ¦Îļþ£º±ÈÈçÏÔʾ»º³åÇøÁбíµÄ»º³åÇø¾ÍÊÇÕâÑù¡£ÔÙ±ÈÈç¡°*Messages*¡±
+»º³åÇøҲûÓжÔÓ¦Îļþ£¬Õâ¸ö»º³åÇøÀï´æ·ÅµÄ¶¼ÊÇÔÚ Emacs µ×²¿³öÏÖµÄÏûÏ¢¡£
 
 >> ÊäÈë C-x b *Messages* <Return> ³ò³òÏûÏ¢»º³åÇøÀﶼÓÐʲô¶«Î÷¡£
    È»ºóÔÙÊäÈë C-x b TUTORIAL.cn <Return> »Øµ½ÕâÀï¡£
 
-Èç¹ûÄã¶ÔÎļþ×öÁËÐ޸ģ¬È»ºóÇл»µ½ÁíÒ»¸öÎļþ£¬Õâ¸ö¶¯×÷²¢²»»á°ïÄã°ÑµÚÒ»¸ö
-Îļþ´æÅÌ£¬¶ÔµÚÒ»¸öÎļþµÄÐÞ¸ÄÈÔÈ»½öÏÞÓÚ Emacs ÖУ¬Ò²¾ÍÊÇÔÚËü¶ÔÓ¦µÄ»º³åÇø
-Àͬʱ¶ÔµÚ¶þ¸öÎļþµÄÐÞ¸ÄÒ²²»»áÓ°Ïìµ½µÚÒ»¸öÎļþ¡£ÕâºÜÓÐÓ㬵«ÊÇҲͦÂé
-·³£¬ÒòΪÈç¹ûÄãÓÖÏëÒª´æ´¢µÚÒ»¸öÎļþ£¬Ä㻹ÐèÒªÏÈÓàC-x C-f Çл»»ØÈ¥£¬È»ºó
-ÔÙÓàC-x C-s ´æÅÌ£¬ÕâÏÔȻ̫Âé·³ÁË¡£ÄãÐèÒªÒ»¸ö¸ü¼ò±ãµÄ·½·¨£¬¶ø Emacs µ±
-È»ÒѾ­ÌæÄãÏëµ½ÁË£º
+Èç¹ûÄã¶Ôij¸öÎļþ×öÁËЩÐ޸ģ¬È»ºóÇл»µ½ÁíÒ»¸öÎļþ£¬Õâ¸ö¶¯×÷²¢²»»á°ïÄã°Ñ
+Ç°Ò»¸öÎļþ´æÅÌ¡£¶ÔµÚÒ»¸öÎļþµÄÐÞ¸ÄÈÔÈ»½ö´æÔÚÓÚ Emacs ÖУ¬Ò²¾ÍÊÇÔÚËü¶ÔÓ¦
+µÄ»º³åÇøÀï¡£²¢ÇÒ£¬¶ÔµÚ¶þ¸öÎļþµÄÐÞ¸ÄÒ²²»»áÓ°Ïìµ½µÚÒ»¸öÎļþ¡£ÕâºÜÓÐÓã¬
+µ«ÊÇҲͦÂé·³£ºÒòΪÈç¹ûÄãÏëÒª´æ´¢µÚÒ»¸öÎļþ£¬»¹ÐèÒªÏÈ C-x C-f Çл»»ØÈ¥ÔÙ
+ÓàC-x C-s ´æÅÌ¡£ÄãÐèÒªÒ»¸ö¸ü¼ò±ãµÄ·½·¨£¬¶ø Emacs ÒѾ­ÎªÄã×¼±¸ºÃÁË£º
 
         C-x s   ±£´æ¶à¸ö»º³åÇø
 
-C-x s »áÕÒµ½ËùÓÐÒѱ»Ð޸ĵ«ÉÐδ´æÅ̵Ļº³åÇø£¬È»ºóÏòÄãÖð¸öѯÎÊ£¬ÊÇ·ñÐèÒª
+C-x s »áÕÒ³öËùÓÐÒѱ»Ð޸ĵ«ÉÐδ´æÅ̵Ļº³åÇø£¬È»ºóÏòÄãÖð¸öѯÎÊ£ºÊÇ·ñÐèÒª
 ´æÅÌ£¿
 
 >> ²åÈëÒ»ÐÐÎÄ×Ö£¬È»ºóÊäÈë C-x s¡£
@@ -529,28 +529,28 @@ C-x s 
 -----------------------------------------
 
 Emacs µÄÃüÁî¾ÍÏñÌìÉϵÄÐÇÐÇ£¬ÊýÒ²Êý²»Çå¡£°ÑËüÃǶ¼¶ÔÓ¦µ½ CONTROL ºÍ META
-×éºÏ¼üÉÏÏÔÈ»ÊDz»¿ÉÄܵÄÊÂÇé¡£Emacs ÓÃÀ©Õ¹£¨eXtend£©ÃüÁîÀ´½â¾öÕâ¸öÎÊÌ⣬
-À©Õ¹ÃüÁîÓÐÁ½ÖÖ·ç¸ñ£º
+×éºÏ¼üÉÏÏÔÈ»ÊDz»¿ÉÄܵġ£Emacs ÓÃÀ©Õ¹£¨eXtend£©ÃüÁîÀ´½â¾öÕâ¸öÎÊÌ⣬À©Õ¹
+ÃüÁîÓÐÁ½ÖÖ·ç¸ñ£º
 
         C-x     ×Ö·ûÀ©Õ¹¡£  C-x Ö®ºóÊäÈëÁíÒ»¸ö×Ö·û»òÕß×éºÏ¼ü¡£
         M-x     ÃüÁîÃûÀ©Õ¹¡£M-x Ö®ºóÊäÈëÒ»¸öÃüÁîÃû¡£
 
-ºÜ¶àÀ©Õ¹ÃüÁºÜÓÐÓã¬ËäÈ»ÓëÄãÒѾ­Ñ§¹ýµÄÃüÁî±ÈÆðÀ´£¬ËûÃÇ¿ÉÄܲ»ÄÇô³£Óá£
-ÄãÓ¦¸ÃÒѾ­¼û¹ýһЩÀ©Õ¹ÃüÁîÁË£¬±ÈÈçÓàC-x C-f Ñ°ÕÒÎļþºÍÓàC-x C-s ±£´æ
-Îļþ¡£Í˳ö Emacs ÓõĠC-x C-c Ò²ÊÇÀ©Õ¹ÃüÁî¡££¨²»Óõ£ÐÄÍ˳ö Emacs »á¸øÄã
-´øÀ´Ê²Ã´Ëðʧ£¬Emacs »áÔÚÍ˳ö֮ǰÌáÐÑÄã±£´æÎļþµÄ£©
+ºÜ¶àÀ©Õ¹ÃüÁÏ൱ÓÐÓã¬ËäÈ»ÓëÄãÒѾ­Ñ§¹ýµÄÃüÁî±ÈÆðÀ´£¬ËûÃÇ¿ÉÄܲ»ÄÇô³£
+Óá£ÎÒÃÇÔçÒѾ­¼û¹ýһЩÀ©Õ¹ÃüÁîÁË£¬±ÈÈçÓàC-x C-f Ñ°ÕÒÎļþºÍÓàC-x C-s
+±£´æÎļþ£»Í˳ö Emacs ÓõĠC-x C-c Ò²ÊÇÀ©Õ¹ÃüÁî¡££¨²»Óõ£ÐÄÍ˳ö Emacs »á
+¸øÄã´øÀ´Ê²Ã´Ëðʧ£¬Emacs »áÔÚÍ˳ö֮ǰÌáÐÑÄã´æÅ̵ģ©
 
 ÔÚ¿ØÖÆ̨Ï£¬C-z ¿ÉÒÔÔÝʱÀ뿪 Emacs¡ª¡ªµ±È»£¬Ä㻹¿ÉÒÔÔÙ»ØÀ´¡£
 
 ÔÚÔÊÐí C-z µÄϵͳÖУ¬C-z »á°Ñ Emacs¡°¹ÒÆ𡱣¬Ò²¾ÍÊÇ˵£¬Ëü»á»Øµ½ shell
-µ«²»Í˳ö Emacs¡£ÔÚÄÇЩ×î³£ÓõĠshell ÖУ¬Í¨³£¿ÉÒÔÓá°fg¡±»òÕß¡°%emacs¡±
-ÃüÁîÔٴλص½ Emacs ÖС£
+µ«²»Í˳ö Emacs¡£ÔÚ³£ÓõĠshell ÖУ¬Í¨³£¿ÉÒÔÓá°fg¡±»òÕß¡°%emacs¡±ÃüÁîÔÙ
+´Î»Øµ½ Emacs ÖС£
 
 ÔÚûÓÐÌṩ¹ÒÆð¹¦ÄܵÄϵͳÖУ¬C-z »áÔÚ Emacs Ö®Ï´´½¨Ò»¸ö×Ó shell À´ÈÃÄã
-ÔËÐÐÆäËü³ÌÐò£¬²¢ÇÒÔٴΡ°»Øµ½¡± Emacs ÖСª¡ªËäÈ»ÎÒÃDz¢Ã»ÓÐÕæÕýÀ뿪¹ý¡£Õâ
-ÖÖÇé¿öÏ£¬Í¨³£ÓÃshell ÃüÁî¡°exit¡±´Ó×Ó shell »Øµ½ Emacs¡£
+ÔËÐÐÆäËü³ÌÐò£¬²¢ÇÒÔٴΡ°»Øµ½¡±Emacs ÖСª¡ªËäÈ»ÎÒÃDz¢Ã»ÓÐÕæÕýÀ뿪¹ý¡£Õâ
+ÖÖÇé¿öÏ£¬Í¨³£Óàshell ÃüÁî¡°exit¡±´Ó×Ó shell »Øµ½ Emacs¡£
 
-C-x C-c ×îºÃÔÚÄã´òËãÍ˳öµÇ½µÄʱºòÔÙÓá£ÔÚ Emacs ±»ÖîÈçÓʼþ´¦Àí³ÌÐòÖ®Àà
+Äã×îºÃÔÚ´òËãÍ˳öµÇ½µÄʱºòÔÙÓàC-x C-c¡£ÔÚ Emacs ±»ÖîÈçÓʼþ´¦Àí³ÌÐòÖ®Àà
 µÄÍⲿ³ÌÐòµ÷ÓÃÖ®ºó£¬Ò²¿ÉÒÔÓàC-x C-c Í˳ö¡£²»¹ýÒ»°ãÀ´½²£¬Èç¹ûÄã²»ÏëÍ˳ö
 µÇ¼£¬×îºÃ»¹ÊÇ°Ñ Emacs ¹ÒÆð¶ø²»ÊÇÍ˳ö¡£
 
@@ -563,50 +563,50 @@ C-x 
         C-x 1           ¹ØµôÆäËüËùÓд°¸ñ£¬Ö»±£ÁôÒ»¸ö¡£
         C-x u           ³·Ïú¡£
 
-ÓÃÃüÁîÃûÀ©Õ¹µÄÃüÁîÒ»°ã¶¼²»Ì«³£Ó㬻òÕßÖ»ÔÚ²¿·Öģʽϱ»Óõ½¡£±ÈÈç
-replace-string£¨×Ö·û´®Ìæ»»£©Õâ¸öÃüÁËü»áÔÚÈ«ÎÄ·¶Î§ÄÚ°ÑÒ»¸ö×Ö·û´®Ìæ»»
-³ÉÁíÒ»¸ö¡£ÔÚÄãÊäÈë M-x µÄʱºò£¬Emacs »áÔÚÆÁÄ»µ×¶ËÏòÄãѯÎÊ£¬È»ºóÄãÓ¦¸ÃÊä
-ÈëÃüÁîÃû¡£Èç¹ûÄãÏëÊäÈë¡°replace-string¡±£¬ÆäʵֻÐèÒªÇá°repl s<TAB>¡±¾Í
-ÐÐÁË£¬Emacs »á°ïÄã×Ô¶¯²¹ÆëµÄ¡£ÊäÈëÍêÖ®ºó°´ <Return> ¡£
+ÓÃÃüÁîÃûÀ©Õ¹µÄÃüÁîͨ³£²¢²»³£Ó㬻òÖ»ÓÃÔÚ²¿·ÖģʽÏ¡£±ÈÈç replace-string
+£¨×Ö·û´®Ìæ»»£©Õâ¸öÃüÁËü»áÔÚÈ«ÎÄ·¶Î§ÄÚ°ÑÒ»¸ö×Ö·û´®Ìæ»»³ÉÁíÒ»¸ö¡£ÔÚÊä
+Èë M-x Ö®ºó£¬Emacs »áÔÚÆÁÄ»µ×¶ËÏòÄãѯÎʲ¢µÈ´ýÄãÊäÈëÃüÁîÃû¡£Èç¹ûÄãÏëÊäÈë
+¡°replace-string¡±£¬ÆäʵֻÐèÒªÇá°repl s<TAB>¡±¾ÍÐÐÁË£¬Emacs »á°ïÄã×Ô¶¯
+²¹Æë¡£ÊäÈëÍêÖ®ºó°´ <Return> ¡£
 
 ×Ö·û´®Ìæ»»ÃüÁîÐèÒªÁ½¸ö²ÎÊý¡ª¡ª±»Ìæ»»µÄ×Ö·û´®ºÍÓÃÀ´Ìæ»»ËüµÄ×Ö·û´®¡£Ã¿¸ö
-²ÎÊýµÄÊäÈëÓû»ÐзûÀ´½áÊø¡£
+²ÎÊýµÄÊäÈ붼ÒÔ»»ÐзûÀ´½áÊø¡£
 
 >> ½«¹â±êÒƵ½±¾ÐÐÏÂÃæµÚ¶þÐеĿհ״¦£¬È»ºóÊäÈë
    M-x repl s<Return>changed<Return>altered<Return>¡£
 
-   ¡¾ÒÔϱ£ÁôÒ»ÐÐÔ­ÎÄ£¬ÒÔÓ¦Á·Ï°Ö®Ð裺
-   Notice how this line has changed: you've replaced... ¡¿
+   ¡¾ÒÔϱ£ÁôÒ»ÐÐÔ­ÎÄ£¬ÒÔÓ¦Á·Ï°Ö®Ð裺¡¿
+   Notice how this line has changed: you've replaced... 
 
-Çë×¢ÒâÕâÒ»ÐÐÊÇÔõô¸Ä±äµÄ£ºÔÚ¹â±êÖ®ºóµÄ·¶Î§ÄÚ£¬ÄãÒѾ­½«¡°changed¡±Õâ¸ö
-´Ê¡ª¡ª²»¹ÜËüÔÚÄÄÀï³öÏÖ¡ª¡ªÈ«²¿Óá°altered¡±Ìæ»»µôÁË¡£
+Çë×¢ÒâÕâÒ»Ðеı仯£ºÔÚ¹â±êÖ®ºóµÄ·¶Î§ÄÚ£¬ÄãÒѾ­½«¡°changed¡±Õâ¸ö´Ê¡ª¡ª²»
+ÂÛËüÔÚÄÄÀï³öÏÖ¡ª¡ªÈ«²¿Óá°altered¡±Ìæ»»µôÁË¡£
 
 
 * ×Ô¶¯±£´æ£¨AUTO SAVE£©
 -----------------------
 
-Èç¹ûÄãÐÞ¸ÄÁËÒ»¸öÎļþµ«ÊÇ»¹Ã»À´µÃ¼°´æÅÌ£¬È»ºóÄãµÄ¼ÆËã»ú°Õ¹¤ÁË£¬ÄÇôÄã±à
-¼­µÄ¶«Î÷ºÜ¿ÉÄܾÍÕÒ²»»ØÀ´ÁË¡£ÎªÁ˱ÜÃâÕâÑùµÄ²»ÐÒÒ»ÔÙ·¢Éú£¬Emacs »á¶¨ÆÚ½«
-ÄãÕýÔڱ༭µÄÎļþ´æÈëÒ»¸ö¡°×Ô¶¯±£´æ¡±ÎļþÖС£×Ô¶¯±£´æµÄÎļþÃûµÄͷβ¸÷ÓÐ
-Ò»¸ö¡°#¡±×Ö·û£¬±ÈÈçÄãÕýÔڱ༭¡°hello.c¡±£¬ÄÇôËüµÄ×Ô¶¯±£´æÎļþ¾Í½Ð
-¡°#hello.c#¡±¡£ÔÚÄãÕý³£´æÅÌÖ®ºó£¬Emacs »áɾ³ý×Ô¶¯±£´æÎļþ¡£
+Èç¹ûÄãÒѾ­ÐÞ¸ÄÁËÒ»¸öÎļþ£¬µ«ÊÇ»¹Ã»À´µÃ¼°´æÅÌÄãµÄ¼ÆËã»ú¾Í°Õ¹¤ÁË£¬ÄÇôÄã
+Ëù×öµÄÐ޸ľͺܿÉÄܻᶪʧ¡£ÎªÁ˱ÜÃâÕâÑùµÄ²»ÐÒ·¢Éú£¬Emacs »á¶¨ÆÚ½«ÕýÔÚ±à
+¼­µÄÎļþдÈëÒ»¸ö¡°×Ô¶¯±£´æ¡±ÎļþÖС£×Ô¶¯±£´æÎļþµÄÎļþÃûµÄͷβ¸÷ÓÐÒ»¸ö
+¡°#¡±×Ö·û£¬±ÈÈçÄãÕýÔڱ༭µÄÎļþ½Ð¡°hello.c¡±£¬ÄÇôËüµÄ×Ô¶¯±£´æÎļþ¾Í½Ð
+¡°#hello.c#¡±¡£Õâ¸öÎļþ»áÔÚÕý³£´æÅÌÖ®ºó±» Emacs É¾³ý¡£
 
-¼ÙÈç²»ÐÒÕæµÄ·¢ÉúÁË£¬Äã´ó¿ÉÒÔ´ÓÈݵĴò¿ªÔ­À´µÄÎļþ£¨×¢Òâ²»ÊÇ×Ô¶¯±£´æÎļþ£©
-È»ºóÊäÈë M-x recover file<Return> À´»Ö¸´ÄãµÄ×Ô¶¯±£´æÎļþ¡£ÔÚÌáʾȷÈϵÄ
±ºò£¬ÊäÈë yes<Return> ¾ÍÐÐÁË¡£
+ËùÒÔ£¬¼ÙÈç²»ÐÒÕæµÄ·¢ÉúÁË£¬Äã´ó¿ÉÒÔ´ÓÈݵشò¿ªÔ­À´µÄÎļþ£¨×¢Òâ²»ÊÇ×Ô¶¯±£
+´æÎļþ£©È»ºóÊäÈë M-x recover file<Return> À´»Ö¸´ÄãµÄ×Ô¶¯±£´æÎļþ¡£ÔÚÌá
¾È·ÈϵÄʱºò£¬ÊäÈë yes<Return>¡£
 
 
 * »ØÏÔÇø£¨ECHO AREA£©
 ---------------------
 
 Èç¹û Emacs ·¢ÏÖÄãÊäÈë¶à×Ö·ûÃüÁîµÄ½Ú×àºÜÂý£¬Ëü»áÔÚ´°¸ñµÄÏ·½³ÆΪ¡°»ØÏÔÇø¡±
-µÄµØ·½¸øÄãÌáʾ¡£»ØÏÔÇøλÓÚÆÁÄ»µÄ×îºóÒ»ÐС£
+µÄµØ·½¸øÄãÌáʾ¡£»ØÏÔÇøλÓÚÆÁÄ»µÄ×îÏÂÃæÒ»ÐС£
 
 
 * ×´Ì¬À¸£¨MODE LINE£©
 ---------------------
 
-λÓÚ»ØÏÔÇøµÄÕýÉÏ·½µÄÒ»Ðб»³ÆΪ¡°×´Ì¬À¸¡±¡£×´Ì¬À¸ÉÏ»áÏÔʾһЩÐÅÏ¢£¬±ÈÈ磺
+λÓÚ»ØÏÔÇøÕýÉÏ·½µÄÒ»Ðб»³ÆΪ¡°×´Ì¬À¸¡±¡£×´Ì¬À¸ÉÏ»áÏÔʾһЩÐÅÏ¢£¬±ÈÈ磺
 
 --:**  TUTORIAL.cn       (Fundamental)--L670--54%----------------
 
@@ -627,58 +627,58 @@ Fundamental
 
 Emacs µÄÖ÷ģʽÁÖÁÖ×Ü×Ü¡£ÓÐÓÃÀ´±à¼­³ÌÐò´úÂëµÄ¡ª¡ª±ÈÈç Lisp Ä£Ê½£»Ò²ÓÐÓÃ
 À´±à¼­¸÷ÖÖ×ÔÈ»ÓïÑÔÎı¾µÄ¡ª¡ª±ÈÈç Text Ä£Ê½¡£ÈκÎÇé¿öÏÂÖ»ÄÜÓ¦ÓÃÒ»¸öÖ÷Ä£
-ʽ£¬ÆäÃû³Æ»áÏÔʾÔÚ״̬À¸ÉÏ£¬¾ÍÔÚÏÖÔÚÏÔʾ¡°Fundamental¡±µÄµØ·½¡£
+ʽ£¬ÆäÃû³Æ»áÏÔʾÔÚ״̬À¸ÉÏ£¬Ò²¾ÍÊÇÏÖÔÚÏÔʾ¡°Fundamental¡±µÄµØ·½¡£
 
-Ö÷ģʽÓÐʱ»á¸Ä±äһЩÃüÁîµÄÐÐΪ¡£±ÈÈç˵£¬²»¹Ü±à¼­Ê²Ã´ÑùµÄ³ÌÐò´úÂ룬Ä㶼
-¿ÉÒÔÓÃÒ»¸öͳһµÄÃüÁîÀ´Ìí¼Ó×¢ÊÍ£¬µ«ÊÇÔÚ²»Í¬µÄÓïÑÔÖÐ×¢Ê͵ÄÓï·¨ÍùÍùÊDz»Í¬
-µÄ£¬ÕâʱÏàÓ¦µÄÖ÷ģʽ¾Í»á·Ö±ðÓø÷×ÔµÄÓï·¨¹æÔòÀ´Ìí¼Ó×¢ÊÍ¡£Ö÷ģʽ¶¼ÊÇ¿ÉÒÔ
-ÓàM-x Æô¶¯µÄÃüÁËùÒÔ M-x fundamental-mode ¾Í¿ÉÒÔÇл»µ½ Fundamental
+Ö÷ģʽͨ³£»á¸Ä±äһЩÃüÁîµÄÐÐΪ¡£±È·½Ëµ£¬²»¹Ü±à¼­Ê²Ã´ÓïÑԵijÌÐò´úÂ룬Äã
+¶¼¿ÉÒÔÓÃÒ»¸öÏàͬµÄÃüÁîÀ´Ìí¼Ó×¢ÊÍ¡£µ«ÊÇÔÚ²»Í¬µÄÓïÑÔÖÐ×¢Ê͵ÄÓï·¨ÍùÍùÊDz»
+ͬµÄ£¬Õâʱ²»Í¬µÄÖ÷ģʽ¾Í»áÓø÷×Ô²»Í¬µÄÓï·¨¹æÔòÀ´Ìí¼Ó×¢ÊÍ¡£Ö÷ģʽ¶¼ÊÇ¿É
+ÒÔÓàM-x Æô¶¯µÄÀ©Õ¹ÃüÁM-x fundamental-mode ¾Í¿ÉÒÔÇл»µ½ Fundamental
 Ä£Ê½¡£
 
-Èç¹ûÄãÒª±à¼­×ÔÈ»ÓïÑÔÎı¾¡ª¡ª±ÈÈçÏÖÔÚ¡ª¡ªÄãÓ¦¸ÃÓàText Ä£Ê½¡£
+±à¼­×ÔÈ»ÓïÑÔÎı¾¡ª¡ª±ÈÈçÏÖÔÚ¡ª¡ªÓ¦¸ÃÓàText Ä£Ê½¡£
 
 >> ÊäÈë M-x text mode<Return>¡£
 
-±ðº¦Å£¬Ã»ÓÐʲôÃüÁî»á¸Ä±ä¹¦ÄÜ¡£²»¹ýÄã¿ÉÒÔ·¢ÏÖ£¬M-f ºÍ M-b ÏÖÔڰѵ¥ÒýºÅ
-£¨'£©ÊÓΪ´ÊµÄÒ»²¿·ÖÁË¡£¶øÔÚÏÈÇ°£¬ÔÚ Fundamental Ä£Ê½ÖУ¬M-f ºÍ M-b ¶¼½«
-µ¥ÒýºÅÊÓΪ·Ö¸ôµ¥´ÊµÄ·ûºÅ¡£
+±ðµ£ÐÄ£¬Ê²Ã´¶¼Ã»±ä¡£²»¹ýϸÐÄһЩ¿ÉÒÔ·¢ÏÖ£¬M-f ºÍ M-b ÏÖÔڰѵ¥ÒýºÅ£¨'£©
+ÊÓΪ´ÊµÄÒ»²¿·ÖÁË¡£¶øÔÚÏÈÇ°µÄ Fundamental Ä£Ê½ÖУ¬M-f ºÍ M-b ¶¼½«µ¥ÒýºÅ
+ÊÓΪ·Ö¸ôµ¥´ÊµÄ·ûºÅ¡£
 
 Ö÷ģʽͨ³£¶¼»á¸ãһЩÀàËƵÄС¶¯×÷£¬ÒòΪºÜ¶àÃüÁîÆäʵÍê³ÉµÄÊÇ¡°ÏàͬµÄ¹¤
-×÷¡±£¬Ö»ÊÇÔÚ²»Í¬Çé¿öÏ»áÓв»Í¬µÄ¹¤×÷·½Ê½¶øÒÑ¡£¡¾Ëùν¡°Çóͬ´æÒ족£¬ÔÚ
+×÷¡±£¬Ö»ÊÇÔÚ²»Í¬»·¾³Ï»áÓв»Í¬µÄ¹¤×÷·½Ê½¶øÒÑ¡£¡¾Ëùν¡°Çóͬ´æÒ족£¬ÔÚ
 Emacs ÀïµÃµ½Á˺ܺõÄÌåÏÖ¡¿
 
 ÓàC-h m ¿ÉÒԲ鿴µ±Ç°Ö÷ģʽµÄÎĵµ¡£
 
->> ÓàC-u C-v ½«±¾Ðдøµ½¿¿½üÆÁÄ»µÄÉÏ·½¡£
+>> ÓàC-u C-v ½«±¾Ðдøµ½ÆÁÄ»µÄ×îÉÏ·½¡£
 >> ÊäÈë C-h m£¬¿´¿´ Text Ä£Ê½Óë Fundamental Ä£Ê½ÓÐÄÄЩ²»Í¬¡£
 >> ÊäÈë C-x 1 ¹ØµôÎĵµ´°¸ñ¡£
 
 Ö÷ģʽ֮ËùÒÔ³Æ֮Ϊ¡°Ö÷£¨major£©¡±Ä£Ê½£¬ÊÇÒòΪͬʱ»¹ÓС°¸¨Ä£Ê½¡±£¨minor
-mode£©´æÔÚ¡£¸¨Ä£Ê½²¢²»ÄÜÌæ´úÖ÷ģʽ£¬¶øÊÇÔÚÖ÷ģʽ֮ÍâÔÙ×öһЩ¸¨ÖúµÄÐ޸ġ£
-ÿ¸ö¸¨Ä£Ê½¶¼¿ÉÒÔ¶ÀÁ¢µØ¿ªÆôºÍ¹Ø±Õ£¬¸úÆäËü¸¨Ä£Ê½Î޹أ¬¸úÖ÷ģʽҲÎ޹ء£Ëù
-ÒÔÄã¿ÉÒÔ²»Óø¨Ä£Ê½£¬Ò²¿ÉÒÔÓÃÒ»¸ö»òÕ߶à¸ö¸¨Ä£Ê½¡£
+mode£©´æÔÚ¡£¸¨Ä£Ê½²¢²»ÄÜÌæ´úÖ÷ģʽ£¬¶øÊÇÌṩһЩ¸¨ÖúµÄ¹¦ÄÜ¡£Ã¿¸ö¸¨Ä£Ê½
+¶¼¿ÉÒÔ¶ÀÁ¢µØ¿ªÆôºÍ¹Ø±Õ£¬¸úÆäËü¸¨Ä£Ê½Î޹أ¬¸úÖ÷ģʽҲÎ޹ء£ËùÒÔÄã¿ÉÒÔ²»
+ʹÓø¨Ä£Ê½£¬Ò²¿ÉÒÔֻʹÓÃÒ»¸ö»òͬʱʹÓöà¸ö¸¨Ä£Ê½¡£
 
-ÓÐÒ»¸ö½Ð×ö×Ô¶¯ÕÛÐУ¨Auto Fill£©µÄ¸¨Ä£Ê½Óô¦ºÜ´ó£¬ÌرðÊÇÔڱ༭×ÔÈ»ÓïÑÔÎÄ
-±¾µÄʱºò¡£Õâ¸ö¸¨Ä£Ê½Æô¶¯ºó£¬Emacs »áÔÚÄã´ò×Ö³¬³öÒ»Ðб߽çʱ×Ô¶¯ÌæÄã»»ÐС£
+ÓÐÒ»¸ö½Ð×ö×Ô¶¯ÕÛÐУ¨Auto Fill£©µÄ¸¨Ä£Ê½ºÜÓÐÓã¬ÌرðÊÇÔڱ༭×ÔÈ»ÓïÑÔÎı¾
+µÄʱºò¡£ÆôÓÃ×Ô¶¯ÕÛÐкó£¬Emacs »áÔÚÄã´ò×Ö³¬³öÒ»Ðб߽çʱ×Ô¶¯ÌæÄã»»ÐС£
 
-ÓàM-x auto fill mode<Return> Æô¶¯×Ô¶¯ÕÛÐÐģʽ¡£Æô¶¯Ö®ºó£¬Èç¹ûÎÒÃÇÔÙÓÃ
-Ò»´Î M-x auto fill mode<Return>£¬×Ô¶¯ÕÛÐÐģʽ¾Í±»¹Ø±ÕÁË¡£Ò²¾ÍÊÇ˵£¬Èç¹û
-×Ô¶¯ÕÛÐÐģʽûÓпªÆô£¬Õâ¸öÃüÁî»á¿ªÆôËü£»¶øÈç¹ûÒѾ­¿ªÆôÁË£¬Õâ¸öÃüÁî»á¹Ø
-±ÕËü¡£ÎÒÃÇ˵Õâ¸öÃüÁîÓÃÀ´¡°¿ª¹Ø£¨toggle£©¡±Ä£Ê½¡£
+ÓàM-x auto fill mode<Return> Æô¶¯×Ô¶¯ÕÛÐÐģʽ¡£ÔÙÓÃÒ»´ÎÕâÌõÃüÁ×Ô¶¯
+ÕÛÐÐģʽ»á±»¹Ø±Õ¡£Ò²¾ÍÊÇ˵£¬Èç¹û×Ô¶¯ÕÛÐÐģʽûÓб»¿ªÆô£¬Õâ¸öÃüÁî»á¿ªÆô
+Ëü£»Èç¹ûÒѾ­¿ªÆôÁË£¬Õâ¸öÃüÁî»á¹Ø±ÕËü¡£ËùÒÔÎÒÃÇ˵£¬Õâ¸öÃüÁî¿ÉÒÔÓÃÀ´¡°¿ª
+¹Ø£¨toggle£©¡±Ä£Ê½¡£
 
 >> ÏÖÔÚÊäÈë M-x auto fill mode<Return>¡£È»ºóËæ±ãÇõãʲô£¬Ö±µ½Äã¿´µ½Ëü
-   ·Ö³ÉÁ½ÐС£±ØÐëÇÃһЩ¿Õ¸ñ£¬ÒòΪ Auto Fill Ö»ÔÚ¿Õ°×´¦½øÐжÏÐС£¡¾¿Õ¸ñ
-   ¶ÔÓ¢ÎÄÀ´ËµÊDZØÐëµÄ£¬¶ø¶ÔÖÐÎÄÔò²»±Ø¡£¡¿
+   ·Ö³ÉÁ½ÐС£Äã±ØÐëÇÃһЩ¿Õ¸ñ£¬ÒòΪ Auto Fill Ö»ÔÚ¿Õ°×´¦½øÐжÏÐС£
+   ¡¾ÊäÈë¿Õ¸ñ¶ÔÓ¢ÎÄÀ´ËµÊDZØÐëµÄ£¬¶ø¶ÔÖÐÎÄÔò²»±Ø¡£¡¿
 
-Ðб߽çͨ³£±»É趨Ϊ 70 ¸ö×Ö·û¡¾ÕâÀïÖ¸Ó¢ÎÄ×Ö·û¡¿£¬Äã¿ÉÒÔÓàC-x f ÃüÁîÀ´ÖØ
-ÐÂÉ趨֮¡£Ö¸¶¨ÐÂÐб߽ç¿ÉÒÔÓÃÊý×Ö²ÎÊýÀ´½øÐд«µÝ¡£
+Ðб߽çͨ³£±»É趨Ϊ 70 ¸ö×Ö·û¡¾ÕâÀïÖ¸Ó¢ÎÄ×Ö·û¡¿£¬Äã¿ÉÒÔÓàC-x f ÃüÁîÅäºÏ
+Êý×Ö²ÎÊýÀ´ÖØÐÂÉ趨Ëü¡£
 
 >> ÊäÈë C-x f ²¢´«µÝ²ÎÊý 20£º C-u 2 0 C-x f¡£
    È»ºóÊäÈëһЩÎÄ×Ö£¬¹Û²ì Emacs µÄ×Ô¶¯ÕÛÐж¯×÷
    ×îºóÔÙÓàC-x f ½«±ß½çÉè»Ø 70¡£
 
 Èç¹ûÄãÔÚ¶ÎÂäµÄÖмä×öÁËһЩÐ޸ģ¬ÄÇô×Ô¶¯ÕÛÐÐģʽ²»»áÌæÄã°ÑÕû¸ö¶ÎÂäÖØÐÂ
-ÕÛÐС£ÖØÐÂ×Ô¶¯ÕÛÐÐÓàM-q£¬×¢ÒâʹÓõÄʱºò¹â±ê±ØÐëλÓÚÄãÏëÕÛÐеÄÄÇÒ»¶ÎÀï¡£
+ÕÛÐУ¬ÄãÐèÒªÓàM-q ÊÖ¶¯ÕÛÐС£×¢Ò⣬¹â±ê±ØÐëλÓÚÄãÐèÒªÕÛÐеÄÄÇÒ»¶ÎÀï¡£
 
 >> Òƶ¯¹â±êµ½Ç°Ò»¶ÎÖУ¬È»ºóÊäÈë M-q¡£
 
@@ -686,49 +686,47 @@ mode
 * ËÑË÷£¨SEARCHING£©
 -------------------
 
-Emacs ¿ÉÒÔÏòÇ°»òÕßÏòºóËÑË÷×Ö·û´®¡£ËÑË÷ÃüÁîÊÇÒ»¸öÒƶ¯¹â±êµÄÃüÁËÑË÷³É
-¹¦ºó£¬¹â±ê»áÍ£ÁôÔÚËÑË÷Ä¿±ê³öÏֵĵط½¡£
+Emacs ¿ÉÒÔÏòÇ°»òÏòºóËÑË÷×Ö·û´®¡£ËÑË÷ÃüÁîÊÇÒ»¸öÒƶ¯¹â±êµÄÃüÁËÑË÷³É¹¦
+ºó£¬¹â±ê»áÍ£ÁôÔÚËÑË÷Ä¿±ê³öÏֵĵط½¡£
 
-Emacs µÄËÑË÷ÃüÁîµÄ¶ÀÌØÖ®´¦ÔÚÓÚ£¬ËüÊÇ¡°½¥½øµÄ£¨incremental£©¡±£¬Òâ˼ÊÇËÑ
+Emacs µÄËÑË÷ÃüÁîµÄ¶ÀÌØÖ®´¦ÔÚÓÚ£¬ËüÊÇ¡°½¥½øµÄ£¨incremental£©¡±¡£Òâ˼ÊÇËÑ
 Ë÷ÓëÊäÈëͬʱ½øÐУºÄãÔÚ¼üÅÌÉÏÒ»×ÖÒ»¾äµØÊäÈëËÑË÷´ÊµÄ¹ý³ÌÖУ¬Emacs ¾ÍÒѾ­
 ¿ªÊ¼ÌæÄãËÑË÷ÁË¡£
 
-C-s ÊÇÏòÇ°ËÑË÷£¬C-r ÊÇÏòºóËÑË÷¡£²»¹ýÊÖ±ðÕâô¿ì£¡Ïȵȵȱð׿±ÊÔ¡£
+C-s ÊÇÏòÇ°ËÑË÷£¬C-r ÊÇÏòºóËÑË÷¡£²»¹ýÊÖ±ðÕâô¿ì£¡±ð׿±ÊÔ¡£
 
-ÔÚÄã°´Ï C-s Ö®ºó£¬Äã»á·¢ÏÖ»ØÏÔÇøÀïÓС°I-search¡±×ÖÑù³öÏÖ£¬ÌáʾÄãÄ¿Ç°
-Emacs Õý´¦ÓÚ¡°½¥½øËÑË÷¡±×´Ì¬£¬ÕýÔڵȴýÄãÊäÈëËÑË÷×Ö´®¡£°´ <Return> »á½á
-ÊøËÑË÷¡£
+ÔÚ°´Ï C-s Ö®ºó£¬»ØÏÔÇøÀï»áÓС°I-search¡±×ÖÑù³öÏÖ£¬±íÃ÷Ä¿Ç° Emacs Õý´¦
+ÓÚ¡°½¥½øËÑË÷¡±×´Ì¬£¬²¢µÈ´ýÄãÊäÈëËÑË÷×Ö´®¡£°´ <Return> ¿ÉÒÔ½áÊøËÑË÷¡£
 
 >> ÊäÈë C-s ¿ªÊ¼Ò»¸öËÑË÷¡£×¢ÒâÇÃÂýÒ»µã£¬Ò»´ÎÊäÈëÒ»¸ö×Ö·û¡£
-   ÂýÂýÊäÈë¡°cursor¡±Õû¸ö´Ê£¬Ã¿ÇÃÒ»¸ö×Ö¾ÍÔÝͣһϣ¬×¢Òâ¹Û²ì¹â±ê¡£
+   ÂýÂýÊäÈë¡°cursor¡±Õâ¸ö´Ê£¬Ã¿ÇÃÒ»¸ö×Ö¶¼Í£¶Ùһϲ¢¹Û²ì¹â±ê¡£
    ÏÖÔÚÄãÓ¦¸ÃÒÑÔø¾­ÕÒµ½¡°cursor¡±Õâ¸ö´ÊÁË¡£
 >> ÔÙ°´Ò»´Î C-s£¬ËÑË÷ÏÂÒ»¸ö¡°cursor¡±³öÏÖµÄλÖá£
 >> ÏÖÔÚ°´ËÄ´ÎÍ˸ñ¼ü£¬¿´¿´¹â±êÊÇÈçºÎÒƶ¯µÄ¡£
 >> Çà<Return> ½áÊøËÑË÷¡£
 
-¸Õ²Å¿´×ÐϸÁËô£¿ÔÚÒ»¸ö½¥½øʽËÑË÷ÖУ¬Emacs »á³¢ÊÔÌøµ½ÄãÊäÈëµÄ×Ö·û´®µÄ³ö
-ÏÖλÖá£ÏëÌøµ½ÏÂÒ»¸öËÑË÷Ä¿±ê³öÏÖµÄλÖã¬Ö»ÒªÔÙ°´Ò»´Î C-s ¾ÍÐÐÁË¡£Èç¹ûÕÒ
-²»µ½£¬Emacs »á·¢³ö¡°ßÙ¡±µÄÒ»Éù£¬¸æËßÄãËÑË÷ʧ°Ü¡£ÔÚÕû¸ö¹ý³ÌÖУ¬¶¼¿ÉÒÔÓÃ
-C-g À´ÖÕÖ¹ËÑË÷¡£¡¾Äã»á·¢ÏÖ C-g Ö®ºó¹â±ê»Øµ½ÁËËÑË÷¿ªÊ¼Ç°µÄµØ·½£¬¶ø
-<Return> »áÈùâ±êÁôÔÚËÑË÷½á¹ûÉÏ£¬ÕâÊǺÜÓÐÓõŦÄÜ¡£¡¿
+¿´×ÐϸÁËô£¿ÔÚÒ»´Î½¥½øʽËÑË÷ÖУ¬Emacs »á³¢ÊÔÌøµ½ËÑË÷Ä¿±ê³öÏÖµÄλÖá£Òª
+Ìøµ½ÏÂÒ»¸öÃüÖÐλÖ㬾ÍÔÙ°´Ò»´Î C-s¡£Èç¹ûÕÒ²»µ½Ä¿±ê£¬Emacs »á·¢³ö¡°ßÙ¡±
+µÄÒ»Éù£¬¸æËßÄãËÑË÷ʧ°Ü¡£ÔÚÕû¸ö¹ý³ÌÖУ¬¶¼¿ÉÒÔÓàC-g À´ÖÕÖ¹ËÑË÷¡£¡¾Äã»á·¢
+ÏÖ C-g »áÈùâ±ê»Øµ½ËÑË÷¿ªÊ¼µÄλÖ㬶ø <Return> ÔòÈùâ±êÁôÔÚËÑË÷½á¹ûÉÏ£¬
+ÕâÊǺÜÓÐÓõŦÄÜ¡£¡¿
 
-×¢Ò⣺ʹÓÃijЩÖն˵Äʱºò£¬ÊäÈë C-x C-s »á¶³½áÆÁÄ»¡¾ÆÁĻûÓÐÈκÎÊä³ö¡¿£¬
-ÕâÑùÄã¾Í¿´²»µ½ Emacs µÄÈκα仯¡£ÆäÔ­ÒòÊDzÙ×÷ϵͳµÄ¡°Á÷Á¿¿ØÖÆ¡±¹¦ÄÜ°Ñ
-C-s À¹½ØÁË£¬²¢ÇÒ¶³½áÁËÆÁÄ»£¬Emacs ×ÔȻҲ¾Í¿´²»µ½Õâ¸öÊäÈëÁË¡£ÓàC-q ¿ÉÒÔ
-½â³ýÆÁÄ»¶³½á¡£Òª½â¾öÕâ¸öÎÊÌ⣬Çë²Î¿¼ Emacs ÊÖ²áÀïµÄ¡°Spontaneous Entry
-to Incremental Search¡±Ò»½Ú¡¾Emacs ÊÖ²á¿ÉÄÜ»¹Ã»ÓÐÖÐÎÄ·­Òë¡¿£¬ÄÇÀï¿ÉÄÜÓÐ
-һЩÓÐÓõĽ¨Òé¡£
+×¢Ò⣺ÔÚijЩÖÕ¶ËÏ£¬ÊäÈë C-x C-s »á¶³½áÆÁÄ»¡¾ÆÁĻûÓÐÈκÎÊä³ö¡¿£¬Ê¹Äã¿´
+²»µ½ Emacs µÄÈκα仯¡£ÆäÔ­ÒòÊDzÙ×÷ϵͳµÄ¡°Á÷Á¿¿ØÖÆ¡±¹¦ÄÜÀ¹½ØÁË C-s ²¢
+¶³½áÁËÆÁÄ»¡£ÓàC-q ¿ÉÒÔ½â³ýÆÁÄ»¶³½á¡£Òª½â¾öÕâ¸öÎÊÌ⣬Çë²Î¿¼ Emacs ÊÖ²á
+ÀïµÄ¡°Spontaneous Entry to Incremental Search¡±Ò»½Ú¡¾Emacs ÊÖ²á¿ÉÄÜ»¹Ã»
+ÓÐÖÐÎÄ·­Òë¡¿£¬ÄÇÀïÌṩÁËһЩÓÐÓõĽ¨Òé¡£
 
-Èç¹ûÄãÕýÔÚ½¥½øʽËÑË÷ÖУ¬°´Í˸ñ¼ü»áɾ³ýÄ¿±ê×Ö·û´®µÄ×îºóÒ»¸ö×Ö·û£¬²¢ÇÒ¹â
-±ê»á»Øµ½×î½üÒ»´ÎËÑË÷µÄÃüÖÐλÖᣱÈÈçÄãÒѾ­ÊäÈëÁË¡°c¡±£¬¹â±ê¾ÍÍ£ÔÚ¡°c¡±
-µÚÒ»´Î³öÏֵĵط½£¬ÔÙÊäÈë¡°u¡±£¬¹â±êÍ£ÔÚ¡°cu¡±µÚÒ»´Î³öÏֵĵط½£¬ÕâʱÔÙ°´
-Í˸ñ¼ü£¬¡°u¡±¾Í´ÓËÑË÷×Ö´®ÖÐÏûʧÁË£¬È»ºó¹â±ê»á»Øµ½¡°c¡±µÚÒ»´Î³öÏֵĵط½¡£
+ÔÚ½¥½øʽËÑË÷ÖУ¬°´Í˸ñ¼ü»áɾ³ýÄ¿±ê×Ö·û´®µÄ×îºóÒ»¸ö×Ö·û£¬²¢ÇÒ¹â±ê»á»Øµ½
+×î½üÒ»´ÎËÑË÷µÄÃüÖÐλÖᣱÈÈçÄãÒѾ­ÊäÈëÁË¡°c¡±£¬¹â±ê¾ÍÍ£ÔÚ¡°c¡±µÚÒ»´Î³ö
+ÏÖµÄλÖã¬ÔÙÊäÈë¡°u¡±£¬¹â±êÍ£ÔÚ¡°cu¡±µÚÒ»´Î³öÏÖµÄλÖã¬ÕâʱÔÙ°´Í˸ñ¼ü£¬
+¡°u¡±¾Í´ÓËÑË÷×Ö´®ÖÐÏûʧÁË£¬È»ºó¹â±ê»á»Øµ½¡°c¡±µÚÒ»´Î³öÏÖµÄλÖá£
 
-ÁíÍâÈç¹ûÄãÔÚËÑË÷µÄʱºòÊäÈëÁË CONTROL »òÕß META ×éºÏ¼üµÄ»°£¬ËÑË÷¿ÉÄÜ»á
-½áÊø¡££¨Ò²ÓÐÀýÍ⣬±ÈÈç C-s ºÍ M-r ÕâЩ¶ÔËÑË÷ÓÐÌرðÒâÒåµÄ×éºÏ¼ü¡££©
+ÁíÍ⣬Èç¹ûÄãÔÚËÑË÷µÄʱºòÊäÈëÁË CONTROL »òÕß META ×éºÏ¼üµÄ»°£¬ËÑË÷¿ÉÄÜ»á
+½áÊø¡££¨Ò²ÓÐÀýÍ⣬±ÈÈç C-s ºÍ M-r ÕâЩÓÃÓÚËÑË÷µÄÃüÁî¡££©
 
 Ç°Ãæ˵µÄ¶¼ÊÇ¡°ÏòÏ¡±ËÑË÷£¬Èç¹ûÏë¡°ÏòÉÏ¡±ËÑË÷£¬¿ÉÒÔÓàC-r¡£C-r Óë C-s
-Ïà±È³ýÁËËÑË÷·½ÏòÏà·´Ö®Í⣬ÆäËüµÄ²Ù×÷¶¼Ò»Ñù¡£
+Ïà±È³ýÁËËÑË÷·½ÏòÏà·´Ö®Í⣬ÆäÓàµÄ²Ù×÷¶¼Ò»Ñù¡£
 
 
 * ¶à´°¸ñ£¨MULTIPLE WINDOWS£©
@@ -759,29 +757,29 @@ Emacs 
 ´°¿ÚÏÂȱʡÏÔʾΪïοչâ±ê¡£¡¿Ò»°ãËùÓеı༭ÃüÁ×÷ÓÃÓÚÕâ¸ö¹â±êËùÔڵĴ°
 ¸ñ£¬ÎÒÃdzÆÕâ¸ö´°¸ñΪ¡°±»Ñ¡ÖеĴ°¸ñ¡±¡£
 
-µ±ÄãÔÚÒ»¸ö´°¸ñÖб༭£¬µ«ÊÇÏëÓÃÁíÒ»¸ö´°¸ñ×÷²Î¿¼µÄʱºò£¬C-M-v ÊǺÜÓÐÓõÄ
-ÃüÁî¡£Äã¿ÉÒÔ±£³Ö¹â±êʼÖÕ´¦Óڱ༭´°¸ñÖУ¬È»ºóÓàC-M-v ÃüÁîÔÚÁíÍâÒ»¸ö´°¸ñ
-Àï¹ö¶¯¡£¡¾·­ÒëºÍУ¶Ô¾ÍºÜÊʺÏÓÃÕâÖÖ·½Ê½½øÐС£¡¿
+µ±ÄãÔÚÒ»¸ö´°¸ñÖб༭£¬µ«ÓÃÁíÒ»¸ö´°¸ñ×÷Ϊ²Î¿¼µÄʱºò£¬C-M-v ÊǺÜÓÐÓõÄÃü
+Áî¡£Äã¿ÉÒÔʼÖÕ´¦Óڱ༭´°¸ñÖУ¬È»ºóÓàC-M-v ÃüÁî¹ö¶¯ÁíÍâÒ»¸ö´°¸ñ¡£¡¾±ÈÈç
+·­ÒëºÍУ¶Ô¾ÍºÜÊʺÏÓÃÕâÖÖ·½Ê½½øÐС£¡¿
 
-C-M-v ÊÇÒ»¸ö CONTROL-META ×éºÏ¼ü¡£Èç¹ûÄãÓРMETA ¼ü£¬Äã¿ÉÒÔͬʱ°´×¡
-CONTROL ºÍ META ¼üÈ»ºóÊäÈë v¡£CONTROL ºÍ META ¼üÄĸöÏÈ°´Ã»ÓйØϵ£¬ÒòΪ
-ËüÃÇÖ»ÊÇÓÃÀ´¡°ÐÞÊΣ¨modify£©¡±ÄãÊäÈëµÄ×Ö·ûµÄ¡£
+C-M-v ÊÇÒ»¸ö CONTROL-META ×éºÏ¼ü¡£Èç¹ûÄãÓРMETA ¼üµÄ»°£¬¿ÉÒÔͬʱ°´×¡
+CONTROL ºÍ META ¼ü²¢ÊäÈë v¡£CONTROL ºÍ META ¼üÏÈ°´Äĸö¶¼¿ÉÒÔ£¬ÒòΪËüÃÇ
+Ö»ÊÇÓÃÀ´¡°ÐÞÊΣ¨modify£©¡±ÄãÊäÈëµÄ×Ö·ûµÄ¡£
 
-Èç¹ûÄ㲢ûÓРMETA ¼ü£¬ÄãÒ²¿ÉÒÔÓàESC À´´úÌ棬²»¹ýÕâÑù×Ó°´¼ü˳Ðò¾ÍÓйØϵ
-ÁË£ºÄã±ØÐëÊäÈë ESC £¬È»ºóÔÙÊäÈë CONTROL-v¡£CONTROL-ESC v ÊÇûÓõģ¬ÒòΪ
-ESC ±¾ÉíÊÇÒ»¸ö×Ö·û¼ü£¬¶ø²»ÊÇÒ»¸öÐÞÊμü£¨modifier key£©¡£
+Èç¹ûÄ㲢ûÓРMETA ¼ü£¬ÄãÒ²¿ÉÒÔÓàESC À´´úÌ棬²»¹ýÕâÑùµÄ»°¾ÍҪעÒâ°´¼ü˳
+ÐòÁË£ºÄã±ØÐëÏÈÊäÈë ESC £¬È»ºóÔÙÊäÈë CONTROL-v¡£CONTROL-ESC v ÊÇûÓõģ¬
+ÒòΪ ESC ±¾ÉíÊÇÒ»¸ö×Ö·û¼ü£¬¶ø²»ÊÇÒ»¸öÐÞÊμü£¨modifier key£©¡£
 
 >> £¨ÔÚÉÏ·½´°¸ñÀÊäÈë C-x 1 ¹ØµôÏ·½´°¸ñ¡£
 
 £¨Èç¹ûÄãÔÚÏ·½µÄ´°¸ñÀïÊäÈë C-x 1£¬ÄÇô¾Í»á¹ØµôÉÏ·½µÄ´°¸ñ¡£Äã¿ÉÒÔ°ÑÕâ¸ö
-ÃüÁî¿´³ÉÊÇ¡°Ö»±£ÁôÒ»¸ö´°¸ñ¡±¡ª¡ª¾ÍÊÇÎÒÕýÔڱ༭µÄÕâ¸ö¡££©
+ÃüÁî¿´³ÉÊÇ¡°Ö»±£ÁôÒ»¸ö´°¸ñ¡±¡ª¡ª¾ÍÊÇÎÒÃÇÕýÔڱ༭µÄÕâ¸ö¡££©
 
-²»Í¬µÄ´°¸ñÀï¿ÉÒÔÏÔʾ²»Í¬µÄ»º³åÇø¡£Èç¹ûÄãÔÚÒ»¸ö´°¸ñÀïÓàC-x C-f ´ò¿ªÁË
-Ò»¸öÎļþ£¬ÁíÒ»¸ö´°¸ñ²¢²»»áÓÐʲô±ä»¯¡£ÔÚÈκÎÒ»¸ö´°¸ñÀﶼ¿ÉÒÔ´ò¿ªÎļþ¡£
+²»Í¬µÄ´°¸ñ¿ÉÒÔÏÔʾ²»Í¬µÄ»º³åÇø¡£Èç¹ûÄãÔÚÒ»¸ö´°¸ñÀïÓàC-x C-f ´ò¿ªÁËÒ»¸ö
+Îļþ£¬ÁíÒ»¸ö´°¸ñ²¢²»»á·¢Éúʲô±ä»¯¡£ÈκÎÒ»¸ö´°¸ñÀﶼ¿ÉÒÔÓÃÀ´´ò¿ªÎļþ¡£
 
ÐÒ»ÖÖ·½Ê½¿ÉÒÔÈÃÄãÔÚÁíÒ»¸ö´°¸ñÀï´ò¿ªÎļþ£º
ÃÏÂÃæµÄ·½·¨¿ÉÒÔÔÚÒ»¸öпª´°¸ñÀï´ò¿ªÎļþ£º
 
->> ÊäÈë C-x 4 C-f£¬ºóÃæ½ô¸ú×ÅÊäÈëÒ»¸öÎļþÃû£¬Óà<Return> ½áÊø¡£
+>> ÊäÈë C-x 4 C-f£¬½ô¸ú×ÅÊäÈëÒ»¸öÎļþÃû£¬ÔÙÓà<Return> ½áÊø¡£
    ¿ÉÒÔ¿´µ½ÄãÖ¸¶¨µÄÎļþ³öÏÖÔÚÏ·½µÄ´°¸ñÖУ¬Í¬Ê±¹â±êÒ²Ìøµ½ÁËÄÇÀï¡£
 
 >> ÊäÈë C-x o »Øµ½ÉÏ·½µÄ´°¸ñ£¬È»ºóÔÙÓàC-x 1 ¹ØµôÏ·½´°¸ñ¡£
@@ -801,29 +799,29 @@ ESC 
 
 >> ÊäÈë M-x ½øÈëС»º³å£»È»ºóÊäÈë ESC ESC ESC À뿪¡£
 
-Äã²»ÄÜÓàC-g À´À뿪µÝ¹é±à¼­£¬ÒòΪ C-g µÄ×÷ÓÃÊÇÈ¡ÏûÃüÁîºÍ¡°²ÎÊý
-£¨arguments£©¡±£¬¶øÕâЩ¶«Î÷¶¼Î»ÓÚ±¾²ãµÝ¹é±à¼­¡°Ö®ÄÚ¡±¡£
+Äã²»ÄÜÓàC-g Í˳öµÝ¹é±à¼­£¬ÒòΪ C-g µÄ×÷ÓÃÊÇÈ¡Ïû¡°±¾²ãµÝ¹é±à¼­Ö®ÄÚ¡±µÄ
+ÃüÁîºÍÆä²ÎÊý£¨arguments£©¡£
 
 
 * »ñµÃ¸ü¶à°ïÖú£¨GETTING MORE HELP£©
 -----------------------------------
 
-±¾¿ìËÙÖ¸ÄϵÄÄ¿µÄ½ö½öÊÇ°ïÖúÄãѧ»áÔÚ Emacs µÄ´óº£ÀïÓÎÓ¾£¬²»ÖÁÓÚÒ»ÉÏÀ´¾ÍÑÍ
-ËÀ¡£ÓйؠEmacs µÄ»°ÌâÈýÌìÈýÒ¹Ò²½²²»Í꣬ÕâÀï×ÔÈ»ÊÇд²»ÏÂÁË¡£Emacs ºÜÀí½â
-ÄãÇóÖªÈô¿ÊµÄÐÄÇ飬ÒòΪËüÌṩµÄÇ¿¾¢¹¦ÄÜʵÔÚÊÇÌ«¶àÁË¡£Emacs ÌṩÁËһЩÃü
îÀ´²é¿´ Emacs ÃüÁîµÄÎĵµ£¬ÕâЩÃüÁÒÔ CONTROL-h ¿ªÍ·£¬Õâ¸ö×Ö·ûÒ²Òò´Ë
-±»³ÆΪ¡°Help£¨°ïÖú£©×Ö·û¡±¡£
+±¾¿ìËÙÖ¸ÄϵÄÄ¿µÄ½ö½öÊÇ°ïÖúÄãÔÚ Emacs µÄº£ÑóÀïÏÂË®£¬²»ÖÁÓÚÊøÊÖÎÞ²ßÍûÑóÐË
+̾¡£ÓйؠEmacs µÄ»°Ìâ¿Éνº¹Å£³ä¶°£¬ÕâÀï×ÔÈ»ÊÇÄѾ¡ÍòÒ»¡£²»¹ý Emacs ºÜÀí
+½âÄãÇóÖªÈô¿ÊµÄÐÄÇ飬ÒòΪËüÌṩµÄÇ¿´ó¹¦ÄÜʵÔÚÊÇÌ«¶àÁË¡£Îª´Ë£¬Emacs Ìṩ
ËһЩÃüÁîÀ´²é¿´ Emacs µÄÃüÁîÎĵµ£¬ÕâЩÃüÁÒÔ CONTROL-h ¿ªÍ·£¬Õâ¸ö×Ö
+·ûÒ²Òò´Ë±»³ÆΪ¡°°ïÖú£¨Help£©×Ö·û¡±¡£
 
-ҪʹÓðïÖú£¨Help£©¹¦ÄÜ£¬ÇëÏÈÊäÈë C-h£¬È»ºóÔÙÊäÈëÒ»¸ö˵Ã÷ÄãÐèÇóµÄ×Ö·û¡£
-Èç¹ûÄãÔε½Á¬ÐèҪʲô°ïÖú¶¼²»ÖªµÀ£¬ÄÇô¾ÍÊäÈë C-h ?£¬Emacs »á¸æËßÄãËüÄÜ
-ÌṩÄÄЩ°ïÖú¡£Èç¹ûÄãÒѾ­°´ÁË C-h ÓÖÏë·´»Ú£¬ÄÇôÓàC-g È¡ÏûËü¾ÍÊÇÁË¡£
+ҪʹÓðïÖú£¨Help£©¹¦ÄÜ£¬ÇëÏÈÊäÈë C-h£¬È»ºóÔÙÊäÈëÒ»¸ö×Ö·ûÒÔ˵Ã÷ÄãÐèҪʲ
+ô°ïÖú¡£Èç¹ûÄãÁ¬×Ô¼ºµ½µ×ÐèҪʲô°ïÖú¶¼²»ÖªµÀ£¬ÄÇô¾ÍÊäÈë C-h ?£¬Emacs
+»á¸æËßÄãËüÄÜÌṩÁËÄÄЩ°ïÖú¡£Èç¹ûÄã°´ÁË C-h ÓÖÏë·´»Ú£¬¿ÉÒÔÓàC-g È¡Ïû¡£
 
-£¨ÓÐЩվµã¸Ä±äÁË C-h µÄÒâ˼£¬ËûÃÇÕâÖÖÒÔ¼º¶ÈÈËÍâ¼ÓÒ»µ¶ÇеÄ×ö·¨Èõ¹ÊÇÈÃÄã
-¿ÉÒÔÒåÕý´ÇÑϵı§Ô¹ÏµÍ³¹ÜÀíÔ±£¬ÕæµÄ²»ÊÇÌ«ºÃ¡£»°Ëµ»ØÀ´£¬Èç¹ûÄã°´ C-h Ö®ºó
-ûÓÐÈκΰïÖúÐÅÏ¢ÏÔʾ³öÀ´£¬ÄÇôÊÔÊÔ F1 ¼ü»òÕß M-x help <Return>¡££©
+£¨ÓÐЩÖ÷»ú¸Ä±äÁË C-h µÄÒâÒ壬ÕâÖÖÒÔ¼º¶ÈÈËÍâ¼ÓÒ»µ¶ÇеÄ×ö·¨È·Êµ²»Ì«ºÃ£¬²»
+¹ýµ¹ÊÇÈÃÄã¿ÉÒÔÒåÕý´ÇÑϵر§Ô¹ËûÃǵÄϵͳ¹ÜÀíÔ±¡£»°Ëµ»ØÀ´£¬Èç¹ûÄã°´ C-h Ö®
+ºóûÓÐÈκΰïÖúÐÅÏ¢ÏÔʾ³öÀ´£¬ÄÇôÊÔÊÔ F1 ¼ü»òÕß M-x help <Return> ¡££©
 
-×î»ù±¾µÄ°ïÖú¹¦ÄÜÊÇ C-h c¡£ÊäÈë C-h c Ö®ºóÔÚÊäÈëÒ»¸ö×éºÏ¼ü£¬Emacs »áºÜ¼ò
-ÒªµØ¸ø³öÕâ¸öÃüÁîµÄ˵Ã÷¡£
+×î»ù±¾µÄ°ïÖú¹¦ÄÜÊÇ C-h c¡£ÊäÈë C-h c Ö®ºóÔÙÊäÈëÒ»¸ö×éºÏ¼ü£¬Emacs »á¸ø³ö
+Õâ¸öÃüÁîµÄ¼òҪ˵Ã÷¡£
 
 >> ÊäÈë C-h c C-p¡£
 
@@ -833,7 +831,7 @@ ESC 
 
 ÕâÌõÏûÏ¢ÏÔʾÁË C-p ÃüÁî¶ÔÓ¦µÄº¯ÊýÃû£¬º¯ÊýÃûÖ÷ÒªÓÃÀ´¶¨ÖƺÍÀ©Õ¹ Emacs¡£Ãü
 ÁîµÄ¹¦ÄÜÓɺ¯ÊýÍê³É£¬ËùÒÔº¯ÊýÃû±¾ÉíÒ²¿ÉÒÔ±»¿´³ÉÊÇ×î¼òµ¥µÄÎĵµ¡ª¡ªÖÁÉÙ¶Ô
-ÓÚÄãÒѾ­Ñ§¹ýµÄÃüÁîÀ´Ëµ£¬ËüÃǵĺ¯ÊýÃû×ãÒÔ½âÊÍËüÃÇËùÍê³ÉµÄ¹¤×÷ÁË¡£
+ÓÚÄãÒѾ­Ñ§¹ýµÄÃüÁîÀ´Ëµ£¬ËüÃǵĺ¯ÊýÃû×ãÒÔ½âÊÍËüÃǵŦÄÜÁË¡£
 
 ¶à×Ö·ûÃüÁîÒ»Ñù¿ÉÒÔÓàC-h c À´²é¿´¡£
 
@@ -841,18 +839,18 @@ ESC 
 
 >> ÊäÈë C-h k C-p¡£
 
-ÉÏÃæµÄÃüÁî»áдò¿ªÒ»¸ö Emacs ´°¸ñ£¬²¢ÔÚÆäÖÐÏÔʾº¯ÊýµÄÃû³Æ¼°ÆäÎĵµ¡£Äã¶Á
-ÍêÖ®ºó£¬¿ÉÒÔÓàC-x 1 ¹ØµôÕâ¸ö°ïÖú´°¸ñ¡£µ±È»Äã²¢²»ÐèÒªÔÚ C-h k Ö®ºóÁ¢¼´
-ÕâÑù×ö£¬ÄãÍêÈ«¿ÉÒÔÏÈÔڱ༭´°¸ñÀï×öµã±ðµÄÊÂÇ飬ȻºóÔÙÓàC-x 1 ¹Øµô°ïÖú¡£
+ÉÏÃæµÄÃüÁî»áдò¿ªÒ»¸ö Emacs ´°¸ñÒÔÏÔʾº¯ÊýµÄÃû³Æ¼°ÆäÎĵµ¡£Äã¶ÁÍêÖ®ºó¿É
+ÒÔÓàC-x 1 ¹ØµôÕâ¸ö°ïÖú´°¸ñ¡£µ±È»Äã²¢²»ÐèÒªÁ¢¼´ÕâÑù×ö£¬ÄãÍêÈ«¿ÉÒÔÏÈÔÚ±à
+¼­´°¸ñÀï×öµã±ðµÄÊÂÇ飬ȻºóÔٹصô°ïÖú´°¸ñ¡£
 
-»¹ÓÐһЩÆäËûÓÐÓõĠC-h ÃüÁ
+»¹ÓÐһЩÆäËüÓÐÓõĠC-h ÃüÁ
 
-   C-h f        ½âÊÍÒ»¸öº¯Êý¡£ÄãÒªÊäÈ뺯ÊýÃû¡£
+   C-h f        ½âÊÍÒ»¸öº¯Êý¡£ÐèÒªÊäÈ뺯ÊýÃû¡£
 
 >> ÊÔÊÔ¿´£¬ÊäÈë C-h f previous-line<Return>¡£
    Emacs »á¸ø³öËüËùÖªµÀµÄËùÓÐÓйء°ÊµÏÖ C-p ÃüÁÄܵĺ¯Êý¡±µÄÐÅÏ¢¡£
 
-C-h v ÓÃÀ´ÏÔʾ Emacs ±äÁ¿µÄÎĵµ£¬Emacs ±äÁ¿¿ÉÒÔ±»ÓÃÀ´¡°¶¨ÖÆ Emacs µÄÐÐ
+C-h v ÓÃÀ´ÏÔʾ Emacs ±äÁ¿µÄÎĵµ¡£Emacs ±äÁ¿¿ÉÒÔ±»ÓÃÀ´¡°¶¨ÖÆ Emacs µÄÐÐ
 Îª¡±¡£Í¬Ñù£¬ÄãÐèÒªÊäÈë±äÁ¿µÄÃû³Æ¡£
 
    C-h a        Ïà¹ØÃüÁîËÑË÷£¨Command Apropos£©¡£
@@ -882,21 +880,21 @@ Emacs 
 * ¸ü¶à¾«²Ê£¨MORE FEATURES£©
 ---------------------------
 
-ÏëÁ˽â¸ü¶àʹÓàEmacs µÄ֪ʶ£¬Ó¦¸ÃÈ¥¶ÁÒ»¶Á Emacs Ê¹ÓÃÊֲᡪ¡ª¿ÉÒÔÊÇÖ½°æ
-µÄÊ飬Ҳ¿ÉÒÔÊǵç×Ó°æµÄÁª»ú°ïÖú£¨¿ÉÒÔ´Ó Help ²Ëµ¥½øÈë»òÕß°´ F10 h r£©¡£
-ÌáÁ½¸öÄã¿ÉÄÜ»áºÜ¸ÐÐËȤµÄ¹¦ÄÜ°É£¬Ò»¸öÊÇ¿ÉÒÔ°ïÄãÉÙÇüüÅ̵Ġcompletion£¨×Ô
-¶¯²¹È«£©£¬Ò»¸öÊÇ·½±ãÎļþ´¦ÀíµÄ dired£¨Ä¿Â¼±à¼­£©¡£
+Ïëѧϰ¸ü¶àµÄʹÓü¼ÇÉ£¬Emacs Ê¹ÓÃÊֲᣨmanual£©ÖµµÃÒ»¶Á¡£Äã¿ÉÒÔ¶ÁÖ½°æµÄ
+Ê飬Ҳ¿ÉÒÔ¿´µç×Ó°æµÄÁª»úÊֲᣨ¿ÉÒÔ´Ó Help ²Ëµ¥½øÈë»òÕß°´ F10 h r£©¡£Ìá
+Á½¸öÄã¿ÉÄÜ»áºÜ¸ÐÐËȤµÄ¹¦ÄÜ°É£¬Ò»¸öÊÇ¿ÉÒÔ°ïÄãÉÙÇüüÅ̵Ġcompletion£¨×Ô¶¯
+²¹È«£©£¬ÁíÒ»¸öÊÇ·½±ãÎļþ´¦ÀíµÄ dired£¨Ä¿Â¼±à¼­£©¡£
 
 Completion ¿ÉÒÔÌæÄã½ÚÊ¡²»±ØÒªµÄ¼üÅÌÊäÈë¡£±ÈÈç˵ÄãÏëÇл»µ½ *Message* »º
-³åÇø£¬Äã¾Í¿ÉÒÔÓàC-x b *M<Tab> À´Íê³É£¬Ö»Òª Emacs Äܹ»´ÓÄãÒѾ­ÊäÈëµÄÎÄ
-×ÖÖÐÅжϳöÄãÏëÒªÊäÈëµÄ¶«Î÷£¬Ëü»á×Ô¶¯°ïÄã²¹ÆëÓàϵġ£ÓйؠCompletion µÄ
-Ïêϸ½âÊÍ¿ÉÒÔÔÚ Emacs Info Öеġ°Completion¡±Ò»½ÚÀïÕÒµ½¡£
+³åÇø£¬Äã¾Í¿ÉÒÔÓàC-x b *M<Tab> À´Íê³É¡£Ö»Òª Emacs Äܹ»¸ù¾ÝÄãÒѾ­ÊäÈëµÄ
+ÎÄ×ÖÈ·¶¨ÄãÏëÒªÊäÈëµÄÄÚÈÝ£¬Ëü¾Í»á×Ô¶¯°ïÄã²¹Æë¡£ÓйؠCompletion µÄÏêϸ˵
+Ã÷¿ÉÒÔÔÚ Emacs Info Öеġ°Completion¡±Ò»½ÚÀïÕÒµ½¡£
 
-Dired ¿ÉÒÔÔÚÒ»¸ö»º³åÇøÀïÁгöÒ»¸öĿ¼ÀïµÄËùÓÐÎļþ£¨¿ÉÒÔÑ¡ÔñÊÇ·ñÒ²Áгö×Ó
-Ŀ¼£©£¬È»ºóÄã¿ÉÒÔÔÚÕâ¸öÎļþÁбíÉÏÍê³É¶ÔÎļþµÄÒƶ¯¡¢·ÃÎÊ¡¢¸ÄÃû»òÕßɾ³ý
-µÈµÈ²Ù×÷¡£Dired Ò²ÔÚ Emacs Info ÖÐÓÐÏêϸ˵Ã÷£¬¾ÍÔÚ¡°Dired¡±Ò»½Ú¡£
+Dired Äܹ»ÔÚÒ»¸ö»º³åÇøÀïÁгöÒ»¸öĿ¼ÏµÄËùÓÐÎļþ£¨¿ÉÒÔÑ¡ÔñÊÇ·ñÒ²Áгö×Ó
+Ŀ¼£©£¬È»ºóÄã¿ÉÒÔÔÚÕâ¸öÎļþÁбíÉÏÍê³É¶ÔÎļþµÄÒƶ¯¡¢·ÃÎÊ¡¢ÖØÃüÃû»òɾ³ý
+µÈµÈ²Ù×÷¡£Dired Ò²ÔÚ Emacs Info ÖÐÓÐÏêϸ½éÉÜ£¬²Î¼û¡°Dired¡±Ò»½Ú¡£
 
-Emacs Ê¹ÓÃÊÖ²áÀﻹÓкܶàºÜ¶àµÄ¾«²Ê¹¦ÄܵÈ×ÅÄãÀ´Á˽⡣
+Emacs Ê¹ÓÃÊÖ²áÀﻹÓÐÐíÐí¶à¶àµÄ¾«²Ê¹¦ÄܵÈ×ÅÄãÀ´Á˽⡣
 
 
 * ×ܽᣨCONCLUSION£©
@@ -905,15 +903,15 @@ Emacs ʹ
 ¼Çס£¬ÒªÍ˳ö Emacs ÇëÓàC-x C-c¡£ÒªÔÝʱÇл»µ½ shell ²¢ÇÒÉÔºóÔٻص½
 Emacs ÀïÀ´£¬ÇëÓàC-z¡£¡¾Çл»µ½ shell ½ö¶Ô¿ØÖÆ̨ϵĠEmacs ÓÐЧ¡¿
 
-±¾ÎÄÍêÈ«ÊÇΪÁãÆðµãÐÂÊÖдµÄɵ¹Ï½Ì³Ì¡£Èç¹ûÄã¾õµÃÄÄÀﻹ¿´²»Ã÷°×£¬Ç§Íò²»Òª
-¾õµÃ²»ºÃÒâ˼£¬ÄÇÒ»¶¨ÊÇÎÒÃÇûÓÐдºÃ¡£ÎÒÃÇÓÀÔ¶»¶Ó­ÄãµÄ²»ÂúºÍ±§Ô¹¡£
+±¾ÎÄÍêÈ«ÊÇΪÁãÆðµãÐÂÊÖËùдµÄÆ𲽽̡̳£Èç¹ûÄã¾õµÃÄÄÀﻹ¿´²»Ã÷°×£¬Ç§Íò²»
+Òª»³ÒÉ×Ô¼º£¬ÄÇÒ»¶¨ÊÇÎÒÃÇûÓÐдºÃ¡£ÎÒÃÇÓÀÔ¶»¶Ó­ÄãµÄ²»ÂúºÍ±§Ô¹¡£
 
 
 * ·­Ò루TRANSLATION£©
 ---------------------
 
-·­Ò룺Ëï Ò»½­ <sunyijiang@gmail.com>
-У¶Ô£ºË®Ä¾ÉçÇø£¨www.newsmth.net£©Emacs °åÖÚ¶àÍøÓÑ
+·­Ò룺ËïÒ»½­ <sunyijiang@gmail.com>
+У¶Ô£ºË®Ä¾ÉçÇø£¨www.newsmth.net£©Emacs °åÖÚ¶àÍøÓѼ°ÖÚ¶à Emacs ÖÐÎÄÓû§
 
 Emacs ¿ìËÙÖ¸ÄÏ£¨Tutorial£©ÔçÓÐÁ½¸öÁõÕѺêµÄÖÐÎÄÒë±¾£¬·±¼ò¸÷Ò»¡£Æä¼òÌå°æ±¾
 £¨TUTORIAL.cn£©»ù±¾ÓÉ·±Ìå°æ±¾£¨TUTORIAL.zh£©¾­´ÊÓïÌæ»»¶øµÃ¡£È»¶ø·±¼òÖÐÎÄ
@@ -924,10 +922,12 @@ Emacs 
 ±íʾ¸Ðл¡£
 
 ·­Òë¹ý³ÌÖÐ×î´óµÄÌôսĪ¹ýÓÚÊõÓïÒë´ÊµÄÑ¡ÔñÁË¡£¾­¹ýˮľÉçÇø Emacs °åÈÈÐÄÍø
-ÓÑС·¶Î§ÄÚµÄÌÖÂÛ£¬ÎÒÃÇÑ¡ÔñÁËÏÖÔÚµÄÒë·¨¡£Óû§µÄ¹ã·º²ÎÓëÊÇ×ÔÓÉÈí¼þÉúÃüÁ¦µÄ
-ԴȪ£¬ËùÒÔÈç¹ûÄãÓÐÈκν¨Òé¡¢¿±Îó»ò¸üºÃµÄÏë·¨£¬ÇëÓÃÄãϲ»¶µÄ·½Ê½ÏòÎÒÃÇÌá³ö
-¡£Äã¿ÉÒÔÖ±½Ó¸øÎÒ·¢µç×ÓÓʼþ£¬Ò²¿ÉÒԷŵ½ GNU Emacs µÄ¿ª·¢ÓʼþÁбí»òÕßˮľ
-ÉçÇøµÄ Emacs °åÉϽøÐÐÌÖÂÛ¡£ÏÂÃæÁгöÖ÷ÒªÊõÓïµÄÒë´Ê¶ÔÕÕ£¬²¢¸ø³ö×¢ÊÍ˵Ã÷£º
+ÓÑС·¶Î§ÄÚµÄÌÖÂÛ£¬ÎÒÃÇÑ¡ÔñÁËÏÖÔÚµÄÒë·¨¡£Óû§µÄ¹ã·º²ÎÓëÊÇ×ÔÓÉÈí¼þÉúÃüÁ¦
+µÄԴȪ£¬ËùÒÔÈç¹ûÄãÓÐÈκν¨Òé¡¢¿±Îó»òÏë·¨£¬ÇëÓÃÄãϲ»¶µÄ·½Ê½ÏòÎÒÃÇÌá³ö¡£
+Äã¿ÉÒÔͨ¹ýµç×ÓÓʼþÖ±½ÓÁªÏµÒëÕߣ¬Ò²¿ÉÒԷŵ½ GNU Emacs µÄ¿ª·¢ÓʼþÁбí»òÕß
+ˮľÉçÇøµÄ Emacs °åÉϽøÐÐÌÖÂÛ¡£
+
+ÏÂÃæÁгöÖ÷ÒªÊõÓïµÄÒë´Ê¶ÔÕÕ£¬²¢¸ø³ö×¢ÊÍ˵Ã÷£º
 
     command               ÃüÁî
     cursor                ¹â±ê
@@ -956,7 +956,7 @@ Emacs 
 
     ¡¶Ñ§Ï°GNU Emacs¡·£¨µÚ¶þ°æ£©Ò»Êé¶Ô¡°window¡±ºÍ¡°frame¡±µÄ·­ÒëÓë±¾½Ì³Ì
     ¸ÕºÃÏà·´£¨·Ö±ðÒë×÷¡°´°¿Ú¡±ºÍ¡°´°¸ñ¡±£©¡£ÔÚ´ËÌرð×¢Ã÷£¬ÒÔÏû³ý¿ÉÄܲúÉú
-    µÄÒÉ»ó¡£
+    µÄÒɻ󡣣¨¸ÐлÀîÐñÕ <lixuzhang@gmail.com> Ö¸³ö£©
 
 [2] ¶ÔÓÚ¡°delete¡±ºÍ¡°kill¡±µÄÇø±ð£¬ÕýÎÄÒѾ­¸ø³öÁËÏêϸµÄ˵Ã÷¡£¡°É¾³ý¡±ºÍ
     ¡°ÒƳý¡±Ïà±È½ÏÆðÀ´£¬Ç°Õ߸ü¶àµØÒþº¬×Å¡°ÆÆ»µ¡±ºÍ¡°²»¿É»Ö¸´¡±µÄÒâ˼£¬¶ø
@@ -968,7 +968,7 @@ Emacs 
 
 [3] ¡°incremental¡±Ò»´ÊÔÚ¼ÆËã»úÖø×÷Öй㷺³öÏÖ£¬±»¹ã·º½ÓÊܵÄÖÐÎÄÒë´ÊÓÐÁ½
     ¸ö£º¡°ÔöÁ¿µÄ¡±ºÍ¡°½¥½øµÄ¡±¡£¡°incremental search¡±·­Òë³É¡°ÔöÁ¿Ê½ËÑË÷
-    ¡±»òÕß¡°½¥½øʽËÑË÷¡±¶¼½²µÄͨ£¬ÇÒ¶¼Óи÷×ÔµÄÐÎÏóÖ®´¦¡£»¹ÊDzο¼Ô­ÎĶÔÆä
+    ¡±»òÕß¡°½¥½øʽËÑË÷¡±¶¼½²µÃͨ£¬ÇÒ¶¼Óи÷×ÔµÄÐÎÏóÖ®´¦¡£»¹ÊDzο¼Ô­ÎĶÔÆä
     µÄ½âÊÍ£º¡°... means that the search happens while you type in the
     string to search for¡±¡£Òâ˼ÊÇÖ®ËùÒÔ³ÆÆäΪ¡°incremental search¡±£¬ÊÇ
     ÒòΪ¡°ÔÚÄãÊäÈëËÑË÷×Ö·û´®µÄ¹ý³ÌÖУ¬ËÑË÷¾ÍÒѾ­ÔÚ½øÐÐÁË¡±¡£ÎÒÃÇÈÏΪ¡°Ôö
@@ -1012,7 +1012,7 @@ GNU Emacs to your friends.  Help stamp out software obstructionism
 
 ±¾ÆªÎĵµÓë GNU Emacs Ò»ÑùÓµÓаæȨ£¬²¢ÔÊÐíÔÚÏÂÁÐÌõ¼þµÄÔ¼ÊøÏ·¢ÐÐÆ俽±´£º
 
-   Copyright (C) 1985, 1996, 1998, 2001, 2002, 2003, 2004, 2005
+   Copyright (C) 1985, 1996, 1998, 2001, 2002, 2003, 2004, 2005, 2006
    Free Software Foundation, Inc.
 
    ±¾ÎĵµÔÊÐíÔÚ²»±ä¸üÎĵµÄÚÈݵÄÇé¿öÏÂÓÉÈκÎÈË·¢²¼ÔÚÈκÎýÌåÉÏ£¬Í¬Ê±±ØÐë
index 57128e2..cc72233 100644 (file)
@@ -50,11 +50,11 @@ def eargs (name, imports):
        if len (parts) > 1:
            exec 'import ' + parts[0] # might fail
        func = eval (name)
-       if inspect.isbuiltin (func):
+       if inspect.isbuiltin (func) or type(func) is type:
            doc = func.__doc__
            if doc.find (' ->') != -1:
                print '_emacs_out', doc.split (' ->')[0]
-           elif doc.find ('\n') != -1:
+           else:
                print '_emacs_out', doc.split ('\n')[0]
            return
        if inspect.ismethod (func):
index bd641c9..8852372 100644 (file)
@@ -29,10 +29,10 @@ default editor.
 
 For
 .B emacsclient
-to work, you need an already running Emacs with a server.  Within Emacs, call
-the function
-`server-start'.  (Your `.emacs' file can do this automatically if you
-add the expression `(server-start)' to it.)
+to work, you need an already running Emacs with a server.  Within Emacs,
+call the functions `server-start' or `server-mode'.  (Your `.emacs' file
+can do this automatically if you add either `(server-start)' or
+`(server-mode 1)' to it.)
 
 When you've finished editing the buffer, type `C-x #'
 (`server-edit').  This saves the file and sends a message back to the
@@ -57,7 +57,11 @@ do not visit files but instead evaluate the arguments as Emacs
 Lisp expressions.
 .TP
 .B \-s, \-\-socket-name=FILENAME
-Use socket named FILENAME for communication.
+use socket named FILENAME for communication.
+.TP
+.B \-f, \-\-server-file=FILENAME
+use TCP configuration file FILENAME for communication.
+This can also be specified via the `EMACS_SERVER_FILE' environment variable.
 .TP
 .B \-a, \-\-alternate-editor=EDITOR
 if the Emacs server is not running, run the specified editor instead.
index 3007d95..80fe284 100644 (file)
@@ -205,7 +205,7 @@ from shell interpretation.
 
 Tag the DEFVAR macros in the emacs source files:
 .br
-\fI\-\-regex\='/[ \\t]*DEFVAR_[A-Z_ \\t(]+"\\([^"]+\\)"\/'\fP
+\fI\-\-regex\='/[ \\t]*DEFVAR_[A-Z_ \\t(]+"\\([^"]+\\)"/'\fP
 .\"" This comment is to avoid confusion to Emacs syntax highlighting
 .br
 
index ef2e847..141e786 100644 (file)
@@ -1,5 +1,5 @@
 % Reference Card for Org Mode
-\def\orgversionnumber{4.44}
+\def\orgversionnumber{4.56}
 \def\year{2006}
 %
 %**start of header
@@ -284,6 +284,7 @@ are preserved on all copies.
 \key{rotate current subtree between states}{TAB}
 \key{rotate entire buffer between states}{S-TAB}
 \key{show the whole file}{C-c C-a}
+\key{reveal context around point}{C-c C-r}
 %\key{show branches}{C-c C-k}
 
 \section{Motion}
@@ -298,8 +299,6 @@ are preserved on all copies.
 
 \key{insert new heading/item at current level}{M-RET}
 \key{insert new TODO entry/checkbox item}{M-S-RET}
-\key{toggle checkbox(es) in region/entry/at point}{C-c C-x C-b}
-\key{toggle checkbox at point}{C-c C-c}
 
 \key{promote current heading up one level}{M-LEFT}
 \key{demote current heading down one level}{M-RIGHT}
@@ -315,8 +314,9 @@ are preserved on all copies.
 \section{Archiving}
 
 \key{toggle ARCHIVE tag}{C-c C-x C-a}
-\metax{mark fully dine children}{C-u C-c C-x C-a}
-\key{move subtree to achive file}{C-c \$}
+\metax{mark fully done children}{C-u C-c C-x C-a}
+\key{force cycling of an ARCHIVEd tree}{C-TAB}
+\key{move subtree to archive file}{C-c \$}
 \key{move all fully done children}{C-u C-c \$}
 To set archive location for current file, add a line like$^2$:
 \vskip -1mm
@@ -330,7 +330,7 @@ To set archive location for current file, add a line like$^2$:
 \key{view TODO's in sparse tree}{C-c C-v}
 \key{global TODO list in agenda mode}{C-c t$^1$}
 \key{create sparse tree with all deadlines due}{C-c C-w}
-\key{time sorted view of current org file}{C-c C-r}
+\key{time sorted view of current org file}{C-c a L}
 %\key{agenda for the week}{C-c a$^1$}
 %\key{agenda for date at cursor}{C-c C-o}
 
@@ -425,10 +425,11 @@ formula, \kbd{:=} a named-field formula.
 \key{insert file link with file name completion}{C-u C-c C-l}
 \key{edit (also hidden part of) link at point}{C-c C-l}
 
-\key{open file links in emacs (\kbd{C-u} : in emacs)}{C-c C-o}
-\key{open link at point (3: in emacs)}{mouse-2/3}
-%\key{open file links in emacs}{mouse-3}
-%\key{record a position in mark ring}{C-c \%}
+\key{open file links in emacs}{C-c C-o}
+\key{...force open in emacs/other window}{C-u C-c C-o}
+\key{open link at point}{mouse-1/2}
+\key{...force open in emacs/other window}{mouse-3}
+\key{record a position in mark ring}{C-c \%}
 \key{jump back to last followed link(s)}{C-c \&}
 
 {\bf Internal Links}
@@ -444,10 +445,10 @@ formula, \kbd{:=} a named-field formula.
 \key{\kbd{file:/home/dominik/img/mars.jpg}}{\rm file, absolute}
 \key{\kbd{file:papers/last.pdf}}{\rm file, relative}
 \key{\kbd{file:projects.org::*that text}}{\rm find headline}
-\key{\kbd{file:projects.org::find me}}{\rm find tgt/string}
+\key{\kbd{file:projects.org::find me}}{\rm find trgt/string}
 %\key{\kbd{file:projects.org::/regexp/}}{\rm regexp search}
 \key{\kbd{http://www.astro.uva.nl/~dominik}}{\rm on the web}
-\key{\kbd{mailto:adent@galaxy.net}}{\rm EMail address}
+\key{\kbd{mailto:adent@galaxy.net}}{\rm Email address}
 \key{\kbd{news:comp.emacs}}{\rm Usenet group}
 \key{\kbd{bbdb:Richard Stallman}}{\rm BBDB person}
 \key{\kbd{gnus:group}}{\rm GNUS group}
@@ -494,7 +495,7 @@ after  ``{\tt :}'', and dictionary words elsewhere.
 
 \centerline{(for version \orgversionnumber)}
 
-\section{TODO Items}
+\section{TODO Items and Checkboxes}
 
 \key{rotate the state of the current item}{C-c C-t}
 \key{view TODO items in a sparse tree}{C-c C-v}
@@ -508,6 +509,12 @@ after  ``{\tt :}'', and dictionary words elsewhere.
 \key{\kbd{\#+SEQ_TODO: TODO TRY BLUFF DONE}}{\rm todo workflow}
 \key{\kbd{\#+TYP_TODO: Phil home work DONE}}{\rm todo types}
 
+\key{insert new checkbox item in plain list}{M-S-RET}
+\key{toggle checkbox(es) in region/entry/at point}{C-c C-x C-b}
+\key{toggle checkbox at point}{C-c C-c}
+\metax{checkbox statistics cookies: insert {\tt [/]} or {\tt [\%]}}{}
+\key{update checkbox statistics (\kbd{C-u} : whole file)}{C-c \#}
+
 \section{Tags}
 
 \key{set tags for current heading}{C-c C-c}
@@ -535,6 +542,7 @@ after  ``{\tt :}'', and dictionary words elsewhere.
 %\key{... forward/backward one day}{S-LEFT/RIGHT}
 %\key{... forward/backward one week}{S-UP/DOWN}
 %\key{... forward/backward one month}{M-S-LEFT/RIGT}
+\key{Toggle custom format display for dates/times}{C-c C-x C-t}
 
 
 \section{Clocking Time}
@@ -547,11 +555,6 @@ after  ``{\tt :}'', and dictionary words elsewhere.
 \key{remove displayed times}{C-c C-c}
 \key{insert/update table with clock report}{C-c C-x C-r}
 
-\section{Dynamic Blocks}
-
-\key{update dynamic block at point}{C-c C-x C-u}
-\metax{update all dynamic blocks}{C-u C-c C-x C-u}
-
 \section{LaTeX and cdlatex-mode}
 
 \key{preview LaTeX fragment}{C-c C-x C-l}
@@ -568,8 +571,10 @@ after  ``{\tt :}'', and dictionary words elsewhere.
 \key{compile global TODO list}{C-c a t$^1$}
 \key{compile TODO list for specific keyword}{C-c a T$^1$}
 \key{match tags in agenda files}{C-c a m$^1$}
+\key{match tags in TODO entries}{C-c a M$^1$}
+\key{show timeline of current org file}{C-c a L$^1$}
+\key{configure custom commands}{C-c a C$^1$}
 \key{agenda for date at cursor}{C-c C-o}
-\key{show timeline of current org file}{C-c C-r}
 
 \vskip 1mm
 To set categories, add lines like$^2$:
@@ -582,11 +587,11 @@ To set categories, add lines like$^2$:
 
 {\bf View Org file}
 
-\key{show original location of item}{SPC}
-\key{... also available with}{mouse-3}
+\key{show original location of item}{SPC/mouse-3}
+%\key{... also available with}{mouse-3}
 \key{show and recenter window}{L}
-\key{goto original location in other window}{TAB}
-\key{... also available with}{mouse-2}
+\key{goto original location in other window}{TAB/mouse-2}
+%\key{... also available with}{mouse-2}
 \key{goto original location, delete other windows}{RET}
 \key{toggle follow-mode}{f}
 
@@ -607,6 +612,7 @@ To set categories, add lines like$^2$:
 
 \key{digit argument}{0-9}
 \key{change state of current TODO item}{t}
+\key{kill item and source}{C-k}
 \key{show tags of current headline}{T}
 \key{set tags for current headline}{:}
 \key{toggle ARCHIVE tag}{a}
@@ -718,6 +724,11 @@ Subtrees whose header starts with COMMENT are never exported.
 %S-RET   $\to$ C-S-RET
 %\endexample
 
+\section{Dynamic Blocks}
+
+\key{update dynamic block at point}{C-c C-x C-u}
+\metax{update all dynamic blocks}{C-u C-c C-x C-u}
+
 \section{Notes}
 $^1$ This is only a suggestion for a binding of this command.  Choose
 you own key as shown under INSTALLATION.
index 7a16795..8717f22 100644 (file)
@@ -1,3 +1,12 @@
+2006-11-29  Juanma Barranquero  <lekktu@gmail.com>
+
+       * quail/greek.el ("greek-mizuochi"): Remove spurious initial newline
+       in docstring.
+
+2006-11-04  Romain Francoise  <romain@orebokech.com>
+
+       * Makefile.in (bootstrap-clean): New target.
+
 2006-10-12  Kenichi Handa  <handa@m17n.org>
 
        * Makefile.in (install): Be sure to make ${INSTALLDIR} before `cd'
 
 2005-06-04  Eli Zaretskii  <eliz@gnu.org>
 
-       * makefile.w32-in (distclean): Fix a typo (colon was after
-       "clean").
+       * makefile.w32-in (distclean): Fix a typo (colon was after "clean").
        (extraclean): New target, emulates Makefile.in.
 
 2005-04-06  Kenichi Handa  <handa@m17n.org>
 
-       * quail/sgml-input.el ("sgml"): Enable quail-completion by typing
-       TAB.
+       * quail/sgml-input.el ("sgml"): Enable quail-completion by typing TAB.
 
 2005-03-26  Kenichi Handa  <handa@m17n.org>
 
-       * quail/latin-ltx.el ("TeX"): Enable quail-completion by typing
-       TAB.
+       * quail/latin-ltx.el ("TeX"): Enable quail-completion by typing TAB.
 
 2005-03-18  Kenichi Handa  <handa@m17n.org>
 
 
 2004-07-01  David Kastrup  <dak@gnu.org>
 
-       * quail/greek.el ("((") ("))"): add quotation mark shorthands.
+       * quail/greek.el ("((") ("))"): Add quotation mark shorthands.
 
 2004-06-30  Andreas Schwab  <schwab@suse.de>
 
 
 2004-05-01  Kenichi Handa  <handa@m17n.org>
 
-       * Makefile.in (OTHERS): Raname from MISC.
+       * Makefile.in (OTHERS): Rename from MISC.
        (MISC): Rename from MISC-DIC.
        (WORLD): Adjute for the above changes.
        (TIT-MISC, NON-TIT-MISC): New targets.
 
 ;; Local Variables:
 ;; coding: iso-2022-7bit
+;; add-log-time-zone-rule: t
 ;; End:
 
     Copyright (C) 1997, 1998, 1999, 2001 Free Software Foundation, Inc.
index 3a4467d..10ba277 100644 (file)
@@ -255,6 +255,12 @@ clean mostlyclean:
        rm -f ${TIT-MISC} ${TIT-MISC:.elc=.el} \
                leim-list.el changed.tit changed.misc
 
+# The following target is needed because the `clean' target only removes
+# TIT-generated files and doesn't touch compiled Quail packages.  But
+# bootstrapping should not leave non-fresh .elc files behind.
+bootstrap-clean: clean
+       rm -f ${WORLD}
+
 distclean: clean
        if test -f stamp-subdir; then rm -rf ${SUBDIRS} stamp-subdir; fi
        rm -f Makefile
index 78a7880..a9a97c8 100644 (file)
@@ -137,8 +137,8 @@ Sorry, accents and terminal sigma are not supported in JIS."
 
 ;;
 
-(quail-define-package "greek-mizuochi" "Greek" "CG" t "
-The Mizuochi input method for Classical Greek using mule-unicode-0100-24ff.
+(quail-define-package "greek-mizuochi" "Greek" "CG" t
+"The Mizuochi input method for Classical Greek using mule-unicode-0100-24ff.
 
 -------------------------------------
 character     capital        small
index e78d3fe..8de0360 100644 (file)
@@ -1,3 +1,217 @@
+2006-11-30  Juanma Barranquero  <lekktu@gmail.com>
+
+       * emacsclient.c (emacs_pid): New variable.
+       (message): Remove leftover code.
+       (get_server_config): Set emacs_pid.  Don't allow Emacs to grab the
+       focus yet; emacsclient can still display an informational message
+       before sending requests to Emacs.
+       (main): Allow Emacs to grab the focus.  Simplify message() call.
+
+2006-11-30  Michael Mauger  <mmaug@yahoo.com>
+
+       * emacsclient.c (message): Make sure the message is properly
+       written even if it contains printf escapes, and flush the result.
+       (set_tcp_socket): Make the message for non-local connections
+       informational rather than an error.
+
+2006-11-28  Kevin Ryde <user42@zip.com.au>  (tiny change)
+
+       * etags.c (readline): Check for double quote after #line.
+
+2006-11-28  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>  (tiny change)
+
+       * etags.c (readline): sscanf could in principle return 2.
+
+2006-11-28  Francesco Potort\e,Al\e(B  <pot@gnu.org>
+
+       * etags.c (readline): lno is unsigned.
+       (TeX_commands): Use p++ (rather than *p++) to increment p.
+       (Lua_functions): Explicitly discard LOOKING_AT's return value.
+
+2006-11-27  Juanma Barranquero  <lekktu@gmail.com>
+
+       * makefile.w32-in (TRES): New macro (copied from nt/makefile.w32-in).
+       ($(TRES)): New rule (copied from nt/makefile.w32-in).
+       ($(BLD)/emacsclientw.exe): Add dependency.
+
+2006-11-27  Eli Zaretskii  <eliz@gnu.org>
+
+       * makefile.w32-in ($(BLD)/emacsclient.$(O)): Depend on
+       makefile.w32-in.
+
+2006-11-25  Juanma Barranquero  <lekktu@gmail.com>
+
+       * makefile.w32-in (VERSION): New macro.
+       (ECLIENT_CFLAGS): Add -DVERSION.
+
+2006-11-25  Jason Rumney  <jasonr@gnu.org>
+
+       * emacsclient.c (file_name_absolute_p) [WINDOWSNT]: Use isalpha().
+
+2006-11-24  Michael Mauger  <mmaug@yahoo.com>
+
+       * emacsclient.c (file_name_absolute_p) [WINDOWSNT]: Support
+       absolute file names with forward slashes.
+
+2006-11-23  Juanma Barranquero  <lekktu@gmail.com>
+
+       * emacsclient.c (print_help_and_exit): Tweak message contents and
+       tabs/spaces to improve alignment in message boxes.
+
+2006-11-22  Lennart Borgman  <lennart.borgman.073@student.lu.se>
+
+       * emacsclient.c: Include <stdarg.h>.
+       [WINDOWSNT]: Include <windows.h>.
+       (w32_check_console_app): New function.
+       (message): New function.
+       (decode_options, print_help_and_exit, fail, main)
+       (initialize_sockets, get_server_config, set_tcp_socket)
+       (set_local_socket, set_socket): Use message().
+
+2006-11-13  Jason Rumney  <jasonr@gnu.org>
+
+       * emacsclient.c [WINDOWSNT]: Let config.h define HAVE_SOCKETS and
+       HAVE_INET_SOCKETS.
+
+2006-11-13  Juanma Barranquero  <lekktu@gmail.com>
+
+       * makefile.w32-in (emacsclient): Depend also on emacsclientw.exe.
+       ($(BLD)/emacsclientw.exe): New target.
+       (install): Install emacsclientw.exe.
+       ($(BLD)/cvtmail.$(O), $(BLD)/emacstool.$(O)): Remove obsolete targets.
+       (ECLIENT_CFLAGS): Remove redundant flags.
+
+       * emacsclient.c [WINDOWSNT]: Undef _WINSOCKAPI_ and _WINSOCK_H.
+
+2006-11-13  Jason Rumney  <jasonr@gnu.org>
+
+       * makefile.w32-in ($(BLD)/emacsclient.$(O)): Use CFLAGS.
+
+2006-11-10  David Reitter  <david.reitter@gmail.com>
+
+       * emacsclient.c [!WINDOWSNT]: Include <sys/types.h>.
+
+2006-11-08  Juanma Barranquero  <lekktu@gmail.com>
+
+       * emacsclient.c (get_server_config) [WINDOWSNT]: Declare set_fg as
+       FARPROC to avoid a compiler warning.
+
+2006-11-07  Juanma Barranquero  <lekktu@gmail.com>
+
+       * emacsclient.c (get_server_config) [WINDOWSNT]: Look for the server
+       file on APPDATA if it doesn't exist on HOME, even if HOME is defined.
+
+       * emacsclient.c (get_server_config): Extract also the Emacs pid
+       from the server file.  On Windows, try to force the Emacs frame to
+       the foreground.
+
+2006-11-06  Juanma Barranquero  <lekktu@gmail.com>
+
+       * emacsclient.c (longopts) [!NO_SOCKETS_IN_FILE_SYSTEM]: Don't show
+       option --socket-name.
+       (decode_options): Don't get EMACS_SERVER_FILE here, it could override
+       command line options.
+       (decode_options) [!NO_SOCKETS_IN_FILE_SYSTEM]: Don't parse "-s" option.
+       (fail): Don't check for missing arguments, it is now done in set_socket.
+       (file_name_absolute_p): New function (loosely based on the one in
+       fileio.c).
+       (initialize_sockets): Don't check for duplicate loading of Winsock.
+       (get_server_config): Only try relative paths in the default
+       directory locations.
+       (set_tcp_socket): Don't call INITIALIZE().  Warn when connecting to
+       a remote server.
+       (set_socket): Call INITIALIZE().  Search explicit command-line
+       arguments, then environment variable EMACS_SERVER_FILE, then implicit
+       socket paths, before trying the alternate editor.
+       (main): Use file_name_absolute_p.
+
+2006-11-04  Eli Zaretskii  <eliz@gnu.org>
+
+       * makefile.w32-in (../src/$(BLD)/temacs.exe): Create as temporary
+       file if it doesn't already exist.
+
+2006-11-03  Juanma Barranquero  <lekktu@gmail.com>
+
+       * emacsclient.c (initialize_sockets): Don't initialize Winsock
+       more than once.
+
+2006-11-03  Mark Davies  <mark@mcs.vuw.ac.nz>
+
+       * Makefile.in (INSTALL_SCRIPT): New macro.
+       ($(DESTDIR)${archlibdir}, install): Use it, instead of INSTALL_PROGRAM.
+
+2006-11-02  Juanma Barranquero  <lekktu@gmail.com>
+
+       * grep-changelog: When called with no arguments (not even a
+       filter), show help instead of blindingly dumping every single
+       ChangeLog available.  Doc fix.  Update version.
+
+2006-11-02  Tim Van Holder  <tim.vanholder@gmail.com>  (tiny change)
+
+       * emacsclient.c [WINDOWSNT]: Define HAVE_INET_SOCKETS.
+       [!WINDOWSNT]: Include <netinet/in.h> if available.
+       [HAVE_SOCKETS]: Also require HAVE_INET_SOCKETS.
+       (IOCTL, IOCTL_BOOL_ARG): Remove.
+       (set_tcp_socket): Don't set the socket in blocking mode.
+       Remove c_arg.
+
+2006-11-01  Juanma Barranquero  <lekktu@gmail.com>
+
+       * emacsclient.c (fail) [WINDOWSNT]: Force the first argv passed to
+       execvp to point to alternate_editor (otherwise .BAT scripts can't run).
+
+2006-10-31  \e,bS\e(Bscar Fuentes  <ofv@wanadoo.es>  (tiny change)
+
+       * emacsclient.c [WINDOWSNT]: Include <malloc.h> and <stdlib.h>.
+       (close_winsock): Declare as __cdecl.
+
+2006-10-31  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * emacsclient.c [!WINDOWSNT]: Include <fcntl.h> if available.
+       (set_tcp_socket): Prefer O_NONBLOCK, then O_NDELAY, then FIONBIO
+       to set the socket in non-blocking mode.
+
+2006-10-31  Tim Van Holder  <tim.vanholder@gmail.com>  (tiny change)
+
+       * emacsclient.c [!WINDOWSNT]: Include <netinet/in.h> and <sys/ioctl.h>.
+       (INVALID_SOCKET): Define.
+       (initialize_sockets): Put #endif at the right place.
+       (set_local_socket): Use progname, not argv[0].
+
+2006-10-31  Juanma Barranquero  <lekktu@gmail.com>
+
+       * makefile.w32-in (ALL): Add emacsclient.
+       (ECLIENT_CFLAGS, ECLIENTOBJS): New macros.
+       (emacsclient, $(BLD)/emacsclient.exe): New targets.
+       (install): Install emacsclient.
+
+       * emacsclient.c: Add support for TCP sockets.
+       (SEND_STRING, SEND_QUOTED, HSOCKET, CLOSE_SOCKET, IOCTL)
+       (INITIALIZE): New macros.
+       (IOCTL_BOOL_ARG): New typedef.
+       (server_file): New global variable.
+       (longopts): New option --server-file.
+       (decode_options): Process new option --server-file and environment
+       variable EMACS_SERVER_FILE.
+       (print_help_and_exit): Document new option.
+       (fail): If no connection available and no alternate editor,
+       suggest using options to make them explicit.
+       (AUTH_KEY_LENGTH, SEND_BUFFER_SIZE): New constants.
+       (send_buffer, sblen): New variables.
+       (send_to_emacs): New function to buffer output and send it with
+       send().
+       (quote_file_name): Use SEND_STRING.
+       (close_winsock, initialize_sockets): New functions to load and
+       unload Winsock.
+       (get_server_config, set_tcp_socket): New functions to create and
+       set up TCP sockets.
+       (set_local_socket): New function to create and set up Unix
+       socket (code moved from previous implementation).
+       (set_socket): New function to chose between TCP and Unix sockets.
+       (main): Use SEND_STRING and SEND_QUOTED.  Most code moved to
+       set_local_socket.  Use set_socket.  Get answers from server.el with
+       recv(), not file stream functions.
+
 2006-10-09  Eli Zaretskii  <eliz@gnu.org>
 
        * makefile.w32-in (../src/config.h): Fix error message.
 
 2006-08-09  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
 
-       * etags.c (readline): expect sscanf returns >= 1.
+       * etags.c (readline): Expect sscanf returns >= 1.
        (readline): Change position on %n and \" in sscanf.
 
 2006-08-07  Masatake YAMATO  <jet@gyve.org>
 
-       * etags.c (readline): expect sscanf returns 2, 
-       not 1.
-       
+       * etags.c (readline): Expect sscanf returns 2, not 1.
+
 2006-08-07  Masatake YAMATO  <jet@gyve.org>
 
        * etags.c (TEX_mode): Check getc returns EOF.
 
 2002-07-30  Adrian Aichner  <adrian@xemacs.org>  (tiny change)
 
-       * etags.c: It's XEmacs, not Xemacs: change all the occurences.
+       * etags.c: It's XEmacs, not Xemacs: change all the occurrences.
 
 2006-07-30  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
 
        * Makefile.in (update-game-score.o): Delete spurious final `\'.
 
-2005-11-18  Hideki IWAMOTO <h-iwamoto@kit.hi-ho.ne.jp>  (tiny change)
+2005-11-18  Hideki IWAMOTO  <h-iwamoto@kit.hi-ho.ne.jp>  (tiny change)
 
        * etags.c (main): Cxref mode writes to stdout: do not close tagf,
        which was never opened.
 
 2005-09-11  Jason Rumney  <jasonr@gnu.org>
 
-       * makefile.w32-in (../src/config.h): Don't overwrite. Print a
+       * makefile.w32-in (../src/config.h): Don't overwrite.  Print a
        message instead.
        (../src/paths.h): Removed.
 
 
 2004-09-13  David A. Capello  <dacap@users.sourceforge.net>  (tiny change)
 
-       * etags.c: (Lua_suffixes, Lua_help, lang_names, Lua_functions):
+       * etags.c (Lua_suffixes, Lua_help, lang_names, Lua_functions):
        Support the Lua scripting language <http://www.lua.org>.
 
 2004-09-08  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
-       * etags.c: [LONG_OPTIONS]: make it TRUE (ifdef) or FALSE (ifndef)
+       * etags.c [LONG_OPTIONS]: Make it TRUE (ifdef) or FALSE (ifndef)
        for ease of use.
 
 2004-07-17  Richard M. Stallman  <rms@gnu.org>
        * emacsclient.c (quote_file_name): Quote \n.
        (main): Print a final \n when needed.
 
-2002-09-03  Francesco Potorti`  <pot@gnu.org>
+2002-09-03  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * etags.c (regex_tag_multiline, readline): Never pass pfnote a
        string that cannot be freed.
 
-2002-08-30  Francesco Potorti`  <pot@gnu.org>
+2002-08-30  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * etags.c (consider_token, C_entries): Switch to C++ parsing when
        auto-detection is enabled and the `::' qualifier is met.
        (C_entries): Several cosmetic changes.
        (C_entries): Invalidate the token is some cases.
 
-2002-08-29  Francesco Potorti`  <pot@gnu.org>
+2002-08-29  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * etags.c (C_entries): Correct a problem with const C++ funcs.
        (ignoreindent): Renamed from noindentypedefs.
        (cjava, cplpl): They are now macros instead of local vars.
 
-2002-08-28  Francesco Potorti`  <pot@gnu.org>
+2002-08-28  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * etags.c (HTML_labels): Tag ID= also.
 
-2002-08-27  Francesco Potorti`  <pot@gnu.org>
+2002-08-27  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * etags.c (Ada_funcs): Do not tag "use type Xxxx;".
 
-       * etags.c: (HTML_labels): New language HTML.
+       * etags.c (HTML_labels): New language HTML.
        (etags_strcasecmp): Like BSD's, for compatibility.
        (strcaseeq): Make it into a macro.
 
 
        * b2m.pl: New file.
 
-2002-06-21  Francesco Potorti`  <pot@gnu.org>
+2002-06-21  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
-       * etags.c: (F_getit, Fortran_functions, Ada_getit, Asm_labels)
+       * etags.c (F_getit, Fortran_functions, Ada_getit, Asm_labels)
        (Python_functions, PHP_functions, PHP_functions, PHP_functions)
        (PHP_functions, PHP_functions, Cobol_paragraphs)
        (Makefile_targets, Postscript_functions, Texinfo_nodes)
        (TeX_commands, get_tag): Use make_tag instead of pfnote.
        (get_tag): Prototype changed, all callers changed.
 
-2002-06-20  Francesco Potorti`  <pot@gnu.org>
+2002-06-20  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * etags.c: Implement implicit tag names, that is, unnamed tags
        whose name is automatically deduced by etags.el.  The advantage is
        (make_tag): New function (was the disabled function new_pfnote).
        (make_C_tag): Use it.
 
-2002-06-19  Francesco Potorti`  <pot@gnu.org>
+2002-06-19  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * etags.c (add_regex): Invalid regexp modifiers are ignored.
        (Makefile_targets): Tag variables unless --no-globals.
        (LOOP_ON_INPUT_LINES): Serious bug corrected.
 
-2002-06-13  Francesco Potorti`  <pot@gnu.org>
+2002-06-13  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * etags.c (erlang_atom, erlang_attribute): Bugs corrected.
        (invalidate_nodes): Bug corrected.
        * makefile.w32-in (lisp): Add international/ucs-tables.elc and
        font-core.elc.
 
-2002-06-12  Francesco Potorti`  <pot@gnu.org>
+2002-06-12  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * etags.c: New multi-line regexp and new regexp syntax.
        (arg_type): at_icregexp label removed (obsolete).
        (readline_internal): If necessary, copy the whole file into filebuf.
        (readline): Skip multi-line regexps, leave them to regex_tag_multiline.
 
-2002-06-11  Francesco Potorti`  <pot@gnu.org>
+2002-06-11  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * etags.c (add_regex): Better check for null regexps.
        (readline): Check for regex matching null string.
        (find_entries): Reorganisation.
 
-2002-06-07  Francesco Potorti`  <pot@gnu.org>
+2002-06-07  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * etags.c (scan_separators): Support all character escape
        sequences supported by Gcc.
        (readline): Conditionally undo readline_internal increment.
        (readline): Do not return a value.
 
-2002-06-06  Francesco Potorti`  <pot@gnu.org>
+2002-06-06  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * etags.c: New option --parse-stdin=FILE.
        (enum arg_type): New label at_stdin.
        (TEX_tabent, TEX_token): Deleted.
        (TeX_commands, TEX_decode_env): Streamlined.
 
-2002-06-05  Francesco Potorti`  <pot@gnu.org>
+2002-06-05  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * etags.c (main): Avoid a buffer overrun with sprintf.
 
        * update-game-score.c (read_score) [HAVE_GETDELIM]: Trim trailing
        space.
 
-2002-04-22  Francesco Potorti`  <pot@gnu.org>
+2002-04-22  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
-       * etags.c: (last_node): Make it a global variable.
+       * etags.c (last_node): Make it a global variable.
        (process_file): Print the tags from the nodes as soon as
        possible, and delete the nodes.  This brings down the memory
        occupancy as etags to almost the same level as when the #line
        * update-game-score.c: Move config.h before the other headers, to
        avoid compiler warnings.
 
-2002-04-16  Francesco Potorti`  <pot@gnu.org>
+2002-04-16  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * etags.c (find_entries): Bug fix in list management.
 
-2002-04-15  Francesco Potorti`  <pot@gnu.org>
+2002-04-15  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * etags.c (get_language_from_filename): Add one argument.
        (strcaseeq): New function.
        (find_entries): Try with case insensitive match.
        (process_file): Bug fixed.
 
-2002-04-13  Francesco Potorti`  <pot@gnu.org>
+2002-04-13  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * etags.c (find_entries): Delete tags previously obtained from
        file xxx.c's #line directives when parsing file xxx.y.  This is
 
 2002-04-10  Colin Walters  <walters@verbum.org>
 
-       * update-game-score.c: (toplevel): Include stdarg.h.
+       * update-game-score.c (toplevel): Include stdarg.h.
        (MAX_DATA_LEN, MAX_SCORES): New.
        (SCORE_FILE_PREFIX): If HAVE_SHARED_GAME_DIR is not defined,
        default to ~/.emacs.d/games.
        `sort TAGFILE -o TAGFILE', as POSIX 1003.1-2001 disallows
        the latter usage.
 
-2002-03-12  Francesco Potorti`  <pot@gnu.org>
+2002-03-12  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * etags.c (Python_functions): Skip spaces at beginning of lines.
        (Python_functions, PHP_functions): Name tags, for ctags' sake.
        * etags.c (put_entries): Use #if !CTAGS, to fix link error on
        compilers that don't optimize out dead code.
 
-2002-03-05  Francesco Potorti`  <pot@gnu.org>
+2002-03-05  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * etags.c: Honour #line directives.
        (no_line_directive): New global var; set it for old behaviour.
        * cvtmail.c, emacsclient.c, emacsserver.c, pop.c, sorted-doc.c,
        * yow.c: Include <config.h>.
 
-2001-12-21  Francesco Potorti`  <pot@gnu.org>
+2001-12-21  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * etags.c (Perl_functions): Tag packages and use them in sub tags.
        (get_tag): Return a pointer to the tag that is found.
        (L_isdef, L_isquote): Removed.
        (Lisp_functions, L_getit): Clarified.
 
-       * etags.c: (P_): Renamed to __P for consistency with config.h.
+       * etags.c (P_): Renamed to __P for consistency with config.h.
        [HAVE_CONFIG_H]: Let config.h deal with __P.
        [__STDC__] [!HAVE_CONFIG_H]: Define PTR as in config.h.
        [!__STDC__] [!HAVE_CONFIG_H]: Do not undefine static, because
        gperf code needs it.
-       [HAVE_CONFIG_H] [!PTR]: Define PTR (for use with Xemacs).
-       [HAVE_CONFIG_H] [!__P]: Define __P (for use with Xemacs).
+       [HAVE_CONFIG_H] [!PTR]: Define PTR (for use with XEmacs).
+       [HAVE_CONFIG_H] [!__P]: Define __P (for use with XEmacs).
        (xmalloc, xrealloc): Use PTR instead of long *.
        (bool): Make it a define, not a typedef, for C++ compilers.
        (pattern): Members renamed to avoid name clash in some C++ compilers.
        not <../src/epaths.h>.
        (malloc, realloc) [!HAVE_STDLIB_H]: Prototype.
 
-2001-12-12  Francesco Potorti`  <pot@gnu.org>
+2001-12-12  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * etags.c (PHP_functions): New function for parsing PHP.
        (LOOKING_AT): New macro.
        * ebrowse.c (main): Check that the output file exists and
        is non-empty if invoked with `--append'.
 
-2001-05-14  Francesco Potorti`  <pot@gnu.org>
+2001-05-14  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * etags.c (add_regex): Reset the whole newly allocated pattern
        buffer instead of the individual members.  It's safer and works
-       with Xemacs.
+       with XEmacs.
 
        * etags.1: Markups corrected.
 
 
        * makefile.w32-in: Fix copyright notice.
 
-2001-02-23  Francesco Potorti`  <pot@gnu.org>
+2001-02-23  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * etags.c (enum sym_type): New label st_C_template.
        (gperf input): Use it for switching to C++ from C.
 
        * etags.c (in_word_set): Use `static' in definition (for pcc).
 
-2001-01-31  Francesco Potorti`  <pot@gnu.org>
+2001-01-31  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
-       * etags.c: [NDEBUG] #undef assert and #define it as ((void)0), for
+       * etags.c [NDEBUG]: #undef assert and #define it as ((void)0), for
        the sake of some buggy assert.h (e.g. in MinGW and sunos4 pcc).
        (C_entries): Tag token renamed to still_in_token because sunos4
        pcc wants to expand it as the token() macro even though it has no
        * etags.c (assert) [__MINGW32__]: Redefine assert to work around a
        bug in the Mingw32 assert.h header file.
 
-2001-01-30  Francesco Potorti`  <pot@gnu.org>
+2001-01-30  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
-       * etags.c: [WIN32-NATIVE]: #undef MSDOS, #undef WINDOWSNT and
-       #define it for the sake of Xemacs.
+       * etags.c [WIN32-NATIVE]: #undef MSDOS, #undef WINDOWSNT and
+       #define it for the sake of XEmacs.
        [WINDOWSNT]: #undef HAVE_NTGUI even if built without
        HAVE_CONFIG_H.  This change only affects a standalone etags.
        [WINDOWSNT]: #undef DOS_NT and #define it even if built with
        [!HAVE_UNISTD_H]: use defined(WINDOWSNT) instead of the bare
        WINDOWSNT, as this is the correct way to use it.
 
-2001-01-28  Francesco Potorti`  <pot@gnu.org>
+2001-01-28  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * etags.c: Be capable to parse nested struct-like structures.
        (structdef, structtag): Struct state machine revisited.
        (matching_regexp): Use them instead of static variables in
        function scope.
 
-2001-01-25  Francesco Potorti`  <pot@gnu.org>
+2001-01-25  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * etags.c (struct tok): Renamed from struct token.
        (token): Renamed from tok.
        * ebrowse.c (xfree): New function.
        (member, declaration, globals): Use xmalloc instead of alloca.
 
-2001-01-15  Francesco Potorti`  <pot@gnu.org>
+2001-01-15  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * etags.c (print_language_names): Print filenames in addition to
        suffixes.
 
-2001-01-14  Francesco Potorti`  <pot@gnu.org>
+2001-01-14  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * etags.c (get_language_from_langname): Renamed from
        get_language_from_name.
 
        * etags.c (lisp_suffixes)  Add `LSP'.
 
-2000-02-10  Francesco Potorti`  <pot@gnu.org>
+2000-02-10  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * etags.c (iswhite): Redefine not to consider '\0' as white
        space, and use it throughout in place of isspace, thus preventing a
        potential signed char to int conversion problem.
        (MSDOS): #undefine befere redefining
 
-2000-02-04  Francesco Potorti`  <pot@gnu.org>
+2000-02-04  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * etags.c (many functions): Add prototypes.
 
        * etags.c (pfnote, new_pfnote, C_entries, prolog_pred)
        (erlang_func): Add `static' to definitions to keep pcc happy.
 
-2000-01-31  Francesco Potorti`  <pot@gnu.org>
+2000-01-31  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * etags.c [MSDOS]: Set MSDOS to 1 if #defined, 0 otherwise.
        (get_compressor_from_suffix, process_file): Use MSDOS in if clause.
        * movemail.c (popmail): Allow mailbox specifications of the
        form `po:username:hostname'.
 
-1999-11-19  Francesco Potorti`  <pot@gnu.org>
+1999-11-19  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * etags.c (_GNU_SOURCE): Define only if undefined.
        (get_scheme): Declaration deleted.
 
        * etags.c (print_help): Change email address to send bugs to.
 
-1999-11-01  Francesco Potorti`  <pot@gnu.org>>
+1999-11-01  Francesco Potort\e,Al\e(B  <pot@gnu.org>>
 
        * etags.c: Add suffix psw for PSWrap.
        (L_getit): Generalize a "cp!=' '" into "!isspace(*cp)".
        [MSDOS]: Support DOS file names by handling e.g. foo.cgz as if it
        were foo.c.gz.
 
-1999-11-01  Francesco Potorti`  <pot@gnu.org>
+1999-11-01  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * etags.c (sym_type, C_stab_entry): New constant st_C_operator.
        (fvdev): New constant foperator.
        (add_regex): New arg determining whether to use translation table.
        (analyse_regex): New arg.  Use it for add_regex.
 
-1999-11-01  Francesco Potorti`  <pot@gnu.org>
+1999-11-01  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * etags.c (init): Cosmetic change: NULL --> '\0'.
        (erlang_attribute): Bug corrected (uninitialized variable).
        Change name of local vars to avoid clashes with typedef linebuffer.
        (readline): Rewritten for new functionality.
 
-       * etags.c: (Scheme_suffixes): New suffix ".ss".
+       * etags.c (Scheme_suffixes): New suffix ".ss".
        (print_help): --globals is now used for more than C-type languages.
        (Perl_functions): Tag global variables ("my" and "local").
 
        characters and compilers with default signed chars.
        (L_getit): Tag "(defstruct (foo", "(defun (operator" and similar
        constructs.
+       (C_stab_entry): "interface" in Java behaves like "class".
 
-       * (C_stab_entry): "interface" in Java behaves like "class".
-
-       * etags.c: (HAVE_NTGUI) [WINDOWSNT]: #undef if HAVE_CONFIG_H.
+       * etags.c (HAVE_NTGUI) [WINDOWSNT]: #undef if HAVE_CONFIG_H.
        (main): Put interval syntax here.
        (add_regex): And remove it from here.
 
 
 1997-10-16  Dave Love  <d.love@dl.ac.uk>
 
-       * etags.c (L_getit): Always make named tags so that Emacs
-       completion on symbols containing `:' etc. works.
-       (get_scheme): Likewise.
+       * etags.c (L_getit): Always make named tags so that Emacs
+       completion on symbols containing `:' etc. works.
+       (get_scheme): Likewise.
 
 1997-09-24  Jonathan I. Kamens  <jik@kamens.brookline.ma.us>
 
 1997-07-22  Jonathan I. Kamens  <jik@kamens.brookline.ma.us>
 
        * pop.c: Support auto-configuration of both Kerberos V4 and
-       Kerberos V5 for movemail, including detection of V4 and V5 header
-       files and libraries.
+       Kerberos V5 for movemail, including detection of V4 and V5 header
+       files and libraries.
        Include <string.h> when STDC_HEADERS is defined, to get
-       declarations of string functions.
+       declarations of string functions.
        [KERBEROS5] (socket_connection): Support the current MIT Kerberos
-       V5 API rather than the old one.
+       V5 API rather than the old one.
        [KERBEROS] (socket_connection): Change a constant name from
-       SOCKET_ERROR to POP_SOCKET_ERROR to avoid a namespace conflict
-       with a constant in a header file.
+       SOCKET_ERROR to POP_SOCKET_ERROR to avoid a namespace conflict
+       with a constant in a header file.
 
        * Makefile.in: Support auto-configuration of both Kerberos V4 and
-       Kerberos V5 for movemail, including detection of V4 and V5 header
-       files and libraries.
+       Kerberos V5 for movemail, including detection of V4 and V5 header
+       files and libraries.
 
 1997-07-17  Richard Stallman  <rms@psilocin.gnu.ai.mit.edu>
 
 
        * movemail.c (rindex): Add declaration.
 
-Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
+1997-07-01  Geoff Voelker  <voelker@cs.washington.edu>
 
        * makefile.nt (GETOPTOBJS, GETOPTDEFS, MOVEMAILOBJS): Define.
        (movemail.exe): Depend upon and link with getopt files.
@@ -2572,14 +2784,14 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        * b2m.c (readline): Terminate buffer properly when EOF seen.
        Test for valid pointer before dereferencing it.
 
-1997-05-30  Francesco Potorti`  <F.Potorti@cnuce.cnr.it>
+1997-05-30  Francesco Potort\e,Al\e(B  <F.Potorti@cnuce.cnr.it>
 
        * Makefile.in (etags): Remove -DETAGS_REGEXPS, because now it is
        defined inside etags.c if HAVE_CONFIG_H is defined.
 
-1997-05-29  Francesco Potorti`  <F.Potorti@cnuce.cnr.it>
+1997-05-29  Francesco Potort\e,Al\e(B  <F.Potorti@cnuce.cnr.it>
 
-       * etags.c: (logical): Type name changed to bool.
+       * etags.c (logical): Type name changed to bool.
        (ETAGS_REGEXPS, LONG_OPTIONS) [HAVE_CONFIG_H]: #define them.
        (<getopt.h>) [LONG_OPTIONS]: Include conditionally.
        (getopt_long) [!LONG_OPTIONS]: Redefine as macro.
@@ -2589,7 +2801,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        defined  conditionally to ETAGS_REGEXPS.
        (print_help): Updated.
 
-1997-05-22  Francesco Potorti`  <F.Potorti@cnuce.cnr.it>
+1997-05-22  Francesco Potort\e,Al\e(B  <F.Potorti@cnuce.cnr.it>
 
        * etags.c (C_entries): Use "." instead of "::" for Java.
        (consider_token): is_func renamed to is_func_or_var.
@@ -2604,7 +2816,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        (main, C_entries): Use them.
        (make_C_tag, C_entries): Make tok a global variable.
 
-1997-05-16  Francesco Potorti`  <F.Potorti@cnuce.cnr.it>
+1997-05-16  Francesco Potort\e,Al\e(B  <F.Potorti@cnuce.cnr.it>
 
        * etags.c (funcdef): New vignore constant.
        (consider_token, C_entries): Use it to tag global variables.
@@ -2614,7 +2826,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        (Cobol_suffixes, lang_names, Cobol_paragraphs): Cobol support.
        (prolog_white, erlang_white): Renamed to eat_white, callers changed.
 
-1997-05-15  Francesco Potorti`  <F.Potorti@cnuce.cnr.it>
+1997-05-15  Francesco Potort\e,Al\e(B  <F.Potorti@cnuce.cnr.it>
 
        * etags.c (CHARS, CHAR): New constant and macro.
        (iswhite, begtoken, intoken, endtoken): Use them.
@@ -2624,13 +2836,13 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        (make_C_tag) [traditional_tag_style]: Use it.
        (traditional_tag_style): Costant set to TRUE for now.
 
-1997-05-14  Francesco Potorti`  <F.Potorti@cnuce.cnr.it>
+1997-05-14  Francesco Potort\e,Al\e(B  <F.Potorti@cnuce.cnr.it>
 
        * etags.c (C_entries, Pascal_functions): Cleanup.
        (TeX_functions): NULL as a function arg needs a cast.
        (Erlang_functions, erlang_func, erlang_attribute): Cleanup.
 
-1997-05-13  Francesco Potorti`  <F.Potorti@cnuce.cnr.it>
+1997-05-13  Francesco Potort\e,Al\e(B  <F.Potorti@cnuce.cnr.it>
 
        * etags.c (TeX_functions): Cleaned up.
        (tex_getit): Removed.
@@ -2638,9 +2850,9 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 1997-05-13  Paul Eggert  <eggert@twinsun.com>
 
        * rcs2log (files): When computing arguments automatically, ignore
-       non-files within the RCS subdirectory.
+       non-files within the RCS subdirectory.
 
-1997-05-13  Francesco Potorti`  <F.Potorti@cnuce.cnr.it>
+1997-05-13  Francesco Potort\e,Al\e(B  <F.Potorti@cnuce.cnr.it>
 
        * etags.c (C_JAVA): New #define.
        (Cjava_suffixes): .java is Java.
@@ -2650,9 +2862,9 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        (C_stab_entry): Add `extends' and `implements' keywords.
        (consider_token, C_entries): Recognise Java structures.
 
-1997-05-12  Francesco Potorti`  <F.Potorti@cnuce.cnr.it>
+1997-05-12  Francesco Potort\e,Al\e(B  <F.Potorti@cnuce.cnr.it>
 
-       * etags.c: (Cplusplus_suffixes): .pdb is Postscript with C syntax.
+       * etags.c (Cplusplus_suffixes): .pdb is Postscript with C syntax.
        (Postscript_suffixes): .ps is Postscript.
        (lang_names): Add Postscript.
        (Postscript_functions): New function.
@@ -2662,10 +2874,10 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 1997-05-11  Paul Eggert  <eggert@twinsun.com>
 
        * rcs2log (loginFullnameMailaddrs, logins, rlog_options, files):
-       Don't prepend $nl since this causes some shells to generate the
-       empty string when IFS is $nl.
+       Don't prepend $nl since this causes some shells to generate the
+       empty string when IFS is $nl.
        (printlogline): Use SOH (octal code 1), not CR, since some
-       PC-based shells mishandle CR.
+       PC-based shells mishandle CR.
        (initialize_fullname): Set NIS_PATH to the empty string before invoking
        nismatch, in case it's set to some nonstandard value.
 
@@ -2674,7 +2886,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        * pop.c (getline): Don't miss CRLF pairs when the CR and LF are
        read in separate blocks.
 
-1997-04-30  Francesco Potorti`  <F.Potorti@cnuce.cnr.it>
+1997-04-30  Francesco Potort\e,Al\e(B  <F.Potorti@cnuce.cnr.it>
 
        * etags.c [TeX_named_tokens]: Set to FALSE if undefined.
        (struct linebuffer): New member `len' is the length of the string.
@@ -2692,14 +2904,14 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        * makefile.nt: Change references of windowsnt.h to ms-w32.h.
        (obj): Change references of nt*.c files to w32*.c files.
 
-1997-04-15  Francesco Potorti`  <F.Potorti@cnuce.cnr.it>
+1997-04-15  Francesco Potort\e,Al\e(B  <F.Potorti@cnuce.cnr.it>
 
        * etags.c (xnew): Add support for debugging with chkmalloc.
        (error): Use this instead of printf whenever possible.
        (main): Only call xnew after having initialised progname.
        (substitute): Bad memory corruption error corrected.
 
-1997-04-08  Francesco Potorti`  <F.Potorti@cnuce.cnr.it>
+1997-04-08  Francesco Potort\e,Al\e(B  <F.Potorti@cnuce.cnr.it>
 
        * etags.c (add_regex): Undo previous change.
        (relative_filename): Small memory leak closed.
@@ -2709,11 +2921,11 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 1997-03-21  Paul Eggert  <eggert@twinsun.com>
 
        * rcs2log (files): Ignore files in RCS directory whose names are
-       of the form ,*, or *_; they are probably RCS lock files.
-       Also, ignore files named .rcsfreeze.log or .rcsfreeze.ver;
+       of the form ,*, or *_; they are probably RCS lock files.
+       Also, ignore files named .rcsfreeze.log or .rcsfreeze.ver;
        they are used by rcsfreeze.
 
-1997-03-14  Francesco Potorti`  <F.Potorti@cnuce.cnr.it>
+1997-03-14  Francesco Potort\e,Al\e(B  <F.Potorti@cnuce.cnr.it>
 
        * etags.c (add_regex): reset *putbuf before using it.
 
@@ -2743,7 +2955,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
 1997-01-20  Paul Eggert  <eggert@twinsun.com>
 
-       * rcs2log: (--help, --version): New options, per GNU coding standards.
+       * rcs2log (--help, --version): New options, per GNU coding standards.
        (Copyright, Help, Id): New variables, for above.
        (rlog): Use -q option with cvs log, to avoid useless chatter.
 
@@ -2764,26 +2976,26 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 1996-12-18  Jonathan I. Kamens  <jik@annex-1-slip-jik.cam.ov.com>
 
        * Makefile.in (LIBMAIL): New macro.  Conditionally includes -lmail.
-       (movemail): Use LIBMAIL, to link against -lmail.
+       (movemail): Use LIBMAIL, to link against -lmail.
 
        * movemail.c: Include maillock.h (conditionally).
        Remove a redundant inclusion of <stdio.h>.
        (MAIL_USE_MAILLOCK): New macro, conditionally defined.
        (main): Add variable spool_name.
        Support the usage of maillock and mailunlock to
-       lock and unlock mailboxes.
+       lock and unlock mailboxes.
        (mail_spool_name): New function.
 
        * movemail.c: Fix an uninitialized variable which could cause
-       movemail to exit with an error status incorrectly on systems which
-       use lock files rather than a system locking function to lock
-       mailboxes.
+       movemail to exit with an error status incorrectly on systems which
+       use lock files rather than a system locking function to lock
+       mailboxes.
 
 1996-12-16  Richard Stallman  <rms@psilocin.gnu.ai.mit.edu>
 
        * pop.c (socket_connection): Free realhost after using it.
 
-1996-12-04  Francesco Potorti`  <F.Potorti@cnuce.cnr.it>
+1996-12-04  Francesco Potort\e,Al\e(B  <F.Potorti@cnuce.cnr.it>
 
        * etags.c (C_entries): Test tok.valid.  This handles some
        particular cases involving function declarations that failed.
@@ -2794,14 +3006,14 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        gethostbyname may return a pointer to static data.
        krb_realmofhost can clobber it.  So copy it.
 
-1996-11-14  Francesco Potorti`  <F.Potorti@cnuce.cnr.it>
+1996-11-14  Francesco Potort\e,Al\e(B  <F.Potorti@cnuce.cnr.it>
 
        * etags.c (pfnote, fatal, error): Callers using a NULL pointer
        must cast it to (char *) because we have no prototypes.
        (make_C_tag): Macro deleted, new function.
        (C_entries): Calls to make_C_tag macro changed to call function.
 
-1996-11-13  Francesco Potorti`  <F.Potorti@cnuce.cnr.it>
+1996-11-13  Francesco Potort\e,Al\e(B  <F.Potorti@cnuce.cnr.it>
 
        * etags.c (grow_linebuffer): New function.
        (GROW_LINEBUFFER): Macro deleted.  All callers changed.
@@ -2811,7 +3023,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        number of arguments.
        (xrealloc): fatal was called with wrong number of arguments
 
-1996-11-08  Francesco Potorti`  <F.Potorti@cnuce.cnr.it>
+1996-11-08  Francesco Potort\e,Al\e(B  <F.Potorti@cnuce.cnr.it>
 
        * etags.c (relative_filename): Bug corrected.
        (etags_getcwd): Avoid warning of unused variable.
@@ -2820,7 +3032,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 1996-11-03  Paul Eggert  <eggert@twinsun.com>
 
        * rcs2log: When processing cvs log output, remove `Attic/' from
-       repository file names.
+       repository file names.
 
 1996-10-22  Karl Heuer  <kwzh@gnu.ai.mit.edu>
 
@@ -2829,7 +3041,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 1996-10-12  Paul Eggert  <eggert@twinsun.com>
 
        * rcs2log (rlog_options): Look for ' option' rather than 'unknown
-       option', since CVS says 'invalid option'.
+       option', since CVS says 'invalid option'.
        (datearg): Use the empty string, not '-d>1970-01-01', to extract all
        revisions, since some hosts reject 1970-01-01 when east of UTC.
        (date): Remove.
@@ -2838,7 +3050,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
        * etags.c (etags_getcwd) [WINDOWSNT]: Convert backslashes to slashes.
 
-1996-10-02  Francesco Potorti`  <F.Potorti@cnuce.cnr.it>
+1996-10-02  Francesco Potort\e,Al\e(B  <F.Potorti@cnuce.cnr.it>
 
        * etags.c (print_version): Print copyright info.
 
@@ -2850,7 +3062,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 1996-09-29  Dave Love  <d.love@dl.ac.uk>
 
        * rcs2log (date): Make default format acceptable to CVS post v1.8
-       as well as earlier CVSs and RCS.
+       as well as earlier CVSs and RCS.
 
 1996-09-29  Richard Stallman  <rms@ethanol.gnu.ai.mit.edu>
 
@@ -2860,7 +3072,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 1996-09-25  Paul Eggert  <eggert@twinsun.com>
 
        * rcs2log (rlog_options): Use $rlog, not rlog, when deciding
-       whether to append -zLT.
+       whether to append -zLT.
 
 1996-09-16  Karl Heuer  <kwzh@gnu.ai.mit.edu>
 
@@ -2890,7 +3102,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
        * emacsserver.c: On fatal signal, delete socket-file:
        * emacsserver.c: Include signal.h.
-       (xmalloc, fatal, error): New functions.
+       (xmalloc, fatal, error): New functions.
        (delete_socket, handle_signals): New functions.
        (progname, socket_name): New variables.
         [HAVE_SOCKETS] (main): Call handle_signals; set the new variables.
@@ -2984,7 +3196,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
 1996-07-15  David Mosberger-Tang  <davidm@AZStarNet.com>
 
-       * cvtmail.c, sorted-doc.c, yow.c: [__GNU_LIBRARY__]: Use <string.h>.
+       * cvtmail.c, sorted-doc.c, yow.c [__GNU_LIBRARY__]: Use <string.h>.
        * emacsserver.c (main) [__GNU_LIBRARY__]: Use size_t for fromlen.
        * etags.c, fakemail.c, profile.c: Declare main as int, not void.
 
@@ -3002,7 +3214,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
        * makefile.nt: Remove all references to wakeup.
 
-1996-06-28  Francesco Potorti`  <F.Potorti@cnuce.cnr.it>
+1996-06-28  Francesco Potort\e,Al\e(B  <F.Potorti@cnuce.cnr.it>
 
        * etags.c (C_stab_entry): New keywords for C++ namespace, bool,
        explicit, mutable, typename.
@@ -3033,7 +3245,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
        * Version 19.31 released.
 
-1996-05-17  Francesco Potorti`  <F.Potorti@cnuce.cnr.it>
+1996-05-17  Francesco Potort\e,Al\e(B  <F.Potorti@cnuce.cnr.it>
 
        * etags.c (CNL_SAVE_DEFINEDEF): Set linecharno for use by readline.
        (Pascal_functions): Increase linecharno by the correct number of
@@ -3146,21 +3358,21 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
        * makefile.nt: Change uses of del to $(DEL).
 
-1996-03-22  Francesco Potorti`  <F.Potorti@cnuce.cnr.it>
+1996-03-22  Francesco Potort\e,Al\e(B  <F.Potorti@cnuce.cnr.it>
 
        * etags.c (just_read_file): Reset lineno and charno on entry.
 
 1996-03-15  Anders Lindgren  <andersl@csd.uu.se>
 
        * etags.c: Prolog language totaly rewritten.
-        (Prolog_functions): Rewritten from scratch.
+       (Prolog_functions): Rewritten from scratch.
        (skip_comment, prolog_getit): Removed.
-        (prolog_skip_comment): New function, like old skip_comment.
-        (prolog_pred, prolog_atom, prolog_white): New functions.
-        (erlang_func, erlang_attributes): Forward declarations added.
-        (erlang_atom): Check if backslash ends line inside quoted atom.
+       (prolog_skip_comment): New function, like old skip_comment.
+       (prolog_pred, prolog_atom, prolog_white): New functions.
+       (erlang_func, erlang_attributes): Forward declarations added.
+       (erlang_atom): Check if backslash ends line inside quoted atom.
 
-1996-03-14  Francesco Potorti`  <F.Potorti@cnuce.cnr.it>
+1996-03-14  Francesco Potort\e,Al\e(B  <F.Potorti@cnuce.cnr.it>
 
        * etags.c (absolutefn): DOS_NT version corrected.
        (main): Append "/" to the dir name only if not already there.
@@ -3248,7 +3460,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
        * Makefile.in (THIS_IS_MAKEFILE): Renamed from THIS_IS_YMAKEFILE.
 
-1995-12-07  Francesco Potorti`  <pot@cnuce.cnr.it>
+1995-12-07  Francesco Potort\e,Al\e(B  <pot@cnuce.cnr.it>
 
        * etags.c (pfnote): Don't make a tag for ctags if there is no name.
        (getit, Asm_labels, Perl_functions, Pascal_functions, L_getit,
@@ -3260,7 +3472,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        (main): Let get_language_from_name make language existence check.
        (streq, strneq): Check the arguments #if DEBUG.
 
-1995-12-06  Francesco Potorti`  <pot@cnuce.cnr.it>
+1995-12-06  Francesco Potort\e,Al\e(B  <pot@cnuce.cnr.it>
 
        * etags.c (Cplusplus_suffixes): Add .M suffix for Objective C++.
        (gperf): Added keywords for Objective C and GNU macros.
@@ -3277,10 +3489,10 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        (C_entries): Consider // as a comment start even in plain C for
        the sake of Objective C parsing.
 
-1995-12-04  Francesco Potorti`  <pot@cnuce.cnr.it>
+1995-12-04  Francesco Potort\e,Al\e(B  <pot@cnuce.cnr.it>
 
        * Makefile.in (ctags): depend on etags only for simplicity;
-       compile with regexp support enabled.
+       compile with regexp support enabled.
 
 1995-11-24  Richard Stallman  <rms@mole.gnu.ai.mit.edu>
 
@@ -3306,7 +3518,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        w32fns.c, w32faces.c, w32select.c, w32menu.c, w32reg.c; remove
        Windows 95 conditional.
 
-1995-11-06  Francesco Potorti`  (pot@cnuce.cnr.it)
+1995-11-06  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (get_lang_from_name, get_lang_from_interpreter,
        get_lang_from_suffix): New functions.
@@ -3319,7 +3531,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        (Perl_functions): New function.
        (lang_suffixes): .pl and .pm are Perl suffixes.
 
-1995-11-02  Francesco Potorti`  (pot@cnuce.cnr.it)
+1995-11-02  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (lowcase): Use the standard tolower function.
        (substitute): Remove some wrong and some useless code related with
@@ -3347,7 +3559,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        [! O_RDONLY]: Define it to zero.
        (main): Use O_RDONLY instead of explicit zero.
 
-1995-08-17  Francesco Potorti`  (pot@cnuce.cnr.it)
+1995-08-17  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (Pascal_functions): Close comment bug corrected.
        (add_node): Correctly compare node file names.
@@ -3402,7 +3614,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        * Makefile.in.in (install, maybe-blessmail): Don't cd ..;
        configure has already set $(INSTALL) to the proper relative path.
 
-1995-06-27  Francesco Potorti`  (pot@cnuce.cnr.it)
+1995-06-27  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (plain_C_entries): new function.
        (lowcase): new macro.
@@ -3433,14 +3645,14 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 1995-06-28  Richard Stallman  <rms@mole.gnu.ai.mit.edu>
 
        * emacsserver.c: Make all error messages start with `Error: '.
-       (fatal_error, perror_1): New functions, use throughout.
+       (fatal_error, perror_1): New functions, use throughout.
 
 1995-06-28  Paul Eggert  <eggert@twinsun.com>
 
        * rcs2log (CVSROOT, repository):
        Allow remote repositories a la CVS 1.4.
 
-1995-06-27  Francesco Potorti`  (pot@cnuce.cnr.it)
+1995-06-27  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (plain_C_entries): new function.
        (lowcase): new macro.
@@ -3458,7 +3670,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
        * make-docfile.c (scan_file): Make sure it never looks at filename[-1].
 
-1995-06-21  Francesco Potorti`  (pot@cnuce.cnr.it)
+1995-06-21  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (find_entries): Rewind before rereading the input file.
 
@@ -3490,7 +3702,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        * rcs2log (output_authors): Allow ':' in time zone,
        as per ISO 8601 and RCS 5.6.8 beta.
 
-1995-05-29  Francesco Potorti`  (pot@cnuce.cnr.it)
+1995-05-29  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (etags_getcwd): Undo the /bin/pwd change.  It may raise
        compatibility problems.
@@ -3513,7 +3725,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        (make-docfile.obj): Depend upon config.h.
        Clean up comments.
 
-1995-05-23  Francesco Potorti`  (pot@cnuce.cnr.it)
+1995-05-23  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (etags_getcwd): Use /bin/pwd instead of pwd because the
        former gives the true path even in the presence of simlinks.
@@ -3623,12 +3835,12 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        even if HAVE_SYSVIPC.
        * emacsclient.c (main): Use getcwd if not BSD.
 
-1995-03-13  Francesco Potorti`  (pot@cnuce.cnr.it)
+1995-03-13  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (process_file): free (filename) after using it.
        (readline_internal): Do not access the char before start of line.
 
-1995-02-22  Francesco Potorti`  (pot@cnuce.cnr.it)
+1995-02-22  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (C_entries): token_saved removed.  Initialise tok.valid and
        savetok.valid.  Mark token as valid when it is initialised.
@@ -3636,12 +3848,12 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        (CNL_SAVE_DEFINEDEF): Test for savetok.valid instead of token_saved.
        (TOKEN): Added a new member: valid.
 
-1995-02-15  Francesco Potorti`  (pot@cnuce.cnr.it)
+1995-02-15  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (C_entries): Bug corrected in xrealloc of token_str.
        (main): Do not read twice the last filename in the stdin file list.
 
-1995-02-14  Francesco Potorti`  (pot@cnuce.cnr.it)
+1995-02-14  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (C_entries): Initialise the new members of TOKEN.
        (C_entries): Do not allocate a new space for each token found by
@@ -3658,18 +3870,18 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
        * Makefile.in.in (maintainer-clean): Renamed from realclean.
 
-1995-02-01  Francesco Potorti`  (pot@cnuce.cnr.it)
+1995-02-01  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (pfnote): Initialise been_warned in the node.
        (C_entries): Removed a speed hack for the sake of clarity.
 
-1995-01-18  Francesco Potorti`  (pot@cnuce.cnr.it)
+1995-01-18  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (longopts, print_help, main): Use -I as abbreviation
        for the --ignore-indentation option.
        (main): Do not print an error message for unknown options.
 
-1995-01-12  Francesco Potorti`  (pot@cnuce.cnr.it)
+1995-01-12  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (FILEPOS, GET_CHARNO, GET_FILEPOS, max, LINENO): Deleted.
        (append_to_tagfile, typedefs, typedefs_and_cplusplus,
@@ -3701,13 +3913,13 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
        * movemail.c (main): Skip past the colon in inname.
 
-1995-01-10  Francesco Potorti`  (pot@cnuce.cnr.it)
+1995-01-10  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (pfatal): New function.
        (main, etags_getcwd): Use pfatal.
        (etags_getcwd): Corrected another bug in the HAVE_GETCWD version.
 
-1995-01-10  Francesco Potorti`  (pot@cnuce.cnr.it)
+1995-01-10  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (Lang_function): Use void instead to declare the
        language functions, because many compilers are buggy.
@@ -3715,7 +3927,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        (readline_internal): Discard possible \r before \n here.
        (C_entries): Do not deal with \r here: undo previous fix.
 
-1995-01-09  Francesco Potorti`  (pot@fly)
+1995-01-09  Francesco Potort\e,Al\e(B  (pot@fly)
 
        * b2m.c (concat, xmalloc, xrealloc, readline, xnew): Four new
        functions and a macro that allow the program to work on input
@@ -3756,12 +3968,12 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
        * emacsclient.c [!HAVE_SYSVIPC] (main): Fix error message diction.
 
-1994-11-22  Francesco Potorti`  (pot@cnuce.cnr.it)
+1994-11-22  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (print_help): print --regex usage for ctags also.
        (main): use -h in addition to -H as abbreviation for --help.
 
-1994-11-16  Francesco Potorti`  (pot@cnuce.cnr.it)
+1994-11-16  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c [ETAGS_REGEXP]: All the new code that deals with regexps
        is compiled if this is defined.  The new functions and variables
@@ -3790,7 +4002,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        (prolog_getit, skip_comment): Rewritten for speed.
        (readline): Rewritten to deal with regexps.
 
-1994-11-16  Francesco Potorti`  (pot@cnuce.cnr.it)
+1994-11-16  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (<errno.h>): #include added.
        (etags_getcwd): Check return value from getcwd.
@@ -3800,7 +4012,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        * profile.c (TV1, TV2): Use EMACS_TIME as type.
        (get_time): Use EMACS_SUB_TIME.
 
-1994-10-30  voelker  <voelker@cs.washington.edu>
+1994-10-30  Geoff Voelker  <voelker@cs.washington.edu>
 
        * ntlib.c: New file.
        * makefile.nt: New file.
@@ -3822,7 +4034,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        to grow the input buffer, take into account the null that's stored
        at the end of already-read input in the buffer.
 
-1994-10-21  Francesco Potorti`  (pot@cnuce.cnr.it)
+1994-10-21  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (prestr, substr): return a logical type.
        (consider_token): Comment out "EXFUN".  Use "DEFUN" instead of "DEF".
@@ -3845,7 +4057,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 1994-10-19  David J. MacKenzie  <djm@duality.gnu.ai.mit.edu>
 
        * rcs-checkin: Use test -r instead of < to check readability, to
-        avoid syntax error.
+       avoid syntax error.
 
 1994-10-19  Jonathan I. Kamens  (jik@cam.ov.com)
 
@@ -3907,7 +4119,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
        * Makefile.in.in (regex.o): Use full path to find regex.c.
 
-1994-10-17  Francesco Potorti`  (pot@fly.cnuce.cnr.it)
+1994-10-17  Francesco Potort\e,Al\e(B  (pot@fly.cnuce.cnr.it)
 
        * Makefile.in.in (etags): add dependency on regex.o, link with it.
        (REGEXPOBJ, REGEXPDEPS, regex.o): target and macros added.
@@ -3934,7 +4146,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
        * Makefile.in.in (libexecdir): Renamed from libdir.
 
-1994-10-11  Francesco Potorti`  (pot@cnuce.cnr.it)
+1994-10-11  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (C_entries): Name the #define's that are macros.
 
@@ -3943,7 +4155,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        * emacsserver.c [! SYSVIPC] (main): Fix uses of FD_* macros:
        fd_set arg is a pointer, descriptor arg comes first.
 
-1994-09-29  Francesco Potorti`  (pot@cnuce.cnr.it)
+1994-09-29  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (C_entries): Recognise typedef of ANSI style functions.
        (C_entries): Recognise #define inside a struct.
@@ -4060,12 +4272,12 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
 1994-07-08  Dave Love  (d.love@dl.ac.uk)
 
-        * etags.c (takeprec): recognise `character*(*) function'
+       * etags.c (takeprec): recognise `character*(*) function'
 
-1994-07-08  Francesco Potorti`  (pot@cnuce.cnr.it)
+1994-07-08  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
-        * etags.c (main): Don't barf on obsolete -t and -T switches.
-        (main): Print an explicative message when a switch is not known.
+       * etags.c (main): Don't barf on obsolete -t and -T switches.
+       (main): Print an explicative message when a switch is not known.
 
 1994-06-23  Richard Stallman  (rms@mole.gnu.ai.mit.edu)
 
@@ -4078,12 +4290,12 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
        * Makefile.in.in (test-distrib): Use ALL_CFLAGS.
 
-1994-06-03  Francesco Potorti`  (pot@fly.cnuce.cnr.it)
+1994-06-03  Francesco Potort\e,Al\e(B  (pot@fly.cnuce.cnr.it)
 
        * etags.c (absolute_filename): Remove infinite loop bug when
        accessing files in directories whose name begins with a dot.
 
-1994-06-03  Francesco Potorti`  (pot@fly.cnuce.cnr.it)
+1994-06-03  Francesco Potort\e,Al\e(B  (pot@fly.cnuce.cnr.it)
 
        * etags.c (etags_getcwd): Delete the trailing newline from cwd.
 
@@ -4206,11 +4418,11 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        * fakemail.c (readline): When extending the buffer,
        calculate end afresh using the new size.
 
-1994-04-18  Francesco Potorti`  (pot@fly.cnuce.cnr.it)
+1994-04-18  Francesco Potort\e,Al\e(B  (pot@fly.cnuce.cnr.it)
 
        * etags.c (main, print_help): eliminate the -F option.
 
-1994-04-18  Francesco Potorti`  (pot@fly.cnuce.cnr.it)
+1994-04-18  Francesco Potort\e,Al\e(B  (pot@fly.cnuce.cnr.it)
 
        * etags.c (absolute_filename): compare against '\0' instead of NULL.
 
@@ -4227,7 +4439,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
        * movemail.c [HAVE_UNISTD_H]: Include unistd.h.
 
-1994-04-12  Francesco Potorti`  (pot@fly.cnuce.cnr.it)
+1994-04-12  Francesco Potort\e,Al\e(B  (pot@fly.cnuce.cnr.it)
 
        * etags.c (etags_getcwd): Initialize bufsize.
 
@@ -4244,7 +4456,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
        * etags.c: #undef static.
 
-1994-04-08  Francesco Potorti`  (pot@fly.cnuce.cnr.it)
+1994-04-08  Francesco Potort\e,Al\e(B  (pot@fly.cnuce.cnr.it)
 
        * etags.c (outf, outfiledir): renamed to tagf, tagfiledir.
        (PF_funcs, Asm_funcs, L_funcs, PAS_funcs, TEX_funcs,
@@ -4257,7 +4469,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        (find_entries): added more suffixes for assembler files.
        (Asm_funcs): Now finds labels even without an ending colon.
 
-1994-03-30  Francesco Potorti`  (pot@fly.cnuce.cnr.it)
+1994-03-30  Francesco Potort\e,Al\e(B  (pot@fly.cnuce.cnr.it)
 
        * etags.c (main): use etags_getcwd for compatibility.
        (etags_getcwd): new function.
@@ -4266,7 +4478,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
        * Makefile.in (etags, ctags): Pass -D for VERSION.
 
-1994-03-25  Francesco Potorti`  (pot@cnuce.cnr.it)
+1994-03-25  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (emacs_tags_format, ETAGS): removed.  Use CTAGS instead.
        (main): don't allow the use of -t and -T in etags mode.
@@ -4274,7 +4486,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        (print_version): show the emacs version number if VERSION is #defined.
        (find_entries): add "ss" as suffix for Chez Scheme.
 
-1994-03-23  Francesco Potorti`  (pot@cnuce.cnr.it)
+1994-03-23  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (cwd, outfiledir): vars added.
        (relative_filename, absolute_filename, absolute_dirname):
@@ -4296,7 +4508,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        * Makefile.in (install, ${archlibdir}): Switch back to ..
        before running INSTALL_PROGRAM.
 
-1994-03-14  Francesco Potorti`  (pot@cnuce.cnr.it)
+1994-03-14  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (TYPEDST): added the `tignore' value.
        (C_entries): corrected various bugs, now correctly parses the
@@ -4342,7 +4554,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        * profile.c (get_time): Simplify; avoid calling index.
        (main): exit on EOF.
 
-1994-02-17  Francesco Potorti`  (pot@cnuce.cnr.it)
+1994-02-17  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (--absolute-pathnames): Option removed.
 
@@ -4350,7 +4562,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
        * fakemail.c (put_line): Don't break the line if it all fits.
 
-1994-02-14  Francesco Potorti`  (pot@fly)
+1994-02-14  Francesco Potort\e,Al\e(B  (pot@fly)
 
        * etags.c (absolute_pathnames, cwd): added global vars.
        (longopts, print_help, main, process_file): put absolute filenames
@@ -4382,7 +4594,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        look like lisp call prototypes: (function ARG1 ARG2), upcasing args.
        (scan_c_file): Pass BUF to write_c_args for FUNC arg.
 
-1994-01-14  Francesco Potorti`  (pot@cnuce.cnr.it)
+1994-01-14  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (stab_entry, stab_create, stab_find, stab_search,
        stab_type, add_keyword, C_reate_stab, C_create_stabs): deleted.
@@ -4526,7 +4738,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
 1993-11-08  Tom Hageman  (tom@basil.icce.rug.nl)
 
-       * etags.c: (C_entries): Keep track of ()-parenthesis level so that
+       * etags.c (C_entries): Keep track of ()-parenthesis level so that
        functions returning a pointer to a function, a la `signal', can be
        parsed.  This also required new state `fstartlist' to `FUNCST'.
        (SAVE_TOKEN, RESTORE_TOKEN, TOKEN_SAVED_P): 1-deep token save stack.
@@ -4534,7 +4746,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        from the other state engines.
        (begtk): add '~', for C++ class destructors.
 
-1993-11-02  Francesco Potorti`  (pot@cnuce.cnr.it)
+1993-11-02  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (consider_token): removed unused variable firsttok.
        (prolog_getit): call pfnote with the right number of arguments.
@@ -4554,7 +4766,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        * Makefile.in: Fixed typos or brainos of whoever thought `@' was
        the comment character.
 
-1993-10-01  Francesco Potorti`  (pot@cnuce.cnr.it)
+1993-10-01  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (process_file): dead code removed.
        (S_ISREG): #define it using S_IFREG if not defined.
@@ -4585,7 +4797,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        By default, look for *,v files as well as RCS/*,v files.
        Use $TMPDIR (default /tmp) instead of /tmp.
 
-1993-09-20  Francesco Potorti`  (pot@fly)
+1993-09-20  Francesco Potort\e,Al\e(B  (pot@fly)
 
        * etags.c (C_entries): is_func is initialised here instead of in
        consider_token for the sake of the yacc rules section.
@@ -4639,7 +4851,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
        * Version 19.18 released.
 
-1993-08-04  Francesco Potorti`  (pot@spiff.gnu.ai.mit.edu)
+1993-08-04  Francesco Potort\e,Al\e(B  (pot@spiff.gnu.ai.mit.edu)
 
        * etags.c (L_isdef, L_isquote, L_getit): small optimisations.
        (L_funcs): the (foo::defmumble stuff now should work.
@@ -4655,9 +4867,9 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
        * timer.c (main): Generate a SIGIO as soon as we've initialized.
 
-1993-07-30  Francesco Potorti`  (pot@cnuce.cnr.it)
+1993-07-30  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
-       * etags.c (FINCST): added the fignore status. Means we are
+       * etags.c (FINCST): Added the fignore status.  Means we are
        after the parameter list and before the open curly brace.
        Allows correct parsing of C++ constructors.
        (C_entries, consider_token): make use of fignore.
@@ -4683,7 +4895,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
 1993-07-18  Richard Stallman  (rms@mole.gnu.ai.mit.edu)
 
-       * Version 19.17 released.
+       * Version 19.17 released.
 
 1993-07-15  Jim Blandy  (jimb@totoro.cs.oberlin.edu)
 
@@ -4694,14 +4906,14 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        * wakeup.c: Use CPP tangle from autoconf manual to #include the
        correct combination of <time.h> and <sys/time.h>.
 
-1993-07-08  Francesco Potorti`  (pot@cnuce.cnr.it)
+1993-07-08  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (alloca): removed all references to it.
        (main): now calls xnew instead of alloca for portability.
        (../src/config.h): included only if HAVE_CONFIG_H.
        (const): void definition removed--config.h takes care of it.
 
-1993-07-08  Francesco Potorti`  (pot@cnuce.cnr.it)
+1993-07-08  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (consider_token): was `==', now is `='.
        (consider_token): DEFUNs now treated like funcs in ctags mode.
@@ -4748,7 +4960,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
 1993-06-16  Jim Blandy  (jimb@wookumz.gnu.ai.mit.edu)
 
-        Bring mumbleclean targets into conformance with GNU coding standards.
+       Bring mumbleclean targets into conformance with GNU coding standards.
        * Makefile.in (distclean): Call clean to do most of the work.
        Delete aixcc.c and TAGS.
        (realclean): Just call distclean.
@@ -4805,7 +5017,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
 1993-05-30  Jim Blandy  (jimb@wookumz.gnu.ai.mit.edu)
 
-       * Makefile.in: (${archlibdir}): Use `(cd foo && pwd)' instead of
+       * Makefile.in (${archlibdir}): Use `(cd foo && pwd)' instead of
        `(cd foo ; pwd)' to get the canonical name of a directory; cd
        might fail, and have pwd print out the current directory.
 
@@ -4891,7 +5103,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
 1993-05-22  Jim Blandy  (jimb@geech.gnu.ai.mit.edu)
 
-        * Version 19.7 released.
+       * Version 19.7 released.
 
 1993-05-22  Richard Stallman  (rms@mole.gnu.ai.mit.edu)
 
@@ -4983,7 +5195,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        (CFLAGS): Include C_SWITCH_SYSTEM in the flags to pass to the
        compiler.
 
-1993-03-22  Francesco Potorti`  (pot@cnuce.cnr.it)
+1993-03-22  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (YACC): flag added to c_ext.
        (c_ext): no more a synonim for c_ext&C_PLPL because of YACC.
@@ -4994,13 +5206,13 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        (C_entries): logical yacc_rules means we are after the first %%.
        (C_entries): added logic for yacc files.
 
-1993-03-16  Francesco Potorti`  (pot@cnuce.cnr.it)
+1993-03-16  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (C_entries): ':' case moved to the second switch.
        (C_entries): do not examine token if structdef==scolonseen.
        (consider_token): structtag set to null string for enum.
 
-1993-03-12  Francesco Potorti`  (pot@cnuce.cnr.it)
+1993-03-12  Francesco Potort\e,Al\e(B  (pot@cnuce.cnr.it)
 
        * etags.c (GET_COOKIE): and related macros removed.
        (logical): is now int, no more a char.
@@ -5018,19 +5230,19 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
        (condider_token): complete rewrite.
        (getline): deleted.
 
-1993-03-01  Francesco Potorti`  (pot@fly.CNUCE.CNR.IT)
+1993-03-01  Francesco Potort\e,Al\e(B  (pot@fly.CNUCE.CNR.IT)
 
        * etags.c (C_entries): Added the quotednl logical variable.
        Used for parsing of #define's spanning multiple lines.
 
-1993-02-23  Francesco Potorti`  (pot@fly.CNUCE.CNR.IT)
+1993-02-23  Francesco Potort\e,Al\e(B  (pot@fly.CNUCE.CNR.IT)
 
        * etags.c (C_entries): Save the definedef status even when a
        newline is met inside a string.
 
 1993-03-19  Eric S. Raymond  (eric@geech.gnu.ai.mit.edu)
 
-        * Makefile.in (EXECUTABLES): added rcs-checkin.
+       * Makefile.in (EXECUTABLES): added rcs-checkin.
 
        * Makefile.in (unlock, relock): New productions.
 
@@ -5054,7 +5266,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
        * b2m.c (main): Don't exit upon reading a blank line.
 
-1993-03-01  Francesco Potorti`  (pot@fly.CNUCE.CNR.IT)
+1993-03-01  Francesco Potort\e,Al\e(B  (pot@fly.CNUCE.CNR.IT)
 
        * etags.c (C_entries): New local variable quotednl.  Used for
        parsing of #define's spanning multiple lines.
@@ -5066,7 +5278,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
        * timer.c (notify): Initialize waitfor properly.
 
-1993-02-22  Francesco Potorti`  (pot@CNUCE.CNR.IT)
+1993-02-22  Francesco Potort\e,Al\e(B  (pot@CNUCE.CNR.IT)
 
        * etags.c (C_entries): Don't reset definedef when a newline inside a
        comment is met.
@@ -5395,7 +5607,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
 1992-03-31  Jim Blandy  (jimb@pogo.cs.oberlin.edu)
 
-       * lib-src/Makefile, etc/MACHINES, etc/NEWS: Changed references to
+       * lib-src/Makefile, etc/MACHINES, etc/NEWS: Changed references to
        `config.emacs' to `configure'.
 
        * lib-src/Makefile: Adjusted for renaming of share-lib to etc.
@@ -5562,7 +5774,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
 1990-08-30  David Lawrence  (tale@pogo.ai.mit.edu)
 
-       * emacs.1:  Add break before -nw option.
+       * emacs.1: Add break before -nw option.
 
 1990-08-19  David J. MacKenzie  (djm@apple-gunkies)
 
@@ -5769,8 +5981,8 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
 1988-12-31  Richard Mlynarik  (mly@rice-chex.ai.mit.edu)
 
-        * env.c:  Add decl for my-index
-        * etags.c (file-entries): .oak => scheme
+       * env.c: Add decl for my-index
+       * etags.c (file-entries): .oak => scheme
 
 1988-12-30  Richard Stallman  (rms@sugar-bombs.ai.mit.edu)
 
@@ -5814,8 +6026,8 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
 1988-11-29  Richard Mlynarik  (mly@pickled-brain.ai.mit.edu)
 
-        * movemail.c:  Better error message when can't create tempname.
-        This file needs a great deal of extra error-checking and lucid reporting...
+       * movemail.c: Better error message when can't create tempname.
+       This file needs a great deal of extra error-checking and lucid reporting...
 
 1988-11-16  Richard Stallman  (rms@sugar-bombs.ai.mit.edu)
 
@@ -5933,6 +6145,7 @@ Tue Jul  1 01:09:07 1997  Geoff Voelker  <voelker@cs.washington.edu>
 
 ;; Local Variables:
 ;; coding: iso-2022-7bit
+;; add-log-time-zone-rule: t
 ;; End:
 
     Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
index 4eb1658..75ab5e1 100644 (file)
@@ -94,6 +94,7 @@ gameuser=@gameuser@
 INSTALL = @INSTALL@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
 # By default, we uphold the dignity of our programs.
 INSTALL_STRIP =
 
@@ -319,7 +320,7 @@ $(DESTDIR)${archlibdir}: all
         if [ `(cd $(DESTDIR)${archlibdir} && /bin/pwd)` \
              != `(cd ${srcdir} && /bin/pwd)` ]; then \
          for file in ${SCRIPTS}; do \
-           $(INSTALL_PROGRAM) ${srcdir}/$$file $(DESTDIR)${archlibdir}/$$file; \
+           $(INSTALL_SCRIPT) ${srcdir}/$$file $(DESTDIR)${archlibdir}/$$file; \
          done ; \
        fi
 
@@ -331,7 +332,7 @@ install: $(DESTDIR)${archlibdir}
          chmod a+rx $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'`; \
        done
        for file in ${INSTALLABLE_SCRIPTS} ; do \
-         $(INSTALL_PROGRAM) ${srcdir}/$${file} $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'`  ; \
+         $(INSTALL_SCRIPT) ${srcdir}/$${file} $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'`  ; \
          chmod a+rx $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'`; \
        done
 
index 3d15a06..64a0e00 100644 (file)
@@ -26,19 +26,55 @@ Boston, MA 02110-1301, USA.  */
 #include <config.h>
 #endif
 
+#ifdef WINDOWSNT
+
+/* config.h defines these, which disables sockets altogether! */
+# undef _WINSOCKAPI_
+# undef _WINSOCK_H
+
+# include <malloc.h>
+# include <stdlib.h>
+# include <windows.h>
+
+# define NO_SOCKETS_IN_FILE_SYSTEM
+
+# define HSOCKET SOCKET
+# define CLOSE_SOCKET closesocket
+# define INITIALIZE() (initialize_sockets ())
+
+#else /* !WINDOWSNT */
+
+# include <sys/types.h>
+
+# ifdef HAVE_INET_SOCKETS
+#  include <netinet/in.h>
+# endif
+
+# define INVALID_SOCKET -1
+# define HSOCKET int
+# define CLOSE_SOCKET close
+# define INITIALIZE()
+
+#endif /* !WINDOWSNT */
+
 #undef signal
 
+#include <stdarg.h>
 #include <ctype.h>
 #include <stdio.h>
-#include <getopt.h>
+#include "getopt.h"
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 
 #ifdef VMS
 # include "vms-pwd.h"
-#else
+#else /* not VMS */
+#ifdef WINDOWSNT
+# include <io.h>
+#else /* not WINDOWSNT */
 # include <pwd.h>
+#endif /* not WINDOWSNT */
 #endif /* not VMS */
 #include <sys/stat.h>
 
@@ -72,6 +108,29 @@ char *(getcwd) ();
 #define VERSION "unspecified"
 #endif
 \f
+#define SEND_STRING(data) (send_to_emacs (s, (data)))
+#define SEND_QUOTED(data) (quote_argument (s, (data)))
+
+#ifndef EXIT_SUCCESS
+#define EXIT_SUCCESS 0
+#endif
+
+#ifndef EXIT_FAILURE
+#define EXIT_FAILURE 1
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+#ifndef NO_RETURN
+#define NO_RETURN
+#endif
+\f
 /* Name used to invoke this program.  */
 char *progname;
 
@@ -101,11 +160,20 @@ int tty = 0;
 
 /* If non-NULL, the name of an editor to fallback to if the server
    is not running.  --alternate-editor.   */
-const char * alternate_editor = NULL;
+const char *alternate_editor = NULL;
 
 /* If non-NULL, the filename of the UNIX socket.  */
 char *socket_name = NULL;
 
+/* If non-NULL, the filename of the authentication file.  */
+char *server_file = NULL;
+
+/* PID of the Emacs server process.  */
+int emacs_pid = 0;
+
+/* File handles for communicating with Emacs. */
+FILE *out, *in;
+
 void print_help_and_exit () NO_RETURN;
 
 struct option longopts[] =
@@ -117,11 +185,166 @@ struct option longopts[] =
   { "tty",     no_argument,       NULL, 't' },
   { "current-frame", no_argument,  NULL, 'c' },
   { "alternate-editor", required_argument, NULL, 'a' },
+#ifndef NO_SOCKETS_IN_FILE_SYSTEM
   { "socket-name",     required_argument, NULL, 's' },
+#endif
+  { "server-file",     required_argument, NULL, 'f' },
   { "display", required_argument, NULL, 'd' },
   { 0, 0, 0, 0 }
 };
 
+\f
+/* Like malloc but get fatal error if memory is exhausted.  */
+
+long *
+xmalloc (size)
+     unsigned int size;
+{
+  long *result = (long *) malloc (size);
+  if (result == NULL)
+    {
+      perror ("malloc");
+      exit (EXIT_FAILURE);
+    }
+  return result;
+}
+
+/* Like strdup but get a fatal error if memory is exhausted. */
+
+char *
+xstrdup (const char *s)
+{
+  char *result = strdup (s);
+  if (result == NULL)
+    {
+      perror ("strdup");
+      exit (EXIT_FAILURE);
+    }
+  return result;
+}
+
+/* From sysdep.c */
+#if !defined (HAVE_GET_CURRENT_DIR_NAME) || defined (BROKEN_GET_CURRENT_DIR_NAME)
+
+/* Return the current working directory.  Returns NULL on errors.
+   Any other returned value must be freed with free. This is used
+   only when get_current_dir_name is not defined on the system.  */
+char*
+get_current_dir_name ()
+{
+  char *buf;
+  char *pwd;
+  struct stat dotstat, pwdstat;
+  /* If PWD is accurate, use it instead of calling getwd.  PWD is
+     sometimes a nicer name, and using it may avoid a fatal error if a
+     parent directory is searchable but not readable.  */
+    if ((pwd = getenv ("PWD")) != 0
+      && (IS_DIRECTORY_SEP (*pwd) || (*pwd && IS_DEVICE_SEP (pwd[1])))
+      && stat (pwd, &pwdstat) == 0
+      && stat (".", &dotstat) == 0
+      && dotstat.st_ino == pwdstat.st_ino
+      && dotstat.st_dev == pwdstat.st_dev
+#ifdef MAXPATHLEN
+      && strlen (pwd) < MAXPATHLEN
+#endif
+      )
+    {
+      buf = (char *) xmalloc (strlen (pwd) + 1);
+      if (!buf)
+        return NULL;
+      strcpy (buf, pwd);
+    }
+#ifdef HAVE_GETCWD
+  else
+    {
+      size_t buf_size = 1024;
+      buf = (char *) xmalloc (buf_size);
+      if (!buf)
+        return NULL;
+      for (;;)
+        {
+          if (getcwd (buf, buf_size) == buf)
+            break;
+          if (errno != ERANGE)
+            {
+              int tmp_errno = errno;
+              free (buf);
+              errno = tmp_errno;
+              return NULL;
+            }
+          buf_size *= 2;
+          buf = (char *) realloc (buf, buf_size);
+          if (!buf)
+            return NULL;
+        }
+    }
+#else
+  else
+    {
+      /* We need MAXPATHLEN here.  */
+      buf = (char *) xmalloc (MAXPATHLEN + 1);
+      if (!buf)
+        return NULL;
+      if (getwd (buf) == NULL)
+        {
+          int tmp_errno = errno;
+          free (buf);
+          errno = tmp_errno;
+          return NULL;
+        }
+    }
+#endif
+  return buf;
+}
+#endif
+
+/* Message functions. */
+
+#ifdef WINDOWSNT
+/* I first tried to check for STDOUT.  The check did not work,
+   I get a valid handle also in nonconsole apps.
+   Instead I test for console title, which seems to work.  */
+int
+w32_window_app()
+{
+  static int window_app = -1;
+  char szTitle[MAX_PATH];
+
+  if (window_app < 0)
+    window_app = (GetConsoleTitleA (szTitle, MAX_PATH) == 0);
+
+  return window_app;
+}
+#endif
+
+void
+message (int is_error, char *message, ...)
+{
+  char msg [2048];
+  va_list args;
+
+  va_start (args, message);
+  vsprintf (msg, message, args);
+  va_end (args);
+
+#ifdef WINDOWSNT
+  if (w32_window_app ())
+    {
+      if (is_error)
+       MessageBox (NULL, msg, "Emacsclient ERROR", MB_ICONERROR);
+      else
+       MessageBox (NULL, msg, "Emacsclient", MB_ICONINFORMATION);
+    }
+  else
+#endif
+    {
+      FILE *f = is_error ? stderr : stdout;
+
+      fputs (msg, f);
+      fflush (f);
+    }
+}
+
 /* Decode the options from argv and argc.
    The global variable `optind' will say how many arguments we used up.  */
 
@@ -138,7 +361,12 @@ decode_options (argc, argv)
   while (1)
     {
       int opt = getopt_long (argc, argv,
-                            "VHnea:s:d:tc", longopts, 0);
+#ifndef NO_SOCKETS_IN_FILE_SYSTEM
+                            "VHnea:s:f:d:tc",
+#else
+                            "VHnea:f:d:tc",
+#endif
+                            longopts, 0);
 
       if (opt == EOF)
        break;
@@ -154,9 +382,15 @@ decode_options (argc, argv)
          alternate_editor = optarg;
          break;
 
+#ifndef NO_SOCKETS_IN_FILE_SYSTEM
        case 's':
          socket_name = optarg;
          break;
+#endif
+
+       case 'f':
+         server_file = optarg;
+         break;
 
        case 'd':
          display = optarg;
@@ -171,7 +405,7 @@ decode_options (argc, argv)
          break;
 
        case 'V':
-         printf ("emacsclient %s\n", VERSION);
+         message (FALSE, "emacsclient %s\n", VERSION);
          exit (EXIT_SUCCESS);
          break;
 
@@ -188,7 +422,7 @@ decode_options (argc, argv)
          break;
 
        default:
-         fprintf (stderr, "Try `%s --help' for more information\n", progname);
+         message (TRUE, "Try `%s --help' for more information\n", progname);
          exit (EXIT_FAILURE);
          break;
        }
@@ -214,24 +448,29 @@ decode_options (argc, argv)
     window_system = 0;
 }
 
+\f
 void
 print_help_and_exit ()
 {
-  printf (
-         "Usage: %s [OPTIONS] FILE...\n\
+  message (FALSE,
+          "Usage: %s [OPTIONS] FILE...\n\
 Tell the Emacs server to visit the specified files.\n\
 Every FILE can be either just a FILENAME or [+LINE[:COLUMN]] FILENAME.\n\
 \n\
 The following OPTIONS are accepted:\n\
--V, --version           Just print version info and return\n\
+-V, --version           Just print version info and return\n\
 -H, --help              Print this usage information message\n\
 -t, --tty               Open a new Emacs frame on the current terminal\n\
 -c, --current-frame    Do not create a new frame; use the current Emacs frame\n\
--n, --no-wait           Don't wait for the server to return\n\
 -e, --eval              Evaluate the FILE arguments as ELisp expressions\n\
--d, --display=DISPLAY   Visit the file in the given display\n\
--s, --socket-name=FILENAME\n\
-                        Set the filename of the UNIX socket for communication\n\
+-n, --no-wait           Don't wait for the server to return\n\
+-d, --display=DISPLAY   Visit the file in the given display\n"
+#ifndef NO_SOCKETS_IN_FILE_SYSTEM
+"-s, --socket-name=FILENAME\n\
+                        Set filename of the UNIX socket for communication\n"
+#endif
+"-f, --server-file=FILENAME\n\
+                        Set filename of the TCP authentication file\n\
 -a, --alternate-editor=EDITOR\n\
                         Editor to fallback to if the server is not running\n\
 \n\
@@ -239,110 +478,103 @@ Report bugs to bug-gnu-emacs@gnu.org.\n", progname);
   exit (EXIT_SUCCESS);
 }
 
-/* Like malloc but get fatal error if memory is exhausted.  */
-
-long *
-xmalloc (size)
-     unsigned int size;
+/*
+  Try to run a different command, or --if no alternate editor is
+  defined-- exit with an errorcode.
+*/
+void
+fail (void)
 {
-  long *result = (long *) malloc (size);
-  if (result == NULL)
+  if (alternate_editor)
     {
-      perror ("malloc");
-      exit (EXIT_FAILURE);
+      int i = optind - 1;
+#ifdef WINDOWSNT
+      main_argv[i] = (char *)alternate_editor;
+#endif
+      execvp (alternate_editor, main_argv + i);
+      message (TRUE, "%s: error executing alternate editor \"%s\"\n",
+              progname, alternate_editor);
     }
-  return result;
+  exit (EXIT_FAILURE);
 }
 
-/* Like strdup but get a fatal error if memory is exhausted. */
+\f
+#if !defined (HAVE_SOCKETS) || !defined (HAVE_INET_SOCKETS)
 
-char *
-xstrdup (const char *s)
+int
+main (argc, argv)
+     int argc;
+     char **argv;
 {
-  char *result = strdup (s);
-  if (result == NULL)
-    {
-      perror ("strdup");
-      exit (EXIT_FAILURE);
-    }
-  return result;
+  main_argc = argc;
+  main_argv = argv;
+  progname = argv[0];
+  message (TRUE, "%s: Sorry, the Emacs server is supported only\n"
+          "on systems with Berkeley sockets.\n", 
+          argv[0]);
+  fail ();
 }
 
-/* From sysdep.c */
-#if !defined (HAVE_GET_CURRENT_DIR_NAME) || defined (BROKEN_GET_CURRENT_DIR_NAME)
+#else /* HAVE_SOCKETS && HAVE_INET_SOCKETS */
 
-/* Return the current working directory.  Returns NULL on errors.
-   Any other returned value must be freed with free. This is used
-   only when get_current_dir_name is not defined on the system.  */
-char*
-get_current_dir_name ()
-{
-  char *buf;
-  char *pwd;
-  struct stat dotstat, pwdstat;
-  /* If PWD is accurate, use it instead of calling getwd.  PWD is
-     sometimes a nicer name, and using it may avoid a fatal error if a
-     parent directory is searchable but not readable.  */
-    if ((pwd = getenv ("PWD")) != 0
-      && (IS_DIRECTORY_SEP (*pwd) || (*pwd && IS_DEVICE_SEP (pwd[1])))
-      && stat (pwd, &pwdstat) == 0
-      && stat (".", &dotstat) == 0
-      && dotstat.st_ino == pwdstat.st_ino
-      && dotstat.st_dev == pwdstat.st_dev
-#ifdef MAXPATHLEN
-      && strlen (pwd) < MAXPATHLEN
-#endif
-      )
-    {
-      buf = (char *) malloc (strlen (pwd) + 1);
-      if (!buf)
-        return NULL;
-      strcpy (buf, pwd);
-    }
-#ifdef HAVE_GETCWD
-  else
-    {
-      size_t buf_size = 1024;
-      buf = (char *) malloc (buf_size);
-      if (!buf)
-        return NULL;
-      for (;;)
-        {
-          if (getcwd (buf, buf_size) == buf)
-            break;
-          if (errno != ERANGE)
-            {
-              int tmp_errno = errno;
-              free (buf);
-              errno = tmp_errno;
-              return NULL;
-            }
-          buf_size *= 2;
-          buf = (char *) realloc (buf, buf_size);
-          if (!buf)
-            return NULL;
-        }
-    }
+#ifdef WINDOWSNT
+# include <winsock2.h>
 #else
-  else
+# include <sys/types.h>
+# include <sys/socket.h>
+# include <sys/un.h>
+# include <sys/stat.h>
+# include <errno.h>
+#endif
+
+#define AUTH_KEY_LENGTH      64
+#define SEND_BUFFER_SIZE   4096
+
+extern char *strerror ();
+extern int errno;
+
+/* Buffer to accumulate data to send in TCP connections.  */
+char send_buffer[SEND_BUFFER_SIZE + 1];
+int sblen = 0; /* Fill pointer for the send buffer.  */
+
+/* Let's send the data to Emacs when either
+   - the data ends in "\n", or
+   - the buffer is full (but this shouldn't happen)
+   Otherwise, we just accumulate it.  */
+void
+send_to_emacs (s, data)
+     HSOCKET s;
+     char *data;
+{
+  while (data)
     {
-      /* We need MAXPATHLEN here.  */
-      buf = (char *) malloc (MAXPATHLEN + 1);
-      if (!buf)
-        return NULL;
-      if (getwd (buf) == NULL)
-        {
-          int tmp_errno = errno;
-          free (buf);
-          errno = tmp_errno;
-          return NULL;
-        }
+      int dlen = strlen (data);
+      if (dlen + sblen >= SEND_BUFFER_SIZE)
+       {
+         int part = SEND_BUFFER_SIZE - sblen;
+         strncpy (&send_buffer[sblen], data, part);
+         data += part;
+         sblen = SEND_BUFFER_SIZE;
+       }
+      else if (dlen)
+       {
+         strcpy (&send_buffer[sblen], data);
+         data = NULL;
+         sblen += dlen;
+       }
+      else
+       break;
+
+      if (sblen == SEND_BUFFER_SIZE
+         || (sblen > 0 && send_buffer[sblen-1] == '\n'))
+       {
+         int sent = send (s, send_buffer, sblen, 0);
+         if (sent != sblen)
+           strcpy (send_buffer, &send_buffer[sent]);
+         sblen -= sent;
+       }
     }
-#endif
-  return buf;
 }
-#endif
-
 
 \f
 /* In STR, insert a & before each &, each space, each newline, and
@@ -350,11 +582,10 @@ get_current_dir_name ()
    return value never contains a space.
 
    Does not change the string.  Outputs the result to STREAM.  */
-
 void
-quote_argument (str, stream)
+quote_argument (s, str)
+     HSOCKET s;
      char *str;
-     FILE *stream;
 {
   char *copy = (char *) xmalloc (strlen (str) * 2 + 1);
   char *p, *q;
@@ -384,7 +615,7 @@ quote_argument (str, stream)
     }
   *q++ = 0;
 
-  fprintf (stream, "%s", copy);
+  SEND_STRING (copy);
 
   free (copy);
 }
@@ -425,31 +656,196 @@ unquote_argument (str)
 }
 
 \f
+int
+file_name_absolute_p (filename)
+     const unsigned char *filename;
+{
+  /* Sanity check, it shouldn't happen.  */
+  if (! filename) return FALSE;
+
+  /* /xxx is always an absolute path.  */
+  if (filename[0] == '/') return TRUE;
+
+  /* Empty filenames (which shouldn't happen) are relative.  */
+  if (filename[0] == '\0') return FALSE;
+
+#ifdef WINDOWSNT
+  /* X:\xxx is always absolute; X:xxx is an error and will fail.  */
+  if (isalpha (filename[0])
+      && filename[1] == ':' && (filename[2] == '\\' || filename[2] == '/'))
+    return TRUE;
+
+  /* Both \xxx and \\xxx\yyy are absolute.  */
+  if (filename[0] == '\\') return TRUE;
+#endif
+
+  return FALSE;
+}
+
+#ifdef WINDOWSNT
+/* Wrapper to make WSACleanup a cdecl, as required by atexit().  */
+void
+__cdecl close_winsock ()
+{
+  WSACleanup ();
+}
+
+/* Initialize the WinSock2 library.  */
+void
+initialize_sockets ()
+{
+  WSADATA wsaData;
+
+  if (WSAStartup (MAKEWORD (2, 0), &wsaData))
+    {
+      message (TRUE, "%s: error initializing WinSock2", progname);
+      exit (EXIT_FAILURE);
+    }
+
+  atexit (close_winsock);
+}
+#endif /* WINDOWSNT */
+
+\f
 /*
-  Try to run a different command, or --if no alternate editor is
 defined-- exit with an errorcode.
+ * Read the information needed to set up a TCP comm channel with
* the Emacs server: host, port, pid and authentication string.
 */
-void
-fail (void)
+int
+get_server_config (server, authentication)
+     struct sockaddr_in *server;
+     char *authentication;
 {
-  if (alternate_editor)
+  char dotted[32];
+  char *port;
+  char *pid;
+  FILE *config = NULL;
+
+  if (file_name_absolute_p (server_file))
+    config = fopen (server_file, "rb");
+  else
     {
-      int i = optind - 1;
-      execvp (alternate_editor, main_argv + i);
-      return;
+      char *home = getenv ("HOME");
+
+      if (home)
+        {
+          char *path = alloca (32 + strlen (home) + strlen (server_file));
+          sprintf (path, "%s/.emacs.d/server/%s", home, server_file);
+          config = fopen (path, "rb");
+        }
+#ifdef WINDOWSNT
+      if (!config && (home = getenv ("APPDATA")))
+        {
+          char *path = alloca (32 + strlen (home) + strlen (server_file));
+          sprintf (path, "%s/.emacs.d/server/%s", home, server_file);
+          config = fopen (path, "rb");
+        }
+#endif
+    }
+
+  if (! config)
+    return FALSE;
+
+  if (fgets (dotted, sizeof dotted, config)
+      && (port = strchr (dotted, ':'))
+      && (pid = strchr (port, ' ')))
+    {
+      *port++ = '\0';
+      *pid++  = '\0';
     }
   else
     {
+      message (TRUE, "%s: invalid configuration info", progname);
       exit (EXIT_FAILURE);
     }
+
+  server->sin_family = AF_INET;
+  server->sin_addr.s_addr = inet_addr (dotted);
+  server->sin_port = htons (atoi (port));
+
+  if (! fread (authentication, AUTH_KEY_LENGTH, 1, config))
+    {
+      message (TRUE, "%s: cannot read authentication info", progname);
+      exit (EXIT_FAILURE);
+    }
+
+  fclose (config);
+
+  emacs_pid = atoi (pid);
+
+  return TRUE;
 }
 
-/* The process id of Emacs. */
-int emacs_pid;
+HSOCKET
+set_tcp_socket ()
+{
+  HSOCKET s;
+  struct sockaddr_in server;
+  struct linger l_arg = {1, 1};
+  char auth_string[AUTH_KEY_LENGTH + 1];
 
-/* File handles for communicating with Emacs. */
-FILE *out, *in;
+  if (! get_server_config (&server, auth_string))
+    return INVALID_SOCKET;
+
+  if (server.sin_addr.s_addr != inet_addr ("127.0.0.1"))
+    message (FALSE, "%s: connected to remote socket at %s\n",
+             progname, inet_ntoa (server.sin_addr));
+
+  /*
+   * Open up an AF_INET socket
+   */
+  if ((s = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
+    {
+      message (TRUE, "%s: socket: %s\n", progname, strerror (errno));
+      return INVALID_SOCKET;
+    }
+
+  /*
+   * Set up the socket
+   */
+  if (connect (s, (struct sockaddr *) &server, sizeof server) < 0)
+    {
+      message (TRUE, "%s: connect: %s\n", progname, strerror (errno));
+      return INVALID_SOCKET;
+    }
+
+  setsockopt (s, SOL_SOCKET, SO_LINGER, (char *) &l_arg, sizeof l_arg);
+
+  /*
+   * Send the authentication
+   */
+  auth_string[AUTH_KEY_LENGTH] = '\0';
+
+  SEND_STRING ("-auth ");
+  SEND_STRING (auth_string);
+  SEND_STRING ("\n");
+
+  return s;
+}
+
+#if !defined (NO_SOCKETS_IN_FILE_SYSTEM)
+
+/* Three possibilities:
+   2 - can't be `stat'ed               (sets errno)
+   1 - isn't owned by us
+   0 - success: none of the above */
+
+static int
+socket_status (socket_name)
+     char *socket_name;
+{
+  struct stat statbfr;
+
+  if (stat (socket_name, &statbfr) == -1)
+    return 2;
+
+  if (statbfr.st_uid != geteuid ())
+    return 1;
 
+  return 0;
+}
+
+\f
 /* A signal handler that passes the signal to the Emacs process.
    Useful for SIGWINCH.  */
 
@@ -542,51 +938,7 @@ init_signals (void)
   signal (SIGTTOU, handle_sigtstp);
 }
 
-\f
-#if !defined (HAVE_SOCKETS) || defined (NO_SOCKETS_IN_FILE_SYSTEM)
-
-int
-main (argc, argv)
-     int argc;
-     char **argv;
-{
-  fprintf (stderr, "%s: Sorry, the Emacs server is supported only\n",
-          argv[0]);
-  fprintf (stderr, "on systems with Berkeley sockets.\n");
-
-  fail ();
-}
-
-#else /* HAVE_SOCKETS */
 
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <sys/stat.h>
-#include <errno.h>
-
-extern char *strerror ();
-extern int errno;
-
-/* Three possibilities:
-   2 - can't be `stat'ed               (sets errno)
-   1 - isn't owned by us
-   0 - success: none of the above */
-
-static int
-socket_status (socket_name)
-     char *socket_name;
-{
-  struct stat statbfr;
-
-  if (stat (socket_name, &statbfr) == -1)
-    return 2;
-
-  if (statbfr.st_uid != geteuid ())
-    return 1;
-
-  return 0;
-}
 
 /* Returns 1 if PREFIX is a prefix of STRING. */
 static int
@@ -605,29 +957,12 @@ strprefix (char *prefix, char *string)
   return 1;
 }
 
-int
-main (argc, argv)
-     int argc;
-     char **argv;
+
+HSOCKET
+set_local_socket ()
 {
-  int s, i, needlf = 0;
+  HSOCKET s;
   struct sockaddr_un server;
-  char *cwd, *str;
-  char string[BUFSIZ];
-
-  main_argc = argc;
-  main_argv = argv;
-  progname = argv[0];
-
-  /* Process options.  */
-  decode_options (argc, argv);
-
-  if ((argc - optind < 1) && !eval && !tty && !window_system)
-    {
-      fprintf (stderr, "%s: file name or argument required\n", progname);
-      fprintf (stderr, "Try `%s --help' for more information\n", progname);
-      exit (EXIT_FAILURE);
-    }
 
   /*
    * Open up an AF_UNIX socket in this person's home directory
@@ -635,9 +970,8 @@ main (argc, argv)
 
   if ((s = socket (AF_UNIX, SOCK_STREAM, 0)) < 0)
     {
-      fprintf (stderr, "%s: ", argv[0]);
-      perror ("socket");
-      fail ();
+      message (TRUE, "%s: socket: %s\n", progname, strerror (errno));
+      return INVALID_SOCKET;
     }
 
   server.sun_family = AF_UNIX;
@@ -647,16 +981,16 @@ main (argc, argv)
     int default_sock = !socket_name;
     int saved_errno = 0;
 
-     char *server_name = "server";
+    char *server_name = "server";
 
-     if (socket_name && !index (socket_name, '/') && !index (socket_name, '\\'))
-       { /* socket_name is a file name component.  */
+    if (socket_name && !index (socket_name, '/') && !index (socket_name, '\\'))
+      { /* socket_name is a file name component.  */
        server_name = socket_name;
        socket_name = NULL;
        default_sock = 1;       /* Try both UIDs.  */
-       }
+      }
 
-     if (default_sock)
+    if (default_sock)
       {
        socket_name = alloca (100 + strlen (server_name));
        sprintf (socket_name, "/tmp/emacs%d/%s",
@@ -667,8 +1001,8 @@ main (argc, argv)
       strcpy (server.sun_path, socket_name);
     else
       {
-        fprintf (stderr, "%s: socket-name %s too long",
-                 argv[0], socket_name);
+        message (TRUE, "%s: socket-name %s too long",
+                 progname, socket_name);
         fail ();
       }
 
@@ -702,8 +1036,8 @@ main (argc, argv)
                  strcpy (server.sun_path, socket_name);
                else
                  {
-                   fprintf (stderr, "%s: socket-name %s too long",
-                            argv[0], socket_name);
+                   message (TRUE, "%s: socket-name %s too long",
+                            progname, socket_name);
                    exit (EXIT_FAILURE);
                  }
 
@@ -715,81 +1049,165 @@ main (argc, argv)
          }
       }
 
-     switch (sock_status)
-       {
-       case 1:
-        /* There's a socket, but it isn't owned by us.  This is OK if
-           we are root. */
-        if (0 != geteuid ())
-          {
-            fprintf (stderr, "%s: Invalid socket owner\n", argv[0]);
-            fail ();
-          }
-        break;
-
-       case 2:
-        /* `stat' failed */
-        if (saved_errno == ENOENT)
-          fprintf (stderr,
-                   "%s: can't find socket; have you started the server?\n\
+    switch (sock_status)
+      {
+      case 1:
+       /* There's a socket, but it isn't owned by us.  This is OK if
+          we are root. */
+       if (0 != geteuid ())
+         {
+           message (TRUE, "%s: Invalid socket owner\n", progname);
+           return INVALID_SOCKET;
+         }
+       break;
+
+      case 2:
+       /* `stat' failed */
+       if (saved_errno == ENOENT)
+         message (TRUE,
+                  "%s: can't find socket; have you started the server?\n\
 To start the server in Emacs, type \"M-x server-start\".\n",
-                   argv[0]);
-        else
-          fprintf (stderr, "%s: can't stat %s: %s\n",
-                   argv[0], server.sun_path, strerror (saved_errno));
-        fail ();
-        break;
-       }
+                  progname);
+       else
+         message (TRUE, "%s: can't stat %s: %s\n",
+                  progname, server.sun_path, strerror (saved_errno));
+       return INVALID_SOCKET;
+      }
   }
 
   if (connect (s, (struct sockaddr *) &server, strlen (server.sun_path) + 2)
       < 0)
     {
-      fprintf (stderr, "%s: ", argv[0]);
-      perror ("connect");
-      fail ();
+      message (TRUE, "%s: connect: %s\n", progname, strerror (errno));
+      return INVALID_SOCKET;
     }
 
-  /* We use the stream OUT to send our commands to the server.  */
-  if ((out = fdopen (s, "r+")) == NULL)
+  return s;
+}
+#endif /* ! NO_SOCKETS_IN_FILE_SYSTEM */
+
+HSOCKET
+set_socket ()
+{
+  HSOCKET s;
+  
+  INITIALIZE ();
+  
+#ifndef NO_SOCKETS_IN_FILE_SYSTEM
+  /* Explicit --socket-name argument.  */
+  if (socket_name)
     {
-      fprintf (stderr, "%s: ", argv[0]);
-      perror ("fdopen");
-      fail ();
+      s = set_local_socket ();
+      if ((s != INVALID_SOCKET) || alternate_editor)
+       return s;
+      message (TRUE, "%s: error accessing socket \"%s\"",
+              progname, socket_name);
+      exit (EXIT_FAILURE);
     }
+#endif
+
+  /* Explicit --server-file arg or EMACS_SERVER_FILE variable.  */
+  if (!server_file)
+    server_file = getenv ("EMACS_SERVER_FILE");
 
-  /* We use the stream IN to read the responses.
-     We used to use just one stream for both output and input
-     on the socket, but reversing direction works nonportably:
-     on some systems, the output appears as the first input;
-     on other systems it does not.  */
-  if ((in = fdopen (s, "r+")) == NULL)
+  if (server_file)
     {
-      fprintf (stderr, "%s: ", argv[0]);
-      perror ("fdopen");
-      fail ();
+      s = set_tcp_socket ();
+      if ((s != INVALID_SOCKET) || alternate_editor)
+       return s;
+      message (TRUE, "%s: error accessing server file \"%s\"",
+              progname, server_file);
+      exit (EXIT_FAILURE);
     }
+  
+#ifndef NO_SOCKETS_IN_FILE_SYSTEM
+  /* Implicit local socket.  */
+  s = set_local_socket ();
+  if (s != INVALID_SOCKET)
+    return s;
+#endif
 
-#ifdef HAVE_GETCWD
-  cwd = getcwd (string, sizeof string);
-#else
-  cwd = getwd (string);
+  /* Implicit server file.  */
+  server_file = "server";
+  s = set_tcp_socket ();
+  if ((s != INVALID_SOCKET) || alternate_editor)
+    return s;
+
+  /* No implicit or explicit socket, and no alternate editor.  */
+  message (TRUE, "%s: No socket or alternate editor.  Please use:\n\n"
+#ifndef NO_SOCKETS_IN_FILE_SYSTEM
+"\t--socket-name\n"
 #endif
+"\t--server-file      (or environment variable EMACS_SERVER_FILE)\n\
+\t--alternate-editor (or environment variable ALTERNATE_EDITOR)\n",
+           progname);
+  exit (EXIT_FAILURE);
+}
+
+int
+main (argc, argv)
+     int argc;
+     char **argv;
+{
+  HSOCKET s;
+  int i, rl, needlf = 0;
+  char *cwd, *str;
+  char string[BUFSIZ+1];
+
+  main_argc = argc;
+  main_argv = argv;
+  progname = argv[0];
+
+  /* Process options.  */
+  decode_options (argc, argv);
+
+  if ((argc - optind < 1) && !eval && !tty && !window_system)
+    {
+      message (TRUE, "%s: file name or argument required\n"
+              "Try `%s --help' for more information\n",
+              progname, progname);
+      exit (EXIT_FAILURE);
+    }
+
+  if ((s = set_socket ()) == INVALID_SOCKET)
+    fail ();
+
+
+  cwd = get_current_dir_name ();
   if (cwd == 0)
     {
       /* getwd puts message in STRING if it fails.  */
-
-#ifdef HAVE_GETCWD
-      fprintf (stderr, "%s: %s (%s)\n", argv[0],
-              "cannot get current working directory", strerror (errno));
-#else
-      fprintf (stderr, "%s: %s (%s)\n", argv[0], string, strerror (errno));
-#endif
+      message (TRUE, "%s: %s\n", progname,
+              "Cannot get current working directory");
       fail ();
     }
 
+#ifdef WINDOWSNT
+  /*
+    Modern Windows restrict which processes can set the foreground window.
+    emacsclient can allow Emacs to grab the focus by calling the function
+    AllowSetForegroundWindow().  Unfortunately, older Windows (W95, W98
+    and NT) lack this function, so we have to check its availability.
+  */
+  if (emacs_pid)
+    {
+      HMODULE hUser32;
+
+      if (hUser32 = LoadLibrary ("user32.dll"))
+       {
+         FARPROC set_fg;
+         if (set_fg = GetProcAddress (hUser32, "AllowSetForegroundWindow"))
+           set_fg (emacs_pid);
+         FreeLibrary (hUser32);
+       }
+    }
+#endif
+
   /* First of all, send our version number for verification. */
-  fprintf (out, "-version %s ", VERSION);
+  SEND_STRING ("-version ");
+  SEND_STRING (VERSION);
+  SEND_STRING (" ");
 
   /* Send over our environment. */
   if (!current_frame)
@@ -800,38 +1218,33 @@ To start the server in Emacs, type \"M-x server-start\".\n",
         {
           char *name = xstrdup (environ[i]);
           char *value = strchr (name, '=');
-          fprintf (out, "-env ");
-          quote_argument (environ[i], out);
-          fprintf (out, " ");
+          SEND_STRING ("-env ");
+          SEND_QUOTED (environ[i]);
+          SEND_STRING (" ");
         }
     }
 
   /* Send over our current directory. */
   if (!current_frame)
     {
-      char *dir = get_current_dir_name ();
-      if (dir)
-        {
-          fprintf (out, "-dir ");          
-          quote_argument (dir, out);
-          fprintf (out, "/");
-          fprintf (out, " ");
-          free (dir);
-        }
+      SEND_STRING ("-dir ");          
+      SEND_QUOTED (cwd);
+      SEND_STRING ("/");
+      SEND_STRING (" ");
     }
 
  retry:
   if (nowait)
-    fprintf (out, "-nowait ");
+    SEND_STRING ("-nowait ");
 
   if (current_frame)
-    fprintf (out, "-current-frame ");
+    SEND_STRING ("-current-frame ");
   
   if (display)
     {
-      fprintf (out, "-display ");
-      quote_argument (display, out);
-      fprintf (out, " ");
+      SEND_STRING ("-display ");
+      SEND_QUOTED (display);
+      SEND_STRING (" ");
     }
 
   if (tty)
@@ -841,13 +1254,13 @@ To start the server in Emacs, type \"M-x server-start\".\n",
 
       if (! tty_name)
         {
-          fprintf (stderr, "%s: could not get terminal name\n", progname);
+          message (TRUE, "%s: could not get terminal name\n", progname);
           fail ();
         }
 
       if (! type)
         {
-          fprintf (stderr, "%s: please set the TERM variable to your terminal type\n",
+          message (TRUE, "%s: please set the TERM variable to your terminal type\n",
                    progname);
           fail ();
         }
@@ -855,22 +1268,22 @@ To start the server in Emacs, type \"M-x server-start\".\n",
       if (! strcmp (type, "eterm"))
         {
           /* This causes nasty, MULTI_KBOARD-related input lockouts. */
-          fprintf (stderr, "%s: opening a frame in an Emacs term buffer"
+          message (TRUE, "%s: opening a frame in an Emacs term buffer"
                    " is not supported\n", progname);
           fail ();
         }
 
       init_signals ();
 
-      fprintf (out, "-tty ");
-      quote_argument (tty_name, out);
-      fprintf (out, " ");
-      quote_argument (type, out);
-      fprintf (out, " ");
+      SEND_STRING ("-tty ");
+      SEND_QUOTED (tty_name);
+      SEND_STRING (" ");
+      SEND_QUOTED (type);
+      SEND_STRING (" ");
     }
 
   if (window_system)
-    fprintf (out, "-window-system ");
+    SEND_STRING ("-window-system ");
 
   if ((argc - optind > 0))
     {
@@ -880,10 +1293,10 @@ To start the server in Emacs, type \"M-x server-start\".\n",
 
          if (eval)
             {
-              /* Don't prepend any cwd or anything like that.  */
-              fprintf (out, "-eval ");
-              quote_argument (argv[i], out);
-              fprintf (out, " ");
+              /* Don't prepend cwd or anything like that.  */
+              SEND_STRING ("-eval ");
+              SEND_QUOTED (argv[i]);
+              SEND_STRING (" ");
               continue;
             }
 
@@ -893,25 +1306,25 @@ To start the server in Emacs, type \"M-x server-start\".\n",
              while (isdigit ((unsigned char) *p) || *p == ':') p++;
              if (*p == 0)
                 {
-                  fprintf (out, "-position ");
-                  quote_argument (argv[i], out);
-                  fprintf (out, " ");
+                  SEND_STRING ("-position ");
+                  SEND_QUOTED (argv[i]);
+                  SEND_STRING (" ");
                   continue;
                 }
               else
                 relative = 1;
             }
-          else if (*argv[i] != '/')
+          else if (! file_name_absolute_p (argv[i]))
             relative = 1;
 
-          fprintf (out, "-file ");
+          SEND_STRING ("-file ");
           if (relative)
             {
-              quote_argument (cwd, out);
-              fprintf (out, "/");
+              SEND_QUOTED (cwd);
+              SEND_STRING ("/");
             }
-          quote_argument (argv[i], out);
-          fprintf (out, " ");
+          SEND_QUOTED (argv[i]);
+          SEND_STRING (" ");
         }
     }
   else
@@ -921,18 +1334,16 @@ To start the server in Emacs, type \"M-x server-start\".\n",
           while ((str = fgets (string, BUFSIZ, stdin)))
             {
               if (eval)
-                fprintf (out, "-eval ");
+                SEND_STRING ("-eval ");
               else
-                fprintf (out, "-file ");
-              quote_argument (str, out);
+                SEND_STRING ("-file ");
+              SEND_QUOTED (out);
             }
-          fprintf (out, " ");
+          SEND_STRING (" ");
         }
     }
 
-  fprintf (out, "\n");
-  fflush (out);
-  fsync (fileno (out));
+  SEND_STRING ("\n");
 
   /* Wait for an answer. */
   if (!eval && !tty && !nowait)
@@ -944,22 +1355,25 @@ To start the server in Emacs, type \"M-x server-start\".\n",
   fsync (1);
 
   /* Now, wait for an answer and print any messages.  */
-  while ((str = fgets (string, BUFSIZ, in)))
+  while ((rl = recv (s, string, BUFSIZ, 0)) > 0)
     {
-      char *p = str + strlen (str) - 1;
-      while (p > str && *p == '\n')
+      char *p;
+      string[rl] = '\0';
+
+      p = string + strlen (string) - 1;
+      while (p > string && *p == '\n')
         *p-- = 0;
 
-      if (strprefix ("-good-version ", str))
+      if (strprefix ("-good-version ", string))
         {
           /* -good-version: The versions match. */
         }
-      else if (strprefix ("-emacs-pid ", str))
+      else if (strprefix ("-emacs-pid ", string))
         {
           /* -emacs-pid PID: The process id of the Emacs process. */
           emacs_pid = strtol (string + strlen ("-emacs-pid"), NULL, 10);
         }
-      else if (strprefix ("-window-system-unsupported ", str))
+      else if (strprefix ("-window-system-unsupported ", string))
         {
           /* -window-system-unsupported: Emacs was compiled without X
               support.  Try again on the terminal. */
@@ -968,22 +1382,22 @@ To start the server in Emacs, type \"M-x server-start\".\n",
           tty = 1;
           goto retry;
         }
-      else if (strprefix ("-print ", str))
+      else if (strprefix ("-print ", string))
         {
           /* -print STRING: Print STRING on the terminal. */
-          str = unquote_argument (str + strlen ("-print "));
+          str = unquote_argument (string + strlen ("-print "));
           if (needlf)
             printf ("\n");
           printf ("%s", str);
           needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n';
         }
-      else if (strprefix ("-error ", str))
+      else if (strprefix ("-error ", string))
         {
           /* -error DESCRIPTION: Signal an error on the terminal. */
-          str = unquote_argument (str + strlen ("-error "));
+          str = unquote_argument (string + strlen ("-error "));
           if (needlf)
             printf ("\n");
-          printf ("*ERROR*: %s", str);
+          fprintf (stderr, "*ERROR*: %s", str);
           needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n';
         }
       else if (strprefix ("-suspend ", str))
@@ -999,8 +1413,8 @@ To start the server in Emacs, type \"M-x server-start\".\n",
           /* Unknown command. */
           if (needlf)
             printf ("\n");
-          printf ("*ERROR*: Unknown message: %s", str);
-          needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n';
+          printf ("*ERROR*: Unknown message: %s", string);
+          needlf = string[0] == '\0' ? needlf : string[strlen (string) - 1] != '\n';
         }
     }
 
@@ -1009,10 +1423,12 @@ To start the server in Emacs, type \"M-x server-start\".\n",
   fflush (stdout);
   fsync (1);
 
+  CLOSE_SOCKET (s);
   return EXIT_SUCCESS;
 }
 
-#endif /* HAVE_SOCKETS */
+#endif /* HAVE_SOCKETS && HAVE_INET_SOCKETS */
+
 \f
 #ifndef HAVE_STRERROR
 char *
index 49a18be..26dac36 100644 (file)
@@ -41,7 +41,7 @@
  * configuration file containing regexp definitions for etags.
  */
 
-char pot_etags_version[] = "@(#) pot revision number is 17.20";
+char pot_etags_version[] = "@(#) pot revision number is $Revision: 3.61 $";
 
 #define        TRUE    1
 #define        FALSE   0
@@ -4955,7 +4955,7 @@ Lua_functions (inf)
       if (bp[0] != 'f' && bp[0] != 'l')
        continue;
 
-      LOOKING_AT (bp, "local");        /* skip possible "local" */
+      (void)LOOKING_AT (bp, "local"); /* skip possible "local" */
 
       if (LOOKING_AT (bp, "function"))
        get_tag (bp, NULL);
@@ -5137,7 +5137,7 @@ TeX_commands (inf)
                if (!opgrp || *p == TEX_clgrp)
                  {
                    while (*p != '\0' && *p != TEX_opgrp && *p != TEX_clgrp)
-                     *p++;
+                     p++;
                    linelen = p - lb.buffer + 1;
                  }
                make_tag (cp, namelen, TRUE,
@@ -6256,15 +6256,14 @@ readline (lbp, stream)
       /* Check whether this is a #line directive. */
       if (result > 12 && strneq (lbp->buffer, "#line ", 6))
        {
-         int start, lno;
+         unsigned int lno;
+         int start = 0;
 
-         if (DEBUG) start = 0; /* shut up the compiler */
-         if (sscanf (lbp->buffer, "#line %d %n\"", &lno, &start) >= 1
-             && lbp->buffer[start] == '"')
+         if (sscanf (lbp->buffer, "#line %u \"%n", &lno, &start) >= 1
+             && start > 0)     /* double quote character found */
            {
-             char *endp = lbp->buffer + ++start;
+             char *endp = lbp->buffer + start;
 
-             assert (start > 0);
              while ((endp = etags_strchr (endp, '"')) != NULL
                     && endp[-1] == '\\')
                endp++;
index e3d3af2..8c19486 100755 (executable)
@@ -36,22 +36,33 @@ use vars qw($author $regexp $exclude $from_date $to_date
             @entries);
 
 use Getopt::Long;
-my $result = GetOptions ("author=s" => \$author,
-                         "text=s"  => \$regexp,
-                         "exclude=s"  => \$exclude,
-                         "from-date=s" => \$from_date,
-                         "to-date=s" => \$to_date,
-                         "rcs-log" => \$rcs_log,
-                         "with-date" => \$with_date,
-                         "reverse!" => \$reverse,
-                         "version" => \$version,
-                         "help"    => \$help);
-
-# If date options are specified, check that they have the format
-# YYYY-MM-DD.
-
-$result = 0 if $from_date && $from_date !~ /^\d\d\d\d-\d\d-\d\d$/;
-$result = 0 if $to_date && $to_date !~ /^\d\d\d\d-\d\d-\d\d$/;
+
+my $result;
+
+if (@ARGV == 0) {
+
+    # No arguments cannot posibly mean "show everything"!!
+    $result = 0;
+
+} else {
+
+    $result = GetOptions ("author=s" => \$author,
+                          "text=s"  => \$regexp,
+                          "exclude=s"  => \$exclude,
+                          "from-date=s" => \$from_date,
+                          "to-date=s" => \$to_date,
+                          "rcs-log" => \$rcs_log,
+                          "with-date" => \$with_date,
+                          "reverse!" => \$reverse,
+                          "version" => \$version,
+                          "help"    => \$help);
+
+    # If date options are specified, check that they have the format
+    # YYYY-MM-DD.
+
+    $result = 0 if $from_date && $from_date !~ /^\d\d\d\d-\d\d-\d\d$/;
+    $result = 0 if $to_date && $to_date !~ /^\d\d\d\d-\d\d-\d\d$/;
+}
 
 # Print usage information and exit when necessary.
 
@@ -77,7 +88,7 @@ Valid options are:
   --help                 Print this help
 
 If no CHANGELOG is specified scan the files "ChangeLog" and
-"ChangeLog.1+" in the current directory.  Old-style dates in ChangeLogs
+"ChangeLog.N+" in the current directory.  Old-style dates in ChangeLogs
 are not recognized.
 USAGE
     exit !$help;
@@ -86,7 +97,7 @@ USAGE
 # Print version info and exit if `--version' was specified.
 
 if ($version) {
-    print "0.2\n";
+    print "0.3\n";
     exit 0;
 }
 
@@ -233,7 +244,7 @@ sub parse_changelog {
 
 # If files were specified on the command line, parse those files in the
 # order supplied by the user; otherwise parse default files ChangeLog and
-# ChangeLog.1+ according to $reverse.
+# ChangeLog.NNN according to $reverse.
 unless (@ARGV > 0) {
     @ARGV = ("ChangeLog");
 
index 0deb001..7f3fc12 100644 (file)
 #  Boston, MA 02110-1301, USA.
 #
 
-ALL = make-docfile hexl ctags etags movemail ebrowse sorted-doc digest-doc
+ALL = make-docfile hexl ctags etags movemail ebrowse sorted-doc digest-doc emacsclient
 
 .PHONY: $(ALL)
 
+VERSION                = 22.0.91
+
 LOCAL_FLAGS    = -DWINDOWSNT -DDOS_NT -DSTDC_HEADERS=1 -DNO_LDAV=1 \
                  -DNO_ARCHIVES=1 -DHAVE_CONFIG_H=1 -I../nt/inc \
-                  -I../src
-
-# don't know what (if) to do with these yet...
-#
-#              $(BLD)/server.exe       \
-#              $(BLD)/emacstool.exe    \
-#              $(BLD)/emacsclient.exe  \
-#              $(BLD)/cvtmail.exe      \
+                 -I../src
 
-LIBS         = $(BASE_LIBS) $(ADVAPI32)
+LIBS           = $(BASE_LIBS) $(ADVAPI32)
 
 $(BLD)/make-docfile.exe:       $(BLD)/make-docfile.$(O) $(BLD)/ntlib.$(O)
                $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/make-docfile.$(O) $(BLD)/ntlib.$(O) $(LIBS)
@@ -59,6 +54,7 @@ movemail:     $(BLD) $(BLD)/movemail.exe
 fakemail:      $(BLD) $(BLD)/fakemail.exe
 sorted-doc:    $(BLD) $(BLD)/sorted-doc.exe
 digest-doc:    $(BLD) $(BLD)/digest-doc.exe
+emacsclient:   $(BLD) $(BLD)/emacsclient.exe $(BLD)/emacsclientw.exe
 
 test-distrib:  $(BLD) $(BLD)/test-distrib.exe
        "$(BLD)/test-distrib.exe" "$(SRC)/testfile"
@@ -74,6 +70,29 @@ $(BLD)/movemail.exe: $(MOVEMAILOBJS) getopt.h
 # put wsock32.lib before $(LIBS) to ensure we don't link to ws2_32.lib
                $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(MOVEMAILOBJS) $(WSOCK32) $(LIBS)
 
+ECLIENT_CFLAGS = -DHAVE_GETCWD -DHAVE_STRERROR -DVERSION="\"$(VERSION)\""
+ECLIENTOBJS =  $(BLD)/emacsclient.$(O) \
+               $(BLD)/getopt.$(O) \
+               $(BLD)/getopt1.$(O) \
+               $(BLD)/ntlib.$(O)
+TRES =         ../nt/$(BLD)/emacs.res
+
+$(TRES):       ../nt/emacs.rc
+               $(RC) $(RC_OUT)../nt/$(BLD)/emacs.res $(ALL_DEPS)
+
+$(BLD)/emacsclient.exe:                $(ECLIENTOBJS)
+# put wsock32.lib before $(LIBS) to ensure we don't link to ws2_32.lib
+               $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(ECLIENTOBJS) $(WSOCK32) $(LIBS)
+
+$(BLD)/emacsclientw.exe:       $(ECLIENTOBJS) $(TRES)
+# put wsock32.lib before $(LIBS) to ensure we don't link to ws2_32.lib
+               $(LINK) $(LINK_OUT)$@ $(TRES) -mwindows $(LINK_FLAGS) $(ECLIENTOBJS) $(WSOCK32) $(LIBS)
+
+# emacsclient.$(O) depends on makefile.w32-in because makefile.w32-in
+# can be edited to define VERSION string, which is part of ECLIENT_CFLAGS.
+$(BLD)/emacsclient.$(O):       emacsclient.c makefile.w32-in
+               $(CC) $(CFLAGS) $(ECLIENT_CFLAGS) $(CC_OUT)$@ emacsclient.c
+
 ETAGSOBJ      = $(BLD)/etags.$(O) \
                $(BLD)/getopt.$(O) \
                $(BLD)/getopt1.$(O) \
@@ -85,9 +104,9 @@ $(BLD)/etags.exe:    $(ETAGSOBJ)
 
 
 EBROWSEOBJ    = $(BLD)/ebrowse.$(O) \
-                $(BLD)/getopt.$(O) \
-                $(BLD)/getopt1.$(O) \
-                $(BLD)/ntlib.$(O)
+               $(BLD)/getopt.$(O) \
+               $(BLD)/getopt1.$(O) \
+               $(BLD)/ntlib.$(O)
 
 $(BLD)/ebrowse.exe:     $(EBROWSEOBJ)
                $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(EBROWSEOBJ) $(LIBS)
@@ -117,14 +136,6 @@ CTAGS_CFLAGS  = -DCTAGS $(ETAGS_CFLAGS)
 $(BLD)/ctags.$(O): ctags.c
                $(CC) $(CFLAGS) $(CTAGS_CFLAGS) $(CC_OUT)$@ ctags.c
 
-#
-# don't know what to do with these yet...
-#
-# $(BLD)/emacstool.exe:        $(BLD)/emacstool.$(O)
-# $(BLD)/server.exe:           $(BLD)/server.$(O)
-# $(BLD)/cvtmail.exe:          $(BLD)/cvtmail.$(O)
-# $(BLD)/emacsclient.exe:      $(BLD)/emacsclient.$(O)
-
 #
 # From ..\src\Makefile.in
 # It doesn't matter if the real name is *.obj for the files in this list,
@@ -263,6 +274,15 @@ lisp2 = \
        $(lispsource)window.elc \
        $(lispsource)version.el
 
+# This is needed the first time we build the tree, since temacs.exe
+# does not exist yet, and the DOC rule needs it to rebuild DOC whenever
+# Emacs is rebuilt.
+../src/$(BLD)/temacs.exe:
+       - mkdir "../src/$(OBJDIR)"
+       - mkdir "../src/$(BLD)"
+       @echo temacs > temacs.exe
+       $(CP) temacs.exe ../src/$(BLD)
+       - $(DEL) temacs.exe
 
 DOC          = DOC
 $(DOC):                $(BLD) $(BLD)/make-docfile.exe ../src/$(BLD)/temacs.exe $(lisp1) $(lisp2)
@@ -296,6 +316,8 @@ install:    $(INSTALL_FILES)
                $(CP) $(BLD)/movemail.exe $(INSTALL_DIR)/bin
                $(CP) $(BLD)/sorted-doc.exe $(INSTALL_DIR)/bin
                $(CP) $(BLD)/digest-doc.exe $(INSTALL_DIR)/bin
+               $(CP) $(BLD)/emacsclient.exe $(INSTALL_DIR)/bin
+               $(CP) $(BLD)/emacsclientw.exe $(INSTALL_DIR)/bin
                - mkdir "$(INSTALL_DIR)/etc"
                $(CP) $(DOC) $(INSTALL_DIR)/etc
 
@@ -351,9 +373,6 @@ $(BLD)/ctags.$(O) : \
        $(SRC)/ntlib.h \
        $(SRC)/getopt.h
 
-$(BLD)/cvtmail.$(O) : \
-       $(SRC)/cvtmail.c
-
 $(BLD)/digest-doc.$(O) : \
        $(SRC)/digest-doc.c
 
@@ -363,10 +382,6 @@ $(BLD)/emacsclient.$(O) : \
        $(EMACS_ROOT)/src/m/intel386.h \
        $(EMACS_ROOT)/lib-src/../src/config.h
 
-$(BLD)/emacstool.$(O) : \
-       $(SRC)/emacstool.c \
-       $(EMACS_ROOT)/nt/inc/sys/file.h
-
 $(BLD)/etags.$(O) : \
        $(SRC)/etags.c \
        $(EMACS_ROOT)/nt/inc/sys/param.h \
@@ -428,7 +443,7 @@ $(BLD)/movemail.$(O) : \
        $(EMACS_ROOT)/lib-src/../src/syswait.h \
        $(EMACS_ROOT)/nt/inc/pwd.h \
        $(SRC)/ntlib.h
-               $(CC) $(CFLAGS) -DUSG $(CC_OUT)$@ movemail.c
+       $(CC) $(CFLAGS) -DUSG $(CC_OUT)$@ movemail.c
 
 $(BLD)/ntlib.$(O) : \
        $(SRC)/ntlib.c \
index 0ae2212..94b535a 100644 (file)
-2006-10-29  Stephen Leake  <stephen_leake@stephe_leake.org>
+2006-12-01  Nick Roberts  <nickrob@snap.net.nz>
+
+       * menu-bar.el (toggle-case-fold-search): Clarfify doc/help string and
+       mini-buffer message.
+
+2006-12-01  Juanma Barranquero  <lekktu@gmail.com>
+
+       * descr-text.el (describe-char-unicodedata-file): Fix typo in docstring.
+
+2006-12-01  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
+
+       * paren.el: Fix the highlight overlay extension when the user types a
+       sequence of char very fast just after the open parenthesis.
+       Suggested by Ben North <ben@redfrontdoor.org>.
+
+       * ps-mule.el: Eliminate Emacs 20 compatibility.
+
+       * ps-print.el: Eliminate Emacs 20 & 21 compatibility.
+       (ps-print-version): New Version 6.7.
+       (ps-print-quote): Replace '?\ ' by '?\s'.
+
+2006-11-30  Juanma Barranquero  <lekktu@gmail.com>
+
+       * hexl.el (hexl-goto-address, hexl-forward-char, hexl-forward-short)
+       (hexl-forward-word, hexl-previous-line, hexl-beginning-of-1k-page)
+       (hexl-end-of-1k-page): Doc fixes.
+       (hexl-address-region, hexl-ascii-region, hexl-highlight-line-range):
+       Fix typos in docstrings.
+
+2006-11-30  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac@lrde.org>
+
+       * ido.el (ido-local-file-exists-p): New.  Tell if a file exists
+       locally, i.e. without using file name handlers.
+       (ido-read-internal): Allow mono letter host names, avoiding the
+       `c:' problem by testing if the file exists locally.
+       (ido-complete, ido-make-file-list, ido-exhibit): Ditto.
+
+2006-11-30  Masatake YAMATO  <jet@gyve.org>
+
+       * hexl.el (hl-line-range-function, hl-line-face): Declare variables
+       to avoid bytecomp warnings.
+       (hexl-mode-old-ruler-function): New variable.
+       (hexl-follow-line): Bind `hexl-mode-old-hl-line-range-function'
+       and `hl-line-range-function' after `require' hl-line.
+       Then bind `hl-line-range-function' and `hl-line-face'.
+       Don't require frame.  Don't use `with-no-warnings'.
+       (hexl-activate-ruler): Store the original value of
+       `ruler-mode-ruler-function' to `hexl-mode-old-ruler-function'.
+       (hexl-mode-exit): Restore the original value of
+       `ruler-mode-ruler-function'.
+
+2006-11-30  Alin C. Soare  <alinsoar@voila.fr>  (tiny change)
+
+       * hexl.el (hexl-mode-old-hl-line-range-function): New variable.
+       (hexl-mode-old-hl-line-face): New variable.
+       (hexl-mode, hexl-mode-exit): Fix the highlighting of the current
+       line when exit from the hexl-mode.
+
+2006-11-30  Juanma Barranquero  <lekktu@gmail.com>
+
+       * emacs-lisp/bytecomp.el (byte-optimize, byte-compile-warnings):
+       Doc fixes.
+
+       * international/fontset.el (create-fontset-from-ascii-font)
+       (create-fontset-from-fontset-spec, x-compose-font-name): Doc fixes.
+       (fontset-name-p): Fix typo in docstring.
+
+       * progmodes/cc-cmds.el (c-indent-exp): Fix typo in docstring.
+
+2006-11-30  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
+
+       * ps-bdf.el: Fix maintainer email.
+
+       * ps-mule.el: Fix maintainer email.  Define functions for Emacs 20
+       compatibility.
+
+       * ps-print.el: Fix maintainer email.  Define functions for Emacs 20 &
+       21 compatibility.
+       (ps-print-quote): Replace '?\s' by '?\ ' to keep compatibility with
+       Emacs 20 & 21.
+
+2006-11-29  J.D. Smith  <jdsmith@as.arizona.edu>
+
+       * progmodes/idlwave.el (idlwave-auto-fill): Remove
+       paragraph-start let to prevent auto-fill giving up.
+
+2006-11-28  Juanma Barranquero  <lekktu@gmail.com>
+
+       * vt100-led.el (led-state): Fix typo in previous change.
+
+2006-11-27  Andreas Seltenreich  <uwi7@rz.uni-karlsruhe.de>
+
+       * emacs-lisp/easy-mmode.el (easy-mmode-define-navigation): Fix
+       interactive spec of the functions getting defined to make them
+       work as documented.
+
+2006-11-28  Chong Yidong  <cyd@stupidchicken.com>
+
+       * startup.el (fancy-splash-screens): Hide initial splash buffer.
+
+2006-11-28  Kim F. Storm  <storm@cua.dk>
+
+       * icomplete.el (icomplete-tidy, icomplete-exhibit): Check that
+       icomplete-mode is enabled.
+
+2006-11-28  Carsten Dominik  <dominik@science.uva.nl>
+
+       * textmodes/org.el (require): Require gnus-sum during compilation
+       to avoid problem with a macro call.
+
+2006-11-28  Glenn Morris  <rgm@gnu.org>
+
+       * emacs-lisp/authors.el (authors-aliases): Add new alias.
+
+       * progmodes/fortran.el (fortran-font-lock-keywords-4): Add `min'.
+       (fortran-window-create-momentarily): Do not need string-to-char.
+
+2006-11-28  Richard Stallman  <rms@gnu.org>
+
+       * emacs-lisp/bytecomp.el (byte-compile-get-constant):
+       Replace incorrect use of assoc-default with a loop.
+
+       * term.el (term-exec-1): Set envvar INSIDE_EMACS.
+
+       * simple.el (next-error-find-buffer): Improve messages.
+
+       * files.el (revert-buffer): Special error message if file
+       is now not readable.
+
+       * facemenu.el (facemenu-add-new-face): Improve doc strings of
+       constructed commands.
+
+       * comint.el (comint-exec-1): Provide Emacs version and `comint'
+       in INSIDE_EMACS.
+
+2006-11-27  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * diff-mode.el (diff-mode-map): Add a binding for unified->context.
+
+       * server.el: Remove spurious * in docstrings.
+       (server-process-filter): Exit from recursive editing before processing
+       a new request.
+
+2006-11-27  J.D. Smith  <jdsmith@as.arizona.edu>
+
+       * progmodes/hideshow.el (hs-already-hidden-p): Move to end of
+       line so hidden blocks will be correctly identified.
+
+2006-11-27  Juanma Barranquero  <lekktu@gmail.com>
+
+       * ledit.el (ledit-save-defun, ledit-mode):
+       * resume.el (resume-emacs-args-buffer):
+       * rot13.el (rot13-display-table, rot13-translate-table, rot13)
+       (rot13-string, rot13-region, rot13-other-window, toggle-rot13-mode):
+       * vmsproc.el (subprocess-input, start-subprocess, subprocess-command)
+       (command-send-input, command-kill-line):
+       * vt100-led.el (led-state, led-on): Fix typos in docstrings.
+
+       * autoarg.el (autoarg-kp-mode): Doc fix.
+
+       * emacs-lock.el (toggle-emacs-lock): Doc fix.  Simplify.
+       (emacs-lock-check-buffer-lock): Doc fix.  Use `when'.
+       (check-emacs-lock): Doc fix.  Simplify.
+
+       * iimage.el (iimage-mode-image-regex-alist): Doc fix.
+       (iimage-mode-buffer): Fix typos in docstring.
+
+       * misc.el (zap-up-to-char): Doc fix.
+
+       * time-stamp.el: Fix comment and obsolescence string for old
+       functions.  Use `dolist' instead of `while'.
+
+       * userlock.el (ask-user-about-lock-help): Fix typos in output message.
+
+       * disp-table.el (standard-display-8bit, standard-display-default):
+       * ebuff-menu.el (electric-buffer-list):
+       * ehelp.el (electric-help-command-loop):
+       * font-core.el (font-lock-mode):
+       * help-macro.el (make-help-screen):
+       * help.el (describe-minor-mode-completion-table-for-indicator)
+       (lookup-minor-mode-from-indicator):
+       * indent.el (tab-to-tab-stop, move-to-tab-stop):
+       * info-look.el (info-lookup-guess-custom-symbol):
+       * locate.el (locate-main-listing-line-p, locate-mode, locate-do-setup):
+       * longlines.el (longlines-wrap-line):
+       * macros.el (insert-kbd-macro):
+       * menu-bar.el (menu-bar-update-buffers):
+       * misc.el (copy-from-above-command):
+       * mouse.el (mouse-popup-menubar, mouse-buffer-menu-alist):
+       * newcomment.el (comment-indent):
+       * novice.el (disabled-command-function):
+       * sort.el (sort-fields-syntax-table):
+       * subr.el (momentary-string-display):
+       * tar-mode.el (tar-header-block-summarize)
+       (tar-clear-modification-flags):
+       * terminal.el (terminal-cease-edit, te-more-break-unwind, te-newline)
+       (te-clear-rest-of-line, te-clear-rest-of-screen, te-clear-screen)
+       (te-insert-lines, te-delete-lines, te-delete, te-insert-spaces)
+       (te-delete-char, te-down-vertically-or-scroll):
+       * time-stamp.el (time-stamp-string-preprocess):
+       * tmm.el (tmm-add-one-shortcut): "?\ " -> "?\s".
+
+2006-11-26  Nick Roberts  <nickrob@snap.net.nz>
+
+       * speedbar.el (speedbar-timer-fn): Revert to old behaviour when not
+       in GUD mode.
+
+       * progmodes/gud.el (gud-install-speedbar-variables): Remove bindings:
+       speedbar-expand-line-descendants, speedbar-contract-line-descendants.
+
+2006-11-26  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * progmodes/cc-vars.el (c-backslash-column): Add . at end of sentence.
+
+2006-11-26  Stephen Leake  <stephen_leake@stephe-leake.org>
+
+       * progmodes/ada-mode.el (ada-which-compiler): Fix typo in docstring.
+       (ada-compile-goto-error): Adapt to new argument profile of
+       compilation-goto-locus in Emacs 22.  Don't check if the various
+       compile functions are defined; we already do "(require 'compile)".
+
+2006-11-26  Kim F. Storm  <storm@cua.dk>
+
+       * kmacro.el: Fix commentary.
+
+2006-11-26  Nick Roberts  <nickrob@snap.net.nz>
+
+       * progmodes/gud.el (gdb): Explain how to run in text command mode
+       more clearly.  Say in error message that multiple debugging
+       requires restarting GDB.
+
+2006-11-25  Juanma Barranquero  <lekktu@gmail.com>
+
+       * international/fontset.el (create-fontset-from-fontset-spec): Doc fix.
+
+2006-11-25  Pavel Kobiakov  <pk_at_work@yahoo.com>
+
+       * progmodes/flymake.el (flymake-posn-at-point-as-event): New function.
+       (flymake-popup-menu): Use it instead of posn-at-point.
+
+2006-11-25  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * progmodes/cc-vars.el (c-backslash-column):
+       Mention c-backslash-max-column in documentation for c-backslash-column.
+
+2006-11-24  Lars Hansen  <larsh@soem.dk>
+
+       * net/tramp.el (tramp-default-method): Under Windows, change from
+       plink to pscp.
+       (tramp-copy-failed-regexp, tramp-action-copy-failed): Add.
+       (tramp-actions-copy-out-of-band):
+       Add pair (tramp-copy-failed-regexp tramp-action-copy-failed).
+       (tramp-action-out-of-band): Move "Permission denied" handling to
+       tramp-action-copy-failed.
+       (tramp-do-copy-or-rename-file-out-of-band): unwind-protect killing of
+       process buffer.
+
+2006-11-24  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * pgg-pgp.el (pgg-pgp-process-region): Change `args' from a list of
+       strings to a single string.  Quote `errors-file-name'.
+       (pgg-pgp-encrypt-region, pgg-pgp-decrypt-region, pgg-pgp-sign-region)
+       (pgg-pgp-verify-region, pgg-pgp-insert-key, pgg-pgp-snarf-keys-region):
+       Adjust calls.  Use `shell-quote-argument'.
+
+       * international/mule.el (load-with-code-conversion)
+       (with-category-table): Use with-current-buffer.
+       (after-insert-file-set-coding): Use restore-buffer-modified-p.
+
+2006-11-24  Eli Zaretskii  <eliz@gnu.org>
+
+       * mail/smtpmail.el (smtpmail-send-it):
+       Copy buffer-file-coding-system from the mail buffer.  Possibly add a
+       MIME header for the message encoding.
+       Bind coding-system-for-write around the call to mail-do-fcc.
+       Use smtpmail-code-conv-from to encode queued mail messages.
+
+2006-11-24  Juanma Barranquero  <lekktu@gmail.com>
+
+       * tabify.el (tabify-regexp): Doc fix.
+
+       * net/rcirc.el (rcirc-buffer-maximum-lines):
+       * progmodes/gud.el (jdb): Fix space/tab mixup in docstrings.
+
+       * play/gomoku.el (gomoku-terminate-game, gomoku-human-takes-back)
+       (gomoku-prompt-for-move, gomoku-human-plays, gomoku-offer-a-draw):
+       Fix typos in output messages.
+       (gomoku-vector-length, gomoku-init-board): Fix typos in docstrings.
+
+2006-11-23  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * hexl.el (hexl-mode): Don't try to guess the max-address: get it from
+       the horse's mouth.
+       (hexlify-buffer): Don't re-encode an arg that's already encoded.
+
+2006-11-23  Michael Kifer  <kifer@cs.stonybrook.edu>
+
+       * ediff-diff.el (ediff-exec-process, ediff-same-file-contents):
+       Remove condition-case.
+
+2006-11-23  Glenn Morris  <rgm@gnu.org>
+
+       * progmodes/f90.el (f90-comment-indent): Do not move point in
+       default case.
+
+2006-11-21  Romain Francoise  <romain@orebokech.com>
+
+       * emacs-lisp/find-func.el (find-library-name): Don't strip ".el"
+       from library name (reverts change of 2005-10-25).
+
+2006-11-21  Lennart Borgman  <lennart.borgman.073@student.lu.se>
+
+       * tutorial.el (tutorial--default-keys): Add newline and
+       delete-backward-char bindings.
+       (tutorial--detailed-help): Save excursion when finding keys.
+       Correct warning string for M-x FOO case.
+       (tutorial--display-changes): Print special keys in tutorial style.
+       Tweak search regexp for changed keys.
+
+2006-11-21  Bob Rogers  <rogers-emacs@rgrjr.dyndns.org>  (tiny change)
+
+       * thingatpt.el (thing-at-point-url-at-point): Don't add a
+       redundant scheme.
+
+2006-11-21  Diane Murray  <disumu@x3y2z1.net>  (tiny change)
+
+       * thingatpt.el (thing-at-point-uri-schemes): Add schemes that
+       are new to the list at IANA.  Also added irc, mms, mmsh.
+
+2006-11-20  J.D. Smith  <jdsmith@as.arizona.edu>
+
+       * progmodes/idlw-help.el (idlwave-html-help-location):
+       Fail gracefully for missing help packages.
+       (idlwave-help-assistant-open-link): Open full links.
+       (idlwave-help-assistant-help-with-topic): Direct help link.
+
+       * progmodes/idlwave.el (idlwave-mode):
+       Set add-log-current-defun-function.
+       (idlwave-current-routine-fullname): Add, to support add-log.
+       (idlwave-convert-xml-system-routine-info): Simplify XML parsing
+       to reflect improvements to xml-parse-file.
+       (idlwave-mode-menu-def): New binding for help-with-topic.
+
+       * progmodes/idlw-shell.el (idlwave-shell-filter-directory):
+       Handle extra newlines and spaces.
+       (idlwave-shell-mode-map): Add help-with-topic.
+
+2006-11-20  Chong Yidong  <cyd@stupidchicken.com>
+
+       * tutorial.el (tutorial-warning-face): New face.
+       (tutorial--detailed-help, tutorial--display-changes): Use it.
+       (tutorial--find-changed-keys): Check ESC-prefix binding specially.
+       Improve search pattern for occurrences of changed keys.
+
+2006-11-20  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * term/x-win.el (x-last-cut-buffer-coding): New variable.
+       (x-select-text): Set it.
+       (x-cut-buffer-or-selection-value): Check also x-last-cut-buffer-coding
+       when checking for newness.
+
+2006-11-19  Juanma Barranquero  <lekktu@gmail.com>
+
+       * subr.el (posn-image):
+       * progmodes/ebnf2ps.el (ebnf-stop-on-error): Fix typos in docstrings.
+
+       * emacs-lisp/regexp-opt.el (regexp-opt): Doc fix.
+
+2006-11-19  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac@lrde.org>
+
+       * progmodes/glasses.el (glasses-separate-parentheses-exceptions): New.
+       Exceptions to the rule "add a space between an identifier and an
+       opening parenthesis".  Defaulted to the `#define' problem of cpp.
+       (glasses-parenthesis-exception-p): New.  Check if the region is an
+       exception regarding to that.
+       (glasses-make-readable): Use it.
+       (glasses-convert-to-unreadable): Ditto.  Modify the file also if
+       `glasses-convert-on-write-p' and `glasses-separate-parentheses-p' are t.
+
+2006-11-19  Chong Yidong  <cyd@stupidchicken.com>
+
+       * emacs-lisp/bytecomp.el (byte-compile-if): Revert last change.
+
+2006-11-19  Stephen Leake  <stephen_leake@stephe-leake.org>
+
+       * progmodes/ada-mode.el (ada-make-body): Fix typo.
+
+       * progmodes/ada-xref.el (ada-make-body-gnatstub): Fix typo.
+       (ada-xref-initialize): Fix typo.  Use add-hook and remove-hook.
+
+2006-11-18  Chong Yidong  <cyd@stupidchicken.com>
+
+       * emacs-lisp/bytecomp.el (byte-compile-maybe-guarded): Check `and'
+       conditions for function or variable bindings.
+
+       * comint.el (comint-exec-1): Set EMACS and INSIDE_EMACS to t.
+
+       * progmodes/compile.el (compilation-start): Ditto.
+
+2006-11-18  Michael Albinus  <michael.albinus@gmx.de>
+
+       * net/tramp.el (top): cl and custom are always required.
+
+2006-11-18  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * term/x-win.el (x-cut-buffer-or-selection-value): Decode text from
+       cut-buffers with next-selection-coding-system if not nil.
+
+2006-11-17  Carsten Dominik  <dominik@science.uva.nl>
+
+       * textmodes/org.el (org-fix-decoded-time): New function.
+       (org-display-custom-time): Use `org-fix-decoded-time'.
+
+2006-11-17  Chong Yidong  <cyd@stupidchicken.com>
+
+       * menu-bar.el (menu-bar-games-menu): Remove yow.
+
+2006-11-17  Carsten Dominik  <dominik@science.uva.nl>
+
+       * textmodes/org.el (org-scan-tags): Re-align code fixed.
+       (org-detach-overlay): Rename from `org-detatch-overlay'.
+       (org-table-convert-region): Insert space after column separator.
+       (org-agenda-kill): New command.
+       (org-metaleft): Call `org-outdent-item' on bullets.
+       (org-metaright): Call `org-indent-item' on bullets.
+       (org-timestamp-change): Set `org-last-changed-timestamp'.
+       (org-current-line): Make sure (bolp) returns correct result.
+       (org-agenda-change-all-lines): Make sure TODO are highlighted.
+
+2006-11-17  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * pcvs.el (cvs-retrieve-revision): Set buffer-file-coding-system.
+
+2006-11-16  Chong Yidong  <cyd@stupidchicken.com>
+
+       * mouse.el (global-map): Change 2006-08-16 fix to call
+       mouse-yank-at-click explicitly, since mouse events are not carried
+       over into keyboard macros.
+
+2006-11-16  Kim F. Storm  <storm@cua.dk>
+
+       * ido.el (ido-file-internal): Use current buffer's file name as default
+       choice for ido-find-alternate-file.  Suggested by Matt Hodges.
+
+2006-11-15  Ken Manheimer  <ken.manheimer@gmail.com>
+
+       * allout.el (allout-doublecheck-at-and-shallower): Clarify docstring.
+       (allout-inhibit-aberrance-doublecheck): Rename from
+       allout-during-yank-processing.  All callers changed.
+       (allout-ascend): Provide for unusual case where some topic after
+       the first in file is at lower depth than the first.
+       (allout-shift-in): Ensure the offspring of the new containing
+       topic are exposed.
+       (allout-encrypt-string): Preserve the coding-system of the text,
+       according to that of the containing buffer.
+       (allout-toggle-subtree-encryption): When the text being encrypted
+       requires a different coding system, offer to preserve the coding
+       system using a file local var.
+
+2006-11-15  Simon Marshall  <simon@gnu.org>
+
+       * progmodes/cc-fonts.el (c-font-lock-declarators): Use c-at-toplevel-p
+       to recognise "T t()" as a function declaration, rather than a
+       variable instantiation, iff at the top-level or inside a class
+       declaration.  Suggested by Feng Li <fengli@gmail.com>.
+
+2006-11-14  Stephen Leake  <stephen_leake@stephe-leake.org>
+
+       * progmodes/ada-xref.el (ada-parse-prj-file):
+       Don't delete project buffer; user may want to edit it.
+       (ada-xref-set-project-field, ada-xref-current-project-file)
+       (ada-xref-current-project, ada-show-current-project)
+       (ada-set-main-compile-application): New functions.
+       (ada-xref-get-project-field, ada-require-project-file):
+       Normalize use of ada-prj-default-project-file.
+       (ada-gdb-application, ada-get-ada-file-name, ada-make-body-gnatstub):
+       Normalize use of ada-require-project-file.
+       (ada-prj-find-prj-file): Improve doc string, comments.
+
+       * progmodes/ada-mode.el (ada-mode-version): Bump version.
+       (ada-create-keymap): Add \C-c\C-m 'ada-set-main-compile-application.
+       (ada-create-menu): Add ada-set-main-compile-application,
+       ada-show-current-main, ada-show-current-project.
+
+2006-11-14  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * progmodes/python.el (inferior-python-mode-syntax-table): New var.
+       (inferior-python-mode): Use it.
+
+2006-11-14  Andreas Schwab  <schwab@suse.de>
+
+       * term/xterm.el (terminal-init-xterm): Add more key bindings.
+
+2006-11-13  Kim F. Storm  <storm@cua.dk>
+
+       * ido.el (ido-copy-current-word): C-o copies region if active.
+
+2006-11-13  Carsten Dominik  <dominik@science.uva.nl>
+
+       * textmodes/org.el (org-emph-face): Fix typo in variable name.
+
+2006-11-13  Juanma Barranquero  <lekktu@gmail.com>
+
+       * ediff.el (ediff-revision):
+       * files.el (set-visited-file-name):
+       * mail/rmailout.el (rmail-output-body-to-file):
+       Use `format', not `message', in `y-or-n-p' call.
+
+2006-11-13  Carsten Dominik  <dominik@science.uva.nl>
+
+       * textmodes/org.el (org-metaleft): Call `org-outdent-item' on bullets.
+       (org-metaright): Call `org-indent-item' on bullets.
+       (org-timestamp-change): Set `org-last-changed-timestamp'.
+       (org-current-line): Make sure (bolp) returns correct result.
+       (org-agenda-change-all-lines): Make sure highlighting TODO always works.
+
+2006-11-12  Richard Stallman  <rms@gnu.org>
+
+       * language/european.el (turkish-case-conversion-enable)
+       (turkish-case-conversion-disable): New functions.
+       ("Turkish" lang env): Use them.
+
+       * international/characters.el (case table):
+       Do nothing special for i and I.
+
+       * subr.el (remove-overlays): Fix last change.
+
+       * cus-edit.el (custom-save-all): Use find-file-visit-truename
+       for visiting the custom file.
+
+2006-11-12  Markus Triska  <triska@gmx.at>
+
+       * play/handwrite.el (handwrite): Also process lines not ending
+       with newline.  Replace some position-fiddling with different
+       logic.  Improve performance.
+
+2006-11-12  Stephen Leake  <stephen_leake@stephe-leake.org>
+
+       * progmodes/ada-xref.el (ada-prj-default-check-cmd): New variable,
+       replacing deleted variable `ada-check-switch'.
+       (ada-project-file-extension): Rename to `ada-prj-file-extension'.
+       (ada-xref-project-files): Improve doc string.
+       (ada-find-executable): New function.
+       (ada-initialize-runtime-library): Use `ada-find-executable'.
+       (ada-xref-set-default-prj-values): In compile commands, don't need
+       `ada-cd-command'; `compile' does that more portably.
+       Use ada-prj-default-check-cmd.
+       (ada-parse-prj-file): Don't set 'debug_post_cmd, 'debug_pre_cmd
+       properties if not specified in project file.
+       (ada-goto-declaration): Display useful message for new error
+       'error-file-not-found.
+       (ada-get-ada-file-name, ada-find-in-src-path): Signal new error
+       'error-file-not-found.
+       (ada-get-all-references): Match latest ali syntax.  Signal new
+       error 'error-file-not-found.
+       (ada-find-in-ali): Match latest ali syntax.
+       (ada-make-filename-from-adaname): Handle different semantics of
+       gnatkr in GNAT 3.15p vs later.
+
+       * progmodes/ada-stmt.el (ada-func-or-proc-name): Match changes to
+       ada-procedure-start-regexp.
+       (ada-or-accept, ada-or-delay, ada-or-terminate): Improve doc string.
+
+       * progmodes/ada-mode.el: Replace conditional (require 'ispell)
+       with defvar.
+       (ada-language-version): Rename ada05 -> ada2005.
+       (ada-align-region-separate): Add `eval-when-compile'.
+       (ada-name-regexp): Remove unneeded escapes in regexp character
+       alternative.
+       (ada-compile-goto-error-file-linenr-re): New constant.
+       (ada-matching-start-re): Handle additional cases `declare',
+       `procedure', `function'.
+       (ada-compile-goto-error): Handle "... at line nn".
+       (ada-mode): Clearer syntax, comments for ff-special-constructs.
+       Delete support for old versions of `align'.
+       (ada-search-prev-end-stmt): Handle additional keyword `private'.
+       (ada-check-defun-name): Simplify handling of `declare'.
+       (ada-goto-matching-start): Handle nested `begin ... end'.
+       Handle `declare', `protected', `procedure', `function'.
+       (ada-create-menu): Presence of arm95 is not conditional on using
+       GNAT compiler.
+
+2006-11-12  Juanma Barranquero  <lekktu@gmail.com>
+
+       * emacs-lisp/re-builder.el (reb-mode): Set `blink-matching-paren' to
+       nil in the *RE-Builder* buffer (it causes spurious error messages).
+
+       * server.el (server-visit-files): If `minibuffer-auto-raise' has
+       been set to t, respect it.
+
+2006-11-11  Stephen Leake  <stephen_leake@stephe-leake.org>
+
+       * progmodes/ada-mode.el: Delete `eval-and-compile' around `require'.
+       Delete commented out code for old Emacs versions.  Autoloading of
+       "ada-xref", "ada-prj" is useful even if compiler is not GNAT.
+       (ada-mode-version): Bump version number.
+       (ada-95-string-keywords, ada-2005-string-keywords)
+       (ada-2005-keywords, ada-name-regexp): New constant.
+       (ada-language-version, ada-procedure-start-regexp, ada-mode)
+       (ada-font-lock-keywords): Add support for Ada 2005 keywords.
+       (ada-package-start-regexp): Support private packages, include package
+       name (for ada-set-point-accordingly).
+       (ada-next-procedure, ada-previous-procedure)
+       (ada-which-function-are-we-in): Match changes to
+       ada-procedure-start-regexp.
+       (ada-make-body): Make non-interactive; not a user function.
+       (ada-make-subprogram-body): Improve doc string.
+
+2006-11-11  Romain Francoise  <romain@orebokech.com>
+
+       * progmodes/cperl-mode.el (cperl-mode): Before adding to it, make
+       `compilation-error-regexp-alist' buffer-local, since we changed
+       `compilation-error-regexp-alist-alist' locally.
+
+2006-11-11  Juanma Barranquero  <lekktu@gmail.com>
+
+       * server.el (server-visit-files): Bind `minibuffer-auto-raise'
+       to the value of `server-raise-frame'.
+
+2006-11-11  Glenn Morris  <rgm@gnu.org>
+
+       * ido.el (ido-enable-prefix)
+       * ses.el (ses-call-printer-return)
+       * net/tramp.el (tramp-unified-filenames)
+       * progmodes/cc-align.el (c-lineup-string-cont)
+       * progmodes/compile.el (compilation-directory-matcher)
+       * progmodes/ebnf2ps.el (ebnf-stop-on-error)
+       * progmodes/vhdl-mode.el (vhdl-reset-active-high)
+       (vhdl-clock-rising-edge)
+       * textmodes/org.el (org-export-with-timestamps)
+       (org-export-remove-timestamps-from-toc)
+       (org-export-with-tags): Improve previous doc fixes.
+
+2006-11-11  Richard Stallman  <rms@gnu.org>
+
+       * textmodes/flyspell.el (flyspell-mode-map):
+       Bind C-c $ instead of M-RET.
+
+2006-11-10  Simon Marshall  <simon@gnu.org>
+
+       * progmodes/cc-fonts.el (c-font-lock-declarations): Don't overwrite
+       fontification for "case" and "default" keywords.
+
+2006-11-10  Andreas Schwab  <schwab@suse.de>
+
+       * calendar/cal-dst.el (calendar-dst-check-each-year-flag):
+       Avoid starting sentence with "nil".
+
+2006-11-10  Juanma Barranquero  <lekktu@gmail.com>
+
+       * server.el (server-raise-frame): New option.
+       (server-switch-buffer): Use it.
+
+2006-11-10  Nick Roberts  <nickrob@snap.net.nz>
+
+       * progmodes/gdb-ui.el (gdb-many-windows): Start doc string
+       with a capital.
+
+2006-11-10  Carsten Dominik  <carsten.dominik@gmail.com>
+
+       * textmodes/org.el (org-show-hierarchy-above)
+       (org-show-following-heading): Fix typo in default value.
+       (org-scan-tags): Make the search case-sensitive.
+       (org-tags-sparse-tree): Don't overrule
+       `org-show-following-heading' and `org-show-hierarchy-above'.
+       (org-reveal): New command.
+       (org-show-context): Rename from `org-show-hierarchy-above'.
+       (org-fast-tag-selection-single-key): New option.
+       (org-fast-tag-show-exit, org-set-current-tags-overlay): New functions.
+       (org-tags-overlay): New variable.
+       (org-agenda-todo-ignore-deadlines): New option.
+       ("session"): Add circular data structure `org-mark-ring' to
+       exceptions list in session.el.
+       (org-agenda-window-setup, org-agenda-restore-windows-after-quit):
+       New options.
+       (org-agenda-quit): Use `org-agenda-restore-windows-after-quit'.
+       (org-prepare-agenda, org-agenda-quit): Use `org-agenda-window-setup'.
+       (org-pre-agenda-window-conf, org-blank-before-new-entry): New vars.
+       (org-finalize-agenda): Activate bracket links in agenda.
+       (org-at-timestamp-p, org-at-date-range-p): Additional argument
+       INACTIVE-OK.
+       (org-show-hierarchy-above, org-show-following-heading):
+       List values allowed for fine-tuned configuration.
+       (org-show-hierarchy-above): New argument CONTEXT, use the
+       fine-tuned settings in `org-show-hierarchy-above' and
+       `org-show-following-heading'.
+       (org-display-custom-time): New function.
+       (org-toggle-time-stamp-overlays, org-insert-time-stamp): New function.
+       (org-display-custom-times, org-time-stamp-custom-formats):
+       (org-maybe-intangible): New macro.
+       (org-activate-bracket-links, org-hide-wide-columns):
+       Use `org-maybe-intangible'.
+       (org-open-file): Use `shell-quote-argument'.
+       (org-display-internal-link-with-indirect-buffer): New option.
+       (org-file-remote-p): Get regexp from list.
+       (org-link-expand-abbrev): New function.
+       (org-link-abbrev-alist): New option.
+       (org-open-at-point, org-cleaned-string-for-export):
+       Call `org-link-expand-abbrev'.
+       (org-timeline, org-agenda-list, org-todo-list)
+       (org-tags-view): Remove the KEEP-MODES argument.
+       (org-finalize-agenda-hook): New hook.
+       (org-get-alist-option): New function.
+       (org-follow-timestamp-link): New function.
+       (org-open-at-point): Call `org-follow-timestamp-link'.
+       (org-log-note-marker, org-log-note-purpose)
+       (org-log-note-window-configuration): New variables.
+       (org-add-log-maybe, org-add-log-note, org-store-log-note): New funs.
+       (org-log-note-headings): New option.
+       (org-dblock-write:clocktable): Bug fix, removed infinite loop.
+       (org-store-link): Support for dired-mode.
+       (org-open-file): Substitute environment variables into filename.
+       (org-last): New defsubst.
+       (org-agenda-re-align-tags): New function.
+       (org-agenda-align-tags-to-column): New option.
+       (org-agenda-timeline): Group removed.
+       (org-prepare-agenda, org-prepare-agenda-buffers)
+       (org-run-agenda-series, org-timeline, org-agenda-list)
+       (org-todo-list, org-tags-view): Call `org-agenda-prepare' and set
+       the text property inticating the agenda type.
+       (org-agenda-post-command-hook): Get agenda type from text property
+       at point.
+       (org-agenda): Handle command sets.  Set `org-agenda-last-arguments'
+       and obey `org-agenda-overriding-arguments'.
+       (org-agenda-overriding-arguments, org-agenda-last-arguments): New vars.
+       (org-agenda-goto-today, org-agenda-later, org-agenda-earlier)
+       (org-agenda-week-view, org-agenda-day-view):
+       Use `org-agenda-overriding-arguments' to make updating work with
+       multi-block agendas.
+       (org-agenda-prefix-format): Allow different formats for the
+       different agenda entry types.
+       (org-timeline-prefix-format): Option removed, use
+       `org-agenda-prefix-format' instead.
+       (org-prepare-agenda): New function.
+       (org-select-timeline-window): Option removed, use
+       `org-select-agenda-window' instead.
+       (org-respect-restriction): Variable removed.
+       (org-cmp-tag): New function.
+       (org-agenda-sorting-strategy, org-entries-lessp):
+       Implement sorting by last tag.
+       (org-complete): Better completion in in-buffer option lines.
+       (org-in-item-p): New function.
+       (org-org-menu): Add entries for checkboxes.
+       (org-cycle): Extra brouping in outline-regexp, because it is used
+       in a search with "^" prepended.
+       (org-provide-checkbox-statistics): New option.
+       (org-set-font-lock-defaults): Highlight checkbox statistics.
+       (org-update-checkbox-count-maybe)
+       (org-get-checkbox-statistics-face): New functions.
+       (org-update-checkbox-count): New command.
+       (org-insert-item, org-toggle-checkbox):
+       Call `org-update-checkbox-count-maybe'.
+       (org-export-as-html): XEmacs compatibility for coding system.
+       (org-force-cycle-archived): New command.
+       (org-cycle-hide-archived-subtrees): Display message when ARCHIVE
+       overrules cycling.
+       (org-fix-position-after-promote): If the line contains only a todo
+       keyword, add a final space.
+       (org-promote-subtree, org-demote-subtree):
+       Call `org-fix-position-after-promote'.
+
+2006-11-10  Glenn Morris  <rgm@gnu.org>
+
+       * calendar/cal-dst.el: Do not assume DST starts/ends on the same
+       date in every year.
+       (calendar-dst-check-each-year-flag): New customizable variable.
+       (calendar-dst-find-data): New function, extracted from
+       calendar-current-time-zone.
+       (calendar-current-time-zone): Use calendar-dst-find-data.
+       (calendar-dst-transition-cache): New variable.
+       (calendar-dst-find-startend, calendar-dst-starts)
+       (calendar-dst-ends): New functions.
+       (calendar-daylight-savings-starts)
+       (calendar-daylight-savings-ends): Change value to use
+       calendar-dst-starts, calendar-dst-ends; respectively.
+
+       * progmodes/f90.el (f90-indent-region): Bind case-fold-search to t.
+
+       * ido.el (ido-enable-prefix)
+       * ses.el (ses-call-printer-return)
+       * net/tramp.el (tramp-unified-filenames)
+       * progmodes/cc-align.el (c-lineup-string-cont)
+       * progmodes/compile.el (compilation-directory-matcher)
+       * progmodes/ebnf2ps.el (ebnf-stop-on-error)
+       * progmodes/gdb-ui.el (gdb-many-windows)
+       * progmodes/vhdl-mode.el (vhdl-reset-active-high)
+       (vhdl-clock-rising-edge)
+       * textmodes/org.el (org-export-with-timestamps)
+       (org-export-remove-timestamps-from-toc, org-export-with-tags)
+       (org-read-date): Doc fix (Nil -> nil).
+
+2006-11-10  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * term/x-win.el (x-select-text, x-cut-buffer-or-selection-value):
+       Encode/decode text to/from cut buffers to/from iso-latin-1 only.
+
+2006-11-10  Juanma Barranquero  <lekktu@gmail.com>
+
+       * bs.el (bs--window-for-buffer): Remove.
+       (bs--show-with-configuration): Use `get-window-with-predicate'
+       instead of `bs--window-for-buffer'.
+
+2006-11-10  Kenichi Handa  <handa@m17n.org>
+
+       * files.el (revert-buffer): Fix previous change.
+
+2006-11-09  Juanma Barranquero  <lekktu@gmail.com>
+
+       * bs.el (bs--redisplay): Fix typo in docstring.
+       (bs--window-config-coming-from): Make frame-local.
+       (bs--restore-window-config): New function.
+       (bs-kill, bs-select, bs-select-other-window)
+       (bs-select-other-frame): Use it.
+       (bs--window-for-buffer): Return as soon as a matching buffer is found.
+       (bs--show-with-configuration): Save the window configuration as a
+       frame local var, and only if *buffer-selection* is not already
+       visible on this frame.
+
+2006-11-08  Chong Yidong  <cyd@stupidchicken.com>
+
+       * vc-svn.el (vc-svn-admin-directory): New var.
+       (vc-svn-registered, vc-svn-responsible-p)
+       (vc-svn-repository-hostname): Use it.
+       Suggested by arit93@yahoo.com.
+
+2006-11-08  Juanma Barranquero  <lekktu@gmail.com>
+
+       * ldefs-boot.el: Regenerate.
+
+2006-11-08  Alan Mackenzie  <acm@muc.de>
+
+       * emacs-lisp/lisp.el (beginning-of-defun-raw): Code up the
+       case (eq open-paren-in-column-0-is-defun-start nil) by searching
+       for least nested open-paren.
+
+2006-11-08  Romain Francoise  <romain@orebokech.com>
+
+       * subr.el (remove-overlays): Fix typo in last change.
+
+2006-11-08  Richard Stallman  <rms@gnu.org>
+
+       * subr.el (remove-overlays): Call overlay-recenter.
+
+2006-11-08  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
+
+       * printing.el (pr-alist-custom-set, pr-ps-utility-custom-set)
+       (pr-ps-name-custom-set, pr-txt-name-custom-set): Return back the old
+       behaviour.
+       (pr-menu-bind): Act on global-map instead of menu-bar-file-menu
+       directly.
+
+2006-11-08  Juanma Barranquero  <lekktu@gmail.com>
+
+       * ido.el (ido-ignore-extensions, ido-show-dot-for-dired)
+       (ido-max-dir-file-cache, ido-decorations)
+       (ido-rewrite-file-prompt-functions, ido-use-mycompletion-depth)
+       (ido-magic-backward-char, ido-enter-dired)
+       (ido-enter-insert-buffer, ido-enter-insert-file, ido-dired)
+       (ido-list-directory, ido-first-match, ido-only-match)
+       (ido-subdir, ido-indicator): Fix typos in docstrings.
+       (ido-buffer-internal, ido-completion-help): Fix typos in messages.
+       (ido-read-internal): Fix typo in error message.
+
+2006-11-08  Kenichi Handa  <handa@m17n.org>
+
+       * international/mule-cmds.el (set-default-coding-systems):
+       Always set default-file-name-coding-system to utf-8 for Mac Darwin.
+
+2006-11-08  Juanma Barranquero  <lekktu@gmail.com>
+
+       * makefile.w32-in (setwins): Remove.
+       (WINS_ALMOST): New macro.
+       (WINS): Use it.
+       (autoloads): Don't extract autoloads from files in obsolete/.
+
+2006-11-07  Chong Yidong  <cyd@stupidchicken.com>
+
+       * whitespace.el (whitespace-buffer): Call remove-overlays after
+       overlay-recenter for performance.  Suggested by Martin Rudalics.
+
+2006-11-07  Michael Albinus  <michael.albinus@gmx.de>
+
+       * net/tramp.el (tramp-default-method): scp is the default method.
+
+2006-11-07  Juanma Barranquero  <lekktu@gmail.com>
+
+       * server.el (server-start): Save also the Emacs pid in the server file.
+
+2006-11-07  Carsten Dominik  <dominik@science.uva.nl>
+
+       * textmodes/reftex-cite.el (reftex-pop-to-bibtex-entry): Preserve
+       point when displaying a bibtex cross reference in the echo area.
+
+2006-11-06  Juanma Barranquero  <lekktu@gmail.com>
+
+       * international/mule.el (make-char): Fix typo in docstring.
+       (load-with-code-conversion, charsetp): Doc fixes.
+
+       * international/ja-dic-cnv.el (skkdic-convert):
+       * cus-edit.el (hook): Fix typo in docstring.
+
+2006-11-06  Chong Yidong  <cyd@stupidchicken.com>
+
+       * cus-edit.el (custom-mode-map): Move defvar above code using it.
+       (custom-mode-link-map): New variable.
+       (custom-group-link, custom-manual): Use follow-link.
+
+2006-11-06  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
+
+       * textmodes/bibtex.el: Fix typo in name of author of bibtex.el,
+       "Mark Shapiro" -> "Marc Shapiro".  Update his email address.
+
+2006-11-06  Richard Stallman  <rms@gnu.org>
+
+       * textmodes/flyspell.el (flyspell-correct-word-before-point):
+       New function broken out of flyspell-correct-word.
+       (flyspell-mode-map): Bind it to M-RET.
+       (flyspell-correct-word): Call it.
+
+       * textmodes/fill.el (fill-minibuffer-function): New function.
+       (fill-paragraph): Bind fill-paragraph-function to
+       fill-minibuffer-function.
+
+       * ruler-mode.el (ruler-mode-map): Add bindings for up-events
+       so that they aren't undefined.
+
+       * dired.el (dired-readin): Locally bind file-name-coding-system.
+
+       * bindings.el: Shorten and clarify usual mode line mouse help string.
+
+       * Makefile.in (autoloads): Don't include `obsolete'.
+
+2006-11-06  Chong Yidong  <cyd@stupidchicken.com>
+
+       * printing.el (pr-alist-custom-set, pr-ps-utility-custom-set)
+       (pr-ps-name-custom-set, pr-txt-name-custom-set): Don't update the
+       Printing menu if it's not initialized.
+       (pr-menu-bind): Act on menu-bar-file-menu directly.
+
+2006-11-06  Juanma Barranquero  <lekktu@gmail.com>
+
+       * help.el (view-emacs-news): Fix typo in error message.
+
+       * menu-bar.el (menu-bar-update-buffers): Fix typo in menu entry.
+
+       * shadowfile.el (shadow-define-regexp-group)
+       (shadow-literal-groups, shadow-insert-var): Doc fixes.
+       (shadow-read-files): Fix typo in message.
+       (shadow-inhibit-overload, shadow-find, shadow-suffix)
+       (shadow-site-match, shadow-write-todo-file, shadow-insert-var)
+       (shadow-suffix, shadow-site-match, shadow-expand-file-name)
+       (shadow-file-match): Fix typos in docstrings.
+
+       * terminal.el (terminal-emulator): Fix typo in message.
+
+       * emacs-lisp/authors.el (authors-fixed-entries): Fix typo.
+
+       * emacs-lisp/lselect.el (x-kill-primary-selection)
+       (x-delete-primary-selection, x-copy-primary-selection):
+       Fix typos in error messages.
+
+       * emulation/edt-mapper.el: Fix typo in interactive message.
+
+       * mail/emacsbug.el (report-emacs-bug): Fix typos in output message.
+
+       * textmodes/ispell.el (ispell, ispell-local-dictionary-alist)
+       (ispell-help): Fix typos in docstrings.
+       (ispell-help): Fix typo in output message.
+
+       * allout.el (allout-adjust-file-variable)
+       (allout-passphrase-verifier-string)
+       (allout-passphrase-hint-string)
+       (allout-toggle-current-subtree-encryption):
+       * apropos.el (apropos-synonyms):
+       * cus-edit.el (hook):
+       * emacs-lock.el (emacs-lock-from-exiting):
+       * follow.el (follow-avoid-tail-recenter-p):
+       * hexl.el (hexl-mode):
+       * mouse-copy.el (mouse-copy-work-around-drag-bug):
+       * mouse.el (mouse-set-font):
+       * resume.el (resume-emacs-args-file):
+       * rfn-eshadow.el (file-name-shadow-tty-properties):
+       * t-mouse.el (t-mouse-process, t-mouse-mode):
+       * emacs-lisp/cust-print.el (custom-print-install)
+       (custom-print-uninstall, custom-format):
+       * emacs-lisp/shadow.el (list-load-path-shadows):
+       * emulation/tpu-edt.el (tpu-help-text)
+       (tpu-save-all-buffers-kill-emacs, tpu-emacs-replace)
+       (tpu-reset-control-keys):
+       * emulation/vip.el (vip-emacs-local-map)
+       (vip-change-mode-to-emacs):
+       * emulation/viper.el (viper-mode, viper-set-hooks)
+       (viper-major-mode-modifier-list):
+       * emulation/viper-init.el (viper-emacs-state-cursor-color):
+       * emulation/viper-keym.el (viper-emacs-kbd-map)
+       (viper-toggle-key):
+       * mail/feedmail.el (feedmail-queue-reminder)
+       (feedmail-queue-reminder-alist, feedmail-confirm-outgoing)
+       (feedmail-confirm-outgoing-timeout, feedmail-nuke-bcc)
+       (feedmail-nuke-resent-bcc, feedmail-fill-to-cc-fill-column)
+       (feedmail-sender-line, feedmail-force-binary-write)
+       (feedmail-from-line, feedmail-deduce-envelope-from)
+       (feedmail-x-mailer-line, feedmail-message-id-generator)
+       (feedmail-date-generator, feedmail-fiddle-plex-user-list)
+       (feedmail-enable-spray, feedmail-spray-this-address)
+       (feedmail-spray-address-fiddle-plex-list, feedmail-enable-queue)
+       (feedmail-queue-runner-confirm-global)
+       (feedmail-ask-before-queue-prompt)
+       (feedmail-ask-before-queue-reprompt)
+       (feedmail-prompt-before-queue-standard-alist)
+       (feedmail-prompt-before-queue-user-alist)
+       (feedmail-prompt-before-queue-help-supplement)
+       (feedmail-queue-use-send-time-for-message-id)
+       (feedmail-queue-default-file-slug, feedmail-queue-fqm-suffix)
+       (feedmail-mail-send-hook-splitter, feedmail-mail-send-hook)
+       (feedmail-mail-send-hook-queued)
+       (feedmail-confirm-addresses-hook-example)
+       (feedmail-last-chance-hook, feedmail-before-fcc-hook)
+       (feedmail-queue-runner-mode-setter)
+       (feedmail-queue-alternative-mail-header-separator)
+       (feedmail-queue-runner-message-sender)
+       (feedmail-buffer-eating-function, feedmail-binmail-template)
+       (feedmail-run-the-queue-no-prompts)
+       (feedmail-run-the-queue-global-prompt)
+       (feedmail-queue-subject-slug-maker, feedmail-fiddle-header)
+       (feedmail-envelope-deducer, feedmail-fiddle-date)
+       (feedmail-default-message-id-generator)
+       (feedmail-fiddle-message-id, feedmail-fiddle-x-mailer)
+       (feedmail-fiddle-spray-address, feedmail-deduce-address-list):
+       * mail/vms-pmail.el (vms-pmail-save-and-exit, vms-pmail-abort)
+       (vms-pmail-setup):
+       * play/dunnet.el (dun-help):
+       * play/handwrite.el (handwrite):
+       * play/hanoi.el (hanoi-unix-64):
+       * progmodes/idlwave.el (idlwave-rescan-asynchronously):
+       * textmodes/enriched.el (fixed):
+       * textmodes/org.el (org-file-apps)
+       (org-emphasis-regexp-components, org-emphasis-alist):
+       * textmodes/texinfmt.el (batch-texinfo-format):
+       Fix typos in docstrings.
+
+2006-11-05  Juanma Barranquero  <lekktu@gmail.com>
+
+       * loadhist.el (read-feature): Don't complete features not loaded
+       from a file (which make `unload-feature' to fail).
+
+2006-11-05  Reiner Steib  <Reiner.Steib@gmx.de>
+
+       * add-log.el (add-log-time-zone-rule): Mark as safe-local-variable.
+
+2006-11-05  Chong Yidong  <cyd@stupidchicken.com>
+
+       * startup.el (command-line-1): Kill emacs if the last frame is
+       deleted while evaluating the command-line arguments.
+
+2006-11-05  Richard Stallman  <rms@gnu.org>
+
+       * startup.el (init-file-had-error): Add doc string.
+       (fancy-splash-text, fancy-splash-head, fancy-splash-tail):
+       Use fixed-width font for keyboard key descriptions.
+
+       * cus-edit.el (custom-save-all): Error if saving in .emacs
+       and it had an error when loaded.
+
+       * dired-aux.el (dired-copy-file-recursive): Catch errors
+       from recursive copies in the loop, around the recursive call.
+
+2006-11-05  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac@lrde.org>
+
+       * battery.el (battery-linux-proc-acpi): Search an ac_adapter in
+       `/proc/acpi/ac_adapter/*'.  Ditto for the thermometers in
+       `/proc/acpi/thermal_zone/*'.
+       (battery-search-for-one-match-in-files): New.  Search a regexp in
+       the content of some files.
+
+2006-11-05  Martin Rudalics  <rudalics@gmx.at>
+
+       * window.el (mouse-autoselect-window-now): Remove variable.
+       (mouse-autoselect-window-state): New variable.
+       (mouse-autoselect-window-start, mouse-autoselect-window-cancel)
+       (mouse-autoselect-window-select, handle-select-window):
+       Rewritten to make mouse-autoselect-window-timer a one-shot timer.
+       Suspend delayed autoselection during menu or popup dialog.
+
+       * info-look.el (info-lookup-guess-custom-symbol): New function
+       for retrieving symbol at point in custom buffers.
+       (top level) <info-lookup-maybe-add-help>: Add backquote and
+       comma to ignored characters in regexps of help specifications
+       for emacs-lisp-mode and lisp-interaction-mode.  This permits
+       looking up symbols in `...' and after a comma.  Add help
+       specifications for custom-mode and help-mode.
+
+2006-11-04  Eli Zaretskii  <eliz@gnu.org>
+
+       * mail/rmail.el (rmail-redecode-body): New optional argument RAW.
+       Don't encode body if RAW is non-nil, or if the old encoding is
+       identical to the new encoding, or if the body contains only
+       eight-bit-* characters.
+
+2006-11-04  Yoni Rabkin Katzenell  <yoni-r@actcom.com>  (tiny change)
+
+       * faces.el (faces-sample-overlay, describe-face): Revert last changes.
+       (faces-sample-overlay): Remove variable.
+       (describe-face): Insert sample text in the face being described.
+
+2006-11-04  Martin Rudalics  <rudalics@gmx.at>
+
+       * whitespace.el (whitespace-indent-regexp): Make this match any
+       multiples of eight spaces near the beginning of a line.
+       (whitespace-buffer): Use `remove-overlays' instead of
+       `whitespace-unhighlight-the-space' and `overlay-recenter' to
+       speed up overlay handling.
+       (whitespace-buffer-leading, whitespace-buffer-trailing):
+       Make these functions highlight the text removed by
+       `whitespace-buffer-leading-cleanup' and
+       `whitespace-buffer-trailing-cleanup' respectively.
+       (whitespace-buffer-search): Use `with-local-quit'.
+       Move `format' out of loop to speed up scanning larger buffers.
+       (whitespace-unhighlight-the-space): Remove `remove-hook' since
+       that function is never added to a hook.
+       (whitespace-spacetab-regexp, whitespace-ateol-regexp)
+       (whitespace-buffer-leading-cleanup)
+       (whitespace-refresh-rescan-list): Fix docstrings.
+
+2006-11-03  Ken Manheimer  <ken.manheimer@gmail.com>
+
+       * allout.el (allout-during-yank-processing): Cue for inhibiting
+       aberrance processing during yanks.
+       (allout-doublecheck-at-and-shallower): Reduce the limit to reduce
+       the amount of yanked topics that can be aberrant.
+       (allout-do-doublecheck): Encapsulate this multiply-used recipe in
+       a function, and supplement with inihibition of doublechecking
+       during yanks.
+       (allout-beginning-of-line, allout-next-heading)
+       (allout-previous-heading, allout-goto-prefix-doublechecked)
+       (allout-back-to-current-heading, allout-next-visible-heading)
+       (allout-next-sibling): Use new allout-do-doublecheck function.
+       (allout-next-sibling): Ensure we made progress when returning
+       other than nil.
+       (allout-rebullet-heading): Preserve text property annotations
+       indicating the text was hidden, if it was.
+       (allout-kill-line): Remove any added was-hidden annotations.
+       (allout-kill-topic): Remove any added was-hidden annotations.
+       (allout-annotate-hidden): Inhibit adding was-hidden text
+       properties to the undo list.
+       (allout-deannotate-hidden): New function to remove was-hidden
+       annotation.
+       (allout-hide-by-annotation): Use new allout-deannotate-hidden.
+       (allout-remove-exposure-annotation): Replace by
+       allout-deannotate-hidden.
+       (allout-yank-processing): Signal that yank processing is happening
+       with allout-during-yank-processing.  Also, wrap
+       allout-unprotected's closer to the text changes, for easier
+       debugging.  We need to inhibit-field-text-motion explicitly, in
+       lieu of the encompassing allout-unprotected.
+       (outlineify-sticky): Adjust criteria for triggering new outline
+       decorations to presence or absence of any topics, not just a topic
+       at the beginning of the buffer.
+
+2006-11-03  Juanma Barranquero  <lekktu@gmail.com>
+
+       * bs.el (bs--show-all, bs--redisplay):
+       * cus-edit.el (custom-unlispify-menu-entries)
+       (custom-unlispify-tag-names, custom-prompt-variable):
+       * expand.el (expand-pos):
+       * speedbar.el (speedbar-generic-list-tag-p):
+       * wid-edit.el (widget-image-enable):
+       * emacs-lisp/checkdoc.el (checkdoc-rogue-space-check-engine):
+       * emacs-lisp/find-func.el (find-function-noselect)
+       (find-function, find-variable-noselect, find-variable)
+       (find-definition-noselect, find-face-definition):
+       * mail/rmail-spam-filter.el (rsf-scanning-messages-now):
+       * net/eudc-vars.el (eudc-expansion-overwrites-query):
+       * progmodes/ada-xref.el (ada-find-in-ali):
+       * textmodes/flyspell.el (flyspell-check-tex-math-command):
+       * textmodes/org.el (org-copy-subtree):
+       * textmodes/table.el (table--row-column-insertion-point-p):
+       Use "non-nil" in docstrings.
+
+2006-11-03  Mark Davies  <mark@mcs.vuw.ac.nz>
+
+       * sort.el (sort-columns): Set the field separator to tab; on
+       NetBSD, sort complains if "\n" is used as field separator.
+
+2006-11-03  NIIMI Satoshi  <sa2c@sa2c.net>
+
+       * emacs-lisp/pp.el (pp-eval-last-sexp): Evaluate target sexp.
+
+2006-11-02  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * server.el (server-auth-key): Remove.  Replace by a process-property.
+       (server-start): Don't remove the file of the previous process, but
+       instead clear out the place for the new file.
+       (server-start): Set the :auth-key property.
+       (server-process-filter): Use the :auth-key property.
+
+2006-11-02  Carsten Dominik  <dominik@science.uva.nl>
+
+       * textmodes/org.el (org-mode-map): No longer copy
+       `outline-mode-map' explicitly - this is already done by
+       `define-derived-mode'.
+
+2006-11-02  Juanma Barranquero  <lekktu@gmail.com>
+
+       * server.el (server-visit-files): Use `when'.
+       (server-process-filter): When authentication fails, send error
+       message to client.  Wrap `process-send-region' in `ignore-errors'
+       instead of `condition-case', and remove misleading comment.
+
+2006-11-01  Juri Linkov  <juri@jurta.org>
+
+       * simple.el (yank): Doc fix.
+
+2006-11-01  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * server.el: Try and fit within 80 columns.
+       (server-start): Make the auth file unreadable by other users.
+
+2006-10-31  Andreas Seltenreich  <uwi7@rz.uni-karlsruhe.de>
+
+       * battery.el (battery-linux-proc-acpi): Prevent range error when
+       `full-capacity' is 0.
+
+2006-10-31  Yoni Rabkin Katzenell  <yoni-r@actcom.com>  (tiny change)
+
+       * faces.el (faces-sample-overlay): New defvar.
+       (faces-sample-overlay): New function to show face sample text.
+       (describe-face): Use it.
+
+2006-10-31  Stephen Leake  <stephen_leake@stephe-leake.org>
+
+       * progmodes/ada-stmt.el: Change maintainer, apply
+       whitespace-cleanup, checkdoc.
+       (ada-func-or-proc-name): Add doc string.
+
+       * progmodes/ada-prj.el (ada-prj-new): Change maintainer, apply
+       whitespace-cleanup, checkdoc.  Minor improvements to many doc
+       strings and comments.
+       (ada-prj-display-page): Change buffer name to more accurately
+       reflect function.
+
+       * progmodes/ada-xref.el: Change maintainer, apply
+       whitespace-cleanup, checkdoc.  Minor improvements to many doc
+       strings and comments.  Don't look for `gvd' or `ddd' debuggers.
+       (ada-compile-current): Don't add newlines to commands.
+
+2006-10-31  Juanma Barranquero  <lekktu@gmail.com>
+
+       * server.el: Add support for TCP sockets.
+       (server-use-tcp, server-host, server-auth-dir): New options.
+       (server-auth-key): New variable.
+       (server-ensure-safe-dir): Create nonexistent parent dirs.
+       Ignore Unix-style file modes on Windows.
+       (server-start): Crete a TCP or Unix socket according to the value
+       of `server-use-tcp'.  For TCP sockets, create the id/auth file in
+       `server-auth-dir' directory.
+       (server-process-filter): Delete process if authentication
+       fails (which never happens for Unix sockets).
+
+2006-10-30  David Kastrup  <dak@gnu.org>
+
+       * subr.el (add-to-list): Don't continue checking if a match has
+       been found.
+
+2006-10-30  Chong Yidong  <cyd@stupidchicken.com>
+
+       * tutorial.el: Move defvars to avoid bytecomp warnings.
+       (tutorial--find-changed-keys): Check if viper-current-state is
+       bound before using it.
+       (help-with-tutorial): Check if viper-tutorial is defined before
+       using it.
+
+2006-10-30  Lennart Borgman  <lennart.borgman.073@student.lu.se>
+
+       * help-fns.el (help-with-tutorial): Move to tutorial.el.
+
+       * tutorial.el: New file.
+       (help-with-tutorial): Move here from help-fns.el. Added help for
+       rebound keys.  Fixed resume of tutorial.
+       (tutorial--describe-nonstandard-key, tutorial--sort-keys)
+       (tutorial--find-changed-keys, tutorial--display-changes)
+       (tutorial--saved-dir, tutorial--saved-file)
+       (tutorial--save-tutorial): New functions to support the changes in
+       help-with-tutorial.
+
+2006-10-30  Kenichi Handa  <handa@m17n.org>
+
+       * files.el (revert-buffer): If a unibyte buffer is being reverted
+       with a coding system for multibyte, set buffer multibyte before
+       calling insert-file-contents.
+
+2006-10-30  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * server.el (server-select-display): Use a dummy buffer to detect when
+       the frame is later used.
+       (server-select-display): New function.
+       (server-process-filter): Use it to detect unused temp frames.
+
+2006-10-29  Stephen Leake  <stephen_leake@stephe-leake.org>
 
        * progmodes/ada-mode.el: Change maintainer, apply
-       whitespace-clean, checkdoc.  Minor improvements to many doc
-       strings.
+       whitespace-clean, checkdoc.  Minor improvements to many doc strings.
        (ada-mode-version): New function.
        (ada-create-menu): Menu operations are available for all supported
        compilers.
 
 2006-10-29  Lars Hansen  <larsh@soem.dk>
-       * net/tramp.el (with-parsed-tramp-file-name): Correct debug
-       spec.  Highlight as keyword.
+
+       * net/tramp.el (with-parsed-tramp-file-name): Correct debug spec.
+       Highlight as keyword.
        (tramp-do-copy-or-rename-file): Correct data for 'file-already-exists.
        Don't call tramp-method-out-of-band-p for local files.
        (tramp-touch): Quote file name.
 
        * calendar/calendar.el (cal-html-cursor-month)
        (cal-html-cursor-year): Add autoloads for this new package.
-       (calendar-mode-map): Bind cal-html-cursor-month,
-       cal-html-cursor-year.
+       (calendar-mode-map): Bind cal-html-cursor-month, cal-html-cursor-year.
 
-2006-10-28  Anna Bigatti  <bigatti@dima.unige.it>
+2006-10-28  Anna M. Bigatti  <bigatti@dima.unige.it>
 
        * calendar/cal-html.el: New file.
 
        * midnight.el (midnight-buffer-display-time): Doc fix.
        (clean-buffer-list-kill-never-buffer-names): Add "*server*".
 
-2006-10-22  martin rudalics  <rudalics@gmx.at>
+2006-10-23  Michael Kifer  <kifer@cs.stonybrook.edu>
+
+       * viper-cmd.el (viper-prefix-arg-com): Define gg as G0.
+
+       * viper-ex.el (ex-read): Quote file argument.
+
+       * ediff-diff.el (ediff-same-file-contents): Expand file names.
+
+       * ediff-mult.el (ediff-append-custom-diff): Quote shell file arguments.
+
+2006-10-22  Martin Rudalics  <rudalics@gmx.at>
 
        * textmodes/flyspell.el (flyspell-check-region-doublons):
        Fix last fix.
        event to unread-command-events as (t . EVENT) so it will be added
        to this-command-keys by read-key-sequence.
 
-2006-10-22  martin rudalics  <rudalics@gmx.at>
+2006-10-22  Martin Rudalics  <rudalics@gmx.at>
 
        * textmodes/flyspell.el (flyspell-word): Skip past all previous
        whitespace when checking doublons.
        * progmodes/cperl-mode.el (cperl-after-expr-p): Don't move point
        to nil if there is no previous property change.
 
-2006-09-26  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac@lrde.org>
+2006-09-29  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac@lrde.org>
 
        * cus-edit.el (custom-save-all): Switch to emacs-lisp mode before
        saving anything to be sure that `forward-sexp' behaves correctly.
        * select.el (xselect-convert-to-string): If UTF8_STRING is requested
        and the data doesn't look like UTF8, send STRING instead.
 
-2006-09-16  Agustin Martin <agustin.martin@hispalinux.es>
+2006-09-16  Agust\e,Am\e(Bn Mart\e,Am\e(Bn  <agustin.martin@hispalinux.es>
 
        * textmodes/flyspell.el (flyspell-check-region-doublons):
        New function to detect duplicated words.
        (allout-mode): Make allout-old-style-prefixes (ie, enabling use with
        outline.el outlines) functional again.  Change the primary bullet
        along with the header-lead - level 1 new-style bullets now work.
-       Engage allout-before-change-handler in mainline emacs, not just
-       xemacs, to do undo handling.
+       Engage allout-before-change-handler in mainline Emacs, not just
+       XEmacs, to do undo handling.
        (allout-before-change-handler): Expose undo changes occurring in
        hidden regions.  Use allout-get-invisibility-overlay instead of
        reimplementing it inline.
 
        * dired.el (dired-log-summary): Add doc string.
 
-       * cus-edit.el (custom-menu-create): Bind deactivate-mark here
+       * 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>
 
        * net/ldap.el (ldap-search-internal): Handle `auth' key.
 
-2006-09-07  Magnus Henoch <mange@freemail.hu>
+2006-09-07  Magnus Henoch  <mange@freemail.hu>
 
        * net/rcirc.el (rcirc-activity-string): Don't quote value in case
        clause.
 
        * replace.el (replace-match-string-symbols): Handle dotted lists.
 
-2006-07-24  mathias  <mathias@mattis>
+2006-07-24  Mathias Dahl  <mathias.dahl@gmail.com>
 
        * tumme.el (tumme-write-tags): Add.
        (tumme-write-comments): Add.
        (tumme-display-previous-thumbnail-original): Remove empty line.
        (tumme-widget-list): Add punctuation.
 
-2006-07-24  mathias  <mathias.dahl@gmail.com>
+2006-07-24  Mathias Dahl  <mathias.dahl@gmail.com>
 
        * tumme.el (tumme-line-up): Add an extra check for end of buffer.
 
        (defcustom, defface, defgroup): Replace reference to Customization
        chapter in manual with hyperlink.
 
-       * cus-edit.el (customize-package-emacs-version-alist):
-       New variable.
+       * cus-edit.el (customize-package-emacs-version-alist): New variable.
        (customize-changed-options): Add check for custom-package-version.
        (customize-package-emacs-version): New function to look up Emacs
        version corresponding to the given package version.
        * files.el (hack-local-variables-confirm) <offer-save>:
        Clarify message text.  Suggested by Ralf Angeli.
 
-2006-04-08  Michael Cadilhac  <michael.cadilhac@lrde.org>
+2006-04-08  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac@lrde.org>
 
        * rect.el (kill-rectangle): Don't barf if `kill-read-only-ok' is set.
        (delete-extract-rectangle-line): Use `filter-buffer-substring'
        (find-variable-other-frame, find-variable-at-point):
        Fix docstrings.
 
-2006-01-21  Francesco Potorti`  <pot@gnu.org>
+2006-01-21  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * mail/rmailout.el (rmail-output): Don't use content-type if it is nil.
 
        Add fset of allout-real-isearch-abort during compile to fix
        byte-compilation warnings.
        (allout-mode-p): Move definition of this macro above all uses, or
-       byte compilation in barren emacs (eg, during emacs build) will
+       byte compilation in barren Emacs (eg, during Emacs build) will
        lack the definition.
        (allout-mode): Move this variable above any uses, or byte
        compilation will fail.
        since the last ping.
        (rcirc-mode): Give rcirc-topic a local binding here.
 
-2005-11-19  Michael Cadilhac  <michael.cadilhac@lrde.org>
+2005-11-19  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac@lrde.org>
 
        * subr.el (read-passwd): Fontify the prompt as we do with other
        prompts.
 
 2005-11-02  Mark A. Hershberger  <mah@everybody.org>
 
-       * xml.el (xml-syntax-table): Allow xml.el to compile in xemacs.
+       * xml.el (xml-syntax-table): Allow xml.el to compile in XEmacs.
        (xml-parse-tag): Join strings separated by a comment properly.
 
 2005-11-02  Andreas Schwab  <schwab@suse.de>
 
        * dired-x.el (dired-virtual): Don't use `dired-insert-headerline'.
 
-2005-10-25  Michael Cadilhac  <michael.cadilhac-@t-lrde.epita.fr>
+2005-10-25  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac-@t-lrde.epita.fr>
 
        * play/blackbox.el (blackbox-redefine-key): New function.
        (blackbox-mode-map): Use it to remap existing bindings for cursor
        * progmodes/gdb-ui.el (gdb-fringe-width -> gdb-buffer-fringe-width):
        Typo.
 
-2005-10-06  Michael Cadilhac  <michael.cadilhac-@t-lrde.epita.fr>
+2005-10-06  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac-@t-lrde.epita.fr>
 
        * play/zone.el (zone): Wrap body with save-window-excursion.
 
 
        * mail/sendmail.el (default-sendmail-coding-system): Doc fix.
 
-2005-09-09  Emilio Lopes  <eclig@gmx.net>
+2005-09-09  Emilio C. Lopes  <eclig@gmx.net>
 
        * woman.el: Format- and whitespace-related changes.
 
 2005-07-21  Kim F. Storm  <storm@cua.dk>
 
        * mail/emacsbug.el (report-emacs-bug): Request that backtraces are
-       included when reporting an emacs crash, and tell about the DEBUG file.
+       included when reporting an Emacs crash, and tell about the DEBUG file.
 
        * image-file.el (insert-image-file): Add yank-handler.
        (image-file-yank-handler): Yank handler to make unique copies of
        * server.el: Bind "C-x #" in a way that works even if C-x is
        redefined to a command key, not a prefix key.
 
-2005-07-16  Johan Bockgard  <bojohan@users.sourceforge.net>  (tiny change)
+2005-07-16  Johan Bockg\e,Ae\e(Brd  <bojohan@users.sourceforge.net>  (tiny change)
 
        * emacs-lisp/cl-macs.el (cl-make-type-test): Defer evaluation of
        cl-make-type-test till execution time.
        * dired-x.el (dired-do-relsymlink-regexp): Add missing optional
        arg ARG and use it.
 
-2005-07-16  Johan Bockgard  <bojohan@users.sourceforge.net>  (tiny change)
+2005-07-16  Johan Bockg\e,Ae\e(Brd  <bojohan@users.sourceforge.net>  (tiny change)
 
        * emacs-lisp/cl-macs.el (cl-make-type-test): Add `atom' type.
 
 2005-07-06  Richard M. Stallman  <rms@gnu.org>
 
        * progmodes/flymake.el (flymake-float-time): Instead of
-       with-no-warnings, test for xemacs.
+       with-no-warnings, test for XEmacs.
        (flymake-replace-regexp-in-string): Test fboundp of replace-in-string
        to avoid warning.
 
 
        * emacs-lisp/lisp.el (buffer-end): Doc fix.
 
-2005-02-05  Arne_J\e,Ax\e(Brgensen  <arne@arnested.dk>  (tiny change)
+2005-02-05  Arne J\e,Ax\e(Brgensen  <arne@arnested.dk>  (tiny change)
 
        * net/ldap.el (ldap-search-internal): Support attributes with
        optional descriptions separated by a semi-colon, as in
        (calc-edit-macro-finish-edit): New functions.
        (calc-user-define-edit): Use new functions to edit named calc macros.
 
-2005-01-01  Stefan  <monnier@iro.umontreal.ca>
+2005-01-01  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * files.el (hack-local-variables): Cleanup prefix/suffix matching.
 
@@ -28386,6 +29692,7 @@ See ChangeLog.11 for earlier changes.
 
 ;; Local Variables:
 ;; coding: iso-2022-7bit
+;; add-log-time-zone-rule: t
 ;; End:
 
     Copyright (C) 2005, 2006 Free Software Foundation, Inc.
index 90604fc..af6d2f0 100644 (file)
        * dbx.el (run-dbx): Set dbx-process.
        (dbx-stop-at): Use that to decide where to send the string.
 
-1989-02-13  Marc Shapiro  (shapiro@sor.inria.fr)
+1989-02-13  Marc Shapiro  (marc.shapiro@acm.org)
 
        * bibtex.el (bibtex-clean-entry, bibtex-empty-field, bibtex-find-text,
        bibtex-kill-optional-field, bibtex-next-field, bibtex-pop-next,
index f6caedc..f6bb1c8 100644 (file)
@@ -74,6 +74,8 @@ setwins=subdirs=`(cd $$wd; find . -type d -print)`; \
           esac; \
         done
 
+# Find all subdirectories except `obsolete'.
+
 setwins_almost=subdirs=`(cd $$wd; find . -type d -print)`; \
        for file in $$subdirs; do \
           case $$file in */Old | */RCS | */CVS | */CVS/* | */.* | */.*/* | */=* | */obsolete | */term ) ;; \
@@ -106,7 +108,7 @@ $(lisp)/loaddefs.el:
        echo ";; End:" >> $@
        echo ";;; loaddefs.el ends here" >> $@
 autoloads: $(lisp)/loaddefs.el doit
-       wd=$(lisp); $(setwins); \
+       wd=$(lisp); $(setwins_almost); \
        echo Directories: $$wins; \
        $(EMACS) $(EMACSOPT) -l autoload --eval '(setq generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads $$wins
 
index d60f920..a1208d5 100644 (file)
@@ -293,6 +293,8 @@ Note: The search is conducted only within 10%, at the beginning of the file."
 It takes the same format as the TZ argument of `set-time-zone-rule'.
 If nil, use local time.
 If t, use universal time.")
+(put 'add-log-time-zone-rule 'safe-local-variable
+     '(lambda (x) (or (booleanp x) (stringp x))))
 
 (defun add-log-iso8601-time-zone (&optional time)
   (let* ((utc-offset (or (car (current-time-zone time)) 0))
index b38d38d..74d87a0 100644 (file)
@@ -66,7 +66,7 @@
 ;;
 ;; The outline menubar additions provide quick reference to many of
 ;; the features, and see the docstring of the variable `allout-init'
-;; for instructions on priming your emacs session for automatic
+;; for instructions on priming your Emacs session for automatic
 ;; activation of allout-mode.
 ;;
 ;; See the docstring of the variables `allout-layout' and
@@ -891,12 +891,12 @@ This is properly set by `set-allout-regexp'.")
 (make-variable-buffer-local 'allout-plain-bullets-string-len)
 
 ;;;_   = allout-doublecheck-at-and-shallower
-(defconst allout-doublecheck-at-and-shallower 3
-  "Verify apparent topics of this depth and shallower as being non-aberrant.
+(defconst allout-doublecheck-at-and-shallower 2
+  "Validate apparent topics of this depth and shallower as being non-aberrant.
 
 Verified with `allout-aberrant-container-p'.  This check's usefulness is
-limited to shallow prospects, because the determination of aberrance
-depends on the mistaken item being followed by a legitimate item of
+limited to shallow depths, because the determination of aberrance
+is according to the mistaken item being followed by a legitimate item of
 excessively greater depth.")
 ;;;_   X allout-reset-header-lead (header-lead)
 (defun allout-reset-header-lead (header-lead)
@@ -1380,7 +1380,7 @@ are random binary characters to avoid exposing greater susceptibility to
 search attacks.
 
 The verifier string is retained as an Emacs file variable, as well as in
-the emacs buffer state, if file variable adjustments are enabled.  See
+the Emacs buffer state, if file variable adjustments are enabled.  See
 `allout-enable-file-variable-adjustment' for details about that.")
 (make-variable-buffer-local 'allout-passphrase-verifier-string)
 ;;;###autoload
@@ -1392,7 +1392,7 @@ the emacs buffer state, if file variable adjustments are enabled.  See
 See the description of `allout-passphrase-hint-handling' for details about how
 the reminder is deployed.
 
-The hint is retained as an Emacs file variable, as well as in the emacs buffer
+The hint is retained as an Emacs file variable, as well as in the Emacs buffer
 state, if file variable adjustments are enabled.  See
 `allout-enable-file-variable-adjustment' for details about that.")
 (make-variable-buffer-local 'allout-passphrase-hint-string)
@@ -1506,6 +1506,18 @@ and the place for the cursor after the decryption is done."
     (goto-char (cadr allout-after-save-decrypt))
     (setq allout-after-save-decrypt nil))
   )
+;;;_   = allout-inhibit-aberrance-doublecheck nil
+;; In some exceptional moments, disparate topic depths need to be allowed
+;; momentarily, eg when one topic is being yanked into another and they're
+;; about to be reconciled.  let-binding allout-inhibit-aberrance-doublecheck
+;; prevents the aberrance doublecheck to allow, eg, the reconciliation
+;; processing to happen in the presence of such discrepancies.  It should
+;; almost never be needed, however.
+(defvar allout-inhibit-aberrance-doublecheck nil
+  "Internal state, for momentarily inhibits aberrance doublecheck.
+
+This should only be momentarily let-bound non-nil, not set
+non-nil in a lasting way.")
 
 ;;;_ #2 Mode activation
 ;;;_  = allout-explicitly-deactivated
@@ -2194,27 +2206,16 @@ to return the current depth of the most recently matched topic."
 
 ;;;_  - Position Assessment
 ;;;_   : Location Predicates
-;;;_    > allout-on-current-heading-p ()
-(defun allout-on-current-heading-p ()
-  "Return non-nil if point is on current visible topics' header line.
-
-Actually, returns prefix beginning point."
-  (save-excursion
-    (allout-beginning-of-current-line)
-    (and (looking-at allout-regexp)
-         (allout-prefix-data)
-         (or (> allout-recent-depth allout-doublecheck-at-and-shallower)
-             (not (allout-aberrant-container-p))))))
-;;;_    > allout-on-heading-p ()
-(defalias 'allout-on-heading-p 'allout-on-current-heading-p)
-;;;_    > allout-e-o-prefix-p ()
-(defun allout-e-o-prefix-p ()
-  "True if point is located where current topic prefix ends, heading begins."
-  (and (save-excursion (let ((inhibit-field-text-motion t))
-                         (beginning-of-line))
-                      (looking-at allout-regexp))
-       (= (point)(save-excursion (allout-end-of-prefix)(point)))))
-;;;_    > allout-aberrant-container-p ()
+;;;_    > allout-do-doublecheck ()
+(defsubst allout-do-doublecheck ()
+  "True if current item conditions qualify for checking on topic aberrance."
+  (and
+   ;; presume integrity of outline and yanked content during yank - necessary,
+   ;; to allow for level disparity of yank location and yanked text:
+   (not allout-inhibit-aberrance-doublecheck)
+   ;; allout-doublecheck-at-and-shallower is ceiling for doublecheck:
+   (<= allout-recent-depth allout-doublecheck-at-and-shallower)))
+;;;_     > allout-aberrant-container-p ()
 (defun allout-aberrant-container-p ()
   "True if topic, or next sibling with children, contains them discontinuously.
 
@@ -2247,7 +2248,7 @@ exceeds the topic by more than one."
         (goto-char allout-recent-prefix-beginning)
         (cond
          ;; sibling - continue:
-         ((eq allout-recent-depth depth)) 
+         ((eq allout-recent-depth depth))
          ;; first offspring is excessive - aberrant:
          ((> allout-recent-depth (1+ depth))
           (setq done t aberrant t))
@@ -2259,6 +2260,26 @@ exceeds the topic by more than one."
       ;; recalibrate allout-recent-*
       (allout-depth)
       nil)))
+;;;_    > allout-on-current-heading-p ()
+(defun allout-on-current-heading-p ()
+  "Return non-nil if point is on current visible topics' header line.
+
+Actually, returns prefix beginning point."
+  (save-excursion
+    (allout-beginning-of-current-line)
+    (and (looking-at allout-regexp)
+         (allout-prefix-data)
+         (or (not (allout-do-doublecheck))
+             (not (allout-aberrant-container-p))))))
+;;;_    > allout-on-heading-p ()
+(defalias 'allout-on-heading-p 'allout-on-current-heading-p)
+;;;_    > allout-e-o-prefix-p ()
+(defun allout-e-o-prefix-p ()
+  "True if point is located where current topic prefix ends, heading begins."
+  (and (save-excursion (let ((inhibit-field-text-motion t))
+                         (beginning-of-line))
+                      (looking-at allout-regexp))
+       (= (point)(save-excursion (allout-end-of-prefix)(point)))))
 ;;;_   : Location attributes
 ;;;_    > allout-depth ()
 (defun allout-depth ()
@@ -2390,8 +2411,7 @@ Outermost is first."
     (allout-depth)
     (let ((beginning-of-body
            (save-excursion
-             (while (and (<= allout-recent-depth
-                             allout-doublecheck-at-and-shallower)
+             (while (and (allout-do-doublecheck)
                          (allout-aberrant-container-p)
                          (allout-previous-visible-heading 1)))
              (allout-beginning-of-current-entry)
@@ -2443,7 +2463,7 @@ We skip anomolous low-level topics, a la `allout-aberrant-container-p'."
 
   (when (re-search-forward allout-line-boundary-regexp nil 0)
     (allout-prefix-data)
-    (and (<= allout-recent-depth allout-doublecheck-at-and-shallower)
+    (and (allout-do-doublecheck)
          ;; this will set allout-recent-* on the first non-aberrant topic,
          ;; whether it's the current one or one that disqualifies it:
          (allout-aberrant-container-p))
@@ -2464,13 +2484,13 @@ We skip anomolous low-level topics, a la `allout-aberrant-container-p'."
 
   (if (bobp)
       nil
-    ;; allout-goto-prefix-doublechecked calls us, so we can't use it here.
     (let ((start-point (point)))
+      ;; allout-goto-prefix-doublechecked calls us, so we can't use it here.
       (allout-goto-prefix)
       (when (or (re-search-backward allout-line-boundary-regexp nil 0)
                 (looking-at allout-bob-regexp))
         (goto-char (allout-prefix-data))
-        (if (and (<= allout-recent-depth allout-doublecheck-at-and-shallower)
+        (if (and (allout-do-doublecheck)
                  (allout-aberrant-container-p))
             (or (allout-previous-heading)
                 (and (goto-char start-point)
@@ -2705,11 +2725,11 @@ Like `allout-goto-prefix', but shallow topics \(according to
 `allout-doublecheck-at-and-shallower') are checked and
 disqualified for child containment discontinuity, according to
 `allout-aberrant-container-p'."
-  (allout-goto-prefix)
-  (if (and (<= allout-recent-depth allout-doublecheck-at-and-shallower)
-           (allout-aberrant-container-p))
-      (allout-previous-heading)
-    (point)))
+  (if (allout-goto-prefix)
+      (if (and (allout-do-doublecheck)
+               (allout-aberrant-container-p))
+          (allout-previous-heading)
+        (point))))
 
 ;;;_   > allout-end-of-prefix ()
 (defun allout-end-of-prefix (&optional ignore-decorations)
@@ -2745,13 +2765,13 @@ of (before any) topics, in which case we return nil."
 
   (allout-beginning-of-current-line)
   (let ((bol-point (point)))
-    (allout-goto-prefix-doublechecked)
-    (if (<= (point) bol-point)
-        (if (interactive-p)
-            (allout-end-of-prefix)
-          (point))
-      (goto-char (point-min))
-      nil)))
+    (if (allout-goto-prefix-doublechecked)
+        (if (<= (point) bol-point)
+            (if (interactive-p)
+                (allout-end-of-prefix)
+              (point))
+          (goto-char (point-min))
+          nil))))
 ;;;_   > allout-back-to-heading ()
 (defalias 'allout-back-to-heading 'allout-back-to-current-heading)
 ;;;_   > allout-pre-next-prefix ()
@@ -2871,7 +2891,15 @@ collapsed."
   "Ascend one level, returning t if successful, nil if not."
   (prog1
       (if (allout-beginning-of-level)
-          (allout-previous-heading))
+          (let ((bolevel (point))
+                (bolevel-depth allout-recent-depth))
+            (allout-previous-heading)
+            (if (< allout-recent-depth bolevel-depth)
+                allout-recent-depth
+              ;; some topic after file's first is at lower depth than first:
+              (goto-char bolevel)
+              (allout-depth)
+              nil)))
     (if (interactive-p) (allout-end-of-prefix))))
 ;;;_   > allout-descend-to-depth (depth)
 (defun allout-descend-to-depth (depth)
@@ -2918,6 +2946,7 @@ Return the start point of the new topic if successful, nil otherwise."
       nil
     (let ((target-depth (or depth (allout-depth)))
           (start-point (point))
+          (start-prefix-beginning allout-recent-prefix-beginning)
           (count 0)
           leaping
          last-depth)
@@ -2941,7 +2970,9 @@ Return the start point of the new topic if successful, nil otherwise."
                    nil)))
             ((and (not (eobp))
                   (and (> (or last-depth (allout-depth)) 0)
-                       (= allout-recent-depth target-depth)))
+                       (= allout-recent-depth target-depth))
+                  (not (= start-prefix-beginning
+                          allout-recent-prefix-beginning)))
              allout-recent-prefix-beginning)
             (t
              (goto-char start-point)
@@ -3067,8 +3098,7 @@ Move to buffer limit in indicated direction if headings are exhausted."
                   ;; not a header line, keep looking:
                   t
                 (allout-prefix-data)
-                (if (and (<= allout-recent-depth
-                             allout-doublecheck-at-and-shallower)
+                (if (and (allout-do-doublecheck)
                          (allout-aberrant-container-p))
                     ;; skip this aberrant prospective header line:
                     t
@@ -3480,8 +3510,6 @@ case.)
 
 If OFFER-RECENT-BULLET is true, offer to use the bullet of the prior sibling.
 
-Runs 
-
 Nuances:
 
 - Creation of new topics is with respect to the visible topic
@@ -3828,6 +3856,7 @@ this function."
          (mb allout-recent-prefix-beginning)
          (me allout-recent-prefix-end)
          (current-bullet (buffer-substring-no-properties (- me 1) me))
+         (has-annotation (get-text-property mb 'allout-was-hidden))
          (new-prefix (allout-make-topic-prefix current-bullet
                                                 nil
                                                 new-depth
@@ -3854,6 +3883,11 @@ this function."
          (allout-unprotected
           (delete-region (match-beginning 0)(match-end 0))))
 
+      ;; convey 'allout-was-hidden annotation, if original had it:
+      (if has-annotation
+          (put-text-property 0 (length new-prefix) 'allout-was-hidden t
+                             new-prefix))
+
                                        ; Put in new prefix:
       (allout-unprotected (insert new-prefix))
 
@@ -4117,7 +4151,10 @@ the file can be adjusted to any positive depth, however."
                      (> (1+ current-depth)
                         (1+ predecessor-depth)))
                 (error (concat "Disallowed shift deeper than"
-                               " containing topic's children."))))))
+                               " containing topic's children."))
+              (allout-back-to-current-heading)
+              (if (< allout-recent-depth (1+ current-depth))
+                  (allout-show-children))))))
     (let ((where (point)))
       (allout-rebullet-topic 1 (and (> arg 1) 'sans-offspring))
       (run-hook-with-args 'allout-structure-shifted-hook arg where))))
@@ -4183,10 +4220,11 @@ subtopics into siblings of the item."
            (depth (allout-depth)))
 
       (allout-annotate-hidden beg end)
-
       (if (and (not beg-hidden) (not end-hidden))
           (allout-unprotected (kill-line arg))
         (kill-line arg))
+      (allout-deannotate-hidden beg end)
+
       (if allout-numbered-bullet
           (save-excursion               ; Renumber subsequent topics if needed:
             (if (not (looking-at allout-regexp))
@@ -4218,6 +4256,7 @@ allout-yank-processing for exposure recovery."
   (interactive)
   (let* ((inhibit-field-text-motion t)
          (beg (prog1 (allout-back-to-current-heading) (beginning-of-line)))
+         end
          (depth allout-recent-depth))
     (allout-end-of-current-subtree)
     (if (and (/= (current-column) 0) (not (eobp)))
@@ -4231,9 +4270,13 @@ allout-yank-processing for exposure recovery."
                           (string= (buffer-substring (- beg 2) beg) "\n\n"))))
            (forward-char 1)))
 
-    (allout-annotate-hidden beg (point))
+    (allout-annotate-hidden beg (setq end (point)))
+    (unwind-protect
+        (allout-unprotected (kill-region beg end))
+      (if buffer-read-only
+          ;; eg, during copy-as-kill.
+          (allout-deannotate-hidden beg end)))
 
-    (allout-unprotected (kill-region beg (point)))
     (save-excursion
       (allout-renumber-to-depth depth))
     (run-hook-with-args 'allout-structure-deleted-hook depth (point))))
@@ -4251,8 +4294,7 @@ allout-yank-processing for exposure recovery."
 
   (let ((was-modified (buffer-modified-p))
         (buffer-read-only nil))
-    (allout-unprotected
-     (remove-text-properties begin end '(allout-was-hidden t)))
+    (allout-deannotate-hidden begin end)
     (save-excursion
       (goto-char begin)
       (let (done next prev overlay)
@@ -4279,9 +4321,19 @@ allout-yank-processing for exposure recovery."
               (when next
                 (goto-char next)
                 (allout-unprotected
-                 (put-text-property (overlay-start overlay) next
-                                    'allout-was-hidden t))))))))
+                 (let ((buffer-undo-list t))
+                   (put-text-property (overlay-start overlay) next
+                                      'allout-was-hidden t)))))))))
     (set-buffer-modified-p was-modified)))
+;;;_    > allout-deannotate-hidden (begin end)
+(defun allout-deannotate-hidden (begin end)
+  "Remove allout hidden-text annotation between BEGIN and END."
+
+  (allout-unprotected
+   (let ((inhibit-read-only t)
+         (buffer-undo-list t))
+     ;(remove-text-properties begin end '(allout-was-hidden t))
+     )))
 ;;;_    > allout-hide-by-annotation (begin end)
 (defun allout-hide-by-annotation (begin end)
   "Translate text properties indicating exposure status into actual exposure."
@@ -4309,16 +4361,10 @@ allout-yank-processing for exposure recovery."
                                                          nil end))
             (overlay-put (make-overlay prev next)
                          'category 'allout-exposure-category)
-            (allout-unprotected
-             (remove-text-properties prev next '(allout-was-hidden t)))
+            (allout-deannotate-hidden prev next)
             (setq prev next)
             (if next (goto-char next)))))
       (set-buffer-modified-p was-modified))))
-;;;_    > allout-remove-exposure-annotation (begin end)
-(defun allout-remove-exposure-annotation (begin end)
-  "Remove text properties indicating exposure status."
-  (remove-text-properties begin end '(allout-was-hidden t)))
-
 ;;;_    > allout-yank-processing ()
 (defun allout-yank-processing (&optional arg)
 
@@ -4345,108 +4391,117 @@ however, are left exactly like normal, non-allout-specific yanks."
                                        ; region around subject:
   (if (< (allout-mark-marker t) (point))
       (exchange-point-and-mark))
-  (allout-unprotected
-   (let* ((subj-beg (point))
-          (into-bol (bolp))
-          (subj-end (allout-mark-marker t))
-          ;; 'resituate' if yanking an entire topic into topic header:
-          (resituate (and (allout-e-o-prefix-p)
-                          (looking-at allout-regexp)
-                          (allout-prefix-data)))
-          ;; `rectify-numbering' if resituating (where several topics may
-          ;; be resituating) or yanking a topic into a topic slot (bol):
-          (rectify-numbering (or resituate
-                                 (and into-bol (looking-at allout-regexp)))))
-     (if resituate
-                                        ; The yanked stuff is a topic:
-         (let* ((prefix-len (- (match-end 1) subj-beg))
-                (subj-depth allout-recent-depth)
-                (prefix-bullet (allout-recent-bullet))
-                (adjust-to-depth
-                 ;; Nil if adjustment unnecessary, otherwise depth to which
-                 ;; adjustment should be made:
-                 (save-excursion
-                   (and (goto-char subj-end)
-                        (eolp)
-                        (goto-char subj-beg)
-                        (and (looking-at allout-regexp)
-                             (progn
-                               (beginning-of-line)
-                               (not (= (point) subj-beg)))
-                             (looking-at allout-regexp)
-                             (allout-prefix-data))
-                        allout-recent-depth)))
-                (more t))
-           (setq rectify-numbering allout-numbered-bullet)
-           (if adjust-to-depth
+  (let* ((subj-beg (point))
+         (into-bol (bolp))
+         (subj-end (allout-mark-marker t))
+         ;; 'resituate' if yanking an entire topic into topic header:
+         (resituate (and (let ((allout-inhibit-aberrance-doublecheck t))
+                           (allout-e-o-prefix-p))
+                         (looking-at allout-regexp)
+                         (allout-prefix-data)))
+         ;; `rectify-numbering' if resituating (where several topics may
+         ;; be resituating) or yanking a topic into a topic slot (bol):
+         (rectify-numbering (or resituate
+                                (and into-bol (looking-at allout-regexp)))))
+    (if resituate
+        ;; Yanking a topic into the start of a topic - reconcile to fit:
+        (let* ((inhibit-field-text-motion t)
+               (prefix-len (if (not (match-end 1))
+                               1
+                             (- (match-end 1) subj-beg)))
+               (subj-depth allout-recent-depth)
+               (prefix-bullet (allout-recent-bullet))
+               (adjust-to-depth
+                ;; Nil if adjustment unnecessary, otherwise depth to which
+                ;; adjustment should be made:
+                (save-excursion
+                  (and (goto-char subj-end)
+                       (eolp)
+                       (goto-char subj-beg)
+                       (and (looking-at allout-regexp)
+                            (progn
+                              (beginning-of-line)
+                              (not (= (point) subj-beg)))
+                            (looking-at allout-regexp)
+                            (allout-prefix-data))
+                       allout-recent-depth)))
+               (more t))
+          (setq rectify-numbering allout-numbered-bullet)
+          (if adjust-to-depth
                                         ; Do the adjustment:
-               (progn
-                 (save-restriction
-                   (narrow-to-region subj-beg subj-end)
+              (progn
+                (save-restriction
+                  (narrow-to-region subj-beg subj-end)
                                         ; Trim off excessive blank
                                         ; line at end, if any:
-                   (goto-char (point-max))
-                   (if (looking-at "^$")
-                       (allout-unprotected (delete-char -1)))
+                  (goto-char (point-max))
+                  (if (looking-at "^$")
+                      (allout-unprotected (delete-char -1)))
                                         ; Work backwards, with each
                                         ; shallowest level,
                                         ; successively excluding the
                                         ; last processed topic from
                                         ; the narrow region:
-                   (while more
-                     (allout-back-to-current-heading)
+                  (while more
+                    (allout-back-to-current-heading)
                                         ; go as high as we can in each bunch:
-                     (while (allout-ascend))
-                     (save-excursion
+                    (while (allout-ascend))
+                    (save-excursion
+                      (allout-unprotected
                        (allout-rebullet-topic-grunt (- adjust-to-depth
-                                                      subj-depth))
-                       (allout-depth))
-                     (if (setq more (not (bobp)))
-                         (progn (widen)
-                                (forward-char -1)
-                                (narrow-to-region subj-beg (point))))))
-                 ;; Preserve new bullet if it's a distinctive one, otherwise
-                 ;; use old one:
-                 (if (string-match (regexp-quote prefix-bullet)
-                                   allout-distinctive-bullets-string)
+                                                       subj-depth)))
+                      (allout-depth))
+                    (if (setq more (not (bobp)))
+                        (progn (widen)
+                               (forward-char -1)
+                               (narrow-to-region subj-beg (point))))))
+                ;; Preserve new bullet if it's a distinctive one, otherwise
+                ;; use old one:
+                (if (string-match (regexp-quote prefix-bullet)
+                                  allout-distinctive-bullets-string)
                                         ; Delete from bullet of old to
                                         ; before bullet of new:
-                     (progn
-                       (beginning-of-line)
-                       (delete-region (point) subj-beg)
-                       (set-marker (allout-mark-marker t) subj-end)
-                       (goto-char subj-beg)
-                       (allout-end-of-prefix))
+                    (progn
+                      (beginning-of-line)
+                      (allout-unprotected
+                       (delete-region (point) subj-beg))
+                      (set-marker (allout-mark-marker t) subj-end)
+                      (goto-char subj-beg)
+                      (allout-end-of-prefix))
                                         ; Delete base subj prefix,
                                         ; leaving old one:
-                   (delete-region (point) (+ (point)
-                                             prefix-len
-                                             (- adjust-to-depth subj-depth)))
+                  (allout-unprotected
+                   (progn
+                     (delete-region (point) (+ (point)
+                                               prefix-len
+                                               (- adjust-to-depth
+                                                  subj-depth)))
                                         ; and delete residual subj
                                         ; prefix digits and space:
-                   (while (looking-at "[0-9]") (delete-char 1))
-                   (if (looking-at " ") (delete-char 1))))
-             (exchange-point-and-mark))))
-     (if rectify-numbering
-         (progn
-           (save-excursion
+                     (while (looking-at "[0-9]") (delete-char 1))
+                     (if (looking-at " ") (delete-char 1))))))
+            (exchange-point-and-mark))))
+    (if rectify-numbering
+        (progn
+          (save-excursion
                                         ; Give some preliminary feedback:
-             (message "... reconciling numbers")
+            (message "... reconciling numbers")
                                         ; ... and renumber, in case necessary:
-             (goto-char subj-beg)
-             (if (allout-goto-prefix-doublechecked)
+            (goto-char subj-beg)
+            (if (allout-goto-prefix-doublechecked)
+                (allout-unprotected
                  (allout-rebullet-heading nil            ;;; solicit
-                                         (allout-depth) ;;; depth
-                                         nil            ;;; number-control
-                                         nil            ;;; index
-                                         t))
-             (message ""))))
-     (if (or into-bol resituate)
-         (allout-hide-by-annotation (point) (allout-mark-marker t))
-       (allout-remove-exposure-annotation (allout-mark-marker t) (point)))
-     (if (not resituate)
-         (exchange-point-and-mark))
-     (run-hook-with-args 'allout-structure-added-hook subj-beg subj-end))))
+                                          (allout-depth) ;;; depth
+                                          nil            ;;; number-control
+                                          nil            ;;; index
+                                          t)))
+            (message ""))))
+    (if (or into-bol resituate)
+        (allout-hide-by-annotation (point) (allout-mark-marker t))
+      (allout-deannotate-hidden (allout-mark-marker t) (point)))
+    (if (not resituate)
+        (exchange-point-and-mark))
+    (run-hook-with-args 'allout-structure-added-hook subj-beg subj-end)))
 ;;;_    > allout-yank (&optional arg)
 (defun allout-yank (&optional arg)
   "`allout-mode' yank, with depth and numbering adjustment of yanked topics.
@@ -5671,7 +5726,7 @@ If allout customization var `allout-passphrase-verifier-handling' is
 non-nil, an entry for `allout-passphrase-verifier-string' and its value is
 added to an Emacs 'local variables' section at the end of the file, which
 is created if necessary.  That setting is for retention of the passphrase
-verifier across emacs sessions.
+verifier across Emacs sessions.
 
 Similarly, `allout-passphrase-hint-string' stores a user-provided reminder
 about their passphrase, and `allout-passphrase-hint-handling' specifies
@@ -5711,7 +5766,7 @@ See `allout-toggle-current-subtree-encryption' for more details."
                        " shift it in to make it encryptable")))
 
     (let* ((allout-buffer (current-buffer))
-           ;; Asses location:
+           ;; Assess location:
            (bullet-pos allout-recent-prefix-beginning)
            (after-bullet-pos (point))
            (was-encrypted
@@ -5745,7 +5800,29 @@ See `allout-toggle-current-subtree-encryption' for more details."
                       '(symmetric nil)))
            (for-key-type (car key-info))
            (for-key-identity (cadr key-info))
-           (fetch-pass (and fetch-pass (member fetch-pass '(16 (16))))))
+           (fetch-pass (and fetch-pass (member fetch-pass '(16 (16)))))
+           (was-coding-system buffer-file-coding-system))
+
+      (when (not was-encrypted)
+        ;; ensure that non-ascii chars pending encryption are noticed before
+        ;; they're encrypted, so the coding system is set to accomodate
+        ;; them.
+        (setq buffer-file-coding-system
+              (select-safe-coding-system subtree-beg subtree-end))
+        ;; if the coding system for the text being encrypted is different
+        ;; than that prevailing, then there a real risk that the coding
+        ;; system can't be noticed by emacs when the file is visited.  to
+        ;; mitigate that, offer to preserve the coding system using a file
+        ;; local variable.
+        (if (and (not (equal buffer-file-coding-system
+                             was-coding-system))
+                 (yes-or-no-p
+                  (format (concat "Register coding system %s as file local"
+                                  " var?  Necessary when only encrypted text"
+                                  " is in that coding system. ")
+                          buffer-file-coding-system)))
+            (allout-adjust-file-variable "buffer-file-coding-system"
+                                         buffer-file-coding-system)))
 
       (setq result-text
             (allout-encrypt-string subject-text was-encrypted
@@ -5834,6 +5911,10 @@ Returns the resulting string, or nil if the transformation fails."
                                       target-prompt-id
                                     (or (buffer-file-name allout-buffer)
                                         target-prompt-id))))
+         (encoding (with-current-buffer allout-buffer
+                     buffer-file-coding-system))
+         (multibyte (with-current-buffer allout-buffer
+                     enable-multibyte-characters))
          (strip-plaintext-regexps
           (if (not decrypt)
               (allout-get-configvar-values
@@ -5870,6 +5951,13 @@ Returns the resulting string, or nil if the transformation fails."
 
           (insert text)
 
+          ;; convey the text characteristics of the original buffer:
+          (set-buffer-multibyte multibyte)
+          (when encoding
+            (set-buffer-file-coding-system encoding)
+            (if (not decrypt)
+                (encode-coding-region (point-min) (point-max) encoding)))
+
           (when (and strip-plaintext-regexps (not decrypt))
             (dolist (re strip-plaintext-regexps)
               (let ((re (if (listp re) (car re) re))
@@ -6356,7 +6444,7 @@ setup for auto-startup."
 
   (save-excursion
     (goto-char (point-min))
-    (if (looking-at allout-regexp)
+    (if (allout-goto-prefix)
        t
       (allout-open-topic 2)
       (insert (concat "Dummy outline topic header - see"
@@ -6393,7 +6481,7 @@ Returns list `(beginning-point prefix-string suffix-string)'."
   )
 ;;;_   > allout-adjust-file-variable (varname value)
 (defun allout-adjust-file-variable (varname value)
-  "Adjust the setting of an emacs file variable named VARNAME to VALUE.
+  "Adjust the setting of an Emacs file variable named VARNAME to VALUE.
 
 This activity is inhibited if either `enable-local-variables'
 `allout-enable-file-variable-adjustment' are nil.
@@ -6404,7 +6492,7 @@ variables, itself, is created if not already present.  When created, the
 section lines \(including the section line) exist as second-level topics in
 a top-level topic at the end of the file.
 
-enable-local-variables must be true for any of this to happen."
+`enable-local-variables' must be true for any of this to happen."
   (if (not (and enable-local-variables
                 allout-enable-file-variable-adjustment))
       nil
index cbe571f..0e24341 100644 (file)
@@ -171,7 +171,7 @@ If value is `verbose', the computed score is shown for each match."
   ("yank" "paste")
   ("region" "selection"))
   "List of synonyms known by apropos.
-Each element is a list of words where the first word is the standard emacs
+Each element is a list of words where the first word is the standard Emacs
 term, and the rest of the words are alternative terms.")
 
 \f
index 1b87c66..8d94ae5 100644 (file)
@@ -119,7 +119,7 @@ then invokes the normal binding of \\[autoarg-terminate].
 With ARG, turn Autoarg mode on if ARG is positive, off otherwise.
 \\<autoarg-kp-mode-map>
 This is similar to \\[autoarg-mode] but rebinds the keypad keys `kp-1'
-&c to supply digit arguments.
+etc. to supply digit arguments.
 
 \\{autoarg-kp-mode-map}"
   nil " Aakp" autoarg-kp-mode-map :global t :group 'keyboard
index 50edc8d..a4c72df 100644 (file)
@@ -49,8 +49,8 @@
              (file-directory-p "/proc/acpi/battery"))
         'battery-linux-proc-acpi)
        ((and (eq system-type 'darwin)
-             (condition-case nil  
-                 (with-temp-buffer 
+             (condition-case nil
+                 (with-temp-buffer
                    (and (eq (call-process "pmset" nil t nil "-g" "ps") 0)
                         (> (buffer-size) 0)))
                (error nil)))
@@ -355,45 +355,19 @@ The following %-sequences are provided:
                                   60)))
               hours (/ minutes 60)))
     (list (cons ?c (or (and capacity (number-to-string capacity)) "N/A"))
-         (cons ?L (or (when (file-exists-p "/proc/acpi/ac_adapter/AC/state")
-                        (with-temp-buffer
-                          (insert-file-contents
-                           "/proc/acpi/ac_adapter/AC/state")
-                          (when (re-search-forward "state: +\\(.*\\)$" nil t)
-                            (match-string 1))))
+         (cons ?L (or (battery-search-for-one-match-in-files
+                       (mapcar (lambda (e) (concat e "/state"))
+                               (directory-files "/proc/acpi/ac_adapter/"
+                                                t "\\`[^.]"))
+                       "state: +\\(.*\\)$" 1)
+
                       "N/A"))
-         (cons ?d (or (when (file-exists-p
-                             "/proc/acpi/thermal_zone/THRM/temperature")
-                        (with-temp-buffer
-                          (insert-file-contents
-                           "/proc/acpi/thermal_zone/THRM/temperature")
-                          (when (re-search-forward
-                                 "temperature: +\\([0-9]+\\) C$" nil t)
-                            (match-string 1))))
-                      (when (file-exists-p
-                             "/proc/acpi/thermal_zone/THM/temperature")
-                        (with-temp-buffer
-                          (insert-file-contents
-                           "/proc/acpi/thermal_zone/THM/temperature")
-                          (when (re-search-forward
-                                 "temperature: +\\([0-9]+\\) C$" nil t)
-                            (match-string 1))))
-                      (when (file-exists-p
-                             "/proc/acpi/thermal_zone/THM0/temperature")
-                        (with-temp-buffer
-                          (insert-file-contents
-                           "/proc/acpi/thermal_zone/THM0/temperature")
-                          (when (re-search-forward
-                                 "temperature: +\\([0-9]+\\) C$" nil t)
-                            (match-string 1))))
-                      (when (file-exists-p
-                             "/proc/acpi/thermal_zone/THR2/temperature")
-                        (with-temp-buffer
-                          (insert-file-contents
-                           "/proc/acpi/thermal_zone/THR2/temperature")
-                          (when (re-search-forward
-                                 "temperature: +\\([0-9]+\\) C$" nil t)
-                            (match-string 1))))
+         (cons ?d (or (battery-search-for-one-match-in-files
+                       (mapcar (lambda (e) (concat e "/temperature"))
+                               (directory-files "/proc/acpi/thermal_zone/"
+                                                t "\\`[^.]"))
+                       "temperature: +\\([0-9]+\\) C$" 1)
+
                       "N/A"))
          (cons ?r (or (and rate (concat (number-to-string rate) " "
                                         rate-type)) "N/A"))
@@ -408,6 +382,7 @@ The following %-sequences are provided:
                            (format "%d:%02d" hours (- minutes (* 60 hours))))
                       "N/A"))
          (cons ?p (or (and full-capacity capacity
+                           (> full-capacity 0)
                            (number-to-string
                             (floor (/ capacity
                                       (/ (float full-capacity) 100)))))
@@ -478,6 +453,17 @@ The following %-sequences are provided:
         (or (cdr (assoc char alist)) ""))))
    format t t))
 
+(defun battery-search-for-one-match-in-files (files regexp match-num)
+  "Search REGEXP in the content of the files listed in FILES.
+If a match occured, return the parenthesized expression numbered by
+MATCH-NUM in the match.  Otherwise, return nil."
+  (with-temp-buffer
+    (catch 'found
+      (dolist (file files)
+       (and (ignore-errors (insert-file-contents file nil nil nil 'replace))
+            (re-search-forward regexp nil t)
+            (throw 'found (match-string match-num)))))))
+
 \f
 (provide 'battery)
 
index 1d0d49f..755d7fe 100644 (file)
@@ -285,7 +285,7 @@ Keymap to display on minor modes.")
        ;;        "\
        ;; mouse-1: select window, mouse-2: delete others, mouse-3: delete,
        ;; drag-mouse-1: resize, C-mouse-2: split horizontally"
-       "mouse-1: select (drag to resize), mouse-2: delete others, mouse-3: delete this")
+       "mouse-1: select (drag to resize), mouse-2 = C-x 1, mouse-3 = C-x 0")
        (dashes (propertize "--" 'help-echo help-echo))
        (standard-mode-line-format
        (list
index f095a98..d0b929b 100644 (file)
@@ -441,11 +441,12 @@ naming a sort behavior.  Default is \"by nothing\" which means no sorting."
 
 (defvar bs--show-all nil
   "Flag whether showing all buffers regardless of current configuration.
-Non nil means to show all buffers.  Otherwise show buffers
+Non-nil means to show all buffers.  Otherwise show buffers
 defined by current configuration `bs-current-configuration'.")
 
 (defvar bs--window-config-coming-from nil
   "Window configuration before starting Buffer Selection Menu.")
+(make-variable-frame-local 'bs--window-config-coming-from)
 
 (defvar bs--intern-show-never "^ \\|\\*buffer-selection\\*"
   "Regular expression specifying which buffers never to show.
@@ -583,8 +584,8 @@ a special function.  SORT-DESCRIPTION is an element of `bs-sort-functions'."
 
 (defun bs--redisplay (&optional keep-line-p sort-description)
   "Redisplay whole Buffer Selection Menu.
-If KEEP-LINE-P is non nil the point will stay on current line.
-SORT-DESCRIPTION is an element of `bs-sort-functions'"
+If KEEP-LINE-P is non-nil the point will stay on current line.
+SORT-DESCRIPTION is an element of `bs-sort-functions'."
   (let ((line (1+ (count-lines 1 (point)))))
     (bs-show-in-buffer (bs-buffer-list nil sort-description))
     (if keep-line-p
@@ -661,11 +662,17 @@ to show always.
        font-lock-verbose nil)
   (run-mode-hooks 'bs-mode-hook))
 
+(defun bs--restore-window-config ()
+  "Restore window configuration on the current frame."
+  (when bs--window-config-coming-from
+    (set-window-configuration bs--window-config-coming-from)
+    (setq bs--window-config-coming-from nil)))
+
 (defun bs-kill ()
   "Let buffer disappear and reset window-configuration."
   (interactive)
   (bury-buffer (current-buffer))
-  (set-window-configuration bs--window-config-coming-from))
+  (bs--restore-window-config))
 
 (defun bs-abort ()
   "Ding and leave Buffer Selection Menu without a selection."
@@ -685,17 +692,6 @@ Refresh whole Buffer Selection Menu."
   (interactive)
   (bs--redisplay t))
 
-(defun bs--window-for-buffer (buffer-name)
-  "Return a window showing a buffer with name BUFFER-NAME.
-Take only windows of current frame into account.
-Return nil if there is no such buffer."
-  (let ((window nil))
-    (walk-windows (lambda (wind)
-                   (if (string= (buffer-name (window-buffer wind))
-                                buffer-name)
-                       (setq window wind))))
-    window))
-
 (defun bs--set-window-height ()
   "Change the height of the selected window to suit the current buffer list."
   (unless (one-window-p t)
@@ -736,7 +732,7 @@ Leave Buffer Selection Menu."
   (interactive)
   (let ((buffer (bs--current-buffer)))
     (bury-buffer (current-buffer))
-    (set-window-configuration bs--window-config-coming-from)
+    (bs--restore-window-config)
     (switch-to-buffer buffer)
     (if bs--marked-buffers
        ;; Some marked buffers for selection
@@ -760,7 +756,7 @@ Leave Buffer Selection Menu."
   (interactive)
   (let ((buffer (bs--current-buffer)))
     (bury-buffer (current-buffer))
-    (set-window-configuration bs--window-config-coming-from)
+    (bs--restore-window-config)
     (switch-to-buffer-other-window buffer)))
 
 (defun bs-tmp-select-other-window ()
@@ -776,7 +772,7 @@ Leave Buffer Selection Menu."
   (interactive)
   (let ((buffer (bs--current-buffer)))
     (bury-buffer (current-buffer))
-    (set-window-configuration bs--window-config-coming-from)
+    (bs--restore-window-config)
     (switch-to-buffer-other-frame buffer)))
 
 (defun bs-mouse-select-other-frame (event)
@@ -1234,7 +1230,6 @@ by buffer configuration `bs-cycle-configuration-name'."
                                (or (cdr bs--cycle-list)
                                    "this buffer"))))))
 
-
 ;;;###autoload
 (defun bs-cycle-previous ()
   "Select previous buffer defined by buffer cycling.
@@ -1426,17 +1421,20 @@ for buffer selection."
     (unless (string= "*buffer-selection*" (buffer-name))
       ;; Only when not in buffer *buffer-selection*
       ;; we have to set the buffer we started the command
-      (progn
-       (setq bs--buffer-coming-from (current-buffer))
-       (setq bs--window-config-coming-from (current-window-configuration))))
+      (setq bs--buffer-coming-from (current-buffer)))
     (let ((liste (bs-buffer-list))
-         (active-window (bs--window-for-buffer "*buffer-selection*")))
+         (active-window (get-window-with-predicate
+                          (lambda (w)
+                            (string= (buffer-name (window-buffer w))
+                                     "*buffer-selection*")))))
       (if active-window
          (select-window active-window)
-       (if (> (window-height (selected-window)) 7)
-           (progn
-             (split-window-vertically)
-             (other-window 1))))
+        (modify-frame-parameters nil
+                                 (list (cons 'bs--window-config-coming-from
+                                             (current-window-configuration))))
+       (when (> (window-height (selected-window)) 7)
+          (split-window-vertically)
+          (other-window 1)))
       (bs-show-in-buffer liste)
       (bs-message-without-log "%s" (bs--current-config-message)))))
 
index 62327a9..aed4c32 100644 (file)
 (require 'calendar)
 (require 'cal-persia)
 
+(defcustom calendar-dst-check-each-year-flag t
+  "Non-nil means to check each year for DST transitions as needed.
+Otherwise assume the next two transitions found after the
+current date apply to all years.  This is faster, but not always
+correct, since the dates of Daylight Saving transitions sometimes
+change."
+  :type 'boolean
+  :version "22.1"
+  :group 'calendar)
+
 (defvar calendar-current-time-zone-cache nil
   "Cache for result of calendar-current-time-zone.")
 
@@ -199,6 +209,74 @@ The result has the proper form for calendar-daylight-savings-starts'."
          (cdr candidate-rules)))
     (car candidate-rules)))
 
+;; TODO it might be better to extract this information directly from
+;; the system timezone database. But cross-platform...?
+;; See thread
+;; http://lists.gnu.org/archive/html/emacs-pretest-bug/2006-11/msg00060.html
+(defun calendar-dst-find-data (&optional time)
+  "Find data on the first Daylight Saving Time transitions after TIME.
+TIME defaults to `current-time'.  Return value is as described
+for `calendar-current-time-zone'."
+  (let* ((t0 (or time (current-time)))
+         (t0-zone (current-time-zone t0))
+         (t0-utc-diff (car t0-zone))
+         (t0-name (car (cdr t0-zone))))
+    (if (not t0-utc-diff)
+        ;; Little or no time zone information is available.
+        (list nil nil t0-name t0-name nil nil nil nil)
+      (let* ((t1 (calendar-next-time-zone-transition t0))
+             (t2 (and t1 (calendar-next-time-zone-transition t1))))
+        (if (not t2)
+            ;; This locale does not have daylight savings time.
+            (list (/ t0-utc-diff 60) 0 t0-name t0-name nil nil 0 0)
+          ;; Use heuristics to find daylight savings parameters.
+          (let* ((t1-zone (current-time-zone t1))
+                 (t1-utc-diff (car t1-zone))
+                 (t1-name (car (cdr t1-zone)))
+                 (t1-date-sec (calendar-absolute-from-time t1 t0-utc-diff))
+                 (t2-date-sec (calendar-absolute-from-time t2 t1-utc-diff))
+                 ;; TODO When calendar-dst-check-each-year-flag is non-nil,
+                 ;; the rules can be simpler than they currently are.
+                 (t1-rules (calendar-time-zone-daylight-rules
+                            (car t1-date-sec) t0-utc-diff))
+                 (t2-rules (calendar-time-zone-daylight-rules
+                            (car t2-date-sec) t1-utc-diff))
+                 (t1-time (/ (cdr t1-date-sec) 60))
+                 (t2-time (/ (cdr t2-date-sec) 60)))
+            (cons
+             (/ (min t0-utc-diff t1-utc-diff) 60)
+             (cons
+              (/ (abs (- t0-utc-diff t1-utc-diff)) 60)
+              (if (< t0-utc-diff t1-utc-diff)
+                  (list t0-name t1-name t1-rules t2-rules t1-time t2-time)
+                (list t1-name t0-name t2-rules t1-rules t2-time t1-time)
+                )))))))))
+
+(defvar calendar-dst-transition-cache nil
+  "Internal cal-dst variable storing date of Daylight Saving Time transitions.
+Value is a list with elements of the form (YEAR START END), where
+START and END are expressions that when evaluated return the
+start and end dates (respectively) for DST in YEAR. Used by the
+function `calendar-dst-find-startend'.")
+
+(defun calendar-dst-find-startend (year)
+  "Find the dates in YEAR on which Daylight Saving Time starts and ends.
+Returns a list (YEAR START END), where START and END are
+expressions that when evaluated return the start and end dates,
+respectively. This function first attempts to use pre-calculated
+data from `calendar-dst-transition-cache', otherwise it calls
+`calendar-dst-find-data' (and adds the results to the cache)."
+  (let ((e (assoc year calendar-dst-transition-cache))
+        f)
+    (or e
+        (progn
+          (setq e (calendar-dst-find-data (encode-time 1 0 0 1 1 year))
+                f (nth 4 e)
+                e (list year f (nth 5 e))
+                calendar-dst-transition-cache
+                (append calendar-dst-transition-cache (list e)))
+          e))))
+
 (defun calendar-current-time-zone ()
   "Return UTC difference, dst offset, names and rules for current time zone.
 
@@ -226,42 +304,8 @@ DST-ZONE are equal, and all the DST-* integer variables are 0.
 Some operating systems cannot provide all this information to Emacs; in this
 case, `calendar-current-time-zone' returns a list containing nil for the data
 it can't find."
-  (or
-   calendar-current-time-zone-cache
-   (setq
-    calendar-current-time-zone-cache
-    (let* ((t0 (current-time))
-          (t0-zone (current-time-zone t0))
-          (t0-utc-diff (car t0-zone))
-          (t0-name (car (cdr t0-zone))))
-      (if (not t0-utc-diff)
-         ;; Little or no time zone information is available.
-         (list nil nil t0-name t0-name nil nil nil nil)
-       (let* ((t1 (calendar-next-time-zone-transition t0))
-              (t2 (and t1 (calendar-next-time-zone-transition t1))))
-         (if (not t2)
-             ;; This locale does not have daylight savings time.
-             (list (/ t0-utc-diff 60) 0 t0-name t0-name nil nil 0 0)
-           ;; Use heuristics to find daylight savings parameters.
-           (let* ((t1-zone (current-time-zone t1))
-                  (t1-utc-diff (car t1-zone))
-                  (t1-name (car (cdr t1-zone)))
-                  (t1-date-sec (calendar-absolute-from-time t1 t0-utc-diff))
-                  (t2-date-sec (calendar-absolute-from-time t2 t1-utc-diff))
-                  (t1-rules (calendar-time-zone-daylight-rules
-                             (car t1-date-sec) t0-utc-diff))
-                  (t2-rules (calendar-time-zone-daylight-rules
-                             (car t2-date-sec) t1-utc-diff))
-                  (t1-time (/ (cdr t1-date-sec) 60))
-                  (t2-time (/ (cdr t2-date-sec) 60)))
-             (cons
-              (/ (min t0-utc-diff t1-utc-diff) 60)
-              (cons
-               (/ (abs (- t0-utc-diff t1-utc-diff)) 60)
-               (if (< t0-utc-diff t1-utc-diff)
-                   (list t0-name t1-name t1-rules t2-rules t1-time t2-time)
-                   (list t1-name t0-name t2-rules t1-rules t2-time t1-time)
-                   )))))))))))
+  (unless calendar-current-time-zone-cache
+    (setq calendar-current-time-zone-cache (calendar-dst-find-data))))
 
 ;;; The following eight defvars relating to daylight savings time should NOT be
 ;;; marked to go into loaddefs.el where they would be evaluated when Emacs is
@@ -293,12 +337,32 @@ For example, \"EST\" in New York City, \"PST\" for Los Angeles.")
   "*Abbreviated name of daylight-savings time zone at `calendar-location-name'.
 For example, \"EDT\" in New York City, \"PDT\" for Los Angeles.")
 
+
+(defun calendar-dst-starts (year)
+  "Return the date of YEAR on which Daylight Saving Time starts.
+This function respects the value of `calendar-dst-check-each-year-flag'."
+  (or (let ((expr (if calendar-dst-check-each-year-flag
+                      (cadr (calendar-dst-find-startend year))
+                    (nth 4 calendar-current-time-zone-cache))))
+        (if expr (eval expr)))
+      (and (not (zerop calendar-daylight-time-offset))
+           (calendar-nth-named-day 1 0 4 year))))
+
+(defun calendar-dst-ends (year)
+  "Return the date of YEAR on which Daylight Saving Time ends.
+This function respects the value of `calendar-dst-check-each-year-flag'."
+  (or (let ((expr (if calendar-dst-check-each-year-flag
+                      (nth 2 (calendar-dst-find-startend year))
+                    (nth 5 calendar-current-time-zone-cache))))
+        (if expr (eval expr)))
+      (and (not (zerop calendar-daylight-time-offset))
+           (calendar-nth-named-day -1 0 10 year))))
+
+
 ;;;###autoload
 (put 'calendar-daylight-savings-starts 'risky-local-variable t)
 (defvar calendar-daylight-savings-starts
-  (or (car (nthcdr 4 calendar-current-time-zone-cache))
-      (and (not (zerop calendar-daylight-time-offset))
-          '(calendar-nth-named-day 1 0 4 year)))
+  '(calendar-dst-starts year)
   "*Sexp giving the date on which daylight savings time starts.
 This is an expression in the variable `year' whose value gives the Gregorian
 date in the form (month day year) on which daylight savings time starts.  It is
@@ -319,9 +383,7 @@ If the locale never uses daylight savings time, set this to nil.")
 ;;;###autoload
 (put 'calendar-daylight-savings-ends 'risky-local-variable t)
 (defvar calendar-daylight-savings-ends
-  (or (car (nthcdr 5 calendar-current-time-zone-cache))
-      (and (not (zerop calendar-daylight-time-offset))
-          '(calendar-nth-named-day -1 0 10 year)))
+  '(calendar-dst-ends year)
   "*Sexp giving the date on which daylight savings time ends.
 This is an expression in the variable `year' whose value gives the Gregorian
 date in the form (month day year) on which daylight savings time ends.  It is
index 48b7470..191807a 100644 (file)
@@ -769,7 +769,8 @@ buffer.  The hook `comint-exec-hook' is run after each exec."
            (list "TERM=emacs"
                  (format "TERMCAP=emacs:co#%d:tc=unknown:" (window-width))))
          (unless (getenv "EMACS")
-           (list (concat "EMACS=" invocation-directory invocation-name)))
+           (list "EMACS=t"))
+         (list (format "INSIDE_EMACS=%s,comint" emacs-version))
          process-environment))
        (default-directory
          (if (file-accessible-directory-p default-directory)
index ab3f7ec..d698aae 100644 (file)
   :version "22.1"
   :prefix "mac-")
 
+;;; Custom mode keymaps
+
+(defvar custom-mode-map
+  ;; This keymap should be dense, but a dense keymap would prevent inheriting
+  ;; "\r" bindings from the parent map.
+  ;; Actually, this misfeature of dense keymaps was fixed on 2001-11-26.
+  (let ((map (make-keymap)))
+    (set-keymap-parent map widget-keymap)
+    (define-key map [remap self-insert-command] 'Custom-no-edit)
+    (define-key map "\^m" 'Custom-newline)
+    (define-key map " " 'scroll-up)
+    (define-key map "\177" 'scroll-down)
+    (define-key map "\C-c\C-c" 'Custom-set)
+    (define-key map "\C-x\C-s" 'Custom-save)
+    (define-key map "q" 'Custom-buffer-done)
+    (define-key map "u" 'Custom-goto-parent)
+    (define-key map "n" 'widget-forward)
+    (define-key map "p" 'widget-backward)
+    map)
+  "Keymap for `custom-mode'.")
+
+(defvar custom-mode-link-map
+  (let ((map (make-keymap)))
+    (set-keymap-parent map custom-mode-map)
+    (define-key map [down-mouse-2] nil)
+    (define-key map [down-mouse-1] 'mouse-drag-region)
+    (define-key map [mouse-2] 'widget-move-and-invoke)
+    map)
+  "Local keymap for links in `custom-mode'.")
+
+
 ;;; Utilities.
 
 (defun custom-split-regexp-maybe (regexp)
@@ -521,7 +552,7 @@ WIDGET is the widget to apply the filter entries of MENU on."
   "List of prefixes that should be ignored by `custom-unlispify'.")
 
 (defcustom custom-unlispify-menu-entries t
-  "Display menu entries as words instead of symbols if non nil."
+  "Display menu entries as words instead of symbols if non-nil."
   :group 'custom-menu
   :type 'boolean)
 
@@ -568,7 +599,7 @@ WIDGET is the widget to apply the filter entries of MENU on."
           (buffer-string)))))
 
 (defcustom custom-unlispify-tag-names t
-  "Display tag names as words instead of symbols if non nil."
+  "Display tag names as words instead of symbols if non-nil."
   :group 'custom-buffer
   :type 'boolean)
 
@@ -846,7 +877,7 @@ it were the arg to `interactive' (which see) to interactively read the value.
 If the variable has a `custom-type' property, it must be a widget and the
 `:prompt-value' property of that widget will be used for reading the value.
 
-If optional COMMENT argument is non nil, also prompt for a comment and return
+If optional COMMENT argument is non-nil, also prompt for a comment and return
 it as the third element in the list."
   (let* ((var (read-variable prompt-var))
         (minibuffer-help-form '(describe-variable var))
@@ -1781,6 +1812,8 @@ item in another window.\n\n"))
 (define-widget 'custom-manual 'info-link
   "Link to the manual entry for this customization option."
   :help-echo "Read the manual entry for this option."
+  :keymap custom-mode-link-map
+  :follow-link 'mouse-face
   :button-face 'custom-link
   :mouse-face 'highlight
   :pressed-face 'highlight
@@ -3631,7 +3664,7 @@ restoring it to the state of a face that has never been customized."
 ;;; The `hook' Widget.
 
 (define-widget 'hook 'list
-  "A emacs lisp hook"
+  "An Emacs Lisp hook."
   :value-to-internal (lambda (widget value)
                       (if (and value (symbolp value))
                           (list value)
@@ -3673,6 +3706,8 @@ restoring it to the state of a face that has never been customized."
   :mouse-face 'highlight
   :pressed-face 'highlight
   :help-echo "Create customization buffer for this group."
+  :keymap custom-mode-link-map
+  :follow-link 'mouse-face
   :action 'custom-group-link-action)
 
 (defun custom-group-link-action (widget &rest ignore)
@@ -4149,6 +4184,8 @@ if only the first line of the docstring is shown."))
 ;;;###autoload
 (defun custom-save-all ()
   "Save all customizations in `custom-file'."
+  (when (and (null custom-file) init-file-had-error)
+    (error "Cannot save customizations; init file was not fully loaded"))
   (let* ((filename (custom-file))
         (recentf-exclude (if recentf-mode
                              (cons (concat "\\`"
@@ -4156,7 +4193,8 @@ if only the first line of the docstring is shown."))
                                            "\\'")
                                    recentf-exclude)))
         (old-buffer (find-buffer-visiting filename)))
-    (with-current-buffer (or old-buffer (find-file-noselect filename))
+    (with-current-buffer (let ((find-file-visit-truename t))
+                          (or old-buffer (find-file-noselect filename)))
       (unless (eq major-mode 'emacs-lisp-mode)
        (emacs-lisp-mode))
       (let ((inhibit-read-only t))
@@ -4267,7 +4305,7 @@ This function does not save the buffer."
                            (eq (get symbol 'force-value)
                                'rogue))))
              (comment (get symbol 'saved-variable-comment)))
-         ;; Check REQUESTS for validity. 
+         ;; Check REQUESTS for validity.
          (dolist (request requests)
            (when (and (symbolp request) (not (featurep request)))
              (message "Unknown requested feature: %s" request)
@@ -4449,25 +4487,6 @@ The format is suitable for use with `easy-menu-define'."
 
 ;;; The Custom Mode.
 
-(defvar custom-mode-map
-  ;; This keymap should be dense, but a dense keymap would prevent inheriting
-  ;; "\r" bindings from the parent map.
-  ;; Actually, this misfeature of dense keymaps was fixed on 2001-11-26.
-  (let ((map (make-keymap)))
-    (set-keymap-parent map widget-keymap)
-    (define-key map [remap self-insert-command] 'Custom-no-edit)
-    (define-key map "\^m" 'Custom-newline)
-    (define-key map " " 'scroll-up)
-    (define-key map "\177" 'scroll-down)
-    (define-key map "\C-c\C-c" 'Custom-set)
-    (define-key map "\C-x\C-s" 'Custom-save)
-    (define-key map "q" 'Custom-buffer-done)
-    (define-key map "u" 'Custom-goto-parent)
-    (define-key map "n" 'widget-forward)
-    (define-key map "p" 'widget-backward)
-    map)
-  "Keymap for `custom-mode'.")
-
 (defun Custom-no-edit (pos &optional event)
   "Invoke button at POS, or refuse to allow editing of Custom buffer."
   (interactive "@d")
index 6200be6..8fb2893 100644 (file)
@@ -185,13 +185,13 @@ otherwise."
 \f
 (defcustom describe-char-unicodedata-file nil
   "Location of Unicode data file.
-This is the UnicodeData.txt file from the Unicode consortium, used for
+This is the UnicodeData.txt file from the Unicode Consortium, used for
 diagnostics.  If it is non-nil `describe-char' will print data
 looked up from it.  This facility is mostly of use to people doing
 multilingual development.
 
-This is a fairly large file, not typically present on GNU systems.  At
-the time of writing it is at the URL
+This is a fairly large file, not typically present on GNU systems.
+At the time of writing it is at the URL
 `http://www.unicode.org/Public/UNIDATA/UnicodeData.txt'."
   :group 'mule
   :version "22.1"
index 01b3a59..9226c53 100644 (file)
@@ -120,8 +120,8 @@ when editing big diffs)."
     ("\C-m" . diff-goto-source)
     ([mouse-2] . diff-goto-source)
     ;; From XEmacs' diff-mode.
-;; Standard M-w is useful, so don't change M-W.
-;;    ("W" . widen)
+    ;; Standard M-w is useful, so don't change M-W.
+    ;;("W" . widen)
     ;;("." . diff-goto-source)         ;display-buffer
     ;;("f" . diff-goto-source)         ;find-file
     ("o" . diff-goto-source)           ;other-window
@@ -153,6 +153,8 @@ when editing big diffs)."
     ("\C-c\C-s" . diff-split-hunk)
     ("\C-c\C-t" . diff-test-hunk)
     ("\C-c\C-u" . diff-context->unified)
+    ;; `d' because it duplicates the context :-(  --Stef
+    ("\C-c\C-d" . diff-unified->context)
     ("\C-c\C-w" . diff-refine-hunk)
     ("\C-c\C-f" . next-error-follow-minor-mode))
   "Keymap for `diff-mode'.  See also `diff-mode-shared-map'.")
index 769d98c..257332f 100644 (file)
@@ -1182,12 +1182,20 @@ Special value `always' suppresses confirmation."
                       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)
-           (pop files)))
+         (dolist (file files)
+           (let ((thisfrom (expand-file-name file from))
+                 (thisto (expand-file-name file to)))
+             ;; Catch errors copying within a directory,
+             ;; and report them through the dired log mechanism
+             ;; just as our caller will do for the top level files.
+             (condition-case err
+                 (dired-copy-file-recursive
+                  thisfrom thisto
+                  ok-flag preserve-time nil recursive)
+               (file-error
+                (push (dired-make-relative thisfrom)
+                      dired-create-files-failures)
+                (dired-log "Copying error for %s:\n%s\n" thisfrom err))))))
       ;; Not a directory.
       (or top (dired-handle-overwrite to))
       (condition-case err
@@ -1198,11 +1206,7 @@ Special value `always' suppresses confirmation."
        (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))))))
+        (dired-log "Can't set date on %s:\n%s\n" from err))))))
 
 ;;;###autoload
 (defun dired-rename-file (file newname ok-if-already-exists)
index 491ef26..5359b46 100644 (file)
@@ -791,6 +791,9 @@ wildcards, erases the buffer, and builds the subdir-alist anew
       (run-hooks 'dired-before-readin-hook)
       (if (consp buffer-undo-list)
          (setq buffer-undo-list nil))
+      (make-local-variable 'file-name-coding-system)
+      (setq file-name-coding-system
+           (or coding-system-for-read file-name-coding-system))
       (let (buffer-read-only
            ;; Don't make undo entries for readin.
            (buffer-undo-list t))
index 7681e85..55438be 100644 (file)
@@ -117,7 +117,7 @@ Valid symbols are `truncation', `wrap', `escape', `control',
   (or standard-display-table
       (setq standard-display-table (make-display-table)))
   (while (<= l h)
-    (aset standard-display-table l (if (or (< l ?\ ) (>= l 127)) (vector l)))
+    (aset standard-display-table l (if (or (< l ?\s) (>= l 127)) (vector l)))
     (setq l (1+ l))))
 
 ;;;###autoload
@@ -126,7 +126,7 @@ Valid symbols are `truncation', `wrap', `escape', `control',
   (or standard-display-table
       (setq standard-display-table (make-display-table)))
   (while (<= l h)
-    (if (and (>= l ?\ ) (char-valid-p l))
+    (if (and (>= l ?\s) (char-valid-p l))
        (aset standard-display-table l nil))
     (setq l (1+ l))))
 
index 222fe05..8bfbb53 100644 (file)
@@ -73,7 +73,7 @@ Run hooks in `electric-buffer-menu-mode-hook' on entry.
                  (catch 'electric-buffer-menu-select
                    (message "<<< Press Return to bury the buffer list >>>")
                    (if (eq (setq unread-command-events (list (read-event)))
-                           ?\ )
+                           ?\s)
                        (progn (setq unread-command-events nil)
                               (throw 'electric-buffer-menu-select nil)))
                    (let ((start-point (point))
index d2dff29..7786326 100644 (file)
@@ -1274,9 +1274,7 @@ delimiter regions"))
                ;; Similarly for Windows-*
                ;; In DOS, must synchronize because DOS doesn't have
                ;; asynchronous processes.
-               (condition-case nil
-                   (apply 'call-process program nil buffer nil args)
-                 (error (format "Cannot execute program %S." program)))
+               (apply 'call-process program nil buffer nil args)
              ;; On other systems, do it asynchronously.
              (setq proc (get-buffer-process buffer))
              (if proc (kill-process proc))
@@ -1447,14 +1445,12 @@ arguments to `skip-chars-forward'."
   "Return t if files F1 and F2 have identical contents."
   (if (and (not (file-directory-p f1))
            (not (file-directory-p f2)))
-      (condition-case nil
-         (let ((res
-                (apply 'call-process ediff-cmp-program nil nil nil
-                       (append ediff-cmp-options (list (expand-file-name f1)
-                                                       (expand-file-name f2))))
-                ))
-           (and (numberp res) (eq res 0)))
-       (error (format "Cannot execute program %S." ediff-cmp-program)))
+      (let ((res
+            (apply 'call-process ediff-cmp-program nil nil nil
+                   (append ediff-cmp-options (list (expand-file-name f1)
+                                                   (expand-file-name f2))))
+            ))
+       (and (numberp res) (eq res 0)))
     ))
 
 
index 14e1461..5327b09 100644 (file)
@@ -1401,8 +1401,8 @@ Uses `vc.el' or `rcs.el' depending on `ediff-version-control-package'."
                                'no-dirs)))
   (find-file file)
   (if (and (buffer-modified-p)
-          (y-or-n-p (message "Buffer %s is modified. Save buffer? "
-                             (buffer-name))))
+          (y-or-n-p (format "Buffer %s is modified. Save buffer? "
+                             (buffer-name))))
       (save-buffer (current-buffer)))
   (let (rev1 rev2)
     (setq rev1
index 376f31f..39f08d5 100644 (file)
@@ -197,7 +197,7 @@ BUFFER is put into `default-major-mode' (or `fundamental-mode') when we exit."
     (if (pos-visible-in-window-p (point-max))
        (progn (message "%s" (substitute-command-keys "<<< Press Space to bury the help buffer, Press \\[electric-help-retain] to retain it >>>"))
               (if (equal (setq unread-command-events (list (read-event)))
-                         '(?\ ))
+                         '(?\s))
                   (progn (setq unread-command-events nil)
                          (throw 'exit t)))))
     (let (up down both neither
index db8c3d5..3c2d937 100644 (file)
@@ -43,6 +43,7 @@ files.")
 (defconst authors-aliases
   '(
     ("Andrew Csillag" "Drew Csillag")
+    ("Anna M. Bigatti" "Anna Bigatti")
     ("Barry A. Warsaw" "Barry A. Warsaw, Century Computing, Inc."
      "Barry A. Warsaw, ITB" "Barry Warsaw")
     ("Bj\e,Av\e(Brn Torkelsson" "Bjorn Torkelsson")
@@ -176,7 +177,7 @@ listed.")
 Changes to files in this list are not listed.")
 
 (defconst authors-fixed-entries
-  '(("Richard M. Stallman" :wrote "[The original GNU emacs and numerous files]")
+  '(("Richard M. Stallman" :wrote "[The original GNU Emacs and numerous files]")
     ("Joseph Arceneaux" :wrote "xrdb.c")
     ("Blitz Product Development Corporation" :wrote "ispell.el")
     ("Frank Bresz" :wrote "diff.el")
index 02a88c1..6790f19 100644 (file)
@@ -264,11 +264,12 @@ facilities that have been added more recently."
 ;; this way can never be run in Emacs 18, and may even cause it to crash.")
 
 (defcustom byte-optimize t
-  "*Enables optimization in the byte compiler.
-nil means don't do any optimization.
-t means do all optimizations.
-`source' means do source-level optimizations only.
-`byte' means do code-level optimizations only."
+  "*Enable optimization in the byte compiler.
+Possible values are:
+  nil      - no optimization
+  t        - all optimizations
+  `source' - source-level optimizations only
+  `byte'   - code-level optimizations only"
   :group 'bytecomp
   :type '(choice (const :tag "none" nil)
                 (const :tag "all" t)
@@ -336,7 +337,7 @@ If it is 'byte, then only byte-level optimizations will be logged."
 (defcustom byte-compile-warnings t
   "*List of warnings that the byte-compiler should issue (t for all).
 
-Elements of the list may be be:
+Elements of the list may be:
 
   free-vars   references to variables not in the current lexical scope.
   unresolved  calls to unknown functions.
@@ -2864,8 +2865,12 @@ That command is designed for interactive use only" fn))
 
 (defmacro byte-compile-get-constant (const)
   `(or (if (stringp ,const)
-          (assoc-default ,const byte-compile-constants
-                         'equal-including-properties nil)
+          ;; In a string constant, treat properties as significant.
+          (let (result)
+            (dolist (elt byte-compile-constants)
+              (if (equal-including-properties (car elt) ,const)
+                  (setq result elt)))
+            result)
         (assq ,const byte-compile-constants))
        (car (setq byte-compile-constants
                  (cons (list ,const) byte-compile-constants)))))
index 666b373..0bacbf1 100644 (file)
@@ -2155,7 +2155,7 @@ before using the Ispell engine on it."
 (defun checkdoc-rogue-space-check-engine (&optional start end interact)
   "Return a message list if there is a line with white space at the end.
 If `checkdoc-autofix-flag' permits, delete that whitespace instead.
-If optional arguments START and END are non nil, bound the check to
+If optional arguments START and END are non-nil, bound the check to
 this region.
 Optional argument INTERACT may permit the user to fix problems on the fly."
   (let ((p (point))
index 332ea81..f37a534 100644 (file)
@@ -256,7 +256,7 @@ Any pair that has the same PREDICATE is first removed."
 
 (defun custom-print-install ()
   "Replace print functions with general, customizable, Lisp versions.
-The emacs subroutines are saved away, and you can reinstall them
+The Emacs subroutines are saved away, and you can reinstall them
 by running `custom-print-uninstall'."
   (interactive)
   (mapcar 'cust-print-set-function-cell
@@ -271,7 +271,7 @@ by running `custom-print-uninstall'."
   t)
 
 (defun custom-print-uninstall ()
-  "Reset print functions to their emacs subroutines."
+  "Reset print functions to their Emacs subroutines."
   (interactive)
   (mapcar 'cust-print-set-function-cell
          '((prin1 cust-print-original-prin1)
@@ -375,7 +375,7 @@ The argument used by %s must be a string or a symbol;
 the argument used by %d, %b, %o, %x or %c must be a number.
 
 This is the custom-print replacement for the standard `format'.  It
-calls the emacs `format' after first making strings for list,
+calls the Emacs `format' after first making strings for list,
 vector, or symbol args.  The format specification for such args should
 be `%s' in any case, so a string argument will also work.  The string
 is generated with `custom-prin1-to-string', which quotes quotable
index b22e49d..de8f0a9 100644 (file)
@@ -500,7 +500,7 @@ found, do widen first and then call NARROWFUN with no args after moving."
                    ,(concat "^No \\(previous\\|next\\) " (regexp-quote name)))
        (defun ,next-sym (&optional count)
         ,(format "Go to the next COUNT'th %s." name)
-        (interactive)
+        (interactive "p")
         (unless count (setq count 1))
         (if (< count 0) (,prev-sym (- count))
           (if (looking-at ,re) (setq count (1+ count)))
@@ -523,7 +523,7 @@ found, do widen first and then call NARROWFUN with no args after moving."
        (put ',next-sym 'definition-name ',base)
        (defun ,prev-sym (&optional count)
         ,(format "Go to the previous COUNT'th %s" (or name base-name))
-        (interactive)
+        (interactive "p")
         (unless count (setq count 1))
         (if (< count 0) (,next-sym (- count))
            (let (was-narrowed)
index 42c5d31..a51493d 100644 (file)
@@ -147,9 +147,9 @@ See the functions `find-function' and `find-variable'."
 
 (defun find-library-name (library)
   "Return the absolute file name of the Lisp source of LIBRARY."
-  ;; Strip off the extension to take advantage of library suffixes in
-  ;; the call to `locate-file'.
-  (if (string-match "\\.el\\(c\\(\\..*\\)?\\)?\\'" library)
+  ;; If the library is byte-compiled, try to find a source library by
+  ;; the same name.
+  (if (string-match "\\.el\\(c\\(\\..*\\)?\\)\\'" library)
       (setq library (replace-match "" t t library)))
   (or (locate-file library
                   (or find-function-source-path load-path)
@@ -264,7 +264,7 @@ not selected.  If the function definition can't be found in
 the buffer, returns (BUFFER).
 
 If the file where FUNCTION is defined is not known, then it is
-searched for in `find-function-source-path' if non nil, otherwise
+searched for in `find-function-source-path' if non-nil, otherwise
 in `load-path'."
   (if (not function)
       (error "You didn't specify a function"))
@@ -357,7 +357,7 @@ places point before the definition.
 Set mark before moving, if the buffer already existed.
 
 The library where FUNCTION is defined is searched for in
-`find-function-source-path', if non nil, otherwise in `load-path'.
+`find-function-source-path', if non-nil, otherwise in `load-path'.
 See also `find-function-recenter-line' and `find-function-after-hook'."
   (interactive (find-function-read))
   (find-function-do-it function nil 'switch-to-buffer))
@@ -387,7 +387,7 @@ the point of the definition.  The buffer is not selected.
 If the variable's definition can't be found in the buffer, return (BUFFER).
 
 The library where VARIABLE is defined is searched for in FILE or
-`find-function-source-path', if non nil, otherwise in `load-path'."
+`find-function-source-path', if non-nil, otherwise in `load-path'."
   (if (not variable)
       (error "You didn't specify a variable")
     (let ((library (or file
@@ -406,7 +406,7 @@ places point before the definition.
 Set mark before moving, if the buffer already existed.
 
 The library where VARIABLE is defined is searched for in
-`find-function-source-path', if non nil, otherwise in `load-path'.
+`find-function-source-path', if non-nil, otherwise in `load-path'.
 See also `find-function-recenter-line' and `find-function-after-hook'."
   (interactive (find-function-read 'defvar))
   (find-function-do-it variable 'defvar 'switch-to-buffer))
@@ -436,7 +436,7 @@ variable, `defface' for a face.  This function does not switch to the
 buffer nor display it.
 
 The library where SYMBOL is defined is searched for in FILE or
-`find-function-source-path', if non nil, otherwise in `load-path'."
+`find-function-source-path', if non-nil, otherwise in `load-path'."
   (cond
    ((not symbol)
     (error "You didn't specify a symbol"))
@@ -461,7 +461,7 @@ places point before the definition.
 Set mark before moving, if the buffer already existed.
 
 The library where FACE is defined is searched for in
-`find-function-source-path', if non nil, otherwise in `load-path'.
+`find-function-source-path', if non-nil, otherwise in `load-path'.
 See also `find-function-recenter-line' and `find-function-after-hook'."
   (interactive (find-function-read 'defface))
   (find-function-do-it face 'defface 'switch-to-buffer))
index 29c70f8..6bc7da7 100644 (file)
@@ -208,22 +208,64 @@ is non-nil.
 
 If variable `beginning-of-defun-function' is non-nil, its value
 is called as a function to find the defun's beginning."
-  (interactive "p")
-  (if beginning-of-defun-function
-      (if (> (setq arg (or arg 1)) 0)
-         (dotimes (i arg)
-           (funcall beginning-of-defun-function))
-       ;; Better not call end-of-defun-function directly, in case
-       ;; it's not defined.
-       (end-of-defun (- arg)))
-    (and arg (< arg 0) (not (eobp)) (forward-char 1))
+  (interactive "p") ; change this to "P", maybe, if we ever come to pass ARG
+                   ; to beginning-of-defun-function.
+  (unless arg (setq arg 1))            ; The call might not be interactive.
+  (cond
+   (beginning-of-defun-function
+    (if (> arg 0)
+       (dotimes (i arg)
+         (funcall beginning-of-defun-function))
+      ;; Better not call end-of-defun-function directly, in case
+      ;; it's not defined.
+      (end-of-defun (- arg))))
+
+   ((or defun-prompt-regexp open-paren-in-column-0-is-defun-start)
+    (and (< arg 0) (not (eobp)) (forward-char 1))
     (and (re-search-backward (if defun-prompt-regexp
                                 (concat (if open-paren-in-column-0-is-defun-start
                                             "^\\s(\\|" "")
                                         "\\(?:" defun-prompt-regexp "\\)\\s(")
                               "^\\s(")
-                            nil 'move (or arg 1))
-        (progn (goto-char (1- (match-end 0)))) t)))
+                            nil 'move arg)
+        (progn (goto-char (1- (match-end 0)))) t))
+
+   (t
+    ;; Column 0 has no significance - so scan forward from BOB to see how
+    ;; nested point is, then carry on from there.
+    (let* ((floor (point-min))
+          (ceiling (point-max))
+          (pps-state (let (syntax-begin-function
+                           font-lock-beginning-of-syntax-function)
+                       (syntax-ppss)))
+          (nesting-depth (nth 0 pps-state)))
+      (save-restriction
+       (widen)
+       ;; Get outside of any string or comment.
+       (if (nth 8 pps-state)
+           (goto-char (nth 8 pps-state)))
+
+       (cond
+        ((> arg 0)
+         (when (> nesting-depth 0)
+           (up-list (- nesting-depth))
+           (setq arg (1- arg)))
+         ;; We're now outside of any defun.
+         (backward-list arg)
+         (if (< (point) floor) (goto-char floor)))
+
+        ((< arg 0)
+         (cond
+          ((> nesting-depth 0)
+           (up-list nesting-depth)
+           (setq arg (1+ arg)))
+          ((not (looking-at "\\s("))
+           ;; We're between defuns, and not at the start of one.
+           (setq arg (1+ arg))))
+         (forward-list (- arg))
+         (down-list)
+         (backward-char)
+         (if (> (point) ceiling) (goto-char ceiling)))))))))
 
 (defvar end-of-defun-function nil
   "If non-nil, function for function `end-of-defun' to call.
index 1d40d2e..5aed482 100644 (file)
@@ -191,7 +191,7 @@ secondary selection instead of the primary selection."
   "If there is a selection, delete the text it covers, and copy it to
 both the kill ring and the Clipboard."
   (interactive)
-  (or (x-selection-owner-p) (error "emacs does not own the primary selection"))
+  (or (x-selection-owner-p) (error "Emacs does not own the primary selection"))
   (setq last-command nil)
   (or primary-selection-extent
       (error "the primary selection is not an extent?"))
@@ -205,7 +205,7 @@ both the kill ring and the Clipboard."
   "If there is a selection, delete the text it covers *without* copying it to
 the kill ring or the Clipboard."
   (interactive)
-  (or (x-selection-owner-p) (error "emacs does not own the primary selection"))
+  (or (x-selection-owner-p) (error "Emacs does not own the primary selection"))
   (setq last-command nil)
   (or primary-selection-extent
       (error "the primary selection is not an extent?"))
@@ -219,7 +219,7 @@ the kill ring or the Clipboard."
   "If there is a selection, copy it to both the kill ring and the Clipboard."
   (interactive)
   (setq last-command nil)
-  (or (x-selection-owner-p) (error "emacs does not own the primary selection"))
+  (or (x-selection-owner-p) (error "Emacs does not own the primary selection"))
   (or primary-selection-extent
       (error "the primary selection is not an extent?"))
   (save-excursion
index a9cb2ab..77f8854 100644 (file)
@@ -161,7 +161,7 @@ Ignores leading comment characters."
     (set-syntax-table stab)
     (if arg
        (insert (pp-to-string (eval exp)))
-      (pp-eval-expression exp))))
+      (pp-eval-expression (eval exp)))))
 
 ;;; Test cases for quote
 ;; (pp-eval-expression ''(quote quote))
index 5dc67e4..cae4be8 100644 (file)
@@ -253,6 +253,7 @@ Except for Lisp syntax this is the same as `reb-regexp'.")
   (kill-all-local-variables)
   (setq major-mode 'reb-mode
         mode-name "RE Builder")
+  (set (make-local-variable 'blink-matching-paren) nil)
   (use-local-map reb-mode-map)
   (reb-mode-common)
   (run-mode-hooks 'reb-mode-hook))
index 52cbc95..931ebf2 100644 (file)
@@ -88,7 +88,7 @@
 
 ;;;###autoload
 (defun regexp-opt (strings &optional paren)
-  "Return a regexp to match a string in STRINGS.
+  "Return a regexp to match a string in the list STRINGS.
 Each string should be unique in STRINGS and should not contain any regexps,
 quoted or not.  If optional PAREN is non-nil, ensure that the returned regexp
 is enclosed by at least one regexp grouping construct.
index 5a2521f..7162aa8 100644 (file)
@@ -184,17 +184,17 @@ and that each of these directories contains a file called XXX.el.  Then
 XXX.el in the site-lisp directory is referred to by all of:
 \(require 'XXX\), \(autoload .... \"XXX\"\), \(load-library \"XXX\"\) etc.
 
-The first XXX.el file prevents emacs from seeing the second \(unless
-the second is loaded explicitly via load-file\).
+The first XXX.el file prevents Emacs from seeing the second \(unless
+the second is loaded explicitly via `load-file'\).
 
 When not intended, such shadowings can be the source of subtle
 problems.  For example, the above situation may have arisen because the
-XXX package was not distributed with versions of emacs prior to
-19.30.  An emacs maintainer downloaded XXX from elsewhere and installed
-it.  Later, XXX was updated and included in the emacs distribution.
-Unless the emacs maintainer checks for this, the new version of XXX
+XXX package was not distributed with versions of Emacs prior to
+19.30.  An Emacs maintainer downloaded XXX from elsewhere and installed
+it.  Later, XXX was updated and included in the Emacs distribution.
+Unless the Emacs maintainer checks for this, the new version of XXX
 will be hidden behind the old \(which may no longer work with the new
-emacs version\).
+Emacs version\).
 
 This function performs these checks and flags all possible
 shadowings.  Because a .el file may exist without a corresponding .elc
index 7a084ad..6fb9e8e 100644 (file)
@@ -1,4 +1,4 @@
-;;; emacs-lock.el --- prevents you from exiting emacs if a buffer is locked
+;;; emacs-lock.el --- prevents you from exiting Emacs if a buffer is locked
 
 ;; Copyright (C) 1994, 1997, 2002, 2003, 2004,
 ;;   2005, 2006 Free Software Foundation, Inc
 ;;; Commentary:
 
 ;; This code sets a buffer-local variable to t if toggle-emacs-lock is run,
-;; then if the user attempts to exit emacs, the locked buffer name will be
+;; then if the user attempts to exit Emacs, the locked buffer name will be
 ;; displayed and the exit aborted.  This is just a way of protecting
 ;; yourself from yourself.  For example, if you have a shell running a big
-;; program and exiting emacs would abort that program, you may want to lock
+;; program and exiting Emacs would abort that program, you may want to lock
 ;; that buffer, then if you forget about it after a while, you won't
-;; accidentally exit emacs.  To unlock the buffer, just goto the buffer and
+;; accidentally exit Emacs.  To unlock the buffer, just goto the buffer and
 ;; run toggle-emacs-lock again.
 
 ;;; Code:
 
 (defvar emacs-lock-from-exiting nil
-  "Whether emacs is locked to prevent exiting.  See `check-emacs-lock'.")
+  "Whether Emacs is locked to prevent exiting.  See `check-emacs-lock'.")
 (make-variable-buffer-local 'emacs-lock-from-exiting)
 
 (defvar emacs-lock-buffer-locked nil
 
 (defun check-emacs-lock ()
   "Check if variable `emacs-lock-from-exiting' is t for any buffer.
-If any t is found, signal error and display the locked buffer name."
-  (let ((buffers (buffer-list)))
-    (save-excursion
-      (while buffers
-       (set-buffer (car buffers))
-       (if emacs-lock-from-exiting
-           (error "Emacs is locked from exit due to buffer: %s" (buffer-name))
-         (setq buffers (cdr buffers)))))))
+If any locked buffer is found, signal error and display the buffer's name."
+  (save-excursion
+    (dolist (buffer (buffer-list))
+      (set-buffer buffer)
+      (when emacs-lock-from-exiting
+       (error "Emacs is locked from exit due to buffer: %s" (buffer-name))))))
 
 (defun toggle-emacs-lock ()
-  "Toggle `emacs-lock-from-exiting' between t and nil for the current buffer.
+  "Toggle `emacs-lock-from-exiting' for the current buffer.
 See `check-emacs-lock'."
   (interactive)
-  (if emacs-lock-from-exiting
-      (setq emacs-lock-from-exiting nil)
-    (setq emacs-lock-from-exiting t))
+  (setq emacs-lock-from-exiting (not emacs-lock-from-exiting))
   (if emacs-lock-from-exiting
       (message "Buffer is now locked")
     (message "Buffer is now unlocked")))
 
 (defun emacs-lock-check-buffer-lock ()
   "Check if variable `emacs-lock-from-exiting' is t for a buffer.
-If t is found, signal error and display the locked buffer name."
-  (if emacs-lock-from-exiting
-      (error "Buffer `%s' is locked, can't delete it" (buffer-name))))
+If the buffer is locked, signal error and display its name."
+  (when emacs-lock-from-exiting
+    (error "Buffer `%s' is locked, can't delete it" (buffer-name))))
 
 ; These next defuns make it so if you exit a shell that is locked,  the lock
-; is shut off for that shell so you can exit emacs.  Same for telnet.
+; is shut off for that shell so you can exit Emacs.  Same for telnet.
 ; Also, if a shell or a telnet buffer was locked and the process killed,
 ; turn the lock back on again if the process is restarted.
 
index 1483898..cee60c6 100644 (file)
 
     Sometimes, edt-mapper will ignore a key you press, and just continue to
     prompt for the same key.  This can happen when your window manager sucks
-    up the key and doesn't pass it on to emacs, or it could be an emacs bug.
+    up the key and doesn't pass it on to Emacs, or it could be an Emacs bug.
     Either way, there's nothing that edt-mapper can do about it.  You must
     press RETURN, to skip the current key and continue.  Later, you and/or
     your local system guru can try to figure out why the key is being ignored.
index 878ac56..5d90728 100644 (file)
@@ -432,7 +432,7 @@ CSI is DEC's name for the sequence <ESC>[.")
   (let ((map (make-keymap)))
     (define-key map "\e[" GOLD-CSI-map)                  ; GOLD-CSI map
     (define-key map "\eO" GOLD-SS3-map)                  ; GOLD-SS3 map
-    ;; 
+    ;;
     (define-key map "\C-A" 'tpu-toggle-overwrite-mode)   ; ^A
     (define-key map "\C-B" 'nil)                         ; ^B
     (define-key map "\C-C" 'nil)                         ; ^C
@@ -557,7 +557,7 @@ GOLD is the ASCII 7-bit escape sequence <ESC>OP.")
 (defvar SS3-map
   (let ((map (make-sparse-keymap)))
     (define-key map "P" GOLD-map)                         ; GOLD map
-    ;; 
+    ;;
     (define-key map "A" 'tpu-previous-line)               ; up
     (define-key map "B" 'tpu-next-line)                   ; down
     (define-key map "C" 'tpu-forward-char)                ; right
@@ -1141,7 +1141,7 @@ This is useful for inserting control characters."
        R     Toggle rectangular mode for remove and insert
        S     Search and substitute - line mode REPLACE command
 
-      ^T     Toggle control key bindings between TPU and emacs
+      ^T     Toggle control key bindings between TPU and Emacs
        U     Undo - undo the last edit
        W     Write - save current buffer
        X     Exit - save all modified buffers and exit
@@ -1292,7 +1292,7 @@ kills modified buffers without asking."
   (kill-buffer (current-buffer)))
 
 (defun tpu-save-all-buffers-kill-emacs nil
-  "Save all buffers and exit emacs."
+  "Save all buffers and exit Emacs."
   (interactive)
   (let ((delete-old-versions t))
     (save-buffers-kill-emacs t)))
@@ -1852,8 +1852,8 @@ A negative argument means replace all occurrences of the search string."
     (message "Replaced %s occurrence%s." strings (if (not (= 1 strings)) "s" ""))))
 
 (defun tpu-emacs-replace (&optional dont-ask)
-  "A TPU-edt interface to the emacs replace functions.  If TPU-edt is
-currently in regular expression mode, the emacs regular expression
+  "A TPU-edt interface to the Emacs replace functions.  If TPU-edt is
+currently in regular expression mode, the Emacs regular expression
 replace functions are used.  If an argument is supplied, replacements
 are performed without asking.  Only works in forward direction."
   (interactive "P")
@@ -2285,7 +2285,7 @@ Accepts a prefix argument for the number of tpu-pan-columns to scroll."
   (setq tpu-control-keys t))
 
 (defun tpu-reset-control-keys (tpu-style)
-  "Set control keys to TPU or emacs style functions."
+  "Set control keys to TPU or Emacs style functions."
   (let* ((tpu   (and tpu-style (not tpu-control-keys)))
         (emacs (and (not tpu-style) tpu-control-keys))
         (doit  (or tpu emacs)))
index 227fe88..8b51097 100644 (file)
@@ -45,7 +45,7 @@
 ;; external variables
 
 (defvar vip-emacs-local-map nil
-  "Local map used in emacs mode.  (Buffer-specific.)")
+  "Local map used in Emacs mode.  (Buffer-specific.)")
 
 (defvar vip-insert-local-map nil
   "Local map used in insert command mode.  (Buffer-specific.)")
@@ -447,7 +447,7 @@ Type `n' to quit this window for now.\n")
   (vip-change-mode 'insert-mode))
 
 (defun vip-change-mode-to-emacs ()
-  "Change mode to emacs mode."
+  "Change mode to Emacs mode."
   (interactive)
   (vip-change-mode 'emacs-mode))
 
index 465f6e5..bf85d28 100644 (file)
@@ -438,7 +438,7 @@ delete the text being replaced, as in standard Vi."
 ;; confused in some cases. So, this var is nulled for now.
 ;; (defcustom viper-emacs-state-cursor-color "Magenta"
 (defcustom viper-emacs-state-cursor-color nil
-  "Cursor color when Viper is in emacs state."
+  "Cursor color when Viper is in Emacs state."
   :type 'string
   :group 'viper)
 (if (fboundp 'make-variable-frame-local)
index 6f9ade2..8eeb5b4 100644 (file)
@@ -144,7 +144,7 @@ viper-insert-basic-map.  Not recommended, except for novice users.")
   "Auxiliary map for global user-defined bindings in Emacs state.")
 
 (defvar  viper-emacs-kbd-map  (make-sparse-keymap)
-  "This keymap keeps Vi-style kbd macros for emacs mode.")
+  "This keymap keeps Vi-style kbd macros for Emacs mode.")
 
 (viper-deflocalvar viper-emacs-local-user-map  (make-sparse-keymap)
   "Auxiliary map for local user-defined bindings in Emacs state.")
@@ -160,10 +160,10 @@ viper-insert-basic-map.  Not recommended, except for novice users.")
 
 ;; Some important keys used in viper
 (defcustom viper-toggle-key [(control ?z)]  ; "\C-z"
-  "The key used to change states from emacs to Vi and back.
+  "The key used to change states from Emacs to Vi and back.
 In insert mode, this key also functions as Meta.
 
-Enter as a sexp. Examples: \"\\C-z\", [(control ?z)]."
+Enter as a sexp.  Examples: \"\\C-z\", [(control ?z)]."
   :type 'sexp
   :group 'viper
   :set (lambda (symbol value)
index 82c070d..fd1a8aa 100644 (file)
@@ -359,7 +359,7 @@ user decide when to invoke Viper in a major mode."
 (defcustom viper-mode (cond (noninteractive nil)
                            (t 'ask))
   "To Viperize or not to Viperize.
-If t, viperize emacs.  If nil -- don't.  If `ask', ask the user.
+If t, viperize Emacs.  If nil -- don't.  If `ask', ask the user.
 This variable is used primatily when Viper is being loaded.
 
 Must be set in `~/.emacs' before Viper is loaded.
@@ -502,10 +502,10 @@ unless it is coming up in a wrong Viper state."
 The list has the structure: ((mode viper-state keymap) (mode viper-state
 keymap) ...).  If `mode' is on the list, the `kemap' will be made active (on
 the minor-mode-map-alist) in the specified viper state.
-If you change this list, have to restart emacs for the change to take effect.
-However, if you did the change through the customization widget, then emacs
+If you change this list, have to restart Emacs for the change to take effect.
+However, if you did the change through the customization widget, then Emacs
 needs to be restarted only if you deleted a triple mode-state-keymap from the
-list.  No need to restart emacs in case of insertion or modification of an
+list.  No need to restart Emacs in case of insertion or modification of an
 existing triple."
   :type '(repeat
          (list symbol
@@ -891,7 +891,7 @@ It also can't undo some Viper settings."
   (eval-after-load
    "passwd"
    '(defadvice read-passwd-1 (before viper-passwd-ad activate)
-      "Switch to emacs state while reading password."
+      "Switch to Emacs state while reading password."
       (viper-change-state-to-emacs)))
 
   (defadvice self-insert-command (around viper-self-insert-ad activate)
@@ -939,7 +939,7 @@ It also can't undo some Viper settings."
   (eval-after-load
    "rmailedit"
    '(defadvice rmail-cease-edit (after viper-rmail-advice activate)
-      "Switch to emacs state when done editing message."
+      "Switch to Emacs state when done editing message."
       (viper-change-state-to-emacs)))
   ;; In case RMAIL was loaded before Viper.
   (defadvice rmail-cease-edit (after viper-rmail-advice activate)
@@ -1121,7 +1121,7 @@ It also can't undo some Viper settings."
        (save-window-excursion
         (with-output-to-temp-buffer " *viper-info*"
           (princ "
-You have loaded Viper, and are about to Viperize your emacs!
+You have loaded Viper, and are about to Viperize your Emacs!
 
 Viper is a Package for Emacs Rebels and a venomous VI PERil,
 
index 72754aa..dfb6fc7 100644 (file)
@@ -1,8 +1,228 @@
+2006-11-28  Juanma Barranquero  <lekktu@gmail.com>
+
+       * erc.el (erc-cmd-BANLIST, erc-cmd-MASSUNBAN): Simplify.
+       (erc-prompt-for-channel-key, erc-ignore-reply-list, erc-send-post-hook)
+       (erc-active-buffer, erc-join-buffer, erc-frame-alist, erc-with-buffer)
+       (erc-modules, erc-display-message-highlight, erc-process-input-line)
+       (erc-cmd-HELP, erc-server-hooks, erc-echo-notice-in-user-buffers)
+       (erc-format-my-nick, erc-echo-notice-in-user-and-target-buffers)
+       (erc-echo-notice-in-first-user-buffer, erc-connection-established)
+       (erc-update-user-nick, erc-update-channel-member, erc-highlight-notice)
+       (erc-command-symbol, erc-add-query, erc-process-script-line)
+       (erc-determine-parameters, erc-client-info, erc-popup-input-buffer):
+       (erc-script-echo): Fix typos in docstrings.
+       (erc-channel-user-op-p, erc-channel-user-voice-p, erc-startup-file-list)
+       (define-erc-module, erc-once-with-server-event)
+       (erc-once-with-server-event-global, erc-debug-irc-protocol)
+       (erc-log-irc-protocol, erc-cmd-LOAD, erc-update-user)
+       (erc-update-current-channel-member, erc-load-script):
+       (erc-mode-line-away-status-format): Doc fixes.
+
+2006-11-24  Juanma Barranquero  <lekktu@gmail.com>
+
+       * erc.el (erc-after-connect, erc-open-ssl-stream)
+       (erc-display-line-1, erc-display-line):
+       * erc-backend.el (005): Fix space/tab mixup in docstrings.
+
+2006-11-20  Michael Olson  <mwolson@gnu.org>
+
+       * erc.el (erc-version-string): Call this Version 5.2 stable
+       pre-release, since it diverges slightly from our 5.2 branch, in
+       that unstable features are not included.
+       (erc-update-modules): Display better error message when module not
+       found.
+
+2006-11-12  Michael Olson  <mwolson@gnu.org>
+
+       * erc-log.el: Save all log buffers when Emacs exits, in case
+       someone ignores the warning about open processes.  Remove the
+       advice code in the commentary.
+       (erc-save-query-buffers): Docfix.
+       (erc-log-save-all-buffers): New function that saves all ERC
+       buffers to logs.
+       (erc-current-logfile): Fix bug in filename selection, where the
+       current buffer was erroneously being preferred over the given
+       buffer.
+
+2006-11-08  Michael Olson  <mwolson@gnu.org>
+
+       * erc.el (erc-string-to-port): Avoid error when a numerical port
+       is passed.  Thanks to Zekeriya KOÇ for the report.
+
+2006-11-08  Łukasz Demianiuk  <ldemianiuk@gmail.com>  (tiny change)
+
+       * erc.el (erc-header-line): Fix typo.
+
+2006-11-06  Juanma Barranquero  <lekktu@gmail.com>
+
+       * erc-dcc.el (erc-dcc-send-file): Fix typo in error message.
+
+       * erc.el (read-passwd):
+       * erc-autoaway.el (erc-autoaway-reestablish-idletimer):
+       * erc-truncate.el (truncate): Fix typo in docstring.
+
+2006-10-21  Michael Olson  <mwolson@gnu.org>
+
+       * erc.el (erc-iswitchb): Fix bug when hitting C-c C-b without
+       first loading iswitchb.  Thanks to Leo for the report.
+
+2006-10-10  Michael Olson  <mwolson@gnu.org>
+
+       * erc.el (erc-default-port): Make the default be 6667 instead of
+       ircd. since Mac OS X apparently has problems with looking up that
+       port name.
+
+       * erc-backend.el (353): Receive names after displaying the initial
+       message, instead of before.
+
+2006-10-05  Diane Murray  <disumu@x3y2z1.net>
+
+       * erc.el (erc-my-nick-face): New face.
+       (erc): Use FULL-NAME argument, not `erc-user-full-name'.  This
+       fixes a bug where the :full-name argument passed to the function
+       was not respected.
+       (erc-format-my-nick): Use `erc-my-nick-face'.  This should help
+       make it easier to find messages you sent in conversations when
+       `erc-show-my-nick' is non-nil.
+       (erc-compute-server): Doc fix.
+
+2006-09-11  Michael Olson  <mwolson@gnu.org>
+
+       * erc-nicklist.el (erc-nicklist-insert-contents): Add missing
+       parenthesis.  Thanks to Stephan Stahl for the report.
+
+2006-09-10  Eric Hanchrow  <offby1@blarg.net>
+
+       * erc.el (erc-cmd-IGNORE): Prompt user if this might be a regexp
+       instead of a single user.
+
+2006-09-10  Michael Olson  <mwolson@gnu.org>
+
+       * erc.el (erc-generate-new-buffer-name): If this is a server
+       buffer and a process exists already, create a new buffer.
+       (erc-open): If the IRC session was continued, restore the old
+       point.  Thanks to Stephan Stahl for the report.
+       (erc-member-ignore-case): Coding style tweak.
+       (erc-cmd-UNIGNORE): Quote the user before comparison.  If we don't
+       find the user listed verbatim, try to match them against the list
+       using string-match.  In this case, prompt as to whether the regexp
+       should be removed.
+       (erc-ignored-user-p): Remove CL-ism.
+
+       * erc-autoaway.el (erc-autoaway-possibly-set-away): Check to see
+       whether we are already away.
+
+       * erc-menu.el: Fix potential compiler warning.
+
+2006-09-07  Diane Murray  <disumu@x3y2z1.net>
+
+       * erc.el: Updated Commentary and URL.
+       (erc-iswitchb, erc-display-line, erc-set-modes, erc-update-modes)
+       (erc-arrange-session-in-multiple-windows): No need to check if
+       `erc-server-process' is bound.
+       (erc-server-buffer-live-p): Doc fix.
+       (erc-part-from-channel): Don't use any initial contents at prompt.
+       (erc-format-nick, erc-format-@nick): Doc fix.  Use `when'.
+       (s367): Fixed to support only banmask and channel which is the
+       standard.  Also, there's no reason to add a message to each banned
+       user entry trying to persuade the user to use /banlist instead of
+       /mode #channel +b.  That part of the message was a little
+       confusing, anyways.
+       (s367-set-by): New catalog entry.  The user who set the ban and
+       the time of ban seem to be specific to only certain servers such
+       as freenode.
+
+       * erc-autoaway.el (erc-autoaway-idletimer): Doc fix.
+
+       * erc-backend.el (erc-server-process-alive): No need to check if
+       `erc-server-process' is bound.
+       (367): Use s367 or s367-set-by where appropriate.
+
+       * erc-compat.el: Fixed URL.
+
+       * erc-dcc.el: Updated copyright years.  Added Usage section.
+       Changed supported Emacs version number from 21.3.50 to 22 in
+       Commentary.
+
+       * erc-ibuffer.el (erc-server-name, erc-target, erc-away): No need
+       to check if `erc-server-process' is bound.
+
+       * erc-nicklist.el: Added to the Commentary section an explanation
+       that `erc-nicklist-quit' should be called from within the nicklist
+       buffer.  Set file coding to utf-8 so a contributor's name is
+       displayed correctly.
+       (erc-nicklist-icons-directory): Use customize type directory
+       instead of string.
+       (erc-nicklist-insert-contents): Set bbdb-nick to an empty string
+       if it wasn't found.  This fixes a bug where an error would occur
+       when using `string=' on bbdb-nick if it was nil.
+
+       * erc-replace.el: Removed URL from file information since it
+       doesn't exist.
+
+       * erc-sound.el: Updated copyright years.  Fixed Commentary and
+       added Usage section.
+       (define-erc-module): Add and remove `erc-ctcp-query-SOUND' to
+       `erc-ctcp-query-SOUND-hook' here.  Removed the keybinding
+       definitions.
+       (erc-play-sound, erc-default-sound, erc-cmd-SOUND)
+       (erc-ctcp-query-SOUND): Doc fix.
+       (erc-play-command): Removed, not necessary anymore.
+       (erc-ctcp-query-SOUND-hook): Set to nil as default.  Moved up
+       higher in code, added docstring.
+       (erc-play-sound): Use `play-sound-file'.  It exists in GNU Emacs
+       as well since version 21 or earlier.  Removed commented-out older
+       version of function.
+
+       * NEWS: Fixed formatting, added channel tracking change.
+
+2006-09-03  Diane Murray  <disumu@x3y2z1.net>
+
+       * erc.el: M-x erc RET can now be used to start ERC.
+       (erc-open): Renamed from `erc'.
+       (erc-before-connect): Change erc-select to erc.
+       (erc): Renamed from `erc-select'.  Use `erc-open'.
+       (erc-select): Defined as alias of `erc'.
+       (erc-ssl): Renamed from `erc-select-ssl'.  Use `erc'.
+       (erc-select-ssl): Defined as alias of `erc-ssl'.
+       (erc-cmd-SERVER): Use `erc'.
+       (erc-query, erc-handle-irc-url): Use `erc-open'.
+
+       * erc-backend.el (erc-process-sentinel-1, JOIN): Use `erc-open'.
+
+       * erc-menu.el (erc-menu-definition): Use `erc'.
+
+       * erc-networks.el: Updated copyright years.
+       (erc-server-select): Use keyword arguments when calling `erc'.
+
+       * erc.texi (Getting Started, Connecting): Changed erc-select to
+       erc.
+
+       * NEWS: Added note about these changes.
+
+2006-08-21  Diane Murray  <disumu@x3y2z1.net>
+
+       * erc-track.el (erc-track-mode-line-mouse-face): New variable.
+       (erc-make-mode-line-buffer-name): Add help-echo and mouse-face
+       properties to channel name.
+
+2006-08-14  Diane Murray  <disumu@x3y2z1.net>
+
+       * erc-menu.el: Updated copyright years.  Removed EmacsWiki URL.
+       (erc-menu-definition): Name the menu "ERC" instead of "IRC" to
+       avoid confusion with rcirc and other clients.
+
 2006-08-13  Romain Francoise  <romain@orebokech.com>
 
        * erc-match.el (erc-log-matches-make-buffer): End `y-or-n-p'
        prompt with a space.
 
+2006-08-11  Michael Olson  <mwolson@gnu.org>
+
+       * erc-fill.el (erc-fill): Skip any initial empty lines so that we
+       avoid errors when inserting disconnect messages and other messages
+       that begin with newlines.
+
 2006-08-07  Michael Olson  <mwolson@gnu.org>
 
        * erc-backend.el (erc-process-sentinel-1): Use erc-display-message
 
 2006-08-06  Michael Olson  <mwolson@gnu.org>
 
+       * erc-backend.el (erc-server-send-queue): Update from Circe
+       version of this function.
+
        * erc.el (erc-arrange-session-in-multiple-windows): Fix bug with
        multi-tty Emacs.
        (erc-select-startup-file): Fix bug introduced by recent change.
 
 2006-05-01  Edward O'Connor  <ted@oconnor.cx>
 
-       * erc-goodies.el: (erc-handle-irc-url): New function, suitable as
+       * erc-goodies.el (erc-handle-irc-url): New function, suitable as
        a value for `url-irc-function'.
 
 2006-04-18  Diane Murray  <disumu@x3y2z1.net>
 
 2006-02-12  Michael Olson  <mwolson@gnu.org>
 
-       * erc-autoaway.el, erc-dcc.el, erc-ezbounce.el, erc-fill.el,
-       erc-goodies.el, erc-hecomplete.el, erc-ibuffer.el, erc-identd.el,
-       erc-imenu.el, erc-join.el, erc-lang.el, erc-list.el, erc-log.el,
-       erc-match.el, erc-menu.el, erc-netsplit.el, erc-networks.el,
-       erc-notify.el, erc-page.el, erc-pcomplete.el, erc-replace.el,
-       erc-ring.el, erc-services.el, erc-sound.el, erc-speedbar.el,
-       erc-spelling.el, erc-track.el, erc-truncate.el, erc-xdcc.el: Add
-       2006 to copyright years, to comply with the changed guidelines.
+       * erc-autoaway.el, erc-dcc.el, erc-ezbounce.el, erc-fill.el
+       * erc-goodies.el, erc-hecomplete.el, erc-ibuffer.el, erc-identd.el
+       * erc-imenu.el, erc-join.el, erc-lang.el, erc-list.el, erc-log.el
+       * erc-match.el, erc-menu.el, erc-netsplit.el, erc-networks.el
+       * erc-notify.el, erc-page.el, erc-pcomplete.el, erc-replace.el
+       * erc-ring.el, erc-services.el, erc-sound.el, erc-speedbar.el
+       * erc-spelling.el, erc-track.el, erc-truncate.el, erc-xdcc.el:
+       Add 2006 to copyright years, to comply with the changed guidelines.
 
 2006-02-11  Michael Olson  <mwolson@gnu.org>
 
 
 2006-01-29  Edward O'Connor  <ted@oconnor.cx>
 
-       * erc-viper.el: Remove. Now that ERC is included in Emacs, these
+       * erc-viper.el: Remove.  Now that ERC is included in Emacs, these
        work-arounds live in Viper itself.
 
 2006-01-28  Michael Olson  <mwolson@gnu.org>
 2006-01-22  Johan Bockgård  <bojohan@users.sourceforge.net>
 
        * erc-track.el: Use `(eval-when-compile (require 'cl))' (for
-       `case'). Doc fixes.
+       `case').  Doc fixes.
        (erc-find-parsed-property): Simplify.
-       (erc-track-get-active-buffer): Fix logic. Simplify.
-       (erc-track-switch-buffer): Remove unused variable `dir'. Simplify.
+       (erc-track-get-active-buffer): Fix logic.  Simplify.
+       (erc-track-switch-buffer): Remove unused variable `dir'.  Simplify.
 
        * erc-speak.el: Doc fixes.
        (erc-speak-region): `propertize' --> `erc-propertize'.
@@ -863,6 +1086,7 @@ See ChangeLog.05 for earlier changes.
 
 ;; Local Variables:
 ;; coding: utf-8
+;; add-log-time-zone-rule: t
 ;; End:
 
 ;; arch-tag: 865a75f6-2bcb-46df-bf0c-b514dadf688a
index 4614bd7..dcb6bc0 100644 (file)
@@ -38,7 +38,7 @@ yourself back when you type something."
 
 (defvar erc-autoaway-idletimer nil
   "The Emacs idletimer.
-This is only used when `erc-autoaway-use-emacs-idle' is non-nil.")
+This is only used when `erc-autoaway-idle-method' is set to 'emacs.")
 
 ;;;###autoload (autoload 'erc-autoaway-mode "erc-autoaway")
 (define-erc-module autoaway nil
@@ -136,7 +136,7 @@ See `erc-auto-discard-away'."
 (eval-when-compile (defvar erc-autoaway-idle-seconds))
 
 (defun erc-autoaway-reestablish-idletimer ()
-  "Reestablish the emacs idletimer.
+  "Reestablish the Emacs idletimer.
 If `erc-autoaway-idle-method' is 'emacs, you must call this
 function each time you change `erc-autoaway-idle-seconds'."
   (interactive)
@@ -206,6 +206,7 @@ exceeds `erc-autoaway-idle-seconds'."
   ;; this function is called from `erc-timer-hook', which is called
   ;; whenever the server sends something to the client.
   (when (and erc-auto-set-away
+            (not erc-autoaway-caused-away)
             (not (erc-away-p)))
     (let ((idle-time (erc-time-diff erc-autoaway-last-sent-time
                                    current-time)))
index 5acbcb0..82934f9 100644 (file)
@@ -416,7 +416,7 @@ Currently this is called by `erc-send-input'."
 
 (defun erc-server-process-alive ()
   "Return non-nil when `erc-server-process' is open or running."
-  (and (boundp 'erc-server-process)
+  (and erc-server-process
        (processp erc-server-process)
        (memq (process-status erc-server-process) '(run open))))
 
@@ -512,8 +512,8 @@ action."
              (not (string-match "^failed with code 111" event)))
         ;; Yuck, this should perhaps funcall
         ;; erc-server-reconnect-function with no args
-        (erc erc-session-server erc-session-port erc-server-current-nick
-             erc-session-user-full-name t erc-session-password)
+        (erc-open erc-session-server erc-session-port erc-server-current-nick
+                  erc-session-user-full-name t erc-session-password)
       ;; terminate, do not reconnect
       (erc-display-message nil 'error (current-buffer)
                            'terminated ?e event))))
@@ -673,7 +673,8 @@ protection algorithm."
               (error nil)))))
       (when erc-server-flood-queue
         (setq erc-server-flood-timer
-              (run-at-time 2 nil #'erc-server-send-queue buffer))))))
+              (run-at-time (+ 0.2 erc-server-flood-penalty)
+                           nil #'erc-server-send-queue buffer))))))
 
 (defun erc-message (message-command line &optional force)
   "Send LINE to the server as a privmsg or a notice.
@@ -1038,11 +1039,11 @@ add things to `%s' instead."
         (let* ((str (cond
                      ;; If I have joined a channel
                      ((erc-current-nick-p nick)
-                      (setq buffer (erc erc-session-server erc-session-port
-                                        nick erc-session-user-full-name
-                                        nil nil
-                                        erc-default-recipients chnl
-                                        erc-server-process))
+                      (setq buffer (erc-open erc-session-server erc-session-port
+                                             nick erc-session-user-full-name
+                                             nil nil
+                                             erc-default-recipients chnl
+                                             erc-server-process))
                       (when buffer
                         (set-buffer buffer)
                         (erc-add-default-channel chnl)
@@ -1225,7 +1226,7 @@ add things to `%s' instead."
         (when buffer
           (with-current-buffer buffer
             ;; update the chat partner info.  Add to the list if private
-            ;; message.         We will accumulate private identities indefinitely
+            ;; message.  We will accumulate private identities indefinitely
             ;; at this point.
             (erc-update-channel-member (if privp nick tgt) nick nick
                                        privp nil nil host login nil nil t)
@@ -1340,7 +1341,7 @@ add things to `%s' instead."
 According to RFC 2812, suggests alternate servers on the network.
 Many servers, however, use this code to show which parameters they have set,
 for example, the network identifier, maximum allowed topic length, whether
-certain commands are accepted and more.         See documentation for
+certain commands are accepted and more.  See documentation for
 `erc-server-parameters' for more information on the parameters sent.
 
 A server may send more than one 005 message."
@@ -1583,11 +1584,11 @@ See `erc-display-server-message'." nil
   "NAMES notice." nil
   (let ((channel (third (erc-response.command-args parsed)))
         (users (erc-response.contents parsed)))
-    (erc-with-buffer (channel proc)
-      (erc-channel-receive-names users))
     (erc-display-message parsed 'notice (or (erc-get-buffer channel proc)
                                             'active)
-                         's353 ?c channel ?u users)))
+                         's353 ?c channel ?u users)
+    (erc-with-buffer (channel proc)
+      (erc-channel-receive-names users))))
 
 (define-erc-response-handler (366)
   "End of NAMES." nil
@@ -1598,11 +1599,16 @@ See `erc-display-server-message'." nil
   "Channel ban list entries" nil
   (multiple-value-bind (channel banmask setter time)
       (cdr (erc-response.command-args parsed))
-    (erc-display-message parsed 'notice 'active 's367
-                         ?c channel
-                         ?b banmask
-                         ?s setter
-                         ?t time)))
+    ;; setter and time are not standard
+    (if setter
+        (erc-display-message parsed 'notice 'active 's367-set-by
+                             ?c channel
+                             ?b banmask
+                             ?s setter
+                             ?t (or time ""))
+      (erc-display-message parsed 'notice 'active 's367
+                           ?c channel
+                           ?b banmask))))
 
 (define-erc-response-handler (368)
   "End of channel ban list" nil
index 2a06fa9..9d652b2 100644 (file)
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
 
 ;; Author: Alex Schroeder <alex@gnu.org>
-;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?EmacsIRCClient
+;; URL: http://www.emacswiki.org/cgi-bin/wiki/ERC
 
 ;; This file is part of GNU Emacs.
 
index 4b9172f..1b5111e 100644 (file)
@@ -35,7 +35,9 @@
 ;; rewritten to support the way how ERC operates.  Server socket support
 ;; was added for DCC CHAT and SEND afterwards.  Thanks
 ;; to the original authors for their work.
-;;
+
+;;; Usage:
+
 ;; To use this file, put
 ;;  (require 'erc-dcc)
 ;; in your .emacs.
@@ -49,7 +51,7 @@
 ;;  /dcc send nick file - Offer DCC SEND to nick
 ;;
 ;; Please note that offering DCC connections (offering chats and sending
-;; files) is only supported with Emacs 21.3.50 (CVS).
+;; files) is only supported with Emacs 22.
 
 ;;; Code:
 
@@ -808,7 +810,7 @@ other client."
                        (erc-ip-to-decimal (nth 0 contact))
                        (nth 1 contact)
                        size)))
-    (error "`make-network-process' not supported by your emacs.")))
+    (error "`make-network-process' not supported by your Emacs")))
 
 ;;; GET handling
 
index 6a5f80f..9552ce8 100644 (file)
@@ -122,7 +122,15 @@ characters. Set to nil to disable."
 You can put this on `erc-insert-modify-hook' and/or `erc-send-modify-hook'."
   (unless (erc-string-invisible-p (buffer-substring (point-min) (point-max)))
     (when erc-fill-function
-      (funcall erc-fill-function))))
+      ;; skip initial empty lines
+      (goto-char (point-min))
+      (save-match-data
+        (while (and (looking-at "[ \t\n]*$")
+                    (= (forward-line 1) 0))))
+      (unless (eobp)
+        (save-restriction
+          (narrow-to-region (point) (point-max))
+          (funcall erc-fill-function))))))
 
 (defun erc-fill-static ()
   "Fills a text such that messages start at column `erc-fill-static-center'."
index 7ca843d..24eb2f0 100644 (file)
     " "))
 
 (define-ibuffer-column erc-server-name (:name "Server")
-  (if (and (boundp 'erc-server-process) (processp erc-server-process))
+  (if (and erc-server-process (processp erc-server-process))
       (with-current-buffer (process-buffer erc-server-process)
        (or erc-server-announced-name erc-session-server))
     ""))
 
 (define-ibuffer-column erc-target (:name "Target")
   (if (eq major-mode 'erc-mode)
-      (cond ((and (boundp 'erc-server-process) (processp erc-server-process)
+      (cond ((and erc-server-process (processp erc-server-process)
                  (eq (current-buffer) (process-buffer erc-server-process)))
             (concat "Server " erc-session-server ":"
                     (erc-port-to-string erc-session-port)))
     ""))
 
 (define-ibuffer-column erc-away (:name "A")
-  (if (and (boundp 'erc-server-process)
+  (if (and erc-server-process
           (processp erc-server-process)
           (with-current-buffer (process-buffer erc-server-process)
             erc-away))
index 2fe29e8..bd4ed33 100644 (file)
 ;;
 ;; (require 'erc-log)
 ;;
-;; You may optionally want the following code, to save all ERC buffers
-;; without confirmation when exiting emacs:
-;;
-;; (defadvice save-buffers-kill-emacs (before save-logs (&rest args) activate)
-;;  (save-some-buffers t (lambda ()
-;;                         (when (and (eq major-mode 'erc-mode)
-;;                                    (not (null buffer-file-name))) t))))
-;;
 ;; If you only want to save logs for some buffers, customise the
 ;; variable `erc-enable-logging'.
 
@@ -213,6 +205,7 @@ also be a predicate function. To only log when you are not set away, use:
      (add-hook 'erc-send-post-hook 'erc-save-buffer-in-logs))
    (add-hook 'erc-kill-buffer-hook 'erc-save-buffer-in-logs)
    (add-hook 'erc-kill-channel-hook 'erc-save-buffer-in-logs)
+   (add-hook 'kill-emacs-hook 'erc-log-save-all-buffers)
    (add-hook 'erc-quit-hook 'erc-conditional-save-queries)
    (add-hook 'erc-part-hook 'erc-conditional-save-buffer)
    ;; append, so that 'erc-initialize-log-marker runs first
@@ -225,6 +218,7 @@ also be a predicate function. To only log when you are not set away, use:
    (remove-hook 'erc-send-post-hook 'erc-save-buffer-in-logs)
    (remove-hook 'erc-kill-buffer-hook 'erc-save-buffer-in-logs)
    (remove-hook 'erc-kill-channel-hook 'erc-save-buffer-in-logs)
+   (remove-hook 'kill-emacs-hook 'erc-log-save-all-buffers)
    (remove-hook 'erc-quit-hook 'erc-conditional-save-queries)
    (remove-hook 'erc-part-hook 'erc-conditional-save-buffer)
    (remove-hook 'erc-connect-pre-hook 'erc-log-setup-logging)
@@ -263,7 +257,7 @@ Returns nil iff `erc-server-buffer-p' returns t."
       (not (erc-server-buffer-p)))))
 
 (defun erc-save-query-buffers (process)
-  "Save all buffers process."
+  "Save all buffers of the given PROCESS."
   (erc-with-all-buffers-of-server process
                                  nil
                                  (erc-save-buffer-in-logs)))
@@ -278,6 +272,12 @@ Returns nil iff `erc-server-buffer-p' returns t."
   (when erc-save-queries-on-quit
     (erc-save-query-buffers process)))
 
+;; Make sure that logs get saved, even if someone overrides the active
+;; process prompt for a quick exit from Emacs
+(defun erc-log-save-all-buffers ()
+  (dolist (buffer (erc-buffer-list))
+    (erc-save-buffer-in-logs buffer)))
+
 ;;;###autoload
 (defun erc-logging-enabled (&optional buffer)
   "Return non-nil if logging is enabled for BUFFER.
@@ -309,7 +309,7 @@ The result is converted to lowercase, as IRC is case-insensitive"
    (erc-log-standardize-name
     (funcall erc-generate-log-file-name-function
             (or buffer (current-buffer))
-            (or (erc-default-target) (buffer-name buffer))
+            (or (buffer-name buffer) (erc-default-target))
             (erc-current-nick)
             erc-session-server erc-session-port))
    erc-log-channels-directory))
index 7040a7b..a2dc7a1 100644 (file)
@@ -4,7 +4,6 @@
 
 ;; Author: Mario Lang <mlang@delysid.org>
 ;; Keywords: comm, processes, menu
-;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcMenu
 
 ;; This file is part of GNU Emacs.
 
 
 ;;; Code:
 
+;(require 'erc)
 (require 'easymenu)
 
 (defvar erc-menu-definition
-  (list "IRC"
-       ["Connect to server..." erc-select t]
+  (list "ERC"
+       ["Connect to server..." erc t]
        ["Disconnect from server..." erc-quit-server erc-server-connected]
        "-"
        ["List channels..." erc-list-channels
index c15f72e..99aba31 100644 (file)
@@ -809,7 +809,7 @@ As an example:
                    (erc-ports-list (nth 3 srv))
                  (list (nth 3 srv))))
         (port (nth (random (length ports)) ports)))
-    (erc host port erc-nick erc-user-full-name t)))
+    (erc :server host :port port)))
 
 ;;; The following experimental
 ;; It does not work yet, help me with it if you
index 5599565..7a94d2b 100644 (file)
@@ -29,7 +29,7 @@
 ;; This provides a minimal mIRC style nicklist buffer for ERC.  To
 ;; activate, do M-x erc-nicklist RET in the channel buffer you want
 ;; the nicklist to appear for.  To close and quit the nicklist
-;; buffer, do M-x erc-nicklist-quit RET.
+;; buffer, do M-x erc-nicklist-quit RET from within the nicklist buffer.
 ;;
 ;; TODO:
 ;; o Somehow associate nicklist windows with channel windows so they
@@ -97,7 +97,7 @@ By \"chat medium\", we mean IRC, AOL, MSN, ICQ, etc."
   "*Directory of the PNG files for chat icons.
 Icons are displayed if `erc-nicklist-use-icons' is non-nil."
   :group 'erc-nicklist
-  :type 'string)
+  :type 'directory)
 
 (defcustom erc-nicklist-voiced-position 'bottom
   "*Position of voiced nicks in the nicklist.
@@ -207,7 +207,9 @@ Seach for the BBDB record of this contact.  If not found, return nil."
           (channels (erc-server-user-buffers server-user))
           (op       (erc-channel-user-op channel-user))
           (voice    (erc-channel-user-voice channel-user))
-          (bbdb-nick (erc-nicklist-search-for-nick (concat login "@" host)))
+          (bbdb-nick (or (erc-nicklist-search-for-nick
+                          (concat login "@" host))
+                         ""))
           (away-status (if voice "" "\n(Away)"))
           (balloon-text (concat bbdb-nick (if (string= "" bbdb-nick)
                                               "" "\n")
@@ -406,6 +408,7 @@ list has all the voiced users according to
 ;; Local Variables:
 ;; indent-tabs-mode: t
 ;; tab-width: 8
+;; coding: utf-8
 ;; End:
 
 ;; arch-tag: db37a256-87a7-4544-bd90-e5f16c9f5ca5
index 06d3ca7..7a22954 100644 (file)
@@ -5,7 +5,6 @@
 ;; Author: Andreas Fuchs <asf@void.at>
 ;; Maintainer: Mario Lang (mlang@delysid.org)
 ;; Keywords: IRC, client, Internet
-;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcReplace
 
 ;; This file is part of GNU Emacs.
 
index bbcddaf..e152d8e 100644 (file)
 
 ;;; Commentary:
 
-;; This used to be in erc.el, I (Jorgen) just extracted it from there
-;; and put it in this file.  Bugs and features are those of the
-;; original author.
+;; Play sounds when users send you CTCP SOUND messages.
+
+;; This file also defines the command /sound so that you can send
+;; sound requests to other users.
+
+;;; Usage:
+
+;; Add the following to your .emacs if you want to play sounds.
+;;
+;; (require 'erc-soud)
+;; (erc-sound-enable)
+;;
+;; To send requests to other users from within query buffers, type the
+;; following:
+;;
+;; /sound filename optional-message-text
+;;
+;; You can also type the following:
+;;
+;; /ctcp nickname sound filename optional-message
 
 ;;; Code:
 
   "In ERC sound mode, the client will respond to CTCP SOUND requests
 and play sound files as requested."
   ;; Enable:
-  ((define-key erc-mode-map "\C-c\C-s" 'erc-toggle-sound))
+  ((add-hook 'erc-ctcp-query-SOUND-hook 'erc-ctcp-query-SOUND)
+   (define-key erc-mode-map "\C-c\C-s" 'erc-toggle-sound))
   ;; Disable:
-  ((define-key erc-mode-map "\C-c\C-s" 'undefined)))
+  ((remove-hook 'erc-ctcp-query-SOUND-hook 'erc-ctcp-query-SOUND)
+   (define-key erc-mode-map "\C-c\C-s" 'undefined)))
 
 (erc-define-catalog-entry 'english 'CTCP-SOUND "%n (%u@%h) plays %s:%m")
 
@@ -45,7 +64,7 @@ and play sound files as requested."
   :group 'erc)
 
 (defcustom erc-play-sound t
-  "*Play sound on SOUND ctcp requests (used in ICQ chat)."
+  "*Play sounds when you receive CTCP SOUND requests."
   :group 'erc-sound
   :type 'boolean)
 
@@ -55,18 +74,22 @@ and play sound files as requested."
   :type '(repeat directory))
 
 (defcustom erc-default-sound nil
-  "Play this sound if the requested file was not found."
+  "Play this sound if the requested file was not found.
+If this is set to nil or the file doesn't exist a beep will sound."
   :group 'erc-sound
   :type '(choice (const nil)
                 file))
 
-(defcustom erc-play-command "play"
-  "Command for playing sound samples."
-  :group 'erc-sound
-  :type 'string)
+(defvar erc-ctcp-query-SOUND-hook nil
+  "Hook to run after receiving a CTCP SOUND request.")
 
 (defun erc-cmd-SOUND (line &optional force)
-  "Play the sound given in LINE."
+  "Send a CTCP SOUND message to the default target.
+If `erc-play-sound' is non-nil, play the sound as well.
+
+/sound filename optional-message-text
+
+LINE is the text entered, including the command."
   (cond
    ((string-match "^\\s-*\\(\\S-+\\)\\(\\s-.*\\)?$" line)
     (let ((file (match-string 1 line))
@@ -84,8 +107,8 @@ and play sound files as requested."
       t))
    (t nil)))
 
-(defvar erc-ctcp-query-SOUND-hook '(erc-ctcp-query-SOUND))
 (defun erc-ctcp-query-SOUND (proc nick login host to msg)
+  "Display a CTCP SOUND message and play sound if `erc-play-sound' is non-nil."
   (when (string-match "^SOUND\\s-+\\(\\S-+\\)\\(\\(\\s-+.*\\)\\|\\(\\s-*\\)\\)$" msg)
     (let ((sound (match-string 1 msg))
          (comment (match-string 2 msg)))
@@ -96,42 +119,16 @@ and play sound files as requested."
   nil)
 
 (defun erc-play-sound (file)
-  "Plays a sound file located in one of the directories in `erc-sound-path'
-with a command `erc-play-command'."
+  "Play a sound file located in one of the directories in `erc-sound-path'.
+See also `play-sound-file'."
   (let ((filepath (erc-find-file file erc-sound-path)))
     (if (and (not filepath) erc-default-sound)
        (setq filepath erc-default-sound))
     (cond ((and filepath (file-exists-p filepath))
-          (if (and (fboundp 'device-sound-enabled-p)
-                   (device-sound-enabled-p))
-              ; For XEmacs
-              (play-sound-file filepath)
-;           (start-process "erc-sound" nil erc-play-command filepath)
-            (start-process "erc-sound" nil "/bin/tcsh"  "-c"
-                           (concat erc-play-command " " filepath))))
+           (play-sound-file filepath))
          (t (beep)))
     (erc-log (format "Playing sound file %S" filepath))))
 
-;(defun erc-play-sound (file)
-;  "Plays a sound file located in one of the directories in `erc-sound-path'
-;   with a command `erc-play-command'."
-;  (let ((filepath nil)
-;      (paths erc-sound-path))
-;    (while (and paths
-;              (progn (setq filepath (expand-file-name file (car paths)))
-;                     (not (file-exists-p filepath))))
-;      (setq paths (cdr paths)))
-;    (if (and (not (and filepath (file-exists-p filepath)))
-;           erc-default-sound)
-;      (setq filepath erc-default-sound))
-;    (cond ((and filepath (file-exists-p filepath))
-;;        (start-process "erc-sound" nil erc-play-command filepath)
-;         (start-process "erc-sound" nil "/bin/tcsh"  "-c"
-;                        (concat erc-play-command " " filepath))
-;         )
-;        (t (beep)))
-;    (erc-log (format "Playing sound file %S" filepath))))
-
 (defun erc-toggle-sound (&optional arg)
   "Toggles playing sounds on and off.  With positive argument,
   turns them on.  With any other argument turns sounds off."
index b045fb2..3c8f93a 100644 (file)
@@ -580,6 +580,11 @@ ARGS are ignored."
       (erc-modified-channels-display)
       (force-mode-line-update t))))
 
+(defvar erc-track-mouse-face (if (featurep 'xemacs)
+                                'modeline-mousable
+                              'mode-line-highlight)
+  "The face to use when mouse is over channel names in the mode line.")
+
 (defun erc-make-mode-line-buffer-name (string buffer &optional faces count)
   "Return STRING as a button that switches to BUFFER when clicked.
 If FACES are provided, color STRING with them."
@@ -609,6 +614,12 @@ If FACES are provided, color STRING with them."
            (posn-window (event-start e)))
           (switch-to-buffer-other-window ,buffer))))
     (put-text-property 0 (length name) 'local-map map name)
+    (put-text-property
+     0 (length name)
+     'help-echo (concat "mouse-2: switch to buffer, "
+                       "mouse-3: switch to buffer in other window")
+     name)
+    (put-text-property 0 (length name) 'mouse-face erc-track-mouse-face name)
     (when (and faces erc-track-use-faces)
       (put-text-property 0 (length name) 'face faces name))
     name))
index 7a1feaa..76475ab 100644 (file)
@@ -48,7 +48,7 @@ Used only when auto-truncation is enabled.
 (define-erc-module truncate nil
   "Truncate a query buffer if it gets too large.
 This prevents the query buffer from getting too large, which can
-bring any grown emacs to its knees after a few days worth of
+bring any grown Emacs to its knees after a few days worth of
 tracking heavy-traffic channels."
   ;;enable
   ((add-hook 'erc-insert-post-hook 'erc-truncate-buffer))
index 41d5957..a40da6f 100644 (file)
 
 ;;; Commentary:
 
-;; ERC is an IRC client for Emacs.
+;; ERC is a powerful, modular, and extensible IRC client for Emacs.
 
 ;; For more information, see the following URLs:
 ;; * http://sv.gnu.org/projects/erc/
-;; * http://www.emacswiki.org/cgi-bin/wiki.pl?EmacsIRCClient
+;; * http://www.emacswiki.org/cgi-bin/wiki/ERC
 
 ;; As of 2006-06-13, ERC development is now hosted on Savannah
 ;; (http://sv.gnu.org/projects/erc).  I invite everyone who wants to
 
 ;; To connect to an IRC server, do
 ;;
-;; M-x erc-select RET
+;; M-x erc RET
 ;;
 ;; After you are connected to a server, you can use C-h m or have a look at
-;; the IRC menu.
+;; the ERC menu.
 
 ;;; History:
 ;;
 
 ;;; Code:
 
-(defconst erc-version-string "Version 5.1.4"
+(defconst erc-version-string "Version 5.2 stable pre-release"
   "ERC version.  This is used by function `erc-version'.")
 
 (eval-when-compile (require 'cl))
@@ -474,7 +474,7 @@ Removes all users in the current channel.  This is called by
     (clrhash erc-channel-users)))
 
 (defsubst erc-channel-user-op-p (nick)
-  "Return `t' if NICK is an operator in the current channel."
+  "Return t if NICK is an operator in the current channel."
   (and nick
        (hash-table-p erc-channel-users)
        (let ((cdata (erc-get-channel-user nick)))
@@ -482,7 +482,7 @@ Removes all users in the current channel.  This is called by
              (erc-channel-user-op (cdr cdata))))))
 
 (defsubst erc-channel-user-voice-p (nick)
-  "Return `t' if NICK has voice in the current channel."
+  "Return t if NICK has voice in the current channel."
   (and nick
        (hash-table-p erc-channel-users)
        (let ((cdata (erc-get-channel-user nick)))
@@ -774,7 +774,7 @@ set if some hacker is trying to flood you away."
   :type 'boolean)
 
 (defcustom erc-prompt-for-channel-key nil
-  "Prompt for channel key when using `erc-join-channel' interactively"
+  "Prompt for channel key when using `erc-join-channel' interactively."
   :group 'erc
   :type 'boolean)
 
@@ -807,7 +807,7 @@ whose identifier matches, the message will not be processed.
 CAVEAT: ERC doesn't know about the user and host of anyone who
 was already in the channel when you joined, but never said
 anything, so it won't be able to match the user and host of those
-people. You can update the ERC internal info using /WHO *."
+people.  You can update the ERC internal info using /WHO *."
   :group 'erc-ignore
   :type '(repeat regexp))
 
@@ -827,9 +827,9 @@ See `erc-server-flood-margin' for other flood-related parameters.")
   "List of files to try for a startup script.
 The first existent and readable one will get executed.
 
-If the filename ends with `.el' it is presumed to be an emacs-lisp
+If the filename ends with `.el' it is presumed to be an Emacs Lisp
 script and it gets (load)ed.  Otherwise is is treated as a bunch of
-regular IRC commands"
+regular IRC commands."
   :group 'erc-scripts
   :type '(repeat file))
 
@@ -841,7 +841,7 @@ directory in the list."
   :type '(repeat directory))
 
 (defcustom erc-script-echo t
-  "*If not-NIL, echo the IRC script commands locally."
+  "*If non-nil, echo the IRC script commands locally."
   :group 'erc-scripts
   :type 'boolean)
 
@@ -1042,7 +1042,7 @@ At this point, all modifications from prior hook functions are done.
 NOTE: The functions on this hook are called _before_ sending a command
 to the server.
 
-This function is called with narrowing, ala `erc-send-modify-hook'"
+This function is called with narrowing, ala `erc-send-modify-hook'."
   :group 'erc-hooks
   :type 'hook
   :options '(erc-make-read-only))
@@ -1164,6 +1164,12 @@ See the variable `erc-command-indicator'."
   "ERC face for errors."
   :group 'erc-faces)
 
+;; same default color as `erc-input-face'
+(defface erc-my-nick-face '((t (:bold t :foreground "brown")))
+  "ERC face for your current nickname in messages sent by you.
+See also `erc-show-my-nick'."
+  :group 'erc-faces)
+
 (defface erc-nick-default-face '((t (:bold t)))
   "ERC nickname default face."
   :group 'erc-faces)
@@ -1192,7 +1198,7 @@ DOC is the documentation string to use for the minor mode.
 ENABLE-BODY is a list of expressions used to enable the mode.
 DISABLE-BODY is a list of expressions used to disable the mode.
 If LOCAL-P is non-nil, the mode will be created as a buffer-local
-mode.  Rather than a global one.
+mode, rather than a global one.
 
 This will define a minor mode called erc-NAME-mode, possibly
 an alias erc-ALIAS-mode, as well as the helper functions
@@ -1260,7 +1266,7 @@ You should make sure that `current-buffer' is a server buffer.
 This function temporarily adds a function to EVENT's hook to
 execute FORMS.  After FORMS are run, the function is removed from
 EVENT's hook.  The last expression of FORMS should be either nil
-or t nil indicates that the other functions on EVENT's hook
+or t, where nil indicates that the other functions on EVENT's hook
 should be run too, and t indicates that other functions should
 not be run.
 
@@ -1288,7 +1294,7 @@ capabilities."
 This function temporarily prepends a function to EVENT's hook to
 execute FORMS.  After FORMS are run, the function is removed from
 EVENT's hook.  The last expression of FORMS should be either nil
-or t nil indicates that the other functions on EVENT's hook
+or t, where nil indicates that the other functions on EVENT's hook
 should be run too, and t indicates that other functions should
 not be run.
 
@@ -1316,8 +1322,7 @@ the process buffer."
        (process-buffer erc-server-process)))
 
 (defun erc-server-buffer-live-p ()
-  "Return t if the buffer associated with `erc-server-process'
-has not been killed."
+  "Return t if the server buffer has not been killed."
   (and (processp erc-server-process)
        (buffer-live-p (process-buffer erc-server-process))))
 
@@ -1385,7 +1390,7 @@ If BUFFER is nil, the current buffer is used."
 (defvar erc-active-buffer nil
   "The current active buffer, the one where the user typed the last command.
 Defaults to the server buffer, and should only be set in the
-server buffer")
+server buffer.")
 (make-variable-buffer-local 'erc-active-buffer)
 
 (defun erc-active-buffer ()
@@ -1433,7 +1438,7 @@ Turning on `erc-mode' runs the hook `erc-mode-hook'."
 (defconst erc-default-server "irc.freenode.net"
   "IRC server to use if it cannot be detected otherwise.")
 
-(defconst erc-default-port "ircd"
+(defconst erc-default-port "6667"
   "IRC port to use if it cannot be detected otherwise.")
 
 (defcustom erc-join-buffer 'buffer
@@ -1442,7 +1447,7 @@ Turning on `erc-mode' runs the hook `erc-mode-hook'."
 'window-noselect - in another window, but don't select that one,
 'frame - in another frame,
 'bury - bury it in a new buffer,
-any other value - in place of the current buffer"
+any other value - in place of the current buffer."
   :group 'erc-buffers
   :type '(choice (const window)
                 (const window-noselect)
@@ -1452,7 +1457,7 @@ any other value - in place of the current buffer"
 
 (defcustom erc-frame-alist nil
   "*Alist of frame parameters for creating erc frames.
-A value of `nil means to use `default-frame-alist'."
+A value of nil means to use `default-frame-alist'."
   :group 'erc-buffers
   :type '(repeat (cons :format "%v"
                       (symbol :tag "Parameter")
@@ -1534,7 +1539,7 @@ symbol, it may have these values:
             (or target
                 (with-current-buffer (get-buffer buf-name)
                   (and (erc-server-buffer-p)
-                       (not erc-server-connected))))
+                       (not (erc-server-process-alive)))))
             (with-current-buffer (get-buffer buf-name)
               (and (string= erc-session-server server)
                    (erc-port-equal erc-session-port port))))
@@ -1555,7 +1560,8 @@ All strings are compared according to IRC protocol case rules, see
   (catch 'result
     (while list
       (if (string= string (erc-downcase (car list)))
-         (throw 'result list) (setq list (cdr list))))))
+         (throw 'result list)
+       (setq list (cdr list))))))
 
 (defmacro erc-with-buffer (spec &rest body)
   "Execute BODY in the buffer associated with SPEC.
@@ -1567,7 +1573,7 @@ SPEC should have the form
 If TARGET is a buffer, use it.  Otherwise, use the buffer
 matching TARGET in the process specified by PROCESS.
 
-If PROCESS is nil, use the current `erc-server-process'
+If PROCESS is nil, use the current `erc-server-process'.
 See `erc-get-buffer' for details.
 
 See also `with-current-buffer'.
@@ -1663,7 +1669,7 @@ If `erc-track-mode' is in enabled, put the last element of
 Due to some yet unresolved reason, global function `iswitchb-mode'
 needs to be active for this function to work."
   (interactive "P")
-  (eval-when-compile
+  (eval-and-compile
     (require 'iswitchb))
   (let ((iswitchb-make-buflist-hook
         (lambda ()
@@ -1671,8 +1677,7 @@ needs to be active for this function to work."
                 (mapcar 'buffer-name
                         (erc-buffer-list
                          nil
-                         (when (and arg (boundp 'erc-server-process))
-                           erc-server-process)))))))
+                         (when arg erc-server-process)))))))
     (switch-to-buffer
      (iswitchb-read-buffer
       "Switch-to: "
@@ -1757,7 +1762,7 @@ all channel buffers on all servers."
 (defcustom erc-modules '(netsplit fill button match track completion readonly
                                  ring autojoin noncommands irccontrols
                                  stamp list)
-  "A list of modules which erc should enable.
+  "A list of modules which ERC should enable.
 If you set the value of this without using `customize' remember to call
 \(erc-update-modules) after you change it.  When using `customize', modules
 removed from the list will be disabled."
@@ -1833,9 +1838,10 @@ removed from the list will be disabled."
       (condition-case nil
          (require (intern req))
        (error nil))
-      (funcall (or (intern-soft (concat "erc-" (symbol-name mod) "-mode"))
-                  (error "`%s' is not a known ERC module" mod))
-              1))))
+      (let ((sym (intern-soft (concat "erc-" (symbol-name mod) "-mode"))))
+       (if (fboundp sym)
+           (funcall sym 1)
+         (error "`%s' is not a known ERC module" mod))))))
 
 (defun erc-setup-buffer (buffer)
   "Consults `erc-join-buffer' to find out how to display `BUFFER'."
@@ -1861,8 +1867,8 @@ removed from the list will be disabled."
             (display-buffer buffer)
           (switch-to-buffer buffer)))))
 
-(defun erc (&optional server port nick full-name
-                     connect passwd tgt-list channel process)
+(defun erc-open (&optional server port nick full-name
+                          connect passwd tgt-list channel process)
   "ERC is a powerful, modular, and extensible IRC client.
 
 Connect to SERVER on PORT as NICK with FULL-NAME.
@@ -1881,6 +1887,7 @@ Returns the buffer for the given server or channel."
        (connected-p (unless connect erc-server-connected))
        (buffer (erc-get-buffer-create server port channel))
        (old-buffer (current-buffer))
+       (old-point (point))
        continued-session)
     (erc-update-modules)
     (set-buffer buffer)
@@ -1959,7 +1966,7 @@ Returns the buffer for the given server or channel."
       (insert "\n"))
     (set-marker (process-mark erc-server-process) (point))
     (if continued-session
-       (goto-char (point-max))
+       (goto-char old-point)
       (set-marker erc-insert-marker (point))
       (erc-display-prompt)
       (goto-char (point-max)))
@@ -2002,12 +2009,12 @@ If no buffer matches, return nil."
 
 (if (not (fboundp 'read-passwd))
     (defun read-passwd (prompt)
-      "Substitute for read-passwd in early emacsen"
+      "Substitute for `read-passwd' in early emacsen."
       (read-from-minibuffer prompt)))
 
 (defcustom erc-before-connect nil
   "Hook called before connecting to a server.
-This hook gets executed before `erc-select' actually invokes `erc-mode'
+This hook gets executed before `erc' actually invokes `erc-mode'
 with your input data.  The functions in here get called with three
 parameters, SERVER, PORT and NICK."
   :group 'erc-hooks
@@ -2015,7 +2022,7 @@ parameters, SERVER, PORT and NICK."
 
 (defcustom erc-after-connect nil
   "Hook called after connecting to a server.
-This hook gets executed when an end of MOTD has been received. All
+This hook gets executed when an end of MOTD has been received.  All
 functions in here get called with the parameters SERVER and NICK."
   :group 'erc-hooks
   :type 'hook)
@@ -2073,11 +2080,11 @@ functions in here get called with the parameters SERVER and NICK."
     (list :server server :port port :nick nick :password passwd)))
 
 ;;;###autoload
-(defun* erc-select (&key (server (erc-compute-server))
-                        (port   (erc-compute-port))
-                        (nick   (erc-compute-nick))
-                        password
-                        (full-name (erc-compute-full-name)))
+(defun* erc (&key (server (erc-compute-server))
+                 (port   (erc-compute-port))
+                 (nick   (erc-compute-nick))
+                 password
+                 (full-name (erc-compute-full-name)))
   "Select connection parameters and run ERC.
 Non-interactively, it takes keyword arguments
    (server (erc-compute-server))
@@ -2088,7 +2095,7 @@ Non-interactively, it takes keyword arguments
 
 That is, if called with
 
-   (erc-select :server \"irc.freenode.net\" :full-name \"Harry S Truman\")
+   (erc :server \"irc.freenode.net\" :full-name \"Harry S Truman\")
 
 server and full-name will be set to those values, whereas
 `erc-compute-port', `erc-compute-nick' and `erc-compute-full-name' will
@@ -2096,20 +2103,23 @@ be invoked for the values of the other parameters."
   (interactive (erc-select-read-args))
 
   (run-hook-with-args 'erc-before-connect server port nick)
-  (erc server port nick erc-user-full-name t password))
+  (erc-open server port nick full-name t password))
 
+(defalias 'erc-select 'erc)
 
-(defun erc-select-ssl (&rest r)
+(defun erc-ssl (&rest r)
   "Interactively select SSL connection parameters and run ERC.
-Arguments are as to erc-select."
+Arguments are the same as for `erc'."
   (interactive (erc-select-read-args))
   (let ((erc-server-connect-function 'erc-open-ssl-stream))
-    (apply 'erc-select r)))
+    (apply 'erc r)))
+
+(defalias 'erc-select-ssl 'erc-ssl)
 
 (defun erc-open-ssl-stream (name buffer host port)
   "Open an SSL stream to an IRC server.
 The process will be given the name NAME, its target buffer will be
-BUFFER.         HOST and PORT specify the connection target."
+BUFFER.  HOST and PORT specify the connection target."
   (when (require 'tls)
     (let ((proc (open-tls-stream name buffer host port)))
       ;; Ugly hack, but it works for now. Problem is it is
@@ -2127,7 +2137,7 @@ BUFFER.    HOST and PORT specify the connection target."
 
 The buffer is created if it doesn't exist.
 
-NOTE: If this variable is non-nil, and you kill the the only
+NOTE: If this variable is non-nil, and you kill the only
 visible \"*erc-protocol*\" buffer, it will be recreated shortly,
 but you won't see it.
 
@@ -2142,7 +2152,7 @@ This only has any effect if `erc-debug-irc-protocol' is non-nil.
 The buffer is created if it doesn't exist.
 
 If OUTBOUND is non-nil, STRING is being sent to the IRC server
-and appears in erc-input-face in the buffer."
+and appears in face `erc-input-face' in the buffer."
   (when erc-debug-irc-protocol
     (let ((network-name (or (ignore-errors (erc-network-name))
                            "???")))
@@ -2226,7 +2236,7 @@ I.e. any char in it has the `invisible' property set."
 
 (defun erc-display-line-1 (string buffer)
   "Display STRING in `erc-mode' BUFFER.
-Auxiliary function used in `erc-display-line'. The line gets filtered to
+Auxiliary function used in `erc-display-line'.  The line gets filtered to
 interpret the control characters.  Then, `erc-insert-pre-hook' gets called.
 If `erc-insert-this' is still t, STRING gets inserted into the buffer.
 Afterwards, `erc-insert-modify' and `erc-insert-post-hook' get called.
@@ -2310,8 +2320,8 @@ or omitted, the default ERC buffer for the `erc-session-server' is used.
 The BUFFER can be an actual buffer, a list of buffers, 'all or 'active.
 If BUFFER = 'all, the string is displayed in all the ERC buffers for the
 current session.  'active means the current active buffer
-\(`erc-active-buffer').         If the buffer can't be resolved, the current
-buffer is used.         `erc-display-line-1' is used to display STRING.
+\(`erc-active-buffer').  If the buffer can't be resolved, the current
+buffer is used.  `erc-display-line-1' is used to display STRING.
 
 If STRING is nil, the function does nothing."
   (let ((inhibit-point-motion-hooks t)
@@ -2321,9 +2331,8 @@ If STRING is nil, the function does nothing."
                  ((listp buffer) buffer)
                  ((processp buffer) (list (process-buffer buffer)))
                  ((eq 'all buffer)
-                  (and (boundp 'erc-server-process)
-                       ;; Hmm, or all of the same session server?
-                       (erc-buffer-list nil erc-server-process)))
+                  ;; Hmm, or all of the same session server?
+                  (erc-buffer-list nil erc-server-process))
                  ((and (eq 'active buffer) (erc-active-buffer))
                   (list (erc-active-buffer)))
                  ((erc-server-buffer-live-p)
@@ -2338,9 +2347,9 @@ If STRING is nil, the function does nothing."
        (erc-display-line-1 string (current-buffer))))))
 
 (defun erc-display-message-highlight (type string)
-  "Highlight STRING according to TYPE, where erc-TYPE-face is an erc face.
+  "Highlight STRING according to TYPE, where erc-TYPE-face is an ERC face.
 
-See also `erc-make-notice'"
+See also `erc-make-notice'."
   (cond ((eq type 'notice)
         (erc-make-notice string))
        (t
@@ -2426,7 +2435,7 @@ Returns non-nil if the command is actually sent to the server, and nil
 otherwise.
 
 If the command in the LINE is not bound as a function `erc-cmd-<COMMAND>',
-it is passed to `erc-cmd-default'.  If LINE is not a command (ie. doesn't
+it is passed to `erc-cmd-default'.  If LINE is not a command (i.e. doesn't
 start with /<COMMAND>) then it is sent as a message.
 
 An optional FORCE argument forces sending the line when flood
@@ -2536,7 +2545,11 @@ therefore has to contain the command itself as well."
   "Ignore USER.  This should be a regexp matching nick!user@host.
 If no USER argument is specified, list the contents of `erc-ignore-list'."
   (if user
-      (progn
+      (let ((quoted (regexp-quote user)))
+       (when (and (not (string= user quoted))
+                  (y-or-n-p (format "Use regexp-quoted form (%s) instead? "
+                                    quoted)))
+         (setq user quoted))
        (erc-display-line
         (erc-make-notice (format "Now ignoring %s" user))
         'active)
@@ -2554,16 +2567,22 @@ If no USER argument is specified, list the contents of `erc-ignore-list'."
 (defun erc-cmd-UNIGNORE (user)
   "Remove the user specified in USER from the ignore list."
   (let ((ignored-nick (car (with-current-buffer (erc-server-buffer)
-                            (erc-member-ignore-case user erc-ignore-list)))))
-    (if (null ignored-nick)
+                            (erc-member-ignore-case (regexp-quote user)
+                                                    erc-ignore-list)))))
+    (unless ignored-nick
+      (if (setq ignored-nick (erc-ignored-user-p user))
+         (unless (y-or-n-p (format "Remove this regexp (%s)? "
+                                   ignored-nick))
+           (setq ignored-nick nil))
        (erc-display-line
         (erc-make-notice (format "%s is not currently ignored!" user))
-        'active)
+        'active)))
+    (when ignored-nick
       (erc-display-line
        (erc-make-notice (format "No longer ignoring %s" user))
-       'active))
-    (with-current-buffer (erc-server-buffer)
-      (setq erc-ignore-list (delete ignored-nick erc-ignore-list))))
+       'active)
+      (with-current-buffer (erc-server-buffer)
+       (setq erc-ignore-list (delete ignored-nick erc-ignore-list)))))
   t)
 
 (defun erc-cmd-CLEAR ()
@@ -2642,7 +2661,7 @@ VERSION and so on.  It is called with ARGS."
 
 If FUNC contains a valid function or variable, help about that
 will be displayed.  If FUNC is empty, display an apropos about
-erc commands.  Otherwise, do apropos in the erc namespace
+ERC commands.  Otherwise, do `apropos' in the ERC namespace
 \(\"erc-.*LINE\"\).
 
 Examples:
@@ -2768,9 +2787,9 @@ LINE has the format: \"#CHANNEL NICK REASON\" or \"NICK REASON\"."
 
 (defun erc-cmd-LOAD (line)
   "Load the script provided in the LINE.
-If LINE continues beyond the file name,
-the rest of it is put in a (local) variable
-`erc-script-args', which can be used in elisp scripts.
+If LINE continues beyond the file name, the rest of
+it is put in a (local) variable `erc-script-args',
+which can be used in Emacs Lisp scripts.
 
 The optional FORCE argument is ignored here - you can't force loading
 a script after exceeding the flood threshold."
@@ -3149,7 +3168,7 @@ the message given by REASON."
   "Connect to SERVER, leaving existing connection intact."
   (erc-log (format "cmd: SERVER: %s" server))
   (condition-case nil
-      (erc-select :server server :nick (erc-current-nick))
+      (erc :server server :nick (erc-current-nick))
     (error
      (message "Cannot find host %s." server)
      (beep)))
@@ -3337,7 +3356,7 @@ The ban list is fetched from the server if necessary."
                                  (and (boundp 'fill-column)
                                       fill-column)
                                  (1- (window-width))))
-            (separator (make-string erc-fill-column (string-to-char "=")))
+            (separator (make-string erc-fill-column ?=))
             (fmt (concat
                   "%-" (number-to-string (/ erc-fill-column 2)) "s"
                   "%" (number-to-string (/ erc-fill-column 2)) "s")))
@@ -3403,7 +3422,7 @@ Unban all currently banned users in the current channel."
        (lambda (x)
         (erc-server-send
          (format "MODE %s -%s %s" (erc-default-target)
-                 (make-string (length x) (string-to-char "b"))
+                 (make-string (length x) ?b)
                        (mapconcat 'identity x " "))))
        (erc-group-list bans 3))))
        t))))
@@ -3534,9 +3553,8 @@ If `point' is at the beginning of a channel name, use that as default."
    (list
     (if (and (boundp 'reason) (stringp reason) (not (string= reason "")))
        reason
-      (read-from-minibuffer (concat "Leave " (erc-default-target)
-                                   ", Reason? ")
-                           (cons "No reason" 0)))))
+      (read-from-minibuffer (concat "Reason for leaving " (erc-default-target)
+                                   ": ")))))
   (erc-cmd-PART (concat (erc-default-target)" " reason)))
 
 (defun erc-set-topic (topic)
@@ -3666,15 +3684,15 @@ To change how this query window is displayed, use `let' to bind
               (buffer-live-p server)
               (set-buffer server))
     (error "Couldn't switch to server buffer"))
-  (let ((buf (erc erc-session-server
-                 erc-session-port
-                 (erc-current-nick)
-                 erc-session-user-full-name
-                 nil
-                 nil
-                 (list target)
-                 target
-                 erc-server-process)))
+  (let ((buf (erc-open erc-session-server
+                      erc-session-port
+                      (erc-current-nick)
+                      erc-session-user-full-name
+                      nil
+                      nil
+                      (list target)
+                      target
+                      erc-server-process)))
     (unless buf
       (error "Couldn't open query window"))
     (erc-update-mode-line)
@@ -3782,7 +3800,7 @@ See also `erc-display-error-notice'."
 
 (defgroup erc-server-hooks nil
   "Server event callbacks.
-Every server event - like numeric replies - has it's own hook.
+Every server event - like numeric replies - has its own hook.
 Those hooks are all called using `run-hook-with-args-until-success'.
 They receive as first argument the process object from where the event
 originated from,
@@ -3846,32 +3864,29 @@ and as second argument the event parsed as a vector."
   :type 'function)
 
 (defun erc-format-nick (&optional user channel-data)
-  "Standard nickname formatting function.  Only returns the value
-of NICK."
-  (if user
-      (erc-server-user-nickname user)))
+  "Return the nickname of USER.
+See also `erc-format-nick-function'."
+  (when user (erc-server-user-nickname user)))
 
 (defun erc-format-@nick (&optional user channel-data)
-  "Format a nickname such that @ or + are prefix for the NICK
-if OP or VOICE are t respectively."
-  (if user
-      (let (op voice)
-       (if channel-data
-           (setq op (erc-channel-user-op channel-data)
-                 voice (erc-channel-user-voice channel-data)))
-    (concat (if voice "+" "")
-           (if op "@" "")
-               (erc-server-user-nickname user)))))
+  "Format the nickname of USER showing if USER is an operator or has voice.
+Operators have \"@\" and users with voice have \"+\" as a prefix.
+Use CHANNEL-DATA to determine op and voice status.
+See also `erc-format-nick-function'."
+  (when user
+    (let ((op (and channel-data (erc-channel-user-op channel-data) "@"))
+         (voice (and channel-data (erc-channel-user-voice channel-data) "+")))
+      (concat voice op (erc-server-user-nickname user)))))
 
 (defun erc-format-my-nick ()
-  "Return the beginning of this user's message, correctly propertized"
+  "Return the beginning of this user's message, correctly propertized."
   (if erc-show-my-nick
       (let ((open "<")
            (close "> ")
            (nick (erc-current-nick)))
        (concat
         (erc-propertize open 'face 'erc-default-face)
-        (erc-propertize nick 'face 'erc-nick-default-face)
+        (erc-propertize nick 'face 'erc-my-nick-face)
         (erc-propertize close 'face 'erc-default-face)))
     (let ((prefix "> "))
       (erc-propertize prefix 'face 'erc-default-face))))
@@ -3933,7 +3948,7 @@ returns non-nil iff there is at least one buffer for which the
 sender is a member.
 
 See also: `erc-echo-notice-in-first-user-buffer',
-`erc-buffer-list-with-nick'"
+`erc-buffer-list-with-nick'."
   (let ((buffers (erc-buffer-list-with-nick sender erc-server-process)))
     (if buffers
        (progn (erc-display-message parsed nil buffers s) t)
@@ -3948,7 +3963,7 @@ at least one buffer for which the sender is a member or the
 default target.
 
 See also: `erc-echo-notice-in-user-buffers',
-`erc-buffer-list-with-nick'"
+`erc-buffer-list-with-nick'."
   (let ((buffers (erc-buffer-list-with-nick sender erc-server-process)))
     (add-to-list 'buffers buffer)
     (if buffers
@@ -3963,7 +3978,7 @@ returns non-nil iff there is at least one buffer for which the
 sender is a member.
 
 See also: `erc-echo-notice-in-user-buffers',
-`erc-buffer-list-with-nick'"
+`erc-buffer-list-with-nick'."
   (let ((buffers (erc-buffer-list-with-nick sender erc-server-process)))
     (if buffers
        (progn (erc-display-message parsed nil (car buffers) s) t)
@@ -4046,7 +4061,7 @@ See also: `erc-echo-notice-in-user-buffers',
 (defun erc-connection-established (proc parsed)
   "Run just after connection.
 
-Set user modes and run `erc-after-connect hook'."
+Set user modes and run `erc-after-connect' hook."
   (unless erc-server-connected ; only once per session
     (let ((server (or erc-server-announced-name (erc-response.sender parsed)))
          (nick (car (erc-response.command-args parsed ))))
@@ -4376,7 +4391,7 @@ The buffer where the change happened is current while this hook is called."
   "Updates the stored user information for the user with nickname
 NICK.
 
-See also: `erc-update-user'"
+See also: `erc-update-user'."
   (erc-update-user (erc-get-server-user nick) new-nick
                   host login full-name info))
 
@@ -4387,9 +4402,9 @@ struct.  Any of NEW-NICK, HOST, LOGIN, FULL-NAME, INFO which are
 non-nil and not equal to the existing values for USER are used to
 replace the stored values in USER.
 
-If, any only if a change is made,
+If, and only if, a change is made,
 `erc-channel-members-changed-hook' is run for each channel for
-which USER is a member, and `t' is returned."
+which USER is a member, and t is returned."
   (let (changed)
     (when user
       (when (and new-nick
@@ -4426,10 +4441,10 @@ which USER is a member, and `t' is returned."
        update-message-time)
   "Updates the stored user information for the user with nickname
 NICK.  `erc-update-user' is called to handle changes to nickname,
-host, login, full-name, and info.  If `op' or `voice' are
-non-nil, they must be equal to either `on' or `off', in which
-case the operator or voice status of USER in the current channel
-is changed accordingly.  If `update-message-time' is non-nil, the
+HOST, LOGIN, FULL-NAME, and INFO.  If OP or VOICE are non-nil,
+they must be equal to either `on' or `off', in which case the
+operator or voice status of the user in the current channel is
+changed accordingly.  If UPDATE-MESSAGE-TIME is non-nil, the
 last-message-time of the user in the current channel is set
 to (current-time).
 
@@ -4438,7 +4453,7 @@ information if it is not already present in the user or channel
 lists.
 
 If, and only if, changes are made, or the user is added,
-`erc-channel-members-updated-hook' is run, and `t' is returned.
+`erc-channel-members-updated-hook' is run, and t is returned.
 
 See also: `erc-update-user' and `erc-update-channel-member'."
   (let* (changed user-changed
@@ -4504,7 +4519,7 @@ See also: `erc-update-user' and `erc-update-channel-member'."
   "Updates user and channel information for the user with
 nickname NICK in channel CHANNEL.
 
-See also: `erc-update-current-channel-member'"
+See also: `erc-update-current-channel-member'."
   (erc-with-buffer
    (channel)
    (erc-update-current-channel-member nick new-nick add op voice host
@@ -4512,8 +4527,8 @@ See also: `erc-update-current-channel-member'"
                                      update-message-time)))
 
 (defun erc-remove-current-channel-member (nick)
-  "Remove NICK from current channel membership list.  Runs
-`erc-channel-members-changed-hook'."
+  "Remove NICK from current channel membership list.
+Runs `erc-channel-members-changed-hook'."
   (let ((channel-data (erc-get-channel-user nick)))
     (when channel-data
       (erc-remove-channel-user nick)
@@ -4548,7 +4563,7 @@ TOPIC string to the current topic."
         ;; list of triples: (mode-char 'on/'off argument)
         (arg-modes (nth 2 modes)))
     (cond ((erc-channel-p tgt); channel modes
-          (let ((buf (and (boundp 'erc-server-process) erc-server-process
+          (let ((buf (and erc-server-process
                           (erc-get-buffer tgt erc-server-process))))
             (when buf
               (with-current-buffer buf
@@ -4640,7 +4655,7 @@ person who changed the modes."
         (arg-modes (nth 2 modes)))
     ;; now parse the modes changes and do the updates
     (cond ((erc-channel-p tgt); channel modes
-          (let ((buf (and (boundp 'erc-server-process) erc-server-process
+          (let ((buf (and erc-server-process
                           (erc-get-buffer tgt erc-server-process))))
             (when buf
               ;; FIXME! This used to have an original buffer
@@ -4718,7 +4733,7 @@ So far the following TYPE/L pairs are supported:
 
 (defun erc-highlight-notice (s)
   "Highlight notice message S and return it.
-See also variable `erc-notice-highlight-type'"
+See also variable `erc-notice-highlight-type'."
   (cond
    ((eq erc-notice-highlight-type 'prefix)
     (erc-put-text-property 0 (length erc-notice-prefix)
@@ -4935,7 +4950,7 @@ current position."
          (run-hooks 'erc-send-post-hook))))))
 
 (defun erc-command-symbol (command)
-  "Return the erc command symbol for COMMAND if it exists and is bound."
+  "Return the ERC command symbol for COMMAND if it exists and is bound."
   (let ((cmd (intern-soft (format "erc-cmd-%s" (upcase command)))))
     (when (fboundp cmd) cmd)))
 
@@ -5034,7 +5049,7 @@ See also `erc-downcase'."
 (defun erc-add-query (nickname)
   "Add QUERY'd NICKNAME to the default channel list.
 
-The previous default target of QUERY type gets removed"
+The previous default target of QUERY type gets removed."
   (let ((d1 (car erc-default-recipients))
        (d2 (cdr erc-default-recipients))
        (qt (cons 'QUERY (downcase nickname))))
@@ -5059,10 +5074,10 @@ The previous default target of QUERY type gets removed"
 Takes a full SPEC of a user in the form \"nick!login@host\", and
 matches against all the regexp's in `erc-ignore-list'.  If any
 match, returns that regexp."
-  (dolist (ignored (with-current-buffer (erc-server-buffer) erc-ignore-list))
-    (if (string-match ignored spec)
-       ;; We have `require'd cl, so we can return from the block named nil
-       (return ignored))))
+  (catch 'found
+    (dolist (ignored (with-current-buffer (erc-server-buffer) erc-ignore-list))
+      (if (string-match ignored spec)
+         (throw 'found ignored)))))
 
 (defun erc-ignored-reply-p (msg tgt proc)
   ;; FIXME: this docstring needs fixing -- Lawrence 2004-01-08
@@ -5259,8 +5274,8 @@ See also `erc-startup-file-list'."
 
 FILE must be the full name, it is not searched in the
 `erc-script-path'.  If the filename ends with `.el', then load it
-as a emacs-lisp program.  Otherwise, treat it as a regular IRC
-script"
+as an Emacs Lisp program.  Otherwise, treat it as a regular IRC
+script."
   (erc-log (concat "erc-load-script: " file))
   (cond
    ((string-match "\\.el$" file)
@@ -5272,13 +5287,13 @@ script"
   "Process an IRC script LINE.
 
 Does script-specific substitutions (script arguments, current nick,
-server, etc.)  in LINE and returns it.
+server, etc.) in LINE and returns it.
 
 Substitutions are: %C and %c = current target (channel or nick),
 %S %s = current server, %N %n = my current nick, and %x is x verbatim,
 where x is any other character;
 $* = the entire argument string, $1 = the first argument, $2 = the second,
-end so on."
+and so on."
   (if (not args) (setq args ""))
   (let* ((arg-esc-regexp "\\(\\$\\(\\*\\|[1-9][0-9]*\\)\\)\\([^0-9]\\|$\\)")
         (percent-regexp "\\(%.\\)")
@@ -5403,10 +5418,10 @@ user input."
   "Determine the connection and authentication parameters.
 Sets the buffer local variables:
 
-- erc-session-server
-- erc-session-port
-- erc-session-full-name
-- erc-server-current-nick"
+- `erc-session-server'
+- `erc-session-port'
+- `erc-session-full-name'
+- `erc-server-current-nick'"
   (setq erc-session-server (erc-compute-server server)
        erc-session-port (or port erc-default-port)
        erc-session-user-full-name (erc-compute-full-name name))
@@ -5418,7 +5433,7 @@ Sets the buffer local variables:
 This tries a number of increasingly more default methods until a
 non-nil value is found.
 
-- SERVER (the argument passwd to this function)
+- SERVER (the argument passed to this function)
 - The `erc-server' option
 - The value of the IRCSERVER environment variable
 - The `erc-default-server' variable"
@@ -5548,7 +5563,7 @@ See also `erc-emacs-time-to-erc-time'."
 
 (defun erc-client-info (s)
   "Return CTCP CLIENTINFO on command S.
-If S is NIL or an empty string then return general CLIENTINFO"
+If S is nil or an empty string then return general CLIENTINFO."
   (if (or (not s) (string= s ""))
       (concat
        (apply #'concat
@@ -5686,7 +5701,7 @@ displayed hostnames."
   "(AWAY since %a %b %d %H:%M) "
   "When you're away on a server, this is shown in the mode line.
 This should be a string with substitution variables recognized by
-format-time-message."
+`format-time-string'."
   :group 'erc-mode-line-and-header
   :type 'string)
 
@@ -5779,7 +5794,7 @@ if `erc-away' is non-nil."
                      ((functionp erc-header-line-face-method)
                       (funcall erc-header-line-face-method))
                      (t
-                      erc-header-line))))
+                      'erc-header-line))))
       (cond ((featurep 'xemacs)
             (setq modeline-buffer-identification
                   (list (format-spec erc-mode-line-format spec)))
@@ -5833,10 +5848,12 @@ P may be an integer or a service name."
 
 (defun erc-string-to-port (s)
   "Convert string S to either an integer port number or a service name."
-  (let ((n (string-to-number s)))
-    (if (= n 0)
-       s
-      n)))
+  (if (numberp s)
+      s
+    (let ((n (string-to-number s)))
+      (if (= n 0)
+         s
+       n))))
 
 (defun erc-version (&optional here)
   "Show the version number of ERC in the minibuffer.
@@ -5886,8 +5903,8 @@ If optional argument HERE is non-nil, insert version number at point."
 
 All windows are opened in the current frame."
   (interactive)
-  (unless (boundp 'erc-server-process)
-    (error "No erc-process found in current buffer"))
+  (unless erc-server-process
+    (error "No erc-server-process found in current buffer"))
   (let ((bufs (erc-buffer-list nil erc-server-process)))
     (when bufs
       (delete-other-windows)
@@ -5901,7 +5918,7 @@ All windows are opened in the current frame."
        (balance-windows)))))
 
 (defun erc-popup-input-buffer ()
-  "Provide a input buffer."
+  "Provide an input buffer."
    (interactive)
    (let ((buffer-name (generate-new-buffer-name "*ERC input*"))
         (mode (intern
@@ -6019,7 +6036,8 @@ All windows are opened in the current frame."
    (s341   . "Inviting %n to channel %c")
    (s352   . "%-11c %-10n %-4a %u@%h (%f)")
    (s353   . "Users on %c: %u")
-   (s367   . "Ban on %b on %c set by %s on %t (Use /banlist!)")
+   (s367   . "Ban for %b on %c")
+   (s367-set-by . "Ban for %b on %c set by %s on %t")
    (s368   . "Banlist of %c ends.")
    (s379   . "%c: Forwarded to %f")
    (s391   . "The time at %s is %t")
@@ -6194,10 +6212,10 @@ Otherwise, connect to HOST:PORT as USER and /join CHANNEL."
     (with-current-buffer (or server-buffer (current-buffer))
       (if (and server-buffer channel)
          (erc-cmd-JOIN channel)
-       (erc host port (or user (erc-compute-nick)) (erc-compute-full-name)
-            (not server-buffer) password nil channel
-            (when server-buffer
-              (get-buffer-process server-buffer)))))))
+       (erc-open host port (or user (erc-compute-nick)) (erc-compute-full-name)
+                 (not server-buffer) password nil channel
+                 (when server-buffer
+                   (get-buffer-process server-buffer)))))))
 
 (provide 'erc)
 
index 5d21312..c67ed2c 100644 (file)
@@ -296,7 +296,7 @@ If ARG is omitted, point is placed at the end of the expanded text."
 (defvar expand-list nil "Temporary variable used by the Expand package.")
 
 (defvar expand-pos nil
-  "If non nil, stores a vector containing markers to positions defined by the last expansion.
+  "If non-nil, stores a vector containing markers to positions defined by the last expansion.
 This variable is local to a buffer.")
 (make-variable-buffer-local 'expand-pos)
 
index 13cf7fb..3db1934 100644 (file)
@@ -685,8 +685,11 @@ This is called whenever you create a new face, and at other times."
            symbol (intern name)))
     (setq menu 'facemenu-face-menu)
     (setq docstring
-         (format "Select face `%s' for subsequent insertion."
-                 name))
+         (format "Select face `%s' for subsequent insertion.
+If the mark is active and there is no prefix argument,
+apply face `%s' to the region instead.
+This command was defined by `facemenu-add-new-face'."
+                 name name))
     (cond ((facemenu-iterate ; check if equivalent face is already in the menu
            (lambda (m) (and (listp m)
                             (symbolp (car m))
index 04d4613..a681c89 100644 (file)
@@ -1293,6 +1293,7 @@ If FRAME is omitted or nil, use the selected frame."
              (insert "   undefined face.\n")
            (let ((customize-label "customize this face")
                  file-name)
+             (insert (concat " (" (propertize "sample" 'font-lock-face f) ")"))
              (princ (concat " (" customize-label ")\n"))
              (insert "Documentation: "
                      (or (face-documentation f)
index bd0c213..686d761 100644 (file)
@@ -4,7 +4,7 @@
 ;;   2005, 2006 Free Software Foundation, Inc.
 
 ;; Author: Michelangelo Grigni <mic@mathcs.emory.edu>
-;; Maintainer: Rajesh Vaidheeswarran  <rv@gnu.org>
+;; Maintainer: FSF
 ;; Created: 29 Mar 1993
 ;; Keywords: files, hypermedia, matching, mouse, convenience
 ;; X-URL: ftp://ftp.mathcs.emory.edu/pub/mic/emacs/
index fbfe0e2..75aa460 100644 (file)
@@ -1533,7 +1533,7 @@ the various files."
                           (not (eq major-mode 'hexl-mode)))
                  (if (buffer-modified-p)
                      (if (y-or-n-p
-                          (format 
+                          (format
                            (if rawfile
                                "The file %s is already visited normally,
 and you have edited the buffer.  Now you have asked to visit it literally,
@@ -1553,7 +1553,7 @@ Do you want to save the file, and visit it normally instead? ")
                            (find-file-noselect-1 buf filename nowarn
                                                  rawfile truename number))
                        (if (y-or-n-p
-                            (format 
+                            (format
                              (if rawfile
                                  "\
 Do you want to discard your changes, and visit the file literally now? "
@@ -1563,8 +1563,8 @@ Do you want to discard your changes, and visit the file normally now? ")))
                                                  rawfile truename number)
                          (error (if rawfile "File already visited non-literally"
                                   "File already visited literally"))))
-                   (if (y-or-n-p 
-                        (format 
+                   (if (y-or-n-p
+                        (format
                          (if rawfile
                              "The file %s is already visited normally.
 You have asked to visit it literally,
@@ -2821,8 +2821,8 @@ the old visited file has been renamed to the new name FILENAME."
     (let ((buffer (and filename (find-buffer-visiting filename))))
       (and buffer (not (eq buffer (current-buffer)))
           (not no-query)
-          (not (y-or-n-p (message "A buffer is visiting %s; proceed? "
-                                  filename)))
+          (not (y-or-n-p (format "A buffer is visiting %s; proceed? "
+                                  filename)))
           (error "Aborted")))
     (or (equal filename buffer-file-name)
        (progn
@@ -4082,6 +4082,11 @@ non-nil, it is called instead of rereading visited file contents."
                              "File %s no longer exists!"
                            "Cannot revert nonexistent file %s")
                          file-name))
+                 ((not (file-readable-p file-name))
+                  (error (if buffer-file-number
+                             "File %s no longer readable!"
+                           "Cannot revert unreadable file %s")
+                         file-name))
                  (t
                   ;; Bind buffer-file-name to nil
                   ;; so that we don't try to lock the file.
@@ -4095,6 +4100,16 @@ non-nil, it is called instead of rereading visited file contents."
                          (if auto-save-p 'auto-save-coding
                            (or coding-system-for-read
                                buffer-file-coding-system-explicit))))
+                    (if (and (not enable-multibyte-characters)
+                             coding-system-for-read
+                             (not (memq (coding-system-base
+                                         coding-system-for-read)
+                                        '(no-conversion raw-text))))
+                        ;; As a coding system suitable for multibyte
+                        ;; buffer is specified, make the current
+                        ;; buffer multibyte.
+                        (set-buffer-multibyte t))
+
                     ;; This force after-insert-file-set-coding
                     ;; (called from insert-file-contents) to set
                     ;; buffer-file-coding-system to a proper value.
index 27c3713..c44b515 100644 (file)
@@ -449,7 +449,7 @@ After that, changing the prefix key requires manipulating keymaps."
        (if follow-mode
            menu
          '(["Activate          " follow-mode t]))))
-    
+
     mainmap)
   "Minor mode keymap for Follow mode.")
 
@@ -473,7 +473,7 @@ are \" Fw\", or simply \"\"."
   :group 'follow)
 
 (defvar follow-avoid-tail-recenter-p (not (featurep 'xemacs))
-  "*When non-nil, patch emacs so that tail windows won't be recentered.
+  "*When non-nil, patch Emacs so that tail windows won't be recentered.
 
 A \"tail window\" is a window that displays only the end of
 the buffer.  Normally it is practical for the user that empty
index 85bbf60..6a3f2b7 100644 (file)
@@ -149,7 +149,7 @@ your own function which is called when `font-lock-mode' is toggled via
   nil nil nil
   ;; Don't turn on Font Lock mode if we don't have a display (we're running a
   ;; batch job) or if the buffer is invisible (the name starts with a space).
-  (when (or noninteractive (eq (aref (buffer-name) 0) ?\ ))
+  (when (or noninteractive (eq (aref (buffer-name) 0) ?\s))
     (setq font-lock-mode nil))
   (funcall font-lock-function font-lock-mode)
   ;; Arrange to unfontify this buffer if we change major mode later.
index fd9de60..787a5d5 100644 (file)
@@ -1,7 +1,101 @@
+2006-11-30  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * mml2015.el (mml2015-pgg-clear-verify): Replace encode-coding-string
+       with mm-encode-coding-string.
+
+2006-11-29  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * nneething.el (nneething-decode-file-name): Replace
+       decode-coding-string with mm-decode-coding-string.
+
+2006-11-24  Juanma Barranquero  <lekktu@gmail.com>
+
+       * gnus-agent.el (gnus-agent-expire-unagentized-dirs)
+       (gnus-agent-regenerate-group): Fix space/tab mixup in messages.
+
+       * gnus-art.el (gnus-article-x-face-command, gnus-numeric-save-name):
+       * gnus-group.el (gnus-group-sort-function, gnus-group-line-format)
+       (gnus-group-mode, gnus-group-read-group, gnus-group-delete-group)
+       (gnus-group-make-directory-group, gnus-group-transpose-groups):
+       * gnus-start.el (gnus-options-subscribe, gnus-options-not-subscribe)
+       (gnus-subscribe-newsgroup, gnus-1):
+       * gnus-sum.el (gnus-summary-make-false-root, gnus-make-threads):
+       * gnus.el (gnus-nntp-server, gnus-use-cross-reference)
+       (gnus-valid-select-methods, total-expire, gnus-summary-line-format)
+       (gnus-group-read-only-p): Fix space/tab mixup in docstrings.
+
+2006-11-21  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * mm-util.el (mm-string-to-multibyte): Alias to identity in XEmacs.
+
+2006-11-18  Andreas Seltenreich  <uwi7@rz.uni-karlsruhe.de>
+
+       * mm-uu.el (mm-uu-pgp-signed-extract-1): Make last fix more thorough
+       and comment it.
+
+       * nnslashdot.el (nnslashdot-retrieve-headers-1): Update regexp.
+
+2006-11-15  Reiner Steib  <Reiner.Steib@gmx.de>
+
+       * gnus-util.el (gnus-extract-address-components): Improve comment.
+
+2006-11-14  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-util.el (gnus-extract-address-components): Work with address in
+       which the name portion contains @.
+
+2006-11-14  Reiner Steib  <Reiner.Steib@gmx.de>
+
+       * gnus.el (gnus-start): Move custom group up.
+       (gnus-select-method): Don't autoload, but make it available for
+       `customize-variable'.
+       (gnus-getenv-nntpserver): Don't autoload.
+
+2006-11-14  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * mml.el (mml-generate-mime-1): Use mm-string-as-unibyte instead of
+       mm-with-unibyte-current-buffer to make string unibyte.
+
+       * mm-decode.el (mm-insert-part): Use mm-string-to-multibyte instead of
+       mm-string-as-multibyte.
+
+2006-11-09  Reiner Steib  <Reiner.Steib@gmx.de>
+
+       * message.el: Merge from the trunk to fix the bug WRT double encoded
+       subjects.
+       (message-replacement-char): New variable.
+       (message-fix-before-sending): Use it.
+       (message-simplify-subject): New function to remove duplicate code.
+       (message-reply, message-followup): Use it.
+       (message-simplify-subject-functions): New variable.
+       (message-strip-subject-encoded-words): New function
+
+2006-11-08  Wolfgang Jenkner  <wjenkner@inode.at>  (tiny change)
+
+       * gnus-sum.el (gnus-summary-catchup): Use gnus-sorted-intersection
+       instead of gnus-intersection because arguments of gnus-sorted-nunion
+       must be sorted.  This avoids corruption of gnus-newsgroup-unreads.
+
+2006-11-03  Juanma Barranquero  <lekktu@gmail.com>
+
+       * gnus-diary.el (gnus-diary-delay-format-function):
+       * nndiary.el (nndiary-reminders):
+       * nnsoup.el (nnsoup-always-save): Use "non-nil" in docstrings.
+
+2006-11-01  Reiner Steib  <Reiner.Steib@gmx.de>
+
+       * gnus-art.el (article-hide-boring-headers): Fetch date from
+       gnus-original-article-buffer to avoid problems with localized date
+       strings.
+
+2006-10-30  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * html2text.el (html2text-format-tags): Avoid infloop on open tags.
+
 2006-10-29  Reiner Steib  <Reiner.Steib@gmx.de>
 
-       * mm-util.el (mm-codepage-iso-8859-list, mm-codepage-ibm-list): New
-       variables.
+       * mm-util.el (mm-codepage-iso-8859-list, mm-codepage-ibm-list):
+       New variables.
        (mm-setup-codepage-iso-8859, mm-setup-codepage-ibm): New functions.
        (mm-charset-synonym-alist): Move some entries to
        mm-codepage-iso-8859-list.
        (rfc2231-encode-string): Be sure to work on multibyte buffer at
        first, and after mm-encode-body, change the buffer to unibyte.
 
-2006-03-21  Daniel Pittman <daniel@rimspace.net>
+2006-03-21  Daniel Pittman  <daniel@rimspace.net>
 
        * nnimap.el (nnimap-request-update-info-internal): Optimize.
        Don't `gnus-uncompress-range' to avoid excessive memory usage.
@@ -4484,6 +4578,7 @@ See ChangeLog.2 for earlier changes.
 ;; Local Variables:
 ;; coding: iso-2022-7bit
 ;; fill-column: 79
+;; add-log-time-zone-rule: t
 ;; End:
 
 ;;; arch-tag: 3f33a3e7-090d-492b-bedd-02a1417d32b4
index 733b753..64e080f 100644 (file)
@@ -13,7 +13,7 @@
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
@@ -1167,7 +1167,7 @@ downloadable."
             ;; For each article that I processed that is no longer
             ;; undownloaded, remove its processable mark.
 
-           (mapc #'gnus-summary-remove-process-mark 
+           (mapc #'gnus-summary-remove-process-mark
                  (gnus-sorted-ndifference gnus-newsgroup-processable gnus-newsgroup-undownloaded))
 
             ;; The preceeding call to (gnus-agent-summary-fetch-group)
@@ -1972,11 +1972,11 @@ doesn't exist, to valid the overview buffer."
                   ;; First, we'll fix the sort.
                   (sort-numeric-fields 1 (point-min) (point-max))
 
-                  ;; but now we have to consider that we may have duplicate rows...      
+                  ;; but now we have to consider that we may have duplicate rows...
                   ;; so reset to beginning of file
                   (goto-char (point-min))
                   (setq last -134217728)
-         
+
                   ;; and throw a code that restarts this scan
                   (throw 'problems t))
                 nil))))))
@@ -3470,7 +3470,7 @@ articles in every agentized group? "))
                    (or gnus-expert-user
                        (gnus-y-or-n-p
                         "gnus-agent-expire has identified local directories that are\
- not currently required by any agentized group.         Do you wish to consider\
+ not currently required by any agentized group.  Do you wish to consider\
  deleting them?")))
           (while to-remove
             (let ((dir (pop to-remove)))
@@ -3756,7 +3756,7 @@ If REREAD is not nil, downloaded articles are marked as unread."
              (dir (file-name-directory file))
              point
              (downloaded (if (file-exists-p dir)
-                          (sort (delq nil (mapcar (lambda (name) 
+                          (sort (delq nil (mapcar (lambda (name)
                                                     (and (not (file-directory-p (nnheader-concat dir name)))
                                                          (string-to-number name)))
                                                   (directory-files dir nil "^[0-9]+$" t)))
@@ -3802,7 +3802,7 @@ If REREAD is not nil, downloaded articles are marked as unread."
                                ((= l1 l2)
                                 (forward-line -1)
                                 (gnus-message 4 "gnus-agent-regenerate-group: NOV\
- entries contained duplicate of article %s.     Duplicate deleted." l1)
+ entries contained duplicate of article %s.  Duplicate deleted." l1)
                                 (gnus-delete-line)
                                 (setq nov-arts (cdr nov-arts))))))
                       (t
@@ -3923,7 +3923,7 @@ If REREAD is not nil, downloaded articles are marked as unread."
                 (gnus-agent-possibly-alter-active group group-active)))))
 
         (when (and reread gnus-agent-article-alist)
-       (gnus-agent-synchronize-group-flags 
+       (gnus-agent-synchronize-group-flags
            group
         (list (list
            (if (listp reread)
index ecee7ff..cdb3c89 100644 (file)
@@ -15,7 +15,7 @@
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
@@ -265,7 +265,7 @@ regexp.  If it matches, the text in question is not a signature."
 display -"))
   "*String or function to be executed to display an X-Face header.
 If it is a string, the command will be executed in a sub-shell
-asynchronously.         The compressed face will be piped to this command."
+asynchronously.  The compressed face will be piped to this command."
   :type `(choice string
                 (function-item gnus-display-x-face-in-from)
                 function)
@@ -1917,7 +1917,11 @@ always hide."
                                'string<))))
                    (gnus-article-hide-header "reply-to")))))
             ((eq elem 'date)
-             (let ((date (message-fetch-field "date")))
+             (let ((date (with-current-buffer gnus-original-article-buffer
+                           ;; If date in `gnus-article-buffer' is localized
+                           ;; (`gnus-treat-date-user-defined'),
+                           ;; `days-between' might fail.
+                           (message-fetch-field "date"))))
                (when (and date
                           (< (days-between (current-time-string) date)
                              4))
@@ -3637,7 +3641,7 @@ Otherwise, it is like ~/News/news/group/num."
 (defun gnus-numeric-save-name (newsgroup headers &optional last-file)
   "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE.
 If variable `gnus-use-long-file-name' is non-nil, it is
-~/News/news.group/num. Otherwise, it is like ~/News/news/group/num."
+~/News/news.group/num.  Otherwise, it is like ~/News/news/group/num."
   (let ((default
          (expand-file-name
           (concat (if (gnus-use-long-file-name 'not-save)
index e483413..bc2f096 100644 (file)
@@ -121,7 +121,7 @@ Please refer to `format-time-string' for information on possible values."
 
 (defcustom gnus-diary-delay-format-function 'gnus-diary-delay-format-english
   "*Function called to format a diary delay string.
-It is passed two arguments.  The first one is non nil if the delay is in
+It is passed two arguments.  The first one is non-nil if the delay is in
 the past.  The second one is of the form ((NUM . UNIT) ...) where NUM is
 an integer and UNIT is one of 'year 'month 'week 'day 'hour or 'minute.
 It should return strings like \"In 2 months, 3 weeks\", \"3 hours,
index c6a0d59..f004a04 100644 (file)
@@ -131,7 +131,7 @@ for the groups to be sorted.  Pre-made functions include
 `gnus-group-sort-by-score', `gnus-group-sort-by-method',
 `gnus-group-sort-by-server', and `gnus-group-sort-by-rank'.
 
-This variable can also be a list of sorting functions. In that case,
+This variable can also be a list of sorting functions.  In that case,
 the most significant sort function should be the last function in the
 list."
   :group 'gnus-group-listing
@@ -193,7 +193,7 @@ with some simple extensions.
 
 Note that this format specification is not always respected.  For
 reasons of efficiency, when listing killed groups, this specification
-is ignored altogether. If the spec is changed considerably, your
+is ignored altogether.  If the spec is changed considerably, your
 output may end up looking strange when listing both alive and killed
 groups.
 
@@ -1115,7 +1115,7 @@ When FORCE, rebuild the tool bar."
 
 All normal editing commands are switched off.
 \\<gnus-group-mode-map>
-The group buffer lists (some of) the groups available. For instance,
+The group buffer lists (some of) the groups available.  For instance,
 `\\[gnus-group-list-groups]' will list all subscribed groups with unread articles, while `\\[gnus-group-list-zombies]'
 lists all zombie groups.
 
@@ -2006,7 +2006,7 @@ and with point over the group in question."
 If the prefix argument ALL is non-nil, already read articles become
 readable.  IF ALL is a number, fetch this number of articles.  If the
 optional argument NO-ARTICLE is non-nil, no article will be
-auto-selected upon group entry.         If GROUP is non-nil, fetch that
+auto-selected upon group entry.  If GROUP is non-nil, fetch that
 group."
   (interactive "P")
   (let ((no-display (eq all 0))
@@ -2446,7 +2446,7 @@ ADDRESS."
   "Delete the current group.  Only meaningful with editable groups.
 If FORCE (the prefix) is non-nil, all the articles in the group will
 be deleted.  This is \"deleted\" as in \"removed forever from the face
-of the Earth\".         There is no undo.  The user will be prompted before
+of the Earth\".  There is no undo.  The user will be prompted before
 doing the deletion.
 Note that you also have to specify FORCE if you want the group to
 be removed from the server, even when it's empty."
@@ -2825,7 +2825,7 @@ Given a prefix, create a full group."
 (defun gnus-group-make-directory-group (dir)
   "Create an nndir group.
 The user will be prompted for a directory.  The contents of this
-directory will be used as a newsgroup. The directory should contain
+directory will be used as a newsgroup.  The directory should contain
 mail messages or news articles in files that have numeric names."
   (interactive
    (list (read-file-name "Create group from directory: ")))
@@ -3495,7 +3495,7 @@ group line."
 
 (defun gnus-group-transpose-groups (n)
   "Move the current newsgroup up N places.
-If given a negative prefix, move down instead. The difference between
+If given a negative prefix, move down instead.  The difference between
 N and the number of steps taken is returned."
   (interactive "p")
   (unless (gnus-group-group-name)
@@ -4211,7 +4211,7 @@ and the second element is the address."
        (unless entry
          (error "Trying to change non-existent group %s" method-only-group))
        ;; We have received parts of the actual group info - either the
-       ;; select method or the group parameters.        We first check
+       ;; select method or the group parameters.  We first check
        ;; whether we have to extend the info, and if so, do that.
        (let ((len (length info))
              (total (if (eq part 'method) 5 6)))
index 1340786..22a807b 100644 (file)
@@ -15,7 +15,7 @@
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
@@ -352,7 +352,7 @@ be subscribed using `gnus-subscribe-options-newsgroup-method'."
 
 (defcustom gnus-options-subscribe nil
   "*All new groups matching this regexp will be subscribed unconditionally.
-Note that this variable deals only with new newsgroups.         This variable
+Note that this variable deals only with new newsgroups.  This variable
 does not affect old newsgroups.
 
 New groups that match this regexp will not be handled by
@@ -364,7 +364,7 @@ be subscribed using `gnus-subscribe-options-newsgroup-method'."
 
 (defcustom gnus-options-not-subscribe nil
   "*All new groups matching this regexp will be ignored.
-Note that this variable deals only with new newsgroups.         This variable
+Note that this variable deals only with new newsgroups.  This variable
 does not affect old (already subscribed) newsgroups."
   :group 'gnus-group-new
   :type '(choice regexp
@@ -620,7 +620,7 @@ it is killed."
 
 (defun gnus-subscribe-newsgroup (newsgroup &optional next)
   "Subscribe new NEWSGROUP.
-If NEXT is non-nil, it is inserted before NEXT.         Otherwise it is made
+If NEXT is non-nil, it is inserted before NEXT.  Otherwise it is made
 the first newsgroup."
   (save-excursion
     (goto-char (point-min))
@@ -732,7 +732,7 @@ will not connect to the local server."
 (defun gnus-1 (&optional arg dont-connect slave)
   "Read network news.
 If ARG is non-nil and a positive number, Gnus will use that as the
-startup level. If ARG is non-nil and not a positive number, Gnus will
+startup level.  If ARG is non-nil and not a positive number, Gnus will
 prompt the user for the name of an NNTP server to use."
   (interactive "P")
 
index 7d0b720..0e43c78 100644 (file)
@@ -15,7 +15,7 @@
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
@@ -110,7 +110,7 @@ have all the sub-threads as children.
 If this variable is `adopt', Gnus will make one of the \"children\"
 the parent and mark all the step-children as such.
 If this variable is `empty', the \"children\" are printed with empty
-subject fields.         (Or rather, they will be printed with a string
+subject fields.  (Or rather, they will be printed with a string
 given by the `gnus-summary-same-subject' variable.)"
   :group 'gnus-thread
   :type '(choice (const :tag "off" nil)
@@ -3975,7 +3975,7 @@ If NO-DISPLAY, don't generate a summary buffer."
     infloop))
 
 (defun gnus-make-threads ()
-  "Go through the dependency hashtb and find the roots.         Return all threads."
+  "Go through the dependency hashtb and find the roots.  Return all threads."
   (let (threads)
     (while (catch 'infloop
             (mapatoms
@@ -4481,7 +4481,7 @@ If LINE, insert the rebuilt thread starting on line LINE."
     ;; First go up in this thread until we find the root.
     (setq last-id (gnus-root-id id)
          headers (message-flatten-list (gnus-id-to-thread last-id)))
-    ;; We have now found the real root of this thread. It might have
+    ;; We have now found the real root of this thread.  It might have
     ;; been gathered into some loose thread, so we have to search
     ;; through the threads to find the thread we wanted.
     (let ((threads gnus-newsgroup-threads)
@@ -5927,7 +5927,7 @@ The resulting hash table is returned, or nil if no Xrefs were found."
       (let ((case-fold-search t)
            in-reply-to header p lines chars)
        (goto-char (point-min))
-       ;; Search to the beginning of the next header.  Error messages
+       ;; Search to the beginning of the next header.  Error messages
        ;; do not begin with 2 or 3.
        (while (re-search-forward "^[23][0-9]+ " nil t)
          (setq id nil
@@ -5935,7 +5935,7 @@ The resulting hash table is returned, or nil if no Xrefs were found."
          ;; This implementation of this function, with nine
          ;; search-forwards instead of the one re-search-forward and
          ;; a case (which basically was the old function) is actually
-         ;; about twice as fast, even though it looks messier.  You
+         ;; about twice as fast, even though it looks messier.  You
          ;; can't have everything, I guess.  Speed and elegance
          ;; doesn't always go hand in hand.
          (setq
@@ -10470,8 +10470,8 @@ The number of articles marked as read is returned."
                        gnus-newsgroup-dormant nil))
                (setq gnus-newsgroup-unreads
                      (gnus-sorted-nunion
-                       (gnus-intersection gnus-newsgroup-unreads
-                                          gnus-newsgroup-downloadable)
+                       (gnus-sorted-intersection gnus-newsgroup-unreads
+                                                gnus-newsgroup-downloadable)
                        gnus-newsgroup-unfetched)))
            ;; We actually mark all articles as canceled, which we
            ;; have to do when using auto-expiry or adaptive scoring.
index 09d7ab9..b88a433 100644 (file)
@@ -202,8 +202,13 @@ is slower."
     ;; First find the address - the thing with the @ in it.  This may
     ;; not be accurate in mail addresses, but does the trick most of
     ;; the time in news messages.
-    (when (string-match "\\b[^@ \t<>]+[!@][^@ \t<>]+\\b" from)
-      (setq address (substring from (match-beginning 0) (match-end 0))))
+    (cond (;; Check ``<foo@bar>'' first in order to handle the quite common
+          ;; form ``"abc@xyz" <foo@bar>'' (i.e. ``@'' as part of a comment)
+          ;; correctly.
+          (string-match "<\\([^@ \t<>]+[!@][^@ \t<>]+\\)>" from)
+          (setq address (substring from (match-beginning 1) (match-end 1))))
+         ((string-match "\\b[^@ \t<>]+[!@][^@ \t<>]+\\b" from)
+          (setq address (substring from (match-beginning 0) (match-end 0)))))
     ;; Then we check whether the "name <address>" format is used.
     (and address
         ;; Linear white space is not required.
index 94e890b..81f62d7 100644 (file)
@@ -16,7 +16,7 @@
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
   :group 'news
   :group 'mail)
 
+(defgroup gnus-start nil
+  "Starting your favorite newsreader."
+  :group 'gnus)
+
 (defgroup gnus-format nil
   "Dealing with formatting issues."
   :group 'gnus)
   "Article Registry."
   :group 'gnus)
 
-(defgroup gnus-start nil
-  "Starting your favorite newsreader."
-  :group 'gnus)
-
 (defgroup gnus-start-server nil
   "Server options at startup."
   :group 'gnus-start)
@@ -1239,7 +1239,6 @@ used to 899, you would say something along these lines:
   :group 'gnus-server
   :type 'file)
 
-;;;###autoload
 (defun gnus-getenv-nntpserver ()
   "Find default nntp server.
 Check the NNTPSERVER environment variable and the
@@ -1251,7 +1250,11 @@ Check the NNTPSERVER environment variable and the
             (when (re-search-forward "[^ \t\n\r]+" nil t)
               (match-string 0))))))
 
-;;;###autoload
+;; `M-x customize-variable RET gnus-select-method RET' should work without
+;; starting or even loading Gnus.
+;;;###autoload(when (fboundp 'custom-autoload)
+;;;###autoload  (custom-autoload 'gnus-select-method "gnus"))
+
 (defcustom gnus-select-method
   (condition-case nil
       (nconc
@@ -1285,6 +1288,8 @@ If you use this variable, you must set `gnus-nntp-server' to nil.
 There is a lot more to know about select methods and virtual servers -
 see the manual for details."
   :group 'gnus-server
+  :group 'gnus-start
+  :initialize 'custom-initialize-default
   :type 'gnus-select-method)
 
 (defcustom gnus-message-archive-method "archive"
@@ -1330,7 +1335,7 @@ non-numeric prefix - `C-u M-x gnus', in short."
 
 (defcustom gnus-nntp-server nil
   "*The name of the host running the NNTP server.
-This variable is semi-obsolete.         Use the `gnus-select-method'
+This variable is semi-obsolete.  Use the `gnus-select-method'
 variable instead."
   :group 'gnus-server
   :type '(choice (const :tag "disable" nil)
@@ -1473,7 +1478,7 @@ group."
 (defcustom gnus-use-cross-reference t
   "*Non-nil means that cross referenced articles will be marked as read.
 If nil, ignore cross references.  If t, mark articles as read in
-subscribed newsgroups. If neither t nor nil, mark as read in all
+subscribed newsgroups.  If neither t nor nil, mark as read in all
 newsgroups."
   :group 'gnus-server
   :type '(choice (const :tag "off" nil)
@@ -1692,7 +1697,7 @@ of the select method.  The other elements may be the category of
 this method (i. e., `post', `mail', `none' or whatever) or other
 properties that this method has (like being respoolable).
 If you implement a new select method, all you should have to change is
-this variable. I think."
+this variable.  I think."
   :group 'gnus-server
   :type '(repeat (group (string :tag "Name")
                        (radio-button-choice (const :format "%v " post)
@@ -1846,7 +1851,7 @@ which to perform auto-expiry.  This only makes sense for mail groups."
  "*Groups in which to perform expiry of all read articles.
 Use with extreme caution.  All groups that match this regexp will be
 expiring - which means that all read articles will be deleted after
-\(say) one week.        (This only goes for mail groups and the like, of
+\(say) one week.  (This only goes for mail groups and the like, of
 course.)"
  :variable-group nnmail-expire
  :variable-type '(choice (const nil)
@@ -2978,7 +2983,7 @@ with some simple extensions.
 The %U (status), %R (replied) and %z (zcore) specs have to be handled
 with care.  For reasons of efficiency, Gnus will compute what column
 these characters will end up in, and \"hard-code\" that.  This means that
-it is invalid to have these specs after a variable-length spec.         Well,
+it is invalid to have these specs after a variable-length spec.  Well,
 you might not be arrested, but your summary buffer will look strange,
 which is bad enough.
 
@@ -3363,7 +3368,7 @@ GROUP can either be a string (a group name) or a select method."
 
 (defun gnus-group-read-only-p (&optional group)
   "Check whether GROUP supports editing or not.
-If GROUP is nil, `gnus-newsgroup-name' will be checked instead.         Note
+If GROUP is nil, `gnus-newsgroup-name' will be checked instead.  Note
 that that variable is buffer-local to the summary buffers."
   (let ((group (or group gnus-newsgroup-name)))
     (not (gnus-check-backend-function 'request-replace-article group))))
@@ -4038,7 +4043,7 @@ If NEWSGROUP is nil, return the global kill file name instead."
     (not method)))
 
 (defun gnus-server-extend-method (group method)
-  ;; This function "extends" a virtual server. If the server is
+  ;; This function "extends" a virtual server.  If the server is
   ;; "hello", and the select method is ("hello" (my-var "something"))
   ;; in the group "alt.alt", this will result in a new virtual server
   ;; called "hello+alt.alt".
index 68934c9..0804422 100644 (file)
@@ -423,7 +423,9 @@ See the documentation for that variable."
              (p3) (p4))
          (search-backward "<" (point-min) t)
          (setq p1 (point))
-         (re-search-forward (format "</%s>" tag) (point-max) t)
+         (unless (search-forward (format "</%s>" tag) (point-max) t)
+           (goto-char p2)
+           (insert (format "</%s>" tag)))
          (setq p4 (point))
          (search-backward "</" (point-min) t)
          (setq p3 (point))
index fc38593..a3d0298 100644 (file)
@@ -1786,6 +1786,96 @@ see `message-narrow-to-headers-or-head'."
       (substring subject (match-end 0))
     subject))
 
+(defcustom message-replacement-char "."
+  "Replacement character used instead of unprintable or not decodable chars."
+  :group 'message-various
+  :version "22.1" ;; Gnus 5.10.9
+  :type '(choice string
+                (const ".")
+                (const "?")))
+
+;; FIXME: We also should call `message-strip-subject-encoded-words'
+;; when forwarding.  Probably in `message-make-forward-subject' and
+;; `message-forward-make-body'.
+
+(defun message-strip-subject-encoded-words (subject)
+  "Fix non-decodable words in SUBJECT."
+  ;; Cf. `gnus-simplify-subject-fully'.
+  (let* ((case-fold-search t)
+        (replacement-chars (format "[%s%s%s]"
+                                   message-replacement-char
+                                   message-replacement-char
+                                   message-replacement-char))
+        (enc-word-re "=\\?\\([^?]+\\)\\?\\([QB]\\)\\?\\([^?]+\\)\\(\\?=\\)")
+        cs-string
+        (have-marker
+         (with-temp-buffer
+           (insert subject)
+           (goto-char (point-min))
+           (when (re-search-forward enc-word-re nil t)
+             (setq cs-string (match-string 1)))))
+        cs-coding q-or-b word-beg word-end)
+    (if (or (not have-marker) ;; No encoded word found...
+           ;; ... or double encoding was correct:
+           (and (stringp cs-string)
+                (setq cs-string (downcase cs-string))
+                (mm-coding-system-p (intern cs-string))
+                (not (prog1
+                         (y-or-n-p
+                          (format "\
+Decoded Subject \"%s\"
+contains a valid encoded word.  Decode again? "
+                                  subject))
+                       (setq cs-coding (intern cs-string))))))
+       subject
+      (with-temp-buffer
+       (insert subject)
+       (goto-char (point-min))
+       (while (re-search-forward enc-word-re nil t)
+         (setq cs-string (downcase (match-string 1))
+               q-or-b    (match-string 2)
+               word-beg (match-beginning 0)
+               word-end (match-end 0))
+         (setq cs-coding
+               (if (mm-coding-system-p (intern cs-string))
+                   (setq cs-coding (intern cs-string))
+                 nil))
+         ;; No double encoded subject? => bogus charset.
+         (unless cs-coding
+           (setq cs-coding
+                 (mm-read-coding-system
+                  (format "\
+Decoded Subject \"%s\"
+contains an encoded word.  The charset `%s' is unknown or invalid.
+Hit RET to replace non-decodable characters with \"%s\" or enter replacement
+charset: "
+                          subject cs-string message-replacement-char)))
+           (if cs-coding
+               (replace-match (concat "=?" (symbol-name cs-coding)
+                                      "?\\2?\\3\\4\\5"))
+             (save-excursion
+               (goto-char word-beg)
+               (re-search-forward "=\\?\\([^?]+\\)\\?\\([QB]\\)\\?" word-end t)
+               (replace-match "")
+               ;; QP or base64
+               (if (string-match "\\`Q\\'" q-or-b)
+                   ;; QP
+                   (progn
+                     (message "Replacing non-decodable characters with \"%s\"."
+                              message-replacement-char)
+                     (while (re-search-forward "\\(=[A-F0-9][A-F0-9]\\)+"
+                                               word-end t)
+                       (replace-match message-replacement-char)))
+                 ;; base64
+                 (message "Replacing non-decodable characters with \"%s\"."
+                          replacement-chars)
+                 (re-search-forward "[^?]+" word-end t)
+                 (replace-match replacement-chars))
+               (re-search-forward "\\?=")
+               (replace-match "")))))
+       (rfc2047-decode-region (point-min) (point-max))
+       (buffer-string)))))
+
 ;;; Start of functions adopted from `message-utils.el'.
 
 (defun message-strip-subject-trailing-was (subject)
@@ -3614,8 +3704,10 @@ It should typically alter the sending method in some way or other."
        (setq choice
              (gnus-multiple-choice
               "Non-printable characters found.  Continue sending?"
-              '((?d "Remove non-printable characters and send")
-                (?r "Replace non-printable characters with dots and send")
+              `((?d "Remove non-printable characters and send")
+                (?r ,(format
+                      "Replace non-printable characters with \"%s\" and send"
+                      message-replacement-char))
                 (?i "Ignore non-printable characters and send")
                 (?e "Continue editing"))))
        (if (eq choice ?e)
@@ -3638,7 +3730,7 @@ It should typically alter the sending method in some way or other."
                (message-kill-all-overlays)
              (delete-char 1)
              (when (eq choice ?r)
-               (insert "."))))
+               (insert message-replacement-char))))
          (forward-char)
          (skip-chars-forward mm-7bit-chars))))))
 
@@ -5816,6 +5908,39 @@ want to get rid of this query permanently.")))
        (push (cons 'Cc recipients) follow-to)))
     follow-to))
 
+(defcustom message-simplify-subject-functions
+  '(message-strip-list-identifiers
+    message-strip-subject-re
+    message-strip-subject-trailing-was
+    message-strip-subject-encoded-words)
+  "List of functions taking a string argument that simplify subjects.
+The functions are applied when replying to a message.
+
+Useful functions to put in this list include:
+`message-strip-list-identifiers', `message-strip-subject-re',
+`message-strip-subject-trailing-was', and
+`message-strip-subject-encoded-words'."
+  :version "22.1" ;; Gnus 5.10.9
+  :group 'message-various
+  :type '(repeat function))
+
+(defun message-simplify-subject (subject &optional functions)
+  "Return simplified SUBJECT."
+  (unless functions
+    ;; Simplify fully:
+    (setq functions message-simplify-subject-functions))
+  (when (and (memq 'message-strip-list-identifiers functions)
+            gnus-list-identifiers)
+    (setq subject (message-strip-list-identifiers subject)))
+  (when (memq 'message-strip-subject-re functions)
+    (setq subject (concat "Re: " (message-strip-subject-re subject))))
+  (when (and (memq 'message-strip-subject-trailing-was functions)
+            message-subject-trailing-was-query)
+    (setq subject (message-strip-subject-trailing-was subject)))
+  (when (memq 'message-strip-subject-encoded-words functions)
+    (setq subject (message-strip-subject-encoded-words subject)))
+  subject)
+
 ;;;###autoload
 (defun message-reply (&optional to-address wide)
   "Start editing a reply to the article in the current buffer."
@@ -5845,11 +5970,9 @@ want to get rid of this query permanently.")))
            date (message-fetch-field "date")
            from (or (message-fetch-field "from") "nobody")
            subject (or (message-fetch-field "subject") "none"))
-      (when gnus-list-identifiers
-       (setq subject (message-strip-list-identifiers subject)))
-      (setq subject (concat "Re: " (message-strip-subject-re subject)))
-      (when message-subject-trailing-was-query
-       (setq subject (message-strip-subject-trailing-was subject)))
+
+      ;; Strip list identifiers, "Re: ", and "was:"
+      (setq subject (message-simplify-subject subject))
 
       (when (and (setq gnus-warning (message-fetch-field "gnus-warning"))
                 (string-match "<[^>]+>" gnus-warning))
@@ -5919,11 +6042,8 @@ If TO-NEWSGROUPS, use that as the new Newsgroups line."
                 (let ((case-fold-search t))
                   (string-match "world" distribution)))
        (setq distribution nil))
-      (if gnus-list-identifiers
-         (setq subject (message-strip-list-identifiers subject)))
-      (setq subject (concat "Re: " (message-strip-subject-re subject)))
-      (when message-subject-trailing-was-query
-       (setq subject (message-strip-subject-trailing-was subject)))
+      ;; Strip list identifiers, "Re: ", and "was:"
+      (setq subject (message-simplify-subject subject))
       (widen))
 
     (message-pop-to-buffer (message-buffer-name "followup" from newsgroups))
index c5fd5d3..7e6f93b 100644 (file)
@@ -1135,7 +1135,7 @@ are ignored."
            (with-current-buffer (mm-handle-buffer handle)
              (buffer-string)))
           ((mm-multibyte-p)
-           (mm-string-as-multibyte (mm-get-part handle no-cache)))
+           (mm-string-to-multibyte (mm-get-part handle no-cache)))
           (t
            (mm-get-part handle no-cache))))))
 
index 05c37a5..10cd78f 100644 (file)
      ;; (string-to-multibyte s)   ~= (decode-coding-string s 'binary)
      ;; (string-make-multibyte s) ~= (decode-coding-string s locale-coding-system)
      (string-as-multibyte . identity)
-     (string-to-multibyte
-      . (lambda (string)
-         "Return a multibyte string with the same individual chars as string."
-         (mapconcat
-          (lambda (ch) (mm-string-as-multibyte (char-to-string ch)))
-          string "")))
      (multibyte-string-p . ignore)
      (insert-byte . insert-char)
      (multibyte-char-to-unibyte . identity))))
@@ -128,6 +122,19 @@ This is a compatibility function for different Emacsen."
          (setq start (- (length string) tail))))
       string))))
 
+(defalias 'mm-string-to-multibyte
+  (cond
+   ((featurep 'xemacs)
+    'identity)
+   ((fboundp 'string-to-multibyte)
+    'string-to-multibyte)
+   (t
+    (lambda (string)
+      "Return a multibyte string with the same individual chars as string."
+      (mapconcat
+       (lambda (ch) (mm-string-as-multibyte (char-to-string ch)))
+       string "")))))
+
 (eval-and-compile
   (defalias 'mm-char-or-char-int-p
     (cond
index b1ed0b7..311dce0 100644 (file)
@@ -373,8 +373,16 @@ Return that buffer."
           mm-security-handle 'gnus-details
           (format "Clear verification not supported by `%s'.\n" mml2015-use))))
       (goto-char (point-min))
-      (if (re-search-forward "\n[\t ]*\n" nil t)
-         (delete-region (point-min) (point)))
+      (forward-line)
+      ;; We need to be careful not to strip beyond the armor headers.
+      ;; Previously, an attacker could replace the text inside our
+      ;; markup with trailing garbage by injecting whitespace into the
+      ;; message.
+      (while (looking-at "Hash:") ; The only header allowed in cleartext
+       (forward-line))           ; signatures according to RFC2440.
+      (when (looking-at "[\t ]*$")
+       (forward-line))
+      (delete-region (point-min) (point))
       (if (re-search-forward mm-uu-pgp-beginning-signature nil t)
          (delete-region (match-beginning 0) (point-max)))
       (goto-char (point-min))
index 1590399..0ae4487 100644 (file)
@@ -501,9 +501,9 @@ If MML is non-nil, return the buffer up till the correspondent mml tag."
            (mm-with-unibyte-buffer
              (cond
               ((cdr (assq 'buffer cont))
-               (insert (with-current-buffer (cdr (assq 'buffer cont))
-                         (mm-with-unibyte-current-buffer
-                           (buffer-string)))))
+               (insert (mm-string-as-unibyte
+                        (with-current-buffer (cdr (assq 'buffer cont))
+                          (buffer-string)))))
               ((and filename
                     (not (equal (cdr (assq 'nofile cont)) "yes")))
                (let ((coding-system-for-read mm-binary-coding-system))
index 591ef64..6c58272 100644 (file)
     (if (condition-case err
            (prog1
                (mm-with-unibyte-buffer
-                 (insert (encode-coding-string text coding-system))
+                 (insert (mm-encode-coding-string text coding-system))
                  (pgg-verify-region (point-min) (point-max) nil t))
              (goto-char (point-min))
              (while (search-forward "\r\n" nil t)
index 0c83a2d..a569314 100644 (file)
@@ -263,7 +263,7 @@ not 'century, sorry).
 
 NOTE: the units of measure actually express dates, not durations: if you
 use 'week, messages will pop up on Sundays at 00:00 (or Mondays if
-`nndiary-week-starts-on-monday' is non nil) and *not* 7 days before the
+`nndiary-week-starts-on-monday' is non-nil) and *not* 7 days before the
 appointement, if you use 'month, messages will pop up on the first day of
 each months, at 00:00 and so on.
 
index 92a62d1..4b5f187 100644 (file)
@@ -303,7 +303,7 @@ included.")
       (setq buf (cons (string (string-to-number (match-string 1 file) 16))
                      (cons (substring file pos (match-beginning 0)) buf))
            pos (match-end 0)))
-    (decode-coding-string
+    (mm-decode-coding-string
      (apply (function concat)
            (nreverse (cons (substring file pos) buf)))
      (or coding-system nnmail-pathname-coding-system))))
index 37ecaf0..0b19fd0 100644 (file)
          (setq article (if (and article (< start article)) article start))
          (goto-char point)
          (while (re-search-forward
-                 "<a name=\"\\([0-9]+\\)\">\\([^<]+\\)</a>.*\n.*\n.*score:\\([^)]+\\))"
+                 "<a name=\"\\([0-9]+\\)\">\\([^<]+\\)\\(?:.*\n\\)\\{2,10\\}.*score:\\([^)]+\\))"
                  nil t)
            (setq cid (match-string 1)
                  subject (match-string 2)
index 9dc429e..e520121 100644 (file)
@@ -75,7 +75,7 @@ The SOUP packet file name will be inserted at the %s.")
   "*Regular expression matching SOUP packets in `nnsoup-packet-directory'.")
 
 (defvoo nnsoup-always-save t
-  "If non nil commit the reply buffer on each message send.
+  "If non-nil commit the reply buffer on each message send.
 This is necessary if using message mode outside Gnus with nnsoup as a
 backend for the messages.")
 
index baffa00..a105083 100644 (file)
 
 (require 'help-mode)
 
-
-;;;###autoload
-(defun help-with-tutorial (&optional arg)
-  "Select the Emacs learn-by-doing tutorial.
-If there is a tutorial version written in the language
-of the selected language environment, that version is used.
-If there's no tutorial in that language, `TUTORIAL' is selected.
-With ARG, you are asked to choose which language."
-  (interactive "P")
-  (let ((lang (if arg
-                  (let ((minibuffer-setup-hook minibuffer-setup-hook))
-                    (add-hook 'minibuffer-setup-hook
-                              'minibuffer-completion-help)
-                    (read-language-name 'tutorial "Language: " "English"))
-               (if (get-language-info current-language-environment 'tutorial)
-                   current-language-environment
-                 "English")))
-       file filename)
-    (setq filename (get-language-info lang 'tutorial))
-    (setq file (expand-file-name (concat "~/" filename)))
-    (delete-other-windows)
-    (if (get-file-buffer file)
-       (switch-to-buffer (get-file-buffer file))
-      (switch-to-buffer (create-file-buffer file))
-      (setq buffer-file-name file)
-      (setq default-directory (expand-file-name "~/"))
-      (setq buffer-auto-save-file-name nil)
-      (insert-file-contents (expand-file-name filename data-directory))
-      (hack-local-variables)
-      (goto-char (point-min))
-      (search-forward "\n<<")
-      (beginning-of-line)
-      ;; Convert the <<...>> line to the proper [...] line,
-      ;; or just delete the <<...>> line if a [...] line follows.
-      (cond ((save-excursion
-              (forward-line 1)
-              (looking-at "\\["))
-            (delete-region (point) (progn (forward-line 1) (point))))
-           ((looking-at "<<Blank lines inserted.*>>")
-            (replace-match "[Middle of page left blank for didactic purposes.   Text continues below]"))
-           (t
-            (looking-at "<<")
-            (replace-match "[")
-            (search-forward ">>")
-            (replace-match "]")))
-      (beginning-of-line)
-      (let ((n (- (window-height (selected-window))
-                 (count-lines (point-min) (point))
-                 6)))
-       (if (< n 8)
-           (progn
-             ;; For a short gap, we don't need the [...] line,
-             ;; so delete it.
-             (delete-region (point) (progn (end-of-line) (point)))
-             (newline n))
-         ;; Some people get confused by the large gap.
-         (newline (/ n 2))
-
-         ;; Skip the [...] line (don't delete it).
-         (forward-line 1)
-         (newline (- n (/ n 2)))))
-      (goto-char (point-min))
-      (setq buffer-undo-list nil)
-      (set-buffer-modified-p nil))))
-
-\f
 ;; Functions
 
 ;;;###autoload
index cc78bd7..66a2497 100644 (file)
@@ -152,7 +152,7 @@ and then returns."
                                 (progn
                                   (if (eq (car-safe char) 'switch-frame)
                                       (handle-switch-frame char))
-                                  (if (memq char '(?\C-v ?\ ))
+                                  (if (memq char '(?\C-v ?\s))
                                       (scroll-up))
                                   (if (or (memq char '(?\177 ?\M-v
                                                        delete backspace))
index 34b1a2f..8c0f92f 100644 (file)
@@ -361,7 +361,7 @@ With argument, display info only for the selected version."
          ((<= version 18)
           (setq version (format "%d" version)))
          ((> version emacs-major-version)
-          (error "No news about emacs %d (yet)" version))))
+          (error "No news about Emacs %d (yet)" version))))
   (let* ((vn (if (stringp version)
                 (string-to-number version)
               version))
@@ -887,7 +887,7 @@ appeared on the mode-line."
                    (cond
                     ((= 0 (length i))
                      nil)
-                    ((eq (aref i 0) ?\ )
+                    ((eq (aref i 0) ?\s)
                      (substring i 1))
                     (t
                      i))))
@@ -909,7 +909,7 @@ is currently activated with completion."
   "Return a minor mode symbol from its indicator on the modeline."
   ;; remove first space if existed
   (if (and (< 0 (length indicator))
-          (eq (aref indicator 0) ?\ ))
+          (eq (aref indicator 0) ?\s))
       (setq indicator (substring indicator 1)))
   (let ((minor-modes minor-mode-alist)
        result)
@@ -920,7 +920,7 @@ is currently activated with completion."
        ;; remove first space if existed
        (if (and (stringp anindicator)
                 (> (length anindicator) 0)
-                (eq (aref anindicator 0) ?\ ))
+                (eq (aref anindicator 0) ?\s))
            (setq anindicator (substring anindicator 1)))
        (if (equal indicator anindicator)
            (setq result minor-mode
index d753fc8..39c313c 100644 (file)
@@ -87,12 +87,12 @@ Quoting cannot be used, so the arguments cannot themselves contain spaces."
 
 (defface hexl-address-region
   '((t (:inherit header-line)))
-  "Face used in address are of hexl-mode buffer."
+  "Face used in address area of hexl-mode buffer."
   :group 'hexl)
 
 (defface hexl-ascii-region
   '((t (:inherit header-line)))
-  "Face used in ascii are of hexl-mode buffer."
+  "Face used in ascii area of hexl-mode buffer."
   :group 'hexl)
 
 (defvar hexl-max-address 0
@@ -100,15 +100,22 @@ Quoting cannot be used, so the arguments cannot themselves contain spaces."
 
 (defvar hexl-mode-map nil)
 
+;; Variable declarations for suppressing warnings from the byte-compiler.
 (defvar ruler-mode)
 (defvar ruler-mode-ruler-function)
 (defvar hl-line-mode)
+(defvar hl-line-range-function)
+(defvar hl-line-face)
 
+;; Variables where the original values are stored to.
 (defvar hexl-mode-old-hl-line-mode)
+(defvar hexl-mode-old-hl-line-range-function)
+(defvar hexl-mode-old-hl-line-face)
 (defvar hexl-mode-old-local-map)
 (defvar hexl-mode-old-mode-name)
 (defvar hexl-mode-old-major-mode)
 (defvar hexl-mode-old-ruler-mode)
+(defvar hexl-mode-old-ruler-function)
 (defvar hexl-mode-old-isearch-search-fun-function)
 (defvar hexl-mode-old-require-final-newline)
 (defvar hexl-mode-old-syntax-table)
@@ -169,7 +176,7 @@ A sample format:
   000000b0: 7461 626c 6520 6368 6172 6163 7465 7220  table character
   000000c0: 7265 6769 6f6e 2e0a                      region..
 
-Movement is as simple as movement in a normal emacs text buffer.  Most
+Movement is as simple as movement in a normal Emacs text buffer.  Most
 cursor movement bindings are the same (ie. Use \\[hexl-backward-char], \\[hexl-forward-char], \\[hexl-next-line], and \\[hexl-previous-line]
 to move the cursor left, right, down, and up).
 
@@ -207,31 +214,27 @@ You can use \\[hexl-find-file] to visit a file in Hexl mode.
   (unless (eq major-mode 'hexl-mode)
     (let ((modified (buffer-modified-p))
          (inhibit-read-only t)
-         (original-point (- (point) (point-min)))
-         max-address)
+         (original-point (- (point) (point-min))))
       (and (eobp) (not (bobp))
           (setq original-point (1- original-point)))
-      (if (not (or (eq arg 1) (not arg)))
-         ;; if no argument then we guess at hexl-max-address
-          (setq max-address (+ (* (/ (1- (buffer-size)) 68) 16) 15))
-        (setq max-address (1- (buffer-size)))
+      ;; If `hexl-mode' is invoked with an argument the buffer is assumed to
+      ;; be in hexl format.
+      (when (memq arg '(1 nil))
        ;; If the buffer's EOL type is -dos, we need to account for
        ;; extra CR characters added when hexlify-buffer writes the
        ;; buffer to a file.
+        ;; FIXME: This doesn't take into account multibyte coding systems.
        (when (eq (coding-system-eol-type buffer-file-coding-system) 1)
-         (setq max-address (+ (count-lines (point-min) (point-max))
-                              max-address))
-         ;; But if there's no newline at the last line, we are off by
-         ;; one; adjust.
-         (or (eq (char-before (point-max)) ?\n)
-             (setq max-address (1- max-address)))
-         (setq original-point (+ (count-lines (point-min) (point))
+          (setq original-point (+ (count-lines (point-min) (point))
                                  original-point))
          (or (bolp) (setq original-point (1- original-point))))
         (hexlify-buffer)
         (restore-buffer-modified-p modified))
-      (make-local-variable 'hexl-max-address)
-      (setq hexl-max-address max-address)
+      (set (make-local-variable 'hexl-max-address)
+           (let* ((full-lines (/ (buffer-size) 68))
+                  (last-line (% (buffer-size) 68))
+                  (last-line-bytes (% last-line 52)))
+             (+ last-line-bytes (* full-lines 16) -1)))
       (condition-case nil
          (hexl-goto-address original-point)
        (error nil)))
@@ -390,8 +393,16 @@ With arg, don't unhexlify buffer."
 
   (if (and (boundp 'ruler-mode) ruler-mode (not hexl-mode-old-ruler-mode))
       (ruler-mode 0))
+  (when (boundp 'hexl-mode-old-ruler-function)
+    (setq ruler-mode-ruler-function hexl-mode-old-ruler-function))
+
   (if (and (boundp 'hl-line-mode) hl-line-mode (not hexl-mode-old-hl-line-mode))
       (hl-line-mode 0))
+  (when (boundp 'hexl-mode-old-hl-line-range-function)
+    (setq hl-line-range-function hexl-mode-old-hl-line-range-function))
+  (when (boundp hexl-mode-old-hl-line-face)
+    (setq hl-line-face hexl-mode-old-hl-line-face))
   (setq require-final-newline hexl-mode-old-require-final-newline)
   (setq mode-name hexl-mode-old-mode-name)
   (setq isearch-search-fun-function hexl-mode-old-isearch-search-fun-function)
@@ -444,7 +455,7 @@ This function is intended to be used as eldoc callback."
 
 (defun hexl-goto-address (address)
   "Goto hexl-mode (decimal) address ADDRESS.
-Signal error if ADDRESS out of range."
+Signal error if ADDRESS is out of range."
   (interactive "nAddress: ")
   (if (or (< address 0) (> address hexl-max-address))
       (error "Out of hexl region"))
@@ -485,7 +496,7 @@ Signal error if HEX-ADDRESS is out of range."
   (hexl-goto-address (- (hexl-current-address) arg)))
 
 (defun hexl-forward-char (arg)
-  "Move right ARG bytes (left if ARG negative) in hexl-mode."
+  "Move to right ARG bytes (left if ARG negative) in hexl-mode."
   (interactive "p")
   (hexl-goto-address (+ (hexl-current-address) arg)))
 
@@ -524,7 +535,7 @@ Signal error if HEX-ADDRESS is out of range."
                       address)))
 
 (defun hexl-forward-short (arg)
-  "Move right ARG shorts (left if ARG negative) in hexl-mode."
+  "Move to right ARG shorts (left if ARG negative) in hexl-mode."
   (interactive "p")
   (hexl-backward-short (- arg)))
 
@@ -563,13 +574,13 @@ Signal error if HEX-ADDRESS is out of range."
                       address)))
 
 (defun hexl-forward-word (arg)
-  "Move right ARG words (left if ARG negative) in hexl-mode."
+  "Move to right ARG words (left if ARG negative) in hexl-mode."
   (interactive "p")
   (hexl-backward-word (- arg)))
 
 (defun hexl-previous-line (arg)
   "Move vertically up ARG lines [16 bytes] (down if ARG negative) in hexl-mode.
-If there is byte at the target address move to the last byte in that line."
+If there is no byte at the target address move to the last byte in that line."
   (interactive "p")
   (hexl-next-line (- arg)))
 
@@ -655,12 +666,12 @@ If there's no byte at the target address, move to the first or last line."
     (recenter 0)))
 
 (defun hexl-beginning-of-1k-page ()
-  "Go to beginning of 1k boundary."
+  "Go to beginning of 1KB boundary."
   (interactive)
   (hexl-goto-address (logand (hexl-current-address) -1024)))
 
 (defun hexl-end-of-1k-page ()
-  "Go to end of 1k boundary."
+  "Go to end of 1KB boundary."
   (interactive)
   (hexl-goto-address (let ((address (logior (hexl-current-address) 1023)))
                       (if (> address hexl-max-address)
@@ -709,7 +720,9 @@ This discards the buffer's undo information."
            ;; Manually encode the args, otherwise they're encoded using
            ;; coding-system-for-write (i.e. buffer-file-coding-system) which
            ;; may not be what we want (e.g. utf-16 on a non-utf-16 system).
-           (mapcar (lambda (s) (encode-coding-string s locale-coding-system))
+           (mapcar (lambda (s)
+                     (if (not (multibyte-string-p s)) s
+                       (encode-coding-string s locale-coding-system)))
                    (split-string hexl-options)))
     (if (> (point) (hexl-address-to-marker hexl-max-address))
        (hexl-goto-address hexl-max-address))))
@@ -931,24 +944,31 @@ Customize the variable `hexl-follow-ascii' to disable this feature."
 (defun hexl-activate-ruler ()
   "Activate `ruler-mode'."
   (require 'ruler-mode)
+  (unless (boundp 'hexl-mode-old-ruler-function)
+    (set (make-local-variable 'hexl-mode-old-ruler-function)
+        ruler-mode-ruler-function))
   (set (make-local-variable 'ruler-mode-ruler-function)
        'hexl-mode-ruler)
   (ruler-mode 1))
 
 (defun hexl-follow-line ()
   "Activate `hl-line-mode'."
-  (require 'frame)
   (require 'hl-line)
-  (with-no-warnings
-    (set (make-local-variable 'hl-line-range-function)
-        'hexl-highlight-line-range)
-    (set (make-local-variable 'hl-line-face)
-        'highlight))
+  (unless (boundp 'hexl-mode-old-hl-line-range-function)
+    (set (make-local-variable 'hexl-mode-old-hl-line-range-function)
+        hl-line-range-function))
+  (unless (boundp 'hexl-mode-old-hl-line-face)
+    (set (make-local-variable 'hexl-mode-old-hl-line-face)
+        hl-line-face))
+  (set (make-local-variable 'hl-line-range-function)
+       'hexl-highlight-line-range)
+  (set (make-local-variable 'hl-line-face)
+       'highlight)
   (hl-line-mode 1))
 
 (defun hexl-highlight-line-range ()
   "Return the range of address region for the point.
-This function is assumed to be used as call back function for `hl-line-mode'."
+This function is assumed to be used as callback function for `hl-line-mode'."
   (cons
    (line-beginning-position)
    ;; 9 stands for (length "87654321:")
index 6687c13..8c1ee3a 100644 (file)
@@ -216,7 +216,7 @@ Usually run by inclusion in `minibuffer-setup-hook'."
   "Remove completions display \(if any) prior to new user input.
 Should be run in on the minibuffer `pre-command-hook'.  See `icomplete-mode'
 and `minibuffer-setup-hook'."
-  (when icomplete-eoinput
+  (when (and icomplete-mode icomplete-eoinput)
 
     (unless (>= icomplete-eoinput (point-max))
       (let ((buffer-undo-list t)) ; prevent entry
@@ -230,7 +230,7 @@ and `minibuffer-setup-hook'."
   "Insert icomplete completions display.
 Should be run via minibuffer `post-command-hook'.  See `icomplete-mode'
 and `minibuffer-setup-hook'."
-  (when (icomplete-simple-completing-p)
+  (when (and icomplete-mode (icomplete-simple-completing-p))
     (save-excursion
       (goto-char (point-max))
       ;; Register the end of input, so we know where the extra stuff
index 480b76c..0e18c4b 100644 (file)
@@ -404,13 +404,13 @@ example functions that filter filenames."
   :group 'ido)
 
 (defcustom ido-ignore-extensions t
-  "*Non-nil means ignore files in completion-ignored-extensions list."
+  "*Non-nil means ignore files in `completion-ignored-extensions' list."
   :type 'boolean
   :group 'ido)
 
 (defcustom ido-show-dot-for-dired nil
   "*Non-nil means to always put . as the first item in file name lists.
-This allows the current directory to be opened immediate with `dired'."
+This allows the current directory to be opened immediately with `dired'."
   :type 'boolean
   :group 'ido)
 
@@ -503,7 +503,7 @@ Value can be toggled within `ido' using `ido-toggle-regexp'."
 (defcustom ido-enable-prefix nil
   "*Non-nil means only match if the entered text is a prefix of file name.
 This behavior is like the standard emacs-completion.
-Nil means to match if the entered text is an arbitrary substring.
+If nil, match if the entered text is an arbitrary substring.
 Value can be toggled within `ido' using `ido-toggle-prefix'."
   :type 'boolean
   :group 'ido)
@@ -714,7 +714,7 @@ When a (partial) file name matches this regexp, merging is inhibited."
 
 (defcustom ido-max-dir-file-cache 100
   "*Maximum number of working directories to be cached.
-This is the size of the cache of file-name-all-completions results.
+This is the size of the cache of `file-name-all-completions' results.
 Each cache entry is time stamped with the modification time of the
 directory.  Some systems, like Windows, have unreliable directory
 modification times, so you may choose to disable caching on such
@@ -777,7 +777,7 @@ Obsolete.  Set 3rd element of `ido-decorations' instead."
   "*List of strings used by ido to display the alternatives in the minibuffer.
 There are 10 elements in this list:
 1st and 2nd elements are used as brackets around the prospect list,
-3rd element is the separator between prospects (ignored if ido-separator is set),
+3rd element is the separator between prospects (ignored if `ido-separator' is set),
 4th element is the string inserted at the end of a truncated list of prospects,
 5th and 6th elements are used as brackets around the common match string which
 can be completed using TAB,
@@ -795,13 +795,13 @@ subdirs in the alternatives."
   :group 'ido)
 
 (defface ido-first-match  '((t (:bold t)))
-  "*Font used by ido for highlighting first match."
+  "*Face used by ido for highlighting first match."
   :group 'ido)
 
 (defface ido-only-match  '((((class color))
                                  (:foreground "ForestGreen"))
                                 (t (:italic t)))
-  "*Font used by ido for highlighting only match."
+  "*Face used by ido for highlighting only match."
   :group 'ido)
 
 (defface ido-subdir  '((((min-colors 88) (class color))
@@ -809,7 +809,7 @@ subdirs in the alternatives."
                            (((class color))
                              (:foreground "red"))
                             (t (:underline t)))
-  "*Font used by ido for highlighting subdirs in the alternatives."
+  "*Face used by ido for highlighting subdirs in the alternatives."
   :group 'ido)
 
 (defface ido-indicator  '((((min-colors 88) (class color))
@@ -821,7 +821,7 @@ subdirs in the alternatives."
                                 :background "red"
                                 :width condensed))
                               (t (:inverse-video t)))
-  "*Font used by ido for highlighting its indicators."
+  "*Face used by ido for highlighting its indicators."
   :group 'ido)
 
 (defface ido-incomplete-regexp
@@ -864,7 +864,7 @@ variables:
   prefix    - either nil or a fixed prefix for the dirname
 
 The following variables are available, but should not be changed:
-  ido-current-directory - the unabbreviated directory name
+  `ido-current-directory' - the unabbreviated directory name
   item - equals `file' or `dir' depending on the current mode."
   :type 'hook
   :group 'ido)
@@ -1034,8 +1034,8 @@ selected.")
 
 (defvar ido-use-mycompletion-depth 0
   "Non-nil means use `ido' completion feedback.
-Is set by ido functions to the current minibuffer-depth, so that
-it doesn't interfere with other minibuffer usage.")
+Is set by ido functions to the current `minibuffer-depth',
+so that it doesn't interfere with other minibuffer usage.")
 
 (defvar ido-incomplete-regexp nil
   "Non-nil if an incomplete regexp is entered.")
@@ -1142,6 +1142,11 @@ it doesn't interfere with other minibuffer usage.")
          (pop-to-buffer b t t)
          (setq truncate-lines t)))))
 
+(defun ido-local-file-exists-p (file)
+  "Tell if FILE exists locally."
+  (let (file-name-handler-alist)
+    (file-exists-p file)))
+
 (defun ido-unc-hosts (&optional query)
   "Return list of UNC host names."
   (let ((hosts
@@ -2044,7 +2049,7 @@ If INITIAL is non-nil, it specifies the initial input string."
             (not (if ido-directory-too-big
                      (file-exists-p (concat ido-current-directory ido-final-text))
                    (ido-existing-item-p))))
-       (error "must specify valid item"))
+       (error "Must specify valid item"))
 
        (t
        (setq ido-selected
@@ -2068,8 +2073,9 @@ If INITIAL is non-nil, it specifies the initial input string."
              (ido-set-current-directory (file-name-directory (substring ido-current-directory 0 -1))))
          (setq ido-set-default-item t))
 
-        ((and (string-match (if ido-enable-tramp-completion "..[:@]\\'" "..:\\'") ido-selected)
-              (ido-is-root-directory)) ;; Ange-ftp or Tramp
+        ((and (string-match (if ido-enable-tramp-completion ".[:@]\\'" ".:\\'") ido-selected)
+              (ido-is-root-directory) ;; Ange-ftp or Tramp
+              (not (ido-local-file-exists-p ido-selected)))
          (ido-set-current-directory ido-current-directory ido-selected)
          (ido-trace "tramp prefix" ido-selected)
          (if (ido-is-slow-ftp-host)
@@ -2079,7 +2085,7 @@ If INITIAL is non-nil, it specifies the initial input string."
 
         ((or (string-match "[/\\][^/\\]" ido-selected)
              (and (memq system-type '(windows-nt ms-dos))
-                  (string-match "\\`.:" ido-selected)))
+                  (string-match "\\`[a-zA-Z]:" ido-selected)))
          (ido-set-current-directory (file-name-directory ido-selected))
          (setq ido-set-default-item t))
 
@@ -2163,7 +2169,7 @@ If INITIAL is non-nil, it specifies the initial input string."
 
        ;; buffer doesn't exist
        ((eq ido-create-new-buffer 'never)
-       (message "no buffer matching `%s'" buf))
+       (message "No buffer matching `%s'" buf))
 
        ((and (eq ido-create-new-buffer 'prompt)
             (not (y-or-n-p (format "No buffer matching `%s', create one? " buf))))
@@ -2270,7 +2276,9 @@ If INITIAL is non-nil, it specifies the initial input string."
        (let ((minibuffer-completing-file-name t))
          (setq filename (ido-read-internal item
                                            (or prompt "Find file: ")
-                                           'ido-file-history nil nil initial))))
+                                           'ido-file-history
+                                           (and (eq method 'alt-file) buffer-file-name)
+                                           nil initial))))
 
       ;; Choose the file name: either the text typed in, or the head
       ;; of the list of matches
@@ -2426,7 +2434,8 @@ If INITIAL is non-nil, it specifies the initial input string."
      ((and (= 1 (length ido-matches))
           (not (and ido-enable-tramp-completion
                     (string-equal ido-current-directory "/")
-                    (string-match "..[@:]\\'" (ido-name (car ido-matches))))))
+                    (string-match ".[@:]\\'" (ido-name (car ido-matches)))))
+                    (not (ido-local-file-exists-p (ido-name (car ido-matches)))))
       ;; only one choice, so select it.
       (if (not ido-confirm-unique-completion)
          (exit-minibuffer)
@@ -2521,10 +2530,10 @@ C-x d ... C-f    fallback to non-ido dired."
 (defun ido-magic-backward-char ()
   "Move backward in user input or perform magic action.
 If no user input is present, or at start of input, perform magic actions:
-C-x C-f C-b  switch to ido-switch-buffer.
-C-x C-d C-b  switch to ido-switch-buffer.
-C-x d C-b    switch to ido-switch-buffer.
-C-x C-b C-b  fallback to non-ido switch-to-buffer."
+C-x C-f C-b  switch to `ido-switch-buffer'.
+C-x C-d C-b  switch to `ido-switch-buffer'.
+C-x d C-b    switch to `ido-switch-buffer'.
+C-x C-b C-b  fallback to non-ido `switch-to-buffer'."
   (interactive)
   (cond
    ((> (point) (minibuffer-prompt-end))
@@ -2658,19 +2667,19 @@ If no buffer or file exactly matching the prompt exists, maybe create a new one.
   (exit-minibuffer))
 
 (defun ido-enter-dired ()
-  "Drop into dired from file switching."
+  "Drop into `dired' from file switching."
   (interactive)
   (setq ido-exit 'dired)
   (exit-minibuffer))
 
 (defun ido-enter-insert-buffer ()
-  "Drop into insert buffer from insert file."
+  "Drop into `insert-buffer' from insert file."
   (interactive)
   (setq ido-exit 'insert-buffer)
   (exit-minibuffer))
 
 (defun ido-enter-insert-file ()
-  "Drop into insert file from insert buffer."
+  "Drop into `insert-file' from insert buffer."
   (interactive)
   (setq ido-exit 'insert-file)
   (exit-minibuffer))
@@ -2917,18 +2926,21 @@ If repeated, insert text from buffer instead."
   (let ((word (save-excursion
                (set-buffer ido-entry-buffer)
                (let ((p (point)) start-line end-line start-name name)
-                 (beginning-of-line)
-                 (setq start-line (point))
-                 (end-of-line)
-                 (setq end-line (point))
-                 (goto-char p)
-                 (if (re-search-backward "[^-_a-zA-Z0-9:./\\~@]" start-line 1)
-                     (forward-char 1))
-                 (setq start-name (point))
-                 (re-search-forward "[-_a-zA-Z0-9:./\\~@]*" end-line 1)
-                 (if (= start-name (point))
-                     nil
-                   (buffer-substring-no-properties start-name (point)))))))
+                 (if (and mark-active (/= p (mark)))
+                     (setq start-name (mark))
+                   (beginning-of-line)
+                   (setq start-line (point))
+                   (end-of-line)
+                   (setq end-line (point))
+                   (goto-char p)
+                   (if (re-search-backward "[^-_a-zA-Z0-9:./\\~@]" start-line 1)
+                       (forward-char 1))
+                   (setq start-name (point))
+                   (re-search-forward "[-_a-zA-Z0-9:./\\~@]*" end-line 1)
+                   (if (= start-name (point))
+                       (setq start-name nil)))
+                 (and start-name
+                      (buffer-substring-no-properties start-name (point)))))))
     (if (cond
         ((not word) nil)
         ((string-match "\\`[~/]" word)
@@ -3433,9 +3445,11 @@ for first matching file."
       (let ((default-directory ido-current-directory))
        (ido-to-end ;; move ftp hosts and visited files to end
         (delq nil (mapcar
-                   (lambda (x) (if (or (string-match "..:\\'" x)
+                   (lambda (x) (if (or (and (string-match ".:\\'" x)
+                                            (not (ido-local-file-exists-p x)))
                                        (and (not (ido-final-slash x))
-                                            (get-file-buffer x))) x))
+                                            (let (file-name-handler-alist)
+                                              (get-file-buffer x)))) x))
                    ido-temp-list)))))
     (ido-to-end  ;; move . files to end
      (delq nil (mapcar
@@ -3742,7 +3756,7 @@ for first matching file."
                  (funcall f completion-list
                           :help-string "ido "
                           :activate-callback
-                          '(lambda (x y z) (message "doesn't work yet, sorry!"))))
+                          '(lambda (x y z) (message "Doesn't work yet, sorry!"))))
              ;; else running Emacs
              ;;(add-hook 'completion-setup-hook 'completion-setup-function)
              (display-completion-list completion-list)))))))
@@ -4053,7 +4067,7 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
 
 ;;;###autoload
 (defun ido-dired ()
-  "Call dired the ido way.
+  "Call `dired' the ido way.
 The directory is selected interactively by typing a substring.
 For details of keybindings, do `\\[describe-function] ido-find-file'."
   (interactive)
@@ -4062,7 +4076,7 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
     (ido-file-internal 'dired 'dired nil "Dired: " 'dir)))
 
 (defun ido-list-directory ()
-  "Call list-directory the ido way.
+  "Call `list-directory' the ido way.
 The directory is selected interactively by typing a substring.
 For details of keybindings, do `\\[describe-function] ido-find-file'."
   (interactive)
@@ -4149,8 +4163,9 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
            (setq refresh t))
          ))
 
-        ((and (string-match (if ido-enable-tramp-completion "..[:@]\\'" "..:\\'") contents)
-              (ido-is-root-directory)) ;; Ange-ftp or tramp
+        ((and (string-match (if ido-enable-tramp-completion ".[:@]\\'" ".:\\'") contents)
+              (ido-is-root-directory) ;; Ange-ftp or tramp
+              (not (ido-local-file-exists-p contents)))
          (ido-set-current-directory ido-current-directory contents)
          (when (ido-is-slow-ftp-host)
            (setq ido-exit 'fallback)
index b563358..99d7ea2 100644 (file)
@@ -87,7 +87,7 @@
 Each element looks like (REGEXP . NUM).
 NUM specifies which parenthesized expression in the regexp.
 
-image filename regex exsamples:
+Examples of image filename regexps:
     file://foo.png
     `file://foo.png'
     \\[\\[foo.gif]]
@@ -116,7 +116,7 @@ image filename regex exsamples:
     (locate-library filename t path)))
 
 (defun iimage-mode-buffer (arg)
-"Display/Undisplay Images.
+"Display/undisplay images.
 With numeric ARG, display the images if and only if ARG is positive."
   (interactive)
   (let ((ing (if (numberp arg)
index ee3eea8..38b509b 100644 (file)
@@ -512,7 +512,7 @@ Use \\[edit-tab-stops] to edit them interactively."
        (let ((opoint (point)))
          (delete-horizontal-space t)
          (indent-to (car tabs)))
-      (insert ?\ ))))
+      (insert ?\s))))
 
 (defun move-to-tab-stop ()
   "Move point to next defined tab-stop column.
@@ -529,11 +529,11 @@ Use \\[edit-tab-stops] to edit them interactively."
            (goto-char before)
            ;; If we just added a tab, or moved over one,
            ;; delete any superfluous spaces before the old point.
-           (if (and (eq (preceding-char) ?\ )
+           (if (and (eq (preceding-char) ?\s)
                     (eq (following-char) ?\t))
                (let ((tabend (* (/ (current-column) tab-width) tab-width)))
                  (while (and (> (current-column) tabend)
-                             (eq (preceding-char) ?\ ))
+                             (eq (preceding-char) ?\s))
                    (forward-char -1))
                  (delete-region (point) before))))))))
 
index 2ac461a..5097f2f 100644 (file)
@@ -250,10 +250,10 @@ system."
 ;;;###autoload
 (defun info-lookup-symbol (symbol &optional mode)
   "Display the definition of SYMBOL, as found in the relevant manual.
-When this command is called interactively, it reads SYMBOL from the minibuffer.
-In the minibuffer, use M-n to yank the default argument value
-into the minibuffer so you can edit it.
-The default symbol is the one found at point.
+When this command is called interactively, it reads SYMBOL from the
+minibuffer.  In the minibuffer, use M-n to yank the default argument
+value into the minibuffer so you can edit it.  The default symbol is the
+one found at point.
 
 With prefix arg a query for the symbol help mode is offered."
   (interactive
@@ -566,6 +566,45 @@ Return nil if there is nothing appropriate in the buffer near point."
               (concat prefix name))))
     (error nil)))
 
+(defun info-lookup-guess-custom-symbol ()
+  "Get symbol at point in custom buffers."
+  (condition-case nil
+      (save-excursion
+       (let ((case-fold-search t)
+             (ignored-chars "][()`',:.\" \t\n")
+             (significant-chars "^][()`',:.\" \t\n")
+             beg end)
+         (cond
+          ((and (memq (get-char-property (point) 'face)
+                        '(custom-variable-tag custom-variable-tag-face))
+                  (setq beg (previous-single-char-property-change
+                             (point) 'face nil (line-beginning-position)))
+                  (setq end (next-single-char-property-change
+                             (point) 'face nil (line-end-position)))
+                  (> end beg))
+           (subst-char-in-string
+            ?\s ?\- (buffer-substring-no-properties beg end)))
+          ((or (and (looking-at (concat "[" significant-chars "]"))
+                    (save-excursion
+                      (skip-chars-backward significant-chars)
+                      (setq beg (point)))
+                    (skip-chars-forward significant-chars)
+                    (setq end (point))
+                    (> end beg))
+               (and (looking-at "[ \t\n]")
+                    (looking-back (concat "[" significant-chars "]"))
+                    (setq end (point))
+                    (skip-chars-backward significant-chars)
+                    (setq beg (point))
+                    (> end beg))
+               (and (skip-chars-forward ignored-chars)
+                    (setq beg (point))
+                    (skip-chars-forward significant-chars)
+                    (setq end (point))
+                    (> end beg)))
+           (buffer-substring-no-properties beg end)))))
+    (error nil)))
+
 ;;;###autoload
 (defun info-complete-symbol (&optional mode)
   "Perform completion on symbol preceding point."
@@ -789,7 +828,7 @@ Return nil if there is nothing appropriate in the buffer near point."
 
 (info-lookup-maybe-add-help
  :mode 'emacs-lisp-mode
- :regexp "[^][()'\" \t\n]+"
+ :regexp "[^][()`',\" \t\n]+"
  :doc-spec '(;; Commands with key sequences appear in nodes as `foo' and
              ;; those without as `M-x foo'.
              ("(emacs)Command Index"  nil "`\\(M-x[ \t\n]+\\)?" "'")
@@ -806,13 +845,13 @@ Return nil if there is nothing appropriate in the buffer near point."
 
 (info-lookup-maybe-add-help
  :mode 'lisp-interaction-mode
- :regexp "[^][()'\" \t\n]+"
+ :regexp "[^][()`',\" \t\n]+"
  :parse-rule 'ignore
  :other-modes '(emacs-lisp-mode))
 
 (info-lookup-maybe-add-help
  :mode 'lisp-mode
- :regexp "[^()'\" \t\n]+"
+ :regexp "[^()`',\" \t\n]+"
  :parse-rule 'ignore
  :other-modes '(emacs-lisp-mode))
 
@@ -913,6 +952,18 @@ Return nil if there is nothing appropriate in the buffer near point."
              ;; This gets functions in evaluated classes.  Other
              ;; possible patterns don't seem to work too well.
              "`" "(")))
+
+(info-lookup-maybe-add-help
+ :mode 'custom-mode
+ :ignore-case t
+ :regexp "[^][()`',:\" \t\n]+"
+ :parse-rule 'info-lookup-guess-custom-symbol
+ :other-modes '(emacs-lisp-mode))
+
+(info-lookup-maybe-add-help
+ :mode 'help-mode
+ :regexp "[^][()`',:\" \t\n]+"
+ :other-modes '(emacs-lisp-mode))
 \f
 (provide 'info-look)
 
index 0b7c223..3522b57 100644 (file)
 
 (let ((tbl (standard-case-table)) c)
 
-;; In some languages, U+0049 LATIN CAPITAL LETTER I and U+0131 LATIN
-;; SMALL LETTER DOTLESS I make a case pair, and so do U+0130 LATIN
-;; CAPITAL LETTER I WITH DOT ABOVE and U+0069 LATIN SMALL LETTER I.
-;; Thus we have to check language-environment to handle casing
-;; correctly.  Currently only I<->i is available.
-
   ;; Latin Extended-A, Latin Extended-B
   (setq c #x0100)
   (while (<= c #x0233)
         (set-case-syntax-pair
          (decode-char 'ucs (1- c)) (decode-char 'ucs c) tbl))
     (setq c (1+ c)))
-  (set-downcase-syntax  ?\e$,1 P\e(B ?i tbl)
-  (set-upcase-syntax    ?I ?\e$,1 Q\e(B tbl)
+
+
+  ;; In some languages, such as Turkish, U+0049 LATIN CAPITAL LETTER I
+  ;; and U+0131 LATIN SMALL LETTER DOTLESS I make a case pair, and so
+  ;; do U+0130 LATIN CAPITAL LETTER I WITH DOT ABOVE and U+0069 LATIN
+  ;; SMALL LETTER I.
+
+  ;; We used to set up half of those correspondence unconditionally,
+  ;; but that makes searches slow.  So now we don't set up either half
+  ;; of these correspondences by default.
+
+  ;;  (set-downcase-syntax  ?\e$,1 P\e(B ?i tbl)
+  ;;  (set-upcase-syntax    ?I ?\e$,1 Q\e(B tbl)
+
   (set-case-syntax-pair ?\e$,1 R\e(B ?\e$,1 S\e(B tbl)
   (set-case-syntax-pair ?\e$,1 T\e(B ?\e$,1 U\e(B tbl)
   (set-case-syntax-pair ?\e$,1 V\e(B ?\e$,1 W\e(B tbl)
index 80d305e..c1193e0 100644 (file)
@@ -382,10 +382,10 @@ PATTERN.  If no full XLFD name is gotten, return nil."
 
 (defun x-compose-font-name (fields &optional reduce)
   "Compose X's fontname from FIELDS.
-FIELDS is a vector of XLFD fields, the length 14.
+FIELDS is a vector of XLFD fields, of length 14.
 If a field is nil, wild-card letter `*' is embedded.
-Optional argument REDUCE is always ignored.  It exists just for
-backward compatibility."
+Optional argument REDUCE exists just for backward compatibility,
+and is always ignored."
   (concat "-" (mapconcat (lambda (x) (or x "*")) fields "-")))
 
 
@@ -463,7 +463,7 @@ variable `x-font-name-charset-alist'), add that information to FONTLIST."
 (defun fontset-name-p (fontset)
   "Return non-nil if FONTSET is valid as fontset name.
 A valid fontset name should conform to XLFD (X Logical Font Description)
-with \"fontset\" in `<CHARSET_REGISTRY> field."
+with \"fontset\" in `<CHARSET_REGISTRY>' field."
   (and (string-match xlfd-tight-regexp fontset)
        (string= (match-string (1+ xlfd-regexp-registry-subnum) fontset)
                "fontset")))
@@ -518,13 +518,12 @@ with \"fontset\" in `<CHARSET_REGISTRY> field."
                                         &optional style-variant noerror)
   "Create a fontset from fontset specification string FONTSET-SPEC.
 FONTSET-SPEC is a string of the format:
-       FONTSET-NAME,CHARSET-NAME0:FONT-NAME0,CHARSET-NAME1:FONT-NAME1, ...
+       FONTSET-NAME,CHARSET0:FONT0,CHARSET1:FONT1, ...
 Any number of SPACE, TAB, and NEWLINE can be put before and after commas.
 
-Optional 2nd argument is ignored.  It exists just for backward
-compatibility.
+Optional 2nd arg exists just for backward compatibility, and is ignored.
 
-If this function attempts to create already existing fontset, error is
+If this function attempts to create already existing fontset, an error is
 signaled unless the optional 3rd argument NOERROR is non-nil.
 
 It returns a name of the created fontset."
@@ -578,11 +577,11 @@ It returns a name of the created fontset."
                                            fontset-name)
   "Create a fontset from an ASCII font FONT.
 
-Optional 1st arg RESOLVED-FONT is a resolved name of FONT.  If
-omitted, `x-resolve-font-name' is called to get the resolved name.  At
-this time, if FONT is not available, error is signaled.
+Optional 2nd arg RESOLVED-FONT is a resolved name of FONT.
+If omitted, `x-resolve-font-name' is called to get the resolved name.
+At this time, if FONT is not available, an error is signaled.
 
-Optional 2nd arg FONTSET-NAME is a string to be used in
+Optional 3rd arg FONTSET-NAME is a string to be used in
 `<CHARSET_ENCODING>' fields of a new fontset name.  If it is omitted,
 an appropriate name is generated automatically.
 
index dbcd2bf..eb9878e 100644 (file)
     (insert ")\n\n")))
 
 (defun skkdic-convert (filename &optional dirname)
-  "Generate Emacs lisp file form Japanese dictionary file FILENAME.
+  "Generate Emacs Lisp file form Japanese dictionary file FILENAME.
 The format of the dictionary file should be the same as SKK dictionaries.
 Optional argument DIRNAME if specified is the directory name under which
 the generated Emacs Lisp is saved.
index 5e9846e..2cec516 100644 (file)
@@ -337,11 +337,13 @@ This also sets the following values:
        (or (local-variable-p 'buffer-file-coding-system buffer)
            (ucs-set-table-for-input buffer))))
 
-  (if (and default-enable-multibyte-characters (not (eq system-type 'darwin))
-          (or (not coding-system)
-              (not (coding-system-get coding-system 'ascii-incompatible))))
+  (if (eq system-type 'darwin)
       ;; The file-name coding system on Darwin systems is always utf-8.
-      (setq default-file-name-coding-system coding-system))
+      (setq default-file-name-coding-system 'utf-8)
+    (if (and default-enable-multibyte-characters
+            (or (not coding-system)
+                (not (coding-system-get coding-system 'ascii-incompatible))))
+       (setq default-file-name-coding-system coding-system)))
   ;; If coding-system is nil, honor that on MS-DOS as well, so
   ;; that they could reset the terminal coding system.
   (unless (and (eq window-system 'pc) coding-system)
index 9ddb666..8b610a0 100644 (file)
@@ -38,10 +38,10 @@ Distribution date of this version of MULE (multilingual environment).")
 (defun load-with-code-conversion (fullname file &optional noerror nomessage)
   "Execute a file of Lisp code named FILE whose absolute name is FULLNAME.
 The file contents are decoded before evaluation if necessary.
-If optional second arg NOERROR is non-nil,
+If optional third arg NOERROR is non-nil,
  report no error if FILE doesn't exist.
 Print messages at start and end of loading unless
- optional third arg NOMESSAGE is non-nil.
+ optional fourth arg NOMESSAGE is non-nil.
 Return t if file exists."
   (if (null (file-readable-p fullname))
       (and (null noerror)
@@ -71,8 +71,7 @@ Return t if file exists."
          (let ((load-file-name fullname)
                (set-auto-coding-for-load t)
                (inhibit-file-name-operation nil))
-           (save-excursion
-             (set-buffer buffer)
+           (with-current-buffer buffer
              ;; Don't let deactivate-mark remain set.
              (let (deactivate-mark)
                (insert-file-contents fullname))
@@ -100,7 +99,7 @@ Return t if file exists."
          (kill-buffer buffer)))
       (unless purify-flag
        (do-after-load-evaluation fullname))
-      
+
       (unless (or nomessage noninteractive)
        (if source
            (message "Loading %s (source)...done" file)
@@ -118,7 +117,7 @@ Return t if file exists."
              (< (aref vector 0) 160)))))
 
 (defsubst charsetp (object)
-  "T if OBJECT is a charset."
+  "Return t if OBJECT is a charset."
   (and (symbolp object) (vectorp (get object 'charset))))
 
 (defsubst charset-info (charset)
@@ -268,7 +267,7 @@ See the function `charset-info' for more detail."
 CODE1 and CODE2 are optional, but if you don't supply
 sufficient position codes, return a generic character which stands for
 all characters or group of characters in the character set.
-A generic character can be used to index a char table (e.g. syntax-table).
+A generic character can be used to index a char table (e.g. `syntax-table').
 
 Such character sets as ascii, eight-bit-control, and eight-bit-graphic
 don't have corresponding generic characters.  If CHARSET is one of
@@ -1683,8 +1682,7 @@ cons (CODING . SOURCE), where CODING is the specified coding
 system and SOURCE is a symbol `auto-coding-alist',
 `auto-coding-regexp-alist', `coding:', or `auto-coding-functions'
 indicating by what CODING is specified.  Note that the validity
-of CODING is not checked; it's callers responsibility to check
-it.
+of CODING is not checked; it's callers responsibility to check it.
 
 If nothing is specified, the return value is nil."
   (or (let ((coding-system (auto-coding-alist-lookup filename)))
@@ -1705,7 +1703,7 @@ If nothing is specified, the return value is nil."
        ;; and for "unibyte:" at the head and tail of SIZE bytes.
        (setq head-found (or (search-forward "coding:" head-end t)
                             (search-forward "unibyte:" head-end t)
-                            (search-forward "enable-character-translation:" 
+                            (search-forward "enable-character-translation:"
                                             head-end t)))
        (if (and head-found (> head-found tail-start))
            ;; Head and tail are overlapped.
@@ -1879,7 +1877,7 @@ The optional second arg VISIT non-nil means that we are visiting a file."
                      (set-buffer-multibyte nil))
                  (set-buffer-multibyte nil))
                (setq inserted (- pos-marker (point)))))
-         (set-buffer-modified-p modified-p))))
+         (restore-buffer-modified-p modified-p))))
   inserted)
 
 ;; The coding-spec and eol-type of coding-system returned is decided
@@ -2231,8 +2229,7 @@ Value is what BODY returns."
           (progn
             (set-category-table ,table)
             ,@body)
-        (save-current-buffer
-          (set-buffer ,old-buffer)
+        (with-current-buffer ,old-buffer
           (set-category-table ,old-table))))))
 
 (defun define-translation-hash-table (symbol table)
index 2d1f5f3..19e8735 100644 (file)
 
 ;;; Commentary:
 
-;; The kmacro package is an alternative user interface to emacs'
-;; keyboard macro functionality.  This functionality is normally bound
-;; to C-x (, C-x ), and C-x e, but these bindings are too hard to
-;; type to be really useful for doing small repeated tasks.
-
-;; With kmacro, two function keys are dedicated to keyboard macros,
-;; by default F3 and F4.  Personally, I prefer F1 and F2, but those
-;; keys already have default bindings.
-;;
+;; The kmacro package provides the user interface to emacs' basic
+;; keyboard macro functionality.  With kmacro, two function keys are
+;; dedicated to keyboard macros, by default F3 and F4.
+
+;; Note: The traditional bindings C-x (, C-x ), and C-x e are still
+;; supported, but for some users these bindings are too hard to type
+;; to be really useful for doing small repeated tasks.
+
 ;; To start defining a keyboard macro, use F3.  To end the macro,
 ;; use F4, and to call the macro also use F4.  This makes it very
 ;; easy to repeat a macro immediately after defining it.
@@ -55,7 +54,6 @@
 ;; elements with C-x C-k C-t.  To delete the first element in the
 ;; macro ring, use C-x C-k C-d.
 ;;
-;;
 ;; You can also use C-x C-k C-s to start a macro, and C-x C-k C-k to
 ;; end it; then use C-k to execute it immediately, or C-x C-k C-k to
 ;; execute it later.
index b070fe7..54d0f86 100644 (file)
@@ -368,7 +368,22 @@ and it selects the Spanish tutorial."))
             (unibyte-display . iso-latin-5)
             (input-method . "turkish-postfix")
             (sample-text . "Turkish (T\e,M|\e(Brk\e,Mg\e(Be)       Merhaba")
-            (documentation . t)))
+            (documentation . t)
+            (setup-function . turkish-case-conversion-enable)
+            (exit-function . turkish-case-conversion-disable)))
+
+(defun turkish-case-conversion-enable ()
+  "Set up Turkish case conversion of `i' and `I' into `\e$,1 P\e(B' and `\e$,1 Q\e(B'."
+  (let ((table (standard-case-table)))
+    (set-case-syntax-pair ?\e$,1 P\e(B ?i table)
+    (set-case-syntax-pair ?I ?\e$,1 Q\e(B table)))
+
+(defun turkish-case-conversion-disable ()
+  "Set up normal (non-Turkish) case conversion of `i' into `I'."
+  (let ((table (standard-case-table)))
+    (set-case-syntax-pair ?I ?i table)
+    (set-case-syntax ?\e$,1 P\e(B "w" table)
+    (set-case-syntax ?\e$,1 Q\e(B "w" table)))
 
 ;; Polish ISO 8859-2 environment.
 ;; Maintainer: Wlodek Bzyl <matwb@univ.gda.pl>
index 5584461..ee8db1f 100644 (file)
@@ -10805,7 +10805,7 @@ the current word list."
 
 
 ;; Move point forward to the end of Thai word which follows point and
-;; update VEC. VEC is a vector of three elements used to cache word
+;; update VEC.  VEC is a vector of three elements used to cache word
 ;; end positions.  The Nth element, if non-nil, is a list of end
 ;; points of the Nth word, or t indicating that there is no Thai
 ;; character.  LIMIT limits the point movement.
@@ -10886,7 +10886,7 @@ the current word list."
          nil)
        (progn
          ;; We found four succeeding Thai words (or LIMIT has been
-         ;; reached).  Move to the end of the first word.
+         ;; reached).  Move to the end of the first word.
          (goto-char (car v0))
          ;; Update VEC for the next function call.  If no larger word
          ;; positions have been found, set the corresponding vector
@@ -10899,7 +10899,7 @@ the current word list."
              (aset vec 1 v2)
              (aset vec 2 v3)))) ; exit function successfully
 
-      ;; We didn't find four consecutive words.         If we have found a
+      ;; We didn't find four consecutive words.  If we have found a
       ;; `second best' solution and the length of those two words is
       ;; longer than the longest word we can see at the current point,
       ;; adopt the second best solution.  This decision is based on
index 8e5975e..f7d8d46 100644 (file)
@@ -81,7 +81,7 @@ Display alphabetical listing of ABBREV-TABLE in buffer OUTPUT-BUFFER.
 ;;;***
 \f
 ;;;### (autoloads (ada-mode ada-add-extensions) "ada-mode" "progmodes/ada-mode.el"
-;;;;;;  (17778 49121))
+;;;;;;  (17778 50475))
 ;;; Generated autoloads from progmodes/ada-mode.el
 
 (autoload (quote ada-add-extensions) "ada-mode" "\
@@ -127,14 +127,14 @@ If you use imenu.el:
 
 If you use find-file.el:
  Switch to other file (Body <-> Spec)                 '\\[ff-find-other-file]'
-                                                   or '\\[ff-mouse-find-other-file]
+                                                  or '\\[ff-mouse-find-other-file]
  Switch to other file in other window                 '\\[ada-ff-other-window]'
-                                                   or '\\[ff-mouse-find-other-file-other-window]
+                                                  or '\\[ff-mouse-find-other-file-other-window]
  If you use this function in a spec and no body is available, it gets created with body stubs.
 
 If you use ada-xref.el:
  Goto declaration:          '\\[ada-point-and-xref]' on the identifier
-                         or '\\[ada-goto-declaration]' with point on the identifier
+                        or '\\[ada-goto-declaration]' with point on the identifier
  Complete identifier:       '\\[ada-complete-identifier]'.
 
 \(fn)" t nil)
@@ -142,7 +142,7 @@ If you use ada-xref.el:
 ;;;***
 \f
 ;;;### (autoloads (ada-header) "ada-stmt" "progmodes/ada-stmt.el"
-;;;;;;  (17390 27404))
+;;;;;;  (17778 50475))
 ;;; Generated autoloads from progmodes/ada-stmt.el
 
 (autoload (quote ada-header) "ada-stmt" "\
@@ -153,11 +153,11 @@ Insert a descriptive header at the top of the file.
 ;;;***
 \f
 ;;;### (autoloads (ada-find-file) "ada-xref" "progmodes/ada-xref.el"
-;;;;;;  (17778 48451))
+;;;;;;  (17778 50475))
 ;;; Generated autoloads from progmodes/ada-xref.el
 
 (autoload (quote ada-find-file) "ada-xref" "\
-Open a file anywhere in the source path.
+Open FILENAME, from anywhere in the source path.
 Completion is available.
 
 \(fn FILENAME)" t nil)
@@ -168,7 +168,7 @@ Completion is available.
 ;;;;;;  change-log-mode add-change-log-entry-other-window add-change-log-entry
 ;;;;;;  find-change-log prompt-for-change-log-name add-log-mailing-address
 ;;;;;;  add-log-full-name add-log-current-defun-function) "add-log"
-;;;;;;  "add-log.el" (17713 5989))
+;;;;;;  "add-log.el" (17778 50472))
 ;;; Generated autoloads from add-log.el
 
 (defvar add-log-current-defun-function nil "\
@@ -524,7 +524,7 @@ A replacement function for `newline-and-indent', aligning as it goes.
 ;;;***
 \f
 ;;;### (autoloads (outlineify-sticky allout-mode) "allout" "allout.el"
-;;;;;;  (17713 5989))
+;;;;;;  (17778 50472))
 ;;; Generated autoloads from allout.el
 
 (put (quote allout-show-bodies) (quote safe-local-variable) (if (fboundp (quote booleanp)) (quote booleanp) (quote (lambda (x) (member x (quote (t nil)))))))
@@ -983,7 +983,7 @@ ARG is positive, otherwise off.
 \f
 ;;;### (autoloads (apropos-documentation apropos-value apropos apropos-documentation-property
 ;;;;;;  apropos-command apropos-variable apropos-read-pattern) "apropos"
-;;;;;;  "apropos.el" (17713 5989))
+;;;;;;  "apropos.el" (17778 50472))
 ;;; Generated autoloads from apropos.el
 
 (autoload (quote apropos-read-pattern) "apropos" "\
@@ -1422,16 +1422,14 @@ This command is obsolete.
 ;;;***
 \f
 ;;;### (autoloads (autoarg-kp-mode autoarg-mode) "autoarg" "autoarg.el"
-;;;;;;  (17390 26935))
+;;;;;;  (17778 50472))
 ;;; Generated autoloads from autoarg.el
 
 (defvar autoarg-mode nil "\
 Non-nil if Autoarg mode is enabled.
 See the command `autoarg-mode' for a description of this minor-mode.")
 
-(custom-autoload (quote autoarg-mode) "autoarg")
-
-(put (quote autoarg-mode) (quote custom-set) (quote custom-set-minor-mode))
+(custom-autoload (quote autoarg-mode) "autoarg" nil)
 
 (autoload (quote autoarg-mode) "autoarg" "\
 Toggle Autoarg minor mode globally.
@@ -1459,18 +1457,17 @@ then invokes the normal binding of \\[autoarg-terminate].
 Non-nil if Autoarg-Kp mode is enabled.
 See the command `autoarg-kp-mode' for a description of this minor-mode.
 Setting this variable directly does not take effect;
-use either \\[customize] or the function `autoarg-kp-mode'.")
-
-(custom-autoload (quote autoarg-kp-mode) "autoarg")
+either customize it (see the info node `Easy Customization')
+or call the function `autoarg-kp-mode'.")
 
-(put (quote autoarg-kp-mode) (quote custom-set) (quote custom-set-minor-mode))
+(custom-autoload (quote autoarg-kp-mode) "autoarg" nil)
 
 (autoload (quote autoarg-kp-mode) "autoarg" "\
 Toggle Autoarg-KP minor mode globally.
 With ARG, turn Autoarg mode on if ARG is positive, off otherwise.
 \\<autoarg-kp-mode-map>
 This is similar to \\[autoarg-mode] but rebinds the keypad keys `kp-1'
-&c to supply digit arguments.
+etc. to supply digit arguments.
 
 \\{autoarg-kp-mode-map}
 
@@ -1698,7 +1695,7 @@ Vectors work just like lists.  Nested backquotes are permitted.
 ;;;***
 \f
 ;;;### (autoloads (display-battery-mode battery) "battery" "battery.el"
-;;;;;;  (17505 62422))
+;;;;;;  (17778 50472))
 ;;; Generated autoloads from battery.el
  (put 'battery-mode-line-string 'risky-local-variable t)
 
@@ -1713,9 +1710,10 @@ The text being displayed in the echo area is controlled by the variables
 Non-nil if Display-Battery mode is enabled.
 See the command `display-battery-mode' for a description of this minor-mode.
 Setting this variable directly does not take effect;
-use either \\[customize] or the function `display-battery-mode'.")
+either customize it (see the info node `Easy Customization')
+or call the function `display-battery-mode'.")
 
-(custom-autoload (quote display-battery-mode) "battery")
+(custom-autoload (quote display-battery-mode) "battery" nil)
 
 (autoload (quote display-battery-mode) "battery" "\
 Display battery status information in the mode line.
@@ -1761,8 +1759,8 @@ non-interactive use see also `benchmark-run' and
 
 ;;;***
 \f
-;;;### (autoloads (bibtex-mode) "bibtex" "textmodes/bibtex.el" (17549
-;;;;;;  4608))
+;;;### (autoloads (bibtex-mode) "bibtex" "textmodes/bibtex.el" (17778
+;;;;;;  50479))
 ;;; Generated autoloads from textmodes/bibtex.el
 
 (autoload (quote bibtex-mode) "bibtex" "\
@@ -2508,7 +2506,7 @@ Return a vector containing the lines from `bruce-phrases-file'.
 ;;;***
 \f
 ;;;### (autoloads (bs-show bs-customize bs-cycle-previous bs-cycle-next)
-;;;;;;  "bs" "bs.el" (17396 42170))
+;;;;;;  "bs" "bs.el" (17778 50472))
 ;;; Generated autoloads from bs.el
 
 (autoload (quote bs-cycle-next) "bs" "\
@@ -2638,7 +2636,7 @@ Also see `make-text-button'.
 ;;;;;;  batch-byte-compile-if-not-done display-call-tree byte-compile
 ;;;;;;  compile-defun byte-compile-file byte-recompile-directory
 ;;;;;;  byte-force-recompile byte-compile-warnings-safe-p) "bytecomp"
-;;;;;;  "emacs-lisp/bytecomp.el" (17591 9570))
+;;;;;;  "emacs-lisp/bytecomp.el" (17778 50473))
 ;;; Generated autoloads from emacs-lisp/bytecomp.el
 (put 'byte-compile-dynamic 'safe-local-variable 'booleanp)
 (put 'byte-compile-dynamic-docstrings 'safe-local-variable 'booleanp)
@@ -2742,7 +2740,7 @@ and corresponding effects.
 
 ;;;***
 \f
-;;;### (autoloads nil "cal-dst" "calendar/cal-dst.el" (17390 27324))
+;;;### (autoloads nil "cal-dst" "calendar/cal-dst.el" (17778 50472))
 ;;; Generated autoloads from calendar/cal-dst.el
 
 (put (quote calendar-daylight-savings-starts) (quote risky-local-variable) t)
@@ -2874,7 +2872,7 @@ See the documentation for `calculator-mode' for more information.
 ;;;;;;  mark-holidays-in-calendar view-calendar-holidays-initially
 ;;;;;;  calendar-remove-frame-by-deleting mark-diary-entries-in-calendar
 ;;;;;;  view-diary-entries-initially calendar-offset) "calendar"
-;;;;;;  "calendar/calendar.el" (17713 5989))
+;;;;;;  "calendar/calendar.el" (17778 50296))
 ;;; Generated autoloads from calendar/calendar.el
 
 (defvar calendar-offset 0 "\
@@ -3700,7 +3698,7 @@ and exists only for compatibility reasons.
 
 ;;;***
 \f
-;;;### (autoloads nil "cc-vars" "progmodes/cc-vars.el" (17524 8597))
+;;;### (autoloads nil "cc-vars" "progmodes/cc-vars.el" (17778 50475))
 ;;; Generated autoloads from progmodes/cc-vars.el
 (put 'c-basic-offset 'safe-local-variable 'integerp)
 (put 'c-backslash-column 'safe-local-variable 'integerp)
@@ -3991,7 +3989,7 @@ to the action header.
 ;;;;;;  checkdoc-comments checkdoc-continue checkdoc-start checkdoc-current-buffer
 ;;;;;;  checkdoc-eval-current-buffer checkdoc-message-interactive
 ;;;;;;  checkdoc-interactive checkdoc) "checkdoc" "emacs-lisp/checkdoc.el"
-;;;;;;  (17713 5989))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from emacs-lisp/checkdoc.el
 
 (autoload (quote checkdoc) "checkdoc" "\
@@ -4431,7 +4429,7 @@ read/written by MS-DOS software, or for display on the MS-DOS terminal.
 ;;;### (autoloads (comint-redirect-results-list-from-process comint-redirect-results-list
 ;;;;;;  comint-redirect-send-command-to-process comint-redirect-send-command
 ;;;;;;  comint-run make-comint make-comint-in-buffer) "comint" "comint.el"
-;;;;;;  (17713 5989))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from comint.el
 
 (defvar comint-output-filter-functions (quote (comint-postoutput-scroll-to-bottom comint-watch-for-password-prompt)) "\
@@ -4559,7 +4557,7 @@ on third call it again advances points to the next difference and so on.
 ;;;;;;  compilation-shell-minor-mode compilation-mode compilation-start
 ;;;;;;  compile compilation-disable-input compile-command compilation-search-path
 ;;;;;;  compilation-ask-about-save compilation-window-height compilation-mode-hook)
-;;;;;;  "compile" "progmodes/compile.el" (17713 5991))
+;;;;;;  "compile" "progmodes/compile.el" (17778 50475))
 ;;; Generated autoloads from progmodes/compile.el
 
 (defvar compilation-mode-hook nil "\
@@ -5223,7 +5221,7 @@ Insert a copyright by $ORGANIZATION notice at cursor.
 ;;;***
 \f
 ;;;### (autoloads (cperl-perldoc-at-point cperl-perldoc cperl-mode)
-;;;;;;  "cperl-mode" "progmodes/cperl-mode.el" (17778 49122))
+;;;;;;  "cperl-mode" "progmodes/cperl-mode.el" (17778 50475))
 ;;; Generated autoloads from progmodes/cperl-mode.el
 
 (autoload (quote cperl-mode) "cperl-mode" "\
@@ -5559,7 +5557,7 @@ Enable CUA selection mode without the C-z/C-x/C-c/C-v bindings.
 ;;;;;;  customize-face customize-changed-options customize-option-other-window
 ;;;;;;  customize-option customize-group-other-window customize-group
 ;;;;;;  customize-mode customize customize-save-variable customize-set-variable
-;;;;;;  customize-set-value) "cus-edit" "cus-edit.el" (17713 5989))
+;;;;;;  customize-set-value) "cus-edit" "cus-edit.el" (17778 50473))
 ;;; Generated autoloads from cus-edit.el
  (add-hook 'same-window-regexps "\\`\\*Customiz.*\\*\\'")
 
@@ -6430,7 +6428,7 @@ the first time the mode is used.
 ;;;***
 \f
 ;;;### (autoloads (describe-char describe-text-properties) "descr-text"
-;;;;;;  "descr-text.el" (17390 26936))
+;;;;;;  "descr-text.el" (17778 50473))
 ;;; Generated autoloads from descr-text.el
 
 (autoload (quote describe-text-properties) "descr-text" "\
@@ -6770,7 +6768,7 @@ With prefix arg, prompt for diff switches.
 ;;;***
 \f
 ;;;### (autoloads (diff-minor-mode diff-mode) "diff-mode" "diff-mode.el"
-;;;;;;  (17713 5989))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from diff-mode.el
 
 (autoload (quote diff-mode) "diff-mode" "\
@@ -6800,7 +6798,7 @@ Minor mode for viewing/editing context diffs.
 ;;;;;;  dired dired-copy-preserve-time dired-dwim-target dired-keep-marker-symlink
 ;;;;;;  dired-keep-marker-hardlink dired-keep-marker-copy dired-keep-marker-rename
 ;;;;;;  dired-trivial-filenames dired-ls-F-marks-symlinks dired-listing-switches)
-;;;;;;  "dired" "dired.el" (17713 5989))
+;;;;;;  "dired" "dired.el" (17778 50473))
 ;;; Generated autoloads from dired.el
 
 (defvar dired-listing-switches "-al" "\
@@ -7005,7 +7003,7 @@ Keybindings:
 ;;;;;;  dired-run-shell-command dired-do-shell-command dired-clean-directory
 ;;;;;;  dired-do-print dired-do-touch dired-do-chown dired-do-chgrp
 ;;;;;;  dired-do-chmod dired-compare-directories dired-backup-diff
-;;;;;;  dired-diff) "dired-aux" "dired-aux.el" (17778 48817))
+;;;;;;  dired-diff) "dired-aux" "dired-aux.el" (17778 50473))
 ;;; Generated autoloads from dired-aux.el
 
 (autoload (quote dired-diff) "dired-aux" "\
@@ -7469,7 +7467,7 @@ redefine OBJECT if it is a symbol.
 ;;;;;;  standard-display-graphic standard-display-g1 standard-display-ascii
 ;;;;;;  standard-display-default standard-display-8bit describe-current-display-table
 ;;;;;;  describe-display-table set-display-table-slot display-table-slot
-;;;;;;  make-display-table) "disp-table" "disp-table.el" (17390 26937))
+;;;;;;  make-display-table) "disp-table" "disp-table.el" (17778 50473))
 ;;; Generated autoloads from disp-table.el
 
 (autoload (quote make-display-table) "disp-table" "\
@@ -7663,7 +7661,7 @@ when pressed twice.  See variable `double-map' for details.
 
 ;;;***
 \f
-;;;### (autoloads (dunnet) "dunnet" "play/dunnet.el" (17591 9445))
+;;;### (autoloads (dunnet) "dunnet" "play/dunnet.el" (17778 50475))
 ;;; Generated autoloads from play/dunnet.el
 
 (autoload (quote dunnet) "dunnet" "\
@@ -7686,7 +7684,7 @@ Play sounds in message buffers.
 \f
 ;;;### (autoloads (easy-mmode-defsyntax easy-mmode-defmap easy-mmode-define-keymap
 ;;;;;;  define-global-minor-mode define-minor-mode) "easy-mmode"
-;;;;;;  "emacs-lisp/easy-mmode.el" (17713 5989))
+;;;;;;  "emacs-lisp/easy-mmode.el" (17778 50473))
 ;;; Generated autoloads from emacs-lisp/easy-mmode.el
 
 (defalias (quote easy-mmode-define-minor-mode) (quote define-minor-mode))
@@ -7924,7 +7922,7 @@ To implement dynamic menus, either call this from
 ;;;;;;  ebnf-eps-directory ebnf-spool-region ebnf-spool-buffer ebnf-spool-file
 ;;;;;;  ebnf-spool-directory ebnf-print-region ebnf-print-buffer
 ;;;;;;  ebnf-print-file ebnf-print-directory ebnf-customize) "ebnf2ps"
-;;;;;;  "progmodes/ebnf2ps.el" (17713 5991))
+;;;;;;  "progmodes/ebnf2ps.el" (17778 50475))
 ;;; Generated autoloads from progmodes/ebnf2ps.el
 
 (autoload (quote ebnf-customize) "ebnf2ps" "\
@@ -8335,7 +8333,7 @@ Display statistics for a class tree.
 ;;;***
 \f
 ;;;### (autoloads (electric-buffer-list) "ebuff-menu" "ebuff-menu.el"
-;;;;;;  (17390 26937))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from ebuff-menu.el
 
 (autoload (quote electric-buffer-list) "ebuff-menu" "\
@@ -8446,7 +8444,7 @@ Toggle edebugging of all forms.
 ;;;;;;  ediff-merge-directory-revisions ediff-merge-directories-with-ancestor
 ;;;;;;  ediff-merge-directories ediff-directories3 ediff-directory-revisions
 ;;;;;;  ediff-directories ediff-buffers3 ediff-buffers ediff-backup
-;;;;;;  ediff-files3 ediff-files) "ediff" "ediff.el" (17778 49123))
+;;;;;;  ediff-files3 ediff-files) "ediff" "ediff.el" (17778 50473))
 ;;; Generated autoloads from ediff.el
 
 (autoload (quote ediff-files) "ediff" "\
@@ -8812,7 +8810,7 @@ Turn on EDT Emulation.
 ;;;***
 \f
 ;;;### (autoloads (electric-helpify with-electric-help) "ehelp" "ehelp.el"
-;;;;;;  (17390 26937))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from ehelp.el
 
 (autoload (quote with-electric-help) "ehelp" "\
@@ -8951,7 +8949,7 @@ displayed.
 ;;;***
 \f
 ;;;### (autoloads (report-emacs-bug) "emacsbug" "mail/emacsbug.el"
-;;;;;;  (17444 1970))
+;;;;;;  (17778 50475))
 ;;; Generated autoloads from mail/emacsbug.el
 
 (autoload (quote report-emacs-bug) "emacsbug" "\
@@ -9057,7 +9055,7 @@ DISPLAY may be a display id, a frame, or nil for the selected frame's display.
 ;;;***
 \f
 ;;;### (autoloads (enriched-decode enriched-encode enriched-mode)
-;;;;;;  "enriched" "textmodes/enriched.el" (17390 26946))
+;;;;;;  "enriched" "textmodes/enriched.el" (17778 50479))
 ;;; Generated autoloads from textmodes/enriched.el
 
 (autoload (quote enriched-mode) "enriched" "\
@@ -9087,8 +9085,8 @@ Not documented
 
 ;;;***
 \f
-;;;### (autoloads (erc-handle-irc-url erc-select erc-select-read-args)
-;;;;;;  "erc" "erc/erc.el" (17713 4881))
+;;;### (autoloads (erc-handle-irc-url erc erc-select-read-args) "erc"
+;;;;;;  "erc/erc.el" (17778 50473))
 ;;; Generated autoloads from erc/erc.el
 
 (autoload (quote erc-select-read-args) "erc" "\
@@ -9096,7 +9094,7 @@ Prompt the user for values of nick, server, port, and password.
 
 \(fn)" nil nil)
 
-(autoload (quote erc-select) "erc" "\
+(autoload (quote erc) "erc" "\
 Select connection parameters and run ERC.
 Non-interactively, it takes keyword arguments
    (server (erc-compute-server))
@@ -9107,7 +9105,7 @@ Non-interactively, it takes keyword arguments
 
 That is, if called with
 
-   (erc-select :server \"irc.freenode.net\" :full-name \"Harry S Truman\")
+   (erc :server \"irc.freenode.net\" :full-name \"Harry S Truman\")
 
 server and full-name will be set to those values, whereas
 `erc-compute-port', `erc-compute-nick' and `erc-compute-full-name' will
@@ -9124,8 +9122,8 @@ Otherwise, connect to HOST:PORT as USER and /join CHANNEL.
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-autoaway" "erc/erc-autoaway.el" (17591
-;;;;;;  9873))
+;;;### (autoloads nil "erc-autoaway" "erc/erc-autoaway.el" (17778
+;;;;;;  50473))
 ;;; Generated autoloads from erc/erc-autoaway.el
  (autoload 'erc-autoaway-mode "erc-autoaway")
 
@@ -9137,14 +9135,14 @@ Otherwise, connect to HOST:PORT as USER and /join CHANNEL.
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-compat" "erc/erc-compat.el" (17374 21559))
+;;;### (autoloads nil "erc-compat" "erc/erc-compat.el" (17778 50473))
 ;;; Generated autoloads from erc/erc-compat.el
  (autoload 'erc-define-minor-mode "erc-compat")
 
 ;;;***
 \f
 ;;;### (autoloads (erc-ctcp-query-DCC pcomplete/erc-mode/DCC erc-cmd-DCC)
-;;;;;;  "erc-dcc" "erc/erc-dcc.el" (17396 42163))
+;;;;;;  "erc-dcc" "erc/erc-dcc.el" (17778 50473))
 ;;; Generated autoloads from erc/erc-dcc.el
 
 (autoload (quote erc-cmd-DCC) "erc-dcc" "\
@@ -9238,8 +9236,8 @@ Add EZBouncer convenience functions to ERC.
 
 ;;;***
 \f
-;;;### (autoloads (erc-fill) "erc-fill" "erc/erc-fill.el" (17396
-;;;;;;  42158))
+;;;### (autoloads (erc-fill) "erc-fill" "erc/erc-fill.el" (17778
+;;;;;;  50473))
 ;;; Generated autoloads from erc/erc-fill.el
  (autoload 'erc-fill-mode "erc-fill" nil t)
 
@@ -9319,7 +9317,7 @@ to RFC and send the LIST header (#321) at start of list transmission.
 ;;;***
 \f
 ;;;### (autoloads (erc-save-buffer-in-logs erc-logging-enabled) "erc-log"
-;;;;;;  "erc/erc-log.el" (17713 4879))
+;;;;;;  "erc/erc-log.el" (17778 50473))
 ;;; Generated autoloads from erc/erc-log.el
  (autoload 'erc-log-mode "erc-log" nil t)
 
@@ -9410,7 +9408,7 @@ Show who's gone.
 ;;;***
 \f
 ;;;### (autoloads (erc-server-select erc-determine-network) "erc-networks"
-;;;;;;  "erc/erc-networks.el" (17396 42158))
+;;;;;;  "erc/erc-networks.el" (17778 50473))
 ;;; Generated autoloads from erc/erc-networks.el
 
 (autoload (quote erc-determine-network) "erc-networks" "\
@@ -9459,7 +9457,7 @@ Not documented
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-replace" "erc/erc-replace.el" (17396 42158))
+;;;### (autoloads nil "erc-replace" "erc/erc-replace.el" (17778 50473))
 ;;; Generated autoloads from erc/erc-replace.el
  (autoload 'erc-replace-mode "erc-replace")
 
@@ -9489,7 +9487,7 @@ When called interactively, read the password using `read-passwd'.
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-sound" "erc/erc-sound.el" (17396 42158))
+;;;### (autoloads nil "erc-sound" "erc/erc-sound.el" (17778 50473))
 ;;; Generated autoloads from erc/erc-sound.el
  (autoload 'erc-sound-mode "erc-sound")
 
@@ -9520,7 +9518,7 @@ This will add a speedbar major display mode.
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-track" "erc/erc-track.el" (17591 9873))
+;;;### (autoloads nil "erc-track" "erc/erc-track.el" (17778 50473))
 ;;; Generated autoloads from erc/erc-track.el
  (autoload 'erc-track-mode "erc-track" nil t)
  (autoload 'erc-track-when-inactive-mode "erc-track" nil t)
@@ -9528,7 +9526,7 @@ This will add a speedbar major display mode.
 ;;;***
 \f
 ;;;### (autoloads (erc-truncate-buffer erc-truncate-buffer-to-size)
-;;;;;;  "erc-truncate" "erc/erc-truncate.el" (17396 42158))
+;;;;;;  "erc-truncate" "erc/erc-truncate.el" (17778 50473))
 ;;; Generated autoloads from erc/erc-truncate.el
  (autoload 'erc-truncate-mode "erc-truncate" nil t)
 
@@ -10317,7 +10315,7 @@ file modes.
 ;;;***
 \f
 ;;;### (autoloads (expand-jump-to-next-slot expand-jump-to-previous-slot
-;;;;;;  expand-add-abbrevs) "expand" "expand.el" (17390 26939))
+;;;;;;  expand-add-abbrevs) "expand" "expand.el" (17778 50473))
 ;;; Generated autoloads from expand.el
 
 (autoload (quote expand-add-abbrevs) "expand" "\
@@ -10360,7 +10358,7 @@ This is used only in conjunction with `expand-add-abbrevs'.
 
 ;;;***
 \f
-;;;### (autoloads (f90-mode) "f90" "progmodes/f90.el" (17390 27324))
+;;;### (autoloads (f90-mode) "f90" "progmodes/f90.el" (17778 50475))
 ;;; Generated autoloads from progmodes/f90.el
 
 (autoload (quote f90-mode) "f90" "\
@@ -10427,7 +10425,7 @@ with no args, if that value is non-nil.
 ;;;;;;  facemenu-remove-all facemenu-remove-face-props facemenu-set-read-only
 ;;;;;;  facemenu-set-intangible facemenu-set-invisible facemenu-set-face-from-menu
 ;;;;;;  facemenu-set-background facemenu-set-foreground facemenu-set-face)
-;;;;;;  "facemenu" "facemenu.el" (17778 48817))
+;;;;;;  "facemenu" "facemenu.el" (17778 50473))
 ;;; Generated autoloads from facemenu.el
  (define-key global-map "\M-o" 'facemenu-keymap)
  (autoload 'facemenu-keymap "facemenu" "Keymap for face-changing commands." t 'keymap)
@@ -10636,7 +10634,7 @@ Unconditionally turn on Fast Lock mode.
 \f
 ;;;### (autoloads (feedmail-queue-reminder feedmail-run-the-queue
 ;;;;;;  feedmail-run-the-queue-global-prompt feedmail-run-the-queue-no-prompts
-;;;;;;  feedmail-send-it) "feedmail" "mail/feedmail.el" (17713 5990))
+;;;;;;  feedmail-send-it) "feedmail" "mail/feedmail.el" (17778 50475))
 ;;; Generated autoloads from mail/feedmail.el
 
 (autoload (quote feedmail-send-it) "feedmail" "\
@@ -10647,12 +10645,12 @@ with various lower-level mechanisms to provide features such as queueing.
 \(fn)" nil nil)
 
 (autoload (quote feedmail-run-the-queue-no-prompts) "feedmail" "\
-Like feedmail-run-the-queue, but suppress confirmation prompts.
+Like `feedmail-run-the-queue', but suppress confirmation prompts.
 
 \(fn &optional ARG)" t nil)
 
 (autoload (quote feedmail-run-the-queue-global-prompt) "feedmail" "\
-Like feedmail-run-the-queue, but with a global confirmation prompt.
+Like `feedmail-run-the-queue', but with a global confirmation prompt.
 This is generally most useful if run non-interactively, since you can
 bail out with an appropriate answer to the global confirmation prompt.
 
@@ -10670,7 +10668,7 @@ backup file names and the like).
 Perform some kind of reminder activity about queued and draft messages.
 Called with an optional symbol argument which says what kind of event
 is triggering the reminder activity.  The default is 'on-demand, which
-is what you typically would use if you were putting this in your emacs start-up
+is what you typically would use if you were putting this in your Emacs start-up
 or mail hook code.  Other recognized values for WHAT-EVENT (these are passed
 internally by feedmail):
 
@@ -10679,18 +10677,18 @@ internally by feedmail):
    after-draft          (a message has just been placed in the draft directory)
    after-run            (the queue has just been run, possibly sending messages)
 
-WHAT-EVENT is used as a key into the table feedmail-queue-reminder-alist.  If
+WHAT-EVENT is used as a key into the table `feedmail-queue-reminder-alist'.  If
 the associated value is a function, it is called without arguments and is expected
 to perform the reminder activity.  You can supply your own reminder functions
-by redefining feedmail-queue-reminder-alist.  If you don't want any reminders,
-you can set feedmail-queue-reminder-alist to nil.
+by redefining `feedmail-queue-reminder-alist'.  If you don't want any reminders,
+you can set `feedmail-queue-reminder-alist' to nil.
 
 \(fn &optional WHAT-EVENT)" t nil)
 
 ;;;***
 \f
 ;;;### (autoloads (ffap-bindings dired-at-point ffap-at-mouse ffap-menu
-;;;;;;  find-file-at-point ffap-next) "ffap" "ffap.el" (17713 5989))
+;;;;;;  find-file-at-point ffap-next) "ffap" "ffap.el" (17778 50473))
 ;;; Generated autoloads from ffap.el
 
 (autoload (quote ffap-next) "ffap" "\
@@ -10820,7 +10818,7 @@ Set up hooks, load the cache file -- if existing -- and build the menu.
 
 ;;;***
 \f
-;;;### (autoloads nil "fill" "textmodes/fill.el" (17713 5992))
+;;;### (autoloads nil "fill" "textmodes/fill.el" (17778 50479))
 ;;; Generated autoloads from textmodes/fill.el
 (put 'colon-double-space 'safe-local-variable 'booleanp)
 
@@ -10983,7 +10981,7 @@ Visit the file you click on in another window.
 ;;;;;;  find-variable find-variable-noselect find-function-other-frame
 ;;;;;;  find-function-other-window find-function find-function-noselect
 ;;;;;;  find-function-search-for-symbol find-library) "find-func"
-;;;;;;  "emacs-lisp/find-func.el" (17713 5989))
+;;;;;;  "emacs-lisp/find-func.el" (17778 50473))
 ;;; Generated autoloads from emacs-lisp/find-func.el
 
 (autoload (quote find-library) "find-func" "\
@@ -11012,7 +11010,7 @@ not selected.  If the function definition can't be found in
 the buffer, returns (BUFFER).
 
 If the file where FUNCTION is defined is not known, then it is
-searched for in `find-function-source-path' if non nil, otherwise
+searched for in `find-function-source-path' if non-nil, otherwise
 in `load-path'.
 
 \(fn FUNCTION)" nil nil)
@@ -11026,7 +11024,7 @@ places point before the definition.
 Set mark before moving, if the buffer already existed.
 
 The library where FUNCTION is defined is searched for in
-`find-function-source-path', if non nil, otherwise in `load-path'.
+`find-function-source-path', if non-nil, otherwise in `load-path'.
 See also `find-function-recenter-line' and `find-function-after-hook'.
 
 \(fn FUNCTION)" t nil)
@@ -11053,7 +11051,7 @@ the point of the definition.  The buffer is not selected.
 If the variable's definition can't be found in the buffer, return (BUFFER).
 
 The library where VARIABLE is defined is searched for in FILE or
-`find-function-source-path', if non nil, otherwise in `load-path'.
+`find-function-source-path', if non-nil, otherwise in `load-path'.
 
 \(fn VARIABLE &optional FILE)" nil nil)
 
@@ -11067,7 +11065,7 @@ places point before the definition.
 Set mark before moving, if the buffer already existed.
 
 The library where VARIABLE is defined is searched for in
-`find-function-source-path', if non nil, otherwise in `load-path'.
+`find-function-source-path', if non-nil, otherwise in `load-path'.
 See also `find-function-recenter-line' and `find-function-after-hook'.
 
 \(fn VARIABLE)" t nil)
@@ -11094,7 +11092,7 @@ variable, `defface' for a face.  This function does not switch to the
 buffer nor display it.
 
 The library where SYMBOL is defined is searched for in FILE or
-`find-function-source-path', if non nil, otherwise in `load-path'.
+`find-function-source-path', if non-nil, otherwise in `load-path'.
 
 \(fn SYMBOL TYPE &optional FILE)" nil nil)
 
@@ -11108,7 +11106,7 @@ places point before the definition.
 Set mark before moving, if the buffer already existed.
 
 The library where FACE is defined is searched for in
-`find-function-source-path', if non nil, otherwise in `load-path'.
+`find-function-source-path', if non-nil, otherwise in `load-path'.
 See also `find-function-recenter-line' and `find-function-after-hook'.
 
 \(fn FACE)" t nil)
@@ -11218,7 +11216,7 @@ Not documented
 ;;;***
 \f
 ;;;### (autoloads (flymake-mode-off flymake-mode-on flymake-mode)
-;;;;;;  "flymake" "progmodes/flymake.el" (17778 48451))
+;;;;;;  "flymake" "progmodes/flymake.el" (17778 50475))
 ;;; Generated autoloads from progmodes/flymake.el
 
 (autoload (quote flymake-mode) "flymake" "\
@@ -11242,7 +11240,7 @@ Turn flymake mode off.
 \f
 ;;;### (autoloads (flyspell-buffer flyspell-region flyspell-mode-off
 ;;;;;;  turn-off-flyspell turn-on-flyspell flyspell-mode flyspell-prog-mode)
-;;;;;;  "flyspell" "textmodes/flyspell.el" (17778 49123))
+;;;;;;  "flyspell" "textmodes/flyspell.el" (17778 50479))
 ;;; Generated autoloads from textmodes/flyspell.el
 
 (autoload (quote flyspell-prog-mode) "flyspell" "\
@@ -11311,7 +11309,7 @@ Flyspell whole buffer.
 \f
 ;;;### (autoloads (follow-delete-other-windows-and-split follow-mode
 ;;;;;;  turn-off-follow-mode turn-on-follow-mode) "follow" "follow.el"
-;;;;;;  (17490 7930))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from follow.el
 
 (autoload (quote turn-on-follow-mode) "follow" "\
@@ -11444,7 +11442,7 @@ Visit a file in Forms mode in other window.
 ;;;***
 \f
 ;;;### (autoloads (fortran-mode fortran-tab-mode-default) "fortran"
-;;;;;;  "progmodes/fortran.el" (17374 21266))
+;;;;;;  "progmodes/fortran.el" (17778 50475))
 ;;; Generated autoloads from progmodes/fortran.el
 
 (defvar fortran-tab-mode-default nil "\
@@ -11453,7 +11451,7 @@ A non-nil value specifies tab-digit style of continuation control.
 A value of nil specifies that continuation lines are marked
 with a character in column 6.")
 
-(custom-autoload (quote fortran-tab-mode-default) "fortran")
+(custom-autoload (quote fortran-tab-mode-default) "fortran" t)
 
 (autoload (quote fortran-mode) "fortran" "\
 Major mode for editing Fortran code in fixed format.
@@ -11580,7 +11578,7 @@ and choose the directory as the fortune-file.
 ;;;***
 \f
 ;;;### (autoloads (gdb-enable-debug gdba) "gdb-ui" "progmodes/gdb-ui.el"
-;;;;;;  (17778 49122))
+;;;;;;  (17778 50475))
 ;;; Generated autoloads from progmodes/gdb-ui.el
 
 (autoload (quote gdba) "gdb-ui" "\
@@ -11719,7 +11717,7 @@ regular expression that can be used as an element of
 ;;;***
 \f
 ;;;### (autoloads (glasses-mode) "glasses" "progmodes/glasses.el"
-;;;;;;  (17407 3111))
+;;;;;;  (17778 50476))
 ;;; Generated autoloads from progmodes/glasses.el
 
 (autoload (quote glasses-mode) "glasses" "\
@@ -11779,37 +11777,10 @@ DEFAULT-MAP specifies the default key map for ICON-LIST.
 ;;;***
 \f
 ;;;### (autoloads (gnus gnus-other-frame gnus-slave gnus-no-server
-;;;;;;  gnus-slave-no-server gnus-select-method gnus-getenv-nntpserver)
-;;;;;;  "gnus" "gnus/gnus.el" (17778 49126))
+;;;;;;  gnus-slave-no-server) "gnus" "gnus/gnus.el" (17778 50473))
 ;;; Generated autoloads from gnus/gnus.el
-
-(autoload (quote gnus-getenv-nntpserver) "gnus" "\
-Find default nntp server.
-Check the NNTPSERVER environment variable and the
-`gnus-nntpserver-file' file.
-
-\(fn)" nil nil)
-
-(defvar gnus-select-method (condition-case nil (nconc (list (quote nntp) (or (condition-case nil (gnus-getenv-nntpserver) (error nil)) (when (and gnus-default-nntp-server (not (string= gnus-default-nntp-server ""))) gnus-default-nntp-server) "news")) (if (or (null gnus-nntp-service) (equal gnus-nntp-service "nntp")) nil (list gnus-nntp-service))) (error nil)) "\
-Default method for selecting a newsgroup.
-This variable should be a list, where the first element is how the
-news is to be fetched, the second is the address.
-
-For instance, if you want to get your news via \"flab.flab.edu\" using
-NNTP, you could say:
-
-\(setq gnus-select-method '(nntp \"flab.flab.edu\"))
-
-If you want to use your local spool, say:
-
-\(setq gnus-select-method (list 'nnspool (system-name)))
-
-If you use this variable, you must set `gnus-nntp-server' to nil.
-
-There is a lot more to know about select methods and virtual servers -
-see the manual for details.")
-
-(custom-autoload (quote gnus-select-method) "gnus" t)
+(when (fboundp 'custom-autoload)
+ (custom-autoload 'gnus-select-method "gnus"))
 
 (autoload (quote gnus-slave-no-server) "gnus" "\
 Read network news as a slave, without connecting to the local server.
@@ -11859,7 +11830,7 @@ prompt the user for the name of an NNTP server to use.
 ;;;;;;  gnus-agent-get-undownloaded-list gnus-agent-delete-group
 ;;;;;;  gnus-agent-rename-group gnus-agent-possibly-save-gcc gnus-agentize
 ;;;;;;  gnus-slave-unplugged gnus-plugged gnus-unplugged) "gnus-agent"
-;;;;;;  "gnus/gnus-agent.el" (17549 5046))
+;;;;;;  "gnus/gnus-agent.el" (17778 50473))
 ;;; Generated autoloads from gnus/gnus-agent.el
 
 (autoload (quote gnus-unplugged) "gnus-agent" "\
@@ -11950,7 +11921,7 @@ If CLEAN, obsolete (ignore).
 ;;;***
 \f
 ;;;### (autoloads (gnus-article-prepare-display) "gnus-art" "gnus/gnus-art.el"
-;;;;;;  (17713 5989))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from gnus/gnus-art.el
 
 (autoload (quote gnus-article-prepare-display) "gnus-art" "\
@@ -12052,7 +12023,7 @@ Checking delayed messages is skipped if optional arg NO-CHECK is non-nil.
 ;;;***
 \f
 ;;;### (autoloads (gnus-user-format-function-D gnus-user-format-function-d)
-;;;;;;  "gnus-diary" "gnus/gnus-diary.el" (17591 9282))
+;;;;;;  "gnus-diary" "gnus/gnus-diary.el" (17778 50473))
 ;;; Generated autoloads from gnus/gnus-diary.el
 
 (autoload (quote gnus-user-format-function-d) "gnus-diary" "\
@@ -12131,7 +12102,7 @@ FILE should be a PNG file that's 48x48 and smaller than or equal to
 ;;;***
 \f
 ;;;### (autoloads (gnus-fetch-group-other-frame gnus-fetch-group)
-;;;;;;  "gnus-group" "gnus/gnus-group.el" (17778 49126))
+;;;;;;  "gnus-group" "gnus/gnus-group.el" (17778 50473))
 ;;; Generated autoloads from gnus/gnus-group.el
 
 (autoload (quote gnus-fetch-group) "gnus-group" "\
@@ -12514,8 +12485,8 @@ Update the format specification near point.
 ;;;***
 \f
 ;;;### (autoloads (gnus-fixup-nnimap-unread-after-getting-new-news
-;;;;;;  gnus-declare-backend) "gnus-start" "gnus/gnus-start.el" (17591
-;;;;;;  9890))
+;;;;;;  gnus-declare-backend) "gnus-start" "gnus/gnus-start.el" (17778
+;;;;;;  50473))
 ;;; Generated autoloads from gnus/gnus-start.el
 
 (autoload (quote gnus-declare-backend) "gnus-start" "\
@@ -12541,7 +12512,7 @@ Add the window configuration CONF to `gnus-buffer-configuration'.
 
 ;;;***
 \f
-;;;### (autoloads (gomoku) "gomoku" "play/gomoku.el" (17383 38807))
+;;;### (autoloads (gomoku) "gomoku" "play/gomoku.el" (17778 50475))
 ;;; Generated autoloads from play/gomoku.el
 
 (autoload (quote gomoku) "gomoku" "\
@@ -12749,7 +12720,7 @@ the form \"WINDOW-ID PIXMAP-ID\".  Value is non-nil if successful.
 ;;;***
 \f
 ;;;### (autoloads (gdb-script-mode bashdb jdb pdb perldb xdb dbx
-;;;;;;  sdb gdb) "gud" "progmodes/gud.el" (17713 5991))
+;;;;;;  sdb gdb) "gud" "progmodes/gud.el" (17778 50476))
 ;;; Generated autoloads from progmodes/gud.el
 
 (autoload (quote gdb) "gud" "\
@@ -12759,8 +12730,12 @@ directory and source-file directory for your debugger.  By
 default this command starts GDB using a graphical interface.  See
 `gdba' for more information.
 
-To run GDB in text command mode, set `gud-gdb-command-name' to
-\"gdb --fullname\" and include the pathname, if necessary.
+To run GDB in text command mode, replace the GDB \"--annotate=3\"
+option with \"--fullname\" either in the minibuffer for the
+current Emacs session, or the custom variable
+`gud-gdb-command-name' for all future sessions.  You need to use
+text command mode to debug multiple programs within one Emacs
+session.
 
 \(fn COMMAND-LINE)" t nil)
 
@@ -12805,7 +12780,7 @@ and source-file directory for your debugger.
 (autoload (quote jdb) "gud" "\
 Run jdb with command line COMMAND-LINE in a buffer.
 The buffer is named \"*gud*\" if no initial class is given or
-\"*gud-<initial-class-basename>*\" if there is.         If the \"-classpath\"
+\"*gud-<initial-class-basename>*\" if there is.  If the \"-classpath\"
 switch is given, omit all whitespace between it and its value.
 
 See `gud-jdb-use-classpath' and `gud-jdb-classpath' documentation for
@@ -12835,8 +12810,8 @@ Major mode for editing GDB scripts
 
 ;;;***
 \f
-;;;### (autoloads (handwrite) "handwrite" "play/handwrite.el" (17383
-;;;;;;  38807))
+;;;### (autoloads (handwrite) "handwrite" "play/handwrite.el" (17778
+;;;;;;  50475))
 ;;; Generated autoloads from play/handwrite.el
 
 (autoload (quote handwrite) "handwrite" "\
@@ -12854,7 +12829,7 @@ Variables: handwrite-linespace     (default 12)
 ;;;***
 \f
 ;;;### (autoloads (hanoi-unix-64 hanoi-unix hanoi) "hanoi" "play/hanoi.el"
-;;;;;;  (17591 9622))
+;;;;;;  (17778 50475))
 ;;; Generated autoloads from play/hanoi.el
 
 (autoload (quote hanoi) "hanoi" "\
@@ -12873,7 +12848,7 @@ Repent before ring 31 moves.
 
 (autoload (quote hanoi-unix-64) "hanoi" "\
 Like hanoi-unix, but pretend to have a 64-bit clock.
-This is, necessarily (as of emacs 20.3), a crock.  When the
+This is, necessarily (as of Emacs 20.3), a crock.  When the
 current-time interface is made s2G-compliant, hanoi.el will need
 to be updated.
 
@@ -13013,19 +12988,10 @@ different regions.  With numeric argument ARG, behaves like
 \f
 ;;;### (autoloads (describe-categories describe-syntax describe-variable
 ;;;;;;  variable-at-point describe-function-1 describe-simplify-lib-file-name
-;;;;;;  help-C-file-name describe-function help-with-tutorial) "help-fns"
-;;;;;;  "help-fns.el" (17778 48452))
+;;;;;;  help-C-file-name describe-function) "help-fns" "help-fns.el"
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from help-fns.el
 
-(autoload (quote help-with-tutorial) "help-fns" "\
-Select the Emacs learn-by-doing tutorial.
-If there is a tutorial version written in the language
-of the selected language environment, that version is used.
-If there's no tutorial in that language, `TUTORIAL' is selected.
-With ARG, you are asked to choose which language.
-
-\(fn &optional ARG)" t nil)
-
 (autoload (quote describe-function) "help-fns" "\
 Display the full documentation of FUNCTION (a symbol).
 
@@ -13081,7 +13047,7 @@ BUFFER should be a buffer or a buffer name.
 ;;;***
 \f
 ;;;### (autoloads (three-step-help) "help-macro" "help-macro.el"
-;;;;;;  (17390 26939))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from help-macro.el
 
 (defvar three-step-help nil "\
@@ -13091,7 +13057,7 @@ and window listing and describing the options.
 A value of nil means skip the middle step, so that
 \\[help-command] \\[help-command] gives the window that lists the options.")
 
-(custom-autoload (quote three-step-help) "help-macro")
+(custom-autoload (quote three-step-help) "help-macro" t)
 
 ;;;***
 \f
@@ -13196,7 +13162,7 @@ Provide help for current mode.
 ;;;***
 \f
 ;;;### (autoloads (hexlify-buffer hexl-find-file hexl-mode) "hexl"
-;;;;;;  "hexl.el" (17591 9619))
+;;;;;;  "hexl.el" (17778 50473))
 ;;; Generated autoloads from hexl.el
 
 (autoload (quote hexl-mode) "hexl" "\
@@ -13238,7 +13204,7 @@ A sample format:
   000000b0: 7461 626c 6520 6368 6172 6163 7465 7220  table character
   000000c0: 7265 6769 6f6e 2e0a                      region..
 
-Movement is as simple as movement in a normal emacs text buffer.  Most
+Movement is as simple as movement in a normal Emacs text buffer.  Most
 cursor movement bindings are the same (ie. Use \\[hexl-backward-char], \\[hexl-forward-char], \\[hexl-next-line], and \\[hexl-previous-line]
 to move the cursor left, right, down, and up).
 
@@ -13474,7 +13440,7 @@ how the hiding is done:
 ;;;***
 \f
 ;;;### (autoloads (hs-minor-mode) "hideshow" "progmodes/hideshow.el"
-;;;;;;  (17390 27408))
+;;;;;;  (17778 50476))
 ;;; Generated autoloads from progmodes/hideshow.el
 
 (defvar hs-special-modes-alist (quote ((c-mode "{" "}" "/[*/]" nil hs-c-like-adjust-block-beginning) (c++-mode "{" "}" "/[*/]" nil hs-c-like-adjust-block-beginning) (bibtex-mode ("^@\\S(*\\(\\s(\\)" 1)) (java-mode "{" "}" "/[*/]" nil hs-c-like-adjust-block-beginning))) "\
@@ -13839,8 +13805,8 @@ Also see `automatic-hscrolling'.
 
 ;;;***
 \f
-;;;### (autoloads (html2text) "html2text" "gnus/html2text.el" (17396
-;;;;;;  42171))
+;;;### (autoloads (html2text) "html2text" "gnus/html2text.el" (17778
+;;;;;;  50473))
 ;;; Generated autoloads from gnus/html2text.el
 
 (autoload (quote html2text) "html2text" "\
@@ -14421,8 +14387,8 @@ buffer `*icalendar-errors*'.
 
 ;;;***
 \f
-;;;### (autoloads (icomplete-mode) "icomplete" "icomplete.el" (17713
-;;;;;;  5990))
+;;;### (autoloads (icomplete-mode) "icomplete" "icomplete.el" (17778
+;;;;;;  50473))
 ;;; Generated autoloads from icomplete.el
 
 (defvar icomplete-mode nil "\
@@ -14483,7 +14449,7 @@ with no args, if that value is non-nil.
 ;;;***
 \f
 ;;;### (autoloads (idlwave-shell) "idlw-shell" "progmodes/idlw-shell.el"
-;;;;;;  (17611 8436))
+;;;;;;  (17778 50476))
 ;;; Generated autoloads from progmodes/idlw-shell.el
 
 (autoload (quote idlwave-shell) "idlw-shell" "\
@@ -14509,11 +14475,11 @@ See also the variable `idlwave-shell-prompt-pattern'.
 ;;;***
 \f
 ;;;### (autoloads (idlwave-mode) "idlwave" "progmodes/idlwave.el"
-;;;;;;  (17713 5991))
+;;;;;;  (17778 50476))
 ;;; Generated autoloads from progmodes/idlwave.el
 
 (autoload (quote idlwave-mode) "idlwave" "\
-Major mode for editing IDL source files (version 6.0_em22).
+Major mode for editing IDL source files (version 6.1_em22).
 
 The main features of this mode are
 
@@ -14645,7 +14611,7 @@ The main features of this mode are
 ;;;;;;  ido-find-file-in-dir ido-switch-buffer-other-frame ido-insert-buffer
 ;;;;;;  ido-kill-buffer ido-display-buffer ido-switch-buffer-other-window
 ;;;;;;  ido-switch-buffer ido-mode ido-mode) "ido" "ido.el" (17778
-;;;;;;  48452))
+;;;;;;  50473))
 ;;; Generated autoloads from ido.el
 
 (defvar ido-mode nil "\
@@ -14857,7 +14823,7 @@ For details of keybindings, do `\\[describe-function] ido-find-file'.
 \(fn)" t nil)
 
 (autoload (quote ido-dired) "ido" "\
-Call dired the ido way.
+Call `dired' the ido way.
 The directory is selected interactively by typing a substring.
 For details of keybindings, do `\\[describe-function] ido-find-file'.
 
@@ -14919,7 +14885,7 @@ Switches to the buffer `*ielm*', or creates it if it does not exist.
 ;;;***
 \f
 ;;;### (autoloads (iimage-mode turn-on-iimage-mode) "iimage" "iimage.el"
-;;;;;;  (17390 26940))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from iimage.el
 
 (autoload (quote turn-on-iimage-mode) "iimage" "\
@@ -15592,7 +15558,7 @@ This will add a speedbar major display mode.
 \f
 ;;;### (autoloads (info-complete-file info-complete-symbol info-lookup-file
 ;;;;;;  info-lookup-symbol info-lookup-reset) "info-look" "info-look.el"
-;;;;;;  (17713 5990))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from info-look.el
 
 (autoload (quote info-lookup-reset) "info-look" "\
@@ -15606,10 +15572,10 @@ system.
 
 (autoload (quote info-lookup-symbol) "info-look" "\
 Display the definition of SYMBOL, as found in the relevant manual.
-When this command is called interactively, it reads SYMBOL from the minibuffer.
-In the minibuffer, use M-n to yank the default argument value
-into the minibuffer so you can edit it.
-The default symbol is the one found at point.
+When this command is called interactively, it reads SYMBOL from the
+minibuffer.  In the minibuffer, use M-n to yank the default argument
+value into the minibuffer so you can edit it.  The default symbol is the
+one found at point.
 
 With prefix arg a query for the symbol help mode is offered.
 
@@ -15873,7 +15839,7 @@ Add submenus to the File menu, to convert to and from various formats.
 ;;;;;;  ispell-region ispell-change-dictionary ispell-kill-ispell
 ;;;;;;  ispell-help ispell-pdict-save ispell-word ispell-local-dictionary-alist
 ;;;;;;  ispell-personal-dictionary) "ispell" "textmodes/ispell.el"
-;;;;;;  (17713 5992))
+;;;;;;  (17778 50479))
 ;;; Generated autoloads from textmodes/ispell.el
 (put 'ispell-check-comments 'safe-local-variable (lambda (a) (memq a '(nil t exclusive))))
 
@@ -15891,7 +15857,7 @@ These can override the values in `ispell-dictionary-alist'.
 
 To make permanent changes to your dictionary definitions, you
 will need to make your changes in this variable, save, and then
-re-start emacs.")
+re-start Emacs.")
 
 (custom-autoload (quote ispell-local-dictionary-alist) "ispell" t)
 
@@ -16058,7 +16024,7 @@ SPC:   Accept word this time.
 `m':   Place typed-in value in personal dictionary, then recheck current word.
 `C-l':  redraws screen
 `C-r':  recursive edit
-`C-z':  suspend emacs or iconify frame
+`C-z':  suspend Emacs or iconify frame
 
 \(fn)" nil nil)
 
@@ -16394,7 +16360,7 @@ and the return value is the length of the conversion.
 ;;;### (autoloads (kmacro-end-call-mouse kmacro-end-and-call-macro
 ;;;;;;  kmacro-end-or-call-macro kmacro-start-macro-or-insert-counter
 ;;;;;;  kmacro-call-macro kmacro-end-macro kmacro-start-macro) "kmacro"
-;;;;;;  "kmacro.el" (17713 5734))
+;;;;;;  "kmacro.el" (17778 50473))
 ;;; Generated autoloads from kmacro.el
  (global-set-key "\C-x(" 'kmacro-start-macro)
  (global-set-key "\C-x)" 'kmacro-end-macro)
@@ -16539,7 +16505,7 @@ Not documented
 ;;;***
 \f
 ;;;### (autoloads (lm lm-test-run) "landmark" "play/landmark.el"
-;;;;;;  (17591 9445))
+;;;;;;  (17778 50475))
 ;;; Generated autoloads from play/landmark.el
 
 (defalias (quote landmark-repeat) (quote lm-test-run))
@@ -16782,7 +16748,7 @@ A major mode to edit GNU ld script files
 ;;;***
 \f
 ;;;### (autoloads (ledit-from-lisp-mode ledit-mode) "ledit" "ledit.el"
-;;;;;;  (17390 26941))
+;;;;;;  (17778 50475))
 ;;; Generated autoloads from ledit.el
 
 (defconst ledit-save-files t "\
@@ -16803,6 +16769,7 @@ Like Lisp mode, plus these special commands:
   \\[ledit-go-to-lisp] -- transfer to Lisp job and transmit saved text.
   \\[ledit-go-to-liszt] -- transfer to Liszt (Lisp compiler) job
           and transmit saved text.
+
 \\{ledit-mode-map}
 To make Lisp mode automatically change to Ledit mode,
 do (setq lisp-mode-hook 'ledit-from-lisp-mode)
@@ -16829,8 +16796,8 @@ generations (this defaults to 1).
 
 ;;;***
 \f
-;;;### (autoloads (unload-feature) "loadhist" "loadhist.el" (17713
-;;;;;;  2476))
+;;;### (autoloads (unload-feature) "loadhist" "loadhist.el" (17778
+;;;;;;  50475))
 ;;; Generated autoloads from loadhist.el
 
 (autoload (quote unload-feature) "loadhist" "\
@@ -16853,7 +16820,7 @@ such as redefining an Emacs function.
 ;;;***
 \f
 ;;;### (autoloads (locate-with-filter locate locate-ls-subdir-switches)
-;;;;;;  "locate" "locate.el" (17713 5990))
+;;;;;;  "locate" "locate.el" (17778 50475))
 ;;; Generated autoloads from locate.el
 
 (defvar locate-ls-subdir-switches "-al" "\
@@ -16932,8 +16899,8 @@ Major mode for browsing CVS log output.
 
 ;;;***
 \f
-;;;### (autoloads (longlines-mode) "longlines" "longlines.el" (17713
-;;;;;;  5990))
+;;;### (autoloads (longlines-mode) "longlines" "longlines.el" (17778
+;;;;;;  50475))
 ;;; Generated autoloads from longlines.el
 
 (autoload (quote longlines-mode) "longlines" "\
@@ -17101,7 +17068,7 @@ definitions to shadow the loaded ones for use in file byte-compilation.
 ;;;***
 \f
 ;;;### (autoloads (apply-macro-to-region-lines kbd-macro-query insert-kbd-macro
-;;;;;;  name-last-kbd-macro) "macros" "macros.el" (17390 26942))
+;;;;;;  name-last-kbd-macro) "macros" "macros.el" (17778 50475))
 ;;; Generated autoloads from macros.el
 
 (autoload (quote name-last-kbd-macro) "macros" "\
@@ -17568,8 +17535,8 @@ yourself the value of `master-of' by calling `master-show-slave'.
 
 ;;;***
 \f
-;;;### (autoloads (menu-bar-mode) "menu-bar" "menu-bar.el" (17713
-;;;;;;  5990))
+;;;### (autoloads (menu-bar-mode) "menu-bar" "menu-bar.el" (17778
+;;;;;;  50475))
 ;;; Generated autoloads from menu-bar.el
 
 (put (quote menu-bar-mode) (quote standard-value) (quote (t)))
@@ -17604,7 +17571,7 @@ turn on menu bars; otherwise, turn off menu bars.
 ;;;;;;  message-cite-function message-yank-prefix message-citation-line-function
 ;;;;;;  message-send-mail-function message-user-organization-file
 ;;;;;;  message-signature-separator message-from-style) "message"
-;;;;;;  "gnus/message.el" (17778 49126))
+;;;;;;  "gnus/message.el" (17778 50473))
 ;;; Generated autoloads from gnus/message.el
 
 (defvar message-from-style (quote default) "\
@@ -18017,7 +17984,7 @@ delete the draft message.
 
 ;;;***
 \f
-;;;### (autoloads (mh-version) "mh-e" "mh-e/mh-e.el" (17591 9293))
+;;;### (autoloads (mh-version) "mh-e" "mh-e/mh-e.el" (17778 50475))
 ;;; Generated autoloads from mh-e/mh-e.el
 
 (put (quote mh-progs) (quote risky-local-variable) t)
@@ -18260,7 +18227,7 @@ Insert file contents of URL using `mm-url-program'.
 ;;;***
 \f
 ;;;### (autoloads (mm-uu-dissect-text-parts mm-uu-dissect) "mm-uu"
-;;;;;;  "gnus/mm-uu.el" (17778 48450))
+;;;;;;  "gnus/mm-uu.el" (17778 50473))
 ;;; Generated autoloads from gnus/mm-uu.el
 
 (autoload (quote mm-uu-dissect) "mm-uu" "\
@@ -18297,7 +18264,7 @@ Not documented
 \f
 ;;;### (autoloads (mml2015-self-encrypt mml2015-sign mml2015-encrypt
 ;;;;;;  mml2015-verify-test mml2015-verify mml2015-decrypt-test mml2015-decrypt)
-;;;;;;  "mml2015" "gnus/mml2015.el" (17496 39167))
+;;;;;;  "mml2015" "gnus/mml2015.el" (17778 50473))
 ;;; Generated autoloads from gnus/mml2015.el
 
 (autoload (quote mml2015-decrypt) "mml2015" "\
@@ -18901,7 +18868,7 @@ Open a network connection to HOST on PORT.
 ;;;;;;  uncomment-region comment-kill comment-set-column comment-indent
 ;;;;;;  comment-indent-default comment-normalize-vars comment-multi-line
 ;;;;;;  comment-padding comment-style comment-column) "newcomment"
-;;;;;;  "newcomment.el" (17713 5990))
+;;;;;;  "newcomment.el" (17778 50475))
 ;;; Generated autoloads from newcomment.el
 
 (defalias (quote indent-for-comment) (quote comment-indent))
@@ -19139,7 +19106,7 @@ Switch to newsticker buffer.  You may want to bind this to a key.
 ;;;***
 \f
 ;;;### (autoloads (nndiary-generate-nov-databases) "nndiary" "gnus/nndiary.el"
-;;;;;;  (17383 38805))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from gnus/nndiary.el
 
 (autoload (quote nndiary-generate-nov-databases) "nndiary" "\
@@ -19200,7 +19167,7 @@ Generate NOV databases in all nnml directories.
 ;;;***
 \f
 ;;;### (autoloads (nnsoup-revert-variables nnsoup-set-variables nnsoup-pack-replies)
-;;;;;;  "nnsoup" "gnus/nnsoup.el" (17383 38805))
+;;;;;;  "nnsoup" "gnus/nnsoup.el" (17778 50473))
 ;;; Generated autoloads from gnus/nnsoup.el
 
 (autoload (quote nnsoup-pack-replies) "nnsoup" "\
@@ -19221,7 +19188,7 @@ Revert posting and mailing methods to the standard Emacs methods.
 ;;;***
 \f
 ;;;### (autoloads (disable-command enable-command disabled-command-function)
-;;;;;;  "novice" "novice.el" (17713 5990))
+;;;;;;  "novice" "novice.el" (17778 50475))
 ;;; Generated autoloads from novice.el
 
 (defvar disabled-command-function (quote disabled-command-function) "\
@@ -19429,9 +19396,10 @@ The Custom feature is intended to make this obsolete.
 ;;;### (autoloads (org-export-icalendar-combine-agenda-files org-export-icalendar-all-agenda-files
 ;;;;;;  org-export-icalendar-this-file orgtbl-mode turn-on-orgtbl
 ;;;;;;  org-remember-handler org-remember-apply-template org-remember-annotation
-;;;;;;  org-store-link org-tags-view org-diary org-todo-list org-agenda-list
-;;;;;;  org-agenda org-global-cycle org-cycle org-mode) "org" "textmodes/org.el"
-;;;;;;  (17713 5992))
+;;;;;;  org-store-link org-tags-view org-diary org-cycle-agenda-files
+;;;;;;  org-todo-list org-agenda-list org-batch-agenda org-agenda
+;;;;;;  org-global-cycle org-cycle org-mode) "org" "textmodes/org.el"
+;;;;;;  (17778 50479))
 ;;; Generated autoloads from textmodes/org.el
 
 (autoload (quote org-mode) "org" "\
@@ -19494,14 +19462,15 @@ Cycle the global visibility.  For details see `org-cycle'.
 Dispatch agenda commands to collect entries to the agenda buffer.
 Prompts for a character to select a command.  Any prefix arg will be passed
 on to the selected command.  The default selections are:
-
-a     Call `org-agenda' to display the agenda for the current day or week.
+g
+a     Call `org-agenda-list' to display the agenda for current day or week.
 t     Call `org-todo-list' to display the global todo list.
 T     Call `org-todo-list' to display the global todo list, select only
       entries with a specific TODO keyword (the user gets a prompt).
 m     Call `org-tags-view' to display headlines with tags matching
       a condition  (the user is prompted for the condition).
 M     Like `m', but select only TODO entries, no ordinary headlines.
+l     Create a timeeline for the current buffer.
 
 More commands can be added by configuring the variable
 `org-agenda-custom-commands'.  In particular, specific tags and TODO keyword
@@ -19513,6 +19482,14 @@ next use of \\[org-agenda]) restricted to the current file.
 
 \(fn ARG)" t nil)
 
+(autoload (quote org-batch-agenda) "org" "\
+Run an agenda command in batch mode, send result to STDOUT.
+CMD-KEY is a string that is also a key in `org-agenda-custom-commands'.
+Paramters are alternating variable names and values that will be bound
+before running the agenda command.
+
+\(fn CMD-KEY &rest PARAMETERS)" nil (quote macro))
+
 (autoload (quote org-agenda-list) "org" "\
 Produce a weekly view from all files in variable `org-agenda-files'.
 The view will be for the current week, but from the overview buffer you
@@ -19526,7 +19503,7 @@ START-DAY defaults to TODAY, or to the most recent match for the weekday
 given in `org-agenda-start-on-weekday'.
 NDAYS defaults to `org-agenda-ndays'.
 
-\(fn &optional INCLUDE-ALL START-DAY NDAYS KEEP-MODES)" t nil)
+\(fn &optional INCLUDE-ALL START-DAY NDAYS)" t nil)
 
 (autoload (quote org-todo-list) "org" "\
 Show all TODO entries from all agenda file in a single list.
@@ -19535,7 +19512,14 @@ the list to these.  When using \\[universal-argument], you will be prompted
 for a keyword.  A numeric prefix directly selects the Nth keyword in
 `org-todo-keywords'.
 
-\(fn ARG &optional KEEP-MODES)" t nil)
+\(fn ARG)" t nil)
+
+(autoload (quote org-cycle-agenda-files) "org" "\
+Cycle through the files in `org-agenda-files'.
+If the current buffer visits an agenda file, find the next one in the list.
+If the current buffer does not, find the first agenda file.
+
+\(fn)" t nil)
 
 (autoload (quote org-diary) "org" "\
 Return diary information from org-files.
@@ -19587,7 +19571,7 @@ function from a program - use `org-agenda-get-day-entries' instead.
 Show all headlines for all `org-agenda-files' matching a TAGS criterion.
 The prefix arg TODO-ONLY limits the search to TODO entries.
 
-\(fn &optional TODO-ONLY MATCH KEEP-MODES)" t nil)
+\(fn &optional TODO-ONLY MATCH)" t nil)
 
 (autoload (quote org-store-link) "org" "\
 \\<org-mode-map>Store an org-link to the current location.
@@ -19754,18 +19738,17 @@ See the command `outline-mode' for more information on this mode.
 
 ;;;***
 \f
-;;;### (autoloads (show-paren-mode) "paren" "paren.el" (17390 26944))
+;;;### (autoloads (show-paren-mode) "paren" "paren.el" (17778 50475))
 ;;; Generated autoloads from paren.el
 
 (defvar show-paren-mode nil "\
 Non-nil if Show-Paren mode is enabled.
 See the command `show-paren-mode' for a description of this minor-mode.
 Setting this variable directly does not take effect;
-use either \\[customize] or the function `show-paren-mode'.")
-
-(custom-autoload (quote show-paren-mode) "paren")
+either customize it (see the info node `Easy Customization')
+or call the function `show-paren-mode'.")
 
-(put (quote show-paren-mode) (quote custom-set) (quote custom-set-minor-mode))
+(custom-autoload (quote show-paren-mode) "paren" nil)
 
 (autoload (quote show-paren-mode) "paren" "\
 Toggle Show Paren mode.
@@ -20124,7 +20107,7 @@ Setup shell-mode to use pcomplete.
 \f
 ;;;### (autoloads (cvs-dired-use-hook cvs-dired-action cvs-status
 ;;;;;;  cvs-update cvs-examine cvs-quickdir cvs-checkout) "pcvs"
-;;;;;;  "pcvs.el" (17713 5990))
+;;;;;;  "pcvs.el" (17778 50475))
 ;;; Generated autoloads from pcvs.el
 
 (autoload (quote cvs-checkout) "pcvs" "\
@@ -20521,7 +20504,7 @@ pong-mode keybindings:\\<pong-mode-map>
 ;;;***
 \f
 ;;;### (autoloads (pp-eval-last-sexp pp-eval-expression pp pp-buffer
-;;;;;;  pp-to-string) "pp" "emacs-lisp/pp.el" (17778 48817))
+;;;;;;  pp-to-string) "pp" "emacs-lisp/pp.el" (17778 50473))
 ;;; Generated autoloads from emacs-lisp/pp.el
 
 (autoload (quote pp-to-string) "pp" "\
@@ -20582,7 +20565,7 @@ Ignores leading comment characters.
 ;;;;;;  pr-ps-buffer-print pr-ps-buffer-using-ghostscript pr-ps-buffer-preview
 ;;;;;;  pr-ps-directory-ps-print pr-ps-directory-print pr-ps-directory-using-ghostscript
 ;;;;;;  pr-ps-directory-preview pr-interface) "printing" "printing.el"
-;;;;;;  (17713 5990))
+;;;;;;  (17778 50475))
 ;;; Generated autoloads from printing.el
 
 (autoload (quote pr-interface) "printing" "\
@@ -21193,7 +21176,7 @@ With prefix argument \\[universal-prefix], prompt for the program to use.
 
 ;;;***
 \f
-;;;### (autoloads nil "ps-bdf" "ps-bdf.el" (17390 26944))
+;;;### (autoloads nil "ps-bdf" "ps-bdf.el" (17778 50476))
 ;;; Generated autoloads from ps-bdf.el
 
 (defvar bdf-directory-list (if (memq system-type (quote (ms-dos windows-nt))) (list (expand-file-name "fonts/bdf" installation-directory)) (quote ("/usr/local/share/emacs/fonts/bdf"))) "\
@@ -21252,7 +21235,7 @@ Typing \\<ps-run-mode-map>\\[ps-run-goto-error] when the cursor is at the number
 ;;;### (autoloads (ps-mule-begin-page ps-mule-begin-job ps-mule-encode-header-string
 ;;;;;;  ps-mule-initialize ps-mule-plot-composition ps-mule-plot-string
 ;;;;;;  ps-mule-set-ascii-font ps-mule-prepare-ascii-font ps-multibyte-buffer)
-;;;;;;  "ps-mule" "ps-mule.el" (17390 26944))
+;;;;;;  "ps-mule" "ps-mule.el" (17778 50476))
 ;;; Generated autoloads from ps-mule.el
 
 (defvar ps-multibyte-buffer nil "\
@@ -21298,7 +21281,7 @@ Valid values are:
 
 Any other value is treated as nil.")
 
-(custom-autoload (quote ps-multibyte-buffer) "ps-mule")
+(custom-autoload (quote ps-multibyte-buffer) "ps-mule" t)
 
 (autoload (quote ps-mule-prepare-ascii-font) "ps-mule" "\
 Setup special ASCII font for STRING.
@@ -21373,8 +21356,8 @@ Not documented
 ;;;;;;  ps-spool-region ps-spool-buffer-with-faces ps-spool-buffer
 ;;;;;;  ps-print-region-with-faces ps-print-region ps-print-buffer-with-faces
 ;;;;;;  ps-print-buffer ps-print-customize ps-print-color-p ps-paper-type
-;;;;;;  ps-page-dimensions-database) "ps-print" "ps-print.el" (17713
-;;;;;;  5991))
+;;;;;;  ps-page-dimensions-database) "ps-print" "ps-print.el" (17778
+;;;;;;  50476))
 ;;; Generated autoloads from ps-print.el
 
 (defvar ps-page-dimensions-database (list (list (quote a4) (/ (* 72 21.0) 2.54) (/ (* 72 29.7) 2.54) "A4") (list (quote a3) (/ (* 72 29.7) 2.54) (/ (* 72 42.0) 2.54) "A3") (list (quote letter) (* 72 8.5) (* 72 11.0) "Letter") (list (quote legal) (* 72 8.5) (* 72 14.0) "Legal") (list (quote letter-small) (* 72 7.68) (* 72 10.16) "LetterSmall") (list (quote tabloid) (* 72 11.0) (* 72 17.0) "Tabloid") (list (quote ledger) (* 72 17.0) (* 72 11.0) "Ledger") (list (quote statement) (* 72 5.5) (* 72 8.5) "Statement") (list (quote executive) (* 72 7.5) (* 72 10.0) "Executive") (list (quote a4small) (* 72 7.47) (* 72 10.85) "A4Small") (list (quote b4) (* 72 10.125) (* 72 14.33) "B4") (list (quote b5) (* 72 7.16) (* 72 10.125) "B5")) "\
@@ -21571,7 +21554,7 @@ If EXTENSION is any other symbol, it is ignored.
 ;;;***
 \f
 ;;;### (autoloads (jython-mode python-mode run-python) "python" "progmodes/python.el"
-;;;;;;  (17778 49122))
+;;;;;;  (17778 50476))
 ;;; Generated autoloads from progmodes/python.el
 
 (add-to-list (quote interpreter-mode-alist) (quote ("jython" . jython-mode)))
@@ -21973,7 +21956,7 @@ Display `quickurl-list' as a formatted list using `quickurl-list-mode'.
 ;;;***
 \f
 ;;;### (autoloads (rcirc-track-minor-mode rcirc-connect rcirc) "rcirc"
-;;;;;;  "net/rcirc.el" (17713 5990))
+;;;;;;  "net/rcirc.el" (17778 50475))
 ;;; Generated autoloads from net/rcirc.el
 
 (autoload (quote rcirc) "rcirc" "\
@@ -22018,7 +22001,7 @@ See \\[compile].
 ;;;***
 \f
 ;;;### (autoloads (re-builder) "re-builder" "emacs-lisp/re-builder.el"
-;;;;;;  (17505 62391))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from emacs-lisp/re-builder.el
 
 (defalias (quote regexp-builder) (quote re-builder))
@@ -22253,7 +22236,7 @@ This enforces rescanning the buffer on next use.
 ;;;***
 \f
 ;;;### (autoloads (reftex-citation) "reftex-cite" "textmodes/reftex-cite.el"
-;;;;;;  (17405 10316))
+;;;;;;  (17778 50479))
 ;;; Generated autoloads from textmodes/reftex-cite.el
 
 (autoload (quote reftex-citation) "reftex-cite" "\
@@ -22356,11 +22339,11 @@ of master file.
 ;;;***
 \f
 ;;;### (autoloads (regexp-opt-depth regexp-opt) "regexp-opt" "emacs-lisp/regexp-opt.el"
-;;;;;;  (17390 26938))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from emacs-lisp/regexp-opt.el
 
 (autoload (quote regexp-opt) "regexp-opt" "\
-Return a regexp to match a string in STRINGS.
+Return a regexp to match a string in the list STRINGS.
 Each string should be unique in STRINGS and should not contain any regexps,
 quoted or not.  If optional PAREN is non-nil, ensure that the returned regexp
 is enclosed by at least one regexp grouping construct.
@@ -22460,8 +22443,8 @@ first comment line visible (if point is in a comment).
 
 ;;;***
 \f
-;;;### (autoloads (resume-suspend-hook) "resume" "resume.el" (17390
-;;;;;;  26945))
+;;;### (autoloads (resume-suspend-hook) "resume" "resume.el" (17778
+;;;;;;  50476))
 ;;; Generated autoloads from resume.el
 
 (autoload (quote resume-suspend-hook) "resume" "\
@@ -22572,8 +22555,8 @@ variable.
 ;;;;;;  rmail-mail-new-frame rmail-primary-inbox-list rmail-delete-after-output
 ;;;;;;  rmail-highlight-face rmail-highlighted-headers rmail-retry-ignored-headers
 ;;;;;;  rmail-displayed-headers rmail-ignored-headers rmail-dont-reply-to-names
-;;;;;;  rmail-movemail-variant-p) "rmail" "mail/rmail.el" (17713
-;;;;;;  5990))
+;;;;;;  rmail-movemail-variant-p) "rmail" "mail/rmail.el" (17778
+;;;;;;  50475))
 ;;; Generated autoloads from mail/rmail.el
 
 (autoload (quote rmail-movemail-variant-p) "rmail" "\
@@ -22903,7 +22886,7 @@ If FILE-NAME is empty, remove any existing inbox list.
 \f
 ;;;### (autoloads (rmail-output-body-to-file rmail-output rmail-fields-not-to-output
 ;;;;;;  rmail-output-to-rmail-file rmail-output-file-alist) "rmailout"
-;;;;;;  "mail/rmailout.el" (17390 26943))
+;;;;;;  "mail/rmailout.el" (17778 50475))
 ;;; Generated autoloads from mail/rmailout.el
 
 (defvar rmail-output-file-alist nil "\
@@ -22914,7 +22897,7 @@ NAME-EXP may be a string constant giving the file name to use,
 or more generally it may be any kind of expression that returns
 a file name as a string.")
 
-(custom-autoload (quote rmail-output-file-alist) "rmailout")
+(custom-autoload (quote rmail-output-file-alist) "rmailout" t)
 
 (autoload (quote rmail-output-to-rmail-file) "rmailout" "\
 Append the current message to an Rmail file named FILE-NAME.
@@ -22938,7 +22921,7 @@ message up instead of moving forward to the next non-deleted message.
 (defvar rmail-fields-not-to-output nil "\
 *Regexp describing fields to exclude when outputting a message to a file.")
 
-(custom-autoload (quote rmail-fields-not-to-output) "rmailout")
+(custom-autoload (quote rmail-fields-not-to-output) "rmailout" t)
 
 (autoload (quote rmail-output) "rmailout" "\
 Append this message to system-inbox-format mail file named FILE-NAME.
@@ -23118,38 +23101,38 @@ If NOQUERY is non-nil, we do not query before doing the work.
 ;;;***
 \f
 ;;;### (autoloads (toggle-rot13-mode rot13-other-window rot13-region
-;;;;;;  rot13-string rot13) "rot13" "rot13.el" (17390 26945))
+;;;;;;  rot13-string rot13) "rot13" "rot13.el" (17778 50476))
 ;;; Generated autoloads from rot13.el
 
 (autoload (quote rot13) "rot13" "\
-Return Rot13 encryption of OBJECT, a buffer or string.
+Return ROT13 encryption of OBJECT, a buffer or string.
 
 \(fn OBJECT &optional START END)" nil nil)
 
 (autoload (quote rot13-string) "rot13" "\
-Return Rot13 encryption of STRING.
+Return ROT13 encryption of STRING.
 
 \(fn STRING)" nil nil)
 
 (autoload (quote rot13-region) "rot13" "\
-Rot13 encrypt the region between START and END in current buffer.
+ROT13 encrypt the region between START and END in current buffer.
 
 \(fn START END)" t nil)
 
 (autoload (quote rot13-other-window) "rot13" "\
-Display current buffer in rot 13 in another window.
+Display current buffer in ROT13 in another window.
 The text itself is not modified, only the way it is displayed is affected.
 
-To terminate the rot13 display, delete that window.  As long as that window
+To terminate the ROT13 display, delete that window.  As long as that window
 is not deleted, any buffer displayed in it will become instantly encoded
-in rot 13.
+in ROT13.
 
 See also `toggle-rot13-mode'.
 
 \(fn)" t nil)
 
 (autoload (quote toggle-rot13-mode) "rot13" "\
-Toggle the use of rot 13 encoding for the current window.
+Toggle the use of ROT13 encoding for the current window.
 
 \(fn)" t nil)
 
@@ -23199,8 +23182,8 @@ This function is obsolete.
 
 ;;;***
 \f
-;;;### (autoloads (ruler-mode) "ruler-mode" "ruler-mode.el" (17390
-;;;;;;  26945))
+;;;### (autoloads (ruler-mode) "ruler-mode" "ruler-mode.el" (17778
+;;;;;;  50476))
 ;;; Generated autoloads from ruler-mode.el
 
 (autoload (quote ruler-mode) "ruler-mode" "\
@@ -23626,18 +23609,17 @@ Interesting variables:
 ;;;***
 \f
 ;;;### (autoloads (scroll-all-mode) "scroll-all" "scroll-all.el"
-;;;;;;  (17390 26945))
+;;;;;;  (17778 50476))
 ;;; Generated autoloads from scroll-all.el
 
 (defvar scroll-all-mode nil "\
 Non-nil if Scroll-All mode is enabled.
 See the command `scroll-all-mode' for a description of this minor-mode.
 Setting this variable directly does not take effect;
-use either \\[customize] or the function `scroll-all-mode'.")
-
-(custom-autoload (quote scroll-all-mode) "scroll-all")
+either customize it (see the info node `Easy Customization')
+or call the function `scroll-all-mode'.")
 
-(put (quote scroll-all-mode) (quote custom-set) (quote custom-set-minor-mode))
+(custom-autoload (quote scroll-all-mode) "scroll-all" nil)
 
 (autoload (quote scroll-all-mode) "scroll-all" "\
 Toggle Scroll-All minor mode.
@@ -23973,7 +23955,7 @@ Like `mail' command, but display mail buffer in another frame.
 ;;;***
 \f
 ;;;### (autoloads (server-save-buffers-kill-terminal server-mode
-;;;;;;  server-start) "server" "server.el" (17713 6546))
+;;;;;;  server-start) "server" "server.el" (17778 59051))
 ;;; Generated autoloads from server.el
 
 (autoload (quote server-start) "server" "\
@@ -24017,7 +23999,7 @@ only these files will be asked to be saved.
 
 ;;;***
 \f
-;;;### (autoloads (ses-mode) "ses" "ses.el" (17713 5991))
+;;;### (autoloads (ses-mode) "ses" "ses.el" (17778 50477))
 ;;; Generated autoloads from ses.el
 
 (autoload (quote ses-mode) "ses" "\
@@ -24183,7 +24165,7 @@ If BINARY is non-nil, return a string in binary form.
 ;;;***
 \f
 ;;;### (autoloads (list-load-path-shadows) "shadow" "emacs-lisp/shadow.el"
-;;;;;;  (17390 26938))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from emacs-lisp/shadow.el
 
 (autoload (quote list-load-path-shadows) "shadow" "\
@@ -24203,17 +24185,17 @@ and that each of these directories contains a file called XXX.el.  Then
 XXX.el in the site-lisp directory is referred to by all of:
 \(require 'XXX), (autoload .... \"XXX\"), (load-library \"XXX\") etc.
 
-The first XXX.el file prevents emacs from seeing the second (unless
-the second is loaded explicitly via load-file).
+The first XXX.el file prevents Emacs from seeing the second (unless
+the second is loaded explicitly via `load-file').
 
 When not intended, such shadowings can be the source of subtle
 problems.  For example, the above situation may have arisen because the
-XXX package was not distributed with versions of emacs prior to
-19.30.  An emacs maintainer downloaded XXX from elsewhere and installed
-it.  Later, XXX was updated and included in the emacs distribution.
-Unless the emacs maintainer checks for this, the new version of XXX
+XXX package was not distributed with versions of Emacs prior to
+19.30.  An Emacs maintainer downloaded XXX from elsewhere and installed
+it.  Later, XXX was updated and included in the Emacs distribution.
+Unless the Emacs maintainer checks for this, the new version of XXX
 will be hidden behind the old (which may no longer work with the new
-emacs version).
+Emacs version).
 
 This function performs these checks and flags all possible
 shadowings.  Because a .el file may exist without a corresponding .elc
@@ -24230,8 +24212,8 @@ buffer called `*Shadows*'.  Shadowings are located by calling the
 ;;;***
 \f
 ;;;### (autoloads (shadow-initialize shadow-define-regexp-group shadow-define-literal-group
-;;;;;;  shadow-define-cluster) "shadowfile" "shadowfile.el" (17390
-;;;;;;  26945))
+;;;;;;  shadow-define-cluster) "shadowfile" "shadowfile.el" (17778
+;;;;;;  50477))
 ;;; Generated autoloads from shadowfile.el
 
 (autoload (quote shadow-define-cluster) "shadowfile" "\
@@ -24256,7 +24238,7 @@ specific hostnames, or names of clusters (see `shadow-define-cluster').
 Make each of a group of files be shared between hosts.
 Prompts for regular expression; files matching this are shared between a list
 of sites, which are also prompted for.  The filenames must be identical on all
-hosts (if they aren't, use shadow-define-group instead of this function).
+hosts (if they aren't, use `shadow-define-literal-group' instead of this function).
 Each site can be either a hostname or the name of a cluster (see
 `shadow-define-cluster').
 
@@ -24353,7 +24335,7 @@ Turning on Sieve mode runs `sieve-mode-hook'.
 
 ;;;***
 \f
-;;;### (autoloads nil "simple" "simple.el" (17778 48817))
+;;;### (autoloads nil "simple" "simple.el" (17778 50477))
 ;;; Generated autoloads from simple.el
 (put 'fill-prefix 'safe-local-variable 'string-or-null-p)
 
@@ -24556,7 +24538,7 @@ interactively. If there's no argument, do it at the current buffer
 ;;;***
 \f
 ;;;### (autoloads (smtpmail-send-queued-mail smtpmail-send-it) "smtpmail"
-;;;;;;  "mail/smtpmail.el" (17778 48817))
+;;;;;;  "mail/smtpmail.el" (17778 50475))
 ;;; Generated autoloads from mail/smtpmail.el
 
 (autoload (quote smtpmail-send-it) "smtpmail" "\
@@ -24775,7 +24757,7 @@ Pick your favourite shortcuts:
 \f
 ;;;### (autoloads (reverse-region sort-columns sort-regexp-fields
 ;;;;;;  sort-fields sort-numeric-fields sort-pages sort-paragraphs
-;;;;;;  sort-lines sort-subr) "sort" "sort.el" (17466 28166))
+;;;;;;  sort-lines sort-subr) "sort" "sort.el" (17778 50477))
 ;;; Generated autoloads from sort.el
 
 (autoload (quote sort-subr) "sort" "\
@@ -24973,7 +24955,7 @@ Spam reports will be queued with the method used when
 ;;;***
 \f
 ;;;### (autoloads (speedbar-get-focus speedbar-frame-mode) "speedbar"
-;;;;;;  "speedbar.el" (17549 4607))
+;;;;;;  "speedbar.el" (17778 50477))
 ;;; Generated autoloads from speedbar.el
 
 (defalias (quote speedbar) (quote speedbar-frame-mode))
@@ -25616,7 +25598,7 @@ Studlify-case the current buffer.
 
 ;;;***
 \f
-;;;### (autoloads (locate-library) "subr" "subr.el" (17778 49122))
+;;;### (autoloads (locate-library) "subr" "subr.el" (17778 50477))
 ;;; Generated autoloads from subr.el
 
 (autoload (quote locate-library) "subr" "\
@@ -25670,7 +25652,7 @@ before, and `sc-post-hook' is run after the guts of this function.
 
 ;;;***
 \f
-;;;### (autoloads (t-mouse-mode) "t-mouse" "t-mouse.el" (17713 2480))
+;;;### (autoloads (t-mouse-mode) "t-mouse" "t-mouse.el" (17778 50477))
 ;;; Generated autoloads from t-mouse.el
 
 (defvar t-mouse-mode nil "\
@@ -25686,13 +25668,13 @@ or call the function `t-mouse-mode'.")
 Toggle t-mouse mode.
 With prefix arg, turn t-mouse mode on iff arg is positive.
 
-Turn it on to use emacs mouse commands, and off to use t-mouse commands.
+Turn it on to use Emacs mouse commands, and off to use t-mouse commands.
 
 \(fn &optional ARG)" t nil)
 
 ;;;***
 \f
-;;;### (autoloads (tabify untabify) "tabify" "tabify.el" (17611 9419))
+;;;### (autoloads (tabify untabify) "tabify" "tabify.el" (17778 50477))
 ;;; Generated autoloads from tabify.el
 
 (autoload (quote untabify) "tabify" "\
@@ -25727,7 +25709,7 @@ The variable `tab-width' controls the spacing of tab stops.
 ;;;;;;  table-recognize table-insert-row-column table-insert-column
 ;;;;;;  table-insert-row table-insert table-point-left-cell-hook
 ;;;;;;  table-point-entered-cell-hook table-load-hook table-cell-map-hook)
-;;;;;;  "table" "textmodes/table.el" (17778 48451))
+;;;;;;  "table" "textmodes/table.el" (17778 50479))
 ;;; Generated autoloads from textmodes/table.el
 
 (defvar table-cell-map-hook nil "\
@@ -26330,7 +26312,7 @@ Connect to the Emacs talk group from the current X display or tty frame.
 
 ;;;***
 \f
-;;;### (autoloads (tar-mode) "tar-mode" "tar-mode.el" (17549 4608))
+;;;### (autoloads (tar-mode) "tar-mode" "tar-mode.el" (17778 50477))
 ;;; Generated autoloads from tar-mode.el
 
 (autoload (quote tar-mode) "tar-mode" "\
@@ -26432,8 +26414,8 @@ Normally input is edited in Emacs and sent a line at a time.
 
 ;;;***
 \f
-;;;### (autoloads (ansi-term term make-term) "term" "term.el" (17569
-;;;;;;  17797))
+;;;### (autoloads (ansi-term term make-term) "term" "term.el" (17778
+;;;;;;  50478))
 ;;; Generated autoloads from term.el
 
 (autoload (quote make-term) "term" "\
@@ -26461,8 +26443,8 @@ Start a terminal-emulator in a new buffer.
 
 ;;;***
 \f
-;;;### (autoloads (terminal-emulator) "terminal" "terminal.el" (17390
-;;;;;;  26946))
+;;;### (autoloads (terminal-emulator) "terminal" "terminal.el" (17778
+;;;;;;  50479))
 ;;; Generated autoloads from terminal.el
 
 (autoload (quote terminal-emulator) "terminal" "\
@@ -26842,7 +26824,7 @@ Major mode to edit DocTeX files.
 ;;;***
 \f
 ;;;### (autoloads (texi2info texinfo-format-region texinfo-format-buffer)
-;;;;;;  "texinfmt" "textmodes/texinfmt.el" (17591 9719))
+;;;;;;  "texinfmt" "textmodes/texinfmt.el" (17778 50479))
 ;;; Generated autoloads from textmodes/texinfmt.el
 
 (autoload (quote texinfo-format-buffer) "texinfmt" "\
@@ -27013,7 +26995,7 @@ Minor mode for automatically correct Thai character composition.
 \f
 ;;;### (autoloads (list-at-point number-at-point symbol-at-point
 ;;;;;;  sexp-at-point thing-at-point bounds-of-thing-at-point forward-thing)
-;;;;;;  "thingatpt" "thingatpt.el" (17713 5993))
+;;;;;;  "thingatpt" "thingatpt.el" (17778 50479))
 ;;; Generated autoloads from thingatpt.el
 
 (autoload (quote forward-thing) "thingatpt" "\
@@ -27341,7 +27323,7 @@ If DATE is malformed, return a time value of zeros.
 ;;;***
 \f
 ;;;### (autoloads (time-stamp-toggle-active time-stamp) "time-stamp"
-;;;;;;  "time-stamp.el" (17490 7930))
+;;;;;;  "time-stamp.el" (17778 50479))
 ;;; Generated autoloads from time-stamp.el
 (put 'time-stamp-format 'safe-local-variable 'stringp)
 (put 'time-stamp-line-limit 'safe-local-variable 'integerp)
@@ -27608,7 +27590,7 @@ PATTERN regexp.
 ;;;***
 \f
 ;;;### (autoloads (tmm-prompt tmm-menubar-mouse tmm-menubar) "tmm"
-;;;;;;  "tmm.el" (17611 51386))
+;;;;;;  "tmm.el" (17778 50479))
 ;;; Generated autoloads from tmm.el
  (define-key global-map "\M-`" 'tmm-menubar)
  (define-key global-map [menu-bar mouse-1] 'tmm-menubar-mouse)
@@ -27782,18 +27764,17 @@ holds a keymap.
 ;;;***
 \f
 ;;;### (autoloads (tpu-edt-on tpu-edt-mode) "tpu-edt" "emulation/tpu-edt.el"
-;;;;;;  (17390 26938))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from emulation/tpu-edt.el
 
 (defvar tpu-edt-mode nil "\
 Non-nil if Tpu-Edt mode is enabled.
 See the command `tpu-edt-mode' for a description of this minor-mode.
 Setting this variable directly does not take effect;
-use either \\[customize] or the function `tpu-edt-mode'.")
-
-(custom-autoload (quote tpu-edt-mode) "tpu-edt")
+either customize it (see the info node `Easy Customization')
+or call the function `tpu-edt-mode'.")
 
-(put (quote tpu-edt-mode) (quote custom-set) (quote custom-set-minor-mode))
+(custom-autoload (quote tpu-edt-mode) "tpu-edt" nil)
 
 (autoload (quote tpu-edt-mode) "tpu-edt" "\
 TPU/edt emulation.
@@ -27881,12 +27862,12 @@ BUFFER defaults to `trace-buffer'.
 ;;;### (autoloads (tramp-unload-tramp tramp-completion-handle-file-name-completion
 ;;;;;;  tramp-completion-handle-file-name-all-completions tramp-unload-file-name-handlers
 ;;;;;;  tramp-file-name-handler tramp-completion-file-name-regexp
-;;;;;;  tramp-file-name-regexp) "tramp" "net/tramp.el" (17713 5990))
+;;;;;;  tramp-file-name-regexp) "tramp" "net/tramp.el" (17778 50475))
 ;;; Generated autoloads from net/tramp.el
 
 (defvar tramp-unified-filenames (not (featurep (quote xemacs))) "\
 Non-nil means to use unified Ange-FTP/Tramp filename syntax.
-Nil means to use a separate filename syntax for Tramp.")
+Otherwise, use a separate filename syntax for Tramp.")
 
 (defconst tramp-file-name-regexp-unified "\\`/[^/:]+:" "\
 Value for `tramp-file-name-regexp' for unified remoting.
@@ -28140,6 +28121,31 @@ easy-to-use form.
 
 ;;;***
 \f
+;;;### (autoloads (help-with-tutorial) "tutorial" "tutorial.el" (17778
+;;;;;;  50471))
+;;; Generated autoloads from tutorial.el
+
+(autoload (quote help-with-tutorial) "tutorial" "\
+Select the Emacs learn-by-doing tutorial.
+If there is a tutorial version written in the language
+of the selected language environment, that version is used.
+If there's no tutorial in that language, `TUTORIAL' is selected.
+With ARG, you are asked to choose which language.
+If DONT-ASK-FOR-REVERT is non-nil the buffer is reverted without
+any question when restarting the tutorial.
+
+If any of the standard Emacs key bindings that are used in the
+tutorial have been changed then an explanatory note about this is
+shown in the beginning of the tutorial buffer.
+
+When the tutorial buffer is killed the content and the point
+position in the buffer is saved so that the tutorial may be
+resumed later.
+
+\(fn &optional ARG DONT-ASK-FOR-REVERT)" t nil)
+
+;;;***
+\f
 ;;;### (autoloads (2C-split 2C-associate-buffer 2C-two-columns) "two-column"
 ;;;;;;  "textmodes/two-column.el" (17713 5993))
 ;;; Generated autoloads from textmodes/two-column.el
@@ -28448,7 +28454,7 @@ of symbols with local bindings.
 ;;;***
 \f
 ;;;### (autoloads (url-retrieve-synchronously url-retrieve) "url"
-;;;;;;  "url/url.el" (17778 49132))
+;;;;;;  "url/url.el" (17778 50479))
 ;;; Generated autoloads from url/url.el
 
 (autoload (quote url-retrieve) "url" "\
@@ -28594,7 +28600,7 @@ Handle file: and ftp: URLs.
 ;;;***
 \f
 ;;;### (autoloads (url-open-stream url-gateway-nslookup-host) "url-gw"
-;;;;;;  "url/url-gw.el" (17778 49132))
+;;;;;;  "url/url-gw.el" (17778 50299))
 ;;; Generated autoloads from url/url-gw.el
 
 (autoload (quote url-gateway-nslookup-host) "url-gw" "\
@@ -28658,7 +28664,7 @@ Not documented
 ;;;***
 \f
 ;;;### (autoloads (url-http-options url-http-file-attributes url-http-file-exists-p
-;;;;;;  url-http) "url-http" "url/url-http.el" (17778 49132))
+;;;;;;  url-http) "url-http" "url/url-http.el" (17778 50479))
 ;;; Generated autoloads from url/url-http.el
 
 (autoload (quote url-http) "url-http" "\
@@ -28854,7 +28860,7 @@ Not documented
 ;;;***
 \f
 ;;;### (autoloads (url-generic-parse-url url-recreate-url) "url-parse"
-;;;;;;  "url/url-parse.el" (17713 5994))
+;;;;;;  "url/url-parse.el" (17778 50479))
 ;;; Generated autoloads from url/url-parse.el
 
 (autoload (quote url-recreate-url) "url-parse" "\
@@ -28888,7 +28894,7 @@ Setup variables that expose info about you and your system.
 ;;;;;;  url-strip-leading-spaces url-eat-trailing-space url-get-normalized-date
 ;;;;;;  url-lazy-message url-normalize-url url-insert-entities-in-string
 ;;;;;;  url-parse-args url-debug url-debug) "url-util" "url/url-util.el"
-;;;;;;  (17713 2482))
+;;;;;;  (17778 50479))
 ;;; Generated autoloads from url/url-util.el
 
 (defvar url-debug nil "\
@@ -29017,7 +29023,7 @@ This uses `url-current-object', set locally to the buffer.
 ;;;***
 \f
 ;;;### (autoloads (ask-user-about-supersession-threat ask-user-about-lock)
-;;;;;;  "userlock" "userlock.el" (17390 26947))
+;;;;;;  "userlock" "userlock.el" (17778 50479))
 ;;; Generated autoloads from userlock.el
 
 (autoload (quote ask-user-about-lock) "userlock" "\
@@ -29432,20 +29438,25 @@ find any project directory." (let ((project-dir (getenv "PROJECTDIR")) dirs dir)
 
 ;;;***
 \f
-;;;### (autoloads nil "vc-svn" "vc-svn.el" (17778 49122))
+;;;### (autoloads nil "vc-svn" "vc-svn.el" (17778 50479))
 ;;; Generated autoloads from vc-svn.el
  (defun vc-svn-registered (f)
-  (when (file-readable-p (expand-file-name
-                         ".svn/entries" (file-name-directory f)))
+  (let ((admin-dir (cond ((and (eq system-type 'windows-nt)
+                              (getenv "SVN_ASP_DOT_NET_HACK"))
+                         "_svn")
+                        (t ".svn"))))
+    (when (file-readable-p (expand-file-name
+                           (concat admin-dir "/entries")
+                           (file-name-directory f)))
       (load "vc-svn")
-      (vc-svn-registered f)))
+      (vc-svn-registered f))))
 
 (add-to-list (quote completion-ignored-extensions) ".svn/")
 
 ;;;***
 \f
 ;;;### (autoloads (vhdl-mode) "vhdl-mode" "progmodes/vhdl-mode.el"
-;;;;;;  (17713 2482))
+;;;;;;  (17778 50476))
 ;;; Generated autoloads from progmodes/vhdl-mode.el
 
 (autoload (quote vhdl-mode) "vhdl-mode" "\
@@ -30297,8 +30308,8 @@ Exit View mode and make the current buffer editable.
 
 ;;;***
 \f
-;;;### (autoloads (vip-mode vip-setup) "vip" "emulation/vip.el" (17390
-;;;;;;  26938))
+;;;### (autoloads (vip-mode vip-setup) "vip" "emulation/vip.el" (17778
+;;;;;;  50473))
 ;;; Generated autoloads from emulation/vip.el
 
 (autoload (quote vip-setup) "vip" "\
@@ -30314,7 +30325,7 @@ Turn on VIP emulation of VI.
 ;;;***
 \f
 ;;;### (autoloads (viper-mode toggle-viper-mode) "viper" "emulation/viper.el"
-;;;;;;  (17778 49123))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from emulation/viper.el
 
 (autoload (quote toggle-viper-mode) "viper" "\
@@ -30485,7 +30496,7 @@ and off otherwise.
 ;;;;;;  whitespace-buffer whitespace-toggle-ateol-check whitespace-toggle-spacetab-check
 ;;;;;;  whitespace-toggle-indent-check whitespace-toggle-trailing-check
 ;;;;;;  whitespace-toggle-leading-check) "whitespace" "whitespace.el"
-;;;;;;  (17713 5311))
+;;;;;;  (17778 50479))
 ;;; Generated autoloads from whitespace.el
 
 (autoload (quote whitespace-toggle-leading-check) "whitespace" "\
@@ -30603,8 +30614,8 @@ With arg, turn widget mode on if and only if arg is positive.
 ;;;***
 \f
 ;;;### (autoloads (widget-setup widget-insert widget-delete widget-create
-;;;;;;  widget-prompt-value widgetp) "wid-edit" "wid-edit.el" (17713
-;;;;;;  5994))
+;;;;;;  widget-prompt-value widgetp) "wid-edit" "wid-edit.el" (17778
+;;;;;;  50479))
 ;;; Generated autoloads from wid-edit.el
 
 (autoload (quote widgetp) "wid-edit" "\
@@ -30992,14 +31003,14 @@ Zone out, completely.
 ;;;;;;  "calc/calc-vec.el" "calc/calc-yank.el" "calc/calcalg2.el"
 ;;;;;;  "calc/calcalg3.el" "calc/calccomp.el" "calc/calcsel2.el"
 ;;;;;;  "calendar/cal-bahai.el" "calendar/cal-china.el" "calendar/cal-coptic.el"
-;;;;;;  "calendar/cal-french.el" "calendar/cal-islam.el" "calendar/cal-iso.el"
-;;;;;;  "calendar/cal-julian.el" "calendar/cal-mayan.el" "calendar/cal-menu.el"
-;;;;;;  "calendar/cal-move.el" "calendar/cal-persia.el" "calendar/cal-tex.el"
-;;;;;;  "calendar/cal-x.el" "case-table.el" "cdl.el" "cus-dep.el"
-;;;;;;  "cus-load.el" "cus-start.el" "custom.el" "dframe.el" "dos-fns.el"
-;;;;;;  "dos-vars.el" "dos-w32.el" "ediff-diff.el" "ediff-init.el"
-;;;;;;  "ediff-merg.el" "ediff-ptch.el" "ediff-vers.el" "ediff-wind.el"
-;;;;;;  "electric.el" "emacs-lisp/assoc.el" "emacs-lisp/authors.el"
+;;;;;;  "calendar/cal-french.el" "calendar/cal-html.el" "calendar/cal-islam.el"
+;;;;;;  "calendar/cal-iso.el" "calendar/cal-julian.el" "calendar/cal-mayan.el"
+;;;;;;  "calendar/cal-menu.el" "calendar/cal-move.el" "calendar/cal-persia.el"
+;;;;;;  "calendar/cal-tex.el" "calendar/cal-x.el" "case-table.el"
+;;;;;;  "cdl.el" "cus-dep.el" "cus-load.el" "cus-start.el" "custom.el"
+;;;;;;  "dframe.el" "dos-fns.el" "dos-vars.el" "dos-w32.el" "ediff-diff.el"
+;;;;;;  "ediff-init.el" "ediff-merg.el" "ediff-ptch.el" "ediff-vers.el"
+;;;;;;  "ediff-wind.el" "electric.el" "emacs-lisp/assoc.el" "emacs-lisp/authors.el"
 ;;;;;;  "emacs-lisp/bindat.el" "emacs-lisp/byte-opt.el" "emacs-lisp/byte-run.el"
 ;;;;;;  "emacs-lisp/cl-compat.el" "emacs-lisp/cl-extra.el" "emacs-lisp/cl-macs.el"
 ;;;;;;  "emacs-lisp/cl-seq.el" "emacs-lisp/cl-specs.el" "emacs-lisp/cust-print.el"
@@ -31109,19 +31120,18 @@ Zone out, completely.
 ;;;;;;  "term/vt100.el" "term/vt102.el" "term/vt125.el" "term/vt200.el"
 ;;;;;;  "term/vt201.el" "term/vt220.el" "term/vt240.el" "term/vt300.el"
 ;;;;;;  "term/vt320.el" "term/vt400.el" "term/vt420.el" "term/w32-win.el"
-;;;;;;  "term/wyse50.el" "term/x-win.el" "term/xterm.el" "termdev.el"
-;;;;;;  "textmodes/bib-mode.el" "textmodes/makeinfo.el" "textmodes/page-ext.el"
-;;;;;;  "textmodes/page.el" "textmodes/refbib.el" "textmodes/refer.el"
-;;;;;;  "textmodes/reftex-auc.el" "textmodes/reftex-dcr.el" "textmodes/reftex-ref.el"
-;;;;;;  "textmodes/reftex-sel.el" "textmodes/reftex-toc.el" "textmodes/texnfo-upd.el"
-;;;;;;  "textmodes/text-mode.el" "timezone.el" "tooltip.el" "tree-widget.el"
-;;;;;;  "uniquify.el" "url/url-about.el" "url/url-cookie.el" "url/url-dired.el"
-;;;;;;  "url/url-expand.el" "url/url-ftp.el" "url/url-history.el"
-;;;;;;  "url/url-imap.el" "url/url-methods.el" "url/url-nfs.el" "url/url-proxy.el"
-;;;;;;  "url/url-vars.el" "url/vc-dav.el" "vc-hooks.el" "vcursor.el"
-;;;;;;  "version.el" "vms-patch.el" "vmsproc.el" "vt-control.el"
-;;;;;;  "vt100-led.el" "w32-fns.el" "w32-vars.el" "widget.el" "window.el"
-;;;;;;  "x-dnd.el") (17778 50114 410901))
+;;;;;;  "term/wyse50.el" "termdev.el" "textmodes/bib-mode.el" "textmodes/makeinfo.el"
+;;;;;;  "textmodes/page-ext.el" "textmodes/page.el" "textmodes/refbib.el"
+;;;;;;  "textmodes/refer.el" "textmodes/reftex-auc.el" "textmodes/reftex-dcr.el"
+;;;;;;  "textmodes/reftex-ref.el" "textmodes/reftex-sel.el" "textmodes/reftex-toc.el"
+;;;;;;  "textmodes/texnfo-upd.el" "textmodes/text-mode.el" "timezone.el"
+;;;;;;  "tooltip.el" "tree-widget.el" "uniquify.el" "url/url-about.el"
+;;;;;;  "url/url-cookie.el" "url/url-dired.el" "url/url-expand.el"
+;;;;;;  "url/url-ftp.el" "url/url-history.el" "url/url-imap.el" "url/url-methods.el"
+;;;;;;  "url/url-nfs.el" "url/url-proxy.el" "url/url-vars.el" "url/vc-dav.el"
+;;;;;;  "vc-hooks.el" "vcursor.el" "version.el" "vms-patch.el" "vmsproc.el"
+;;;;;;  "vt-control.el" "vt100-led.el" "w32-fns.el" "w32-vars.el"
+;;;;;;  "widget.el" "window.el" "x-dnd.el") (17778 59104 269580))
 
 ;;;***
 \f
index 6aafdcf..e44be05 100644 (file)
@@ -57,7 +57,7 @@
 *Shell commands to execute to resume Lisp compiler job.")
 
 (defun ledit-save-defun ()
-  "Save the current defun in the ledit buffer"
+  "Save the current defun in the ledit buffer."
   (interactive)
   (save-excursion
    (end-of-defun)
@@ -141,6 +141,7 @@ Like Lisp mode, plus these special commands:
   \\[ledit-go-to-lisp] -- transfer to Lisp job and transmit saved text.
   \\[ledit-go-to-liszt] -- transfer to Liszt (Lisp compiler) job
           and transmit saved text.
+
 \\{ledit-mode-map}
 To make Lisp mode automatically change to Ledit mode,
 do (setq lisp-mode-hook 'ledit-from-lisp-mode)"
index 61f15c8..6683f8a 100644 (file)
@@ -119,7 +119,9 @@ return the feature \(symbol\)."
                           (mapcar (lambda (feature)
                                     (list (symbol-name feature)))
                                   features)
-                          nil t)))
+                          ;; Complete only features loaded from a file
+                          #'(lambda (f) (feature-file (intern (car f))))
+                          t)))
 
 (defvaralias 'loadhist-hook-functions 'unload-feature-special-hooks)
 (defvar unload-feature-special-hooks
index 9cf37e8..bb31082 100644 (file)
@@ -430,7 +430,7 @@ file name or is inside a subdirectory."
   (save-excursion
     (forward-line 0)
     (looking-at (concat "."
-                       (make-string (1- locate-filename-indentation) ?\ )
+                       (make-string (1- locate-filename-indentation) ?\s)
                        "\\(/\\|[A-Za-z]:\\)"))))
 
 (defun locate-mouse-view-file (event)
@@ -478,7 +478,7 @@ do not work in subdirectories.
   ;; This should support both Unix and Windoze style names
   (setq directory-listing-before-filename-regexp
        (concat "^."
-               (make-string (1- locate-filename-indentation) ?\ )
+               (make-string (1- locate-filename-indentation) ?\s)
                "\\(/\\|[A-Za-z]:\\)\\|"
                (default-value 'directory-listing-before-filename-regexp)))
   (make-local-variable 'dired-actual-switches)
@@ -486,7 +486,7 @@ do not work in subdirectories.
   (make-local-variable 'dired-permission-flags-regexp)
   (setq dired-permission-flags-regexp
        (concat "^.\\("
-               (make-string (1- locate-filename-indentation) ?\ )
+               (make-string (1- locate-filename-indentation) ?\s)
                "\\)\\|"
                (default-value 'dired-permission-flags-regexp)))
   (make-local-variable 'revert-buffer-function)
@@ -511,7 +511,7 @@ do not work in subdirectories.
     (locate-insert-header search-string)
 
     (while (not (eobp))
-      (insert-char ?\  locate-filename-indentation t)
+      (insert-char ?\s locate-filename-indentation t)
       (locate-set-properties)
       (forward-line 1)))
   (goto-char (point-min)))
index ee469e1..af81793 100644 (file)
@@ -258,7 +258,7 @@ not need to be wrapped, move point to the next line and return t."
                     (if (> longlines-wrap-point (point))
                         (setq longlines-wrap-point
                               (1- longlines-wrap-point))))
-                (insert-before-markers-and-inherit ?\ )
+                (insert-before-markers-and-inherit ?\s)
                 (backward-char 1)
                 (delete-char -1)
                 (forward-char 1))
index 55916ba..db4de40 100644 (file)
@@ -130,7 +130,7 @@ use this command, and then save the file."
       (if (vectorp definition)
          (let ((len (length definition)) (i 0) char mods)
            (while (< i len)
-             (insert (if (zerop i) ?\[ ?\ ))
+             (insert (if (zerop i) ?\[ ?\s))
              (setq char (aref definition i)
                    i (1+ i))
              (cond ((not (numberp char))
index 63b16e3..3d4a53b 100644 (file)
@@ -126,7 +126,7 @@ usually do not have translators to read other languages for them.\n\n")
     (setq user-point (point))
     (insert "\n\n")
 
-    (insert "If emacs crashed, and you have the emacs process in the gdb debugger,\n"
+    (insert "If Emacs crashed, and you have the Emacs process in the gdb debugger,\n"
            "please include the output from the following gdb commands:\n"
            "    `bt full' and `xbacktrace'.\n")
 
index 04928fb..3180b05 100644 (file)
@@ -330,11 +330,11 @@ This is done after the message is completely prepped, and you'll be
 looking at the top of the message in a buffer when you get the prompt.
 If set to the symbol 'queued, give the confirmation prompt only while
 running the queue (however, the prompt is always suppressed if you are
-processing the queue via feedmail-run-the-queue-no-prompts).  If set
+processing the queue via `feedmail-run-the-queue-no-prompts').  If set
 to the symbol 'immediate, give the confirmation prompt only when
 sending immediately.  For any other non-nil value, prompt in both
 cases.  You can give a timeout for the prompt; see variable
-feedmail-confirm-outgoing-timeout."
+`feedmail-confirm-outgoing-timeout'."
   :group 'feedmail-misc
   :type 'boolean
   )
@@ -344,7 +344,7 @@ feedmail-confirm-outgoing-timeout."
   "*If non-nil, a timeout in seconds at the send confirmation prompt.
 If a positive number, it's a timeout before sending.  If a negative
 number, it's a timeout before not sending.  This will not work if your
-version of Emacs doesn't include the function y-or-n-p-with-timeout
+version of Emacs doesn't include the function `y-or-n-p-with-timeout'
 \(e.g., some versions of XEmacs\)."
   :group 'feedmail-misc
   :type '(choice (const nil) integer)
@@ -355,7 +355,7 @@ version of Emacs doesn't include the function y-or-n-p-with-timeout
   "*If non-nil remove Bcc: lines from the message headers.
 In any case, the Bcc: lines do participate in the composed address
 list.  You may want to leave them in if you're using sendmail
-\(see feedmail-buffer-eating-function\)."
+\(see `feedmail-buffer-eating-function'\)."
   :group 'feedmail-headers
   :type 'boolean
   )
@@ -365,7 +365,7 @@ list.  You may want to leave them in if you're using sendmail
   "*If non-nil remove Resent-Bcc: lines from the message headers.
 In any case, the Resent-Bcc: lines do participate in the composed
 address list.  You may want to leave them in if you're using sendmail
-\(see feedmail-buffer-eating-function\)."
+\(see `feedmail-buffer-eating-function'\)."
   :group 'feedmail-headers
   :type 'boolean
   )
@@ -410,7 +410,7 @@ as-is.  The filling is done after mail address alias expansion."
 
 
 (defcustom feedmail-fill-to-cc-fill-column default-fill-column
-  "*Fill column used by feedmail-fill-to-cc."
+  "*Fill column used by `feedmail-fill-to-cc'."
   :group 'feedmail-headers
   :type 'integer
   )
@@ -481,7 +481,7 @@ another function, but let's not be ridiculous).  If a string, it
 should be just the contents of the header, not the name of the header
 itself nor the trailing newline.  If a function, it will be called
 with no arguments.  For an explanation of fiddle-plexes, see the
-documentation for the variable feedmail-fiddle-plex-blurb.  In all
+documentation for the variable `feedmail-fiddle-plex-blurb'.  In all
 cases the name element of the fiddle-plex is ignored and is hardwired
 by feedmail to either \"X-Sender\" or \"X-Resent-Sender\".
 
@@ -498,7 +498,7 @@ header is fiddled after the From: header is fiddled."
   "*If non-nil, force writing file as binary (this applies to queues and Fcc:).
 On systems where there is a difference between binary and text files,
 feedmail will temporarily manipulate the values of `buffer-file-type'
-and/or default-buffer-file-type to make the writing as binary.  If
+and/or `default-buffer-file-type' to make the writing as binary.  If
 nil, writing will be in text mode.  On systems where there is no
 distinction or where it is controlled by other variables or other
 means, this option has no effect."
@@ -521,7 +521,7 @@ another function, but let's not be ridiculous).  If a string, it
 should be just the contents of the header, not the name of the header
 itself nor the trailing newline.  If a function, it will be called
 with no arguments.  For an explanation of fiddle-plexes, see the
-documentation for the variable feedmail-fiddle-plex-blurb.  In all
+documentation for the variable `feedmail-fiddle-plex-blurb'.  In all
 cases the name element of the fiddle-plex is ignored and is hardwired
 by feedmail to either \"X-From\" or \"X-Resent-From\".
 
@@ -544,7 +544,7 @@ change the value of `user-mail-address' to be the same while the message
 is being sent.  If there is no Sender: header, use the From: header,
 if any.  Address values are taken from the actual message just before
 it is sent, and the process is independent of the values of
-feedmail-from-line and/or feedmail-sender-line.
+`feedmail-from-line' and/or `feedmail-sender-line'.
 
 There are many and good reasons for having the message header
 From:/Sender: be different from the message envelope \"from\"
@@ -595,7 +595,7 @@ another function, but let's not be ridiculous).  If a string, it
 should be just the contents of the header, not the name of the header
 itself nor the trailing newline.  If a function, it will be called
 with no arguments.  For an explanation of fiddle-plexes, see the
-documentation for the variable feedmail-fiddle-plex-blurb.  In all
+documentation for the variable `feedmail-fiddle-plex-blurb'.  In all
 cases the name element of the fiddle-plex is ignored and is hardwired
 by feedmail to either \"X-Mailer\" or \"X-Resent-Mailer\"."
   :group 'feedmail-headers
@@ -619,7 +619,7 @@ should be just the contents of the header, not the name of the header
 itself nor the trailing newline.  If a function, it will be called
 with one argument: the possibly-nil name of the file associated with
 the message buffer.  For an explanation of fiddle-plexes, see the
-documentation for the variable feedmail-fiddle-plex-blurb.  In all
+documentation for the variable `feedmail-fiddle-plex-blurb'.  In all
 cases the name element of the fiddle-plex is ignored and is hardwired
 by feedmail to either \"Message-Id\" or \"Resent-Message-Id\".
 
@@ -655,7 +655,7 @@ If nil, nothing is done about Date:.
 
 If t, a Date: header of a predetermined format is produced, but only
 if there is not already a Date: in the message.  A value of t is
-equivalent to using the function feedmail-default-date-generator.
+equivalent to using the function `feedmail-default-date-generator'.
 
 If neither nil nor t, it may be a string, a fiddle-plex, or a function
 which returns either nil, t, a string, or a fiddle-plex (or, in fact,
@@ -664,7 +664,7 @@ should be just the contents of the header, not the name of the header
 itself nor the trailing newline.  If a function, it will be called
 with one argument: the possibly-nil name of the file associated with
 the message buffer.  For an explanation of fiddle-plexes, see the
-documentation for the variable feedmail-fiddle-plex-blurb.  In all
+documentation for the variable `feedmail-fiddle-plex-blurb'.  In all
 cases the name element of the fiddle-plex is ignored and is hardwired
 by feedmail to either \"Date\" or \"Resent-Date\".
 
@@ -700,10 +700,10 @@ fiddle-plex.
 
 feedmail will use this list of fiddle-plexes to manipulate user-specified
 message header fields.  It does this after it has completed all normal
-message header field manipulation and before calling feedmail-last-chance-hook.
+message header field manipulation and before calling `feedmail-last-chance-hook'.
 
 For an explanation of fiddle-plexes, see the documentation for the
-variable feedmail-fiddle-plex-blurb.  In contrast to some other fiddle-plex
+variable `feedmail-fiddle-plex-blurb'.  In contrast to some other fiddle-plex
 manipulation functions, in this context, it makes no sense to have an element
 which is nil, t, or a simple string."
   :group 'feedmail-headers
@@ -727,7 +727,7 @@ it, you should avoid it since it is inherently less efficient than normal
 multiple delivery.  One reason to use it is to overcome mis-featured mail
 transports which betray your trust by revealing Bcc: addressees in the
 headers of a message.  Another use is to do a crude form of mailmerge, for
-which see feedmail-spray-address-fiddle-plex-list.
+which see `feedmail-spray-address-fiddle-plex-list'.
 
 If one of the calls to the buffer-eating function results in an error,
 what happens next is carelessly defined, so beware."
@@ -736,12 +736,12 @@ what happens next is carelessly defined, so beware."
   )
 
 (defvar feedmail-spray-this-address nil
-  "Do not set or change this variable.  See feedmail-spray-address-fiddle-plex-list.")
+  "Do not set or change this variable.  See `feedmail-spray-address-fiddle-plex-list'.")
 
 (defcustom feedmail-spray-address-fiddle-plex-list nil
   "User-supplied specification for a crude form of mailmerge capability.
 When spraying is enabled, feedmail composes a list of envelope addresses.
-In turn, feedmail-spray-this-address is temporarily set to each address
+In turn, `feedmail-spray-this-address' is temporarily set to each address
 \(stripped of any comments and angle brackets\) and calls a function which
 fiddles message headers according to this variable.  See the documentation for
 `feedmail-fiddle-plex-blurb', for an overview of fiddle-plex data structures.
@@ -772,15 +772,15 @@ For example,
 
 The idea of the example is that, during spray mode, as each message is
 about to be transmitted to an individual address, the function will be
-called and will consult feedmail-spray-this-address to find the
+called and will consult `feedmail-spray-this-address' to find the
 stripped envelope email address (no comments or angle brackets).  The
 function should return an embellished form of the address.
 
 The recipe for sending form letters is:  (1) create a message with all
 addressees on Bcc: headers; (2) tell feedmail to remove Bcc: headers
 before sending the message; (3) create a function which will embellish
-stripped addresses, if desired; (4) define feedmail-spray-address-fiddle-plex-list
-appropriately; (5) send the message with feedmail-enable-spray set
+stripped addresses, if desired; (4) define `feedmail-spray-address-fiddle-plex-list'
+appropriately; (5) send the message with `feedmail-enable-spray' set
 non-nil; (6) stand back and watch co-workers wonder at how efficient
 you are at accomplishing inherently inefficient things."
   :group 'feedmail-spray
@@ -809,7 +809,7 @@ versa by pretending to send it and then selecting whichever queue
 directory you want at the prompt.  The right thing will happen.
 
 To transmit all the messages in the queue, invoke the command
-feedmail-run-the-queue or feedmail-run-the-queue-no-prompts."
+`feedmail-run-the-queue' or `feedmail-run-the-queue-no-prompts'."
   :group 'feedmail-queue
   :type 'boolean
   )
@@ -818,7 +818,7 @@ feedmail-run-the-queue or feedmail-run-the-queue-no-prompts."
 (defcustom feedmail-queue-runner-confirm-global nil
   "*If non-nil, give a y-or-n confirmation prompt before running the queue.
 Prompt even if the queue is about to be processed as a result of a call to
-feedmail-run-the-queue-no-prompts.  This gives you a way to bail out
+`feedmail-run-the-queue-no-prompts'.  This gives you a way to bail out
 without having to answer no to the individual message prompts."
   :group 'feedmail-queue
   :type 'boolean)
@@ -868,7 +868,7 @@ without a prompt."
 (defcustom feedmail-ask-before-queue-prompt "FQM: Message action (q, i, d, e, ?)? [%s]: "
   "*A string which will be used for the message action prompt.
 If it contains a \"%s\", that will be replaced with the value of
-feedmail-ask-before-queue-default."
+`feedmail-ask-before-queue-default'."
   :group 'feedmail-queue
   :type 'string
   )
@@ -877,7 +877,7 @@ feedmail-ask-before-queue-default."
 (defcustom feedmail-ask-before-queue-reprompt "FQM: Please type q, i, d, or e; or ? for help [%s]: "
   "*A string which will be used for repompting after invalid input.
 If it contains a \"%s\", that will be replaced with the value of
-feedmail-ask-before-queue-default."
+`feedmail-ask-before-queue-default'."
   :group 'feedmail-queue
   :type 'string
   )
@@ -921,7 +921,7 @@ the help for the message action prompt."
 All of the values are function names, except help, which is a special
 symbol that calls up help for the prompt (the help describes the
 actions from the standard alist).  To customize your own choices,
-define a similar alist called feedmail-prompt-before-queue-user-alist.
+define a similar alist called `feedmail-prompt-before-queue-user-alist'.
 The actual alist used for message action will be the standard alist
 overlaid with the user-alist.  To neutralize an item in the standard
 alist without providing a replacement, define an appropriate element
@@ -929,7 +929,7 @@ in the user alist with a value of nil." )
 
 
 (defcustom feedmail-prompt-before-queue-user-alist nil
-  "See feedmail-prompt-before-queue-standard-alist."
+  "See `feedmail-prompt-before-queue-standard-alist'."
   :group 'feedmail-queue
   :type '(repeat (cons character function))
   )
@@ -940,10 +940,10 @@ in the user alist with a value of nil." )
 When the message action prompt is shown, the user can as for verbose help,
 at which point a buffer pops up describing the meaning of possible
 responses to the prompt.  Through various customizations (see, for
-example, feedmail-prompt-before-queue-user-alist), the available responses
+example, `feedmail-prompt-before-queue-user-alist'), the available responses
 and the prompt itself can be changed.  If this variable is set to a string
 value, that string is written to the help buffer after the standard info.
-It may contain embedded line breaks.  It will be printed via princ."
+It may contain embedded line breaks.  It will be printed via `princ'."
   :group 'feedmail-queue
   :type '(choice (const nil) string)
   )
@@ -955,7 +955,7 @@ It may contain embedded line breaks.  It will be printed via princ."
     (after-draft . feedmail-queue-reminder-medium)
     (after-run . feedmail-queue-reminder-brief)
     (on-demand . feedmail-run-the-queue-global-prompt))
-  "See feedmail-queue-reminder."
+  "See `feedmail-queue-reminder'."
   :group 'feedmail-queue
   :type '(repeat (cons (choice :tag "Event"
                               (const on-demand)
@@ -1017,7 +1017,7 @@ used."
 (defcustom feedmail-queue-use-send-time-for-message-id nil
   "*If non-nil, use send time for the Message-Id: header value.
 This variable is used by the default Message-Id: generating function,
-feedmail-default-message-id-generator.  If nil, the default, the
+`feedmail-default-message-id-generator'.  If nil, the default, the
 last-modified timestamp of the queue file is used to create the
 message Message-Id: header; if there is no queue file, the current time is
 used."
@@ -1061,7 +1061,7 @@ any."
 When feedmail queues a message, it creates a unique file name.  By default,
 the file name is based in part on the subject of the message being queued.
 If there is no subject, consult this variable.  See documentation for the
-function feedmail-queue-subject-slug-maker.
+function `feedmail-queue-subject-slug-maker'.
 
 If t, an innocuous default is used.
 
@@ -1083,8 +1083,8 @@ it's not expected to be a complete filename."
   "*The FQM suffix used to distinguish feedmail queued message files.
 You probably want this to be a period followed by some letters and/or
 digits.  The distinction is to be able to tell them from other random
-files that happen to be in the feedmail-queue-directory or
-feedmail-queue-draft-directory. By the way, FQM stands for feedmail
+files that happen to be in the `feedmail-queue-directory' or
+`feedmail-queue-draft-directory'.  By the way, FQM stands for feedmail
 queued message."
   :group 'feedmail-queue
   :type 'string
@@ -1133,20 +1133,20 @@ variable, but may depend on its value as described here.")
 
 
 (defun feedmail-mail-send-hook-splitter ()
-  "Facilitate dividing mail-send-hook things into queued and immediate cases.
-If you have mail-send-hook functions that should only be called for sending/
+  "Facilitate dividing `mail-send-hook' things into queued and immediate cases.
+If you have `mail-send-hook' functions that should only be called for sending/
 queueing messages or only be called for the sending of queued messages, this is
-for you.  Add this function to mail-send-hook with something like this:
+for you.  Add this function to `mail-send-hook' with something like this:
 
        (add-hook 'mail-send-hook 'feedmail-mail-send-hook-splitter)
 
-Then add the functions you want called to either feedmail-mail-send-hook-queued
-or feedmail-mail-send-hook, as apprpriate.  The distinction is that
-feedmail-mail-send-hook will be called when you send mail from a composition
+Then add the functions you want called to either `feedmail-mail-send-hook-queued'
+or `feedmail-mail-send-hook', as apprpriate.  The distinction is that
+`feedmail-mail-send-hook' will be called when you send mail from a composition
 buffer (typically by typing C-c C-c), whether the message is sent immediately
-or placed in the queue or drafts directory.  feedmail-mail-send-hook-queued is
+or placed in the queue or drafts directory.  `feedmail-mail-send-hook-queued' is
 called when messages are being sent from the queue directory, typically via a
-call to feedmail-run-the-queue."
+call to `feedmail-run-the-queue'."
   (if feedmail-queue-runner-is-active
       (run-hooks 'feedmail-mail-send-hook-queued)
     (run-hooks 'feedmail-mail-send-hook))
@@ -1154,15 +1154,15 @@ call to feedmail-run-the-queue."
 
 
 (defvar feedmail-mail-send-hook nil
-  "*See documentation for feedmail-mail-send-hook-splitter.")
+  "*See documentation for `feedmail-mail-send-hook-splitter'.")
 
 
 (defvar feedmail-mail-send-hook-queued nil
-  "*See documentation for feedmail-mail-send-hook-splitter.")
+  "*See documentation for `feedmail-mail-send-hook-splitter'.")
 
 
 (defun feedmail-confirm-addresses-hook-example ()
-  "An example of a feedmail-last-chance-hook.
+  "An example of a `feedmail-last-chance-hook'.
 It shows the simple addresses and gets a confirmation.  Use as:
  (setq feedmail-last-chance-hook 'feedmail-confirm-addresses-hook-example)."
   (save-window-excursion
@@ -1179,10 +1179,10 @@ It shows the simple addresses and gets a confirmation.  Use as:
 It has already had all the header prepping from the standard package.
 The next step after running the hook will be to push the buffer into a
 subprocess that mails the mail.  The hook might be interested in
-these: (1) feedmail-prepped-text-buffer contains the header and body
-of the message, ready to go; (2) feedmail-address-list contains a list
+these: (1) `feedmail-prepped-text-buffer' contains the header and body
+of the message, ready to go; (2) `feedmail-address-list' contains a list
 of simplified recipients of addresses which are to be given to the
-subprocess (the hook may change the list); (3) feedmail-error-buffer
+subprocess (the hook may change the list); (3) `feedmail-error-buffer'
 is an empty buffer intended to soak up errors for display to the user.
 If the hook allows interactive activity, the user should not send more
 mail while in the hook since some of the internal buffers will be
@@ -1197,10 +1197,10 @@ reused and things will get confused."
 It has already had all the header prepping from the standard package.
 The next step after running the hook will be to save the message via
 Fcc: processing. The hook might be interested in these: (1)
-feedmail-prepped-text-buffer contains the header and body of the
-message, ready to go; (2) feedmail-address-list contains a list of
+`feedmail-prepped-text-buffer' contains the header and body of the
+message, ready to go; (2) `feedmail-address-list' contains a list of
 simplified recipients of addressees to whom the message was sent (3)
-feedmail-error-buffer is an empty buffer intended to soak up errors
+`feedmail-error-buffer' is an empty buffer intended to soak up errors
 for display to the user.  If the hook allows interactive activity, the
 user should not send more mail while in the hook since some of the
 internal buffers will be reused and things will get confused."
@@ -1213,7 +1213,7 @@ internal buffers will be reused and things will get confused."
   "*A function to set the proper mode of a message file.
 Called when the message is read back out of the queue directory with a single
 argument, the optional argument used in the call to
-feedmail-run-the-queue or feedmail-run-the-queue-no-prompts.
+`feedmail-run-the-queue' or `feedmail-run-the-queue-no-prompts'.
 
 Most people want `mail-mode', so the default value is an anonymous
 function which is just a wrapper to ignore the supplied argument when
@@ -1235,7 +1235,7 @@ When trying to send a queued message, if the value of this variable is
 non-nil, feedmail will first try to send the message using the value
 of `mail-header-separator'.  If it can't find that, it will temporarily
 set `mail-header-separator' to the value of
-feedmail-queue-alternative-mail-header-separator and try again."
+`feedmail-queue-alternative-mail-header-separator' and try again."
   :group 'feedmail-queue
   :type '(choice (const nil) string)
   )
@@ -1245,11 +1245,11 @@ feedmail-queue-alternative-mail-header-separator and try again."
   "*Function to initiate sending a message file.
 Called for each message read back out of the queue directory with a
 single argument, the optional argument used in the call to
-feedmail-run-the-queue or feedmail-run-the-queue-no-prompts.
+`feedmail-run-the-queue' or `feedmail-run-the-queue-no-prompts'.
 Interactively, that argument will be the prefix argument.  Most people
-want mail-send-and-exit (bound to C-c C-c in mail-mode), but here's
-your chance to have something different.  Called with funcall, not
-call-interactively."
+want `mail-send-and-exit' (bound to C-c C-c in mail-mode), but here's
+your chance to have something different.  Called with `funcall', not
+`call-interactively'."
   :group 'feedmail-queue
   :type 'function
   )
@@ -1291,11 +1291,11 @@ The function's three (mandatory) arguments are: (1) the buffer
 containing the prepped message; (2) a buffer where errors should be
 directed; and (3) a list containing the addresses individually as
 strings.  Three popular choices for this are
-feedmail-buffer-to-binmail, feedmail-buffer-to-smtpmail, and
-feedmail-buffer-to-sendmail.  If you use the sendmail form, you
-probably want to set feedmail-nuke-bcc and/or feedmail-nuke-resent-bcc
+`feedmail-buffer-to-binmail', `feedmail-buffer-to-smtpmail', and
+`feedmail-buffer-to-sendmail'.  If you use the sendmail form, you
+probably want to set `feedmail-nuke-bcc' and/or `feedmail-nuke-resent-bcc'
 to nil.  If you use the binmail form, check the value of
-feedmail-binmail-template."
+`feedmail-binmail-template'."
   :group 'feedmail-misc
   :type 'function
   )
@@ -1306,7 +1306,7 @@ feedmail-binmail-template."
 It can result in any command understandable by /bin/sh.  Might not
 work at all in non-Unix environments.  The single '%s', if present,
 gets replaced by the space-separated, simplified list of addressees.
-Used in feedmail-buffer-to-binmail to form the shell command which
+Used in `feedmail-buffer-to-binmail' to form the shell command which
 will receive the contents of the prepped buffer as stdin.  If you'd
 like your errors to come back as mail instead of immediately in a
 buffer, try /bin/rmail instead of /bin/mail (this can be accomplished
@@ -1535,13 +1535,13 @@ with various lower-level mechanisms to provide features such as queueing."
 
 ;;;###autoload
 (defun feedmail-run-the-queue-no-prompts (&optional arg)
-  "Like feedmail-run-the-queue, but suppress confirmation prompts."
+  "Like `feedmail-run-the-queue', but suppress confirmation prompts."
   (interactive "p")
   (let ((feedmail-confirm-outgoing nil)) (feedmail-run-the-queue arg)))
 
 ;;;###autoload
 (defun feedmail-run-the-queue-global-prompt (&optional arg)
-  "Like feedmail-run-the-queue, but with a global confirmation prompt.
+  "Like `feedmail-run-the-queue', but with a global confirmation prompt.
 This is generally most useful if run non-interactively, since you can
 bail out with an appropriate answer to the global confirmation prompt."
   (interactive "p")
@@ -1678,7 +1678,7 @@ backup file names and the like)."
   "Perform some kind of reminder activity about queued and draft messages.
 Called with an optional symbol argument which says what kind of event
 is triggering the reminder activity.  The default is 'on-demand, which
-is what you typically would use if you were putting this in your emacs start-up
+is what you typically would use if you were putting this in your Emacs start-up
 or mail hook code.  Other recognized values for WHAT-EVENT (these are passed
 internally by feedmail):
 
@@ -1687,11 +1687,11 @@ internally by feedmail):
    after-draft          (a message has just been placed in the draft directory)
    after-run            (the queue has just been run, possibly sending messages)
 
-WHAT-EVENT is used as a key into the table feedmail-queue-reminder-alist.  If
+WHAT-EVENT is used as a key into the table `feedmail-queue-reminder-alist'.  If
 the associated value is a function, it is called without arguments and is expected
 to perform the reminder activity.  You can supply your own reminder functions
-by redefining feedmail-queue-reminder-alist.  If you don't want any reminders,
-you can set feedmail-queue-reminder-alist to nil."
+by redefining `feedmail-queue-reminder-alist'.  If you don't want any reminders,
+you can set `feedmail-queue-reminder-alist' to nil."
   (interactive "p")
   (let ((key (if (and what-event (symbolp what-event)) what-event 'on-demand)) entry reminder)
     (setq entry (assoc key feedmail-queue-reminder-alist))
@@ -1871,7 +1871,7 @@ the counts."
 Optional argument QUEUE-DIRECTORY specifies into which directory the
 file will be placed.  The name is based on the Subject: header (if
 there is one).  If there is no subject,
-feedmail-queue-default-file-slug is consulted Special characters are
+`feedmail-queue-default-file-slug' is consulted.  Special characters are
 mapped to mostly alphanumerics for safety."
   (let ((eoh-marker) (case-fold-search t) (subject "") (s-point))
     (setq eoh-marker (feedmail-find-eoh))
@@ -2152,7 +2152,7 @@ mapped to mostly alphanumerics for safety."
   "Internal feedmail function for jamming fields into message header.
 NAME, VALUE, ACTION, and FOLDING are the four elements of a
 fiddle-plex, as described in the documentation for the variable
-feedmail-fiddle-plex-blurb."
+`feedmail-fiddle-plex-blurb'."
   (let ((case-fold-search t)
        (header-colon (concat (regexp-quote name) ":"))
        header-regexp eoh-marker has-like ag-like val-like that-point)
@@ -2249,7 +2249,7 @@ feedmail-fiddle-plex-blurb."
 
 
 (defun feedmail-envelope-deducer (eoh-marker)
-  "If feedmail-deduce-envelope-from is false, simply return `user-mail-address'.
+  "If `feedmail-deduce-envelope-from' is false, simply return `user-mail-address'.
 Else, look for Sender: or From: (or Resent-*) and
 return that value."
   (if (not feedmail-deduce-envelope-from)
@@ -2345,7 +2345,7 @@ return that value."
 
 
 (defun feedmail-fiddle-date (maybe-file)
-  "Fiddle Date:.  See documentation of feedmail-date-generator."
+  "Fiddle Date:.  See documentation of `feedmail-date-generator'."
   ;; default is to fall off the end of the list and do nothing
   (cond
    ;; nil means do nothing
@@ -2377,7 +2377,7 @@ return that value."
 (defun feedmail-default-message-id-generator (maybe-file)
   "Default function for generating Message-Id: header contents.
 Based on a date and a sort of random number for tie breaking.  Unless
-feedmail-message-id-suffix is defined, uses `user-mail-address', so be
+`feedmail-message-id-suffix' is defined, uses `user-mail-address', so be
 sure it's set."
   (let ((date-time)
        (end-stuff (if feedmail-message-id-suffix feedmail-message-id-suffix user-mail-address)))
@@ -2395,7 +2395,7 @@ sure it's set."
   )
 
 (defun feedmail-fiddle-message-id (maybe-file)
-  "Fiddle Message-Id:.  See documentation of feedmail-message-id-generator."
+  "Fiddle Message-Id:.  See documentation of `feedmail-message-id-generator'."
   ;; default is to fall off the end of the list and do nothing
   (cond
    ;; nil means do nothing
@@ -2436,7 +2436,7 @@ sure it's set."
 
 
 (defun feedmail-fiddle-x-mailer ()
-  "Fiddle X-Mailer:.  See documentation of feedmail-x-mailer-line."
+  "Fiddle X-Mailer:.  See documentation of `feedmail-x-mailer-line'."
   ;; default is to fall off the end of the list and do nothing
   (cond
    ;; t is the same a using the function feedmail-default-x-mailer-generator, so let it and recurse
@@ -2464,7 +2464,7 @@ sure it's set."
 
 
 (defun feedmail-fiddle-spray-address (addy-plex)
-  "Fiddle header for single spray address.  Uses feedmail-spray-this-address."
+  "Fiddle header for single spray address.  Uses `feedmail-spray-this-address'."
   ;; default is to fall off the end of the list and do nothing
   (cond
    ;; nil means do nothing
@@ -2607,7 +2607,7 @@ Resent-To:, Resent-Cc:, and Resent-Bcc:."
 (defun feedmail-deduce-address-list (message-buffer header-start header-end addr-regexp address-list)
   "Get address list with all comments and other excitement trimmed.
 Addresses are collected only from headers whose names match the fourth
-argument Returns a list of strings.  Duplicate addresses will have
+argument Returns a list of strings.  Duplicate addresses will have
 been weeded out."
   (let ((simple-address)
        (address-blob)
index bba2311..14edab9 100644 (file)
@@ -211,7 +211,7 @@ specify 'this\\&that' in the appropriate spam definition field."
   :group 'rmail-spam-filter)
 
 (defvar rsf-scanning-messages-now nil
-  "Non nil when `rmail-spam-filter' scans messages.
+  "Non-nil when `rmail-spam-filter' scans messages.
 This is for interaction with `rsf-bbdb-auto-delete-spam-entries'.")
 
 ;; the advantage over the automatic filter definitions is the AND conjunction
index 68dfd9f..148f391 100644 (file)
@@ -2828,7 +2828,7 @@ If summary buffer is currently displayed, update current message there also."
        (if blurb
            (message blurb))))))
 
-(defun rmail-redecode-body (coding)
+(defun rmail-redecode-body (coding &optional raw)
   "Decode the body of the current message using coding system CODING.
 This is useful with mail messages that have malformed or missing
 charset= headers.
@@ -2838,6 +2838,16 @@ and displayed in the RMAIL buffer, but the coding system used to
 decode it was incorrect.  It then encodes the message back to its
 original form, and decodes it again, using the coding system CODING.
 
+Optional argument RAW, if non-nil, means don't encode the message
+before decoding it with the new CODING.  This is useful if the current
+message text was produced by some function which invokes `insert',
+since `insert' leaves unibyte character codes 128 through 255 unconverted
+to multibyte.  One example of such a situation is when the text was
+produced by `base64-decode-region'.
+
+Interactively, invoke the function with a prefix argument to set RAW
+non-nil.
+
 Note that if Emacs erroneously auto-detected one of the iso-2022
 encodings in the message, this function might fail because the escape
 sequences that switch between character sets and also single-shift and
@@ -2849,7 +2859,8 @@ iso-8859, koi8-r, etc."
     (or (eq major-mode 'rmail-mode)
        (switch-to-buffer rmail-buffer))
     (save-excursion
-      (let ((pruned (rmail-msg-is-pruned)))
+      (let ((pruned (rmail-msg-is-pruned))
+           (raw (or raw current-prefix-arg)))
        (unwind-protect
            (let ((msgbeg (rmail-msgbeg rmail-current-message))
                  (msgend (rmail-msgend rmail-current-message))
@@ -2883,7 +2894,22 @@ iso-8859, koi8-r, etc."
                              (car (find-coding-systems-region msgbeg msgend))))
                    (setq x-coding-header (point-marker))
                    (narrow-to-region msgbeg msgend)
-                   (encode-coding-region (point) msgend old-coding)
+                   (and (null raw)
+                        ;; If old and new encoding are the same, it
+                        ;; clearly doesn't make sense to encode.
+                        (not (coding-system-equal
+                              (coding-system-base old-coding)
+                              (coding-system-base coding)))
+                        ;; If the body includes only eight-bit-*
+                        ;; characters, encoding might fail, e.g. with
+                        ;; UTF-8, and isn't needed anyway.
+                        (> (length (delq 'ascii
+                                         (delq 'eight-bit-graphic
+                                               (delq 'eight-bit-control
+                                                     (find-charset-region
+                                                      msgbeg msgend)))))
+                           0)
+                        (encode-coding-region (point) msgend old-coding))
                    (decode-coding-region (point) msgend coding)
                    (setq last-coding-system-used coding)
                    ;; Rewrite the coding-system header according
index e09e1eb..d7b4c59 100644 (file)
@@ -408,7 +408,7 @@ FILE-NAME defaults, interactively, from the Subject field of the message."
     (goto-char (point-min))
     (search-forward "\n\n")
     (and (file-exists-p file-name)
-        (not (y-or-n-p (message "File %s exists; overwrite? " file-name)))
+        (not (y-or-n-p (format "File %s exists; overwrite? " file-name)))
         (error "Operation aborted"))
     (write-region (point) (point-max) file-name)
     (if (equal major-mode 'rmail-mode)
index ac87a93..271c7a7 100644 (file)
@@ -244,6 +244,11 @@ This is relative to `smtpmail-queue-dir'.")
        (save-excursion
          (set-buffer tembuf)
          (erase-buffer)
+         ;; Use the same buffer-file-coding-system as in the mail
+         ;; buffer, otherwise any write-region invocations (e.g., in
+         ;; mail-do-fcc below) will annoy with asking for a suitable
+         ;; encoding.
+         (set-buffer-file-coding-system smtpmail-code-conv-from nil t)
          (insert-buffer-substring mailbuf)
          (goto-char (point-max))
          ;; require one newline at the end.
@@ -326,6 +331,22 @@ This is relative to `smtpmail-queue-dir'.")
            (goto-char (point-min))
            (unless (re-search-forward "^Date:" delimline t)
              (insert "Date: " (message-make-date) "\n"))
+           ;; Possibly add a MIME header for the current coding system
+           (let (charset)
+             (goto-char (point-min))
+             (and (eq mail-send-nonascii 'mime)
+                  (not (re-search-forward "^MIME-version:" delimline t))
+                  (progn (skip-chars-forward "\0-\177")
+                         (/= (point) (point-max)))
+                  smtpmail-code-conv-from
+                  (setq charset
+                        (coding-system-get smtpmail-code-conv-from
+                                           'mime-charset))
+                  (goto-char delimline)
+                  (insert "MIME-version: 1.0\n"
+                          "Content-type: text/plain; charset="
+                          (symbol-name charset)
+                          "\nContent-Transfer-Encoding: 8bit\n")))
            ;; Insert an extra newline if we need it to work around
            ;; Sun's bug that swallows newlines.
            (goto-char (1+ delimline))
@@ -334,7 +355,10 @@ This is relative to `smtpmail-queue-dir'.")
            ;; Find and handle any FCC fields.
            (goto-char (point-min))
            (if (re-search-forward "^FCC:" delimline t)
-               (mail-do-fcc delimline))
+               ;; Force mail-do-fcc to use the encoding of the mail
+               ;; buffer to encode outgoing messages on FCC files.
+               (let ((coding-system-for-write smtpmail-code-conv-from))
+                 (mail-do-fcc delimline)))
            (if mail-interactive
                (with-current-buffer errbuf
                  (erase-buffer))))
@@ -370,6 +394,7 @@ This is relative to `smtpmail-queue-dir'.")
                (make-directory smtpmail-queue-dir t))
              (with-current-buffer buffer-data
                (erase-buffer)
+               (set-buffer-file-coding-system smtpmail-code-conv-from nil t)
                (insert-buffer-substring tembuf)
                (write-file file-data)
                (set-buffer buffer-elisp)
index 3126f81..e7c44ed 100644 (file)
@@ -40,9 +40,9 @@
 ;;;     then execute them as though emacs were just starting up.
 ;;;
 (defun vms-pmail-save-and-exit ()
-  "Save current buffer and exit emacs.
-If this emacs cannot be suspended, you will be prompted about modified
-buffers other than the mail buffer.  BEWARE --- suspending emacs without
+  "Save current buffer and exit Emacs.
+If this Emacs cannot be suspended, you will be prompted about modified
+buffers other than the mail buffer.  BEWARE --- suspending Emacs without
 saving your mail buffer causes mail to abort the send (potentially useful
 since the mail buffer is still here)."
   (interactive)
@@ -55,7 +55,7 @@ since the mail buffer is still here)."
     (suspend-emacs)))
 
 (defun vms-pmail-abort ()
-  "Mark buffer as unmodified and exit emacs.
+  "Mark buffer as unmodified and exit Emacs.
 When the editor is exited without saving its buffer, VMS mail does not
 send a message.  If you have other modified buffers you will be
 prompted for what to do with them."
@@ -78,7 +78,7 @@ following bindings are established.
 \\[vms-pmail-save-and-exit]    vms-pmail-save-and-exit
 \\[vms-pmail-abort]    vms-pmail-abort
 
-All other emacs commands are still available."
+All other Emacs commands are still available."
   (interactive)
   (auto-save-mode -1)
   (text-mode)
index 6c5a68d..8acdde5 100644 (file)
@@ -67,17 +67,8 @@ COMPILE_FIRST = \
 
 emacs = "$(EMACS)" $(EMACSOPT)
 
-# Common command to find subdirectories
-
-setwins=subdirs=`find $$wd -type d -print`; \
-       for file in $$subdirs; do \
-          case $$file in */Old | */RCS | */CVS | */CVS/* | */=* ) ;; \
-               *) wins="$$wins $$file" ;; \
-          esac; \
-        done
-
 # Have to define the list of subdirs manually when not using sh.
-WINS=\
+WINS_ALMOST=\
        calc \
        calendar \
        emacs-lisp \
@@ -90,13 +81,15 @@ WINS=\
        mail \
        mh-e \
        net \
-       obsolete \
        play \
        progmodes \
        term \
        textmodes \
        url
 
+WINS= $(WINS_ALMOST) \
+       obsolete
+
 doit:
 
 $(lisp)/cus-load.el:
@@ -160,10 +153,10 @@ loaddefs.el-CMD:
 # WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as
 #          this can break with GNU Make 3.81 and later if sh.exe is used.
 autoloads: $(lisp)/loaddefs.el doit
-       @echo Directories: . $(WINS)
+       @echo Directories: . $(WINS_ALMOST)
        $(emacs) -l autoload \
                --eval $(ARGQUOTE)(setq find-file-hook nil find-file-suppress-same-file-warnings t)$(ARGQUOTE) \
-               -f w32-batch-update-autoloads "$(lisp)/loaddefs.el" . $(WINS)
+               -f w32-batch-update-autoloads "$(lisp)/loaddefs.el" . $(WINS_ALMOST)
 
 $(lisp)/subdirs.el:
        $(MAKE) $(MFLAGS) update-subdirs
index 642149b..fb59ef9 100644 (file)
@@ -1018,9 +1018,9 @@ mail status in mode line"))
 
 (define-key menu-bar-options-menu [case-fold-search]
   (menu-bar-make-toggle toggle-case-fold-search case-fold-search
-                       "Case-Insensitive Search"
-                       "Case-Insensitive Search %s"
-                       "Ignore letter-case in search"))
+           "Case-Insensitive Search"
+           "Case-Insensitive Search %s for buffers without local setting"
+           "Ignore letter-case in search for buffers without local setting"))
 
 (defun menu-bar-text-mode-auto-fill ()
   (interactive)
@@ -1090,9 +1090,6 @@ mail status in mode line"))
 (define-key menu-bar-games-menu [zone]
   '(menu-item "Zone Out"  zone
              :help "Play tricks with Emacs display when Emacs is idle"))
-(define-key menu-bar-games-menu [yow]
-  '(menu-item "Random Quotation"  yow
-             :help "Display a random Zippy quotation"))
 (define-key menu-bar-games-menu [tetris]
   '(menu-item "Tetris"  tetris))
 (define-key menu-bar-games-menu [solitaire]
@@ -1599,14 +1596,14 @@ Buffers menu is regenerated."
                               name))))
                 ;; Compute the maximum length of any name.
                 (dolist (buf buffer-list)
-                  (unless (eq ?\  (aref (cdr buf) 0))
+                  (unless (eq ?\s (aref (cdr buf) 0))
                     (setq menu-bar-update-buffers-maxbuf
                           (max menu-bar-update-buffers-maxbuf
                                (length (cdr buf))))))
                 ;; Set ALIST to an alist of the form
                 ;; ITEM-STRING . BUFFER
                 (dolist (buf buffer-list)
-                  (unless (eq ?\  (aref (cdr buf) 0))
+                  (unless (eq ?\s (aref (cdr buf) 0))
                     (push (menu-bar-update-buffers-1 buf) alist)))
                 ;; Now make the actual list of items, and add
                 ;; some miscellaneous buffer commands to the end.
@@ -1669,7 +1666,7 @@ Buffers menu is regenerated."
                             'menu-item
                             "List All Buffers"
                             'list-buffers
-                            :help "Pop up a window listing all emacs buffers"
+                            :help "Pop up a window listing all Emacs buffers"
                             ))))
         (setq buffers-menu
               (nconc buffers-menu menu-bar-buffers-menu-command-entries))
index 76875b2..1093fdb 100644 (file)
@@ -1,15 +1,53 @@
+2006-11-14  Bill Wohler  <wohler@newt.com>
+
+       * mh-xface.el (mh-x-image-url-cache-canonicalize): Add `*' to
+       reserved Windows filename characters (closes SF #1396499).
+
+2006-11-13  Bill Wohler  <wohler@newt.com>
+
+       Release MH-E version 8.0.3.
+
+       * mh-e.el (Version, mh-version): Update for release 8.0.3.
+
+       * mh-e.el (mh-alias-local-users): Boolean docstrings should start
+       with "Non-nil means". Perhaps this option should have a -flag
+       appended.
+       (mh-junk-background): Sync docstring with manual.
+
+       * mh-junk.el (mh-spamassassin-blacklist, mh-bogofilter-blacklist)
+       (mh-spamprobe-blacklist): Sync docstring with manual.
+
+2006-11-11  Stephen Gildea  <gildea@stop.mail-abuse.org>
+
+       * mh-junk.el (mh-spamassassin-blacklist, mh-spamassassin-whitelist):
+       Use mh-junk-background consistently in call-process calls.
+       (mh-bogofilter-blacklist, mh-bogofilter-whitelist)
+       (mh-spamprobe-blacklist, mh-spamprobe-whitelist):
+       Use with-current-buffer so the right thing happens if
+       mh-junk-background is t (closes SF #1594802).
+
+       * mh-e.el (mh-junk-background): Document that On value is 0;
+       t may be used for debugging.
+
+2006-11-10  Andreas Schwab  <schwab@suse.de>
+
+       * mh-e.el (mh-draft-folder): Avoid starting sentence with "nil".
+
+2006-11-10  Glenn Morris  <rgm@gnu.org>
+
+       * mh-e.el (mh-draft-folder): Doc fix (Nil -> nil).
+
 2006-09-25  Stephen Gildea  <gildea@stop.mail-abuse.org>
 
        * mh-junk.el (mh-spamassassin-whitelist): Add two missing
-       quotation marks, so that the last two arguments of sa-learn 
+       quotation marks, so that the last two arguments of sa-learn
        are separated properly (closes SF #1565460).
-       
-       * (mh-spamassassin-blacklist): In example .procmailrc, add
+       (mh-spamassassin-blacklist): In example .procmailrc, add
        PATH element to find mhparam on Debian.
-       
+
 2006-09-24  Stephen Gildea  <gildea@stop.mail-abuse.org>
 
-       * mh-comp.el (mh-send-args): Initialize to "" instead of nil 
+       * mh-comp.el (mh-send-args): Initialize to "" instead of nil
        so that we always have a valid string for split-string even if
        nothing is added in mh-send-letter (closes SF #1564742).
 
 
        * mh-tool-bar.el (mh-tool-bar-define): Fix XEmacs' vector-list so
        it refers to the icons in mh-xemacs-icon-map instead of trying to
-       declare the icons in situ. This allows mh-tool-bar.el to be
+       declare the icons in situ.  This allows mh-tool-bar.el to be
        compiled under XEmacs. Remove initial value for
        mh-tool-bar-folder-buttons, mh-tool-bar-show-buttons,
-       mh-tool-bar-letter-buttons. The MH-E icons now appear in XEmacs.
+       mh-tool-bar-letter-buttons.  The MH-E icons now appear in XEmacs.
        In mh-tool-bar-init, check for mh-xemacs-use-tool-bar-flag sooner.
-       This allows MH-E to be used in XEmacs in a tty (closes SF
-       #1506846).
+       This allows MH-E to be used in XEmacs in a tty (closes SF #1506846).
 
 2006-07-03  Bill Wohler  <wohler@newt.com>
 
@@ -41,7 +78,7 @@
        * mh-search.el (mh-search, mh-index-group-by-folder): Add "the" in
        loop construct to be consistent with other loops, and because
        edebug doesn't work without it.
-       
+
 2006-06-29  Ted Phelps  <phelps@gnusto.com>  (tiny change)
 
        * mh-search.el (mh-folder-exists-p): Strip + from folder to avoid
@@ -61,9 +98,9 @@
 2006-06-15  Bill Wohler  <wohler@newt.com>
 
        * mh-search.el (mh-index-new-folder): Use -2 suffix instead of <2>
-       suffix for folder names, as <> are illegal filenakme characters on
+       suffix for folder names, as <> are illegal filename characters on
        Windows (closes SF #1507002).
-       
+
 2006-06-05  Jacob Morzinski  <morzinski@MIT.EDU>  (tiny change)
 
        * mh-comp.el (mh-send-uses-spost): New variable.
        mh-send-uses-spost is t (closes SF #1486726).
 
 2006-06-02  Bill Wohler  <wohler@newt.com>
-       
+
        (mh-folder-exists-p): Change test from an empty buffer, to one
        that contains the actual folder, since GNU mailutils' folder
        command displays output if the folder doesn't exist (closes SF
        * mh-tool-bar.el (image-load-path): Define to shush compiler.
        (mh-buffer-exists-p): Move inside mh-do-in-gnu-emacs since it
        isn't used outside of it.
-       (mh-tool-bar-folder-buttons-init,
-       mh-tool-bar-letter-buttons-init): Update load-path/image-load-path
-       before setting buttons. This code used to be in
-       mh-folder-mode/mh-letter-mode but this was the wrong place since
-       mh-tool-bar-*-buttons-init can also be called when customizing the
-       buttons.
+       (mh-tool-bar-folder-buttons-init, mh-tool-bar-letter-buttons-init):
+       Update load-path/image-load-path before setting buttons.
+       This code used to be in mh-folder-mode/mh-letter-mode but this was
+       the wrong place since mh-tool-bar-*-buttons-init can also be called
+       when customizing the buttons.
        (mh-tool-bar-update): New function which updates tool-bar-map in
        all of the MH-E buffers after customizing the buttons (closes SF
        #1452718).
        find-func (invoked by clicking on the filename link in the *Help*
        buffer).
        (mh-defmacro-compat): Rename to defmacro-mh. Ditto.
+
        * mh-e.el: (mh-defgroup): Rename to defgroup-mh. Ditto.
        (mh-defcustom): Rename to defcustom-mh. Ditto.
        (mh-defface): Rename to defface-mh. Ditto.
        * mh-xface.el (default-enable-multibyte-characters): Ditto.
 
        * mh-compat.el (mh-font-lock-add-keywords): New alias for
-       font-lock-add-keywords. Returns nil on XEmacs.  
+       font-lock-add-keywords. Returns nil on XEmacs.
 
        * mh-e.el: Add MH-E function and variable keywords such as
-       mh-defun-compat and mh-defcustom to font-lock-keywords. 
+       mh-defun-compat and mh-defcustom to font-lock-keywords.
 
 2006-04-13  Bill Wohler  <wohler@newt.com>
 
 
        * mh-tool-bar.el: Use clipboard-kill-region,
        clipboard-kill-ring-save, and clipboard-yank instead of undo,
-       kill-region, and menu-bar-kill-ring-save respectively. In
+       kill-region, and menu-bar-kill-ring-save respectively.  In
        MH-Letter mode, move save-buffer and mh-fully-kill-draft icons in
        front of mh-compose-insertion to be consistent with other mailers,
-       such as Evolution. In MH-Folder mode, move vanilla reply icon to
+       such as Evolution.  In MH-Folder mode, move vanilla reply icon to
        the left of the other reply icons. Use mail/inbox icon instead of
        mail, next-page instead of page-down, delete instead of close,
        mail/move instead of mail/refile, data-save instead of execute,
        mail/flag-for-followup instead of highlight, contact instead of
        mail/alias, open instead of fld-open, zoom-out instead of widen.
 
-       * mh-folder.el (mh-execute-commands, mh-rescan-folder): 
+       * mh-folder.el (mh-execute-commands, mh-rescan-folder):
        * mh-funcs.el (mh-pack-folder): Sync docstrings with manual.
 
 2006-03-27  Eric Ding  <ericding@alum.mit.edu>
 
        * mh-e.el (mh-invisible-header-fields-internal): Add entries
-       "X-AOL-IP:" and "X-MB-Message-" (AOL WebMail)
+       "X-AOL-IP:" and "X-MB-Message-" (AOL WebMail).
 
 2006-03-19  Bill Wohler  <wohler@newt.com>
 
 
 2006-03-17  Bill Wohler  <wohler@newt.com>
 
-       * mh-compat.el (mh-image-load-path-for-library): Minor docstring
-       fix.
+       * mh-compat.el (mh-image-load-path-for-library): Minor docstring fix.
 
 2006-03-16  Bill Wohler  <wohler@newt.com>
 
 
        * mh-e.el (mh-list-to-string-1): Use dolist.
 
-       * mh-compat.el (mh-image-load-path-for-library): Prefer user's
-       images.
+       * mh-compat.el (mh-image-load-path-for-library): Prefer user's images.
 
 2006-03-15  Bill Wohler  <wohler@newt.com>
 
        * mh-compat.el (mh-image-load-path-for-library): Incorporate
        changes from image-load-path-for-library, which are:
        (image-load-path-for-library): Pass value of path rather than
-       symbol. Always return list of directories. Guarantee that image
+       symbol.  Always return list of directories.  Guarantee that image
        directory comes first.
 
        * mh-e.el (image-load-path): Define on those Emacsen that lack it
-       to avoid compile and run-time errors.   
+       to avoid compile and run-time errors.
 
        * mh-folder.el (mh-folder-mode): Use new idiom for setting
        image-load-path.
 
-       * mh-letter.el (mh-letter-mode): Ditto. 
+       * mh-letter.el (mh-letter-mode): Ditto.
 
        * mh-utils.el (mh-logo-display): Ditto.
 
        Release MH-E version 7.93.
 
        * mh-e.el (Version, mh-version): Update for release 7.93.
-       
+
 2006-03-05  Bill Wohler  <wohler@newt.com>
 
        * mh-folder.el (mh-folder-mode): Drop 'load-path argument when
        * mh-compat.el (mh-image-load-path-for-library): Move here from
        mh-utils.el and wrap with mh-defun-compat since this function will
        be soon added to image.el.
-       
-       * mh-utils.el (mh-image-load-path-for-library): Move to
-       mh-compat.el.
+
+       * mh-utils.el (mh-image-load-path-for-library): Move to mh-compat.el.
        (mh-normalize-folder-name): Add return-nil-if-folder-empty
        argument which is useful when calling mh-normalize-folder-name to
        process the folder argument for the folders command.
        (mh-sub-folders): Use new flag to mh-normalize-folder-name to make
-       this function more robust. It could too easily list the folders in
-       /.
+       this function more robust.  It could too easily list the folders in /.
        (mh-folder-list): Fix a couple of problems pointed out by Thomas
-       Baumann. Set folder to nil if empty. Don't append "/" if folder
-       nil.
+       Baumann.  Set folder to nil if empty. Don't append "/" if folder nil.
 
 2006-03-03  Bill Wohler  <wohler@newt.com>
 
        mh-image-load-path-for-library.
 
        * mh-utils.el (mh-image-load-path): Rename to
-       mh-image-load-path-for-library. Add example to docstring. Rename
-       local variable mh-image-directory to image-directory. Move error
+       mh-image-load-path-for-library.  Add example to docstring.  Rename
+       local variable mh-image-directory to image-directory.  Move error
        checks to default case in cond and simplify.
 
        * mh-comp.el (mh-send-letter, mh-insert-auto-fields): Sync
 
        * mh-utils.el (mh-image-directory)
        (mh-image-load-path-called-flag): Delete.
-       (mh-image-load-path): Incorporate changes from Gnus team. Biggest
+       (mh-image-load-path): Incorporate changes from Gnus team.  Biggest
        changes are that it no longer uses/sets mh-image-directory or
        mh-image-load-path-called-flag, and returns the updated path
        rather than change it.
        (mh-image-load-path): Access mh-image-directory instead of
        mh-image-load-path.
        (mh-folder-list): Fix problem with passing in a folder and getting
-       nothing back. Fix problem with passing in empty string and getting
-       the entire filesystem (or infinite loop). Don't append slash to
-       folder. These fixes fix problems observed with the pick search.
+       nothing back.  Fix problem with passing in empty string and getting
+       the entire filesystem (or infinite loop).  Don't append slash to
+       folder.  These fixes fix problems observed with the pick search.
        Thanks to Thomas Baumann for the help (closes SF #1435381).
        (mh-pick-regexp-chars, mh-quote-pick-expr): New variable and
        function for quoting pick regular expression characters (closes SF
        * mh-compat.el (mh-display-color-cells): Return 2 if
        device-color-cells returns nil (closes SF #1436924).
 
-       * mh-e.el (mh-compiling-flag): Delete. No longer needed by
+       * mh-e.el (mh-compiling-flag): Delete.  No longer needed by
        mh-display-color-cells.
 
 2006-02-21  Eric Ding  <ericding@alum.mit.edu>
 
        * mh-show.el (mh-show-mode): Mention goto-address-highlight-p in
        docstring.
-       (mh-show-addr): Call goto-address unconditionally. User should use
+       (mh-show-addr): Call goto-address unconditionally.  User should use
        goto-address-highlight-p instead of mh-show-use-goto-addr-flag.
 
 2006-02-18  Bill Wohler  <wohler@newt.com>
 
 2006-02-16  Bill Wohler  <wohler@newt.com>
 
-       * mh-e.el (mh-inherit-face-flag): New variable. Non-nil means that
+       * mh-e.el (mh-inherit-face-flag): New variable.  Non-nil means that
        the defface :inherit keyword is available.
        (mh-face-data): New variable (contains all face specs) and
        function (accessor).
        (mh-show-to, mh-show-xface, mh-speedbar-folder)
        (mh-speedbar-folder-with-unseen-messages)
        (mh-speedbar-selected-folder)
-       (mh-speedbar-selected-folder-with-unseen-messages): Use
-       mh-face-data.
+       (mh-speedbar-selected-folder-with-unseen-messages):
+       Use mh-face-data.
 
        * mh-utils.el (mh-image-load-path): The variables image-load-path
        or load-path would not get updated if user set mh-image-load-path.
        Moved tests and add-to-list calls outside of cond so they are
        applied consistently, even if they are redundant in some
-       circumstances. Efficiency isn't a concern here. Made error
+       circumstances.  Efficiency isn't a concern here.  Made error
        messages more user-friendly.
 
 2006-02-15  Peter S Galbraith  <psg@debian.org>
 2006-02-10  Bill Wohler  <wohler@newt.com>
 
        * mh-search.el (mh-search): Wrap code in (block mh-search ...)
-       rather than use defun*. XEmacs cannot create a proper autoload for
+       rather than use defun*.  XEmacs cannot create a proper autoload for
        a defun*.
 
 2006-02-09  Bill Wohler  <wohler@newt.com>
 2006-02-08  Peter S Galbraith  <psg@debian.org>
 
        * mh-e.el (mh-invisible-header-fields-internal): Added entries
-       "X-BrightmailFiltered:", "X-Brightmail-Tracker:" and "X-Hashcash"
+       "X-BrightmailFiltered:", "X-Brightmail-Tracker:" and "X-Hashcash".
 
 2006-02-04  Bill Wohler  <wohler@newt.com>
 
        * mh-e.el (mh-inc-spool-list): Update example for Emacs 22 which
-       has an emacsclient command that supports --eval. I had read that
+       has an emacsclient command that supports --eval.  I had read that
        gnudoit was deprecated in favor of gnuclient anyway.
 
 2006-02-04  Eric Ding  <ericding@alum.mit.edu>
 2006-02-03  Bill Wohler  <wohler@newt.com>
 
        * mh-utils.el (mh-image-load-path, mh-image-load-path-called-flag)
-       (mh-image-load-path): Checkdoc fix. Docstring edits. Reduce scope
+       (mh-image-load-path): Checkdoc fix.  Docstring edits.  Reduce scope
        of local variable mh-library-name.
 
        * mh-e.el (mh-folder-msg-number, mh-folder-refiled, mh-folder-to)
 2006-02-03  Peter S Galbraith  <psg@debian.org>
 
        * mh-utils.el (mh-image-load-path): New variable to optionally
-       hold the directory where MH-E images are stored.  If nil, then 
+       hold the directory where MH-E images are stored.  If nil, then
        the function `mh-image-load-path' will find it.  This variable
        will be used for Debian packaging.
        (mh-image-load-path function): Use variable `mh-image-load-path'
        (crm, multi-prompt): Use mh-require instead of require.
        (mh-goto-address-find-address-at-point): Use
        mh-line-beginning-position and mh-line-end-position instead of
-       line-beginning-position and line-end-position. Use
+       line-beginning-position and line-end-position.  Use
        mh-match-string-no-properties instead of
        match-string-no-properties.
 
        (mh-require, mh-cancel-timer, mh-display-color-cells)
        (mh-line-beginning-position, mh-line-end-position)
        (mh-match-string-no-properties, mh-replace-regexp-in-string)
-       (mh-view-mode-enter): Move definition here from mh-xemacs.el and 
+       (mh-view-mode-enter): Move definition here from mh-xemacs.el and
        add mh- prefix since compatibility functions should have our
        package prefix (mh-) by Emacs convention and to avoid messing up
        checks for the same functions in other packages.
        * mh-funcs.el (mh-list-folders): Use mh-view-mode-enter instead of
        view-mode-enter.
 
-       * mh-gnus.el (gnus-util, mm-bodies, mm-decode, mm-view, mml): Use
-       mh-require instead of require.
+       * mh-gnus.el (gnus-util, mm-bodies, mm-decode, mm-view, mml):
+       Use mh-require instead of require.
 
        * mh-letter.el (mh-letter-header-end, mh-letter-mode)
        (mh-letter-next-header-field): Use mh-line-beginning-position and
        * mh-acros.el (mh-defun-compat, mh-defmacro-compat): Add name
        argument since compatibility functions should have our package
        prefix (mh-) by Emacs convention and to avoid messing up checks
-       for the same functions in other packages. Use explicit argument
+       for the same functions in other packages.  Use explicit argument
        instead of forming name by adding mh- prefix so that one can grep
        and find the definition.
 
        * mh-alias.el (mh-alias-local-users, mh-alias-reload)
-       (mh-alias-expand, mh-alias-minibuffer-confirm-address): Use
-       mh-assoc-string instead of assoc-string.
+       (mh-alias-expand, mh-alias-minibuffer-confirm-address):
+       Use mh-assoc-string instead of assoc-string.
 
        * mh-compat.el (assoc-string): Rename to mh-assoc-string.
-       (mh-mail-abbrev-make-syntax-table, mh-url-hexify-string): Move
-       here from mh-utils.el.
+       (mh-mail-abbrev-make-syntax-table, mh-url-hexify-string):
+       Move here from mh-utils.el.
        (mh-display-completion-list): Move here from mh-comp.el.
        (mh-face-foreground, mh-face-background): Move here from
        mh-xface.el.
        mh-url-hexify-string.
 
        * mh-letter.el (mh-complete-word): Fix bug in call to
-       mh-display-completion-list. Wrong argument was passed, so
+       mh-display-completion-list.  Wrong argument was passed, so
        completions wouldn't show highlighted prefix.
 
 2006-01-29  Bill Wohler  <wohler@newt.com>
 
        * mh-comp.el (sc-cite-original): Remove autoload of "sc" with old
        docstring. sc-cite-original is autoloaded via loaddefs.el for all
-       supported versions. In addition, the package name "sc" has been
+       supported versions.  In addition, the package name "sc" has been
        made obsolete by "supercite since at least Emacs 21.
 
        * mh-scan.el (mh-note-copied, mh-note-printed): Reorganization
        mh-letter.el.
 
        * mh-utils.el (mh-get-header-field)
-       (mh-letter-hide-all-skipped-fields) 
+       (mh-letter-hide-all-skipped-fields)
        (mh-letter-skipped-header-field-p, mh-hidden-header-keymap)
        (mh-letter-toggle-header-field-display)
        (mh-letter-skip-leading-whitespace-in-header-field)
        mh-letter.el so that you can read messages without having to load
        mh-comp.el and mh-letter.el.
 
-       * mh-comp.el (mh-insert-fields): Handle nil values. Rmail, at
+       * mh-comp.el (mh-insert-fields): Handle nil values.  Rmail, at
        least, will deliver them to us.
 
        * mh-e.el (mh-after-commands-processed-hook)
        * mh-folder.el (mh-folder-mode): Use add-to-list to modify
        minor-mode-alias.
 
-       * mh-letter.el (mh-letter-menu): Remove. Defvar no longer needed
+       * mh-letter.el (mh-letter-menu): Remove.  Defvar no longer needed
        to shush compiler.
        (mh-letter-mode): Remove Mail menu.
 
 2006-01-29  Bill Wohler  <wohler@newt.com>
 
        The Great Cleanup
-       Remove circular dependencies. mh-e.el now includes few require
-       statements and stands alone. Other files should need to require
+       Remove circular dependencies.  mh-e.el now includes few require
+       statements and stands alone.  Other files should need to require
        mh-e.el, which requires mh-loaddefs.el, plus variable-only files
        such as mh-scan.el.
        Remove unneeded require statements.
        Rearrange and provide consistent headings.
        Untabify.
 
-       * mh-acros.el: Update commentary to reflect current usage. Add
-       autoload cookies to all macros.
+       * mh-acros.el: Update commentary to reflect current usage.
+       Add autoload cookies to all macros.
        (mh-require-cl): Merge docstring and comment.
        (mh-do-in-xemacs): Fix typo in docstring.
        (assoc-string): Move to new file mh-compat.el.
        (with-mh-folder-updating, mh-in-show-buffer)
-       (mh-do-at-event-location, mh-seq-msgs): Move here from
-       mh-utils.el.
+       (mh-do-at-event-location, mh-seq-msgs): Move here from mh-utils.el.
        (mh-iterate-on-messages-in-region, mh-iterate-on-range): Move here
        from mh-seq.el.
 
        * mh-alias.el (mh-address-mail-regexp)
-       (mh-goto-address-find-address-at-point): Move here from
-       mh-utils.el.
+       (mh-goto-address-find-address-at-point): Move here from mh-utils.el.
        (mh-folder-line-matches-show-buffer-p): Move here from mh-e.el.
 
-       * mh-buffers.el: Update descriptive text.       
+       * mh-buffers.el: Update descriptive text.
 
        * mh-comp.el (mh-note-repl, mh-note-forw, mh-note-dist): Move to
        new file mh-scan.el.
        (mh-display-completion-list): Move here from mh-comp.el.
 
        * mh-customize.el: Move content into mh-e.el and remove.
-       
+
        * mh-e.el (mh-folder-mode-map, mh-folder-seq-tool-bar-map)
        (mh-folder-tool-bar-map, mh-inc-spool-map, mh-letter-mode-map)
        (mh-letter-tool-bar-map, mh-search-mode-map, mh-show-mode-map)
        deprecated file mh-customize.el.
 
        * mh-exec.el: Move content into mh-e.el and remove.
-       
-       * mh-folder.el: New file. Contains mh-folder-mode from mh-e.el
+
+       * mh-folder.el: New file. Contains mh-folder-mode from mh-e.el.
 
        * mh-funcs.el (mh-note-copied, mh-note-printed): Move to new file
        mh-scan.el.
        (mh-identity-add-menu): New function
        (mh-insert-identity): Add optional argument maybe-insert so that
        local variable mh-identity-local does not have to be visible.
-       (mh-identity-handler-default):
 
        * mh-inc.el (mh-inc-spool-map): Move declaration to mh-e.el (with
-       rest of keymaps). Update key binding for ? to call mh-help with
+       rest of keymaps).  Update key binding for ? to call mh-help with
        help messages in new argument.
        (mh-inc-spool-make-no-autoload): New alias for mh-inc-spool-make
        which can be called from mh-e.el.
        (mh-inc-spool-list-set): Simplify update of mh-inc-spool-map-help.
 
        * mh-init.el: Move content into mh-e.el and remove.
-       
+
        * mh-junk.el: Update requires, untabify, and add mh-autoload
        cookies.
 
-       * mh-letter.el: New file. Contains mh-letter-mode from mh-comp.el.
+       * mh-letter.el: New file.  Contains mh-letter-mode from mh-comp.el.
 
-       * mh-limit.el: New file. Contains display limit commands from
+       * mh-limit.el: New file.  Contains display limit commands from
        mh-mime.el.
 
        * mh-mime.el: Rearrange for consistency with other files.
 
        * mh-search.el: Rearrange for consistency with other files.
        (mh-search-mode-map): Drop C-c C-f {dr} bindings since these
-       fields which don't exist in the saved header. Replace C-c C-f f
+       fields which don't exist in the saved header.  Replace C-c C-f f
        with C-c C-f m per mail-mode consistency.
        (mh-search-mode): Use mh-set-help instead of setting
        mh-help-messages.
        (mh-thread-current-indentation-level, mh-thread-next-sibling)
        (mh-thread-previous-sibling, mh-thread-immediate-ancestor)
        (mh-thread-ancestor, mh-thread-find-children)
-       (mh-message-id-regexp, mh-thread-delete, mh-thread-refile): Move
-       to new file mh-thread.el.
+       (mh-message-id-regexp, mh-thread-delete, mh-thread-refile):
+       Move to new file mh-thread.el.
        (mh-subject-to-sequence, mh-subject-to-sequence-unthreaded)
        (mh-subject-to-sequence-threaded, mh-edit-pick-expr)
        (mh-pick-args-list, mh-narrow-to-subject, mh-narrow-to-from)
        (mh-make-seq, mh-seq-name, mh-find-seq, mh-seq-to-msgs)
        (mh-add-msgs-to-seq, mh-notate): Move here from mh-utils.el.
 
-       * mh-show.el: New file. Contains mh-show-mode from mh-utils.el.
+       * mh-show.el: New file.  Contains mh-show-mode from mh-utils.el.
 
        * mh-speed.el: Rearrange for consistency with other files.
 
-       * mh-thread.el: New file. Contains threading code from mh-seq.el.
+       * mh-thread.el: New file.  Contains threading code from mh-seq.el.
 
-       * mh-tool-bar.el: New file. Contains tool bar creation code from
+       * mh-tool-bar.el: New file.  Contains tool bar creation code from
        deprecated file mh-customize.el.
 
-       * mh-utils.el (recursive-load-depth-limit): Remove setting. No
-       longer needed.
+       * mh-utils.el (recursive-load-depth-limit): Remove setting.
+       No longer needed.
        (mh-scan-msg-number-regexp, mh-scan-msg-overflow-regexp)
        (mh-scan-msg-format-regexp, mh-scan-msg-format-string)
        (mh-scan-msg-search-regexp, mh-cmd-note, mh-note-seq)
        mh-init.el.
        (mh-help-messages): Now an alist of modes to an alist of messages.
        (mh-set-help): New function used to set mh-help-messages
-       (mh-help): Adjust for new format of mh-help-messages. Add
+       (mh-help): Adjust for new format of mh-help-messages.  Add
        help-messages argument.
        (mh-prefix-help): Refactor to use mh-help.
        (mh-coalesce-msg-list, mh-greaterp, mh-lessp): Move here from
        (mh-clear-sub-folders-cache): New function added to avoid exposing
        mh-sub-folders-cache variable.
 
-       * mh-xface.el: New file. Contains X-Face and Face header field
+       * mh-xface.el: New file.  Contains X-Face and Face header field
        display routines from mh-utils.el.
 
 2006-01-17  Bill Wohler  <wohler@newt.com>
 
        * mh-acros.el (require): Remove defadvice of require as defadvice
        is verboten within Emacs and our implementation was returning the
-       wrong value from require. Upcoming restructuring should make this
+       wrong value from require.  Upcoming restructuring should make this
        unnecessary.
        (mh-assoc-ignore-case): Replace with defsubst assoc-string.
 
-       * mh-alias.el (mh-alias-local-users, mh-alias-reload,
-       mh-alias-expand, mh-alias-minibuffer-confirm-address): Use it.
+       * mh-alias.el (mh-alias-local-users, mh-alias-reload)
+       (mh-alias-expand, mh-alias-minibuffer-confirm-address): Use it.
 
        * mh-identity.el (mh-identity-field-handler): Use it.
 
        * mh-utils.el (mh-pgp-support-flag): Move to mh-comp.el to reduce
        dependencies on mh-utils.el.
        (mh-profile-component, mh-profile-component-value): Move to
-       mh-init.el since that's the only place that uses them. (Other than
+       mh-init.el since that's the only place that uses them.  (Other than
        mh-alias.el; I'm thinking that mh-find-path can set variable from
        the Aliasfile component like it does the other components).
        (mh-index-max-cmdline-args, mh-xargs, mh-quote-for-shell)
        file mh-exec.el so that mh-init.el doesn't have to depend on
        mh-utils.el, breaking circular dependency.
 
-       * mh-alias.el: 
-       * mh-customize.el: 
-       * mh-e.el: 
-       * mh-funcs.el: 
-       * mh-gnus.el: 
-       * mh-identity.el: 
-       * mh-inc.el: 
-       * mh-junk.el: 
-       * mh-mime.el: 
-       * mh-print.el: 
-       * mh-search.el: 
-       * mh-seq.el: 
+       * mh-alias.el:
+       * mh-customize.el:
+       * mh-e.el:
+       * mh-funcs.el:
+       * mh-gnus.el:
+       * mh-identity.el:
+       * mh-inc.el:
+       * mh-junk.el:
+       * mh-mime.el:
+       * mh-print.el:
+       * mh-search.el:
+       * mh-seq.el:
        * mh-speed.el: Added debugging statements (commented out) around
-       requires to help find dependency loops. Will remove them when
+       requires to help find dependency loops.  Will remove them when
        issues are resolved.
 
 2006-01-14  Bill Wohler  <wohler@newt.com>
        * mh-e.el (mh-folder-font-lock-keywords): Rename mh-index-folder
        to mh-search-folder.
 
-       * mh-search.el (mh-indexer) Rename to mh-searcher. The commands
+       * mh-search.el (mh-indexer) Rename to mh-searcher.  The commands
        pick and grep are searchers too but aren't indexed.
        (mh-index-execute-search-function): Rename to mh-search-function.
        (mh-index-next-result-function): Rename to
        (mh-index-regexp-builder): Rename to mh-search-regexp-builder.
        (mh-search): Since redo-search-flag defaults to nil and is of
        lesser importance, make it an optional argument and place it after
-       the folder and search-regexp arguments. Sync docstring with
-       manual.
+       the folder and search-regexp arguments.  Sync docstring with manual.
        (mh-search-mode-map): Autoload so that keys are shown in help even
        before mh-search is loaded.
        (mh-search-mode): Sync docstring with manual.
-       (mh-index-do-search): Rename argument indexer to searcher. Sync
+       (mh-index-do-search): Rename argument indexer to searcher.  Sync
        docstring with manual.
        (mh-pick-do-search): Sync docstring with manual.
        (mh-index-p): Rename to mh-search-p.
        (mh-indexer-choices): Rename to mh-search-choices.
-       (mh-index-choose): Rename to mh-search-choose. Rename argument
+       (mh-index-choose): Rename to mh-search-choose.  Rename argument
        indexer to searcher.
        (mh-swish++-execute-search, mh-swish-execute-search)
        (mh-mairix-execute-search, mh-namazu-execute-search): Drop "and
        given and recurse folder(s).
        (mh-pick-next-result): Handle new output.
 
-       * mh-utils.el: (mh-collect-folder-names): Fix docstring.
-       (mh-children-p, mh-folder-list): New functions. 
+       * mh-utils.el (mh-collect-folder-names): Fix docstring.
+       (mh-children-p, mh-folder-list): New functions.
 
 2006-01-12  Bill Wohler  <wohler@newt.com>
 
        * mh-search.el: New file containing contents of mh-index.el and
        mh-pick.el. C-c C-c launches your mh-index-program; C-c C-p runs
-       pick. Pick no longer sets the "search" sequence. Instead, it
-       brings up a folder view that we're accustomed to. (closes SF
-       #829207).
+       pick.  Pick no longer sets the "search" sequence.  Instead, it
+       brings up a folder view that we're accustomed to.  (Closes SF
+       #829207.)
        (mh-index-search): Rename to mh-search.
-       (mh-pick-menu): Rename menu from Pick to Search. Rename Execute
-       the Search to Perform Search and call mh-do-search. Add Search
+       (mh-pick-menu): Rename menu from Pick to Search.  Rename Execute
+       the Search to Perform Search and call mh-do-search.  Add Search
        with Pick menu item.
        (mh-do-search): Delete.
        (mh-search-mode): Rename from mh-pick-mode.
        * mh-customize.el (mh-index-program): Change mh-index-search to
        mh-search in docstring.
        (mh-tool-bar-search-function): Change default from
-       mh-search-folder to mh-search. Remove mh-search-folder as choice
-       and rename mh-index-search choice to mh-search. Fix docstring.
+       mh-search-folder to mh-search.  Remove mh-search-folder as choice
+       and rename mh-index-search choice to mh-search.  Fix docstring.
        (mh-pick-mode-hook): Rename to mh-search-mode-hook and change
        mh-search-folder to mh-search in docstring.
 
-       * mh-e.el (mh-folder-folder-menu): Delete Search a Folder. Change
-       Indexed Search to Search. Use mh-search instead of
-       mh-index-search.
-       (mh-folder-map): Delete i (mh-index-search) keybinding. Change s
+       * mh-e.el (mh-folder-folder-menu): Delete Search a Folder.  Change
+       Indexed Search to Search.  Use mh-search instead of mh-index-search.
+       (mh-folder-map): Delete i (mh-index-search) keybinding.  Change s
        from mh-show-search-folder to mh-search.
 
        * mh-seq.el (mh-put-msg-in-seq): Fix docstring now that
        * mh-utils.el (mh-show-search-folder): Delete.
        (mh-show-folder-map): Delete i (mh-index-search) keybinding.
        Change s from mh-show-search-folder to mh-search.
-       (mh-show-folder-menu): Delete Search a Folder. Change Indexed
-       Search to Search. Use mh-search instead of mh-index-search.
-       (mh-index-max-cmdline-args, mh-xargs, mh-quote-for-shell): Move
-       here from deleted mh-index.el.
+       (mh-show-folder-menu): Delete Search a Folder.  Change Indexed
+       Search to Search.  Use mh-search instead of mh-index-search.
+       (mh-index-max-cmdline-args, mh-xargs, mh-quote-for-shell):
+       Move here from deleted mh-index.el.
 
 2006-01-11  Bill Wohler  <wohler@newt.com>
 
        * mh-buffers.el: New file. Contains constants and code from
        mh-index.el and mh-utils.el.
 
-       * mh-alias.el: 
-       * mh-comp.el: 
-       * mh-e.el: 
-       * mh-funcs.el: 
+       * mh-alias.el:
+       * mh-comp.el:
+       * mh-e.el:
+       * mh-funcs.el:
        * mh-init.el:
-       * mh-junk.el: 
+       * mh-junk.el:
        * mh-mime.el:
        * mh-print.el:
        * mh-seq.el: Require new file mh-buffers.el.
        #1205890).
 
        * mh-mime.el (mh-compose-forward): Use standard range argument
-       instead of messages. Use more powerful mh-read-range instead of
-       read-string. Sync docstring with manual (close SF #1205890).
+       instead of messages.  Use more powerful mh-read-range instead of
+       read-string.  Sync docstring with manual (close SF #1205890).
 
        * mh-index.el (mh-index-search): Checking mh-find-path-run is
        unnecessary.
        since this skips the current folder heading if point is on the
        first message after the folder heading (closes SF #1126188).
 
-       * mh-init.el (mh-sys-path): Co-locate with mh-variants, which uses
-       it.
+       * mh-init.el (mh-sys-path): Co-locate with mh-variants, which uses it.
        (mh-variants): Note variable isn't meant to be accessed directly;
        use function mh-variants instead.
        (mh-variant-info, mh-variant-mh-info, mh-variant-mu-mh-info)
        (mh-file-command-p): Move here from mh-utils, since
        mh-variant-*-info are the only functions to use it.
        (mh-variant-set, mh-variant-set-variant, mh-variant-p): Use
-       function mh-variants instead of variable. More robust.
-       (mh-find-path-run): Move here from mh-utils.el. Mention that
+       function mh-variants instead of variable.  More robust.
+       (mh-find-path-run): Move here from mh-utils.el.  Mention that
        checking this variable is unnecessary.
-       (mh-find-path): Move here from mh-utils.el. With the advent of MH
+       (mh-find-path): Move here from mh-utils.el.  With the advent of MH
        variants and an mhparam command that doesn't work if there isn't
-       an MH profile, we can't get libdir for running install-mh. So
-       don't bother. If there's an issue with the environment, direct the
-       user to install MH and run install-mh (closes SF #835192). Don't
-       read ~/.mh_profile directly. Use mh-profile-component which uses
+       an MH profile, we can't get libdir for running install-mh.  So
+       don't bother.  If there's an issue with the environment, direct the
+       user to install MH and run install-mh (closes SF #835192).  Don't
+       read ~/.mh_profile directly.  Use mh-profile-component which uses
        mhparam (closes SF #1016027).
 
        * mh-utils.el (mh-get-profile-field): Rename to
-       mh-profile-component-value. Add colon to search removing
+       mh-profile-component-value.  Add colon to search removing
        unnecessary addition of colon to field in mh-profile-component.
        (mh-profile-component): Modify call to mh-profile-component-value
-       accordingly. Move next to mh-profile-component-value.
+       accordingly.  Move next to mh-profile-component-value.
        (mh-find-path-run, mh-find-path, mh-file-command-p): Move to
-       mh-init.el. It makes sense that code that is only run once per
+       mh-init.el.  It makes sense that code that is only run once per
        session (more or less) is in mh-init.el rather than cluttering
        mh-utils.el.
        (mh-no-install, mh-install): Delete.
 
-       * mh-customize.el (mh-folder-msg-number): 
+       * mh-customize.el (mh-folder-msg-number):
        * mh-mime.el (mh-file-mime-type): Removed trailing whitespace.
 
 2006-01-09  Bill Wohler  <wohler@newt.com>
        * mh-comp.el: Use ";; Shush compiler." comment consistently per
        Mark's suggestion.
        (mh-letter-mode): Derive from mail-mode and delete code copied
-       from mail-mode (closes SF #1385571). Mention mail-mode-hook in
+       from mail-mode (closes SF #1385571).  Mention mail-mode-hook in
        docstring.
-       (mh-fill-paragraph-function): Delete. Handled by mail-mode.
+       (mh-fill-paragraph-function): Delete.  Handled by mail-mode.
        (mh-to-field-choices): For consistency with mail-mode, add "a" for
        "Mail-Reply-To:", "l" for "Mail-Followup-To:", and "r" for
-       "Reply-To:". Change "r" to "m" for "From:" (closes SF #1400139).
+       "Reply-To:".  Change "r" to "m" for "From:" (closes SF #1400139).
        (mh-to-fcc): Move setting of folder argument to interactive
        argument as is the norm.
        (mh-letter-complete-function-alist): Add mail-reply-to.
        Comment declaration to remind programmer to update forward
        definition if default changes.
 
-       * mh-funcs.el: 
-       * mh-inc.el: 
-       * mh-init.el: 
-       * mh-mime.el: 
-       * mh-seq.el: 
+       * mh-funcs.el:
+       * mh-inc.el:
+       * mh-init.el:
+       * mh-mime.el:
+       * mh-seq.el:
        * mh-utils.el: Use ";; Shush compiler." comment consistently per
        Mark's suggestion.
 
 
        Removed code that was marked as Emacs 20 compatible that was
        easily found showing how important it is to document such
-       things (closes SF #1359240). Feel free to nuke any other Emacs 20
-       peculiarities that you find. Wrapped code for shushing compiler
+       things (closes SF #1359240).  Feel free to nuke any other Emacs 20
+       peculiarities that you find.  Wrapped code for shushing compiler
        with (eval-when-compile), sometimes moving the defvars closer to
        where they were used.
-       
+
        * mh-alias.el (mh-alias-gecos-name): Use replace-regexp-in-string
        instead of mh-replace-in-string as mh-replace-in-string was
        replaced by a more appropriate defsubst in mh-xemacs.el.
        eval-when-compile.
        (mh-thread-scan-line-map-stack, tool-bar-mode): Delete unused
        variables.
-       (mh-colors-available-p): Just call display-color-cells. It's on
+       (mh-colors-available-p): Just call display-color-cells.  It's on
        all supported Emacsen (and defaliased on XEmacs).
 
        * mh-funcs.el:
 
        * mh-mime.el: Wrap compiler-shushing defvars with
        eval-when-compile.
-       (mh-have-file-command): Initialize variable to 'undefined. Add
-       docstring. Update function of same name accordingly. Also don't
+       (mh-have-file-command): Initialize variable to 'undefined.  Add
+       docstring.  Update function of same name accordingly.  Also don't
        need to load executable any more.
        (mh-mime-content-types): Delete.
        (mh-minibuffer-read-type): Prompt user for type if
-       mh-file-mime-type returns application/octet-stream. Assume we have
+       mh-file-mime-type returns application/octet-stream.  Assume we have
        mailcap-mime-types.
        (mh-mime-display): Update error message.
 
        * mh-utils.el: Require cleanup, and wrap compiler-shushing defvars
        with eval-when-compile.
        (mh-clean-msg-header): Don't set after-change-functions to nil.
-       (mh-replace-in-string): Remove. Create defsubst in mh-xemacs.el
+       (mh-replace-in-string): Remove.  Create defsubst in mh-xemacs.el
        instead.
-       
+
 2006-01-07  Bill Wohler  <wohler@newt.com>
 
        * mh-customize.el: Updated Faces documentation in header.
 2006-01-03  Bill Wohler  <wohler@newt.com>
 
        * mh-alias.el (mh-alias-add-alias): Grand message and error string
-       unification. Use single sentence if possible by using semicolon.
-       Don't end message with punctuation. Don't need format with
-       message. Quote messages as in docstrings: use `' around symbols,
-       \" for option choices. Don't use quotes around %s.
-       
+       unification.  Use single sentence if possible by using semicolon.
+       Don't end message with punctuation.  Don't need format with
+       message.  Quote messages as in docstrings: use `' around symbols,
+       \" for option choices.  Don't use quotes around %s.
+
        * mh-comp.el (mh-complete-word): Ditto.
 
        * mh-customize.el (mh-adaptive-cmd-note-flag-check)
        them alphabetically.
        (mh-faces): Move below mh-hooks.
        (mh-folder-faces, mh-index-faces, mh-letter-faces)
-       (mh-show-faces, mh-speed-faces): Delete. Organize faces like
-       hooks.
+       (mh-show-faces, mh-speed-faces): Delete.  Organize faces like hooks.
        (mh-speed-update-interval): Fix group (mh-speedbar, not mh-speed).
        (facemenu-unlisted-faces): Might as well ignore all MH-E faces.
        (mh-folder-body-face, mh-folder-cur-msg-face)
        (mh-show-pgg-unknown-face, mh-show-pgg-bad-face)
        (mh-show-to-face, mh-show-from-face, mh-show-subject-face):
        Delete.
-       (mh-folder-cur-msg): Unused. Delete.
+       (mh-folder-cur-msg): Unused.  Delete.
        (mh-folder-address): Use defface; inherit from mh-folder-subject.
        (mh-folder-body, mh-folder-cur-msg-number, mh-folder-date):
        Inherit from mh-folder-msg-number.
-       (mh-folder-deleted): Use defface. Inherit from
+       (mh-folder-deleted): Use defface.  Inherit from
        mh-folder-msg-number.
-       (mh-folder-sent-to-me-hint): New face. Inherit from
+       (mh-folder-sent-to-me-hint): New face.  Inherit from
        mh-folder-date.
        (mh-folder-sent-to-me-sender): Rename from mh-folder-scan-format.
-       Use defface. Inherit from mh-folder-followup.
+       Use defface.  Inherit from mh-folder-followup.
        (mh-show-xface): Inherit from mh-show-from and highlight.
        (bw-face-generation, bw-toggle-faces)
        (bw-new-face-to-old, bw-old-face-to-new): New (tempoarary)
        variables, functions for toggling between old and new faces.
 
        * mh-e.el (font-lock-auto-fontify, font-lock-defaults): Hide in
-       eval-when-compile. We should probably do this throughout.
+       eval-when-compile.  We should probably do this throughout.
        (mh-scan-good-msg-regexp, mh-scan-deleted-msg-regexp)
        (mh-scan-refiled-msg-regexp, mh-scan-cur-msg-number-regexp)
        (mh-scan-date-regexp, mh-scan-rcpt-regexp, mh-scan-body-regexp)
        (mh-scan-subject-regexp): Sync docstrings with manual
        (mh-scan-format-regexp): Rename to
        mh-scan-sent-to-me-sender-regexp. Drop date parenthesized
-       expression. Make expression more like the others (anchored at the
-       beginning of line). Sync docstrings with manual.
+       expression.  Make expression more like the others (anchored at the
+       beginning of line).  Sync docstrings with manual.
        (mh-folder-font-lock-keywords): Use faces directly rather than
-       -face variables. Use mh-scan-sent-to-me-sender-regexp instead of
+       -face variables.  Use mh-scan-sent-to-me-sender-regexp instead of
        mh-scan-format-regexp, and within that expression, use faces
        mh-folder-sent-to-me-hint and mh-folder-sent-to-me-sender instead
        of mh-folder-date-face and mh-folder-scan-format-face which were
 
 2005-12-28  Bill Wohler  <wohler@newt.com>
 
-       * mh-comp.el (mh-e-user-agent): Move here from simple.el. Use
-       mh-user-agent-compose instead of mh-smail-batch.
+       * mh-comp.el (mh-e-user-agent): Move here from simple.el.
+       Use mh-user-agent-compose instead of mh-smail-batch.
 
 2005-12-27  Bill Wohler  <wohler@newt.com>
 
 
        * mh-e.el (mh-folders-changed): Fix typo in docstring.
 
-       Follow MH-E Developers Guide conventions. Use `' quotes for Help
-       hyperlinks such as symbols, Info nodes, or URLs. Use \" quotes for
-       everything else. Otherwise, you can accidently get links to
+       Follow MH-E Developers Guide conventions.  Use `' quotes for Help
+       hyperlinks such as symbols, Info nodes, or URLs.  Use \" quotes for
+       everything else.  Otherwise, you can accidently get links to
        nonsense symbols.
 
 2005-12-22  Bill Wohler  <wohler@newt.com>
 
-       Follow Emacs coding conventions. Use default setting of
+       Follow Emacs coding conventions.  Use default setting of
        emacs-lisp-docstring-fill-column which is 65.
 
        * mh-alias.el (mh-alias-reload): Sync docstrings with manual.
        with manual.
        (mh-yank-cur-msg): Mention that mh-ins-buf-prefix isn't used if
        you have added a mail-citation-hook and neither are used if you
-       use one of the supercite flavors of mh-yank-behavior. Sync
+       use one of the supercite flavors of mh-yank-behavior.  Sync
        docstrings with manual.
 
        * mh-customize.el (mh-kill-folder-suppress-prompt-hooks): Rename
        from mh-kill-folder-suppress-prompt-hook since it is an abnormal
-       hook. Use "Hook run by `function'..." instead of "Invoked...".
+       hook.  Use "Hook run by `function'..." instead of "Invoked...".
        Sync docstrings with manual.
        (mh-ins-buf-prefix, mh-yank-behavior): Mention that
        mh-ins-buf-prefix isn't used if you have added a
        mail-citation-hook and neither are used if you use one of the
-       supercite flavors of mh-yank-behavior. Sync docstrings with
-       manual.
-       (mail-citation-hook): Delete. Use one in sendmail.el.
+       supercite flavors of mh-yank-behavior.  Sync docstrings with manual.
+       (mail-citation-hook): Delete.  Use one in sendmail.el.
        (mh-signature-file-name, mh-after-commands-processed-hook)
        (mh-alias-reloaded-hook, mh-before-commands-processed-hook)
        (mh-before-quit-hook, mh-before-send-letter-hook)
        (mh-mh-to-mime-hook, mh-pick-mode-hook, mh-quit-hook)
        (mh-refile-msg-hook, mh-show-hook, mh-show-mode-hook)
        (mh-unseen-updated-hook): Use "Hook run by `function'..." instead
-       of "Invoked...". Sync docstrings with manual.
+       of "Invoked...".  Sync docstrings with manual.
 
        * mh-e.el (mh-last-destination, mh-last-destination-folder)
        (mh-last-destination-write, mh-folder-mode-map, mh-arrow-marker)
 
 2005-12-19  Stephen Gildea  <gildea@stop.mail-abuse.org>
 
-       * mh-customize.el (mh-after-commands-processed-hook): New
-       variable.
-       (mh-before-commands-processed-hook): Rename
-       mh-folder-updated-hook.
+       * mh-customize.el (mh-after-commands-processed-hook): New variable.
+       (mh-before-commands-processed-hook): Rename mh-folder-updated-hook.
 
        * mh-e.el (mh-process-commands): Rename mh-folder-updated-hook to
        mh-before-commands-processed-hook, call new
        * mh-seq.el:
        * mh-speed.el:
        * mh-utils.el:
-       Follow commenting conventions. Don't use ;;; form so much, except
-       for headings. Precede headings with page feed. This was mostly
-       already done, so I made it a convention. Did not update copyright
+       Follow commenting conventions.  Don't use ;;; form so much, except
+       for headings.  Precede headings with page feed.  This was mostly
+       already done, so I made it a convention.  Did not update copyright
        on a couple of files since this was an insignificant change.
 
 2005-12-18  Bill Wohler  <wohler@newt.com>
 
        * mh-customize.el (mh-toolbar): Rename to mh-tool-bar.
        (mh-tool-bar-search-function): Sync docstrings with manual.
-       (mh-tool-bar-customize): Replace toolbar with tool bar in
-       docstring.
+       (mh-tool-bar-customize): Replace toolbar with tool bar in docstring.
        (mh-tool-bar-letter-help): Fix manual reference.
        (mh-xemacs-use-toolbar-flag): Rename to
-       mh-xemacs-use-tool-bar-flag. Initialize to
-       mh-xemacs-has-tool-bar-flag. Sync docstrings with manual.
+       mh-xemacs-use-tool-bar-flag.  Initialize to
+       mh-xemacs-has-tool-bar-flag.  Sync docstrings with manual.
        (mh-xemacs-toolbar-position): Rename to
-       mh-xemacs-tool-bar-position. Initialize to nil. Drop "no tool bar"
+       mh-xemacs-tool-bar-position.  Initialize to nil.  Drop "no tool bar"
        option (redundant) and change "Same As Default Tool Bar" setting
-       to nil. Sync docstrings with manual.
+       to nil.  Sync docstrings with manual.
        (mh-tool-bar-define): Replace toolbar with tool-bar or tool bar
        depending on context.
-       (mh-toolbar-init): Rename to mh-tool-bar-init. Simplify condition
+       (mh-toolbar-init): Rename to mh-tool-bar-init.  Simplify condition
        for calling set-specifier. Only look at the value of
        mh-xemacs-use-tool-bar-flag.
-       (mh-tool-bar-folder-buttons, mh-tool-bar-letter-buttons): Sync
-       docstrings with manual.
+       (mh-tool-bar-folder-buttons, mh-tool-bar-letter-buttons):
+       Sync docstrings with manual.
 
        * mh-comp.el (mh-letter-mode): Use mh-tool-bar-init instead of
        mh-toolbar-init.
 
        * mh-customize.el (mh-speed-flists-interval): Rename to
        mh-speed-update-interval.
-       (mh-speed-run-flists-flag): Delete. Setting
+       (mh-speed-run-flists-flag): Delete.  Setting
        mh-speed-flists-interval to 0 accomplishes the same thing.
 
        * mh-speed.el (mh-folder-speedbar-buttons, mh-speed-flists): Use
        * mh-comp.el (mh-insert-signature): Ditto.
 
        * mh-customize.el (mh-fetch-x-image-url): Change default from 'ask
-       to nil. Remove t option. Sync docstring with manual (closes SF
+       to nil.  Remove t option.  Sync docstring with manual (closes SF
        #831278).
        (mh-invisible-header-fields-internal): Remove X-Image-URL so that
        users can see it, look it up in the manual's index, and discover
        (mh-index-new-messages): Ditto.
 
        * mh-comp.el (mh-forward): Went over all uses of the word "RANGE"
-       in the docstrings and made usage consistent. Generally speaking,
+       in the docstrings and made usage consistent.  Generally speaking,
        "messages in range" and "range of messages" is redundant and just
-       "range" can be used in most circumstances. Also ensured that
+       "range" can be used in most circumstances.  Also ensured that
        mh-interactive-range was mentioned in all interactive functions
        that use a range which describes the range argument for both users
        and programmers.
        I think, so use "truncated".
 
        * mh-customize.el (mh-folder, mh-folder-faces): Group's manual
-       section is Folders, not Organizing. Parent of mh-folder-faces is
+       section is Folders, not Organizing.  Parent of mh-folder-faces is
        mh-folder, not mh-show.
        (mh-speed): Rename to mh-speedbar for consistency with mh-toolbar.
-       (mh-thread): New group that corresponds with manual's Threading
-       chapter.
+       (mh-thread): New group that corresponds with manual's Threading chapter.
        (mh-letter-faces): Group's manual section is Editing Drafts, not
        Sending Mail.
-       (mh-sortm-args): New customization variable that used to be a
-       defvar.
+       (mh-sortm-args): New customization variable that used to be a defvar.
        (mh-index-new-messages-folders, mh-index-ticked-messages-folders):
        Move from mh-index group to mh-folders group.
        (mh-alias-local-users-prefix, mh-large-folder)
        (mh-quit-hook, mh-refile-msg-hook): Move from mh-show group to
        mh-folder group.
        (mh-highlight-citation-style): Rename from
-       mh-highlight-citation-p. Sync docstrings with manual.
-       (mh-mhl-format-file): Rename from mhl-formfile. Sync docstrings
+       mh-highlight-citation-p.  Sync docstrings with manual.
+       (mh-mhl-format-file): Rename from mhl-formfile.  Sync docstrings
        with manual.
        (mh-show-threads-flag): Move from mh-show group to mh-thread
        group.
        (mh-summary-height, mh-delete-msg-hook
        (mh-show-hook, mh-show-mode-hook): Sync docstrings with manual.
 
-       * mh-e.el
-       (mh-scan-format-mh, mh-scan-good-msg-regexp)
+       * mh-e.el (mh-scan-format-mh, mh-scan-good-msg-regexp)
        (mh-scan-deleted-msg-regexp, mh-scan-refiled-msg-regexp)
-       (mh-scan-cur-msg-number-regexp, mh-scan-subject-regexp): Use
-       non-fontification instead of non-fontifying.
+       (mh-scan-cur-msg-number-regexp, mh-scan-subject-regexp):
+       Use non-fontification instead of non-fontifying.
        (mh-header-display): Use mh-mhl-format-file instead of
-       mhl-formfile. Sync docstrings with manual.
+       mhl-formfile.  Sync docstrings with manual.
        (mh-next-undeleted-msg, mh-previous-undeleted-msg): Rename arg to
-       count. Sync docstrings with manual.
+       count.  Sync docstrings with manual.
        (mh-refile-or-write-again): Use output from mh-write-msg-to-file
-       so that message doesn't change when using this command. Sync
+       so that message doesn't change when using this command.  Sync
        docstrings with manual.
-       (mh-page-msg, mh-previous-page): Rename arg to lines. Sync
+       (mh-page-msg, mh-previous-page): Rename arg to lines.  Sync
        docstrings with manual.
-       (mh-write-msg-to-file): Rename msg to message. Rename no-headers
-       to no-header. Sync docstrings with manual.
+       (mh-write-msg-to-file): Rename msg to message.  Rename no-headers
+       to no-header.  Sync docstrings with manual.
        (mh-ps-print-map): Delete keybindings for deleted commands
        mh-ps-print-toggle-mime and mh-ps-print-msg-show.
        (mh-help-messages): Update printing help.
 
        * mh-funcs.el (mh-sortm-args): Now a customization option and in
        mh-customize.el.
-       (mh-pipe-msg): Rename include-headers to include-header. Sync
-       docstrings with manual.
+       (mh-pipe-msg): Rename include-headers to include-header.
+       Sync docstrings with manual.
        (mh-burst-digest, mh-page-digest, mh-page-digest-backwards)
        (mh-store-msg): Sync docstrings with manual.
 
-       * mh-mime.el (mh-mime-save-parts): Rename arg to prompt. Sync
-       docstrings with manual.
+       * mh-mime.el (mh-mime-save-parts): Rename arg to prompt.
+       Sync docstrings with manual.
        (mh-toggle-mh-decode-mime-flag): Use English in message, not Lisp.
        Sync docstrings with manual.
        (mh-mm-display-part, mh-mm-inline-message): Use
        mh-highlight-citation-style instead of mh-highlight-citation-p.
        (mh-press-button): Sync docstrings with manual.
        (mh-display-with-external-viewer): Fix default output in
-       minibuffer. Sync docstrings with manual.
+       minibuffer.  Sync docstrings with manual.
 
-       * mh-print.el: (mh-ps-print-mime, mh-ps-print-toggle-mime):
+       * mh-print.el (mh-ps-print-mime, mh-ps-print-toggle-mime):
        Delete.
        (mh-ps-print-color-option): Incorporate docstring from
        ps-print-color-p.
-       (mh-ps-spool-buffer): Remove unused code. Fix indent. Slimline
-       docstring.
-       (mh-ps-spool-msg): Slimline docstring. Rename from
-       mh-ps-spool-a-msg. Rewrite to use existing show buffer when
+       (mh-ps-spool-buffer): Remove unused code.  Fix indent.
+       Slimline docstring.
+       (mh-ps-spool-msg): Slimline docstring.  Rename from
+       mh-ps-spool-a-msg.  Rewrite to use existing show buffer when
        available.
        (mh-ps-print-range): Extract method from common code in
        mh-ps-print-msg and mh-ps-print-msg-file.
-       (mh-ps-print-preprint): Clean docstring. Use filename "mh-%s".
-       (mh-ps-print-msg-show): Delete. Can use either
+       (mh-ps-print-preprint): Clean docstring.  Use filename "mh-%s".
+       (mh-ps-print-msg-show): Delete.  Can use either
        mh-ps-print-msg-show or mh-ps-print-msg-show to same effect with
        new code in mh-ps-spool-msg.
        (mh-print-msg): Use mh-mhl-format-file instead of mhl-formfile.
        Sync docstrings with manual.
        (mh-ps-print-msg, mh-ps-print-msg-file)
-       (mh-ps-print-toggle-faces, mh-ps-print-toggle-color): Sync
-       docstrings with manual.
-       
+       (mh-ps-print-toggle-faces, mh-ps-print-toggle-color):
+       Sync docstrings with manual.
+
        * mh-utils.el (mh-show-ps-print-msg-show)
-       mh-show-ps-print-toggle-mime): Delete.
+       (mh-show-ps-print-toggle-mime): Delete.
        (mh-show-ps-print-map): Update accordingly.
        (mh-show-mode): Use mh-highlight-citation-style instead of
        mh-highlight-citation-p.
        (mh-show-xface, mh-display-msg): Use mh-mhl-format-file instead of
        mhl-formfile.
-       (mh-show): Use mh-mhl-format-file instead of mhl-formfile. Sync
-       docstrings with manual.
-       (mh-show-font-lock-fontify-region, mh-modify, mh-goto-msg): Sync
-       docstrings with manual.
+       (mh-show): Use mh-mhl-format-file instead of mhl-formfile.
+       Sync docstrings with manual.
+       (mh-show-font-lock-fontify-region, mh-modify, mh-goto-msg):
+       Sync docstrings with manual.
 
 2005-12-01  Bill Wohler  <wohler@newt.com>
 
        (mh-min-colors-defined-flag, mh-defface-compat): Move here from
        mh-customize.el.
 
-       * mh-customize.el: Refactor faces. Move grayscale requirements
-       last before t. Use uniform line breaks.
+       * mh-customize.el: Refactor faces.  Move grayscale requirements
+       last before t.  Use uniform line breaks.
        (mh-min-colors-defined-flag): New variable.
-       (mh-defface-compat): New function. Provides backward compatibility
+       (mh-defface-compat): New function.  Provides backward compatibility
        for face specs.
        (mh-show-header, mh-show-date, mh-show-cc, mh-folder-to)
        (mh-folder-refiled, mh-folder-cur-msg-number, mh-folder-cur-msg)
 2005-11-03  Bill Wohler  <wohler@newt.com>
 
        * mh-customize.el (mh-refile-preserves-sequences-flag)
-       (mh-tick-seq, mh-update-sequences-after-mh-show-flag): Sync
-       docstrings with manual.
+       (mh-tick-seq, mh-update-sequences-after-mh-show-flag):
+       Sync docstrings with manual.
 
        * mh-e.el (mh-update-sequences): Sync docstrings with manual.
 
 2005-10-30  Bill Wohler  <wohler@newt.com>
 
        * mh-e.el (mh-scan-good-msg-regexp, mh-scan-deleted-msg-regexp)
-       (mh-scan-refiled-msg-regexp, mh-scan-cur-msg-number-regexp): Sync
-       docstrings with manual.
+       (mh-scan-refiled-msg-regexp, mh-scan-cur-msg-number-regexp):
+       Sync docstrings with manual.
 
        * mh-customize.el (mh-compose-space-does-completion-flag)
        (mh-signature-separator-flag, mh-interpret-number-as-range-flag)
        (mh-adaptive-cmd-note-flag): Use "Non-nil means" instead of "On
-       means" to remain checkdoc clean and consistent with Emacs. I
+       means" to remain checkdoc clean and consistent with Emacs.  I
        raised this issue with the Emacs developers and Stallman agrees
        that "On means" should be allowed in custom docstrings but that
        this change requires thought and should wait until after the Emacs
        (mh-adaptive-cmd-note-flag, mh-scan-format-file): Docstring fixes,
        add :set.
 
-       * mh-e.el: (mh-scan-field-destination-offset): New variable. The
+       * mh-e.el (mh-scan-field-destination-offset): New variable.  The
        destination is the -, t, b, c, or n character for Replied, To, cc,
        Bcc, or Newsgroups respectively.
-       (mh-make-folder, mh-regenerate-headers, mh-generate-new-cmd-note)
+       (mh-make-folder, mh-regenerate-headers, mh-generate-new-cmd-note):
        Call new function mh-msg-num-width-to-column to make leap between
        width and column more explicit.
        (mh-msg-num-width-to-column): New function that steals logic from
-       old mh-set-cmd-note. Also, throw error if mh-scan-format-file
+       old mh-set-cmd-note.  Also, throw error if mh-scan-format-file
        isn't t since we can't adapt the scan lines in this case.
        (mh-set-cmd-note): Now just simply sets mh-cmd-note which will
        make the documentation more clear.
        (mh-generate-new-cmd-note): Docstring fix--mh-cmd-note is a
        column, not a width.
        (mh-add-sequence-notation, mh-remove-sequence-notation): Use new
-       variable mh-scan-field-destination-offset rather than hard-coding
-       1.
+       variable mh-scan-field-destination-offset rather than hard-coding 1.
 
        * mh-utils.el (mh-cmd-note) Synced docstring with manual.
        (mh-notate): Use new variable mh-scan-field-destination-offset
 
        * mh-customize.el (mh-x-face-file, mh-show-use-xface-flag)
        (mail-citation-hook): Quote URLs in docstrings and precede with
-       `URL'. The former will suppress checkdoc warnings, the latter will
+       `URL'.  The former will suppress checkdoc warnings, the latter will
        turn them into hyperlinks in Emacs 22 (I just added the code to do
        that today).
        (mh-scan-format-file): Checkdoc fix.
 
        * mh-utils.el (mh-goto-msg): Use mh-scan-msg-search-regexp instead
        of hard-coded string.
-       (mh-mail-header-separator, mh-signature-separator-regexp): Use
-       "regular expression" in docstring instead of regexp.
+       (mh-mail-header-separator, mh-signature-separator-regexp):
+       Use "regular expression" in docstring instead of regexp.
        (mh-scan-msg-number-regexp)
        (mh-scan-msg-overflow-regexp, mh-scan-msg-format-regexp)
        (mh-scan-msg-format-string, mh-scan-msg-search-regexp)
 
 2005-10-23  Bill Wohler  <wohler@newt.com>
 
-       * mh-customize.el (mh-interpret-number-as-range-flag): Sync
-       docstring with manual.
+       * mh-customize.el (mh-interpret-number-as-range-flag):
+       Sync docstring with manual.
 
        * mh-identity.el (mh-assoc-ignore-case): Merge with version in
        mh-alias.el and move to mh-acros.el
 
        * mh-customize.el (mh-buffer-exists-p): New function which tests
        presence of buffers of a given mode.
-       (mh-tool-bar-define): New functions
-       mh-tool-bar-folder-buttons-init and
-       mh-tool-bar-letter-buttons-init are defined. These functions are
+       (mh-tool-bar-define): New functions mh-tool-bar-folder-buttons-init and
+       mh-tool-bar-letter-buttons-init are defined.  These functions are
        used to create the tool-bar from the corresponding customizable
        variables.
 
 
        * mh-comp.el (mh-letter-menu): Rename
        mh-mhn-compose-external-compressed-tar to
-       mh-mh-compose-external-compressed-tar. Rename
-       mh-mhn-compose-anon-ftp to mh-mh-compose-anon-ftp. Rename
+       mh-mh-compose-external-compressed-tar.  Rename
+       mh-mhn-compose-anon-ftp to mh-mh-compose-anon-ftp.  Rename
        mh-edit-mhn to mh-mh-to-mime. Rename mh-mhn-directive-present-p to
        mh-mh-directive-present-p. Rename mh-revert-mhn-edit to
-       mh-mh-to-mime-undo. Rename mh-gnus-pgp-support-flag to
-       mh-pgp-support-flag. Rename mh-compose-insertion value from 'mhn
+       mh-mh-to-mime-undo.  Rename mh-gnus-pgp-support-flag to
+       mh-pgp-support-flag.  Rename mh-compose-insertion value from 'mhn
        to 'mh.
        (mh-insert-signature): Rename mh-mhn-directive-present-p to
        mh-mh-directive-present-p.
        (mh-send-letter): Rename mh-mhn-directive-present-p to
        mh-mh-directive-present-p. Rename mh-edit-mhn to mh-mh-to-mime.
-       (mh-letter-mode-map): Rename mh-edit-mhn to mh-mh-to-mime. Rename
-       mh-mhn-compose-anon-ftp to mh-mh-compose-anon-ftp. Rename
+       (mh-letter-mode-map): Rename mh-edit-mhn to mh-mh-to-mime.  Rename
+       mh-mhn-compose-anon-ftp to mh-mh-compose-anon-ftp.  Rename
        mh-mhn-compose-external-compressed-tar to
-       mh-mh-compose-external-compressed-tar. Rename mh-revert-mhn-edit
-       to mh-mh-to-mime-undo. Rename mh-mhn-compose-external-type to
-       mh-mh-compose-external-type. Rename mh-mhn-compose-anon-ftp to
-       mh-mh-compose-anon-ftp. Rename
+       mh-mh-compose-external-compressed-tar.  Rename mh-revert-mhn-edit
+       to mh-mh-to-mime-undo.  Rename mh-mhn-compose-external-type to
+       mh-mh-compose-external-type.  Rename mh-mhn-compose-anon-ftp to
+       mh-mh-compose-anon-ftp.  Rename
        mh-mhn-compose-external-compressed-tar to
-       mh-mh-compose-external-compressed-tar. Rename mh-revert-mhn-edit
-       to mh-mh-to-mime-undo. Rename mh-mhn-compose-external-type to
+       mh-mh-compose-external-compressed-tar.  Rename mh-revert-mhn-edit
+       to mh-mh-to-mime-undo.  Rename mh-mhn-compose-external-type to
        mh-mh-compose-external-type.
        (mh-send-letter, mh-letter-mode-map): Rename mh-edit-mhn to
        mh-mh-to-mime, mh-revert-mhn-edit to mh-mh-to-mime-undo.
        (mh-mhn-compose-forw): Rename to mh-mh-forward-message.
        (mh-mhn-compose-type): Rename to mh-mh-compose-type.
        (mh-mhn-compose-anon-ftp): Rename to mh-mh-compose-anon-ftp.
-       Rename mh-mhn-compose-external-type to
-       mh-mh-compose-external-type.
+       Rename mh-mhn-compose-external-type to mh-mh-compose-external-type.
        (mh-mhn-compose-external-compressed-tar): Rename to
-       mh-mh-compose-external-compressed-tar. Rename
+       mh-mh-compose-external-compressed-tar.  Rename
        mh-mhn-compose-external-type to mh-mh-compose-external-type.
-       (mh-mhn-compose-external-type): Rename to
-       mh-mh-compose-external-type.
-       (mh-edit-mhn): Rename to mh-mh-to-mime. Rename mh-mhn-args to
-       mh-mh-to-mime-args. Rename mh-edit-mhn-hook to mh-mh-to-mime-hook.
+       (mh-mhn-compose-external-type): Rename to mh-mh-compose-external-type.
+       (mh-edit-mhn): Rename to mh-mh-to-mime.  Rename mh-mhn-args to
+       mh-mh-to-mime-args.  Rename mh-edit-mhn-hook to mh-mh-to-mime-hook.
        Use correct program in message.
        (mh-mhn-directive-present-p): Rename to mh-mh-directive-present-p.
        (mh-mml-directive-present-p): Rename to mh-mml-tag-present-p.
 
 2005-10-17  Peter S Galbraith  <psg@debian.org>
 
-       * mh-identity.el (mh-identity-field-handler): Use
-       `assoc-ignore-case' to compare against header field for mixed-case
-       "From:".
+       * mh-identity.el (mh-identity-field-handler): Use `assoc-ignore-case'
+       to compare against header field for mixed-case "From:".
 
 2005-10-17  Bill Wohler  <wohler@newt.com>
 
        (mh-complete-word): Use it.
 
        * mh-init.el (mh-image-load-path): Use locate-library to find
-       MH-E. This simplified the code a lot. Flattened out nested
+       MH-E.  This simplified the code a lot.  Flattened out nested
        statements even more.
 
 2005-10-16  Satyaki Das  <satyaki@theforce.stanford.edu>
 
        * mh-init.el (mh-image-load-path-called-flag): New variable which
        is used by mh-image-load-path so that it runs only once.
-       (mh-image-load-path): Modify so that it gets run only once. Also
+       (mh-image-load-path): Modify so that it gets run only once.  Also
        flatten out heavily nested if statements to make it clearer.
 
        * mh-e.el (mh-folder-mode): Call mh-image-load-path to allow Emacs
 
 2005-10-14  Bill Wohler  <wohler@newt.com>
 
-       * mh-e.el, mh-funcs.el, mh-init.el, mh-mime.el, mh-pick.el: *
-       mh-seq.el, mh-utils.el: Ran mh-unit. Continued copyright lines
+       * mh-e.el, mh-funcs.el, mh-init.el, mh-mime.el, mh-pick.el:
+       * mh-seq.el, mh-utils.el: Ran mh-unit.  Continued copyright lines
        need to be indented.
 
        * mh-e.el: mh-folder-tick-face had been renamed to mh-folder-tick
-       but the code that invoked the face had not been updated. Tick
+       but the code that invoked the face had not been updated.  Tick
        highlighting working again.
 
        * mh-seq.el (mh-non-seq-mode-line-annotation): Move
 
        * ChangeLog: Move contents into ChangeLog.1 and trim.
 
-       * ChangeLog.1: New file. Contains old ChangeLog.
+       * ChangeLog.1: New file.  Contains old ChangeLog.
 
 
   Copyright (C) 2005 Free Software Foundation, Inc.
 
 ;; Local Variables:
 ;; sentence-end-double-space: nil
+;; add-log-time-zone-rule: t
 ;; End:
 
 ;;; arch-tag: 87324964-69b6-4925-a3c2-9c1df53d7d51
index ba48a84..172de5c 100644 (file)
@@ -6,7 +6,7 @@
 
 ;; Author: Bill Wohler <wohler@newt.com>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
-;; Version: 8.0.2
+;; Version: 8.0.3
 ;; Keywords: mail
 
 ;; This file is part of GNU Emacs.
 ;; Try to keep variables local to a single file. Provide accessors if
 ;; variables are shared. Use this section as a last resort.
 
-(defconst mh-version "8.0.2" "Version number of MH-E.")
+(defconst mh-version "8.0.3" "Version number of MH-E.")
 
 ;; Variants
 
@@ -188,7 +188,7 @@ This directory contains, among other things, the mhl program.")
 (defvar mh-draft-folder nil
   "Cached value of the \"Draft-Folder:\" MH profile component.
 Name of folder containing draft messages.
-Nil means do not use a draft folder.")
+Do not use a draft folder if nil.")
 
 (defvar mh-inbox nil
   "Cached value of the \"Inbox:\" MH profile component.
@@ -1218,7 +1218,7 @@ or \"Bottom\" of your alias file might be more appropriate."
   :package-version '(MH-E . "7.1"))
 
 (defcustom-mh mh-alias-local-users t
-  "*If on, local users are added to alias completion.
+  "*Non-nil means local users are added to alias completion.
 
 Aliases are created from \"/etc/passwd\" entries with a user ID
 larger than a magical number, typically 200. This can be a handy
@@ -1690,7 +1690,13 @@ The function is always called with SYMBOL bound to
 By default, the programs are run in the foreground, but this can
 be slow when junking large numbers of messages. If you have
 enough memory or don't junk that many messages at the same time,
-you might try turning on this option."
+you might try turning on this option.
+
+Note that this option is used as the \"display\" argument in the
+call to `call-process'. Therefore, turning on this option means
+setting its value to \"0\". You can also set its value to t to
+direct the programs' output to the \"*MH-E Log*\" buffer; this
+may be useful for debugging."
   :type '(choice (const :tag "Off" nil)
                  (const :tag "On" 0))
   :group 'mh-junk
index 67f267d..f2cb96c 100644 (file)
@@ -115,9 +115,7 @@ http://spamassassin.org/.
 To use SpamAssassin, add the following recipes to
 \".procmailrc\":
 
-    # Append to $PATH the location of mhparam in some distros.
     PATH=$PATH:/usr/bin/mh
-
     MAILDIR=$HOME/`mhparam Path`
 
     # Fight spam with SpamAssassin.
@@ -195,30 +193,33 @@ done by adding the following to your crontab:
   (let ((current-folder mh-current-folder)
         (msg-file (mh-msg-filename msg mh-current-folder))
         (sender))
-    (save-excursion
-      (message "Reporting message %d..." msg)
-      (mh-truncate-log-buffer)
-      (call-process mh-spamassassin-executable msg-file mh-log-buffer nil
+    (message "Reporting message %d..." msg)
+    (mh-truncate-log-buffer)
+    ;; Put call-process output in log buffer if we are saving it
+    ;; (this happens if mh-junk-background is t).
+    (with-current-buffer mh-log-buffer
+      (call-process mh-spamassassin-executable msg-file mh-junk-background nil
                     ;;"--report" "--remove-from-whitelist"
                     "-r" "-R")          ; spamassassin V2.20
-      (when mh-sa-learn-executable
-          (message "Recategorizing this message as spam...")
-          (call-process mh-sa-learn-executable msg-file mh-log-buffer nil
-                        "--single" "--spam" "--local" "--no-rebuild"))
-      (message "Blacklisting message %d..." msg)
-      (set-buffer (get-buffer-create mh-temp-buffer))
+    (when mh-sa-learn-executable
+      (message "Recategorizing message %d as spam..." msg)
+      (mh-truncate-log-buffer)
+      (call-process mh-sa-learn-executable msg-file mh-junk-background nil
+                    "--single" "--spam" "--local" "--no-rebuild")))
+    (message "Blacklisting sender of message %d..." msg)
+    (with-current-buffer (get-buffer-create mh-temp-buffer)
       (erase-buffer)
       (call-process (expand-file-name mh-scan-prog mh-progs)
-                    nil mh-junk-background nil
-                    (format "%s" msg) current-folder
+                    nil t nil
+                    (format "%d" msg) current-folder
                     "-format" "%<(mymbox{from})%|%(addr{from})%>")
       (goto-char (point-min))
       (if (search-forward-regexp "^\\(.+\\)$" nil t)
           (progn
             (setq sender (match-string 0))
             (mh-spamassassin-add-rule "blacklist_from" sender)
-            (message "Blacklisting message %d...done" msg))
-        (message "Blacklisting message %d...not done (from my address)" msg)))))
+            (message "Blacklisting sender of message %d...done" msg))
+        (message "Blacklisting sender of message %d...not done (from my address)" msg)))))
 
 ;;;###mh-autoload
 (defun mh-spamassassin-whitelist (msg)
@@ -234,28 +235,31 @@ See `mh-spamassassin-blacklist' for more information."
   (let ((msg-file (mh-msg-filename msg mh-current-folder))
         (show-buffer (get-buffer mh-show-buffer))
         from)
-    (save-excursion
-      (set-buffer (get-buffer-create mh-temp-buffer))
+    (with-current-buffer (get-buffer-create mh-temp-buffer)
       (erase-buffer)
-      (message "Removing spamassassin markup from message...")
-      (call-process mh-spamassassin-executable msg-file mh-temp-buffer nil
+      (message "Removing spamassassin markup from message %d..." msg)
+      (call-process mh-spamassassin-executable msg-file t nil
                     ;; "--remove-markup"
                     "-d")               ; spamassassin V2.20
       (if show-buffer
           (kill-buffer show-buffer))
       (write-file msg-file)
       (when mh-sa-learn-executable
-        (message "Recategorizing this message as ham...")
-        (call-process mh-sa-learn-executable msg-file mh-temp-buffer nil
-                      "--single" "--ham" "--local" "--no-rebuild"))
-      (message "Whitelisting message %d..." msg)
+        (message "Recategorizing message %d as ham..." msg)
+        (mh-truncate-log-buffer)
+        ;; Put call-process output in log buffer if we are saving it
+        ;; (this happens if mh-junk-background is t).
+        (with-current-buffer mh-log-buffer
+          (call-process mh-sa-learn-executable msg-file mh-junk-background nil
+                        "--single" "--ham" "--local" "--no-rebuild")))
+      (message "Whitelisting sender of message %d..." msg)
       (setq from
             (car (mh-funcall-if-exists
                   ietf-drums-parse-address (mh-get-header-field "From:"))))
       (kill-buffer nil)
       (unless (or (null from) (equal from ""))
         (mh-spamassassin-add-rule "whitelist_from" from))
-      (message "Whitelisting message %d...done" msg))))
+      (message "Whitelisting sender of message %d...done" msg))))
 
 (defun mh-spamassassin-add-rule (rule body)
   "Add a new rule to \"~/.spamassassin/user_prefs\".
@@ -346,6 +350,7 @@ type of message to start doing a good job.
 
 To use bogofilter, add the following recipes to \".procmailrc\":
 
+    PATH=$PATH:/usr/bin/mh
     MAILDIR=$HOME/`mhparam Path`
 
     # Fight spam with bogofilter.
@@ -375,8 +380,12 @@ The \"Bogofilter tuning HOWTO\" describes how you can fine-tune Bogofilter."
   (unless mh-bogofilter-executable
     (error "Unable to find the bogofilter executable"))
   (let ((msg-file (mh-msg-filename msg mh-current-folder)))
-    (call-process mh-bogofilter-executable msg-file mh-junk-background
-                  nil "-s")))
+    (mh-truncate-log-buffer)
+    ;; Put call-process output in log buffer if we are saving it
+    ;; (this happens if mh-junk-background is t).
+    (with-current-buffer mh-log-buffer
+      (call-process mh-bogofilter-executable msg-file mh-junk-background
+                    nil "-s"))))
 
 ;;;###mh-autoload
 (defun mh-bogofilter-whitelist (msg)
@@ -386,8 +395,12 @@ See `mh-bogofilter-blacklist' for more information."
   (unless mh-bogofilter-executable
     (error "Unable to find the bogofilter executable"))
   (let ((msg-file (mh-msg-filename msg mh-current-folder)))
-    (call-process mh-bogofilter-executable msg-file mh-junk-background
-                  nil "-n")))
+    (mh-truncate-log-buffer)
+    ;; Put call-process output in log buffer if we are saving it
+    ;; (this happens if mh-junk-background is t).
+    (with-current-buffer mh-log-buffer
+      (call-process mh-bogofilter-executable msg-file mh-junk-background
+                    nil "-n"))))
 
 \f
 
@@ -404,6 +417,7 @@ distribution or from http://spamprobe.sourceforge.net.
 
 To use SpamProbe, add the following recipes to \".procmailrc\":
 
+    PATH=$PATH:/usr/bin/mh
     MAILDIR=$HOME/`mhparam Path`
 
     # Fight spam with SpamProbe.
@@ -423,8 +437,12 @@ update SpamProbe's training."
   (unless mh-spamprobe-executable
     (error "Unable to find the spamprobe executable"))
   (let ((msg-file (mh-msg-filename msg mh-current-folder)))
-    (call-process mh-spamprobe-executable msg-file mh-junk-background
-                  nil "spam")))
+    (mh-truncate-log-buffer)
+    ;; Put call-process output in log buffer if we are saving it
+    ;; (this happens if mh-junk-background is t).
+    (with-current-buffer mh-log-buffer
+      (call-process mh-spamprobe-executable msg-file mh-junk-background
+                    nil "spam"))))
 
 ;;;###mh-autoload
 (defun mh-spamprobe-whitelist (msg)
@@ -434,8 +452,12 @@ See `mh-spamprobe-blacklist' for more information."
   (unless mh-spamprobe-executable
     (error "Unable to find the spamprobe executable"))
   (let ((msg-file (mh-msg-filename msg mh-current-folder)))
-    (call-process mh-spamprobe-executable msg-file mh-junk-background
-                  nil "good")))
+    (mh-truncate-log-buffer)
+    ;; Put call-process output in log buffer if we are saving it
+    ;; (this happens if mh-junk-background is t).
+    (with-current-buffer mh-log-buffer
+      (call-process mh-spamprobe-executable msg-file mh-junk-background
+                    nil "good"))))
 
 (provide 'mh-junk)
 
index deb2ceb..e6da733 100644 (file)
@@ -361,14 +361,16 @@ This is only done if `mh-x-image-cache-directory' is nil."
 Replace the ?/ character with a ?! character and append .png.
 Also replaces special characters with `mh-url-hexify-string'
 since not all characters, such as :, are legal within Windows
-filenames. See URL
-`http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/naming_a_file.asp'."
+filenames. In addition, replaces * with %2a. See URL
+`http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/ifaces/iitemnamelimits/GetValidCharacters.asp'."
   (format "%s/%s.png" mh-x-image-cache-directory
-          (mh-url-hexify-string
-           (with-temp-buffer
-             (insert url)
-             (mh-replace-string "/" "!")
-             (buffer-string)))))
+          (mh-replace-regexp-in-string
+           "\*" "%2a"
+           (mh-url-hexify-string
+            (with-temp-buffer
+              (insert url)
+              (mh-replace-string "/" "!")
+              (buffer-string))))))
 
 (defun mh-x-image-get-download-state (file)
   "Check the state of FILE by following any symbolic links."
index e4c5409..522ffef 100644 (file)
@@ -48,7 +48,7 @@ The characters copied are inserted in the buffer before point."
       (if (< cc (current-column))
          (if (= (preceding-char) ?\t)
              (progn
-               (setq string (make-string (min n (- (current-column) cc)) ?\ ))
+               (setq string (make-string (min n (- (current-column) cc)) ?\s))
                (setq n (- n (min n (- (current-column) cc)))))
            ;; In middle of ctl char => copy that whole char.
            (backward-char 1)))
@@ -62,7 +62,7 @@ The characters copied are inserted in the buffer before point."
 ;; Variation of `zap-to-char'.
 
 (defun zap-up-to-char (arg char)
-  "Kill up to, but not including ARG'th occurrence of CHAR.
+  "Kill up to, but not including ARGth occurrence of CHAR.
 Case is ignored if `case-fold-search' is non-nil in the current buffer.
 Goes backward if ARG is negative; error if CHAR not found.
 Ignores CHAR at point."
index 445b64e..7703f62 100644 (file)
 See `mouse-copy-work-around-drag-bug' for details.")
 
 (defun mouse-copy-work-around-drag-bug (start-event end-event)
-  "Code to work around a bug in post-19.29 emacs:  it drops mouse-drag events.
+  "Code to work around a bug in post-19.29 Emacs: it drops mouse-drag events.
 The problem occurs under XFree86-3.1.1 (X11R6pl11) but not under X11R5,
-and under post-19.29 but not early versions of emacs.
+and under post-19.29 but not early versions of Emacs.
 
 19.29 and 19.30 seems to drop mouse drag events
 sometimes. (Reproducible under XFree86-3.1.1 (X11R6pl11) and
index 0b6cccd..23a2cab 100644 (file)
@@ -241,7 +241,7 @@ not it is actually displayed."
                          (cons 'keymap
                                (cons (concat
                                       (capitalize (subst-char-in-string
-                                                   ?- ?\  (symbol-name
+                                                   ?- ?\s (symbol-name
                                                            minor-mode)))
                                       " Menu")
                                      (cdr menu)))))
@@ -846,7 +846,7 @@ at the same position."
       ;; Should we instead decide that `action' takes a `posn'?
       (if (consp pos)
          (with-current-buffer (window-buffer (posn-window pos))
-           (funcall action (posn-point pos)))  
+           (funcall action (posn-point pos)))
        (funcall action pos)))
      (t action))))
 
@@ -889,7 +889,7 @@ at the same position."
   (let ((range (mouse-start-end start end mode)))
     (move-overlay ol (car range) (nth 1 range))))
 
-(defun mouse-drag-track (start-event  &optional 
+(defun mouse-drag-track (start-event  &optional
                                      do-mouse-drag-region-post-process)
     "Track mouse drags by highlighting area between point and cursor.
 The region will be defined with mark and point, and the overlay
@@ -983,8 +983,8 @@ should only be used by mouse-drag-region."
          (let* ((fun (key-binding (vector (car event))))
                 (do-multi-click   (and (> (event-click-count event) 0)
                                        (functionp fun)
-                                       (not (memq fun 
-                                                  '(mouse-set-point 
+                                       (not (memq fun
+                                                  '(mouse-set-point
                                                     mouse-set-region))))))
            ;; Run the binding of the terminating up-event, if possible.
            (if (and (not (= (overlay-start mouse-drag-overlay)
@@ -1885,7 +1885,7 @@ and selects that window."
     (setq tail buffers)
     (while tail
       (let ((elt (car tail)))
-       (if (/= (aref (buffer-name elt) 0) ?\ )
+       (if (/= (aref (buffer-name elt) 0) ?\s)
            (setq head
                  (cons
                   (cons
@@ -2377,7 +2377,7 @@ and selects that window."
   "X fonts suitable for use in Emacs.")
 
 (defun mouse-set-font (&rest fonts)
-  "Select an emacs font from a list of known good fonts and fontsets."
+  "Select an Emacs font from a list of known good fonts and fontsets."
   (interactive
    (progn (unless (display-multi-font-p)
            (error "Cannot change fonts on this display"))
@@ -2416,7 +2416,7 @@ and selects that window."
 
 (global-set-key [mouse-2]      'mouse-yank-at-click)
 ;; Allow yanking also when the corresponding cursor is "in the fringe".
-(global-set-key [right-fringe mouse-2] [mouse-2])
+(global-set-key [right-fringe mouse-2] 'mouse-yank-at-click)
 (global-set-key [mouse-3]      'mouse-save-then-kill)
 
 ;; By binding these to down-going events, we let the user use the up-going
index 987b71f..74e3ded 100644 (file)
@@ -165,7 +165,7 @@ must be set in a protocol/server-local fashion, see `eudc-server-set' and
   :group 'eudc)
 
 (defcustom eudc-expansion-overwrites-query t
-  "*If non nil, expanding a query overwrites the query string."
+  "*If non-nil, expanding a query overwrites the query string."
   :type  'boolean
   :group 'eudc)
 
index a639afe..20305f2 100644 (file)
@@ -15,7 +15,7 @@
 
 ;; This file is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
@@ -137,7 +137,7 @@ Used as the first arg to `format-time-string'."
 (defcustom rcirc-buffer-maximum-lines nil
   "*The maximum size in lines for rcirc buffers.
 Channel buffers are truncated from the top to be no greater than this
-number.         If zero or nil, no truncating is done."
+number.  If zero or nil, no truncating is done."
   :type '(choice (const :tag "No truncation" nil)
                 (integer :tag "Number of lines"))
   :group 'rcirc)
@@ -341,12 +341,12 @@ If ARG is non-nil, prompt for a server to connect to."
        (when (string= rcirc-default-server (process-name p))
          (setq connected p)))
       (if (not connected)
-         (rcirc-connect rcirc-default-server rcirc-default-port 
+         (rcirc-connect rcirc-default-server rcirc-default-port
                         rcirc-default-nick rcirc-default-user-name
                         rcirc-default-user-full-name
                         (rcirc-startup-channels rcirc-default-server))
        (switch-to-buffer (process-buffer connected))
-       (message "Connected to %s" 
+       (message "Connected to %s"
                 (process-contact (get-buffer-process (current-buffer))
                                  :host))))))
 ;;;###autoload
@@ -569,7 +569,7 @@ With no argument or nil as argument, use the current buffer."
 
 (defun rcirc-nick (process)
   "Return PROCESS nick."
-  (with-rcirc-process-buffer process 
+  (with-rcirc-process-buffer process
     (or rcirc-nick rcirc-default-nick)))
 
 (defun rcirc-buffer-nick (&optional buffer)
@@ -970,7 +970,7 @@ Create the buffer if it doesn't exist."
 
 (defvar rcirc-multiline-minor-mode-map (make-sparse-keymap)
   "Keymap for multiline mode in rcirc.")
-(define-key rcirc-multiline-minor-mode-map 
+(define-key rcirc-multiline-minor-mode-map
   (kbd "C-c C-c") 'rcirc-multiline-minor-submit)
 (define-key rcirc-multiline-minor-mode-map
   (kbd "C-x C-s") 'rcirc-multiline-minor-submit)
@@ -1079,7 +1079,7 @@ is found by looking up RESPONSE in `rcirc-response-formats'."
                   "%")
                  ((or (eq key ?n) (eq key ?N))
                   ;; %n/%N -- nick
-                  (let ((nick (concat (if (string= (with-rcirc-process-buffer 
+                  (let ((nick (concat (if (string= (with-rcirc-process-buffer
                                                        process
                                                      rcirc-server)
                                                    sender)
@@ -1092,7 +1092,7 @@ is found by looking up RESPONSE in `rcirc-response-formats'."
                                     (cond ((string= sender (rcirc-nick process))
                                            'rcirc-my-nick)
                                           ((and rcirc-bright-nicks
-                                                (string-match 
+                                                (string-match
                                                  (regexp-opt rcirc-bright-nicks)
                                                  sender))
                                            'rcirc-bright-nick)
@@ -1206,7 +1206,7 @@ record activity."
 
            (let ((text-start (make-marker)))
              (set-marker text-start
-                         (or (next-single-property-change fill-start 
+                         (or (next-single-property-change fill-start
                                                           'rcirc-text)
                              rcirc-prompt-end-marker))
              ;; squeeze spaces out of text before rcirc-text
@@ -1402,7 +1402,7 @@ if NICK is also on `rcirc-ignore-list-automatic'."
                   (append global-mode-string '(rcirc-activity-string))))
        (add-hook 'window-configuration-change-hook
                  'rcirc-window-configuration-change))
-    (setq global-mode-string 
+    (setq global-mode-string
          (delete 'rcirc-activity-string global-mode-string))
     (remove-hook 'window-configuration-change-hook
                 'rcirc-window-configuration-change)))
@@ -1461,7 +1461,7 @@ show the buffer."
   (interactive "P")
   (let* ((pair (rcirc-split-activity rcirc-activity))
         (lopri (car pair))
-        (hipri (cdr pair)))            
+        (hipri (cdr pair)))
     (if (or (and (not arg) hipri)
            (and arg lopri))
        (progn
@@ -1476,10 +1476,10 @@ show the buffer."
            (message "No more IRC activity.  Go back to work.")
            (funcall rcirc-switch-to-buffer-function rcirc-last-non-irc-buffer)
            (setq rcirc-last-non-irc-buffer nil))
-       (message (concat 
+       (message (concat
                  "No IRC activity."
                  (when lopri
-                   (concat 
+                   (concat
                     "  Type C-u "
                     (key-description (this-command-keys))
                     " for low priority activity."))))))))
@@ -1669,7 +1669,7 @@ Also, clear the overlay arrow if the current buffer is now hidden."
   (if (null message)
       (progn
         (setq target (completing-read "Message nick: "
-                                      (with-rcirc-server-buffer 
+                                      (with-rcirc-server-buffer
                                        rcirc-nick-table)))
         (when (> (length target) 0)
           (setq message (read-string (format "Message %s: " target)))
@@ -1775,7 +1775,7 @@ With a prefix arg, prompt for new topic."
   "Kick NICK from current channel."
   (interactive (list
                 (concat (completing-read "Kick nick: "
-                                         (rcirc-channel-nicks 
+                                         (rcirc-channel-nicks
                                          (rcirc-buffer-process)
                                          rcirc-target))
                         (read-from-minibuffer "Kick reason: "))))
@@ -1812,7 +1812,7 @@ nicks when no NICK is given.  When listing ignored nicks, the
 ones added to the list automatically are marked with an asterisk."
   (interactive "sToggle ignoring of nick: ")
   (setq rcirc-ignore-list (rcirc-add-or-remove rcirc-ignore-list nick))
-  (rcirc-print process nil "IGNORE" target 
+  (rcirc-print process nil "IGNORE" target
               (mapconcat
                (lambda (nick)
                  (concat nick
@@ -1824,14 +1824,14 @@ ones added to the list automatically are marked with an asterisk."
   "Manage the bright nick list."
   (interactive "sToggle emphasis of nick: ")
   (setq rcirc-bright-nicks (rcirc-add-or-remove rcirc-bright-nicks nick))
-  (rcirc-print process nil "BRIGHT" target 
+  (rcirc-print process nil "BRIGHT" target
               (mapconcat 'identity rcirc-bright-nicks " ")))
 
 (defun-rcirc-command dim (nick)
   "Manage the dim nick list."
   (interactive "sToggle deemphasis of nick: ")
   (setq rcirc-dim-nicks (rcirc-add-or-remove rcirc-dim-nicks nick))
-  (rcirc-print process nil "DIM" target 
+  (rcirc-print process nil "DIM" target
               (mapconcat 'identity rcirc-dim-nicks " ")))
 
 (defun-rcirc-command keyword (keyword)
@@ -1840,7 +1840,7 @@ Mark KEYWORD, unmark KEYWORD if already marked, or list marked
 keywords when no KEYWORD is given."
   (interactive "sToggle highlighting of keyword: ")
   (setq rcirc-keywords (rcirc-add-or-remove rcirc-keywords keyword))
-  (rcirc-print process nil "KEYWORD" target 
+  (rcirc-print process nil "KEYWORD" target
               (mapconcat 'identity rcirc-keywords " ")))
 
 \f
@@ -1865,8 +1865,8 @@ keywords when no KEYWORD is given."
 (defvar rcirc-url-regexp
   (rx-to-string
    `(and word-boundary
-        (or (and 
-             (or (and (or "http" "https" "ftp" "file" "gopher" "news" 
+        (or (and
+             (or (and (or "http" "https" "ftp" "file" "gopher" "news"
                           "telnet" "wais" "mailto")
                       "://")
                  "www.")
@@ -1876,7 +1876,7 @@ keywords when no KEYWORD is given."
             (and (1+ (char "-a-zA-Z0-9_."))
                  (or ".com" ".net" ".org")
                  word-boundary))
-        (optional 
+        (optional
          (and "/"
               (1+ (char "-a-zA-Z0-9_=!?#$\@~`%&*+|\\/:;.,{}[]()"))
               (char "-a-zA-Z0-9_=#$\@~`%&*+|\\/:;{}[]()")))))
@@ -1957,11 +1957,11 @@ in this buffer.")
 
 (defun rcirc-markup-my-nick (process sender response channel-buffer)
   (with-syntax-table rcirc-nick-syntax-table
-    (while (re-search-forward (concat "\\b" 
+    (while (re-search-forward (concat "\\b"
                                      (regexp-quote (rcirc-nick process))
                                      "\\b")
                              nil t)
-      (rcirc-add-face (match-beginning 0) (match-end 0) 
+      (rcirc-add-face (match-beginning 0) (match-end 0)
                      'rcirc-nick-in-message)
       (when (string= response "PRIVMSG")
        (rcirc-add-face (point-min) (point-max) 'rcirc-nick-in-message-full-line)
@@ -2409,7 +2409,7 @@ Passwords are stored in `rcirc-authinfo' (which see)."
 (defface rcirc-nick-in-message-full-line
   '((t (:bold t)))
   "The face used emphasize the entire message when your nick is mentioned."
-  :group 'rcirc-faces)  
+  :group 'rcirc-faces)
 
 (defface rcirc-prompt                  ; comint-highlight-prompt
   '((((min-colors 88) (background dark)) (:foreground "cyan1"))
index 0b914a8..1ee7ca0 100644 (file)
 ;;;###autoload
 (defvar tramp-unified-filenames (not (featurep 'xemacs))
   "Non-nil means to use unified Ange-FTP/Tramp filename syntax.
-Nil means to use a separate filename syntax for Tramp.")
+Otherwise, use a separate filename syntax for Tramp.")
 
 ;; Load foreign methods.  Because they do require Tramp internally, this
 ;; must be done with the `eval-after-load' trick.
@@ -149,12 +149,11 @@ Nil means to use a separate filename syntax for Tramp.")
                    (when (featurep 'tramp-smb)
                      (unload-feature 'tramp-smb 'force)))))))
 
-(eval-when-compile
-  (require 'cl)
-  (require 'custom)
-  ;; Emacs 19.34 compatibility hack -- is this needed?
-  (or (>= emacs-major-version 20)
-      (load "cl-seq")))
+(require 'cl)
+(require 'custom)
+;; Emacs 19.34 compatibility hack -- is this needed?
+(or (>= emacs-major-version 20)
+    (load "cl-seq"))
 
 (unless (boundp 'custom-print-functions)
   (defvar custom-print-functions nil)) ; not autoloaded before Emacs 20.4
@@ -674,9 +673,9 @@ various functions for details."
 
 (defcustom tramp-default-method
   (if (and (fboundp 'executable-find)
-          (executable-find "plink"))
-      "plink"
-    "ssh")
+          (executable-find "pscp"))
+      "pscp"
+    "scp")
   "*Default method to use for transferring files.
 See `tramp-methods' for possibilities.
 Also see `tramp-default-method-alist'."
@@ -944,6 +943,17 @@ be ignored safely."
   :group 'tramp
   :type 'regexp)
 
+(defcustom tramp-copy-failed-regexp
+  (concat "\\(.+: "
+          (regexp-opt '("Permission denied"
+                        "not a regular file"
+                        "is a directory"
+                        "No such file or directory") t)
+          "\\)\\s-*")
+  "Regular expression matching copy problems in (s)cp operations."
+  :group 'tramp
+  :type 'regexp)
+
 (defcustom tramp-process-alive-regexp
   ""
   "Regular expression indicating a process has finished.
@@ -1341,6 +1351,7 @@ corresponding PATTERN matches, the ACTION function is called."
 (defcustom tramp-actions-copy-out-of-band
   '((tramp-password-prompt-regexp tramp-action-password)
     (tramp-wrong-passwd-regexp tramp-action-permission-denied)
+    (tramp-copy-failed-regexp tramp-action-copy-failed)
     (tramp-process-alive-regexp tramp-action-out-of-band))
   "List of pattern/action pairs.
 This list is used for copying/renaming with out-of-band methods.
@@ -3175,12 +3186,13 @@ be a local filename.  The method used must be an out-of-band method."
       (message "Transferring %s to %s..." filename newname)
 
       ;; Use rcp-like program for file transfer.
-      (let ((p (apply 'start-process (buffer-name trampbuf) trampbuf
-                     copy-program copy-args)))
-       (tramp-set-process-query-on-exit-flag p nil)
-       (tramp-process-actions p multi-method method user host
-                              tramp-actions-copy-out-of-band))
-      (kill-buffer trampbuf)
+      (unwind-protect
+          (let ((p (apply 'start-process (buffer-name trampbuf) trampbuf
+                          copy-program copy-args)))
+            (tramp-set-process-query-on-exit-flag p nil)
+            (tramp-process-actions p multi-method method user host
+                                   tramp-actions-copy-out-of-band))
+        (kill-buffer trampbuf))
       (message "Transferring %s to %s...done" filename newname)
 
       ;; Set the mode.
@@ -5354,6 +5366,11 @@ Returns nil if none was found, else the command is returned."
   (kill-process p)
   (throw 'tramp-action 'permission-denied))
 
+(defun tramp-action-copy-failed (p multi-method method user host)
+  "Signal copy failed."
+  (kill-process p)
+  (error "%s" (match-string 1)))
+
 (defun tramp-action-yesno (p multi-method method user host)
   "Ask the user for confirmation using `yes-or-no-p'.
 Send \"yes\" to remote process on confirmation, abort otherwise.
@@ -5410,9 +5427,6 @@ The terminal type can be configured with `tramp-terminal-type'."
               (tramp-message 10 "'set mode' error ignored.")
               (tramp-message 9 "Process has finished.")
               (throw 'tramp-action 'ok))
-          (goto-char (point-min))
-          (when (re-search-forward "^.cp.?: \\(.+: Permission denied.?\\)$" nil t)
-            (error "Remote host: %s" (match-string 1)))
           (tramp-message 9 "Process has died.")
           (throw 'tramp-action 'process-died)))
        (t nil)))
index 9d089a2..d0b29d4 100644 (file)
@@ -551,8 +551,8 @@ If CONTINUE is non-nil, use the `comment-continue' markers if any."
            (indent-to comment-column)
            ;; Ensure there's a space before the comment for things
            ;; like sh where it matters (as well as being neater).
-           (unless (memq (char-before) '(nil ?\n ?\t ?\ ))
-             (insert ?\ ))
+           (unless (memq (char-before) '(nil ?\n ?\t ?\s))
+             (insert ?\s))
            (setq begpos (point))
            (insert starter)
            (setq cpos (point-marker))
index 7fff480..ca826ca 100644 (file)
@@ -95,7 +95,7 @@ SPC to try the command just this once, but leave it disabled.
        (while (progn (setq char (read-event))
                     (or (not (numberp char))
                         (not (memq (downcase char)
-                                   '(?! ?y ?n ?\  ?\C-g)))))
+                                   '(?! ?y ?n ?\s ?\C-g)))))
         (ding)
         (message "Please type y, n, ! or SPC (the space bar): "))))
     (setq char (downcase char))
index 2950617..fe92804 100644 (file)
@@ -220,7 +220,7 @@ in `show-paren-style' after `show-paren-delay' seconds of Emacs idle time."
                        (point))))
              (if show-paren-overlay-1
                  (move-overlay show-paren-overlay-1 from to (current-buffer))
-               (setq show-paren-overlay-1 (make-overlay from to)))
+               (setq show-paren-overlay-1 (make-overlay from to nil t)))
              ;; Always set the overlay face, since it varies.
              (overlay-put show-paren-overlay-1 'priority show-paren-priority)
              (overlay-put show-paren-overlay-1 'face face)))
@@ -243,7 +243,7 @@ in `show-paren-style' after `show-paren-delay' seconds of Emacs idle time."
                          (forward-point (- dir))))))
            (if show-paren-overlay
                (move-overlay show-paren-overlay from to (current-buffer))
-             (setq show-paren-overlay (make-overlay from to))))
+             (setq show-paren-overlay (make-overlay from to nil t))))
          ;;
          ;; Always set the overlay face, since it varies.
          (overlay-put show-paren-overlay 'priority show-paren-priority)
index 1f2bad1..5223700 100644 (file)
@@ -1741,6 +1741,8 @@ Signal an error if there is no backup file."
             ;; into a sequence of chars.
             (decode-coding-inserted-region
              (point-min) (point-max) file t nil nil t)
+            ;; Set buffer-file-coding-system.
+            (after-insert-file-set-coding (buffer-size) t)
            (set-buffer-modified-p nil)
            (let ((buffer-file-name (expand-file-name file)))
              (after-find-file))
index e53a0c2..aa0cfcf 100644 (file)
@@ -63,9 +63,9 @@ Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"."
 (defun pgg-pgp-process-region (start end passphrase program args)
   (let* ((errors-file-name (pgg-make-temp-file "pgg-errors"))
         (args
-         (append args
+         (concat args
                  pgg-pgp-extra-args
-                 (list (concat "2>" errors-file-name))))
+                  " 2>" (shell-quote-argument errors-file-name)))
         (shell-file-name pgg-pgp-shell-file-name)
         (shell-command-switch pgg-pgp-shell-command-switch)
         (process-environment process-environment)
@@ -83,9 +83,8 @@ Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"."
          (let ((coding-system-for-read 'binary)
                (coding-system-for-write 'binary))
            (setq process
-                 (apply #'funcall
-                        #'start-process-shell-command "*PGP*" output-buffer
-                        program args)))
+                 (start-process-shell-command "*PGP*" output-buffer
+                                               (concat program " " args))))
          (set-process-sentinel process #'ignore)
          (when passphrase
            (process-send-string process (concat passphrase "\n")))
@@ -142,15 +141,14 @@ Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"."
                                    pgg-pgp-user-id)
                            pgg-pgp-user-id))))
         (args
-         (append
-          `("+encrypttoself=off +verbose=1" "+batchmode"
-            "+language=us" "-fate"
-            ,@(if recipients
-                  (mapcar (lambda (rcpt) (concat "\"" rcpt "\""))
-                          (append recipients
-                                  (if pgg-encrypt-for-me
-                                      (list pgg-pgp-user-id))))))
-          (if sign '("-s" "-u" pgg-pgp-user-id)))))
+         (concat
+          "+encrypttoself=off +verbose=1 +batchmode +language=us -fate "
+           (if recipients
+               (mapconcat 'shell-quote-argument
+                          (append recipients
+                                  (if pgg-encrypt-for-me
+                                      (list pgg-pgp-user-id)))))
+           (if sign (concat " -s -u " (shell-quote-argument pgg-pgp-user-id))))))
     (pgg-pgp-process-region start end nil pgg-pgp-program args)
     (pgg-process-when-success nil)))
 
@@ -166,7 +164,7 @@ passphrase cache or user."
              (pgg-read-passphrase
               (format "PGP passphrase for %s: " pgg-pgp-user-id) key)))
         (args
-         '("+verbose=1" "+batchmode" "+language=us" "-f")))
+         "+verbose=1 +batchmode +language=us -f"))
     (pgg-pgp-process-region start end passphrase pgg-pgp-program args)
     (pgg-process-when-success
       (if pgg-cache-passphrase
@@ -184,9 +182,9 @@ passphrase cache or user."
               (format "PGP passphrase for %s: " pgg-pgp-user-id)
               (pgg-pgp-lookup-key pgg-pgp-user-id 'sign))))
         (args
-         (list (if clearsign "-fast" "-fbast")
-               "+verbose=1" "+language=us" "+batchmode"
-               "-u" pgg-pgp-user-id)))
+         (concat (if clearsign "-fast" "-fbast")
+               " +verbose=1 +language=us +batchmode"
+               " -u " (shell-quote-argument pgg-pgp-user-id))))
     (pgg-pgp-process-region start end passphrase pgg-pgp-program args)
     (pgg-process-when-success
       (goto-char (point-min))
@@ -204,7 +202,7 @@ passphrase cache or user."
 (defun pgg-pgp-verify-region (start end &optional signature)
   "Verify region between START and END as the detached signature SIGNATURE."
   (let* ((orig-file (pgg-make-temp-file "pgg"))
-        (args '("+verbose=1" "+batchmode" "+language=us"))
+        (args "+verbose=1 +batchmode +language=us")
         (orig-mode (default-file-modes)))
     (unwind-protect
        (progn
@@ -216,8 +214,8 @@ passphrase cache or user."
     (if (stringp signature)
        (progn
          (copy-file signature (setq signature (concat orig-file ".asc")))
-         (setq args (append args (list signature orig-file))))
-      (setq args (append args (list orig-file))))
+         (setq args (concat args " " (shell-quote-argument signature)))))
+    (setq args (concat args " " (shell-quote-argument orig-file)))
     (pgg-pgp-process-region (point)(point) nil pgg-pgp-program args)
     (delete-file orig-file)
     (if signature (delete-file signature))
@@ -237,8 +235,8 @@ passphrase cache or user."
   "Insert public key at point."
   (let* ((pgg-pgp-user-id (or pgg-pgp-user-id pgg-default-user-id))
         (args
-         (list "+verbose=1" "+batchmode" "+language=us" "-kxaf"
-               (concat "\"" pgg-pgp-user-id "\""))))
+         (concat "+verbose=1 +batchmode +language=us -kxaf "
+                  (shell-quote-argument pgg-pgp-user-id))))
     (pgg-pgp-process-region (point)(point) nil pgg-pgp-program args)
     (insert-buffer-substring pgg-output-buffer)))
 
@@ -247,8 +245,8 @@ passphrase cache or user."
   (let* ((pgg-pgp-user-id (or pgg-pgp-user-id pgg-default-user-id))
         (key-file (pgg-make-temp-file "pgg"))
         (args
-         (list "+verbose=1" "+batchmode" "+language=us" "-kaf"
-               key-file)))
+         (concat "+verbose=1 +batchmode +language=us -kaf "
+                  (shell-quote-argument key-file))))
     (let ((coding-system-for-write 'raw-text-dos))
       (write-region start end key-file))
     (pgg-pgp-process-region start end nil pgg-pgp-program args)
@@ -257,5 +255,5 @@ passphrase cache or user."
 
 (provide 'pgg-pgp)
 
-;;; arch-tag: 076b7801-37b2-49a6-97c3-218fdecde33c
+;; arch-tag: 076b7801-37b2-49a6-97c3-218fdecde33c
 ;;; pgg-pgp.el ends here
index ae8a62c..930ceac 100644 (file)
@@ -935,7 +935,7 @@ or more clues in here):
 - If you go down a hole in the floor without an aid such as a ladder,
   you probably won't be able to get back up the way you came, if at all.
 
-- To run this game in batch mode (no emacs window), use:
+- To run this game in batch mode (no Emacs window), use:
      emacs -batch -l dunnet
 NOTE: This game *should* be run in batch mode!
 
index ee321b4..2df8a9a 100644 (file)
@@ -29,7 +29,7 @@
 
 ;; RULES:
 ;;
-;; Gomoku is a game played between two players on a rectangular board. Each
+;; Gomoku is a game played between two players on a rectangular board.  Each
 ;; player, in turn, marks a free square of its choice. The winner is the first
 ;; one to mark five contiguous squares in any direction (horizontally,
 ;; vertically or diagonally).
@@ -212,9 +212,9 @@ is non-nil."
 ;;;
 
 ;; The board is a rectangular grid. We code empty squares with 0, X's with 1
-;; and O's with 6. The rectangle is recorded in a one dimensional vector
-;; containing padding squares (coded with -1). These squares allow us to
-;; detect when we are trying to move out of the board. We denote a square by
+;; and O's with 6.  The rectangle is recorded in a one dimensional vector
+;; containing padding squares (coded with -1).  These squares allow us to
+;; detect when we are trying to move out of the board.  We denote a square by
 ;; its (X,Y) coords, or by the INDEX corresponding to them in the vector.  The
 ;; leftmost topmost square has coords (1,1) and index gomoku-board-width + 2.
 ;; Similarly, vectors between squares may be given by two DX, DY coords or by
@@ -230,7 +230,7 @@ is non-nil."
   "Vector recording the actual state of the Gomoku board.")
 
 (defvar gomoku-vector-length nil
-  "Length of gomoku-board vector.")
+  "Length of `gomoku-board' vector.")
 
 (defvar gomoku-draw-limit nil
   ;; This is usually set to 70% of the number of squares.
@@ -250,7 +250,7 @@ is non-nil."
   (/ index (1+ gomoku-board-width)))
 
 (defun gomoku-init-board ()
-  "Create the gomoku-board vector and fill it with initial values."
+  "Create the `gomoku-board' vector and fill it with initial values."
   (setq gomoku-board (make-vector gomoku-vector-length 0))
   ;; Every square is 0 (i.e. empty) except padding squares:
   (let ((i 0) (ii (1- gomoku-vector-length)))
@@ -671,11 +671,11 @@ that DVAL has been added on SQUARE."
      (cond ((< gomoku-number-of-moves 20)
            "This was a REALLY QUICK win.")
           (gomoku-human-refused-draw
-           "I won... Too bad you refused my offer of a draw!")
+           "I won...  Too bad you refused my offer of a draw!")
           (gomoku-human-took-back
-           "I won... Taking moves back will not help you!")
+           "I won...  Taking moves back will not help you!")
           ((not gomoku-emacs-played-first)
-           "I won... Playing first did not help you much!")
+           "I won...  Playing first did not help you much!")
           ((and (zerop gomoku-number-of-human-wins)
                 (zerop gomoku-number-of-draws)
                 (> gomoku-number-of-emacs-wins 1))
@@ -875,9 +875,9 @@ If the game is finished, this command requests for another game."
     (let (square score)
       (setq square (gomoku-point-square))
       (cond ((null square)
-            (error "Your point is not on a square. Retry!"))
+            (error "Your point is not on a square.  Retry!"))
            ((not (zerop (aref gomoku-board square)))
-            (error "Your point is not on a free square. Retry!"))
+            (error "Your point is not on a free square.  Retry!"))
            (t
             (setq score (aref gomoku-score-table square))
             (gomoku-play-move square 1)
@@ -902,7 +902,7 @@ If the game is finished, this command requests for another game."
     (sit-for 4)
     (gomoku-prompt-for-other-game))
    ((zerop gomoku-number-of-human-moves)
-    (message "You have not played yet... Your move?"))
+    (message "You have not played yet...  Your move?"))
    (t
     (message "One moment, please...")
     ;; It is possible for the user to let Emacs play several consecutive
@@ -937,7 +937,7 @@ If the game is finished, this command requests for another game."
 (defun gomoku-prompt-for-move ()
   "Display a message asking for Human's move."
   (message (if (zerop gomoku-number-of-human-moves)
-              "Your move? (move to a free square and hit X, RET ...)"
+              "Your move?  (Move to a free square and hit X, RET ...)"
               "Your move?"))
   ;; This may seem silly, but if one omits the following line (or a similar
   ;; one), the cursor may very well go to some place where POINT is not.
@@ -951,7 +951,7 @@ If the game is finished, this command requests for another game."
 
 (defun gomoku-offer-a-draw ()
   "Offer a draw and return t if Human accepted it."
-  (or (y-or-n-p "I offer you a draw. Do you accept it? ")
+  (or (y-or-n-p "I offer you a draw.  Do you accept it? ")
       (not (setq gomoku-human-refused-draw t))))
 \f
 ;;;
index 5e9ba97..578f9a8 100644 (file)
@@ -77,7 +77,7 @@
 ;; Variables
 
 (defgroup handwrite nil
-  "Turns your emacs buffer into a handwritten document."
+  "Turns your Emacs buffer into a handwritten document."
   :prefix "handwrite-"
   :group 'games)
 
@@ -155,7 +155,19 @@ Variables: handwrite-linespace     (default 12)
        (buf-name (buffer-name) )
        (textp)
        (ps-buf-name)                   ;name of the PostScript buffer
-       )
+       (trans-table
+       '(("ÿ" . "264") ("á" . "207") ("à" . "210") ("â" . "211")
+         ("ä" . "212") ("ã" . "213") ("å" . "214") ("é" . "216")
+         ("è" . "217") ("ê" . "220") ("ë" . "221") ("í" . "222")
+         ("ì" . "223") ("î" . "224") ("ï" . "225") ("ó" . "227")
+         ("ò" . "230") ("ô" . "231") ("ö" . "232") ("õ" . "233")
+         ("ú" . "234") ("ù" . "235") ("û" . "236") ("ü" . "237")
+         ("ß" . "247") ("°" . "241") ("®" . "250") ("©" . "251")
+         ("ij" . "264") ("ç" . "215") ("§" . "244") ("ñ" . "226")
+         ("£" . "243")))
+       (escape-table '("\\\\" "(" ")")) ; \\ comes first to not work
+                                       ; on inserted backslashes
+       line)
     (goto-char (point-min))            ;start at beginning
     (setq handwrite-psindex (1+ handwrite-psindex))
     (setq ps-buf-name
@@ -178,155 +190,46 @@ Variables: handwrite-linespace     (default 12)
     (switch-to-buffer cur-buf)
     (goto-char (point-min))            ;start at beginning
     (save-excursion
-      ;;as long as we see a newline the document is not ended.
-      (while (re-search-forward "\n" nil t)
-       (previous-line 1)
-       (beginning-of-line)
-       (setq pmin (point))
-       (search-forward "\n" nil t)
-       (backward-char 1)
-       (copy-region-as-kill (point) pmin)
-       (forward-char 1)
+      (while (not (eobp))
+       (setq line (thing-at-point 'line))
+       (dolist (escape escape-table)
+         (setq line (replace-regexp-in-string escape
+                                              (concat "\\\\" escape) line)))
+       (dolist (trans trans-table)
+         (setq line (replace-regexp-in-string (car trans)
+                                              (concat "\\\\" (cdr trans))
+                                              line)))
        (switch-to-buffer ps-buf-name)
-       (yank)
+       (insert (replace-regexp-in-string "\n" "" line))
        (message "write write write...")
-       (search-forward ")a" nil t)
-       (backward-char 2)
-       (setq lastp (point))
-       (beginning-of-line)
-       (search-forward "(" nil t)
-       (while (re-search-forward "[()\\]" lastp t)
-         (save-excursion
-           (setq lastp (+ lastp 1))
-           (forward-char -1)
-           (insert "\\")))
        (setq ps-ypos (+ ps-ypos handwrite-linespace))
        (end-of-line)
        (insert "\n")
        (setq lcount (+ lcount 1))
-       (cond ( (eq lcount handwrite-numlines)
-               (setq ipage (+ ipage 1))
-               (insert "0 0  m\n")
-               (insert "showpage exec Hwsave restore\n")
-               (insert "%%Page: " (number-to-string ipage) " "
-                       (number-to-string ipage) "\n")
-               (insert "Hwjst\n")
-               (insert "/Hwsave save def\n")
-               (if handwrite-pagenumbering
-                   (insert "20 30 m\nxym(page "
-                           (number-to-string ipage) ")a\n"))
-               (setq ps-ypos 63)
-               (setq lcount 0)
-               ))
-       (insert "44 "(number-to-string ps-ypos) " m\n")
+       (when (= lcount handwrite-numlines)
+         (setq ipage (+ ipage 1))
+         (insert "0 0  m\n")
+         (insert "showpage exec Hwsave restore\n")
+         (insert "%%Page: " (number-to-string ipage) " "
+                 (number-to-string ipage) "\n")
+         (insert "Hwjst\n")
+         (insert "/Hwsave save def\n")
+         (if handwrite-pagenumbering
+             (insert "20 30 m\nxym(page "
+                     (number-to-string ipage) ")a\n"))
+         (setq ps-ypos 63)
+         (setq lcount 0))
+       (insert "44 " (number-to-string ps-ypos) " m\n")
        (insert "xym( )a")
        (backward-char 3)
        (switch-to-buffer cur-buf)
+       (forward-line 1)
        ))
     (switch-to-buffer ps-buf-name)
     (next-line 1)
     (insert "showpage exec Hwsave restore\n\n")
     (insert "%%Pages " (number-to-string ipage) " 0\n")
     (insert "%%EOF\n")
-    (goto-char textp)                  ;start where the inserted text begins
-    (while (search-forward "ÿ" nil t)
-      (replace-match "\\" nil t) (insert "264"))
-    (goto-char textp)
-    (while (search-forward "á" nil t)
-      (replace-match "\\" nil t) (insert "207"))
-    (goto-char textp)
-    (while (search-forward "à" nil t)
-      (replace-match "\\" nil t) (insert "210"))
-    (goto-char textp)
-    (while (search-forward "â" nil t)
-      (replace-match "\\" nil t) (insert "211"))
-    (goto-char textp)
-    (while (search-forward "ä" nil t)
-      (replace-match "\\" nil t) (insert "212"))
-    (goto-char textp)
-    (while (search-forward "ã" nil t)
-      (replace-match "\\" nil t) (insert "213"))
-    (goto-char textp)
-    (while (search-forward "å" nil t)
-      (replace-match "\\" nil t) (insert "214"))
-    (goto-char textp)
-    (while (search-forward "é" nil t)
-      (replace-match "\\" nil t) (insert "216"))
-    (goto-char textp)
-    (while (search-forward "è" nil t)
-      (replace-match "\\" nil t) (insert "217"))
-    (goto-char textp)
-    (while (search-forward "ê" nil t)
-      (replace-match "\\" nil t) (insert "220"))
-    (goto-char textp)
-    (while (search-forward "ë" nil t)
-      (replace-match "\\" nil t) (insert "221"))
-    (goto-char textp)
-    (while (search-forward "í" nil t)
-      (replace-match "\\" nil t) (insert "222"))
-    (goto-char textp)
-    (while (search-forward "ì" nil t)
-      (replace-match "\\" nil t) (insert "223"))
-    (goto-char textp)
-    (while (search-forward "î" nil t)
-      (replace-match "\\" nil t) (insert "224"))
-    (goto-char textp)
-    (while (search-forward "ï" nil t)
-      (replace-match "\\" nil t) (insert "225"))
-    (goto-char textp)
-    (while (search-forward "ó" nil t)
-      (replace-match "\\" nil t) (insert "227"))
-    (goto-char textp)
-    (while (search-forward "ò" nil t)
-      (replace-match "\\" nil t) (insert "230"))
-    (goto-char textp)
-    (while (search-forward "ô" nil t)
-      (replace-match "\\" nil t) (insert "231"))
-    (goto-char textp)
-    (while (search-forward "ö" nil t)
-      (replace-match "\\" nil t) (insert "232"))
-    (goto-char textp)
-    (while (search-forward "õ" nil t)
-      (replace-match "\\" nil t) (insert "233"))
-    (goto-char textp)
-    (while (search-forward "ú" nil t)
-      (replace-match "\\" nil t) (insert "234"))
-    (goto-char textp)
-    (while (search-forward "ù" nil t)
-      (replace-match "\\" nil t) (insert "235"))
-    (goto-char textp)
-    (while (search-forward "û" nil t)
-      (replace-match "\\" nil t) (insert "236"))
-    (goto-char textp)
-    (while (search-forward "ü" nil t)
-      (replace-match "\\" nil t) (insert "237"))
-    (goto-char textp)
-    (while (search-forward "ß" nil t)
-      (replace-match "\\" nil t) (insert "247"))
-    (goto-char textp)
-    (while (search-forward "°" nil t)
-      (replace-match "\\" nil t) (insert "241"))
-    (goto-char textp)
-    (while (search-forward "®" nil t)
-      (replace-match "\\" nil t) (insert "250"))
-    (goto-char textp)
-    (while (search-forward "©" nil t)
-      (replace-match "\\" nil t) (insert "251"))
-    (goto-char textp)
-    (while (search-forward "ij" nil t)
-      (replace-match "\\" nil t) (insert "264"))
-    (goto-char textp)
-    (while (search-forward "ç" nil t)
-      (replace-match "\\" nil t) (insert "215"))
-    (goto-char textp)
-    (while (search-forward "§" nil t)
-      (replace-match "\\" nil t) (insert "244"))
-    (goto-char textp)
-    (while (search-forward "ñ" nil t)
-      (replace-match "\\" nil t) (insert "226"))
-    (goto-char textp)
-    (while (search-forward "£" nil t)
-      (replace-match "\\" nil t) (insert "243"))
     ;;To avoid cumbersome code we simply ignore pagefeeds
     (goto-char textp)
     (while (search-forward "\f" nil t)
@@ -342,7 +245,9 @@ Variables: handwrite-linespace     (default 12)
                 (ps-lpr-switches
                  (if (stringp ps-printer-name)
                      (list (concat "-P" ps-printer-name)))))
-           (apply (or ps-print-region-function 'call-process-region)
+           (apply (or (and (boundp 'ps-print-region-function)
+                           ps-print-region-function)
+                      'call-process-region)
                   (point-min) (point-max) ps-lpr-command nil nil nil))))
     (message "")
     (bury-buffer ())
index 40a96f4..fddfe22 100644 (file)
@@ -133,7 +133,7 @@ Repent before ring 31 moves."
 ;;;###autoload
 (defun hanoi-unix-64 ()
   "Like hanoi-unix, but pretend to have a 64-bit clock.
-This is, necessarily (as of emacs 20.3), a crock.  When the
+This is, necessarily (as of Emacs 20.3), a crock.  When the
 current-time interface is made s2G-compliant, hanoi.el will need
 to be updated."
   (interactive)
@@ -152,7 +152,7 @@ BITS must be of length nrings.  Start at START-TIME."
   (buffer-disable-undo (current-buffer))
   (unwind-protect
       (let*
-         (;; These lines can cause emacs to crash if you ask for too
+         (;; These lines can cause Emacs to crash if you ask for too
           ;; many rings.  If you uncomment them, on most systems you
           ;; can get 10,000+ rings.
           ;;(max-specpdl-size (max max-specpdl-size (* nrings 15)))
index 1bd1c7e..f947a8c 100644 (file)
@@ -75,7 +75,7 @@
 ;; The board is a rectangular grid. We code empty squares with 0, X's with 1
 ;; and O's with 6. The rectangle is recorded in a one dimensional vector
 ;; containing padding squares (coded with -1). These squares allow us to
-;; detect when we are trying to move out of the board. We denote a square by
+;; detect when we are trying to move out of the board.  We denote a square by
 ;; its (X,Y) coords, or by the INDEX corresponding to them in the vector.  The
 ;; leftmost topmost square has coords (1,1) and index lm-board-width + 2.
 ;; Similarly, vectors between squares may be given by two DX, DY coords or by
index 1825215..d99d698 100644 (file)
@@ -5,7 +5,7 @@
 
 ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
-;; Time-stamp: <2006/09/15 18:53:14 vinicius>
+;; Time-stamp: <2006/11/08 12:01:50 vinicius>
 ;; Keywords: wp, print, PostScript
 ;; Version: 6.8.4
 ;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre
@@ -68,7 +68,7 @@ Please send all bug fixes and enhancements to
 ;; interface to ps-print package and it also provides some extra stuff.
 ;;
 ;; To download the latest ps-print package see
-;; `http://www.cpqd.com.br/~vinicius/emacs/ps-print.tar.gz'.
+;; `http://www.emacswiki.org/cgi-bin/emacs/download/ps-print.tar.gz'.
 ;; Please, see README file for ps-print installation instructions.
 ;;
 ;; `printing' was inspired on:
@@ -958,8 +958,8 @@ Please send all bug fixes and enhancements to
 ;;
 ;; * For `printing' package:
 ;;
-;;    printing `http://www.cpqd.com.br/~vinicius/emacs/printing.el.gz'
-;;    ps-print `http://www.cpqd.com.br/~vinicius/emacs/ps-print.tar.gz'
+;;    printing `http://www.emacswiki.org/cgi-bin/emacs/download/printing.el'
+;;    ps-print `http://www.emacswiki.org/cgi-bin/emacs/download/ps-print.tar.gz'
 ;;
 ;; * For GNU or Unix system:
 ;;
@@ -3087,7 +3087,7 @@ Calls `pr-update-menus' to adjust menus."
     ;; third... time, but "print" item exists only in the first load.
     (cond
      ;; Emacs 20
-     ((string< emacs-version "21.")
+     ((< emacs-major-version 21)
       (easy-menu-change '("tools") "Printing" pr-menu-spec pr-menu-print-item)
       (when pr-menu-print-item
        (easy-menu-remove-item nil '("tools") pr-menu-print-item)
@@ -3096,23 +3096,24 @@ Calls `pr-update-menus' to adjust menus."
                                  (pr-get-symbol "Printing")))))
      ;; Emacs 21 & 22
      (t
-      (let* ((has-file  (lookup-key global-map (vector 'menu-bar 'file)))
-            (item-file (if has-file '("file") '("files"))))
+      (let ((menu-file (if (= emacs-major-version 21)
+                          '("menu-bar" "files") ; Emacs 21
+                        '("menu-bar" "file")))) ; Emacs 22 or higher
        (cond
         (pr-menu-print-item
-         (easy-menu-change item-file "Print" pr-menu-spec "print-buffer")
-         (let ((items '("print-buffer"          "print-region"
-                        "ps-print-buffer-faces" "ps-print-region-faces"
-                        "ps-print-buffer"       "ps-print-region")))
-           (while items
-             (easy-menu-remove-item nil item-file (car items))
-             (setq items (cdr items)))
-           (setq pr-menu-print-item nil
-                 pr-menu-bar (vector 'menu-bar
-                                     (if has-file 'file 'files)
-                                     (pr-get-symbol "Print")))))
+         (easy-menu-add-item global-map menu-file
+                             (easy-menu-create-menu "Print" pr-menu-spec)
+                             "print-buffer")
+         (dolist (item '("print-buffer"          "print-region"
+                         "ps-print-buffer-faces" "ps-print-region-faces"
+                         "ps-print-buffer"       "ps-print-region"))
+           (easy-menu-remove-item global-map menu-file item))
+         (setq pr-menu-print-item nil
+               pr-menu-bar (vector 'menu-bar
+                                   (pr-get-symbol (nth 1 menu-file))
+                                   (pr-get-symbol "Print"))))
         (t
-         (easy-menu-change item-file "Print" pr-menu-spec))))))))
+         (easy-menu-change (cdr menu-file) "Print" pr-menu-spec))))))))
   (pr-update-menus t))
 
 
@@ -6054,7 +6055,9 @@ COMMAND.exe, COMMAND.bat and COMMAND.com in this order."
   ;; header
   (let ((versions (concat "printing v" pr-version
                          "    ps-print v" ps-print-version)))
-    (widget-insert (make-string (- 79 (length versions)) ?\s) versions))
+    ;; to keep compatibility with Emacs 20 & 21:
+    ;; DO NOT REPLACE `?\ ' BY `?\s'
+    (widget-insert (make-string (- 79 (length versions)) ?\ ) versions))
   (pr-insert-italic "\nCurrent Directory : " 1)
   (pr-insert-italic default-directory)
 
index 7015a24..c529e3a 100644 (file)
 ;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
-;;; This mode is a major mode for editing Ada83 and Ada95 source code.
-;;; This is a major rewrite of the file packaged with Emacs-20.  The
-;;; ada-mode is composed of four Lisp files, ada-mode.el, ada-xref.el,
-;;; ada-prj.el and ada-stmt.el. Only this file (ada-mode.el) is
-;;; completely independent from the GNU Ada compiler Gnat, distributed
-;;; by Ada Core Technologies. All the other files rely heavily on
-;;; features provided only by Gnat.
+;;; This mode is a major mode for editing Ada code.  This is a major
+;;; rewrite of the file packaged with Emacs-20.  The Ada mode is
+;;; composed of four Lisp files: ada-mode.el, ada-xref.el, ada-prj.el
+;;; and ada-stmt.el.  Only this file (ada-mode.el) is completely
+;;; independent from the GNU Ada compiler GNAT, distributed by Ada
+;;; Core Technologies.  All the other files rely heavily on features
+;;; provided only by GNAT.
 ;;;
 ;;; Note: this mode will not work with Emacs 19. If you are on a VMS
 ;;; system, where the latest version of Emacs is 19.28, you will need
@@ -77,7 +77,7 @@
 ;;; (yet) been recoded in this new mode.  Perhaps you prefer sticking
 ;;; to his version.
 ;;;
-;;; A complete rewrite for Emacs-20 / Gnat-3.11 has been done by Ada Core
+;;; A complete rewrite for Emacs-20 / GNAT-3.11 has been done by Ada Core
 ;;; Technologies.
 
 ;;; Credits:
 ;;;   `abbrev-mode': Provides the capability to define abbreviations, which
 ;;;      are automatically expanded when you type them. See the Emacs manual.
 
-(eval-when-compile
-  (require 'ispell nil t)
-  (require 'find-file nil t)
-  (require 'align nil t)
-  (require 'which-func nil t)
-  (require 'compile nil t))
+(require 'find-file nil t)
+(require 'align nil t)
+(require 'which-func nil t)
+(require 'compile nil t)
 
 (defvar compile-auto-highlight)
+(defvar ispell-check-comments)
 (defvar skeleton-further-elements)
 
-;; this function is needed at compile time
 (eval-and-compile
   (defun ada-check-emacs-version (major minor &optional is-xemacs)
     "Return t if Emacs's version is greater or equal to MAJOR.MINOR.
@@ -148,16 +146,10 @@ If IS-XEMACS is non-nil, check for XEmacs instead of Emacs."
               (and (= emacs-major-version major)
                    (>= emacs-minor-version minor)))))))
 
-
-;;  This call should not be made in the release that is done for the
-;;  official Emacs, since it does nothing useful for the latest version
-;;(if (not (ada-check-emacs-version 21 1))
-;;    (require 'ada-support))
-
 (defun ada-mode-version ()
   "Return Ada mode version."
   (interactive)
-  (let ((version-string "3.5"))
+  (let ((version-string "3.7"))
     (if (interactive-p)
        (message version-string)
       version-string)))
@@ -366,8 +358,8 @@ This is also used for <<..>> labels"
   :type 'integer :group 'ada)
 
 (defcustom ada-language-version 'ada95
-  "*Do we program in `ada83' or `ada95'?"
-  :type '(choice (const ada83) (const ada95)) :group 'ada)
+  "*Ada language version; one of `ada83', `ada95', `ada2005'."
+  :type '(choice (const ada83) (const ada95) (const ada2005)) :group 'ada)
 
 (defcustom ada-move-to-declaration nil
   "*Non-nil means `ada-move-to-start' moves to the subprogram declaration, not to 'begin'."
@@ -445,7 +437,7 @@ An example is:
   "*Name of the compiler to use.
 This will determine what features are made available through the Ada mode.
 The possible choices are:
-`gnat': Use Ada Core Technologies' Gnat compiler.  Add some cross-referencing
+`gnat': Use Ada Core Technologies' GNAT compiler.  Add some cross-referencing
     features.
 `generic': Use a generic compiler."
   :type '(choice (const gnat)
@@ -480,6 +472,7 @@ The extensions should include a `.' if needed.")
   "Syntax table for Ada, where `_' is a word constituent.")
 
 (eval-when-compile
+  ;; These values are used in eval-when-compile expressions.
   (defconst ada-83-string-keywords
     '("abort" "abs" "accept" "access" "all" "and" "array" "at" "begin"
       "body" "case" "constant" "declare" "delay" "delta" "digits" "do"
@@ -489,8 +482,18 @@ The extensions should include a `.' if needed.")
       "procedure" "raise" "range" "record" "rem" "renames" "return"
       "reverse" "select" "separate" "subtype" "task" "terminate" "then"
       "type" "use" "when" "while" "with" "xor")
-    "List of Ada keywords.
-This variable is used to define `ada-83-keywords' and `ada-95-keywords'."))
+    "List of Ada 83 keywords.
+Used to define `ada-*-keywords'.")
+
+  (defconst ada-95-string-keywords
+    '("abstract" "aliased" "protected" "requeue" "tagged" "until")
+    "List of keywords new in Ada 95.
+Used to define `ada-*-keywords'.")
+
+  (defconst ada-2005-string-keywords
+    '("interface" "overriding" "synchronized")
+    "List of keywords new in Ada 2005.
+Used to define `ada-*-keywords.'"))
 
 (defvar ada-ret-binding nil
   "Variable to save key binding of RET when casing is activated.")
@@ -541,24 +544,25 @@ See `align-mode-alist' for more information.")
 This variable defines several rules to use to align different lines.")
 
 (defconst ada-align-region-separate
-  (concat
-   "^\\s-*\\($\\|\\("
-   "begin\\|"
-   "declare\\|"
-   "else\\|"
-   "end\\|"
-   "exception\\|"
-   "for\\|"
-   "function\\|"
-   "generic\\|"
-   "if\\|"
-   "is\\|"
-   "procedure\\|"
-   "record\\|"
-   "return\\|"
-   "type\\|"
-   "when"
-   "\\)\\>\\)")
+  (eval-when-compile
+    (concat
+     "^\\s-*\\($\\|\\("
+     "begin\\|"
+     "declare\\|"
+     "else\\|"
+     "end\\|"
+     "exception\\|"
+     "for\\|"
+     "function\\|"
+     "generic\\|"
+     "if\\|"
+     "is\\|"
+     "procedure\\|"
+     "record\\|"
+     "return\\|"
+     "type\\|"
+     "when"
+     "\\)\\>\\)"))
   "See the variable `align-region-separate' for more information.")
 
 ;;; ---- Below are the regexp used in this package for parsing
@@ -566,29 +570,38 @@ This variable defines several rules to use to align different lines.")
 (defconst ada-83-keywords
   (eval-when-compile
     (concat "\\<" (regexp-opt ada-83-string-keywords t) "\\>"))
-  "Regular expression for looking at Ada83 keywords.")
+  "Regular expression matching Ada83 keywords.")
 
 (defconst ada-95-keywords
   (eval-when-compile
     (concat "\\<" (regexp-opt
                   (append
-                   '("abstract" "aliased" "protected" "requeue"
-                     "tagged" "until")
+                   ada-95-string-keywords
                    ada-83-string-keywords) t) "\\>"))
-  "Regular expression for looking at Ada95 keywords.")
+  "Regular expression matching Ada95 keywords.")
 
-(defvar ada-keywords ada-95-keywords
-  "Regular expression for looking at Ada keywords.")
+(defconst ada-2005-keywords
+  (eval-when-compile
+    (concat "\\<" (regexp-opt
+                  (append
+                   ada-2005-string-keywords
+                   ada-83-string-keywords
+                   ada-95-string-keywords) t) "\\>"))
+  "Regular expression matching Ada2005 keywords.")
+
+(defvar ada-keywords ada-2005-keywords
+  "Regular expression matching Ada keywords.")
+;; FIXME: make this customizable
 
 (defconst ada-ident-re
   "\\(\\sw\\|[_.]\\)+"
   "Regexp matching Ada (qualified) identifiers.")
 
-;;  "with" needs to be included in the regexp, so that we can insert new lines
-;;  after the declaration of the parameter for a generic.
+;;  "with" needs to be included in the regexp, to match generic subprogram parameters
+;;  Similarly, we put '[not] overriding' on the same line with 'procedure' etc.
 (defvar ada-procedure-start-regexp
   (concat
-   "^[ \t]*\\(with[ \t]+\\)?\\(procedure\\|function\\|task\\)[ \t\n]+"
+   "^[ \t]*\\(with[ \t]+\\)?\\(\\(not[ \t]+\\)?overriding[ \t]+\\)?\\(procedure\\|function\\|task\\)[ \t\n]+"
 
    ;;  subprogram name: operator ("[+/=*]")
    "\\("
@@ -598,11 +611,21 @@ This variable defines several rules to use to align different lines.")
    "\\|"
    "\\(\\(\\sw\\|[_.]\\)+\\)"
    "\\)")
-  "Regexp used to find Ada procedures/functions.")
+  "Regexp matching Ada subprogram start.
+The actual start is at (match-beginning 4). The name is in (match-string 5).")
 
-(defvar ada-package-start-regexp
-  "^[ \t]*\\(package\\)"
-  "Regexp used to find Ada packages.")
+(defconst ada-name-regexp
+  "\\([a-zA-Z][a-zA-Z0-9_.']*[a-zA-Z0-9]\\)"
+  "Regexp matching a fully qualified name (including attribute).")
+
+(defconst ada-package-start-regexp
+  (concat "^[ \t]*\\(private[ \t]+\\)?\\(package\\)[ \t\n]+\\(body[ \t]*\\)?" ada-name-regexp)
+  "Regexp matching start of package.
+The package name is in (match-string 4).")
+
+(defconst ada-compile-goto-error-file-linenr-re
+  "\\([-_.a-zA-Z0-9]+\\):\\([0-9]+\\)\\(:\\([0-9]+\\)\\)?"
+  "Regexp matching filename:linenr[:column].")
 
 
 ;;; ---- regexps for indentation functions
@@ -635,8 +658,8 @@ A new statement starts after these.")
   (eval-when-compile
     (concat "\\<"
            (regexp-opt
-            '("end" "loop" "select" "begin" "case" "do"
-              "if" "task" "package" "record" "protected") t)
+            '("end" "loop" "select" "begin" "case" "do" "declare"
+              "if" "task" "package" "procedure" "function" "record" "protected") t)
            "\\>"))
   "Regexp used in `ada-goto-matching-start'.")
 
@@ -753,40 +776,42 @@ the 4 file locations can be clicked on and jumped to."
   (skip-chars-backward "-a-zA-Z0-9_:./\\")
   (cond
    ;;  special case: looking at a filename:line not at the beginning of a line
+   ;;  or a simple line reference "at line ..."
    ((and (not (bolp))
-        (looking-at
-         "\\([-_.a-zA-Z0-9]+\\):\\([0-9]+\\)\\(:\\([0-9]+\\)\\)?"))
-    (let ((line (match-string 2))
-         file
+        (or (looking-at ada-compile-goto-error-file-linenr-re)
+            (and
+             (save-excursion
+               (beginning-of-line)
+               (looking-at ada-compile-goto-error-file-linenr-re))
+             (save-excursion
+               (if (looking-at "\\([0-9]+\\)") (backward-word 1))
+               (looking-at "line \\([0-9]+\\)"))))
+            )
+    (let ((line (if (match-beginning 2) (match-string 2) (match-string 1)))
+         (file (if (match-beginning 2) (match-string 1)
+                 (save-excursion (beginning-of-line)
+                                 (looking-at ada-compile-goto-error-file-linenr-re)
+                                 (match-string 1))))
          (error-pos (point-marker))
          source)
+
+      ;; set source marker
       (save-excursion
-       (save-restriction
-         (widen)
-         ;;  Use funcall so as to prevent byte-compiler warnings
-         ;;  `ada-find-file' is not defined if ada-xref wasn't loaded. But
-         ;;  if we can find it, we should use it instead of
-         ;;  `compilation-find-file', since the latter doesn't know anything
-         ;;  about source path.
-
-         (if (functionp 'ada-find-file)
-             (setq file (funcall (symbol-function 'ada-find-file)
-                                 (match-string 1)))
-           (setq file (funcall (symbol-function 'compilation-find-file)
-                               (point-marker) (match-string 1)
-                               "./")))
-         (set-buffer file)
-
-         (if (stringp line)
-             (goto-line (string-to-number line)))
-         (setq source (point-marker))))
-      (funcall (symbol-function 'compilation-goto-locus)
-              (cons source error-pos))
+        (compilation-find-file (point-marker) (match-string 1) "./")
+        (set-buffer file)
+
+        (if (stringp line)
+            (goto-line (string-to-number line)))
+
+        (setq source (point-marker)))
+
+      (compilation-goto-locus error-pos source nil)
+
       ))
 
    ;; otherwise, default behavior
    (t
-    (funcall (symbol-function 'compile-goto-error)))
+    (compile-goto-error))
    )
   (recenter))
 
@@ -1216,36 +1241,36 @@ If you use ada-xref.el:
        ff-file-created-hook 'ada-make-body)
   (add-hook 'ff-pre-load-hook 'ada-which-function-are-we-in)
 
-  ;; Some special constructs for find-file.el.
   (make-local-variable 'ff-special-constructs)
-  (mapc (lambda (pair)
-         (add-to-list 'ff-special-constructs pair))
-       `(
-         ;; Go to the parent package.
-         (,(eval-when-compile
-             (concat "^\\(private[ \t]\\)?[ \t]*package[ \t]+"
-                     "\\(body[ \t]+\\)?"
-                     "\\(\\(\\sw\\|[_.]\\)+\\)\\.\\(\\sw\\|_\\)+[ \t\n]+is"))
-          . ,(lambda ()
-               (ff-get-file
-                ada-search-directories-internal
-                (ada-make-filename-from-adaname (match-string 3))
-                ada-spec-suffixes)))
-         ;; A "separate" clause.
-         ("^separate[ \t\n]*(\\(\\(\\sw\\|[_.]\\)+\\))"
-          . ,(lambda ()
-               (ff-get-file
-                ada-search-directories-internal
-                (ada-make-filename-from-adaname (match-string 1))
-                ada-spec-suffixes)))
-         ;; A "with" clause.
-         ("^with[ \t]+\\([a-zA-Z0-9_\\.]+\\)"
-          . ,(lambda ()
-               (ff-get-file
-                ada-search-directories-internal
-                (ada-make-filename-from-adaname (match-string 1))
-                ada-spec-suffixes)))
-         ))
+  (mapc (lambda (pair) (add-to-list 'ff-special-constructs pair))
+        (list
+         ;; Top level child package declaration; go to the parent package.
+         (cons (eval-when-compile
+                 (concat "^\\(private[ \t]\\)?[ \t]*package[ \t]+"
+                         "\\(body[ \t]+\\)?"
+                         "\\(\\(\\sw\\|[_.]\\)+\\)\\.\\(\\sw\\|_\\)+[ \t\n]+is"))
+               (lambda ()
+                 (ff-get-file
+                  ada-search-directories-internal
+                  (ada-make-filename-from-adaname (match-string 3))
+                  ada-spec-suffixes)))
+
+         ;; A "separate" clause.
+         (cons "^separate[ \t\n]*(\\(\\(\\sw\\|[_.]\\)+\\))"
+               (lambda ()
+                 (ff-get-file
+                  ada-search-directories-internal
+                  (ada-make-filename-from-adaname (match-string 1))
+                  ada-spec-suffixes)))
+
+         ;; A "with" clause.
+         (cons "^with[ \t]+\\([a-zA-Z0-9_\\.]+\\)"
+               (lambda ()
+                 (ff-get-file
+                  ada-search-directories-internal
+                  (ada-make-filename-from-adaname (match-string 1))
+                  ada-spec-suffixes)))
+         ))
 
   ;;  Support for outline-minor-mode
   (set (make-local-variable 'outline-regexp)
@@ -1258,59 +1283,49 @@ If you use ada-xref.el:
   ;;  Support for ispell : Check only comments
   (set (make-local-variable 'ispell-check-comments) 'exclusive)
 
-  ;;  Support for align.el <= 2.2, if present
-  ;;  align.el is distributed with Emacs 21, but not with earlier versions.
-  (if (boundp 'align-mode-alist)
-      (add-to-list 'align-mode-alist '(ada-mode . ada-align-list)))
-
-  ;;  Support for align.el >= 2.8, if present
-  (if (boundp 'align-dq-string-modes)
-      (progn
-       (add-to-list 'align-dq-string-modes 'ada-mode)
-       (add-to-list 'align-open-comment-modes 'ada-mode)
-       (set (make-local-variable 'align-region-separate)
-            ada-align-region-separate)
-
-       ;; Exclude comments alone on line from alignment.
-       (add-to-list 'align-exclude-rules-list
-                    '(ada-solo-comment
-                      (regexp  . "^\\(\\s-*\\)--")
-                      (modes   . '(ada-mode))))
-       (add-to-list 'align-exclude-rules-list
-                    '(ada-solo-use
-                      (regexp  . "^\\(\\s-*\\)\\<use\\>")
-                      (modes   . '(ada-mode))))
-
-       (setq ada-align-modes nil)
-
-       (add-to-list 'ada-align-modes
-                    '(ada-declaration-assign
-                      (regexp  . "[^:]\\(\\s-*\\):[^:]")
-                      (valid   . (lambda() (not (ada-in-comment-p))))
-                      (repeat . t)
-                      (modes   . '(ada-mode))))
-       (add-to-list 'ada-align-modes
-                    '(ada-associate
-                      (regexp  . "[^=]\\(\\s-*\\)=>")
-                      (valid   . (lambda() (not (ada-in-comment-p))))
-                      (modes   . '(ada-mode))))
-       (add-to-list 'ada-align-modes
-                    '(ada-comment
-                      (regexp  . "\\(\\s-*\\)--")
-                      (modes   . '(ada-mode))))
-       (add-to-list 'ada-align-modes
-                    '(ada-use
-                      (regexp  . "\\(\\s-*\\)\\<use\\s-")
-                      (valid   . (lambda() (not (ada-in-comment-p))))
-                      (modes   . '(ada-mode))))
-       (add-to-list 'ada-align-modes
-                    '(ada-at
-                      (regexp . "\\(\\s-+\\)at\\>")
-                      (modes . '(ada-mode))))
-
-
-       (setq align-mode-rules-list ada-align-modes)
-       ))
+  ;;  Support for align
+  (add-to-list 'align-dq-string-modes 'ada-mode)
+  (add-to-list 'align-open-comment-modes 'ada-mode)
+  (set (make-local-variable 'align-region-separate) ada-align-region-separate)
+
+  ;; Exclude comments alone on line from alignment.
+  (add-to-list 'align-exclude-rules-list
+               '(ada-solo-comment
+                 (regexp  . "^\\(\\s-*\\)--")
+                 (modes   . '(ada-mode))))
+  (add-to-list 'align-exclude-rules-list
+               '(ada-solo-use
+                 (regexp  . "^\\(\\s-*\\)\\<use\\>")
+                 (modes   . '(ada-mode))))
+
+  (setq ada-align-modes nil)
+
+  (add-to-list 'ada-align-modes
+               '(ada-declaration-assign
+                 (regexp  . "[^:]\\(\\s-*\\):[^:]")
+                 (valid   . (lambda() (not (ada-in-comment-p))))
+                 (repeat . t)
+                 (modes   . '(ada-mode))))
+  (add-to-list 'ada-align-modes
+               '(ada-associate
+                 (regexp  . "[^=]\\(\\s-*\\)=>")
+                 (valid   . (lambda() (not (ada-in-comment-p))))
+                 (modes   . '(ada-mode))))
+  (add-to-list 'ada-align-modes
+               '(ada-comment
+                 (regexp  . "\\(\\s-*\\)--")
+                 (modes   . '(ada-mode))))
+  (add-to-list 'ada-align-modes
+               '(ada-use
+                 (regexp  . "\\(\\s-*\\)\\<use\\s-")
+                 (valid   . (lambda() (not (ada-in-comment-p))))
+                 (modes   . '(ada-mode))))
+  (add-to-list 'ada-align-modes
+               '(ada-at
+                 (regexp . "\\(\\s-+\\)at\\>")
+                 (modes . '(ada-mode))))
+
+  (setq align-mode-rules-list ada-align-modes)
 
   ;;  Set up the contextual menu
   (if ada-popup-key
@@ -1321,12 +1336,6 @@ If you use ada-xref.el:
   (setq local-abbrev-table ada-mode-abbrev-table)
 
   ;;  Support for which-function mode
-  ;; which-function-mode does not work with nested subprograms, since it is
-  ;; based only on the regexps generated by imenu, and thus can only detect the
-  ;; beginning of subprograms, not the end.
-  ;; Fix is: redefine a new function ada-which-function, and call it when the
-  ;; major-mode is ada-mode.
-
   (make-local-variable 'which-func-functions)
   (setq which-func-functions '(ada-which-function))
 
@@ -1379,7 +1388,9 @@ If you use ada-xref.el:
   (cond ((eq ada-language-version 'ada83)
         (setq ada-keywords ada-83-keywords))
        ((eq ada-language-version 'ada95)
-        (setq ada-keywords ada-95-keywords)))
+        (setq ada-keywords ada-95-keywords))
+       ((eq ada-language-version 'ada2005)
+        (setq ada-keywords ada-2005-keywords)))
 
   (if ada-auto-case
       (ada-activate-keys-for-case)))
@@ -3412,9 +3423,14 @@ is the end of the match."
                                       (concat "\\<"
                                               (regexp-opt
                                                '("separate" "access" "array"
-                                                 "abstract" "new") t)
+                                                 "private" "abstract" "new") t)
                                               "\\>\\|("))))))))
 
+        ((looking-at "private")
+         (save-excursion
+           (backward-word 1)
+           (setq found (not (looking-at "is")))))
+
         (t
          (setq found t))
        )))
@@ -3509,10 +3525,10 @@ Moves point to the beginning of the declaration."
     ;;
     (save-excursion
       ;;
-      ;; a named 'declare'-block ?
+      ;; a named 'declare'-block ? => jump to the label
       ;;
       (if (looking-at "\\<declare\\>")
-         (ada-goto-stmt-start)
+         (backward-word 1)
        ;;
        ;; no, => 'procedure'/'function'/'task'/'protected'
        ;;
@@ -3702,6 +3718,14 @@ If NOERROR is non-nil, it only returns nil if no matching start was found.
 If GOTOTHEN is non-nil, point moves to the 'then' following 'if'."
   (let ((nest-count (if nest-level nest-level 0))
        (found nil)
+
+       (last-was-begin '())
+       ;;  List all keywords encountered while traversing
+       ;;  something like '("end" "end" "begin")
+       ;;  This is removed from the list when "package", "procedure",...
+       ;;  are seen. The goal is to find whether a package has an elaboration
+       ;;  part
+
        (pos nil))
 
     ;; search backward for interesting keywords
@@ -3718,6 +3742,7 @@ If GOTOTHEN is non-nil, point moves to the 'then' following 'if'."
          (cond
           ;; found block end => increase nest depth
           ((looking-at "end")
+           (push nil last-was-begin)
            (setq nest-count (1+ nest-count)))
 
           ;; found loop/select/record/case/if => check if it starts or
@@ -3728,13 +3753,24 @@ If GOTOTHEN is non-nil, point moves to the 'then' following 'if'."
              ;; check if keyword follows 'end'
              (ada-goto-previous-word)
              (if (looking-at "\\<end\\>[ \t]*[^;]")
-                 ;; it ends a block => increase nest depth
-                 (setq nest-count (1+ nest-count)
-                       pos        (point))
+                 (progn
+                   ;; it ends a block => increase nest depth
+                   (setq nest-count (1+ nest-count)
+                         pos        (point))
+                   (push nil last-was-begin))
 
                ;; it starts a block => decrease nest depth
-               (setq nest-count (1- nest-count))))
-           (goto-char pos))
+               (setq nest-count (1- nest-count))
+
+               ;; Some nested  "begin .. end" blocks with no "declare"?
+               ;;  => remove those entries
+               (while (car last-was-begin)
+                 (setq last-was-begin (cdr (cdr last-was-begin))))
+
+               (setq last-was-begin (cdr last-was-begin))
+               ))
+           (goto-char pos)
+           )
 
           ;; found package start => check if it really is a block
           ((looking-at "package")
@@ -3758,8 +3794,12 @@ If GOTOTHEN is non-nil, point moves to the 'then' following 'if'."
                  ;;  or            package Foo is separate;
                  ;;  or            package Foo is begin null; end Foo
                  ;;                     for elaboration code (elaboration)
-                 (if (not (looking-at "\\<\\(new\\|separate\\|begin\\)\\>"))
-                     (setq nest-count (1- nest-count)))))))
+                 (if (and (not (looking-at "\\<\\(new\\|separate\\|begin\\)\\>"))
+                          (not (car last-was-begin)))
+                     (setq nest-count (1- nest-count))))))
+
+           (setq last-was-begin (cdr last-was-begin))
+           )
           ;; found task start => check if it has a body
           ((looking-at "task")
            (save-excursion
@@ -3791,10 +3831,53 @@ If GOTOTHEN is non-nil, point moves to the 'then' following 'if'."
                ;; it (i.e do nothing if we have just "task name;")
                (unless (progn (forward-word 1)
                               (looking-at "[ \t]*;"))
-                 (setq nest-count (1- nest-count)))))))
+                 (setq nest-count (1- nest-count))))))
+           (setq last-was-begin (cdr last-was-begin))
+           )
+
+          ((looking-at "declare")
+           ;;  remove entry for begin and end (include nested begin..end
+           ;;  groups)
+           (setq last-was-begin (cdr last-was-begin))
+           (let ((count 1))
+             (while (and (> count 0))
+               (if (equal (car last-was-begin) t)
+                   (setq count (1+ count))
+                 (setq count (1- count)))
+               (setq last-was-begin (cdr last-was-begin))
+               )))
+
+          ((looking-at "protected")
+           ;; Ignore if this is just a declaration
+           (save-excursion
+             (let ((pos (ada-search-ignore-string-comment
+                         "\\(\\<is\\>\\|\\<renames\\>\\|;\\)" nil)))
+               (if pos
+                   (goto-char (car pos)))
+               (if (looking-at "is")
+                   ;;  remove entry for end
+                   (setq last-was-begin (cdr last-was-begin)))))
+           (setq nest-count     (1- nest-count)))
+
+          ((or (looking-at "procedure")
+               (looking-at "function"))
+           ;; Ignore if this is just a declaration
+           (save-excursion
+             (let ((pos (ada-search-ignore-string-comment
+                         "\\(\\<is\\>\\|\\<renames\\>\\|)[ \t]*;\\)" nil)))
+               (if pos
+                   (goto-char (car pos)))
+               (if (looking-at "is")
+                   ;;  remove entry for begin and end
+                   (setq last-was-begin (cdr (cdr last-was-begin))))))
+           )
+
           ;; all the other block starts
           (t
-           (setq nest-count (1- nest-count)))) ; end of 'cond'
+           (push (looking-at "begin") last-was-begin)
+           (setq nest-count (1- nest-count)))
+
+          )
 
          ;; match is found, if nest-depth is zero
          (setq found (zerop nest-count))))) ; end of loop
@@ -4430,7 +4513,7 @@ Moves to 'begin' if in a declarative part."
   (interactive)
   (end-of-line)
   (if (re-search-forward ada-procedure-start-regexp nil t)
-      (goto-char (match-beginning 2))
+      (goto-char (match-beginning 4))
     (error "No more functions/procedures/tasks")))
 
 (defun ada-previous-procedure ()
@@ -4438,7 +4521,7 @@ Moves to 'begin' if in a declarative part."
   (interactive)
   (beginning-of-line)
   (if (re-search-backward ada-procedure-start-regexp nil t)
-      (goto-char (match-beginning 2))
+      (goto-char (match-beginning 4))
     (error "No more functions/procedures/tasks")))
 
 (defun ada-next-package ()
@@ -4525,6 +4608,7 @@ Moves to 'begin' if in a declarative part."
   (define-key ada-mode-map "\C-cc"     'ada-change-prj)
   (define-key ada-mode-map "\C-cd"     'ada-set-default-project-file)
   (define-key ada-mode-map "\C-cg"     'ada-gdb-application)
+  (define-key ada-mode-map "\C-c\C-m"  'ada-set-main-compile-application)
   (define-key ada-mode-map "\C-cr"     'ada-run-application)
   (define-key ada-mode-map "\C-c\C-o"  'ada-goto-parent)
   (define-key ada-mode-map "\C-c\C-r"  'ada-find-references)
@@ -4582,8 +4666,7 @@ Moves to 'begin' if in a declarative part."
               (eq ada-which-compiler 'gnat)]
              ["Gdb Documentation"      (info "gdb")
               (eq ada-which-compiler 'gnat)]
-             ["Ada95 Reference Manual" (info "arm95")
-              (eq ada-which-compiler 'gnat)])
+             ["Ada95 Reference Manual" (info "arm95") t])
             ("Options"  :included (eq major-mode 'ada-mode)
              ["Auto Casing" (setq ada-auto-case (not ada-auto-case))
               :style toggle :selected ada-auto-case]
@@ -4610,11 +4693,14 @@ Moves to 'begin' if in a declarative part."
              :included (fboundp 'customize-group)]
             ["Check file"    ada-check-current   t]
             ["Compile file"  ada-compile-current t]
+            ["Set main and Build" ada-set-main-compile-application t]
+            ["Show main" ada-show-current-main t]
             ["Build"         ada-compile-application t]
             ["Run"           ada-run-application     t]
             ["Debug"         ada-gdb-application (eq ada-which-compiler 'gnat)]
             ["------"        nil nil]
             ("Project"
+             ["Show project" ada-show-current-project t]
              ["Load..."      ada-set-default-project-file t]
              ["New..."       ada-prj-new                  t]
              ["Edit..."      ada-prj-edit                 t])
@@ -4958,13 +5044,14 @@ or the spec otherwise."
 
 (defun ada-which-function-are-we-in ()
   "Return the name of the function whose definition/declaration point is in.
-Redefines the function `ff-which-function-are-we-in'."
+Used in `ff-pre-load-hook'."
   (setq ff-function-name nil)
   (save-excursion
     (end-of-line);;  make sure we get the complete name
-    (if (or (re-search-backward ada-procedure-start-regexp nil t)
-           (re-search-backward ada-package-start-regexp nil t))
-       (setq ff-function-name (match-string 0)))
+    (or (if (re-search-backward ada-procedure-start-regexp nil t)
+            (setq ff-function-name (match-string 5)))
+        (if (re-search-backward ada-package-start-regexp nil t)
+            (setq ff-function-name (match-string 4))))
     ))
 
 
@@ -5162,11 +5249,11 @@ Return nil if no body was found."
              '("abort" "abs" "abstract" "accept" "access" "aliased" "all"
                "and" "array" "at" "begin" "case" "declare" "delay" "delta"
                "digits" "do" "else" "elsif" "entry" "exception" "exit" "for"
-               "generic" "if" "in" "is" "limited" "loop" "mod" "not"
-               "null" "or" "others" "private" "protected" "raise"
+               "generic" "if" "in" "interface" "is" "limited" "loop" "mod" "not"
+               "null" "or" "others" "overriding" "private" "protected" "raise"
                "range" "record" "rem" "renames" "requeue" "return" "reverse"
-               "select" "separate" "tagged" "task" "terminate" "then" "until"
-               "when" "while" "with" "xor") t)
+               "select" "separate" "synchronized" "tagged" "task" "terminate"
+                "then" "until" "when" "while" "with" "xor") t)
             "\\>")
      ;;
      ;; Anything following end and not already fontified is a body name.
@@ -5324,10 +5411,8 @@ for `ada-procedure-start-regexp'."
 
 (defun ada-make-body ()
   "Create an Ada package body in the current buffer.
-The potential old buffer contents is deleted first, then we copy the
-spec buffer in here and modify it to make it a body.
-This function typically is to be hooked into `ff-file-created-hooks'."
-  (interactive)
+The spec must be the previously visited buffer.
+This function typically is to be hooked into `ff-file-created-hook'."
   (delete-region (point-min) (point-max))
   (insert-buffer-substring (car (cdr (buffer-list))))
   (goto-char (point-min))
@@ -5358,7 +5443,7 @@ This function typically is to be hooked into `ff-file-created-hooks'."
 
 
 (defun ada-make-subprogram-body ()
-  "Make one dummy subprogram body from spec surrounding point."
+  "Create a dummy subprogram body in package body file from spec surrounding point."
   (interactive)
   (let* ((found (re-search-backward ada-procedure-start-regexp nil t))
         (spec  (match-beginning 0))
@@ -5417,35 +5502,34 @@ This function typically is to be hooked into `ff-file-created-hooks'."
 (ada-case-read-exceptions)
 
 ;;  Setup auto-loading of the other Ada mode files.
-(if (equal ada-which-compiler 'gnat)
-    (progn
-      (autoload 'ada-change-prj                   "ada-xref" nil t)
-      (autoload 'ada-check-current                "ada-xref" nil t)
-      (autoload 'ada-compile-application          "ada-xref" nil t)
-      (autoload 'ada-compile-current              "ada-xref" nil t)
-      (autoload 'ada-complete-identifier          "ada-xref" nil t)
-      (autoload 'ada-find-file                    "ada-xref" nil t)
-      (autoload 'ada-find-any-references          "ada-xref" nil t)
-      (autoload 'ada-find-src-file-in-dir         "ada-xref" nil t)
-      (autoload 'ada-find-local-references        "ada-xref" nil t)
-      (autoload 'ada-find-references              "ada-xref" nil t)
-      (autoload 'ada-gdb-application              "ada-xref" nil t)
-      (autoload 'ada-goto-declaration             "ada-xref" nil t)
-      (autoload 'ada-goto-declaration-other-frame "ada-xref" nil t)
-      (autoload 'ada-goto-parent                  "ada-xref" nil t)
-      (autoload 'ada-make-body-gnatstub           "ada-xref" nil t)
-      (autoload 'ada-point-and-xref               "ada-xref" nil t)
-      (autoload 'ada-reread-prj-file              "ada-xref" nil t)
-      (autoload 'ada-run-application              "ada-xref" nil t)
-      (autoload 'ada-set-default-project-file     "ada-xref" nil nil)
-      (autoload 'ada-set-default-project-file     "ada-xref" nil t)
-      (autoload 'ada-xref-goto-previous-reference "ada-xref" nil t)
-
-      (autoload 'ada-customize                    "ada-prj"  nil t)
-      (autoload 'ada-prj-edit                     "ada-prj"  nil t)
-      (autoload 'ada-prj-new                      "ada-prj"  nil t)
-      (autoload 'ada-prj-save                     "ada-prj"  nil t)
-      ))
+(autoload 'ada-change-prj                   "ada-xref" nil t)
+(autoload 'ada-check-current                "ada-xref" nil t)
+(autoload 'ada-compile-application          "ada-xref" nil t)
+(autoload 'ada-compile-current              "ada-xref" nil t)
+(autoload 'ada-complete-identifier          "ada-xref" nil t)
+(autoload 'ada-find-file                    "ada-xref" nil t)
+(autoload 'ada-find-any-references          "ada-xref" nil t)
+(autoload 'ada-find-src-file-in-dir         "ada-xref" nil t)
+(autoload 'ada-find-local-references        "ada-xref" nil t)
+(autoload 'ada-find-references              "ada-xref" nil t)
+(autoload 'ada-gdb-application              "ada-xref" nil t)
+(autoload 'ada-goto-declaration             "ada-xref" nil t)
+(autoload 'ada-goto-declaration-other-frame "ada-xref" nil t)
+(autoload 'ada-goto-parent                  "ada-xref" nil t)
+(autoload 'ada-make-body-gnatstub           "ada-xref" nil t)
+(autoload 'ada-point-and-xref               "ada-xref" nil t)
+(autoload 'ada-reread-prj-file              "ada-xref" nil t)
+(autoload 'ada-run-application              "ada-xref" nil t)
+(autoload 'ada-set-default-project-file     "ada-xref" nil nil)
+(autoload 'ada-set-default-project-file     "ada-xref" nil t)
+(autoload 'ada-xref-goto-previous-reference "ada-xref" nil t)
+(autoload 'ada-set-main-compile-application "ada-xref" nil t)
+(autoload 'ada-show-current-main            "ada-xref" nil t)
+
+(autoload 'ada-customize                    "ada-prj"  nil t)
+(autoload 'ada-prj-edit                     "ada-prj"  nil t)
+(autoload 'ada-prj-new                      "ada-prj"  nil t)
+(autoload 'ada-prj-save                     "ada-prj"  nil t)
 
 (autoload 'ada-array           "ada-stmt" nil t)
 (autoload 'ada-case            "ada-stmt" nil t)
index 1d42a39..e1906df 100644 (file)
@@ -1,9 +1,10 @@
-;;; ada-prj.el --- easy editing of project files for the ada-mode
+;;; ada-prj.el --- GUI editing of project files for the ada-mode
 
-;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 
+;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
 ;; Free Software Foundation, Inc.
 
 ;; Author: Emmanuel Briot <briot@gnat.com>
+;; Maintainer: Stephen Leake <stephen_leake@stephe-leake.org>
 ;; Keywords: languages, ada, project file
 
 ;; This file is part of GNU Emacs.
 ;;; Internally, a project file is represented as a property list, with each
 ;;; field of the project file matching one property of the list.
 
+
+;;; History:
+;;
+
 ;;; Code:
 
 
@@ -64,7 +69,7 @@
 ;; ----- Functions --------------------------------------------------------
 
 (defun ada-prj-new ()
-  "Open a new project file"
+  "Open a new project file."
   (interactive)
   (let* ((prj
          (if (and ada-prj-default-project-file
@@ -93,7 +98,7 @@ If there is none, opens a new project file"
   "Set SYMBOL to the property list of the project file FILENAME.
 If FILENAME is null, read the file associated with ADA-BUFFER. If no
 project file is found, returns the default values."
-
+;; FIXME: rationalize arguments; make ada-buffer optional?
   (if (and filename
           (not (string= filename ""))
           (assoc filename ada-xref-project-files))
@@ -108,7 +113,7 @@ project file is found, returns the default values."
 
 
 (defun ada-prj-save-specific-option (field)
-  "Returns the string to print in the project file to save FIELD.
+  "Return the string to print in the project file to save FIELD.
 If the current value of FIELD is the default value, returns an empty string."
   (if (string= (plist-get ada-prj-current-values field)
               (plist-get ada-prj-default-values field))
@@ -170,7 +175,7 @@ If the current value of FIELD is the default value, returns an empty string."
     (kill-buffer nil)
 
     ;; kill the editor buffer
-    (kill-buffer "*Customize Ada Mode*")
+    (kill-buffer "*Edit Ada Mode Project*")
 
     ;; automatically set the new project file as the active one
     (set 'ada-prj-default-project-file file-name)
@@ -208,7 +213,7 @@ If the current value of FIELD is the default value, returns an empty string."
   ))
 
 (defun ada-prj-subdirs-of (dir)
-  "Returns a list of all the subdirectories of dir, recursively."
+  "Return a list of all the subdirectories of DIR, recursively."
   (let ((subdirs (directory-files dir t "^[^.].*"))
        (dirlist (list dir)))
     (while subdirs
@@ -220,7 +225,7 @@ If the current value of FIELD is the default value, returns an empty string."
     dirlist))
 
 (defun ada-prj-load-directory (field &optional file-name)
-  "Append the content of FILE-NAME to FIELD in the current project file.
+  "Append to FIELD in the current project the subdirectories of FILE-NAME.
 If FILE-NAME is nil, ask the user for the name."
 
   ;;  Do not use an external dialog for this, since it wouldn't allow
@@ -238,8 +243,7 @@ If FILE-NAME is nil, ask the user for the name."
   (ada-prj-display-page 2))
 
 (defun ada-prj-display-page (tab-num)
-  "Display one of the pages available in the notebook. TAB-NUM should have
-a value between 1 and the maximum number of pages.
+  "Display page TAB-NUM in the notebook.
 The current buffer must be the project editing buffer."
 
   (let ((inhibit-read-only t))
@@ -255,7 +259,7 @@ The current buffer must be the project editing buffer."
 
   ;;  Display the tabs
 
-  (widget-insert "\n               Project and Editor configuration.\n
+  (widget-insert "\n               Project configuration.\n
   ___________    ____________    ____________    ____________    ____________\n / ")
   (widget-create 'push-button :notify
                 (lambda (&rest dummy) (ada-prj-display-page 1)) "General")
@@ -346,9 +350,9 @@ Note that src_dir includes both the build directory
 and the standard runtime."
       t t
       (mapconcat (lambda(x)
-                   (concat "           " x))
-                 ada-xref-runtime-library-specs-path
-                 "\n")
+                  (concat "           " x))
+                ada-xref-runtime-library-specs-path
+                "\n")
       )
     (widget-insert "\n\n")
 
@@ -361,9 +365,9 @@ Note that obj_dir includes both the build directory
 and the standard runtime."
       t t
       (mapconcat (lambda(x)
-                   (concat "           " x))
-                 ada-xref-runtime-library-ali-path
-                 "\n")
+                  (concat "           " x))
+                ada-xref-runtime-library-ali-path
+                "\n")
       )
     (widget-insert "\n\n")
     )
@@ -512,7 +516,7 @@ If FILENAME is given, edit that file."
          (ada-reread-prj-file)))
 
       ;;  Else start the interactive editor
-      (switch-to-buffer "*Customize Ada Mode*")
+      (switch-to-buffer "*Edit Ada Mode Project*")
 
       (ada-xref-set-default-prj-values 'ada-prj-default-values ada-buffer)
       (ada-prj-initialize-values 'ada-prj-current-values
@@ -536,30 +540,30 @@ If FILENAME is given, edit that file."
 ;; ---------------- Utilities --------------------------------
 
 (defun ada-prj-set-list (string ada-list &optional is-directory)
-  "Join the strings in ADA-LIST into a single string.
-Each name is put on a separate line that begins with STRING.
-If IS-DIRECTORY is non-nil, each name is explicitly converted to a
-directory name."
+  "Prepend STRING to strings in ADA-LIST, return new-line separated string.
+If IS-DIRECTORY is non-nil, each element of ADA-LIST is explicitly
+converted to a directory name."
 
   (mapconcat (lambda (x) (concat string "="
                                 (if is-directory
                                     (file-name-as-directory x)
                                   x)))
-             ada-list "\n"))
+            ada-list "\n"))
 
 
 (defun ada-prj-field-modified (widget &rest dummy)
-  "Callback called each time the value of WIDGET is modified. Save the
-change in ada-prj-current-values so that selecting another page and coming
-back keeps the new value."
+  "Callback for modification of WIDGET.
+Remaining args DUMMY are ignored.
+Save the change in `ada-prj-current-values' so that selecting
+another page and coming back keeps the new value."
   (set 'ada-prj-current-values
        (plist-put ada-prj-current-values
                  (widget-get widget ':prj-field)
                  (widget-value widget))))
 
 (defun ada-prj-display-help (widget widget-modified event)
-  "An help button in WIDGET was clicked on. The parameters are so that
-this function can be used as :notify for the widget."
+  "Callback for help button in WIDGET.
+Parameters WIDGET-MODIFIED, EVENT match :notify for the widget."
   (let ((text (widget-get widget 'prj-help)))
     (if event
        ;;  If we have a mouse-event, popup a menu
@@ -575,6 +579,8 @@ this function can be used as :notify for the widget."
       )))
 
 (defun ada-prj-show-value (widget widget-modified event)
+  "Show the current field value in WIDGET.
+Parameters WIDGET-MODIFIED, EVENT match :notify for the widget."
   (let* ((field (widget-get widget ':prj-field))
         (value (plist-get ada-prj-current-values field))
         (inhibit-read-only t)
index 525b53c..fa6c680 100644 (file)
@@ -6,9 +6,8 @@
 ;; This file is part of GNU Emacs.
 
 ;; Authors: Daniel Pfeiffer, Markus Heritsch, Rolf Ebert <ebert@waporo.muc.de>
-;; Maintainer: Emmanuel Briot <briot@gnat.com>
+;; Maintainer: Stephen Leake <stephen_leake@stephe-leake.org>
 ;; Keywords: languages, ada
-;; Rolf Ebert's version: 2.26
 
 ;;; Commentary:
 ;; This file is now automatically loaded from ada-mode.el, and creates a submenu
 (require 'ada-mode)
 
 (defun ada-func-or-proc-name ()
-  ;; Get the name of the current function or procedure."
+  "Return the name of the current function or procedure."
   (save-excursion
     (let ((case-fold-search t))
       (if (re-search-backward ada-procedure-start-regexp nil t)
-         (buffer-substring (match-beginning 3) (match-end 3))
+         (match-string 5)
        "NAME?"))))
 
 ;;; ---- statement skeletons ------------------------------------------
@@ -305,7 +304,7 @@ Invoke right after `ada-function-spec' or `ada-procedure-spec'."
        (backward-char 1)
        (forward-sexp 1)))
     (if (looking-at ";")
-        (delete-char 1)))
+       (delete-char 1)))
   " is" \n
    _ \n
    < "begin" \n
@@ -446,21 +445,21 @@ Invoke right after `ada-function-spec' or `ada-procedure-spec'."
 
 
 (define-skeleton ada-or-accept
-  "Insert an or statement, prompting for the condition name."
+  "Insert an accept alternative, prompting for the condition name."
   ()
   < "or\n"
   (ada-accept))
 
 
 (define-skeleton ada-or-delay
-  "Insert a delay statement, prompting for the delay value."
+  "Insert a delay alternative, prompting for the delay value."
   "[delay value]: "
   < "or\n"
   > "delay " str ";")
 
 
 (define-skeleton ada-or-terminate
-  "Insert a terminate statement."
+  "Insert a terminate alternative."
   ()
   < "or\n"
   > "terminate;")
index 05d2a8b..6c59560 100644 (file)
@@ -1,4 +1,4 @@
-;;; ada-xref.el --- for lookup and completion in Ada mode
+;; ada-xref.el --- for lookup and completion in Ada mode
 
 ;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
 ;;               2004, 2005, 2006 Free Software Foundation, Inc.
@@ -6,8 +6,7 @@
 ;; Author: Markus Heritsch <Markus.Heritsch@studbox.uni-stuttgart.de>
 ;;      Rolf Ebert <ebert@inf.enst.fr>
 ;;      Emmanuel Briot <briot@gnat.com>
-;; Maintainer: Emmanuel Briot <briot@gnat.com>
-;; Ada Core Technologies's version:   Revision: 1.181
+;; Maintainer: Stephen Leake <stephen_leake@stephe-leake.org>
 ;; Keywords: languages ada xref
 
 ;; This file is part of GNU Emacs.
 
 ;;; You need Emacs >= 20.2 to run this package
 
+
+;;; History:
+;;
+
 ;;; Code:
 
 ;; ----- Requirements -----------------------------------------------------
@@ -47,7 +50,7 @@
 (require 'find-file)
 (require 'ada-mode)
 
-;; ------ Use variables
+;; ------ User variables
 (defcustom ada-xref-other-buffer t
   "*If nil, always display the cross-references in the same buffer.
 Otherwise create either a new buffer or a new frame."
@@ -59,7 +62,7 @@ If nil, the cross-reference mode never runs gcc."
   :type 'boolean :group 'ada)
 
 (defcustom ada-xref-confirm-compile nil
-  "*If non-nil, ask for confirmation before compiling or running the application."
+  "*Non-nil means ask for confirmation before compiling or running the application."
   :type 'boolean :group 'ada)
 
 (defcustom ada-krunch-args "0"
@@ -101,30 +104,37 @@ The command `gnatfind' is used every time you choose the menu
 \"Show all references\"."
   :type 'string :group 'ada)
 
+(defcustom ada-prj-default-check-cmd
+  (concat "${cross_prefix}gnatmake -u -c -gnatc ${gnatmake_opt} ${full_current}"
+         " -cargs ${comp_opt}")
+  "*Default command to be used to compile a single file.
+Emacs will substitute the current filename for ${full_current}, or add
+the filename at the end.  This is the same syntax as in the project file."
+  :type 'string :group 'ada)
+
 (defcustom ada-prj-default-comp-cmd
   (concat "${cross_prefix}gnatmake -u -c ${gnatmake_opt} ${full_current} -cargs"
          " ${comp_opt}")
   "*Default command to be used to compile a single file.
-Emacs will add the filename at the end of this command.  This is the same
-syntax as in the project file."
+Emacs will substitute the current filename for ${full_current}, or add
+the filename at the end. This is the same syntax as in the project file."
   :type 'string :group 'ada)
 
 (defcustom ada-prj-default-debugger "${cross_prefix}gdb"
-  "*Default name of the debugger.  We recommend either `gdb',
-`gdb --emacs_gdbtk' or `ddd --tty -fullname'."
+  "*Default name of the debugger."
   :type 'string :group 'ada)
 
 (defcustom ada-prj-default-make-cmd
   (concat "${cross_prefix}gnatmake -o ${main} ${main_unit} ${gnatmake_opt} "
-          "-cargs ${comp_opt} -bargs ${bind_opt} -largs ${link_opt}")
+         "-cargs ${comp_opt} -bargs ${bind_opt} -largs ${link_opt}")
   "*Default command to be used to compile the application.
 This is the same syntax as in the project file."
   :type 'string :group 'ada)
 
 (defcustom ada-prj-default-project-file ""
-  "*Name of the project file to use for every Ada file.
-Emacs will not try to use the standard algorithm to find the project file if
-this string is not empty."
+  "*Name of the current project file.
+Emacs will not try to use the search algorithm to find the project file if
+this string is not empty.  It is set whenever a project file is found."
   :type '(file :must-match t) :group 'ada)
 
 (defcustom ada-gnatstub-opts "-q -I${src_dir}"
@@ -169,10 +179,7 @@ file.")
 (defvar ada-last-prj-file ""
   "Name of the last project file entered by the user.")
 
-(defvar ada-check-switch "-gnats"
-  "Switch added to the command line to check the current file.")
-
-(defconst ada-project-file-extension ".adp"
+(defconst ada-prj-file-extension ".adp"
   "The extension used for project files.")
 
 (defvar ada-xref-runtime-library-specs-path '()
@@ -208,10 +215,15 @@ we need to use `/d' or the drive is never changed.")
   "Regexp to match for operators.")
 
 (defvar ada-xref-project-files '()
-  "Associative list of project files.
-It has the following format:
-\((project_name . value) (project_name . value) ...)
-As always, the values of the project file are defined through properties.")
+  "Associative list of project files with properties.
+It has the format: (project project ...)
+A project has the format: (project-file . project-plist)
+\(See 'apropos plist' for operations on property lists).  See
+ada-xref-set-default-prj-values for the list of valid properties.  The
+current project is retrieved with ada-xref-current-project.  Properties
+are retrieved with ada-xref-get-project-field, set with
+ada-xref-set-project-field.  If project properties are accessed with no
+project file, a (nil . default-properties) entry is created.")
 
 
 ;; ----- Identlist manipulation -------------------------------------------
@@ -238,7 +250,7 @@ As always, the values of the project file are defined through properties.")
 (defmacro ada-set-on-declaration (ident value) (list 'aset ident 7 value))
 
 (defsubst ada-get-ali-buffer (file)
-  "Reads the ali file into a new buffer, and returns this buffer's name"
+  "Read the ali file FILE into a new buffer, and return the buffer's name."
   (find-file-noselect (ada-get-ali-file-name file)))
 
 
@@ -248,9 +260,16 @@ As always, the values of the project file are defined through properties.")
   "Duplicate all \\ characters in CMD so that it can be passed to `compile'."
   (mapconcat 'identity (split-string cmd "\\\\") "\\\\"))
 
+(defun ada-find-executable (exec-name)
+  "Find the full path to the executable file EXEC-NAME.
+On Windows systems, this will properly handle .exe extension as well"
+  (or (ada-find-file-in-dir exec-name exec-path)
+      (ada-find-file-in-dir (concat exec-name ".exe") exec-path)
+      exec-name))
+
 (defun ada-initialize-runtime-library (cross-prefix)
   "Initialize the variables for the runtime library location.
-CROSS-PREFIX is the prefix to use for the gnatls command."
+CROSS-PREFIX is the prefix to use for the `gnatls' command."
   (save-excursion
     (setq ada-xref-runtime-library-specs-path '()
          ada-xref-runtime-library-ali-path   '())
@@ -262,8 +281,9 @@ CROSS-PREFIX is the prefix to use for the gnatls command."
        ;;  Even if we get an error, delete the *gnatls* buffer
        (unwind-protect
            (progn
-             (apply 'call-process (concat cross-prefix "gnatls")
-                    (append '(nil t nil) ada-gnatls-args))
+             (let ((gnatls
+                    (ada-find-executable (concat cross-prefix "gnatls"))))
+                (apply 'call-process gnatls (append '(nil t nil) ada-gnatls-args)))
              (goto-char (point-min))
 
              ;;  Source path
@@ -305,9 +325,9 @@ CROSS-PREFIX is the prefix to use for the gnatls command."
 
 (defun ada-treat-cmd-string (cmd-string)
   "Replace meta-sequences like ${...} in CMD-STRING with the appropriate value.
-The project file must have been loaded first.
-As a special case, ${current} is replaced with the name of the currently
-edited file, minus extension but with directory, and ${full_current} is
+Assumes project exists.
+As a special case, ${current} is replaced with the name of the current
+file, minus extension but with directory, and ${full_current} is
 replaced by the name including the extension."
 
   (while (string-match "\\(-[^-\$IO]*[IO]\\)?\${\\([^}]+\\)}" cmd-string)
@@ -349,9 +369,8 @@ replaced by the name including the extension."
       (set-buffer ada-buffer)
 
       (set 'plist
-          ;;  Try hard to find a default value for filename, so that the user
-          ;;  can edit his project file even if the current buffer is not an
-          ;;  Ada file or not even associated with a file
+          ;;  Try hard to find a project file, even if the current
+          ;;  buffer is not an Ada file or not associated with a file
           (list 'filename (expand-file-name
                            (cond
                             (ada-prj-default-project-file
@@ -383,51 +402,29 @@ replaced by the name including the extension."
                                    "")
                 'cross_prefix    ""
                 'remote_machine  ""
-                'comp_cmd        (list (concat ada-cd-command " ${build_dir}")
-                                       ada-prj-default-comp-cmd)
-                'check_cmd       (list (concat ada-prj-default-comp-cmd " "
-                                               ada-check-switch))
-                'make_cmd        (list (concat ada-cd-command " ${build_dir}")
-                                       ada-prj-default-make-cmd)
-                'run_cmd         (list (concat ada-cd-command " ${build_dir}")
-                                       (concat "${main}"
-                                               (if is-windows ".exe")))
-                'debug_pre_cmd   (list (concat ada-cd-command
-                                               " ${build_dir}"))
+                'comp_cmd        (list ada-prj-default-comp-cmd)
+                'check_cmd       (list ada-prj-default-check-cmd)
+                'make_cmd        (list ada-prj-default-make-cmd)
+                'run_cmd         (list (concat "./${main}" (if is-windows ".exe")))
+                'debug_pre_cmd   (list (concat ada-cd-command " ${build_dir}"))
                 'debug_cmd       (concat ada-prj-default-debugger
-                                         (if is-windows " ${main}.exe"
-                                           " ${main}"))
+                                         " ${main}" (if is-windows ".exe"))
                 'debug_post_cmd  (list nil)))
       )
     (set symbol plist)))
 
 (defun ada-xref-get-project-field (field)
   "Extract the value of FIELD from the current project file.
-The project file must have been loaded first.
-A default value is returned if the file was not found.
+Project variables are substituted.
 
 Note that for src_dir and obj_dir, you should rather use
 `ada-xref-get-src-dir-field' or `ada-xref-get-obj-dir-field' which will in
 addition return the default paths."
 
-  (let ((file-name ada-prj-default-project-file)
-       file value)
-
-    ;;  Get the project file (either the current one, or a default one)
-    (setq file (or (assoc file-name ada-xref-project-files)
-                  (assoc nil ada-xref-project-files)))
+  (let* ((project-plist (cdr (ada-xref-current-project)))
+        value)
 
-    ;;  If the file was not found, use the default values
-    (if file
-       ;;  Get the value from the file
-       (set 'value (plist-get (cdr file) field))
-
-      ;; Create a default nil file that contains the default values
-      (ada-xref-set-default-prj-values 'value (current-buffer))
-      (add-to-list 'ada-xref-project-files (cons nil value))
-      (ada-xref-update-project-menu)
-      (set 'value (plist-get value field))
-      )
+    (set 'value (plist-get project-plist field))
 
     ;;  Substitute the ${...} constructs in all the strings, including
     ;;  inside lists
@@ -443,7 +440,6 @@ addition return the default paths."
      )
   ))
 
-
 (defun ada-xref-get-src-dir-field ()
   "Return the full value for src_dir, including the default directories.
 All the directories are returned as absolute directories."
@@ -474,6 +470,15 @@ All the directories are returned as absolute directories."
      ;; Add the standard runtime at the end
      ada-xref-runtime-library-ali-path)))
 
+(defun ada-xref-set-project-field (field value)
+  "Set FIELD to VALUE in current project.  Assumes project exists."
+  ;; same algorithm to find project-plist as ada-xref-current-project
+  (let* ((file-name (ada-xref-current-project-file))
+        (project-plist (cdr (assoc file-name ada-xref-project-files))))
+
+    (setq project-plist (plist-put project-plist field value))
+    (setcdr (assoc file-name ada-xref-project-files) project-plist)))
+
 (defun ada-xref-update-project-menu ()
   "Update the menu Ada->Project, with the list of available project files."
   ;; Create the standard items.
@@ -495,7 +500,7 @@ All the directories are returned as absolute directories."
                                  (ada-xref-update-project-menu))))
                  (vector
                   (if (string= (file-name-extension name)
-                               ada-project-file-extension)
+                               ada-prj-file-extension)
                       (file-name-sans-extension
                        (file-name-nondirectory name))
                     (file-name-nondirectory name))
@@ -529,6 +534,7 @@ All the directories are returned as absolute directories."
   "Completion function when reading a file from the minibuffer.
 Completion is attempted in all the directories in the source path, as
 defined in the project file."
+  ;; FIXME: doc arguments
   (let (list
        (dirs (ada-xref-get-src-dir-field)))
 
@@ -547,7 +553,7 @@ defined in the project file."
 
 ;;;###autoload
 (defun ada-find-file (filename)
-  "Open a file anywhere in the source path.
+  "Open FILENAME, from anywhere in the source path.
 Completion is available."
   (interactive
    (list (completing-read "File: " 'ada-do-file-completion)))
@@ -560,12 +566,36 @@ Completion is available."
 ;; ----- Utilities -------------------------------------------------
 
 (defun ada-require-project-file ()
-  "If no project file is currently active, load a default one."
-  (if (or (not ada-prj-default-project-file)
-         (not ada-xref-project-files)
-         (string= ada-prj-default-project-file ""))
+  "If the current project does not exist, load or create a default one.
+Should only be called from interactive functions."
+  (if (not (ada-xref-current-project t))
       (ada-reread-prj-file)))
 
+(defun ada-xref-current-project-file (&optional no-user-question)
+  "Return the current project file name; never nil unless NO-USER-QUESTION.
+If NO-USER-QUESTION, don't prompt user for file.  Call
+`ada-require-project-file' first if a project must exist."
+  (if (not (string= "" ada-prj-default-project-file))
+      ada-prj-default-project-file
+    (ada-prj-find-prj-file nil no-user-question)))
+
+(defun ada-xref-current-project (&optional no-user-question)
+  "Return the current project; nil if none.
+If NO-USER-QUESTION, don't prompt user for file.  Call
+`ada-require-project-file' first if a project must exist."
+  (let* ((file-name (ada-xref-current-project-file no-user-question)))
+    (assoc file-name ada-xref-project-files)))
+
+(defun ada-show-current-project ()
+  "Display current project file name in message buffer."
+  (interactive)
+  (message (ada-xref-current-project-file)))
+
+(defun ada-show-current-main ()
+  "Display current main unit name in message buffer."
+  (interactive)
+  (message "ada-mode main_unit: %s" (ada-xref-get-project-field 'main_unit)))
+
 (defun ada-xref-push-pos (filename position)
   "Push (FILENAME, POSITION) on the position ring for cross-references."
   (setq ada-xref-pos-ring (cons (list position filename) ada-xref-pos-ring))
@@ -582,9 +612,10 @@ Completion is available."
        (goto-char (car pos)))))
 
 (defun ada-convert-file-name (name)
-  "Converts from NAME to a name that can be used by the compilation commands.
+  "Convert from NAME to a name that can be used by the compilation commands.
 This is overriden on VMS to convert from VMS filenames to Unix filenames."
   name)
+;; FIXME: use convert-standard-filename instead
 
 (defun ada-set-default-project-file (name &optional keep-existing)
   "Set the file whose name is NAME as the default project file.
@@ -602,21 +633,23 @@ a project file unless the user has already loaded one."
 ;; ------ Handling the project file -----------------------------
 
 (defun ada-prj-find-prj-file (&optional file no-user-question)
-  "Find the prj file associated with FILE (or the current buffer if nil).
-If NO-USER-QUESTION is non-nil, use a default file if not project file was
-found, and do not ask the user.
-If the buffer is not an Ada buffer, associate it with the default project
-file.  If none is set, return nil."
+  "Find the project file associated with FILE (or the current buffer if nil).
+If the buffer is not in Ada mode, or not associated with a file,
+return `ada-prj-default-project-file'.  Otherwise, search for a file with
+the same base name as the Ada file, but extension given by
+`ada-prj-file-extension' (default .adp).  If not found, search for *.adp
+in the current directory; if several are found, and NO-USER-QUESTION
+is non-nil, prompt the user to select one.  If none are found, return
+'default.adp'."
 
   (let (selected)
 
-    ;;  Use the active project file if there is one.
-    ;;  This is also valid if we don't currently have an Ada buffer, or if
-    ;;  the current buffer is not a real file (for instance an emerge buffer)
-
     (if (or (not (string= mode-name "Ada"))
            (not (buffer-file-name)))
 
+       ;;  Not in an Ada buffer, or current buffer not associated
+       ;;  with a file (for instance an emerge buffer)
+
        (if (and ada-prj-default-project-file
                 (not (string= ada-prj-default-project-file "")))
            (setq selected ada-prj-default-project-file)
@@ -627,7 +660,7 @@ file.  If none is set, return nil."
       (let* ((current-file (or file (buffer-file-name)))
             (first-choice (concat
                            (file-name-sans-extension current-file)
-                           ada-project-file-extension))
+                           ada-prj-file-extension))
             (dir          (file-name-directory current-file))
 
             ;; on Emacs 20.2, directory-files does not work if
@@ -636,22 +669,21 @@ file.  If none is set, return nil."
             (prj-files    (directory-files
                            dir t
                            (concat ".*" (regexp-quote
-                                         ada-project-file-extension) "$")))
+                                         ada-prj-file-extension) "$")))
             (choice       nil))
 
        (cond
 
-        ;;  Else if there is a project file with the same name as the Ada
-        ;;  file, but not the same extension.
         ((file-exists-p first-choice)
+         ;; filename.adp
          (set 'selected first-choice))
 
-        ;;  Else if only one project file was found in the current directory
         ((= (length prj-files) 1)
+         ;; Exactly one project file was found in the current directory
          (set 'selected (car prj-files)))
 
-        ;;  Else if there are multiple files, ask the user
         ((and (> (length prj-files) 1) (not no-user-question))
+         ;;  multiple project files in current directory, ask the user
          (save-window-excursion
            (with-output-to-temp-buffer "*choice list*"
              (princ "There are more than one possible project file.\n")
@@ -676,10 +708,8 @@ file.  If none is set, return nil."
                            (read-from-minibuffer "Enter No. of your choice: "))))
            (set 'selected (nth (1- choice) prj-files))))
 
-        ;; Else if no project file was found in the directory, ask a name
-        ;; to the user, using as a default value the last one entered by
-        ;; the user
         ((= (length prj-files) 0)
+         ;; No project file in the current directory; ask user
          (unless (or no-user-question (not ada-always-ask-project))
            (setq ada-last-prj-file
                  (read-file-name
@@ -694,12 +724,12 @@ file.  If none is set, return nil."
 
 
 (defun ada-parse-prj-file (prj-file)
-  "Reads and parses the PRJ-FILE file if it was found.
-The current buffer should be the ada-file buffer."
+  "Read PRJ-FILE, set it as the active project."
+  ;; FIXME: doc nil, search, etc.
   (if prj-file
       (let (project src_dir obj_dir make_cmd comp_cmd check_cmd casing
                    run_cmd debug_pre_cmd debug_post_cmd
-            (ada-buffer (current-buffer)))
+           (ada-buffer (current-buffer)))
        (setq prj-file (expand-file-name prj-file))
 
        ;;  Set the project file as the active one.
@@ -728,6 +758,8 @@ The current buffer should be the ada-file buffer."
              (while (not (eobp))
                (if (looking-at "^\\([^=]+\\)=\\(.*\\)")
                    (cond
+                    ;; fields that are lists or paths require special processing
+                    ;; FIXME: strip trailing spaces
                     ((string= (match-string 1) "src_dir")
                      (add-to-list 'src_dir
                                   (file-name-as-directory (match-string 2))))
@@ -753,6 +785,7 @@ The current buffer should be the ada-file buffer."
                     ((string= (match-string 1) "debug_post_cmd")
                      (add-to-list 'debug_post_cmd (match-string 2)))
                     (t
+                     ;; any other field in the file is just copied
                      (set 'project (plist-put project (intern (match-string 1))
                                               (match-string 2))))))
                (forward-line 1))
@@ -771,32 +804,30 @@ The current buffer should be the ada-file buffer."
                                                     (reverse check_cmd))))
              (if run_cmd (set 'project (plist-put project 'run_cmd
                                                   (reverse run_cmd))))
-             (set 'project (plist-put project 'debug_post_cmd
-                                      (reverse debug_post_cmd)))
-             (set 'project (plist-put project 'debug_pre_cmd
-                                      (reverse debug_pre_cmd)))
+             (if debug_post_cmd (set 'project (plist-put project 'debug_post_cmd
+                                                          (reverse debug_post_cmd))))
+             (if debug_pre_cmd (set 'project (plist-put project 'debug_pre_cmd
+                                                         (reverse debug_pre_cmd))))
 
-             ;; Kill the project buffer
-             (kill-buffer nil)
              (set-buffer ada-buffer)
              )
 
          ;;  Else the file wasn't readable (probably the default project).
          ;;  We initialize it with the current environment variables.
-          ;;  We need to add the startup directory in front so that
-          ;;  files locally redefined are properly found.  We cannot
-          ;;  add ".", which varies too much depending on what the
-          ;;  current buffer is.
+         ;;  We need to add the startup directory in front so that
+         ;;  files locally redefined are properly found.  We cannot
+         ;;  add ".", which varies too much depending on what the
+         ;;  current buffer is.
          (set 'project
               (plist-put project 'src_dir
                          (append
-                           (list command-line-default-directory)
+                          (list command-line-default-directory)
                           (split-string (or (getenv "ADA_INCLUDE_PATH") "") ":")
                           (list "." default-directory))))
          (set 'project
               (plist-put project 'obj_dir
                          (append
-                           (list command-line-default-directory)
+                          (list command-line-default-directory)
                           (split-string (or (getenv "ADA_OBJECTS_PATH") "") ":")
                           (list "." default-directory))))
          )
@@ -817,11 +848,11 @@ The current buffer should be the ada-file buffer."
        ;; go to the source of the errors in a compilation buffer
        (setq compilation-search-path (ada-xref-get-src-dir-field))
 
-        ;; Set the casing exceptions file list
-        (if casing
-            (progn
-              (setq ada-case-exception-file (reverse casing))
-              (ada-case-read-exceptions)))
+       ;; Set the casing exceptions file list
+       (if casing
+           (progn
+             (setq ada-case-exception-file (reverse casing))
+             (ada-case-read-exceptions)))
 
        ;; Add the directories to the search path for ff-find-other-file
        ;; Do not add the '/' or '\' at the end
@@ -850,21 +881,21 @@ If LOCAL-ONLY is t, only the declarations in the current file are returned."
   (ada-require-project-file)
 
   (let* ((identlist (ada-read-identifier pos))
-         (alifile (ada-get-ali-file-name (ada-file-of identlist)))
+        (alifile (ada-get-ali-file-name (ada-file-of identlist)))
         (process-environment (ada-set-environment)))
 
     (set-buffer (get-file-buffer (ada-file-of identlist)))
 
     ;;  if the file is more recent than the executable
     (if (or (buffer-modified-p (current-buffer))
-            (file-newer-than-file-p (ada-file-of identlist) alifile))
-        (ada-find-any-references (ada-name-of identlist)
-                                 (ada-file-of identlist)
-                                 nil nil local-only arg)
+           (file-newer-than-file-p (ada-file-of identlist) alifile))
+       (ada-find-any-references (ada-name-of identlist)
+                                (ada-file-of identlist)
+                                nil nil local-only arg)
       (ada-find-any-references (ada-name-of identlist)
-                               (ada-file-of identlist)
-                               (ada-line-of identlist)
-                               (ada-column-of identlist) local-only arg)))
+                              (ada-file-of identlist)
+                              (ada-line-of identlist)
+                              (ada-column-of identlist) local-only arg)))
   )
 
 (defun ada-find-local-references (&optional pos arg)
@@ -897,9 +928,9 @@ buffer `*gnatfind*', if there is one."
         (switches (ada-xref-get-project-field 'gnatfind_opt))
         (command (concat "gnat find " switches " "
                          quote-entity
-                          (if file (concat ":" (file-name-nondirectory file)))
-                          (if line (concat ":" line))
-                          (if column (concat ":" column))
+                         (if file (concat ":" (file-name-nondirectory file)))
+                         (if line (concat ":" line))
+                         (if column (concat ":" column))
                          (if local-only (concat " " (file-name-nondirectory file)))
                          ))
         old-contents)
@@ -907,10 +938,10 @@ buffer `*gnatfind*', if there is one."
     ;;  If a project file is defined, use it
     (if (and ada-prj-default-project-file
             (not (string= ada-prj-default-project-file "")))
-        (if (string-equal (file-name-extension ada-prj-default-project-file)
-                          "gpr")
-            (setq command (concat command " -P" ada-prj-default-project-file))
-          (setq command (concat command " -p" ada-prj-default-project-file))))
+       (if (string-equal (file-name-extension ada-prj-default-project-file)
+                         "gpr")
+           (setq command (concat command " -P" ada-prj-default-project-file))
+         (setq command (concat command " -p" ada-prj-default-project-file))))
 
     (if (and append (get-buffer "*gnatfind*"))
        (save-excursion
@@ -937,21 +968,19 @@ buffer `*gnatfind*', if there is one."
 
 ;; ----- Identifier Completion --------------------------------------------
 (defun ada-complete-identifier (pos)
-  "Tries to complete the identifier around POS.
-The feature is only available if the files where compiled without
-the option `-gnatx'."
+  "Try to complete the identifier around POS, using compiler cross-reference information."
   (interactive "d")
   (ada-require-project-file)
 
   ;; Initialize function-local variables and jump to the .ali buffer
   ;; Note that for regexp search is case insensitive too
   (let* ((curbuf (current-buffer))
-         (identlist (ada-read-identifier pos))
-         (sofar (concat "^[0-9]+[a-zA-Z][0-9]+[ *]\\("
-                        (regexp-quote (ada-name-of identlist))
-                        "[a-zA-Z0-9_]*\\)"))
-         (completed nil)
-         (symalist nil))
+        (identlist (ada-read-identifier pos))
+        (sofar (concat "^[0-9]+[a-zA-Z][0-9]+[ *]\\("
+                       (regexp-quote (ada-name-of identlist))
+                       "[a-zA-Z0-9_]*\\)"))
+        (completed nil)
+        (symalist nil))
 
     ;; Open the .ali file
     (set-buffer (ada-get-ali-buffer (buffer-file-name)))
@@ -990,6 +1019,7 @@ the option `-gnatx'."
 
 (defun ada-goto-body (pos &optional other-frame)
   "Display the body of the entity around POS.
+OTHER-FRAME non-nil means display in another frame.
 If the entity doesn't have a body, display its declaration.
 As a side effect, the buffer for the declaration is also open."
   (interactive "d")
@@ -1014,8 +1044,13 @@ If OTHER-FRAME is non-nil, display the cross-reference in another frame."
   ;;  that file was too old or even did not exist, try to look in the whole
   ;;  object path for a possible location.
   (let ((identlist (ada-read-identifier pos)))
-    (condition-case nil
+    (condition-case err
        (ada-find-in-ali identlist other-frame)
+      ;; File not found: print explicit error message
+      (error-file-not-found
+       (message (concat (error-message-string err)
+                       (nthcdr 1 err))))
+
       (error
        (let ((ali-file (ada-get-ali-file-name (ada-file-of identlist))))
 
@@ -1023,7 +1058,7 @@ If OTHER-FRAME is non-nil, display the cross-reference in another frame."
         ;; entity, whose references are not given by GNAT
         (if (and (file-exists-p ali-file)
                  (file-newer-than-file-p ali-file (ada-file-of identlist)))
-            (message "No cross-reference found--may be a predefined entity.")
+            (message "No cross-reference found -- may be a predefined entity.")
 
           ;; Else, look in every ALI file, except if the user doesn't want that
           (if ada-xref-search-with-egrep
@@ -1048,8 +1083,8 @@ The declation is shown in another frame if `ada-xref-other-buffer' is non-nil."
              command))))
 
 (defun ada-get-absolute-dir-list (dir-list root-dir)
-  "Returns the list of absolute directories found in dir-list.
-If a directory is a relative directory, add the value of ROOT-DIR in front."
+  "Return the list of absolute directories found in DIR-LIST.
+If a directory is a relative directory, ROOT-DIR is prepended."
   (mapcar (lambda (x) (expand-file-name x root-dir)) dir-list))
 
 (defun ada-set-environment ()
@@ -1109,6 +1144,24 @@ If ARG is not nil, ask for user confirmation."
 
     (compile (ada-quote-cmd cmd))))
 
+(defun ada-set-main-compile-application ()
+  "Set main_unit and main project variables to current buffer, build main."
+  (interactive)
+  (ada-require-project-file)
+  (let* ((file (buffer-file-name (current-buffer)))
+        main)
+    (if (not file)
+       (error "No file for current buffer")
+
+      (setq main
+           (if file
+               (file-name-nondirectory
+                (file-name-sans-extension file))
+             ""))
+      (ada-xref-set-project-field 'main main)
+      (ada-xref-set-project-field 'main_unit main)
+      (ada-compile-application))))
+
 (defun ada-compile-current (&optional arg prj-field)
   "Recompile the current file.
 If ARG is not nil, ask for user confirmation of the command.
@@ -1134,12 +1187,6 @@ command, and should be either comp_cmd (default) or check_cmd."
     (if (or ada-xref-confirm-compile arg)
        (setq cmd (read-from-minibuffer "enter command to compile: " cmd)))
 
-    ;;  Insert newlines so as to separate the name of the commands to run
-    ;;  and the output of the commands.  This doesn't work with cmdproxy.exe,
-    ;;  which gets confused by newline characters.
-    (if (not (string-match ".exe" shell-file-name))
-       (setq cmd (concat cmd "\n\n")))
-
     (compile (ada-quote-cmd cmd))))
 
 (defun ada-check-current (&optional arg)
@@ -1162,7 +1209,7 @@ if ARG is not-nil, ask for user confirmation."
 
     ;;  Guess the command if it wasn't specified
     (if (not command)
-        (set 'command (list (file-name-sans-extension (buffer-name)))))
+       (set 'command (list (file-name-sans-extension (buffer-name)))))
 
     ;; Modify the command to run remotely
     (setq command (ada-remote (mapconcat 'identity command
@@ -1197,13 +1244,13 @@ if ARG is not-nil, ask for user confirmation."
 
 (defun ada-gdb-application (&optional arg executable-name)
   "Start the debugger on the application.
+If ARG is non-nil, ask the user to confirm the command.
 EXECUTABLE-NAME, if non-nil, is debugged instead of the file specified in the
-project file.
-If ARG is non-nil, ask the user to confirm the command."
+project file."
   (interactive "P")
+  (ada-require-project-file)
   (let ((buffer (current-buffer))
        cmd pre-cmd post-cmd)
-    (ada-require-project-file)
     (setq cmd   (if executable-name
                    (concat ada-prj-default-debugger " " executable-name)
                  (ada-xref-get-project-field 'debug_cmd))
@@ -1303,13 +1350,8 @@ If ARG is non-nil, ask the user to confirm the command."
       (switch-to-buffer buffer)
       )))
 
-
 (defun ada-reread-prj-file (&optional filename)
-  "Forces Emacs to read either FILENAME or the project file associated
-with the current buffer.
-Otherwise, this file is only read once, and never read again.
-Since the information in the project file is shared between all buffers, this
-automatically modifies the setup for all the Ada buffer that use this file."
+  "Reread either the current project, or FILENAME if non-nil."
   (interactive "P")
   (if filename
       (ada-parse-prj-file filename)
@@ -1330,7 +1372,7 @@ the cross-reference information.  Note that the ali file can then be deduced by
 replacing the file extension with `.ali'."
   ;; kill old buffer
   (if (and ali-file-name
-           (get-file-buffer ali-file-name))
+          (get-file-buffer ali-file-name))
       (kill-buffer (get-file-buffer ali-file-name)))
 
   (let* ((name      (ada-convert-file-name file))
@@ -1375,15 +1417,15 @@ replacing the file extension with `.ali'."
     found))
 
 (defun ada-find-ali-file-in-dir (file)
-  "Find an .ali file in obj_dir.  The current buffer must be the Ada file.
+  "Find the ali file FILE, searching obj_dir for the current project.
 Adds build_dir in front of the search path to conform to gnatmake's behavior,
 and the standard runtime location at the end."
   (ada-find-file-in-dir file (ada-xref-get-obj-dir-field)))
 
 (defun ada-find-src-file-in-dir (file)
-  "Find a source file in src_dir.  The current buffer must be the Ada file.
-Adds src_dir in front of the search path to conform to gnatmake's behavior,
-and the standard runtime location at the end."
+  "Find the source file FILE, searching src_dir for the current project.
+Adds the standard runtime location at the end of the search path to conform
+to gnatmake's behavior."
   (ada-find-file-in-dir file (ada-xref-get-src-dir-field)))
 
 (defun ada-get-ali-file-name (file)
@@ -1414,9 +1456,9 @@ the project file."
   (save-excursion
     (set-buffer (get-file-buffer file))
     (let ((short-ali-file-name
-           (concat (file-name-sans-extension (file-name-nondirectory file))
-                   ".ali"))
-          ali-file-name
+          (concat (file-name-sans-extension (file-name-nondirectory file))
+                  ".ali"))
+         ali-file-name
          is-spec)
 
       ;; If we have a non-standard file name, and this is a spec, we first
@@ -1507,22 +1549,18 @@ file for possible paths."
     (let ((buffer (get-file-buffer original-file)))
       (if buffer
          (set-buffer buffer)
-       (find-file original-file)
-       (ada-require-project-file)))
+       (find-file original-file)))
 
     ;; we choose the first possible completion and we
     ;; return the absolute file name
     (let ((filename (ada-find-src-file-in-dir file)))
       (if filename
-          (expand-file-name filename)
-        (error (concat
-                (file-name-nondirectory file)
-                " not found in src_dir; please check your project file")))
-
+         (expand-file-name filename)
+       (signal 'error-file-not-found (file-name-nondirectory file)))
       )))
 
 (defun ada-find-file-number-in-ali (file)
-  "Returns the file number for FILE in the associated ali file."
+  "Return the file number for FILE in the associated ali file."
   (set-buffer (ada-get-ali-buffer file))
   (goto-char (point-min))
 
@@ -1532,7 +1570,7 @@ file for possible paths."
     (count-lines begin (point))))
 
 (defun ada-read-identifier (pos)
-  "Returns the identlist around POS and switch to the .ali buffer.
+  "Return the identlist around POS and switch to the .ali buffer.
 The returned list represents the entity, and can be manipulated through the
 macros `ada-name-of', `ada-line-of', `ada-column-of', `ada-file-of',..."
 
@@ -1553,7 +1591,7 @@ macros `ada-name-of', `ada-line-of', `ada-column-of', `ada-file-of',..."
     ;; Just in front of a string => we could have an operator declaration,
     ;; as in "+", "-", ..
     (if (= (char-after) ?\")
-        (forward-char 1))
+       (forward-char 1))
 
     ;; if looking at an operator
     ;; This is only true if:
@@ -1563,19 +1601,19 @@ macros `ada-name-of', `ada-line-of', `ada-column-of', `ada-file-of',..."
             (or (not (= (char-syntax (char-after)) ?w))
                 (not (or (= (char-syntax (char-after (match-end 0))) ?w)
                          (= (char-after (match-end 0)) ?_)))))
-        (progn
-          (if (and (= (char-before) ?\")
-                   (= (char-after (+ (length (match-string 0)) (point))) ?\"))
-              (forward-char -1))
-          (set 'identifier (regexp-quote (concat "\"" (match-string 0) "\""))))
+       (progn
+         (if (and (= (char-before) ?\")
+                  (= (char-after (+ (length (match-string 0)) (point))) ?\"))
+             (forward-char -1))
+         (set 'identifier (regexp-quote (concat "\"" (match-string 0) "\""))))
 
       (if (ada-in-string-p)
-          (error "Inside string or character constant"))
+         (error "Inside string or character constant"))
       (if (looking-at (concat ada-keywords "[^a-zA-Z_]"))
-          (error "No cross-reference available for reserved keyword"))
+         (error "No cross-reference available for reserved keyword"))
       (if (looking-at "[a-zA-Z0-9_]+")
-          (set 'identifier (match-string 0))
-        (error "No identifier around")))
+         (set 'identifier (match-string 0))
+       (error "No identifier around")))
 
     ;; Build the identlist
     (set 'identlist    (ada-make-identlist))
@@ -1589,8 +1627,8 @@ macros `ada-name-of', `ada-line-of', `ada-column-of', `ada-file-of',..."
     ))
 
 (defun ada-get-all-references (identlist)
-  "Completes and returns IDENTLIST with the information extracted
-from the ali file (definition file and places where it is referenced)."
+  "Complete IDENTLIST with definition file and places where it is referenced.
+Information is extracted from the ali file."
 
   (let ((ali-buffer (ada-get-ali-buffer (ada-file-of identlist)))
        declaration-found)
@@ -1605,13 +1643,13 @@ from the ali file (definition file and places where it is referenced)."
     (if (re-search-forward
         (concat "^X [0-9]+ " (file-name-nondirectory (ada-file-of identlist)))
         nil t)
-        (let ((bound (save-excursion (re-search-forward "^X " nil t))))
-          (set 'declaration-found
+       (let ((bound (save-excursion (re-search-forward "^X " nil t))))
+         (set 'declaration-found
               (re-search-forward
                (concat "^"    (ada-line-of identlist)
                        "."    (ada-column-of identlist)
                        "[ *]" (ada-name-of identlist)
-                       "[{\(<= ]?\\(.*\\)$") bound t))
+                       "[{\[\(<= ]?\\(.*\\)$") bound t))
          (if declaration-found
              (ada-set-on-declaration identlist t))
          ))
@@ -1636,14 +1674,14 @@ from the ali file (definition file and places where it is referenced)."
                                         (ada-column-of identlist) "\\>")
                                 nil t)
 
-          ;; if we did not find it, it may be because the first reference
-          ;; is not required to have a 'unit_number|' item included.
-          ;; Or maybe we are already on the declaration...
-          (unless (re-search-forward
+         ;; if we did not find it, it may be because the first reference
+         ;; is not required to have a 'unit_number|' item included.
+         ;; Or maybe we are already on the declaration...
+         (unless (re-search-forward
                   (concat
                    "^[0-9]+.[0-9]+[ *]"
                    (ada-name-of identlist)
-                   "[ <{=\(]\\(.\\|\n\\.\\)*\\<"
+                   "[ <{=\(\[]\\(.\\|\n\\.\\)*\\<"
                    (ada-line-of identlist)
                    "[^0-9]"
                    (ada-column-of identlist) "\\>")
@@ -1653,7 +1691,7 @@ from the ali file (definition file and places where it is referenced)."
            ;; or the source file has been modified since the ali file was
            ;; created
            (set 'declaration-found nil)
-            )
+           )
          )
 
       ;; Last check to be completly sure we have found the correct line (the
@@ -1663,9 +1701,10 @@ from the ali file (definition file and places where it is referenced)."
            (beginning-of-line)
            ;; while we have a continuation line, go up one line
            (while (looking-at "^\\.")
-             (previous-line 1))
+             (previous-line 1)
+             (beginning-of-line))
            (unless (looking-at (concat "[0-9]+.[0-9]+[ *]"
-                                       (ada-name-of identlist) "[ <{=\(]"))
+                                       (ada-name-of identlist) "[ <{=\(\[]"))
              (set 'declaration-found nil))))
 
       ;; Still no success ! The ali file must be too old, and we need to
@@ -1688,15 +1727,15 @@ from the ali file (definition file and places where it is referenced)."
     ;; information available
     (beginning-of-line)
     (if declaration-found
-        (let ((current-line (buffer-substring
+       (let ((current-line (buffer-substring
                             (point) (save-excursion (end-of-line) (point)))))
-          (save-excursion
-            (next-line 1)
-            (beginning-of-line)
-            (while (looking-at "^\\.\\(.*\\)")
-              (set 'current-line (concat current-line (match-string 1)))
-              (next-line 1))
-            )
+         (save-excursion
+           (next-line 1)
+           (beginning-of-line)
+           (while (looking-at "^\\.\\(.*\\)")
+             (set 'current-line (concat current-line (match-string 1)))
+             (next-line 1))
+           )
 
          (if (re-search-backward "^X [0-9]+ \\([a-zA-Z0-9_.-]+\\)" nil t)
 
@@ -1708,6 +1747,8 @@ from the ali file (definition file and places where it is referenced)."
                                          (ada-file-of identlist)))
 
                ;;  Else clean up the ali file
+               (error-file-not-found
+                (signal (car err) (cdr err)))
                (error
                 (kill-buffer ali-buffer)
                 (error (error-message-string err)))
@@ -1725,7 +1766,7 @@ This function is disabled for operators, and only works for identifiers."
 
   (unless (= (string-to-char (ada-name-of identlist)) ?\")
       (progn
-        (let ((declist '()) ;;; ( (line_in_ali_file line_in_ada) ( ... ))
+       (let ((declist '()) ;;; ( (line_in_ali_file line_in_ada) ( ... ))
              (my-regexp  (concat "[ *]"
                                  (regexp-quote (ada-name-of identlist)) " "))
              (line-ada "--")
@@ -1735,43 +1776,43 @@ This function is disabled for operators, and only works for identifiers."
              (choice 0)
              (ali-buffer (current-buffer)))
 
-          (goto-char (point-max))
-          (while (re-search-backward my-regexp nil t)
-            (save-excursion
-              (set 'line-ali (count-lines 1 (point)))
-              (beginning-of-line)
-              ;; have a look at the line and column numbers
-              (if (looking-at "^\\([0-9]+\\).\\([0-9]+\\)[ *]")
-                  (progn
-                    (setq line-ada (match-string 1))
-                    (setq col-ada  (match-string 2)))
-                (setq line-ada "--")
-                (setq col-ada  "--")
-                )
-              ;; construct a list with the file names and the positions within
-              (if (re-search-backward "^X [0-9]+ \\([a-zA-Z0-9._-]+\\)" nil t)
+         (goto-char (point-max))
+         (while (re-search-backward my-regexp nil t)
+           (save-excursion
+             (set 'line-ali (count-lines 1 (point)))
+             (beginning-of-line)
+             ;; have a look at the line and column numbers
+             (if (looking-at "^\\([0-9]+\\).\\([0-9]+\\)[ *]")
+                 (progn
+                   (setq line-ada (match-string 1))
+                   (setq col-ada  (match-string 2)))
+               (setq line-ada "--")
+               (setq col-ada  "--")
+               )
+             ;; construct a list with the file names and the positions within
+             (if (re-search-backward "^X [0-9]+ \\([a-zA-Z0-9._-]+\\)" nil t)
                  (add-to-list
                   'declist (list line-ali (match-string 1) line-ada col-ada))
-                )
-              )
-            )
-
-          ;; how many possible declarations have we found ?
-          (setq len (length declist))
-          (cond
-           ;; none => error
-           ((= len 0)
-            (kill-buffer (current-buffer))
-            (error (concat "No declaration of "
-                           (ada-name-of identlist)
-                           " recorded in .ali file")))
-
-           ;; one => should be the right one
-           ((= len 1)
-            (goto-line (caar declist)))
-
-           ;; more than one => display choice list
-           (t
+               )
+             )
+           )
+
+         ;; how many possible declarations have we found ?
+         (setq len (length declist))
+         (cond
+          ;; none => error
+          ((= len 0)
+           (kill-buffer (current-buffer))
+           (error (concat "No declaration of "
+                          (ada-name-of identlist)
+                          " recorded in .ali file")))
+
+          ;; one => should be the right one
+          ((= len 1)
+           (goto-line (caar declist)))
+
+          ;; more than one => display choice list
+          (t
            (save-window-excursion
              (with-output-to-temp-buffer "*choice list*"
 
@@ -1782,13 +1823,13 @@ This function is disabled for operators, and only works for identifiers."
                (let ((counter 0))
                  (while (< counter len)
                    (princ (format "  %2d)    %-21s   %4s  %4s\n"
-                                 (1+ counter)
+                                (1+ counter)
                                 (ada-get-ada-file-name
                                  (nth 1 (nth counter declist))
                                  (ada-file-of identlist))
-                                 (nth 2 (nth counter declist))
-                                 (nth 3 (nth counter declist))
-                                 ))
+                                (nth 2 (nth counter declist))
+                                (nth 3 (nth counter declist))
+                                ))
                    (setq counter (1+ counter))
                    ) ; end of while
                  ) ; end of let
@@ -1804,13 +1845,13 @@ This function is disabled for operators, and only works for identifiers."
                       (read-from-minibuffer "Enter No. of your choice: "))))
              )
            (set-buffer ali-buffer)
-            (goto-line (car (nth (1- choice) declist)))
-            ))))))
+           (goto-line (car (nth (1- choice) declist)))
+           ))))))
 
 
 (defun ada-find-in-ali (identlist &optional other-frame)
   "Look in the .ali file for the definition of the identifier in IDENTLIST.
-If OTHER-FRAME is non nil, and `ada-xref-other-buffer' is non nil,
+If OTHER-FRAME is non-nil, and `ada-xref-other-buffer' is non-nil,
 opens a new window to show the declaration."
 
   (ada-get-all-references identlist)
@@ -1825,7 +1866,7 @@ opens a new window to show the declaration."
     ;; In that case, we simply go to each one in turn.
 
     ;; Get all the possible locations
-    (string-match "^\\([0-9]+\\)[a-zA-Z+]\\([0-9]+\\)[ *]" ali-line)
+    (string-match "^\\([0-9]+\\)[a-zA-Z+*]\\([0-9]+\\)[ *]" ali-line)
     (set 'locations (list (list (match-string 1 ali-line) ;; line
                                (match-string 2 ali-line) ;; column
                                (ada-declare-file-of identlist))))
@@ -1836,7 +1877,10 @@ opens a new window to show the declaration."
            start (match-end 3))
 
       ;;  it there was a file number in the same line
-      (if (string-match (concat "[^{(<]\\([0-9]+\\)|\\([^|bc]+\\)?"
+      ;;  Make sure we correctly handle the case where the first file reference
+      ;;  on the line is the type reference.
+      ;;    1U2 T(2|2r3) 34r23
+      (if (string-match (concat "[^{(<0-9]\\([0-9]+\\)|\\([^|bc]+\\)?"
                                (match-string 0 ali-line))
                        ali-line)
          (let ((file-number (match-string 1 ali-line)))
@@ -1899,7 +1943,7 @@ This command requires the external `egrep' program to be available.
 This works well when one is using an external librarie and wants
 to find the declaration and documentation of the subprograms one is
 is using."
-
+;; FIXME: what does this function do?
   (let (list
        (dirs (ada-xref-get-obj-dir-field))
        (regexp (concat "[ *]" (ada-name-of identlist)))
@@ -2005,7 +2049,7 @@ is using."
                                  (string-to-number (nth 2 (nth choice list)))
                                  identlist
                                  other-frame)
-       (error (concat (car (nth choice list)) " not found in src_dir")))
+       (signal 'error-file-not-found (car (nth choice list))))
       (message "This is only a (good) guess at the cross-reference.")
       ))))
 
@@ -2020,12 +2064,12 @@ If OTHER-FRAME is non-nil, creates a new frame to show the file."
 
     ;; Select and display the destination buffer
     (if ada-xref-other-buffer
-        (if other-frame
-            (find-file-other-frame file)
-          (set 'declaration-buffer (find-file-noselect file))
-          (set-buffer declaration-buffer)
-          (switch-to-buffer-other-window declaration-buffer)
-          )
+       (if other-frame
+           (find-file-other-frame file)
+         (set 'declaration-buffer (find-file-noselect file))
+         (set-buffer declaration-buffer)
+         (switch-to-buffer-other-window declaration-buffer)
+         )
       (find-file file)
       )
 
@@ -2043,11 +2087,11 @@ If OTHER-FRAME is non-nil, creates a new frame to show the file."
 
 
 (defun ada-xref-search-nearest (name)
-  "Searches for NAME nearest to the position recorded in the Xref file.
-It returns the position of the declaration in the buffer or nil if not found."
+  "Search for NAME nearest to the position recorded in the Xref file.
+Return the position of the declaration in the buffer, or nil if not found."
   (let ((orgpos (point))
-        (newpos nil)
-        (diff nil))
+       (newpos nil)
+       (diff nil))
 
     (goto-char (point-max))
 
@@ -2056,33 +2100,33 @@ It returns the position of the declaration in the buffer or nil if not found."
 
       ;; check if it really is a complete Ada identifier
       (if (and
-           (not (save-excursion
-                  (goto-char (match-end 0))
-                  (looking-at "_")))
-           (not (ada-in-string-or-comment-p))
-           (or
-            ;; variable declaration ?
-            (save-excursion
-              (skip-chars-forward "a-zA-Z_0-9" )
-              (ada-goto-next-non-ws)
-              (looking-at ":[^=]"))
-            ;; procedure, function, task or package declaration ?
-            (save-excursion
-              (ada-goto-previous-word)
-              (looking-at "\\<[pP][rR][oO][cC][eE][dD][uU][rR][eE]\\>\\|\\<[fF][uU][nN][cC][tT][iI][oO][nN]\\>\\|\\<[tT][yY][pP][eE]\\>\\|\\<[tT][aA][sS][kK]\\>\\|\\<[pP][aA][cC][kK][aA][gG][eE]\\>\\|\\<[bB][oO][dD][yY]\\>"))))
-
-          ;; check if it is nearer than the ones before if any
-          (if (or (not diff)
-                  (< (abs (- (point) orgpos)) diff))
-              (progn
-                (setq newpos (point)
+          (not (save-excursion
+                 (goto-char (match-end 0))
+                 (looking-at "_")))
+          (not (ada-in-string-or-comment-p))
+          (or
+           ;; variable declaration ?
+           (save-excursion
+             (skip-chars-forward "a-zA-Z_0-9" )
+             (ada-goto-next-non-ws)
+             (looking-at ":[^=]"))
+           ;; procedure, function, task or package declaration ?
+           (save-excursion
+             (ada-goto-previous-word)
+             (looking-at "\\<[pP][rR][oO][cC][eE][dD][uU][rR][eE]\\>\\|\\<[fF][uU][nN][cC][tT][iI][oO][nN]\\>\\|\\<[tT][yY][pP][eE]\\>\\|\\<[tT][aA][sS][kK]\\>\\|\\<[pP][aA][cC][kK][aA][gG][eE]\\>\\|\\<[bB][oO][dD][yY]\\>"))))
+
+         ;; check if it is nearer than the ones before if any
+         (if (or (not diff)
+                 (< (abs (- (point) orgpos)) diff))
+             (progn
+               (setq newpos (point)
                      diff (abs (- newpos orgpos))))))
       )
 
     (if newpos
-        (progn
-          (message "ATTENTION: this declaration is only a (good) guess ...")
-          (goto-char newpos))
+       (progn
+         (message "ATTENTION: this declaration is only a (good) guess ...")
+         (goto-char newpos))
       nil)))
 
 
@@ -2093,26 +2137,26 @@ It returns the position of the declaration in the buffer or nil if not found."
   (ada-require-project-file)
 
   (let ((buffer (ada-get-ali-buffer (buffer-file-name)))
-        (unit-name nil)
-        (body-name nil)
-        (ali-name nil))
+       (unit-name nil)
+       (body-name nil)
+       (ali-name nil))
     (save-excursion
       (set-buffer buffer)
       (goto-char (point-min))
       (re-search-forward "^U \\([^ \t%]+\\)%[bs][ \t]+\\([^ \t]+\\)")
       (setq unit-name (match-string 1))
       (if (not (string-match "\\(.*\\)\\.[^.]+" unit-name))
-          (progn
-            (kill-buffer buffer)
-            (error "No parent unit !"))
-        (setq unit-name (match-string 1 unit-name))
-        )
+         (progn
+           (kill-buffer buffer)
+           (error "No parent unit !"))
+       (setq unit-name (match-string 1 unit-name))
+       )
 
       ;; look for the file name for the parent unit specification
       (goto-char (point-min))
       (re-search-forward (concat "^W " unit-name
-                                 "%s[ \t]+\\([^ \t]+\\)[ \t]+"
-                                 "\\([^ \t\n]+\\)"))
+                                "%s[ \t]+\\([^ \t]+\\)[ \t]+"
+                                "\\([^ \t\n]+\\)"))
       (setq body-name (match-string 1))
       (setq ali-name (match-string 2))
       (kill-buffer buffer)
@@ -2123,15 +2167,15 @@ It returns the position of the declaration in the buffer or nil if not found."
     (save-excursion
       ;; Tries to open the new ali file to find the spec file
       (if ali-name
-          (progn
-            (find-file ali-name)
-            (goto-char (point-min))
-            (re-search-forward (concat "^U " unit-name "%s[ \t]+"
-                                       "\\([^ \t]+\\)"))
-            (setq body-name (match-string 1))
-            (kill-buffer (current-buffer))
-            )
-        )
+         (progn
+           (find-file ali-name)
+           (goto-char (point-min))
+           (re-search-forward (concat "^U " unit-name "%s[ \t]+"
+                                      "\\([^ \t]+\\)"))
+           (setq body-name (match-string 1))
+           (kill-buffer (current-buffer))
+           )
+       )
       )
 
     (find-file body-name)
@@ -2145,15 +2189,22 @@ This is a GNAT specific function that uses gnatkrunch."
     (save-excursion
       (set-buffer krunch-buf)
       ;; send adaname to external process `gnatkr'.
+      ;; Add a dummy extension, since gnatkr versions have two different
+      ;; behaviors depending on the version:
+      ;;   Up to 3.15:   "AA.BB.CC"  =>  aa-bb-cc
+      ;;   After:        "AA.BB.CC"  =>  aa-bb.cc
       (call-process "gnatkr" nil krunch-buf nil
-                    adaname ada-krunch-args)
+                   (concat adaname ".adb") ada-krunch-args)
       ;; fetch output of that process
       (setq adaname (buffer-substring
-                     (point-min)
-                     (progn
-                       (goto-char (point-min))
-                       (end-of-line)
-                       (point))))
+                    (point-min)
+                    (progn
+                      (goto-char (point-min))
+                      (end-of-line)
+                      (point))))
+      ;;  Remove the extra extension we added above
+      (setq adaname (substring adaname 0 -4))
+
       (kill-buffer krunch-buf)))
   adaname
   )
@@ -2161,13 +2212,14 @@ This is a GNAT specific function that uses gnatkrunch."
 (defun ada-make-body-gnatstub (&optional interactive)
   "Create an Ada package body in the current buffer.
 This function uses the `gnatstub' program to create the body.
-This function typically is to be hooked into `ff-file-created-hooks'."
+This function typically is to be hooked into `ff-file-created-hook'."
   (interactive "p")
+  (ada-require-project-file)
 
   (save-some-buffers nil nil)
 
   ;; If the current buffer is the body (as is the case when calling this
-  ;; function from ff-file-created-hooks), then kill this temporary buffer
+  ;; function from ff-file-created-hook), then kill this temporary buffer
   (unless interactive
     (progn
       (set-buffer-modified-p nil)
@@ -2180,17 +2232,12 @@ This function typically is to be hooked into `ff-file-created-hooks'."
   (unless (buffer-file-name (car (buffer-list)))
     (set-buffer (cadr (buffer-list))))
 
-  ;;  Make sure we have a project file (for parameters to gnatstub).  Note that
-  ;;  this might have already been done if we have been called from the hook,
-  ;;  but this is not an expensive call)
-  (ada-require-project-file)
-
   ;; Call the external process gnatstub
   (let* ((gnatstub-opts (ada-treat-cmd-string ada-gnatstub-opts))
-         (filename      (buffer-file-name (car (buffer-list))))
-         (output        (concat (file-name-sans-extension filename) ".adb"))
-         (gnatstub-cmd  (concat "gnatstub " gnatstub-opts " " filename))
-         (buffer        (get-buffer-create "*gnatstub*")))
+        (filename      (buffer-file-name (car (buffer-list))))
+        (output        (concat (file-name-sans-extension filename) ".adb"))
+        (gnatstub-cmd  (concat "gnatstub " gnatstub-opts " " filename))
+        (buffer        (get-buffer-create "*gnatstub*")))
 
     (save-excursion
       (set-buffer buffer)
@@ -2203,33 +2250,34 @@ This function typically is to be hooked into `ff-file-created-hooks'."
     (call-process shell-file-name nil buffer nil "-c" gnatstub-cmd)
 
     (if (save-excursion
-          (set-buffer buffer)
-          (goto-char (point-min))
-          (search-forward "command not found" nil t))
-        (progn
-          (message "gnatstub was not found -- using the basic algorithm")
-          (sleep-for 2)
-          (kill-buffer buffer)
-          (ada-make-body))
+         (set-buffer buffer)
+         (goto-char (point-min))
+         (search-forward "command not found" nil t))
+       (progn
+         (message "gnatstub was not found -- using the basic algorithm")
+         (sleep-for 2)
+         (kill-buffer buffer)
+         (ada-make-body))
 
       ;; Else clean up the output
 
       (if (file-exists-p output)
-          (progn
-            (find-file output)
-            (kill-buffer buffer))
+         (progn
+           (find-file output)
+           (kill-buffer buffer))
 
-        ;; display the error buffer
-        (display-buffer buffer)
-        )
+       ;; display the error buffer
+       (display-buffer buffer)
+       )
       )))
 
 (defun ada-xref-initialize ()
   "Function called by `ada-mode-hook' to initialize the ada-xref.el package.
 For instance, it creates the gnat-specific menus, sets some hooks for
-find-file...."
-  ;; This should really be an `add-hook'.  -stef
-  (setq ff-file-created-hook 'ada-make-body-gnatstub)
+`find-file'..."
+  (remove-hook 'ff-file-created-hook 'ada-make-body) ; from global hook
+  (remove-hook 'ff-file-created-hook 'ada-make-body t) ; from local hook
+  (add-hook 'ff-file-created-hook 'ada-make-body-gnatstub nil t)
 
   ;; Completion for file names in the mini buffer should ignore .ali files
   (add-to-list 'completion-ignored-extensions ".ali")
@@ -2237,24 +2285,19 @@ find-file...."
   (ada-xref-update-project-menu)
   )
 
-
 ;; ----- Add to ada-mode-hook ---------------------------------------------
 
-;;  Use gvd or ddd as the default debugger if it was found
-;;  On windows, do not use the --tty switch for GVD, since this is
-;;  not supported.  Actually, we do not use this on Unix either,
-;;  since otherwise there is no console window left in GVD,
-;;  and people have to use the Emacs one.
 ;;  This must be done before initializing the Ada menu.
-(if (ada-find-file-in-dir "gvd" exec-path)
-    (set 'ada-prj-default-debugger "gvd ")
-  (if (ada-find-file-in-dir "gvd.exe" exec-path)
-     (set 'ada-prj-default-debugger "gvd ")
-  (if (ada-find-file-in-dir "ddd" exec-path)
-      (set 'ada-prj-default-debugger "ddd --tty -fullname -toolbar"))))
-
 (add-hook 'ada-mode-hook 'ada-xref-initialize)
 
+;;  Define a new error type
+(put 'error-file-not-found
+     'error-conditions
+     '(error ada-mode-errors error-file-not-found))
+(put 'error-file-not-found
+     'error-message
+     "File not found in src-dir (check project file): ")
+
 ;;  Initializes the cross references to the runtime library
 (ada-initialize-runtime-library "")
 
index f1d5121..53711ec 100644 (file)
@@ -822,7 +822,7 @@ directly after another one.  E.g:
 result = prefix + \"A message \"
                   \"string.\";      <- c-lineup-string-cont
 
-Nil is returned in other situations, to allow stacking with other
+In other situations, returns nil, to allow stacking with other
 line-up functions.
 
 Works with: topmost-intro-cont, statement-cont, arglist-cont,
index 8b2f5e5..b876930 100644 (file)
@@ -271,7 +271,7 @@ With universal argument, inserts the analysis as a comment on that line."
 ;;           fmt))
     (setq mode-name
          (if (> (length fmt) 1)
-             (concat bare-mode-name fmt) 
+             (concat bare-mode-name fmt)
        bare-mode-name))
     (force-mode-line-update)))
 
@@ -536,7 +536,7 @@ inside a literal or a macro, nothing special happens."
        ;; shut this up too
        (c-echo-syntactic-information-p nil)
        symb-newlines)               ; e.g. (substatement-open . (after))
-    
+
     (setq symb-newlines
          ;; Do not try to insert newlines around a special
          ;; (Pike-style) brace list.
@@ -1661,12 +1661,12 @@ function does not require the declaration to contain a brace block."
 (defun c-narrow-to-comment-innards (range)
   ;; Narrow to the "inside" of the comment (block) defined by range, as
   ;; follows:
-  ;; 
+  ;;
   ;; A c-style block comment has its opening "/*" and its closing "*/" (if
   ;; present) removed.  A c++-style line comment retains its opening "//" but
   ;; has any final NL removed.  If POINT is currently outwith these innards,
   ;; move it to the appropriate boundary.
-  ;; 
+  ;;
   ;; This narrowing simplifies the sentence movement functions, since it
   ;; eliminates awkward things at the boundaries of the comment (block).
   ;;
@@ -1694,7 +1694,7 @@ function does not require the declaration to contain a brace block."
   ;; of the comment and return T.
   ;;
   ;; The BOS is either text which follows a regexp match of sentence-end,
-  ;; or text which is a beginning of "paragraph".  
+  ;; or text which is a beginning of "paragraph".
   ;; Comment-prefixes are treated like WS when calculating BOSes or BOPs.
   ;;
   ;; This code was adapted from GNU Emacs's forward-sentence in paragraphs.el.
@@ -2104,7 +2104,7 @@ function does not require the declaration to contain a brace block."
           ((looking-at c-string-limit-regexp) ; Just gone back over a string terminator?
            (goto-char last)
            (throw 'done '(t . literal)))
-        
+
           ;; Nothing special: go back word characters.
           (t (skip-syntax-backward "w_")) ; Speedup only.
           ))))))
@@ -2136,7 +2136,7 @@ function does not require the declaration to contain a brace block."
   ;; As a clarification of "after the end-of-statement", if a comment or
   ;; whitespace follows a completed AWK statement, that statement is treated
   ;; as ending just after the last non-ws character before the comment.
-  ;; 
+  ;;
   ;; Note that this function moves within either preprocessor commands
   ;; (macros) or normal code, but not both within the same invocation.
   ;;
@@ -2427,7 +2427,7 @@ sentence motion in or near comments and multiline strings."
 
        (if (/= count 0) (setq count (1- count))))
       (c-keep-region-active))))
-                              
+
 
 \f
 ;; set up electric character functions to work with pending-del,
@@ -2560,7 +2560,7 @@ forward."
   (interactive "p")
   (c-forward-conditional (- count) -1)
   (c-keep-region-active))
-  
+
 (defun c-up-conditional-with-else (count)
   "Move back to the containing preprocessor conditional, including \"#else\".
 Just like `c-up-conditional', except it also stops at \"#else\"
@@ -2782,7 +2782,7 @@ prefix argument is equivalent to -1.
 
 (defun c-indent-exp (&optional shutup-p)
   "Indent each line in the balanced expression following point syntactically.
-If optional SHUTUP-P is non-nil, no errors are signalled if no
+If optional SHUTUP-P is non-nil, no errors are signaled if no
 balanced expression is found."
   (interactive "*P")
   (let ((here (point-marker))
@@ -3611,7 +3611,7 @@ command to conveniently insert and align the necessary backslashes."
        hang-ender-stuck
        ;; auto-fill-spaces is the exact sequence of whitespace between a
        ;; comment's last word and the comment ender, temporarily replaced
-       ;; with 'x's before calling FUN when FILL-PARAGRAPH is nil.  
+       ;; with 'x's before calling FUN when FILL-PARAGRAPH is nil.
        auto-fill-spaces
        (here (point))
        (c-lit-limits c-lit-limits)
index 9c05150..8473eee 100644 (file)
@@ -897,7 +897,11 @@ casts and declarations are fontified.  Used on level 2 and higher."
             "[;,]\\|\\s)\\|\\'\\|\\(=\\|\\s(\\)" limit t t))
 
       (setq next-pos (match-beginning 0)
-           id-face (if (eq (char-after next-pos) ?\()
+           id-face (if (and (eq (char-after next-pos) ?\()
+                            (let (c-last-identifier-range)
+                              (save-excursion
+                                (goto-char next-pos)
+                                (c-at-toplevel-p))))
                        'font-lock-function-name-face
                      'font-lock-variable-name-face)
            got-init (and (match-beginning 1)
@@ -1170,21 +1174,39 @@ casts and declarations are fontified.  Used on level 2 and higher."
              (c-fontify-recorded-types-and-refs)
              nil))
 
-         ;; It was a false alarm.  Check if we're in a label instead.
+         ;; It was a false alarm.
          (goto-char start-pos)
-         (when (c-forward-label t match-pos nil)
-           ;; Can't use `c-fontify-types-and-refs' here since we
-           ;; should use the label face.
-           (let (elem)
-             (while c-record-ref-identifiers
-               (setq elem (car c-record-ref-identifiers)
-                     c-record-ref-identifiers (cdr c-record-ref-identifiers))
-               (c-put-font-lock-face (car elem) (cdr elem)
-                                     c-label-face-name)))
-           ;; `c-forward-label' probably has added a `c-decl-end'
-           ;; marker, so return t to `c-find-decl-spots' to signal
-           ;; that.
-           t))))
+         ;; The below code attempts to fontify the case constants in
+         ;; c-label-face-name, but it cannot catch every case [sic].
+         ;; And do we want to fontify case constants anyway?
+         nil
+;;;      (when (c-forward-label t match-pos nil)
+;;;        ;; Can't use `c-fontify-types-and-refs' here since we
+;;;        ;; should use the label face.
+;;;        (save-excursion
+;;;          (while c-record-ref-identifiers
+;;;            (let ((elem (car c-record-ref-identifiers))
+;;;                  c-record-type-identifiers)
+;;;              (goto-char (cdr elem))
+;;;              ;; Find the end of any label.
+;;;              (while (and (re-search-forward "\\sw\\|:" nil t)
+;;;                          (progn (backward-char 1) t)
+;;;                          (or (re-search-forward
+;;;                               "\\=0[Xx][0-9A-Fa-f]+\\|\\([0-9]+\\)" nil t)
+;;;                              (c-forward-name)))
+;;;                (c-backward-syntactic-ws)
+;;;                (let ((end (point)))
+;;;                  ;; Now find the start of the bit we regard as the label.
+;;;                  (when (and (c-simple-skip-symbol-backward)
+;;;                             (not (c-get-char-property (point) 'face)))
+;;;                    (c-put-font-lock-face (point) end c-label-face-name))
+;;;                  (goto-char end))))
+;;;            (setq c-record-ref-identifiers (cdr c-record-ref-identifiers))))
+;;;        ;; `c-forward-label' probably has added a `c-decl-end'
+;;;        ;; marker, so return t to `c-find-decl-spots' to signal
+;;;        ;; that.
+;;;        t)
+         )))
 
       nil)))
 
index 0e67387..2abc766 100644 (file)
@@ -809,7 +809,7 @@ then no newline is inserted."
 This is used by the functions that automatically insert or align the
 line continuation backslashes in multiline macros.  If any line in the
 macro exceeds this column then the next tab stop from that line is
-used as alignment column instead."
+used as alignment column instead.  See also `c-backslash-max-column'."
   :type 'integer
   :group 'c)
 ;;;###autoload(put 'c-backslash-column 'safe-local-variable 'integerp)
index 7d9ce41..04a5cf9 100644 (file)
@@ -61,7 +61,7 @@
 
 ;; TYPE is 0 for info or 1 for warning if the message matcher identified it as
 ;; such, 2 otherwise (for a real error).  END-LOC is a LOC pointing to the
-;; other end, if the parsed message contained a range. If the end of the
+;; other end, if the parsed message contained a range.  If the end of the
 ;; range didn't specify a COLUMN, it defaults to -1, meaning end of line.
 ;; These are the value of the `message' text-properties in the compilation
 ;; buffer.
@@ -397,7 +397,7 @@ be added."
 (defvar compilation-directory-matcher
   '("\\(?:Entering\\|Leavin\\(g\\)\\) directory `\\(.+\\)'$" (2 . 1))
   "A list for tracking when directories are entered or left.
-Nil means not to track directories, e.g. if all file names are absolute.  The
+If nil, do not track directories, e.g. if all file names are absolute.  The
 first element is the REGEXP matching these messages.  It can match any number
 of variants, e.g. different languages.  The remaining elements are all of the
 form (DIR .  LEAVE).  If for any one of these the DIR'th subexpression
@@ -499,7 +499,7 @@ This only affects platforms that support asynchronous processes (see
 
 ;; A weak per-compilation-buffer hash indexed by (FILENAME . DIRECTORY).  Each
 ;; value is a FILE-STRUCTURE as described above, with the car eq to the hash
-;; key.         This holds the tree seen from root, for storing new nodes.
+;; key.  This holds the tree seen from root, for storing new nodes.
 (defvar compilation-locs ())
 
 (defvar compilation-debug nil
@@ -627,12 +627,12 @@ Faces `compilation-error-face', `compilation-warning-face',
       keymap compilation-button-map
       help-echo "mouse-2: visit this directory")))
 
-;; Data type `reverse-ordered-alist' retriever.         This function retrieves the
+;; Data type `reverse-ordered-alist' retriever.  This function retrieves the
 ;; KEY element from the ALIST, creating it in the right position if not already
 ;; present. ALIST structure is
 ;; '(ANCHOR (KEY1 ...) (KEY2 ...)... (KEYn ALIST ...))
 ;; ANCHOR is ignored, but necessary so that elements can be inserted.  KEY1
-;; may be nil. The other KEYs are ordered backwards so that growing line
+;; may be nil.  The other KEYs are ordered backwards so that growing line
 ;; numbers can be inserted in front and searching can abort after half the
 ;; list on average.
 (eval-when-compile                 ;Don't keep it at runtime if not needed.
@@ -1069,7 +1069,8 @@ Returns the compilation buffer created."
              ;; Set the EMACS variable, but
              ;; don't override users' setting of $EMACS.
              (unless (getenv "EMACS")
-               (list (concat "EMACS=" invocation-directory invocation-name)))
+               (list "EMACS=t"))
+             (list "INSIDE_EMACS=t")
              (copy-sequence process-environment))))
        (set (make-local-variable 'compilation-arguments)
             (list command mode name-function highlight-regexp))
index 26bbb8f..983087d 100644 (file)
@@ -1783,6 +1783,7 @@ or as help on variables `cperl-tips', `cperl-problems',
          (if (fboundp 'compilation-build-compilation-error-regexp-alist)
              (let ((f 'compilation-build-compilation-error-regexp-alist))
                (funcall f))
+           (make-local-variable 'compilation-error-regexp-alist)
            (push 'cperl compilation-error-regexp-alist)))
        ((boundp 'compilation-error-regexp-alist);; xmeacs 19.x
         (make-local-variable 'compilation-error-regexp-alist)
index 9f27c8a..eb20324 100644 (file)
@@ -275,7 +275,7 @@ Please send all bug fixes and enhancements to
 ;;    ;; 8-bit accentuated characters) except `"', as `"' is used to delimit a
 ;;    ;; terminal.  Also, accepts escaped characters, that is, a character
 ;;    ;; pair starting with `\' followed by a printable character, for
-;;    ;; example: \", \\. 
+;;    ;; example: \", \\.
 ;;
 ;;    special = "[^?\\000-\\010\\012-\\037\\177-\\237]*".
 ;;    ;; that is, a valid special accepts any printable character (including
@@ -800,7 +800,7 @@ Please send all bug fixes and enhancements to
 ;; `ebnf-reset-style'  Reset current style.
 ;;
 ;; `ebnf-push-style'   Push the current style and set STYLE as the current
-;;                     style. 
+;;                     style.
 ;;
 ;; `ebnf-pop-style'    Pop a style and set it as the current style.
 ;;
@@ -1968,7 +1968,7 @@ when executing ebnf2ps, set `ebnf-use-float-format' to nil."
 
 
 (defcustom ebnf-stop-on-error nil
-  "*Non-nil means signal error and stop. Nil means signal error and continue."
+  "*Non-nil means signal error and stop.  Otherwise, signal error and continue."
   :type 'boolean
   :version "20"
   :group 'ebnf2ps)
index e661552..6b0a44f 100644 (file)
@@ -1007,8 +1007,9 @@ All others return `comment-column', leaving at least one space after code."
                (skip-chars-backward " \t")
                (bolp)))
         (f90-calculate-indent))
-       (t (skip-chars-backward " \t")
-          (max (if (bolp) 0 (1+ (current-column))) comment-column))))
+       (t (save-excursion
+             (skip-chars-backward " \t")
+             (max (if (bolp) 0 (1+ (current-column))) comment-column)))))
 
 (defsubst f90-present-statement-cont ()
   "Return continuation properties of present statement.
@@ -1470,6 +1471,7 @@ If run in the middle of a line, the line is not broken."
   (interactive "*r")
   (let ((end-region-mark (copy-marker end-region))
         (save-point (point-marker))
+        (case-fold-search t)
        block-list ind-lev ind-curr ind-b cont struct beg-struct end-struct)
     (goto-char beg-region)
     ;; First find a line which is not a continuation line or comment.
index b37be18..9f5031b 100644 (file)
@@ -2,8 +2,8 @@
 
 ;; Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation
 
-;; Author:  Pavel Kobiakov <pk_at_work@yahoo.com>
-;; Maintainer: Pavel Kobiakov <pk_at_work@yahoo.com>
+;; Author:  Pavel Kobyakov <pk_at_work@yahoo.com>
+;; Maintainer: Pavel Kobyakov <pk_at_work@yahoo.com>
 ;; Version: 0.3
 ;; Keywords: c languages tools
 
@@ -117,6 +117,30 @@ Zero-length substrings at the beginning and end of the list are omitted."
       'line-end-position
     (lambda (&optional arg) (save-excursion (end-of-line arg) (point)))))
 
+(defun flymake-posn-at-point-as-event (&optional position window dx dy)
+  "Return pixel position of top left corner of glyph at POSITION,
+relative to top left corner of WINDOW, as a mouse-1 click
+event (identical to the event that would be triggered by clicking
+mouse button 1 at the top left corner of the glyph).
+
+POSITION and WINDOW default to the position of point in the
+selected window.
+
+DX and DY specify optional offsets from the top left of the glyph."
+  (unless window (setq window (selected-window)))
+  (unless position (setq position (window-point window)))
+  (unless dx (setq dx 0))
+  (unless dy (setq dy 0))
+
+  (let* ((pos (posn-at-point position window))
+         (x-y (posn-x-y pos))
+         (edges (window-inside-pixel-edges window))
+         (win-x-y (window-pixel-edges window)))
+    ;; adjust for window edges
+    (setcar (nthcdr 2 pos)
+            (cons (+ (car x-y) (car  edges) (- (car win-x-y))  dx)
+                  (+ (cdr x-y) (cadr edges) (- (cadr win-x-y)) dy)))
+    (list 'mouse-1 pos)))
 
 (defun flymake-popup-menu (menu-data)
   "Pop up the flymake menu at point, using the data MENU-DATA.
@@ -134,7 +158,7 @@ MENU-DATA is a list of error and warning messages returned by
        (popup-menu (flymake-make-xemacs-menu menu-data)
                     (make-event 'button-press fake-event-props)))
     (x-popup-menu (if (eval-when-compile (fboundp 'posn-at-point))
-                      (posn-at-point)
+                      (flymake-posn-at-point-as-event)
                     (list (flymake-get-point-pixel-pos) (selected-window)))
                   (flymake-make-emacs-menu menu-data))))
 
index c7a1752..fcc9db1 100644 (file)
@@ -385,8 +385,8 @@ program\\|subroutine\\)\\>[ \t]*\\(\\sw+\\)?"
                             "dabs" "cabs" "mod" "amod" "dmod" "isign"
                             "sign" "dsign" "idim" "dim" "ddim" "dprod"
                             "max" "max0" "amax1" "dmax1" "amax0" "max1"
-                            "min0" "amin1" "dmin1" "amin0" "min1" "len"
-                            "index" "lge" "lgt" "lle" "llt" "aimag"
+                            "min" "min0" "amin1" "dmin1" "amin0" "min1"
+                            "len" "index" "lge" "lgt" "lle" "llt" "aimag"
                             "conjg" "sqrt" "dsqrt" "csqrt" "exp" "dexp"
                             "cexp" "log" "alog" "dlog" "clog" "log10"
                             "alog10" "dlog10" "sin" "dsin" "csin" "cos"
@@ -968,7 +968,7 @@ See also `fortran-window-create'."
            (error (error "No room for Fortran window")))
          (message "Type SPC to continue editing.")
          (let ((char (read-event)))
-           (or (equal char (string-to-char " "))
+           (or (equal char ?\s)
                (setq unread-command-events (list char))))))
     (fortran-window-create)))
 
index 007033a..2259523 100644 (file)
@@ -312,11 +312,11 @@ Also display the main routine in the disassembly buffer if present."
   :version "22.1")
 
 (defcustom gdb-many-windows nil
-  "Nil means just pop up the GUD buffer unless `gdb-show-main' is t.
-In this case it starts with two windows: one displaying the GUD
+  "If nil just pop up the GUD buffer unless `gdb-show-main' is t.
+In this case start with two windows: one displaying the GUD
 buffer and the other with the source file with the main routine
-of the debugged program.  Non-nil means display the layout shown for
-`gdba'."
+of the debugged program.  Non-nil means display the layout shown
+for `gdba'."
   :type 'boolean
   :group 'gud
   :version "22.1")
index dadc9cf..90e6fbe 100644 (file)
@@ -110,6 +110,13 @@ but will have their capitals in bold."
   :group 'glasses
   :type 'boolean)
 
+(defcustom glasses-separate-parentheses-exceptions
+  '("^#[\t ]*define[\t ]*[A-Za-z0-9_-]* ?($")
+  "List of regexp that are exceptions for `glasses-separate-parentheses-p'.
+They are matched to the current line truncated to the point where the
+parenthesis expression starts."
+  :group 'glasses
+  :type '(repeat regexp))
 
 (defcustom glasses-uncapitalize-p nil
   "If non-nil, downcase embedded capital letters in identifiers.
@@ -153,6 +160,14 @@ Used in :set parameter of some customized glasses variables."
 
 ;;; Utility functions
 
+(defun glasses-parenthesis-exception-p (beg end)
+  "Tell if (BEG, END) is an exception to `glasses-separate-parentheses-p'.
+See `glasses-separate-parentheses-exceptions'."
+  (save-match-data
+    (let ((str (buffer-substring beg end)))
+      (catch 'match
+       (dolist (re glasses-separate-parentheses-exceptions)
+         (and (string-match re str) (throw 'match t)))))))
 
 (defun glasses-set-overlay-properties ()
   "Set properties of glasses overlays.
@@ -232,8 +247,9 @@ CATEGORY is the overlay category.  If it is nil, use the `glasses' category."
        (when glasses-separate-parentheses-p
          (goto-char beg)
          (while (re-search-forward "[a-zA-Z]_*\\(\(\\)" end t)
-           (glasses-make-overlay (match-beginning 1) (match-end 1)
-                                 'glasses-parenthesis)))))))
+           (unless (glasses-parenthesis-exception-p (point-at-bol) (match-end 1))
+             (glasses-make-overlay (match-beginning 1) (match-end 1)
+                                   'glasses-parenthesis))))))))
 
 
 (defun glasses-make-unreadable (beg end)
@@ -247,30 +263,31 @@ CATEGORY is the overlay category.  If it is nil, use the `glasses' category."
   "Convert current buffer to unreadable identifiers and return nil.
 This function modifies buffer contents, it removes all the separators,
 recognized according to the current value of the variable `glasses-separator'."
-  (when (and glasses-convert-on-write-p
-            (not (string= glasses-separator "")))
+  (when glasses-convert-on-write-p
     (let ((case-fold-search nil)
          (separator (regexp-quote glasses-separator)))
       (save-excursion
-       (goto-char (point-min))
-       (while (re-search-forward
-               (format "[a-z]\\(%s\\)[A-Z]\\|[A-Z]\\(%s\\)[A-Z][a-z]"
-                       separator separator)
-               nil t)
-         (let ((n (if (match-string 1) 1 2)))
-           (replace-match "" t nil nil n)
-           (goto-char (match-end n))))
-       (unless (string= glasses-separator glasses-original-separator)
+       (unless (string= glasses-separator "")
          (goto-char (point-min))
-         (while (re-search-forward (format "[a-zA-Z0-9]\\(%s+\\)[a-zA-Z0-9]"
-                                           separator)
-                                   nil t)
-           (replace-match glasses-original-separator nil nil nil 1)
-           (goto-char (match-beginning 1))))
+         (while (re-search-forward
+                 (format "[a-z]\\(%s\\)[A-Z]\\|[A-Z]\\(%s\\)[A-Z][a-z]"
+                         separator separator)
+                 nil t)
+           (let ((n (if (match-string 1) 1 2)))
+             (replace-match "" t nil nil n)
+             (goto-char (match-end n))))
+         (unless (string= glasses-separator glasses-original-separator)
+           (goto-char (point-min))
+           (while (re-search-forward (format "[a-zA-Z0-9]\\(%s+\\)[a-zA-Z0-9]"
+                                             separator)
+                                     nil t)
+             (replace-match glasses-original-separator nil nil nil 1)
+             (goto-char (match-beginning 1)))))
        (when glasses-separate-parentheses-p
          (goto-char (point-min))
          (while (re-search-forward "[a-zA-Z]_*\\( \\)\(" nil t)
-           (replace-match "" t nil nil 1))))))
+           (unless (glasses-parenthesis-exception-p (point-at-bol) (1+ (match-end 1)))
+             (replace-match "" t nil nil 1)))))))
   ;; nil must be returned to allow use in write file hooks
   nil)
 
index b42e1b7..fc7c303 100644 (file)
@@ -394,8 +394,6 @@ t means that there is no stack, and we are in display-file mode.")
     (define-key gud-speedbar-key-map "e" 'speedbar-edit-line)
     (define-key gud-speedbar-key-map "\C-m" 'speedbar-edit-line)
     (define-key gud-speedbar-key-map " " 'speedbar-toggle-line-expansion)
-    (define-key gud-speedbar-key-map "[" 'speedbar-expand-line-descendants)
-    (define-key gud-speedbar-key-map "]" 'speedbar-contract-line-descendants)
     (define-key gud-speedbar-key-map "D" 'gdb-var-delete)
     (define-key gud-speedbar-key-map "p" 'gud-pp))
 
@@ -624,7 +622,7 @@ required by the caller."
 
     ;; Does the remaining text look like it might end with the
     ;; beginning of another marker?  If it does, then keep it in
-    ;; gud-marker-acc until we receive the rest of it. Since we
+    ;; gud-marker-acc until we receive the rest of it.  Since we
     ;; know the full marker regexp above failed, it's pretty simple to
     ;; test for marker starts.
     (if (string-match "\n\\(\032.*\\)?\\'" gud-marker-acc)
@@ -680,15 +678,19 @@ directory and source-file directory for your debugger.  By
 default this command starts GDB using a graphical interface.  See
 `gdba' for more information.
 
-To run GDB in text command mode, set `gud-gdb-command-name' to
-\"gdb --fullname\" and include the pathname, if necessary."
+To run GDB in text command mode, replace the GDB \"--annotate=3\"
+option with \"--fullname\" either in the minibuffer for the
+current Emacs session, or the custom variable
+`gud-gdb-command-name' for all future sessions.  You need to use
+text command mode to debug multiple programs within one Emacs
+session."
   (interactive (list (gud-query-cmdline 'gdb)))
 
   (if (and gud-comint-buffer
           (buffer-name gud-comint-buffer)
           (get-buffer-process gud-comint-buffer)
           (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)))
-      (error "Multiple debugging is only supported with \"gdb --fullname\""))
+      (error "Multiple debugging requires restarting in text command mode"))
 
   (gud-common-init command-line nil 'gud-gdb-marker-filter)
   (set (make-local-variable 'gud-minor-mode) 'gdb)
@@ -1457,7 +1459,7 @@ into one that invokes an Emacs-enabled debugging session.
 
     ;; Does the remaining text look like it might end with the
     ;; beginning of another marker?  If it does, then keep it in
-    ;; gud-marker-acc until we receive the rest of it. Since we
+    ;; gud-marker-acc until we receive the rest of it.  Since we
     ;; know the full marker regexp above failed, it's pretty simple to
     ;; test for marker starts.
     (if (string-match "\032.*\\'" gud-marker-acc)
@@ -1562,7 +1564,7 @@ and source-file directory for your debugger."
 
     ;; Does the remaining text look like it might end with the
     ;; beginning of another marker?  If it does, then keep it in
-    ;; gud-marker-acc until we receive the rest of it. Since we
+    ;; gud-marker-acc until we receive the rest of it.  Since we
     ;; know the full marker regexp above failed, it's pretty simple to
     ;; test for marker starts.
     (if (string-match gud-pdb-marker-regexp-start gud-marker-acc)
@@ -1861,7 +1863,7 @@ extension EXTN.  Normally EXTN is given as the regular expression
     (forward-char))
   (forward-char))
 
-;; Move point past the following block.         There may be (legal) cruft before
+;; Move point past the following block.  There may be (legal) cruft before
 ;; the block's opening brace.  There must be a block or it's the end of life
 ;; in petticoat junction.
 (defun gud-jdb-skip-block ()
@@ -2049,7 +2051,7 @@ extension EXTN.  Normally EXTN is given as the regular expression
        massaged-args)))
 
 ;; Search for an association with P, a fully qualified class name, in
-;; gud-jdb-class-source-alist. The asssociation gives the fully
+;; gud-jdb-class-source-alist.  The asssociation gives the fully
 ;; qualified file name of the source file which produced the class.
 (defun gud-jdb-find-source-file (p)
   (cdr (assoc p gud-jdb-class-source-alist)))
@@ -2217,7 +2219,7 @@ nil)
 (defun jdb (command-line)
   "Run jdb with command line COMMAND-LINE in a buffer.
 The buffer is named \"*gud*\" if no initial class is given or
-\"*gud-<initial-class-basename>*\" if there is.         If the \"-classpath\"
+\"*gud-<initial-class-basename>*\" if there is.  If the \"-classpath\"
 switch is given, omit all whitespace between it and its value.
 
 See `gud-jdb-use-classpath' and `gud-jdb-classpath' documentation for
@@ -2794,7 +2796,7 @@ Obeying it means displaying in another window the specified file and line."
            (cond ((or (< pos (point-min)) (> pos (point-max)))
                   (widen)
                   (goto-char pos))))
-         (when window 
+         (when window
            (set-window-point window gud-overlay-arrow-position)
            (if (memq gud-minor-mode '(gdbmi gdba))
                (setq gdb-source-window window)))))))
index e7ed67c..e50a9a4 100644 (file)
@@ -706,6 +706,7 @@ and `case-fold-search' are both t."
       (if (and c-reg (nth 0 c-reg))
           ;; point is inside a comment, and that comment is hidable
           (goto-char (nth 0 c-reg))
+       (end-of-line)
         (when (and (not c-reg)
                    (hs-find-block-beginning)
                    (looking-at hs-block-start-regexp))
index e572631..1d37024 100644 (file)
@@ -6,7 +6,7 @@
 ;; Authors: J.D. Smith <jdsmith@as.arizona.edu>
 ;;          Carsten Dominik <dominik@science.uva.nl>
 ;; Maintainer: J.D. Smith <jdsmith@as.arizona.edu>
-;; Version: 6.0_em22
+;; Version: 6.1_em22
 
 ;; This file is part of GNU Emacs.
 
@@ -307,10 +307,12 @@ Here are all keybindings.
                           (> (length idlwave-html-help-location) 0)
                           idlwave-html-help-location)
                      (getenv "IDLWAVE_HELP_LOCATION"))))
-    (if (file-directory-p syshelp-dir) 
+    (if (and syshelp-dir (file-directory-p syshelp-dir))
        syshelp-dir
-      (setq help-dir (expand-file-name "idl_html_help" help-dir))
-      (if (file-directory-p help-dir) help-dir))))
+      (if help-dir 
+         (progn
+           (setq help-dir (expand-file-name "idl_html_help" help-dir))
+           (if (file-directory-p help-dir) help-dir))))))
       
 (defvar idlwave-help-assistant-available nil) 
 
@@ -319,6 +321,7 @@ Here are all keybindings.
   (let ((sys-dir (idlwave-sys-dir))
        (help-loc (idlwave-html-help-location)))
     (if (or (not (file-directory-p sys-dir))
+           (not help-loc)
            (not (file-directory-p help-loc)))
        (message
         "HTML help location not found: try setting `idlwave-system-directory' and/or `idlwave-html-help-location'."))
@@ -1239,8 +1242,8 @@ IDL assistant.")
 (defun idlwave-help-assistant-command ()
   (expand-file-name idlwave-help-assistant-command (idlwave-sys-dir)))
 
-(defun idlwave-help-assistant-start (&optional link)
-  "Start the IDL Assistant, loading LINK, if passed."
+(defun idlwave-help-assistant-start (&optional full-link)
+  "Start the IDL Assistant, loading link FULL-LINK, if passed."
   (when (or (not idlwave-help-assistant-socket)
            (not (eq (process-status idlwave-help-assistant-socket) 'open)))
     (let* ((help-loc (idlwave-html-help-location))
@@ -1249,8 +1252,7 @@ IDL assistant.")
            (nconc
             (if (memq system-type '(ms-dos windows-nt))
                 `("-profile" ,(expand-file-name "idl.adp" help-loc)))
-            (if link 
-                `("-file" ,(expand-file-name link help-loc)))))
+            (if full-link `("-file" ,full-link))))
           port)
       (if idlwave-help-assistant-socket 
          (delete-process idlwave-help-assistant-socket))
@@ -1271,8 +1273,10 @@ IDL assistant.")
              (open-network-stream "IDL_ASSISTANT_SOCK" 
                                   nil "localhost" port))
        (if (eq (process-status idlwave-help-assistant-socket) 'open)
-           (process-send-string  idlwave-help-assistant-socket
-                                 (concat "setHelpPath " help-loc "\n"))
+           (progn
+             (process-send-string  idlwave-help-assistant-socket
+                                   (concat "setHelpPath " help-loc "\n"))
+             t)
          (idlwave-help-assistant-close)
          (error "Cannot communicate with IDL_ASSISTANT"))))))
 
@@ -1282,17 +1286,57 @@ IDL assistant.")
 
 (defun idlwave-help-assistant-open-link (&optional link)
   ;; Open a link (file name with anchor, no leading path) in the assistant.
-  (if link 
-      (let ((file (expand-file-name link (idlwave-html-help-location))))
-       (idlwave-help-assistant-start link)
-       (process-send-string idlwave-help-assistant-socket
-                            (concat "openLink " file "\n"))
-       (string-match "\.html" link)
-       (process-send-string idlwave-help-assistant-socket
-                            (concat "searchIndexNoOpen " 
-                                    (substring link 0 (match-beginning 0))
-                                    "\n")))
-    (idlwave-help-assistant-raise)))
+  (let ((help-loc (idlwave-html-help-location))
+       topic anchor file just-started exists full-link)
+    
+    (if (string-match "\.html" link)
+       (setq topic (substring link 0 (match-beginning 0))
+             anchor (substring link (match-end 0)))
+      (error "Malformed help link."))
+    
+    (setq file (expand-file-name (concat topic ".html") help-loc))
+    (if (file-exists-p file)
+       (setq exists t)
+      (setq file (expand-file-name 
+                 (concat (upcase topic) ".html") help-loc))
+      (setq exists (file-exists-p file)))
+    
+    (setq full-link    (concat file anchor)
+         just-started (idlwave-help-assistant-start (if exists full-link)))
+    (if exists
+       (progn
+         (if (not just-started)
+             (process-send-string idlwave-help-assistant-socket
+                                  (concat "openLink " full-link "\n")))
+         (process-send-string idlwave-help-assistant-socket
+                              (concat "searchIndexNoOpen " topic "\n")))
+      (process-send-string idlwave-help-assistant-socket
+                          (concat "searchIndexAndOpen " topic "\n"))))
+  (idlwave-help-assistant-raise))
+
+(defvar idlwave-help-assistant-help-with-topic-history nil
+  "The history of help topics selected with the minibuffer.")
+
+(defun idlwave-help-assistant-help-with-topic (&optional topic)
+  "Prompt for and provide help with TOPIC."
+  (interactive)
+  (let (list)
+    (unless topic
+      (idlwave-routines)
+      (setq list (append (mapcar (lambda (x)
+                                  (concat (nth 2 x) (car x)))
+                                idlwave-system-routines)
+                        (mapcar (lambda (x)
+                                  (concat "." (car x)))
+                                idlwave-executive-commands-alist)
+                        idlwave-system-class-info))
+      (setq topic 
+           (idlwave-completing-read 
+            "Help Topic: " list
+            nil nil nil
+            'idlwave-help-assistant-help-with-topic-history)))
+    (if (and topic (not (string= topic "")))
+       (idlwave-help-assistant-open-link (concat topic ".html")))))
   
 (defun idlwave-help-assistant-close ()
   (when (and idlwave-help-assistant-process
index f4c117f..9f43aa1 100644 (file)
@@ -6,7 +6,7 @@
 ;;          Carsten Dominik <dominik@astro.uva.nl>
 ;;          Chris Chase <chase@att.com>
 ;; Maintainer: J.D. Smith <jdsmith@as.arizona.edu>
-;; Version: 6.0_em22
+;; Version: 6.1_em22
 ;; Keywords: processes
 
 ;; This file is part of GNU Emacs.
@@ -31,7 +31,7 @@
 ;; This mode is for IDL version 5 or later.  It should work on
 ;; Emacs>20.3 or XEmacs>20.4.
 ;;
-;; Runs IDL as an inferior process of Emacs, much like the emacs
+;; Runs IDL as an inferior process of Emacs, much like the Emacs
 ;; `shell' or `telnet' commands.  Provides command history and
 ;; searching.  Provides debugging commands available in buffers
 ;; visiting IDL procedure files, e.g., breakpoint setting, stepping,
@@ -252,7 +252,7 @@ to set this option to nil."
   :group 'idlwave-shell-general-setup
   :type 'boolean)
 
-(defcustom idlwave-shell-file-name-chars "~/A-Za-z0-9+:_.$#%={}\\-"
+(defcustom idlwave-shell-file-name-chars "~/A-Za-z0-9+:_.$#%={}\\- "
   "The characters allowed in file names, as a string.
 Used for file name completion. Must not contain `'', `,' and `\"'
 because these are used as separators by IDL."
@@ -1573,7 +1573,8 @@ and then calls `idlwave-shell-send-command' for any pending commands."
                      (re-search-backward idlwave-shell-prompt-pattern nil t)
                      (goto-char (match-end 0))
                      (setq idlwave-shell-command-output
-                     (buffer-substring-no-properties (point-min) (point)))
+                           (buffer-substring-no-properties 
+                            (point-min) (point)))
                      (delete-region (point-min) (point)))
                  (setq idlwave-shell-command-output
                        (with-current-buffer (process-buffer proc)
@@ -2101,7 +2102,7 @@ HEAP_GC, /VERBOSE"
 Change the default directory for the process buffer to concur."
   (save-excursion
     (set-buffer (idlwave-shell-buffer))
-    (if (string-match ",___cur[\n\r]\\(\\S-*\\) *[\n\r]"
+    (if (string-match ",___cur[\n\r ]+\\([^\n\r]+\\)[\n\r]"
                      idlwave-shell-command-output)
        (let ((dir (substring idlwave-shell-command-output 
                              (match-beginning 1) (match-end 1))))
@@ -4099,13 +4100,15 @@ Otherwise, just expand the file name."
 
 ;(define-key idlwave-shell-mode-map "\M-?" 'comint-dynamic-list-completions)
 ;(define-key idlwave-shell-mode-map "\t" 'comint-dynamic-complete)
+(define-key idlwave-shell-mode-map "\C-w"     'comint-kill-region)
 (define-key idlwave-shell-mode-map "\t"       'idlwave-shell-complete)
 (define-key idlwave-shell-mode-map "\M-\t"    'idlwave-shell-complete)
 (define-key idlwave-shell-mode-map "\C-c\C-s" 'idlwave-shell)
 (define-key idlwave-shell-mode-map "\C-c?"    'idlwave-routine-info)
 (define-key idlwave-shell-mode-map "\C-g"     'idlwave-keyboard-quit)
 (define-key idlwave-shell-mode-map "\M-?"     'idlwave-context-help)
-(define-key idlwave-shell-mode-map [(control meta ?\?)] 'idlwave-online-help)
+(define-key idlwave-shell-mode-map [(control meta ?\?)] 
+  'idlwave-help-assistant-help-with-topic)
 (define-key idlwave-shell-mode-map "\C-c\C-i" 'idlwave-update-routine-info)
 (define-key idlwave-shell-mode-map "\C-c\C-y" 'idlwave-shell-char-mode-loop)
 (define-key idlwave-shell-mode-map "\C-c\C-x" 'idlwave-shell-send-char)
index 6617df7..28d184b 100644 (file)
@@ -4,7 +4,7 @@
 
 ;; Author: Carsten Dominik <dominik@astro.uva.nl>
 ;; Maintainer: J.D. Smith <jdsmith@as.arizona.edu>
-;; Version: 6.0_em22
+;; Version: 6.1_em22
 ;; Keywords: processes
 
 ;; This file is part of GNU Emacs.
index 52cfa60..6fa03c2 100644 (file)
@@ -6,7 +6,7 @@
 ;;          Carsten Dominik <dominik@science.uva.nl>
 ;;          Chris Chase <chase@att.com>
 ;; Maintainer: J.D. Smith <jdsmith@as.arizona.edu>
-;; Version: 6.0_em22
+;; Version: 6.1_em22
 ;; Keywords: languages
 
 ;; This file is part of GNU Emacs.
@@ -1393,7 +1393,7 @@ Normally a space.")
   "Character which is inserted as a last character on previous line by
    \\[idlwave-split-line] to begin a continuation line.  Normally $.")
 
-(defconst idlwave-mode-version "6.0_em22")
+(defconst idlwave-mode-version "6.1_em22")
 
 (defmacro idlwave-keyword-abbrev (&rest args)
   "Creates a function for abbrev hooks to call `idlwave-check-abbrev' with args."
@@ -1595,7 +1595,8 @@ Capitalize system variables - action only
 (define-key idlwave-mode-map "\C-c\C-t"   'idlwave-find-module-this-file)
 (define-key idlwave-mode-map "\C-c?"      'idlwave-routine-info)
 (define-key idlwave-mode-map "\M-?"       'idlwave-context-help)
-(define-key idlwave-mode-map [(control meta ?\?)] 'idlwave-online-help)
+(define-key idlwave-mode-map [(control meta ?\?)] 
+  'idlwave-help-assistant-help-with-topic)
 ;; Pickup both forms of Esc/Meta binding
 (define-key idlwave-mode-map [(meta tab)] 'idlwave-complete)
 (define-key idlwave-mode-map [?\e?\t] 'idlwave-complete)
@@ -1779,7 +1780,7 @@ idlwave-mode-abbrev-table unless TABLE is non-nil."
 
 ;;;###autoload
 (defun idlwave-mode ()
-  "Major mode for editing IDL source files (version 6.0_em22).
+  "Major mode for editing IDL source files (version 6.1_em22).
 
 The main features of this mode are
 
@@ -1940,11 +1941,15 @@ The main features of this mode are
   (set (make-local-variable 'paragraph-ignore-fill-prefix) nil)
   (set (make-local-variable 'parse-sexp-ignore-comments) t)
 
+  ;; ChangeLog
+  (set (make-local-variable 'add-log-current-defun-function) 
+       'idlwave-current-routine-fullname)
+
   ;; 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
+  ;; Font-lock additions
   ;; Following line is for Emacs - XEmacs uses the corresponding property
   ;; on the `idlwave-mode' symbol.
   (set (make-local-variable 'font-lock-defaults) idlwave-font-lock-defaults)
@@ -1969,7 +1974,6 @@ The main features of this mode are
                     ";"
                     '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
   ;; (make-local-hook 'post-command-hook)
@@ -1980,7 +1984,7 @@ The main features of this mode are
   ;; (make-local-hook 'kill-buffer-hook)
   (add-hook 'kill-buffer-hook 'idlwave-kill-buffer-update nil 'local)
   ;; (make-local-hook 'after-save-hook)
-  ;; (add-hook 'after-save-hook 'idlwave-save-buffer-update nil 'local)
+  (add-hook 'after-save-hook 'idlwave-save-buffer-update nil 'local)
   (add-hook 'after-save-hook 'idlwave-revoke-license-to-kill nil 'local)
 
   ;; Setup directories and file, if necessary
@@ -2522,6 +2526,10 @@ The marks are pushed."
          (message "Could not find doc library header start.")
          (goto-char here)))))
 
+(defun idlwave-current-routine-fullname ()
+  (let ((name (idlwave-current-routine)))
+    (idlwave-make-full-name (nth 2 name) (car name))))
+
 (defun idlwave-current-routine ()
   "Return (NAME TYPE CLASS) of current routine."
   (idlwave-routines)
@@ -3478,8 +3486,6 @@ if `idlwave-auto-fill-split-string' is non-nil."
          (idlwave-indent-line)
          ;; Prevent actions do-auto-fill which calls indent-line-function.
          (let (idlwave-do-actions
-               (paragraph-start ".")
-               (paragraph-separate ".")
                (fill-nobreak-predicate
                 (if (and (idlwave-in-quote)
                          idlwave-auto-fill-split-string)
@@ -3651,6 +3657,7 @@ location on mark ring so that the user can return to previous point."
          (run-hooks 'idlwave-timestamp-hook))
       (error "No valid DOCLIB header"))))
 
+
 ;;; CJC 3/16/93
 ;;; Interface to expand-region-abbrevs which did not work when the
 ;;; abbrev hook associated with an abbrev moves point backwards
@@ -4387,7 +4394,7 @@ Does not run after automatic updates of buffer or the shell.")
   (idlwave-update-routine-info '(16)))
 
 (defun idlwave-rescan-asynchronously ()
-  "Dispatch another emacs instance to update the idlwave catalog.
+  "Dispatch another Emacs instance to update the idlwave catalog.
 After the process finishes normally, the first access to routine info
 will re-read the catalog."
   (interactive)
@@ -4892,19 +4899,14 @@ Cache to disk for quick recovery."
         (elem-cnt 0)
         props rinfo msg-cnt elem type nelem class-result alias
         routines routine-aliases statement-aliases sysvar-aliases
-        buf version-string)
+        version-string)
     (if (not (file-exists-p catalog-file))
        (error "No such XML routine info file: %s" catalog-file)
       (if (not (file-readable-p catalog-file))
          (error "Cannot read XML routine info file: %s" catalog-file)))
     (require 'xml)
     (message "Reading XML routine info...")
-    (unwind-protect
-       (progn
-         ;; avoid warnings about read-only files
-         (setq buf (find-file-noselect catalog-file 'nowarn))
-         (setq rinfo (xml-parse-file catalog-file)))
-      (if (bufferp buf) (kill-buffer buf)))
+    (setq rinfo (xml-parse-file catalog-file))
     (message "Reading XML routine info...done")
     (setq rinfo (assq 'CATALOG rinfo))
     (unless rinfo (error "Failed to parse XML routine info"))
@@ -7713,7 +7715,7 @@ property indicating the link is added."
      ((eq mode 'set)
       (if entry
          (setq link
-               (if (setq target (cdr (assoc word tags)))
+               (if (setq target (cdr (assoc-string word tags t)))
                  (idlwave-substitute-link-target main target)
                main)))) ;; setting dynamic!!!
      (t (error "This should not happen")))))
@@ -7762,8 +7764,7 @@ property indicating the link is added."
 (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
-                                        (idlwave-class-info class)))))
+  (let ((sclasses (cons class (idlwave-all-class-inherits class)))
        cl)
    (catch 'exit
      (while sclasses
@@ -9231,6 +9232,8 @@ Assumes that point is at the beginning of the unit as found by
      "--"
      ["Info" idlwave-info t]
      "--"
+     ["Help with Topic" idlwave-help-assistant-help-with-topic 
+      idlwave-help-use-assistant]
      ["Launch IDL Help" idlwave-launch-idlhelp t])))
 
 (defvar idlwave-mode-debug-menu-def
index 4d9a49a..24e9f65 100644 (file)
@@ -1194,6 +1194,15 @@ local value.")
     ;; (define-key map "\C-c\C-f" 'python-describe-symbol)
     map))
 
+(defvar inferior-python-mode-syntax-table
+  (let ((st (make-syntax-table python-mode-syntax-table)))
+    ;; Don't get confused by apostrophes in the process's output (e.g. if
+    ;; you execute "help(os)").
+    (modify-syntax-entry ?\' "." st)
+    ;; Maybe we should do the same for double quotes?
+    ;; (modify-syntax-entry ?\" "." st)
+    st))
+
 ;; Fixme: This should inherit some stuff from `python-mode', but I'm
 ;; not sure how much: at least some keybindings, like C-c C-f;
 ;; syntax?; font-locking, e.g. for triple-quoted strings?
@@ -1216,7 +1225,6 @@ For running multiple processes in multiple buffers, see `run-python' and
 
 \\{inferior-python-mode-map}"
   :group 'python
-  (set-syntax-table python-mode-syntax-table)
   (setq mode-line-process '(":%s"))
   (set (make-local-variable 'comint-input-filter) 'python-input-filter)
   (add-hook 'comint-preoutput-filter-functions #'python-preoutput-filter
index cf88739..60c3e1c 100644 (file)
@@ -1023,13 +1023,13 @@ NOTE: Activate the new setting in a VHDL buffer by using the menu entry
 
 (defcustom vhdl-reset-active-high nil
   "*Non-nil means reset in sequential processes is active high.
-Nil means active low."
+Otherwise, reset is active low."
   :type 'boolean
   :group 'vhdl-sequential-process)
 
 (defcustom vhdl-clock-rising-edge t
   "*Non-nil means rising edge of clock triggers sequential processes.
-Nil means falling edge."
+Otherwise, falling edge triggers."
   :type 'boolean
   :group 'vhdl-sequential-process)
 
index 0c3736f..1545663 100644 (file)
@@ -6,7 +6,7 @@
 ;;   Registration Number H14PRO021
 
 ;; Keywords: wp, BDF, font, PostScript
-;; Maintainer: Kenichi Handa <handa@etl.go.jp>
+;; Maintainer: Kenichi Handa <handa@m17n.org>
 ;; Time-stamp: <2003/07/11 21:13:44 vinicius>
 
 ;; This file is part of GNU Emacs.
index c4a19cd..f67b54e 100644 (file)
@@ -3,12 +3,12 @@
 ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006 Free Software Foundation, Inc.
 
-;; Author: Vinicius Jose Latorre <vinicius@cpqd.com.br>
-;;     Kenichi Handa <handa@etl.go.jp> (multi-byte characters)
-;; Maintainer: Kenichi Handa <handa@etl.go.jp> (multi-byte characters)
-;;     Vinicius Jose Latorre <vinicius@cpqd.com.br>
+;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
+;;     Kenichi Handa <handa@m17n.org> (multi-byte characters)
+;; Maintainer: Kenichi Handa <handa@m17n.org> (multi-byte characters)
+;;     Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Keywords: wp, print, PostScript, multibyte, mule
-;; Time-stamp: <2003/05/14 22:19:41 vinicius>
+;; Time-stamp: <2006/11/11 16:58:10 vinicius>
 
 ;; This file is part of GNU Emacs.
 
index 32f2b88..8512c2c 100644 (file)
@@ -6,16 +6,16 @@
 ;; Author: Jim Thompson (was <thompson@wg2.waii.com>)
 ;;     Jacques Duthen (was <duthen@cegelec-red.fr>)
 ;;     Vinicius Jose Latorre <viniciusjl@ig.com.br>
-;;     Kenichi Handa <handa@etl.go.jp> (multi-byte characters)
-;; Maintainer: Kenichi Handa <handa@etl.go.jp> (multi-byte characters)
+;;     Kenichi Handa <handa@m17n.org> (multi-byte characters)
+;; Maintainer: Kenichi Handa <handa@m17n.org> (multi-byte characters)
 ;;     Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Keywords: wp, print, PostScript
-;; Time-stamp: <2005/06/27 00:57:22 vinicius>
-;; Version: 6.6.7
+;; Time-stamp: <2006/12/01 09:59:01 vinicius>
+;; Version: 6.7
 ;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre
 
-(defconst ps-print-version "6.6.7"
-  "ps-print.el, v 6.6.7 <2005/06/27 vinicius>
+(defconst ps-print-version "6.7"
+  "ps-print.el, v 6.7 <2006/12/01 vinicius>
 
 Vinicius's last change version -- this file may have been edited as part of
 Emacs without changes to the version number.  When reporting bugs, please also
@@ -1332,7 +1332,7 @@ Please send all bug fixes and enhancements to
 ;;
 ;; Faces are always treated as opaque.
 ;;
-;; Epoch, Lucid and Emacs 19 not supported.  At all.
+;; Epoch, Lucid and Emacs 21 not supported.  At all.
 ;;
 ;; Fixed-pitch fonts work better for line folding, but are not required.
 ;;
@@ -1459,31 +1459,11 @@ Please send all bug fixes and enhancements to
           (error "`ps-print' doesn't support Epoch"))
          (t
           (unless (and (boundp 'emacs-major-version)
-                       (> emacs-major-version 19))
-            (error "`ps-print' only supports Emacs 20 and higher"))
+                       (>= emacs-major-version 22))
+            (error "`ps-print' only supports Emacs 22 and higher"))
           'emacs))))
 
 
-;; For Emacs 20.2 and the earlier version.
-
-(or (fboundp 'set-buffer-multibyte)
-    (defun set-buffer-multibyte (arg)
-      (setq enable-multibyte-characters arg)))
-
-(or (fboundp 'string-as-unibyte)
-    (defun string-as-unibyte (arg) arg))
-
-(or (fboundp 'string-as-multibyte)
-    (defun string-as-multibyte (arg) arg))
-
-(or (fboundp 'char-charset)
-    (defun char-charset (arg) 'ascii))
-
-(or (fboundp 'charset-after)
-    (defun charset-after (&optional arg)
-      (char-charset (char-after arg))))
-
-
 ;; GNU Emacs
 (or (fboundp 'line-beginning-position)
     (defun line-beginning-position (&optional n)
@@ -1545,7 +1525,7 @@ Please send all bug fixes and enhancements to
        (defun ps-face-background-name (face)
         (ps-xemacs-color-name (face-background face)))
        )
-      (t                               ; emacs
+      (t                               ; emacs 22 or higher
        (defvar mark-active nil)
        (defun ps-mark-active-p ()
         mark-active)
index 0a71927..85c1ea0 100644 (file)
 ;;; Code:
 
 (defvar resume-emacs-args-file (expand-file-name "~/.emacs_args")
-  "*This file is where arguments are placed for a suspended emacs job.")
+  "*This file is where arguments are placed for a suspended Emacs job.")
 
 (defvar resume-emacs-args-buffer " *Command Line Args*"
-  "Buffer that is used by resume-process-args.")
+  "Buffer that is used by `resume-process-args'.")
 
 (defun resume-process-args ()
   "Handler for command line args given when Emacs is resumed."
index e8f0ab7..8e58003 100644 (file)
@@ -106,8 +106,8 @@ If Emacs is not running under a window system,
 (defcustom file-name-shadow-tty-properties
   '(before-string "{" after-string "} " field shadow)
   "Properties given to the `shadowed' part of a filename in the minibuffer.
-Only used when `file-name-shadow-mode' is active and emacs
-is not running under a window-system; if emacs is running under a window
+Only used when `file-name-shadow-mode' is active and Emacs
+is not running under a window-system; if Emacs is running under a window
 system, `file-name-shadow-properties' is used instead."
   :type file-name-shadow-properties-custom-type
   :group 'minibuffer
index 449583a..38e0d5e 100644 (file)
@@ -1,4 +1,4 @@
-;;; rot13.el --- display a buffer in rot13
+;;; rot13.el --- display a buffer in ROT13
 
 ;; Copyright (C) 1988, 2002, 2003, 2004, 2005,
 ;;   2006 Free Software Foundation, Inc.
@@ -27,7 +27,7 @@
 
 ;; The entry point, `rot13-other-window', performs a Caesar cipher
 ;; encrypt/decrypt on the current buffer and displays the result in another
-;; window.  Rot13 encryption is sometimes used on USENET as a read-at-your-
+;; window.  ROT13 encryption is sometimes used on USENET as a read-at-your-
 ;; own-risk wrapper for material some might consider offensive, such as
 ;; ethnic humor.
 ;;
@@ -48,7 +48,7 @@
       (aset table (+ i ?A) (vector (+ (% (+ i 13) 26) ?A)))
       (setq i (1+ i)))
     table)
-  "Char table for rot 13 display.")
+  "Char table for ROT13 display.")
 
 (defvar rot13-translate-table
   (let ((str (make-string 127 0))
       (aset str (+ i ?A) (+ (% (+ i 13) 26) ?A))
       (setq i (1+ i)))
     str)
-  "String table for rot 13 translation.")
+  "String table for ROT13 translation.")
 
 ;;;###autoload
 (defun rot13 (object &optional start end)
-  "Return Rot13 encryption of OBJECT, a buffer or string."
+  "Return ROT13 encryption of OBJECT, a buffer or string."
   (if (bufferp object)
       (with-current-buffer object
        (rot13-region start end))
@@ -74,7 +74,7 @@
 
 ;;;###autoload
 (defun rot13-string (string)
-  "Return Rot13 encryption of STRING."
+  "Return ROT13 encryption of STRING."
   (with-temp-buffer
     (insert string)
     (rot13-region (point-min) (point-max))
 
 ;;;###autoload
 (defun rot13-region (start end)
-  "Rot13 encrypt the region between START and END in current buffer."
+  "ROT13 encrypt the region between START and END in current buffer."
   (interactive "r")
   (translate-region start end rot13-translate-table))
 
 ;;;###autoload
 (defun rot13-other-window ()
-  "Display current buffer in rot 13 in another window.
+  "Display current buffer in ROT13 in another window.
 The text itself is not modified, only the way it is displayed is affected.
 
-To terminate the rot13 display, delete that window.  As long as that window
+To terminate the ROT13 display, delete that window.  As long as that window
 is not deleted, any buffer displayed in it will become instantly encoded
-in rot 13.
+in ROT13.
 
 See also `toggle-rot13-mode'."
   (interactive)
@@ -102,7 +102,7 @@ See also `toggle-rot13-mode'."
 
 ;;;###autoload
 (defun toggle-rot13-mode ()
-  "Toggle the use of rot 13 encoding for the current window."
+  "Toggle the use of ROT13 encoding for the current window."
   (interactive)
   (if (eq (window-display-table (selected-window)) rot13-display-table)
       (set-window-display-table (selected-window) nil)
index a441c3a..10d05da 100644 (file)
@@ -527,6 +527,16 @@ START-EVENT is the mouse click event."
       #'ruler-mode-mouse-del-tab-stop)
     (define-key km [header-line (control down-mouse-2)]
       #'ruler-mode-toggle-show-tab-stops)
+    (define-key km [header-line (shift mouse-1)]
+      'ignore)
+    (define-key km [header-line (shift mouse-3)]
+      'ignore)
+    (define-key km [header-line (control mouse-1)]
+      'ignore)
+    (define-key km [header-line (control mouse-3)]
+      'ignore)
+    (define-key km [header-line (control mouse-2)]
+      'ignore)
     km)
   "Keymap for ruler minor mode.")
 
index 9e81648..c659768 100644 (file)
@@ -28,7 +28,7 @@
 ;;    up or down lines in any buffer causes all the buffers to mirror
 ;;    the scrolling.  It hooks into the post-command-hook to check for
 ;;    potential scrolling commands and if we're locked, mirrors them in all
-;;    windows. This allows us to grab line-at-a-time scrolling as well as
+;;    windows.  This allows us to grab line-at-a-time scrolling as well as
 ;;    screen-at-a-time scrolling, and doesn't remap any of the keyboard
 ;;    commands to do it.
 
index 73d36ca..7a4179e 100644 (file)
   "Emacs running as a server process."
   :group 'external)
 
+(defcustom server-use-tcp nil
+  "If non-nil, use TCP sockets instead of local sockets."
+  :set #'(lambda (sym val)
+           (unless (featurep 'make-network-process '(:family local))
+             (setq val t)
+             (unless load-in-progress
+               (message "Local sockets unsupported, using TCP sockets")))
+           (when val (random t))
+           (set-default sym val))
+  :group 'server
+  :type 'boolean
+  :version "22.1")
+
+(defcustom server-host nil
+  "The name or IP address to use as host address of the server process.
+If set, the server accepts remote connections; otherwise it is local."
+  :group 'server
+  :type '(choice
+          (string :tag "Name or IP address")
+          (const :tag "Local" nil))
+  :version "22.1")
+(put 'server-host 'risky-local-variable t)
+
+(defcustom server-auth-dir "~/.emacs.d/server/"
+  "Directory for server authentication files."
+  :group 'server
+  :type 'directory
+  :version "22.1")
+(put 'server-auth-dir 'risky-local-variable t)
+
+(defcustom server-raise-frame t
+  "If non-nil, raise frame when switching to a buffer."
+  :group 'server
+  :type 'boolean
+  :version "22.1")
+
 (defcustom server-visit-hook nil
-  "*Hook run when visiting a file for the Emacs server."
+  "Hook run when visiting a file for the Emacs server."
   :group 'server
   :type 'hook)
 
 (defcustom server-switch-hook nil
-  "*Hook run when switching to a buffer for the Emacs server."
+  "Hook run when switching to a buffer for the Emacs server."
   :group 'server
   :type 'hook)
 
 (defcustom server-done-hook nil
-  "*Hook run when done editing a buffer for the Emacs server."
+  "Hook run when done editing a buffer for the Emacs server."
   :group 'server
   :type 'hook)
 
@@ -113,7 +149,7 @@ and PROPERTIES is an association list of client properties.")
 (put 'server-buffer-clients 'permanent-local t)
 
 (defcustom server-window nil
-  "*Specification of the window to use for selecting Emacs server buffers.
+  "Specification of the window to use for selecting Emacs server buffers.
 If nil, use the selected window.
 If it is a function, it should take one argument (a buffer) and
 display and select it.  A common value is `pop-to-buffer'.
@@ -132,14 +168,14 @@ Only programs can do so."
                 (function :tag "Other function")))
 
 (defcustom server-temp-file-regexp "^/tmp/Re\\|/draft$"
-  "*Regexp matching names of temporary files.
+  "Regexp matching names of temporary files.
 These are deleted and reused after each edit by the programs that
 invoke the Emacs server."
   :group 'server
   :type 'regexp)
 
 (defcustom server-kill-new-buffers t
-  "*Whether to kill buffers when done with them.
+  "Whether to kill buffers when done with them.
 If non-nil, kill a buffer unless it already existed before editing
 it with Emacs server.  If nil, kill only buffers as specified by
 `server-temp-file-regexp'.
@@ -151,7 +187,7 @@ this way."
   :version "21.1")
 
 (or (assq 'server-buffer-clients minor-mode-alist)
-    (setq minor-mode-alist (cons '(server-buffer-clients " Server") minor-mode-alist)))
+    (push '(server-buffer-clients " Server") minor-mode-alist))
 
 (defvar server-existing-buffer nil
   "Non-nil means the buffer existed before the server was asked to visit it.
@@ -306,16 +342,16 @@ If NOFRAME is non-nil, let the frames live.  (To be used from
   "If a *server* buffer exists, write STRING to it for logging purposes.
 If CLIENT is non-nil, add a description of it to the logged
 message."
-  (if (get-buffer "*server*")
-      (with-current-buffer "*server*"
-       (goto-char (point-max))
-       (insert (current-time-string)
-               (cond
-                ((null client) " ")
-                ((listp client) (format " %s: " (car client)))
-                (t (format " %s: " client)))
-               string)
-       (or (bolp) (newline)))))
+  (when (get-buffer "*server*")
+    (with-current-buffer "*server*"
+      (goto-char (point-max))
+      (insert (current-time-string)
+             (cond
+              ((null client) " ")
+              ((listp client) (format " %s: " (car client)))
+              (t (format " %s: " client)))
+             string)
+      (or (bolp) (newline)))))
 
 (defun server-sentinel (proc msg)
   "The process sentinel for Emacs server connections."
@@ -324,6 +360,12 @@ message."
   (when (and (eq (process-status proc) 'open)
             (process-query-on-exit-flag proc))
     (set-process-query-on-exit-flag proc nil))
+  ;; Delete the associated connection file, if applicable.
+  ;; This is actually problematic: the file may have been overwritten by
+  ;; another Emacs server in the mean time, so it's not ours any more.
+  ;; (and (process-contact proc :server)
+  ;;      (eq (process-status proc) 'closed)
+  ;;      (ignore-errors (delete-file (process-get proc :server-file))))
   (server-log (format "Status changed to %s: %s" (process-status proc) msg) proc)
   (server-delete-client proc))
 
@@ -390,11 +432,12 @@ Creates the directory if necessary and makes sure:
   (setq dir (directory-file-name dir))
   (let ((attrs (file-attributes dir)))
     (unless attrs
-      (letf (((default-file-modes) ?\700)) (make-directory dir))
+      (letf (((default-file-modes) ?\700)) (make-directory dir t))
       (setq attrs (file-attributes dir)))
     ;; Check that it's safe for use.
     (unless (and (eq t (car attrs)) (eq (nth 2 attrs) (user-uid))
-                (zerop (logand ?\077 (file-modes dir))))
+                 (or (eq system-type 'windows-nt)
+                     (zerop (logand ?\077 (file-modes dir)))))
       (error "The directory %s is unsafe" dir))))
 
 ;;;###autoload
@@ -415,9 +458,9 @@ communications subprocess."
     ;; It is safe to get the user id now.
     (setq server-socket-dir (or server-socket-dir
                                (format "/tmp/emacs%d" (user-uid))))
-    ;; kill it dead!
-    (if server-process
-       (condition-case () (delete-process server-process) (error nil)))
+    (when server-process
+      ;; kill it dead!
+      (ignore-errors (delete-process server-process)))
     ;; Delete the socket files made by previous server invocations.
     (condition-case ()
        (delete-file (expand-file-name server-name server-socket-dir))
@@ -430,25 +473,56 @@ communications subprocess."
        (progn
          (server-log (message "Server stopped"))
          (setq server-process nil))
-      ;; Make sure there is a safe directory in which to place the socket.
-      (server-ensure-safe-dir server-socket-dir)
-      (if server-process
-         (server-log (message "Restarting server"))
-       (server-log (message "Starting server")))
-      (letf (((default-file-modes) ?\700))
-       (add-hook 'suspend-tty-functions 'server-handle-suspend-tty)
-       (add-hook 'delete-frame-functions 'server-handle-delete-frame)
-       (add-hook 'kill-buffer-query-functions 'server-kill-buffer-query-function)
-       (add-hook 'kill-emacs-query-functions 'server-kill-emacs-query-function)
-       (setq server-process
-             (make-network-process
-              :name "server" :family 'local :server t :noquery t
-              :service (expand-file-name server-name server-socket-dir)
-              :sentinel 'server-sentinel :filter 'server-process-filter
-              ;; We must receive file names without being decoded.
-              ;; Those are decoded by server-process-filter according
-              ;; to file-name-coding-system.
-              :coding 'raw-text))))))
+      (let* ((server-dir (if server-use-tcp server-auth-dir server-socket-dir))
+            (server-file (expand-file-name server-name server-dir)))
+       ;; Make sure there is a safe directory in which to place the socket.
+       (server-ensure-safe-dir server-dir)
+       ;; Remove any leftover socket or authentication file.
+       (ignore-errors (delete-file server-file))
+       (when server-process
+         (server-log (message "Restarting server")))
+       (letf (((default-file-modes) ?\700))
+         (add-hook 'suspend-tty-functions 'server-handle-suspend-tty)
+         (add-hook 'delete-frame-functions 'server-handle-delete-frame)
+         (add-hook 'kill-buffer-query-functions 'server-kill-buffer-query-function)
+         (add-hook 'kill-emacs-query-functions 'server-kill-emacs-query-function)
+         (setq server-process
+               (apply #'make-network-process
+                      :name server-name
+                      :server t
+                      :noquery t
+                      :sentinel 'server-sentinel
+                      :filter 'server-process-filter
+                      ;; We must receive file names without being decoded.
+                      ;; Those are decoded by server-process-filter according
+                      ;; to file-name-coding-system.
+                      :coding 'raw-text
+                      ;; The rest of the args depends on the kind of socket used.
+                      (if server-use-tcp
+                          (list :family nil
+                                :service t
+                                :host (or server-host 'local)
+                                :plist '(:authenticated nil))
+                        (list :family 'local
+                              :service server-file
+                              :plist '(:authenticated t)))))
+         (unless server-process (error "Could not start server process"))
+         (when server-use-tcp
+           (let ((auth-key
+                  (loop
+                   ;; The auth key is a 64-byte string of random chars in the
+                   ;; range `!'..`~'.
+                   for i below 64
+                   collect (+ 33 (random 94)) into auth
+                   finally return (concat auth))))
+             (process-put server-process :auth-key auth-key)
+             (with-temp-file server-file
+               (set-buffer-multibyte nil)
+               (setq buffer-file-coding-system 'no-conversion)
+               (insert (format-network-address
+                        (process-contact server-process :local))
+                       " " (int-to-string (emacs-pid))
+                       "\n" auth-key)))))))))
 
 ;;;###autoload
 (define-minor-mode server-mode
@@ -463,7 +537,7 @@ Server mode runs a process that accepts commands from the
   ;; nothing if there is one (for multiple Emacs sessions)?
   (server-start (not server-mode)))
 \f
-(defun server-process-filter (proc string)
+(defun* server-process-filter (proc string)
   "Process a request from the server to edit some files.
 PROC is the server process.  STRING consists of a sequence of
 commands prefixed by a dash.  Some commands have arguments; these
@@ -486,6 +560,10 @@ as a response.
 
 The following commands are accepted by the server:
 
+`-auth AUTH-STRING'
+  Authenticate the client using the secret authentication string
+  AUTH_STRING.
+
 `-version CLIENT-VERSION'
   Check version numbers between server and client, and signal an
   error if there is a mismatch.  The server replies with
@@ -564,6 +642,30 @@ The following commands are accepted by the client:
   Suspend this terminal, i.e., stop the client process.  Sent
   when the user presses C-z."
   (server-log (concat "Received " string) proc)
+  ;; First things first: let's check the authentication
+  (unless (process-get proc :authenticated)
+    (if (and (string-match "-auth \\(.*?\\)\n" string)
+            (equal (match-string 1 string) (process-get proc :auth-key)))
+       (progn
+         (setq string (substring string (match-end 0)))
+         (process-put proc :authenticated t)
+         (server-log "Authentication successful" proc))
+      (server-log "Authentication failed" proc)
+      (server-send-string
+       proc (concat "-error " (server-quote-arg "Authentication failed")))
+      (delete-process proc)
+      ;; We return immediately
+      (return-from server-process-filter)))
+  (when (> (recursion-depth) 0)
+    ;; We're inside a minibuffer already, so if the emacs-client is trying
+    ;; to open a frame on a new display, we might end up with an unusable
+    ;; frame because input from that display will be blocked (until exiting
+    ;; the minibuffer).  Better exit this minibuffer right away.
+    ;; Similarly with recursive-edits such as the splash screen.
+    (process-put proc :previous-string string)
+    (run-with-timer 0 nil (lexical-let ((proc proc))
+                           (lambda () (server-process-filter proc ""))))
+    (top-level))
   (let ((prev (process-get proc 'previous-string)))
     (when prev
       (setq string (concat prev string))
@@ -857,19 +959,21 @@ so don't mark these buffers specially, just visit them normally."
        ;; If there is an existing buffer modified or the file is
        ;; modified, revert it.  If there is an existing buffer with
        ;; deleted file, offer to write it.
-       (let* ((filen (car file))
+       (let* ((minibuffer-auto-raise (or server-raise-frame
+                                         minibuffer-auto-raise))
+              (filen (car file))
               (obuf (get-file-buffer filen)))
          (add-to-history 'file-name-history filen)
          (if (and obuf (set-buffer obuf))
              (progn
                (cond ((file-exists-p filen)
-                      (if (not (verify-visited-file-modtime obuf))
-                          (revert-buffer t nil)))
+                      (when (not (verify-visited-file-modtime obuf))
+                        (revert-buffer t nil)))
                      (t
-                      (if (y-or-n-p
-                           (concat "File no longer exists: " filen
-                                   ", write buffer to file? "))
-                          (write-file filen))))
+                      (when (y-or-n-p
+                             (concat "File no longer exists: " filen
+                                     ", write buffer to file? "))
+                        (write-file filen))))
                (unless server-buffer-clients
                  (setq server-existing-buffer t))
                (server-goto-line-column file))
@@ -913,33 +1017,33 @@ FOR-KILLING if non-nil indicates that we are called from `kill-buffer'."
          (unless buffers
            (server-log "Close" client)
            (server-delete-client client)))))
-    (if (and (bufferp buffer) (buffer-name buffer))
-       ;; We may or may not kill this buffer;
-       ;; if we do, do not call server-buffer-done recursively
-       ;; from kill-buffer-hook.
-       (let ((server-kill-buffer-running t))
-         (with-current-buffer buffer
-           (setq server-buffer-clients nil)
-           (run-hooks 'server-done-hook))
-         ;; Notice whether server-done-hook killed the buffer.
-         (if (null (buffer-name buffer))
+    (when (and (bufferp buffer) (buffer-name buffer))
+      ;; We may or may not kill this buffer;
+      ;; if we do, do not call server-buffer-done recursively
+      ;; from kill-buffer-hook.
+      (let ((server-kill-buffer-running t))
+       (with-current-buffer buffer
+         (setq server-buffer-clients nil)
+         (run-hooks 'server-done-hook))
+       ;; Notice whether server-done-hook killed the buffer.
+       (if (null (buffer-name buffer))
+           (setq killed t)
+         ;; Don't bother killing or burying the buffer
+         ;; when we are called from kill-buffer.
+         (unless for-killing
+           (when (and (not killed)
+                      server-kill-new-buffers
+                      (with-current-buffer buffer
+                        (not server-existing-buffer)))
              (setq killed t)
-           ;; Don't bother killing or burying the buffer
-           ;; when we are called from kill-buffer.
-           (unless for-killing
-             (when (and (not killed)
-                        server-kill-new-buffers
-                        (with-current-buffer buffer
-                          (not server-existing-buffer)))
-               (setq killed t)
-               (bury-buffer buffer)
-               (kill-buffer buffer))
-             (unless killed
-               (if (server-temp-file-p buffer)
-                   (progn
-                     (kill-buffer buffer)
-                     (setq killed t))
-                 (bury-buffer buffer)))))))
+             (bury-buffer buffer)
+             (kill-buffer buffer))
+           (unless killed
+             (if (server-temp-file-p buffer)
+                 (progn
+                   (kill-buffer buffer)
+                   (setq killed t))
+               (bury-buffer buffer)))))))
     (list next-buffer killed)))
 
 (defun server-temp-file-p (&optional buffer)
@@ -966,10 +1070,10 @@ specifically for the clients and did not exist before their request for it."
        (let ((version-control nil)
              (buffer-backed-up nil))
          (save-buffer))
-      (if (and (buffer-modified-p)
-              buffer-file-name
-              (y-or-n-p (concat "Save file " buffer-file-name "? ")))
-         (save-buffer)))
+      (when (and (buffer-modified-p)
+                buffer-file-name
+                (y-or-n-p (concat "Save file " buffer-file-name "? ")))
+       (save-buffer)))
     (server-buffer-done (current-buffer))))
 
 ;; Ask before killing a server buffer.
@@ -992,9 +1096,9 @@ specifically for the clients and did not exist before their request for it."
   (or (not server-clients)
       (let (live-client)
        (dolist (client server-clients live-client)
-         (if (memq t (mapcar 'buffer-live-p (server-client-get
-                                             client 'buffers)))
-             (setq live-client t))))
+         (when (memq t (mapcar 'buffer-live-p (server-client-get
+                                               client 'buffers)))
+           (setq live-client t))))
       (yes-or-no-p "This Emacs session has clients; exit anyway? ")))
 
 (defvar server-kill-buffer-running nil
@@ -1027,12 +1131,12 @@ If invoked with a prefix argument, or if there is no server process running,
 starts server process and that is all.  Invoked by \\[server-edit]."
   (interactive "P")
   (cond
-   ((or arg
-       (not server-process)
-       (memq (process-status server-process) '(signal exit)))
-    (server-mode 1))
-   (server-clients (apply 'server-switch-buffer (server-done)))
-   (t (message "No server editing buffers exist"))))
+    ((or arg
+         (not server-process)
+         (memq (process-status server-process) '(signal exit)))
+     (server-mode 1))
+    (server-clients (apply 'server-switch-buffer (server-done)))
+    (t (message "No server editing buffers exist"))))
 
 (defun server-switch-buffer (&optional next-buffer killed-one)
   "Switch to another buffer, preferably one that has a client.
@@ -1065,21 +1169,19 @@ done that."
        (let ((win (get-buffer-window next-buffer 0)))
          (if (and win (not server-window))
              ;; The buffer is already displayed: just reuse the window.
-             (let ((frame (window-frame win)))
-               (if (eq (frame-visible-p frame) 'icon)
-                   (raise-frame frame))
-               (select-window win)
-               (set-buffer next-buffer))
+              (progn
+                (select-window win)
+                (set-buffer next-buffer))
            ;; Otherwise, let's find an appropriate window.
            (cond ((and (windowp server-window)
                        (window-live-p server-window))
                   (select-window server-window))
                  ((framep server-window)
-                  (if (not (frame-live-p server-window))
-                      (setq server-window (make-frame)))
+                  (unless (frame-live-p server-window)
+                    (setq server-window (make-frame)))
                   (select-window (frame-selected-window server-window))))
-           (if (window-minibuffer-p (selected-window))
-               (select-window (next-window nil 'nomini 0)))
+           (when (window-minibuffer-p (selected-window))
+             (select-window (next-window nil 'nomini 0)))
            ;; Move to a non-dedicated window, if we have one.
            (when (window-dedicated-p (selected-window))
              (select-window
@@ -1093,7 +1195,9 @@ done that."
                (switch-to-buffer next-buffer)
              ;; After all the above, we might still have ended up with
              ;; a minibuffer/dedicated-window (if there's no other).
-             (error (pop-to-buffer next-buffer)))))))))
+             (error (pop-to-buffer next-buffer)))))))
+    (when server-raise-frame
+      (select-frame-set-input-focus (window-frame (selected-window))))))
 
 ;;;###autoload
 (defun server-save-buffers-kill-terminal (proc &optional arg)
index 85f6f8d..fc75d74 100644 (file)
@@ -297,7 +297,7 @@ need to be recalculated.")
 (defvar ses-call-printer-return nil
   "Set to t if last cell printer invoked by `ses-call-printer' requested
 left-justification of the result.  Set to error-signal if ses-call-printer
-encountered an error during printing.  Nil otherwise.")
+encountered an error during printing.  Otherwise nil.")
 
 (defvar ses-start-time nil
   "Time when current operation started.  Used by `ses-time-check' to decide
index f5f8bac..ac2ab0f 100644 (file)
@@ -97,12 +97,12 @@ is no buffer currently visiting the file."
   :group 'shadow)
 
 (defcustom shadow-inhibit-message nil
-  "*If nonnil, do not display a message when a file needs copying."
+  "*If non-nil, do not display a message when a file needs copying."
   :type 'boolean
   :group 'shadow)
 
 (defcustom shadow-inhibit-overload nil
-  "If nonnil, shadowfile won't redefine \\[save-buffers-kill-emacs].
+  "If non-nil, shadowfile won't redefine \\[save-buffers-kill-emacs].
 Normally it overloads the function `save-buffers-kill-emacs' to check
 for files have been changed and need to be copied to other systems."
   :type 'boolean
@@ -146,7 +146,7 @@ Default: ~/.shadow_todo"
 (defvar shadow-literal-groups nil
   "List of files that are shared between hosts.
 This list contains shadow structures with literal filenames, created by
-shadow-define-group.")
+`shadow-define-literal-group'.")
 
 (defvar shadow-regexp-groups nil
   "List of file types that are shared between hosts.
@@ -178,7 +178,7 @@ created by `shadow-define-regexp-group'.")
       (shadow-union (cdr a) (cons (car a) b)))))
 
 (defun shadow-find (func list)
-  "If FUNC applied to some element of LIST is nonnil, return first such element."
+  "If FUNC applied to some element of LIST is non-nil, return first such element."
   (while (and list (not (funcall func (car list))))
     (setq list (cdr list)))
   (car list))
@@ -205,7 +205,7 @@ This makes sure regexp matches nothing but STRING."
 
 (defun shadow-suffix (prefix string)
   "If PREFIX begins STRING, return the rest.
-Return value is nonnil if PREFIX and STRING are string= up to the length of
+Return value is non-nil if PREFIX and STRING are `string=' up to the length of
 PREFIX."
   (let ((lp (length prefix))
        (ls (length string)))
@@ -285,9 +285,9 @@ information defining the cluster.  For interactive use, call
       ans)))
 
 (defun shadow-site-match (site1 site2)
-  "Nonnil iff SITE1 is or includes SITE2.
-Each may be a host or cluster name; if they are clusters, regexp of site1 will
-be matched against the primary of site2."
+  "Non-nil iff SITE1 is or includes SITE2.
+Each may be a host or cluster name; if they are clusters, regexp of SITE1 will
+be matched against the primary of SITE2."
   (or (string-equal site1 site2) ; quick check
       (let* ((cluster1 (shadow-get-cluster site1))
             (primary2 (shadow-site-primary site2)))
@@ -355,7 +355,7 @@ Will return the name bare if it is a local file."
                                 (nth 2 hup))))))
 
 (defun shadow-expand-file-name (file &optional default)
-  "Expand file name and get file's true name."
+  "Expand file name and get FILE's true name."
   (file-truename (expand-file-name file default)))
 
 (defun shadow-contract-file-name (file)
@@ -398,7 +398,7 @@ local filename."
  "Return t if PATTERN matches FILE.
 If REGEXP is supplied and non-nil, the file part of the pattern is a regular
 expression, otherwise it must match exactly.  The sites and usernames must
-match---see shadow-same-site.  The pattern must be in full ange-ftp format, but
+match---see `shadow-same-site'.  The pattern must be in full ange-ftp format, but
 the file can be any valid filename.  This function does not do any filename
 expansion or contraction, you must do that yourself first."
  (let* ((pattern-sup (shadow-parse-fullname pattern))
@@ -475,7 +475,7 @@ specific hostnames, or names of clusters \(see `shadow-define-cluster')."
   "Make each of a group of files be shared between hosts.
 Prompts for regular expression; files matching this are shared between a list
 of sites, which are also prompted for.  The filenames must be identical on all
-hosts \(if they aren't, use shadow-define-group instead of this function).
+hosts \(if they aren't, use `shadow-define-literal-group' instead of this function).
 Each site can be either a hostname or the name of a cluster \(see
 `shadow-define-cluster')."
   (interactive)
@@ -661,7 +661,7 @@ Returns t unless files were locked; then returns nil."
           (or (stringp (file-locked-p shadow-info-file))
               (stringp (file-locked-p shadow-todo-file))))
       (progn
-       (message "Shadowfile is running in another emacs; can't have two.")
+       (message "Shadowfile is running in another Emacs; can't have two.")
        (beep)
        (sit-for 3)
        nil)
@@ -707,8 +707,8 @@ defined, the old hashtable info is invalid."
        (shadow-insert-var 'shadow-regexp-groups))))
 
 (defun shadow-write-todo-file (&optional save)
-  "Write out information to shadow-todo-file.
-With nonnil argument also saves the buffer."
+  "Write out information to `shadow-todo-file'.
+With non-nil argument also saves the buffer."
   (save-excursion
     (if (not shadow-todo-buffer)
        (setq shadow-todo-buffer (find-file-noselect shadow-todo-file)))
@@ -731,9 +731,9 @@ With nonnil argument also saves the buffer."
   (setq shadow-hashtable (make-vector 37 0)))
 
 (defun shadow-insert-var (variable)
-  "Prettily insert a setq command for VARIABLE.
+  "Prettily insert a `setq' command for VARIABLE,
 which, when later evaluated, will restore it to its current setting.
-SYMBOL must be the name of a variable whose value is a list."
+VARIABLE must be the name of a variable whose value is a list."
   (let ((standard-output (current-buffer)))
     (insert (format "(setq %s" variable))
     (cond ((consp (eval variable))
index 8fc0fdf..1dd6d8b 100644 (file)
@@ -250,10 +250,10 @@ that buffer is rejected."
        (next-error-buffer-p (current-buffer) nil
                             extra-test-inclusive extra-test-exclusive)
        (progn
-         (message "This is the only next-error capable buffer")
+         (message "This is the only buffer with error message locations")
          (current-buffer)))
    ;; 6. Give up.
-   (error "No next-error capable buffer found")))
+   (error "No buffers contain error message locations")))
 
 (defun next-error (&optional arg reset)
   "Visit next `next-error' message and corresponding source code.
@@ -2717,7 +2717,7 @@ When this command inserts killed text into the buffer, it honors
 `yank-excluded-properties' and `yank-handler' as described in the
 doc string for `insert-for-yank-1', which see.
 
-See also the command \\[yank-pop]."
+See also the command `yank-pop' (\\[yank-pop])."
   (interactive "*P")
   (setq yank-window-start (window-start))
   ;; If we don't get all the way thru, make last-command indicate that
index 359067a..99293d6 100644 (file)
@@ -248,7 +248,7 @@ the sort order."
     (while (< i 256)
       (modify-syntax-entry i "w" table)
       (setq i (1+ i)))
-    (modify-syntax-entry ?\  " " table)
+    (modify-syntax-entry ?\s " " table)
     (modify-syntax-entry ?\t " " table)
     (modify-syntax-entry ?\n " " table)
     (modify-syntax-entry ?\. "_" table)        ; for floating pt. numbers. -wsr
@@ -505,8 +505,9 @@ Use \\[untabify] to convert tabs to spaces before sorting."
          ;; Use the sort utility if we can; it is 4 times as fast.
          ;; Do not use it if there are any non-font-lock properties
          ;; in the region, since the sort utility would lose the
-         ;; properties.
-         (let ((sort-args (list (if reverse "-rt\n" "-t\n")
+         ;; properties.  Tabs are used as field separator; on NetBSD,
+         ;; sort complains if "\n" is used as field separator.
+         (let ((sort-args (list (if reverse "-rt\t" "-t\t")
                                 (format "-k1.%d,1.%d"
                                         (1+ col-start)
                                         (1+ col-end)))))
index e5ab181..01357cb 100644 (file)
@@ -2157,7 +2157,7 @@ Groups may optionally contain a position."
             ))))
 
 (defun speedbar-generic-list-tag-p (sublst)
-  "Non nil if SUBLST is a tag."
+  "Non-nil if SUBLST is a tag."
   (and (stringp (car-safe sublst))
        (or (and (number-or-marker-p (cdr-safe sublst))
                (not (cdr-safe (cdr-safe sublst))))
@@ -2681,7 +2681,15 @@ Also resets scanner functions."
                             "Updating speedbar to special mode: %s...done"
                             major-mode)
                            (speedbar-message nil))))
-                   (speedbar-update-localized-contents))
+
+                 ;; Update all the contents if directories change!
+                 (unless (and (or (member major-mode speedbar-ignored-modes)
+                                  (eq af (speedbar-current-frame))
+                                  (not (buffer-file-name)))
+                              ;; Always update for GUD.
+                              (not (string-equal "GUD"
+                                    speedbar-initial-expansion-list-name)))
+                   (speedbar-update-localized-contents)))
                (select-frame af))
            ;; Now run stealthy updates of time-consuming items
            (speedbar-stealthy-updates)))))
index 59bcabf..724329a 100644 (file)
@@ -290,7 +290,8 @@ from being initialized."
 
 (defvar init-file-debug nil)
 
-(defvar init-file-had-error nil)
+(defvar init-file-had-error nil
+  "Non-nil if there was an error loading the user's init file.")
 
 (defvar normal-top-level-add-subdirs-inode-list nil)
 
@@ -1133,8 +1134,16 @@ Getting New Versions\tHow to obtain the latest version of Emacs
 More Manuals / Ordering Manuals       Buying printed manuals from the FSF\n")
   (:face (variable-pitch :weight bold)
         "Useful File menu items:\n"
-        :face variable-pitch "\
-Exit Emacs\t\t(Or type Control-x followed by Control-c)
+        :face variable-pitch
+        "Exit Emacs\t\t(Or type "
+        :face default
+        "Control-x"
+        :face variable-pitch
+        " followed by "
+        :face default
+        "Control-c"
+        :face variable-pitch
+        ")
 Recover Crashed Session\tRecover files you were editing before a crash
 
 
@@ -1249,16 +1258,19 @@ where FACE is a valid face specification, as it can be used with
    :face 'variable-pitch
    "You can do basic editing with the menu bar and scroll bar \
 using the mouse.\n\n")
-  (if fancy-splash-outer-buffer
-      (fancy-splash-insert
-       :face 'variable-pitch
-       (substitute-command-keys
-       (concat
-        "Type \\[recenter] to begin editing"
-        (if (equal (buffer-name fancy-splash-outer-buffer)
-                   "*scratch*")
-            ".\n"
-          " your file.\n"))))))
+  (when fancy-splash-outer-buffer
+    (fancy-splash-insert
+     :face 'variable-pitch
+     "Type "
+     :face 'default
+     (substitute-command-keys
+      "\\[recenter]")
+     :face 'variable-pitch
+     " to begin editing"
+     (if (equal (buffer-name fancy-splash-outer-buffer)
+               "*scratch*")
+        ".\n"
+       " your file.\n"))))
 
 (defun fancy-splash-tail ()
   "Insert the tail part of the splash screen into the current buffer."
@@ -1285,7 +1297,11 @@ using the mouse.\n\n")
          t)
         (fancy-splash-insert :face '(variable-pitch :foreground "red")
                              "\n\nIf an Emacs session crashed recently, "
-                             "type Meta-x recover-session RET\nto recover"
+                             "type "
+                             :face '(fixed-pitch :foreground "red")
+                             "Meta-x recover-session RET"
+                             :face '(variable-pitch :foreground "red")
+                             "\nto recover"
                              " the files you were editing."))))
 
 (defun fancy-splash-screens-1 (buffer)
@@ -1350,7 +1366,7 @@ mouse."
            timer)
        (save-selected-window
          (select-frame frame)
-         (switch-to-buffer "GNU Emacs")
+         (switch-to-buffer " GNU Emacs")
          (setq splash-buffer (current-buffer))
          (catch 'stop-splashing
            (unwind-protect
@@ -1879,7 +1895,12 @@ With a prefix argument, any user input hides the splash screen."
                          (setq line 0)
                          (unless (< column 1)
                            (move-to-column (1- column)))
-                         (setq column 0))))))))
+                         (setq column 0))))))
+         ;; In unusual circumstances, the execution of Lisp code due
+         ;; to command-line options can cause the last visible frame
+         ;; to be deleted.  In this case, kill emacs to avoid an
+         ;; abort later.
+         (unless (frame-live-p (selected-frame)) (kill-emacs nil))))
 
       ;; If 3 or more files visited, and not all visible,
       ;; show user what they all are.  But leave the last one current.
index 028b6ef..91c12fd 100644 (file)
@@ -877,7 +877,7 @@ and `event-end' functions."
 
 (defsubst posn-image (position)
   "Return the image object of POSITION.
-Value is an list (image ...), or nil if not an image.
+Value is a list (image ...), or nil if not an image.
 POSITION should be a list of the form returned by the `event-start'
 and `event-end' functions."
   (nth 7 position))
@@ -1108,11 +1108,11 @@ other hooks, such as major mode hooks, can do the job."
        ((eq compare-fn 'eql)
        (memql element (symbol-value list-var)))
        (t
-       (let (present)
-         (dolist (elt (symbol-value list-var))
-           (if (funcall compare-fn element elt)
-               (setq present t)))
-         present)))
+       (let ((lst (symbol-value list-var)))
+         (while (and lst
+                     (not (funcall compare-fn element (car lst))))
+           (setq lst (cdr lst)))
+          lst)))
       (symbol-value list-var)
     (set list-var
         (if append
@@ -1892,7 +1892,7 @@ EXIT-CHAR it is swallowed; otherwise it is then available as
 input (as a command if nothing else).
 Display MESSAGE (optional fourth arg) in the echo area.
 If MESSAGE is nil, instructions to type EXIT-CHAR are displayed there."
-  (or exit-char (setq exit-char ?\ ))
+  (or exit-char (setq exit-char ?\s))
   (let ((inhibit-read-only t)
        ;; Don't modify the undo list at all.
        (buffer-undo-list t)
@@ -1960,8 +1960,10 @@ If MESSAGE is nil, instructions to type EXIT-CHAR are displayed there."
   "Clear BEG and END of overlays whose property NAME has value VAL.
 Overlays might be moved and/or split.
 BEG and END default respectively to the beginning and end of buffer."
+  ;; This speeds up the loops over overlays.
   (unless beg (setq beg (point-min)))
   (unless end (setq end (point-max)))
+  (overlay-recenter end)
   (if (< end beg)
       (setq beg (prog1 end (setq end beg))))
   (save-excursion
index 06b7784..1a4ca96 100644 (file)
@@ -38,7 +38,7 @@
 ;; now position sensitive.
 
 (defvar t-mouse-process nil
-  "Embeds the process which passes mouse events to emacs.
+  "Embeds the process which passes mouse events to Emacs.
 It is used by the program t-mouse.")
 
 (defvar t-mouse-filter-accumulator ""
@@ -123,7 +123,7 @@ For example, \"2\" for /dev/tty2."
   (if (null l1) l2
     (append (mapcar (function (lambda (x) (append (nth 0 l1) x))) l2)
             (t-mouse-cartesian (cdr l1) l2))))
-      
+
 (let* ((modifier-sets (t-mouse-powerset '(control meta shift)))
        (typed-sets (t-mouse-cartesian '((down) (drag))
                                       '((mouse-1) (mouse-2) (mouse-3))))
@@ -178,9 +178,9 @@ Also trim the accumulator by all the data used to build the event."
                 ((event-name-string (symbol-name event-type))
                  end-of-root-event-name
                  new-event-name-string)
+
               (if (string-match "-\\(21\\|\\12\\)$" event-name-string)
+
                   ;;Transform the name to what it should have been.
                   (progn
                     (setq end-of-root-event-name (match-beginning 0))
@@ -188,12 +188,12 @@ Also trim the accumulator by all the data used to build the event."
                           (concat (substring
                                    event-name-string 0
                                    end-of-root-event-name) "-3"))
-             
+
                     ;;Change the event to the symbol that corresponds to the
                     ;;name we made. The proper symbol already exists.
                     (setq event-type
                           (intern new-event-name-string))))))
-       
+
         ;;store current position for mouse-position
 
         (setq t-mouse-current-xy (nth 0 current-xy-avec-time))
@@ -269,7 +269,7 @@ The (secret) scrollbar interface is not implemented yet."
   "Toggle t-mouse mode.
 With prefix arg, turn t-mouse mode on iff arg is positive.
 
-Turn it on to use emacs mouse commands, and off to use t-mouse commands."
+Turn it on to use Emacs mouse commands, and off to use t-mouse commands."
   nil " Mouse" nil :global t
   (if t-mouse-mode
       ;; Turn it on
index de37f28..9dde60b 100644 (file)
@@ -52,7 +52,7 @@ The variable `tab-width' controls the spacing of tab stops."
 
 (defvar tabify-regexp " [ \t]+"
   "Regexp matching whitespace that tabify should consider.
-Usually this will be \" [ \\t]+\" to match two or more spaces or tabs.
+Usually this will be \" [ \\t]+\" to match a space followed by whitespace.
 \"^\\t* [ \\t]+\" is also useful, for tabifying only initial whitespace.")
 
 ;;;###autoload
index a02fd1b..b1f0176 100644 (file)
@@ -363,7 +363,7 @@ MODE should be an integer which is a file mode value."
                  ((eq type 29) ?M)     ; multivolume continuation
                  ((eq type 35) ?S)     ; sparse
                  ((eq type 38) ?V)     ; volume header
-                 (t ?\ )
+                 (t ?\s)
                  )
            (tar-grind-file-mode mode)
            (if (= 0 (length uname)) uid uname)
@@ -958,7 +958,7 @@ for this to be permanent."
   (save-excursion
     (goto-char (point-min))
     (while (< (position-bytes (point)) tar-header-offset)
-      (if (not (eq (following-char) ?\ ))
+      (if (not (eq (following-char) ?\s))
          (progn (delete-char 1) (insert " ")))
       (forward-line 1))))
 
index 4124e2a..77dd921 100644 (file)
@@ -1422,8 +1422,12 @@ The main purpose is to get rid of the local keymap."
           (format "TERMINFO=%s" data-directory)
           (format term-termcap-format "TERMCAP="
                   term-term-name term-height term-width)
-          ;; Breaks `./configure' of w3 and url which try to run $EMACS.
+          ;; We are going to get rid of the binding for EMACS,
+          ;; probably in Emacs 23, because it breaks
+          ;; `./configure' of some packages that expect it to
+          ;; say where to find EMACS.
           (format "EMACS=%s (term:%s)" emacs-version term-protocol-version)
+          (format "INSIDE_EMACS=%s,term:%s" emacs-version term-protocol-version)
           (format "LINES=%d" term-height)
           (format "COLUMNS=%d" term-width))
          process-environment))
index ec058e9..afb749f 100644 (file)
@@ -2147,6 +2147,8 @@ The actual text stored in the X cut buffer is what encoded from this value.")
 (defvar x-last-selected-text-cut-encoded nil
   "The value of the X cut buffer last time we selected or pasted text.
 This is the actual text stored in the X cut buffer.")
+(defvar x-last-cut-buffer-coding 'iso-latin-1
+  "The coding we last used to encode/decode the text from the X cut buffer")
 
 (defvar x-cut-buffer-max 20000 ; Note this value is overridden below.
   "Max number of characters to put in the cut buffer.
@@ -2172,9 +2174,10 @@ in the clipboard."
               x-last-selected-text-cut-encoded ""))
        (t
         (setq x-last-selected-text-cut text
+              x-last-cut-buffer-coding 'iso-latin-1
               x-last-selected-text-cut-encoded
-              (encode-coding-string text (or locale-coding-system
-                                             'iso-latin-1)))
+              ;; ICCCM says cut buffer always contain ISO-Latin-1
+              (encode-coding-string text 'iso-latin-1))
         (x-set-cut-buffer x-last-selected-text-cut-encoded push)))
   (x-set-selection 'PRIMARY text)
   (setq x-last-selected-text-primary text)
@@ -2340,23 +2343,28 @@ order until succeed.")
     ;; from what we remebered them to be last time we did a
     ;; cut/paste operation.
     (setq cut-text
-         (cond;; check cut buffer
-          ((or (not cut-text) (string= cut-text ""))
-           (setq x-last-selected-text-cut nil))
-          ;; This short cut doesn't work because x-get-cut-buffer
-          ;; always returns a newly created string.
-          ;; ((eq      cut-text x-last-selected-text-cut) nil)
-          ((string= cut-text x-last-selected-text-cut-encoded)
-           ;; See the comment above.  No need of this recording.
-           ;; Record the newer string,
-           ;; so subsequent calls can use the `eq' test.
-           ;; (setq x-last-selected-text-cut cut-text)
-           nil)
-          (t
-           (setq x-last-selected-text-cut-encoded cut-text
+         (let ((next-coding (or next-selection-coding-system 'iso-latin-1)))
+           (cond;; check cut buffer
+            ((or (not cut-text) (string= cut-text ""))
+             (setq x-last-selected-text-cut nil))
+            ;; This short cut doesn't work because x-get-cut-buffer     
+            ;; always returns a newly created string.   
+            ;; ((eq      cut-text x-last-selected-text-cut) nil)        
+            ((and (string= cut-text x-last-selected-text-cut-encoded)
+                  (eq x-last-cut-buffer-coding next-coding))
+             ;; See the comment above.  No need of this recording.      
+             ;; Record the newer string,        
+             ;; so subsequent calls can use the `eq' test.      
+             ;; (setq x-last-selected-text-cut cut-text)        
+             nil)
+            (t
+             (setq x-last-selected-text-cut-encoded cut-text
+                 x-last-cut-buffer-coding next-coding
                  x-last-selected-text-cut
-                 (decode-coding-string cut-text (or locale-coding-system
-                                                    'iso-latin-1))))))
+                 ;; ICCCM says cut buffer always contain ISO-Latin-1, but
+                 ;; use next-selection-coding-system if not nil.
+                 (decode-coding-string 
+                  cut-text next-coding))))))
 
     ;; As we have done one selection, clear this now.
     (setq next-selection-coding-system nil)
index e574c34..fd21c77 100644 (file)
 (define-key xterm-function-map "\eO2Q" [S-f2])
 (define-key xterm-function-map "\eO2R" [S-f3])
 (define-key xterm-function-map "\eO2S" [S-f4])
+(define-key xterm-function-map "\e[1;2P" [S-f1])
+(define-key xterm-function-map "\e[1;2Q" [S-f2])
+(define-key xterm-function-map "\e[1;2R" [S-f3])
+(define-key xterm-function-map "\e[1;2S" [S-f4])
 (define-key xterm-function-map "\e[15;2~" [S-f5])
 (define-key xterm-function-map "\e[17;2~" [S-f6])
 (define-key xterm-function-map "\e[18;2~" [S-f7])
     ;; MODIFIER-FUNCTION_KEY, where modifier is S-, C, A-, C-S-.  The
     ;; code here subsitutes the corresponding defintions in
     ;; function-key-map. This substitution is needed because if a key
-    ;; definition if found in function-key-map, there are no further
+    ;; definition is found in function-key-map, there are no further
     ;; lookups in other keymaps.
     (substitute-key-definition [f13] [S-f1] local-function-key-map)
     (substitute-key-definition [f14] [S-f2] local-function-key-map)
index 63092e3..323ddcd 100644 (file)
@@ -567,10 +567,10 @@ together with a command \\<terminal-edit-map>to return to terminal emulation: \\
         (let ((p (point)))
           (cond ((search-forward "\n" (+ p width) 'move)
                  (forward-char -1)
-                 (insert-char ?\  (- width (- (point) p)))
+                 (insert-char ?\s (- width (- (point) p)))
                  (forward-char 1))
                 ((eobp)
-                 (insert-char ?\  (- width (- (point) p))))
+                 (insert-char ?\s (- width (- (point) p))))
                 ((= (following-char) ?\n)
                  (forward-char 1))
                 (t
@@ -642,7 +642,7 @@ together with a command \\<terminal-edit-map>to return to terminal emulation: \\
           (forward-char 1)
           (delete-region (point)
                          (+ (point) (length terminal-more-break-insertion)))
-          (insert-char ?\  te-width)
+          (insert-char ?\s te-width)
           (goto-char te-more-old-point)))
     (setq te-more-old-point nil)
     (let ((te-more-count 259259))
@@ -693,7 +693,7 @@ move to start of new line, clear to end of line."
                   (insert ?\n))))
     (forward-char 1)
     (delete-region (point) (+ (point) te-width)))
-  (insert-char ?\  te-width)
+  (insert-char ?\s te-width)
   (beginning-of-line)
   (te-set-window-start))
 
@@ -717,7 +717,7 @@ move to start of new line, clear to end of line."
   (save-excursion
     (let ((n (- (point) (progn (end-of-line) (point)))))
       (delete-region (point) (+ (point) n))
-      (insert-char ?\  (- n)))))
+      (insert-char ?\s (- n)))))
 
 
 ;; ^p C
@@ -727,7 +727,7 @@ move to start of new line, clear to end of line."
     (while (progn (end-of-line) (not (eobp)))
       (forward-char 1) (end-of-line)
       (delete-region (- (point) te-width) (point))
-      (insert-char ?\  te-width))))
+      (insert-char ?\s te-width))))
 
 
 ;; ^p ^l
@@ -737,7 +737,7 @@ move to start of new line, clear to end of line."
   (let ((i 0))
     (while (< i te-height)
       (setq i (1+ i))
-      (insert-char ?\  te-width)
+      (insert-char ?\s te-width)
       (insert ?\n)))
   (delete-region (1- (point-max)) (point-max))
   (goto-char (point-min))
@@ -750,13 +750,13 @@ move to start of new line, clear to end of line."
       ();(error "fooI")
     (save-excursion
       (let* ((line (- te-height (/ (- (point) (point-min)) (1+ te-width)) -1))
-            (n (min (- (te-get-char) ?\ ) line))
+            (n (min (- (te-get-char) ?\s) line))
             (i 0))
        (delete-region (- (point-max) (* n (1+ te-width))) (point-max))
        (if (eq (point) (point-max)) (insert ?\n))
        (while (< i n)
          (setq i (1+ i))
-         (insert-char ?\  te-width)
+         (insert-char ?\s te-width)
          (or (eq i line) (insert ?\n))))))
   (setq te-more-count -1))
 
@@ -766,7 +766,7 @@ move to start of new line, clear to end of line."
   (if (not (bolp))
       ();(error "fooD")
     (let* ((line (- te-height (/ (- (point) (point-min)) (1+ te-width)) -1))
-          (n (min (- (te-get-char) ?\ ) line))
+          (n (min (- (te-get-char) ?\s) line))
           (i 0))
       (delete-region (point)
                     (min (+ (point) (* n (1+ te-width))) (point-max)))
@@ -774,7 +774,7 @@ move to start of new line, clear to end of line."
        (goto-char (point-max))
        (while (< i n)
          (setq i (1+ i))
-         (insert-char ?\  te-width)
+         (insert-char ?\s te-width)
          (or (eq i line) (insert ?\n))))))
   (setq te-more-count -1))
 
@@ -798,7 +798,7 @@ move to start of new line, clear to end of line."
   (if (bolp)
       ()
     (delete-region (1- (point)) (point))
-    (insert ?\ )
+    (insert ?\s)
     (forward-char -1)))
 
 ;; ^p ^g
@@ -815,7 +815,7 @@ move to start of new line, clear to end of line."
        nil
       (delete-char (- n))
       (goto-char p)
-      (insert-char ?\  n))
+      (insert-char ?\s n))
     (goto-char p)))
 
 ;; ^p d count+32  (should be ^p ^d but cretinous un*x won't send ^d chars!!!)
@@ -825,7 +825,7 @@ move to start of new line, clear to end of line."
                 (- (progn (end-of-line) (point)) p))))
     (if (<= n 0)
        nil
-      (insert-char ?\  n)
+      (insert-char ?\s n)
       (goto-char p)
       (delete-char n))
     (goto-char p)))
@@ -862,7 +862,7 @@ move to start of new line, clear to end of line."
          (delete-char 1)
          (goto-char (point-max))
          (insert ?\n)
-         (insert-char ?\  te-width)
+         (insert-char ?\s te-width)
          (beginning-of-line))
       (forward-line 1))
     (move-to-column column))
@@ -1162,7 +1162,7 @@ subprocess started."
   (setq inhibit-quit t)                        ;sport death
   (use-local-map terminal-map)
   (run-hooks 'terminal-mode-hook)
-  (message "Entering emacs terminal-emulator...  Type %s %s for help"
+  (message "Entering Emacs terminal-emulator...  Type %s %s for help"
           (single-key-description terminal-escape-char)
           (mapconcat 'single-key-description
                      (where-is-internal 'te-escape-help terminal-escape-map t)
index c82f2dc..9597b13 100644 (file)
@@ -5,7 +5,7 @@
 
 ;; Author: Stefan Schoef <schoef@offis.uni-oldenburg.de>
 ;;      Bengt Martensson <bengt@mathematik.uni-Bremen.de>
-;;      Mark Shapiro <shapiro@corto.inria.fr>
+;;      Marc Shapiro <marc.shapiro@acm.org>
 ;;      Mike Newton <newton@gumby.cs.caltech.edu>
 ;;      Aaron Larson <alarson@src.honeywell.com>
 ;;      Dirk Herrmann <D.Herrmann@tu-bs.de>
index 1c81b5c..cd1079e 100644 (file)
@@ -66,7 +66,7 @@
 (defface fixed
   '((t (:weight bold)))
   "Face used for text that must be shown in fixed width.
-Currently, emacs can only display fixed-width fonts, but this may change.
+Currently, Emacs can only display fixed-width fonts, but this may change.
 This face is used for text specifically marked as fixed-width, for example
 in text/enriched files."
   :group 'enriched)
index 5143501..e5b3a64 100644 (file)
@@ -741,6 +741,12 @@ space does not end a sentence, so don't break a line there."
               (looking-at (regexp-quote prefix))))
     (goto-char (match-end 0))))
 
+(defun fill-minibuffer-function (arg)
+  "Fill a paragraph in the minibuffer, ignoring the prompt."
+  (save-restriction 
+    (narrow-to-region (minibuffer-prompt-end) (point-max))
+    (fill-paragraph arg)))
+
 (defun fill-paragraph (arg)
   "Fill paragraph at or after point.  Prefix ARG means justify as well.
 If `sentence-end-double-space' is non-nil, then period followed by one
@@ -755,8 +761,13 @@ If `fill-paragraph-function' is nil, return the `fill-prefix' used for filling."
                 (barf-if-buffer-read-only)
                 (list (if current-prefix-arg 'full))))
   ;; First try fill-paragraph-function.
-  (or (and fill-paragraph-function
-          (let ((function fill-paragraph-function)
+  (or (and (or fill-paragraph-function
+              (and (window-minibuffer-p (selected-window))
+                   (= 1 (point-min))))
+          (let ((function (or fill-paragraph-function
+                              ;; In the minibuffer, don't count the width
+                              ;; of the prompt.
+                              'fill-minibuffer-function))
                 ;; If fill-paragraph-function is set, it probably takes care
                 ;; of comments and stuff.  If not, it will have to set
                 ;; fill-paragraph-handle-comment back to t explicitly or
index b241248..a3c110b 100644 (file)
@@ -189,7 +189,7 @@ Ispell's ultimate default dictionary."
   :type 'string)
 
 (defcustom flyspell-check-tex-math-command nil
-  "Non nil means check even inside TeX math environment.
+  "Non-nil means check even inside TeX math environment.
 TeX math environments are discovered by the TEXMATHP that implemented
 inside the texmathp.el Emacs package.  That package may be found at:
 http://strw.leidenuniv.nl/~dominik/Tools"
@@ -412,6 +412,7 @@ property of the major mode name.")
     (define-key map flyspell-auto-correct-binding 'flyspell-auto-correct-previous-word)
     (define-key map [(control ?\,)] 'flyspell-goto-next-error)
     (define-key map [(control ?\.)] 'flyspell-auto-correct-word)
+    (define-key map [?\C-c ?$] 'flyspell-correct-word-before-point)
     map)
   "Minor mode keymap for Flyspell mode--for the whole buffer.")
 
@@ -1999,52 +2000,62 @@ But don't look beyond what's visible on the screen."
 ;;*---------------------------------------------------------------------*/
 ;;*    flyspell-correct-word ...                                        */
 ;;*---------------------------------------------------------------------*/
+
 (defun flyspell-correct-word (event)
   "Pop up a menu of possible corrections for a misspelled word.
 The word checked is the word at the mouse position."
   (interactive "e")
-  ;; use the correct dictionary
-  (flyspell-accept-buffer-local-defs)
-  ;; retain cursor location (I don't know why but save-excursion here fails).
   (let ((save (point)))
     (mouse-set-point event)
-    (let ((cursor-location (point))
-         (word (flyspell-get-word nil)))
-      (if (consp word)
-         (let ((start (car (cdr word)))
-               (end (car (cdr (cdr word))))
-               (word (car word))
-               poss ispell-filter)
-           ;; now check spelling of word.
-           (ispell-send-string "%\n") ;put in verbose mode
-           (ispell-send-string (concat "^" word "\n"))
-           ;; wait until ispell has processed word
-            (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
-            ((or (eq poss t) (stringp poss))
-             ;; don't correct word
-             t)
-            ((null poss)
-             ;; ispell error
-             (error "Ispell: error in Ispell process"))
-            ((featurep 'xemacs)
-             (flyspell-xemacs-popup
-               poss word cursor-location start end save))
-            (t
-             ;; The word is incorrect, we have to propose a replacement.
-              (flyspell-do-correct (flyspell-emacs-popup event poss word)
-                                   poss word cursor-location start end save)))
-           (ispell-pdict-save t))))))
+    (flyspell-correct-word-before-point event save)))
+
+(defun flyspell-correct-word-before-point (&optional event opoint)
+  "Pop up a menu of possible corrections for misspelled word before point.
+If EVENT is non-nil, it is the mouse event that invoked this operation;
+that controls where to put the menu.
+If OPOINT is non-nil, restore point there after adjusting it for replacement."
+  (interactive)
+  (unless (mouse-position)
+    (error "Pop-up menus do not work on this terminal"))
+  ;; use the correct dictionary
+  (flyspell-accept-buffer-local-defs)
+  (let ((cursor-location (point))
+       (word (flyspell-get-word nil)))
+    (if (consp word)
+       (let ((start (car (cdr word)))
+             (end (car (cdr (cdr word))))
+             (word (car word))
+             poss ispell-filter)
+         ;; now check spelling of word.
+         (ispell-send-string "%\n")    ;put in verbose mode
+         (ispell-send-string (concat "^" word "\n"))
+         ;; wait until ispell has processed word
+         (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
+          ((or (eq poss t) (stringp poss))
+           ;; don't correct word
+           t)
+          ((null poss)
+           ;; ispell error
+           (error "Ispell: error in Ispell process"))
+          ((featurep 'xemacs)
+           (flyspell-xemacs-popup
+            poss word cursor-location start end opoint))
+          (t
+           ;; The word is incorrect, we have to propose a replacement.
+           (flyspell-do-correct (flyspell-emacs-popup event poss word)
+                                poss word cursor-location start end opoint)))
+         (ispell-pdict-save t)))))
 
 ;;*---------------------------------------------------------------------*/
 ;;*    flyspell-do-correct ...                                      */
index 2a42a91..5bc685a 100644 (file)
        "Empty replacement for defgroup when not supplied.")))
 
 (defgroup ispell nil
-  "User variables for emacs ispell interface."
+  "User variables for Emacs ispell interface."
   :group 'applications)
 
 (if (not (fboundp 'buffer-substring-no-properties))
@@ -496,7 +496,7 @@ These can override the values in `ispell-dictionary-alist'.
 
 To make permanent changes to your dictionary definitions, you
 will need to make your changes in this variable, save, and then
-re-start emacs."
+re-start Emacs."
   :type '(repeat (list (choice :tag "Dictionary"
                               (string :tag "Dictionary name")
                               (const :tag "default" nil))
@@ -900,13 +900,13 @@ and added as a submenu of the \"Edit\" menu.")
             (buffer-string))))
         ;; Search for the named dictionaries.
         (found
-         (delq nil 
+         (delq nil
                (mapcar #'ispell-aspell-find-dictionary dictionaries))))
     ;; Ensure aspell's alias dictionary will override standard
     ;; definitions.
     (setq found (ispell-aspell-add-aliases found))
     ;; Merge into FOUND any elements from the standard ispell-dictionary-alist
-    ;; which have no element in FOUND at all.    
+    ;; which have no element in FOUND at all.
     (dolist (dict ispell-dictionary-alist)
       (unless (assoc (car dict) found)
        (setq found (nconc found (list dict)))))
@@ -2104,7 +2104,7 @@ SPC:   Accept word this time.
 `m':   Place typed-in value in personal dictionary, then recheck current word.
 `C-l':  redraws screen
 `C-r':  recursive edit
-`C-z':  suspend emacs or iconify frame"
+`C-z':  suspend Emacs or iconify frame"
 
   (if (equal ispell-help-in-bufferp 'electric)
       (progn
@@ -2136,7 +2136,7 @@ SPC:   Accept word this time.
 `m':   Place typed-in value in personal dictionary, then recheck current word.
 `C-l':  redraws screen
 `C-r':  recursive edit
-`C-z':  suspend emacs or iconify frame")
+`C-z':  suspend Emacs or iconify frame")
                     nil        ;undocumented requirement of with-electric-help
                     ))))
 
index caca6a6..d9baad4 100644 (file)
@@ -5,7 +5,7 @@
 ;; Author: Carsten Dominik <dominik at science dot uva dot nl>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/
-;; Version: 4.44
+;; Version: 4.56b
 ;;
 ;; This file is part of GNU Emacs.
 ;;
 ;; iCalendar file.  It can also serve as a publishing tool for a set of
 ;; linked webpages.
 ;;
+;; Installation and Activation
+;; ---------------------------
+;; See the corresponding sections in the manual at
 ;;
-;; Installation
-;; ------------
-;; If Org-mode is part of the Emacs distribution or an XEmacs package, you
-;; only need to copy the following lines to your .emacs file.  The last two
-;; lines define *global* keys for the commands `org-store-link' and
-;; `org-agenda' - please choose suitable keys yourself.
-;;
-;;    (add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
-;;    (define-key global-map "\C-cl" 'org-store-link)
-;;    (define-key global-map "\C-ca" 'org-agenda)
-;;
-;; Furthermore you need to activate font-lock-mode in org-mode buffers.
-;; either of the following two lins will do the trick:
-;;
-;;    (global-font-lock-mode 1)                     ; for all buffers
-;;    (add-hook 'org-mode-hook 'turn-on-font-lock)  ; org-mode buffers only
-;;
-;; If you have downloaded Org-mode from the Web, you have to take additional
-;; action:  Byte-compile org.el and org-publish.el and put them together with
-;; org-install.el on your load path.  Then also add to your .emacs file:
-;;
-;;    (require 'org-install)
-;;
-;;
-;; Activation
-;; ----------
-;; The setup above will put all files with extension ".org" into Org-mode.
-;; As an alternative, make the first line of a file look like this:
-;;
-;;     MY PROJECTS    -*- mode: org; -*-
-;;
-;; which will select Org-mode for this buffer no matter what the file's
-;; name is.
+;;   http://staff.science.uva.nl/~dominik/Tools/org/org.html#Installation
 ;;
 ;; Documentation
 ;; -------------
 ;;
 ;; Recent changes
 ;; --------------
-;; Version 4.44
-;;    - Clock table can be done for a limited time interval.
-;;    - Obsolete support for the old outline mode has been removed.
-;;    - Bug fixes and code cleaning.
-;;
-;; Version 4.43
-;;    - Bug fixes
-;;    - `s' key in the agenda saves all org-mode buffers.
-;;
-;; Version 4.41
-;;    - Shift-curser keys can modify inactive time stamps (inactive time
-;;      stamps are the ones in [...] brackets.
-;;    - Toggle all checkboxes in a region/below a headline.
+;; Version 4.56
+;;    - `C-k' in agenda kills current line and corresponding subtree in file.
+;;    - XEmacs compatibility issues fixed, in particular tag alignment.
+;;    - M-left/right now in/outdents plain list items, no Shift needed.
 ;;    - Bug fixes.
 ;;
-;; Version 4.40
+;; Version 4.55
 ;;    - Bug fixes.
 ;;
-;; Version 4.39
-;;    - Special tag ARCHIVE keeps a subtree closed and away from agenda lists.
-;;    - LaTeX code in Org-mode files can be converted to images for HTML.
+;; Version 4.54
+;;    - Improvements to fast tag selection
+;;      + show status also in target line.
+;;      + option to auto-exit after first change to tags list (see manual).
+;;    - Tags sparse trees now also respect the settings in
+;;      `org-show-hierarchy-above' and `org-show-following-heading'.
 ;;    - Bug fixes.
-;;    - CDLaTeX-mode features can be used in Org-mode to help inserting
-;;      LaTeX environment and math.
 ;;
-;; Version 4.38
-;;    - noutline.el is now required (important for XEmacs users only).
-;;    - Dynamic blocks.
-;;    - Archiving of all level 1 trees without open TODO items.
-;;    - Clock reports can be inserted into the file in a special section.
-;;    - FAQ removed from the manual, now only on the web.
+;; Version 4.53
+;;    - Custom time formats can be overlayed over time stamps.
+;;    - New option `org-agenda-todo-ignore-deadlines'.
+;;    - Work-around for flyspell bug (CVS Emacs has this fixed in flyspell.el).
+;;    - Work-around for session.el problem with circular data structures.
 ;;    - Bug fixes.
 ;;
-;; Version 4.37
-;;    - Clock-feature for measuring time spent on specific items.
-;;    - Improved emphasizing allows configuration and stacking.
-;;
-;; Version 4.36
-;;    - Improved indentation of ASCII export, when headlines become items.
-;;    - Handling of 12am and 12pm fixed.  Times beyond 24:00 can be used
-;;      and will not lead to conflicts.
-;;    - Support for mutually exclusive TAGS with the fast tags interface.
+;; Version 4.52
+;;    - TAG matches can also specify conditions on TODO keywords.
+;;    - The fast tag interface allows setting tags that are not in the
+;;      predefined list.
 ;;    - Bug fixes.
 ;;
-;; Version 4.35
-;;    - HTML export is now valid XHTML.
-;;    - Timeline can also show dates without entries.  See new option
-;;      `org-timeline-show-empty-dates'.
-;;    - The bullets created by the ASCII exporter can now be configured.
-;;      See the new option `org-export-ascii-bullets'.
-;;    - New face `org-upcoming-deadline' (was `org-scheduled-previously').
-;;    - New function `org-context' to allow testing for local context.
-;;
-;; Version 4.34
+;; Version 4.51
+;;    - Link abbreviations (manual section 4.5).
+;;    - More control over how agenda is displayed.  See the new variables
+;;      `org-agenda-window-setup', `org-agenda-restore-windows-after-quit'.
 ;;    - Bug fixes.
 ;;
-;; Version 4.33
-;;    - New commands to move through plain lists: S-up and S-down.
-;;    - Bug fixes and documentation update.
-;;
-;; Version 4.32
-;;    - Fast (single-key-per-tag) interface for setting TAGS.
-;;    - The list of legal tags can be configured globally and locally.
-;;    - Elisp and Info links (thanks to Todd Neal).
-;;    - `org-export-publishing-directory' can be an alist, with different
-;;      directories for different export types.
-;;    - All context-sensitive commands use `call-interactively' to dispatch.
-;;    - `org-confirm-shell-links' renamed to `org-confirm-shell-link-function'.
-;;    - Bug fixes.
-;;
-;; Version 4.31
-;;    - Bug fixes.
-;;
-;; Version 4.30
-;;    - Modified installation: Autoloads have been collected in org-install.el.
-;;    - Logging (org-log-done) is now a #+STARTUP option.
-;;    - Checkboxes in plain list items, following up on Frank Ruell's idea.
-;;    - File links inserted with C-c C-l will use relative paths if the linked
-;;      file is in the current directory or a subdirectory of it.
-;;    - New variable `org-link-file-path-type' to specify preference for
-;;      relative and absolute paths.
-;;    - New CSS classes for tags, timestamps, timestamp keywords.
-;;    - Bug and typo fixes.
-;;
-;; Version 4.29
-;;    - Inlining images in HTML export now depends on wheather the link
-;;      contains a description or not.
-;;    - TODO items can be scheduled from the global TODO list using C-c C-s.
-;;    - TODO items already scheduled can be made to disappear from the global
-;;      todo list, see `org-agenda-todo-ignore-scheduled'.
-;;    - In Tables, formulas may also be Lisp forms.
-;;    - Exporting the visible part of an outline with `C-c C-x v' works now
-;;      for all available exporters.
-;;    - Bug fixes, lots of them :-(
-;;
-;; Version 4.28
-;;    - Bug fixes.
-;;
-;; Version 4.27
-;;    - HTML exporter generalized to receive external options.
-;;      As part of the process, author, email and date have been moved to the
-;;      end of the HTML file.
-;;    - Support for customizable file search in file links.
-;;    - BibTeX database links as first application of the above.
-;;    - New option `org-agenda-todo-list-sublevels' to turn off listing TODO
-;;      entries that are sublevels of another TODO entry.
-;;
-;;
 ;;; Code:
 
 (eval-when-compile
   (require 'cl)
+  (require 'gnus-sum)
   (require 'calendar))
 ;; For XEmacs, noutline is not yet provided by outline.el, so arrange for
 ;; the file noutline.el being loaded.
 
 ;;; Customization variables
 
-(defvar org-version "4.44"
+(defvar org-version "4.56b"
   "The version number of the file org.el.")
 (defun org-version ()
   (interactive)
@@ -472,6 +372,16 @@ body starts at column 0, indentation is not changed at all."
   :group 'org-edit-structure
   :type 'boolean)
 
+(defcustom org-blank-before-new-entry '((heading . nil)
+                                       (plain-list-item . nil))
+  "Should `org-insert-heading' leave a blank line before new heading/item?
+The value is an alist, with `heading' and `plain-list-item' as car,
+and a boolean flag as cdr."
+  :group 'org-edit-structure
+  :type '(list
+         (cons (const heading) (boolean))
+         (cons (const plain-list-item) (boolean))))
+
 (defcustom org-insert-heading-hook nil
   "Hook being run after inserting a new heading."
   :group 'org-edit-structure
@@ -497,21 +407,71 @@ changed by an edit command."
   :group 'org-sparse-trees
   :type 'boolean)
 
-(defcustom org-show-hierarchy-above t
-  "Non-nil means, show full hierarchy when showing a spot in the tree.
-Turning this off makes sparse trees more compact, but also less clear."
+(defcustom org-remove-highlights-with-change t
+  "Non-nil means, any change to the buffer will remove temporary highlights.
+Such highlights are created by `org-occur' and `org-clock-display'.
+When nil, `C-c C-c needs to be used to get rid of the highlights.
+The highlights created by `org-preview-latex-fragment' always need
+`C-c C-c' to be removed."
   :group 'org-sparse-trees
+  :group 'org-time
   :type 'boolean)
 
-(defcustom org-show-following-heading t
+(defcustom org-show-hierarchy-above '((default . t))
+  "Non-nil means, show full hierarchy when showing a spot in the tree.
+Turning this off makes sparse trees more compact, but also less clear.
+Instead of t, this can also be an alist specifying this option for different
+contexts.  Valid contexts are
+  agenda         when exposing an entry from the agenda
+  org-goto       when using the command `org-goto' on key C-c C-j
+  occur-tree     when using the command `org-occur' on key C-c /
+  tags-tree      when constructing a sparse tree based on tags matches
+  link-search    when exposing search matches associated with a link
+  mark-goto      when exposing the jump goal of a mark
+  bookmark-jump  when exposing a bookmark location
+  default        default for all contexts not set explicitly"
+  :group 'org-sparse-trees
+  :type '(choice
+         (const :tag "Always" t)
+         (const :tag "Never" nil)
+         (repeat :greedy t :tag "Individual contexts"
+                 (cons
+                  (choice :tag "Context"
+                   (const agenda)
+                   (const org-goto)
+                   (const occur-tree)
+                   (const tags-tree)
+                   (const link-search)
+                   (const mark-goto)
+                   (const bookmark-jump)
+                   (const default))
+                  (boolean)))))
+
+(defcustom org-show-following-heading '((default . t))
   "Non-nil means, show heading following match in `org-occur'.
 When doing an `org-occur' it is useful to show the headline which
 follows the match, even if they do not match the regexp.  This makes it
 easier to edit directly inside the sparse tree.  However, if you use
 `org-occur' mainly as an overview, the following headlines are
-unnecessary clutter."
+unnecessary clutter.
+Instead of t, this can also be an alist specifying this option for different
+contexts.  See `org-show-hierarchy-above' for valid contexts."
   :group 'org-sparse-trees
-  :type 'boolean)
+  :type '(choice
+         (const :tag "Always" t)
+         (const :tag "Never" nil)
+         (repeat :greedy t :tag "Individual contexts"
+                 (cons
+                  (choice :tag "Context"
+                   (const agenda)
+                   (const org-goto)
+                   (const occur-tree)
+                   (const tags-tree)
+                   (const link-search)
+                   (const mark-goto)
+                   (const bookmark-jump)
+                   (const default))
+                  (boolean)))))
 
 (defcustom org-occur-hook '(org-first-headline-recenter)
   "Hook that is run after `org-occur' has constructed a sparse tree.
@@ -535,7 +495,6 @@ such an item."
   :group 'org-plain-lists
   :type 'boolean)
 
-
 (defcustom org-plain-list-ordered-item-terminator t
   "The character that makes a line with leading number an ordered list item.
 Valid values are ?. and ?\).  To get both terminators, use t.  While
@@ -555,6 +514,14 @@ use \\[org-ctrl-c-ctrl-c] to trigger renumbering."
   :group 'org-plain-lists
   :type 'boolean)
 
+(defcustom org-provide-checkbox-statistics t
+  "Non-nil means, update checkbox statistics after insert and toggle.
+When this is set, checkbox statistics is updated each time you either insert
+a new checkbox with \\[org-insert-todo-heading] or toggle a checkbox
+with \\[org-ctrl-c-ctrl-c\\]."
+  :group 'org
+  :type 'boolean)
+
 (defgroup org-archive nil
   "Options concerning archiving in Org-mode."
   :tag "Org Archive"
@@ -652,8 +619,8 @@ When nil, such lines will be treated like ordinary lines.
 
 When equal to the symbol `optimized', the table editor will be optimized to
 do the following:
-- Use automatic overwrite mode in front of whitespace in table fields.
-  This make the structure of the table stay in tact as long as the edited
+- Automatic overwrite mode in front of whitespace in table fields.
+  This makes the structure of the table stay in tact as long as the edited
   field does not exceed the column width.
 - Minimize the number of realigns.  Normally, the table is aligned each time
   TAB or RET are pressed to move to another field.  With optimization this
@@ -701,7 +668,8 @@ this variable requires a restart of Emacs to become effective."
   :group 'org-table-settings
    :type 'string)
 
-(defcustom org-table-number-regexp "^[<>]?[-+^.0-9]*[0-9][-+^.0-9eEdDx()%]*$"
+(defcustom org-table-number-regexp
+  "^\\([<>]?[-+^.0-9]*[0-9][-+^.0-9eEdDx()%]*\\|\\(0[xX]\\)?[0-9a-fA-F]+\\)$"
   "Regular expression for recognizing numbers in table columns.
 If a table column contains mostly numbers, it will be aligned to the
 right.  If not, it will be aligned to the left.
@@ -725,8 +693,8 @@ Other options offered by the customize interface are more restrictive."
                 "^[-+]?\\([0-9]*\\.[0-9]+\\|[0-9]+\\.?[0-9]*\\)$")
          (const :tag "Exponential, Floating point, Integer"
                 "^[-+]?[0-9.]+\\([eEdD][-+0-9]+\\)?$")
-         (const :tag "Very General Number-Like"
-                "^[<>]?[-+^.0-9]*[0-9][-+^.0-9eEdDx()%]*$")
+         (const :tag "Very General Number-Like, including hex"
+                "^\\([<>]?[-+^.0-9]*[0-9][-+^.0-9eEdDx()%]*\\|\\(0[xX]\\)?[0-9a-fA-F]+\\)$")
          (string :tag "Regexp:")))
 
 (defcustom org-table-number-fraction 0.5
@@ -857,6 +825,26 @@ Automatically means, when TAB or RET or C-c C-c are pressed in the line."
   :tag "Org Link"
   :group 'org)
 
+(defvar org-link-abbrev-alist-local nil
+  "buffer-local version of `org-link-abbrev-alist', which see.
+The value of this is taken from the #+LINK lines.")
+(make-variable-buffer-local 'org-link-abbrev-alist-local)
+
+(defcustom org-link-abbrev-alist nil
+  "Alist of link abbreviations.
+The car of each element is a string, to be replaced at the start of a link.
+The cdrs are replacement values, like (\"linkkey\" . REPLACE).  Abbreviated
+links in Org-mode buffers can have an optional tag after a double colon, e.g.
+
+     [[linkkey::tag][description]]
+
+If REPLACE is a string, the tag will simply be appended to create the link.
+If the string contains \"%s\", the tag will be inserted there.  REPLACE may
+also be a function that will be called with the tag as the only argument to
+create the link.  See the manual for examples."
+  :group 'org-link
+  :type 'alist)
+
 (defcustom org-descriptive-links t
   "Non-nil means, hide link part and only show description of bracket links.
 Bracket links are like [[link][descritpion]]. This variable sets the initial
@@ -1042,12 +1030,37 @@ another window."
                 (const find-file-other-window)
                 (const find-file-other-frame)))))
 
+(defcustom org-display-internal-link-with-indirect-buffer nil
+  "Non-nil means, use indirect buffer to display infile links.
+Activating internal links (from one location in a file to another location
+in the same file) normally just jumps to the location.  When the link is
+activated with a C-u prefix (or with mouse-3), the link is displayed in
+another window.  When this option is set, the other window actually displays
+an indirect buffer clone of the current buffer, to avoid any visibility
+changes to the current buffer."
+  :group 'org-link-follow
+  :type 'boolean)
+
+
 (defcustom org-open-non-existing-files nil
   "Non-nil means, `org-open-file' will open non-existing file.
 When nil, an error will be generated."
   :group 'org-link-follow
   :type 'boolean)
 
+(defcustom org-link-mailto-program '(browse-url "mailto:%a?subject=%s")
+  "Function and arguments to call for following mailto links.
+This is a list with the first element being a lisp function, and the
+remaining elements being arguments to the function.  In string arguments,
+%a will be replaced by the address, and %s will be replaced by the subject
+if one was given like in <mailto:arthur@galaxy.org::this subject>."
+  :group 'org-link-follow
+  :type '(choice
+         (const :tag "browse-url" (browse-url-mail "mailto:%a?subject=%s"))
+         (const :tag "compose-mail" (compose-mail "%a" "%s"))
+         (const :tag "message-mail" (message-mail "%a" "%s"))
+         (cons :tag "other" (function) (repeat :tag "argument" sexp))))
+
 (defcustom org-confirm-shell-link-function 'yes-or-no-p
   "Non-nil means, ask for confirmation before executing shell links.
 Shell links can be dangerous, just thing about a link
@@ -1067,7 +1080,7 @@ rather than having to type \"yes\"."
 
 (defcustom org-confirm-elisp-link-function 'yes-or-no-p
   "Non-nil means, ask for confirmation before executing elisp links.
-Elisp links can be dangerous, just thing about a link
+Elisp links can be dangerous, just think about a link
 
      [[elisp:(shell-command \"rm -rf ~/*\")][Google Search]]
 
@@ -1090,7 +1103,7 @@ See `org-file-apps'.")
 
 (defconst org-file-apps-defaults-macosx
   '((remote . emacs)
-    (t        . "open %s")
+    (t . "open %s")
     ("ps"     . "gv %s")
     ("ps.gz"  . "gv %s")
     ("eps"    . "gv %s")
@@ -1103,7 +1116,7 @@ for some files for which the OS does not have a good default.
 See `org-file-apps'.")
 
 (defconst org-file-apps-defaults-windowsnt
-  (list 
+  (list
    '(remote . emacs)
    (cons t
         (list (if (featurep 'xemacs)
@@ -1132,7 +1145,7 @@ file identifier are
  \"ext\"         A string identifying an extension
  `directory'   Matches a directory
  `remote'      Matches a remote file, accessible through tramp or efs.
-               Remote files most likely should be visited through emacs
+               Remote files most likely should be visited through Emacs
                because external applications cannot handle such paths.
  t             Default for all remaining files
 
@@ -1272,13 +1285,41 @@ Lisp variable `state'."
   "When set, insert a (non-active) time stamp when TODO entry is marked DONE.
 When the state of an entry is changed from nothing to TODO, remove a previous
 closing date.
-This can also be configured on a per-file basis by adding one of
+
+This can also be a list of symbols indicating under which conditions
+the time stamp recording the action should be annotated with a short note.
+Valid members of this list are
+
+  done       Offer to record a note when marking entries done
+  clock-out  Offer to record a note when clocking out of an item.
+
+A separate window will then pop up and allow you to type a note.
+After finishing with C-c C-c, the note will be added directly after the
+timestamp, as a plain list item.  See also the variable
+`org-log-note-headings'.
+
+Logging can also be configured on a per-file basis by adding one of
 the following lines anywhere in the buffer:
 
    #+STARTUP: logging
    #+STARTUP: nologging"
+;; FIXME: in-buffer words for notes???????
   :group 'org-todo
-  :type 'boolean)
+  :type '(choice
+         (const :tag "off" nil)
+         (const :tag "on" t)
+         (set :tag "on, with notes" :greedy t :value (done)
+              (const done) (const clock-out))))
+
+(defcustom org-log-note-headings '((done . "CLOSING NOTE") (clock-out . ""))
+  "Headings for notes added when clocking out or closing TODO items.
+The value is an alist, with the car being a sympol indicating the note
+context, and the cdr is the heading to be used.  The heading may also be the
+empty string."
+  :group  'org-todo
+  :type '(list :greedy t
+         (cons (const :tag "Heading when closing an item" done) string)
+         (cons (const :tag "Heading when clocking out" clock-out) string)))
 
 (defgroup org-priorities nil
   "Priorities in Org-mode."
@@ -1322,9 +1363,27 @@ a double prefix argument to a time-stamp command like `C-c .' or `C-c !'."
   :group 'org-time
   :type 'integer)
 
+(defcustom org-display-custom-times nil
+  "Non-nil means, overlay custom formats over all time stamps.
+The formats are defined through the variable `org-time-stamp-custom-formats'.
+To turn this on on a per-file basis, insert anywhere in the file:
+   #+STARTUP: customtime"
+  :group 'org-time
+  :set 'set-default
+  :type 'sexp)
+(make-variable-buffer-local 'org-display-custom-times)
+
+(defcustom org-time-stamp-custom-formats
+  '("<%m/%d/%y %a>" . "<%m/%d/%y %a %H:%M>") ; american
+  "Custom formats for time stamps.  See `format-time-string' for the syntax.
+These are overlayed over the default ISO format if the variable
+`org-display-custom-times' is set."
+  :group 'org-time
+  :type 'sexp)
+
 (defcustom org-deadline-warning-days 30
   "No. of days before expiration during which a deadline becomes active.
-This variable governs the display in the org file."
+This variable governs the display in sparse trees and in the agenda."
   :group 'org-time
   :type 'number)
 
@@ -1378,6 +1437,13 @@ automatically if necessary."
          (const :tag "Never" nil)
          (const :tag "When selection characters are configured" 'auto)))
 
+(defcustom org-fast-tag-selection-single-key nil
+  "Non-nil means, fast tag selection exits after first change.
+When nil, you have to press RET to exit it.
+During fast tag selection, you can toggle this flag with `C-c'."
+  :group 'org-tags
+  :type 'boolean)
+
 (defcustom org-tags-column 48
   "The column to which tags should be indented in a headline.
 If this number is positive, it specifies the column.  If it is negative,
@@ -1454,34 +1520,94 @@ agenda file per line."
          (repeat :tag "List of files" file)
          (file :tag "Store list in a file\n" :value "~/.agenda_files")))
 
-(defcustom org-agenda-custom-commands '(("w" todo "WAITING"))
+(defcustom org-agenda-custom-commands ;'(("w" todo "WAITING"))
+'(("w" todo "WAITING" ((aaa 1) (bbb 2))))
   "Custom commands for the agenda.
 These commands will be offered on the splash screen displayed by the
-agenda dispatcher \\[org-agenda].  Each entry is a list of 3 items:
-
-key    The key (a single char as a string) to be associated with the command.
-type   The command type, any of the following symbols:
-        todo        Entries with a specific TODO keyword, in all agenda files.
-        tags        Tags match in all agenda files.
-        tags-todo   Tags match in all agenda files, TODO entries only.
-        todo-tree   Sparse tree of specific TODO keyword in *current* file.
-        tags-tree   Sparse tree with all tags matches in *current* file.
-        occur-tree  Occur sparse tree for current file.
-match  What to search for:
-        - a single keyword for TODO keyword searches
-        - a tags match expression for tags searches
-        - a regular expression for occur searches"
+agenda dispatcher \\[org-agenda].  Each entry is a list like this:
+
+   (key type match options)
+
+key     The key (a single char as a string) to be associated with the command.
+type    The command type, any of the following symbols:
+         todo        Entries with a specific TODO keyword, in all agenda files.
+         tags        Tags match in all agenda files.
+         tags-todo   Tags match in all agenda files, TODO entries only.
+         todo-tree   Sparse tree of specific TODO keyword in *current* file.
+         tags-tree   Sparse tree with all tags matches in *current* file.
+         occur-tree  Occur sparse tree for *current* file.
+match   What to search for:
+         - a single keyword for TODO keyword searches
+         - a tags match expression for tags searches
+         - a regular expression for occur searches
+options  A list of option setttings, similar to that in a let form, so like
+         this: ((opt1 val1) (opt2 val2) ...)
+
+You can also define a set of commands, to create a composite agenda buffer.
+In this case, an entry looks like this:
+
+  (key desc (cmd1 cmd2 ...) general-options)
+
+where
+
+desc   A description string to be displayed in the dispatcher menu.
+cmd    An agenda command, similar to the above.  However, tree commands
+       are no allowed, but instead you can get agenda and global todo list.
+       So valid commands for a set are:
+       (agenda)
+       (alltodo)
+       (todo \"match\" options)
+       (tags \"match\" options )
+       (tags-todo \"match\" options)
+
+Each command can carry a list of options, and another set of options can be
+given for the whole set of commands.  Individual command options take
+precedence over the general options."
   :group 'org-agenda
   :type '(repeat
-         (list (string :tag "Key")
-               (choice :tag "Type"
-                       (const :tag "Tags search in all agenda files" tags)
-                       (const :tag "Tags search of TODO entries, all agenda files" tags-todo)
-                       (const :tag "TODO keyword search in all agenda files" todo)
-                       (const :tag "Tags sparse tree in current buffer" tags-tree)
-                       (const :tag "TODO keyword tree in current buffer" todo-tree)
-                       (const :tag "Occur tree in current buffer" occur-tree))
-               (string :tag "Match"))))
+         (choice
+          (list :tag "Single command"
+                (string :tag "Key")
+                (choice
+                 (const :tag "Tags search (all agenda files)" tags)
+                 (const :tag "Tags search of TODO entries (all agenda files)" tags-todo)
+                 (const :tag "TODO keyword search (all agenda files)" todo)
+                 (const :tag "Tags sparse tree (current buffer)" tags-tree)
+                 (const :tag "TODO keyword tree (current buffer)" todo-tree)
+                 (const :tag "Occur tree (current buffer)" occur-tree))
+                (string :tag "Match")
+                (repeat :tag "Local options"
+                        (list (variable :tag "Option") (sexp :tag "Value"))))
+          (list :tag "Command series, all agenda files"
+                (string :tag "Key")
+                (string :tag "Description")
+                (repeat
+                 (choice
+                  (const :tag "Agenda" (agenda))
+                  (const :tag "TODO list" (alltodo))
+                  (list :tag "Tags search"
+                        (const :format "" tags)
+                        (string :tag "Match")
+                        (repeat :tag "Local options"
+                                (list (variable :tag "Option")
+                                      (sexp :tag "Value"))))
+
+                  (list :tag "Tags search, TODO entries only"
+                        (const :format "" tags-todo)
+                        (string :tag "Match")
+                        (repeat :tag "Local options"
+                                (list (variable :tag "Option")
+                                      (sexp :tag "Value"))))
+
+                  (list :tag "TODO keyword search"
+                        (const :format "" todo)
+                        (string :tag "Match")
+                        (repeat :tag "Local options"
+                                (list (variable :tag "Option")
+                                      (sexp :tag "Value"))))))
+                (repeat :tag "General options"
+                        (list (variable :tag "Option")
+                              (sexp :tag "Value")))))))
 
 (defcustom org-agenda-todo-list-sublevels t
   "Non-nil means, check also the sublevels of a TODO entry for TODO entries.
@@ -1499,11 +1625,41 @@ of this item."
   :group 'org-todo
   :type 'boolean)
 
+(defcustom org-agenda-todo-ignore-deadlines nil
+  "Non-nil means, don't show near deadline entries in the global todo list.
+Near means closer than `org-deadline-warning-days' days.
+The idea behind this is that such items will appear in the agenda anyway."
+  :group 'org-agenda
+  :group 'org-todo
+  :type 'boolean)
+
+
+(defcustom org-timeline-show-empty-dates 3
+  "Non-nil means, `org-timeline' also shows dates without an entry.
+When nil, only the days which actually have entries are shown.
+When t, all days between the first and the last date are shown.
+When an integer, show also empty dates, but if there is a gap of more than
+N days, just insert a special line indicating the size of the gap."
+  :group 'org-agenda
+  :type '(choice
+         (const :tag "None" nil)
+         (const :tag "All" t)
+         (number :tag "at most")))
+
+(defcustom org-agenda-confirm-kill 1
+  "When set, remote killing from the agenda buffer needs confirmation.
+When t, a confirmation is always needed.  When a number N, confirmation is
+only needed when the text to be killed contains more than N non-white lines."
+  :group 'org-agenda ;; FIXME
+  :type '(choice
+         (const :tag "Never" nil)
+         (const :tag "Always" t)
+         (number :tag "When more than N lines")))
+
+;; FIXME: This variable could be removed
 (defcustom org-agenda-include-all-todo nil
-  "Non-nil means, the agenda will always contain all TODO entries.
-When nil, date-less entries will only be shown if `org-agenda' is called
-with a prefix argument.
-When non-nil, the TODO entries will be listed at the top of the agenda, before
+  "Set  means weekly/daily agenda will always contain all TODO entries.
+The TODO entries will be listed at the top of the agenda, before
 the entries for specific days."
   :group 'org-agenda
   :type 'boolean)
@@ -1526,26 +1682,63 @@ forth between agenda and calendar."
   :tag "Org Agenda Window Setup"
   :group 'org-agenda)
 
-(defcustom org-agenda-mouse-1-follows-link nil
-  "Non-nil means, mouse-1 on a link will follow the link in the agenda.
-A longer mouse click will still set point.  Does not wortk on XEmacs.
-Needs to be set before org.el is loaded."
+(defcustom org-agenda-window-setup 'reorganize-frame
+  "How the agenda buffer should be displayed.
+Possible values for this option are:
+
+current-window    Show agenda in the current window, keeping all other windows.
+other-frame       Use `switch-to-buffer-other-frame' to display agenda.
+other-window      Use `switch-to-buffer-other-window' to display agenda.
+reorganize-frame  Show only two windows on the current frame, the current
+                  window and the agenda.  Also, if the option
+                  `org-fit-agenda-window' is set, resize the agenda window to
+                  try to show as much as possible of the buffer content.
+See also the variable `org-agenda-restore-windows-after-quit'."
   :group 'org-agenda-setup
-  :type 'boolean)
-
-(defcustom org-agenda-start-with-follow-mode nil
-  "The initial value of follwo-mode in a newly created agenda window."
+  :type '(choice
+         (const current-window)
+         (const other-frame)
+         (const other-window)
+         (const reorganize-frame)))
+
+(defcustom org-agenda-restore-windows-after-quit nil
+  "Non-nil means, restore window configuration open exiting agenda.
+Before the window configuration is changed for displaying the agenda,
+the current status is recorded.  When the agenda is exited with
+`q' or `x' and this option is set, the old state is restored.  If
+`org-agenda-window-setup' is `other-frame', the value of this
+option will be ignored.."
   :group 'org-agenda-setup
   :type 'boolean)
 
+;; FIXME: I think this variable could be removed.
 (defcustom org-select-agenda-window t
   "Non-nil means, after creating an agenda, move cursor into Agenda window.
 When nil, cursor will remain in the current window."
   :group 'org-agenda-setup
   :type 'boolean)
 
+;; FIXME: I think this variable could be removed.
 (defcustom org-fit-agenda-window t
-  "Non-nil means, change window size of agenda to fit content."
+  "Non-nil means, change window size of agenda to fit content.
+This is only effective if `org-agenda-window-setup' is `reorganize-frame'."
+  :group 'org-agenda-setup
+  :type 'boolean)
+
+(defcustom org-finalize-agenda-hook nil
+  "Hook run just before displaying an agenda buffer."
+  :group 'org-agenda-setup
+  :type 'hook)
+
+(defcustom org-agenda-mouse-1-follows-link nil
+  "Non-nil means, mouse-1 on a link will follow the link in the agenda.
+A longer mouse click will still set point.  Does not wortk on XEmacs.
+Needs to be set before org.el is loaded."
+  :group 'org-agenda-setup
+  :type 'boolean)
+
+(defcustom org-agenda-start-with-follow-mode nil
+  "The initial value of follwo-mode in a newly created agenda window."
   :group 'org-agenda-setup
   :type 'boolean)
 
@@ -1596,7 +1789,7 @@ symbols specifying conditions when the grid should be displayed:
  daily         if the agenda shows a single day
  weekly        if the agenda shows an entire week
  today         show grid on current date, independent of daily/weekly display
- require-timed show grid only if at least on item has a time specification
+ require-timed show grid only if at least one item has a time specification
 
 The second item is a string which will be places behing the grid time.
 
@@ -1616,8 +1809,18 @@ a grid line."
     (string :tag "Grid String")
     (repeat :tag "Grid Times" (integer :tag "Time"))))
 
-(defcustom org-agenda-sorting-strategy '(time-up category-keep priority-down)
-  "Sorting structure for the agenda items of a single day.
+(let ((sorting-choice
+       '(choice
+        (const time-up) (const time-down)
+        (const category-keep) (const category-up) (const category-down)
+        (const tag-down) (const tag-up)
+        (const priority-up) (const priority-down))))
+
+  (defcustom org-agenda-sorting-strategy
+    '((agenda time-up category-keep priority-down)
+      (todo category-keep priority-down)
+      (tags category-keep))
+    "Sorting structure for the agenda items of a single day.
 This is a list of symbols which will be used in sequence to determine
 if an entry should be listed before another entry.  The following
 symbols are recognized:
@@ -1628,6 +1831,8 @@ category-keep   Keep the default order of categories, corresponding to the
                sequence in `org-agenda-files'.
 category-up     Sort alphabetically by category, A-Z.
 category-down   Sort alphabetically by category, Z-A.
+tag-up          Sort alphabetically by last tag, A-Z.
+tag-down        Sort alphabetically by last tag, Z-A.
 priority-up     Sort numerically by priority, high priority last.
 priority-down   Sort numerically by priority, high priority first.
 
@@ -1644,15 +1849,15 @@ priority.
 Leaving out `category-keep' would mean that items will be sorted across
 categories by priority."
   :group 'org-agenda-display
-  :type '(repeat
-         (choice
-          (const time-up)
-          (const time-down)
-          (const category-keep)
-          (const category-up)
-          (const category-down)
-          (const priority-up)
-          (const priority-down))))
+  :type `(choice
+         (repeat :tag "General" ,sorting-choice)
+         (list :tag "Individually"
+               (cons (const :tag "Strategy for Weekly/Daily agenda" agenda)
+                     (repeat ,sorting-choice))
+               (cons (const :tag "Strategy for TODO lists" todo)
+                     (repeat ,sorting-choice))
+               (cons (const :tag "Strategy for Tags matches" tags)
+                     (repeat ,sorting-choice))))))
 
 (defcustom org-sort-agenda-notime-is-late t
   "Non-nil means, items without time are considered late.
@@ -1664,19 +1869,26 @@ agenda entries."
   :group 'org-agenda-display
   :type 'boolean)
 
-
 (defgroup org-agenda-prefix nil
   "Options concerning the entry prefix in the Org-mode agenda display."
   :tag "Org Agenda Prefix"
   :group 'org-agenda)
 
-(defcustom org-agenda-prefix-format "  %-12:c%?-12t% s"
-  "Format specification for the prefix of items in the agenda buffer.
+(defcustom org-agenda-prefix-format
+  '((agenda  . "  %-12:c%?-12t% s")
+    (timeline  . "  % s")
+    (todo  . "  %-12:c")
+    (tags  . "  %-12:c"))
+  "Format specifications for the prefix of items in the agenda views.
+An alist with four entries, for the different agenda types.  The keys to the
+sublists are `agenda', `timeline', `todo', and `tags'.  The values
+are format strings.
 This format works similar to a printf format, with the following meaning:
 
   %c   the category of the item, \"Diary\" for entries from the diary, or
        as given by the CATEGORY keyword or derived from the file name.
-  %T   the first tag of the item.
+  %T   the *last* tag of the item.  Last because inherited tags come
+       first in the list.
   %t   the time-of-day specification if one applies to the entry, in the
        format HH:MM
   %s   Scheduling/Deadline information, a short string
@@ -1715,13 +1927,18 @@ the prefix, you could use:
 
 See also the variables `org-agenda-remove-times-when-in-prefix' and
 `org-agenda-remove-tags-when-in-prefix'."
-  :type 'string
+  :type '(choice
+         (string :tag "General format")
+         (list :greedy t :tag "View dependent"
+               (cons  (const agenda) (string :tag "Format"))
+               (cons  (const timeline) (string :tag "Format"))
+               (cons  (const todo) (string :tag "Format"))
+               (cons  (const tags) (string :tag "Format"))))
   :group 'org-agenda-prefix)
 
 (defvar org-prefix-format-compiled nil
   "The compiled version of the most recently used prefix format.
-Depending on which command was used last, this may be the compiled version
-of `org-agenda-prefix-format' or `org-timeline-prefix-format'.")
+See the variable `org-agenda-prefix-format'.")
 
 (defcustom org-agenda-remove-times-when-in-prefix t
   "Non-nil means, remove duplicate time specifications in agenda items.
@@ -1750,33 +1967,10 @@ When this is the symbol `prefix', only remove tags when
          (const :tag "Never" nil)
          (const :tag "When prefix format contains %T" prefix)))
 
-(defgroup org-agenda-timeline nil
-  "Options concerning the timeline buffer in Org Mode."
-  :tag "Org Agenda Timeline"
-  :group 'org-agenda)
-
-(defcustom org-timeline-prefix-format "  % s"
-  "Like `org-agenda-prefix-format', but for the timeline of a single file."
-  :type 'string
-  :group 'org-agenda-timeline)
-
-(defcustom org-select-timeline-window t
-  "Non-nil means, after creating a timeline, move cursor into Timeline window.
-When nil, cursor will remain in the current window."
-  :group 'org-agenda-timeline
-  :type 'boolean)
-
-(defcustom org-timeline-show-empty-dates 3
-  "Non-nil means, `org-timeline' also shows dates without an entry.
-When nil, only the days which actually have entries are shown.
-When t, all days between the first and the last date are shown.
-When an integer, show also empty dates, but if there is a gap of more than
-N days, just insert a special line indicating the size of the gap."
-  :group 'org-agenda-timeline
-  :type '(choice
-         (const :tag "None" nil)
-         (const :tag "All" t)
-         (number :tag "at most")))
+(defcustom org-agenda-align-tags-to-column 65
+  "Shift tags in agenda items to this column."
+  :group 'org-agenda-prefix
+  :type 'integer)
 
 (defgroup org-latex nil
   "Options for embedding LaTeX code into Org-mode"
@@ -1914,24 +2108,24 @@ headline  Only export the headline, but skip the tree below it."
          (const :tag "entirely" t)))
 
 (defcustom org-export-with-timestamps t
-  "Nil means, do not export time stamps and associated keywords."
-  :group 'org-export
+  "If nil, do not export time stamps and associated keywords."
+  :group 'org-export-general
   :type 'boolean)
 
 (defcustom org-export-remove-timestamps-from-toc t
-  "Nil means, remove timestamps from the table of contents entries."
-  :group 'org-export
-  :type 'boolean)
-
-(defcustom org-export-with-tags t
-  "Nil means, do not export tags, just remove them from headlines."
+  "If nil, remove timestamps from the table of contents entries."
   :group 'org-export-general
   :type 'boolean)
 
-(defcustom org-export-with-timestamps t
-  "Nil means, do not export timestamps and associated keywords."
+(defcustom org-export-with-tags 'not-in-toc
+  "If nil, do not export tags, just remove them from headlines.
+If this is the symbol `not-in-toc', tags will be removed from table of
+contents entries, but still be shown in the headlines of the document."
   :group 'org-export-general
-  :type 'boolean)
+  :type '(choice
+         (const :tag "Off" nil)
+         (const :tag "Not in TOC" not-in-toc)
+         (const :tag "On" t)))
 
 (defgroup org-export-translation nil
   "Options for translating special ascii sequences for the export backends."
@@ -2308,7 +2502,11 @@ Changing this variable requires a restart of Emacs to take effect."
          (setq markers (concat (replace-match "" t t markers) "^")))
       (if (string-match "-" markers)
          (setq markers (concat (replace-match "" t t markers) "-")))
-      (while (>= (setq nl (1- nl)) 0) (setq body1 (concat body1 "\n?" body "*?")))
+;      (while (>= (setq nl (1- nl)) 0) (setq body1 (concat body1 "\n?" body "*?")))
+;      (while (>= (setq nl (1- nl)) 0) (setq body1 (concat body1 "\\(?:\n?" body "*?\\)?")))
+      (if (> nl 0)
+          (setq body1 (concat body1 "\\(?:\n" body "*?\\)\\{0,"
+                              (int-to-string nl) "\\}")))
       ;; Make the regexp
       (setq org-emph-re
            (concat "\\([" pre (if stacked markers) "]\\|^\\)"
@@ -2323,7 +2521,7 @@ Changing this variable requires a restart of Emacs to take effect."
                    "\\([" post (if stacked markers) "]\\|$\\)")))))
 
 (defcustom org-emphasis-regexp-components
-  '(" \t(" " \t.,?;:'\")" " \t\r\n,." "." 1 nil)
+  '(" \t(" " \t.,?;'\")" " \t\r\n," "." 1 nil)
   "Components used to build the reqular expression for emphasis.
 This is a list with 6 entries.  Terminology:  In an emphasis string
 like \" *strong word* \", we call the initial space PREMATCH, the final
@@ -2342,7 +2540,7 @@ stacked      Non-nil means, allow stacked styles.  This works only in HTML
              export.  When this is set, all marker characters (as given in
              `org-emphasis-alist') will be allowed as pre/post, aiding
              inside-out matching.
-Use customize to modify this, or restart emacs after changing it."
+Use customize to modify this, or restart Emacs after changing it."
   :group 'org-font-lock
   :set 'org-set-emph-re
   :type '(list
@@ -2360,12 +2558,12 @@ Use customize to modify this, or restart emacs after changing it."
     ("=" shadow "<code>" "</code>")
     ("+" (:strike-through t) "<del>" "</del>")
 )
-"Special syntax for emphasised text.
+"Special syntax for emphasized text.
 Text starting and ending with a special character will be emphasized, for
 example *bold*, _underlined_ and /italic/.  This variable sets the marker
 characters, the face to bbe used by font-lock for highlighting in Org-mode
-emacs buffers, and the HTML tags to be used for this.
-Use customize to modify this, or restart emacs after changing it."
+Emacs buffers, and the HTML tags to be used for this.
+Use customize to modify this, or restart Emacs after changing it."
   :group 'org-font-lock
   :set 'org-set-emph-re
   :type '(repeat
@@ -2559,8 +2757,8 @@ This face is only used if `org-fontify-done-headline' is set."
 
 (defface org-done ;; font-lock-type-face
   (org-compatible-face
-   '((((class color) (min-colors 16) (background light)) (:foreground "ForestGreen"))
-     (((class color) (min-colors 16) (background dark)) (:foreground "PaleGreen"))
+   '((((class color) (min-colors 16) (background light)) (:foreground "ForestGreen" :bold t))
+     (((class color) (min-colors 16) (background dark)) (:foreground "PaleGreen" :bold t))
      (((class color) (min-colors 8)) (:foreground "green"))
      (t (:bold t))))
   "Face used for DONE."
@@ -2690,7 +2888,7 @@ Also put tags into group 4 if tags are present.")
 (make-variable-buffer-local 'org-keyword-time-regexp)
 
 (defconst org-rm-props '(invisible t face t keymap t intangible t mouse-face t
-                                   rear-nonsticky t mouse-map t)
+                                  rear-nonsticky t mouse-map t)
   "Properties to remove when a string without properties is wanted.")
 
 (defsubst org-match-string-no-properties (num &optional string)
@@ -2704,6 +2902,12 @@ Also put tags into group 4 if tags are present.")
   (remove-text-properties 0 (length s) org-rm-props s)
   s)
 
+(defsubst org-get-alist-option (option key)
+  (cond ((eq key t) t)
+       ((eq option t) t)
+       ((assoc key option) (cdr (assoc key option)))
+       (t (cdr (assq 'default option)))))
+
 (defsubst org-set-local (var value)
   "Make VAR local in current buffer and set it to VALUE."
   (set (make-variable-buffer-local var) value))
@@ -2712,14 +2916,44 @@ Also put tags into group 4 if tags are present.")
   "Check if the current buffer is in Org-mode."
   (eq major-mode 'org-mode))
 
+(defsubst org-last (list)
+  "Return the last element of LIST."
+  (car (last list)))
+
+(defun org-let (list &rest body)
+  (eval (cons 'let (cons list body))))
+(put 'org-let 'lisp-indent-function 1)
+
+(defun org-let2 (list1 list2 &rest body)
+  (eval (cons 'let (cons list1 (list (cons 'let (cons list2 body)))))))
+(put 'org-let2 'lisp-indent-function 2)
+
+(defconst org-startup-options
+  '(("fold" org-startup-folded t)
+    ("overview" org-startup-folded t)
+    ("nofold" org-startup-folded nil)
+    ("showall" org-startup-folded nil)
+    ("content" org-startup-folded content)
+    ("hidestars" org-hide-leading-stars t)
+    ("showstars" org-hide-leading-stars nil)
+    ("odd" org-odd-levels-only t)
+    ("oddeven" org-odd-levels-only nil)
+    ("align" org-startup-align-all-tables t)
+    ("noalign" org-startup-align-all-tables nil)
+    ("customtime" org-display-custom-times t)
+    ("logging" org-log-done t)
+    ("nologging" org-log-done nil)
+    ("dlcheck" org-startup-with-deadline-check t)
+    ("nodlcheck" org-startup-with-deadline-check nil)))
+
 (defun org-set-regexps-and-options ()
   "Precompute regular expressions for current buffer."
   (when (org-mode-p)
     (let ((re (org-make-options-regexp
               '("CATEGORY" "SEQ_TODO" "PRI_TODO" "TYP_TODO"
-                "STARTUP" "ARCHIVE" "TAGS" "CALC")))
+                "STARTUP" "ARCHIVE" "TAGS" "LINK")))
          (splitre "[ \t]+")
-         kwds int key value cat arch tags)
+         kwds int key value cat arch tags links)
       (save-excursion
        (save-restriction
          (widen)
@@ -2742,25 +2976,15 @@ Also put tags into group 4 if tags are present.")
                    kwds (append kwds (org-split-string value splitre))))
             ((equal key "TAGS")
              (setq tags (append tags (org-split-string value splitre))))
+            ((equal key "LINK")
+             (when (string-match "^\\(\\S-+\\)[ \t]+\\(.+\\)" value)
+               (push (cons (match-string 1 value)
+                           (org-trim (match-string 2 value)))
+                     links)))
             ((equal key "STARTUP")
              (let ((opts (org-split-string value splitre))
-                   (set '(("fold" org-startup-folded t)
-                          ("overview" org-startup-folded t)
-                          ("nofold" org-startup-folded nil)
-                          ("showall" org-startup-folded nil)
-                          ("content" org-startup-folded content)
-                          ("hidestars" org-hide-leading-stars t)
-                          ("showstars" org-hide-leading-stars nil)
-                          ("odd" org-odd-levels-only t)
-                          ("oddeven" org-odd-levels-only nil)
-                          ("align" org-startup-align-all-tables t)
-                          ("noalign" org-startup-align-all-tables nil)
-                          ("logging" org-log-done t)
-                          ("nologging" org-log-done nil)
-                          ("dlcheck" org-startup-with-deadline-check t)
-                          ("nodlcheck" org-startup-with-deadline-check nil)))
                    l var val)
-               (while (setq l (assoc (pop opts) set))
+               (while (setq l (assoc (pop opts) org-startup-options))
                  (setq var (nth 1 l) val (nth 2 l))
                  (set (make-local-variable var) val))))
             ((equal key "ARCHIVE")
@@ -2773,6 +2997,7 @@ Also put tags into group 4 if tags are present.")
       (and kwds (org-set-local 'org-todo-keywords kwds))
       (and arch (org-set-local 'org-archive-location arch))
       (and int (org-set-local 'org-todo-interpretation int))
+      (and links (setq org-link-abbrev-alist-local (nreverse links)))
       (when tags
        (let (e tgs)
          (while (setq e (pop tags))
@@ -2807,15 +3032,15 @@ Also put tags into group 4 if tags are present.")
                             "\\|")
                  "\\)\\>")
          org-todo-line-regexp
-         (concat "^\\(\\*+\\)[ \t]*\\("
+         (concat "^\\(\\*+\\)[ \t]*\\(?:\\("
                  (mapconcat 'regexp-quote org-todo-keywords "\\|")
-                 "\\)? *\\(.*\\)")
+                 "\\)\\>\\)? *\\(.*\\)")
          org-nl-done-regexp
          (concat "[\r\n]\\*+[ \t]+" org-done-string "\\>")
          org-todo-line-tags-regexp
-         (concat "^\\(\\*+\\)[ \t]*\\("
+         (concat "^\\(\\*+\\)[ \t]*\\(?:\\("
                  (mapconcat 'regexp-quote org-todo-keywords "\\|")
-                 "\\)? *\\(.*?\\([ \t]:[a-zA-Z0-9:_@]+:[ \t]*\\)?$\\)")
+                 "\\)\\>\\)? *\\(.*?\\([ \t]:[a-zA-Z0-9:_@]+:[ \t]*\\)?$\\)")
          org-looking-at-done-regexp (concat "^" org-done-string "\\>")
          org-deadline-regexp (concat "\\<" org-deadline-string)
          org-deadline-time-regexp
@@ -2871,6 +3096,7 @@ Also put tags into group 4 if tags are present.")
 (defvar include-all-loc) ; local variable
 (defvar vm-message-pointer) ; from vm
 (defvar vm-folder-directory) ; from vm
+(defvar gnus-other-frame-object) ; from gnus
 (defvar wl-summary-buffer-elmo-folder) ; from wanderlust
 (defvar wl-summary-buffer-folder-name) ; from wanderlust
 (defvar gnus-group-name) ; from gnus
@@ -2894,14 +3120,14 @@ Also put tags into group 4 if tags are present.")
 (defvar Info-current-node) ; from info.el
 (defvar texmathp-why) ; from texmathp.el
 (defvar org-latex-regexps)
+(defvar outline-mode-menu-heading)
+(defvar outline-mode-menu-show)
+(defvar outline-mode-menu-hide)
 
 ;;; Define the mode
 
-(defvar org-mode-map
-  (if (and (not (keymapp outline-mode-map)) (featurep 'allout))
-      (error "Conflict with outdated version of allout.el.  Load org.el before allout.el, or ugrade to newer allout, for example by switching to Emacs 22.")
-    (copy-keymap outline-mode-map))
-  "Keymap for Org-mode.")
+(if (and (not (keymapp outline-mode-map)) (featurep 'allout))
+    (error "Conflict with outdated version of allout.el.  Load org.el before allout.el, or ugrade to newer allout, for example by switching to Emacs 22."))
 
 (defvar org-struct-menu) ; defined later in this file
 (defvar org-org-menu) ; defined later in this file
@@ -2913,6 +3139,7 @@ Also put tags into group 4 if tags are present.")
   "Indicates that a table might need an update.
 This variable is set by `org-before-change-function'.
 `org-table-align' sets it back to nil.")
+(defvar org-mode-map)
 (defvar org-mode-hook nil)
 (defvar org-inhibit-startup nil)        ; Dynamically-scoped param.
 (defvar org-agenda-keep-modes nil)      ; Dynamically-scoped param.
@@ -2940,9 +3167,10 @@ The following commands are available:
 
   ;; Get rid of Outline menus, they are not needed
   ;; Need to do this here because define-derived-mode sets up
-  ;; the keymap so late.
+  ;; the keymap so late.  Still, it is a waste to call this each time
+  ;; we switch another buffer into org-mode.
   (if (featurep 'xemacs)
-      (progn
+      (when (boundp 'outline-mode-menu-heading)
        ;; Assume this is Greg's port, it used easymenu
        (easy-menu-remove outline-mode-menu-heading)
        (easy-menu-remove outline-mode-menu-show)
@@ -3008,7 +3236,9 @@ The following commands are available:
   (let ((current-prefix-arg arg)) (call-interactively command)))
 
 (defsubst org-current-line (&optional pos)
-  (+ (if (bolp) 1 0) (count-lines (point-min) (or pos (point)))))
+  (save-excursion
+    (and pos (goto-char pos))
+    (+ (if (bolp) 1 0) (count-lines (point-min) (point)))))
 
 (defun org-current-time ()
   "Current time, possibly rounded to `org-time-stamp-rounding-minutes'."
@@ -3098,7 +3328,6 @@ that will be added to PLIST.  Returns the string that was modified."
 ; 4: [desc]
 ; 5: desc
 
-
 (defconst org-ts-lengths
   (cons (length (format-time-string (car org-time-stamp-formats)))
        (length (format-time-string (cdr org-time-stamp-formats))))
@@ -3115,11 +3344,18 @@ that will be added to PLIST.  Returns the string that was modified."
   "Regular expression matching time stamps (also [..]), with groups.")
 (defconst org-tr-regexp (concat org-ts-regexp "--?-?" org-ts-regexp)
   "Regular expression matching a time stamp range.")
+(defconst org-tr-regexp-both
+  (concat org-ts-regexp-both "--?-?" org-ts-regexp-both)
+  "Regular expression matching a time stamp range.")
 (defconst org-tsr-regexp (concat org-ts-regexp "\\(--?-?"
                                 org-ts-regexp "\\)?")
   "Regular expression matching a time stamp or time stamp range.")
+(defconst org-tsr-regexp-both (concat org-ts-regexp-both "\\(--?-?"
+                                     org-ts-regexp-both "\\)?")
+  "Regular expression matching a time stamp or time stamp range.
+The time stamps may be either active or inactive.")
 
-(defvar org-\81§emph-face nil)
+(defvar org-emph-face nil)
 
 (defun org-do-emphasis-faces (limit)
   "Run through the buffer and add overlays to links."
@@ -3156,6 +3392,18 @@ that will be added to PLIST.  Returns the string that was modified."
                                   ))
        t)))
 
+(defmacro org-maybe-intangible (props)
+  "Add '(intangigble t) to PROPS if Emacs version is earlier than Emacs 22.
+In emacs 21, invisible text is not avoided by the command loop, so the
+intangible property is needed to make sure point skips this text.
+In Emacs 22, this is not necessary.  The intangible text property has
+led to problems with flyspell.  These problems are fixed in flyspell.el,
+but we still avoid setting the property in Emacs 22 and later.
+We use a macro so that the test can happen at compilation time."
+  (if (< emacs-major-version 22)
+      `(append '(intangible t) ,props)
+    props))
+
 (defun org-activate-bracket-links (limit)
   "Run through the buffer and add overlays to bracketed links."
   (if (re-search-forward org-bracket-link-regexp limit t)
@@ -3164,9 +3412,10 @@ that will be added to PLIST.  Returns the string that was modified."
             ;; FIXME: above we should remove the escapes.
             ;; but that requires another match, protecting match data,
             ;; a lot of overhead for font-lock.
-            (ip (list 'invisible 'org-link 'intangible t 'rear-nonsticky t
-                      'keymap org-mouse-map 'mouse-face 'highlight
-                      'help-echo help))
+            (ip (org-maybe-intangible
+                 (list 'invisible 'org-link 'rear-nonsticky t
+                       'keymap org-mouse-map 'mouse-face 'highlight
+                       'help-echo help)))
             (vp (list 'rear-nonsticky t
                       'keymap org-mouse-map 'mouse-face 'highlight
                       'help-echo help)))
@@ -3186,12 +3435,20 @@ that will be added to PLIST.  Returns the string that was modified."
 
 (defun org-activate-dates (limit)
   "Run through the buffer and add overlays to dates."
-  (if (re-search-forward org-tsr-regexp limit t)
+;  (if (re-search-forward org-tsr-regexp limit t)
+;  (if (re-search-forward
+;       (if org-display-custom-times org-ts-regexp-both org-tsr-regexp-both)
+;       limit t)
+  (if (re-search-forward org-tsr-regexp-both limit t)
       (progn
        (add-text-properties (match-beginning 0) (match-end 0)
                             (list 'mouse-face 'highlight
                                   'rear-nonsticky t
                                   'keymap org-mouse-map))
+       (when org-display-custom-times
+         (if (match-end 3)
+             (org-display-custom-time (match-beginning 3) (match-end 3)))
+         (org-display-custom-time (match-beginning 1) (match-end 1)))
        t)))
 
 (defvar org-target-link-regexp nil
@@ -3229,7 +3486,7 @@ that will be added to PLIST.  Returns the string that was modified."
                               'org-cwidth t))
     (when s
       (setq e (next-single-property-change s 'org-cwidth))
-      (add-text-properties s e '(invisible org-cwidth intangible t))
+      (add-text-properties s e (org-maybe-intangible '(invisible org-cwidth)))
       (goto-char e)
       t)))
 
@@ -3333,10 +3590,16 @@ between words."
           (list (concat "\\<" org-closed-string) '(0 'org-special-keyword t))
           (list (concat "\\<" org-clock-string) '(0 'org-special-keyword t))
           ;; Emphasis
-          (if em '(org-do-emphasis-faces))
+          (if em
+               (if (featurep 'xemacs)
+                   '(org-do-emphasis-faces (0 nil append))
+                 '(org-do-emphasis-faces)))
           ;; Checkboxes, similar to Frank Ruell's org-checklet.el
           '("^[ \t]*\\([-+*]\\|[0-9]+[.)]\\) +\\(\\[[ X]\\]\\)"
             2 'bold prepend)
+          (if org-provide-checkbox-statistics
+              '("\\[\\([0-9]*%\\)\\]\\|\\[\\([0-9]*\\)/\\([0-9]*\\)\\]"
+                (0 (org-get-checkbox-statistics-face) t)))
           ;; COMMENT
           (list (concat "^\\*+[ \t]*\\<\\(" org-comment-string
                         "\\|" org-quote-string "\\)\\>")
@@ -3385,9 +3648,10 @@ between words."
         (inhibit-modification-hooks t)
         deactivate-mark buffer-file-name buffer-file-truename)
     (remove-text-properties beg end
-                           '(mouse-face nil keymap nil org-linked-text nil
-                                        rear-nonsticky nil
-                                        invisible nil intangible nil))))
+                           '(mouse-face t keymap t org-linked-text t
+                                        rear-nonsticky t
+                                        invisible t intangible t))))
+
 ;;; Visibility cycling
 
 (defvar org-cycle-global-status nil)
@@ -3424,10 +3688,9 @@ between words."
 - Special case: if point is the the beginning of the buffer and there is
   no headline in line 1, this function will act as if called with prefix arg."
   (interactive "P")
-
   (let* ((outline-regexp
-         (if org-cycle-include-plain-lists
-             "\\*+\\|\\([ \t]*\\)\\([-+*]\\|[0-9]+[.)]\\) "
+         (if (and (org-mode-p) org-cycle-include-plain-lists)
+             "\\(?:\\*+\\|\\([ \t]*\\)\\([-+*]\\|[0-9]+[.)]\\) \\)"
            outline-regexp))
         (bob-special (and org-cycle-global-at-bob (bobp)
                           (not (looking-at outline-regexp))))
@@ -3453,7 +3716,7 @@ between words."
              (call-interactively 'org-table-next-field)))))
 
      ((eq arg t) ;; Global cycling
-      
+
       (cond
        ((and (eq last-command this-command)
             (eq org-cycle-global-status 'overview))
@@ -3559,12 +3822,14 @@ between words."
 (defun org-global-cycle (&optional arg)
   "Cycle the global visibility.  For details see `org-cycle'."
   (interactive "P")
-  (if (integerp arg)
-      (progn
-       (show-all)
-       (hide-sublevels arg)
-       (setq org-cycle-global-status 'contents))
-    (org-cycle '(4))))
+  (let ((org-cycle-include-plain-lists
+        (if (org-mode-p) org-cycle-include-plain-lists nil)))
+    (if (integerp arg)
+       (progn
+         (show-all)
+         (hide-sublevels arg)
+         (setq org-cycle-global-status 'contents))
+      (org-cycle '(4)))))
 
 (defun org-overview ()
   "Switch to overview mode, shoing only top-level headlines.
@@ -3677,7 +3942,7 @@ to the new location, making it and the headline hierarchy above it visible."
          (org-mark-ring-push org-goto-start-pos)
          (goto-char selected-point)
          (if (or (org-invisible-p) (org-invisible-p2))
-             (org-show-hierarchy-above)))
+             (org-show-context 'org-goto)))
       (error "Quit"))))
 
 (defun org-get-location (buf help)
@@ -3776,21 +4041,33 @@ the current headline."
                           (org-back-to-heading)
                           (match-string 0))
                       (error "*"))))
+            (blank (cdr (assq 'heading org-blank-before-new-entry)))
             pos)
        (cond
         ((and (org-on-heading-p) (bolp)
               (save-excursion (backward-char 1) (not (org-invisible-p))))
-         (open-line 1))
+         (open-line (if blank 2 1)))
         ((and (bolp) (save-excursion
                        (backward-char 1) (not (org-invisible-p))))
          nil)
-        (t (newline)))
+        (t (newline (if blank 2 1))))
        (insert head) (just-one-space)
        (setq pos (point))
        (end-of-line 1)
        (unless (= (point) pos) (just-one-space) (backward-delete-char 1))
        (run-hooks 'org-insert-heading-hook)))))
 
+(defun org-in-item-p ()
+  "It the cursor inside a plain list item.
+Does not have to be the first line."
+  (save-excursion
+    (condition-case nil
+       (progn
+         (org-beginning-of-item)
+         (org-at-item-p)
+         t)
+      (error nil))))
+
 (defun org-insert-item (&optional checkbox)
   "Insert a new item at the current level.
 Return t when things worked, nil when we are not in an item."
@@ -3799,26 +4076,29 @@ Return t when things worked, nil when we are not in an item."
              (progn
                (org-beginning-of-item)
                (org-at-item-p)
+               (if (org-invisible-p) (error "Invisible item"))
                t)
            (error nil)))
     (let* ((bul (match-string 0))
           (eow (save-excursion (beginning-of-line 1) (looking-at "[ \t]*")
                                (match-end 0)))
+          (blank (cdr (assq 'plain-list-item org-blank-before-new-entry)))
           pos)
       (cond
        ((and (org-at-item-p) (<= (point) eow))
        ;; before the bullet
        (beginning-of-line 1)
-       (open-line 1))
+       (open-line (if blank 2 1)))
        ((<= (point) eow)
        (beginning-of-line 1))
-       (t (newline)))
+       (t (newline (if blank 2 1))))
       (insert bul (if checkbox "[ ]" ""))
       (just-one-space)
       (setq pos (point))
       (end-of-line 1)
       (unless (= (point) pos) (just-one-space) (backward-delete-char 1)))
     (org-maybe-renumber-ordered-list)
+    (and checkbox (org-update-checkbox-count-maybe))
     t))
 
 (defun org-insert-todo-heading (arg)
@@ -3843,14 +4123,17 @@ state (TODO by default).  Also with prefix arg, force first state."
 See also `org-promote'."
   (interactive)
   (save-excursion
-    (org-map-tree 'org-promote)))
+    (org-map-tree 'org-promote))
+  (org-fix-position-after-promote))
 
 (defun org-demote-subtree ()
   "Demote the entire subtree.  See `org-demote'.
 See also `org-promote'."
   (interactive)
   (save-excursion
-    (org-map-tree 'org-demote)))
+    (org-map-tree 'org-demote))
+  (org-fix-position-after-promote))
+
 
 (defun org-do-promote ()
   "Promote the current heading higher up the tree.
@@ -3876,17 +4159,22 @@ in the region."
 
 (defun org-fix-position-after-promote ()
   "Make sure that after pro/demotion cursor position is right."
+  (if (and (equal (char-after) ?\n)
+          (save-excursion
+            (skip-chars-backward "a-zA-Z0-9_@")
+            (looking-at org-todo-regexp)))
+      (insert " "))
   (and (equal (char-after) ?\ )
        (equal (char-before) ?*)
        (forward-char 1)))
 
-(defun org-get-legal-level (level change)
+(defun org-get-legal-level (level &optional change)
   "Rectify a level change under the influence of `org-odd-levels-only'
 LEVEL is a current level, CHANGE is by how much the level should be
 modified.  Even if CHANGE is nil, LEVEL may be returned modified because
 even level numbers will become the next higher odd number."
   (if org-odd-levels-only
-      (cond ((not change) (1+ (* 2 (/ level 2))))
+      (cond ((or (not change) (= 0 change)) (1+ (* 2 (/ level 2))))
            ((> change 0) (1+ (* 2 (/ (+ level (* 2 change)) 2))))
            ((< change 0) (max 1 (1+ (* 2 (/ (+ level (* 2 change)) 2))))))
     (max 1 (+ level change))))
@@ -3899,7 +4187,7 @@ in the region."
   (let* ((level (save-match-data (funcall outline-level)))
         (up-head (make-string (org-get-legal-level level -1) ?*))
         (diff (abs (- level (length up-head)))))
-    (if (= level 1) (error "Cannot promote to level 0. UNDO to recover"))
+    (if (= level 1) (error "Cannot promote to level 0. UNDO to recover if necessary"))
     (replace-match up-head nil t)
     ;; Fixup tag positioning
     (and org-auto-align-tags (org-set-tags nil t))
@@ -3953,7 +4241,7 @@ would end up with no indentation after the change, nothing at all is done."
     (let ((end (save-excursion (outline-next-heading)
                               (point-marker)))
          (prohibit (if (> diff 0)
-                       "^\\S-" 
+                       "^\\S-"
                      (concat "^ \\{0," (int-to-string (- diff)) "\\}\\S-")))
          col)
       (unless (save-excursion (re-search-forward prohibit end t))
@@ -4029,7 +4317,7 @@ This is a short-hand for marking the subtree and then cutting it."
 (defun org-copy-subtree (&optional cut)
   "Cut the current subtree into the clipboard.
 This is a short-hand for marking the subtree and then copying it.
-If CUT is non nil, actually cut the subtree."
+If CUT is non-nil, actually cut the subtree."
   (interactive)
   (let (beg end folded)
     (org-back-to-heading)
@@ -4217,9 +4505,70 @@ If optional TXT is given, check this string instead of the current kill."
            (setq status (equal (match-string 0) "[X]"))
            (when (eq firstnew 'unknown)
              (setq firstnew (not status)))
-           (replace-match 
+           (replace-match
             (if (if arg (not status) firstnew) "[X]" "[ ]") t t))
-         (beginning-of-line 2))))))
+         (beginning-of-line 2)))))
+  (org-update-checkbox-count-maybe))
+
+(defun org-update-checkbox-count-maybe ()
+  "Update checkbox statistics unless turned off by user."
+  (when org-provide-checkbox-statistics
+    (org-update-checkbox-count)))
+
+(defun org-update-checkbox-count (&optional all)
+  "Update the checkbox statistics in the current section.
+This will find all statistic cookies like [57%] and [6/12] and update them
+with the current numbers.  With optional prefix argument ALL, do this for
+the whole buffer."
+  (interactive "P")
+  (save-excursion
+    (let* ((buffer-invisibility-spec nil) ; Emacs 21 compatibility
+          (beg (progn (outline-back-to-heading) (point)))
+          (end (move-marker (make-marker)
+                            (progn (outline-next-heading) (point))))
+          (re "\\(\\[[0-9]*%\\]\\)\\|\\(\\[[0-9]*/[0-9]*\\]\\)")
+          (re-box "^[ \t]*\\([-+*]\\|[0-9]+[.)]\\) +\\(\\[[ X]\\]\\)")
+          b1 e1 f1 c-on c-off lim (cstat 0))
+      (when all
+       (goto-char (point-min))
+       (outline-next-heading)
+       (setq beg (point) end (point-max)))
+      (goto-char beg)
+      (while (re-search-forward re end t)
+       (setq cstat (1+ cstat)
+             b1 (match-beginning 0)
+             e1 (match-end 0)
+             f1 (match-beginning 1)
+             lim (cond
+                  ((org-on-heading-p) (outline-next-heading) (point))
+                  ((org-at-item-p) (org-end-of-item) (point))
+                  (t nil))
+             c-on 0 c-off 0)
+       (goto-char e1)
+       (when lim
+         (while (re-search-forward re-box lim t)
+           (if (equal (match-string 2) "[ ]")
+               (setq c-off (1+ c-off))
+             (setq c-on (1+ c-on))))
+         (delete-region b1 e1)
+         (goto-char b1)
+         (insert (if f1
+                     (format "[%d%%]" (/ (* 100 c-on) (max 1 (+ c-on c-off))))
+                   (format "[%d/%d]" c-on (+ c-on c-off))))))
+      (when (interactive-p)
+       (message "Checkbox satistics updated %s (%d places)"
+                (if all "in entire file" "in current outline entry") cstat)))))
+
+(defun org-get-checkbox-statistics-face ()
+  "Select the face for checkbox statistics.
+The face will be `org-done' when all relevant boxes are checked.  Otherwise
+it will be `org-todo'."
+  (if (match-end 1)
+      (if (equal (match-string 1) "100%") 'org-done 'org-todo)
+    (if (and (> (match-end 2) (match-beginning 2))
+            (equal (match-string 2) (match-string 3)))
+       'org-done
+      'org-todo)))
 
 (defun org-get-indentation (&optional line)
   "Get the indentation of the current line, interpreting tabs.
@@ -4513,7 +4862,7 @@ this heading. "
   (if find-done
       (org-archive-all-done)
     ;; Save all relevant TODO keyword-relatex variables
-    
+
     (let ((tr-org-todo-line-regexp org-todo-line-regexp) ; keep despite compiler
          (tr-org-todo-keywords org-todo-keywords)
          (tr-org-todo-interpretation org-todo-interpretation)
@@ -4591,9 +4940,7 @@ this heading. "
            (beginning-of-line 1)
            (looking-at org-todo-line-regexp)
            (goto-char (or (match-end 2) (match-beginning 3)))
-           (insert "(" (format-time-string (cdr org-time-stamp-formats)
-                                           (org-current-time))
-                   ")"))
+           (org-insert-time-stamp (org-current-time) t t "(" ")"))
          ;; Save the buffer, if it is not the same buffer.
          (if (not (eq this-buffer buffer)) (save-buffer))))
       ;; Here we are back in the original buffer.  Everything seems to have
@@ -4620,12 +4967,12 @@ When TAG is non-nil, don't move trees, but mark them with the ARCHIVE tag."
     (if (org-on-heading-p)
        (progn
          (setq re1 (concat "^" (regexp-quote
-                                (make-string 
+                                (make-string
                                  (1+ (- (match-end 0) (match-beginning 0)))
                                  ?*))
                            " "))
          (move-marker begm (point))
-         (move-marker endm (org-end-of-subtree)))
+         (move-marker endm (org-end-of-subtree t)))
       (setq re1 "^* ")
       (move-marker begm (point-min))
       (move-marker endm (point-max)))
@@ -4655,8 +5002,19 @@ When TAG is non-nil, don't move trees, but mark them with the ARCHIVE tag."
     (save-excursion
       (let* ((globalp (memq state '(contents all)))
              (beg (if globalp (point-min) (point)))
-             (end (if globalp (point-max) (org-end-of-subtree))))
-       (org-hide-archived-subtrees beg end)))))
+             (end (if globalp (point-max) (org-end-of-subtree t))))
+       (org-hide-archived-subtrees beg end)
+       (goto-char beg)
+       (if (looking-at (concat ".*:" org-archive-tag ":"))
+           (message (substitute-command-keys
+                     "Subtree is archived and stays closed.  Use \\[org-force-cycle-archived] to cycle it anyway.")))))))
+
+(defun org-force-cycle-archived ()
+  "Cycle subtree even if it is archived."
+  (interactive)
+  (setq this-command 'org-cycle)
+  (let ((org-cycle-open-archived-trees t))
+    (call-interactively 'org-cycle)))
 
 (defun org-hide-archived-subtrees (beg end)
   "Re-hide all archived subtrees after a visibility state change."
@@ -4665,7 +5023,7 @@ When TAG is non-nil, don't move trees, but mark them with the ARCHIVE tag."
       (goto-char beg)
       (while (re-search-forward re end t)
        (and (org-on-heading-p) (hide-subtree))
-       (org-end-of-subtree)))))
+       (org-end-of-subtree t)))))
 
 (defun org-toggle-tag (tag &optional onoff)
   "Toggle the tag TAG for the current line.
@@ -4712,6 +5070,51 @@ the children that do not contain any open TODO items."
       (and set (beginning-of-line 1))
       (message "Subtree %s" (if set "archived" "unarchived")))))
 
+(defvar org-agenda-multi nil)  ; dynammically scoped
+(defvar org-agenda-buffer-name "*Org Agenda*")
+(defvar org-pre-agenda-window-conf nil)
+(defun org-prepare-agenda ()
+  (if org-agenda-multi
+      (progn
+       (setq buffer-read-only nil)
+       (goto-char (point-max))
+       (unless (= (point) 1)
+         (insert "\n" (make-string (window-width) ?=) "\n"))
+       (narrow-to-region (point) (point-max)))
+    (org-agenda-maybe-reset-markers 'force)
+    (org-prepare-agenda-buffers (org-agenda-files))
+    (let* ((abuf (get-buffer-create org-agenda-buffer-name))
+          (awin (get-buffer-window abuf)))
+      (cond
+       ((equal (current-buffer) abuf) nil)
+       (awin (select-window awin))
+       ((not (setq org-pre-agenda-window-conf (current-window-configuration))))
+       ((equal org-agenda-window-setup 'current-window)
+       (switch-to-buffer abuf))
+       ((equal org-agenda-window-setup 'other-window)
+       (switch-to-buffer-other-window abuf))
+       ((equal org-agenda-window-setup 'other-frame)
+       (switch-to-buffer-other-frame abuf))
+       ((equal org-agenda-window-setup 'reorganize-frame)
+       (delete-other-windows)
+       (switch-to-buffer-other-window abuf))))
+    (setq buffer-read-only nil)
+    (erase-buffer)
+    (org-agenda-mode))
+  (setq buffer-read-only nil))
+
+(defun org-finalize-agenda ()
+  "Finishing touch for the agenda buffer, called just before displaying it."
+  (unless org-agenda-multi
+    (org-agenda-align-tags)
+    (save-excursion
+      (let ((buffer-read-only))
+       (goto-char (point-min))
+       (while (org-activate-bracket-links (point-max))
+         (add-text-properties (match-beginning 0) (match-end 0)
+                              '(face org-link))))
+      (run-hooks 'org-finalize-agenda-hook))))
+
 (defun org-prepare-agenda-buffers (files)
   "Create buffers for all agenda files, protect archived trees and comments."
   (interactive)
@@ -4745,13 +5148,13 @@ the children that do not contain any open TODO items."
   (let ((p (point-at-bol)))
     (and org-agenda-skip-archived-trees
         (get-text-property p :org-archived)
-        (org-end-of-subtree)
+        (org-end-of-subtree t)
         (throw :skip t))
     (and (get-text-property p :org-comment)
-        (org-end-of-subtree)
+        (org-end-of-subtree t)
         (throw :skip t))
     (if (equal (char-after p) ?#) (throw :skip t))))
-  
+
 (defun org-agenda-toggle-archive-tag ()
   "Toggle the archive tag for the current entry."
   (interactive)
@@ -4766,7 +5169,7 @@ the children that do not contain any open TODO items."
     (with-current-buffer buffer
       (widen)
       (goto-char pos)
-      (org-show-hidden-entry)
+      (org-show-context 'agenda)
       (save-excursion
        (and (outline-next-heading)
             (org-flag-heading nil)))   ; show the next heading
@@ -4896,25 +5299,27 @@ If the current word is preceded by a backslash, completes the TeX symbols
 that are supported for HTML support.
 If the current word is preceded by \"#+\", completes special words for
 setting file options.
+In the line after \"#+STARTUP:, complete valid keywords.\"
 At all other locations, this simply calls `ispell-complete-word'."
   (interactive "P")
   (catch 'exit
     (let* ((end (point))
           (beg1 (save-excursion
-                  (if (equal (char-before (point)) ?\ ) (backward-char 1))
                   (skip-chars-backward "a-zA-Z_@0-9")
                   (point)))
           (beg (save-excursion
-                 (if (equal (char-before (point)) ?\ ) (backward-char 1))
                  (skip-chars-backward "a-zA-Z0-9_:$")
                  (point)))
           (confirm (lambda (x) (stringp (car x))))
           (camel (equal (char-before beg) ?*))
           (tag (equal (char-before beg1) ?:))
           (texp (equal (char-before beg) ?\\))
+          (link (equal (char-before beg) ?\[))
           (opt (equal (buffer-substring (max (point-at-bol) (- beg 2))
                                         beg)
                       "#+"))
+          (startup (string-match "^#\\+STARTUP:.*"
+                                (buffer-substring (point-at-bol) (point))))
           (completion-ignore-case opt)
           (type nil)
           (tbl nil)
@@ -4925,6 +5330,11 @@ At all other locations, this simply calls `ispell-complete-word'."
                              (string-match "^#\\+\\(\\([A-Z_]+:?\\).*\\)" x)
                              (cons (match-string 2 x) (match-string 1 x)))
                            (org-split-string (org-get-current-options) "\n")))
+                  (startup
+                   (setq type :startup)
+                   org-startup-options)
+                  (link (append org-link-abbrev-alist-local
+                                org-link-abbrev-alist))
                   (texp
                    (setq type :tex)
                    org-html-entities)
@@ -5061,7 +5471,7 @@ prefix arg, switch to that state."
            (not (equal state org-done-string)))
       (when org-log-done
        (if (equal state org-done-string)
-           (org-add-planning-info 'closed (current-time) 'scheduled)
+           (org-add-planning-info 'closed (org-current-time) 'scheduled)
          (if (not this)
              (org-add-planning-info nil nil 'closed))))
       ;; Fixup tag positioning
@@ -5077,38 +5487,6 @@ prefix arg, switch to that state."
        (goto-char (or (match-end 2) (match-end 1)))
        (just-one-space))))
 
-(defun org-log-done (&optional undone)
-  "Add a time stamp logging that a TODO entry has been closed.
-When UNDONE is non-nil, remove such a time stamp again."
-  (interactive)
-  (let (beg end col)
-    (save-excursion
-      (org-back-to-heading t)
-      (setq beg (point))
-      (looking-at (concat outline-regexp " *"))
-      (goto-char (match-end 0))
-      (setq col (current-column))
-      (outline-next-heading)
-      (setq end (point))
-      (goto-char beg)
-      (when (re-search-forward (concat
-                               "[\r\n]\\([ \t]*"
-                               (regexp-quote org-closed-string)
-                               " *\\[.*?\\][^\n\r]*[\n\r]?\\)") end t)
-       (delete-region (match-beginning 1) (match-end 1)))
-      (unless undone
-       (org-back-to-heading t)
-       (skip-chars-forward "^\n\r")
-       (goto-char (min (1+ (point)) (point-max)))
-       (when (not (member (char-before) '(?\r ?\n)))
-         (insert "\n"))
-       (indent-to col)
-       (insert org-closed-string " "
-               (format-time-string
-                (concat "[" (substring (cdr org-time-stamp-formats) 1 -1) "]")
-                (org-current-time))
-               "\n")))))
-
 (defun org-show-todo-tree (arg)
   "Make a compact tree which shows all headlines marked with TODO.
 The tree will show the lines where the regexp matches, and all higher
@@ -5153,81 +5531,140 @@ be removed."
   (when (and org-insert-labeled-timestamps-at-point
             (member what '(scheduled deadline)))
     (insert
-     (if (eq what 'scheduled) org-scheduled-string org-deadline-string)
-     " "
-     (format-time-string (car org-time-stamp-formats) time))
+     (if (eq what 'scheduled) org-scheduled-string org-deadline-string) " ")
+    (org-insert-time-stamp time)
     (setq what nil))
   (save-excursion
-    (let (col list elt (buffer-invisibility-spec nil) ts)
-      (org-back-to-heading t)
-      (looking-at (concat outline-regexp "\\( *\\)[^\r\n]*"))
-      (goto-char (match-end 1))
-      (setq col (current-column))
-      (goto-char (1+ (match-end 0)))
-      (if (and (not (looking-at outline-regexp))
-              (looking-at (concat "[^\r\n]*?" org-keyword-time-regexp
-                                  "[^\r\n]*"))
-              (not (equal (match-string 1) org-clock-string)))
-         (narrow-to-region (match-beginning 0) (match-end 0))
-       (insert "\n")
-       (backward-char 1)
-       (narrow-to-region (point) (point))
-       (indent-to-column col))
-      ;; Check if we have to remove something.
-      (setq list (cons what remove))
-      (while list
-       (setq elt (pop list))
+    (save-restriction
+      (let (col list elt ts buffer-invisibility-spec)
+       (org-back-to-heading t)
+       (looking-at (concat outline-regexp "\\( *\\)[^\r\n]*"))
+       (goto-char (match-end 1))
+       (setq col (current-column))
+       (goto-char (1+ (match-end 0)))
+       (if (and (not (looking-at outline-regexp))
+                (looking-at (concat "[^\r\n]*?" org-keyword-time-regexp
+                                    "[^\r\n]*"))
+                (not (equal (match-string 1) org-clock-string)))
+           (narrow-to-region (match-beginning 0) (match-end 0))
+         (insert "\n")
+         (backward-char 1)
+         (narrow-to-region (point) (point))
+         (indent-to-column col))
+       ;; Check if we have to remove something.
+       (setq list (cons what remove))
+       (while list
+         (setq elt (pop list))
+         (goto-char (point-min))
+         (when (or (and (eq elt 'scheduled)
+                        (re-search-forward org-scheduled-time-regexp nil t))
+                   (and (eq elt 'deadline)
+                        (re-search-forward org-deadline-time-regexp nil t))
+                   (and (eq elt 'closed)
+                        (re-search-forward org-closed-time-regexp nil t)))
+           (replace-match "")
+           (if (looking-at " +") (replace-match ""))))
+       (goto-char (point-max))
+       (when what
+         (insert
+          (if (not (equal (char-before) ?\ )) " " "")
+          (cond ((eq what 'scheduled) org-scheduled-string)
+                ((eq what 'deadline) org-deadline-string)
+                ((eq what 'closed) org-closed-string))
+          " ")
+         (org-insert-time-stamp time nil (eq what 'closed))
+         (end-of-line 1)
+         (org-add-log-maybe 'done))
        (goto-char (point-min))
-       (when (or (and (eq elt 'scheduled)
-                      (re-search-forward org-scheduled-time-regexp nil t))
-                 (and (eq elt 'deadline)
-                      (re-search-forward org-deadline-time-regexp nil t))
-                 (and (eq elt 'closed)
-                      (re-search-forward org-closed-time-regexp nil t)))
-         (replace-match "")
-         (if (looking-at " +") (replace-match ""))))
-      (goto-char (point-max))
-      (when what
-       (insert
-        (if (not (equal (char-before) ?\ )) " " "")
-        (cond ((eq what 'scheduled) org-scheduled-string)
-              ((eq what 'deadline) org-deadline-string)
-              ((eq what 'closed) org-closed-string))
-        " ")
-       (insert
-        (setq ts
-              (format-time-string
-               (if (eq what 'closed)
-                   (concat "[" (substring (cdr org-time-stamp-formats) 1 -1) "]")
-                 (car org-time-stamp-formats))
-               time))))
-      (goto-char (point-min))
-      (widen)
-      (if (looking-at "[ \t]+\r?\n")
-         (replace-match ""))
-      ts)))
+       (widen)
+       (if (looking-at "[ \t]+\r?\n")
+           (replace-match ""))
+       ts))))
+
+(defvar org-log-note-marker (make-marker))
+(defvar org-log-note-purpose nil)
+(defvar org-log-note-window-configuration nil)
+
+(defun org-add-log-maybe (&optional purpose)
+  (when (and (listp org-log-done)
+            (memq purpose org-log-done))
+    (move-marker org-log-note-marker (point))
+    (setq org-log-note-purpose purpose)
+    (add-hook 'post-command-hook 'org-add-log-note 'append)))
+
+(defun org-add-log-note (&optional purpose)
+  "Pop up a window for taking a note, and add this note later at point."
+  (remove-hook 'post-command-hook 'org-add-log-note)
+  (setq org-log-note-window-configuration (current-window-configuration))
+  (delete-other-windows)
+  (switch-to-buffer (marker-buffer org-log-note-marker))
+  (goto-char org-log-note-marker)
+  (switch-to-buffer-other-window "*Org Note*")
+  (erase-buffer)
+  (org-mode)
+  (insert (format "# Insert note for %s, finish with C-c C-c.\n\n"
+                 (cond
+                  ((eq org-log-note-purpose 'clock-out) "stopped clock")
+                  ((eq org-log-note-purpose 'done)  "closed todo item")
+                  (t (error "This should not happen")))))
+  (org-set-local 'org-finish-function 'org-store-log-note))
+
+(defun org-store-log-note ()
+  "Finish taking a log note, and insert it to where it belongs."
+  (let ((txt (buffer-string))
+       (note (cdr (assq org-log-note-purpose org-log-note-headings)))
+       lines ind)
+    (kill-buffer (current-buffer))
+    (if (string-match "^#.*\n[ \t\\n]*" txt)
+       (setq txt (replace-match "" t t txt)))
+    (when (string-match "\\S-" txt)
+      (if (string-match "\\s-+\\'" txt)
+         (setq txt (replace-match "" t t txt)))
+      (setq lines (org-split-string txt "\n"))
+      (and note (string-match "\\S-" note) (push note lines))
+      (save-excursion
+       (set-buffer (marker-buffer org-log-note-marker))
+       (save-excursion
+         (goto-char org-log-note-marker)
+         (if (not (bolp)) (newline))
+         (indent-relative t)
+         (setq ind (concat (buffer-substring (point-at-bol) (point)) "    "))
+         (insert "  - " (pop lines))
+         (while lines
+           (insert "\n" ind (pop lines))))))
+    (set-window-configuration org-log-note-window-configuration)))
+
+(defvar org-occur-highlights nil)
+(make-variable-buffer-local 'org-occur-highlights)
 
-(defun org-occur (regexp &optional callback)
+(defun org-occur (regexp &optional keep-previous callback)
   "Make a compact tree which shows all matches of REGEXP.
 The tree will show the lines where the regexp matches, and all higher
 headlines above the match.  It will also show the heading after the match,
 to make sure editing the matching entry is easy.
+If KEEP-PREVIOUS is non-nil, highlighting and exposing done by a previous
+call to `org-occur' will be kept, to allow stacking of calls to this
+command.
 If CALLBACK is non-nil, it is a function which is called to confirm
 that the match should indeed be shown."
-  (interactive "sRegexp: ")
-  (org-remove-occur-highlights nil nil t)
+  (interactive "sRegexp: \nP")
+  (or keep-previous (org-remove-occur-highlights nil nil t))
   (let ((cnt 0))
     (save-excursion
       (goto-char (point-min))
-      (org-overview)
+      (if (or (not keep-previous)          ; do not want to keep
+             (not org-occur-highlights))  ; no previous matches
+         ;; hide everything
+         (org-overview))
       (while (re-search-forward regexp nil t)
        (when (or (not callback)
                  (save-match-data (funcall callback)))
          (setq cnt (1+ cnt))
          (org-highlight-new-match (match-beginning 0) (match-end 0))
-         (org-show-hierarchy-above))))
-    (org-add-hook 'before-change-functions 'org-remove-occur-highlights
-                 nil 'local)
+         (org-show-context 'occur-tree))))
+    (when org-remove-highlights-with-change
+      (org-add-hook 'before-change-functions 'org-remove-occur-highlights
+                   nil 'local))
     (unless org-sparse-tree-open-archived-trees
       (org-hide-archived-subtrees (point-min) (point-max)))
     (run-hooks 'org-occur-hook)
@@ -5235,24 +5672,53 @@ that the match should indeed be shown."
        (message "%d match(es) for regexp %s" cnt regexp))
     cnt))
 
-(defun org-show-hierarchy-above ()
-  "Make sure point and the headings hierarchy above is visible."
-  (catch 'exit
-    (if (org-on-heading-p t)
-       (org-flag-heading nil)    ; only show the heading
-      (and (or (org-invisible-p) (org-invisible-p2))
-          (org-show-hidden-entry)))    ; show entire entry
-    (save-excursion
-      (and org-show-following-heading
-          (outline-next-heading)
-          (org-flag-heading nil)))  ; show the next heading
-    (when org-show-hierarchy-above
-      (save-excursion                  ; show all higher headings
-       (while (and (condition-case nil
-                       (progn (org-up-heading-all 1) t)
-                     (error nil))
-                   (not (bobp)))
-         (org-flag-heading nil))))))
+(defun org-show-context (&optional key siblings)
+  "Make sure point and context and visible.
+How much context is shown depends upon the variables
+`org-show-hierarchy-above' and `org-show-following-heading'.
+When SIBLINGS is non-nil, show all siblings on each hierarchy level."
+  (let ((heading-p (org-on-heading-p t))
+       (hierarchy-p (org-get-alist-option org-show-hierarchy-above key))
+       (following-p (org-get-alist-option org-show-following-heading key)))
+    (catch 'exit
+      ;; Show heading or entry text
+      (if heading-p
+         (org-flag-heading nil)    ; only show the heading
+       (and (or (org-invisible-p) (org-invisible-p2))
+            (org-show-hidden-entry)))    ; show entire entry
+      (when following-p
+       ;; Show next sibling, or heading below text
+       (save-excursion
+         (and (if heading-p (org-goto-sibling) (outline-next-heading))
+              (org-flag-heading nil))))
+      (when hierarchy-p
+       ;; show all higher headings, possibly with siblings
+       (save-excursion
+         (while (and (condition-case nil
+                         (progn (org-up-heading-all 1) t)
+                       (error nil))
+                     (not (bobp)))
+           (org-flag-heading nil)
+           (when siblings
+             (save-excursion
+               (while (org-goto-sibling) (org-flag-heading nil)))
+             (save-excursion
+               (while (org-goto-sibling 'previous)
+                 (org-flag-heading nil))))))))))
+
+(defun org-reveal (&optional siblings)
+  "Show current entry, hierarchy above it, and the following headline.
+This can be used to show a consistent set of context around locations
+exposed with `org-show-hierarchy-above' or `org-show-following-heading'
+not t for the search context.
+
+With optional argument SIBLINGS, on each level of the hierarchy all
+siblings are shown.  This repairs the tree structure so what it would
+look like when opend with successive calls to `org-cycle'."
+  (interactive "P")
+  (let ((org-show-hierarchy-above t)
+       (org-show-following-heading t))
+    (org-show-context nil siblings)))
 
 ;; Overlay compatibility functions
 (defun org-make-overlay (beg end &optional buffer)
@@ -5261,25 +5727,40 @@ that the match should indeed be shown."
     (make-overlay beg end buffer)))
 (defun org-delete-overlay (ovl)
   (if (featurep 'xemacs) (delete-extent ovl) (delete-overlay ovl)))
-(defun org-detatch-overlay (ovl)
+(defun org-detach-overlay (ovl)
   (if (featurep 'xemacs) (detach-extent ovl) (delete-overlay ovl)))
 (defun org-move-overlay (ovl beg end &optional buffer)
   (if (featurep 'xemacs)
-      (set-extent-endpoints ovl beg end buffer)
+      (set-extent-endpoints ovl beg end (or buffer (current-buffer)))
     (move-overlay ovl beg end buffer)))
 (defun org-overlay-put (ovl prop value)
   (if (featurep 'xemacs)
       (set-extent-property ovl prop value)
     (overlay-put ovl prop value)))
+(defun org-overlay-display (ovl text &optional face)
+  "Make overlay OVL display TEXT with face FACE."
+  (if (featurep 'xemacs)
+      (let ((gl (make-glyph text)))
+       (and face (set-glyph-face gl face))
+       (set-extent-property ovl 'invisible t)
+       (set-extent-property ovl 'end-glyph gl))
+    (overlay-put ovl 'display text)
+    (if face (overlay-put ovl 'face face))))
+(defun org-overlay-get (ovl prop)
+  (if (featurep 'xemacs)
+      (extent-property ovl prop)
+    (overlay-get ovl prop)))
 (defun org-overlays-at (pos)
   (if (featurep 'xemacs) (extents-at pos) (overlays-at pos)))
+(defun org-overlays-in (&optional start end)
+  (if (featurep 'xemacs)
+      (extent-list nil start end)
+    (overlays-in start end)))
 (defun org-overlay-start (o)
   (if (featurep 'xemacs) (extent-start-position o) (overlay-start o)))
 (defun org-overlay-end (o)
   (if (featurep 'xemacs) (extent-end-position o) (overlay-end o)))
 
-(defvar org-occur-highlights nil)
-(make-variable-buffer-local 'org-occur-highlights)
 (defun org-highlight-new-match (beg end)
   "Highlight from BEG to END and mark the highlight is an occur headline."
   (let ((ov (org-make-overlay beg end)))
@@ -5383,10 +5864,7 @@ So if you press just return without typing anything, the time stamp
 will represent the current date/time.  If there is already a timestamp
 at the cursor, it will be modified."
   (interactive "P")
-  (let ((fmt (if arg (cdr org-time-stamp-formats)
-              (car org-time-stamp-formats)))
-       (org-time-was-given nil)
-       time)
+  (let (org-time-was-given time)
     (cond
      ((and (org-at-timestamp-p)
           (eq last-command 'org-time-stamp)
@@ -5394,21 +5872,19 @@ at the cursor, it will be modified."
       (insert "--")
       (setq time (let ((this-command this-command))
                  (org-read-date arg 'totime)))
-      (if org-time-was-given (setq fmt (cdr org-time-stamp-formats)))
-      (insert (format-time-string fmt time)))
+      (org-insert-time-stamp time (or org-time-was-given arg)))
      ((org-at-timestamp-p)
       (setq time (let ((this-command this-command))
                   (org-read-date arg 'totime)))
-      (and (org-at-timestamp-p) (replace-match
-                                (setq org-last-changed-timestamp
-                                      (format-time-string fmt time))
-                                t t))
+      (when (org-at-timestamp-p) ; just to get the match data
+       (replace-match "")
+       (setq org-last-changed-timestamp
+             (org-insert-time-stamp time (or org-time-was-given arg))))
       (message "Timestamp updated"))
      (t
       (setq time (let ((this-command this-command))
-                 (org-read-date arg 'totime)))
-      (if org-time-was-given (setq fmt (cdr org-time-stamp-formats)))
-      (insert (format-time-string fmt time))))))
+                  (org-read-date arg 'totime)))
+      (org-insert-time-stamp time (or org-time-was-given arg))))))
 
 (defun org-time-stamp-inactive (&optional arg)
   "Insert an inactive time stamp.
@@ -5417,20 +5893,15 @@ brackets.  It is inactive in the sense that it does not trigger agenda entries,
 does not link to the calendar and cannot be changed with the S-cursor keys.
 So these are more for recording a certain time/date."
   (interactive "P")
-  (let ((fmt (if arg (cdr org-time-stamp-formats)
-              (car org-time-stamp-formats)))
-       (org-time-was-given nil)
-       time)
+  (let (org-time-was-given time)
     (setq time (org-read-date arg 'totime))
-    (if org-time-was-given (setq fmt (cdr org-time-stamp-formats)))
-    (setq fmt (concat "[" (substring fmt 1 -1) "]"))
-    (insert (format-time-string fmt time))))
+    (org-insert-time-stamp time (or org-time-was-given arg) 'inactive)))
 
 (defvar org-date-ovl (org-make-overlay 1 1))
 (org-overlay-put org-date-ovl 'face 'org-warning)
-(org-detatch-overlay org-date-ovl)
+(org-detach-overlay org-date-ovl)
 
-(defun org-read-date (&optional with-time to-time)
+(defun org-read-date (&optional with-time to-time from-string)
   "Read a date and make things smooth for the user.
 The prompt will suggest to enter an ISO date, but you can also enter anything
 which will at least partially be understood by `parse-time-string'.
@@ -5486,56 +5957,58 @@ used to insert the time stamp into the buffer to include the time."
         ans ans1 ans2
         second minute hour day month year tl wday wday1)
 
-    (if org-popup-calendar-for-date-prompt
-       (save-excursion
-         (save-window-excursion
-           (calendar)
-           (calendar-forward-day (- (time-to-days default-time)
-                                    (calendar-absolute-from-gregorian
-                                     (calendar-current-date))))
-            (org-eval-in-calendar nil)
-           (let* ((old-map (current-local-map))
-                  (map (copy-keymap calendar-mode-map))
-                  (minibuffer-local-map (copy-keymap minibuffer-local-map)))
-             (define-key map (kbd "RET") 'org-calendar-select)
-             (define-key map (if (featurep 'xemacs) [button1] [mouse-1])
-               'org-calendar-select-mouse)
-             (define-key map (if (featurep 'xemacs) [button2] [mouse-2])
-               'org-calendar-select-mouse)
-             (define-key minibuffer-local-map [(meta shift left)]
-               (lambda () (interactive)
-                 (org-eval-in-calendar '(calendar-backward-month 1))))
-             (define-key minibuffer-local-map [(meta shift right)]
-               (lambda () (interactive)
-                 (org-eval-in-calendar '(calendar-forward-month 1))))
-             (define-key minibuffer-local-map [(shift up)]
-               (lambda () (interactive)
-                 (org-eval-in-calendar '(calendar-backward-week 1))))
-             (define-key minibuffer-local-map [(shift down)]
-               (lambda () (interactive)
-                 (org-eval-in-calendar '(calendar-forward-week 1))))
-             (define-key minibuffer-local-map [(shift left)]
-               (lambda () (interactive)
-                 (org-eval-in-calendar '(calendar-backward-day 1))))
-             (define-key minibuffer-local-map [(shift right)]
-               (lambda () (interactive)
-                 (org-eval-in-calendar '(calendar-forward-day 1))))
-             (define-key minibuffer-local-map ">"
-               (lambda () (interactive)
-                 (org-eval-in-calendar '(scroll-calendar-left 1))))
-             (define-key minibuffer-local-map "<"
-               (lambda () (interactive)
-                 (org-eval-in-calendar '(scroll-calendar-right 1))))
-             (unwind-protect
-                 (progn
-                   (use-local-map map)
-                   (setq ans (read-string prompt "" nil nil))
-                   (if (not (string-match "\\S-" ans)) (setq ans nil))
-                   (setq ans (or ans1 ans ans2)))
-               (use-local-map old-map)))))
-      ;; Naked prompt only
-      (setq ans (read-string prompt "" nil timestr)))
-    (org-detatch-overlay org-date-ovl)
+    (cond
+     (from-string (setq ans from-string))
+     (org-popup-calendar-for-date-prompt
+      (save-excursion
+       (save-window-excursion
+         (calendar)
+         (calendar-forward-day (- (time-to-days default-time)
+                                  (calendar-absolute-from-gregorian
+                                   (calendar-current-date))))
+         (org-eval-in-calendar nil)
+         (let* ((old-map (current-local-map))
+                (map (copy-keymap calendar-mode-map))
+                (minibuffer-local-map (copy-keymap minibuffer-local-map)))
+           (define-key map (kbd "RET") 'org-calendar-select)
+           (define-key map (if (featurep 'xemacs) [button1] [mouse-1])
+             'org-calendar-select-mouse)
+           (define-key map (if (featurep 'xemacs) [button2] [mouse-2])
+             'org-calendar-select-mouse)
+           (define-key minibuffer-local-map [(meta shift left)]
+             (lambda () (interactive)
+               (org-eval-in-calendar '(calendar-backward-month 1))))
+           (define-key minibuffer-local-map [(meta shift right)]
+             (lambda () (interactive)
+               (org-eval-in-calendar '(calendar-forward-month 1))))
+           (define-key minibuffer-local-map [(shift up)]
+             (lambda () (interactive)
+               (org-eval-in-calendar '(calendar-backward-week 1))))
+           (define-key minibuffer-local-map [(shift down)]
+             (lambda () (interactive)
+               (org-eval-in-calendar '(calendar-forward-week 1))))
+           (define-key minibuffer-local-map [(shift left)]
+             (lambda () (interactive)
+               (org-eval-in-calendar '(calendar-backward-day 1))))
+           (define-key minibuffer-local-map [(shift right)]
+             (lambda () (interactive)
+               (org-eval-in-calendar '(calendar-forward-day 1))))
+           (define-key minibuffer-local-map ">"
+             (lambda () (interactive)
+               (org-eval-in-calendar '(scroll-calendar-left 1))))
+           (define-key minibuffer-local-map "<"
+             (lambda () (interactive)
+               (org-eval-in-calendar '(scroll-calendar-right 1))))
+           (unwind-protect
+               (progn
+                 (use-local-map map)
+                 (setq ans (read-string prompt "" nil nil))
+                 (if (not (string-match "\\S-" ans)) (setq ans nil))
+                 (setq ans (or ans1 ans ans2)))
+             (use-local-map old-map))))))
+     (t ; Naked prompt only
+      (setq ans (read-string prompt "" nil timestr))))
+    (org-detach-overlay org-date-ovl)
 
     (if (string-match
         "^ *\\(\\([0-9]+\\)-\\)?\\([0-1]?[0-9]\\)-\\([0-3]?[0-9]\\)\\([^-0-9]\\|$\\)" ans)
@@ -5595,6 +6068,84 @@ This is used by `org-read-date' in a temporary keymap for the calendar buffer."
       (setq ans1 (format-time-string "%Y-%m-%d" time)))
     (if (active-minibuffer-window) (exit-minibuffer))))
 
+(defun org-insert-time-stamp (time &optional with-hm inactive pre post)
+  "Insert a date stamp for the date given by the internal TIME.
+WITH-HM means, use the stamp format that includes the time of the day.
+INACTIVE means use square brackets instead of angular ones, so that the
+stamp will not contribute to the agenda.
+PRE and POST are optional strings to be inserted before and after the
+stamp.
+The command returns the inserted time stamp."
+  (let ((fmt (funcall (if with-hm 'cdr 'car) org-time-stamp-formats))
+       stamp)
+    (if inactive (setq fmt (concat "[" (substring fmt 1 -1) "]")))
+    (insert (or pre ""))
+    (insert (setq stamp (format-time-string fmt time)))
+    (insert (or post ""))
+    stamp))
+
+(defun org-toggle-time-stamp-overlays ()
+  "Toggle the use of custom time stamp formats."
+  (interactive)
+  (setq org-display-custom-times (not org-display-custom-times))
+  (unless org-display-custom-times
+    (let ((p (point-min)) (bmp (buffer-modified-p)))
+      (while (setq p (next-single-property-change p 'display))
+       (if (and (get-text-property p 'display)
+                (eq (get-text-property p 'face) 'org-date))
+           (remove-text-properties
+            p (setq p (next-single-property-change p 'display))
+            '(display t))))
+      (set-buffer-modified-p bmp)))
+  (if (featurep 'xemacs)
+      (remove-text-properties (point-min) (point-max) '(end-glyph t)))
+  (org-restart-font-lock)
+  (setq org-table-may-need-update t)
+  (if org-display-custom-times
+      (message "Time stamps are overlayed with custom format")
+    (message "Time stamp overlays removed")))
+
+(defun org-display-custom-time (beg end)
+  "Overlay modified time stamp format over timestamp between BED and END."
+  (let* ((t1 (save-match-data
+              (org-parse-time-string (buffer-substring beg end) t)))
+        (w1 (- end beg))
+        (with-hm (and (nth 1 t1) (nth 2 t1)))
+        (inactive (= (char-before (1- beg)) ?\[))
+        (tf (funcall (if with-hm 'cdr 'car) org-time-stamp-custom-formats))
+        (time (org-fix-decoded-time t1))
+        (time (mapcar (lambda (x) (or x 0)) t1))
+        (str (org-add-props
+                 (format-time-string
+                  (substring tf 1 -1) (apply 'encode-time time))
+                 nil 'mouse-face 'highlight))
+        (w2 (length str)))
+    (if (not (= w2 w1))
+       (add-text-properties (1+ beg) (+ 2 beg)
+                            (list 'org-dwidth t 'org-dwidth-n (- w1 w2))))
+    (if (featurep 'xemacs)
+       (progn
+         (put-text-property beg end 'invisible t)
+         (put-text-property beg end 'end-glyph (make-glyph str)))
+      (put-text-property beg end 'display str))))
+
+(defun org-fix-decoded-time (time)
+  "Set 0 instead of nil for the first 6 elements of time.
+Don't touch the rest."
+  (let ((n 0))
+    (mapcar (lambda (x) (if (< (setq n (1+ n)) 7) (or x 0) x)) time)))
+
+(defun org-days-to-time (timestamp-string)
+  "Difference between TIMESTAMP-STRING and now in days."
+  (- (time-to-days (org-time-string-to-time timestamp-string))
+     (time-to-days (current-time))))
+
+(defun org-deadline-close (timestamp-string &optional ndays)
+  "Is the time in TIMESTAMP-STRING close to the current date?"
+  (and (< (org-days-to-time timestamp-string)
+         (or ndays org-deadline-warning-days))
+       (not (org-entry-is-done-p))))
+
 (defun org-calendar-select-mouse (ev)
   "Return to `org-read-date' with the date currently selected.
 This is used by `org-read-date' in a temporary keymap for the calendar buffer."
@@ -5621,14 +6172,10 @@ days.  If the prefix is a raw \\[universal-argument] prefix, all deadlines are s
         (case-fold-search nil)
         (regexp (concat "\\<" org-deadline-string " *<\\([^>]+\\)>"))
         (callback
-         (lambda ()
-           (and (let ((d1 (time-to-days (current-time)))
-                      (d2 (time-to-days
-                           (org-time-string-to-time (match-string 1)))))
-                  (< (- d2 d1) org-warn-days))
-                (not (org-entry-is-done-p))))))
+         (lambda () (org-deadline-close (match-string 1) org-warn-days))))
+
     (message "%d deadlines past-due or due within %d days"
-            (org-occur regexp callback)
+            (org-occur regexp nil callback)
             org-warn-days)))
 
 (defun org-evaluate-time-range (&optional to-buffer)
@@ -5765,10 +6312,10 @@ With prefix ARG, change that many days."
        (<= (match-beginning n) pos)
        (>= (match-end n) pos)))
 
-(defun org-at-timestamp-p (&optional also-inactive)
+(defun org-at-timestamp-p (&optional inactive-ok)
   "Determine if the cursor is in or at a timestamp."
   (interactive)
-  (let* ((tsr (if also-inactive org-ts-regexp3 org-ts-regexp2))
+  (let* ((tsr (if inactive-ok org-ts-regexp3 org-ts-regexp2))
         (pos (point))
         (ans (or (looking-at tsr)
                  (save-excursion
@@ -5793,21 +6340,23 @@ With prefix ARG, change that many days."
 The date will be changed by N times WHAT.  WHAT can be `day', `month',
 `year', `minute', `second'.  If WHAT is not given, the cursor position
 in the timestamp determines what will be changed."
-  (let ((fmt (car org-time-stamp-formats))
+  (let ((pos (point))
+       with-hm inactive
        org-ts-what
-       (pos (point))
        ts time time0)
     (if (not (org-at-timestamp-p t))
        (error "Not at a timestamp"))
-    (setq org-ts-what (or what org-ts-what))
-    (setq fmt (if (<= (abs (- (cdr org-ts-lengths)
+    (if (and (not what) (not (eq org-ts-what 'day))
+            org-display-custom-times
+            (get-text-property (point) 'display)
+            (not (get-text-property (1- (point)) 'display)))
+       (setq org-ts-what 'day))
+    (setq org-ts-what (or what org-ts-what)
+         with-hm (<= (abs (- (cdr org-ts-lengths)
                              (- (match-end 0) (match-beginning 0))))
                      1)
-                 (cdr org-time-stamp-formats)
-               (car org-time-stamp-formats)))
-    (if (= (char-after (match-beginning 0)) ?\[)
-       (setq fmt (concat "[" (substring fmt 1 -1) "]")))
-    (setq ts (match-string 0))
+         inactive (= (char-after (match-beginning 0)) ?\[)
+         ts (match-string 0))
     (replace-match "")
     (setq time0 (org-parse-time-string ts))
     (setq time
@@ -5833,7 +6382,8 @@ in the timestamp determines what will be changed."
          (setcar (nthcdr 1 time0) (or (nth 1 time0) 0))
          (setcar (nthcdr 2 time0) (or (nth 1 time0) 0))
          (setq time (apply 'encode-time time0))))
-    (insert (setq org-last-changed-timestamp (format-time-string fmt time)))
+    (setq org-last-changed-timestamp
+         (org-insert-time-stamp time with-hm inactive))
     (org-clock-update-time-maybe)
     (goto-char pos)
     ;; Try to recenter the calendar window, if any
@@ -5899,12 +6449,8 @@ If necessary, clock-out of the currently active clock."
          (beginning-of-line 1))
       (insert "\n") (backward-char 1)
       (indent-relative)
-      (insert org-clock-string " "
-             (setq ts (concat "[" (format-time-string
-                                   (substring
-                                    (cdr org-time-stamp-formats) 1 -1)
-                                   (current-time))
-                              "]")))
+      (insert org-clock-string " ")
+      (setq ts (org-insert-time-stamp (current-time) 'with-hm 'inactive))
       (move-marker org-clock-marker (point))
       (message "Clock started at %s" ts))))
 
@@ -5925,19 +6471,17 @@ If there is no running clock, throw an error, unless FAIL-QUIETLY is set."
          (setq ts (match-string 2))
        (if fail-quietly (throw 'exit nil) (error "Clock start time is gone")))
       (goto-char org-clock-marker)
-      (setq te (concat "[" (format-time-string
-                           (substring
-                            (cdr org-time-stamp-formats) 1 -1)
-                           (current-time))
-                      "]"))
+      (insert "--")
+      (setq te (org-insert-time-stamp (current-time) 'with-hm 'inactive))
       (setq s (- (time-to-seconds (apply 'encode-time (org-parse-time-string te)))
                 (time-to-seconds (apply 'encode-time (org-parse-time-string ts))))
            h (floor (/ s 3600))
            s (- s (* 3600 h))
            m (floor (/ s 60))
            s (- s (* 60 s)))
-      (insert "--" te " => " (format "%2d:%02d" h m))
+      (insert " => " (format "%2d:%02d" h m))
       (move-marker org-clock-marker nil)
+      (org-add-log-maybe 'clock-out)
       (message "Clock stopped at %s after HH:MM = %d:%02d" te h m)))))
 
 (defun org-clock-cancel ()
@@ -6016,9 +6560,10 @@ in the echo area."
        (setq h (/ org-clock-file-total-minutes 60)
              m (- org-clock-file-total-minutes (* 60 h)))
        ;; Arrange to remove the overlays upon next change.
-       (org-add-hook 'before-change-functions 'org-remove-clock-overlays
-                     nil 'local)))
-  (message "Total file time: %d:%02d (%d hours and %d minutes)" h m h m)))
+       (when org-remove-highlights-with-change
+         (org-add-hook 'before-change-functions 'org-remove-clock-overlays
+                       nil 'local))))
+    (message "Total file time: %d:%02d (%d hours and %d minutes)" h m h m)))
 
 (defvar org-clock-overlays nil)
 (make-variable-buffer-local 'org-clock-overlays)
@@ -6043,7 +6588,10 @@ will be easy to remove."
                                            (make-string (- 10 l) ?\ ))
                         '(face secondary-selection))
                     ""))
-    (org-overlay-put ov 'display tx)
+    (if (not (featurep 'xemacs))
+       (org-overlay-put ov 'display tx)
+      (org-overlay-put ov 'invisible t)
+      (org-overlay-put ov 'end-glyph (make-glyph tx)))
     (push ov org-clock-overlays)))
 
 (defun org-remove-clock-overlays (&optional beg end noremove)
@@ -6066,7 +6614,12 @@ This is used to stop the clock after a TODO entry is marked DONE."
             (< (point) org-clock-marker)
             (> (save-excursion (outline-next-heading) (point))
                org-clock-marker))
-    (org-clock-out)))
+    ;; Clock out, but don't accept a logging message for this.
+    (let ((org-log-done (if (and (listp org-log-done)
+                                (member 'clock-out org-log-done))
+                           '(done)
+                         org-log-done)))
+      (org-clock-out))))
 
 (add-hook 'org-after-todo-state-change-hook
          'org-clock-out-if-current)
@@ -6192,12 +6745,13 @@ the returned times will be formatted strings."
                     (apply 'encode-time (org-parse-time-string te)))))
     (move-marker ins (point))
     (setq ipos (point))
-    (insert-before-markers "Clock summary at [" 
+    ;; FIXME: does not yet use org-insert-time-stamp
+    (insert-before-markers "Clock summary at ["
                           (substring
                            (format-time-string (cdr org-time-stamp-formats))
                            1 -1)
                           "]."
-                          (if block 
+                          (if block
                               (format "  Considered range is /%s/." block)
                             "")
                           "\n\n|L|Headline|Time|\n")
@@ -6223,7 +6777,7 @@ the returned times will be formatted strings."
            (goto-char ins)
            (if (= level 1) (insert-before-markers "|-\n"))
            (insert-before-markers
-            "| " (int-to-string level) "|" hlc hdl hlc " |" 
+            "| " (int-to-string level) "|" hlc hdl hlc " |"
             (make-string (1- level) ?|)
             hlc
             (format "%d:%02d" h m)
@@ -6283,7 +6837,6 @@ FIXME: describe the elements."
 (defvar org-agenda-menu) ; defined later in this file.
 (defvar org-agenda-follow-mode nil)
 (defvar org-agenda-show-log nil)
-(defvar org-agenda-buffer-name "*Org Agenda*")
 (defvar org-agenda-redo-command nil)
 (defvar org-agenda-mode-hook nil)
 (defvar org-agenda-type nil)
@@ -6327,6 +6880,7 @@ The following commands are available:
 (define-key org-agenda-mode-map "\C-i"     'org-agenda-goto)
 (define-key org-agenda-mode-map [(tab)]    'org-agenda-goto)
 (define-key org-agenda-mode-map "\C-m"     'org-agenda-switch-to)
+(define-key org-agenda-mode-map "\C-k"     'org-agenda-kill)
 (define-key org-agenda-mode-map " "        'org-agenda-show)
 (define-key org-agenda-mode-map "\C-c\C-t" 'org-agenda-todo)
 (define-key org-agenda-mode-map "o"        'delete-other-windows)
@@ -6403,7 +6957,7 @@ The following commands are available:
     "--"
     ["Show" org-agenda-show t]
     ["Go To (other window)" org-agenda-goto t]
-    ["Go To (one window)" org-agenda-switch-to t]
+    ["Go To (this window)" org-agenda-switch-to t]
     ["Follow Mode" org-agenda-follow-mode
      :style toggle :selected org-agenda-follow-mode :active t]
     "--"
@@ -6457,19 +7011,25 @@ The following commands are available:
     ["Exit and Release Buffers" org-agenda-exit t]
     ))
 
+(defvar org-agenda-restrict nil)
+(defvar org-agenda-restrict-begin (make-marker))
+(defvar org-agenda-restrict-end (make-marker))
+(defvar org-agenda-last-dispatch-buffer nil)
+
 ;;;###autoload
 (defun org-agenda (arg)
   "Dispatch agenda commands to collect entries to the agenda buffer.
 Prompts for a character to select a command.  Any prefix arg will be passed
 on to the selected command.  The default selections are:
-
-a     Call `org-agenda' to display the agenda for the current day or week.
+g
+a     Call `org-agenda-list' to display the agenda for current day or week.
 t     Call `org-todo-list' to display the global todo list.
 T     Call `org-todo-list' to display the global todo list, select only
       entries with a specific TODO keyword (the user gets a prompt).
 m     Call `org-tags-view' to display headlines with tags matching
       a condition  (the user is prompted for the condition).
 M     Like `m', but select only TODO entries, no ordinary headlines.
+l     Create a timeeline for the current buffer.
 
 More commands can be added by configuring the variable
 `org-agenda-custom-commands'.  In particular, specific tags and TODO keyword
@@ -6480,11 +7040,18 @@ first press `1' to indicate that the agenda should be temporarily (until the
 next use of \\[org-agenda]) restricted to the current file."
   (interactive "P")
   (catch 'exit
-    (let ((restrict-ok (and buffer-file-name (org-mode-p)))
-         (bfn buffer-file-name)
-         (custom org-agenda-custom-commands)
-         c entry key type string)
+    (let* ((buf (current-buffer))
+          (bfn (buffer-file-name (buffer-base-buffer)))
+          (restrict-ok (and bfn (org-mode-p)))
+          (custom org-agenda-custom-commands)
+          c entry key type match lprops)
+      ;; Turn off restriction
       (put 'org-agenda-files 'org-restrict nil)
+      (setq org-agenda-restrict nil)
+      (move-marker org-agenda-restrict-begin nil)
+      (move-marker org-agenda-restrict-end nil)
+      ;; Remember where this call originated
+      (setq org-agenda-last-dispatch-buffer (current-buffer))
       (save-window-excursion
        (delete-other-windows)
        (switch-to-buffer-other-window " *Agenda Commands*")
@@ -6495,32 +7062,56 @@ next use of \\[org-agenda]) restricted to the current file."
 a   Agenda for current week or day
 t   List of all TODO entries             T   Entries with special TODO kwd
 m   Match a TAGS query                   M   Like m, but only TODO entries
-C   Configure your own agenda commands")
+L   Timeline for current buffer          C   Configure custom agenda commands")
        (while (setq entry (pop custom))
-         (setq key (car entry) type (nth 1 entry) string (nth 2 entry))
+         (setq key (car entry) type (nth 1 entry) match (nth 2 entry))
          (insert (format "\n%-4s%-14s: %s"
                          key
                          (cond
+                          ((stringp type) type)
                           ((eq type 'tags) "Tags query")
                           ((eq type 'todo) "TODO keyword")
                           ((eq type 'tags-tree) "Tags tree")
                           ((eq type 'todo-tree) "TODO kwd tree")
                           ((eq type 'occur-tree) "Occur tree")
                           (t "???"))
-                         (org-add-props string nil 'face 'org-warning))))
+                         (if (stringp match)
+                             (org-add-props match nil 'face 'org-warning)
+                           (format "set of %d commands" (+ -2 (length entry)))))))
+       (if restrict-ok
+           (insert "\n"
+                   (org-add-props "1   Restrict call to current buffer      0   Restrict call to region or subtree" nil 'face 'org-table)))
+
        (goto-char (point-min))
        (if (fboundp 'fit-window-to-buffer) (fit-window-to-buffer))
        (message "Press key for agenda command%s"
-                (if restrict-ok ", or [1] to restrict to current file" ""))
+                (if restrict-ok ", or [1] or [0] to restrict" ""))
        (setq c (read-char-exclusive))
        (message "")
-       (when (equal c ?1)
+       (when (memq c '(?L ?1 ?0))
          (if restrict-ok
              (put 'org-agenda-files 'org-restrict (list bfn))
            (error "Cannot restrict agenda to current buffer"))
-         (message "Press key for agenda command%s"
-                  (if restrict-ok " (restricted to current file)" ""))
-         (setq c (read-char-exclusive))
+         (with-current-buffer " *Agenda Commands*"
+           (goto-char (point-max))
+           (delete-region (point-at-bol) (point))
+           (goto-char (point-min)))
+         (when (eq c ?0)
+           (setq org-agenda-restrict t)
+           (with-current-buffer buf
+             (if (org-region-active-p)
+                 (progn
+                   (move-marker org-agenda-restrict-begin (region-beginning))
+                   (move-marker org-agenda-restrict-end (region-end)))
+               (save-excursion
+                 (org-back-to-heading t)
+                 (move-marker org-agenda-restrict-begin (point))
+                 (move-marker org-agenda-restrict-end
+                              (progn (org-end-of-subtree t)))))))
+         (unless (eq c ?L)
+           (message "Press key for agenda command%s"
+                    (if restrict-ok " (restricted to current file)" ""))
+           (setq c (read-char-exclusive)))
          (message "")))
       (require 'calendar)  ; FIXME: can we avoid this for some commands?
       ;; For example the todo list should not need it (but does...)
@@ -6531,28 +7122,87 @@ C   Configure your own agenda commands")
        ((equal c ?T) (org-call-with-arg 'org-todo-list (or arg '(4))))
        ((equal c ?m) (call-interactively 'org-tags-view))
        ((equal c ?M) (org-call-with-arg 'org-tags-view (or arg '(4))))
+       ((equal c ?L)
+       (unless restrict-ok
+         (error "This is not an Org-mode file"))
+       (org-call-with-arg 'org-timeline arg))
        ((setq entry (assoc (char-to-string c) org-agenda-custom-commands))
-       (setq type (nth 1 entry) string (nth 2 entry))
-       (cond
-        ((eq type 'tags)
-         (org-tags-view current-prefix-arg string))
-        ((eq type 'tags-todo)
-         (org-tags-view '(4) string))
-        ((eq type 'todo)
-         (org-todo-list string))
-        ((eq type 'tags-tree)
-         (org-check-for-org-mode)
-         (org-tags-sparse-tree current-prefix-arg string))
-        ((eq type 'todo-tree)
-         (org-check-for-org-mode)
-         (org-occur (concat "^" outline-regexp "[ \t]*"
-                            (regexp-quote string) "\\>")))
-        ((eq type 'occur-tree)
-         (org-check-for-org-mode)
-         (org-occur string))
-        (t (error "Invalid custom agenda command type %s" type))))
+       (if (symbolp (nth 1 entry))
+           (progn
+             (setq type (nth 1 entry) match (nth 2 entry) lprops (nth 3 entry)
+                   lprops (nth 3 entry))
+             (cond
+              ((eq type 'tags)
+               (org-let lprops '(org-tags-view current-prefix-arg match)))
+              ((eq type 'tags-todo)
+               (org-let lprops '(org-tags-view '(4) match)))
+              ((eq type 'todo)
+               (org-let lprops '(org-todo-list match)))
+              ((eq type 'tags-tree)
+               (org-check-for-org-mode)
+               (org-let lprops '(org-tags-sparse-tree current-prefix-arg match)))
+              ((eq type 'todo-tree)
+               (org-check-for-org-mode)
+               (org-let lprops
+                 '(org-occur (concat "^" outline-regexp "[ \t]*"
+                                     (regexp-quote match) "\\>"))))
+              ((eq type 'occur-tree)
+               (org-check-for-org-mode)
+               (org-let lprops '(org-occur match)))
+              (t (error "Invalid custom agenda command type %s" type))))
+         (org-run-agenda-series (cddr entry))))
        (t (error "Invalid key"))))))
 
+;; FIXME: what is the meaning of WINDOW?????
+(defun org-run-agenda-series (series &optional window)
+  (org-prepare-agenda)
+  (let* ((org-agenda-multi t)
+        (redo (list 'org-run-agenda-series (list 'quote series)))
+        (org-select-agenda-window t)
+        (cmds (car series))
+        (gprops (nth 1 series))
+        match ;; The byte compiler incorrectly complains about this.  Keep it!
+        cmd type lprops)
+    (while (setq cmd (pop cmds))
+      (setq type (car cmd) match (nth 1 cmd) lprops (nth 2 cmd))
+      (cond
+       ((eq type 'agenda)
+       (call-interactively 'org-agenda-list))
+       ((eq type 'alltodo)
+       (call-interactively 'org-todo-list))
+       ((eq type 'tags)
+       (org-let2 gprops lprops
+                 '(org-tags-view current-prefix-arg match)))
+       ((eq type 'tags-todo)
+       (org-let2 gprops lprops
+                 '(org-tags-view '(4) match)))
+       ((eq type 'todo)
+       (org-let2 gprops lprops
+                 '(org-todo-list match)))
+       (t (error "Invalid type in command series"))))
+    (widen)
+    (setq org-agenda-redo-command redo)
+    (goto-char (point-min)))
+  (org-finalize-agenda))
+
+;;;###autoload
+(defmacro org-batch-agenda (cmd-key &rest parameters)
+  "Run an agenda command in batch mode, send result to STDOUT.
+CMD-KEY is a string that is also a key in `org-agenda-custom-commands'.
+Paramters are alternating variable names and values that will be bound
+before running the agenda command."
+  (let (pars)
+    (while parameters
+      (push (list (pop parameters) (if parameters (pop parameters))) pars))
+    (flet ((read-char-exclusive () (string-to-char cmd-key)))
+      (eval (list 'let (nreverse pars) '(org-agenda nil))))
+    (set-buffer "*Org Agenda*")
+    (princ (buffer-string))))
+
+(defmacro org-no-read-only (&rest body)
+  "Inhibit read-only for BODY."
+  `(let ((inhibit-read-only t)) ,@body))
+
 (defun org-check-for-org-mode ()
   "Make sure current buffer is in org-mode.  Error if not."
   (or (org-mode-p)
@@ -6562,6 +7212,7 @@ C   Configure your own agenda commands")
 (defun org-fit-agenda-window ()
   "Fit the window to the buffer size."
   (and org-fit-agenda-window
+       (memq org-agenda-window-setup '(reorganize-frame))
        (fboundp 'fit-window-to-buffer)
        (fit-window-to-buffer nil (/ (* (frame-height) 3) 4)
                              (/ (frame-height) 2))))
@@ -6635,7 +7286,7 @@ no longer in use."
 
 (defun org-agenda-maybe-reset-markers (&optional force)
   "Reset markers created by `org-agenda'.  But only if they are old enough."
-  (if (or force
+  (if (or (and force (not org-agenda-multi))
          (> (- (time-to-seconds (current-time))
                org-agenda-last-marker-time)
             5))
@@ -6669,9 +7320,7 @@ When a buffer is unmodified, it is just killed.  When modified, it is saved
        (with-current-buffer buf (save-buffer)))
       (kill-buffer buf))))
 
-(defvar org-respect-restriction nil)    ; Dynamically-scoped param.
-
-(defun org-timeline (&optional include-all keep-modes)
+(defun org-timeline (&optional include-all)
   "Show a time-sorted view of the entries in the current org file.
 Only entries with a time stamp of today or later will be listed.  With
 \\[universal-argument] prefix, all unfinished TODO items will also be shown,
@@ -6680,14 +7329,12 @@ If the buffer contains an active region, only check the region for
 dates."
   (interactive "P")
   (require 'calendar)
-  (org-agenda-maybe-reset-markers 'force)
-  (org-compile-prefix-format org-timeline-prefix-format)
+  (org-compile-prefix-format 'timeline)
+  (org-set-sorting-strategy 'timeline)
   (let* ((dopast t)
         (dotodo include-all)
         (doclosed org-agenda-show-log)
-        (org-agenda-keep-modes keep-modes)
         (entry buffer-file-name)
-        (org-agenda-files (list buffer-file-name))
         (date (calendar-current-date))
         (win (selected-window))
         (pos1 (point))
@@ -6697,26 +7344,19 @@ dates."
                                         t doclosed ; always include today
                                         org-timeline-show-empty-dates))
         (today (time-to-days (current-time)))
-        (org-respect-restriction t)
         (past t)
         args
         s e rtn d emptyp)
-    (org-prepare-agenda-buffers org-agenda-files)
     (setq org-agenda-redo-command
          (list 'progn
                (list 'switch-to-buffer-other-window (current-buffer))
-               (list 'org-timeline (list 'quote include-all) t)))
+               (list 'org-timeline (list 'quote include-all))))
     (if (not dopast)
        ;; Remove past dates from the list of dates.
        (setq day-numbers (delq nil (mapcar (lambda(x)
                                              (if (>= x today) x nil))
                                            day-numbers))))
-    (switch-to-buffer-other-window
-     (get-buffer-create org-agenda-buffer-name))
-    (setq buffer-read-only nil)
-    (erase-buffer)
-    (org-agenda-mode) (setq buffer-read-only nil)
-    (org-set-local 'org-agenda-type 'timeline)
+    (org-prepare-agenda)
     (if doclosed (push :closed args))
     (push :timestamp args)
     (if dotodo (push :todo args))
@@ -6751,15 +7391,21 @@ dates."
              (and rtn (insert (org-finalize-agenda-entries rtn) "\n"))
              (put-text-property s (1- (point)) 'day d)))))
     (goto-char (point-min))
-    (setq buffer-read-only t)
     (goto-char (or (text-property-any (point-min) (point-max) 'org-today t)
                   (point-min)))
-    (when (not org-select-timeline-window)
+    (add-text-properties (point-min) (point-max) '(org-agenda-type timeline))
+    (org-finalize-agenda)
+    (setq buffer-read-only t)
+    (when (not org-select-agenda-window)
       (select-window win)
       (goto-char pos1))))
 
+(defvar org-agenda-overriding-arguments nil) ; dynamically scoped parameter
+(defvar org-agenda-last-arguments nil
+  "The arguments of the previous call to org-agenda")
+
 ;;;###autoload
-(defun org-agenda-list (&optional include-all start-day ndays keep-modes)
+(defun org-agenda-list (&optional include-all start-day ndays)
   "Produce a weekly view from all files in variable `org-agenda-files'.
 The view will be for the current week, but from the overview buffer you
 will be able to go to other weeks.
@@ -6772,14 +7418,18 @@ START-DAY defaults to TODAY, or to the most recent match for the weekday
 given in `org-agenda-start-on-weekday'.
 NDAYS defaults to `org-agenda-ndays'."
   (interactive "P")
-  (org-agenda-maybe-reset-markers 'force)
-  (org-compile-prefix-format org-agenda-prefix-format)
+  (if org-agenda-overriding-arguments
+      (setq include-all (car org-agenda-overriding-arguments)
+           start-day (nth 1 org-agenda-overriding-arguments)
+           ndays (nth 2 org-agenda-overriding-arguments)))
+  (setq org-agenda-last-arguments (list include-all start-day ndays))
+  (org-compile-prefix-format 'agenda)
+  (org-set-sorting-strategy 'agenda)
   (require 'calendar)
   (let* ((org-agenda-start-on-weekday
          (if (or (equal ndays 1)
                  (and (null ndays) (equal 1 org-agenda-ndays)))
              nil org-agenda-start-on-weekday))
-        (org-agenda-keep-modes keep-modes)
         (thefiles (org-agenda-files))
         (files thefiles)
         (win (selected-window))
@@ -6796,9 +7446,8 @@ NDAYS defaults to `org-agenda-ndays'."
         (day-numbers (list start))
         (inhibit-redisplay t)
         s e rtn rtnall file date d start-pos end-pos todayp nd)
-    (org-prepare-agenda-buffers files)
     (setq org-agenda-redo-command
-         (list 'org-agenda-list (list 'quote include-all) start-day ndays t))
+         (list 'org-agenda-list (list 'quote include-all) start-day ndays))
     ;; Make the list of days
     (setq ndays (or ndays org-agenda-ndays)
          nd ndays)
@@ -6806,15 +7455,7 @@ NDAYS defaults to `org-agenda-ndays'."
       (push (1+ (car day-numbers)) day-numbers)
       (setq ndays (1- ndays)))
     (setq day-numbers (nreverse day-numbers))
-    (if (not (equal (current-buffer) (get-buffer org-agenda-buffer-name)))
-       (progn
-         (delete-other-windows)
-         (switch-to-buffer-other-window
-          (get-buffer-create org-agenda-buffer-name))))
-    (setq buffer-read-only nil)
-    (erase-buffer)
-    (org-agenda-mode) (setq buffer-read-only nil)
-    (org-set-local 'org-agenda-type 'agenda)
+    (org-prepare-agenda)
     (org-set-local 'starting-day (car day-numbers))
     (org-set-local 'include-all-loc include-all)
     (when (and (or include-all org-agenda-include-all-todo)
@@ -6833,6 +7474,9 @@ NDAYS defaults to `org-agenda-ndays'."
        (add-text-properties (point-min) (1- (point))
                             (list 'face 'org-level-3))
        (insert (org-finalize-agenda-entries rtnall) "\n")))
+    (setq s (point))
+    (insert (if (= nd 7) "Week-" "Day-") "agenda:\n")
+    (add-text-properties s (1- (point)) (list 'face 'org-level-3))
     (while (setq d (pop day-numbers))
       (setq date (calendar-gregorian-from-absolute d)
            s (point))
@@ -6868,6 +7512,8 @@ NDAYS defaults to `org-agenda-ndays'."
                            (extract-calendar-year date)))
            (put-text-property s (1- (point)) 'face
                               'org-level-3)
+           (if todayp (put-text-property s (1- (point)) 'org-today t))
+
            (if rtnall (insert
                        (org-finalize-agenda-entries
                         (org-agenda-add-time-grid-maybe
@@ -6875,7 +7521,6 @@ NDAYS defaults to `org-agenda-ndays'."
                        "\n"))
            (put-text-property s (1- (point)) 'day d))))
     (goto-char (point-min))
-    (setq buffer-read-only t)
     (org-fit-agenda-window)
     (unless (and (pos-visible-in-window-p (point-min))
                 (pos-visible-in-window-p (point-max)))
@@ -6886,23 +7531,26 @@ NDAYS defaults to `org-agenda-ndays'."
            (goto-char (or start-pos 1))
            (recenter 1))))
     (goto-char (or start-pos 1))
+    (add-text-properties (point-min) (point-max) '(org-agenda-type agenda))
+    (org-finalize-agenda)
+    (setq buffer-read-only t)
     (if (not org-select-agenda-window) (select-window win))
     (message "")))
 
 (defvar org-select-this-todo-keyword nil)
 
 ;;;###autoload
-(defun org-todo-list (arg &optional keep-modes)
+(defun org-todo-list (arg)
   "Show all TODO entries from all agenda file in a single list.
 The prefix arg can be used to select a specific TODO keyword and limit
 the list to these.  When using \\[universal-argument], you will be prompted
 for a keyword.  A numeric prefix directly selects the Nth keyword in
 `org-todo-keywords'."
   (interactive "P")
-  (org-agenda-maybe-reset-markers 'force)
-  (org-compile-prefix-format org-agenda-prefix-format)
-  (let* ((org-agenda-keep-modes keep-modes)
-        (today (time-to-days (current-time)))
+  (require 'calendar)
+  (org-compile-prefix-format 'todo)
+  (org-set-sorting-strategy 'todo)
+  (let* ((today (time-to-days (current-time)))
         (date (calendar-gregorian-from-absolute today))
         (win (selected-window))
         (kwds org-todo-keywords)
@@ -6917,22 +7565,13 @@ for a keyword.  A numeric prefix directly selects the Nth keyword in
            (completing-read "Keyword: " (mapcar 'list org-todo-keywords)
                             nil t)))
     (and (equal 0 arg) (setq org-select-this-todo-keyword nil))
-    (if (not (equal (current-buffer) (get-buffer org-agenda-buffer-name)))
-       (progn
-         (delete-other-windows)
-         (switch-to-buffer-other-window
-          (get-buffer-create org-agenda-buffer-name))))
-    (setq buffer-read-only nil)
-    (erase-buffer)
-    (org-agenda-mode) (setq buffer-read-only nil)
-    (org-set-local 'org-agenda-type 'todo)
+    (org-prepare-agenda)
     (org-set-local 'last-arg arg)
     (org-set-local 'org-todo-keywords kwds)
-    (org-set-local 'org-agenda-redo-command
-                  '(org-todo-list (or current-prefix-arg last-arg) t))
+    (setq org-agenda-redo-command
+         '(org-todo-list (or current-prefix-arg last-arg)))
     (setq files (org-agenda-files)
          rtnall nil)
-    (org-prepare-agenda-buffers files)
     (while (setq file (pop files))
       (catch 'nextfile
        (org-check-agenda-file file)
@@ -6945,19 +7584,22 @@ for a keyword.  A numeric prefix directly selects the Nth keyword in
     (insert (or org-select-this-todo-keyword "ALL") "\n")
     (add-text-properties pos (1- (point)) (list 'face 'org-warning))
     (setq pos (point))
-    (insert
-     "Available with `N r': (0)ALL "
-     (let ((n 0))
-       (mapconcat (lambda (x)
-                   (format "(%d)%s" (setq n (1+ n)) x))
-                 org-todo-keywords " "))
-     "\n")
+    (unless org-agenda-multi
+      (insert
+       "Available with `N r': (0)ALL "
+       (let ((n 0))
+        (mapconcat (lambda (x)
+                     (format "(%d)%s" (setq n (1+ n)) x))
+                   org-todo-keywords " "))
+       "\n"))
     (add-text-properties pos (1- (point)) (list 'face 'org-level-3))
     (when rtnall
       (insert (org-finalize-agenda-entries rtnall) "\n"))
     (goto-char (point-min))
-    (setq buffer-read-only t)
     (org-fit-agenda-window)
+    (add-text-properties (point-min) (point-max) '(org-agenda-type todo))
+    (org-finalize-agenda)
+    (setq buffer-read-only t)
     (if (not org-select-agenda-window) (select-window win))))
 
 (defun org-check-agenda-file (file)
@@ -6987,7 +7629,12 @@ If ERROR is non-nil, throw an error, otherwise just return nil."
   (let ((buf (current-buffer)))
     (if (not (one-window-p)) (delete-window))
     (kill-buffer buf)
-    (org-agenda-maybe-reset-markers 'force)))
+    (org-agenda-maybe-reset-markers 'force))
+  ;; Maybe restore the pre-agenda window configuration.
+  (and org-agenda-restore-windows-after-quit
+       (not (eq org-agenda-window-setup 'other-frame))
+       org-pre-agenda-window-conf
+       (set-window-configuration org-pre-agenda-window-conf)))
 
 (defun org-agenda-exit ()
   "Exit agenda by removing the window or the buffer.
@@ -6998,7 +7645,6 @@ Org-mode buffers visited directly by the user will not be touched."
   (setq org-agenda-new-buffers nil)
   (org-agenda-quit))
 
-;; FIXME: move this function.
 (defun org-save-all-org-buffers ()
   "Save all Org-mode buffers without user confirmation."
   (interactive)
@@ -7010,48 +7656,73 @@ Org-mode buffers visited directly by the user will not be touched."
   "Rebuild Agenda.
 When this is the global TODO list, a prefix argument will be interpreted."
   (interactive)
-  (message "Rebuilding agenda buffer...")
-  (eval org-agenda-redo-command)
-  (message "Rebuilding agenda buffer...done"))
+  (let* ((org-agenda-keep-modes t)
+        (line (org-current-line))
+        (window-line (- line (org-current-line (window-start)))))
+    (message "Rebuilding agenda buffer...")
+    (eval org-agenda-redo-command)
+    (message "Rebuilding agenda buffer...done")
+    (goto-line line)
+    (recenter window-line)))
 
 (defun org-agenda-goto-today ()
   "Go to today."
   (interactive)
   (org-agenda-check-type t 'timeline 'agenda)
-  (if (boundp 'starting-day)
-      (let ((cmd (car org-agenda-redo-command))
-           (iall (nth 1 org-agenda-redo-command))
-           (nday (nth 3 org-agenda-redo-command))
-           (keep (nth 4 org-agenda-redo-command)))
-       (eval (list cmd iall nil nday keep)))
-    (goto-char (or (text-property-any (point-min) (point-max) 'org-today t)
-                  (point-min)))))
+  (let ((tdpos (text-property-any (point-min) (point-max) 'org-today t)))
+    (cond
+     (tdpos (goto-char tdpos))
+     ((eq org-agenda-type 'agenda)
+      (let ((org-agenda-overriding-arguments org-agenda-last-arguments))
+       (setf (nth 1 org-agenda-overriding-arguments) nil)
+       (org-agenda-redo)
+       (org-agenda-find-today-or-agenda)))
+     (t (error "Cannot find today")))))
+
+(defun org-agenda-find-today-or-agenda ()
+  (goto-char
+   (or (text-property-any (point-min) (point-max) 'org-today t)
+       (text-property-any (point-min) (point-max) 'org-agenda-type 'agenda)
+       (point-min))))
 
 (defun org-agenda-later (arg)
   "Go forward in time by `org-agenda-ndays' days.
 With prefix ARG, go forward that many times `org-agenda-ndays'."
   (interactive "p")
   (org-agenda-check-type t 'agenda)
-  (org-agenda-list (if (boundp 'include-all-loc) include-all-loc nil)
-                  (+ starting-day (* arg org-agenda-ndays)) nil t))
+  (let ((org-agenda-overriding-arguments
+        (list (car org-agenda-last-arguments)
+              (+ starting-day (* arg org-agenda-ndays))
+              nil t)))
+    (org-agenda-redo)
+    (org-agenda-find-today-or-agenda)))
 
 (defun org-agenda-earlier (arg)
   "Go back in time by `org-agenda-ndays' days.
 With prefix ARG, go back that many times `org-agenda-ndays'."
   (interactive "p")
   (org-agenda-check-type t 'agenda)
-  (org-agenda-list (if (boundp 'include-all-loc) include-all-loc nil)
-                  (- starting-day (* arg org-agenda-ndays)) nil t))
+  (let ((org-agenda-overriding-arguments
+        (list (car org-agenda-last-arguments)
+              (- starting-day (* arg org-agenda-ndays))
+              nil t)))
+    (org-agenda-redo)
+    (org-agenda-find-today-or-agenda)))
 
 (defun org-agenda-week-view ()
   "Switch to weekly view for agenda."
   (interactive)
   (org-agenda-check-type t 'agenda)
+  (if (= org-agenda-ndays 7)
+      (error "This is already the week view"))
   (setq org-agenda-ndays 7)
-  (org-agenda-list include-all-loc
-                  (or (get-text-property (point) 'day)
+  (let ((org-agenda-overriding-arguments
+        (list (car org-agenda-last-arguments)
+              (or (get-text-property (point) 'day)
                       starting-day)
-                  nil t)
+              nil t)))
+    (org-agenda-redo)
+    (org-agenda-find-today-or-agenda))
   (org-agenda-set-mode-name)
   (message "Switched to week view"))
 
@@ -7059,11 +7730,16 @@ With prefix ARG, go back that many times `org-agenda-ndays'."
   "Switch to daily view for agenda."
   (interactive)
   (org-agenda-check-type t 'agenda)
+  (if (= org-agenda-ndays 1)
+      (error "This is already the day view"))
   (setq org-agenda-ndays 1)
-  (org-agenda-list include-all-loc
-                  (or (get-text-property (point) 'day)
+  (let ((org-agenda-overriding-arguments
+        (list (car org-agenda-last-arguments)
+              (or (get-text-property (point) 'day)
                       starting-day)
-                  nil t)
+              nil t)))
+    (org-agenda-redo)
+    (org-agenda-find-today-or-agenda))
   (org-agenda-set-mode-name)
   (message "Switched to day view"))
 
@@ -7153,6 +7829,7 @@ With prefix ARG, go back that many times `org-agenda-ndays'."
 
 (defun org-agenda-post-command-hook ()
   (and (eolp) (not (bolp)) (backward-char 1))
+  (setq org-agenda-type (get-text-property (point) 'org-agenda-type))
   (if (and org-agenda-follow-mode
           (get-text-property (point) 'org-marker))
       (org-agenda-show)))
@@ -7251,6 +7928,7 @@ Needed to avoid empty dates which mess up holiday display."
       (error
        (add-to-diary-list original-date  "Org-mode dummy" "" nil)))))
 
+;;;###autoload
 (defun org-cycle-agenda-files ()
   "Cycle through the files in `org-agenda-files'.
 If the current buffer visits an agenda file, find the next one in the list.
@@ -7407,7 +8085,8 @@ The function expects the lisp variables `entry' and `date' to be provided
 by the caller, because this is how the calendar works.  Don't use this
 function from a program - use `org-agenda-get-day-entries' instead."
   (org-agenda-maybe-reset-markers)
-  (org-compile-prefix-format org-agenda-prefix-format)
+  (org-compile-prefix-format 'agenda)
+  (org-set-sorting-strategy 'agenda)
   (setq args (or args '(:deadline :scheduled :timestamp)))
   (let* ((files (if (and entry (stringp entry) (string-match "\\S-" entry))
                    (list entry)
@@ -7473,12 +8152,9 @@ the documentation of `org-diary'."
        (let ((case-fold-search nil))
          (save-excursion
            (save-restriction
-             (if org-respect-restriction
-                 (if (org-region-active-p)
-                     ;; Respect a region to restrict search
-                     (narrow-to-region (region-beginning) (region-end)))
-               ;; If we work for the calendar or many files,
-               ;; get rid of any restriction
+             (if org-agenda-restrict
+                 (narrow-to-region org-agenda-restrict-begin
+                                   org-agenda-restrict-end)
                (widen))
              ;; The way we repeatedly append to `results' makes it O(n^2) :-(
              (while (setq arg (pop args))
@@ -7510,20 +8186,20 @@ the documentation of `org-diary'."
     (and (re-search-backward "[\r\n]\\*" nil t)
         (looking-at org-nl-done-regexp))))
 
-(defun org-at-date-range-p ()
+(defun org-at-date-range-p (&optional inactive-ok)
   "Is the cursor inside a date range?"
   (interactive)
   (save-excursion
     (catch 'exit
       (let ((pos (point)))
-       (skip-chars-backward "^<\r\n")
-       (skip-chars-backward "<")
-       (and (looking-at org-tr-regexp)
+       (skip-chars-backward "^[<\r\n")
+       (skip-chars-backward "<[")
+       (and (looking-at (if inactive-ok org-tr-regexp-both org-tr-regexp))
             (>= (match-end 0) pos)
             (throw 'exit t))
-       (skip-chars-backward "^<\r\n")
-       (skip-chars-backward "<")
-       (and (looking-at org-tr-regexp)
+       (skip-chars-backward "^<[\r\n")
+       (skip-chars-backward "<[")
+       (and (looking-at (if inactive-ok org-tr-regexp-both org-tr-regexp))
             (>= (match-end 0) pos)
             (throw 'exit t)))
       nil)))
@@ -7544,17 +8220,25 @@ the documentation of `org-diary'."
                                     "\\)\\>")
                           org-not-done-regexp)
                         "[^\n\r]*\\)"))
-        (sched-re (concat ".*\n?.*?" org-scheduled-time-regexp))
+        (deadline-re (concat ".*\\(\n[^*].*\\)?" org-deadline-time-regexp))
+        (sched-re (concat ".*\\(\n[^*].*\\)?" org-scheduled-time-regexp))
+; FIXME why was this wrong?     (sched-re (concat ".*\n?.*?" org-scheduled-time-regexp))
         marker priority category tags
         ee txt)
     (goto-char (point-min))
     (while (re-search-forward regexp nil t)
       (catch :skip
-       (when (and org-agenda-todo-ignore-scheduled
-                  (looking-at sched-re))
-         ;; FIXME: the following test also happens below, but we need it here
-         (or org-agenda-todo-list-sublevels (org-end-of-subtree 'invisible))
-         (throw :skip nil))
+       (save-match-data
+         (beginning-of-line)
+         (when (or (and org-agenda-todo-ignore-scheduled
+                        (looking-at sched-re))
+                   (and org-agenda-todo-ignore-deadlines
+                        (looking-at deadline-re)
+                        (org-deadline-close (match-string 2))))
+
+           ;; FIXME: the following test also happens below, but we need it here
+           (or org-agenda-todo-list-sublevels (org-end-of-subtree 'invisible))
+           (throw :skip nil)))
        (org-agenda-skip)
        (goto-char (match-beginning 1))
        (setq marker (org-agenda-new-marker (1+ (match-beginning 0)))
@@ -7851,7 +8535,6 @@ the documentation of `org-diary'."
                'priority (org-get-priority txt) 'category category)
              (push txt ee)))
        (goto-char pos)))
-;      (outline-next-heading))) ;FIXME: correct to be removed??????
     ;; Sort the entries by expiration date.
     (nreverse ee)))
 
@@ -7890,7 +8573,8 @@ The flag is set if the currently compiled format contains a `%t'.")
   "A flag, set by `org-compile-prefix-format'.
 The flag is set if the currently compiled format contains a `%T'.")
 
-(defun org-format-agenda-item (extra txt &optional category tags dotime noprefix)
+(defun org-format-agenda-item (extra txt &optional category tags dotime
+                                    noprefix)
   "Format TXT to be inserted into the agenda buffer.
 In particular, it adds the prefix and corresponding text properties.  EXTRA
 must be a string and replaces the `%s' specifier in the prefix format.
@@ -7901,7 +8585,7 @@ time-of-day should be extracted from TXT for sorting of this entry, and for
 the `%t' specifier in the format.  When DOTIME is a string, this string is
 searched for a time before TXT is.  NOPREFIX is a flag and indicates that
 only the correctly processes TXT should be returned - this is used by
-`org-agenda-change-all-lines'.  TAG can be the tag of the headline."
+`org-agenda-change-all-lines'.  TAGS can be the tags of the headline."
   (save-match-data
     ;; Diary entries sometimes have extra whitespace at the beginning
     (if (string-match "^ +" txt) (setq txt (replace-match "" nil nil txt)))
@@ -7967,6 +8651,9 @@ only the correctly processes TXT should be returned - this is used by
        'time-of-day time-of-day
        'dotime dotime))))
 
+(defvar org-agenda-sorting-strategy)
+(defvar org-agenda-sorting-strategy-selected nil)
+
 (defun org-agenda-add-time-grid-maybe (list ndays todayp)
   (catch 'exit
     (cond ((not org-agenda-use-time-grid) (throw 'exit list))
@@ -7994,16 +8681,23 @@ only the correctly processes TXT should be returned - this is used by
                new)
          (put-text-property
           1 (length (car new)) 'face 'org-time-grid (car new))))
-      (if (member 'time-up org-agenda-sorting-strategy)
+      (if (member 'time-up org-agenda-sorting-strategy-selected)
          (append new list)
        (append list new)))))
 
-(defun org-compile-prefix-format (format)
+(defun org-compile-prefix-format (key)
   "Compile the prefix format into a Lisp form that can be evaluated.
 The resulting form is returned and stored in the variable
 `org-prefix-format-compiled'."
   (setq org-prefix-has-time nil org-prefix-has-tag nil)
-  (let ((start 0) varform vars var (s format)e c f opt)
+  (let ((s (cond
+           ((stringp org-agenda-prefix-format)
+            org-agenda-prefix-format)
+           ((assq key org-agenda-prefix-format)
+            (cdr (assq key org-agenda-prefix-format)))
+           (t "  %-12:c%?-12t% s")))
+       (start 0)
+       varform vars var e c f opt)
     (while (string-match "%\\(\\?\\)?\\([-+]?[0-9.]*\\)\\([ .;,:!?=|/<>]?\\)\\([cts]\\)"
                         s start)
       (setq var (cdr (assoc (match-string 4 s)
@@ -8026,6 +8720,15 @@ The resulting form is returned and stored in the variable
     (setq vars (nreverse vars))
     (setq org-prefix-format-compiled `(format ,s ,@vars))))
 
+(defun org-set-sorting-strategy (key)
+  (if (symbolp (car org-agenda-sorting-strategy))
+      ;; the old format
+      (setq org-agenda-sorting-strategy-selected org-agenda-sorting-strategy)
+    (setq org-agenda-sorting-strategy-selected
+         (or (cdr (assq key org-agenda-sorting-strategy))
+             (cdr (assq 'agenda org-agenda-sorting-strategy))
+             '(time-up category-keep priority-down)))))
+
 (defun org-get-time-of-day (s &optional string mod24)
   "Check string S for a time of day.
 If found, return it as a military time number between 0 and 2400.
@@ -8055,10 +8758,12 @@ HH:MM."
                        (int-to-string t0))))
        (if string (concat (substring t1 -4 -2) ":" (substring t1 -2)) t0)))))
 
-(defun org-finalize-agenda-entries (list)
+(defun org-finalize-agenda-entries (list &optional nosort)
   "Sort and concatenate the agenda items."
   (setq list (mapcar 'org-agenda-highlight-todo list))
-  (mapconcat 'identity (sort list 'org-entries-lessp) "\n"))
+  (if nosort
+      list
+    (mapconcat 'identity (sort list 'org-entries-lessp) "\n")))
 
 (defun org-agenda-highlight-todo (x)
   (let (re pl)
@@ -8066,14 +8771,14 @@ HH:MM."
        (save-excursion
          (beginning-of-line 1)
          (setq re (get-text-property (point) 'org-not-done-regexp))
-         (goto-char (+ (point) (get-text-property (point) 'prefix-length)))
-         (and (looking-at (concat "[ \t]*" re))
+         (goto-char (+ (point) (or (get-text-property (point) 'prefix-length) 0)))
+         (and (looking-at (concat "[ \t]*\\.*" re))
               (add-text-properties (match-beginning 0) (match-end 0)
                                    '(face org-todo))))
-      (setq re (get-text-property 0 'org-not-done-regexp x)
+      (setq re (concat (get-text-property 0 'org-not-done-regexp x))
            pl (get-text-property 0 'prefix-length x))
-      (and re (equal (string-match re x pl) pl)
-          (add-text-properties (match-beginning 0) (match-end 0)
+      (and re (equal (string-match (concat "\\(\\.*\\)" re) x (or pl 0)) pl)
+          (add-text-properties (or (match-end 1) (match-end 0)) (match-end 0)
                                '(face org-todo) x))
       x)))
 
@@ -8093,6 +8798,16 @@ HH:MM."
          ((string-lessp cb ca) +1)
          (t nil))))
 
+(defsubst org-cmp-tag (a b)
+  "Compare the string values of categories of strings A and B."
+  (let ((ta (car (last (get-text-property 1 'tags a))))
+       (tb (car (last (get-text-property 1 'tags b)))))
+    (cond ((not ta) +1)
+         ((not tb) -1)
+         ((string-lessp ta tb) -1)
+         ((string-lessp tb ta) +1)
+         (t nil))))
+
 (defsubst org-cmp-time (a b)
   "Compare the time-of-day values of strings A and B."
   (let* ((def (if org-sort-agenda-notime-is-late 9901 -1))
@@ -8111,9 +8826,11 @@ HH:MM."
         (priority-down (if priority-up (- priority-up) nil))
         (category-up (org-cmp-category a b))
         (category-down (if category-up (- category-up) nil))
-        (category-keep (if category-up +1 nil)))
+        (category-keep (if category-up +1 nil))
+        (tag-up (org-cmp-tag a b))
+        (tag-down (if tag-up (- tag-up) nil)))
     (cdr (assoc
-         (eval (cons 'or org-agenda-sorting-strategy))
+         (eval (cons 'or org-agenda-sorting-strategy-selected))
          '((-1 . t) (1 . nil) (nil . nil))))))
 
 (defun org-agenda-show-priority ()
@@ -8144,13 +8861,47 @@ and by additional input from the age of a schedules or deadline entry."
     (widen)
     (goto-char pos)
     (when (org-mode-p)
-      (org-show-hidden-entry)
+      (org-show-context 'agenda)
       (save-excursion
        (and (outline-next-heading)
             (org-flag-heading nil)))) ; show the next heading
     (and highlight (org-highlight (point-at-bol) (point-at-eol)))))
 
-(defun org-agenda-switch-to ()
+(defun org-agenda-kill ()
+  "Kill the entry or subtree belonging to the current agenda entry."
+  (interactive)
+  (let* ((marker (or (get-text-property (point) 'org-marker)
+                    (org-agenda-error)))
+        (hdmarker (get-text-property (point) 'org-hd-marker))
+        (buffer (marker-buffer marker))
+        (pos (marker-position marker))
+        dbeg dend txt n conf)
+    (with-current-buffer buffer
+      (save-excursion
+       (goto-char pos)
+       (if (org-mode-p)
+           (setq dbeg (progn (org-back-to-heading t) (point))
+                 dend (org-end-of-subtree t))
+         (setq dbeg (point-at-bol)
+               dend (min (point-max) (1+ (point-at-eol)))))
+       (setq txt (buffer-substring dbeg dend))))
+    (while (string-match "^[ \t]*\n" txt) (setq txt (replace-match "" t t txt)))
+    (setq n (length (split-string txt "\n"))
+         conf (or (eq t org-agenda-confirm-kill)
+                  (and (numberp org-agenda-confirm-kill)
+                       (> n org-agenda-confirm-kill))))
+    (and conf
+        (not (y-or-n-p
+              (format "Delete entry with %d lines in buffer \"%s\"? "
+                      n (buffer-name buffer))))
+        (error "Abort"))
+    ;; FIXME: if we kill an entire subtree, should we not find all
+    ;; lines coming from the subtree?
+    (save-excursion (org-agenda-change-all-lines "" hdmarker))
+    (with-current-buffer buffer (delete-region dbeg dend))
+    (message "Agenda item and source killed")))
+
+(defun org-agenda-switch-to (&optional delete-other-windows)
   "Go to the Org-mode file which contains the item at point."
   (interactive)
   (let* ((marker (or (get-text-property (point) 'org-marker)
@@ -8158,11 +8909,11 @@ and by additional input from the age of a schedules or deadline entry."
         (buffer (marker-buffer marker))
         (pos (marker-position marker)))
     (switch-to-buffer buffer)
-    (delete-other-windows)
+    (and delete-other-windows (delete-other-windows))
     (widen)
     (goto-char pos)
     (when (org-mode-p)
-      (org-show-hidden-entry)
+      (org-show-context 'agenda)
       (save-excursion
        (and (outline-next-heading)
             (org-flag-heading nil))))))  ; show the next heading
@@ -8223,7 +8974,7 @@ the same tree node, and the headline of the tree node in the Org-mode file."
     (with-current-buffer buffer
       (widen)
       (goto-char pos)
-      (org-show-hidden-entry)
+      (org-show-context 'agenda)
       (save-excursion
        (and (outline-next-heading)
             (org-flag-heading nil)))   ; show the next heading
@@ -8245,8 +8996,8 @@ The new content of the line will be NEWHEAD (as modified by
 `equal' against all `org-hd-marker' text properties in the file.
 If FIXFACE is non-nil, the face of each item is modified acording to
 the new TODO state."
-  (let* (props m pl undone-face done-face finish new dotime cat tags)
-;    (setq newhead (org-format-agenda-item "x" newhead "x" nil 'noprefix))
+  (let* ((buffer-read-only nil)
+        props m pl undone-face done-face finish new dotime cat tags)
     (save-excursion
       (goto-char (point-max))
       (beginning-of-line 1)
@@ -8263,21 +9014,39 @@ the new TODO state."
                undone-face (get-text-property (point) 'undone-face)
                done-face (get-text-property (point) 'done-face))
          (move-to-column pl)
-         (if (looking-at ".*")
-             (progn
-               (replace-match new t t)
-               (beginning-of-line 1)
-               (add-text-properties (point-at-bol) (point-at-eol) props)
-               (when fixface
-                 (add-text-properties
-                  (point-at-bol) (point-at-eol)
-                  (list 'face
-                        (if org-last-todo-state-is-todo
-                            undone-face done-face)))
-                 (org-agenda-highlight-todo 'line))
-               (beginning-of-line 1))
-           (error "Line update did not work")))
-       (beginning-of-line 0)))))
+         (cond
+          ((equal new "")
+           (beginning-of-line 1)
+           (and (looking-at ".*\n?") (replace-match "")))
+          ((looking-at ".*")
+           (replace-match new t t)
+           (beginning-of-line 1)
+           (add-text-properties (point-at-bol) (point-at-eol) props)
+           (when fixface
+             (add-text-properties
+              (point-at-bol) (point-at-eol)
+              (list 'face
+                    (if org-last-todo-state-is-todo
+                        undone-face done-face))))
+           (org-agenda-highlight-todo 'line)
+           (beginning-of-line 1))
+          (t (error "Line update did not work"))))
+       (beginning-of-line 0)))
+    (org-finalize-agenda)))
+
+(defun org-agenda-align-tags (&optional line)
+  "Align all tags in agenda items to `org-agenda-align-tags-to-column'."
+  (let ((buffer-read-only))
+    (save-excursion
+      (goto-char (if line (point-at-bol) (point-min)))
+      (while (re-search-forward "\\([ \t]+\\):[a-zA-Z0-9_@:]+:[ \t]*$"
+                               (if line (point-at-eol) nil) t)
+       (delete-region (match-beginning 1) (match-end 1))
+       (goto-char (match-beginning 1))
+       (insert (org-add-props
+                   (make-string (max 1 (- org-agenda-align-tags-to-column
+                                          (current-column))) ?\ )
+                   (text-properties-at (point))))))))
 
 (defun org-agenda-priority-up ()
   "Increase the priority of line at point, also in Org-mode file."
@@ -8305,7 +9074,7 @@ the same tree node, and the headline of the tree node in the Org-mode file."
     (with-current-buffer buffer
       (widen)
       (goto-char pos)
-      (org-show-hidden-entry)
+      (org-show-context 'agenda)
       (save-excursion
        (and (outline-next-heading)
             (org-flag-heading nil)))   ; show the next heading
@@ -8335,9 +9104,9 @@ the tags of the current headline come last."
              (or org-use-tag-inheritance (error ""))
              (org-up-heading-all 1))
          (error nil))))
-    (message "%s" tags)
     tags))
 
+;; FIXME: should fix the tags property of the agenda line.
 (defun org-agenda-set-tags ()
   "Set tags for the current headline."
   (interactive)
@@ -8352,7 +9121,7 @@ the tags of the current headline come last."
     (with-current-buffer buffer
       (widen)
       (goto-char pos)
-      (org-show-hidden-entry)
+      (org-show-context 'agenda)
       (save-excursion
        (and (outline-next-heading)
             (org-flag-heading nil)))   ; show the next heading
@@ -8564,7 +9333,7 @@ This is a command that has to be installed in `calendar-mode-map'."
   (interactive)
   (org-agenda-list nil (calendar-absolute-from-gregorian
                        (calendar-cursor-to-date))
-                  nil t))
+                  nil))
 
 (defun org-agenda-convert-date ()
   (interactive)
@@ -8606,15 +9375,17 @@ are included in the output."
                     (mapconcat 'regexp-quote
                                (nreverse (cdr (reverse org-todo-keywords)))
                                "\\|")
-                    "\\>\\)\\)? *\\(.*?\\)\\(:[A-Za-z_@0-9:]+:\\)?[ \t]*[\n\r]"))
+                    "\\>\\)\\)? *\\(.*?\\)\\(:[A-Za-z_@0-9:]+:\\)?[ \t]*$"))
         (props (list 'face nil
                      'done-face 'org-done
                      'undone-face nil
                      'mouse-face 'highlight
+                     'org-not-done-regexp org-not-done-regexp
                      'keymap org-agenda-keymap
                      'help-echo
                      (format "mouse-2 or RET jump to org file %s"
                              (abbreviate-file-name buffer-file-name))))
+        (case-fold-search nil)
          lspos
         tags tags-list tags-alist (llast 0) rtn level category i txt
         todo marker)
@@ -8652,7 +9423,7 @@ are included in the output."
            ;; list this headline
            (if (eq action 'sparse-tree)
                (progn
-                 (org-show-hierarchy-above))
+                 (org-show-context 'tags-tree))
              (setq txt (org-format-agenda-item
                         ""
                         (concat
@@ -8666,7 +9437,6 @@ are included in the output."
                'org-marker marker 'org-hd-marker marker 'category category)
              (push txt rtn))
            ;; if we are to skip sublevels, jump to end of subtree
-           (point)
            (or org-tags-match-list-sublevels (org-end-of-subtree t))))))
     (when (and (eq action 'sparse-tree)
               (not org-sparse-tree-open-archived-trees))
@@ -8674,52 +9444,89 @@ are included in the output."
     (nreverse rtn)))
 
 (defun org-tags-sparse-tree (&optional arg match)
-  "Create a sparse tree according to tags search string MATCH.
+  "Create a sparse tree according to tags  string MATCH.
 MATCH can contain positive and negative selection of tags, like
 \"+WORK+URGENT-WITHBOSS\"."
   (interactive "P")
-  (let ((org-show-following-heading nil)
-       (org-show-hierarchy-above nil))
-    (org-scan-tags 'sparse-tree (cdr (org-make-tags-matcher match)))))
+  (org-scan-tags 'sparse-tree (cdr (org-make-tags-matcher match))))
 
 (defun org-make-tags-matcher (match)
-  "Create the TAGS matcher form for the tags-selecting string MATCH."
+  "Create the TAGS//TODO matcher form for the selection string MATCH."
   (unless match
     ;; Get a new match request, with completion
     (setq org-last-tags-completion-table
-         (or (org-get-buffer-tags)
+         (or org-tag-alist
              org-last-tags-completion-table))
     (setq match (completing-read
-                "Tags: " 'org-tags-completion-function nil nil nil
-                'org-tags-history)))
-  ;; parse the string and create a lisp form
-  (let ((match0 match) minus tag mm matcher orterms term orlist)
-    (setq orterms (org-split-string match "|"))
-    (while (setq term (pop orterms))
-      (while (string-match "^&?\\([-+:]\\)?\\([A-Za-z_@0-9]+\\)" term)
-       (setq minus (and (match-end 1)
-                        (equal (match-string 1 term) "-"))
-             tag (match-string 2 term)
-             term (substring term (match-end 0))
-             mm (list 'member (downcase tag) 'tags-list)
-             mm (if minus (list 'not mm) mm))
-       (push mm matcher))
-      (push (if (> (length matcher) 1) (cons 'and matcher) (car matcher))
-           orlist)
-      (setq matcher nil))
-    (setq matcher (if (> (length orlist) 1) (cons 'or orlist) (car orlist)))
+                "Match: " 'org-tags-completion-function nil nil nil
+                'org-tags-history)))  ; FIXME: SHould we have a separate history for this?
+
+  ;; Parse the string and create a lisp form
+  (let ((match0 match) minus tag mm
+       tagsmatch todomatch tagsmatcher todomatcher kwd matcher
+       orterms term orlist)
+    (if (string-match "/+" match)
+       ;; match contains also a todo-matching request
+       (setq tagsmatch (substring match 0 (match-beginning 0))
+             todomatch (substring match (match-end 0)))
+      ;; only matching tags
+      (setq tagsmatch match todomatch nil))
+
+    ;; Make the tags matcher
+    (if (or (not tagsmatch) (not (string-match "\\S-" tagsmatch)))
+       (setq tagsmatcher t)
+      (setq orterms (org-split-string tagsmatch "|") orlist nil)
+      (while (setq term (pop orterms))
+       (while (string-match "^&?\\([-+:]\\)?\\([A-Za-z_@0-9]+\\)" term)
+         (setq minus (and (match-end 1)
+                          (equal (match-string 1 term) "-"))
+               tag (match-string 2 term)
+               term (substring term (match-end 0))
+               mm (list 'member (downcase tag) 'tags-list)
+               mm (if minus (list 'not mm) mm))
+         (push mm tagsmatcher))
+       (push (if (> (length tagsmatcher) 1)
+                 (cons 'and tagsmatcher)
+               (car tagsmatcher))
+             orlist)
+       (setq tagsmatcher nil))
+      (setq tagsmatcher (if (> (length orlist) 1) (cons 'or orlist) (car orlist))))
+
+    ;; Make the todo matcher ;; FIXME: reduce syntax richness?
+    (if (or (not todomatch) (not (string-match "\\S-" todomatch)))
+       (setq todomatcher t)
+      (setq orterms (org-split-string todomatch "|") orlist nil)
+      (while (setq term (pop orterms))
+       (while (string-match "^&?\\([-+:]\\)?\\([A-Za-z_@0-9]+\\)" term)
+         (setq minus (and (match-end 1)
+                          (equal (match-string 1 term) "-"))
+               kwd (match-string 2 term)
+               term (substring term (match-end 0))
+               mm (list 'equal 'todo kwd)
+               mm (if minus (list 'not mm) mm))
+         (push mm todomatcher))
+       (push (if (> (length todomatcher) 1)
+                 (cons 'and todomatcher)
+               (car todomatcher))
+             orlist)
+       (setq todomatcher nil))
+      (setq todomatcher (if (> (length orlist) 1)
+                           (cons 'or orlist) (car orlist))))
+
     ;; Return the string and lisp forms of the matcher
+    (setq matcher (if todomatcher
+                     (list 'and tagsmatcher todomatcher)
+                   tagsmatcher))
     (cons match0 matcher)))
 
 ;;;###autoload
-(defun org-tags-view (&optional todo-only match keep-modes)
+(defun org-tags-view (&optional todo-only match)
   "Show all headlines for all `org-agenda-files' matching a TAGS criterion.
 The prefix arg TODO-ONLY limits the search to TODO entries."
   (interactive "P")
-  (org-agenda-maybe-reset-markers 'force)
-  (org-compile-prefix-format org-agenda-prefix-format)
-  (let* ((org-agenda-keep-modes keep-modes)
-        (org-tags-match-list-sublevels
+  (org-compile-prefix-format 'tags)
+  (org-set-sorting-strategy 'tags)
+  (let* ((org-tags-match-list-sublevels
          (if todo-only t org-tags-match-list-sublevels))
         (win (selected-window))
         (completion-ignore-case t)
@@ -8727,21 +9534,12 @@ The prefix arg TODO-ONLY limits the search to TODO entries."
         buffer)
     (setq matcher (org-make-tags-matcher match)
          match (car matcher) matcher (cdr matcher))
-    (if (not (equal (current-buffer) (get-buffer org-agenda-buffer-name)))
-       (progn
-         (delete-other-windows)
-         (switch-to-buffer-other-window
-          (get-buffer-create org-agenda-buffer-name))))
-    (setq buffer-read-only nil)
-    (erase-buffer)
-    (org-agenda-mode) (setq buffer-read-only nil)
-    (org-set-local 'org-agenda-type 'tags)
-    (org-set-local 'org-agenda-redo-command
-                  (list 'org-tags-view (list 'quote todo-only)
-                        (list 'if 'current-prefix-arg nil match) t))
+    (org-prepare-agenda)
+    (setq org-agenda-redo-command
+         (list 'org-tags-view (list 'quote todo-only)
+               (list 'if 'current-prefix-arg nil match)))
     (setq files (org-agenda-files)
          rtnall nil)
-    (org-prepare-agenda-buffers files)
     (while (setq file (pop files))
       (catch 'nextfile
        (org-check-agenda-file file)
@@ -8759,12 +9557,9 @@ The prefix arg TODO-ONLY limits the search to TODO entries."
            (setq org-category-table (org-get-category-table))
            (save-excursion
              (save-restriction
-               (if org-respect-restriction
-                   (if (org-region-active-p)
-                       ;; Respect a region to restrict search
-                       (narrow-to-region (region-beginning) (region-end)))
-                 ;; If we work for the calendar or many files,
-                 ;; get rid of any restriction
+               (if org-agenda-restrict
+                   (narrow-to-region org-agenda-restrict-begin
+                                     org-agenda-restrict-end)
                  (widen))
                (setq rtn (org-scan-tags 'agenda matcher todo-only))
                (setq rtnall (append rtnall rtn))))))))
@@ -8775,33 +9570,41 @@ The prefix arg TODO-ONLY limits the search to TODO entries."
     (insert match "\n")
     (add-text-properties pos (1- (point)) (list 'face 'org-warning))
     (setq pos (point))
-    (insert "Press `C-u r' to search again with new search string\n")
+    (unless org-agenda-multi
+      (insert "Press `C-u r' to search again with new search string\n"))
     (add-text-properties pos (1- (point)) (list 'face 'org-level-3))
     (when rtnall
-      (insert (mapconcat 'identity rtnall "\n")))
+      (insert (org-finalize-agenda-entries rtnall) "\n"))
     (goto-char (point-min))
-    (setq buffer-read-only t)
     (org-fit-agenda-window)
+    (add-text-properties (point-min) (point-max) '(org-agenda-type tags))
+    (org-finalize-agenda)
+    (setq buffer-read-only t)
     (if (not org-select-agenda-window) (select-window win))))
 
 (defvar org-add-colon-after-tag-completion nil)  ;; dynamically skoped param
+(defvar org-tags-overlay (org-make-overlay 1 1))
+(org-detach-overlay org-tags-overlay)
+
 (defun org-set-tags (&optional arg just-align)
   "Set the tags for the current headline.
 With prefix ARG, realign all tags in headings in the current buffer."
   (interactive "P")
   (let* ((re (concat "^" outline-regexp))
-        (col (current-column))
         (current (org-get-tags))
         table current-tags inherited-tags ; computed below when needed
-        tags hd empty invis)
+        tags p0 c0 c1 rpl)
     (if arg
        (save-excursion
          (goto-char (point-min))
-         (while (re-search-forward re nil t)
-           (org-set-tags nil t))
+         (let (buffer-invisibility-spec)  ; Emacs 21 compatibility
+           (while (re-search-forward re nil t)
+             (org-set-tags nil t)
+             (end-of-line 1)))
          (message "All tags realigned to column %d" org-tags-column))
       (if just-align
          (setq tags current)
+       ;; Get a new set of tags from the user
        (setq table (or org-tag-alist (org-get-buffer-tags))
              org-last-tags-completion-table table
              current-tags (org-split-string current ":")
@@ -8814,40 +9617,35 @@ With prefix ARG, realign all tags in headings in the current buffer."
                           (delq nil (mapcar 'cdr table))))
                  (org-fast-tag-selection current-tags inherited-tags table)
                (let ((org-add-colon-after-tag-completion t))
-                 (completing-read "Tags: " 'org-tags-completion-function
-                                  nil nil current 'org-tags-history))))
+                 (org-trim
+                  (completing-read "Tags: " 'org-tags-completion-function
+                                   nil nil current 'org-tags-history)))))
        (while (string-match "[-+&]+" tags)
+         ;; No boolean logic, just a list
          (setq tags (replace-match ":" t t tags))))
-      
-      (unless (setq empty (string-match "\\`[\t ]*\\'" tags))
+      (if (string-match "\\`[\t ]*\\'" tags)
+          (setq tags "")
        (unless (string-match ":$" tags) (setq tags (concat tags ":")))
        (unless (string-match "^:" tags) (setq tags (concat ":" tags))))
-      (if (equal current "")
+
+      ;; Insert new tags at the correct column
+      (beginning-of-line 1)
+      (if (re-search-forward
+          (concat "\\([ \t]*" (regexp-quote current) "\\)[ \t]*$")
+          (point-at-eol) t)
          (progn
-           (end-of-line 1)
-           (or empty (insert-before-markers " ")))
-       (beginning-of-line 1)
-       (setq invis (org-invisible-p))
-       (looking-at (concat "\\(.*\\)\\(" (regexp-quote current) "\\)[ \t]*"))
-       (setq hd (match-string 1))
-       (delete-region (match-beginning 0) (match-end 0))
-       (insert-before-markers (org-trim hd) (if empty "" " ")))
-      (if (equal tags "")
-         (save-excursion
-           (beginning-of-line 1)
-           (skip-chars-forward "*")
-           (if (= (char-after) ?\ ) (forward-char 1))
-           (and (re-search-forward "[ \t]+$" (point-at-eol) t)
-                (replace-match "")))
-       (move-to-column (max (current-column)
-                            (if (> org-tags-column 0)
-                                org-tags-column
-                              (- (- org-tags-column) (length tags))))
-                       t)
-       (insert-before-markers tags)
-       (if (and (not invis) (org-invisible-p))
-           (outline-flag-region (point-at-bol) (point) nil)))
-      (move-to-column col))))
+           (if (equal tags "")
+               (setq rpl "")
+             (goto-char (match-beginning 0))
+             (setq c0 (current-column) p0 (point)
+                   c1 (max (1+ c0) (if (> org-tags-column 0)
+                                       org-tags-column
+                                     (- (- org-tags-column) (length tags))))
+                   rpl (concat (make-string (max 0 (- c1 c0)) ?\ ) tags)))
+           (replace-match rpl)
+           (and (not (featurep 'xemacs)) c0 (tabify p0 (point)))
+           tags)
+       (error "Tags alignment failed")))))
 
 (defun org-tags-completion-function (string predicate &optional flag)
   (let (s1 s2 rtn (ctable org-last-tags-completion-table)
@@ -8881,6 +9679,24 @@ With prefix ARG, realign all tags in headings in the current buffer."
          (org-add-props (mapconcat 'identity tags " ") nil 'face face)
          (or end "")))
 
+(defun org-fast-tag-show-exit (flag)
+  (save-excursion
+    (goto-line 3)
+    (if (re-search-forward "[ \t]+Next change exits" (point-at-eol) t)
+       (replace-match ""))
+    (when flag
+      (end-of-line 1)
+      (move-to-column (- (window-width) 19) t)
+      (insert (org-add-props " Next change exits" nil 'face 'org-warning)))))
+
+(defun org-set-current-tags-overlay (current prefix)
+  (let ((s (concat ":" (mapconcat 'identity current ":") ":")))
+    (if (featurep 'xemacs)
+       (org-overlay-display org-tags-overlay (concat prefix s)
+                            'secondary-selection)
+      (put-text-property 0 (length s) 'face '(secondary-selection org-tag) s)
+      (org-overlay-display org-tags-overlay (concat prefix s)))))
+
 (defun org-fast-tag-selection (current inherited table)
   "Fast tag selection with single keys.
 CURRENT is the current list of tags in the headline, INHERITED is the
@@ -8892,19 +9708,42 @@ Returns the new tags string, or nil to not change the current settings."
                              (lambda (x)
                                (if (stringp (car x)) (string-width (car x)) 0))
                              table)))
+        (buf (current-buffer))
+        (buffer-tags nil)
         (fwidth (+ maxlen 3 1 3))
         (ncol (/ (- (window-width) 4) fwidth))
         (i-face 'org-done)
         (c-face 'org-tag)
         tg cnt e c char c1 c2 ntable tbl rtn
+        ov-start ov-end ov-prefix
+        (exit-after-next org-fast-tag-selection-single-key)
         groups ingroup)
+    (save-excursion
+      (beginning-of-line 1)
+      (if (looking-at ".*[ \t]\\(:[A-Za-z_@0-9:]+:\\)[ \t]*\\(\r\\|$\\)")
+         (setq ov-start (match-beginning 1)
+               ov-end (match-end 1)
+               ov-prefix "")
+       (setq ov-start (1- (point-at-eol))
+             ov-end (1+ ov-start))
+       (skip-chars-forward "^\n\r")
+       (setq ov-prefix
+             (concat
+              (buffer-substring (1- (point)) (point))
+              (if (> (current-column) org-tags-column)
+                  " "
+                (make-string (- org-tags-column (current-column)) ?\ ))))))
+    (org-move-overlay org-tags-overlay ov-start ov-end)
     (save-window-excursion
+      ;; FIXME: would it be better to keep the other windows?
       (delete-other-windows)
       (split-window-vertically)
       (switch-to-buffer-other-window (get-buffer-create " *Org tags*"))
       (erase-buffer)
       (org-fast-tag-insert "Inherited" inherited i-face "\n")
       (org-fast-tag-insert "Current" current c-face "\n\n")
+      (org-fast-tag-show-exit exit-after-next)
+      (org-set-current-tags-overlay current ov-prefix)
       (setq tbl table char ?a cnt 0)
       (while (setq e (pop tbl))
        (cond
@@ -8951,19 +9790,39 @@ Returns the new tags string, or nil to not change the current settings."
       (setq rtn
            (catch 'exit
              (while t
-               (message "[key]:Toggle  SPC: clear current  RET accept%s"
-                        (if groups "  [!] ignore goups" ""))
-               (setq c (read-char-exclusive))
+               (message "[a-z..]:Toggle [SPC]:clear [RET]:accept [TAB]:free [C-c]: multi%s"
+                        (if groups "  [!] no groups" ""))
+               (setq c (let ((inhibit-quit t)) (read-char-exclusive)))
                (cond
                 ((= c ?\r) (throw 'exit t))
                 ((= c ?!)
                  (setq groups nil)
                  (goto-char (point-min))
                  (while (re-search-forward "[{}]" nil t) (replace-match " ")))
+                ((= c ?\C-c)
+                 (org-fast-tag-show-exit
+                  (setq exit-after-next (not exit-after-next))))
                 ((or (= c ?\C-g)
                      (and (= c ?q) (not (rassoc c ntable))))
+                 (org-detach-overlay org-tags-overlay)
                  (setq quit-flag t))
-                ((= c ?\ ) (setq current nil))
+                ((= c ?\ )
+                 (setq current nil)
+                 (if exit-after-next (setq exit-after-next 'now)))
+                ((= c ?\t)
+                 (condition-case nil
+                     (setq tg (completing-read
+                               "Tag: "
+                               (or buffer-tags
+                                   (with-current-buffer buf
+                                     (org-get-buffer-tags)))))
+                   (quit (setq tg "")))
+                 (when (string-match "\\S-" tg)
+                   (add-to-list 'buffer-tags (list tg))
+                   (if (member tg current)
+                       (setq current (delete tg current))
+                     (push tg current)))
+                 (if exit-after-next (setq exit-after-next 'now)))
                 ((setq e (rassoc c ntable) tg (car e))
                  (if (member tg current)
                      (setq current (delete tg current))
@@ -8972,16 +9831,20 @@ Returns the new tags string, or nil to not change the current settings."
                              (mapcar (lambda (x)
                                        (setq current (delete x current)))
                                      g)))
-                   (setq current (cons tg current)))))
+                   (push tg current))
+                 (if exit-after-next (setq exit-after-next 'now))))
+
                ;; Create a sorted list
                (setq current
                      (sort current
                            (lambda (a b)
                              (assoc b (cdr (memq (assoc a ntable) ntable))))))
+               (if (eq exit-after-next 'now) (throw 'exit t))
                (goto-char (point-min))
                (beginning-of-line 2)
                (delete-region (point) (point-at-eol))
                (org-fast-tag-insert "Current" current c-face)
+               (org-set-current-tags-overlay current ov-prefix)
                (while (re-search-forward "\\[.\\] \\([a-zA-Z0-9_@]+\\)" nil t)
                  (setq tg (match-string 1))
                  (add-text-properties (match-beginning 1) (match-end 1)
@@ -8991,13 +9854,14 @@ Returns the new tags string, or nil to not change the current settings."
                                              ((member tg inherited) i-face)
                                              (t nil)))))
                (goto-char (point-min)))))
+      (org-detach-overlay org-tags-overlay)
       (if rtn
          (mapconcat 'identity current ":")
        nil))))
 
 (defun org-get-tags ()
   "Get the TAGS string in the current headline."
-  (unless (org-on-heading-p)
+  (unless (org-on-heading-p t)
     (error "Not on a heading"))
   (save-excursion
     (beginning-of-line 1)
@@ -9077,6 +9941,7 @@ the window configuration before `org-open-at-point' was called using:
   "The window configuration before following a link.
 This is saved in case the need arises to restore it.")
 
+;; FIXME: IN-EMACS is used for many purposes, maybe rename this argument???
 (defun org-open-at-point (&optional in-emacs)
   "Open link at or after point.
 If there is no link at point, this function will search forward up to
@@ -9086,10 +9951,8 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file."
   (interactive "P")
   (setq org-window-config-before-follow-link (current-window-configuration))
   (org-remove-occur-highlights nil nil t)
-  (if (org-at-timestamp-p)
-      (org-agenda-list nil (time-to-days (org-time-string-to-time
-                                         (substring (match-string 1) 0 10)))
-                      1)
+  (if (org-at-timestamp-p t)
+      (org-follow-timestamp-link)
     (let (type path link line search (pos (point)))
       (catch 'match
        (save-excursion
@@ -9101,6 +9964,7 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file."
            (setq link (org-link-unescape (org-match-string-no-properties 1)))
            (while (string-match " *\n *" link)
              (setq link (replace-match " " t t link)))
+           (setq link (org-link-expand-abbrev link))
            (if (string-match org-link-re-with-space2 link)
                (setq type (match-string 1 link)
                      path (match-string 2 link))
@@ -9153,14 +10017,35 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file."
 
       (cond
 
-       ((member type '("http" "https" "ftp" "mailto" "news"))
+       ((equal type "mailto")
+       (let ((cmd (car org-link-mailto-program))
+             (args (cdr org-link-mailto-program)) args1
+             (address path) (subject "") a)
+         (if (string-match "\\(.*\\)::\\(.*\\)" path)
+             (setq address (match-string 1 path)
+                   subject (org-link-escape (match-string 2 path))))
+         (while args
+           (cond
+            ((not (stringp (car args))) (push (pop args) args1))
+            (t (setq a (pop args))
+               (if (string-match "%a" a)
+                   (setq a (replace-match address t t a)))
+               (if (string-match "%s" a)
+                   (setq a (replace-match subject t t a)))
+               (push a args1))))
+         (apply cmd (nreverse args1))))
+
+       ((member type '("http" "https" "ftp" "news"))
        (browse-url (concat type ":" path)))
 
        ((string= type "tags")
        (org-tags-view in-emacs path))
        ((or (string= type "camel")
            (string= type "thisfile"))
-       (org-mark-ring-push)
+       (if in-emacs
+           (switch-to-buffer-other-window
+            (org-get-buffer-for-internal-link (current-buffer)))
+         (org-mark-ring-push))
        (org-link-search
         path
         (cond ((equal in-emacs '(4)) 'occur)
@@ -9228,9 +10113,9 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file."
 
        ((string= type "shell")
        (let ((cmd path))
-         (while (string-match "@{" cmd)
+         (while (string-match "@{" cmd) ; FIXME: not needed for [[]] links
            (setq cmd (replace-match "<" t t cmd)))
-         (while (string-match "@}" cmd)
+         (while (string-match "@}" cmd) ; FIXME: not needed for [[]] links
            (setq cmd (replace-match ">" t t cmd)))
          (if (or (not org-confirm-shell-link-function)
                  (funcall org-confirm-shell-link-function
@@ -9255,6 +10140,23 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file."
        (t
        (browse-url-at-point))))))
 
+(defun org-link-expand-abbrev (link)
+  "Apply replacements as defined in `org-link-abbrev-alist."
+  (if (string-match "^\\([a-zA-Z]+\\)\\(::\\(.*\\)\\)?$" link)
+      (let* ((key (match-string 1 link))
+            (as (or (assoc key org-link-abbrev-alist-local)
+                    (assoc key org-link-abbrev-alist)))
+            (tag (and (match-end 2) (match-string 3 link)))
+            rpl)
+       (if (not as)
+           link
+         (setq rpl (cdr as))
+         (cond
+          ((symbolp rpl) (funcall rpl tag))
+          ((string-match "%s" rpl) (replace-match (or tag "") t t rpl))
+          (t (concat rpl tag)))))
+    link))
+
 (defun org-link-search (s &optional type)
   "Search for a link search option.
 When S is a CamelCaseWord, search for a target, or for a sentence containing
@@ -9339,7 +10241,7 @@ in all files."
       (if (search-forward s nil t)
          (goto-char (match-beginning 0))
        (error "No match"))))
-    (and (org-mode-p) (org-show-hierarchy-above))))
+    (and (org-mode-p) (org-show-context 'link-search))))
 
 (defun org-search-not-link (&rest args)
   "Execute `re-search-forward', but only accept matches that are not a link."
@@ -9356,6 +10258,22 @@ in all files."
                   (throw 'exit (point)))
          (goto-char (match-end 0)))))))
 
+(defun org-get-buffer-for-internal-link (buffer)
+  "Return a buffer to be used for displaying the link target of internal links."
+  (cond
+   ((not org-display-internal-link-with-indirect-buffer)
+    buffer)
+   ((string-match "(Clone)$" (buffer-name buffer))
+    (message "Buffer is already a clone, not making another one")
+    ;; we also do not modify visibility in this case
+    buffer)
+   (t ; make a new indirect buffer for displaying the link
+    (let* ((bn (buffer-name buffer))
+          (ibn (concat bn "(Clone)"))
+          (ib (or (get-buffer ibn) (make-indirect-buffer buffer ibn 'clone))))
+      (with-current-buffer ib (org-overview))
+      ib))))
+
 (defun org-do-occur (regexp &optional cleanup)
   "Call the Emacs command `occur'.
 If CLEANUP is non-nil, remove the printout of the regular expression
@@ -9414,7 +10332,7 @@ onto the ring."
     (setq m (car p))
     (switch-to-buffer (marker-buffer m))
     (goto-char m)
-    (if (or (org-invisible-p) (org-invisible-p2)) (org-show-hierarchy-above))))
+    (if (or (org-invisible-p) (org-invisible-p2)) (org-show-context 'mark-goto))))
 
 (defun org-camel-to-words (s)
   "Split \"CamelCaseWords\" to (\"Camel\" \"Case\" \"Words\")."
@@ -9434,6 +10352,22 @@ onto the ring."
   (if (equal (substring s -1) ">") nil (setq s (concat s ">")))
   s)
 
+(defun org-follow-timestamp-link ()
+  (cond
+   ((org-at-date-range-p t)
+    (let ((org-agenda-start-on-weekday)
+         (t1 (match-string 1))
+         (t2 (match-string 2)))
+      (setq t1 (time-to-days (org-time-string-to-time t1))
+           t2 (time-to-days (org-time-string-to-time t2)))
+      (org-agenda-list nil t1 (1+ (- t2 t1)))))
+   ((org-at-timestamp-p t)
+    (org-agenda-list nil (time-to-days (org-time-string-to-time
+                                       (substring (match-string 1) 0 10)))
+                    1))
+   (t (error "This should not happen"))))
+
+
 (defun org-follow-bbdb-link (name)
   "Follow a BBDB link to NAME."
   (require 'bbdb)
@@ -9745,7 +10679,7 @@ If the file does not exist, an error is thrown."
   (setq in-emacs (or in-emacs line search))
   (let* ((file (if (equal path "")
                   buffer-file-name
-                path))
+                (substitute-in-file-name (expand-file-name path))))
         (apps (append org-file-apps (org-default-apps)))
         (remp (and (assq 'remote apps) (org-file-remote-p file)))
         (dirp (if remp nil (file-directory-p file)))
@@ -9778,10 +10712,10 @@ If the file does not exist, an error is thrown."
        (error "No such file: %s" file))
     (cond
      ((and (stringp cmd) (not (string-match "^\\s-*$" cmd)))
-      ;; Normalize use of quote, this can vary.
+      ;; Remove quotes around the file name - we'll use shell-quote-argument.
       (if (string-match "['\"]%s['\"]" cmd)
-         (setq cmd (replace-match "'%s'" t t cmd)))
-      (setq cmd (format cmd file))
+         (setq cmd (replace-match "%s" t t cmd)))
+      (setq cmd (format cmd (shell-quote-argument file)))
       (save-window-excursion
        (shell-command (concat cmd " &"))))
      ((or (stringp cmd)
@@ -9812,6 +10746,7 @@ If the file does not exist, an error is thrown."
   "Replace special path abbreviations and expand the file name."
   (expand-file-name path))
 
+(defvar ange-ftp-name-format) ; to silence the XEmacs compiler.
 (defun org-file-remote-p (file)
   "Test whether FILE specifies a location on a remote system.
 Return non-nil if the location is indeed remote.
@@ -9936,6 +10871,7 @@ For file links, arg negates `org-context-in-file-links'."
              link (org-make-link cpltxt))))
 
      ((memq major-mode '(gnus-summary-mode gnus-article-mode))
+      (require 'gnus-sum)
       (and (eq major-mode 'gnus-article-mode) (gnus-article-show-summary))
       (gnus-summary-beginning-of-article)
       (let* ((group (car gnus-article-current))
@@ -9971,9 +10907,17 @@ For file links, arg negates `org-context-in-file-links'."
      ((eq major-mode 'image-mode)
       (setq cpltxt (concat "file:"
                           (abbreviate-file-name buffer-file-name))
-           link (org-make-link cpltxt)))      
+           link (org-make-link cpltxt)))
+
+     ((eq major-mode 'dired-mode)
+      ;; link to the file in the current line
+      (setq cpltxt (concat "file:"
+                          (abbreviate-file-name
+                           (expand-file-name
+                            (dired-get-filename nil t))))
+           link (org-make-link cpltxt)))
 
-     ((org-mode-p)
+     ((and buffer-file-name (org-mode-p))
       ;; Just link to current headline
       (setq cpltxt (concat "file:"
                           (abbreviate-file-name buffer-file-name)))
@@ -10248,7 +11192,8 @@ With three \\[universal-argument] prefixes, negate the meaning of
 
     ;; Check if we are linking to the current file with a search option
     ;; If yes, simplify the link by using only the search option.
-    (when (string-match "\\<file:\\(.+?\\)::\\([^>]+\\)" link)
+    (when (and buffer-file-name
+              (string-match "\\<file:\\(.+?\\)::\\([^>]+\\)" link))
       (let* ((path (match-string 1 link))
             (case-fold-search nil)
             (search (match-string 2 link)))
@@ -10455,7 +11400,7 @@ See also the variable `org-reverse-note-order'."
                     (outline-end-of-subtree))
                   (if (not (bolp)) (newline))
                   (beginning-of-line 1)
-                  (org-paste-subtree (1+ level) txt))
+                  (org-paste-subtree (org-get-legal-level level 1) txt))
                  (t
                   ;; Put it right there, with automatic level determined by
                   ;; org-paste-subtree or from prefix arg
@@ -10608,7 +11553,7 @@ separate columns (default: just one space)."
                       (max 1 (prefix-numeric-value nspace)))))
     (goto-char beg)
     (while (re-search-forward re end t)
-      (replace-match "|" t t))
+      (replace-match "| " t t))
     (goto-char beg)
     (insert " ")
     (org-table-align)))
@@ -10686,9 +11631,10 @@ This is being used to correctly align a single field after TAB or RET.")
         (beg (org-table-begin))
         (end (org-table-end))
         ;; Current cursor position
-        (linepos (+ (if (bolp) 1 0) (count-lines (point-min) (point))))
+        (linepos (org-current-line))
         (colpos (org-table-current-column))
         (winstart (window-start))
+        (winstartline (org-current-line (min winstart (1- (point-max)))))
         lines (new "") lengths l typenums ty fields maxfields i
         column
         (indent "") cnt frac
@@ -10700,14 +11646,20 @@ This is being used to correctly align a single field after TAB or RET.")
                 (make-string sp2 ?\ ) "%%%s%ds" (make-string sp1 ?\ ) "|"))
         (hfmt1 (concat
                 (make-string sp2 ?-) "%s" (make-string sp1 ?-) "+"))
-        emptystrings links narrow fmax f1 len c e)
+        emptystrings links dates narrow fmax f1 len c e)
     (untabify beg end)
-    (remove-text-properties beg end '(org-cwidth t display t))
-    ;; Check if we have links
+    (remove-text-properties beg end '(org-cwidth t org-dwidth t display t))
+    ;; Check if we have links or dates
     (goto-char beg)
     (setq links (re-search-forward org-bracket-link-regexp end t))
+    (goto-char beg)
+    (setq dates (and org-display-custom-times
+                    (re-search-forward org-ts-regexp-both end t)))
     ;; Make sure the link properties are right
     (when links (goto-char beg) (while (org-activate-bracket-links end)))
+    ;; Make sure the date properties are right
+    (when dates (goto-char beg) (while (org-activate-dates end)))
+
     ;; Check if we are narrowing any columns
     (goto-char beg)
     (setq narrow (and org-format-transports-properties-p
@@ -10739,7 +11691,7 @@ This is being used to correctly align a single field after TAB or RET.")
        (kill-region beg end)
        (org-table-create org-table-default-size)
        (error "Empty table - created default table")))
-    ;; A list of empty string to fill any short rows on output
+    ;; A list of empty strings to fill any short rows on output
     (setq emptystrings (make-list maxfields ""))
     ;; Check for special formatting.
     (setq i -1)
@@ -10821,7 +11773,9 @@ This is being used to correctly align a single field after TAB or RET.")
     (when (and orgtbl-mode (not (org-mode-p)))
       (goto-char org-table-aligned-begin-marker)
       (while (org-hide-wide-columns org-table-aligned-end-marker)))
-    ;; Try to move to the old location (approximately)
+    ;; Try to move to the old location
+    (goto-line winstartline)
+    (setq winstart (point-at-bol))
     (goto-line linepos)
     (set-window-start (selected-window) winstart 'noforce)
     (org-table-goto-column colpos)
@@ -10833,7 +11787,7 @@ This is being used to correctly align a single field after TAB or RET.")
 This ignores character with invisibility property `org-link', and also
 characters with property `org-cwidth', because these will become invisible
 upon the next fontification round."
-  (let (b)
+  (let (b l)
     (when (or (eq t buffer-invisibility-spec)
              (assq 'org-link buffer-invisibility-spec))
       (while (setq b (text-property-any 0 (length s)
@@ -10845,7 +11799,10 @@ upon the next fontification round."
       (setq s (concat (substring s 0 b)
                      (substring s (or (next-single-property-change
                                        b 'org-cwidth s) (length s))))))
-    (string-width s)))
+    (setq l (string-width s) b -1)
+    (while (setq b (text-property-any (1+ b) (length s) 'org-dwidth t s))
+      (setq l (- l (get-text-property b 'org-dwidth-n s))))
+    l))
 
 (defun org-table-begin (&optional table-type)
   "Find the beginning of the table and return its position.
@@ -11167,7 +12124,7 @@ If TABLE-TYPE is non-nil, also check for table.el-type tables."
         (beg (org-table-begin))
         (end (org-table-end))
         ;; Current cursor position
-        (linepos (+ (if (bolp) 1 0) (count-lines (point-min) (point))))
+        (linepos (org-current-line))
         (colpos col))
     (goto-char beg)
     (while (< (point) end)
@@ -11212,7 +12169,7 @@ If TABLE-TYPE is non-nil, also check for table.el-type tables."
         (beg (org-table-begin))
         (end (org-table-end))
         ;; Current cursor position
-        (linepos (+ (if (bolp) 1 0) (count-lines (point-min) (point))))
+        (linepos (org-current-line))
         (colpos col))
     (goto-char beg)
     (while (< (point) end)
@@ -11249,7 +12206,7 @@ If TABLE-TYPE is non-nil, also check for table.el-type tables."
         (beg (org-table-begin))
         (end (org-table-end))
         ;; Current cursor position
-        (linepos (+ (if (bolp) 1 0) (count-lines (point-min) (point))))
+        (linepos (org-current-line))
         (colpos (if left (1- col) (1+ col))))
     (if (and left (= col 1))
        (error "Cannot move column further left"))
@@ -12311,7 +13268,7 @@ With prefix arg ALL, do this for all lines in the table."
                       (lambda (a b) (string< (car a) (car b)))))
         (inhibit-redisplay t)
         (line-re org-table-dataline-regexp)
-        (thisline (+ (if (bolp) 1 0) (count-lines (point-min) (point))))
+        (thisline (org-current-line))
         (thiscol (org-table-current-column))
         beg end entry eqlnum eqlname eql (cnt 0) eq a name)
     ;; Insert constants in all formulas
@@ -13332,7 +14289,7 @@ translations.  There is currently no way for users to extend this.")
            (beginning-of-line 1)
            (delete-region
             (if org-export-with-archived-trees (1+ (point-at-eol)) (point))
-            (org-end-of-subtree)))))
+            (org-end-of-subtree t)))))
 
       ;; Find targets in comments and move them out of comments,
       ;; but mark them as targets that should be invisible
@@ -13340,6 +14297,11 @@ translations.  There is currently no way for users to extend this.")
       (while (re-search-forward "^#.*?\\(<<<?[^>\r\n]+>>>?\\).*" nil t)
        (replace-match "\\1(INVISIBLE)"))
 
+      ;; Remove comments
+      (goto-char (point-min))
+      (while (re-search-forward "^#.*\n?" nil t)
+       (replace-match ""))
+
       ;; Find matches for radio targets and turn them into internal links
       (goto-char (point-min))
       (when re-radio
@@ -13354,7 +14316,7 @@ translations.  There is currently no way for users to extend this.")
 
       ;; Convert LaTeX fragments to images
       (when (memq :LaTeX-fragments parameters)
-       (org-format-latex 
+       (org-format-latex
         (concat "ltxpng/" (file-name-sans-extension
                            (file-name-nondirectory
                             org-current-export-file)))
@@ -13362,6 +14324,7 @@ translations.  There is currently no way for users to extend this.")
       (message "Exporting...")
 
       ;; Normalize links: Convert angle and plain links into bracket links
+      ;; Expand link abbreviations
       (goto-char (point-min))
       (while (re-search-forward re-plain-link nil t)
        (replace-match
@@ -13374,6 +14337,17 @@ translations.  There is currently no way for users to extend this.")
         (concat
          (match-string 1) "[[" (match-string 2) ":" (match-string 3) "]]")
         t t))
+      (goto-char (point-min))
+      (while (re-search-forward org-bracket-link-regexp nil t)
+       (replace-match
+        (concat "[[" (save-match-data
+                       (org-link-expand-abbrev (match-string 1)))
+                "]"
+                (if (match-end 3)
+                    (match-string 2)
+                  (concat "[" (match-string 1) "]"))
+                "]")
+        t t))
 
       ;; Find multiline emphasis and put them into single line
       (when (memq :emph-multiline parameters)
@@ -13382,10 +14356,6 @@ translations.  There is currently no way for users to extend this.")
          (subst-char-in-region (match-beginning 0) (match-end 0) ?\n ?\  t)
          (goto-char (1- (match-end 0)))))
 
-      ;; Remove comments
-      (goto-char (point-min))
-      (while (re-search-forward "^#.*\n?" nil t)
-       (replace-match ""))
       (setq rtn (buffer-string)))
     (kill-buffer " org-mode-tmp")
     rtn))
@@ -13425,7 +14395,7 @@ is signaled in this case."
   (goto-char (point-min))
   ;; First check if there are no even levels
   (when (re-search-forward "^\\(\\*\\*\\)+[^*]" nil t)
-    (org-show-hierarchy-above)
+    (org-show-context t)
     (error "Not all levels are odd in this file.  Conversion not possible."))
   (when (yes-or-no-p "Are you sure you want to globally change levels to odd-even? ")
     (let ((org-odd-levels-only nil) n)
@@ -13483,6 +14453,8 @@ underlined headlines.  The default is 3."
                           (file-name-nondirectory buffer-file-name))))
         (email       (plist-get opt-plist :email))
         (language    (plist-get opt-plist :language))
+        (quote-re0   (concat "^[ \t]*" org-quote-string "\\>"))
+        (quote-re    (concat "^\\(\\*+\\)\\([ \t]*" org-quote-string "\\>\\)"))
         (text        nil)
         (todo nil)
         (lang-words nil))
@@ -13546,6 +14518,12 @@ underlined headlines.  The default is 3."
                                           line lines level))))
                           (setq txt (org-html-expand-for-ascii txt))
 
+                          (if (and (memq org-export-with-tags '(not-in-toc nil))
+                                   (string-match "[ \t]+:[a-zA-Z0-9_@:]+:[ \t]*$" txt))
+                              (setq txt (replace-match "" t t txt)))
+                          (if (string-match quote-re0 txt)
+                              (setq txt (replace-match "" t t txt)))
+
                           (if org-export-with-section-numbers
                               (setq txt (concat (org-section-number level)
                                                 " " txt)))
@@ -13650,6 +14628,9 @@ underlined headlines.  The default is 3."
              (not (equal (char-before (1- (point))) ?\n)))
          (insert "\n"))
       (setq char (nth (- umax level) (reverse org-export-ascii-underline)))
+      (unless org-export-with-tags
+       (if (string-match "[ \t]+\\(:[a-zA-Z0-9_@:]+:\\)[ \t]*$" title)
+           (setq title (replace-match "" t t title))))
       (if org-export-with-section-numbers
          (setq title (concat (org-section-number level) " " title)))
       (insert title "\n" (make-string (string-width title) char) "\n")
@@ -13739,6 +14720,7 @@ Does include HTML export options as well as TODO and CATEGORY stuff."
 #+STARTUP:   %s %s %s %s %s %s
 #+TAGS:      %s
 #+ARCHIVE:   %s
+#+LINK:      %s
 "
    (buffer-name) (user-full-name) user-mail-address org-export-default-language
    org-export-headline-levels
@@ -13766,8 +14748,15 @@ Does include HTML export options as well as TODO and CATEGORY stuff."
    (if org-hide-leading-stars "hidestars" "showstars")
    (if org-startup-align-all-tables "align" "noalign")
    (if org-log-done "logging" "nologging")
-   (if org-tag-alist (mapconcat 'car org-tag-alist " ") "")
+   (or (mapconcat (lambda (x)
+                   (cond
+                    ((equal '(:startgroup) x) "{")
+                    ((equal '(:endgroup) x) "}")
+                    ((cdr x) (format "%s(%c)" (car x) (cdr x)))
+                    (t (car x))))
+                 (or org-tag-alist (org-get-buffer-tags)) " ") "")
    org-archive-location
+   "org file:~/org/%s.org"
    ))
 
 (defun org-insert-export-options-template ()
@@ -13873,7 +14862,7 @@ org-mode's default settings, but still inferior to file-local settings."
          (all_lines
           (org-skip-comments (org-split-string
                              (org-cleaned-string-for-export
-                              region :emph-multiline 
+                              region :emph-multiline
                               (if (plist-get opt-plist :LaTeX-fragments)
                                   :LaTeX-fragments))
                              "[\r\n]")))
@@ -13909,12 +14898,12 @@ org-mode's default settings, but still inferior to file-local settings."
         (target-alist nil) tg
         (head-count  0) cnt
         (start       0)
-        (coding-system (and (fboundp 'coding-system-get)
-                            (boundp 'buffer-file-coding-system)
+        (coding-system (and (boundp 'buffer-file-coding-system)
                             buffer-file-coding-system))
-        (coding-system-for-write (or coding-system coding-system-for-write))
-        (save-buffer-coding-system (or coding-system save-buffer-coding-system))
+        (coding-system-for-write coding-system)
+        (save-buffer-coding-system coding-system)
         (charset (and coding-system
+                      (fboundp 'coding-system-get)
                       (coding-system-get coding-system 'mime-charset)))
         table-open type
         table-buffer table-orig-buffer
@@ -14001,6 +14990,11 @@ lang=\"%s\" xml:lang=\"%s\">
                                            (= level umax)
                                            (org-search-todo-below
                                             line lines level))))
+                            (if (and (memq org-export-with-tags '(not-in-toc nil))
+                                     (string-match "[ \t]+:[a-zA-Z0-9_@:]+:[ \t]*$" txt))
+                                (setq txt (replace-match "" t t txt)))
+                            (if (string-match quote-re0 txt)
+                                (setq txt (replace-match "" t t txt)))
                             (if org-export-with-section-numbers
                                 (setq txt (concat (org-section-number level)
                                                   " " txt)))
@@ -14137,7 +15131,7 @@ lang=\"%s\" xml:lang=\"%s\">
                  (setq valid
                        (if (functionp link-validate)
                            (funcall link-validate filename current-dir)
-                         t))               
+                         t))
                  (setq file-is-image-p
                        (string-match (org-image-file-name-regexp) filename))
                  (setq thefile (if abs-p (expand-file-name filename) filename))
@@ -14480,8 +15474,8 @@ But it has the disadvantage, that Org-mode's HTML conversions cannot be used."
   (catch 'exit
     (let (r b)
       (while (string-match org-maybe-keyword-time-regexp s)
-       ;; FIXME: is it good to never export CLOCK, or do we need control?
        (if (and (match-end 1) (equal (match-string 1 s) org-clock-string))
+           ;; never export CLOCK
            (throw 'exit ""))
        (or b (setq b (substring s 0 (match-beginning 0))))
        (if (not org-export-with-timestamps)
@@ -14735,6 +15729,7 @@ file, but with extension `.ics'."
 (defun org-export-as-xoxo-insert-into (buffer &rest output)
   (with-current-buffer buffer
     (apply 'insert output)))
+(put 'org-export-as-xoxo-insert-into 'lisp-indent-function 1)
 
 (defun org-export-as-xoxo (&optional buffer)
   "Export the org buffer as XOXO.
@@ -14993,7 +15988,7 @@ a time), or the day by one (if it does not contain a time)."
 (defvar org-cdlatex-texmathp-advice-is-done nil
   "Flag remembering if we have applied the advice to texmathp already.")
 
-(define-minor-mode org-cdlatex-mode 
+(define-minor-mode org-cdlatex-mode
   "Toggle the minor `org-cdlatex-mode'.
 This mode supports entering LaTeX environment and math in LaTeX fragments
 in Org-mode.
@@ -15077,7 +16072,6 @@ It makes sense to do so if `org-cdlatex-mode' is active and if the cursor is
   - inside a LaTeX fragment, or
   - after the first word in a line, where an abbreviation expansion could
     insert a LaTeX environment."
-  ;; FIXME:  This may still need refinement.
   (when org-cdlatex-mode
     (cond
      ((save-excursion
@@ -15121,7 +16115,7 @@ Revert to the normal definition outside of these fragments."
 If the cursor is in a LaTeX fragment, create the image and overlay
 it over the source code.  If there is no fragment at point, display
 all fragments in the current text, from one headline to the next.  With
-prefix SUBTREE, display all fragments in the current subtree.  With a 
+prefix SUBTREE, display all fragments in the current subtree.  With a
 double prefix `C-u C-u', or when the cursor is before the first headline,
 display all fragments in the buffer.
 The images can be removed again with \\[org-ctrl-c-ctrl-c]."
@@ -15138,7 +16132,7 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]."
                msg "Creating images for buffer...%s"))
         ((equal subtree '(4))
          (org-back-to-heading)
-         (setq beg (point) end (org-end-of-subtree)
+         (setq beg (point) end (org-end-of-subtree t)
                msg "Creating images for subtree...%s"))
         (t
          (if (setq at (org-inside-LaTeX-fragment-p))
@@ -15209,16 +16203,16 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]."
                      (progn
                        (org-overlay-put ov 'invisible t)
                        (org-overlay-put
-                        ov 'end-glyph 
+                        ov 'end-glyph
                         (make-glyph (vector 'png :file movefile))))
-                   (org-overlay-put 
-                    ov 'display 
+                   (org-overlay-put
+                    ov 'display
                     (list 'image :type 'png :file movefile :ascent 'center)))
                  (push ov org-latex-fragment-image-overlays)
                  (goto-char end))
              (delete-region beg end)
              (insert link))))))))
-    
+
 ;; This function borrows from Ganesh Swami's latex2png.el
 (defun org-create-formula-image (string tofile options)
   (let* ((tmpdir (if (featurep 'xemacs)
@@ -15282,55 +16276,64 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]."
 ;; TAB key with modifiers
 (define-key org-mode-map "\C-i"       'org-cycle)
 (define-key org-mode-map [(tab)]      'org-cycle)
+(define-key org-mode-map [(control tab)] 'org-force-cycle-archived)
 (define-key org-mode-map [(meta tab)] 'org-complete)
-(define-key org-mode-map "\M-\C-i"    'org-complete)            ; for tty emacs
 ;; The following line is necessary under Suse GNU/Linux
 (unless (featurep 'xemacs)
   (define-key org-mode-map [S-iso-lefttab]  'org-shifttab))
 (define-key org-mode-map [(shift tab)]    'org-shifttab)
 
 (define-key org-mode-map (org-key 'S-return)   'org-table-copy-down)
-(define-key org-mode-map "\C-c\C-xc"           'org-table-copy-down)     ; tty
 (define-key org-mode-map [(meta shift return)] 'org-insert-todo-heading)
-(define-key org-mode-map "\C-c\C-xM"           'org-insert-todo-heading) ; tty
 (define-key org-mode-map [(meta return)]       'org-meta-return)
-(define-key org-mode-map "\C-c\C-xm"           'org-meta-return)  ; tty emacs
-(define-key org-mode-map [?\e (return)]        'org-meta-return)   ; tty emacs
 
 ;; Cursor keys with modifiers
 (define-key org-mode-map [(meta left)]  'org-metaleft)
-(define-key org-mode-map [?\e (left)]   'org-metaleft)          ; for tty emacs
-(define-key org-mode-map "\C-c\C-xl"    'org-metaleft)          ; for tty emacs
 (define-key org-mode-map [(meta right)] 'org-metaright)
-(define-key org-mode-map [?\e (right)]  'org-metaright)         ; for tty emacs
-(define-key org-mode-map "\C-c\C-xr"    'org-metaright)         ; for tty emacs
 (define-key org-mode-map [(meta up)]    'org-metaup)
-(define-key org-mode-map [?\e (up)]     'org-metaup)            ; for tty emacs
-(define-key org-mode-map "\C-c\C-xu"    'org-metaup)            ; for tty emacs
 (define-key org-mode-map [(meta down)]  'org-metadown)
-(define-key org-mode-map [?\e (down)]   'org-metadown)          ; for tty emacs
-(define-key org-mode-map "\C-c\C-xd"    'org-metadown)          ; for tty emacs
-
-(define-key org-mode-map [(meta shift left)]       'org-shiftmetaleft)
-(define-key org-mode-map "\C-c\C-xL"               'org-shiftmetaleft)  ; tty
-(define-key org-mode-map [(meta shift right)]      'org-shiftmetaright)
-(define-key org-mode-map "\C-c\C-xR"               'org-shiftmetaright) ; tty
-(define-key org-mode-map [(meta shift up)]         'org-shiftmetaup)
-(define-key org-mode-map "\C-c\C-xU"               'org-shiftmetaup)    ; tty
-(define-key org-mode-map [(meta shift down)]       'org-shiftmetadown)
-(define-key org-mode-map "\C-c\C-xD"               'org-shiftmetadown)  ; tty
+
+(define-key org-mode-map [(meta shift left)]   'org-shiftmetaleft)
+(define-key org-mode-map [(meta shift right)]  'org-shiftmetaright)
+(define-key org-mode-map [(meta shift up)]     'org-shiftmetaup)
+(define-key org-mode-map [(meta shift down)]   'org-shiftmetadown)
+
 (define-key org-mode-map (org-key 'S-up)       'org-shiftup)
-(define-key org-mode-map [?\C-c ?\C-x (up)]    'org-shiftup)
 (define-key org-mode-map (org-key 'S-down)     'org-shiftdown)
-(define-key org-mode-map [?\C-c ?\C-x (down)]  'org-shiftdown)
 (define-key org-mode-map (org-key 'S-left)     'org-shiftleft)
-(define-key org-mode-map [?\C-c ?\C-x (left)]  'org-shiftleft)
 (define-key org-mode-map (org-key 'S-right)    'org-shiftright)
-(define-key org-mode-map [?\C-c ?\C-x (right)] 'org-shiftright)
 
-;; All the other keys
+;; Extra keys for tty access.  We only set them when really needed
+;; because otherwise the menus don't show the simple keys
+
+(when (or (featurep 'xemacs)   ;; because XEmacs supports multi-device stuff
+         (not window-system))
+  (define-key org-mode-map "\M-\C-i"      'org-complete)
+  (define-key org-mode-map "\C-c\C-xc"    'org-table-copy-down)
+  (define-key org-mode-map "\C-c\C-xM"    'org-insert-todo-heading)
+  (define-key org-mode-map "\C-c\C-xm"    'org-meta-return)
+  (define-key org-mode-map [?\e (return)] 'org-meta-return)
+  (define-key org-mode-map [?\e (left)]   'org-metaleft)
+  (define-key org-mode-map "\C-c\C-xl"    'org-metaleft)
+  (define-key org-mode-map [?\e (right)]  'org-metaright)
+  (define-key org-mode-map "\C-c\C-xr"    'org-metaright)
+  (define-key org-mode-map [?\e (up)]     'org-metaup)
+  (define-key org-mode-map "\C-c\C-xu"    'org-metaup)
+  (define-key org-mode-map [?\e (down)]   'org-metadown)
+  (define-key org-mode-map "\C-c\C-xd"    'org-metadown)
+  (define-key org-mode-map "\C-c\C-xL"    'org-shiftmetaleft)
+  (define-key org-mode-map "\C-c\C-xR"    'org-shiftmetaright)
+  (define-key org-mode-map "\C-c\C-xU"    'org-shiftmetaup)
+  (define-key org-mode-map "\C-c\C-xD"    'org-shiftmetadown)
+  (define-key org-mode-map [?\C-c ?\C-x (up)]    'org-shiftup)
+  (define-key org-mode-map [?\C-c ?\C-x (down)]  'org-shiftdown)
+  (define-key org-mode-map [?\C-c ?\C-x (left)]  'org-shiftleft)
+  (define-key org-mode-map [?\C-c ?\C-x (right)] 'org-shiftright))
+  
+  ;; All the other keys
 
 (define-key org-mode-map "\C-c\C-a" 'show-all)  ; in case allout messed up.
+(define-key org-mode-map "\C-c\C-r" 'org-reveal)
 (define-key org-mode-map "\C-xns" 'org-narrow-to-subtree)
 (define-key org-mode-map "\C-c$"    'org-archive-subtree)
 (define-key org-mode-map "\C-c\C-x\C-a" 'org-toggle-archive-tag)
@@ -15359,10 +16362,10 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]."
 (define-key org-mode-map [(control ?,)]     'org-cycle-agenda-files)
 (define-key org-mode-map "\C-c["    'org-agenda-file-to-front)
 (define-key org-mode-map "\C-c]"    'org-remove-file)
-(define-key org-mode-map "\C-c\C-r"       'org-timeline)
 (define-key org-mode-map "\C-c-"          'org-table-insert-hline)
 (define-key org-mode-map "\C-c^"          'org-table-sort-lines)
 (define-key org-mode-map "\C-c\C-c"       'org-ctrl-c-ctrl-c)
+(define-key org-mode-map "\C-c#"          'org-update-checkbox-count)
 (define-key org-mode-map "\C-m"           'org-return)
 (define-key org-mode-map "\C-c?"          'org-table-current-column)
 (define-key org-mode-map "\C-c "          'org-table-blank-field)
@@ -15383,6 +16386,7 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]."
 (define-key org-mode-map "\C-c\C-x\M-w"   'org-copy-special)
 (define-key org-mode-map "\C-c\C-x\C-y"   'org-paste-special)
 
+(define-key org-mode-map "\C-c\C-x\C-t" 'org-toggle-time-stamp-overlays)
 (define-key org-mode-map "\C-c\C-x\C-i" 'org-clock-in)
 (define-key org-mode-map "\C-c\C-x\C-o" 'org-clock-out)
 (define-key org-mode-map "\C-c\C-x\C-x" 'org-clock-cancel)
@@ -15472,6 +16476,12 @@ because, in this case the deletion might narrow the column."
        (delete-char N))
     (delete-char N)))
 
+;; Make `delete-selection-mode' work with org-mode and orgtbl-mode
+(put 'org-self-insert-command 'delete-selection t)
+(put 'orgtbl-self-insert-command 'delete-selection t)
+(put 'org-delete-char 'delete-selection 'supersede)
+(put 'org-delete-backward-char 'delete-selection 'supersede)
+
 ;; How to do this: Measure non-white length of current string
 ;; If equal to column width, we should realign.
 
@@ -15563,6 +16573,7 @@ See the individual commands for more information."
    ((org-at-table-p) (org-call-with-arg 'org-table-move-column 'left))
    ((or (org-on-heading-p) (org-region-active-p))
     (call-interactively 'org-do-promote))
+   ((org-at-item-p) (call-interactively 'org-outdent-item))
    (t (call-interactively 'backward-word))))
 
 (defun org-metaright (&optional arg)
@@ -15575,6 +16586,7 @@ See the individual commands for more information."
    ((org-at-table-p) (call-interactively 'org-table-move-column))
    ((or (org-on-heading-p) (org-region-active-p))
     (call-interactively 'org-do-demote))
+   ((org-at-item-p) (call-interactively 'org-indent-item))
    (t (call-interactively 'forward-word))))
 
 (defun org-metaup (&optional arg)
@@ -15697,7 +16709,8 @@ This command does many different things, depending on context:
   (interactive "P")
   (let  ((org-enable-table-editor t))
     (cond
-     ((or org-clock-overlays org-occur-highlights
+     ((or org-clock-overlays
+         org-occur-highlights
          org-latex-fragment-image-overlays)
       (org-remove-clock-overlays)
       (org-remove-occur-highlights)
@@ -15825,10 +16838,12 @@ See the individual commands for more information."
 
 (easy-menu-define org-org-menu org-mode-map "Org menu"
   '("Org"
-    ["Cycle Visibility" org-cycle (or (bobp) (outline-on-heading-p))]
-    ["Cycle Global Visibility" org-shifttab (not (org-at-table-p))]
-    ["Sparse Tree" org-occur t]
-    ["Show All" show-all t]
+    ("Show/Hide"
+     ["Cycle Visibility" org-cycle (or (bobp) (outline-on-heading-p))]
+     ["Cycle Global Visibility" org-shifttab (not (org-at-table-p))]
+     ["Sparse Tree" org-occur t]
+     ["Reveal Context" org-reveal t]
+     ["Show All" show-all t])
     "--"
     ["New Heading" org-insert-heading t]
     ("Navigate Headings"
@@ -15870,7 +16885,7 @@ See the individual commands for more information."
       :style toggle :selected (not org-agenda-skip-archived-trees)]
      "--"
      ["Move Subtree to Archive" org-archive-subtree t]
-     ["Check and Move Children" (org-archive-subtree '(4)) 
+     ["Check and Move Children" (org-archive-subtree '(4))
       :active t :keys "C-u C-c $"])
     "--"
     ("TODO Lists"
@@ -15884,19 +16899,31 @@ See the individual commands for more information."
      "--"
      ["Set Priority" org-priority t]
      ["Priority Up" org-shiftup t]
-     ["Priority Down" org-shiftdown t])
+     ["Priority Down" org-shiftdown t]
+     "--"
+;     ["Insert Checkbox" org-insert-todo-heading (org-in-item-p)]
+;     ["Toggle Checkbox" org-ctrl-c-ctrl-c (org-at-item-checkbox-p)]
+;     ["Insert [n/m] cookie" (progn (insert "[/]") (org-update-checkbox-count))
+;      (or (org-on-heading-p) (org-at-item-p))]
+;     ["Insert [%] cookie" (progn (insert "[%]") (org-update-checkbox-count))
+;      (or (org-on-heading-p) (org-at-item-p))]
+;     ["Update Statistics" org-update-checkbox-count t]
+     )
     ("Dates and Scheduling"
      ["Timestamp" org-time-stamp t]
      ["Timestamp (inactive)" org-time-stamp-inactive t]
      ("Change Date"
-      ["1 Day Later" org-timestamp-up-day t]
-      ["1 Day Earlier" org-timestamp-down-day t]
+      ["1 Day Later" org-shiftright t]
+      ["1 Day Earlier" org-shiftleft t]
       ["1 ... Later" org-shiftup t]
       ["1 ... Earlier" org-shiftdown t])
      ["Compute Time Range" org-evaluate-time-range t]
      ["Schedule Item" org-schedule t]
      ["Deadline" org-deadline t]
      "--"
+     ["Custom time format" org-toggle-time-stamp-overlays
+      :style radio :selected org-display-custom-times]
+     "--"
      ["Goto Calendar" org-goto-calendar t]
      ["Date from Calendar" org-date-from-calendar t])
     ("Logging work"
@@ -15913,7 +16940,7 @@ See the individual commands for more information."
                      (if org-log-done "automatically" "not")))
       :style toggle :selected org-log-done])
     "--"
-    ["Agenda Command" org-agenda t]
+    ["Agenda Command..." org-agenda t]
     ("File List for Agenda")
     ("Special views current file"
      ["TODO Tree"  org-show-todo-tree t]
@@ -15938,16 +16965,16 @@ See the individual commands for more information."
       (save-excursion (goto-char (point-min))
                      (re-search-forward "<[a-z]+:" nil t))])
     "--"
-    ["Export/Publish" org-export t]
+    ["Export/Publish..." org-export t]
     ("LaTeX"
-     ["Org CDLaTeX mode" org-cdlatex-mode :style toggle 
+     ["Org CDLaTeX mode" org-cdlatex-mode :style toggle
       :selected org-cdlatex-mode]
      ["Insert Environment" cdlatex-environment (fboundp 'cdlatex-environment)]
      ["Insert math symbol" cdlatex-math-symbol (fboundp 'cdlatex-math-symbol)]
      ["Modify math symbol" org-cdlatex-math-modify
       (org-inside-LaTeX-fragment-p)]
      ["Export LaTeX fragments as images"
-      (setq org-export-with-LaTeX-fragments (not org-export-with-LaTeX-fragments)) 
+      (setq org-export-with-LaTeX-fragments (not org-export-with-LaTeX-fragments))
       :style toggle :selected org-export-with-LaTeX-fragments])
     "--"
     ("Documentation"
@@ -16097,16 +17124,16 @@ and :keyword."
          (push (org-point-in-group p 0 :radio-target) clist))
       (goto-char p))
      ((setq o (car (delq nil
-                        (mapcar 
+                        (mapcar
                          (lambda (x)
                            (if (memq x org-latex-fragment-image-overlays) x))
                          (org-overlays-at (point))))))
-      (push (list :latex-fragment 
+      (push (list :latex-fragment
                  (org-overlay-start o) (org-overlay-end o)) clist)
-      (push (list :latex-preview 
+      (push (list :latex-preview
                  (org-overlay-start o) (org-overlay-end o)) clist))
      ((org-inside-LaTeX-fragment-p)
-      ;; FIXME: positions wring.
+      ;; FIXME: positions wrong.
       (push (list :latex-fragment (point) (point)) clist)))
 
     (setq clist (nreverse (delq nil clist)))
@@ -16319,6 +17346,26 @@ With argument, move up ARG levels."
       (outline-up-heading-all arg)   ; emacs 21 version of outline.el
     (outline-up-heading arg t)))     ; emacs 22 version of outline.el
 
+(defun org-goto-sibling (&optional previous)
+  "Goto the next sibling, even if it is invisible.
+When PREVIOUS is set, go to the previous sibling instead.  Returns t
+when a sibling was found.  When none is found, return nil and don't
+move point."
+  (let ((fun (if previous 're-search-backward 're-search-forward))
+       (pos (point))
+       (re (concat "^" outline-regexp))
+       level l)
+    (org-back-to-heading t)
+    (setq level (funcall outline-level))
+    (catch 'exit
+      (or previous (forward-char 1))
+      (while (funcall fun re nil t)
+       (setq l (funcall outline-level))
+       (when (< l level) (goto-char pos) (throw 'exit nil))
+       (when (= l level) (goto-char (match-beginning 0)) (throw 'exit t)))
+      (goto-char pos)
+      nil)))
+
 (defun org-show-hidden-entry ()
   "Show an entry where even the heading is hidden."
   (save-excursion
@@ -16407,13 +17454,16 @@ Show the heading too, if it is currently invisible."
        (or (org-invisible-p)
           (save-excursion (goto-char (max (point-min) (1- (point))))
                           (org-invisible-p)))
-       (org-show-hierarchy-above)))
+       (org-show-context 'bookmark-jump)))
 
-;;; Experimental code
+;; Make session.el ignore our circular variable
+(eval-after-load "session"
+  '(add-to-list 'session-globals-exclude 'org-mark-ring))
 
+;;; Experimental code
 
 ;;; Finish up
-       
+
 (provide 'org)
 
 (run-hooks 'org-load-hook)
index ced4475..a83c790 100644 (file)
   ;; If MARK-TO-KILL is non-nil, mark new buffer to kill.
   ;; If HIGHLIGHT is non-nil, highlight the match.
   ;; If ITEM in non-nil, search for bibitem instead of database entry.
-  ;; If RETURN is non-nil, just return the entry.
+  ;; If RETURN is non-nil, just return the entry and restore point.
 
   (let* ((re
           (if item 
             (concat "@[a-zA-Z]+[ \t\n\r]*[{(][ \t\n\r]*" (regexp-quote key)
                     "[, \t\r\n}]")))
          (buffer-conf (current-buffer))
-         file buf pos)
+         file buf pos oldpos)
 
     (catch 'exit
       (while file-list
         (unless (setq buf (reftex-get-file-buffer-force file mark-to-kill))
           (error "No such file %s" file))
         (set-buffer buf)
+       (setq oldpos (point))
         (widen)
         (goto-char (point-min))
-        (when (re-search-forward re nil t)
+        (if (not (re-search-forward re nil t))
+           (goto-char oldpos) ;; restore previous position of point
           (goto-char (match-beginning 0))
           (setq pos (point))
           (when return
             (if item (goto-char (match-end 0)))
             (setq return (buffer-substring 
                           (point) (reftex-end-of-bib-entry item)))
+           (goto-char oldpos) ;; restore point.
             (set-buffer buffer-conf)
             (throw 'exit return))
           (switch-to-buffer-other-window buf)
index 169eeb2..70bd3a0 100644 (file)
@@ -4692,7 +4692,7 @@ of line."
     (point)))
 
 (defun table--row-column-insertion-point-p (&optional columnp)
-  "Return non nil if it makes sense to insert a row or a column at point."
+  "Return non-nil if it makes sense to insert a row or a column at point."
   (and (not buffer-read-only)
        (or (get-text-property (point) 'table-cell)
           (let ((column (current-column)))
index 9e0b6b6..35ac181 100644 (file)
@@ -2125,7 +2125,7 @@ This command is executed when texinfmt sees @item inside @multitable."
         (setq tab-number (1+ tab-number)))
       (let ((needed-tabs (- (length table-widths) tab-number)))
         (when (> needed-tabs 0)
-              (goto-char (point-min)) 
+              (goto-char (point-min))
               (end-of-line)
               (while (> needed-tabs 0)
                 (insert "@w{ }\n@tab")
@@ -4292,7 +4292,7 @@ the @ifeq command."
 
 (defun batch-texinfo-format ()
   "Runs  texinfo-format-buffer  on the files remaining on the command line.
-Must be used only with -batch, and kills emacs on completion.
+Must be used only with -batch, and kills Emacs on completion.
 Each file will be processed even if an error occurred previously.
 For example, invoke
   \"emacs -batch -funcall batch-texinfo-format $docs/ ~/*.texinfo\"."
index e2618bc..ee58fff 100644 (file)
@@ -214,15 +214,18 @@ Hostname matching is stricter in this case than for
 ``thing-at-point-url-regexp''.")
 
 (defvar thing-at-point-uri-schemes
-  ;; Officials from http://www.iana.org/assignments/uri-schemes
+  ;; Officials from http://www.iana.org/assignments/uri-schemes.html
   '("ftp://" "http://" "gopher://" "mailto:" "news:" "nntp:"
     "telnet://" "wais://" "file:/" "prospero:" "z39.50s:" "z39.50r:"
     "cid:" "mid:" "vemmi:" "service:" "imap:" "nfs:" "acap:" "rtsp:"
     "tip:" "pop:" "data:" "dav:" "opaquelocktoken:" "sip:" "tel:" "fax:"
     "modem:" "ldap:" "https://" "soap.beep:" "soap.beeps:" "urn:" "go:"
     "afs:" "tn3270:" "mailserver:"
+    "crid:" "dict:" "dns:" "dtn:" "h323:" "im:" "info:" "ipp:"
+    "iris.beep:" "mtqp:" "mupdate:" "pres:" "sips:" "snmp:" "tag:"
+    "tftp:" "xmlrpc.beep:" "xmlrpc.beeps:" "xmpp:"
   ;; Compatibility
-    "snews:")
+    "snews:" "irc:" "mms://" "mmsh://")
   "Uniform Resource Identifier (URI) Schemes.")
 
 (defvar thing-at-point-url-regexp
@@ -275,7 +278,10 @@ starts with \"ftp\" and not \"ftp:/\", or \"http://\" by default."
          ;; strip whitespace
          (while (string-match "[ \t\n\r]+" url)
            (setq url (replace-match "" t t url)))
-         (and short (setq url (concat (cond ((string-match "@" url)
+         (and short (setq url (concat (cond ((string-match "^[a-zA-Z]+:" url)
+                                              ;; already has a URL scheme.
+                                              "")
+                                            ((string-match "@" url)
                                               "mailto:")
                                             ;; e.g. ftp.swiss... or ftp-swiss...
                                              ((string-match "^ftp" url)
index c66736a..f29806e 100644 (file)
@@ -491,7 +491,7 @@ and all `time-stamp-format' compatibility."
                 (or (eq ?. cur-char)
                     (eq ?, cur-char) (eq ?: cur-char) (eq ?@ cur-char)
                     (eq ?- cur-char) (eq ?+ cur-char) (eq ?_ cur-char)
-                    (eq ?\  cur-char) (eq ?# cur-char) (eq ?^ cur-char)
+                    (eq ?\s cur-char) (eq ?# cur-char) (eq ?^ cur-char)
                     (and (eq ?\( cur-char)
                          (not (eq prev-char ?\\))
                          (setq paren-level (1+ paren-level)))
@@ -710,23 +710,16 @@ around literals."
 ;;; Some functions used in time-stamp-format
 
 ;;; These functions have been obsolete since 1995
-;;; and will be removed in Emacs 22.
+;;; and will be removed in a future Emacs release.
 ;;; Meanwhile, discourage other packages from using them.
-(let ((obsolete-functions '(time-stamp-month-dd-yyyy
-                           time-stamp-dd/mm/yyyy
-                           time-stamp-mon-dd-yyyy
-                           time-stamp-dd-mon-yy
-                           time-stamp-yy/mm/dd
-                           time-stamp-yyyy/mm/dd
-                           time-stamp-yyyy-mm-dd
-                           time-stamp-yymmdd
-                           time-stamp-hh:mm:ss
-                           time-stamp-hhmm)))
-  (while obsolete-functions
-    (make-obsolete (car obsolete-functions)
-                  "use time-stamp-string or format-time-string instead."
-                  "20.1")
-    (setq obsolete-functions (cdr obsolete-functions))))
+(dolist (function '(time-stamp-month-dd-yyyy time-stamp-dd/mm/yyyy
+                   time-stamp-mon-dd-yyyy   time-stamp-dd-mon-yy
+                   time-stamp-yy/mm/dd      time-stamp-yyyy/mm/dd
+                   time-stamp-yyyy-mm-dd    time-stamp-yymmdd
+                   time-stamp-hh:mm:ss      time-stamp-hhmm))
+  (make-obsolete function
+                "use `time-stamp-string' or `format-time-string' instead."
+                "20.1"))
 
 ;;; pretty form, suitable for a title page
 
index 53b61a5..b5138fb 100644 (file)
@@ -304,7 +304,7 @@ Stores a list of all the shortcuts in the free variable `tmm-short-cuts'."
       (if char (setq tmm-short-cuts (cons char tmm-short-cuts)))
       (cons (concat (if char (concat (char-to-string char) tmm-mid-prompt)
                       ;; keep them lined up in columns
-                      (make-string (1+ (length tmm-mid-prompt)) ?\ ))
+                      (make-string (1+ (length tmm-mid-prompt)) ?\s))
                     str)
             (cdr elt))))))
 
diff --git a/lisp/tutorial.el b/lisp/tutorial.el
new file mode 100644 (file)
index 0000000..b171ee9
--- /dev/null
@@ -0,0 +1,1030 @@
+;;; tutorial.el --- tutorial for Emacs
+
+;; Copyright (C) 2006 Free Software Foundation, Inc.
+
+;; Maintainer: FSF
+;; Keywords: help, internal
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;; Code for running the Emacs tutorial.
+
+;;; History:
+
+;; File was created 2006-09.
+
+;;; Code:
+
+(require 'help-mode) ;; for function help-buffer
+(eval-when-compile (require 'cl))
+
+(defface tutorial-warning-face
+  '((((class color) (min-colors 88) (background light))
+     (:foreground "Red1" :weight bold))
+    (((class color) (min-colors 88) (background dark))
+     (:foreground "Pink" :weight bold))
+    (((class color) (min-colors 16) (background light))
+     (:foreground "Red1" :weight bold))
+    (((class color) (min-colors 16) (background dark))
+     (:foreground "Pink" :weight bold))
+    (((class color) (min-colors 8)) (:foreground "red"))
+    (t (:inverse-video t :weight bold)))
+  "Face used to highlight warnings in the tutorial."
+  :group 'font-lock-faces)
+
+(defvar tutorial--point-before-chkeys 0
+  "Point before display of key changes.")
+(make-variable-buffer-local 'tutorial--point-before-chkeys)
+
+(defvar tutorial--point-after-chkeys 0
+  "Point after display of key changes.")
+(make-variable-buffer-local 'tutorial--point-after-chkeys)
+
+(defvar tutorial--lang nil
+  "Tutorial language.")
+(make-variable-buffer-local 'tutorial--lang)
+
+(defun tutorial--describe-nonstandard-key (value)
+  "Give more information about a changed key binding.
+This is used in `help-with-tutorial'.  The information includes
+the key sequence that no longer has a default binding, the
+default binding and the current binding.  It also tells in what
+keymap the new binding has been done and how to access the
+function in the default binding from the keyboard.
+
+For `cua-mode' key bindings that try to combine CUA key bindings
+with default Emacs bindings information about this is shown.
+
+VALUE should have either of these formats:
+
+  \(cua-mode)
+  \(current-binding KEY-FUN DEF-FUN KEY WHERE)
+
+Where
+  KEY         is a key sequence whose standard binding has been changed
+  KEY-FUN     is the actual binding for KEY
+  DEF-FUN     is the standard binding of KEY
+  WHERE       is a text describing the key sequences to which DEF-FUN is
+              bound now (or, if it is remapped, a key sequence
+              for the function it is remapped to)"
+  (with-output-to-temp-buffer (help-buffer)
+    (help-setup-xref (list #'tutorial--describe-nonstandard-key value)
+                     (interactive-p))
+    (with-current-buffer (help-buffer)
+      (insert
+       "Your Emacs customizations override the default binding for this key:"
+       "\n\n")
+      (let ((inhibit-read-only t))
+        (cond
+         ((eq (car value) 'cua-mode)
+          (insert
+           "CUA mode is enabled.
+
+When CUA mode is enabled, you can use C-z, C-x, C-c, and C-v to
+undo, cut, copy, and paste in addition to the normal Emacs
+bindings.  The C-x and C-c keys only do cut and copy when the
+region is active, so in most cases, they do not conflict with the
+normal function of these prefix keys.
+
+If you really need to perform a command which starts with one of
+the prefix keys even when the region is active, you have three
+options:
+- press the prefix key twice very quickly (within 0.2 seconds),
+- press the prefix key and the following key within 0.2 seconds, or
+- use the SHIFT key with the prefix key, i.e. C-S-x or C-S-c."))
+         ((eq (car value) 'current-binding)
+          (let ((cb    (nth 1 value))
+                (db    (nth 2 value))
+                (key   (nth 3 value))
+                (where (nth 4 value))
+                map
+                (maps (current-active-maps))
+                mapsym)
+            ;; Look at the currently active keymaps and try to find
+            ;; first the keymap where the current binding occurs:
+            (while maps
+              (let* ((m (car maps))
+                     (mb (lookup-key m key t)))
+                (setq maps (cdr maps))
+                (when (eq mb cb)
+                  (setq map m)
+                  (setq maps nil))))
+            ;; Now, if a keymap was found we must found the symbol
+            ;; name for it to display to the user.  This can not
+            ;; always be found since all keymaps does not have a
+            ;; symbol pointing to them, but here they should have
+            ;; that:
+            (when map
+              (mapatoms (lambda (s)
+                          (and
+                           ;; If not already found
+                           (not mapsym)
+                           ;; and if s is a keymap
+                           (and (boundp s)
+                                (keymapp (symbol-value s)))
+                           ;; and not the local symbol map
+                           (not (eq s 'map))
+                           ;; and the value of s is map
+                           (eq map (symbol-value s))
+                           ;; then save this value in mapsym
+                           (setq mapsym s)))))
+            (insert "The default Emacs binding for the key "
+                    (key-description key)
+                    " is the command `")
+            (insert (format "%s" db))
+            (insert "'.  "
+                    "However, your customizations have rebound it to the command `")
+            (insert (format "%s" cb))
+            (insert "'.")
+            (when mapsym
+              (insert "  (For the more advanced user:"
+                      " This binding is in the keymap `"
+                      (format "%s" mapsym)
+                      "'.)"))
+            (if (string= where "")
+                (unless (keymapp db)
+                  (insert "\n\nYou can use M-x "
+                          (format "%s" db)
+                          " RET instead."))
+              (insert "\n\nWith you current key bindings"
+                      " you can use the key "
+                      where
+                      " to get the function `"
+                      (format "%s" db)
+                      "'."))
+            )
+          (fill-region (point-min) (point)))))
+      (print-help-return-message))))
+
+(defun tutorial--sort-keys (left right)
+  "Sort predicate for use with `tutorial--default-keys'.
+This is a predicate function to `sort'.
+
+The sorting is for presentation purpose only and is done on the
+key sequence.
+
+LEFT and RIGHT are the elements to compare."
+  (let ((x (append (cadr left)  nil))
+        (y (append (cadr right) nil)))
+    ;; Skip the front part of the key sequences if they are equal:
+    (while (and x y
+                (listp x) (listp y)
+                (equal (car x) (car y)))
+      (setq x (cdr x))
+      (setq y (cdr y)))
+    ;; Try to make a comparision that is useful for presentation (this
+    ;; could be made nicer perhaps):
+    (let ((cx (car x))
+          (cy (car y)))
+      ;;(message "x=%s, y=%s;;;; cx=%s, cy=%s" x y cx cy)
+      (cond
+       ;; Lists? Then call this again
+       ((and cx cy
+             (listp cx)
+             (listp cy))
+        (tutorial--sort-keys cx cy))
+       ;; Are both numbers? Then just compare them
+       ((and (wholenump cx)
+             (wholenump cy))
+        (> cx cy))
+       ;; Is one of them a number? Let that be bigger then.
+       ((wholenump cx)
+        t)
+       ((wholenump cy)
+        nil)
+       ;; Are both symbols? Compare the names then.
+       ((and (symbolp cx)
+             (symbolp cy))
+        (string< (symbol-name cy)
+                 (symbol-name cx)))
+       ))))
+
+(defconst tutorial--default-keys
+  (let* (
+         ;; On window system suspend Emacs is replaced in the
+         ;; default keymap so honor this here.
+         (suspend-emacs (if window-system
+                            'iconify-or-deiconify-frame
+                          'suspend-emacs))
+         (default-keys
+           `(
+             ;; These are not mentioned but are basic:
+             (ESC-prefix [27])
+             (Control-X-prefix [?\C-x])
+             (mode-specific-command-prefix [?\C-c])
+
+             (save-buffers-kill-emacs [?\C-x ?\C-c])
+
+
+             ;; * SUMMARY
+             (scroll-up [?\C-v])
+             (scroll-down [?\M-v])
+             (recenter [?\C-l])
+
+
+             ;; * BASIC CURSOR CONTROL
+             (forward-char [?\C-f])
+             (backward-char [?\C-b])
+
+             (forward-word [?\M-f])
+             (backward-word [?\M-b])
+
+             (next-line [?\C-n])
+             (previous-line [?\C-p])
+
+             (move-beginning-of-line [?\C-a])
+             (move-end-of-line [?\C-e])
+
+             (backward-sentence [?\M-a])
+             (forward-sentence [?\M-e])
+
+             (newline "\r")
+
+             (beginning-of-buffer [?\M-<])
+             (end-of-buffer [?\M->])
+
+             (universal-argument [?\C-u])
+
+
+             ;; * WHEN EMACS IS HUNG
+             (keyboard-quit [?\C-g])
+
+
+             ;; * DISABLED COMMANDS
+             (downcase-region [?\C-x ?\C-l])
+
+
+             ;; * WINDOWS
+             (delete-other-windows [?\C-x ?1])
+             ;; C-u 0 C-l
+             ;; Type CONTROL-h k CONTROL-f.
+
+
+             ;; * INSERTING AND DELETING
+             ;; C-u 8 * to insert ********.
+
+             (delete-backward-char [backspace])
+             (delete-backward-char "\d")
+             (delete-char [?\C-d])
+
+             (backward-kill-word [(meta backspace)])
+             (kill-word [?\M-d])
+
+             (kill-line [?\C-k])
+             (kill-sentence [?\M-k])
+
+             (set-mark-command [?\C-@])
+             (set-mark-command [?\C- ])
+             (kill-region [?\C-w])
+             (yank [?\C-y])
+             (yank-pop [?\M-y])
+
+
+             ;; * UNDO
+             (advertised-undo [?\C-x ?u])
+             (advertised-undo [?\C-x ?u])
+
+
+             ;; * FILES
+             (find-file [?\C-x ?\C-f])
+             (save-buffer [?\C-x ?\C-s])
+
+
+             ;; * BUFFERS
+             (list-buffers [?\C-x ?\C-b])
+             (switch-to-buffer [?\C-x ?b])
+             (save-some-buffers [?\C-x ?s])
+
+
+             ;; * EXTENDING THE COMMAND SET
+             ;; C-x    Character eXtend.  Followed by one character.
+             (execute-extended-command [?\M-x])
+
+             ;; C-x C-f                Find file
+             ;; C-x C-s                Save file
+             ;; C-x s          Save some buffers
+             ;; C-x C-b                List buffers
+             ;; C-x b          Switch buffer
+             ;; C-x C-c                Quit Emacs
+             ;; C-x 1          Delete all but one window
+             ;; C-x u          Undo
+
+
+             ;; * MODE LINE
+             (describe-mode [?\C-h ?m])
+
+             (set-fill-column [?\C-x ?f])
+             (fill-paragraph [?\M-q])
+
+
+             ;; * SEARCHING
+             (isearch-forward [?\C-s])
+             (isearch-backward [?\C-r])
+
+
+             ;; * MULTIPLE WINDOWS
+             (split-window-vertically [?\C-x ?2])
+             (scroll-other-window [?\C-\M-v])
+             (other-window [?\C-x ?o])
+             (find-file-other-window [?\C-x ?4 ?\C-f])
+
+
+             ;; * RECURSIVE EDITING LEVELS
+             (keyboard-escape-quit [27 27 27])
+
+
+             ;; * GETTING MORE HELP
+             ;; The most basic HELP feature is C-h c
+             (describe-key-briefly [?\C-h ?c])
+             (describe-key [?\C-h ?k])
+
+
+             ;; * MORE FEATURES
+             ;; F10
+
+
+             ;; * CONCLUSION
+             ;;(iconify-or-deiconify-frame [?\C-z])
+             (,suspend-emacs [?\C-z])
+             )))
+    (sort default-keys 'tutorial--sort-keys))
+  "Default Emacs key bindings that the tutorial depends on.")
+
+(defun tutorial--detailed-help (button)
+  "Give detailed help about changed keys."
+  (with-output-to-temp-buffer (help-buffer)
+    (help-setup-xref (list #'tutorial--detailed-help button)
+                     (interactive-p))
+    (with-current-buffer (help-buffer)
+      (let* ((tutorial-buffer  (button-get button 'tutorial-buffer))
+             ;;(tutorial-arg     (button-get button 'tutorial-arg))
+             (explain-key-desc (button-get button 'explain-key-desc))
+             (changed-keys (with-current-buffer tutorial-buffer
+                             (save-excursion
+                               (goto-char (point-min))
+                               (tutorial--find-changed-keys
+                               tutorial--default-keys)))))
+        (when changed-keys
+          (insert
+           "The following key bindings used in the tutorial had been changed
+from Emacs default in the " (buffer-name tutorial-buffer) " buffer:\n\n" )
+          (let ((frm "   %-9s %-27s %-11s %s\n"))
+            (insert (format frm "Key" "Standard Binding" "Is Now On" "Remark")))
+          (dolist (tk changed-keys)
+            (let* ((def-fun     (nth 1 tk))
+                   (key         (nth 0 tk))
+                   (def-fun-txt (nth 2 tk))
+                   (where       (nth 3 tk))
+                   (remark      (nth 4 tk))
+                   (rem-fun (command-remapping def-fun))
+                   (key-txt (key-description key))
+                   (key-fun (with-current-buffer tutorial-buffer (key-binding key)))
+                   tot-len)
+              (unless (eq def-fun key-fun)
+                ;; Insert key binding description:
+                (when (string= key-txt explain-key-desc)
+                  (put-text-property 0 (length key-txt)
+                                    'face 'tutorial-warning-face key-txt))
+                (insert "   " key-txt " ")
+                (setq tot-len (length key-txt))
+                (when (> 9 tot-len)
+                  (insert (make-string (- 9 tot-len) ? ))
+                  (setq tot-len 9))
+                ;; Insert a link describing the old binding:
+                (insert-button def-fun-txt
+                               'value def-fun
+                               'action
+                               (lambda(button) (interactive)
+                                 (describe-function
+                                  (button-get button 'value)))
+                               'follow-link t)
+                (setq tot-len (+ tot-len (length def-fun-txt)))
+                (when (> 36 tot-len)
+                  (insert (make-string (- 36 tot-len) ? )))
+                (when (listp where)
+                  (setq where "list"))
+                ;; Tell where the old binding is now:
+                (insert (format " %-11s "
+                                (if (string= "" where)
+                                    (format "M-x %s" def-fun-txt)
+                                  where)))
+                ;; Insert a link with more information, for example
+                ;; current binding and keymap or information about
+                ;; cua-mode replacements:
+                (insert-button (car remark)
+                               'action
+                               (lambda(b) (interactive)
+                                 (let ((value (button-get b 'value)))
+                                   (tutorial--describe-nonstandard-key value)))
+                               'value (cdr remark)
+                               'follow-link t)
+                (insert "\n")))))
+
+        (insert "
+It is legitimate to change key bindings, but changed bindings do not
+correspond to what the tutorial says.  (See also " )
+        (insert-button "Key Binding Conventions"
+                       'action
+                       (lambda(button) (interactive)
+                         (info
+                          "(elisp) Key Binding Conventions")
+                         (message "Type C-x 0 to close the new window"))
+                       'follow-link t)
+        (insert ".)\n\n")
+        (print-help-return-message)))))
+
+(defun tutorial--find-changed-keys (default-keys)
+  "Find the key bindings that have changed.
+Check if the default Emacs key bindings that the tutorial depends
+on have been changed.
+
+Return a list with the keys that have been changed.  The element
+of this list have the following format:
+
+  \(list KEY DEF-FUN DEF-FUN-TXT WHERE REMARK)
+
+Where
+  KEY         is a key sequence whose standard binding has been changed
+  DEF-FUN     is the standard binding of KEY
+  DEF-FUN-TXT is a short descriptive text for DEF-FUN
+  WHERE       is a text describing the key sequences to which DEF-FUN is
+              bound now (or, if it is remapped, a key sequence
+              for the function it is remapped to)
+  REMARK      is a list with info about rebinding. It has either of these
+              formats:
+
+                \(TEXT cua-mode)
+                \(TEXT current-binding KEY-FUN DEF-FUN KEY WHERE)
+
+              Here TEXT is a link text to show to the user.  The
+              rest of the list is used to show information when
+              the user clicks the link.
+
+              KEY-FUN is the actual binding for KEY."
+  (let (changed-keys remark)
+    ;; (default-keys tutorial--default-keys))
+    (dolist (kdf default-keys)
+      ;; The variables below corresponds to those with the same names
+      ;; described in the doc string.
+      (let* ((key     (nth 1 kdf))
+             (def-fun (nth 0 kdf))
+             (def-fun-txt (format "%s" def-fun))
+             (rem-fun (command-remapping def-fun))
+             (key-fun (if (eq def-fun 'ESC-prefix)
+                         (lookup-key global-map [27])
+                       (key-binding key)))
+             (where (where-is-internal (if rem-fun rem-fun def-fun))))
+        (if where
+            (progn
+              (setq where (key-description (car where)))
+              (when (and (< 10 (length where))
+                         (string= (substring where 0 (length "<menu-bar>"))
+                                  "<menu-bar>"))
+                (setq where "the menus")))
+          (setq where ""))
+        (setq remark nil)
+        (unless
+            (cond ((eq key-fun def-fun)
+                   ;; No rebinding, return t
+                   t)
+                  ((eq key-fun (command-remapping def-fun))
+                   ;; Just a remapping, return t
+                   t)
+                  ;; cua-mode specials:
+                  ((and cua-mode
+                        (or (and
+                             (equal key [?\C-v])
+                             (eq key-fun 'cua-paste))
+                            (and
+                             (equal key [?\C-z])
+                             (eq key-fun 'undo))))
+                   (setq remark (list "cua-mode, more info" 'cua-mode))
+                   nil)
+                  ((and cua-mode
+                        (or
+                         (and (eq def-fun 'ESC-prefix)
+                              (equal key-fun
+                                     `(keymap
+                                       (118 . cua-repeat-replace-region))))
+                         (and (eq def-fun 'mode-specific-command-prefix)
+                              (equal key-fun
+                                     '(keymap
+                                       (timeout . copy-region-as-kill))))
+                         (and (eq def-fun 'Control-X-prefix)
+                              (equal key-fun
+                                     '(keymap (timeout . kill-region))))))
+                   (setq remark (list "cua-mode replacement" 'cua-mode))
+                   (cond
+                    ((eq def-fun 'mode-specific-command-prefix)
+                     (setq def-fun-txt "\"C-c prefix\""))
+                    ((eq def-fun 'Control-X-prefix)
+                     (setq def-fun-txt "\"C-x prefix\""))
+                    ((eq def-fun 'ESC-prefix)
+                     (setq def-fun-txt "\"ESC prefix\"")))
+                   (setq where "Same key")
+                   nil)
+                  ;; viper-mode specials:
+                  ((and (boundp 'viper-mode-string)
+                       (boundp 'viper-current-state)
+                        (eq viper-current-state 'vi-state)
+                        (or (and (eq def-fun 'isearch-forward)
+                                 (eq key-fun 'viper-isearch-forward))
+                            (and (eq def-fun 'isearch-backward)
+                                 (eq key-fun 'viper-isearch-backward))))
+                   ;; These bindings works as the default bindings,
+                   ;; return t
+                   t)
+                  ((when normal-erase-is-backspace
+                     (or (and (equal key [C-delete])
+                              (equal key-fun 'kill-word))
+                         (and (equal key [C-backspace])
+                              (equal key-fun 'backward-kill-word))))
+                   ;; This is the strange handling of C-delete and
+                   ;; C-backspace, return t
+                   t)
+                  (t
+                   ;; This key has indeed been rebound. Put information
+                   ;; in `remark' and return nil
+                   (setq remark
+                         (list "more info" 'current-binding
+                               key-fun def-fun key where))
+                   nil))
+          (add-to-list 'changed-keys
+                       (list key def-fun def-fun-txt where remark)))))
+    changed-keys))
+
+(defvar tutorial--tab-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map [tab] 'forward-button)
+    (define-key map [(shift tab)] 'backward-button)
+    (define-key map [(meta tab)] 'backward-button)
+    map)
+  "Keymap that allows tabbing between buttons.")
+
+(defun tutorial--display-changes (changed-keys)
+  "Display changes to some default key bindings.
+If some of the default key bindings that the tutorial depends on
+have been changed then display the changes in the tutorial buffer
+with some explanatory links.
+
+CHANGED-KEYS should be a list in the format returned by
+`tutorial--find-changed-keys'."
+  (when (or changed-keys
+            (boundp 'viper-mode-string))
+    ;; Need the custom button face for viper buttons:
+    (when (boundp 'viper-mode-string)
+      (require 'cus-edit))
+    (let ((start (point))
+          end
+          (head  (get-lang-string tutorial--lang 'tut-chgdhead))
+          (head2 (get-lang-string tutorial--lang 'tut-chgdhead2)))
+      (when (and head head2)
+        (goto-char tutorial--point-before-chkeys)
+        (insert head)
+        (insert-button head2
+                       'tutorial-buffer
+                       (current-buffer)
+                       ;;'tutorial-arg arg
+                       'action
+                       'tutorial--detailed-help
+                       'follow-link t
+                       'face 'link)
+        (insert "]\n\n" )
+        (when changed-keys
+          (dolist (tk changed-keys)
+            (let* ((def-fun     (nth 1 tk))
+                   (key         (nth 0 tk))
+                   (def-fun-txt (nth 2 tk))
+                   (where       (nth 3 tk))
+                   (remark      (nth 4 tk))
+                   (rem-fun (command-remapping def-fun))
+                   (key-txt (key-description key))
+                   (key-fun (key-binding key))
+                   tot-len)
+              (unless (eq def-fun key-fun)
+                ;; Mark the key in the tutorial text
+                (unless (string= "Same key" where)
+                  (let ((here (point))
+                       (case-fold-search nil)
+                        (key-desc (key-description key)))
+                    (cond ((string= "ESC" key-desc)
+                          (setq key-desc "<ESC>"))
+                         ((string= "RET" key-desc)
+                          (setq key-desc "<Return>"))
+                         ((string= "DEL" key-desc)
+                          (setq key-desc "<Delback>")))
+                    (while (re-search-forward
+                           (concat "[[:space:]]\\("
+                                    (regexp-quote key-desc)
+                                   "\\)[[:space:]]") nil t)
+                      (put-text-property (match-beginning 1)
+                                         (match-end 1)
+                                         'tutorial-remark 'only-colored)
+                      (put-text-property (match-beginning 1)
+                                         (match-end 1)
+                                         'face 'tutorial-warning-face)
+                      (forward-line)
+                      (let ((s  (get-lang-string tutorial--lang 'tut-chgdkey))
+                            (s2 (get-lang-string tutorial--lang 'tut-chgdkey2))
+                            (start (point))
+                            end)
+                        (when (and s s2)
+                          (setq s (format s key-desc where s2))
+                          (insert s)
+                          (insert-button s2
+                                         'tutorial-buffer
+                                         (current-buffer)
+                                         ;;'tutorial-arg arg
+                                         'action
+                                         'tutorial--detailed-help
+                                         'explain-key-desc key-desc
+                                         'follow-link t
+                                         'face 'link)
+                          (insert "] **")
+                          (insert "\n")
+                          (setq end (point))
+                          (put-text-property start end 'local-map tutorial--tab-map)
+                          ;; Add a property so we can remove the remark:
+                          (put-text-property start end 'tutorial-remark t)
+                          (put-text-property start end
+                                             'face 'tutorial-warning-face)
+                          (put-text-property start end 'read-only t))))
+                    (goto-char here)))))))
+
+
+        (setq end (point))
+        ;; Make the area with information about change key
+        ;; bindings stand out:
+        (put-text-property start end 'tutorial-remark t)
+        (put-text-property start end
+                           'face 'tutorial-warning-face)
+        ;; Make it possible to use Tab/S-Tab between fields in
+        ;; this area:
+        (put-text-property start end 'local-map tutorial--tab-map)
+        (setq tutorial--point-after-chkeys (point-marker))
+        ;; Make this area read-only:
+        (put-text-property start end 'read-only t)))))
+
+(defun tutorial--saved-dir ()
+  "Directory where to save tutorials."
+  (expand-file-name ".emacstut" "~/"))
+
+(defun tutorial--saved-file ()
+  "File name in which to save tutorials."
+  (let ((file-name tutorial--lang)
+        (ext (file-name-extension tutorial--lang)))
+    (when (or (not ext)
+              (string= ext ""))
+      (setq file-name (concat file-name ".tut")))
+    (expand-file-name file-name (tutorial--saved-dir))))
+
+(defun tutorial--remove-remarks()
+  "Remove the remark lines that was added to the tutorial buffer."
+  (save-excursion
+    (goto-char (point-min))
+    (let (prop-start
+          prop-end
+          prop-val)
+      ;; Catch the case when we already are on a remark line
+      (while (if (get-text-property (point) 'tutorial-remark)
+                 (setq prop-start (point))
+               (setq prop-start (next-single-property-change (point) 'tutorial-remark)))
+        (setq prop-end (next-single-property-change prop-start 'tutorial-remark))
+        (setq prop-val (get-text-property prop-start 'tutorial-remark))
+        (unless prop-end
+          (setq prop-end (point-max)))
+        (goto-char prop-end)
+        (if (eq prop-val 'only-colored)
+            (put-text-property prop-start prop-end 'face '(:background nil))
+          (let ((orig-text (get-text-property prop-start 'tutorial-orig)))
+            (delete-region prop-start prop-end)
+            (when orig-text (insert orig-text))))))))
+
+(defun tutorial--save-tutorial ()
+  "Save the tutorial buffer.
+This saves the part of the tutorial before and after the area
+showing changed keys.  It also saves the point position and the
+position where the display of changed bindings was inserted."
+  ;; This runs in a hook so protect it:
+  (condition-case err
+      (tutorial--save-tutorial-to (tutorial--saved-file))
+    (error (message "Error saving tutorial state: %s" (error-message-string err))
+           (sit-for 4))))
+
+(defun tutorial--save-tutorial-to (saved-file)
+  "Save the tutorial buffer to SAVED-FILE.
+See `tutorial--save-tutorial' for more information."
+  ;; Anything to save?
+  (when (or (buffer-modified-p)
+            (< 1 (point)))
+    (let ((tutorial-dir (tutorial--saved-dir))
+          save-err)
+      ;; The tutorial is saved in a subdirectory in the user home
+      ;; directory. Create this subdirectory first.
+      (unless (file-directory-p tutorial-dir)
+        (condition-case err
+            (make-directory tutorial-dir nil)
+          (error (setq save-err t)
+                 (warn "Could not create directory %s: %s" tutorial-dir
+                       (error-message-string err)))))
+      ;; Make sure we have that directory.
+      (if (file-directory-p tutorial-dir)
+          (let ((tut-point (if (= 0 tutorial--point-after-chkeys)
+                               ;; No info about changed keys is
+                               ;; displayed.
+                               (point)
+                             (if (< (point) tutorial--point-after-chkeys)
+                                 (- (point))
+                               (- (point) tutorial--point-after-chkeys))))
+                (old-point (point))
+                ;; Use a special undo list so that we easily can undo
+                ;; the changes we make to the tutorial buffer.  This is
+                ;; currently not needed since we now delete the buffer
+                ;; after saving, but kept for possible future use of
+                ;; this function.
+                buffer-undo-list
+                (inhibit-read-only t))
+            ;; Delete the area displaying info about changed keys.
+            ;;             (when (< 0 tutorial--point-after-chkeys)
+            ;;               (delete-region tutorial--point-before-chkeys
+            ;;                              tutorial--point-after-chkeys))
+            ;; Delete the remarks:
+            (tutorial--remove-remarks)
+            ;; Put the value of point first in the buffer so it will
+            ;; be saved with the tutorial.
+            (goto-char (point-min))
+            (insert (number-to-string tut-point)
+                    "\n"
+                    (number-to-string (marker-position
+                                       tutorial--point-before-chkeys))
+                    "\n")
+            (condition-case err
+                (write-region nil nil saved-file)
+              (error (setq save-err t)
+                     (warn "Could not save tutorial to %s: %s"
+                           saved-file
+                           (error-message-string err))))
+            ;; An error is raised here?? Is this a bug?
+            (condition-case err
+                (undo-only)
+              (error nil))
+            ;; Restore point
+            (goto-char old-point)
+            (if save-err
+                (message "Could not save tutorial state.")
+              (message "Saved tutorial state.")))
+        (message "Can't save tutorial: %s is not a directory"
+                 tutorial-dir)))))
+
+
+;;;###autoload
+(defun help-with-tutorial (&optional arg dont-ask-for-revert)
+  "Select the Emacs learn-by-doing tutorial.
+If there is a tutorial version written in the language
+of the selected language environment, that version is used.
+If there's no tutorial in that language, `TUTORIAL' is selected.
+With ARG, you are asked to choose which language.
+If DONT-ASK-FOR-REVERT is non-nil the buffer is reverted without
+any question when restarting the tutorial.
+
+If any of the standard Emacs key bindings that are used in the
+tutorial have been changed then an explanatory note about this is
+shown in the beginning of the tutorial buffer.
+
+When the tutorial buffer is killed the content and the point
+position in the buffer is saved so that the tutorial may be
+resumed later."
+  (interactive "P")
+  (if (boundp 'viper-current-state)
+      (let ((prompt1
+             "You can not run the Emacs tutorial directly because you have \
+enabled Viper.")
+           (prompt2 "\nThere is however a Viper tutorial you can run instead.
+Run the Viper tutorial? "))
+       (if (fboundp 'viper-tutorial)
+           (if (y-or-n-p (concat prompt1 prompt2))
+               (progn (message "")
+                      (funcall 'viper-tutorial 0))
+             (message "Tutorial aborted by user"))
+         (message prompt1)))
+    (let* ((lang (if arg
+                     (let ((minibuffer-setup-hook minibuffer-setup-hook))
+                       (add-hook 'minibuffer-setup-hook
+                                 'minibuffer-completion-help)
+                       (read-language-name 'tutorial "Language: " "English"))
+                   (if (get-language-info current-language-environment 'tutorial)
+                       current-language-environment
+                     "English")))
+           (filename (get-language-info lang 'tutorial))
+           ;; Choose a buffer name including the language so that
+           ;; several languages can be tested simultaneously:
+           (tut-buf-name (concat "TUTORIAL (" lang ")"))
+           (old-tut-buf (get-buffer tut-buf-name))
+           (old-tut-win (when old-tut-buf (get-buffer-window old-tut-buf t)))
+           (old-tut-is-ok (when old-tut-buf
+                            (not (buffer-modified-p old-tut-buf))))
+           old-tut-file
+           (old-tut-point 1))
+      (setq tutorial--point-after-chkeys (point-min))
+      ;; Try to display the tutorial buffer before asking to revert it.
+      ;; If the tutorial buffer is shown in some window make sure it is
+      ;; selected and displayed:
+      (if old-tut-win
+          (raise-frame
+           (window-frame
+            (select-window (get-buffer-window old-tut-buf t))))
+        ;; Else, is there an old tutorial buffer? Then display it:
+        (when old-tut-buf
+          (switch-to-buffer old-tut-buf)))
+      ;; Use whole frame for tutorial
+      (delete-other-windows)
+      ;; If the tutorial buffer has been changed then ask if it should
+      ;; be reverted:
+      (when (and old-tut-buf
+                 (not old-tut-is-ok))
+        (setq old-tut-is-ok
+              (if dont-ask-for-revert
+                  nil
+                (not (y-or-n-p
+                      "You have changed the Tutorial buffer.  Revert it? ")))))
+      ;; (Re)build the tutorial buffer if it is not ok
+      (unless old-tut-is-ok
+        (switch-to-buffer (get-buffer-create tut-buf-name))
+        (unless old-tut-buf (text-mode))
+        (unless lang (error "Variable lang is nil"))
+        (setq tutorial--lang lang)
+        (setq old-tut-file (file-exists-p (tutorial--saved-file)))
+        (let ((inhibit-read-only t))
+          (erase-buffer))
+        (message "Preparing tutorial ...") (sit-for 0)
+
+        ;; Do not associate the tutorial buffer with a file. Instead use
+        ;; a hook to save it when the buffer is killed.
+        (setq buffer-auto-save-file-name nil)
+        (add-hook 'kill-buffer-hook 'tutorial--save-tutorial nil t)
+
+        ;; Insert the tutorial. First offer to resume last tutorial
+        ;; editing session.
+        (when dont-ask-for-revert
+          (setq old-tut-file nil))
+        (when old-tut-file
+          (setq old-tut-file
+                (y-or-n-p "Resume your last saved tutorial? ")))
+        (if old-tut-file
+            (progn
+              (insert-file-contents (tutorial--saved-file))
+              (goto-char (point-min))
+              (setq old-tut-point
+                    (string-to-number
+                     (buffer-substring-no-properties
+                      (line-beginning-position) (line-end-position))))
+              (forward-line)
+              (setq tutorial--point-before-chkeys
+                    (string-to-number
+                     (buffer-substring-no-properties
+                      (line-beginning-position) (line-end-position))))
+              (forward-line)
+              (delete-region (point-min) (point))
+              (goto-char tutorial--point-before-chkeys)
+              (setq tutorial--point-before-chkeys (point-marker)))
+          (insert-file-contents (expand-file-name filename data-directory))
+          (forward-line)
+          (setq tutorial--point-before-chkeys (point-marker)))
+
+
+        ;; Check if there are key bindings that may disturb the
+        ;; tutorial.  If so tell the user.
+        (let ((changed-keys (tutorial--find-changed-keys tutorial--default-keys)))
+          (when changed-keys
+            (tutorial--display-changes changed-keys)))
+
+
+        ;; Clear message:
+        (unless dont-ask-for-revert
+          (message "") (sit-for 0))
+
+
+        (if old-tut-file
+            ;; Just move to old point in saved tutorial.
+            (let ((old-point
+                   (if (> 0 old-tut-point)
+                       (- old-tut-point)
+                     (+ old-tut-point tutorial--point-after-chkeys))))
+              (when (< old-point 1)
+                (setq old-point 1))
+              (goto-char old-point))
+          (goto-char (point-min))
+          (search-forward "\n<<")
+          (beginning-of-line)
+          ;; Convert the <<...>> line to the proper [...] line,
+          ;; or just delete the <<...>> line if a [...] line follows.
+          (cond ((save-excursion
+                   (forward-line 1)
+                   (looking-at "\\["))
+                 (delete-region (point) (progn (forward-line 1) (point))))
+                ((looking-at "<<Blank lines inserted.*>>")
+                 (replace-match "[Middle of page left blank for didactic purposes.   Text continues below]"))
+                (t
+                 (looking-at "<<")
+                 (replace-match "[")
+                 (search-forward ">>")
+                 (replace-match "]")))
+          (beginning-of-line)
+          (let ((n (- (window-height (selected-window))
+                      (count-lines (point-min) (point))
+                      6)))
+            (if (< n 8)
+                (progn
+                  ;; For a short gap, we don't need the [...] line,
+                  ;; so delete it.
+                  (delete-region (point) (progn (end-of-line) (point)))
+                  (newline n))
+              ;; Some people get confused by the large gap.
+              (newline (/ n 2))
+
+              ;; Skip the [...] line (don't delete it).
+              (forward-line 1)
+              (newline (- n (/ n 2)))))
+          (goto-char (point-min)))
+        (setq buffer-undo-list nil)
+        (set-buffer-modified-p nil)))))
+
+
+;; Below is some attempt to handle language specific strings. These
+;; are currently only used in the tutorial.
+
+(defconst lang-strings
+  '(
+    ("English" .
+     (
+      (tut-chgdkey . "** The key %s has been rebound, but you can use %s instead [")
+      (tut-chgdkey2 . "More information")
+      (tut-chgdhead . "
+ NOTICE: The main purpose of the Emacs tutorial is to teach you
+ the most important standard Emacs commands (key bindings).
+ However, your Emacs has been customized by changing some of
+ these basic editing commands, so it doesn't correspond to the
+ tutorial.  We have inserted colored notices where the altered
+ commands have been introduced. [")
+      (tut-chgdhead2 . "Details")
+      )
+     )
+    )
+  "Language specific strings for Emacs.
+This is an association list with the keys equal to the strings
+that can be returned by `read-language-name'.  The elements in
+the list are themselves association lists with keys that are
+string ids and values that are the language specific strings.
+
+See `get-lang-string' for more information.")
+
+(defun get-lang-string(lang stringid &optional no-eng-fallback)
+  "Get a language specific string for Emacs.
+In certain places Emacs can replace a string showed to the user with a language specific string.
+This function retrieves such strings.
+
+LANG is the language specification. It should be one of those
+strings that can be returned by `read-language-name'.  STRINGID
+is a symbol that specifies the string to retrieve.
+
+If no string is found for STRINGID in the choosen language then
+the English string is returned unless NO-ENG-FALLBACK is non-nil.
+
+See `lang-strings' for more information.
+
+Currently this feature is only used in `help-with-tutorial'."
+  (let ((my-lang-strings (assoc lang lang-strings))
+        (found-string))
+    (when my-lang-strings
+      (let ((entry (assoc stringid (cdr my-lang-strings))))
+        (when entry
+          (setq found-string (cdr entry)))))
+    ;; Fallback to English strings
+    (unless (or found-string
+                no-eng-fallback)
+      (setq found-string (get-lang-string "English" stringid t)))
+    found-string))
+
+;;(get-lang-string "English" 'tut-chgdkey)
+
+(provide 'tutorial)
+
+;; arch-tag: c8e80aef-c3bb-4ffb-8af6-22171bf0c100
+;;; tutorial.el ends here
index e63759f..c50dcf5 100644 (file)
@@ -1,3 +1,58 @@
+2006-11-26  Magnus Henoch  <mange@freemail.hu>
+
+       * url-http.el (url-http-wait-for-headers-change-function): Use
+       `when' instead of `if' when possible.
+       (url-http): Define url-http-response-version.
+       (url-http-parse-response): Set it.
+       (url-http-parse-headers): Use it to determine keep-alive behavior.
+
+2006-11-23  Diane Murray  <disumu@x3y2z1.net>
+
+       * url-http.el (url-http-content-length-after-change-function): Use
+       `url-lazy-message'.
+
+       * url-util.el (url-display-percentage): Only show a message if
+       `url-show-status' is non-nil.
+
+2006-11-15  Magnus Henoch  <mange@freemail.hu>
+
+       * url-http.el (url-http): Make proxy-object buffer-local, to
+       handle proxied asynchronous connections correctly.
+
+       * url-parse.el (url-generic-parse-url): Use with-temp-buffer.
+
+2006-11-15  Shun-ichi GOTO  <gotoh@taiyo.co.jp>  (tiny change)
+
+       * url-http.el (url-http-wait-for-headers-change-function):
+       Defer detection of HTTP 0.9 until we have at least one line.
+
+2006-11-10  Shun-ichi GOTO  <gotoh@taiyo.co.jp>  (tiny change)
+
+       * url-http.el (url-http-mark-connection-as-free)
+       (url-http-find-free-connection): Don't treat process with status
+       `connect' as free.
+       (url-http-async-sentinel): Request correct url.
+
+2006-11-08  Magnus Henoch  <mange@freemail.hu>
+
+       * url-http.el (url-http-handle-authentication): If there are
+       several authentication headers, use the strongest available
+       method.
+
+       * url.el (url-retrieve-synchronously): Allow quitting when
+       inhibit-quit is t.
+
+2006-11-03  Shun-ichi GOTO  <gotoh@taiyo.co.jp>  (tiny change)
+
+       * url-http.el (url-http-handle-authentication): If there are
+       several authentication headers, use the first with a supported
+       method.
+
+2006-11-01  Magnus Henoch  <mange@freemail.hu>
+
+       * url-http.el (url-http-create-request): Use buffer-local
+       equivalents of dynamically bound variables.
+
 2006-10-29  Magnus Henoch  <mange@freemail.hu>
 
        * url-gw.el (url-open-stream): Really use asynchronous
 
 2006-10-16  Magnus Henoch  <mange@freemail.hu>
 
-       * url-http.el (url-https-create-secure-wrapper): Always use tls
-       gateway method.
+       * url-http.el (url-https-create-secure-wrapper):
+       Always use tls gateway method.
 
 2006-10-12  Magnus Henoch  <mange@freemail.hu>
 
-       * url-http.el (url-http-find-free-connection): Handle
-       url-open-stream returning nil.
+       * url-http.el (url-http-find-free-connection):
+       Handle url-open-stream returning nil.
 
 2006-10-11  Magnus Henoch  <mange@freemail.hu>
 
 2004-11-20  Masatake YAMATO  <jet@gyve.org>
 
        * url.el (url-mm-callback): Delay the invocation
-       of `mm-destroy-parts'. Invoke `mm-destroy-parts'
+       of `mm-destroy-parts'.  Invoke `mm-destroy-parts'
        when the buffer is killed.
 
 2004-11-12  Masatake YAMATO  <jet@gyve.org>
 2004-11-02  Masatake YAMATO  <jet@gyve.org>
 
        * url-imap.el (url-imap-open-host): Don't use
-       `string-to-int'. The port returned by `url-port'
+       `string-to-int'.  The port returned by `url-port'
        is expected to be an integer.
 
        * url-irc.el (url-irc): Ditto.
        * lisp/url.el (url-retrieve-synchronously): Use sleep-for, not
        sit-for.  From monnier@gnu.org.
 
-2002-11-04  Walter C. Pelissero <walter@pelissero.org>
+2002-11-04  Walter C. Pelissero  <walter@pelissero.org>
 
        * lisp/url-methods.el (url-scheme-register-proxy): Make sure to convert
        port numbers to integers when creating the URL objects for proxies.
        * lisp/url-nfs.el: Fix `file-truname' typo.
 
        * lisp/url-news.el: Require cl when compiling.
-       (url-warn, gnus-group-read-ephemeral-group):  Autoload.
+       (url-warn, gnus-group-read-ephemeral-group): Autoload.
        (url-nntp-default-port, url-news-default-port, url-nntp): Delete.
        (url-news-fetch-newsgroup): Declare gnus-group-buffer special.
 
        * lisp/url-history.el: Avoid cl-...hash functions.
        (url): Require.
 
-       * lisp/url-gw.el, lisp/url-cookie.el:  Require cl only when compiling.
+       * lisp/url-gw.el, lisp/url-cookie.el: Require cl only when compiling.
 
 2000-10-03  William M. Perry  <wmperry@aventail.com>
 
        * configure.in: Checks to make sure that Gnus was found, since we
        HAVE to have it now.  Removed conditional compilation of url-cid.el
 
-1999-12-16  Eric Marsden <emarsden@mail.dotcom.fr>
+1999-12-16  Eric Marsden  <emarsden@mail.dotcom.fr>
 
        * lisp/url-util.el (url-get-url-at-point): Allow URLs wrapped in
        () to have periods at the end of the chunk.
        nnimap-server-buffer or `nnimap-open-server' chokes trying to use
        the current buffer as the IMAP server buffer, which fails miserably.
 
-1999-12-11  Simon Josefsson <jas@pdc.kth.se>
+1999-12-11  Simon Josefsson  <jas@pdc.kth.se>
 
        * lisp/url-imap.el: Initial (rough) implementation for IMAP urls.
 
        * lisp/url-http.el (mail-parse): Since we use functions from here,
        we should require it, eh?
 
-1999-12-10 01:57:01  Shenghuo ZHU  <zsh@cs.rochester.edu>
+1999-12-10  Shenghuo ZHU  <zsh@cs.rochester.edu>
 
        * lisp/url-cookie.el (url-cookie-multiple-line): One line cookie
        if nil.
 
 Local variables:
 coding: utf-8
+add-log-time-zone-rule: t
 End:
 
 ;; arch-tag: ac117078-3091-4533-be93-098162ac2926
index 181a4b8..ad556c3 100644 (file)
@@ -92,7 +92,7 @@ request.")
 
 (defun url-http-mark-connection-as-free (host port proc)
   (url-http-debug "Marking connection as free: %s:%d %S" host port proc)
-  (when (memq (process-status proc) '(open run))
+  (when (memq (process-status proc) '(open run connect))
     (set-process-buffer proc nil)
     (set-process-sentinel proc 'url-http-idle-sentinel)
     (puthash (cons host port)
@@ -104,7 +104,7 @@ request.")
   (let ((conns (gethash (cons host port) url-http-open-connections))
        (found nil))
     (while (and conns (not found))
-      (if (not (memq (process-status (car conns)) '(run open)))
+      (if (not (memq (process-status (car conns)) '(run open connect)))
          (progn
            (url-http-debug "Cleaning up dead process: %s:%d %S"
                            host port (car conns))
@@ -151,13 +151,15 @@ request.")
 
 (defun url-http-create-request (url &optional ref-url)
   "Create an HTTP request for URL, referred to by REF-URL."
-  (declare (special proxy-object proxy-info))
+  (declare (special proxy-object proxy-info 
+                   url-http-method url-http-data
+                   url-http-extra-headers))
   (let* ((extra-headers)
         (request nil)
-        (no-cache (cdr-safe (assoc "Pragma" url-request-extra-headers)))
+        (no-cache (cdr-safe (assoc "Pragma" url-http-extra-headers)))
         (proxy-obj (and (boundp 'proxy-object) proxy-object))
         (proxy-auth (if (or (cdr-safe (assoc "Proxy-Authorization"
-                                             url-request-extra-headers))
+                                             url-http-extra-headers))
                             (not proxy-obj))
                         nil
                       (let ((url-basic-auth-storage
@@ -166,7 +168,7 @@ request.")
         (real-fname (concat (url-filename (or proxy-obj url))
                             (url-recreate-url-attributes (or proxy-obj url))))
         (host (url-host (or proxy-obj url)))
-        (auth (if (cdr-safe (assoc "Authorization" url-request-extra-headers))
+        (auth (if (cdr-safe (assoc "Authorization" url-http-extra-headers))
                   nil
                 (url-get-authentication (or
                                          (and (boundp 'proxy-info)
@@ -191,12 +193,12 @@ request.")
                 (memq 'lastloc url-privacy-level)))
        (setq ref-url nil))
 
-    ;; url-request-extra-headers contains an assoc-list of
+    ;; url-http-extra-headers contains an assoc-list of
     ;; header/value pairs that we need to put into the request.
     (setq extra-headers (mapconcat
                         (lambda (x)
                           (concat (car x) ": " (cdr x)))
-                        url-request-extra-headers "\r\n"))
+                        url-http-extra-headers "\r\n"))
     (if (not (equal extra-headers ""))
        (setq extra-headers (concat extra-headers "\r\n")))
 
@@ -219,7 +221,7 @@ request.")
            (delq nil
             (list
              ;; The request
-             (or url-request-method "GET") " "
+             (or url-http-method "GET") " "
              (if proxy-obj (url-recreate-url proxy-obj) real-fname)
              " HTTP/" url-http-version "\r\n"
              ;; Version of MIME we speak
@@ -267,7 +269,7 @@ request.")
                                                (equal "https" (url-type url)))
              ;; If-modified-since
              (if (and (not no-cache)
-                      (member url-request-method '("GET" nil)))
+                      (member url-http-method '("GET" nil)))
                  (let ((tm (url-is-cached (or proxy-obj url))))
                    (if tm
                        (concat "If-modified-since: "
@@ -277,15 +279,15 @@ request.")
                           "Referer: " ref-url "\r\n"))
              extra-headers
              ;; Length of data
-             (if url-request-data
+             (if url-http-data
                  (concat
                   "Content-length: " (number-to-string
-                                      (length url-request-data))
+                                      (length url-http-data))
                   "\r\n"))
              ;; End request
              "\r\n"
              ;; Any data
-             url-request-data))
+             url-http-data))
            ""))
     (url-http-debug "Request is: \n%s" request)
     request))
@@ -303,21 +305,35 @@ This allows us to use `mail-fetch-field', etc."
   (declare (special status success url-http-method url-http-data
                    url-callback-function url-callback-arguments))
   (url-http-debug "Handling %s authentication" (if proxy "proxy" "normal"))
-  (let ((auth (or (mail-fetch-field (if proxy "proxy-authenticate" "www-authenticate"))
-                 "basic"))
+  (let ((auths (or (nreverse
+                   (mail-fetch-field
+                    (if proxy "proxy-authenticate" "www-authenticate")
+                    nil nil t))
+                 '("basic")))
        (type nil)
        (url (url-recreate-url url-current-object))
        (url-basic-auth-storage 'url-http-real-basic-auth-storage)
-       )
-
+       auth
+       (strength 0))
     ;; Cheating, but who cares? :)
     (if proxy
        (setq url-basic-auth-storage 'url-http-proxy-basic-auth-storage))
 
-    (setq auth (url-eat-trailing-space (url-strip-leading-spaces auth)))
-    (if (string-match "[ \t]" auth)
-       (setq type (downcase (substring auth 0 (match-beginning 0))))
-      (setq type (downcase auth)))
+    ;; find strongest supported auth
+    (dolist (this-auth auths)
+      (setq this-auth (url-eat-trailing-space 
+                      (url-strip-leading-spaces 
+                       this-auth)))
+      (let* ((this-type 
+             (if (string-match "[ \t]" this-auth)
+                 (downcase (substring this-auth 0 (match-beginning 0)))
+               (downcase this-auth)))
+            (registered (url-auth-registered this-type))
+            (this-strength (cddr registered)))
+       (when (and registered (> this-strength strength))
+         (setq auth this-auth
+               type this-type
+               strength this-strength))))
 
     (if (not (url-auth-registered type))
        (progn
@@ -342,14 +358,19 @@ This allows us to use `mail-fetch-field', etc."
 
 (defun url-http-parse-response ()
   "Parse just the response code."
-  (declare (special url-http-end-of-headers url-http-response-status))
+  (declare (special url-http-end-of-headers url-http-response-status
+                   url-http-response-version))
   (if (not url-http-end-of-headers)
       (error "Trying to parse HTTP response code in odd buffer: %s" (buffer-name)))
   (url-http-debug "url-http-parse-response called in (%s)" (buffer-name))
   (goto-char (point-min))
   (skip-chars-forward " \t\n")         ; Skip any blank crap
   (skip-chars-forward "HTTP/")         ; Skip HTTP Version
-  (read (current-buffer))
+  (setq url-http-response-version
+       (buffer-substring (point)
+                         (progn
+                           (skip-chars-forward "[0-9].")
+                           (point))))
   (setq url-http-response-status (read (current-buffer))))
 
 (defun url-http-handle-cookies ()
@@ -375,6 +396,7 @@ should be shown to the user."
   ;; The comments after each status code handled are taken from RFC
   ;; 2616 (HTTP/1.1)
   (declare (special url-http-end-of-headers url-http-response-status
+                   url-http-response-version
                    url-http-method url-http-data url-http-process
                    url-callback-function url-callback-arguments))
 
@@ -391,9 +413,19 @@ should be shown to the user."
   (mail-narrow-to-head)
   ;;(narrow-to-region (point-min) url-http-end-of-headers)
   (let ((connection (mail-fetch-field "Connection")))
-    (if (and connection
-            (string= (downcase connection) "close"))
+    ;; In HTTP 1.0, keep the connection only if there is a
+    ;; "Connection: keep-alive" header.
+    ;; In HTTP 1.1 (and greater), keep the connection unless there is a
+    ;; "Connection: close" header
+    (cond 
+     ((string= url-http-response-version "1.0")
+      (unless (and connection
+                  (string= (downcase connection) "keep-alive"))
        (delete-process url-http-process)))
+     (t
+      (when (and connection
+                (string= (downcase connection) "close"))
+       (delete-process url-http-process)))))
   (let ((class nil)
        (success nil))
     (setq class (/ url-http-response-status 100))
@@ -803,7 +835,7 @@ the callback to be triggered."
       (progn
        ;; Found the end of the document!  Wheee!
        (url-display-percentage nil nil)
-       (message "Reading... done.")
+       (url-lazy-message "Reading... done.")
        (if (url-http-parse-headers)
            (url-http-activate-callback)))))
 
@@ -912,122 +944,121 @@ the end of the document."
                    url-http-response-status))
   (url-http-debug "url-http-wait-for-headers-change-function (%s)"
                  (buffer-name))
-  (if (not (bobp))
-      (let ((end-of-headers nil)
-           (old-http nil)
-           (content-length nil))
-       (goto-char (point-min))
-       (if (not (looking-at "^HTTP/[1-9]\\.[0-9]"))
-           ;; Not HTTP/x.y data, must be 0.9
-           ;; God, I wish this could die.
-           (setq end-of-headers t
-                 url-http-end-of-headers 0
-                 old-http t)
-         (if (re-search-forward "^\r*$" nil t)
-             ;; Saw the end of the headers
-             (progn
-               (url-http-debug "Saw end of headers... (%s)" (buffer-name))
-               (setq url-http-end-of-headers (set-marker (make-marker)
-                                                         (point))
-                     end-of-headers t)
-               (url-http-clean-headers))))
-
-       (if (not end-of-headers)
-           ;; Haven't seen the end of the headers yet, need to wait
-           ;; for more data to arrive.
-           nil
-         (if old-http
-             (message "HTTP/0.9 How I hate thee!")
-           (progn
-             (url-http-parse-response)
-             (mail-narrow-to-head)
-             ;;(narrow-to-region (point-min) url-http-end-of-headers)
-             (setq url-http-transfer-encoding (mail-fetch-field
-                                               "transfer-encoding")
-                   url-http-content-type (mail-fetch-field "content-type"))
-             (if (mail-fetch-field "content-length")
-                 (setq url-http-content-length
-                       (string-to-number (mail-fetch-field "content-length"))))
-             (widen)))
-         (if url-http-transfer-encoding
-             (setq url-http-transfer-encoding
-                   (downcase url-http-transfer-encoding)))
-
-         (cond
-          ((or (= url-http-response-status 204)
-               (= url-http-response-status 205))
-           (url-http-debug "%d response must have headers only (%s)."
-                           url-http-response-status (buffer-name))
-           (if (url-http-parse-headers)
-               (url-http-activate-callback)))
-          ((string= "HEAD" url-http-method)
-           ;; A HEAD request is _ALWAYS_ terminated by the header
-           ;; information, regardless of any entity headers,
-           ;; according to section 4.4 of the HTTP/1.1 draft.
-           (url-http-debug "HEAD request must have headers only (%s)."
-                           (buffer-name))
-           (if (url-http-parse-headers)
-               (url-http-activate-callback)))
-          ((string= "CONNECT" url-http-method)
-           ;; A CONNECT request is finished, but we cannot stick this
-           ;; back on the free connectin list
-           (url-http-debug "CONNECT request must have headers only.")
-           (if (url-http-parse-headers)
-               (url-http-activate-callback)))
-          ((equal url-http-response-status 304)
-           ;; Only allowed to have a header section.  We have to handle
-           ;; this here instead of in url-http-parse-headers because if
-           ;; you have a cached copy of something without a known
-           ;; content-length, and try to retrieve it from the cache, we'd
-           ;; fall into the 'being dumb' section and wait for the
-           ;; connection to terminate, which means we'd wait for 10
-           ;; seconds for the keep-alives to time out on some servers.
-           (if (url-http-parse-headers)
-               (url-http-activate-callback)))
-          (old-http
-           ;; HTTP/0.9 always signaled end-of-connection by closing the
-           ;; connection.
+  (when (not (bobp))
+    (let ((end-of-headers nil)
+         (old-http nil)
+         (content-length nil))
+      (goto-char (point-min))
+      (if (and (looking-at ".*\n")     ; have one line at least
+              (not (looking-at "^HTTP/[1-9]\\.[0-9]")))
+         ;; Not HTTP/x.y data, must be 0.9
+         ;; God, I wish this could die.
+         (setq end-of-headers t
+               url-http-end-of-headers 0
+               old-http t)
+       (when (re-search-forward "^\r*$" nil t)
+         ;; Saw the end of the headers
+         (url-http-debug "Saw end of headers... (%s)" (buffer-name))
+         (setq url-http-end-of-headers (set-marker (make-marker)
+                                                   (point))
+               end-of-headers t)
+         (url-http-clean-headers)))
+
+      (if (not end-of-headers)
+         ;; Haven't seen the end of the headers yet, need to wait
+         ;; for more data to arrive.
+         nil
+       (if old-http
+           (message "HTTP/0.9 How I hate thee!")
+         (progn
+           (url-http-parse-response)
+           (mail-narrow-to-head)
+           ;;(narrow-to-region (point-min) url-http-end-of-headers)
+           (setq url-http-transfer-encoding (mail-fetch-field
+                                             "transfer-encoding")
+                 url-http-content-type (mail-fetch-field "content-type"))
+           (if (mail-fetch-field "content-length")
+               (setq url-http-content-length
+                     (string-to-number (mail-fetch-field "content-length"))))
+           (widen)))
+       (when url-http-transfer-encoding
+         (setq url-http-transfer-encoding
+               (downcase url-http-transfer-encoding)))
+
+       (cond
+        ((or (= url-http-response-status 204)
+             (= url-http-response-status 205))
+         (url-http-debug "%d response must have headers only (%s)."
+                         url-http-response-status (buffer-name))
+         (when (url-http-parse-headers)
+           (url-http-activate-callback)))
+        ((string= "HEAD" url-http-method)
+         ;; A HEAD request is _ALWAYS_ terminated by the header
+         ;; information, regardless of any entity headers,
+         ;; according to section 4.4 of the HTTP/1.1 draft.
+         (url-http-debug "HEAD request must have headers only (%s)."
+                         (buffer-name))
+         (when (url-http-parse-headers)
+           (url-http-activate-callback)))
+        ((string= "CONNECT" url-http-method)
+         ;; A CONNECT request is finished, but we cannot stick this
+         ;; back on the free connectin list
+         (url-http-debug "CONNECT request must have headers only.")
+         (when (url-http-parse-headers)
+           (url-http-activate-callback)))
+        ((equal url-http-response-status 304)
+         ;; Only allowed to have a header section.  We have to handle
+         ;; this here instead of in url-http-parse-headers because if
+         ;; you have a cached copy of something without a known
+         ;; content-length, and try to retrieve it from the cache, we'd
+         ;; fall into the 'being dumb' section and wait for the
+         ;; connection to terminate, which means we'd wait for 10
+         ;; seconds for the keep-alives to time out on some servers.
+         (when (url-http-parse-headers)
+           (url-http-activate-callback)))
+        (old-http
+         ;; HTTP/0.9 always signaled end-of-connection by closing the
+         ;; connection.
+         (url-http-debug
+          "Saw HTTP/0.9 response, connection closed means end of document.")
+         (setq url-http-after-change-function
+               'url-http-simple-after-change-function))
+        ((equal url-http-transfer-encoding "chunked")
+         (url-http-debug "Saw chunked encoding.")
+         (setq url-http-after-change-function
+               'url-http-chunked-encoding-after-change-function)
+         (when (> nd url-http-end-of-headers)
            (url-http-debug
-            "Saw HTTP/0.9 response, connection closed means end of document.")
-           (setq url-http-after-change-function
-                 'url-http-simple-after-change-function))
-          ((equal url-http-transfer-encoding "chunked")
-           (url-http-debug "Saw chunked encoding.")
-           (setq url-http-after-change-function
-                 'url-http-chunked-encoding-after-change-function)
-           (if (> nd url-http-end-of-headers)
-               (progn
-                 (url-http-debug
-                  "Calling initial chunked-encoding for extra data at end of headers")
-                 (url-http-chunked-encoding-after-change-function
-                  (marker-position url-http-end-of-headers) nd
-                  (- nd url-http-end-of-headers)))))
-          ((integerp url-http-content-length)
+            "Calling initial chunked-encoding for extra data at end of headers")
+           (url-http-chunked-encoding-after-change-function
+            (marker-position url-http-end-of-headers) nd
+            (- nd url-http-end-of-headers))))
+        ((integerp url-http-content-length)
+         (url-http-debug
+          "Got a content-length, being smart about document end.")
+         (setq url-http-after-change-function
+               'url-http-content-length-after-change-function)
+         (cond
+          ((= 0 url-http-content-length)
+           ;; We got a NULL body!  Activate the callback
+           ;; immediately!
            (url-http-debug
-            "Got a content-length, being smart about document end.")
-           (setq url-http-after-change-function
-                 'url-http-content-length-after-change-function)
-           (cond
-            ((= 0 url-http-content-length)
-             ;; We got a NULL body!  Activate the callback
-             ;; immediately!
-             (url-http-debug
-              "Got 0-length content-length, activating callback immediately.")
-             (if (url-http-parse-headers)
-                 (url-http-activate-callback)))
-            ((> nd url-http-end-of-headers)
-             ;; Have some leftover data
-             (url-http-debug "Calling initial content-length for extra data at end of headers")
-             (url-http-content-length-after-change-function
-              (marker-position url-http-end-of-headers)
-              nd
-              (- nd url-http-end-of-headers)))
-            (t
-             nil)))
+            "Got 0-length content-length, activating callback immediately.")
+           (when (url-http-parse-headers)
+             (url-http-activate-callback)))
+          ((> nd url-http-end-of-headers)
+           ;; Have some leftover data
+           (url-http-debug "Calling initial content-length for extra data at end of headers")
+           (url-http-content-length-after-change-function
+            (marker-position url-http-end-of-headers)
+            nd
+            (- nd url-http-end-of-headers)))
           (t
-           (url-http-debug "No content-length, being dumb.")
-           (setq url-http-after-change-function
-                 'url-http-simple-after-change-function)))))
+           nil)))
+        (t
+         (url-http-debug "No content-length, being dumb.")
+         (setq url-http-after-change-function
+               'url-http-simple-after-change-function)))))
     ;; We are still at the beginning of the buffer... must just be
     ;; waiting for a response.
     (url-http-debug "Spinning waiting for headers..."))
@@ -1054,7 +1085,8 @@ CBARGS as the arguments."
                    url-http-chunked-length
                    url-http-chunked-start
                    url-http-chunked-counter
-                   url-http-process))
+                   url-http-process
+                   proxy-object))
   (let ((connection (url-http-find-free-connection (url-host url)
                                                   (url-port url)))
        (buffer (generate-new-buffer (format " *http %s:%d*"
@@ -1077,6 +1109,7 @@ CBARGS as the arguments."
                       url-http-content-length
                       url-http-transfer-encoding
                       url-http-after-change-function
+                      url-http-response-version
                       url-http-response-status
                       url-http-chunked-length
                       url-http-chunked-counter
@@ -1089,6 +1122,7 @@ CBARGS as the arguments."
                       url-http-data
                       url-http-target-url))
          (set (make-local-variable var) nil))
+       (make-local-variable 'proxy-object)
 
        (setq url-http-method (or url-request-method "GET")
              url-http-extra-headers url-request-extra-headers
@@ -1128,7 +1162,7 @@ CBARGS as the arguments."
     (cond
      ((string= (substring why 0 4) "open")
       (set-process-sentinel proc 'url-http-end-of-document-sentinel)
-      (process-send-string proc (url-http-create-request url-current-object)))
+      (process-send-string proc (url-http-create-request url-http-target-url)))
      (t
       (setf (car url-callback-arguments)
            (nconc (list :error (list 'error 'connection-failed why
index 2e4fc8a..bda3036 100644 (file)
@@ -135,8 +135,7 @@ Format is:
       (url-set-full retval nil)
       retval))
    (t
-    (save-excursion
-      (set-buffer (get-buffer-create " *urlparse*"))
+    (with-temp-buffer
       (set-syntax-table url-parse-syntax-table)
       (let ((save-pos nil)
            (prot nil)
index 0aeb141..57c0f05 100644 (file)
@@ -244,12 +244,13 @@ Will not do anything if `url-show-status' is nil."
 
 ;;;###autoload
 (defun url-display-percentage (fmt perc &rest args)
-  (if (null fmt)
-      (if (fboundp 'clear-progress-display)
-         (clear-progress-display))
-    (if (and (fboundp 'progress-display) perc)
-       (apply 'progress-display fmt perc args)
-      (apply 'message fmt args))))
+  (when url-show-status
+    (if (null fmt)
+       (if (fboundp 'clear-progress-display)
+           (clear-progress-display))
+      (if (and (fboundp 'progress-display) perc)
+         (apply 'progress-display fmt perc args)
+       (apply 'message fmt args)))))
 
 ;;;###autoload
 (defun url-percentage (x y)
index 6e4dfa0..a95c7e3 100644 (file)
@@ -246,10 +246,16 @@ no further processing).  URL is either a string or a parsed URL."
             ;; interrupt it before it got a chance to handle process input.
             ;; `sleep-for' was tried but it lead to other forms of
             ;; hanging.  --Stef
-            (unless (or (accept-process-output proc) (null proc))
+            (unless (or (with-local-quit 
+                         (accept-process-output proc))
+                       (null proc))
               ;; accept-process-output returned nil, maybe because the process
-              ;; exited (and may have been replaced with another).
-              (setq proc (get-buffer-process asynch-buffer))))))
+              ;; exited (and may have been replaced with another).  If we got
+             ;; a quit, just stop.
+             (when quit-flag
+               (delete-process proc))
+              (setq proc (and (not quit-flag)
+                             (get-buffer-process asynch-buffer)))))))
       asynch-buffer)))
 
 (defun url-mm-callback (&rest ignored)
index 8a539da..3be854b 100644 (file)
@@ -87,9 +87,9 @@ in any way you like."
 (defun ask-user-about-lock-help ()
   (with-output-to-temp-buffer "*Help*"
     (princ "It has been detected that you want to modify a file that someone else has
-already started modifying in EMACS.
+already started modifying in Emacs.
 
-You can <s>teal the file; The other user becomes the
+You can <s>teal the file; the other user becomes the
   intruder if (s)he ever unmodifies the file and then changes it again.
 You can <p>roceed; you edit at your own (and the other user's) risk.
 You can <q>uit; don't modify this file.")
index c48ce7a..0394c11 100644 (file)
@@ -95,22 +95,38 @@ This is only meaningful if you don't use the implicit checkout model
   ;; :group 'vc
   )
 
+(defvar vc-svn-admin-directory
+  (cond ((and (eq system-type 'windows-nt)
+             (getenv "SVN_ASP_DOT_NET_HACK"))
+        "_svn")
+       (t ".svn"))
+  "The name of the \".svn\" subdirectory or its equivalent.")
+
 ;;;
 ;;; State-querying functions
 ;;;
 
+;;; vc-svn-admin-directory is generally not defined when the
+;;; autoloaded function is called.
+
 ;;;###autoload (defun vc-svn-registered (f)
-;;;###autoload   (when (file-readable-p (expand-file-name
-;;;###autoload                           ".svn/entries" (file-name-directory f)))
+;;;###autoload   (let ((admin-dir (cond ((and (eq system-type 'windows-nt)
+;;;###autoload                                (getenv "SVN_ASP_DOT_NET_HACK"))
+;;;###autoload                           "_svn")
+;;;###autoload                          (t ".svn"))))
+;;;###autoload     (when (file-readable-p (expand-file-name
+;;;###autoload                             (concat admin-dir "/entries")
+;;;###autoload                             (file-name-directory f)))
 ;;;###autoload       (load "vc-svn")
-;;;###autoload       (vc-svn-registered f)))
+;;;###autoload       (vc-svn-registered f))))
 
 ;;;###autoload
 (add-to-list 'completion-ignored-extensions ".svn/")
 
 (defun vc-svn-registered (file)
   "Check if FILE is SVN registered."
-  (when (file-readable-p (expand-file-name ".svn/entries"
+  (when (file-readable-p (expand-file-name (concat vc-svn-admin-directory
+                                                  "/entries")
                                           (file-name-directory file)))
     (with-temp-buffer
       (cd (file-name-directory file))
@@ -206,7 +222,7 @@ the SVN command (in that order)."
 
 (defun vc-svn-responsible-p (file)
   "Return non-nil if SVN thinks it is responsible for FILE."
-  (file-directory-p (expand-file-name ".svn"
+  (file-directory-p (expand-file-name vc-svn-admin-directory
                                      (if (file-directory-p file)
                                          file
                                        (file-name-directory file)))))
@@ -474,7 +490,9 @@ and that it passes `vc-svn-global-switches' to it before FLAGS."
     (let ((coding-system-for-read
           (or file-name-coding-system
               default-file-name-coding-system)))
-      (vc-insert-file (expand-file-name ".svn/entries" dirname)))
+      (vc-insert-file (expand-file-name (concat vc-svn-admin-directory
+                                               "/entries")
+                                       dirname)))
     (goto-char (point-min))
     (when (re-search-forward
           ;; Old `svn' used name="svn:dir", newer use just name="".
index e6ed5fb..d975d89 100644 (file)
@@ -27,7 +27,7 @@
 
 ;;; Code:
 
-(defconst emacs-version "22.0.91" "\
+(defconst emacs-version "23.0.51" "\
 Version numbers of this version of Emacs.")
 
 (defconst emacs-major-version
index 649d3a2..40e7f46 100644 (file)
@@ -44,7 +44,7 @@
     map))
 
 (defun subprocess-input (name str)
-  "Handles input from a subprocess.  Called by Emacs."
+  "Handle input from a subprocess.  Called by Emacs."
   (if display-subprocess-window
       (display-buffer subprocess-buf))
   (with-current-buffer subprocess-buf
@@ -56,7 +56,7 @@
   (setq subprocess-running nil))
 
 (defun start-subprocess ()
-  "Spawns an asynchronous subprocess with output redirected to
+  "Spawn an asynchronous subprocess with output redirected to
 the buffer *COMMAND*.  Within this buffer, use C-m to send
 the last line to the subprocess or to bring another line to
 the end."
@@ -98,7 +98,7 @@ the end."
   ;;     (delete-file output-filename))))
 
 (defun subprocess-command ()
-  "Starts asynchronous subprocess if not running and switches to its window."
+  "Start asynchronous subprocess if not running and switch to its window."
   (interactive)
   (if (not subprocess-running)
       (start-subprocess))
@@ -106,8 +106,8 @@ the end."
        (progn (pop-to-buffer subprocess-buf) (goto-char (point-max)))))
 
 (defun command-send-input ()
-  "If at last line of buffer, sends the current line to
-the spawned subprocess.  Otherwise brings back current
+  "If at last line of buffer, send the current line to
+the spawned subprocess.  Otherwise bring back current
 line to the last line for resubmission."
   (interactive)
   (beginning-of-line)
@@ -134,7 +134,7 @@ line to the last line for resubmission."
          current-line)))))
 
 (defun command-kill-line ()
-  "Kills the current line.  Used in command mode."
+  "Kill the current line.  Used in command mode."
   (interactive)
   (beginning-of-line)
   (kill-line))
index 541f06e..0686218 100644 (file)
@@ -29,7 +29,7 @@
 ;;; Code:
 
 (defvar led-state (make-vector 5 nil)
-   "The internal state of the LEDs.  Choices are nil, t, `flash.
+   "The internal state of the LEDs.  Choices are nil, t, `flash'.
 Element 0 is not used.")
 
 (defun led-flash (l)
@@ -46,7 +46,7 @@ Element 0 is not used.")
   (led-update))
 
 (defun led-on (l)
-  "Turn on LED l."
+  "Turn on LED L."
   (aset led-state l t)
   (led-update))
 
index bb82927..cdb743c 100644 (file)
@@ -194,7 +194,7 @@ It can be overriden by setting a buffer local variable
   :group 'whitespace)
 
 (defcustom whitespace-spacetab-regexp "[ ]+\t"
-  "Regexp to match a space followed by a TAB."
+  "Regexp to match one or more spaces followed by a TAB."
   :type 'regexp
   :group 'whitespace)
 
@@ -205,8 +205,9 @@ It can be overriden by setting a buffer local variable
   :type 'boolean
   :group 'whitespace)
 
-(defcustom whitespace-indent-regexp (concat "^\\(\t*\\)    " "    ")
-  "Regexp to match (any TABS followed by) 8/more whitespaces at start of line."
+(defcustom whitespace-indent-regexp "^\t*\\(        \\)+"
+  "Regexp to match multiples of eight spaces near line beginnings.
+The default value ignores leading TABs."
   :type 'regexp
   :group 'whitespace)
 
@@ -217,9 +218,8 @@ It can be overriden by setting a buffer local variable
   :type 'boolean
   :group 'whitespace)
 
-;; (defcustom whitespace-ateol-regexp "[ \t]$"
 (defcustom whitespace-ateol-regexp "[ \t]+$"
-  "Regexp to match a TAB or a space at the EOL."
+  "Regexp to match one or more TABs or spaces at line ends."
   :type 'regexp
   :group 'whitespace)
 
@@ -425,7 +425,8 @@ and:
        (progn
          (whitespace-check-buffer-list (buffer-name) buffer-file-name)
          (whitespace-tickle-timer)
-         (whitespace-unhighlight-the-space)
+         (overlay-recenter (point-max))
+         (remove-overlays nil nil 'face 'whitespace-highlight)
          (if whitespace-auto-cleanup
              (if buffer-read-only
                  (if (not quiet)
@@ -591,74 +592,53 @@ See `whitespace-buffer' docstring for a summary of the problems."
     (whitespace-buffer t)))
 
 (defun whitespace-buffer-leading ()
-  "Check to see if there are any empty lines at the top of the file."
+  "Return t if the current buffer has leading newline characters.
+If highlighting is enabled, highlight these characters."
   (save-excursion
-    (let ((pmin nil)
-         (pmax nil))
-      (goto-char (point-min))
-      (beginning-of-line)
-      (setq pmin (point))
-      (end-of-line)
-      (setq pmax (point))
-      (if (equal pmin pmax)
-         (progn
-           (whitespace-highlight-the-space pmin (1+ pmax))
-           t)
-       nil))))
+    (goto-char (point-min))
+    (skip-chars-forward "\n")
+    (unless (bobp)
+      (whitespace-highlight-the-space (point-min) (point))
+      t)))
 
 (defun whitespace-buffer-leading-cleanup ()
-  "Remove any empty lines at the top of the file."
+  "Remove any leading newline characters from current buffer."
   (save-excursion
     (goto-char (point-min))
     (skip-chars-forward "\n")
     (delete-region (point-min) (point))))
 
 (defun whitespace-buffer-trailing ()
-  "Check to see if are is more than one empty line at the bottom."
+  "Return t if the current buffer has extra trailing newline characters.
+If highlighting is enabled, highlight these characters."
   (save-excursion
-    (let ((pmin nil)
-         (pmax nil))
-      (goto-char (point-max))
-      (beginning-of-line)
-      (setq pmin (point))
-      (end-of-line)
-      (setq pmax (point))
-      (if (equal pmin pmax)
-         (progn
-           (goto-char (- (point) 1))
-           (beginning-of-line)
-           (setq pmin (point))
-           (end-of-line)
-           (setq pmax (point))
-           (if (equal pmin pmax)
-               (progn
-                 (whitespace-highlight-the-space (- pmin 1) pmax)
-                 t)
-             nil))
-       nil))))
+    (goto-char (point-max))
+    (skip-chars-backward "\n")
+    (forward-line)
+    (unless (eobp)
+      (whitespace-highlight-the-space (point) (point-max))
+      t)))
 
 (defun whitespace-buffer-trailing-cleanup ()
-  "Delete all the empty lines at the bottom."
+  "Remove extra trailing newline characters from current buffer."
   (save-excursion
     (goto-char (point-max))
     (skip-chars-backward "\n")
-    (if (not (bolp))
-       (forward-char 1))
-    (delete-region (point) (point-max))))
+    (unless (eobp)
+      (forward-line)
+      (delete-region (point) (point-max)))))
 
 (defun whitespace-buffer-search (regexp)
   "Search for any given whitespace REGEXP."
-  (let ((whitespace-retval ""))
-    (save-excursion
-      (goto-char (point-min))
-      (while (re-search-forward regexp nil t)
-       (progn
-         (setq whitespace-retval (format "%s %s" whitespace-retval
-                                       (match-beginning 0)))
-       (whitespace-highlight-the-space (match-beginning 0) (match-end 0))))
-      (if (equal "" whitespace-retval)
-         nil
-       whitespace-retval))))
+  (with-local-quit
+    (let (whitespace-retval)
+      (save-excursion
+       (goto-char (point-min))
+       (while (re-search-forward regexp nil t)
+         (whitespace-highlight-the-space (match-beginning 0) (match-end 0))
+         (push (match-beginning 0) whitespace-retval)))
+      (when whitespace-retval
+       (format " %s" (nreverse whitespace-retval))))))
 
 (defun whitespace-buffer-cleanup (regexp newregexp)
   "Search for any given whitespace REGEXP and replace it with the NEWREGEXP."
@@ -713,17 +693,14 @@ Also with whitespaces whose testing has been turned off."
   "Highlight the current line, unhighlighting a previously jumped to line."
   (if whitespace-display-spaces-in-color
       (let ((ol (whitespace-make-overlay b e)))
-       (push ol whitespace-highlighted-space)
        (whitespace-overlay-put ol 'face 'whitespace-highlight))))
-;;  (add-hook 'pre-command-hook 'whitespace-unhighlight-the-space))
 
 (defun whitespace-unhighlight-the-space()
   "Unhighlight the currently highlight line."
   (if (and whitespace-display-spaces-in-color whitespace-highlighted-space)
       (progn
        (mapc 'whitespace-delete-overlay whitespace-highlighted-space)
-       (setq whitespace-highlighted-space nil))
-    (remove-hook 'pre-command-hook 'whitespace-unhighlight-the-space)))
+       (setq whitespace-highlighted-space nil))))
 
 (defun whitespace-check-buffer-list (buf-name buf-file)
   "Add a buffer and its file to the whitespace monitor list.
@@ -780,7 +757,7 @@ If timer is not set, then set it to scan the files in
          (whitespace-refresh-rescan-list buffile bufname))))))
 
 (defun whitespace-refresh-rescan-list (buffile bufname)
-  "Refresh the list of files to be rescaned for whitespace creep."
+  "Refresh the list of files to be rescanned for whitespace creep."
   (if whitespace-all-buffer-files
       (setq whitespace-all-buffer-files
            (delete (list buffile bufname) whitespace-all-buffer-files))
index af41424..7d57236 100644 (file)
@@ -598,7 +598,7 @@ automatically."
   :type 'directory)
 
 (defcustom widget-image-enable t
-  "If non nil, use image buttons in widgets when available."
+  "If non-nil, use image buttons in widgets when available."
   :version "21.1"
   :group 'widgets
   :type 'boolean)
@@ -1719,7 +1719,7 @@ If END is omitted, it defaults to the length of LIST."
 ;;; The `push-button' Widget.
 
 ;; (defcustom widget-push-button-gui t
-;;   "If non nil, use GUI push buttons when available."
+;;   "If non-nil, use GUI push buttons when available."
 ;;   :group 'widgets
 ;;   :type 'boolean)
 
@@ -2562,7 +2562,7 @@ Return an alist of (TYPE MATCH)."
 ;;; The `editable-list' Widget.
 
 ;; (defcustom widget-editable-list-gui nil
-;;   "If non nil, use GUI push-buttons in editable list when available."
+;;   "If non-nil, use GUI push-buttons in editable list when available."
 ;;   :type 'boolean
 ;;   :group 'widgets)
 
index ac4fc0b..2316eb9 100644 (file)
@@ -795,8 +795,11 @@ and the buffer that is killed or buried is the one in that window."
 (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'.")
+(defvar mouse-autoselect-window-state nil
+  "When non-nil, special state of delayed window autoselection.
+Possible values are `suspend' \(suspend autoselection after a menu or
+scrollbar interaction\) and `select' \(the next invocation of
+'handle-select-window' shall select the window immediately\).")
 
 (defun mouse-autoselect-window-cancel (&optional force)
   "Cancel delayed window autoselection.
@@ -806,32 +809,26 @@ Optional argument FORCE means cancel unconditionally."
               (eq this-command 'scroll-bar-toolkit-scroll)
               (memq (nth 4 (event-end last-input-event))
                     '(handle end-scroll)))
-    (setq mouse-autoselect-window-now nil)
+    (setq mouse-autoselect-window-state 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)
+(defun mouse-autoselect-window-start (mouse-position &optional window suspend)
   "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-POSITION is the last position where the mouse was seen as returned
+by `mouse-position'.  Optional argument WINDOW non-nil denotes the
+window where the mouse was seen.  Optional argument SUSPEND non-nil
+means suspend autoselection."
+  ;; Record values for MOUSE-POSITION, WINDOW, and SUSPEND.
+  (setq mouse-autoselect-window-position mouse-position)
+  (when window (setq mouse-autoselect-window-window window))
+  (setq mouse-autoselect-window-state (when suspend 'suspend))
+  ;; Install timer which runs `mouse-autoselect-window-select' after
   ;; `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))
+        (abs mouse-autoselect-window) nil 'mouse-autoselect-window-select)))
 
 (defun mouse-autoselect-window-select ()
   "Select window with delayed window autoselection.
@@ -840,9 +837,21 @@ 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))))
+            (window
+             (condition-case nil
+                 (window-at (cadr mouse-position) (cddr mouse-position)
+                            (car mouse-position))
+               (error nil))))
        (cond
+        ((or (menu-or-popup-active-p)
+             (and window
+                  (not (coordinates-in-window-p (cdr mouse-position) window))))
+         ;; A menu / popup dialog is active or the mouse is on the scroll-bar
+         ;; of WINDOW, temporarily suspend delayed autoselection.
+         (mouse-autoselect-window-start mouse-position nil t))
+        ((eq mouse-autoselect-window-state 'suspend)
+         ;; Delayed autoselection was temporarily suspended, reenable it.
+         (mouse-autoselect-window-start mouse-position))
         ((and window (not (eq window (selected-window)))
               (or (not (numberp mouse-autoselect-window))
                   (and (> mouse-autoselect-window 0)
@@ -851,24 +860,23 @@ active.  This function is run by `mouse-autoselect-window-timer'."
                        (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.
+                  ;; starting autoselection 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 position has stabilized in non-selected window: Cancel
+         ;; delayed 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.
+         ;; autoselection again, set `mouse-autoselect-window-state'."
          (unless (window-minibuffer-p (selected-window))
-           (setq mouse-autoselect-window-now t)
+           (setq mouse-autoselect-window-state 'select)
            (setq unread-command-events
                  (cons (list 'select-window (list window))
                        unread-command-events))))
@@ -876,14 +884,12 @@ active.  This function is run by `mouse-autoselect-window-timer'."
              (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-position': Cancel delayed 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))))
+         ;; Mouse position has not stabilized yet, resume delayed
+         ;; autoselection.
+         (mouse-autoselect-window-start mouse-position window))))
     (error nil)))
 
 (defun handle-select-window (event)
@@ -901,14 +907,18 @@ active.  This function is run by `mouse-autoselect-window-timer'."
                   (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)
+                  (not (eq mouse-autoselect-window-state 'select))
+                  (progn
+                    ;; Cancel any delayed autoselection.
+                    (mouse-autoselect-window-cancel t)
+                    ;; Start delayed autoselection from current mouse position
+                    ;; and window.
+                    (mouse-autoselect-window-start (mouse-position) window)
+                    ;; Executing a command cancels delayed autoselection.
+                    (add-hook
+                     'pre-command-hook 'mouse-autoselect-window-cancel)))
+       ;; Reset state of delayed autoselection.
+       (setq mouse-autoselect-window-state nil)
        (when mouse-autoselect-window
          ;; Run `mouse-leave-buffer-hook' when autoselecting window.
          (run-hooks 'mouse-leave-buffer-hook))
index 48e46e4..72772f5 100644 (file)
+2006-11-27  Andreas Schwab  <schwab@suse.de>
+
+       * Makefile.in (usermanualdir): Define.
+       (emacs-lisp-intro.dvi): Pass -I options to texi2dvi instead of
+       using TEXINPUTS.
+
+       * emacs-lisp-intro.texi: Input texinfo instead of ../man/texinfo
+       to fix building outside source directory.
+
+2006-11-09  Robert J. Chassell  <bob@rattlesnake.com>
+
+       * emacs-lisp-intro.texi: Copy descriptions from detailed master
+       menu to menus within body.
+
+       * emacs-lisp-intro.texi (at the beginning):  Add `other shell
+       commands' to produce additional output formats; total is now ten.
+       (A Loop with an Incrementing Counter, and others): Ensure Info
+       menus will appear in short windows.
+       (Disentangle beginning-of-buffer): Replace `version 21' with `more
+       recent versions'.
+       (Simple Extension): Show how to handle multiple versions by adding
+       an alternative with a test of `>= 21'
+
+
+2006-11-06  Robert J. Chassell  <bob@rattlesnake.com>
+
+       * emacs-lisp-intro.texi: Finish minor changes seen from DVI output.
+       Replace 22.1.100 with 22.1.1.
+       (current-kill): Mention functions that directly or indirectly call
+       `kill-new', which sets `kill-ring-yank-pointer'.
+       (Understanding current-kill): Change `lasted' to `last'.  Remove
+       extraneous parenthesis.  Reword item about returning `car' of list.
+       (yank): Remove mention of `rotate-yank-pointer'.
+       (Y Axis Element): Add comment regarding replacement of blank space.
+       (print-Y-axis Penultimate): Explain that `print-graph' will pass
+       `height-of-top-line' so `print-Y-axis' does not have a bug.
+
+2006-11-05  Robert J. Chassell  <bob@rattlesnake.com>
+
+       * emacs-lisp-intro.texi: Yet more minor changes:
+       (defcustom): Said that `:options' is usually for a hook.  Remove
+       extraneous space in parenthetical remark concerning
+       `text-mode-hook-identify'.  At end, mention other defines, too.
+       (Beginning a .emacs File): Reverse words about comments so they
+       parallel numbers of listed semi-colons.
+       (Text and Auto-fill): Remove extraneous blank line in example.
+       (Mail Aliases): Remove extraneous blank line in example.
+       (Keybindings): Reformat as needed with `key' rather than `kbd'.
+       (Keybindings, Miscellaneous, Mode Line): For small book format, start
+       section name on top of new page.
+       (Simple Extension): Replace longer expression with
+       `emacs-major-version'.  Remove comment about `number-to-string'
+       function.
+       (Miscellaneous): Add filename option, `-H', to `grep' example
+       (debug, debug-on-entry):  Replace `GNU Emacs 22' with `a recent
+       GNU Emacs'.
+       (edebug): More properly state where to place point for 'M-x
+       edebug-defun'.
+
+       * emacs-lisp-intro.texi: More minor changes.
+       Center images for TeX output.
+       (kill-new function):  Remove indentation for sentence talking about
+       momentarily skipping code.
+       (cons & search-fwd Review):  Document @code{funcall}.  Document
+       @code{re-search-forward} with existing @code{search-forward}.
+       Reference chapter on regular expression searches.
+       (Recursion with list): Specify a more recent version as being Emacs.
+       (Recursion with list, Every, recursive-graph-body-print):  Change
+       `if ... progn' expression to `when'.
+       (Recursive triangle function): For printing in small book, ensure
+       section name is not last on bottom of preceding page.
+       (Keep): Remove extraneous space in function definition example.
+       (sentence-end): Specify `in English' for glyphs that end a sentence.
+       Note that in GNU Emacs 22, the name refers to both a variable and a
+       function.
+       (fwd-sentence while loops): Write a function as one, not as a form
+       (fwd-para let): Add `which' to sentence with `parstart' and `parsep'.
+       (etags): Move sentences involving `find-tag' and sources.  State
+       location of Emacs `src' directory.
+       (Design count-words-region):  Better explain two backslashes in a row.
+       (Find a File): Fix grammar; add a `to' and write `to visit'.  Change
+       `named' to `selected'.
+       (lengths-list-file): Remove extraneous parenthesis from reference.
+       (lengths-list-many-files): Explain `expand-file-name' better.
+       (Files List): Rephrase sentence regarding Lisp sources directory
+
+2006-11-04  Robert J. Chassell  <bob@rattlesnake.com>
+
+       * emacs-lisp-intro.texi: Replace 22.0.100 with 22.1.100.
+       (defcustom): Note that the value set by defconst is a variable.
+       (Buffer Size & Locations): Parenthetical remark about evaluation.
+       (Finding More): Change text to include C sources by inference.
+
+       * emacs-lisp-intro.texi: Minor fixes.
+       Replace all tabs with eight spaces each so printed text looks correct.
+       Remove extraneous comma in a printed node name produced by `ref'.
+       (insert-buffer): Add a missing beginning parenthesis.
+       (beginning-of-buffer): Add `beginning of' to note about accessible
+       portion.
+       (narrow Exercise): Write closing parenthesis at end of correct
+       paragraph.
+       (zap-to-char): Remove extraneous `a' from first sentence.
+       (Complete zap-to-char): Remove two extraneous sentences.
+       (zap-to-char body): Move sentences on documentation two nodes earlier.
+       (Lisp macro): Add definition of `unless' macro.
+       (last-command & this-command): Remove comment that `we have not yet
+       seen' the @code{eq} function.
+       (kill-append function): Reformat `kill-append' function definition so
+       it prints well.
+       (kill-new function): Indent the sentence beginning `notice'.  Replace
+       `the same as' with `similar to'.  Repair typo.  Remove obsolete
+       references to `yank' and `yank-pop.  End section with a note that `we
+       will digress into C.'
+
+2006-11-02  Robert J. Chassell  <bob@rattlesnake.com>
+
+       * emacs-lisp-intro.texi (kill-ring-yank-pointer): Revert addition
+       of extraneous quotation mark to rotate-yank-pointer.
+
+2006-11-01  Juri Linkov  <juri@jurta.org>
+
+       * emacs-lisp-intro.texi: Fix unbalanced quotes.
+
+2006-10-31  Robert J. Chassell  <bob@rattlesnake.com>
+
+       * emacs-lisp-intro.texi: Revised text for kill-region,
+       copy-region-as-kill, kill-append, kill-new, forward-sentence,
+       forward-paragraph, find-file, current-kill, yank, and yank-pop.
+       Removed INSTALL MANIFEST from the directory since those files are
+       now irrelevant.  Updated Info file in ../info.  Changed numbering
+       so is now Revised Third Edition and this instance's edition-number
+       is 3.00.  Did not update ISBN number.
+
+       * emacs-lisp-intro.texi: Remove version reference for X colors.
+       Document `='.  Remove mention that :eval was new in 21. Updated
+       instance's edition-number to 3.01.
+
+2006-10-30  Robert J. Chassell  <bob@rattlesnake.com>
+
+       * emacs-lisp-intro.texi:  Many changes since it turned out that
+       many `simple' functions were rewritten.  Changes to the text
+       regarding zap-to-char, mark-whole-buffer, append-to-buffer,
+       copy-to-buffer, beginning-of-buffer, what-line, and possibly
+       others.  (I have not reviewed all yet.)  This instance does build
+       for Info and TeX.
+
 2006-10-29  Chong Yidong  <cyd@stupidchicken.com>
 
        * Makefile.in: Use relative paths to avoid advertising filesystem
        contents during compilation.
 
-       * makefile.w32-in: Likewise.
-
 2006-08-21  Robert J. Chassell  <bob@rattlesnake.com>
 
        * emacs-lisp-intro.texi: deleted in directory copy of texinfo.tex
-          and pointed towards ../man/texinfo.tex so only one file
-          needs updating.  Added comment of what to do when building on own.
+         and pointed towards ../man/texinfo.tex so only one file
+         needs updating.  Added comment of what to do when building on own.
 
        * texinfo.tex: changed to version 2006-02-13.16
-          to enable a DVI build using the more recent versions of TeX.
+         to enable a DVI build using the more recent versions of TeX.
 
 2006-05-25  David Kastrup  <dak@gnu.org>
 
 
 ;; Local Variables:
 ;; coding: iso-2022-7bit
+;; add-log-time-zone-rule: t
 ;; End:
 
     Copyright (C) 2001, 2002, 2003, 2004, 2005,
diff --git a/lispintro/INSTALL b/lispintro/INSTALL
deleted file mode 100644 (file)
index 6a53152..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-Basic Installation for  An Introduction to Programming in Emacs Lisp  version 2
-==================
-
-    # To see the table of contents of the emacs-lisp-intro-2.00.tar.gz
-    # file, execute the following at your shell prompt:
-
-    tar -tzvf emacs-lisp-intro-2.00.tar.gz
-
-    # To uncompress and untar the file, execute the following:
-
-    tar -xzvf emacs-lisp-intro-2.00.tar.gz
-
-    # The file will untar into a subdirectory called emacs-lisp-intro-2.00
-    # That directory will contain the Texinfo source for the book, the
-    # Info files and various other files.
-
-    cd emacs-lisp-intro-2.00
-
-    # To create a DVI file that can be printed directly or converted
-    # to PostScript or PDF and then printed, execute the following:
-
-    ./configure
-    make dvi
-
-    # To create an HTML file, execute the following
-    #   (presumably you have already executed the `./configure' command
-    #    before running `make dvi'; if not execute `./configure' now);
-    # this will place HTML files into a emacs-lisp-intro/ subdirectory:
-
-    makeinfo --html --verbose emacs-lisp-intro.texi
-
-    # To create a single, large HTML file in the current directory,
-    # use the --no-split option, like this:
-
-    makeinfo --html --no-split --verbose emacs-lisp-intro.texi
-
-        # At the time of writing, `makeinfo' version 4.0b creates HTML
-        # files with %20 in addresses instead of a space.  Some
-        # browsers have difficulty following such references.  In
-        # GNU Emacs, you can replace the occurrences of %20 with a
-        # command such as
-        #              (replace-string "%20" " ")
-
-    # To create a single, large Info file in the current directory
-    # instead of the usual 16 smaller Info files, and also, to avoid
-    # indenting paragraphs, execute:
-
-    makeinfo --no-split --paragraph-indent=0 --verbose emacs-lisp-intro.texi
-
-    # To create a single, large Plain text file in the current
-    # directory, execute:
-
-    makeinfo --fill-column=70 --no-split --paragraph-indent=0 \
-    --verbose --no-headers --output=emacs-lisp-intro.txt emacs-lisp-intro.texi
-
-###
diff --git a/lispintro/MANIFEST b/lispintro/MANIFEST
deleted file mode 100644 (file)
index 6a54a9a..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-`emacs-lisp-intro-2.00.tar' contains:
-
-        size  filename
-
-        2102  INSTALL
-        1482  MANIFEST
-       10295  Makefile
-         358  Makefile.am
-       10215  Makefile.in
-        5642  README
-        3542  aclocal.m4
-        7129  drawers.eps
-       36057  configure
-         142  configure.in
-       12136  cons-1.eps
-       12523  cons-2.eps
-       12420  cons-2a.eps
-       12984  cons-3.eps
-       13866  cons-4.eps
-       12986  cons-5.eps
-      772149  emacs-lisp-intro.texi
-        5584  install-sh
-       10252  lambda-1.eps
-       10278  lambda-2.eps
-       10275  lambda-3.eps
-        4650  missing
-         732  mkinstalldirs
-      207383  texinfo.tex
-
-###
index eacd154..cfc9b9b 100644 (file)
@@ -26,6 +26,7 @@ srcdir = @srcdir@
 VPATH = @srcdir@
 
 infodir = ../info
+usermanualdir = $(srcdir)/../man
 
 INFO_SOURCES = ${srcdir}/emacs-lisp-intro.texi
 # The file name eintr must fit within 5 characters, to allow for
@@ -36,7 +37,6 @@ DVI_TARGETS = emacs-lisp-intro.dvi
 MAKEINFO = makeinfo
 TEXI2DVI = texi2dvi
 DVIPS = dvips
-ENVADD = TEXINPUTS="$(srcdir):$(TEXINPUTS)" MAKEINFO="$(MAKEINFO) -I$(srcdir)"
 
 .SUFFIXES: .dvi .ps .texi
 
@@ -48,7 +48,7 @@ ${infodir}/eintr: ${INFO_SOURCES}
        cd $(srcdir); $(MAKEINFO) emacs-lisp-intro.texi -o $(infodir)/eintr
 
 emacs-lisp-intro.dvi: ${INFO_SOURCES}
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/emacs-lisp-intro.texi
+       $(TEXI2DVI) -I $(srcdir) -I $(usermanualdir) $(srcdir)/emacs-lisp-intro.texi
 
 emacs-lisp-intro.html: $(INFO_SOURCES)
        $(MAKEINFO) --html -o $@ $(srcdir)/emacs-lisp-intro.texi
index e322fc8..76cf71a 100644 (file)
@@ -1,16 +1,17 @@
-This directory contains the source of the "Introduction to programming
+This directory contains the source of the "Introduction to Programming
 in Emacs Lisp" written by Robert J. Chassell, bob@gnu.org.  This
 manual is an elementary introduction to programming in Emacs Lisp for
 people who are not programmers, and who are not necessarily interested
 in programming, but who do want to customize or extend their computing
 environment.
 
-This second edition of 2001 Nov 20 updates the previous editions to
-GNU Emacs 21.
+This third edition of 2006 Oct 31 updates the previous editions to GNU
+Emacs 22.
 
 The Texinfo source file `emacs-lisp-intro.texi', formats without
-error using TeX version 3.14159, `kpathsea' version 3.3.1,
-`texinfo.tex' version 2001-05-24.08, and `makeinfo' version 4.0b.
+reported error using `pdfeTeXk', Version 3.141592-1.21a-2.2 (Web2C
+7.5.4) and texinfo.tex version 2006-08-26.17 started by `texi2dvi'
+version 4.8, and with `makeinfo' version 4.8.
 
 Also, this tar file contains the following optional Encapsulated Post
 Script figures.
@@ -56,5 +57,5 @@ This will prevent TeX from attempting to load the last few .eps files.
 You will find additional instructions on formatting in the beginning
 of the Texinfo file 'emacs-lisp-intro.texi'.  Best Wishes!
 
-2001 Nov  20
+2006 Oct 31
 Robert J. Chassell, bob@gnu.org
index cb04acc..afa1033 100644 (file)
@@ -1,5 +1,4 @@
-\input ../man/texinfo                                  @c -*-texinfo-*-
-@c change above to   \input texinfo   if building on own.
+\input texinfo                                      @c -*-texinfo-*-
 @comment %**start of header
 @setfilename ../info/eintr
 @c setfilename emacs-lisp-intro.info
 
 @comment %**end of header
 
-@set edition-number 2.14
-@set update-date 2004 Oct 12
+@set edition-number 3.07
+@set update-date 9 November 2006
 
 @ignore
  ## Summary of shell commands to create various output formats:
 
     pushd /usr/local/src/emacs/lispintro/
+    ## pushd /u/intro/
 
     ## Info output
-    makeinfo --no-split --paragraph-indent=0 --verbose emacs-lisp-intro.texi
+    makeinfo --paragraph-indent=0 --verbose emacs-lisp-intro.texi
+
+      ## ;; (progn (when (bufferp (get-buffer "*info*")) (kill-buffer "*info*")) (info "/usr/local/src/emacs/info/eintr"))
 
     ## DVI output
     texi2dvi emacs-lisp-intro.texi
 
+      ## xdvi -margins 24pt -topmargin 4pt -offsets 24pt -geometry 760x1140 -s 5 -useTeXpages -mousemode 1 emacs-lisp-intro.dvi &
+
     ## HTML output
     makeinfo --html --no-split --verbose emacs-lisp-intro.texi
 
+      ## galeon emacs-lisp-intro.html
+
     ## Plain text output
     makeinfo --fill-column=70 --no-split --paragraph-indent=0 \
     --verbose --no-headers --output=emacs-lisp-intro.txt emacs-lisp-intro.texi
 
-    ## DocBook output
+    popd
+
+# as user `root'
+# insert thumbdrive
+  mtusb       #   mount -v -t ext3 /dev/sda /mnt
+  cp -v /u/intro/emacs-lisp-intro.texi /mnt/backup/intro/emacs-lisp-intro.texi
+  umtusb      #   umount -v /mnt
+# remove thumbdrive
+
+    ## Other shell commands
+
+    pushd /usr/local/src/emacs/lispintro/
+    ## pushd /u/intro/
+
+    ## PDF
+    texi2dvi --pdf emacs-lisp-intro.texi
+       # xpdf emacs-lisp-intro.pdf &
+
+    ## DocBook                    -- note file extension
     makeinfo --docbook --no-split --paragraph-indent=0 \
-    --verbose emacs-lisp-intro.texi
+    --verbose --output=emacs-lisp-intro.docbook emacs-lisp-intro.texi
 
-    ## XML output
+    ## XML with a Texinfo DTD     -- note file extension
     makeinfo --xml --no-split --paragraph-indent=0 \
-    --verbose emacs-lisp-intro.texi
-
-    #### (You must be in the same directory as the viewed file.)
+    --verbose --output=emacs-lisp-intro.texinfoxml emacs-lisp-intro.texi
 
-      ## View DVI output
-      xdvi emacs-lisp-intro.dvi &
+    ## PostScript (needs DVI)
+        #     gv emacs-lisp-intro.ps &
+        # Create DVI if we lack it
+        # texi2dvi emacs-lisp-intro.texi
+    dvips emacs-lisp-intro.dvi -o emacs-lisp-intro.ps
 
-      ## View HTML output
-      galeon emacs-lisp-intro.html
+    ## RTF (needs HTML)
+        # Use OpenOffice to view RTF
+        # Create HTML if we lack it
+        # makeinfo --no-split --html emacs-lisp-intro.texi
+    /usr/local/src/html2rtf.pl emacs-lisp-intro.html
 
-      ## View Info output with standalone reader
-      info emacs-lisp-intro.info
+    ## LaTeX (needs RTF)
+    /usr/bin/rtf2latex emacs-lisp-intro.rtf
 
## popd
   popd
 
 @end ignore
 
 @c Your site may require editing changes to print PostScript; in this
 @c case, search for `print-postscript-figures' and make appropriate changes.
 
-
 @c ================ How to Create an Info file ================
 
 @c If you have `makeinfo' installed, run the following command
 @c in the Texinfo version 4.6 of the 2003 Jun 13 distribution.
 
 @tex
-\global\def\xrefprintnodename#1{``#1''}
+\if \xrefprintnodename
+ \global\def\xrefprintnodename#1{\unskip, ``#1''}
+ \else
+ \global\def\xrefprintnodename#1{ ``#1''}
+\fi
+% \global\def\xrefprintnodename#1{, ``#1''}
 @end tex
 
 @c ----------------------------------------------------
 @dircategory Emacs
 @direntry
 * Emacs Lisp Intro: (eintr).
-                       A simple introduction to Emacs Lisp programming.
+                          A simple introduction to Emacs Lisp programming.
 @end direntry
 
 @copying
@@ -242,7 +274,7 @@ Free Software Foundation raise funds for GNU development.''
 @sp 2
 @center @titlefont{Programming in Emacs Lisp}
 @sp 2
-@center Revised Second Edition
+@center Revised Third Edition
 @sp 4
 @center by Robert J. Chassell
 
@@ -280,6 +312,16 @@ This master menu first lists each chapter and index; then it lists
 every node in every chapter.
 @end ifnottex
 
+@c >>>> Set pageno appropriately <<<<
+
+@c The first page of the Preface is a roman numeral; it is the first
+@c right handed page after the Table of Contents; hence the following
+@c setting must be for an odd negative number.
+
+@iftex
+@global@pageno = -11
+@end iftex
+
 @menu
 * Preface::                     What to look for.
 * List Processing::             What is Lisp?
@@ -339,7 +381,7 @@ Lisp Lists
 
 * Numbers Lists::               List have numbers, other lists, in them.
 * Lisp Atoms::                  Elemental entities.
-* Whitespace in Lists::         Formating lists to be readable.
+* Whitespace in Lists::         Formatting lists to be readable.
 * Typing Lists::                How GNU Emacs helps you type lists.
 
 The Lisp Interpreter
@@ -349,6 +391,7 @@ The Lisp Interpreter
 
 Evaluation
 
+* How the Interpreter Acts::    Returns and Side Effects...
 * Evaluating Inner Lists::      Lists within lists...
 
 Variables
@@ -371,34 +414,34 @@ Arguments
 
 Setting the Value of a Variable
 
-* Using set::                   Setting values.
-* Using setq::                  Setting a quoted value.
-* Counting::                    Using @code{setq} to count.
+* Using set::                  Setting values.
+* Using setq::                 Setting a quoted value.
+* Counting::                   Using @code{setq} to count.
 
 Practicing Evaluation
 
-* How to Evaluate::             Typing editing commands or @kbd{C-x C-e}
-                                  causes evaluation.
-* Buffer Names::                Buffers and files are different.
-* Getting Buffers::             Getting a buffer itself, not merely its name.
-* Switching Buffers::           How to change to another buffer.
-* Buffer Size & Locations::     Where point is located and the size of
-                                the buffer.
+* How to Evaluate::            Typing editing commands or @kbd{C-x C-e}
+                                 causes evaluation.
+* Buffer Names::               Buffers and files are different.
+* Getting Buffers::            Getting a buffer itself, not merely its name.
+* Switching Buffers::          How to change to another buffer.
+* Buffer Size & Locations::    Where point is located and the size of
+                               the buffer.
 * Evaluation Exercise::
 
 How To Write Function Definitions
 
 * Primitive Functions::
-* defun::                       The @code{defun} special form.
-* Install::                     Install a function definition.
-* Interactive::                 Making a function interactive.
-* Interactive Options::         Different options for @code{interactive}.
-* Permanent Installation::      Installing code permanently.
-* let::                         Creating and initializing local variables.
-* if::                          What if?
-* else::                        If--then--else expressions.
-* Truth & Falsehood::           What Lisp considers false and true.
-* save-excursion::              Keeping track of point, mark, and buffer.
+* defun::                        The @code{defun} special form.
+* Install::                      Install a function definition.
+* Interactive::                  Making a function interactive.
+* Interactive Options::          Different options for @code{interactive}.
+* Permanent Installation::       Installing code permanently.
+* let::                          Creating and initializing local variables.
+* if::                           What if?
+* else::                         If--then--else expressions.
+* Truth & Falsehood::            What Lisp considers false and true.
+* save-excursion::               Keeping track of point, mark, and buffer.
 * Review::
 * defun Exercises::
 
@@ -410,7 +453,7 @@ Install a Function Definition
 Make a Function Interactive
 
 * Interactive multiply-by-seven::  An overview.
-* multiply-by-seven in detail::  The interactive version.
+* multiply-by-seven in detail::    The interactive version.
 
 @code{let}
 
@@ -473,6 +516,7 @@ The Definition of @code{insert-buffer}
 * if & or::                     Using an @code{if} instead of an @code{or}.
 * Insert or::                   How the @code{or} expression works.
 * Insert let::                  Two @code{save-excursion} expressions.
+* New insert-buffer::
 
 The Interactive Expression in @code{insert-buffer}
 
@@ -519,9 +563,9 @@ Cutting and Storing Text
 * Storing Text::                Text is stored in a list.
 * zap-to-char::                 Cutting out text up to a character.
 * kill-region::                 Cutting text out of a region.
+* copy-region-as-kill::         A definition for copying text.
 * Digression into C::           Minor note on C programming language macros.
 * defvar::                      How to give a variable an initial value.
-* copy-region-as-kill::         A definition for copying text.
 * cons & search-fwd Review::
 * search Exercises::
 
@@ -538,17 +582,12 @@ Cutting and Storing Text
 
 * Complete kill-region::        The function definition.
 * condition-case::              Dealing with a problem.
-* delete-and-extract-region::   Doing the work.
-
-Initializing a Variable with @code{defvar}
-
-* See variable current value::
-* defvar and asterisk::         An old-time convention.
+* Lisp macro::
 
 @code{copy-region-as-kill}
 
 * Complete copy-region-as-kill::  The complete function definition.
-* copy-region-as-kill body::    The body of @code{copy-region-as-kill}.
+* copy-region-as-kill body::      The body of @code{copy-region-as-kill}.
 
 The Body of @code{copy-region-as-kill}
 
@@ -556,6 +595,11 @@ The Body of @code{copy-region-as-kill}
 * kill-append function::
 * kill-new function::
 
+Initializing a Variable with @code{defvar}
+
+* See variable current value::
+* defvar and asterisk::
+
 How Lists are Implemented
 
 * Lists diagrammed::
@@ -564,9 +608,9 @@ How Lists are Implemented
 
 Yanking Text Back
 
-* Kill Ring Overview::          The kill ring is a list.
-* kill-ring-yank-pointer::      The @code{kill-ring-yank-pointer} variable.
-* yank nthcdr Exercises::
+* Kill Ring Overview::
+* kill-ring-yank-pointer::      The kill ring is a list.
+* yank nthcdr Exercises::       The @code{kill-ring-yank-pointer} variable.
 
 Loops and Recursion
 
@@ -581,9 +625,10 @@ Loops and Recursion
 * Loop Example::                A @code{while} loop that uses a list.
 * print-elements-of-list::      Uses @code{while}, @code{car}, @code{cdr}.
 * Incrementing Loop::           A loop with an incrementing counter.
+* Incrementing Loop Details::
 * Decrementing Loop::           A loop with a decrementing counter.
 
-A Loop with an Incrementing Counter
+Details of an Incrementing Loop
 
 * Incrementing Example::        Counting pebbles in a triangle.
 * Inc Example parts::           The parts of the function definition.
@@ -643,11 +688,6 @@ Regular Expression Searches
 * forward-paragraph in brief::  Key parts of the function definition.
 * fwd-para let::                The @code{let*} expression.
 * fwd-para while::              The forward motion @code{while} loop.
-* fwd-para between paragraphs::  Movement between paragraphs.
-* fwd-para within paragraph::   Movement within paragraphs.
-* fwd-para no fill prefix::     When there is no fill prefix.
-* fwd-para with fill prefix::   When there is a fill prefix.
-* fwd-para summary::            Summary of @code{forward-paragraph} code.
 
 Counting: Repetition and Regexps
 
@@ -681,6 +721,7 @@ Count Words in @code{defuns} in Different Files
 
 Prepare the Data for Display in a Graph
 
+* Data for Display in Detail::
 * Sorting::                     Sorting lists.
 * Files List::                  Making a list of files.
 * Counting function definitions::
@@ -707,7 +748,7 @@ Your @file{.emacs} File
 * Loading Files::               Load (i.e., evaluate) files automatically.
 * Autoload::                    Make functions available.
 * Simple Extension::            Define a function; bind it to a key.
-* X11 Colors::                  Colors in version 19 in X.
+* X11 Colors::                  Colors in X.
 * Miscellaneous::
 * Mode Line::                   How to customize your mode line.
 
@@ -721,28 +762,21 @@ Debugging
 
 Handling the Kill Ring
 
-* rotate-yank-pointer::         Move a pointer along a list and around.
+* What the Kill Ring Does::
+* current-kill::
 * yank::                        Paste a copy of a clipped element.
-* yank-pop::                    Insert first element pointed to.
+* yank-pop::                    Insert element pointed to.
 * ring file::
 
-The @code{rotate-yank-pointer} Function
+The @code{current-kill} Function
 
-* Understanding rotate-yk-ptr::
-* rotate-yk-ptr body::          The body of @code{rotate-yank-pointer}.
+* Understanding current-kill::
 
-The Body of @code{rotate-yank-pointer}
+@code{current-kill} in Outline
 
+* Body of current-kill::
 * Digression concerning error::  How to mislead humans, but not computers.
-* rotate-yk-ptr else-part::     The else-part of the @code{if} expression.
-* Remainder Function::          The remainder, @code{%}, function.
-* rotate-yk-ptr remainder::     Using @code{%} in @code{rotate-yank-pointer}.
-* kill-rng-yk-ptr last elt::    Pointing to the last element.
-
-@code{yank}
-
-* rotate-yk-ptr arg::           Pass the argument to @code{rotate-yank-pointer}.
-* rotate-yk-ptr negative arg::  Pass a negative argument.
+* Determining the Element::
 
 A Graph with Labelled Axes
 
@@ -754,6 +788,7 @@ A Graph with Labelled Axes
 
 The @code{print-Y-axis} Function
 
+* print-Y-axis in Detail::
 * Height of label::             What height for the Y axis?
 * Compute a Remainder::         How to compute the remainder of a division.
 * Y Axis Element::              Construct a line for the Y axis.
@@ -778,16 +813,6 @@ Printing the Whole Graph
 @end detailmenu
 @end menu
 
-@c >>>> Set pageno appropriately <<<<
-
-@c The first page of the Preface is a roman numeral; it is the first
-@c right handed page after the Table of Contents; hence the following
-@c setting must be for an odd negative number.
-
-@iftex
-@global@pageno = -11
-@end iftex
-
 @node Preface, List Processing, Top, Top
 @comment  node-name,  next,  previous,  up
 @unnumbered Preface
@@ -1107,7 +1132,7 @@ like flowers in a field with a stone wall around them.
 @menu
 * Numbers Lists::               List have numbers, other lists, in them.
 * Lisp Atoms::                  Elemental entities.
-* Whitespace in Lists::         Formating lists to be readable.
+* Whitespace in Lists::         Formatting lists to be readable.
 * Typing Lists::                How GNU Emacs helps you type lists.
 @end menu
 
@@ -1151,8 +1176,8 @@ term comes from the historical meaning of the word atom, which means
 using in the lists cannot be divided into any smaller parts and still
 mean the same thing as part of a program; likewise with numbers and
 single character symbols like @samp{+}.  On the other hand, unlike an
-atom, a list can be split into parts.  (@xref{car cdr & cons, ,
-@code{car} @code{cdr} & @code{cons} Fundamental Functions}.)
+ancient atom, a list can be split into parts.  (@xref{car cdr & cons,
+@code{car} @code{cdr} & @code{cons} Fundamental Functions}.)
 
 In a list, atoms are separated from each other by whitespace.  They can be
 right next to a parenthesis.
@@ -1378,13 +1403,13 @@ C-e}:
 
 @noindent
 What you see depends on which version of Emacs you are running.  GNU
-Emacs version 21 provides more information than version 20 and before.
+Emacs version 22 provides more information than version 20 and before.
 First, the more recent result of generating an error; then the
 earlier, version 20 result.
 
 @need 1250
 @noindent
-In GNU Emacs version 21, a @file{*Backtrace*} window will open up and
+In GNU Emacs version 22, a @file{*Backtrace*} window will open up and
 you will see the following in it:
 
 @smallexample
@@ -1501,7 +1526,7 @@ carry out.  Instead, the symbol is used, perhaps temporarily, as a way
 of locating the definition or set of instructions.  What we see is the
 name through which the instructions can be found.  Names of people
 work the same way.  I can be referred to as @samp{Bob}; however, I am
-not the letters @samp{B}, @samp{o}, @samp{b} but am, or were, the
+not the letters @samp{B}, @samp{o}, @samp{b} but am, or was, the
 consciousness consistently associated with a particular life-form.
 The name is not me, but it can be used to refer to me.
 
@@ -1617,6 +1642,17 @@ The word comes from its use in everyday language, `to ascertain the
 value or amount of; to appraise', according to @cite{Webster's New
 Collegiate Dictionary}.
 
+@menu
+* How the Interpreter Acts::    Returns and Side Effects...
+* Evaluating Inner Lists::      Lists within lists...
+@end menu
+
+@node How the Interpreter Acts, Evaluating Inner Lists, Evaluation, Evaluation
+@ifnottex
+@unnumberedsubsec How the Lisp Interpreter Acts
+@end ifnottex
+
+@cindex @samp{returned value} explained
 After evaluating an expression, the Lisp interpreter will most likely
 @dfn{return} the value that the computer produces by carrying out the
 instructions it found in the function definition, or perhaps it will
@@ -1638,11 +1674,7 @@ In summary, evaluating a symbolic expression most commonly causes the
 Lisp interpreter to return a value and perhaps carry out a side effect;
 or else produce an error.
 
-@menu
-* Evaluating Inner Lists::      Lists within lists...
-@end menu
-
-@node Evaluating Inner Lists,  , Evaluation, Evaluation
+@node Evaluating Inner Lists,  , How the Interpreter Acts, Evaluation
 @comment  node-name,  next,  previous,  up
 @subsection Evaluating Inner Lists
 @cindex Inner list evaluation
@@ -1737,7 +1769,7 @@ Another way to think about this is to imagine a symbol as being a chest
 of drawers.  The function definition is put in one drawer, the value in
 another, and so on.  What is put in the drawer holding the value can be
 changed without affecting the contents of the drawer holding the
-function definition, and vice-versa.
+function definition, and vice-verse.
 
 @menu
 * fill-column Example::
@@ -1805,7 +1837,7 @@ Try evaluating this:
 
 @need 1250
 @noindent
-In GNU Emacs version 21, you will create a @file{*Backtrace*} buffer
+In GNU Emacs version 22, you will create a @file{*Backtrace*} buffer
 that says:
 
 @smallexample
@@ -1825,6 +1857,7 @@ Debugger entered--Lisp error: (void-function fill-column)
 (Remember, to quit the debugger and make the debugger window go away,
 type @kbd{q} in the @file{*Backtrace*} buffer.)
 
+@ignore
 @need 800
 In GNU Emacs 20 and before, you will produce an error message that says:
 
@@ -1833,8 +1866,9 @@ Symbol's function definition is void:@: fill-column
 @end smallexample
 
 @noindent
-(The message will go away away as soon as you move the cursor or type
+(The message will go away as soon as you move the cursor or type
 another key.)
+@end ignore
 
 @node Void Variable,  , Void Function, Variables
 @comment  node-name,  next,  previous,  up
@@ -1854,7 +1888,7 @@ type @kbd{C-x C-e}:
 
 @need 1500
 @noindent
-In GNU Emacs 21, you will create a @file{*Backtrace*} buffer that
+In GNU Emacs 22, you will create a @file{*Backtrace*} buffer that
 says:
 
 @smallexample
@@ -1891,6 +1925,7 @@ Since @code{+} does not have a value bound to it, just the function
 definition, the error message reported that the symbol's value as a
 variable was void.
 
+@ignore
 @need 800
 In GNU Emacs version 20 and before, your error message will say:
 
@@ -1899,7 +1934,8 @@ Symbol's value as variable is void:@: +
 @end example
 
 @noindent
-The meaning is the same as in GNU Emacs 21.
+The meaning is the same as in GNU Emacs 22.
+@end ignore
 
 @node Arguments, set & setq, Variables, List Processing
 @comment  node-name,  next,  previous,  up
@@ -2028,7 +2064,7 @@ C-e}:
 
 @noindent
 The value will be a number two more than what you get by evaluating
-@code{fill-column} alone.  For me, this is 74, because the value of
+@code{fill-column} alone.  For me, this is 74, because my value of
 @code{fill-column} is 72.
 
 As we have just seen, an argument can be a symbol that returns a value
@@ -2038,7 +2074,7 @@ the arguments to the function @code{concat} are the strings
 @w{@code{"The "}} and @w{@code{" red foxes."}} and the list
 @code{(number-to-string (+ 2 fill-column))}.
 
-@c For Emacs 21, need number-to-string
+@c For GNU Emacs 22, need number-to-string
 @smallexample
 (concat "The " (number-to-string (+ 2 fill-column)) " red foxes.")
 @end smallexample
@@ -2122,7 +2158,7 @@ is that @code{+} has tried to add the 2 to the value returned by
 could not carry out its addition.
 
 @need 1250
-In GNU Emacs version 21, you will create and enter a
+In GNU Emacs version 22, you will create and enter a
 @file{*Backtrace*} buffer that says:
 
 @noindent
@@ -2180,6 +2216,7 @@ addition had been passed the correct type of object, the value passed
 would have been a number, such as 37, rather than a symbol like
 @code{hello}.  But then you would not have got the error message.
 
+@ignore
 @need 1250
 In GNU Emacs version 20 and before, the echo area displays an error
 message that says:
@@ -2190,6 +2227,7 @@ Wrong type argument:@: number-or-marker-p, hello
 
 This says, in different words, the same as the top line of the
 @file{*Backtrace*} buffer.
+@end ignore
 
 @node message,  , Wrong Type of Argument, Arguments
 @comment  node-name,  next,  previous,  up
@@ -2300,8 +2338,9 @@ resulting from the evaluation of @code{(- fill-column 32)} is inserted
 in place of the @samp{%d}; and the value returned by the expression
 beginning with @code{concat} is inserted in place of the @samp{%s}.
 
-When I evaluate the expression, the message @code{"He saw 38 red
-foxes leaping."} appears in my echo area.
+When your fill column is 70 and you evaluate the expression, the
+message @code{"He saw 38 red foxes leaping."} appears in your echo
+area.
 
 @node set & setq, Summary, Arguments, List Processing
 @comment  node-name,  next,  previous,  up
@@ -2319,9 +2358,9 @@ The following sections not only describe how @code{set} and @code{setq}
 work but also illustrate how arguments are passed.
 
 @menu
-* Using set::                   Setting values.
-* Using setq::                  Setting a quoted value.
-* Counting::                    Using @code{setq} to count.
+* Using set::                  Setting values.
+* Using setq::                 Setting a quoted value.
+* Counting::                   Using @code{setq} to count.
 @end menu
 
 @node Using set, Using setq, set & setq, set & setq
@@ -2340,7 +2379,7 @@ positioning the cursor after the expression and typing @kbd{C-x C-e}.
 @noindent
 The list @code{(rose violet daisy buttercup)} will appear in the echo
 area.  This is what is @emph{returned} by the @code{set} function.  As a
-side effect, the symbol @code{flowers} is bound to the list ; that is,
+side effect, the symbol @code{flowers} is bound to the list; that is,
 the symbol @code{flowers}, which can be viewed as a variable, is given
 the list as its value.  (This process, by the way, illustrates how a
 side effect to the Lisp interpreter, setting the value, can be the
@@ -2529,7 +2568,14 @@ in the list and then at the function definition bound to that symbol.
 Then the instructions in the function definition are carried out.
 
 @item
-A single-quote, @code{'}, tells the Lisp interpreter that it should
+A single quotation mark,
+@ifinfo
+'
+@end ifinfo
+@ifnotinfo
+@code{'}
+@end ifnotinfo
+, tells the Lisp interpreter that it should
 return the following expression as written, and not evaluate it as it
 would if the quote were not there.
 
@@ -2584,13 +2630,13 @@ these.  In another section, we will study the code of several other
 buffer-related functions, to see how they were written.
 
 @menu
-* How to Evaluate::             Typing editing commands or @kbd{C-x C-e}
-                                  causes evaluation.
-* Buffer Names::                Buffers and files are different.
-* Getting Buffers::             Getting a buffer itself, not merely its name.
-* Switching Buffers::           How to change to another buffer.
-* Buffer Size & Locations::     Where point is located and the size of
-                                the buffer.
+* How to Evaluate::            Typing editing commands or @kbd{C-x C-e}
+                                 causes evaluation.
+* Buffer Names::               Buffers and files are different.
+* Getting Buffers::            Getting a buffer itself, not merely its name.
+* Switching Buffers::          How to change to another buffer.
+* Buffer Size & Locations::    Where point is located and the size of
+                               the buffer.
 * Evaluation Exercise::
 @end menu
 
@@ -2656,27 +2702,45 @@ If you are reading this in Info inside of GNU Emacs, you can evaluate
 each of the following expressions by positioning the cursor after it and
 typing @kbd{C-x C-e}.
 
-@smallexample
+@example
 @group
 (buffer-name)
 
 (buffer-file-name)
 @end group
-@end smallexample
+@end example
 
 @noindent
-When I do this, @file{"introduction.texinfo"} is the value returned by
-evaluating @code{(buffer-name)}, and
-@file{"/gnu/work/intro/introduction.texinfo"} is the value returned by
-evaluating @code{(buffer-file-name)}.  The former is the name of the
-buffer and the latter is the name of the file.  (In the expressions, the
-parentheses tell the Lisp interpreter to treat @code{buffer-name} and
-@code{buffer-file-name} as functions; without the parentheses, the
-interpreter would attempt to evaluate the symbols as variables.
-@xref{Variables}.)
+When I do this in Info, the value returned by evaluating
+@code{(buffer-name)} is @file{"*info*"}, and the value returned by
+evaluating @code{(buffer-file-name)} is @file{nil}.
+
+On the other hand, while I am writing this Introduction, the value
+returned by evaluating @code{(buffer-name)} is
+@file{"introduction.texinfo"}, and the value returned by evaluating
+@code{(buffer-file-name)} is
+@file{"/gnu/work/intro/introduction.texinfo"}.
+
+@cindex @code{nil}, history of word
+The former is the name of the buffer and the latter is the name of the
+file.  In Info, the buffer name is @file{"*info*"}.  Info does not
+point to any file, so the result of evaluating
+@code{(buffer-file-name)} is @file{nil}.  The symbol @code{nil} is
+from the Latin word for `nothing'; in this case, it means that the
+buffer is not associated with any file.  (In Lisp, @code{nil} is also
+used to mean `false' and is a synonym for the empty list, @code{()}.)
+
+When I am writing, the name of my buffer is
+@file{"introduction.texinfo"}.  The name of the file to which it
+points is @file{"/gnu/work/intro/introduction.texinfo"}.
+
+(In the expressions, the parentheses tell the Lisp interpreter to
+treat @w{@code{buffer-name}} and @w{@code{buffer-file-name}} as
+functions; without the parentheses, the interpreter would attempt to
+evaluate the symbols as variables.  @xref{Variables}.)
 
 In spite of the distinction between files and buffers, you will often
-find that people refer to a file when they mean a buffer and vice-versa.
+find that people refer to a file when they mean a buffer and vice-verse.
 Indeed, most people say, ``I am editing a file,'' rather than saying,
 ``I am editing a buffer which I will soon save to a file.''  It is
 almost always clear from context what people mean.  When dealing with
@@ -2698,23 +2762,25 @@ great city: once it was merely the place where cargo was warehoused
 temporarily before being loaded onto ships; then it became a business
 and cultural center in its own right.
 
-Not all buffers are associated with files.  For example, when you start
-an Emacs session by typing the command @code{emacs} alone, without
-naming any files, Emacs will start with the @file{*scratch*} buffer on
-the screen.  This buffer is not visiting any file.  Similarly, a
+Not all buffers are associated with files.  For example, a
+@file{*scratch*} buffer does not visit any file.  Similarly, a
 @file{*Help*} buffer is not associated with any file.
 
-@cindex @code{nil}, history of word
-If you switch to the @file{*scratch*} buffer, type @code{(buffer-name)},
-position the cursor after it, and type @kbd{C-x C-e} to evaluate the
-expression, the name @code{"*scratch*"} is returned and will appear in
-the echo area.  @code{"*scratch*"} is the name of the buffer.  However,
-if you type @code{(buffer-file-name)} in the @file{*scratch*} buffer and
-evaluate that, @code{nil} will appear in the echo area.  @code{nil} is
-from the Latin word for `nothing'; in this case, it means that the
-@file{*scratch*} buffer is not associated with any file.  (In Lisp,
-@code{nil} is also used to mean `false' and is a synonym for the empty
-list, @code{()}.)
+In the old days, when you lacked a @file{~/.emacs} file and started an
+Emacs session by typing the command @code{emacs} alone, without naming
+any files, Emacs started with the @file{*scratch*} buffer visible.
+Nowadays, you will see a splash screen.  You can follow one of the
+commands suggested on the splash screen, visit a file, or press the
+spacebar to reach the @file{*scratch*} buffer.
+
+If you switch to the @file{*scratch*} buffer, type
+@code{(buffer-name)}, position the cursor after it, and then type
+@kbd{C-x C-e} to evaluate the expression.  The name @code{"*scratch*"}
+will be returned and will appear in the echo area.  @code{"*scratch*"}
+is the name of the buffer.  When you type @code{(buffer-file-name)} in
+the @file{*scratch*} buffer and evaluate that, @code{nil} will appear
+in the echo area, just as it does when you evaluate
+@code{(buffer-file-name)} in Info.
 
 Incidentally, if you are in the @file{*scratch*} buffer and want the
 value returned by an expression to appear in the @file{*scratch*}
@@ -2771,18 +2837,20 @@ Here is an expression containing the function:
 @end smallexample
 
 @noindent
-If you evaluate the expression in the usual way, @file{#<buffer *info*>}
-appears in the echo area.  The special format indicates that the
-buffer itself is being returned, rather than just its name.
+If you evaluate this expression in Info in Emacs in the usual way,
+@file{#<buffer *info*>} will appear in the echo area.  The special
+format indicates that the buffer itself is being returned, rather than
+just its name.
 
 Incidentally, while you can type a number or symbol into a program, you
 cannot do that with the printed representation of a buffer: the only way
 to get a buffer itself is with a function such as @code{current-buffer}.
 
 A related function is @code{other-buffer}.  This returns the most
-recently selected buffer other than the one you are in currently.  If
-you have recently switched back and forth from the @file{*scratch*}
-buffer, @code{other-buffer} will return that buffer.
+recently selected buffer other than the one you are in currently, not
+a printed representation of its name.  If you have recently switched
+back and forth from the @file{*scratch*} buffer, @code{other-buffer}
+will return that buffer.
 
 @need 800
 You can see this by evaluating the expression:
@@ -2815,12 +2883,13 @@ But first, a brief introduction to the @code{switch-to-buffer}
 function.  When you switched back and forth from Info to the
 @file{*scratch*} buffer to evaluate @code{(buffer-name)}, you most
 likely typed @kbd{C-x b} and then typed @file{*scratch*}@footnote{Or
-rather, to save typing, you probably typed just part of the name, such
-as @code{*sc}, and then pressed your @kbd{TAB} key to cause it to
-expand to the full name; and then typed your @kbd{RET} key.} when
-prompted in the minibuffer for the name of the buffer to which you
-wanted to switch.  The keystrokes, @kbd{C-x b}, cause the Lisp
-interpreter to evaluate the interactive function
+rather, to save typing, you probably only typed @kbd{RET} if the
+default buffer was @file{*scratch*}, or if it was different, then you
+typed just part of the name, such as @code{*sc}, pressed your
+@kbd{TAB} key to cause it to expand to the full name, and then typed
+your @kbd{RET} key.} when prompted in the minibuffer for the name of
+the buffer to which you wanted to switch.  The keystrokes, @kbd{C-x
+b}, cause the Lisp interpreter to evaluate the interactive function
 @code{switch-to-buffer}.  As we said before, this is how Emacs works:
 different keystrokes call or run different functions.  For example,
 @kbd{C-f} calls @code{forward-char}, @kbd{M-e} calls
@@ -2945,7 +3014,9 @@ buffer.  If you evaluate point in this spot, the number will be larger:
 
 @noindent
 For me, the value of point in this location is 66043, which means that
-there are 319 characters (including spaces) between the two expressions.
+there are 319 characters (including spaces) between the two
+expressions.  (Doubtless, you will see different numbers, since I will
+have edited this since I first evaluated point.)
 
 @cindex @samp{narrowing} defined
 The function @code{point-min} is somewhat similar to @code{point}, but
@@ -2980,16 +3051,16 @@ symbol refers to it.)
 
 @menu
 * Primitive Functions::
-* defun::                       The @code{defun} special form.
-* Install::                     Install a function definition.
-* Interactive::                 Making a function interactive.
-* Interactive Options::         Different options for @code{interactive}.
-* Permanent Installation::      Installing code permanently.
-* let::                         Creating and initializing local variables.
-* if::                          What if?
-* else::                        If--then--else expressions.
-* Truth & Falsehood::           What Lisp considers false and true.
-* save-excursion::              Keeping track of point, mark, and buffer.
+* defun::                        The @code{defun} special form.
+* Install::                      Install a function definition.
+* Interactive::                  Making a function interactive.
+* Interactive Options::          Different options for @code{interactive}.
+* Permanent Installation::       Installing code permanently.
+* let::                          Creating and initializing local variables.
+* if::                           What if?
+* else::                         If--then--else expressions.
+* Truth & Falsehood::            What Lisp considers false and true.
+* save-excursion::               Keeping track of point, mark, and buffer.
 * Review::
 * defun Exercises::
 @end menu
@@ -3226,7 +3297,6 @@ use.  (@code{multiply-by-seven} will stay installed until you quit
 Emacs.  To reload code automatically whenever you start Emacs, see
 @ref{Permanent Installation, , Installing Code Permanently}.)
 
-
 @menu
 * Effect of installation::
 * Change a defun::              How to change a function definition.
@@ -3237,7 +3307,6 @@ Emacs.  To reload code automatically whenever you start Emacs, see
 @unnumberedsubsec The effect of installation
 @end ifnottex
 
-
 You can see the effect of installing @code{multiply-by-seven} by
 evaluating the following sample.  Place the cursor after the following
 expression and type @kbd{C-x C-e}.  The number 21 will appear in the
@@ -3254,7 +3323,9 @@ function, @code{multiply-by-seven}.  When you do this, a
 
 @smallexample
 @group
-multiply-by-seven:
+multiply-by-seven is a Lisp function.
+(multiply-by-seven NUMBER)
+
 Multiply NUMBER by seven.
 @end group
 @end smallexample
@@ -3330,7 +3401,7 @@ each time you typed a key, it would be very distracting.
 
 @menu
 * Interactive multiply-by-seven::  An overview.
-* multiply-by-seven in detail::  The interactive version.
+* multiply-by-seven in detail::    The interactive version.
 @end menu
 
 @node Interactive multiply-by-seven, multiply-by-seven in detail, Interactive, Interactive
@@ -3436,14 +3507,14 @@ will evaluate the outer list, passing the values of the second and
 subsequent elements of the list to the function @code{message}.
 
 As we have seen, @code{message} is an Emacs Lisp function especially
-designed for sending a one line message to a user.  (@xref{message, , The
-@code{message} function}.)
-In summary, the @code{message} function prints its first argument in the
-echo area as is, except for occurrences of @samp{%d}, @samp{%s}, or
-@samp{%c}.  When it sees one of these control sequences, the function
-looks to the second and subsequent arguments and prints the value of the
-argument in the location in the string where the control sequence is
-located.
+designed for sending a one line message to a user.  (@xref{message, ,
+The @code{message} function}.)  In summary, the @code{message}
+function prints its first argument in the echo area as is, except for
+occurrences of @samp{%d} or @samp{%s} (and various other %-sequences
+which we have not mentioned).  When it sees a control sequence, the
+function looks to the second or subsequent arguments and prints the
+value of the argument in the location in the string where the control
+sequence is located.
 
 In the interactive @code{multiply-by-seven} function, the control string
 is @samp{%d}, which requires a number, and the value returned by
@@ -3476,62 +3547,67 @@ a function.  (@xref{Interactive Codes, , Code Characters for
 @code{interactive}, elisp, The GNU Emacs Lisp Reference Manual}.)
 
 @need 1250
-For example, the character @samp{r} causes Emacs to pass the beginning
-and end of the region (the current values of point and mark) to the
-function as two separate arguments.  It is used as follows:
+Consider the function @code{zap-to-char}.  Its interactive expression
+is
 
 @smallexample
-(interactive "r")
+(interactive "p\ncZap to char: ")
 @end smallexample
 
-On the other hand, a @samp{B} tells Emacs to ask for the name of a
-buffer that will be passed to the function.  When it sees a @samp{B},
-Emacs will ask for the name by prompting the user in the minibuffer,
-using a string that follows the @samp{B}, as in @code{"BAppend to
-buffer:@: "}.  Not only will Emacs prompt for the name, but Emacs will
-complete the name if you type enough of it and press @key{TAB}.
+The first part of the argument to @code{interactive} is @samp{p}, with
+which you are already familiar.  This argument tells Emacs to
+interpret a `prefix', as a number to be passed to the function.  You
+can specify a prefix either by typing @kbd{C-u} followed by a number
+or by typing @key{META} followed by a number.  The prefix is the
+number of specified characters.  Thus, if your prefix is three and the
+specified character is @samp{x}, then you will delete all the text up
+to and including the third next @samp{x}.  If you do not set a prefix,
+then you delete all the text up to and including the specified
+character, but no more.
+
+The @samp{c} tells the function the name of the character to which to delete.
 
-A function with two or more arguments can have information passed to
-each argument by adding parts to the string that follows
-@code{interactive}.  When you do this, the information is passed to
-each argument in the same order it is specified in the
+More formally, a function with two or more arguments can have
+information passed to each argument by adding parts to the string that
+follows @code{interactive}.  When you do this, the information is
+passed to each argument in the same order it is specified in the
 @code{interactive} list.  In the string, each part is separated from
 the next part by a @samp{\n}, which is a newline.  For example, you
-could follow @code{"BAppend to buffer:@: "} with a @samp{\n} and an
-@samp{r}.  This would cause Emacs to pass the values of point and mark
-to the function as well as prompt you for the buffer---three arguments
-in all.
+can follow @samp{p} with a @samp{\n} and an @samp{cZap to char:@: }.
+This causes Emacs to pass the value of the prefix argument (if there
+is one) and the character.
 
-In this case, the function definition would look like the following,
-where @code{buffer}, @code{start}, and @code{end} are the symbols to
-which @code{interactive} binds the buffer and the current values of the
-beginning and ending of the region:
+In this case, the function definition looks like the following, where
+@code{arg} and @code{char} are the symbols to which @code{interactive}
+binds the prefix argument and the specified character:
 
 @smallexample
 @group
-(defun @var{name-of-function} (buffer start end)
+(defun @var{name-of-function} (arg char)
   "@var{documentation}@dots{}"
-  (interactive "BAppend to buffer:@: \nr")
+  (interactive "p\ncZap to char: ")
   @var{body-of-function}@dots{})
 @end group
 @end smallexample
 
 @noindent
 (The space after the colon in the prompt makes it look better when you
-are prompted.  The @code{append-to-buffer} function looks exactly like
-this.  @xref{append-to-buffer, , The Definition of
-@code{append-to-buffer}}.)
+are prompted.  @xref{copy-to-buffer, , The Definition of
+@code{copy-to-buffer}}, for an example.)
 
-If a function does not have arguments, then @code{interactive} does not
+When a function does not take arguments, @code{interactive} does not
 require any.  Such a function contains the simple expression
 @code{(interactive)}.  The @code{mark-whole-buffer} function is like
 this.
 
 Alternatively, if the special letter-codes are not right for your
 application, you can pass your own arguments to @code{interactive} as
-a list.  @xref{Using Interactive, , Using @code{Interactive}, elisp, The
-GNU Emacs Lisp Reference Manual}, for more information about this advanced
-technique.
+a list.
+
+@xref{append-to-buffer, , The Definition of @code{append-to-buffer}},
+for an example.  @xref{Using Interactive, , Using @code{Interactive},
+elisp, The GNU Emacs Lisp Reference Manual}, for a more complete
+explanation about this technique.
 
 @node Permanent Installation, let, Interactive Options, Writing Defuns
 @comment  node-name,  next,  previous,  up
@@ -3565,11 +3641,11 @@ functions in the files.
 @xref{Loading Files, , Loading Files}.
 
 @item
-On the other hand, if you have code that your whole site will use, it
-is usual to put it in a file called @file{site-init.el} that is loaded
-when Emacs is built.  This makes the code available to everyone who
-uses your machine.  (See the @file{INSTALL} file that is part of the
-Emacs distribution.)
+Thirdly, if you have code that your whole site will use, it is usual
+to put it in a file called @file{site-init.el} that is loaded when
+Emacs is built.  This makes the code available to everyone who uses
+your machine.  (See the @file{INSTALL} file that is part of the Emacs
+distribution.)
 @end itemize
 
 Finally, if you have code that everyone who uses Emacs may want, you
@@ -3621,6 +3697,7 @@ and the two are not intended to refer to the same value.  The
 @end ifnottex
 
 @cindex @samp{local variable} defined
+@cindex @samp{variable, local}, defined
 The @code{let} special form prevents confusion.  @code{let} creates a
 name for a @dfn{local variable} that overshadows any use of the same
 name outside the @code{let} expression.  This is like understanding
@@ -3726,13 +3803,17 @@ Here, the varlist is @code{((zebra 'stripes) (tiger 'fierce))}.
 The two variables are @code{zebra} and @code{tiger}.  Each variable is
 the first element of a two-element list and each value is the second
 element of its two-element list.  In the varlist, Emacs binds the
-variable @code{zebra} to the value @code{stripes}, and binds the
+variable @code{zebra} to the value @code{stripes}@footnote{According
+to Jared Diamond in @cite{Guns, Germs, and Steel}, ``@dots{} zebras
+become impossibly dangerous as they grow older'' but the claim here is
+that they do not become fierce like a tiger.  (1997, W. W. Norton and
+Co., ISBN 0-393-03894-2, page 171)}, and binds the
 variable @code{tiger} to the value @code{fierce}.  In this example,
 both values are symbols preceded by a quote.  The values could just as
 well have been another list or a string.  The body of the @code{let}
-follows after the list holding the variables.  In this example, the body
-is a list that uses the @code{message} function to print a string in
-the echo area.
+follows after the list holding the variables.  In this example, the
+body is a list that uses the @code{message} function to print a string
+in the echo area.
 
 @need 1500
 You may evaluate the example in the usual fashion, by placing the
@@ -4086,8 +4167,8 @@ when you evaluate @code{(type-of-animal 'zebra)}, you will see
 (Of course, if the @var{characteristic} were @code{ferocious}, the
 message @code{"It's not fierce!"} would be printed; and it would be
 misleading!  When you write code, you need to take into account the
-possibility that some such argument will be tested by the @code{if} and
-write your program accordingly.)
+possibility that some such argument will be tested by the @code{if}
+and write your program accordingly.)
 
 @node Truth & Falsehood, save-excursion, else, Writing Defuns
 @comment  node-name,  next,  previous,  up
@@ -4106,8 +4187,8 @@ The expression that tests for truth is interpreted as @dfn{true}
 if the result of evaluating it is a value that is not @code{nil}.  In
 other words, the result of the test is considered true if the value
 returned is a number such as 47, a string such as @code{"hello"}, or a
-symbol (other than @code{nil}) such as @code{flowers}, or a list, or
-even a buffer!
+symbol (other than @code{nil}) such as @code{flowers}, or a list (so
+long as it is not empty), or even a buffer!
 
 @menu
 * nil explained::               @code{nil} has two meanings.
@@ -4256,8 +4337,8 @@ abnormal exit'').  This feature is very helpful.
 In addition to recording the values of point and mark,
 @code{save-excursion} keeps track of the current buffer, and restores
 it, too.  This means you can write code that will change the buffer and
-have @code{save-excursion} switch you back to the original buffer.  This
-is how @code{save-excursion} is used in @code{append-to-buffer}.
+have @code{save-excursion} switch you back to the original buffer.
+This is how @code{save-excursion} is used in @code{append-to-buffer}.
 (@xref{append-to-buffer, , The Definition of @code{append-to-buffer}}.)
 
 @node Template for save-excursion,  , Point and mark, save-excursion
@@ -4334,7 +4415,9 @@ documentation, an optional interactive declaration, and the body of the
 definition.
 
 @need 1250
-For example:
+For example, in an early version of Emacs, the function definition was
+as follows.  (It is slightly more complex now that it seeks the first
+non-whitespace character rather than the first visible character.)
 
 @smallexample
 @group
@@ -4346,6 +4429,24 @@ For example:
 @end group
 @end smallexample
 
+@ignore
+In GNU Emacs 22,
+
+(defun backward-to-indentation (&optional arg)
+  "Move backward ARG lines and position at first nonblank character."
+  (interactive "p")
+  (forward-line (- (or arg 1)))
+  (skip-chars-forward " \t"))
+
+(defun back-to-indentation ()
+  "Move point to the first non-whitespace character on this line."
+  (interactive)
+  (beginning-of-line 1)
+  (skip-syntax-forward " " (line-end-position))
+  ;; Move back over chars that have whitespace syntax but have the p flag.
+  (backward-prefix-chars))
+@end ignore
+
 @item interactive
 Declare to the interpreter that the function can be used
 interactively.  This special form may be followed by a string with one
@@ -4429,24 +4530,12 @@ For example,
 
 @smallexample
 @group
-(if (string-equal
-     (number-to-string 21)
-     (substring (emacs-version) 10 12))
-    (message "This is version 21 Emacs")
-  (message "This is not version 21 Emacs"))
+(if (= 22 emacs-major-version)
+    (message "This is version 22 Emacs")
+  (message "This is not version 22 Emacs"))
 @end group
 @end smallexample
 
-@item equal
-@itemx eq
-Test whether two objects are the same.  @code{equal} uses one meaning
-of the word `same' and @code{eq} uses another:  @code{equal} returns
-true if the two objects have a similar structure and contents, such as
-two copies of the same book.  On the other hand, @code{eq}, returns
-true if both arguments are actually the same object.
-@findex equal
-@findex eq
-
 @need 1250
 @item <
 @itemx >
@@ -4460,6 +4549,23 @@ tests whether the first argument is less than or equal to the second and
 the second.  In all cases, both arguments must be numbers or markers
 (markers indicate positions in buffers).
 
+@need 800
+@item =
+The @code{=} function tests whether two arguments, both numbers or
+markers, are equal.
+
+@need 1250
+@item equal
+@itemx eq
+Test whether two objects are the same.  @code{equal} uses one meaning
+of the word `same' and @code{eq} uses another:  @code{equal} returns
+true if the two objects have a similar structure and contents, such as
+two copies of the same book.  On the other hand, @code{eq}, returns
+true if both arguments are actually the same object.
+@findex equal
+@findex eq
+
+@need 1250
 @item string<
 @itemx string-lessp
 @itemx string=
@@ -4487,6 +4593,7 @@ arguments that follow the string.  The argument used by @samp{%s} must
 be a string or a symbol; the argument used by @samp{%d} must be a
 number.  The argument used by @samp{%c} must be an @sc{ascii} code
 number; it will be printed as the character with that @sc{ascii} code.
+(Various other %-sequences have not been mentioned.)
 
 @item setq
 @itemx set
@@ -4591,12 +4698,23 @@ variable by typing @kbd{C-h v} and then the name of the variable (and
 then @key{RET}).
 
 @cindex Find source of function
-In versions 20 and higher, when a function is written in Emacs Lisp,
-@code{describe-function} will also tell you the location of the
-function definition.  If you move point over the file name and press
+@c In version 22, tells location both of C and of Emacs Lisp
+Also, @code{describe-function} will tell you the location of the
+function definition.
+
+Put point into the name of the file that contains the function and
+press the @key{RET} key.  In this case, @key{RET} means
+@code{push-button} rather than `return' or `enter'.  Emacs will take
+you directly to the function definition.
+
+@ignore
+Not In version 22
+
+If you move point over the file name and press
 the @key{RET} key, which in this case means @code{help-follow} rather
 than `return' or `enter', Emacs will take you directly to the function
 definition.
+@end ignore
 
 More generally, if you want to see a function in its original source
 file, you can use the @code{find-tags} function to jump to it.
@@ -4604,7 +4722,6 @@ file, you can use the @code{find-tags} function to jump to it.
 Lisp, and C, and it works with non-programming text as well.  For
 example, @code{find-tags} will jump to the various nodes in the
 Texinfo source file of this document.
-
 The @code{find-tags} function depends on `tags tables' that record
 the locations of the functions, variables, and other items to which
 @code{find-tags} jumps.
@@ -4619,7 +4736,7 @@ screen.  To switch back to your current buffer, type @kbd{C-x b
 @key{RET}}.  (On some keyboards, the @key{META} key is labelled
 @key{ALT}.)
 
-@c !!! 21.0.100 tags table location in this paragraph
+@c !!! 22.1.1 tags table location in this paragraph
 @cindex TAGS table, specifying
 @findex find-tags
 Depending on how the initial default values of your copy of Emacs are
@@ -4629,15 +4746,15 @@ interested in Emacs sources, the tags table you will most likely want,
 if it has already been created for you, will be in a subdirectory of
 the @file{/usr/local/share/emacs/} directory; thus you would use the
 @code{M-x visit-tags-table} command and specify a pathname such as
-@file{/usr/local/share/emacs/21.0.100/lisp/TAGS} or
-@file{/usr/local/src/emacs/src/TAGS}.  If the tags table has
-not already been created, you will have to create it yourself.
+@file{/usr/local/share/emacs/22.1.1/lisp/TAGS}.  If the tags table
+has not already been created, you will have to create it yourself.  It
+will in a file such as @file{/usr/local/src/emacs/src/TAGS}.
 
 @need 1250
 To create a @file{TAGS} file in a specific directory, switch to that
 directory in Emacs using @kbd{M-x cd} command, or list the directory
 with @kbd{C-x d} (@code{dired}).  Then run the compile command, with
-@w{@code{etags *.el}} as the command to execute
+@w{@code{etags *.el}} as the command to execute:
 
 @smallexample
 M-x compile RET etags *.el RET
@@ -4773,12 +4890,14 @@ example, the documentation for @code{goto-char} is:
 
 @smallexample
 @group
-One arg, a number.  Set point to that number.
-Beginning of buffer is position (point-min),
-end is (point-max).
+Set point to POSITION, a number or marker.
+Beginning of buffer is position (point-min), end is (point-max).
 @end group
 @end smallexample
 
+@noindent
+The function's one argument is the desired position.
+
 @noindent
 (The prompt for @code{describe-function} will offer you the symbol
 under or preceding the cursor, so you can save typing by positioning
@@ -4805,28 +4924,29 @@ marks a whole buffer as a region by putting point at the beginning and
 a mark at the end of the buffer.  It is generally bound to @kbd{C-x
 h}.
 
-
 @menu
 * mark-whole-buffer overview::
 * Body of mark-whole-buffer::   Only three lines of code.
 @end menu
 
-
 @node mark-whole-buffer overview, Body of mark-whole-buffer, mark-whole-buffer, mark-whole-buffer
 @ifnottex
 @unnumberedsubsec An overview of @code{mark-whole-buffer}
 @end ifnottex
 
 @need 1250
-In GNU Emacs 20, the code for the complete function looks like this:
+In GNU Emacs 22, the code for the complete function looks like this:
 
 @smallexample
 @group
 (defun mark-whole-buffer ()
-  "Put point at beginning and mark at end of buffer."
+  "Put point at beginning and mark at end of buffer.
+You probably should not use this function in Lisp programs;
+it is usually a mistake for a Lisp function to use any subroutine
+that uses or sets the mark."
   (interactive)
   (push-mark (point))
-  (push-mark (point-max))
+  (push-mark (point-max) nil t)
   (goto-char (point-min)))
 @end group
 @end smallexample
@@ -4863,10 +4983,11 @@ previous section.
 The body of the @code{mark-whole-buffer} function consists of three
 lines of code:
 
+@c GNU Emacs 22
 @smallexample
 @group
 (push-mark (point))
-(push-mark (point-max))
+(push-mark (point-max) nil t)
 (goto-char (point-min))
 @end group
 @end smallexample
@@ -4889,34 +5010,36 @@ so as to parallel the structure of the next line.  In any case, the
 line causes Emacs to determine the position of point and set a mark
 there.
 
-The next line of @code{mark-whole-buffer} is @code{(push-mark (point-max)}.
-This expression sets a mark at the point in the buffer
-that has the highest number.  This will be the end of the buffer (or,
-if the buffer is narrowed, the end of the accessible portion of the
-buffer.  @xref{Narrowing & Widening, , Narrowing and Widening}, for
-more about narrowing.)  After this mark has been set, the previous
-mark, the one set at point, is no longer set, but Emacs remembers its
-position, just as all other recent marks are always remembered.  This
-means that you can, if you wish, go back to that position by typing
-@kbd{C-u C-@key{SPC}} twice.
+In earlier versions of GNU Emacs, the next line of
+@code{mark-whole-buffer} was @code{(push-mark (point-max))}.  This
+expression sets a mark at the point in the buffer that has the highest
+number.  This will be the end of the buffer (or, if the buffer is
+narrowed, the end of the accessible portion of the buffer.
+@xref{Narrowing & Widening, , Narrowing and Widening}, for more about
+narrowing.)  After this mark has been set, the previous mark, the one
+set at point, is no longer set, but Emacs remembers its position, just
+as all other recent marks are always remembered.  This means that you
+can, if you wish, go back to that position by typing @kbd{C-u
+C-@key{SPC}} twice.
 
-(In GNU Emacs 21, the @code{(push-mark (point-max)} is slightly more
-complicated than shown here.  The line reads
+@need 1250
+In GNU Emacs 22, the @code{(point-max)} is slightly more complicated.
+The line reads
 
 @smallexample
 (push-mark (point-max) nil t)
 @end smallexample
 
 @noindent
-(The expression works nearly the same as before.  It sets a mark at
-the highest numbered place in the buffer that it can.  However, in
-this version, @code{push-mark} has two additional arguments.  The
-second argument to @code{push-mark} is @code{nil}.  This tells the
-function it @emph{should} display a message that says `Mark set' when
-it pushes the mark.  The third argument is @code{t}.  This tells
+The expression works nearly the same as before.  It sets a mark at the
+highest numbered place in the buffer that it can.  However, in this
+version, @code{push-mark} has two additional arguments.  The second
+argument to @code{push-mark} is @code{nil}.  This tells the function
+it @emph{should} display a message that says `Mark set' when it pushes
+the mark.  The third argument is @code{t}.  This tells
 @code{push-mark} to activate the mark when Transient Mark mode is
 turned on.  Transient Mark mode highlights the currently active
-region.  It is usually turned off.)
+region.  It is often turned off.
 
 Finally, the last line of the function is @code{(goto-char
 (point-min)))}.  This is written exactly the same way as it is written
@@ -4932,10 +5055,10 @@ region.
 @section The Definition of @code{append-to-buffer}
 @findex append-to-buffer
 
-The @code{append-to-buffer} command is very nearly as simple as the
-@code{mark-whole-buffer} command.  What it does is copy the region (that
-is, the part of the buffer between point and mark) from the current
-buffer to a specified buffer.
+The @code{append-to-buffer} command is more complex than the
+@code{mark-whole-buffer} command.  What it does is copy the region
+(that is, the part of the buffer between point and mark) from the
+current buffer to a specified buffer.
 
 @menu
 * append-to-buffer overview::
@@ -4954,10 +5077,15 @@ The @code{append-to-buffer} command uses the
 @code{insert-buffer-substring} function to copy the region.
 @code{insert-buffer-substring} is described by its name: it takes a
 string of characters from part of a buffer, a ``substring'', and
-inserts them into another buffer.  Most of @code{append-to-buffer} is
+inserts them into another buffer.
+
+Most of @code{append-to-buffer} is
 concerned with setting up the conditions for
 @code{insert-buffer-substring} to work: the code must specify both the
-buffer to which the text will go and the region that will be copied.
+buffer to which the text will go, the window it comes from and goes
+to, and the region that will be copied.
+
+@need 1250
 Here is the complete text of the function:
 
 @smallexample
@@ -4969,13 +5097,26 @@ It is inserted into that buffer before its point.
 
 @group
 When calling from a program, give three arguments:
-a buffer or the name of one, and two character numbers
-specifying the portion of the current buffer to be copied."
-  (interactive "BAppend to buffer:@: \nr")
+BUFFER (or buffer name), START and END.
+START and END specify the portion of the current buffer to be copied."
+  (interactive
+   (list (read-buffer "Append to buffer: " (other-buffer
+                                            (current-buffer) t))
+         (region-beginning) (region-end)))
+@end group
+@group
   (let ((oldbuf (current-buffer)))
     (save-excursion
-      (set-buffer (get-buffer-create buffer))
-      (insert-buffer-substring oldbuf start end))))
+      (let* ((append-to (get-buffer-create buffer))
+             (windows (get-buffer-window-list append-to t t))
+             point)
+        (set-buffer append-to)
+        (setq point (point))
+        (barf-if-buffer-read-only)
+        (insert-buffer-substring oldbuf start end)
+        (dolist (window windows)
+          (when (= (window-point window) point)
+            (set-window-point window (point))))))))
 @end group
 @end smallexample
 
@@ -4989,7 +5130,7 @@ function, it looks like this (with several slots filled in):
 @group
 (defun append-to-buffer (buffer start end)
   "@var{documentation}@dots{}"
-  (interactive "BAppend to buffer:@: \nr")
+  (interactive @dots{})
   @var{body}@dots{})
 @end group
 @end smallexample
@@ -5000,7 +5141,12 @@ the @code{start} and @code{end} of the region in the current buffer that
 will be copied.
 
 The next part of the function is the documentation, which is clear and
-complete.
+complete.  As is conventional, the three arguments are written in
+upper case so you will notice them easily.  Even better, they are
+described in the same order as in the argument list.
+
+Note that the documentation distinguishes between a buffer and its
+name.  (The function can handle either.)
 
 @node append interactive, append-to-buffer body, append-to-buffer overview, append-to-buffer
 @comment  node-name,  next,  previous,  up
@@ -5012,30 +5158,96 @@ review of @code{interactive}, see @ref{Interactive, , Making a
 Function Interactive}.)  The expression reads as follows:
 
 @smallexample
-(interactive "BAppend to buffer:@: \nr")
+@group
+(interactive
+ (list (read-buffer
+        "Append to buffer: "
+        (other-buffer (current-buffer) t))
+       (region-beginning)
+       (region-end)))
+@end group
 @end smallexample
 
 @noindent
-This expression has an argument inside of quotation marks and that
-argument has two parts, separated by @samp{\n}.
+This expression is not one with letters standing for parts, as
+described earlier.  Instead, it starts a list with thee parts.
+
+The first part of the list is an expression to read the name of a
+buffer and return it as a string.  That is @code{read-buffer}.  The
+function requires a prompt as its first argument, @samp{"Append to
+buffer: "}.  Its second argument tells the command what value to
+provide if you don't specify anything.
 
-The first part is @samp{BAppend to buffer:@: }.  Here, the @samp{B}
-tells Emacs to ask for the name of the buffer that will be passed to the
-function.  Emacs will ask for the name by prompting the user in the
-minibuffer, using the string following the @samp{B}, which is the string
-@samp{Append to buffer:@: }.  Emacs then binds the variable @code{buffer}
-in the function's argument list to the specified buffer.
+In this case that second argument is an expression containing the
+function @code{other-buffer}, an exception, and a @samp{t}, standing
+for true.
+
+The first argument to @code{other-buffer}, the exception, is yet
+another function, @code{current-buffer}.  That is not going to be
+returned.  The second argument is the symbol for true, @code{t}. that
+tells @code{other-buffer} that it may show visible buffers (except in
+this case, it will not show the current buffer, which makes sense).
+
+@need 1250
+The expression looks like this:
+
+@smallexample
+(other-buffer (current-buffer) t)
+@end smallexample
+
+The second and third arguments to the @code{list} expression are
+@code{(region-beginning)} and @code{(region-end)}.  These two
+functions specify the beginning and end of the text to be appended.
+
+@need 1250
+Originally, the command used the letters @samp{B} and @samp{r}.
+The whole @code{interactive} expression looked like this:
+
+@smallexample
+(interactive "BAppend to buffer:@: \nr")
+@end smallexample
+
+@noindent
+But when that was done, the default value of the buffer switched to
+was invisible.  That was not wanted.
 
-The newline, @samp{\n}, separates the first part of the argument from
-the second part.  It is followed by an @samp{r} that tells Emacs to bind
-the two arguments that follow the symbol @code{buffer} in the function's
+(The prompt was separated from the second argument with a newline,
+@samp{\n}.  It was followed by an @samp{r} that told Emacs to bind the
+two arguments that follow the symbol @code{buffer} in the function's
 argument list (that is, @code{start} and @code{end}) to the values of
-point and mark.
+point and mark.  That argument worked fine.)
 
 @node append-to-buffer body, append save-excursion, append interactive, append-to-buffer
 @comment  node-name,  next,  previous,  up
 @subsection The Body of @code{append-to-buffer}
 
+@ignore
+in GNU Emacs 22   in    /usr/local/src/emacs/lisp/simple.el
+
+(defun append-to-buffer (buffer start end)
+  "Append to specified buffer the text of the region.
+It is inserted into that buffer before its point.
+
+When calling from a program, give three arguments:
+BUFFER (or buffer name), START and END.
+START and END specify the portion of the current buffer to be copied."
+  (interactive
+   (list (read-buffer "Append to buffer: " (other-buffer (current-buffer) t))
+         (region-beginning) (region-end)))
+  (let ((oldbuf (current-buffer)))
+    (save-excursion
+      (let* ((append-to (get-buffer-create buffer))
+             (windows (get-buffer-window-list append-to t t))
+             point)
+        (set-buffer append-to)
+        (setq point (point))
+        (barf-if-buffer-read-only)
+        (insert-buffer-substring oldbuf start end)
+        (dolist (window windows)
+          (when (= (window-point window) point)
+            (set-window-point window (point))))))))
+@end ignore
+
 The body of the @code{append-to-buffer} function begins with @code{let}.
 
 As we have seen before (@pxref{let, , @code{let}}), the purpose of a
@@ -5052,7 +5264,7 @@ whole by showing a template for @code{append-to-buffer} with the
 @group
 (defun append-to-buffer (buffer start end)
   "@var{documentation}@dots{}"
-  (interactive "BAppend to buffer:@: \nr")
+  (interactive @dots{})
   (let ((@var{variable} @var{value}))
         @var{body}@dots{})
 @end group
@@ -5142,7 +5354,7 @@ this:
 
 @need 1500
 @noindent
-This formatting convention makes it easy to see that the two lines in
+This formatting convention makes it easy to see that the lines in
 the body of the @code{save-excursion} are enclosed by the parentheses
 associated with @code{save-excursion}, just as the
 @code{save-excursion} itself is enclosed by the parentheses associated
@@ -5152,8 +5364,10 @@ with the @code{let}:
 @group
 (let ((oldbuf (current-buffer)))
   (save-excursion
-    (set-buffer (get-buffer-create buffer))
-    (insert-buffer-substring oldbuf start end))))
+    @dots{}
+    (set-buffer @dots{})
+    (insert-buffer-substring oldbuf start end)
+    @dots{}))
 @end group
 @end smallexample
 
@@ -5174,70 +5388,84 @@ of filling in the slots of a template:
 @need 1200
 @noindent
 In this function, the body of the @code{save-excursion} contains only
-two expressions.  The body looks like this:
+one expression, the @code{let*} expression.  You know about a
+@code{let} function.  The @code{let*} function is different.  It has a
+@samp{*} in its name.  It enables Emacs to set each variable in its
+varlist in sequence, one after another.
 
-@smallexample
-@group
-(set-buffer (get-buffer-create buffer))
-(insert-buffer-substring oldbuf start end)
-@end group
-@end smallexample
+Its critical feature is that variables later in the varlist can make
+use of the values to which Emacs set variables earlier in the varlist.
+@xref{fwd-para let, , The @code{let*} expression}.
 
-When the @code{append-to-buffer} function is evaluated, the two
-expressions in the body of the @code{save-excursion} are evaluated in
-sequence.  The value of the last expression is returned as the value of
-the @code{save-excursion} function; the other expression is evaluated
-only for its side effects.
+We will skip functions like @code{let*} and focus on two: the
+@code{set-buffer} function and the @code{insert-buffer-substring}
+function.
 
-The first line in the body of the @code{save-excursion} uses the
-@code{set-buffer} function to change the current buffer to the one
-specified in the first argument to @code{append-to-buffer}.  (Changing
-the buffer is the side effect; as we have said before, in Lisp, a side
-effect is often the primary thing we want.)  The second line does the
-primary work of the function.
+@need 1250
+In the old days, the @code{set-buffer} expression was simply
 
-The @code{set-buffer} function changes Emacs' attention to the buffer to
-which the text will be copied and from which @code{save-excursion} will
-return.
+@smallexample
+(set-buffer (get-buffer-create buffer))
+@end smallexample
 
-@need 800
-The line looks like this:
+@need 1250
+@noindent
+but now it is
 
 @smallexample
-(set-buffer (get-buffer-create buffer))
+(set-buffer append-to)
 @end smallexample
 
-The innermost expression of this list is @code{(get-buffer-create
-buffer)}.  This expression uses the @code{get-buffer-create} function,
-which either gets the named buffer, or if it does not exist, creates one
-with the given name.  This means you can use @code{append-to-buffer} to
-put text into a buffer that did not previously exist.
+@noindent
+@code{append-to} is bound to @code{(get-buffer-create buffer)} earlier
+on in the @code{let*} expression.  That extra binding would not be
+necessary except for that @code{append-to} is used later in the
+varlist as an argument to @code{get-buffer-window-list}.
+
+@ignore
+in GNU Emacs 22
+
+  (let ((oldbuf (current-buffer)))
+    (save-excursion
+      (let* ((append-to (get-buffer-create buffer))
+             (windows (get-buffer-window-list append-to t t))
+             point)
+        (set-buffer append-to)
+        (setq point (point))
+        (barf-if-buffer-read-only)
+        (insert-buffer-substring oldbuf start end)
+        (dolist (window windows)
+          (when (= (window-point window) point)
+            (set-window-point window (point))))))))
+@end ignore
 
-@code{get-buffer-create} also keeps @code{set-buffer} from getting an
-unnecessary error: @code{set-buffer} needs a buffer to go to; if you
-were to specify a buffer that does not exist, Emacs would baulk.
-Since @code{get-buffer-create} will create a buffer if none exists,
-@code{set-buffer} is always provided with a buffer.
+The @code{append-to-buffer} function definition inserts text from the
+buffer in which you are currently to a named buffer.  It happens that
+@code{insert-buffer-substring} copies text from another buffer to the
+current buffer, just the reverse---that is why the
+@code{append-to-buffer} definition starts out with a @code{let} that
+binds the local symbol @code{oldbuf} to the value returned by
+@code{current-buffer}.
 
 @need 1250
-The last line of @code{append-to-buffer} does the work of appending
-the text:
+The @code{insert-buffer-substring} expression looks like this:
 
 @smallexample
 (insert-buffer-substring oldbuf start end)
 @end smallexample
 
 @noindent
-The @code{insert-buffer-substring} function copies a string @emph{from}
-the buffer specified as its first argument and inserts the string into
-the present buffer.  In this case, the argument to
-@code{insert-buffer-substring} is the value of the variable created and
-bound by the @code{let}, namely the value of @code{oldbuf}, which was
-the current buffer when you gave the @code{append-to-buffer} command.
+The @code{insert-buffer-substring} function copies a string
+@emph{from} the buffer specified as its first argument and inserts the
+string into the present buffer.  In this case, the argument to
+@code{insert-buffer-substring} is the value of the variable created
+and bound by the @code{let}, namely the value of @code{oldbuf}, which
+was the current buffer when you gave the @code{append-to-buffer}
+command.
 
 After @code{insert-buffer-substring} has done its work,
-@code{save-excursion} will restore the action to the original buffer and
-@code{append-to-buffer} will have done its job.
+@code{save-excursion} will restore the action to the original buffer
+and @code{append-to-buffer} will have done its job.
 
 @need 800
 Written in skeletal form, the workings of the body look like this:
@@ -5251,16 +5479,15 @@ Written in skeletal form, the workings of the body look like this:
 
   @var{change-back-to-original-buffer-when-finished}
 @var{let-the-local-meaning-of-}@code{oldbuf}@var{-disappear-when-finished}
-
 @end group
 @end smallexample
 
-In summary, @code{append-to-buffer} works as follows: it saves the value
-of the current buffer in the variable called @code{oldbuf}.  It gets the
-new buffer, creating one if need be, and switches Emacs to it.  Using
-the value of @code{oldbuf}, it inserts the region of text from the old
-buffer into the new buffer; and then using @code{save-excursion}, it
-brings you back to your original buffer.
+In summary, @code{append-to-buffer} works as follows: it saves the
+value of the current buffer in the variable called @code{oldbuf}.  It
+gets the new buffer (creating one if need be) and switches Emacs'
+attention to it.  Using the value of @code{oldbuf}, it inserts the
+region of text from the old buffer into the new buffer; and then using
+@code{save-excursion}, it brings you back to your original buffer.
 
 In looking at @code{append-to-buffer}, you have explored a fairly
 complex function.  It shows how to use @code{let} and
@@ -5366,42 +5593,63 @@ to which the name refers.
 
 After understanding how @code{append-to-buffer} works, it is easy to
 understand @code{copy-to-buffer}.  This function copies text into a
-buffer, but instead of adding to the second buffer, it replaces the
-previous text in the second buffer.  The code for the
-@code{copy-to-buffer} function is almost the same as the code for
-@code{append-to-buffer}, except that @code{erase-buffer} and a second
-@code{save-excursion} are used.  (@xref{append-to-buffer, , The
-Definition of @code{append-to-buffer}}, for the description of
-@code{append-to-buffer}.)
+buffer, but instead of adding to the second buffer, it replaces all the
+previous text in the second buffer.
 
 @need 800
-The body of @code{copy-to-buffer} looks like this
+The body of @code{copy-to-buffer} looks like this,
 
 @smallexample
 @group
 @dots{}
-(interactive "BCopy to buffer:@: \nr")
-  (let ((oldbuf (current-buffer)))
+(interactive "BCopy to buffer: \nr")
+(let ((oldbuf (current-buffer)))
+  (with-current-buffer (get-buffer-create buffer)
+    (barf-if-buffer-read-only)
+    (erase-buffer)
     (save-excursion
-      (set-buffer (get-buffer-create buffer))
-      (erase-buffer)
-      (save-excursion
-        (insert-buffer-substring oldbuf start end)))))
+      (insert-buffer-substring oldbuf start end)))))
 @end group
 @end smallexample
 
-This code is similar to the code in @code{append-to-buffer}: it is
-only after changing to the buffer to which the text will be copied
-that the definition for this function diverges from the definition for
-@code{append-to-buffer}: the @code{copy-to-buffer} function erases the
-buffer's former contents.  (This is what is meant by `replacement'; to
-replace text, Emacs erases the previous text and then inserts new
-text.)  After erasing the previous contents of the buffer,
-@code{save-excursion} is used for a second time and the new text is
-inserted.
+The @code{copy-to-buffer} function has a simpler @code{interactive}
+expression than @code{append-to-buffer}.
+
+@need 800
+The definition then says
+
+@smallexample
+(with-current-buffer (get-buffer-create buffer) @dots{}
+@end smallexample
+
+First, look at the earliest inner expression; that is evaluated first.
+That expression starts with @code{get-buffer-create buffer}.  The
+function tells the computer to use the buffer with the name specified
+as the one to which you are copying, or if such a buffer does not
+exist, to create it.  Then, the @code{with-current-buffer} function
+evaluates its body with that buffer temporarily current.
 
-Why is @code{save-excursion} used twice?  Consider again what the
-function does.
+(This demonstrates another way to shift the computer's attention but
+not the user's.  The @code{append-to-buffer} function showed how to do
+the same with @code{save-excursion} and @code{set-buffer}.
+@code{with-current-buffer} is a newer, and arguably easier,
+mechanism.)
+
+The @code{barf-if-buffer-read-only} function sends you an error
+message saying the buffer is read-only if you cannot modify it.
+
+The next line has the @code{erase-buffer} function as its sole
+contents.  That function erases the buffer.
+
+Finally, the last two lines contain the @code{save-excursion}
+expression with @code{insert-buffer-substring} as its body.
+The  @code{insert-buffer-substring} expression copies the text from
+the buffer you are in (and you have not seen the computer shift its
+attention, so you don't know that that buffer is now called
+@code{oldbuf}).
+
+Incidentally, this is what is meant by `replacement'.  To replace text,
+Emacs erases the previous text and then inserts new text.
 
 @need 1250
 In outline, the body of @code{copy-to-buffer} looks like this:
@@ -5409,27 +5657,14 @@ In outline, the body of @code{copy-to-buffer} looks like this:
 @smallexample
 @group
 (let (@var{bind-}@code{oldbuf}@var{-to-value-of-}@code{current-buffer})
-  (save-excursion         ; @r{First use of @code{save-excursion}.}
-    @var{change-buffer}
+    (@var{with-the-buffer-you-are-copying-to}
+      (@var{but-do-not-erase-or-copy-to-a-read-only-buffer})
       (erase-buffer)
-      (save-excursion     ; @r{Second use of @code{save-excursion}.}
+      (save-excursion
         @var{insert-substring-from-}@code{oldbuf}@var{-into-buffer})))
 @end group
 @end smallexample
 
-The first use of @code{save-excursion} returns Emacs to the buffer from
-which the text is being copied.  That is clear, and is just like its use
-in @code{append-to-buffer}.  Why the second use?  The reason is that
-@code{insert-buffer-substring} always leaves point at the @emph{end} of
-the region being inserted.  The second @code{save-excursion} causes
-Emacs to leave point at the beginning of the text being inserted.  In
-most circumstances, users prefer to find point at the beginning of
-inserted text.  (Of course, the @code{copy-to-buffer} function returns
-the user to the original buffer when done---but if the user @emph{then}
-switches to the copied-to buffer, point will go to the beginning of the
-text.  Thus, this use of a second @code{save-excursion} is a little
-nicety.)
-
 @node insert-buffer, beginning-of-buffer, copy-to-buffer, More Complex
 @comment  node-name,  next,  previous,  up
 @section The Definition of @code{insert-buffer}
@@ -5443,6 +5678,9 @@ copy a region of text @emph{from} the current buffer to another buffer.
 Here is a discussion based on the original code.  The code was
 simplified in 2003 and is harder to understand.
 
+(@xref{New insert-buffer, , New Body for @code{insert-buffer}}, to see
+a discussion of the new body.)
+
 In addition, this code illustrates the use of @code{interactive} with a
 buffer that might be @dfn{read-only} and the important distinction
 between the name of an object and the object actually referred to.
@@ -5454,6 +5692,7 @@ between the name of an object and the object actually referred to.
 * if & or::                     Using an @code{if} instead of an @code{or}.
 * Insert or::                   How the @code{or} expression works.
 * Insert let::                  Two @code{save-excursion} expressions.
+* New insert-buffer::
 @end menu
 
 @node insert-buffer code, insert-buffer interactive, insert-buffer, insert-buffer
@@ -5462,7 +5701,7 @@ between the name of an object and the object actually referred to.
 @end ifnottex
 
 @need 800
-Here is the code:
+Here is the earlier code:
 
 @smallexample
 @group
@@ -5546,6 +5785,11 @@ of the buffer, offering you a default buffer, with name completion
 enabled.  If the buffer does not exist, you receive a message that
 says ``No match''; your terminal may beep at you as well.
 
+The new and simplified code generates a list for @code{interactive}.
+It uses the @code{barf-if-buffer-read-only} and @code{read-buffer}
+functions with which we are already familiar and the @code{progn}
+special form with which we are not.  (It will be described later.)
+
 @node insert-buffer body, if & or, insert-buffer interactive, insert-buffer
 @comment  node-name,  next,  previous,  up
 @subsection The Body of the @code{insert-buffer} Function
@@ -5644,7 +5888,7 @@ so the true-or-false-test looks like this:
 @noindent
 @code{not} is a function that returns true if its argument is false
 and false if its argument is true.  So if @code{(bufferp buffer)}
-returns true, the @code{not} expression returns false and vice-versa:
+returns true, the @code{not} expression returns false and vice-verse:
 what is ``not true'' is false and what is ``not false'' is true.
 
 Using this test, the @code{if} expression works as follows: when the
@@ -5722,7 +5966,7 @@ written like this:
 (or (holding-on-to-guest) (find-and-take-arm-of-guest))
 @end smallexample
 
-@node Insert let,  , Insert or, insert-buffer
+@node Insert let, New insert-buffer, Insert or, insert-buffer
 @comment  node-name,  next,  previous,  up
 @subsection The @code{let} Expression in @code{insert-buffer}
 
@@ -5821,6 +6065,45 @@ function uses @code{let}, @code{save-excursion}, and
 use @code{or}.  All these functions are building blocks that we will
 find and use again and again.
 
+@node New insert-buffer,  , Insert let, insert-buffer
+@comment  node-name,  next,  previous,  up
+@subsection New Body for @code{insert-buffer}
+@findex insert-buffer, new version body
+@findex new version body for insert-buffer
+
+The body in the GNU Emacs 22 version is more confusing than the original.
+
+@need 1250
+It consists of two expressions,
+
+@smallexample
+@group
+  (push-mark
+   (save-excursion
+     (insert-buffer-substring (get-buffer buffer))
+     (point)))
+
+   nil
+@end group
+@end smallexample
+
+@noindent
+except, and this is what confuses novices, very important work is done
+inside the @code{push-mark} expression.
+
+The @code{get-buffer} function returns a buffer with the name
+provided.  You will note that the function is @emph{not} called
+@code{get-buffer-create}; it does not create a buffer if one does not
+already exist.  The buffer returned by @code{get-buffer}, an existing
+buffer, is passed to @code{insert-buffer-substring}, which inserts the
+whole of the buffer (since you did not specify anything else).
+
+The location into which the buffer is inserted is recorded by
+@code{push-mark}.  Then the function returns @code{nil}, the value of
+its last command.  Put another way, the @code{insert-buffer} function
+exists only to produce a side effect, inserting another buffer, not to
+return any value.
+
 @node beginning-of-buffer, Second Buffer Related Review, insert-buffer, More Complex
 @comment  node-name,  next,  previous,  up
 @section Complete Definition of @code{beginning-of-buffer}
@@ -5833,16 +6116,17 @@ This section describes the complex part of the definition.
 
 As previously described, when invoked without an argument,
 @code{beginning-of-buffer} moves the cursor to the beginning of the
-buffer, leaving the mark at the previous position.  However, when the
+buffer (in truth, the beginning of the accessible portion of the
+buffer), leaving the mark at the previous position.  However, when the
 command is invoked with a number between one and ten, the function
 considers that number to be a fraction of the length of the buffer,
-measured in tenths, and Emacs moves the cursor that fraction of the way
-from the beginning of the buffer.  Thus, you can either call this
+measured in tenths, and Emacs moves the cursor that fraction of the
+way from the beginning of the buffer.  Thus, you can either call this
 function with the key command @kbd{M-<}, which will move the cursor to
 the beginning of the buffer, or with a key command such as @kbd{C-u 7
 M-<} which will move the cursor to a point 70% of the way through the
-buffer.  If a number bigger than ten is used for the argument, it moves
-to the end of the buffer.
+buffer.  If a number bigger than ten is used for the argument, it
+moves to the end of the buffer.
 
 The @code{beginning-of-buffer} function can be called with or without an
 argument.  The use of the argument is optional.
@@ -5864,12 +6148,12 @@ If that does not happen, you get an error and a message that says
 @cindex Optional arguments
 @cindex Keyword
 @findex optional
-However, optional arguments are a feature of Lisp: a @dfn{keyword} may
-be used to tell the Lisp interpreter that an argument is optional.
-The keyword is @code{&optional}.  (The @samp{&} in front of
+However, optional arguments are a feature of Lisp: a particular
+@dfn{keyword} is used to tell the Lisp interpreter that an argument is
+optional.  The keyword is @code{&optional}.  (The @samp{&} in front of
 @samp{optional} is part of the keyword.)  In a function definition, if
-an argument follows the keyword @code{&optional}, a value does not
-need to be passed to that argument when the function is called.
+an argument follows the keyword @code{&optional}, no value need be
+passed to that argument when the function is called.
 
 @need 1200
 The first line of the function definition of @code{beginning-of-buffer}
@@ -5887,12 +6171,16 @@ In outline, the whole function looks like this:
 (defun beginning-of-buffer (&optional arg)
   "@var{documentation}@dots{}"
   (interactive "P")
-  (push-mark)
+  (or (@var{is-the-argument-a-cons-cell} arg)
+      (and @var{are-both-transient-mark-mode-and-mark-active-true})
+      (push-mark))
+  (let (@var{determine-size-and-set-it})
   (goto-char
     (@var{if-there-is-an-argument}
         @var{figure-out-where-to-go}
       @var{else-go-to}
       (point-min))))
+   @var{do-nicety}
 @end group
 @end smallexample
 
@@ -5900,26 +6188,37 @@ The function is similar to the @code{simplified-beginning-of-buffer}
 function except that the @code{interactive} expression has @code{"P"}
 as an argument and the @code{goto-char} function is followed by an
 if-then-else expression that figures out where to put the cursor if
-there is an argument.
-
-The @code{"P"} in the @code{interactive} expression tells Emacs to pass
-a prefix argument, if there is one, to the function.  A prefix argument
-is made by typing the @key{META} key followed by a number, or by typing
-@kbd{C-u} and then a number (if you don't type a number, @kbd{C-u}
-defaults to 4).
-
-The true-or-false-test of the @code{if} expression is simple: it is
-simply the argument @code{arg}.  If @code{arg} has a value that is not
-@code{nil}, which will be the case if @code{beginning-of-buffer} is
-called with an argument, then this true-or-false-test will return true
-and the then-part of the @code{if} expression will be evaluated.  On the
+there is an argument that is not a cons cell.
+
+(Since I do not explain a cons cell for many more chapters, please
+consider ignoring the function @code{consp}.  @xref{List
+Implementation, , How Lists are Implemented}, and @ref{Cons Cell Type,
+, Cons Cell and List Types, elisp, The GNU Emacs Lisp Reference
+Manual}.)
+
+The @code{"P"} in the @code{interactive} expression tells Emacs to
+pass a prefix argument, if there is one, to the function in raw form.
+A prefix argument is made by typing the @key{META} key followed by a
+number, or by typing @kbd{C-u} and then a number.  (If you don't type
+a number, @kbd{C-u} defaults to a cons cell with a 4.  A lowercase
+@code{"p"} in the @code{interactive} expression causes the function to
+convert a prefix arg to a number.)
+
+The true-or-false-test of the @code{if} expression looks complex, but
+it is not: it checks whether @code{arg} has a value that is not
+@code{nil} and whether it is a cons cell.  (That is what @code{consp}
+does; it checks whether its argument is a cons cell.)  If @code{arg}
+has a value that is not @code{nil} (and is not a cons cell), which
+will be the case if @code{beginning-of-buffer} is called with a
+numeric argument, then this true-or-false-test will return true and
+the then-part of the @code{if} expression will be evaluated.  On the
 other hand, if @code{beginning-of-buffer} is not called with an
 argument, the value of @code{arg} will be @code{nil} and the else-part
-of the @code{if} expression will be evaluated.  The else-part is simply
-@code{point-min}, and when this is the outcome, the whole
-@code{goto-char} expression is @code{(goto-char (point-min))}, which is
-how we saw the @code{beginning-of-buffer} function in its simplified
-form.
+of the @code{if} expression will be evaluated.  The else-part is
+simply @code{point-min}, and when this is the outcome, the whole
+@code{goto-char} expression is @code{(goto-char (point-min))}, which
+is how we saw the @code{beginning-of-buffer} function in its
+simplified form.
 
 @node beginning-of-buffer opt arg, beginning-of-buffer complete, Optional Arguments, beginning-of-buffer
 @subsection @code{beginning-of-buffer} with an Argument
@@ -5934,11 +6233,12 @@ like this:
 @group
 (if (> (buffer-size) 10000)
     ;; @r{Avoid overflow for large buffer sizes!}
-    (* (prefix-numeric-value arg) (/ (buffer-size) 10))
+                          (* (prefix-numeric-value arg)
+                             (/ size 10))
   (/
    (+ 10
       (*
-       (buffer-size) (prefix-numeric-value arg))) 10))
+       size (prefix-numeric-value arg))) 10)))
 @end group
 @end smallexample
 
@@ -5967,14 +6267,14 @@ expression.  In skeletal form, the expression looks like this:
 @end smallexample
 
 The true-or-false-test of this inner @code{if} expression checks the
-size of the buffer.  The reason for this is that the old Version 18
-Emacs used numbers that are no bigger than eight million or so
-and in the computation that followed, the programmer feared that Emacs
-might try to use over-large numbers if the buffer were large.  The
-term `overflow', mentioned in the comment, means numbers that are over
-large.  Version 21 Emacs uses larger numbers, but this code has not
-been touched, if only because people now look at buffers that are far,
-far larger than ever before.
+size of the buffer.  The reason for this is that the old version 18
+Emacs used numbers that are no bigger than eight million or so and in
+the computation that followed, the programmer feared that Emacs might
+try to use over-large numbers if the buffer were large.  The term
+`overflow', mentioned in the comment, means numbers that are over
+large.  More recent versions of Emacs use larger numbers, but this
+code has not been touched, if only because people now look at buffers
+that are far, far larger than ever before.
 
 There are two cases:  if the buffer is large and if it is not.
 
@@ -5984,13 +6284,21 @@ There are two cases:  if the buffer is large and if it is not.
 
 In @code{beginning-of-buffer}, the inner @code{if} expression tests
 whether the size of the buffer is greater than 10,000 characters.  To do
-this, it uses the @code{>} function and the @code{buffer-size} function.
+this, it uses the @code{>} function and the computation of @code{size}
+that comes from the let expression.
+
+In the old days, the function @code{buffer-size} was used.  Not only
+was that function called several times, it gave the size of the whole
+buffer, not the accessible part.  The computation makes much more
+sense when it handles just the accessible part.  (@xref{Narrowing &
+Widening, , Narrowing and Widening}, for more information on focusing
+attention to an `accessible' part.)
 
 @need 800
 The line looks like this:
 
 @smallexample
-(if (> (buffer-size) 10000)
+(if (> size 10000)
 @end smallexample
 
 @need 1200
@@ -6002,7 +6310,7 @@ evaluated.  It reads like this (after formatting for easy reading):
 @group
 (*
   (prefix-numeric-value arg)
-  (/ (buffer-size) 10))
+  (/ size 10))
 @end group
 @end smallexample
 
@@ -6019,11 +6327,12 @@ the arithmetic, a conversion is necessary, and
 
 @findex / @r{(division)}
 @cindex Division
-The second argument is @code{(/ (buffer-size) 10)}.  This expression
-divides the numeric value of the buffer by ten.  This produces a number
-that tells how many characters make up one tenth of the buffer size.
-(In Lisp, @code{/} is used for division, just as @code{*} is
-used for multiplication.)
+The second argument is @code{(/ size 10)}.  This expression divides
+the numeric value by ten --- the numeric value of the size of the
+accessible portion of the buffer.  This produces a number that tells
+how many characters make up one tenth of the buffer size.  (In Lisp,
+@code{/} is used for division, just as @code{*} is used for
+multiplication.)
 
 @need 1200
 In the multiplication expression as a whole, this amount is multiplied
@@ -6032,23 +6341,22 @@ by the value of the prefix argument---the multiplication looks like this:
 @smallexample
 @group
 (* @var{numeric-value-of-prefix-arg}
-   @var{number-of-characters-in-one-tenth-of-the-buffer})
+   @var{number-of-characters-in-one-tenth-of-the-accessible-buffer})
 @end group
 @end smallexample
 
 @noindent
 If, for example, the prefix argument is @samp{7}, the one-tenth value
-will be multiplied by 7 to give a position 70% of the way through the
-buffer.
+will be multiplied by 7 to give a position 70% of the way through.
 
 @need 1200
-The result of all this is that if the buffer is large, the
-@code{goto-char} expression reads like this:
+The result of all this is that if the accessible portion of the buffer
+is large, the @code{goto-char} expression reads like this:
 
 @smallexample
 @group
 (goto-char (* (prefix-numeric-value arg)
-              (/ (buffer-size) 10)))
+              (/ size 10)))
 @end group
 @end smallexample
 
@@ -6069,7 +6377,7 @@ The code looks like this:
 
 @c Keep this on one line.
 @smallexample
-(/ (+ 10 (* (buffer-size) (prefix-numeric-value arg))) 10))
+(/ (+ 10 (* size (prefix-numeric-value arg))) 10))
 @end smallexample
 
 @need 1200
@@ -6084,7 +6392,7 @@ enclosing expression:
   (/
    (+ 10
       (*
-       (buffer-size)
+       size
        (prefix-numeric-value arg)))
    10))
 @end group
@@ -6093,12 +6401,12 @@ enclosing expression:
 @need 1200
 @noindent
 Looking at parentheses, we see that the innermost operation is
-@code{(prefix-numeric-value arg)}, which converts the raw argument to a
-number.  This number is multiplied by the buffer size in the following
-expression:
+@code{(prefix-numeric-value arg)}, which converts the raw argument to
+a number.  In the following expression, this number is multiplied by
+the size of the accessible portion of the buffer:
 
 @smallexample
-(* (buffer-size) (prefix-numeric-value arg))
+(* size (prefix-numeric-value arg))
 @end smallexample
 
 @noindent
@@ -6120,25 +6428,66 @@ the cursor is moved to that point.
 Here is the complete text of the @code{beginning-of-buffer} function:
 @sp 1
 
+@c In GNU Emacs 22
 @smallexample
 @group
 (defun beginning-of-buffer (&optional arg)
   "Move point to the beginning of the buffer;
 leave mark at previous position.
-With arg N, put point N/10 of the way
-from the true beginning.
+With \\[universal-argument] prefix,
+do not set mark at previous position.
+With numeric arg N,
+put point N/10 of the way from the beginning.
+
+If the buffer is narrowed,
+this command uses the beginning and size
+of the accessible part of the buffer.
 @end group
+
 @group
-Don't use this in Lisp programs!
+Don't use this command in Lisp programs!
 \(goto-char (point-min)) is faster
-and does not set the mark."
+and avoids clobbering the mark."
   (interactive "P")
-  (push-mark)
+  (or (consp arg)
+      (and transient-mark-mode mark-active)
+      (push-mark))
+@end group
+@group
+  (let ((size (- (point-max) (point-min))))
+    (goto-char (if (and arg (not (consp arg)))
+                   (+ (point-min)
+                      (if (> size 10000)
+                          ;; Avoid overflow for large buffer sizes!
+                          (* (prefix-numeric-value arg)
+                             (/ size 10))
+                        (/ (+ 10 (* size (prefix-numeric-value arg))) 10)))
+                 (point-min))))
+  (if arg (forward-line 1)))
 @end group
+@end smallexample
+
+@ignore
+From before GNU Emacs 22
+@smallexample
 @group
-  (goto-char
-   (if arg
-       (if (> (buffer-size) 10000)
+(defun beginning-of-buffer (&optional arg)
+  "Move point to the beginning of the buffer;
+leave mark at previous position.
+With arg N, put point N/10 of the way
+from the true beginning.
+@end group
+@group
+Don't use this in Lisp programs!
+\(goto-char (point-min)) is faster
+and does not set the mark."
+  (interactive "P")
+  (push-mark)
+@end group
+@group
+  (goto-char
+   (if arg
+       (if (> (buffer-size) 10000)
            ;; @r{Avoid overflow for large buffer sizes!}
            (* (prefix-numeric-value arg)
               (/ (buffer-size) 10))
@@ -6151,6 +6500,7 @@ and does not set the mark."
   (if arg (forward-line 1)))
 @end group
 @end smallexample
+@end ignore
 
 @noindent
 Except for two small points, the previous discussion shows how this
@@ -6162,18 +6512,21 @@ the function.
 In the documentation string, there is reference to an expression:
 
 @smallexample
-\(goto-char (point-min))
+\\[universal-argument]
 @end smallexample
 
 @noindent
-A @samp{\} is used before the first parenthesis of this expression.
-This @samp{\} tells the Lisp interpreter that the expression should be
-printed as shown in the documentation rather than evaluated as a
-symbolic expression, which is what it looks like.
+A @samp{\\} is used before the first square bracket of this
+expression.  This @samp{\\} tells the Lisp interpreter to substitute
+whatever key is currently bound to the @samp{[@dots{}]}.  In the case
+of @code{universal-argument}, that is usually @kbd{C-u}, but it might
+be different.  (@xref{Documentation Tips, , Tips for Documentation
+Strings, elisp, The GNU Emacs Lisp Reference Manual}, for more
+information.)
 
 @need 1200
-Finally, the last line of the @code{beginning-of-buffer} command says to
-move point to the beginning of the next line if the command is
+Finally, the last line of the @code{beginning-of-buffer} command says
+to move point to the beginning of the next line if the command is
 invoked with an argument:
 
 @smallexample
@@ -6185,8 +6538,15 @@ This puts the cursor at the beginning of the first line after the
 appropriate tenths position in the buffer.  This is a flourish that
 means that the cursor is always located @emph{at least} the requested
 tenths of the way through the buffer, which is a nicety that is,
-perhaps, not necessary, but which, if it did not occur, would be sure to
-draw complaints.
+perhaps, not necessary, but which, if it did not occur, would be sure
+to draw complaints.
+
+On the other hand, it also means that if you specify the command with
+a @kbd{C-u}, but without a number, that is to say, if the `raw prefix
+argument' is simply a cons cell, then the command puts you at the
+beginning of the second line @dots{}  I don't know whether this is
+intended or whether no one has dealt with the code to avoid this
+happening.
 
 @node Second Buffer Related Review, optional Exercise, beginning-of-buffer, More Complex
 @comment  node-name,  next,  previous,  up
@@ -6200,7 +6560,7 @@ Evaluate each argument in sequence, and return the value of the first
 argument that is not @code{nil}; if none return a value that is not
 @code{nil}, return @code{nil}.  In brief, return the first true value
 of the arguments; return a true value if one @emph{or} any of the
-other are true.
+others are true.
 
 @item and
 Evaluate each argument in sequence, and if any are @code{nil}, return
@@ -6359,6 +6719,60 @@ For example,
 @end group
 @end smallexample
 
+@ignore
+Emacs 22
+/usr/local/src/emacs/lisp/simple.el
+
+(defun what-line ()
+  "Print the current buffer line number and narrowed line number of point."
+  (interactive)
+  (let ((start (point-min))
+        (n (line-number-at-pos)))
+    (if (= start 1)
+        (message "Line %d" n)
+      (save-excursion
+        (save-restriction
+          (widen)
+          (message "line %d (narrowed line %d)"
+                   (+ n (line-number-at-pos start) -1) n))))))
+
+(defun line-number-at-pos (&optional pos)
+  "Return (narrowed) buffer line number at position POS.
+If POS is nil, use current buffer location.
+Counting starts at (point-min), so the value refers
+to the contents of the accessible portion of the buffer."
+  (let ((opoint (or pos (point))) start)
+    (save-excursion
+      (goto-char (point-min))
+      (setq start (point))
+      (goto-char opoint)
+      (forward-line 0)
+      (1+ (count-lines start (point))))))
+
+(defun count-lines (start end)
+  "Return number of lines between START and END.
+This is usually the number of newlines between them,
+but can be one more if START is not equal to END
+and the greater of them is not at the start of a line."
+  (save-excursion
+    (save-restriction
+      (narrow-to-region start end)
+      (goto-char (point-min))
+      (if (eq selective-display t)
+          (save-match-data
+            (let ((done 0))
+              (while (re-search-forward "[\n\C-m]" nil t 40)
+                (setq done (+ 40 done)))
+              (while (re-search-forward "[\n\C-m]" nil t 1)
+                (setq done (+ 1 done)))
+              (goto-char (point-max))
+              (if (and (/= start end)
+                       (not (bolp)))
+                  (1+ done)
+                done)))
+        (- (buffer-size) (forward-line (buffer-size)))))))
+@end ignore
+
 @node what-line, narrow Exercise, save-restriction, Narrowing & Widening
 @comment  node-name,  next,  previous,  up
 @section @code{what-line}
@@ -6389,13 +6803,17 @@ been expanded to tell you your line number in a narrowed buffer as
 well as your line number in a widened buffer.  The recent version is
 more complex than the version shown here.  If you feel adventurous,
 you might want to look at it after figuring out how this version
-works.  The newer version uses a conditional to determine whether the
-buffer has been narrowed, and rather than use @code{beginning-of-line}
-to move point to the beginning of the current line, if need be, the
-function uses @code{(forward-line 0)}.)
+works.  You will probably need to use @kbd{C-h f}
+(@code{describe-function}).  The newer version uses a conditional to
+determine whether the buffer has been narrowed.
 
-The function as shown here has a documentation line and is
-interactive, as you would expect.  The next two lines use the
+(Also, it uses @code{line-number-at-pos}, which among other simple
+expressions, such as @code{(goto-char (point-min))}, moves point to
+the beginning of the current line with @code{(forward-line 0)} rather
+than @code{beginning-of-line}.)
+
+The @code{what-line} function as shown here has a documentation line
+and is interactive, as you would expect.  The next two lines use the
 functions @code{save-restriction} and @code{widen}.
 
 The @code{save-restriction} special form notes whatever narrowing is in
@@ -6434,15 +6852,14 @@ echo area.
 @end group
 @end smallexample
 
-The @code{message} function prints a one-line message at the bottom of the
-Emacs screen.  The first argument is inside of quotation marks and is
-printed as a string of characters.  However, it may contain @samp{%d},
-@samp{%s}, or @samp{%c} to print arguments that follow the string.
-@samp{%d} prints the argument as a decimal, so the message will say
-something such as @samp{Line 243}.
+The @code{message} function prints a one-line message at the bottom of
+the Emacs screen.  The first argument is inside of quotation marks and
+is printed as a string of characters.  However, it may contain a
+@samp{%d} expression to print a following argument.  @samp{%d} prints
+the argument as a decimal, so the message will say something such as
+@samp{Line 243}.
 
 @need 1200
-
 The number that is printed in place of the @samp{%d} is computed by the
 last line of the function:
 
@@ -6450,6 +6867,33 @@ last line of the function:
 (1+ (count-lines 1 (point)))
 @end smallexample
 
+@ignore
+GNU Emacs 22
+
+(defun count-lines (start end)
+  "Return number of lines between START and END.
+This is usually the number of newlines between them,
+but can be one more if START is not equal to END
+and the greater of them is not at the start of a line."
+  (save-excursion
+    (save-restriction
+      (narrow-to-region start end)
+      (goto-char (point-min))
+      (if (eq selective-display t)
+          (save-match-data
+            (let ((done 0))
+              (while (re-search-forward "[\n\C-m]" nil t 40)
+                (setq done (+ 40 done)))
+              (while (re-search-forward "[\n\C-m]" nil t 1)
+                (setq done (+ 1 done)))
+              (goto-char (point-max))
+              (if (and (/= start end)
+                       (not (bolp)))
+                  (1+ done)
+                done)))
+        (- (buffer-size) (forward-line (buffer-size)))))))
+@end ignore
+
 @noindent
 What this does is count the lines from the first position of the
 buffer, indicated by the @code{1}, up to @code{(point)}, and then add
@@ -6477,12 +6921,14 @@ functions, including @code{save-restriction}, @code{widen},
 @cindex Properties, mention of @code{buffer-substring-no-properties}
 (@code{buffer-substring} is a previously unmentioned function you will
 have to investigate yourself; or perhaps you will have to use
-@code{buffer-substring-no-properties} @dots{}, yet another function
-and one that introduces text properties, a feature otherwise not
-discussed here.  @xref{Text Properties, , Text Properties, elisp, The
-GNU Emacs Lisp Reference Manual}.  Additionally, do you really need
-@code{goto-char} or @code{point-min}?  Or can you write the function
-without them?)
+@code{buffer-substring-no-properties} or
+@code{filter-buffer-substring} @dots{}, yet other functions.  Text
+properties are a feature otherwise not discussed here.  @xref{Text
+Properties, , Text Properties, elisp, The GNU Emacs Lisp Reference
+Manual}.)
+
+Additionally, do you really need @code{goto-char} or @code{point-min}?
+Or can you write the function without them?
 
 @node car cdr & cons, Cutting & Storing Text, Narrowing & Widening, Top
 @comment  node-name,  next,  previous,  up
@@ -6798,7 +7244,7 @@ without giving it an argument, not even an empty list:
 What you see, if you evaluate this, is the error message
 
 @smallexample
-Wrong number of arguments: #<subr length>, 0
+Lisp error: (wrong-number-of-arguments length 0)
 @end smallexample
 
 @noindent
@@ -6808,13 +7254,20 @@ this case, one argument is expected, the argument being a list whose
 length the function is measuring.  (Note that @emph{one} list is
 @emph{one} argument, even if the list has many elements inside it.)
 
-The part of the error message that says @samp{#<subr length>} is the
-name of the function.  This is written with a special notation,
-@samp{#<subr}, that indicates that the function @code{length} is one
-of the primitive functions written in C rather than in Emacs Lisp.
-(@samp{subr} is an abbreviation for `subroutine'.)  @xref{What Is a
-Function, , What Is a Function?, elisp , The GNU Emacs Lisp Reference
-Manual}, for more about subroutines.
+The part of the error message that says @samp{length} is the name of
+the function.
+
+@ignore
+@code{length} is still a subroutine, but you need C-h f to discover that.
+
+In an earlier version:
+    This is written with a special notation, @samp{#<subr},
+    that indicates that the function @code{length} is one of the primitive
+    functions written in C rather than in Emacs Lisp.  (@samp{subr} is an
+    abbreviation for `subroutine'.)  @xref{What Is a Function, , What Is a
+    Function?, elisp , The GNU Emacs Lisp Reference Manual}, for more
+    about subroutines.
+@end ignore
 
 @node nthcdr, nth, cons, car cdr & cons
 @comment  node-name,  next,  previous,  up
@@ -7016,9 +7469,14 @@ list, using the @code{setq} function.  Here is a list of animals:
 @noindent
 If you are reading this in Info inside of GNU Emacs, you can evaluate
 this expression in the usual fashion, by positioning the cursor after
-the expression and typing @kbd{C-x C-e}.  (I'm doing this right here as
-I write this.  This is one of the advantages of having the interpreter
-built into the computing environment.)
+the expression and typing @kbd{C-x C-e}.  (I'm doing this right here
+as I write this.  This is one of the advantages of having the
+interpreter built into the computing environment.  Incidentally, when
+there is nothing on the line after the final parentheses, such as a
+comment, point can be on the next line.  Thus, if your cursor is in
+the first column of the next line, you do not need to move it.
+Indeed, Emacs permits any amount of white space after the final
+parenthesis.)
 
 @need 1200
 When we evaluate the variable @code{animals}, we see that it is bound to
@@ -7159,9 +7617,9 @@ sources with `clip' and all occurrences of `killed' with `clipped'.)
 * Storing Text::                Text is stored in a list.
 * zap-to-char::                 Cutting out text up to a character.
 * kill-region::                 Cutting text out of a region.
+* copy-region-as-kill::         A definition for copying text.
 * Digression into C::           Minor note on C programming language macros.
 * defvar::                      How to give a variable an initial value.
-* copy-region-as-kill::         A definition for copying text.
 * cons & search-fwd Review::
 * search Exercises::
 @end menu
@@ -7181,9 +7639,9 @@ look like this:
 
 @need 1200
 @noindent
-The function @code{cons} can be used to to create a new list from a
-piece of text (an `atom', to use the jargon) and an existing list,
-like this:
+The function @code{cons} can be used to create a new list from a piece
+of text (an `atom', to use the jargon) and an existing list, like
+this:
 
 @smallexample
 @group
@@ -7238,15 +7696,15 @@ retrieved.  @xref{Yanking, , Yanking Text Back}.
 @section @code{zap-to-char}
 @findex zap-to-char
 
-The @code{zap-to-char} function barely changed between GNU Emacs
-version 19 and GNU Emacs version 21.  However, @code{zap-to-char}
-calls another function, @code{kill-region}, which enjoyed a major rewrite
-on the way to version 21.
+The @code{zap-to-char} function changed little between GNU Emacs
+version 19 and GNU Emacs version 22.  However, @code{zap-to-char}
+calls another function, @code{kill-region}, which enjoyed a major
+rewrite.
 
 The @code{kill-region} function in Emacs 19 is complex, but does not
 use code that is important at this time.  We will skip it.
 
-The @code{kill-region} function in Emacs 21 is easier to read than the
+The @code{kill-region} function in Emacs 22 is easier to read than the
 same function in Emacs 19 and introduces a very important concept,
 that of error handling.  We will walk through the function.
 
@@ -7266,18 +7724,16 @@ But first, let us look at the interactive @code{zap-to-char} function.
 @unnumberedsubsec The Complete @code{zap-to-char} Implementation
 @end ifnottex
 
-The GNU Emacs version 19 and version 21 implementations of the
-@code{zap-to-char} function are nearly identical in form, and they
-work alike.  The function removes the text in the region between the
-location of the cursor (i.e., of point) up to and including the next
-occurrence of a specified character.  The text that @code{zap-to-char}
-removes is put in the kill ring; and it can be retrieved from the kill
-ring by typing @kbd{C-y} (@code{yank}).  If the command is given an
-argument, it removes text through that number of occurrences.  Thus,
-if the cursor were at the beginning of this sentence and the character
-were @samp{s}, @samp{Thus} would be removed.  If the argument were
-two, @samp{Thus, if the curs} would be removed, up to and including
-the @samp{s} in @samp{cursor}.
+The @code{zap-to-char} function removes the text in the region between
+the location of the cursor (i.e., of point) up to and including the
+next occurrence of a specified character.  The text that
+@code{zap-to-char} removes is put in the kill ring; and it can be
+retrieved from the kill ring by typing @kbd{C-y} (@code{yank}).  If
+the command is given an argument, it removes text through that number
+of occurrences.  Thus, if the cursor were at the beginning of this
+sentence and the character were @samp{s}, @samp{Thus} would be
+removed.  If the argument were two, @samp{Thus, if the curs} would be
+removed, up to and including the @samp{s} in @samp{cursor}.
 
 If the specified character is not found, @code{zap-to-char} will say
 ``Search failed'', tell you the character you typed, and not remove
@@ -7288,12 +7744,8 @@ a search function.  Searches are used extensively in code that
 manipulates text, and we will focus attention on them as well as on the
 deletion command.
 
-@need 800
-Here is the complete text of the version 19 implementation of the function:
-
-@c v 19
-@smallexample
-@group
+@ignore
+@c GNU Emacs version 19
 (defun zap-to-char (arg char)  ; version 19 implementation
   "Kill up to and including ARG'th occurrence of CHAR.
 Goes backward if ARG is negative; error if CHAR not found."
@@ -7303,9 +7755,30 @@ Goes backward if ARG is negative; error if CHAR not found."
                  (search-forward
                   (char-to-string char) nil nil arg)
                  (point))))
+@end ignore
+
+@need 1250
+Here is the complete text of the version 22 implementation of the function:
+
+@c GNU Emacs 22
+@smallexample
+@group
+(defun zap-to-char (arg char)
+  "Kill up to and including ARG'th occurrence of CHAR.
+Case is ignored if `case-fold-search' is non-nil in the current buffer.
+Goes backward if ARG is negative; error if CHAR not found."
+  (interactive "p\ncZap to char: ")
+  (if (char-table-p translation-table-for-input)
+      (setq char (or (aref translation-table-for-input char) char)))
+  (kill-region (point) (progn
+                         (search-forward (char-to-string char) nil nil arg)
+                         (point))))
 @end group
 @end smallexample
 
+The documentation is thorough.  You do need to know the jargon meaning
+of the word `kill'.
+
 @node zap-to-char interactive, zap-to-char body, Complete zap-to-char, zap-to-char
 @comment  node-name,  next,  previous,  up
 @subsection The @code{interactive} Expression
@@ -7315,44 +7788,11 @@ The interactive expression in the @code{zap-to-char} command looks like
 this:
 
 @smallexample
-(interactive "*p\ncZap to char: ")
-@end smallexample
-
-The part within quotation marks, @code{"*p\ncZap to char:@: "}, specifies
-three different things.  First, and most simply, the asterisk, @samp{*},
-causes an error to be signaled if the buffer is read-only.  This means that
-if you try @code{zap-to-char} in a read-only buffer you will not be able to
-remove text, and you will receive a message that says ``Buffer is
-read-only''; your terminal may beep at you as well.
-
-The version 21 implementation does not have the asterisk, @samp{*}.  The
-function works the same as in version 19: in both cases, it cannot
-remove text from a read-only buffer but the function does copy the
-text that would have been removed to the kill ring.  Also, in both
-cases, you see an error message.
-
-However, the version 19 implementation copies text from a read-only
-buffer only because of a mistake in the implementation of
-@code{interactive}.  According to the documentation for
-@code{interactive}, the asterisk, @samp{*}, should prevent the
-@code{zap-to-char} function from doing anything at all when the buffer
-is read only.  In version 19, the function should not copy the text to
-the kill ring.  It is a bug that it does.
-
-In version 21, the function is designed to copy the text to the kill
-ring; moreover, @code{interactive} is implemented correctly.  So the
-asterisk, @samp{*}, had to be removed from the interactive
-specification.  However, if you insert an @samp{*} yourself and
-evaluate the function definition, then the next time you run the
-@code{zap-to-char} function on a read-only buffer, you will not copy
-any text.
-
-That change aside, and a change to the documentation, the two versions
-of the  @code{zap-to-char} function are identical.
-
-Let us continue with the interactive specification.
+(interactive "p\ncZap to char: ")
+@end smallexample
 
-The second part of @code{"*p\ncZap to char:@: "} is the @samp{p}.
+The part within quotation marks, @code{"p\ncZap to char:@: "}, specifies
+two different things.  First, and most simply, is the @samp{p}.
 This part is separated from the next part by a newline, @samp{\n}.
 The @samp{p} means that the first argument to the function will be
 passed the value of a `processed prefix'.  The prefix argument is
@@ -7360,15 +7800,21 @@ passed by typing @kbd{C-u} and a number, or @kbd{M-} and a number.  If
 the function is called interactively without a prefix, 1 is passed to
 this argument.
 
-The third part of @code{"*p\ncZap to char:@: "} is @samp{cZap to char:@:
-}.  In this part, the lower case @samp{c} indicates that
-@code{interactive} expects a prompt and that the argument will be a
-character.  The prompt follows the @samp{c} and is the string @samp{Zap
-to char:@: } (with a space after the colon to make it look good).
+The second part of @code{"p\ncZap to char:@: "} is
+@samp{cZap to char:@:  }.  In this part, the lower case @samp{c}
+indicates that @code{interactive} expects a prompt and that the
+argument will be a character.  The prompt follows the @samp{c} and is
+the string @samp{Zap to char:@: } (with a space after the colon to
+make it look good).
 
 What all this does is prepare the arguments to @code{zap-to-char} so they
 are of the right type, and give the user a prompt.
 
+In a read-only buffer, the @code{zap-to-char} function copies the text
+to the kill ring, but does not remove it.  The echo area displays a
+message saying that the buffer is read-only.  Also, the terminal may
+beep or blink at you.
+
 @node zap-to-char body, search-forward, zap-to-char interactive, zap-to-char
 @comment  node-name,  next,  previous,  up
 @subsection The Body of @code{zap-to-char}
@@ -7376,12 +7822,27 @@ are of the right type, and give the user a prompt.
 The body of the @code{zap-to-char} function contains the code that
 kills (that is, removes) the text in the region from the current
 position of the cursor up to and including the specified character.
+
 The first part of the code looks like this:
 
 @smallexample
-(kill-region (point) @dots{}
+(if (char-table-p translation-table-for-input)
+    (setq char (or (aref translation-table-for-input char) char)))
+(kill-region (point) (progn
+                       (search-forward (char-to-string char) nil nil arg)
+                       (point)))
 @end smallexample
 
+@noindent
+@code{char-table-p} is an hitherto unseen function.  It determines
+whether its argument is a character table.  When it is, it sets the
+character passed to @code{zap-to-char} to one of them, if that
+character exists, or to the character itself.  (This becomes important
+for certain characters in non-European languages.  The @code{aref}
+function extracts an element from an array.  It is an array-specific
+function that is not described in this document.  @xref{Arrays, ,
+Arrays, elisp, The GNU Emacs Lisp Reference Manual}.)
+
 @noindent
 @code{(point)} is the current position of the cursor.
 
@@ -7402,10 +7863,12 @@ The @code{search-forward} function is used to locate the
 zapped-for-character in @code{zap-to-char}.  If the search is
 successful, @code{search-forward} leaves point immediately after the
 last character in the target string.  (In @code{zap-to-char}, the
-target string is just one character long.)  If the search is
-backwards, @code{search-forward} leaves point just before the first
-character in the target.  Also, @code{search-forward} returns @code{t}
-for true.  (Moving point is therefore a `side effect'.)
+target string is just one character long.  @code{zap-to-char} uses the
+function @code{char-to-string} to ensure that the computer treats that
+character as a string.)  If the search is backwards,
+@code{search-forward} leaves point just before the first character in
+the target.  Also, @code{search-forward} returns @code{t} for true.
+(Moving point is therefore a `side effect'.)
 
 @need 1250
 In @code{zap-to-char}, the @code{search-forward} function looks like this:
@@ -7501,9 +7964,12 @@ character in the target.  The movement of point is a side effect.
 The second and last argument to @code{progn} is the expression
 @code{(point)}.  This expression returns the value of point, which in
 this case will be the location to which it has been moved by
-@code{search-forward}.  This value is returned by the @code{progn}
-expression and is passed to @code{kill-region} as @code{kill-region}'s
-second argument.
+@code{search-forward}.  (In the source, a line that tells the function
+to go to the previous character, if it is going forward, was commented
+out in 1999; I don't remember whether that feature or mis-feature was
+ever a part of the distributed source.)  The value of @code{point} is
+returned by the @code{progn} expression and is passed to
+@code{kill-region} as @code{kill-region}'s second argument.
 
 @node Summing up zap-to-char,  , progn, zap-to-char
 @comment  node-name,  next,  previous,  up
@@ -7520,14 +7986,14 @@ value of this location.  The @code{kill-region} function puts together
 these two values of point, the first one as the beginning of the region
 and the second one as the end of the region, and removes the region.
 
-The @code{progn} special form is necessary because the @code{kill-region}
-command takes two arguments; and it would fail if @code{search-forward}
-and @code{point} expressions were  written in sequence as two
-additional arguments.  The @code{progn} expression is a single argument
-to @code{kill-region} and returns the one value that @code{kill-region}
-needs for its second argument.
+The @code{progn} special form is necessary because the
+@code{kill-region} command takes two arguments; and it would fail if
+@code{search-forward} and @code{point} expressions were written in
+sequence as two additional arguments.  The @code{progn} expression is
+a single argument to @code{kill-region} and returns the one value that
+@code{kill-region} needs for its second argument.
 
-@node kill-region, Digression into C, zap-to-char, Cutting & Storing Text
+@node kill-region, copy-region-as-kill, zap-to-char, Cutting & Storing Text
 @comment  node-name,  next,  previous,  up
 @section @code{kill-region}
 @findex kill-region
@@ -7536,7 +8002,67 @@ The @code{zap-to-char} function uses the @code{kill-region} function.
 This function clips text from a region and copies that text to
 the kill ring, from which it may be retrieved.
 
-The Emacs 21 version of that function uses @code{condition-case} and
+@ignore
+GNU Emacs 22:
+
+(defun kill-region (beg end &optional yank-handler)
+  "Kill (\"cut\") text between point and mark.
+This deletes the text from the buffer and saves it in the kill ring.
+The command \\[yank] can retrieve it from there.
+\(If you want to kill and then yank immediately, use \\[kill-ring-save].)
+
+If you want to append the killed region to the last killed text,
+use \\[append-next-kill] before \\[kill-region].
+
+If the buffer is read-only, Emacs will beep and refrain from deleting
+the text, but put the text in the kill ring anyway.  This means that
+you can use the killing commands to copy text from a read-only buffer.
+
+This is the primitive for programs to kill text (as opposed to deleting it).
+Supply two arguments, character positions indicating the stretch of text
+ to be killed.
+Any command that calls this function is a \"kill command\".
+If the previous command was also a kill command,
+the text killed this time appends to the text killed last time
+to make one entry in the kill ring.
+
+In Lisp code, optional third arg YANK-HANDLER, if non-nil,
+specifies the yank-handler text property to be set on the killed
+text.  See `insert-for-yank'."
+  ;; Pass point first, then mark, because the order matters
+  ;; when calling kill-append.
+  (interactive (list (point) (mark)))
+  (unless (and beg end)
+    (error "The mark is not set now, so there is no region"))
+  (condition-case nil
+      (let ((string (filter-buffer-substring beg end t)))
+        (when string                        ;STRING is nil if BEG = END
+          ;; Add that string to the kill ring, one way or another.
+          (if (eq last-command 'kill-region)
+              (kill-append string (< end beg) yank-handler)
+            (kill-new string nil yank-handler)))
+        (when (or string (eq last-command 'kill-region))
+          (setq this-command 'kill-region))
+        nil)
+    ((buffer-read-only text-read-only)
+     ;; The code above failed because the buffer, or some of the characters
+     ;; in the region, are read-only.
+     ;; We should beep, in case the user just isn't aware of this.
+     ;; However, there's no harm in putting
+     ;; the region's text in the kill ring, anyway.
+     (copy-region-as-kill beg end)
+     ;; Set this-command now, so it will be set even if we get an error.
+     (setq this-command 'kill-region)
+     ;; This should barf, if appropriate, and give us the correct error.
+     (if kill-read-only-ok
+         (progn (message "Read only text copied to kill ring") nil)
+       ;; Signal an error if the buffer is read-only.
+       (barf-if-buffer-read-only)
+       ;; If the buffer isn't read-only, the text is.
+       (signal 'text-read-only (list (current-buffer)))))))
+@end ignore
+
+The Emacs 22 version of that function uses @code{condition-case} and
 @code{copy-region-as-kill}, both of which we will explain.
 @code{condition-case} is an important special form.
 
@@ -7549,7 +8075,7 @@ contains the code that is called in the event of an error.
 @menu
 * Complete kill-region::        The function definition.
 * condition-case::              Dealing with a problem.
-* delete-and-extract-region::   Doing the work.
+* Lisp macro::
 @end menu
 
 @node Complete kill-region, condition-case, kill-region, kill-region
@@ -7559,10 +8085,116 @@ contains the code that is called in the event of an error.
 
 @need 1200
 We will go through the @code{condition-case} code in a moment.  First,
-let us look at the original definition of @code{kill-region}, with
-comments added (the newer definition has an optional third argument
-and is more complex):
+let us look at the definition of @code{kill-region}, with comments
+added:
+
+@c GNU Emacs 22:
+@smallexample
+@group
+(defun kill-region (beg end)
+  "Kill (\"cut\") text between point and mark.
+This deletes the text from the buffer and saves it in the kill ring.
+The command \\[yank] can retrieve it from there. @dots{} "
+@end group
+
+@group
+  ;; @bullet{} Since order matters, pass point first.
+  (interactive (list (point) (mark)))
+  ;; @bullet{} And tell us if we cannot cut the text.
+  ;; `unless' is an `if' without a then-part.
+  (unless (and beg end)
+    (error "The mark is not set now, so there is no region"))
+@end group
+
+@group
+  ;; @bullet{} `condition-case' takes three arguments.
+  ;;    If the first argument is nil, as it is here,
+  ;;    information about the error signal is not
+  ;;    stored for use by another function.
+  (condition-case nil
+@end group
+
+@group
+      ;; @bullet{} The second argument to `condition-case' tells the
+      ;;    Lisp interpreter what to do when all goes well.
+@end group
+
+@group
+      ;;    It starts with a `let' function that extracts the string
+      ;;    and tests whether it exists.  If so (that is what the
+      ;;    `when' checks), it calls an `if' function that determines
+      ;;    whether the previous command was another call to
+      ;;    `kill-region'; if it was, then the new text is appended to
+      ;;    the previous text; if not, then a different function,
+      ;;    `kill-new', is called.
+@end group
+
+@group
+      ;;    The `kill-append' function concatenates the new string and
+      ;;    the old.  The `kill-new' function inserts text into a new
+      ;;    item in the kill ring.
+@end group
+
+@group
+      ;;    `when' is an `if' without an else-part.  The second `when'
+      ;;    again checks whether the current string exists; in
+      ;;    addition, it checks whether the previous command was
+      ;;    another call to `kill-region'.  If one or the other
+      ;;    condition is true, then it sets the current command to
+      ;;    be `kill-region'.
+@end group
+@group
+      (let ((string (filter-buffer-substring beg end t)))
+        (when string                    ;STRING is nil if BEG = END
+          ;; Add that string to the kill ring, one way or another.
+          (if (eq last-command 'kill-region)
+@end group
+@group
+              ;;    @minus{} `yank-handler' is an optional argument to
+              ;;    `kill-region' that tells the `kill-append' and
+              ;;    `kill-new' functions how deal with properties
+              ;;    added to the text, such as `bold' or `italics'.
+              (kill-append string (< end beg) yank-handler)
+            (kill-new string nil yank-handler)))
+        (when (or string (eq last-command 'kill-region))
+          (setq this-command 'kill-region))
+        nil)
+@end group
+
+@group
+    ;;  @bullet{} The third argument to `condition-case' tells the interpreter
+    ;;    what to do with an error.
+@end group
+@group
+    ;;    The third argument has a conditions part and a body part.
+    ;;    If the conditions are met (in this case,
+    ;;             if text or buffer are read-only)
+    ;;    then the body is executed.
+@end group
+@group
+    ;;    The first part of the third argument is the following:
+    ((buffer-read-only text-read-only) ;; the if-part
+     ;; @dots{}  the then-part
+     (copy-region-as-kill beg end)
+@end group
+@group
+     ;;    Next, also as part of the then-part, set this-command, so
+     ;;    it will be set in an error
+     (setq this-command 'kill-region)
+     ;;    Finally, in the then-part, send a message if you may copy
+     ;;    the text to the kill ring without signally an error, but
+     ;;    don't if you may not.
+@end group
+@group
+     (if kill-read-only-ok
+         (progn (message "Read only text copied to kill ring") nil)
+       (barf-if-buffer-read-only)
+       ;; If the buffer isn't read-only, the text is.
+       (signal 'text-read-only (list (current-buffer)))))
+@end group
+@end smallexample
 
+@ignore
 @c v 21
 @smallexample
 @group
@@ -7615,7 +8247,7 @@ The text is deleted but saved in the kill ring."
 @group
     ;;    The third argument has a conditions part and a body part.
     ;;    If the conditions are met (in this case,
-    ;;             if text or buffer is read-only)
+    ;;             if text or buffer are read-only)
     ;;    then the body is executed.
 @end group
 @group
@@ -7632,8 +8264,9 @@ The text is deleted but saved in the kill ring."
        (signal 'text-read-only (list (current-buffer)))))))
 @end group
 @end smallexample
+@end ignore
 
-@node condition-case, delete-and-extract-region, Complete kill-region, kill-region
+@node condition-case, Lisp macro, Complete kill-region, kill-region
 @comment  node-name,  next,  previous,  up
 @subsection @code{condition-case}
 @findex condition-case
@@ -7707,87 +8340,75 @@ In brief, in the @code{kill-region} function, the code
 @end group
 @end smallexample
 
-@node delete-and-extract-region,  , condition-case, kill-region
-@comment  node-name,  next,  previous,  up
-@subsection @code{delete-and-extract-region}
-@findex delete-and-extract-region
-
-A @code{condition-case} expression has two parts, a part that is
-evaluated in the expectation that all will go well, but which may
-generate an error; and a part that is evaluated when there is an
-error.
-
-First, let us look at the code in @code{kill-region} that is run in
-the expectation that all goes well.  This is the core of the function.
-The code looks like this:
-
-@smallexample
-@group
-(let ((string (delete-and-extract-region beg end)))
-  (when string
-    (if (eq last-command 'kill-region)
-        (kill-append string (< end beg))
-      (kill-new string)))
-  (setq this-command 'kill-region))
-@end group
-@end smallexample
-
-It looks complicated because we have the new functions
-@code{delete-and-extract-region}, @code{kill-append}, and
-@code{kill-new} as well as the new variables,
-@code{last-command} and @code{this-command}.
-
-The @code{delete-and-extract-region} function is straightforward.  It
-is a built-in function that deletes the text in a region (a side
-effect) and also returns that text.  This is the function that
-actually removes the text.  (And if it cannot do that, it signals the
-error.)
+@ignore
+2006 Oct 24
+In Emacs 22,
+copy-region-as-kill is short, 12 lines, and uses
+filter-buffer-substring, which is longer, 39 lines
+and has delete-and-extract-region in it.
+delete-and-extract-region is written in C.
+
+see Initializing a Variable with @code{defvar}
+this is line 8054
+Initializing a Variable with @code{defvar} includes line 8350
+@end ignore
 
-In this @code{let} expression, the text that
-@code{delete-and-extract-region} returns is placed in the local
-variable called @samp{string}.  This is the text that is removed from
-the buffer.  (To be more precise, the variable is set to point to the
-address of the extracted text; to say it is `placed in' the variable
-is simply a shorthand.)
+@node Lisp macro,  , condition-case, kill-region
+@comment  node-name,  next,  previous,  up
+@subsection Lisp macro
+@cindex Macro, lisp
+@cindex Lisp macro
 
-If the variable @samp{string} does point to text, that text is added
-to the kill ring.  The variable will have a @code{nil} value if no
-text was removed.
+The part of the @code{condition-case} expression that is evaluated in
+the expectation that all goes well has a @code{when}.  The code uses
+@code{when} to determine whether the @code{string} variable points to
+text that exists.
 
-The code uses @code{when} to determine whether the variable
-@samp{string} points to text.  A @code{when} statement is simply a
-programmers' convenience.  A @code{when} statement is an @code{if}
-statement without the possibility of an else clause.  In your mind, you
-can replace @code{when} with @code{if} and understand what goes on.
-That is what the Lisp interpreter does.
+A @code{when} expression is simply a programmers' convenience.  It is
+an @code{if} without the possibility of an else clause.  In your mind,
+you can replace @code{when} with @code{if} and understand what goes
+on.  That is what the Lisp interpreter does.
 
-@cindex Macro, lisp
-@cindex Lisp macro
 Technically speaking, @code{when} is a Lisp macro.  A Lisp @dfn{macro}
 enables you to define new control constructs and other language
 features.  It tells the interpreter how to compute another Lisp
 expression which will in turn compute the value.  In this case, the
-`other expression' is an @code{if} expression.  For more about Lisp
-macros, see @ref{Macros, , Macros, elisp, The GNU Emacs Lisp Reference
-Manual}.  The C programming language also provides macros.  These are
-different, but also useful.  We will briefly look at C macros in
+`other expression' is an @code{if} expression.
+
+The @code{kill-region} function definition also has an @code{unless}
+macro; it is the converse of @code{when}.  The @code{unless} macro is
+an @code{if} without a then clause
+
+For more about Lisp macros, see @ref{Macros, , Macros, elisp, The GNU
+Emacs Lisp Reference Manual}.  The C programming language also
+provides macros.  These are different, but also useful.
+
+@ignore
+We will briefly look at C macros in
 @ref{Digression into C}.
+@end ignore
 
 @need 1200
-If the string has content, then another conditional expression is
-executed.  This is an @code{if} with both a then-part and an else-part.
+Regarding the @code{when} macro, in the @code{condition-case}
+expression, when the string has content, then another conditional
+expression is executed.  This is an @code{if} with both a then-part
+and an else-part.
 
 @smallexample
 @group
 (if (eq last-command 'kill-region)
-    (kill-append string (< end beg))
-  (kill-new string)))
+    (kill-append string (< end beg) yank-handler)
+  (kill-new string nil yank-handler))
 @end group
 @end smallexample
 
 The then-part is evaluated if the previous command was another call to
 @code{kill-region}; if not, the else-part is evaluated.
 
+@code{yank-handler} is an optional argument to @code{kill-region} that
+tells the @code{kill-append} and @code{kill-new} functions how deal
+with properties added to the text, such as `bold' or `italics'.
+
 @code{last-command} is a variable that comes with Emacs that we have
 not seen before.  Normally, whenever a function is executed, Emacs
 sets the value of @code{last-command} to the previous command.
@@ -7797,396 +8418,87 @@ In this segment of the definition, the @code{if} expression checks
 whether the previous command was @code{kill-region}.  If it was,
 
 @smallexample
-(kill-append string (< end beg))
+(kill-append string (< end beg) yank-handler)
 @end smallexample
 
 @noindent
 concatenates a copy of the newly clipped text to the just previously
-clipped text in the kill ring.  (If the @w{@code{(< end beg))}}
-expression is true, @code{kill-append} prepends the string to the just
-previously clipped text.  For a detailed discussion, see
-@ref{kill-append function, , The @code{kill-append} function}.)
+clipped text in the kill ring.
 
-If you then yank back the text, i.e., `paste' it, you get both
-pieces of text at once.  That way, if you delete two words in a row,
-and then yank them back, you get both words, in their proper order,
-with one yank.  (The @w{@code{(< end beg))}} expression makes sure the
-order is correct.)
-
-On the other hand, if the previous command is not @code{kill-region},
-then the @code{kill-new} function is called, which adds the text to
-the kill ring as the latest item, and sets the
-@code{kill-ring-yank-pointer} variable to point to it.
-
-@node Digression into C, defvar, kill-region, Cutting & Storing Text
+@node copy-region-as-kill, Digression into C, kill-region, Cutting & Storing Text
 @comment  node-name,  next,  previous,  up
-@section Digression into C
-@findex delete-and-extract-region
-@cindex C, a digression into
-@cindex Digression into C
+@section @code{copy-region-as-kill}
+@findex copy-region-as-kill
+@findex nthcdr
 
-The @code{zap-to-char} command uses the
-@code{delete-and-extract-region} function, which in turn uses two
-other functions, @code{copy-region-as-kill} and
-@code{del_range_1}.  The @code{copy-region-as-kill} function will be
-described in a following section; it puts a copy of the region in the
-kill ring so it can be yanked back.  (@xref{copy-region-as-kill, ,
-@code{copy-region-as-kill}}.)
+The @code{copy-region-as-kill} function copies a region of text from a
+buffer and (via either @code{kill-append} or @code{kill-new}) saves it
+in the @code{kill-ring}.
 
-The @code{delete-and-extract-region} function removes the contents of
-a region and you cannot get them back.
+If you call @code{copy-region-as-kill} immediately after a
+@code{kill-region} command, Emacs appends the newly copied text to the
+previously copied text.  This means that if you yank back the text, you
+get it all, from both this and the previous operation.  On the other
+hand, if some other command precedes the @code{copy-region-as-kill},
+the function copies the text into a separate entry in the kill ring.
 
-Unlike the other code discussed here, @code{delete-and-extract-region}
-is not written in Emacs Lisp; it is written in C and is one of the
-primitives of the GNU Emacs system.  Since it is very simple, I will
-digress briefly from Lisp and describe it here.
+@menu
+* Complete copy-region-as-kill::  The complete function definition.
+* copy-region-as-kill body::      The body of @code{copy-region-as-kill}.
+@end menu
 
-@need 1500
-Like many of the other Emacs primitives,
-@code{delete-and-extract-region} is written as an instance of a C
-macro, a macro being a template for code.  The complete macro looks
-like this:
+@node Complete copy-region-as-kill, copy-region-as-kill body, copy-region-as-kill, copy-region-as-kill
+@ifnottex
+@unnumberedsubsec The complete @code{copy-region-as-kill} function definition
+@end ifnottex
+
+@need 1200
+Here is the complete text of the version 22 @code{copy-region-as-kill}
+function:
 
-@c /usr/local/src/emacs/src/editfns.c
 @smallexample
 @group
-DEFUN ("delete-and-extract-region", Fdelete_and_extract_region,
-       Sdelete_and_extract_region, 2, 2, 0,
-  "Delete the text between START and END and return it.")
-  (start, end)
-     Lisp_Object start, end;
-@{
-  validate_region (&start, &end);
-  return del_range_1 (XINT (start), XINT (end), 1, 1);
-@}
+(defun copy-region-as-kill (beg end)
+  "Save the region as if killed, but don't kill it.
+In Transient Mark mode, deactivate the mark.
+If `interprogram-cut-function' is non-nil, also save the text for a window
+system cut and paste."
+  (interactive "r")
+@end group
+@group
+  (if (eq last-command 'kill-region)
+      (kill-append (filter-buffer-substring beg end) (< end beg))
+    (kill-new (filter-buffer-substring beg end)))
+@end group
+@group
+  (if transient-mark-mode
+      (setq deactivate-mark t))
+  nil)
 @end group
 @end smallexample
 
-Without going into the details of the macro writing process, let me
-point out that this macro starts with the word @code{DEFUN}.  The word
-@code{DEFUN} was chosen since the code serves the same purpose as
-@code{defun} does in Lisp.  The word @code{DEFUN} is followed by seven
-parts inside of parentheses:
-
-@itemize @bullet
-@item
-The first part is the name given to the function in Lisp,
-@code{delete-and-extract-region}.
+@need 800
+As usual, this function can be divided into its component parts:
 
-@item
-The second part is the name of the function in C,
-@code{Fdelete_and_extract_region}.  By convention, it starts with
-@samp{F}.  Since C does not use hyphens in names, underscores are used
-instead.
+@smallexample
+@group
+(defun copy-region-as-kill (@var{argument-list})
+  "@var{documentation}@dots{}"
+  (interactive "r")
+  @var{body}@dots{})
+@end group
+@end smallexample
 
-@item
-The third part is the name for the C constant structure that records
-information on this function for internal use.  It is the name of the
-function in C but begins with an @samp{S} instead of an @samp{F}.
+The arguments are @code{beg} and @code{end} and the function is
+interactive with @code{"r"}, so the two arguments must refer to the
+beginning and end of the region.  If you have been reading though this
+document from the beginning, understanding these parts of a function is
+almost becoming routine.
 
-@item
-The fourth and fifth parts specify the minimum and maximum number of
-arguments the function can have.  This function demands exactly 2
-arguments.
-
-@item
-The sixth part is nearly like the argument that follows the
-@code{interactive} declaration in a function written in Lisp: a letter
-followed, perhaps, by a prompt.  The only difference from the Lisp is
-when the macro is called with no arguments.  Then you write a @code{0}
-(which is a `null string'), as in this macro.
-
-If you were to specify arguments, you would place them between
-quotation marks.  The C macro for @code{goto-char} includes
-@code{"NGoto char: "} in this position to indicate that the function
-expects a raw prefix, in this case, a numerical location in a buffer,
-and provides a prompt.
-
-@item
-The seventh part is a documentation string, just like the one for a
-function written in Emacs Lisp, except that every newline must be
-written explicitly as @samp{\n} followed by a backslash and carriage
-return.
-
-@need 1000
-Thus, the first two lines of documentation for  @code{goto-char} are
-written like this:
-
-@smallexample
-@group
-  "Set point to POSITION, a number or marker.\n\
-Beginning of buffer is position (point-min), end is (point-max).
-@end group
-@end smallexample
-@end itemize
-
-@need 1200
-In a C macro, the formal parameters come next, with a statement of
-what kind of object they are, followed by what might be called the `body'
-of the macro.  For @code{delete-and-extract-region} the `body'
-consists of the following two lines:
-
-@smallexample
-@group
-validate_region (&start, &end);
-return del_range_1 (XINT (start), XINT (end), 1, 1);
-@end group
-@end smallexample
-
-The first function, @code{validate_region} checks whether the values
-passed as the beginning and end of the region are the proper type and
-are within range.  The second function, @code{del_range_1}, actually
-deletes the text.
-
-@code{del_range_1} is a complex function we will not look into.  It
-updates the buffer and does other things.
-
-However, it is worth looking at the two arguments passed to
-@code{del_range}.  These are @w{@code{XINT (start)}} and @w{@code{XINT
-(end)}}.
-
-As far as the C language is concerned, @code{start} and @code{end} are
-two integers that mark the beginning and end of the region to be
-deleted@footnote{More precisely, and requiring more expert knowledge
-to understand, the two integers are of type `Lisp_Object', which can
-also be a C union instead of an integer type.}.
-
-In early versions of Emacs, these two numbers were thirty-two bits
-long, but the code is slowly being generalized to handle other
-lengths.  Three of the available bits are used to specify the type of
-information and a fourth bit is used for handling the computer's
-memory; the remaining bits are used as `content'.
-
-@samp{XINT} is a C macro that extracts the relevant number from the
-longer collection of bits; the four other bits are discarded.
-
-@need 800
-The command in @code{delete-and-extract-region} looks like this:
-
-@smallexample
-del_range_1 (XINT (start), XINT (end), 1, 1);
-@end smallexample
-
-@noindent
-It deletes the region between the beginning position, @code{start},
-and the ending position, @code{end}.
-
-From the point of view of the person writing Lisp, Emacs is all very
-simple; but hidden underneath is a great deal of complexity to make it
-all work.
-
-@node defvar, copy-region-as-kill, Digression into C, Cutting & Storing Text
-@comment  node-name,  next,  previous,  up
-@section Initializing a Variable with @code{defvar}
-@findex defvar
-@cindex Initializing a variable
-@cindex Variable initialization
-
-Unlike the @code{delete-and-extract-region} function, the
-@code{copy-region-as-kill} function is written in Emacs Lisp.  Two
-functions within it, @code{kill-append} and @code{kill-new}, copy a
-region in a buffer and save it in a variable called the
-@code{kill-ring}.  This section describes how the @code{kill-ring}
-variable is created and initialized using the @code{defvar} special
-form.
-
-(Again we note that the term @code{kill-ring} is a misnomer.  The text
-that is clipped out of the buffer can be brought back; it is not a ring
-of corpses, but a ring of resurrectable text.)
-
-In Emacs Lisp, a variable such as the @code{kill-ring} is created and
-given an initial value by using the @code{defvar} special form.  The
-name comes from ``define variable''.
-
-The @code{defvar} special form is similar to @code{setq} in that it sets
-the value of a variable.  It is unlike @code{setq} in two ways: first,
-it only sets the value of the variable if the variable does not already
-have a value.  If the variable already has a value, @code{defvar} does
-not override the existing value.  Second, @code{defvar} has a
-documentation string.
-
-(Another special form, @code{defcustom}, is designed for variables
-that people customize.  It has more features than @code{defvar}.
-(@xref{defcustom, , Setting Variables with @code{defcustom}}.)
-
-@menu
-* See variable current value::
-* defvar and asterisk::         An old-time convention.
-@end menu
-
-@node See variable current value, defvar and asterisk, defvar, defvar
-@ifnottex
-@unnumberedsubsec Seeing the Current Value of a Variable
-@end ifnottex
-
-You can see the current value of a variable, any variable, by using
-the @code{describe-variable} function, which is usually invoked by
-typing @kbd{C-h v}.  If you type @kbd{C-h v} and then @code{kill-ring}
-(followed by @key{RET}) when prompted, you will see what is in your
-current kill ring---this may be quite a lot!  Conversely, if you have
-been doing nothing this Emacs session except read this document, you
-may have nothing in it.  Also, you will see the documentation for
-@code{kill-ring}:
-
-@smallexample
-@group
-Documentation:
-List of killed text sequences.
-Since the kill ring is supposed to interact nicely with cut-and-paste
-facilities offered by window systems, use of this variable should
-@end group
-@group
-interact nicely with `interprogram-cut-function' and
-`interprogram-paste-function'.  The functions `kill-new',
-`kill-append', and `current-kill' are supposed to implement this
-interaction; you may want to use them instead of manipulating the kill
-ring directly.
-@end group
-@end smallexample
-
-@need 800
-The kill ring is defined by a @code{defvar} in the following way:
-
-@smallexample
-@group
-(defvar kill-ring nil
-  "List of killed text sequences.
-@dots{}")
-@end group
-@end smallexample
-
-@noindent
-In this variable definition, the variable is given an initial value of
-@code{nil}, which makes sense, since if you have saved nothing, you want
-nothing back if you give a @code{yank} command.  The documentation
-string is written just like the documentation string of a @code{defun}.
-As with the documentation string of the @code{defun}, the first line of
-the documentation should be a complete sentence, since some commands,
-like @code{apropos}, print only the first line of documentation.
-Succeeding lines should not be indented; otherwise they look odd when
-you use @kbd{C-h v} (@code{describe-variable}).
-
-@node defvar and asterisk,  , See variable current value, defvar
-@subsection @code{defvar} and an asterisk
-@findex defvar @r{for a user customizable variable}
-@findex defvar @r{with an asterisk}
-
-In the past, Emacs used the @code{defvar} special form both for
-internal variables that you would not expect a user to change and for
-variables that you do expect a user to change.  Although you can still
-use @code{defvar} for user customizable variables, please use
-@code{defcustom} instead, since that special form provides a path into
-the Customization commands.  (@xref{defcustom, , Specifying Variables
-using @code{defcustom}}.)
-
-When you specified a variable using the @code{defvar} special form,
-you could distinguish a readily settable variable from others by
-typing an asterisk, @samp{*}, in the first column of its documentation
-string.  For example:
-
-@smallexample
-@group
-(defvar shell-command-default-error-buffer nil
-  "*Buffer name for `shell-command' @dots{} error output.
-@dots{} ")
-@end group
-@end smallexample
-
-@findex set-variable
-@noindent
-You could (and still can) use the @code{set-variable} command to
-change the value of @code{shell-command-default-error-buffer}
-temporarily.  However, options set using @code{set-variable} are set
-only for the duration of your editing session.  The new values are not
-saved between sessions.  Each time Emacs starts, it reads the original
-value, unless you change the value within your @file{.emacs} file,
-either by setting it manually or by using @code{customize}.
-@xref{Emacs Initialization, , Your @file{.emacs} File}.
-
-For me, the major use of the @code{set-variable} command is to suggest
-variables that I might want to set in my @file{.emacs} file.  There
-are now more than 700 such variables --- far too many to remember
-readily.  Fortunately, you can press @key{TAB} after calling the
-@code{M-x set-variable} command to see the list of variables.
-(@xref{Examining, , Examining and Setting Variables, emacs,
-The GNU Emacs Manual}.)
-
-@node copy-region-as-kill, cons & search-fwd Review, defvar, Cutting & Storing Text
-@comment  node-name,  next,  previous,  up
-@section @code{copy-region-as-kill}
-@findex copy-region-as-kill
-@findex nthcdr
-
-The @code{copy-region-as-kill} function copies a region of text from a
-buffer and (via either @code{kill-append} or @code{kill-new}) saves it
-in the @code{kill-ring}.
-
-If you call @code{copy-region-as-kill} immediately after a
-@code{kill-region} command, Emacs appends the newly copied text to the
-previously copied text.  This means that if you yank back the text, you
-get it all, from both this and the previous operation.  On the other
-hand, if some other command precedes the @code{copy-region-as-kill},
-the function copies the text into a separate entry in the kill ring.
-
-@menu
-* Complete copy-region-as-kill::  The complete function definition.
-* copy-region-as-kill body::    The body of @code{copy-region-as-kill}.
-@end menu
-
-@node Complete copy-region-as-kill, copy-region-as-kill body, copy-region-as-kill, copy-region-as-kill
-@ifnottex
-@unnumberedsubsec The complete @code{copy-region-as-kill} function definition
-@end ifnottex
-
-@need 1200
-Here is the complete text of the version 21 @code{copy-region-as-kill}
-function:
-
-@c !!! for no text properties, use buffer-substring-no-properties
-
-@smallexample
-@group
-(defun copy-region-as-kill (beg end)
-  "Save the region as if killed, but don't kill it.
-In Transient Mark mode, deactivate the mark.
-If `interprogram-cut-function' is non-nil, also save
-the text for a window system cut and paste."
-  (interactive "r")
-@end group
-@group
-  (if (eq last-command 'kill-region)
-      (kill-append (buffer-substring beg end) (< end beg))
-    (kill-new (buffer-substring beg end)))
-@end group
-@group
-  (if transient-mark-mode
-      (setq deactivate-mark t))
-  nil)
-@end group
-@end smallexample
-
-@need 800
-As usual, this function can be divided into its component parts:
-
-@smallexample
-@group
-(defun copy-region-as-kill (@var{argument-list})
-  "@var{documentation}@dots{}"
-  (interactive "r")
-  @var{body}@dots{})
-@end group
-@end smallexample
-
-The arguments are @code{beg} and @code{end} and the function is
-interactive with @code{"r"}, so the two arguments must refer to the
-beginning and end of the region.  If you have been reading though this
-document from the beginning, understanding these parts of a function is
-almost becoming routine.
-
-The documentation is somewhat confusing unless you remember that the
-word `kill' has a meaning different from its usual meaning.  The
-`Transient Mark' and @code{interprogram-cut-function} comments explain
-certain side-effects.
+The documentation is somewhat confusing unless you remember that the
+word `kill' has a meaning different from usual.  The `Transient Mark'
+and @code{interprogram-cut-function} comments explain certain
+side-effects.
 
 After you once set a mark, a buffer always contains a region.  If you
 wish, you can use Transient Mark mode to highlight the region
@@ -8219,14 +8531,14 @@ The body of @code{copy-region-as-kill} merits discussion in detail.
 @subsection The Body of @code{copy-region-as-kill}
 
 The @code{copy-region-as-kill} function works in much the same way as
-the @code{kill-region} function (@pxref{kill-region,
-,@code{kill-region}}).  Both are written so that two or more kills in
-a row combine their text into a single entry.  If you yank back the
-text from the kill ring, you get it all in one piece.  Moreover, kills
-that kill forward from the current position of the cursor are added to
-the end of the previously copied text and commands that copy text
-backwards add it to the beginning of the previously copied text.  This
-way, the words in the text stay in the proper order.
+the @code{kill-region} function.  Both are written so that two or more
+kills in a row combine their text into a single entry.  If you yank
+back the text from the kill ring, you get it all in one piece.
+Moreover, kills that kill forward from the current position of the
+cursor are added to the end of the previously copied text and commands
+that copy text backwards add it to the beginning of the previously
+copied text.  This way, the words in the text stay in the proper
+order.
 
 Like @code{kill-region}, the @code{copy-region-as-kill} function makes
 use of the @code{last-command} variable that keeps track of the
@@ -8261,19 +8573,26 @@ attaches a new element to the kill ring using the @code{kill-new}
 function.
 
 @need 1250
-The @code{if} expression reads as follows; it uses @code{eq}, which is
-a function we have not yet seen:
+The @code{if} expression reads as follows; it uses @code{eq}:
 
 @smallexample
 @group
   (if (eq last-command 'kill-region)
       ;; @r{then-part}
-      (kill-append (buffer-substring beg end) (< end beg))
+      (kill-append  (filter-buffer-substring beg end) (< end beg))
     ;; @r{else-part}
-    (kill-new (buffer-substring beg end)))
+    (kill-new  (filter-buffer-substring beg end)))
 @end group
 @end smallexample
 
+@findex filter-buffer-substring
+(The @code{filter-buffer-substring} function returns a filtered
+substring of the buffer, if any.  Optionally---the arguments are not
+here, so neither is done---the function may delete the initial text or
+return the text without its properties; this function is a replacement
+for the older @code{buffer-substring} function, which came before text
+properties were implemented.)
+
 @findex eq @r{(example of use)}
 @noindent
 The @code{eq} function tests whether its first argument is the same Lisp
@@ -8294,8 +8613,24 @@ interpreter calls the @code{kill-append} function
 @need 800
 The @code{kill-append} function looks like this:
 
+@c in GNU Emacs 22
 @smallexample
 @group
+(defun kill-append (string before-p &optional yank-handler)
+  "Append STRING to the end of the latest kill in the kill ring.
+If BEFORE-P is non-nil, prepend STRING to the kill.
+@dots{} "
+  (let* ((cur (car kill-ring)))
+    (kill-new (if before-p (concat string cur) (concat cur string))
+              (or (= (length cur) 0)
+                  (equal yank-handler
+                         (get-text-property 0 'yank-handler cur)))
+              yank-handler)))
+@end group
+@end smallexample
+
+@ignore
+was:
 (defun kill-append (string before-p)
   "Append STRING to the end of the latest kill in the kill ring.
 If BEFORE-P is non-nil, prepend STRING to the kill.
@@ -8305,24 +8640,34 @@ it."
                 (concat string (car kill-ring))
               (concat (car kill-ring) string))
             t))
-@end group
-@end smallexample
+@end ignore
 
 @noindent
 The @code{kill-append} function is fairly straightforward.  It uses
 the @code{kill-new} function, which we will discuss in more detail in
 a moment.
 
-First, let us look at the conditional that is one of the two arguments
-to @code{kill-new}.  It uses @code{concat} to concatenate the new text
-to the @sc{car} of the kill ring.  Whether it prepends or appends the
+(Also, the function provides an optional argument called
+@code{yank-handler}; when invoked, this argument tells the function
+how to deal with properties added to the text, such as `bold' or
+`italics'.)
+
+@c !!! bug in GNU Emacs 22 version of  kill-append ?
+It has a @code{let*} function to set the value of the first element of
+the kill ring to @code{cur}.  (I do not know why the function does not
+use @code{let} instead; only one value is set in the expression.
+Perhaps this is a bug that produces no problems?)
+
+Consider the conditional that is one of the two arguments to
+@code{kill-new}.  It uses @code{concat} to concatenate the new text to
+the @sc{car} of the kill ring.  Whether it prepends or appends the
 text depends on the results of an @code{if} expression:
 
 @smallexample
 @group
 (if before-p                            ; @r{if-part}
-    (concat string (car kill-ring))     ; @r{then-part}
-  (concat (car kill-ring) string))      ; @r{else-part}
+    (concat string cur)                 ; @r{then-part}
+  (concat cur string))                  ; @r{else-part}
 @end group
 @end smallexample
 
@@ -8355,7 +8700,7 @@ When the newly saved text will be prepended, then the string with the new
 text will be concatenated before the old text:
 
 @smallexample
-(concat string (car kill-ring))
+(concat string cur)
 @end smallexample
 
 @need 1200
@@ -8364,7 +8709,7 @@ But if the text will be appended, it will be concatenated
 after the old text:
 
 @smallexample
-(concat (car kill-ring) string))
+(concat cur string))
 @end smallexample
 
 To understand how this works, we first need to review the
@@ -8397,26 +8742,49 @@ function which in turn uses the @code{setcar} function.
 @unnumberedsubsubsec The @code{kill-new} function
 @findex kill-new
 
+@c in GNU Emacs 22, additional documentation to kill-new:
+@ignore
+Optional third arguments YANK-HANDLER controls how the STRING is later
+inserted into a buffer; see `insert-for-yank' for details.
+When a yank handler is specified, STRING must be non-empty (the yank
+handler, if non-nil, is stored as a `yank-handler' text property on STRING).
+
+When the yank handler has a non-nil PARAM element, the original STRING
+argument is not used by `insert-for-yank'.  However, since Lisp code
+may access and use elements from the kill ring directly, the STRING
+argument should still be a \"useful\" string for such uses."
+@end ignore
 @need 1200
 The @code{kill-new} function looks like this:
 
 @smallexample
 @group
-(defun kill-new (string &optional replace)
+(defun kill-new (string &optional replace yank-handler)
   "Make STRING the latest kill in the kill ring.
-Set the kill-ring-yank pointer to point to it.
+Set `kill-ring-yank-pointer' to point to it.
+
 If `interprogram-cut-function' is non-nil, apply it to STRING.
 Optional second argument REPLACE non-nil means that STRING will replace
-the front of the kill ring, rather than being added to the list."
+the front of the kill ring, rather than being added to the list.
+@dots{}"
 @end group
 @group
-  (and (fboundp 'menu-bar-update-yank-menu)
-       (menu-bar-update-yank-menu string (and replace (car kill-ring))))
+  (if (> (length string) 0)
+      (if yank-handler
+          (put-text-property 0 (length string)
+                             'yank-handler yank-handler string))
+    (if yank-handler
+        (signal 'args-out-of-range
+                (list string "yank-handler specified for empty string"))))
+@end group
+@group
+  (if (fboundp 'menu-bar-update-yank-menu)
+      (menu-bar-update-yank-menu string (and replace (car kill-ring))))
 @end group
 @group
   (if (and replace kill-ring)
       (setcar kill-ring string)
-    (setq kill-ring (cons string kill-ring))
+    (push string kill-ring)
     (if (> (length kill-ring) kill-ring-max)
         (setcdr (nthcdr (1- kill-ring-max) kill-ring) nil)))
 @end group
@@ -8426,9 +8794,34 @@ the front of the kill ring, rather than being added to the list."
       (funcall interprogram-cut-function string (not replace))))
 @end group
 @end smallexample
+@ignore
+was:
+(defun kill-new (string &optional replace)
+  "Make STRING the latest kill in the kill ring.
+Set the kill-ring-yank pointer to point to it.
+If `interprogram-cut-function' is non-nil, apply it to STRING.
+Optional second argument REPLACE non-nil means that STRING will replace
+the front of the kill ring, rather than being added to the list."
+  (and (fboundp 'menu-bar-update-yank-menu)
+       (menu-bar-update-yank-menu string (and replace (car kill-ring))))
+  (if (and replace kill-ring)
+      (setcar kill-ring string)
+    (setq kill-ring (cons string kill-ring))
+    (if (> (length kill-ring) kill-ring-max)
+        (setcdr (nthcdr (1- kill-ring-max) kill-ring) nil)))
+  (setq kill-ring-yank-pointer kill-ring)
+  (if interprogram-cut-function
+      (funcall interprogram-cut-function string (not replace))))
+@end ignore
+
+(Notice that the function is not interactive.)
 
 As usual, we can look at this function in parts.
 
+The function definition has an optional @code{yank-handler} argument,
+which when invoked tells the function how to deal with properties
+added to the text, such as `bold' or `italics'.  We will skip that.
+
 @need 1200
 The first line of the documentation makes sense:
 
@@ -8439,8 +8832,10 @@ Make STRING the latest kill in the kill ring.
 @noindent
 Let's skip over the rest of the documentation for the moment.
 
-Also, let's skip over the first two lines of code, those involving
-@code{menu-bar-update-yank-menu}.  We will explain them below.
+@noindent
+Also, let's skip over the initial @code{if} expression and those lines
+of code involving @code{menu-bar-update-yank-menu}.  We will explain
+them below.
 
 @need 1200
 The critical lines are these:
@@ -8453,6 +8848,9 @@ The critical lines are these:
 @end group
 @group
     ;; @r{else}
+  (push string kill-ring)
+@end group
+@group
     (setq kill-ring (cons string kill-ring))
     (if (> (length kill-ring) kill-ring-max)
         ;; @r{avoid overly long kill ring}
@@ -8470,8 +8868,8 @@ This will be true when two conditions are met:  the kill ring has
 something in it, and the @code{replace} variable is true.
 
 @need 1250
-The @code{kill-append} function sets @code{replace} to be true; then,
-when the kill ring has at least one item in it, the @code{setcar}
+When the @code{kill-append} function sets @code{replace} to be true
+and when the kill ring has at least one item in it, the @code{setcar}
 expression is executed:
 
 @smallexample
@@ -8482,31 +8880,48 @@ The @code{setcar} function actually changes the first element of the
 @code{kill-ring} list to the value of @code{string}.  It replaces the
 first element.
 
+@need 1250
 On the other hand, if the kill ring is empty, or replace is false, the
 else-part of the condition is executed:
 
 @smallexample
-@group
+(push string kill-ring)
+@end smallexample
+
+@noindent
+@need 1250
+@code{push} puts its first argument onto the second.  It is similar to
+the older
+
+@smallexample
 (setq kill-ring (cons string kill-ring))
-(if (> (length kill-ring) kill-ring-max)
-    (setcdr (nthcdr (1- kill-ring-max) kill-ring) nil))
-@end group
 @end smallexample
 
 @noindent
-This expression first constructs a new version of the kill ring by
-prepending @code{string} to the existing kill ring as a new element.
-Then it executes a second @code{if} clause.  This second @code{if}
-clause keeps the kill ring from growing too long.
+@need 1250
+or the newer
+
+@smallexample
+(add-to-list kill-ring string)
+@end smallexample
+
+@noindent
+When it is false, the expression first constructs a new version of the
+kill ring by prepending @code{string} to the existing kill ring as a
+new element (that is what the @code{push} does).  Then it executes a
+second @code{if} clause.  This second @code{if} clause keeps the kill
+ring from growing too long.
 
 Let's look at these two expressions in order.
 
-The @code{setq} line of the else-part sets the new value of the kill
-ring to what results from adding the string being killed to the old kill
-ring.
+The @code{push} line of the else-part sets the new value of the kill
+ring to what results from adding the string being killed to the old
+kill ring.
+
+We can see how this works with an example.
 
 @need 800
-We can see how this works with an example:
+First,
 
 @smallexample
 (setq example-list '("here is a clause" "another clause"))
@@ -8528,10 +8943,10 @@ example-list
 @noindent
 Now, we can add a new element on to this list by evaluating the
 following expression:
-@findex cons, @r{example}
+@findex push, @r{example}
 
 @smallexample
-(setq example-list (cons "a third clause" example-list))
+(push "a third clause" example-list)
 @end smallexample
 
 @need 800
@@ -8540,22 +8955,14 @@ When we evaluate @code{example-list}, we find its value is:
 
 @smallexample
 @group
-example-list
-     @result{} ("a third clause" "here is a clause" "another clause")
-@end group
-@end smallexample
-
-@noindent
-Thus, the third clause was added to the list by @code{cons}.
-
-@need 1200
-This is exactly similar to what the @code{setq} and @code{cons} do in
-the function.  Here is the line again:
-
-@smallexample
-(setq kill-ring (cons string kill-ring))
+example-list
+     @result{} ("a third clause" "here is a clause" "another clause")
+@end group
 @end smallexample
 
+@noindent
+Thus, the third clause is added to the list by @code{push}.
+
 @need 1200
 Now for the second part of the @code{if} clause.  This expression
 keeps the kill ring from growing too long.  It looks like this:
@@ -8587,13 +8994,15 @@ the last element of the kill ring.
 The @code{nthcdr} function works by repeatedly taking the @sc{cdr} of a
 list---it takes the @sc{cdr} of the @sc{cdr} of the @sc{cdr}
 @dots{}  It does this @var{N} times and returns the results.
+(@xref{nthcdr, , @code{nthcdr}}.)
 
 @findex setcdr, @r{example}
 Thus, if we had a four element list that was supposed to be three
 elements long, we could set the @sc{cdr} of the next to last element
-to @code{nil}, and thereby shorten the list.  (If you sent the last
+to @code{nil}, and thereby shorten the list.  (If you set the last
 element to some other value than @code{nil}, which you could do, then
-you would not have shortened the list.)
+you would not have shortened the list.  @xref{setcdr, ,
+@code{setcdr}}.)
 
 You can see shortening by evaluating the following three expressions
 in turn.  First set the value of @code{trees} to @code{(maple oak pine
@@ -8621,9 +9030,9 @@ that is what the @sc{cdr} is set to.)
 
 To repeat, in @code{kill-new}, the @code{nthcdr} function takes the
 @sc{cdr} a number of times that is one less than the maximum permitted
-size of the kill ring and sets the @sc{cdr} of that element (which
-will be the rest of the elements in the kill ring) to @code{nil}.
-This prevents the kill ring from growing too long.
+size of the kill ring and @code{setcdr} sets the @sc{cdr} of that
+element (which will be the rest of the elements in the kill ring) to
+@code{nil}.  This prevents the kill ring from growing too long.
 
 @need 800
 The next to last expression in the @code{kill-new} function is
@@ -8638,93 +9047,441 @@ the @code{kill-ring}.
 Even though the @code{kill-ring-yank-pointer} is called a
 @samp{pointer}, it is a variable just like the kill ring.  However, the
 name has been chosen to help humans understand how the variable is used.
-The variable is used in functions such as @code{yank} and
-@code{yank-pop} (@pxref{Yanking, , Yanking Text Back}).
 
-@need 1200
-Now, to return to the first two lines in the body of the function:
+@need 1200
+Now, to return to an early expression in the body of the function:
+
+@smallexample
+@group
+  (if (fboundp 'menu-bar-update-yank-menu)
+       (menu-bar-update-yank-menu string (and replace (car kill-ring))))
+@end group
+@end smallexample
+
+@noindent
+It starts with an @code{if} expression
+
+In this case, the expression tests first to see whether
+@code{menu-bar-update-yank-menu} exists as a function, and if so,
+calls it.  The @code{fboundp} function returns true if the symbol it
+is testing has a function definition that `is not void'.  If the
+symbol's function definition were void, we would receive an error
+message, as we did when we created errors intentionally (@pxref{Making
+Errors, , Generate an Error Message}).
+
+@noindent
+The then-part contains an expression whose first element is the
+function @code{and}.
+
+@findex and
+The @code{and} special form evaluates each of its arguments until one
+of the arguments returns a value of @code{nil}, in which case the
+@code{and} expression returns @code{nil}; however, if none of the
+arguments returns a value of @code{nil}, the value resulting from
+evaluating the last argument is returned.  (Since such a value is not
+@code{nil}, it is considered true in Emacs Lisp.)  In other words, an
+@code{and} expression returns a true value only if all its arguments
+are true.  (@xref{Second Buffer Related Review}.)
+
+The expression determines whether the second argument to
+@code{menu-bar-update-yank-menu} is true or not.
+@ignore
+    ;; If we're supposed to be extending an existing string, and that
+    ;; string really is at the front of the menu, then update it in place.
+@end ignore
+
+@code{menu-bar-update-yank-menu} is one of the functions that make it
+possible to use the `Select and Paste' menu in the Edit item of a menu
+bar; using a mouse, you can look at the various pieces of text you
+have saved and select one piece to paste.
+
+The last expression in the @code{kill-new} function adds the newly
+copied string to whatever facility exists for copying and pasting
+among different programs running in a windowing system.  In the X
+Windowing system, for example, the @code{x-select-text} function takes
+the string and stores it in memory operated by X.  You can paste the
+string in another program, such as an Xterm.
+
+@need 1200
+The expression looks like this:
+
+@smallexample
+@group
+  (if interprogram-cut-function
+      (funcall interprogram-cut-function string (not replace))))
+@end group
+@end smallexample
+
+If an @code{interprogram-cut-function} exists, then Emacs executes
+@code{funcall}, which in turn calls its first argument as a function
+and passes the remaining arguments to it.  (Incidentally, as far as I
+can see, this @code{if} expression could be replaced by an @code{and}
+expression similar to the one in the first part of the function.)
+
+We are not going to discuss windowing systems and other programs
+further, but merely note that this is a mechanism that enables GNU
+Emacs to work easily and well with other programs.
+
+This code for placing text in the kill ring, either concatenated with
+an existing element or as a new element, leads us to the code for
+bringing back text that has been cut out of the buffer---the yank
+commands.  However, before discussing the yank commands, it is better
+to learn how lists are implemented in a computer.  This will make
+clear such mysteries as the use of the term `pointer'.  But before
+that, we will digress into C.
+
+@ignore
+@c is this true in Emacs 22?   Does not seems to be
+
+  (If the @w{@code{(< end beg))}}
+expression is true, @code{kill-append} prepends the string to the just
+previously clipped text.  For a detailed discussion, see
+@ref{kill-append function, , The @code{kill-append} function}.)
+
+If you then yank back the text, i.e., `paste' it, you get both
+pieces of text at once.  That way, if you delete two words in a row,
+and then yank them back, you get both words, in their proper order,
+with one yank.  (The @w{@code{(< end beg))}} expression makes sure the
+order is correct.)
+
+On the other hand, if the previous command is not @code{kill-region},
+then the @code{kill-new} function is called, which adds the text to
+the kill ring as the latest item, and sets the
+@code{kill-ring-yank-pointer} variable to point to it.
+@end ignore
+@ignore
+
+@c Evidently, changed for Emacs 22. The zap-to-char command does not
+@c use the delete-and-extract-region function
+
+2006 Oct 26, the Digression into C is now OK but should come after
+copy-region-as-kill and filter-buffer-substring
+
+2006 Oct 24
+In Emacs 22,
+copy-region-as-kill is short, 12 lines, and uses
+filter-buffer-substring, which is longer, 39 lines
+and has delete-and-extract-region in it.
+delete-and-extract-region is written in C.
+
+see Initializing a Variable with @code{defvar}
+@end ignore
+
+@node Digression into C, defvar, copy-region-as-kill, Cutting & Storing Text
+@comment  node-name,  next,  previous,  up
+@section Digression into C
+@findex delete-and-extract-region
+@cindex C, a digression into
+@cindex Digression into C
+
+The @code{copy-region-as-kill} function (@pxref{copy-region-as-kill, ,
+@code{copy-region-as-kill}}) uses the @code{filter-buffer-substring}
+function, which in turn uses the @code{delete-and-extract-region}
+function.  It removes the contents of a region and you cannot get them
+back.
+
+Unlike the other code discussed here, the
+@code{delete-and-extract-region} function is not written in Emacs
+Lisp; it is written in C and is one of the primitives of the GNU Emacs
+system.  Since it is very simple, I will digress briefly from Lisp and
+describe it here.
+
+@c GNU Emacs 22  in /usr/local/src/emacs/src/editfns.c
+@c the DEFUN for  buffer-substring-no-properties
+
+@need 1500
+Like many of the other Emacs primitives,
+@code{delete-and-extract-region} is written as an instance of a C
+macro, a macro being a template for code.  The complete macro looks
+like this:
+
+@smallexample
+@group
+DEFUN ("buffer-substring-no-properties", Fbuffer_substring_no_properties,
+       Sbuffer_substring_no_properties, 2, 2, 0,
+       doc: /* Return the characters of part of the buffer,
+without the text properties.
+The two arguments START and END are character positions;
+they can be in either order.  */)
+     (start, end)
+     Lisp_Object start, end;
+@{
+  register int b, e;
+
+  validate_region (&start, &end);
+  b = XINT (start);
+  e = XINT (end);
+
+  return make_buffer_string (b, e, 0);
+@}
+@end group
+@end smallexample
+
+Without going into the details of the macro writing process, let me
+point out that this macro starts with the word @code{DEFUN}.  The word
+@code{DEFUN} was chosen since the code serves the same purpose as
+@code{defun} does in Lisp.  (The @code{DEFUN} C macro is defined in
+@file{emacs/src/lisp.h}.)
+
+The word @code{DEFUN} is followed by seven parts inside of
+parentheses:
+
+@itemize @bullet
+@item
+The first part is the name given to the function in Lisp,
+@code{delete-and-extract-region}.
+
+@item
+The second part is the name of the function in C,
+@code{Fdelete_and_extract_region}.  By convention, it starts with
+@samp{F}.  Since C does not use hyphens in names, underscores are used
+instead.
+
+@item
+The third part is the name for the C constant structure that records
+information on this function for internal use.  It is the name of the
+function in C but begins with an @samp{S} instead of an @samp{F}.
+
+@item
+The fourth and fifth parts specify the minimum and maximum number of
+arguments the function can have.  This function demands exactly 2
+arguments.
+
+@item
+The sixth part is nearly like the argument that follows the
+@code{interactive} declaration in a function written in Lisp: a letter
+followed, perhaps, by a prompt.  The only difference from the Lisp is
+when the macro is called with no arguments.  Then you write a @code{0}
+(which is a `null string'), as in this macro.
+
+If you were to specify arguments, you would place them between
+quotation marks.  The C macro for @code{goto-char} includes
+@code{"NGoto char: "} in this position to indicate that the function
+expects a raw prefix, in this case, a numerical location in a buffer,
+and provides a prompt.
+
+@item
+The seventh part is a documentation string, just like the one for a
+function written in Emacs Lisp, except that every newline must be
+written explicitly as @samp{\n} followed by a backslash and carriage
+return.
+
+@need 1000
+Thus, the first two lines of documentation for  @code{goto-char} are
+written like this:
+
+@smallexample
+@group
+  "Set point to POSITION, a number or marker.\n\
+Beginning of buffer is position (point-min), end is (point-max)."
+@end group
+@end smallexample
+@end itemize
+
+@need 1200
+In a C macro, the formal parameters come next, with a statement of
+what kind of object they are, followed by what might be called the `body'
+of the macro.  For @code{delete-and-extract-region} the `body'
+consists of the following four lines:
+
+@smallexample
+@group
+validate_region (&start, &end);
+if (XINT (start) == XINT (end))
+  return build_string ("");
+return del_range_1 (XINT (start), XINT (end), 1, 1);
+@end group
+@end smallexample
+
+The   @code{validate_region} function checks whether the values
+passed as the beginning and end of the region are the proper type and
+are within range.  If the beginning and end positions are the same,
+then return and empty string.
+
+The @code{del_range_1} function actually deletes the text.  It is a
+complex function we will not look into.  It updates the buffer and
+does other things.  However, it is worth looking at the two arguments
+passed to @code{del_range}.  These are @w{@code{XINT (start)}} and
+@w{@code{XINT (end)}}.
+
+As far as the C language is concerned, @code{start} and @code{end} are
+two integers that mark the beginning and end of the region to be
+deleted@footnote{More precisely, and requiring more expert knowledge
+to understand, the two integers are of type `Lisp_Object', which can
+also be a C union instead of an integer type.}.
+
+In early versions of Emacs, these two numbers were thirty-two bits
+long, but the code is slowly being generalized to handle other
+lengths.  Three of the available bits are used to specify the type of
+information; the remaining bits are used as `content'.
+
+@samp{XINT} is a C macro that extracts the relevant number from the
+longer collection of bits; the three other bits are discarded.
+
+@need 800
+The command in @code{delete-and-extract-region} looks like this:
+
+@smallexample
+del_range_1 (XINT (start), XINT (end), 1, 1);
+@end smallexample
+
+@noindent
+It deletes the region between the beginning position, @code{start},
+and the ending position, @code{end}.
+
+From the point of view of the person writing Lisp, Emacs is all very
+simple; but hidden underneath is a great deal of complexity to make it
+all work.
+
+@node defvar, cons & search-fwd Review, Digression into C, Cutting & Storing Text
+@comment  node-name,  next,  previous,  up
+@section Initializing a Variable with @code{defvar}
+@findex defvar
+@cindex Initializing a variable
+@cindex Variable initialization
+
+@ignore
+2006 Oct 24
+In Emacs 22,
+copy-region-as-kill is short, 12 lines, and uses
+filter-buffer-substring, which is longer, 39 lines
+and has delete-and-extract-region in it.
+delete-and-extract-region is written in C.
+
+see Initializing a Variable with @code{defvar}
+
+@end ignore
+
+The @code{copy-region-as-kill} function is written in Emacs Lisp.  Two
+functions within it, @code{kill-append} and @code{kill-new}, copy a
+region in a buffer and save it in a variable called the
+@code{kill-ring}.  This section describes how the @code{kill-ring}
+variable is created and initialized using the @code{defvar} special
+form.
+
+(Again we note that the term @code{kill-ring} is a misnomer.  The text
+that is clipped out of the buffer can be brought back; it is not a ring
+of corpses, but a ring of resurrectable text.)
+
+In Emacs Lisp, a variable such as the @code{kill-ring} is created and
+given an initial value by using the @code{defvar} special form.  The
+name comes from ``define variable''.
+
+The @code{defvar} special form is similar to @code{setq} in that it sets
+the value of a variable.  It is unlike @code{setq} in two ways: first,
+it only sets the value of the variable if the variable does not already
+have a value.  If the variable already has a value, @code{defvar} does
+not override the existing value.  Second, @code{defvar} has a
+documentation string.
+
+(Another special form, @code{defcustom}, is designed for variables
+that people customize.  It has more features than @code{defvar}.
+(@xref{defcustom, , Setting Variables with @code{defcustom}}.)
+
+@menu
+* See variable current value::
+* defvar and asterisk::
+@end menu
+
+@node See variable current value, defvar and asterisk, defvar, defvar
+@ifnottex
+@unnumberedsubsec Seeing the Current Value of a Variable
+@end ifnottex
+
+You can see the current value of a variable, any variable, by using
+the @code{describe-variable} function, which is usually invoked by
+typing @kbd{C-h v}.  If you type @kbd{C-h v} and then @code{kill-ring}
+(followed by @key{RET}) when prompted, you will see what is in your
+current kill ring---this may be quite a lot!  Conversely, if you have
+been doing nothing this Emacs session except read this document, you
+may have nothing in it.  Also, you will see the documentation for
+@code{kill-ring}:
 
 @smallexample
 @group
-  (and (fboundp 'menu-bar-update-yank-menu)
-       (menu-bar-update-yank-menu string (and replace (car kill-ring))))
+Documentation:
+List of killed text sequences.
+Since the kill ring is supposed to interact nicely with cut-and-paste
+facilities offered by window systems, use of this variable should
+@end group
+@group
+interact nicely with `interprogram-cut-function' and
+`interprogram-paste-function'.  The functions `kill-new',
+`kill-append', and `current-kill' are supposed to implement this
+interaction; you may want to use them instead of manipulating the kill
+ring directly.
 @end group
 @end smallexample
 
-@noindent
-This is an expression whose first element is the function @code{and}.
-
-@findex and, @r{introduced}
-The @code{and} special form evaluates each of its arguments until one of
-the arguments returns a value of @code{nil}, in which case the
-@code{and} expression returns @code{nil}; however, if none of the
-arguments returns a value of @code{nil}, the value resulting from
-evaluating the last argument is returned.  (Since such a value is not
-@code{nil}, it is considered true in Emacs Lisp.)  In other words, an
-@code{and} expression returns a true value only if all its arguments
-are true.
-@findex and
-
-In this case, the expression tests first to see whether
-@code{menu-bar-update-yank-menu} exists as a function, and if so,
-calls it.  The @code{fboundp} function returns true if the symbol it
-is testing has a function definition that `is not void'.  If the
-symbol's function definition were void, we would receive an error
-message, as we did when we created errors intentionally (@pxref{Making
-Errors, , Generate an Error Message}).
-
-@need 1200
-Essentially, the @code{and} is an @code{if} expression that reads like
-this:
+@need 800
+The kill ring is defined by a @code{defvar} in the following way:
 
 @smallexample
 @group
-if @var{the-menu-bar-function-exists}
-  then @var{execute-it}
+(defvar kill-ring nil
+  "List of killed text sequences.
+@dots{}")
 @end group
 @end smallexample
 
-@code{menu-bar-update-yank-menu} is one of the functions that make it
-possible to use the `Select and Paste' menu in the Edit item of a menu
-bar; using a mouse, you can look at the various pieces of text you
-have saved and select one piece to paste.
+@noindent
+In this variable definition, the variable is given an initial value of
+@code{nil}, which makes sense, since if you have saved nothing, you want
+nothing back if you give a @code{yank} command.  The documentation
+string is written just like the documentation string of a @code{defun}.
+As with the documentation string of the @code{defun}, the first line of
+the documentation should be a complete sentence, since some commands,
+like @code{apropos}, print only the first line of documentation.
+Succeeding lines should not be indented; otherwise they look odd when
+you use @kbd{C-h v} (@code{describe-variable}).
 
-Finally, the last expression in the @code{kill-new} function adds the
-newly copied string to whatever facility exists for copying and
-pasting among different programs running in a windowing system.  In
-the X Windowing system, for example, the @code{x-select-text} function
-takes the string and stores it in memory operated by X.  You can paste
-the string in another program, such as an Xterm.
+@node defvar and asterisk,  , See variable current value, defvar
+@subsection @code{defvar} and an asterisk
+@findex defvar @r{for a user customizable variable}
+@findex defvar @r{with an asterisk}
 
-@need 1200
-The expression looks like this:
+In the past, Emacs used the @code{defvar} special form both for
+internal variables that you would not expect a user to change and for
+variables that you do expect a user to change.  Although you can still
+use @code{defvar} for user customizable variables, please use
+@code{defcustom} instead, since that special form provides a path into
+the Customization commands.  (@xref{defcustom, , Specifying Variables
+using @code{defcustom}}.)
+
+When you specified a variable using the @code{defvar} special form,
+you could distinguish a readily settable variable from others by
+typing an asterisk, @samp{*}, in the first column of its documentation
+string.  For example:
 
 @smallexample
 @group
-  (if interprogram-cut-function
-      (funcall interprogram-cut-function string (not replace))))
+(defvar shell-command-default-error-buffer nil
+  "*Buffer name for `shell-command' @dots{} error output.
+@dots{} ")
 @end group
 @end smallexample
 
-If an @code{interprogram-cut-function} exists, then Emacs executes
-@code{funcall}, which in turn calls its first argument as a function
-and passes the remaining arguments to it.  (Incidentally, as far as I
-can see, this @code{if} expression could be replaced by an @code{and}
-expression similar to the one in the first part of the function.)
-
-We are not going to discuss windowing systems and other programs
-further, but merely note that this is a mechanism that enables GNU
-Emacs to work easily and well with other programs.
+@findex set-variable
+@noindent
+You could (and still can) use the @code{set-variable} command to
+change the value of @code{shell-command-default-error-buffer}
+temporarily.  However, options set using @code{set-variable} are set
+only for the duration of your editing session.  The new values are not
+saved between sessions.  Each time Emacs starts, it reads the original
+value, unless you change the value within your @file{.emacs} file,
+either by setting it manually or by using @code{customize}.
+@xref{Emacs Initialization, , Your @file{.emacs} File}.
 
-This code for placing text in the kill ring, either concatenated with
-an existing element or as a new element, leads us to the code for
-bringing back text that has been cut out of the buffer---the yank
-commands.  However, before discussing the yank commands, it is better
-to learn how lists are implemented in a computer.  This will make
-clear such mysteries as the use of the term `pointer'.
+For me, the major use of the @code{set-variable} command is to suggest
+variables that I might want to set in my @file{.emacs} file.  There
+are now more than 700 such variables --- far too many to remember
+readily.  Fortunately, you can press @key{TAB} after calling the
+@code{M-x set-variable} command to see the list of variables.
+(@xref{Examining, , Examining and Setting Variables, emacs,
+The GNU Emacs Manual}.)
 
 @need 1250
-@node cons & search-fwd Review, search Exercises, copy-region-as-kill, Cutting & Storing Text
+@node cons & search-fwd Review, search Exercises, defvar, Cutting & Storing Text
 @comment  node-name,  next,  previous,  up
 @section Review
 
@@ -8762,6 +9519,10 @@ For example:
 @end group
 @end smallexample
 
+@item funcall
+@code{funcall} evaluates its first argument as a function.  It passes
+its remaining arguments to its first argument.
+
 @item nthcdr
 Return the result of taking @sc{cdr} `n' times on a list.
 @iftex
@@ -8826,15 +9587,19 @@ Record whatever narrowing is in effect in the current buffer, if any,
 and restore that narrowing after evaluating the arguments.
 
 @item search-forward
-Search for a string, and if the string is found, move point.
+Search for a string, and if the string is found, move point.  With a
+regular expression, use the similar @code{re-search-forward}.
+(@xref{Regexp Search, , Regular Expression Searches}, for an
+explanation of regular expression patterns and searches.)
 
 @need 1250
 @noindent
-Takes four arguments:
+@code{search-forward} and @code{re-search-forward} take four
+arguments:
 
 @enumerate
 @item
-The string to search for.
+The string or regular expression to search for.
 
 @item
 Optionally, the limit of the search.
@@ -8856,14 +9621,15 @@ search goes backwards.
 buffer and stores that text in the kill ring, so you can get it back
 by yanking.
 
-@code{delete-and-extract-region} removes the text between point and
-mark from the buffer and throws it away.  You cannot get it back.
-
 @code{copy-region-as-kill} copies the text between point and mark into
 the kill ring, from which you can get it by yanking.  The function
 does not cut or remove the text from the buffer.
 @end table
 
+@code{delete-and-extract-region} removes the text between point and
+mark from the buffer and throws it away.  You cannot get it back.
+(This is not an interactive command.)
+
 @need 1500
 @node search Exercises,  , cons & search-fwd Review, Cutting & Storing Text
 @section Searching Exercises
@@ -8940,7 +9706,7 @@ This sounds more complicated than it is and is easier seen in a diagram:
 @ifset print-postscript-figures
 @sp 1
 @tex
-@image{cons-1}
+@center @image{cons-1}
 %%%% old method of including an image
 % \input /usr/local/lib/tex/inputs/psfig.tex
 % \centerline{\psfig{figure=/usr/local/lib/emacs/man/cons-1.eps}}
@@ -9003,7 +9769,7 @@ bouquet
 @ifset print-postscript-figures
 @sp 1
 @tex
-@image{cons-2}
+@center @image{cons-2}
 %%%% old method of including an image
 % \input /usr/local/lib/tex/inputs/psfig.tex
 % \centerline{\psfig{figure=/usr/local/lib/emacs/man/cons-2.eps}}
@@ -9052,7 +9818,7 @@ bouquet
 @ifset print-postscript-figures
 @sp 1
 @tex
-@image{cons-2a}
+@center @image{cons-2a}
 %%%% old method of including an image
 % \input /usr/local/lib/tex/inputs/psfig.tex
 % \centerline{\psfig{figure=/usr/local/lib/emacs/man/cons-2a.eps}}
@@ -9119,7 +9885,7 @@ bouquet        flowers
 @ifset print-postscript-figures
 @sp 1
 @tex
-@image{cons-3}
+@center @image{cons-3}
 %%%% old method of including an image
 % \input /usr/local/lib/tex/inputs/psfig.tex
 % \centerline{\psfig{figure=/usr/local/lib/emacs/man/cons-3.eps}}
@@ -9191,7 +9957,7 @@ bouquet                       flowers
 @ifset print-postscript-figures
 @sp 1
 @tex
-@image{cons-4}
+@center @image{cons-4}
 %%%% old method of including an image
 % \input /usr/local/lib/tex/inputs/psfig.tex
 % \centerline{\psfig{figure=/usr/local/lib/emacs/man/cons-4.eps}}
@@ -9258,7 +10024,7 @@ In an earlier section, I suggested that you might imagine a symbol as
 being a chest of drawers.  The function definition is put in one
 drawer, the value in another, and so on.  What is put in the drawer
 holding the value can be changed without affecting the contents of the
-drawer holding the function definition, and vice-versa.
+drawer holding the function definition, and vice-verse.
 
 Actually, what is put in each drawer is the address of the value or
 function definition.  It is as if you found an old chest in the attic,
@@ -9308,7 +10074,7 @@ Here is a fanciful representation:
 @ifset print-postscript-figures
 @sp 1
 @tex
-@image{drawers}
+@center @image{drawers}
 %%%% old method of including an image
 % \input /usr/local/lib/tex/inputs/psfig.tex
 % \centerline{\psfig{figure=/usr/local/lib/emacs/man/drawers.eps}}
@@ -9361,7 +10127,6 @@ What does the @code{more-flowers} list now contain?
 @comment  node-name,  next,  previous,  up
 @chapter Yanking Text Back
 @findex yank
-@findex rotate-yank-pointer
 @cindex Text retrieval
 @cindex Retrieving text
 @cindex Pasting text
@@ -9385,9 +10150,9 @@ that holds the text is a list.
 list is handled as a ring.)
 
 @menu
-* Kill Ring Overview::          The kill ring is a list.
-* kill-ring-yank-pointer::      The @code{kill-ring-yank-pointer} variable.
-* yank nthcdr Exercises::
+* Kill Ring Overview::
+* kill-ring-yank-pointer::      The kill ring is a list.
+* yank nthcdr Exercises::       The @code{kill-ring-yank-pointer} variable.
 @end menu
 
 @node Kill Ring Overview, kill-ring-yank-pointer, Yanking, Yanking
@@ -9422,9 +10187,17 @@ These functions refer to the kill ring through a variable called the
 (insert (car kill-ring-yank-pointer))
 @end smallexample
 
+@noindent
+(Well, no more.  In GNU Emacs 22, the function has been replaced by
+@code{insert-for-yank} which calls @code{insert-for-yank-1}
+repetitively for each @code{yank-handler} segment.  In turn,
+@code{insert-for-yank-1} strips text properties from the inserted text
+according to @code{yank-excluded-properties}.  Otherwise, it is just
+like @code{insert}.  We will stick with plain @code{insert} since it
+is easier to understand.)
+
 To begin to understand how @code{yank} and @code{yank-pop} work, it is
-first necessary to look at the @code{kill-ring-yank-pointer} variable
-and the @code{rotate-yank-pointer} function.
+first necessary to look at the @code{kill-ring-yank-pointer} variable.
 
 @node kill-ring-yank-pointer, yank nthcdr Exercises, Kill Ring Overview, Yanking
 @comment  node-name,  next,  previous,  up
@@ -9470,7 +10243,7 @@ kill-ring     kill-ring-yank-pointer
             |              |            |
             |              |             --> "yet more text"
             |              |
-            |               --> "a different piece of text
+            |               --> "a different piece of text"
             |
              --> "some text"
 @end group
@@ -9480,7 +10253,7 @@ kill-ring     kill-ring-yank-pointer
 @ifset print-postscript-figures
 @sp 1
 @tex
-@image{cons-5}
+@center @image{cons-5}
 %%%% old method of including an image
 % \input /usr/local/lib/tex/inputs/psfig.tex
 % \centerline{\psfig{figure=/usr/local/lib/emacs/man/cons-5.eps}}
@@ -9525,15 +10298,45 @@ on the other hand, serves to indicate---that is, to `point to'---that part
 of the kill ring of which the first element (the @sc{car}) will be
 inserted.
 
-The @code{rotate-yank-pointer} function changes the element in the
-kill ring to which the @code{kill-ring-yank-pointer} points; when the
-pointer is set to point to the next element beyond the end of the kill
-ring, it automatically sets it to point to the first element of the
-kill ring.  This is how the list is transformed into a ring.  The
-@code{rotate-yank-pointer} function itself is not difficult, but
-contains many details.  It and the much simpler @code{yank} and
-@code{yank-pop} functions are described in an appendix.
-@xref{Kill Ring, , Handling the Kill Ring}.
+@ignore
+In GNU Emacs 22, the @code{kill-new} function calls
+
+@code{(setq kill-ring-yank-pointer kill-ring)}
+
+(defun rotate-yank-pointer (arg)
+  "Rotate the yanking point in the kill ring.
+With argument, rotate that many kills forward (or backward, if negative)."
+  (interactive "p")
+  (current-kill arg))
+
+(defun current-kill (n &optional do-not-move)
+  "Rotate the yanking point by N places, and then return that kill.
+If N is zero, `interprogram-paste-function' is set, and calling it
+returns a string, then that string is added to the front of the
+kill ring and returned as the latest kill.
+If optional arg DO-NOT-MOVE is non-nil, then don't actually move the
+yanking point; just return the Nth kill forward."
+  (let ((interprogram-paste (and (= n 0)
+                                 interprogram-paste-function
+                                 (funcall interprogram-paste-function))))
+    (if interprogram-paste
+        (progn
+          ;; Disable the interprogram cut function when we add the new
+          ;; text to the kill ring, so Emacs doesn't try to own the
+          ;; selection, with identical text.
+          (let ((interprogram-cut-function nil))
+            (kill-new interprogram-paste))
+          interprogram-paste)
+      (or kill-ring (error "Kill ring is empty"))
+      (let ((ARGth-kill-element
+             (nthcdr (mod (- n (length kill-ring-yank-pointer))
+                          (length kill-ring))
+                     kill-ring)))
+        (or do-not-move
+            (setq kill-ring-yank-pointer ARGth-kill-element))
+        (car ARGth-kill-element)))))
+
+@end ignore
 
 @need 1500
 @node yank nthcdr Exercises,  , kill-ring-yank-pointer, Yanking
@@ -9625,6 +10428,7 @@ The template for a @code{while} expression looks like this:
 * Loop Example::                A @code{while} loop that uses a list.
 * print-elements-of-list::      Uses @code{while}, @code{car}, @code{cdr}.
 * Incrementing Loop::           A loop with an incrementing counter.
+* Incrementing Loop Details::
 * Decrementing Loop::           A loop with a decrementing counter.
 @end menu
 
@@ -9776,8 +10580,9 @@ loop with a list.
 
 @cindex @file{*scratch*} buffer
 The function requires several lines for its output.  If you are
-reading this in Emacs 21 or a later version, you can evaluate the
-following expression inside of Info, as usual.
+reading this in a recent instance of GNU Emacs,
+@c GNU Emacs 21, GNU Emacs 22, or a later version,
+you can evaluate the following expression inside of Info, as usual.
 
 If you are using an earlier version of Emacs, you need to copy the
 necessary expressions to your @file{*scratch*} buffer and evaluate
@@ -9787,8 +10592,10 @@ earlier versions.
 You can copy the expressions by marking the beginning of the region
 with @kbd{C-@key{SPC}} (@code{set-mark-command}), moving the cursor to
 the end of the region and then copying the region using @kbd{M-w}
-(@code{copy-region-as-kill}).  In the @file{*scratch*} buffer, you can
-yank the expressions back by typing @kbd{C-y} (@code{yank}).
+(@code{kill-ring-save}, which calls @code{copy-region-as-kill} and
+then provides visual feedback).  In the @file{*scratch*}
+buffer, you can yank the expressions back by typing @kbd{C-y}
+(@code{yank}).
 
 After you have copied the expressions to the @file{*scratch*} buffer,
 evaluate each expression in turn.  Be sure to evaluate the last
@@ -9801,7 +10608,7 @@ echo area: @code{^Jgazelle^J^Jgiraffe^J^Jlion^J^Jtiger^Jnil}, in which
 each @samp{^J} stands for a `newline'.)
 
 @need 1500
-If you are using Emacs 21 or later, you can evaluate these expressions
+In a recent instance of GNU Emacs, you can evaluate these expressions
 directly in the Info buffer, and the echo area will grow to show the
 results.
 
@@ -9843,7 +10650,7 @@ function is printed.  Since the last expression in the function is the
 @code{while} loop, and since @code{while} loops always return
 @code{nil}, a @code{nil} is printed after the last element of the list.
 
-@node Incrementing Loop, Decrementing Loop, print-elements-of-list, while
+@node Incrementing Loop, Incrementing Loop Details, print-elements-of-list, while
 @comment  node-name,  next,  previous,  up
 @subsection A Loop with an Incrementing Counter
 
@@ -9854,15 +10661,21 @@ number of repetitions are complete.  This means that the loop must
 have a counter---an expression that counts how many times the loop
 repeats itself.
 
-The test can be an expression such as @code{(< count desired-number)}
-which returns @code{t} for true if the value of @code{count} is less
-than the @code{desired-number} of repetitions and @code{nil} for false if
-the value of @code{count} is equal to or is greater than the
-@code{desired-number}.  The expression that increments the count can be
-a simple @code{setq} such as @code{(setq count (1+ count))}, where
+@node Incrementing Loop Details, Decrementing Loop, Incrementing Loop, while
+@ifnottex
+@unnumberedsubsec Details of an Incrementing Loop
+@end ifnottex
+
+The test for a loop with an incrementing counter can be an expression
+such as @code{(< count desired-number)} which returns @code{t} for
+true if the value of @code{count} is less than the
+@code{desired-number} of repetitions and @code{nil} for false if the
+value of @code{count} is equal to or is greater than the
+@code{desired-number}.  The expression that increments the count can
+be a simple @code{setq} such as @code{(setq count (1+ count))}, where
 @code{1+} is a built-in function in Emacs Lisp that adds 1 to its
-argument.  (The expression @w{@code{(1+ count)}} has the same result as
-@w{@code{(+ count 1)}}, but is easier for a human to read.)
+argument.  (The expression @w{@code{(1+ count)}} has the same result
+as @w{@code{(+ count 1)}}, but is easier for a human to read.)
 
 @need 1250
 The template for a @code{while} loop controlled by an incrementing
@@ -9887,7 +10700,7 @@ is set to 1.
 * Inc Example altogether::      Putting the function definition together.
 @end menu
 
-@node Incrementing Example, Inc Example parts, Incrementing Loop, Incrementing Loop
+@node Incrementing Example, Inc Example parts, Incrementing Loop Details, Incrementing Loop Details
 @unnumberedsubsubsec  Example with incrementing counter
 
 Suppose you are playing on the beach and decide to make a triangle of
@@ -9954,7 +10767,7 @@ row has been added to the total of all the preceding rows.  In a more
 complex loop the repetitive action might not be so simple, but it will
 be simpler than doing everything all at once.
 
-@node Inc Example parts, Inc Example altogether, Incrementing Example, Incrementing Loop
+@node Inc Example parts, Inc Example altogether, Incrementing Example, Incrementing Loop Details
 @unnumberedsubsubsec The parts of the function definition
 
 The preceding analysis gives us the bones of our function definition:
@@ -9967,9 +10780,9 @@ argument will be the total number of rows in the triangle.  It can be
 called @code{number-of-rows}.
 
 Finally, we need a variable to use as a counter.  We could call this
-variable @code{counter}, but a better name is @code{row-number}.
-That is because what the counter does is count rows, and a program
-should be written to be as understandable as possible.
+variable @code{counter}, but a better name is @code{row-number}.  That
+is because what the counter does in this function is count rows, and a
+program should be written to be as understandable as possible.
 
 When the Lisp interpreter first starts evaluating the expressions in the
 function, the value of @code{total} should be set to zero, since we have
@@ -10048,7 +10861,7 @@ The built-in Emacs Lisp function @code{1+} adds 1 to a number, so the
 (setq row-number (1+ row-number))
 @end smallexample
 
-@node Inc Example altogether,  , Inc Example parts, Incrementing Loop
+@node Inc Example altogether,  , Inc Example parts, Incrementing Loop Details
 @unnumberedsubsubsec Putting the function definition together
 
 We have created the parts for the function definition; now we need to
@@ -10092,7 +10905,7 @@ In outline, the function will look like this:
   (let (@var{varlist})
     (while (@var{true-or-false-test})
       @var{body-of-while}@dots{} )
-    @dots{} )                     ; @r{Need final expression here.}
+    @dots{} ))                    ; @r{Need final expression here.}
 @end group
 @end smallexample
 
@@ -10158,7 +10971,7 @@ can try it out.  Here are two examples:
 The sum of the first four numbers is 10 and the sum of the first seven
 numbers is 28.
 
-@node Decrementing Loop,  , Incrementing Loop, while
+@node Decrementing Loop,  , Incrementing Loop Details, while
 @comment  node-name,  next,  previous,  up
 @subsection Loop with a Decrementing Counter
 
@@ -10668,8 +11481,8 @@ The example of a @code{while} loop that printed the elements of a list
 of numbers can be written recursively.  Here is the code, including
 an expression to set the value of the variable @code{animals} to a list.
 
-If you are using Emacs 20 or before, this example must be copied to
-the @file{*scratch*} buffer and each expression must be evaluated
+If you are using GNU Emacs 20 or before, this example must be copied
+to the @file{*scratch*} buffer and each expression must be evaluated
 there.  Use @kbd{C-u C-x C-e} to evaluate the
 @code{(print-elements-recursively animals)} expression so that the
 results are printed in the buffer; otherwise the Lisp interpreter will
@@ -10679,8 +11492,8 @@ Also, place your cursor immediately after the last closing parenthesis
 of the @code{print-elements-recursively} function, before the comment.
 Otherwise, the Lisp interpreter will try to evaluate the comment.
 
-If you are using Emacs 21 or later, you can evaluate this expression
-directly in Info.
+If you are using a more recent version of Emacs, you can evaluate this
+expression directly in Info.
 
 @findex print-elements-recursively
 @smallexample
@@ -10690,11 +11503,10 @@ directly in Info.
 (defun print-elements-recursively (list)
   "Print each element of LIST on a line of its own.
 Uses recursion."
-  (if list                              ; @r{do-again-test}
-      (progn
+  (when list                            ; @r{do-again-test}
         (print (car list))              ; @r{body}
         (print-elements-recursively     ; @r{recursive call}
-         (cdr list)))))                 ; @r{next-step-expression}
+         (cdr list))))                  ; @r{next-step-expression}
 
 (print-elements-recursively animals)
 @end group
@@ -10716,7 +11528,7 @@ Put in yet another way, if the list is not empty, the first robot
 assemblies a second robot and tells it what to do; the second robot is
 a different individual from the first, but is the same model.
 
-When the second evaluation occurs, the @code{if} expression is
+When the second evaluation occurs, the @code{when} expression is
 evaluated and if true, prints the first element of the list it
 receives as its argument (which is the second element of the original
 list).  Then the function `calls itself' with the @sc{cdr} of the list
@@ -10735,7 +11547,7 @@ works on a shorter list.
 Eventually, the function invokes itself on an empty list.  It creates
 a new instance whose argument is @code{nil}.  The conditional expression
 tests the value of @code{list}.  Since the value of @code{list} is
-@code{nil}, the @code{if} expression tests false so the then-part is
+@code{nil}, the @code{when} expression tests false so the then-part is
 not evaluated.  The function as a whole then returns @code{nil}.
 
 @need 1200
@@ -10755,6 +11567,7 @@ nil
 @end group
 @end smallexample
 
+@need 2000
 @node Recursive triangle function, Recursion with cond, Recursion with list, Recursion
 @comment  node-name,  next,  previous,  up
 @subsection Recursion in Place of a Counter
@@ -11114,11 +11927,10 @@ The @code{print-elements-recursively} function looks like this:
 (defun print-elements-recursively (list)
   "Print each element of LIST on a line of its own.
 Uses recursion."
-  (if list                              ; @r{do-again-test}
-      (progn
+  (when list                            ; @r{do-again-test}
         (print (car list))              ; @r{body}
         (print-elements-recursively     ; @r{recursive call}
-         (cdr list)))))                 ; @r{next-step-expression}
+         (cdr list))))                  ; @r{next-step-expression}
 
 (print-elements-recursively animals)
 @end group
@@ -11129,9 +11941,9 @@ The pattern for @code{print-elements-recursively} is:
 
 @itemize @bullet
 @item
-If the list be empty, do nothing.
+When the list is empty, do nothing.
 @item
-But if the list has at least one element,
+But when the list has at least one element,
     @itemize @minus
     @item
     act on the beginning of the list (the @sc{car} of the list),
@@ -11250,7 +12062,7 @@ Here is an example that uses @code{cond}:
 
    ;; Third do-again-test: when to skip element;
    ;;   recursively call shorter list with next-step expression
-   (t  (keep-three-letter-words (cdr word-list)))))
+   (t (keep-three-letter-words (cdr word-list)))))
 @end group
 
 @group
@@ -11432,7 +12244,7 @@ test whether @code{(> counter number)}:
 @need 1200
 @noindent
 and find that the result is false, so it will invoke
-the then-part of the @code{if} clause:
+the else-part of the @code{if} clause:
 
 @smallexample
 @group
@@ -11548,7 +12360,7 @@ For more information, see
 @ref{Indicating, , Indicating, texinfo, Texinfo Manual}, which goes to
 a Texinfo manual in the current directory.  Or, if you are on the
 Internet, see
-@uref{http://www.gnu.org/manual/texinfo-4.6/html_node/Indicating.html}
+@uref{http://www.gnu.org/software/texinfo/manual/texinfo/}
 @end ifhtml
 @iftex
 ``Indicating Definitions, Commands, etc.'' in @cite{Texinfo, The GNU
@@ -11612,9 +12424,9 @@ The symbol @code{sentence-end} is bound to the pattern that marks the
 end of a sentence.  What should this regular expression be?
 
 Clearly, a sentence may be ended by a period, a question mark, or an
-exclamation mark.  Indeed, only clauses that end with one of those three
-characters should be considered the end of a sentence.  This means that
-the pattern should include the character set:
+exclamation mark.  Indeed, in English, only clauses that end with one
+of those three characters should be considered the end of a sentence.
+This means that the pattern should include the character set:
 
 @smallexample
 [.?!]
@@ -11697,13 +12509,27 @@ sentence-end
 @end group
 @end smallexample
 
-@ignore
+@noindent
+(Well, not in GNU Emacs 22; that is because of an effort to make the
+process simpler and to handle more glyphs and languages.  When the
+value of @code{sentence-end} is @code{nil}, then use the value defined
+by the function @code{sentence-end}.  (Here is a use of the difference
+between a value and a function in Emacs Lisp.)  The function returns a
+value constructed from the variables @code{sentence-end-base},
+@code{sentence-end-double-space}, @code{sentence-end-without-period},
+and @code{sentence-end-without-space}.  The critical variable is
+@code{sentence-end-base}; its global value is similar to the one
+described above but it also contains two additional quotation marks.
+These have differing degrees of curliness.  The
+@code{sentence-end-without-period} variable, when true, tells Emacs
+that a sentence may end without a period, such as text in Thai.)
 
+@ignore
 @noindent
 (Note that here the @key{TAB}, two spaces, and  @key{RET} are shown
 literally in the pattern.)
 
-This regular expression can be decyphered as follows:
+This regular expression can be deciphered as follows:
 
 @table @code
 @item [.?!]
@@ -11739,7 +12565,6 @@ mark may, but need not, be followed by one or more carriage returns.  In
 the pattern, the carriage return is inserted as an actual carriage
 return between square brackets but here it is shown as @key{RET}.
 @end table
-
 @end ignore
 
 @node re-search-forward, forward-sentence, sentence-end, Regexp Search
@@ -11802,7 +12627,7 @@ to.
 
 @need 1200
 In the @code{forward-sentence} function, the regular expression will be
-the value of the variable @code{sentence-end}, namely:
+the value of the variable @code{sentence-end}.  In simple form, that is:
 
 @smallexample
 @group
@@ -11843,6 +12668,44 @@ bound to the key command @kbd{M-e}.
 @need 1250
 Here is the code for @code{forward-sentence}:
 
+@c in GNU Emacs 22
+@smallexample
+@group
+(defun forward-sentence (&optional arg)
+  "Move forward to next `sentence-end'.  With argument, repeat.
+With negative argument, move backward repeatedly to `sentence-beginning'.
+
+The variable `sentence-end' is a regular expression that matches ends of
+sentences.  Also, every paragraph boundary terminates sentences as well."
+@end group
+@group
+  (interactive "p")
+  (or arg (setq arg 1))
+  (let ((opoint (point))
+        (sentence-end (sentence-end)))
+    (while (< arg 0)
+      (let ((pos (point))
+            (par-beg (save-excursion (start-of-paragraph-text) (point))))
+       (if (and (re-search-backward sentence-end par-beg t)
+                (or (< (match-end 0) pos)
+                    (re-search-backward sentence-end par-beg t)))
+           (goto-char (match-end 0))
+         (goto-char par-beg)))
+      (setq arg (1+ arg)))
+@end group
+@group
+    (while (> arg 0)
+      (let ((par-end (save-excursion (end-of-paragraph-text) (point))))
+       (if (re-search-forward sentence-end par-end t)
+           (skip-chars-backward " \t\n")
+         (goto-char par-end)))
+      (setq arg (1- arg)))
+    (constrain-to-field nil opoint t)))
+@end group
+@end smallexample
+
+@ignore
+GNU Emacs 21
 @smallexample
 @group
 (defun forward-sentence (&optional arg)
@@ -11872,6 +12735,7 @@ terminates sentences as well."
     (setq arg (1- arg))))
 @end group
 @end smallexample
+@end ignore
 
 The function looks long at first sight and it is best to look at its
 skeleton first, and then its muscle.  The way to see the skeleton is to
@@ -11883,16 +12747,21 @@ look at the expressions that start in the left-most columns:
   "@var{documentation}@dots{}"
   (interactive "p")
   (or arg (setq arg 1))
-  (while (< arg 0)
-    @var{body-of-while-loop}
-  (while (> arg 0)
-    @var{body-of-while-loop}
+  (let ((opoint (point)) (sentence-end (sentence-end)))
+    (while (< arg 0)
+      (let ((pos (point))
+            (par-beg (save-excursion (start-of-paragraph-text) (point))))
+       @var{rest-of-body-of-while-loop-when-going-backwards}
+    (while (> arg 0)
+      (let ((par-end (save-excursion (end-of-paragraph-text) (point))))
+       @var{rest-of-body-of-while-loop-when-going-forwards}
+    @var{handle-forms-and-equivalent}
 @end group
 @end smallexample
 
 This looks much simpler!  The function definition consists of
 documentation, an @code{interactive} expression, an @code{or}
-expression, and @code{while} loops.
+expression, a @code{let} expression, and @code{while} loops.
 
 Let's look at each of these parts in turn.
 
@@ -11902,24 +12771,31 @@ The function has an @code{interactive "p"} declaration.  This means
 that the processed prefix argument, if any, is passed to the
 function as its argument.  (This will be a number.)  If the function
 is not passed an argument (it is optional) then the argument
-@code{arg} will be bound to 1.  When @code{forward-sentence} is called
-non-interactively without an argument, @code{arg} is bound to
+@code{arg} will be bound to 1.
+
+When @code{forward-sentence} is called non-interactively without an
+argument, @code{arg} is bound to @code{nil}.  The @code{or} expression
+handles this.  What it does is either leave the value of @code{arg} as
+it is, but only if @code{arg} is bound to a value; or it sets the
+value of @code{arg} to 1, in the case when @code{arg} is bound to
 @code{nil}.
 
-The @code{or} expression handles the prefix argument.  What it does is
-either leave the value of @code{arg} as it is, but only if @code{arg}
-is bound to a value; or it sets the value of @code{arg} to 1, in the
-case when @code{arg} is bound to @code{nil}.
+Next is a @code{let}.  That specifies the values of two local
+variables, @code{point} and @code{sentence-end}.  The local value of
+point, from before the search, is used in the
+@code{constrain-to-field} function which handles forms and
+equivalents.  The @code{sentence-end} variable is set by the
+@code{sentence-end} function.
 
 @node fwd-sentence while loops, fwd-sentence re-search, Complete forward-sentence, forward-sentence
 @unnumberedsubsec The @code{while} loops
 
-Two @code{while} loops follow the @code{or} expression.  The first
-@code{while} has a true-or-false-test that tests true if the prefix
-argument for @code{forward-sentence} is a negative number.  This is for
-going backwards.  The body of this loop is similar to the body of the
-second @code{while} clause, but it is not exactly the same.  We will
-skip this @code{while} loop and concentrate on the second @code{while}
+Two @code{while} loops follow.  The first @code{while} has a
+true-or-false-test that tests true if the prefix argument for
+@code{forward-sentence} is a negative number.  This is for going
+backwards.  The body of this loop is similar to the body of the second
+@code{while} clause, but it is not exactly the same.  We will skip
+this @code{while} loop and concentrate on the second @code{while}
 loop.
 
 @need 1500
@@ -11988,7 +12864,7 @@ end of the paragraph, @code{(point)} returns the value of point, and then
 @code{save-excursion} restores point to its original position.  Thus,
 the @code{let} binds @code{par-end} to the value returned by the
 @code{save-excursion} expression, which is the position of the end of
-the paragraph.  (The @code{(end-of-paragraph-text)} function uses
+the paragraph.  (The @code{end-of-paragraph-text} function uses
 @code{forward-paragraph}, which we will discuss shortly.)
 
 @need 1200
@@ -12052,6 +12928,9 @@ false.  The false then causes the @code{if} to evaluate its third
 argument, which is @code{(goto-char par-end)}:  it moves point to the
 end of the paragraph.
 
+(And if the text is in a form or equivalent, and point may not move
+fully, then the @code{constrain-to-field} function comes into play.)
+
 Regular expression searches are exceptionally useful and the pattern
 illustrated by @code{re-search-forward}, in which the search is the
 test of an @code{if} expression, is handy.  You will see or write code
@@ -12062,6 +12941,151 @@ incorporating this pattern often.
 @section @code{forward-paragraph}: a Goldmine of Functions
 @findex forward-paragraph
 
+@ignore
+@c in GNU Emacs 22
+(defun forward-paragraph (&optional arg)
+  "Move forward to end of paragraph.
+With argument ARG, do it ARG times;
+a negative argument ARG = -N means move backward N paragraphs.
+
+A line which `paragraph-start' matches either separates paragraphs
+\(if `paragraph-separate' matches it also) or is the first line of a paragraph.
+A paragraph end is the beginning of a line which is not part of the paragraph
+to which the end of the previous line belongs, or the end of the buffer.
+Returns the count of paragraphs left to move."
+  (interactive "p")
+  (or arg (setq arg 1))
+  (let* ((opoint (point))
+         (fill-prefix-regexp
+          (and fill-prefix (not (equal fill-prefix ""))
+               (not paragraph-ignore-fill-prefix)
+               (regexp-quote fill-prefix)))
+         ;; Remove ^ from paragraph-start and paragraph-sep if they are there.
+         ;; These regexps shouldn't be anchored, because we look for them
+         ;; starting at the left-margin.  This allows paragraph commands to
+         ;; work normally with indented text.
+         ;; This hack will not find problem cases like "whatever\\|^something".
+         (parstart (if (and (not (equal "" paragraph-start))
+                            (equal ?^ (aref paragraph-start 0)))
+                       (substring paragraph-start 1)
+                     paragraph-start))
+         (parsep (if (and (not (equal "" paragraph-separate))
+                          (equal ?^ (aref paragraph-separate 0)))
+                     (substring paragraph-separate 1)
+                   paragraph-separate))
+         (parsep
+          (if fill-prefix-regexp
+              (concat parsep "\\|"
+                      fill-prefix-regexp "[ \t]*$")
+            parsep))
+         ;; This is used for searching.
+         (sp-parstart (concat "^[ \t]*\\(?:" parstart "\\|" parsep "\\)"))
+         start found-start)
+    (while (and (< arg 0) (not (bobp)))
+      (if (and (not (looking-at parsep))
+               (re-search-backward "^\n" (max (1- (point)) (point-min)) t)
+               (looking-at parsep))
+          (setq arg (1+ arg))
+        (setq start (point))
+        ;; Move back over paragraph-separating lines.
+        (forward-char -1) (beginning-of-line)
+        (while (and (not (bobp))
+                    (progn (move-to-left-margin)
+                           (looking-at parsep)))
+          (forward-line -1))
+        (if (bobp)
+            nil
+          (setq arg (1+ arg))
+          ;; Go to end of the previous (non-separating) line.
+          (end-of-line)
+          ;; Search back for line that starts or separates paragraphs.
+          (if (if fill-prefix-regexp
+                  ;; There is a fill prefix; it overrides parstart.
+                  (let (multiple-lines)
+                    (while (and (progn (beginning-of-line) (not (bobp)))
+                                (progn (move-to-left-margin)
+                                       (not (looking-at parsep)))
+                                (looking-at fill-prefix-regexp))
+                      (unless (= (point) start)
+                        (setq multiple-lines t))
+                      (forward-line -1))
+                    (move-to-left-margin)
+                    ;; This deleted code caused a long hanging-indent line
+                    ;; not to be filled together with the following lines.
+                    ;; ;; Don't move back over a line before the paragraph
+                    ;; ;; which doesn't start with fill-prefix
+                    ;; ;; unless that is the only line we've moved over.
+                    ;; (and (not (looking-at fill-prefix-regexp))
+                    ;;      multiple-lines
+                    ;;      (forward-line 1))
+                    (not (bobp)))
+                (while (and (re-search-backward sp-parstart nil 1)
+                            (setq found-start t)
+                            ;; Found a candidate, but need to check if it is a
+                            ;; REAL parstart.
+                            (progn (setq start (point))
+                                   (move-to-left-margin)
+                                   (not (looking-at parsep)))
+                            (not (and (looking-at parstart)
+                                      (or (not use-hard-newlines)
+                                          (bobp)
+                                          (get-text-property
+                                           (1- start) 'hard)))))
+                  (setq found-start nil)
+                  (goto-char start))
+                found-start)
+              ;; Found one.
+              (progn
+                ;; Move forward over paragraph separators.
+                ;; We know this cannot reach the place we started
+                ;; because we know we moved back over a non-separator.
+                (while (and (not (eobp))
+                            (progn (move-to-left-margin)
+                                   (looking-at parsep)))
+                  (forward-line 1))
+                ;; If line before paragraph is just margin, back up to there.
+                (end-of-line 0)
+                (if (> (current-column) (current-left-margin))
+                    (forward-char 1)
+                  (skip-chars-backward " \t")
+                  (if (not (bolp))
+                      (forward-line 1))))
+            ;; No starter or separator line => use buffer beg.
+            (goto-char (point-min))))))
+
+    (while (and (> arg 0) (not (eobp)))
+      ;; Move forward over separator lines...
+      (while (and (not (eobp))
+                  (progn (move-to-left-margin) (not (eobp)))
+                  (looking-at parsep))
+        (forward-line 1))
+      (unless (eobp) (setq arg (1- arg)))
+      ;; ... and one more line.
+      (forward-line 1)
+      (if fill-prefix-regexp
+          ;; There is a fill prefix; it overrides parstart.
+          (while (and (not (eobp))
+                      (progn (move-to-left-margin) (not (eobp)))
+                      (not (looking-at parsep))
+                      (looking-at fill-prefix-regexp))
+            (forward-line 1))
+        (while (and (re-search-forward sp-parstart nil 1)
+                    (progn (setq start (match-beginning 0))
+                           (goto-char start)
+                           (not (eobp)))
+                    (progn (move-to-left-margin)
+                           (not (looking-at parsep)))
+                    (or (not (looking-at parstart))
+                        (and use-hard-newlines
+                             (not (get-text-property (1- start) 'hard)))))
+          (forward-char 1))
+        (if (< (point) (point-max))
+            (goto-char start))))
+    (constrain-to-field nil opoint t)
+    ;; Return the number of steps that could not be done.
+    arg))
+@end ignore
+
 The @code{forward-paragraph} function moves point forward to the end
 of the paragraph.  It is usually bound to @kbd{M-@}} and makes use of a
 number of functions that are important in themselves, including
@@ -12094,11 +13118,6 @@ This is an added complication.
 * forward-paragraph in brief::  Key parts of the function definition.
 * fwd-para let::                The @code{let*} expression.
 * fwd-para while::              The forward motion @code{while} loop.
-* fwd-para between paragraphs::  Movement between paragraphs.
-* fwd-para within paragraph::   Movement within paragraphs.
-* fwd-para no fill prefix::     When there is no fill prefix.
-* fwd-para with fill prefix::   When there is a fill prefix.
-* fwd-para summary::            Summary of @code{forward-paragraph} code.
 @end menu
 
 @node forward-paragraph in brief, fwd-para let, forward-paragraph, forward-paragraph
@@ -12121,12 +13140,10 @@ In outline, the function looks like this:
   (or arg (setq arg 1))
   (let*
       @var{varlist}
-    (while (< arg 0)        ; @r{backward-moving-code}
+    (while (and (< arg 0) (not (bobp)))     ; @r{backward-moving-code}
       @dots{}
-      (setq arg (1+ arg)))
-    (while (> arg 0)        ; @r{forward-moving-code}
+    (while (and (> arg 0) (not (eobp)))     ; @r{forward-moving-code}
       @dots{}
-      (setq arg (1- arg)))))
 @end group
 @end smallexample
 
@@ -12147,22 +13164,34 @@ familiar part of this function.
 @unnumberedsubsec The @code{let*} expression
 
 The next line of the @code{forward-paragraph} function begins a
-@code{let*} expression.  This is a different kind of expression than
-we have seen so far.  The symbol is @code{let*} not @code{let}.
+@code{let*} expression.  This is a different than @code{let}.  The
+symbol is @code{let*} not @code{let}.
 
 The @code{let*} special form is like @code{let} except that Emacs sets
 each variable in sequence, one after another, and variables in the
 latter part of the varlist can make use of the values to which Emacs
 set variables in the earlier part of the varlist.
 
-In the @code{let*} expression in this function, Emacs binds two
-variables: @code{fill-prefix-regexp} and @code{paragraph-separate}.
-The value to which @code{paragraph-separate} is bound depends on the
-value of @code{fill-prefix-regexp}.
+@ignore
+( refappend save-excursion, , code save-excursion in code append-to-buffer .)
+@end ignore
 
-@need 1200
-Let's look at each in turn.  The symbol @code{fill-prefix-regexp} is
-set to the value returned by evaluating the following list:
+(@ref{append save-excursion, , @code{save-excursion} in @code{append-to-buffer}}.)
+
+In the @code{let*} expression in this function, Emacs binds a total of
+seven variables:  @code{opoint}, @code{fill-prefix-regexp},
+@code{parstart}, @code{parsep}, @code{sp-parstart}, @code{start}, and
+@code{found-start}.
+
+The variable @code{parsep} appears twice, first, to remove instances
+of @samp{^}, and second, to handle fill prefixes.
+
+The variable @code{opoint} is just the value of @code{point}.  As you
+can guess, it is used in a @code{constrain-to-field} expression, just
+as in @code{forward-sentence}.
+
+The variable @code{fill-prefix-regexp} is set to the value returned by
+evaluating the following list:
 
 @smallexample
 @group
@@ -12226,49 +13255,44 @@ This means that @code{fill-prefix-regexp} will be set to a value that
 will exactly match the fill prefix if the fill prefix exists.
 Otherwise, the variable will be set to @code{nil}.
 
-The second local variable in the @code{let*} expression is
-@code{paragraph-separate}.  It is bound to the value returned by
-evaluating the expression:
-
-@smallexample
-@group
-(if fill-prefix-regexp
-    (concat paragraph-separate
-            "\\|^" fill-prefix-regexp "[ \t]*$")
-  paragraph-separate)))
-@end group
-@end smallexample
+The next two local variables in the @code{let*} expression are
+designed to remove instances of @samp{^} from @code{parstart} and
+@code{parsep}, the local variables which indicate the paragraph start
+and the paragraph separator.  The next expression sets @code{parsep}
+again.  That is to handle fill prefixes.
 
-This expression shows why @code{let*} rather than @code{let} was used.
-The true-or-false-test for the @code{if} depends on whether the variable
-@code{fill-prefix-regexp} evaluates to @code{nil} or some other value.
+This is the setting that requires the definition call @code{let*}
+rather than @code{let}.  The true-or-false-test for the @code{if}
+depends on whether the variable @code{fill-prefix-regexp} evaluates to
+@code{nil} or some other value.
 
 If @code{fill-prefix-regexp} does not have a value, Emacs evaluates
-the else-part of the @code{if} expression and binds
-@code{paragraph-separate} to its local value.
-(@code{paragraph-separate} is a regular expression that matches what
-separates paragraphs.)
+the else-part of the @code{if} expression and binds @code{parsep} to
+its local value.  (@code{parsep} is a regular expression that matches
+what separates paragraphs.)
 
 But if @code{fill-prefix-regexp} does have a value, Emacs evaluates
-the then-part of the @code{if} expression and binds
-@code{paragraph-separate} to a regular expression that includes the
-@code{fill-prefix-regexp} as part of the pattern.
-
-Specifically, @code{paragraph-separate} is set to the original value
-of the paragraph separate regular expression concatenated with an
-alternative expression that consists of the @code{fill-prefix-regexp}
-followed by a blank line.  The @samp{^} indicates that the
-@code{fill-prefix-regexp} must begin a line, and the optional
-whitespace to the end of the line is defined by @w{@code{"[ \t]*$"}}.)
-The @samp{\\|} defines this portion of the regexp as an alternative to
-@code{paragraph-separate}.
+the then-part of the @code{if} expression and binds @code{parsep} to a
+regular expression that includes the @code{fill-prefix-regexp} as part
+of the pattern.
+
+Specifically, @code{parsep} is set to the original value of the
+paragraph separate regular expression concatenated with an alternative
+expression that consists of the @code{fill-prefix-regexp} followed by
+optional whitespace to the end of the line.  The whitespace is defined
+by @w{@code{"[ \t]*$"}}.)  The @samp{\\|} defines this portion of the
+regexp as an alternative to @code{parsep}.
+
+According to a comment in the code, the next local variable,
+@code{sp-parstart}, is used for searching, and then the final two,
+@code{start} and @code{found-start}, are set to @code{nil}.
 
 Now we get into the body of the @code{let*}.  The first part of the body
 of the @code{let*} deals with the case when the function is given a
 negative argument and is therefore moving backwards.  We will skip this
 section.
 
-@node fwd-para while, fwd-para between paragraphs, fwd-para let, forward-paragraph
+@node fwd-para while,  , fwd-para let, forward-paragraph
 @unnumberedsubsec The forward motion @code{while} loop
 
 The second part of the body of the @code{let*} deals with forward
@@ -12278,242 +13302,160 @@ the function, the value of the argument is 1, so the body of the
 @code{while} loop is evaluated exactly once, and the cursor moves
 forward one paragraph.
 
-This part handles three situations: when point is between paragraphs,
-when point is within a paragraph and there is a fill prefix, and
-when point is within a paragraph and there is no fill prefix.
-
-@need 800
-The @code{while} loop looks like this:
-
-@smallexample
-@group
-(while (> arg 0)
-  (beginning-of-line)
+@ignore
+(while (and (> arg 0) (not (eobp)))
 
-  ;; @r{between paragraphs}
-  (while (prog1 (and (not (eobp))
-                     (looking-at paragraph-separate))
-           (forward-line 1)))
-@end group
+  ;; Move forward over separator lines...
+  (while (and (not (eobp))
+              (progn (move-to-left-margin) (not (eobp)))
+              (looking-at parsep))
+    (forward-line 1))
+  (unless (eobp) (setq arg (1- arg)))
+  ;; ... and one more line.
+  (forward-line 1)
 
-@group
-  ;; @r{within paragraphs, with a fill prefix}
   (if fill-prefix-regexp
-      ;; @r{There is a fill prefix; it overrides paragraph-start.}
-      (while (and (not (eobp))
-                  (not (looking-at paragraph-separate))
-                  (looking-at fill-prefix-regexp))
-        (forward-line 1))
-@end group
-
-@group
-    ;; @r{within paragraphs, no fill prefix}
-    (if (re-search-forward paragraph-start nil t)
-        (goto-char (match-beginning 0))
-      (goto-char (point-max))))
-
-  (setq arg (1- arg)))
-@end group
-@end smallexample
-
-We can see immediately that this is a decrementing counter @code{while}
-loop, using the expression @code{(setq arg (1- arg))} as the decrementer.
-
-@need 800
-The body of the loop consists of three expressions:
-
-@smallexample
-@group
-;; @r{between paragraphs}
-(beginning-of-line)
-(while
-    @var{body-of-while})
-@end group
-
-@group
-;; @r{within paragraphs, with fill prefix}
-(if @var{true-or-false-test}
-    @var{then-part}
-@end group
-
-@group
-;; @r{within paragraphs, no fill prefix}
-  @var{else-part}
-@end group
-@end smallexample
-
-@noindent
-When the Emacs Lisp interpreter evaluates the body of the
-@code{while} loop, the first thing it does is evaluate the
-@code{(beginning-of-line)} expression and move point to the beginning
-of the line.  Then there is an inner @code{while} loop.  This
-@code{while} loop is designed to move the cursor out of the blank
-space between paragraphs, if it should happen to be there.  Finally,
-there is an @code{if} expression that actually moves point to the end
-of the paragraph.
-
-@node fwd-para between paragraphs, fwd-para within paragraph, fwd-para while, forward-paragraph
-@unnumberedsubsec Between paragraphs
-
-First, let us look at the inner @code{while} loop.  This loop handles
-the case when point is between paragraphs; it uses three functions
-that are new to us: @code{prog1}, @code{eobp} and @code{looking-at}.
-@findex prog1
-@findex eobp
-@findex looking-at
-
-@itemize @bullet
-@item
-@code{prog1} is similar to the @code{progn} special form,
-except that @code{prog1} evaluates its arguments in sequence and then
-returns the value of its first argument as the value of the whole
-expression.  (@code{progn} returns the value of its last argument as the
-value of the expression.) The second and subsequent arguments to
-@code{prog1} are evaluated only for their side effects.
-
-@item
-@code{eobp} is an abbreviation of @samp{End Of Buffer P} and is a
-function that returns true if point is at the end of the buffer.
-
-@item
-@code{looking-at} is a function that returns true if the text following
-point matches the regular expression passed @code{looking-at} as its
-argument.
-@end itemize
-
-@need 800
-The @code{while} loop we are studying looks like this:
-
-@smallexample
-@group
-(while (prog1 (and (not (eobp))
-                   (looking-at paragraph-separate))
-              (forward-line 1)))
-@end group
-@end smallexample
-
-@need 1200
-@noindent
-This is a @code{while} loop with no body!  The true-or-false-test of the
-loop is the expression:
-
-@smallexample
-@group
-(prog1 (and (not (eobp))
-            (looking-at paragraph-separate))
-       (forward-line 1))
-@end group
-@end smallexample
-
-@noindent
-The first argument to the @code{prog1} is the @code{and} expression.  It
-has within in it a test of whether point is at the end of the buffer and
-also a test of whether the pattern following point matches the regular
-expression for separating paragraphs.
-
-If the cursor is not at the end of the buffer and if the characters
-following the cursor mark the separation between two paragraphs, then
-the @code{and} expression is true.  After evaluating the @code{and}
-expression, the Lisp interpreter evaluates the second argument to
-@code{prog1}, which is @code{forward-line}.  This moves point forward
-one line.  The value returned by the @code{prog1} however, is the
-value of its first argument, so the @code{while} loop continues so
-long as point is not at the end of the buffer and is between
-paragraphs.  When, finally, point is moved to a paragraph, the
-@code{and} expression tests false.  Note however, that the
-@code{forward-line} command is carried out anyhow.  This means that
-when point is moved from between paragraphs to a paragraph, it is left
-at the beginning of the second line of the paragraph.
-
-@node fwd-para within paragraph, fwd-para no fill prefix, fwd-para between paragraphs, forward-paragraph
-@unnumberedsubsec Within paragraphs
+      ;; There is a fill prefix; it overrides parstart.
+      (while (and (not (eobp))
+                  (progn (move-to-left-margin) (not (eobp)))
+                  (not (looking-at parsep))
+                  (looking-at fill-prefix-regexp))
+        (forward-line 1))
 
-The next expression in the outer @code{while} loop is an @code{if}
-expression.  The Lisp interpreter evaluates the then-part of the
-@code{if} when the @code{fill-prefix-regexp} variable has a value other
-than @code{nil}, and it evaluates the else-part when the value of
-@code{if fill-prefix-regexp} is @code{nil}, that is, when there is no
-fill prefix.
+    (while (and (re-search-forward sp-parstart nil 1)
+                (progn (setq start (match-beginning 0))
+                       (goto-char start)
+                       (not (eobp)))
+                (progn (move-to-left-margin)
+                       (not (looking-at parsep)))
+                (or (not (looking-at parstart))
+                    (and use-hard-newlines
+                         (not (get-text-property (1- start) 'hard)))))
+      (forward-char 1))
+
+    (if (< (point) (point-max))
+        (goto-char start))))
+@end ignore
 
-@node fwd-para no fill prefix, fwd-para with fill prefix, fwd-para within paragraph, forward-paragraph
-@unnumberedsubsec No fill prefix
+This part handles three situations: when point is between paragraphs,
+when there is a fill prefix and when there is no fill prefix.
 
-It is simplest to look at the code for the case when there is no fill
-prefix first.  This code consists of yet another inner @code{if}
-expression, and reads as follows:
+@need 800
+The @code{while} loop looks like this:
 
 @smallexample
 @group
-(if (re-search-forward paragraph-start nil t)
-    (goto-char (match-beginning 0))
-  (goto-char (point-max)))
-@end group
-@end smallexample
+;; @r{going forwards and not at the end of the buffer}
+(while (and (> arg 0) (not (eobp)))
 
-@noindent
-This expression actually does the work that most people think of as
-the primary purpose of the @code{forward-paragraph} command: it causes
-a regular expression search to occur that searches forward to the
-start of the next paragraph and if it is found, moves point there; but
-if the start of another paragraph if not found, it moves point to the
-end of the accessible region of the buffer.
+  ;; @r{between paragraphs}
+  ;; Move forward over separator lines...
+  (while (and (not (eobp))
+              (progn (move-to-left-margin) (not (eobp)))
+              (looking-at parsep))
+    (forward-line 1))
+  ;;  @r{This decrements the loop}
+  (unless (eobp) (setq arg (1- arg)))
+  ;; ... and one more line.
+  (forward-line 1)
+@end group
 
-The only unfamiliar part of this is the use of @code{match-beginning}.
-This is another function that is new to us.  The
-@code{match-beginning} function returns a number specifying the
-location of the start of the text that was matched by the last regular
-expression search.
+@group
+  (if fill-prefix-regexp
+      ;; There is a fill prefix; it overrides parstart;
+      ;; we go forward line by line
+      (while (and (not (eobp))
+                  (progn (move-to-left-margin) (not (eobp)))
+                  (not (looking-at parsep))
+                  (looking-at fill-prefix-regexp))
+        (forward-line 1))
+@end group
 
-The @code{match-beginning} function is used here because of a
-characteristic of a forward search: a successful forward search,
-regardless of whether it is a plain search or a regular expression
-search, will move point to the end of the text that is found.  In this
-case, a successful search will move point to the end of the pattern for
-@code{paragraph-start}, which will be the beginning of the next
-paragraph rather than the end of the current one.
+@group
+    ;; There is no fill prefix;
+    ;; we go forward character by character
+    (while (and (re-search-forward sp-parstart nil 1)
+                (progn (setq start (match-beginning 0))
+                       (goto-char start)
+                       (not (eobp)))
+                (progn (move-to-left-margin)
+                       (not (looking-at parsep)))
+                (or (not (looking-at parstart))
+                    (and use-hard-newlines
+                         (not (get-text-property (1- start) 'hard)))))
+      (forward-char 1))
+@end group
 
-However, we want to put point at the end of the current paragraph, not at
-the beginning of the next one.  The two positions may be different,
-because there may be several blank lines between paragraphs.
+@group
+    ;; and if there is no fill prefix and if we are not at the end,
+    ;;     go to whatever was found in the regular expression search
+    ;;     for sp-parstart
+    (if (< (point) (point-max))
+        (goto-char start))))
+@end group
+@end smallexample
 
-@findex match-beginning
-When given an argument of 0, @code{match-beginning} returns the position
-that is the start of the text that the most recent regular
-expression search matched.  In this case, the most recent regular
-expression search is the one looking for @code{paragraph-start}, so
-@code{match-beginning} returns the beginning position of the pattern,
-rather than the end of the pattern.  The beginning position is the end
-of the paragraph.
+@findex eobp
+We can see that this is a decrementing counter @code{while} loop,
+using the expression @code{(setq arg (1- arg))} as the decrementer.
+That expression is not far from the @code{while}, but is hidden in
+another Lisp macro, an @code{unless} macro.  Unless we are at the end
+of the buffer --- that is what the @code{eobp} function determines; it
+is an abbreviation of @samp{End Of Buffer P} --- we decrease the value
+of @code{arg} by one.
+
+(If we are at the end of the buffer, we cannot go forward any more and
+the next loop of the @code{while} expression will test false since the
+test is an @code{and} with @code{(not (eobp))}.  The @code{not}
+function means exactly as you expect; it is another name for
+@code{null}, a function that returns true when its argument is false.)
+
+Interestingly, the loop count is not decremented until we leave the
+space between paragraphs, unless we come to the end of buffer or stop
+seeing the local value of the paragraph separator.
+
+That second @code{while} also has a @code{(move-to-left-margin)}
+expression.  The function is self-explanatory.  It is inside a
+@code{progn} expression and not the last element of its body, so it is
+only invoked for its side effect, which is to move point to the left
+margin of the current line.
 
-(Incidentally, when passed a positive number as an argument, the
-@code{match-beginning} function will place point at that parenthesized
-expression in the last regular expression.  It is a useful function.)
+@findex looking-at
+The @code{looking-at} function is also self-explanatory; it returns
+true if the text after point matches the regular expression given as
+its argument.
 
-@node fwd-para with fill prefix, fwd-para summary, fwd-para no fill prefix, forward-paragraph
-@unnumberedsubsec With a fill prefix
+The rest of the body of the loop looks difficult at first, but makes
+sense as you come to understand it.
 
-The inner @code{if} expression just discussed is the else-part of an enclosing
-@code{if} expression which tests whether there is a fill prefix.  If
-there is a fill prefix, the then-part of this @code{if} is evaluated.
-It looks like this:
+@need 800
+First consider what happens if there is a fill prefix:
 
 @smallexample
 @group
-(while (and (not (eobp))
-            (not (looking-at paragraph-separate))
-            (looking-at fill-prefix-regexp))
-  (forward-line 1))
+  (if fill-prefix-regexp
+      ;; There is a fill prefix; it overrides parstart;
+      ;; we go forward line by line
+      (while (and (not (eobp))
+                  (progn (move-to-left-margin) (not (eobp)))
+                  (not (looking-at parsep))
+                  (looking-at fill-prefix-regexp))
+        (forward-line 1))
 @end group
 @end smallexample
 
 @noindent
-What this expression does is move point forward line by line so long
-as three conditions are true:
+This expression moves point forward line by line so long
+as four conditions are true:
 
 @enumerate
 @item
 Point is not at the end of the buffer.
 
+@item
+We can move to the left margin of the text and are
+not at the end of the buffer.
+
 @item
 The text following point does not separate paragraphs.
 
@@ -12526,101 +13468,93 @@ moved to the beginning of the line early in the @code{forward-paragraph}
 function.  This means that if the text has a fill prefix, the
 @code{looking-at} function will see it.
 
-@node fwd-para summary,  , fwd-para with fill prefix, forward-paragraph
-@unnumberedsubsec Summary
-
-In summary, when moving forward, the @code{forward-paragraph} function
-does the following:
+@need 1250
+Consider what happens when there is no fill prefix.
 
-@itemize @bullet
-@item
-Move point to the beginning of the line.
+@smallexample
+@group
+    (while (and (re-search-forward sp-parstart nil 1)
+                (progn (setq start (match-beginning 0))
+                       (goto-char start)
+                       (not (eobp)))
+                (progn (move-to-left-margin)
+                       (not (looking-at parsep)))
+                (or (not (looking-at parstart))
+                    (and use-hard-newlines
+                         (not (get-text-property (1- start) 'hard)))))
+      (forward-char 1))
+@end group
+@end smallexample
 
-@item
-Skip over lines between paragraphs.
+@noindent
+This @code{while} loop has us searching forward for
+@code{sp-parstart}, which is the combination of possible whitespace
+with a the local value of the start of a paragraph or of a paragraph
+separator.  (The latter two are within an expression starting
+@code{\(?:} so that they are not referenced by the
+@code{match-beginning} function.)
 
-@item
-Check whether there is a fill prefix, and if there is:
+@need 800
+The two expressions,
 
-@itemize ---
+@smallexample
+@group
+(setq start (match-beginning 0))
+(goto-char start)
+@end group
+@end smallexample
 
-@item
-Go forward line by line so long as the line is not a paragraph
-separating line.
-@end itemize
+@noindent
+mean go to the start of the text matched by the regular expression
+search.
 
-@item
-But if there is no fill prefix,
+The @code{(match-beginning 0)} expression is new.  It returns a number
+specifying the location of the start of the text that was matched by
+the last search.
 
-@itemize ---
+The @code{match-beginning} function is used here because of a
+characteristic of a forward search: a successful forward search,
+regardless of whether it is a plain search or a regular expression
+search, moves point to the end of the text that is found.  In this
+case, a successful search moves point to the end of the pattern for
+@code{sp-parstart}.
 
-@item
-Search for the next paragraph start pattern.
+However, we want to put point at the end of the current paragraph, not
+somewhere else.  Indeed, since the search possibly includes the
+paragraph separator, point may end up at the beginning of the next one
+unless we use an expression that includes @code{match-beginning}.
 
-@item
-Go to the beginning of the paragraph start pattern, which will be the
-end of the previous paragraph.
+@findex match-beginning
+When given an argument of 0, @code{match-beginning} returns the
+position that is the start of the text matched by the most recent
+search.  In this case, the most recent search looks for
+@code{sp-parstart}.  The @code{(match-beginning 0)} expression returns
+the beginning position of that pattern, rather than the end position
+of that pattern.
 
-@item
-Or else go to the end of the accessible portion of the buffer.
-@end itemize
-@end itemize
+(Incidentally, when passed a positive number as an argument, the
+@code{match-beginning} function returns the location of point at that
+parenthesized expression in the last search unless that parenthesized
+expression begins with @code{\(?:}.  I don't know why @code{\(?:}
+appears here since the argument is 0.)
 
-@need 1200
-For review, here is the code we have just been discussing, formatted
-for clarity:
+@need 1250
+The last expression when there is no fill prefix is
 
 @smallexample
 @group
-(interactive "p")
-(or arg (setq arg 1))
-(let* (
-       (fill-prefix-regexp
-        (and fill-prefix (not (equal fill-prefix ""))
-             (not paragraph-ignore-fill-prefix)
-             (regexp-quote fill-prefix)))
-@end group
-
-@group
-       (paragraph-separate
-        (if fill-prefix-regexp
-            (concat paragraph-separate
-                    "\\|^"
-                    fill-prefix-regexp
-                    "[ \t]*$")
-          paragraph-separate)))
-
-  @var{omitted-backward-moving-code} @dots{}
-@end group
-
-@group
-  (while (> arg 0)                ; @r{forward-moving-code}
-    (beginning-of-line)
-
-    (while (prog1 (and (not (eobp))
-                       (looking-at paragraph-separate))
-             (forward-line 1)))
-@end group
-
-@group
-    (if fill-prefix-regexp
-        (while (and (not (eobp))  ; @r{then-part}
-                    (not (looking-at paragraph-separate))
-                    (looking-at fill-prefix-regexp))
-          (forward-line 1))
-@end group
-@group
-                                  ; @r{else-part: the inner-if}
-      (if (re-search-forward paragraph-start nil t)
-          (goto-char (match-beginning 0))
-        (goto-char (point-max))))
-
-    (setq arg (1- arg)))))        ; @r{decrementer}
+(if (< (point) (point-max))
+    (goto-char start))))
 @end group
 @end smallexample
 
+@noindent
+This says that if there is no fill prefix and if we are not at the
+end, point should move to the beginning of whatever was found by the
+regular expression search for @code{sp-parstart}.
+
 The full definition for the @code{forward-paragraph} function not only
-includes this code for going forwards, but also code for going backwards.
+includes code for going forwards, but also code for going backwards.
 
 If you are reading this inside of GNU Emacs and you want to see the
 whole function, you can type @kbd{C-h f} (@code{describe-function})
@@ -12631,29 +13565,27 @@ key; you will be taken directly to the source.  (Be sure to install
 your sources!  Without them, you are like a person who tries to drive
 a car with his eyes shut!)
 
-@c !!! again, 21.0.100 tags table location in this paragraph
-Or -- a good habit to get into -- you can type @kbd{M-.}
-(@code{find-tag}) and the name of the function when prompted for it.
-This will take you directly to the source.  If the @code{find-tag}
-function first asks you for the name of a @file{TAGS} table, give it
-the name of the @file{TAGS} file such as
-@file{/usr/local/share/emacs/21.0.100/lisp/TAGS}.  (The exact path to your
-@file{TAGS} file depends on how your copy of Emacs was installed.)
-
-You can also create your own @file{TAGS} file for directories that
-lack one.
-@ifnottex
-@xref{etags, , Create Your Own @file{TAGS} File}.
-@end ifnottex
-
 @node etags, Regexp Review, forward-paragraph, Regexp Search
 @section Create Your Own @file{TAGS} File
 @findex etags
 @cindex @file{TAGS} file, create own
 
-The @kbd{M-.} (@code{find-tag}) command takes you directly to the
-source for a function, variable, node, or other source.  The function
-depends on tags tables to tell it where to go.
+Besides @kbd{C-h f} (@code{describe-function}), another way to see the
+source of a function is to type @kbd{M-.} (@code{find-tag}) and the
+name of the function when prompted for it.  This is a good habit to
+get into.  The @kbd{M-.} (@code{find-tag}) command takes you directly
+to the source for a function, variable, or node.  The function depends
+on tags tables to tell it where to go.
+
+If the @code{find-tag} function first asks you for the name of a
+@file{TAGS} table, give it the name of a @file{TAGS} file such as
+@file{/usr/local/src/emacs/src/TAGS}.  (The exact path to your
+@file{TAGS} file depends on how your copy of Emacs was installed.  I
+just told you the location that provides both my C and my Emacs Lisp
+sources.)
+
+You can also create your own @file{TAGS} file for directories that
+lack one.
 
 You often need to build and install tags tables yourself.  They are
 not built automatically.  A tags table is called a @file{TAGS} file;
@@ -12676,7 +13608,7 @@ M-x compile RET etags *.el RET
 @end smallexample
 
 @noindent
-to create a @file{TAGS} file.
+to create a @file{TAGS} file for Emacs Lisp.
 
 For example, if you have a large number of files in your
 @file{~/emacs} directory, as I do---I have 137 @file{.el} files in it,
@@ -12684,11 +13616,10 @@ of which I load 12---you can create a @file{TAGS} file for the Emacs
 Lisp files in that directory.
 
 @need 1250
-The @code{etags} program takes all the
-usual shell `wildcards'.  For example, if you have two directories for
-which you want a single @file{TAGS file}, type
-@w{@code{etags *.el ../elisp/*.el}},
-where @file{../elisp/} is the second directory:
+The @code{etags} program takes all the usual shell `wildcards'.  For
+example, if you have two directories for which you want a single
+@file{TAGS} file, type @w{@code{etags *.el ../elisp/*.el}}, where
+@file{../elisp/} is the second directory:
 
 @smallexample
 M-x compile RET etags *.el ../elisp/*.el RET
@@ -12706,10 +13637,11 @@ to see a list of the options accepted by @code{etags} as well as a
 list of supported languages.
 
 The @code{etags} program handles more than 20 languages, including
-Emacs Lisp, Common Lisp, Scheme, C, C++, Ada, Fortran, Java, LaTeX,
-Pascal, Perl, Python, Texinfo, makefiles, and most assemblers.  The
-program has no switches for specifying the language; it recognizes the
-language in an input file according to its file name and contents.
+Emacs Lisp, Common Lisp, Scheme, C, C++, Ada, Fortran, HTML, Java,
+LaTeX, Pascal, Perl, Postscript, Python, TeX, Texinfo, makefiles, and
+most assemblers.  The program has no switches for specifying the
+language; it recognizes the language in an input file according to its
+file name and contents.
 
 @file{etags} is very helpful when you are writing code yourself and
 want to refer back to functions you have already written.  Just run
@@ -12720,11 +13652,11 @@ If you think an appropriate @file{TAGS} file already exists for what
 you want, but do not know where it is, you can use the @code{locate}
 program to attempt to find it.
 
-Type @w{@kbd{M-x locate RET TAGS RET}} and Emacs will list for you the
-full path names of all your @file{TAGS} files.  On my system, this
-command lists 34 @file{TAGS} files.  On the other hand, a `plain
-vanilla' system I recently installed did not contain any @file{TAGS}
-files.
+Type @w{@kbd{M-x locate @key{RET} TAGS @key{RET}}} and Emacs will list
+for you the full path names of all your @file{TAGS} files.  On my
+system, this command lists 34 @file{TAGS} files.  On the other hand, a
+`plain vanilla' system I recently installed did not contain any
+@file{TAGS} files.
 
 If the tags table you want has been created, you can use the @code{M-x
 visit-tags-table} command to specify it.  Otherwise, you will need to
@@ -12739,8 +13671,8 @@ visit-tags-table}.
 The GNU Emacs sources come with a @file{Makefile} that contains a
 sophisticated @code{etags} command that creates, collects, and merges
 tags tables from all over the Emacs sources and puts the information
-into one @file{TAGS} file in the @file{src/} directory below the top
-level of your Emacs source directory.
+into one @file{TAGS} file in the @file{src/} directory. (The
+@file{src/} directory is below the top level of your Emacs directory.)
 
 @need 1250
 To build this @file{TAGS} file, go to the top level of your Emacs
@@ -12784,6 +13716,7 @@ For example:
              nil
 @end group
 @end smallexample
+
 @noindent
 (The @code{insert} function inserts its arguments at point; the
 @code{format} function returns a string formatted from its arguments
@@ -12800,6 +13733,7 @@ Takes four arguments, like @code{search-forward}:
 @enumerate
 @item
 A regular expression that specifies the pattern to search for.
+(Remember to put quotation marks around this argument!)
 
 @item
 Optionally, the limit of the search.
@@ -12844,20 +13778,6 @@ Return @code{t} for true if point is at the end of the accessible part
 of a buffer.  The end of the accessible part is the end of the buffer
 if the buffer is not narrowed; it is the end of the narrowed part if
 the buffer is narrowed.
-
-@item prog1
-Evaluate each argument in sequence and then return the value of the
-@emph{first}.
-
-@need 1250
-For example:
-
-@smallexample
-@group
-(prog1 1 2 3 4)
-     @result{} 1
-@end group
-@end smallexample
 @end table
 
 @need 1500
@@ -12928,8 +13848,8 @@ the Emacs tradition encourages flexibility---you may want to count
 words in just a section, rather than all of a buffer.  So it makes
 more sense to design the command to count the number of words in a
 region.  Once you have a @code{count-words-region} command, you can,
-if you wish, count words in a whole buffer by marking it with @kbd{C-x
-h} (@code{mark-whole-buffer}).
+if you wish, count words in a whole buffer by marking it with
+@w{@kbd{C-x h}} (@code{mark-whole-buffer}).
 
 Clearly, counting words is a repetitive act: starting from the
 beginning of the region, you count the first word, then the second
@@ -13043,11 +13963,13 @@ The search expression looks like this:
 
 @noindent
 (Note that paired backslashes precede the @samp{w} and @samp{W}.  A
-single backslash has special meaning to the Emacs Lisp interpreter.  It
-indicates that the following character is interpreted differently than
-usual.  For example, the two characters, @samp{\n}, stand for
+single backslash has special meaning to the Emacs Lisp interpreter.
+It indicates that the following character is interpreted differently
+than usual.  For example, the two characters, @samp{\n}, stand for
 @samp{newline}, rather than for a backslash followed by @samp{n}.  Two
-backslashes in a row stand for an ordinary, `unspecial' backslash.)
+backslashes in a row stand for an ordinary, `unspecial' backslash, so
+Emacs Lisp interpreter ends of seeing a single backslash followed by a
+letter.  So it discovers the letter is special.)
 
 We need a counter to count how many words there are; this variable
 must first be set to 0 and then incremented each time Emacs goes
@@ -13312,21 +14234,21 @@ the @code{while} loop as the true-or-false-test, like this:
 @iftex
 @noindent
 (For information about @code{and}, see
-@ref{forward-paragraph, , @code{forward-paragraph}: a Goldmine of
-Functions}.)
+@ref{kill-new function, , The @code{kill-new} function}.)
 @end iftex
 @ifinfo
 @noindent
-(@xref{forward-paragraph}, for information about @code{and}.)
+(@xref{kill-new function, , The @code{kill-new} function}, for
+information about @code{and}.)
 @end ifinfo
 
 The @code{re-search-forward} expression returns @code{t} if the search
 succeeds and as a side effect moves point.  Consequently, as words are
-found, point is moved through the region.  When the search
-expression fails to find another word, or when point reaches the end
-of the region, the true-or-false-test tests false, the @code{while}
-loop exists, and the @code{count-words-region} function displays one
-or other of its messages.
+found, point is moved through the region.  When the search expression
+fails to find another word, or when point reaches the end of the
+region, the true-or-false-test tests false, the @code{while} loop
+exits, and the @code{count-words-region} function displays one or
+other of its messages.
 
 After incorporating these final changes, the @code{count-words-region}
 works without bugs (or at least, without bugs that I have found!).
@@ -13590,6 +14512,7 @@ point forward by one word, and since a recursive call is made for
 each word, the counting mechanism must be an expression that adds one
 to the value returned by a call to @code{recursive-count-words}.
 
+@need 800
 Consider several cases:
 
 @itemize @bullet
@@ -14161,7 +15084,7 @@ several definitions within a single file.
 @node Several defuns, Find a File, count-words-in-defun, Words in a defun
 @section Count Several @code{defuns} Within a File
 
-A file such as @file{simple.el} may have 80 or more function
+A file such as @file{simple.el} may have a hundred or more function
 definitions within it.  Our long term goal is to collect statistics on
 many files, but as a first step, our immediate goal is to collect
 statistics on one file.
@@ -14223,9 +15146,7 @@ command.  This command is almost, but not quite right for the lengths
 problem.
 
 @need 1200
-Let's look at the source for @code{find-file} (you can use the
-@code{find-tag} command or @kbd{C-h f} (@code{describe-function}) to
-find the source of a function):
+Let's look at the source for @code{find-file}:
 
 @smallexample
 @group
@@ -14238,18 +15159,54 @@ creating one if none already exists."
 @end group
 @end smallexample
 
-The definition possesses short but complete documentation and an
-interactive specification that prompts you for a file name when you
-use the command interactively.  The body of the definition contains
-two functions, @code{find-file-noselect} and @code{switch-to-buffer}.
+@noindent
+(The most recent version of the @code{find-file} function definition
+permits you to specify optional wildcards to visit multiple files; that
+makes the definition more complex and we will not discuss it here,
+since it is not relevant.  You can see its source using either
+@kbd{M-.} (@code{find-tag}) or @kbd{C-h f} (@code{describe-function}).)
+
+@ignore
+In Emacs 22
+(defun find-file (filename &optional wildcards)
+  "Edit file FILENAME.
+Switch to a buffer visiting file FILENAME,
+creating one if none already exists.
+Interactively, the default if you just type RET is the current directory,
+but the visited file name is available through the minibuffer history:
+type M-n to pull it into the minibuffer.
+
+Interactively, or if WILDCARDS is non-nil in a call from Lisp,
+expand wildcards (if any) and visit multiple files.  You can
+suppress wildcard expansion by setting `find-file-wildcards' to nil.
+
+To visit a file without any kind of conversion and without
+automatically choosing a major mode, use \\[find-file-literally]."
+  (interactive (find-file-read-args "Find file: " nil))
+  (let ((value (find-file-noselect filename nil nil wildcards)))
+    (if (listp value)
+        (mapcar 'switch-to-buffer (nreverse value))
+      (switch-to-buffer value))))
+@end ignore
+
+The definition I am showing possesses short but complete documentation
+and an interactive specification that prompts you for a file name when
+you use the command interactively.  The body of the definition
+contains two functions, @code{find-file-noselect} and
+@code{switch-to-buffer}.
 
 According to its documentation as shown by @kbd{C-h f} (the
 @code{describe-function} command), the @code{find-file-noselect}
 function reads the named file into a buffer and returns the buffer.
-However, the buffer is not selected.  Emacs does not switch its
-attention (or yours if you are using @code{find-file-noselect}) to the
-named buffer.  That is what @code{switch-to-buffer} does: it switches
-the buffer to which Emacs attention is directed; and it switches the
+(Its most recent version includes an optional wildcards argument,
+too, as well as another to read a file literally and an other you
+suppress warning messages.  These optional arguments are irrelevant.)
+
+However, the @code{find-file-noselect} function does not select the
+buffer in which it puts the file.  Emacs does not switch its attention
+(or yours if you are using @code{find-file-noselect}) to the selected
+buffer.  That is what @code{switch-to-buffer} does: it switches the
+buffer to which Emacs attention is directed; and it switches the
 buffer displayed in the window to the new buffer.  We have discussed
 buffer switching elsewhere.  (@xref{Switching Buffers}.)
 
@@ -14261,7 +15218,7 @@ program to a different buffer but does not redisplay it on the screen.
 So instead of calling on @code{find-file} to do the job, we must write
 our own expression.
 
-The task is easy: use  @code{find-file-noselect} and @code{set-buffer}.
+The task is easy: use @code{find-file-noselect} and @code{set-buffer}.
 
 @node lengths-list-file, Several files, Find a File, Words in a defun
 @section @code{lengths-list-file} in Detail
@@ -14324,10 +15281,10 @@ and symbols in a function definition should change the buffer.
 Besides, the buffer is not going to be saved, even if it were changed.
 This line is entirely the consequence of great, perhaps excessive,
 caution.  The reason for the caution is that this function and those
-it calls work on the sources for Emacs and it is very inconvenient if
-they are inadvertently modified.  It goes without saying that I did
-not realize a need for this line until an experiment went awry and
-started to modify my Emacs source files @dots{}
+it calls work on the sources for Emacs and it is inconvenient if they
+are inadvertently modified.  It goes without saying that I did not
+realize a need for this line until an experiment went awry and started
+to modify my Emacs source files @dots{}
 
 Next comes a call to widen the buffer if it is narrowed.  This
 function is usually not needed---Emacs creates a fresh buffer if none
@@ -14345,10 +15302,10 @@ carried out.  In the loop, Emacs determines the length of each
 definition and constructs a lengths' list containing the information.
 
 Emacs kills the buffer after working through it.  This is to save
-space inside of Emacs.  My version of Emacs 19 contained over 300
-source files of interest; Emacs 21 contains over 800 source files.
-Another function will apply @code{lengths-list-file} to each of the
-files.
+space inside of Emacs.  My version of GNU Emacs 19 contained over 300
+source files of interest; GNU Emacs 22 contains over a thousand source
+files.  Another function will apply @code{lengths-list-file} to each
+of the files.
 
 Finally, the last expression within the @code{let} expression is the
 @code{lengths-list} variable; its value is returned as the value of
@@ -14358,20 +15315,15 @@ You can try this function by installing it in the usual fashion.  Then
 place your cursor after the following expression and type @kbd{C-x
 C-e} (@code{eval-last-sexp}).
 
-@c !!! 21.0.100 lisp sources location here
+@c !!! 22.1.1 lisp sources location here
 @smallexample
 (lengths-list-file
- "/usr/local/share/emacs/21.0.100/lisp/emacs-lisp/debug.el")
+ "/usr/local/share/emacs/22.1.1/lisp/emacs-lisp/debug.el")
 @end smallexample
 
-@c was: (lengths-list-file "../lisp/debug.el")
-@c !!!  as of 21, Info file is in
-@c /usr/share/info/emacs-lisp-intro.info.gz
-@c but debug.el is in  /usr/local/share/emacs/21.0.100/lisp/emacs-lisp/debug.el
-
 @noindent
-(You may need to change the pathname of the file; the one here worked
-with GNU Emacs version 21.0.100.  To change the expression, copy it to
+(You may need to change the pathname of the file; the one here is for
+GNU Emacs version 22.1.1.  To change the expression, copy it to
 the @file{*scratch*} buffer and edit it.
 
 @need 1200
@@ -14384,15 +15336,15 @@ version, you may have to evaluate the following:
 @end smallexample
 
 @noindent
-(@xref{defcustom, , Specifying Variables using @code{defcustom}}.)
+(@xref{defcustom, , Specifying Variables using @code{defcustom}}.
 Then evaluate the @code{lengths-list-file} expression.)
 
 @need 1200
 The lengths' list for @file{debug.el} takes less than a second to
-produce and looks like this:
+produce and looks like this in GNU Emacs 22:
 
 @smallexample
-(77 95 85 87 131 89 50 25 44 44 68 35 64 45 17 34 167 457)
+(83 113 105 144 289 22 30 97 48 89 25 52 52 88 28 29 77 49 43 290 232 587)
 @end smallexample
 
 @need 1500
@@ -14403,7 +15355,7 @@ took seven seconds to produce and looked like this:
 (75 41 80 62 20 45 44 68 45 12 34 235)
 @end smallexample
 
-(The newer version of  @file{debug.el} contains more defuns than the
+(The newer version of @file{debug.el} contains more defuns than the
 earlier one; and my new machine is much faster than the old one.)
 
 Note that the length of the last definition in the file is first in
@@ -14496,14 +15448,14 @@ These considerations lead us directly to the function itself:
 @end smallexample
 
 @code{expand-file-name} is a built-in function that converts a file
-name to the absolute, long, path name form of the directory in which
-the function is called.
+name to the absolute, long, path name form.  The function employs the
+name of the directory in which the function is called.
 
-@c !!! 21.0.100 lisp sources location here
+@c !!! 22.1.1 lisp sources location here
 @need 1500
 Thus, if @code{expand-file-name} is called on @code{debug.el} when
 Emacs is visiting the
-@file{/usr/local/share/emacs/21.0.100/lisp/emacs-lisp/} directory,
+@file{/usr/local/share/emacs/22.1.1/lisp/emacs-lisp/} directory,
 
 @smallexample
 debug.el
@@ -14513,9 +15465,9 @@ debug.el
 @noindent
 becomes
 
-@c !!! 21.0.100 lisp sources location here
+@c !!! 22.1.1 lisp sources location here
 @smallexample
-/usr/local/share/emacs/21.0.100/lisp/emacs-lisp/debug.el
+/usr/local/share/emacs/22.1.1/lisp/emacs-lisp/debug.el
 @end smallexample
 
 The only other new element of this function definition is the as yet
@@ -14604,21 +15556,21 @@ in their customary places.  To change the expressions, copy them to
 the @file{*scratch*} buffer, edit them, and then evaluate them.
 
 The results are shown after the @samp{@result{}}.  (These results are
-for files from Emacs Version 21.0.100; files from other versions of
+for files from Emacs version 22.1.1; files from other versions of
 Emacs may produce different results.)
 
-@c !!! 21.0.100 lisp sources location here
+@c !!! 22.1.1 lisp sources location here
 @smallexample
 @group
-(cd "/usr/local/share/emacs/21.0.100/")
+(cd "/usr/local/share/emacs/22.1.1/")
 
 (lengths-list-file "./lisp/macros.el")
-     @result{} (273 263 456 90)
+     @result{} (283 263 480 90)
 @end group
 
 @group
 (lengths-list-file "./lisp/mail/mailalias.el")
-     @result{} (38 32 26 77 174 180 321 198 324)
+     @result{} (38 32 29 95 178 180 321 218 324)
 @end group
 
 @group
@@ -14627,11 +15579,11 @@ Emacs may produce different results.)
 @end group
 
 @group
-(recursive-lengths-list-many-files
- '("./lisp/macros.el"
-   "./lisp/mail/mailalias.el"
-   "./lisp/makesum.el"))
-       @result{} (273 263 456 90 38 32 26 77 174 180 321 198 324 85 181)
+  (recursive-lengths-list-many-files
  '("./lisp/macros.el"
+     "./lisp/mail/mailalias.el"
+     "./lisp/makesum.el"))
+       @result{} (283 263 480 90 38 32 29 95 178 180 321 218 324 85 181)
 @end group
 @end smallexample
 
@@ -14656,6 +15608,18 @@ In brief, we need to go through the lengths' list produced by the
 of defuns within each range of lengths, and produce a list of those
 numbers.
 
+@menu
+* Data for Display in Detail::
+* Sorting::                     Sorting lists.
+* Files List::                  Making a list of files.
+* Counting function definitions::
+@end menu
+
+@node Data for Display in Detail, Sorting, Prepare the data, Prepare the data
+@ifnottex
+@unnumberedsubsec The Data for Display in Detail
+@end ifnottex
+
 Based on what we have done before, we can readily foresee that it
 should not be too hard to write a function that `@sc{cdr}s' down the
 lengths' list, looks at each element, determines which length range it
@@ -14670,13 +15634,7 @@ inspecting a sorted list, we can discover the highest and lowest
 number, and thereby determine the largest and smallest length range
 that we will need.
 
-@menu
-* Sorting::                     Sorting lists.
-* Files List::                  Making a list of files.
-* Counting function definitions::
-@end menu
-
-@node Sorting, Files List, Prepare the data, Prepare the data
+@node Sorting, Files List, Data for Display in Detail, Prepare the data
 @subsection Sorting Lists
 @findex sort
 
@@ -14717,13 +15675,27 @@ Sorting the list returned by the
 @code{recursive-lengths-list-many-files} function is straightforward;
 it uses the @code{<} function:
 
+@ignore
+2006 Oct 29
+In GNU Emacs 22,  eval
+(progn
+  (cd "/usr/local/share/emacs/22.0.50/")
+  (sort
+   (recursive-lengths-list-many-files
+    '("./lisp/macros.el"
+      "./lisp/mail/mailalias.el"
+      "./lisp/makesum.el"))
+   '<))
+
+@end ignore
+
 @smallexample
 @group
 (sort
  (recursive-lengths-list-many-files
-  '("../lisp/macros.el"
-    "../lisp/mailalias.el"
-    "../lisp/makesum.el"))
+  '("./lisp/macros.el"
+    "./lisp/mailalias.el"
+    "./lisp/makesum.el"))
  '<)
 @end group
 @end smallexample
@@ -14733,7 +15705,7 @@ it uses the @code{<} function:
 which produces:
 
 @smallexample
-(85 86 116 122 154 176 179 265)
+(29 32 38 85 90 95 178 180 181 218 263 283 321 324 480)
 @end smallexample
 
 @noindent
@@ -14779,9 +15751,9 @@ as a list that looks like this (but with more elements):
 
 @smallexample
 @group
-("../lisp/macros.el"
- "../lisp/mail/rmail.el"
- "../lisp/makesum.el")
+("./lisp/macros.el"
+ "./lisp/mail/rmail.el"
+ "./lisp/makesum.el")
 @end group
 @end smallexample
 
@@ -14795,7 +15767,7 @@ for symbolic link (the string is the name linked to), or @code{nil}.
 
 For example, the first @samp{.el} file in the @file{lisp/} directory
 is @file{abbrev.el}.  Its name is
-@file{/usr/local/share/emacs/21.0.100/lisp/abbrev.el} and it is not a
+@file{/usr/local/share/emacs/22.1.1/lisp/abbrev.el} and it is not a
 directory or a symbolic link.
 
 @need 1000
@@ -14804,23 +15776,23 @@ its attributes:
 
 @smallexample
 @group
-("/usr/local/share/emacs/21.0.100/lisp/abbrev.el"
+("abbrev.el"
 nil
 1
 1000
 100
 @end group
 @group
-(15019 32380)
-(14883 48041)
-(15214 49336)
-11583
+(17733 259)
+(17491 28834)
+(17596 62124)
+13157
 "-rw-rw-r--"
 @end group
 @group
-t
-341385
-776)
+nil
+2971624
+773)
 @end group
 @end smallexample
 
@@ -14830,18 +15802,17 @@ directory.  The beginning of its listing looks like this:
 
 @smallexample
 @group
-("/usr/local/share/emacs/21.0.100/lisp/mail"
+("mail"
 t
 @dots{}
 )
 @end group
 @end smallexample
 
-(Look at the documentation of @code{file-attributes} to learn about
-the different attributes.  Bear in mind that the
-@code{file-attributes} function does not list the filename, so its
-first element is @code{directory-files-and-attributes}'s second
-element.)
+(To learn about the different attributes, look at the documentation of
+@code{file-attributes}.  Bear in mind that the @code{file-attributes}
+function does not list the filename, so its first element is
+@code{directory-files-and-attributes}'s second element.)
 
 We will want our new function, @code{files-in-below-directory}, to
 list the @samp{.el} files in the directory it is told to check, and in
@@ -14893,11 +15864,14 @@ pattern is `accumulate'
 using @code{append} as the combiner.
 
 @ignore
-(directory-files "/usr/local/share/emacs/21.0.100/lisp/" t "\\.el$")
-(shell-command "find /usr/local/share/emacs/21.0.100/lisp/ -name '*.el'")
+(directory-files "/usr/local/src/emacs/lisp/" t "\\.el$")
+(shell-command "find /usr/local/src/emacs/lisp/ -name '*.el'")
+
+(directory-files "/usr/local/share/emacs/22.1.1/lisp/" t "\\.el$")
+(shell-command "find /usr/local/share/emacs/22.1.1/lisp/ -name '*.el'")
 @end ignore
 
-@c  /usr/local/share/emacs/21.0.100/lisp/
+@c  /usr/local/share/emacs/22.1.1/lisp/
 
 @need 800
 Here is the function:
@@ -14909,7 +15883,7 @@ Here is the function:
   ;; Although the function will be used non-interactively,
   ;; it will be easier to test if we make it interactive.
   ;; The directory will have a name such as
-  ;;  "/usr/local/share/emacs/21.0.100/lisp/"
+  ;;  "/usr/local/share/emacs/22.1.1/lisp/"
   (interactive "DDirectory name: ")
 @end group
 @group
@@ -14953,7 +15927,8 @@ Here is the function:
 @end group
 @end smallexample
 
-@c (files-in-below-directory "/usr/local/share/emacs/21.0.100/lisp/")
+@c (files-in-below-directory "/usr/local/src/emacs/lisp/")
+@c (files-in-below-directory "/usr/local/share/emacs/22.1.1/lisp/")
 
 The @code{files-in-below-directory} @code{directory-files} function
 takes one argument, the name of a directory.
@@ -14961,16 +15936,18 @@ takes one argument, the name of a directory.
 @need 1250
 Thus, on my system,
 
-@c !!! 21.0.100 lisp sources location here
+@c (length (files-in-below-directory "/usr/local/src/emacs/lisp/"))
+
+@c !!! 22.1.1 lisp sources location here
 @smallexample
 @group
 (length
- (files-in-below-directory "/usr/local/share/emacs/21.0.100/lisp/"))
+ (files-in-below-directory "/usr/local/share/emacs/22.1.1/lisp/"))
 @end group
 @end smallexample
 
 @noindent
-tells me that my version 21.0.100 Lisp sources directory contains 754
+tells me that in and below my Lisp sources directory are 1031
 @samp{.el} files.
 
 @code{files-in-below-directory} returns a list in reverse alphabetical
@@ -14980,24 +15957,21 @@ like this:
 @smallexample
 @group
 (sort
- (files-in-below-directory "/usr/local/share/emacs/21.0.100/lisp/")
+ (files-in-below-directory "/usr/local/share/emacs/22.1.1/lisp/")
  'string-lessp)
 @end group
 @end smallexample
 
 @ignore
 (defun test ()
-  "Test how long it takes to find lengths of all elisp defuns."
+  "Test how long it takes to find lengths of all sorted elisp defuns."
   (insert "\n" (current-time-string) "\n")
   (sit-for 0)
   (sort
    (recursive-lengths-list-many-files
-    '("../lisp/macros.el"
-      "../lisp/mailalias.el"
-      "../lisp/makesum.el"))
+    (files-in-below-directory "/usr/local/src/emacs/lisp/"))
    '<)
   (insert (format "%s" (current-time-string))))
-
 @end ignore
 
 @node Counting function definitions,  , Files List, Prepare the data
@@ -15259,11 +16233,14 @@ of the @code{and} expression.
 @c colon in printed section title causes problem in Info cross reference
 This way, we avoid an error.
 @iftex
-@xref{forward-paragraph, , @code{forward-paragraph}: a Goldmine of
-Functions}, for more information about @code{and}.
+@noindent
+(For information about @code{and}, see
+@ref{kill-new function, , The @code{kill-new} function}.)
 @end iftex
 @ifinfo
-@xref{forward-paragraph}, for more information about @code{and}.
+@noindent
+(@xref{kill-new function, , The @code{kill-new} function}, for
+information about @code{and}.)
 @end ifinfo
 
 Here is a short test of the @code{defuns-per-range} function.  First,
@@ -15301,7 +16278,6 @@ between 120 and 129, and so on.  There are four elements with a value
 of 200 or larger.
 
 @c The next step is to turn this numbers' list into a graph.
-
 @node Readying a Graph, Emacs Initialization, Words in a defun, Top
 @chapter Readying a Graph
 @cindex Readying a graph
@@ -15363,7 +16339,7 @@ line by line, by typing.  We have two routes we can follow: write our
 own column-insertion function or discover whether one exists in Emacs.
 
 To see whether there is one in Emacs, we can use the @kbd{M-x apropos}
-command.  This command is like the @kbd{C-h a} (command-apropos)
+command.  This command is like the @kbd{C-h a} (@code{command-apropos})
 command, except that the latter finds only those functions that are
 commands.  The @kbd{M-x apropos} command lists all symbols that match
 a regular expression, including functions that are not interactive.
@@ -15374,9 +16350,11 @@ columns.  Very likely, the name of the function will contain either
 the word `print' or the word `insert' or the word `column'.
 Therefore, we can simply type @kbd{M-x apropos RET
 print\|insert\|column RET} and look at the result.  On my system, this
-command takes quite some time, and then produces a list of 79
-functions and variables.  Scanning down the list, the only function
-that looks as if it might do the job is @code{insert-rectangle}.
+command once too takes quite some time, and then produced a list of 79
+functions and variables.  Now it does not take much time at all and
+produces a list of 211 functions and variables.  Scanning down the
+list, the only function that looks as if it might do the job is
+@code{insert-rectangle}.
 
 @need 1200
 Indeed, this is the function we want; its documentation says:
@@ -15388,6 +16366,8 @@ Insert text of RECTANGLE with upper left corner at point.
 RECTANGLE's first line is inserted at point,
 its second line is inserted at a point vertically under point, etc.
 RECTANGLE should be a list of strings.
+After this command, the mark is at the upper left corner
+and point is at the lower right corner.
 @end group
 @end smallexample
 
@@ -15403,8 +16383,7 @@ point.  Also the function returns @code{nil}.
 @group
 (insert-rectangle '("first" "second" "third"))first
                                               second
-                                              third
-nil
+                                              thirdnil
 @end group
 @end smallexample
 
@@ -15418,12 +16397,14 @@ column of strings.
 
 If you are reading this in Info, you can see how this works by
 switching to another buffer, such as the @file{*scratch*} buffer,
-placing point somewhere in the buffer, typing @kbd{M-:},
-typing the @code{insert-rectangle} expression into the minibuffer at
-the prompt, and then typing @key{RET}.  This causes Emacs to evaluate
-the expression in the minibuffer, but to use as the value of point the
-position of point in the @file{*scratch*} buffer.  (@kbd{M-:}
-is the keybinding for @code{eval-expression}.)
+placing point somewhere in the buffer, typing @kbd{M-:}, typing the
+@code{insert-rectangle} expression into the minibuffer at the prompt,
+and then typing @key{RET}.  This causes Emacs to evaluate the
+expression in the minibuffer, but to use as the value of point the
+position of point in the @file{*scratch*} buffer.  (@kbd{M-:}  is the
+keybinding for @code{eval-expression}. Also, @code{nil} does not
+appear in the @file{*scratch*} buffer since the expression is
+evaluated in the minibuffer.)
 
 We find when we do this that point ends up at the end of the last
 inserted line---that is to say, this function moves point as a
@@ -15892,7 +16873,7 @@ The numbers-list consists of the Y-axis values."
 
 The recursive function is a little more difficult.  It has four parts:
 the `do-again-test', the printing code, the recursive call, and the
-`next-step-expression'.  The `do-again-test' is an @code{if}
+`next-step-expression'.  The `do-again-test' is a @code{when}
 expression that determines whether the @code{numbers-list} contains
 any remaining elements; if it does, the function prints one column of
 the graph using the printing code and calls itself again.  The
@@ -15909,8 +16890,7 @@ Used within recursive-graph-body-print function."
 @end group
 
 @group
-  (if numbers-list
-      (progn
+  (when numbers-list
         (setq from-position (point))
         (insert-rectangle
          (column-of-graph height (car numbers-list)))
@@ -15920,7 +16900,7 @@ Used within recursive-graph-body-print function."
         (forward-char symbol-width)
         (sit-for 0)     ; @r{Draw graph column by column.}
         (recursive-graph-body-print-internal
-         (cdr numbers-list) height symbol-width))))
+         (cdr numbers-list) height symbol-width)))
 @end group
 @end smallexample
 
@@ -15994,7 +16974,7 @@ expressions in Emacs Lisp you can change or extend Emacs.
 * Loading Files::               Load (i.e., evaluate) files automatically.
 * Autoload::                    Make functions available.
 * Simple Extension::            Define a function; bind it to a key.
-* X11 Colors::                  Colors in version 19 in X.
+* X11 Colors::                  Colors in X.
 * Miscellaneous::
 * Mode Line::                   How to customize your mode line.
 @end menu
@@ -16011,7 +16991,11 @@ Fundamental mode when you edit an unadorned file.  This all makes
 sense, if you do not know who is going to use Emacs.  Who knows what a
 person hopes to do with an unadorned file?  Fundamental mode is the
 right default for such a file, just as C mode is the right default for
-editing C code.  But when you do know who is going to use Emacs---you,
+editing C code.  (Enough programming languages have syntaxes
+that enable them to share or nearly share features, so C mode is
+now provided by by CC mode, the `C Collection'.)
+
+But when you do know who is going to use Emacs---you,
 yourself---then it makes sense to customize Emacs.
 
 For example, I seldom want Fundamental mode when I edit an
@@ -16141,7 +17125,7 @@ The @code{:type} keyword tells Emacs the kind of data to which
 Customization buffer.
 
 The @code{:options} keyword specifies a suggested list of values for
-the variable.  Currently, you can use @code{:options} only for a hook.
+the variable.  Usually, @code{:options} applies to a hook.
 The list is only a suggestion; it is not exclusive; a person who sets
 the variable may set it to other values; the list shown following the
 @code{:options} keyword is intended to offer convenient choices to a
@@ -16151,6 +17135,7 @@ Finally, the @code{:group} keyword tells the Emacs Customization
 command in which group the variable is located.  This tells where to
 find it.
 
+The @code{defcustom} function recognizes more than a dozen keywords.
 For more information, see @ref{Customization, , Writing Customization
 Definitions, elisp, The GNU Emacs Lisp Reference Manual}.
 
@@ -16169,8 +17154,8 @@ M-x customize
 @noindent
 and find that the group for editing files of data is called `data'.
 Enter that group.  Text Mode Hook is the first member.  You can click
-on its various options to set the values.  After you click on the
-button to
+on its various options, such as @code{turn-on-auto-fill}, to set the
+values.  After you click on the button to
 
 @smallexample
 Save for Future Sessions
@@ -16183,24 +17168,21 @@ It will look like this:
 @smallexample
 @group
 (custom-set-variables
-  ;; custom-set-variables was added by Custom --
-  ;;                           don't edit or cut/paste it!
+  ;; custom-set-variables was added by Custom.
+  ;; If you edit it by hand, you could mess it up, so be careful.
   ;; Your init file should contain only one such instance.
+  ;; If there is more than one, they won't work right.
  '(text-mode-hook (quote (turn-on-auto-fill text-mode-hook-identify))))
 @end group
 @end smallexample
 
 @noindent
 (The @code{text-mode-hook-identify} function tells
-@code{toggle-text-mode-auto-fill} which buffers are in Text mode.)
-
-In spite of the warning, you certainly may edit, cut, and paste the
-expression!  I do all time.  The purpose of the warning is to scare
-those who do not know what they are doing, so they do not
-inadvertently generate an error.
+@code{toggle-text-mode-auto-fill} which buffers are in Text mode.
+It comes on automatically.)
 
 The @code{custom-set-variables} function works somewhat differently
-than a @code{setq}.  While I have never learned the differences, I do
+than a @code{setq}.  While I have never learned the differences, I
 modify the @code{custom-set-variables} expressions in my @file{.emacs}
 file by hand:  I make the changes in what appears to me to be a
 reasonable manner and have not had any problems.  Others prefer to use
@@ -16221,7 +17203,7 @@ When you do this, and later use @code{customize}, you will see a
 message that says
 
 @smallexample
-this option has been changed outside the customize buffer.
+CHANGED outside Customize; operating on it here may be unreliable.
 @end smallexample
 
 @need 800
@@ -16246,6 +17228,15 @@ initialization file, which is usually called @file{.emacs}.
 I myself use @code{customize} for hardly anything.  Mostly, I write
 expressions myself.
 
+@findex defsubst
+@findex defconst
+Incidentally, to be more complete concerning defines:  @code{defsubst}
+defines an inline function.  The syntax is just like that of
+@code{defun}.  @code{defconst} defines a symbol as a constant.  The
+intent is that neither programs nor users should ever change a value
+set by @code{defconst}.  (You can change it; the value set is a
+variable; but please do not.)
+
 @node Beginning a .emacs File, Text and Auto-fill, defcustom, Emacs Initialization
 @section Beginning a @file{.emacs} File
 @cindex @file{.emacs} file, beginning of
@@ -16293,9 +17284,9 @@ adding to it ever since.
 @noindent
 This describes the usual conventions for comments in Emacs Lisp.
 Everything on a line that follows a semicolon is a comment.  Two,
-three, and four semicolons are used as section and subsection
-markers.  (@xref{Comments, ,, elisp, The GNU Emacs Lisp Reference
-Manual}, for more about comments.)
+three, and four semicolons are used as subsection and section markers.
+(@xref{Comments, ,, elisp, The GNU Emacs Lisp Reference Manual}, for
+more about comments.)
 
 @smallexample
 @group
@@ -16338,12 +17329,10 @@ Auto Fill mode.
 @smallexample
 @group
 ;;; Text mode and Auto Fill mode
-; The next three lines put Emacs into Text mode
+; The next two lines put Emacs into Text mode
 ; and Auto Fill mode, and are for writers who
 ; want to start writing prose rather than code.
-
 (setq default-major-mode 'text-mode)
-(add-hook 'text-mode-hook 'text-mode-hook-identify)
 (add-hook 'text-mode-hook 'turn-on-auto-fill)
 @end group
 @end smallexample
@@ -16404,33 +17393,28 @@ a value in your @file{.emacs} file and the procedure you use anywhere
 else in Emacs.
 
 @need 800
-Here are the next two lines:
+Here is the next line:
 
 @cindex Auto Fill mode turned on
 @findex add-hook
 @smallexample
-(add-hook 'text-mode-hook 'text-mode-hook-identify)
 (add-hook 'text-mode-hook 'turn-on-auto-fill)
 @end smallexample
 
 @noindent
-In these two lines, the @code{add-hook} command first adds
-@code{text-mode-hook-identify} to the variable called
-@code{text-mode-hook} and then adds @code{turn-on-auto-fill} to the
-variable.
+In this line, the @code{add-hook} command adds
+@code{turn-on-auto-fill} to the variable.
 
 @code{turn-on-auto-fill} is the name of a program, that, you guessed
-it!, turns on Auto Fill mode.  @code{text-mode-hook-identify} is a
-function that tells @code{toggle-text-mode-auto-fill} which buffers
-are in Text mode.
+it!, turns on Auto Fill mode.
 
 Every time Emacs turns on Text mode, Emacs runs the commands `hooked'
 onto Text mode.  So every time Emacs turns on Text mode, Emacs also
 turns on Auto Fill mode.
 
-In brief, the first line causes Emacs to enter Text mode when you edit
-a file, unless the file name extension, first non-blank line, or local
-variables tell Emacs otherwise.
+In brief, the first line causes Emacs to enter Text mode when you edit a
+file, unless the file name extension, a first non-blank line, or local
+variables to tell Emacs otherwise.
 
 Text mode among other actions, sets the syntax table to work
 conveniently for writers.  In Text mode, Emacs considers an apostrophe
@@ -16439,11 +17423,10 @@ or a space as part of a word.  Thus, @kbd{M-f} moves you over
 @samp{it's}.  On the other hand, in C mode, @kbd{M-f} stops just after
 the @samp{t} of @samp{it's}.
 
-The second and third lines causes Emacs to turn on Auto Fill mode when
-it turns on Text mode.  In Auto Fill mode, Emacs automatically breaks
-a line that is too wide and brings the excessively wide part of the
-line down to the next line.  Emacs breaks lines between words, not
-within them.
+The second line causes Emacs to turn on Auto Fill mode when it turns
+on Text mode.  In Auto Fill mode, Emacs automatically breaks a line
+that is too wide and brings the excessively wide part of the line down
+to the next line.  Emacs breaks lines between words, not within them.
 
 When Auto Fill mode is turned off, lines continue to the right as you
 type them.  Depending on how you set the value of
@@ -16471,7 +17454,6 @@ reminders.
 ; To enter mail mode, type `C-x m'
 ; To enter RMAIL (for reading mail),
 ; type `M-x rmail'
-
 (setq mail-aliases t)
 @end group
 @end smallexample
@@ -16531,6 +17513,7 @@ See sections ``Tabs vs.@: Spaces'' and ``Local Variables in
 Files'' in @cite{The GNU Emacs Manual}.
 @end iftex
 
+@need 1700
 @node Keybindings, Keymaps, Indent Tabs Mode, Emacs Initialization
 @section Some Keybindings
 
@@ -16558,13 +17541,14 @@ This also shows how to set a key globally, for all modes.
 The command is @code{global-set-key}.  It is followed by the
 keybinding.  In a @file{.emacs} file, the keybinding is written as
 shown: @code{\C-c} stands for `control-c', which means `press the
-control key and the @kbd{c} key at the same time'.  The @code{w} means
-`press the @kbd{w} key'.  The keybinding is surrounded by double
-quotation marks.  In documentation, you would write this as @kbd{C-c
-w}.  (If you were binding a @key{META} key, such as @kbd{M-c}, rather
-than a @key{CTL} key, you would write @code{\M-c}.  @xref{Init
-Rebinding, , Rebinding Keys in Your Init File, emacs, The GNU Emacs
-Manual}, for details.)
+control key and the @key{c} key at the same time'.  The @code{w} means
+`press the @key{w} key'.  The keybinding is surrounded by double
+quotation marks.  In documentation, you would write this as
+@w{@kbd{C-c w}}.  (If you were binding a @key{META} key, such as
+@kbd{M-c}, rather than a @key{CTRL} key, you would write
+@w{@code{\M-c}} in your @file{.emacs} file.  @xref{Init Rebinding, ,
+Rebinding Keys in Your Init File, emacs, The GNU Emacs Manual}, for
+details.)
 
 The command invoked by the keys is @code{compare-windows}.  Note that
 @code{compare-windows} is preceded by a single quote; otherwise, Emacs
@@ -16785,7 +17769,10 @@ Incidentally, @code{load-library} is an interactive interface to the
 (defun load-library (library)
   "Load the library named LIBRARY.
 This is an interface to the function `load'."
-  (interactive "sLoad library: ")
+  (interactive
+   (list (completing-read "Load library: "
+                          'locate-file-completion
+                          (cons load-path (get-load-suffixes)))))
   (load library))
 @end group
 @end smallexample
@@ -16822,12 +17809,12 @@ come to use a `rare' function frequently.  When you do, you should
 load that function's file with a @code{load} expression in your
 @file{.emacs} file.
 
-In my @file{.emacs} file for Emacs version 21, I load 12 libraries
-that contain functions that would otherwise be autoloaded.  (Actually,
-it would have been better to include these files in my `dumped' Emacs
-when I built it, but I forgot.  @xref{Building Emacs, , Building
-Emacs, elisp, The GNU Emacs Lisp Reference Manual}, and the @file{INSTALL}
-file for more about dumping.)
+In my @file{.emacs} file, I load 14 libraries that contain functions
+that would otherwise be autoloaded.  (Actually, it would have been
+better to include these files in my `dumped' Emacs, but I forgot.
+@xref{Building Emacs, , Building Emacs, elisp, The GNU Emacs Lisp
+Reference Manual}, and the @file{INSTALL} file for more about
+dumping.)
 
 You may also want to include autoloaded expressions in your @file{.emacs}
 file.  @code{autoload} is a built-in function that takes up to five
@@ -16850,8 +17837,8 @@ Here is a typical example:
 @end smallexample
 
 @noindent
-(@code{html-helper-mode} is an alternative to @code{html-mode}, which
-is a standard part of the distribution).
+(@code{html-helper-mode} is an older alternative to @code{html-mode},
+which is a standard part of the distribution.)
 
 @noindent
 This expression autoloads the @code{html-helper-mode} function.  It
@@ -16916,37 +17903,41 @@ Your Init File, emacs, The GNU Emacs Manual}.
 @cindex Conditional 'twixt two versions of Emacs
 @cindex Version of Emacs, choosing
 @cindex Emacs version, choosing
-If you run two versions of GNU Emacs, such as versions 20 and 21, and
+If you run two versions of GNU Emacs, such as versions 21 and 22, and
 use one @file{.emacs} file, you can select which code to evaluate with
 the following conditional:
 
 @smallexample
 @group
 (cond
- ((string-equal (number-to-string 20) (substring (emacs-version) 10 12))
-  ;; evaluate version 20 code
-  ( @dots{} ))
- ((string-equal (number-to-string 21) (substring (emacs-version) 10 12))
+ (= 21 emacs-major-version)
   ;; evaluate version 21 code
+  ( @dots{} ))
+ (= 22 emacs-major-version)
+  ;; evaluate version 22 code
   ( @dots{} )))
 @end group
 @end smallexample
 
-For example, in contrast to version 20, version 21 blinks its cursor
-by default.  I hate such blinking, as well as some other features in
-version 21, so I placed the following in my @file{.emacs}
+For example, in contrast to version 20, more recent versions blink
+their cursors by default.  I hate such blinking, as well as other
+features, so I placed the following in my @file{.emacs}
 file@footnote{When I start instances of Emacs that do not load my
 @file{.emacs} file or any site file, I also turn off blinking:
 
 @smallexample
 emacs -q --no-site-file -eval '(blink-cursor-mode nil)'
+
+@exdent Or nowadays, using an even more sophisticated set of options,
+
+emacs -Q - D
 @end smallexample
 }:
 
 @smallexample
 @group
-(if (string-equal "21" (substring (emacs-version) 10 12))
-    (progn
+(when (or (= 21 emacs-major-version)
+          (= 22 emacs-major-version))
       (blink-cursor-mode 0)
       ;; Insert newline when you press `C-n' (next-line)
       ;; at the end of the buffer
@@ -16972,19 +17963,25 @@ emacs -q --no-site-file -eval '(blink-cursor-mode nil)'
       ;; (Use numeric argument to turn on)
       (tooltip-mode nil)
       ;; If tooltips turned on, make tips appear promptly
-      (setq tooltip-delay 0.1)  ; default is one second
-       ))
+      (setq tooltip-delay 0.1)  ; default is 0.7 second
+       )
+@end group
+@end smallexample
+
+@need 1250
+Alternatively, since @code{blink-cursor-mode} has existed since Emacs
+version 21 and is likely to continue, you could write
+
+@smallexample
+@group
+(when (>= emacs-major-version 21)
+  (blink-cursor-mode 0)
 @end group
 @end smallexample
 
 @noindent
-(You will note that instead of typing @code{(number-to-string 21)}, I
-decided to save typing and wrote `21' as a string, @code{"21"}, rather
-than convert it from an integer to a string.  In this instance, this
-expression is better than the longer, but more general
-@code{(number-to-string 21)}.  However, if you do not know ahead of
-time what type of information will be returned, then the
-@code{number-to-string} function will be needed.)
+and add other expressions, too. 
+
 
 @node X11 Colors, Miscellaneous, Simple Extension, Emacs Initialization
 @section X11 Colors
@@ -17055,27 +18052,26 @@ Emacs*pointerColor: white
 @end smallexample
 
 In any event, since it is not part of Emacs, I set the root color of
-my X window in my @file{~/.xinitrc} file, like this@footnote{I
-occasionally run more modern window managers, such as Sawfish with
-GNOME, Enlightenment, SCWM, or KDE; in those cases, I often specify an
-image rather than a plain color.}:
+my X window in my @file{~/.xinitrc} file, like this@footnote{I also
+run more modern window managers, such as Enlightenment, Gnome, or KDE;
+in those cases, I often specify an image rather than a plain color.}:
 
 @smallexample
-@group
-# I use TWM for window manager.
 xsetroot -solid Navy -fg white &
-@end group
 @end smallexample
 
+@need 1700
 @node Miscellaneous, Mode Line, X11 Colors, Emacs Initialization
 @section Miscellaneous Settings for a @file{.emacs} File
 
+@need 1250
 Here are a few miscellaneous settings:
 @sp 1
 
 @itemize @minus
 @item
 Set the shape and color of the mouse cursor:
+
 @smallexample
 @group
 ; Cursor shapes are defined in
@@ -17099,8 +18095,34 @@ Set the shape and color of the mouse cursor:
 @end smallexample
 
 @item
-Convert @kbd{@key{CTL}-h} into @key{DEL} and @key{DEL}
-into @kbd{@key{CTL}-h}.@*
+Or you can set the values of a variety of features in an alist, like
+this:
+
+@smallexample
+@group
+(setq-default
+ default-frame-alist
+ '((cursor-color . "white")
+   (mouse-color . "white")
+   (foreground-color . "white")
+   (background-color . "DodgerBlue4")
+   ;; (cursor-type . bar)
+   (cursor-type . box)
+@end group
+@group
+   (tool-bar-lines . 0)
+   (menu-bar-lines . 1)
+   (width . 80)
+   (height . 58)
+   (font .
+         "-Misc-Fixed-Medium-R-Normal--20-200-75-75-C-100-ISO8859-1")
+   ))
+@end group
+@end smallexample
+
+@item
+Convert @kbd{@key{CTRL}-h} into @key{DEL} and @key{DEL}
+into @kbd{@key{CTRL}-h}.@*
 (Some older keyboards needed this, although I have not seen the
 problem recently.)
 
@@ -17123,20 +18145,30 @@ problem recently.)
 @end group
 @end smallexample
 
-@item  Ignore case when using `grep'@*
-@samp{-n}@w{  }   Prefix each line of output with line number@*
+@noindent
+or start GNU Emacs with the command @code{emacs -nbc}.
+
+@need 1250
+@item When using `grep'@*
 @samp{-i}@w{  }   Ignore case distinctions@*
+@samp{-n}@w{  }   Prefix each line of output with line number@*
+@samp{-H}@w{  }   Print the filename for each match.@*
 @samp{-e}@w{  }   Protect patterns beginning with a hyphen character, @samp{-}
 
 @smallexample
-(setq grep-command "grep  -n -i -e ")
+(setq grep-command "grep -i -nH -e ")
 @end smallexample
 
-@item Automatically uncompress compressed files when visiting them
+@ignore
+@c Evidently, no longer needed in GNU Emacs 22
 
-@smallexample
+item Automatically uncompress compressed files when visiting them
+
+smallexample
 (load "uncompress")
-@end smallexample
+end smallexample
+
+@end ignore
 
 @item Find an existing buffer, even if it has a different name@*
 This avoids problems with symbolic links.
@@ -17171,7 +18203,7 @@ If you want to write with Chinese `GB' characters, set this instead:
 @cindex Bindings, key, fixing unpleasant
 
 Some systems bind keys unpleasantly.  Sometimes, for example, the
-@key{CTL} key appears in an awkward spot rather than at the far left
+@key{CTRL} key appears in an awkward spot rather than at the far left
 of the home row.
 
 Usually, when people fix these sorts of keybindings, they do not
@@ -17187,9 +18219,7 @@ For a boot script:
 @smallexample
 @group
 loadkeys /usr/share/keymaps/i386/qwerty/emacs2.kmap.gz
-
 @exdent or
-
 install-keymap emacs2
 @end group
 @end smallexample
@@ -17222,6 +18252,7 @@ xmodmap -e "keysym Alt_L = Meta_L Alt_L"
 @end group
 @end smallexample
 
+@need 1700
 @node Mode Line,  , Miscellaneous, Emacs Initialization
 @section A Modified Mode Line
 @vindex default-mode-line-format
@@ -17305,8 +18336,8 @@ the old days, it would have been specified simply as @code{"-"}.  But
 nowadays, Emacs can add properties to a string, such as highlighting
 or, as in this case, a help feature.  If you place your mouse cursor
 over the hyphen, some help information appears (By default, you must
-wait one second before the information appears.  You can change that
-timing by changing the value of @code{tooltip-delay}.)
+wait seven-tenths of a second before the information appears.  You can
+change that timing by changing the value of @code{tooltip-delay}.)
 
 @need 1000
 The new string format has a special syntax:
@@ -17344,13 +18375,12 @@ this number.  (Buffer names can and often should be longer than 12
 characters; this length works well in a typical 80 column wide
 window.)
 
-@code{:eval} is a new feature in GNU Emacs version 21.  It says to
-evaluate the following form and use the result as a string to display.
-In this case, the expression displays the first component of the full
-system name.  The end of the first component is a @samp{.} (`period'),
-so I use the @code{string-match} function to tell me the length of the
-first component.  The substring from the zeroth character to that
-length is the name of the machine.
+@code{:eval} says to evaluate the following form and use the result as
+a string to display.  In this case, the expression displays the first
+component of the full system name.  The end of the first component is
+a @samp{.} (`period'), so I use the @code{string-match} function to
+tell me the length of the first component.  The substring from the
+zeroth character to that length is the name of the machine.
 
 @need 1250
 This is the expression:
@@ -17445,8 +18475,8 @@ argument of 4:
 @end smallexample
 
 @noindent
-In GNU Emacs version 21, you will create and enter a
-@file{*Backtrace*} buffer that says:
+In a recent GNU Emacs, you will create and enter a @file{*Backtrace*}
+buffer that says:
 
 @noindent
 @smallexample
@@ -17479,6 +18509,7 @@ In practice, for a bug as simple as this, the `Lisp error' line will
 tell you what you need to know to correct the definition.  The
 function @code{1=} is `void'.
 
+@ignore
 @need 800
 In GNU Emacs 20 and before, you will see:
 
@@ -17489,13 +18520,14 @@ Symbol's function definition is void:@: 1=
 @noindent
 which has the same meaning as the @file{*Backtrace*} buffer line in
 version 21.
+@end ignore
 
 However, suppose you are not quite certain what is going on?
 You can read the complete backtrace.
 
-In this case, you need to run GNU Emacs 21, which automatically starts
-the debugger that puts you in the @file{*Backtrace*} buffer; or else,
-you need to start the debugger manually as described below.
+In this case, you need to run a recent GNU Emacs, which automatically
+starts the debugger that puts you in the @file{*Backtrace*} buffer; or
+else, you need to start the debugger manually as described below.
 
 Read the @file{*Backtrace*} buffer from the bottom up; it tells you
 what Emacs did that led to the error.  Emacs made an interactive call
@@ -17535,14 +18567,18 @@ then run your test again.
 @section @code{debug-on-entry}
 @findex debug-on-entry
 
-GNU Emacs 21 starts the debugger automatically when your function has
-an error.  GNU Emacs version 20 and before did not; it simply
+A recent GNU Emacs starts the debugger automatically when your
+function has an error.
+
+@ignore
+GNU Emacs version 20 and before did not; it simply
 presented you with an error message.  You had to start the debugger
 manually.
+@end ignore
 
-You can start the debugger manually for all versions of Emacs; the
-advantage is that the debugger runs even if you do not have a bug in
-your code.  Sometimes your code will be free of bugs!
+Incidentally, you can start the debugger manually for all versions of
+Emacs; the advantage is that the debugger runs even if you do not have
+a bug in your code.  Sometimes your code will be free of bugs!
 
 You can enter the debugger when you call the function by calling
 @code{debug-on-entry}.
@@ -17742,7 +18778,8 @@ Interactive mode.)
 @need 1500
 However, to prepare this function definition for Edebug, you must
 first @dfn{instrument} the code using a different command.  You can do
-this by positioning your cursor within the definition and typing
+this by positioning your cursor within or just after the definition
+and typing
 
 @smallexample
 M-x edebug-defun RET
@@ -17796,13 +18833,13 @@ that value will be displayed in the echo area.  For example, after you
 move point past @code{number}, you will see the following:
 
 @smallexample
-Result: 3 = C-c
+Result: 3 (#o3, #x3, ?\C-c)
 @end smallexample
 
 @noindent
-This means the value of @code{number} is 3, which is @sc{ascii}
-`control-c' (the third letter of the alphabet, in case you need to
-know this information).
+This means the value of @code{number} is 3, which is octal three,
+hexadecimal three, and @sc{ascii} `control-c' (the third letter of the
+alphabet, in case you need to know this information).
 
 You can continue moving through the code until you reach the line with
 the error.  Before evaluation, that line looks like this:
@@ -17863,7 +18900,7 @@ completes without problems.
 @item
 While running Edebug, type @kbd{?} to see a list of all the Edebug commands.
 (The @code{global-edebug-prefix} is usually @kbd{C-x X}, i.e.@:
-@kbd{@key{CTL}-x} followed by an upper case @kbd{X}; use this prefix
+@kbd{@key{CTRL}-x} followed by an upper case @kbd{X}; use this prefix
 for commands made outside of the Edebug debugging buffer.)
 
 @item
@@ -17872,7 +18909,7 @@ In the Edebug debugging buffer, use the @kbd{p}
 @code{count-words-region} is working.
 
 @item
-Move point to some spot further down function and then type the
+Move point to some spot further down the function and then type the
 @kbd{h} (@code{edebug-goto-here}) command to jump to that location.
 
 @item
@@ -17922,8 +18959,8 @@ introduction, it comes as a Texinfo source file, so you can read it
 on-line and as a typeset, printed book.)
 
 Go to the other on-line help that is part of GNU Emacs: the on-line
-documentation for all functions, and @code{find-tags}, the program
-that takes you to sources.
+documentation for all functions and variables, and @code{find-tags},
+the program that takes you to sources.
 
 Here is an example of how I explore the sources.  Because of its name,
 @file{simple.el} is the file I looked at first, a long time ago.  As
@@ -17932,21 +18969,16 @@ or at least look complicated at first sight.  The @code{open-line}
 function, for example, looks complicated.
 
 You may want to walk through this function slowly, as we did with the
-@code{forward-sentence} function.
-@ifnottex
-(@xref{forward-sentence}.)
-@end ifnottex
-@iftex
-(@xref{forward-sentence, , @code{forward-sentence}}.)
-@end iftex
-Or you may want to skip that function and look at another, such as
-@code{split-line}.  You don't need to read all the functions.
-According to @code{count-words-in-defun}, the @code{split-line}
-function contains 27 words and symbols.
-
-Even though it is short, @code{split-line} contains four expressions
+@code{forward-sentence} function.  (@xref{forward-sentence, The
+@code{forward-sentence} function}.)  Or you may want to skip that
+function and look at another, such as @code{split-line}.  You don't
+need to read all the functions.  According to
+@code{count-words-in-defun}, the @code{split-line} function contains
+102 words and symbols.
+
+Even though it is short, @code{split-line} contains  expressions
 we have not studied: @code{skip-chars-forward}, @code{indent-to},
-@code{current-column} and @samp{?\n}.
+@code{current-column} and @code{insert-and-inherit}.
 
 Consider the @code{skip-chars-forward} function.  (It is part of the
 function definition for @code{back-to-indentation}, which is shown in
@@ -17974,25 +19006,17 @@ customize the @code{interactive} expression without using the standard
 character codes; and it shows how to create a temporary buffer.
 
 (The @code{indent-to} function is written in C rather than Emacs Lisp;
-it is a `built-in' function.  @code{help-follow} only provides you
-with the documentation of a built-in function; it does not take you to
-the source.  But @code{find-tag} will take you to the source, if
-properly set up.)
+it is a `built-in' function.  @code{help-follow} takes you to its
+source as does @code{find-tag}, when properly set up.)
 
 You can look at a function's source using @code{find-tag}, which is
 bound to @kbd{M-.}  Finally, you can find out what the Reference
 Manual has to say by visiting the manual in Info, and typing @kbd{i}
-(@code{Info-index}) and the name of the function, or by looking up
-@code{skip-chars-forward} in the index to a printed copy of the
-manual.
-
-Similarly, you can find out what is meant by @samp{?\n}.  You can try
-using @code{Info-index} with @samp{?\n}.  It turns out that this
-action won't help; but don't give up.  If you search the index for
-@samp{\n} without the @samp{?}, you will be taken directly to the
-relevant section of the manual.  (@xref{Character Type, , Character
-Type, elisp, The GNU Emacs Lisp Reference Manual}.  @samp{?\n} stands
-for the newline character.)
+(@code{Info-index}) and the name of the function, or by looking up the
+function in the index to a printed copy of the manual.
+
+Similarly, you can find out what is meant by
+@code{insert-and-inherit}.
 
 Other interesting source files include @file{paragraphs.el},
 @file{loaddefs.el}, and @file{loadup.el}.  The @file{paragraphs.el}
@@ -18121,156 +19145,292 @@ function definition and try each of them on this list.
 @cindex Handling the kill ring
 @cindex Ring, making a list like a
 
-The kill ring is a list that is transformed into a ring by the
-workings of the @code{rotate-yank-pointer} function.  The @code{yank}
-and @code{yank-pop} commands use the @code{rotate-yank-pointer}
-function.  This appendix describes the @code{rotate-yank-pointer}
-function as well as both the @code{yank} and the @code{yank-pop}
-commands.
+The kill ring is a list that is transformed into a ring by the
+workings of the @code{current-kill} function.  The @code{yank} and
+@code{yank-pop} commands use the @code{current-kill} function.
+
+This appendix describes the @code{current-kill} function as well as
+both the @code{yank} and the @code{yank-pop} commands, but first,
+consider the workings of the kill ring.
+
+@menu
+* What the Kill Ring Does::
+* current-kill::
+* yank::                        Paste a copy of a clipped element.
+* yank-pop::                    Insert element pointed to.
+* ring file::
+@end menu
+
+@node What the Kill Ring Does, current-kill, Kill Ring, Kill Ring
+@ifnottex
+@unnumberedsec What the Kill Ring Does
+@end ifnottex
+
+@need 1250
+The kill ring has a default maximum length of sixty items; this number
+is too large for an explanation.  Instead, set it to four.  Please
+evaluate the following:
+
+@smallexample
+@group
+(setq old-kill-ring-max kill-ring-max)
+(setq kill-ring-max 4)
+@end group
+@end smallexample
+
+@noindent
+Then, please copy each line of the following indented example into the
+kill ring.  You may kill each line with @kbd{C-k} or mark it and copy
+it with @kbd{M-w}.
+
+@noindent
+(In a read-only buffer, such as the @file{*info*} buffer, the kill
+command, @kbd{C-k} (@code{kill-line}), will not remove the text,
+merely copy it to the kill ring.  However, your machine may beep at
+you.  Alternatively, for silence, you may copy the region of each line
+with the @kbd{M-w} (@code{kill-ring-save}) command.  You must mark
+each line for this command to succeed, but it does not matter at which
+end you put point or mark.)
+
+@need 1250
+@noindent
+Please invoke the calls in order, so that five elements attempt to
+fill the kill ring:
+
+@smallexample
+@group
+first some text
+second piece of text
+third line
+fourth line of text
+fifth bit of text
+@end group
+@end smallexample
+
+@need 1250
+@noindent
+Then find the value of @code{kill-ring} by evaluating
+
+@smallexample
+kill-ring
+@end smallexample
+
+@need 800
+@noindent
+It is:
+
+@smallexample
+@group
+("fifth bit of text" "fourth line of text"
+"third line" "second piece of text")
+@end group
+@end smallexample
+
+@noindent
+The first element, @samp{first some text}, was dropped.
+
+@need 1250
+To return to the old value for the length of the kill ring, evaluate:
+
+@smallexample
+(setq kill-ring-max old-kill-ring-max)
+@end smallexample
+
+@node current-kill, yank, What the Kill Ring Does, Kill Ring
+@comment  node-name,  next,  previous,  up
+@appendixsec The @code{current-kill} Function
+@findex current-kill
+
+The @code{current-kill} function changes the element in the kill ring
+to which @code{kill-ring-yank-pointer} points.  (Also, the
+@code{kill-new} function sets @code{kill-ring-yank-pointer} to point
+to the latest element of the the kill ring.  The @code{kill-new}
+function is used directly or indirectly by @code{kill-append},
+@code{copy-region-as-kill}, @code{kill-ring-save}, @code{kill-line},
+and @code{kill-region}.)
 
 @menu
-* rotate-yank-pointer::         Move a pointer along a list and around.
-* yank::                        Paste a copy of a clipped element.
-* yank-pop::                    Insert first element pointed to.
-* ring file::
+* Code for current-kill::
+* Understanding current-kill::
 @end menu
 
-@node rotate-yank-pointer, yank, Kill Ring, Kill Ring
-@comment  node-name,  next,  previous,  up
-@appendixsec The @code{rotate-yank-pointer} Function
-@findex rotate-yank-pointer
+@node Code for current-kill, Understanding current-kill, current-kill, current-kill
+@ifnottex
+@unnumberedsubsec The code for @code{current-kill}
+@end ifnottex
 
-The @code{rotate-yank-pointer} function changes the element in the kill
-ring to which @code{kill-ring-yank-pointer} points.  For example, it can
-change  @code{kill-ring-yank-pointer} from pointing to the second
-element to point to the third element.
 
-@need 800
-Here is the code for @code{rotate-yank-pointer}:
+@need 1500
+The @code{current-kill} function is used by @code{yank} and by
+@code{yank-pop}.  Here is the code for @code{current-kill}:
 
 @smallexample
 @group
-(defun rotate-yank-pointer (arg)
-  "Rotate the yanking point in the kill ring."
-  (interactive "p")
-  (let ((length (length kill-ring)))
+(defun current-kill (n &optional do-not-move)
+  "Rotate the yanking point by N places, and then return that kill.
+If N is zero, `interprogram-paste-function' is set, and calling it
+returns a string, then that string is added to the front of the
+kill ring and returned as the latest kill.
+@end group
+@group
+If optional arg DO-NOT-MOVE is non-nil, then don't actually move the
+yanking point; just return the Nth kill forward."
+  (let ((interprogram-paste (and (= n 0)
+                                 interprogram-paste-function
+                                 (funcall interprogram-paste-function))))
 @end group
 @group
-    (if (zerop length)
-        ;; @r{then-part}
-        (error "Kill ring is empty")
+    (if interprogram-paste
+        (progn
+          ;; Disable the interprogram cut function when we add the new
+          ;; text to the kill ring, so Emacs doesn't try to own the
+          ;; selection, with identical text.
+          (let ((interprogram-cut-function nil))
+            (kill-new interprogram-paste))
+          interprogram-paste)
 @end group
 @group
-      ;; @r{else-part}
-      (setq kill-ring-yank-pointer
-            (nthcdr (% (+ arg
-                          (- length
-                             (length
-                              kill-ring-yank-pointer)))
-                       length)
-                    kill-ring)))))
+      (or kill-ring (error "Kill ring is empty"))
+      (let ((ARGth-kill-element
+             (nthcdr (mod (- n (length kill-ring-yank-pointer))
+                          (length kill-ring))
+                     kill-ring)))
+        (or do-not-move
+            (setq kill-ring-yank-pointer ARGth-kill-element))
+        (car ARGth-kill-element)))))
 @end group
 @end smallexample
 
-@menu
-* Understanding rotate-yk-ptr::
-* rotate-yk-ptr body::          The body of @code{rotate-yank-pointer}.
-@end menu
+Remember also that the @code{kill-new} function sets
+@code{kill-ring-yank-pointer} to the latest element of the the kill
+ring, which means that all the functions that call it set the value
+indirectly: @code{kill-append}, @code{copy-region-as-kill},
+@code{kill-ring-save}, @code{kill-line}, and @code{kill-region}.
+
+@need 1500
+Here is the line in @code{kill-new}, which is explained in
+@ref{kill-new function, , The @code{kill-new} function}.
+
+@smallexample
+(setq kill-ring-yank-pointer kill-ring)
+@end smallexample
 
-@node Understanding rotate-yk-ptr, rotate-yk-ptr body, rotate-yank-pointer, rotate-yank-pointer
+@node Understanding current-kill,  , Code for current-kill, current-kill
 @ifnottex
-@unnumberedsubsec @code{rotate-yank-pointer} in Outline
+@unnumberedsubsec @code{current-kill} in Outline
 @end ifnottex
 
-The @code{rotate-yank-pointer} function looks complex, but as usual,
-it can be understood by taking it apart piece by piece.  First look at
-it in skeletal form:
+The @code{current-kill} function looks complex, but as usual, it can
+be understood by taking it apart piece by piece.  First look at it in
+skeletal form:
 
 @smallexample
 @group
-(defun rotate-yank-pointer (arg)
-  "Rotate the yanking point in the kill ring."
-  (interactive "p")
+(defun current-kill (n &optional do-not-move)
+  "Rotate the yanking point by N places, and then return that kill."
   (let @var{varlist}
     @var{body}@dots{})
 @end group
 @end smallexample
 
-This function takes one argument, called @code{arg}.  It has a brief
-documentation string; and it is interactive with a small @samp{p}, which
-means that the argument must be a processed prefix passed to the
-function as a number.
+This function takes two arguments, one of which is optional.  It has a
+documentation string.  It is @emph{not} interactive.
+
+@menu
+* Body of current-kill::
+* Digression concerning error::  How to mislead humans, but not computers.
+* Determining the Element::
+@end menu
+
+@node Body of current-kill, Digression concerning error, Understanding current-kill, Understanding current-kill
+@ifnottex
+@unnumberedsubsubsec The Body of @code{current-kill}
+@end ifnottex
 
 The body of the function definition is a @code{let} expression, which
 itself has a body as well as a @var{varlist}.
 
 The @code{let} expression declares a variable that will be only usable
 within the bounds of this function.  This variable is called
-@code{length} and is bound to a value that is equal to the number of
-items in the kill ring.  This is done by using the function called
-@code{length}.  (Note that this function has the same name as the
-variable called @code{length}; but one use of the word is to name the
-function and the other is to name the variable.  The two are quite
-distinct.  Similarly, an English speaker will distinguish between the
-meanings of the word @samp{ship} when he says: "I must ship this package
-immediately." and "I must get aboard the ship immediately.")
-
-The function @code{length} tells the number of items there are in a list,
-so @code{(length kill-ring)} returns the number of items there are in the
-kill ring.
+@code{interprogram-paste} and is for copying to another program.  It
+is not for copying within this instance of GNU Emacs.  Most window
+systems provide a facility for interprogram pasting.  Sadly, that
+facility usually provides only for the last element.  Most windowing
+systems have not adopted a ring of many possibilities, even though
+Emacs has provided it for decades.
 
-@node rotate-yk-ptr body,  , Understanding rotate-yk-ptr, rotate-yank-pointer
-@comment  node-name,  next,  previous,  up
-@appendixsubsec The Body of @code{rotate-yank-pointer}
+The @code{if} expression has two parts, one if there exists
+@code{interprogram-paste} and one if not.
 
-The body of @code{rotate-yank-pointer} is a @code{let} expression and
-the body of the @code{let} expression is an @code{if} expression.
+@need 2000
+Let us consider the `if not' or else-part of the @code{current-kill}
+function.  (The then-part uses the the @code{kill-new} function, which
+we have already described.  @xref{kill-new function, , The
+@code{kill-new} function}.)
+
+@smallexample
+@group
+(or kill-ring (error "Kill ring is empty"))
+(let ((ARGth-kill-element
+       (nthcdr (mod (- n (length kill-ring-yank-pointer))
+                    (length kill-ring))
+               kill-ring)))
+  (or do-not-move
+      (setq kill-ring-yank-pointer ARGth-kill-element))
+  (car ARGth-kill-element))
+@end group
+@end smallexample
 
-The purpose of the @code{if} expression is to find out whether there is
-anything in the kill ring.  If the kill ring is empty, the @code{error}
-function stops evaluation of the function and prints a message in the
-echo area.  On the other hand, if the kill ring has something in it, the
-work of the function is done.
+@noindent
+The code first checks whether the kill ring has content; otherwise it
+signals an error.
 
-Here is the if-part and then-part of the @code{if} expression:
+@need 1000
+Note that the @code{or} expression is very similar to testing length
+with an @code{if}:
 
 @findex zerop
 @findex error
 @smallexample
 @group
-(if (zerop length)                      ; @r{if-part}
-    (error "Kill ring is empty")        ; @r{then-part}
-  @dots{}
+(if (zerop (length kill-ring))          ; @r{if-part}
+    (error "Kill ring is empty"))       ; @r{then-part}
+  ;; No else-part
 @end group
 @end smallexample
 
 @noindent
 If there is not anything in the kill ring, its length must be zero and
 an error message sent to the user: @samp{Kill ring is empty}.  The
-@code{if} expression uses the function @code{zerop} which returns true
-if the value it is testing is zero.  When @code{zerop} tests true, the
-then-part of the @code{if} is evaluated.  The then-part is a list
-starting with the function @code{error}, which is a function that is
-similar to the @code{message} function (@pxref{message}), in that it
-prints a one-line message in the echo area.  However, in addition to
-printing a message, @code{error} also stops evaluation of the function
-within which it is embedded.  This means that the rest of the function
-will not be evaluated if the length of the kill ring is zero.
-
-@menu
-* Digression concerning error::  How to mislead humans, but not computers.
-* rotate-yk-ptr else-part::     The else-part of the @code{if} expression.
-* Remainder Function::          The remainder, @code{%}, function.
-* rotate-yk-ptr remainder::     Using @code{%} in @code{rotate-yank-pointer}.
-* kill-rng-yk-ptr last elt::    Pointing to the last element.
-@end menu
-
-@node Digression concerning error, rotate-yk-ptr else-part, rotate-yk-ptr body, rotate-yk-ptr body
+@code{current-kill} function uses an @code{or} expression which is
+simpler.  But an @code{if} expression reminds us what goes on.
+
+This @code{if} expression uses the function @code{zerop} which returns
+true if the value it is testing is zero.  When @code{zerop} tests
+true, the then-part of the @code{if} is evaluated.  The then-part is a
+list starting with the function @code{error}, which is a function that
+is similar to the @code{message} function
+(@pxref{message, , The @code{message} Function}) in that
+it prints a one-line message in the echo area.  However, in addition
+to printing a message, @code{error} also stops evaluation of the
+function within which it is embedded.  This means that the rest of the
+function will not be evaluated if the length of the kill ring is zero.
+
+Then the @code{current-kill} function selects the element to return.
+The selection depends on the number of places that @code{current-kill}
+rotates and on where @code{kill-ring-yank-pointer} points.
+
+Next, either the optional @code{do-not-move} argument is true or the
+current value of @code{kill-ring-yank-pointer} is set to point to the
+list.  Finally, another expression returns the first element of the
+list even if the @code{do-not-move} argument is true.
+
+@node Digression concerning error, Determining the Element, Body of current-kill, Understanding current-kill
 @ifnottex
 @unnumberedsubsubsec Digression about the word `error'
 @end ifnottex
 
-(In my opinion, it is slightly misleading, at least to humans, to use
+In my opinion, it is slightly misleading, at least to humans, to use
 the term `error' as the name of the @code{error} function.  A better
 term would be `cancel'.  Strictly speaking, of course, you cannot
 point to, much less rotate a pointer to a list that has no length, so
@@ -18285,86 +19445,38 @@ even in the bowels of a computer.  As it is, the code in Emacs implies
 that a human who is acting virtuously, by exploring his or her
 environment, is making an error.  This is bad.  Even though the computer
 takes the same steps as it does when there is an `error', a term such as
-`cancel' would have a clearer connotation.)
-
-@node rotate-yk-ptr else-part, Remainder Function, Digression concerning error, rotate-yk-ptr body
-@unnumberedsubsubsec The else-part of the @code{if} expression
-
-The else-part of the @code{if} expression is dedicated to setting the
-value of @code{kill-ring-yank-pointer} when the kill ring has something
-in it.  The code looks like this:
-
-@smallexample
-@group
-(setq kill-ring-yank-pointer
-      (nthcdr (% (+ arg
-                    (- length
-                       (length kill-ring-yank-pointer)))
-                 length)
-              kill-ring)))))
-@end group
-@end smallexample
-
-This needs some examination.  Clearly, @code{kill-ring-yank-pointer}
-is being set to be equal to some @sc{cdr} of the kill ring, using the
-@code{nthcdr} function that is described in an earlier section.
-(@xref{copy-region-as-kill}.)  But exactly how does it do this?
-
-Before looking at the details of the code let's first consider the
-purpose of the @code{rotate-yank-pointer} function.
-
-The @code{rotate-yank-pointer} function changes what
-@code{kill-ring-yank-pointer} points to.  If
-@code{kill-ring-yank-pointer} starts by pointing to the first element
-of a list, a call to @code{rotate-yank-pointer} causes it to point to
-the second element; and if @code{kill-ring-yank-pointer} points to the
-second element, a call to @code{rotate-yank-pointer} causes it to
-point to the third element.  (And if @code{rotate-yank-pointer} is
-given an argument greater than 1, it jumps the pointer that many
-elements.)
-
-The @code{rotate-yank-pointer} function uses @code{setq} to reset what
-the @code{kill-ring-yank-pointer} points to.  If
-@code{kill-ring-yank-pointer} points to the first element of the kill
-ring, then, in the simplest case, the @code{rotate-yank-pointer}
-function must cause it to point to the second element.  Put another
-way, @code{kill-ring-yank-pointer} must be reset to have a value equal
-to the @sc{cdr} of the kill ring.
-
-@need 1250
-That is, under these circumstances,
+`cancel' would have a clearer connotation.
 
-@smallexample
-@group
-(setq kill-ring-yank-pointer
-   ("some text" "a different piece of text" "yet more text"))
+@node Determining the Element,  , Digression concerning error, Understanding current-kill
+@ifnottex
+@unnumberedsubsubsec Determining the Element
+@end ifnottex
 
-(setq kill-ring
-   ("some text" "a different piece of text" "yet more text"))
-@end group
-@end smallexample
+Among other actions, the else-part of the @code{if} expression sets
+the value of @code{kill-ring-yank-pointer} to
+@code{ARGth-kill-element} when the kill ring has something in it and
+the value of @code{do-not-move} is @code{nil}.
 
 @need 800
-@noindent
-the code should do this:
-
-@smallexample
-(setq kill-ring-yank-pointer (cdr kill-ring))
-@end smallexample
-
-@need 1000
-@noindent
-As a result, the @code{kill-ring-yank-pointer} will look like this:
+The code looks like this:
 
 @smallexample
 @group
-kill-ring-yank-pointer
-     @result{} ("a different piece of text" "yet more text"))
+(nthcdr (mod (- n (length kill-ring-yank-pointer))
+             (length kill-ring))
+        kill-ring)))
 @end group
 @end smallexample
 
-The actual @code{setq} expression uses the @code{nthcdr} function to do
-the job.
+This needs some examination.  Unless it is not supposed to move the
+pointer, the @code{current-kill} function changes where
+@code{kill-ring-yank-pointer} points.
+That is what the
+@w{@code{(setq kill-ring-yank-pointer ARGth-kill-element))}}
+expression does.  Also, clearly, @code{ARGth-kill-element} is being
+set to be equal to some @sc{cdr} of the kill ring, using the
+@code{nthcdr} function that is described in an earlier section.
+(@xref{copy-region-as-kill}.)  How does it do this?
 
 As we have seen before (@pxref{nthcdr}), the @code{nthcdr} function
 works by repeatedly taking the @sc{cdr} of a list---it takes the
@@ -18381,498 +19493,254 @@ The two following expressions produce the same result:
 @end group
 @end smallexample
 
-In the @code{rotate-yank-pointer} function, however, the first
-argument to @code{nthcdr} is a rather complex looking expression with
-lots of arithmetic inside of it:
-
-@smallexample
-@group
-(% (+ arg
-      (- length
-         (length kill-ring-yank-pointer)))
-   length)
-@end group
-@end smallexample
+However, the @code{nthcdr} expression is more complicated.  It uses
+the @code{mod} function to determine which @sc{cdr} to select.
 
-As usual, we need to look at the most deeply embedded expression first
-and then work our way towards the light.
+(You will remember to look at inner functions first; indeed, we will
+have to go inside the @code{mod}.)
 
-The most deeply embedded expression is @code{(length
-kill-ring-yank-pointer)}.  This finds the length of the current value of
-the @code{kill-ring-yank-pointer}.  (Remember that the
-@code{kill-ring-yank-pointer} is the name of a variable whose value is a
-list.)
+The @code{mod} function returns the value of its first argument modulo
+the second; that is to say, it returns the remainder after dividing
+the first argument by the second.  The value returned has the same
+sign as the second argument.
 
 @need 800
-The measurement of the length is inside the expression:
-
-@smallexample
-(- length (length kill-ring-yank-pointer))
-@end smallexample
-
-@noindent
-In this expression, the first @code{length} is the variable that was
-assigned the length of the kill ring in the @code{let} statement at the
-beginning of the function.  (One might think this function would be
-clearer if the variable @code{length} were named
-@code{length-of-kill-ring} instead; but if you look at the text of the
-whole function, you will see that it is so short that naming this
-variable @code{length} is not a bother, unless you are pulling the
-function apart into very tiny pieces as we are doing here.)
-
-So the line @code{(- length (length kill-ring-yank-pointer))} tells the
-difference between the length of the kill ring and the length of the list
-whose name is @code{kill-ring-yank-pointer}.
-
-To see how all this fits into the @code{rotate-yank-pointer}
-function, let's begin by analyzing the case where
-@code{kill-ring-yank-pointer} points to the first element of the kill
-ring, just as @code{kill-ring} does, and see what happens when
-@code{rotate-yank-pointer} is called with an argument of 1.
-
-The variable @code{length} and the value of the expression
-@code{(length kill-ring-yank-pointer)} will be the same since the
-variable @code{length} is the length of the kill ring and the
-@code{kill-ring-yank-pointer} is pointing to the whole kill ring.
-Consequently, the value of
-
-@smallexample
-(- length (length kill-ring-yank-pointer))
-@end smallexample
-
-@noindent
-will be zero.  Since the value of @code{arg} will be 1, this will mean
-that the value of the whole expression
-
-@smallexample
-(+ arg (- length (length kill-ring-yank-pointer)))
-@end smallexample
-
-@noindent
-will be 1.
-
-@need 1200
-Consequently, the argument to @code{nthcdr} will be found as the result of
-the expression
-
-@smallexample
-(% 1 length)
-@end smallexample
-
-@node Remainder Function, rotate-yk-ptr remainder, rotate-yk-ptr else-part, rotate-yk-ptr body
-@unnumberedsubsubsec The @code{%} remainder function
-
-To understand @code{(% 1 length)}, we need to understand @code{%}.
-According to its documentation (which I just found by typing @kbd{C-h
-f @kbd{%} @key{RET}}), the @code{%} function returns the remainder of
-its first argument divided by its second argument.  For example, the
-remainder of 5 divided by 2 is 1.  (2 goes into 5 twice with a
-remainder of 1.)
-
-What surprises people who don't often do arithmetic is that a smaller
-number can be divided by a larger number and have a remainder.  In the
-example we just used, 5 was divided by 2.  We can reverse that and ask,
-what is the result of dividing 2 by 5?  If you can use fractions, the
-answer is obviously 2/5 or .4; but if, as here, you can only use whole
-numbers, the result has to be something different.  Clearly, 5 can go into
-2 zero times, but what of the remainder?  To see what the answer is,
-consider a case that has to be familiar from childhood:
-
-@itemize @bullet
-@item
-5 divided by 5 is 1 with a remainder of 0;
-
-@item
-6 divided by 5 is 1 with a remainder of 1;
-
-@item
-7 divided by 5 is 1 with a remainder of 2.
-
-@item
-Similarly, 10 divided by 5 is 2 with a remainder of 0;
-
-@item
-11 divided by 5 is 2 with a remainder of 1;
-
-@item
-12 divided by 5 is 1 with a remainder of 2.
-@end itemize
-
-@need 1250
-@noindent
-By considering the cases as parallel, we can see that
-
-@itemize @bullet
-@item
-zero divided by 5 must be zero with a remainder of zero;
-
-@item
-1 divided by 5 must be zero with a remainder of 1;
-
-@item
-2 divided by 5 must be zero with a remainder of 2;
-@end itemize
-
-@noindent
-and so on.
-
-@need 1250
-So, in this code, if the value of @code{length} is 5, then the result of
-evaluating
-
-@smallexample
-(% 1 5)
-@end smallexample
-
-@noindent
-is 1.  (I just checked this by placing the cursor after the expression
-and typing @kbd{C-x C-e}.  Indeed, 1 is printed in the echo area.)
-
-@need 2000
-@node rotate-yk-ptr remainder, kill-rng-yk-ptr last elt, Remainder Function, rotate-yk-ptr body
-@unnumberedsubsubsec Using @code{%} in @code{rotate-yank-pointer}
-
-When the @code{kill-ring-yank-pointer} points to the
-beginning of the kill ring, and the argument passed to
-@code{rotate-yank-pointer} is 1, the @code{%} expression returns 1:
+Thus,
 
 @smallexample
 @group
-(- length (length kill-ring-yank-pointer))
-     @result{} 0
+(mod 12 4)
+  @result{} 0  ;; @r{because there is no remainder}
+(mod 13 4)
+  @result{} 1
 @end group
 @end smallexample
 
 @need 1250
-@noindent
-therefore,
+In this case, the first argument is often smaller than the second.
+That is fine.
 
 @smallexample
 @group
-(+ arg (- length (length kill-ring-yank-pointer)))
-     @result{} 1
+(mod 0 4)
+  @result{} 0
+(mod 1 4)
+  @result{} 1
 @end group
 @end smallexample
 
-@need 1250
-@noindent
-and consequently:
-
-@smallexample
-@group
-(% (+ arg (- length (length kill-ring-yank-pointer)))
-   length)
-     @result{} 1
-@end group
-@end smallexample
+We can guess what the @code{-} function does.  It is like @code{+} but
+subtracts instead of adds; the @code{-} function subtracts its second
+argument from its first.  Also, we already know what the @code{length}
+function does (@pxref{length}).  It returns the length of a list.
 
-@noindent
-regardless of the value of @code{length}.
+And @code{n} is the name of the required argument to the
+@code{current-kill} function.
 
 @need 1250
-@noindent
-As a result of this, the @code{setq kill-ring-yank-pointer} expression
-simplifies to:
-
-@smallexample
-(setq kill-ring-yank-pointer (nthcdr 1 kill-ring))
-@end smallexample
-
-@noindent
-What it does is now easy to understand.  Instead of pointing as it did
-to the first element of the kill ring, the
-@code{kill-ring-yank-pointer} is set to point to the second element.
-
-Clearly, if the argument passed to @code{rotate-yank-pointer} is two, then
-the @code{kill-ring-yank-pointer} is set to @code{(nthcdr 2 kill-ring)};
-and so on for different values of the argument.
-
-Similarly, if the @code{kill-ring-yank-pointer} starts out pointing to
-the second element of the kill ring, its length is shorter than the
-length of the kill ring by 1, so the computation of the remainder is
-based on the expression @code{(% (+ arg 1) length)}.  This means that
-the @code{kill-ring-yank-pointer} is moved from the second element of
-the kill ring to the third element if the argument passed to
-@code{rotate-yank-pointer} is 1.
-
-@node kill-rng-yk-ptr last elt,  , rotate-yk-ptr remainder, rotate-yk-ptr body
-@unnumberedsubsubsec Pointing to the last element
-
-The final question is, what happens if the @code{kill-ring-yank-pointer}
-is set to the @emph{last} element of the kill ring?  Will a call to
-@code{rotate-yank-pointer} mean that nothing more can be taken from the
-kill ring?  The answer is no.  What happens is different and useful.
-The @code{kill-ring-yank-pointer} is set to point to the beginning of
-the kill ring instead.
-
-Let's see how this works by looking at the code, assuming the length of the
-kill ring is 5 and the argument passed to @code{rotate-yank-pointer} is 1.
-When the @code{kill-ring-yank-pointer} points to the last element of
-the kill ring, its length is 1.  The code looks like this:
+So when the first argument to @code{nthcdr} is zero, the @code{nthcdr}
+expression returns the whole list, as you can see by evaluating the
+following:
 
 @smallexample
-(% (+ arg (- length (length kill-ring-yank-pointer))) length)
+@group
+;; kill-ring-yank-pointer @r{and} kill-ring @r{have a length of four}
+;; @r{and} (mod (- 0 4) 4) @result{} 0
+(nthcdr (mod (- 0 4) 4)
+        '("fourth line of text"
+          "third line"
+          "second piece of text"
+          "first some text"))
+@end group
 @end smallexample
 
 @need 1250
-When the variables are replaced by their numeric values, the expression
-looks like this:
-
-@smallexample
-(% (+ 1 (- 5 1)) 5)
-@end smallexample
-
-@noindent
-This expression can be evaluated by looking at the most embedded inner
-expression first and working outwards:  The value of @code{(- 5 1)} is 4;
-the sum of @code{(+ 1 4)} is 5; and the remainder of dividing 5 by 5 is
-zero.  So what @code{rotate-yank-pointer} will do is
+When the first argument to the @code{current-kill} function is one,
+the @code{nthcdr} expression returns the list without its first
+element.
 
 @smallexample
-(setq kill-ring-yank-pointer (nthcdr 0 kill-ring))
+@group
+(nthcdr (mod (- 1 4) 4)
+        '("fourth line of text"
+          "third line"
+          "second piece of text"
+          "first some text"))
+@end group
 @end smallexample
 
-@noindent
-which will set the @code{kill-ring-yank-pointer} to point to the beginning
-of the kill ring.
+@cindex @samp{global variable} defined
+@cindex @samp{variable, global}, defined
+Incidentally, both @code{kill-ring} and @code{kill-ring-yank-pointer}
+are @dfn{global variables}.  That means that any expression in Emacs
+Lisp can access them.  They are not like the local variables set by
+@code{let} or like the symbols in an argument list.
+Local variables can only be accessed
+within the @code{let} that defines them or the function that specifies
+them in an argument list (and within expressions called by them).
 
-So what happens with successive calls to @code{rotate-yank-pointer} is that
-it moves the @code{kill-ring-yank-pointer} from element to element in the
-kill ring until it reaches the end; then it jumps back to the beginning.
-And this is why the kill ring is called a ring, since by jumping back to
-the beginning, it is as if the list has no end!  (And what is a ring, but
-an entity with no end?)
+@ignore
+@c texi2dvi fails when the name of the section is within ifnottex ...
+(@xref{Prevent confusion, , @code{let} Prevents Confusion}, and
+@ref{defun, , The @code{defun} Special Form}.)
+@end ignore
 
-@node yank, yank-pop, rotate-yank-pointer, Kill Ring
+@node yank, yank-pop, current-kill, Kill Ring
 @comment  node-name,  next,  previous,  up
 @appendixsec @code{yank}
 @findex yank
 
-After learning about @code{rotate-yank-pointer}, the code for the
-@code{yank} function is almost easy.  It has only one tricky part, which is
-the computation of the argument to be passed to @code{rotate-yank-pointer}.
+After learning about @code{current-kill}, the code for the
+@code{yank} function is almost easy.
+
+The @code{yank} function does not use the
+@code{kill-ring-yank-pointer} variable directly.  It calls
+@code{insert-for-yank} which calls @code{current-kill} which sets the
+@code{kill-ring-yank-pointer} variable.
 
 @need 1250
 The code looks like this:
 
+@c in GNU Emacs 22
 @smallexample
 @group
 (defun yank (&optional arg)
-  "Reinsert the last stretch of killed text.
-More precisely, reinsert the stretch of killed text most
-recently killed OR yanked.
-With just C-U as argument, same but put point in front
-(and mark at end).  With argument n, reinsert the nth
-most recently killed stretch of killed text.
+  "Reinsert (\"paste\") the last stretch of killed text.
+More precisely, reinsert the stretch of killed text most recently
+killed OR yanked.  Put point at end, and set mark at beginning.
+With just \\[universal-argument] as argument, same but put point at
+beginning (and mark at end).  With argument N, reinsert the Nth most
+recently killed stretch of killed text.
+
+When this command inserts killed text into the buffer, it honors
+`yank-excluded-properties' and `yank-handler' as described in the
+doc string for `insert-for-yank-1', which see.
+
 See also the command \\[yank-pop]."
 @end group
 @group
-
   (interactive "*P")
-  (rotate-yank-pointer (if (listp arg) 0
-                         (if (eq arg '-) -1
-                           (1- arg))))
+  (setq yank-window-start (window-start))
+  ;; If we don't get all the way thru, make last-command indicate that
+  ;; for the following command.
+  (setq this-command t)
   (push-mark (point))
-  (insert (car kill-ring-yank-pointer))
-  (if (consp arg)
-      (exchange-point-and-mark)))
-@end group
-@end smallexample
-
-Glancing over this code, we can understand the last few lines readily
-enough.  The mark is pushed, that is, remembered; then the first element
-(the @sc{car}) of what the @code{kill-ring-yank-pointer} points to is
-inserted; and then, if the argument passed the function is a
-@code{cons}, point and mark are exchanged so the point is put in the
-front of the inserted text rather than at the end.  This option is
-explained in the documentation.  The function itself is interactive with
-@code{"*P"}.  This means it will not work on a read-only buffer, and that
-the unprocessed prefix argument is passed to the function.
-
-@menu
-* rotate-yk-ptr arg::           Pass the argument to @code{rotate-yank-pointer}.
-* rotate-yk-ptr negative arg::  Pass a negative argument.
-@end menu
-
-@node rotate-yk-ptr arg, rotate-yk-ptr negative arg, yank, yank
-@unnumberedsubsubsec Passing the argument
-
-The hard part of @code{yank} is understanding the computation that
-determines the value of the argument passed to
-@code{rotate-yank-pointer}.  Fortunately, it is not so difficult as it
-looks at first sight.
-
-What happens is that the result of evaluating one or both of the
-@code{if} expressions will be a number and that number will be the
-argument passed to @code{rotate-yank-pointer}.
-
-@need 1250
-Laid out with comments, the code looks like this:
-
-@smallexample
-@group
-(if (listp arg)                         ; @r{if-part}
-    0                                   ; @r{then-part}
-  (if (eq arg '-)                       ; @r{else-part, inner if}
-      -1                                ; @r{inner if's then-part}
-    (1- arg))))                         ; @r{inner if's else-part}
 @end group
-@end smallexample
-
-@noindent
-This code consists of two @code{if} expression, one the else-part of
-the other.
-
-The first or outer @code{if} expression tests whether the argument
-passed to @code{yank} is a list.  Oddly enough, this will be true if
-@code{yank} is called without an argument---because then it will be
-passed the value of @code{nil} for the optional argument and an
-evaluation of @code{(listp nil)} returns true!  So, if no argument is
-passed to @code{yank}, the argument passed to
-@code{rotate-yank-pointer} inside of @code{yank} is zero.  This means
-the pointer is not moved and the first element to which
-@code{kill-ring-yank-pointer} points is inserted, as we expect.
-Similarly, if the argument for @code{yank} is @kbd{C-u}, this will be
-read as a list, so again, a zero will be passed to
-@code{rotate-yank-pointer}.  (@kbd{C-u} produces an unprocessed prefix
-argument of @code{(4)}, which is a list of one element.)  At the same
-time, later in the function, this argument will be read as a
-@code{cons} so point will be put in the front and mark at the end of
-the insertion.  (The @code{P} argument to @code{interactive} is
-designed to provide these values for the case when an optional
-argument is not provided or when it is @kbd{C-u}.)
-
-The then-part of the outer @code{if} expression handles the case when
-there is no argument or when it is @kbd{C-u}.  The else-part handles the
-other situations.  The else-part is itself another @code{if} expression.
-
-The inner @code{if} expression tests whether the argument is a minus
-sign.  (This is done by pressing the @key{META} and @kbd{-} keys at the
-same time, or the @key{ESC} key and then the @kbd{-} key).  In this
-case, the @code{rotate-yank-pointer} function is passed @kbd{-1} as an
-argument.  This moves the @code{kill-ring-yank-pointer} backwards, which
-is what is desired.
-
-If the true-or-false-test of the inner @code{if} expression is false
-(that is, if the argument is not a minus sign), the else-part of the
-expression is evaluated.  This is the expression @code{(1- arg)}.
-Because of the two @code{if} expressions, it will only occur when the
-argument is a positive number or when it is a negative number (not
-just a minus sign on its own).  What @code{(1- arg)} does is decrement
-the number and return it.  (The @code{1-} function subtracts one from
-its argument.)  This means that if the argument to
-@code{rotate-yank-pointer} is 1, it is reduced to zero, which means
-the first element to which @code{kill-ring-yank-pointer} points is
-yanked back, as you would expect.
-
-@node rotate-yk-ptr negative arg,  , rotate-yk-ptr arg, yank
-@unnumberedsubsubsec Passing a negative argument
-
-Finally, the question arises, what happens if either the remainder
-function, @code{%}, or the @code{nthcdr} function is passed a negative
-argument, as they quite well may?
-
-The answers can be found by a quick test.  When @code{(% -1 5)} is
-evaluated, a negative number is returned; and if @code{nthcdr} is
-called with a negative number, it returns the same value as if it were
-called with a first argument of zero.  This can be seen by evaluating
-the following code.
-
-Here the @samp{@result{}} points to the result of evaluating the code
-preceding it.  This was done by positioning the cursor after the code
-and typing @kbd{C-x C-e} (@code{eval-last-sexp}) in the usual fashion.
-You can do this if you are reading this in Info inside of GNU Emacs.
-
-@smallexample
 @group
-(% -1 5)
-     @result{} -1
+  (insert-for-yank (current-kill (cond
+                                  ((listp arg) 0)
+                                  ((eq arg '-) -2)
+                                  (t (1- arg)))))
+  (if (consp arg)
+      ;; This is like exchange-point-and-mark,
+      ;;     but doesn't activate the mark.
+      ;; It is cleaner to avoid activation, even though the command
+      ;; loop would deactivate the mark because we inserted text.
+      (goto-char (prog1 (mark t)
+                   (set-marker (mark-marker) (point) (current-buffer)))))
 @end group
-
 @group
-(setq animals '(cats dogs elephants))
-     @result{} (cats dogs elephants)
+  ;; If we do get all the way thru, make this-command indicate that.
+  (if (eq this-command t)
+      (setq this-command 'yank))
+  nil)
 @end group
+@end smallexample
 
-@group
-(nthcdr 1 animals)
-     @result{} (dogs elephants)
-@end group
+The key expression is @code{insert-for-yank}, which inserts the string
+returned by @code{current-kill}, but removes some text properties from
+it.
 
-@group
-(nthcdr 0 animals)
-     @result{} (cats dogs elephants)
-@end group
+However, before getting to that expression, the function sets the value
+of @code{yank-window-start} to the position returned by the
+@code{(window-start)} expression, the position at which the display
+currently starts.  The @code{yank} function also sets
+@code{this-command} and pushes the mark.
 
-@group
-(nthcdr -1 animals)
-     @result{} (cats dogs elephants)
-@end group
-@end smallexample
+After it yanks the appropriate element, if the optional argument is a
+@sc{cons} rather than a number or nothing, it puts point at beginning
+of the yanked text and mark at its end.
 
-So, if a minus sign or a negative number is passed to @code{yank}, the
-@code{kill-ring-yank-point} is rotated backwards until it reaches the
-beginning of the list.  Then it stays there.  Unlike the other case,
-when it jumps from the end of the list to the beginning of the list,
-making a ring, it stops.  This makes sense.  You often want to get back
-to the most recently clipped out piece of text, but you don't usually
-want to insert text from as many as thirty kill commands ago.  So you
-need to work through the ring to get to the end, but won't cycle around
-it inadvertently if you are trying to come back to the beginning.
+(The @code{prog1} function is like @code{progn} but returns the value
+of its first argument rather than the value of its last argument.  Its
+first argument is forced to return the buffer's mark as an integer.
+You can see the documentation for these functions by placing point
+over them in this buffer and then typing @kbd{C-h f}
+(@code{describe-function}) followed by a @kbd{RET}; the default is the
+function.)
 
-Incidentally, any number passed to @code{yank} with a minus sign
-preceding it will be treated as @minus{}1.  This is evidently a
-simplification for writing the program.  You don't need to jump back
-towards the beginning of the kill ring more than one place at a time
-and doing this is easier than writing a function to determine the
-magnitude of the number that follows the minus sign.
+The last part of the function tells what to do when it succeeds.
 
 @node yank-pop, ring file, yank, Kill Ring
 @comment  node-name,  next,  previous,  up
 @appendixsec @code{yank-pop}
 @findex yank-pop
 
-After understanding @code{yank}, the @code{yank-pop} function is easy.
-Leaving out the documentation to save space, it looks like this:
+After understanding @code{yank} and @code{current-kill}, you know how
+to approach the @code{yank-pop} function.  Leaving out the
+documentation to save space, it looks like this:
 
+@c GNU Emacs 22
 @smallexample
 @group
-(defun yank-pop (arg)
+(defun yank-pop (&optional arg)
+  "@dots{}"
   (interactive "*p")
   (if (not (eq last-command 'yank))
       (error "Previous command was not a yank"))
 @end group
 @group
   (setq this-command 'yank)
-  (let ((before (< (point) (mark))))
-    (delete-region (point) (mark))
-    (rotate-yank-pointer arg)
+  (unless arg (setq arg 1))
+  (let ((inhibit-read-only t)
+        (before (< (point) (mark t))))
+@end group
+@group
+    (if before
+        (funcall (or yank-undo-function 'delete-region) (point) (mark t))
+      (funcall (or yank-undo-function 'delete-region) (mark t) (point)))
+    (setq yank-undo-function nil)
+@end group
+@group
+    (set-marker (mark-marker) (point) (current-buffer))
+    (insert-for-yank (current-kill arg))
+    ;; Set the window start back where it was in the yank command,
+    ;; if possible.
+    (set-window-start (selected-window) yank-window-start t)
 @end group
 @group
-    (set-mark (point))
-    (insert (car kill-ring-yank-pointer))
-    (if before (exchange-point-and-mark))))
+    (if before
+        ;; This is like exchange-point-and-mark,
+        ;;     but doesn't activate the mark.
+        ;; It is cleaner to avoid activation, even though the command
+        ;; loop would deactivate the mark because we inserted text.
+        (goto-char (prog1 (mark t)
+                     (set-marker (mark-marker)
+                                 (point)
+                                 (current-buffer))))))
+  nil)
 @end group
 @end smallexample
 
 The function is interactive with a small @samp{p} so the prefix
 argument is processed and passed to the function.  The command can
 only be used after a previous yank; otherwise an error message is
-sent.  This check uses the variable @code{last-command} which is
-discussed elsewhere.  (@xref{copy-region-as-kill}.)
+sent.  This check uses the variable @code{last-command} which is set
+by @code{yank} and is discussed elsewhere.
+(@xref{copy-region-as-kill}.)
 
 The @code{let} clause sets the variable @code{before} to true or false
 depending whether point is before or after mark and then the region
 between point and mark is deleted.  This is the region that was just
 inserted by the previous yank and it is this text that will be
-replaced.  Next the @code{kill-ring-yank-pointer} is rotated so that
-the previously inserted text is not reinserted yet again.  Mark is set
-at the beginning of the place the new text will be inserted and then
-the first element to which @code{kill-ring-yank-pointer} points is
-inserted.  This leaves point after the new text.  If in the previous
-yank, point was left before the inserted text, point and mark are now
-exchanged so point is again left in front of the newly inserted text.
-That is all there is to it!
+replaced.
+
+@code{funcall} calls its first argument as a function, passing
+remaining arguments to it.  The first argument is whatever the
+@code{or} expression returns.  The two remaining arguments are the
+positions of point and mark set by the preceding @code{yank} command.
+
+There is more, but that is the hardest part.
 
 @node ring file,  , yank-pop, Kill Ring
 @comment  node-name,  next,  previous,  up
@@ -19061,6 +19929,20 @@ the vertical axis that looks like this:
 The function should be passed the height of the graph, and then should
 construct and insert the appropriate numbers and marks.
 
+@menu
+* print-Y-axis in Detail::
+* Height of label::             What height for the Y axis?
+* Compute a Remainder::         How to compute the remainder of a division.
+* Y Axis Element::              Construct a line for the Y axis.
+* Y-axis-column::               Generate a list of Y axis labels.
+* print-Y-axis Penultimate::    A not quite final version.
+@end menu
+
+@node print-Y-axis in Detail, Height of label, print-Y-axis, print-Y-axis
+@ifnottex
+@unnumberedsubsec The @code{print-Y-axis} Function in Detail
+@end ifnottex
+
 It is easy enough to see in the figure what the Y axis label should
 look like; but to say in words, and then to write a function
 definition to do the job is another matter.  It is not quite true to
@@ -19072,15 +19954,7 @@ the base line (number 1) and then that we want a number and a tic on
 the fifth line from the bottom and on every line that is a multiple of
 five.
 
-@menu
-* Height of label::             What height for the Y axis?
-* Compute a Remainder::         How to compute the remainder of a division.
-* Y Axis Element::              Construct a line for the Y axis.
-* Y-axis-column::               Generate a list of Y axis labels.
-* print-Y-axis Penultimate::    A not quite final version.
-@end menu
-
-@node Height of label, Compute a Remainder, print-Y-axis, print-Y-axis
+@node Height of label, Compute a Remainder, print-Y-axis in Detail, print-Y-axis
 @ifnottex
 @unnumberedsubsec What height should the label be?
 @end ifnottex
@@ -19129,10 +20003,7 @@ second argument.  As it happens, @code{%} is a function in Emacs Lisp
 that you cannot discover using @code{apropos}: you find nothing if you
 type @kbd{M-x apropos @key{RET} remainder @key{RET}}.  The only way to
 learn of the existence of @code{%} is to read about it in a book such
-as this or in the Emacs Lisp sources.  The @code{%} function is used
-in the code for @code{rotate-yank-pointer}, which is described in an
-appendix.  (@xref{rotate-yk-ptr body, , The Body of
-@code{rotate-yank-pointer}}.)
+as this or in the Emacs Lisp sources.
 
 You can try the @code{%} function by evaluating the following two
 expressions:
@@ -19354,7 +20225,8 @@ will be and the second is a symbol for the character to insert, in a
 special format.  The format is a question mark followed by a blank
 space, like this, @samp{? }.  @xref{Character Type, , Character Type,
 elisp, The GNU Emacs Lisp Reference Manual}, for a description of the
-syntax for characters.
+syntax for characters.  (Of course, you might want to replace the
+blank space by some other character @dots{}  You know what to do.)
 
 The @code{number-to-string} function is used in the concatenation
 expression, to convert the number to a string that is concatenated
@@ -19477,10 +20349,10 @@ with @kbd{C-y} (@code{yank)}.
 Press @key{RET} to evaluate the expression.
 @end enumerate
 
-Emacs will print labels vertically, the top one being
-@w{@samp{10 -@w{ }}}.  (The @code{print-graph} function
-will pass the value of @code{height-of-top-line}, which
-in this case would end up as 15.)
+Emacs will print labels vertically, the top one being @w{@samp{10 -@w{
+}}}.  (The @code{print-graph} function will pass the value of
+@code{height-of-top-line}, which in this case will end up as 15,
+thereby getting rid of what might appear as a bug.)
 
 @need 2000
 @node print-X-axis, Print Whole Graph, print-Y-axis, Full Graph
@@ -19563,11 +20435,11 @@ the tic marks themselves and their spacing:
 @noindent
 (Note that the value of @code{graph-blank} is set by another
 @code{defvar}.  The @code{boundp} predicate checks whether it has
-already been set; @code{boundp} returns @code{nil} if it has not.
-If @code{graph-blank} were unbound and we did not use this conditional
-construction, in GNU Emacs 21, we would enter the debugger and see an
-error message saying
-@samp{@w{Debugger entered--Lisp error:} @w{(void-variable graph-blank)}}.)
+already been set; @code{boundp} returns @code{nil} if it has not.  If
+@code{graph-blank} were unbound and we did not use this conditional
+construction, in a recent GNU Emacs, we would enter the debugger and
+see an error message saying @samp{@w{Debugger entered--Lisp error:}
+@w{(void-variable graph-blank)}}.)
 
 @need 1200
 Here is the @code{defvar} for @code{X-axis-tic-symbol}:
@@ -20259,7 +21131,7 @@ If we want to multiply 3 by 7, we can write:
 @ifset print-postscript-figures
 @sp 1
 @tex
-@image{lambda-1}
+@center @image{lambda-1}
 %%%% old method of including an image
 % \input /usr/local/lib/tex/inputs/psfig.tex
 % \centerline{\psfig{figure=/usr/local/lib/emacs/man/lambda-1.eps}}
@@ -20301,7 +21173,7 @@ Similarly, we can write:
 @ifset print-postscript-figures
 @sp 1
 @tex
-@image{lambda-2}
+@center @image{lambda-2}
 %%%% old method of including an image
 % \input /usr/local/lib/tex/inputs/psfig.tex
 % \centerline{\psfig{figure=/usr/local/lib/emacs/man/lambda-2.eps}}
@@ -20340,7 +21212,7 @@ If we want to divide 100 by 50, we can write:
 @ifset print-postscript-figures
 @sp 1
 @tex
-@image{lambda-3}
+@center @image{lambda-3}
 %%%% old method of including an image
 % \input /usr/local/lib/tex/inputs/psfig.tex
 % \centerline{\psfig{figure=/usr/local/lib/emacs/man/lambda-3.eps}}
@@ -21325,7 +22197,6 @@ Note: The Free Software Foundation maintains a page on its Web site
 that lists free books available from other publishers:@*
 @uref{http://www.gnu.org/doc/other-free-books.html}
 
-
 @node GNU Free Documentation License, Index, Free Software and Free Manuals, Top
 @appendix GNU Free Documentation License
 
index c0ab934..c0b4b2a 100644 (file)
@@ -21,7 +21,7 @@
 
 srcdir = .
 
-infodir = ../info
+infodir = $(srcdir)/../info
 
 INFO_SOURCES = $(srcdir)/emacs-lisp-intro.texi
 # The file name eintr must fit within 5 characters, to allow for
@@ -46,7 +46,7 @@ $(infodir)/dir:
 dvi: $(DVI_TARGETS)
 
 $(infodir)/eintr: $(INFO_SOURCES)
-       cd $(srcdir); $(MAKEINFO) emacs-lisp-intro.texi -o $(infodir)/eintr
+       $(MAKEINFO) -o $@ $(srcdir)/emacs-lisp-intro.texi
 
 emacs-lisp-intro.dvi: $(INFO_SOURCES)
        $(ENVADD) $(TEXI2DVI) $(srcdir)/emacs-lisp-intro.texi
index 03359e1..312932c 100644 (file)
@@ -1,10 +1,45 @@
+2006-11-29  Richard Stallman  <rms@gnu.org>
+
+       * frames.texi (Visibility of Frames): Explain visible windows
+       can be covered by others.  Add xref for raise-frame.
+
+2006-11-28  Richard Stallman  <rms@gnu.org>
+
+       * searching.texi (Regexp Special): Update when ^ is special.
+
+2006-11-27  Eli Zaretskii  <eliz@gnu.org>
+
+       * customize.texi (Customization, Common Keywords)
+       (Group Definitions, Variable Definitions, Composite Types)
+       (Type Keywords, Customization Types): Add index entries for
+       various customization keywords.
+
+2006-11-23  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * modes.texi (Multiline Font Lock): Rephrase some parts for clarity.
+
+2006-11-10  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * frames.texi (Window System Selections): Remove clipboard from
+       description of selection-coding-system.
+
+2006-11-06  Richard Stallman  <rms@gnu.org>
+
+       * lists.texi (List Variables): Document COMPARE-FN.
+
+       * keymaps.texi: Avoid use of "binding" to mean a relation;
+       use it only to refer to the meaning associated with a key.
+       (Keymaps): Change menu node description.
+
+       * elisp.texi (Top): Change menu node description.
+
+       * display.texi (Managing Overlays): Document overlay-recenter.
+
 2006-10-29  Chong Yidong  <cyd@stupidchicken.com>
 
        * Makefile.in: Use relative paths to avoid advertising filesystem
        contents during compilation.
 
-       * makefile.w32-in: Likewise.
-
 2006-10-23  Kim F. Storm  <storm@cua.dk>
 
        * commands.texi (Event Input Misc): Update unread-command-events.
@@ -5435,6 +5470,7 @@ Tue Apr 11 12:23:28 1989  Robert J. Chassell  (bob@rice-chex.ai.mit.edu)
 
 ;; Local Variables:
 ;; coding: iso-2022-7bit
+;; add-log-time-zone-rule: t
 ;; End:
 
     Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
index 9e10e54..d47c863 100644 (file)
@@ -7,6 +7,7 @@
 @node Customization, Loading, Macros, Top
 @chapter Writing Customization Definitions
 
+@cindex customization definitions
   This chapter describes how to declare user options for customization,
 and also customization groups for classifying them.  We use the term
 @dfn{customization item} to include both kinds of customization
@@ -23,6 +24,7 @@ definitions---as well as face definitions (@pxref{Defining Faces}).
 @node Common Keywords
 @section Common Item Keywords
 
+@cindex customization keywords
   All kinds of customization declarations (for variables and groups, and
 for faces) accept keyword arguments for specifying various information.
 This section describes some keywords that apply to all kinds.
@@ -34,6 +36,7 @@ display one name.
 
 @table @code
 @item :tag @var{label}
+@kindex tag@r{, customization keyword}
 Use @var{label}, a string, instead of the item's name, to label the
 item in customization menus and buffers.  @strong{Don't use a tag
 which is substantially different from the item's real name; that would
@@ -45,6 +48,7 @@ specify a dash where normally a hyphen would be converted to a space:
   :tag "Cursor In Non-selected Windows"
 @end example
 
+@kindex group@r{, customization keyword}
 @item :group @var{group}
 Put this customization item in group @var{group}.  When you use
 @code{:group} in a @code{defgroup}, it makes the new group a subgroup of
@@ -55,6 +59,7 @@ more than one group.  Displaying any of those groups will show this
 item.  Please don't overdo this, since the result would be annoying.
 
 @item :link @var{link-data}
+@kindex link@r{, customization keyword}
 Include an external link after the documentation string for this item.
 This is a sentence containing an active field which references some
 other documentation.
@@ -114,11 +119,13 @@ An item can have more than one external link; however, most items have
 none at all.
 
 @item :load @var{file}
+@kindex load@r{, customization keyword}
 Load file @var{file} (a string) before displaying this customization
 item.  Loading is done with @code{load-library}, and only if the file is
 not already loaded.
 
 @item :require @var{feature}
+@kindex require@r{, customization keyword}
 Execute @code{(require '@var{feature})} when your saved customizations
 set the value of this item.  @var{feature} should be a symbol.
 
@@ -127,11 +134,13 @@ a feature such as a minor mode, and just setting the variable won't have
 any effect unless the code which implements the mode is loaded.
 
 @item :version @var{version}
+@kindex version@r{, customization keyword}
 This option specifies that the item was first introduced in Emacs
 version @var{version}, or that its default value was changed in that
 version.  The value @var{version} must be a string.
 
 @item :package-version '(@var{package} . @var{version})
+@kindex package-version@r{, customization keyword}
 This option specifies that the item was first introduced in
 @var{package} version @var{version}, or that its meaning or default
 value was changed in that version.  The value of @var{package} is a
@@ -179,6 +188,7 @@ choice is the official name of the package, such as MH-E or Gnus.
 @node Group Definitions
 @section Defining Custom Groups
 
+@cindex custom groups, how to define
   Each Emacs Lisp package should have one main customization group which
 contains all the options, faces and other groups in the package.  If the
 package has a small number of options and faces, use just one group and
@@ -221,6 +231,7 @@ also use this keyword in @code{defgroup}:
 
 @table @code
 @item :prefix @var{prefix}
+@kindex prefix@r{, @code{defgroup} keyword}
 If the name of an item in the group starts with @var{prefix}, then the
 tag for that item is constructed (by default) by omitting @var{prefix}.
 
@@ -249,6 +260,8 @@ turn this feature back on, if someone would like to do the work.
 @node Variable Definitions
 @section Defining Customization Variables
 
+@cindex customization variables, how to define
+@cindex declare user-editable variables
   Use @code{defcustom} to declare user-editable variables.
 
 @defmac defcustom option standard doc [keyword value]@dots{}
@@ -297,6 +310,7 @@ values are legitimate, and how to display the value.
 @xref{Customization Types}, for more information.
 
 @item :options @var{list}
+@kindex options@r{, @code{defcustom} keyword}
 Specify @var{list} as the list of reasonable values for use in this
 option.  The user is not restricted to using only these values, but they
 are offered as convenient alternatives.
@@ -306,6 +320,7 @@ This is meaningful only for certain types, currently including
 individual types for a description of how to use @code{:options}.
 
 @item :set @var{setfunction}
+@kindex set@r{, @code{defcustom} keyword}
 Specify @var{setfunction} as the way to change the value of this
 option.  The function @var{setfunction} should take two arguments, a
 symbol (the option name) and the new value, and should do whatever is
@@ -314,6 +329,7 @@ mean simply setting the option as a Lisp variable).  The default for
 @var{setfunction} is @code{set-default}.
 
 @item :get @var{getfunction}
+@kindex get@r{, @code{defcustom} keyword}
 Specify @var{getfunction} as the way to extract the value of this
 option.  The function @var{getfunction} should take one argument, a
 symbol, and should return whatever customize should use as the
@@ -327,6 +343,7 @@ is almost surely a mistake to specify @code{getfunction} for a value
 that really is stored in a Lisp variable.
 
 @item :initialize @var{function}
+@kindex initialize@r{, @code{defcustom} keyword}
 @var{function} should be a function used to initialize the variable
 when the @code{defcustom} is evaluated.  It should take two arguments,
 the option name (a symbol) and the value.  Here are some predefined
@@ -374,6 +391,7 @@ variables and functions will be defined, so there will not be an error.
 @end table
 
 @item :set-after @var{variables}
+@kindex set-after@r{, @code{defcustom} keyword}
 When setting variables according to saved customizations, make sure to
 set the variables @var{variables} before this one; in other words, delay
 setting this variable until after those others have been handled.  Use
@@ -425,11 +443,13 @@ an expression which evaluates to the value.
 @node Customization Types
 @section Customization Types
 
+@cindex customization types
   When you define a user option with @code{defcustom}, you must specify
 its @dfn{customization type}.  That is a Lisp object which describes (1)
 which values are legitimate and (2) how to display the value in the
 customization buffer for editing.
 
+@kindex type@r{, @code{defcustom} keyword}
   You specify the customization type in @code{defcustom} with the
 @code{:type} keyword.  The argument of @code{:type} is evaluated, but
 only once when the @code{defcustom} is executed, so it isn't useful
@@ -905,10 +925,12 @@ purposes.  This is useful for a type that appears inside of a
 @code{choice}.
 
 @item :match-alternatives @var{criteria}
+@kindex match-alternatives@r{, customization keyword}
 Use @var{criteria} to match possible values.  This is used only in
 @code{restricted-sexp}.
 
 @item :args @var{argument-list}
+@kindex args@r{, customization keyword}
 Use the elements of @var{argument-list} as the arguments of the type
 construct.  For instance, @code{(const :args (foo))} is equivalent to
 @code{(const foo)}.  You rarely need to write @code{:args} explicitly,
@@ -986,6 +1008,7 @@ If @code{nil} is not a valid value for the alternative, then it is
 essential to specify a valid default with @code{:value}.
 
 @item :format @var{format-string}
+@kindex format@r{, customization keyword}
 This string will be inserted in the buffer to represent the value
 corresponding to the type.  The following @samp{%} escapes are available
 for use in @var{format-string}:
@@ -1024,14 +1047,18 @@ Display a literal @samp{%}.
 @end table
 
 @item :action @var{action}
+@kindex action@r{, customization keyword}
 Perform @var{action} if the user clicks on a button.
 
 @item :button-face @var{face}
+@kindex button-face@r{, customization keyword}
 Use the face @var{face} (a face name or a list of face names) for button
 text displayed with @samp{%[@dots{}%]}.
 
 @item :button-prefix @var{prefix}
 @itemx :button-suffix @var{suffix}
+@kindex button-prefix@r{, customization keyword}
+@kindex button-suffix@r{, customization keyword}
 These specify the text to display before and after a button.
 Each can be:
 
@@ -1051,6 +1078,7 @@ Use @var{tag} (a string) as the tag for the value (or part of the value)
 that corresponds to this type.
 
 @item :doc @var{doc}
+@kindex doc@r{, customization keyword}
 Use @var{doc} as the documentation string for this value (or part of the
 value) that corresponds to this type.  In order for this to work, you
 must specify a value for @code{:format}, and use @samp{%d} or @samp{%h}
@@ -1061,6 +1089,7 @@ provide more information about the meanings of alternatives inside a
 @code{:choice} type or the parts of some other composite type.
 
 @item :help-echo @var{motion-doc}
+@kindex help-echo@r{, customization keyword}
 When you move to this item with @code{widget-forward} or
 @code{widget-backward}, it will display the string @var{motion-doc} in
 the echo area.  In addition, @var{motion-doc} is used as the mouse
@@ -1069,6 +1098,7 @@ to yield a help string.  If it is a function, it is called with one
 argument, the widget.
 
 @item :match @var{function}
+@kindex match@r{, customization keyword}
 Specify how to decide whether a value matches the type.  The
 corresponding value, @var{function}, should be a function that accepts
 two arguments, a widget and a value; it should return non-@code{nil} if
index e7fab3a..a60cb9a 100644 (file)
@@ -1259,6 +1259,21 @@ foo
      @result{} t
 @end example
 
+  Emacs stores the overlays of each buffer in two lists, divided
+around an arbitrary ``center position.''  One list extends backwards
+through the buffer from that center position, and the other extends
+forwards from that center position.  The center position can be anywhere
+in the buffer.
+
+@defun overlay-recenter pos
+This function recenters the overlays of the current buffer around
+position @var{pos}.  That makes overlay lookup faster for positions
+near @var{pos}, but slower for positions far away from @var{pos}.
+@end defun
+
+  A loop that scans the buffer forwards, creating overlays, can run
+faster if you do @code{(overlay-recenter (point-max))} first.
+
 @node Overlay Properties
 @subsection Overlay Properties
 
index 367932a..7b869d0 100644 (file)
@@ -7,7 +7,7 @@
 @c Version of the manual and of Emacs.
 @c Please remember to update the edition number in README as well.
 @set VERSION  2.9
-@set EMACSVER 22.0.90
+@set EMACSVER 22.0.91
 
 @dircategory Emacs
 @direntry
@@ -614,7 +614,7 @@ Keymaps
 * Key Lookup::                  How extracting elements from keymaps works.
 * Functions for Key Lookup::    How to request key lookup.
 * Changing Key Bindings::       Redefining a key in a keymap.
-* Remapping Commands::          Bindings that translate one command to another.
+* Remapping Commands::          A keymap can translate one command to another.
 * Key Binding Commands::        Interactive interfaces for redefining keys.
 * Scanning Keymaps::            Looking through all keymaps, for printing help.
 * Menu Keymaps::               A keymap can define a menu for X
index 617a2a1..f27aa35 100644 (file)
@@ -1203,17 +1203,19 @@ moved by the OS to the selected frame.)
 @cindex frame visibility
 
 A window frame may be @dfn{visible}, @dfn{invisible}, or
-@dfn{iconified}.  If it is visible, you can see its contents.  If it is
-iconified, the frame's contents do not appear on the screen, but an icon
-does.  If the frame is invisible, it doesn't show on the screen, not
-even as an icon.
+@dfn{iconified}.  If it is visible, you can see its contents, unless
+other windows cover it.  If it is iconified, the frame's contents do
+not appear on the screen, but an icon does.  If the frame is
+invisible, it doesn't show on the screen, not even as an icon.
 
 Visibility is meaningless for terminal frames, since only the selected
 one is actually displayed in any case.
 
 @deffn Command make-frame-visible &optional frame
-This function makes frame @var{frame} visible.  If you omit @var{frame},
-it makes the selected frame visible.
+This function makes frame @var{frame} visible.  If you omit
+@var{frame}, it makes the selected frame visible.  This does not raise
+the frame, but you can do that with @code{raise-frame} if you wish
+(@pxref{Raising and Lowering}).
 @end deffn
 
 @deffn Command make-frame-invisible &optional frame force
@@ -1691,7 +1693,7 @@ the third, and so on through all eight cut buffers.
 
 @defvar selection-coding-system
 This variable specifies the coding system to use when reading and
-writing selections, the clipboard, or a cut buffer.  @xref{Coding
+writing selections or the clipboard.  @xref{Coding
 Systems}.  The default is @code{compound-text-with-extensions}, which
 converts to the text representation that X11 normally uses.
 @end defvar
index 1f017b1..a9b9ca2 100644 (file)
@@ -8,12 +8,12 @@
 @chapter Keymaps
 @cindex keymap
 
-  The bindings between input events and commands are recorded in data
-structures called @dfn{keymaps}.  Each binding in a keymap associates
-(or @dfn{binds}) an individual event type, either to another keymap or to
-a command.  When an event type is bound to a keymap, that keymap is used
-to look up the next input event; this continues until a command is
-found.  The whole process is called @dfn{key lookup}.
+  The command bindings of input events are recorded in data structures
+called @dfn{keymaps}.  Each entry in a keymap associates (or
+@dfn{binds}) an individual event type, either to another keymap or to
+a command.  When an event type is bound to a keymap, that keymap is
+used to look up the next input event; this continues until a command
+is found.  The whole process is called @dfn{key lookup}.
 
 @menu
 * Key Sequences::              Key sequences as Lisp objects.
@@ -32,7 +32,7 @@ found.  The whole process is called @dfn{key lookup}.
 * Key Lookup::                  Finding a key's binding in one keymap.
 * Functions for Key Lookup::    How to request key lookup.
 * Changing Key Bindings::       Redefining a key in a keymap.
-* Remapping Commands::          Bindings that translate one command to another.
+* Remapping Commands::          A keymap can translate one command to another.
 * Translation Keymaps::         Keymaps for translating sequences of events.
 * Key Binding Commands::        Interactive interfaces for redefining keys.
 * Scanning Keymaps::            Looking through all keymaps, for printing help.
@@ -382,19 +382,21 @@ definition is a keymap; the same symbol appears in the new copy.
 @dfn{parent keymap}.  Such a keymap looks like this:
 
 @example
-(keymap @var{bindings}@dots{} . @var{parent-keymap})
+(keymap @var{elements}@dots{} . @var{parent-keymap})
 @end example
 
 @noindent
 The effect is that this keymap inherits all the bindings of
 @var{parent-keymap}, whatever they may be at the time a key is looked up,
-but can add to them or override them with @var{bindings}.
-
-If you change the bindings in @var{parent-keymap} using @code{define-key}
-or other key-binding functions, these changes are visible in the
-inheriting keymap unless shadowed by @var{bindings}.  The converse is
-not true: if you use @code{define-key} to change the inheriting keymap,
-that affects @var{bindings}, but has no effect on @var{parent-keymap}.
+but can add to them or override them with @var{elements}.
+
+If you change the bindings in @var{parent-keymap} using
+@code{define-key} or other key-binding functions, these changed
+bindings are visible in the inheriting keymap, unless shadowed by the
+bindings made by @var{elements}.  The converse is not true: if you use
+@code{define-key} to change bindings in the inheriting keymap, these
+changes are recorded in @var{elements}, but have no effect on
+@var{parent-keymap}.
 
 The proper way to construct a keymap with a parent is to use
 @code{set-keymap-parent}; if you have code that directly constructs a
index 62c7600..cf72541 100644 (file)
@@ -713,12 +713,14 @@ l
 
   Two functions modify lists that are the values of variables.
 
-@defun add-to-list symbol element &optional append
+@defun add-to-list symbol element &optional append compare-fn
 This function sets the variable @var{symbol} by consing @var{element}
 onto the old value, if @var{element} is not already a member of that
 value.  It returns the resulting list, whether updated or not.  The
 value of @var{symbol} had better be a list already before the call.
-Membership is tested using @code{equal}.
+@code{add-to-list} uses @var{compare-fn} to compare @var{element}
+against existing list members; if @var{compare-fn} is @code{nil}, it
+uses @code{equal}.
 
 Normally, if @var{element} is added, it is added to the front of
 @var{symbol}, but if the optional argument @var{append} is
index 93bb5ae..7da8805 100644 (file)
@@ -22,7 +22,7 @@
 # Standard configure variables.
 srcdir = .
 
-infodir = ../info
+infodir = $(srcdir)/../info
 usermanualdir = $(srcdir)/../man
 
 # Redefine `TEX' if `tex' does not invoke plain TeX.  For example:
@@ -106,7 +106,7 @@ $(infodir)/dir:
        $(INSTALL_INFO) --info-dir=$(infodir) $(infodir)/elisp
 
 $(infodir)/elisp: $(srcs)
-       cd $(srcdir); $(MAKEINFO) -I. -I$(infodir) elisp.texi -o $(infodir)/elisp
+       $(MAKEINFO) -I. -I$(srcdir) -o $(infodir)/elisp $(srcdir)/elisp.texi
 
 elisp.dvi: $(srcs)
        $(texinputdir) $(TEX) -I $(usermanualdir) $(srcdir)/elisp.texi
index d5e058f..4f68bb5 100644 (file)
@@ -3043,16 +3043,19 @@ constructs:
 
 @itemize
 @item
-Place a @code{font-lock-multiline}
-property on the construct when it is added to the buffer.
-@item
-Use @code{font-lock-fontify-region-function} hook to extend the scan
-so that the scanned text never starts or ends in the middle of a
-multiline construct.
-@item
 Add a function to @code{font-lock-extend-region-functions} that does
 the @emph{identification} and extends the scan so that the scanned
 text never starts or ends in the middle of a multiline construct.
+@item
+Use the @code{font-lock-fontify-region-function} hook similarly to
+extend the scan so that the scanned text never starts or ends in the
+middle of a multiline construct.
+@item
+Somehow identify the multiline construct right when it gets inserted
+into the buffer (or at any point after that but before font-lock
+tries to highlight it), and mark it with a @code{font-lock-multiline}
+which will instruct font-lock not to start or end the scan in the
+middle of the construct.
 @end itemize
 
   There are three ways to do rehighlighting of multiline constructs:
@@ -3062,18 +3065,21 @@ text never starts or ends in the middle of a multiline construct.
 Place a @code{font-lock-multiline} property on the construct.  This
 will rehighlight the whole construct if any part of it is changed.  In
 some cases you can do this automatically by setting the
-@code{font-lock-multiline} variable.
+@code{font-lock-multiline} variable, which see.
 @item
-Use @code{jit-lock-contextually}.  This will only rehighlight the part
-of the construct that follows the actual change, and will do it after
-a short delay.  This only works if the highlighting of the various
-parts of your multiline construct never depends on text in subsequent
-lines.  Since @code{jit-lock-contextually} is activated by default,
-this can be an attractive solution.
+Make sure @code{jit-lock-contextually} is set and rely on it doing its
+job.  This will only rehighlight the part of the construct that
+follows the actual change, and will do it after a short delay.
+This only works if the highlighting of the various parts of your
+multiline construct never depends on text in subsequent lines.
+Since @code{jit-lock-contextually} is activated by default, this can
+be an attractive solution.
 @item
 Place a @code{jit-lock-defer-multiline} property on the construct.
-This works only if @code{jit-lock-contextually} is used, but it can
-handle the case where highlighting depends on subsequent lines.
+This works only if @code{jit-lock-contextually} is used, and with the
+same delay before rehighlighting, but like @code{font-lock-multiline},
+it also handles the case where highlighting depends on
+subsequent lines.
 @end itemize
 
 @menu
@@ -3086,7 +3092,7 @@ handle the case where highlighting depends on subsequent lines.
 @subsubsection Font Lock Multiline
 
   One way to ensure reliable rehighlighting of multiline Font Lock
-constructs is to put on the text property @code{font-lock-multiline}.
+constructs is to put on them the text property @code{font-lock-multiline}.
 It should be present and non-@code{nil} for text that is part of a
 multiline construct.
 
index 204cfa1..bc3fd9c 100644 (file)
@@ -438,7 +438,8 @@ When matching a string instead of a buffer, @samp{^} matches at the
 beginning of the string or after a newline character.
 
 For historical compatibility reasons, @samp{^} can be used only at the
-beginning of the regular expression, or after @samp{\(} or @samp{\|}.
+beginning of the regular expression, or after @samp{\(}, @samp{\(?:}
+or @samp{\|}.
 
 @item @samp{$}
 @cindex @samp{$} in regexp
index 11be821..5a8f10f 100644 (file)
@@ -1,3 +1,7 @@
+2006-10-30  Chong Yidong  <cyd@stupidchicken.com>
+
+       * Makefile.in (lwlib-utils.o): Use CPPFLAGS.
+
 2006-09-15  Jay Belanger  <belanger@truman.edu>
 
        * COPYING: Replace "Library Public License" by "Lesser Public
        * xlwmenu.c: Include xterm.h if emacs instead of declaring functions
        used.
        (string_width): Declare as static.
-       (Start, pop_up_menu): Set is_hint to 0 before calling 
+       (Start, pop_up_menu): Set is_hint to 0 before calling
        handle_motion_event.
        (pop_up_menu): Return value and parameters for x_catch_errors and
        x_uncatch_errors changed.
 
 2005-09-27  Dan Nicolaescu  <dann@ics.uci.edu>
 
-       * xlwmenu.c (find_next_selectable): 
+       * xlwmenu.c (find_next_selectable):
        (find_prev_selectable): Add missing parameter
        declarations.
 
 2005-09-24  Dan Nicolaescu  <dann@ics.uci.edu>
 
        * xlwmenu.c: Fix the return type for x_clear_errors and
-       x_uncatch_errors. 
+       x_uncatch_errors.
 
 2005-07-19  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
 
-       * lwlib-Xm.c (make_menu_in_widget): Disable drag and drop for 
+       * lwlib-Xm.c (make_menu_in_widget): Disable drag and drop for
        labels in menu bar.
 
 2005-07-04  Lute Kamstra  <lute@gnu.org>
 
 ;; Local Variables:
 ;; coding: iso-2022-7bit-unix
+;; add-log-time-zone-rule: t
 ;; End:
 
     Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2006
index dd2bb65..af9c2a2 100644 (file)
@@ -47,7 +47,7 @@ liblw.a: $(OBJS)
 
 # Depend on Makefile so that we recompile if TOOLKIT_DEFINES changes.
 lwlib.o:  $(srcdir)/lwlib.c  Makefile
-       $(CC) -c $(TOOLKIT_DEFINES) $(ALL_CFLAGS) $(srcdir)/lwlib.c
+       $(CC) -c $(CPPFLAGS) $(TOOLKIT_DEFINES) $(ALL_CFLAGS) $(srcdir)/lwlib.c
 
 lwlib-utils.o: lwlib-utils.c lwlib-utils.h
 lwlib.o:       lwlib.c lwlib.h lwlib-int.h lwlib-Xaw.h lwlib-Xlw.h
index 914874c..038d749 100644 (file)
@@ -1,3 +1,17 @@
+2006-11-24  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * INSTALL: Add descriptions about configuration and invocation.
+       Capitalize `Carbon'.
+
+2006-11-14  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * inc/config.h: Sync with src/config.in.
+
+2006-11-08  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * INSTALL: Remove descriptions about --without-x.  Remove
+       --without-carbon from configure options for X11 build.
+
 2006-09-19  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
        * INSTALL: Remove descriptions about experimental flags.
        GetScrapFlavorFlags.
 
        * src/macfns.c: Synchronize with changes in w32fns.c.
-       [MAC_OSX]: Include Carbon headers.
+       [MAC_OSX]: Include Carbon headers.
        (x_real_positions): Use Carbon routine GetWindowPortBounds.
        (x_set_scroll_bar_width): Set width of scroll bar to 16.
        (x_make_gc): Remove static qualifier.
 
 ;; Local Variables:
 ;; coding: iso-2022-7bit-unix
+;; add-log-time-zone-rule: t
 ;; End:
 
     Copyright (C) 2001, 2002, 2003, 2004, 2005,
index 4830958..d297cfb 100644 (file)
@@ -1,5 +1,5 @@
 /* Localized versions of Info.plist keys */
 
 CFBundleName = "Emacs";
-CFBundleShortVersionString = "22.0.90";
-CFBundleGetInfoString = "22.0.90, Copyright (C) 2006 Free Software Foundation, Inc.";
+CFBundleShortVersionString = "22.0.91";
+CFBundleGetInfoString = "22.0.91, Copyright (C) 2006 Free Software Foundation, Inc.";
index 3e27f8e..de9e760 100644 (file)
@@ -29,14 +29,10 @@ you try to install into /usr (with ./configure --prefix=/usr), then you
 must install as root using the sudo command.  However, it is not
 recommended; see the notes section below for more details.
 
-The --enable-carbon-app specifies that the carbon GUI application
+The --enable-carbon-app specifies that the Carbon GUI application
 should be installed into /Application.  If you want it to install in a
 different location, specify --enable-carbon-app=<mydir>
 
-If you have X Window installed on your Mac and you are building Emacs
-to run under Carbon and not X Window, you need to type `./configure
---without-x' instead of `./configure'.
-
 You can type `make bootstrap' instead of `make' to rebuild everything,
 including byte-compiling the Lisp files.
 
@@ -47,23 +43,31 @@ GNU texinfo package are given below.  Alternatively, you can type `make
 -k' instead of `make' and safely ignore the error messages and use the
 existing info files.
 
-After Emacs is installed, you can run it by typing `emacs -nw' from a
-terminal (make sure your path contains /usr/local/bin) or by
-double-clicking on /Applications/Emacs.app in the Finder.  To start
-Emacs as a GUI application from the terminal, the pathname to the
-executable in the bundle, i.e.,
+After Emacs is installed, you can run a text-only terminal version by
+typing `emacs' from a terminal (make sure your path contains
+/usr/local/bin) or a GUI application by double-clicking on
+/Applications/Emacs.app in the Finder.  Even in the terminal version,
+some Carbon-specific functions such as `mac-set-file-creator' are
+still meaningful.
+
+To start Emacs as a GUI application from the terminal, the pathname to
+the executable in the bundle, i.e.,
 
   /Application/Emacs.app/Contents/MacOS/Emacs
 
 must be typed to the shell to enable Emacs to locate its resources
-correctly.  You may want to create a symlink or alias to this path to
-quickly access both the terminal and GUI versions.
+correctly.  You may want to create an alias to this path to quickly
+access both the terminal and GUI versions.  You can specify some
+standard Emacs options when invoking Emacs in this way.
 
-If you are building Emacs to run on Mac OS X and X Window,
-instead of typing `./configure' above, type
+Emacs on Mac OS X is not configured to use X11 unless either it is
+requested or the use of Carbon is disabled explicitly.  So, if you are
+building Emacs to run on X Window System, you need to specify like:
 
-  ./configure --without-carbon --with-x
+  ./configure --with-x
 
+Note that the Carbon-specific functions mentioned above are not
+available on the X11-enabled build.
 
 To use colors in a terminal, put the following lines in the file
 ~/.termcap and log in again.
@@ -134,7 +138,7 @@ If you are intending to build a binary distribution of Emacs, there is
 a script that will greatly simplify the process.  It is called
 make-package and it is contained in this directory.  It will generate
 a disc image containing a installer bundle.  By default the installer
-will place the emacs common files in /usr/local/* and the carbon
+will place the emacs common files in /usr/local/* and the Carbon
 application in /Applications.  Typical usage would be
 
 ./make-package
index e340120..3af1f35 100644 (file)
@@ -102,16 +102,13 @@ Boston, MA 02110-1301, USA.  */
 /* #undef HAVE_ALSA */
 
 /* Define to 1 if you have the `bcmp' function. */
-/* #define HAVE_BCMP */
+/* #undef HAVE_BCMP */
 
 /* Define to 1 if you have the `bcopy' function. */
-/* #define HAVE_BCOPY */
+/* #undef HAVE_BCOPY */
 
 /* Define to 1 if you have the `bzero' function. */
-/* #define HAVE_BZERO */
-
-/* Define to 1 if CancelMenuTracking is available (Mac OSX). */
-/* #undef HAVE_CANCELMENUTRACKING */
+/* #undef HAVE_BZERO */
 
 /* Define to 1 if you are using the Carbon API on Mac OS X. */
 /* #undef HAVE_CARBON */
@@ -451,7 +448,7 @@ Boston, MA 02110-1301, USA.  */
 /* #undef HAVE_MREMAP */
 
 /* Define to 1 if you have the <net/if.h> header file. */
-/* #define HAVE_NET_IF_H */
+/* #undef HAVE_NET_IF_H */
 
 /* Define to 1 if you have the <nlist.h> header file. */
 /* #undef HAVE_NLIST_H */
index 30f572e..73be848 100644 (file)
@@ -221,10 +221,10 @@ resource 'vers' (1) {
        0x22,           /* Major revision in BCD */
        0x0,            /* Minor revision in BCD */
        alpha,  /* development, alpha, beta, or final (release) */
-       90,             /* Non-final release # */
+       91,             /* Non-final release # */
        0,              /* Region code */
-       "22.0.90",      /* Short version number */
-       "22.0.90, Copyright \0xa9 2006 "
+       "22.0.91",      /* Short version number */
+       "22.0.91, Copyright \0xa9 2006 "
        "Free Software Foundation, Inc." /* Long version number */
 };
 
index 4fa4ab7..eaa24e8 100755 (executable)
--- a/make-dist
+++ b/make-dist
@@ -632,6 +632,7 @@ echo "Making links to \`info'"
 echo "Making links to \`man'"
 (cd man
  ln *.texi *.aux *.cps *.fns *.kys *.vrs ../${tempdir}/man
+ ln makefile.w32-in ../${tempdir}/man
  test -f README && ln README ../${tempdir}/man
  test -f Makefile.in && ln Makefile.in ../${tempdir}/man
  ln ChangeLog ../${tempdir}/man
@@ -646,6 +647,7 @@ echo "Making links to \`lispref'"
  ln `ls -1 *.texi` ../${tempdir}/lispref
  ln *.aux *.cps *.fns *.kys *.vrs ../${tempdir}/lispref
  ln *.txt *.el spellfile tindex.pl ../${tempdir}/lispref
+ ln makefile.w32-in ../${tempdir}/lispref
  test -f README && ln README ../${tempdir}/lispref
  test -f Makefile.in && ln Makefile.in ../${tempdir}/lispref
  ln ChangeLog ../${tempdir}/lispref
@@ -656,6 +658,7 @@ echo "Making links to \`lispref'"
 echo "Making links to \`lispintro'"
 (cd lispintro
  ln *.texi *.aux *.cps *.fns *.kys *.vrs *.eps ../${tempdir}/lispintro
+ ln makefile.w32-in ../${tempdir}/lispintro
  test -f texinfo.tex && ln texinfo.tex ../${tempdir}/lispintro
  test -f README && ln README ../${tempdir}/lispintro
  test -f Makefile.in && ln Makefile.in ../${tempdir}/lispintro
index 34728d0..1d07178 100644 (file)
@@ -1,3 +1,132 @@
+2006-12-01  Eli Zaretskii  <eliz@gnu.org>
+
+       * mule.texi (Enabling Multibyte): Rephrase the confusing reference to a
+       colon in the mode line.
+
+       * msdog.texi (Windows Processes) [@ifnottex]: Mention
+       w32-shell-execute.
+
+2006-11-26  Nick Roberts  <nickrob@snap.net.nz>
+
+       * building.texi (Watch Expressions): Mention SPC for expanding/
+       contracting watch expressions.
+
+2006-11-26  Kim F. Storm  <storm@cua.dk>
+
+       * kmacro.texi (Basic Keyboard Macro): Mention F3/F4 more.
+
+2006-11-26  Nick Roberts  <nickrob@snap.net.nz>
+
+       * building.texi (Debugger Operation): Define text command mode.
+       Clarify how tooltips work.
+       (GDB Graphical Interface): Explain how to run in text command mode
+       more clearly.
+
+2006-11-25  Juanma Barranquero  <lekktu@gmail.com>
+
+       * mule.texi (Defining Fontsets): Fix use of `charset' and `font'.
+
+2006-11-22  Juanma Barranquero  <lekktu@gmail.com>
+
+       * anti.texi (Antinews): Mention --server-file and TCP sockets.
+
+2006-11-20  Michael Olson  <mwolson@gnu.org>
+
+       * erc.texi: Call this the 5.2 stable pre-release of ERC.
+
+2006-11-18  Chong Yidong  <cyd@stupidchicken.com>
+
+       * misc.texi (Interactive Shell): INSIDE_EMACS is set to t,
+       and EMACS is deprecated.
+
+2006-11-18  Juanma Barranquero  <lekktu@gmail.com>
+
+       * makefile.w32-in (emacs.dvi): Remove xresmini.texi.
+
+2006-11-18  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * Makefile.in (emacs.dvi): Remove xresmini.texi.
+
+       * emacs.texi: Include xresources.texi both for info and dvi.
+
+       * xresources.texi: Merge text from xresmini.texi.
+
+2006-11-17  Carsten Dominik  <dominik@science.uva.nl>
+
+       * org.texi: Fix typos.
+       (Agenda commands): Document `C-k'.
+
+2006-11-16  Eli Zaretskii  <eliz@gnu.org>
+
+       * url.texi (http/https): Fix a typo in the HTTP URL.
+
+2006-11-14  Stephen Leake  <stephen_leake@stephe-leake.org>
+
+       * ada-mode.texi: Total rewrite.
+
+2006-11-13  Carsten Dominik  <dominik@science.uva.nl>
+
+       * org.texi: Minor typo fixes.
+
+2006-11-13  Bill Wohler  <wohler@newt.com>
+
+       Release MH-E manual version 8.0.3.
+
+       * mh-e.texi (VERSION, EDITION, UPDATED, UPDATE-MONTH): Update for
+       release 8.0.3.
+
+       * mh-e.texi (Incorporating Mail): Use output of "mhparam Path"
+       to set MAILDIR.
+       (Reading Mail): Document the customization of read-mail-command
+       for MH-E.
+       (Viewing Attachments): Document mm-discouraged-alternatives.
+       (Tool Bar): Fix Texinfo for mh-xemacs-use-tool-bar-flag.
+       (Junk): Add more information about the settings of mh-junk-background
+       in a program.  Add /usr/bin/mh to PATH in examples.
+
+2006-11-12  Richard Stallman  <rms@gnu.org>
+
+       * woman.texi: Update author address but say he no longer maintains it.
+
+2006-11-12  Roberto Rodr\e,Am\e(Bguez  <lanubeblanca@googlemail.com>  (tiny change)
+
+       * glossary.texi: Fix typos.
+
+2006-11-10  Carsten Dominik  <carsten.dominik@gmail.com>
+
+       * org.texi (ARCHIVE tag): Document C-TAB for forcing cycling of
+       archived trees.
+       (Checkboxes): Section moved to chapter 5, and extended.
+       (The date/time prompt): New section.
+       (Link abbreviations): New section.
+       (Presentation and sorting): New section.
+       (Custom agenda views): Section completely rewritten.
+       (Summary): Compare with Planner.
+       (Feedback): More info about creating backtraces.
+       (Plain lists): Modified example.
+       (Breaking down tasks): New section.
+       (Custom time format): New section.
+       (Time stamps): Document inactive timestamps.
+       (Setting tags): More details about fast tag selection.
+       (Block agenda): New section.
+       (Custom agenda views): Section rewritten.
+       (Block agenda): New section.
+
+2006-11-07  Michael Albinus  <michael.albinus@gmx.de>
+
+       * tramp.texi (Configuration): scp is the default method.
+       (Default Method): Use ssh as example for another method.
+
+2006-11-06  Richard Stallman  <rms@gnu.org>
+
+       * emacs.texi (Acknowledgments): Fix name spelling, add Anna Bigatti.
+
+       * ack.texi (Acknowledgments): Fix name spelling.
+
+2006-11-01  Juri Linkov  <juri@jurta.org>
+
+       * search.texi (Word Search): Document incremental word search.
+
 2006-10-28  Glenn Morris  <rgm@gnu.org>
 
        * ack.texi (Acknowledgments): Add cal-html author.
 
 2003-02-01  Kevin Ryde  <user42@zip.com.au>
 
-        * glossary.texi (Glossary): Correction to cl cross reference.
+       * glossary.texi (Glossary): Correction to cl cross reference.
 
 2003-01-20  Richard M. Stallman  <rms@gnu.org>
 
        `info' file.
 
        * frames.texi (Creating Frames): Mention `C-x 5' instead of `C-x
-       4' where appropriate.
+       4' where appropriate.
 
 1993-10-20  Brian Fox  (bfox@ai.mit.edu)
 
 ;; Local Variables:
 ;; coding: iso-2022-7bit
 ;; fill-column: 79
+;; add-log-time-zone-rule: t
 ;; End:
 
     Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002,
index 61f7752..5008cfb 100644 (file)
@@ -144,7 +144,7 @@ info.dvi: ${INFOSOURCES}
 ../info/emacs: ${EMACSSOURCES}
        cd $(srcdir); $(MAKEINFO) emacs.texi
 
-emacs.dvi: ${EMACSSOURCES} $(srcdir)/xresmini.texi
+emacs.dvi: ${EMACSSOURCES}
        $(ENVADD) $(TEXI2DVI) ${srcdir}/emacs.texi
 
 # This target is here so you could easily get the list of the *.texi
index 29279c4..36e9b53 100644 (file)
@@ -735,7 +735,7 @@ expression from a list of strings.  He also extended @file{comint.el},
 originally written by Olin Shivers.
 
 @item
-Bengt Martensson, Mark Shapiro, Mike Newton, Aaron Larson, and Stefan
+Bengt Martensson, Marc Shapiro, Mike Newton, Aaron Larson, and Stefan
 Schoef, wrote @file{bibtex.el}, a mode for editing Bib@TeX{}
 bibliography files.
 
dissimilarity index 78%
index aebb66b..9d25370 100644 (file)
-\input texinfo  @c -*-texinfo-*-
-@setfilename ../info/ada-mode
-@settitle Ada Mode
-
-@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-@comment The following lines inserts the copyright notice
-@comment into the Info file.
-@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-@copying
-Copyright @copyright{} 1999, 2000, 2001, 2002, 2003, 2004,
-2005, 2006 Free Software Foundation, Inc.
-
-@quotation
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.2 or
-any later version published by the Free Software Foundation; with the
-Invariant Sections being ``The GNU Manifesto'', ``Distribution'' and
-``GNU GENERAL PUBLIC LICENSE'', with the Front-Cover texts being ``A GNU
-Manual'', and with the Back-Cover Texts as in (a) below.  A copy of the
-license is included in the section entitled ``GNU Free Documentation
-License'' in the Emacs manual.
-
-(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
-this GNU Manual, like GNU software.  Copies published by the Free
-Software Foundation raise funds for GNU development.''
-
-This document is part of a collection distributed under the GNU Free
-Documentation License.  If you want to distribute this document
-separately from the collection, you can do so by adding a copy of the
-license to the document, as described in section 6 of the license.
-@end quotation
-@end copying
-
-@dircategory Emacs
-@direntry
-* Ada mode: (ada-mode). Emacs mode for editing Ada code.
-@end direntry
-
-@titlepage
-@sp 10
-@title{Ada Mode}
-@sp 2
-@subtitle An Emacs major mode for programming Ada 95 with GNAT
-@subtitle July 1998 for Ada Mode Version 3.0
-@sp 2
-@page
-@vskip 0pt plus 1filll
-@insertcopying
-@end titlepage
-
-
-@node Top, Overview, (dir), (dir)
-
-@menu
-* Overview::
-* Installation::                  Installing Ada mode on your system
-* Customization::                 Setting up Ada mode to your taste
-* Project files::                 Describing the organization of your project
-* Syntax highlighting::           Using specific colors and fonts to highlight
-                                    the structure of your files
-* Moving Through Ada Code::       Moving easily through Ada sources
-* Identifier completion::         Finishing words automatically
-* Index Menu of Subprograms::     A menu of all the types and subprograms
-                                     defined in your application
-* File Browser::                  Easy access to your files
-* Automatic Smart Indentation::   Indenting your code automatically as you type
-* Formatting Parameter Lists::    Formatting subprograms' parameter lists
-                                     automatically
-* Automatic Casing::              Adjusting the case of words automatically
-* Statement Templates::           Inserting code templates
-* Comment Handling::              Reformatting comments easily
-* Compiling Executing::           Working with your application within Emacs
-* Debugging::                     Debugging your application
-* Using non-standard file names:: Configuring Emacs for special file names
-* Working Remotely::              Working on a different machine
-* Index::
-@end menu
-
-
-@c -----------------------------------------------------------------------
-@node Overview, Installation, Top, Top
-@chapter Overview
-@c -----------------------------------------------------------------------
-
-The Emacs mode for programming in Ada 95 with GNAT helps the user in
-understanding existing code and facilitates writing new code.  It
-furthermore provides some utility functions for easier integration of
-standard Emacs features when programming in Ada.
-
-@section General features:
-
-@itemize @bullet
-@item
-full Integrated Development Environment:
-@itemize @bullet
-@item
-support of ``project files'' for the configuration (directories,
-compilation options,...)
-@item
-compiling and stepping through error messages.
-@item
-running and debugging your applications within Emacs.
-@end itemize
-@item
-easy to use for beginners by pull-down menus,
-@item
-user configurable by many user-option variables.
-@end itemize
-
-@section Ada mode features that help understanding code:
-
-@itemize @bullet
-@item
-functions for easy and quick stepping through Ada code,
-@item
-getting cross reference information for identifiers (e.g. find the
-defining place by a keystroke),
-@item
-displaying an index menu of types and subprograms and move point to
-the chosen one,
-@item
-automatic color highlighting of the various entities in Ada code.
-@end itemize
-
-@section Emacs support for writing Ada code:
-
-@itemize @bullet
-@item
-switching between spec and body files with eventually
-auto-generation of body files,
-@item
-automatic formatting of subprograms' parameter lists.
-@item
-automatic smart indentation according to Ada syntax,
-@item
-automatic completion of identifiers,
-@item
-automatic casing of identifiers, keywords, and attributes,
-@item
-insertion of statement templates,
-@item
-filling comment paragraphs like filling normal text,
-@end itemize
-
-@c -----------------------------------------------------------------------
-@node Installation, Customization, Overview, Top
-@chapter Installation
-@c -----------------------------------------------------------------------
-
-If you  got Ada mode as  a separate distribution, you  should have a
-look at the  @file{README} file.  It explains the  basic steps necessary
-for a good installation of the emacs Ada mode.
-
-Installing the  Ada mode  is basically  just a matter  of copying  a few
-files into  the Emacs  library directories. Every  time you open  a file
-with  a  file  extension  of  @file{.ads}  or  @file{.adb},  Emacs  will
-automatically load and activate Ada mode.
-
-@xref{Using non-standard file names}, if your files do
-not use these extensions and if you want Emacs to automatically start the
-Ada mode every time you edit an Ada file.
-
-Also, for general usage variables that you might want to set,
-see
-@iftex
-@cite{The GNU Emacs Manual}.
-@end iftex
-@ifhtml
-@cite{The GNU Emacs Manual}.
-@end ifhtml
-@ifinfo
-@ref{Top, , The GNU Emacs Manual, emacs, The GNU Emacs Manual}.
-@end ifinfo
-
-@c ---------------------------------------------------------------------
-@section Required files
-@c ---------------------------------------------------------------------
-
-This Ada  mode works best  with Emacs 20.3  or higher (the  easy editing
-features for the  project files won't work with  any older version), but
-most of the commands should work  with older versions too. Please try to
-install  the  most  recent  version  of  Emacs  on  your  system  before
-installing Ada mode.
-
-Although part of Ada mode is compiler-independent, the most advanced
-features are specific to the Gnat compiler @url{http://www.gnat.com}.
-
-The following files are provided with the Ada mode distribution:
-
-@itemize @bullet
-
-@item
-@file{ada-mode.el}: The main file for Ada mode.
-This  is the  only file  which does  not require  Gnat. It  contains the
-functions  for  indentation,  formatting  of parameter  lists,  stepping
-through  code, comment  handling and  automatic casing.   Emacs versions
-20.2 and higher already contain Ada mode version 2.27, which is an older
-version of this file  and should be replaced. Loading @file{ada-mode.el}
-from the current distribution supersedes the standard installation.
-
-@item
-@file{ada-stmt.el}: Contains the statement templates feature.
-
-@item
-@file{ada-xref.el}: This file provides the main support for Gnat.
-This  is  where  the   functions  for  cross-references,  completion  of
-identifiers,  support   for  project  files  and   compilation  of  your
-application are defined.
-
-@item
-@file{ada-prj.el}: The functions to use for easy-edition of the
-project files.  This file is the only one which really requires Emacs
-at least 20.2. It uses the new widget features from Emacs.
-
-@end itemize
-
-@c --------------------------------------------------------------------
-@node Customization, Project files, Installation, Top
-@chapter Customizing Ada mode
-@c ---------------------------------------------------------------------
-
-Ada mode is  fully customizable. Everything, from the  file names to
-the automatic  indentation and  the automatic casing  can be  adapted to
-your own needs.
-
-There  are   two  different  kinds   of  variables  that   control  this
-customization, both are easy to modify.
-
-The first set of variables are standard Emacs variables. Of course, some
-are defined  only for Ada  mode, whereas others have  a more general
-meaning  in   Emacs.  Please  see  the  Emacs   documentation  for  more
-information on the latest. In this documentation, we will detail all the
-variables that are specific to Ada mode, and a few others. The names
-will be given, as in @code{ada-case-identifier}.
-
-Emacs provides an easy way to modify them, through a special mode called
-customization.    To    access    this    mode,    select    the    menu
-@samp{Ada->Customize}.  This will open a new buffer with some fields that
-you can edit.  For instance, you will get something like:
-@example
-Put below the compiler switches.
-comp_opt= _____________________________________
-@end example
-The first  line gives a brief  description of the  variable.  The second
-line is  the name of  the variable  and the field  where you can  give a
-value for this variable. Simply type what you want in the field.
-
-When you are  finished modifying the variables, you  can simply click on
-the @b{Save for future sessions} button  at the top of the buffer (click
-with  the  middle mouse  button).  This will  save  the  values in  your
-@file{.emacs} file, so that next time you start Emacs they will have the
-same values.
-
-To modify a specific variable, you can directly call the function
-@code{customize-variable} from Emacs (just type @kbd{M-x
-customize-variable @key{RET} @var{variable-name} @key{RET}}).
-
-Some users might prefer to modify the variables directly in their
-configuration file, @file{.emacs}. This file is coded in Emacs lisp, and
-the syntax to set a variable is the following:
-@example
-(setq variable-name value)
-@end example
-
-The second set of variables for customization are set through the use of
-project files. These variables are  specific to a given project, whereas
-the  first   set  was  more   general.  For  more   information,  please
-@xref{Project files}.
-
-@c ---------------------------------------------------------------------
-@node Project files, Syntax highlighting, Customization, Top
-@chapter Project files
-@c ---------------------------------------------------------------------
-
-@c ---------------------------------------------------------------------
-@section General overview
-@c ---------------------------------------------------------------------
-
-Emacs provides a full Integrated Development Environment for GNAT and
-Ada programmers. That is to say, editing, compiling, executing and
-debugging can be performed within Emacs in a convenient and natural way.
-
-To take full advantage of this features, it is possible to create a file
-in  the main  directory of  your application,  with a  @samp{.adp} extension.
-This  file contains  all needed  information  dealing with  the way  your
-application is  organized between directories, the  commands to compile,
-run and debug it etc. Creating this file is not mandatory and convenient
-defaults are  automatically provided for simple setups.  It only becomes
-necessary when those above mentioned defaults need customizing.
-
-A simple way to edit this file is provided for Emacs 20.2 or newer, with
-the  following functions,  that  you  can access  also  through the  Ada
-menu. It  is also possible  to edit the  project file as a  regular text
-file.
-
-Once  in the  buffer for  editing the  project file,  you can  save your
-modification using  the @samp{[OK]}  button at the  bottom of the  buffer, or
-simply   use  the  usual   @kbd{C-x  C-s}   binding.   To   cancel  your
-modifications, simply kill the buffer  or click on the @samp{[CANCEL]} button
-at the button.
-
-Each buffer using Ada mode will be associated with one project file when
-there  is one  available,  so  that Emacs  can  easily navigate  through
-related source files for instance.
-
-The exact algorithm to determine which project file should be used is
-described in the next section, but you can force the project file you
-want to use by setting one or two variables in your @file{.emacs} file.
-
-@itemize @bullet
-@item
-To set up a default project file to use for any directory, anywhere
-on your system, set the variable @code{ada-prj-default-project-file} to
-the name of that file.
-
-@example
-(set 'ada-prj-default-project-file "/dir1/dir2/file")
-@end example
-
-@item
-For finer control, you can set a per-directory project file.
-This is done through the variable @code{ada-xref-default-prj-file}.
-
-@example
-  (set 'ada-xref-default-prj-file
-       '(("/dir1/dir2" . "/dir3/file1")
-         ("/dir4/dir5" . "/dir6/file2")))
-@end example
-
-Note: This has a higher priority than the first variable, so the first
-choice is to use this variable's settings, and otherwise
-@code{ada-prj-default-project-file}.
-@end itemize
-
-
-@table @kbd
-@item C-c u
-@findex ada-customize
-Create or edit the project file for the current buffer (@code{ada-customize}).
-@item C-c c
-@findex ada-change-prj
-Change the project file associated with the current Ada buffer (@code{ada-change-prj}).
-@item C-c d
-@findex ada-change-default-project
-Change the  default project  file for the  current directory
-(@code{ada-change-default-project}).  Every new file opened  from this
-directory will be  associated with that  file by default.
-@item ada-set-default-project-file
-@findex ada-set-default-project-file
-Set the default  project file to use for *any*  Ada file opened anywhere
-on your system. This sets this file only for the current Emacs session.
-@end table
-
-@c ---------------------------------------------------------------------
-@section Project file variables
-@c ---------------------------------------------------------------------
-
-The following variables can be defined in a project file.  They all have
-a default value, so that small  projects do not need to create a project
-file.
-
-Some  variables below  can be  referenced  in other  variables, using  a
-shell-like  notation.   For instance,  if  the variable  @code{comp_cmd}
-contains a sequence like @code{$@{comp_opt@}}, the value of that variable
-will be substituted.
-
-Here is the list of variables:
-
-@table @asis
-@item @code{src_dir}          [default: @code{"./"}]
-This is  a list of directories where Ada mode will  look for source
-files. These directories are used mainly  in two cases, both as a switch
-for the compiler and for the cross-references.
-
-@item @code{obj_dir}             [default: @code{"./"}]
-This is a list of directories where to look for object and library
-files.  The library files are the @samp{.ali} files generated by Gnat
-and that contain cross-reference informations.
-
-@item @code{comp_opt}            [default: @code{""}]
-Creates a  variable which can be  referred to subsequently  by using the
-@code{$@{comp_opt@}} notation.   This is  intended to store  the default
-switches given to @command{gnatmake} and @command{gcc}.
-
-@item @code{bind_opt=@var{switches}}   [default: @code{""}]
-Creates a  variable which can be  referred to subsequently  by using the
-@code{$@{bind_opt@}} notation.   This is  intended to store  the default
-switches given to @command{gnatbind}.
-
-@item @code{link_opt=@var{switches}}   [default: @code{""}]
-Creates a  variable which can be  referred to subsequently  by using the
-@code{$@{link_opt@}} notation.   This is  intended to store  the default
-switches given to @command{gnatlink}.
-
-@item @code{main=@var{executable}}     [default: @code{""}]
-Specifies the name of the  executable for the application. This variable
-can be referred to in  the following lines by using the @code{$@{main@}}
-notation.
-
-@item @code{cross_prefix=@var{prefix}} [default: @code{""}]
-This variable  should be set if  you are working  in a cross-compilation
-environment. This is the prefix used in front of the gnatmake commands.
-
-@item @code{remote_machine=@var{machine}} [default: @code{""}]
-This is the name of the machine to log into before issuing the
-compilation command. If this variable is empty, the command will be
-run on the local machine. This will not work on Windows NT machines,
-since Ada mode will simply precede the compilation command with a
-@command{rsh} command, unknown on Windows.
-
-@item @code{comp_cmd=@var{command}}    [default: @code{"$@{cross_prefix@}gcc -c -I$@{src_dir@} -g -gnatq"}]
-Specifies the command used to compile a single file in the application.
-The name of the file will be added at the end of this command.
-
-@item @code{make_cmd=@var{command}}    [default: @code{"$@{cross_prefix@}gnatmake $@{main@} -aI$@{src_dir@} -aO$@{obj_dir@} -g -gnatq -cargs $@{comp_opt@} -bargs $@{bind_opt@} -largs $@{link_opt@}"]}'
-Specifies the command used to recompile the whole application.
-
-@item @code{run_cmd=@var{command}}     [default: @code{"$@{main@}"}]
-Specifies the command used to run the application.
-
-@item @code{debug_cmd=@var{command}}   [default: @code{"$@{cross_prefix@}gdb $@{main@}"}]
-Specifies the command used to debug the application
-
-@end table
-
-@c ---------------------------------------------------------------------
-@section Detailed algorithm
-@c ---------------------------------------------------------------------
-
-This section gives more details on the project file setup and is only of
-interest for advanced users.
-
-Usually, an Ada file is part  of a larger application, whose sources and
-objects can be spread over multiple directories. The first time emacs is
-asked to compile, run or debug an application, or when a cross reference
-function is  used (goto declaration  for instance), the  following steps
-are taken:
-
-@itemize @bullet
-@item
-find the appropriate project file, open and parse it.
-All  the fields  read  in the  project  file are  then  stored by  emacs
-locally.  Finding the project file requires a few steps:
-
-@itemize @minus
-@item
-if a file from the same directory was already associated with
-a project file, use the same one. This is the variable
-@code{ada-xref-default-prj-file} described above.
-@item
-if the variable @code{ada-prj-default-project-file} is set,
-use the project file specified in this variable.
-@item
-if there is a project file whose name is the same as the source file
-except for the suffix, use this one.
-@item
-if  there's only one project file in the source directory, use
-that one.
-@item
-if there are more than one project file in the source directory,
-ask the user.
-@item
-if there are no project files in the source directory use standard
-default values.
-@end itemize
-
-The first project file that is selected in a given directory becomes the
-default project file for this directory and is used implicitly for other
-sources unless specified otherwise by the user.
-
-@item
-look for the corresponding @samp{.ali} file in the @code{obj_dir} defined
-in the project  file.  If this file can not be  found, emacs proposes to
-compile the source using the @code{comp_cmd} defined in the project file
-in order to create the ali file.
-
-@item
-when cross referencing is requested, the @samp{.ali}  file is parsed to
-determine  the  file and  line  of  the  identifier definition.   It  is
-possible for  the @samp{.ali} file to be  older than the source  file,
-in which case it will be recompiled if the variable
-@code{ada-xref-create-ali} is set, otherwise the  reference is searched
-in the  obsolete ali file with possible inaccurate results.
-
-@item
-look  for   the file containing the declaration using the source
-path @code{src_dir} defined in the  project file.  Put the cursor at the
-correct position and display this new cursor.
-@end itemize
-
-@c -----------------------------------------------------------------------
-@node Syntax highlighting, Moving Through Ada Code, Project files, Top
-@chapter Syntax highlighting
-@c -----------------------------------------------------------------------
-
-Ada mode is made to help you understand the structure of your source
-files. Some  people like having  colors or different fonts  depending on
-the  context: commands  should be  displayed differently  than keywords,
-which should also be different from strings, @dots{}
-
-Emacs is able to display in a different way the following syntactic
-entities:
-
-@itemize @bullet
-@item keywords
-@item commands
-@item strings
-@item gnatprep statements (preprocessor)
-@item types (under certain conditions)
-@item other words
-@end itemize
-
-This  is not  the default  behavior for  Emacs. You  have  to explicitly
-activate it. This requires that you add a new line in your @file{.emacs}
-file (if this file does not exist, just create it).
-
-@example
-(global-font-lock-mode t)
-@end example
-
-But  the default colors  might not  be the  ones you  like. Fortunately,
-there  is  a  very  easy  way  to change  them.  Just  select  the  menu
-@samp{Help->Customize->Specific  Face...}  and  press @key{RET}.  This
-will display a buffer will all the ``faces'' (the colors) that Emacs knows
-about. You can change any of them.
-
-
-@c -----------------------------------------------------------------------
-@node Moving Through Ada Code, Identifier completion, Syntax highlighting, Top
-@chapter Moving Through Ada Code
-@c -----------------------------------------------------------------------
-
-There are several  easy to use commands to stroll  through Ada code. All
-these functions are available through the Ada menu, and you can also use
-the following key bindings or the command names:
-
-@table @kbd
-@item C-M-e
-@findex ada-next-procedure
-Move to the next function/procedure/task, which ever comes next
-(@code{ada-next-procedure}).
-@item C-M-a
-@findex ada-previous-procedure
-Move to previous function/procedure/task
-(@code{ada-previous-procedure}).
-@item M-x ada-next-package
-@findex ada-next-package
-Move to next package.
-@item M-x ada-prev-package
-@findex ada-prev-package
-Move to previous package.
-@item C-c C-a
-@findex ada-move-to-start
-Move to matching start of @code{end} (@code{ada-move-to-start}).  If
-point is at the end of a subprogram, this command jumps to the
-corresponding @code{begin} if the user option
-@code{ada-move-to-declaration} is @code{nil} (default), it jumps to
-the subprogram declaration otherwise.
-@item C-c C-e
-@findex ada-move-to-end
-Move point to end of current block (@code{ada-move-to-end}).
-@item C-c o
-Switch between corresponding spec and body file
-(@code{ff-find-other-file}).  If the cursor is on a subprogram, switch
-between declaration and body.
-@item C-c c-d
-@findex ada-goto-declaration
-Move  from   any  reference  to  its  declaration   and  switch  between
-declaration  and body  (for  procedures, tasks,  private and  incomplete
-types).
-@item C-c C-r
-@findex ada-find-references
-runs the @file{gnatfind} command to search for all references to the
-entity pointed by the cursor (@code{ada-find-references}).  Use
-@kbd{C-x `} (@code{next-error}) to visit each reference (as for
-compilation errors).
-@end table
-
-These  functions use  the  information in  the  output of  the Gnat  Ada
-compiler.   However,   if  your   application  was  compiled   with  the
-@samp{-gnatx}  switch, these  functions will  not work,  since  no extra
-information  is generated by  GNAT. See  GNAT documentation  for further
-information.
-
-Emacs will  try to  run    Gnat for  you whenever the    cross-reference
-informations  are     older   than your   source   file   (provided  the
-@code{ada-xref-create-ali} variable is  non-@code{nil}).  Gnat  then produces a
-file with the same name  as the current  Ada file but with the extension
-changed to @file{.ali}. This files are normally used  by the binder, but
-they will also contain additional cross-referencing information.
-
-@c -----------------------------------------------------------------------
-@node Identifier completion, Index Menu of Subprograms, Moving Through Ada Code, Top
-@chapter Identifier completion
-@c -----------------------------------------------------------------------
-
-@c -----------------------------------------------------------------------
-@section Overview
-@c -----------------------------------------------------------------------
-
-Emacs and  Ada mode provide  two general ways for  the completion of
-identifiers. This is  an easy way to type faster: you  just have to type
-the first few  letters of an identifier, and then  loop through all the
-possible completions.
-
-The  first method  is general  for  Emacs. It  will work  both with  Ada
-buffers, but also in C buffers,  Java buffers, @enddots{}  The idea is to parse
-all the opened buffers for possible completions.
-
-For instance, if the words @samp{my_identifier}, @samp{my_subprogram}
-are the only words starting with @samp{my} in any of the opened files,
-then you will have this scenario:
-
-@quotation
-You type:  my@key{M-/}
-Emacs inserts:  @samp{my_identifier}
-If you press @key{M-/} once again, Emacs replaces @samp{my_identifier} with
-@samp{my_subprogram}.
-Pressing @key{M-/} once more will bring you back to @samp{my_identifier}.
-@end quotation
-
-This is a very  fast way to do completion, and the  casing of words will
-also be respected.
-
-The second  method is specific to Ada  buffers, and even to  users of the
-Gnat compiler. Emacs will search the cross-information found in the
-@samp{.ali} files generated by Gnat for possible completions.
-
-The  main advantage  is  that  this completion  is  more accurate:  only
-existing identifier  will be  suggested, you don't  need to have  a file
-opened that already contains this identifiers, @enddots{}
-
-On the other  hand, this completion is a little  bit slower and requires
-that you  have compiled your file  at least once since  you created that
-identifier.
-
-@c -----------------------------------------------------------------------
-@section Summary of commands
-@c -----------------------------------------------------------------------
-
-@table @kbd
-@item C-@key{TAB}
-@findex ada-complete-identifier
-Complete accurately current identifier using information in @samp{.ali} file
-(@code{ada-complete-identifier}).
-@item M-/
-Complete identifier using buffer information (not Ada-specific).
-@end table
-
-@c -----------------------------------------------------------------------
-@node Index Menu of Subprograms, File Browser, Identifier completion, Top
-@chapter Index Menu of Subprograms
-@c -----------------------------------------------------------------------
-
-You  can   display  a  choice  menu   with  all  procedure/function/task
-declarations in the file and choose an item by mouse click to get to its
-declaration.  This function is  accessible through  the @samp{Ada} menu when
-editing a Ada file, or simply through the following key binding:
-
-@table @kbd
-@item C-S-Mouse-3
-display index menu
-@end table
-
-@c -----------------------------------------------------------------------
-@node File Browser, Automatic Smart Indentation, Index Menu of Subprograms, Top
-@chapter File Browser
-@c -----------------------------------------------------------------------
-
-Emacs provides a special mode, called @code{speedbar}. When this mode is
-activated, a new frame is displayed, with a file browser. The files from
-the current  directory are displayed, and  you can click on  them as you
-would with any file browser. The following commands are then available.
-
-You can click  on a directory name  or file name to open  it. The editor
-will  automatically  select  the  best  possible  mode  for  this  file,
-including of course Ada mode for files written in Ada.
-
-If you click on the @samp{[+]} symbol near a file name, all the symbols (types,
-variables and subprograms)  defined in that file will  be displayed, and
-you  can directly click  on them  to open  the right  file at  the right
-place.
-
-You can activate  this mode by typing @key{M-x  speedbar} in the editor.
-This  will open  a new  frame. A  better way  might be  to  associate the
-following key binding
-
-@example
-(global-set-key [f7]  'speedbar-get-focus)
-@end example
-
-Every time you press @key{F7},  the mouse will automatically move to the
-speedbar frame (which will be created if it does not exist).
-
-@c -----------------------------------------------------------------------
-@node Automatic Smart Indentation, Formatting Parameter Lists, File Browser, Top
-@chapter Automatic Smart Indentation
-@c -----------------------------------------------------------------------
-
-Ada mode  comes with a full set of  rules for automatic indentation.
-You can of course configure the  indentation as you want, by setting the
-value of a few variables.
-
-As  always,  the  preferred  way  to  modify variables  is  to  use  the
-@samp{Ada->Customize} menu  (don't forget  to save your  changes!). This
-will also show you some example of code where this variable is used, and
-hopefully make things clearer.
-
-The relevant variables are the following:
-
-@table @asis
-@item @code{ada-broken-indent}           (default value: 2)
-Number of columns to indent the continuation of a broken line.
-
-@item @code{ada-indent}                  (default value: 3)
-Width of the default indentation.
-
-@item @code{ada-indent-record-rel-type}  (default value: 3)
-Indentation for @code{record} relative to @code{type} or @code{use}.
-
-@item @code{ada-indent-return}           (default value: 0)
-Indentation for @code{return} relative to @code{function} (if
-@code{ada-indent-return} is greater than 0), or the open parenthesis
-(if @code{ada-indent-return} is negative or null).  Note that in the second
-case, when there is no open parenthesis, the indentation is done
-relative to @code{function} with the value of @code{ada-broken-indent}.
-
-@item @code{ada-label-indent}            (default value: -4)
-Number of columns to indent a label.
-
-@item @code{ada-stmt-end-indent}         (default value: 0)
-Number of columns to indent a statement @code{end} keyword on a separate line.
-
-@item @code{ada-when-indent}             (default value: 3)
-Indentation for @code{when} relative to @code{exception} or @code{case}.
-
-@item @code{ada-indent-is-separate}      (default value: t)
-Non-@code{nil} means indent @code{is separate} or @code{is abstract} if on a single line.
-
-@item @code{ada-indent-to-open-paren}    (default value: t)
-Non-@code{nil} means indent according to the innermost open parenthesis.
-
-@item @code{ada-indent-after-return}     (default  value: t)
-Non-@code{nil}  means that  the current  line will  also be  re-indented before
-inserting a newline, when you press @key{RET}.
-@end table
-
-Most of the  time, the indentation will be automatic,  i.e when you will
-press @key{RET},  the cursor will move  to the correct  column on the
-next line.
-
-However, you might want or  need sometimes to re-indent the current line
-or a set of  lines. For this, you can simply go  to that line, or select
-the lines,  and then press @key{TAB}. This  will automatically re-indent
-the lines.
-
-Another mode of indentation exists that helps you to set up your
-indentation scheme. If you press @kbd{C-c @key{TAB}}, Ada mode will do
-the following:
-
-@itemize @bullet
-@item
-Reindent the current line, as @key{TAB} would do.
-@item
-Temporarily move the cursor to a reference line, i.e., the line that
-was used to calculate the current indentation.
-@item
-Display at the bottom of the window the name of the variable that
-provided the offset for the indentation.
-@end itemize
-
-The exact indentation of the current line is the same as the one for the
-reference line, plus an offset given by the variable.
-
-Once you know the name of the variable, you can either modify it
-through the usual @samp{Ada->Customize} menu, or by typing @kbd{M-x
-customize-variable @key{RET}} in the Emacs window, and then give the
-name of the variable.
-
-@table @kbd
-@item @key{TAB}
-Indent the current line or the current region.
-@item C-M-\
-Indent lines in the current selected block.
-@item C-c @key{TAB}
-Indent the current line and prints the name of the variable used for
-indentation.
-@end table
-
-
-
-@c -----------------------------------------------------------------------
-@node Formatting Parameter Lists, Automatic Casing, Automatic Smart Indentation, Top
-@chapter Formatting Parameter Lists
-@c -----------------------------------------------------------------------
-
-To help you correctly align fields in a subprogram parameter list,
-Emacs provides one function that will do most of the work for you.
-This function will align the declarations on the colon (@samp{:})
-separating argument names and argument types, plus align the
-@code{in}, @code{out} and @code{in out} keywords if required.
-
-@table @kbd
-@item C-c C-f
-@findex ada-format-paramlist
-Format the parameter list (@code{ada-format-paramlist}).
-@end table
-
-@c -----------------------------------------------------------------------
-@node Automatic Casing, Statement Templates, Formatting Parameter Lists, Top
-@chapter Automatic Casing
-@c -----------------------------------------------------------------------
-
-Casing  of   identifiers,  attributes  and   keywords  is  automatically
-performed while  typing when  the variable @code{ada-auto-case}  is set.
-Every  time   you  press  a   word  separator,  the  previous   word  is
-automatically cased.
-
-You  can  customize  the  automatic  casing  differently  for  keywords,
-attributes and  identifiers. The  relevant variables are  the following:
-@code{ada-case-keyword},          @code{ada-case-attribute}          and
-@code{ada-case-identifier}.
-
-All these variables can have one of the following values:
-
-@table @code
-@item downcase-word
-The  previous word  will simply  be in  all lower  cases.   For instance
-@code{My_vARIable} is converted to @code{my_variable}.
-
-@item upcase-word
-The previous word will be  fully converted to upper cases.  For instance
-@code{My_vARIable} is converted to @code{MY_VARIABLE}.
-
-@item ada-capitalize-word
-All letters, except the first one of the word and every letter after the
-@samp{_}  character are  lower cased.  Other  letters are  upper cased.   For
-instance @code{My_vARIable} is converted to @code{My_Variable}.
-
-@item ada-loose-case-word
-No letters are  modified in the previous word, except  the ones after the
-@samp{_} character that are  upper cased.  For instance @code{My_vARIable} is
-converted to @code{My_VARIable}.
-@end table
-
-These  functions, although they  will work  in most  cases, will  not be
-accurate sometimes. The  Ada mode allows you to  define some exceptions,
-that will always be cased the same way.
-
-The idea  is to  create a dictionary  of exceptions,  and store it  in a
-file. This file should contain  one identifier per line, with the casing
-you   want   to   force.   The   default   name   for   this   file   is
-@file{~/.emacs_case_exceptions}.  You can  of course  change  this name,
-through the variable @code{ada-case-exception-file}.
-
-Note that  each line  in this file  must start  with the key  word whose
-casing  you want  to  specify. The  rest of  the  line can  be used  for
-comments  (explaining  for  instance  what  an  abbreviation  means,  as
-recommended in the Ada 95  Quality and Style, paragraph 3.1.4).  Thus, a
-good example for this file could be:
-
-@example
-DOD        Department of Defense
-Text_IO
-GNAT       The GNAT compiler from Ada Core Technologies
-@end example
-
-When  working on  project involving  multiple programmers,  we recommend
-that every  member of  the team  sets this variable  to the  same value,
-which  should  point  to  a  system-wide  file that  each  of  them  can
-write.  That  way,  you  will  ensure  that  the  casing  is  consistent
-throughout your application(s).
-
-@findex ada-create-case-exception
-There are two ways to add new items to this file: you can simply edit it
-as you  would edit any  text file, and  add or suppress entries  in this
-file.  Remember that  you should  put one  entity per  line.  The other,
-easier way, is to position the cursor  over the word you want to add, in
-an Ada buffer.  This word should have the casing  you want.  Then simply
-select  the  menu @samp{Ada->Edit->Create  Case  Exception},  or the  key
-@kbd{C-c C-y} (@code{ada-create-case-exception}). The word will
-automatically be added to the current list of exceptions and to the file.
-
-It  is sometimes  useful to  have multiple  exception files  around (for
-instance,  one could  be  the  standard Ada  acronyms,  the second  some
-company  specific exceptions,  and the  last one  some  project specific
-exceptions).  If you  set up the variable @code{ada-case-exception-file}
-as a list of  files, each of them will be parsed  and used in your emacs
-session.
-
-However, when  you save a new  exception through the  menu, as described
-above, the  new exception will  be added to  the first file in  the list
-only.  You  can not automatically add  an exception to one  of the other
-files, although you can of course edit the files by hand at any time.
-
-Automatic casing can be performed on part of the buffer, or on the
-whole buffer, using:
-
-@table @kbd
-@item C-c C-b
-@findex ada-adjust-case-buffer
-Adjust case in the whole buffer (@code{ada-adjust-case-buffer}).
-@item C-c C-y
-Create a new entry in the exception dictionary, with the word under
-the cursor (@code{ada-create-case-exception})
-@item C-c C-t
-@findex ada-case-read-exceptions
-Rereads the exception dictionary from the file
-@code{ada-case-exception-file} (@code{ada-case-read-exceptions}).
-@end table
-
-@c -----------------------------------------------------------------------
-@node Statement Templates, Comment Handling, Automatic Casing, Top
-@chapter Statement Templates
-@c -----------------------------------------------------------------------
-
-NOTE:  This features  are  not available  on  VMS for  Emacs 19.28.  The
-functions used here do not exist on Emacs 19.28.
-
-Templates exist  for most  Ada statements. They  can be inserted  in the
-buffer using the following commands:
-
-@table @kbd
-@item C-c t b
-@findex ada-exception-block
-exception Block (@code{ada-exception-block}).
-@item C-c t c
-@findex ada-case
-case (@code{ada-case}).
-@item C-c t d
-@findex ada-declare-block
-declare Block (@code{ada-declare-block}).
-@item C-c t e
-@findex ada-else
-else (@code{ada-else}).
-@item C-c t f
-@findex ada-for-loop
-for Loop (@code{ada-for-loop}).
-@item C-c t h
-@findex ada-header
-Header (@code{ada-header}).
-@item C-c t i
-@findex ada-if
-if (@code{ada-if}).
-@item C-c t k
-@findex ada-package-body
-package Body (@code{ada-package-body}).
-@item C-c t l
-@findex ada-loop
-loop (@code{ada-loop}).
-@item C-c p
-@findex ada-subprogram-body
-subprogram body (@code{ada-subprogram-body}).
-@item C-c t t
-@findex ada-task-body
-task Body (@code{ada-task-body}).
-@item C-c t w
-@findex ada-while
-while Loop (@code{ada-while}).
-@item C-c t u
-@findex ada-use
-use (@code{ada-use}).
-@item C-c t x
-@findex ada-exit
-exit (@code{ada-exit}).
-@item C-c t C-a
-@findex ada-array
-array (@code{ada-array}).
-@item C-c t C-e
-@findex ada-elsif
-elsif (@code{ada-elsif}).
-@item C-c t C-f
-@findex ada-function-spec
-function Spec (@code{ada-function-spec}).
-@item C-c t C-k
-@findex ada-package-spec
-package Spec (@code{ada-package-spec}).
-@item C-c t C-p
-@findex ada-procedure-spec
-procedure Spec (@code{ada-package-spec}.
-@item C-c t C-r
-@findex ada-record
-record (@code{ada-record}).
-@item C-c t C-s
-@findex ada-subtype
-subtype (@code{ada-subtype}).
-@item C-c t C-t
-@findex ada-task-spec
-task Spec (@code{ada-task-spec}).
-@item C-c t C-u
-@findex ada-with
-with (@code{ada-with}).
-@item C-c t C-v
-@findex ada-private
-private (@code{ada-private}).
-@item C-c t C-w
-@findex ada-when
-when (@code{ada-when}).
-@item C-c t C-x
-@findex ada-exception
-exception (@code{ada-exception}).
-@item C-c t C-y
-@findex ada-type
-type (@code{ada-type}).
-@end table
-
-@c -----------------------------------------------------------------------
-@node Comment Handling, Compiling Executing, Statement Templates, Top
-@chapter Comment Handling
-@c -----------------------------------------------------------------------
-
-By default, comment lines get indented like Ada code. There are a few
-additional functions to handle comments:
-
-
-@table @kbd
-@item M-;
-Start a comment in default column.
-@item M-j
-Continue comment on next line.
-@item C-c ;
-Comment the selected region (add -- at the beginning of lines).
-@item C-c :
-Uncomment the selected region
-@item M-q
-autofill the current comment.
-@end table
-
-@c -----------------------------------------------------------------------
-@node Compiling Executing, Debugging, Comment Handling, Top
-@chapter Compiling Executing
-@c -----------------------------------------------------------------------
-
-Ada mode  provides a much complete environment  for compiling, debugging
-and running an application within Emacs.
-
-All the  commands used  by Emacs to  manipulate your application  can be
-customized in  the project file.  Some default values are  provided, but
-these will  likely not  be good  enough for a  big or  even medium-sized
-project.  See the section on the  project file for an explanation on how
-to set up the commands to use.
-
-One   of   the  variables   you   can   set   in  your   project   file,
-@code{cross_prefix}, indicates whether you are using a cross-compilation
-environment, and if  yes for which target. The  default command used for
-compilation  will add  this @code{cross_prefix}  in front  of  the name:
-@code{gcc}  will become  @code{cross_prefix}-@code{gcc}, @code{gnatmake}
-will become @code{cross_prefix}-@code{gnatmake}, @enddots{}
-
-This  will also modify  the way  your application  is run  and debugged,
-although this is not implemented at the moment.
-
-Here are the commands for building and using an Ada application
-
-@itemize @bullet
-
-@item Compiling the current source
-This command is issued when  issuing the @code{compile} command from the
-Ada  menu. It  compiles  unconditionally the  current  source using  the
-@code{comp_cmd} variable of the project file. Compilation options can be
-customized with the variable @code{comp_opt} of the project file.
-
-Emacs  will  display  a new  buffer  that  contains  the result  of  the
-compilation.  Each line associated with an error will become active: you
-can simply click on it with the  middle button of the mouse, or move the
-cursor  on  it and  press  @key{RET}.  Emacs  will then  display  the
-relevant source file and put the cursor on the line and column the error
-was found at.
-
-You can also simply press the @kbd{C-x `} key and Emacs will jump to the
-first error. If you press that key again, it will move you to the second
-error, and so on.
-
-Some error messages might also include references to some files. These
-references are also clickable in the same way.
-
-
-@item (Re)building the whole application
-This command is issued when you select the @code{build} command from the
-Ada menu.   It compiles  all obsolete units  of the  current application
-using  the @code{make_cmd}  variable  of the  project file.  Compilation
-options  can be  customized  with the  variable  @code{comp_opt} of  the
-project  file, binder  options with  @code{bind_opt} and  linker options
-with @code{link_opt}. The main unit  of the application may be specified
-with @code{main}.
-
-The compilation buffer is also active in the same way it was for the above
-command.
-
-@item Running the application
-This command is  issued when you select the  @code{run} command from the
-Ada   menu.   It   executes  the   current  application   in   an  emacs
-buffer. Arguments can be  passed through before executing. The execution
-buffer allows for interactive input/output.
-
-This   command   is   not   yet   available   in   a   cross-compilation
-toolchain. Emacs  would first need to  log on the  target before running
-the application. This will be implemented in a future release of Gnat.
-
-@end itemize
-
-@c ---------------------------------------------------------------------
-@node Debugging, Using non-standard file names, Compiling Executing, Top
-@chapter Debugging your application
-@c ---------------------------------------------------------------------
-
-You  can set  up in  the project  file a  command to  use to  debug your
-application. Emacs is compatible with a lot of debuggers, and provide an
-easy interface to them.
-
-This section will focus on the  gdb debugger, and two of the graphical
-interfaces that exist for it.
-
-In all  cases, the main  window in  Emacs will be  split in two:  in the
-upper  buffer,  the  source  code  will  appear,  whereas  the  debugger
-input/output  window is  displayed at  the  bottom.  You  can enter  the
-debugger  commands as  usual in  the command  window. Every  time  a new
-source file is  selected by the debugger (for instance as  a result of a
-@code{frame} command),  the appropriate source file is  displayed in the
-upper buffer.
-
-The source window is interactive: you can click on an identifier with the
-right mouse button, and print its value in the debugger window. You can
-also set a breakpoint simply by right-clicking on a line.
-
-You  can easily use  Emacs as  the source  window when  you are  using a
-graphical  interface for the  debugger. The  interesting thing  is that,
-whereas  you still  have the  graphical nifties,  you can  also use the
-cross-references  features that  Ada mode  provides to  look  at the
-definition for the identifiers, @enddots{}
-
-Here is how you  can set up gdbtk and ddd for  use with Emacs (These are
-the commands you should setup in the project file):
-
-@itemize @bullet
-@item gdbtk
-should  be used  with  the  switch @samp{--emacs_gdbtk}.   It  provides a  nice
-backtrace window, as well as a tasks window. You can click interactively
-on both of  them, and Emacs will display the source  file on the correct
-line.
-
-@item ddd (Data Display Debugger)
-should be used with the switches @samp{--tty} and
-@samp{--fullname}. Whenever you print a variable from Emacs, it will
-be displayed graphically in the data window.
-
-@end itemize
-
-
-@c ---------------------------------------------------------------------
-@node Using non-standard file names, Working Remotely, Debugging, Top
-@chapter Using non-standard file names
-@c ---------------------------------------------------------------------
-
-By default, Emacs is configured to  use the GNAT style file names, where
-file names are the package names,  and the extension for spec and bodies
-are respectively @samp{.ads} and @samp{.adb}.
-
-If you  want to  use other  types of file  names, you will need to modify
-your @file{.emacs} file.
-
-Adding new possible extensions is easy. Since Ada mode needs to know
-how to  go from  the body  to the spec  (and back),  you always  have to
-specify  both. A  function  is provided  with  Ada mode  to add  new
-extensions.
-
-For instance, if your spec and bodies files are called
-@file{@var{unit}_s.ada} and @file{@var{unit}_b.ada}, respectively, you
-need to add the following to your @file{.emacs} file:
-
-@example
-(ada-add-extensions "_s.ada" "_b.ada")
-@end example
-
-Note that it is possible to redefine the extensions, even if they already
-exist, as in:
-
-@example
-(ada-add-extensions ".ads" "_b.ada")
-(ada-add-extensions ".ads" ".body")
-@end example
-
-This simply means that whenever the  ada-mode will look for the body for
-a file whose extension is  @file{.ads}, it will take the first available
-file  that ends  with  either @file{.adb}  (standard), @file{_b.ada}  or
-@file{.body}.
-
-If the filename is not the unit name, then things are a little more
-complicated.  You then need to rewrite the function
-@code{ada-make-filename-from-adaname} (see the file @file{ada-mode.el}
-for an example).
-
-@c ---------------------------------------------------------------------
-@node Working Remotely, Index, Using non-standard file names, Top
-@chapter Working Remotely
-@c ---------------------------------------------------------------------
-
-When  you work  on a project  that  involves a  lot of  programmers, it  is
-generally the case that you will edit the files on your own machine, but
-you want to compile, run and debug your application in another buffer.
-
-Fortunately, here too Emacs provides a very convenient way to do this.
-
-@c ---------------------------------------------------------------------
-@section Remote editing
-@c ---------------------------------------------------------------------
-
-First of  all, the files do  not need to  be on your machine.  Emacs can
-edit any  remote file,  by doing transparent  FTP sessions  between your
-machine and the remote machine that stores your files. This is a special
-Emacs mode, called @code{ange-ftp}. To use it, you just have to use a
-slightly different syntax when you open a file.
-
-For instance, if you want to  open the file @file{/work/foo.adb} on the machine
-aleph.gnu.org, where you log in as qwe, you would simply do this:
-
-@example
-C-x C-f /qwe@@aleph.gnu.org:/work/foo.adb @key{RET}
-@end example
-
-@noindent
-i.e., use your name, the name of the machine and the name of the file.
-
-The first time, Emacs will ask  you for a password that it will remember
-until you  close the current Emacs.  Even if the ftp  session times out,
-you won't need to reenter your password.
-
-Every time you save the file, Emacs will upload it to the remote machine
-transparently. No file is modified on the local machine.
-
-@c ---------------------------------------------------------------------
-@section Remote compiling
-@c ---------------------------------------------------------------------
-
-If the  machine you  want to  compile on is  not the  one your  Emacs is
-running  on,  you can  set  the  variable  @code{remote_machine} in  the
-project file for your application.
-
-This  will force  Emacs  to issue  a  @command{rsh} command  for the  compilation,
-instead of  running it on  the local machine. Unfortunately,  this won't
-work on Windows workstations, since this protocol is not supported.
-
-@example
-If  your   @code{remote_machine}  is  aleph.gnu.org   and  the  standard
-compilation command is @code{cd /work/ && gnatmake foo}, then Emacs will
-actually  issue  the  command  @code{rsh  aleph.gnu.org  'cd  /work/  &&
-gnatmake foo'}.
-@end example
-
-The advantage of using the  @code{remote_machine} variable is that it is
-easier to change  that machine without having to  modify the compilation
-command.
-
-Note that if you need to set up some environment variables before the
-compilation, you need to insert a call to the appropriate initialization
-script in the compilation command, for instance:
-
-@example
-build_cmd= initialization_script; cd /work/ && gnatmake foo
-@end example
-
-@c ---------------------------------------------------------------------
-@section Remote running and debugging
-@c ---------------------------------------------------------------------
-
-This feature is not completely implemented yet.
-
-However, most of the time, you will be able to run your application
-remotely simply by replacing it with a @command{rsh} call.
-For instance, if your command was @code{$@{main@}}, you could replace it with
-@code{rsh aleph.gnu.org $@{main@}}.
-
-However, this would not work on vxworks, for instance, where
-@command{rsh} is not supported.
-
-@node Index, , Working Remotely, Top
-@unnumbered Index
-
-@printindex fn
-
-@contents
-@bye
-
-@ignore
-   arch-tag: 68cf0d8a-55cc-4190-a28d-4984fa56ed1e
-@end ignore
+\input texinfo  @c -*-texinfo-*-
+@setfilename ../info/ada-mode
+@settitle Ada Mode
+
+@copying
+Copyright @copyright{} 1999, 2000, 2001, 2002, 2003, 2004,
+2005, 2006 Free Software Foundation, Inc.
+
+@quotation
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with the
+Invariant Sections being ``The GNU Manifesto'', ``Distribution'' and
+``GNU GENERAL PUBLIC LICENSE'', with the Front-Cover texts being ``A GNU
+Manual'', and with the Back-Cover Texts as in (a) below.  A copy of the
+license is included in the section entitled ``GNU Free Documentation
+License'' in the Emacs manual.
+
+(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
+this GNU Manual, like GNU software.  Copies published by the Free
+Software Foundation raise funds for GNU development.''
+
+This document is part of a collection distributed under the GNU Free
+Documentation License.  If you want to distribute this document
+separately from the collection, you can do so by adding a copy of the
+license to the document, as described in section 6 of the license.
+@end quotation
+@end copying
+
+@dircategory Emacs
+@direntry
+* Ada mode: (ada-mode). Emacs mode for editing and compiling Ada code.
+@end direntry
+
+@titlepage
+@sp 10
+@title{Ada Mode}
+@sp 2
+@subtitle An Emacs major mode for programming in Ada
+@subtitle Ada Mode Version 3.7
+@sp 2
+@page
+@vskip 0pt plus 1filll
+@insertcopying
+@end titlepage
+
+@c fixme; title page doesn't show up in ada-mode.info; why bother with
+@c it?
+
+@node Top, Overview, (dir), (dir)
+
+@menu
+* Overview::
+* Installation::                Installing Ada mode on your system
+* Customization::               Setting up Ada mode to your taste
+* Compiling Executing::         Working with your application within Emacs
+* Project files::               Describing the organization of your project
+* Compiling Examples::          A small tutorial
+* Moving Through Ada Code::     Moving easily through Ada sources
+* Identifier completion::       Finishing words automatically
+* Automatic Smart Indentation::  Indenting your code automatically as you type
+* Formatting Parameter Lists::  Formatting subprograms' parameter lists
+                                     automatically
+* Automatic Casing::            Adjusting the case of words automatically
+* Statement Templates::         Inserting code templates
+* Comment Handling::            Reformatting comments easily
+* Index::
+@end menu
+
+
+@node Overview, Installation, Top, Top
+@chapter Overview
+
+The Emacs mode for programming in Ada helps the user in understanding
+existing code and facilitates writing new code.
+
+When the Gnu Ada compiler GNAT is used, the cross-reference
+information output by the compiler is used to provide powerful code
+navigation (jump to definition, find all uses, etc).
+
+When you open a file with a file extension of @file{.ads} or
+@file{.adb}, Emacs will automatically load and activate Ada mode.
+
+Ada mode works without any customization, if you are using the GNAT
+compiler (@url{https://libre2.adacore.com/}) and the GNAT default
+naming convention.
+
+You must customize a few things if you are using a different compiler
+or file naming convention; @xref{Other compiler}, @xref{Non-standard
+file names}.
+
+In addition, you may want to customize the indentation,
+capitalization, and other things; @xref{Other customization}.
+
+Finally, for large Ada projects, you will want to set up an Emacs
+Ada mode project file for each project; @xref{Project files}. Note
+that these are different from the GNAT project files used by gnatmake
+and other GNAT commands.
+
+See the Emacs info manual, section 'Running Debuggers Under Emacs',
+for general information on debugging.
+
+@node Installation, Customization, Overview, Top
+@chapter Installation
+
+Ada mode is part of the standard Emacs distribution; if you use that,
+no files need to be installed.
+
+Ada mode is also available as a separate distribution, from the Emacs
+Ada mode website
+@uref{http://stephe-leake.org/emacs/ada-mode/emacs-ada-mode.html}. The
+separate distribution may be more recent.
+
+For installing the separate distribution, see the @file{README} file
+in the distribution.
+
+To see what version of Ada mode you have installed, do @key{M-x
+ada-mode-version}.
+
+The following files are provided with the Ada mode distribution:
+
+@itemize @bullet
+
+@item
+@file{ada-mode.el}: The main file for Ada mode, providing indentation,
+formatting of parameter lists, moving through code, comment handling
+and automatic casing.
+
+@item
+@file{ada-prj.el}: GUI editing of Ada mode project files, using Emacs
+widgets.
+
+@item
+@file{ada-stmt.el}: Ada statement templates.
+
+@item
+@file{ada-xref.el}: GNAT cross-references, completion of identifiers,
+and compilation. Also provides project files (which are not
+GNAT-specific).
+
+@end itemize
+
+@node Customization, Compiling Executing, Installation, Top
+@chapter Customizing Ada mode
+
+Here we assume you are familiar with setting variables in Emacs,
+either thru 'customize' or in elisp (in your @file{.emacs} file). For
+a basic introduction to customize, elisp, and Emacs in general, see
+the tutorial in
+@iftex
+@cite{The GNU Emacs Manual}.
+@end iftex
+@ifhtml
+@cite{The GNU Emacs Manual}.
+@end ifhtml
+@ifinfo
+@ref{Top, , The GNU Emacs Manual, emacs, The GNU Emacs Manual}.
+@end ifinfo
+
+These global Emacs settings are strongly recommended (put them in your
+.emacs):
+
+@example
+(global-font-lock-mode t)
+(transient-mark-mode t)
+@end example
+
+@samp{(global-font-lock-mode t)} turns on syntax
+highlighting for all buffers (it is off by default because it may be
+too slow for some machines).
+
+@samp{(transient-mark-mode t)} highlights selected text.
+
+See the Emacs help for each of these variables for more information.
+
+@menu
+* Non-standard file names::
+* Other compiler::
+* Other customization::
+@end menu
+
+@node Non-standard file names, Other compiler, Customization, Customization
+@section Non-standard file names
+
+By default, Ada mode is configured to use the GNAT file naming
+convention, where file names are a simple modification of the Ada
+names, and the extension for specs and bodies are
+@samp{.ads} and @samp{.adb}, respectively.
+
+Ada mode uses the file extentions to allow moving from a package body
+to the corresponding spec and back.
+
+Ada mode supports a list of alternative file extensions for specs and bodies.
+
+For instance, if your spec and bodies files are called
+@file{@var{unit}_s.ada} and @file{@var{unit}_b.ada}, respectively, you
+can add the following to your @file{.emacs} file:
+
+@example
+(ada-add-extensions "_s.ada" "_b.ada")
+@end example
+
+You can define additional extensions:
+
+@example
+(ada-add-extensions ".ads" "_b.ada")
+(ada-add-extensions ".ads" ".body")
+@end example
+
+This means that whenever Ada mode looks for the body for a file
+whose extension is @file{.ads}, it will take the first available file
+that ends with either @file{.adb}, @file{_b.ada} or
+@file{.body}.
+
+Simililarly, if Ada mode is looking for a spec, it will look for
+@file{.ads} or @file{_s.ada}.
+
+If the filename is not derived from the Ada name following the GNAT
+convention, things are a little more complicated. You then need to
+rewrite the function @code{ada-make-filename-from-adaname}. Doing that
+is beyond the scope of this manual; see the current definitions in
+@file{ada-mode.el} and @file{ada-xref.el} for examples.
+
+@node Other compiler, Other customization, Non-standard file names, Customization
+@section Other compiler
+
+By default, Ada mode is configured to use the Gnu Ada compiler GNAT.
+
+To use a different Ada compiler, you must specify the command lines
+used to run that compiler, either in lisp variables or in Emacs
+Ada mode project files. See @ref{Project file variables} for the list
+of project variables, and the corresponding lisp variables.
+
+@node Other customization,  , Other compiler, Customization
+@section Other customization
+
+All user-settable Ada mode variables can be set via the menu
+@samp{Ada | Customize}.  Click on the @samp{Help} button there for help
+on using customize.
+
+To modify a specific variable, you can directly call the function
+@code{customize-variable}; just type @kbd{M-x customize-variable
+@key{RET} @var{variable-name} @key{RET}}).
+
+Alternately, you can specify variable settings in the Emacs
+configuration file, @file{.emacs}. This file is coded in Emacs lisp,
+and the syntax to set a variable is the following:
+@example
+(setq variable-name value)
+@end example
+
+@node Compiling Executing, Project files, Customization, Top
+@chapter Compiling Executing
+
+Ada projects can be compiled, linked, and executed using commands on
+the Ada menu. All of these commands can be customized via a project
+file (@pxref{Project files}), but the defaults are sufficient for using
+the GNAT compiler for simple projects (single files, or several files
+in a single directory).
+
+Even when no project file is used, the GUI project editor (menu
+@key{Ada | Project | Edit}) shows the settings of the various project
+file variables referenced here.
+
+@menu
+* Compile commands::
+* Compiler errors::
+@end menu
+
+@node Compile commands, Compiler errors, Compiling Executing, Compiling Executing
+@section Compile commands
+
+Here are the commands for building and using an Ada project, as
+listed in the Ada menu.
+
+In multi-file projects, there must be one file that is the main
+program. That is given by the @code{main_unit} project file variable;
+it defaults to the current file if not yet set, but is also set by the
+``set main and build'' command.
+
+@table @code
+
+@item Check file
+Compiles the current file in syntax check mode, by running
+@code{check_cmd} defined in the current project file. This typically
+runs faster than full compile mode, speeding up finding and fixing
+compilation errors.
+
+This sets @code{main_unit} only if it has not been set yet.
+
+@item Compile file
+Compiles the current file, by running @code{comp_cmd} from the current
+project file.
+
+This does not set @code{main_unit}.
+
+@item Set main and Build
+Sets @code{main_unit} to the current file, then executes the Build
+command.
+
+@item Show main
+Display @code{main_unit} in the message buffer.
+
+@item Build
+Compiles all obsolete units of the current @code{main_unit}, and links
+@code{main_unit}, by running @code{make_cmd} from the current project.
+
+This sets @code{main_unit} only if it has not been set yet.
+
+@item Run
+Executes the main program in a shell, displayed in a separate Emacs
+buffer. This runs @code{run_cmd} from the current project. The
+execution buffer allows for interactive input/output.
+
+To modify the run command, in particular to provide or change the
+command line arguments, type @key{C-u} before invoking the command.
+
+This command is not available for a cross-compilation toolchain.
+
+@end table
+It is important when using these commands to understand how
+@code{main_unit} is used and changed.
+
+Build runs 'gnatmake' on the main unit. During a typical edit/compile
+session, this is the only command you need to invoke, which is why it
+is bound to @key{C-c C-c}. It will compile all files needed by the
+main unit, and display compilation errors in any of them.
+
+Note that Build can be invoked from any Ada buffer; typically you will
+be fixing errors in files other than the main, but you don't have to
+switch back to the main to invoke the compiler again.
+
+Novices and students typically work on single-file Ada projects. In
+this case, @key{C-c C-m} will normally be the only command needed; it
+will build the current file, rather than the last-built main.
+
+There are three ways to change @code{main_unit}:
+
+@enumerate
+@item
+Invoke @key{Ada | Set main and Build}, which sets @code{main_unit} to
+the current file.
+
+@item
+Invoke @key{Ada | Project | Edit}, edit @code{main_unit} and
+@code{main}, and click @key{[save]}
+
+@item
+Invoke @key{Ada | Project | Load}, and load a project file that specifies @code{main_unit}
+
+@end enumerate
+
+@node Compiler errors,  , Compile commands, Compiling Executing
+@section Compiler errors
+
+The @code{Check file}, @code{Compile file}, and @code{Build} commands
+all place compilation errors in a separate buffer named
+@code{*compilation*}.
+
+Each line in this buffer will become active: you can simply click on
+it with the middle button of the mouse, or move point to it and press
+@key{RET}. Emacs will then display the relevant source file and put
+point on the line and column where the error was found.
+
+You can also press the @kbd{C-x `} key (@code{next-error}), and Emacs
+will jump to the first error. If you press that key again, it will
+move you to the second error, and so on.
+
+Some error messages might also include references to other files. These
+references are also clickable in the same way, or put point after the
+line number and press @key{RET}.
+
+@node Project files, Compiling Examples, Compiling Executing, Top
+@chapter Project files
+
+An Emacs Ada mode project file specifies what directories hold sources
+for your project, and allows you to customize the compilation commands
+and other things on a per-project basis.
+
+Note that Ada mode project files @samp{*.adp} are different than GNAT
+compiler project files @samp{*.gpr}.
+
+@menu
+* Project File Overview::
+* GUI Editor::
+* Project file variables::
+@end menu
+
+@node Project File Overview, GUI Editor, Project files, Project files
+@section Project File Overview
+
+Project files have a simple syntax; they may be edited directly. Each
+line specifies a project variable name and its value, separated by ``='':
+@example
+src_dir=/Projects/my_project/src_1
+src_dir=/Projects/my_project/src_2
+@end example
+
+Some variables (like @code{src_dir}) are lists; multiple occurances
+are concatenated.
+
+There must be no space between the variable name and ``='', and no
+trailing spaces.
+
+Alternately, a GUI editor for project files is available (@pxref{GUI
+Editor}). It uses Emacs widgets, similar to Emacs customize.
+
+The GUI editor also provides a convenient way to view current project
+settings, if they have been modified using menu commands rather than
+by editing the project file.
+
+After the first Ada mode build command is invoked, there is always a
+current project file, given by the lisp variable
+@code{ada-prj-default-project-file}. Currently, the only way to show
+the current project file is to invoke the GUI editor.
+
+To find the project file the first time, Ada mode uses the following
+search algorithm:
+
+@itemize @bullet
+@item
+If @code{ada-prj-default-project-file} is set, use that.
+
+@item
+Otherwise, search for a file in the current directory with
+the same base name as the Ada file, but extension given by
+@code{ada-prj-file-extension} (default @code{".adp"}).
+
+@item
+If not found, search for @file{*.adp} in the current directory; if
+several are found, prompt the user to select one.
+
+@item
+If none are found, use @file{default.adp} in the current directory (even
+if it does not exist).
+
+@end itemize
+
+This algorithm always sets @code{ada-prj-default-project-file}, even
+when the file does not actually exist.
+
+To change the project file before or after the first one is found,
+invoke @key{Ada | Project | Load ...}.
+
+Or, in lisp, evaluate @code{ada-set-default-project-file "/path/file.adp"}.
+This sets @code{ada-prj-default-project-file}, and reads the project file.
+
+@node GUI Editor, Project file variables, Project File Overview, Project files
+@section GUI Editor
+
+The project file editor is invoked with the menu @samp{Ada | Projects
+| Edit}.
+
+Once in the buffer for editing the project file, you can save your
+modification using the @samp{[save]} button at the bottom of the
+buffer, or the @kbd{C-x C-s} binding. To cancel your modifications,
+kill the buffer or click on the @samp{[cancel]} button.
+
+@node Project file variables,  , GUI Editor, Project files
+@section Project file variables
+
+The following variables can be defined in a project file; some can
+also be defined in lisp variables.
+
+To set a project variable that is a list, specify each element of the
+list on a separate line in the project file.
+
+Any project variable can be referenced in other project variables,
+using a shell-like notation. For instance, if the variable
+@code{comp_cmd} contains @code{$@{comp_opt@}}, the value of the
+@code{comp_opt} variable will be substituted when @code{comp_cmd} is
+used.
+
+Most project variables have defaults that can be changed by setting
+lisp variables; the table below identifies the lisp variable for each
+project variable. Lisp variables corresponding to project variables
+that are lists are lisp lists.
+
+Here is the list of variables. In the default values, the current
+directory @code{"."} is the project file directory.
+
+@c defined in ada-xref-set-default-prj-values; same order here
+@table @asis
+@item @code{build_dir}      [default: @code{"."}]
+The compile commands will be issued in this directory.
+
+@item @code{src_dir}        [default: @code{"."}]
+A list of directories to search for source files, both for compile
+commands and source navigation.
+
+@item @code{obj_dir}        [default: @code{"."}]
+A list of directories to search for library files. Ada mode searches
+this list for the @samp{.ali} files generated by GNAT that contain
+cross-reference information.
+
+The compiler commands must place the @samp{.ali} files in one of these
+directories; the default commands do that.
+
+@item @code{casing}         [default: @code{("~/.emacs_case_exceptions")}
+List of files containing casing exceptions. See the help on
+@code{ada-case-exception-file} for more info.
+@c FIXME: section on case exceptions
+
+Lisp variable: @code{ada-case-exception-file}.
+
+@item @code{comp_opt}       [default: @code{"-gnatq -gnatQ"}]
+Holds user compiler options; used in the default compile commands. The
+default value tells gnatmake to generate library files for
+cross-referencing even when there are errors.
+
+If source code for the project is in multiple directories, the
+appropriate compiler options must be added here. @ref{Set source
+search path} for examples of this. Alternately, GNAT project files may
+be used; @ref{Use GNAT project file}.
+
+Lisp variable: @code{ada-prj-default-comp-opt}.
+
+@item @code{bind_opt}       [default: @code{""}]
+Holds user binder options; used in the default build commands.
+
+Lisp variable: @code{ada-prj-default-bind-opt}.
+
+@item @code{link_opt}       [default: @code{""}]
+Holds user linker options; used in the default build commands.
+
+Lisp variable: @code{ada-prj-default-link-opt}.
+
+@item @code{gnatmake_opt}   [default: @code{"-g"}]
+Holds user gnatmake options; used in the default build commands.
+
+If a GNAT project file is used (for example @file{project.gpr}), this
+option should be set to @code{-Pproject.gpr}.
+
+Lisp variable: @code{ada-prj-default-gnatmake-opt}.
+
+@item @code{gnatfind_opt}   [default: @code{"-rf"}]
+Holds user gnatfind options; used in the default find commands.
+
+Lisp variable: @code{ada-prj-gnatfind-switches}.
+
+@item @code{main}           [default: current file]
+Specifies the name of the executable file for the project; used in the
+default build commands.
+
+@item @code{main_unit}      [default: current Ada unit]
+Specifies the name of the main Ada unit for the project; used in the
+default build commands.
+
+@item @code{cross_prefix}   [default: @code{""}]
+Name of target machine in a cross-compilation environment. Used in
+default compile and build commands.
+
+@item @code{remote_machine} [default: @code{""}]
+Name of the machine to log into before issuing the compile and build
+commands. If this variable is empty, the command will be run on the
+local machine.
+
+@item @code{comp_cmd}       [default: @code{"$@{cross_prefix@}gnatmake -u -c $@{gnatmake_opt@} $@{full_current@} -cargs $@{comp_opt@}"}]
+Command used to compile a single file.
+The name of the file is substituted for @code{full_current}.
+
+Lisp variable: @code{ada-prj-default-comp-cmd}.
+
+@item @code{check_cmd}      [default: @code{"$@{cross_prefix@}gnatmake -u -c -gnatc $@{gnatmake_opt@} $@{full_current@} -cargs $@{comp_opt@}"}]
+Command used to syntax check a single file.
+The name of the file is substituted for @code{full_current}.
+
+Lisp variable: @code{ada-prj-default-check-cmd}
+
+@item @code{make_cmd}       [default: @code{"$@{cross_prefix@}gnatmake -o $@{main@} $@{main_unit@} $@{gnatmake_opt@} -cargs $@{comp_opt@} -bargs $@{bind_opt@} -largs $@{link_opt@}"}]
+Command used to build the application.
+
+Lisp variable: @code{ada-prj-default-make-cmd}.
+
+@item @code{run_cmd}        [default: @code{"./$@{main@}"}]
+Command used to run the application.
+
+@item @code{debug_pre_cmd}  [default: @code{"cd $@{build_dir@}"}]
+Command executed before @code{debug_cmd}.
+
+@item @code{debug_cmd}      [default: @code{"$@{cross_prefix@}gdb $@{main@}"}]
+Command used to debug the application
+
+Lisp variable: @code{ada-prj-default-debugger}.
+
+@item @code{debug_post_cmd} [default: @code{""}]
+Command executed after @code{debug_cmd}.
+
+@end table
+
+@node Compiling Examples, Moving Through Ada Code, Project files, Top
+@chapter Compiling Examples
+
+We present several small projects, and walk thru the process of
+compiling, linking, and running them.
+
+The first example illustrates more Ada mode features than the others;
+you should work thru that example before doing the others.
+
+All of these examples assume you are using GNAT.
+
+The source for these examples is available on the Emacs Ada mode
+website mentioned in @xref{Installation}.
+
+@menu
+* No project files::            Just menus
+* Set compiler options::        A basic Ada mode project file
+* Set source search path::      Source in multiple directories
+* Use GNAT project file::
+@end menu
+
+@node No project files, Set compiler options, Compiling Examples, Compiling Examples
+@section No project files
+This example uses no project files.
+
+First, create a directory @file{Example_1}, containing:
+
+@file{hello.adb}:
+
+@example
+with Ada.Text_IO;
+procedure Hello
+is begin
+   Put_Line("Hello from hello.adb");
+end Hello;
+@end example
+
+Yes, this is missing ``use Ada.Text_IO;'' - we want to demonstrate
+compiler error handling.
+
+@file{hello_2.adb}:
+
+@example
+with Hello_Pkg;
+procedure Hello_2
+is begin
+   Hello_Pkg.Say_Hello;
+end Hello_2;
+@end example
+
+@file{hello_pkg.ads}:
+
+@example
+package Hello_Pkg is
+   procedure Say_Hello;
+end Hello_Pkg;
+@end example
+
+@file{hello_pkg.adb}:
+
+@example
+with Ada.Text_IO;
+package Hello_Pkg is
+   procedure Say_Hello
+   is begin
+      Ada.Text_IO.Put_Line ("Hello from hello_pkg.adb");
+   end Say_Hello;
+end Hello_Pkg;
+@end example
+
+Yes, this is missing the keyword @code{body}; another compiler error
+example.
+
+In buffer @file{hello.adb}, invoke @key{Ada | Check file}. You should
+get a @code{*compilation*} buffer containing something like (the
+directory paths will be different):
+
+@example
+cd c:/Examples/Example_1/
+gnatmake -u -c -gnatc -g c:/Examples/Example_1/hello.adb -cargs -gnatq -gnatQ
+gcc -c -Ic:/Examples/Example_1/ -gnatc -g -gnatq -gnatQ -I- c:/Examples/Example_1/hello.adb
+hello.adb:4:04: "Put_Line" is not visible
+hello.adb:4:04: non-visible declaration at a-textio.ads:264
+hello.adb:4:04: non-visible declaration at a-textio.ads:260
+gnatmake: "c:/Examples/Example_1/hello.adb" compilation error
+@end example
+
+If you have enabled font-lock, the lines with actual errors (starting
+with @file{hello.adb}) are highlighted, with the file name in red.
+
+Now type @key{C-x `} (on a PC keyboard, @key{`} is next to @key{1}).
+Or you can click the middle mouse button on the first error line. The
+compilation buffer scrolls to put the first error on the top line, and
+point is put at the place of the error in the @file{hello.adb} buffer.
+
+To fix the error, change the line to be
+
+@example
+    Ada.Text_IO.Put_Line ("hello from hello.adb"):
+@end example
+
+Now invoke @key{Ada | Show main}; this displays @file{Ada mode main_unit: hello}.
+
+Now (in buffer @file{hello.adb}), invoke @key{Ada | Build}. You are
+prompted to save the file (if you haven't already). Then the
+compilation buffer is displayed again, containing:
+
+@example
+cd c:/Examples/Example_1/
+gnatmake -o hello hello -g -cargs -gnatq -gnatQ -bargs  -largs
+gcc -c -g -gnatq -gnatQ hello.adb
+gnatbind -x hello.ali
+gnatlink hello.ali -o hello.exe -g
+@end example
+
+The compilation has succeeded without errors; @file{hello.exe} now
+exists in the same directory as @file{hello.adb}.
+
+Now invoke @key{Ada | Run}. A @file{*run*} buffer is displayed,
+containing
+
+@example
+Hello from hello.adb
+
+Process run finished
+@end example
+
+That completes the first part of this example.
+
+Now we will compile a multi-file project. Open the file
+@file{hello_2.adb}, and invoke @key{Ada | Set main and Build}. This
+finds an error in @file{hello_pkg.adb}:
+
+@example
+cd c:/Examples/Example_1/
+gnatmake -o hello_2 hello_2 -g -cargs -gnatq -gnatQ -bargs  -largs
+gcc -c -g -gnatq -gnatQ hello_pkg.adb
+hello_pkg.adb:2:08: keyword "body" expected here [see file name]
+gnatmake: "hello_pkg.adb" compilation error
+@end example
+
+This demonstrates that gnatmake finds the files needed by the main
+program. However, it cannot find files in a different directory,
+unless you use an Emacs Ada mode project file to specify the other directories;
+@xref{Set source search path}, or a GNAT project file; @ref{Use GNAT
+project file}.
+
+Invoke @key{Ada | Show main}; this displays @file{Ada mode main_unit: hello_2}.
+
+Move to the error with @key{C-x `}, and fix the error by adding @code{body}:
+
+@example
+package body Hello_Pkg is
+@end example
+
+Now, while still in @file{hello_pkg.adb}, invoke @key{Ada | Build}.
+gnatmake successfully builds @file{hello_2}. This demonstrates that
+Emacs has remembered the main file, in the project variable
+@code{main_unit}, and used it for the Build command.
+
+Finally, again while in @file{hello_pkg.adb}, invoke @key{Ada | Run}.
+The @code{*run*} buffer displays @code{Hello from hello_pkg.adb}.
+
+One final point. If you switch back to buffer @file{hello.adb}, and
+invoke @key{Ada | Run}, @file{hello_2.exe} will be run. That is
+because @code{main_unit} is still set to @code{hello_2}, as you can
+see when you invoke @key{Ada | Project | Edit}.
+
+There are three ways to change @code{main_unit}:
+
+@enumerate
+@item
+Invoke @key{Ada | Set main and Build}, which sets @code{main_unit} to
+the current file.
+
+@item
+Invoke @key{Ada | Project | Edit}, edit @code{main_unit} and
+@code{main}, and click @key{[save]}
+
+@item
+Invoke @key{Ada | Project | Load}, and load a project file that specifies @code{main_unit}
+
+@end enumerate
+
+@node Set compiler options, Set source search path, No project files, Compiling Examples
+@section Set compiler options
+
+This example illustrates using an Emacs Ada mode project file to set a
+compiler option.
+
+If you have files from @file{Example_1} open in Emacs, you should
+close them so you don't get confused. Use menu @key{File | Close
+(current buffer)}.
+
+In directory @file{Example_2}, create these files:
+
+@file{hello.adb}:
+
+@example
+with Ada.Text_IO;
+procedure Hello
+is begin
+   Put_Line("Hello from hello.adb");
+end Hello;
+@end example
+
+This is the same as @file{hello.adb} from @file{Example_1}. It has two
+errors; missing ``use Ada.Text_IO;'', and no space between
+@code{Put_Line} and its argument list.
+
+@file{hello.adp}:
+
+@example
+comp_opt=-gnatyt
+@end example
+
+This tells the GNAT compiler to check for token spacing; in
+particular, there must be a space preceding a parenthesis.
+
+In buffer @file{hello.adb}, invoke @key{Ada | Project | Load...}, and
+select @file{Example_2/hello.adp}.
+
+Then, again in buffer @file{hello.adb}, invoke @key{Ada | Set main and
+Build}. You should get a @code{*compilation*} buffer containing
+something like (the directory paths will be different):
+
+@example
+cd c:/Examples/Example_2/
+gnatmake -o hello hello -g -cargs -gnatyt  -bargs  -largs
+gcc -c -g -gnatyt hello.adb
+hello.adb:4:04: "Put_Line" is not visible
+hello.adb:4:04: non-visible declaration at a-textio.ads:264
+hello.adb:4:04: non-visible declaration at a-textio.ads:260
+hello.adb:4:12: (style) space required
+gnatmake: "hello.adb" compilation error
+@end example
+
+Compare this to the compiler output in @ref{No project files}; the
+gnatmake option @code{-cargs -gnatq -gnatQ} has been replaced by
+@code{-cargs -gnaty}, and an additional error is reported in
+@file{hello.adb} on line 4. This shows that @file{hello.adp} is being
+used to set the compiler options.
+
+Fixing the error, linking and running the code proceed as in @ref{No
+project files}.
+
+@node Set source search path, Use GNAT project file, Set compiler options, Compiling Examples
+@section Set source search path
+
+In this example, we show how to deal with files in more than one
+directory. We start with the same code as in @ref{No project files}; create those
+files (with the errors present)
+
+Create the directory @file{Example_3}, containing:
+
+@file{hello_pkg.ads}:
+
+@example
+package Hello_Pkg is
+   procedure Say_Hello;
+end Hello_Pkg;
+@end example
+
+@file{hello_pkg.adb}:
+
+@example
+with Ada.Text_IO;
+package Hello_Pkg is
+   procedure Say_Hello
+   is begin
+      Ada.Text_IO.Put_Line ("Hello from hello_pkg.adb");
+   end Say_Hello;
+end Hello_Pkg;
+@end example
+
+These are the same files from example 1; @file{hello_pkg.adb} has an
+error on line 2.
+
+In addition, create a directory @file{Example_3/Other}, containing these files:
+
+@file{Other/hello_3.adb}:
+
+@example
+with Hello_Pkg;
+with Ada.Text_IO; use Ada.Text_IO;
+procedure Hello_3
+is begin
+   Hello_Pkg.Say_Hello;
+   Put_Line ("From hello_3");
+end Hello_3;
+@end example
+
+There are no errors in this file.
+
+@file{Other/other.adp}:
+
+@example
+src_dir=..
+comp_opt=-I..
+@end example
+
+Note that there must be no trailing spaces.
+
+In buffer @file{hello_3.adb}, invoke @key{Ada | Project | Load...}, and
+select @file{Example_3/Other/other.adp}.
+
+Then, again in @file{hello_3.adb}, invoke @key{Ada | Set main and
+Build}. You should get a @code{*compilation*} buffer containing
+something like (the directory paths will be different):
+
+@example
+cd c:/Examples/Example_3/Other/
+gnatmake -o hello_3 hello_3 -g -cargs -I.. -bargs  -largs
+gcc -c -g -I.. hello_3.adb
+gcc -c -I./ -g -I.. -I- C:\Examples\Example_3\hello_pkg.adb
+hello_pkg.adb:2:08: keyword "body" expected here [see file name]
+gnatmake: "C:\Examples\Example_3\hello_pkg.adb" compilation error
+@end example
+
+Compare the @code{-cargs} option to the compiler output in @ref{Set
+compiler options}; this shows that @file{other.adp} is being used to
+set the compiler options.
+
+Move to the error with @key{C-x `}. Ada mode searches the list of
+directories given by @code{src_dir} for the file mentioned in the
+compiler error message.
+
+Fixing the error, linking and running the code proceed as in @ref{No
+project files}.
+
+@node Use GNAT project file,  , Set source search path, Compiling Examples
+@section Use GNAT project file
+
+In this example, we show how to use a GNAT project file.
+
+Create the directory @file{Example_4}, containing:
+
+@file{hello_pkg.ads}:
+
+@example
+package Hello_Pkg is
+   procedure Say_Hello;
+end Hello_Pkg;
+@end example
+
+@file{hello_pkg.adb}:
+
+@example
+with Ada.Text_IO;
+package Hello_Pkg is
+   procedure Say_Hello
+   is begin
+      Ada.Text_IO.Put_Line ("Hello from hello_pkg.adb");
+   end Say_Hello;
+end Hello_Pkg;
+@end example
+
+These are the same files from example 1; @file{hello_pkg.adb} has an
+error on line 2.
+
+In addition, create a directory @file{Example_4/Gnat_Project},
+containing these files:
+
+@file{Other/hello_4.adb}:
+
+@example
+with Hello_Pkg;
+with Ada.Text_IO; use Ada.Text_IO;
+procedure Hello_4
+is begin
+   Hello_Pkg.Say_Hello;
+   Put_Line ("From hello_4");
+end Hello_4;
+@end example
+
+There are no errors in this file.
+
+@file{Gnat_Project/hello_4.adp}:
+
+@example
+src_dir=..
+gnatmake_opt=-Phello_4.gpr
+@end example
+
+@file{Gnat_Project/hello_4.gpr}:
+
+@example
+Project Hello_4 is
+   for Source_Dirs use (".", "..");
+end Hello_4;
+@end example
+
+In buffer @file{hello_4.adb}, invoke @key{Ada | Project | Load...}, and
+select @file{Example_4/Gnat_Project/hello_4.adp}.
+
+Then, again in @file{hello_4.adb}, invoke @key{Ada | Set main and
+Build}. You should get a @code{*compilation*} buffer containing
+something like (the directory paths will be different):
+
+@example
+cd c:/Examples/Example_4/Gnat_Project/
+gnatmake -o hello_4 hello_4 -Phello_4.gpr -cargs -gnatq -gnatQ -bargs  -largs
+gcc -c -g -gnatyt -gnatq -gnatQ -I- -gnatA c:\Examples\Example_4\Gnat_Project\hello_4.adb
+gcc -c -g -gnatyt -gnatq -gnatQ -I- -gnatA c:\Examples\Example_4\hello_pkg.adb
+hello_pkg.adb:2:08: keyword "body" expected here [see file name]
+gnatmake: "c:\examples\example_4\hello_pkg.adb" compilation error
+@end example
+
+Compare the @code{gcc} options to the compiler output in @ref{Set
+compiler options}; this shows that @file{hello_4.gpr} is being used to
+set the compiler options.
+
+Fixing the error, linking and running the code proceed as in @ref{No
+project files}.
+
+@node Moving Through Ada Code, Identifier completion, Compiling Examples, Top
+@chapter Moving Through Ada Code
+@c -----------------------------------------------------------------------
+
+There are several easy to use commands to navigate through Ada code. All
+these functions are available through the Ada menu, and you can also
+use the following key bindings or the command names. Some of these
+menu entries are available only if the GNAT compiler is used, since
+the implementation relies on the GNAT cross-referencing information.
+
+@table @kbd
+@item M-C-e
+@findex ada-next-procedure
+Move to the next function/procedure/task, which ever comes next
+(@code{ada-next-procedure}).
+@item M-C-a
+@findex ada-previous-procedure
+Move to previous function/procedure/task
+(@code{ada-previous-procedure}).
+@item M-x ada-next-package
+@findex ada-next-package
+Move to next package.
+@item M-x ada-previous-package
+@findex ada-previous-package
+Move to previous package.
+@item C-c C-a
+@findex ada-move-to-start
+Move to matching start of @code{end} (@code{ada-move-to-start}).  If
+point is at the end of a subprogram, this command jumps to the
+corresponding @code{begin} if the user option
+@code{ada-move-to-declaration} is @code{nil} (default), otherwise it jumps to
+the subprogram declaration.
+@item C-c C-e
+@findex ada-move-to-end
+Move point to end of current block (@code{ada-move-to-end}).
+@item C-c o
+Switch between corresponding spec and body file
+(@code{ff-find-other-file}).  If point is in a subprogram, position
+point on the corresponding declaration or body in the other file.
+@item C-c c-d
+@findex ada-goto-declaration
+Move from any reference to its declaration, for from a declaration to
+its body (for procedures, tasks, private and incomplete types).
+@item C-c C-r
+@findex ada-find-references
+Runs the @file{gnatfind} command to search for all references to the
+identifier surrounding point (@code{ada-find-references}). Use
+@kbd{C-x `} (@code{next-error}) to visit each reference (as for
+compilation errors).
+@end table
+
+If the @code{ada-xref-create-ali} variable is non-@code{nil}, Emacs
+will try to run GNAT for you whenever cross-reference information is
+needed, and is older than the current source file.
+
+@node Identifier completion, Automatic Smart Indentation, Moving Through Ada Code, Top
+@chapter Identifier completion
+
+Emacs and Ada mode provide two general ways for the completion of
+identifiers. This is an easy way to type faster: you just have to type
+the first few letters of an identifiers, and then loop through all the
+possible completions.
+
+The first method is general for Emacs. It works by parsing all open
+files for possible completions.
+
+For instance, if the words @samp{my_identifier}, @samp{my_subprogram}
+are the only words starting with @samp{my} in any of the opened files,
+then you will have this scenario:
+
+@example
+You type:  my@key{M-/}
+Emacs inserts:  @samp{my_identifier}
+If you press @key{M-/} once again, Emacs replaces @samp{my_identifier} with
+@samp{my_subprogram}.
+Pressing @key{M-/} once more will bring you back to @samp{my_identifier}.
+@end example
+
+This is a very fast way to do completion, and the casing of words will
+also be respected.
+
+The second method (@key{C-TAB}) is specific to Ada mode and the GNAT
+compiler. Emacs will search the cross-information for possible
+completions.
+
+The main advantage is that this completion is more accurate: only
+existing identifier will be suggested.
+
+On the other hand, this completion is a little bit slower and requires
+that you have compiled your file at least once since you created that
+identifier.
+
+@table @kbd
+@item C-@key{TAB}
+@findex ada-complete-identifier
+Complete current identifier using cross-reference information.
+@item M-/
+Complete identifier using buffer information (not Ada-specific).
+@end table
+
+@node Automatic Smart Indentation, Formatting Parameter Lists, Identifier completion, Top
+@chapter Automatic Smart Indentation
+
+Ada mode comes with a full set of rules for automatic indentation. You
+can also configure the indentation, via the following variables:
+
+@table @asis
+@item @code{ada-broken-indent}           (default value: 2)
+Number of columns to indent the continuation of a broken line.
+
+@item @code{ada-indent}                  (default value: 3)
+Number of columns for default indentation.
+
+@item @code{ada-indent-record-rel-type}  (default value: 3)
+Indentation for @code{record} relative to @code{type} or @code{use}.
+
+@item @code{ada-indent-return}           (default value: 0)
+Indentation for @code{return} relative to @code{function} (if
+@code{ada-indent-return} is greater than 0), or the open parenthesis
+(if @code{ada-indent-return} is negative or 0).  Note that in the second
+case, when there is no open parenthesis, the indentation is done
+relative to @code{function} with the value of @code{ada-broken-indent}.
+
+@item @code{ada-label-indent}            (default value: -4)
+Number of columns to indent a label.
+
+@item @code{ada-stmt-end-indent}         (default value: 0)
+Number of columns to indent a statement @code{end} keyword on a separate line.
+
+@item @code{ada-when-indent}             (default value: 3)
+Indentation for @code{when} relative to @code{exception} or @code{case}.
+
+@item @code{ada-indent-is-separate}      (default value: t)
+Non-@code{nil} means indent @code{is separate} or @code{is abstract} if on a single line.
+
+@item @code{ada-indent-to-open-paren}    (default value: t)
+Non-@code{nil} means indent according to the innermost open parenthesis.
+
+@item @code{ada-indent-after-return}     (default value: t)
+Non-@code{nil} means that the current line will also be re-indented
+before inserting a newline, when you press @key{RET}.
+@end table
+
+Most of the time, the indentation will be automatic, i.e when you
+press @key{RET}, the cursor will move to the correct column on the
+next line.
+
+You can also indent single lines, or the current region, with @key{TAB}.
+
+Another mode of indentation exists that helps you to set up your
+indentation scheme. If you press @kbd{C-c @key{TAB}}, Ada mode will do
+the following:
+
+@itemize @bullet
+@item
+Reindent the current line, as @key{TAB} would do.
+@item
+Temporarily move the cursor to a reference line, i.e., the line that
+was used to calculate the current indentation.
+@item
+Display in the message window the name of the variable that provided
+the offset for the indentation.
+@end itemize
+
+The exact indentation of the current line is the same as the one for the
+reference line, plus an offset given by the variable.
+
+@table @kbd
+@item @key{TAB}
+Indent the current line or the current region.
+@item C-M-\
+Indent lines in the current region.
+@item C-c @key{TAB}
+Indent the current line and display the name of the variable used for
+indentation.
+@end table
+
+@node Formatting Parameter Lists, Automatic Casing, Automatic Smart Indentation, Top
+@chapter Formatting Parameter Lists
+
+@table @kbd
+@item C-c C-f
+@findex ada-format-paramlist
+Format the parameter list (@code{ada-format-paramlist}).
+@end table
+
+This aligns the declarations on the colon (@samp{:}) separating
+argument names and argument types, and aligns the @code{in},
+@code{out} and @code{in out} keywords.
+
+@node Automatic Casing, Statement Templates, Formatting Parameter Lists, Top
+@chapter Automatic Casing
+
+Casing of identifiers, attributes and keywords is automatically
+performed while typing when the variable @code{ada-auto-case} is set.
+Every time you press a word separator, the previous word is
+automatically cased.
+
+You can customize the automatic casing differently for keywords,
+attributes and identifiers. The relevant variables are the following:
+@code{ada-case-keyword}, @code{ada-case-attribute} and
+@code{ada-case-identifier}.
+
+All these variables can have one of the following values:
+
+@table @code
+@item downcase-word
+The word will be lowercase. For instance @code{My_vARIable} is
+converted to @code{my_variable}.
+
+@item upcase-word
+The word will be uppercase. For instance @code{My_vARIable} is
+converted to @code{MY_VARIABLE}.
+
+@item ada-capitalize-word
+The first letter and each letter following an underscore (@samp{_})
+are uppercase, others are lowercase. For instance @code{My_vARIable}
+is converted to @code{My_Variable}.
+
+@item ada-loose-case-word
+Characters after an underscore @samp{_} character are uppercase,
+others are not modified. For instance @code{My_vARIable} is converted
+to @code{My_VARIable}.
+@end table
+
+Ada mode allows you to define exceptions to these rules, in a file
+specified by the variable variable @code{ada-case-exception-file}
+(default @file{~/.emacs_case_exceptions}). Each line in this file
+specifies the casing of one word or word fragment. Comments may be
+included, separated from the word by a space.
+
+If the word starts with an asterisk (@key{*}), it defines the casing
+af a word fragemnt (or ``substring''); part of a word between two
+underscores or word boundary.
+
+For example:
+
+@example
+DOD        Department of Defense
+*IO
+GNAT       The GNAT compiler from Ada Core Technologies
+@end example
+
+The word fragment @code{*IO} applies to any word containing ``_io'';
+@code{Text_IO}, @code{Hardware_IO}, etc.
+
+@findex ada-create-case-exception
+There are two ways to add new items to this file: you can simply edit
+it as you would edit any text file. Or you can position point on the
+word you want to add, and select menu @samp{Ada | Edit | Create Case
+Exception}, or press @kbd{C-c C-y} (@code{ada-create-case-exception}).
+The word will automatically be added to the current list of exceptions
+and to the file.
+
+To define a word fragment case exception, select the word fragment,
+then select menu @samp{Ada | Edit | Create Case Exception Substring}.
+
+It is sometimes useful to have multiple exception files around (for
+instance, one could be the standard Ada acronyms, the second some
+company specific exceptions, and the last one some project specific
+exceptions). If you set up the variable @code{ada-case-exception-file}
+as a list of files, each of them will be parsed and used in your emacs
+session. However, when you save a new exception through the menu, as
+described above, the new exception will be added to the first file in
+the list.
+
+@table @kbd
+@item C-c C-b
+@findex ada-adjust-case-buffer
+Adjust case in the whole buffer (@code{ada-adjust-case-buffer}).
+@item C-c C-y
+Create a new entry in the exception dictionary, with the word under
+the cursor (@code{ada-create-case-exception})
+@item C-c C-t
+@findex ada-case-read-exceptions
+Rereads the exception dictionary from the file
+@code{ada-case-exception-file} (@code{ada-case-read-exceptions}).
+@end table
+
+@node Statement Templates, Comment Handling, Automatic Casing, Top
+@chapter Statement Templates
+
+Templates are defined for most Ada statements, using the Emacs
+``skeleton'' package. They can be inserted in the buffer using the
+following commands:
+
+@table @kbd
+@item C-c t b
+@findex ada-exception-block
+exception Block (@code{ada-exception-block}).
+@item C-c t c
+@findex ada-case
+case (@code{ada-case}).
+@item C-c t d
+@findex ada-declare-block
+declare Block (@code{ada-declare-block}).
+@item C-c t e
+@findex ada-else
+else (@code{ada-else}).
+@item C-c t f
+@findex ada-for-loop
+for Loop (@code{ada-for-loop}).
+@item C-c t h
+@findex ada-header
+Header (@code{ada-header}).
+@item C-c t i
+@findex ada-if
+if (@code{ada-if}).
+@item C-c t k
+@findex ada-package-body
+package Body (@code{ada-package-body}).
+@item C-c t l
+@findex ada-loop
+loop (@code{ada-loop}).
+@item C-c p
+@findex ada-subprogram-body
+subprogram body (@code{ada-subprogram-body}).
+@item C-c t t
+@findex ada-task-body
+task Body (@code{ada-task-body}).
+@item C-c t w
+@findex ada-while
+while Loop (@code{ada-while}).
+@item C-c t u
+@findex ada-use
+use (@code{ada-use}).
+@item C-c t x
+@findex ada-exit
+exit (@code{ada-exit}).
+@item C-c t C-a
+@findex ada-array
+array (@code{ada-array}).
+@item C-c t C-e
+@findex ada-elsif
+elsif (@code{ada-elsif}).
+@item C-c t C-f
+@findex ada-function-spec
+function Spec (@code{ada-function-spec}).
+@item C-c t C-k
+@findex ada-package-spec
+package Spec (@code{ada-package-spec}).
+@item C-c t C-p
+@findex ada-procedure-spec
+procedure Spec (@code{ada-package-spec}.
+@item C-c t C-r
+@findex ada-record
+record (@code{ada-record}).
+@item C-c t C-s
+@findex ada-subtype
+subtype (@code{ada-subtype}).
+@item C-c t C-t
+@findex ada-task-spec
+task Spec (@code{ada-task-spec}).
+@item C-c t C-u
+@findex ada-with
+with (@code{ada-with}).
+@item C-c t C-v
+@findex ada-private
+private (@code{ada-private}).
+@item C-c t C-w
+@findex ada-when
+when (@code{ada-when}).
+@item C-c t C-x
+@findex ada-exception
+exception (@code{ada-exception}).
+@item C-c t C-y
+@findex ada-type
+type (@code{ada-type}).
+@end table
+
+@node Comment Handling, Index, Statement Templates, Top
+@chapter Comment Handling
+
+By default, comment lines get indented like Ada code. There are a few
+additional functions to handle comments:
+
+@table @kbd
+@item M-;
+Start a comment in default column.
+@item M-j
+Continue comment on next line.
+@item C-c ;
+Comment the selected region (add -- at the beginning of lines).
+@item C-c :
+Uncomment the selected region
+@item M-q
+autofill the current comment.
+@end table
+
+@node Index,  , Comment Handling, Top
+@unnumbered Index
+
+@printindex fn
+
+@contents
+@bye
+
+@ignore
+   arch-tag: 68cf0d8a-55cc-4190-a28d-4984fa56ed1e
+@end ignore
index 6bb0f5e..10f18cd 100644 (file)
@@ -212,8 +212,9 @@ only be one Emacs server running at a time.  The @code{server-mode}
 command and @code{server-name} user option have been eliminated.
 
 @item
-The @file{emacsclient} program no longer accepts the @samp{--eval} and
-@samp{--display} command line options.
+The @file{emacsclient} program no longer accepts the @samp{--eval},
+@samp{--display} and @samp{--server-file} command line options, and
+can only establish local connections using Unix domain sockets.
 
 @item
 The command @code{quail-show-key}, for showing how to input a
index a92810e..bee9462 100644 (file)
@@ -536,10 +536,11 @@ allowed.  GUD assumes that the first argument not starting with a
 @subsection Debugger Operation
 
 @cindex fringes, and current execution line in GUD
-  When you run a debugger with GUD using the textual interface, the
-debugger uses an Emacs buffer for its ordinary input and output.  This
-is called the GUD buffer.  Input and output from the program you are
-debugging also use this buffer.
+  Generally when you run a debugger with GUD, the debugger uses an Emacs
+buffer for its ordinary input and output.  This is called the GUD
+buffer.  Input and output from the program you are debugging also use
+this buffer.  We call this @dfn{text command mode}.  The GDB Graphical
+Interface can use further buffers (@pxref{GDB Graphical Interface}).
 
   The debugger displays the source files of the program by visiting
 them in Emacs buffers.  An arrow in the left fringe indicates the
@@ -563,13 +564,13 @@ to be reflected in the debugger's tables.
   The Tooltip facility (@pxref{Tooltips}) provides support for GUD@.
 You activate this feature by turning on the minor mode
 @code{gud-tooltip-mode}.  Then you can display a variable's value in a
-tooltip simply by pointing at it with the mouse.  In graphical mode,
-with a C program, you can also display the @code{#define} directive
-associated with an identifier when the program is not executing.  This
-operates in the GUD buffer and in source buffers with major modes in
-the list @code{gud-tooltip-modes}.  If the variable
-@code{gud-tooltip-echo-area} is non-@code{nil} then the variable's
-value is displayed in the echo area.
+tooltip simply by pointing at it with the mouse.  This operates in the
+GUD buffer and in source buffers with major modes in the list
+@code{gud-tooltip-modes}.  If the variable @code{gud-tooltip-echo-area}
+is non-@code{nil} then the variable's value is displayed in the echo
+area.  When debugging a C program using the GDB Graphical Interface, you
+can also display macro definitions associated with an identifier when
+the program is not executing.
 
   GUD tooltips are disabled when you use GDB in text command mode
 (@pxref{GDB Graphical Interface}), because displaying an expression's
@@ -828,11 +829,13 @@ operation you must not change these values during the GDB session.
 @vindex gud-gdb-command-name
 @findex gdba
   You can also run GDB in text command mode, like other debuggers.  To
-do this, set @code{gud-gdb-command-name} to @code{"gdb --fullname"} or
-edit the startup command in the minibuffer to say that.  You need to
-do use text command mode to run multiple debugging sessions within one
-Emacs session.  If you have customized @code{gud-gdb-command-name} in
-that way, you can use @kbd{M-x gdba} to invoke GDB in graphical mode.
+do this, replace the GDB @code{"--annotate=3"} option with
+@code{"--fullname"} either in the minibuffer for the current Emacs
+session, or the custom variable @code{gud-gdb-command-name} for all
+future sessions.  You need to use text command mode to debug multiple
+programs within one Emacs session.  If you have customized
+@code{gud-gdb-command-name} in this way, you can use @kbd{M-x gdba} to
+invoke GDB in graphical mode.
 
 @menu
 * GDB-UI Layout::               Control the number of displayed buffers.
@@ -1097,7 +1100,7 @@ also display the frame address as a tooltip to help identify the frame
 in which they were defined.
 
   To expand or contract a complex data type, click @kbd{Mouse-2}
-on the tag to the left of the expression.
+or press @key{SPC} on the tag to the left of the expression.
 
 @kindex D @r{(GDB speedbar)}
 @findex gdb-var-delete
index cb3fa72..22e03ed 100644 (file)
@@ -5,7 +5,7 @@
 
 @c The edition number appears in several places in this file
 @set EDITION   Sixteenth
-@set EMACSVER  22.0.90
+@set EMACSVER  22.0.91
 
 @copying
 This is the @value{EDITION} edition of the @cite{GNU Emacs Manual},
@@ -1027,7 +1027,7 @@ Contributors to GNU Emacs include Jari Aalto, Per Abrahamsen, Tomas
 Abrahamsson, Jay K.@: Adams, Michael Albinus, Nagy Andras, Ralf
 Angeli, Joe Arceneaux, Miles Bader, David Bakhash, Juanma Barranquero,
 Eli Barzilay, Steven L.@: Baur, Jay Belanger, Alexander L.@: Belikoff,
-Boaz Ben-Zvi, Karl Berry, Ray Blaak, Jim Blandy, Johan Bockg@aa{}rd,
+Boaz Ben-Zvi, Karl Berry, Anna M.@: Bigatti, Ray Blaak, Jim Blandy, Johan Bockg@aa{}rd,
 Per Bothner, Terrence Brannon, Frank Bresz, Peter Breton, Emmanuel
 Briot, Kevin Broadey, Vincent Broman, David M.@: Brown, Georges
 Brun-Cottan, Joe Buehler, W@l{}odek Bzyl, Bill Carpenter, Per
@@ -1082,7 +1082,7 @@ Schaefer, Holger Schauer, William Schelter, Ralph Schleicher, Gregor
 Schmid, Michael Schmidt, Ronald S. Schnell, Philippe Schnoebelen, Jan
 Schormann, Alex Schroeder, Stephen Schoef, Raymond Scholz, Randal
 Schwartz, Oliver Seidel, Manuel Serrano, Hovav Shacham, Stanislav
-Shalunov, Mark Shapiro, Richard Sharman, Olin Shivers, Espen Skoglund,
+Shalunov, Marc Shapiro, Richard Sharman, Olin Shivers, Espen Skoglund,
 Rick Sladkey, Lynn Slater, Chris Smith, David Smith, Paul D.@: Smith,
 Andre Spiegel, Michael Staats, William Sommerfeld, Michael Staats,
 Reiner Steib, Sam Steingold, Ake Stenhoff, Peter Stephenson, Ken
@@ -1586,12 +1586,7 @@ Public License instead of this License.
 
 @include doclicense.texi
 @include cmdargs.texi
-@iftex
-@include xresmini.texi
-@end iftex
-@ifnottex
 @include xresources.texi
-@end ifnottex
 
 @include anti.texi
 @include macos.texi
index c4317f1..0d535ea 100644 (file)
@@ -12,7 +12,7 @@
 @syncodeindex fn cp
 
 @copying
-This manual is for ERC version 5.1.4.
+This manual is for ERC version 5.2 stable pre-release.
 
 Copyright @copyright{} 2005, 2006 Free Software Foundation, Inc.
 
@@ -271,7 +271,7 @@ itself.  An example follows.
 (require 'erc)
 @end lisp
 
-Once ERC is loaded, the command @kbd{M-x erc-select} will start ERC and
+Once ERC is loaded, the command @kbd{M-x erc} will start ERC and
 prompt for the server to connect to.
 
 @c PRE5_2: Sample session, including:
@@ -520,11 +520,11 @@ Translate morse code in messages
 @section Connecting to an IRC Server
 @cindex connecting
 
-The easiest way to connect to an IRC server is to call
-@kbd{M-x erc-select}.  If you want to assign this function to a
-keystroke, the following will help you figure out its parameters.
+The easiest way to connect to an IRC server is to call @kbd{M-x erc}.
+If you want to assign this function to a keystroke, the following will
+help you figure out its parameters.
 
-@defun erc-select
+@defun erc
 Select connection parameters and run ERC.
 Non-interactively, it takes the following keyword arguments.
 
@@ -543,7 +543,7 @@ That is, if called with the following arguments, @var{server} and
 parameters.
 
 @example
-(erc-select :server "irc.freenode.net" :full-name "Harry S Truman")
+(erc :server "irc.freenode.net" :full-name "Harry S Truman")
 @end example
 @end defun
 
index 0e0fd1b..0261179 100644 (file)
@@ -453,7 +453,7 @@ or absolute; the meaning of a relative file name depends on the current
 directory, but an absolute file name refers to the same file regardless
 of which directory is current.  On GNU and Unix systems, an absolute
 file name starts with a slash (the root directory) or with @samp{~/} or
-@samp{~@var{user}/} (a home directory).  On MS-Windows/MS-DOS, and
+@samp{~@var{user}/} (a home directory).  On MS-Windows/MS-DOS, an
 absolute file name can also start with a drive letter and a colon
 @samp{@var{d}:}.
 
@@ -848,8 +848,8 @@ has never been saved).  @xref{Saving}.
 
 @item Moving Text
 Moving text means erasing it from one place and inserting it in
-another.  The usual way to move text by killing (q.v.@:) and then
-yanking (q.v.@:).  @xref{Killing}.
+another.  The usual way to move text is by killing (q.v.@:) it and then
+yanking (q.v.@:) it.  @xref{Killing}.
 
 @item MULE
 MULE refers to the Emacs features for editing multilingual non-@acronym{ASCII} text
index 66b8c2d..6596adf 100644 (file)
@@ -46,19 +46,19 @@ intelligent or general.  For such things, Lisp must be used.
 @section Basic Use
 
 @table @kbd
-@item C-x (
-@itemx @key{F3}
+@item @key{F3}
+@itemx C-x (
 Start defining a keyboard macro (@code{kmacro-start-macro}).
+@item @key{F4}
+If a keyboard macro is being defined, end the definition; otherwise,
+execute the most recent keyboard macro
+(@code{kmacro-end-or-call-macro}).
 @item C-x )
 End the definition of a keyboard macro (@code{kmacro-end-macro}).
 @item C-x e
 Execute the most recent keyboard macro (@code{kmacro-end-and-call-macro}).
 First end the definition of the keyboard macro, if currently defining it.
 To immediately execute the keyboard macro again, just repeat the @kbd{e}.
-@item @key{F4}
-If a keyboard macro is being defined, end the definition; otherwise,
-execute the most recent keyboard macro
-(@code{kmacro-end-or-call-macro}).
 @item C-u C-x (
 Re-execute last keyboard macro, then add more keys to its definition.
 @item C-u C-u C-x (
@@ -68,17 +68,19 @@ Run the last keyboard macro on each line that begins in the region
 (@code{apply-macro-to-region-lines}).
 @end table
 
+@kindex F3
+@kindex F4
 @kindex C-x (
 @kindex C-x )
 @kindex C-x e
 @findex kmacro-start-macro
 @findex kmacro-end-macro
 @findex kmacro-end-and-call-macro
-  To start defining a keyboard macro, type the @kbd{C-x (} command
+  To start defining a keyboard macro, type the @kbd{F3} or @kbd{C-x (} command
 (@code{kmacro-start-macro}).  From then on, your keys continue to be
 executed, but also become part of the definition of the macro.  @samp{Def}
 appears in the mode line to remind you of what is going on.  When you are
-finished, the @kbd{C-x )} command (@code{kmacro-end-macro}) terminates the
+finished, the @kbd{F4} or @kbd{C-x )} command (@code{kmacro-end-macro}) terminates the
 definition (without becoming part of it!).  For example,
 
 @example
@@ -115,7 +117,14 @@ MS-DOS, @kbd{C-@key{BREAK}}).
 
   The key @key{F4} is like a combination of @kbd{C-x )} and @kbd{C-x
 e}.  If you're defining a macro, @key{F4} ends the definition.
-Otherwise it executes the last macro.
+Otherwise it executes the last macro.  For example,
+
+@example
+F3 xyz F4 F4 F4
+@end example
+
+@noindent
+inserts @samp{xyzxyzxyz} in the current buffer.
 
   If you wish to repeat an operation at regularly spaced places in the
 text, define a macro and include as part of the macro the commands to move
@@ -152,7 +161,8 @@ you invoked the keyboard macro, it also necessarily exits the keyboard
 macro as part of the process.
 
   After you have terminated the definition of a keyboard macro, you can add
-to the end of its definition by typing @kbd{C-u C-x (}.  This is equivalent
+to the end of its definition by typing @kbd{C-u F3} or @kbd{C-u C-x (}.
+This is equivalent
 to plain @kbd{C-x (} followed by retyping the whole definition so far.  As
 a consequence it re-executes the macro as previously defined.
 
index 613151f..f47c571 100644 (file)
@@ -147,7 +147,7 @@ info.dvi: $(INFOSOURCES)
 $(infodir)/emacs: $(EMACSSOURCES)
        $(MAKEINFO) emacs.texi
 
-emacs.dvi: $(EMACSSOURCES) $(srcdir)/xresmini.texi
+emacs.dvi: $(EMACSSOURCES)
        $(ENVADD) $(TEXI2DVI) $(srcdir)/emacs.texi
 
 # This target is here so you could easily get the list of the *.texi
index dcc84e1..dfe9ab0 100644 (file)
@@ -8,12 +8,12 @@
 @c %**end of header
 
 @c Version of the software and manual.
-@set VERSION 8.0.1
+@set VERSION 8.0.3
 @c Edition of the manual. It is either empty for the first edition or
 @c has the form ", nth Edition" (without the quotes).
-@set EDITION 
-@set UPDATED 2006-06-20
-@set UPDATE-MONTH June, 2006
+@set EDITION
+@set UPDATED 2006-11-12
+@set UPDATE-MONTH November, 2006
 
 @c Other variables.
 @set MH-BOOK-HOME http://rand-mh.sourceforge.net/book/mh
@@ -1481,7 +1481,8 @@ use @command{procmail} to filter this mail into @file{~/mail/mh-e}
 with the following recipe in @file{.procmailrc}:
 
 @smallexample
-MAILDIR=$HOME/mail
+PATH=$PATH:/usr/bin/mh
+MAILDIR=$HOME/`mhparam Path`
 :0:
 * ^From mh-e-devel-admin@@stop.mail-abuse.org
 mh-e
@@ -1560,9 +1561,9 @@ the message numbers from outside of MH-E.
 @cindex modes, MH-Show
 @cindex reading mail
 @findex mh-rmail
-@kindex M-x mh-rmail
 @kindex F r
 @kindex F v
+@kindex M-x mh-rmail
 
 The MH-E entry point for reading mail is @kbd{M-x mh-rmail}. This
 command incorporates your mail and creates a buffer called
@@ -1573,6 +1574,14 @@ into MH-E. Or, give a prefix argument to @code{mh-rmail} so it will
 prompt you for folder to visit like @kbd{F v} (for example, @kbd{C-u
 M-x mh-rmail @key{RET} bob @key{RET}}). @xref{Folders}.}.
 
+@findex display-time
+@vindex read-mail-command
+
+There are some commands that need to read mail, such as @kbd{Mouse-2}
+over the @samp{Mail} button that @code{display-time} adds to the mode
+line. You can configure Emacs to have these commands use MH-E by
+setting the option @code{read-mail-command} to @samp{mh-rmail}.
+
 @cindex @command{scan}
 @cindex @samp{Message} menu
 @cindex MH commands, @command{scan}
@@ -2476,6 +2485,13 @@ the option @code{mh-display-buttons-for-alternatives-flag} is on, then
 the preferred part is shown inline and buttons are shown for each of
 the other alternatives.
 
+@vindex mm-discouraged-alternatives
+
+Many people prefer to see the @samp{text/plain} alternative rather
+than the @samp{text/html} alternative. To do this in MH-E, customize
+the option @code{mm-discouraged-alternatives}, and add
+@samp{text/html}. The next best alternative, if any, will be shown.
+
 @kindex K i
 @findex mh-folder-inline-mime-part
 
@@ -6381,7 +6397,7 @@ Function called by the tool bar search button (default:
 Tool bar location (default: @samp{Same As Default Tool Bar}).
 @c -------------------------
 @item mh-xemacs-use-tool-bar-flag
-If on, use tool bar (default: on, if supported).
+If @samp{on}, use tool bar (default: @samp{on}, if supported).
 @end vtable
 
 In GNU Emacs, icons for some of MH-E's functions are added to the tool
@@ -7559,12 +7575,20 @@ reclassifies a range of messages (@pxref{Ranges}) as ham if it were
 incorrectly classified as spam. It then refiles the message into the
 @file{+inbox} folder.
 
+@cindex @samp{*MH-E Log*}
+@cindex buffers, @samp{*MH-E Log*}
+@findex call-process
 @vindex mh-junk-background
 
 By default, the programs are run in the foreground, but this can be
 slow when junking large numbers of messages. If you have enough memory
 or don't junk that many messages at the same time, you might try
-turning on the option @code{mh-junk-background}.
+turning on the option @code{mh-junk-background}. @footnote{Note that
+the option @code{mh-junk-background} is used as the @code{display}
+argument in the call to @code{call-process}. Therefore, turning on
+this option means setting its value to @samp{0}. You can also set its
+value to @samp{t} to direct the programs' output to the @samp{*MH-E
+Log*} buffer; this may be useful for debugging.}
 
 The following sections discuss the various counter-spam measures that
 MH-E can work with.
@@ -7590,6 +7614,7 @@ To use SpamAssassin, add the following recipes to @file{~/.procmailrc}:
 @cindex header field, @samp{X-Spam-Status:}
 
 @smallexample
+PATH=$PATH:/usr/bin/mh
 MAILDIR=$HOME/`mhparam Path`
 
 # Fight spam with SpamAssassin.
@@ -7712,6 +7737,7 @@ To use bogofilter, add the following recipes to @file{~/.procmailrc}:
 @cindex header field, @samp{X-Bogosity:}
 
 @smallexample
+PATH=$PATH:/usr/bin/mh
 MAILDIR=$HOME/`mhparam Path`
 
 # Fight spam with Bogofilter.
@@ -7764,6 +7790,7 @@ To use SpamProbe, add the following recipes to @file{~/.procmailrc}:
 @cindex header field, @samp{X-SpamProbe:}
 
 @smallexample
+PATH=$PATH:/usr/bin/mh
 MAILDIR=$HOME/`mhparam Path`
 
 # Fight spam with SpamProbe.
@@ -7803,6 +7830,7 @@ can't read.
 @cindex header field, @samp{Subject:}
 
 @smallexample
+PATH=$PATH:/usr/bin/mh
 MAILDIR=$HOME/`mhparam Path`
 
 #
@@ -8528,6 +8556,7 @@ to the GnuCash mailing list, substitute one to which you are
 subscribed.
 
 @smallexample
+PATH=$PATH:/usr/bin/mh
 MAILDIR=$HOME/`mhparam Path`
 # Place mail sent to the GnuCash mailing list in gnucash.spool, where
 # Gnus will pick it up.
index 839e8bc..d851135 100644 (file)
@@ -486,12 +486,16 @@ also change the coding system for a running subshell by typing
 @kbd{C-x @key{RET} p} in the shell buffer.  @xref{Communication
 Coding}.
 
+@cindex @env{INSIDE_EMACS} environment variable
+  Emacs sets the envitonment variable @env{INSIDE_EMACS} to @code{t}
+in the subshell.  Programs can check this variable to determine
+whether they are running inside an Emacs subshell.
+
 @cindex @env{EMACS} environment variable
-  Unless the environment variable @env{EMACS} is already defined,
-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.
+  Emacs also sets the @env{EMACS} environment variable to @code{t} if
+it is not already defined.  @strong{Warning:} This environment
+variable is deprecated.  Programs that check this variable should be
+changed to check @env{INSIDE_EMACS} instead.
 
 @node Shell Mode
 @subsection Shell Mode
index 88fdb4b..d92929e 100644 (file)
@@ -518,6 +518,16 @@ character.  If the value is a character, use that character to escape
 any quote characters that appear; otherwise chose a suitable escape
 character based on the type of the program.
 
+@ifnottex
+@findex w32-shell-execute
+  The function @code{w32-shell-execute} can be useful for writing
+customized commands that run MS-Windows applications registered to
+handle a certain standard Windows operation for a specific type of
+document or file.  This function is a wrapper around the Windows
+@code{ShellExecute} API.  See the MS-Windows API documentation for
+more details.
+@end ifnottex
+
 @node Windows Printing
 @section Printing and MS-Windows
 
index 9437e30..3e7a35d 100644 (file)
@@ -212,11 +212,13 @@ always load any particular Lisp file in the same way.  However, you can
 load a Lisp file as unibyte, on any one occasion, by typing @kbd{C-x
 @key{RET} c raw-text @key{RET}} immediately before loading it.
 
-  The mode line indicates whether multibyte character support is enabled
-in the current buffer.  If it is, there are two or more characters (most
-often two dashes) before the colon near the beginning of the mode line.
-When multibyte characters are not enabled, nothing precedes the colon
-except a single dash.
+  The mode line indicates whether multibyte character support is
+enabled in the current buffer.  If it is, there are two or more
+characters (most often two dashes) near the beginning of the mode
+line, before the indication of the visited file's end-of-line
+convention (colon, backslash, etc.).  When multibyte characters
+are not enabled, nothing precedes the colon except a single dash.
+@xref{Mode Line}, for more details about this.
 
 @node Language Environments
 @section Language Environments
@@ -1302,7 +1304,7 @@ menus cannot handle fontsets.
 The resource value should have this form:
 
 @smallexample
-@var{fontpattern}, @r{[}@var{charsetname}:@var{fontname}@r{]@dots{}}
+@var{fontpattern}, @r{[}@var{charset}:@var{font}@r{]@dots{}}
 @end smallexample
 
 @noindent
index 0c3460b..db8f20c 100644 (file)
@@ -3,20 +3,20 @@
 @setfilename ../info/org
 @settitle Org Mode Manual
 
-@set VERSION 4.44
-@set DATE August 2006
+@set VERSION 4.56
+@set DATE November 2006
 
 @dircategory Emacs
 @direntry
-* Org Mode: (org).     outline-based notes management and organizer
+* Org Mode: (org).      outline-based notes management and organizer
 @end direntry
 
 @c Version and Contact Info
 @set MAINTAINERSITE @uref{http://www.astro.uva.nl/~dominik/Tools/org/,maintainers webpage}
 @set AUTHOR Carsten Dominik
 @set MAINTAINER Carsten Dominik
-@set MAINTAINEREMAIL @email{dominik@@science.uva.nl}
-@set MAINTAINERCONTACT @uref{mailto:dominik@@science.uva.nl,contact the maintainer}
+@set MAINTAINEREMAIL @email{dominik at science dot uva dot nl}
+@set MAINTAINERCONTACT @uref{mailto:dominik at science dot uva dot nl,contact the maintainer}
 @c %**end of header
 @finalout
 
@@ -111,8 +111,7 @@ Document Structure
 * Structure editing::           Changing sequence and level of headlines
 * Archiving::                   Move done task trees to a different place
 * Sparse trees::                Matches embedded in context
-* Plain lists::                 Editing hand-formatted lists
-* Checkboxes::                  Easily checking off things.
+* Plain lists::                 Additional structure within an entry
 
 Archiving
 
@@ -143,6 +142,7 @@ Hyperlinks
 * Internal links::              Links to other places in the current file
 * External links::              URL-like links to the world
 * Handling links::              Creating, inserting and following
+* Link abbreviations::          Shortcuts for writing complex links
 * Search options::              Linking to a specific location
 * Custom searches::             When the default search is not enough
 * Remember::                    Org-trees store quick notes
@@ -157,6 +157,8 @@ TODO items
 * TODO basics::                 Marking and displaying TODO entries
 * TODO extensions::             Workflow and assignments
 * Priorities::                  Some things are more important than others
+* Breaking down tasks::         Splitting a task into managable pieces
+* Checkboxes::                  Tick-off lists
 
 Extended use of TODO keywords
 
@@ -168,8 +170,13 @@ Timestamps
 
 * Time stamps::                 Assigning a time to a tree entry
 * Creating timestamps::         Commands which insert timestamps
+* Custom time format::          If you cannot work with the ISO format
 * Progress logging::            Documenting when what work was done.
 
+Creating timestamps
+
+* The date/time prompt::        How org-mode helps you entering date and time
+
 Progress Logging
 
 * Closing items::               When was this entry marked DONE?
@@ -189,15 +196,27 @@ Agenda Views
 * Global TODO list::            All unfinished action items
 * Matching headline tags::      Structured information with fine-tuned search
 * Timeline::                    Time-sorted view for single file
+* Presentation and sorting::    How agenda items are prepared for display
 * Agenda commands::             Remote editing of org trees
+* Custom agenda views::         Defining special searches and views
 
 The weekly/daily agenda
 
+* Calendar/Diary integration::  Integrating Anniversaries and more
+
+Presentation and sorting
+
 * Categories::                  Not all tasks are equal
 * Time-of-day specifications::  How the agenda knows the time
-* Calendar/Diary integration::  Integrating Anniversaries and more
 * Sorting of agenda items::     The order of things
 
+Custom agenda views
+
+* Storing searches::            Type once, use often
+* Block agenda::                All the stuff you need in a single buffer
+* Setting Options::             Changing the rules
+* Batch processing::            Agenda views from the command line
+
 Embedded LaTeX
 
 * Math symbols::                TeX macros for symbols and Greek letters
@@ -284,20 +303,29 @@ Org-mode is a mode for keeping notes, maintaining ToDo lists, and doing
 project planning with a fast and effective plain-text system.
 
 Org-mode develops organizational tasks around NOTES files that contain
-information about projects as plain text.  Org-mode is implemented on
-top of outline-mode, which makes it possible to keep the content of
-large files well structured.  Visibility cycling and structure editing
-help to work with the tree.  Tables are easily created with a built-in
-table editor.  Org-mode supports ToDo items, deadlines, time stamps,
-and scheduling.  It dynamically compiles entries into an agenda that
-utilizes and smoothly integrates much of the Emacs calendar and diary.
-Plain text URL-like links connect to websites, emails, Usenet
-messages, BBDB entries, and any files related to the projects.  For
-printing and sharing of notes, an Org-mode file can be exported as a
+lists or information about projects as plain text.  Org-mode is
+implemented on top of outline-mode, which makes it possible to keep the
+content of large files well structured.  Visibility cycling and
+structure editing help to work with the tree.  Tables are easily created
+with a built-in table editor.  Org-mode supports ToDo items, deadlines,
+time stamps, and scheduling.  It dynamically compiles entries into an
+agenda that utilizes and smoothly integrates much of the Emacs calendar
+and diary.  Plain text URL-like links connect to websites, emails,
+Usenet messages, BBDB entries, and any files related to the projects.
+For printing and sharing of notes, an Org-mode file can be exported as a
 structured ASCII file, as HTML, or (todo and agenda items only) as an
 iCalendar file.  It can also serve as a publishing tool for a set of
 linked webpages.
 
+An important design aspect that distinguishes Org-mode from for example
+Planner/Muse is that it encougages to store every piece of information
+only once.  In Planner, you have project pages, day pages and possibly
+other files, duplicating some information such as tasks.  In Org-mode,
+you only have notes files.  In your notes you mark entries as tasks,
+label them with tags and timestamps.  All necessary lists like a
+schedule for the day, the agenda for a meeting, tasks lists selected by
+tags etc are created dynamically when you need them.
+
 Org-mode keeps simple things simple.  When first fired up, it should
 feel like a straightforward, easy to use outliner.  Complexity is not
 imposed, but a large amount of functionality is available when you need
@@ -310,12 +338,13 @@ example:
 @r{@bullet{} as an ASCII table editor with spreadsheet-like capabilities}
 @r{@bullet{} as a TODO list editor}
 @r{@bullet{} as a full agenda and planner with deadlines and work scheduling}
+@r{@bullet{} as an environment to implement David Allen's GTD system}
 @r{@bullet{} as a simple hypertext system, with HTML export}
 @r{@bullet{} as a publishing tool to create a set of interlinked webpages}
 @end example
 
-The Org-mode table editor can be integrated into any major mode by
-activating the minor Orgtbl-mode.
+Org-mode's automatic, context sensitive table editor can be integrated
+into any major mode by activating the minor Orgtbl-mode.
 
 @cindex FAQ
 There is a website for Org-mode which provides links to the newest
@@ -432,8 +461,8 @@ For bug reports, please provide as much information as possible,
 including the version information of Emacs (@kbd{C-h v emacs-version
 @key{RET}}) and Org-mode (@kbd{C-h v org-version @key{RET}}), as well as
 the Org-mode related setup in @file{.emacs}.  If an error occurs, a
-traceback can be very useful.  Often a small example file helps, along
-with clear information about:
+backtrace can be very useful (see below on how to create one).  Often a
+small example file helps, along with clear information about:
 
 @enumerate
 @item What exactly did you do?
@@ -442,6 +471,38 @@ with clear information about:
 @end enumerate
 @noindent Thank you for helping to improve this mode.
 
+@subsubheading How to create a useful backtrace
+
+@cindex backtrace of an error
+If working with Org-mode produces an error with a message you don't
+understand, you may have hit a bug.  The best way to report this is by
+providing, in addition to what was mentioned above, a @emph{Backtrace}.
+This is information from the built-in debugger about where and how the
+error occurred.  Here is how to produce a useful backtrace:
+
+@enumerate
+@item
+Start a fresh Emacs or XEmacs, and make sure that it will load the
+original Lisp code in @file{org.el} instead of the compiled version in
+@file{org.elc}.  The backtrace contains much more information if it is
+produced with uncompiled code.  To do this, either rename @file{org.elc}
+to something else before starting Emacs, or ask Emacs explicitly to load
+@file{org.el} by using the command line
+@example
+emacs -l /path/to/org.el
+@end example
+@item
+Go to the @code{Options} menu and select @code{Enter Debugger on Error}
+(XEmacs has this option in the @code{Troubleshooting} sub-menu).
+@item
+Do whatever you have to do to hit the error.  Don't forget to
+document the steps you take.
+@item
+When you hit the error, a @file{*Backtrace*} buffer will appear on the
+screen.  Save this buffer to a file (for example using @kbd{C-x C-w}) and
+attach it to your bug report.
+@end enumerate
+
 @node Document structure, Tables, Introduction, Top
 @chapter Document Structure
 @cindex document structure
@@ -458,8 +519,7 @@ edit the structure of the document.
 * Structure editing::           Changing sequence and level of headlines
 * Archiving::                   Move done task trees to a different place
 * Sparse trees::                Matches embedded in context
-* Plain lists::                 Editing hand-formatted lists
-* Checkboxes::                  Easily checking off things.
+* Plain lists::                 Additional structure within an entry
 @end menu
 
 @node Outlines, Headlines, Document structure, Document structure
@@ -555,6 +615,12 @@ Note that inside tables, @kbd{S-@key{TAB}} jumps to the previous field.
 @kindex C-c C-a
 @item C-c C-a
 Show all.
+@kindex C-c C-r
+@item C-c C-r
+Reveal context around point, showing the current entry, the following
+heading and the hierarchy above.  Useful for working near a location
+exposed by a sparse tree command (@pxref{Sparse trees}) or an agenda
+command (@pxref{Agenda commands}).
 @end table
 
 When Emacs first visits an Org-mode file, the global state is set to
@@ -625,7 +691,9 @@ the middle of a line, the line is split and the rest of the line becomes
 the new headline.  If the command is used at the beginning of a
 headline, the new headline is created before the current line.  If at
 the beginning of any other line, the content of that line is made the
-new heading.
+new heading.  If the command is used at the end of a folded subtree
+(i.e. behind the ellipses at the end of a headline), then a headline
+like the current one will be inserted after the end of the subtree.
 @kindex M-S-@key{RET}
 @item M-S-@key{RET}
 Insert new TODO entry with same level as current heading.
@@ -699,9 +767,10 @@ its location in the outline tree, but behaves in the following way:
 @itemize @minus
 @item
 It does not open when you attempt to do so with a visibility cycling
-command (@pxref{Visibility cycling}).  You can still open it with a
-normal outline command like @code{show-all}.  Or you can modify the
-option @code{org-cycle-open-archived-trees}.
+command (@pxref{Visibility cycling}).  You can force cycling archived
+subtrees with @kbd{C-@key{TAB}}, or by setting the option
+@code{org-cycle-open-archived-trees}.  Also normal outline commands like
+@code{show-all} will open archived subtrees.
 @item
 During sparse tree construction (@pxref{Sparse trees}), matches in
 archived subtrees are not exposed, unless you configure the option
@@ -716,7 +785,7 @@ is.  Configure the details using the variable
 @code{org-export-with-archived-trees}.
 @end itemize
 
-The following commands allow to set or clear the ARCHIVE tag:
+The following commands help managing the ARCHIVE tag:
 
 @table @kbd
 @kindex C-c C-x C-a
@@ -731,6 +800,9 @@ To do this, each subtree is checked for open TODO entries.  If none are
 found, the command offers to set the ARCHIVE tag for the child.  If the
 cursor is @emph{not} on a headline when this command is invoked, the
 level 1 trees will be checked.
+@kindex C-@kbd{TAB}
+@item C-@kbd{TAB}
+Cycle a tree even if it is tagged with ARCHIVE.
 @end table
 
 @node Moving subtrees,  , ARCHIVE tag, Archiving
@@ -790,7 +862,9 @@ match is in the body of an entry, headline and body are made visible.
 In order to provide minimal context, also the full hierarchy of
 headlines above the match is shown, as well as the headline following
 the match.  Each match is also highlighted; the highlights disappear
-when the buffer is changed with an editing command.
+when the bufer is changes an editing command, or by pressing @kbd{C-c
+C-c}.  When called with a @kbd{C-u} prefix argument, previous highlights
+are kept, so several calls to this command can be stacked.
 @end table
 @noindent
 For frequently used sparse trees of specific search strings, you can
@@ -820,20 +894,17 @@ XEmacs uses selective display for outlining, not text properties.}.
 Or you can use the command @kbd{C-c C-e v} to export only the visible
 part of the document and print the resulting file.
 
-
-@node Plain lists, Checkboxes, Sparse trees, Document structure
+@node Plain lists,  , Sparse trees, Document structure
 @section Plain lists
 @cindex plain lists
 @cindex lists, plain
 @cindex lists, ordered
 @cindex ordered lists
 
-Headlines define both the structure of the Org-mode file, and also lists
-(for example, TODO items (@pxref{TODO items}) should be created using
-headline levels).  When taking notes, however, the plain text is
-sometimes easier to read with hand-formatted lists.  Org-mode supports
-editing such lists, and the HTML exporter (@pxref{Exporting}) does
-parse and format them.
+Within an entry of the outline tree, hand-formatted lists can provide
+additional structure.  They also provide a way to create lists of
+checkboxes (@pxref{Checkboxes}).  Org-mode supports editing such lists,
+and the HTML exporter (@pxref{Exporting}) does parse and format them.
 
 Org-mode knows ordered and unordered lists.  Unordered list items start
 with @samp{-}, @samp{+}, or @samp{*}@footnote{When using @samp{*} as a
@@ -853,22 +924,22 @@ less.  For example:
 @example
 @group
 ** Lord of the Rings
-My favorite scenes are (in this order)
-1. Eowyns fight with the witch king
-   + this was already my favorite scene in the book
-   + I really like Miranda Otto.
-2. The attack of the Rohirrim
-3. Peter Jackson being shot by Legolas
-    - on DVD only
-   He makes a really funny face when it happens.
-But in the end, not individual scenes matter but the film as a whole.
+   My favorite scenes are (in this order)
+   1. The attack of the Rohirrim
+   2. Eowyns fight with the witch king
+      + this was already my favorite scene in the book
+      + I really like Miranda Otto.
+   3. Peter Jackson being shot by Legolas
+       - on DVD only
+      He makes a really funny face when it happens.
+   But in the end, not individual scenes matter but the film as a whole.
 @end group
 @end example
 
 Org-mode supports these lists by tuning filling and wrapping commands to
 deal with them correctly@footnote{Org-mode only changes the filling
 settings for Emacs.  For XEmacs, you should use Kyle E. Jones'
-@file{filladapt.el}.  To turn is on,  put into @file{.emacs}:
+@file{filladapt.el}.  To turn this on,  put into @file{.emacs}:
 @example
 (require 'filladapt)
 @end example
@@ -927,56 +998,6 @@ state of the checkbox.  Otherwise, if this is an ordered list, renumber
 the ordered list at the cursor.
 @end table
 
-@page
-@node Checkboxes,  , Plain lists, Document structure
-@section Checkboxes
-@cindex checkboxes
-
-Every item in a plain list (ordered and unordered) can be made a
-checkbox by starting it with the string @samp{[ ]}.  This feature is
-similar to TODO items (@pxref{TODO items}), but more lightweight.
-Checkboxes are not included into the global TODO list, so they are often
-great to split a task into a number of simple steps.  Or you can use
-them in a shopping list to select the items you need to buy.  To toggle
-a checkbox, use @kbd{C-c C-c}, or try Piotr Zielinski's
-@file{org-mouse.el}.  Here is an example of a checkbox list.
-
-@example
-* Avoid stupid mistakes when distributing a new version
-  - [ ] update also Emacs CVS
-  - [X] forget to update index.html on the website
-  - [X] leaving a `(debug)' form in the code
-@end example
-
-@noindent The following commands work with checkboxes:
-
-@table @kbd
-@kindex C-c C-c
-@item C-c C-c
-Toggle checkbox at point.
-@kindex C-c C-x C-b
-@item C-c C-x C-b
-Toggle checkbox at point.
-@itemize @minus
-@item
-If there is an active region, toggle the first checkbox in the region
-and set all remaining boxes to the same status as the first.  If you
-want to toggle all boxes in the region independently, use a prefix
-argument.
-@item
-If the cursor is in a headline, toggle checkboxes in the region between
-this headline and the next.  This does @emph{not} act on the entire
-subtree, just the current entry.
-@item
-If no active region, just toggle the checkbox at point.
-@end itemize
-@kindex M-S-@key{RET}
-@item M-S-@key{RET}
-Insert a new item with a checkbox.
-This works only if the cursor is already in a plain list item
-(@pxref{Plain lists}).
-@end table
-
 @node Tables, Hyperlinks, Document structure, Top
 @chapter Tables
 @cindex tables
@@ -1020,7 +1041,7 @@ expanded on the next re-align to span the whole table width.  So, to
 create the above table, you would only type
 
 @example
-|Name|Phone|Age
+|Name|Phone|Age|
 |-
 @end example
 
@@ -1636,6 +1657,7 @@ links to other files, Usenet articles, emails, and much more.
 * Internal links::              Links to other places in the current file
 * External links::              URL-like links to the world
 * Handling links::              Creating, inserting and following
+* Link abbreviations::          Shortcuts for writing complex links
 * Search options::              Linking to a specific location
 * Custom searches::             When the default search is not enough
 * Remember::                    Org-trees store quick notes
@@ -1676,6 +1698,7 @@ internal structure of all links, use the menu entry
 @cindex internal links
 @cindex links, internal
 @cindex CamelCase links
+@cindex targets, for links
 
 If the link does not look like a URL, it is considered to be internal in
 the current file.  Links such as @samp{[[My Target]]} or @samp{[[My
@@ -1726,6 +1749,9 @@ earlier.
 
 @node Radio targets, CamelCase links, Internal links, Internal links
 @subsection Radio targets
+@cindex radio targets
+@cindex targets, radio
+@cindex links, radio targets
 
 You can configure Org-mode to link any occurrences of certain target
 names in normal text.  So without explicitly creating a link, the text
@@ -1744,10 +1770,11 @@ loaded into Emacs.  To update the target list during editing, press
 
 Org-mode also supports CamelCase words as links.  This feature is not
 turned on by default because of the inconsistencies this system suffers
-from.  To activate CamelCase words as links, you need to customize
-the option @code{org-activate-links}.  A CamelCase word then leads to a
-text search such that @samp{CamelCaseLink} is equivalent to
-@samp{[[camel case link]]}.
+from.  It is also possible that this feature will disappear entirely in
+a future version of Org-mode.  To activate CamelCase words as links, you
+need to customize the option @code{org-activate-links}.  A CamelCase
+word then leads to a text search such that @samp{CamelCaseLink} is
+equivalent to @samp{[[camel case link]]}.
 
 @node External links, Handling links, Internal links, Hyperlinks
 @section External links
@@ -1810,8 +1837,9 @@ as links.  If spaces must be part of the link (for example in
 @samp{bbdb:Richard Stallman}), or you need to remove ambiguities about the end of
 the link, enclose them in angular brackets.
 
-@node Handling links, Search options, External links, Hyperlinks
+@node Handling links, Link abbreviations, External links, Hyperlinks
 @section Handling links
+@cindex links, handling
 
 Org-mode provides methods to create a link in the correct syntax, to
 insert it into an org-mode file, and to follow the link.
@@ -1900,7 +1928,9 @@ would.  Under Emacs 22, also @kbd{mouse-1} will follow a link.
 
 @kindex mouse-3
 @item mouse-3
-Like @kbd{mouse-2}, but force file links to be opened with Emacs.
+Like @kbd{mouse-2}, but force file links to be opened with Emacs, and
+internal links to be displayed in another window@footnote{See the
+variable @code{org-display-internal-link-with-indirect-buffer}}.
 
 @cindex mark ring
 @kindex C-c %
@@ -1917,8 +1947,57 @@ command several times in direct succession moves through a ring of
 previously recorded positions.
 @end table
 
+@node Link abbreviations, Search options, Handling links, Hyperlinks
+@section Link abbreviatons
+@cindex link abbreviations
+@cindex abbreviation, links
+
+Long URLs can be cumbersome to type, and often many similar links are
+needed in a document.  For this you can use link abbreviations.  An
+abbreviated link looks like this
+
+@example
+[[linkword::tag][description]]
+@end example
+
+@noindent
+where the tag is optional.  Such abbreviations are resolved according to
+the information in the variable @code{org-link-abbrev-alist} that
+relates the linkwords to replacement text.  Here is an example:
+
+@lisp
+@group
+(setq org-link-abbrev-alist
+  '(("bugzilla" . "http://10.1.2.9/bugzilla/show_bug.cgi?id=")
+    ("google"   . "http://www.google.com/search?q=")
+    ("ads"      . "http://adsabs.harvard.edu/cgi-bin/
+                   nph-abs_connect?author=%s&db_key=AST")))
+@end group
+@end lisp
+
+If the replacement text contains the string @samp{%s}, it will be
+replaced with the tag.  Otherwise the tag will be appended to the string
+in order to create the link.  You may also specify a function that will
+be called with the tag as the only argument to create the link.
+
+With the above setting, you could link to a specific bug with
+@code{[[bugzilla::129]]}, search the web for OrgMode with
+@code{[[google::OrgMode]]} and find out what the Org-mode author is
+doing besides Emacs hacking with @code{[[ads::Dominik,C]]}.
+
+If you need special abbreviations just for a single Org-mode buffer, you
+can define them in the file with
+
+@example
+#+LINK: bugzilla  http://10.1.2.9/bugzilla/show_bug.cgi?id=
+#+LINK: google    http://www.google.com/search?q=%s
+@end example
+
+@noindent
+In-buffer completion @pxref{Completion} can be used after @samp{[} to
+complete link abbreviations.
 
-@node Search options, Custom searches, Handling links, Hyperlinks
+@node Search options, Custom searches, Link abbreviations, Hyperlinks
 @section Search options in file links
 @cindex search option in file links
 @cindex file links, searching
@@ -1970,6 +2049,7 @@ a search for @samp{find me} in the current file, just as
 @node Custom searches, Remember, Search options, Hyperlinks
 @section Custom Searches
 @cindex custom search strings
+@cindex search strings, custom
 
 The default mechanism for creating search strings and for doing the
 actual search related to a file link may not work correctly in all
@@ -2101,6 +2181,8 @@ things you have to do.
 * TODO basics::                 Marking and displaying TODO entries
 * TODO extensions::             Workflow and assignments
 * Priorities::                  Some things are more important than others
+* Breaking down tasks::         Splitting a task into managable pieces
+* Checkboxes::                  Tick-off lists
 @end menu
 
 @node TODO basics, TODO extensions, TODO items, TODO items
@@ -2264,8 +2346,7 @@ changing one of these lines, use @kbd{C-c C-c} with the cursor still
 in the line to make the changes known to Org-mode@footnote{Org-mode
 parses these lines only when Org-mode is activated after visiting a
 file.  @kbd{C-c C-c} with the cursor in a line starting with @samp{#+}
-is simply restarting Org-mode, making sure that these changes will be
-respected.}.
+is simply restarting Org-mode for the current buffer.}.
 
 If you want to use very many keywords, for example when working with a
 large group of people, you may split the names over several lines:
@@ -2277,7 +2358,7 @@ large group of people, you may split the names over several lines:
 #+TYP_TODO: DONE
 @end example
 
-@node Priorities,  , TODO extensions, TODO items
+@node Priorities, Breaking down tasks, TODO extensions, TODO items
 @section Priorities
 @cindex priorities
 
@@ -2314,8 +2395,96 @@ are also used to modify time stamps (@pxref{Creating timestamps}).
 Furthermore, these keys are also used by CUA-mode (@pxref{Conflicts}).
 @end table
 
+@node Breaking down tasks, Checkboxes, Priorities, TODO items
+@section Breaking tasks down into subtasks
+@cindex tasks, breaking down
+
+It is often advisable to break down large tasks into smaller, managable
+subtasks.  You can do this by creating an outline tree below a TODO
+item, with detailed subtasks on the tree@footnote{To keep subtasks out
+of the global TODO list, see the
+@code{org-agenda-todo-list-sublevels}.}.  Another possibility is the use
+of checkboxes to identify (a hierarchy of) a large number of subtasks
+(@pxref{Checkboxes}).
+
+
+@node Checkboxes,  , Breaking down tasks, TODO items
+@section Checkboxes
+@cindex checkboxes
+
+Every item in a plain list (@pxref{Plain lists}) can be made a checkbox
+by starting it with the string @samp{[ ]}.  This feature is similar to
+TODO items (@pxref{TODO items}), but more lightweight.  Checkboxes are
+not included into the global TODO list, so they are often great to split
+a task into a number of simple steps.  Or you can use them in a shopping
+list.  To toggle a checkbox, use @kbd{C-c C-c}, or try Piotr Zielinski's
+@file{org-mouse.el}.  Here is an example of a checkbox list.
+
+@example
+* TODO Organize party [3/6]
+  - call people [1/3]
+    - [ ] Peter
+    - [X] Sarah
+    - [ ] Sam
+  - [X] order food
+  - [ ] think about what music to play
+  - [X] talk to the neighbors
+@end example
+
+@cindex statistics, for checkboxes
+@cindex checkbox statistics
+The @samp{[3/6]} and @samp{[1/3]} in the first and second line are
+cookies indicating how many checkboxes are present in this entry, and
+how many of them have been checked off.  This can give you an idea on
+how many checkboxes remain, even without opening a folded entry.  The
+cookies can be placed into a headline or into (the first line of) a
+plain list item. Each cookie covers all checkboxes structurally below
+that headline/item.  You have to insert the cookie yourself by typing
+either @samp{[/]} or @samp{[%]}.  In the first case you get an @samp{n
+out of m} result, in the second case you get information about the
+percentage of checkboxes checked (in the above example, this would be
+@samp{[50%]} and @samp{[33%], respectively}).
+
+@noindent The following commands work with checkboxes:
+
+@table @kbd
+@kindex C-c C-c
+@item C-c C-c
+Toggle checkbox at point.
+@kindex C-c C-x C-b
+@item C-c C-x C-b
+Toggle checkbox at point.
+@itemize @minus
+@item
+If there is an active region, toggle the first checkbox in the region
+and set all remaining boxes to the same status as the first.  If you
+want to toggle all boxes in the region independently, use a prefix
+argument.
+@item
+If the cursor is in a headline, toggle checkboxes in the region between
+this headline and the next (so @emph{not} the entire subtree).
+@item
+If there is no active region, just toggle the checkbox at point.
+@end itemize
+@kindex M-S-@key{RET}
+@item M-S-@key{RET}
+Insert a new item with a checkbox.
+This works only if the cursor is already in a plain list item
+(@pxref{Plain lists}).
+@kindex C-c #
+@item C-c #
+Update the checkbox statistics in the current outline entry.  When
+called with a @kbd{C-u} prefix, update the entire file.  Checkbox
+statistic cookies are updated automatically if you toggle checkboxes
+with @kbd{C-c C-c} and make new ones with @kbd{M-S-@key{RET}}.  If you
+delete boxes or add/change them by hand, use this command to get things
+back into synch.  Or simply toggle any checkbox twice with @kbd{C-c C-c}.
+@end table
+
 @node Timestamps, Tags, TODO items, Top
 @chapter Timestamps
+@cindex time stamps
+@cindex date stamps
 
 Items can be labeled with timestamps to make them useful for project
 planning.
@@ -2323,6 +2492,7 @@ planning.
 @menu
 * Time stamps::                 Assigning a time to a tree entry
 * Creating timestamps::         Commands which insert timestamps
+* Custom time format::          If you cannot work with the ISO format
 * Progress logging::            Documenting when what work was done.
 @end menu
 
@@ -2336,10 +2506,12 @@ planning.
 @cindex scheduling
 
 A time stamp is a specification of a date (possibly with time) in a
-special format, either @samp{<2003-09-16 Tue>} or @samp{<2003-09-16
-Tue 09:39>}.  A time stamp can appear anywhere in the headline or body
-of an org-tree entry.  Its presence allows entries to be shown on specific
-dates in the agenda (@pxref{Weekly/Daily agenda}).  We distinguish:
+special format, either @samp{<2003-09-16 Tue>} or @samp{<2003-09-16 Tue
+09:39>}@footnote{This is the standard ISO date/time format.  If you
+cannot get used to these, see @ref{Custom time format}}.  A time stamp
+can appear anywhere in the headline or body of an org-tree entry.  Its
+presence allows entries to be shown on specific dates in the agenda
+(@pxref{Weekly/Daily agenda}).  We distinguish:
 
 @table @var
 @item Plain time stamp
@@ -2350,6 +2522,21 @@ an event in a diary, when you want to take note of when something
 happened.  In the timeline and agenda displays, the headline of an entry
 associated with a plain time stamp will be shown exactly on that date.
 
+@example
+* Meet Peter at the movies <2006-11-01 Wed 19:15>
+@end example
+
+@item Inactive time stamp
+@cindex timestamp, inactive
+@cindex inactive timestamp
+Just like a plain time stamp, but with square brackets instead of
+angular ones.  These time stamps are inactive in the sense that they do
+@emph{not} trigger an entry to show up in the agenda.
+
+@example
+* Gillian comes late for the fifth time [2006-11-01 Wed]
+@end example
+
 @item Time stamp range
 @cindex timerange
 Two time stamps connected by @samp{--} denote a time range.  The
@@ -2406,7 +2593,7 @@ automatically into the file.  The time stamps are enclosed in square
 brackets instead of angular brackets.  @xref{Clocking work time}.
 @end table
 
-@node Creating timestamps, Progress logging, Time stamps, Timestamps
+@node Creating timestamps, Custom time format, Time stamps, Timestamps
 @section Creating timestamps
 @cindex creating timestamps
 @cindex timestamps, creating
@@ -2445,8 +2632,8 @@ instead.
 
 @kindex C-c C-o
 @item C-c C-o
-Access the agenda for the date given by the time stamp at point
-(@pxref{Weekly/Daily agenda}).
+Access the agenda for the date given by the time stamp or -range at
+point (@pxref{Weekly/Daily agenda}).
 
 @kindex C-c C-d
 @item C-c C-d
@@ -2480,11 +2667,11 @@ CUA-mode (@pxref{Conflicts}).
 @kindex S-@key{down}
 @item S-@key{up}
 @itemx S-@key{down}
-Change the item under the cursor in a timestamp.  The cursor can be on
-a year, month, day, hour or minute.  Note that if the cursor is not at
-a time stamp, these same keys modify the priority of an item.
-(@pxref{Priorities}). The key bindings also conflict with CUA-mode
-(@pxref{Conflicts}).
+Change the item under the cursor in a timestamp.  The cursor can be on a
+year, month, day, hour or minute.  Note that if the cursor is in a
+headline and not at a time stamp, these same keys modify the priority of
+an item.  (@pxref{Priorities}). The key bindings also conflict with
+CUA-mode (@pxref{Conflicts}).
 
 
 @kindex C-c C-y
@@ -2495,15 +2682,42 @@ end.  With prefix arg, insert result after the time range (in a table:
 into the following column).
 @end table
 
+
+@menu
+* The date/time prompt::        How org-mode helps you entering date and time
+@end menu
+
+@node The date/time prompt,  , Creating timestamps, Creating timestamps
+@subsection The date/time prompt
 @cindex date, reading in minibuffer
 @cindex time, reading in minibuffer
+
+When Org-mode prompts for a date/time, the prompt suggests to enter an
+ISO date.  But it will in fact accept any string containing some date
+and/or time information.  You can, for example, use @kbd{C-y} to paste a
+(possibly multi-line) string copied from an email message.  Org-mode
+will find whatever information is in there and will replace anything not
+specified with the current date and time.  For example:
+
+@example
+  3-2-5         --> 2003-02-05
+  feb 15        --> currentyear-02-15
+  sep 12 9      --> 2009-09-12
+  12:45         --> today 12:45
+  22 sept 0:34  --> currentyear-09-22 0:34
+  12            --> currentyear-currentmonth-12
+  Fri           --> nearest Friday (today or later)
+@end example
+
+The function understands English month and weekday abbreviations.  If
+you want to use unabbreviated names and/or other languages, configure
+the variables @code{parse-time-months} and @code{parse-time-weekdays}.
+
 @cindex calendar, for selecting date
-When Org-mode prompts for a date/time, the function reading your input
-will replace anything you choose not to specify with the current date
-and time.  For details, see the documentation string of
-@command{org-read-date}.  Also, a calender will pop up to allow
-selecting a date.  The calendar can be fully controlled from the
-minibuffer, and a date can be selected with the following commands:
+Parallel to the minibuffer prompt, a calendar is popped up@footnote{If
+you don't need/want the calendar, configure the variable
+@code{org-popup-calendar-for-date-prompt}.}.  You can control the
+calendar fully from the minibuffer:
 
 @table @kbd
 @kindex <
@@ -2535,10 +2749,53 @@ One month forward.
 One month back.
 @kindex @key{RET}
 @item @key{RET}
-Choose date in calendar (only if nothing typed into minibuffer).
+Choose date in calendar (only if nothing was typed into minibuffer).
 @end table
 
-@node Progress logging,  , Creating timestamps, Timestamps
+@node Custom time format, Progress logging, Creating timestamps, Timestamps
+@section Custom time format
+@cindex custom date/time format
+@cindex time format, custom
+@cindex date format, custom
+
+Org-mode uses the standard ISO notation for dates and times as it is
+defined in ISO 8601.  If you cannot get used to this and require another
+representation of date and time to keep you happy, you can get it by
+customizing the variables @code{org-display-custom-times} and
+@code{org-time-stamp-custom-formats}.
+
+@table @kbd
+@kindex C-c C-x C-t
+@item C-c C-x C-t
+Toggle the display of custom formats for dates and times.
+@end table
+
+@noindent
+Org-mode needs the default format for scanning, so the custom date/time
+format does not @emph{replace} the default format - instead it is put
+@emph{over} the default format using text properties.  This has the
+following consequences:
+@itemize @bullet
+@item 
+You cannot place the cursor onto a time stamp anymore, only before or
+after.
+@item
+The @kbd{S-@key{up}/@key{down}} keys can no longer be used to adjust
+each component of a time stamp.  If the cursor is at the beginning of
+the stamp, @kbd{S-@key{up}/@key{down}} will change the stamp by one day,
+just like @kbd{S-@key{left}/@key{right}}.  At the end of the stamp, the
+time will be changed by one minute.
+@item
+When you delete a time stamp character-by-character, it will only
+disappear from the buffer after @emph{all} (invisible) characters
+belonging to the ISO timestamp have been removed.
+@item
+If the custom time stamp format is longer than the default and you are
+using dates in tables, table alignment will be messed up.  If the custom
+format is shorter, things do work as expected.
+@end itemize
+
+@node Progress logging,  , Custom time format, Timestamps
 @section Progress Logging
 @cindex progress logging
 @cindex logging, of progress
@@ -2572,6 +2829,8 @@ state cycling, that line will be removed again.  In the timeline
 (@pxref{Timeline}) and in the agenda (@pxref{Weekly/Daily agenda}),
 you can then use the @kbd{l} key to display the TODO items closed on
 each day, giving you an overview of what has been done on a day.
+See the variable @code{org-log-done} for the possibility to record an
+additional note together with a timestamp.
 
 @node Clocking work time,  , Closing items, Progress logging
 @subsection Clocking work time
@@ -2592,7 +2851,8 @@ keyword together with a timestamp.
 Stop the clock (clock-out).  The inserts another timestamp at the same
 location where the clock was last started.  It also directly computes
 the resulting time in inserts it after the time range as @samp{=>
-HH:MM}.  
+HH:MM}.  See the variable @code{org-log-done} for the possibility to
+record an additional note together with the clock-out time stamp.
 @kindex C-c C-y
 @item C-c C-y
 Recompute the time interval after changing one of the time stamps.  This
@@ -2612,7 +2872,8 @@ Display time summaries for each subtree in the current buffer.  This
 puts overlays at the end of each headline, showing the total time
 recorded under that heading, including the time of any subheadings. You
 can use visibility cycling to study the tree, but the overlays disappear
-automatically when the buffer is changed.
+when you change the buffer (see variable
+@code{org-remove-highlights-with-change}) or press @kbd{C-c C-c}.
 @kindex C-c C-x C-r
 @item C-c C-x C-r
 Insert a dynamic block (@pxref{Dynamic blocks}) containing a clock
@@ -2685,6 +2946,7 @@ Tags are normal words containing letters, numbers, @samp{_}, and
 @node Tag inheritance, Setting tags, Tags, Tags
 @section Tag inheritance
 @cindex inheritance, of tags
+@cindex sublevels, inclusion into tags match
 
 @i{Tags} make use of the hierarchical structure of outline trees.  If a
 heading has a certain tag, all subheadings will inherit the tag as
@@ -2709,6 +2971,7 @@ searching using the variables @code{org-use-tag-inheritance} and
 @node Setting tags, Tag searches, Tag inheritance, Tags
 @section Setting tags
 @cindex setting tags
+@cindex tags, setting
 
 @kindex M-@key{TAB}
 Tags can simply be typed into the buffer at the end of a headline.
@@ -2732,18 +2995,26 @@ Org will support tag insertion based on a @emph{list of tags}.  By
 default this list is constructed dynamically, containing all tags
 currently used in the buffer.  You may also globally specify a hard list
 of tags with the variable @code{org-tag-alist}.  Finally you can set
-the allowed tags for a given file with lines like
+the default tags for a given file with lines like
 
 @example
 #+TAGS: @@WORK @@HOME @@TENNISCLUB
 #+TAGS: Laptop Car PC Sailboat
 @end example
 
-The default support method is minibuffer completion.  However, Org-mode
-also implements a much better method: @emph{fast tag selection}.  This
-method allows to select and deselect tags with a single key per tag.  To
-function efficiently, you should assign unique keys to all tags.  This
-can be done globally with
+If you have globally defined your preferred set of tags using the
+variable @code{org-tag-alist}, but would like to use a dynamic tag list
+in a specific file: Just add an empty TAGS option line to that file:
+
+@example
+#+TAGS:
+@end example
+
+The default support method for entering tags is minibuffer completion.
+However, Org-mode also implements a much better method: @emph{fast tag
+selection}.  This method allows to select and deselect tags with a
+single key per tag.  To function efficiently, you should assign unique
+keys to most tags.  This can be done globally with
 
 @lisp
 (setq org-tag-alist '(("@@WORK" . ?w) ("@@HOME" . ?h) ("Laptop" . ?l)))
@@ -2774,32 +3045,57 @@ these lines to activate any changes.
 If at least one tag has a selection key, pressing @kbd{C-c C-c} will
 automatically present you with a special interface, listing inherited
 tags, the tags of the current headline, and a list of all legal tags
-with corresponding keys@footnote{Keys will automatically assigned to
-tags which have no configured keys.}.  Pressing keys for the tags will
-add or remove them from the list of tags in the current line.  Selecting
-a tag in a group of mutually exclusive tags will turn off any other tags
-from that group.  @key{SPC} clears all tags for this line, @kbd{RET}
-accepts the modified set, and @kbd{C-g} aborts without installing
-changes.  This method lets you assign tags to a headline with very few
-keys.  With the above setup, you could clear the current tags and set
-@samp{@@HOME}, @samp{Laptop} and @samp{PC} tags with just the following
-keys: @kbd{C-c C-c @key{SPC} h l p @key{RET}}.  Switching from
-@samp{@@HOME} to @samp{@@WORK} would be done with @kbd{C-c C-c w
-@key{RET}}.
-
-What if you have globally defined your preferred set of tags using the
-variable @code{org-tag-alist}, but would like to use a dynamic tag list
-in a specific file?  Just add an empty TAGS option line to that file:
-
-@example
-#+TAGS:
-@end example
+with corresponding keys@footnote{Keys will automatically be assigned to
+tags which have no configured keys.}.  In this interface, you can use
+the following keys:
 
+@table @kbd
+@item a-z...
+Pressing keys assigned to tags will add or remove them from the list of
+tags in the current line.  Selecting a tag in a group of mutually
+exclusive tags will turn off any other tags from that group.
+@kindex @key{TAB}
+@item @key{TAB}
+Enter a tag in the minibuffer, even if the tag is not in the predefined
+list.  You will be able to complete on all tags present in the buffer.
+@kindex @key{SPC}
+@item @key{SPC}
+Clear all tags for this line.
+@kindex @key{RET}
+@item @key{RET}
+Accept the modified set.
+@item C-g
+Abort without installing changes.
+@item q
+If @kbd{q} is not assigned to a tag, it aborts like @kbd{C-g}.
+@item !
+Turn off groups of mutually exclusive tags.  Use this to (as an
+exception) assign several tags from such a group.
+@item C-c
+Toggle auto-exit after the next change (see below).
+@end table
 
+@noindent
+This method lets you assign tags to a headline with very few keys.  With
+the above setup, you could clear the current tags and set @samp{@@HOME},
+@samp{Laptop} and @samp{PC} tags with just the following keys: @kbd{C-c
+C-c @key{SPC} h l p @key{RET}}.  Switching from @samp{@@HOME} to
+@samp{@@WORK} would be done with @kbd{C-c C-c w @key{RET}} or
+alternatively with @kbd{C-c C-c C-c w}.  Adding the non-predefined tag
+@samp{Sarah} could be done with @kbd{C-c C-c @key{TAB} S a r a h
+@key{RET} @key{RET}}.
+
+If you find that most of the time, you need only a single keypress to
+modify your list of tags, set the variable
+@code{org-fast-tag-selection-single-key}.  Then you no longer have to
+press @key{RET} to exit fast tag selection - it will immediately exit
+after the first change.  If you then occasionally need more keys, press
+@kbd{C-c} to turn off auto-exit for the current tag selection process.
 
 @node Tag searches,  , Setting tags, Tags
 @section Tag searches
 @cindex tag searches
+@cindex searching for tags
 
 Once a tags system has been set up, it can be used to collect related
 information into special lists.
@@ -2819,17 +3115,45 @@ only TODO items and force checking subitems (see variable
 @code{org-tags-match-list-sublevels}).
 @end table
 
+@cindex Boolean logic, for tag searches
 A @i{tags} search string can use Boolean operators @samp{&} for AND and
 @samp{|} for OR.  @samp{&} binds more strongly than @samp{|}.
 Parenthesis are currently not implemented.  A tag may also be preceded
 by @samp{-}, to select against it, and @samp{+} is syntactic sugar for
 positive selection.  The AND operator @samp{&} is optional when @samp{+}
-or @samp{-} is present.  For example, @samp{+WORK-BOSS} would select all
-headlines that are tagged @samp{:WORK:}, but discard those also tagged
-@samp{:BOSS:}.  The search string @samp{WORK|LAPTOP} selects all lines
-tagged @samp{:WORK:} or @samp{:LAPTOP:}.  The string
-@samp{WORK|LAPTOP&NIGHT} requires that the @samp{:LAPTOP:} lines are
-also tagged @samp{NIGHT}.
+or @samp{-} is present.  Examples:
+
+@table @samp
+@item +WORK-BOSS
+Select all headlines that are tagged @samp{:WORK:}, but discard those also tagged
+@samp{:BOSS:}.
+@item WORK|LAPTOP
+Selects lines tagged @samp{:WORK:} or @samp{:LAPTOP:}.
+@item WORK|LAPTOP&NIGHT
+Like the previous example, but require  the @samp{:LAPTOP:} lines to be
+tagged also @samp{NIGHT}.
+@end table
+
+@cindex TODO keyword matching, with tags search
+If you are using multi-state TODO keywords (@pxref{TODO extensions}), it
+can be useful to also match on the TODO keyword.  This can be done by
+adding a condition after a slash to a tags match.  The syntax is similar
+to the tag matches, but should be applied with consideration: For
+example, a positive selection on several TODO keywords can not
+meaningfully be combined with boolean AND.  However, @emph{negative
+selection} combined with AND can be meaningful.  Examples:
+
+@table @samp
+@item WORK/WAITING
+Select @samp{:WORK:}-tagged TODO lines with the specific TODO
+keyword @samp{WAITING}.
+@item WORK/-WAITING-NEXT
+Select @samp{:WORK:}-tagged TODO lines that are neither @samp{WAITING}
+nor @samp{NEXT}
+@item WORK/+WAITING|+NEXT
+Select @samp{:WORK:}-tagged TODO lines that are either @samp{WAITING} or
+@samp{NEXT}.
+@end table
 
 @node Agenda views, Embedded LaTeX, Tags, Top
 @chapter Agenda Views
@@ -2842,7 +3166,7 @@ are important for a particular date, this information must be collected,
 sorted and displayed in an organized way.
 
 Org-mode can select items based on various criteria, and display them
-in a separate buffer.  Three different views are provided:
+in a separate buffer.  Five different view types are provided:
 
 @itemize @bullet
 @item
@@ -2850,17 +3174,28 @@ an @emph{agenda} that is like a calendar and shows information
 for specific dates
 @item
 a @emph{TODO list} that covers all unfinished
-action items, and
+action items,
 @item
 a @emph{tags view} that shows information based on
-the tags associated with headlines in the outline tree.
+the tags associated with headlines in the outline tree,
+@item
+a @emph{timeline view} that shows all events in a single Org-mode file,
+in time-sorted view
+@item
+@emph{custom views} that are special tag and keyword searches and
+combinations of different views.
 @end itemize
 
 @noindent
 The extracted information is displayed in a special @emph{agenda
 buffer}.  This buffer is read-only, but provides commands to visit the
 corresponding locations in the original Org-mode files, and even to
-edit these files remotely.
+edit these files remotely.  
+
+Two variables control how the agenda buffer is displayed and whether the
+window configuration is restored when the agenda exits:
+@code{org-agenda-window-setup} and
+@code{org-agenda-restore-windows-after-quit}.
 
 @menu
 * Agenda files::                Files being searched for agenda information
@@ -2869,18 +3204,22 @@ edit these files remotely.
 * Global TODO list::            All unfinished action items
 * Matching headline tags::      Structured information with fine-tuned search
 * Timeline::                    Time-sorted view for single file
+* Presentation and sorting::    How agenda items are prepared for display
 * Agenda commands::             Remote editing of org trees
+* Custom agenda views::         Defining special searches and views
 @end menu
 
 @node Agenda files, Agenda dispatcher, Agenda views, Agenda views
 @section Agenda files
+@cindex agenda files
+@cindex files for agenda
 
 The information to be shown is collected from all @emph{agenda files},
 the files listed in the variable @code{org-agenda-files}@footnote{If the
 value of that variable is not a list, but a single file name, then the
 list of agenda files will be maintained in that external file.}.  Thus even
 if you only work with a single Org-mode file, this file should be put
-into that list@footnote{When using the dispatcher pressing @kbd{1}
+into that list@footnote{When using the dispatcher, pressing @kbd{1}
 before selecting a command will actually limit the command to the
 current file, and ignore @code{org-agenda-files} until the next
 dispatcher command.}.  You can customize @code{org-agenda-files}, but
@@ -2909,8 +3248,6 @@ to visit any of them.
 @section The agenda dispatcher
 @cindex agenda dispatcher
 @cindex dispatching agenda commands
-@cindex custom agenda commands
-@cindex agenda commands, custom
 The views are created through a dispatcher that should be bound to a
 global key, for example @kbd{C-c a} (@pxref{Installation}).  In the
 following we will assume that @kbd{C-c a} is indeed how the dispatcher
@@ -2925,44 +3262,32 @@ Create a list of all TODO items (@pxref{Global TODO list}).
 @item m / M
 Create a list of headlines matching a TAGS expression (@pxref{Matching
 headline tags}).
+@item L
+Create the timeline view for the current buffer (@pxref{Timeline}).
+@item 1
+Restrict an agenda command to the current buffer.  After pressing
+@kbd{1}, you still need to press the character selecting the command.
+@item 0
+If there is an active region, restrict the following agenda command to
+the region.  Otherwise, restrict it to the current subtree.  After
+pressing @kbd{0}, you still need to press the character selecting the
+command.
 @end table
 
-You can also define custom commands that will be accessible through
-the dispatcher, just like the default commands.  Custom commands are
-global searches for tags and specific TODO keywords, or a variety of
-sparse tree creating commands (@pxref{Sparse trees}).  As sparse trees
-are only defined for a single org-mode file, these latter commands act
-on the current buffer instead of the list of agenda files.
-
-@kindex C-c a C
-Custom commands are configured in the variable
-@code{org-agenda-custom-commands}.  You can customize this variable,
-for example by pressing @kbd{C-c a C}.  You can also directly set it
-with Emacs Lisp in @file{.emacs}.  For example:
-
-@lisp
-(setq org-agenda-custom-commands
-      '(("w" todo "WAITING")
-        ("u" tags "+BOSS-URGENT")
-        ("U" tags-tree "+BOSS-URGENT")
-        ("f" occur-tree "\\<FIXME\\>")))
-@end lisp
-
-@noindent will define @kbd{C-c a w} as a global search for
-TODO entries with @samp{WAITING} as the TODO keyword, @kbd{C-c a u} as a
-global tags search for headlines marked @samp{:BOSS:} but not
-@samp{:URGENT:}, @kbd{C-c a U} to do the same search but only in the
-current buffer and display the result as a sparse tree, and @kbd{C-c a
-f} to create a sparse tree with all entries containing the word
-@samp{FIXME}.  For more information, look at the documentation string
-of the variable @code{org-agenda-custom-commands}.
+You can also define custom commands that will be accessible through the
+dispatcher, just like the default commands.  This includes the
+possibility to create extended agenda buffers that contain several
+blocks together, for example the weekly agenda, the global TODO list and
+a number of special tags matches.  @xref{Custom agenda views}.
 
 @node Weekly/Daily agenda, Global TODO list, Agenda dispatcher, Agenda views
 @section The weekly/daily agenda
 @cindex agenda
+@cindex weekly agenda
+@cindex daily agenda
 
-The purpose of the weekly/daily @emph{agenda} is to act like a page of
-paper agenda, showing all the tasks for the current week or day.
+The purpose of the weekly/daily @emph{agenda} is to act like a page of a
+paper agenda, showing all the tasks for the current week or day.
 
 @table @kbd
 @cindex org-agenda, command
@@ -2981,78 +3306,11 @@ The commands available in the Agenda buffer are listed in @ref{Agenda
 commands}.
 
 @menu
-* Categories::                  Not all tasks are equal
-* Time-of-day specifications::  How the agenda knows the time
 * Calendar/Diary integration::  Integrating Anniversaries and more
-* Sorting of agenda items::     The order of things
 @end menu
 
-@node Categories, Time-of-day specifications, Weekly/Daily agenda, Weekly/Daily agenda
-@subsection Categories
-
-@cindex category
-In the agenda buffer, each entry is preceded by a @emph{category},
-which is derived from the file name.  The category can also be set
-with a special line anywhere in the buffer, looking like this:
-
-@example
-#+CATEGORY: Thesis
-@end example
-
-If there are several such lines in a file, each specifies the category
-for the text below it (but the first category also applies to any text
-before the first CATEGORY line).  The display in the agenda buffer looks
-best if the category is not longer than 10 characters.
-
-@node Time-of-day specifications, Calendar/Diary integration, Categories, Weekly/Daily agenda
-@subsection Time-of-Day Specifications
-
-Org-mode checks each agenda item for a time-of-day specification.  The
-time can be part of the time stamp that triggered inclusion into the
-agenda, for example as in @w{@samp{<2005-05-10 Tue 19:00>}}.  Time
-ranges can be specified with two time stamps, like
-@c
-@w{@samp{<2005-05-10 Tue 20:30>--<2005-05-10 Tue 22:15>}}.
-
-In the headline of the entry itself, a time(range) may also appear as
-plain text (like @samp{12:45} or a @samp{8:30-1pm}.  If the agenda
-integrates the Emacs diary (@pxref{Calendar/Diary integration}), time
-specifications in diary entries are recognized as well.
-
-For agenda display, Org-mode extracts the time and displays it in a
-standard 24 hour format as part of the prefix.  The example times in
-the previous paragraphs would end up in the agenda like this:
-
-@example
-    8:30-13:00 Arthur Dent lies in front of the bulldozer
-   12:45...... Ford Prefect arrives and takes Arthur to the pub
-   19:00...... The Vogon reads his poem
-   20:30-22:15 Marwin escorts the Hitchhikers to the bridge
-@end example
-
-If the agenda is in single-day mode, or for the display of today, the
-timed entries are embedded in a time grid, like
 
-@example
-    8:00...... ------------------
-    8:30-13:00 Arthur Dent lies in front of the bulldozer
-   10:00...... ------------------
-   12:00...... ------------------
-   12:45...... Ford Prefect arrives and takes Arthur to the pub
-   14:00...... ------------------
-   16:00...... ------------------
-   18:00...... ------------------
-   19:00...... The Vogon reads his poem
-   20:00...... ------------------
-   20:30-22:15 Marwin escorts the Hitchhikers to the bridge
-@end example
-
-The time grid can be turned on and off with the variable
-@code{org-agenda-use-time-grid}, and can be configured with
-@code{org-agenda-time-grid}.
-
-
-@node Calendar/Diary integration, Sorting of agenda items, Time-of-day specifications, Weekly/Daily agenda
+@node Calendar/Diary integration,  , Weekly/Daily agenda, Weekly/Daily agenda
 @subsection Calendar/Diary integration
 @cindex calendar integration
 @cindex diary integration
@@ -3083,24 +3341,6 @@ Sunrise/Sunset times, show lunar phases and to convert to other
 calendars, respectively.  @kbd{c} can be used to switch back and forth
 between calendar and agenda.
 
-@node Sorting of agenda items,  , Calendar/Diary integration, Weekly/Daily agenda
-@subsection Sorting of agenda items
-@cindex sorting, of agenda items
-@cindex priorities, of agenda items
-The entries for each day are sorted.  The default order is to first
-collect all items containing an explicit time-of-day specification.
-These entries will be shown at the beginning of the list, as a
-@emph{schedule} for the day.  After that, items remain grouped in
-categories, in the sequence given by @code{org-agenda-files}.  Within
-each category, items are sorted by priority (@pxref{Priorities}).
-
-The priority is a numerical quantity composed of the base priority
-(2000 for priority @samp{A}, 1000 for @samp{B}, and 0 for @samp{C}),
-plus additional increments for overdue scheduled or deadline items.
-
-Sorting can be customized using the variable
-@code{org-agenda-sorting-strategy}.
-
 
 @node Global TODO list, Matching headline tags, Weekly/Daily agenda, Agenda views
 @section The global TODO list
@@ -3119,6 +3359,7 @@ agenda files (@pxref{Agenda views}) into a single buffer.  The buffer is in
 the TODO entries directly from that buffer (@pxref{Agenda commands}).
 @kindex C-c a T
 @item C-c a T
+@cindex TODO keyword matching
 Like the above, but allows selection of a specific TODO keyword.  You can
 also do this by specifying a prefix argument to @kbd{C-c a t}.  With a
 @kbd{C-u} prefix you are prompted for a keyword.  With a numeric
@@ -3127,14 +3368,17 @@ prefix, the Nth keyword in @code{org-todo-keywords} is selected.
 The @kbd{r} key in the agenda buffer regenerates it, and you can give
 a prefix argument to this command to change the selected TODO keyword,
 for example @kbd{3 r}.  If you often need a search for a specific
-keyword, define a custom command for it (@pxref{Agenda dispatcher}).
+keyword, define a custom command for it (@pxref{Agenda dispatcher}).@*
+Matching specific TODO keywords can also be done as part of a tags
+search (@pxref{Tag searches}).
 @end table
 
 Remote editing of TODO items means that you can change the state of a
 TODO entry with a single key press.  The commands available in the
 TODO list are described in @ref{Agenda commands}.
 
-Nomally the global todo list simply shows all headlines with TODO
+@cindex sublevels, inclusion into todo list
+Normally the global todo list simply shows all headlines with TODO
 keywords.  This list can become very long.  There are two ways to keep
 it more compact:
 @itemize @minus
@@ -3150,7 +3394,6 @@ and omit the sublevels from the global list.  Configure the variable
 @code{org-agenda-todo-list-sublevels} to get this behavior.
 @end itemize
 
-
 @node Matching headline tags, Timeline, Global TODO list, Agenda views
 @section Matching headline tags
 @cindex matching, of tags
@@ -3172,29 +3415,25 @@ define a custom command for it (@pxref{Agenda dispatcher}).
 @item C-c a M
 Like @kbd{C-c a m}, but only select headlines that are also TODO items
 and force checking subitems (see variable
-@code{org-tags-match-list-sublevels}.
+@code{org-tags-match-list-sublevels}).  Matching specific todo keywords
+together with a tags match is also possible, see @ref{Tag searches}.
 @end table
 
 The commands available in the tags list are described in @ref{Agenda
 commands}.
 
-@node Timeline, Agenda commands, Matching headline tags, Agenda views
+@node Timeline, Presentation and sorting, Matching headline tags, Agenda views
 @section Timeline for a single file
-@cindex single file summary
-@cindex agenda, for single file
 @cindex timeline, single file
 @cindex time-sorted view
 
-The timeline is not really an agenda view, because it only summarizes
-items from a single Org-mode file.  But it also uses the agenda buffer
-and provides similar commands, so we discuss it here.  The timeline
-shows all time-stamped items in a single Org-mode file (or the
-selected part of it), in a @emph{time-sorted view}.  The main purpose of
-this command is to give an overview over events in a project.
+The timeline summarizes all time-stamped items from a single Org-mode
+file in a @emph{time-sorted view}.  The main purpose of this command is
+to give an overview over events in a project.
 
 @table @kbd
-@kindex C-c C-r
-@item C-c C-r
+@kindex C-a a L
+@item C-c a L
 Show a time-sorted view of the org file, with all time-stamped items.
 When called with a @kbd{C-u} prefix, all unfinished TODO entries
 (scheduled or not) are also listed under the current date.
@@ -3204,7 +3443,122 @@ When called with a @kbd{C-u} prefix, all unfinished TODO entries
 The commands available in the timeline buffer are listed in
 @ref{Agenda commands}.
 
-@node Agenda commands,  , Timeline, Agenda views
+
+@node Presentation and sorting, Agenda commands, Timeline, Agenda views
+@section Presentation and sorting
+@cindex presentation, of agenda items
+
+Before displaying items in an agenda view, Org-mode visually prepares
+the items and sorts them.  Each item occupies a single line.  The line
+starts with a @emph{prefix} that contains the @emph{category}
+(@pxref{Categories}) of the item and other important information.  You can
+customize the prefix using the option @code{org-agenda-prefix-format}.
+The prefix is followed by a cleaned-up version of the outline headline
+associated with the item.
+
+@menu
+* Categories::                  Not all tasks are equal
+* Time-of-day specifications::  How the agenda knows the time
+* Sorting of agenda items::     The order of things
+@end menu
+
+@node Categories, Time-of-day specifications, Presentation and sorting, Presentation and sorting
+@subsection Categories
+
+@cindex category
+The category is a broad label assigned to each agenda item.  By default,
+the category is simply derived from the file name, but you can also
+specify it with a special line in the buffer, like this:
+
+@example
+#+CATEGORY: Thesis
+@end example
+
+If there are several such lines in a file, each specifies the category
+for the text below it (but the first category also applies to any text
+before the first CATEGORY line).  The display in the agenda buffer looks
+best if the category is not longer than 10 characters.
+
+@node Time-of-day specifications, Sorting of agenda items, Categories, Presentation and sorting
+@subsection Time-of-Day Specifications
+@cindex time-of-day specification
+
+Org-mode checks each agenda item for a time-of-day specification.  The
+time can be part of the time stamp that triggered inclusion into the
+agenda, for example as in @w{@samp{<2005-05-10 Tue 19:00>}}.  Time
+ranges can be specified with two time stamps, like
+@c
+@w{@samp{<2005-05-10 Tue 20:30>--<2005-05-10 Tue 22:15>}}.
+
+In the headline of the entry itself, a time(range) may also appear as
+plain text (like @samp{12:45} or a @samp{8:30-1pm}.  If the agenda
+integrates the Emacs diary (@pxref{Calendar/Diary integration}), time
+specifications in diary entries are recognized as well.
+
+For agenda display, Org-mode extracts the time and displays it in a
+standard 24 hour format as part of the prefix.  The example times in
+the previous paragraphs would end up in the agenda like this:
+
+@example
+    8:30-13:00 Arthur Dent lies in front of the bulldozer
+   12:45...... Ford Prefect arrives and takes Arthur to the pub
+   19:00...... The Vogon reads his poem
+   20:30-22:15 Marwin escorts the Hitchhikers to the bridge
+@end example
+
+@cindex time grid
+If the agenda is in single-day mode, or for the display of today, the
+timed entries are embedded in a time grid, like
+
+@example
+    8:00...... ------------------
+    8:30-13:00 Arthur Dent lies in front of the bulldozer
+   10:00...... ------------------
+   12:00...... ------------------
+   12:45...... Ford Prefect arrives and takes Arthur to the pub
+   14:00...... ------------------
+   16:00...... ------------------
+   18:00...... ------------------
+   19:00...... The Vogon reads his poem
+   20:00...... ------------------
+   20:30-22:15 Marwin escorts the Hitchhikers to the bridge
+@end example
+
+The time grid can be turned on and off with the variable
+@code{org-agenda-use-time-grid}, and can be configured with
+@code{org-agenda-time-grid}.
+
+@node Sorting of agenda items,  , Time-of-day specifications, Presentation and sorting
+@subsection Sorting of agenda items
+@cindex sorting, of agenda items
+@cindex priorities, of agenda items
+Before being inserted into a view, the items are sorted.  How this is
+done depends on the type of view.
+@itemize @bullet
+@item
+For the daily/weekly agenda, the items for each day are sorted.  The
+default order is to first collect all items containing an explicit
+time-of-day specification.  These entries will be shown at the beginning
+of the list, as a @emph{schedule} for the day.  After that, items remain
+grouped in categories, in the sequence given by @code{org-agenda-files}.
+Within each category, items are sorted by priority (@pxref{Priorities}),
+which is composed of the base priority (2000 for priority @samp{A}, 1000
+for @samp{B}, and 0 for @samp{C}), plus additional increments for
+overdue scheduled or deadline items.
+@item 
+For the TODO list, items remain in the order of categories, but within
+each category, sorting takes place according to priority
+(@pxref{Priorities}).
+@item
+For tags matches, items are not sorted at all, but just appear in the
+sequence in which they are found in the agenda files.
+@end itemize
+
+Sorting can be customized using the variable
+@code{org-agenda-sorting-strategy}.
+
+
+@node Agenda commands, Custom agenda views, Presentation and sorting, Agenda views
 @section Commands in the agenda buffer
 @cindex commands, in agenda buffer
 
@@ -3220,6 +3574,7 @@ the other commands, the cursor needs to be in the desired line.
 
 @table @kbd
 @tsubheading{Motion}
+@cindex motion commands in agenda
 @kindex n
 @item n
 Next line (same as @key{up}).
@@ -3265,6 +3620,7 @@ logging was on (variable @code{org-log-done}) are shown in the agenda,
 as are entries that have been clocked on that day.
 
 @tsubheading{Change display}
+@cindex display changing, in agenda
 @kindex o
 @item o
 Delete other windows.
@@ -3313,6 +3669,7 @@ Display the previous dates.
 Goto today.
 
 @tsubheading{Remote editing}
+@cindex remote editing, from agenda
 
 @item 0-9
 Digit argument.
@@ -3322,6 +3679,13 @@ Digit argument.
 Change the TODO state of the item, both in the agenda and in the
 original org file.
 
+@kindex C-k
+@item C-k
+Delete the current agenda item along with the entire subtree belonging
+to it in the original Org-mode file.  If the text to be deleted remotely
+is longer than one line, the kill needs to be confirmed by the user.  See
+variable @code{org-agenda-confirm-kill}.
+
 @kindex T
 @item T
 Show all tags associated with the current item.  Because of
@@ -3399,6 +3763,7 @@ Stop the previously started clock.
 Cancel the currently running clock.
 
 @tsubheading{Calendar commands}
+@cindex calendar commands, from agenda
 @kindex c
 @item c
 Open the Emacs calendar and move to the date at the agenda cursor.
@@ -3452,6 +3817,207 @@ visit org files will not be removed.
 
 @end table
 
+
+@node Custom agenda views,  , Agenda commands, Agenda views
+@section Custom agenda views
+@cindex custom agenda views
+@cindex agenda views, custom
+
+Custom agenda commands serve two purposes: to store and quickly access
+frequently used TODO and tags searches, and to create special composite
+agenda buffers.  Custom agenda commands will be accessible through the
+dispatcher (@pxref{Agenda dispatcher}), just like the default commands.
+
+@menu
+* Storing searches::            Type once, use often
+* Block agenda::                All the stuff you need in a single buffer
+* Setting Options::             Changing the rules
+* Batch processing::            Agenda views from the command line
+@end menu
+
+@node Storing searches, Block agenda, Custom agenda views, Custom agenda views
+@subsection Storing searches
+
+The first application of custom searches is the definition of keyboard
+shortcuts for frequently used searches, either creating an agenda
+buffer, or a sparse tree (the latter covering of course only the current
+buffer).
+@kindex C-c a C
+Custom commands are configured in the variable
+@code{org-agenda-custom-commands}.  You can customize this variable, for
+example by pressing @kbd{C-c a C}.  You can also directly set it with
+Emacs Lisp in @file{.emacs}.  The following example contains all valid
+search types:
+
+@lisp
+@group
+(setq org-agenda-custom-commands
+      '(("w" todo "WAITING")
+        ("W" todo-tree "WAITING")
+        ("u" tags "+BOSS-URGENT")
+        ("v" tags-todo "+BOSS-URGENT")
+        ("U" tags-tree "+BOSS-URGENT")
+        ("f" occur-tree "\\<FIXME\\>")))
+@end group
+@end lisp
+
+@noindent
+The initial single-character string in each entry defines the character
+you have to press after the dispatcher command @kbd{C-c a} in order to
+access the command.   The second parameter is the search type, followed
+by the string or regular expression to be used for the matching.  The
+example above will therefore define:
+
+@table @kbd
+@item C-c a w
+as a global search for TODO entries with @samp{WAITING} as the TODO
+keyword
+@item C-c a W
+as the same search, but only in the current buffer and displaying the
+results as a sparse tree
+@item C-c a u
+as a global tags search for headlines marked @samp{:BOSS:} but not
+@samp{:URGENT:}
+@item C-c a v
+as the same search as @kbd{C-c a u}, but limiting the search to
+headlines that are also TODO items
+@item C-c a U
+as the same search as @kbd{C-c a u}, but only in the current buffer and
+displaying the result as a sparse tree
+@item C-c a f
+to create a sparse tree (again: current buffer only) with all entries
+containing the word @samp{FIXME}.
+@end table
+
+@node Block agenda, Setting Options, Storing searches, Custom agenda views
+@subsection Block agenda
+@cindex block agenda
+@cindex agenda, with block views
+
+Another possibility is the construction of agenda views that comprise
+the results of @emph{several} commands, each of which creates a block in
+the agenda buffer.  The available commands include @code{agenda} for the
+daily or weekly agenda (as created with @kbd{C-c a a}), @code{alltodo}
+for the global todo list (as constructed with @kbd{C-c a t}), and the
+matching commands discussed above: @code{todo}, @code{tags}, and
+@code{tags-todo}.  Here are two examples:
+
+@lisp
+@group
+(setq org-agenda-custom-commands
+      '(("h" "Agenda and Home-related tasks"
+         ((agenda)
+          (tags-todo "HOME")
+          (tags "GARDEN")))
+        ("o" "Agenda and Office-related tasks"
+         ((agenda)
+          (tags-todo "WORK")
+          (tags "OFFICE")))))
+@end group
+@end lisp
+
+@noindent
+This will define @kbd{C-c a h} to create a multi-block view for stuff
+you need to attend to at home.  The resulting agenda buffer will contain
+your agenda for the current week, all TODO items that carry the tag
+@samp{HOME}, and also all lines tagged with @samp{GARDEN}.  Finally the
+command @kbd{C-c a o} provides a similar view for office tasks.
+
+
+@node Setting Options, Batch processing, Block agenda, Custom agenda views
+@subsection Setting Options for custom commands
+@cindex options, for custom agenda views
+
+Org-mode contains a number of variables regulating agenda construction
+and display.  The global variables define the behavior for all agenda
+commands, including the custom commands.  However, if you want to change
+some settings just for a single custom view, you can do so.  Setting
+options requires inserting a list of variable names and values at the
+right spot in @code{org-agenda-custom-commands}.  For example:
+
+@lisp
+@group
+(setq org-agenda-custom-commands
+      '(("w" todo "WAITING"
+         ((org-agenda-sorting-strategy '(priority-down))
+          (org-agenda-prefix-format "  Mixed: ")))
+        ("U" tags-tree "+BOSS-URGENT"
+         ((org-show-following-heading nil)
+          (org-show-hierarchy-above nil)))))
+@end group
+@end lisp
+
+@noindent
+Now the @kbd{C-c a w} command will sort the collected entries only by
+priority, and the prefix format is modified to just say @samp{  Mixed:}
+instead of giving the category of the entry.  The sparse tags tree of
+@kbd{C-c a U} will now turn out ultra-compact, because neither the
+headline hierarchy above the match, nor the headline following the match
+will be shown.
+
+For command sets creating a block agenda,
+@code{org-agenda-custom-commands} has two separate spots for setting
+options.  You can add options that should be valid for just a single
+command in the set, and options that should be valid for all commands in
+the set.  The former are just added to the command entry, the latter
+must come after the list of command entries.  Going back to the block
+agenda example (@pxref{Block agenda}), let's change the sorting strategy
+for the @kbd{C-c a h} commands to @code{priority-down}, but let's sort
+the results for GARDEN tags query in the opposite order,
+@code{priority-up}.  This would look like this:
+
+@lisp
+@group
+(setq org-agenda-custom-commands
+      '(("h" "Agenda and Home-related tasks"
+         ((agenda)
+          (tags-todo "HOME")
+          (tags "GARDEN" ((org-agenda-sorting-strategy '(priority-up)))))
+         ((org-agenda-sorting-strategy '(priority-down))))
+        ("o" "Agenda and Office-related tasks"
+         ((agenda)
+          (tags-todo "WORK")
+          (tags "OFFICE")))))
+@end group
+@end lisp
+
+As you see, the values and parenthesis setting is a little complex.
+When in doubt, use the customize interface to set this variable - it
+fully supports its structure.  Just one caveat: When setting options in
+this interface, the @emph{values} are just lisp expressions.  So if the
+value is a string, you need to add the double quotes around the value
+yourself.
+
+@node Batch processing,  , Setting Options, Custom agenda views
+@subsection Creating agenda views in batch processing
+@cindex agenda, batch production
+
+If you want to print or otherwise reprocess agenda views, it can be
+useful to create an agenda from the command line.  This is the purpose
+of the function @code{org-batch-agenda}.  It takes as a parameter one of
+the strings that are the keys in @code{org-agenda-custom-commands}.  For
+example, to directly print the current TODO list, you could use
+
+@example
+emacs -batch -l ~/.emacs -eval '(org-batch-agenda "t")' | lpr
+@end example
+
+@noindent
+You may also modify parameters on the fly like this:
+
+@example
+emacs -batch -l ~/.emacs                                      \
+   -eval '(org-batch-agenda "a"                               \
+            org-agenda-ndays 300                              \
+            org-agenda-include-diary nil                      \
+            org-agenda-files (quote ("~/org/project.org")))'  \
+   | lpr
+@end example
+
+@noindent
+which will produce a 300 day agenda, fully restricted to the Org file
+@file{~/org/projects.org}, not even including the diary.
+
 @node Embedded LaTeX, Exporting, Agenda views, Top
 @chapter Embedded LaTeX
 @cindex @TeX{} interpretation
@@ -3482,6 +4048,8 @@ to do with it.
 
 @node Math symbols, Subscripts and Superscripts, Embedded LaTeX, Embedded LaTeX
 @section Math symbols
+@cindex math symbols
+@cindex TeX macros
 
 You can use La@TeX{} macros to insert special symbols like @samp{\alpha}
 to indicate the Greek letter, or @samp{\to} to indicate an arrow.
@@ -3500,6 +4068,8 @@ into the proper syntax for HTML, for the above examples this is
 
 @node Subscripts and Superscripts, LaTeX fragments, Math symbols, Embedded LaTeX
 @section Subscripts and Superscripts
+@cindex subscript
+@cindex superscript
 
 Just like in La@TeX{}, @samp{^} and @samp{_} are used to indicate super-
 and subscripts.  Again, these can be used without embedding them in
@@ -3520,9 +4090,14 @@ are surrounded with @code{<sub>} and @code{<sup>} tags, respectively.
 
 @node LaTeX fragments, Processing LaTeX fragments, Subscripts and Superscripts, Embedded LaTeX
 @section LaTeX fragments
+@cindex LaTeX fragments
 
 With symbols, sub- and superscripts, HTML is pretty much at its end when
-it comes to representing mathematical formulas.  More complex
+it comes to representing mathematical formulas@footnote{Yes, there is
+MathML, but that is not yet fully supported by many browsers, and there
+is no decent converter for turning LaTeX of ASCII representations of
+formulas into MathML.  So for the time being, converting formulas into
+images seems the way to go.}.  More complex
 expressions need a dedicated formula processor.  To this end, Org-mode
 can contain arbitrary La@TeX{} fragments.  It provides commands to
 preview the typeset result of these fragments, and upon export to HTML,
@@ -3566,6 +4141,7 @@ ones you do not wish to have interpreted by the La@TeX{} converter.
 
 @node Processing LaTeX fragments, CDLaTeX mode, LaTeX fragments, Embedded LaTeX
 @section Processing LaTeX fragments
+@cindex LaTeX fragments, preview
 
 La@TeX{} fragments can be processed to produce a preview images of the
 typeset expressions:
@@ -3594,6 +4170,7 @@ setting is active:
 
 @node CDLaTeX mode,  , Processing LaTeX fragments, Embedded LaTeX
 @section Using CDLaTeX to enter math
+@cindex CDLaTeX
 
 CDLaTeX-mode is a minor mode that is normally used in combination with a
 major LaTeX mode like AUCTeX in order to speed-up insertion of
@@ -4035,7 +4612,7 @@ LaTeX:  @r{turn on/off La@TeX{} fragments}
 @cindex publishing
 
 Org-mode includes@footnote{@file{org-publish.el} is not yet part of
-emacs, so if you are using @file{org.el} as it comes with Emacs, you
+Emacs, so if you are using @file{org.el} as it comes with Emacs, you
 need to download this file separately.  Also make sure org.el is at
 least version 4.27.} a publishing management system
 that allows you to configure automatic HTML conversion of
@@ -4110,6 +4687,9 @@ and where to put published files.
 @tab Directory containing publishing source files
 @item @code{:publishing-directory}
 @tab Directory (possibly remote) where output files will be published.
+@item @code{:preparation-function}
+@tab Function called before starting publishing process, for example to
+run @code{make} for updating files to be published.
 @end multitable
 @noindent
 
@@ -4149,7 +4729,8 @@ specify the publishing function.
 
 @multitable @columnfractions 0.3 0.7
 @item @code{:publishing-function}
-@tab Function executing the publication of a file.
+@tab Function executing the publication of a file.  This may also be a
+list of functions, which will all be called in turn.
 @end multitable
 
 The function must accept two arguments: a property list containing at
@@ -4354,7 +4935,7 @@ following functions:
 @item C-c C-e c
 Prompt for a specific project and publish all files that belong to it.
 @item C-c C-e p
-Publish the project containin the current file.
+Publish the project containing the current file.
 @item C-c C-e f
 Publish only the current file.
 @item C-c C-e a
@@ -4408,16 +4989,24 @@ At the beginning of a headline, complete TODO keywords.
 @item
 After @samp{\}, complete @TeX{} symbols supported by the exporter.
 @item
-After @samp{*}, complete CamelCase versions of all headlines in the
-buffer.
+After @samp{*}, complete headlines in the current buffer so that they
+can be used in search links like @samp{[[*find this headline]]}.
 @item
-After @samp{:}, complete tags used elsewhere in the buffer.
+After @samp{:}, complete tags.  The list of tags is taken from the
+variable @code{org-tag-alist} (possibly set through the @samp{#+TAGS}
+in-buffer option, @pxref{Setting tags}), or it is created dynamically
+from all tags used in the current buffer.
+@item
+After @samp{[}, complete link abbreviations (@pxref{Link abbreviations}).
 @item
 After @samp{#+}, complete the special keywords like @samp{TYP_TODO} or
 @samp{OPTIONS} which set file-specific options for Org-mode.  When the
 option keyword is already complete, pressing @kbd{M-@key{TAB}} again
 will insert example settings for this keyword.
 @item
+In the line after @samp{#+STARTUP: }, complete startup keywords,
+i.e. valid keys for this line.
+@item
 Elsewhere, complete dictionary words using ispell.
 @end itemize
 @end table
@@ -4487,6 +5076,12 @@ showstars  @r{show all stars starting a headline}
 odd        @r{allow only odd outline levels (1,3,...)}
 oddeven    @r{allow all outline levels}
 @end example
+To turn on custom format overlays over time stamps (variables
+@code{org-put-time-stamp-overlays} and
+@code{org-time-stamp-overlay-formats}), use
+@example
+customtime @r{overlay custom time format}
+@end example
 @item #+SEQ_TODO:   #+TYP_TODO:
 These lines set the TODO keywords and their interpretation in the
 current file.  The corresponding variables are @code{org-todo-keywords}
@@ -4495,6 +5090,10 @@ and @code{org-todo-interpretation}.
 These lines (several such lines are allowed) specify the legal tags in
 this file, and (potentially) the corresponding @emph{fast tag selection}
 keys.  The corresponding variable is @code{org-tag-alist}.
+@item #+LINK:  linkword replace
+These lines (several are allowed) specify link abbreviations.
+@xref{Link abbreviations}.  The corresponding variable is
+@code{org-link-abbrev-alist}.
 @item #+CATEGORY:
 This line sets the category for the agenda file.  The category applies
 for all subsequent lines until the next @samp{#+CATEGORY} line, or the
@@ -4509,6 +5108,7 @@ These lines provide settings for exporting files.  For more details see
 @node The very busy C-c C-c key, Clean view, In-buffer settings, Miscellaneous
 @section The very busy C-c C-c key
 @kindex C-c C-c
+@cindex C-c C-c, overview
 
 The key @kbd{C-c C-c} has many purposes in org-mode, which are all
 mentioned scattered throughout this manual.  One specific function of
@@ -4535,9 +5135,9 @@ the entire table.
 If the cursor is inside a table created by the @file{table.el} package,
 activate that table.
 @item
-If the current buffer is a remember buffer, close note and file it.
-with a prefix argument, file it without further interaction to the default
-location.
+If the current buffer is a remember buffer, close the note and file it.
+With a prefix argument, file it, without further interaction, to the
+default location.
 @item
 If the cursor is on a @code{<<<target>>>}, update radio targets and
 corresponding links in this buffer.
@@ -4607,7 +5207,7 @@ With stars hidden, the tree becomes:
 @noindent
 Note that the leading stars are not truly replaced by whitespace, they
 are only fontified with the face @code{org-hide} that uses the
-background color as font color.  If are are not using either white or
+background color as font color.  If you are not using either white or
 black background, you may have to customize this face to get the wanted
 effect.  Another possibility is to set this font such that the extra
 stars are @i{almost} invisible, for example using the color
@@ -4698,7 +5298,6 @@ with other code out there.
 * Conflicts::                   Packages that lead to conflicts
 @end menu
 
-
 @node Cooperation, Conflicts, Interaction, Interaction
 @subsection Packages that Org-mode cooperates with
 
@@ -4839,13 +5438,6 @@ functionality of Org-mode.
 The following extensions for Org-mode have been written by other people:
 
 @table @asis
-@cindex @file{org-mouse.el}
-@item @file{org-mouse.el} by Piotr Zielinski
-This package implements extended mouse functionality for Org-mode.  It
-allows you to cycle visibility and to edit the document structure with
-the mouse.  Best of all, it provides a context-sensitive menu on
-@key{mouse-3} that changes depending on the context of a mouse-click.
-@file{org-mouse.el} is freely available at @url{http://www.cl.cam.ac.uk/~pz215/files/org-mouse.el}.
 @cindex @file{org-publish.el}
 @item @file{org-publish.el} by David O'Toole
 This package provides facilities for publishing related sets of Org-mode
@@ -4856,6 +5448,17 @@ Org-mode distribution.  It is not yet part of Emacs, however, a delay
 caused by the preparations for the 22.1 release.  In the mean time,
 @file{org-publish.el} can be downloaded from David's site:
 @url{http://dto.freeshell.org/e/org-publish.el}.
+@cindex @file{org-mouse.el}
+@item @file{org-mouse.el} by Piotr Zielinski
+This package implements extended mouse functionality for Org-mode.  It
+allows you to cycle visibility and to edit the document structure with
+the mouse.  Best of all, it provides a context-sensitive menu on
+@key{mouse-3} that changes depending on the context of a mouse-click.
+As of Org-mode version 4.53, @file{org-mouse.el} is part of the
+Org-mode distribution.  It is not yet part of Emacs, however, a delay
+caused by the preparations for the 22.1 release.  In the mean time,
+@file{org-mouse.el} can be downloaded from Piotr's site:
+@url{http://www.cl.cam.ac.uk/~pz215/files/org-mouse.el}.
 @cindex @file{org-blog.el}
 @item @file{org-blog.el} by David O'Toole
 A blogging plug-in for @file{org-publish.el}.@*
@@ -4917,7 +5520,7 @@ The corresponding block writer function could look like this:
 (defun org-dblock-write:block-update-time (params)
    (let ((fmt (or (plist-get params :format) "%d. %m. %Y")))
      (insert "Last block update at: "
-            (format-time-string fmt (current-time)))))
+             (format-time-string fmt (current-time)))))
 @end lisp
 
 If you want to make sure that all dynamic blocks are always up-to-date,
@@ -4925,25 +5528,24 @@ you could add the function @code{org-update-all-dblocks} to a hook, for
 example @code{before-save-hook}.  @code{org-update-all-dblocks} is
 written in a way that is does nothing in buffers that are not in Org-mode.
 
-
 @node History and Acknowledgments, Index, Extensions and Hacking, Top
 @appendix History and Acknowledgments
 @cindex acknowledgments
 @cindex history
 @cindex thanks
 
-The beginnings of Org-mode go back to 2003.  It was borne out of
-frustration over the user interface of the emacs outline-mode.  All I
-wanted was to make working with an outline tree possible without having
-to remember more than 10 commands just for hiding and unhiding parts of
-the outline tree, and to allow to restructure a tree easily.  Visibility
-cycling and structure editing were originally implemented in the package
-@file{outline-magic.el}, but quickly moved to the more general
-@file{org.el}.  TODO entries, basic time stamps, and table support were
-added next, and highlight the two main goals that Org-mode still has
-today:  To create a new, outline-based, plain text mode with innovative
-and intuitive editing features, and to incorporate project planning
-functionality directly into a notes file.
+Org-mode was borne in 2003, out of frustration over the user interface
+of the Emacs outline-mode.  All I wanted was to make working with an
+outline tree possible without having to remember more than 10 commands
+just for hiding and unhiding parts of the outline tree, and to allow to
+restructure a tree easily.  Visibility cycling and structure editing
+were originally implemented in the package @file{outline-magic.el}, but
+quickly moved to the more general @file{org.el}.  TODO entries, basic
+time stamps, and table support were added next, and highlight the two
+main goals that Org-mode still has today: To create a new,
+outline-based, plain text mode with innovative and intuitive editing
+features, and to incorporate project planning functionality directly
+into a notes file.
 
 Since the first release, hundreds of emails to me or on
 @code{emacs-orgmode@@gnu.org} have provided a constant stream of bug
@@ -4955,6 +5557,7 @@ be complete, if I have forgotten someone, please accept my apologies and
 let me know.
 
 @itemize @bullet
+
 @item
 @i{Thomas Baumann} contributed the code for links to the MH-E email
 system.
@@ -4973,6 +5576,8 @@ calculations and improved XEmacs compatibility, in particular by porting
 @item
 @i{Sacha Chua} suggested to copy some linking code from Planner.
 @item
+@i{Eddward DeVilla} proposed and tested checkbox statistics.
+@item
 @i{Kees Dullemond} inspired the use of narrowed tabled columns.
 @item
 @i{Christian Egli} converted the documentation into TeXInfo format,
@@ -4982,10 +5587,9 @@ patched CSS formatting into the HTML exporter, and inspired the agenda.
 @item
 @i{Niels Giessen} had the idea to automatically archive DONE trees.
 @item
-@i{Bastien Guerry} provoded extensive feedback.
+@i{Bastien Guerry} provided extensive feedback.
 @item
-@i{Kai Grossjohann} pointed out key-binding conflicts caused by
-Org-mode.
+@i{Kai Grossjohann} pointed out key-binding conflicts with other packages.
 @item
 @i{Leon Liu} asked for embedded LaTeX and tested it.
 @item
@@ -5002,7 +5606,8 @@ file links, and TAGS.
 @i{Scott Otterson} sparked the introduction of descriptive text for
 links, among other things.
 @item
-@i{Pete Phillips} helped the development of the TAGS feature.
+@i{Pete Phillips} helped during the development of the TAGS feature, and
+provided frequent feedback.
 @item
 @i{T.V. Raman} reported bugs and suggested improvements.
 @item
@@ -5014,6 +5619,8 @@ control.
 @i{Frank Ruell} solved the mystery of the @code{keymapp nil} bug, a
 conflict with @file{allout.el}.
 @item
+@i{Jason Riedy} sent a patch to fix a bug with export of TODO keywords.
+@item
 @i{Philip Rooke} created the Org-mode reference card and provided lots
 of feedback.
 @item
@@ -5026,6 +5633,8 @@ Linking to VM/BBDB/GNUS was inspired by @i{Tom Shannon}'s
 @i{Daniel Sinder} came up with the idea of internal archiving by locking
 subtrees.
 @item
+@i{Dale Smith} proposed link abbreviations.
+@item
 @i{David O'Toole} wrote @file{org-publish.el} and drafted the manual
 chapter about publishing.
 @item
@@ -5051,8 +5660,8 @@ linking to GNUS.
 @i{Roland Winkler} requested additional keybindings to make Org-mode
 work on a tty.
 @item
-@i{Piotr Zielinski} wrote @file{org-mouse.el} and showed how to follow
-links with mouse-1.
+@i{Piotr Zielinski} wrote @file{org-mouse.el}, proposed agenda blocks
+and contributed various ideas and code snippets.
 @end itemize
 
 
@@ -5062,7 +5671,7 @@ links with mouse-1.
 @printindex cp
 
 @node Key Index,  , Index, Top
-@chapter Key Index
+@unnumbered Key Index
 
 @printindex ky
 
index b1ed713..67b61ae 100644 (file)
@@ -417,7 +417,7 @@ Search for @var{words}, ignoring details of punctuation.
 Search backward for @var{words}, ignoring details of punctuation.
 @end table
 
-  Word search is a special case of nonincremental search and is invoked
+  Word search as a special case of nonincremental search is invoked
 with @kbd{C-s @key{RET} C-w}.  This is followed by the search string,
 which must always be terminated with @key{RET}.  Being nonincremental,
 this search does not start until the argument is terminated.  It works
@@ -426,6 +426,13 @@ by constructing a regular expression and searching for that; see
 
   Use @kbd{C-r @key{RET} C-w} to do backward word search.
 
+  You can also invoke word search with @kbd{C-s M-e C-w} or @kbd{C-r
+M-e C-w} followed by the search string and terminated with @key{RET},
+@kbd{C-s} or @kbd{C-r}.  This puts word search into incremental mode
+where you can use all keys available for incremental search.  However,
+when you type more words in incremental word search, it will fail
+until you type complete words.
+
 @findex word-search-forward
 @findex word-search-backward
   Forward and backward word searches are implemented by the commands
index 0817739..4d47842 100644 (file)
@@ -3,7 +3,7 @@
 % Load plain if necessary, i.e., if running under initex.
 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
 %
-\def\texinfoversion{2006-08-26.17}
+\def\texinfoversion{2006-11-08.17}
 %
 % Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
 % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free
 \chardef\spacecat = 10
 \def\spaceisspace{\catcode`\ =\spacecat}
 
+% sometimes characters are active, so we need control sequences.
+\chardef\colonChar = `\:
+\chardef\commaChar = `\,
+\chardef\dashChar  = `\-
+\chardef\dotChar   = `\.
+\chardef\exclamChar= `\!
+\chardef\lquoteChar= `\`
+\chardef\questChar = `\?
+\chardef\rquoteChar= `\'
+\chardef\semiChar  = `\;
+\chardef\underChar = `\_
+
 % Ignore a token.
 %
 \def\gobble#1{}
@@ -1243,6 +1255,11 @@ where each line of input produces a line of output.}
   \HyPsdSubst{)}{\realbackslash)}{#1}%
 }
 
+\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
+with PDF output, and none of those formats could be found.  (.eps cannot
+be supported due to the design of the PDF format; use regular TeX (DVI
+output) for that.)}
+
 \ifpdf
   \input pdfcolor
   \pdfcatalog{/PageMode /UseOutlines}%
@@ -1250,6 +1267,36 @@ where each line of input produces a line of output.}
   \def\dopdfimage#1#2#3{%
     \def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
     \def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
+    %
+    % pdftex (and the PDF format) support .png, .jpg, .pdf (among
+    % others).  Let's try in that order.
+    \let\pdfimgext=\empty
+    \begingroup
+      \openin 1 #1.png \ifeof 1
+        \openin 1 #1.jpg \ifeof 1
+          \openin 1 #1.jpeg \ifeof 1
+            \openin 1 #1.JPG \ifeof 1
+              \openin 1 #1.pdf \ifeof 1
+                \errhelp = \nopdfimagehelp
+                \errmessage{Could not find image file #1 for pdf}%
+              \else
+                \gdef\pdfimgext{pdf}%
+              \fi
+            \else
+              \gdef\pdfimgext{JPG}%
+            \fi
+          \else
+            \gdef\pdfimgext{jpeg}%
+          \fi
+        \else
+          \gdef\pdfimgext{jpg}%
+        \fi
+      \else
+        \gdef\pdfimgext{png}%
+      \fi
+      \closein 1
+    \endgroup
+    %
     % without \immediate, pdftex seg faults when the same image is
     % included twice.  (Version 3.14159-pre-1.0-unofficial-20010704.)
     \ifnum\pdftexversion < 14
@@ -1260,9 +1307,9 @@ where each line of input produces a line of output.}
       \ifdim \wd0 >0pt width \imagewidth \fi
       \ifdim \wd2 >0pt height \imageheight \fi
       \ifnum\pdftexversion<13
-         #1.pdf%
+         #1.\pdfimgext
        \else
-         {#1.pdf}%
+         {#1.\pdfimgext}%
        \fi
     \ifnum\pdftexversion < 14 \else
       \pdfrefximage \pdflastximage
@@ -1976,13 +2023,6 @@ where each line of input produces a line of output.}
 % Can't use plain's \frenchspacing because it uses the `\x notation, and
 % sometimes \x has an active definition that messes things up.
 %
-\chardef\colonChar = `\:
-\chardef\commaChar = `\,
-\chardef\dotChar   = `\.
-\chardef\exclamChar= `\!
-\chardef\questChar = `\?
-\chardef\semiChar  = `\;
-%
 \catcode`@=11
   \def\plainfrenchspacing{%
     \sfcode\dotChar  =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m
@@ -2010,6 +2050,7 @@ where each line of input produces a line of output.}
      \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
     \kern-0.4pt\hrule}%
   \kern-.06em\raise0.4pt\hbox{\angleright}}}}
+\def\key #1{{\nohyphenation \uppercase{#1}}\null}
 % The old definition, with no lozenge:
 %\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
 \def\ctrl #1{{\tt \rawbackslash \hat}#1}
@@ -2051,11 +2092,14 @@ where each line of input produces a line of output.}
 % and arrange explicitly to hyphenate at a dash.
 %  -- rms.
 {
-  \catcode`\-=\active \catcode`\_=\active \catcode`\'=\active
+  \catcode`\-=\active \catcode`\_=\active
+  \catcode`\'=\active \catcode`\`=\active
   %
   \global\def\code{\begingroup
-    \catcode`\-=\active  \catcode`\_=\active \catcode`\'=\active
-    \let'\singlequotechar
+    \catcode\rquoteChar=\active \catcode\lquoteChar=\active
+    \let'\codequoteright \let`\codequoteleft
+    %
+    \catcode\dashChar=\active  \catcode\underChar=\active
     \ifallowcodebreaks
      \let-\codedash
      \let_\codeunder
@@ -5410,7 +5454,7 @@ where each line of input produces a line of output.}
 % evince), the lilypond developers report.  xpdf does work with the
 % regular 0x27.  
 % 
-\def\singlequotechar{%
+\def\codequoteright{%
   \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
     '%
   \else
@@ -5418,6 +5462,18 @@ where each line of input produces a line of output.}
   \fi
 }
 %
+% and a similar option for the left quote char vs. a grave accent.
+% Modern fonts display ASCII 0x60 as a grave accent, so some people like
+% the code environments to do likewise.
+% 
+\def\codequoteleft{%
+  \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
+    `%
+  \else
+    \char'22
+  \fi
+}
+%
 \begingroup
   \catcode`\^^I=\active
   \gdef\tabexpand{%
@@ -5431,12 +5487,15 @@ where each line of input produces a line of output.}
     }%
   }
   \catcode`\'=\active
-  \gdef\quoteexpand{%
-    \catcode`\'=\active
-    \def'{\singlequotechar}
-  }%
+  \gdef\rquoteexpand{\catcode\rquoteChar=\active \def'{\codequoteright}}%
+  %
+  \catcode`\`=\active
+  \gdef\lquoteexpand{\catcode\lquoteChar=\active \def`{\codequoteleft}}%
+  %
+  \gdef\quoteexpand{\rquoteexpand \lquoteexpand}%
 \endgroup
-%
+
+% start the verbatim environment.
 \def\setupverbatim{%
   \let\nonarrowing = t%
   \nonfillstart
index baea8d6..48d13b6 100644 (file)
@@ -456,11 +456,10 @@ filenames in July 2002.
 @cindex configuration
 
 @cindex default configuration
-@value{tramp} is (normally) fully functional when it is initially installed.
-It is initially configured to use the @command{ssh} program to connect
-to the remote host and to use base64 or uu encoding to transfer the
-files through that shell connection.  So in the easiest case, you just
-type @kbd{C-x C-f} and then enter the filename
+@value{tramp} is (normally) fully functional when it is initially
+installed.  It is initially configured to use the @command{scp}
+program to connect to the remote host.  So in the easiest case, you
+just type @kbd{C-x C-f} and then enter the filename
 @file{@value{prefix}@var{user}@@@var{machine}@value{postfix}@var{/path/to.file}}.
 
 On some hosts, there are problems with opening a connection.  These are
@@ -1036,7 +1035,7 @@ choice.  This variable controls which method will be used when a method
 is not specified in the @value{tramp} file name.  For example:
 
 @lisp
-(setq tramp-default-method "scp")
+(setq tramp-default-method "ssh")
 @end lisp
 
 @vindex tramp-default-method-alist
index 453ae4a..610bf75 100644 (file)
@@ -250,7 +250,7 @@ supports version 1.1, specified in RFC 2616.  (This supersedes 1.0,
 defined in RFC 1945) HTTP URLs have the following form, where most of
 the parts are optional:
 @example
-http://@var{user}:@var{password}@var{host}:@var{port}/@var{path}?@var{searchpart}#@var{fragment}
+http://@var{user}:@var{password}@@@var{host}:@var{port}/@var{path}?@var{searchpart}#@var{fragment}
 @end example
 @c The @code{:@var{port}} part is optional, and @var{port} defaults to
 @c 80.  The @code{/@var{path}} part, if present, is a slash-separated
index 0d782fd..d7a21d0 100644 (file)
@@ -57,8 +57,9 @@ license to the document, as described in section 6 of the license.
 @author Queen Mary and Westfield College
 @author (University of London)
 @author Mile End Road, London E1 4NS, UK
-@author @email{F.J.Wright@@qmw.ac.uk}
+@author @email{F.J.Wright@@qmul.ac.uk}
 @author @uref{http://centaur.maths.qmw.ac.uk/}
+@c He no longer maintains this manual.
 @sp 2
 @author Manual Last Updated @value{UPDATED}
 
diff --git a/man/xresmini.texi b/man/xresmini.texi
deleted file mode 100644 (file)
index 7820793..0000000
+++ /dev/null
@@ -1,432 +0,0 @@
-@c This is part of the Emacs manual.
-@c Copyright (C) 1987, 1993, 1994, 1995, 1997, 2001, 2002, 2003,
-@c   2004, 2005, 2006 Free Software Foundation, Inc.
-@c See file emacs.texi for copying conditions.
-@node X Resources, Antinews, Emacs Invocation, Top
-@appendix X Options and Resources
-
-  You can customize some X-related aspects of Emacs behavior using X
-resources, as is usual for programs that use X.  On MS-Windows, you
-can customize some of the same aspects using the system registry.
-@xref{MS-Windows Registry}.  Likewise, Emacs on MacOS Carbon emulates X
-resources using the Preferences system.  @xref{Mac Environment Variables}.
-
-  When Emacs is built using an ``X toolkit,'' such as Lucid or
-LessTif, you need to use X resources to customize the appearance of
-the widgets, including the menu-bar, scroll-bar, and dialog boxes.
-This is because the libraries that implement these don't provide for
-customization through Emacs.  GTK+ widgets use a separate system of
-``GTK resources.''  In this chapter we describe the most commonly used
-resource specifications.  For full documentation, see the online
-manual.
-
-@c Add xref for LessTif/Motif menu resources.
-
-@menu
-* Resources::           Using X resources with Emacs (in general).
-* Table of Resources::  Table of specific X resources that affect Emacs.
-* Face Resources::      X resources for customizing faces.
-* Lucid Resources::     X resources for Lucid menus.
-* GTK resources::       Resources for GTK widgets.
-@end menu
-
-@node Resources
-@appendixsec X Resources
-@cindex resources
-@cindex X resources
-@cindex @file{~/.Xdefaults} file
-@cindex @file{~/.Xresources} file
-
-  Programs running under the X Window System organize their user
-options under a hierarchy of classes and resources.  You can specify
-default values for these options in your X resources file, usually
-named @file{~/.Xdefaults} or @file{~/.Xresources}.
-If changes in @file{~/.Xdefaults} do not
-take effect, it is because your X server stores its own list of
-resources; to update them, use the shell command @command{xrdb}---for
-instance, @samp{xrdb ~/.Xdefaults}.
-
-  Each line in the file specifies a value for one option or for a
-collection of related options, for one program or for several programs
-(optionally even for all programs).
-
-@cindex Registry (MS-Windows)
-  MS-Windows systems don't support @file{~/.Xdefaults} files, but
-Emacs compiled for Windows looks for X resources in the Windows
-Registry, under the key @samp{HKEY_CURRENT_USER\SOFTWARE\GNU\Emacs}
-and then under the key @samp{HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs}.
-The menu and scrollbars are native widgets on MS-Windows, so they are
-only customizable via the system-wide settings in the Display Control
-Panel.  You can also set resources using the @samp{-xrm} command line
-option (see below.)
-
-  Applications such as Emacs look for resources with specific names
-and their particular meanings.  Case distinctions are significant in
-these names.  Each resource specification in @file{~/.Xdefaults}
-states the name of the program and the name of the resource.  For
-Emacs, the program name is @samp{Emacs}.  It looks like this:
-
-@example
-Emacs.borderWidth: 2
-@end example
-
-  The order in which the lines appear in the file does not matter.
-Also, command-line options always override the X resources file.
-
-  You can experiment with the effect of different resource settings
-with the @code{editres} program.  Select @samp{Get Tree} from the
-@samp{Commands} menu, then click on an Emacs frame.  This will display
-a tree showing the structure of X toolkit widgets used in an Emacs
-frame.  Select one of them, such as @samp{menubar}, then select
-@samp{Show Resource Box} from the @samp{Commands} menu.  This displays
-a list of all the meaningful X resources for that widget, and allows
-you to edit them.  Changes take effect when you click on the
-@samp{Apply} button.  (See the @code{editres} man page for more
-details.)
-
-@node Table of Resources
-@appendixsec Table of X Resources for Emacs
-
-  This table lists the resource names that designate options for
-Emacs, not counting those for the appearance of the menu bar, each
-with the class that it belongs to:
-
-@table @asis
-@item @code{background} (class @code{Background})
-Background color name.
-
-@item @code{borderColor} (class @code{BorderColor})
-Color name for the external border.
-
-@item @code{cursorColor} (class @code{Foreground})
-Color name for text cursor (point).
-
-@item @code{font} (class @code{Font})
-Font name (or fontset name, @pxref{Fontsets}) for @code{default} font.
-
-@item @code{foreground} (class @code{Foreground})
-Color name for text.
-
-@item @code{geometry} (class @code{Geometry})
-Window size and position.  Be careful not to specify this resource as
-@samp{emacs*geometry}, because that may affect individual menus as well
-as the Emacs frame itself.
-
-If this resource specifies a position, that position applies only to the
-initial Emacs frame (or, in the case of a resource for a specific frame
-name, only that frame).  However, the size, if specified here, applies to
-all frames.
-
-@item @code{iconName} (class @code{Title})
-Name to display in the icon.
-
-@item @code{internalBorder} (class @code{BorderWidth})
-Width in pixels of the internal border.
-
-@item @code{lineSpacing} (class @code{LineSpacing})
-@cindex line spacing
-@cindex leading
-Additional space (@dfn{leading}) between lines, in pixels.
-
-@item @code{menuBar} (class @code{MenuBar})
-@cindex menu bar
-Give frames menu bars if @samp{on}; don't have menu bars if
-@samp{off}.  @xref{Lucid Resources}, for how to control the appearance
-of the menu bar if you have one.
-
-@item @code{pointerColor} (class @code{Foreground})
-Color of the mouse cursor.
-
-@item @code{screenGamma} (class @code{ScreenGamma})
-@cindex gamma correction
-Gamma correction for colors, equivalent to the frame parameter
-@code{screen-gamma}.
-
-@item @code{title} (class @code{Title})
-Name to display in the title bar of the initial Emacs frame.
-
-@item @code{toolBar} (class @code{ToolBar})
-@cindex tool bar
-Number of lines to reserve for the tool bar.  A zero value suppresses
-the tool bar.  If the value is non-zero and
-@code{auto-resize-tool-bars} is non-@code{nil}, the tool bar's size
-will be changed automatically so that all tool bar items are visible.
-
-@item @code{useXIM} (class @code{UseXIM})
-@cindex XIM
-@cindex X input methods
-@cindex input methods, X
-Turn off use of X input methods (XIM) if @samp{false} or @samp{off}.
-This is only relevant if your Emacs is actually built with XIM
-support.  It is potentially useful to turn off XIM for efficiency,
-especially slow X client/server links.
-
-@item @code{verticalScrollBars} (class @code{ScrollBars})
-Give frames scroll bars if @samp{on}; don't have scroll bars if
-@samp{off}.
-@end table
-
-@node Face Resources
-@appendixsec X Resources for Faces
-
-  You can use resources to customize the appearance of particular
-faces (@pxref{Faces}):
-
-@table @code
-@item @var{face}.attributeForeground
-Foreground color for face @var{face}.
-@item @var{face}.attributeBackground
-Background color for face @var{face}.
-@item @var{face}.attributeUnderline
-Underline flag for face @var{face}.  Use @samp{on} or @samp{true} for
-yes.
-@item @var{face}.attributeStrikeThrough
-@itemx @var{face}.attributeOverline
-@itemx @var{face}.attributeBox
-@itemx @var{face}.attributeInverse
-Likewise, for other boolean font attributes.
-@item @var{face}.attributeStipple
-The name of a pixmap data file to use for the stipple pattern, or
-@code{false} to not use stipple for the face @var{face}.
-@item @var{face}.attributeBackgroundPixmap
-The background pixmap for the face @var{face}.  Should be a name of a
-pixmap file or @code{false}.
-@item @var{face}.attributeFont
-Font name (full XFD name or valid X abbreviation) for face @var{face}.
-Instead of this, you can specify the font through separate attributes.
-@end table
-
-  Instead of using @code{attributeFont} to specify a font name, you can
-select a font through these separate attributes:
-
-@table @code
-@item @var{face}.attributeFamily
-Font family for face @var{face}.
-@item @var{face}.attributeHeight
-Height of the font to use for face @var{face}: either an integer
-specifying the height in units of 1/10@dmn{pt}, or a floating point
-number that specifies a scale factor to scale the underlying face's
-default font, or a function to be called with the default height which
-will return a new height.
-@item @var{face}.attributeWidth
-@itemx @var{face}.attributeWeight
-@itemx @var{face}.attributeSlant
-Each of these resources corresponds to a like-named font attribute,
-and you write the resource value the same as the symbol you would use
-for the font attribute value.
-@item @var{face}.attributeBold
-Bold flag for face @var{face}---instead of @code{attributeWeight}.  Use @samp{on} or @samp{true} for
-yes.
-@item @var{face}.attributeItalic
-Italic flag for face @var{face}---instead of @code{attributeSlant}.
-@end table
-
-@node Lucid Resources
-@appendixsec Lucid Menu X Resources
-@cindex Menu X Resources (Lucid widgets)
-@cindex Lucid Widget X Resources
-
-  If the Emacs installed at your site was built to use the X toolkit
-with the Lucid menu widgets, then the menu bar is a separate widget
-and has its own resources.  The resource specifications start with
-@samp{Emacs.pane.menubar}---for instance, to specify the font
-@samp{8x16} for the menu-bar items, write this:
-
-@example
-Emacs.pane.menubar.font:  8x16
-@end example
-
-@noindent
-Resources for @emph{non-menubar} toolkit pop-up menus have
-@samp{menu*} instead of @samp{pane.menubar}.  For example, to specify
-the font @samp{8x16} for the pop-up menu items, write this:
-
-@example
-Emacs.menu*.font:      8x16
-@end example
-
-@noindent
-For dialog boxes, use @samp{dialog*}:
-
-@example
-Emacs.dialog*.font:    8x16
-@end example
-
-@noindent
-The Lucid menus can display multilingual text in your locale.  For
-more information about fontsets see the man page for
-@code{XCreateFontSet}.  To enable multilingual menu text you specify a
-@code{fontSet} resource instead of the font resource.  If both
-@code{font} and @code{fontSet} resources are specified, the
-@code{fontSet} resource is used.
-
-  Thus, to specify @samp{-*-helvetica-medium-r-*--*-120-*-*-*-*-*-*,*}
-for both the popup and menu bar menus, write this:
-
-@example
-Emacs*menu*fontSet:  -*-helvetica-medium-r-*--*-120-*-*-*-*-*-*,*
-@end example
-
-@noindent
-The @samp{*menu*} as a wildcard matches @samp{pane.menubar} and
-@samp{menu@dots{}}.
-
-  Experience shows that on some systems you may need to add
-@samp{shell.}@: before the @samp{pane.menubar} or @samp{menu*}.  On
-some other systems, you must not add @samp{shell.}.  The generic wildcard
-approach should work on both kinds of systems.
-
-  Here is a list of the specific resources for menu bars and pop-up menus:
-
-@table @code
-@item font
-Font for menu item text.
-@item fontSet
-Fontset for menu item text.
-@item foreground
-Color of the foreground.
-@item background
-Color of the background.
-@item buttonForeground
-In the menu bar, the color of the foreground for a selected item.
-@item margin
-The margin of the menu bar, in characters.  Default is 1.
-@end table
-
-@node GTK resources
-@appendixsec GTK resources
-
-  The most common way to customize the GTK widgets Emacs uses (menus, dialogs
-tool bars and scroll bars) is by choosing an appropriate theme, for example
-with the GNOME theme selector.  You can also do Emacs specific customization
-by inserting GTK style directives in the file @file{~/.emacs.d/gtkrc}.  Some GTK
-themes ignore customizations in @file{~/.emacs.d/gtkrc} so not everything
-works with all themes.  To customize Emacs font, background, faces, etc., use
-the normal X resources (@pxref{Resources}).  We will present some examples of
-customizations here, but for a more detailed description, see the online manual.
-
-  The first example is just one line.  It changes the font on all GTK widgets
-to courier with size 12:
-
-@smallexample
-gtk-font-name = "courier 12"
-@end smallexample
-
-  The thing to note is that the font name is not an X font name, like
--*-helvetica-medium-r-*--*-120-*-*-*-*-*-*, but a Pango font name.  A Pango
-font name is basically of the format "family style size", where the style
-is optional as in the case above.  A name with a style could be for example:
-
-@smallexample
-gtk-font-name = "helvetica bold 10"
-@end smallexample
-
-  To customize widgets you first define a style and then apply the style to
-the widgets.  Here is an example that sets the font for menus, but not
-for other widgets:
-
-@smallexample
-# @r{Define the style @samp{menufont}.}
-style "menufont"
-@{
-  font_name = "helvetica bold 14"  # This is a Pango font name
-@}
-
-# @r{Specify that widget type @samp{*emacs-menuitem*} uses @samp{menufont}.}
-widget "*emacs-menuitem*" style "menufont"
-@end smallexample
-
-The widget name in this example contains wildcards, so the style will be
-applied to all widgets that match "*emacs-menuitem*".  The widgets are
-named by the way they are contained, from the outer widget to the inner widget.
-So to apply the style "my_style" (not shown) with the full, absolute name, for
-the menubar and the scroll bar in Emacs we use:
-
-@smallexample
-widget "Emacs.pane.menubar" style "my_style"
-widget "Emacs.pane.emacs.verticalScrollBar" style "my_style"
-@end smallexample
-But to avoid having to type it all, wildcards are often used.  @samp{*}
-matches zero or more characters and @samp{?} matches one character.  So "*"
-matches all widgets.
-
-  Each widget has a class (for example GtkMenuItem) and a name (emacs-menuitem).
-You can assign styles by name or by class.  In this example we have used the
-class:
-
-@smallexample
-style "menufont"
-@{
-  font_name = "helvetica bold 14"
-@}
-
-widget_class "*GtkMenuBar" style "menufont"
-@end smallexample
-
-@noindent
-The names and classes for the GTK widgets Emacs uses are:
-
-@multitable {@code{verticalScrollbar plus}} {@code{GtkFileSelection} and some}
-@item @code{emacs-filedialog}
-@tab @code{GtkFileSelection}
-@item @code{emacs-dialog}
-@tab @code{GtkDialog}
-@item @code{Emacs}
-@tab @code{GtkWindow}
-@item @code{pane}
-@tab @code{GtkVHbox}
-@item @code{emacs}
-@tab @code{GtkFixed}
-@item @code{verticalScrollBar}
-@tab @code{GtkVScrollbar}
-@item @code{emacs-toolbar}
-@tab @code{GtkToolbar}
-@item @code{menubar}
-@tab @code{GtkMenuBar}
-@item @code{emacs-menuitem}
-@tab anything in menus
-@end multitable
-
-  GTK absolute names are quite strange when it comes to menus
-and dialogs.  The names do not start with @samp{Emacs}, as they are
-free-standing windows and not contained (in the GTK sense) by the
-Emacs GtkWindow.  To customize the dialogs and menus, use wildcards like this:
-
-@smallexample
-widget "*emacs-dialog*" style "my_dialog_style"
-widget "*emacs-filedialog* style "my_file_style"
-widget "*emacs-menuitem* style "my_menu_style"
-@end smallexample
-
-  If you specify a customization in @file{~/.emacs.d/gtkrc}, then it
-automatically applies only to Emacs, since other programs don't read
-that file.  For example, the drop down menu in the file dialog can not
-be customized by any absolute widget name, only by an absolute class
-name.  This is because the widgets in the drop down menu do not
-have names and the menu is not contained in the Emacs GtkWindow.  To
-have all menus in Emacs look the same, use this in
-@file{~/.emacs.d/gtkrc}:
-
-@smallexample
-widget_class "*Menu*" style "my_menu_style"
-@end smallexample
-
-  Here is a more elaborate example, showing how to change the parts of
-the scroll bar:
-
-@smallexample
-style "scroll"
-@{
-  fg[NORMAL] = "red"@ @ @ @ @ # @r{The arrow color.}
-  bg[NORMAL] = "yellow"@ @ # @r{The thumb and background around the arrow.}
-  bg[ACTIVE] = "blue"@ @ @ @ # @r{The trough color.}
-  bg[PRELIGHT] = "white"@ # @r{The thumb color when the mouse is over it.}
-@}
-
-widget "*verticalScrollBar*" style "scroll"
-@end smallexample
-
-@ignore
-   arch-tag: e1856f29-2482-42c0-a990-233cdccd1f21
-@end ignore
index 156c04c..e9233df 100644 (file)
@@ -8,15 +8,25 @@
   You can customize some X-related aspects of Emacs behavior using X
 resources, as is usual for programs that use X.  On MS-Windows, you
 can customize some of the same aspects using the system registry.
-@xref{MS-Windows Registry}.  Likewise, the Mac Carbon port emulates X
+@xref{MS-Windows Registry}.  Likewise, Emacs on MacOS Carbon emulates X
 resources using the Preferences system.  @xref{Mac Environment Variables}.
 
-  When Emacs is built using an `X toolkit', such as Lucid or LessTif,
-you need to use X resources to customize the appearance of the
-widgets, including the menu-bar, scroll-bar, and dialog boxes.  This
-is because the libraries that implement these don't provide for
+  When Emacs is built using an ``X toolkit'', such as Lucid or 
+LessTif, you need to use X resources to customize the appearance of
+the widgets, including the menu-bar, scroll-bar, and dialog boxes.
+This is because the libraries that implement these don't provide for
 customization through Emacs.  GTK+ widgets use a separate system of
-`GTK resources', which we will also describe.
+@ifnottex
+``GTK resources'', which we will also describe.
+@end ifnottex
+@iftex
+``GTK resources.''  In this chapter we describe the most commonly used
+resource specifications.  For full documentation, see the online
+manual.
+
+@c Add xref for LessTif/Motif menu resources.
+@end iftex
+
 
 @menu
 * Resources::           Using X resources with Emacs (in general).
@@ -57,6 +67,18 @@ only customizable via the system-wide settings in the Display Control
 Panel.  You can also set resources using the @samp{-xrm} command line
 option (see below.)
 
+@iftex
+  Applications such as Emacs look for resources with specific names
+and their particular meanings.  Case distinctions are significant in
+these names.  Each resource specification in @file{~/.Xdefaults}
+states the name of the program and the name of the resource.  For
+Emacs, the program name is @samp{Emacs}.  It looks like this:
+@example
+Emacs.borderWidth: 2
+@end example
+@end iftex
+@ifnottex
   Programs define named resources with particular meanings.  They also
 define how to group resources into named classes.  For instance, in
 Emacs, the @samp{internalBorder} resource controls the width of the
@@ -95,9 +117,12 @@ borders, but overrides this value with 4 for the external border:
 emacs.BorderWidth: 2
 emacs.borderWidth: 4
 @end example
+@end ifnottex
 
   The order in which the lines appear in the file does not matter.
 Also, command-line options always override the X resources file.
+
+@ifnottex
 Here is a list of X command-line options and their corresponding
 resource names.
 
@@ -145,13 +170,19 @@ take precedence over all other resource specifications.
 
   One way to experiment with the effect of different resource settings
 is to use the @code{editres} program.  Select @samp{Get Tree} from the
+@end ifnottex
+@iftex
+  You can experiment with the effect of different resource settings
+with the @code{editres} program.  Select @samp{Get Tree} from the
+@end iftex
 @samp{Commands} menu, then click on an Emacs frame.  This will display
 a tree showing the structure of X toolkit widgets used in an Emacs
 frame.  Select one of them, such as @samp{menubar}, then select
 @samp{Show Resource Box} from the @samp{Commands} menu.  This displays
-a list of all the meaningful X resources and allows you to edit them.
-Changes take effect immediately if you click on the @samp{Apply} button.
-(See the @code{editres} man page for more details.)
+a list of all the meaningful X resources for that widget, and allows
+you to edit them.  Changes take effect when you click on the
+@samp{Apply} button.  (See the @code{editres} man page for more
+details.)
 
 @node Table of Resources
 @appendixsec Table of X Resources for Emacs
@@ -164,25 +195,31 @@ with the class that it belongs to:
 @item @code{background} (class @code{Background})
 Background color name.
 
+@ifnottex
 @item @code{bitmapIcon} (class @code{BitmapIcon})
 Use a bitmap icon (a picture of a gnu) if @samp{on}, let the window
 manager choose an icon if @samp{off}.
+@end ifnottex
 
 @item @code{borderColor} (class @code{BorderColor})
 Color name for the external border.
 
+@ifnottex
 @item @code{borderWidth} (class @code{BorderWidth})
 Width in pixels of the external border.
+@end ifnottex
 
 @item @code{cursorColor} (class @code{Foreground})
 Color name for text cursor (point).
 
+@ifnottex
 @item @code{cursorBlink} (class @code{CursorBlink})
 Specifies whether to make the cursor blink. The default is @samp{on}.  Use
 @samp{off} or @samp{false} to turn cursor blinking off.
+@end ifnottex
 
 @item @code{font} (class @code{Font})
-Font name for text (or fontset name, @pxref{Fontsets}).
+Font name (or fontset name, @pxref{Fontsets}) for @code{default} font.
 
 @item @code{foreground} (class @code{Foreground})
 Color name for text.
@@ -197,14 +234,15 @@ initial Emacs frame (or, in the case of a resource for a specific frame
 name, only that frame).  However, the size, if specified here, applies to
 all frames.
 
+@ifnottex
 @item @code{fullscreen} (class @code{Fullscreen})
 The desired fullscreen size.  The value can be one of @code{fullboth},
 @code{fullwidth} or @code{fullheight}, which correspond to
 the command-line options @samp{-fs}, @samp{-fw}, and @samp{-fh}
 (@pxref{Window Size X}).
 
-Note that this applies to all frames created, not just the initial
-one.
+Note that this applies to the initial frame only.
+@end ifnottex
 
 @item @code{iconName} (class @code{Title})
 Name to display in the icon.
@@ -219,10 +257,16 @@ Additional space (@dfn{leading}) between lines, in pixels.
 
 @item @code{menuBar} (class @code{MenuBar})
 @cindex menu bar
-Give frames menu bars if @samp{on}; don't have menu bars if
-@samp{off}.  @xref{Lucid Resources}, and @ref{LessTif Resources}, for
-how to control the appearance of the menu bar if you have one.
+Give frames menu bars if @samp{on}; don't have menu bars if @samp{off}.
+@ifnottex
+@xref{Lucid Resources}, and @ref{LessTif Resources},
+@end ifnottex
+@iftex
+@xref{Lucid Resources},
+@end iftex
+for how to control the appearance of the menu bar if you have one.
 
+@ifnottex
 @item @code{minibuffer} (class @code{Minibuffer})
 If @samp{none}, don't make a minibuffer in this frame.
 It will use a separate minibuffer frame instead.
@@ -230,10 +274,12 @@ It will use a separate minibuffer frame instead.
 @item @code{paneFont} (class @code{Font})
 @cindex font for menus
 Font name for menu pane titles, in non-toolkit versions of Emacs.
+@end ifnottex
 
 @item @code{pointerColor} (class @code{Foreground})
 Color of the mouse cursor.
 
+@ifnottex
 @item @code{privateColormap} (class @code{PrivateColormap})
 If @samp{on}, use a private color map, in the case where the ``default
 visual'' of class PseudoColor and Emacs is using it.
@@ -241,12 +287,14 @@ visual'' of class PseudoColor and Emacs is using it.
 @item @code{reverseVideo} (class @code{ReverseVideo})
 Switch foreground and background default colors if @samp{on}, use colors as
 specified if @samp{off}.
+@end ifnottex
 
 @item @code{screenGamma} (class @code{ScreenGamma})
 @cindex gamma correction
 Gamma correction for colors, equivalent to the frame parameter
 @code{screen-gamma}.
 
+@ifnottex
 @item @code{selectionFont} (class @code{SelectionFont})
 Font name for pop-up menu items, in non-toolkit versions of Emacs.  (For
 toolkit versions, see @ref{Lucid Resources}, also see @ref{LessTif
@@ -262,6 +310,7 @@ A value of 0 means wait as long as necessary.
 @cindex synchronous X mode
 Run Emacs in synchronous mode if @samp{on}.  Synchronous mode is
 useful for debugging X problems.
+@end ifnottex
 
 @item @code{title} (class @code{Title})
 Name to display in the title bar of the initial Emacs frame.
@@ -286,6 +335,7 @@ especially slow X client/server links.
 Give frames scroll bars if @samp{on}; don't have scroll bars if
 @samp{off}.
 
+@ifnottex
 @item @code{visualClass} (class @code{VisualClass})
 Specify the ``visual'' that X should use.  This tells X how to handle
 colors.
@@ -296,6 +346,7 @@ The value should start with one of @samp{TrueColor},
 @samp{-@var{depth}}, where @var{depth} is the number of color planes.
 Most terminals only allow a few ``visuals,'' and the @samp{dpyinfo}
 program outputs information saying which ones.
+@end ifnottex
 @end table
 
 @node Face Resources
@@ -358,6 +409,7 @@ Italic flag for face @var{face}---instead of @code{attributeSlant}.
 @cindex Menu X Resources (Lucid widgets)
 @cindex Lucid Widget X Resources
 
+@ifnottex
   If the Emacs installed at your site was built to use the X toolkit
 with the Lucid menu widgets, then the menu bar is a separate widget and
 has its own resources.  The resource names contain @samp{pane.menubar}
@@ -371,6 +423,14 @@ Emacs.pane.menubar.@var{resource}:  @var{value}
 @noindent
 For example, to specify the font @samp{8x16} for the menu-bar items,
 write this:
+@end ifnottex
+@iftex
+   If the Emacs installed at your site was built to use the X toolkit
+with the Lucid menu widgets, then the menu bar is a separate widget
+and has its own resources.  The resource specifications start with
+@samp{Emacs.pane.menubar}---for instance, to specify the font
+@samp{8x16} for the menu-bar items, write this:
+@end iftex
 
 @example
 Emacs.pane.menubar.font:  8x16
@@ -378,37 +438,43 @@ Emacs.pane.menubar.font:  8x16
 
 @noindent
 Resources for @emph{non-menubar} toolkit pop-up menus have
-@samp{menu*}, in like fashion.  For example, to specify the font
-@samp{8x16} for the pop-up menu items, write this:
+@samp{menu*} instead of @samp{pane.menubar}.  For example, to specify 
+the font @samp{8x16} for the pop-up menu items, write this:
 
 @example
 Emacs.menu*.font:      8x16
 @end example
 
 @noindent
-For dialog boxes, use @samp{dialog} instead of @samp{menu}:
+For dialog boxes, use @samp{dialog*}:
 
 @example
 Emacs.dialog*.font:    8x16
 @end example
 
 @noindent
-The Lucid menus can display multilingual text in your locale.  For more 
-information about fontsets see the man page for XCreateFontSet.  To enable
-multilingual menu text you specify a fontSet resource instead of the font
-resource.  If both font and fontSet resources are specified, the fontSet
-resource is used.  To specify
-@samp{-*-helvetica-medium-r-*--*-120-*-*-*-*-*-*,*} for both the popup and
-menu bar menus, write this:
+The Lucid menus can display multilingual text in your locale.  For
+more information about fontsets see the man page for
+@code{XCreateFontSet}.  To enable multilingual menu text you specify a
+@code{fontSet} resource instead of the font resource.  If both
+@code{font} and @code{fontSet} resources are specified, the
+@code{fontSet} resource is used.
+
+  Thus, to specify @samp{-*-helvetica-medium-r-*--*-120-*-*-*-*-*-*,*}
+for both the popup and menu bar menus, write this:
 
 @example
-Emacs*fontSet:  -*-helvetica-medium-r-*--*-120-*-*-*-*-*-*,*
+Emacs*menu*fontSet:  -*-helvetica-medium-r-*--*-120-*-*-*-*-*-*,*
 @end example
 
 @noindent
+The @samp{*menu*} as a wildcard matches @samp{pane.menubar} and
+@samp{menu@dots{}}.
+
 Experience shows that on some systems you may need to add
 @samp{shell.}@: before the @samp{pane.menubar} or @samp{menu*}.  On
-some other systems, you must not add @samp{shell.}.
+some other systems, you must not add @samp{shell.}.  The generic wildcard
+approach should work on both kinds of systems.
 
   Here is a list of the specific resources for menu bars and pop-up menus:
 
@@ -423,6 +489,7 @@ Color of the foreground.
 Color of the background.
 @item buttonForeground
 In the menu bar, the color of the foreground for a selected item.
+@ifnottex
 @item horizontalSpacing
 Horizontal spacing in pixels between items.  Default is 3.
 @item verticalSpacing
@@ -440,10 +507,12 @@ difference between ``in'' and ``out'' buttons is difficult to see, set
 this to 2.  If you have no problems with visibility, the default
 probably looks better.  The background color may also have some effect
 on the contrast.
+@end ifnottex
 @item margin
 The margin of the menu bar, in characters.  Default is 1.
 @end table
 
+@ifnottex
 @node LessTif Resources
 @appendixsec LessTif Menu X Resources
 @cindex Menu X Resources (LessTif widgets)
@@ -576,10 +645,145 @@ The color for the border shadow, on the bottom and the right.
 @item topShadowColor
 The color for the border shadow, on the top and the left.
 @end table
+@end ifnottex
 
 
 @node GTK resources
 @appendixsec GTK resources
+@iftex
+  The most common way to customize the GTK widgets Emacs uses (menus, dialogs
+tool bars and scroll bars) is by choosing an appropriate theme, for example
+with the GNOME theme selector.  You can also do Emacs specific customization
+by inserting GTK style directives in the file @file{~/.emacs.d/gtkrc}.  Some GTK
+themes ignore customizations in @file{~/.emacs.d/gtkrc} so not everything
+works with all themes.  To customize Emacs font, background, faces, etc., use
+the normal X resources (@pxref{Resources}).  We will present some examples of
+customizations here, but for a more detailed description, see the online manual
+
+  The first example is just one line.  It changes the font on all GTK widgets
+to courier with size 12:
+
+@smallexample
+gtk-font-name = "courier 12"
+@end smallexample
+
+  The thing to note is that the font name is not an X font name, like
+-*-helvetica-medium-r-*--*-120-*-*-*-*-*-*, but a Pango font name.  A Pango
+font name is basically of the format "family style size", where the style
+is optional as in the case above.  A name with a style could be for example:
+
+@smallexample
+gtk-font-name = "helvetica bold 10"
+@end smallexample
+
+  To customize widgets you first define a style and then apply the style to
+the widgets.  Here is an example that sets the font for menus, but not
+for other widgets:
+
+@smallexample
+# @r{Define the style @samp{menufont}.}
+style "menufont"
+@{
+  font_name = "helvetica bold 14"  # This is a Pango font name
+@}
+
+# @r{Specify that widget type @samp{*emacs-menuitem*} uses @samp{menufont}.}
+widget "*emacs-menuitem*" style "menufont"
+@end smallexample
+
+The widget name in this example contains wildcards, so the style will be
+applied to all widgets that match "*emacs-menuitem*".  The widgets are
+named by the way they are contained, from the outer widget to the inner widget.
+So to apply the style "my_style" (not shown) with the full, absolute name, for
+the menubar and the scroll bar in Emacs we use:
+
+@smallexample
+widget "Emacs.pane.menubar" style "my_style"
+widget "Emacs.pane.emacs.verticalScrollBar" style "my_style"
+@end smallexample
+But to avoid having to type it all, wildcards are often used.  @samp{*}
+matches zero or more characters and @samp{?} matches one character.  So "*"
+matches all widgets.
+
+  Each widget has a class (for example GtkMenuItem) and a name (emacs-menuitem).
+You can assign styles by name or by class.  In this example we have used the
+class:
+
+@smallexample
+style "menufont"
+@{
+  font_name = "helvetica bold 14"
+@}
+
+widget_class "*GtkMenuBar" style "menufont"
+@end smallexample
+
+@noindent
+The names and classes for the GTK widgets Emacs uses are:
+
+@multitable {@code{verticalScrollbar plus}} {@code{GtkFileSelection} and some}
+@item @code{emacs-filedialog}
+@tab @code{GtkFileSelection}
+@item @code{emacs-dialog}
+@tab @code{GtkDialog}
+@item @code{Emacs}
+@tab @code{GtkWindow}
+@item @code{pane}
+@tab @code{GtkVHbox}
+@item @code{emacs}
+@tab @code{GtkFixed}
+@item @code{verticalScrollBar}
+@tab @code{GtkVScrollbar}
+@item @code{emacs-toolbar}
+@tab @code{GtkToolbar}
+@item @code{menubar}
+@tab @code{GtkMenuBar}
+@item @code{emacs-menuitem}
+@tab anything in menus
+@end multitable
+
+  GTK absolute names are quite strange when it comes to menus
+and dialogs.  The names do not start with @samp{Emacs}, as they are
+free-standing windows and not contained (in the GTK sense) by the
+Emacs GtkWindow.  To customize the dialogs and menus, use wildcards like this:
+
+@smallexample
+widget "*emacs-dialog*" style "my_dialog_style"
+widget "*emacs-filedialog* style "my_file_style"
+widget "*emacs-menuitem* style "my_menu_style"
+@end smallexample
+
+  If you specify a customization in @file{~/.emacs.d/gtkrc}, then it
+automatically applies only to Emacs, since other programs don't read
+that file.  For example, the drop down menu in the file dialog can not
+be customized by any absolute widget name, only by an absolute class
+name.  This is because the widgets in the drop down menu do not
+have names and the menu is not contained in the Emacs GtkWindow.  To
+have all menus in Emacs look the same, use this in
+@file{~/.emacs.d/gtkrc}:
+
+@smallexample
+widget_class "*Menu*" style "my_menu_style"
+@end smallexample
+
+  Here is a more elaborate example, showing how to change the parts of
+the scroll bar:
+
+@smallexample
+style "scroll"
+@{
+  fg[NORMAL] = "red"@ @ @ @ @ # @r{The arrow color.}
+  bg[NORMAL] = "yellow"@ @ # @r{The thumb and background around the arrow.}
+  bg[ACTIVE] = "blue"@ @ @ @ # @r{The trough color.}
+  bg[PRELIGHT] = "white"@ # @r{The thumb color when the mouse is over it.}
+@}
+
+widget "*verticalScrollBar*" style "scroll"
+@end smallexample
+@end iftex
+
+@ifnottex
 @cindex GTK resources and customization
 @cindex resource files for GTK
 @cindex @file{~/.gtkrc-2.0} file
@@ -996,6 +1200,7 @@ family.  It corresponds to the fifth part of an X font name.  It is one of
 
 @noindent
 @var{size} is a decimal number that describes the font size in points.
+@end ifnottex
 
 @ignore
    arch-tag: 9b6ff773-48b6-41f6-b2f9-f114b8bdd97f
index ded6609..1403c47 100644 (file)
@@ -1,3 +1,7 @@
+2006-11-25  Eli Zaretskii  <eliz@gnu.org>
+
+       * sed1v2.inp (CFLAGS_SOUND): Edit out.
+
 2006-09-15  Jay Belanger  <belanger@truman.edu>
 
        * COPYING: Replace "Library Public License" by "Lesser Public
 
 ;; Local Variables:
 ;; coding: iso-2022-7bit-unix
+;; add-log-time-zone-rule: t
 ;; End:
 
     Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003,
index 63f6298..be67284 100644 (file)
@@ -36,6 +36,7 @@ s/\.h\.in/.h-in/
 /^LIBOBJS *=/s/@[^@\n]*@/getloadavg.o/
 /^GETLOADAVG_LIBS *=/s/@[^@\n]*@//
 /^LIBSOUND *=/s/@LIBSOUND@//
+/^CFLAGS_SOUND *=/s/@CFLAGS_SOUND@//
 /^EXEEXT *=/s/@EXEEXT@//
 /^LN_S *=/s/@[^@\n]*@/ln -s/
 /^M_FILE *=/s!@[^@\n]*@!m/intel386.h!
index ebdbf5b..7bb8528 100644 (file)
 1998-04-23  Andrew Innes  <andrewi@harlequin.co.uk>
 
        * ddeclient.c: New file.  (Support program for performing limited
-       interprocess communication on Windows.)
+       interprocess communication on Windows.)
 
        * makefile.nt: Build ddeclient.
 
        * cmdproxy.c (main): Only set environment size for real shell, and
-       provide extra directory argument, when running on Windows 95.
+       provide extra directory argument, when running on Windows 95.
 
 1998-04-17  Geoff Voelker  <voelker@cs.washington.edu>
 
        (CFLAGS) [!MSVCNT11]: Define _CRTAPI1.
 
        * runemacs.c (WinMain): Allow Emacs process to be started with
-       high or low priority.
+       high or low priority.
 
        * emacs.bat.in: Remove OS dependent operations.
 
 
 1996-06-03  Kim F. Storm  <kfs@olicom.dk>
 
-        * runemacs.c (CHOOSE_NEWEST_EXE): New parameter macro.
+       * runemacs.c (CHOOSE_NEWEST_EXE): New parameter macro.
        Not defined by default.
        (WinMain): Add conditional testing CHOOSE_NEWEST_EXE.
        (WinMain): Convert backslashes to slashes in env var values.
 
-        * addpm.c (env_vars): Use slashes, not backslashes.
+       * addpm.c (env_vars): Use slashes, not backslashes.
 
 1996-05-25  Karl Heuer  <kwzh@gnu.ai.mit.edu>
 
 1996-05-08  Andrew Innes  <andrewi@harlequin.co.uk>
 
        * addpm.c (env_vars): Set SHELL registry entry to value of COMSPEC
-       environment variable.
+       environment variable.
 
 1996-05-03  Andrew Innes  <andrewi@harlequin.co.uk>
 
 
        * ebuild.cmd, emacs.cmd, install.cmd: Changed extension to .bat.
 
-1994-12-13  voelker  <voelker@cs.washington.edu>
+1994-12-13  Geoff Voelker  <voelker@cs.washington.edu>
 
        * makefile.def (CC): In configuration section.
        (COMPAT_LIB): Defined.
 
-1994-11-01  voelker  <voelker@cs.washington.edu>
+1994-11-01  Geoff Voelker  <voelker@cs.washington.edu>
 
        * src/paths.h: New file.
 
 
        * makefile.nt: New file.
 
-        * makefile.def: New file.
+       * makefile.def: New file.
 
-        * install.cmd: New file.
+       * install.cmd: New file.
 
-        * INSTALL: New file.
+       * INSTALL: New file.
 
-        * fast-install.cmd: New file.
+       * fast-install.cmd: New file.
 
        * emacs.cmd: New file.
 
 
 ;; Local Variables:
 ;; coding: iso-2022-7bit
+;; add-log-time-zone-rule: t
 ;; End:
 
     Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004,
index 27e9ed2..0384adc 100644 (file)
@@ -6,8 +6,8 @@ Emacs ICON   icons\emacs.ico
 #endif
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 22,0,90,0
- PRODUCTVERSION 22,0,90,0
+ FILEVERSION 22,0,91,0
+ PRODUCTVERSION 22,0,91,0
  FILEFLAGSMASK 0x3FL
 #ifdef EMACSDEBUG
  FILEFLAGS 0x1L
@@ -24,12 +24,12 @@ BEGIN
        BEGIN
            VALUE "CompanyName", "Free Software Foundation\0"
            VALUE "FileDescription", "GNU Emacs for Windows NT/95/98/2000/ME/XP\0"
-           VALUE "FileVersion", "22, 0, 90, 0\0"
+           VALUE "FileVersion", "22, 0, 91, 0\0"
            VALUE "InternalName", "Emacs\0"
            VALUE "LegalCopyright", "Copyright (C) 2002, 2003, 2004, 2005, 2006\0"
            VALUE "OriginalFilename", "emacs.exe"
            VALUE "ProductName", "Emacs: The extensible self-documenting text editor\0"
-           VALUE "ProductVersion", "22, 0, 90, 0\0"
+           VALUE "ProductVersion", "22, 0, 91, 0\0"
            VALUE "OLESelfRegister", "\0"
         END
      END
index a9d7c9b..9f7967a 100644 (file)
 
 1993-06-16  Jim Blandy  (jimb@wookumz.gnu.ai.mit.edu)
 
-        Bring mumbleclean targets into conformance with GNU coding standards.
+       Bring mumbleclean targets into conformance with GNU coding standards.
        * Makefile.in (mostlyclean, realclean): New targets.
 
 1993-06-08  Jim Blandy  (jimb@wookumz.gnu.ai.mit.edu)
 
 1993-05-22  Jim Blandy  (jimb@geech.gnu.ai.mit.edu)
 
-        * Version 19.7 released.
+       * Version 19.7 released.
 
 1993-05-15  Jim Blandy  (jimb@geech.gnu.ai.mit.edu)
 
 
 1991-11-16  Noah Friedman  (friedman@nutrimat)
 
-        * copyright.h: New file (copied from X11R4 distribution)
-        * All files: Replaced occurrences of #include <X11/copyright.h>
-          with #include "copyright.h"
+       * copyright.h: New file (copied from X11R4 distribution)
+       * All files: Replaced occurrences of #include <X11/copyright.h>
+       with #include "copyright.h"
 
 1991-10-25  Richard Stallman  (rms@mole.gnu.ai.mit.edu)
 
 
 ;; Local Variables:
 ;; coding: iso-2022-7bit-unix
+;; add-log-time-zone-rule: t
 ;; End:
 
     Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001,
diff --git a/s.diff b/s.diff
new file mode 100644 (file)
index 0000000..5fc53fa
--- /dev/null
+++ b/s.diff
@@ -0,0 +1,184 @@
+--- orig/lisp/server.el
++++ mod/lisp/server.el
+@@ -83,18 +83,54 @@
+   "Emacs running as a server process."
+   :group 'external)
++(defcustom server-use-tcp nil
++  "If non-nil, use TCP sockets instead of local sockets."
++  :set #'(lambda (sym val)
++           (unless (featurep 'make-network-process '(:family local))
++             (setq val t)
++             (unless load-in-progress
++               (message "Local sockets unsupported, using TCP sockets")))
++           (when val (random t))
++           (set-default sym val))
++  :group 'server
++  :type 'boolean
++  :version "22.1")
++
++(defcustom server-host nil
++  "The name or IP address to use as host address of the server process.
++If set, the server accepts remote connections; otherwise it is local."
++  :group 'server
++  :type '(choice
++          (string :tag "Name or IP address")
++          (const :tag "Local" nil))
++  :version "22.1")
++(put 'server-host 'risky-local-variable t)
++
++(defcustom server-auth-dir "~/.emacs.d/server/"
++  "Directory for server authentication files."
++  :group 'server
++  :type 'directory
++  :version "22.1")
++(put 'server-auth-dir 'risky-local-variable t)
++
++(defcustom server-raise-frame t
++  "If non-nil, raise frame when switching to a buffer."
++  :group 'server
++  :type 'boolean
++  :version "22.1")
++
+ (defcustom server-visit-hook nil
+-  "*Hook run when visiting a file for the Emacs server."
++  "Hook run when visiting a file for the Emacs server."
+   :group 'server
+   :type 'hook)
+ (defcustom server-switch-hook nil
+-  "*Hook run when switching to a buffer for the Emacs server."
++  "Hook run when switching to a buffer for the Emacs server."
+   :group 'server
+   :type 'hook)
+ (defcustom server-done-hook nil
+-  "*Hook run when done editing a buffer for the Emacs server."
++  "Hook run when done editing a buffer for the Emacs server."
+   :group 'server
+   :type 'hook)
+@@ -113,7 +149,7 @@
+ (put 'server-buffer-clients 'permanent-local t)
+ (defcustom server-window nil
+-  "*Specification of the window to use for selecting Emacs server buffers.
++  "Specification of the window to use for selecting Emacs server buffers.
+ If nil, use the selected window.
+ If it is a function, it should take one argument (a buffer) and
+ display and select it.  A common value is `pop-to-buffer'.
+@@ -132,14 +168,14 @@
+                (function :tag "Other function")))
+ (defcustom server-temp-file-regexp "^/tmp/Re\\|/draft$"
+-  "*Regexp matching names of temporary files.
++  "Regexp matching names of temporary files.
+ These are deleted and reused after each edit by the programs that
+ invoke the Emacs server."
+   :group 'server
+   :type 'regexp)
+ (defcustom server-kill-new-buffers t
+-  "*Whether to kill buffers when done with them.
++  "Whether to kill buffers when done with them.
+ If non-nil, kill a buffer unless it already existed before editing
+ it with Emacs server.  If nil, kill only buffers as specified by
+ `server-temp-file-regexp'.
+@@ -151,7 +187,7 @@
+   :version "21.1")
+ (or (assq 'server-buffer-clients minor-mode-alist)
+-    (setq minor-mode-alist (cons '(server-buffer-clients " Server") minor-mode-alist)))
++    (push '(server-buffer-clients " Server") minor-mode-alist))
+ (defvar server-existing-buffer nil
+   "Non-nil means the buffer existed before the server was asked to visit it.
+@@ -390,11 +426,12 @@
+   (setq dir (directory-file-name dir))
+   (let ((attrs (file-attributes dir)))
+     (unless attrs
+-      (letf (((default-file-modes) ?\700)) (make-directory dir))
++      (letf (((default-file-modes) ?\700)) (make-directory dir t))
+       (setq attrs (file-attributes dir)))
+     ;; Check that it's safe for use.
+     (unless (and (eq t (car attrs)) (eq (nth 2 attrs) (user-uid))
+-               (zerop (logand ?\077 (file-modes dir))))
++                 (or (eq system-type 'windows-nt)
++                     (zerop (logand ?\077 (file-modes dir)))))
+       (error "The directory %s is unsafe" dir))))
+ ;;;###autoload
+@@ -966,10 +1003,10 @@
+       (let ((version-control nil)
+             (buffer-backed-up nil))
+         (save-buffer))
+-      (if (and (buffer-modified-p)
+-             buffer-file-name
+-             (y-or-n-p (concat "Save file " buffer-file-name "? ")))
+-        (save-buffer)))
++      (when (and (buffer-modified-p)
++               buffer-file-name
++               (y-or-n-p (concat "Save file " buffer-file-name "? ")))
++      (save-buffer)))
+     (server-buffer-done (current-buffer))))
+ ;; Ask before killing a server buffer.
+@@ -1027,12 +1064,12 @@
+ starts server process and that is all.  Invoked by \\[server-edit]."
+   (interactive "P")
+   (cond
+-   ((or arg
+-      (not server-process)
+-      (memq (process-status server-process) '(signal exit)))
+-    (server-mode 1))
+-   (server-clients (apply 'server-switch-buffer (server-done)))
+-   (t (message "No server editing buffers exist"))))
++    ((or arg
++         (not server-process)
++         (memq (process-status server-process) '(signal exit)))
++     (server-mode 1))
++    (server-clients (apply 'server-switch-buffer (server-done)))
++    (t (message "No server editing buffers exist"))))
+ (defun server-switch-buffer (&optional next-buffer killed-one)
+   "Switch to another buffer, preferably one that has a client.
+@@ -1065,21 +1102,19 @@
+       (let ((win (get-buffer-window next-buffer 0)))
+         (if (and win (not server-window))
+             ;; The buffer is already displayed: just reuse the window.
+-            (let ((frame (window-frame win)))
+-              (if (eq (frame-visible-p frame) 'icon)
+-                  (raise-frame frame))
+-              (select-window win)
+-              (set-buffer next-buffer))
++              (progn
++                (select-window win)
++                (set-buffer next-buffer))
+           ;; Otherwise, let's find an appropriate window.
+           (cond ((and (windowp server-window)
+                       (window-live-p server-window))
+                  (select-window server-window))
+                 ((framep server-window)
+-                 (if (not (frame-live-p server-window))
+-                     (setq server-window (make-frame)))
++                 (unless (frame-live-p server-window)
++                   (setq server-window (make-frame)))
+                  (select-window (frame-selected-window server-window))))
+-          (if (window-minibuffer-p (selected-window))
+-              (select-window (next-window nil 'nomini 0)))
++          (when (window-minibuffer-p (selected-window))
++            (select-window (next-window nil 'nomini 0)))
+           ;; Move to a non-dedicated window, if we have one.
+           (when (window-dedicated-p (selected-window))
+             (select-window
+@@ -1093,7 +1128,9 @@
+               (switch-to-buffer next-buffer)
+             ;; After all the above, we might still have ended up with
+             ;; a minibuffer/dedicated-window (if there's no other).
+-            (error (pop-to-buffer next-buffer)))))))))
++            (error (pop-to-buffer next-buffer)))))))
++    (when server-raise-frame
++      (select-frame-set-input-focus (window-frame (selected-window))))))
+ ;;;###autoload
+ (defun server-save-buffers-kill-terminal (proc &optional arg)
index 27a229b..506ee83 100644 (file)
@@ -1,4 +1,406 @@
-2006-10-29  Mark Davies  <mark@mcs.vuw.ac.nz> (tiny change)
+2006-12-01  Eli Zaretskii  <eliz@gnu.org>
+
+       * w32fns.c (Fw32_shell_execute): Doc fix.
+
+2006-11-30  Chong Yidong  <cyd@stupidchicken.com>
+
+       * xdisp.c (move_it_to): Correctly count tab glyphs for continued
+       lines ending in tab.
+
+2006-11-30  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * xterm.c (x_raise_frame): Move setting of _NET_ACTIVE_WINDOW
+       property ...
+       (XTframe_raise_lower): ... to here.
+
+2006-11-30  Kenichi Handa  <handa@m17n.org>
+
+       * regex.c (regex_compile): Fix previous change.
+
+2006-11-29  Juanma Barranquero  <lekktu@gmail.com>
+
+       * sound.c (Fplay_sound_internal): Remove spurious newline in docstring.
+
+2006-11-28  Chong Yidong  <cyd@stupidchicken.com>
+
+       * config.in: Regenerate.
+
+2006-11-28  Kenichi Handa  <handa@m17n.org>
+
+       * regex.c (regex_compile): Don't call SET_LIST_BIT with a
+       multibyte character.
+
+2006-11-27  Chong Yidong  <cyd@stupidchicken.com>
+
+       * s/aix4-2.h: Undefine _NO_PROTO.  Suggested by Joe Buehler.
+
+2006-11-27  Kim F. Storm  <storm@cua.dk>
+
+       * window.c (set_window_buffer): Refactor recent changes.
+
+2006-11-27  Jason Rumney  <jasonr@gnu.org>
+
+       * w32term.c (w32_msg_worker): Declare correctly.
+       (w32_initialize): Don't cast w32_msg_worker.
+
+       * w32fns.c (w32_msg_worker): Define as WINAPI and arg as void pointer.
+
+2006-11-26  Chong Yidong  <cyd@stupidchicken.com>
+
+       * m/amdx86-64.h: Look for standard libs in /usr/lib64 only if that
+       directory exists.
+
+2006-11-25  Eli Zaretskii  <eliz@gnu.org>
+
+       * w16select.c (Fw16_set_clipboard_data): Fix the call to sit_for
+       as per the calling sequence change on 2006-07-11.
+
+2006-11-25  Chong Yidong  <cyd@stupidchicken.com>
+
+       * window.c (set_window_buffer): Use BLOCK_INPUT.
+
+2006-11-24  Juanma Barranquero  <lekktu@gmail.com>
+
+       * fns.c (substring_both): Add missing address operator.
+
+2006-11-24  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * fns.c: Use AREF/ASIZE macros.
+       (concat): Provide the full ANSI prototype.
+
+2006-11-24  Juanma Barranquero  <lekktu@gmail.com>
+
+       * buffer.c (syms_of_buffer) <buffer-undo-list>: Doc fix.
+
+2006-11-23  William Smith  <William.Smith@global360.com>  (tiny change)
+
+       * strftime.c (HAVE_SYS__MBSTATE_T_H): Fix typo.
+
+2006-11-02  Alfred M. Szmidt  <ams@gnu.org>  (tiny change)
+
+       * s/openbsd.h (LD_SWITCH_SYSTEM): Remove /usr/pkg/lib and
+       /usr/pkg/lib from the library search path.
+       (LD_SWITCH_X_DEFAULT): New macro.
+
+2006-11-22  Chong Yidong  <cyd@stupidchicken.com>
+
+       * window.c (set_window_buffer): Clear mouse highlight if it is in
+       this window.
+
+2006-11-21  Chong Yidong  <cyd@stupidchicken.com>
+
+       * xfaces.c (realize_default_face): Check if the default font name
+       exists on this display before trying to use it.
+
+2006-11-21  Richard Stallman  <rms@gnu.org>
+
+       * fileio.c: Break line before &&, not after.
+
+2006-11-20  Eli Zaretskii  <eliz@gnu.org>
+
+       * fns.c (concat) [!__GNUC__]: Add prototype.
+
+2006-11-20  Kenichi Handa  <handa@m17n.org>
+
+       * fileio.c (Fread_file_name_internal): Use SBYTES (not SCHARS) to
+       check the tailing slash of a filename.
+
+2006-11-20  KOBAYASHI Yasuhiro  <kobayays@otsukakj.co.jp>  (tiny change)
+
+       * indent.c (Fvertical_motion): Include composition in the case of
+       overshoot expected.
+
+2006-11-19  Andreas Schwab  <schwab@gnu.org>
+
+       * xfaces.c (Fdisplay_supports_face_attributes_p): Initialize supports.
+
+       * xmenu.c (Fx_popup_menu): Initialize selection.
+
+2006-11-18  Andreas Schwab  <schwab@suse.de>
+
+       * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Update call to mark_memory.
+
+2006-11-17  Tetsurou Okazaki  <okazaki@be.to>  (tiny change)
+
+       * xterm.c (do_ewmh_fullscreen): Declare variable before XSETFRAME
+       to avoid gcc 2.96 error.
+
+2006-11-17  NIIMI Satoshi  <sa2c@sa2c.net>  (tiny change)
+
+       * search.c (simple_search): In the loop of backward searching,
+       check also the byte position against the limit.
+
+2006-11-14  Romain Francoise  <romain@orebokech.com>
+
+       * minibuf.c (Fcompleting_read): Fix typo in docstring.
+
+2006-11-14  Kenichi Handa  <handa@m17n.org>
+
+       * coding.c (code_convert_region): Initialize coding->heading_ascii.
+       (decode_coding_string, code_convert_region): Likewise.
+
+2006-11-14  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * config.in: Regenerate.
+
+       * macfns.c (Fx_display_mm_height, Fx_display_mm_width)
+       [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
+       && MAC_OS_X_VERSION_MIN_REQUIRED == 1020]: Check if
+       CGDisplayScreenSize is available.
+
+       * macmenu.c (menu_quit_handler, install_menu_quit_handler):
+       Replace `#ifdef HAVE_CANCELMENUTRACKING' with
+       `#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030'.
+       (install_menu_quit_handler) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
+       && MAC_OS_X_VERSION_MIN_REQUIRED == 1020]: Check if
+       CancelMenuTracking is available.
+
+       * macterm.c [USE_CG_TEXT_DRAWING] (mac_draw_image_string_cg)
+       [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
+       && MAC_OS_X_VERSION_MIN_REQUIRED == 1020]: Check if
+       CGContextShowGlyphsWithAdvances is available.
+
+2006-11-13  Jason Rumney  <jasonr@gnu.org>
+
+       * s/ms-w32.h: Define HAVE_INET_SOCKETS.
+
+2006-11-13  Nozomu Ando  <nand@mac.com>
+
+       * alloc.c (mark_memory): New argument OFFSET.  All uses changed.
+       Fix address calculations for case END < START.
+       (mark_stack): Impose Lisp_Object alignment on jmp_buf.
+
+2006-11-12  Juanma Barranquero  <lekktu@gmail.com>
+
+       * coding.c (Fencode_sjis_char, Fencode_big5_char):
+       Improve argument/docstring consistency.
+
+       * editfns.c (Fmessage): Doc fixes.
+
+       * process.c (syms_of_process) <delete-exited-processes>: Doc fix.
+
+2006-11-12  Chong Yidong  <cyd@stupidchicken.com>
+
+       * xmenu.c (popup_activated): Define outside HAVE_MENUS.
+
+2006-11-12  Romain Francoise  <romain@orebokech.com>
+
+       * xselect.c (selection-coding-system): Fix docstring.
+
+2006-11-12  Juanma Barranquero  <lekktu@gmail.com>
+
+       * category.c (Fchar_category_set): Improve arg/docstring consistency.
+
+       * data.c (Flogxor):
+       * fns.c (Frandom, Flength, Fsafe_length, Fstring_bytes)
+       (Fstring_equal, Fcompare_strings, Fstring_lessp, Fcopy_sequence)
+       (Fstring_make_unibyte): Fix typos in docstrings.
+
+2006-11-10  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * xterm.h (struct x_display_info): Fix indentation.
+
+       * xterm.c (do_ewmh_fullscreen, XTfullscreen_hook): New functions.
+       (x_check_fullscreen): Call do_ewmh_fullscreen.
+       (x_initialize): Set fullscreen_hook to XTfullscreen_hook.
+
+       * frame.c (x_set_fullscreen): Call fullscreen_hook if set.
+
+       * term.c: Define fullscreen_hook.
+       (syms_of_term): Initialize fullscreen_hook to NULL.
+
+       * termhooks.h: Add fullscreen_hook.
+
+2006-11-08  Juanma Barranquero  <lekktu@gmail.com>
+
+       * bytecode.c (Fbyte_code):
+       * data.c (Fmakunbound): Use SYMBOL_CONSTANT_P macro.
+
+2006-11-06  Juanma Barranquero  <lekktu@gmail.com>
+
+       * lread.c (syms_of_lread):
+       * xsmfns.c (syms_of_xsmfns): Fix typo in docstring.
+
+2006-11-06  Martin Rudalics  <rudalics@gmx.at>
+
+       * macmenu.c (Fmenu_or_popup_active_p): Define outside HAVE_MENUS.
+
+       * w32menu.c (Fmenu_or_popup_active_p): Define outside HAVE_MENUS.
+       Return nil if building without menus.
+
+       * xmenu.c (Fmenu_or_popup_active_p): Define outside HAVE_MENUS.
+       Return nil if building without menus.
+
+2006-11-05  Mark Davies  <mark@mcs.vuw.ac.nz>  (tiny change)
+
+       * s/netbsd.h (POSIX_SIGNALS): Define.
+
+2006-11-05  Martin Rudalics  <rudalics@gmx.at>
+
+       * macmenu.c (Fmenu_or_popup_active_p): New function.
+       (syms_of_macmenu): Defsubr it.
+
+       * w32menu.c (Fmenu_or_popup_active_p): New function.
+       (syms_of_w32menu): Defsubr it.
+       (popup_activated_flag, popup_activated): Remove.
+
+       * xdisp.c (note_mouse_highlight) [HAVE_NTGUI]: Don't bother to
+       check popup_activated.
+
+       * xmenu.c (Fmenu_or_popup_active_p): New function.
+       (syms_of_xmenu): Defsubr it.
+
+2006-11-05  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * unexmacosx.c (malloc_cookie): Remove unused variable.
+       (region_list_head, region_list_tail, lca, nlc, infile_lc_highest_addr)
+       (text_seg_lowest_offset, mh, curr_header_offset, infd, outfd)
+       (emacs_zone, data_segment_old_fileoff, data_segment_scp)
+       (num_unexec_regions, unexec_regions): Make variables static.
+       (print_regions, find_emacs_zone_regions): Make static.
+       (unexec_region_info): New typedef.
+       (unexec_regions): Change type from vm_range_t[] to unexec_region_info[].
+       All uses changed.
+       (unexec_regions_recorder): Subtract size of trailing null pages from
+       filesize.  Show filesize.
+       (unexec_regions_merge): Don't merge if null pages of preceding region
+       is not too small.  Use long format in printf.
+       (copy_segment, copy_data_segment): Show filesize.
+       (copy_data_segment): Write filesize bytes of region data.
+       Adjust filesize in segment command accordingly.
+       (dump_it): Use long format in printf.
+
+2006-11-05  Juanma Barranquero  <lekktu@gmail.com>
+
+       * dosfns.c (Finsert_startup_screen):
+       * fns.c (Ffeaturep, syms_of_fns):
+       * frame.c (syms_of_frame): Fix typos in docstrings.
+
+       * unexcw.c (unexec): Fix typo in output message.
+
+2006-11-04  Ralf Angeli  <angeli@caeruleus.net>
+
+       * w32fns.c (w32_createwindow): Remove code for handling -geometry
+       command line option and `initial-frame-alist' which is superfluous
+       after the last change to `w32_createwindow'.
+
+2006-11-04  Slawomir Nowaczyk  <slawek@cs.lth.se>  (tiny change)
+
+       * w32proc.c (sys_wait): Only wait for processes with fd<0.
+       Others should be handled by sys_select instead.  Fixes problems
+       with (progn (start-process "" nil "ls") (call-process "ls")).
+
+2006-11-04  Giorgos Keramidas  <keramida@ceid.upatras.gr>  (tiny change)
+
+       * xmenu.c (Fmenu_bar_open): Declare variable before BLOCK_INPUT to
+       avoid gcc 2.95 error.
+
+2006-11-04  Chong Yidong  <cyd@stupidchicken.com>
+
+       * gtkutil.c (update_frame_tool_bar): If icon image is invalid and
+       wicon is null, insert an empty button.
+
+2006-11-03  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * xterm.c (x_raise_frame): Send _NET_ACTIVE_WINDOW when raising the
+       window.
+
+2006-11-02  Juanma Barranquero  <lekktu@gmail.com>
+
+       * emacs.c (Fkill_emacs): Fix typo in docstring.
+
+2006-11-02  Nozomu Ando  <nand@mac.com>
+
+       * unexmacosx.c (mach_header, segment_command, vm_region, section)
+       [_LP64]: New defines.
+       (VM_REGION_BASIC_INFO_COUNT, VM_REGION_BASIC_INFO, LC_SEGMENT)
+       (MH_MAGIC) [_LP64]: Redefine.
+       (delta): Remove variable.
+       (curr_file_offset, pagesize): New variables.
+       (ROUNDUP_TO_PAGE_BOUNDARY): New macro.
+       (data_segment_old_fileoff): Initialize explicitly.
+       (print_region, unexec_regions_recorder, print_load_command_name)
+       (copy_segment, copy_data_segment): Use long format in printf.
+       (MAX_UNEXEC_REGIONS): Increase to 400.
+       (unexec_regions_recorder): Don't warn too many regions here.
+       (find_emacs_zone_regions): Warn too many regions here.
+       (print_load_command_name) [_LP64]: Show correct load command name.
+       (copy_segment, copy_data_segment): Use variable `curr_file_offset'.
+       Show starting virtual memory address.  Don't show ending file offset.
+       (copy_symtab, copy_dysymtab, copy_twolevelhints): New argument DELTA.
+       (dump_it): Use new local variable `linkedit_delta' and pass to them.
+       Error if trying to handle multiple DATA segments.
+       (unexec): Initialize variable `pagesize'.
+
+2006-11-01  Juanma Barranquero  <lekktu@gmail.com>
+
+       * eval.c (Fcatch): Doc fix.
+
+2006-10-31  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * image.c [MAC_OS] (image_load_qt_1, xpm_scan, xpm_make_color_table_v)
+       (xpm_put_color_table_v, xpm_get_color_table_v, xpm_make_color_table_h)
+       (xpm_put_color_table_h, xpm_get_color_table_h, xpm_str_to_color_key)
+       (xpm_load_image): Add const qualifier to arguments.
+       [MAC_OS] (xpm_color_key_strings): Make static const.
+
+       * mac.c (create_apple_event_from_event_ref)
+       (create_apple_event_from_drag_ref, skip_white_space, parse_comment)
+       (parse_include_file, parse_binding, parse_component)
+       (parse_resource_name, parse_value, parse_resource_line)
+       (xrm_merge_string_database, xrm_get_resource)
+       (xrm_get_preference_database): Add const qualifier to arguments.
+       [MAC_OSX] (sys_select): Make variable `context' static const.
+
+       * macfns.c (mac_color_map): Make static const.
+       (mac_color_map_lookup): Add const qualifier to arguments.
+
+       * macmenu.c (install_menu_quit_handler): Make variable `typesList'
+       static const.
+       (name_is_separator): Add const qualifier to arguments.
+
+       * macselect.c (init_service_handler): Make variable `specs' static
+       const.
+
+       * macterm.c (mac_create_bitmap_from_bitmap_data): Make variable
+       `swap_nibbles' static const.
+       (atsu_get_text_layout_with_text_ptr): Make variables `lengths',
+       `tags', `sizes', `values' static const.
+       (mac_draw_string_common): Make variables `context' static.
+       Make variables `tags', `sizes', and `values' static const.
+       (pcm_get_status, x_detect_focus_change, x_scroll_bar_handle_click)
+       (xlfdpat_create, xlfdpat_block_match_1, xlfdpat_match)
+       (mac_to_x_fontname, parse_x_font_name, add_mac_font_name)
+       (mac_do_list_fonts, is_fully_specified_xlfd, do_grow_window)
+       (mac_store_event_ref_as_apple_event, mac_make_rdb): Add const
+       qualifier to arguments.
+       (xlfd_scalable_fields, keycode_to_xkeysym_table)
+       (fn_keycode_to_keycode_table): Make static const.
+       (mac_load_query_font): Make variables `tags', `sizes', `values',
+       `types', and `selectors' static const.
+       (mac_handle_command_event, mac_handle_window_event):
+       Make variables `names' and `types' static const.
+       (init_command_handler, install_window_handler): Make variables
+       `specs*' static const.
+       (mac_handle_font_event, mac_handle_text_input_event)
+       (mac_store_service_event): Make variables `names' and `types'
+       const.  Make variables `names_*' and `types_*' static const.
+
+       * macterm.h (create_apple_event_from_event_ref)
+       (create_apple_event_from_drag_ref, xrm_merge_string_database)
+       (xrm_get_resource, xrm_get_preference_database): Add const
+       qualifier to arguments in externs.
+
+2006-10-31  Kenichi Handa  <handa@m17n.org>
+
+       * xfns.c (xic_create_xfontset): Fix previous change.
+
+2006-10-30  Chong Yidong  <cyd@stupidchicken.com>
+
+       * s/openbsd.h (LD_SWITCH_SYSTEM): Add /usr/pkg/lib and
+       /usr/pkg/lib to library search path.
+
+2006-10-29  Mark Davies  <mark@mcs.vuw.ac.nz>  (tiny change)
 
        * ralloc.c (relinquish): Use a long for excess space counter to
        handle 64-bit case correctly.
 2006-10-16  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
 
        * gtkutil.c (get_utf8_string): Remove warnings with casts.
-       (xg_tool_bar_button_cb): Ditto
+       (xg_tool_bar_button_cb): Ditto.
        (xg_tool_bar_callback): Ditto.
 
 2006-10-16  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
        * editfns.c (Fsystem_name): Mention "host" in the doc string.
        (syms_of_editfns) <system-name>: Likewise.
 
-2006-08-27  Martin Rudalics  <rudalics@gmx.at>
+2006-09-08  Martin Rudalics  <rudalics@gmx.at>
 
        * xdisp.c (mouse_autoselect_window): Remove.
        (Vmouse_autoselect_window): New variable.  DEFVAR_LISP it.
        precedence.
        (XTread_socket) [TARGET_API_MAC_CARBON]: Don't specify drag area.
 
-2004-10-05  Jan Dj\e,Ad\e(Brv.  <jan.h.d@swipnet.se>
+2004-10-05  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
 
        * config.in: Regenerate.
 
        Set BUF_INTERVALS (buffer)->up_obj when appropriate.
        Handle over_used when splitting UNDER.
 
-2003-09-30  YAMAMOTO  Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+2003-09-30  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
        * regex.c (regex_compile): Free the stack when returning from function.
 
 
        * alloca.c: Undo ifdef change accidentally made on 12-04.
 
-2002-12-06  Francesco Potorti`  <pot@gnu.org>
+2002-12-06  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * xfns.c (png_load): Avoid double gamma correction for PNG images.
 
        * fns.c (Fcopy_sequence): Doc fix.
        (Fmap_char_table): Cast `call2'.
 
-2002-11-14  Francesco Potorti`  <pot@gnu.org>
+2002-11-14  Francesco Potort\e,Al\e(B  <pot@gnu.org>
 
        * s/sol2-8.h: New file.
 
@@ -26188,6 +26590,7 @@ See ChangeLog.9 for earlier changes.
 
 ;; Local Variables:
 ;; coding: iso-2022-7bit
+;; add-log-time-zone-rule: t
 ;; End:
 
     Copyright (C) 2001, 2002, 2003, 2004, 2005,
index 2f186fd..c49d3b5 100644 (file)
@@ -480,7 +480,7 @@ static int live_symbol_p P_ ((struct mem_node *, void *));
 static int live_float_p P_ ((struct mem_node *, void *));
 static int live_misc_p P_ ((struct mem_node *, void *));
 static void mark_maybe_object P_ ((Lisp_Object));
-static void mark_memory P_ ((void *, void *));
+static void mark_memory P_ ((void *, void *, int));
 static void mem_init P_ ((void));
 static struct mem_node *mem_insert P_ ((void *, void *, enum mem_type));
 static void mem_insert_fixup P_ ((struct mem_node *));
@@ -4330,11 +4330,13 @@ mark_maybe_pointer (p)
 }
 
 
-/* Mark Lisp objects referenced from the address range START..END.  */
+/* Mark Lisp objects referenced from the address range START+OFFSET..END
+   or END+OFFSET..START. */
 
 static void
-mark_memory (start, end)
+mark_memory (start, end, offset)
      void *start, *end;
+     int offset;
 {
   Lisp_Object *p;
   void **pp;
@@ -4353,7 +4355,7 @@ mark_memory (start, end)
     }
 
   /* Mark Lisp_Objects.  */
-  for (p = (Lisp_Object *) start; (void *) p < end; ++p)
+  for (p = (Lisp_Object *) ((char *) start + offset); (void *) p < end; ++p)
     mark_maybe_object (*p);
 
   /* Mark Lisp data pointed to.  This is necessary because, in some
@@ -4374,7 +4376,7 @@ mark_memory (start, end)
      away.  The only reference to the life string is through the
      pointer `s'.  */
 
-  for (pp = (void **) start; (void *) pp < end; ++pp)
+  for (pp = (void **) ((char *) start + offset); (void *) pp < end; ++pp)
     mark_maybe_pointer (*pp);
 }
 
@@ -4553,7 +4555,11 @@ static void
 mark_stack ()
 {
   int i;
-  jmp_buf j;
+  /* jmp_buf may not be aligned enough on darwin-ppc64 */
+  union aligned_jmpbuf {
+    Lisp_Object o;
+    jmp_buf j;
+  } j;
   volatile int stack_grows_down_p = (char *) &j > (char *) stack_base;
   void *end;
 
@@ -4584,7 +4590,7 @@ mark_stack ()
     }
 #endif /* GC_SETJMP_WORKS */
 
-  setjmp (j);
+  setjmp (j.j);
   end = stack_grows_down_p ? (char *) &j + sizeof j : (char *) &j;
 #endif /* not GC_SAVE_REGISTERS_ON_STACK */
 
@@ -4599,7 +4605,7 @@ mark_stack ()
 #endif
 #endif
   for (i = 0; i < sizeof (Lisp_Object); i += GC_LISP_OBJECT_ALIGNMENT)
-    mark_memory ((char *) stack_base + i, end);
+    mark_memory (stack_base, end, i);
   /* Allow for marking a secondary stack, like the register stack on the
      ia64.  */
 #ifdef GC_MARK_SECONDARY_STACK
index f2f15a5..0555591 100644 (file)
@@ -5948,8 +5948,8 @@ An entry of the form POSITION indicates that point was at the buffer
 location given by the integer.  Undoing an entry of this form places
 point at POSITION.
 
-nil marks undo boundaries.  The undo command treats the changes
-between two undo boundaries as a single step to be undone.
+Entries with value `nil' mark undo boundaries.  The undo command treats
+the changes between two undo boundaries as a single step to be undone.
 
 If the value of the variable is t, undo information is not recorded.  */);
 
index 2facaa4..f965353 100644 (file)
@@ -597,7 +597,7 @@ If the third argument is incorrect, Emacs may crash.  */)
            if (SYMBOLP (sym)
                && !EQ (val, Qunbound)
                && !XSYMBOL (sym)->indirect_variable
-               && !XSYMBOL (sym)->constant
+               && !SYMBOL_CONSTANT_P (sym)
                && !MISCP (XSYMBOL (sym)->value))
              XSYMBOL (sym)->value = val;
            else
index 6835d00..d717805 100644 (file)
@@ -284,7 +284,8 @@ Return TABLE.  */)
 
 \f
 DEFUN ("char-category-set", Fchar_category_set, Schar_category_set, 1, 1, 0,
-       doc: /* Return the category set of CHAR.  */)
+       doc: /* Return the category set of CHAR.
+usage: (char-category-set CHAR)  */)
      (ch)
      Lisp_Object ch;
 {
index 24c6ef0..53661fc 100644 (file)
@@ -5577,6 +5577,8 @@ code_convert_region (from, from_byte, to, to_byte, coding, encodep, replace)
       inhibit_modification_hooks = saved_inhibit_modification_hooks;
     }
 
+  coding->heading_ascii = 0;
+
   if (! encodep && CODING_REQUIRE_DETECTION (coding))
     {
       /* We must detect encoding of text and eol format.  */
@@ -6221,6 +6223,8 @@ decode_coding_string (str, coding, nocopy)
   saved_coding_symbol = coding->symbol;
   coding->src_multibyte = STRING_MULTIBYTE (str);
   coding->dst_multibyte = 1;
+  coding->heading_ascii = 0;
+
   if (CODING_REQUIRE_DETECTION (coding))
     {
       /* See the comments in code_convert_region.  */
@@ -6433,6 +6437,7 @@ encode_coding_string (str, coding, nocopy)
   /* Try to skip the heading and tailing ASCIIs.  We can't skip them
      if we must run CCL program or there are compositions to
      encode.  */
+  coding->heading_ascii = 0;
   if (coding->type != coding_type_ccl
       && (! coding->cmp_data || coding->cmp_data->used == 0))
     {
@@ -7270,7 +7275,7 @@ Return the corresponding character.  */)
 }
 
 DEFUN ("encode-sjis-char", Fencode_sjis_char, Sencode_sjis_char, 1, 1, 0,
-       doc: /* Encode a Japanese character CHAR to shift_jis encoding.
+       doc: /* Encode a Japanese character CH to shift_jis encoding.
 Return the corresponding code in SJIS.  */)
      (ch)
      Lisp_Object ch;
@@ -7330,7 +7335,7 @@ Return the corresponding character.  */)
 }
 
 DEFUN ("encode-big5-char", Fencode_big5_char, Sencode_big5_char, 1, 1, 0,
-       doc: /* Encode the Big5 character CHAR to BIG5 coding system.
+       doc: /* Encode the Big5 character CH to BIG5 coding system.
 Return the corresponding character code in Big5.  */)
      (ch)
      Lisp_Object ch;
index 51f4aaa..2105247 100644 (file)
@@ -99,9 +99,6 @@ Boston, MA 02110-1301, USA.  */
 /* Define to 1 if you have the `bzero' function. */
 #undef HAVE_BZERO
 
-/* Define to 1 if CancelMenuTracking is available (Mac OSX). */
-#undef HAVE_CANCELMENUTRACKING
-
 /* Define to 1 if you are using the Carbon API on Mac OS X. */
 #undef HAVE_CARBON
 
@@ -697,6 +694,9 @@ Boston, MA 02110-1301, USA.  */
 /* Define to 1 if you have the X11R6 or newer version of Xt. */
 #undef HAVE_X11XTR6
 
+/* Define to 1 if the file /usr/lib64 exists. */
+#undef HAVE_X86_64_LIB64_DIR
+
 /* Define to 1 if you have the Xaw3d library (-lXaw3d). */
 #undef HAVE_XAW3D
 
index cc15431..cc0f967 100644 (file)
@@ -607,7 +607,7 @@ Return SYMBOL.  */)
      register Lisp_Object symbol;
 {
   CHECK_SYMBOL (symbol);
-  if (XSYMBOL (symbol)->constant)
+  if (SYMBOL_CONSTANT_P (symbol))
     xsignal1 (Qsetting_constant, symbol);
   Fset (symbol, Qunbound);
   return symbol;
@@ -2884,7 +2884,7 @@ usage: (logior &rest INTS-OR-MARKERS)  */)
 DEFUN ("logxor", Flogxor, Slogxor, 0, MANY, 0,
        doc: /* Return bitwise-exclusive-or of all the arguments.
 Arguments may be integers, or markers converted to integers.
-usage: (logxor &rest INTS-OR-MARKERS) */)
+usage: (logxor &rest INTS-OR-MARKERS)  */)
      (nargs, args)
      int nargs;
      Lisp_Object *args;
index 22aaa62..92b90e5 100644 (file)
@@ -213,7 +213,7 @@ DEFUN ("msdos-mouse-disable", Fmsdos_mouse_disable, Smsdos_mouse_disable, 0, 0,
 }
 
 DEFUN ("insert-startup-screen", Finsert_startup_screen, Sinsert_startup_screen, 0, 0, "",
-       doc: /* Insert copy of screen contents prior to starting emacs.
+       doc: /* Insert copy of screen contents prior to starting Emacs.
 Return nil if startup screen is not available.  */)
      ()
 {
index 71b518a..39f8f87 100644 (file)
@@ -3171,9 +3171,10 @@ static char *message_text;
 static int message_length;
 
 DEFUN ("message", Fmessage, Smessage, 1, MANY, 0,
-       doc: /* Print a one-line message at the bottom of the screen.
+       doc: /* Display a message at the bottom of the screen.
 The message also goes into the `*Messages*' buffer.
 \(In keyboard macros, that's all it does.)
+Return the message.
 
 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.
index 26a0c4d..76ad59c 100644 (file)
@@ -2055,7 +2055,7 @@ sort_args (argc, argv)
 DEFUN ("kill-emacs", Fkill_emacs, Skill_emacs, 0, 1, "P",
        doc: /* Exit the Emacs job and kill it.
 If ARG is an integer, return ARG as the exit program code.
-If ARG is a  string, stuff it as keyboard input.
+If ARG is a string, stuff it as keyboard input.
 
 The value of `kill-emacs-hook', if not void,
 is a list of functions (of no args),
index 3c9a0c0..c587142 100644 (file)
@@ -1174,7 +1174,7 @@ DEFUN ("catch", Fcatch, Scatch, 1, UNEVALLED, 0,
 TAG is evalled to get the tag to use; it must not be nil.
 
 Then the BODY is executed.
-Within BODY, (throw TAG) with same tag exits BODY and exits this `catch'.
+Within BODY, a call to `throw' with the same TAG exits BODY and this `catch'.
 If no throw happens, `catch' returns the value of the last BODY form.
 If a throw happens, it specifies the value to return from `catch'.
 usage: (catch TAG BODY...)  */)
index 62d539d..e6a4314 100644 (file)
@@ -1250,9 +1250,9 @@ See also the function `substitute-in-file-name'.  */)
              }
            else
 #endif /* NO_HYPHENS_IN_FILENAMES */
-             if (lbrack > rbrack &&
-                 ((p[-1] == '.' || p[-1] == '[' || p[-1] == '<') &&
-                  (p[1] == '.' || p[1] == ']' || p[1] == '>')))
+             if (lbrack > rbrack
+                 && ((p[-1] == '.' || p[-1] == '[' || p[-1] == '<')
+                     && (p[1] == '.' || p[1] == ']' || p[1] == '>')))
                lose = 1;
 #ifdef NO_HYPHENS_IN_FILENAMES
              else
@@ -1621,8 +1621,8 @@ See also the function `substitute-in-file-name'.  */)
          else if (*p == '-' && *o != '.')
            *--p = '.';
        }
-      else if (p[0] == '-' && o[-1] == '.' &&
-              (p[1] == '.' || p[1] == ']' || p[1] == '>'))
+      else if (p[0] == '-' && o[-1] == '.'
+              && (p[1] == '.' || p[1] == ']' || p[1] == '>'))
        /* flush .foo.- ; leave - if stopped by '[' or '<' */
        {
          do
@@ -1637,9 +1637,9 @@ See also the function `substitute-in-file-name'.  */)
       else
        {
 #ifdef NO_HYPHENS_IN_FILENAMES
-         if (*p == '-' &&
-             o[-1] != '[' && o[-1] != '<' && o[-1] != '.' &&
-             p[1] != ']' && p[1] != '>' && p[1] != '.')
+         if (*p == '-'
+             && o[-1] != '[' && o[-1] != '<' && o[-1] != '.'
+             && p[1] != ']' && p[1] != '>' && p[1] != '.')
            *p = '_';
 #endif /* NO_HYPHENS_IN_FILENAMES */
          *o++ = *p++;
@@ -1822,9 +1822,9 @@ See also the function `substitute-in-file-name'.")
              }
            else
 #endif /* VMS4_4 */
-             if (lbrack > rbrack &&
-                 ((p[-1] == '.' || p[-1] == '[' || p[-1] == '<') &&
-                  (p[1] == '.' || p[1] == ']' || p[1] == '>')))
+             if (lbrack > rbrack
+                 && ((p[-1] == '.' || p[-1] == '[' || p[-1] == '<')
+                     && (p[1] == '.' || p[1] == ']' || p[1] == '>')))
                lose = 1;
 #ifndef VMS4_4
              else
@@ -1993,8 +1993,8 @@ See also the function `substitute-in-file-name'.")
          else if (*p == '-' && *o != '.')
            *--p = '.';
        }
-      else if (p[0] == '-' && o[-1] == '.' &&
-              (p[1] == '.' || p[1] == ']' || p[1] == '>'))
+      else if (p[0] == '-' && o[-1] == '.'
+              && (p[1] == '.' || p[1] == ']' || p[1] == '>'))
        /* flush .foo.- ; leave - if stopped by '[' or '<' */
        {
          do
@@ -2009,9 +2009,9 @@ See also the function `substitute-in-file-name'.")
       else
        {
 #ifndef VMS4_4
-         if (*p == '-' &&
-             o[-1] != '[' && o[-1] != '<' && o[-1] != '.' &&
-             p[1] != ']' && p[1] != '>' && p[1] != '.')
+         if (*p == '-'
+             && o[-1] != '[' && o[-1] != '<' && o[-1] != '.'
+             && p[1] != ']' && p[1] != '>' && p[1] != '.')
            *p = '_';
 #endif /* VMS4_4 */
          *o++ = *p++;
@@ -2031,8 +2031,8 @@ See also the function `substitute-in-file-name'.")
          o = target;
          p++;
        }
-      else if (p[0] == '/' && p[1] == '.' &&
-              (p[2] == '/' || p[2] == 0))
+      else if (p[0] == '/' && p[1] == '.'
+              && (p[2] == '/' || p[2] == 0))
        p += 2;
       else if (!strncmp (p, "/..", 3)
               /* `/../' is the "superroot" on certain file systems.  */
@@ -6203,9 +6203,9 @@ DEFUN ("read-file-name-internal", Fread_file_name_internal, Sread_file_name_inte
            {
              Lisp_Object tem = XCAR (all);
              int len;
-             if (STRINGP (tem) &&
-                 (len = SCHARS (tem), len > 0) &&
-                 IS_DIRECTORY_SEP (SREF (tem, len-1)))
+             if (STRINGP (tem)
+                 && (len = SBYTES (tem), len > 0)
+                 && IS_DIRECTORY_SEP (SREF (tem, len-1)))
                comp = Fcons (tem, comp);
            }
        }
index 31774e7..709b588 100644 (file)
--- a/src/fns.c
+++ b/src/fns.c
@@ -103,7 +103,7 @@ DEFUN ("random", Frandom, Srandom, 0, 1, 0,
 All integers representable in Lisp are equally likely.
   On most systems, this is 29 bits' worth.
 With positive integer argument N, return random number in interval [0,N).
-With argument t, set the random number seed from the current time and pid. */)
+With argument t, set the random number seed from the current time and pid.  */)
      (n)
      Lisp_Object n;
 {
@@ -140,7 +140,7 @@ DEFUN ("length", Flength, Slength, 1, 1, 0,
 A byte-code function object is also allowed.
 If the string contains multibyte characters, this is not necessarily
 the number of bytes in the string; it is the number of characters.
-To get the number of bytes, use `string-bytes'. */)
+To get the number of bytes, use `string-bytes'.  */)
      (sequence)
      register Lisp_Object sequence;
 {
@@ -150,7 +150,7 @@ To get the number of bytes, use `string-bytes'. */)
   if (STRINGP (sequence))
     XSETFASTINT (val, SCHARS (sequence));
   else if (VECTORP (sequence))
-    XSETFASTINT (val, XVECTOR (sequence)->size);
+    XSETFASTINT (val, ASIZE (sequence));
   else if (SUB_CHAR_TABLE_P (sequence))
     XSETFASTINT (val, SUB_CHAR_TABLE_ORDINARY_SLOTS);
   else if (CHAR_TABLE_P (sequence))
@@ -158,7 +158,7 @@ To get the number of bytes, use `string-bytes'. */)
   else if (BOOL_VECTOR_P (sequence))
     XSETFASTINT (val, XBOOL_VECTOR (sequence)->size);
   else if (COMPILEDP (sequence))
-    XSETFASTINT (val, XVECTOR (sequence)->size & PSEUDOVECTOR_SIZE_MASK);
+    XSETFASTINT (val, ASIZE (sequence) & PSEUDOVECTOR_SIZE_MASK);
   else if (CONSP (sequence))
     {
       i = 0;
@@ -193,7 +193,7 @@ DEFUN ("safe-length", Fsafe_length, Ssafe_length, 1, 1, 0,
        doc: /* Return the length of a list, but avoid error or infinite loop.
 This function never gets an error.  If LIST is not really a list,
 it returns 0.  If LIST is circular, it returns a finite value
-which is at least the number of distinct elements. */)
+which is at least the number of distinct elements.  */)
      (list)
      Lisp_Object list;
 {
@@ -217,7 +217,7 @@ which is at least the number of distinct elements. */)
 
 DEFUN ("string-bytes", Fstring_bytes, Sstring_bytes, 1, 1, 0,
        doc: /* Return the number of bytes in STRING.
-If STRING is a multibyte string, this is greater than the length of STRING. */)
+If STRING is a multibyte string, this is greater than the length of STRING.  */)
      (string)
      Lisp_Object string;
 {
@@ -228,7 +228,7 @@ If STRING is a multibyte string, this is greater than the length of STRING. */)
 DEFUN ("string-equal", Fstring_equal, Sstring_equal, 2, 2, 0,
        doc: /* Return t if two strings have identical contents.
 Case is significant, but text properties are ignored.
-Symbols are also allowed; their print names are used instead. */)
+Symbols are also allowed; their print names are used instead.  */)
      (s1, s2)
      register Lisp_Object s1, s2;
 {
@@ -260,7 +260,7 @@ The value is t if the strings (or specified portions) match.
 If string STR1 is less, the value is a negative number N;
   - 1 - N is the number of characters that match at the beginning.
 If string STR1 is greater, the value is a positive number N;
-  N - 1 is the number of characters that match at the beginning. */)
+  N - 1 is the number of characters that match at the beginning.  */)
      (str1, start1, end1, str2, start2, end2, ignore_case)
      Lisp_Object str1, start1, end1, start2, str2, end2, ignore_case;
 {
@@ -352,7 +352,7 @@ If string STR1 is greater, the value is a positive number N;
 DEFUN ("string-lessp", Fstring_lessp, Sstring_lessp, 2, 2, 0,
        doc: /* Return t if first arg string is less than second in lexicographic order.
 Case is significant.
-Symbols are also allowed; their print names are used instead. */)
+Symbols are also allowed; their print names are used instead.  */)
      (s1, s2)
      register Lisp_Object s1, s2;
 {
@@ -391,7 +391,9 @@ Symbols are also allowed; their print names are used instead. */)
 /* "gcc -O3" enables automatic function inlining, which optimizes out
    the arguments for the invocations of this function, whereas it
    expects these values on the stack.  */
-static Lisp_Object concat () __attribute__((noinline));
+static Lisp_Object concat P_ ((int nargs, Lisp_Object *args, enum Lisp_Type target_type, int last_special)) __attribute__((noinline));
+#else  /* !__GNUC__ */
+static Lisp_Object concat P_ ((int nargs, Lisp_Object *args, enum Lisp_Type target_type, int last_special));
 #endif
 
 /* ARGSUSED */
@@ -488,7 +490,7 @@ copy_sub_char_table (arg)
 DEFUN ("copy-sequence", Fcopy_sequence, Scopy_sequence, 1, 1, 0,
        doc: /* Return a copy of a list, vector, string or char-table.
 The elements of a list or vector are not copied; they are shared
-with the original. */)
+with the original.  */)
      (arg)
      Lisp_Object arg;
 {
@@ -615,7 +617,7 @@ concat (nargs, args, target_type, last_special)
          if (VECTORP (this))
            for (i = 0; i < len; i++)
              {
-               ch = XVECTOR (this)->contents[i];
+               ch = AREF (this, i);
                CHECK_NUMBER (ch);
                this_len_byte = CHAR_BYTES (XINT (ch));
                result_len_byte += this_len_byte;
@@ -768,7 +770,7 @@ concat (nargs, args, target_type, last_special)
                thisindex++;
              }
            else
-             elt = XVECTOR (this)->contents[thisindex++];
+             elt = AREF (this, thisindex++);
 
            /* Store this element into the result.  */
            if (toindex < 0)
@@ -778,7 +780,7 @@ concat (nargs, args, target_type, last_special)
                tail = XCDR (tail);
              }
            else if (VECTORP (val))
-             XVECTOR (val)->contents[toindex++] = elt;
+             AREF (val, toindex++) = elt;
            else
              {
                CHECK_NUMBER (elt);
@@ -1109,7 +1111,7 @@ DEFUN ("string-make-unibyte", Fstring_make_unibyte, Sstring_make_unibyte,
 Multibyte character codes are converted to unibyte according to
 `nonascii-translation-table' or, if that is nil, `nonascii-insert-offset'.
 If the lookup in the translation table fails, this function takes just
-the low 8 bits of each character. */)
+the low 8 bits of each character.  */)
      (string)
      Lisp_Object string;
 {
@@ -1259,7 +1261,7 @@ This function allows vectors as well as strings.  */)
       size_byte = SBYTES (string);
     }
   else
-    size = XVECTOR (string)->size;
+    size = ASIZE (string);
 
   if (NILP (to))
     {
@@ -1297,8 +1299,7 @@ This function allows vectors as well as strings.  */)
                            string, make_number (0), res, Qnil);
     }
   else
-    res = Fvector (to_char - from_char,
-                  XVECTOR (string)->contents + from_char);
+    res = Fvector (to_char - from_char, &AREF (string, from_char));
 
   return res;
 }
@@ -1382,7 +1383,7 @@ substring_both (string, from, from_byte, to, to_byte)
       size_byte = SBYTES (string);
     }
   else
-    size = XVECTOR (string)->size;
+    size = ASIZE (string);
 
   if (!(0 <= from && from <= to && to <= size))
     args_out_of_range_3 (string, make_number (from), make_number (to));
@@ -1396,8 +1397,7 @@ substring_both (string, from, from_byte, to, to_byte)
                            string, make_number (0), res, Qnil);
     }
   else
-    res = Fvector (to - from,
-                  XVECTOR (string)->contents + from);
+    res = Fvector (to - from, &AREF (string, from));
 
   return res;
 }
@@ -2243,11 +2243,11 @@ internal_equal (o1, o2, depth, props)
     case Lisp_Vectorlike:
       {
        register int i;
-       EMACS_INT size = XVECTOR (o1)->size;
+       EMACS_INT size = ASIZE (o1);
        /* Pseudovectors have the type encoded in the size field, so this test
           actually checks that the objects have the same type as well as the
           same size.  */
-       if (XVECTOR (o2)->size != size)
+       if (ASIZE (o2) != size)
          return 0;
        /* Boolvectors are compared much like strings.  */
        if (BOOL_VECTOR_P (o1))
@@ -2277,8 +2277,8 @@ internal_equal (o1, o2, depth, props)
        for (i = 0; i < size; i++)
          {
            Lisp_Object v1, v2;
-           v1 = XVECTOR (o1)->contents [i];
-           v2 = XVECTOR (o2)->contents [i];
+           v1 = AREF (o1, i);
+           v2 = AREF (o2, i);
            if (!internal_equal (v1, v2, depth + 1, props))
              return 0;
          }
@@ -2319,7 +2319,7 @@ ARRAY is a vector, string, char-table, or bool-vector.  */)
   if (VECTORP (array))
     {
       register Lisp_Object *p = XVECTOR (array)->contents;
-      size = XVECTOR (array)->size;
+      size = ASIZE (array);
       for (index = 0; index < size; index++)
        p[index] = item;
     }
@@ -2547,7 +2547,7 @@ Note that this function doesn't check the parent of CHAR-TABLE.  */)
 
       charset_info = Fget (range, Qcharset);
       CHECK_VECTOR (charset_info);
-      charset_id = XINT (XVECTOR (charset_info)->contents[0]);
+      charset_id = XINT (AREF (charset_info, 0));
       ch = Fmake_char_internal (make_number (charset_id),
                                make_number (0), make_number (0));
     }
@@ -2673,7 +2673,7 @@ character set, or a character code.  Return VALUE.  */)
     Faset (char_table, range, value);
   else if (VECTORP (range))
     {
-      int size = XVECTOR (range)->size;
+      int size = ASIZE (range);
       Lisp_Object *val = XVECTOR (range)->contents;
       Lisp_Object ch = Fmake_char_internal (size <= 0 ? Qnil : val[0],
                                            size <= 1 ? Qnil : val[1],
@@ -3059,14 +3059,14 @@ mapcar1 (leni, vals, fn, seq)
   else
     GCPRO2 (fn, seq);
   /* We need not explicitly protect `tail' because it is used only on lists, and
-    1) lists are not relocated and 2) the list is marked via `seq' so will not be freed */
+    1) lists are not relocated and 2) the list is marked via `seq' so will not
+    be freed */
 
   if (VECTORP (seq))
     {
       for (i = 0; i < leni; i++)
        {
-         dummy = XVECTOR (seq)->contents[i];
-         dummy = call1 (fn, dummy);
+         dummy = call1 (fn, AREF (seq, i));
          if (vals)
            vals[i] = dummy;
        }
@@ -3077,11 +3077,7 @@ mapcar1 (leni, vals, fn, seq)
        {
          int byte;
          byte = XBOOL_VECTOR (seq)->data[i / BOOL_VECTOR_BITS_PER_CHAR];
-         if (byte & (1 << (i % BOOL_VECTOR_BITS_PER_CHAR)))
-           dummy = Qt;
-         else
-           dummy = Qnil;
-
+         dummy = (byte & (1 << (i % BOOL_VECTOR_BITS_PER_CHAR))) ? Qt : Qnil;
          dummy = call1 (fn, dummy);
          if (vals)
            vals[i] = dummy;
@@ -3464,7 +3460,7 @@ DEFUN ("featurep", Ffeaturep, Sfeaturep, 1, 2, 0,
        doc: /* Returns t if FEATURE is present in this Emacs.
 
 Use this to conditionalize execution of lisp code based on the
-presence or absence of emacs or environment extensions.
+presence or absence of Emacs or environment extensions.
 Use `provide' to declare that a feature is available.  This function
 looks at the value of the variable `features'.  The optional argument
 SUBFEATURE can be used to check a specific subfeature of FEATURE.  */)
@@ -4385,7 +4381,7 @@ larger_vector (vec, new_size, init)
   int i, old_size;
 
   xassert (VECTORP (vec));
-  old_size = XVECTOR (vec)->size;
+  old_size = ASIZE (vec);
   xassert (new_size >= old_size);
 
   v = allocate_vector (new_size);
@@ -4717,7 +4713,7 @@ maybe_resize_hash_table (h)
        if (!NILP (HASH_HASH (h, i)))
          {
            unsigned hash_code = XUINT (HASH_HASH (h, i));
-           int start_of_bucket = hash_code % XVECTOR (h->index)->size;
+           int start_of_bucket = hash_code % ASIZE (h->index);
            HASH_NEXT (h, i) = HASH_INDEX (h, start_of_bucket);
            HASH_INDEX (h, start_of_bucket) = make_number (i);
          }
@@ -4743,7 +4739,7 @@ hash_lookup (h, key, hash)
   if (hash)
     *hash = hash_code;
 
-  start_of_bucket = hash_code % XVECTOR (h->index)->size;
+  start_of_bucket = hash_code % ASIZE (h->index);
   idx = HASH_INDEX (h, start_of_bucket);
 
   /* We need not gcpro idx since it's either an integer or nil.  */
@@ -4790,7 +4786,7 @@ hash_put (h, key, value, hash)
   HASH_HASH (h, i) = make_number (hash);
 
   /* Add new entry to its collision chain.  */
-  start_of_bucket = hash % XVECTOR (h->index)->size;
+  start_of_bucket = hash % ASIZE (h->index);
   HASH_NEXT (h, i) = HASH_INDEX (h, start_of_bucket);
   HASH_INDEX (h, start_of_bucket) = make_number (i);
   return i;
@@ -4809,7 +4805,7 @@ hash_remove (h, key)
   Lisp_Object idx, prev;
 
   hash_code = h->hashfn (h, key);
-  start_of_bucket = hash_code % XVECTOR (h->index)->size;
+  start_of_bucket = hash_code % ASIZE (h->index);
   idx = HASH_INDEX (h, start_of_bucket);
   prev = Qnil;
 
@@ -4865,8 +4861,8 @@ hash_clear (h)
          HASH_HASH (h, i) = Qnil;
        }
 
-      for (i = 0; i < XVECTOR (h->index)->size; ++i)
-       XVECTOR (h->index)->contents[i] = Qnil;
+      for (i = 0; i < ASIZE (h->index); ++i)
+       AREF (h->index, i) = Qnil;
 
       h->next_free = make_number (0);
       h->count = make_number (0);
@@ -4891,7 +4887,7 @@ sweep_weak_table (h, remove_entries_p)
 {
   int bucket, n, marked;
 
-  n = XVECTOR (h->index)->size & ~ARRAY_MARK_FLAG;
+  n = ASIZE (h->index) & ~ARRAY_MARK_FLAG;
   marked = 0;
 
   for (bucket = 0; bucket < n; ++bucket)
@@ -5105,13 +5101,13 @@ sxhash_vector (vec, depth)
      Lisp_Object vec;
      int depth;
 {
-  unsigned hash = XVECTOR (vec)->size;
+  unsigned hash = ASIZE (vec);
   int i, n;
 
-  n = min (SXHASH_MAX_LEN, XVECTOR (vec)->size);
+  n = min (SXHASH_MAX_LEN, ASIZE (vec));
   for (i = 0; i < n; ++i)
     {
-      unsigned hash2 = sxhash (XVECTOR (vec)->contents[i], depth + 1);
+      unsigned hash2 = sxhash (AREF (vec, i), depth + 1);
       hash = SXHASH_COMBINE (hash, hash2);
     }
 
@@ -5806,7 +5802,7 @@ syms_of_fns ()
   Fset (Qyes_or_no_p_history, Qnil);
 
   DEFVAR_LISP ("features", &Vfeatures,
-    doc: /* A list of symbols which are the features of the executing emacs.
+    doc: /* A list of symbols which are the features of the executing Emacs.
 Used by `featurep' and `require', and altered by `provide'.  */);
   Vfeatures = Fcons (intern ("emacs"), Qnil);
   Qsubfeatures = intern ("subfeatures");
index d7c58fd..b6f361b 100644 (file)
@@ -2905,7 +2905,7 @@ extern Lisp_Object Qbox;
 extern Lisp_Object Qtop;
 
 /* Calculate fullscreen size.  Return in *TOP_POS and *LEFT_POS the
-   wanted positions of the WM window (not emacs window).
+   wanted positions of the WM window (not Emacs window).
    Return in *WIDTH and *HEIGHT the wanted width and height of Emacs
    window (FRAME_X_WINDOW).
  */
@@ -3340,6 +3340,9 @@ x_set_fullscreen (f, new_value, old_value)
     f->want_fullscreen = FULLSCREEN_WIDTH;
   else if (EQ (new_value, Qfullheight))
     f->want_fullscreen = FULLSCREEN_HEIGHT;
+
+  if (FRAME_TERMINAL (f)->fullscreen_hook != NULL) 
+    FRAME_TERMINAL (f)->fullscreen_hook (f);
 }
 
 
@@ -4429,7 +4432,7 @@ Setting this variable does not affect existing frames, only new ones.  */);
                doc: /* The initial frame-object, which represents Emacs's stdout.  */);
 
   DEFVAR_LISP ("emacs-iconified", &Vemacs_iconified,
-              doc: /* Non-nil if all of emacs is iconified and frame updates are not needed.  */);
+              doc: /* Non-nil if all of Emacs is iconified and frame updates are not needed.  */);
   Vemacs_iconified = Qnil;
 
   DEFVAR_LISP ("mouse-position-function", &Vmouse_position_function,
index 2370855..17bf2d2 100644 (file)
@@ -3720,7 +3720,12 @@ update_frame_tool_bar (f)
 
       if (img->load_failed_p || img->pixmap == None)
         {
-          if (wicon) gtk_widget_hide (wicon);
+          if (wicon)
+           gtk_widget_hide (wicon);
+         else
+           gtk_toolbar_insert (GTK_TOOLBAR (x->toolbar_widget),
+                               gtk_tool_button_new (NULL, ""),
+                               i);
           continue;
         }
 
index 5b80fe5..8f13da3 100644 (file)
@@ -2395,7 +2395,7 @@ image_load_qt_1 (f, img, type, fss, dh)
      struct frame *f;
      struct image *img;
      OSType type;
-     FSSpec *fss;
+     const FSSpec *fss;
      Handle dh;
 {
   ComponentResult err;
@@ -2409,8 +2409,7 @@ image_load_qt_1 (f, img, type, fss, dh)
   XImagePtr ximg;
   RGBColor bg_color;
 
-  err = OpenADefaultComponent (GraphicsImporterComponentType,
-                              type, &gi);
+  err = OpenADefaultComponent (GraphicsImporterComponentType, type, &gi);
   if (err != noErr)
     {
       image_error ("Cannot get importer component for `%s'", img->spec, Qnil);
@@ -4112,25 +4111,25 @@ xpm_load (f, img)
 /* XPM support functions for Mac OS where libxpm is not available.
    Only XPM version 3 (without any extensions) is supported.  */
 
-static int xpm_scan P_ ((unsigned char **, unsigned char *,
-                        unsigned char **, int *));
+static int xpm_scan P_ ((const unsigned char **, const unsigned char *,
+                        const unsigned char **, int *));
 static Lisp_Object xpm_make_color_table_v
-  P_ ((void (**) (Lisp_Object, unsigned char *, int, Lisp_Object),
-       Lisp_Object (**) (Lisp_Object, unsigned char *, int)));
-static void xpm_put_color_table_v P_ ((Lisp_Object, unsigned char *,
+  P_ ((void (**) (Lisp_Object, const unsigned char *, int, Lisp_Object),
+       Lisp_Object (**) (Lisp_Object, const unsigned char *, int)));
+static void xpm_put_color_table_v P_ ((Lisp_Object, const unsigned char *,
                                       int, Lisp_Object));
 static Lisp_Object xpm_get_color_table_v P_ ((Lisp_Object,
-                                             unsigned char *, int));
+                                             const unsigned char *, int));
 static Lisp_Object xpm_make_color_table_h
-  P_ ((void (**) (Lisp_Object, unsigned char *, int, Lisp_Object),
-       Lisp_Object (**) (Lisp_Object, unsigned char *, int)));
-static void xpm_put_color_table_h P_ ((Lisp_Object, unsigned char *,
+  P_ ((void (**) (Lisp_Object, const unsigned char *, int, Lisp_Object),
+       Lisp_Object (**) (Lisp_Object, const unsigned char *, int)));
+static void xpm_put_color_table_h P_ ((Lisp_Object, const unsigned char *,
                                       int, Lisp_Object));
 static Lisp_Object xpm_get_color_table_h P_ ((Lisp_Object,
-                                             unsigned char *, int));
-static int xpm_str_to_color_key P_ ((char *));
+                                             const unsigned char *, int));
+static int xpm_str_to_color_key P_ ((const char *));
 static int xpm_load_image P_ ((struct frame *, struct image *,
-                              unsigned char *, unsigned char *));
+                              const unsigned char *, const unsigned char *));
 
 /* Tokens returned from xpm_scan.  */
 
@@ -4150,7 +4149,7 @@ enum xpm_token
 
 static int
 xpm_scan (s, end, beg, len)
-     unsigned char **s, *end, **beg;
+     const unsigned char **s, *end, **beg;
      int *len;
 {
   int c;
@@ -4216,8 +4215,8 @@ xpm_scan (s, end, beg, len)
 
 static Lisp_Object
 xpm_make_color_table_v (put_func, get_func)
-     void (**put_func) (Lisp_Object, unsigned char *, int, Lisp_Object);
-     Lisp_Object (**get_func) (Lisp_Object, unsigned char *, int);
+     void (**put_func) (Lisp_Object, const unsigned char *, int, Lisp_Object);
+     Lisp_Object (**get_func) (Lisp_Object, const unsigned char *, int);
 {
   *put_func = xpm_put_color_table_v;
   *get_func = xpm_get_color_table_v;
@@ -4227,7 +4226,7 @@ xpm_make_color_table_v (put_func, get_func)
 static void
 xpm_put_color_table_v (color_table, chars_start, chars_len, color)
      Lisp_Object color_table;
-     unsigned char *chars_start;
+     const unsigned char *chars_start;
      int chars_len;
      Lisp_Object color;
 {
@@ -4237,7 +4236,7 @@ xpm_put_color_table_v (color_table, chars_start, chars_len, color)
 static Lisp_Object
 xpm_get_color_table_v (color_table, chars_start, chars_len)
      Lisp_Object color_table;
-     unsigned char *chars_start;
+     const unsigned char *chars_start;
      int chars_len;
 {
   return XVECTOR (color_table)->contents[*chars_start];
@@ -4245,8 +4244,8 @@ xpm_get_color_table_v (color_table, chars_start, chars_len)
 
 static Lisp_Object
 xpm_make_color_table_h (put_func, get_func)
-     void (**put_func) (Lisp_Object, unsigned char *, int, Lisp_Object);
-     Lisp_Object (**get_func) (Lisp_Object, unsigned char *, int);
+     void (**put_func) (Lisp_Object, const unsigned char *, int, Lisp_Object);
+     Lisp_Object (**get_func) (Lisp_Object, const unsigned char *, int);
 {
   *put_func = xpm_put_color_table_h;
   *get_func = xpm_get_color_table_h;
@@ -4259,7 +4258,7 @@ xpm_make_color_table_h (put_func, get_func)
 static void
 xpm_put_color_table_h (color_table, chars_start, chars_len, color)
      Lisp_Object color_table;
-     unsigned char *chars_start;
+     const unsigned char *chars_start;
      int chars_len;
      Lisp_Object color;
 {
@@ -4274,7 +4273,7 @@ xpm_put_color_table_h (color_table, chars_start, chars_len, color)
 static Lisp_Object
 xpm_get_color_table_h (color_table, chars_start, chars_len)
      Lisp_Object color_table;
-     unsigned char *chars_start;
+     const unsigned char *chars_start;
      int chars_len;
 {
   struct Lisp_Hash_Table *table = XHASH_TABLE (color_table);
@@ -4292,11 +4291,11 @@ enum xpm_color_key {
   XPM_COLOR_KEY_C
 };
 
-static char xpm_color_key_strings[][4] = {"s", "m", "g4", "g", "c"};
+static const char xpm_color_key_strings[][4] = {"s", "m", "g4", "g", "c"};
 
 static int
 xpm_str_to_color_key (s)
-     char *s;
+     const char *s;
 {
   int i;
 
@@ -4312,15 +4311,15 @@ static int
 xpm_load_image (f, img, contents, end)
      struct frame *f;
      struct image *img;
-     unsigned char *contents, *end;
+     const unsigned char *contents, *end;
 {
-  unsigned char *s = contents, *beg, *str;
+  const unsigned char *s = contents, *beg, *str;
   unsigned char buffer[BUFSIZ];
   int width, height, x, y;
   int num_colors, chars_per_pixel;
   int len, LA1;
-  void (*put_color_table) (Lisp_Object, unsigned char *, int, Lisp_Object);
-  Lisp_Object (*get_color_table) (Lisp_Object, unsigned char *, int);
+  void (*put_color_table) (Lisp_Object, const unsigned char *, int, Lisp_Object);
+  Lisp_Object (*get_color_table) (Lisp_Object, const unsigned char *, int);
   Lisp_Object frame, color_symbols, color_table;
   int best_key, have_mask = 0;
   XImagePtr ximg = NULL, mask_img = NULL;
index efe10bc..e840599 100644 (file)
@@ -2090,10 +2090,10 @@ whether or not it is currently displayed in some window.  */)
       it_start = IT_CHARPOS (it);
 
       /* We expect the call to move_it_to, further down, to overshoot
-        if the starting point is on an image, stretch glyph, or Lisp
-        string.  We won't need to backtrack in this situation, except
-        for one corner case: when the Lisp string contains a
-        newline.  */
+        if the starting point is on an image, stretch glyph,
+        composition, or Lisp string.  We won't need to backtrack in
+        this situation, except for one corner case: when the Lisp
+        string contains a newline.  */
       if (it.method == GET_FROM_STRING)
        {
          const char *s = SDATA (it.string);
@@ -2106,7 +2106,8 @@ whether or not it is currently displayed in some window.  */)
        }
       else
        it_overshoot_expected_p = (it.method == GET_FROM_IMAGE
-                                  || it.method == GET_FROM_STRETCH);
+                                  || it.method == GET_FROM_STRETCH
+                                  || it.method == GET_FROM_COMPOSITION);
 
       reseat_at_previous_visible_line_start (&it);
       it.current_x = it.hpos = 0;
index 9755471..2f4879d 100644 (file)
@@ -5816,7 +5816,7 @@ make_lispy_event (event)
        position = make_lispy_position (f, &event->x, &event->y,
                                        event->timestamp);
 
-       /* Set double or triple modifiers to indicate the wheel speed.  */
+       /* Set double or triple modifiers to indicate the wheel speed.  */
        {
          /* On window-system frames, use the value of
             double-click-fuzz as is.  On other frames, interpret it
@@ -5870,7 +5870,7 @@ make_lispy_event (event)
 
          if (event->modifiers & up_modifier)
            {
-             /* Emit a wheel-up event.  */
+             /* Emit a wheel-up event.  */
              event->modifiers &= ~up_modifier;
              symbol_num = 0;
            }
@@ -5885,7 +5885,7 @@ make_lispy_event (event)
               the up_modifier set.  */
            abort ();
 
-         /* Get the symbol we should use for the wheel event.  */
+         /* Get the symbol we should use for the wheel event.  */
          head = modify_event_symbol (symbol_num,
                                      event->modifiers,
                                      Qmouse_click,
index ef76e72..596ba79 100644 (file)
@@ -134,7 +134,7 @@ static int load_force_doc_strings;
 /* Nonzero means read should convert strings to unibyte.  */
 static int load_convert_to_unibyte;
 
-/* Function to use for loading an Emacs lisp source file (not
+/* Function to use for loading an Emacs Lisp source file (not
    compiled) instead of readevalloop.  */
 Lisp_Object Vload_source_file_function;
 
@@ -4119,7 +4119,7 @@ The default is nil, which means use the function `read'.  */);
   Vload_read_function = Qnil;
 
   DEFVAR_LISP ("load-source-file-function", &Vload_source_file_function,
-              doc: /* Function called in `load' for loading an Emacs lisp source file.
+              doc: /* Function called in `load' for loading an Emacs Lisp source file.
 This function is for doing code conversion before reading the source file.
 If nil, loading is done without any code conversion.
 Arguments are FULLNAME, FILE, NOERROR, NOMESSAGE, where
index 419fa13..940ff70 100644 (file)
@@ -128,7 +128,11 @@ Boston, MA 02110-1301, USA.  */
 #else /* !__OpenBSD__ && !__FreeBSD__ */
 
 #undef START_FILES
+#ifdef HAVE_X86_64_LIB64_DIR
 #define START_FILES pre-crt0.o /usr/lib64/crt1.o /usr/lib64/crti.o
+#else
+#define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o
+#endif
 
 /* The duplicate -lgcc is intentional in the definition of LIB_STANDARD.
    The reason is that some functions in libgcc.a call functions from libc.a,
@@ -136,7 +140,11 @@ Boston, MA 02110-1301, USA.  */
    versions of ld are one-pass linkers, we need to mention -lgcc twice,
    or else we risk getting unresolved externals.  */
 #undef LIB_STANDARD
+#ifdef HAVE_X86_64_LIB64_DIR
 #define LIB_STANDARD -lgcc -lc -lgcc /usr/lib64/crtn.o
+#else
+#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtn.o
+#endif
 
 #endif /* __FreeBSD__ */
 
index 3d3e45e..10b43bf 100644 (file)
@@ -44,7 +44,7 @@ Boston, MA 02110-1301, USA.  */
 #define IBMR2AIX
 
 /* Use type int rather than a union, to represent Lisp_Object */
-/* This is desirable for most machines.         */
+/* This is desirable for most machines.  */
 
 #define NO_UNION_TYPE
 
@@ -72,7 +72,7 @@ Boston, MA 02110-1301, USA.  */
 
 /* The data segment in this machine always starts at address 0x20000000.
    An address of data cannot be stored correctly in a Lisp object;
-   we always lose the high bits.  We must tell XPNTR to add them back. */
+   we always lose the high bits.  We must tell XPNTR to add them back.  */
 
 #ifndef USG5_4
 #define DATA_SEG_BITS 0x20000000
@@ -86,7 +86,7 @@ Boston, MA 02110-1301, USA.  */
 #define PURE_SEG_BITS 0x30000000
 
 /* Use shared memory.  */
-/* This is turned off because it does not always work. See etc/AIX.DUMP.  */
+/* This is turned off because it does not always work.  See etc/AIX.DUMP.  */
 /* #define HAVE_SHM */
 #define SHMKEY 5305035         /* used for shared memory code segments */
 #endif /* CANNOT_DUMP */
index 85d2810..0b1511f 100644 (file)
@@ -50,7 +50,7 @@ Boston, MA 02110-1301, USA.  */
 #define NO_REMAP
 
 /* Define TEXT_START_ADDR if your linker don't set execute point to _start.
-   If it needed, temacs always CORE-DUMP.      */
+   If it needed, temacs always CORE-DUMP.  */
 
 #define TEXT_START_ADDR __start
 
index d127422..c4275ca 100644 (file)
--- a/src/mac.c
+++ b/src/mac.c
@@ -835,8 +835,8 @@ OSStatus
 create_apple_event_from_event_ref (event, num_params, names, types, result)
      EventRef event;
      UInt32 num_params;
-     EventParamName *names;
-     EventParamType *types;
+     const EventParamName *names;
+     const EventParamType *types;
      AppleEvent *result;
 {
   OSStatus err;
@@ -891,7 +891,7 @@ OSErr
 create_apple_event_from_drag_ref (drag, num_types, types, result)
      DragRef drag;
      UInt32 num_types;
-     FlavorType *types;
+     const FlavorType *types;
      AppleEvent *result;
 {
   OSErr err;
@@ -1315,7 +1315,7 @@ cfproperty_list_to_lisp (plist, with_tag, hash_bound)
 
 static void
 skip_white_space (p)
-     char **p;
+     const char **p;
 {
   /* WhiteSpace = {<space> | <horizontal tab>} */
   while (*P == ' ' || *P == '\t')
@@ -1324,7 +1324,7 @@ skip_white_space (p)
 
 static int
 parse_comment (p)
-     char **p;
+     const char **p;
 {
   /* Comment = "!" {<any character except null or newline>} */
   if (*P == '!')
@@ -1342,7 +1342,7 @@ parse_comment (p)
 /* Don't interpret filename.  Just skip until the newline.  */
 static int
 parse_include_file (p)
-     char **p;
+     const char **p;
 {
   /* IncludeFile = "#" WhiteSpace "include" WhiteSpace FileName WhiteSpace */
   if (*P == '#')
@@ -1359,7 +1359,7 @@ parse_include_file (p)
 
 static char
 parse_binding (p)
-     char **p;
+     const char **p;
 {
   /* Binding = "." | "*"  */
   if (*P == '.' || *P == '*')
@@ -1377,7 +1377,7 @@ parse_binding (p)
 
 static Lisp_Object
 parse_component (p)
-     char **p;
+     const char **p;
 {
   /*  Component = "?" | ComponentName
       ComponentName = NameChar {NameChar}
@@ -1389,7 +1389,7 @@ parse_component (p)
     }
   else if (isalnum (*P) || *P == '_' || *P == '-')
     {
-      char *start = P++;
+      const char *start = P++;
 
       while (isalnum (*P) || *P == '_' || *P == '-')
        P++;
@@ -1402,7 +1402,7 @@ parse_component (p)
 
 static Lisp_Object
 parse_resource_name (p)
-     char **p;
+     const char **p;
 {
   Lisp_Object result = Qnil, component;
   char binding;
@@ -1436,7 +1436,7 @@ parse_resource_name (p)
 
 static Lisp_Object
 parse_value (p)
-     char **p;
+     const char **p;
 {
   char *q, *buf;
   Lisp_Object seq = Qnil, result;
@@ -1526,7 +1526,7 @@ parse_value (p)
 
 static Lisp_Object
 parse_resource_line (p)
-     char **p;
+     const char **p;
 {
   Lisp_Object quarks, value;
 
@@ -1629,7 +1629,7 @@ xrm_q_put_resource (database, quarks, value)
 void
 xrm_merge_string_database (database, data)
      XrmDatabase database;
-     char *data;
+     const char *data;
 {
   Lisp_Object quarks_value;
 
@@ -1705,7 +1705,7 @@ xrm_q_get_resource (database, quark_name, quark_class)
 Lisp_Object
 xrm_get_resource (database, name, class)
      XrmDatabase database;
-     char *name, *class;
+     const char *name, *class;
 {
   Lisp_Object key, query_cache, quark_name, quark_class, tmp;
   int i, nn, nc;
@@ -1794,7 +1794,7 @@ xrm_cfproperty_list_to_value (plist)
 
 XrmDatabase
 xrm_get_preference_database (application)
-     char *application;
+     const char *application;
 {
 #if TARGET_API_MAC_CARBON
   CFStringRef app_id, *keys, user_doms[2], host_doms[2];
@@ -5129,7 +5129,7 @@ sys_select (nfds, rfds, wfds, efds, timeout)
          int minfd, fd;
          CFRunLoopRef runloop =
            (CFRunLoopRef) GetCFRunLoopFromEventLoop (GetCurrentEventLoop ());
-         static CFSocketContext context = {0, ofds, NULL, NULL, NULL};
+         static const CFSocketContext context = {0, ofds, NULL, NULL, NULL};
          static CFMutableDictionaryRef sources;
 
          if (sources == NULL)
index e0e58ff..14261f6 100644 (file)
@@ -251,7 +251,7 @@ typedef struct colormap_t
   char *name;
 } colormap_t;
 
-colormap_t mac_color_map[] =
+static const colormap_t mac_color_map[] =
 {
   { RGB_TO_ULONG(255, 250, 250), "snow" },
   { RGB_TO_ULONG(248, 248, 255), "ghost white" },
@@ -1009,7 +1009,7 @@ colormap_t mac_color_map[] =
 
 Lisp_Object
 mac_color_map_lookup (colorname)
-     char *colorname;
+     const char *colorname;
 {
   Lisp_Object ret = Qnil;
   int i;
@@ -3092,18 +3092,30 @@ If omitted or nil, that stands for the selected frame's display.  */)
      Lisp_Object display;
 {
   struct mac_display_info *dpyinfo = check_x_display_info (display);
+
   /* Only of the main display.  */
 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
-  CGSize size;
+#if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
+  if (CGDisplayScreenSize != NULL)
+#endif
+    {
+      CGSize size;
 
-  BLOCK_INPUT;
-  size = CGDisplayScreenSize (kCGDirectMainDisplay);
-  UNBLOCK_INPUT;
+      BLOCK_INPUT;
+      size = CGDisplayScreenSize (kCGDirectMainDisplay);
+      UNBLOCK_INPUT;
 
-  return make_number ((int) (size.height + .5f));
-#else
-  /* This is an approximation.  */
-  return make_number ((int) (dpyinfo->height * 25.4 / dpyinfo->resy));
+      return make_number ((int) (size.height + .5f));
+    }
+#if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
+  else
+#endif
+#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030  */
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1030 || MAC_OS_X_VERSION_MIN_REQUIRED == 1020
+    {
+      /* This is an approximation.  */
+      return make_number ((int) (dpyinfo->height * 25.4 / dpyinfo->resy));
+    }
 #endif
 }
 
@@ -3116,18 +3128,30 @@ If omitted or nil, that stands for the selected frame's display.  */)
      Lisp_Object display;
 {
   struct mac_display_info *dpyinfo = check_x_display_info (display);
+
   /* Only of the main display.  */
 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
-  CGSize size;
+#if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
+  if (CGDisplayScreenSize != NULL)
+#endif
+    {
+      CGSize size;
 
-  BLOCK_INPUT;
-  size = CGDisplayScreenSize (kCGDirectMainDisplay);
-  UNBLOCK_INPUT;
+      BLOCK_INPUT;
+      size = CGDisplayScreenSize (kCGDirectMainDisplay);
+      UNBLOCK_INPUT;
 
-  return make_number ((int) (size.width + .5f));
-#else
-  /* This is an approximation.  */
-  return make_number ((int) (dpyinfo->width * 25.4 / dpyinfo->resx));
+      return make_number ((int) (size.width + .5f));
+    }
+#if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
+  else
+#endif
+#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030  */
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1030 || MAC_OS_X_VERSION_MIN_REQUIRED == 1020
+    {
+      /* This is an approximation.  */
+      return make_number ((int) (dpyinfo->width * 25.4 / dpyinfo->resx));
+    }
 #endif
 }
 
index 1a1525e..14bfe92 100644 (file)
@@ -319,7 +319,7 @@ restore_menu_items (saved)
   menu_items_used = XINT (XCAR (saved));
   saved = XCDR (saved);
   menu_items_n_panes = XINT (XCAR (saved));
-  saved = XCDR (saved);  
+  saved = XCDR (saved);
   menu_items_submenu_depth = XINT (XCAR (saved));
   return Qnil;
 }
@@ -1453,7 +1453,7 @@ update_submenu_strings (first_wv)
 /* Event handler function that pops down a menu on C-g.  We can only pop
    down menus if CancelMenuTracking is present (OSX 10.3 or later).  */
 
-#ifdef HAVE_CANCELMENUTRACKING
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
 static pascal OSStatus
 menu_quit_handler (nextHandler, theEvent, userData)
      EventHandlerCallRef nextHandler;
@@ -1487,7 +1487,7 @@ menu_quit_handler (nextHandler, theEvent, userData)
 
   return CallNextEventHandler (nextHandler, theEvent);
 }
-#endif /* HAVE_CANCELMENUTRACKING */
+#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 */
 
 /* Add event handler to all menus that belong to KIND so we can detect C-g.
    MENU_HANDLE is the root menu of the tracking session to dismiss
@@ -1499,10 +1499,15 @@ install_menu_quit_handler (kind, menu_handle)
      enum mac_menu_kind kind;
      MenuHandle menu_handle;
 {
-#ifdef HAVE_CANCELMENUTRACKING
-  EventTypeSpec typesList[] = { { kEventClassKeyboard, kEventRawKeyDown } };
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
+  static const EventTypeSpec typesList[] =
+    {{kEventClassKeyboard, kEventRawKeyDown}};
   int id;
 
+#if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
+  if (CancelMenuTracking == NULL)
+    return;
+#endif
   for (id = min_menu_id[kind]; id < min_menu_id[kind + 1]; id++)
     {
       MenuHandle menu = GetMenuHandle (id);
@@ -1511,9 +1516,9 @@ install_menu_quit_handler (kind, menu_handle)
        break;
       InstallMenuEventHandler (menu, menu_quit_handler,
                               GetEventTypeCount (typesList),
-                               typesList, menu_handle, NULL);
+                              typesList, menu_handle, NULL);
     }
-#endif /* HAVE_CANCELMENUTRACKING */
+#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 */
 }
 
 /* Set the contents of the menubar widgets of frame F.
@@ -2428,9 +2433,9 @@ mac_dialog_show (f, keymaps, title, header, error_name)
 /* Is this item a separator? */
 static int
 name_is_separator (name)
-     char *name;
+     const char *name;
 {
-  char *start = name;
+  const char *start = name;
 
   /* Check if name string consists of only dashes ('-').  */
   while (*name == '-') name++;
@@ -2641,6 +2646,17 @@ dispose_menus (kind, id)
 }
 
 #endif /* HAVE_MENUS */
+
+/* The following is used by delayed window autoselection.  */
+
+DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_p, 0, 0, 0,
+       doc: /* Return t if a menu or popup dialog is active.  */)
+     ()
+{
+  /* Always return Qnil since menu selection functions do not return
+     until a selection has been made or cancelled.  */
+  return Qnil;
+}
 \f
 void
 syms_of_macmenu ()
@@ -2652,6 +2668,7 @@ syms_of_macmenu ()
   staticpro (&Qdebug_on_next_call);
 
   defsubr (&Sx_popup_menu);
+  defsubr (&Smenu_or_popup_active_p);
 #ifdef HAVE_MENUS
   defsubr (&Sx_popup_dialog);
 #endif
index fd72bd3..7a952f8 100644 (file)
@@ -1616,10 +1616,11 @@ remove_drag_handler (window)
 void
 init_service_handler ()
 {
-  EventTypeSpec specs[] = {{kEventClassService, kEventServiceGetTypes},
-                          {kEventClassService, kEventServiceCopy},
-                          {kEventClassService, kEventServicePaste},
-                          {kEventClassService, kEventServicePerform}};
+  static const EventTypeSpec specs[] =
+    {{kEventClassService, kEventServiceGetTypes},
+     {kEventClassService, kEventServiceCopy},
+     {kEventClassService, kEventServicePaste},
+     {kEventClassService, kEventServicePerform}};
   InstallApplicationEventHandler (NewEventHandlerUPP (mac_handle_service_event),
                                  GetEventTypeCount (specs), specs, NULL, NULL);
 }
index d4ce2a1..4739a52 100644 (file)
@@ -244,7 +244,8 @@ static void x_new_focus_frame P_ ((struct x_display_info *, struct frame *));
 static void mac_focus_changed P_ ((int, struct mac_display_info *,
                                   struct frame *, struct input_event *));
 static void x_detect_focus_change P_ ((struct mac_display_info *,
-                                      EventRecord *, struct input_event *));
+                                      const EventRecord *,
+                                      struct input_event *));
 static void XTframe_rehighlight P_ ((struct frame *));
 static void x_frame_rehighlight P_ ((struct x_display_info *));
 static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *));
@@ -640,7 +641,7 @@ mac_create_bitmap_from_bitmap_data (bitmap, bits, w, h)
      char *bits;
      int w, h;
 {
-  static unsigned char swap_nibble[16]
+  static const unsigned char swap_nibble[16]
     = { 0x0, 0x8, 0x4, 0xc,    /* 0000 1000 0100 1100 */
        0x2, 0xa, 0x6, 0xe,    /* 0010 1010 0110 1110 */
        0x1, 0x9, 0x5, 0xd,    /* 0001 1001 0101 1101 */
@@ -826,9 +827,9 @@ atsu_get_text_layout_with_text_ptr (text, text_length, style, text_layout)
 
   if (saved_text_layout == NULL)
     {
-      UniCharCount lengths[] = {kATSUToTextEnd};
-      ATSUAttributeTag tags[] = {kATSULineLayoutOptionsTag};
-      ByteCount sizes[] = {sizeof (ATSLineLayoutOptions)};
+      static const UniCharCount lengths[] = {kATSUToTextEnd};
+      static const ATSUAttributeTag tags[] = {kATSULineLayoutOptionsTag};
+      static const ByteCount sizes[] = {sizeof (ATSLineLayoutOptions)};
       static ATSLineLayoutOptions line_layout =
 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
        kATSLineDisableAllLayoutOperations | kATSLineUseDeviceMetrics
@@ -837,7 +838,7 @@ atsu_get_text_layout_with_text_ptr (text, text_length, style, text_layout)
        kATSLineIsDisplayOnly | kATSLineFractDisable
 #endif
        ;
-      ATSUAttributeValuePtr values[] = {&line_layout};
+      static const ATSUAttributeValuePtr values[] = {&line_layout};
 
       err = ATSUCreateTextLayoutWithTextPtr (text,
                                             kATSUFromTextBeginning,
@@ -960,11 +961,11 @@ mac_draw_string_common (f, gc, x, y, buf, nchars, bg_width,
       else
        {
          CGrafPtr port;
-         CGContextRef context;
+         static CGContextRef context;
          float port_height = FRAME_PIXEL_HEIGHT (f);
-         ATSUAttributeTag tags[] = {kATSUCGContextTag};
-         ByteCount sizes[] = {sizeof (CGContextRef)};
-         ATSUAttributeValuePtr values[] = {&context};
+         static const ATSUAttributeTag tags[] = {kATSUCGContextTag};
+         static const ByteCount sizes[] = {sizeof (CGContextRef)};
+         static const ATSUAttributeValuePtr values[] = {&context};
 
 #if USE_CG_DRAWING
          context = mac_begin_cg_clip (f, gc);
@@ -1359,20 +1360,31 @@ mac_draw_image_string_cg (f, gc, x, y, buf, nchars, bg_width, overstrike_p)
   if (GC_FONT (gc)->mac_fontsize <= cg_text_anti_aliasing_threshold)
     CGContextSetShouldAntialias (context, false);
 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
-  CGContextSetTextPosition (context, gx, gy);
-  CGContextShowGlyphsWithAdvances (context, glyphs, advances, nchars);
-  if (overstrike_p)
+#if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
+  if (CGContextShowGlyphsWithAdvances != NULL)
+#endif
     {
-      CGContextSetTextPosition (context, gx + 1.0f, gy);
+      CGContextSetTextPosition (context, gx, gy);
       CGContextShowGlyphsWithAdvances (context, glyphs, advances, nchars);
+      if (overstrike_p)
+       {
+         CGContextSetTextPosition (context, gx + 1.0f, gy);
+         CGContextShowGlyphsWithAdvances (context, glyphs, advances, nchars);
+       }
     }
-#else
-  for (i = 0; i < nchars; i++)
+#if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
+  else
+#endif
+#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030  */
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1030 || MAC_OS_X_VERSION_MIN_REQUIRED == 1020
     {
-      CGContextShowGlyphsAtPoint (context, gx, gy, glyphs + i, 1);
-      if (overstrike_p)
-       CGContextShowGlyphsAtPoint (context, gx + 1.0f, gy, glyphs + i, 1);
-      gx += advances[i].width;
+      for (i = 0; i < nchars; i++)
+       {
+         CGContextShowGlyphsAtPoint (context, gx, gy, glyphs + i, 1);
+         if (overstrike_p)
+           CGContextShowGlyphsAtPoint (context, gx + 1.0f, gy, glyphs + i, 1);
+         gx += advances[i].width;
+       }
     }
 #endif
 #if USE_CG_DRAWING
@@ -2196,7 +2208,7 @@ pcm_init (pcm, count)
 
 static enum pcm_status
 pcm_get_status (pcm)
-     XCharStruct *pcm;
+     const XCharStruct *pcm;
 {
   int height = pcm->ascent + pcm->descent;
 
@@ -4219,7 +4231,7 @@ mac_focus_changed (type, dpyinfo, frame, bufp)
 static void
 x_detect_focus_change (dpyinfo, event, bufp)
      struct mac_display_info *dpyinfo;
-     EventRecord *event;
+     const EventRecord *event;
      struct input_event *bufp;
 {
   struct frame *frame;
@@ -5232,7 +5244,7 @@ static void
 x_scroll_bar_handle_click (bar, part_code, er, bufp)
      struct scroll_bar *bar;
      ControlPartCode part_code;
-     EventRecord *er;
+     const EventRecord *er;
      struct input_event *bufp;
 {
   int win_y, top_range;
@@ -6695,11 +6707,12 @@ xlfdpat_destroy (pat)
 
 static struct xlfdpat *
 xlfdpat_create (pattern)
-     char *pattern;
+     const char *pattern;
 {
   struct xlfdpat *pat;
   int nblocks, i, skip;
   unsigned char last_char, *p, *q, *anychar_head;
+  const unsigned char *ptr;
   struct xlfdpat_block *blk;
 
   pat = xmalloc (sizeof (struct xlfdpat));
@@ -6710,9 +6723,9 @@ xlfdpat_create (pattern)
   anychar_head = NULL;
   q = pat->buf;
   last_char = '\0';
-  for (p = pattern; *p; p++)
+  for (ptr = pattern; *ptr; ptr++)
     {
-      unsigned char c = *p;
+      unsigned char c = *ptr;
 
       if (c == '*')
        if (last_char == '*')
@@ -6816,14 +6829,15 @@ xlfdpat_exact_p (pat)
    that the pattern in *BLK matches with its prefix.  Return NULL
    there is no such strings.  STRING must be lowered in advance.  */
 
-static char *
+static const char *
 xlfdpat_block_match_1 (blk, string, start_max)
      struct xlfdpat_block *blk;
-     unsigned char *string;
+     const unsigned char *string;
      int start_max;
 {
   int start, infinity;
-  unsigned char *p, *s;
+  unsigned char *p;
+  const unsigned char *s;
 
   xassert (blk->len > 0);
   xassert (start_max + blk->len <= strlen (string));
@@ -6880,17 +6894,17 @@ xlfdpat_block_match_1 (blk, string, start_max)
   ((b)->len == 1 ? memchr ((s), (b)->last_char, (m) + 1) \
    : xlfdpat_block_match_1 (b, s, m))
 
-/* Check if XLFD pattern PAT, which is generated by `xfldpat_create',
+/* Check if XLFD pattern PAT, which is generated by `xlfdpat_create',
    matches with STRING.  STRING must be lowered in advance.  */
 
 static int
 xlfdpat_match (pat, string)
      struct xlfdpat *pat;
-     unsigned char *string;
+     const unsigned char *string;
 {
   int str_len, nblocks, i, start_max;
   struct xlfdpat_block *blk;
-  unsigned char *s;
+  const unsigned char *s;
 
   xassert (pat->nblocks > 0);
 
@@ -7061,7 +7075,7 @@ decode_mac_font_name (name, size, coding_system)
 
 static char *
 mac_to_x_fontname (name, size, style, charset)
-     char *name;
+     const char *name;
      int size;
      Style style;
      char *charset;
@@ -7108,7 +7122,8 @@ const int kDefaultFontSize = 12;
 
 static int
 parse_x_font_name (xf, family, size, style, charset)
-     char *xf, *family;
+     const char *xf;
+     char *family;
      int *size;
      Style *style;
      char *charset;
@@ -7191,10 +7206,10 @@ add_font_name_table_entry (char *font_name)
 
 static void
 add_mac_font_name (name, size, style, charset)
-     char *name;
+     const char *name;
      int size;
      Style style;
-     char *charset;
+     const char *charset;
 {
   if (size > 0)
     add_font_name_table_entry (mac_to_x_fontname (name, size, style, charset));
@@ -7496,7 +7511,7 @@ enum xlfd_scalable_field_index
     XLFD_SCL_LAST
   };
 
-static int xlfd_scalable_fields[] =
+static const int xlfd_scalable_fields[] =
   {
     6,                         /* PIXEL_SIZE */
     7,                         /* POINT_SIZE */
@@ -7506,14 +7521,16 @@ static int xlfd_scalable_fields[] =
 
 static Lisp_Object
 mac_do_list_fonts (pattern, maxnames)
-     char *pattern;
+     const char *pattern;
      int maxnames;
 {
   int i, n_fonts = 0;
   Lisp_Object font_list = Qnil;
   struct xlfdpat *pat;
-  char *scaled, *ptr;
-  int scl_val[XLFD_SCL_LAST], *field, *val;
+  char *scaled;
+  const char *ptr;
+  int scl_val[XLFD_SCL_LAST], *val;
+  const int *field;
   int exact;
 
   if (font_name_table == NULL)  /* Initialize when first used.  */
@@ -7763,7 +7780,8 @@ x_compute_min_glyph_bounds (f)
    fields are present, none is '*'.  */
 
 static int
-is_fully_specified_xlfd (char *p)
+is_fully_specified_xlfd (p)
+     const char *p;
 {
   int i;
   char *q;
@@ -7840,18 +7858,21 @@ mac_load_query_font (f, fontname)
   if (strcmp (charset, "iso10646-1") == 0) /* XXX */
     {
       OSStatus err;
-      ATSUAttributeTag tags[] = {kATSUFontTag, kATSUSizeTag,
-                                kATSUQDBoldfaceTag, kATSUQDItalicTag};
-      ByteCount sizes[] = {sizeof (ATSUFontID), sizeof (Fixed),
-                          sizeof (Boolean), sizeof (Boolean)};
+      static const ATSUAttributeTag tags[] =
+       {kATSUFontTag, kATSUSizeTag,
+        kATSUQDBoldfaceTag, kATSUQDItalicTag};
+      static const ByteCount sizes[] =
+       {sizeof (ATSUFontID), sizeof (Fixed),
+        sizeof (Boolean), sizeof (Boolean)};
       static Fixed size_fixed;
       static Boolean bold_p, italic_p;
-      ATSUAttributeValuePtr values[] = {&font_id, &size_fixed,
-                                       &bold_p, &italic_p};
-      ATSUFontFeatureType types[] = {kAllTypographicFeaturesType,
-                                    kDiacriticsType};
-      ATSUFontFeatureSelector selectors[] = {kAllTypeFeaturesOffSelector,
-                                            kDecomposeDiacriticsSelector};
+      static const ATSUAttributeValuePtr values[] =
+       {&font_id, &size_fixed,
+        &bold_p, &italic_p};
+      static const ATSUFontFeatureType types[] =
+       {kAllTypographicFeaturesType, kDiacriticsType};
+      static const ATSUFontFeatureSelector selectors[] =
+       {kAllTypeFeaturesOffSelector, kDecomposeDiacriticsSelector};
       Lisp_Object font_id_cons;
       FMFontStyle style;
 
@@ -8642,7 +8663,7 @@ extern void terminate_applescript();
    except `clear' (-> <clear>) on the KeyPad, `enter' (-> <kp-enter>)
    on the right of the Cmd key on laptops, and fn + `enter' (->
    <linefeed>). */
-static unsigned char keycode_to_xkeysym_table[] = {
+static const unsigned char keycode_to_xkeysym_table[] = {
   /*0x00*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
   /*0x10*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
   /*0x20*/ 0, 0, 0, 0, 0x0d /*return*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -8679,7 +8700,7 @@ static unsigned char keycode_to_xkeysym_table[] = {
    keyboard, and they may not be the same on other types of keyboards.
    If the destination is identical to the source (f1 ... f12), it
    doesn't map `fn' key to a modifier.  */
-static unsigned char fn_keycode_to_keycode_table[] = {
+static const unsigned char fn_keycode_to_keycode_table[] = {
   /*0x00*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
   /*0x10*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
   /*0x20*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -9137,7 +9158,9 @@ do_apple_menu (SInt16 menu_item)
    Mesander and IM - Window Manager A.  */
 
 static void
-do_grow_window (WindowPtr w, EventRecord *e)
+do_grow_window (w, e)
+     WindowPtr w;
+     const EventRecord *e;
 {
   Rect limit_rect;
   int rows, columns, width, height;
@@ -9321,8 +9344,8 @@ mac_store_event_ref_as_apple_event (class, id, class_key, id_key,
      Lisp_Object class_key, id_key;
      EventRef event;
      UInt32 num_params;
-     EventParamName *names;
-     EventParamType *types;
+     const EventParamName *names;
+     const EventParamType *types;
 {
   OSStatus err = eventNotHandledErr;
   Lisp_Object binding;
@@ -9383,10 +9406,10 @@ mac_handle_command_event (next_handler, event, data)
 {
   OSStatus result, err;
   HICommand command;
-  static EventParamName names[] = {kEventParamDirectObject,
-                                  kEventParamKeyModifiers};
-  static EventParamType types[] = {typeHICommand,
-                                  typeUInt32};
+  static const EventParamName names[] =
+    {kEventParamDirectObject, kEventParamKeyModifiers};
+  static const EventParamType types[] =
+    {typeHICommand, typeUInt32};
   int num_params = sizeof (names) / sizeof (names[0]);
 
   result = CallNextEventHandler (next_handler, event);
@@ -9410,7 +9433,8 @@ mac_handle_command_event (next_handler, event, data)
 static OSStatus
 init_command_handler ()
 {
-  EventTypeSpec specs[] = {{kEventClassCommand, kEventCommandProcess}};
+  static const EventTypeSpec specs[] =
+    {{kEventClassCommand, kEventCommandProcess}};
   static EventHandlerUPP handle_command_eventUPP = NULL;
 
   if (handle_command_eventUPP == NULL)
@@ -9570,18 +9594,18 @@ mac_handle_window_event (next_handler, event, data)
     case kEventWindowToolbarSwitchMode:
       result = CallNextEventHandler (next_handler, event);
       {
-       static EventParamName names[] = {kEventParamDirectObject,
-                                        kEventParamWindowMouseLocation,
-                                        kEventParamKeyModifiers,
-                                        kEventParamMouseButton,
-                                        kEventParamClickCount,
-                                        kEventParamMouseChord};
-       static EventParamType types[] = {typeWindowRef,
-                                        typeQDPoint,
-                                        typeUInt32,
-                                        typeMouseButton,
-                                        typeUInt32,
-                                        typeUInt32};
+       static const EventParamName names[] = {kEventParamDirectObject,
+                                              kEventParamWindowMouseLocation,
+                                              kEventParamKeyModifiers,
+                                              kEventParamMouseButton,
+                                              kEventParamClickCount,
+                                              kEventParamMouseChord};
+       static const EventParamType types[] = {typeWindowRef,
+                                              typeQDPoint,
+                                              typeUInt32,
+                                              typeMouseButton,
+                                              typeUInt32,
+                                              typeUInt32};
        int num_params = sizeof (names) / sizeof (names[0]);
 
        err = mac_store_event_ref_as_apple_event (0, 0,
@@ -9688,18 +9712,18 @@ mac_handle_font_event (next_handler, event, data)
   OSStatus result, err;
   Lisp_Object id_key;
   int num_params;
-  EventParamName *names;
-  EventParamType *types;
-  static EventParamName names_sel[] = {kEventParamATSUFontID,
-                                      kEventParamATSUFontSize,
-                                      kEventParamFMFontFamily,
-                                      kEventParamFMFontSize,
-                                      kEventParamFontColor};
-  static EventParamType types_sel[] = {typeATSUFontID,
-                                      typeATSUSize,
-                                      typeFMFontFamily,
-                                      typeFMFontSize,
-                                      typeFontColor};
+  const EventParamName *names;
+  const EventParamType *types;
+  static const EventParamName names_sel[] = {kEventParamATSUFontID,
+                                            kEventParamATSUFontSize,
+                                            kEventParamFMFontFamily,
+                                            kEventParamFMFontSize,
+                                            kEventParamFontColor};
+  static const EventParamType types_sel[] = {typeATSUFontID,
+                                            typeATSUSize,
+                                            typeFMFontFamily,
+                                            typeFMFontSize,
+                                            typeFontColor};
 
   result = CallNextEventHandler (next_handler, event);
   if (result != eventNotHandledErr)
@@ -9740,10 +9764,10 @@ mac_handle_text_input_event (next_handler, event, data)
   OSStatus result, err = noErr;
   Lisp_Object id_key = Qnil;
   int num_params;
-  EventParamName *names;
-  EventParamType *types;
+  const EventParamName *names;
+  const EventParamType *types;
   static UInt32 seqno_uaia = 0;
-  static EventParamName names_uaia[] =
+  static const EventParamName names_uaia[] =
     {kEventParamTextInputSendComponentInstance,
      kEventParamTextInputSendRefCon,
      kEventParamTextInputSendSLRec,
@@ -9756,7 +9780,7 @@ mac_handle_text_input_event (next_handler, event, data)
      kEventParamTextInputSendTextServiceEncoding,
      kEventParamTextInputSendTextServiceMacEncoding,
      EVENT_PARAM_TEXT_INPUT_SEQUENCE_NUMBER};
-  static EventParamType types_uaia[] =
+  static const EventParamType types_uaia[] =
     {typeComponentInstance,
      typeLongInteger,
      typeIntlWritingCode,
@@ -9773,12 +9797,12 @@ mac_handle_text_input_event (next_handler, event, data)
      typeUInt32,
      typeUInt32,
      typeUInt32};
-  static EventParamName names_ufke[] =
+  static const EventParamName names_ufke[] =
     {kEventParamTextInputSendComponentInstance,
      kEventParamTextInputSendRefCon,
      kEventParamTextInputSendSLRec,
      kEventParamTextInputSendText};
-  static EventParamType types_ufke[] =
+  static const EventParamType types_ufke[] =
     {typeComponentInstance,
      typeLongInteger,
      typeIntlWritingCode,
@@ -9931,12 +9955,12 @@ mac_store_service_event (event)
   OSStatus err;
   Lisp_Object id_key;
   int num_params;
-  EventParamName *names;
-  EventParamType *types;
-  static EventParamName names_pfm[] = {kEventParamServiceMessageName,
-                                      kEventParamServiceUserData};
-  static EventParamType types_pfm[] = {typeCFStringRef,
-                                      typeCFStringRef};
+  const EventParamName *names;
+  const EventParamType *types;
+  static const EventParamName names_pfm[] =
+    {kEventParamServiceMessageName, kEventParamServiceUserData};
+  static const EventParamType types_pfm[] =
+    {typeCFStringRef, typeCFStringRef};
 
   switch (GetEventKind (event))
     {
@@ -9974,7 +9998,7 @@ install_window_handler (window)
 {
   OSStatus err = noErr;
 #if USE_CARBON_EVENTS
-  EventTypeSpec specs_window[] =
+  static const EventTypeSpec specs_window[] =
     {{kEventClassWindow, kEventWindowUpdate},
      {kEventClassWindow, kEventWindowGetIdealSize},
      {kEventClassWindow, kEventWindowBoundsChanging},
@@ -9992,16 +10016,18 @@ install_window_handler (window)
      {kEventClassWindow, kEventWindowFocusRelinquish},
 #endif
   };
-  EventTypeSpec specs_mouse[] = {{kEventClassMouse, kEventMouseWheelMoved}};
+  static const EventTypeSpec specs_mouse[] =
+    {{kEventClassMouse, kEventMouseWheelMoved}};
   static EventHandlerUPP handle_window_eventUPP = NULL;
   static EventHandlerUPP handle_mouse_eventUPP = NULL;
 #if USE_MAC_FONT_PANEL
-  EventTypeSpec specs_font[] = {{kEventClassFont, kEventFontPanelClosed},
-                               {kEventClassFont, kEventFontSelection}};
+  static const EventTypeSpec specs_font[] =
+    {{kEventClassFont, kEventFontPanelClosed},
+     {kEventClassFont, kEventFontSelection}};
   static EventHandlerUPP handle_font_eventUPP = NULL;
 #endif
 #if USE_MAC_TSM
-  EventTypeSpec specs_text_input[] =
+  static const EventTypeSpec specs_text_input[] =
     {{kEventClassTextInput, kEventTextInputUpdateActiveInputArea},
      {kEventClassTextInput, kEventTextInputUnicodeForKeyEvent},
      {kEventClassTextInput, kEventTextInputOffsetToPos}};
@@ -11218,7 +11244,7 @@ mac_initialize_display_info ()
 
 static XrmDatabase
 mac_make_rdb (xrm_option)
-     char *xrm_option;
+     const char *xrm_option;
 {
   XrmDatabase database;
 
index e33f939..33692a8 100644 (file)
@@ -666,11 +666,11 @@ extern Lisp_Object mac_aedesc_to_lisp P_ ((const AEDesc *));
 extern OSErr mac_ae_put_lisp P_ ((AEDescList *, UInt32, Lisp_Object));
 #if TARGET_API_MAC_CARBON
 extern OSStatus create_apple_event_from_event_ref P_ ((EventRef, UInt32,
-                                                      EventParamName *,
-                                                      EventParamType *,
+                                                      const EventParamName *,
+                                                      const EventParamType *,
                                                       AppleEvent *));
 extern OSErr create_apple_event_from_drag_ref P_ ((DragRef, UInt32,
-                                                  FlavorType *,
+                                                  const FlavorType *,
                                                   AppleEvent *));
 extern CFStringRef cfstring_create_with_utf8_cstring P_ ((const char *));
 extern CFStringRef cfstring_create_with_string P_ ((Lisp_Object));
@@ -683,9 +683,10 @@ extern Lisp_Object cfboolean_to_lisp P_ ((CFBooleanRef));
 extern Lisp_Object cfobject_desc_to_lisp P_ ((CFTypeRef));
 extern Lisp_Object cfproperty_list_to_lisp P_ ((CFPropertyListRef, int, int));
 #endif
-extern void xrm_merge_string_database P_ ((XrmDatabase, char *));
-extern Lisp_Object xrm_get_resource P_ ((XrmDatabase, char *, char *));
-extern XrmDatabase xrm_get_preference_database P_ ((char *));
+extern void xrm_merge_string_database P_ ((XrmDatabase, const char *));
+extern Lisp_Object xrm_get_resource P_ ((XrmDatabase, const char *,
+                                        const char *));
+extern XrmDatabase xrm_get_preference_database P_ ((const char *));
 EXFUN (Fmac_get_preference, 4);
 
 /* arch-tag: 6b4ca125-5bef-476d-8ee8-31ed808b7e79
index f54feff..31c0fd1 100644 (file)
@@ -1689,7 +1689,7 @@ Lisp_Object Vminibuffer_completing_file_name;
 DEFUN ("completing-read", Fcompleting_read, Scompleting_read, 2, 8, 0,
        doc: /* Read a string in the minibuffer, with completion.
 PROMPT is a string to prompt with; normally it ends in a colon and a space.
-TABLE can be an list of strings, an alist, an obarray or a hash table.
+TABLE can be a list of strings, an alist, an obarray or a hash table.
 TABLE can also be a function to do the completion itself.
 PREDICATE limits completion to a subset of TABLE.
 See `try-completion' and `all-completions' for more details
index 8595c8f..834a32d 100644 (file)
@@ -2639,7 +2639,7 @@ check_x (void)
 #define Ctrl   0x0200  /* ctrl scan-code */
 #define Shift  0x0400  /* shift scan-code */
 
-static int extended_kbd; /* 101 (102) keyboard present.        */
+static int extended_kbd; /* 101 (102) keyboard present. */
 
 struct kbd_translate {
   unsigned char  sc;
index 9062e6c..7a8ad5c 100644 (file)
@@ -7074,7 +7074,7 @@ syms_of_process ()
 
   DEFVAR_BOOL ("delete-exited-processes", &delete_exited_processes,
               doc: /* *Non-nil means delete processes immediately when they exit.
-nil means don't delete them until `list-processes' is run.  */);
+A value of nil means don't delete them until `list-processes' is run.  */);
 
   delete_exited_processes = 1;
 
index ae80ad0..c0dd6e0 100644 (file)
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-   USA.         */
+   USA.  */
 
 /* TODO:
    - structure the opcode space into opcode+flag.
 # endif
 # define free xfree
 
-/* Converts the pointer to the char to BEG-based offset from the start.         */
+/* Converts the pointer to the char to BEG-based offset from the start.  */
 # define PTR_TO_OFFSET(d) POS_AS_IN_BUFFER (POINTER_TO_OFFSET (d))
 # define POS_AS_IN_BUFFER(p) ((p) + (NILP (re_match_object) || BUFFERP (re_match_object)))
 
@@ -540,7 +540,7 @@ init_syntax_once ()
 
 #  define REGEX_REALLOCATE_STACK(source, osize, nsize)                 \
    REGEX_REALLOCATE (source, osize, nsize)
-/* No need to explicitly free anything.         */
+/* No need to explicitly free anything.  */
 #  define REGEX_FREE_STACK(arg) ((void)0)
 
 # endif /* not REGEX_MALLOC */
@@ -654,7 +654,7 @@ typedef enum
   jump,
 
        /* Followed by two-byte relative address of place to resume at
-          in case of failure.  */
+          in case of failure.  */
   on_failure_jump,
 
        /* Like on_failure_jump, but pushes a placeholder instead of the
@@ -691,7 +691,7 @@ typedef enum
   jump_n,
 
        /* Set the following two-byte relative address to the
-          subsequent two-byte number.  The address *includes* the two
+          subsequent two-byte number.  The address *includes* the two
           bytes of number.  */
   set_number_at,
 
@@ -699,7 +699,7 @@ typedef enum
   wordend,     /* Succeeds if at word end.  */
 
   wordbound,   /* Succeeds if at a word boundary.  */
-  notwordbound,        /* Succeeds if not at a word boundary.  */
+  notwordbound,        /* Succeeds if not at a word boundary.  */
 
   symbeg,       /* Succeeds if at symbol beginning.  */
   symend,       /* Succeeds if at symbol end.  */
@@ -717,8 +717,8 @@ typedef enum
   after_dot,   /* Succeeds if after point.  */
 
   /* Matches any character whose category-set contains the specified
-     category. The operator is followed by a byte which contains a
-     category code (mnemonic ASCII character). */
+     category.  The operator is followed by a byte which contains a
+     category code (mnemonic ASCII character).  */
   categoryspec,
 
   /* Matches any character whose category-set does not contain the
@@ -807,7 +807,7 @@ extract_number_and_incr (destination, source)
 \f
 /* Store a multibyte character in three contiguous bytes starting
    DESTINATION, and increment DESTINATION to the byte after where the
-   character is stored.         Therefore, DESTINATION must be an lvalue.  */
+   character is stored.  Therefore, DESTINATION must be an lvalue.  */
 
 #define STORE_CHARACTER_AND_INCR(destination, character)       \
   do {                                                         \
@@ -818,7 +818,7 @@ extract_number_and_incr (destination, source)
   } while (0)
 
 /* Put into DESTINATION a character stored in three contiguous bytes
-   starting at SOURCE. */
+   starting at SOURCE.  */
 
 #define EXTRACT_CHARACTER(destination, source) \
   do {                                         \
@@ -854,13 +854,13 @@ extract_number_and_incr (destination, source)
    && (p)[2 + (c) / BYTEWIDTH] & (1 << ((c) % BYTEWIDTH)))
 
 /* Return the address of end of RANGE_TABLE.  COUNT is number of
-   ranges (which is a pair of (start, end)) in the RANGE_TABLE.         `* 2'
-   is start of range and end of range. `* 3' is size of each start
+   ranges (which is a pair of (start, end)) in the RANGE_TABLE.  `* 2'
+   is start of range and end of range.  `* 3' is size of each start
    and end.  */
 #define CHARSET_RANGE_TABLE_END(range_table, count)    \
   ((range_table) + (count) * 2 * 3)
 
-/* Test if C is in RANGE_TABLE.         A flag NOT is negated if C is in.
+/* Test if C is in RANGE_TABLE.  A flag NOT is negated if C is in.
    COUNT is number of ranges in RANGE_TABLE.  */
 #define CHARSET_LOOKUP_RANGE_TABLE_RAW(not, c, range_table, count)     \
   do                                                                   \
@@ -1667,7 +1667,7 @@ do {                                                                      \
      REGSTART, REGEND -- arrays of string positions.
 
    Also assumes the variables `fail_stack' and (if debugging), `bufp',
-   `pend', `string1', `size1', `string2', and `size2'. */
+   `pend', `string1', `size1', `string2', and `size2'.  */
 
 #define POP_FAILURE_POINT(str, pat)                                     \
 do {                                                                   \
@@ -1936,7 +1936,7 @@ struct range_table_work_area
 {
   int *table;                  /* actual work area.  */
   int allocated;               /* allocated size for work area in bytes.  */
-  int used;                    /* actually used size in words.  */
+  int used;                    /* actually used size in words.  */
   int bits;                    /* flag to record character classes */
 };
 
@@ -1978,7 +1978,7 @@ struct range_table_work_area
       FREE_STACK_RETURN (tem);                                         \
   } while (0)
 
-/* Free allocated memory for WORK_AREA.         */
+/* Free allocated memory for WORK_AREA.  */
 #define FREE_RANGE_TABLE_WORK_AREA(work_area)  \
   do {                                         \
     if ((work_area).table)                     \
@@ -2478,7 +2478,7 @@ regex_compile (pattern, size, syntax, bufp)
   re_char *beg_interval;
 
   /* Address of the place where a forward jump should go to the end of
-     the containing expression.         Each alternative of an `or' -- except the
+     the containing expression.  Each alternative of an `or' -- except the
      last -- ends with a forward jump of this sort.  */
   unsigned char *fixup_alt_jump = 0;
 
@@ -2550,11 +2550,11 @@ regex_compile (pattern, size, syntax, bufp)
       if (bufp->buffer)
        { /* If zero allocated, but buffer is non-null, try to realloc
             enough space.  This loses if buffer's address is bogus, but
-            that is the user's responsibility.  */
+            that is the user's responsibility.  */
          RETALLOC (bufp->buffer, INIT_BUF_SIZE, unsigned char);
        }
       else
-       { /* Caller did not allocate a buffer.  Do it for them.  */
+       { /* Caller did not allocate a buffer.  Do it for them.  */
          bufp->buffer = TALLOC (INIT_BUF_SIZE, unsigned char);
        }
       if (!bufp->buffer) FREE_STACK_RETURN (REG_ESPACE);
@@ -2618,15 +2618,15 @@ regex_compile (pattern, size, syntax, bufp)
            p = pattern = whitespace_regexp;
            pend = p + strlen (p);
            break;
-         }    
+         }
 
        case '^':
          {
-           if (   /* If at start of pattern, it's an operator.  */
+           if (   /* If at start of pattern, it's an operator.  */
                   p == pattern + 1
-                  /* If context independent, it's an operator.  */
+                  /* If context independent, it's an operator.  */
                || syntax & RE_CONTEXT_INDEP_ANCHORS
-                  /* Otherwise, depends on what's come before.  */
+                  /* Otherwise, depends on what's come before.  */
                || at_begline_loc_p (pattern, p, syntax))
              BUF_PUSH ((syntax & RE_NO_NEWLINE_ANCHOR) ? begbuf : begline);
            else
@@ -2639,7 +2639,7 @@ regex_compile (pattern, size, syntax, bufp)
          {
            if (   /* If at end of pattern, it's an operator.  */
                   p == pend
-                  /* If context independent, it's an operator.  */
+                  /* If context independent, it's an operator.  */
                || syntax & RE_CONTEXT_INDEP_ANCHORS
                   /* Otherwise, depends on what's next.  */
                || at_endline_loc_p (p, pend, syntax))
@@ -2667,14 +2667,14 @@ regex_compile (pattern, size, syntax, bufp)
            }
 
          {
-           /* 1 means zero (many) matches is allowed.  */
+           /* 1 means zero (many) matches is allowed.  */
            boolean zero_times_ok = 0, many_times_ok = 0;
            boolean greedy = 1;
 
            /* If there is a sequence of repetition chars, collapse it
               down to just one (the right one).  We can't combine
               interval operators with these because of, e.g., `a{2}*',
-              which should only match an even number of `a's.  */
+              which should only match an even number of `a's.  */
 
            for (;;)
              {
@@ -2714,7 +2714,7 @@ regex_compile (pattern, size, syntax, bufp)
              break;
 
            /* Now we know whether or not zero matches is allowed
-              and also whether or not two or more matches is allowed.  */
+              and also whether or not two or more matches is allowed.  */
            if (greedy)
              {
                if (many_times_ok)
@@ -2821,7 +2821,7 @@ regex_compile (pattern, size, syntax, bufp)
            laststart = b;
 
            /* We test `*p == '^' twice, instead of using an if
-              statement, so we only need one BUF_PUSH.  */
+              statement, so we only need one BUF_PUSH.  */
            BUF_PUSH (*p == '^' ? charset_not : charset);
            if (*p == '^')
              p++;
@@ -2829,7 +2829,7 @@ regex_compile (pattern, size, syntax, bufp)
            /* Remember the first position in the bracket expression.  */
            p1 = p;
 
-           /* Push the number of bytes in the bitmap.  */
+           /* Push the number of bytes in the bitmap.  */
            BUF_PUSH ((1 << BYTEWIDTH) / BYTEWIDTH);
 
            /* Clear the whole map.  */
@@ -2840,7 +2840,7 @@ regex_compile (pattern, size, syntax, bufp)
                && (syntax & RE_HAT_LISTS_NOT_NEWLINE))
              SET_LIST_BIT ('\n');
 
-           /* Read in characters and ranges, setting map bits.  */
+           /* Read in characters and ranges, setting map bits.  */
            for (;;)
              {
                boolean escaped_char = false;
@@ -2864,7 +2864,7 @@ regex_compile (pattern, size, syntax, bufp)
                  }
                else
                  {
-                   /* Could be the end of the bracket expression.      If it's
+                   /* Could be the end of the bracket expression.  If it's
                       not (i.e., when the bracket expression is `[]' so
                       far), the ']' character bit gets set way below.  */
                    if (c == ']' && p2 != p1)
@@ -2881,7 +2881,7 @@ regex_compile (pattern, size, syntax, bufp)
                if (!escaped_char &&
                    syntax & RE_CHAR_CLASSES && c == '[' && *p == ':')
                  {
-                   /* Leave room for the null.  */
+                   /* Leave room for the null.  */
                    unsigned char str[CHAR_CLASS_MAX_LENGTH + 1];
                    const unsigned char *class_beg;
 
@@ -2939,7 +2939,8 @@ regex_compile (pattern, size, syntax, bufp)
                         for (ch = 0; ch < 1 << BYTEWIDTH; ++ch)
                          {
                            int translated = TRANSLATE (ch);
-                           if (re_iswctype (btowc (ch), cc))
+                           if (translated < (1 << BYTEWIDTH)
+                               && re_iswctype (btowc (ch), cc))
                              SET_LIST_BIT (translated);
                          }
 
@@ -2962,7 +2963,7 @@ regex_compile (pattern, size, syntax, bufp)
 
                        /* Because the `:' may starts the range, we
                           can't simply set bit and repeat the loop.
-                          Instead, just set it to C and handle below.  */
+                          Instead, just set it to C and handle below.  */
                        c = ':';
                      }
                  }
@@ -3020,7 +3021,14 @@ regex_compile (pattern, size, syntax, bufp)
                      {
                        for (this_char = range_start; this_char <= range_end;
                             this_char++)
-                         SET_LIST_BIT (TRANSLATE (this_char));
+                         {
+                           int translated = TRANSLATE (this_char);
+                           if (translated < (1 << BYTEWIDTH))
+                             SET_LIST_BIT (translated);
+                           else
+                             SET_RANGE_TABLE_WORK_AREA
+                               (range_table_work, translated, translated);
+                         }
                      }
                  }
                else
@@ -3029,7 +3037,7 @@ regex_compile (pattern, size, syntax, bufp)
              }
 
            /* Discard any (non)matching list bytes that are all 0 at the
-              end of the map.  Decrease the map-length byte too.  */
+              end of the map.  Decrease the map-length byte too.  */
            while ((int) b[-1] > 0 && b[b[-1] - 1] == 0)
              b[-1]--;
            b += b[-1];
@@ -3148,7 +3156,7 @@ regex_compile (pattern, size, syntax, bufp)
                  }
 
                /* These are the values to restore when we hit end of this
-                  group.        They are all relative offsets, so that if the
+                  group.  They are all relative offsets, so that if the
                   whole pattern moves because of realloc, they will still
                   be valid.  */
                COMPILE_STACK_TOP.begalt_offset = begalt - bufp->buffer;
@@ -3204,7 +3212,7 @@ regex_compile (pattern, size, syntax, bufp)
              {
                /* We don't just want to restore into `regnum', because
                   later groups should continue to be numbered higher,
-                  as in `(ab)c(de)' -- the second group is #2.  */
+                  as in `(ab)c(de)' -- the second group is #2.  */
                regnum_t this_group_regnum;
 
                compile_stack.avail--;
@@ -3221,7 +3229,7 @@ regex_compile (pattern, size, syntax, bufp)
                pending_exact = 0;
 
                /* We're at the end of the group, so now we know how many
-                  groups were inside this one.  */
+                  groups were inside this one.  */
                if (this_group_regnum <= MAX_REGNUM && this_group_regnum > 0)
                  BUF_PUSH_2 (stop_memory, this_group_regnum);
              }
@@ -3236,7 +3244,7 @@ regex_compile (pattern, size, syntax, bufp)
                goto normal_char;
 
              /* Insert before the previous alternative a jump which
-                jumps to this alternative if the former fails.  */
+                jumps to this alternative if the former fails.  */
              GET_BUFFER_SPACE (3);
              INSERT_JUMP (on_failure_jump, begalt, b + 6);
              pending_exact = 0;
@@ -3373,7 +3381,7 @@ regex_compile (pattern, size, syntax, bufp)
                        b += 5;
 
                        /* Code to initialize the lower bound.  Insert
-                          before the `succeed_n'.       The `5' is the last two
+                          before the `succeed_n'.  The `5' is the last two
                           bytes of this `set_number_at', plus 3 bytes of
                           the following `succeed_n'.  */
                        insert_op2 (set_number_at, laststart, 5, lower_bound, b);
@@ -3443,7 +3451,7 @@ regex_compile (pattern, size, syntax, bufp)
 
 #ifdef emacs
            /* There is no way to specify the before_dot and after_dot
-              operators.  rms says this is ok.  --karl  */
+              operators.  rms says this is ok.  --karl  */
            case '=':
              BUF_PUSH (at_dot);
              break;
@@ -3588,7 +3596,7 @@ regex_compile (pattern, size, syntax, bufp)
              /* We have only one byte following the exactn for the count.  */
              || *pending_exact >= (1 << BYTEWIDTH) - MAX_MULTIBYTE_LENGTH
 
-             /* If followed by a repetition operator.  */
+             /* If followed by a repetition operator.  */
              || (p != pend && (*p == '*' || *p == '^'))
              || ((syntax & RE_BK_PLUS_QM)
                  ? p + 1 < pend && *p == '\\' && (p[1] == '+' || p[1] == '?')
@@ -3680,7 +3688,7 @@ regex_compile (pattern, size, syntax, bufp)
 \f
 /* Subroutines for `regex_compile'.  */
 
-/* Store OP at LOC followed by two-byte integer parameter ARG. */
+/* Store OP at LOC followed by two-byte integer parameter ARG.  */
 
 static void
 store_op1 (op, loc, arg)
@@ -3832,7 +3840,7 @@ analyse_first (p, pend, fastmap, multibyte)
   boolean not;
 
   /* If all elements for base leading-codes in fastmap is set, this
-     flag is set true. */
+     flag is set true.  */
   boolean match_any_multibyte_characters = false;
 
   assert (p);
@@ -3880,7 +3888,7 @@ analyse_first (p, pend, fastmap, multibyte)
 
 
       /* Following are the cases which match a character.  These end
-        with `break'.  */
+        with `break'.  */
 
        case exactn:
          if (fastmap)
@@ -4102,7 +4110,7 @@ analyse_first (p, pend, fastmap, multibyte)
 
       /* Getting here means we have found the possible starting
         characters for one path of the pattern -- and that the empty
-        string does not match.  We need not follow this path further.  */
+        string does not match.  We need not follow this path further.  */
       return 0;
     } /* while p */
 
@@ -4137,7 +4145,7 @@ re_compile_fastmap (bufp)
 
   assert (fastmap && bufp->buffer);
 
-  bzero (fastmap, 1 << BYTEWIDTH);  /* Assume nothing's valid. */
+  bzero (fastmap, 1 << BYTEWIDTH);  /* Assume nothing's valid.  */
   bufp->fastmap_accurate = 1;      /* It will be when we're done.  */
 
   analysis = analyse_first (bufp->buffer, bufp->buffer + bufp->used,
@@ -4182,7 +4190,7 @@ re_set_registers (bufp, regs, num_regs, starts, ends)
 }
 WEAK_ALIAS (__re_set_registers, re_set_registers)
 \f
-/* Searching routines. */
+/* Searching routines.  */
 
 /* Like re_search_2, below, but only one string is specified, and
    doesn't let you say where to stop matching. */
@@ -4251,7 +4259,7 @@ re_search_2 (bufp, str1, size1, str2, size2, startpos, range, regs, stop)
   int endpos = startpos + range;
   boolean anchored_start;
 
-  /* Nonzero if we have to concern multibyte character.         */
+  /* Nonzero if we have to concern multibyte character.  */
   const boolean multibyte = RE_MULTIBYTE_P (bufp);
 
   /* Check for out-of-range STARTPOS.  */
@@ -4321,7 +4329,7 @@ re_search_2 (bufp, str1, size1, str2, size2, startpos, range, regs, stop)
       /* If a fastmap is supplied, skip quickly over characters that
         cannot be the start of a match.  If the pattern can match the
         null string, however, we don't need to skip characters; we want
-        the first null string.  */
+        the first null string.  */
       if (fastmap && startpos < total_size && !bufp->can_be_null)
        {
          register re_char *d;
@@ -4329,7 +4337,7 @@ re_search_2 (bufp, str1, size1, str2, size2, startpos, range, regs, stop)
 
          d = POS_ADDR_VSTRING (startpos);
 
-         if (range > 0)        /* Searching forwards.  */
+         if (range > 0)        /* Searching forwards.  */
            {
              register int lim = 0;
              int irange = range;
@@ -4403,7 +4411,7 @@ re_search_2 (bufp, str1, size1, str2, size2, startpos, range, regs, stop)
 
              startpos += irange - range;
            }
-         else                          /* Searching backwards.  */
+         else                          /* Searching backwards.  */
            {
              int room = (startpos >= size1
                          ? size2 + size1 - startpos
@@ -4526,7 +4534,7 @@ static int bcmp_translate _RE_ARGS((re_char *s1, re_char *s2,
      }                                                                 \
 
 /* Test if at very beginning or at very end of the virtual concatenation
-   of `string1' and `string2'. If only one string, it's `string2'.  */
+   of `string1' and `string2'.  If only one string, it's `string2'.  */
 #define AT_STRINGS_BEG(d) ((d) == (size1 ? string1 : string2) || !size2)
 #define AT_STRINGS_END(d) ((d) == end2)
 
@@ -4547,7 +4555,7 @@ static int bcmp_translate _RE_ARGS((re_char *s1, re_char *s2,
 
    The DEC Alpha C compiler 3.x generates incorrect code for the
    test         WORDCHAR_P (d - 1) != WORDCHAR_P (d)  in the expansion of
-   AT_WORD_BOUNDARY, so this code is disabled. Expanding the
+   AT_WORD_BOUNDARY, so this code is disabled.  Expanding the
    macro and introducing temporary variables works around the bug.  */
 
 #if 0
@@ -4749,7 +4757,7 @@ mutually_exclusive_p (bufp, p1, p2)
        {
          /* Now, we are sure that P2 has no range table.
             So, for the size of bitmap in P2, `p2[1]' is
-            enough.    But P1 may have range table, so the
+            enough.  But P1 may have range table, so the
             size of bitmap table of P1 is extracted by
             using macro `CHARSET_BITMAP_SIZE'.
 
@@ -4780,7 +4788,7 @@ mutually_exclusive_p (bufp, p1, p2)
            {
              int idx;
              /* We win if the charset_not inside the loop lists
-                every character listed in the charset after.    */
+                every character listed in the charset after.  */
              for (idx = 0; idx < (int) p2[1]; idx++)
                if (! (p2[2 + idx] == 0
                       || (idx < CHARSET_BITMAP_SIZE (p1)
@@ -4874,7 +4882,7 @@ WEAK_ALIAS (__re_match, re_match)
 
 #ifdef emacs
 /* In Emacs, this is the string or buffer in which we
-   are matching.  It is used for looking up syntax properties. */
+   are matching.  It is used for looking up syntax properties.  */
 Lisp_Object re_match_object;
 #endif
 
@@ -4884,11 +4892,11 @@ Lisp_Object re_match_object;
    matching at STOP.
 
    If REGS is non-null and the `no_sub' field of BUFP is nonzero, we
-   store offsets for the substring each group matched in REGS. See the
+   store offsets for the substring each group matched in REGS.  See the
    documentation for exactly how many groups we fill.
 
    We return -1 if no match, -2 if an internal error (such as the
-   failure stack overflowing). Otherwise, we return the length of the
+   failure stack overflowing).  Otherwise, we return the length of the
    matched substring.  */
 
 int
@@ -4920,7 +4928,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
 WEAK_ALIAS (__re_match_2, re_match_2)
 
 /* This is a separate function so that we can force an alloca cleanup
-   afterwards. */
+   afterwards.  */
 static int
 re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
      struct re_pattern_buffer *bufp;
@@ -4939,7 +4947,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
   re_char *end1, *end2;
 
   /* Pointers into string1 and string2, just past the last characters in
-     each to consider matching.         */
+     each to consider matching.  */
   re_char *end_match_1, *end_match_2;
 
   /* Where we are in the data, and the end of the current string.  */
@@ -4955,10 +4963,10 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
   re_char *p = bufp->buffer;
   re_char *pend = p + bufp->used;
 
-  /* We use this to map every character in the string. */
+  /* We use this to map every character in the string.  */
   RE_TRANSLATE_TYPE translate = bufp->translate;
 
-  /* Nonzero if we have to concern multibyte character.         */
+  /* Nonzero if we have to concern multibyte character.  */
   const boolean multibyte = RE_MULTIBYTE_P (bufp);
 
   /* Failure point stack.  Each place that can handle a failure further
@@ -4967,8 +4975,8 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
      the subexpressions we're currently inside, plus the number of such
      registers, and, finally, two char *'s.  The first char * is where
      to resume scanning the pattern; the second one is where to resume
-     scanning the strings.     */
-#ifdef MATCH_MAY_ALLOCATE /* otherwise, this is global.         */
+     scanning the strings.  */
+#ifdef MATCH_MAY_ALLOCATE /* otherwise, this is global.  */
   fail_stack_type fail_stack;
 #endif
 #ifdef DEBUG
@@ -4982,7 +4990,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
 #endif
 
   /* We fill all the registers internally, independent of what we
-     return, for use in backreferences.         The number here includes
+     return, for use in backreferences.  The number here includes
      an element for register zero.  */
   size_t num_regs = bufp->re_nsub + 1;
 
@@ -5008,7 +5016,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
 
   /* Logically, this is `best_regend[0]'.  But we don't want to have to
      allocate space for that if we're not allocating space for anything
-     else (see below). Also, we never need info about register 0 for
+     else (see below).  Also, we never need info about register 0 for
      any of the other register vectors, and it seems rather a kludge to
      treat `best_regend' differently than the rest.  So we keep track of
      the end of the best match so far in a separate variable.  We
@@ -5066,7 +5074,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
     regstart[reg] = regend[reg] = NULL;
 
   /* We move `string1' into `string2' if the latter's empty -- but not if
-     `string1' is null.         */
+     `string1' is null.  */
   if (size2 == 0 && string1 != NULL)
     {
       string2 = string1;
@@ -5123,7 +5131,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
   DEBUG_PRINT_DOUBLE_STRING (d, string1, size1, string2, size2);
   DEBUG_PRINT1 ("'\n");
 
-  /* This loops over pattern commands. It exits by returning from the
+  /* This loops over pattern commands.  It exits by returning from the
      function if the match is complete, or it drops through if the match
      fails at this starting point in the input data.  */
   for (;;)
@@ -5146,7 +5154,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
              boolean best_match_p;
 
              /* AIX compiler got confused when this was combined
-                with the previous declaration.  */
+                with the previous declaration.  */
              if (same_str_p)
                best_match_p = d > match_end;
              else
@@ -5184,7 +5192,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
                     end_match_1' while the restored d is in string2.
                     For example, the pattern `x.*y.*z' against the
                     strings `x-' and `y-z-', if the two strings are
-                    not consecutive in memory.  */
+                    not consecutive in memory.  */
                  DEBUG_PRINT1 ("Restoring best registers.\n");
 
                  d = match_end;
@@ -5207,7 +5215,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
            {
              /* Have the register data arrays been allocated?  */
              if (bufp->regs_allocated == REGS_UNALLOCATED)
-               { /* No.  So allocate them with malloc.  We need one
+               { /* No.  So allocate them with malloc.  We need one
                     extra element beyond `num_regs' for the `-1' marker
                     GNU code uses.  */
                  regs->num_regs = MAX (RE_NREGS, num_regs + 1);
@@ -5239,7 +5247,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
              else
                {
                  /* These braces fend off a "empty body in an else-statement"
-                    warning under GCC when assert expands to nothing.  */
+                    warning under GCC when assert expands to nothing.  */
                  assert (bufp->regs_allocated == REGS_FIXED);
                }
 
@@ -5271,7 +5279,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
                 were in the pattern, set the extra elements to -1.  If
                 we (re)allocated the registers, this is the case,
                 because we always allocate enough to have at least one
-                -1 at the end.  */
+                -1 at the end.  */
              for (reg = num_regs; reg < regs->num_regs; reg++)
                regs->start[reg] = regs->end[reg] = -1;
            } /* regs && !bufp->no_sub */
@@ -5289,7 +5297,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
          return mcnt;
        }
 
-      /* Otherwise match next pattern command. */
+      /* Otherwise match next pattern command.  */
       switch (SWITCH_ENUM_CAST ((re_opcode_t) *p++))
        {
        /* Ignore these.  Used to ignore the n of succeed_n's which
@@ -5302,9 +5310,9 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
          DEBUG_PRINT1 ("EXECUTING succeed.\n");
          goto succeed_label;
 
-       /* Match the next n pattern characters exactly.  The following
+       /* Match the next n pattern characters exactly.  The following
           byte in the pattern defines n, and the n bytes after that
-          are the characters to match.  */
+          are the characters to match.  */
        case exactn:
          mcnt = *p++;
          DEBUG_PRINT2 ("EXECUTING exactn %d.\n", mcnt);
@@ -5468,7 +5476,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
        /* The beginning of a group is represented by start_memory.
           The argument is the register number.  The text
           matched within the group is recorded (in the internal
-          registers data structure) under the register number.  */
+          registers data structure) under the register number.  */
        case start_memory:
          DEBUG_PRINT2 ("EXECUTING start_memory %d:\n", *p);
 
@@ -5517,14 +5525,14 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
        case duplicate:
          {
            register re_char *d2, *dend2;
-           int regno = *p++;   /* Get which register to match against.  */
+           int regno = *p++;   /* Get which register to match against.  */
            DEBUG_PRINT2 ("EXECUTING duplicate %d.\n", regno);
 
-           /* Can't back reference a group which we've never matched.  */
+           /* Can't back reference a group which we've never matched.  */
            if (REG_UNSET (regstart[regno]) || REG_UNSET (regend[regno]))
              goto fail;
 
-           /* Where in input to try to start matching.  */
+           /* Where in input to try to start matching.  */
            d2 = regstart[regno];
 
            /* Remember the start point to rollback upon failure.  */
@@ -5637,7 +5645,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
           pushes NULL as the value for the string on the stack.  Then
           `POP_FAILURE_POINT' will keep the current value for the
           string, instead of restoring it.  To see why, consider
-          matching `foo\nbar' against `.*\n'.  The .* matches the foo;
+          matching `foo\nbar' against `.*\n'.  The .* matches the foo;
           then the . fails against the \n.  But the next thing we want
           to do is match the \n against the \n; if we restored the
           string value, we would be back at the foo.
@@ -5782,7 +5790,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
          IMMEDIATE_QUIT_CHECK;
          EXTRACT_NUMBER_AND_INCR (mcnt, p);    /* Get the amount to jump.  */
          DEBUG_PRINT2 ("EXECUTING jump %d ", mcnt);
-         p += mcnt;                            /* Do the jump.  */
+         p += mcnt;                            /* Do the jump.  */
          DEBUG_PRINT2 ("(to %p).\n", p);
          break;
 
@@ -5875,7 +5883,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
              if (/* Case 2: Only one of S1 and S2 is Sword.  */
                  ((s1 == Sword) != (s2 == Sword))
                  /* Case 3: Both of S1 and S2 are Sword, and macro
-                    WORD_BOUNDARY_P (C1, C2) returns nonzero.  */
+                    WORD_BOUNDARY_P (C1, C2) returns nonzero.  */
                  || ((s1 == Sword) && WORD_BOUNDARY_P (c1, c2)))
                not = !not;
            }
@@ -5889,7 +5897,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
 
          /* We FAIL in one of the following cases: */
 
-         /* Case 1: D is at the end of string.  */
+         /* Case 1: D is at the end of string.  */
          if (AT_STRINGS_END (d))
            goto fail;
          else
@@ -5921,7 +5929,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
                  s1 = SYNTAX (c1);
 
                  /* ... and S1 is Sword, and WORD_BOUNDARY_P (C1, C2)
-                    returns 0.  */
+                    returns 0.  */
                  if ((s1 == Sword) && !WORD_BOUNDARY_P (c1, c2))
                    goto fail;
                }
@@ -5965,7 +5973,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
                  s2 = SYNTAX (c2);
 
                  /* ... and S2 is Sword, and WORD_BOUNDARY_P (C1, C2)
-                    returns 0.  */
+                    returns 0.  */
                  if ((s2 == Sword) && !WORD_BOUNDARY_P (c1, c2))
          goto fail;
                }
@@ -5977,7 +5985,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
 
          /* We FAIL in one of the following cases: */
 
-         /* Case 1: D is at the end of string.  */
+         /* Case 1: D is at the end of string.  */
          if (AT_STRINGS_END (d))
            goto fail;
          else
@@ -5994,7 +6002,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
              PREFETCH ();
              c2 = RE_STRING_CHAR (d, dend - d);
              s2 = SYNTAX (c2);
-       
+
              /* Case 2: S2 is neither Sword nor Ssymbol. */
              if (s2 != Sword && s2 != Ssymbol)
                goto fail;
index 02225a9..c23987d 100644 (file)
 */
 #define BROKEN_GET_CURRENT_DIR_NAME 1
 
+/* aix3-1.h defined _NO_PROTO, probably to work around an AIX compiler
+   that did not handle prototypes.  On (at least) AIX 5.2, this causes
+   the proper prototype to be thrown away for lseek64, so compiled
+   Lisp files do not load correctly and compilation fails.
+
+   The AIX compiler should have learned about function prototypes long
+   ago, so we can probably go ahead and undefine _NO_PROTO.  However,
+   if someone can demonstrate that this problem still exists for AIX
+   4, this should be moved into a new file (aix5.h).
+*/
+
+#undef _NO_PROTO
+
+
 /* arch-tag: 38fe75ea-6aef-42bd-8449-bc34d921a562
    (do not change this comment) */
index 55d9a72..7116d24 100644 (file)
@@ -377,7 +377,7 @@ Boston, MA 02110-1301, USA.  */
     extern void *__libc_ia64_register_backing_store_base;      \
     __builtin_ia64_flushrs ();                                 \
     mark_memory (__libc_ia64_register_backing_store_base,      \
-                __builtin_ia64_bsp ());                        \
+                __builtin_ia64_bsp (), 0);                     \
   } while (0)
 #endif
 #endif
index fa4ca56..461df7a 100644 (file)
@@ -279,7 +279,7 @@ Boston, MA 02110-1301, USA.  */
 #define HAVE_STRFTIME 1
 
 #define LOCALTIME_CACHE
-#undef  HAVE_INET_SOCKETS
+#define HAVE_INET_SOCKETS 1
 
 #undef  HAVE_AIX_SMT_EXP
 
index 206ff55..c4bfddf 100644 (file)
 
 #define GC_MARK_STACK  GC_MAKE_GCPROS_NOOPS
 
+/* Use sigprocmask and friends instead of sigblock;
+   sigblock is considered obsolete on NetBSD.  */
+
+#define POSIX_SIGNALS  1
+
 /* arch-tag: e80f364a-04e9-4faf-93cb-f36a0fe95c81
    (do not change this comment) */
index 39e48da..3b996de 100644 (file)
 #undef LD_SWITCH_SYSTEM
 #ifdef __ELF__
 
-/*  Han Boetes <han@mijncomputer.nl> says this
-    is necessary,  otherwise Emacs dumps core on elf systems.  */
+  /*  Han Boetes <han@mijncomputer.nl> says this
+      is necessary,  otherwise Emacs dumps core on elf systems.  */
 #define LD_SWITCH_SYSTEM LD_SWITCH_SYSTEM_tmp -Z
 
-#else
+/* The version of gcc on OpenBSD doesn't search /usr/local/lib by
+   default.  */
+#define LD_SWITCH_X_DEFAULT -L/usr/local/lib
 
+#else
+  
 #define LD_SWITCH_SYSTEM LD_SWITCH_SYSTEM_tmp
+#define LD_SWITCH_X_DEFAULT -L/usr/local/lib
 
 #endif
 
index 7c3151b..d6572c5 100644 (file)
@@ -1514,7 +1514,7 @@ simple_search (n, pat, len, len_byte, trt, pos, pos_byte, lim, lim_byte)
            int this_len_byte = len_byte;
            unsigned char *p = pat;
 
-           if (pos - len < lim)
+           if (this_pos < lim || this_pos_byte < lim_byte)
              goto stop;
 
            while (this_len > 0)
index 6f955a7..6f8e3ec 100644 (file)
@@ -1015,14 +1015,14 @@ alsa_configure (sd)
 
   val = sd->format;
   err = snd_pcm_hw_params_set_format (p->handle, p->hwparams, val);
-  if (err < 0) 
+  if (err < 0)
     alsa_sound_perror ("Could not set sound format", err);
 
   uval = sd->sample_rate;
   err = snd_pcm_hw_params_set_rate_near (p->handle, p->hwparams, &uval, 0);
   if (err < 0)
     alsa_sound_perror ("Could not set sample rate", err);
-  
+
   val = sd->channels;
   err = snd_pcm_hw_params_set_channels (p->handle, p->hwparams, val);
   if (err < 0)
@@ -1072,11 +1072,11 @@ alsa_configure (sd)
   p->hwparams = NULL;
   snd_pcm_sw_params_free (p->swparams);
   p->swparams = NULL;
-  
+
   err = snd_pcm_prepare (p->handle);
   if (err < 0)
     alsa_sound_perror ("Could not prepare audio interface for use", err);
-  
+
   if (sd->volume > 0)
     {
       int chn;
@@ -1098,7 +1098,7 @@ alsa_configure (sd)
                     long pmin, pmax;
                     snd_mixer_selem_get_playback_volume_range (e, &pmin, &pmax);
                     long vol = pmin + (sd->volume * (pmax - pmin)) / 100;
-                    
+
                     for (chn = 0; chn <= SND_MIXER_SCHN_LAST; chn++)
                       snd_mixer_selem_set_playback_volume (e, chn, vol);
                   }
@@ -1230,9 +1230,9 @@ alsa_write (sd, buffer, nbytes)
                                        err);
                 }
             }
-          else 
+          else
             alsa_sound_perror ("Error writing to sound device", err);
-          
+
         }
       else
         nwritten += err * fact;
@@ -1374,7 +1374,7 @@ do_play_sound (psz_file, ui_volume)
 DEFUN ("play-sound-internal", Fplay_sound_internal, Splay_sound_internal, 1, 1, 0,
        doc: /* Play sound SOUND.
 
-Internal use only, use `play-sound' instead.\n  */)
+Internal use only, use `play-sound' instead.  */)
      (sound)
      Lisp_Object sound;
 {
index 123763d..88800c0 100644 (file)
@@ -69,9 +69,9 @@ extern char *tzname[];
 #if DO_MULTIBYTE
 # if HAVE_MBRLEN
 #  include <wchar.h>
-#   ifdef HAVE_SYS__MBSTATE_H  /* previously tested __hpux */
-#     include <sys/_mbstate_t.h>
-#   endif
+#  ifdef HAVE_SYS__MBSTATE_T_H       /* previously tested __hpux */
+#   include <sys/_mbstate_t.h>
+#  endif
 #  if !defined (mbsinit) && !defined (HAVE_MBSINIT)
 #   define mbsinit(ps) 1
 #  endif /* !defined (mbsinit) && !defined (HAVE_MBSINIT) */
index 052191d..55f73d6 100644 (file)
@@ -1470,7 +1470,7 @@ skip_chars (forwardp, syntaxp, string, lim, handle_iso_classes)
              const unsigned char *class_beg = str + i_byte + 1;
              const unsigned char *class_end = class_beg;
              const unsigned char *class_limit = str + size_byte - 2;
-             /* Leave room for the null.        */
+             /* Leave room for the null.  */
              unsigned char class_name[CHAR_CLASS_MAX_LENGTH + 1];
              re_wctype_t cc;
 
index 07f5f2e..1068c7a 100644 (file)
@@ -3863,7 +3863,7 @@ set_file_times (filename, atime, mtime)
  *                                     sdcsvax!rmr or rmr@uscd
  *
  * Severely hacked over by John Gilmore to make a 4.2BSD compatible
- * subroutine. 11Mar86; hoptoad!gnu
+ * subroutine.  11Mar86; hoptoad!gnu
  *
  * Modified by rmtodd@uokmax 6-28-87 -- when making an already existing dir,
  * subroutine didn't return EEXIST.  It does now.
index 924bebf..00c72ea 100644 (file)
@@ -2300,6 +2300,7 @@ clear_tty_hooks (struct terminal *terminal)
   terminal->mouse_position_hook = 0;
   terminal->frame_rehighlight_hook = 0;
   terminal->frame_raise_lower_hook = 0;
+  terminal->fullscreen_hook = 0;
   terminal->set_vertical_scroll_bar_hook = 0;
   terminal->condemn_scroll_bars_hook = 0;
   terminal->redeem_scroll_bar_hook = 0;
index 64a72ac..98c4edb 100644 (file)
@@ -43,6 +43,11 @@ enum scroll_bar_part {
   scroll_bar_move_ratio
 };
 
+/* If the value of the frame parameter changed, whis hook is called.
+   For example, if going from fullscreen to not fullscreen this hook
+   may do something OS dependent, like extended window manager hints on X11.  */
+extern void (*fullscreen_hook) P_ ((struct frame *f));
+
 \f
 /* Input queue declarations and hooks.  */
 
@@ -443,6 +448,11 @@ struct terminal
      windows.  */
   void (*frame_raise_lower_hook) P_ ((struct frame *f, int raise));
 
+  /* If the value of the frame parameter changed, whis hook is called.
+     For example, if going from fullscreen to not fullscreen this hook
+     may do something OS dependent, like extended window manager hints on X11.  */
+  void (*fullscreen_hook) P_ ((struct frame *f));
+    
   \f
   /* Scroll bar hooks.  */
 
index aee4f58..92e313c 100644 (file)
@@ -262,7 +262,7 @@ unexec (char *outfile, char *infile, unsigned start_data, unsigned d1,
   if (bss_sbrk_did_unexec)
     {
       /* can only dump once */
-      printf ("You can only dump emacs once on this platform.\n");
+      printf ("You can only dump Emacs once on this platform.\n");
       return (1);
     }
 
index f65fd9c..e95aa2f 100644 (file)
@@ -69,10 +69,10 @@ Boston, MA 02110-1301, USA.  */
    fact, the earliest one starts a few hundred bytes beyond the end of
    the last load command.  The linker option -headerpad controls the
    minimum size of this padding.  Its setting can be changed in
-   s/darwin.h.  A value of 0x300, e.g., leaves room for about 15
-   additional load commands for the newly created __DATA segments (at
-   56 bytes each).  Unexec fails if there is not enough room for these
-   new segments.
+   s/darwin.h.  A value of 0x690, e.g., leaves room for 30 additional
+   load commands for the newly created __DATA segments (at 56 bytes
+   each).  Unexec fails if there is not enough room for these new
+   segments.
 
    The __TEXT segment contains the sections __text, __cstring,
    __picsymbol_stub, and __const and the __DATA segment contains the
@@ -112,6 +112,20 @@ Boston, MA 02110-1301, USA.  */
 
 #include <assert.h>
 
+#ifdef _LP64
+#define mach_header                    mach_header_64
+#define segment_command                        segment_command_64
+#undef  VM_REGION_BASIC_INFO_COUNT
+#define VM_REGION_BASIC_INFO_COUNT     VM_REGION_BASIC_INFO_COUNT_64
+#undef  VM_REGION_BASIC_INFO
+#define VM_REGION_BASIC_INFO           VM_REGION_BASIC_INFO_64
+#undef  LC_SEGMENT
+#define LC_SEGMENT                     LC_SEGMENT_64
+#define vm_region                      vm_region_64
+#define section                                section_64
+#undef MH_MAGIC
+#define MH_MAGIC                       MH_MAGIC_64
+#endif
 
 #define VERBOSE 1
 
@@ -123,9 +137,6 @@ Boston, MA 02110-1301, USA.  */
    mapped to dynamically loaded libraries and will not be dumped.  */
 #define VM_DATA_TOP (20 * 1024 * 1024)
 
-/* Used by malloc_freezedry and malloc_jumpstart.  */
-int malloc_cookie;
-
 /* Type of an element on the list of regions to be dumped.  */
 struct region_t {
   vm_address_t address;
@@ -137,47 +148,49 @@ struct region_t {
 };
 
 /* Head and tail of the list of regions to be dumped.  */
-struct region_t *region_list_head = 0;
-struct region_t *region_list_tail = 0;
+static struct region_t *region_list_head = 0;
+static struct region_t *region_list_tail = 0;
 
 /* Pointer to array of load commands.  */
-struct load_command **lca;
+static struct load_command **lca;
 
 /* Number of load commands.  */
-int nlc;
+static int nlc;
 
 /* The highest VM address of segments loaded by the input file.
    Regions with addresses beyond this are assumed to be allocated
    dynamically and thus require dumping.  */
-vm_address_t infile_lc_highest_addr = 0;
+static vm_address_t infile_lc_highest_addr = 0;
 
 /* The lowest file offset used by the all sections in the __TEXT
    segments.  This leaves room at the beginning of the file to store
    the Mach-O header.  Check this value against header size to ensure
    the added load commands for the new __DATA segments did not
    overwrite any of the sections in the __TEXT segment.  */
-unsigned long text_seg_lowest_offset = 0x10000000;
+static unsigned long text_seg_lowest_offset = 0x10000000;
 
 /* Mach header.  */
-struct mach_header mh;
+static struct mach_header mh;
 
 /* Offset at which the next load command should be written.  */
-unsigned long curr_header_offset = sizeof (struct mach_header);
+static unsigned long curr_header_offset = sizeof (struct mach_header);
 
-/* Current adjustment that needs to be made to offset values because
-   of additional data segments.  */
-unsigned long delta = 0;
+/* Offset at which the next segment should be written.  */
+static unsigned long curr_file_offset = 0;
 
-int infd, outfd;
+static unsigned long pagesize;
+#define ROUNDUP_TO_PAGE_BOUNDARY(x)    (((x) + pagesize - 1) & ~(pagesize - 1))
 
-int in_dumped_exec = 0;
+static int infd, outfd;
 
-malloc_zone_t *emacs_zone;
+static int in_dumped_exec = 0;
+
+static malloc_zone_t *emacs_zone;
 
 /* file offset of input file's data segment */
-off_t data_segment_old_fileoff;
+static off_t data_segment_old_fileoff = 0;
 
-struct segment_command *data_segment_scp;
+static struct segment_command *data_segment_scp;
 
 /* Read N bytes from infd into memory starting at address DEST.
    Return true if successful, false otherwise.  */
@@ -286,7 +299,7 @@ static void
 print_region (vm_address_t address, vm_size_t size, vm_prot_t prot,
              vm_prot_t max_prot)
 {
-  printf ("%#10x %#8x ", address, size);
+  printf ("%#10lx %#8lx ", (long) address, (long) size);
   print_prot (prot);
   putchar (' ');
   print_prot (max_prot);
@@ -304,7 +317,7 @@ print_region_list ()
     print_region (r->address, r->size, r->protection, r->max_protection);
 }
 
-void
+static void
 print_regions ()
 {
   task_t target_task = mach_task_self ();
@@ -412,23 +425,40 @@ build_region_list ()
 }
 
 
-#define MAX_UNEXEC_REGIONS 200
+#define MAX_UNEXEC_REGIONS 400
 
-int num_unexec_regions;
-vm_range_t unexec_regions[MAX_UNEXEC_REGIONS];
+static int num_unexec_regions;
+typedef struct {
+  vm_range_t range;
+  vm_size_t filesize;
+} unexec_region_info;
+static unexec_region_info unexec_regions[MAX_UNEXEC_REGIONS];
 
 static void
 unexec_regions_recorder (task_t task, void *rr, unsigned type,
                         vm_range_t *ranges, unsigned num)
 {
+  vm_address_t p;
+  vm_size_t filesize;
+
   while (num && num_unexec_regions < MAX_UNEXEC_REGIONS)
     {
-      unexec_regions[num_unexec_regions++] = *ranges;
-      printf ("%#8x (sz: %#8x)\n", ranges->address, ranges->size);
+      /* Subtract the size of trailing null pages from filesize.  It
+        can be smaller than vmsize in segment commands.  In such a
+        case, trailing pages are initialized with zeros.  */
+      for (p = ranges->address + ranges->size; p > ranges->address;
+          p -= sizeof (int))
+       if (*(((int *) p)-1))
+         break;
+      filesize = ROUNDUP_TO_PAGE_BOUNDARY (p - ranges->address);
+      assert (filesize <= ranges->size);
+
+      unexec_regions[num_unexec_regions].filesize = filesize;
+      unexec_regions[num_unexec_regions++].range = *ranges;
+      printf ("%#10lx (sz: %#8lx/%#8lx)\n", (long) (ranges->address),
+             (long) filesize, (long) (ranges->size));
       ranges++; num--;
     }
-  if (num_unexec_regions == MAX_UNEXEC_REGIONS)
-    fprintf (stderr, "malloc_freezedry_recorder: too many regions\n");
 }
 
 static kern_return_t
@@ -438,7 +468,7 @@ unexec_reader (task_t task, vm_address_t address, vm_size_t size, void **ptr)
   return KERN_SUCCESS;
 }
 
-void
+static void
 find_emacs_zone_regions ()
 {
   num_unexec_regions = 0;
@@ -449,13 +479,16 @@ find_emacs_zone_regions ()
                                      (vm_address_t) emacs_zone,
                                      unexec_reader,
                                      unexec_regions_recorder);
+
+  if (num_unexec_regions == MAX_UNEXEC_REGIONS)
+    unexec_error ("find_emacs_zone_regions: too many regions");
 }
 
 static int
 unexec_regions_sort_compare (const void *a, const void *b)
 {
-  vm_address_t aa = ((vm_range_t *) a)->address;
-  vm_address_t bb = ((vm_range_t *) b)->address;
+  vm_address_t aa = ((unexec_region_info *) a)->range.address;
+  vm_address_t bb = ((unexec_region_info *) b)->range.address;
 
   if (aa < bb)
     return -1;
@@ -469,7 +502,7 @@ static void
 unexec_regions_merge ()
 {
   int i, n;
-  vm_range_t r;
+  unexec_region_info r;
 
   qsort (unexec_regions, num_unexec_regions, sizeof (unexec_regions[0]),
         &unexec_regions_sort_compare);
@@ -477,9 +510,11 @@ unexec_regions_merge ()
   r = unexec_regions[0];
   for (i = 1; i < num_unexec_regions; i++)
     {
-      if (r.address + r.size == unexec_regions[i].address)
+      if (r.range.address + r.range.size == unexec_regions[i].range.address
+         && r.range.size - r.filesize < 2 * pagesize)
        {
-         r.size += unexec_regions[i].size;
+         r.filesize = r.range.size + unexec_regions[i].filesize;
+         r.range.size += unexec_regions[i].range.size;
        }
       else
        {
@@ -500,7 +535,11 @@ print_load_command_name (int lc)
   switch (lc)
     {
     case LC_SEGMENT:
+#ifndef _LP64
       printf ("LC_SEGMENT       ");
+#else
+      printf ("LC_SEGMENT_64    ");
+#endif
       break;
     case LC_LOAD_DYLINKER:
       printf ("LC_LOAD_DYLINKER ");
@@ -541,14 +580,14 @@ print_load_command (struct load_command *lc)
       int j;
 
       scp = (struct segment_command *) lc;
-      printf (" %-16.16s %#10x %#8x\n",
-             scp->segname, scp->vmaddr, scp->vmsize);
+      printf (" %-16.16s %#10lx %#8lx\n",
+             scp->segname, (long) (scp->vmaddr), (long) (scp->vmsize));
 
       sectp = (struct section *) (scp + 1);
       for (j = 0; j < scp->nsects; j++)
        {
-         printf ("                           %-16.16s %#10x %#8x\n",
-                 sectp->sectname, sectp->addr, sectp->size);
+         printf ("                           %-16.16s %#10lx %#8lx\n",
+                 sectp->sectname, (long) (sectp->addr), (long) (sectp->size));
          sectp++;
        }
     }
@@ -620,7 +659,7 @@ read_load_commands ()
   printf ("Highest address of load commands in input file: %#8x\n",
          infile_lc_highest_addr);
 
-  printf ("Lowest offset of all sections in __TEXT segment: %#8x\n",
+  printf ("Lowest offset of all sections in __TEXT segment: %#8lx\n",
          text_seg_lowest_offset);
 
   printf ("--- List of Load Commands in Input File ---\n");
@@ -644,21 +683,23 @@ copy_segment (struct load_command *lc)
   struct section *sectp;
   int j;
 
-  scp->fileoff += delta;
+  scp->fileoff = curr_file_offset;
 
   sectp = (struct section *) (scp + 1);
   for (j = 0; j < scp->nsects; j++)
     {
-      sectp->offset += delta;
+      sectp->offset += curr_file_offset - old_fileoff;
       sectp++;
     }
 
-  printf ("Writing segment %-16.16s at %#8x - %#8x (sz: %#8x)\n",
-         scp->segname, scp->fileoff, scp->fileoff + scp->filesize,
-         scp->filesize);
+  printf ("Writing segment %-16.16s @ %#8lx (%#8lx/%#8lx @ %#10lx)\n",
+         scp->segname, (long) (scp->fileoff), (long) (scp->filesize),
+         (long) (scp->vmsize), (long) (scp->vmaddr));
 
   if (!unexec_copy (scp->fileoff, old_fileoff, scp->filesize))
     unexec_error ("cannot copy segment from input to output file");
+  curr_file_offset += ROUNDUP_TO_PAGE_BOUNDARY (scp->filesize);
+
   if (!unexec_write (curr_header_offset, lc, lc->cmdsize))
     unexec_error ("cannot write load command to header");
 
@@ -683,14 +724,18 @@ copy_data_segment (struct load_command *lc)
   struct segment_command *scp = (struct segment_command *) lc;
   struct section *sectp;
   int j;
-  unsigned long header_offset, file_offset, old_file_offset;
+  unsigned long header_offset, old_file_offset;
 
-  printf ("Writing segment %-16.16s at %#8x - %#8x (sz: %#8x)\n",
-         scp->segname, scp->fileoff, scp->fileoff + scp->filesize,
-         scp->filesize);
+  /* The new filesize of the segment is set to its vmsize because data
+     blocks for segments must start at region boundaries.  Note that
+     this may leave unused locations at the end of the segment data
+     block because the total of the sizes of all sections in the
+     segment is generally smaller than vmsize.  */
+  scp->filesize = scp->vmsize;
 
-  if (delta != 0)
-    unexec_error ("cannot handle multiple DATA segments in input file");
+  printf ("Writing segment %-16.16s @ %#8lx (%#8lx/%#8lx @ %#10lx)\n",
+         scp->segname, curr_file_offset, (long)(scp->filesize),
+         (long)(scp->vmsize), (long) (scp->vmaddr));
 
   /* Offsets in the output file for writing the next section structure
      and segment data block, respectively.  */
@@ -700,7 +745,7 @@ copy_data_segment (struct load_command *lc)
   for (j = 0; j < scp->nsects; j++)
     {
       old_file_offset = sectp->offset;
-      sectp->offset = sectp->addr - scp->vmaddr + scp->fileoff;
+      sectp->offset = sectp->addr - scp->vmaddr + curr_file_offset;
       /* The __data section is dumped from memory.  The __bss and
         __common sections are also dumped from memory but their flag
         fields require changing (from S_ZEROFILL to S_REGULAR).  The
@@ -762,21 +807,16 @@ copy_data_segment (struct load_command *lc)
       else
        unexec_error ("unrecognized section name in __DATA segment");
 
-      printf ("        section %-16.16s at %#8x - %#8x (sz: %#8x)\n",
-             sectp->sectname, sectp->offset, sectp->offset + sectp->size,
-             sectp->size);
+      printf ("        section %-16.16s at %#8lx - %#8lx (sz: %#8lx)\n",
+             sectp->sectname, (long) (sectp->offset),
+             (long) (sectp->offset + sectp->size), (long) (sectp->size));
 
       header_offset += sizeof (struct section);
       sectp++;
     }
 
-  /* The new filesize of the segment is set to its vmsize because data
-     blocks for segments must start at region boundaries.  Note that
-     this may leave unused locations at the end of the segment data
-     block because the total of the sizes of all sections in the
-     segment is generally smaller than vmsize.  */
-  delta = scp->vmsize - scp->filesize;
-  scp->filesize = scp->vmsize;
+  curr_file_offset += ROUNDUP_TO_PAGE_BOUNDARY (scp->filesize);
+
   if (!unexec_write (curr_header_offset, scp, sizeof (struct segment_command)))
     unexec_error ("cannot write header of __DATA segment");
   curr_header_offset += lc->cmdsize;
@@ -784,8 +824,7 @@ copy_data_segment (struct load_command *lc)
   /* Create new __DATA segment load commands for regions on the region
      list that do not corresponding to any segment load commands in
      the input file.
-     */
-  file_offset = scp->fileoff + scp->filesize;
+  */
   for (j = 0; j < num_unexec_regions; j++)
     {
       struct segment_command sc;
@@ -793,23 +832,22 @@ copy_data_segment (struct load_command *lc)
       sc.cmd = LC_SEGMENT;
       sc.cmdsize = sizeof (struct segment_command);
       strncpy (sc.segname, SEG_DATA, 16);
-      sc.vmaddr = unexec_regions[j].address;
-      sc.vmsize = unexec_regions[j].size;
-      sc.fileoff = file_offset;
-      sc.filesize = unexec_regions[j].size;
+      sc.vmaddr = unexec_regions[j].range.address;
+      sc.vmsize = unexec_regions[j].range.size;
+      sc.fileoff = curr_file_offset;
+      sc.filesize = unexec_regions[j].filesize;
       sc.maxprot = VM_PROT_READ | VM_PROT_WRITE;
       sc.initprot = VM_PROT_READ | VM_PROT_WRITE;
       sc.nsects = 0;
       sc.flags = 0;
 
-      printf ("Writing segment %-16.16s at %#8x - %#8x (sz: %#8x)\n",
-             sc.segname, sc.fileoff, sc.fileoff + sc.filesize,
-             sc.filesize);
+      printf ("Writing segment %-16.16s @ %#8lx (%#8lx/%#8lx @ %#10lx)\n",
+             sc.segname, (long) (sc.fileoff), (long) (sc.filesize),
+             (long) (sc.vmsize), (long) (sc.vmaddr));
 
-      if (!unexec_write (sc.fileoff, (void *) sc.vmaddr, sc.vmsize))
+      if (!unexec_write (sc.fileoff, (void *) sc.vmaddr, sc.filesize))
        unexec_error ("cannot write new __DATA segment");
-      delta += sc.filesize;
-      file_offset += sc.filesize;
+      curr_file_offset += ROUNDUP_TO_PAGE_BOUNDARY (sc.filesize);
 
       if (!unexec_write (curr_header_offset, &sc, sc.cmdsize))
        unexec_error ("cannot write new __DATA segment's header");
@@ -821,7 +859,7 @@ copy_data_segment (struct load_command *lc)
 /* Copy a LC_SYMTAB load command from the input file to the output
    file, adjusting the file offset fields.  */
 static void
-copy_symtab (struct load_command *lc)
+copy_symtab (struct load_command *lc, long delta)
 {
   struct symtab_command *stp = (struct symtab_command *) lc;
 
@@ -898,7 +936,7 @@ unrelocate (const char *name, off_t reloff, int nrel)
 /* Copy a LC_DYSYMTAB load command from the input file to the output
    file, adjusting the file offset fields.  */
 static void
-copy_dysymtab (struct load_command *lc)
+copy_dysymtab (struct load_command *lc, long delta)
 {
   struct dysymtab_command *dstp = (struct dysymtab_command *) lc;
 
@@ -927,7 +965,7 @@ copy_dysymtab (struct load_command *lc)
 /* Copy a LC_TWOLEVEL_HINTS load command from the input file to the output
    file, adjusting the file offset fields.  */
 static void
-copy_twolevelhints (struct load_command *lc)
+copy_twolevelhints (struct load_command *lc, long delta)
 {
   struct twolevel_hints_command *tlhp = (struct twolevel_hints_command *) lc;
 
@@ -964,6 +1002,7 @@ static void
 dump_it ()
 {
   int i;
+  long linkedit_delta = 0;
 
   printf ("--- Load Commands written to Output File ---\n");
 
@@ -977,6 +1016,9 @@ dump_it ()
            {
              /* save data segment file offset and segment_command for
                 unrelocate */
+             if (data_segment_old_fileoff)
+               unexec_error ("cannot handle multiple DATA segments"
+                             " in input file");
              data_segment_old_fileoff = scp->fileoff;
              data_segment_scp = scp;
 
@@ -984,18 +1026,26 @@ dump_it ()
            }
          else
            {
+             if (strncmp (scp->segname, SEG_LINKEDIT, 16) == 0)
+               {
+                 if (linkedit_delta)
+                   unexec_error ("cannot handle multiple LINKEDIT segments"
+                                 " in input file");
+                 linkedit_delta = curr_file_offset - scp->fileoff;
+               }
+
              copy_segment (lca[i]);
            }
        }
        break;
       case LC_SYMTAB:
-       copy_symtab (lca[i]);
+       copy_symtab (lca[i], linkedit_delta);
        break;
       case LC_DYSYMTAB:
-       copy_dysymtab (lca[i]);
+       copy_dysymtab (lca[i], linkedit_delta);
        break;
       case LC_TWOLEVEL_HINTS:
-       copy_twolevelhints (lca[i]);
+       copy_twolevelhints (lca[i], linkedit_delta);
        break;
       default:
        copy_other (lca[i]);
@@ -1005,7 +1055,7 @@ dump_it ()
   if (curr_header_offset > text_seg_lowest_offset)
     unexec_error ("not enough room for load commands for new __DATA segments");
 
-  printf ("%d unused bytes follow Mach-O header\n",
+  printf ("%ld unused bytes follow Mach-O header\n",
          text_seg_lowest_offset - curr_header_offset);
 
   mh.sizeofcmds = curr_header_offset - sizeof (struct mach_header);
@@ -1024,6 +1074,7 @@ unexec (char *outfile, char *infile, void *start_data, void *start_bss,
   if (in_dumped_exec)
     unexec_error ("Unexec from a dumped executable is not supported.");
 
+  pagesize = getpagesize ();
   infd = open (infile, O_RDONLY, 0);
   if (infd < 0)
     {
@@ -1081,8 +1132,8 @@ ptr_in_unexec_regions (void *ptr)
   int i;
 
   for (i = 0; i < num_unexec_regions; i++)
-    if ((vm_address_t) ptr - unexec_regions[i].address
-       < unexec_regions[i].size)
+    if ((vm_address_t) ptr - unexec_regions[i].range.address
+       < unexec_regions[i].range.size)
       return 1;
 
   return 0;
index cd3098b..ea9d9ae 100644 (file)
@@ -590,7 +590,7 @@ DEFUN ("w16-set-clipboard-data", Fw16_set_clipboard_data, Sw16_set_clipboard_dat
            message2 (system_error_msg, sizeof (system_error_msg) - 1, 0);
            break;
        }
-      sit_for (2, 0, 0, 1, 1);
+      sit_for (make_number (2), 0, 2);
     }
 
  done:
index f7e2116..6313afe 100644 (file)
@@ -2080,32 +2080,7 @@ w32_createwindow (f)
 
   if (!hprevinst)
     {
-      Lisp_Object ifa;
-
       w32_init_class (hinst);
-
-      /* Handle the -geometry command line option and the geometry
-        settings in the registry.  They are decoded and put into
-        initial-frame-alist by w32-win.el:x-handle-geometry.  */
-      ifa = Fsymbol_value (intern ("initial-frame-alist"));
-      if (CONSP (ifa))
-       {
-         Lisp_Object lt = Fassq (Qleft, ifa);
-         Lisp_Object tp = Fassq (Qtop,  ifa);
-
-         if (!NILP (lt))
-           {
-             lt = XCDR (lt);
-             if (INTEGERP (lt))
-               left = lt;
-           }
-         if (!NILP (tp))
-           {
-             tp = XCDR (tp);
-             if (INTEGERP (tp))
-               top = tp;
-           }
-       }
     }
 
   if (f->size_hint_flags & USPosition || f->size_hint_flags & PPosition)
@@ -2714,9 +2689,8 @@ cancel_all_deferred_msgs ()
   PostThreadMessage (dwWindowsThreadId, WM_NULL, 0, 0);
 }
 
-DWORD
-w32_msg_worker (dw)
-     DWORD dw;
+DWORD WINAPI
+w32_msg_worker (void *arg)
 {
   MSG msg;
   deferred_msg dummy_buf;
@@ -8070,17 +8044,39 @@ DEFUN ("w32-shell-execute", Fw32_shell_execute, Sw32_shell_execute, 2, 4, 0,
        doc: /* Get Windows to perform OPERATION on DOCUMENT.
 This is a wrapper around the ShellExecute system function, which
 invokes the application registered to handle OPERATION for DOCUMENT.
-OPERATION is typically \"open\", \"print\" or \"explore\" (but can be
-nil for the default action), and DOCUMENT is typically the name of a
-document file or URL, but can also be a program executable to run or
-a directory to open in the Windows Explorer.
-
-If DOCUMENT is a program executable, PARAMETERS can be a string
-containing command line parameters, but otherwise should be nil.
 
-SHOW-FLAG can be used to control whether the invoked application is hidden
-or minimized.  If SHOW-FLAG is nil, the application is displayed normally,
-otherwise it is an integer representing a ShowWindow flag:
+OPERATION is either nil or a string that names a supported operation.
+What operations can be used depends on the particular DOCUMENT and its
+handler application, but typically it is one of the following common
+operations:
+
+ \"open\"    - open DOCUMENT, which could be a file, a directory, or an
+               executable program.  If it is an application, that
+               application is launched in the current buffer's default
+               directory.  Otherwise, the application associated with
+               DOCUMENT is launched in the buffer's default directory.
+ \"print\"   - print DOCUMENT, which must be a file
+ \"explore\" - start the Windows Explorer on DOCUMENT
+ \"edit\"    - launch an editor and open DOCUMENT for editing; which
+               editor is launched depends on the association for the
+               specified DOCUMENT
+ \"find\"    - initiate search starting from DOCUMENT which must specify
+               a directory
+ nil       - invoke the default OPERATION, or \"open\" if default is
+               not defined or unavailable
+
+DOCUMENT is typically the name of a document file or a URL, but can
+also be a program executable to run, or a directory to open in the
+Windows Explorer.
+
+If DOCUMENT is a program executable, the optional arg PARAMETERS can
+be a string containing command line parameters that will be passed to
+the program; otherwise, PARAMETERS should be nil or unspecified.
+
+Second optional argument SHOW-FLAG can be used to control how the
+application will be displayed when it is invoked.  If SHOW-FLAG is nil
+or unspceified, the application is displayed normally, otherwise it is
+an integer representing a ShowWindow flag:
 
   0 - start hidden
   1 - start normally
index 3a4dc20..d5c38be 100644 (file)
@@ -235,10 +235,6 @@ static int menu_items_n_panes;
 /* Current depth within submenus.  */
 static int menu_items_submenu_depth;
 
-/* Flag which when set indicates a dialog or menu has been posted by
-   Xt on behalf of one of the widget sets.  */
-static int popup_activated_flag;
-
 static int next_menubar_widget_id;
 
 /* This is set nonzero after the user activates the menu bar, and set
@@ -2148,7 +2144,6 @@ w32_dialog_show (f, keymaps, title, header, error)
 
   /* Display the menu.  */
   lw_pop_up_all_widgets (dialog_id);
-  popup_activated_flag = 1;
 
   /* Process events that apply to the menu.  */
   popup_get_selection ((XEvent *) 0, FRAME_X_DISPLAY_INFO (f), dialog_id);
@@ -2428,13 +2423,6 @@ fill_in_menu (HMENU menu, widget_value *wv)
   return 1;
 }
 
-int
-popup_activated ()
-{
-  /* popup_activated_flag not actually used on W32 */
-  return 0;
-}
-
 /* Display help string for currently pointed to menu item. Not
    supported on NT 3.51 and earlier, as GetMenuItemInfo is not
    available. */
@@ -2537,6 +2525,21 @@ w32_free_menu_strings (hwnd)
 
 #endif /* HAVE_MENUS */
 
+/* The following is used by delayed window autoselection.  */
+
+DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_p, 0, 0, 0,
+       doc: /* Return t if a menu or popup dialog is active on selected frame.  */)
+     ()
+{
+#ifdef HAVE_MENUS
+  FRAME_PTR f;
+  f = SELECTED_FRAME ();
+  return (f->output_data.w32->menubar_active > 0) ? Qt : Qnil;
+#else
+  return Qnil;
+#endif /* HAVE_MENUS */
+}
+
 void syms_of_w32menu ()
 {
        globals_of_w32menu ();
@@ -2549,6 +2552,7 @@ void syms_of_w32menu ()
   staticpro (&Qdebug_on_next_call);
 
   defsubr (&Sx_popup_menu);
+  defsubr (&Smenu_or_popup_active_p);
 #ifdef HAVE_MENUS
   defsubr (&Sx_popup_dialog);
 #endif
index 2949193..7d27172 100644 (file)
@@ -486,7 +486,8 @@ sys_wait (int *status)
     {
       for (cp = child_procs+(child_proc_count-1); cp >= child_procs; cp--)
        /* some child_procs might be sockets; ignore them */
-       if (CHILD_ACTIVE (cp) && cp->procinfo.hProcess)
+       if (CHILD_ACTIVE (cp) && cp->procinfo.hProcess
+           && (cp->fd < 0 || (fd_info[cp->fd].flags & FILE_AT_EOF) != 0))
          {
            wait_hnd[nh] = cp->procinfo.hProcess;
            cps[nh] = cp;
index 948a555..bd3db15 100644 (file)
@@ -4439,7 +4439,7 @@ w32_read_socket (sd, expected, hold_quit)
                /* Ignore any mouse motion that happened before this
                   event; any subsequent mouse-movement Emacs events
                   should reflect only motion after the
-                  ButtonPress.  */
+                  ButtonPress.  */
                f->mouse_moved = 0;
              }
            last_mouse_frame = f;
@@ -6282,7 +6282,7 @@ x_delete_display (dpyinfo)
 \f
 /* Set up use of W32.  */
 
-DWORD w32_msg_worker ();
+DWORD WINAPI w32_msg_worker (void * arg);
 
 void
 x_flush (struct frame * f)
@@ -6388,8 +6388,8 @@ w32_initialize ()
     PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE);
 
     hWindowsThread = CreateThread (NULL, 0,
-                              (LPTHREAD_START_ROUTINE) w32_msg_worker,
-                              0, 0, &dwWindowsThreadId);
+                                   w32_msg_worker,
+                                   0, 0, &dwWindowsThreadId);
 
     GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE);
   }
index e996fc5..c46df0e 100644 (file)
@@ -3267,6 +3267,10 @@ set_window_buffer (window, buffer, run_hooks_p, keep_margins_p)
   struct window *w = XWINDOW (window);
   struct buffer *b = XBUFFER (buffer);
   int count = SPECPDL_INDEX ();
+#ifdef HAVE_WINDOW_SYSTEM
+  struct frame *f = XFRAME (w->frame);
+  Display_Info *dpyinfo;
+#endif
 
   w->buffer = buffer;
 
@@ -3347,6 +3351,15 @@ set_window_buffer (window, buffer, run_hooks_p, keep_margins_p)
        call1 (Vrun_hooks, Qwindow_configuration_change_hook);
     }
 
+#ifdef HAVE_WINDOW_SYSTEM
+  BLOCK_INPUT;
+  if (f && FRAME_X_OUTPUT (f)
+      && (dpyinfo = FRAME_X_DISPLAY_INFO (f))
+      && EQ (window, dpyinfo->mouse_face_window))
+    clear_mouse_face (dpyinfo);
+  UNBLOCK_INPUT;
+#endif
+
   unbind_to (count, Qnil);
 }
 
index d99f7a9..0928d01 100644 (file)
@@ -6815,7 +6815,12 @@ move_it_to (it, to_charpos, to_x, to_y, to_vpos, op)
          break;
 
        case MOVE_LINE_CONTINUED:
-         it->continuation_lines_width += it->current_x;
+         /* For continued lines ending in a tab, some of the glyphs
+            associated with the tab are displayed on the current
+            line.  Since it->current_x does not include these glyphs,
+            we use it->last_visible_x instead.  */
+         it->continuation_lines_width +=
+           (it->c == '\t') ? it->last_visible_x : it->current_x;
          break;
 
        default:
@@ -17396,7 +17401,7 @@ pint2str (buf, width, d)
 
 /* Write a null-terminated, right justified decimal and "human
    readable" representation of the nonnegative integer D to BUF using
-   a minimal field width WIDTH.         D should be smaller than 999.5e24. */
+   a minimal field width WIDTH.  D should be smaller than 999.5e24. */
 
 static const char power_letter[] =
   {
@@ -22650,7 +22655,7 @@ note_mouse_highlight (f, x, y)
   struct buffer *b;
 
   /* When a menu is active, don't highlight because this looks odd.  */
-#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NTGUI)
+#if defined (USE_X_TOOLKIT) || defined (USE_GTK)
   if (popup_activated ())
     return;
 #endif
index b55118a..ec20445 100644 (file)
@@ -6195,7 +6195,7 @@ face for italic.  */)
   (attributes, display)
      Lisp_Object attributes, display;
 {
-  int supports, i;
+  int supports = 0, i;
   Lisp_Object frame;
   struct frame *f;
   struct face *def_face;
@@ -7089,10 +7089,18 @@ realize_default_face (f)
 #ifdef HAVE_WINDOW_SYSTEM
 #ifdef HAVE_X_WINDOWS
   if (FRAME_X_P (f) && face->font != FRAME_FONT (f))
-    /* As the font specified for the frame was not acceptable as a
-       font for the default face (perhaps because auto-scaled fonts
-       are rejected), we must adjust the frame font.  */
-    x_set_font (f, build_string (face->font_name), Qnil);
+    {
+      /* This can happen when making a frame on a display that does
+        not support the default font.  */
+      if (!face->font)
+       return 0;
+      /* Otherwise, the font specified for the frame was not
+        acceptable as a font for the default face (perhaps because
+        auto-scaled fonts are rejected), so we must adjust the frame
+        font.  */
+      x_set_font (f, build_string (face->font_name), Qnil);
+    }
 #endif /* HAVE_X_WINDOWS */
 #endif /* HAVE_WINDOW_SYSTEM */
   return 1;
index 1cd8265..8b4ab0c 100644 (file)
@@ -2143,27 +2143,35 @@ xic_create_xfontset (f, base_fontname)
   if (!xfs)
     {
       char *fontsetname = xic_create_fontsetname (base_fontname, False);
-      char *p0 = fontsetname, *p1;
 
       /* New fontset.  */
-      /* FONTSETNAME contains a list of font names (specific fonts
-        first, general fonts last), but giving that to XCreateFontSet
-        at once occasionally fails (bug of X?).  So, we try to call
-        XCreateFontSet for each fontname.  */
-
-      while (p0)
+      xfs = XCreateFontSet (FRAME_X_DISPLAY (f),
+                           fontsetname, &missing_list,
+                           &missing_count, &def_string);
+      if (missing_list)
+       XFreeStringList (missing_list);
+      if (! xfs)
        {
-         p1 = strchr (p0, ',');
-         if (p1)
-           *p1 = '\0';
-         xfs = XCreateFontSet (FRAME_X_DISPLAY (f),
-                               p0, &missing_list,
-                               &missing_count, &def_string);
-         if (missing_list)
-           XFreeStringList (missing_list);
-         if (xfs)
-           break;
-         p0 = p1 ? p1 + 1 : NULL;
+         /* FONTSETNAME contains a list of font names (specific fonts
+            first, general fonts last), but giving that to
+            XCreateFontSet at once occasionally fails (bug of X?).
+            So, we try to call XCreateFontSet for each fontname.  */
+         char *p0 = fontsetname, *p1;
+
+         while (p0)
+           {
+             p1 = strchr (p0, ',');
+             if (p1)
+               *p1 = '\0';
+             xfs = XCreateFontSet (FRAME_X_DISPLAY (f),
+                                   p0, &missing_list,
+                                   &missing_count, &def_string);
+             if (missing_list)
+               XFreeStringList (missing_list);
+             if (xfs)
+               break;
+             p0 = p1 ? p1 + 1 : NULL;
+           }
        }
       xfree (fontsetname);
     }
index b615d32..b4665f8 100644 (file)
@@ -825,7 +825,7 @@ no quit occurs and `x-popup-menu' returns nil.  */)
   int xpos = 0, ypos = 0;
   Lisp_Object title;
   char *error_name = NULL;
-  Lisp_Object selection;
+  Lisp_Object selection = Qnil;
   FRAME_PTR f = NULL;
   Lisp_Object x, y, window;
   int keymaps = 0;
@@ -1404,8 +1404,13 @@ If FRAME is nil or not given, use the selected frame.  */)
      Lisp_Object frame;
 {
   GtkWidget *menubar;
+  FRAME_PTR f;
+
+  /* gcc 2.95 doesn't accept the FRAME_PTR declaration after
+     BLOCK_INPUT.  */
+
   BLOCK_INPUT;
-  FRAME_PTR f = check_x_frame (frame);
+  f = check_x_frame (frame);
 
   if (FRAME_EXTERNAL_MENU_BAR (f))
     set_frame_menubar (f, 0, 1);
@@ -1418,7 +1423,7 @@ If FRAME is nil or not given, use the selected frame.  */)
 
       gtk_menu_shell_select_item (GTK_MENU_SHELL (menubar),
                                   GTK_WIDGET (children->data));
-      
+
       popup_activated_flag = 1;
       g_list_free (children);
     }
@@ -1495,14 +1500,6 @@ x_activate_menubar (f)
   f->output_data.x->saved_menu_event->type = 0;
 }
 
-/* Detect if a dialog or menu has been posted.  */
-
-int
-popup_activated ()
-{
-  return popup_activated_flag;
-}
-
 /* This callback is invoked when the user selects a menubar cascade
    pushbutton, but before the pulldown menu is posted.  */
 
@@ -3801,6 +3798,27 @@ xmenu_show (f, x, y, for_click, keymaps, title, error)
 #endif /* not USE_X_TOOLKIT */
 
 #endif /* HAVE_MENUS */
+
+/* Detect if a dialog or menu has been posted.  */
+
+int
+popup_activated ()
+{
+  return popup_activated_flag;
+}
+
+/* The following is used by delayed window autoselection.  */
+
+DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_p, 0, 0, 0,
+       doc: /* Return t if a menu or popup dialog is active.  */)
+     ()
+{
+#ifdef HAVE_MENUS
+  return (popup_activated ()) ? Qt : Qnil;
+#else
+  return Qnil;
+#endif /* HAVE_MENUS */
+}
 \f
 void
 syms_of_xmenu ()
@@ -3818,6 +3836,7 @@ syms_of_xmenu ()
 #endif
 
   defsubr (&Sx_popup_menu);
+  defsubr (&Smenu_or_popup_active_p);
 
 #if defined (USE_GTK) || defined (USE_X_TOOLKIT)
   defsubr (&Sx_menu_bar_open_internal);
index e610304..54b20d8 100644 (file)
@@ -123,8 +123,8 @@ Lisp_Object QCUT_BUFFER0, QCUT_BUFFER1, QCUT_BUFFER2, QCUT_BUFFER3,
 
 static Lisp_Object Vx_lost_selection_functions;
 static Lisp_Object Vx_sent_selection_functions;
-/* Coding system for communicating with other X clients via cutbuffer,
-   selection, and clipboard.  */
+/* Coding system for communicating with other X clients via selection
+   and clipboard.  */
 static Lisp_Object Vselection_coding_system;
 
 /* Coding system for the next communicating with other X clients.  */
@@ -843,7 +843,7 @@ x_reply_selection_request (event, format, data, size, type)
            break;
 
          /* Now wait for the requester to ack this chunk by deleting the
-            property.   This can run random lisp code or signal.  */
+            property.  This can run random lisp code or signal.  */
          TRACE1 ("Waiting for increment ACK (deletion of %s)",
                  XGetAtomName (display, reply.property));
          wait_for_property_change (wait_object);
@@ -2742,11 +2742,11 @@ FRAME is on.  If FRAME is nil, the selected frame is used.  */)
   else
     error ("ATOM must be a symbol or a string");
 
-  for (i = 0; i < dpyinfo->x_dnd_atoms_length; ++i) 
+  for (i = 0; i < dpyinfo->x_dnd_atoms_length; ++i)
     if (dpyinfo->x_dnd_atoms[i] == x_atom)
       return Qnil;
 
-  if (dpyinfo->x_dnd_atoms_length == dpyinfo->x_dnd_atoms_size) 
+  if (dpyinfo->x_dnd_atoms_length == dpyinfo->x_dnd_atoms_size)
     {
       dpyinfo->x_dnd_atoms_size *= 2;
       dpyinfo->x_dnd_atoms = xrealloc (dpyinfo->x_dnd_atoms,
@@ -2776,7 +2776,7 @@ x_handle_dnd_message (f, event, dpyinfo, bufp)
   int idata[5];
   size_t i;
 
-  for (i = 0; i < dpyinfo->x_dnd_atoms_length; ++i) 
+  for (i = 0; i < dpyinfo->x_dnd_atoms_length; ++i)
     if (dpyinfo->x_dnd_atoms[i] == event->message_type) break;
 
   if (i == dpyinfo->x_dnd_atoms_length) return 0;
@@ -3007,8 +3007,8 @@ it merely informs you that they have happened.  */);
 
   DEFVAR_LISP ("selection-coding-system", &Vselection_coding_system,
               doc: /* Coding system for communicating with other X clients.
-When sending or receiving text via cut_buffer, selection, and clipboard,
-the text is encoded or decoded by this coding system.
+When sending or receiving text via selection and clipboard, the text is
+encoded or decoded by this coding system.
 The default value is `compound-text-with-extensions'.  */);
   Vselection_coding_system = intern ("compound-text-with-extensions");
 
index 974b3a1..1e4618e 100644 (file)
@@ -570,7 +570,7 @@ See also `x-session-previous-id', `emacs-save-session-functions',
   DEFVAR_LISP ("x-session-previous-id", &Vx_session_previous_id,
     doc: /* The previous session id Emacs got from session manager.
 If Emacs is running on a window system that has a session manager, the
-session manager gives Emacs a session id.  It is feasible for Emacs lisp
+session manager gives Emacs a session id.  It is feasible for Emacs Lisp
 code to use the session id to save configuration in, for example, a file
 with a file name based on the session id.  If Emacs is running when the
 window system is shut down, the session manager remembers that Emacs was
index 95b2a87..7bbd273 100644 (file)
@@ -8336,6 +8336,119 @@ x_set_offset (f, xoff, yoff, change_gravity)
   UNBLOCK_INPUT;
 }
 
+/* Do fullscreen as specified in extended window manager hints */
+static int
+do_ewmh_fullscreen (f)
+     struct frame *f;
+{
+  int have_net_atom = FRAME_X_DISPLAY_INFO (f)->have_net_atoms;
+
+  if (!have_net_atom)
+    {
+      int num;
+      Atom *atoms = XListProperties (FRAME_X_DISPLAY (f),
+                                     FRAME_X_DISPLAY_INFO (f)->root_window,
+                                     &num);
+      if (atoms && num > 0) 
+        {
+          char **names = (char **) xmalloc (num * sizeof(*names));
+          if (XGetAtomNames (FRAME_X_DISPLAY (f), atoms, num, names)) 
+            {
+              int i;
+              for (i = 0; i < num; ++i) 
+                {
+                  if (!have_net_atom) 
+                    have_net_atom = strncmp (names[i], "_NET_", 5) == 0;
+                  XFree (names[i]);
+                }
+            }
+          xfree (names);
+        }
+      if (atoms)
+        XFree (atoms);
+
+      FRAME_X_DISPLAY_INFO (f)->have_net_atoms = have_net_atom;
+    }
+
+  if (have_net_atom) 
+    {
+      Lisp_Object frame;
+      const char *atom = "_NET_WM_STATE";
+      const char *fs = "_NET_WM_STATE_FULLSCREEN";
+      const char *fw = "_NET_WM_STATE_MAXIMIZED_HORZ";
+      const char *fh = "_NET_WM_STATE_MAXIMIZED_VERT";
+      const char *what = NULL;
+
+      XSETFRAME (frame, f);
+
+      /* If there are _NET_ atoms we assume we have extended window manager
+         hints.  */
+      switch (f->want_fullscreen) 
+        {
+        case FULLSCREEN_BOTH:
+          what = fs;
+          break;
+        case FULLSCREEN_WIDTH:
+          what = fw;
+          break;
+        case FULLSCREEN_HEIGHT:
+          what = fh;
+          break;
+        }
+
+      Fx_send_client_event (frame, make_number (0), frame,
+                            make_unibyte_string (atom, strlen (atom)),
+                            make_number (32),
+                            Fcons (make_number (0), /* Remove */
+                                   Fcons
+                                   (make_unibyte_string (fs,
+                                                         strlen (fs)),
+                                    Qnil)));
+      Fx_send_client_event (frame, make_number (0), frame,
+                            make_unibyte_string (atom, strlen (atom)),
+                            make_number (32),
+                            Fcons (make_number (0), /* Remove */
+                                   Fcons
+                                   (make_unibyte_string (fh,
+                                                         strlen (fh)),
+                                    Qnil)));
+      Fx_send_client_event (frame, make_number (0), frame,
+                            make_unibyte_string (atom, strlen (atom)),
+                            make_number (32),
+                            Fcons (make_number (0), /* Remove */
+                                   Fcons
+                                   (make_unibyte_string (fw,
+                                                         strlen (fw)),
+                                    Qnil)));
+      f->want_fullscreen = FULLSCREEN_NONE;
+      if (what != NULL)
+        Fx_send_client_event (frame, make_number (0), frame,
+                              make_unibyte_string (atom, strlen (atom)),
+                              make_number (32),
+                              Fcons (make_number (1), /* Add */
+                                     Fcons
+                                     (make_unibyte_string (what,
+                                                           strlen (what)),
+                                      Qnil)));
+    }
+
+  return have_net_atom;
+}
+
+static void
+XTfullscreen_hook (f)
+     FRAME_PTR f;
+{
+  if (f->async_visible) 
+    {
+      BLOCK_INPUT;
+      do_ewmh_fullscreen (f);
+      x_sync (f);
+      UNBLOCK_INPUT;
+    }
+}
+
+
 /* Check if we need to resize the frame due to a fullscreen request.
    If so needed, resize the frame. */
 static void
@@ -8346,6 +8459,9 @@ x_check_fullscreen (f)
     {
       int width, height, ign;
 
+      if (do_ewmh_fullscreen (f)) 
+        return;
+
       x_real_positions (f, &f->left_pos, &f->top_pos);
 
       x_fullscreen_adjust (f, &width, &height, &ign, &ign);
@@ -8647,13 +8763,12 @@ void
 x_raise_frame (f)
      struct frame *f;
 {
+  BLOCK_INPUT;
   if (f->async_visible)
-    {
-      BLOCK_INPUT;
-      XRaiseWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f));
-      XFlush (FRAME_X_DISPLAY (f));
-      UNBLOCK_INPUT;
-    }
+    XRaiseWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f));
+
+  XFlush (FRAME_X_DISPLAY (f));
+  UNBLOCK_INPUT;
 }
 
 /* Lower frame F.  */
@@ -8677,7 +8792,22 @@ XTframe_raise_lower (f, raise_flag)
      int raise_flag;
 {
   if (raise_flag)
-    x_raise_frame (f);
+    {
+      Lisp_Object frame;
+      const char *atom = "_NET_ACTIVE_WINDOW";
+
+      x_raise_frame (f);
+      /* See Window Manager Specification/Extended Window Manager Hints at
+         http://freedesktop.org/wiki/Standards_2fwm_2dspec */
+
+      XSETFRAME (frame, f);
+      Fx_send_client_event (frame, make_number (0), frame,
+                            make_unibyte_string (atom, strlen (atom)),
+                            make_number (32),
+                            Fcons (make_number (1),
+                                   Fcons (make_number (time (NULL) * 1000),
+                                          Qnil)));
+    }
   else
     x_lower_frame (f);
 }
@@ -11038,6 +11168,7 @@ x_create_terminal (struct x_display_info *dpyinfo)
   terminal->mouse_position_hook = XTmouse_position;
   terminal->frame_rehighlight_hook = XTframe_rehighlight;
   terminal->frame_raise_lower_hook = XTframe_raise_lower;
+  terminal->fullscreen_hook = XTfullscreen_hook;
   terminal->set_vertical_scroll_bar_hook = XTset_vertical_scroll_bar;
   terminal->condemn_scroll_bars_hook = XTcondemn_scroll_bars;
   terminal->redeem_scroll_bar_hook = XTredeem_scroll_bar;
index 3c4bdab..1ea50b8 100644 (file)
@@ -391,10 +391,12 @@ struct x_display_info
     } wm_type;
 
 
-    /* Atoms that are drag and drop atoms */
-    Atom *x_dnd_atoms;
-    size_t x_dnd_atoms_size;
-    size_t x_dnd_atoms_length;
+  /* Atoms that are drag and drop atoms */
+  Atom *x_dnd_atoms;
+  size_t x_dnd_atoms_size;
+  size_t x_dnd_atoms_length;
+
+  int have_net_atoms;
 };
 
 #ifdef HAVE_X_I18N