changeset 90099:fa9654493afb

Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-10 Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-59 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-68 Update from CVS
author Miles Bader <miles@gnu.org>
date Wed, 02 Feb 2005 01:54:00 +0000
parents 59a447f7a6ba (current diff) 615d37ab8a5d (diff)
children 72cf6261961e
files etc/NEWS lib-src/ChangeLog lib-src/movemail.c lisp/ChangeLog lisp/calc/calc-aent.el lisp/calc/calc-embed.el lisp/calc/calc-ext.el lisp/calc/calc-help.el lisp/calc/calc-lang.el lisp/calc/calc-prog.el lisp/calc/calc.el lisp/calc/calccomp.el lisp/comint.el lisp/cus-edit.el lisp/dired.el lisp/files.el lisp/gnus/ChangeLog lisp/gnus/gnus-art.el lisp/man.el lisp/progmodes/compile.el lisp/progmodes/gdb-ui.el lisp/rect.el lisp/ses.el lisp/simple.el lisp/textmodes/ispell.el lisp/wid-edit.el lispref/ChangeLog lispref/commands.texi lispref/customize.texi lispref/display.texi lispref/text.texi man/ChangeLog man/basic.texi man/building.texi man/custom.texi man/display.texi man/files.texi man/frames.texi man/glossary.texi man/help.texi man/macos.texi man/maintaining.texi man/major.texi man/mini.texi man/misc.texi man/mule.texi man/picture.texi man/programs.texi man/screen.texi man/sending.texi src/ChangeLog src/buffer.c src/casetab.c src/macterm.c src/undo.c src/xdisp.c src/xfns.c
diffstat 58 files changed, 1352 insertions(+), 524 deletions(-) [+]
line wrap: on
line diff
--- a/admin/FOR-RELEASE	Mon Jan 31 01:41:13 2005 +0000
+++ b/admin/FOR-RELEASE	Wed Feb 02 01:54:00 2005 +0000
@@ -208,7 +208,7 @@
 man/msdog.texi
 man/mule.texi       "Luc Teirlinck"
 man/m-x.texi        "Luc Teirlinck"
-man/picture.texi
+man/picture.texi    Joakim Verona <joakim@verona.se>
 man/programs.texi   "Stephen Eglen"
 man/regs.texi       "Luc Teirlinck"
 man/rmail.texi
--- a/etc/NEWS	Mon Jan 31 01:41:13 2005 +0000
+++ b/etc/NEWS	Wed Feb 02 01:54:00 2005 +0000
@@ -250,8 +250,8 @@
 
 +++
 ** When the undo information of the current command gets really large
-(beyond the value of `undo-outer-limit'), Emacs asks you whether to
-discard it or keep it.
+(beyond the value of `undo-outer-limit'), Emacs discards it and warns
+you about it.
 
 ** line-move-ignore-invisible now defaults to t.
 
@@ -2562,6 +2562,11 @@
 
 * Lisp Changes in Emacs 21.4
 
+** An element of buffer-undo-list can now have the form (FUNNAME .
+ARGS), where FUNNAME is a symbol other than t or nil.  That stands for
+a high-level change that should be undone by evaluating (apply FUNNAME
+ARGS).
+
 +++
 ** The line-move, scroll-up, and scroll-down functions will now
 modify the window vscroll to scroll through display rows that are
--- a/lib-src/ChangeLog	Mon Jan 31 01:41:13 2005 +0000
+++ b/lib-src/ChangeLog	Wed Feb 02 01:54:00 2005 +0000
@@ -1,3 +1,7 @@
+2005-01-29  Richard M. Stallman  <rms@gnu.org>
+
+	* movemail.c (popmail): Don't use Errmsg as format string.
+
 2004-12-26  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
 	* make-docfile.c: Include stdlib.h even if WINDOWSNT is not
--- a/lib-src/movemail.c	Mon Jan 31 01:41:13 2005 +0000
+++ b/lib-src/movemail.c	Wed Feb 02 01:54:00 2005 +0000
@@ -789,7 +789,7 @@
       mbx_delimit_begin (mbf);
       if (pop_retr (server, i, mbf) != OK)
 	{
-	  error (Errmsg, 0, 0);
+	  error ("%s", Errmsg, 0);
 	  close (mbfi);
 	  return EXIT_FAILURE;
 	}
--- a/lisp/ChangeLog	Mon Jan 31 01:41:13 2005 +0000
+++ b/lisp/ChangeLog	Wed Feb 02 01:54:00 2005 +0000
@@ -1,8 +1,158 @@
+2005-01-31  Jay Belanger  <belanger@truman.edu>
+
+	* calc/calc-embed.el (calc-embedded-find-bounds): Set the formula
+	bound on the line with the formula.
+
+2005-01-31  Kim F. Storm  <storm@cua.dk>
+
+	* ses.el (ses-create-cell-variable-range)
+	(ses-destroy-cell-variable-range, ses-reset-header-string)
+	(ses-set-with-undo, ses-unset-with-undo, ses-aset-with-undo)
+	(ses-insert-row): Fix format of apply undo entries.
+
+2005-01-31  Jay Belanger  <belanger@truman.edu>
+
+	* calc/calc-aent.el (math-read-token): Separate the TeX and LaTeX
+	parts.
+
+	* calc/calc-embed.el (calc-embedded-open-formula)
+	(calc-embedded-close-formula): Ignore matrix environments.
+
+	* calc/calc-ext.el (math-read-big-expr): Make LaTeX the default
+	TeX mode.
+
+	* calc/calc-lang.el (math-function-table, math-oper-table)
+	(math-variable-table): Adjust the LaTeX portions.
+
+	* calc/calc.el (math-tex-ignore-words): Remove LaTeX portion.
+	(math-latex-ignore-words): New constant.
+
+2005-01-31  Richard M. Stallman  <rms@gnu.org>
+
+	* textmodes/ispell.el (ispell-local-dictionary-overridden): New var.
+	(ispell-local-dictionary): Doc fix.
+	(ispell-dictionary-alist): Don't include ispell-local-dictionary-alist.
+	Don't reinitialize at run time.  Don't defcustom.
+	All uses changed to append ispell-local-dictionary-alist,
+	or check it first.
+	(ispell-current-dictionary): New variable for dictionary in use.
+	(ispell-dictionary): Now used only for global default.
+	(ispell-start-process): Set ispell-current-dictionary,
+	not ispell-dictionary.
+	(ispell-change-dictionary): Use this only for setting
+	user preferences.
+	(ispell-internal-change-dictionary): New function
+	to change the current dictionary in use.
+	(ispell-region, ispell-process-line, ispell-buffer-local-dict):
+	Use ispell-current-dictionary.
+	Handle ispell-local-dictionary-overridden.
+	(ispell-buffer-local-dict): Call ispell-internal-change-dictionary.
+
+2005-01-31  Jay Belanger  <belanger@truman.edu>
+
+	* calc/calc-aent.el (math-read-token): Add support for LaTeX.
+
+	* calc/calc-ext.el: Add calc-latex-language to autoloads.
+	(calc-mode-map): Add calc-latex-language.
+
+	* calc/calc-lang.el (calc-latex-language, math-latex-parse-frac)
+	(math-latex-print-frac): New functions.
+	(math-oper-table, math-function-table, math-variable-table)
+	(math-complex-format, math-input-filter): Add latex properties.
+	(calc-set-language): Set math-expr-special-function-mapping.
+
+	* calc/calc-prog.el (calc-edit-user-syntax, calc-fix-token-name)
+	(calc-write-parse-table-part):  Add LaTeX support.
+
+	* calc/calc.el (calc-language): Adjust docstring.
+	(calc-set-mode-line): Add LaTeX support.
+	(math-expr-special-function-mapping): New variable.
+	(math-tex-ignore-words): Add to list.
+
+	* calc/calccomp.el (math-compose-expr, math-compose-rows):
+	Add LaTeX support.
+	(math-compose-expr): Add support for special functions.
+
+	* calc/calc-help.el (calc-d-prefix-help): Add LaTeX.
+
+2005-01-31  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gdb-ui.el (gdb-memory-address)
+	(gdb-memory-repeat-count, gdb-memory-format, gdb-memory-unit)
+	(gdb-memory-mode-map, gdb-memory-format-keymap)
+	(gdb-memory-format-menu, gdb-memory-unit-keymap)
+	(gdb-memory-unit-menu): New variables for a buffer
+	that lets the user examine program memory.
+	(gdb-memory-set-address, gdb-memory-set-repeat-count)
+	(gdb-memory-format-binary, gdb-memory-format-octal)
+	(gdb-memory-format-unsigned, gdb-memory-format-signed)
+	(gdb-memory-format-hexadecimal, gdb-memory-format-menu)
+	(gdb-memory-format-menu-1, gdb-memory-unit-giant)
+	(gdb-memory-unit-word, gdb-memory-unit-halfword)
+	(gdb-memory-unit-byte, gdb-memory-unit-menu)
+	(gdb-memory-unit-menu-1, gdb-make-header-line-mouse-map)
+	(gdb-memory-mode, gdb-memory-buffer-name)
+	(gdb-display-memory-buffer, gdb-frame-memory-buffer):
+	New functions for above buffer.
+
+2005-01-30  Richard M. Stallman  <rms@gnu.org>
+
+	* cus-edit.el (custom-bury-buffer): Function deleted.
+	(custom-buffer-done-function): Option deleted.
+	(custom-buffer-done-kill): New (replacement option.
+	(Custom-buffer-done): Call quit-window.
+	(custom-buffer-create-internal): Update for above changes.
+
+2005-01-29  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* simple.el (undo-ask-before-discard): New var.
+	(undo-outer-limit-truncate): Implement it.
+	(undo-extra-outer-limit): Doc update.
+
+2005-01-29  Richard M. Stallman  <rms@gnu.org>
+
+	* ses.el (undo-more): defadvice deleted.
+	(ses-begin-change): Doc fix.
+
+	* dired.el (dired-mode-map): Remap `undo' and `advertised-undo'
+	instead of rebinding C-x u and C-_.
+
+	* files.el (normal-backup-enable-predicate): Return nil for files
+	in /tmp, regardless of temporary-file-directory.
+
+	* man.el (Man-getpage-in-background): Disable undo in Man buffer.
+
+	* rect.el (delete-rectangle-line, delete-extract-rectangle-line)
+	(open-rectangle, delete-whitespace-rectangle-line)
+	(clear-rectangle-line): If FILL, pass t instead of FILL
+	for move-to-column's 2nd arg.
+
+	* simple.el (undo): Fix the test for continuing a series of undos.
+	(undo-more): Set pending-undo-list to t when we reach end.
+	(pending-undo-list): defvar moved up.
+
+	* wid-edit.el (widget-button-click):
+	Shorten the range of the track-mouse binding.
+
+	* comint.el (comint-insert-input): Undo previous changes;
+	use last-input-event in interactive spec.
+
+2005-01-29  Eli Zaretskii  <eliz@gnu.org>
+
+	* progmodes/compile.el (compilation-start): Bind buffer-read-only
+	to nil before invoking call-process.  Reset buffer's modified flag
+	after fontifying it in the no-async branch.
+
+	* wid-edit.el (widget-specify-button): If mouse pointer shape
+	cannot be changed, use mouse face instead.
+
 2005-01-29  Nick Roberts  <nickrob@snap.net.nz>
 
 	* progmodes/gdb-ui.el (gdb-info-breakpoints-custom)
 	(gdb-goto-breakpoint): Make breakpoint handling work on template
-	functions in C++. Reported by Martin Reed <mjreed@essex.ac.uk>
+	functions in C++.  Reported by Martin Reed <mjreed@essex.ac.uk>
+	(gdb-assembler-custom): Update to recognise breakpoint information
+	added on 2005-01-19.
 
 2005-01-28  Eli Zaretskii  <eliz@gnu.org>
 
--- a/lisp/calc/calc-aent.el	Mon Jan 31 01:41:13 2005 +0000
+++ b/lisp/calc/calc-aent.el	Wed Feb 02 01:54:00 2005 +0000
@@ -690,7 +690,7 @@
                           math-exp-pos)
 		      (or (eq math-exp-pos 0)
 			  (and (memq calc-language '(nil flat big unform
-							 tex eqn))
+							 tex latex eqn))
 			       (eq (string-match "[^])}\"a-zA-Z0-9'$]_"
 						 math-exp-str (1- math-exp-pos))
 				   (1- math-exp-pos))))))
@@ -756,6 +756,34 @@
 		   math-exp-pos (match-end 0)
 		   math-expr-data (math-restore-dashes
 			     (math-match-substring math-exp-str 1)))
+	     (let ((code (assoc math-expr-data math-latex-ignore-words)))
+	       (cond ((null code))
+		     ((null (cdr code))
+		      (math-read-token))
+		     ((eq (nth 1 code) 'punc)
+		      (setq math-exp-token 'punc
+			    math-expr-data (nth 2 code)))
+                      ((and (eq (nth 1 code) 'mat)
+                            (string-match " *{" math-exp-str math-exp-pos))
+		      (setq math-exp-pos (match-end 0)
+			    math-exp-token 'punc
+			    math-expr-data "[")
+		      (let ((right (string-match "}" math-exp-str math-exp-pos)))
+			(and right
+			     (setq math-exp-str (copy-sequence math-exp-str))
+			     (aset math-exp-str right ?\])))))))
+	    ((and (= ch ?\\) (eq calc-language 'latex)
+		  (< math-exp-pos (1- (length math-exp-str))))
+	     (or (string-match "\\\\hbox *{\\([a-zA-Z0-9]+\\)}" 
+                               math-exp-str math-exp-pos)
+                 (string-match "\\\\text *{\\([a-zA-Z0-9]+\\)}" 
+                               math-exp-str math-exp-pos)
+		 (string-match "\\(\\\\\\([a-zA-Z]+\\|[^a-zA-Z]\\)\\)" 
+                               math-exp-str math-exp-pos))
+	     (setq math-exp-token 'symbol
+		   math-exp-pos (match-end 0)
+		   math-expr-data (math-restore-dashes
+			     (math-match-substring math-exp-str 1)))
 	     (let ((code (assoc math-expr-data math-tex-ignore-words)))
 	       (cond ((null code))
 		     ((null (cdr code))
@@ -763,8 +791,23 @@
 		     ((eq (nth 1 code) 'punc)
 		      (setq math-exp-token 'punc
 			    math-expr-data (nth 2 code)))
-		     ((and (eq (nth 1 code) 'mat)
-			   (string-match " *{" math-exp-str math-exp-pos))
+                     ((and (eq (nth 1 code) 'begenv)
+                           (string-match " *{\\([^}]*\\)}" math-exp-str math-exp-pos))
+                      (setq math-exp-pos (match-end 0)
+                            envname (match-string 1 math-exp-str)
+                            math-exp-token 'punc
+                            math-expr-data "[")
+                      (cond ((or (string= envname "matrix")
+                                 (string= envname "bmatrix")
+                                 (string= envname "smallmatrix")
+                                 (string= envname "pmatrix"))
+                             (if (setq j (string-match (concat "\\\\end{" envname "}")
+                                               math-exp-str math-exp-pos))
+                                 (setq math-exp-str 
+                                       (replace-match "]" t t math-exp-str))
+                               (error "%s" (concat "No closing \\end{" envname "}"))))))
+                      ((and (eq (nth 1 code) 'mat)
+                            (string-match " *{" math-exp-str math-exp-pos))
 		      (setq math-exp-pos (match-end 0)
 			    math-exp-token 'punc
 			    math-expr-data "[")
@@ -800,11 +843,11 @@
 	     (setq math-exp-pos (match-end 0))
 	     (math-read-token))
 	    (t
-	     (if (and (eq ch ?\{) (memq calc-language '(tex eqn)))
+	     (if (and (eq ch ?\{) (memq calc-language '(tex latex eqn)))
 		 (setq ch ?\())
-	     (if (and (eq ch ?\}) (memq calc-language '(tex eqn)))
+	     (if (and (eq ch ?\}) (memq calc-language '(tex latex eqn)))
 		 (setq ch ?\)))
-	     (if (and (eq ch ?\&) (eq calc-language 'tex))
+	     (if (and (eq ch ?\&) (memq calc-language '(tex latex)))
 		 (setq ch ?\,))
 	     (setq math-exp-token 'punc
 		   math-expr-data (char-to-string ch)
--- a/lisp/calc/calc-embed.el	Mon Jan 31 01:41:13 2005 +0000
+++ b/lisp/calc/calc-embed.el	Wed Feb 02 01:54:00 2005 +0000
@@ -48,11 +48,11 @@
 (defvar calc-embedded-some-active nil)
 (make-variable-buffer-local 'calc-embedded-some-active)
 
-(defvar calc-embedded-open-formula "\\`\\|^\n\\|\\$\\$?\\|\\\\\\[\\|^\\\\begin.*\n\\|^@.*\n\\|^\\.EQ.*\n\\|\\\\(\\|^%\n\\|^\\.\\\\\"\n"
+(defvar calc-embedded-open-formula "\\`\\|^\n\\|\\$\\$?\\|\\\\\\[\\|^\\\\begin[^{].*\n\\|^\\\\begin{.*[^x]}.*\n\\|^@.*\n\\|^\\.EQ.*\n\\|\\\\(\\|^%\n\\|^\\.\\\\\"\n"
   "*A regular expression for the opening delimiter of a formula used by
 calc-embedded.")
 
-(defvar calc-embedded-close-formula "\\'\\|\n$\\|\\$\\$?\\|\\\\]\\|^\\\\end.*\n\\|^@.*\n\\|^\\.EN.*\n\\|\\\\)\\|\n%\n\\|^\\.\\\\\"\n"
+(defvar calc-embedded-close-formula "\\'\\|\n$\\|\\$\\$?\\|\\\\]\\|^\\\\end[^{].*\n\\|^\\\\end{.*[^x]}.*\n\\|^@.*\n\\|^\\.EN.*\n\\|\\\\)\\|\n%\n\\|^\\.\\\\\"\n"
   "*A regular expression for the closing delimiter of a formula used by
 calc-embedded.")
 
@@ -417,6 +417,8 @@
 	 (forward-char -1))
     (setq calc-embed-outer-top (point))
     (goto-char (match-end 0))
+    (if (looking-at "[ \t]*$")
+        (end-of-line))
     (if (eq (following-char) ?\n)
 	(forward-char 1))
     (or (bolp)
--- a/lisp/calc/calc-ext.el	Mon Jan 31 01:41:13 2005 +0000
+++ b/lisp/calc/calc-ext.el	Wed Feb 02 01:54:00 2005 +0000
@@ -217,6 +217,7 @@
   (define-key calc-mode-map "dO" 'calc-flat-language)
   (define-key calc-mode-map "dP" 'calc-pascal-language)
   (define-key calc-mode-map "dT" 'calc-tex-language)
+  (define-key calc-mode-map "dL" 'calc-latex-language)
   (define-key calc-mode-map "dU" 'calc-unformatted-language)
   (define-key calc-mode-map "dW" 'calc-maple-language)
   (define-key calc-mode-map "d[" 'calc-truncate-up)
@@ -998,7 +999,7 @@
  ("calc-lang" calc-big-language calc-c-language calc-eqn-language
 calc-flat-language calc-fortran-language calc-maple-language
 calc-mathematica-language calc-normal-language calc-pascal-language
-calc-tex-language calc-unformatted-language)
+calc-tex-language calc-latex-language calc-unformatted-language)
 
  ("calc-map" calc-accumulate calc-apply calc-inner-product calc-map
 calc-map-equation calc-map-stack calc-outer-product calc-reduce)
@@ -2946,13 +2947,13 @@
        (setq str (concat (substring str 0 (match-beginning 0))
 			 (substring str (match-end 0)))))
   (if (string-match "\\\\[^ \n|]" str)
-      (if (eq calc-language 'tex)
+      (if (eq calc-language 'latex)
 	  (math-read-expr str)
-	(let ((calc-language 'tex)
+	(let ((calc-language 'latex)
 	      (calc-language-option nil)
-	      (math-expr-opers (get 'tex 'math-oper-table))
-	      (math-expr-function-mapping (get 'tex 'math-function-table))
-	      (math-expr-variable-mapping (get 'tex 'math-variable-table)))
+	      (math-expr-opers (get 'latex 'math-oper-table))
+	      (math-expr-function-mapping (get 'latex 'math-function-table))
+	      (math-expr-variable-mapping (get 'latex 'math-variable-table)))
 	  (math-read-expr str)))
     (let ((math-read-big-lines nil)
 	  (pos 0)
--- a/lisp/calc/calc-help.el	Mon Jan 31 01:41:13 2005 +0000
+++ b/lisp/calc/calc-help.el	Wed Feb 02 01:54:00 2005 +0000
@@ -593,7 +593,7 @@
      "Why; Line-nums, line-Breaks; <, =, > (justify); Plain"
      "\" (strings); Truncate, [, ]; SPC (refresh), RET, @"
      "SHIFT + language: Normal, One-line, Big, Unformatted"
-     "SHIFT + language: C, Pascal, Fortran; TeX, Eqn"
+     "SHIFT + language: C, Pascal, Fortran; TeX, LaTeX, Eqn"
      "SHIFT + language: Mathematica, W=Maple")
    "display" ?d))
 
--- a/lisp/calc/calc-lang.el	Mon Jan 31 01:41:13 2005 +0000
+++ b/lisp/calc/calc-lang.el	Wed Feb 02 01:54:00 2005 +0000
@@ -36,6 +36,7 @@
 (defun calc-set-language (lang &optional option no-refresh)
   (setq math-expr-opers (or (get lang 'math-oper-table) math-standard-opers)
 	math-expr-function-mapping (get lang 'math-function-table)
+	math-expr-special-function-mapping (get lang 'math-special-function-table)
 	math-expr-variable-mapping (get lang 'math-variable-table)
 	calc-language-input-filter (get lang 'math-input-filter)
 	calc-language-output-filter (get lang 'math-output-filter)
@@ -296,6 +297,26 @@
 		  "TeX language mode with \\func{\\hbox{var}}")
 	      "TeX language mode"))))
 
+(defun calc-latex-language (n)
+  (interactive "P")
+  (calc-wrapper
+   (and n (setq n (prefix-numeric-value n)))
+   (calc-set-language 'latex n)
+   (cond ((not n)
+          (message "LaTeX language mode"))
+         ((= n 0)
+          (message "LaTeX language mode with multiline matrices"))
+         ((= n 1)
+          (message "LaTeX language mode with \\text{func}(\\text{var})"))
+         ((> n 1)
+          (message 
+           "LaTeX language mode with \\text{func}(\\text{var}) and multiline matrices"))
+         ((= n -1)
+          (message "LaTeX language mode with \\func(\\text{var})"))
+         ((< n -1)
+          (message 
+           "LaTeX language mode with \\func(\\text{var}) and multiline matrices")))))
+
 (put 'tex 'math-oper-table
   '( ( "u+"       ident		   -1 1000 )
      ( "u-"       neg		   -1 1000 )
@@ -406,6 +427,80 @@
   str)
 (put 'tex 'math-input-filter 'math-tex-input-filter)
 
+(put 'latex 'math-oper-table
+     (append (get 'tex 'math-oper-table)
+             '(( "\\Hat"    calcFunc-Hat     -1  950 )
+               ( "\\Check"  calcFunc-Check   -1  950 )
+               ( "\\Tilde"  calcFunc-Tilde   -1  950 )
+               ( "\\Acute"  calcFunc-Acute   -1  950 )
+               ( "\\Grave"  calcFunc-Grave   -1  950 )
+               ( "\\Dot"    calcFunc-Dot     -1  950 )
+               ( "\\Ddot"   calcFunc-Dotdot  -1  950 )
+               ( "\\Breve"  calcFunc-Breve   -1  950 )
+               ( "\\Bar"    calcFunc-Bar     -1  950 )
+               ( "\\Vec"    calcFunc-VEC     -1  950 )
+               ( "\\dddot"  calcFunc-dddot   -1  950 )
+               ( "\\ddddot" calcFunc-ddddot  -1  950 )
+               ( "\div"     /                170 171 )
+               ( "\\le"     calcFunc-leq     160 161 )
+               ( "\\leqq"   calcFunc-leq     160 161 )
+               ( "\\leqsland" calcFunc-leq   160 161 )
+               ( "\\ge"	    calcFunc-geq     160 161 )
+               ( "\\geqq"   calcFunc-geq     160 161 )
+               ( "\\geqslant" calcFunc-geq   160 161 )
+               ( "="	    calcFunc-eq	     160 161 )
+               ( "\\neq"    calcFunc-neq     160 161 )
+               ( "\\ne"	    calcFunc-neq     160 161 )
+               ( "\\lnot"   calcFunc-lnot     -1 121 )
+               ( "\\land"   calcFunc-land    110 111 )
+               ( "\\lor"    calcFunc-lor     100 101 )
+               ( "?"	    (math-read-if)    91  90 )
+               ( "!!!"	    calcFunc-pnot     -1  85 )
+               ( "&&&"	    calcFunc-pand     80  81 )
+               ( "|||"	    calcFunc-por      75  76 )
+               ( "\\gets"   calcFunc-assign   51  50 )
+               ( ":="	    calcFunc-assign   51  50 )
+               ( "::"       calcFunc-condition 45 46 )
+               ( "\\to"	    calcFunc-evalto   40  41 )
+               ( "\\to"	    calcFunc-evalto   40  -1 )
+               ( "=>" 	    calcFunc-evalto   40  41 )
+               ( "=>" 	    calcFunc-evalto   40  -1 ))))
+
+(put 'latex 'math-function-table
+     (append
+      (get 'tex 'math-function-table)
+      '(( \\frac      . (math-latex-parse-frac /))
+        ( \\tfrac     . (math-latex-parse-frac /))
+        ( \\dfrac     . (math-latex-parse-frac /))
+        ( \\binom     . (math-latex-parse-frac calcFunc-choose))
+        ( \\tbinom    . (math-latex-parse-frac calcFunc-choose))
+        ( \\dbinom    . (math-latex-parse-frac calcFunc-choose))
+        ( \\phi	      . calcFunc-totient )
+        ( \\mu	      . calcFunc-moebius ))))
+
+(put 'latex 'math-special-function-table
+     '((/               . (math-latex-print-frac "\\frac"))
+       (calcFunc-choose . (math-latex-print-frac "\\binom"))))
+
+(put 'latex 'math-variable-table
+     (get 'tex 'math-variable-table))
+
+(put 'latex 'math-complex-format 'i)
+
+(defun math-latex-parse-frac (f val)
+  (let (numer denom)
+    (setq args (math-read-expr-list))
+    (math-read-token)
+    (setq margs (math-read-factor))
+    (list (nth 2 f) (car args) margs)))
+
+(defun math-latex-print-frac (a fn)
+  (list 'horiz (nth 1 fn) "{" (math-compose-expr (nth 1 a) -1)
+               "}{"
+               (math-compose-expr (nth 2 a) -1)
+               "}"))
+
+(put 'latex 'math-input-filter 'math-tex-input-filter)
 
 (defun calc-eqn-language (n)
   (interactive "P")
--- a/lisp/calc/calc-prog.el	Mon Jan 31 01:41:13 2005 +0000
+++ b/lisp/calc/calc-prog.el	Wed Feb 02 01:54:00 2005 +0000
@@ -477,6 +477,7 @@
 		     (format "Editing %s-Mode Syntax Table. "
 			     (cond ((null lang) "Normal")
 				   ((eq lang 'tex) "TeX")
+                                   ((eq lang 'latex) "LaTeX")
 				   (t (capitalize (symbol-name lang))))))
      (calc-write-parse-table (cdr (assq lang calc-user-parse-tables))
 			     lang)))
@@ -519,7 +520,7 @@
     (cond ((stringp (car p))
 	   (let ((s (car p)))
 	     (if (and (string-match "\\`\\\\dots\\>" s)
-		      (not (eq calc-lang 'tex)))
+		      (not (eq calc-lang '(tex latex))))
 		 (setq s (concat ".." (substring s 5))))
 	     (if (or (and (string-match
 			   "[a-zA-Z0-9\"{}]\\|\\`:=\\'\\|\\`#\\|\\`%%" s)
@@ -582,11 +583,11 @@
 (defun calc-fix-token-name (name &optional unquoted)
   (cond ((string-match "\\`\\.\\." name)
 	 (concat "\\dots" (substring name 2)))
-	((and (equal name "{") (memq calc-lang '(tex eqn)))
+	((and (equal name "{") (memq calc-lang '(tex latex eqn)))
 	 "(")
-	((and (equal name "}") (memq calc-lang '(tex eqn)))
+	((and (equal name "}") (memq calc-lang '(tex latex eqn)))
 	 ")")
-	((and (equal name "&") (eq calc-lang 'tex))
+	((and (equal name "&") (eq calc-lang '(tex latex)))
 	 ",")
 	((equal name "#")
 	 (search-backward "#")
--- a/lisp/calc/calc.el	Mon Jan 31 01:41:13 2005 +0000
+++ b/lisp/calc/calc.el	Wed Feb 02 01:54:00 2005 +0000
@@ -405,6 +405,7 @@
   pascal	Use Pascal language notation.
   fortran	Use Fortran language notation.
   tex		Use TeX notation.
+  latex         Use LaTeX notation.
   eqn		Use eqn notation.
   math		Use Mathematica(tm) notation.
   maple		Use Maple notation.")
@@ -704,6 +705,7 @@
 (defvar math-eval-rules-cache-tag t)
 (defvar math-radix-explicit-format t)
 (defvar math-expr-function-mapping nil)
+(defvar math-expr-special-function-mapping nil)
 (defvar math-expr-variable-mapping nil)
 (defvar math-read-expr-quotes nil)
 (defvar math-working-step nil)
@@ -1368,6 +1370,7 @@
 		     (if calc-leading-zeros "Zero " "")
 		     (cond ((null calc-language) "")
 			   ((eq calc-language 'tex) "TeX ")
+			   ((eq calc-language 'latex) "LaTeX ")
 			   (t (concat
 			       (capitalize (symbol-name calc-language))
 			       " ")))
@@ -3218,9 +3221,13 @@
      ("\\cal") ("\\mit") ("\\Cal") ("\\Bbb") ("\\frak") ("\\goth")
      ("\\evalto")
      ("\\matrix" mat) ("\\bmatrix" mat) ("\\pmatrix" mat)
+     ("\\begin" begenv)
      ("\\cr" punc ";") ("\\\\" punc ";") ("\\*" punc "*")
-     ("\\{" punc "[") ("\\}" punc "]")
-))
+     ("\\{" punc "[") ("\\}" punc "]")))
+
+(defconst math-latex-ignore-words
+  (append math-tex-ignore-words
+          '(("\\begin" begenv))))
 
 (defconst math-eqn-ignore-words
   '( ("roman") ("bold") ("italic") ("mark") ("lineup") ("evalto")
@@ -3228,8 +3235,7 @@
      ("right" ("floor") ("ceil"))
      ("arc" ("sin") ("cos") ("tan") ("sinh") ("cosh") ("tanh"))
      ("size" n) ("font" n) ("fwd" n) ("back" n) ("up" n) ("down" n)
-     ("above" punc ",")
-))
+     ("above" punc ",")))
 
 (defconst math-standard-opers
   '( ( "_"     calcFunc-subscr 1200 1201 )
--- a/lisp/calc/calccomp.el	Mon Jan 31 01:41:13 2005 +0000
+++ b/lisp/calc/calccomp.el	Wed Feb 02 01:54:00 2005 +0000
@@ -79,7 +79,8 @@
 
 
 (defun math-compose-expr (a prec)
-  (let ((math-compose-level (1+ math-compose-level)))
+  (let ((math-compose-level (1+ math-compose-level))
+        spfn)
     (cond
      ((or (and (eq a math-comp-selected) a)
 	  (and math-comp-tagged
@@ -89,10 +90,13 @@
 	(list 'tag a (math-compose-expr a prec))))
      ((and (not (consp a)) (not (integerp a)))
       (concat "'" (prin1-to-string a)))
+     ((setq spfn (assq (car-safe a) math-expr-special-function-mapping))
+      (setq spfn (cdr spfn))
+      (funcall (car spfn) a spfn))
      ((math-scalarp a)
       (if (or (eq (car-safe a) 'frac)
 	      (and (nth 1 calc-frac-format) (Math-integerp a)))
-	  (if (memq calc-language '(tex eqn math maple c fortran pascal))
+	  (if (memq calc-language '(tex latex eqn math maple c fortran pascal))
 	      (let ((aa (math-adjust-fraction a))
 		    (calc-frac-format nil))
 		(math-compose-expr (list '/
@@ -265,34 +269,44 @@
 		      (append '(horiz "\\matrix{ ")
 			      (math-compose-tex-matrix (cdr a))
 			      '(" }"))
-		    (if (and (eq calc-language 'eqn)
-			     (math-matrixp a))
-			(append '(horiz "matrix { ")
-				(math-compose-eqn-matrix
-				 (cdr (math-transpose a)))
-				'("}"))
-		      (if (and (eq calc-language 'maple)
-			       (math-matrixp a))
-			  (list 'horiz
-				"matrix("
-				math-comp-left-bracket
-				(math-compose-vector (cdr a) 
+                    (if (and (eq calc-language 'latex)
+                             (math-matrixp a))
+                        (if (memq calc-language-option '(-2 0 2))
+                            (append '(vleft 0 "\\begin{pmatrix}")
+                                    (math-compose-tex-matrix (cdr a))
+                                    '("\\end{pmatrix}"))
+                          (append '(horiz "\\begin{pmatrix} ")
+                                  (math-compose-tex-matrix (cdr a))
+                                  '(" \\end{pmatrix}")))
+                      (if (and (eq calc-language 'eqn)
+                               (math-matrixp a))
+                          (append '(horiz "matrix { ")
+                                  (math-compose-eqn-matrix
+                                   (cdr (math-transpose a)))
+                                  '("}"))
+                        (if (and (eq calc-language 'maple)
+                                 (math-matrixp a))
+                            (list 'horiz
+                                  "matrix("
+                                  math-comp-left-bracket
+                                  (math-compose-vector (cdr a) 
+                                                       (concat math-comp-comma " ")
+                                                       math-comp-vector-prec)
+                                  math-comp-right-bracket
+                                  ")")
+                          (list 'horiz
+                                math-comp-left-bracket
+                                (math-compose-vector (cdr a) 
                                                      (concat math-comp-comma " ")
-						     math-comp-vector-prec)
-				math-comp-right-bracket
-				")")
-			(list 'horiz
-			      math-comp-left-bracket
-			      (math-compose-vector (cdr a) 
-                                                   (concat math-comp-comma " ")
-						   math-comp-vector-prec)
-			      math-comp-right-bracket))))
+                                                     math-comp-vector-prec)
+                                math-comp-right-bracket)))))
 		(list 'horiz
 		      math-comp-left-bracket
 		      (math-compose-vector (list (nth 1 a) (nth 2 a) (nth 3 a))
 					   (concat math-comp-comma " ") 
                                            math-comp-vector-prec)
-		      math-comp-comma (if (eq calc-language 'tex) " \\ldots" " ...")
+		      math-comp-comma (if (memq calc-language '(tex latex)) 
+                                          " \\ldots" " ...")
 		      math-comp-comma " "
 		      (list 'break math-compose-level)
 		      (math-compose-expr (nth (1- (length a)) a)
@@ -326,12 +340,14 @@
       (let ((v (rassq (nth 2 a) math-expr-variable-mapping)))
 	(if v
 	    (symbol-name (car v))
-	  (if (and (eq calc-language 'tex)
+	  (if (and (memq calc-language '(tex latex))
 		   calc-language-option
 		   (not (= calc-language-option 0))
 		   (string-match "\\`[a-zA-Z][a-zA-Z0-9]+\\'"
 				 (symbol-name (nth 1 a))))
-	      (format "\\hbox{%s}" (symbol-name (nth 1 a)))
+              (if (eq calc-language 'latex)
+                  (format "\\text{%s}" (symbol-name (nth 1 a)))
+                (format "\\hbox{%s}" (symbol-name (nth 1 a))))
 	    (if (and math-compose-hash-args
 		     (let ((p calc-arg-values))
 		       (setq v 1)
@@ -359,7 +375,7 @@
 	    (if (eq calc-language 'maple) ""
 	      (if (memq (nth 1 a) '(0 1)) "(" "["))
 	    (math-compose-expr (nth 2 a) 0)
-	    (if (eq calc-language 'tex) " \\ldots "
+	    (if (memq calc-language '(tex latex)) " \\ldots "
 	      (if (eq calc-language 'eqn) " ... " " .. "))
 	    (math-compose-expr (nth 3 a) 0)
 	    (if (eq calc-language 'maple) ""
@@ -404,7 +420,7 @@
 	    (math-compose-expr (nth 2 a) 0)
 	    "]]"))
      ((and (eq (car a) 'calcFunc-sqrt)
-	   (eq calc-language 'tex))
+	   (memq calc-language '(tex latex)))
       (list 'horiz
 	    "\\sqrt{"
 	    (math-compose-expr (nth 1 a) 0)
@@ -440,7 +456,7 @@
 	      (math-comp-height a1)
 	      a1 '(rule ?-) a2)))
      ((and (memq (car a) '(calcFunc-sum calcFunc-prod))
-	   (eq calc-language 'tex)
+	   (memq calc-language '(tex latex))
 	   (= (length a) 5))
       (list 'horiz (if (eq (car a) 'calcFunc-sum) "\\sum" "\\prod")
 	    "_{" (math-compose-expr (nth 2 a) 0)
@@ -495,7 +511,7 @@
 	   (integerp (nth 2 a)))
       (let ((c (math-compose-expr (nth 1 a) -1)))
 	(if (> prec (nth 2 a))
-	    (if (eq calc-language 'tex)
+	    (if (memq calc-language '(tex latex))
 		(list 'horiz "\\left( " c " \\right)")
 	      (if (eq calc-language 'eqn)
 		  (list 'horiz "{left ( " c " right )}")
@@ -633,13 +649,13 @@
 		      (make-list (nth 1 a) c))))))
      ((and (eq (car a) 'calcFunc-evalto)
 	   (setq calc-any-evaltos t)
-	   (memq calc-language '(tex eqn))
+	   (memq calc-language '(tex latex eqn))
 	   (= math-compose-level (if math-comp-tagged 2 1))
 	   (= (length a) 3))
       (list 'horiz
-	    (if (eq calc-language 'tex) "\\evalto " "evalto ")
+	    (if (memq calc-language '(tex latex)) "\\evalto " "evalto ")
 	    (math-compose-expr (nth 1 a) 0)
-	    (if (eq calc-language 'tex) " \\to " " -> ")
+	    (if (memq calc-language '(tex latex)) " \\to " " -> ")
 	    (math-compose-expr (nth 2 a) 0)))
      (t
       (let ((op (and (not (eq calc-language 'unform))
@@ -651,7 +667,7 @@
 		    (/= (nth 3 op) -1))
 	       (cond
 		((> prec (or (nth 4 op) (min (nth 2 op) (nth 3 op))))
-		 (if (and (eq calc-language 'tex)
+		 (if (and (memq calc-language '(tex latex))
 			  (not (math-tex-expr-is-flat a)))
 		     (if (eq (car-safe a) '/)
 			 (list 'horiz "{" (math-compose-expr a -1) "}")
@@ -668,7 +684,7 @@
 				 (math-compose-expr a -1)
 				 " right )}")))
 		     (list 'horiz "(" (math-compose-expr a 0) ")"))))
-		((and (eq calc-language 'tex)
+		((and (memq calc-language '(tex latex))
 		      (memq (car a) '(/ calcFunc-choose calcFunc-evalto))
 		      (>= prec 0))
 		 (list 'horiz "{" (math-compose-expr a -1) "}"))
@@ -694,7 +710,7 @@
 		   (and (equal (car op) "^")
 			(eq (math-comp-first-char lhs) ?-)
 			(setq lhs (list 'horiz "(" lhs ")")))
-		   (and (eq calc-language 'tex)
+		   (and (memq calc-language '(tex latex))
 			(or (equal (car op) "^") (equal (car op) "_"))
 			(not (and (stringp rhs) (= (length rhs) 1)))
 			(setq rhs (list 'horiz "{" rhs "}")))
@@ -761,7 +777,7 @@
 		((or (> prec (or (nth 4 op) (nth 2 op)))
 		     (and (not (eq (assoc (car op) math-expr-opers) op))
 			  (> prec 0)))   ; don't write x% + y
-		 (if (and (eq calc-language 'tex)
+		 (if (and (memq calc-language '(tex latex))
 			  (not (math-tex-expr-is-flat a)))
 		     (list 'horiz "\\left( "
 			   (math-compose-expr a -1)
@@ -786,7 +802,7 @@
 	      ((and op (= (length a) 2) (= (nth 2 op) -1))
 	       (cond
 		((eq (nth 3 op) 0)
-		 (let ((lr (and (eq calc-language 'tex)
+		 (let ((lr (and (memq calc-language '(tex latex))
 				(not (math-tex-expr-is-flat (nth 1 a))))))
 		   (list 'horiz
 			 (if lr "\\left" "")
@@ -799,7 +815,7 @@
 			 (if lr "\\right" "")
 			 (car (nth 1 (memq op math-expr-opers))))))
 		((> prec (or (nth 4 op) (nth 3 op)))
-		 (if (and (eq calc-language 'tex)
+		 (if (and (memq calc-language '(tex latex))
 			  (not (math-tex-expr-is-flat a)))
 		     (list 'horiz "\\left( "
 			   (math-compose-expr a -1)
@@ -836,6 +852,7 @@
 				      ( pascal . math-compose-pascal )
 				      ( fortran . math-compose-fortran )
 				      ( tex . math-compose-tex )
+				      ( latex . math-compose-latex )
 				      ( eqn . math-compose-eqn )
 				      ( math . math-compose-math )
 				      ( maple . math-compose-maple ))))
@@ -866,20 +883,22 @@
 			       (symbol-name func))))
 		 (if (memq calc-language '(c fortran pascal maple))
 		     (setq func (math-to-underscores func)))
-		 (if (and (eq calc-language 'tex)
+		 (if (and (memq calc-language '(tex latex))
 			  calc-language-option
 			  (not (= calc-language-option 0))
 			  (string-match "\\`[a-zA-Z][a-zA-Z0-9]+\\'" func))
 		     (if (< (prefix-numeric-value calc-language-option) 0)
 			 (setq func (format "\\%s" func))
-		       (setq func (format "\\hbox{%s}" func))))
+		       (setq func (if (eq calc-language 'latex)
+                                      (format "\\text{%s}" func)
+                                    (format "\\hbox{%s}" func)))))
 		 (if (and (eq calc-language 'eqn)
 			  (string-match "[^']'+\\'" func))
 		     (let ((n (- (length func) (match-beginning 0) 1)))
 		       (setq func (substring func 0 (- n)))
 		       (while (>= (setq n (1- n)) 0)
 			 (setq func (concat func " prime")))))
-		 (cond ((and (eq calc-language 'tex)
+		 (cond ((and (eq calc-language '(tex latex))
 			     (or (> (length a) 2)
 				 (not (math-tex-expr-is-flat (nth 1 a)))))
 			(setq left "\\left( "
@@ -889,11 +908,13 @@
 				 (not (math-tex-expr-is-flat (nth 1 a)))))
 			(setq left "{left ( "
 			      right " right )}"))
-		       ((and (or (and (eq calc-language 'tex)
+		       ((and (or (and (memq calc-language '(tex latex))
 				      (eq (aref func 0) ?\\))
 				 (and (eq calc-language 'eqn)
 				      (memq (car a) math-eqn-special-funcs)))
-			     (not (string-match "\\hbox{" func))
+			     (not (or
+                                   (string-match "\\hbox{" func)
+                                   (string-match "\\text{" func)))
 			     (= (length a) 2)
 			     (or (Math-realp (nth 1 a))
 				 (memq (car (nth 1 a)) '(var *))))
@@ -968,7 +989,7 @@
       (if (<= count 0)
 	  (if (< count 0)
 	      (math-compose-rows (cdr a) -1 nil)
-	    (cons (concat (if (eq calc-language 'tex) "  \\ldots" "  ...")
+	    (cons (concat (if (memq calc-language '(tex latex)) "  \\ldots" "  ...")
 			  math-comp-comma)
 		  (math-compose-rows (cdr a) -1 nil)))
 	(cons (list 'horiz
@@ -983,9 +1004,8 @@
 
 (defun math-compose-tex-matrix (a)
   (if (cdr a)
-      (cons (math-compose-vector (cdr (car a)) " & " 0)
-	    (cons " \\\\ "
-		  (math-compose-tex-matrix (cdr a))))
+      (cons (append (math-compose-vector (cdr (car a)) " & " 0) '(" \\\\ "))
+            (math-compose-tex-matrix (cdr a)))
     (list (math-compose-vector (cdr (car a)) " & " 0))))
 
 (defun math-compose-eqn-matrix (a)
--- a/lisp/comint.el	Mon Jan 31 01:41:13 2005 +0000
+++ b/lisp/comint.el	Wed Feb 02 01:54:00 2005 +0000
@@ -788,7 +788,9 @@
 
 (defun comint-insert-input (&optional event)
   "In a Comint buffer, set the current input to the previous input at point."
-  (interactive "e")
+  ;; This doesn't use "e" because it is supposed to work
+  ;; for events without parameters.
+  (interactive (list last-input-event))
   (if event (mouse-set-point event))
   (let ((pos (point)))
     (if (not (eq (get-char-property pos 'field) 'input))
--- a/lisp/cus-edit.el	Mon Jan 31 01:41:13 2005 +0000
+++ b/lisp/cus-edit.el	Wed Feb 02 01:54:00 2005 +0000
@@ -1180,19 +1180,10 @@
 		(const links))
   :group 'custom-buffer)
 
-;; If we pass BUFFER to `bury-buffer', the buffer isn't removed from
-;; the window.
-(defun custom-bury-buffer (buffer)
-  (with-current-buffer buffer
-    (bury-buffer)))
-
-(defcustom custom-buffer-done-function 'custom-bury-buffer
-  "*Function called to remove a Custom buffer when the user is done with it.
-Called with one argument, the buffer to remove."
-  :type '(choice (function-item :tag "Bury buffer" custom-bury-buffer)
-		 (function-item :tag "Kill buffer" kill-buffer)
-		 (function :tag "Other"))
-  :version "21.1"
+(defcustom custom-buffer-done-kill nil
+  "*Non-nil means exiting a Custom buffer should kill it."
+  :type 'boolean
+  :version "21.4"
   :group 'custom-buffer)
 
 (defcustom custom-buffer-indent 3
@@ -1262,9 +1253,9 @@
   :group 'custom-buffer)
 
 (defun Custom-buffer-done (&rest ignore)
-  "Remove current buffer by calling `custom-buffer-done-function'."
+  "Exit current Custom buffer according to `custom-buffer-done-kill'."
   (interactive)
-  (funcall custom-buffer-done-function (current-buffer)))
+  (quit-window custom-buffer-done-kill))
 
 (defcustom custom-raised-buttons (not (equal (face-valid-attribute-values :box)
 					     '(("unspecified" . unspecified))))
@@ -1350,13 +1341,9 @@
 		 :tag "Finish"
 		 :help-echo
 		 (lambda (&rest ignore)
-		   (cond
-		    ((eq custom-buffer-done-function
-			 'custom-bury-buffer)
-		     "Bury this buffer")
-		    ((eq custom-buffer-done-function 'kill-buffer)
-		     "Kill this buffer")
-		    (t "Finish with this buffer")))
+		   (if custom-buffer-done-kill
+		       "Kill this buffer"
+		     "Bury this buffer"))
 		 :action #'Custom-buffer-done)
   (widget-insert "\n\n")
   (message "Creating customization items...")
--- a/lisp/dired.el	Mon Jan 31 01:41:13 2005 +0000
+++ b/lisp/dired.el	Wed Feb 02 01:54:00 2005 +0000
@@ -1197,8 +1197,8 @@
     ;; misc
     (define-key map "?" 'dired-summary)
     (define-key map "\177" 'dired-unmark-backward)
-    (define-key map "\C-_" 'dired-undo)
-    (define-key map "\C-xu" 'dired-undo)
+    (define-key map [remap undo] 'dired-undo)
+    (define-key map [remap advertised-undo] 'dired-undo)
 
     ;; Make menu bar items.
 
--- a/lisp/files.el	Mon Jan 31 01:41:13 2005 +0000
+++ b/lisp/files.el	Wed Feb 02 01:54:00 2005 +0000
@@ -2844,13 +2844,18 @@
 
 (defun normal-backup-enable-predicate (name)
   "Default `backup-enable-predicate' function.
-Checks for files in `temporary-file-directory' or
-`small-temporary-file-directory'."
+Checks for files in `temporary-file-directory',
+`small-temporary-file-directory', and /tmp."
   (not (or (let ((comp (compare-strings temporary-file-directory 0 nil
 					name 0 nil)))
 	     ;; Directory is under temporary-file-directory.
 	     (and (not (eq comp t))
 		  (< comp (- (length temporary-file-directory)))))
+	   (let ((comp (compare-strings "/tmp" 0 nil
+					name 0 nil)))
+	     ;; Directory is under /tmp.
+	     (and (not (eq comp t))
+		  (< comp (- (length "/tmp")))))
 	   (if small-temporary-file-directory
 	       (let ((comp (compare-strings small-temporary-file-directory
 					    0 nil
--- a/lisp/gnus/ChangeLog	Mon Jan 31 01:41:13 2005 +0000
+++ b/lisp/gnus/ChangeLog	Wed Feb 02 01:54:00 2005 +0000
@@ -1,3 +1,7 @@
+2005-01-30  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* gnus-art.el (gnus-article-mode): Turn off the "\ " non-break space.
+
 2005-01-28  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* message.el (message-beginning-of-line): Change the behavior when
@@ -11,8 +15,8 @@
 
 2005-01-28  Katsumi Yamaoka  <yamaoka@jpl.org>
 
-	* gnus-art.el (gnus-article-prepare): Remove
-	message-strip-forbidden-properties from the local hook.
+	* gnus-art.el (gnus-article-prepare):
+	Remove message-strip-forbidden-properties from the local hook.
 
 2005-01-24  Katsumi Yamaoka  <yamaoka@jpl.org>
 
@@ -33,9 +37,9 @@
 
 2004-12-27  Simon Josefsson  <jas@extundo.com>
 
-	* mm-bodies.el (mm-body-encoding): Don't permit 7-bit to be used
-	when mm-use-ultra-safe-encoding is enabled (e.g., for PGP/MIME)
-	and we have trailing white space.  Reported by Werner Koch <wk@gnupg.org>.
+	* mm-bodies.el (mm-body-encoding): Don't permit 7-bit to be used when
+	mm-use-ultra-safe-encoding is enabled (e.g., for PGP/MIME) and we have
+	trailing white space.  Reported by Werner Koch <wk@gnupg.org>.
 
 2004-12-17  Kim F. Storm  <storm@cua.dk>
 
@@ -408,11 +412,10 @@
 
 2004-10-18  Kevin Greiner  <kevin.greiner@compsol.cc>
 
-	* gnus-agent.el (gnus-agent-possibly-synchronize-flags): Ignore
-	servers that are offline.  Avoids having gnus-agent-toggle-plugged
-	first ask if you want to open a server and then, even when you
-	responded with no, asking if you want to synchronize the server's
-	flags.
+	* gnus-agent.el (gnus-agent-possibly-synchronize-flags): Ignore servers
+	that are offline.  Avoids having gnus-agent-toggle-plugged first ask if
+	you want to open a server and then, even when you responded with no,
+	asking if you want to synchronize the server's flags.
 	(gnus-agent-synchronize-flags-server): Rewrite read loop to handle
 	multi-line expressions.
 	(gnus-agent-synchronize-group-flags): New internal function.
@@ -560,9 +563,8 @@
 
 2004-10-18  Kevin Greiner <kevin.greiner@compsol.cc>
 
-	* gnus-start.el (gnus-convert-old-newsrc): Only write the
-	conversion message to newsrc-dribble when an actual conversion is
-	performed.
+	* gnus-start.el (gnus-convert-old-newsrc): Only write the conversion
+	message to newsrc-dribble when an actual conversion is performed.
 
 2004-10-18  Kevin Greiner <kevin.greiner@compsol.cc>
 
--- a/lisp/gnus/gnus-art.el	Mon Jan 31 01:41:13 2005 +0000
+++ b/lisp/gnus/gnus-art.el	Wed Feb 02 01:54:00 2005 +0000
@@ -3711,6 +3711,8 @@
   (make-local-variable 'gnus-article-image-alist)
   (make-local-variable 'gnus-article-charset)
   (make-local-variable 'gnus-article-ignored-charsets)
+  ;; Prevent recent Emacsen from displaying non-break space as "\ ".
+  (set (make-local-variable 'show-nonbreak-escape) nil)
   (gnus-set-default-directory)
   (buffer-disable-undo)
   (setq buffer-read-only t)
--- a/lisp/man.el	Mon Jan 31 01:41:13 2005 +0000
+++ b/lisp/man.el	Wed Feb 02 01:54:00 2005 +0000
@@ -697,6 +697,7 @@
       (setq buffer (generate-new-buffer bufname))
       (save-excursion
 	(set-buffer buffer)
+	(setq buffer-undo-list t)
 	(setq Man-original-frame (selected-frame))
 	(setq Man-arguments man-args))
       (let ((process-environment (copy-sequence process-environment))
--- a/lisp/progmodes/compile.el	Mon Jan 31 01:41:13 2005 +0000
+++ b/lisp/progmodes/compile.el	Wed Feb 02 01:54:00 2005 +0000
@@ -985,8 +985,9 @@
 	  (setq mode-line-process ":run")
 	  (force-mode-line-update)
 	  (sit-for 0)			; Force redisplay
-	  (let ((status (call-process shell-file-name nil outbuf nil "-c"
-				      command)))
+	  (let* ((buffer-read-only nil)	; call-process needs to modify outbuf
+		 (status (call-process shell-file-name nil outbuf nil "-c"
+				       command)))
 	    (cond ((numberp status)
 		   (compilation-handle-exit 'exit status
 					    (if (zerop status)
@@ -1003,6 +1004,7 @@
 	  ;; fontified, so fontify it now.
 	  (let ((font-lock-verbose nil)) ; shut up font-lock messages
 	    (font-lock-fontify-buffer))
+	  (set-buffer-modified-p nil)
 	  (message "Executing `%s'...done" command)))
       ;; Now finally cd to where the shell started make/grep/...
       (setq default-directory thisdir))
--- a/lisp/progmodes/gdb-ui.el	Mon Jan 31 01:41:13 2005 +0000
+++ b/lisp/progmodes/gdb-ui.el	Wed Feb 02 01:54:00 2005 +0000
@@ -53,8 +53,14 @@
 ;; Known Bugs:
 ;;
 ;; TODO:
-;; Use tree-widget.el instead of the speedbar for watch-expressions?
-;; Mark breakpoint locations on scroll-bar of source buffer?
+;; 1) Use MI command -data-read-memory for memory window.
+;; 2) Highlight changed register values (use MI commands
+;;    -data-list-register-values and -data-list-changed-registers instead
+;;    of 'info registers'.
+;; 3) Use tree-widget.el instead of the speedbar for watch-expressions?
+;; 4) Mark breakpoint locations on scroll-bar of source buffer?
+;; 5) After release of 21.4 use '-var-list-children --all-values'
+;;    and '-stack-list-locals 2' which need GDB 6.1 onwards.
 
 ;;; Code:
 
@@ -62,6 +68,7 @@
 
 (defvar gdb-current-address "main" "Initialisation for Assembler buffer.")
 (defvar gdb-previous-address nil)
+(defvar gdb-memory-address "main")
 (defvar gdb-previous-frame nil)
 (defvar gdb-current-frame nil)
 (defvar gdb-current-stack-level nil)
@@ -227,6 +234,7 @@
   ;; (re-)initialize
   (setq gdb-current-address "main")
   (setq gdb-previous-address nil)
+  (setq gdb-memory-address "main")
   (setq gdb-previous-frame nil)
   (setq gdb-current-frame nil)
   (setq gdb-current-stack-level nil)
@@ -840,6 +848,7 @@
 	(gdb-invalidate-breakpoints)
 	(gdb-invalidate-assembler)
 	(gdb-invalidate-registers)
+	(gdb-invalidate-memory)
 	(gdb-invalidate-locals)
 	(gdb-invalidate-threads)
 	(unless (eq system-type 'darwin) ;Breaks on Darwin's GDB-5.3.
@@ -1521,8 +1530,268 @@
   (let ((special-display-regexps (append special-display-regexps '(".*")))
 	(special-display-frame-alist gdb-frame-parameters))
     (display-buffer (gdb-get-create-buffer 'gdb-registers-buffer))))
+
+;; Memory buffer.
+;;
+(defcustom gdb-memory-repeat-count 32
+  "Number of data items in memory window."
+  :type 'integer
+  :group 'gud
+  :version "21.4")
+
+(defcustom gdb-memory-format "x"
+  "Display format of data items in memory window."
+  :type '(choice (const :tag "Hexadecimal" "x")
+	 	 (const :tag "Signed decimal" "d")
+	 	 (const :tag "Unsigned decimal" "u")
+		 (const :tag "Octal" "o")
+		 (const :tag "Binary" "t"))
+  :group 'gud
+  :version "21.4")
+
+(defcustom gdb-memory-unit "w"
+  "Unit size of data items in memory window."
+  :type '(choice (const :tag "Byte" "b")
+		 (const :tag "Halfword" "h")
+		 (const :tag "Word" "w")
+		 (const :tag "Giant word" "g"))
+  :group 'gud
+  :version "21.4")
+
+(gdb-set-buffer-rules 'gdb-memory-buffer
+		      'gdb-memory-buffer-name
+		      'gdb-memory-mode)
+
+(def-gdb-auto-updated-buffer gdb-memory-buffer
+  gdb-invalidate-memory
+  (concat gdb-server-prefix "x/" (number-to-string gdb-memory-repeat-count)
+	  gdb-memory-format gdb-memory-unit " " gdb-memory-address "\n")
+  gdb-read-memory-handler
+  gdb-read-memory-custom)
+
+(defun gdb-read-memory-custom ())
+
+(defvar gdb-memory-mode-map
+  (let ((map (make-sparse-keymap)))
+    (suppress-keymap map)
+    (define-key map "q" 'kill-this-buffer)
+     map))
+
+(defun gdb-memory-set-address (event)
+  "Set the start memory address."
+  (interactive "e")
+  (save-selected-window
+    (select-window (posn-window (event-start event)))
+    (let ((arg (read-from-minibuffer "Memory address: ")))
+      (setq gdb-memory-address arg))
+    (gdb-invalidate-memory)))
+
+(defun gdb-memory-set-repeat-count (event)
+  "Set the number of data items in memory window."
+  (interactive "e")
+  (save-selected-window
+    (select-window (posn-window (event-start event)))
+    (let* ((arg (read-from-minibuffer "Repeat count: "))
+	  (count (string-to-int arg)))
+      (if (< count 0)
+	  (error "Non-negative numbers only")
+	(customize-set-variable 'gdb-memory-repeat-count count)
+	(gdb-invalidate-memory)))))
+
+(defun gdb-memory-format-binary ()
+  "Set the display format to binary."
+  (interactive)
+  (customize-set-variable 'gdb-memory-format "t")
+  (gdb-invalidate-memory))
+
+(defun gdb-memory-format-octal ()
+  "Set the display format to octal."
+  (interactive)
+  (customize-set-variable 'gdb-memory-format "o")
+  (gdb-invalidate-memory))
+
+(defun gdb-memory-format-unsigned ()
+  "Set the display format to unsigned decimal."
+  (interactive)
+  (customize-set-variable 'gdb-memory-format "u")
+  (gdb-invalidate-memory))
+
+(defun gdb-memory-format-signed ()
+  "Set the display format to decimal."
+  (interactive)
+  (customize-set-variable 'gdb-memory-format "d")
+  (gdb-invalidate-memory))
+
+(defun gdb-memory-format-hexadecimal ()
+  "Set the display format to hexadecimal."
+  (interactive)
+  (customize-set-variable 'gdb-memory-format "x")
+  (gdb-invalidate-memory))
+
+(defvar gdb-memory-format-keymap
+  (let ((map (make-sparse-keymap)))
+    (define-key map [header-line down-mouse-3] 'gdb-memory-format-menu-1)
+    map)
+ "Keymap to select format in the header line.")
+
+(defvar gdb-memory-format-menu (make-sparse-keymap "Format")
+ "Menu of display formats in the header line.")
+
+(define-key gdb-memory-format-menu [binary]
+  '(menu-item "Binary" gdb-memory-format-binary
+	      :button (:radio . (equal gdb-memory-format "t"))))
+(define-key gdb-memory-format-menu [octal]
+  '(menu-item "Octal" gdb-memory-format-octal
+	      :button (:radio . (equal gdb-memory-format "o"))))
+(define-key gdb-memory-format-menu [unsigned]
+  '(menu-item "Unsigned Decimal" gdb-memory-format-unsigned
+	      :button (:radio . (equal gdb-memory-format "u"))))
+(define-key gdb-memory-format-menu [signed]
+  '(menu-item "Signed Decimal" gdb-memory-format-signed
+	      :button (:radio . (equal gdb-memory-format "d"))))
+(define-key gdb-memory-format-menu [hexadecimal]
+  '(menu-item "Hexadecimal" gdb-memory-format-hexadecimal
+	      :button (:radio . (equal gdb-memory-format "x"))))
+
+(defun gdb-memory-format-menu (event)
+  (interactive "@e")
+  (x-popup-menu event gdb-memory-format-menu))
+
+(defun gdb-memory-format-menu-1 (event)
+  (interactive "e")
+  (save-selected-window
+    (select-window (posn-window (event-start event)))
+    (let* ((selection (gdb-memory-format-menu event))
+	   (binding (and selection (lookup-key gdb-memory-format-menu
+					       (vector (car selection))))))
+      (if binding (call-interactively binding)))))
+
+(defun gdb-memory-unit-giant ()
+  "Set the unit size to giant words (eight bytes)."
+  (interactive)
+  (customize-set-variable 'gdb-memory-unit "g")
+  (gdb-invalidate-memory))
+
+(defun gdb-memory-unit-word ()
+  "Set the unit size to words (four bytes)."
+  (interactive)
+  (customize-set-variable 'gdb-memory-unit "w")
+  (gdb-invalidate-memory))
+
+(defun gdb-memory-unit-halfword ()
+  "Set the unit size to halfwords (two bytes)."
+  (interactive)
+  (customize-set-variable 'gdb-memory-unit "h")
+  (gdb-invalidate-memory))
+
+(defun gdb-memory-unit-byte ()
+  "Set the unit size to bytes."
+  (interactive)
+  (customize-set-variable 'gdb-memory-unit "b")
+  (gdb-invalidate-memory))
+
+(defvar gdb-memory-unit-keymap
+  (let ((map (make-sparse-keymap)))
+    (define-key map [header-line down-mouse-3] 'gdb-memory-unit-menu-1)
+    map)
+ "Keymap to select units in the header line.")
+
+(defvar gdb-memory-unit-menu (make-sparse-keymap "Unit")
+ "Menu of units in the header line.")
+
+(define-key gdb-memory-unit-menu [giantwords]
+  '(menu-item "Giant words" gdb-memory-unit-giant
+	      :button (:radio . (equal gdb-memory-unit "g"))))
+(define-key gdb-memory-unit-menu [words]
+  '(menu-item "Words" gdb-memory-unit-word
+	      :button (:radio . (equal gdb-memory-unit "w"))))
+(define-key gdb-memory-unit-menu [halfwords]
+  '(menu-item "Halfwords" gdb-memory-unit-halfword
+	      :button (:radio . (equal gdb-memory-unit "h"))))
+(define-key gdb-memory-unit-menu [bytes]
+  '(menu-item "Bytes" gdb-memory-unit-byte
+	      :button (:radio . (equal gdb-memory-unit "b"))))
+
+(defun gdb-memory-unit-menu (event)
+  (interactive "@e")
+  (x-popup-menu event gdb-memory-unit-menu))
+
+(defun gdb-memory-unit-menu-1 (event)
+  (interactive "e")
+  (save-selected-window
+    (select-window (posn-window (event-start event)))
+    (let* ((selection (gdb-memory-unit-menu event))
+	   (binding (and selection (lookup-key gdb-memory-unit-menu
+					       (vector (car selection))))))
+      (if binding (call-interactively binding)))))
+
+;;from make-mode-line-mouse-map
+(defun gdb-make-header-line-mouse-map (mouse function) "\
+Return a keymap with single entry for mouse key MOUSE on the header line.
+MOUSE is defined to run function FUNCTION with no args in the buffer
+corresponding to the mode line clicked."
+  (let ((map (make-sparse-keymap)))
+    (define-key map (vector 'header-line mouse) function)
+    (define-key map (vector 'header-line 'down-mouse-1) 'ignore)
+    map))
+
+(defun gdb-memory-mode ()
+  "Major mode for examining memory.
+
+\\{gdb-memory-mode-map}"
+  (kill-all-local-variables)
+  (setq major-mode 'gdb-memory-mode)
+  (setq mode-name "Memory")
+  (setq buffer-read-only t)
+  (use-local-map gdb-memory-mode-map)
+  (setq header-line-format
+	'(:eval
+	  (concat 
+	   "Read address: "
+	   (propertize gdb-memory-address
+		       'face font-lock-warning-face
+		       'help-echo (purecopy "mouse-1: Set memory address")
+		       'local-map (purecopy (gdb-make-header-line-mouse-map
+					     'mouse-1
+					     #'gdb-memory-set-address)))
+	   "  Repeat Count: "
+	   (propertize (number-to-string gdb-memory-repeat-count)
+		       'face font-lock-warning-face
+		       'help-echo (purecopy "mouse-1: Set repeat count")
+		       'local-map (purecopy (gdb-make-header-line-mouse-map
+					     'mouse-1
+					     #'gdb-memory-set-repeat-count)))
+	   "  Display Format: "
+	   (propertize gdb-memory-format
+		       'face font-lock-warning-face
+		       'help-echo (purecopy "mouse-3: Select display format")
+		       'local-map gdb-memory-format-keymap)
+	   "  Unit Size: "
+	   (propertize gdb-memory-unit
+		       'face font-lock-warning-face
+		       'help-echo (purecopy "mouse-3: Select unit size")
+		       'local-map gdb-memory-unit-keymap))))
+  (run-mode-hooks 'gdb-memory-mode-hook)
+  'gdb-invalidate-memory)
+
+(defun gdb-memory-buffer-name ()
+  (with-current-buffer gud-comint-buffer
+    (concat "*memory of " (gdb-get-target-string) "*")))
+
+(defun gdb-display-memory-buffer ()
+  "Display memory contents."
+  (interactive)
+  (gdb-display-buffer
+   (gdb-get-create-buffer 'gdb-memory-buffer)))
+
+(defun gdb-frame-memory-buffer ()
+  "Display memory contents in a new frame."
+  (interactive)
+  (let ((special-display-regexps (append special-display-regexps '(".*")))
+	(special-display-frame-alist gdb-frame-parameters))
+    (display-buffer (gdb-get-create-buffer 'gdb-memory-buffer))))
 
-;;
+
 ;; Locals buffer.
 ;;
 (gdb-set-buffer-rules 'gdb-locals-buffer
@@ -1633,6 +1902,7 @@
     `(menu-item "GDB-Frames" ,menu :visible (eq gud-minor-mode 'gdba)))
   (define-key menu [gdb] '("Gdb" . gdb-frame-gdb-buffer))
   (define-key menu [threads] '("Threads" . gdb-frame-threads-buffer))
+  (define-key menu [memory] '("Memory" . gdb-frame-memory-buffer))
   (define-key menu [assembler] '("Machine" . gdb-frame-assembler-buffer))
   (define-key menu [registers] '("Registers" . gdb-frame-registers-buffer))
   (define-key menu [locals] '("Locals" . gdb-frame-locals-buffer))
@@ -1643,8 +1913,9 @@
   (define-key gud-menu-map [displays]
     `(menu-item "GDB-Windows" ,menu :visible (eq gud-minor-mode 'gdba)))
   (define-key menu [gdb] '("Gdb" . gdb-display-gdb-buffer))
+  (define-key menu [threads] '("Threads" . gdb-display-threads-buffer))
+  (define-key menu [memory] '("Memory" . gdb-display-memory-buffer))
   (define-key menu [assembler] '("Machine" . gdb-display-assembler-buffer))
-  (define-key menu [threads] '("Threads" . gdb-display-threads-buffer))
   (define-key menu [registers] '("Registers" . gdb-display-registers-buffer))
   (define-key menu [locals] '("Locals" . gdb-display-locals-buffer))
   (define-key menu [frames] '("Stack" . gdb-display-stack-buffer))
@@ -1902,7 +2173,7 @@
 
 (defun gdb-assembler-custom ()
   (let ((buffer (gdb-get-buffer 'gdb-assembler-buffer))
-	(pos 1) (address) (flag))
+	(pos 1) (address) (flag) (bptno))
     (with-current-buffer buffer
       (if (not (equal gdb-current-address "main"))
 	  (progn
@@ -1924,16 +2195,17 @@
 	(if (looking-at "[^\t].*breakpoint")
 	    (progn
 	      (looking-at
-	       "[0-9]*\\s-*\\S-*\\s-*\\S-*\\s-*\\(.\\)\\s-*0x\\(\\S-*\\)")
-	      (setq flag (char-after (match-beginning 1)))
-	      (setq address (match-string 2))
+	       "\\([0-9]+\\)\\s-+\\S-+\\s-+\\S-+\\s-+\\(.\\)\\s-+0x\\(\\S-+\\)")
+	      (setq bptno (match-string 1))
+	      (setq flag (char-after (match-beginning 2)))
+	      (setq address (match-string 3))
 	      ;; remove leading 0s from output of info break.
 	      (if (string-match "^0+\\(.*\\)" address)
 		  (setq address (match-string 1 address)))
 	      (with-current-buffer buffer
 		  (goto-char (point-min))
 		  (if (re-search-forward address nil t)
-		      (gdb-put-breakpoint-icon (eq flag ?y))))))))
+		      (gdb-put-breakpoint-icon (eq flag ?y) bptno)))))))
     (if (not (equal gdb-current-address "main"))
 	(set-window-point (get-buffer-window buffer 0) pos))))
 
--- a/lisp/rect.el	Mon Jan 31 01:41:13 2005 +0000
+++ b/lisp/rect.el	Wed Feb 02 01:54:00 2005 +0000
@@ -127,14 +127,14 @@
     ))
 
 (defun delete-rectangle-line (startcol endcol fill)
-  (when (= (move-to-column startcol (or fill 'coerce)) startcol)
+  (when (= (move-to-column startcol (if fill t 'coerce)) startcol)
     (delete-region (point)
 		   (progn (move-to-column endcol 'coerce)
 			  (point)))))
 
 (defun delete-extract-rectangle-line (startcol endcol lines fill)
   (let ((pt (point-at-eol)))
-    (if (< (move-to-column startcol (or fill 'coerce)) startcol)
+    (if (< (move-to-column startcol (if fill t 'coerce)) startcol)
 	(setcdr lines (cons (spaces-string (- endcol startcol))
 			    (cdr lines)))
       ;; else
@@ -284,13 +284,13 @@
   (goto-char start))
 
 (defun open-rectangle-line (startcol endcol fill)
-  (when (= (move-to-column startcol (or fill 'coerce)) startcol)
+  (when (= (move-to-column startcol (if fill t 'coerce)) startcol)
     (unless (and (not fill)
 		 (= (point) (point-at-eol)))
       (indent-to endcol))))
 
 (defun delete-whitespace-rectangle-line (startcol endcol fill)
-  (when (= (move-to-column startcol (or fill 'coerce)) startcol)
+  (when (= (move-to-column startcol (if fill t 'coerce)) startcol)
     (unless (= (point) (point-at-eol))
       (delete-region (point) (progn (skip-syntax-forward " ") (point))))))
 
@@ -371,7 +371,7 @@
 
 (defun clear-rectangle-line (startcol endcol fill)
   (let ((pt (point-at-eol)))
-    (when (= (move-to-column startcol (or fill 'coerce)) startcol)
+    (when (= (move-to-column startcol (if fill t 'coerce)) startcol)
       (if (and (not fill)
 	       (<= (save-excursion (goto-char pt) (current-column)) endcol))
 	  (delete-region (point) pt)
--- a/lisp/ses.el	Mon Jan 31 01:41:13 2005 +0000
+++ b/lisp/ses.el	Wed Feb 02 01:54:00 2005 +0000
@@ -515,7 +515,7 @@
 
 (defun ses-create-cell-variable-range (minrow maxrow mincol maxcol)
   "Create buffer-local variables for cells.  This is undoable."
-  (push `(ses-destroy-cell-variable-range ,minrow ,maxrow ,mincol ,maxcol)
+  (push `(apply ses-destroy-cell-variable-range ,minrow ,maxrow ,mincol ,maxcol)
 	buffer-undo-list)
   (let (sym xrow xcol)
     (dotimes (row (1+ (- maxrow minrow)))
@@ -536,16 +536,16 @@
       (dotimes (col (1+ (- maxcol mincol)))
 	(setq sym (ses-create-cell-symbol (+ row minrow) (+ col mincol)))
 	(if (boundp sym)
-	    (push `(ses-set-with-undo ,sym ,(symbol-value sym))
+	    (push `(apply ses-set-with-undo ,sym ,(symbol-value sym))
 		  buffer-undo-list))
 	(kill-local-variable sym))))
-  (push `(ses-create-cell-variable-range ,minrow ,maxrow ,mincol ,maxcol)
+  (push `(apply ses-create-cell-variable-range ,minrow ,maxrow ,mincol ,maxcol)
 	buffer-undo-list))
 
 (defun ses-reset-header-string ()
   "Flags the header string for update.  Upon undo, the header string will be
 updated again."
-  (push '(ses-reset-header-string) buffer-undo-list)
+  (push '(apply ses-reset-header-string) buffer-undo-list)
   (setq ses--header-hscroll -1))
 
 ;;Split this code off into a function to avoid coverage-testing difficulties
@@ -1279,38 +1279,39 @@
 ;; Undo control
 ;;----------------------------------------------------------------------------
 
-(defadvice undo-more (around ses-undo-more activate preactivate)
-  "Define a meaning for conses in buffer-undo-list whose car is a symbol
-other than t or nil.  To undo these, apply the car--a function--to the
-cdr--its arglist."
-  (let ((ses-count (ad-get-arg 0)))
-    (catch 'undo
-      (dolist (ses-x pending-undo-list)
-	(unless ses-x
-	  ;;End of undo boundary
-	  (setq ses-count (1- ses-count))
-	  (if (<= ses-count 0)
-	      ;;We've seen enough boundaries - stop undoing
-	      (throw 'undo nil)))
-	(and (consp ses-x) (symbolp (car ses-x)) (fboundp (car ses-x))
-	     ;;Undo using apply
-	     (apply (car ses-x) (cdr ses-x)))))
-    (if (not (eq major-mode 'ses-mode))
-	ad-do-it
-      ;;Here is some extra code for SES mode.
-      (setq ses--deferred-narrow
-	    (or ses--deferred-narrow (ses-narrowed-p)))
-      (widen)
-      (condition-case x
-	  ad-do-it
-	(error
-	 ;;Restore narrow if appropriate
-	 (ses-command-hook)
-	 (signal (car x) (cdr x)))))))
+;; This should be unnecessary, because the feature is now built in.
+
+;;; (defadvice undo-more (around ses-undo-more activate preactivate)
+;;;   "Define a meaning for conses in buffer-undo-list whose car is a symbol
+;;; other than t or nil.  To undo these, apply the car--a function--to the
+;;; cdr--its arglist."
+;;;   (let ((ses-count (ad-get-arg 0)))
+;;;     (catch 'undo
+;;;       (dolist (ses-x pending-undo-list)
+;;; 	(unless ses-x
+;;; 	  ;;End of undo boundary
+;;; 	  (setq ses-count (1- ses-count))
+;;; 	  (if (<= ses-count 0)
+;;; 	      ;;We've seen enough boundaries - stop undoing
+;;; 	      (throw 'undo nil)))
+;;; 	(and (consp ses-x) (symbolp (car ses-x)) (fboundp (car ses-x))
+;;; 	     ;;Undo using apply
+;;; 	     (apply (car ses-x) (cdr ses-x)))))
+;;;     (if (not (eq major-mode 'ses-mode))
+;;; 	ad-do-it
+;;;       ;;Here is some extra code for SES mode.
+;;;       (setq ses--deferred-narrow
+;;; 	    (or ses--deferred-narrow (ses-narrowed-p)))
+;;;       (widen)
+;;;       (condition-case x
+;;; 	  ad-do-it
+;;; 	(error
+;;; 	 ;;Restore narrow if appropriate
+;;; 	 (ses-command-hook)
+;;; 	 (signal (car x) (cdr x)))))))
 
 (defun ses-begin-change ()
-  "For undo, remember current buffer-position before we start changing hidden
-stuff."
+  "For undo, remember point before we start changing hidden stuff."
   (let ((inhibit-read-only t))
     (insert-and-inherit "X")
     (delete-region (1- (point)) (point))))
@@ -1324,8 +1325,8 @@
 	       (equal (symbol-value sym) newval)
 	       (not (stringp newval)))
     (push (if (boundp sym)
-	      `(ses-set-with-undo ,sym ,(symbol-value sym))
-	    `(ses-unset-with-undo ,sym))
+	      `(apply ses-set-with-undo ,sym ,(symbol-value sym))
+	    `(apply ses-unset-with-undo ,sym))
 	  buffer-undo-list)
     (set sym newval)
     t))
@@ -1333,13 +1334,13 @@
 (defun ses-unset-with-undo (sym)
   "Set SYM to be unbound.  This is undoable."
   (when (1value (boundp sym)) ;;Always bound, except after a programming error
-    (push `(ses-set-with-undo ,sym ,(symbol-value sym)) buffer-undo-list)
+    (push `(apply ses-set-with-undo ,sym ,(symbol-value sym)) buffer-undo-list)
     (makunbound sym)))
 
 (defun ses-aset-with-undo (array idx newval)
   "Like aset, but undoable.  Result is t if element has changed"
   (unless (equal (aref array idx) newval)
-    (push `(ses-aset-with-undo ,array ,idx ,(aref array idx)) buffer-undo-list)
+    (push `(apply ses-aset-with-undo ,array ,idx ,(aref array idx)) buffer-undo-list)
     (aset array idx newval)
     t))
 
@@ -2065,7 +2066,7 @@
       (dotimes (col ses--numcols)
 	(aset newrow col (ses-make-cell)))
       (setq ses--cells (ses-vector-insert ses--cells row newrow))
-      (push `(ses-vector-delete ses--cells ,row 1) buffer-undo-list)
+      (push `(apply ses-vector-delete ses--cells ,row 1) buffer-undo-list)
       (insert ses--blank-line))
     ;;Insert empty lines in cell data area (will be replaced by
     ;;ses-relocate-all)
--- a/lisp/simple.el	Mon Jan 31 01:41:13 2005 +0000
+++ b/lisp/simple.el	Wed Feb 02 01:54:00 2005 +0000
@@ -1235,6 +1235,10 @@
 (defvar undo-no-redo nil
   "If t, `undo' doesn't go through redo entries.")
 
+(defvar pending-undo-list nil
+  "Within a run of consecutive undo commands, list remaining to be undone.
+t if we undid all the way to the end of it.")
+
 (defun undo (&optional arg)
   "Undo some previous changes.
 Repeat this command to undo more changes.
@@ -1258,14 +1262,15 @@
     (setq this-command 'undo-start)
 
     (unless (and (eq last-command 'undo)
-		 ;; If something (a timer or filter?) changed the buffer
-		 ;; since the previous command, don't continue the undo seq.
-		 (let ((list buffer-undo-list))
-		   (while (eq (car list) nil)
-		     (setq list (cdr list)))
-		   ;; If the last undo record made was made by undo
-		   ;; it shows nothing else happened in between.
-		   (gethash list undo-equiv-table)))
+		 (or (eq pending-undo-list t)
+		     ;; If something (a timer or filter?) changed the buffer
+		     ;; since the previous command, don't continue the undo seq.
+		     (let ((list buffer-undo-list))
+		       (while (eq (car list) nil)
+			 (setq list (cdr list)))
+		       ;; If the last undo record made was made by undo
+		       ;; it shows nothing else happened in between.
+		       (gethash list undo-equiv-table))))
       (setq undo-in-region
 	    (if transient-mark-mode mark-active (and arg (not (numberp arg)))))
       (if undo-in-region
@@ -1340,9 +1345,6 @@
 ;; no idea whereas to bind it.  Any suggestion welcome.  -stef
 ;; (define-key ctl-x-map "U" 'undo-only)
 
-(defvar pending-undo-list nil
-  "Within a run of consecutive undo commands, list remaining to be undone.")
-
 (defvar undo-in-progress nil
   "Non-nil while performing an undo.
 Some change-hooks test this variable to do something different.")
@@ -1351,12 +1353,14 @@
   "Undo back N undo-boundaries beyond what was already undone recently.
 Call `undo-start' to get ready to undo recent changes,
 then call `undo-more' one or more times to undo them."
-  (or pending-undo-list
+  (or (listp pending-undo-list)
       (error (format "No further undo information%s"
 		     (if (and transient-mark-mode mark-active)
 			 " for region" ""))))
   (let ((undo-in-progress t))
-    (setq pending-undo-list (primitive-undo count pending-undo-list))))
+    (setq pending-undo-list (primitive-undo count pending-undo-list))
+    (if (null pending-undo-list)
+	(setq pending-undo-list t))))
 
 ;; Deep copy of a list
 (defun undo-copy-list (list)
@@ -1521,33 +1525,76 @@
 	     '(0 . 0)))
     '(0 . 0)))
 
+(defcustom undo-ask-before-discard t
+  "If non-nil ask about discarding undo info for the current command.
+Normally, Emacs discards the undo info for the current command if
+it exceeds `undo-outer-limit'.  But if you set this option
+non-nil, it asks in the echo area whether to discard the info.
+If you answer no, there a slight risk that Emacs might crash, so
+only do it if you really want to undo the command.
+
+This option is mainly intended for debugging.  You have to be
+careful if you use it for other purposes.  Garbage collection is
+inhibited while the question is asked, meaning that Emacs might
+leak memory.  So you should make sure that you do not wait
+excessively long before answering the question."
+  :type 'boolean
+  :group 'undo
+  :version "21.4")
+
 (defvar undo-extra-outer-limit nil
   "If non-nil, an extra level of size that's ok in an undo item.
 We don't ask the user about truncating the undo list until the
-current item gets bigger than this amount.")
+current item gets bigger than this amount.
+
+This variable only matters if `undo-ask-before-discard' is non-nil.")
 (make-variable-buffer-local 'undo-extra-outer-limit)
 
-;; When the first undo batch in an undo list is longer than undo-outer-limit,
-;; this function gets called to ask the user what to do.
-;; Garbage collection is inhibited around the call,
-;; so it had better not do a lot of consing.
+;; When the first undo batch in an undo list is longer than
+;; undo-outer-limit, this function gets called to warn the user that
+;; the undo info for the current command was discarded.  Garbage
+;; collection is inhibited around the call, so it had better not do a
+;; lot of consing.
 (setq undo-outer-limit-function 'undo-outer-limit-truncate)
 (defun undo-outer-limit-truncate (size)
-  (when (or (null undo-extra-outer-limit)
-	    (> size undo-extra-outer-limit))
-    ;; Don't ask the question again unless it gets even bigger.
-    ;; This applies, in particular, if the user quits from the question.
-    ;; Such a quit quits out of GC, but something else will call GC
-    ;; again momentarily.  It will call this function again,
-    ;; but we don't want to ask the question again.
-    (setq undo-extra-outer-limit (+ size 50000))
-    (if (let (use-dialog-box)
-	  (yes-or-no-p (format "Buffer %s undo info is %d bytes long; discard it? "
-			       (buffer-name) size)))
-	(progn (setq buffer-undo-list nil)
-	       (setq undo-extra-outer-limit nil)
-	       t)
-      nil)))
+  (if undo-ask-before-discard
+      (when (or (null undo-extra-outer-limit)
+		(> size undo-extra-outer-limit))
+	;; Don't ask the question again unless it gets even bigger.
+	;; This applies, in particular, if the user quits from the question.
+	;; Such a quit quits out of GC, but something else will call GC
+	;; again momentarily.  It will call this function again,
+	;; but we don't want to ask the question again.
+	(setq undo-extra-outer-limit (+ size 50000))
+	(if (let (use-dialog-box track-mouse executing-kbd-macro )
+	      (yes-or-no-p (format "Buffer %s undo info is %d bytes long; discard it? "
+				   (buffer-name) size)))
+	    (progn (setq buffer-undo-list nil)
+		   (setq undo-extra-outer-limit nil)
+		   t)
+	  nil))
+    (display-warning '(undo discard-info)
+		     (concat
+		      (format "Buffer %s undo info was %d bytes long.\n"
+			      (buffer-name) size)
+		      "The undo info was discarded because it exceeded \
+`undo-outer-limit'.
+
+This is normal if you executed a command that made a huge change
+to the buffer.  In that case, to prevent similar problems in the
+future, set `undo-outer-limit' to a value that is large enough to
+cover the maximum size of normal changes you expect a single
+command to make, but not so large that it might exceed the
+maximum memory allotted to Emacs.
+
+If you did not execute any such command, the situation is
+probably due to a bug and you should report it.
+
+You can disable the popping up of this buffer by adding the entry
+\(undo discard-info) to the user option `warning-suppress-types'.\n")
+		     :warning)
+    (setq buffer-undo-list nil)
+    t))
 
 (defvar shell-command-history nil
   "History list for some commands that read shell commands.")
--- a/lisp/textmodes/ispell.el	Mon Jan 31 01:41:13 2005 +0000
+++ b/lisp/textmodes/ispell.el	Wed Feb 02 01:54:00 2005 +0000
@@ -44,8 +44,8 @@
 ;; country and language.
 ;;   Most dictionary changes should be made in this file so all users can
 ;; enjoy them.  Local or modified dictionaries are supported in your .emacs
-;; file.  Modify the variable `ispell-local-dictionary-alist' to include
-;; these dictionaries, and they will be installed when ispell.el is loaded.
+;; file.  Use the variable `ispell-local-dictionary-alist' to specify
+;; your own dictionaries.
 
 ;;  Depending on the mail system you use, you may want to include these:
 ;;  (add-hook 'news-inews-hook 'ispell-message)
@@ -428,29 +428,27 @@
   :type 'boolean
   :group 'ispell)
 
-;;; This is the local dictionary to use.  When nil the default dictionary will
-;;; be used.  Change set-default call to use a new default dictionary.
+(defvar ispell-local-dictionary-overridden nil
+  "Non-nil means the user has explicitly set this buffer's Ispell dictionary.")
+(make-variable-buffer-local 'ispell-local-dictionary)
+
 (defcustom ispell-local-dictionary nil
-  "If non-nil, the dictionary to be used for Ispell commands.
-The value must be a string dictionary name in `ispell-dictionary-alist'.
+  "If non-nil, the dictionary to be used for Ispell commands in this buffer.
+The value must be a string dictionary name,
+or nil, which means use the global setting in `ispell-dictionary'.
+Dictionary names are defined in `ispell-local-dictionary-alist'
+and `ispell-dictionary-alist',
 
 Setting `ispell-local-dictionary' to a value has the same effect as
 calling \\[ispell-change-dictionary] with that value.  This variable
 is automatically set when defined in the file with either
-`ispell-dictionary-keyword' or the Local Variable syntax.
-
-To create a non-standard default dictionary (not from `ispell-dictionary-alist')
-call function `set-default' with the new dictionary name."
+`ispell-dictionary-keyword' or the Local Variable syntax."
   :type '(choice string
 		 (const :tag "default" nil))
   :group 'ispell)
 
 (make-variable-buffer-local 'ispell-local-dictionary)
 
-;; Call this function set up the default dictionary if not English.
-;;(set-default 'ispell-local-dictionary nil)
-
-
 (defcustom ispell-extra-args nil
   "*If non-nil, a list of extra switches to pass to the Ispell program.
 For example, (\"-W\" \"3\") to cause it to accept all 1-3 character
@@ -473,17 +471,14 @@
 (make-variable-buffer-local 'ispell-skip-html)
 
 
-;;; Define definitions here only for personal dictionaries.
 ;;;###autoload
 (defcustom ispell-local-dictionary-alist nil
-  "*Contains local or customized dictionary definitions.
-
-These will override the values in `ispell-dictionary-alist'.
-
-Customization changes made to `ispell-dictionary-alist' will not operate
-over emacs sessions.  To make permanent changes to your dictionary
-definitions, you will need to make your changes in this variable, save,
-and then re-start emacs."
+  "*List of local or customized dictionary definitions.
+These can override the values in `ispell-dictionary-alist'.
+
+To make permanent changes to your dictionary definitions, you
+will need to make your changes in this variable, save, and then
+re-start emacs."
   :type '(repeat (list (choice :tag "Dictionary"
 			       (string :tag "Dictionary name")
 			       (const :tag "default" nil))
@@ -646,9 +641,8 @@
 
 
 ;;;###autoload
-(defcustom ispell-dictionary-alist
-  (append ispell-local-dictionary-alist	; dictionary customizations
-	  ispell-dictionary-alist-1 ispell-dictionary-alist-2
+(defvar ispell-dictionary-alist
+  (append ispell-dictionary-alist-1 ispell-dictionary-alist-2
 	  ispell-dictionary-alist-3 ispell-dictionary-alist-4
 	  ispell-dictionary-alist-5 ispell-dictionary-alist-6)
   "An alist of dictionaries and their associated parameters.
@@ -696,33 +690,7 @@
 
 Note that the CASECHARS and OTHERCHARS slots of the alist should
 contain the same character set as casechars and otherchars in the
-LANGUAGE.aff file \(e.g., english.aff\)."
-  :type '(repeat (list (choice :tag "Dictionary"
-			       (string :tag "Dictionary name")
-			       (const :tag "default" nil))
-		       (regexp :tag "Case characters")
-		       (regexp :tag "Non case characters")
-		       (regexp :tag "Other characters")
-		       (boolean :tag "Many other characters")
-		       (repeat :tag "Ispell command line args"
-			       (string :tag "Arg"))
-		       (choice :tag "Extended character mode"
-			       (const "~tex") (const "~plaintex")
-			       (const "~nroff") (const "~list")
-			       (const "~latin1") (const "~latin3")
- 			       (const :tag "default" nil))
-		       (choice :tag "Coding System"
-			       (const iso-8859-1)
-			       (const iso-8859-2)
-			       (const koi8-r))))
-  :group 'ispell)
-
-;;; update the dictionaries at load time
-(setq ispell-dictionary-alist
-      (append ispell-local-dictionary-alist	; dictionary customizations
-	      ispell-dictionary-alist-1 ispell-dictionary-alist-2
-	      ispell-dictionary-alist-3 ispell-dictionary-alist-4
-	      ispell-dictionary-alist-5 ispell-dictionary-alist-6))
+LANGUAGE.aff file \(e.g., english.aff\).")
 
 (defvar ispell-really-aspell nil) ; Non-nil if aspell extensions should be used
 
@@ -877,7 +845,7 @@
 (defun ispell-valid-dictionary-list ()
   "Returns a list of valid dictionaries.
 The variable `ispell-library-directory' defines the library location."
-  (let ((dicts ispell-dictionary-alist)
+  (let ((dicts (append ispell-local-dictionary-alist ispell-dictionary-alist))
 	(dict-list (cons "default" nil))
 	name load-dict)
     (dolist (dict dicts)
@@ -899,11 +867,12 @@
 	  (setq dict-list (cons name dict-list))))
     dict-list))
 
-
 ;;;###autoload
 (if ispell-menu-map-needed
     (let ((dicts (if (fboundp 'ispell-valid-dictionary-list)
 		     (ispell-valid-dictionary-list)
+		   ;; This case is used in loaddefs.el
+		   ;; since ispell-valid-dictionary-list isn't defined then.
 		   (mapcar (lambda (x) (or (car x) "default"))
 			   ispell-dictionary-alist)))
 	  (dict-map (make-sparse-keymap "Dictionaries")))
@@ -1054,14 +1023,14 @@
 
 
 ;;; This variable contains the current dictionary being used if the ispell
-;;; process is running.  Otherwise it contains the global default.
-(defvar ispell-dictionary nil
+;;; process is running.
+(defvar ispell-current-dictionary nil
   "The name of the current dictionary, or nil for the default.
-When `ispell-local-dictionary' is nil, `ispell-dictionary' is used to select
-the dictionary for new buffers.
-
 This is passed to the ispell process using the `-d' switch and is
-used as key in `ispell-dictionary-alist' (which see).")
+used as key in `ispell-local-dictionary-alist' and `ispell-dictionary-alist'.")
+
+(defvar ispell-dictionary nil
+  "Default dictionary to use if `ispell-local-dictionary' is nil.")
 
 (defun ispell-decode-string (str)
   "Decodes multibyte character strings.
@@ -1076,7 +1045,9 @@
 
 ;; Return a string decoded from Nth element of the current dictionary.
 (defun ispell-get-decoded-string (n)
-  (let* ((slot (assoc ispell-dictionary ispell-dictionary-alist))
+  (let* ((slot (or
+		(assoc ispell-current-dictionary ispell-local-dictionary-alist)
+		(assoc ispell-current-dictionary ispell-dictionary-alist)))
 	 (str (nth n slot)))
     (when (and (> (length str) 0)
 	       (not (multibyte-string-p str)))
@@ -1093,13 +1064,17 @@
 (defun ispell-get-otherchars ()
   (ispell-get-decoded-string 3))
 (defun ispell-get-many-otherchars-p ()
-  (nth 4 (assoc ispell-dictionary ispell-dictionary-alist)))
+  (nth 4 (or (assoc ispell-current-dictionary ispell-local-dictionary-alist)
+	     (assoc ispell-current-dictionary ispell-dictionary-alist))))
 (defun ispell-get-ispell-args ()
-  (nth 5 (assoc ispell-dictionary ispell-dictionary-alist)))
+  (nth 5 (or (assoc ispell-current-dictionary ispell-local-dictionary-alist)
+	     (assoc ispell-current-dictionary ispell-dictionary-alist))))
 (defun ispell-get-extended-character-mode ()
-  (nth 6 (assoc ispell-dictionary ispell-dictionary-alist)))
+  (nth 6 (or (assoc ispell-current-dictionary ispell-local-dictionary-alist)
+	     (assoc ispell-current-dictionary ispell-dictionary-alist))))
 (defun ispell-get-coding-system ()
-  (nth 7 (assoc ispell-dictionary ispell-dictionary-alist)))
+  (nth 7 (or (assoc ispell-current-dictionary ispell-local-dictionary-alist)
+	     (assoc ispell-current-dictionary ispell-dictionary-alist))))
 
 
 (defvar ispell-pdict-modified-p nil
@@ -1151,8 +1126,9 @@
 
 (defconst ispell-dictionary-keyword "Local IspellDict: "
   "The keyword for a local dictionary to use.
-The keyword must be followed by a correct dictionary name in
-`ispell-dictionary-alist'.  When multiple occurrences exist, the last keyword
+The keyword must be followed by a valid dictionary name, defined in
+`ispell-local-dictionary-alist' or `ispell-dictionary-alist'.
+When multiple occurrences exist, the last keyword
 definition is used.")
 
 (defconst ispell-pdict-keyword "Local IspellPersDict: "
@@ -1409,7 +1385,8 @@
 With a prefix argument (or if CONTINUE is non-nil),
 resume interrupted spell-checking of a buffer or region.
 
-Word syntax described by `ispell-dictionary-alist' (which see).
+Word syntax is controlled by the definition of the chosen dictionary,
+which is in `ispell-local-dictionary-alist' or `ispell-dictionary-alist'.
 
 This will check or reload the dictionary.  Use \\[ispell-change-dictionary]
 or \\[ispell-region] to update the Ispell process.
@@ -1519,7 +1496,8 @@
 Optional second argument contains otherchars that can be included in word
 many times.
 
-Word syntax described by `ispell-dictionary-alist' (which see)."
+Word syntax is controlled by the definition of the chosen dictionary,
+which is in `ispell-local-dictionary-alist' or `ispell-dictionary-alist'."
   (let* ((ispell-casechars (ispell-get-casechars))
 	 (ispell-not-casechars (ispell-get-not-casechars))
 	 (ispell-otherchars (ispell-get-otherchars))
@@ -2279,13 +2257,13 @@
 Keeps argument list for future ispell invocations for no async support."
   (let (args)
     ;; Local dictionary becomes the global dictionary in use.
-    (if ispell-local-dictionary
-	(setq ispell-dictionary ispell-local-dictionary))
+    (setq ispell-current-dictionary
+	  (or ispell-local-dictionary ispell-dictionary))
     (setq args (ispell-get-ispell-args))
-    (if (and ispell-dictionary		; use specified dictionary
+    (if (and ispell-current-dictionary	; use specified dictionary
 	     (not (member "-d" args)))	; only define if not overridden
 	(setq args
-	      (append (list "-d" ispell-dictionary) args)))
+	      (append (list "-d" ispell-current-dictionary) args)))
     (if ispell-personal-dictionary	; use specified pers dict
 	(setq args
 	      (append args
@@ -2401,9 +2379,7 @@
 
 ;;;###autoload
 (defun ispell-change-dictionary (dict &optional arg)
-  "Change `ispell-dictionary' (q.v.) to DICT and kill old Ispell process.
-A new one will be started as soon as necessary.
-
+  "Change to dictionary DICT for Ispell.
 By just answering RET you can find out what the current dictionary is.
 
 With prefix argument, set the default dictionary."
@@ -2411,39 +2387,42 @@
    (list (completing-read
 	  "Use new dictionary (RET for current, SPC to complete): "
 	  (and (fboundp 'ispell-valid-dictionary-list)
-	       (mapcar (lambda (x)(cons x nil)) (ispell-valid-dictionary-list)))
+	       (mapcar 'list (ispell-valid-dictionary-list)))
 	  nil t)
 	 current-prefix-arg))
+  (unless arg (ispell-accept-buffer-local-defs))
   (if (equal dict "default") (setq dict nil))
   ;; This relies on completing-read's bug of returning "" for no match
   (cond ((equal dict "")
 	 (message "Using %s dictionary"
 		  (or ispell-local-dictionary ispell-dictionary "default")))
-	((and (equal dict ispell-dictionary)
-	      (or (null ispell-local-dictionary)
-		  (equal dict ispell-local-dictionary)))
+	((equal dict (or ispell-local-dictionary
+			 ispell-dictionary "default"))
 	 ;; Specified dictionary is the default already.  No-op
 	 (and (interactive-p)
-	      (message "No change, using %s dictionary" (or dict "default"))))
+	      (message "No change, using %s dictionary" dict)))
 	(t				; reset dictionary!
-	 (if (assoc dict ispell-dictionary-alist)
-	     (progn
-	       (if (or arg (null dict))	; set default dictionary
-		   (setq ispell-dictionary dict))
-	       (if (null arg)		; set local dictionary
-		   (setq ispell-local-dictionary dict)))
+	 (if (or (assoc dict ispell-local-dictionary-alist)
+		 (assoc dict ispell-dictionary-alist))
+	     (if arg
+		 ;; set default dictionary
+		 (setq ispell-dictionary dict)
+	       ;; set local dictionary
+	       (setq ispell-local-dictionary dict)
+	       (setq ispell-local-dictionary-overridden t))
 	   (error "Undefined dictionary: %s" dict))
-	 (ispell-kill-ispell t)
-	 (message "(Next %sIspell command will use %s dictionary)"
-		  (cond ((equal ispell-local-dictionary ispell-dictionary)
-			 "")
-			(arg "global ")
-			(t "local "))
-		  (or (if (or (equal ispell-local-dictionary ispell-dictionary)
-			      (null arg))
-			  ispell-local-dictionary
-			ispell-dictionary)
-		      "default")))))
+	 (message "%s Ispell dictionary set to %s"
+		  (if arg "Global" "Local")
+		  dict))))
+
+(defun ispell-internal-change-dictionary ()
+  "Update the dictionary actually used by Ispell.
+This may kill the Ispell process; if so,
+a new one will be started when needed."
+  (let ((dict (or ispell-local-dictionary ispell-dictionary "default")))
+    (unless (equal ispell-current-dictionary dict)
+      (setq ispell-current-dictionary dict)
+      (ispell-kill-ispell t))))
 
 
 ;;; Spelling of comments are checked when ispell-check-comments is non-nil.
@@ -2463,7 +2442,7 @@
 	(message "Spell checking %s using %s dictionary..."
 		 (if (and (= reg-start (point-min)) (= reg-end (point-max)))
 		     (buffer-name) "region")
-		 (or ispell-dictionary "default"))
+		 (or ispell-current-dictionary "default"))
 	;; Returns cursor to original location.
 	(save-window-excursion
 	  (goto-char reg-start)
@@ -2481,7 +2460,7 @@
 		  (goto-char reg-start)))
 	    (let (message-log-max)
 	      (message "Continuing spelling check using %s dictionary..."
-		       (or ispell-dictionary "default")))
+		       (or ispell-current-dictionary "default")))
 	    (set-marker rstart reg-start)
 	    (set-marker ispell-region-end reg-end)
 	    (while (and (not ispell-quit)
@@ -2911,7 +2890,7 @@
 	    (if (not ispell-quit)
 		(let (message-log-max)
 		  (message "Continuing spelling check using %s dictionary..."
-			   (or ispell-dictionary "default"))))
+			   (or ispell-current-dictionary "default"))))
 	    (sit-for 0)
 	    (setq start (marker-position line-start)
 		  end (marker-position line-end))
@@ -3481,14 +3460,15 @@
       ;; Override the local variable definition.
       ;; Uses last occurrence of ispell-dictionary-keyword.
       (goto-char (point-max))
-      (if (search-backward ispell-dictionary-keyword nil t)
-	  (progn
-	    (search-forward ispell-dictionary-keyword)
-	    (setq end (save-excursion (end-of-line) (point)))
-	    (if (re-search-forward " *\\([^ \"]+\\)" end t)
-		(setq ispell-local-dictionary
-		      (buffer-substring-no-properties (match-beginning 1)
-						      (match-end 1))))))
+      (unless ispell-local-dictionary-overridden
+	(if (search-backward ispell-dictionary-keyword nil t)
+	    (progn
+	      (search-forward ispell-dictionary-keyword)
+	      (setq end (save-excursion (end-of-line) (point)))
+	      (if (re-search-forward " *\\([^ \"]+\\)" end t)
+		  (setq ispell-local-dictionary
+			(buffer-substring-no-properties (match-beginning 1)
+							(match-end 1)))))))
       (goto-char (point-max))
       (if (search-backward ispell-pdict-keyword nil t)
 	  (progn
@@ -3505,8 +3485,7 @@
 	(ispell-kill-ispell t)
 	(setq ispell-personal-dictionary ispell-local-pdict)))
   ;; Reload if new dictionary defined.
-  (if (not (equal ispell-local-dictionary ispell-dictionary))
-      (ispell-change-dictionary ispell-local-dictionary)))
+  (ispell-internal-change-dictionary))
 
 
 (defun ispell-buffer-local-words ()
--- a/lisp/wid-edit.el	Mon Jan 31 01:41:13 2005 +0000
+++ b/lisp/wid-edit.el	Wed Feb 02 01:54:00 2005 +0000
@@ -391,7 +391,11 @@
     (overlay-put overlay 'evaporate t)
     ;; We want to avoid the face with image buttons.
     (unless (widget-get widget :suppress-face)
-      (overlay-put overlay 'face (widget-apply widget :button-face-get)))
+      (overlay-put overlay 'face (widget-apply widget :button-face-get))
+      ; Text terminals cannot change mouse pointer shape, so use mouse
+      ; face instead.
+      (or (display-graphic-p)
+	  (overlay-put overlay 'mouse-face widget-mouse-face)))
     (overlay-put overlay 'pointer 'hand)
     (overlay-put overlay 'follow-link follow-link)
     (overlay-put overlay 'help-echo help-echo)))
@@ -911,14 +915,14 @@
 		      ;; until we receive a release event.  Highlight/
 		      ;; unhighlight the button the mouse was initially
 		      ;; on when we move over it.
-		      (let ((track-mouse t))
-			(save-excursion
-			  (when face	; avoid changing around image
-			    (overlay-put overlay
-					 'face widget-button-pressed-face)
-			    (overlay-put overlay
-					 'mouse-face widget-button-pressed-face))
-			  (unless (widget-apply button :mouse-down-action event)
+		      (save-excursion
+			(when face	; avoid changing around image
+			  (overlay-put overlay
+				       'face widget-button-pressed-face)
+			  (overlay-put overlay
+				       'mouse-face widget-button-pressed-face))
+			(unless (widget-apply button :mouse-down-action event)
+			  (let ((track-mouse t))
 			    (while (not (widget-button-release-event-p event))
 			      (setq event (read-event)
 				    pos (widget-event-point event))
@@ -933,13 +937,13 @@
 						 'mouse-face
 						 widget-button-pressed-face))
 				(overlay-put overlay 'face face)
-				(overlay-put overlay 'mouse-face mouse-face))))
-
-			  ;; When mouse is released over the button, run
-			  ;; its action function.
-			  (when (and pos
-				     (eq (get-char-property pos 'button) button))
-			    (widget-apply-action button event))))
+				(overlay-put overlay 'mouse-face mouse-face)))))
+
+			;; When mouse is released over the button, run
+			;; its action function.
+			(when (and pos
+				   (eq (get-char-property pos 'button) button))
+			  (widget-apply-action button event)))
 		    (overlay-put overlay 'face face)
 		    (overlay-put overlay 'mouse-face mouse-face))))
 
--- a/lispref/ChangeLog	Mon Jan 31 01:41:13 2005 +0000
+++ b/lispref/ChangeLog	Wed Feb 02 01:54:00 2005 +0000
@@ -1,3 +1,25 @@
+2005-01-31  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* text.texi (Maintaining Undo): Add `undo-outer-limit'.
+
+2005-02-01  Kim F. Storm  <storm@cua.dk>
+
+	* text.texi (Undo) <buffer-undo-list>: Describe `apply' elements.
+
+2005-01-29  Eli Zaretskii  <eliz@gnu.org>
+
+	* commands.texi (Misc Events): Describe the help-echo event.
+
+	* text.texi (Special Properties) <help-echo>: Use `pos'
+	consistently in description of the help-echo property.  Use
+	@code{nil} instead of @var{nil}.
+
+	* display.texi (Overlay Properties): Fix the index entry for
+	help-echo overlay property.
+
+	* customize.texi (Type Keywords): Uncomment the xref to the
+	help-echo property documentation.
+
 2005-01-23  Kim F. Storm  <storm@cua.dk>
 
 	* windows.texi (Window Start): Fix `pos-visible-in-window-p'
--- a/lispref/commands.texi	Mon Jan 31 01:41:13 2005 +0000
+++ b/lispref/commands.texi	Wed Feb 02 01:54:00 2005 +0000
@@ -1547,6 +1547,21 @@
 This kind of event is generated, at present, only on some kinds of
 systems.
 
+@cindex @code{help-echo} event
+@item help-echo
+This kind of event is generated when a mouse pointer moves onto a
+portion of buffer text which has a @code{help-echo} text property.
+The generated event has this form:
+
+@example
+ (help-echo @var{frame} @var{help} @var{window} @var{object} @var{pos})
+@end example
+
+@noindent
+The precise meaning of the event parameters and the way these
+parameters are used to display the help-echo text are described in
+@ref{Text help-echo}.
+
 @cindex @code{usr1-signal} event
 @cindex @code{usr2-signal} event
 @item usr1-signal
--- a/lispref/customize.texi	Mon Jan 31 01:41:13 2005 +0000
+++ b/lispref/customize.texi	Wed Feb 02 01:54:00 2005 +0000
@@ -983,7 +983,7 @@
 @code{help-echo} string and may actually be a function or form evaluated
 to yield a help string.  If it is a function, it is called with one
 argument, the widget.
-@c @xref{Text help-echo}.
+@xref{Text help-echo}.
 
 @item :match @var{function}
 Specify how to decide whether a value matches the type.  The
--- a/lispref/display.texi	Mon Jan 31 01:41:13 2005 +0000
+++ b/lispref/display.texi	Wed Feb 02 01:54:00 2005 +0000
@@ -1209,7 +1209,7 @@
 @xref{Display Property}.
 
 @item help-echo
-@kindex help-echo @r{(text property)}
+@kindex help-echo @r{(overlay property)}
 If an overlay has a @code{help-echo} property, then when you move the
 mouse onto the text in the overlay, Emacs displays a help string in the
 echo area, or in the tooltip window.  For details see @ref{Text
--- a/lispref/text.texi	Mon Jan 31 01:41:13 2005 +0000
+++ b/lispref/text.texi	Wed Feb 02 01:54:00 2005 +0000
@@ -1208,6 +1208,18 @@
 (put-text-property @var{beg} @var{end} @var{property} @var{value})
 @end example
 
+@item (apply @var{funname} . @var{args})
+This kind of element records a change that can be undone by evaluating
+(@code{apply} @var{funname} @var{args}).
+
+@item (apply @var{delta} @var{beg} @var{end} @var{funname} . @var{args})
+This kind of element records a change that can be undone by evaluating
+(@code{apply} @var{funname} @var{args}).  The integer values @var{beg}
+and @var{end} is buffer positions of the range affected by this change
+and @var{delta} is an integer value which is the number of bytes added
+or deleted in that range by this change.  This kind of element
+supports undo in an active region
+
 @item (@var{marker} . @var{adjustment})
 This kind of element records the fact that the marker @var{marker} was
 relocated due to deletion of surrounding text, and that it moved
@@ -1309,20 +1321,27 @@
 them from using up all available memory space, garbage collection trims
 them back to size limits you can set.  (For this purpose, the ``size''
 of an undo list measures the cons cells that make up the list, plus the
-strings of deleted text.)  Two variables control the range of acceptable
-sizes: @code{undo-limit} and @code{undo-strong-limit}.
-
-@defvar undo-limit
+strings of deleted text.)  Three variables control the range of acceptable
+sizes: @code{undo-limit}, @code{undo-strong-limit} and
+@code{undo-outer-limit}.
+
+@defopt undo-limit
 This is the soft limit for the acceptable size of an undo list.  The
 change group at which this size is exceeded is the last one kept.
-@end defvar
-
-@defvar undo-strong-limit
+@end defopt
+
+@defopt undo-strong-limit
 This is the upper limit for the acceptable size of an undo list.  The
 change group at which this size is exceeded is discarded itself (along
 with all older change groups).  There is one exception: the very latest
-change group is never discarded no matter how big it is.
-@end defvar
+change group is only discarded if it exceeds @code{undo-outer-limit}.
+@end defopt
+
+@defopt undo-outer-limit
+If at garbage collection time the undo info for the current command
+exceeds this limit, Emacs discards the info and prints a warning
+message.  This is a last ditch limit to prevent memory overflow.
+@end defopt
 
 @node Filling
 @comment  node-name,  next,  previous,  up
@@ -2892,10 +2911,10 @@
 
 If the value of the @code{help-echo} property is a function, that
 function is called with three arguments, @var{window}, @var{object} and
-@var{position} and should return a help string or @var{nil} for
+@var{pos} and should return a help string or @code{nil} for
 none.  The first argument, @var{window} is the window in which
 the help was found.  The second, @var{object}, is the buffer, overlay or
-string which had the @code{help-echo} property.  The @var{position}
+string which had the @code{help-echo} property.  The @var{pos}
 argument is as follows:
 
 @itemize @bullet{}
--- a/man/ChangeLog	Mon Jan 31 01:41:13 2005 +0000
+++ b/man/ChangeLog	Wed Feb 02 01:54:00 2005 +0000
@@ -1,3 +1,37 @@
+2005-01-31  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* basic.texi (Undo): Update description of `undo-outer-limit'.
+
+2005-02-01  Nick Roberts  <nickrob@snap.net.nz>
+
+	* building.texi: Update documentation relating to GDB Graphical
+	Interface.
+
+2005-01-30  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* custom.texi (Easy Customization): Adapt menu to node name change.
+
+2005-01-30  Richard M. Stallman  <rms@gnu.org>
+
+	* custom.texi (Easy Customization): Defn of "User Option" now
+	includes faces.  Don't say just "option" when talking about variables.
+	Do say just "options" to mean "anything customizable".
+	(Specific Customization): Describe `customize-variable',
+	not `customize-option'.
+
+	* glossary.texi (Glossary) <Faces>: Add xref.
+	<User Option>: Change definition--include faces.  Change xref.
+
+	* picture.texi (Picture): Mention artist.el.
+
+	* sending.texi, screen.texi, programs.texi, misc.texi:
+	* mini.texi, major.texi, maintaining.texi, macos.texi:
+	* help.texi, frames.texi, files.texi:
+	Don't say just "option" when talking about variables.
+
+	* display.texi, mule.texi: Don't say just "option" when talking
+	about variables.  Other minor cleanups.
+
 2005-01-28  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
 	* gnus.texi: Some edits based on comments from David Abrahams.
--- a/man/basic.texi	Mon Jan 31 01:41:13 2005 +0000
+++ b/man/basic.texi	Wed Feb 02 01:54:00 2005 +0000
@@ -399,13 +399,13 @@
 
   Regardless of the values of those variables, the most recent change
 is never discarded unless it gets bigger than @code{undo-outer-limit}
-(normally 300,000).  At that point, Emacs asks whether to discard the
-undo information even for the current command.  (You also have the
-option of quitting.)  So there is normally no danger that garbage
-collection occurring right after an unintentional large change might
-prevent you from undoing it.  But if you didn't expect the command
-to create such large undo data, you can get rid of it and prevent
-Emacs from running out of memory.
+(normally 3,000,000).  At that point, Emacs discards the undo data and
+warns you about it.  This is the only situation in which you can not
+undo the last command.  If this happens, you can increase the value of
+@code{undo-outer-limit} to make it even less likely to happen in the
+future.  But if you didn't expect the command to create such large
+undo data, then it is probably a bug and you should report it.
+@xref{Bugs,, Reporting Bugs}.
 
   The reason the @code{undo} command has two keys, @kbd{C-x u} and
 @kbd{C-_}, set up to run it is that it is worthy of a single-character
--- a/man/building.texi	Mon Jan 31 01:41:13 2005 +0000
+++ b/man/building.texi	Wed Feb 02 01:54:00 2005 +0000
@@ -309,12 +309,13 @@
 
 @c Do you believe in GUD?
 The GUD (Grand Unified Debugger) library provides an interface to
-various symbolic debuggers from within Emacs.  We recommend the debugger
-GDB, which is free software, but you can also run DBX, SDB or XDB if you
-have them.  GUD can also serve as an interface to Perl's debugging
-mode, the Python debugger PDB, and to JDB, the Java Debugger.
-@xref{Debugging,, The Lisp Debugger, elisp, the Emacs Lisp Reference Manual},
-for information on debugging Emacs Lisp programs.
+various symbolic debuggers from within Emacs.  We recommend the
+debugger GDB, which is free software, but you can also run DBX, SDB or
+XDB if you have them.  GUD can also serve as an interface to Perl's
+debugging mode, the Python debugger PDB, the bash debugger, and to
+JDB, the Java Debugger.  @xref{Debugging,, The Lisp Debugger, elisp,
+the Emacs Lisp Reference Manual}, for information on debugging Emacs
+Lisp programs.
 
 @menu
 * Starting GUD::	How to start a debugger subprocess.
@@ -336,15 +337,14 @@
 @table @kbd
 @item M-x gdb @key{RET} @var{file} @key{RET}
 @findex gdb
-Run GDB as a subprocess of Emacs.  If the variable
-@code{gud-gdb-command-name} is ``gdb --annotate=3'' (the default
-value) then GDB starts as for @kbd{M-x gdba} below.  If you want GDB
-to start as in Emacs 21.3 and earlier then edit the string in the
-minibuffer or set @code{gud-gdb-command-name} to ``gdb --fullname''.
-You need to do this if you want to run multiple debugging sessions
-within one Emacs session.  In this case, the command creates a buffer
-for input and output to GDB, and switches to it.  If a GDB buffer
-already exists, it just switches to that buffer.
+Run GDB as a subprocess of Emacs.  By default, GDB starts as for
+@kbd{M-x gdba} below.  If you want GDB to start as in Emacs 21.3 and
+earlier then edit the string in the minibuffer or set
+@code{gud-gdb-command-name} to ``gdb --fullname''.  You need to do
+this if you want to run multiple debugging sessions within one Emacs
+session.  In this case, the command creates a buffer for input and
+output to GDB, and switches to it.  If a GDB buffer already exists, it
+just switches to that buffer.
 
 @item M-x gdba @key{RET} @var{file} @key{RET}
 Run GDB as a subprocess of Emacs, providing a graphical interface
@@ -569,11 +569,13 @@
 details.
 @end table
 
-If you started GDB with the command @code{gdba}, you can click
-@kbd{Mouse-1} on a line of the source buffer, in the fringe or display
-margin, to set a breakpoint there.  If a breakpoint already exists on
-that line, this action will remove it.
-(@code{gdb-mouse-toggle-breakpoint}).
+With the GDB Graphical Interface, you can click @kbd{Mouse-1} on a
+line of the source buffer, in the fringe or display margin, to set a
+breakpoint there.  If a breakpoint already exists on that line, this
+action will remove it (@code{gdb-mouse-set-clear-breakpoint}). Where
+Emacs uses the margin to display breakpoints, it is also possible to
+enable or disable them when you click @kbd{Mouse-3} there
+(@code{gdb-mouse-toggle--breakpoint}).
 
   These commands interpret a numeric argument as a repeat count, when
 that makes sense.
@@ -661,19 +663,23 @@
 @node GDB Graphical Interface
 @subsection GDB Graphical Interface
 
+By default, the command @code{gdb} starts GDB using a graphical
+interface where you view and control the program's data using Emacs
+windows.  You can still interact with GDB through the GUD buffer, but
+the point of this mode is that you can do it through menus and clicks,
+without needing to know GDB commands.
+
 @findex gdba
-The command @code{gdba} starts GDB using a graphical interface where
-you view and control the program's data using Emacs windows.  You can
-still interact with GDB through the GUD buffer, but the point of this
-mode is that you can do it through menus and clicks, without needing
-to know GDB commands.
+If you have customised @code{gud-gdb-command-name}, then start this
+mode with the command @code{gdba}.
 
 @menu
 * Layout::               Control the number of displayed buffers.
 * Breakpoints Buffer::   A breakpoint control panel.
 * Stack Buffer::         Select a frame from the call stack.
 * Watch Expressions::    Monitor variable values in the speedbar.
-* Other Buffers::        Input/output, locals, registers and assembler buffers.
+* Other Buffers::        Input/output, locals, registers, assembler, threads
+                         and memory buffers.
 @end menu
 
 @node Layout
@@ -722,6 +728,15 @@
 gdb-frame-@var{buffertype}-buffer} respectively, where @var{buffertype}
 is the relevant buffer type e.g breakpoints.
 
+When you finish debugging then kill the GUD buffer with @kbd{C-x k},
+which will also kill all the buffers associated with the session.
+However you need not do this if, after editing and re-compiling your
+source code within Emacs, you wish continue debugging.  When you
+restart execution, GDB will automatically find your new executable.
+Keeping the GUD buffer has the advantage of keeping the shell history
+as well as GDB's breakpoints.  You need to check, however, that the
+breakpoints in the recently edited code are still where you want them.
+
 @node Breakpoints Buffer
 @subsubsection Breakpoints Buffer
 
@@ -827,18 +842,27 @@
 @item Assembler Buffer
 The assembler buffer displays the current frame as machine code.  An
 overlay arrow points to the current instruction and you can set and
-remove breakpoints as with the source buffer.  Breakpoints also
-appear in the margin.
+remove breakpoints as with the source buffer.  Breakpoint icons also
+appear in the fringe or margin.
 
 @item Threads Buffer
 
 The threads buffer displays a summary of all threads currently in your
-program.(@pxref{Threads,,, gdb, The GNU debugger}).  Move point to
+program (@pxref{Threads,,, gdb, The GNU debugger}).  Move point to
 any thread in the list and type @key{RET} to make it become the
 current thread (@code{gdb-threads-select}) and display the associated
 source in the source buffer.  Alternatively, click @kbd{Mouse-2} to
 make the selected thread become the current one.
 
+@item Memory Buffer
+
+The memory buffer allows the user to examine sections of program
+memory (@pxref{Memory,,, gdb, The GNU debugger}).  Click @kbd{Mouse-1}
+on the appropriate part of the header line to change the starting
+address or number of data items that the buffer displays.
+Click @kbd{Mouse-3} on the header line to select the display format
+or unit size for these data items.
+
 @end table
 
 @node Executing Lisp
--- a/man/custom.texi	Mon Jan 31 01:41:13 2005 +0000
+++ b/man/custom.texi	Wed Feb 02 01:54:00 2005 +0000
@@ -178,10 +178,11 @@
 
 @cindex user option
   Emacs has many @dfn{user options} which have values that you can set
-in order to customize various commands.  Most user options are
-documented in this manual.  Each user option is actually a Lisp
-variable (@pxref{Variables}), so their names appear in the Variable
-Index (@pxref{Variable Index}).
+in order to customize various commands.  Many user options are
+documented in this manual.  Most user options are actually Lisp
+variables (@pxref{Variables}), so their names appear in the Variable
+Index (@pxref{Variable Index}).  The rest are faces and their
+attributes (@pxref{Faces}).
 
 @findex customize
 @cindex customization buffer
@@ -199,11 +200,11 @@
 @menu
 * Groups: Customization Groups.
                              How options are classified in a structure.
-* Changing an Option::       How to edit a value and set an option.
+* Changing a Variable::      How to edit a value and set an option.
 * Saving Customizations::    Details of saving customizations.
 * Face Customization::       How to edit the attributes of a face.
 * Specific Customization::   Making a customization buffer for specific
-                                options, faces, or groups.
+                                variables, faces, or groups.
 @end menu
 
 @node Customization Groups
@@ -266,7 +267,7 @@
 mainly it contains other groups, which contain more groups, which
 contain the user options.  By browsing the hierarchy of groups, you
 will eventually find the feature you are interested in customizing.
-Then you can use the customization buffer to set the options and faces
+Then you can use the customization buffer to set the options
 pertaining to that feature.  You can also go straight to a particular
 group by name, using the command @kbd{M-x customize-group}.
 
@@ -274,45 +275,45 @@
   You can view the structure of customization groups on a larger scale
 with @kbd{M-x customize-browse}.  This command creates a special kind of
 customization buffer which shows only the names of the groups (and
-options and faces), and their structure.
+variables and faces), and their structure.
 
   In this buffer, you can show the contents of a group by invoking
 @samp{[+]}.  When the group contents are visible, this button changes to
 @samp{[-]}; invoking that hides the group contents.
 
-  Each group, option or face name in this buffer has an active field
-which says @samp{[Group]}, @samp{[Option]} or @samp{[Face]}.  Invoking
+  Each group, variable, or face name in this buffer has an active field
+which says @samp{[Group]}, @samp{[Variable]} or @samp{[Face]}.  Invoking
 that active field creates an ordinary customization buffer showing just
-that group and its contents, just that option, or just that face.
+that group and its contents, just that variable, or just that face.
 This is the way to set values in it.
 
-@node Changing an Option
-@subsection Changing an Option
+@node Changing a Variable
+@subsection Changing a Variable
 
-  Here is an example of what a user option looks like in the
+  Here is an example of what a variable looks like in the
 customization buffer:
 
 @smallexample
 Kill Ring Max: [Hide] 60
-   [State]: this option is unchanged from its standard setting.
+   [State]: this variable is unchanged from its standard setting.
 Maximum length of kill ring before oldest elements are thrown away.
 @end smallexample
 
   The text following @samp{[Hide]}, @samp{60} in this case, indicates
-the current value of the option.  If you see @samp{[Show]} instead of
+the current value of the variable.  If you see @samp{[Show]} instead of
 @samp{[Hide]}, it means that the value is hidden; the customization
 buffer initially hides values that take up several lines.  Invoke
 @samp{[Show]} to show the value.
 
   The line after the option name indicates the @dfn{customization state}
-of the option: in the example above, it says you have not changed the
+of the variable: in the example above, it says you have not changed the
 option yet.  The word @samp{[State]} at the beginning of this line is
 active; you can get a menu of various operations by invoking it with
 @kbd{Mouse-1} or @key{RET}.  These operations are essential for
-customizing the user option.
+customizing the variable.
 
   The line after the @samp{[State]} line displays the beginning of the
-option's documentation string.  If there are more lines of
+variable's documentation string.  If there are more lines of
 documentation, this line ends with @samp{[More]}; invoke this to show
 the full documentation string.
 
@@ -324,22 +325,22 @@
 change to say that you have edited the value:
 
 @smallexample
-[State]: you have edited the value as text, but not set the option.
+[State]: you have edited the value as text, but not set the variable.
 @end smallexample
 
 @cindex setting option value
-  Editing the value does not actually set the option.  To do
-that, you must @dfn{set} the option.  To do this, invoke the word
+  Editing the value does not actually set the variable.  To do
+that, you must @dfn{set} it.  To do this, invoke the word
 @samp{[State]} and choose @samp{Set for Current Session}.
 
-  The state of the option changes visibly when you set it:
+  The state of the variable changes visibly when you set it:
 
 @smallexample
-[State]: you have set this option, but not saved it for future sessions.
+[State]: you have set this variable, but not saved it for future sessions.
 @end smallexample
 
    You don't have to worry about specifying a value that is not valid;
-setting the option checks for validity and will not really install an
+setting the variable checks for validity and will not really install an
 unacceptable value.
 
 @kindex M-TAB @r{(customization buffer)}
@@ -348,15 +349,15 @@
 command name, or anything else for which completion is defined, you can
 type @kbd{M-@key{TAB}} (@code{widget-complete}) to do completion.
 
-  Some options have a small fixed set of possible legitimate values.
-These options don't let you edit the value textually.  Instead, an
+  Some variables have a small fixed set of possible legitimate values.
+These variables don't let you edit the value textually.  Instead, an
 active field @samp{[Value Menu]} appears before the value; invoke this
 field to edit the value.  For a boolean ``on or off'' value, the active
 field says @samp{[Toggle]}, and it changes to the other value.
 @samp{[Value Menu]} and @samp{[Toggle]} edit the buffer; the changes
 take effect when you use the @samp{Set for Current Session} operation.
 
-  Some options have values with complex structure.  For example, the
+  Some variables have values with complex structure.  For example, the
 value of @code{file-coding-system-alist} is an association list.  Here
 is how it appears in the customization buffer:
 
@@ -379,7 +380,7 @@
             Decoding: undecided
             Encoding: nil
 [INS]
-   [State]: this option is unchanged from its standard setting.
+   [State]: this variable is unchanged from its standard setting.
 Alist to decide a coding system to use for a file I/O operation. [Hide]
 The format is ((PATTERN . VAL) ...),
 where PATTERN is a regular expression matching a file name,
@@ -415,37 +416,37 @@
 when they are finished editing a field.  To insert a newline within an
 editable field, use @kbd{C-o} or @kbd{C-q C-j}.
 
-@cindex saving option value
-@cindex customized options, saving
-  Setting the option changes its value in the current Emacs session;
+@cindex saving variable value
+@cindex customized variables, saving
+  Setting the variable changes its value in the current Emacs session;
 @dfn{saving} the value changes it for future sessions as well.  To
-save the option, invoke @samp{[State]} and select the @samp{Save for
+save the variable, invoke @samp{[State]} and select the @samp{Save for
 Future Sessions} operation.  This works by writing code so as to set
-the option again, each time you start Emacs (@pxref{Saving
+the variable again, each time you start Emacs (@pxref{Saving
 Customizations}).
 
-  You can also restore the option to its standard value by invoking
+  You can also restore the variable to its standard value by invoking
 @samp{[State]} and selecting the @samp{Erase Customization} operation.
 There are actually three reset operations:
 
 @table @samp
 @item Reset
-If you have made some modifications and not yet set the option,
+If you have made some modifications and not yet set the variable,
 this restores the text in the customization buffer to match
 the actual value.
 
 @item Reset to Saved
-This restores the value of the option to the last saved value,
+This restores the value of the variable to the last saved value,
 and updates the text accordingly.
 
 @item Erase Customization
-This sets the option to its standard value, and updates the text
+This sets the variable to its standard value, and updates the text
 accordingly.  This also eliminates any saved value for the option,
 so that you will get the standard value in future Emacs sessions.
 
 @item Use Backup Value
-This sets the option to a previous value that was set in the
-customization buffer in this session.  If you customize an option
+This sets the variable to a previous value that was set in the
+customization buffer in this session.  If you customize a variable
 and then reset it, which discards the customized value,
 you can get the customized value back again with this operation.
 @end table
@@ -455,7 +456,7 @@
 customization.  Use the @samp{Add Comment} item from the
 @samp{[State]} menu to create a field for entering the comment.  The
 comment you enter will be saved, and displayed again if you again view
-the same option in a customization buffer, even in another session.
+the same variable in a customization buffer, even in another session.
 
   The state of a group indicates whether anything in that group has been
 edited, set or saved.  You can select @samp{Set for Current Session},
@@ -477,8 +478,9 @@
 buffer according to the setting of the option
 @code{custom-buffer-done-function}; the default is to bury the buffer.
 Each of the other fields performs an operation---set, save or
-reset---on each of the items in the buffer that could meaningfully be
-set, saved or reset.
+reset---on each of the options in the buffer that could meaningfully
+be set, saved or reset.  They do not operate on options whose values
+are hidden.
 
 @node Saving Customizations
 @subsection Saving Customizations
@@ -525,8 +527,8 @@
 @cindex italic font
 @cindex fonts and faces
 
-  In addition to user options, some customization groups also include
-faces.  When you show the contents of a group, both the user options and
+  In addition to variables, some customization groups also include
+faces.  When you show the contents of a group, both the variables and
 the faces in the group appear in the customization buffer.  Here is an
 example of how a face looks:
 
@@ -568,7 +570,7 @@
 stipple patterns instead of a color.
 
   Setting, saving and resetting a face work like the same operations for
-options (@pxref{Changing an Option}).
+variables (@pxref{Changing a Variable}).
 
   A face can specify different appearances for different types of
 display.  For example, a face can make text red on a color display, but
@@ -588,37 +590,37 @@
 @subsection Customizing Specific Items
 
   Instead of finding the options you want to change by moving down
-through the structure of groups, you can specify the particular option,
-face or group that you want to customize.
+through the structure of groups, you can specify the particular variable,
+face, or group that you want to customize.
 
 @table @kbd
-@item M-x customize-option @key{RET} @var{option} @key{RET}
-Set up a customization buffer with just one option, @var{option}.
+@item M-x customize-variable @key{RET} @var{variable} @key{RET}
+Set up a customization buffer with just one variable, @var{variable}.
 @item M-x customize-face @key{RET} @var{face} @key{RET}
 Set up a customization buffer with just one face, @var{face}.
 @item M-x customize-group @key{RET} @var{group} @key{RET}
 Set up a customization buffer with just one group, @var{group}.
 @item M-x customize-apropos @key{RET} @var{regexp} @key{RET}
-Set up a customization buffer with all the options, faces and groups
+Set up a customization buffer with all the variables, faces and groups
 that match @var{regexp}.
 @item M-x customize-changed-options @key{RET} @var{version} @key{RET}
-Set up a customization buffer with all the options, faces and groups
+Set up a customization buffer with all the variables, faces and groups
 whose meaning has changed since Emacs version @var{version}.
 @item M-x customize-saved
-Set up a customization buffer containing all options and faces that you
+Set up a customization buffer containing all variables and faces that you
 have saved with customization buffers.
 @item M-x customize-customized
-Set up a customization buffer containing all options and faces that you
+Set up a customization buffer containing all variables and faces that you
 have customized but not saved.
 @end table
 
-@findex customize-option
-  If you want to alter a particular user option with the
-customization buffer, and you know its name, you can use the command
-@kbd{M-x customize-option} and specify the option name.  This sets up
-the customization buffer with just one option---the one that you asked
-for.  Editing, setting and saving the value work as described above, but
-only for the specified option.
+@findex customize-variable
+  If you want to alter a particular variable with the customization
+buffer, and you know its name, you can use the command @kbd{M-x
+customize-variable} and specify the variable name.  This sets up the
+customization buffer with just one variable---the one that you asked
+for.  Editing, setting and saving the value work as described above,
+but only for the specified variable.
 
 @findex customize-face
   Likewise, you can modify a specific face, chosen by name, using
@@ -650,11 +652,11 @@
 
 @findex customize-saved
 @findex customize-customized
-  If you change option values and then decide the change was a mistake,
-you can use two special commands to revisit your previous changes.  Use
-@kbd{M-x customize-saved} to look at the options and faces that you have
-saved.  Use @kbd{M-x customize-customized} to look at the options and
-faces that you have set but not saved.
+  If you change option values and then decide the change was a
+mistake, you can use two special commands to revisit your previous
+changes.  Use @kbd{M-x customize-saved} to look at the options that
+you have saved.  Use @kbd{M-x customize-customized} to look at the
+options that you have set but not saved.
 
 @node Variables
 @section Variables
@@ -679,14 +681,14 @@
 set the variable---is @code{t}.
 
   Emacs uses many Lisp variables for internal record keeping, but the
-most interesting variables for a non-programmer user are the @dfn{user
-options}, the variables that are meant for users to change.  Each user
-option that you can set with the customization buffer is, in fact, a
-Lisp variable.  Emacs does not (usually) change the values of these
-variables; instead, you set the values, and thereby alter and control
-the behavior of certain Emacs commands.  Use of the customization
-buffer is explained above; here we describe other aspects of Emacs
-variables.
+most interesting variables for a non-programmer user are those that
+are also @dfn{user options}, the variables that are meant for users to
+change.  Each user option that you can set with the customization
+buffer is (if it is not a face) in fact a Lisp variable.  Emacs does
+not (usually) change the values of these variables; instead, you set
+the values, and thereby alter and control the behavior of certain
+Emacs commands.  Use of the customization buffer is explained above;
+here we describe other aspects of Emacs variables.
 
 @menu
 * Examining::	        Examining or setting one variable's value.
@@ -734,10 +736,10 @@
 options; it allows any variable name.
 
 @findex set-variable
-  The most convenient way to set a specific user option is with @kbd{M-x
-set-variable}.  This reads the variable name with the minibuffer (with
-completion), and then reads a Lisp expression for the new value using
-the minibuffer a second time.  For example,
+  The most convenient way to set a specific user option variable is
+with @kbd{M-x set-variable}.  This reads the variable name with the
+minibuffer (with completion), and then reads a Lisp expression for the
+new value using the minibuffer a second time.  For example,
 
 @example
 M-x set-variable @key{RET} fill-column @key{RET} 75 @key{RET}
@@ -1092,10 +1094,10 @@
   The @code{eval} ``variable,'' and certain actual variables, create a
 special risk; when you visit someone else's file, local variable
 specifications for these could affect your Emacs in arbitrary ways.
-Therefore, the option @code{enable-local-eval} controls whether Emacs
+Therefore, the variable @code{enable-local-eval} controls whether Emacs
 processes @code{eval} variables, as well variables with names that end
 in @samp{-hook}, @samp{-hooks}, @samp{-function} or @samp{-functions},
-and certain other variables.  The three possibilities for the option's
+and certain other variables.  The three possibilities for the variable's
 value are @code{t}, @code{nil}, and anything else, just as for
 @code{enable-local-variables}.  The default is @code{maybe}, which is
 neither @code{t} nor @code{nil}, so normally Emacs does ask for
--- a/man/display.texi	Mon Jan 31 01:41:13 2005 +0000
+++ b/man/display.texi	Wed Feb 02 01:54:00 2005 +0000
@@ -219,7 +219,7 @@
 @findex global-font-lock-mode
 @vindex global-font-lock-mode
   To turn on Font Lock mode automatically in all modes which support
-it, customize the user option @code{global-font-lock-mode} or use the
+it, customize the variable @code{global-font-lock-mode} or use the
 function @code{global-font-lock-mode} in your @file{.emacs} file, like
 this:
 
@@ -327,9 +327,9 @@
 that becomes visible is fontified as soon as it is displayed.  The
 parts of the buffer that are not displayed are fontified
 ``stealthily'', in the background, i.e.@: when Emacs is idle.  You can
-control this background fontification, called @dfn{Just-In-Time}, or
-@dfn{JIT} Font Lock, by customizing various options in the
-customization group @samp{jit-lock}.  @xref{Specific Customization}.
+control this background fontification, also called @dfn{Just-In-Time}
+(or @dfn{JIT}) Lock, by customizing variables in the customization
+group @samp{jit-lock}.  @xref{Specific Customization}.
 
 @node Highlight Changes
 @section Highlight Changes Mode
@@ -1087,7 +1087,7 @@
 state, with the same appearance as when the blinking cursor blinks
 ``off''.  For a box cursor, this is a hollow box; for a bar cursor,
 this is a thinner bar.  To turn off cursors in non-selected windows,
-customize the option @code{cursor-in-non-selected-windows} and assign
+customize the variable @code{cursor-in-non-selected-windows} and assign
 it a @code{nil} value.
 
 @vindex x-stretch-cursor
--- a/man/files.texi	Mon Jan 31 01:41:13 2005 +0000
+++ b/man/files.texi	Wed Feb 02 01:54:00 2005 +0000
@@ -2979,7 +2979,7 @@
 compressed files when you visit them, and automatically recompress them
 if you alter them and save them.  To enable this feature, type the
 command @kbd{M-x auto-compression-mode}.  You can enable it permanently
-by customizing the option @code{auto-compression-mode}.
+by customizing the variable @code{auto-compression-mode}.
 
   When automatic compression (which implies automatic uncompression as
 well) is enabled, Emacs recognizes compressed files by their file names.
--- a/man/frames.texi	Mon Jan 31 01:41:13 2005 +0000
+++ b/man/frames.texi	Wed Feb 02 01:54:00 2005 +0000
@@ -278,7 +278,7 @@
 @code{Paste} and @code{Copy} menu items, as well as the keys of the same
 names, all use the clipboard.
 
-  You can customize the option @code{x-select-enable-clipboard} to make
+  You can customize the variable @code{x-select-enable-clipboard} to make
 the Emacs yank functions consult the clipboard before the primary
 selection, and to make the kill functions to store in the clipboard as
 well as the primary selection.  Otherwise they do not access the
@@ -758,7 +758,7 @@
 scroll-bar-mode}.  With no argument, it toggles the use of scroll bars.
 With an argument, it turns use of scroll bars on if and only if the
 argument is positive.  This command applies to all frames, including
-frames yet to be created.  Customize the option @code{scroll-bar-mode}
+frames yet to be created.  Customize the variable @code{scroll-bar-mode}
 to control the use of scroll bars at startup.  You can use it to specify
 that they are placed at the right of windows if you prefer that.  You
 have to set this variable through the @samp{Customize} interface
@@ -788,7 +788,7 @@
 @kbd{Mouse-3}, depending on the setup.  You can also use the wheel to
 scroll windows instead of using the scroll bar or keyboard commands.
 To do so, turn on Mouse Wheel global minor mode with the command
-@kbd{M-x mouse-wheel-mode} or by customizing the option
+@kbd{M-x mouse-wheel-mode} or by customizing the variable
 @code{mouse-wheel-mode}.  Support for the wheel depends on the system
 generating appropriate events for Emacs.
 
@@ -849,7 +849,7 @@
 @cindex mode, Menu Bar
 
   You can turn display of menu bars on or off with @kbd{M-x
-menu-bar-mode} or by customizing the option @code{menu-bar-mode}.
+menu-bar-mode} or by customizing the variable @code{menu-bar-mode}.
 With no argument, this command toggles Menu Bar mode, a
 minor mode.  With an argument, the command turns Menu Bar mode on if the
 argument is positive, off if the argument is not positive.  You can use
@@ -899,7 +899,7 @@
 dialog box to ask a yes-or-no question, if you used the mouse to
 invoke the command to begin with.
 
-  You can customize the option @code{use-dialog-box} to suppress the
+  You can customize the variable @code{use-dialog-box} to suppress the
 use of dialog boxes.  This also controls whether to use file selection
 windows (but those are not supported on all platforms).
 
@@ -907,10 +907,10 @@
   A file selection window is a special kind of dialog box for asking for
 file names.
 
-  You can customize the option @code{use-file-dialog} to suppress the
+  You can customize the variable @code{use-file-dialog} to suppress the
 use of file selection windows even if you still want other kinds
-of dialogs.  This option has no effect if you have suppressed all dialog
-boxes with the option @code{use-dialog-box}.
+of dialogs.  This variable has no effect if you have suppressed all dialog
+boxes with the variable @code{use-dialog-box}.
 
 @vindex x-use-old-gtk-file-dialog
   For Gtk+ version 2.4 and 2.6, you can make Emacs use the old file dialog
@@ -949,7 +949,7 @@
 @vindex mouse-avoidance-mode
 Mouse Avoidance mode keeps the window system mouse pointer away from
 point, to avoid obscuring text.  Whenever it moves the mouse, it also
-raises the frame.  To use Mouse Avoidance mode, customize the option
+raises the frame.  To use Mouse Avoidance mode, customize the variable
 @code{mouse-avoidance-mode}.  You can set this to various values to
 move the mouse in several ways:
 
--- a/man/glossary.texi	Mon Jan 31 01:41:13 2005 +0000
+++ b/man/glossary.texi	Wed Feb 02 01:54:00 2005 +0000
@@ -434,6 +434,7 @@
 underline and strike-through, background stipple, etc.  Emacs provides
 features to associate specific faces with portions of buffer text, in
 order to display that text as specified by the face attributes.
+@xref{Faces}.
 
 @item File Locking
 Emacs uses file locking to notice when two different users
@@ -1223,8 +1224,9 @@
 @xref{Undo}.
 
 @item User Option
-A user option is a variable (q.v.@:) that exists so that you can customize
-Emacs by setting it to a new value.  @xref{Variables}.
+A user option is a face (q.v.@:) or a variable (q.v.@:) that exists so
+that you can customize Emacs by setting it to a new value.
+@xref{Easy Customization}.
 
 @item Variable
 A variable is an object in Lisp that can store an arbitrary value.
--- a/man/help.texi	Mon Jan 31 01:41:13 2005 +0000
+++ b/man/help.texi	Wed Feb 02 01:54:00 2005 +0000
@@ -40,7 +40,7 @@
 @cindex looking for a subject in documentation
   If you are looking for a certain feature, but don't know where
 exactly it is documented, and aren't sure of the name of a
-related command or option, we recommend trying these methods.  Usually
+related command or variable, we recommend trying these methods.  Usually
 it is best to start with an apropos command, then try searching the
 manual index, then finally look in the FAQ and the package keywords.
 
@@ -51,9 +51,9 @@
 command displays to find what you are looking for.  @xref{Apropos}.
 
 @item M-x apropos @key{RET} @var{topic} @key{RET}
-This works like @kbd{C-h a}, but it also searches for user options and
-other variables, in case the feature you are looking for is controlled
-by an option, not a command.  @xref{Apropos}.
+This works like @kbd{C-h a}, but it also searches for variables,
+in case the feature you are looking for is controlled by a variable
+rather than a command.  @xref{Apropos}.
 
 @item M-x apropos-documentation @key{RET} @var{topic} @key{RET}
 This searches the @emph{documentation strings} (the built-in short
@@ -302,9 +302,9 @@
 
 @findex apropos-variable
   To list all user variables that match a regexp, use the command
-@kbd{M-x apropos-variable}. This command shows only user variables and
-customization options by default; if you specify a prefix argument, it
-checks all variables.
+@kbd{M-x apropos-variable}.  By default, this command shows only
+variables meant for user customization; if you specify a prefix
+argument, it checks all variables.
 
 @findex apropos
   To list all Lisp symbols that contain a match for a regexp, not just
--- a/man/macos.texi	Mon Jan 31 01:41:13 2005 +0000
+++ b/man/macos.texi	Wed Feb 02 01:54:00 2005 +0000
@@ -101,7 +101,7 @@
 coding system using 12-point Monaco.
 
   To insert characters directly in the @code{mac-roman} coding system,
-type @kbd{C-x @key{RET} k mac-roman @key{RET}}, customize the option
+type @kbd{C-x @key{RET} k mac-roman @key{RET}}, customize the variable
 @code{keyboard-coding-system}, or put this in your init file:
 
 @lisp
--- a/man/maintaining.texi	Mon Jan 31 01:41:13 2005 +0000
+++ b/man/maintaining.texi	Wed Feb 02 01:54:00 2005 +0000
@@ -90,7 +90,7 @@
 changed.
 
 @vindex add-log-keep-changes-together
-  When the option @code{add-log-keep-changes-together} is
+  When the variable @code{add-log-keep-changes-together} is
 non-@code{nil}, @kbd{C-x 4 a} adds to any existing entry for the file
 rather than starting a new entry.
 
--- a/man/major.texi	Mon Jan 31 01:41:13 2005 +0000
+++ b/man/major.texi	Wed Feb 02 01:54:00 2005 +0000
@@ -18,9 +18,10 @@
   The least specialized major mode is called @dfn{Fundamental mode}.
 This mode has no mode-specific redefinitions or variable settings, so
 that each Emacs command behaves in its most general manner, and each
-option is in its default state.  For editing text of a specific type
-that Emacs knows about, such as Lisp code or English text, you should
-switch to the appropriate major mode, such as Lisp mode or Text mode.
+user option variable is in its default state.  For editing text of a
+specific type that Emacs knows about, such as Lisp code or English
+text, you should switch to the appropriate major mode, such as Lisp
+mode or Text mode.
 
   Selecting a major mode changes the meanings of a few keys to become
 more specifically adapted to the language being edited.  The ones that
--- a/man/mini.texi	Mon Jan 31 01:41:13 2005 +0000
+++ b/man/mini.texi	Wed Feb 02 01:54:00 2005 +0000
@@ -392,7 +392,7 @@
 complete to @file{/usr/bin/foo}.
 
   To enable this mode, use the command @kbd{M-x
-partial-completion-mode}, or customize the option
+partial-completion-mode}, or customize the variable
 @code{partial-completion-mode}.  This binds the partial completion
 commands to @key{TAB}, @key{SPC}, @key{RET}, and @kbd{?}.  The usual
 completion commands are available on @kbd{M-@key{TAB}},
--- a/man/misc.texi	Mon Jan 31 01:41:13 2005 +0000
+++ b/man/misc.texi	Wed Feb 02 01:54:00 2005 +0000
@@ -2020,8 +2020,8 @@
 @cindex mode, CRiSP
 You can turn on key bindings to emulate the CRiSP/Brief editor with
 @kbd{M-x crisp-mode}.  Note that this rebinds @kbd{M-x} to exit Emacs
-unless you change the user option @code{crisp-override-meta-x}.  You can
-also use the command @kbd{M-x scroll-all-mode} or set the user option
+unless you set the variable @code{crisp-override-meta-x}.  You can
+also use the command @kbd{M-x scroll-all-mode} or set the variable
 @code{crisp-load-scroll-all} to emulate CRiSP's scroll-all feature
 (scrolling all windows together).
 
--- a/man/mule.texi	Mon Jan 31 01:41:13 2005 +0000
+++ b/man/mule.texi	Wed Feb 02 01:54:00 2005 +0000
@@ -996,11 +996,11 @@
 @findex set-keyboard-coding-system
 @vindex keyboard-coding-system
   The command @kbd{C-x @key{RET} k} (@code{set-keyboard-coding-system})
-or the Custom option @code{keyboard-coding-system}
-specifies the coding system for keyboard input.  Character-code
-translation of keyboard input is useful for terminals with keys that
-send non-@acronym{ASCII} graphic characters---for example, some terminals designed
-for ISO Latin-1 or subsets of it.
+or the variable @code{keyboard-coding-system} specifies the coding
+system for keyboard input.  Character-code translation of keyboard
+input is useful for terminals with keys that send non-@acronym{ASCII}
+graphic characters---for example, some terminals designed for ISO
+Latin-1 or subsets of it.
 
   By default, keyboard input is translated based on your system locale
 setting.  If your terminal does not really support the encoding
@@ -1276,7 +1276,7 @@
 @vindex latin1-display
   If your terminal can display Latin-1, you can display characters
 from other European character sets using a mixture of equivalent
-Latin-1 characters and @acronym{ASCII} mnemonics.  Use the Custom option
+Latin-1 characters and @acronym{ASCII} mnemonics.  Customize the variable
 @code{latin1-display} to enable this.  The mnemonic @acronym{ASCII}
 sequences mostly correspond to those of the prefix input methods.
 
@@ -1338,10 +1338,10 @@
 On a windowing terminal, you should not need to do anything special to
 use these keys; they should simply work.  On a text-only terminal, you
 should use the command @code{M-x set-keyboard-coding-system} or the
-Custom option @code{keyboard-coding-system} to specify which coding
+variable @code{keyboard-coding-system} to specify which coding
 system your keyboard uses (@pxref{Specify Coding}).  Enabling this
 feature will probably require you to use @kbd{ESC} to type Meta
-characters; however, on a Linux console or in @code{xterm}, you can
+characters; however, on a console terminal or in @code{xterm}, you can
 arrange for Meta to be converted to @kbd{ESC} and still be able type
 8-bit characters present directly on the keyboard or using
 @kbd{Compose} or @kbd{AltGr} keys.  @xref{User Input}.
--- a/man/picture.texi	Mon Jan 31 01:41:13 2005 +0000
+++ b/man/picture.texi	Wed Feb 02 01:54:00 2005 +0000
@@ -44,7 +44,8 @@
 
 @vindex picture-mode-hook
   Turning on Picture mode runs the hook @code{picture-mode-hook}
-(@pxref{Hooks}).
+(@pxref{Hooks}).  Additional extensions to Picture mode can be found
+in @file{artist.el}.
 
 @menu
 * Basic Picture::         Basic concepts and simple commands of Picture Mode.
--- a/man/programs.texi	Mon Jan 31 01:41:13 2005 +0000
+++ b/man/programs.texi	Wed Feb 02 01:54:00 2005 +0000
@@ -1277,7 +1277,7 @@
 @vindex hs-hide-comments-when-hiding-all
 @vindex hs-isearch-open
 @vindex hs-special-modes-alist
-  These user options exist for customizing Hideshow mode.
+  These variables exist for customizing Hideshow mode.
 
 @table @code
 @item hs-hide-comments-when-hiding-all
--- a/man/screen.texi	Mon Jan 31 01:41:13 2005 +0000
+++ b/man/screen.texi	Wed Feb 02 01:54:00 2005 +0000
@@ -97,7 +97,7 @@
 are just hollow.  Thus, the most striking cursor always shows you
 the selected window, on all kinds of terminals.
 
-  @xref{Cursor Display}, for customization options that control display
+  @xref{Cursor Display}, for customizable variables that control display
 of the cursor or cursors.
 
   The term ``point'' comes from the character @samp{.}, which was the
--- a/man/sending.texi	Mon Jan 31 01:41:13 2005 +0000
+++ b/man/sending.texi	Wed Feb 02 01:54:00 2005 +0000
@@ -506,9 +506,9 @@
 
   For completion purposes, the valid mailing addresses are taken to be
 the local users' names plus your personal mail aliases.  You can
-specify additional sources of valid addresses; look at the customization
-group @samp{mailalias} to see the options for this
-(@pxref{Customization Groups}).
+specify additional sources of valid addresses; see the customization
+group @samp{mailalias} to see the variables for customizing this
+feature (@pxref{Customization Groups}).
 
   If you type @kbd{M-@key{TAB}} in the body of the message,
 @code{mail-complete} invokes @code{ispell-complete-word}, as in Text
--- a/src/ChangeLog	Mon Jan 31 01:41:13 2005 +0000
+++ b/src/ChangeLog	Wed Feb 02 01:54:00 2005 +0000
@@ -1,3 +1,38 @@
+2005-02-01  Kim F. Storm  <storm@cua.dk>
+
+	* xdisp.c (back_to_previous_visible_line_start): Reset iterator
+	stack before calling handle_display_prop.
+
+2005-01-31  Kim F. Storm  <storm@cua.dk>
+
+	* undo.c (Qapply): New lisp var.
+	(syms_of_undo): Intern and staticpro it.
+	(Fprimitive_undo): Support formats (apply FUNNAME . ARGS) and
+	(apply DELTA BEG END FUNNAME . ARGS) instead of (FUNNAME . ARGS).
+
+	* buffer.c (syms_of_buffer) <buffer-undo-list>: Doc fix.
+
+2005-01-30  Jesper Harder  <harder@phys.au.dk>
+
+	* macterm.c (syms_of_macterm) <mac-reverse-ctrl-meta>
+	<mac-emulate-three-button-mouse>: Fix docstring indentation.
+
+2005-01-29  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* undo.c (syms_of_undo) <undo-outer-limit>: Doc update.
+	Increase value to 3 Meg.
+
+2005-01-29  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* xfns.c (show_hourglass): Use FRAME_X_WINDOW as parent for GTK,
+	button events are not received otherwise.
+
+2005-01-29  Richard M. Stallman  <rms@gnu.org>
+
+	* buffer.c (syms_of_buffer) <buffer-undo-list>: Doc fix.
+
+	* undo.c (Fprimitive_undo): Handle (FUNNAME . ARGS) by calling FUNNAME.
+
 2005-01-28  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* keymap.c (access_keymap): YAILOM.
--- a/src/buffer.c	Mon Jan 31 01:41:13 2005 +0000
+++ b/src/buffer.c	Wed Feb 02 01:54:00 2005 +0000
@@ -5798,6 +5798,14 @@
 was modified between BEG and END.  PROPERTY is the property name,
 and VALUE is the old value.
 
+An entry (apply FUN-NAME . ARGS) means undo the change with
+\(apply FUN-NAME ARGS).
+
+An entry (apply DELTA BEG END FUN-NAME . ARGS) supports selective undo
+in the active region.  BEG and END is the range affected by this entry
+and DELTA is the number of bytes added or deleted in that range by
+this change.
+
 An entry (MARKER . DISTANCE) indicates that the marker MARKER
 was adjusted in position by the offset DISTANCE (an integer).
 
--- a/src/casetab.c	Mon Jan 31 01:41:13 2005 +0000
+++ b/src/casetab.c	Wed Feb 02 01:54:00 2005 +0000
@@ -18,7 +18,7 @@
 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
-/* Written by Howard Gayle.  See chartab.c for details. */
+/* Written by Howard Gayle.  */
 
 #include <config.h>
 #include "lisp.h"
--- a/src/macterm.c	Mon Jan 31 01:41:13 2005 +0000
+++ b/src/macterm.c	Wed Feb 02 01:54:00 2005 +0000
@@ -9928,18 +9928,18 @@
 
   DEFVAR_LISP ("mac-reverse-ctrl-meta", &Vmac_reverse_ctrl_meta,
     doc: /* Non-nil means that the control and meta keys are reversed.  This is
-	    useful for non-standard keyboard layouts.  */);
+useful for non-standard keyboard layouts.  */);
   Vmac_reverse_ctrl_meta = Qnil;
 
   DEFVAR_LISP ("mac-emulate-three-button-mouse",
 	       &Vmac_emulate_three_button_mouse,
     doc: /* t means that when the option-key is held down while pressing the
-    mouse button, the click will register as mouse-2 and while the
-    command-key is held down, the click will register as mouse-3.
-    'reverse means that the the option-key will register for mouse-3
-    and the command-key will register for mouse-2.  nil means that
-    not emulation should be done and the modifiers should be placed
-    on the mouse-1 event. */);
+mouse button, the click will register as mouse-2 and while the
+command-key is held down, the click will register as mouse-3.
+'reverse means that the the option-key will register for mouse-3
+and the command-key will register for mouse-2.  nil means that
+no emulation should be done and the modifiers should be placed
+on the mouse-1 event. */);
   Vmac_emulate_three_button_mouse = Qnil;
 
 #if USE_CARBON_EVENTS
--- a/src/undo.c	Mon Jan 31 01:41:13 2005 +0000
+++ b/src/undo.c	Wed Feb 02 01:54:00 2005 +0000
@@ -40,6 +40,10 @@
 
 Lisp_Object Qinhibit_read_only;
 
+/* Marker for function call undo list elements.  */
+
+Lisp_Object Qapply;
+
 /* The first time a command records something for undo.
    it also allocates the undo-boundary object
    which will be added to the list at the end of the command.
@@ -519,7 +523,7 @@
 		}
 	      else if (EQ (car, Qnil))
 		{
-		  /* Element (nil prop val beg . end) is property change.  */
+		  /* Element (nil PROP VAL BEG . END) is property change.  */
 		  Lisp_Object beg, end, prop, val;
 
 		  prop = Fcar (cdr);
@@ -543,6 +547,26 @@
 		  Fgoto_char (car);
 		  Fdelete_region (car, cdr);
 		}
+	      else if (EQ (car, Qapply))
+		{
+		  Lisp_Object oldlist = current_buffer->undo_list;
+		  /* Element (apply FUNNAME . ARGS) means call FUNNAME to undo.  */
+		  car = Fcar (cdr);
+		  if (INTEGERP (car))
+		    {
+		      /* Long format: (apply DELTA START END FUNNAME . ARGS).  */
+		      cdr = Fcdr (Fcdr (Fcdr (cdr)));
+		      car = Fcar (cdr);
+		    }
+		  cdr = Fcdr (cdr);
+		  apply1 (car, cdr);
+		  /* Make sure this produces at least one undo entry,
+		     so the test in `undo' for continuing an undo series
+		     will work right.  */
+		  if (EQ (oldlist, current_buffer->undo_list))
+		    current_buffer->undo_list
+		      = Fcons (list2 (Qcdr, Qnil), current_buffer->undo_list);
+		}
 	      else if (STRINGP (car) && INTEGERP (cdr))
 		{
 		  /* Element (STRING . POS) means STRING was deleted.  */
@@ -589,13 +613,16 @@
   UNGCPRO;
   return unbind_to (count, list);
 }
-
+
 void
 syms_of_undo ()
 {
   Qinhibit_read_only = intern ("inhibit-read-only");
   staticpro (&Qinhibit_read_only);
 
+  Qapply = intern ("apply");
+  staticpro (&Qapply);
+
   pending_boundary = Qnil;
   staticpro (&pending_boundary);
 
@@ -627,17 +654,19 @@
   DEFVAR_LISP ("undo-outer-limit", &Vundo_outer_limit,
 	      doc: /* Outer limit on size of undo information for one command.
 At garbage collection time, if the current command has produced
-more than this much undo information, it asks you whether to delete
-the information.  This is a last-ditch limit to prevent memory overflow.
+more than this much undo information, it discards the info and displays
+a warning.  This is a last-ditch limit to prevent memory overflow.
 
-The size is counted as the number of bytes occupied,
-which includes both saved text and other data.
+The size is counted as the number of bytes occupied, which includes
+both saved text and other data.  A value of nil means no limit.  In
+this case, accumulating one huge undo entry could make Emacs crash as
+a result of memory overflow.
 
 In fact, this calls the function which is the value of
 `undo-outer-limit-function' with one argument, the size.
 The text above describes the behavior of the function
 that variable usually specifies.  */);
-  Vundo_outer_limit = make_number (300000);
+  Vundo_outer_limit = make_number (3000000);
 
   DEFVAR_LISP ("undo-outer-limit-function", &Vundo_outer_limit_function,
 	       doc: /* Function to call when an undo list exceeds `undo-outer-limit'.
--- a/src/xdisp.c	Mon Jan 31 01:41:13 2005 +0000
+++ b/src/xdisp.c	Wed Feb 02 01:54:00 2005 +0000
@@ -4799,6 +4799,7 @@
 	int beg, end;
 	Lisp_Object val, overlay;
 
+	it2.sp = 0;
 	if (handle_display_prop (&it2) == HANDLED_RETURN
 	    && !NILP (val = get_char_property_and_overlay
 		      (make_number (pos), Qdisplay, Qnil, &overlay))
--- a/src/xfns.c	Mon Jan 31 01:41:13 2005 +0000
+++ b/src/xfns.c	Wed Feb 02 01:54:00 2005 +0000
@@ -4323,11 +4323,15 @@
 		    {
 		      unsigned long mask = CWCursor;
 		      XSetWindowAttributes attrs;
-
+#ifdef USE_GTK
+                      Window parent = FRAME_X_WINDOW (f);
+#else
+                      Window parent = FRAME_OUTER_WINDOW (f);
+#endif
 		      attrs.cursor = f->output_data.x->hourglass_cursor;
 
 		      f->output_data.x->hourglass_window
-			= XCreateWindow (dpy, FRAME_OUTER_WINDOW (f),
+			= XCreateWindow (dpy, parent,
 					 0, 0, 32000, 32000, 0, 0,
 					 InputOnly,
 					 CopyFromParent,