changeset 83492:203c9b24206b

Merged from emacs@sv.gnu.org Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-153 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-154 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-155 Remove nick-abbrevs stuff from rcirc.el * emacs@sv.gnu.org/emacs--devo--0--patch-156 rcirc.el update from Ryan Yeske * emacs@sv.gnu.org/emacs--devo--0--patch-157 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-158 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-159 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-532
author Karoly Lorentey <lorentey@elte.hu>
date Wed, 15 Mar 2006 17:22:12 +0000
parents 16813e8005ce (current diff) be6a0491d438 (diff)
children 1bf2ca323037
files lisp/ChangeLog lisp/allout.el lisp/cus-start.el lisp/font-lock.el lisp/mh-e/ChangeLog lisp/net/rcirc.el lisp/progmodes/gdb-ui.el lispref/ChangeLog man/ChangeLog man/mh-e.texi src/macterm.c src/macterm.h src/w32term.c src/xterm.c
diffstat 42 files changed, 2227 insertions(+), 962 deletions(-) [+]
line wrap: on
line diff
--- a/etc/ChangeLog	Sun Mar 12 05:02:59 2006 +0000
+++ b/etc/ChangeLog	Wed Mar 15 17:22:12 2006 +0000
@@ -1,3 +1,7 @@
+2006-03-15  Nick Roberts  <nickrob@snap.net.nz>
+
+	* DEBUG (Note): Describe features for debugging with GDB in Emacs.
+
 2006-03-11  Miles Bader  <miles@gnu.org>
 
 	* images/mail: New directory.
--- a/etc/DEBUG	Sun Mar 12 05:02:59 2006 +0000
+++ b/etc/DEBUG	Wed Mar 15 17:22:12 2006 +0000
@@ -245,6 +245,25 @@
 
    xsymbol
 
+** Using GDB in Emacs
+
+Debugging with GDB in Emacs offers some advantages over the command line (See
+the GDB Graphical Interface node of the Emacs manual).  There are also some
+features available just for debugging Emacs:
+
+1) The command gud-pp isavailable on the tool bar (the `pp' icon) and allows
+   the user to print the s-expression of the variable at point, in the GUD
+   buffer.
+
+2) Pressing `p' on a component of a watch expression that is a lisp object
+   in the speedbar prints its s-expression in the GUD buffer.
+
+3) The STOP button on the tool bar is adjusted so that it sends SIGTSTP
+   instead of the usual SIGINT.
+
+4) The command gud-pv has the global binding 'C-x C-a C-v' and prints the
+   value of the lisp variable at point.
+
 ** Debugging what happens while preloading and dumping Emacs
 
 Type `gdb temacs' and start it with `r -batch -l loadup dump'.
--- a/etc/orgcard.tex	Sun Mar 12 05:02:59 2006 +0000
+++ b/etc/orgcard.tex	Wed Mar 15 17:22:12 2006 +0000
@@ -1,4 +1,4 @@
-% Reference Card for Org Mode 4.08
+% Reference Card for Org Mode 4.09
 %
 %**start of header
 \newcount\columnsperpage
@@ -58,7 +58,7 @@
 % Thanks to Paul Rubin, Bob Chassell, Len Tower, and Richard Mlynarik
 % for their many good ideas.
 
-\def\orgversionnumber{4.08}
+\def\orgversionnumber{4.09}
 \def\year{2006}
 
 \def\shortcopyrightnotice{\vskip 1ex plus 2 fill
--- a/lisp/ChangeLog	Sun Mar 12 05:02:59 2006 +0000
+++ b/lisp/ChangeLog	Wed Mar 15 17:22:12 2006 +0000
@@ -1,3 +1,128 @@
+2006-03-14  Ken Manheimer  <ken.manheimer@gmail.com>
+
+	* allout.el: Increment version to 2.2.1 in file commentary.
+
+	(allout-version): Increment to 2.2.1.
+
+	(allout-default-layout): New customization variable, used when the
+	file lacks a specific allout-layout.  Uses allout-layout-type for
+	recursively nested definition.
+
+	(allout-layout-type): Widget defining allout layouts, necessary for
+	self-recursive definition.
+
+	(allout-mode): Incorporate allout-default-layout as fallback for
+	allout-layout.
+
+	(allout-layout): Mark as 'safe-local-variable', and refer mention
+	fallback to `allout-default-layout' in absence of a specified value.
+	(allout-passphrase-verifier-string)
+	(allout-passphrase-hint-string): Mark as 'safe-local-variable'.
+
+	(allout-file-passphrase-verifier-string): Obsolete variable, removed.
+
+	(allout-get-encryption-passphrase-verifier): Use correct name of
+	passphrase verifier in docstring.
+
+2006-03-15  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gdb-ui.el (gdb-var-list): Change order of first two
+	elements.
+	(gdb-find-watch-expression): Make it work for arrays too.  Follow
+	change to gdb-var-list.
+	(gud-watch): Allow the user to enter variable name with a prexix
+	arg.  Create keybindings.
+	(gdb-var-create-handler, gdb-var-evaluate-expression-handler)
+	(gdb-var-list-children-handler, gdb-var-update-handler)
+	(gdb-var-delete, gdb-edit-value, gdb-speedbar-expand-node)
+	(gdb-var-list-children-handler-1, gdb-var-update-handler-1):
+	Follow change to gdb-var-list.
+	(gdb-starting): Don't show the overlay arrows when program is
+	running.
+
+	* progmodes/gud.el (gud-speedbar-buttons): Follow change to
+	gdb-var-list.
+
+2006-03-14  Bill Wohler  <wohler@newt.com>
+
+	* image.el (image-load-path-for-library): Pass value of path
+	rather than symbol. Always return list of directories. Guarantee
+	that image directory comes first.
+
+2006-03-14  Alan Mackenzie  <acm@muc.de>
+
+	* font-core.el: New function/variable
+	font-lock-extend-region\(-function\)?.
+
+	* font-lock.el (font-lock-after-change-function): Call
+	font-lock-extend-region.  Obey font-lock-lines-before.
+	(font-lock-default-fontify-region): Remove reference to
+	font-lock-lines-before.
+
+	* jit-lock.el (jit-lock-after-change): Call
+	font-lock-extend-region.  Obey font-lock-lines-before.
+
+2006-03-14  David Ponce  <david@dponce.com>
+
+	* tree-widget.el (tree-widget-themes-load-path)
+	(tree-widget-themes-directory, tree-widget-theme): Doc fix.
+
+2006-03-13  Ryan Yeske  <rcyeske@gmail.com>
+
+	* net/rcirc.el (rcirc) <defgroup>: Add link to manual.
+	(rcirc-print): Mark the start of text at the end of the prompt.
+	(rcirc-track-minor-mode): Add autoload cookie.
+	(rcirc-update-activity-string): Add space to front of mode-line
+	indicator.
+
+2006-03-13  Miles Bader  <miles@gnu.org>
+
+	* net/rcirc.el (rcirc-nick-abbrevs): Remove variable.
+	(rcirc-abbrev-nick): Remove function.
+	(rcirc-format-response-string): Don't call `rcirc-abbrev-nick'.
+
+2006-03-13  David Ponce  <david@dponce.com>
+
+	* tree-widget.el: Handle themes across all occurrences of the main
+	themes sub-directory found in tree-widget-themes-load-path.
+	(tree-widget-themes-directory, tree-widget-theme): Doc fix.
+	(tree-widget--locate-sub-directory): Return all occurrences.
+	(tree-widget-themes-path): New function.  Replace
+	tree-widget-themes-directory, and return a list of directories.
+	(tree-widget-set-parent-theme)
+	(tree-widget-lookup-image): Use it.
+
+2006-03-13  Carsten Dominik  <dominik@science.uva.nl>
+
+	* textmodes/org.el: (org-link-search): Avoid self-matching of
+	links, allow target text to be distributed over several lines.
+	(org-search-not-link): New function.
+	(org-set-regexps-and-options, org-get-current-options): New
+	startup options.
+	(org-export-as-html): Take odd-level setting from local variable.
+	(org-fontify-emphasized-text): New option.
+	(org-set-font-lock-defaults): Include emphasized text.
+	(org-follow-mhe-link): Allow folder-only links, fix folder name.
+	(org-font-lock): Customize group renamed from `org-faces'.
+
+2006-03-13  John Paul Wallington  <jpw@pobox.com>
+
+	* ibuf-ext.el (ibuffer-never-show-predicates): Add `require'
+	keyword; require `ibuf-ext' feature.  Thanks to Zhang Wei.
+
+2006-03-12  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* cus-start.el (all): Delete :version keyword for members of the
+	fringe group, since the entire group is new in 22.1.
+
+2006-03-13  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gdb-ui.el (gdb-stack-list-locals-handler): Add local
+	map if value is hexadecimal (an address).
+	(gud-watch): Only search roots for existing watch expressions.
+	(gdb-speedbar-refresh): Bind speedbar-shown-directories to nil to
+	prevent caching problems with speedbar-update-directory-contents.
+
 2006-03-12  Juri Linkov  <juri@jurta.org>
 
 	* battery.el (battery-linux-proc-acpi): Check `capacity' for non-nil
--- a/lisp/allout.el	Sun Mar 12 05:02:59 2006 +0000
+++ b/lisp/allout.el	Wed Mar 15 17:22:12 2006 +0000
@@ -6,7 +6,7 @@
 ;; Author: Ken Manheimer <ken dot manheimer at gmail dot com>
 ;; Maintainer: Ken Manheimer <ken dot manheimer at gmail dot com>
 ;; Created: Dec 1991 - first release to usenet
-;; Version: 2.2
+;; Version: 2.2.1
 ;; Keywords: outlines wp languages
 
 ;; This file is part of GNU Emacs.
@@ -126,38 +126,72 @@
                 (const :tag "Mode only" "activate")
                 (const :tag "Off" nil))
   :group 'allout)
-;;;_  = allout-layout
-(defvar allout-layout nil
-  "*Layout specification and provisional mode trigger for allout outlines.
-
-Buffer-specific.
-
-A list value specifies a default layout for the current buffer, to be
-applied upon activation of `allout-mode'.  Any non-nil value will
-automatically trigger `allout-mode' \(provided `allout-init' has been called
-to enable this behavior).
-
-See the docstring for `allout-init' for details on setting up for
-auto-mode-activation, and for `allout-expose-topic' for the format of
-the layout specification.
-
-You can associate a particular outline layout with a file by setting
-this var via the file's local variables.  For example, the following
-lines at the bottom of an Emacs Lisp file:
-
-;;;Local variables:
-;;;allout-layout: \(0 : -1 -1 0)
-;;;End:
-
-will, modulo the above-mentioned conditions, cause the mode to be
-activated when the file is visited, followed by the equivalent of
-`\(allout-expose-topic 0 : -1 -1 0)'.  \(This is the layout used for
-the allout.el source file.)
+;;;_  = allout-default-layout
+(defcustom allout-default-layout '(-2 : 0)
+  "*Default allout outline layout specification.
+
+This setting specifies the outline exposure to use when
+`allout-layout' has the local value `t'.  This docstring describes the
+layout specifications.
+
+A list value specifies a default layout for the current buffer,
+to be applied upon activation of `allout-mode'.  Any non-nil
+value will automatically trigger `allout-mode', provided
+`allout-init' has been called to enable this behavior.
+
+The types of elements in the layout specification are:
+
+ integer - dictate the relative depth to open the corresponding topic(s),
+           where:
+         - negative numbers force the topic to be closed before opening
+           to the absolute value of the number, so all siblings are open
+           only to that level.
+         - positive numbers open to the relative depth indicated by the
+           number, but do not force already opened subtopics to be closed.
+         - 0 means to close topic - hide all subitems.
+ :   - repeat spec - apply the preceeding element to all siblings at
+       current level, *up to* those siblings that would be covered by specs
+       following the `:' on the list.  Ie, apply to all topics at level but
+       trailing ones accounted for by trailing specs.  \(Only the first of
+       multiple colons at the same level is honored - later ones are ignored.)
+ *   - completely exposes the topic, including bodies
+ +   - exposes all subtopics, but not the bodies
+ -   - exposes the body of the corresponding topic, but not subtopics
+ list - a nested layout spec, to be applied intricately to its
+        corresponding item(s)
+
+Examples:
+ '(-2 : 0)
+	Collapse the top-level topics to show their children and
+        grandchildren, but completely collapse the final top-level topic.
+ '(-1 () : 1 0)
+	Close the first topic so only the immediate subtopics are shown,
+        leave the subsequent topics exposed as they are until the second
+	second to last topic, which is exposed at least one level, and
+        completely close the last topic.
+ '(-2 : -1 *)
+        Expose children and grandchildren of all topics at current
+	level except the last two; expose children of the second to
+	last and completely expose the last one, including its subtopics.
+
+See `allout-expose-topic' for more about the exposure process.
 
 Also, allout's mode-specific provisions will make topic prefixes default
 to the comment-start string, if any, of the language of the file.  This
-is modulo the setting of `allout-use-mode-specific-leader', which see.")
-(make-variable-buffer-local 'allout-layout)
+is modulo the setting of `allout-use-mode-specific-leader', which see."
+  :type 'allout-layout-type
+  :group 'allout)
+;;;_  : allout-layout-type
+(define-widget 'allout-layout-type 'lazy
+  "Allout layout format customization basic building blocks."
+  :type '(repeat
+          (choice (integer :tag "integer (<= zero is strict)")
+                  (const :tag ": (repeat prior)" :)
+                  (const :tag "* (completely expose)" *)
+                  (const :tag "+ (expose all offspring, headlines only)" +)
+                  (const :tag "- (expose topic body but not offspring)" -)
+                  (allout-layout-type :tag "<Nested layout>"))))
+
 ;;;_  = allout-show-bodies
 (defcustom allout-show-bodies nil
   "*If non-nil, show entire body when exposing a topic, rather than
@@ -590,7 +624,7 @@
 ;;;_ #1 Internal Outline Formatting and Configuration
 ;;;_  : Version
 ;;;_   = allout-version
-(defvar allout-version "2.2"
+(defvar allout-version "2.2.1"
   "Version of currently loaded outline package.  \(allout.el)")
 ;;;_   > allout-version
 (defun allout-version (&optional here)
@@ -604,6 +638,36 @@
 ;;;_   = allout-mode
 (defvar allout-mode nil "Allout outline mode minor-mode flag.")
 (make-variable-buffer-local 'allout-mode)
+;;;_   = allout-layout nil
+(defvar allout-layout nil            ; LEAVE GLOBAL VALUE NIL - see docstring.
+  "Buffer-specific setting for allout layout.
+
+In buffers where this is non-nil \(and if `allout-init' has been run, to
+enable this behavior), `allout-mode' will be automatically activated.  The
+layout dictated by the value will be used to set the initial exposure when
+`allout-mode' is activated.
+
+\*You should not setq-default this variable non-nil unless you want every
+visited file to be treated as an allout file.*
+
+The value would typically be set by a file local variable.  For
+example, the following lines at the bottom of an Emacs Lisp file:
+
+;;;Local variables:
+;;;allout-layout: \(0 : -1 -1 0)
+;;;End:
+
+dictate activation of `allout-mode' mode when the file is visited
+\(presuming allout-init was already run), followed by the
+equivalent of `\(allout-expose-topic 0 : -1 -1 0)'.  \(This is
+the layout used for the allout.el source file.)
+
+`allout-default-layout' describes the specification format.
+`allout-layout' can additionally have the value `t', in which
+case the value of `allout-default-layout' is used.")
+(make-variable-buffer-local 'allout-layout)
+(put 'allout-layout 'safe-local-variable t)
+
 ;;;_  : Topic header format
 ;;;_   = allout-regexp
 (defvar allout-regexp ""
@@ -973,11 +1037,6 @@
   "Horrible hack used to prevent invalid multiple triggering of outline
 mode from prop-line file-var activation.  Used by `allout-mode' function
 to track repeats.")
-;;;_   = allout-file-passphrase-verifier-string
-(defvar allout-file-passphrase-verifier-string nil
-  "Name for use as a file variable for verifying encryption passphrase
-across sessions.")
-(make-variable-buffer-local 'allout-file-passphrase-verifier-string)
 ;;;_   = allout-passphrase-verifier-string
 (defvar allout-passphrase-verifier-string nil
   "Setting used to test solicited encryption passphrases against the one
@@ -993,6 +1052,7 @@
 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)
+(put 'allout-passphrase-verifier-string 'safe-local-variable t)
 ;;;_   = allout-passphrase-hint-string
 (defvar allout-passphrase-hint-string ""
   "Variable used to retain reminder string for file's encryption passphrase.
@@ -1004,6 +1064,7 @@
 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)
+(put 'allout-passphrase-hint-string 'safe-local-variable t)
 (setq-default allout-passphrase-hint-string "")
 ;;;_   = allout-after-save-decrypt
 (defvar allout-after-save-decrypt nil
@@ -1578,30 +1639,33 @@
       (allout-infer-body-reindent))
      )					; cond
 
-    (if (and do-layout
-	     allout-auto-activation
-	     (listp allout-layout)
-	     (and (not (eq allout-auto-activation 'activate))
-		  (if (eq allout-auto-activation 'ask)
-		      (if (y-or-n-p (format "Expose %s with layout '%s'? "
-					    (buffer-name)
-					    allout-layout))
-			  t
-			(message "Skipped %s layout." (buffer-name))
-			nil)
-		    t)))
-	(save-excursion
-	  (message "Adjusting '%s' exposure..." (buffer-name))
-	  (goto-char 0)
-	  (allout-this-or-next-heading)
-	  (condition-case err
-	      (progn
-		(apply 'allout-expose-topic (list allout-layout))
-		(message "Adjusting '%s' exposure... done." (buffer-name)))
-	    ;; Problem applying exposure - notify user, but don't
-	    ;; interrupt, eg, file visit:
-	    (error (message "%s" (car (cdr err)))
-		   (sit-for 1)))))
+    (let ((use-layout (if (listp allout-layout)
+                          allout-layout
+                        allout-default-layout)))
+      (if (and do-layout
+               allout-auto-activation
+               use-layout
+               (and (not (eq allout-auto-activation 'activate))
+                    (if (eq allout-auto-activation 'ask)
+                        (if (y-or-n-p (format "Expose %s with layout '%s'? "
+                                              (buffer-name)
+                                              use-layout))
+                            t
+                          (message "Skipped %s layout." (buffer-name))
+                          nil)
+                      t)))
+          (save-excursion
+            (message "Adjusting '%s' exposure..." (buffer-name))
+            (goto-char 0)
+            (allout-this-or-next-heading)
+            (condition-case err
+                (progn
+                  (apply 'allout-expose-topic (list use-layout))
+                  (message "Adjusting '%s' exposure... done." (buffer-name)))
+              ;; Problem applying exposure - notify user, but don't
+              ;; interrupt, eg, file visit:
+              (error (message "%s" (car (cdr err)))
+                     (sit-for 1))))))
     allout-mode
     )					; let*
   )  					; defun
@@ -1660,7 +1724,7 @@
             (if (not
                  (yes-or-no-p
                   (substitute-command-keys
-                   (concat "Modify this concealed text?  (\"no\" aborts,"
+                   (concat "Modify concealed text?  (\"no\" just aborts,"
                            " \\[keyboard-quit] also reconceals) "))))
                 (progn (goto-char start)
                        (error "Concealed-text change refused.")))
@@ -1676,7 +1740,7 @@
 
 This before-change handler is used only where modification-hooks
 overlay property is not supported."
-  (if (not allout-mode)
+  (if (not (allout-mode-p))
       nil
     (allout-overlay-interior-modification-handler nil nil beg end nil)))
 ;;;_  > allout-isearch-end-handler (&optional overlay)
@@ -2561,7 +2625,6 @@
 return to regular interpretation of self-insert characters."
 
   (if (not (allout-mode-p))
-      ;; Shouldn't be invoked if not in allout-mode, but just in case:
       nil
     ;; Hot-spot navigation provisions:
     (if (and (eq this-command 'self-insert-command)
@@ -2595,7 +2658,7 @@
 		      this-command mapped-binding)))))))
 ;;;_   > allout-find-file-hook ()
 (defun allout-find-file-hook ()
-  "Activate `allout-mode' when `allout-auto-activation', `allout-layout' non-nil.
+  "Activate `allout-mode' on non-nil `allout-auto-activation', `allout-layout'.
 
 See `allout-init' for setup instructions."
   (if (and allout-auto-activation
@@ -3415,7 +3478,7 @@
   (if (or (not (allout-mode-p))
           (not (bolp))
           (not (looking-at allout-regexp)))
-      ;; Above conditions do not obtain - just do a regular kill:
+      ;; Just do a regular kill:
       (kill-line arg)
     ;; Ah, have to watch out for adjustments:
     (let* ((beg (point))
@@ -3889,7 +3952,7 @@
 topics \(which intrinsically can be considered both collapsed and
 not\), as collapsed.  Otherwise they are considered uncollapsed."
   (save-excursion
-      (and 
+      (and
        (= (progn (allout-back-to-current-heading)
                  (move-end-of-line 1)
                  (point))
@@ -5068,7 +5131,7 @@
   )
 ;;;_  > allout-obtain-passphrase (for-key cache-id prompt-id key-type
 ;;;                                       allout-buffer retried fetch-pass)
-(defun allout-obtain-passphrase (for-key cache-id prompt-id key-type 
+(defun allout-obtain-passphrase (for-key cache-id prompt-id key-type
                                          allout-buffer retried fetch-pass)
   "Obtain passphrase for a key from the cache or else from the user.
 
@@ -5242,7 +5305,7 @@
                            nil nil 0 passphrase))
   )
 ;;;_  > allout-update-passphrase-mnemonic-aids (for-key passphrase
-;;;                                                     outline-buffer) 
+;;;                                                     outline-buffer)
 (defun allout-update-passphrase-mnemonic-aids (for-key passphrase
                                                        outline-buffer)
   "Update passphrase verifier and hint strings if necessary.
@@ -5298,7 +5361,7 @@
 (defun allout-get-encryption-passphrase-verifier ()
   "Return text of the encrypt passphrase verifier, unmassaged, or nil if none.
 
-Derived from value of `allout-file-passphrase-verifier-string'."
+Derived from value of `allout-passphrase-verifier-string'."
 
   (let ((verifier-string (and (boundp 'allout-passphrase-verifier-string)
                               allout-passphrase-verifier-string)))
@@ -5457,7 +5520,7 @@
       (insert (concat "Dummy outline topic header - see"
                       "`allout-mode' docstring: `^Hm'."))
       (allout-adjust-file-variable
-       "allout-layout" (format "%s" (or allout-layout '(-1 : 0)))))))
+       "allout-layout" (or allout-layout '(-1 : 0))))))
 ;;;_  > allout-file-vars-section-data ()
 (defun allout-file-vars-section-data ()
   "Return data identifying the file-vars section, or nil if none.
@@ -5708,13 +5771,7 @@
 
 With argument ARG not nil or 1, move forward ARG - 1 lines first.
 If point reaches the beginning or end of buffer, it stops there.
-To ignore intangibility, bind `inhibit-point-motion-hooks' to t.
-
-This function does not move point across a field boundary unless that
-would move point to a different line than the original, unconstrained
-result.  If N is nil or 1, and a front-sticky field starts at point,
-the point does not move.  To ignore field boundaries bind
-`inhibit-field-text-motion' to t."
+To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
       (interactive "p")
       (or arg (setq arg 1))
       (if (/= arg 1)
@@ -5730,7 +5787,7 @@
           (skip-chars-backward "^\n"))
         (vertical-motion 0)
         (if (/= orig (point))
-            (goto-char (constrain-to-field (point) orig (/= arg 1) t nil)))))
+            (goto-char orig))))
 )
 ;;;_  > move-end-of-line if necessary - older emacs, xemacs
 (if (not (fboundp 'move-end-of-line))
@@ -5741,13 +5798,7 @@
 
 With argument ARG not nil or 1, move forward ARG - 1 lines first.
 If point reaches the beginning or end of buffer, it stops there.
-To ignore intangibility, bind `inhibit-point-motion-hooks' to t.
-
-This function does not move point across a field boundary unless that
-would move point to a different line than the original, unconstrained
-result.  If N is nil or 1, and a rear-sticky field ends at point,
-the point does not move.  To ignore field boundaries bind
-`inhibit-field-text-motion' to t."
+To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
       (interactive "p")
       (or arg (setq arg 1))
       (let ((orig (point))
@@ -5777,8 +5828,7 @@
                   (setq arg 1)
                 (setq done t)))))
         (if (/= orig (point))
-            (goto-char (constrain-to-field (point) orig (/= arg 1) t
-                                           nil)))))
+            (goto-char orig))))
   )
 ;;;_  > line-move-invisible-p if necessary
 (if (not (fboundp 'line-move-invisible-p))
--- a/lisp/cus-start.el	Sun Mar 12 05:02:59 2006 +0000
+++ b/lisp/cus-start.el	Wed Mar 15 17:22:12 2006 +0000
@@ -52,7 +52,7 @@
 	     (ctl-arrow display boolean)
 	     (truncate-lines display boolean)
 	     (selective-display-ellipses display boolean)
-	     (indicate-empty-lines fringe boolean "21.1")
+	     (indicate-empty-lines fringe boolean)
 	     (indicate-buffer-boundaries
 	      fringe
 	      (choice
@@ -91,8 +91,7 @@
 			    (const :tag "Do not show" (down . nil))
 			    (const :tag "On the left" (down . left))
 			    (const :tag "On the right" (down . right))))
-	       (other :tag "On left, no arrows" t))
-	      "22.1")
+	       (other :tag "On left, no arrows" t)))
 	     (scroll-up-aggressively windows
 				     (choice (const :tag "off" nil) number)
 				     "21.1")
@@ -174,7 +173,7 @@
 					    (const :tag "always shown" t)
 					    (other :tag "hidden by keypress" 1)))
 	     ;; fringe.c
-	     (overflow-newline-into-fringe fringe boolean "22.1")
+	     (overflow-newline-into-fringe fringe boolean)
 	     ;; indent.c
 	     (indent-tabs-mode fill boolean)
 	     ;; keyboard.c
--- a/lisp/font-core.el	Sun Mar 12 05:02:59 2006 +0000
+++ b/lisp/font-core.el	Wed Mar 15 17:22:12 2006 +0000
@@ -83,6 +83,34 @@
 settings.  See the variable `font-lock-defaults', which takes precedence.")
 (make-obsolete-variable 'font-lock-defaults-alist 'font-lock-defaults)
 
+(defvar font-lock-extend-region-function nil
+  "A function that determines the region to fontify after a change.
+
+This buffer-local variable is either nil, or is a function that determines the
+region to fontify.  It is usually set by the major mode.  The currently active
+font-lock after-change function calls this function after each buffer change.
+
+The function is given three parameters, the standard BEG, END, and OLD-LEN
+from after-change-functions.  It should return either a cons of the beginning
+and end buffer positions \(in that order) of the region to fontify, or nil
+\(which directs the caller to fontify a default region).  This function need
+not preserve point or the match-data, but must preserve the current
+restriction.  The region it returns may start or end in the middle of a
+line.")
+(make-variable-buffer-local 'font-lock-extend-region-function)
+
+(defun font-lock-extend-region (beg end old-len)
+  "Determine the region to fontify after a buffer change.
+
+BEG END and OLD-LEN are the standard parameters from after-change-functions.
+The return value is either nil \(which directs the caller to chose the region
+itself), or a cons of the beginning and end \(in that order) of the region.
+The region returned may start or end in the middle of a line."
+  (if font-lock-extend-region-function
+      (save-match-data
+	(save-excursion
+	  (funcall font-lock-extend-region-function beg end old-len)))))
+
 (defvar font-lock-function 'font-lock-default-function
   "A function which is called when `font-lock-mode' is toggled.
 It will be passed one argument, which is the current value of
--- a/lisp/font-lock.el	Sun Mar 12 05:02:59 2006 +0000
+++ b/lisp/font-lock.el	Wed Mar 15 17:22:12 2006 +0000
@@ -1039,7 +1039,7 @@
 	  (when font-lock-syntax-table
 	    (set-syntax-table font-lock-syntax-table))
           (goto-char beg)
-          (setq beg (line-beginning-position (- 1 font-lock-lines-before)))
+	  (setq beg (line-beginning-position))
 	  ;; check to see if we should expand the beg/end area for
 	  ;; proper multiline matches
 	  (when (and (> beg (point-min))
@@ -1090,13 +1090,18 @@
 ;; Called when any modification is made to buffer text.
 (defun font-lock-after-change-function (beg end old-len)
   (let ((inhibit-point-motion-hooks t)
-	(inhibit-quit t))
+	(inhibit-quit t)
+	(region (font-lock-extend-region beg end old-len)))
     (save-excursion
       (save-match-data
-	;; Rescan between start of lines enclosing the region.
-	(font-lock-fontify-region
-	 (progn (goto-char beg) (forward-line 0) (point))
-	 (progn (goto-char end) (forward-line 1) (point)))))))
+	(if region
+	    ;; Fontify the region the major mode has specified.
+	    (setq beg (car region) end (cdr region))
+	  ;; Fontify the whole lines which enclose the region.
+	  (setq beg (progn (goto-char beg)
+			   (forward-line (- font-lock-lines-before)))
+		end (progn (goto-char end) (forward-line 1) (point))))
+	(font-lock-fontify-region beg end)))))
 
 (defun font-lock-fontify-block (&optional arg)
   "Fontify some lines the way `font-lock-fontify-buffer' would.
--- a/lisp/ibuf-ext.el	Sun Mar 12 05:02:59 2006 +0000
+++ b/lisp/ibuf-ext.el	Wed Mar 15 17:22:12 2006 +0000
@@ -74,6 +74,7 @@
 If a function, it will be called with the buffer as an argument, and
 should return non-nil if this buffer should not be shown."
   :type '(repeat (choice regexp function))
+  :require 'ibuf-ext
   :group 'ibuffer)
 
 (defcustom ibuffer-always-show-predicates nil
--- a/lisp/image.el	Sun Mar 12 05:02:59 2006 +0000
+++ b/lisp/image.el	Wed Mar 15 17:22:12 2006 +0000
@@ -77,30 +77,34 @@
        (list (file-name-as-directory (expand-file-name "images" data-directory))
 	     'data-directory 'load-path)))
 
+
 (defun image-load-path-for-library (library image &optional path no-error)
   "Return a suitable search path for images relative to LIBRARY.
 
-Images for LIBRARY are searched for in \"../../etc/images\" and
-\"../etc/images\" relative to the files in \"lisp/LIBRARY\" as
-well as in `image-load-path' and `load-path'.
+First it searches for IMAGE in a path suitable for LIBRARY, which
+includes \"../../etc/images\" and \"../etc/images\" relative to
+the library file itself, followed by `image-load-path' and
+`load-path'.
 
-This function returns the value of `load-path' augmented with the
-directory containing IMAGE. If PATH is given, it is used instead
-of `load-path'. If PATH is t, just return the directory that
-contains IMAGE.
+Then this function returns a list of directories which contains
+first the directory in which IMAGE was found, followed by the
+value of `load-path'. If PATH is given, it is used instead of
+`load-path'.
 
-If NO-ERROR is non-nil, return nil if a suitable path can't be
-found rather than signaling an error.
+If NO-ERROR is non-nil and a suitable path can't be found, don't
+signal an error. Instead, return a list of directories as before,
+except that nil appears in place of the image directory.
 
 Here is an example that uses a common idiom to provide
 compatibility with versions of Emacs that lack the variable
 `image-load-path':
 
-  (let ((load-path
-         (image-load-path-for-library \"mh-e\" \"mh-logo.xpm\"))
-        (image-load-path
-         (image-load-path-for-library \"mh-e\" \"mh-logo.xpm\" 'image-load-path)))
-    (mh-tool-bar-folder-buttons-init))"
+    ;; Avoid errors on Emacsen without `image-load-path'.
+    (if (not (boundp 'image-load-path)) (defvar image-load-path nil))
+
+    (let* ((load-path (image-load-path-for-library \"mh-e\" \"mh-logo.xpm\"))
+           (image-load-path (cons (car load-path) image-load-path)))
+      (mh-tool-bar-folder-buttons-init))"
   (unless library (error "No library specified"))
   (unless image   (error "No image specified"))
   (let ((image-directory))
@@ -142,26 +146,14 @@
                        dir (expand-file-name "../" dir)))
                (setq image-directory dir)))))
      (no-error
-      ;; In this case we will return nil.
       (message "Could not find image %s for library %s" image library))
      (t
       (error "Could not find image %s for library %s" image library)))
 
-    ;; Return the directory, nil if no-error was non-nil and a
-    ;; suitable path could not be found, or an augmented
-    ;; `image-load-path' or `load-path'.
-    (cond ((or (null image-directory)
-               (eq path t))
-           image-directory)
-          ((and path (symbolp path))
-           (nconc (list image-directory)
-                  (delete image-directory
-                          (if (boundp path)
-                              (copy-sequence (symbol-value path))
-                            nil))))
-          (t
-           (nconc (list image-directory)
-                  (delete image-directory (copy-sequence load-path)))))))
+    ;; Return an augmented `path' or `load-path'.
+    (nconc (list image-directory)
+           (delete image-directory (copy-sequence (or path load-path))))))
+
 
 (defun image-jpeg-p (data)
   "Value is non-nil if DATA, a string, consists of JFIF image data.
--- a/lisp/jit-lock.el	Sun Mar 12 05:02:59 2006 +0000
+++ b/lisp/jit-lock.el	Wed Mar 15 17:22:12 2006 +0000
@@ -557,36 +557,44 @@
 in case the syntax of those lines has changed.  Refontification
 will take place when text is fontified stealthily."
   (when (and jit-lock-mode (not memory-full))
-    (save-excursion
-      (with-buffer-prepared-for-jit-lock
-       ;; It's important that the `fontified' property be set from the
-       ;; beginning of the line, else font-lock will properly change the
-       ;; text's face, but the display will have been done already and will
-       ;; be inconsistent with the buffer's content.
-       (goto-char start)
-       (setq start (line-beginning-position))
+    (let ((region (font-lock-extend-region start end old-len)))
+      (save-excursion
+	(with-buffer-prepared-for-jit-lock
+	 ;; It's important that the `fontified' property be set from the
+	 ;; beginning of the line, else font-lock will properly change the
+	 ;; text's face, but the display will have been done already and will
+	 ;; be inconsistent with the buffer's content.
+	 ;; 
+	 ;; FIXME!!! (Alan Mackenzie, 2006-03-14): If start isn't at a BOL,
+	 ;; expanding the region to BOL might mis-fontify, should the BOL not
+	 ;; be at a "safe" position.
+	 (setq start (if region
+			 (car region)
+		       (goto-char start)
+		       (line-beginning-position (- 1 font-lock-lines-before))))
 
-       ;; If we're in text that matches a multi-line font-lock pattern,
-       ;; make sure the whole text will be redisplayed.
-       ;; I'm not sure this is ever necessary and/or sufficient.  -stef
-       (when (get-text-property start 'font-lock-multiline)
-	 (setq start (or (previous-single-property-change
-			  start 'font-lock-multiline)
-			 (point-min))))
+	 ;; If we're in text that matches a multi-line font-lock pattern,
+	 ;; make sure the whole text will be redisplayed.
+	 ;; I'm not sure this is ever necessary and/or sufficient.  -stef
+	 (when (get-text-property start 'font-lock-multiline)
+	   (setq start (or (previous-single-property-change
+			    start 'font-lock-multiline)
+			   (point-min))))
 
-       ;; Make sure we change at least one char (in case of deletions).
-       (setq end (min (max end (1+ start)) (point-max)))
-       ;; Request refontification.
-       (put-text-property start end 'fontified nil))
-      ;; Mark the change for deferred contextual refontification.
-      (when jit-lock-context-unfontify-pos
-	(setq jit-lock-context-unfontify-pos
-              ;; Here we use `start' because nothing guarantees that the
-              ;; text between start and end will be otherwise refontified:
-              ;; usually it will be refontified by virtue of being
-              ;; displayed, but if it's outside of any displayed area in the
-              ;; buffer, only jit-lock-context-* will re-fontify it.
-	      (min jit-lock-context-unfontify-pos start))))))
+	 (if region (setq end (cdr region)))
+	 ;; Make sure we change at least one char (in case of deletions).
+	 (setq end (min (max end (1+ start)) (point-max)))
+	 ;; Request refontification.
+	 (put-text-property start end 'fontified nil))
+	;; Mark the change for deferred contextual refontification.
+	(when jit-lock-context-unfontify-pos
+	  (setq jit-lock-context-unfontify-pos
+		;; Here we use `start' because nothing guarantees that the
+		;; text between start and end will be otherwise refontified:
+		;; usually it will be refontified by virtue of being
+		;; displayed, but if it's outside of any displayed area in the
+		;; buffer, only jit-lock-context-* will re-fontify it.
+		(min jit-lock-context-unfontify-pos start)))))))
 
 (provide 'jit-lock)
 
--- a/lisp/mh-e/ChangeLog	Sun Mar 12 05:02:59 2006 +0000
+++ b/lisp/mh-e/ChangeLog	Wed Mar 15 17:22:12 2006 +0000
@@ -1,3 +1,26 @@
+2006-03-14  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
+	directory comes first.
+
+	* mh-e.el (image-load-path): Define on those Emacsen that lack it
+	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-utils.el (mh-logo-display): Ditto.
+
+2006-03-12  Bill Wohler  <wohler@newt.com>
+
+	* mh-utils.el (mh-folder-list): Fix docstring (closes SF
+	#1448498).
+
 2006-03-10  Bill Wohler  <wohler@newt.com>
 
 	* mh-compat.el (mh-replace-regexp-in-string): Pass the literal
--- a/lisp/mh-e/mh-compat.el	Sun Mar 12 05:02:59 2006 +0000
+++ b/lisp/mh-e/mh-compat.el	Wed Mar 15 17:22:12 2006 +0000
@@ -119,30 +119,30 @@
   image-load-path-for-library (library image &optional path no-error)
   "Return a suitable search path for images relative to LIBRARY.
 
-Images for LIBRARY are searched for in \"../../etc/images\" and
-\"../etc/images\" relative to the files in \"lisp/LIBRARY\" as
-well as in `image-load-path' and `load-path'.
+First it searches for IMAGE in a path suitable for LIBRARY, which
+includes \"../../etc/images\" and \"../etc/images\" relative to
+the library file itself, followed by `image-load-path' and
+`load-path'.
 
-This function returns the value of `load-path' augmented with the
-directory containing IMAGE. If PATH is given, it is used instead
-of `load-path'. If PATH is t, just return the directory that
-contains IMAGE.
+Then this function returns a list of directories which contains
+first the directory in which IMAGE was found, followed by the
+value of `load-path'. If PATH is given, it is used instead of
+`load-path'.
 
-If NO-ERROR is non-nil, return nil if a suitable path can't be
-found rather than signaling an error.
+If NO-ERROR is non-nil and a suitable path can't be found, don't
+signal an error. Instead, return a list of directories as before,
+except that nil appears in place of the image directory.
 
 Here is an example that uses a common idiom to provide
 compatibility with versions of Emacs that lack the variable
 `image-load-path':
 
-  (let ((load-path
-         (image-load-path-for-library \"mh-e\" \"mh-logo.xpm\"))
-        (image-load-path
-         (image-load-path-for-library \"mh-e\" \"mh-logo.xpm\" 'image-load-path)))
-    (mh-tool-bar-folder-buttons-init))
+    ;; Avoid errors on Emacsen without `image-load-path'.
+    (if (not (boundp 'image-load-path)) (defvar image-load-path nil))
 
-This function is used by Emacs versions that don't have
-`image-load-path-for-library'."
+    (let* ((load-path (image-load-path-for-library \"mh-e\" \"mh-logo.xpm\"))
+           (image-load-path (cons (car load-path) image-load-path)))
+      (mh-tool-bar-folder-buttons-init))"
   (unless library (error "No library specified"))
   (unless image   (error "No image specified"))
   (let ((image-directory))
@@ -184,26 +184,13 @@
                        dir (expand-file-name "../" dir)))
                (setq image-directory dir)))))
      (no-error
-      ;; In this case we will return nil.
       (message "Could not find image %s for library %s" image library))
      (t
       (error "Could not find image %s for library %s" image library)))
 
-    ;; Return the directory, nil if no-error was non-nil and a
-    ;; suitable path could not be found, or an augmented
-    ;; `image-load-path' or `load-path'.
-    (cond ((or (null image-directory)
-               (eq path t))
-           image-directory)
-          ((and path (symbolp path))
-           (nconc (list image-directory)
-                  (delete image-directory
-                          (if (boundp path)
-                              (copy-sequence (symbol-value path))
-                            nil))))
-          (t
-           (nconc (list image-directory)
-                  (delete image-directory (copy-sequence load-path)))))))
+    ;; Return an augmented `path' or `load-path'.
+    (nconc (list image-directory)
+           (delete image-directory (copy-sequence (or path load-path))))))
 
 (mh-defun-compat mh-image-search-load-path
   image-search-load-path (file &optional path)
--- a/lisp/mh-e/mh-e.el	Sun Mar 12 05:02:59 2006 +0000
+++ b/lisp/mh-e/mh-e.el	Wed Mar 15 17:22:12 2006 +0000
@@ -325,6 +325,9 @@
 
 ;; Etc. (alphabetical)
 
+;; Avoid errors on Emacsen without image-load-path.
+(if (not (boundp 'image-load-path)) (defvar image-load-path nil))
+
 (defvar mh-flists-present-flag nil
   "Non-nil means that we have \"flists\".")
 
--- a/lisp/mh-e/mh-folder.el	Sun Mar 12 05:02:59 2006 +0000
+++ b/lisp/mh-e/mh-folder.el	Wed Mar 15 17:22:12 2006 +0000
@@ -591,9 +591,8 @@
 \\{mh-folder-mode-map}"
   (mh-do-in-gnu-emacs
     (unless mh-folder-buttons-init-flag
-      (let ((load-path (mh-image-load-path-for-library "mh-e" "mh-logo.xpm"))
-            (image-load-path (mh-image-load-path-for-library
-                              "mh-e" "mh-logo.xpm" 'image-load-path)))
+      (let* ((load-path (mh-image-load-path-for-library "mh-e" "mh-logo.xpm"))
+             (image-load-path (cons (car load-path) image-load-path)))
         (mh-tool-bar-folder-buttons-init)
         (setq mh-folder-buttons-init-flag t)))
     (set (make-local-variable 'tool-bar-map) mh-folder-tool-bar-map))
--- a/lisp/mh-e/mh-letter.el	Sun Mar 12 05:02:59 2006 +0000
+++ b/lisp/mh-e/mh-letter.el	Wed Mar 15 17:22:12 2006 +0000
@@ -313,9 +313,8 @@
   (make-local-variable 'mh-sent-from-msg)
   (mh-do-in-gnu-emacs
     (unless mh-letter-buttons-init-flag
-      (let ((load-path (mh-image-load-path-for-library "mh-e" "mh-logo.xpm"))
-            (image-load-path (mh-image-load-path-for-library
-                              "mh-e" "mh-logo.xpm" 'image-load-path)))
+      (let* ((load-path (mh-image-load-path-for-library "mh-e" "mh-logo.xpm"))
+             (image-load-path (cons (car load-path) image-load-path)))
         (mh-tool-bar-letter-buttons-init)
         (setq mh-letter-buttons-init-flag t)))
     (set (make-local-variable 'tool-bar-map) mh-letter-tool-bar-map))
--- a/lisp/mh-e/mh-utils.el	Sun Mar 12 05:02:59 2006 +0000
+++ b/lisp/mh-e/mh-utils.el	Wed Mar 15 17:22:12 2006 +0000
@@ -131,9 +131,8 @@
 (defun mh-logo-display ()
   "Modify mode line to display MH-E logo."
   (mh-do-in-gnu-emacs
-    (let ((load-path (mh-image-load-path-for-library "mh-e" "mh-logo.xpm"))
-          (image-load-path (mh-image-load-path-for-library
-                            "mh-e" "mh-logo.xpm" 'image-load-path)))
+    (let* ((load-path (mh-image-load-path-for-library "mh-e" "mh-logo.xpm"))
+           (image-load-path (cons (car load-path) image-load-path)))
       (add-text-properties
        0 2
        `(display ,(or mh-logo-cache
@@ -504,7 +503,7 @@
   (mh-folder-list nil)
        => (\"inbox\" \"lists\" \"lists/mh-e\" \"outbox\")
   (mh-folder-list \"+lists\")
-       => (\"lists/mh-e\")
+       => (\"lists\" \"lists/mh-e\")
 
 Respects the value of `mh-recursive-folders-flag'. If this flag
 is nil, and the sub-folders have not been explicitly viewed, then
--- a/lisp/net/rcirc.el	Sun Mar 12 05:02:59 2006 +0000
+++ b/lisp/net/rcirc.el	Wed Mar 15 17:22:12 2006 +0000
@@ -50,6 +50,7 @@
   "Simple IRC client."
   :version "22.1"
   :prefix "rcirc-"
+  :link '(custom-manual "(rcirc)")
   :group 'applications)
 
 (defcustom rcirc-server "irc.freenode.net"
@@ -195,12 +196,6 @@
   :type '(repeat string)
   :group 'rcirc)
 
-(defcustom rcirc-nick-abbrevs nil
-  "List of short replacements for printing nicks."
-  :type '(alist :key-type (string :tag "Nick")
-		:value-type (string :tag "Abbrev"))
-  :group 'rcirc)
-
 (defvar rcirc-ignore-list-automatic ()
   "List of ignored nicks added to `rcirc-ignore-list' because of renaming.
 When an ignored person renames, their nick is added to both lists.
@@ -493,11 +488,6 @@
   (with-rcirc-process-buffer process
     rcirc-nick))
 
-(defun rcirc-abbrev-nick (nick)
-  "If NICK has an entry in `rcirc-nick-abbrevs', return its abbreviation,
-otherwise return NICK."
-  (or (cdr (assoc nick rcirc-nick-abbrevs)) nick))
-
 (defvar rcirc-max-message-length 450
   "Messages longer than this value will be split.")
 
@@ -883,7 +873,7 @@
 (defun rcirc-multiline-edit-submit ()
   "Send the text in buffer back to parent buffer."
   (interactive)
-  (assert (and (eq major-mode 'rcirc-multiline-edit-mode)))
+  (assert (eq major-mode 'rcirc-multiline-edit-mode))
   (assert rcirc-parent-buffer)
   (untabify (point-min) (point-max))
   (let ((text (buffer-substring (point-min) (point-max)))
@@ -899,7 +889,7 @@
 (defun rcirc-multiline-edit-cancel ()
   "Cancel the multiline edit."
   (interactive)
-  (assert (and (eq major-mode 'rcirc-multiline-edit-mode)))
+  (assert (eq major-mode 'rcirc-multiline-edit-mode))
   (kill-buffer (current-buffer))
   (set-window-configuration rcirc-window-configuration))
 
@@ -975,7 +965,7 @@
 							process rcirc-server)
 						    sender)
 					   ""
-					 (rcirc-abbrev-nick sender))
+					 sender)
 				       (and target (concat "," target)))))
 		     (rcirc-facify nick
 				   (if (eq key ?n)
@@ -1088,7 +1078,7 @@
 	      (set-marker text-start
 			  (or (next-single-property-change fill-start 
 							   'rcirc-text)
-			      (point-max)))
+			      rcirc-prompt-end-marker))
 	      ;; squeeze spaces out of text before rcirc-text
 	      (fill-region fill-start (1- text-start))
 
@@ -1253,9 +1243,7 @@
 (define-key rcirc-track-minor-mode-map (kbd "C-c C-@") 'rcirc-next-active-buffer)
 (define-key rcirc-track-minor-mode-map (kbd "C-c C-SPC") 'rcirc-next-active-buffer)
 
-;;; FIXME: the code to insert `rcirc-activity-string' into
-;;; `global-mode-string' isn't called when the mode is activated by
-;;; customize.  I don't know how to set that up.
+;;;###autoload
 (define-minor-mode rcirc-track-minor-mode
   "Global minor mode for tracking activity in rcirc buffers."
   :init-value nil
@@ -1357,7 +1345,7 @@
   (setq rcirc-activity-string
 	(if (not rcirc-activity)
 	       ""
-	  (concat " ["
+	  (concat "-["
 		  (mapconcat
 		   (lambda (b)
 		     (let ((s (rcirc-short-buffer-name b)))
@@ -1366,7 +1354,7 @@
 			     s
 			   (rcirc-facify s 'rcirc-mode-line-nick)))))
 		   rcirc-activity ",")
-		  "]"))))
+		  "]-"))))
 
 (defun rcirc-short-buffer-name (buffer)
   "Return a short name for BUFFER to use in the modeline indicator."
--- a/lisp/progmodes/gdb-ui.el	Sun Mar 12 05:02:59 2006 +0000
+++ b/lisp/progmodes/gdb-ui.el	Wed Mar 15 17:22:12 2006 +0000
@@ -81,7 +81,7 @@
 
 ;; 1) They go out of scope when the inferior is re-run.
 ;; 2) -stack-list-locals has a type field but also prints type in values field.
-;; 3) VARNUM increments even when vairable object is not created (maybe trivial).
+;; 3) VARNUM increments even when variable object is not created (maybe trivial).
 
 ;;; TODO:
 
@@ -107,7 +107,7 @@
 (defvar gdb-current-language nil)
 (defvar gdb-var-list nil
  "List of variables in watch window.
-Each element has the form (EXPRESSION VARNUM NUMCHILD TYPE VALUE STATUS) where
+Each element has the form (VARNUM EXPRESSION NUMCHILD TYPE VALUE STATUS) where
 STATUS is nil (unchanged), `changed' or `out-of-scope'.")
 (defvar gdb-force-update t
  "Non-nil means that view of watch expressions will be updated in the speedbar.")
@@ -301,12 +301,38 @@
   :group 'gud
   :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
+buffer and the other with the source file with the main routine
+of the inferior.  Non-nil means display the layout shown for
+`gdba'."
+  :type 'boolean
+  :group 'gud
+  :version "22.1")
+
 (defcustom gdb-use-separate-io-buffer nil
   "Non-nil means display output from the inferior in a separate buffer."
   :type 'boolean
   :group 'gud
   :version "22.1")
 
+(defun gdb-many-windows (arg)
+  "Toggle the number of windows in the basic arrangement.
+With arg, display additional buffers iff arg is positive."
+  (interactive "P")
+  (setq gdb-many-windows
+	(if (null arg)
+	    (not gdb-many-windows)
+	  (> (prefix-numeric-value arg) 0)))
+  (message (format "Display of other windows %sabled"
+		   (if gdb-many-windows "en" "dis")))
+  (if (and gud-comint-buffer
+	   (buffer-name gud-comint-buffer))
+      (condition-case nil
+	  (gdb-restore-windows)
+	(error nil))))
+
 (defun gdb-use-separate-io-buffer (arg)
   "Toggle separate IO for inferior.
 With arg, use separate IO iff arg is positive."
@@ -391,12 +417,20 @@
 
 (defun gdb-find-watch-expression ()
   (let* ((var (nth (- (line-number-at-pos (point)) 2) gdb-var-list))
-	 (varno (nth 1 var)) (expr))
-    (string-match "\\(var[0-9]+\\)\\.\\(.*\\)" varno)
-    (dolist (var1 gdb-var-list)
-      (if (string-equal (nth 1 var1) (match-string 1 varno))
-	  (setq expr (concat (car var1) "." (match-string 2 varno)))))
-    expr))
+	 (varnum (car var)) expr array)
+    (string-match "\\(var[0-9]+\\)\\.\\(.*\\)" varnum)
+    (let ((var1 (assoc (match-string 1 varnum) gdb-var-list)) var2 varnumlet
+	  (component-list (split-string (match-string 2 varnum) "\\." t)))
+      (setq expr (nth 1 var1))
+      (setq varnumlet (car var1))
+      (dolist (component component-list)
+	(setq var2 (assoc varnumlet gdb-var-list))
+	(setq expr (concat expr
+			   (if (string-match ".*\\[[0-9]+\\]$" (nth 3 var2))
+			       (concat "[" component "]")
+			     (concat "." component))))
+	(setq varnumlet (concat varnumlet "." component)))
+      expr)))
 
 (defun gdb-init-1 ()
   (set (make-local-variable 'gud-minor-mode) 'gdba)
@@ -622,23 +656,36 @@
   :group 'gud
   :version "22.1")
 
-(defun gud-watch (&optional event)
-  "Watch expression at point."
-  (interactive (list last-input-event))
-  (if event (posn-set-point (event-end event)))
-  (require 'tooltip)
-  (save-selected-window
-    (let ((expr (tooltip-identifier-from-point (point))))
-      (catch 'already-watched
-	(dolist (var gdb-var-list)
-	  (if (string-equal expr (car var)) (throw 'already-watched nil)))
-	(set-text-properties 0 (length expr) nil expr)
-	(gdb-enqueue-input
-	 (list
-	  (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
-	      (concat "server interpreter mi \"-var-create - * "  expr "\"\n")
-	    (concat"-var-create - * "  expr "\n"))
-	  `(lambda () (gdb-var-create-handler ,expr))))))))
+(define-key gud-minor-mode-map "\C-c\C-w" 'gud-watch)
+(define-key global-map (concat gud-key-prefix "\C-w") 'gud-watch)
+
+(defun gud-watch (&optional arg event)
+  "Watch expression at point.
+With arg, enter name of variable to be watched in the minibuffer."
+  (interactive (list current-prefix-arg last-input-event))
+  (let ((minor-mode (buffer-local-value 'gud-minor-mode gud-comint-buffer)))
+    (if (memq minor-mode '(gdbmi gdba))
+	(progn
+	  (if event (posn-set-point (event-end event)))
+	  (require 'tooltip)
+	  (save-selected-window
+	    (let ((expr (if arg
+			    (read-string "Name of variable: ")
+			  (tooltip-identifier-from-point (point)))))
+	      (catch 'already-watched
+		(dolist (var gdb-var-list)
+		  (unless (string-match "\\." (car var))
+		    (if (string-equal expr (nth 1 var))
+			(throw 'already-watched nil))))
+		(set-text-properties 0 (length expr) nil expr)
+		(gdb-enqueue-input
+		 (list
+		  (if (eq minor-mode 'gdba)
+		      (concat
+		       "server interpreter mi \"-var-create - * "  expr "\"\n")
+		    (concat"-var-create - * "  expr "\n"))
+		  `(lambda () (gdb-var-create-handler ,expr))))))))
+      (message "gud-watch is a no-op in this mode."))))
 
 (defconst gdb-var-create-regexp
   "name=\"\\(.*?\\)\",numchild=\"\\(.*?\\)\",type=\"\\(.*?\\)\"")
@@ -647,11 +694,11 @@
   (goto-char (point-min))
   (if (re-search-forward gdb-var-create-regexp nil t)
       (let ((var (list
+		  (match-string 1)
 		  (if (and (string-equal gdb-current-language "c")
 			   gdb-use-colon-colon-notation gdb-selected-frame)
 		      (setq expr (concat gdb-selected-frame "::" expr))
 		    expr)
-		  (match-string 1)
 		  (match-string 2)
 		  (match-string 3)
 		  nil nil)))
@@ -664,10 +711,10 @@
 	 (list
 	  (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
 	      (concat "server interpreter mi \"-var-evaluate-expression "
-		      (nth 1 var) "\"\n")
-	    (concat "-var-evaluate-expression " (nth 1 var) "\n"))
+		      (car var) "\"\n")
+	    (concat "-var-evaluate-expression " (car var) "\n"))
 	  `(lambda () (gdb-var-evaluate-expression-handler
-		       ,(nth 1 var) nil)))))
+		       ,(car var) nil)))))
     (if (search-forward "Undefined command" nil t)
 	(message-box "Watching expressions requires gdb 6.0 onwards")
       (message-box "No symbol \"%s\" in current context." expr))))
@@ -675,12 +722,10 @@
 (defun gdb-var-evaluate-expression-handler (varnum changed)
   (goto-char (point-min))
   (re-search-forward ".*value=\\(\".*\"\\)" nil t)
-  (catch 'var-found
-    (dolist (var gdb-var-list)
-      (when (string-equal varnum (cadr var))
-	(if changed (setcar (nthcdr 5 var) 'changed))
-	(setcar (nthcdr 4 var) (read (match-string 1)))
-	(throw 'var-found nil)))))
+  (let ((var (assoc varnum gdb-var-list)))
+    (when var
+      (if changed (setcar (nthcdr 5 var) 'changed))
+      (setcar (nthcdr 4 var) (read (match-string 1))))))
 
 (defun gdb-var-list-children (varnum)
   (gdb-enqueue-input
@@ -696,26 +741,25 @@
   (let ((var-list nil))
     (catch 'child-already-watched
       (dolist (var gdb-var-list)
-	(if (string-equal varnum (cadr var))
+	(if (string-equal varnum (car var))
 	    (progn
 	      (push var var-list)
 	      (while (re-search-forward gdb-var-list-children-regexp nil t)
-		(let ((varchild (list (match-string 2)
-				      (match-string 1)
+		(let ((varchild (list (match-string 1)
+				      (match-string 2)
 				      (match-string 3)
 				      (match-string 4)
 				      nil nil)))
-		  (dolist (var1 gdb-var-list)
-		    (if (string-equal (cadr var1) (cadr varchild))
-			(throw 'child-already-watched nil)))
+		  (if (assoc (car varchild) gdb-var-list)
+		      (throw 'child-already-watched nil))
 		  (push varchild var-list)
 		  (gdb-enqueue-input
 		   (list
 		    (concat
 		     "server interpreter mi \"-var-evaluate-expression "
-		     (nth 1 varchild) "\"\n")
+		     (car varchild) "\"\n")
 		    `(lambda () (gdb-var-evaluate-expression-handler
-				 ,(nth 1 varchild) nil)))))))
+				 ,(car varchild) nil)))))))
 	  (push var var-list)))
       (setq gdb-var-list (nreverse var-list)))))
 
@@ -735,11 +779,8 @@
   (while (re-search-forward gdb-var-update-regexp nil t)
     (let ((varnum (match-string 1)))
       (if  (string-equal (match-string 2) "false")
-	  (catch 'var-found
-	    (dolist (var gdb-var-list)
-	      (when (string-equal varnum (cadr var))
-		(setcar (nthcdr 5 var) 'out-of-scope)
-		(throw 'var-found nil))))
+	  (let ((var (assoc varnum gdb-var-list)))
+	    (if var (setcar (nthcdr 5 var) 'out-of-scope)))
 	(gdb-enqueue-input
 	 (list
 	  (concat "server interpreter mi \"-var-evaluate-expression "
@@ -757,7 +798,8 @@
   (setq gdb-pending-triggers
 	(delq 'gdb-speedbar-refresh gdb-pending-triggers))
   (with-current-buffer gud-comint-buffer
-    (let ((speedbar-verbosity-level 0))
+    (let ((speedbar-verbosity-level 0)
+	  (speedbar-shown-directories nil))
       (save-excursion
 	(speedbar-refresh)))))
 
@@ -768,10 +810,14 @@
 	    '(gdbmi gdba))
       (let ((text (speedbar-line-text)))
 	(string-match "\\(\\S-+\\)" text)
-	(let* ((expr (match-string 1 text))
-	       (var (assoc expr gdb-var-list))
-	       (varnum (cadr var)))
-	  (unless (string-match "\\." varnum)
+	(let ((expr (match-string 1 text)) var varnum)
+	  (catch 'expr-found
+	    (dolist (var1 gdb-var-list)
+	      (when (string-equal expr (nth 1 var1))
+		(setq var var1)
+		(setq varnum (car var1))
+		(throw 'expr-found nil))))
+	  (unless (string-match "\\." (car var))
 	    (gdb-enqueue-input
 	     (list
 	      (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
@@ -781,13 +827,13 @@
 		   'ignore))
 	    (setq gdb-var-list (delq var gdb-var-list))
 	    (dolist (varchild gdb-var-list)
-	      (if (string-match (concat (nth 1 var) "\\.") (nth 1 varchild))
+	      (if (string-match (concat (car var) "\\.") (car varchild))
 		  (setq gdb-var-list (delq varchild gdb-var-list)))))))))
 
 (defun gdb-edit-value (text token indent)
   "Assign a value to a variable displayed in the speedbar."
   (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list))
-	 (varnum (cadr var)) (value))
+	 (varnum (car var)) (value))
     (setq value (read-string "New value: "))
     (gdb-enqueue-input
      (list
@@ -823,7 +869,7 @@
 	   (gdb-var-list-children-1 token)))
 	((string-match "-" text)	;contract this node
 	 (dolist (var gdb-var-list)
-	   (if (string-match (concat token "\\.") (nth 1 var))
+	   (if (string-match (concat token "\\.") (car var))
 	       (setq gdb-var-list (delq var gdb-var-list))))
 	 (speedbar-change-expand-button-char ?+)
 	 (speedbar-delete-subblock indent))
@@ -1193,6 +1239,8 @@
       (progn
 	(setq gud-running t)
 	(gdb-remove-text-properties)
+	(setq gud-overlay-arrow-position nil)
+	(setq gdb-overlay-arrow-position nil)
 	(if gdb-use-separate-io-buffer
 	    (setq gdb-output-sink 'inferior))))
      (t
@@ -2671,32 +2719,6 @@
   (gdb-set-window-buffer (gdb-breakpoints-buffer-name))
   (other-window 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
-buffer and the other with the source file with the main routine
-of the inferior.  Non-nil means display the layout shown for
-`gdba'."
-  :type 'boolean
-  :group 'gud
-  :version "22.1")
-
-(defun gdb-many-windows (arg)
-  "Toggle the number of windows in the basic arrangement.
-With arg, display additional buffers iff arg is positive."
-  (interactive "P")
-  (setq gdb-many-windows
-	(if (null arg)
-	    (not gdb-many-windows)
-	  (> (prefix-numeric-value arg) 0)))
-  (message (format "Display of other windows %sabled"
-		   (if gdb-many-windows "en" "dis")))
-  (if (and gud-comint-buffer
-	   (buffer-name gud-comint-buffer))
-      (condition-case nil
-	  (gdb-restore-windows)
-	(error nil))))
-
 (defun gdb-restore-windows ()
   "Restore the basic arrangement of windows used by gdba.
 This arrangement depends on the value of `gdb-many-windows'."
@@ -3115,19 +3137,18 @@
   (let ((var-list nil))
     (catch 'child-already-watched
       (dolist (var gdb-var-list)
-	(if (string-equal varnum (cadr var))
+	(if (string-equal varnum (car var))
 	    (progn
 	      (push var var-list)
 	      (while (re-search-forward gdb-var-list-children-regexp-1 nil t)
-		(let ((varchild (list (match-string 2)
-				      (match-string 1)
+		(let ((varchild (list (match-string 1)
+				      (match-string 2)
 				      (match-string 3)
 				      (match-string 5)
 				      (read (match-string 4))
 				      nil)))
-		  (dolist (var1 gdb-var-list)
-		    (if (string-equal (cadr var1) (cadr varchild))
-			(throw 'child-already-watched nil)))
+		  (if (assoc (car varchild) gdb-var-list)
+		      (throw 'child-already-watched nil))
 		  (push varchild var-list))))
 	  (push var var-list)))
       (setq gdb-var-list (nreverse var-list)))))
@@ -3152,16 +3173,14 @@
     (setcar (nthcdr 5 var) nil))
   (goto-char (point-min))
   (while (re-search-forward gdb-var-update-regexp-1 nil t)
-    (let ((varnum (match-string 1)))
-      (catch 'var-found
-	(dolist (var gdb-var-list)
-	  (when (string-equal varnum (cadr var))
-	    (if (string-equal (match-string 3) "false")
-		(setcar (nthcdr 5 var) 'out-of-scope)
-	      (setcar (nthcdr 5 var) 'changed)
-	      (setcar (nthcdr 4 var)
-		      (read (match-string 2))))
-	    (throw 'var-found nil))))))
+    (let* ((varnum (match-string 1))
+	   (var (assoc varnum gdb-var-list)))
+      (when var
+	(if (string-equal (match-string 3) "false")
+	    (setcar (nthcdr 5 var) 'out-of-scope)
+	  (setcar (nthcdr 5 var) 'changed)
+	  (setcar (nthcdr 4 var)
+		  (read (match-string 2)))))))
   (setq gdb-pending-triggers
    (delq 'gdb-var-update gdb-pending-triggers))
   (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame))
@@ -3309,7 +3328,7 @@
 		   (dolist (local locals-list)
 		     (setq name (car local))
 		     (if (or (not (nth 2 local))
-			     (string-match "\\*$" (nth 1 local)))
+			     (string-match "\\0x" (nth 2 local)))
 		       (add-text-properties 0 (length name)
 			    `(mouse-face highlight
 			      help-echo "mouse-2: create watch expression"
--- a/lisp/progmodes/gud.el	Sun Mar 12 05:02:59 2006 +0000
+++ b/lisp/progmodes/gud.el	Wed Mar 15 17:22:12 2006 +0000
@@ -174,7 +174,7 @@
 		  :enable (and (not gud-running)
 			       (memq gud-minor-mode
 				     '(gdbmi gdba gdb dbx xdb jdb pdb bashdb))))
-    ([pp]	menu-item "Print the emacs s-expression" gud-pp
+    ([pp]	menu-item "Print S-expression" gud-pp
                   :enable (and (not gud-running)
 				  gdb-active-process)
 		  :visible (and (string-equal
@@ -234,9 +234,6 @@
 		     (gud-run . "gud/run")
 		     (gud-go . "gud/go")
 		     (gud-stop-subjob . "gud/stop")
-		     ;; gud-s, gud-si etc. instead of gud-step,
-		     ;; gud-stepi, to avoid file-name clashes on DOS
-		     ;; 8+3 filesystems.
 		     (gud-cont . "gud/cont")
 		     (gud-until . "gud/until")
 		     (gud-next . "gud/next")
@@ -455,7 +452,7 @@
 	  (let ((var-list gdb-var-list) parent)
 	    (while var-list
 	      (let* (char (depth 0) (start 0) (var (car var-list))
-			  (expr (car var)) (varnum (nth 1 var))
+			  (varnum (car var)) (expr (nth 1 var))
 			  (type (nth 3 var)) (value (nth 4 var))
 			  (status (nth 5 var)))
 		(put-text-property
@@ -483,9 +480,9 @@
 		       t)
 		     depth)
 		  (if (eq status 'out-of-scope) (setq parent 'shadow))
-		  (if (and (cadr var-list)
+		  (if (and (nth 1 var-list)
 			   (string-match (concat varnum "\\.")
-					 (cadr (cadr var-list))))
+					 (car (nth 1 var-list))))
 		      (setq char ?-)
 		    (setq char ?+))
 		  (if (string-match "\\*$" type)
--- a/lisp/textmodes/org.el	Sun Mar 12 05:02:59 2006 +0000
+++ b/lisp/textmodes/org.el	Wed Mar 15 17:22:12 2006 +0000
@@ -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.08
+;; Version: 4.09
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -81,8 +81,14 @@
 ;;
 ;; Changes since version 4.00:
 ;; ---------------------------
+;; Version 4.09
+;;    - Bug fixes.
+;;    - Small improvements to font-lock support.
+;;    - MHE support finalized.
+;;
 ;; Version 4.08
-;;
+;;    - Bug fixes.
+;;    - Improved MHE support
 ;;
 ;; Version 4.07
 ;;    - Bug fixes.
@@ -139,7 +145,7 @@
 
 ;;; Customization variables
 
-(defvar org-version "4.08"
+(defvar org-version "4.09"
   "The version number of the file org.el.")
 (defun org-version ()
   (interactive)
@@ -796,31 +802,15 @@
   :group 'org-structure
   :type 'hook)
 
-(defcustom org-level-color-stars-only nil
-  "Non-nil means fontify only the stars in each headline.
-When nil, the entire headline is fontified.
-Changing it requires restart of `font-lock-mode' to become effective."
-  :group 'org-structure
-  :type 'boolean)
-
-(defcustom org-hide-leading-stars nil
-  "Non-nil means, hide the first N-1 stars in a headline.
-This works by using the face `org-hide' for these stars.  This
-face is white for a light background, and black for a dark
-background.  You may have to customize the face `org-hide' to
-make this work.
-Changing it requires restart of `font-lock-mode' to become effective."
-  :group 'org-structure
-  :type 'boolean)
-
 (defcustom org-odd-levels-only nil
   "Non-nil means, skip even levels and only use odd levels for the outline.
 This has the effect that two stars are being added/taken away in
 promotion/demotion commands.  It also influences how levels are
 handled by the exporters.
 Changing it requires restart of `font-lock-mode' to become effective
-for fontification." 
+for fontification also in regions already fontified." 
   :group 'org-structure
+  :group 'org-font-lock
   :type 'boolean)
 
 (defcustom org-adapt-indentation t
@@ -1710,11 +1700,44 @@
   :group 'org-export
   :type 'string)
 
-(defgroup org-faces nil
-  "Faces for highlighting in Org-mode."
-  :tag "Org Faces"
+(defgroup org-font-lock nil
+  "Faces and settings for highlighting in Org-mode."
+  :tag "Org Font Lock"
   :group 'org)
 
+(defcustom org-level-color-stars-only nil
+  "Non-nil means fontify only the stars in each headline.
+When nil, the entire headline is fontified.
+Changing it requires restart of `font-lock-mode' to become effective
+also in regions already fontified."
+  :group 'org-font-lock
+  :type 'boolean)
+
+(defcustom org-hide-leading-stars nil
+  "Non-nil means, hide the first N-1 stars in a headline.
+This works by using the face `org-hide' for these stars.  This
+face is white for a light background, and black for a dark
+background.  You may have to customize the face `org-hide' to
+make this work.
+Changing it requires restart of `font-lock-mode' to become effective
+also in regions already fontified."
+  :group 'org-font-lock
+  :type 'boolean)
+
+(defcustom org-fontify-done-headline nil
+  "Non-nil means, change the face of a headline if it is marked DONE.
+Normally, only the TODO/DONE keyword indicates the state of a headline.
+When this is non-nil, the headline after the keyword is set to the
+`org-headline-done' as an additional indication."
+  :group 'org-font-lock
+  :type 'boolean)
+
+(defcustom org-fontify-emphasized-text t
+  "Non-nil means fontify *bold*, /italic/ and _underlined_ text.
+Changing this variable requires a restart of Emacs to take effect."
+  :group 'org-font-lock
+  :type 'boolean)
+
 (defface org-hide
   '((((type tty) (class color)) (:foreground "blue" :weight bold))
     (((class color) (background light)) (:foreground "white"))
@@ -1723,7 +1746,7 @@
 ;    (((class color) (background dark)) (:foreground "grey10"))
     (t (:inverse-video nil)))
   "Face used for level 1 headlines."
-  :group 'org-faces)
+  :group 'org-font-lock)
 
 (defface org-level-1 ;; font-lock-function-name-face
   '((((type tty) (class color)) (:foreground "blue" :weight bold))
@@ -1731,7 +1754,7 @@
     (((class color) (background dark)) (:foreground "LightSkyBlue"))
     (t (:inverse-video t :bold t)))
   "Face used for level 1 headlines."
-  :group 'org-faces)
+  :group 'org-font-lock)
 
 (defface org-level-2 ;; font-lock-variable-name-face
   '((((type tty) (class color)) (:foreground "yellow" :weight light))
@@ -1739,7 +1762,7 @@
     (((class color) (background dark)) (:foreground "LightGoldenrod"))
     (t (:bold t :italic t)))
   "Face used for level 2 headlines."
-  :group 'org-faces)
+  :group 'org-font-lock)
 
 (defface org-level-3 ;; font-lock-keyword-face
   '((((type tty) (class color)) (:foreground "cyan" :weight bold))
@@ -1747,7 +1770,7 @@
     (((class color) (background dark)) (:foreground "Cyan"))
     (t (:bold t)))
   "Face used for level 3 headlines."
-  :group 'org-faces)
+  :group 'org-font-lock)
 
 (defface org-level-4   ;; font-lock-comment-face
   '((((type tty pc) (class color) (background light)) (:foreground "red"))
@@ -1756,7 +1779,7 @@
     (((class color) (background dark)) (:foreground "chocolate1"))
     (t (:bold t :italic t)))
   "Face used for level 4 headlines."
-  :group 'org-faces)
+  :group 'org-font-lock)
 
 (defface org-level-5 ;; font-lock-type-face
   '((((type tty) (class color)) (:foreground "green"))
@@ -1764,7 +1787,7 @@
     (((class color) (background dark)) (:foreground "PaleGreen"))
     (t (:bold t :underline t)))
   "Face used for level 5 headlines."
-  :group 'org-faces)
+  :group 'org-font-lock)
 
 (defface org-level-6 ;; font-lock-constant-face
   '((((type tty) (class color)) (:foreground "magenta"))
@@ -1772,7 +1795,7 @@
     (((class color) (background dark)) (:foreground "Aquamarine"))
     (t (:bold t :underline t)))
   "Face used for level 6 headlines."
-  :group 'org-faces)
+  :group 'org-font-lock)
 
 (defface org-level-7 ;; font-lock-builtin-face
   '((((type tty) (class color)) (:foreground "blue" :weight light))
@@ -1780,7 +1803,7 @@
     (((class color) (background dark)) (:foreground "LightSteelBlue"))
     (t (:bold t)))
   "Face used for level 7 headlines."
-  :group 'org-faces)
+  :group 'org-font-lock)
 
 (defface org-level-8 ;; font-lock-string-face
   '((((type tty) (class color)) (:foreground "green"))
@@ -1788,7 +1811,7 @@
     (((class color) (background dark)) (:foreground "LightSalmon"))
     (t (:italic t)))
   "Face used for level 8 headlines."
-  :group 'org-faces)
+  :group 'org-font-lock)
 
 (defface org-special-keyword ;; font-lock-string-face
   '((((type tty) (class color)) (:foreground "green"))
@@ -1796,7 +1819,7 @@
     (((class color) (background dark)) (:foreground "LightSalmon"))
     (t (:italic t)))
   "Face used for special keywords."
-  :group 'org-faces)
+  :group 'org-font-lock)
 
 (defface org-warning ;; font-lock-warning-face
   '((((type tty) (class color)) (:foreground "red"))
@@ -1805,15 +1828,7 @@
 ;    (((class color) (background dark)) (:foreground "Pink" :bold t))
     (t (:inverse-video t :bold t)))
   "Face for deadlines and TODO keywords."
-  :group 'org-faces)
-
-(defcustom org-fontify-done-headline nil
-  "Non-nil means, change the face of a headline if it is marked DONE.
-Normally, only the TODO/DONE keyword indicates the state of a headline.
-When this is non-nil, the headline after the keyword is set to the
-`org-headline-done' as an additional indication."
-  :group 'org-faces
-  :type 'boolean)
+  :group 'org-font-lock)
 
 (defface org-headline-done ;; font-lock-string-face
   '((((type tty) (class color)) (:foreground "green"))
@@ -1822,7 +1837,7 @@
     (t (:italic t)))
   "Face used to indicate that a headline is DONE.  See also the variable
 `org-fontify-done-headline'."
-  :group 'org-faces)
+  :group 'org-font-lock)
 
 ;; Inheritance does not yet work for xemacs. So we just copy...
 
@@ -1832,7 +1847,7 @@
     (((class color) (background dark)) (:foreground "LightSkyBlue"))
     (t (:inverse-video t :bold t)))
   "Face for upcoming deadlines."
-  :group 'org-faces)
+  :group 'org-font-lock)
 
 (defface org-scheduled-today
   '((((type tty) (class color)) (:foreground "green"))
@@ -1840,7 +1855,7 @@
     (((class color) (background dark)) (:foreground "PaleGreen"))
     (t (:bold t :underline t)))
   "Face for items scheduled for a certain day."
-  :group 'org-faces)
+  :group 'org-font-lock)
 
 (defface org-scheduled-previously
   '((((type tty pc) (class color) (background light)) (:foreground "red"))
@@ -1849,7 +1864,7 @@
     (((class color) (background dark)) (:foreground "chocolate1"))
     (t (:bold t :italic t)))
   "Face for items scheduled previously, and not yet done."
-  :group 'org-faces)
+  :group 'org-font-lock)
 
 (defface org-formula
   '((((type tty pc) (class color) (background light)) (:foreground "red"))
@@ -1858,7 +1873,7 @@
     (((class color) (background dark)) (:foreground "chocolate1"))
     (t (:bold t :italic t)))
   "Face for formulas."
-  :group 'org-faces)
+  :group 'org-font-lock)
 
 (defface org-link
   '((((type tty) (class color)) (:foreground "cyan" :weight bold))
@@ -1866,15 +1881,15 @@
     (((class color) (background dark)) (:foreground "Cyan"))
     (t (:bold t)))
   "Face for links."
-  :group 'org-faces)
+  :group 'org-font-lock)
 
 (defface org-tag
   '((((type tty) (class color)) (:foreground "cyan" :weight bold))
     (((class color) (background light)) (:foreground "Purple" :weight bold))
     (((class color) (background dark)) (:foreground "Cyan" :weight bold))
     (t (:bold t)))
-  "Face for links."
-  :group 'org-faces)
+  "Face for tags."
+  :group 'org-font-lock)
 
 (defface org-done ;; font-lock-type-face
   '((((type tty) (class color)) (:foreground "green"))
@@ -1882,7 +1897,7 @@
     (((class color) (background dark)) (:foreground "PaleGreen" :bold t))
     (t (:bold t :underline t)))
   "Face used for DONE."
-  :group 'org-faces)
+  :group 'org-font-lock)
 
 (defface org-table ;; font-lock-function-name-face
   '((((type tty) (class color)) (:foreground "blue" :weight bold))
@@ -1890,7 +1905,7 @@
     (((class color) (background dark)) (:foreground "LightSkyBlue"))
     (t (:inverse-video t :bold t)))
   "Face used for tables."
-  :group 'org-faces)
+  :group 'org-font-lock)
 
 (defface org-time-grid ;; font-lock-variable-name-face
   '((((type tty) (class color)) (:foreground "yellow" :weight light))
@@ -1898,7 +1913,7 @@
     (((class color) (background dark)) (:foreground "LightGoldenrod"))
     (t (:bold t :italic t)))
   "Face used for time grids."
-  :group 'org-faces)
+  :group 'org-font-lock)
 
 (defvar org-level-faces
   '(org-level-1 org-level-2 org-level-3 org-level-4
@@ -1939,6 +1954,10 @@
 		    (set '(("fold" org-startup-folded t)
 			   ("nofold" 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)
 			   ("dlcheck" org-startup-with-deadline-check t)
 			   ("nodlcheck" org-startup-with-deadline-check nil)))
 		    l var val)
@@ -2307,44 +2326,45 @@
 (defvar org-font-lock-keywords nil)
 
 (defun org-set-font-lock-defaults ()
-  (let ((org-font-lock-extra-keywords
-	 (list
-	  '("^\\(\\**\\)\\(\\*\\)\\(.*\\)" (1 (org-get-level-face 1))
-	    (2 (org-get-level-face 2)) (3 (org-get-level-face 3)))
-	  '(org-activate-links (0 'org-link t))
-	  '(org-activate-links2 (0 'org-link t))
-	  '(org-activate-target-links (0 'org-link t))
-	  '(org-activate-dates (0 'org-link t))
-	  '(org-activate-camels (0 'org-link t))
-	  '(org-activate-tags (1 'org-tag t))
-	  (list (concat "^\\*+[ \t]*" org-not-done-regexp)
-		'(1 'org-warning t))
-	  (list (concat "\\[#[A-Z]\\]") '(0 'org-special-keyword t))
-	  (list (concat "\\<" org-deadline-string) '(0 'org-special-keyword t))
-	  (list (concat "\\<" org-scheduled-string) '(0 'org-special-keyword t))
-	  (list (concat "\\<" org-closed-string) '(0 'org-special-keyword t))
-	  ;; '("\\(\\s-\\|^\\)\\(\\*\\([a-zA-Z]+\\)\\*\\)\\([^a-zA-Z*]\\|$\\)"
-	  ;; (3 'bold))
-	  ;; '("\\(\\s-\\|^\\)\\(/\\([a-zA-Z]+\\)/\\)\\([^a-zA-Z*]\\|$\\)"
-	  ;; (3 'italic))
-	  ;; '("\\(\\s-\\|^\\)\\(_\\([a-zA-Z]+\\)_\\)\\([^a-zA-Z*]\\|$\\)"
-	  ;; (3 'underline))
-	  (list (concat "^\\*+[ \t]*\\<\\(" org-comment-string
-			"\\|" org-quote-string "\\)\\>")
-		'(1 'org-special-keyword t))
-	  '("^#.*" (0 'font-lock-comment-face t))
-	  (if org-fontify-done-headline
-	      (list (concat "^[*]+ +\\<\\(" org-done-string "\\)\\(.*\\)\\>")
-		    '(1 'org-done t) '(2 'org-headline-done t))
-	    (list (concat "^[*]+ +\\<\\(" org-done-string "\\)\\>")
-		  '(1 'org-done t)))
-	  '("^[ \t]*\\(\\(|\\|\\+-[-+]\\).*\\S-\\)"
-	    (1 'org-table t))
-	  '("^[ \t]*\\(:.*\\)" (1 'org-table t))
-	  '("| *\\(:?=[^|\n]*\\)" (1 'org-formula t))
-	  '("^[ \t]*| *\\([#!$*_^]\\) *|" (1 'org-formula t))
-	  )))
-
+  (let* ((em org-fontify-emphasized-text)
+	 (org-font-lock-extra-keywords
+	  (list
+	   '("^\\(\\**\\)\\(\\*\\)\\(.*\\)" (1 (org-get-level-face 1))
+	     (2 (org-get-level-face 2)) (3 (org-get-level-face 3)))
+	   '(org-activate-links (0 'org-link t))
+	   '(org-activate-links2 (0 'org-link t))
+	   '(org-activate-target-links (0 'org-link t))
+	   '(org-activate-dates (0 'org-link t))
+	   '(org-activate-camels (0 'org-link t))
+	   '(org-activate-tags (1 'org-tag t))
+	   (list (concat "^\\*+[ \t]*" org-not-done-regexp)
+		 '(1 'org-warning t))
+	   (list (concat "\\[#[A-Z]\\]") '(0 'org-special-keyword t))
+	   (list (concat "\\<" org-deadline-string) '(0 'org-special-keyword t))
+	   (list (concat "\\<" org-scheduled-string) '(0 'org-special-keyword t))
+	   (list (concat "\\<" org-closed-string) '(0 'org-special-keyword t))
+;	   (if em '("\\(\\s-\\|^\\)\\(\\*\\([a-zA-Z]+\\)\\*\\)\\([^a-zA-Z*]\\|$\\)" (3 'bold)))
+;	   (if em '("\\(\\s-\\|^\\)\\(/\\([a-zA-Z]+\\)/\\)\\([^a-zA-Z*]\\|$\\)" (3 'italic)))
+;	   (if em '("\\(\\s-\\|^\\)\\(_\\([a-zA-Z]+\\)_\\)\\([^a-zA-Z*]\\|$\\)" (3 'underline)))
+	   (if em '("\\*[a-zA-Z]+\\*" 0 'bold))
+	   (if em '("/*[a-zA-Z]+/" 0 'italic))
+	   (if em '("_[a-zA-Z]+_" 0 'underline))
+	   (list (concat "^\\*+[ \t]*\\<\\(" org-comment-string
+			 "\\|" org-quote-string "\\)\\>")
+		 '(1 'org-special-keyword t))
+	   '("^#.*" (0 'font-lock-comment-face t))
+	   (if org-fontify-done-headline
+	       (list (concat "^[*]+ +\\<\\(" org-done-string "\\)\\(.*\\)\\>")
+		     '(1 'org-done t) '(2 'org-headline-done t))
+	     (list (concat "^[*]+ +\\<\\(" org-done-string "\\)\\>")
+		   '(1 'org-done t)))
+	   '("^[ \t]*\\(\\(|\\|\\+-[-+]\\).*\\S-\\)"
+	     (1 'org-table t))
+	   '("^[ \t]*\\(:.*\\)" (1 'org-table t))
+	   '("| *\\(:?=[^|\n]*\\)" (1 'org-formula t))
+	   '("^[ \t]*| *\\([#!$*_^]\\) *|" (1 'org-formula t))
+	   )))
+    (setq org-font-lock-extra-keywords (delq nil org-font-lock-extra-keywords))
     ;; Now set the full font-lock-keywords
     (set (make-local-variable 'org-font-lock-keywords)
 	 org-font-lock-extra-keywords)
@@ -6960,7 +6980,7 @@
 	(s0 (mapconcat 'identity (org-split-string s "[ \t\r\n]+") " "))
 	(pos (point))
 	(pre "") (post "")
-	words re0 re1 re2 re3 re4 re5 reall camel)
+	words re0 re1 re2 re3 re4 re5 re2a reall camel)
     (cond ((save-excursion
 	     (goto-char (point-min))
 	     (and
@@ -6995,11 +7015,13 @@
 		   (org-split-string s "[ \n\r\t]+"))
 		 re0 (concat "<<" (regexp-quote s0) ">>")
 		 re2 (concat "\\<" (mapconcat 'downcase words "[ \t]+") "\\>")
+		 re2a (concat "\\<" (mapconcat 'downcase words "[ \t\r\n]+") "\\>")
 		 re4 (concat "\\<" (mapconcat 'downcase words "[^a-zA-Z_\r\n]+") "\\>")
 		 re1 (concat pre re2 post)
 		 re3 (concat pre re4 post)
 		 re5 (concat pre ".*" re4)
 		 re2 (concat pre re2)
+		 re2a (concat pre re2a)
 		 re4 (concat pre re4)
 		 reall (concat "\\(" re0 "\\)\\|\\(" re1 "\\)\\|\\(" re2
 			       "\\)\\|\\(" re3 "\\)\\|\\(" re4 "\\)\\|\\("
@@ -7009,12 +7031,14 @@
 	    ((eq type 'org-occur) (org-occur reall))
 	    ((eq type 'occur) (org-do-occur (downcase reall) 'cleanup))
 	    (t (goto-char (point-min))
-	       (if (or (re-search-forward re0 nil t)
-		       (re-search-forward re1 nil t)
-		       (re-search-forward re2 nil t)
-		       (re-search-forward re3 nil t)
-		       (re-search-forward re4 nil t)
-		       (re-search-forward re5 nil t))
+	       (if (or (org-search-not-link re0 nil t)
+		       (org-search-not-link re1 nil t)
+		       (org-search-not-link re2 nil t)
+		       (org-search-not-link re2a nil t) ;; FIXME: Right place???
+		       (org-search-not-link re3 nil t)
+		       (org-search-not-link re4 nil t)
+		       (org-search-not-link re5 nil t)
+		       )
 		   (goto-char (match-beginning 0))
 		 (goto-char pos)
 		 (error "No match")))))
@@ -7026,6 +7050,21 @@
 	     (error "No match"))))
     (and (eq major-mode 'org-mode) (org-show-hierarchy-above))))
 
+(defun org-search-not-link (&rest args)
+  "Execute `re-search-forward', but only accept matches that are not a link."
+  (catch 'exit
+    (let ((pos (point)) p1)
+      (while (apply 're-search-forward args)
+	(setq p1 (point))
+	(if (not (save-match-data
+		   (and (re-search-backward "\\[\\[" nil t)
+			(looking-at org-bracket-link-regexp)
+			(<= (match-beginning 0) p1)
+			(>= (match-end 0) p1))))
+	    (progn (goto-char (match-end 0))
+		   (throw 'exit (point)))
+	  (goto-char (match-end 0)))))))
+
 (defun org-do-occur (regexp &optional cleanup)
   "Call the Emacs command `occur'.
 If CLEANUP is non-nil, remove the printout of the regular expression
@@ -7284,24 +7323,32 @@
     header-field)))
 
 (defun org-follow-mhe-link (folder article)
-  "Follow an MHE link to FOLDER and ARTICLE."
-  (setq article (org-add-angle-brackets article))
+  "Follow an MHE link to FOLDER and ARTICLE.
+If ARTICLE is nil FOLDER is shown.  If the configuration variable
+`org-mhe-search-all-folders' is t and `mh-searcher' is pick,
+ARTICLE is searched in all folders.  Indexed searches (swish++,
+namazu, and others supported by MH-E) will always search in all
+folders."
   (require 'mh-e)
   (require 'mh-search)
+  (require 'mh-utils)
   (mh-find-path)
-  (mh-search-choose)
-  (if (equal mh-searcher 'pick)
-      (progn
-        (mh-search folder (list "--message-id" article))
-        (when (and org-mhe-search-all-folders
-                 (not (org-mhe-get-message-real-folder)))
-          (kill-this-buffer)
-          (mh-search "+" (list "--message-id" article))))
-    (mh-search "+" article))
-  (if (org-mhe-get-message-real-folder)
-      (mh-show-msg 1)
-    (kill-this-buffer)
-    (error "Message not found")))
+  (if (not article)
+      (mh-visit-folder (mh-normalize-folder-name folder))
+    (setq article (org-add-angle-brackets article))
+    (mh-search-choose)
+    (if (equal mh-searcher 'pick)
+        (progn
+          (mh-search folder (list "--message-id" article))
+          (when (and org-mhe-search-all-folders
+                     (not (org-mhe-get-message-real-folder)))
+            (kill-this-buffer)
+            (mh-search "+" (list "--message-id" article))))
+      (mh-search "+" article))
+    (if (org-mhe-get-message-real-folder)
+        (mh-show-msg 1)
+      (kill-this-buffer)
+      (error "Message not found"))))
 
 (defun org-open-file (path &optional in-emacs line search)
   "Open the file at PATH.
@@ -10563,7 +10610,7 @@
 This will leave level 1 alone, convert level 2 to level 3, level 3 to
 level 5 etc."
   (interactive)
-  (when (yes-or-no-p "Are you sure you want to globally change levels? ")
+  (when (yes-or-no-p "Are you sure you want to globally change levels to odd? ")
     (let ((org-odd-levels-only nil) n)
       (save-excursion
 	(goto-char (point-min))
@@ -10573,6 +10620,28 @@
 	    (org-demote))
 	  (end-of-line 1))))))
 
+
+(defun org-convert-to-oddeven-levels ()
+  "Convert an org-mode file with only odd levels to one with odd and even levels.
+This promotes level 3 to level 2, level 5 to level 3 etc.  If the file contains a
+section with an even level, conversion would destroy the structure of the file.  An error
+is signaled in this case."
+  (interactive)
+  (goto-char (point-min))
+  ;; First check if there are no even levels
+  (when (re-search-forward "^\\(\\*\\*\\)+[^*]" nil t)
+    (org-show-hierarchy-above)
+    (error "Not all levels are odd in this file.  Conversion not possible."))
+  (when (yes-or-no-p "Are you sure you want to globally change levels to odd-even? ")
+    (let ((org-odd-levels-only nil) n)
+      (save-excursion
+	(goto-char (point-min))
+	(while (re-search-forward "^\\*\\*+" nil t)
+	  (setq n (/ (length (match-string 0)) 2))
+	  (while (>= (setq n (1- n)) 0)
+	    (org-promote))
+	  (end-of-line 1))))))
+
 (defun org-tr-level (n)
   "Make N odd if required."
   (if org-odd-levels-only (1+ (/ n 2)) n))
@@ -10817,7 +10886,7 @@
 #+CATEGORY:  %s
 #+SEQ_TODO:  %s
 #+TYP_TODO:  %s
-#+STARTUP:   %s %s
+#+STARTUP:   %s %s %s %s
 #+ARCHIVE:   %s
 "
    (buffer-name) (user-full-name) user-mail-address org-export-default-language
@@ -10841,6 +10910,8 @@
    (cdr (assoc org-startup-folded
 	       '((nil . "nofold")(t . "fold")(content . "content"))))
    (if org-startup-with-deadline-check "dlcheck" "nodlcheck")
+   (if org-odd-levels-only "odd" "oddeven")
+   (if org-hide-leading-stars "hidestars" "showstars")
    org-archive-location
    ))
 
@@ -10924,6 +10995,7 @@
   (setq-default org-deadline-line-regexp org-deadline-line-regexp)
   (setq-default org-done-string org-done-string)
   (let* ((style org-export-html-style)
+	 (odd org-odd-levels-only)
 	 (region-p (org-region-active-p))
          (region
           (buffer-substring
@@ -10987,7 +11059,8 @@
       (switch-to-buffer-other-window buffer))
     (erase-buffer)
     (fundamental-mode)
-    (let ((case-fold-search nil))
+    (let ((case-fold-search nil)
+	  (org-odd-levels-only odd))
       (if options (org-parse-export-options options))
       (setq umax (if arg (prefix-numeric-value arg)
                    org-export-headline-levels))
@@ -12372,7 +12445,8 @@
      "--"
      ["Archive Subtree" org-archive-subtree t]
      "--"
-     ["Convert file to odd levels" org-convert-to-odd-levels t])
+     ["Convert to odd levels" org-convert-to-odd-levels t]
+     ["Convert to odd/even levels" org-convert-to-oddeven-levels t])
     "--"
     ("TODO Lists"
      ["TODO/DONE/-" org-todo t]
@@ -12851,3 +12925,4 @@
 
 ;; arch-tag: e77da1a7-acc7-4336-b19e-efa25af3f9fd
 ;;; org.el ends here
+
--- a/lisp/tree-widget.el	Sun Mar 12 05:02:59 2006 +0000
+++ b/lisp/tree-widget.el	Wed Mar 15 17:22:12 2006 +0000
@@ -140,10 +140,9 @@
                  data-directory)))
       (and dir (list dir (expand-file-name "images" dir))))
     )
-  "List of locations where to search for the themes sub-directory.
-Each element is an expression that will be evaluated to return a
-single directory or a list of directories to search.
-
+  "List of locations in which to search for the themes sub-directory.
+Each element is an expression that will be recursively evaluated until
+it returns a single directory or a list of directories.
 The default is to search in the `load-path' first, then in the
 \"images\" sub directory in the data directory, then in the data
 directory.
@@ -152,22 +151,22 @@
 XEmacs.")
 
 (defcustom tree-widget-themes-directory "tree-widget"
-  "*Name of the directory where to look up for image themes.
+  "*Name of the directory in which to look for an image theme.
 When nil use the directory where the tree-widget library is located.
-When a relative name is specified, try to locate that sub directory in
-the locations specified in `tree-widget-themes-load-path'.
+When it is a relative name, search in all occurrences of that sub
+directory in the path specified by `tree-widget-themes-load-path'.
 The default is to use the \"tree-widget\" relative name."
   :type '(choice (const :tag "Default" "tree-widget")
-                 (const :tag "With the library" nil)
+                 (const :tag "Where is this library" nil)
                  (directory :format "%{%t%}:\n%v"))
   :group 'tree-widget)
 
 (defcustom tree-widget-theme nil
-  "*Name of the theme where to look up for images.
-It must be a sub directory of the directory specified in variable
-`tree-widget-themes-directory'.  The default theme is \"default\".
-When an image is not found in a theme, it is searched in the default
-theme.
+  "*Name of the theme in which to look for images.
+This is a sub directory of the themes directory specified by the
+`tree-widget-themes-directory' option.
+The default theme is \"default\".  When an image is not found in a
+theme, it is searched in its parent theme.
 
 A complete theme must at least contain images with these file names
 with a supported extension (see also `tree-widget-image-formats'):
@@ -275,10 +274,15 @@
   (unless (member name (aref tree-widget--theme 0))
     (aset tree-widget--theme 0
           (append (aref tree-widget--theme 0) (list name)))
-    ;; Load the theme setup
-    (let ((default-directory (tree-widget-themes-directory)))
-      (when default-directory
-        (load (expand-file-name "tree-widget-theme-setup" name) t)))))
+    ;; Load the theme setup from the first directory where the theme
+    ;; is found.
+    (catch 'found
+      (dolist (dir (tree-widget-themes-path))
+        (setq dir (expand-file-name name dir))
+        (when (file-accessible-directory-p dir)
+          (throw 'found
+                 (load (expand-file-name
+                        "tree-widget-theme-setup" dir) t)))))))
 
 (defun tree-widget-set-theme (&optional name)
   "In the current buffer, set the theme to use for images.
@@ -304,54 +308,62 @@
       (tree-widget-set-parent-theme name)
       (tree-widget-set-parent-theme "default")))
 
-(defun tree-widget--locate-sub-directory (name path)
-  "Locate the sub-directory NAME in PATH.
-Return the absolute name of the directory found, or nil if not found."
-  (let (dir elt)
-    (while (and (not dir) (consp path))
-      (setq elt  (condition-case nil (eval (car path)) (error nil))
-            path (cdr path))
-      (cond
-       ((stringp elt)
-        (setq dir (expand-file-name name elt))
-        (or (file-accessible-directory-p dir)
-            (setq dir nil)))
-       ((and elt (not (equal elt (car path))))
-        (setq dir (tree-widget--locate-sub-directory name elt)))))
-    dir))
+(defun tree-widget--locate-sub-directory (name path &optional found)
+  "Locate all occurrences of the sub-directory NAME in PATH.
+Return a list of absolute directory names in reverse order, or nil if
+not found."
+  (condition-case err
+      (dolist (elt path)
+        (setq elt (eval elt))
+        (cond
+         ((stringp elt)
+          (and (file-accessible-directory-p
+                (setq elt (expand-file-name name elt)))
+               (push elt found)))
+         (elt
+          (setq found (tree-widget--locate-sub-directory
+                       name (if (atom elt) (list elt) elt) found)))))
+    (error
+     (message "In tree-widget--locate-sub-directory: %s"
+              (error-message-string err))))
+  found)
 
-(defun tree-widget-themes-directory ()
-  "Locate the directory where to search for a theme.
-It is defined in variable `tree-widget-themes-directory'.
-Return the absolute name of the directory found, or nil if the
-specified directory is not accessible."
-  (let ((found (aref tree-widget--theme 1)))
+(defun tree-widget-themes-path ()
+  "Return the path where to search for a theme.
+It is specified in variable `tree-widget-themes-directory'.
+Return a list of absolute directory names, or nil when no directory
+has been found accessible."
+  (let ((path (aref tree-widget--theme 1)))
     (cond
-     ;; The directory was not found.
-     ((eq found 'void)
-      (setq found nil))
-     ;; The directory is available in the cache.
-     (found)
+     ;; No directory was found.
+     ((eq path 'void) nil)
+     ;; The list of directories is available in the cache.
+     (path)
      ;; Use the directory where this library is located.
      ((null tree-widget-themes-directory)
-      (setq found (locate-library "tree-widget"))
-      (when found
-        (setq found (file-name-directory found))
-        (or (file-accessible-directory-p found)
-            (setq found nil))))
+      (when (setq path (locate-library "tree-widget"))
+        (setq path (file-name-directory path))
+        (setq path (and (file-accessible-directory-p path)
+                        (list path)))
+        ;; Store the result in the cache for later use.
+        (aset tree-widget--theme 1 (or path 'void))
+        path))
      ;; Check accessibility of absolute directory name.
      ((file-name-absolute-p tree-widget-themes-directory)
-      (setq found (expand-file-name tree-widget-themes-directory))
-      (or (file-accessible-directory-p found)
-          (setq found nil)))
+      (setq path (expand-file-name tree-widget-themes-directory))
+      (setq path (and (file-accessible-directory-p path)
+                      (list path)))
+      ;; Store the result in the cache for later use.
+      (aset tree-widget--theme 1 (or path 'void))
+      path)
      ;; Locate a sub-directory in `tree-widget-themes-load-path'.
      (t
-      (setq found (tree-widget--locate-sub-directory
-                   tree-widget-themes-directory
-                   tree-widget-themes-load-path))))
-    ;; Store the result in the cache for later use.
-    (aset tree-widget--theme 1 (or found 'void))
-    found))
+      (setq path (nreverse (tree-widget--locate-sub-directory
+                            tree-widget-themes-directory
+                            tree-widget-themes-load-path)))
+      ;; Store the result in the cache for later use.
+      (aset tree-widget--theme 1 (or path 'void))
+      path))))
 
 (defconst tree-widget--cursors
   ;; Pointer shapes when the mouse pointer is over inactive
@@ -391,20 +403,19 @@
 function `tree-widget-set-parent-theme').
 Return the first image found having a supported format, or nil if not
 found."
-  (let ((default-directory (tree-widget-themes-directory)) file)
-    (when default-directory
-      (catch 'found
-        (dolist (dir (aref tree-widget--theme 0))
-          (dolist (fmt (tree-widget-image-formats))
-            (dolist (ext (cdr fmt))
-              (setq file (expand-file-name (concat name ext) dir))
-              (and (file-readable-p file)
-                   (file-regular-p file)
-                   (throw 'found
-                          (tree-widget-create-image
-                           (car fmt) file
-                           (tree-widget-image-properties name)))))))
-        nil))))
+  (catch 'found
+    (dolist (default-directory (tree-widget-themes-path))
+      (dolist (dir (aref tree-widget--theme 0))
+        (dolist (fmt (tree-widget-image-formats))
+          (dolist (ext (cdr fmt))
+            (setq file (expand-file-name (concat name ext) dir))
+            (and (file-readable-p file)
+                 (file-regular-p file)
+                 (throw 'found
+                        (tree-widget-create-image
+                         (car fmt) file
+                         (tree-widget-image-properties name))))))))
+    nil))
 
 (defun tree-widget-find-image (name)
   "Find the image with NAME in current theme.
--- a/lispref/ChangeLog	Sun Mar 12 05:02:59 2006 +0000
+++ b/lispref/ChangeLog	Wed Mar 15 17:22:12 2006 +0000
@@ -1,3 +1,21 @@
+2006-03-14  Bill Wohler  <wohler@newt.com>
+
+	* display.texi (Defining Images): In image-load-path-for-library,
+	always return list of directories.  Update example.
+
+2006-03-14  Alan Mackenzie  <acm@muc.de>
+
+	* modes.texi: New node, "Region to Fontify" (for Font Lock).
+	This describes font-lock-extend-region-function.
+	("Other Font Lock Variables"): move "font-lock-lines-before" to
+	the new node "Region to Fontify".
+
+2006-03-13  Richard Stallman  <rms@gnu.org>
+
+	* display.texi (Invisible Text): The impossible position is
+	now before the invisible text, not after.
+	(Defining Images): Clean up last change.
+
 2006-03-11  Bill Wohler  <wohler@newt.com>
 
 	* display.texi (Defining Images): Add image-load-path-for-library.
--- a/lispref/display.texi	Sun Mar 12 05:02:59 2006 +0000
+++ b/lispref/display.texi	Wed Mar 15 17:22:12 2006 +0000
@@ -800,15 +800,15 @@
 @code{line-move-ignore-invisible} is non-@code{nil} (the default), but
 only because they are explicitly programmed to do so.
 
-  However, if a command ends with point inside or immediately after
+  However, if a command ends with point inside or immediately before
 invisible text, the main editing loop moves point further forward or
 further backward (in the same direction that the command already moved
 it) until that condition is no longer true.  Thus, if the command
 moved point back into an invisible range, Emacs moves point back to
-the beginning of that range, following the previous visible character.
-If the command moved point forward into an invisible range, Emacs
-moves point forward past the first visible character that follows the
-invisible text.
+the beginning of that range, and then back one more character.  If the
+command moved point forward into an invisible range, Emacs moves point
+forward up to the first visible character that follows the invisible
+text.
 
   Incremental search can make invisible overlays visible temporarily
 and/or permanently when a match includes invisible text.  To enable
@@ -4127,30 +4127,32 @@
 
 @defun image-load-path-for-library library image &optional path no-error
 @tindex image-load-path-for-library
-Return a suitable search path for images relative to @var{library}.
-
-Images for @var{library} are searched for in @file{../../etc/images}
-and @file{../etc/images} relative to the files in
-@file{lisp/@var{library}} as well as in @code{image-load-path} and
-@var{load-path}.
-
-This function returns the value of @code{load-path} augmented with the
-directory containing @var{image}. If @var{path} is given, it is used
-instead of @code{load-path}. If @code{path} is @code{t}, just return
-the directory that contains @var{image}.
-
-If @var{no-error} is non-nil, this function returns @code{nil} if a
-suitable path can't be found rather than signaling an error.
+This function returns a suitable search path for images relative to
+@var{library}.
+
+First it searches for @var{image} in a path suitable for
+@var{library}, which includes @file{../../etc/images} and
+@file{../etc/images} relative to the library file itself, followed by
+@code{image-load-path} and @code{load-path}.
+
+Then this function returns a list of directories which contains first
+the directory in which @var{image} was found, followed by the value of
+@code{load-path}.  If @var{path} is given, it is used instead of
+@code{load-path}.
+
+If @var{no-error} is non-@code{nil} and a suitable path can't be
+found, don't signal an error.  Instead, return a list of directories as
+before, except that @code{nil} appears in place of the image directory.
 
 Here is an example that uses a common idiom to provide compatibility
 with versions of Emacs that lack the variable @code{image-load-path}:
 
 @example
-(let ((load-path
-       (image-load-path-for-library "mh-e" "mh-logo.xpm"))
-      (image-load-path
-       (image-load-path-for-library "mh-e" "mh-logo.xpm"
-                                    'image-load-path)))
+;; Avoid errors on Emacsen without `image-load-path'.
+(if (not (boundp 'image-load-path)) (defvar image-load-path nil))
+
+(let* ((load-path (image-load-path-for-library "mh-e" "mh-logo.xpm"))
+       (image-load-path (cons (car load-path) image-load-path)))
   (mh-tool-bar-folder-buttons-init))
 @end example
 @end defun
--- a/lispref/modes.texi	Sun Mar 12 05:02:59 2006 +0000
+++ b/lispref/modes.texi	Wed Mar 15 17:22:12 2006 +0000
@@ -2337,6 +2337,8 @@
 * Font Lock Basics::            Overview of customizing Font Lock.
 * Search-based Fontification::  Fontification based on regexps.
 * Customizing Keywords::        Customizing search-based fontification.
+* Region to Fontify::           Controlling which region gets refontified
+                                  after a buffer change.
 * Other Font Lock Variables::   Additional customization facilities.
 * Levels of Font Lock::         Each mode can define alternative levels
                                   so that the user can select more or less.
@@ -2717,6 +2719,46 @@
       font-lock-keyword-face)))))
 @end smallexample
 
+@node Region to Fontify
+@subsection Region to Fontify after a Buffer Change
+
+  When a buffer is changed, the region that Font Lock refontifies is by
+default the smallest sequence of whole lines that spans the change.
+While this works well most of the time, sometimes it doesn't---for
+example, when a buffer change has changed the syntactic meaning of text
+on an earlier line.
+
+You can enlarge (or even reduce) the region to fontify by setting either
+of the following variables:
+
+@defvar font-lock-lines-before
+This variable specifies the number of extra lines to consider when
+refontifying the buffer after each text change.  Font lock begins
+refontifying from that number of lines before the changed region.  The
+default is 0, but using a larger value can be useful for coping with
+multi-line patterns.  This variable is ignored whenever
+@code{font-lock-extend-region-function} is set and returns a
+non-@code{nil} value.
+@end defvar
+
+@defvar font-lock-extend-region-function
+This buffer-local variable is either @code{nil} or is a function that
+determines the region to fontify, which Emacs then calls after each
+buffer change.
+
+The function is given three parameters, the standard @var{beg},
+@var{end}, and @var{old-len} from after-change-functions (@pxref{Change
+Hooks}).  It should return either a cons of the beginning and end buffer
+positions (in that order) of the region to fontify, or @code{nil} (which
+directs the caller to fontify the default region).  This function need
+not preserve point or the match-data, but must preserve the current
+restriction.  The region it returns may start or end in the middle of a
+line.
+
+Since this function is called after every buffer change, it should be
+reasonably fast.
+@end defvar
+
 @node Other Font Lock Variables
 @subsection Other Font Lock Variables
 
@@ -2772,14 +2814,6 @@
 @code{font-lock-default-unfontify-region}.
 @end defvar
 
-@defvar font-lock-lines-before
-This variable specifies the number of extra lines to consider when
-refontifying the buffer after each text change.  Font lock begins
-refontifying from that number of lines before the changed region.  The
-default is 0, but using a larger value can be useful for coping with
-multi-line patterns.
-@end defvar
-
 @ignore
 @defvar font-lock-inhibit-thing-lock
 List of Font Lock mode related modes that should not be turned on.
--- a/man/ChangeLog	Sun Mar 12 05:02:59 2006 +0000
+++ b/man/ChangeLog	Wed Mar 15 17:22:12 2006 +0000
@@ -1,3 +1,35 @@
+2006-03-14  Bill Wohler  <wohler@newt.com>
+
+	* mh-e.texi: Add index entries around each paragraph rather than
+	depend on entries from beginning of node. Doing so ensures that
+	index entries are less likely to be forgotten if text is cut and
+	pasted, and are necessary anyway if the references are on a
+	separate page. It seems that makeinfo is now (v. 4.8) only
+	producing one index entry per node, so there is no longer any
+	excuse not to. Use subheading instead of heading. The incorrect
+	use of heading produced very large fonts in Info--as large as the
+	main heading.
+	(From Bill Wohler): MH-E never did appear in Emacs 21--MH-E
+	versions 6 and 7 appeared *around* the time of these Emacs
+	releases.
+
+2006-03-13  Carsten Dominik  <dominik@science.uva.nl>
+
+	* org.texi (Clean view): Document new startup options.
+
+2006-03-11  Bill Wohler  <wohler@newt.com>
+
+	* mh-e.texi (Preface, More About MH-E, Options, HTML, Folders)
+	(Composing, Scan Line Formats): Fix @refs.
+	(Getting Started): Define MH profile and MH profile components.
+	(Incorporating Mail, Reading Mail, Viewing, Printing)
+	(Sending Mail, Forwarding, Editing Drafts, Inserting Letter)
+	(Signature, Aliases, Scan Line Formats): Use @code instead of @samp
+	for string constants.
+	(Tool Bar): Remove spurious quote.
+	(Junk): Use ``...'' instead of "...".
+	(Scan Line Formats): Replace @samp with @kbd.
+
 2006-03-11  Luc Teirlinck  <teirllm@auburn.edu>
 
 	* search.texi (Regexps): Use @samp for regexp that is not in Lisp
--- a/man/calendar.texi	Sun Mar 12 05:02:59 2006 +0000
+++ b/man/calendar.texi	Wed Mar 15 17:22:12 2006 +0000
@@ -24,7 +24,7 @@
 calendar features that are independent of any particular date.  To exit
 the calendar, type @kbd{q}.
 
-The basic features of the Calendar/Diary are described here.
+  This chapter describes the basic calendar features.
 @inforef{Advanced Calendar/Diary Usage,, emacs-xtra}, for information
 about more specialized features.
 
@@ -49,13 +49,13 @@
 @section Movement in the Calendar
 
 @cindex moving inside the calendar
-  Calendar mode lets you move through the calendar in logical units of
-time such as days, weeks, months, and years.  If you move outside the
-three months originally displayed, the calendar display ``scrolls''
-automatically through time to make the selected date visible.  Moving to
-a date lets you view its holidays or diary entries, or convert it to other
-calendars; moving longer time periods is also useful simply to scroll the
-calendar.
+  Calendar mode provides commands to move through the calendar in
+logical units of time such as days, weeks, months, and years.  If you
+move outside the three months originally displayed, the calendar
+display ``scrolls'' automatically through time to make the selected
+date visible.  Moving to a date lets you view its holidays or diary
+entries, or convert it to other calendars; moving by long time periods
+is also useful simply to scroll the calendar.
 
 @menu
 * Calendar Unit Motion::      Moving by days, weeks, months, and years.
@@ -117,16 +117,16 @@
 @findex calendar-forward-year
   The commands for motion by months and years work like those for
 weeks, but move a larger distance.  The month commands @kbd{M-@}} and
-@kbd{M-@{} move forward or backward by an entire month's time.  The
-year commands @kbd{C-x ]} and @w{@kbd{C-x [}} move forward or backward a
+@kbd{M-@{} move forward or backward by an entire month.  The year
+commands @kbd{C-x ]} and @w{@kbd{C-x [}} move forward or backward a
 whole year.
 
   The easiest way to remember these commands is to consider months and
-years analogous to paragraphs and pages of text, respectively.  But the
-commands themselves are not quite analogous.  The ordinary Emacs paragraph
-commands move to the beginning or end of a paragraph, whereas these month
-and year commands move by an entire month or an entire year, which usually
-involves skipping across the end of a month or year.
+years analogous to paragraphs and pages of text, respectively.  But
+the commands themselves are not quite analogous.  The ordinary Emacs
+paragraph commands move to the beginning or end of a paragraph,
+whereas these month and year commands move by an entire month or an
+entire year, keeping the same date within the month or year.
 
   All these commands accept a numeric argument as a repeat count.
 For convenience, the digit keys and the minus sign specify numeric
@@ -313,8 +313,8 @@
   To display the number of days elapsed since the start of the year, or
 the number of days remaining in the year, type the @kbd{p d} command
 (@code{calendar-print-day-of-year}).  This displays both of those
-numbers in the echo area.  The number of days elapsed includes the
-selected date.  The number of days remaining does not include that
+numbers in the echo area.  The count of days elapsed includes the
+selected date.  The count of days remaining does not include that
 date.
 
 @kindex C-c C-l @r{(Calendar mode)}
@@ -432,8 +432,7 @@
 click on that date with @kbd{Mouse-2} and then choose @kbd{Holidays}
 from the menu that appears.  Either way, this displays the holidays for
 that date, in the echo area if they fit there, otherwise in a separate
-window.  If the variable @code{view-calendar-holidays-initially} is
-non-@code{nil}, creating the calendar displays holidays in this way.
+window.
 
 @kindex x @r{(Calendar mode)}
 @findex mark-calendar-holidays
@@ -462,9 +461,11 @@
 @findex holidays
   The command @kbd{M-x holidays} displays the list of holidays for the
 current month and the preceding and succeeding months; this works even
-if you don't have a calendar window.  If you want the list of holidays
-centered around a different month, use @kbd{C-u M-x holidays}, which
-prompts for the month and year.
+if you don't have a calendar window.  If the variable
+@code{view-calendar-holidays-initially} is non-@code{nil}, creating
+the calendar displays holidays in this way.  If you want the list of
+holidays centered around a different month, use @kbd{C-u M-x
+holidays}, which prompts for the month and year.
 
   The holidays known to Emacs include United States holidays and the
 major Christian, Jewish, and Islamic holidays; also the solstices and
@@ -1017,7 +1018,7 @@
 @kbd{Mouse-2} on the date, and then choose @kbd{Diary entries} from
 the menu that appears.  If the variable
 @code{view-diary-entries-initially} is non-@code{nil}, creating the
-calendar also lists diary entries for the current date (provided the
+calendar lists the diary entries for the current date (provided the
 current date is visible).
 
 @kindex m @r{(Calendar mode)}
@@ -1371,10 +1372,10 @@
 minutes beforehand that that appointment is pending.  Emacs alerts you
 to the appointment by displaying a message in your chosen format, as
 specified by the variable @code{appt-display-format}.  If the value of
-@code{appt-audible} is non-@code{nil}, an audible reminder is also
-given.  In addition, if @code{appt-display-mode-line} is non-@code{nil},
-Emacs displays the number of minutes to the appointment on the mode
-line.
+@code{appt-audible} is non-@code{nil}, the warning includes an audible
+reminder.  In addition, if @code{appt-display-mode-line} is
+non-@code{nil}, Emacs displays the number of minutes to the
+appointment on the mode line.
 
 @vindex appt-display-duration
 @vindex appt-disp-window-function
@@ -1387,12 +1388,12 @@
 respectively.
 
 @findex appt-activate
-  To enable appointment notification, call the function
-@code{appt-activate} with a positive argument.  This sets up an
-appointment list for today from the diary file, giving all diary entries
-found with recognizable times of day, and reminds you just before each
-of them. Calling @code{appt-activate} with a negative argument disables
-the appointment package.  With no argument, it toggles.
+  To enable appointment notification, use the command @kbd{M-x
+appt-activate}.  With a positive argument, it enables notification;
+with a negative argument, it disables notification; with no argument,
+it toggles.  Enabling notification also sets up an appointment list
+for today from the diary file, giving all diary entries found with
+recognizable times of day, and reminds you just before each of them.
 
   For example, suppose the diary file contains these lines:
 
@@ -1404,10 +1405,10 @@
 
 @vindex appt-message-warning-time
 @noindent
-Then on Mondays, you will be reminded at around 9:20am about your coffee
-break and at around 11:50am about lunch.  How many minutes in advance you
-are first warned is determined by the value of
-@code{appt-message-warning-time}.
+Then on Mondays, you will be reminded at around 9:20am about your
+coffee break and at around 11:50am about lunch.  The variable
+@code{appt-message-warning-time} specifies how many minutes in advance
+to warn you; its default value is 12 (12 minutes).
 
   You can write times in am/pm style (with @samp{12:00am} standing
 for midnight and @samp{12:00pm} standing for noon), or 24-hour
@@ -1416,12 +1417,12 @@
 of lines if they are to be recognized.
 
 @vindex appt-display-diary
-  Emacs updates the appointments list from the diary file automatically
-just after midnight.  An update can be forced at any time by
-re-activating the appointment package.  Both these actions also display
-the day's diary buffer, unless you set @code{appt-display-diary} to
-@code{nil}.  The appointments list is also updated whenever the
-diary file is saved.
+  Emacs updates the appointments list from the diary file
+automatically just after midnight.  You can force an update at any
+time by re-enabling appointment notification.  Both these actions also
+display the day's diary buffer, unless you set
+@code{appt-display-diary} to @code{nil}.  The appointments list is
+also updated whenever the diary file is saved.
 
 @findex appt-add
 @findex appt-delete
@@ -1450,11 +1451,11 @@
 2445---Internet Calendaring and Scheduling Core Object Specification
 (iCalendar)'' (as well as the earlier vCalendar format).
 
-  Importing works for ``ordinary'' (i.e. non-recurring) events, but (at
-present) may not work correctly (if at all) for recurring events.
-Exporting of diary files into iCalendar files should work correctly for
-most diary entries.  Please note that @file{icalendar.el} is work in
-progress, so usage may evolve in future.
+  Importing works for ``ordinary'' (i.e. non-recurring) events, but
+(at present) may not work correctly (if at all) for recurring events.
+Exporting of diary files into iCalendar files should work correctly
+for most diary entries.  This feature is a work in progress, so the
+commands may evolve in future.
 
 @findex icalendar-import-buffer
   The command @code{icalendar-import-buffer} extracts
@@ -1476,7 +1477,7 @@
 
 @noindent
 You can use an @code{#include} directive to add the import file contents
-to the main diary file, if these are distinct.  @inforef{Fancy Diary
+to the main diary file, if these are different files.  @inforef{Fancy Diary
 Display,, emacs-xtra}.
 
 @findex icalendar-export-file, icalendar-export-region
@@ -1485,7 +1486,6 @@
 file, mark the relevant area, and call @code{icalendar-export-region}.
 In both cases the result is appended to the target file.
 
-
 @node Daylight Savings
 @section Daylight Savings Time
 @cindex daylight savings time
@@ -1560,7 +1560,8 @@
 @cindex timeclock
 
   The timeclock feature adds up time intervals, so you can (for
-instance) keep track of how much time you spend working.
+instance) keep track of how much time you spend working on particular
+projects.
 
 @findex timeclock-in
 @findex timeclock-out
@@ -1586,11 +1587,11 @@
 @code{t}, or invoke the @kbd{M-x timeclock-modeline-display} command.
 
 @vindex timeclock-ask-before-exiting
-  Terminating the current Emacs session might or might not mean that you
-have stopped working on the project and, by default, Emacs queries this.
-You can, however, set the value of the variable
+  Terminating the current Emacs session might or might not mean that
+you have stopped working on the project and, by default, Emacs asks
+you.  You can, however, set the value of the variable
 @code{timeclock-ask-before-exiting} to @code{nil} (via @kbd{M-x
-customize}) to avoid this behavior; then, only an explicit @kbd{M-x
+customize}) to avoid the question; then, only an explicit @kbd{M-x
 timeclock-out} or @kbd{M-x timeclock-change} will tell Emacs that the
 current interval is over.
 
--- a/man/mh-e.texi	Sun Mar 12 05:02:59 2006 +0000
+++ b/man/mh-e.texi	Wed Mar 15 17:22:12 2006 +0000
@@ -9,10 +9,10 @@
 
 @c Version of the software and manual.
 @set VERSION 7.93
-@c EDITION of the manual. It is either empty for the first edition or
+@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-03-05
+@set EDITION , 3rd Edition
+@set UPDATED 2006-03-14
 @set UPDATE-MONTH March, 2006
 
 @c Other variables.
@@ -203,6 +203,7 @@
 
 @cindex Emacs
 @cindex Unix commands, Emacs
+@cindex preface
 
 This manual introduces another interface to the MH mail system that is
 accessible through the GNU Emacs editor, namely, @emph{MH-E}. MH-E is
@@ -218,8 +219,11 @@
 21.5.9-21.5.16). It is compatible with MH versions 6.8.4 and higher,
 all versions of nmh, and GNU mailutils 0.4 and higher.}, so you
 shouldn't have to do anything special to use it. This manual covers
-MH-E version @value{VERSION}. @ref{Getting Started} will help you
-decide which version you have.
+MH-E version @value{VERSION}. To help you decide which version you
+have, see @ref{Getting Started}.
+
+@findex help-with-tutorial
+@kindex C-h t
 
 If you don't already use GNU Emacs but want to learn more, you can
 read an online tutorial by starting GNU Emacs and typing @kbd{C-h t}
@@ -241,10 +245,13 @@
 the individual MH commands. When the name is not obvious, I'll guide
 you to a relevant MH manual page that describes the action more fully.
 
+@cindex info
+@kindex C-h i
+
 This manual is available in both Info and online formats. The Info
 version is distributed with Emacs and can be accessed with the
-@command{info} command (@samp{info mh-e}) or within Emacs (@kbd{M-x
-info @key{RET} m mh-e @key{RET}}). The online version is available at
+@command{info} command (@samp{info mh-e}) or within Emacs (@kbd{C-h i
+m mh-e @key{RET}}). The online version is available at
 @uref{http://mh-e.sourceforge.net/manual/, SourceForge}. Another great
 online resource is the book @uref{http://www.ics.uci.edu/~mh/book/,
 @cite{MH & nmh: Email for Users & Programmers}} (also known as
@@ -265,8 +272,11 @@
 @chapter GNU Emacs Terms and Conventions
 
 @cindex Emacs
-@cindex Emacs, terms and conventions
+@cindex Emacs, conventions
+@cindex Emacs, terms
 @cindex Unix commands, Emacs
+@cindex conventions, Emacs
+@cindex terms, Emacs
 
 If you're an experienced Emacs user, you can skip the following
 conventions and definition of terms and go directly to the next
@@ -325,6 +335,7 @@
 
 @cindex Emacs, prefix argument
 @cindex prefix argument
+@kindex C-u
 
 A @dfn{prefix argument} allows you to pass an argument to any Emacs
 function. To pass an argument, type @kbd{C-u} before the Emacs command
@@ -348,8 +359,11 @@
 @end quotation
 @sp 1
  
+@cindex @file{.emacs}
 @cindex Emacs, variables
+@cindex files, @file{.emacs}
 @cindex variables
+@findex setq
 
 Emacs uses @dfn{variables} to hold values. These can be changed via
 calls to the function @code{setq} in @file{~/.emacs}.
@@ -392,9 +406,11 @@
 Face Customization} in @cite{The GNU Emacs Manual}.
 @end ifhtml
 
+@cindex abnormal hooks
 @cindex hooks
 @cindex normal hooks
-@cindex abnormal hooks
+@findex add-hook
+@findex customize-option
 
 Commands often offer @dfn{hooks} which enable you to extend or modify
 the way a command works. 
@@ -409,10 +425,11 @@
 @end ifhtml
 for a description about @dfn{normal hooks} and @dfn{abnormal hooks}.
 MH-E uses normal hooks in nearly all cases, so you can assume that we
-are talking about normal hooks unless we explicitly mention that a hook
-is abnormal. We also follow the conventions described in that section:
-the name of the abnormal hooks end in @code{-hooks} and all the rest
-of the MH-E hooks end in @code{-hook}.
+are talking about normal hooks unless we explicitly mention that a
+hook is abnormal. We also follow the conventions described in that
+section: the name of the abnormal hooks end in @code{-hooks} and all
+the rest of the MH-E hooks end in @code{-hook}. You can add hooks with
+either @code{customize-option} or @code{add-hook}.
 
 @cindex Emacs, mark
 @cindex Emacs, point
@@ -420,6 +437,8 @@
 @cindex mark
 @cindex point
 @cindex region
+@kindex C-@@
+@kindex C-@key{SPC}
 
 There are several other terms that are used in Emacs that you should
 know. The @dfn{point} is where the cursor currently is. You can save
@@ -430,14 +449,16 @@
 filling paragraphs. A mark can be set with @kbd{C-@@} (or
 @kbd{C-@key{SPC}}).
 
+@cindex completion
 @cindex Emacs, completion
 @cindex Emacs, file completion
 @cindex Emacs, folder completion
 @cindex Emacs, minibuffer
-@cindex completion
 @cindex file completion
 @cindex folder completion
 @cindex minibuffer
+@kindex SPC
+@kindex TAB
 
 The @dfn{minibuffer} is the bottom line of the Emacs window, where all
 prompting and multiple-character input is directed. You can use
@@ -456,6 +477,10 @@
 Note that @key{SPC} cannot be used for completing filenames and
 folders.
 
+@findex help-with-tutorial
+@kindex C-h t
+@kindex M-x
+
 The minibuffer is also where you enter Emacs function names after
 typing @kbd{M-x}. For example, in the preface, I mentioned that you
 could obtain help with @kbd{C-h t} (@code{help-with-tutorial}). What
@@ -518,6 +543,14 @@
 MH-E, and you may need to install MH too. However, newer versions of
 MH-E are better at finding MH if it is on your system.}.
 
+@cindex @command{mhparam}
+@cindex MH commands, @command{mhparam}
+@vindex exec-path
+@vindex mh-path
+@vindex mh-sys-path
+@vindex mh-variant
+@vindex mh-variant-in-use
+
 The option @code{mh-variant} specifies the variant used by MH-E
 (@pxref{Options}). The default setting of this option is
 @samp{Auto-detect} which means that MH-E will automatically choose the
@@ -525,15 +558,23 @@
 listed in @code{mh-path} (which you can customize),
 @code{mh-sys-path}, and @code{exec-path}. If MH-E can't find MH at
 all, you may have to customize @code{mh-path} and add the directory in
-which the command @code{mhparam} is located. If, on the other hand,
+which the command @command{mhparam} is located. If, on the other hand,
 you have both nmh and mailutils installed (for example) and
 @code{mh-variant-in-use} was initialized to nmh but you want to use
 mailutils, then you can set @code{mh-variant} to @samp{mailutils}.
 
+@vindex mh-flists-present-flag
+@vindex mh-lib
+@vindex mh-lib-progs
+@vindex mh-progs
+
 When @code{mh-variant} is changed, MH-E resets @code{mh-progs},
 @code{mh-lib}, @code{mh-lib-progs}, @code{mh-flists-present-flag}, and
 @code{mh-variant-in-use} accordingly.
 
+@cindex @file{.emacs}
+@cindex files, @file{.emacs}
+
 @sp 1
 @center @strong{NOTE}
 
@@ -554,14 +595,25 @@
 If you don't, you'll be greeted with the error message: @samp{Install
 MH and run install-mh before running MH-E}.
 
+@cindex @samp{Path:} MH profile component
+@cindex MH profile
+@cindex MH profile component
+@cindex MH profile component, @samp{Path:}
+
+Your MH environment includes your @dfn{MH profile} which is found in
+the file @file{~/.mh_profile}. This file contains a number of @dfn{MH
+profile components}. For example, the @samp{Path:} MH profile
+component contains the path to your mail directory, which is
+@file{~/Mail} by default.
+
+@cindex MH profile component, @samp{Draft-Folder:}
+@cindex MH profile component, @samp{Path:}
+@cindex MH profile component, @samp{Previous-Sequence:}
+@cindex MH profile component, @samp{Unseen-Sequence:}
 @cindex @samp{Draft-Folder:} MH profile component
 @cindex @samp{Path:} MH profile component
 @cindex @samp{Previous-Sequence:} MH profile component
 @cindex @samp{Unseen-Sequence:} MH profile component
-@cindex MH profile component, @samp{Draft-Folder:}
-@cindex MH profile component, @samp{Path:}
-@cindex MH profile component, @samp{Previous-Sequence:}
-@cindex MH profile component, @samp{Unseen-Sequence:}
 @findex mh-find-path
 @vindex mh-draft-folder
 @vindex mh-find-path-hook
@@ -586,6 +638,10 @@
 @node Tour Through MH-E, Using This Manual, Getting Started, Top
 @chapter Tour Through MH-E
 
+@cindex introduction
+@cindex tour
+@cindex tutorial
+
 This chapter introduces some of the terms you'll need to know and then
 takes you on a tour of MH-E@footnote{The keys mentioned in these
 chapters refer to the default key bindings. If you've changed the
@@ -610,6 +666,7 @@
 
 @cindex sending mail
 @findex mh-smail
+@kindex M-x mh-smail
 
 Let's start our tour by sending ourselves a message which we can later
 read and process. Enter @kbd{M-x mh-smail} to invoke the MH-E program
@@ -660,7 +717,10 @@
 the header.
 
 @cindex help
+@findex describe-mode
+@kindex C-c ?
 @kindex C-c C-c
+@kindex C-h m
 
 There are several commands specific to MH-Letter mode@footnote{You can
 get quick help for the commands used most often with @kbd{C-c ?} or
@@ -679,6 +739,7 @@
 @cindex modes, MH-Folder
 @cindex reading mail
 @findex mh-rmail
+@kindex M-x mh-rmail
 
 To read the mail you've just sent yourself, enter @kbd{M-x mh-rmail}.
 This incorporates the new mail and puts the output from
@@ -691,10 +752,15 @@
 summary of each message) into a buffer called @samp{+inbox} whose
 major mode is MH-Folder.
 
+@findex mh-rmail
+@kindex F r
+@kindex M-x mh-rmail
+
 @sp 1
 @center @strong{NOTE}
 
 @quotation
+
 The @kbd{M-x mh-rmail} command will show you only new mail, not mail
 you have already read. If you were to run this tour again, you would
 use @kbd{F r} to pull all your messages into MH-E.
@@ -742,6 +808,7 @@
 @section Processing Mail
 
 @cindex processing mail
+@kindex @key{RET}
 @kindex r
 
 The first thing we want to do is reply to the message that we sent
@@ -778,8 +845,17 @@
 @end cartouche
 @i{Composition window during reply}
 
+@findex backward-char
+@findex forward-char
+@findex next-line
+@findex previous-line
+@kindex C-b
 @kindex C-c C-c
 @kindex C-c C-f C-t
+@kindex C-f
+@kindex C-n
+@kindex C-p
+@kindex @key{BS}
 
 By default, MH will not add you to the address list of your replies,
 so if you find that the @samp{To:} header field is missing, don't
@@ -791,7 +867,10 @@
 delete the previous character with @key{BS}. When you're finished
 editing your message, send it with @kbd{C-c C-c} as before.
 
+@cindex @command{refile}
+@cindex MH commands, @command{refile}
 @cindex folders
+@kindex @key{SPC}
 @kindex o
 
 You'll often want to save messages that were sent to you in an
@@ -809,9 +888,11 @@
 
 @cindex MH-Folder mode
 @cindex modes, MH-Folder
-@kindex @key{RET}
 @kindex d
 @kindex i
+@kindex @key{RET}
+@kindex n
+@kindex p
 @kindex x
 
 Your previous reply is now waiting in the system mailbox. You
@@ -826,6 +907,7 @@
 
 @findex mh-smail
 @kindex m
+@kindex M-x mh-smail
 
 If you want to send another message you can use @kbd{m} instead of
 @kbd{M-x mh-smail}. So go ahead, send some mail to your friends!
@@ -835,6 +917,7 @@
 @findex describe-mode
 @kindex ?
 @kindex C-h m
+@kindex F ?
 
 You can get a quick reminder about these commands by typing @kbd{?}.
 This lists several @dfn{prefix characters}. To list the commands
@@ -847,6 +930,8 @@
 
 @cindex Emacs, quitting
 @cindex quitting
+@kindex C-x C-c
+@kindex x
 
 You may now wish to exit @command{emacs} entirely. Use @kbd{C-x C-c}
 to exit @command{emacs}. If you exited without running @kbd{x} in the
@@ -855,6 +940,9 @@
 perform any refiles and deletes that you did there.
 
 @findex mh-rmail
+@kindex C-x b
+@kindex C-x k
+@kindex M-x mh-rmail
 @kindex q
 
 If you don't want to leave Emacs, you can type @kbd{q} to bury (hide)
@@ -886,57 +974,58 @@
 
 @itemize @bullet
 @item
-Print your messages (@ref{Printing}).
+Print your messages (@pxref{Printing}).
 @c -------------------------
 @item
-Edit messages and include your signature (@ref{Editing Drafts}).
+Edit messages and include your signature (@pxref{Editing Drafts}).
 @c -------------------------
 @item
-Forward messages (@ref{Forwarding}).
+Forward messages (@pxref{Forwarding}).
 @c -------------------------
 @item
-Read digests (@ref{Digests}).
+Read digests (@pxref{Digests}).
 @c -------------------------
 @item
-Edit bounced messages (@ref{Editing Again}).
+Edit bounced messages (@pxref{Editing Again}).
 @c -------------------------
 @item
-Send multimedia messages (@ref{Adding Attachments}).
+Send multimedia messages (@pxref{Adding Attachments}).
 @c -------------------------
 @item
-Read HTML messages (@ref{HTML}).
+Read HTML messages (@pxref{HTML}).
 @c -------------------------
 @item
-Use @ref{Aliases} and @ref{Identities}.
+Use aliases and identities (see @ref{Aliases}, @pxref{Identities}).
 @c -------------------------
 @item
-Create different views of your mail (@ref{Threading} and @ref{Limits}).
+Create different views of your mail (see @ref{Threading}, @pxref{Limits}).
 @c -------------------------
 @item
-Deal with junk mail (@ref{Junk}).
+Deal with junk mail (@pxref{Junk}).
 @c -------------------------
 @item
-Handle signed and encrypted messages (@ref{Reading PGP} and
-@ref{Sending PGP}).
+Handle signed and encrypted messages (see @ref{Reading PGP},
+@pxref{Sending PGP}).
 @c -------------------------
 @item
 Process mail that was sent with @command{shar} or @command{uuencode}
-(@ref{Files and Pipes}).
+(@pxref{Files and Pipes}).
 @c -------------------------
 @item
-Use sequences conveniently (@ref{Sequences}).
+Use sequences conveniently (@pxref{Sequences}).
 @c -------------------------
 @item
-Use the @ref{Speedbar}, @ref{Tool Bar}, and @ref{Menu Bar}.
+Use the speedbar, tool bar, and menu bar (see @ref{Speedbar}, see @ref{Tool
+Bar}, @pxref{Menu Bar}).
 @c -------------------------
 @item
-Show header fields in different fonts (@ref{Reading Mail}).
+Show header fields in different fonts (@pxref{Reading Mail}).
 @c -------------------------
 @item
-Find previously refiled messages (@ref{Searching}).
+Find previously refiled messages (@pxref{Searching}).
 @c -------------------------
 @item
-Place messages in a file (@ref{Files and Pipes}).
+Place messages in a file (@pxref{Files and Pipes}).
 @end itemize
 
 Remember that you can also use MH commands when you're not running
@@ -956,6 +1045,10 @@
 @findex mh-help
 @kindex ?
 @kindex C-c ?
+@kindex C-h C-h
+@kindex C-h C-k i
+@kindex C-h i
+@kindex C-h m
 
 There are many commands, but don't get intimidated. There are command
 summaries at the beginning of each chapter. In case you have or would
@@ -986,7 +1079,8 @@
 GNU Emacs. Note that MH-E does not provide hooks for customizations
 that can be done in MH; this omission is intentional.
 
-@cindex Emacs, Emacs Lisp manual
+@cindex Emacs Lisp Manual
+@cindex Emacs, Emacs Lisp Manual
 @cindex Emacs, info
 @cindex Emacs, online help
 @cindex info
@@ -1065,8 +1159,15 @@
 the string to the right of the variable. For example, you may change
 the @command{lpr} command with @samp{nenscript -G -r -2 -i'%s'}. Then
 use the @samp{State} combo box and select @samp{Save for Future
-Sessions}. @ref{Printing} talks more about this option.
-
+Sessions}. To read more about @code{mh-lpr-command-format}, see
+@ref{Printing}.
+
+@cindex nil
+@cindex off, option
+@cindex on, option
+@cindex option, turning on and off
+@cindex t
+@findex customize-option
 @vindex mh-bury-show-buffer-flag, example
 
 Options can also hold boolean values. In Emacs Lisp, the boolean
@@ -1082,14 +1183,16 @@
 default, which places the MH-Show buffer at the bottom of the buffer
 stack.
 
+@vindex mh-mhl-format-file, example
+
 The text usually says to turn on an option by setting it to a
 @emph{non-@code{nil}} value, because sometimes values other than
-@samp{on} are meaningful (for example, see @code{mh-mhl-format-file},
-described in @ref{Viewing}). Other options, such as hooks, involve a
-little more Emacs Lisp programming expertise.
-
+@samp{on} are meaningful. An example of this is the variable
+@code{mh-mhl-format-file} (@pxref{Viewing}). Other options, such as
+hooks, involve a little more Emacs Lisp programming expertise.
+
+@cindex customization group, @samp{mh}
 @cindex @samp{mh} customization group
-@cindex customization group, @samp{mh}
 @findex customize-group
 @findex mh-customize
 
@@ -1104,14 +1207,16 @@
 
 @c Sync with mh-folder-mode docstring.
 
-@cindex ranges
 @cindex message abbreviations
 @cindex message ranges
+@cindex ranges
 
 Many commands that operate on individual messages, such as
 @code{mh-forward} or @code{mh-refile-msg} take a @code{RANGE}
 argument. This argument can be used in several ways.
 
+@kindex C-u, with ranges
+
 If you provide the prefix argument @kbd{C-u} to these commands, then
 you will be prompted for the message range. This can be any valid MH
 range which can include messages, sequences (@pxref{Sequences}), and
@@ -1143,9 +1248,9 @@
 
 @vindex transient-mark-mode
 
-If the option @code{transient-mark-mode} is set to @code{t} and you
-set a region in the MH-Folder buffer, then the MH-E command will
-perform the operation on all messages in that region.
+If the option @code{transient-mark-mode} is turned on and you set a
+region in the MH-Folder buffer, then the MH-E command will perform the
+operation on all messages in that region.
 
 @cindex @samp{mh-range} customization group
 @cindex customization group, @samp{mh-range}
@@ -1158,6 +1263,8 @@
 On means interpret a number as a range (default: @samp{on}).
 @end vtable
 
+@vindex mh-interpret-number-as-range-flag
+
 Since one of the most frequent ranges used is @samp{last:N}, MH-E will
 interpret input such as @samp{200} as @samp{last:200} if the
 @code{mh-interpret-number-as-range-flag} option is on (which is the
@@ -1167,6 +1274,8 @@
 @node Folder Selection,  , Ranges, Using This Manual
 @section Folder Selection
 
+@cindex completion, folders
+@cindex folders, completion
 @cindex folders, selecting
 
 When you choose a folder in MH-E via a command such as @kbd{o}
@@ -1182,8 +1291,8 @@
 In addition, MH-E has several ways of choosing a suitable default so
 that the folder can often be selected with a single @key{RET} key.
 
+@cindex customization group, @samp{mh-folder-selection}
 @cindex @samp{mh-folder-selection} customization group
-@cindex customization group, @samp{mh-folder-selection}
 
 The @samp{mh-folder-selection} customization group contains some
 options which are used to help with this.
@@ -1204,6 +1313,8 @@
 Prefix used for folder names generated from aliases (default: @code{""}).
 @end vtable
 
+@vindex mh-default-folder-for-message-function
+
 You can set the option @code{mh-default-folder-for-message-function}
 to a function that provides a default folder for the message to be
 refiled. When this function is called, the current buffer contains the
@@ -1217,6 +1328,7 @@
 sender as follows:
 
 @enumerate
+@vindex mh-default-folder-list
 @item
 The folder name associated with the first address found in the list
 @code{mh-default-folder-list} is used. Each element in this list
@@ -1224,12 +1336,15 @@
 then the address is checked against the recipient instead of the
 sender. This is useful for mailing lists.
 @c -------------------------
+@vindex mh-default-folder-prefix
 @item
 An alias prefixed by @code{mh-default-folder-prefix} corresponding to
 the address is used. The prefix is used to prevent clutter in your
 mail directory. @xref{Aliases}.
 @end enumerate
 
+@vindex mh-default-folder-must-exist-flag
+
 If the derived folder does not exist, and
 @code{mh-default-folder-must-exist-flag} is @code{t}, then the last
 folder name used is suggested. This is useful if you get mail from
@@ -1239,7 +1354,9 @@
 @node Incorporating Mail, Reading Mail, Using This Manual, Top
 @chapter Incorporating Your Mail
 
+@cindex @samp{Folder} menu
 @cindex incorporating
+@cindex menu, @samp{Folder}
 
 This chapter talks about getting mail from your system mailbox into
 your MH @samp{+inbox} folder. The following command accomplishes that
@@ -1262,7 +1379,7 @@
 
 @vtable @code
 @item mh-inc-prog
-Program to incorporate mail (default: @samp{"inc"}).
+Program to incorporate mail (default: @code{"inc"}).
 @c -------------------------
 @item mh-inc-spool-list
 Alternate spool files (default: @code{nil}).
@@ -1271,11 +1388,16 @@
 The following hook is available.
 
 @vtable @code
+@findex mh-inc-folder
 @item mh-inc-folder-hook
-Hook run by @samp{mh-inc-folder} after incorporating mail into a
+Hook run by @code{mh-inc-folder} after incorporating mail into a
 folder (default: @code{nil}).
 @end vtable
 
+@cindex @samp{+inbox}
+@findex mh-inc-folder
+@kindex i
+
 If at any time you receive new mail, incorporate the new mail into
 your @samp{+inbox} buffer with @kbd{i} (@code{mh-inc-folder}). Note
 that @kbd{i} will display the @samp{+inbox} buffer, even if there
@@ -1292,7 +1414,7 @@
 
 Emacs can notify you when you have new mail by displaying @samp{Mail}
 in the mode line. To enable this behavior, and to have a clock in the
-mode line besides, add the following to @file{~/.emacs}:
+mode line as well, add the following to @file{~/.emacs}:
 
 @findex display-time
 
@@ -1301,12 +1423,13 @@
 @end lisp
 
 @cindex @command{inc}
+@cindex incorporating
 @cindex MH commands, @command{inc}
-@cindex incorporating
+@vindex mh-inc-prog
 @vindex mh-progs
 
 The name of the program that incorporates new mail is stored in
-@code{mh-inc-prog}; it is @samp{"inc"} by default. This program
+@code{mh-inc-prog}; it is @code{"inc"} by default. This program
 generates a one-line summary for each of the new messages. Unless it
 is an absolute pathname, the file is assumed to be in the
 @code{mh-progs} directory (@pxref{Getting Started}). You may also link
@@ -1317,6 +1440,8 @@
 the MH book). You'll then need to modify several variables
 appropriately (@pxref{Scan Line Formats}).
 
+@vindex mh-inc-spool-list
+
 You can use the @code{mh-inc-spool-list} variable to direct MH-E to
 retrieve mail from arbitrary spool files other than your system
 mailbox, file it in folders other than your @samp{+inbox}, and assign
@@ -1338,6 +1463,9 @@
 mh-e
 @end smallexample
 
+@findex mh-inc-spool-*
+@kindex I *
+
 In order to incorporate @file{~/mail/mh-e} into @samp{+mh-e} with an
 @kbd{I m} (@code{mh-inc-spool-mh-e}) command, customize this option,
 and click on the @samp{INS} button. Enter a @samp{Spool File} of
@@ -1367,6 +1495,10 @@
 In XEmacs, the command @command{gnuclient} is used in a similar
 fashion.
 
+@findex mh-inc-folder
+@kindex i
+@vindex mh-inc-folder-hook
+
 You can set the hook @code{mh-inc-folder-hook}, which is called after
 new mail is incorporated by the @kbd{i} (@code{mh-inc-folder})
 command. A good use of this hook is to rescan the whole folder either
@@ -1397,13 +1529,16 @@
 @node Reading Mail, Folders, Incorporating Mail, Top
 @chapter Reading Your Mail
 
+@cindex @samp{+inbox}
 @cindex MH-Folder mode
 @cindex MH-Show mode
 @cindex modes, MH-Folder
 @cindex modes, MH-Show
 @cindex reading mail
-@cindex scan lines
 @findex mh-rmail
+@kindex M-x mh-rmail
+@kindex F r
+@kindex F v
 
 The MH-E entry point for reading mail is @kbd{M-x mh-rmail}. This
 command incorporates your mail and creates a buffer called
@@ -1414,6 +1549,12 @@
 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}.}.
 
+@cindex @command{scan}
+@cindex @samp{Message} menu
+@cindex MH commands, @command{scan}
+@cindex menu, @samp{Message}
+@cindex scan lines
+
 The @samp{+inbox} buffer contains @dfn{scan lines}, which are one-line
 summaries of each incorporated message. You can perform most MH
 commands on these messages via one- or two-letter commands in either
@@ -1714,7 +1855,7 @@
 @c -------------------------
 @item mh-fetch-x-image-url
 Control fetching of @samp{X-Image-URL:} header field image (default:
-@code{Never Fetch}).
+@samp{Never Fetch}).
 @c -------------------------
 @item mh-graphical-smileys-flag
 On means graphical smileys are displayed (default: @samp{on}).
@@ -1733,14 +1874,14 @@
 Additional header fields to hide (default: @code{nil}).
 @c -------------------------
 @item mh-lpr-command-format
-Command used to print (default: @samp{"lpr -J '%s'"}).
+Command used to print (default: @code{"lpr -J '%s'"}).
 @c -------------------------
 @item mh-max-inline-image-height
-Maximum inline image height if \"Content-Disposition:\" is not
+Maximum inline image height if @samp{Content-Disposition:} is not
 present (default: 0).
 @c -------------------------
 @item mh-max-inline-image-width
-Maximum inline image width if \"Content-Disposition:\" is not
+Maximum inline image width if @samp{Content-Disposition:} is not
 present(default: 0).
 @c -------------------------
 @item mh-mhl-format-file
@@ -1754,12 +1895,16 @@
 On means messages should be printed in the background (default:
 @samp{off}).
 @c -------------------------
+@item mh-show-buffer-mode-line-buffer-id
+Format string to produce @code{mode-line-buffer-identification} for
+show buffers (default: @code{"    @{show-%s@} %d"}).
+@c -------------------------
 @item mh-show-maximum-size
 Maximum size of message (in bytes) to display automatically (default:
 0).
 @c -------------------------
 @item mh-show-use-xface-flag
-On means display face images in MH-Show buffers (default: @code{on}).
+On means display face images in MH-Show buffers (default: @samp{on}).
 @c -------------------------
 @item mh-store-default-directory
 Default directory for @kbd{X s} (default: @samp{Current}).
@@ -1863,6 +2008,8 @@
 all of them, use the command @kbd{,} (comma;
 @code{mh-header-display}).
 
+@vindex mh-show-maximum-size
+
 The option @code{mh-show-maximum-size} provides an opportunity to skip
 over large messages which may be slow to load. The default value of 0
 means that all message are shown regardless of size.
@@ -1884,8 +2031,8 @@
 
 @cindex regular expressions, @code{mh-invisible-header-fields}
 @vindex mh-clean-message-header-flag
+@vindex mh-invisible-header-fields
 @vindex mh-invisible-header-fields-default
-@vindex mh-invisible-header-fields
 
 Normally messages are delivered with a handful of uninteresting header
 fields. These are hidden by turning on the option
@@ -1901,12 +2048,12 @@
 header field should be generally ignored, report a bug (@pxref{Bug
 Reports}).
 
+@cindex header field, @samp{Face:}
+@cindex header field, @samp{X-Face:}
+@cindex header field, @samp{X-Image-URL:}
 @cindex @samp{Face:} header field
 @cindex @samp{X-Face:} header field
 @cindex @samp{X-Image-URL:} header field
-@cindex header field, @samp{Face:}
-@cindex header field, @samp{X-Face:}
-@cindex header field, @samp{X-Image-URL:}
 @vindex mh-show-use-xface-flag
 
 MH-E can display the content of @samp{Face:}, @samp{X-Face:}, and
@@ -2005,9 +2152,9 @@
 and forwarding; in this case, the value of @code{mh-mhl-format-file}
 is consulted if you have specified a format file.
 
-@vindex mh-highlight-citation-style
 @cindex citations, highlighting
 @cindex highlighting citations
+@vindex mh-highlight-citation-style
 
 If the sender of the message has cited other messages in his message,
 then MH-E will highlight these citations to emphasize the sender's
@@ -2030,9 +2177,9 @@
 Email addresses and URLs in the message are highlighted if the option
 @code{goto-address-highlight-p} is on, which it is by default. To view
 the web page for a highlighted URL or to send a message using a
-highlighted email address, use @kbd{Mouse-2} or @kbd{C-c @key{RET}}.
-See @ref{Sending Mail}, to see how to configure Emacs to send the
-message using MH-E.
+highlighted email address, use @kbd{Mouse-2} or @kbd{C-c @key{RET}}
+(@code{goto-address-at-point}). @xref{Sending Mail}, to see how to
+configure Emacs to send the message using MH-E.
 
 @cindex boldface, showing
 @cindex emphasis
@@ -2074,7 +2221,7 @@
 
 MH-E normally renders signatures and vCards in italics so that the
 body of the message stands out more. MH-E depends on the presence of
-the @dfn{signature separator} (@samp{"-- "}) to do this. You can also
+the @dfn{signature separator} (@code{"-- "}) to do this. You can also
 customize the face @code{mh-show-signature} so the appearance of the
 signature block is more to your liking.
 
@@ -2089,16 +2236,16 @@
 behavior of MH-E in general or when @code{mh-show-mode-hook} is too
 early.
 
-@vindex mh-show-buffer-mode-line-buffer-id
 @cindex MH-Show mode
 @cindex modes, MH-Show
+@vindex mh-show-buffer-mode-line-buffer-id
 
 For those who like to modify their mode lines, use
 @code{mh-show-buffer-mode-line-buffer-id} to modify the mode line in
 the MH-Show buffers. Place the two escape strings @samp{%s} and
 @samp{%d}, which will display the folder name and the message number,
 respectively, somewhere in the string in that order. The default value
-of @samp{"@{show-%s@} %d"} yields a mode line of
+of @code{"@{show-%s@} %d"} yields a mode line of
 
 @smallexample
 -----@{show-+inbox@} 4      (MH-Show)--Bot--------------------------------
@@ -2107,13 +2254,13 @@
 @node Viewing Attachments, HTML, Viewing, Reading Mail
 @section Viewing Attachments
 
+@cindex attachments
+@cindex body parts
 @cindex @command{mhshow}
 @cindex @command{show}
 @cindex MH commands, @command{mhshow}
 @cindex MH commands, @command{show}
 @cindex MIME
-@cindex attachments
-@cindex body parts
 @cindex multimedia mail
 
 MH has the ability to display @dfn{@sc{mime}} (Multipurpose Internet
@@ -2147,21 +2294,22 @@
 other graphical widgets. @xref{Viewing}.
 
 @cindex buttons
-@kindex Mouse-1
-@kindex Mouse-2
-@kindex @key{RET}
-@findex mh-press-button
-@findex mh-next-button
-@findex mh-prev-button
-@kindex K @key{TAB}
-@kindex K S-@key{TAB}
-
-Attachments in MH-E are indicated by buttons like this:
+
+Attachments in MH-E are indicated by @dfn{buttons} like this:
 
 @example
 [1. image/jpeg; foo.jpg]...
 @end example
 
+@findex mh-next-button
+@findex mh-press-button
+@findex mh-prev-button
+@kindex @key{RET}
+@kindex K @key{TAB}
+@kindex K S-@key{TAB}
+@kindex Mouse-1
+@kindex Mouse-2
+
 To view the contents of the button, use either @kbd{Mouse-1} or
 @kbd{Mouse-2} on the button or @key{RET} (@code{mh-press-button}) when
 the cursor is over the button. This command is a toggle so if you use
@@ -2214,7 +2362,6 @@
 
 @cindex attachments, saving
 @cindex saving attachments
-
 @findex mh-folder-save-mime-part
 @kindex K o
 
@@ -2244,6 +2391,8 @@
 components, since this function calls on @command{mhstore}
 (@command{mhn}) to do the work.
 
+@vindex mh-mime-save-parts-default-directory
+
 The default value for the option
 @code{mh-mime-save-parts-default-directory} is @samp{Prompt Always} so
 that you are always prompted for the directory in which to save the
@@ -2275,9 +2424,9 @@
 MH-E cannot display all attachments inline however. It can display
 text (including @sc{html}) and images.
 
-@cindex @samp{Content-Disposition:} header field
 @cindex header field, @samp{Content-Disposition:}
 @cindex inline images
+@cindex @samp{Content-Disposition:} header field
 @vindex mh-max-inline-image-height
 @vindex mh-max-inline-image-width
 
@@ -2331,7 +2480,6 @@
 
 @cindex HTML
 @cindex Gnus
-@vindex mm-text-html-renderer
 
 MH-E can display messages that have been sent in HTML@footnote{This
 feature depends on a version of Gnus that is at least 5.10.}. The
@@ -2344,8 +2492,10 @@
 [1. text/html; foo.html]...
 @end example
 
-See @ref{Viewing Attachments} to see how to read the contents of this
-body part.
+To see how to read the contents of this body part, see @ref{Viewing
+Attachments}.
+
+@vindex mm-text-html-renderer
 
 The browser that MH-E uses is determined by the option
 @code{mm-text-html-renderer}. The default setting is set automatically
@@ -2356,12 +2506,17 @@
 images as this can tip off spammers that the email address they have
 used is valid.
 
+@vindex mm-text-html-renderer
+
 If you're confused about which @code{mm-text-html-renderer} to use,
 here's a brief description of each, sorted by popularity, that
 includes the results of a quick poll of MH-E users from 2005-12-23.
 
 @table @asis
-
+@cindex browser, @samp{w3m}
+@cindex @samp{w3m}
+@kindex Mouse-2
+@kindex S-Mouse-2
 @item @samp{w3m} 7
 The @samp{w3m} browser requires an external program. It's quick,
 produces pretty nice output, and best of all, it's the only browser
@@ -2372,6 +2527,8 @@
 (which can cause text to wrap if the author didn't anticipate that the
 page would be viewed in Emacs).
 @c -------------------------
+@cindex browser, @samp{w3m-standalone}
+@cindex @samp{w3m-standalone}
 @item @samp{w3m-standalone} 3
 This browser, along with @samp{nil} for the external browser, are the
 only choices that work without having to download a separate lisp
@@ -2381,6 +2538,8 @@
 handle the escape @samp{&ndash;} (it printed a @samp{?}), but it did
 render @samp{&reg;}.
 @c -------------------------
+@cindex browser, @samp{links}
+@cindex @samp{links}
 @item @samp{links} 1
 The @samp{links} browser requires an external program. It's quick, and
 produces nicer output than @samp{lynx} on single column mails in
@@ -2389,6 +2548,8 @@
 columns and thus seems better than @samp{w3} and
 @samp{w3m-standalone}. Converts escapes such as @samp{&reg;} to (R).
 @c -------------------------
+@cindex browser, @samp{lynx}
+@cindex @samp{lynx}
 @item @samp{lynx} 1
 The @samp{lynx} browser requires an external program. It's quick and
 produces pretty decent output but it doesn't show links. It doesn't
@@ -2402,6 +2563,8 @@
 HTML messages have a button for the body part which you can view with
 @kbd{K v} (@code{mh-folder-toggle-mime-part}).
 @c -------------------------
+@cindex browser, @samp{w3}
+@cindex @samp{w3}
 @item @samp{w3} 0
 This choice does not require an external program as all of the
 rendering is done in lisp. You do need to get the package separately.
@@ -2414,6 +2577,8 @@
 highlighted. Performs well on single-column tables and handles escapes
 such as @samp{&reg;}.
 @c -------------------------
+@cindex browser, @samp{html2text}
+@cindex @samp{html2text}
 @item @samp{html2text} 0
 The @samp{html2text} browser requires an external program. I noticed
 that it can do some nasty things with simple HTML mails (like filling
@@ -2422,6 +2587,8 @@
 reason.
 @end table
 
+@vindex mm-text-html-renderer
+
 For a couple more sources of information about
 @code{mm-text-html-renderer},
 @ifinfo
@@ -2442,10 +2609,10 @@
 @cindex digests
 @findex mh-page-digest
 @findex mh-page-digest-backwards
+@kindex D @key{BS}
+@kindex D @key{SPC}
 @kindex @key{BS}
 @kindex @key{SPC}
-@kindex D @key{BS}
-@kindex D @key{SPC}
 
 A digest is a message that contains other messages. Special MH-E
 commands let you read digests conveniently. You can use @key{SPC} and
@@ -2459,8 +2626,8 @@
 @cindex MH-Folder Show mode
 @cindex modes, MH-Folder Show
 @findex mh-burst-digest
+@kindex d
 @kindex D b
-@kindex d
 @kindex t
 
 Another handy command is @kbd{D b} (@code{mh-burst-digest}). This
@@ -2622,6 +2789,8 @@
 @findex mh-ps-print-msg-file
 @kindex P f
 @kindex P p
+@vindex mh-lpr-command-format
+@vindex mh-print-background-flag
 
 To print messages in MH-E, use the command @kbd{P p}
 (@code{mh-ps-print-msg}). You can print all the messages in a range
@@ -2677,6 +2846,9 @@
 @uref{@value{MH-BOOK-HOME}/shomes.htm#Usisho, Using mhl} in the MH
 book.} and printed with the @command{lpr} command.
 
+@kindex P f
+@kindex P l
+@kindex P p
 @vindex mh-lpr-command-format
 @vindex mh-print-background-flag
 
@@ -2685,7 +2857,7 @@
 performs the actual printing. The string can contain one escape,
 @samp{%s}, which is replaced by the name of the folder and the message
 number and is useful for print job names. The default setting is
-@samp{"lpr -J '%s'"}. I use @samp{"mpage -h'%s' -b Letter -H1of -mlrtb
+@code{"lpr -J '%s'"}. I use @code{"mpage -h'%s' -b Letter -H1of -mlrtb
 -P"} which produces a nice header and adds a bit of margin so the text
 fits within my printer's margins. Normally messages are printed in the
 foreground. If this is slow on your system, you may elect to turn on
@@ -2699,11 +2871,10 @@
 
 @cindex files
 @cindex pipes
-
 @findex mh-refile-or-write-again
 @findex mh-write-msg-to-file
+@kindex >
 @kindex !
-@kindex >
 
 MH-E does offer a couple of commands that are not a part of MH@. The
 first one, @kbd{>} (@code{mh-write-msg-to-file}), writes a message to
@@ -2716,6 +2887,7 @@
 
 @findex mh-pipe-msg
 @kindex |
+@kindex l
 
 You can also pipe the message through a Unix shell command with the
 command @kbd{|} (@code{mh-pipe-msg}). You are prompted for the Unix
@@ -2744,6 +2916,8 @@
 directory for storing the content of these messages.
 
 @findex mh-store-buffer
+@kindex @key{RET}
+@kindex X s
 
 By the way, @kbd{X s} calls the Emacs Lisp function
 @code{mh-store-buffer}. I mention this because you can use it directly
@@ -2764,11 +2938,11 @@
 @findex mh-next-unread-msg
 @findex mh-previous-undeleted-msg
 @findex mh-previous-unread-msg
+@kindex g
 @kindex M-<
 @kindex M->
 @kindex M-n
 @kindex M-p
-@kindex g
 @kindex n
 @kindex p
 
@@ -2792,6 +2966,7 @@
 @findex previous-line
 @kindex C-n
 @kindex C-p
+@kindex @key{RET}
 
 You can also use the Emacs commands @kbd{C-p} (@code{previous-line})
 and @kbd{C-n} (@code{next-line}) to move up and down the scan lines in
@@ -2801,6 +2976,8 @@
 @cindex deleting messages
 @findex mh-delete-msg
 @kindex d
+@kindex n
+@kindex p
 
 To mark a message for deletion, use the command @kbd{d}
 (@code{mh-delete-msg}). A @samp{D} is placed by the message in the
@@ -2822,7 +2999,11 @@
 
 @findex mh-delete-subject
 @findex mh-delete-subject-or-thread
+@findex mh-thread-delete
+@findex mh-undo
 @kindex k
+@kindex T d
+@kindex u
 
 And to delete more messages faster, you can use @kbd{k}
 (@code{mh-delete-subject-or-thread}) to delete all the messages with
@@ -2861,6 +3042,8 @@
 an editable buffer. When you are done editing, save and kill the
 buffer as you would any other.
 
+@findex mh-kill-folder
+@findex mh-pack-folder
 @vindex mh-do-not-confirm-flag
 
 Commands such as @code{mh-pack-folder} prompt to confirm whether to
@@ -2960,7 +3143,11 @@
 @node Folders, Sending Mail, Reading Mail, Top
 @chapter Organizing Your Mail with Folders
 
+@cindex @samp{Folder} menu
+@cindex @samp{Message} menu
 @cindex folders
+@cindex menu, @samp{Folder}
+@cindex menu, @samp{Message}
 @cindex using folders
 
 This chapter discusses the things you can do with folders within MH-E.
@@ -3214,6 +3401,8 @@
 @samp{To:} face.
 @end vtable
 
+@vindex mh-folder-mode-hook
+
 The hook @code{mh-folder-mode-hook} is called when visiting a new
 folder in MH-Folder mode. This could be used to set your own key
 bindings, for example:
@@ -3268,15 +3457,20 @@
 be prompted to create it. The hook @code{mh-refile-msg-hook} is called
 after a message is marked to be refiled.
 
+@findex mh-write-msg-to-file
+@kindex !
+
 If you are refiling several messages into the same folder, you can use
 the command @kbd{!} (@code{mh-refile-or-write-again}) to repeat the
-last refile or write (see the description of @kbd{>}
-(@code{mh-write-msg-to-file} in @ref{Files and Pipes}). You can use a
+last refile or write (for the description of @kbd{>}
+(@code{mh-write-msg-to-file}), @pxref{Files and Pipes}). You can use a
 range in either case (for example, @kbd{C-u o 1 3 5-7 last:5 frombob
 @key{RET}}, @pxref{Ranges}).
 
 @cindex expunging refiles and deletes
 @cindex undoing refiles and deletes
+@findex mh-undo
+@kindex u
 
 If you've deleted a message or refiled it, but changed your mind, you
 can cancel the action before you've executed it. Use @kbd{u}
@@ -3284,9 +3478,15 @@
 You can also undo refiles and deletes for messages that are found in a
 given range (@pxref{Ranges}).
 
+@findex mh-undo-folder
+@kindex F u
+
 Alternatively, you can use @kbd{F u} (@code{mh-undo-folder}) to undo
 all refiles and deletes in the current folder.
 
+@findex mh-execute-commands
+@kindex x
+
 If you've marked messages to be deleted or refiled and you want to go
 ahead and delete or refile the messages, use @kbd{x}
 (@code{mh-execute-commands}). Many MH-E commands that may affect the
@@ -3295,6 +3495,10 @@
 @kbd{x} for you or undo the pending refiles and deletes, which are
 lost.
 
+@kindex x
+@vindex mh-after-commands-processed-hook
+@vindex mh-before-commands-processed-hook
+
 The command @kbd{x} runs @code{mh-before-commands-processed-hook}
 before the commands are processed and
 @code{mh-after-commands-processed-hook} after the commands are
@@ -3306,6 +3510,10 @@
 affected by deletes and refiles. This list will always include the
 current folder @code{mh-current-folder}.
 
+@findex mh-copy-msg
+@kindex c
+@kindex o
+
 If you wish to copy a message to another folder, you can use the
 command @kbd{c} (@code{mh-copy-msg}) (see the @option{-link} argument
 to @command{refile}(1)). Like the command @kbd{o}, this command
@@ -3314,12 +3522,14 @@
 takes place immediately. The original copy remains in the current
 folder.
 
-@cindex MH-Folder Show mode
+@cindex junk mail
 @cindex MH-Folder mode
-@cindex junk mail
+@cindex MH-Folder Show mode
 @cindex modes, MH-Folder
 @cindex modes, MH-Folder Show
 @cindex spam
+@findex mh-toggle-showing
+@kindex t
 
 The command @kbd{t} (@code{mh-toggle-showing}) switches between
 MH-Folder mode and MH-Folder Show mode@footnote{For you Emacs wizards,
@@ -3334,6 +3544,7 @@
 @cindex modes, MH-Folder
 @cindex modes, MH-Show
 @cindex moving between messages
+@kindex t
 @vindex mh-recenter-summary-flag
 
 When you use @kbd{t} to toggle between show mode and scan mode, the
@@ -3343,6 +3554,10 @@
 cursor at the middle. The effect of @code{mh-recenter-summary-flag} is
 rather useful, but it can be annoying on a slow network connection.
 
+@findex mh-visit-folder
+@kindex F v
+@vindex mh-large-folder
+
 When you want to read the messages that you have refiled into folders,
 use the command @kbd{F v} (@code{mh-visit-folder}) to visit the
 folder. You are prompted for the folder name. The folder buffer will
@@ -3356,15 +3571,18 @@
 this command can also be used to create folders. If you specify a
 folder that does not exist, you will be prompted to create it.
 
+@findex mh-search
+@kindex F s
+
 If you forget where you've refiled your messages, you can find them
 using @kbd{F s} (@code{mh-search}). @xref{Searching}.
 
 @cindex @command{procmail}
 @cindex @command{rcvstore}
+@cindex MH commands, @command{rcvstore}
 @cindex @samp{unseen} sequence
-@cindex MH commands, @command{rcvstore}
+@cindex sequence, @samp{unseen}
 @cindex Unix commands, @command{procmail}
-@cindex sequence, @samp{unseen}
 @cindex unseen messages, viewing
 @findex mh-index-new-messages
 @kindex F n
@@ -3382,6 +3600,9 @@
 @cindex @samp{tick} sequence
 @cindex sequence, @samp{tick}
 @cindex ticked messages, viewing
+@findex mh-index-ticked-messages
+@kindex F '
+@vindex mh-ticked-messages-folders
 
 If you have ticked messages (@pxref{Sequences}), you can display them
 using the command @kbd{F '} (@code{mh-index-ticked-messages}). All
@@ -3400,14 +3621,28 @@
 With a prefix argument, enter a space-separated list of folders at the
 prompt, or nothing to search all folders.
 
+@vindex mh-new-messages-folders
+@vindex mh-recursive-folders-flag
+@vindex mh-ticked-messages-folders
+
 Set the options @code{mh-new-messages-folders} and
 @code{mh-ticked-messages-folders} to @samp{Inbox} to search the
 @samp{+inbox} folder or @samp{All} to search all of the top level
 folders. Otherwise, list the folders that should be searched with the
 @samp{Choose Folders} menu item. See @code{mh-recursive-folders-flag}.
 
+@cindex buffers, @samp{*MH-E Folders*}
 @cindex @samp{*MH-E Folders*}
-@cindex buffers, @samp{*MH-E Folders*}
+@findex mh-kill-folder
+@findex mh-list-folders
+@findex mh-pack-folder
+@findex mh-rescan-folder
+@findex mh-sort-folder
+@kindex F k
+@kindex F l
+@kindex F p
+@kindex F r
+@kindex F S
 
 Other commands you can perform on folders include: @kbd{F l}
 (@code{mh-list-folders}), to place a listing of all the folders in
@@ -3422,11 +3657,16 @@
 you don't want to rescan the entire folder, the commands @kbd{F r} or
 @kbd{F p} will accept a range (@pxref{Ranges}).
 
+@kindex @key{TAB}
+@vindex mh-recursive-folders-flag
+
 By default, operations on folders work only one level at a time. Set
 @code{mh-recursive-folders-flag} to non-@code{nil} to operate on all
 folders. This mostly means that you'll be able to see all your folders
 when you press @key{TAB} when prompted for a folder name.
 
+@findex mh-search-p
+@kindex k
 @vindex mh-kill-folder-suppress-prompt-hooks
 
 The hook @code{mh-kill-folder-suppress-prompt-hooks} is an abnormal
@@ -3449,10 +3689,12 @@
 
 @cindex @command{sortm}
 @cindex @file{.mh_profile}
-@cindex @samp{sortm:} MH profile component
+@cindex files, @file{.mh_profile}
 @cindex MH commands, @command{sortm}
 @cindex MH profile component, @samp{sortm:}
-@cindex files, @file{.mh_profile}
+@cindex @samp{sortm:} MH profile component
+@kindex F S
+@vindex mh-sortm-args
 
 The option @code{mh-sortm-args} holds extra arguments to pass on to
 the command @command{sortm}@footnote{See the section
@@ -3464,7 +3706,8 @@
 
 @cindex exiting
 @cindex quitting
-@findex mh-rmail
+@findex mh-quit
+@kindex q
 
 When you want to quit using MH-E and go back to editing, you can use
 the @kbd{q} (@code{mh-quit}) command. This buries the buffers of the
@@ -3475,18 +3718,20 @@
 selecting the @samp{+inbox} buffer or by running @kbd{M-x mh-rmail}
 again.
 
+@findex mh-execute-commands
+@kindex q
 @vindex mh-before-quit-hook
 @vindex mh-quit-hook
 
 The two hooks @code{mh-before-quit-hook} and @code{mh-quit-hook} are
-called by @kbd{q} (@code{mh-quit}). The former one is called before
-the quit occurs, so you might use it to perform any MH-E operations;
-you could perform some query and abort the quit or call
-@code{mh-execute-commands}, for example. The latter is not run in an
-MH-E context, so you might use it to modify the window setup. For
-example, if the window configuration was saved as in the example in
-@ref{Miscellaneous Commands and Options}, you would also want to set
-@code{mh-quit-hook} to the following:
+called by @kbd{q}. The former one is called before the quit occurs, so
+you might use it to perform any MH-E operations; you could perform
+some query and abort the quit or call @code{mh-execute-commands}, for
+example. The latter is not run in an MH-E context, so you might use it
+to modify the window setup. For example, if the window configuration
+was saved as in the example in @ref{Miscellaneous Commands and
+Options}, you would also want to set @code{mh-quit-hook} to the
+following:
 
 @c XXX Replace this with my example for killing the mail buffers.
 
@@ -3508,8 +3753,8 @@
 
 @cindex folders, renaming
 @cindex renaming folders
+@findex dired
 @findex dired-do-rename
-@kindex R
 
 You can use dired to manipulate the folders themselves. For example, I
 renamed my @samp{+out} folder to the more common @samp{+outbox} by
@@ -3522,6 +3767,7 @@
 
 @cindex sending mail
 @findex mh-smail
+@kindex M-x mh-smail
 
 You can send a mail message in several ways. You can call @kbd{M-x
 mh-smail} directly, or from the command line like this:
@@ -3540,6 +3786,9 @@
 commands use MH-E by setting the option @code{mail-user-agent} to
 @samp{Emacs interface to MH}.
 
+@cindex @samp{Message} menu
+@cindex menu, @samp{Message}
+
 From within MH-E's MH-Folder mode, other methods of sending mail are
 available as well. These can also be found in the @samp{Message} menu.
 
@@ -3616,7 +3865,7 @@
 @samp{off}).
 @c -------------------------
 @item mh-forward-subject-format
-Format string for forwarded message subject (default: @samp{"%s:
+Format string for forwarded message subject (default: @code{"%s:
 %s"}).
 @c -------------------------
 @item mh-insert-x-mailer-flag
@@ -3671,6 +3920,8 @@
 @cindex sending mail
 @findex mh-smail
 @findex mh-smail-other-window
+@kindex M-x mh-smail
+@kindex M-x mh-smail-other-window
 
 Outside of an MH-Folder buffer, you must call either @kbd{M-x
 mh-smail} or @kbd{M-x mh-smail-other-window} to compose a new message.
@@ -3684,25 +3935,24 @@
 (global-set-key "\C-x4m" 'mh-smail-other-window)
 @end smalllisp
 
+@cindex draft folder
 @cindex MH-Letter mode
-@cindex draft folder
 @cindex modes, MH-Letter
 @findex mh-send
 @kindex m
 
 From within a MH-Folder buffer, you can simply use the command @kbd{m}
 (@code{mh-send}). However you invoke @code{mh-send}, your letter
-appears in an Emacs buffer whose mode is MH-Letter (see the Figure in
-@ref{Sending Mail Tour} to see what the buffer looks like). MH-Letter
-mode allows you to edit your message, to check the validity of the
-recipients, to insert attachments and other messages into your
-message, and to send the message. We'll go more into depth about
-editing a @dfn{draft}@footnote{I highly recommend that you use a
-@dfn{draft folder} so that you can edit several drafts in parallel. To
-do so, create a folder named @samp{+drafts} for example, and add the
-profile component @samp{Draft-Folder: drafts} (see
-@code{mh-profile}(5)).} (a message you're composing) in just a moment
-(@pxref{Editing Drafts}).
+appears in an Emacs buffer whose mode is MH-Letter (to see what the
+buffer looks like, @pxref{Sending Mail Tour}). MH-Letter mode allows
+you to edit your message, to check the validity of the recipients, to
+insert attachments and other messages into your message, and to send
+the message. We'll go more into depth about editing a
+@dfn{draft}@footnote{I highly recommend that you use a @dfn{draft
+folder} so that you can edit several drafts in parallel. To do so,
+create a folder named @samp{+drafts} for example, and add the profile
+component @samp{Draft-Folder: drafts} (see @code{mh-profile}(5)).} (a
+message you're composing) in just a moment (@pxref{Editing Drafts}).
 
 @vindex mh-compose-prompt-flag
 
@@ -3710,8 +3960,8 @@
 before the MH-Letter buffer appears, turn on the option
 @code{mh-compose-prompt-flag}.
 
+@cindex header field, @samp{X-Mailer:}
 @cindex @samp{X-Mailer:} header field
-@cindex header field, @samp{X-Mailer:}
 @vindex mh-insert-x-mailer-flag
 
 MH-E adds an @samp{X-Mailer:} header field to the header that includes
@@ -3722,8 +3972,10 @@
 @cindex @command{repl}
 @cindex @file{components}
 @cindex MH commands, @command{repl}
+@cindex MH-Letter mode
 @cindex Mail mode
 @cindex files, @file{components}
+@cindex modes, MH-Letter
 @cindex modes, Mail
 @vindex mail-mode-hook
 @vindex mh-letter-mode-hook
@@ -3738,9 +3990,7 @@
 to modify the header after @command{repl} has done its work, or you
 may have a complicated @file{components} file and need to tell MH-E
 where the cursor should go. Here's an example of how you would use
-this hook. You can add the hook using @code{add-hook} or by running
-@kbd{M-x customize-option @key{RET} mh-letter-mode-hook
-@key{RET}}---all of the other hooks are set in a similar fashion.
+this hook.
 
 @findex mh-insert-signature, example
 
@@ -3764,8 +4014,6 @@
     (goto-char (point-max))             ; @r{go to end of message to}
     (mh-insert-signature)))             ;   @r{insert signature}
 
-(add-hook 'mh-letter-mode-hook 'my-mh-letter-mode-hook)
-
 @i{Prepare draft for editing via mh-letter-mode-hook}
 
 @end group
@@ -3775,6 +4023,7 @@
 @ref{Adding Attachments}.
 
 @vindex mh-compose-letter-function
+@vindex mh-letter-mode-hook
 
 The second hook, a function really, is
 @code{mh-compose-letter-function}. Like @code{mh-letter-mode-hook}, it
@@ -3853,6 +4102,8 @@
 Another way to include the message automatically in your draft is to
 use @samp{repl: -filter repl.filter} in your MH profile.
 
+@vindex mh-reply-show-message-flag
+
 If you include the message automatically, you can hide the MH-Show
 buffer by turning off the option @code{mh-reply-show-message-flag}.
 
@@ -3872,9 +4123,9 @@
 @section Forwarding Mail
 
 @cindex @command{forw}
-@cindex MH commands, @command{forw}
 @cindex draft
 @cindex forwarding
+@cindex MH commands, @command{forw}
 @findex mh-forward
 @kindex f
 @vindex mh-forward-hook
@@ -3890,9 +4141,9 @@
 hook @code{mh-forward-hook} is called on the draft.
 
 @cindex @file{.mh_profile}
-@cindex @samp{forw:} MH profile component
+@cindex files, @file{.mh_profile}
 @cindex MH profile component, @samp{forw:}
-@cindex files, @file{.mh_profile}
+@cindex @samp{forw:} MH profile component
 @vindex mh-compose-forward-as-mime-flag
 
 By default, the option @code{mh-compose-forward-as-mime-flag} is on
@@ -3912,7 +4163,7 @@
 option is a string which includes two escapes (@samp{%s}). The first
 @samp{%s} is replaced with the sender of the original message, and the
 second one is replaced with the original @samp{Subject:}. The default
-value of @samp{"%s: %s"} takes a message with the header:
+value of @code{"%s: %s"} takes a message with the header:
 
 @smallexample
 @group
@@ -3943,6 +4194,9 @@
 the recipient as if the message had come from the original sender.
 When you run this command, you are prompted for the recipients.
 
+@findex mh-edit-again
+@kindex e
+
 For more information on redistributing messages, see
 @command{dist}(1). Also investigate the command @kbd{e}
 (@code{mh-edit-again}) for another way to redistribute messages
@@ -3969,7 +4223,9 @@
 @cindex files, @file{draft}
 @cindex re-editing drafts
 @findex mh-edit-again
+@kindex F v drafts
 @kindex e
+@kindex n
 
 If you don't complete a draft for one reason or another, and if the
 draft buffer is no longer available, you can pick your draft up again
@@ -3979,11 +4235,14 @@
 @key{RET}}, use @kbd{n} to move to the appropriate message, and then
 use @kbd{e} to prepare the message for editing.
 
+@kindex e
+
 The @kbd{e} command can also be used to take messages that were sent
 to you and to send them to more people.
 
 @cindex Mailer-Daemon
 @findex mh-extract-rejected-mail
+@kindex C-c C-c
 @kindex E
 
 Don't use @kbd{e} to re-edit a message from a @i{Mailer-Daemon} who
@@ -3996,9 +4255,11 @@
 @node Editing Drafts, Aliases, Sending Mail, Top
 @chapter Editing a Draft
 
+@cindex @samp{Letter} menu
 @cindex MH-Letter mode
 @cindex draft
 @cindex editing draft
+@cindex menu, @samp{Letter}
 @cindex modes, MH-Letter
 
 When you edit a message that you want to send (called a @dfn{draft} in
@@ -4310,11 +4571,11 @@
 @c -------------------------
 @item mh-extract-from-attribution-verb
 Verb to use for attribution when a message is yanked by @kbd{C-c C-y}
-(default: @samp{"wrote:"}).
+(default: @code{"wrote:"}).
 @c -------------------------
 @item mh-ins-buf-prefix
 String to put before each line of a yanked or inserted message
-(default: @samp{"> "}).
+(default: @code{"> "}).
 @c -------------------------
 @item mh-letter-complete-function
 Function to call when completing outside of address or folder fields
@@ -4328,7 +4589,7 @@
 support for it is available; otherwise @samp{None}).
 @c -------------------------
 @item mh-signature-file-name
-Source of user's signature (default: @samp{"~/.signature"}).
+Source of user's signature (default: @code{"~/.signature"}).
 @c -------------------------
 @item mh-signature-separator-flag
 On means a signature separator should be inserted (default:
@@ -4336,7 +4597,7 @@
 @c -------------------------
 @item mh-x-face-file
 File containing X-Face or Face header field to insert in outgoing mail.
-(default: @samp{"~/.face"}).
+(default: @code{"~/.face"}).
 @c -------------------------
 @item mh-yank-behavior
 Controls which part of a message is yanked by @kbd{C-c C-y} (default:
@@ -4433,8 +4694,8 @@
 @findex indent-relative
 @findex mh-letter-next-header-field-or-indent
 @findex mh-letter-previous-header-field
+@kindex @key{TAB}
 @kindex S-@key{TAB}
-@kindex @key{TAB}
 @vindex mh-compose-skipped-header-fields
 @vindex mh-letter-header-field
 
@@ -4460,8 +4721,10 @@
 @findex mh-letter-complete-or-space
 @findex mh-letter-confirm-address
 @kindex , (comma)
+@kindex @key{SPC}
 @kindex M-@key{TAB}
-@kindex @key{SPC}
+@vindex mh-alias-flash-on-comma
+@vindex mh-compose-space-does-completion-flag
 @vindex mh-letter-complete-function
 
 If the field contains addresses (for example, @samp{To:} or
@@ -4480,10 +4743,11 @@
 the alias expansion in the minibuffer if
 @code{mh-alias-flash-on-comma} is turned on.
 
-@kindex C-c C-t
-@findex mh-letter-toggle-header-field-display
 @c XXX Document the replacement for the inaccessible 'long argument.
  
+@findex mh-letter-toggle-header-field-display
+@kindex C-c C-t
+
 Use the command @kbd{C-c C-t}
 @code{mh-letter-toggle-header-field-display} to display truncated
 header fields. This command is a toggle so entering it again will hide
@@ -4566,6 +4830,7 @@
 @cindex yanking messages
 @findex mh-yank-cur-msg
 @kindex C-c C-y
+@vindex mh-ins-buf-prefix
 
 It is often useful to insert a snippet of text from a letter that
 someone mailed to provide some context for your reply. The command
@@ -4592,9 +4857,11 @@
 @samp{wrote:}, @samp{a écrit:}, and @samp{schrieb:}. You can also use
 the @samp{Custom String} menu item to enter your own verb.
 
+@vindex mail-citation-hook
 @vindex mh-ins-buf-prefix
-
-The prefix @samp{"> "} is the default setting for the option
+@vindex mh-yank-behavior
+
+The prefix @code{"> "} is the default setting for the option
 @code{mh-ins-buf-prefix}. I suggest that you not modify this option
 since it is used by many mailers and news readers: messages are far
 easier to read if several included messages have all been indented by
@@ -4608,9 +4875,11 @@
 option to delete the window containing the original message after
 yanking it to make more room on your screen for your reply.
 
-@vindex mh-yank-behavior
 @cindex Emacs, packages, supercite
 @cindex supercite package
+@kindex r
+@vindex mail-citation-hook
+@vindex mh-yank-behavior
 
 You can control how the message to which you are replying is yanked
 into your reply using @code{mh-yank-behavior}. To include the entire
@@ -4628,11 +4897,16 @@
 full-bodied, full-featured, citation package that comes standard with
 Emacs.} to pass the entire message and header through supercite.
 
+@vindex mh-extract-from-attribution-verb
+
 If the @samp{Body With Attribution} setting is used, then the message
 minus the header is yanked and a simple attribution line is added at
 the top using the value of the option
 @code{mh-extract-from-attribution-verb}. This is the default.
 
+@kindex C-c C-y
+@vindex mh-delete-yanked-msg-window-flag
+
 If the @samp{Invoke supercite} or @samp{Body With Attribution}
 settings are used, the @samp{-noformat} argument is passed to the
 @command{repl} program to override a @samp{-filter} or @samp{-format}
@@ -4644,12 +4918,16 @@
 @code{mh-delete-yanked-msg-window-flag} as well so that the show
 window is never displayed.
 
+@vindex mh-yank-behavior
+
 If the show buffer has a region, the option @code{mh-yank-behavior} is
 ignored unless its value is one of @samp{Attribution} variants in
 which case the attribution is added to the yanked region.
 
 @findex trivial-cite
 @vindex mail-citation-hook
+@vindex mh-ins-buf-prefix
+@vindex mh-yank-behavior
 
 If this isn't enough, you can gain full control over the appearance of
 the included text by setting @code{mail-citation-hook} to a function
@@ -4661,6 +4939,10 @@
 for the next hook function. The standard prefix
 @code{mh-ins-buf-prefix} is not added if this hook is set.
 
+@cindex Emacs, packages, trivial-cite
+@cindex trivial-cite package
+@vindex mh-yank-behavior
+
 For example, if you use the hook function
 @uref{http://shasta.cs.uiuc.edu/~lrclause/tc.html,
 @code{trivial-cite}} (which is NOT part of Emacs), set
@@ -4675,6 +4957,7 @@
 @kindex C-c C-i
 @vindex mh-ins-buf-prefix
 @vindex mh-invisible-header-fields-compiled
+@vindex mh-yank-behavior
 
 Messages can be inserted with @kbd{C-c C-i} (@code{mh-insert-letter}).
 This command prompts you for the folder and message number, which
@@ -4701,8 +4984,8 @@
 You can insert your signature at the current cursor location with the
 command @kbd{C-c C-s} (@code{mh-insert-signature}).
 
+@cindex files, @file{.signature}
 @cindex @file{.signature}
-@cindex files, @file{.signature}
 @cindex vCard
 @vindex mh-signature-file-name
 
@@ -4712,6 +4995,7 @@
 @dfn{vCard} in which case an attachment is added with the vCard.
 
 @findex mh-signature-separator-p
+@vindex mh-signature-file-name
 @vindex mh-signature-separator
 @vindex mh-signature-separator-regexp
 
@@ -4727,7 +5011,7 @@
 @cindex signature separator
 @vindex mh-signature-separator-flag
 
-A signature separator (@samp{"-- "}) will be added if the signature
+A signature separator (@code{"-- "}) will be added if the signature
 block does not contain one and @code{mh-signature-separator-flag} is
 on. It is not recommended that you change this option since various
 mail user agents, including MH-E, use the separator to present the
@@ -4735,6 +5019,7 @@
 yanking a letter into a draft.
 
 @vindex mh-insert-signature-hook
+@vindex mh-signature-file-name
 
 The hook @code{mh-insert-signature-hook} is run after the signature is
 inserted. Hook functions may access the actual name of the file or the
@@ -4786,6 +5071,8 @@
 The URL of any image can be used for the @samp{X-Image-URL:} field and
 no processing of the image is required.
 
+@vindex mh-x-face-file
+
 To prevent the setting of any of these header fields, either set
 @code{mh-x-face-file} to @code{nil}, or simply ensure that the file
 defined by this option doesn't exist.
@@ -4810,6 +5097,8 @@
 binary files, and even commands that fetch a file with @samp{ftp} when
 your recipient reads the message!
 
+@kindex C-c C-m
+
 If you were to create a multimedia message with plain MH commands, you
 would insert @command{mhbuild} or @command{mhn} directives (henceforth
 called @dfn{MH-style directives} into your draft and use the
@@ -4855,8 +5144,8 @@
 
 @cindex @command{file}
 @cindex @file{/etc/mime.types}
+@cindex files, @file{/etc/mime.types}
 @cindex Unix commands, @command{file}
-@cindex files, @file{/etc/mime.types}
 @findex mailcap-mime-types
 
 In the cases where MH-E can do so, it will determine the media type
@@ -4936,16 +5225,17 @@
 
 @subheading Including Files
 
+@cindex attachments, inserting
+@cindex images
 @cindex MIME, images
 @cindex MIME, sound
 @cindex MIME, video
-@cindex attachments, inserting
-@cindex images
 @cindex sound
 @cindex video
 @findex mh-compose-insertion
 @kindex C-c C-m C-i
 @kindex C-c C-m i
+@vindex mh-compose-insertion
 
 Binaries, images, sound, and video can be inserted in your message
 with the command @kbd{C-c C-m C-i} (@code{mh-compose-insertion}). You
@@ -4988,7 +5278,9 @@
 @cindex MIME, @command{tar}
 @cindex Unix commands, @command{ftp}
 @cindex Unix commands, @command{tar}
+@findex mh-mh-compose-anon-ftp
 @findex mh-mh-compose-external-compressed-tar
+@kindex C-c C-m C-g
 @kindex C-c C-m C-t
 @kindex C-c C-m t
 
@@ -5049,6 +5341,9 @@
 Typically, you send a message with attachments just like any other
 message (@pxref{Sending Message}).
 
+@findex mh-mml-to-mime
+@kindex C-c C-m C-m
+
 However, you may take a sneak preview of the @sc{mime} encoding if you
 wish by running the command @kbd{C-c C-m C-m} (@code{mh-mml-to-mime}).
 The following screen shows the @sc{mime} encoding specified by the
@@ -5081,15 +5376,19 @@
 @end cartouche
 @i{MH-E @sc{mime} draft ready to send}
 
+@cindex undo effects of mh-mml-to-mime
+
 This action can be undone by running @kbd{C-_} (@code{undo}).
 
 @cindex @command{mhbuild}
 @cindex @command{mhn}
 @cindex MH commands, @command{mhbuild}
 @cindex MH commands, @command{mhn}
+@cindex undo effects of mh-mh-to-mime
 @findex mh-mh-to-mime
 @findex mh-mh-to-mime-undo
 @kindex C-c C-e
+@kindex C-c C-m C-m
 @kindex C-c C-m C-u
 @kindex C-c C-m u
 
@@ -5104,6 +5403,7 @@
 confirmation by adding an argument (for example, @kbd{C-u C-c C-m
 C-u}).
 
+@kindex C-c C-e
 @vindex mh-mh-to-mime-args
 
 If you wish to pass additional arguments to @command{mhbuild}
@@ -5113,13 +5413,14 @@
 @samp{-check}. The recipient of your message can then run
 @samp{mhbuild -check} on the message---@command{mhbuild}
 (@command{mhn}) will complain if the message has been corrupted on the
-way. The command @kbd{C-c C-e} (@code{mh-mh-to-mime}) only consults
-this option when given a prefix argument (as in @kbd{C-u C-c C-e}).
-
+way. The command @kbd{C-c C-e} only consults this option when given a
+prefix argument (as in @kbd{C-u C-c C-e}).
+
+@kindex C-c C-e
 @vindex mh-mh-to-mime-hook
 
 The hook @code{mh-mh-to-mime-hook} is called after the message has
-been formatted by @kbd{C-c C-e} (@code{mh-mh-to-mime})
+been formatted by @kbd{C-c C-e}.
 
 @node Sending PGP, Checking Recipients, Adding Attachments, Editing Drafts
 @section Signing and Encrypting Messages
@@ -5169,6 +5470,7 @@
 @findex mh-mml-unsecure-message
 @kindex C-c C-m C-n
 @kindex C-c C-m n
+@vindex mh-mml-method-default
 
 This is used to sign and encrypt your message. In each of these cases,
 a proper multipart message is created for you when you send the
@@ -5202,8 +5504,8 @@
 @cite{The PGG Manual}}.
 @end ifhtml
 
+@cindex header field, @samp{Fcc:}
 @cindex @samp{Fcc:} header field
-@cindex header field, @samp{Fcc:}
 @vindex pgg-encrypt-for-me
 
 In particular, I turn on the option @code{pgg-encrypt-for-me} so that
@@ -5233,8 +5535,8 @@
 @node Sending Message, Killing Draft, Checking Recipients, Editing Drafts
 @section Sending a Message
 
+@cindex buffers, @samp{*MH-E Mail Delivery*}
 @cindex @samp{*MH-E Mail Delivery*}
-@cindex buffers, @samp{*MH-E Mail Delivery*}
 @cindex sending mail
 @findex mh-send-letter
 @kindex C-c C-c
@@ -5247,6 +5549,8 @@
 
 @cindex sending mail
 @cindex spell check
+@findex ispell-message
+@kindex C-c C-c
 @vindex mh-before-send-letter-hook
 
 The hook @code{mh-before-send-letter-hook} is run at the beginning of
@@ -5350,7 +5654,7 @@
 @c -------------------------
 @item mh-alias-local-users-prefix
 String prefixed to the real names of users from the password file
-(default: @samp{"local."}.
+(default: @code{"local."}.
 @c -------------------------
 @item mh-alias-passwd-gecos-comma-separator-flag
 On means the GECOS field in the password file uses a comma separator
@@ -5365,12 +5669,14 @@
 @code{nil}).
 @end vtable
 
-@heading Adding Addresses to Draft
+@subheading Adding Addresses to Draft
 
 You can use aliases when you are adding recipients to a message.
 
 @findex minibuffer-complete
 @kindex @key{TAB}
+@vindex mh-alias-expand-aliases-flag
+@vindex mh-compose-prompt-flag
 
 In order to use minibuffer prompting for recipients and the subject
 line in the minibuffer, turn on the option
@@ -5380,10 +5686,17 @@
 on the option @code{mh-alias-expand-aliases-flag} if you want these
 aliases to be expanded to their respective addresses in the draft.
 
+@findex mh-letter-complete
+@findex mh-letter-complete-or-space
+@kindex @key{SPC}
+@kindex M-@key{TAB}
+
 Otherwise, you can complete aliases in the header of the draft with
 @kbd{M-@key{TAB}} (@code{mh-letter-complete}) or @key{SPC}
 (@code{mh-letter-complete-or-space}).
 
+@vindex mh-alias-completion-ignore-case-flag
+
 As MH ignores case in the aliases, so too does MH-E. However, you may
 turn off the option @code{mh-alias-completion-ignore-case-flag} to
 make case significant which can be used to segregate completion of
@@ -5402,6 +5715,11 @@
 only. If you were to enter @kbd{Mark.Baushke}, it would still be
 identified with your @samp{mark.baushke} alias.
 
+@findex mh-alias-minibuffer-confirm-address
+@findex mh-letter-confirm-address
+@vindex mh-alias-flash-on-comma
+@vindex mh-compose-prompt-flag
+
 To verify that the alias you've entered is valid, the alias will be
 displayed in the minibuffer when you type a comma
 (@code{mh-letter-confirm-address} or
@@ -5415,7 +5733,7 @@
 For another way to verify the alias expansion, see @ref{Checking
 Recipients}.
 
-@heading Loading Aliases
+@subheading Loading Aliases
 
 @cindex @command{ali}
 @cindex @file{/etc/nmh/MailAliases}
@@ -5441,6 +5759,8 @@
 name is present in the password file. Otherwise, the alias will have
 the form @samp{local.@var{login}}.
 
+@vindex mh-alias-local-users-prefix
+
 The prefix @samp{local.} can be modified via the option
 @code{mh-alias-local-users-prefix}. This option can also be set to
 @samp{Use Login}.
@@ -5451,6 +5771,8 @@
 psg:x:1000:1000:Peter S Galbraith,,,:/home/psg:/bin/tcsh
 @end example
 
+@vindex mh-alias-local-users-prefix
+
 The following settings of option @code{mh-alias-local-users-prefix}
 will produce the associated aliases:
 
@@ -5465,6 +5787,8 @@
 psg
 @end table
 
+@vindex mh-alias-passwd-gecos-comma-separator-flag
+
 In the example above, commas are used to separate different values
 within the so-called GECOS field. This is a fairly common usage.
 However, in the rare case that the GECOS field in your password file
@@ -5472,8 +5796,9 @@
 can turn the option @code{mh-alias-passwd-gecos-comma-separator-flag}
 off.
 
+@cindex NIS, obtaining local aliases from
 @cindex @samp{ypcat passwd}
-@cindex NIS, obtaining local aliases from
+@vindex mh-alias-local-users
 
 If you're on a system with thousands of users you don't know, and the
 loading of local aliases slows MH-E down noticeably, then the local
@@ -5482,18 +5807,25 @@
 executed to generate the password file. For example, use @samp{ypcat
 passwd} to obtain the NIS password file.
 
+@findex mh-alias-reload
+@kindex M-x mh-alias-reload
+@vindex mh-alias-reloaded-hook
+
 Since aliases are updated frequently, MH-E reloads aliases
 automatically whenever an alias lookup occurs if an alias source has
 changed. However, you can reload your aliases manually by calling the
 command @kbd{M-x mh-alias-reload} directly. This command runs
 @code{mh-alias-reloaded-hook} after the aliases have been loaded.
 
-@heading Adding Aliases
+@subheading Adding Aliases
 
 In the past, you have manually added aliases to your alias file(s)
 listed in your @samp{Aliasfile:} profile component. MH-E provides
 other methods for maintaining your alias file(s).
 
+@findex mh-alias-add-alias
+@kindex M-x mh-alias-add-alias
+
 You can use the @kbd{M-x mh-alias-add-alias} command which will prompt
 you for the alias and address that you would like to add. If the alias
 exists already, you will have the choice of inserting the new alias
@@ -5525,6 +5857,9 @@
 completion. If you forget the name of an old dive buddy, you can enter
 @samp{div} and then @key{SPC} to get a listing of all your dive buddies.
 
+@kindex M-x mh-alias-add-address-under-point
+@kindex M-x mh-alias-grab-from-field
+
 An alias for the sender of the current message is added automatically
 by clicking on the @samp{Grab From alias} tool bar button or by running
 the @kbd{M-x mh-alias-grab-from-field} command. Aliases for other
@@ -5532,24 +5867,33 @@
 over the desired recipient and giving the @kbd{M-x
 mh-alias-add-address-under-point} command.
 
+@vindex mh-alias-insert-file
+@vindex mh-alias-insertion-location
+
 The options @code{mh-alias-insert-file} and
 @code{mh-alias-insertion-location} controls how and where these aliases
 are inserted.
 
-The default setting of this option is @samp{Use Aliasfile Profile
-Component}. This option can also hold the name of a file or a list a
-file names. If this option is set to a list of file names, or the
-@samp{Aliasfile:} profile component contains more than one file name,
-MH-E will prompt for one of them.
+@vindex mh-alias-insert-file
+
+The default setting of option @code{mh-alias-insert-file} is @samp{Use
+Aliasfile Profile Component}. This option can also hold the name of a
+file or a list a file names. If this option is set to a list of file
+names, or the @samp{Aliasfile:} profile component contains more than
+one file name, MH-E will prompt for one of them.
+
+@vindex mh-alias-insertion-location
 
 The option @code{mh-alias-insertion-location} is set to
 @samp{Alphabetical} by default. If you organize your alias file in
 other ways, then the settings @samp{Top} and @samp{Bottom} might be
 more appropriate.
 
-@heading Querying Aliases
+@subheading Querying Aliases
 
 @cindex regular expressions, @code{mh-alias-apropos}
+@findex mh-alias-apropos
+@kindex M-x mh-alias-apropos
 
 If you can't quite remember an alias, you can use @kbd{M-x
 mh-alias-apropos} to show all aliases or addresses that match a
@@ -5575,6 +5919,9 @@
 This means that you can easily have a different header and signature
 at home and at work.
 
+@cindex @samp{Identity} menu
+@cindex menu, @samp{Identity}
+
 A couple of commands are used to insert identities in MH-Letter mode
 which are also found in the @samp{Identity} menu.
 
@@ -5623,6 +5970,8 @@
 context are the @samp{From:} and @samp{Organization:} fields, as well
 as the signature.
 
+@vindex mh-identity-list
+
 This is done by customizing the option @code{mh-identity-list}. In the
 customization buffer for this option, click on the @samp{INS} button
 and enter a label such as @samp{Home} or @samp{Work}. Then click on
@@ -5666,18 +6015,21 @@
 
 @cindex Identity menu
 @cindex menu, Identity
+@findex mh-insert-identity
+@kindex C-c C-d
 
 You can select the identities you have added via the menu called
 @samp{Identity} in the MH-Letter buffer. You can also use @kbd{C-c
 C-d} (@code{mh-insert-identity}). To clear the fields and signature
 added by the identity, select the @samp{None} identity.
 
-@cindex @samp{Identity > Save as Default} menu item
+@cindex menu item, @samp{Identity > Customize Identities}
 @cindex menu item, @samp{Identity > Save as Default}
-@cindex @samp{Identity > Set Default for Session} menu item
 @cindex menu item, @samp{Identity > Set Default for Session}
 @cindex @samp{Identity > Customize Identities} menu item
-@cindex menu item, @samp{Identity > Customize Identities}
+@cindex @samp{Identity > Save as Default} menu item
+@cindex @samp{Identity > Set Default for Session} menu item
+@vindex mh-identity-default
 
 The @samp{Identity} menu contains two other items to save you from
 having to set the identity on every message. The menu item @samp{Set
@@ -5690,6 +6042,7 @@
 Identities} is available for your convenience.
 
 @cindex regular expressions, @code{mh-auto-fields-list}
+@vindex mh-auto-fields-list
 
 The option @code{mh-auto-fields-list} can also be used to set the
 identity depending on the recipient to provide even more control. To
@@ -5738,6 +6091,10 @@
 Other header fields may be added using this menu item. 
 @end table
 
+@findex mh-insert-auto-fields
+@kindex C-c M-d
+@vindex mh-auto-fields-prompt-flag
+
 These fields can only be added after the recipient is known. Because
 you can continue to add recipients as you edit the draft, MH-E waits
 until the message is sent to perform the auto-insertions. This seems
@@ -5754,10 +6111,16 @@
 manually. However, if you use this command, the automatic insertion
 when the message is sent is disabled.
 
+@vindex mh-auto-fields-list
+@vindex mh-identity-list
+
 You should avoid using the same header field in
 @code{mh-auto-fields-list} and @code{mh-identity-list} definitions
 that may apply to the same message as the result is undefined.
 
+@vindex mh-identity-handlers
+@vindex mh-identity-list
+
 The option @code{mh-identity-handlers} is used to change the way that
 fields, signatures, and attributions in @code{mh-identity-list} are
 added. To customize @code{mh-identity-handlers}, replace the name of
@@ -5766,6 +6129,8 @@
 click on an @samp{INS} button and insert a field of your choice and
 the name of the function you have written to handle it. 
 
+@vindex mh-identity-list
+
 The @samp{Field} field can be any field that you've used in your
 @code{mh-identity-list}. The special fields @samp{:attribution-verb},
 @samp{:signature}, or @samp{:pgg-default-user-id} are used for the
@@ -5786,6 +6151,10 @@
 
 @cindex folder navigation
 @cindex speedbar
+@findex mh-visit-folder
+@kindex F v
+@kindex M-x speedbar
+@kindex Mouse-2
 
 You can also use the speedbar 
 @ifnothtml
@@ -5832,6 +6201,10 @@
 count before the next automatic update (@code{mh-speed-refresh}).
 @end table
 
+@findex delete-frame
+@kindex C-x 5 0
+@kindex Mouse-3
+
 You can click on @kbd{Mouse-3} to bring up a context menu that
 contains these items. Dismiss the speedbar with @kbd{C-x 5 0}
 (@code{delete-frame}).
@@ -5874,8 +6247,12 @@
 @node Menu Bar, Tool Bar, Speedbar, Top
 @chapter The Menu Bar
 
-@cindex menu bar
-
+@cindex @samp{Folder} menu
+@cindex @samp{Identity} menu
+@cindex @samp{Letter} menu
+@cindex @samp{Message} menu
+@cindex @samp{Search} menu
+@cindex @samp{Sequence} menu
 @cindex Folder menu
 @cindex Identity menu
 @cindex Letter menu
@@ -5885,12 +6262,19 @@
 @cindex Message menu
 @cindex Search menu
 @cindex Sequence menu
+@cindex menu bar
 @cindex menu, Folder
 @cindex menu, Identity
 @cindex menu, Letter
 @cindex menu, Message
 @cindex menu, Search
 @cindex menu, Sequence
+@cindex menu, @samp{Folder}
+@cindex menu, @samp{Identity}
+@cindex menu, @samp{Letter}
+@cindex menu, @samp{Message}
+@cindex menu, @samp{Search}
+@cindex menu, @samp{Sequence}
 @cindex modes, MH-Folder
 @cindex modes, MH-Letter
 @cindex modes, MH-Search
@@ -5924,8 +6308,6 @@
 @chapter The Tool Bar
 
 @cindex tool bar
-@cindex @samp{mh-tool-bar} customization group
-@cindex customization group, @samp{mh-tool-bar}
 
 Emacs also provides a graphical tool bar. For a description of the
 tool bar, please
@@ -5938,6 +6320,9 @@
 Tool Bars} in @cite{The GNU Emacs Manual}.
 @end ifhtml
 
+@cindex @samp{mh-tool-bar} customization group
+@cindex customization group, @samp{mh-tool-bar}
+
 MH-E adds several icons to this tool bar; you can modify the MH-E
 aspects of the tool bar via the @samp{mh-tool-bar} customization group.
 
@@ -5965,6 +6350,9 @@
 bar. In XEmacs, you have the opportunity to create a separate tool bar for
 the MH-E icons.
 
+@vindex mh-tool-bar-folder-buttons
+@vindex mh-tool-bar-letter-buttons
+
 In either case, you can select which of these functions you'd like to
 see by customizing the options @code{mh-tool-bar-folder-buttons} and
 @code{mh-tool-bar-letter-buttons}. As you probably guessed, the former
@@ -5973,31 +6361,39 @@
 check the functions whose icons you want to see and clear the check
 boxes for those you don't.
 
+@findex mh-search
+@vindex mh-tool-bar-search-function
+
 The function associated with the searching icon can be set via the
 option @code{mh-tool-bar-search-function}. By default, this is set to
 @code{mh-search}. @xref{Searching}. You can also choose @samp{Other
 Function} from the @samp{Value Menu} and enter a function of your own
 choosing.
 
+@vindex mh-xemacs-use-tool-bar-flag
+
 XEmacs provides a couple of extra options. The first,
 @code{mh-xemacs-use-tool-bar-flag}, controls whether to show the MH-E
 icons at all. By default, this option is turned on if the window
 system supports tool bars. If your system doesn't support tool bars,
 then you won't be able to turn on this option.
 
+@vindex mh-xemacs-tool-bar-position
+
 The second extra option is @code{mh-xemacs-tool-bar-position} which
 controls the placement of the tool bar along the four edges of the
 frame. You can choose from one of @samp{Same As Default Tool Bar},
 @samp{Top}, @samp{Bottom}, @samp{Left}, or @samp{Right}. If this
 variable is set to anything other than @samp{Same As Default Tool Bar}
 and the default tool bar is in a different location, then two tool
-bars will be displayed: the MH-E tool bar and the default tool bar."
+bars will be displayed: the MH-E tool bar and the default tool bar.
 
 @node Searching, Threading, Tool Bar, Top
 @chapter Searching Through Messages
 
+@cindex @samp{Search} menu
+@cindex menu, @samp{Search}
 @cindex searching
-
 @findex mh-search
 @kindex F s
 
@@ -6141,12 +6537,18 @@
 Folder heading face in MH-Folder buffers created by searches.
 @end vtable
 
+@findex mh-search-folder
+@kindex F s
+
 The command @kbd{F s} (@code{mh-search-folder}) helps you find
 messages in your entire corpus of mail. You can search for messages to
 or from a particular person or about a particular subject. In fact,
 you can also search for messages containing selected strings in any
 arbitrary header field or any string found within the messages.
 
+@cindex @command{pick}
+@cindex MH commands, @command{pick}
+
 Out of the box, MH-E uses @command{pick} to find messages. With a
 little extra effort, you can set an indexing program which rewards you
 with extremely quick results. The drawback is that sometimes the index
@@ -6213,26 +6615,25 @@
 @end group
 @end smallexample
 
+@findex mh-to-field
+@kindex C-c C-f C-t
+
 As with MH-Letter mode, MH-Search provides commands like @kbd{C-c C-f
 C-t} (@code{mh-to-field}) to help you fill in the blanks.
 @xref{Editing Message}.
 
+@kindex F s
+@vindex mh-search-mode-hook
+
 If you find that you do the same thing over and over when editing the
 search template, you may wish to bind some shortcuts to keys. This can
 be done with the variable @code{mh-search-mode-hook}, which is called
 when @kbd{F s} is run on a new pattern.
 
-@cindex @samp{+mhe-index}
-@cindex folders, @samp{+mhe-index}
 @findex mh-index-do-search
-@findex mh-index-next-folder
-@findex mh-index-previous-folder
 @findex mh-pick-do-search
-@kindex @key{TAB}
 @kindex C-c C-c
-@kindex F s
-@kindex S-@key{TAB}
-@vindex mh-search-folder
+@kindex C-c C-p
 
 To perform the search, type @kbd{C-c C-c} (@code{mh-index-do-search}).
 Sometimes you're searching for text that is either not indexed, or
@@ -6240,6 +6641,14 @@
 method with the pick method by running the command @kbd{C-c C-p}
 (@code{mh-pick-do-search}).
 
+@cindex folders, @samp{+mhe-index}
+@cindex @samp{+mhe-index}
+@findex mh-index-next-folder
+@findex mh-index-previous-folder
+@kindex @key{TAB}
+@kindex S-@key{TAB}
+@vindex mh-search-folder
+
 The messages that are found are put in a temporary sub-folder of
 @samp{+mhe-index} and are displayed in an MH-Folder buffer. This
 buffer is special because it displays messages from multiple folders;
@@ -6250,6 +6659,11 @@
 (@code{mh-index-next-folder}) and @kbd{S-@key{TAB}}
 (@code{mh-index-previous-folder}).
 
+@findex mh-index-visit-folder
+@findex mh-rescan-folder
+@kindex F r
+@kindex v
+
 In addition, the command @kbd{v} (@code{mh-index-visit-folder}) can be
 used to visit the folder of the message at point. Initially, only the
 messages that matched the search criteria are displayed in the folder.
@@ -6259,10 +6673,15 @@
 interesting message, or to view surrounding messages with the command
 @kbd{F r} @code{mh-rescan-folder}. @xref{Folders}.
 
+@findex mh-kill-folder
+@kindex F k
+
 Because this folder is temporary, you'll probably get in the habit of
 killing it when you're done with @kbd{F k} (@code{mh-kill-folder}).
 @xref{Folders}.
 
+@kindex F s
+
 You can regenerate the results by running @kbd{F s} with a prefix
 argument.
 
@@ -6418,7 +6837,7 @@
 daily from cron:
 
 @smallexample
-    swish-e -c /home/user/Mail/.swish/config
+swish-e -c /home/user/Mail/.swish/config
 @end smallexample
 
 @subsection mairix
@@ -6520,6 +6939,10 @@
 limiting (@pxref{Limits}) or using full-text indexed searches
 (@pxref{Searching}).
 
+@cindex root, in threads
+@cindex siblings, in threads
+@cindex ancestor, in threads
+
 A thread begins with a single message called a @dfn{root}. All replies
 to the same message are @dfn{siblings} of each other. Any message that
 has replies to it is an @dfn{ancestor} of those replies.
@@ -6565,6 +6988,9 @@
 Display ancestor of current message (@code{mh-thread-ancestor}).
 @end table
 
+@cindex @samp{mh-thread} customization group
+@cindex customization group, @samp{mh-thread}
+
 The @samp{mh-thread} customization group contains one option.
 
 @vtable @code
@@ -6572,6 +6998,11 @@
 On means new folders start in threaded mode (default: @samp{off}).
 @end vtable
 
+@findex mh-toggle-threads
+@kindex T t
+@vindex mh-large-folder
+@vindex mh-show-threads-flag
+
 Threading large number of messages can be time consuming so the option
 @code{mh-show-threads-flag} is turned off by default. If you turn on
 this option, then threading will be done only if the number of
@@ -6579,6 +7010,13 @@
 event, threading can be turned on (and off) with the command @kbd{T t}
 (@code{mh-toggle-threads}).
 
+@findex mh-thread-ancestor
+@findex mh-thread-next-sibling
+@findex mh-thread-previous-sibling
+@kindex T n
+@kindex T p
+@kindex T u
+
 There are a few commands to help you navigate threads. If you do not
 care for the way a particular thread has turned, you can move up the
 chain of messages with the command @kbd{T u}
@@ -6588,6 +7026,13 @@
 sibling, skipping the sub-threads. The command @kbd{T u} can also take
 a prefix argument to jump to the message that started everything.
 
+@findex mh-delete-subject-or-thread
+@findex mh-thread-delete
+@findex mh-thread-refile
+@kindex k
+@kindex T d
+@kindex T o
+
 There are threaded equivalents for the commands that delete and refile
 messages. For example, @kbd{T o} (@code{mh-thread-refile}) refiles the
 current message and all its children. Similarly, the command @kbd{T d}
@@ -6596,11 +7041,13 @@
 @xref{Navigating}, for a description of the similar command @kbd{k}
 (@code{mh-delete-subject-or-thread}).
 
+@vindex mh-large-folder
+
 If you find that threading is too slow, it may be that you have
-@code{mh-large-folder} set too high. Threading is one of the few
+@code{mh-large-folder} set too high. Also, threading is one of the few
 features of MH-E that really benefits from compiling. If you haven't
-compiled MH-E, I encourage you to do so@footnote{If you're not sure
-if MH-E has been byte-compiled, you could try running @samp{locate
+compiled MH-E, I encourage you to do so@footnote{If you're not sure if
+MH-E has been byte-compiled, you could try running @samp{locate
 mh-thread.elc} or otherwise find MH-E on your system and ensure that
 @file{mh-thread.elc} exists. If you have multiple versions and you
 find that one is compiled but the other is not, then go into your
@@ -6679,18 +7126,32 @@
 
 @cindex @command{pick}
 @cindex MH commands, @command{pick}
-
-The commands @kbd{/ c}, @code{/ m}, @code{/ s}, and @code{/ t}
-restrict the display to messages matching the content of the
-respective field in the current message. However, you can give any of
-these a prefix argument to edit the @command{pick} expression used to
-narrow the view@footnote{See @command{pick}(1) or the section
+@findex mh-narrow-to-cc
+@findex mh-narrow-to-from
+@findex mh-narrow-to-subject
+@findex mh-narrow-to-to
+@kindex / c
+@kindex / m
+@kindex / s
+@kindex / t
+
+The commands @kbd{/ c} (@code{mh-narrow-to-cc}), @kbd{/ m}
+(@code{mh-narrow-to-from}), @kbd{/ s} (@code{mh-narrow-to-subject}),
+and @kbd{/ t} (@code{mh-narrow-to-to}) restrict the display to
+messages matching the content of the respective field in the current
+message. However, you can give any of these a prefix argument to edit
+the @command{pick} expression used to narrow the view@footnote{See
+@command{pick}(1) or the section
 @uref{@value{MH-BOOK-HOME}/finpic.htm, Finding Messages with pick} in
 the MH book.}.
 
 @cindex @samp{tick} sequence
 @cindex sequence, @samp{tick}
 @cindex ticked messages, viewing
+@findex mh-narrow-to-range
+@findex mh-narrow-to-tick
+@kindex / '
+@kindex / g
 
 You can also limit the display to messages in the @samp{tick} sequence
 with the command @kbd{/ '} (@code{mh-narrow-to-tick}).
@@ -6698,12 +7159,17 @@
 @samp{tick} sequence. Use the @kbd{/ g} (@code{mh-narrow-to-range})
 command to limit the display to messages in a range (@pxref{Ranges}).
 
+@findex mh-widen
+@kindex / w
+
 Each limit can be undone in turn with the @kbd{/ w} (@code{mh-widen})
 command. Give this command a prefix argument to remove all limits.
 
 @node Sequences, Junk, Limits, Top
 @chapter Using Sequences
 
+@cindex @samp{Sequence} menu
+@cindex menu, @samp{Sequence}
 @cindex sequences
 
 For the whole scoop on MH sequences, refer to
@@ -6819,6 +7285,8 @@
 
 @cindex @command{pick}
 @cindex MH commands, @command{pick}
+@findex mh-put-msg-in-seq
+@kindex S p
 
 To place a message in a sequence, use @kbd{S p}
 (@code{mh-put-msg-in-seq}). Give @kbd{S p} a range and you can add all
@@ -6828,11 +7296,18 @@
 @cindex @samp{tick} sequence
 @cindex sequence, @samp{tick}
 @cindex ticking messages
+@findex mh-index-ticked-messages
+@findex mh-toggle-tick
+@kindex '
+@kindex F '
+@kindex S p
 
 One specific use of the @kbd{S p} command is @kbd{'}
 (@code{mh-toggle-tick}) which adds messages to the @samp{tick}
-sequence. This sequence can be viewed later with the @kbd{F '} command
-(@pxref{Folders}).
+sequence. This sequence can be viewed later with the @kbd{F '}
+(@code{mh-index-ticked-messages}) command (@pxref{Folders}).
+
+@vindex mh-tick-seq
 
 You can customize the option @code{mh-tick-seq} if you already use the
 @samp{tick} sequence for your own use. You can also disable all of the
@@ -6841,6 +7316,12 @@
 
 @cindex MH-Folder mode
 @cindex modes, MH-Folder
+@findex mh-narrow-to-seq
+@findex mh-narrow-to-tick
+@findex mh-widen
+@kindex S '
+@kindex S n
+@kindex S w
 
 Once you've placed some messages in a sequence, you may wish to narrow
 the field of view to just those messages in the sequence you've
@@ -6853,8 +7334,12 @@
 widen the view to all your messages again, use @kbd{S w}
 (@code{mh-widen}).
 
+@cindex buffers, @samp{*MH-E Sequences*}
 @cindex @samp{*MH-E Sequences*}
-@cindex buffers, @samp{*MH-E Sequences*}
+@findex mh-list-sequences
+@findex mh-msg-is-in-seq
+@kindex S l
+@kindex S s
 
 You can see which sequences in which a message appears with the
 command @kbd{S s} (@code{mh-msg-is-in-seq}). Use a prefix argument to
@@ -6864,11 +7349,12 @@
 (@code{mh-list-sequences}). The list appears in a buffer named
 @samp{*MH-E Sequences*} (@pxref{Miscellaneous}).
 
-@cindex @samp{Previous-Sequence:} MH profile component
+@cindex MH profile component, @samp{Previous-Sequence:}
 @cindex @samp{cur} sequence
-@cindex MH profile component, @samp{Previous-Sequence:}
+@cindex @samp{Previous-Sequence:} MH profile component
+@cindex sequence, @samp{cur}
 @cindex sequence, @samp{Previous-Sequence}
-@cindex sequence, @samp{cur}
+@vindex mh-refile-preserves-sequences-flag
 
 If a message is in any sequence (except
 @samp{Previous-Sequence:}@footnote{See @samp{mh-profile}(5)).} and
@@ -6876,6 +7362,12 @@
 sequences in the destination folder. If this behavior is not desired,
 then turn off the option @code{mh-refile-preserves-sequences-flag}.
 
+@findex mh-delete-msg-from-seq
+@findex mh-delete-seq
+@kindex d
+@kindex S d
+@kindex S k
+
 If you want to remove a message (or range, @pxref{Ranges}) from a
 sequence, use @kbd{S d} (@code{mh-delete-msg-from-seq}). If you want
 to delete an entire sequence, use @kbd{S k} (@code{mh-delete-seq}). In
@@ -6885,8 +7377,18 @@
 Mail}).
 
 @cindex @samp{Unseen-Sequence:} MH profile component
+@cindex @samp{cur} sequence
+@cindex @samp{tick} sequence
 @cindex MH profile component, @samp{Unseen-Sequence:}
 @cindex sequence, @samp{Unseen-Sequence}
+@cindex sequence, @samp{cur}
+@cindex sequence, @samp{tick}
+@findex mh-update-sequences
+@kindex M-x mh-update-sequences
+@kindex q
+@kindex x
+@vindex mh-tick-seq
+@vindex mh-update-sequences-after-mh-show-flag
 
 Three sequences are maintained internally by MH-E and pushed out to MH
 when a message is shown. They include the sequence specified by your
@@ -6907,6 +7409,8 @@
 
 @cindex @command{mark}
 @cindex MH commands, @command{mark}
+@kindex S n
+@kindex S w
 
 With the exceptions of @kbd{S n} and @kbd{S w}, the underlying MH
 command dealing with sequences is @command{mark}@footnote{See the
@@ -6989,6 +7493,8 @@
 to work well with MH-E and how to use MH-E's interface that provides
 continuing education for these programs.
 
+@vindex mh-junk-program
+
 The default setting of the option @code{mh-junk-program} is
 @samp{Auto-detect} which means that MH-E will automatically choose one
 of SpamAssassin, bogofilter, or SpamProbe in that order. If, for
@@ -6996,6 +7502,10 @@
 want to use bogofilter, then you can set this option to
 @samp{Bogofilter}.
 
+@findex mh-junk-blacklist
+@kindex J b
+@vindex mh-junk-disposition
+
 The command @kbd{J b} (@code{mh-junk-blacklist}) trains the spam
 program in use with the content of the range (@pxref{Ranges}) and then
 handles the message(s) as specified by the option
@@ -7003,11 +7513,16 @@
 @samp{Delete Spam} but you can also specify the name of the folder
 which is useful for building a corpus of spam for training purposes.
 
+@findex mh-junk-whitelist
+@kindex J w
+
 In contrast, the command @kbd{J w} (@code{mh-junk-whitelist})
 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.
 
+@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
@@ -7019,7 +7534,10 @@
 @cindex @file{.procmailrc}
 @cindex files, @file{.procmailrc}
 
-@heading SpamAssassin
+@subheading SpamAssassin
+
+@cindex Spamassassin
+@cindex spam filters, Spamassassin
 
 SpamAssassin is one of the more popular spam filtering programs. Get
 it from your local distribution or from the
@@ -7059,7 +7577,7 @@
 First, run @samp{spamassassin -t} on every mail message in your
 archive and use @command{gnumeric} to verify that the average plus the
 standard deviation of good mail is under 5, the SpamAssassin default
-for "spam".
+for ``spam''.
 
 Using @command{gnumeric}, sort the messages by score and view the
 messages with the highest score. Determine the score which encompasses
@@ -7072,6 +7590,11 @@
 rules-based filters is a plethora of false positives so it is
 worthwhile to check.
 
+@findex mh-junk-blacklist
+@findex mh-junk-whitelist
+@kindex J b
+@kindex J w
+
 If SpamAssassin classifies a message incorrectly, or is unsure, you can
 use the MH-E commands @kbd{J b} (@code{mh-junk-blacklist}) and
 @kbd{J w} (@code{mh-junk-whitelist}).
@@ -7117,7 +7640,10 @@
 0 * * * *	sa-learn --rebuild > /dev/null 2>&1
 @end smallexample
 
-@heading Bogofilter
+@subheading Bogofilter
+
+@cindex bogofilter
+@cindex spam filters, bogofilter
 
 Bogofilter is a Bayesian spam filtering program. Get it from your
 local distribution or from the
@@ -7163,6 +7689,11 @@
 spam/unsure/.
 @end smallexample
 
+@findex mh-junk-blacklist
+@findex mh-junk-whitelist
+@kindex J b
+@kindex J w
+
 If bogofilter classifies a message incorrectly, or is unsure, you can
 use the MH-E commands @kbd{J b} (@code{mh-junk-blacklist}) and @kbd{J
 w} (@code{mh-junk-whitelist}) to update bogofilter's training.
@@ -7179,7 +7710,10 @@
 The @cite{Bogofilter tuning HOWTO} describes how you can fine-tune
 bogofilter.
 
-@heading SpamProbe
+@subheading SpamProbe
+
+@cindex SpamProbe
+@cindex spam filters, SpamProbe
 
 SpamProbe is a Bayesian spam filtering program. Get it from your local
 distribution or from the @uref{http://spamprobe.sourceforge.net,
@@ -7206,11 +7740,16 @@
 spam/.
 @end smallexample
 
+@findex mh-junk-blacklist
+@findex mh-junk-whitelist
+@kindex J b
+@kindex J w
+
 If SpamProbe classifies a message incorrectly, you can use the MH-E
 commands @kbd{J b} (@code{mh-junk-blacklist}) and @kbd{J w}
 (@code{mh-junk-whitelist}) to update SpamProbe's training.
 
-@heading Other Things You Can Do
+@subheading Other Things You Can Do
 
 There are a couple of things that you can add to @file{~/.procmailrc}
 in order to filter out a lot of spam and viruses. The first is to
@@ -7270,10 +7809,11 @@
 system.
 @end ftable
 
-@cindex @samp{*MH-E Info*}
+@cindex buffers, @samp{*MH-E Info*}
 @cindex MH-E version
-@cindex buffers, @samp{*MH-E Info*}
+@cindex @samp{*MH-E Info*}
 @cindex version
+@kindex M-x mh-version
 
 One command worth noting is @kbd{M-x mh-version}. You can compare the
 version this command prints to the latest release (@pxref{Getting
@@ -7281,7 +7821,7 @@
 @samp{*MH-E Info*}, should usually be included with any bug report you
 submit (@pxref{Bug Reports}).
 
-@heading MH-E Buffers
+@subheading MH-E Buffers
 
 Besides the MH-Folder, MH-Show, and MH-Letter buffers, MH-E creates
 several other buffers. They are:
@@ -7338,7 +7878,7 @@
 @c -------------------------
 @cindex @samp{*mh-temp*}
 @cindex buffers, @samp{*mh-temp*}
-@item *mh-temp
+@item *mh-temp*
 This is a scratch, ephemeral, buffer used by MH-E functions. Note that
 it is hidden because the first character in the name is a space.
 You'll generally not have any need for this buffer.
@@ -7370,12 +7910,10 @@
 @samp{Use MH-E scan Format}).
 @c -------------------------
 @item mh-scan-prog
-Program used to scan messages (default: @samp{"scan"}).
+Program used to scan messages (default: @code{"scan"}).
 @end vtable
 
-@findex mh-set-cmd-note
 @vindex mh-adaptive-cmd-note-flag
-@vindex mh-scan-format-file
 
 There are a couple of caveats when creating your own scan format file.
 First, MH-E will not work if your scan lines do not include message
@@ -7385,6 +7923,9 @@
 (@pxref{Threading}).
 
 @cindex message numbers
+@findex mh-set-cmd-note
+@vindex mh-adaptive-cmd-note-flag
+@vindex mh-scan-format-file
 
 If you've created your own format to handle long message numbers,
 you'll be pleased to know you no longer need it since MH-E adapts its
@@ -7395,8 +7936,10 @@
 format file (see @code{mh-scan-format-file}). For example, the default
 width is 4, so you would use @samp{(mh-set-cmd-note 4)}.
 
+@vindex mh-adaptive-cmd-note-flag
+@vindex mh-scan-format-file
+@vindex mh-scan-format-mh
 @vindex mh-scan-format-nmh
-@vindex mh-scan-format-mh
 
 The default setting for @code{mh-scan-format-file} is @samp{Use MH-E
 scan Format}. This means that the format string will be taken from the
@@ -7409,6 +7952,10 @@
 you can set this option to @samp{Specify a scan Format File} and enter
 the name of your format file.
 
+@vindex mh-scan-format-file
+@vindex mh-scan-format-mh
+@vindex mh-scan-format-nmh
+
 The scan format that MH-E uses when @code{mh-scan-format-file} is set
 to its default of @samp{Use MH-E scan Format} is held in the variables
 @code{mh-scan-format-nmh} and @code{mh-scan-format-mh} depending on
@@ -7432,8 +7979,9 @@
  "%(decode@{subject@})%<@{body@}<<%@{body@}%>")
 @end smallexample
 
+@cindex decoding RFC 2047
 @cindex RFC 2047, decoding
-@cindex decoding RFC 2047
+@vindex mh-scan-format-mh
 
 The setting for @code{mh-scan-format-mh} is similar, except that MH
 doesn't have the function @code{decode} (which is used to decode RFC
@@ -7459,7 +8007,7 @@
 @vindex mh-scan-prog
 
 The name of the program that generates a listing of one line per
-message is held in @code{mh-scan-prog} (default: @samp{"scan"}).
+message is held in @code{mh-scan-prog} (default: @code{"scan"}).
 Unless this variable contains an absolute pathname, it is assumed to
 be in the @code{mh-progs} directory (@pxref{Getting Started}). You may
 link another program to @command{scan} (see @samp{mh-profile}(5)) to
@@ -7468,25 +8016,26 @@
 pick Ranges Sequences} in the MH book.}.
 
 @cindex regular expressions, scan line formats
+@findex mh-set-cmd-note
+@findex setq
 
 If you change the format of the scan lines you'll need to tell MH-E
 how to parse the new format. As you will see, quite a lot of variables
-are involved to do that. Use @samp{M-x apropos @key{RET} mh-scan.*regexp'}
-to obtain a list of these variables. You will also have to call
-@code{mh-set-cmd-note} if your notations are not in column 4 (columns
-in Emacs start with 0). Note that unlike most of the user options
-described in this manual, these are variables and must be set with
-@code{setq} instead of in a customization buffer. For help with
-regular expressions, see
+are involved to do that. Use @kbd{M-x apropos @key{RET}
+mh-scan.*regexp @key{RET}} to obtain a list of these variables. You
+will also have to call @code{mh-set-cmd-note} if your notations are
+not in column 4 (columns in Emacs start with 0). Note that unlike most
+of the user options described in this manual, these are variables and
+must be set with @code{setq} instead of in a customization buffer. For
+help with regular expressions, see
 @ifnothtml
 @ref{Regexps, , Syntax of Regular Expressions, emacs, The
-GNU Emacs Manual}
+GNU Emacs Manual}.
 @end ifnothtml
 @ifhtml
-the section
+section
 @uref{http://www.gnu.org/software/emacs/manual/html_node/Regexps.html,
-Syntax of Regular Expressions} in
-@cite{The GNU Emacs Manual}).
+Syntax of Regular Expressions} in @cite{The GNU Emacs Manual}.
 @end ifhtml
 
 The first variable has to do with pruning out garbage.
@@ -7501,13 +8050,11 @@
 eliminate error messages that are occasionally produced by
 @command{inc}@footnote{See the section
 @uref{@value{MH-BOOK-HOME}/reapre.htm, Reading Mail: inc show next
-prev} in the MH book.} or @command{scan} (default: @samp{"^ *[0-9]"}).
+prev} in the MH book.} or @command{scan} (default: @code{"^ *[0-9]"}).
 @end vtable
 
 Next, many variables control how the scan lines are parsed.
 
-@vindex mh-folder-font-lock-keywords
-
 @vtable @code
 @vindex mh-folder-body
 @vindex mh-folder-font-lock-keywords
@@ -7516,7 +8063,7 @@
 the default setting of @code{mh-folder-font-lock-keywords} expects
 this expression to contain at least one parenthesized expression which
 matches the body text as in the default of
-@samp{"\\(<<\\([^\n]+\\)?\\)"}. If this regular expression is not
+@code{"\\(<<\\([^\n]+\\)?\\)"}. If this regular expression is not
 correct, the body fragment will not be highlighted with the face
 @code{mh-folder-body}.
 @c -------------------------
@@ -7528,7 +8075,7 @@
 from the beginning of the line. Note that the default setting of
 @code{mh-folder-font-lock-keywords} expects this expression to contain
 at least one parenthesized expression which matches the message number
-as in the default of @w{@samp{"^\\( *[0-9]+\\+\\).*"}}. This
+as in the default of @w{@code{"^\\( *[0-9]+\\+\\).*"}}. This
 expression includes the leading space and current message marker
 @samp{+} within the parenthesis since it looks better to highlight
 these items as well. The highlighting is done with the face
@@ -7545,7 +8092,7 @@
 default setting of @code{mh-folder-font-lock-keywords} expects this
 expression to contain only one parenthesized expression which matches
 the date field as in the default of
-@samp{"\\([0-9][0-9]/[0-9][0-9]\\)"}. If this regular expression is
+@code{"\\([0-9][0-9]/[0-9][0-9]\\)"}. If this regular expression is
 not correct, the date will not be highlighted with the face
 @code{mh-folder-date}.
 @c -------------------------
@@ -7557,7 +8104,7 @@
 the beginning of the line. Note that the default setting of
 @code{mh-folder-font-lock-keywords} expects this expression to contain
 at least one parenthesized expression which matches the message number
-as in the default of @samp{"^\\( *[0-9]+\\)D"}. This expression
+as in the default of @code{"^\\( *[0-9]+\\)D"}. This expression
 includes the leading space within the parenthesis since it looks
 better to highlight it as well. The highlighting is done with the face
 @code{mh-folder-deleted}. This regular expression should be correct as
@@ -7571,7 +8118,7 @@
 the beginning of the line. Note that the default setting of
 @code{mh-folder-font-lock-keywords} expects this expression to contain
 at least one parenthesized expression which matches the message number
-as in the default of @w{@samp{"^\\( *[0-9]+\\)[^D^0-9]"}}. This
+as in the default of @w{@code{"^\\( *[0-9]+\\)[^D^0-9]"}}. This
 expression includes the leading space within the parenthesis since it
 looks better to highlight it as well. The highlighting is done with
 the face @code{mh-folder-msg-number}. This regular expression should
@@ -7581,7 +8128,7 @@
 @item mh-scan-msg-format-regexp
 This regular expression finds the message number width in a scan
 format. Note that the message number must be placed in a parenthesized
-expression as in the default of @samp{"%\\([0-9]*\\)(msg)"}. This
+expression as in the default of @code{"%\\([0-9]*\\)(msg)"}. This
 variable is only consulted if @code{mh-scan-format-file} is set to
 @samp{Use MH-E scan Format}.
 @c -------------------------
@@ -7590,22 +8137,22 @@
 This is a format string for the width of the message number in a scan
 format. Use @samp{0%d} for zero-filled message numbers. This variable
 is only consulted if @code{mh-scan-format-file} is set to @samp{Use
-MH-E scan Format} (default: @samp{"%d"}).
+MH-E scan Format} (default: @code{"%d"}).
 @c -------------------------
 @item mh-scan-msg-number-regexp
 This regular expression extracts the message number. It must match
 from the beginning of the line. Note that the message number must be
-placed in a parenthesized expression as in the default of @w{@samp{"^
+placed in a parenthesized expression as in the default of @w{@code{"^
 *\\([0-9]+\\)"}}.
 @c -------------------------
 @item mh-scan-msg-overflow-regexp
 This regular expression matches overflowed message numbers (default:
-@samp{"^[?0-9][0-9]"}).
+@code{"^[?0-9][0-9]"}).
 @c -------------------------
 @item mh-scan-msg-search-regexp
 This regular expression matches a particular message. It is a format
 string; use @samp{%d} to represent the location of the message number
-within the expression as in the default of @samp{"^[^0-9]*%d[^0-9]"}.
+within the expression as in the default of @code{"^[^0-9]*%d[^0-9]"}.
 @c -------------------------
 @vindex mh-folder-address
 @vindex mh-folder-font-lock-keywords
@@ -7616,7 +8163,7 @@
 expects this expression to contain two parenthesized expressions. The
 first is expected to match the @samp{To:} that the default scan format
 file generates. The second is expected to match the recipient's name
-as in the default of @samp{"\\(To:\\)\\(..............\\)"}. If this
+as in the default of @code{"\\(To:\\)\\(..............\\)"}. If this
 regular expression is not correct, the @samp{To:} string will not be
 highlighted with the face @code{mh-folder-to} and the recipient will not be
 highlighted with the face @code{mh-folder-address}.
@@ -7629,7 +8176,7 @@
 the beginning of the line. Note that the default setting of
 @code{mh-folder-font-lock-keywords} expects this expression to contain
 at least one parenthesized expression which matches the message number
-as in the default of @w{@samp{"^\\( *[0-9]+\\)\\^"}}. This expression
+as in the default of @w{@code{"^\\( *[0-9]+\\)\\^"}}. This expression
 includes the leading space within the parenthesis since it looks
 better to highlight it as well. The highlighting is done with the face
 @code{mh-folder-refiled}. This regular expression should be correct as
@@ -7647,7 +8194,7 @@
 first should match the fontification hint (see
 @code{mh-scan-format-nmh}) and the second should match the user name
 as in the default of
-@w{@samp{"^ *[0-9]+.\\([bct]\\).....[ ]*\\(..................\\)"}}.
+@w{@code{"^ *[0-9]+.\\([bct]\\).....[ ]*\\(..................\\)"}}.
 If this regular expression is not correct, the notation hints will not
 be highlighted with the face @code{mh-mh-folder-sent-to-me-hint} and
 the sender will not be highlighted with the face
@@ -7667,8 +8214,8 @@
 sub-expression of the first expression). The third is expected to
 match the subject line itself which is highlighted with the face
 @code{mh-folder-subject}. For example, the default is
-@w{@samp{"^ *[0-9]+........[ ]*...................}}@*
-@w{@samp{\\([Rr][Ee]\\(\\[[0-9]+\\]\\)?:\\s-*\\)*\\([^<\n]*\\)"}}.
+@w{@code{"^ *[0-9]+........[ ]*...................}}@*
+@w{@code{\\([Rr][Ee]\\(\\[[0-9]+\\]\\)?:\\s-*\\)*\\([^<\n]*\\)"}}.
 This regular expression should be correct as it is needed by
 non-fontification functions. Note that this example is broken up on
 two lines for readability, but is actually a single string.
@@ -7678,6 +8225,8 @@
 the scan lines.
 
 @vtable @code
+@findex mh-set-cmd-note
+@vindex mh-adaptive-cmd-note-flag
 @item mh-cmd-note
 Column for notations (default: 4). This variable should be set with
 the function @code{mh-set-cmd-note}. This variable may be updated
@@ -7687,39 +8236,42 @@
 @c -------------------------
 @item mh-note-copied
 Messages that have been copied are marked by this character (default:
-@samp{?C}).
-@c -------------------------
+@code{?C}).
+@c -------------------------
+@vindex mh-scan-cur-msg-number-regexp
 @item mh-note-cur
 The current message (in MH, not in MH-E) is marked by this character
-(default: @samp{?+}). See also @code{mh-scan-cur-msg-number-regexp}.
-@c -------------------------
+(default: @code{?+}). See also @code{mh-scan-cur-msg-number-regexp}.
+@c -------------------------
+@vindex mh-scan-deleted-msg-regexp
 @item mh-note-deleted
 Messages that have been deleted are marked by this character (default:
-@samp{?D}). See also @code{mh-scan-deleted-msg-regexp}.
+@code{?D}). See also @code{mh-scan-deleted-msg-regexp}.
 @c -------------------------
 @item mh-note-dist
 Messages that have been redistributed are marked by this character
-(default: @samp{?R}).
+(default: @code{?R}).
 @c -------------------------
 @item mh-note-forw
 Messages that have been forwarded are marked by this character
-(default: @samp{?F}).
+(default: @code{?F}).
 @c -------------------------
 @item mh-note-printed
 Messages that have been printed are marked by this character (default:
-@samp{?P}).
-@c -------------------------
+@code{?P}).
+@c -------------------------
+@vindex mh-scan-refiled-msg-regexp
 @item mh-note-refiled
 Messages that have been refiled are marked by this character (default:
-@samp{?^}). See also @code{mh-scan-refiled-msg-regexp}.
+@code{?^}). See also @code{mh-scan-refiled-msg-regexp}.
 @c -------------------------
 @item mh-note-repl
 Messages that have been replied to are marked by this character
-(default: @samp{?-}).
+(default: @code{?-}).
 @c -------------------------
 @item mh-note-seq
 Messages in a user-defined sequence are marked by this character
-(default: @samp{?%}). Messages in the @samp{search} sequence are
+(default: @code{?%}). Messages in the @samp{search} sequence are
 marked by this character as well.
 @end vtable
 
@@ -7732,6 +8284,8 @@
 %20(decode(friendly@{from@})) %50(decode@{subject@})  %4(msg)%<(cur)+%| %>
 @end example
 
+@vindex mh-adaptive-cmd-note-flag
+@vindex mh-scan-format-file
 @vindex mh-scan-format-file, example
 
 The first thing you have to do is tell MH-E to use this file.
@@ -7916,9 +8470,10 @@
 @samp{Path} box and enter @file{~/Mail} to tell Gnus where to find
 your mail.
 @c -------------------------
+@vindex mail-user-agent
 @item message-mail-user-agent
 In order to send mail within Gnus using MH-E, set this option to
-@samp{mail-user-agent} and set the @samp{mail-user-agent} option to
+@samp{mail-user-agent} and set the @code{mail-user-agent} option to
 @samp{Emacs interface to MH}.
 @c -------------------------
 @item nnmail-keep-last-article
@@ -7966,8 +8521,9 @@
 @node Bug Reports, Mailing Lists, Odds and Ends, Odds and Ends
 @appendixsec Bug Reports
 
+@cindex bugs
 @cindex SourceForge
-@cindex bugs
+@kindex M-x mh-version
 
 Bug reports should be filed at
 @uref{https://sourceforge.net/bugs/?group_id=13357, SourceForge}. You
@@ -8025,7 +8581,6 @@
 @cindex change log
 @cindex release notes
 
-@c intentionally wordy to avoid overfull hbox
 New MH-E releases are always available for downloading at
 @uref{https://sourceforge.net/project/showfiles.php?group_id=13357,
 SourceForge} before they appear in an Emacs release. You can read the
@@ -8035,11 +8590,12 @@
 MH-E has to offer (although we have no doubt that you will be
 extremely interested in all new releases).
 
-@cindex @samp{MH-E-NEWS}
-@cindex @samp{README}
 @cindex files, @samp{MH-E-NEWS}
 @cindex files, @samp{README}
 @cindex news
+@cindex @samp{MH-E-NEWS}
+@cindex @samp{README}
+@kindex M-x mh-version
 
 After you download and extract the MH-E tarball, read the
 @file{README} file and @file{MH-E-NEWS}. These correspond to the
@@ -8232,20 +8788,24 @@
 After a long break, Stephen handed the reins over to me in 2000. I
 moved the project to a new site called SourceForge and organized a
 great team of developers. Our first release in late 2001 was version
-6. It appeared in Emacs 21.2 and had menus and tool bar buttons.
+6. It appeared around the time of Emacs 21.2 and had menus and tool
+bar buttons.
 
 Then, indexed searches, improved MIME handling, a speedbar, multiple
 identities, alias completion, an index view of unseen messages, spam
 software support, Face and X-Image-URL header field support, Fcc
 completion, arbitrary range handling, and draft form editing were
-introduced in the version 7 series in Emacs 21.4 (2004).
+introduced in the version 7 series around the time of Emacs 21.4
+(2004). Still, Emacs itself contained version 5 of MH-E released back
+in 1994.
 
 Version 8 development was mostly driven by the rewrite of the manual.
 It also brought mailutils support, S/MIME support, picon support, and
 an improved interface for hiding header fields. The CVS repository was
 migrated from SourceForge to Savannah (only for those files that were
 already part of Emacs) and the software was completely reorganized to
-push back two decades of entropy. It appeared in Emacs 22.1 (2006).
+push back two decades of entropy. Version 8 will appear in Emacs 22.1,
+expected to be released in 2006.
 
 Bill Wohler, February 2006
 
--- a/man/org.texi	Sun Mar 12 05:02:59 2006 +0000
+++ b/man/org.texi	Wed Mar 15 17:22:12 2006 +0000
@@ -4,7 +4,7 @@
 @setfilename ../info/org
 @settitle Org Mode Manual
 
-@set VERSION 4.08
+@set VERSION 4.09
 @set DATE March 2006
 
 @dircategory Emacs
@@ -22,6 +22,7 @@
 
 @c Macro definitions
 
+@c FIXME: does not look good in html
 @c Subheadings inside a table.  Need a difference between info and the rest.
 @macro tsubheading{text}
 @ifinfo
@@ -3063,8 +3064,18 @@
 @end lisp
 
 @noindent
-and restart emacs (this is necessary to make this change effective).
-The tree then becomes
+or change this on a per-file basis with one of the lines (anywhere in
+the buffer)
+
+@example
+#+STARTUP: showstars
+#+STARTUP: hidestars
+@end example
+@noindent
+Press @kbd{C-c C-c} with the cursor in a @samp{STARTUP} line to activate
+the modifications.  
+
+With stars hidden, the tree becomes:
 
 @example
 * Top level headline
@@ -3101,17 +3112,28 @@
 
 @noindent
 In order to make the structure editing and export commands handle this
-convention correctly, use (again a restart of emacs will be needed)
+convention correctly, use
 
 @lisp
 (setq org-odd-levels-only t)
 @end lisp
 
 @noindent
+or set this on a per-file basis with one of the following lines (don't
+forget to press @kbd{C-c C-c} with the cursor in the startup line to
+activate changes immediately).
+
+@example
+#+STARTUP: odd
+#+STARTUP: oddeven
+@end example
+
 You can convert an Org-mode file from single-star-per-level to
 double-star-per-level convention with @kbd{M-x org-convert-to-odd-levels
-RET} in that file.  It is not possible to use this setting on a
-file-local basis, so you need to decide which format to use.
+RET} in that file.  There is no command for the back conversion because
+such a command might merge levels and in this way destroy the
+structure of the tree.
+@c FIXME: Maybe we should have such a command...
 
 @node TTY keys, FAQ, Clean view, Miscellaneous
 @section Using org-mode on a tty
@@ -3130,7 +3152,6 @@
 really only fun with @kbd{S-@key{cursor}} keys.  On a tty you would
 rather use @kbd{C-c .}  to re-insert the timestamp.
 
-@page
 @multitable @columnfractions 0.15 0.2 0.2
 @item @b{Default} @tab @b{Alternative 1} @tab @b{Alternative 2}
 @item @kbd{S-@key{TAB}}     @tab @kbd{C-u @key{TAB}}       @tab
@@ -3339,7 +3360,7 @@
 @code{org-disputed-keys}.
 @item @file{remember.el} by John Wiegley
 Org mode cooperates with remember, see @ref{Remember}.
-@file{remember.el} is not part of Emacs, find it on the web.
+@file{Remember.el} is not part of Emacs, find it on the web.
 @cindex @file{planner.el}
 @item @file{planner.el} by John Wiegley
 Planner is another tool to plan work and keep track of tasks.  Planner
@@ -3388,7 +3409,7 @@
 @kbd{C-c C-r} and @kbd{C-c a}), things do work correctly.
 @item
 You can only make a single word boldface or italic.  To emphasize
-several words in a row, each much have the emphasize markers, like in
+several words in a row, each must have the emphasize markers, like in
 @samp{*three* *bold* *words*}.
 @item
 The exporters work well, but could be made more efficient.
@@ -3452,6 +3473,8 @@
 Juergen Vollmer contributed code generating the table of contents
 in HTML output, and other export improvements.
 @item
+Chris Wallace provided a patch implementing the @samp{QUOTE} keyword.
+@item
 David Wainberg suggested the archiving mechanism and shaped the
 internal link system with many suggestions and ideas.
 @item
--- a/nt/ChangeLog	Sun Mar 12 05:02:59 2006 +0000
+++ b/nt/ChangeLog	Wed Mar 15 17:22:12 2006 +0000
@@ -1,3 +1,12 @@
+2006-03-12  Jason Rumney  <jasonr@gnu.org>
+
+	* addpm.c (add_registry): Don't change the registry unless keys
+	already exist from a previous version.
+
+	* makefile.w32-in (install): Use -q when invoking addpm.
+
+	* addpm.c (main): Accept -q as alternative for /q.
+
 2006-03-11  Jason Rumney  <jasonr@gnu.org>
 
 	* runemacs.c (WinMain): Set screen buffer to 80x25.
--- a/nt/addpm.c	Sun Mar 12 05:02:59 2006 +0000
+++ b/nt/addpm.c	Wed Mar 15 17:22:12 2006 +0000
@@ -71,19 +71,23 @@
      char *path;
 {
   HKEY hrootkey = NULL;
-  DWORD dwDisp;
   int i;
   BOOL ok = TRUE;
 
+  /* Previous versions relied on registry settings, but we do not need
+     them any more.  If registry settings are installed from a previous
+     version, replace them to ensure they are the current settings.
+     Otherwise, do nothing.  */
+
   /* Check both the current user and the local machine to see if we
      have any resources.  */
 
-  if (RegCreateKeyEx (HKEY_LOCAL_MACHINE, REG_ROOT,
-		      0, "", REG_OPTION_NON_VOLATILE,
-		      KEY_WRITE, NULL, &hrootkey, &dwDisp) != ERROR_SUCCESS
-      && RegCreateKeyEx (HKEY_CURRENT_USER, REG_ROOT,
-			 0, "", REG_OPTION_NON_VOLATILE,
-			 KEY_WRITE, NULL, &hrootkey, &dwDisp) != ERROR_SUCCESS)
+  if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, REG_ROOT,
+		      REG_OPTION_NON_VOLATILE,
+		      KEY_WRITE, &hrootkey) != ERROR_SUCCESS
+      && RegOpenKeyEx (HKEY_CURRENT_USER, REG_ROOT,
+			 REG_OPTION_NON_VOLATILE,
+			 KEY_WRITE, &hrootkey) != ERROR_SUCCESS)
     {
       return FALSE;
     }
@@ -122,12 +126,14 @@
 #if 0
   if (argc < 2 || argc > 3)
     {
-      fprintf (stderr, "usage: addpm [/q] [emacs_path [icon_path]]\n");
+      fprintf (stderr, "usage: addpm [-q] [emacs_path [icon_path]]\n");
       exit (1);
     }
 #endif
 
-  if (argc > 1 && argv[1][0] == '/' && argv[1][1] == 'q')
+  if (argc > 1
+      && (argv[1][0] == '/' || argv[1][0] == '-')
+      && argv[1][1] == 'q')
     {
       quiet = 1;
       --argc;
--- a/nt/makefile.w32-in	Sun Mar 12 05:02:59 2006 +0000
+++ b/nt/makefile.w32-in	Wed Mar 15 17:22:12 2006 +0000
@@ -180,7 +180,7 @@
 	- $(CP) $(BLD)/ddeclient.exe $(INSTALL_DIR)/bin
 	- $(CP) $(BLD)/cmdproxy.exe $(INSTALL_DIR)/bin
 	- $(CP) $(BLD)/runemacs.exe $(INSTALL_DIR)/bin
-	- "$(INSTALL_DIR)/bin/addpm" /q
+	- "$(INSTALL_DIR)/bin/addpm" -q
 	- $(DEL) ../same-dir.tst
 	- $(DEL) $(INSTALL_DIR)/same-dir.tst
 	echo SameDirTest > "$(INSTALL_DIR)/same-dir.tst"
--- a/src/ChangeLog	Sun Mar 12 05:02:59 2006 +0000
+++ b/src/ChangeLog	Wed Mar 15 17:22:12 2006 +0000
@@ -1,3 +1,61 @@
+2006-03-14  Chong Yidong  <cyd@stupidchicken.com>
+
+	* xterm.c (x_uncatch_errors): Block input for entire function.
+
+2006-03-12  Jason Rumney  <jasonr@gnu.org>
+
+	* w32fns.c (Fx_create_frame): Remove call to
+	Qface_set_after_frame_default. (from xfns.c 2003-05-26)
+
+	* w32menu.c (Fx_popup_menu): Call w32_free_menu_strings when
+	finished with the menu.
+
+	* w32term.c: Sync 2005-10-24 xterm.c changes.
+	(last_mouse_glyph_frame): New var.
+	(note_mouse_movement): Say mouse moved if current frame differs
+	from last_mouse_glyph_frame, and update last_mouse_glyph_frame.
+	(w32_mouse_position): Set last_mouse_glyph_frame.
+	 Remove OLD_REDISPLAY_CODE block.
+
+2006-03-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* macgui.h [USE_ATSUI && MAC_OSX]: Define USE_CG_TEXT_DRAWING to 1.
+
+	* macterm.h (struct mac_output) [USE_CG_DRAWING]: New member cg_context.
+	(mac_prepare_for_quickdraw) [USE_CG_DRAWING]: Add prototype.
+
+	* mac.c (sys_select) [USE_CG_DRAWING]: Call mac_prepare_for_quickdraw.
+
+	* macfns.c (x_create_tip_frame): Apply 2006-03-11 change for xfns.c.
+
+	* macterm.c (mac_draw_rectangle, x_draw_glyph_string_foreground)
+	(x_draw_composite_glyph_string_foreground)
+	(x_draw_image_foreground): Undo previous changes.
+	(x_draw_hollow_cursor): Likewise.  Subtract 1 from the last
+	argument of mac_draw_rectangle.
+	(CG_SET_FILL_COLOR, CG_SET_STROKE_COLOR): New macros.
+	(mac_draw_string_common, mac_draw_image_string_cg): Use them.
+	(FRAME_CG_CONTEXT) [USE_CG_DRAWING]: New macro.
+	(mac_begin_cg_clip, mac_end_cg_clip, mac_prepare_for_quickdraw)
+	[USE_CG_DRAWING]: New functions.
+	(mac_draw_line, mac_erase_rectangle, mac_clear_window)
+	(mac_fill_rectangle, mac_draw_rectangle, mac_draw_string_common)
+	(mac_draw_image_string_cg) [USE_CG_DRAWING]: Add Quartz 2D drawing part.
+	(mac_draw_bitmap, mac_invert_rectangle, mac_draw_string_common)
+	(mac_copy_area, mac_scroll_area, x_scroll_bar_create)
+	(x_scroll_bar_remove, XTset_vertical_scroll_bar, x_set_window_size)
+	(XTread_socket) [USE_CG_DRAWING]: Call mac_prepare_for_quickdraw.
+
+2006-03-12  L$,1 q(Brentey K,Aa(Broly  <lorentey@elte.hu>
+
+	* xfns.c (x_icon): Disable redundant call to `x_wm_set_window_state'.
+
+2006-03-11  Jason Rumney  <jasonr@gnu.org>
+
+	* w32fns.c (signal_user_input): New function.
+	(post_character_message): Use it for keyboard input.
+	(w32_msg_pump): Use it for mouse input.
+
 2006-03-11  Luc Teirlinck  <teirllm@auburn.edu>
 
 	* window.c: Rename preserve_y to window_scroll_pixel_based_preserve_y.
@@ -95,7 +153,7 @@
 
 	* image.c [MAC_OS] (XPutPixel): Set alpha channel bits if pixmap
 	depth is 32.
-	 [MAC_OS] (XGetPixel): Strip off alpha channel bits if pixmap
+	[MAC_OS] (XGetPixel): Strip off alpha channel bits if pixmap
 	depth is 32.
 
 2006-03-06  Chong Yidong  <cyd@stupidchicken.com>
--- a/src/mac.c	Sun Mar 12 05:02:59 2006 +0000
+++ b/src/mac.c	Wed Mar 15 17:22:12 2006 +0000
@@ -4829,6 +4829,9 @@
 	    return 0;
 	}
 
+#if USE_CG_DRAWING
+      mac_prepare_for_quickdraw (NULL);
+#endif
       /* Avoid initial overhead of RunLoop setup for the case that
 	 some input is already available.  */
       EMACS_SET_SECS_USECS (select_timeout, 0, 0);
--- a/src/macfns.c	Sun Mar 12 05:02:59 2006 +0000
+++ b/src/macfns.c	Wed Mar 15 17:22:12 2006 +0000
@@ -3591,6 +3591,7 @@
 
   check_mac ();
 
+  parms = Fcopy_alist (parms);
 
 #ifdef MULTI_KBOARD
   kb = dpyinfo->kboard;
--- a/src/macgui.h	Sun Mar 12 05:02:59 2006 +0000
+++ b/src/macgui.h	Wed Mar 15 17:22:12 2006 +0000
@@ -79,6 +79,18 @@
 #include <Gestalt.h>
 #endif /* not HAVE_CARBON */
 
+#ifndef USE_CG_TEXT_DRAWING
+#if USE_ATSUI && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
+#define USE_CG_TEXT_DRAWING 1
+#endif
+#endif
+
+#ifndef USE_CG_DRAWING
+#if USE_ATSUI && defined (MAC_OSX)
+#define USE_CG_DRAWING 1
+#endif
+#endif
+
 typedef WindowPtr Window;
 typedef GWorldPtr Pixmap;
 
@@ -92,12 +104,6 @@
 #endif
 
 
-#ifndef USE_CG_TEXT_DRAWING
-#if USE_ATSUI && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
-#define USE_CG_TEXT_DRAWING 1
-#endif
-#endif
-
 /* Emulate XCharStruct.  */
 typedef struct _XCharStruct
 {
--- a/src/macterm.c	Sun Mar 12 05:02:59 2006 +0000
+++ b/src/macterm.c	Wed Mar 15 17:22:12 2006 +0000
@@ -268,6 +268,72 @@
 #define GC_BACK_COLOR(gc)	(&(gc)->back_color)
 #define GC_FONT(gc)		((gc)->xgcv.font)
 #define FRAME_NORMAL_GC(f)	((f)->output_data.mac->normal_gc)
+#define CG_SET_FILL_COLOR(context, color)			\
+  CGContextSetRGBFillColor (context,					\
+			    RED_FROM_ULONG (color) / 255.0f,		\
+			    GREEN_FROM_ULONG (color) / 255.0f,		\
+			    BLUE_FROM_ULONG (color) / 255.0f, 1.0f)
+#define CG_SET_STROKE_COLOR(context, color)		\
+  CGContextSetRGBStrokeColor (context,					\
+			      RED_FROM_ULONG (color) / 255.0f,		\
+			      GREEN_FROM_ULONG (color) / 255.0f,	\
+			      BLUE_FROM_ULONG (color) / 255.0f, 1.0f)
+#if USE_CG_DRAWING
+#define FRAME_CG_CONTEXT(f)	((f)->output_data.mac->cg_context)
+
+static CGContextRef
+mac_begin_cg_clip (f, gc)
+     struct frame *f;
+     GC gc;
+{
+  CGContextRef context = FRAME_CG_CONTEXT (f);
+
+  if (!context)
+    {
+      QDBeginCGContext (GetWindowPort (FRAME_MAC_WINDOW (f)), &context);
+      FRAME_CG_CONTEXT (f) = context;
+    }
+
+  CGContextSaveGState (context);
+  CGContextTranslateCTM (context, 0, FRAME_PIXEL_HEIGHT (f));
+  CGContextScaleCTM (context, 1, -1);
+  if (gc && gc->n_clip_rects)
+    CGContextClipToRects (context, gc->clip_rects, gc->n_clip_rects);
+
+  return context;
+}
+
+static void
+mac_end_cg_clip (f)
+     struct frame *f;
+{
+  CGContextRestoreGState (FRAME_CG_CONTEXT (f));
+}
+
+void
+mac_prepare_for_quickdraw (f)
+     struct frame *f;
+{
+  if (f == NULL)
+    {
+      Lisp_Object rest, frame;
+      FOR_EACH_FRAME (rest, frame)
+	if (FRAME_MAC_P (XFRAME (frame)))
+	  mac_prepare_for_quickdraw (XFRAME (frame));
+    }
+  else
+    {
+      CGContextRef context = FRAME_CG_CONTEXT (f);
+
+      if (context)
+	{
+	  CGContextSynchronize (context);
+	  QDEndCGContext (GetWindowPort (FRAME_MAC_WINDOW (f)),
+			  &FRAME_CG_CONTEXT (f));
+	}
+    }
+}
+#endif
 
 static RgnHandle saved_port_clip_region = NULL;
 
@@ -318,6 +384,18 @@
      GC gc;
      int x1, y1, x2, y2;
 {
+#if USE_CG_DRAWING
+  CGContextRef context;
+
+  context = mac_begin_cg_clip (f, gc);
+  CG_SET_STROKE_COLOR (context, gc->xgcv.foreground);
+  CGContextBeginPath (context);
+  CGContextMoveToPoint (context, x1 + 0.5f, y1 + 0.5f);
+  CGContextAddLineToPoint (context, x2 + 0.5f, y2 + 0.5f);
+  CGContextClosePath (context);
+  CGContextStrokePath (context);
+  mac_end_cg_clip (f);
+#else
   SetPortWindowPort (FRAME_MAC_WINDOW (f));
 
   RGBForeColor (GC_FORE_COLOR (gc));
@@ -326,6 +404,7 @@
   MoveTo (x1, y1);
   LineTo (x2, y2);
   mac_end_clip (gc);
+#endif
 }
 
 void
@@ -359,6 +438,14 @@
      int x, y;
      unsigned int width, height;
 {
+#if USE_CG_DRAWING
+  CGContextRef context;
+
+  context = mac_begin_cg_clip (f, gc);
+  CG_SET_FILL_COLOR (context, gc->xgcv.background);
+  CGContextFillRect (context, CGRectMake (x, y, width, height));
+  mac_end_cg_clip (f);
+#else
   Rect r;
 
   SetPortWindowPort (FRAME_MAC_WINDOW (f));
@@ -371,6 +458,7 @@
   mac_end_clip (gc);
 
   RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f)));
+#endif
 }
 
 
@@ -391,6 +479,16 @@
 mac_clear_window (f)
      struct frame *f;
 {
+#if USE_CG_DRAWING
+  CGContextRef context;
+  GC gc = FRAME_NORMAL_GC (f);
+
+  context = mac_begin_cg_clip (f, NULL);
+  CG_SET_FILL_COLOR (context, gc->xgcv.background);
+  CGContextFillRect (context, CGRectMake (0, 0, FRAME_PIXEL_WIDTH (f),
+					  FRAME_PIXEL_HEIGHT (f)));
+  mac_end_cg_clip (f);
+#else
   SetPortWindowPort (FRAME_MAC_WINDOW (f));
 
   RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f)));
@@ -405,6 +503,7 @@
 #else /* not TARGET_API_MAC_CARBON */
   EraseRect (&(FRAME_MAC_WINDOW (f)->portRect));
 #endif /* not TARGET_API_MAC_CARBON */
+#endif
 }
 
 
@@ -425,6 +524,9 @@
   bitmap.baseAddr = (char *)bits;
   SetRect (&(bitmap.bounds), 0, 0, width, height);
 
+#if USE_CG_DRAWING
+  mac_prepare_for_quickdraw (f);
+#endif
   SetPortWindowPort (FRAME_MAC_WINDOW (f));
 
   RGBForeColor (GC_FORE_COLOR (gc));
@@ -571,6 +673,14 @@
      int x, y;
      unsigned int width, height;
 {
+#if USE_CG_DRAWING
+  CGContextRef context;
+
+  context = mac_begin_cg_clip (f, gc);
+  CG_SET_FILL_COLOR (context, gc->xgcv.foreground);
+  CGContextFillRect (context, CGRectMake (x, y, width, height));
+  mac_end_cg_clip (f);
+#else
   Rect r;
 
   SetPortWindowPort (FRAME_MAC_WINDOW (f));
@@ -581,6 +691,7 @@
   mac_begin_clip (gc);
   PaintRect (&r); /* using foreground color of gc */
   mac_end_clip (gc);
+#endif
 }
 
 
@@ -593,16 +704,26 @@
      int x, y;
      unsigned int width, height;
 {
+#if USE_CG_DRAWING
+  CGContextRef context;
+
+  context = mac_begin_cg_clip (f, gc);
+  CG_SET_STROKE_COLOR (context, gc->xgcv.foreground);
+  CGContextStrokeRect (context,
+		       CGRectMake (x + 0.5f, y + 0.5f, width, height));
+  mac_end_cg_clip (f);
+#else
   Rect r;
 
   SetPortWindowPort (FRAME_MAC_WINDOW (f));
 
   RGBForeColor (GC_FORE_COLOR (gc));
-  SetRect (&r, x, y, x + width, y + height);
+  SetRect (&r, x, y, x + width + 1, y + height + 1);
 
   mac_begin_clip (gc);
   FrameRect (&r); /* using foreground color of gc */
   mac_end_clip (gc);
+#endif
 }
 
 
@@ -672,6 +793,9 @@
 {
   Rect r;
 
+#if USE_CG_DRAWING
+  mac_prepare_for_quickdraw (f);
+#endif
   SetPortWindowPort (FRAME_MAC_WINDOW (f));
 
   SetRect (&r, x, y, x + width, y + height);
@@ -717,6 +841,9 @@
       if (!mac_use_core_graphics)
 	{
 #endif
+#if USE_CG_DRAWING
+	  mac_prepare_for_quickdraw (f);
+#endif
 	  mac_begin_clip (gc);
 	  RGBForeColor (GC_FORE_COLOR (gc));
 	  if (bg_width)
@@ -745,6 +872,9 @@
 	  ByteCount sizes[] = {sizeof (CGContextRef)};
 	  ATSUAttributeValuePtr values[] = {&context};
 
+#if USE_CG_DRAWING
+	  context = mac_begin_cg_clip (f, gc);
+#else
 	  GetPort (&port);
 	  QDBeginCGContext (port, &context);
 	  if (gc->n_clip_rects || bg_width)
@@ -754,14 +884,10 @@
 	      if (gc->n_clip_rects)
 		CGContextClipToRects (context, gc->clip_rects,
 				      gc->n_clip_rects);
+#endif
 	      if (bg_width)
 		{
-		  CGContextSetRGBFillColor
-		    (context,
-		     RED_FROM_ULONG (gc->xgcv.background) / 255.0f,
-		     GREEN_FROM_ULONG (gc->xgcv.background) / 255.0f,
-		     BLUE_FROM_ULONG (gc->xgcv.background) / 255.0f,
-		     1.0);
+		  CG_SET_FILL_COLOR (context, gc->xgcv.background);
 		  CGContextFillRect
 		    (context,
 		     CGRectMake (x, y - FONT_BASE (GC_FONT (gc)),
@@ -769,13 +895,10 @@
 		}
 	      CGContextScaleCTM (context, 1, -1);
 	      CGContextTranslateCTM (context, 0, -port_height);
+#if !USE_CG_DRAWING
 	    }
-	  CGContextSetRGBFillColor
-	    (context,
-	     RED_FROM_ULONG (gc->xgcv.foreground) / 255.0f,
-	     GREEN_FROM_ULONG (gc->xgcv.foreground) / 255.0f,
-	     BLUE_FROM_ULONG (gc->xgcv.foreground) / 255.0f,
-	     1.0);
+#endif
+	  CG_SET_FILL_COLOR (context, gc->xgcv.foreground);
 	  err = ATSUSetLayoutControls (text_layout,
 				       sizeof (tags) / sizeof (tags[0]),
 				       tags, sizes, values);
@@ -783,8 +906,13 @@
 	    ATSUDrawText (text_layout,
 			  kATSUFromTextBeginning, kATSUToTextEnd,
 			  Long2Fix (x), Long2Fix (port_height - y));
+#if USE_CG_DRAWING
+	  mac_end_cg_clip (f);
+	  context = NULL;
+#else
 	  CGContextSynchronize (context);
 	  QDEndCGContext (port, &context);
+#endif
 #if 0
 	  /* This doesn't work on Mac OS X 10.1.  */
 	  ATSUClearLayoutControls (text_layout,
@@ -806,6 +934,9 @@
       if (mac_use_core_graphics)
 	savedFlags = SwapQDTextFlags (kQDUseCGTextRendering);
 #endif
+#if USE_CG_DRAWING
+      mac_prepare_for_quickdraw (f);
+#endif
       mac_begin_clip (gc);
       RGBForeColor (GC_FORE_COLOR (gc));
 #ifdef MAC_OS8
@@ -1113,6 +1244,9 @@
       buf++;
     }
 
+#if USE_CG_DRAWING
+  context = mac_begin_cg_clip (f, gc);
+#else
   QDBeginCGContext (port, &context);
   if (gc->n_clip_rects || bg_width)
     {
@@ -1120,14 +1254,10 @@
       CGContextScaleCTM (context, 1, -1);
       if (gc->n_clip_rects)
 	CGContextClipToRects (context, gc->clip_rects, gc->n_clip_rects);
+#endif
       if (bg_width)
 	{
-	  CGContextSetRGBFillColor
-	    (context,
-	     RED_FROM_ULONG (gc->xgcv.background) / 255.0f,
-	     GREEN_FROM_ULONG (gc->xgcv.background) / 255.0f,
-	     BLUE_FROM_ULONG (gc->xgcv.background) / 255.0f,
-	     1.0);
+	  CG_SET_FILL_COLOR (context, gc->xgcv.background);
 	  CGContextFillRect
 	    (context,
 	     CGRectMake (gx, y - FONT_BASE (GC_FONT (gc)),
@@ -1135,12 +1265,10 @@
 	}
       CGContextScaleCTM (context, 1, -1);
       CGContextTranslateCTM (context, 0, -port_height);
-    }
-  CGContextSetRGBFillColor (context,
-			    RED_FROM_ULONG (gc->xgcv.foreground) / 255.0f,
-			    GREEN_FROM_ULONG (gc->xgcv.foreground) / 255.0f,
-			    BLUE_FROM_ULONG (gc->xgcv.foreground) / 255.0f,
-			    1.0);
+#if !USE_CG_DRAWING
+    }
+#endif
+  CG_SET_FILL_COLOR (context, gc->xgcv.foreground);
   CGContextSetFont (context, GC_FONT (gc)->cg_font);
   CGContextSetFontSize (context, GC_FONT (gc)->mac_fontsize);
   if (GC_FONT (gc)->mac_fontsize <= cg_text_anti_aliasing_threshold)
@@ -1155,8 +1283,12 @@
       gx += advances[i].width;
     }
 #endif
+#if USE_CG_DRAWING
+  mac_end_cg_clip (f);
+#else
   CGContextSynchronize (context);
   QDEndCGContext (port, &context);
+#endif
 
   return 1;
 }
@@ -1176,6 +1308,9 @@
 {
   Rect src_r, dest_r;
 
+#if USE_CG_DRAWING
+  mac_prepare_for_quickdraw (f);
+#endif
   SetPortWindowPort (FRAME_MAC_WINDOW (f));
 
   SetRect (&src_r, src_x, src_y, src_x + width, src_y + height);
@@ -1220,6 +1355,9 @@
 {
   Rect src_r, dest_r;
 
+#if USE_CG_DRAWING
+  mac_prepare_for_quickdraw (f);
+#endif
   SetPortWindowPort (FRAME_MAC_WINDOW (f));
 
   SetRect (&src_r, src_x, src_y, src_x + width, src_y + height);
@@ -1269,6 +1407,9 @@
   RgnHandle dummy = NewRgn ();	/* For avoiding update events.  */
 
   SetRect (&src_r, src_x, src_y, src_x + width, src_y + height);
+#if USE_CG_DRAWING
+  mac_prepare_for_quickdraw (f);
+#endif
   ScrollWindowRect (FRAME_MAC_WINDOW (f),
 		    &src_r, dest_x - src_x, dest_y - src_y,
 		    kScrollWindowNoOptions, dummy);
@@ -1527,6 +1668,9 @@
 {
 #if TARGET_API_MAC_CARBON
   BLOCK_INPUT;
+#if USE_CG_DRAWING
+  mac_prepare_for_quickdraw (f);
+#endif
   if (f)
     QDFlushPortBuffer (GetWindowPort (FRAME_MAC_WINDOW (f)), NULL);
   else
@@ -2436,7 +2580,7 @@
 	{
 	  struct glyph *g = s->first_glyph + i;
 	  mac_draw_rectangle (s->f, s->gc, x, s->y,
-			      g->pixel_width, s->height);
+			      g->pixel_width - 1, s->height - 1);
 	  x += g->pixel_width;
 	}
     }
@@ -2515,7 +2659,7 @@
     {
       if (s->gidx == 0)
 	mac_draw_rectangle (s->f, s->gc, x, s->y,
-			    s->width, s->height);
+			    s->width - 1, s->height - 1);
     }
   else
     {
@@ -3068,15 +3212,15 @@
 	      int r = s->img->relief;
 	      if (r < 0) r = -r;
 	      mac_draw_rectangle (s->f, s->gc, x - r, y - r,
-				  s->slice.width + r*2,
-				  s->slice.height + r*2);
+				  s->slice.width + r*2 - 1,
+				  s->slice.height + r*2 - 1);
 	    }
 	}
     }
   else
     /* Draw a rectangle if image could not be loaded.  */
     mac_draw_rectangle (s->f, s->gc, x, y,
-			s->slice.width, s->slice.height);
+			s->slice.width - 1, s->slice.height - 1);
 }
 
 
@@ -4593,6 +4737,9 @@
   r.right = left + width;
   r.bottom = disp_top + disp_height;
 
+#if USE_CG_DRAWING
+  mac_prepare_for_quickdraw (f);
+#endif
 #if TARGET_API_MAC_CARBON
   ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p",
 #if USE_TOOLKIT_SCROLL_BARS
@@ -4719,6 +4866,9 @@
 
   BLOCK_INPUT;
 
+#if USE_CG_DRAWING
+  mac_prepare_for_quickdraw (f);
+#endif
   /* Destroy the Mac scroll bar control  */
   DisposeControl (SCROLL_BAR_CONTROL_HANDLE (bar));
 
@@ -4815,6 +4965,9 @@
 	     for them on the frame, we have to clear "under" them.  */
 	  mac_clear_area (f, left, top, width, height);
 
+#if USE_CG_DRAWING
+	  mac_prepare_for_quickdraw (f);
+#endif
           HideControl (ch);
           MoveControl (ch, sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM, disp_top);
           SizeControl (ch, sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
@@ -5245,7 +5398,7 @@
   /* Compute frame-relative coordinates for phys cursor.  */
   x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x);
   y = get_phys_cursor_geometry (w, row, cursor_glyph, &h);
-  wd = w->phys_cursor_width + 1;
+  wd = w->phys_cursor_width;
 
   /* The foreground of cursor_gc is typically the same as the normal
      background color, which can cause the cursor box to be invisible.  */
@@ -5259,7 +5412,7 @@
 
   /* Set clipping, draw the rectangle, and reset clipping again.  */
   x_clip_to_row (w, row, TEXT_AREA, gc);
-  mac_draw_rectangle (f, gc, x, y, wd, h);
+  mac_draw_rectangle (f, gc, x, y, wd, h - 1);
   mac_reset_clip_rectangles (dpy, gc);
 }
 
@@ -5786,8 +5939,13 @@
   SizeWindow (FRAME_MAC_WINDOW (f), pixelwidth, pixelheight, 0);
 #if TARGET_API_MAC_CARBON
   if (f->output_data.mac->hourglass_control)
-    MoveControl (f->output_data.mac->hourglass_control,
-		 pixelwidth - HOURGLASS_WIDTH, 0);
+    {
+#if USE_CG_DRAWING
+      mac_prepare_for_quickdraw (f);
+#endif
+      MoveControl (f->output_data.mac->hourglass_control,
+		   pixelwidth - HOURGLASS_WIDTH, 0);
+    }
 #endif
 
   /* Now, strictly speaking, we can't be sure that this is accurate,
@@ -9672,7 +9830,11 @@
 #if USE_CARBON_EVENTS
   toolbox_dispatcher = GetEventDispatcherTarget ();
 
-  while (!ReceiveNextEvent (0, NULL, kEventDurationNoWait,
+  while (
+#if USE_CG_DRAWING
+	 mac_prepare_for_quickdraw (NULL),
+#endif
+	 !ReceiveNextEvent (0, NULL, kEventDurationNoWait,
 			    kEventRemoveFromQueue, &eventRef))
 #else /* !USE_CARBON_EVENTS */
   while (mac_wait_next_event (&er, 0, true))
--- a/src/macterm.h	Sun Mar 12 05:02:59 2006 +0000
+++ b/src/macterm.h	Wed Mar 15 17:22:12 2006 +0000
@@ -334,6 +334,11 @@
 
   /* Hints for the size and the position of a window.  */
   XSizeHints *size_hints;
+
+#if USE_CG_DRAWING
+  /* Quartz 2D graphics context.  */
+  CGContextRef cg_context;
+#endif
 };
 
 typedef struct mac_output mac_output;
@@ -563,6 +568,9 @@
 extern OSErr install_window_handler P_ ((WindowPtr));
 extern void remove_window_handler P_ ((WindowPtr));
 extern Lisp_Object mac_make_lispy_event_code P_ ((int));
+#if USE_CG_DRAWING
+extern void mac_prepare_for_quickdraw P_ ((struct frame *));
+#endif
 
 #define FONT_TYPE_FOR_UNIBYTE(font, ch) 0
 #define FONT_TYPE_FOR_MULTIBYTE(font, ch) 0
--- a/src/w32fns.c	Sun Mar 12 05:02:59 2006 +0000
+++ b/src/w32fns.c	Wed Mar 15 17:22:12 2006 +0000
@@ -2695,6 +2695,24 @@
 }
 
 static void
+signal_user_input ()
+{
+  /* Interrupt any lisp that wants to be interrupted by input.  */
+  if (!NILP (Vthrow_on_input))
+    {
+      Vquit_flag = Vthrow_on_input;
+      /* If we're inside a function that wants immediate quits,
+	 do it now.  */
+      if (immediate_quit && NILP (Vinhibit_quit))
+	{
+	  immediate_quit = 0;
+	  QUIT;
+	}
+    }
+}
+
+
+static void
 post_character_message (hwnd, msg, wParam, lParam, modifiers)
      HWND hwnd;
      UINT msg;
@@ -2751,6 +2769,8 @@
 	   to receive C-g to interrupt the lisp thread.  */
 	cancel_all_deferred_msgs ();
       }
+    else
+      signal_user_input ();
   }
 
   my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
@@ -3270,6 +3290,7 @@
 
       wmsg.dwModifiers = w32_get_modifiers ();
       my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
+      signal_user_input ();
 
       /* Need to return true for XBUTTON messages, false for others,
          to indicate that we processed the message.  */
@@ -3324,11 +3345,13 @@
     case WM_MOUSEWHEEL:
       wmsg.dwModifiers = w32_get_modifiers ();
       my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
+      signal_user_input ();
       return 0;
 
     case WM_DROPFILES:
       wmsg.dwModifiers = w32_get_modifiers ();
       my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
+      signal_user_input ();
       return 0;
 
     case WM_TIMER:
@@ -3338,6 +3361,7 @@
 	  if (saved_mouse_button_msg.msg.hwnd)
 	    {
 	      post_msg (&saved_mouse_button_msg);
+	      signal_user_input ();
 	      saved_mouse_button_msg.msg.hwnd = 0;
 	    }
 	  KillTimer (hwnd, mouse_button_timer);
@@ -3840,6 +3864,7 @@
 	{
 	  wmsg.dwModifiers = w32_get_modifiers ();
 	  my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
+	  signal_user_input ();
 	  return 0;
 	}
 
@@ -4344,17 +4369,6 @@
   x_wm_set_size_hint (f, window_prompting, 0);
   UNBLOCK_INPUT;
 
-  /* Avoid a bug that causes the new frame to never become visible if
-     an echo area message is displayed during the following call1.  */
-  specbind(Qredisplay_dont_pause, Qt);
-
-  /* Set up faces after all frame parameters are known.  This call
-     also merges in face attributes specified for new frames.  If we
-     don't do this, the `menu' face for instance won't have the right
-     colors, and the menu bar won't appear in the specified colors for
-     new frames.  */
-  call1 (Qface_set_after_frame_default, frame);
-
   /* Make the window appear on the frame and enable display, unless
      the caller says not to.  However, with explicit parent, Emacs
      cannot control visibility, so don't try.  */
--- a/src/w32menu.c	Sun Mar 12 05:02:59 2006 +0000
+++ b/src/w32menu.c	Wed Mar 15 17:22:12 2006 +0000
@@ -819,8 +819,10 @@
     }
 
 #ifdef HAVE_MENUS
-  /* If resources from a previous popup menu exist yet, does nothing
-     until the `menu_free_timer' has freed them (see w32fns.c).
+  /* If resources from a previous popup menu still exist, does nothing
+     until the `menu_free_timer' has freed them (see w32fns.c). This
+     can occur if you press ESC or click outside a menu without selecting
+     a menu item.
   */
   if (current_popup_menu)
     {
@@ -837,6 +839,8 @@
   UNBLOCK_INPUT;
 
   discard_menu_items ();
+  w32_free_menu_strings (FRAME_W32_WINDOW (f));
+
 #endif /* HAVE_MENUS */
 
   UNGCPRO;
--- a/src/w32term.c	Sun Mar 12 05:02:59 2006 +0000
+++ b/src/w32term.c	Wed Mar 15 17:22:12 2006 +0000
@@ -183,6 +183,7 @@
 /* Where the mouse was last time we reported a mouse event.  */
 
 static RECT last_mouse_glyph;
+static FRAME_PTR last_mouse_glyph_frame;
 static Lisp_Object last_mouse_press_frame;
 
 int w32_num_mouse_buttons;
@@ -3221,11 +3222,13 @@
       frame->mouse_moved = 1;
       last_mouse_scroll_bar = Qnil;
       note_mouse_highlight (frame, -1, -1);
+      last_mouse_glyph_frame = 0;
       return 1;
     }
 
   /* Has the mouse moved off the glyph it was on at the last sighting?  */
-  if (mouse_x < last_mouse_glyph.left
+  if (frame != last_mouse_glyph_frame
+      || mouse_x < last_mouse_glyph.left
       || mouse_x >= last_mouse_glyph.right
       || mouse_y < last_mouse_glyph.top
       || mouse_y >= last_mouse_glyph.bottom)
@@ -3238,6 +3241,7 @@
 	 to keep track of the mouse for help_echo and highlighting at
 	 other times.  */
       remember_mouse_glyph (frame, mouse_x, mouse_y, &last_mouse_glyph);
+      last_mouse_glyph_frame = frame;
       return 1;
     }
 
@@ -3361,19 +3365,9 @@
 	       on it, i.e. into the same rectangles that matrices on
 	       the frame are divided into.  */
 
-#if OLD_REDISPLAY_CODE
-	    int ignore1, ignore2;
-
-	    ScreenToClient (FRAME_W32_WINDOW (f1), &pt);
-
-	    pixel_to_glyph_coords (f1, pt.x, pt.y, &ignore1, &ignore2,
-				   &last_mouse_glyph,
-				   FRAME_W32_DISPLAY_INFO (f1)->grabbed
-				   || insist);
-#else
 	    ScreenToClient (FRAME_W32_WINDOW (f1), &pt);
 	    remember_mouse_glyph (f1, pt.x, pt.y, &last_mouse_glyph);
-#endif
+	    last_mouse_glyph_frame = f1;
 
 	    *bar_window = Qnil;
 	    *part = 0;
--- a/src/xterm.c	Sun Mar 12 05:02:59 2006 +0000
+++ b/src/xterm.c	Wed Mar 15 17:22:12 2006 +0000
@@ -7547,18 +7547,17 @@
 {
   struct x_error_message_stack *tmp;
 
+  BLOCK_INPUT;
+
   /* The display may have been closed before this function is called.
      Check if it is still open before calling XSync.  */
   if (x_display_info_for_display (x_error_message->dpy) != 0)
-    {
-      BLOCK_INPUT;
-      XSync (x_error_message->dpy, False);
-      UNBLOCK_INPUT;
-    }
+    XSync (x_error_message->dpy, False);
 
   tmp = x_error_message;
   x_error_message = x_error_message->prev;
   xfree (tmp);
+  UNBLOCK_INPUT;
 }
 
 /* If any X protocol errors have arrived since the last call to