changeset 90106:bf0d492ea2d5

Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-16 Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-106 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-110 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-111 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-112 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-113 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-114 <no summary provided> * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-115 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-123 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-124 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-17 - miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-19 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-20 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-21 More work on moving images to etc/images * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-22 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-23 Fix errors with image-file installation * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-24 etc/Makefile.in (install): Put gnus-tut.txt in the right place. * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-25 etc/Makefile.in (install, uninstall): Fix installed image dirs. * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-26 etc/Makefile.in (install): Create $(etcdir)/images/gnus dir. * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-27 Update from CVS
author Miles Bader <miles@gnu.org>
date Wed, 23 Feb 2005 09:18:23 +0000
parents 7e3f621f1dd4 (current diff) a2c5c861962a (diff)
children 02eaf6dd9258
files admin/FOR-RELEASE etc/NEWS etc/PROBLEMS lisp/ChangeLog lisp/autorevert.el lisp/button.el lisp/calc/calc-aent.el lisp/calc/calc-arith.el lisp/calc/calc-math.el lisp/calc/calc-prog.el lisp/calc/calcalg2.el lisp/ediff-diff.el lisp/ediff-init.el lisp/ediff-mult.el lisp/ediff.el lisp/emulation/viper-cmd.el lisp/emulation/viper-ex.el lisp/emulation/viper-init.el lisp/emulation/viper-keym.el lisp/emulation/viper-macs.el lisp/emulation/viper-util.el lisp/emulation/viper.el lisp/faces.el lisp/frame.el lisp/gnus/ChangeLog lisp/gnus/gnus-art.el lisp/gnus/gnus-group.el lisp/gnus/gnus-msg.el lisp/gnus/gnus-sum.el lisp/gnus/gnus.el lisp/gnus/imap.el lisp/gnus/mml.el lisp/gnus/nnimap.el lisp/gnus/rfc2047.el lisp/isearch.el lisp/log-view.el lisp/mouse.el lisp/net/browse-url.el lisp/net/tramp.el lisp/pcvs.el lisp/progmodes/gdb-ui.el lisp/progmodes/hideif.el lisp/progmodes/meta-mode.el lisp/progmodes/scheme.el lisp/ps-print.el lisp/replace.el lisp/ses.el lisp/simple.el lisp/subr.el lisp/term/mac-win.el lisp/textmodes/ispell.el lisp/tooltip.el lispref/ChangeLog lispref/minibuf.texi man/ChangeLog man/ediff.texi man/ses.texi man/viper.texi src/.gdbinit src/ChangeLog src/ChangeLog.5 src/alloc.c src/gtkutil.c src/keymap.h src/minibuf.c src/window.c src/xdisp.c src/xfaces.c
diffstat 70 files changed, 1499 insertions(+), 479 deletions(-) [+]
line wrap: on
line diff
--- a/admin/FOR-RELEASE	Fri Feb 18 00:41:50 2005 +0000
+++ b/admin/FOR-RELEASE	Wed Feb 23 09:18:23 2005 +0000
@@ -13,6 +13,9 @@
 
 ** Update Speedbar.
 
+** Enhance scroll-bar to handle tall line (similar to line-move).
+
+
 * FATAL ERRORS
 
 ** Investigate face cache related crash.
@@ -65,41 +68,6 @@
 I think in the near future we will see more of this problem, so it might be
 time to make anfe-ftp more intelligent.
 
-** pcvs bug:
-
-In a CVS mode buffer created using the `cvs-examine' command, if I
-commit a file in a subdirectory, after committing the line is not
-updated with the version of the new revision.  Instead, a line is added
-in the buffer in the top directory listing.
-
-Example: I start with this:
-
-,----
-| In directory .:
-|               Unknown                 .htaccess
-|               Unknown                 404.php
-|               Unknown                 rain.jpg
-| In directory include:
-|               Modified                include/foo.include
-`----
-
-I commit the file include/foo.include using `c' on the corresponding
-line.  I get:
-
-,----
-| In directory .:
-|               Unknown                 .htaccess
-|               Unknown                 404.php
-| committed     Up-To-Date  1.13        foo.include
-|               Unknown                 rain.jpg
-| In directory include:
-|               Modified                include/foo.include
-`----
-
-There is no file named foo.include in the top directory. This bug
-appeared sometime before October 2004 and now.
-
-
 
 * GTK RELATED BUGS
 
@@ -222,7 +190,7 @@
 man/cmdargs.texi    Chong Yidong
 man/commands.texi   "Luc Teirlinck"
 man/custom.texi     Chong Yidong
-man/dired.texi      Chong Yidong     joakim@verona.se 
+man/dired.texi      Chong Yidong     joakim@verona.se
 man/display.texi    "Luc Teirlinck"  Chong Yidong
 man/emacs.texi      "Luc Teirlinck"
 man/entering.texi   "Luc Teirlinck"  Chong Yidong
--- a/etc/NEWS	Fri Feb 18 00:41:50 2005 +0000
+++ b/etc/NEWS	Wed Feb 23 09:18:23 2005 +0000
@@ -3392,7 +3392,8 @@
 ** The functions all-completions and try-completion now accept lists
 of strings as well as hash-tables additionally to alists, obarrays
 and functions.  Furthermore, the function `test-completion' is now
-exported to Lisp.
+exported to Lisp.  The keys in alists and hash tables may be either
+strings or symbols, which are automatically converted with to strings.
 
 ---
 ** When pure storage overflows while dumping, Emacs now prints how
--- a/etc/PROBLEMS	Fri Feb 18 00:41:50 2005 +0000
+++ b/etc/PROBLEMS	Wed Feb 23 09:18:23 2005 +0000
@@ -492,6 +492,20 @@
 Upgrade to AUC TeX version 10 or later, and make sure it is
 byte-compiled with Emacs 21.
 
+** PCL-CVS
+
+*** Lines are not updated or new lines are added in the buffer upon commit.
+
+When committing files located higher in the hierarchy than the examined
+directory, some versions of the CVS program return an ambiguous message
+from which PCL-CVS cannot extract the full location of the committed
+files.  As a result, the corresponding lines in the PCL-CVS buffer are
+not updated with the new revision of these files, and new lines are
+added to the top-level directory.
+
+This can happen with CVS versions 1.12.8 and 1.12.9.  Upgrade to CVS
+1.12.10 or newer to fix this problem.
+
 ** Miscellaneous problems
 
 *** Self-documentation messages are garbled.
--- a/lisp/ChangeLog	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/ChangeLog	Wed Feb 23 09:18:23 2005 +0000
@@ -1,3 +1,198 @@
+2005-02-22  Kim F. Storm  <storm@cua.dk>
+
+	* progmodes/hideif.el (hide-ifdef-use-define-alist): Use
+	completing-read.  Suggested by Juan-Leon Lahoz Garcia.
+
+2005-02-22  Simon Josefsson  <jas@extundo.com>
+
+	* net/browse-url.el (browse-url-netscape-new-window-is-tab): New
+	variable.
+	(browse-url-netscape): Use it.  Suggested by "Johann 'Myrkraverk'
+	Oskarsson" <myrkraverk@users.sourceforget.net>.
+
+2005-02-22  Kim F. Storm  <storm@cua.dk>
+
+	* mouse.el (mouse-on-link-p): If arg POS is a mouse event,
+	check that window of that event is the selected window.
+	(mouse-drag-region-1): Compare mouse event window to selected
+	window before setting point.
+
+	* tooltip.el (tooltip-show-help-function): Pass event to
+	mouse-on-link-p so it can check selected window.
+
+2005-02-22  Kenichi Handa  <handa@m17n.org>
+
+	* ps-mule.el (ps-mule-header-string-charsets): Delete it.
+	(ps-mule-show-warning): New function.
+	(ps-mule-begin-job): Use ps-mule-show-warning if unprintable
+	characters are found.
+
+	* ps-print.el (ps-header-footer-string): Return a list of header
+	and footer strings.
+
+2005-02-21  Wolfgang Jenkner  <wjenkner@inode.at>  (tiny change)
+
+	* pcvs.el (cvs-retrieve-revision): Fix thinko.
+
+2005-02-21  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* frame.el (blink-cursor-mode): Use define-minor-mode.
+
+	* term/mac-win.el (function-key-map): Use char-names more consistently.
+	(file-name-coding-system): Only set it for MacOS-9.  The other case is
+	already handled in mule-cmds.el (where it also works when mac-win.el
+	is not used).
+
+2005-02-21  Kenichi Handa  <handa@m17n.org>
+
+	* international/mule.el (ctext-pre-write-conversion): Always use
+	" *code-converting-work*" buffer for work.
+
+	* textmodes/ispell.el (ispell-dictionary-alist): Fix docstring.
+
+2005-02-20  Thien-Thi Nguyen  <ttn@gnu.org>
+
+	* progmodes/scheme.el (scheme-font-lock-keywords-2): Handle named-let.
+
+2005-02-20  Jonathan Yavner  <jyavner@member.fsf.org>
+
+	* ses.el (undo-more): Restore defadvice, but only the part that
+	allows changes outside the restricted area of the buffer.
+
+2005-02-20  Kim F. Storm  <storm@cua.dk>
+
+	* simple.el (line-move): Add fourth optional arg try-vscroll which
+	must be set to perform auto-window-vscroll.
+	When moving backwards and doing auto-window-vscroll, automatically
+	vscroll to the last part of lines which are taller than the window.
+	(next-line, previous-line): Set try-vscroll arg on line-move.
+
+2005-02-19  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* replace.el (query-replace, query-replace-regexp)
+	(replace-string, replace-regexp): When operating on region, make
+	the minibuffer prompt say so.
+
+	* isearch.el (isearch-forward): Document isearch-query-replace and
+	isearch-query-replace-regexp keybindings.
+
+2005-02-19  Jay Belanger  <belanger@truman.edu>
+
+	* calc/calc-aent.el (math-read-token): Add local variable.
+
+	* calc/calc-prog.el (calc-user-define-edit): Add local variable.
+	(calc-edit-top): Move declaration to earlier in file.
+	(calc-edit-macro-repeats): Add local variables.
+
+	* calc/calcalg2.el: Add differentiation rule for calcFunc-coth.
+	Adjust differentiation rules for calcFunc-tan, calcFunc-cot,
+	calcFunc-tanh.
+	Adjust integration rule for calcFunc-tan.
+
+2005-02-19  Michael Kifer  <kifer@cs.stonybrook.edu>
+
+	* viper-cmd.el (viper-prefix-commands): Make into a defconst.
+	(viper-exec-buffer-search): Use regexp-quote to quote buffer string.
+	(viper-minibuffer-setup-sentinel): Make some variables buffer-local.
+	(viper-skip-separators): Bug fix.
+	(viper-set-searchstyle-toggling-macros): Allow to unset macros in a
+	particular major mode.
+	(viper-del-backward-char-in-replace): Don't put deleted char on the
+	kill ring.
+
+	* viper-ex.el (viper-color-display-p): New function.
+	(viper-has-face-support-p): Use viper-color-display-p.
+
+	* viper-keym.el (viper-gnus-modifier-map): New keymap.
+
+	* viper-macs.el (viper-unrecord-kbd-macro): Bug fix.
+
+	* viper-util.el (viper-glob-unix-files): Fix shell status check.
+	(viper-file-remote-p): Make equivalent to file-remote-p.
+
+	* viper.el (viper-major-mode-modifier-list): Use
+	viper-gnus-modifier-map.
+
+2005-02-19  David Kastrup  <dak@gnu.org>
+
+	* subr.el (subregexp-context-p): Fix garbled doc string by adding
+	quoting.
+
+2005-02-19  Jay Belanger  <belanger@truman.edu>
+
+	* calc/calc-math.el (calc-arctan, calc-tanh, calc-arctanh):
+	Removed extra definitions.
+	(calc-coth): New function.
+	(calcFunc-cot): Fix `let'.
+
+2005-02-19  Eli Zaretskii  <eliz@gnu.org>
+
+	* faces.el (escape-glyph, minibuffer-prompt): Add commentary for
+	the reasons we use "type pc" in these faces.
+
+	* button.el (button): Ditto.
+
+2005-02-19  Michael Mauger  <mmaug@yahoo.com>
+
+	* replace.el (query-replace-read-from): Set the value of
+	query-replace-from-history-variable to handle the case of an empty
+	string entered to accept the suggested default.
+
+	* net/tramp.el (tramp-file-name-for-operation): Use
+	dired-call-process instead of dired-call-process-command.
+
+2005-02-19  Jay Belanger  <belanger@truman.edu>
+
+	* calc/calc-arith.el (math-trig-inverses, math-div-trig)
+	(math-div-non-trig): New variables.
+	(math-combine-prod-trig, math-div-new-trig, math-div-new-non-trig)
+	(math-div-isolate-trig, math-div-isolate-trig-term): New functions.
+	(math-combine-prod, math-div-symb-fancy): Add simplifications for
+	trig expressions.
+
+2005-02-19  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gdb-ui.el (gdb-var-update-handler)
+	(gdb-speedbar-timer-fn): Ensure speedbar updates with new values
+	for watch expressions,
+	(gdb-var-create-handler): Don't set speedbar-update-flag.
+	(gdb-post-prompt): Simplify test for speedbar.
+
+2005-02-19  Michael Kifer  <kifer@cs.stonybrook.edu>
+
+	* ediff.el (ediff-set-diff-overlays-in-one-buffer,
+	ediff-set-fine-overlays-in-one-buffer,ediff-goto-word) make sure
+	we use the syntax table of the correct buffer.
+	(ediff-same-file-contents,ediff-same-contents): enhancements thanks to
+	Felix Gatzemeier.
+
+	* ediff-init.el (ediff-hide-face): checks for definedness of functions.
+	(ediff-file-remote-p): make synonymous with file-remote-p.
+	In all deffaces ediff-*-face-*, use min-colors.
+
+	* ediff-mult.el (ediff-meta-mark-equal-files): make use of
+        ediff-recurse-to-subdirectories.
+	(ediff-mark-if-equal): check that the arguments are strings, use
+	ediff-same-contents (after to Felix Gatzemeier).
+
+	* ediff.el (ediff-merge-on-startup): don't set buffer-modified-p to
+	nil.
+
+2005-02-18  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* log-view.el (log-view-message-re): Fix up Subversion regexp.
+
+2005-02-18  David Kastrup  <dak@gnu.org>
+
+	* progmodes/meta-mode.el (meta-mark-active): Fix condition to just
+	use `mark-active' when defined.
+
+2005-02-18  Kenichi Handa  <handa@m17n.org>
+
+	* ps-print.el (ps-font-info-database): New entry
+	ZapfChancery-MediumItalic with correct font name.  Fix font name
+	of the entry Zapf-Chancery-MediumItalic.
+
 2005-02-16  Luc Teirlinck  <teirllm@auburn.edu>
 
 	* autorevert.el (auto-revert-stop-on-user-input): Further doc fix.
@@ -82,8 +277,8 @@
 
 2005-02-15  Lute Kamstra  <lute@gnu.org>
 
-	* emacs-lisp/lisp-mode.el (lisp-mode-variables): Add
-	;;;###autoload to `outline-regexp'.  Suggested by Stefan Monnier
+	* emacs-lisp/lisp-mode.el (lisp-mode-variables):
+	Add ;;;###autoload to `outline-regexp'.  Suggested by Stefan Monnier
 	<monnier@iro.umontreal.ca>
 	(lisp-outline-level): Improve efficiency.  Suggested by David
 	Kastrup <dak@gnu.org>.
@@ -158,7 +353,7 @@
 	* simple.el (eval-expression-print-format):
 	Avoid warning about edebug-active.
 
-	* help.el (help-for-help-internal): Renamed from help-for-help.
+	* help.el (help-for-help-internal): Rename from help-for-help.
 	(help-for-help): Define with defalias.
 
 	* font-core.el (font-lock-default-function): Use with-no-warnings.
@@ -191,7 +386,7 @@
 2005-02-09  Nick Roberts  <nickrob@snap.net.nz>
 
 	* progmodes/gdb-ui.el (gdb-location-list): New variable.
-	(gdb-cdir): Delete
+	(gdb-cdir): Delete.
 	(gdb-info-breakpoints-custom, gdb-goto-breakpoint)
 	(gdb-source-info): Treat case when source file is in another
 	directory properly.
@@ -202,8 +397,7 @@
 	* calc/calc-prog.el (calc-write-parse-table-part)
 	(calc-fix-token-name): Fix a check for language type.
 
-	* calc/calccomp.el (math-compose-expr): Fix a check for language
-	type.
+	* calc/calccomp.el (math-compose-expr): Fix a check for language type.
 
 2005-02-07  Andre Spiegel  <spiegel@gnu.org>
 
--- a/lisp/autorevert.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/autorevert.el	Wed Feb 23 09:18:23 2005 +0000
@@ -156,7 +156,7 @@
 \(until the next run of the timer) if user input is available.
 When nil, Auto-Revert Mode checks files and reverts buffers,
 with quitting disabled, without paying attention to user input.
-Thus, Emacs might be non-responsive at times."
+Thus, with this setting, Emacs might be non-responsive at times."
   :group 'auto-revert
   :type 'boolean)
 
--- a/lisp/button.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/button.el	Wed Feb 23 09:18:23 2005 +0000
@@ -50,6 +50,7 @@
 
 ;; Globals
 
+;; Use color for the MS-DOS port because it doesn't support underline.
 (defface button '((((type pc) (class color))
 		   (:foreground "lightblue"))
 		  (t :underline t))
--- a/lisp/calc/calc-aent.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/calc/calc-aent.el	Wed Feb 23 09:18:23 2005 +0000
@@ -784,7 +784,8 @@
 		   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)))
+	     (let ((code (assoc math-expr-data math-tex-ignore-words))
+                   envname)
 	       (cond ((null code))
 		     ((null (cdr code))
 		      (math-read-token))
@@ -801,8 +802,8 @@
                                  (string= envname "bmatrix")
                                  (string= envname "smallmatrix")
                                  (string= envname "pmatrix"))
-                             (if (setq j (string-match (concat "\\\\end{" envname "}")
-                                               math-exp-str math-exp-pos))
+                             (if (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 "}"))))))
--- a/lisp/calc/calc-arith.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/calc/calc-arith.el	Wed Feb 23 09:18:23 2005 +0000
@@ -1609,6 +1609,50 @@
 	    (math-reject-arg b "*Division by zero"))
 	a))))
 
+;; For math-div-symb-fancy
+(defvar math-trig-inverses
+  '((calcFunc-sin . calcFunc-csc)
+    (calcFunc-cos . calcFunc-sec)
+    (calcFunc-tan . calcFunc-cot)
+    (calcFunc-sec . calcFunc-cos)
+    (calcFunc-csc . calcFunc-sin)
+    (calcFunc-cot . calcFunc-tan)
+    (calcFunc-sinh . calcFunc-csch)
+    (calcFunc-cosh . calcFunc-sech)
+    (calcFunc-tanh . calcFunc-coth)
+    (calcFunc-sech . calcFunc-cosh)
+    (calcFunc-csch . calcFunc-sinh)
+    (calcFunc-coth . calcFunc-tanh)))
+
+(defvar math-div-trig)
+(defvar math-div-non-trig)
+
+(defun math-div-new-trig (tr)
+  (if math-div-trig
+      (setq math-div-trig
+            (list '* tr math-div-trig))
+    (setq math-div-trig tr)))
+
+(defun math-div-new-non-trig (ntr)
+  (if math-div-non-trig
+      (setq math-div-non-trig 
+            (list '* ntr math-div-non-trig))
+    (setq math-div-non-trig ntr)))
+
+(defun math-div-isolate-trig (expr)
+  (if (eq (car-safe expr) '*)
+      (progn
+        (math-div-isolate-trig-term (nth 1 expr))
+        (math-div-isolate-trig (nth 2 expr)))
+    (math-div-isolate-trig-term expr)))
+
+(defun math-div-isolate-trig-term (term)
+  (let ((fn (assoc (car-safe term) math-trig-inverses)))
+    (if fn
+        (math-div-new-trig
+         (cons (cdr fn) (cdr term)))
+      (math-div-new-non-trig term))))
+
 (defun math-div-symb-fancy (a b)
   (or (and math-simplify-only
 	   (not (equal a math-simplify-only))
@@ -1667,6 +1711,15 @@
 		    (list 'calcFunc-idn (math-div a (nth 1 b))))
 	       (and (math-known-matrixp a)
 		    (math-div a (nth 1 b)))))
+      (and math-simplifying
+           (let ((math-div-trig nil)
+                 (math-div-non-trig nil))
+             (math-div-isolate-trig b)
+             (if math-div-trig
+                 (if math-div-non-trig
+                     (math-div (math-mul a math-div-trig) math-div-non-trig)
+                   (math-mul a math-div-trig))
+               nil)))
       (if (and calc-matrix-mode
 	       (or (math-known-matrixp a) (math-known-matrixp b)))
 	  (math-combine-prod a b nil t nil)
@@ -2674,6 +2727,8 @@
 	 invb
 	 (math-looks-negp (nth 2 b)))
     (math-mul a (math-pow (nth 1 b) (math-neg (nth 2 b)))))
+   ((and math-simplifying
+         (math-combine-prod-trig a b)))
    (t (let ((apow 1) (bpow 1))
 	(and (consp a)
 	     (cond ((and (eq (car a) '^)
@@ -2771,6 +2826,83 @@
 			    (math-pow a apow)
 			  (inexact-result (list '^ a apow)))))))))))
 
+(defun math-combine-prod-trig (a b)
+  (cond
+   ((and (eq (car-safe a) 'calcFunc-sin)
+         (eq (car-safe b) 'calcFunc-csc)
+         (= 0 (math-simplify (math-sub (cdr a) (cdr b)))))
+    1)
+   ((and (eq (car-safe a) 'calcFunc-sin)
+         (eq (car-safe b) 'calcFunc-sec)
+         (= 0 (math-simplify (math-sub (cdr a) (cdr b)))))
+    (cons 'calcFunc-tan (cdr a)))
+   ((and (eq (car-safe a) 'calcFunc-sin)
+         (eq (car-safe b) 'calcFunc-cot)
+         (= 0 (math-simplify (math-sub (cdr a) (cdr b)))))
+    (cons 'calcFunc-cos (cdr a)))
+   ((and (eq (car-safe a) 'calcFunc-cos)
+         (eq (car-safe b) 'calcFunc-sec)
+         (= 0 (math-simplify (math-sub (cdr a) (cdr b)))))
+    1)
+   ((and (eq (car-safe a) 'calcFunc-cos)
+         (eq (car-safe b) 'calcFunc-csc)
+         (= 0 (math-simplify (math-sub (cdr a) (cdr b)))))
+    (cons 'calcFunc-cot (cdr a)))
+   ((and (eq (car-safe a) 'calcFunc-cos)
+         (eq (car-safe b) 'calcFunc-tan)
+         (= 0 (math-simplify (math-sub (cdr a) (cdr b)))))
+    (cons 'calcFunc-sin (cdr a)))
+   ((and (eq (car-safe a) 'calcFunc-tan)
+         (eq (car-safe b) 'calcFunc-cot)
+         (= 0 (math-simplify (math-sub (cdr a) (cdr b)))))
+    1)
+   ((and (eq (car-safe a) 'calcFunc-tan)
+         (eq (car-safe b) 'calcFunc-csc)
+         (= 0 (math-simplify (math-sub (cdr a) (cdr b)))))
+    (cons 'calcFunc-sec (cdr a)))
+   ((and (eq (car-safe a) 'calcFunc-sec)
+         (eq (car-safe b) 'calcFunc-cot)
+         (= 0 (math-simplify (math-sub (cdr a) (cdr b)))))
+    (cons 'calcFunc-csc (cdr a)))
+   ((and (eq (car-safe a) 'calcFunc-sinh)
+         (eq (car-safe b) 'calcFunc-csch)
+         (= 0 (math-simplify (math-sub (cdr a) (cdr b)))))
+    1)
+   ((and (eq (car-safe a) 'calcFunc-sinh)
+         (eq (car-safe b) 'calcFunc-sech)
+         (= 0 (math-simplify (math-sub (cdr a) (cdr b)))))
+    (cons 'calcFunc-tanh (cdr a)))
+   ((and (eq (car-safe a) 'calcFunc-sinh)
+         (eq (car-safe b) 'calcFunc-coth)
+         (= 0 (math-simplify (math-sub (cdr a) (cdr b)))))
+    (cons 'calcFunc-cosh (cdr a)))
+   ((and (eq (car-safe a) 'calcFunc-cosh)
+         (eq (car-safe b) 'calcFunc-sech)
+         (= 0 (math-simplify (math-sub (cdr a) (cdr b)))))
+    1)
+   ((and (eq (car-safe a) 'calcFunc-cosh)
+         (eq (car-safe b) 'calcFunc-csch)
+         (= 0 (math-simplify (math-sub (cdr a) (cdr b)))))
+    (cons 'calcFunc-coth (cdr a)))
+   ((and (eq (car-safe a) 'calcFunc-cosh)
+         (eq (car-safe b) 'calcFunc-tanh)
+         (= 0 (math-simplify (math-sub (cdr a) (cdr b)))))
+    (cons 'calcFunc-sinh (cdr a)))
+   ((and (eq (car-safe a) 'calcFunc-tanh)
+         (eq (car-safe b) 'calcFunc-coth)
+         (= 0 (math-simplify (math-sub (cdr a) (cdr b)))))
+    1)
+   ((and (eq (car-safe a) 'calcFunc-tanh)
+         (eq (car-safe b) 'calcFunc-csch)
+         (= 0 (math-simplify (math-sub (cdr a) (cdr b)))))
+    (cons 'calcFunc-sech (cdr a)))
+   ((and (eq (car-safe a) 'calcFunc-sech)
+         (eq (car-safe b) 'calcFunc-coth)
+         (= 0 (math-simplify (math-sub (cdr a) (cdr b)))))
+    (cons 'calcFunc-csch (cdr a)))
+   (t
+    nil)))
+
 (defun math-mul-or-div (a b ainv binv)
   (if (or (Math-vectorp a) (Math-vectorp b))
       (math-normalize
--- a/lisp/calc/calc-math.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/calc/calc-math.el	Wed Feb 23 09:18:23 2005 +0000
@@ -236,21 +236,10 @@
        (calc-unary-op "coth" 'calcFunc-coth arg)
      (calc-unary-op "cot" 'calcFunc-cot arg))))
 
-(defun calc-arctan (arg)
-  (interactive "P")
-  (calc-invert-func)
-  (calc-tan arg))
-
-(defun calc-tanh (arg)
+(defun calc-coth (arg)
   (interactive "P")
   (calc-hyperbolic-func)
-  (calc-tan arg))
-
-(defun calc-arctanh (arg)
-  (interactive "P")
-  (calc-invert-func)
-  (calc-hyperbolic-func)
-  (calc-tan arg))
+  (calc-cot arg))
 
 (defun calc-arctan2 ()
   (interactive)
@@ -991,11 +980,11 @@
 	 (or (math-with-extra-prec 2
 	       (let* ((xx (math-to-radians (math-float x)))
 		      (na (math-floor (math-div (nth 2 xx) (math-pi))))
-		      (nb (math-floor (math-div (nth 3 xx) (math-pi))))
+		      (nb (math-floor (math-div (nth 3 xx) (math-pi)))))
 		 (and (equal na nb)
 		      (math-sort-intv (nth 1 x)
 				      (math-cot-raw (nth 2 xx))
-				      (math-cot-raw (nth 3 xx)))))))
+				      (math-cot-raw (nth 3 xx))))))
 	     '(intv 3 (neg (var inf var-inf)) (var inf var-inf))))
 	((equal x '(var nan var-nan))
 	 x)
--- a/lisp/calc/calc-prog.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/calc/calc-prog.el	Wed Feb 23 09:18:23 2005 +0000
@@ -671,7 +671,8 @@
 (defun calc-user-define-edit ()
   (interactive)  ; but no calc-wrapper!
   (message "Edit definition of command: z-")
-  (let* ((key (read-char))
+  (let* (cmdname
+         (key (read-char))
 	 (def (or (assq key (calc-user-key-map))
 		  (assq (upcase key) (calc-user-key-map))
 		  (assq (downcase key) (calc-user-key-map))
@@ -720,17 +721,19 @@
 
 ;; Formatting the macro buffer
 
+(defvar calc-edit-top)
+
 (defun calc-edit-macro-repeats ()
   (goto-char calc-edit-top)
   (while
       (re-search-forward "^\\([0-9]+\\)\\*" nil t)
-    (setq num (string-to-int (match-string 1)))
-    (setq line (buffer-substring (point) (line-end-position)))
-    (goto-char (line-beginning-position))
-    (kill-line 1)
-    (while (> num 0)
-      (insert line "\n")
-      (setq num (1- num)))))
+    (let ((num (string-to-int (match-string 1)))
+          (line (buffer-substring (point) (line-end-position))))
+      (goto-char (line-beginning-position))
+      (kill-line 1)
+      (while (> num 0)
+        (insert line "\n")
+        (setq num (1- num))))))
 
 (defun calc-edit-macro-adjust-buffer ()
   (calc-edit-macro-repeats)
@@ -916,7 +919,6 @@
     (delete-char 3)
     (insert "<return>")))
 
-(defvar calc-edit-top)
 (defun calc-edit-macro-finish-edit (cmdname key)
   "Finish editing a Calc macro.
 Redefine the corresponding command."
--- a/lisp/calc/calcalg2.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/calc/calcalg2.el	Wed Feb 23 09:18:23 2005 +0000
@@ -408,9 +408,9 @@
 
 (put 'calcFunc-tan\' 'math-derivative-1
      (function (lambda (u) (math-to-radians-2
-			    (math-div 1 (math-sqr
-					 (math-normalize
-					  (list 'calcFunc-cos u))))))))
+			    (math-sqr
+                             (math-normalize
+                              (list 'calcFunc-sec u)))))))
 
 (put 'calcFunc-sec\' 'math-derivative-1
      (function (lambda (u) (math-to-radians-2 
@@ -432,9 +432,9 @@
 (put 'calcFunc-cot\' 'math-derivative-1
      (function (lambda (u) (math-neg
                             (math-to-radians-2
-                             (math-div 1 (math-sqr
-                                          (math-normalize
-                                           (list 'calcFunc-sin u)))))))))
+                             (math-sqr
+                              (math-normalize
+                               (list 'calcFunc-csc u))))))))
 
 (put 'calcFunc-arcsin\' 'math-derivative-1
      (function (lambda (u)
@@ -461,9 +461,9 @@
      (function (lambda (u) (math-normalize (list 'calcFunc-sinh u)))))
 
 (put 'calcFunc-tanh\' 'math-derivative-1
-     (function (lambda (u) (math-div 1 (math-sqr
-					(math-normalize
-					 (list 'calcFunc-cosh u)))))))
+     (function (lambda (u) (math-sqr
+                            (math-normalize
+                             (list 'calcFunc-sech u))))))
 
 (put 'calcFunc-sech\' 'math-derivative-1
      (function (lambda (u) (math-neg
@@ -477,11 +477,11 @@
                              (math-normalize (list 'calcFunc-csch u))
                              (math-normalize (list 'calcFunc-coth u)))))))
 
-(put 'calcFunc-tanh\' 'math-derivative-1
+(put 'calcFunc-coth\' 'math-derivative-1
      (function (lambda (u) (math-neg
-                            (math-div 1 (math-sqr
-                                         (math-normalize
-                                          (list 'calcFunc-sinh u))))))))
+                            (math-sqr
+                             (math-normalize
+                              (list 'calcFunc-csch u)))))))
 
 (put 'calcFunc-arcsinh\' 'math-derivative-1
      (function (lambda (u)
@@ -1664,8 +1664,8 @@
 
 (math-defintegral calcFunc-tan
   (and (equal u math-integ-var)
-       (math-neg (math-from-radians-2
-		  (list 'calcFunc-ln (list 'calcFunc-cos u))))))
+       (math-from-radians-2
+        (list 'calcFunc-ln (list 'calcFunc-sec u)))))
 
 (math-defintegral calcFunc-sec
   (and (equal u math-integ-var)
--- a/lisp/ediff-diff.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/ediff-diff.el	Wed Feb 23 09:18:23 2005 +0000
@@ -534,6 +534,7 @@
 (defun ediff-set-diff-overlays-in-one-buffer (buf-type diff-list)
   (let* ((current-diff -1)
 	 (buff (ediff-get-buffer buf-type))
+	 (ctl-buf ediff-control-buffer)
 	 ;; ediff-extract-diffs puts the type of diff-list as the first elt
 	 ;; of this list. The type is either 'points or 'words
 	 (diff-list-type (car diff-list))
@@ -580,8 +581,9 @@
       (if (eq diff-list-type 'words)
 	  (progn
 	    (ediff-with-current-buffer buff (goto-char pt-saved))
-	    (setq begin (ediff-goto-word (1+ begin) buff)
-		  end (ediff-goto-word end buff 'end))
+	    (ediff-with-current-buffer ctl-buf
+	      (setq begin (ediff-goto-word (1+ begin) buff)
+		    end (ediff-goto-word end buff 'end)))
 	    (if (> end limit) (setq end limit))
 	    (if (> begin end) (setq begin end))
 	    (setq pt-saved (ediff-with-current-buffer buff (point)))))
@@ -864,6 +866,7 @@
   (let* ((current-diff -1)
 	 (reg-start (ediff-get-diff-posn buf-type 'beg region-num))
 	 (buff (ediff-get-buffer buf-type))
+	 (ctl-buf ediff-control-buffer)
 	 combined-merge-diff-list
 	 diff-overlay-list list-element
 	 begin end overlay)
@@ -892,8 +895,9 @@
 	    () ; skip this diff
 	  ;; Put overlays at appropriate places in buffers
 	  ;; convert lines to points, if necessary
-	  (setq begin (ediff-goto-word (1+ begin) buff)
-		end (ediff-goto-word end buff 'end))
+	  (ediff-with-current-buffer ctl-buf
+	    (setq begin (ediff-goto-word (1+ begin) buff)
+		  end (ediff-goto-word end buff 'end)))
 	  (setq overlay (ediff-make-bullet-proof-overlay begin end buff))
 	  ;; record all overlays for this difference region
 	  (setq diff-overlay-list (nconc diff-overlay-list (list overlay))))
@@ -1326,17 +1330,73 @@
 	(while (> n 1)
 	  (funcall fwd-word-fun)
 	  (skip-chars-forward ediff-whitespace)
-	  (setq n (1- n))))
-      (if (and flag (> n 0))
-	  (funcall fwd-word-fun))
+	  (setq n (1- n)))
+	(if (and flag (> n 0))
+	    (funcall fwd-word-fun)))
       (point))))
 
 (defun ediff-same-file-contents (f1 f2)
-  "Return t if F1 and F2 have identical contents."
-  (let ((res
-	 (apply 'call-process ediff-cmp-program nil nil nil
- 		(append ediff-cmp-options (list f1 f2)))))
-    (and (numberp res) (eq res 0))))
+  "Return t if files F1 and F2 have identical contents."
+  (if (and (not (file-directory-p f1))
+           (not (file-directory-p f2)))
+      (let ((res
+	     (apply 'call-process ediff-cmp-program nil nil nil
+		    (append ediff-cmp-options (list f1 f2)))))
+	(and (numberp res) (eq res 0))))
+  )
+
+
+(defun ediff-same-contents (d1 d2 &optional filter-re)
+  "Returns t iff D1 and D2 have the same content.
+D1 and D2 can either be both directories or both regular files.
+Symlinks and the likes are not handled.
+If FILTER-RE is non-nil, recursive checking in directories
+affects only files whose names match the expression."
+  ;; Normalize empty filter RE to nil.
+  (unless (length filter-re) (setq filter-re nil))
+  ;; Indicate progress
+  (message "Comparing '%s' and '%s' modulo '%s'" d1 d2 filter-re)
+  (cond
+   ;; D1 & D2 directories => recurse
+   ((and (file-directory-p d1)
+         (file-directory-p d2))
+    (if (null ediff-recurse-to-subdirectories)
+	(if (y-or-n-p "Compare subdirectories recursively? ")
+	    (setq ediff-recurse-to-subdirectories 'yes)
+	  (setq ediff-recurse-to-subdirectories 'no)))
+    (if (eq ediff-recurse-to-subdirectories 'yes)
+	(let* ((all-entries-1 (directory-files d1 t filter-re))
+	       (all-entries-2 (directory-files d2 t filter-re))
+	       (entries-1 (remove-if (lambda (s)
+				       (string-match "^\\.\\.?$"
+						     (file-name-nondirectory s))) 
+				     all-entries-1))
+	       (entries-2 (remove-if (lambda (s)
+				       (string-match "^\\.\\.?$"
+						     (file-name-nondirectory s)))
+				     all-entries-2))
+	       )
+	  ;; First, check only the names (works quickly and ensures a
+	  ;; precondition for subsequent code)
+	  (if (and (= (length entries-1) (length entries-2))
+		   (every (lambda (a b) (equal (file-name-nondirectory a)
+					       (file-name-nondirectory b)))
+			  entries-1 entries-2))
+	      ;; With name equality established, compare the entries
+	      ;; through recursion.
+	      (every (lambda (a b)
+		       (ediff-same-contents a b filter-re))
+		     entries-1 entries-2)
+	    )
+	  ))
+    ) ; end of the directories case
+   ;; D1 & D2 are both files => compare directly
+   ((and (file-regular-p d1)
+         (file-regular-p d2))
+    (ediff-same-file-contents d1 d2))
+   ;; Otherwise => false: unequal contents
+   )
+  )
 
 
 ;;; Local Variables:
--- a/lisp/ediff-init.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/ediff-init.el	Wed Feb 23 09:18:23 2005 +0000
@@ -895,7 +895,8 @@
 	 (sit-for 1)))))
 
 (defun ediff-hide-face (face)
-  (if (and (ediff-has-face-support-p) (boundp 'add-to-list)
+  (if (and (ediff-has-face-support-p)
+	   (boundp 'add-to-list)
 	   (boundp 'facemenu-unlisted-faces))
       (add-to-list 'facemenu-unlisted-faces face)))
 
@@ -1404,7 +1405,7 @@
 ;;; Misc
 
 ;; if nil, this silences some messages
-(defvar ediff-verbose-p t)
+(defconst ediff-verbose-p t)
 
 (defcustom ediff-autostore-merges  'group-jobs-only
   "*Save the results of merge jobs automatically.
@@ -1473,11 +1474,8 @@
 (ediff-defvar-local ediff-temp-file-C nil "")
 
 
-;; If file-remote-p is defined (as in XEmacs, use it. Otherwise, check
-;; if find-file-name-handler is defined for 'file-local-copy
 (defun ediff-file-remote-p (file-name)
-  (or (and (fboundp 'file-remote-p) (file-remote-p file-name))
-      (find-file-name-handler file-name 'file-local-copy)))
+  (file-remote-p file-name))
 
 ;; File for which we can get attributes, such as size or date
 (defun ediff-listable-file (file-name)
--- a/lisp/ediff-mult.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/ediff-mult.el	Wed Feb 23 09:18:23 2005 +0000
@@ -1,6 +1,6 @@
 ;;; ediff-mult.el --- support for multi-file/multi-buffer processing in Ediff
 
-;; Copyright (C) 1995, 96, 97, 98, 99, 2000, 01, 02 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 96, 97, 98, 99, 2000, 01, 02, 05 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 
@@ -167,6 +167,9 @@
 ;; buffer used to collect custom diffs from individual sessions in the group
 (ediff-defvar-local ediff-meta-diff-buffer nil "")
 
+;; t means recurse into subdirs when deciding which files have same contents
+(ediff-defvar-local ediff-recurse-to-subdirectories nil "")
+
 ;; history var to use for filtering groups of files
 (defvar ediff-filtering-regexp-history nil "")
 
@@ -2349,6 +2352,7 @@
 		))
       (setq list (cdr list)))
     (message "Comparing files ... Done"))
+  (setq ediff-recurse-to-subdirectories nil)
   (ediff-update-meta-buffer (current-buffer) 'must-redraw))
 
 ;; mark files 1 and 2 as equal, if they are.
@@ -2356,12 +2360,11 @@
 (defun ediff-mark-if-equal (fileinfo1 fileinfo2)
   (let ((f1 (car fileinfo1))
 	(f2 (car fileinfo2)))
-    (cond ((file-directory-p f1) nil)
-	  ((file-directory-p f2) nil)
-	  ((ediff-same-file-contents f1 f2)
-	   (ediff-set-file-eqstatus fileinfo1 t)
-	   (ediff-set-file-eqstatus fileinfo2 t)
-	   t))
+    (if (and (stringp f1) (stringp f2) (ediff-same-contents f1 f2))
+	(progn
+	  (ediff-set-file-eqstatus fileinfo1 t)
+	  (ediff-set-file-eqstatus fileinfo2 t)
+	  ))
     ))
 
 
--- a/lisp/ediff.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/ediff.el	Wed Feb 23 09:18:23 2005 +0000
@@ -1,13 +1,13 @@
 ;;; ediff.el --- a comprehensive visual interface to diff & patch
 
-;; Copyright (C) 1994, 95, 96, 97, 98, 99, 2000, 01, 02, 03 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 95, 96, 97, 98, 99, 2000, 01, 02, 03, 05 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;; Created: February 2, 1994
 ;; Keywords: comparing, merging, patching, tools, unix
 
-(defconst ediff-version "2.78" "The current version of Ediff")
-(defconst ediff-date "May 18, 2003" "Date of last update")  
+(defconst ediff-version "2.80" "The current version of Ediff")
+(defconst ediff-date "February 19, 2005" "Date of last update")  
 
 
 ;; This file is part of GNU Emacs.
@@ -1080,8 +1080,11 @@
 
 (defsubst ediff-merge-on-startup ()
   (ediff-do-merge 0)
-  (ediff-with-current-buffer ediff-buffer-C
-    (set-buffer-modified-p nil)))
+  ;; Can't remember why this is here, but it may cause the automatically merged
+  ;; buffer to be lost. So, keep the buffer modified.
+  ;;(ediff-with-current-buffer ediff-buffer-C
+  ;;  (set-buffer-modified-p nil))
+  )
 
 ;;;###autoload
 (defun ediff-merge-files (file-A file-B
--- a/lisp/emulation/viper-cmd.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/emulation/viper-cmd.el	Wed Feb 23 09:18:23 2005 +0000
@@ -1063,7 +1063,7 @@
 
     ;; call the actual function to execute ESC (if no other symbols followed)
     ;; or the key bound to the ESC sequence (if the sequence was issued
-    ;; with very short delay between characters.
+    ;; with very short delay between characters).
     (if (eq cmd 'viper-intercept-ESC-key)
 	(setq cmd
 	      (cond ((eq viper-current-state 'vi-state)
@@ -1529,7 +1529,8 @@
   nil)
 
 (defun viper-exec-buffer-search (m-com com)
-  (setq viper-s-string (buffer-substring (point) viper-com-point))
+  (setq viper-s-string
+	(regexp-quote (buffer-substring (point) viper-com-point)))
   (setq viper-s-forward t)
   (setq viper-search-history (cons viper-s-string viper-search-history))
   (setq viper-intermediate-command 'viper-exec-buffer-search)
@@ -1982,6 +1983,16 @@
   (let ((hook (if viper-vi-style-in-minibuffer
 		  'viper-change-state-to-insert
 		'viper-change-state-to-emacs)))
+    ;; making buffer-local variables so that normal buffers won't affect the
+    ;; minibuffer and vice versa. Otherwise, command arguments will affect
+    ;; minibuffer ops and insertions from the minibuffer will change those in
+    ;; the normal buffers
+    (make-local-variable 'viper-d-com)
+    (make-local-variable 'viper-last-insertion)
+    (make-local-variable 'viper-command-ring)
+    (setq viper-d-com nil
+	  viper-last-insertion nil
+	  viper-command-ring nil)
     (funcall hook)
     ))
 
@@ -2707,7 +2718,7 @@
     (viper-backward-char-carefully)
     (if (looking-at "\n")
 	(viper-skip-all-separators-backward 'within-line)
-      (or (bobp) (forward-char)))))
+      (or (viper-looking-at-separator) (forward-char)))))
 
 
 (defun viper-forward-word-kernel (val)
@@ -3630,33 +3641,39 @@
 	   (setq msg "Search style remains unchanged")))
     (princ msg t)))
 
-(defun viper-set-searchstyle-toggling-macros (unset)
+(defun viper-set-searchstyle-toggling-macros (unset &optional major-mode)
   "Set the macros for toggling the search style in Viper's vi-state.
 The macro that toggles case sensitivity is bound to `//', and the one that
 toggles regexp search is bound to `///'.
-With a prefix argument, this function unsets the macros. "
+With a prefix argument, this function unsets the macros.
+If MAJOR-MODE is set, set the macros only in that major mode."
   (interactive "P")
-  (or noninteractive
-      (if (not unset)
-	  (progn
-	    ;; toggle case sensitivity in search
-	    (viper-record-kbd-macro
-	     "//" 'vi-state
-	     [1 (meta x) v i p e r - t o g g l e - s e a r c h - s t y l e return]
-	     't)
-	    ;; toggle regexp/vanila search
-	    (viper-record-kbd-macro
-	     "///" 'vi-state
-	     [2 (meta x) v i p e r - t o g g l e - s e a r c h - s t y l e return]
-	     't)
-	    (if (interactive-p)
-		(message
-		 "// and /// now toggle case-sensitivity and regexp search")))
-	(viper-unrecord-kbd-macro "//" 'vi-state)
-	(sit-for 2)
-	(viper-unrecord-kbd-macro "///" 'vi-state))))
-
-
+  (let (scope)
+    (if (and major-mode (symbolp major-mode))
+	(setq scope major-mode)
+      (setq scope 't))
+    (or noninteractive
+	(if (not unset)
+	    (progn
+	      ;; toggle case sensitivity in search
+	      (viper-record-kbd-macro
+	       "//" 'vi-state
+	       [1 (meta x) v i p e r - t o g g l e - s e a r c h - s t y l e return]
+	       scope)
+	      ;; toggle regexp/vanila search
+	      (viper-record-kbd-macro
+	       "///" 'vi-state
+	       [2 (meta x) v i p e r - t o g g l e - s e a r c h - s t y l e return]
+	       scope)
+	      (if (interactive-p)
+		  (message
+		   "// and /// now toggle case-sensitivity and regexp search")))
+	  (viper-unrecord-kbd-macro "//" 'vi-state)
+	  (sit-for 2)
+	  (viper-unrecord-kbd-macro "///" 'vi-state)))
+    ))
+  
+  
 (defun viper-set-parsing-style-toggling-macro (unset)
   "Set `%%%' to be a macro that toggles whether comment fields should be parsed for matching parentheses.
 This is used in conjunction with the `%' command.
@@ -4112,7 +4129,8 @@
   (interactive)
   (if (and viper-ex-style-editing (bolp))
       (beep 1)
-    (delete-backward-char 1 t)))
+    ;; don't put on kill ring
+    (delete-backward-char 1 nil)))
 
 
 (defun viper-del-backward-char-in-replace ()
@@ -4124,13 +4142,15 @@
   (interactive)
   (cond (viper-delete-backwards-in-replace
 	 (cond ((not (bolp))
-		(delete-backward-char 1 t))
+		;; don't put on kill ring
+		(delete-backward-char 1 nil))
 	       (viper-ex-style-editing
 		(beep 1))
 	       ((bobp)
 		(beep 1))
 	       (t
-		(delete-backward-char 1 t))))
+		;; don't put on kill ring
+		(delete-backward-char 1 nil))))
 	(viper-ex-style-editing
 	 (if (bolp)
 	     (beep 1)
--- a/lisp/emulation/viper-ex.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/emulation/viper-ex.el	Wed Feb 23 09:18:23 2005 +0000
@@ -1,6 +1,6 @@
 ;;; viper-ex.el --- functions implementing the Ex commands for Viper
 
-;; Copyright (C) 1994, 95, 96, 97, 98, 2000, 01, 02, 04 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 95, 96, 97, 98, 2000, 01, 02, 04, 05 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 
--- a/lisp/emulation/viper-init.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/emulation/viper-init.el	Wed Feb 23 09:18:23 2005 +0000
@@ -70,6 +70,16 @@
    window-system
    ))
 
+(defun viper-color-display-p ()
+  (condition-case nil
+      (viper-cond-compile-for-xemacs-or-emacs
+       (eq (device-class (selected-device)) 'color) ; xemacs form
+       (if (fboundp 'display-color-p) ; emacs form
+	   (display-color-p)
+	 (x-display-color-p))
+	)
+    (error nil)))
+
 ;; in XEmacs: device-type is tty on tty and stream in batch.
 (defun viper-window-display-p ()
   (and (viper-device-type) (not (memq (viper-device-type) '(tty stream pc)))))
@@ -97,6 +107,7 @@
 (defun viper-has-face-support-p ()
   (cond ((viper-window-display-p))
 	(viper-force-faces)
+	((viper-color-display-p))
 	(viper-emacs-p (memq (viper-device-type) '(pc)))
 	(viper-xemacs-p (memq (viper-device-type) '(tty pc)))))
 
--- a/lisp/emulation/viper-keym.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/emulation/viper-keym.el	Wed Feb 23 09:18:23 2005 +0000
@@ -455,6 +455,10 @@
 (define-key viper-dired-modifier-map ":" 'viper-ex)
 (define-key viper-dired-modifier-map "/" 'viper-search-forward)
 
+(defvar viper-gnus-modifier-map (make-sparse-keymap)
+  "This map modifies Gnus behavior.")
+(define-key viper-gnus-modifier-map ":" 'viper-ex)
+
 
 
 ;;; Code
--- a/lisp/emulation/viper-macs.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/emulation/viper-macs.el	Wed Feb 23 09:18:23 2005 +0000
@@ -329,6 +329,8 @@
 ;; Accepts as macro names: strings and vectors.
 ;; strings must be strings of characters; vectors must be vectors of keys
 ;; in canonic form.  The canonic form is essentially the form used in XEmacs
+;; More general definitions are inherited by more specific scopes:
+;; global->major mode->buffer. More specific definitions override more general
 (defun viper-record-kbd-macro (macro-name state macro-body &optional scope)
   "Record a Vi macro.  Can be used in `.viper' file to define permanent macros.
 MACRO-NAME is a string of characters or a vector of keys.  STATE is
@@ -451,22 +453,22 @@
 		       (list (list (cons scope nil)) nil (cons t nil))))))
     (setq old-elt (assoc macro-name (eval macro-alist-var)))
 
-      (if (null old-elt)
-	  (progn
-	    ;; insert new-elt in macro-alist-var and keep the list sorted
-	    (define-key
-	      keymap
-	      (vector (viper-key-to-emacs-key (aref macro-name 0)))
-	      'viper-exec-mapped-kbd-macro)
-	    (setq lis (eval macro-alist-var))
-	    (while (and lis (string< (viper-array-to-string (car (car lis)))
-				     (viper-array-to-string macro-name)))
-	      (setq lis2 (cons (car lis) lis2))
-	      (setq lis (cdr lis)))
-
-	    (setq lis2 (reverse lis2))
-	    (set macro-alist-var (append lis2 (cons new-elt lis)))
-	    (setq old-elt new-elt)))
+    (if (null old-elt)
+	(progn
+	  ;; insert new-elt in macro-alist-var and keep the list sorted
+	  (define-key
+	    keymap
+	    (vector (viper-key-to-emacs-key (aref macro-name 0)))
+	    'viper-exec-mapped-kbd-macro)
+	  (setq lis (eval macro-alist-var))
+	  (while (and lis (string< (viper-array-to-string (car (car lis)))
+				   (viper-array-to-string macro-name)))
+	    (setq lis2 (cons (car lis) lis2))
+	    (setq lis (cdr lis)))
+	  
+	  (setq lis2 (reverse lis2))
+	  (set macro-alist-var (append lis2 (cons new-elt lis)))
+	  (setq old-elt new-elt)))
     (setq old-sub-elt
 	  (cond ((eq scope t) (viper-kbd-global-pair old-elt))
 		((symbolp scope) (assoc scope (viper-kbd-mode-alist old-elt)))
@@ -484,6 +486,11 @@
 
 
 ;; macro name must be a vector of viper-style keys
+;; viper-unrecord-kbd-macro doesn't have scope. Macro definitions are inherited
+;; from global -> major mode -> buffer
+;; More specific definition overrides more general
+;; Can't unrecord definition for more specific, if a more general definition is
+;; in effect
 (defun viper-unrecord-kbd-macro (macro-name state)
   "Delete macro MACRO-NAME from Viper STATE.
 MACRO-NAME must be a vector of viper-style keys.  This command is used by Viper
@@ -546,7 +553,7 @@
 	   (setq macro-pair mode-mapping)
 	   (message "%S is unmapped for %s in %S"
 		    (viper-display-macro macro-name) state-name major-mode))
-	  ((cdr (setq macro-pair (viper-kbd-global-pair macro-entry)))
+	  ((cdr (setq macro-pair global-mapping))
 	   (message
 	    "Global mapping for %S in %s is removed"
 	    (viper-display-macro macro-name) state-name))
@@ -560,7 +567,7 @@
 	(progn
 	  (set macro-alist-var (delq macro-entry (eval macro-alist-var)))
 	  (if (viper-can-release-key (aref macro-name 0)
-				   (eval macro-alist-var))
+				     (eval macro-alist-var))
 	      (define-key
 		keymap
 		(vector (viper-key-to-emacs-key (aref macro-name 0)))
--- a/lisp/emulation/viper-util.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/emulation/viper-util.el	Wed Feb 23 09:18:23 2005 +0000
@@ -662,14 +662,8 @@
 
 
 ;; define remote file test
-(or (fboundp 'viper-file-remote-p) ; user supplied his own function: use it
-    (defun viper-file-remote-p (file-name)
-      (car (cond ((featurep 'efs-auto) (efs-ftp-path file-name))
-		 ((fboundp 'file-remote-p) (file-remote-p file-name))
-		 (t (require 'ange-ftp)
-		    ;; Can happen only in Emacs, since XEmacs has file-remote-p
-		    (ange-ftp-ftp-name file-name))))))
-
+(defun viper-file-remote-p (file-name)
+  (file-remote-p file-name))
 
 
 ;; This is a simple-minded check for whether a file is under version control.
--- a/lisp/emulation/viper.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/emulation/viper.el	Wed Feb 23 09:18:23 2005 +0000
@@ -3,12 +3,12 @@
 ;;		 and a venomous VI PERil.
 ;;		 Viper Is also a Package for Emacs Rebels.
 
-;; Copyright (C) 1994, 95, 96, 97, 98, 99, 2000, 01, 02 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 95, 96, 97, 98, 99, 2000, 01, 02, 05 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;; Keywords: emulations
 
-(defconst viper-version "3.11.2 of January 4, 2002"
+(defconst viper-version "3.11.4 of February 19, 2005"
   "The current version of Viper")
 
 ;; This file is part of GNU Emacs.
@@ -466,7 +466,7 @@
 	     (nth 0 triple) (nth 1 triple) (eval (nth 2 triple))))
 	  viper-major-mode-modifier-list))
 
-;; We change standard bindings in some major mode, making them slightly
+;; We change standard bindings in some major modes, making them slightly
 ;; different than in "normal" vi/insert/emacs states
 (defcustom viper-major-mode-modifier-list
   '((help-mode emacs-state viper-slash-and-colon-map)
@@ -482,8 +482,8 @@
     (dired-mode emacs-state viper-dired-modifier-map)
     (tar-mode emacs-state viper-slash-and-colon-map)
     (mh-folder-mode emacs-state viper-slash-and-colon-map)
-    (gnus-group-mode emacs-state viper-slash-and-colon-map)
-    (gnus-summary-mode emacs-state viper-slash-and-colon-map)
+    (gnus-group-mode emacs-state viper-gnus-modifier-map)
+    (gnus-summary-mode emacs-state viper-gnus-modifier-map)
     (Info-mode emacs-state viper-slash-and-colon-map)
     (Buffer-menu-mode emacs-state viper-slash-and-colon-map)
     )
--- a/lisp/faces.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/faces.el	Wed Feb 23 09:18:23 2005 +0000
@@ -1881,6 +1881,9 @@
 
 
 (defface minibuffer-prompt '((((background dark)) :foreground "cyan")
+			     ;; Don't use blue because many users of
+			     ;; the MS-DOS port customize their
+			     ;; foreground color to be blue.
 			     (((type pc)) :foreground "magenta")
 			     (t :foreground "dark blue"))
   "Face for minibuffer prompts."
@@ -2048,6 +2051,8 @@
   :group 'basic-faces)
 
 (defface escape-glyph '((((background dark)) :foreground "cyan")
+			;; See the comment in minibuffer-prompt for
+			;; the reason not to use blue on MS-DOS.
 			(((type pc)) :foreground "magenta")
 			(t :foreground "blue"))
   "Face for characters displayed as ^-sequences or \-sequences."
--- a/lisp/frame.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/frame.el	Wed Feb 23 09:18:23 2005 +0000
@@ -1,6 +1,6 @@
 ;;; frame.el --- multi-frame management independent of window systems
 
-;; Copyright (C) 1993, 1994, 1996, 1997, 2000, 2001, 2003, 2004
+;; Copyright (C) 1993, 1994, 1996, 1997, 2000, 2001, 2003, 2004, 2005
 ;;   Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
@@ -1256,35 +1256,11 @@
 This timer calls `blink-cursor-timer-function' every
 `blink-cursor-interval' seconds.")
 
-;; The strange sequence below is meant to set both the right temporary
-;; value and the right "standard expression" , according to Custom,
-;; for blink-cursor-mode.  We do not know the standard _evaluated_
-;; value yet, because the standard expression uses values that are not
-;; yet set.  Evaluating it now would yield an error, but we make sure
-;; that it is not evaluated, by ensuring that blink-cursor-mode is set
-;; before the defcustom is evaluated and by using the right :initialize
-;; function.  The correct evaluated standard value will be installed
-;; in startup.el using exactly the same expression as in the defcustom.
-(defvar blink-cursor-mode)
-(unless (boundp 'blink-cursor-mode) (setq blink-cursor-mode nil))
-(defcustom blink-cursor-mode
-  (not (or noninteractive
-	   emacs-quick-startup
-	   (eq system-type 'ms-dos)
-	   (not (memq window-system '(x w32)))))
-  "*Non-nil means Blinking Cursor mode is active."
-  :group 'cursor
-  :tag "Blinking cursor"
-  :type 'boolean
-  :initialize 'custom-initialize-set
-  :set #'(lambda (symbol value)
-	   (set-default symbol value)
-	   (blink-cursor-mode (or value 0))))
-
-(defvaralias 'blink-cursor 'blink-cursor-mode)
-(make-obsolete-variable 'blink-cursor 'blink-cursor-mode "22.1")
-
-(defun blink-cursor-mode (arg)
+;; We do not know the standard _evaluated_ value yet, because the standard
+;; expression uses values that are not yet set.  The correct evaluated
+;; standard value will be installed in startup.el using exactly the same
+;; expression as in the defcustom.
+(define-minor-mode blink-cursor-mode
   "Toggle blinking cursor mode.
 With a numeric argument, turn blinking cursor mode on iff ARG is positive.
 When blinking cursor mode is enabled, the cursor of the selected
@@ -1293,27 +1269,27 @@
 Note that this command is effective only when Emacs
 displays through a window system, because then Emacs does its own
 cursor display.  On a text-only terminal, this is not implemented."
-  (interactive "P")
-  (let ((on-p (if (null arg)
-		  (not blink-cursor-mode)
-		(> (prefix-numeric-value arg) 0))))
-    (if blink-cursor-idle-timer
-	(cancel-timer blink-cursor-idle-timer))
-    (if blink-cursor-timer
-	(cancel-timer blink-cursor-timer))
-    (setq blink-cursor-idle-timer nil
-	  blink-cursor-timer nil
-	  blink-cursor-mode nil)
-    (if on-p
-	(progn
-	  ;; Hide the cursor.
-	  ;(internal-show-cursor nil nil)
-	  (setq blink-cursor-idle-timer
-		(run-with-idle-timer blink-cursor-delay
-				     blink-cursor-delay
-				     'blink-cursor-start))
-	  (setq blink-cursor-mode t))
-      (internal-show-cursor nil t))))
+  :init-value (not (or noninteractive
+		       emacs-quick-startup
+		       (eq system-type 'ms-dos)
+		       (not (memq window-system '(x w32)))))
+  :global t
+  (if blink-cursor-idle-timer (cancel-timer blink-cursor-idle-timer))
+  (if blink-cursor-timer (cancel-timer blink-cursor-timer))
+  (setq blink-cursor-idle-timer nil
+	blink-cursor-timer nil)
+  (if blink-cursor-mode
+      (progn
+	;; Hide the cursor.
+	;;(internal-show-cursor nil nil)
+	(setq blink-cursor-idle-timer
+	      (run-with-idle-timer blink-cursor-delay
+				   blink-cursor-delay
+				   'blink-cursor-start)))
+    (internal-show-cursor nil t)))
+
+(defvaralias 'blink-cursor 'blink-cursor-mode)
+(make-obsolete-variable 'blink-cursor 'blink-cursor-mode "22.1")
 
 (defun blink-cursor-start ()
   "Timer function called from the timer `blink-cursor-idle-timer'.
@@ -1379,5 +1355,5 @@
 
 (provide 'frame)
 
-;;; arch-tag: 82979c70-b8f2-4306-b2ad-ddbd6b328b56
+;; arch-tag: 82979c70-b8f2-4306-b2ad-ddbd6b328b56
 ;;; frame.el ends here
--- a/lisp/gnus/ChangeLog	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/gnus/ChangeLog	Wed Feb 23 09:18:23 2005 +0000
@@ -1,3 +1,40 @@
+2005-02-21  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* gnus-art.el (gnus-parse-news-url, gnus-button-handle-news):
+	Handle news URL with given port correctly.
+
+2005-02-19  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus-msg.el (gnus-copy-article-buffer): Quote decoded words
+	containing special characters.
+
+	* gnus-sum.el (gnus-summary-edit-article): Ditto.
+
+	* mml.el (mime-to-mml): Ditto.
+
+	* rfc2047.el (rfc2047-encode-parameter): Use ietf-drums-tspecials.
+	(rfc2047-quote-decoded-words-containing-tspecials): New variable.
+	(rfc2047-decode-region): Quote decoded words containing special
+	characters when rfc2047-quote-decoded-words-containing-tspecials
+	is non-nil.
+
+2005-02-16  Teodor Zlatanov  <tzz@lifelogs.com>
+
+	* gnus-registry.el (gnus-registry-delete-group): minor bug fix
+
+	* gnus.el (gnus-install-group-spam-parameters): Doc fix.
+
+2005-02-15  Simon Josefsson  <jas@extundo.com>
+
+	* nnimap.el (nnimap-debug): Doc fix.
+
+	* imap.el (imap-debug): Doc fix.
+
+2005-02-14  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* gnus-group.el (gnus-group-make-doc-group): Mention prefix
+	argument in doc string.  Make query for type more clear.
+
 2005-02-13  Reiner Steib  <Reiner.Steib@gmx.de>
 
 	* gnus.el (gnus-group-startup-message): Search for gnus images in
--- a/lisp/gnus/gnus-art.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/gnus/gnus-art.el	Wed Feb 23 09:18:23 2005 +0000
@@ -6648,15 +6648,18 @@
 		      (cons fun args)))))))
 
 (defun gnus-parse-news-url (url)
-  (let (scheme server group message-id articles)
+  (let (scheme server port group message-id articles)
     (with-temp-buffer
       (insert url)
       (goto-char (point-min))
       (when (looking-at "\\([A-Za-z]+\\):")
 	(setq scheme (match-string 1))
 	(goto-char (match-end 0)))
-      (when (looking-at "//\\([^/]+\\)/")
+      (when (looking-at "//\\([^:/]+\\)\\(:?\\)\\([0-9]+\\)?/")
 	(setq server (match-string 1))
+	(setq port (if (stringp (match-string 3))
+		       (string-to-number (match-string 3))
+		     (match-string 3)))
 	(goto-char (match-end 0)))
 
       (cond
@@ -6669,18 +6672,19 @@
 	(setq group (match-string 1)))
        (t
 	(error "Unknown news URL syntax"))))
-    (list scheme server group message-id articles)))
+    (list scheme server port group message-id articles)))
 
 (defun gnus-button-handle-news (url)
   "Fetch a news URL."
-  (destructuring-bind (scheme server group message-id articles)
+  (destructuring-bind (scheme server port group message-id articles)
       (gnus-parse-news-url url)
     (cond
      (message-id
       (save-excursion
 	(set-buffer gnus-summary-buffer)
 	(if server
-	    (let ((gnus-refer-article-method (list (list 'nntp server))))
+	    (let ((gnus-refer-article-method (list (list 'nntp server)))
+		  (nntp-port-number (or port "nntp")))
 	      (gnus-summary-refer-article message-id))
 	  (gnus-summary-refer-article message-id))))
      (group
--- a/lisp/gnus/gnus-group.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/gnus/gnus-group.el	Wed Feb 23 09:18:23 2005 +0000
@@ -2502,7 +2502,9 @@
   (gnus-group-position-point))
 
 (defun gnus-group-make-doc-group (file type)
-  "Create a group that uses a single file as the source."
+  "Create a group that uses a single file as the source.
+
+If called with a prefix argument, ask for the file type."
   (interactive
    (list (read-file-name "File name: ")
 	 (and current-prefix-arg 'ask)))
@@ -2511,7 +2513,7 @@
 	  char found)
       (while (not found)
 	(message
-	 "%sFile type (mbox, babyl, digest, forward, mmdf, guess) [mbdfag]: "
+	 "%sFile type (mbox, babyl, digest, forward, mmdf, guess) [m, b, d, f, a, g]: "
 	 err)
 	(setq found (cond ((= (setq char (read-char)) ?m) 'mbox)
 			  ((= char ?b) 'babyl)
--- a/lisp/gnus/gnus-msg.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/gnus/gnus-msg.el	Wed Feb 23 09:18:23 2005 +0000
@@ -876,7 +876,8 @@
 	    ;; Decode charsets.
 	    (let ((gnus-article-decode-hook
 		   (delq 'article-decode-charset
-			 (copy-sequence gnus-article-decode-hook))))
+			 (copy-sequence gnus-article-decode-hook)))
+		  (rfc2047-quote-decoded-words-containing-tspecials t))
 	      (run-hooks 'gnus-article-decode-hook)))))
       gnus-article-copy)))
 
--- a/lisp/gnus/gnus-registry.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/gnus/gnus-registry.el	Wed Feb 23 09:18:23 2005 +0000
@@ -606,7 +606,9 @@
       (when gnus-registry-trim-articles-without-groups
 	(unless (gnus-registry-group-count id)
 	  (gnus-registry-delete-id id)))
-      (gnus-registry-store-extra-entry id 'mtime (current-time)))))
+      ;; is this ID still in the registry?
+      (when (gethash id gnus-registry-hashtb)
+	(gnus-registry-store-extra-entry id 'mtime (current-time))))))
 
 (defun gnus-registry-delete-id (id)
   "Delete a message ID from the registry."
--- a/lisp/gnus/gnus-sum.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/gnus/gnus-sum.el	Wed Feb 23 09:18:23 2005 +0000
@@ -9485,7 +9485,8 @@
 	   `(lambda ()
 	      (let ((mbl mml-buffer-list))
 		(setq mml-buffer-list nil)
-		(mime-to-mml ,'current-handles)
+		(let ((rfc2047-quote-decoded-words-containing-tspecials t))
+		  (mime-to-mml ,'current-handles))
 		(let ((mbl1 mml-buffer-list))
 		  (setq mml-buffer-list mbl)
 		  (set (make-local-variable 'mml-buffer-list) mbl1))
--- a/lisp/gnus/gnus.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/gnus/gnus.el	Wed Feb 23 09:18:23 2005 +0000
@@ -1819,11 +1819,12 @@
    :variable gnus-spam-newsgroup-contents
    :variable-default nil
    :variable-document
-   "*Groups in which to automatically mark new articles as spam on
-summary entry.  If non-nil, this should be a list of group name
-regexps that should match all groups in which to do automatic spam
-tagging, associated with a classification (spam, ham, or neither).
-This only makes sense for mail groups."
+   "*Group classification (spam, ham, or neither).  Only
+meaningful when spam.el is loaded.  If non-nil, this should be a
+list of group name regexps associated with a classification for
+each one.  In spam groups, new articles are marked as spam on
+summary entry.  There is other behavior associated with ham and
+no classification when spam.el is loaded - see the manual."
    :variable-group spam
    :variable-type '(repeat
 		    (list :tag "Group contents spam/ham classification"
@@ -1840,7 +1841,9 @@
 				  (const :tag "Unclassified" nil)))
    :parameter-document
    "The spam classification (spam, ham, or neither) of this group.
-When a spam group is entered, all unread articles are marked as spam.")
+When a spam group is entered, all unread articles are marked as
+spam.  There is other behavior associated with ham and no
+classification when spam.el is loaded - see the manual.")
 
   (defvar gnus-group-spam-exit-processor-ifile "ifile"
     "OBSOLETE: The ifile summary exit spam processor.")
--- a/lisp/gnus/imap.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/gnus/imap.el	Wed Feb 23 09:18:23 2005 +0000
@@ -250,7 +250,11 @@
   :type 'boolean)
 
 (defcustom imap-debug nil
-  "If non-nil, random debug spews are placed in *imap-debug* buffer."
+  "If non-nil, random debug spews are placed in *imap-debug* buffer.
+Note that username, passwords and other privacy sensitive
+information (such as e-mail) may be stored in the *imap-debug*
+buffer.  It is not written to disk, however.  Do not enable this
+variable unless you are comfortable with that."
   :group 'imap
   :type 'boolean)
 
--- a/lisp/gnus/mml.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/gnus/mml.el	Wed Feb 23 09:18:23 2005 +0000
@@ -709,7 +709,8 @@
   ;; First decode the head.
   (save-restriction
     (message-narrow-to-head)
-    (mail-decode-encoded-word-region (point-min) (point-max)))
+    (let ((rfc2047-quote-decoded-words-containing-tspecials t))
+      (mail-decode-encoded-word-region (point-min) (point-max))))
   (unless handles
     (setq handles (mm-dissect-buffer t)))
   (goto-char (point-min))
--- a/lisp/gnus/nnimap.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/gnus/nnimap.el	Wed Feb 23 09:18:23 2005 +0000
@@ -1,5 +1,5 @@
 ;;; nnimap.el --- imap backend for Gnus
-;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
+;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
 ;;        Free Software Foundation, Inc.
 
 ;; Author: Simon Josefsson <jas@pdc.kth.se>
@@ -409,7 +409,11 @@
 restrict visible folders.")
 
 (defcustom nnimap-debug nil
-  "If non-nil, random debug spews are placed in *nnimap-debug* buffer."
+  "If non-nil, random debug spews are placed in *nnimap-debug* buffer.
+Note that username, passwords and other privacy sensitive
+information (such as e-mail) may be stored in the *nnimap-debug*
+buffer.  It is not written to disk, however.  Do not enable this
+variable unless you are comfortable with that."
   :group 'nnimap
   :type 'boolean)
 
--- a/lisp/gnus/rfc2047.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/gnus/rfc2047.el	Wed Feb 23 09:18:23 2005 +0000
@@ -1,5 +1,7 @@
 ;;; rfc2047.el --- functions for encoding and decoding rfc2047 messages
-;; Copyright (C) 1998, 1999, 2000, 2002, 2003, 2005 Free Software Foundation, Inc.
+
+;; Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004, 2005
+;;        Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;;	MORIOKA Tomohiko <morioka@jaist.ac.jp>
@@ -50,6 +52,7 @@
 
 (require 'qp)
 (require 'mm-util)
+(require 'ietf-drums)
 ;; Fixme: Avoid this (used for mail-parse-charset) mm dependence on gnus.
 (require 'mail-prsvr)
 (require 'base64)
@@ -639,6 +642,9 @@
     "=\\?\\([^][\000-\040()<>@,\;:\\\"/?.=]+\\)\\?\\(B\\|Q\\)\
 \\?\\([!->@-~ +]*\\)\\?="))
 
+(defvar rfc2047-quote-decoded-words-containing-tspecials nil
+  "If non-nil, quote decoded words containing special characters.")
+
 ;; Fixme: This should decode in place, not cons intermediate strings.
 ;; Also check whether it needs to worry about delimiting fields like
 ;; encoding.
@@ -673,14 +679,66 @@
 	  (insert (rfc2047-parse-and-decode
 		   (prog1
 		       (match-string 0)
-		     (delete-region (match-beginning 0) (match-end 0)))))
-	  ;; Remove newlines between decoded words, though such things
-	  ;; essentially must not be there.
+		     (delete-region e (match-end 0)))))
+	  (while (looking-at rfc2047-encoded-word-regexp)
+	    (insert (rfc2047-parse-and-decode
+		     (prog1
+			 (match-string 0)
+		       (delete-region (point) (match-end 0))))))
 	  (save-restriction
 	    (narrow-to-region e (point))
 	    (goto-char e)
+	    ;; Remove newlines between decoded words, though such
+	    ;; things essentially must not be there.
 	    (while (re-search-forward "[\n\r]+" nil t)
 	      (replace-match " "))
+	    ;; Quote decoded words if there are special characters
+	    ;; which might violate RFC2822.
+	    (when (and rfc2047-quote-decoded-words-containing-tspecials
+		       (let ((regexp (car (rassq
+					   'address-mime
+					   rfc2047-header-encoding-alist))))
+			 (when regexp
+			   (save-restriction
+			     (widen)
+			     (beginning-of-line)
+			     (while (and (memq (char-after) '(?  ?\t))
+					 (zerop (forward-line -1))))
+			     (looking-at regexp)))))
+	      (let (quoted)
+		(goto-char e)
+		(skip-chars-forward " \t")
+		(setq start (point))
+		(setq quoted (eq (char-after) ?\"))
+		(goto-char (point-max))
+		(skip-chars-backward " \t")
+		(if (setq quoted (and quoted
+				      (> (point) (1+ start))
+				      (eq (char-before) ?\")))
+		    (progn
+		      (backward-char)
+		      (setq start (1+ start)
+			    end (point-marker)))
+		  (setq end (point-marker)))
+		(goto-char start)
+		(while (search-forward "\"" end t)
+		  (when (prog2
+			    (backward-char)
+			    (zerop (% (skip-chars-backward "\\\\") 2))
+			  (goto-char (match-beginning 0)))
+		    (insert "\\"))
+		  (forward-char))
+		(when (and (not quoted)
+			   (progn
+			     (goto-char start)
+			     (re-search-forward
+			      (concat "[" ietf-drums-tspecials "]")
+			      end t)))
+		  (goto-char start)
+		  (insert "\"")
+		  (goto-char end)
+		  (insert "\""))
+		(set-marker end nil)))
 	    (goto-char (point-max)))
 	  (when (and (mm-multibyte-p)
 		     mail-parse-charset
--- a/lisp/isearch.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/isearch.el	Wed Feb 23 09:18:23 2005 +0000
@@ -533,6 +533,11 @@
 \\[isearch-abort] when search is successful aborts and moves point to\
  starting point.
 
+Type \\[isearch-query-replace] to start `query-replace' with string to\
+replace from  last search string.
+Type \\[isearch-query-replace-regexp] to start `query-replace-regexp'\
+with string to replace from last search string..
+
 Type \\[isearch-toggle-case-fold] to toggle search case-sensitivity.
 Type \\[isearch-toggle-regexp] to toggle regular-expression mode.
 Type \\[isearch-edit-string] to edit the search string in the minibuffer.
--- a/lisp/log-view.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/log-view.el	Wed Feb 23 09:18:23 2005 +0000
@@ -1,6 +1,6 @@
 ;;; log-view.el --- Major mode for browsing RCS/CVS/SCCS log output
 
-;; Copyright (C) 1999, 2000, 2001  Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2000, 2001, 2005  Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@cs.yale.edu>
 ;; Keywords: rcs sccs cvs log version-control
@@ -85,7 +85,7 @@
 	  "\\|SCCS/s\\.\\(.+\\):"
 	  "\\)\n"))
 ;; In RCS, a locked revision will look like "revision N.M\tlocked by: FOO".
-(defconst log-view-message-re "^\\(revision \\([.0-9]+\\)\\(?:\t.*\\)?\\|rev \\([0-9]+\\):  .*\\|D \\([.0-9]+\\) .*\\)$")
+(defconst log-view-message-re "^\\(revision \\([.0-9]+\\)\\(?:\t.*\\)?\\|r\\([0-9]+\\) | .* | .*\\|D \\([.0-9]+\\) .*\\)$")
 
 (defconst log-view-font-lock-keywords
   `((,log-view-file-re
@@ -206,5 +206,5 @@
 
 (provide 'log-view)
 
-;;; arch-tag: 0d64220b-ce7e-4f62-9c2a-6b04c2f81f4f
+;; arch-tag: 0d64220b-ce7e-4f62-9c2a-6b04c2f81f4f
 ;;; log-view.el ends here
--- a/lisp/mouse.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/mouse.el	Wed Feb 23 09:18:23 2005 +0000
@@ -769,6 +769,8 @@
 
 (defun mouse-on-link-p (pos)
   "Return non-nil if POS is on a link in the current buffer.
+POS must be a buffer position in the current buffer or an mouse
+event location in the selected window, see `event-start'.
 
 A clickable link is identified by one of the following methods:
 
@@ -787,7 +789,7 @@
 
 - If the value is a function, FUNC, POS is inside a link if
 the call \(FUNC POS) returns non-nil.  Return the return value
-from that call.
+from that call.  Arg is \(posn-point POS) if POS is a mouse event,
 
 - Otherwise, return the value itself.
 
@@ -803,17 +805,22 @@
 
 - Otherwise, the mouse-1 event is translated into a mouse-2 event
 at the same position."
-  (let ((action
-	 (or (get-char-property pos 'follow-link)
-	     (save-excursion
-	       (goto-char pos)
-	       (key-binding [follow-link] nil t)))))
-    (cond
-     ((eq action 'mouse-face)
-      (and (get-char-property pos 'mouse-face) t))
-     ((functionp action)
-      (funcall action pos))
-     (t action))))
+  (if (consp pos)
+      (setq pos (and (eq (selected-window) (posn-window pos))
+		     (posn-point pos))))
+  (when pos
+    (let ((action
+	   (or (get-char-property pos 'follow-link)
+	       (save-excursion
+		 (goto-char pos)
+		 (key-binding [follow-link] nil t)))))
+      (cond
+       ((eq action 'mouse-face)
+	(and (get-char-property pos 'mouse-face) t))
+       ((functionp action)
+	(funcall action pos))
+       (t action)))))
+
 
 (defun mouse-drag-region-1 (start-event)
   (mouse-minibuffer-check start-event)
@@ -831,7 +838,9 @@
 		     (nth 3 bounds)
 		   ;; Don't count the mode line.
 		   (1- (nth 3 bounds))))
-	 on-link remap-double-click
+	 (on-link (and mouse-1-click-follows-link
+		       (eq start-window (selected-window))))
+	 remap-double-click
 	 (click-count (1- (event-click-count start-event))))
     (setq mouse-selection-click-count click-count)
     (setq mouse-selection-click-count-buffer (current-buffer))
@@ -841,7 +850,7 @@
     (if (< (point) start-point)
 	(goto-char start-point))
     (setq start-point (point))
-    (setq on-link (and mouse-1-click-follows-link
+    (setq on-link (and on-link
 		       (mouse-on-link-p start-point)))
     (setq remap-double-click (and on-link
 				  (eq mouse-1-click-follows-link 'double)
--- a/lisp/net/browse-url.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/net/browse-url.el	Wed Feb 23 09:18:23 2005 +0000
@@ -1,6 +1,6 @@
 ;;; browse-url.el --- pass a URL to a WWW browser
 
-;; Copyright (C) 1995, 96, 97, 98, 99, 2000, 2001, 2004
+;; Copyright (C) 1995, 96, 97, 98, 99, 2000, 2001, 2004, 2005
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Denis Howe <dbh@doc.ic.ac.uk>
@@ -387,6 +387,14 @@
   :type 'boolean
   :group 'browse-url)
 
+(defcustom browse-url-netscape-new-window-is-tab nil
+  "*Whether to open up new windows in a tab or a new window.
+If non-nil, then open the URL in a new tab rather than a new
+window if `browse-url-netscape' is asked to open it in a new
+window."
+  :type 'boolean
+  :group 'browse-url)
+
 (defcustom browse-url-new-window-flag nil
   "*If non-nil, always open a new browser window with appropriate browsers.
 Passing an interactive argument to \\[browse-url], or specific browser
@@ -834,6 +842,10 @@
 random existing one.  A non-nil interactive prefix argument reverses
 the effect of `browse-url-new-window-flag'.
 
+If `browse-url-netscape-new-window-is-tab' is non-nil, then
+whenever a document would otherwise be loaded in a new window, it
+is loaded in a new tab in an existing window instead.
+
 When called non-interactively, optional second argument NEW-WINDOW is
 used instead of `browse-url-new-window-flag'."
   (interactive (browse-url-interactive-arg "URL: "))
@@ -843,21 +855,24 @@
     (setq url (replace-match
 	       (format "%%%x" (string-to-char (match-string 0 url))) t t url)))
   (let* ((process-environment (browse-url-process-environment))
-         (process (apply 'start-process
-			 (concat "netscape " url) nil
-			 browse-url-netscape-program
-			 (append
-			  browse-url-netscape-arguments
-			  (if (eq window-system 'w32)
-			      (list url)
-			    (append
-			     (if new-window '("-noraise"))
-			     (list "-remote"
-				   (concat "openURL(" url
-					   (if (browse-url-maybe-new-window
-						new-window)
-					       ",new-window")
-					   ")"))))))))
+	 (process
+	  (apply 'start-process
+		 (concat "netscape " url) nil
+		 browse-url-netscape-program
+		 (append
+		  browse-url-netscape-arguments
+		  (if (eq window-system 'w32)
+		      (list url)
+		    (append
+		     (if new-window '("-noraise"))
+		     (list "-remote"
+			   (concat "openURL(" url
+				   (if (browse-url-maybe-new-window
+					new-window)
+				       (if browse-url-netscape-new-window-is-tab
+					   ",new-tab"
+					 ",new-window"))
+				   ")"))))))))
     (set-process-sentinel process
 			  `(lambda (process change)
 			     (browse-url-netscape-sentinel process ,url)))))
--- a/lisp/net/tramp.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/net/tramp.el	Wed Feb 23 09:18:23 2005 +0000
@@ -4105,7 +4105,7 @@
      (if (bufferp (nth 0 args)) (nth 0 args) (current-buffer))))
    ; COMMAND
    ((member operation
-	    (list 'dired-call-process-command
+	    (list 'dired-call-process
                   ; Emacs only
 		  'shell
                   ; Post Emacs 21.3 only
--- a/lisp/pcvs.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/pcvs.el	Wed Feb 23 09:18:23 2005 +0000
@@ -1,7 +1,7 @@
 ;;; pcvs.el --- a front-end to CVS
 
 ;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-;;   2000, 2002, 2003, 2004  Free Software Foundation, Inc.
+;;   2000, 2002, 2003, 2004, 2005  Free Software Foundation, Inc.
 
 ;; Author: (The PCL-CVS Trust) pcl-cvs@cyclic.com
 ;;	(Per Cederqvist) ceder@lysator.liu.se
@@ -1687,8 +1687,7 @@
 	  (message "Retrieving revision %s..." rev)
 	  ;; Discard stderr output to work around the CVS+SSH+libc
 	  ;; problem when stdout and stderr are the same.
-	  ;; FIXME: this doesn't seem to make any difference :-(
-	  (let ((res (apply 'call-process cvs-program nil '(t . nil) nil
+	  (let ((res (apply 'call-process cvs-program nil '(t nil) nil
 			    "-q" "update" "-p"
 			    ;; If `rev' is HEAD, don't pass it at all:
 			    ;; the default behavior is to get the head
--- a/lisp/progmodes/gdb-ui.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/progmodes/gdb-ui.el	Wed Feb 23 09:18:23 2005 +0000
@@ -338,7 +338,6 @@
 			 (match-string 3)
 			 nil nil)))
 	  (push var gdb-var-list)
-	  (setq speedbar-update-flag t)
 	  (speedbar 1)
 	  (if (equal (nth 2 var) "0")
 	      (gdb-enqueue-input
@@ -433,7 +432,18 @@
 		     `(lambda () (gdb-var-evaluate-expression-handler
 				  ,varnum t)))))))
   (setq gdb-pending-triggers
-   (delq 'gdb-var-update gdb-pending-triggers)))
+   (delq 'gdb-var-update gdb-pending-triggers))
+  (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame))
+    ;; dummy command to update speedbar at right time
+    (gdb-enqueue-input (list "server pwd\n" 'gdb-speedbar-timer-fn))
+    ;; keep gdb-pending-triggers non-nil till end
+    (push 'gdb-speedbar-timer gdb-pending-triggers)))
+
+(defun gdb-speedbar-timer-fn ()
+  (setq gdb-pending-triggers
+	(delq 'gdb-speedbar-timer gdb-pending-triggers))
+  (with-current-buffer gud-comint-buffer
+    (speedbar-timer-fn)))
 
 (defun gdb-var-delete ()
   "Delete watched expression from the speedbar."
@@ -882,12 +892,12 @@
 	(gdb-invalidate-threads)
 	(unless (eq system-type 'darwin) ;Breaks on Darwin's GDB-5.3.
 	  ;; FIXME: with GDB-6 on Darwin, this might very well work.
-	  (dolist (frame (frame-list))
-	    (when (string-equal (frame-parameter frame 'name) "Speedbar")
-	      (setq gdb-var-changed t)    ; force update
-	      (dolist (var gdb-var-list)
-		(setcar (nthcdr 5 var) nil))))
-	  (gdb-var-update))))
+	  ;; only needed/used with speedbar/watch expressions
+	  (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame))
+	    (setq gdb-var-changed t)    ; force update
+	    (dolist (var gdb-var-list)
+	      (setcar (nthcdr 5 var) nil))
+	    (gdb-var-update)))))
   (let ((sink gdb-output-sink))
     (cond
      ((eq sink 'user) t)
--- a/lisp/progmodes/hideif.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/progmodes/hideif.el	Wed Feb 23 09:18:23 2005 +0000
@@ -958,7 +958,10 @@
 
 (defun hide-ifdef-use-define-alist (name)
   "Set `hide-ifdef-env' to the define list specified by NAME."
-  (interactive "SUse define list: ")
+  (interactive
+   (list (completing-read "Use define list: "
+			  hide-ifdef-define-alist nil t)))
+  (if (stringp name) (setq name (intern name)))
   (let ((define-list (assoc name hide-ifdef-define-alist)))
     (if define-list
 	(setq hide-ifdef-env
--- a/lisp/progmodes/meta-mode.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/progmodes/meta-mode.el	Wed Feb 23 09:18:23 2005 +0000
@@ -898,7 +898,7 @@
 ;; Compatibility: XEmacs doesn't have the  `mark-active' variable.
 (defun meta-mark-active ()
   "Return whether the mark and region are currently active in this buffer."
-  (or (and (boundp 'mark-active) mark-active) (mark)))
+  (if (boundp 'mark-active) mark-active (mark)))
 
 
 
--- a/lisp/progmodes/scheme.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/progmodes/scheme.el	Wed Feb 23 09:18:23 2005 +0000
@@ -330,6 +330,10 @@
 	       "map" "syntax" "syntax-rules") t)
 	"\\>") 1)
       ;;
+      ;; It wouldn't be Scheme w/o named-let.
+      '("(let\\s-+\\(\\sw+\\)"
+        (1 font-lock-function-name-face))
+      ;;
       ;; David Fox <fox@graphics.cs.nyu.edu> for SOS/STklos class specifiers.
       '("\\<<\\sw+>\\>" . font-lock-type-face)
       ;;
--- a/lisp/ps-print.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/ps-print.el	Wed Feb 23 09:18:23 2005 +0000
@@ -986,7 +986,7 @@
 ;;      (my-mixed-family
 ;;       (fonts (normal               . "Courier-Bold")
 ;;              (bold                 . "Helvetica")
-;;              (italic               . "Zapf-Chancery-MediumItalic")
+;;              (italic               . "ZapfChancery-MediumItalic")
 ;;              (bold-italic          . "NewCenturySchlbk-BoldItalic")
 ;;              (w3-table-hack-x-face . "LineDrawNormal"))
 ;;       (size . 10.0)
@@ -1010,7 +1010,7 @@
 ;;       (fonts (w3-table-hack-x-face . "LineDrawNormal")
 ;;              (bold                 . "Helvetica")
 ;;              (bold-italic          . "NewCenturySchlbk-BoldItalic")
-;;              (italic               . "Zapf-Chancery-MediumItalic")
+;;              (italic               . "ZapfChancery-MediumItalic")
 ;;              (normal               . "Courier-Bold"))
 ;;       (avg-char-width . 6.0)
 ;;       (space-width . 6.0)
@@ -2820,8 +2820,16 @@
      (line-height . 9.63)
      (space-width . 2.78)
      (avg-char-width . 2.78))
+    (ZapfChancery-MediumItalic
+     (fonts (normal . "ZapfChancery-MediumItalic"))
+     (size . 10.0)
+     (line-height . 11.45)
+     (space-width . 2.2)
+     (avg-char-width . 4.10811))
+    ;; We keep this wrong entry name (but with correct font name) for
+    ;; backward compatibility.
     (Zapf-Chancery-MediumItalic
-     (fonts (normal . "Zapf-Chancery-MediumItalic"))
+     (fonts (normal . "ZapfChancery-MediumItalic"))
      (size . 10.0)
      (line-height . 11.45)
      (space-width . 2.2)
--- a/lisp/replace.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/replace.el	Wed Feb 23 09:18:23 2005 +0000
@@ -115,8 +115,11 @@
 	       query-replace-from-history-variable
 	       nil t t))))
       (if (and (zerop (length from)) lastto lastfrom)
-	  (cons lastfrom
-		(query-replace-compile-replacement lastto regexp-flag))
+	  (progn
+	    (cons lastfrom
+		  (query-replace-compile-replacement lastto regexp-flag))
+	    (set query-replace-from-history-variable
+		 (cdr (symbol-value query-replace-from-history-variable))))
 	;; Warn if user types \n or \t, but don't reject the input.
 	(and regexp-flag
 	     (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\(\\\\[nt]\\)" from)
@@ -214,7 +217,11 @@
 
 To customize possible responses, change the \"bindings\" in `query-replace-map'."
   (interactive (let ((common
-		      (query-replace-read-args "Query replace" nil)))
+		      (query-replace-read-args 
+		       (if (and transient-mark-mode mark-active)
+			 "Query replace in region"
+			 "Query replace")
+			 nil)))
 		 (list (nth 0 common) (nth 1 common) (nth 2 common)
 		       ;; These are done separately here
 		       ;; so that command-history will record these expressions
@@ -274,7 +281,11 @@
 Use \\[repeat-complex-command] after this command for details."
   (interactive
    (let ((common
-	  (query-replace-read-args "Query replace regexp" t)))
+	  (query-replace-read-args 
+	   (if (and transient-mark-mode mark-active)
+	       "Query replace regexp in region"
+	     "Query replace regexp")
+	   t)))
      (list (nth 0 common) (nth 1 common) (nth 2 common)
 	   ;; These are done separately here
 	   ;; so that command-history will record these expressions
@@ -420,7 +431,11 @@
 and TO-STRING is also null.)"
   (interactive
    (let ((common
-	  (query-replace-read-args "Replace string" nil)))
+	  (query-replace-read-args 
+	   (if (and transient-mark-mode mark-active)
+	       "Replace string in region"
+	     "Replace string")
+	   nil)))
      (list (nth 0 common) (nth 1 common) (nth 2 common)
 	   (if (and transient-mark-mode mark-active)
 	       (region-beginning))
@@ -474,7 +489,11 @@
 which will run faster and will not set the mark or print anything."
   (interactive
    (let ((common
-	  (query-replace-read-args "Replace regexp" t)))
+	  (query-replace-read-args 
+	   (if (and transient-mark-mode mark-active)
+	       "Replace regexp in region" 
+	     "Replace regexp") 
+	   t)))
      (list (nth 0 common) (nth 1 common) (nth 2 common)
 	   (if (and transient-mark-mode mark-active)
 	       (region-beginning))
--- a/lisp/ses.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/ses.el	Wed Feb 23 09:18:23 2005 +0000
@@ -1281,34 +1281,20 @@
 
 ;; 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)))))))
+(defadvice undo-more (around ses-undo-more activate preactivate)
+  "For SES mode, allow undo outside of narrowed buffer range."
+  (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 point before we start changing hidden stuff."
--- a/lisp/simple.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/simple.el	Wed Feb 23 09:18:23 2005 +0000
@@ -3158,12 +3158,12 @@
 	  (let ((abbrev-mode nil))
 	    (end-of-line)
 	    (insert "\n"))
-	(line-move arg))
+	(line-move arg nil nil t))
     (if (interactive-p)
 	(condition-case nil
-	    (line-move arg)
+	    (line-move arg nil nil t)
 	  ((beginning-of-buffer end-of-buffer) (ding)))
-      (line-move arg)))
+      (line-move arg nil nil t)))
   nil)
 
 (defun previous-line (&optional arg)
@@ -3186,9 +3186,9 @@
   (or arg (setq arg 1))
   (if (interactive-p)
       (condition-case nil
-	  (line-move (- arg))
+	  (line-move (- arg) nil nil t)
 	((beginning-of-buffer end-of-buffer) (ding)))
-    (line-move (- arg)))
+    (line-move (- arg) nil nil t))
   nil)
 
 (defcustom track-eol nil
@@ -3227,8 +3227,8 @@
 	  (assq prop buffer-invisibility-spec)))))
 
 ;; Perform vertical scrolling of tall images if necessary.
-(defun line-move (arg &optional noerror to-end)
-  (if auto-window-vscroll
+(defun line-move (arg &optional noerror to-end try-vscroll)
+  (if (and auto-window-vscroll try-vscroll)
       (let ((forward (> arg 0))
 	    (part (nth 2 (pos-visible-in-window-p (point) nil t))))
 	(if (and (consp part)
@@ -3244,7 +3244,14 @@
 					       (* (frame-char-height) (- arg))))))
 				t)
 	  (set-window-vscroll nil 0)
-	  (line-move-1 arg noerror to-end)))
+	  (when (line-move-1 arg noerror to-end)
+	    (sit-for 0)
+	    (if (and (not forward)
+		     (setq part (nth 2 (pos-visible-in-window-p
+					(line-beginning-position) nil t)))
+		     (> (cdr part) 0))
+		(set-window-vscroll nil (cdr part) t))
+	    t)))
     (line-move-1 arg noerror to-end)))
 
 ;; This is the guts of next-line and previous-line.
--- a/lisp/subr.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/subr.el	Wed Feb 23 09:18:23 2005 +0000
@@ -2221,10 +2221,10 @@
 (defun subregexp-context-p (regexp pos &optional start)
   "Return non-nil if POS is in a normal subregexp context in REGEXP.
 A subregexp context is one where a sub-regexp can appear.
-A non-subregexp context is for example within brackets, or within a repetition
-bounds operator \\{..\\}, or right after a \\.
-If START is non-nil, it should be a position in REGEXP, smaller than POS,
-and known to be in a subregexp context."
+A non-subregexp context is for example within brackets, or within a
+repetition bounds operator `\\=\\{...\\}', or right after a `\\'.
+If START is non-nil, it should be a position in REGEXP, smaller
+than POS, and known to be in a subregexp context."
   ;; Here's one possible implementation, with the great benefit that it
   ;; reuses the regexp-matcher's own parser, so it understands all the
   ;; details of the syntax.  A disadvantage is that it needs to match the
--- a/lisp/term/mac-win.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/term/mac-win.el	Wed Feb 23 09:18:23 2005 +0000
@@ -1,6 +1,7 @@
 ;;; mac-win.el --- parse switches controlling interface with Mac window system
 
-;; Copyright (C) 1999, 2000, 2002, 2003, 2004  Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005
+;;   Free Software Foundation, Inc.
 
 ;; Author: Andrew Choi <akochoi@mac.com>
 ;; Keywords: terminals
@@ -1013,16 +1014,16 @@
 (define-key function-key-map [M-return] [?\M-\C-m])
 (define-key function-key-map [tab] [?\t])
 (define-key function-key-map [M-tab] [?\M-\t])
-(define-key function-key-map [backspace] [127])
+(define-key function-key-map [backspace] [?\d])
 (define-key function-key-map [M-backspace] [?\M-\d])
 (define-key function-key-map [escape] [?\e])
 (define-key function-key-map [M-escape] [?\M-\e])
 
 ;; These tell read-char how to convert
 ;; these special chars to ASCII.
-(put 'return 'ascii-character 13)
+(put 'return 'ascii-character ?\C-m)
 (put 'tab 'ascii-character ?\t)
-(put 'backspace 'ascii-character 127)
+(put 'backspace 'ascii-character ?\d)
 (put 'escape 'ascii-character ?\e)
 
 
@@ -1268,7 +1269,7 @@
 
 (unless (eq system-type 'darwin)
   ;; This variable specifies the Unix program to call (as a process) to
-  ;; deteremine the amount of free space on a file system (defaults to
+  ;; determine the amount of free space on a file system (defaults to
   ;; df).  If it is not set to nil, ls-lisp will not work correctly
   ;; unless an external application df is implemented on the Mac.
   (setq directory-free-space-program nil)
@@ -1276,20 +1277,17 @@
   ;; Set this so that Emacs calls subprocesses with "sh" as shell to
   ;; expand filenames Note no subprocess for the shell is actually
   ;; started (see run_mac_command in sysdep.c).
-  (setq shell-file-name "sh"))
+  (setq shell-file-name "sh")
+
+  ;; To display filenames in Chinese or Japanese, replace mac-roman with
+  ;; big5 or sjis
+  (setq file-name-coding-system 'mac-roman))
 
 ;; X Window emulation in macterm.c is not complete enough to start a
 ;; frame without a minibuffer properly.  Call this to tell ediff
 ;; library to use a single frame.
 ; (ediff-toggle-multiframe)
 
-(if (eq system-type 'darwin)
-    ;; On Darwin filenames are encoded in UTF-8
-    (setq file-name-coding-system 'utf-8)
-  ;; To display filenames in Chinese or Japanese, replace mac-roman with
-  ;; big5 or sjis
-  (setq file-name-coding-system 'mac-roman))
-
 ;; If Emacs is started from the Finder, change the default directory
 ;; to the user's home directory.
 (if (string= default-directory "/")
@@ -1307,5 +1305,5 @@
 
 ;; (prefer-coding-system 'mac-roman)
 
-;;; arch-tag: 71dfcd14-cde8-4d66-b05c-85ec94fb23a6
+;; arch-tag: 71dfcd14-cde8-4d66-b05c-85ec94fb23a6
 ;;; mac-win.el ends here
--- a/lisp/textmodes/ispell.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/textmodes/ispell.el	Wed Feb 23 09:18:23 2005 +0000
@@ -671,6 +671,12 @@
 If you want OTHERCHARS to be empty, use the empty string.
 Hint: regexp syntax requires the hyphen to be declared first here.
 
+CASECHAS, NOT-CASECHARS, and OTHERCHARS must be a unibyte string
+containing bytes of CHARACTER-SET.  In addition, if they contain
+a non-ASCII byte, the regular expression must be a single
+`character set' construct that doesn't specify a character range
+for non-ASCII bytes.
+
 MANY-OTHERCHARS-P is non-nil when multiple OTHERCHARS are allowed in a word.
 Otherwise only a single OTHERCHARS character is allowed to be part of any
 single word.
--- a/lisp/tooltip.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/tooltip.el	Wed Feb 23 09:18:23 2005 +0000
@@ -488,7 +488,7 @@
 	     (setq pos (posn-at-x-y (car pos) (cdr pos) (car mp)))
 	     (windowp (posn-window pos)))
 	(with-current-buffer (window-buffer (posn-window pos))
-	  (if (mouse-on-link-p (posn-point pos))
+	  (if (mouse-on-link-p pos)
 	      (setq msg (concat
 		    (cond
 		     ((eq mouse-1-click-follows-link 'double) "double-")
--- a/lisp/wdired.el	Fri Feb 18 00:41:50 2005 +0000
+++ b/lisp/wdired.el	Wed Feb 23 09:18:23 2005 +0000
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2001, 2004  Free Software Foundation, Inc.
 
 ;; Filename: wdired.el
-;; Author: Juan León Lahoz García <juan-leon.lahoz@tecsidel.es>
+;; Author: Juan León Lahoz García <juan-leon.lahoz@tecsidel.es>
 ;; Version: 1.91
 ;; Keywords: dired, environment, files, renaming
 
--- a/lispref/ChangeLog	Fri Feb 18 00:41:50 2005 +0000
+++ b/lispref/ChangeLog	Wed Feb 23 09:18:23 2005 +0000
@@ -1,3 +1,8 @@
+2005-02-22  Kim F. Storm  <storm@cua.dk>
+
+	* minibuf.texi (Basic Completion): Allow symbols in addition to
+	strings in try-completion and all-completions.
+
 2005-02-14  Lute Kamstra  <lute@gnu.org>
 
 	* elisp.texi (Top): Remove reference to deleted node.
--- a/lispref/minibuf.texi	Fri Feb 18 00:41:50 2005 +0000
+++ b/lispref/minibuf.texi	Wed Feb 23 09:18:23 2005 +0000
@@ -595,9 +595,9 @@
 @defun try-completion string collection &optional predicate
 This function returns the longest common substring of all possible
 completions of @var{string} in @var{collection}.  The value of
-@var{collection} must be a list of strings, an alist, an obarray, a
-hash table, or a function that implements a virtual set of strings
-(see below).
+@var{collection} must be a list of strings or symbols, an alist, an
+obarray, a hash table, or a function that implements a virtual set of
+strings (see below).
 
 Completion compares @var{string} against each of the permissible
 completions specified by @var{collection}; if the beginning of the
@@ -610,11 +610,13 @@
 
 If @var{collection} is an alist (@pxref{Association Lists}), the
 permissible completions are the elements of the alist that are either
-strings or conses whose @sc{car} is a string.  Other elements of the
-alist are ignored. (Remember that in Emacs Lisp, the elements of
-alists do not @emph{have} to be conses.)  As all elements of the alist
-can be strings, this case actually includes lists of strings, even
-though we usually do not think of such lists as alists.
+strings, symbols, or conses whose @sc{car} is a string or symbol.
+Symbols are converted to strings using @code{symbol-name}.
+Other elements of the alist are ignored. (Remember that in Emacs Lisp,
+the elements of alists do not @emph{have} to be conses.)  As all
+elements of the alist can be strings, this case actually includes
+lists of strings or symbols, even though we usually do not think of
+such lists as alists.
 
 @cindex obarray in completion
 If @var{collection} is an obarray (@pxref{Creating Symbols}), the names
--- a/man/ChangeLog	Fri Feb 18 00:41:50 2005 +0000
+++ b/man/ChangeLog	Wed Feb 23 09:18:23 2005 +0000
@@ -1,3 +1,9 @@
+2005-02-18  Jonathan Yavner  <jyavner@member.fsf.org>
+
+	* ses.texi: Add concept/function/variable indices (this work was
+	donated by Brad Collins <brad@chenla.org>, copyright-assignment
+	papers on file at FSF).
+
 2005-02-16  Luc Teirlinck  <teirllm@auburn.edu>
 
 	* emacs.texi (Top): Update menu for splitting of node in
--- a/man/ediff.texi	Fri Feb 18 00:41:50 2005 +0000
+++ b/man/ediff.texi	Wed Feb 23 09:18:23 2005 +0000
@@ -1106,10 +1106,18 @@
 many ways to create diff output, and it is easier to handle by running
 Ediff on the inactive sessions.
 
-Last, but not least, by typing @kbd{=}, you can quickly find out which
-sessions have identical files, so you won't have to run Ediff on those
+Last, but not least, by typing @kbd{==}, you can quickly find out which
+sessions have identical entries, so you won't have to run Ediff on those
 sessions.  This, however, works only on local, uncompressed files.
 For compressed or remote files, this command won't report anything.
+Likewise, you can use @kbd{=h} to mark sessions with identical entries
+for hiding or, with @kbd{=m}, for further operations.
+
+The comparison operations @kbd{==}, @kbd{=h}, and @kbd{=m} can recurse into
+subdirectories to see if they have identical contents (so the user will not
+need to descend into those subdirectories manually). These commands ask the
+user whether or not to do a recursive descent.
+
 
 
 @node Remote and Compressed Files, Customization, Session Groups, Top
@@ -2395,11 +2403,13 @@
 Xavier Fornari (xavier@@europe.cma.fr),
 Eric Freudenthal (freudent@@jan.ultra.nyu.edu),
 Job Ganzevoort (Job.Ganzevoort@@cwi.nl),
+Felix Heinrich Gatzemeier (felix.g@@tzemeier.info),
 Boris Goldowsky (boris@@cs.rochester.edu),
 Allan Gottlieb (gottlieb@@allan.ultra.nyu.edu),
 Aaron Gross (aaron@@bfr.co.il),
 Thorbjoern Hansen (thorbjoern.hansen@@mchp.siemens.de),
 Marcus Harnisch (marcus_harnisch@@mint-tech.com),
+Steven E. Harris (seh@@panix.com),
 Xiaoli Huang (hxl@@epic.com),
 Andreas Jaeger (aj@@suse.de),
 Lars Magne Ingebrigtsen (larsi@@ifi.uio.no),
@@ -2428,6 +2438,7 @@
 Erik Naggum (erik@@naggum.no),
 Eyvind Ness (Eyvind.Ness@@hrp.no),
 Ray Nickson (nickson@@cs.uq.oz.au),
+Dan Nicolaescu (dann@@ics.uci.edu),
 David Petchey (petchey_david@@jpmorgan.com),
 Benjamin Pierce (benjamin.pierce@@cl.cam.ac.uk),
 Francois Pinard (pinard@@iro.umontreal.ca),
--- a/man/ses.texi	Fri Feb 18 00:41:50 2005 +0000
+++ b/man/ses.texi	Wed Feb 23 09:18:23 2005 +0000
@@ -8,7 +8,7 @@
 @copying
 This file documents SES: the Simple Emacs Spreadsheet.
 
-Copyright @copyright{} 2002  Free Software Foundation, Inc.
+Copyright @copyright{} 2002, 2005  Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
@@ -71,6 +71,7 @@
 * The Basics::                  Basic spreadsheet commands
 * Advanced Features::           Want to know more?
 * For Gurus::                   Want to know @emph{even more}?
+* Index::                       Concept, Function and Variable Index
 * Acknowledgements::            Acknowledgements
 @end menu
 
@@ -79,6 +80,7 @@
 @node Sales Pitch, The Basics, Top, Top
 @comment  node-name,  next,  previous,  up
 @chapter Sales Pitch
+@cindex features
 
 @itemize @bullet
 @item Create and edit simple spreadsheets with a minimum of fuss.
@@ -100,6 +102,13 @@
 @node The Basics, Advanced Features, Sales Pitch, Top
 @comment  node-name,  next,  previous,  up
 @chapter The Basics
+@cindex basic commands
+@findex ses-jump
+@findex ses-mark-row
+@findex ses-mark-column
+@findex ses-mark-whole-buffer
+@findex set-mark-command
+@findex keyboard-quit
 
 A @dfn{cell identifier} is a symbol with a column letter and a row
 number.  Cell B7 is the 2nd column of the 7th row.  For very wide
@@ -147,6 +156,13 @@
 
 @node Formulas, Resizing, The Basics, The Basics
 @section Cell formulas
+@cindex formulas
+@cindex formulas, entering
+@findex ses-read-cell
+@findex ses-read-symbol
+@findex ses-edit-cell
+@findex ses-recalculate-cell
+@findex ses-recalculate-all
 
 To enter a number into the current cell, just start typing:
 
@@ -193,6 +209,15 @@
 
 @node Resizing, Printer functions, Formulas, The Basics
 @section Resizing the spreadsheet
+@cindex resizing spreadsheets
+@findex ses-insert-row
+@findex ses-insert-column
+@findex ses-delete-row
+@findex ses-delete-column
+@findex ses-set-column-width
+@findex ses-forward-or-insert
+@findex ses-append-row-jump-first-column
+
 
 Basic commands:
 
@@ -240,6 +265,16 @@
 
 @node Printer functions, Clearing cells, Resizing, The Basics
 @section Printer functions
+@cindex printer functions
+@findex ses-read-cell-printer
+@findex ses-read-column-printer
+@findex ses-read-default-printer
+@findex ses-center
+@findex ses-center-span
+@findex ses-dashfill
+@findex ses-dashfill-span
+@findex ses-tildefill-span
+
 
 Printer functions convert binary cell values into the print forms that
 Emacs will display on the screen.
@@ -295,6 +330,9 @@
 
 @node Clearing cells, Copy/cut/paste, Printer functions, The Basics
 @section Clearing cells
+@cindex clearing commands
+@findex ses-clear-cell-backward
+@findex ses-clear-cell-forward
 
 These commands set both formula and printer to @code{nil}:
 
@@ -309,6 +347,18 @@
 
 @node Copy/cut/paste, Customizing SES, Clearing cells, The Basics
 @section Copy, cut, and paste
+@cindex copy
+@cindex cut
+@cindex paste
+@findex kill-ring-save
+@findex mouse-set-region
+@findex mouse-set-secondary
+@findex ses-kill-override
+@findex yank
+@findex clipboard-yank
+@findex mouse-yank-at-click
+@findex mouse-yank-at-secondary
+@findex ses-yank-pop
 
 The copy functions work on rectangular regions of cells.  You can paste the
 copies into non-SES buffers to export the print text.
@@ -372,6 +422,12 @@
 
 @node Customizing SES,  , Copy/cut/paste, The Basics
 @section Customizing SES
+@cindex customizing
+@vindex enable-local-eval
+@vindex ses-mode-hook
+@vindex safe-functions
+@vindex enable-local-eval
+
 
 By default, a newly-created spreadsheet has 1 row and 1 column.  The
 column width is 7 and the default printer is @samp{"%.7g"}.  Each of these
@@ -403,6 +459,9 @@
 
 @node Advanced Features, For Gurus, The Basics, Top
 @chapter Advanced Features
+@cindex advanced features
+@findex ses-read-header-row
+
 
 @table @kbd
 @item C-c M-C-h
@@ -430,6 +489,10 @@
 
 @node The print area, Ranges in formulas, Advanced Features, Advanced Features
 @section The print area
+@cindex print area
+@findex widen
+@findex ses-renarrow-buffer
+@findex ses-reprint-all
 
 A SES file consists of a print area and a data area.  Normally the
 buffer is narrowed to show only the print area.  The print area is
@@ -452,6 +515,13 @@
 
 @node Ranges in formulas, Sorting by column, The print area, Advanced Features
 @section Ranges in formulas
+@cindex ranges
+@findex ses-insert-range-click
+@findex ses-insert-range
+@findex ses-insert-ses-range-click
+@findex ses-insert-ses-range
+@vindex from
+@vindex to
 
 A formula like
 @lisp
@@ -505,6 +575,9 @@
 
 @node Sorting by column, Standard formula functions, Ranges in formulas, Advanced Features
 @section Sorting by column
+@cindex sorting
+@findex ses-sort-column
+@findex ses-sort-column-click
 
 @table @kbd
 @item C-c M-C-s
@@ -531,6 +604,12 @@
 
 @node Standard formula functions, More on cell printing, Sorting by column, Advanced Features
 @section Standard formula functions
+@cindex standard formula functions
+@cindex *skip*
+@cindex *error*
+@findex ses-delete-blanks
+@findex ses-average
+@findex ses+
 
 Oftentimes you want a calculation to exclude the blank cells.  Here
 are some useful functions to call from your formulas:
@@ -550,6 +629,9 @@
 
 @node More on cell printing, Import and export, Standard formula functions, Advanced Features
 @section More on cell printing
+@cindex cell printing, more
+@findex ses-truncate-cell
+@findex ses-recalculate-cell
 
 Special cell values:
 @itemize
@@ -590,6 +672,10 @@
 
 @node Import and export, Virus protection, More on cell printing, Advanced Features
 @section Import and export
+@cindex import and export
+@cindex export, and import
+@findex ses-export-tsv
+@findex ses-export-tsf
 
 @table @kbd
 @item x t
@@ -606,6 +692,7 @@
 
 @node Virus protection, Spreadsheets with details and summary, Import and export, Advanced Features
 @section Virus protection
+@cindex virus protection
 
 Whenever a formula or printer is read from a file or is pasted into
 the spreadsheet, it receives a ``needs safety check'' marking.  Later,
@@ -632,6 +719,8 @@
 
 @node Spreadsheets with details and summary,  , Virus protection, Advanced Features
 @section Spreadsheets with details and summary
+@cindex details and summary
+@cindex summary, and details
 
 A common organization for spreadsheets is to have a bunch of ``detail''
 rows, each perhaps describing a transaction, and then a set of
@@ -664,8 +753,9 @@
 
 @c ===================================================================
 
-@node For Gurus, Acknowledgements, Advanced Features, Top
+@node For Gurus, Index, Advanced Features, Top
 @chapter For Gurus
+@cindex advanced features
 
 @menu
 * Deferred updates::
@@ -677,6 +767,9 @@
 
 @node Deferred updates, Nonrelocatable references, For Gurus, For Gurus
 @section Deferred updates
+@cindex deferred updates
+@cindex updates, deferred
+@vindex run-with-idle-timer
 
 To save time by avoiding redundant computations, cells that need
 recalculation due to changes in other cells are added to a set.  At
@@ -706,6 +799,8 @@
 
 @node Nonrelocatable references, The data area, Deferred updates, For Gurus
 @section Nonrelocatable references
+@cindex nonrelocatable references
+@cindex references, nonrelocatable
 
 @kbd{C-y} relocates all cell-references in a pasted formula, while
 @kbd{C-u C-y} relocates none of the cell-references.  What about mixed
@@ -732,6 +827,8 @@
 
 @node The data area, Buffer-local variables in spreadsheets, Nonrelocatable references, For Gurus
 @section The data area
+@cindex data area
+@findex ses-reconstruct-all
 
 Begins with an 014 character, followed by sets of cell-definition
 macros for each row, followed by column-widths, column-printers,
@@ -762,6 +859,8 @@
 
 @node Buffer-local variables in spreadsheets, Uses of defadvice in SES, The data area, For Gurus
 @section Buffer-local variables in spreadsheets
+@cindex buffer-local variables
+@cindex variables, buffer-local
 
 You can add additional local variables to the list at the bottom of
 the data area, such as hidden constants you want to refer to in your
@@ -794,6 +893,10 @@
 
 @node Uses of defadvice in SES,  , Buffer-local variables in spreadsheets, For Gurus
 @section Uses of defadvice in SES
+@cindex defadvice
+@cindex undo-more
+@cindex copy-region-as-kill
+@cindex yank
 
 @table @code
 @item undo-more
@@ -814,10 +917,24 @@
 cell.
 @end table
 
+@c ===================================================================
+@node Index, Acknowledgements, For Gurus, Top
+@unnumbered Concept Index
+
+@printindex cp
+
+@heading Function Index
+
+@printindex fn
+
+@heading Variable Index
+
+@printindex vr
+
 
 @c ===================================================================
 
-@node Acknowledgements,  , For Gurus, Top
+@node Acknowledgements, , Index, Top
 @chapter Acknowledgements
 
 Coding by:
@@ -826,6 +943,14 @@
 Stefan Monnier @email{monnier@@gnu.org}
 @end quotation
 
+@noindent
+Texinfo manual by:
+@quotation
+Jonathan Yavner @email{jyavner@@member.fsf.org}@*
+Brad Collins <brad@@chenla.org>
+@end quotation
+
+@noindent
 Ideas from:
 @quotation
 Christoph Conrad @email{christoph.conrad@@gmx.de}@*
--- a/man/viper.texi	Fri Feb 18 00:41:50 2005 +0000
+++ b/man/viper.texi	Wed Feb 23 09:18:23 2005 +0000
@@ -2285,7 +2285,7 @@
 bind common keys to specialized commands.  This might make sense for modes
 that bind only a small number of common keys.  For instance, Viper subverts
 the Shell mode by changing the bindings for @kbd{C-m} and @kbd{C-d} using
-@code{viper-add-local-keys} described in section on customization
+@code{viper-add-local-keys} described in the section on customization
 (@pxref{Customization}).
 
 In some cases, some @emph{minor} modes might override certain essential
@@ -2294,7 +2294,7 @@
 @code{M-x viper-mode} will correct the situation.  Viper knows about
 several such minor modes and takes care of them, so the above trick
 is usually not necessary.  If you find that some minor mode, e.g.,
-@code{nasty-mode.el} interferes with Viper, putting the following in
+@code{nasty-mode} interferes with Viper, putting the following in
 @file{.viper} should fix the problem:
 @lisp
 (viper-harness-minor-mode "nasty-mode")
@@ -2305,7 +2305,7 @@
 
 It may not be always obvious which minor mode is at fault.  The only
 guidance here is to look into the file that defines the minor mode you are
-suspecting, say @code{nasty-mode.el}, and see if it has a variable called
+suspecting, say @file{nasty-mode.el}, and see if it has a variable called
 @code{nasty-mode-map}.  Then check if there is a statement of the form
 @lisp
 (define-key nasty-mode-map key function)
@@ -2316,6 +2316,18 @@
 suspicion is wrong, no harm is done if you harness a minor mode that
 doesn't need to be harnessed.
 
+It is recommended to harness even those minor modes that don't override
+Viper keys, but still have their own keymaps. A general way to
+make a minor mode, @code{my-mode},
+compatible with Viper is to have the file @file{my-mode.el} include the following code:
+
+@lisp
+(when (fboundp 'viper-harness-minor-mode)
+  (let ((lib (file-name-sans-extension
+               (file-name-nondirectory load-file-name))))
+    (viper-harness-minor-mode lib)))
+@end lisp
+
 @vindex @code{viper-want-emacs-keys-in-vi}
 @vindex @code{viper-want-emacs-keys-in-insert}
 @vindex @code{viper-always}
@@ -2371,11 +2383,19 @@
 @end example
 @findex @code{viper-set-searchstyle-toggling-macros}
 
+If you don't like this feature as a default, but would still like to have
+it in some major modes, you can do so by first unsetting it globally, as
+shown above, and then setting it in the desired major modes as follows:
+@example
+(viper-set-searchstyle-toggling-macros nil 'c-mode)
+(viper-set-searchstyle-toggling-macros nil 'lisp-mode)
+@end example
+
 @item Vi-isms in Emacs state
 Some people find it useful to use the Vi-style search key, `/', to invoke
 search in modes which Viper leaves in emacs-state.  These modes are:
-@code{dired-mode}, @code{mh-folder-mode}, @code{gnus-group-mode},
-@code{gnus-summary-mode}, @code{Info-mode}, and @code{Buffer-menu-mode}
+@code{dired-mode}, @code{mh-folder-mode},
+@code{Info-mode}, and @code{Buffer-menu-mode}
 (more may be added in the future).  So, in the above modes, Viper binds `/'
 so that it will behave Vi-style.  Furthermore, in those major modes, Viper
 binds `:' to invoke ex-style commands, like in vi-state.  And, as described
@@ -4470,6 +4490,7 @@
 gvr@@halcyon.com (George V.@: Reilly),
 hatazaki@@bach.convex.com (Takao Hatazaki),
 hpz@@ibmhpz.aug.ipp-garching.mpg.de (Hans-Peter Zehrfeld),
+irie@@t.email.ne.jp (Irie Tetsuya),
 jackr@@dblues.engr.sgi.com (Jack Repenning),
 jamesm@@bga.com (D.J.@: Miller II),
 jjm@@hplb.hpl.hp.com (Jean-Jacques Moreau),
--- a/src/.gdbinit	Fri Feb 18 00:41:50 2005 +0000
+++ b/src/.gdbinit	Wed Feb 23 09:18:23 2005 +0000
@@ -101,6 +101,193 @@
 Print point, beg, end, narrow, and gap for current buffer.
 end
 
+# Print out iterator given as first arg
+define pitx
+  set $it = $arg0
+  printf "cur=%d", $it->current.pos.charpos
+  if ($it->current.pos.charpos != $it->current.pos.bytepos)
+    printf "[%d]", $it->current.pos.bytepos
+  end
+  printf " start=%d", $it->start.pos.charpos
+  if ($it->start.pos.charpos != $it->start.pos.bytepos)
+    printf "[%d]", $it->start.pos.bytepos
+  end
+  printf " stop=%d ", $it->stop_charpos
+  output $it->what
+  if ($it->what == IT_CHARACTER)
+    if ($it->len == 1 && $it->c >= ' ' && it->c < 255)
+      printf "['%c']", $it->c
+    else
+      printf "[%d,%d]", $it->c, $it->len
+    end
+  end
+  printf " next="
+  output $it->method
+  printf "\n"
+  printf "vpos=%d hpos=%d", $it->vpos, $it->hpos,
+  printf " y=%d lvy=%d", $it->current_y, $it->last_visible_y
+  printf " x=%d lvx=%d", $it->current_x, $it->last_visible_x
+  printf " a+d=%d+%d=%d", $it->ascent, $it->descent, $it->ascent+$it->descent
+  printf " max=%d+%d=%d", $it->max_ascent, $it->max_descent, $it->max_ascent+$it->max_descent
+  printf "\n"
+end
+document pitx
+Pretty print a display iterator.
+Take one arg, an iterator object or pointer.
+end
+
+define pit
+  pitx it
+end
+document pit
+Pretty print the display iterator it.
+end
+
+define prowx
+  set $row = $arg0
+  printf "y=%d x=%d pwid=%d", $row->y, $row->x, $row->pixel_width
+  printf " a+d=%d+%d=%d", $row->ascent, $row->height-$row->ascent, $row->height
+  printf " phys=%d+%d=%d", $row->phys_ascent, $row->phys_height-$row->phys_ascent, $row->phys_height
+  printf " vis=%d", $row->visible_height
+  printf "  L=%d T=%d R=%d", $row->used[0], $row->used[1], $row->used[2]
+  printf "\n"
+  printf "start=%d end=%d", $row->start.pos.charpos, $row->end.pos.charpos
+  if ($row->enabled_p)
+    printf " ENA"
+  end
+  if ($row->displays_text_p)
+    printf " DISP"
+  end
+  if ($row->mode_line_p)
+    printf " MODEL"
+  end
+  if ($row->continued_p)
+    printf " CONT"
+  end
+  if ($row-> truncated_on_left_p)
+    printf " TRUNC:L"
+  end
+  if ($row-> truncated_on_right_p)
+    printf " TRUNC:R"
+  end
+  if ($row->starts_in_middle_of_char_p)
+    printf " STARTMID"
+  end
+  if ($row->ends_in_middle_of_char_p)
+    printf " ENDMID"
+  end
+  if ($row->ends_in_newline_from_string_p)
+    printf " ENDNLFS"
+  end
+  if ($row->ends_at_zv_p)
+    printf " ENDZV"
+  end
+  if ($row->overlapped_p)
+    printf " OLAPD"
+  end
+  if ($row->overlapping_p)
+    printf " OLAPNG"
+  end
+  printf "\n"
+end
+document prowx
+Pretty print information about glyph_row.
+Takes one argument, a row object or pointer.
+end
+
+define prow
+  prowx row
+end
+document prow
+Pretty print information about glyph_row in row.
+end
+
+
+define pcursorx
+  set $cp = $arg0
+  printf "y=%d x=%d vpos=%d hpos=%d", $cp->y, $cp->x, $cp->vpos, $cp->hpos
+end
+document pcursorx
+Pretty print a window cursor
+end
+
+define pcursor
+  printf "output: "
+  pcursorx output_cursor
+  printf "\n"
+end
+document pcursor
+Pretty print the output_cursor
+end
+
+define pwinx
+  set $w = $arg0
+  xgetint $w->sequence_number
+  if ($w->mini_p != Qnil)
+    printf "Mini "
+  end
+  printf "Window %d ", $int
+  xgetptr $w->buffer
+  set $tem = (struct buffer *) $ptr
+  xgetptr $tem->name
+  printf "%s", ((struct Lisp_String *) $ptr)->data
+  printf "\n"
+  xgetptr $w->start
+  set $tem = (struct Lisp_Marker *) $ptr
+  printf "start=%d end:", $tem->charpos
+  if ($w->window_end_valid != Qnil)
+    xgetint $w->window_end_pos
+    printf "pos=%d", $int
+    xgetint $w->window_end_vpos
+    printf " vpos=%d", $int
+  else
+    printf "invalid"
+  end
+  printf " vscroll=%d", $w->vscroll
+  if ($w->force_start != Qnil)
+    printf " FORCE_START"
+  end
+  if ($w->must_be_updated_p)
+    printf " MUST_UPD"
+  end
+  printf "\n"
+  printf "cursor: "
+  pcursorx $w->cursor
+  printf "  phys: "
+  pcursorx $w->phys_cursor
+  if ($w->phys_cursor_on_p)
+    printf " ON"
+  else
+    printf " OFF"
+  end
+  printf " blk="
+  if ($w->last_cursor_off_p != $w->cursor_off_p)
+    if ($w->last_cursor_off_p)
+      printf "ON->"
+    else
+      printf "OFF->"
+    end
+  end
+  if ($w->cursor_off_p)
+    printf "ON"
+  else
+    printf "OFF"
+  end
+  printf "\n"
+end
+document pwinx
+Pretty print a window structure.
+Takes one argument, a pointer to a window structure
+end
+
+define pwin
+  pwinx w
+end
+document pwin
+Pretty print window structure w.
+end
+
+
 define xtype
   xgettype $
   output $type
--- a/src/ChangeLog	Fri Feb 18 00:41:50 2005 +0000
+++ b/src/ChangeLog	Wed Feb 23 09:18:23 2005 +0000
@@ -1,3 +1,66 @@
+2005-02-22  Kim F. Storm  <storm@cua.dk>
+
+	* minibuf.c (Ftry_completion, Fall_completions): Allow both string
+	and symbol keys in alists and hash tables.
+
+	* xdisp.c (fast_find_position): Fix search for start of overlay.
+
+2005-02-21  Kim F. Storm  <storm@cua.dk>
+
+	* window.c (window_scroll_pixel_based): When scrolling backwards,
+	handle partial visible line at end of window even when we hit PT.
+
+2005-02-21  Stefan  <monnier@iro.umontreal.ca>
+
+	* keymap.h: Declare Fcurrent_active_maps, used in doc.c.
+
+2005-02-21  Kim F. Storm  <storm@cua.dk>
+
+	* xdisp.c (move_it_vertically_backward): Eliminate two xasserts.
+	I think those asserts are bogus if buffer contains invisible text
+	or images.
+
+2005-02-21  David Kastrup <dak@gnu.org>
+
+	* gtkutil.c (xg_create_frame_widgets): UNBLOCK_INPUT on error.
+
+2005-02-20  Kim F. Storm  <storm@cua.dk>
+
+	* xdisp.c (pos_visible_p): Be sure to move to the specified
+	position.  Always get the full ascent / descent of the
+	corresponding row, to return reliable rtop and rbot values.
+	(back_to_previous_visible_line_start): Fix 2005-01-18 change.
+	Must look one character back, as back_to_previous_line_start
+	returns position after the newline.
+	(move_it_vertically_backward): Fix heuristic for when to move further
+	back in case line_height * 2/3 is larger than window height.
+	(cursor_row_fully_visible_p): Rename make_cursor_line_fully_visible_p
+	as it does not do anything anymore.  Add arg current_matrix_p to
+	use current matrix rather than desired matrix when set.
+	(try_cursor_movement): Don't scroll to make cursor row fully
+	visible if cursor didn't move.  This avoids unexpected recentering
+	in case of blinking cursor or accepting process output.
+	Use current matrix to check cursor row visibility.
+	(redisplay_window): Fix whether to recenter or move to top in case
+	cursor line is taller than window height.
+	(find_first_unchanged_at_end_row): Stop search if we reach a row
+	which not enabled (instead of abort).
+
+2005-02-18  Kim F. Storm  <storm@cua.dk>
+
+	* xfaces.c (Finternal_set_lisp_face_attribute): Allow :color property
+	to be nil in a :box attribute value list; customize prints that
+	as lisp value when no box color is specified.
+
+	* .gdbinit (pitx, pit): Pretty print display iterator.
+	(prowx, prow): Pretty print glyph row.
+	(pcursorx, pcursor): Pretty print a window cursor.
+	(pwinx, pwin): Pretty print struct window.
+
+2005-02-18  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* alloc.c (BLOCK_BYTES): Harmless typo.
+
 2005-02-17  Andreas Schwab  <schwab@suse.de>
 
 	* xfns.c (hack_wm_protocols): Use correct type for last parameter
@@ -811,13 +874,8 @@
 	(install_window_handler) [TARGET_API_MAC_CARBON]:
 	Register handlers for tracking/receiving drag-and-drop items.
 	(do_ae_open_documents): Generate unibyte strings for filenames.
-<<<<<<< ChangeLog
-	(mac_do_receive_drag) [TARGET_API_MAC_CARBON] : Likewise.
-	Reject only non-filename items.  Set event modifiers and return value.
-=======
 	(mac_do_receive_drag) [TARGET_API_MAC_CARBON] : Likewise.
 	Reject only non-filename items.  Set event modifiers, and return value.
->>>>>>> 1.4187
 
 2004-12-28  Dan Nicolaescu  <dann@ics.uci.edu>
 
@@ -927,12 +985,7 @@
 	(x_make_frame_visible) [TARGET_API_MAC_CARBON]: Reposition window
 	if the position is neither user-specified nor program-specified.
 	(x_free_frame_resources): Free size_hints.
-<<<<<<< ChangeLog
-	(x_wm_set_size_hint): Allocate size_hints if needed.
-	Set size_hints.
-=======
 	(x_wm_set_size_hint): Allocate size_hints if needed.  Set size_hints.
->>>>>>> 1.4187
 	(mac_clear_font_name_table): New function.
 	(mac_do_list_fonts): Initialize font_name_table if needed.
 	(x_list_fonts): Don't initialize font_name_table.  Add BLOCK_INPUT
@@ -984,11 +1037,7 @@
 
 2004-12-27  Richard M. Stallman  <rms@gnu.org>
 
-<<<<<<< ChangeLog
-	* buffer.c (Fbuffer_disable_undo): Delete (moved to simple.el).
-=======
 	* buffer.c (Fbuffer_disable_undo): Delete (move to simple.el).
->>>>>>> 1.4187
 	(syms_of_buffer): Don't defsubr it.
 
 	* process.c (list_processes_1): Set undo_list instead
--- a/src/ChangeLog.5	Fri Feb 18 00:41:50 2005 +0000
+++ b/src/ChangeLog.5	Wed Feb 23 09:18:23 2005 +0000
@@ -3405,7 +3405,7 @@
 	(UNISTD_H_INCLUDED): Don't define or test this.
 	* m/ibm370aix.h (NEED_UNISTD_H): Defined.
 	* s/aix3-1.h (NEED_UNISTD_H): Defined.
-	* s/irix4-0.h (NEED_UNISTD_H): Defined.
+	* s/irix4-0.h (NEED_UNISTD_H): Define.
 
 	* fileio.c (internal_delete_file, internal_delete_file_1):
 	New functions.
@@ -3419,7 +3419,7 @@
 1994-11-24  Francesco Potorti`  <pot@cnuce.cnr.it>
 
 	* m/delta.h (C_SWITCH_MACHINE): -inline-functions removed,
-        because the compiler shipped with R3V7 is not stable.
+	because the compiler shipped with R3V7 is not stable.
 
 1994-11-24  Richard Stallman  <rms@mole.gnu.ai.mit.edu>
 
@@ -3443,7 +3443,7 @@
 	(complete_and_exit_1, complete_and_exit_2): New subroutines.
 
 	* s/aix4.h: New file.
-	* s/aix3-1.h (AIXHFT): Defined.
+	* s/aix3-1.h (AIXHFT): Define.
 	* m/ibmrs6000.h (OBJECTS_MACHINE): Define only if AIXHFT.
 
 	* sysdep.c (init_sys_modes): Tes AIXHFT, not AIX.
@@ -6451,7 +6451,7 @@
 	Add an unwind protect to restore original buffer and kill the temp.
 
 	* sysdep.c (init_system_name): Retry gethostbyname after TRY_AGAIN
-        failure.
+	failure.
 
 	* process.c (Fopen_network_stream):
 	Retry gethostbyname after TRY_AGAIN failure.
@@ -6477,7 +6477,7 @@
 
 	* s/linux.h [emacs]: Include stdio.h.
 
-	* commands.h (unread_command_char): Declared.
+	* commands.h (unread_command_char): Declare.
 	* dispnew.c (sit_for): Return immediately if unread events exist.
 
 1994-07-17  Richard Stallman  (rms@mole.gnu.ai.mit.edu)
--- a/src/alloc.c	Fri Feb 18 00:41:50 2005 +0000
+++ b/src/alloc.c	Wed Feb 23 09:18:23 2005 +0000
@@ -1,6 +1,6 @@
 /* Storage allocation and gc for GNU Emacs Lisp interpreter.
    Copyright (C) 1985, 1986, 1988, 1993, 1994, 1995, 1997, 1998, 1999,
-      2000, 2001, 2002, 2003, 2004  Free Software Foundation, Inc.
+      2000, 2001, 2002, 2003, 2004, 2005  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -890,12 +890,13 @@
    On glibc-2.3.2, malloc never tries to align, so a padding of 0 is best.
    posix_memalign on the other hand would ideally prefer a value of 4
    because otherwise, there's 1020 bytes wasted between each ablocks.
-   But testing shows that those 1020 will most of the time be efficiently
-   used by malloc to place other objects, so a value of 0 is still preferable
-   unless you have a lot of cons&floats and virtually nothing else.  */
+   In Emacs, testing shows that those 1020 can most of the time be
+   efficiently used by malloc to place other objects, so a value of 0 can
+   still preferable unless you have a lot of aligned blocks and virtually
+   nothing else.  */
 #define BLOCK_PADDING 0
 #define BLOCK_BYTES \
-  (BLOCK_ALIGN - sizeof (struct aligned_block *) - BLOCK_PADDING)
+  (BLOCK_ALIGN - sizeof (struct ablock *) - BLOCK_PADDING)
 
 /* Internal data structures and constants.  */
 
--- a/src/gtkutil.c	Fri Feb 18 00:41:50 2005 +0000
+++ b/src/gtkutil.c	Wed Feb 23 09:18:23 2005 +0000
@@ -584,14 +584,14 @@
 {
   int mbheight = FRAME_MENUBAR_HEIGHT (f);
   int tbheight = FRAME_TOOLBAR_HEIGHT (f);
-  int rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, (pixelheight 
+  int rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, (pixelheight
 						   - mbheight - tbheight));
   int columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixelwidth);
 
   if (FRAME_GTK_WIDGET (f)
-      && (columns != FRAME_COLS (f) 
+      && (columns != FRAME_COLS (f)
 	  || rows != FRAME_LINES (f)
-          || pixelwidth != FRAME_PIXEL_WIDTH (f) 
+          || pixelwidth != FRAME_PIXEL_WIDTH (f)
 	  || pixelheight != FRAME_PIXEL_HEIGHT (f)))
     {
       struct x_output *x = f->output_data.x;
@@ -719,6 +719,7 @@
       if (wvbox) gtk_widget_destroy (wvbox);
       if (wfixed) gtk_widget_destroy (wfixed);
 
+      UNBLOCK_INPUT;
       return 0;
     }
 
@@ -2881,7 +2882,7 @@
       if (xg_timer) xg_stop_timer ();
       bar->dragging = Qnil;
     }
-  
+
   return FALSE;
 }
 
@@ -2945,7 +2946,7 @@
      event box window.  */
   gtk_fixed_put (GTK_FIXED (f->output_data.x->edit_widget), webox, -1, -1);
   gtk_container_add (GTK_CONTAINER (webox), wscroll);
-  
+
 
   /* Set the cursor to an arrow.  */
   xg_set_cursor (webox, FRAME_X_DISPLAY_INFO (f)->xg_cursor);
@@ -3270,10 +3271,10 @@
 
   event->area.x = max (0, event->area.x);
   event->area.y = max (0, event->area.y);
-  
+
   event->area.width = max (width, event->area.width);
   event->area.height = max (height, event->area.height);
-  
+
   return FALSE;
 }
 
@@ -3394,7 +3395,7 @@
      DEFAULT_TOOL_BAR_BUTTON_MARGIN has no effect.  */
   hmargin = max (0, hmargin - DEFAULT_TOOL_BAR_BUTTON_MARGIN);
   vmargin = max (0, vmargin - DEFAULT_TOOL_BAR_BUTTON_MARGIN);
-  
+
   if (! x->toolbar_widget)
     xg_create_tool_bar (f);
 
--- a/src/keymap.h	Fri Feb 18 00:41:50 2005 +0000
+++ b/src/keymap.h	Wed Feb 23 09:18:23 2005 +0000
@@ -1,5 +1,5 @@
 /* Functions to manipulate keymaps.
-   Copyright (C) 2001  Free Software Foundation, Inc.
+   Copyright (C) 2001, 2005  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -33,6 +33,7 @@
 EXFUN (Fkey_description, 2);
 EXFUN (Fsingle_key_description, 2);
 EXFUN (Fwhere_is_internal, 5);
+EXFUN (Fcurrent_active_maps, 1);
 extern Lisp_Object access_keymap P_ ((Lisp_Object, Lisp_Object, int, int, int));
 extern Lisp_Object get_keyelt P_ ((Lisp_Object, int));
 extern Lisp_Object get_keymap P_ ((Lisp_Object, int, int));
--- a/src/minibuf.c	Fri Feb 18 00:41:50 2005 +0000
+++ b/src/minibuf.c	Wed Feb 23 09:18:23 2005 +0000
@@ -1181,13 +1181,16 @@
 DEFUN ("try-completion", Ftry_completion, Stry_completion, 2, 3, 0,
        doc: /* Return common substring of all completions of STRING in ALIST.
 Each car of each element of ALIST (or each element if it is not a cons cell)
-is tested to see if it begins with STRING.
+is tested to see if it begins with STRING.  The possible matches may be
+strings or symbols.  Symbols are converted to strings before testing,
+see `symbol-name'.
 All that match are compared together; the longest initial sequence
 common to all matches is returned as a string.
 If there is no match at all, nil is returned.
 For a unique match which is exact, t is returned.
 
-If ALIST is a hash-table, all the string keys are the possible matches.
+If ALIST is a hash-table, all the string and symbol keys are the
+possible matches.
 If ALIST is an obarray, the names of all symbols in the obarray
 are the possible matches.
 
@@ -1257,7 +1260,7 @@
 	  if (!EQ (bucket, zero))
 	    {
 	      elt = bucket;
-	      eltstring = Fsymbol_name (elt);
+	      eltstring = elt;
 	      if (XSYMBOL (bucket)->next)
 		XSETSYMBOL (bucket, XSYMBOL (bucket)->next);
 	      else
@@ -1284,6 +1287,9 @@
 
       /* Is this element a possible completion? */
 
+      if (SYMBOLP (eltstring))
+	eltstring = Fsymbol_name (eltstring);
+
       if (STRINGP (eltstring)
 	  && SCHARS (string) <= SCHARS (eltstring)
 	  && (tem = Fcompare_strings (eltstring, zero,
@@ -1440,10 +1446,13 @@
 DEFUN ("all-completions", Fall_completions, Sall_completions, 2, 4, 0,
        doc: /* Search for partial matches to STRING in ALIST.
 Each car of each element of ALIST (or each element if it is not a cons cell)
-is tested to see if it begins with STRING.
+is tested to see if it begins with STRING.  The possible matches may be
+strings or symbols.  Symbols are converted to strings before testing,
+see `symbol-name'.
 The value is a list of all the strings from ALIST that match.
 
-If ALIST is a hash-table, all the string keys are the possible matches.
+If ALIST is a hash-table, all the string and symbol keys are the
+possible matches.
 If ALIST is an obarray, the names of all symbols in the obarray
 are the possible matches.
 
@@ -1512,7 +1521,7 @@
 	  if (!EQ (bucket, zero))
 	    {
 	      elt = bucket;
-	      eltstring = Fsymbol_name (elt);
+	      eltstring = elt;
 	      if (XSYMBOL (bucket)->next)
 		XSETSYMBOL (bucket, XSYMBOL (bucket)->next);
 	      else
@@ -1539,6 +1548,9 @@
 
       /* Is this element a possible completion? */
 
+      if (SYMBOLP (eltstring))
+	eltstring = Fsymbol_name (eltstring);
+
       if (STRINGP (eltstring)
 	  && SCHARS (string) <= SCHARS (eltstring)
 	  /* If HIDE_SPACES, reject alternatives that start with space
--- a/src/window.c	Fri Feb 18 00:41:50 2005 +0000
+++ b/src/window.c	Wed Feb 23 09:18:23 2005 +0000
@@ -4763,6 +4763,7 @@
   else if (n < 0)
     {
       int charpos, bytepos;
+      int partial_p;
 
       /* Save our position, for the preserve_y case.  */
       charpos = IT_CHARPOS (it);
@@ -4774,7 +4775,20 @@
 		  it.last_visible_y - this_scroll_margin - 1, -1,
 		  MOVE_TO_POS | MOVE_TO_Y);
 
-      if (IT_CHARPOS (it) == PT)
+      /* Save our position, in case it's correct.  */
+      charpos = IT_CHARPOS (it);
+      bytepos = IT_BYTEPOS (it);
+
+      /* See if point is on a partially visible line at the end.  */
+      if (it.what == IT_EOB)
+	partial_p = it.current_y + it.ascent + it.descent > it.last_visible_y;
+      else
+	{
+	  move_it_by_lines (&it, 1, 1);
+	  partial_p = it.current_y > it.last_visible_y;
+	}
+
+      if (charpos == PT && !partial_p)
 	/* We found PT before we found the display margin, so PT is ok.  */
 	;
       else if (preserve_y >= 0)
@@ -4795,14 +4809,7 @@
 	}
       else
 	{
-	  /* Save our position, in case it's correct.  */
-	  charpos = IT_CHARPOS (it);
-	  bytepos = IT_BYTEPOS (it);
-
-	  /* See if point is on a partially visible line at the end.  */
-	  move_it_by_lines (&it, 1, 1);
-
-	  if (it.current_y > it.last_visible_y)
+	  if (partial_p)
 	    /* The last line was only partially visible, so back up two
 	       lines to make sure we're on a fully visible line.  */
 	    {
--- a/src/xdisp.c	Fri Feb 18 00:41:50 2005 +0000
+++ b/src/xdisp.c	Wed Feb 23 09:18:23 2005 +0000
@@ -866,7 +866,7 @@
 							  Lisp_Object));
 static void extend_face_to_end_of_line P_ ((struct it *));
 static int append_space_for_newline P_ ((struct it *, int));
-static int make_cursor_line_fully_visible P_ ((struct window *, int));
+static int cursor_row_fully_visible_p P_ ((struct window *, int, int));
 static int try_scrolling P_ ((Lisp_Object, int, EMACS_INT, EMACS_INT, int, int));
 static int try_cursor_movement P_ ((Lisp_Object, struct text_pos, int *));
 static int trailing_whitespace_p P_ ((int));
@@ -1288,8 +1288,8 @@
     }
 
   start_display (&it, w, top);
-  move_it_to (&it, charpos, 0, it.last_visible_y, -1,
-	      MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y);
+  move_it_to (&it, charpos, -1, it.last_visible_y, -1,
+	      MOVE_TO_POS | MOVE_TO_Y);
 
   /* Note that we may overshoot because of invisible text.  */
   if (IT_CHARPOS (it) >= charpos)
@@ -1313,12 +1313,13 @@
 	    }
 	}
     }
-  else if (it.current_y + it.max_ascent + it.max_descent > it.last_visible_y)
+  else
     {
       struct it it2;
 
       it2 = it;
-      move_it_by_lines (&it, 1, 0);
+      if (IT_CHARPOS (it) < ZV && FETCH_BYTE (IT_BYTEPOS (it)) != '\n')
+	move_it_by_lines (&it, 1, 0);
       if (charpos < IT_CHARPOS (it))
 	{
 	  visible_p = 1;
@@ -1329,8 +1330,9 @@
 	      *y = it2.current_y + it2.max_ascent - it2.ascent;
 	      if (rtop)
 		{
-		  *rtop = 0;
-		  *rbot = max (0, (it2.current_y + it2.max_ascent + it2.max_descent) - it.last_visible_y);
+		  *rtop = max (0, -it2.current_y);
+		  *rbot = max (0, ((it2.current_y + it2.max_ascent + it2.max_descent)
+				   - it.last_visible_y));
 		}
 	    }
 	}
@@ -4793,27 +4795,31 @@
       /* If newline has a display property that replaces the newline with something
 	 else (image or text), find start of overlay or interval and continue search
 	 from that point.  */
-      {
-	struct it it2 = *it;
-	int pos = IT_CHARPOS (*it);
-	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))
-	    && (OVERLAYP (overlay)
-		? (beg = OVERLAY_POSITION (OVERLAY_START (overlay)))
-		: get_property_and_range (pos, Qdisplay, &val, &beg, &end, Qnil)))
-	  {
-	    if (beg < BEGV)
-	      beg = BEGV;
-	    IT_CHARPOS (*it) = beg;
-	    IT_BYTEPOS (*it) = buf_charpos_to_bytepos (current_buffer, beg);
-	    continue;
-	  }
-      }
+      if (IT_CHARPOS (*it) > BEGV)
+	{
+	  struct it it2 = *it;
+	  int pos;
+	  int beg, end;
+	  Lisp_Object val, overlay;
+
+	  pos = --IT_CHARPOS (it2);
+	  --IT_BYTEPOS (it2);
+	  it2.sp = 0;
+	  if (handle_display_prop (&it2) == HANDLED_RETURN
+	      && !NILP (val = get_char_property_and_overlay
+			(make_number (pos), Qdisplay, Qnil, &overlay))
+	      && (OVERLAYP (overlay)
+		  ? (beg = OVERLAY_POSITION (OVERLAY_START (overlay)))
+		  : get_property_and_range (pos, Qdisplay, &val, &beg, &end, Qnil)))
+	    {
+	      if (beg < BEGV)
+		beg = BEGV;
+	      IT_CHARPOS (*it) = beg;
+	      IT_BYTEPOS (*it) = buf_charpos_to_bytepos (current_buffer, beg);
+	      continue;
+	    }
+	}
+
       break;
     }
 
@@ -6424,7 +6430,11 @@
 	 value of nlines is > 0 if continuation lines were involved.  */
       if (nlines > 0)
 	move_it_by_lines (it, nlines, 1);
+#if 0
+      /* I think this assert is bogus if buffer contains
+	 invisible text or images.  KFS.  */
       xassert (IT_CHARPOS (*it) <= start_pos);
+#endif
     }
   else
     {
@@ -6442,7 +6452,8 @@
 	     a line height of 13 pixels each, recentering with point
 	     on the bottom line will try to move -39/2 = 19 pixels
 	     backward.  Try to avoid moving into the first line.  */
-	  && it->current_y - target_y > line_height * 2 / 3
+	  && (it->current_y - target_y
+	      > min (window_box_height (it->w), line_height * 2 / 3))
 	  && IT_CHARPOS (*it) > BEGV)
 	{
 	  TRACE_MOVE ((stderr, "  not far enough -> move_vert %d\n",
@@ -6472,7 +6483,11 @@
 	      while (target_y >= line_bottom_y (it) && IT_CHARPOS (*it) < ZV);
 	    }
 
+#if 0
+	  /* I think this assert is bogus if buffer contains
+	     invisible text or images.  KFS.  */
 	  xassert (IT_CHARPOS (*it) >= BEGV);
+#endif
 	}
     }
 }
@@ -11191,7 +11206,7 @@
    as if point had gone off the screen.  */
 
 static int
-make_cursor_line_fully_visible (w, force_p)
+cursor_row_fully_visible_p (w, force_p, current_matrix_p)
      struct window *w;
      int force_p;
 {
@@ -11207,7 +11222,7 @@
   if (w->cursor.vpos < 0)
     return 1;
 
-  matrix = w->desired_matrix;
+  matrix = current_matrix_p ? w->current_matrix : w->desired_matrix;
   row = MATRIX_ROW (matrix, w->cursor.vpos);
 
   /* If the cursor row is not partially visible, there's nothing to do.  */
@@ -11512,7 +11527,7 @@
 
       /* If cursor ends up on a partially visible line,
 	 treat that as being off the bottom of the screen.  */
-      if (! make_cursor_line_fully_visible (w, extra_scroll_margin_lines <= 1))
+      if (! cursor_row_fully_visible_p (w, extra_scroll_margin_lines <= 1, 0))
 	{
 	  clear_glyph_matrix (w->desired_matrix);
 	  ++extra_scroll_margin_lines;
@@ -11782,6 +11797,12 @@
 		  && CHARPOS (startp) != BEGV)
 		scroll_p = 1;
 	    }
+	  else
+	    {
+	      /* Cursor did not move.  So don't scroll even if cursor line
+		 is partially visible, as it was so before.  */
+		 rc = CURSOR_MOVEMENT_SUCCESS;
+	    }
 
 	  if (PT < MATRIX_ROW_START_CHARPOS (row)
 	      || PT > MATRIX_ROW_END_CHARPOS (row))
@@ -11789,7 +11810,8 @@
 	      /* if PT is not in the glyph row, give up.  */
 	      rc = CURSOR_MOVEMENT_MUST_SCROLL;
 	    }
-	  else if (MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row)
+	  else if (rc != CURSOR_MOVEMENT_SUCCESS
+		   && MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row)
 		   && make_cursor_line_fully_visible_p)
 	    {
 	      if (PT == MATRIX_ROW_END_CHARPOS (row)
@@ -11808,7 +11830,7 @@
 	      else
 		{
 		  set_cursor_from_row (w, row, w->current_matrix, 0, 0, 0, 0);
-		  if (!make_cursor_line_fully_visible (w, 0))
+		  if (!cursor_row_fully_visible_p (w, 0, 1))
 		    rc = CURSOR_MOVEMENT_MUST_SCROLL;
 		  else
 		    rc = CURSOR_MOVEMENT_SUCCESS;
@@ -11893,7 +11915,7 @@
   int temp_scroll_step = 0;
   int count = SPECPDL_INDEX ();
   int rc;
-  int centering_position;
+  int centering_position = -1;
   int last_line_misfit = 0;
 
   SET_TEXT_POS (lpoint, PT, PT_BYTE);
@@ -12139,7 +12161,7 @@
 	  new_vpos = window_box_height (w) / 2;
 	}
 
-      if (!make_cursor_line_fully_visible (w, 0))
+      if (!cursor_row_fully_visible_p (w, 0, 0))
 	{
 	  /* Point does appear, but on a line partly visible at end of window.
 	     Move it back to a fully-visible line.  */
@@ -12276,7 +12298,7 @@
 	    /* Forget any recorded base line for line number display.  */
 	    w->base_line_number = Qnil;
 
-	  if (!make_cursor_line_fully_visible (w, 1))
+	  if (!cursor_row_fully_visible_p (w, 1, 0))
 	    {
 	      clear_glyph_matrix (w->desired_matrix);
 	      last_line_misfit = 1;
@@ -12336,10 +12358,8 @@
   /* Finally, just choose place to start which centers point */
 
  recenter:
-  centering_position = window_box_height (w) / 2;
-
- point_at_top:
-  /* Jump here with centering_position already set to 0.  */
+  if (centering_position < 0)
+    centering_position = window_box_height (w) / 2;
 
 #if GLYPH_DEBUG
   debug_method_add (w, "recenter");
@@ -12436,7 +12456,7 @@
       set_cursor_from_row (w, row, w->current_matrix, 0, 0, 0, 0);
     }
 
-  if (!make_cursor_line_fully_visible (w, centering_position > 0))
+  if (!cursor_row_fully_visible_p (w, 0, 0))
     {
       /* If vscroll is enabled, disable it and try again.  */
       if (w->vscroll)
@@ -12451,9 +12471,10 @@
 	 visible, if it can be done.  */
       if (centering_position == 0)
 	goto done;
+
       clear_glyph_matrix (w->desired_matrix);
       centering_position = 0;
-      goto point_at_top;
+      goto recenter;
     }
 
  done:
@@ -13238,8 +13259,10 @@
 	 starts at a minimum position >= last_unchanged_pos_old.  */
       for (; row > first_text_row; --row)
 	{
+	  /* This used to abort, but it can happen.
+	     It is ok to just stop the search instead here.  KFS.  */
 	  if (!row->enabled_p || !MATRIX_ROW_DISPLAYS_TEXT_P (row))
-	    abort ();
+	    break;
 
 	  if (MATRIX_ROW_START_CHARPOS (row) >= last_unchanged_pos_old)
 	    row_found = row;
@@ -20901,7 +20924,7 @@
      have a STOP object and previous row's end glyph came from STOP.  */
   if (!NILP (stop))
     {
-      struct glyph_row *prev = row-1;
+      struct glyph_row *prev;
       while ((prev = row - 1, prev >= first)
 	     && MATRIX_ROW_END_CHARPOS (prev) == charpos
 	     && prev->used[TEXT_AREA] > 0)
@@ -20910,8 +20933,8 @@
 	  glyph = end + prev->used[TEXT_AREA];
 	  while (--glyph >= end
 		 && INTEGERP (glyph->object));
-	  if (glyph >= end
-	      && !EQ (stop, glyph->object))
+	  if (glyph < end
+	      || !EQ (stop, glyph->object))
 	    break;
 	  row = prev;
 	}
--- a/src/xfaces.c	Fri Feb 18 00:41:50 2005 +0000
+++ b/src/xfaces.c	Wed Feb 23 09:18:23 2005 +0000
@@ -4227,7 +4227,7 @@
 		}
 	      else if (EQ (k, QCcolor))
 		{
-		  if (!STRINGP (v) || SCHARS (v) == 0)
+		  if (!NILP (v) && (!STRINGP (v) || SCHARS (v) == 0))
 		    break;
 		}
 	      else if (EQ (k, QCstyle))