changeset 90037:0fe073a08cef

Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-65 Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-634 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-639 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-640 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-641 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-59 - miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-60 Update from CVS
author Miles Bader <miles@gnu.org>
date Wed, 27 Oct 2004 05:42:04 +0000
parents af754c88f187 (current diff) c0675c413aa3 (diff)
children 3a5b83e18d41
files etc/NEWS lisp/ChangeLog lisp/calc/calc-incom.el lisp/calc/calc-misc.el lisp/calc/calc-rewr.el lisp/calc/calc.el lisp/files.el lisp/find-file.el lisp/gnus/ChangeLog lisp/gnus/gnus-start.el lisp/help.el lisp/ibuf-ext.el lisp/ibuffer.el lisp/imenu.el lisp/indent.el lisp/info.el lisp/man.el lisp/menu-bar.el lisp/mouse-sel.el lisp/net/tramp-vc.el lisp/net/tramp.el lisp/pcomplete.el lisp/progmodes/asm-mode.el lisp/progmodes/gdb-ui.el lisp/simple.el lisp/subr.el lisp/textmodes/sgml-mode.el lisp/textmodes/tex-mode.el lisp/vc.el lisp/woman.el lispref/ChangeLog lispref/commands.texi lispref/minibuf.texi lispref/processes.texi lispref/text.texi lispref/windows.texi man/ChangeLog man/text.texi nt/INSTALL src/ChangeLog src/buffer.c src/callint.c src/fontset.c src/gtkutil.c src/regex.c src/regex.h src/xfns.c src/xsmfns.c
diffstat 52 files changed, 1629 insertions(+), 497 deletions(-) [+]
line wrap: on
line diff
--- a/etc/NEWS	Tue Oct 26 01:28:28 2004 +0000
+++ b/etc/NEWS	Wed Oct 27 05:42:04 2004 +0000
@@ -174,6 +174,12 @@
 * Changes in Emacs 21.4
 
 +++
+** `set-auto-mode' now gives the interpreter magic line (if present)
+precedence over the file name.  Likewise an <?xml or <!DOCTYPE declaration
+will give the buffer XML or SGML mode, unless the file name leads to a mode in
+`xml-based-modes'.
+
++++
 ** New function `looking-back' checks whether a regular expression matches
 the text before point.  Specifying the LIMIT argument bounds how far
 back the match can start; this is a way to keep it from taking too long.
@@ -2127,6 +2133,8 @@
 
 * New modes and packages in Emacs 21.4
 
+** The new package password.el provide a password cache and expiring mechanism.
+
 ** The new package dns-mode.el add syntax highlight of DNS master files.
 The key binding C-c C-s (`dns-mode-soa-increment-serial') can be used
 to increment the SOA serial.
@@ -2363,6 +2371,14 @@
 * Lisp Changes in Emacs 21.4
 
 +++
+** An interactive specification may now use the code letter 'U' to get
+the up-event that was discarded in case the last key sequence read for a
+previous 'k' or 'K' argument was a down-event; otherwise nil is used.
+
+** Function `translate-region' accepts also a char-table as TABLE
+argument.
+
++++
 ** Major mode functions now run the new normal hook
 `after-change-major-mode-hook', at their very end, after the mode hooks.
 
@@ -3578,6 +3594,11 @@
 +++
 ** New function `call-process-shell-command'.
 
+** New function `process-file'.
+
+This is similar to `call-process', but obeys file handlers.  The file
+handler is chosen based on default-directory.
+
 ---
 ** The dummy function keys made by easymenu
 are now always lower case.  If you specify the
--- a/lisp/ChangeLog	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/ChangeLog	Wed Oct 27 05:42:04 2004 +0000
@@ -1,13 +1,166 @@
+2004-10-26  Daniel Pfeiffer  <occitan@esperanto.org>
+
+	* files.el (auto-mode-alist): Add pod, js, xbm and xpm and group
+	trivial variants to shorten the list.
+	(xml-based-modes): New var.
+	(set-auto-mode): Give interpreter-mode-alist or <?xml or <!DOCTYPE
+	declaration higher priority than auto-mode-alist.
+
+	* find-file.el (cc-other-file-alist): Bring it in line with
+	cc-mode's auto-mode-alist entries and use \' instead of $.
+
+	* textmodes/sgml-mode.el (sgml-mode): Fix imenu-generic-expression
+	and add "Id" and "Name" submenus to it.
+
+	* imenu.el (imenu--generic-function): Skip matches in comments.
+
+2004-10-26  Jay Belanger  <belanger@truman.edu>
+
+	* calc/calc.el (calc,full-calc, calc-quit, calc-keypad)
+	(full-calc-keypad, calc-trail-display):  Use an extra argument
+	instead of `interactive-p'.
+
+	* calc/calc-misc.el (calc-other-window): Use an extra argument
+	instead of `interactive-p'.
+
+	* calc/calc-rewr.el (calc-match): Use an extra argument instead of
+	`interactive-p'.
+
+2004-10-26  Kim F. Storm  <storm@cua.dk>
+
+	* help.el (describe-key): Describe both down-event and up-event
+	for a mouse click.
+
+2004-10-26  Richard M. Stallman  <rms@gnu.org>
+
+	* woman.el (woman): Don't call interactive-p.
+
+	* pcomplete.el (pcomplete): Instead of interactive-p,
+	use an arg set non-nil by the interactive spec.
+
+	* menu-bar.el (menu-bar-make-toggle): Instead of interactive-p,
+	use an arg set non-nil by the interactive spec.
+
+	* man.el (Man-cleanup-manpage): Instead of interactive-p,
+	use an arg set non-nil by the interactive spec.
+
+2004-10-26  Pavel Kobiakov  <pk_at_work@yahoo.com>
+
+	* progmodes/flymake.el (flymake-split-string): Use
+	`flymake-split-string-remove-empty-edges' in any case.
+
+2004-10-26  Masatake YAMATO  <jet@gyve.org>
+
+	* progmodes/flymake.el (flymake-err-line-patterns):
+	Use `compilation-error-regexp-alist-alist' instead of
+	`compilation-error-regexp-alist'.
+
+2004-10-25  Jay Belanger  <belanger@truman.edu>
+
+	* calc/calc-incom.el (calc-digit-dots):  Inhibit read-only before
+	erasing minibuffer.
+
+2004-10-25  Simon Josefsson  <jas@extundo.com>
+
+	* subr.el (read-passwd): Move to net/password.el.
+
+	* net/password.el (read-passwd): Add.  Autoload it.
+
+2004-10-25  Kai Grossjohann  <kai.grossjohann@gmx.net>
+
+	* mouse-sel.el (mouse-sel-mode): Specify custom group.
+
+	* simple.el (process-file): Fix logic.
+
+2004-10-24  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* indent.el (set-left-margin, set-right-margin): Delete redundant code.
+	(increase-right-margin): Remove erroneous call to `interactive-p'.
+
+2004-10-24  Kim F. Storm  <storm@cua.dk>
+
+	* help.el (describe-mode): Fix 2004-10-13 change.
+	Copy pure "Auto Fill" string so it can be propertized later
+	without causing a read-only error.
+
+2004-10-24  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* info.el (Info-find-emacs-command-nodes): Adapt to Texinfo-4.7
+	style indexes.
+
+2004-10-24  Kai Grossjohann  <kai.grossjohann@gmx.net>
+
+	* simple.el (process-file): Accept nil for INFILE.  Reported by
+	Luc Teirlinck.
+
+2004-10-24  Masatake YAMATO  <jet@gyve.org>
+
+	* progmodes/gdb-ui.el (gdb-assembler-font-lock-keywords):
+	Handle periods and underscores in a function name.
+	Remove the address fontification.
+
+2004-10-24 Masatake YAMATO <jet@gyve.org>
+
+	* progmodes/asm-mode.el (asm-font-lock-keywords):
+	Use font-lock-variable-name-face for registers.
+
+2004-10-24  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gdb-ui.el (gdb-get-create-buffer): Allow modes to run
+	kill-all-local-variables.
+	(gdb-breakpoints-mode, gdb-frames-mode, gdb-threads-mode)
+	(gdb-registers-mode, gdb-locals-mode, gdb-assembler-mode):
+	Use kill-all-local-variables and provide mode-hooks.
+	(gdb-assembler-font-lock-keywords): New font lock keywords definition.
+	(gdb-assembler-mode): Use 'gdb-assembler-font-lock-keywords'.
+	Suggested by Masatake YAMATO <jet@gyve.org>.
+
+2004-10-23  Kai Grossjohann  <kai.grossjohann@gmx.net>
+
+	* simple.el (process-file): New function, similar to call-process
+	but supports file handlers.
+	* vc.el (vc-do-command): Use it, instead of call-process.
+	* net/tramp-vc.el (vc-do-command): Do not advise it if
+	process-file is fboundp.
+	* net/tramp.el (tramp-file-name-handler-alist): Add entry for
+	process-file.
+	(tramp-handle-process-file): New function.
+	(tramp-file-name-for-operation): Support process-file.
+
+2004-10-23  Ulf Jasper  <ulf.jasper@web.de>
+
+	* calendar/icalendar.el (icalendar--weekday-array): New constant.
+	(icalendar-weekdayabbrev-table)
+	(icalendar-monthnumber-table): Delete.
+	(icalendar--get-month-number): Use calendar-month-name-array.
+	(icalendar--get-weekday-number): New function.
+	(icalendar--get-weekday-abbrev) Use calendar-day-name-array.
+	(icalendar-export-region): Handle multi-line entries.
+	(icalendar--convert-ical-to-diary): Use calendar-day-name-array.
+
+2004-10-23  John Paul Wallington  <jpw@gnu.org>
+
+	* ibuffer.el (ibuffer-find-file): Remove `interactive-p' call;
+	`wildcards' set to t in interactive spec.
+
+	* ibuf-ext.el (ibuffer-jump-to-buffer): Read buffer name in
+	interactive spec rather than use `interactive-p'.
+	(ibuffer-kill-line): Set arg `interactive-p' in interactive spec
+	rather than use function `interactive-p'.
+
 2004-10-21  Jay Belanger  <belanger@truman.edu>
 
 	* calc/calc-aent.el (calc-alg-ent-map, calc-alg-ent-esc-map):
-	Declared these variables with defvar.
+	Declare these variables with defvar.
 
 	* calc/calc-aent.el (calc-do-alg-entry): Since `calc-alg-ent-map'
 	is bound, only check to see if it is bound.
 
 2004-10-21  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+	* textmodes/tex-mode.el (tex-compilation-parse-errors):
+	Don't output messages.
+
 	* calc/calc-help.el (calc-describe-bindings): Fix last change.
 
 2004-10-21  John Paul Wallington  <jpw@gnu.org>
@@ -245,6 +398,13 @@
 
 	* net/password.el: Add.
 
+2004-10-14  Masatake YAMATO  <jet@gyve.org>
+
+	* progmodes/gud.el (gdb-script-beginning-of-defun): New function.
+	(gdb-script-end-of-defun): New function.
+	(gdb-script-mode): Use `gdb-script-beginning-of-defun' and
+	`gdb-script-end-of-defun' as *-of-defun-function.
+
 2004-10-13  Daniel Pfeiffer  <occitan@esperanto.org>
 
 	* button.el (button-activate): Allow a marker to display as an action.
@@ -254,13 +414,6 @@
 	* help.el (describe-mode): Use it to make minor mode list into
 	hyperlinks.
 
-2004-10-14  Masatake YAMATO  <jet@gyve.org>
-
-	* progmodes/gud.el (gdb-script-beginning-of-defun): New function.
-	(gdb-script-end-of-defun): New function.
-	(gdb-script-mode): Use `gdb-script-beginning-of-defun' and
-	`gdb-script-end-of-defun' as *-of-defun-function.
-
 2004-10-13  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* vc.el (vc-annotate-display-select): Fix typo.
@@ -564,6 +717,15 @@
 	* diff-mode.el (diff-file-header-re): Tighten up regexp a tiny bit.
 	(diff-fixup-modifs): Catch unified-diff file-headers.
 
+2004-09-29  Kim F. Storm  <storm@cua.dk>
+
+	* progmodes/gdb-ui.el (breakpoint): Define as fringe bitmap.
+	(gdb-mouse-toggle-breakpoint): Fix fringe-bitmaps-at-pos usage.
+	(gdb-put-breakpoint-icon): Use breakpoint bitmap.
+
+	* fringe.el (fringe-bitmap-p): New macro.
+	(fringe-bitmaps): Add standard fringe bitmaps on load.
+
 2004-09-28  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* dired.el (dired-view-command-alist): Use more efficient regexps.
@@ -573,15 +735,6 @@
 	(dired-move-to-end-of-filename): Make the " -> " search more specific.
 	(dired-buffers-for-dir): Remove unused var `pattern'.
 
-2004-09-29  Kim F. Storm  <storm@cua.dk>
-
-	* progmodes/gdb-ui.el (breakpoint): Define as fringe bitmap.
-	(gdb-mouse-toggle-breakpoint): Fix fringe-bitmaps-at-pos usage.
-	(gdb-put-breakpoint-icon): Use breakpoint bitmap.
-
-	* fringe.el (fringe-bitmap-p): New macro.
-	(fringe-bitmaps): Add standard fringe bitmaps on load.
-
 2004-09-28  Matthew Mundell  <matt@mundell.ukfsn.org>  (tiny change)
 
 	* calendar/diary-lib.el (list-diary-entries): Save diary buffer
@@ -720,7 +873,7 @@
 
 	* calc/calc-graph.el (calc-graph-add-curve): Moved the call to
 	`calc-graph-set-styles' so the gnuplot buffer will appear in a
-	separate window. 
+	separate window.
 
 2004-09-21  Luc Teirlinck  <teirllm@auburn.edu>
 
@@ -737,7 +890,7 @@
 	fixed.
 
 2004-09-21  Jay Belanger  <belanger@truman.edu>
-	
+
 	* calc/calc.el (calc-mode-var-list): Removed unnecessary quotes.
 
 2004-09-20  Luc Teirlinck  <teirllm@auburn.edu>
@@ -828,8 +981,8 @@
 2004-09-17  Jay Belanger  <belanger@truman.edu>
 
 	* calc/calc.el (calc-mode-var-list): Fixed the value of
-	`calc-matrix-brackets'. 
-	
+	`calc-matrix-brackets'.
+
 2004-09-17  Romain Francoise  <romain@orebokech.com>
 
 	* ibuf-ext.el (define-ibuffer-filter filename):
--- a/lisp/calc/calc-incom.el	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/calc/calc-incom.el	Wed Oct 27 05:42:04 2004 +0000
@@ -183,7 +183,8 @@
 	(if calc-prev-prev-char
 	    (calcDigit-nondigit)
 	  (setq calc-digit-value nil)
-	  (erase-buffer)
+          (let ((inhibit-read-only t))
+            (erase-buffer))
 	  (exit-minibuffer)))
     ;; just ignore extra decimal point, anticipating ".."
     (delete-backward-char 1)))
--- a/lisp/calc/calc-misc.el	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/calc/calc-misc.el	Wed Oct 27 05:42:04 2004 +0000
@@ -130,9 +130,9 @@
 		 "Now using full screen for Calc"
 	       "Now using partial screen for Calc"))))
 
-(defun calc-other-window ()
+(defun calc-other-window (&optional interactive)
   "Invoke the Calculator in another window."
-  (interactive)
+  (interactive "p")
   (if (memq major-mode '(calc-mode calc-trail-mode))
       (progn
 	(other-window 1)
@@ -141,7 +141,7 @@
     (if (get-buffer-window "*Calculator*")
 	(calc-quit)
       (let ((win (selected-window)))
-	(calc nil win (interactive-p))))))
+	(calc nil win interactive)))))
 
 (defun another-calc ()
   "Create another, independent Calculator buffer."
--- a/lisp/calc/calc-rewr.el	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/calc/calc-rewr.el	Wed Oct 27 05:42:04 2004 +0000
@@ -143,15 +143,15 @@
      (calc-pop-push-record-list n "rwrt" (list expr)))
    (calc-handle-whys)))
 
-(defun calc-match (pat)
-  (interactive "sPattern: \n")
+(defun calc-match (pat &optional interactive)
+  (interactive "sPattern: \np")
   (calc-slow-wrapper
    (let (n expr)
      (if (or (null pat) (equal pat "") (equal pat "$"))
 	 (setq expr (calc-top-n 2)
 	       pat (calc-top-n 1)
 	       n 2)
-       (if (interactive-p) (setq calc-previous-alg-entry pat))
+       (if interactive (setq calc-previous-alg-entry pat))
        (setq pat (if (stringp pat) (math-read-expr pat) pat))
        (if (eq (car-safe pat) 'error)
 	   (error "Bad format in expression: %s" (nth 1 pat)))
--- a/lisp/calc/calc.el	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/calc/calc.el	Wed Oct 27 05:42:04 2004 +0000
@@ -1142,7 +1142,7 @@
 ;;;###autoload
 (defun calc (&optional arg full-display interactive)
   "The Emacs Calculator.  Full documentation is listed under \"calc-mode\"."
-  (interactive "P")
+  (interactive "P\ni\np")
   (if arg
       (unless (eq arg 0)
 	(calc-extensions)
@@ -1188,17 +1188,16 @@
 	     (window-point full-display)
 	     (select-window full-display))
 	(calc-check-defines)
-	(when (and calc-said-hello
-		   (or (interactive-p) interactive))
+	(when (and calc-said-hello interactive)
 	  (sit-for 2)
 	  (message ""))
 	(setq calc-said-hello t)))))
 
 ;;;###autoload
-(defun full-calc ()
+(defun full-calc (&optional interactive)
   "Invoke the Calculator and give it a full-sized window."
-  (interactive)
-  (calc nil t (interactive-p)))
+  (interactive "p")
+  (calc nil t interactive))
 
 (defun calc-same-interface (arg)
   "Invoke the Calculator using the most recent interface (calc or calc-keypad)."
@@ -1215,8 +1214,8 @@
 	  (calc arg calc-full-mode t))))))
 
 
-(defun calc-quit (&optional non-fatal)
-  (interactive)
+(defun calc-quit (&optional non-fatal interactive)
+  (interactive "i\np")
   (and calc-standalone-flag (not non-fatal)
        (save-buffers-kill-emacs nil))
   (if (and (equal (buffer-name) "*Gnuplot Trail*")
@@ -1226,7 +1225,7 @@
       (calc-edit-cancel)
     (if (eq major-mode 'MacEdit-mode)
 	(MacEdit-cancel-edit)
-      (if (and (interactive-p)
+      (if (and interactive
 	       calc-embedded-info
 	       (eq (current-buffer) (aref calc-embedded-info 0)))
 	  (calc-embedded nil)
@@ -1266,22 +1265,22 @@
   (calc-do-calc-eval str separator args))
 
 ;;;###autoload
-(defun calc-keypad ()
+(defun calc-keypad (&optional interactive)
   "Invoke the Calculator in \"visual keypad\" mode.
 This is most useful in the X window system.
 In this mode, click on the Calc \"buttons\" using the left mouse button.
 Or, position the cursor manually and do M-x calc-keypad-press."
-  (interactive)
+  (interactive "p")
   (calc-extensions)
-  (calc-do-keypad calc-full-mode (interactive-p)))
+  (calc-do-keypad calc-full-mode interactive))
 
 ;;;###autoload
-(defun full-calc-keypad ()
+(defun full-calc-keypad (&optional interactive)
   "Invoke the Calculator in full-screen \"visual keypad\" mode.
 See calc-keypad for details."
-  (interactive)
+  (interactive "p")
   (calc-extensions)
-  (calc-do-keypad t (interactive-p)))
+  (calc-do-keypad t interactive))
 
 
 (defvar calc-aborted-prefix nil)
@@ -1802,8 +1801,8 @@
   val)
 
 
-(defun calc-trail-display (flag &optional no-refresh)
-  (interactive "P")
+(defun calc-trail-display (flag &optional no-refresh interactive)
+  (interactive "P\ni\np")
   (let ((win (get-buffer-window (calc-trail-buffer))))
     (if (setq calc-display-trail
 	      (not (if flag (memq flag '(nil 0)) win)))
@@ -1817,7 +1816,7 @@
 	       (setq overlay-arrow-string calc-trail-overlay
 		     overlay-arrow-position calc-trail-pointer)
 	       (or no-refresh
-		   (if (interactive-p)
+		   (if interactive
 		       (calc-do-refresh)
 		     (calc-refresh))))))
       (if win
@@ -1825,7 +1824,7 @@
 	    (delete-window win)
 	    (calc-wrapper
 	     (or no-refresh
-		 (if (interactive-p)
+		 (if interactive
 		     (calc-do-refresh)
 		   (calc-refresh))))))))
   calc-trail-buffer)
--- a/lisp/calendar/icalendar.el	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/calendar/icalendar.el	Wed Oct 27 05:42:04 2004 +0000
@@ -39,6 +39,8 @@
 ;;        Added icalendar-export-region.
 ;;        The import and export commands do not clear their target file,
 ;;        but append their results to the target file.
+;;        I18n-problems fixed -- use calendar-(month|day)-name-array.
+;;        Fixed problems with export of multi-line diary entries.
 
 ;;  0.06: Bugfixes regarding icalendar-import-format-*.
 ;;        Fix in icalendar-convert-diary-to-ical -- thanks to Philipp
@@ -167,31 +169,7 @@
 ;; NO USER SERVICABLE PARTS BELOW THIS LINE
 ;; ======================================================================
 
-(defconst icalendar-weekdayabbrev-table
-  '(("mon\\(day\\)?"    . "MO")
-    ("tue\\(sday\\)?"   . "TU")
-    ("wed\\(nesday\\)?" . "WE")
-    ("thu\\(rsday\\)?"  . "TH")
-    ("fri\\(day\\)?"    . "FR")
-    ("sat\\(urday\\)?"  . "SA")
-    ("sun\\(day\\)?"    . "SU"))
-  "Translation table for weekdays.")
-
-(defconst icalendar-monthnumber-table
-  '(("^jan\\(uar\\)?y?$"       . 1)
-    ("^feb\\(ruar\\)?y?$"      . 2)
-    ("^mar\\(ch\\)?\\|märz$"   . 3)
-    ("^apr\\(il\\)?$"          . 4)
-    ("^ma[iy]$"                . 5)
-    ("^jun[ie]?$"              . 6)
-    ("^jul[iy]?$"              . 7)
-    ("^aug\\(ust\\)?$"         . 8)
-    ("^sep\\(tember\\)?$"      . 9)
-    ("^o[ck]t\\(ober\\)?$"     . 10)
-    ("^nov\\(ember\\)?$"       . 11)
-    ("^de[cz]\\(ember\\)?$"    . 12))
-  "Regular expressions for month names.
-Currently this matches only German and English.")
+(defconst icalendar--weekday-array ["SU" "MO" "TU" "WE" "TH" "FR" "SA"])
 
 (defvar icalendar-debug nil ".")
 
@@ -511,18 +489,47 @@
 
 (defun icalendar--get-month-number (monthname)
   "Return the month number for the given MONTHNAME."
-  (save-match-data
-    (let ((case-fold-search t))
-      (assoc-default monthname icalendar-monthnumber-table
-                     'string-match))))
+  (catch 'found
+    (let ((num 1)
+          (m (downcase monthname)))
+      (mapc (lambda (month)
+              (let ((mm (downcase month)))
+                (if (or (string-equal mm m)
+                        (string-equal (substring mm 0 3) m))
+                    (throw 'found num))
+                (setq num (1+ num))))
+            calendar-month-name-array))
+    ;; Error:
+    -1))
+
+(defun icalendar--get-weekday-number (abbrevweekday)
+  "Return the number for the ABBREVWEEKDAY."
+  (catch 'found
+    (let ((num 0)
+          (aw (downcase abbrevweekday)))
+      (mapc (lambda (day)
+              (let ((d (downcase day)))
+                (if (string-equal d aw)
+                    (throw 'found num))
+                (setq num (1+ num))))
+            icalendar--weekday-array))
+    ;; Error:
+    -1))
 
 (defun icalendar--get-weekday-abbrev (weekday)
   "Return the abbreviated WEEKDAY."
-  ;;FIXME: ISO-like(?).
-  (save-match-data
-    (let ((case-fold-search t))
-      (assoc-default weekday icalendar-weekdayabbrev-table
-                     'string-match))))
+  (catch 'found
+    (let ((num 0)
+          (w (downcase weekday)))
+      (mapc (lambda (day)
+              (let ((d (downcase day)))
+                (if (or (string-equal d w)
+                        (string-equal (substring d 0 3) w))
+                    (throw 'found (aref icalendar--weekday-array num)))
+                (setq num (1+ num))))
+            calendar-day-name-array))
+    ;; Error:
+    "??"))
 
 (defun icalendar--datestring-to-isodate (datestring &optional day-shift)
   "Convert diary-style DATESTRING to iso-style date.
@@ -648,7 +655,7 @@
     (save-excursion
       (goto-char min)
       (while (re-search-forward
-              "^\\([^ \t\n].*\\)\\(\n[ \t].*\\)*" max t)
+              "^\\([^ \t\n].*\\)\\(\\(\n[ \t].*\\)*\\)" max t)
         (setq entry-main (match-string 1))
         (if (match-beginning 2)
             (setq entry-rest (match-string 2))
@@ -1171,13 +1178,13 @@
                          ;; weekly and not all-day
                          (let* ((byday (cadr (assoc 'BYDAY rrule-props)))
                                 (weekday
-                                 (cdr (rassoc
-                                       byday
-                                       icalendar-weekdayabbrev-table))))
+                                 (icalendar--get-weekday-number byday)))
                            (icalendar--dmsg "weekly not-all-day")
-                           (if weekday
+                           (if (> weekday -1)
                                (setq diary-string
-                                     (format "%s %s%s%s" weekday
+                                     (format "%s %s%s%s"
+                                             (aref calendar-day-name-array
+ 						   weekday)
                                              start-t (if end-t "-" "")
                                              (or end-t "")))
                              ;; FIXME!!!!
--- a/lisp/files.el	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/files.el	Wed Oct 27 05:42:04 2004 +0000
@@ -1646,40 +1646,33 @@
    (lambda (elt)
      (cons (purecopy (car elt)) (cdr elt)))
    '(("\\.te?xt\\'" . text-mode)
-     ("\\.tex\\'" . tex-mode)
+     ("\\.[tT]e[xX]\\'" . tex-mode)
      ("\\.ins\\'" . tex-mode)		;Installation files for TeX packages.
      ("\\.ltx\\'" . latex-mode)
      ("\\.dtx\\'" . doctex-mode)
      ("\\.el\\'" . emacs-lisp-mode)
      ("\\.\\(scm\\|stk\\|ss\\|sch\\)\\'" . scheme-mode)
      ("\\.l\\'" . lisp-mode)
-     ("\\.lisp\\'" . lisp-mode)
-     ("\\.f\\'" . fortran-mode)
-     ("\\.F\\'" . fortran-mode)
+     ("\\.li?sp\\'" . lisp-mode)
+     ("\\.[fF]\\'" . fortran-mode)
      ("\\.for\\'" . fortran-mode)
      ("\\.p\\'" . pascal-mode)
      ("\\.pas\\'" . pascal-mode)
      ("\\.ad[abs]\\'" . ada-mode)
      ("\\.ad[bs].dg\\'" . ada-mode)
-     ("\\.\\([pP]\\([Llm]\\|erl\\)\\|al\\)\\'" . perl-mode)
+     ("\\.\\([pP]\\([Llm]\\|erl\\|od\\)\\|al\\)\\'" . perl-mode)
      ("\\.s?html?\\'" . html-mode)
      ("\\.mk\\'" . makefile-mode)
-     ("\\(M\\|m\\|GNUm\\)akefile\\'" . makefile-mode)
+     ("\\([Mm]\\|GNUm\\)akep*file\\'" . makefile-mode)
      ("\\.am\\'" . makefile-mode)	;For Automake.
      ;; Less common extensions come here
      ;; so more common ones above are found faster.
      ("\\.texinfo\\'" . texinfo-mode)
      ("\\.te?xi\\'" . texinfo-mode)
-     ("\\.s\\'" . asm-mode)
-     ("\\.S\\'" . asm-mode)
+     ("\\.[sS]\\'" . asm-mode)
      ("\\.asm\\'" . asm-mode)
-     ("ChangeLog\\'" . change-log-mode)
-     ("change\\.log\\'" . change-log-mode)
-     ("changelo\\'" . change-log-mode)
-     ("ChangeLog\\.[0-9]+\\'" . change-log-mode)
-     ;; for MSDOS and MS-Windows (which are case-insensitive)
-     ("changelog\\'" . change-log-mode)
-     ("changelog\\.[0-9]+\\'" . change-log-mode)
+     ("[cC]hange\\.?[lL]og?\\'" . change-log-mode)
+     ("[cC]hange[lL]og\\.[0-9]+\\'" . change-log-mode)
      ("\\$CHANGE_LOG\\$\\.TXT" . change-log-mode)
      ("\\.scm\\.[0-9]*\\'" . scheme-mode)
      ("\\.[ck]?sh\\'\\|\\.shar\\'\\|/\\.z?profile\\'" . sh-mode)
@@ -1688,36 +1681,27 @@
      ("\\(/\\|\\`\\)\\.\\(bash_logout\\|shrc\\|[kz]shrc\\|bashrc\\|t?cshrc\\|esrc\\)\\'" . sh-mode)
      ("\\(/\\|\\`\\)\\.\\([kz]shenv\\|xinitrc\\|startxrc\\|xsession\\)\\'" . sh-mode)
      ("\\.m?spec\\'" . sh-mode)
-     ("\\.mm\\'" . nroff-mode)
-     ("\\.me\\'" . nroff-mode)
-     ("\\.ms\\'" . nroff-mode)
+     ("\\.m[mes]\\'" . nroff-mode)
      ("\\.man\\'" . nroff-mode)
-     ("\\.TeX\\'" . tex-mode)
      ("\\.sty\\'" . latex-mode)
-     ("\\.cls\\'" . latex-mode)		;LaTeX 2e class
-     ("\\.clo\\'" . latex-mode)		;LaTeX 2e class option
+     ("\\.cl[so]\\'" . latex-mode)		;LaTeX 2e class option
      ("\\.bbl\\'" . latex-mode)
      ("\\.bib\\'" . bibtex-mode)
      ("\\.sql\\'" . sql-mode)
-     ("\\.m4\\'" . m4-mode)
-     ("\\.mc\\'" . m4-mode)
-     ("\\.mf\\'" . metafont-mode)
-     ("\\.mp\\'" . metapost-mode)
+     ("\\.m[4c]\\'" . m4-mode)
+     ("\\.m[fp]\\'" . metapost-mode)
      ("\\.vhdl?\\'" . vhdl-mode)
      ("\\.article\\'" . text-mode)
      ("\\.letter\\'" . text-mode)
-     ("\\.tcl\\'" . tcl-mode)
+     ("\\.i?tcl\\'" . tcl-mode)
      ("\\.exp\\'" . tcl-mode)
-     ("\\.itcl\\'" . tcl-mode)
      ("\\.itk\\'" . tcl-mode)
      ("\\.icn\\'" . icon-mode)
      ("\\.sim\\'" . simula-mode)
      ("\\.mss\\'" . scribe-mode)
-     ("\\.f90\\'" . f90-mode)
-     ("\\.f95\\'" . f90-mode)
+     ("\\.f9[05]\\'" . f90-mode)
      ("\\.indent\\.pro\\'" . fundamental-mode) ; to avoid idlwave-mode
      ("\\.pro\\'" . idlwave-mode)
-     ("\\.lsp\\'" . lisp-mode)
      ("\\.prolog\\'" . prolog-mode)
      ("\\.tar\\'" . tar-mode)
      ("\\.\\(arc\\|zip\\|lzh\\|zoo\\|ear\\|jar\\|war\\)\\'" . archive-mode)
@@ -1733,10 +1717,11 @@
      ("\\`/tmp/fol/" . text-mode)
      ("\\.oak\\'" . scheme-mode)
      ("\\.sgml?\\'" . sgml-mode)
-     ("\\.xml\\'" . sgml-mode)
-     ("\\.xsl\\'" . sgml-mode)
+     ("\\.x[ms]l\\'" . xml-mode)
      ("\\.dtd\\'" . sgml-mode)
      ("\\.ds\\(ss\\)?l\\'" . dsssl-mode)
+     ("\\.js\\'" . java-mode)		; javascript-mode would be better
+     ("\\.x[bp]m\\'" . c-mode)
      ;; .emacs or .gnus or .viper following a directory delimiter in
      ;; Unix, MSDOG or VMS syntax.
      ("[]>:/\\]\\..*\\(emacs\\|gnus\\|viper\\)\\'" . emacs-lisp-mode)
@@ -1760,7 +1745,7 @@
      ;; or .#<file>.<rev>-<rev> or VC's <file>.~<rev>~.
      ;; Using mode nil rather than `ignore' would let the search continue
      ;; through this list (with the shortened name) rather than start over.
-     ("\\.~?[0-9]+\\.[0-9][-.0-9]*~?\\'" ignore t)
+     ("\\.~?[0-9]+\\.[0-9][-.0-9]*~?\\'" nil t)
      ;; The following should come after the ChangeLog pattern
      ;; for the sake of ChangeLog.1, etc.
      ;; and after the .scm.[0-9] and CVS' <file>.<rev> patterns too.
@@ -1849,12 +1834,20 @@
 regular expression.  The mode is then determined as the mode associated
 with that interpreter in `interpreter-mode-alist'.")
 
+(defvar xml-based-modes '(html-mode)
+  "Modes that override an XML declaration.
+When `set-auto-mode' sees an <?xml or <!DOCTYPE declaration, that
+buffer will be in some XML mode.  If `auto-mode-alist' associates
+the file with one of the modes in this list, that mode will be
+used.  Else `xml-mode' or `sgml-mode' is used.")
+
 (defun set-auto-mode (&optional just-from-file-name)
   "Select major mode appropriate for current buffer.
-This checks for a -*- mode tag in the buffer's text,
-compares the filename against the entries in `auto-mode-alist',
-or checks the interpreter that runs this file against
-`interpreter-mode-alist'.
+This checks for a -*- mode tag in the buffer's text, checks the
+interpreter that runs this file against `interpreter-mode-alist',
+looks for an <?xml or <!DOCTYPE declaration (see
+`xml-based-modes'), or compares the filename against the entries
+in `auto-mode-alist'.
 
 It does not check for the `mode:' local variable in the
 Local Variables section of the file; for that, use `hack-local-variables'.
@@ -1866,87 +1859,84 @@
 then we do not set anything but the major mode,
 and we don't even do that unless it would come from the file name."
   ;; Look for -*-MODENAME-*- or -*- ... mode: MODENAME; ... -*-
-  (let (end done modes)
-    (save-excursion
-      (goto-char (point-min))
-      (skip-chars-forward " \t\n")
-      (and enable-local-variables
-	   (setq end (set-auto-mode-1))
-	   (if (save-excursion (search-forward ":" end t))
-	       ;; Find all specifications for the `mode:' variable
-	       ;; and execute them left to right.
-	       (while (let ((case-fold-search t))
-			(or (and (looking-at "mode:")
-				 (goto-char (match-end 0)))
-			    (re-search-forward "[ \t;]mode:" end t)))
-		 (skip-chars-forward " \t")
-		 (let ((beg (point)))
-		   (if (search-forward ";" end t)
-		       (forward-char -1)
-		     (goto-char end))
-		   (skip-chars-backward " \t")
-		   (push (intern (concat (downcase (buffer-substring beg (point))) "-mode"))
-			 modes)))
-	     ;; Simple -*-MODE-*- case.
-	     (push (intern (concat (downcase (buffer-substring (point) end))
-				   "-mode"))
-		   modes))))
-    ;; If we found modes to use, invoke them now,
-    ;; outside the save-excursion.
+  (let (end done mode modes xml)
     (unless just-from-file-name
-      (dolist (mode (nreverse modes))
-	(if (not (functionp mode))
-	    (message "Ignoring unknown mode `%s'" mode)
-	  (setq done t)
-	  (funcall mode))))
-    ;; If we didn't find a mode from a -*- line, try using the file name.
+      ;; Find a -*- mode tag
+      (save-excursion
+	(goto-char (point-min))
+	(skip-chars-forward " \t\n")
+	;; While we're at this point, check xml for later.
+	(setq xml (looking-at "<\\?xml \\|<!DOCTYPE"))
+	(and enable-local-variables
+	     (setq end (set-auto-mode-1))
+	     (if (save-excursion (search-forward ":" end t))
+		 ;; Find all specifications for the `mode:' variable
+		 ;; and execute them left to right.
+		 (while (let ((case-fold-search t))
+			  (or (and (looking-at "mode:")
+				   (goto-char (match-end 0)))
+			      (re-search-forward "[ \t;]mode:" end t)))
+		   (skip-chars-forward " \t")
+		   (let ((beg (point)))
+		     (if (search-forward ";" end t)
+			 (forward-char -1)
+		       (goto-char end))
+		     (skip-chars-backward " \t")
+		     (push (intern (concat (downcase (buffer-substring beg (point))) "-mode"))
+			   modes)))
+	       ;; Simple -*-MODE-*- case.
+	       (push (intern (concat (downcase (buffer-substring (point) end))
+				     "-mode"))
+		     modes))))
+      ;; If we found modes to use, invoke them now, outside the save-excursion.
+      (if modes
+	  (dolist (mode (nreverse modes))
+	    (if (not (functionp mode))
+		(message "Ignoring unknown mode `%s'" mode)
+	      (setq done t)
+	      (funcall mode)))
+	;; If we didn't, look for an interpreter specified in the first line.
+	;; As a special case, allow for things like "#!/bin/env perl", which
+	;; finds the interpreter anywhere in $PATH.
+	(setq mode (save-excursion
+		     (goto-char (point-min))
+		     (if (looking-at auto-mode-interpreter-regexp)
+			 (match-string 2)
+		       ""))
+	      ;; Map interpreter name to a mode, signalling we're done at the
+	      ;; same time.
+	      done (assoc (file-name-nondirectory mode)
+			  interpreter-mode-alist))
+	;; If we found an interpreter mode to use, invoke it now.
+	(if done (funcall (cdr done)))))
     (if (and (not done) buffer-file-name)
-	(let ((name buffer-file-name)
-	      (keep-going t))
+	(let ((name buffer-file-name))
 	  ;; Remove backup-suffixes from file name.
 	  (setq name (file-name-sans-versions name))
-	  (while keep-going
-	    (setq keep-going nil)
-	    (let ((alist auto-mode-alist)
-		  (mode nil))
-	      ;; Find first matching alist entry.
-	      (let ((case-fold-search
-		     (memq system-type '(vax-vms windows-nt cygwin))))
-		(while (and (not mode) alist)
-		  (if (string-match (car (car alist)) name)
-		      (if (and (consp (cdr (car alist)))
-			       (nth 2 (car alist)))
-			  (setq mode (car (cdr (car alist)))
-				name (substring name 0 (match-beginning 0))
-				keep-going t)
-			(setq mode (cdr (car alist))
-			      keep-going nil)))
-		  (setq alist (cdr alist))))
-	      (if mode
-		  ;; When JUST-FROM-FILE-NAME is set,
-		  ;; we are working on behalf of set-visited-file-name.
-		  ;; In that case, if the major mode specified is the
-		  ;; same one we already have, don't actually reset it.
-		  ;; We don't want to lose minor modes such as Font Lock.
-		  (unless (and just-from-file-name (eq mode major-mode))
-		    (funcall mode))
-		;; If we can't deduce a mode from the file name,
-		;; look for an interpreter specified in the first line.
-		;; As a special case, allow for things like "#!/bin/env perl",
-		;; which finds the interpreter anywhere in $PATH.
-		(let ((interpreter
-		       (save-excursion
-			 (goto-char (point-min))
-			 (if (looking-at auto-mode-interpreter-regexp)
-			     (match-string 2)
-			   "")))
-		      elt)
-		  ;; Map interpreter name to a mode.
-		  (setq elt (assoc (file-name-nondirectory interpreter)
-				   interpreter-mode-alist))
-		  (unless just-from-file-name
-		    (if elt
-			(funcall (cdr elt))))))))))))
+	  (while (not done)
+	    ;; Find first matching alist entry.
+	    (let ((case-fold-search
+		   (memq system-type '(vax-vms windows-nt cygwin))))
+	      (if (and (setq mode (assoc-default name auto-mode-alist
+						 'string-match))
+		       (consp mode)
+		       (cadr mode))
+		  (setq mode (car mode)
+			name (substring name 0 (match-beginning 0)))
+		(setq done t)))
+	    (if mode
+		;; When JUST-FROM-FILE-NAME is set, we are working on behalf
+		;; of set-visited-file-name.  In that case, if the major mode
+		;; specified is the same one we already have, don't actually
+		;; reset it.  We don't want to lose minor modes such as Font
+		;; Lock.
+		(unless (and just-from-file-name (eq mode major-mode))
+		  (if (if xml (memq mode xml-based-modes) t)
+		      (funcall mode)
+		    (xml-mode)))))))
+    (and (not done)
+	 xml
+	 (xml-mode))))
 
 
 (defun set-auto-mode-1 ()
@@ -2157,7 +2147,7 @@
 			(error "Local variables entry is missing the suffix")))
 		  (forward-line 1))
 		(goto-char (point-min))
-		  
+
 		(while (not (eobp))
 		  ;; Find the variable name; strip whitespace.
 		  (skip-chars-forward " \t")
--- a/lisp/find-file.el	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/find-file.el	Wed Oct 27 05:42:04 2004 +0000
@@ -57,7 +57,7 @@
 ;; format above can be changed to include a function to be called when the
 ;; current file matches the regexp:
 ;;
-;;   '(("\\.cc$"  cc-function)
+;;   '(("\\.cc$"  cc--function)
 ;;     ("\\.hh$"  hh-function))
 ;;
 ;; These functions must return a list consisting of the possible names of the
@@ -239,22 +239,26 @@
   :group 'ff)
 
 (defcustom cc-other-file-alist
-  '(
-    ("\\.cc$"  (".hh" ".h"))
-    ("\\.hh$"  (".cc" ".C"))
+  '(("\\.cc\\'"  (".hh" ".h"))
+    ("\\.hh\\'"  (".cc" ".C"))
 
-    ("\\.c$"   (".h"))
-    ("\\.h$"   (".c" ".cc" ".C" ".CC" ".cxx" ".cpp"))
+    ("\\.c\\'"   (".h"))
+    ("\\.h\\'"   (".c" ".cc" ".C" ".CC" ".cxx" ".cpp"))
+
+    ("\\.C\\'"   (".H"  ".hh" ".h"))
+    ("\\.H\\'"   (".C"  ".CC"))
 
-    ("\\.C$"   (".H"  ".hh" ".h"))
-    ("\\.H$"   (".C"  ".CC"))
+    ("\\.CC\\'"  (".HH" ".H"  ".hh" ".h"))
+    ("\\.HH\\'"  (".CC"))
+
+    ("\\.c\\+\\+\\'" (".h++" ".hh" ".h"))
+    ("\\.h\\+\\+\\'" (".c++"))
 
-    ("\\.CC$"  (".HH" ".H"  ".hh" ".h"))
-    ("\\.HH$"  (".CC"))
+    ("\\.cpp\\'" (".hpp" ".hh" ".h"))
+    ("\\.hpp\\'" (".cpp"))
 
-    ("\\.cxx$" (".hh" ".h"))
-    ("\\.cpp$" (".hh" ".h"))
-    )
+    ("\\.cxx\\'" (".hxx" ".hh" ".h"))
+    ("\\.hxx\\'" (".cxx")))
   "*Alist of extensions to find given the current file's extension.
 
 This list should contain the most used extensions before the others,
--- a/lisp/gnus/ChangeLog	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/gnus/ChangeLog	Wed Oct 27 05:42:04 2004 +0000
@@ -1,3 +1,13 @@
+2004-10-25  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* html2text.el (html2text-buffer-head): Removed.  Use `goto-char'
+	instead.
+
+2004-10-24  Kevin Greiner  <kevin.greiner@compsol.cc>
+
+	* gnus-start.el (gnus-convert-old-newsrc): Fixed numeric
+	comparison on string.
+
 2004-10-21  Katsumi Yamaoka  <yamaoka@jpl.org>
 
 	* mm-view.el (mm-display-inline-fontify): Inhibit font-lock when
--- a/lisp/gnus/gnus-start.el	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/gnus/gnus-start.el	Wed Oct 27 05:42:04 2004 +0000
@@ -2227,7 +2227,8 @@
 (defun gnus-convert-old-newsrc ()
   "Convert old newsrc formats into the current format, if needed."
   (let ((fcv (and gnus-newsrc-file-version
-		  (gnus-continuum-version gnus-newsrc-file-version))))
+		  (gnus-continuum-version gnus-newsrc-file-version)))
+	(gcv (gnus-continuum-version)))
     (when fcv
       ;; A newsrc file was loaded.
       (let (prompt-displayed
@@ -2261,7 +2262,7 @@
         ;; Perform converters to bring older version up to date.
 	(when (and converters (< fcv (caar converters)))
 	  (while (and converters (< fcv (caar converters))
-		      (<= (caar converters) gnus-version))
+		      (<= (caar converters) gcv))
             (let* ((converter-spec  (pop converters))
                    (convert-to      (nth 1 converter-spec))
                    (load-from       (nth 2 converter-spec))
--- a/lisp/gnus/html2text.el	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/gnus/html2text.el	Wed Oct 27 05:42:04 2004 +0000
@@ -116,12 +116,6 @@
 ;; <Utility functions>
 ;;
 
-(defun html2text-buffer-head ()
-  (if (string= mode-name "Article")
-      (beginning-of-buffer)
-    (beginning-of-buffer)
-    )
-  )
 
 (defun html2text-replace-string (from-string to-string p1 p2)
   (goto-char p1)
@@ -432,11 +426,11 @@
   "This _tries_ to fix up the paragraphs - this is done in quite a ad-hook
 fashion, quite close to pure guess-work. It does work in some cases though."
   (interactive)
-  (html2text-buffer-head)
+  (goto-char (point-min))
   (replace-regexp "^<br>$" "")
   ;; Removing lonely <br> on a single line, if they are left intact we
   ;; dont have any paragraphs at all.
-  (html2text-buffer-head)
+  (goto-char (point-min))
   (while (not (eobp))
     (let ((p1 (point)))
       (forward-paragraph 1)
@@ -462,7 +456,7 @@
 See the documentation for that variable."
   (interactive)
   (dolist (tag tag-list)
-    (html2text-buffer-head)
+    (goto-char (point-min))
     (while (re-search-forward (format "\\(</?%s[^>]*>\\)" tag) (point-max) t)
       (delete-region (match-beginning 0) (match-end 0)))))
 
@@ -472,7 +466,7 @@
   (dolist (tag-and-function html2text-format-tag-list)
     (let ((tag      (car tag-and-function))
 	  (function (cdr tag-and-function)))
-      (html2text-buffer-head)
+      (goto-char (point-min))
       (while (re-search-forward (format "\\(<%s\\( [^>]*\\)?>\\)" tag)
 				(point-max) t)
 	(let ((p1)
@@ -497,7 +491,7 @@
   "See the variable \"html2text-replace-list\" for documentation"
   (interactive)
   (dolist (e html2text-replace-list)
-    (html2text-buffer-head)
+    (goto-char (point-min))
     (let ((old-string (car e))
 	  (new-string (cdr e)))
       (html2text-replace-string old-string new-string (point-min) (point-max))
@@ -511,7 +505,7 @@
   (dolist (tag-and-function html2text-format-single-element-list)
     (let ((tag      (car tag-and-function))
 	  (function (cdr tag-and-function)))
-      (html2text-buffer-head)
+      (goto-char (point-min))
       (while (re-search-forward (format "\\(<%s\\( [^>]*\\)?>\\)" tag)
 				(point-max) t)
 	(let ((p1)
--- a/lisp/help.el	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/help.el	Wed Oct 27 05:42:04 2004 +0000
@@ -573,14 +573,14 @@
 			 (if (symbolp defn) defn (prin1-to-string defn)))))))))
 
 
-(defun describe-key (key &optional untranslated)
+(defun describe-key (key &optional untranslated up-event)
   "Display documentation of the function invoked by KEY.
 KEY should be a key sequence--when calling from a program,
 pass a string or a vector.
 If non-nil UNTRANSLATED is a vector of the untranslated events.
 It can also be a number in which case the untranslated events from
 the last key hit are used."
-  (interactive "kDescribe key: \np")
+  (interactive "kDescribe key: \np\nU")
   (if (numberp untranslated)
       (setq untranslated (this-single-command-raw-keys)))
   (save-excursion
@@ -608,6 +608,17 @@
 	    (prin1 defn)
 	    (princ "\n   which is ")
 	    (describe-function-1 defn)
+	    (when up-event
+	      (let ((defn (or (string-key-binding up-event) (key-binding up-event))))
+		(unless (or (null defn) (integerp defn) (equal defn 'undefined))
+		  (princ "\n\n-------------- up event ---------------\n\n")
+		  (princ (key-description up-event))
+		  (if (windowp window)
+		      (princ " at that spot"))
+		  (princ " runs the command ")
+		  (prin1 defn)
+		  (princ "\n   which is ")
+		  (describe-function-1 defn))))
 	    (print-help-return-message)))))))
 
 
@@ -651,7 +662,8 @@
 		 (push (list pretty-minor-mode mode indicator)
 		       minor-modes))))
 	(if auto-fill-function
-	    (push '("Auto Fill" auto-fill-mode " Fill")
+	    ;; copy pure string so we can add face property to it below.
+	    (push (list (copy-sequence "Auto Fill") 'auto-fill-mode " Fill")
 		  minor-modes))
 	(setq minor-modes
 	      (sort minor-modes
--- a/lisp/ibuf-ext.el	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/ibuf-ext.el	Wed Oct 27 05:42:04 2004 +0000
@@ -645,16 +645,16 @@
   (ibuffer-update nil t))
 
 ;;;###autoload
-(defun ibuffer-kill-line (&optional arg)
+(defun ibuffer-kill-line (&optional arg interactive-p)
   "Kill the filter group at point.
 See also `ibuffer-kill-filter-group'."
-  (interactive "P")
+  (interactive "P\np")
   (ibuffer-aif (save-excursion
 		 (ibuffer-forward-line 0)
 		 (get-text-property (point) 'ibuffer-filter-group-name))
       (progn
 	(ibuffer-kill-filter-group it))
-      (funcall (if (interactive-p) #'call-interactively #'funcall)
+      (funcall (if interactive-p #'call-interactively #'funcall)
 	       #'kill-line arg)))
 
 (defun ibuffer-insert-filter-group-before (newgroup group)
@@ -1237,53 +1237,51 @@
 If `ibuffer-jump-offer-only-visible-buffers' is non-nil, only offer
 visible buffers in the completion list.  Calling the command with
 a prefix argument reverses the meaning of that variable."
-  (interactive (list nil))
-  (let ((only-visible ibuffer-jump-offer-only-visible-buffers))
-    (when current-prefix-arg
-      (setq only-visible (not only-visible)))
-    (if only-visible
-	(let ((table (mapcar #'(lambda (x)
-				 (buffer-name (car x)))
-			     (ibuffer-current-state-list))))
-	  (when (null table)
-	    (error "No buffers!"))
-	  (when (interactive-p)
-	    (setq name (completing-read "Jump to buffer: "
-					table nil t))))
-      (when (interactive-p)
-	(setq name (read-buffer "Jump to buffer: " nil t))))
-    (when (not (string= "" name))
-      (let (buf-point)
-	;; Blindly search for our buffer: it is very likely that it is
-	;; not in a hidden filter group.
-	(ibuffer-map-lines #'(lambda (buf marks)
-			       (when (string= (buffer-name buf) name)
-				 (setq buf-point (point))
-				 nil))
-			   t nil)
-	(when (and
-	       (null buf-point)
-	       (not (null ibuffer-hidden-filter-groups)))
-	  ;; We did not find our buffer.  It must be in a hidden filter
-	  ;; group, so go through all hidden filter groups to find it.
-	  (catch 'found
-	    (dolist (group ibuffer-hidden-filter-groups)
-	      (ibuffer-jump-to-filter-group group)
-	      (ibuffer-toggle-filter-group)
-	      (ibuffer-map-lines #'(lambda (buf marks)
-				     (when (string= (buffer-name buf) name)
-				       (setq buf-point (point))
-				       nil))
-				 t group)
-	      (if buf-point
-		  (throw 'found nil)
-		(ibuffer-toggle-filter-group)))))
-	(if (null buf-point)
-	    ;; Still not found even though we expanded all hidden filter
-	    ;; groups: that must be because it's hidden by predicate:
-	    ;; we won't bother trying to display it.
-	    (error "No buffer with name %s" name)
-	  (goto-char buf-point))))))
+  (interactive (list
+		(let ((only-visible ibuffer-jump-offer-only-visible-buffers))
+		  (when current-prefix-arg
+		    (setq only-visible (not only-visible)))
+		  (if only-visible
+		      (let ((table (mapcar #'(lambda (x)
+					       (buffer-name (car x)))
+					   (ibuffer-current-state-list))))
+			(when (null table)
+			  (error "No buffers!"))
+			(completing-read "Jump to buffer: "
+					 table nil t))
+		    (read-buffer "Jump to buffer: " nil t)))))
+  (when (not (string= "" name))
+    (let (buf-point)
+      ;; Blindly search for our buffer: it is very likely that it is
+      ;; not in a hidden filter group.
+      (ibuffer-map-lines #'(lambda (buf marks)
+			     (when (string= (buffer-name buf) name)
+			       (setq buf-point (point))
+			       nil))
+			 t nil)
+      (when (and
+	     (null buf-point)
+	     (not (null ibuffer-hidden-filter-groups)))
+	;; We did not find our buffer.  It must be in a hidden filter
+	;; group, so go through all hidden filter groups to find it.
+	(catch 'found
+	  (dolist (group ibuffer-hidden-filter-groups)
+	    (ibuffer-jump-to-filter-group group)
+	    (ibuffer-toggle-filter-group)
+	    (ibuffer-map-lines #'(lambda (buf marks)
+				   (when (string= (buffer-name buf) name)
+				     (setq buf-point (point))
+				     nil))
+			       t group)
+	    (if buf-point
+		(throw 'found nil)
+	      (ibuffer-toggle-filter-group)))))
+      (if (null buf-point)
+	  ;; Still not found even though we expanded all hidden filter
+	  ;; groups: that must be because it's hidden by predicate:
+	  ;; we won't bother trying to display it.
+	  (error "No buffer with name %s" name)
+	(goto-char buf-point)))))
 
 ;;;###autoload
 (defun ibuffer-diff-with-file ()
--- a/lisp/ibuffer.el	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/ibuffer.el	Wed Oct 27 05:42:04 2004 +0000
@@ -873,8 +873,8 @@
 				    default-directory)
 				default-directory))))
      (list (read-file-name "Find file: " default-directory)
-	   current-prefix-arg)))
-  (find-file file (or wildcards (interactive-p))))
+	   t)))
+  (find-file file wildcards))
 
 (defun ibuffer-mouse-visit-buffer (event)
   "Visit the buffer chosen with the mouse."
--- a/lisp/imenu.el	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/imenu.el	Wed Oct 27 05:42:04 2004 +0000
@@ -62,6 +62,8 @@
 
 ;;; Code:
 
+(require 'newcomment)
+
 (eval-when-compile (require 'cl))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -796,32 +798,37 @@
 		  (regexp (nth 1 pat))
 		  (index (nth 2 pat))
 		  (function (nth 3 pat))
-		  (rest (nthcdr 4 pat)))
+		  (rest (nthcdr 4 pat))
+		  cs)
 	      ;; Go backwards for convenience of adding items in order.
 	      (goto-char (point-max))
 	      (while (re-search-backward regexp nil t)
-		(imenu-progress-message prev-pos nil t)
+		(goto-char (match-end index))
 		(setq beg (match-beginning index))
-		;; Add this sort of submenu only when we've found an
-		;; item for it, avoiding empty, duff menus.
-		(unless (assoc menu-title index-alist)
-		  (push (list menu-title) index-alist))
-		(if imenu-use-markers
-		    (setq beg (copy-marker beg)))
-		(let ((item
-		       (if function
-			   (nconc (list (match-string-no-properties index)
-					beg function)
-				  rest)
-			 (cons (match-string-no-properties index)
-			       beg)))
-		      ;; This is the desired submenu,
-		      ;; starting with its title (or nil).
-		      (menu (assoc menu-title index-alist)))
-		  ;; Insert the item unless it is already present.
-		  (unless (member item (cdr menu))
-		    (setcdr menu
-			    (cons item (cdr menu))))))))
+		(if (setq cs (save-match-data (comment-beginning)))
+		    (goto-char cs)	; skip this one, it's in a comment
+		  (goto-char beg)
+		  (imenu-progress-message prev-pos nil t)
+		  ;; Add this sort of submenu only when we've found an
+		  ;; item for it, avoiding empty, duff menus.
+		  (unless (assoc menu-title index-alist)
+		    (push (list menu-title) index-alist))
+		  (if imenu-use-markers
+		      (setq beg (copy-marker beg)))
+		  (let ((item
+			 (if function
+			     (nconc (list (match-string-no-properties index)
+					  beg function)
+				    rest)
+			   (cons (match-string-no-properties index)
+				 beg)))
+			;; This is the desired submenu,
+			;; starting with its title (or nil).
+			(menu (assoc menu-title index-alist)))
+		    ;; Insert the item unless it is already present.
+		    (unless (member item (cdr menu))
+		      (setcdr menu
+			      (cons item (cdr menu)))))))))
 	  (set-syntax-table old-table)))
     (imenu-progress-message prev-pos 100 t)
     ;; Sort each submenu by position.
--- a/lisp/indent.el	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/indent.el	Wed Oct 27 05:42:04 2004 +0000
@@ -205,7 +205,6 @@
 Interactively, WIDTH is the prefix argument, if specified.
 Without prefix argument, the command prompts for WIDTH."
   (interactive "r\nNSet left margin to column: ")
-  (if (interactive-p) (setq width (prefix-numeric-value width)))
   (save-excursion
     ;; If inside indentation, start from BOL.
     (goto-char from)
@@ -229,7 +228,6 @@
 Interactively, WIDTH is the prefix argument, if specified.
 Without prefix argument, the command prompts for WIDTH."
   (interactive "r\nNSet right margin to width: ")
-  (if (interactive-p) (setq width (prefix-numeric-value width)))
   (save-excursion
     (goto-char from)
     (skip-chars-backward " \t")
@@ -289,12 +287,10 @@
 the right margin width.
 If `auto-fill-mode' is active, re-fill the region to fit the new margin."
   (interactive "r\nP")
-  (if (interactive-p)
-      (setq inc (if inc (prefix-numeric-value current-prefix-arg)
-		  standard-indent)))
+  (setq inc (if inc (prefix-numeric-value inc) standard-indent))
   (save-excursion
     (alter-text-property from to 'right-margin
-       (lambda (v) (+ inc (or v 0))))
+			 (lambda (v) (+ inc (or v 0))))
     (if auto-fill-function
 	(fill-region from to nil t t))))
 
--- a/lisp/info.el	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/info.el	Wed Oct 27 05:42:04 2004 +0000
@@ -3248,7 +3248,8 @@
 \(FILENAME NODENAME BUFFERPOS\)."
   (let ((where '())
 	(cmd-desc (concat "^\\* +" (regexp-quote (symbol-name command))
-			  "\\( <[0-9]+>\\)?:\\s *\\(.*\\)\\.$"))
+			  "\\( <[0-9]+>\\)?:\\s *\\(.*\\)\\."
+			  "\\([ \t]*(line[ \t]*[0-9]*)\\)?$"))
 	(info-file "emacs"))		;default
     ;; Determine which info file this command is documented in.
     (if (get command 'info-file)
--- a/lisp/man.el	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/man.el	Wed Oct 27 05:42:04 2004 +0000
@@ -893,12 +893,15 @@
 	 'Man-target-string (match-string target-pos)
 	 )))))
 
-(defun Man-cleanup-manpage ()
-  "Remove overstriking and underlining from the current buffer."
-  (interactive)
+(defun Man-cleanup-manpage (&optional interactive)
+  "Remove overstriking and underlining from the current buffer.
+Normally skip any jobs that should have been done by the sed script,
+but when called interactively, do those jobs even if the sed
+script would have done them."
+  (interactive "p")
   (message "Please wait: cleaning up the %s man page..."
 	   Man-arguments)
-  (if (or (interactive-p) (not Man-sed-script))
+  (if (or interactive (not Man-sed-script))
       (progn
 	(goto-char (point-min))
 	(while (search-forward "_\b" nil t) (backward-delete-char 2))
--- a/lisp/menu-bar.el	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/menu-bar.el	Wed Oct 27 05:42:04 2004 +0000
@@ -596,10 +596,12 @@
 
 (defmacro menu-bar-make-toggle (name variable doc message help &rest body)
   `(progn
-     (defun ,name ()
+     (defun ,name (&optional interactively)
        ,(concat "Toggle whether to " (downcase (substring help 0 1))
-		(substring help 1) ".")
-       (interactive)
+		(substring help 1) ".\
+In an interactive call, record this option as a candidate for saving
+by \"Save Options\" in Custom buffers.")
+       (interactive "p")
        (if ,(if body `(progn . ,body)
 	      `(progn
 		 (custom-load-symbol ',variable)
@@ -612,7 +614,7 @@
        ;; a variable is set interactively, as the purpose is to mark it as
        ;; a candidate for "Save Options", and we do not want to save options
        ;; the user have already set explicitly in his init file.
-       (if (interactive-p) (customize-mark-as-set ',variable)))
+       (if interactively (customize-mark-as-set ',variable)))
      '(menu-item ,doc ,name
 		 :help ,help
                  :button (:toggle . (and (default-boundp ',variable)
--- a/lisp/mouse-sel.el	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/mouse-sel.el	Wed Oct 27 05:42:04 2004 +0000
@@ -240,6 +240,7 @@
 & mouse-3, but operate on the X secondary selection rather than the
 primary selection and region."
   :global t
+  :group 'mouse-sel
   (if mouse-sel-mode
       (progn
 	(add-hook 'x-lost-selection-hooks 'mouse-sel-lost-selection-hook)
--- a/lisp/net/password.el	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/net/password.el	Wed Oct 27 05:42:04 2004 +0000
@@ -122,6 +122,62 @@
 		 key))
   nil)
 
+;;;###autoload
+(defun read-passwd (prompt &optional confirm default)
+  "Read a password, prompting with PROMPT, and return it.
+If optional CONFIRM is non-nil, read the password twice to make sure.
+Optional DEFAULT is a default password to use instead of empty input.
+
+This function echoes `.' for each character that the user types.
+The user ends with RET, LFD, or ESC.  DEL or C-h rubs out.  C-u kills line.
+C-g quits; if `inhibit-quit' was non-nil around this function,
+then it returns nil if the user types C-g.
+
+Once the caller uses the password, it can erase the password
+by doing (clear-string STRING)."
+  (with-local-quit
+    (if confirm
+	(let (success)
+	  (while (not success)
+	    (let ((first (read-passwd prompt nil default))
+		  (second (read-passwd "Confirm password: " nil default)))
+	      (if (equal first second)
+		  (progn
+		    (and (arrayp second) (clear-string second))
+		    (setq success first))
+		(and (arrayp first) (clear-string first))
+		(and (arrayp second) (clear-string second))
+		(message "Password not repeated accurately; please start over")
+		(sit-for 1))))
+	  success)
+      (let ((pass nil)
+	    (c 0)
+	    (echo-keystrokes 0)
+	    (cursor-in-echo-area t))
+	(while (progn (message "%s%s"
+			       prompt
+			       (make-string (length pass) ?.))
+		      (setq c (read-char-exclusive nil t))
+		      (and (/= c ?\r) (/= c ?\n) (/= c ?\e)))
+	  (clear-this-command-keys)
+	  (if (= c ?\C-u)
+	      (progn
+		(and (arrayp pass) (clear-string pass))
+		(setq pass ""))
+	    (if (and (/= c ?\b) (/= c ?\177))
+		(let* ((new-char (char-to-string c))
+		       (new-pass (concat pass new-char)))
+		  (and (arrayp pass) (clear-string pass))
+		  (clear-string new-char)
+		  (setq c ?\0)
+		  (setq pass new-pass))
+	      (if (> (length pass) 0)
+		  (let ((new-pass (substring pass 0 -1)))
+		    (and (arrayp pass) (clear-string pass))
+		    (setq pass new-pass))))))
+	(message nil)
+	(or pass default "")))))
+
 (provide 'password)
 
 ;;; arch-tag: ab160494-16c8-4c68-a4a1-73eebf6686e5
--- a/lisp/net/tramp-vc.el	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/net/tramp-vc.el	Wed Oct 27 05:42:04 2004 +0000
@@ -217,6 +217,7 @@
 ;; Daniel Pittman <daniel@danann.net>
 ;;-(if (fboundp 'vc-call-backend)
 ;;-    () ;; This is the new VC for which we don't have an appropriate advice yet
+(unless (fboundp 'process-file)
 (if (fboundp 'vc-call-backend)
     (defadvice vc-do-command
       (around tramp-advice-vc-do-command
@@ -242,7 +243,7 @@
           (setq ad-return-value
                 (apply 'tramp-vc-do-command buffer okstatus command 
                        (or file (buffer-file-name)) last flags))
-        ad-do-it))))
+        ad-do-it)))))
 ;;-)
 
 
--- a/lisp/net/tramp.el	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/net/tramp.el	Wed Oct 27 05:42:04 2004 +0000
@@ -1770,6 +1770,7 @@
     (delete-file . tramp-handle-delete-file)
     (directory-file-name . tramp-handle-directory-file-name)
     (shell-command . tramp-handle-shell-command)
+    (process-file . tramp-handle-process-file)
     (insert-directory . tramp-handle-insert-directory)
     (expand-file-name . tramp-handle-expand-file-name)
     (file-local-copy . tramp-handle-file-local-copy)
@@ -3469,6 +3470,18 @@
     (tramp-run-real-handler 'shell-command
 			    (list command output-buffer error-buffer))))
 
+(defun tramp-handle-process-file (program &optional infile buffer display &rest args)
+  "Like `process-file' for Tramp files."
+  (when infile (error "Implementation does not handle input from file"))
+  (when (and (numberp buffer) (zerop buffer))
+    (error "Implementation does not handle immediate return"))
+  (when (consp buffer) (error "Implementation does not handle error files"))
+  (shell-command 
+   (mapconcat 'tramp-shell-quote-argument
+              (cons program args)
+              " ")
+   buffer))
+
 ;; File Editing.
 
 (defsubst tramp-make-temp-file ()
@@ -3960,6 +3973,8 @@
    ; COMMAND
    ((member operation
 	    (list 'dired-call-process 'shell-command
+                  ; Post Emacs 21.3 only
+                  'process-file
 	          ; XEmacs only
 		  'dired-print-file 'dired-shell-call-process))
     default-directory)
--- a/lisp/pcomplete.el	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/pcomplete.el	Wed Oct 27 05:42:04 2004 +0000
@@ -347,12 +347,12 @@
 ;;; User Functions:
 
 ;;;###autoload
-(defun pcomplete ()
+(defun pcomplete (&optional interactively)
   "Support extensible programmable completion.
 To use this function, just bind the TAB key to it, or add it to your
 completion functions list (it should occur fairly early in the list)."
-  (interactive)
-  (if (and (interactive-p)
+  (interactive "p")
+  (if (and interactively
 	   pcomplete-cycle-completions
 	   pcomplete-current-completions
 	   (memq last-command '(pcomplete
--- a/lisp/progmodes/asm-mode.el	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/progmodes/asm-mode.el	Wed Oct 27 05:42:04 2004 +0000
@@ -90,7 +90,9 @@
     2 font-lock-keyword-face)
    ;; directive started from ".".
    ("^\\(\\.\\(\\sw\\|\\s_\\)+\\)\\>[^:]?"
-    1 font-lock-keyword-face))
+    1 font-lock-keyword-face)
+   ;; %register
+   ("%\\sw+" . font-lock-variable-name-face))
  "Additional expressions to highlight in Assembler mode.")
 
 ;;;###autoload
--- a/lisp/progmodes/flymake.el	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/progmodes/flymake.el	Wed Oct 27 05:42:04 2004 +0000
@@ -94,7 +94,7 @@
 (defun flymake-split-string(str pattern)
     (cond
 	((equal flymake-emacs 'xemacs)  (flymake-split-string-remove-empty-edges str pattern))
-	(t                              (split-string str pattern))
+	(t                              (flymake-split-string-remove-empty-edges str pattern))
     )
 )
 
@@ -1243,7 +1243,8 @@
 	   (" *\\(\\[javac\\]\\)? *\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[ \t\n]*\\(.+\\)"
 	2 4 nil 5)
       )
-     compilation-error-regexp-alist)
+     ;; compilation-error-regexp-alist)
+     (mapcar (lambda (x) (cdr x)) compilation-error-regexp-alist-alist)) 
     "patterns for matching error/warning lines, (regexp file-idx line-idx err-text-idx)"
 )
 ;(defcustom flymake-err-line-patterns
--- a/lisp/progmodes/gdb-ui.el	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/progmodes/gdb-ui.el	Wed Oct 27 05:42:04 2004 +0000
@@ -177,7 +177,7 @@
 
   (setq comint-input-sender 'gdb-send)
   ;;
-  ;; (re-)initialise
+  ;; (re-)initialize
   (setq gdb-current-address "main")
   (setq gdb-previous-address nil)
   (setq gdb-previous-frame nil)
@@ -482,14 +482,14 @@
 	     (name (funcall (gdb-rules-name-maker rules)))
 	     (new (get-buffer-create name)))
 	(with-current-buffer new
-	  ;; FIXME: This should be set after calling the function, since the
-	  ;; function should run kill-all-local-variables.
-	  (set (make-local-variable 'gdb-buffer-type) key)
-	  (if (cdr (cdr rules))
-	      (funcall (car (cdr (cdr rules)))))
-	  (set (make-local-variable 'gud-minor-mode)
-	       (with-current-buffer gud-comint-buffer gud-minor-mode))
-	  (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
+	  (let ((trigger))	  
+	    (if (cdr (cdr rules))
+		(setq trigger (funcall (car (cdr (cdr rules))))))
+	    (set (make-local-variable 'gdb-buffer-type) key)
+	    (set (make-local-variable 'gud-minor-mode)
+		 (with-current-buffer gud-comint-buffer gud-minor-mode))
+	    (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
+	    (if trigger (funcall trigger)))
 	  new))))
 
 (defun gdb-rules-name-maker (rules) (car (cdr rules)))
@@ -1190,13 +1190,15 @@
   "Major mode for gdb breakpoints.
 
 \\{gdb-breakpoints-mode-map}"
+  (kill-all-local-variables)
   (setq major-mode 'gdb-breakpoints-mode)
   (setq mode-name "Breakpoints")
   (use-local-map gdb-breakpoints-mode-map)
   (setq buffer-read-only t)
+  (run-mode-hooks 'gdb-breakpoints-mode-hook)
   (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
-      (gdb-invalidate-breakpoints)
-    (gdbmi-invalidate-breakpoints)))
+      'gdb-invalidate-breakpoints
+    'gdbmi-invalidate-breakpoints))
 
 (defun gdb-toggle-breakpoint ()
   "Enable/disable the breakpoint at current line."
@@ -1317,14 +1319,16 @@
   "Major mode for gdb frames.
 
 \\{gdb-frames-mode-map}"
+  (kill-all-local-variables)
   (setq major-mode 'gdb-frames-mode)
   (setq mode-name "Frames")
   (setq buffer-read-only t)
   (use-local-map gdb-frames-mode-map)
   (font-lock-mode -1)
+  (run-mode-hooks 'gdb-frames-mode-hook)
   (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
-      (gdb-invalidate-frames)
-    (gdbmi-invalidate-frames)))
+      'gdb-invalidate-frames
+    'gdbmi-invalidate-frames))
 
 (defun gdb-get-frame-number ()
   (save-excursion
@@ -1396,11 +1400,13 @@
   "Major mode for gdb frames.
 
 \\{gdb-threads-mode-map}"
+  (kill-all-local-variables)
   (setq major-mode 'gdb-threads-mode)
   (setq mode-name "Threads")
   (setq buffer-read-only t)
   (use-local-map gdb-threads-mode-map)
-  (gdb-invalidate-threads))
+  (run-mode-hooks 'gdb-threads-mode-hook)
+  'gdb-invalidate-threads)
 
 (defun gdb-get-thread-number ()
   (save-excursion
@@ -1444,11 +1450,13 @@
   "Major mode for gdb registers.
 
 \\{gdb-registers-mode-map}"
+  (kill-all-local-variables)
   (setq major-mode 'gdb-registers-mode)
   (setq mode-name "Registers")
   (setq buffer-read-only t)
   (use-local-map gdb-registers-mode-map)
-  (gdb-invalidate-registers))
+  (run-mode-hooks 'gdb-registers-mode-hook)
+  'gdb-invalidate-registers)
 
 (defun gdb-registers-buffer-name ()
   (with-current-buffer gud-comint-buffer
@@ -1518,13 +1526,15 @@
   "Major mode for gdb locals.
 
 \\{gdb-locals-mode-map}"
+  (kill-all-local-variables)
   (setq major-mode 'gdb-locals-mode)
   (setq mode-name (concat "Locals:" gdb-current-frame))
   (setq buffer-read-only t)
   (use-local-map gdb-locals-mode-map)
+  (run-mode-hooks 'gdb-locals-mode-hook)
   (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
-      (gdb-invalidate-locals)
-    (gdbmi-invalidate-locals)))
+      'gdb-invalidate-locals
+    'gdbmi-invalidate-locals))
 
 (defun gdb-locals-buffer-name ()
   (with-current-buffer gud-comint-buffer
@@ -1939,10 +1949,26 @@
     (suppress-keymap map)
     map))
 
+(defvar gdb-assembler-font-lock-keywords
+  '(;; <__function.name+n>
+    ("<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>"
+     (1 font-lock-function-name-face))
+    ;; 0xNNNNNNNN <__function.name+n>: opcode
+    ("^0x[0-9a-f]+ \\(<\\(\\(\\sw\\|[_.]\\)+\\)\\+[0-9]+>\\)?:[ \t]+\\(\\sw+\\)"
+     (4 font-lock-keyword-face))
+    ;; %register(at least i386)
+    ("%\\sw+" . font-lock-variable-name-face)
+    ("^\\(Dump of assembler code for function\\) \\(.+\\):"
+     (1 font-lock-comment-face)
+     (2 font-lock-function-name-face))
+    ("^\\(End of assembler dump\\.\\)" . font-lock-comment-face))
+  "Font lock keywords used in `gdb-assembler-mode'.")
+
 (defun gdb-assembler-mode ()
   "Major mode for viewing code assembler.
 
 \\{gdb-assembler-mode-map}"
+  (kill-all-local-variables)
   (setq major-mode 'gdb-assembler-mode)
   (setq mode-name "Machine")
   (setq gdb-overlay-arrow-position nil)
@@ -1951,7 +1977,11 @@
   (setq fringes-outside-margins t)
   (setq buffer-read-only t)
   (use-local-map gdb-assembler-mode-map)
-  (gdb-invalidate-assembler))
+  (gdb-invalidate-assembler)
+  (set (make-local-variable 'font-lock-defaults)
+       '(gdb-assembler-font-lock-keywords))
+  (run-mode-hooks 'gdb-assembler-mode-hook)
+  'gdb-invalidate-assembler)
 
 (defun gdb-assembler-buffer-name ()
   (with-current-buffer gud-comint-buffer
--- a/lisp/simple.el	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/simple.el	Wed Oct 27 05:42:04 2004 +0000
@@ -1879,6 +1879,39 @@
     (with-current-buffer
       standard-output
       (call-process shell-file-name nil t nil shell-command-switch command))))
+
+(defun process-file (program &optional infile buffer display &rest args)
+  "Process files synchronously in a separate process.
+Similar to `call-process', but may invoke a file handler based on
+`default-directory'.  The current working directory of the
+subprocess is `default-directory'.
+
+File names in INFILE and BUFFER are handled normally, but file
+names in ARGS should be relative to `default-directory', as they
+are passed to the process verbatim.  \(This is a difference to
+`call-process' which does not support file handlers for INFILE
+and BUFFER.\)
+
+Some file handlers might not support all variants, for example
+they might behave as if DISPLAY was nil, regardless of the actual
+value passed."
+  (let ((fh (find-file-name-handler default-directory 'process-file))
+        lc stderr-file)
+    (unwind-protect
+        (if fh (apply fh 'process-file program infile buffer display args)
+          (when infile (setq lc (file-local-copy infile)))
+          (setq stderr-file (when (and (consp buffer) (stringp (cadr buffer)))
+                              (make-temp-file "emacs")))
+          (prog1
+              (apply 'call-process program
+                     (or lc infile)
+                     (if stderr-file (list (car buffer) stderr-file) buffer)
+                     display args)
+            (when stderr-file (copy-file stderr-file (cadr buffer)))))
+      (when stderr-file (delete-file stderr-file))
+      (when lc (delete-file lc)))))
+
+
 
 (defvar universal-argument-map
   (let ((map (make-sparse-keymap)))
--- a/lisp/subr.el	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/subr.el	Wed Oct 27 05:42:04 2004 +0000
@@ -1211,61 +1211,6 @@
       (setq first nil))
     code))
 
-(defun read-passwd (prompt &optional confirm default)
-  "Read a password, prompting with PROMPT, and return it.
-If optional CONFIRM is non-nil, read the password twice to make sure.
-Optional DEFAULT is a default password to use instead of empty input.
-
-This function echoes `.' for each character that the user types.
-The user ends with RET, LFD, or ESC.  DEL or C-h rubs out.  C-u kills line.
-C-g quits; if `inhibit-quit' was non-nil around this function,
-then it returns nil if the user types C-g.
-
-Once the caller uses the password, it can erase the password
-by doing (clear-string STRING)."
-  (with-local-quit
-    (if confirm
-	(let (success)
-	  (while (not success)
-	    (let ((first (read-passwd prompt nil default))
-		  (second (read-passwd "Confirm password: " nil default)))
-	      (if (equal first second)
-		  (progn
-		    (and (arrayp second) (clear-string second))
-		    (setq success first))
-		(and (arrayp first) (clear-string first))
-		(and (arrayp second) (clear-string second))
-		(message "Password not repeated accurately; please start over")
-		(sit-for 1))))
-	  success)
-      (let ((pass nil)
-	    (c 0)
-	    (echo-keystrokes 0)
-	    (cursor-in-echo-area t))
-	(while (progn (message "%s%s"
-			       prompt
-			       (make-string (length pass) ?.))
-		      (setq c (read-char-exclusive nil t))
-		      (and (/= c ?\r) (/= c ?\n) (/= c ?\e)))
-	  (clear-this-command-keys)
-	  (if (= c ?\C-u)
-	      (progn
-		(and (arrayp pass) (clear-string pass))
-		(setq pass ""))
-	    (if (and (/= c ?\b) (/= c ?\177))
-		(let* ((new-char (char-to-string c))
-		       (new-pass (concat pass new-char)))
-		  (and (arrayp pass) (clear-string pass))
-		  (clear-string new-char)
-		  (setq c ?\0)
-		  (setq pass new-pass))
-	      (if (> (length pass) 0)
-		  (let ((new-pass (substring pass 0 -1)))
-		    (and (arrayp pass) (clear-string pass))
-		    (setq pass new-pass))))))
-	(message nil)
-	(or pass default "")))))
-
 ;; This should be used by `call-interactively' for `n' specs.
 (defun read-number (prompt &optional default)
   (let ((n nil))
--- a/lisp/textmodes/sgml-mode.el	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/textmodes/sgml-mode.el	Wed Oct 27 05:42:04 2004 +0000
@@ -451,10 +451,22 @@
   ;; recognized.
   (set (make-local-variable 'comment-start-skip) "\\(?:<!\\)?--[ \t]*")
   (set (make-local-variable 'comment-end-skip) "[ \t]*--\\([ \t\n]*>\\)?")
-  ;; This definition probably is not useful in derived modes.
-  (set (make-local-variable 'imenu-generic-expression)
-       (concat "<!\\(element\\|entity\\)[ \t\n]+%?[ \t\n]*\\("
-	       sgml-name-re "\\)")))
+  ;; This definition has an HTML leaning but probably fits well for other modes.
+  (setq imenu-generic-expression
+	`((nil
+	   ,(concat "<!\\(element\\|entity\\)[ \t\n]+%?[ \t\n]*\\("
+		    sgml-name-re "\\)")
+	   2)
+	  ("Id"
+	   ,(concat "<[^>]+[ \t\n]+[Ii][Dd]=\\(['\"]"
+		    (if sgml-xml-mode "" "?")
+		    "\\)\\(" sgml-name-re "\\)\\1")
+	   2)
+	  ("Name"
+	   ,(concat "<[^>]+[ \t\n]+[Nn][Aa][Mm][Ee]=\\(['\"]"
+		    (if sgml-xml-mode "" "?")
+		    "\\)\\(" sgml-name-re "\\)\\1")
+	   2))))
 
 ;; Some programs (such as Glade 2) generate XML which has
 ;; -*- mode: xml -*-.
--- a/lisp/textmodes/tex-mode.el	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/textmodes/tex-mode.el	Wed Oct 27 05:42:04 2004 +0000
@@ -468,6 +468,10 @@
 	   ;; (arg "\\(?:{\\(\\(?:[^{}\\]+\\|\\\\.\\|{[^}]*}\\)+\\)\\|\\\\[a-z*]+\\)"))
 	   (arg "{\\(\\(?:[^{}\\]+\\|\\\\.\\|{[^}]*}\\)+\\)"))
       (list
+       ;; font-lock-syntactic-keywords causes the \ of \end{verbatim} to be
+       ;; highlighted as tex-verbatim-face.  Let's undo that.
+       ;; This is ugly and brittle :-(  --Stef
+       '("^\\(\\\\\\)end" (1 (get-text-property (match-end 1) 'face) t))
        ;; display $$ math $$
        ;; We only mark the match between $$ and $$ because the $$ delimiters
        ;; themselves have already been marked (along with $..$) by syntactic
@@ -619,6 +623,8 @@
       ;; 2 - font-lock considers the preceding \n as being part of the
       ;;     preceding line, so things gets screwed every time the previous
       ;;     line is re-font-locked on its own.
+      ;; There's a hack in tex-font-lock-keywords-1 to remove the verbatim
+      ;; face from the \ but C-M-f still jumps to the wrong spot :-(  --Stef
       (,(concat "^\\(\\\\\\)end *{" verbs "}\\(.?\\)") (1 "|") (3 "<"))
       ;; ("^\\(\\\\\\)begin *{comment}" 1 "< b")
       ;; ("^\\\\end *{comment}.*\\(\n\\)" 1 "> b")
--- a/lisp/vc.el	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/vc.el	Wed Oct 27 05:42:04 2004 +0000
@@ -953,7 +953,7 @@
 	      (vc-exec-after
 	       `(unless (active-minibuffer-window)
                   (message "Running %s in the background... done" ',command))))
-	  (setq status (apply 'call-process command nil t nil squeezed))
+	  (setq status (apply 'process-file command nil t nil squeezed))
 	  (when (or (not (integerp status)) (and okstatus (< okstatus status)))
 	    (pop-to-buffer (current-buffer))
 	    (goto-char (point-min))
--- a/lisp/woman.el	Tue Oct 26 01:28:28 2004 +0000
+++ b/lisp/woman.el	Wed Oct 27 05:42:04 2004 +0000
@@ -1132,7 +1132,7 @@
 should be a topic string and non-nil RE-CACHE forces re-caching."
   (interactive (list nil current-prefix-arg))
   ;; The following test is for non-interactive calls via gnudoit etc.
-  (if (or (interactive-p) (not (stringp topic)) (string-match "\\S " topic))
+  (if (or (not (stringp topic)) (string-match "\\S " topic))
       (let ((file-name (woman-file-name topic re-cache)))
 	(if file-name
 	    (woman-find-file file-name)
--- a/lispref/ChangeLog	Tue Oct 26 01:28:28 2004 +0000
+++ b/lispref/ChangeLog	Wed Oct 27 05:42:04 2004 +0000
@@ -1,3 +1,30 @@
+2004-10-26  Kim F. Storm  <storm@cua.dk>
+
+	* commands.texi (Interactive Codes): Add U code letter.
+
+2004-10-25  Simon Josefsson  <jas@extundo.com>
+
+	* minibuf.texi (Reading a Password): Add.
+
+2004-10-24  Jason Rumney  <jasonr@gnu.org>
+
+	* commands.texi (Misc Events): Remove mouse-wheel. Add wheel-up
+	and wheel-down.
+
+2004-10-24  Kai Grossjohann  <kai.grossjohann@gmx.net>
+
+	* processes.texi (Synchronous Processes): Document process-file.
+
+2004-10-22  Kenichi Handa  <handa@m17n.org>
+
+	* text.texi (translate-region): Document that it accepts also a
+	char-table.
+
+2004-10-22  David Ponce  <david@dponce.com>
+
+	* windows.texi (Resizing Windows): Document the `preserve-before'
+	argument of the functions `enlarge-window' and `shrink-window'.
+
 2004-10-19  Jason Rumney  <jasonr@gnu.org>
 
 	* makefile.w32-in (elisp): Change order of arguments to makeinfo.
--- a/lispref/commands.texi	Tue Oct 26 01:28:28 2004 +0000
+++ b/lispref/commands.texi	Wed Oct 27 05:42:04 2004 +0000
@@ -360,6 +360,9 @@
 maps.  The key sequence argument is represented as a string or vector.
 The cursor does not move into the echo area.  Prompt.
 
+If the key sequence is a down-event, the following up-event is discarded,
+but can be read via the @code{U} code character.
+
 This kind of input is used by commands such as @code{describe-key} and
 @code{global-set-key}.
 
@@ -416,6 +419,11 @@
 the string.)  Other characters that normally terminate a symbol (e.g.,
 parentheses and brackets) do not do so here.  Prompt.
 
+@item U
+A key sequence or nil.  May be used after a @code{k} or @code{K}
+argument to get the up-event that was discarded in case the key
+sequence read for that argument was a down-event.  No I/O.
+
 @item v
 A variable declared to be a user option (i.e., satisfying the
 predicate @code{user-variable-p}).  This reads the variable using
@@ -1501,21 +1509,20 @@
 the window manager.  Its standard definition is @code{ignore}; since the
 frame has already been made visible, Emacs has no work to do.
 
-@cindex @code{mouse-wheel} event
-@item (mouse-wheel @var{position} @var{delta})
-This kind of event is generated by moving a wheel on a mouse (such as
-the MS Intellimouse).  Its effect is typically a kind of scroll or zoom.
-
-The element @var{delta} describes the amount and direction of the wheel
-rotation.  Its absolute value is the number of increments by which the
-wheel was rotated.  A negative @var{delta} indicates that the wheel was
-rotated backwards, towards the user, and a positive @var{delta}
-indicates that the wheel was rotated forward, away from the user.
+@cindex @code{wheel-up} event
+@cindex @code{wheel-down} event
+@item (wheel-up @var{position})
+@item (wheel-down @var{position})
+This kind of event is generated by moving a wheel on a mouse.  Its
+effect is typically a kind of scroll or zoom.
 
 The element @var{position} is a list describing the position of the
 event, in the same format as used in a mouse-click event.
 
-This kind of event is generated only on some kinds of systems.
+This kind of event is generated only on some kinds of systems. On
+other systems, mouse-4 and mouse-5 may be used instead.  For portable
+code, the variables @code{mouse-wheel-up-event} and
+@code{mouse-wheel-down-event} defined in @file{mwheel.el} can be used.
 
 @cindex @code{drag-n-drop} event
 @item (drag-n-drop @var{position} @var{files})
--- a/lispref/minibuf.texi	Tue Oct 26 01:28:28 2004 +0000
+++ b/lispref/minibuf.texi	Wed Oct 27 05:42:04 2004 +0000
@@ -1660,6 +1660,32 @@
   To read a password to pass to another program, you can use the
 function @code{read-passwd}.
 
+@cindex password cache
+  Passwords are sometimes needed several times throughout an Emacs
+session.  Then it can be useful to avoid having to ask for a password
+more than once.  Passwords are entered into the password cache using
+the function @code{password-cache-add}.  To read a password, possibly
+retrieving the password from the cache without querying the user, you
+can use the function @code{password-read}.  The two calls can be
+combined into the function @code{password-read-and-add} that read a
+password and store it in the cache.
+
+  Typically users do not use the same password for all services.  The
+password cache mechanism use a @samp{key} string to differentiate
+among the passwords.  The @samp{key} string is typically a fixed
+string chosen to be related to what the password is used for.  For
+example, a password used when connecting to a @acronym{IMAP} mail
+server called @samp{mail.example.org}, could use a @samp{key} string
+of @samp{imap:mail.example.org}.  You can use any string, as long as
+it is reasonably unique.
+
+@cindex password expiry
+Passwords in the cache typically expire after a while (controlled by
+the variable @code{password-cache-expiry}), but you can force removal
+of a password using the function @code{password-cache-remove}.  This
+is useful when there is a problem with the password, to avoid using
+the same incorrect password from the cache in the future.
+
 @defun read-passwd prompt &optional confirm default
 This function reads a password, prompting with @var{prompt}.  It does
 not echo the password as the user types it; instead, it echoes @samp{.}
@@ -1675,6 +1701,41 @@
 then @code{read-passwd} returns the null string in that case.
 @end defun
 
+@defun password-read prompt key
+Read a password from the user, using @code{read-passwd}, prompting
+with @var{prompt}.  If a password has been stored in the password
+cache, using @code{password-cache-add} on the same @var{key}, it is
+returned directly, without querying the user.
+@end defun
+
+@defun password-cache-add key password
+Add a password to the password cache, indexed under the given
+@var{key}.  The password is later retrieved using @code{password-read}
+called with the same @var{key}.
+@end defun
+
+@defun password-cache-remove key
+Remove a password from the cache, indexed under the given @var{key}.
+@end defun
+
+@defun password-read-and-add prompt &optional key
+Read a password, prompting with @var{prompt}, and possibly add it to
+the cache, indexed using the @var{key} string.  This is one-call
+interface to @code{password-read} and @code{password-cache-add}.
+@end defun
+
+@defvar password-cache-expiry
+This variable specify for how many seconds passwords are retained in
+the password cache before they are expired.  For high security, use a
+low value (below a minute).  For more lax security, use a setting of
+@samp{14400} corresponding to half a work day (4 hours).
+@end defvar
+
+@defvar password-cache
+This variable toggle whether or not the password cache is used at all.
+The default is non-@code{nil}, i.e., to use the cache.
+@end defvar
+
 @node Minibuffer Misc
 @section Minibuffer Miscellany
 
--- a/lispref/processes.texi	Tue Oct 26 01:28:28 2004 +0000
+++ b/lispref/processes.texi	Wed Oct 27 05:42:04 2004 +0000
@@ -317,6 +317,47 @@
 @end smallexample
 @end defun
 
+@defun process-file program &optional infile buffer display &rest args
+This function processes files synchronously in a separate process.  It
+is similar to @code{call-process} but may invoke a file handler based
+on the value of the variable @code{default-directory}.  The current
+working directory of the subprocess is @code{default-directory}.
+
+The arguments are handled in almost the same way as for
+@code{call-process}, with the following differences:
+
+Some file handlers may not support all combinations and forms of the
+arguments @var{infile}, @var{buffer}, and @var{display}.  For example,
+some file handlers might behave as if @var{display} was nil,
+regardless of the value actually passed.  As another example, some
+file handlers might not support separating standard output and error
+output by way of the @var{buffer} argument.
+
+If a file handler is invoked, it determines the program to run based
+on the first argument @var{program}.  For instance, consider that a
+handler for remote files is invoked.  Then the path that is used for
+searching the program might be different than @code{exec-path}.
+
+The second argument @var{infile} may invoke a file handler.  The file
+handler could be different from the handler chosen for the
+@code{process-file} function itself.  (For example,
+@code{default-directory} could be on a remote host, whereas
+@var{infile} is on another remote host.  Or @code{default-directory}
+could be non-special, whereas @var{infile} is on a remote host.)
+
+If @var{buffer} has the form @code{(@var{real-destination}
+@var{error-destination})}, and @var{error-destination} names a file,
+then the same remarks as for @var{infile} apply.
+
+The remaining arguments (@var{args}) will be passed to the process
+verbatim.  Emacs is not involved in processing file names that are
+present in @var{args}.  To avoid confusion, it may be best to avoid
+absolute file names in @var{args}, but rather to specify all file
+names as relative to @code{default-directory}.  The function
+@code{file-relative-name} is useful for constructing such relative
+file names.
+@end defun
+
 @defun call-process-region start end program &optional delete destination display &rest args
 This function sends the text from @var{start} to @var{end} as
 standard input to a process running @var{program}.  It deletes the text
--- a/lispref/text.texi	Tue Oct 26 01:28:28 2004 +0000
+++ b/lispref/text.texi	Wed Oct 27 05:42:04 2004 +0000
@@ -3620,9 +3620,9 @@
 This function applies a translation table to the characters in the
 buffer between positions @var{start} and @var{end}.
 
-The translation table @var{table} is a string; @code{(aref @var{table}
-@var{ochar})} gives the translated character corresponding to
-@var{ochar}.  If the length of @var{table} is less than 256, any
+The translation table @var{table} is a string or a char-table;
+@code{(aref @var{table} @var{ochar})} gives the translated character
+corresponding to @var{ochar}.  If @var{table} is a string, any
 characters with codes larger than the length of @var{table} are not
 altered by the translation.
 
--- a/lispref/windows.texi	Tue Oct 26 01:28:28 2004 +0000
+++ b/lispref/windows.texi	Wed Oct 27 05:42:04 2004 +0000
@@ -1922,7 +1922,7 @@
 window size.  Emacs does not permit overlapping windows or gaps between
 windows, so resizing one window affects other windows.
 
-@deffn Command enlarge-window size &optional horizontal
+@deffn Command enlarge-window size &optional horizontal preserve-before
 This function makes the selected window @var{size} lines taller,
 stealing lines from neighboring windows.  It takes the lines from one
 window at a time until that window is used up, then takes from another.
@@ -1945,6 +1945,11 @@
 size of a fixed-size window, @code{enlarge-window} gets an error
 instead.
 
+If @var{preserve-before} is non-@code{nil}, this function does not
+change the size of the siblings above or to the left of the selected
+window.  Only the size of the siblings below or to the right of the
+selected window are changed.
+
 If @var{size} is negative, this function shrinks the window by
 @minus{}@var{size} lines or columns.  If that makes the window smaller
 than the minimum size (@code{window-min-height} and
@@ -1965,7 +1970,7 @@
 @end example
 @end deffn
 
-@deffn Command shrink-window size &optional horizontal
+@deffn Command shrink-window size &optional horizontal preserve-before
 This function is like @code{enlarge-window} but negates the argument
 @var{size}, making the selected window smaller by giving lines (or
 columns) to the other windows.  If the window shrinks below
--- a/man/ChangeLog	Tue Oct 26 01:28:28 2004 +0000
+++ b/man/ChangeLog	Wed Oct 27 05:42:04 2004 +0000
@@ -1,3 +1,11 @@
+2004-10-23  Eli Zaretskii  <eliz@gnu.org>
+
+	* text.texi (Text Based Tables, Table Definition)
+	(Table Creation, Table Recognition, Cell Commands)
+	(Cell Justification, Row Commands, Column Commands)
+	(Fixed Width Mode, Table Conversion, Measuring Tables)
+	(Table Misc): New nodes, documenting the Table Mode.
+
 2004-10-21  Jay Belanger  <belanger@truman.edu>
 	* calc.texi (Algebraic-Style Calculations): Removed a comment.
 
--- a/man/text.texi	Tue Oct 26 01:28:28 2004 +0000
+++ b/man/text.texi	Wed Oct 27 05:42:04 2004 +0000
@@ -70,6 +70,7 @@
 * HTML Mode::           Editing HTML, SGML, and XML files.
 * Nroff Mode::	        Editing input to the formatter nroff.
 * Formatted Text::      Editing formatted text directly in WYSIWYG fashion.
+* Text Based Tables::   Editing text-based tables in WYSIWYG fashion.
 @end menu
 
 @node Words
@@ -2290,6 +2291,517 @@
 but allow character code conversion and/or automatic uncompression if
 appropriate, use @code{format-find-file} with suitable arguments.
 
+@node Text Based Tables
+@section Editing Text-based Tables
+@cindex table mode
+@cindex text-based tables
+
+  Table Mode provides an easy and intuitive way to create and edit WYSIWYG
+text-based tables.  Here is an example of such a table:
+
+@smallexample
++-----------------+--------------------------------+-----------------+
+|     Command     |          Description           |   Key Binding   |
++-----------------+--------------------------------+-----------------+
+|  forward-char   |Move point right N characters   |       C-f       |
+|                 |(left if N is negative).        |                 |
+|                 |                                |                 |
+|                 |On reaching end of buffer, stop |                 |
+|                 |and signal error.               |                 |
++-----------------+--------------------------------+-----------------+
+|  backward-char  |Move point left N characters    |       C-b       |
+|                 |(right if N is negative).       |                 |
+|                 |                                |                 |
+|                 |On attempt to pass beginning or |                 |
+|                 |end of buffer, stop and signal  |                 |
+|                 |error.                          |                 |
++-----------------+--------------------------------+-----------------+
+@end smallexample
+
+  Table Mode allows the contents of the table such as this one to be
+easily manipulated by inserting or deleting characters inside a cell.
+A cell is effectively a localized rectangular edit region and edits to
+a cell do not affect the contents of the surrounding cells.  If the
+contents do not fit into a cell, then the cell is automatically
+expanded in the vertical and/or horizontal directions and the rest of
+the table is restructured and reformatted in accordance with the
+growth of the cell.
+
+@menu
+* Table Definition::          What is a text based table.
+* Table Creation::            How to create a table.
+* Table Recognition::         How to activate and deactivate tables.
+* Cell Commands::             Cell-oriented commands in a table.
+* Cell Justification::        Justifying cell contents.
+* Row Commands::              Manipulating rows of table cell.
+* Column Commands::           Manipulating columns of table cell.
+* Fixed Width Mode::          Fixing cell width.
+* Table Conversion::          Converting between plain text and tables.
+* Measuring Tables::          Analyzing table dimension.
+* Table Misc::                Table miscellany.
+@end menu
+
+@node Table Definition
+@subsection What is a Text-based Table?
+
+  Look at the following examples of valid tables as a reference while
+you read this section:
+
+@example
+              +--+----+---+     +-+     +--+-----+
+              |  |    |   |     | |     |  |     |
+              +--+----+---+     +-+     |  +--+--+
+              |  |    |   |             |  |  |  |
+              +--+----+---+             +--+--+  |
+                                        |     |  |
+                                        +-----+--+
+@end example
+
+  A table consists of a rectangular frame and the contents inside the
+frame.  A table's cells must be at least one character wide and one
+character high with two adjacent cells sharing a boarder line.  A cell
+can be subdivided into multiple rectangular cells but cannot nest or
+overlap.
+
+  Both the table frame and cell border lines must consist of one of
+three special characters.  The variables that hold these characters
+are described below:
+
+@table @code
+@vindex table-cell-vertical-char
+@item table-cell-vertical-char
+Holds the character used for vertical lines.  The default value is
+@samp{|}.
+
+@vindex table-cell-horizontal-char
+@item table-cell-horizontal-char
+Holds the character used for horizontal lines.  The default value is
+@samp{-}.
+
+@vindex table-cell-intersection-char
+@item table-cell-intersection-char
+Holds the character used at where horizontal line and vertical line
+meet.  The default value is @samp{+}.
+@end table
+
+@noindent
+Based on this definition, the following five tables are examples of invalid
+tables:
+
+@example
+   +-----+    +-----+       +--+    +-++--+    ++
+   |     |    |     |       |  |    | ||  |    ++
+   | +-+ |    |     |       |  |    | ||  |
+   | | | |    +--+  |    +--+--+    +-++--+
+   | +-+ |    |  |  |    |  |  |    +-++--+
+   |     |    |  |  |    |  |  |    | ||  |
+   +-----+    +--+--+    +--+--+    +-++--+
+     a           b          c          d        e
+@end example
+
+From left to right:
+
+@enumerate a
+@item
+Nested cells are not allowed.
+@item
+Overlapped cells or non-rectangular cells are not allowed.
+@item
+The border must be rectangular.
+@item
+Cells must have a minimum width/height of one character.
+@item
+Same as d.
+@end enumerate
+
+@node Table Creation
+@subsection How to Create a Table?
+@cindex create a text-based table
+@cindex table creation
+
+@findex table-insert
+  The command to create a table is @code{table-insert}.  When called
+interactively, it asks for the number of columns, number of rows, cell
+width and cell height.  The number of columns is a number of cells
+within the table's width.  The number of rows is the number of cells
+within the table's height.  The cell width is a number of characters
+that fit within a cell width.  The cell height is a number of lines
+within cell height.  While the number of columns and number of rows
+must be an integer number, the cell width and the cell height can be
+either an integer number (when the value is constant across the table)
+or a series of integer numbers, separated by spaces or commas, where
+each number corresponds to each cell width within a row from left to
+right or each cell height within a column from top to bottom.
+
+@node Table Recognition
+@subsection Table Recognition
+@cindex table recognition
+
+@findex table-recognize
+@findex table-unrecognize
+  Table Mode maintains special text properties in the buffer to allow
+editing in a convenient fashion.  When a buffer with tables is saved
+to its file, these text properties are lost, so when you visit this
+file again later, Emacs does not see a table, but just formatted text.
+To resurrect the table text properties, issue the @kbd{M-x
+table-recognize} command.  It scans the current buffer, recognizes
+valid table cells, and attaches appropriate text properties to allow
+for table editing.  The converse command, @code{table-unrecognize}, is
+used to remove the special text properties and revert the buffer back
+to plain text.
+
+  An optional numeric prefix argument can precede the
+@code{table-recognize} command.  If the argument is negative, tables
+in the buffer become inactive.  This is equivalent to invoking
+@code{table-unrecognize}.
+
+  Similar functions exist to enable or disable tables within a region,
+enable or disable individual tables, and enable/disable individual
+cells.  These commands are:
+
+@table @kbd
+@findex table-recognize-region
+@item M-x table-recognize-region
+Recognize tables within the current region and activate them.
+@findex table-unrecognize-region
+@item M-x table-unrecognize-region
+Deactivate tables within the current region.
+@findex table-recognize-table
+@item M-x table-recognize-table
+Recognize the table under point and activate it.
+@findex table-unrecognize-table
+@item M-x table-unrecognize-table
+Deactivate the table under point.
+@findex table-recognize-cell
+@item M-x table-recognize-cell
+Recognize the cell under point and activate it.
+@findex table-unrecognize-cell
+@item M-x table-unrecognize-cell
+Deactivate the cell under point.
+@end table
+
+  For another way of converting text into tables, see @ref{Table
+Conversion}.
+
+@node Cell Commands
+@subsection Commands for Table Cells
+
+@findex table-forward-cell
+@findex table-backward-cell
+  The commands @code{table-forward-cell} and
+@code{table-backward-cell} move point from the current cell to an
+adjacent cell forward and backward respectively.  The order of the
+cell is wrapped.  When point is positioned in the last cell of a
+table, typing @kbd{M-x table-forward-cell} moves point to the first
+cell in the table.  Likewise @kbd{M-x table-backward-cell} from the
+first cell in a table moves point to the last cell in the table.
+
+@findex table-span-cell
+  The command @code{table-span-cell} spans the current cell into one
+of the four directions---right, left, above or below---and merges the
+current cell with the adjacent cell.  It does not allow directions to
+which spanning does not produce a legitimate cell.
+
+@findex table-split-cell
+@cindex text-based tables, split a cell
+@cindex split table cell
+  The command @code{table-split-cell} splits the current cell
+vertically or horizontally.  This command is a wrapper to the
+direction specific commands @code{table-split-cell-vertically} and
+@code{table-split-cell-horizontally}.
+
+@findex table-split-cell-vertically
+  The command @code{table-split-cell-vertically} splits the current
+cell vertically and creates a pair of cells above and below where
+point is located.  The content in the original cell is split as well.
+
+@findex table-split-cell-horizontally
+  The command @code{table-split-cell-horizontally} splits the current
+cell horizontally and creates a pair of cells right and left of where
+point is located.  If the subject cell to split is not empty the user
+is asked how to handle the cell contents.  The three options are:
+@code{split}, @code{left}, or @code{right}.  @code{split} splits the
+contents at point literally while the @code{left} and @code{right}
+options move the entire contents into the left or right cell
+respectively.
+
+@cindex enlarge a table cell
+@cindex shrink a table cell
+  The next four commands enlarge or shrink a cell.  These commands
+accept numeric arguments (@pxref{Arguments}) to specify how many
+columns or rows to enlarge or shrink a particular table.
+
+@table @kbd
+@findex table-heighten-cell
+@item M-x table-heighten-cell
+Enlarge the current cell vertically.
+@findex table-shorten-cell
+@item M-x table-shorten-cell
+Shrink the current cell vertically.
+@findex table-widen-cell
+@item M-x table-widen-cell
+Enlarge the current cell horizontally.
+@findex table-narrow-cell
+@item M-x table-narrow-cell
+Shrink the current cell horizontally.
+@end table
+
+@node Cell Justification
+@subsection Cell Justification
+@cindex cell text justification
+
+  You can specify text justification for each cell.  The justification
+is remembered independently for each cell and the subsequent editing
+of cell contents is subject to the specified justification.
+
+@findex table-justify
+  The command @code{table-justify} requests the user to specify what
+to justify: a cell,a column, or a row.  If you select cell
+justification, this command sets the justification only to the current
+cell.  Selecting column or row justification set the justification to
+all the cells within a column or row respectively.  The command then
+requests the user to enter which justification to apply: @code{left},
+@code{center}, @code{right}, @code{top}, @code{middle}, @code{bottom},
+or @code{none}.  The options @code{left}, @code{center}, and
+@code{right} specify horizontal justification while the options
+@code{top}, @code{middle}, @code{bottom}, and @code{none} specify
+vertical justification.  The vertical justification @code{none}
+effectively removes vertical justification while horizontal
+justification must be one of @code{left}, @code{center}, or
+@code{right}.  Horizontal justification and vertical justification are
+specified independently.
+
+@vindex table-detect-cell-alignment
+  Justification information is stored in the buffer as a part of text
+property.  Therefore, this information is ephemeral and does not
+survive through the loss of the buffer (closing the buffer and
+revisiting the buffer erase any previous text properties).  To
+countermand for this, the command @code{table-recognize} and other
+recognition commands (@pxref{Table Recognition}) are equipped with a
+convenience feature (turned on by default).  During table recognition,
+the contents of a cell are examined to determine which justification
+was originally applied to the cell and then applies this justification
+to the the cell.  This is a speculative algorithm and is therefore not
+perfect, however, the justification is deduced correctly most of the
+time.  If you desire to disable this feature, customize the variable
+@code{table-detect-cell-alignment} to set it to @code{nil}.
+
+@node Row Commands
+@subsection Commands for Table Rows
+@cindex table row commands
+
+@cindex insert row in table
+@findex table-insert-row
+  The command @code{table-insert-row} inserts a row of cells before
+the current row in a table.  The current row where point is located is
+pushed down after the newly inserted row.  A numeric prefix argument
+specifies the number of rows to insert.  Note that in order to insert
+rows @emph{after} the last row at the bottom of a table, you must
+place point below the table, i.e.@: outside the table, prior to
+invoking this command.
+
+@cindex delete row in table
+@findex table-delete-row
+  The command @code{table-delete-row} deletes a row of cells at point.
+A numeric prefix argument specifies the number of rows to delete.
+
+@node Column Commands
+@subsection Commands for Table Columns
+@cindex table column commands
+
+@cindex insert column in table
+@findex table-insert-column
+  The command @code{table-insert-column} inserts a column of cells to
+the left of the current row in a table.  The current column where
+point is located at is pushed right of the newly inserted column.  To
+insert a column to the right side of the right most column, place
+point to the right of the rightmost column, which is outside of the
+table, prior to invoking this command.  A numeric prefix argument
+specifies the number of columns to insert.
+
+@cindex delete column in table
+  A command @code{table-delete-column} deletes a column of cells at
+point.  A numeric prefix argument specifies the number of columns to
+delete.
+
+@node Fixed Width Mode
+@subsection Fix Width of Cells
+@cindex fix width of table cells
+
+@findex table-fixed-width-mode
+  The command @code{table-fixed-width-mode} toggles fixed width mode
+on and off.  When the fixed width mode is turned on, editing inside a
+cell never changes the cell width; when it is off, the cell width
+expands automatically in order to prevent a word from being folded
+into multiple lines.  By default, the fixed width mode is turned off.
+
+
+@node Table Conversion
+@subsection Conversion Between Plain Text and Tables
+@cindex text to table
+@cindex table to text
+
+@findex table-capture
+  The command @code{table-capture} captures plain text in a region and
+turns it into a table.  Unlike @code{table-recognize} (@pxref{Table
+Recognition}), the original text does not have a table appearance but
+may hold a logical table structure.  For example, some elements
+separated by known patterns form a two dimensional structure which can
+be turned into a table.  Look at the numbers below.  The numbers are
+horizontally separated by a comma and vertically separated by a
+newline character.
+
+@example
+1, 2, 3, 4
+5, 6, 7, 8
+, 9, 10
+@end example
+
+@noindent
+When you invoke @kbd{M-x table-capture} on the above three-line
+region, the region can be turned into the next table:
+
+@example
++-----+-----+-----+-----+
+|1    |2    |3    |4    |
++-----+-----+-----+-----+
+|5    |6    |7    |8    |
++-----+-----+-----+-----+
+|     |9    |10   |     |
++-----+-----+-----+-----+
+@end example
+
+@noindent
+where @samp{,} is used for a column delimiter regexp, a newline is
+used for a row delimiter regexp, cells are left justified, and minimum
+cell width is 5.
+
+@findex table-release
+  The command @code{table-release} does the opposite of
+@code{table-capture}.  It releases a table by removing the table frame
+and cell borders.  This leaves the table contents as plain text.  One
+of the useful applications of @code{table-capture} and
+@code{table-release} is to edit a text in layout.  Look at the
+following three paragraphs (the latter two are indented with header
+lines):
+
+@example
+@samp{table-capture} is a powerful command however mastering its power
+requires some practice.  Here is a list of items what it can do.
+
+Parse Cell Items      By using column delimiter regular
+                      expression and raw delimiter regular
+                      expression, it parses the specified text
+                      area and extracts cell items from
+                      non-table text and then forms a table out
+                      of them.
+
+Capture Text Area     When no delimiters are specified it
+                      creates a single cell table.  The text in
+                      the specified region is placed in that
+                      cell.
+@end example
+
+@noindent
+Applying @code{table-capture} to a region containing the above three
+paragraphs, with empty strings for column delimiter regexp and row
+delimiter regexp, creates a table with a single cell like the
+following one.
+
+@c The first line's right-hand frame in the following two examples
+@c sticks out to accommodate for the removal of @samp in the
+@c produced output!!
+@example
++-----------------------------------------------------------------+
+|@samp{table-capture} is a powerful command however mastering its      |
+|power requires some practice.  Here is a list of items what it   |
+|can do.                                                          |
+|                                                                 |
+|Parse Cell Items      By using column delimiter regular          |
+|                      expression and raw delimiter regular       |
+|                      expression, it parses the specified text   |
+|                      area and extracts cell items from          |
+|                      non-table text and then forms a table out  |
+|                      of them.                                   |
+|                                                                 |
+|Capture Text Area     When no delimiters are specified it        |
+|                      creates a single cell table.  The text in  |
+|                      the specified region is placed in that     |
+|                      cell.                                      |
++-----------------------------------------------------------------+
+@end example
+
+@noindent
+By splitting the cell appropriately we now have a table consisting of
+paragraphs occupying its own cell.  Each cell can now be edited
+independently without affecting the layout of other cells.
+
+@example
++-----------------------------------------------------------------+
+|@samp{table-capture} is a powerful command however mastering its      |
+|power requires some practice.  Here is a list of items what it   |
+|can do.                                                          |
++---------------------+-------------------------------------------+
+|Parse Cell Items     |By using column delimiter regular          |
+|                     |expression and raw delimiter regular       |
+|                     |expression, it parses the specified text   |
+|                     |area and extracts cell items from          |
+|                     |non-table text and then forms a table out  |
+|                     |of them.                                   |
++---------------------+-------------------------------------------+
+|Capture Text Area    |When no delimiters are specified it        |
+|                     |creates a single cell table.  The text in  |
+|                     |the specified region is placed in that     |
+|                     |cell.                                      |
++---------------------+-------------------------------------------+
+@end example
+
+@noindent
+By applying @code{table-release}, which does the opposite process, the
+contents become once again plain text.  @code{table-release} works as
+a companion command to @code{table-capture}.
+
+@node Measuring Tables
+@subsection Analyzing Table Dimensions
+@cindex table dimensions
+
+@findex table-query-dimension
+  The command @code{table-query-dimension} analyzes a table structure
+and reports information regarding its dimensions.  In case of the
+above example table, the @code{table-query-dimension} command displays
+in echo area:
+
+@smallexample
+Cell: (21w, 6h), Table: (67w, 16h), Dim: (2c, 3r), Total Cells: 5
+@end smallexample
+
+@noindent
+This indicates that the current cell is 21 character wide and 6 lines
+high, the entire table is 67 characters wide and 16 lines high.  The
+table has 2 columns and 3 rows.  It has a total of 5 cells, since the
+first row has a spanned cell.
+
+@node Table Misc
+@subsection Table Miscellany
+
+@cindex insert string into table cells
+@findex table-insert-sequence
+  The command @code{table-insert-sequence} inserts a string into each
+cell.  Each string is a part of a sequence i.e.@: a series of
+increasing integer numbers.
+
+@cindex table in language format
+@cindex table for HTML and LaTeX
+@findex table-generate-source
+The command @code{table-generate-source} generates a table formatted
+for a specific markup language.  It asks for a language (which must be
+one of @code{html}, @code{latex}, or @code{cals}), a destination
+buffer where to put the result, and the table caption (a string), and
+then inserts the generated table in the proper syntax into the
+destination buffer.  The default destination buffer is
+@code{table.@var{lang}}, where @var{lang} is the language you
+specified.
+
 @ignore
    arch-tag: 8db54ed8-2036-49ca-b0df-23811d03dc70
 @end ignore
--- a/nt/INSTALL	Tue Oct 26 01:28:28 2004 +0000
+++ b/nt/INSTALL	Wed Oct 27 05:42:04 2004 +0000
@@ -54,7 +54,9 @@
 
   In addition, using 4NT as your shell is known to fail the build process,
   at least for 4NT version 3.01.  Use cmd.exe, the default NT shell,
-  instead.
+  instead. MSYS sh.exe also appears to cause various problems. If you have
+  MSYS installed, try "make SHELL=cmd.exe" to force the use of cmd.exe
+  instead of sh.exe.
 
                                          sh exists     no sh
 
--- a/src/ChangeLog	Tue Oct 26 01:28:28 2004 +0000
+++ b/src/ChangeLog	Wed Oct 27 05:42:04 2004 +0000
@@ -1,3 +1,46 @@
+2004-10-26  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* gtkutil.c: Put empty line between comment and function body.
+	(xg_destroy_widgets): Renamed from remove_from_container.  Just
+	destroy all widgets in list.  Argument wcont removed.
+	(xg_update_menubar, xg_update_submenu): Call xg_destroy_widgets
+	instead of remove_from_container.
+	(xg_display_close, xg_create_tool_bar, update_frame_tool_bar)
+	(free_frame_tool_bar): Add comment.
+
+	* xfns.c (xic_create_xfontset): Check that FRAME_XIC_BASE_FONTNAME
+	is not NULL before strcmp.
+
+2004-10-26  Kim F. Storm  <storm@cua.dk>
+
+	* callint.c (Fcall_interactively): Add 'U' code to get the
+	up-event discarded by a previous 'k' or 'K' argument.
+
+2004-10-26  David Kastrup  <dak@gnu.org>
+
+	* buffer.c (syms_of_buffer): Fix a few typos.
+
+2004-10-26  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* xsmfns.c: Put empty line between comment and function body.
+	Use two spaces before comment end.
+
+2004-10-25  Kenichi Handa  <handa@m17n.org>
+
+	* fontset.c (fontset_pattern_regexp): Optimize for the case that
+	PATTERN is full XLFD.
+
+2004-10-24  Kenichi Handa  <handa@m17n.org>
+
+	* regex.h (enum reg_errcode_t): New value REG_ERANGEX.
+
+	* regex.c (re_error_msgid): Add an entry for REG_ERANGEX.
+	(regex_compile): Return REG_ERANGEX if appropriate.
+
+2004-10-22  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* xfns.c (xic_create_xfontset): Initialize missing_list to NULL.
+
 2004-10-21  K,Aa(Broly L$,1 q(Brentey  <lorentey@elte.hu>
 
         * xterm.h (x_output): New member `xic_base_fontname'.
--- a/src/buffer.c	Tue Oct 26 01:28:28 2004 +0000
+++ b/src/buffer.c	Wed Oct 27 05:42:04 2004 +0000
@@ -5828,21 +5828,21 @@
 		     doc: /* Non-nil means that Emacs should use caches to handle long lines more quickly.
 
 Normally, the line-motion functions work by scanning the buffer for
-newlines.  Columnar operations (like move-to-column and
-compute-motion) also work by scanning the buffer, summing character
+newlines.  Columnar operations (like `move-to-column' and
+`compute-motion') also work by scanning the buffer, summing character
 widths as they go.  This works well for ordinary text, but if the
 buffer's lines are very long (say, more than 500 characters), these
 motion functions will take longer to execute.  Emacs may also take
 longer to update the display.
 
-If cache-long-line-scans is non-nil, these motion functions cache the
+If `cache-long-line-scans' is non-nil, these motion functions cache the
 results of their scans, and consult the cache to avoid rescanning
 regions of the buffer until the text is modified.  The caches are most
 beneficial when they prevent the most searching---that is, when the
 buffer contains long lines and large regions of characters with the
 same, fixed screen width.
 
-When cache-long-line-scans is non-nil, processing short lines will
+When `cache-long-line-scans' is non-nil, processing short lines will
 become slightly slower (because of the overhead of consulting the
 cache), and the caches will use memory roughly proportional to the
 number of newlines and characters whose screen width varies.
@@ -5922,8 +5922,8 @@
   hollow	 display a hollow box cursor
   bar		 display a vertical bar cursor with default width
   (bar . WIDTH)	 display a vertical bar cursor with width WIDTH
-  hbar		 display a horisontal bar cursor with default width
-  (hbar . WIDTH) display a horisontal bar cursor with width WIDTH
+  hbar		 display a horizontal bar cursor with default width
+  (hbar . WIDTH) display a horizontal bar cursor with width WIDTH
   ANYTHING ELSE	 display a hollow box cursor.
 
 When the buffer is displayed in a nonselected window,
--- a/src/callint.c	Tue Oct 26 01:28:28 2004 +0000
+++ b/src/callint.c	Wed Oct 27 05:42:04 2004 +0000
@@ -110,6 +110,7 @@
 r -- Region: point and mark as 2 numeric args, smallest first.  Does no I/O.
 s -- Any string.  Does not inherit the current input method.
 S -- Any symbol.
+U -- Mouse up event discarded by a previous k or K argument.
 v -- Variable name: symbol that is user-variable-p.
 x -- Lisp expression read but not evaluated.
 X -- Lisp expression read and evaluated.
@@ -268,6 +269,7 @@
   Lisp_Object specs;
   Lisp_Object filter_specs;
   Lisp_Object teml;
+  Lisp_Object up_event;
   Lisp_Object enable;
   int speccount = SPECPDL_INDEX ();
 
@@ -289,7 +291,7 @@
   char prompt1[100];
   char *tem1;
   int arg_from_tty = 0;
-  struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
+  struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
   int key_count;
   int record_then_fail = 0;
 
@@ -328,6 +330,9 @@
      The feature is not fully implemented.  */
   filter_specs = Qnil;
 
+  /* If k or K discard an up-event, save it here so it can be retrieved with U */
+  up_event = Qnil;
+
   /* Decode the kind of function.  Either handle it and return,
      or go to `lose' if not interactive, or go to `retry'
      to specify a different function, or set either STRING or SPECS.  */
@@ -499,7 +504,7 @@
       varies[i] = 0;
     }
 
-  GCPRO4 (prefix_arg, function, *args, *visargs);
+  GCPRO5 (prefix_arg, function, *args, *visargs, up_event);
   gcpro3.nvars = (count + 1);
   gcpro4.nvars = (count + 1);
 
@@ -628,7 +633,7 @@
 		/* Ignore first element, which is the base key.  */
 		tem2 = Fmemq (intern ("down"), Fcdr (teml));
 		if (! NILP (tem2))
-		  Fread_event (Qnil, Qnil);
+		  up_event = Fread_event (Qnil, Qnil);
 	      }
 	  }
 	  break;
@@ -656,11 +661,21 @@
 		/* Ignore first element, which is the base key.  */
 		tem2 = Fmemq (intern ("down"), Fcdr (teml));
 		if (! NILP (tem2))
-		  Fread_event (Qnil, Qnil);
+		  up_event = Fread_event (Qnil, Qnil);
 	      }
 	  }
 	  break;
 
+	case 'U':		/* Up event from last k or K */
+	  if (!NILP (up_event))
+	    {
+	      args[i] = Fmake_vector (make_number (1), up_event);
+	      up_event = Qnil;
+	      teml = args[i];
+	      visargs[i] = Fkey_description (teml, Qnil);
+	    }
+	  break;
+
 	case 'e':		/* The invoking event.  */
 	  if (next_event >= key_count)
 	    error ("%s must be bound to an event with parameters",
--- a/src/fontset.c	Tue Oct 26 01:28:28 2004 +0000
+++ b/src/fontset.c	Wed Oct 27 05:42:04 2004 +0000
@@ -1069,16 +1069,34 @@
       || strcmp (SDATA (pattern), CACHED_FONTSET_NAME))
     {
       /* We must at first update the cached data.  */
-      char *regex = (char *) alloca (SCHARS (pattern) * 2 + 3);
-      char *p0, *p1 = regex;
+      char *regex, *p0, *p1;
+      int ndashes = 0, nstars = 0;
+      
+      for (p0 = SDATA (pattern); *p0; p0++)
+	{
+	  if (*p0 == '-')
+	    ndashes++;
+	  else if (*p0 == '*')
+	    nstars++;
+	}
 
-      /* Convert "*" to ".*", "?" to ".".  */
+      /* If PATTERN is not full XLFD we conert "*" to ".*".  Otherwise
+	 we convert "*" to "[^-]*" which is much faster in regular
+	 expression matching.  */
+      if (ndashes < 14)
+	p1 = regex = (char *) alloca (SBYTES (pattern) + 2 * nstars + 1);
+      else
+	p1 = regex = (char *) alloca (SBYTES (pattern) + 5 * nstars + 1);
+
       *p1++ = '^';
       for (p0 = (char *) SDATA (pattern); *p0; p0++)
 	{
 	  if (*p0 == '*')
 	    {
-	      *p1++ = '.';
+	      if (ndashes < 14)
+		*p1++ = '.';
+	      else
+		*p1++ = '[', *p1++ = '^', *p1++ = '-', *p1++ = ']';
 	      *p1++ = '*';
 	    }
 	  else if (*p0 == '?')
--- a/src/gtkutil.c	Tue Oct 26 01:28:28 2004 +0000
+++ b/src/gtkutil.c	Wed Oct 27 05:42:04 2004 +0000
@@ -48,6 +48,7 @@
 #ifdef HAVE_GTK_MULTIDISPLAY
 
 /* Return the GdkDisplay that corresponds to the X display DPY.  */
+
 static GdkDisplay *
 xg_get_gdk_display (dpy)
      Display *dpy;
@@ -58,6 +59,7 @@
 /* When the GTK widget W is to be created on a display for F that
    is not the default display, set the display for W.
    W can be a GtkMenu or a GtkWindow widget.  */
+
 static void
 xg_set_screen (w, f)
      GtkWidget *w;
@@ -80,6 +82,7 @@
 
 /* Make some defines so we can use the GTK 2.2 functions when
    compiling with GTK 2.0.  */
+
 #define xg_set_screen(w, f)
 #define gdk_xid_table_lookup_for_display(dpy, w)    gdk_xid_table_lookup (w)
 #define gdk_pixmap_foreign_new_for_display(dpy, p)  gdk_pixmap_foreign_new (p)
@@ -95,6 +98,7 @@
    Returns non-zero if display could be opened, zero if display could not
    be opened, and less than zero if the GTK version doesn't support
    multipe displays.  */
+
 int
 xg_display_open (display_name, dpy)
      char *display_name;
@@ -115,6 +119,8 @@
 }
 
 
+/* Close display DPY.  */
+
 void
 xg_display_close (Display *dpy)
 {
@@ -176,6 +182,7 @@
    widget_value_free_list or by malloc:ing a new one.
 
    Return a pointer to the allocated structure.  */
+
 widget_value *
 malloc_widget_value ()
 {
@@ -197,6 +204,7 @@
 
 /* This is analogous to free.  It frees only what was allocated
    by malloc_widget_value, and no substructures.  */
+
 void
 free_widget_value (wv)
      widget_value *wv;
@@ -221,6 +229,7 @@
 
 /* Create and return the cursor to be used for popup menus and
    scroll bars on display DPY.  */
+
 GdkCursor *
 xg_create_default_cursor (dpy)
      Display *dpy;
@@ -239,6 +248,7 @@
    WIDGET is used to find the GdkColormap to use for the GdkPixbuf.
    If OLD_WIDGET is NULL, a new widget is constructed and returned.
    If OLD_WIDGET is not NULL, that widget is modified.  */
+
 static GtkWidget *
 xg_get_image_for_pixmap (f, img, widget, old_widget)
      FRAME_PTR f;
@@ -373,6 +383,7 @@
 /* Set CURSOR on W and all widgets W contain.  We must do like this
    for scroll bars and menu because they create widgets internally,
    and it is those widgets that are visible.  */
+
 static void
 xg_set_cursor (w, cursor)
      GtkWidget *w;
@@ -400,6 +411,7 @@
     has expired by calling the GTK event loop.
     Also, when a menu is active, it has a small timeout before it
     pops down the sub menu under it.  */
+
 static void
 xg_process_timeouts (timer)
      struct atimer *timer;
@@ -415,6 +427,7 @@
 /* Start the xg_timer with an interval of 0.1 seconds, if not already started.
    xg_process_timeouts is called when the timer expires.  The timer
    started is continuous, i.e. runs until xg_stop_timer is called.  */
+
 static void
 xg_start_timer ()
 {
@@ -430,6 +443,7 @@
 }
 
 /* Stop the xg_timer if started.  */
+
 static void
 xg_stop_timer ()
 {
@@ -441,6 +455,7 @@
 }
 
 /* Insert NODE into linked LIST.  */
+
 static void
 xg_list_insert (xg_list_node *list, xg_list_node *node)
 {
@@ -453,6 +468,7 @@
 }
 
 /* Remove NODE from linked LIST.  */
+
 static void
 xg_list_remove (xg_list_node *list, xg_list_node *node)
 {
@@ -473,6 +489,7 @@
    utf8 or NULL, just return STR.
    If not, a new string is allocated and the caller must free the result
    with g_free.  */
+
 static char *
 get_utf8_string (str)
      char *str;
@@ -496,6 +513,7 @@
    only way to get geometry position right if the user explicitly
    asked for a position when starting Emacs.
    F is the frame we shall set geometry for.  */
+
 static void
 xg_set_geometry (f)
      FRAME_PTR f;
@@ -529,6 +547,7 @@
 /* Resize the outer window of frame F after chainging the height.
    This happend when the menu bar or the tool bar is added or removed.
    COLUMNS/ROWS is the size the edit area shall have after the resize.  */
+
 static void
 xg_resize_outer_widget (f, columns, rows)
      FRAME_PTR f;
@@ -555,6 +574,7 @@
    manually.
    F is the frame to resize.
    PIXELWIDTH, PIXELHEIGHT is the new size in pixels.  */
+
 void
 xg_resize_widgets (f, pixelwidth, pixelheight)
      FRAME_PTR f;
@@ -591,6 +611,7 @@
 
 
 /* Update our widget size to be COLS/ROWS characters for frame F.  */
+
 void
 xg_frame_set_char_size (f, cols, rows)
      FRAME_PTR f;
@@ -630,6 +651,7 @@
    X Window that aren't accessible.
 
    Return 0 if no widget match WDESC.  */
+
 GtkWidget *
 xg_win_to_widget (dpy, wdesc)
      Display *dpy;
@@ -655,6 +677,7 @@
 
 /* Fill in the GdkColor C so that it represents PIXEL.
    W is the widget that color will be used for.  Used to find colormap.  */
+
 static void
 xg_pix_to_gcolor (w, pixel, c)
      GtkWidget *w;
@@ -667,6 +690,7 @@
 
 /* Create and set up the GTK widgets for frame F.
    Return 0 if creation failed, non-zero otherwise.  */
+
 int
 xg_create_frame_widgets (f)
      FRAME_PTR f;
@@ -802,6 +826,7 @@
    that the window now has.
    If USER_POSITION is nonzero, we set the User Position
    flag (this is useful when FLAGS is 0).  */
+
 void
 x_wm_set_size_hint (f, flags, user_position)
      FRAME_PTR f;
@@ -900,6 +925,7 @@
    keep the GTK and X colors in sync.
    F is the frame to change,
    BG is the pixel value to change to.  */
+
 void
 xg_set_background_color (f, bg)
      FRAME_PTR f;
@@ -923,6 +949,7 @@
  ***********************************************************************/
 /* Return the dialog title to use for a dialog of type KEY.
    This is the encoding used by lwlib.  We use the same for GTK.  */
+
 static char *
 get_dialog_title (char key)
 {
@@ -963,6 +990,7 @@
    user_data is NULL (not used).
 
    Returns TRUE to end propagation of event.  */
+
 static gboolean
 dialog_delete_callback (w, event, user_data)
      GtkWidget *w;
@@ -979,6 +1007,7 @@
    DEACTIVATE_CB is the callback to use when the dialog pops down.
 
    Returns the GTK dialog widget.  */
+
 static GtkWidget *
 create_dialog (wv, select_cb, deactivate_cb)
      widget_value *wv;
@@ -1101,6 +1130,7 @@
    a file dialog.
    W is the file dialog widget,
    ARG points to an integer where we record what has happend.  */
+
 static void
 xg_file_sel_ok (w, arg)
      GtkWidget *w;
@@ -1113,6 +1143,7 @@
    a file dialog.
    W is the file dialog widget,
    ARG points to an integer where we record what has happend.  */
+
 static void
 xg_file_sel_cancel (w, arg)
      GtkWidget *w;
@@ -1127,6 +1158,7 @@
    the dialog is popped down, but the dialog widget is not destroyed.
    W is the file dialog widget,
    ARG points to an integer where we record what has happend.  */
+
 static void
 xg_file_sel_destroy (w, arg)
      GtkWidget *w;
@@ -1144,6 +1176,7 @@
 
    Returns a file name or NULL if no file was selected.
    The returned string must be freed by the caller.  */
+
 char *
 xg_get_file_name (f, prompt, default_filename, mustmatch_p)
      FRAME_PTR f;
@@ -1234,6 +1267,7 @@
 
    Returns CL_DATA if CL_DATA is not NULL,  or a pointer to a newly
    allocated xg_menu_cb_data if CL_DATA is NULL.  */
+
 static xg_menu_cb_data *
 make_cl_data (cl_data, f, highlight_cb)
      xg_menu_cb_data *cl_data;
@@ -1267,6 +1301,7 @@
    HIGHLIGHT_CB could change, there is no check that the same
    function is given when modifying a menu bar as was given when
    creating the menu bar.  */
+
 static void
 update_cl_data (cl_data, f, highlight_cb)
      xg_menu_cb_data *cl_data;
@@ -1284,6 +1319,7 @@
 
 /* Decrease reference count for CL_DATA.
    If reference count is zero, free CL_DATA.  */
+
 static void
 unref_cl_data (cl_data)
      xg_menu_cb_data *cl_data;
@@ -1300,6 +1336,7 @@
 }
 
 /* Function that marks all lisp data during GC.  */
+
 void
 xg_mark_data ()
 {
@@ -1321,6 +1358,7 @@
 /* Callback called when a menu item is destroyed.  Used to free data.
    W is the widget that is being destroyed (not used).
    CLIENT_DATA points to the xg_menu_item_cb_data associated with the W.  */
+
 static void
 menuitem_destroy_callback (w, client_data)
      GtkWidget *w;
@@ -1340,6 +1378,7 @@
    CLIENT_DATA points to the xg_menu_item_cb_data associated with the W.
 
    Returns FALSE to tell GTK to keep processing this event.  */
+
 static gboolean
 menuitem_highlight_callback (w, event, client_data)
      GtkWidget *w;
@@ -1364,6 +1403,7 @@
 /* Callback called when a menu is destroyed.  Used to free data.
    W is the widget that is being destroyed (not used).
    CLIENT_DATA points to the xg_menu_cb_data associated with W.  */
+
 static void
 menu_destroy_callback (w, client_data)
      GtkWidget *w;
@@ -1379,6 +1419,7 @@
    W is the widget that does the grab (not used).
    UNGRAB_P is TRUE if this is an ungrab, FALSE if it is a grab.
    CLIENT_DATA is NULL (not used).  */
+
 static void
 menu_grab_callback (GtkWidget *widget,
                     gboolean ungrab_p,
@@ -1398,6 +1439,7 @@
    must be non-NULL) and can be inserted into a menu item.
 
    Returns the GtkHBox.  */
+
 static GtkWidget *
 make_widget_for_menu_item (utf8_label, utf8_key)
      char *utf8_label;
@@ -1437,6 +1479,7 @@
 
    Unfortunately, keys don't line up as nicely as in Motif,
    but the MacOS X version doesn't either, so I guess that is OK.  */
+
 static GtkWidget *
 make_menu_item (utf8_label, utf8_key, item, group)
      char *utf8_label;
@@ -1486,6 +1529,7 @@
 
 /* Return non-zero if LABEL specifies a separator (GTK only has one
    separator type)  */
+
 static int
 xg_separator_p (char *label)
 {
@@ -1534,6 +1578,7 @@
 static int xg_detached_menus;
 
 /* Returns non-zero if there are detached menus.  */
+
 int
 xg_have_tear_offs ()
 {
@@ -1544,6 +1589,7 @@
    decrease the xg_detached_menus count.
    WIDGET is the top level window that is removed (the parent of the menu).
    CLIENT_DATA is not used.  */
+
 static void
 tearoff_remove (widget, client_data)
      GtkWidget *widget;
@@ -1556,6 +1602,7 @@
    xg_detached_menus count.
    WIDGET is the GtkTearoffMenuItem.
    CLIENT_DATA is not used.  */
+
 static void
 tearoff_activate (widget, client_data)
      GtkWidget *widget;
@@ -1585,6 +1632,7 @@
    in the group.  On exit, *GROUP contains the radio item group.
 
    Returns the created GtkWidget.  */
+
 static GtkWidget *
 xg_create_one_menuitem (item, f, select_cb, highlight_cb, cl_data, group)
      widget_value *item;
@@ -1802,6 +1850,7 @@
    HIGHLIGHT_CB is the callback to call when entering/leaving menu items.
 
    Returns the widget created.  */
+
 GtkWidget *
 xg_create_widget (type, name, f, val,
                   select_cb, deactivate_cb, highlight_cb)
@@ -1859,6 +1908,7 @@
 }
 
 /* Return the label for menu item WITEM.  */
+
 static const char *
 xg_get_menu_item_label (witem)
      GtkMenuItem *witem;
@@ -1868,6 +1918,7 @@
 }
 
 /* Return non-zero if the menu item WITEM has the text LABEL.  */
+
 static int
 xg_item_label_same_p (witem, label)
      GtkMenuItem *witem;
@@ -1887,10 +1938,10 @@
   return is_same;
 }
 
-/* Remove widgets in LIST from container WCONT.  */
+/* Destroy widgets in LIST.  */
+
 static void
-remove_from_container (wcont, list)
-     GtkWidget *wcont;
+xg_destroy_widgets (list)
      GList *list;
 {
   GList *iter;
@@ -1899,15 +1950,7 @@
     {
       GtkWidget *w = GTK_WIDGET (iter->data);
 
-      /* Add a ref to w so we can explicitly destroy it later.  */
-      gtk_widget_ref (w);
-      gtk_container_remove (GTK_CONTAINER (wcont), w);
-
-      /* If there is a menu under this widget that has been detached,
-         there is a reference to it, and just removing w from the
-         container does not destroy the submenu.  By explicitly
-         destroying w we make sure the submenu is destroyed, thus
-         removing the detached window also if there was one.  */
+      /* Destroying the widget will remove it from the container it is in.  */
       gtk_widget_destroy (w);
     }
 }
@@ -1923,6 +1966,7 @@
    CL_DATA points to the callback data to be used for this menu bar.
 
    This function calls itself to walk through the menu bar names.  */
+
 static void
 xg_update_menubar (menubar, f, list, iter, pos, val,
                    select_cb, highlight_cb, cl_data)
@@ -1941,7 +1985,7 @@
   else if (iter && ! val)
     {
       /* Item(s) have been removed.  Remove all remaining items.  */
-      remove_from_container (menubar, iter);
+      xg_destroy_widgets (iter);
 
       /* All updated.  */
       val = 0;
@@ -2095,6 +2139,7 @@
    SELECT_CB is the callback to use when a menu item is selected.
    HIGHLIGHT_CB is the callback to call when entering/leaving menu items.
    CL_DATA is the data to set in the widget for menu invokation.  */
+
 static void
 xg_update_menu_item (val, w, select_cb, highlight_cb, cl_data)
      widget_value *val;
@@ -2229,6 +2274,7 @@
 }
 
 /* Update the toggle menu item W so it corresponds to VAL.  */
+
 static void
 xg_update_toggle_item (val, w)
      widget_value *val;
@@ -2238,6 +2284,7 @@
 }
 
 /* Update the radio menu item W so it corresponds to VAL.  */
+
 static void
 xg_update_radio_item (val, w)
      widget_value *val;
@@ -2367,8 +2414,8 @@
     {
       /* If we are adding new menu items below, we must remove from
          first radio button so that radio groups become correct.  */
-      if (cur && first_radio) remove_from_container (submenu, first_radio);
-      else remove_from_container (submenu, iter);
+      if (cur && first_radio) xg_destroy_widgets (first_radio);
+      else xg_destroy_widgets (iter);
     }
 
   if (cur)
@@ -2400,6 +2447,7 @@
    SELECT_CB is the callback to use when a menu item is selected.
    DEACTIVATE_CB is the callback to use when a sub menu is not shown anymore.
    HIGHLIGHT_CB is the callback to call when entering/leaving menu items.  */
+
 void
 xg_modify_menubar_widgets (menubar, f, val, deep_p,
                            select_cb, deactivate_cb, highlight_cb)
@@ -2544,12 +2592,14 @@
 
 /* Setting scroll bar values invokes the callback.  Use this variable
    to indicate that callback should do nothing.  */
+
 int xg_ignore_gtk_scrollbar;
 
 /* SET_SCROLL_BAR_X_WINDOW assumes the second argument fits in
    32 bits.  But we want to store pointers, and they may be larger
    than 32 bits.  Keep a mapping from integer index to widget pointers
    to get around the 32 bit limitation.  */
+
 static struct
 {
   GtkWidget **widgets;
@@ -2558,9 +2608,11 @@
 } id_to_widget;
 
 /* Grow this much every time we need to allocate more  */
+
 #define ID_TO_WIDGET_INCR  32
 
 /* Store the widget pointer W in id_to_widget and return the integer index.  */
+
 static int
 xg_store_widget_in_map (w)
      GtkWidget *w;
@@ -2599,6 +2651,7 @@
 
 /* Remove pointer at IDX from id_to_widget.
    Called when scroll bar is destroyed.  */
+
 static void
 xg_remove_widget_from_map (idx)
      int idx;
@@ -2611,6 +2664,7 @@
 }
 
 /* Get the widget pointer at IDX from id_to_widget. */
+
 static GtkWidget *
 xg_get_widget_from_map (idx)
      int idx;
@@ -2623,6 +2677,7 @@
 
 /* Return the scrollbar id for X Window WID on display DPY.
    Return -1 if WID not in id_to_widget.  */
+
 int
 xg_get_scroll_id_for_window (dpy, wid)
      Display *dpy;
@@ -2646,6 +2701,7 @@
 /* Callback invoked when scroll bar WIDGET is destroyed.
    DATA is the index into id_to_widget for WIDGET.
    We free pointer to last scroll bar values here and remove the index.  */
+
 static void
 xg_gtk_scroll_destroy (widget, data)
      GtkWidget *widget;
@@ -2668,6 +2724,7 @@
 
    Returns FALSE to tell GTK that it shall continue propagate the event
    to widgets.  */
+
 static gboolean
 scroll_bar_button_cb (widget, event, user_data)
      GtkWidget *widget;
@@ -2692,6 +2749,7 @@
    bar changes.
    SCROLL_BAR_NAME is the name we use for the scroll bar.  Can be used
    to set resources for the widget.  */
+
 void
 xg_create_scroll_bar (f, bar, scroll_callback, scroll_bar_name)
      FRAME_PTR f;
@@ -2753,6 +2811,7 @@
 }
 
 /* Make the scroll bar represented by SCROLLBAR_ID visible.  */
+
 void
 xg_show_scroll_bar (scrollbar_id)
      int scrollbar_id;
@@ -2763,6 +2822,7 @@
 }
 
 /* Remove the scroll bar represented by SCROLLBAR_ID from the frame F.  */
+
 void
 xg_remove_scroll_bar (f, scrollbar_id)
      FRAME_PTR f;
@@ -2782,6 +2842,7 @@
    in frame F.
    TOP/LEFT are the new pixel positions where the bar shall appear.
    WIDTH, HEIGHT is the size in pixels the bar shall have.  */
+
 void
 xg_update_scrollbar_pos (f, scrollbar_id, top, left, width, height)
      FRAME_PTR f;
@@ -2810,6 +2871,7 @@
 
 /* Set the thumb size and position of scroll bar BAR.  We are currently
    displaying PORTION out of a whole WHOLE, and our position POSITION.  */
+
 void
 xg_set_toolkit_scroll_bar_thumb (bar, portion, position, whole)
      struct scroll_bar *bar;
@@ -2902,6 +2964,7 @@
    W is the button widget in the tool bar that got pressed,
    CLIENT_DATA is an integer that is the index of the button in the
    tool bar.  0 is the first button.  */
+
 static void
 xg_tool_bar_callback (w, client_data)
      GtkWidget *w;
@@ -2938,6 +3001,7 @@
    WBOX is the handle box widget that enables detach/attach of the tool bar.
    W is the tool bar widget.
    CLIENT_DATA is a pointer to the frame the tool bar belongs to.  */
+
 static void
 xg_tool_bar_detach_callback (wbox, w, client_data)
      GtkHandleBox *wbox;
@@ -2966,6 +3030,7 @@
    WBOX is the handle box widget that enables detach/attach of the tool bar.
    W is the tool bar widget.
    CLIENT_DATA is a pointer to the frame the tool bar belongs to.  */
+
 static void
 xg_tool_bar_attach_callback (wbox, w, client_data)
      GtkHandleBox *wbox;
@@ -2995,6 +3060,7 @@
    tool bar.  0 is the first button.
 
    Returns FALSE to tell GTK to keep processing this event.  */
+
 static gboolean
 xg_tool_bar_help_callback (w, event, client_data)
      GtkWidget *w;
@@ -3040,6 +3106,7 @@
    CLIENT_DATA is unused.
 
    Returns FALSE to tell GTK to keep processing this event.  */
+
 static gboolean
 xg_tool_bar_item_expose_callback (w, event, client_data)
      GtkWidget *w;
@@ -3070,6 +3137,7 @@
    CLIENT_DATA is pointing to the frame for this tool bar.
 
    Returns FALSE to tell GTK to keep processing this event.  */
+
 static gboolean
 xg_tool_bar_expose_callback (w, event, client_data)
      GtkWidget *w;
@@ -3080,6 +3148,8 @@
   return FALSE;
 }
 
+/* Create a tool bar for frame F.  */
+
 static void
 xg_create_tool_bar (f)
      FRAME_PTR f;
@@ -3133,6 +3203,8 @@
   SET_FRAME_GARBAGED (f);
 }
 
+/* Update the tool bar for frame F.  Add new buttons and remove old.  */
+
 void
 update_frame_tool_bar (f)
      FRAME_PTR f;
@@ -3300,6 +3372,9 @@
   UNBLOCK_INPUT;
 }
 
+/* Deallocate all resources for the tool bar on frame F.
+   Remove the tool bar.  */
+
 void
 free_frame_tool_bar (f)
      FRAME_PTR f;
--- a/src/regex.c	Tue Oct 26 01:28:28 2004 +0000
+++ b/src/regex.c	Wed Oct 27 05:42:04 2004 +0000
@@ -1308,6 +1308,7 @@
     gettext_noop ("Premature end of regular expression"), /* REG_EEND */
     gettext_noop ("Regular expression too big"), /* REG_ESIZE */
     gettext_noop ("Unmatched ) or \\)"), /* REG_ERPAREN */
+    gettext_noop ("Range striding over charsets") /* REG_ERANGEX  */
   };
 
 /* Avoiding alloca during matching, to placate r_alloc.  */
@@ -2925,7 +2926,7 @@
 		    if (c > c1)
 		      {
 			if (syntax & RE_NO_EMPTY_RANGES)
-			  FREE_STACK_RETURN (REG_ERANGE);
+			  FREE_STACK_RETURN (REG_ERANGEX);
 			/* Else, repeat the loop.  */
 		      }
 		  }
--- a/src/regex.h	Tue Oct 26 01:28:28 2004 +0000
+++ b/src/regex.h	Wed Oct 27 05:42:04 2004 +0000
@@ -316,7 +316,8 @@
   /* Error codes we've added.  */
   REG_EEND,		/* Premature end.  */
   REG_ESIZE,		/* Compiled pattern bigger than 2^16 bytes.  */
-  REG_ERPAREN		/* Unmatched ) or \); not returned from regcomp.  */
+  REG_ERPAREN,		/* Unmatched ) or \); not returned from regcomp.  */
+  REG_ERANGEX		/* Range striding over charsets.  */
 } reg_errcode_t;
 
 /* This data structure represents a compiled pattern.  Before calling
--- a/src/xfns.c	Tue Oct 26 01:28:28 2004 +0000
+++ b/src/xfns.c	Wed Oct 27 05:42:04 2004 +0000
@@ -1929,7 +1929,7 @@
      char *base_fontname;
 {
   XFontSet xfs = NULL;
-  char **missing_list;
+  char **missing_list = NULL;
   int missing_count;
   char *def_string;
   Lisp_Object rest, frame;
@@ -1940,6 +1940,7 @@
       struct frame *cf = XFRAME (frame);
       if (cf != f && FRAME_LIVE_P (f) && FRAME_X_P (cf)
           && FRAME_X_DISPLAY_INFO (cf) == FRAME_X_DISPLAY_INFO (f)
+          && FRAME_XIC_BASE_FONTNAME (cf)
           && !strcmp (FRAME_XIC_BASE_FONTNAME (cf), base_fontname))
         {
           xfs = FRAME_XIC_FONTSET (cf);
@@ -1948,12 +1949,14 @@
     }
 
   if (!xfs)
-    /* New fontset.  */
-    xfs = XCreateFontSet (FRAME_X_DISPLAY (f),
-                          base_fontname, &missing_list,
-                          &missing_count, &def_string);
-  if (missing_list)
-    XFreeStringList (missing_list);
+    {
+      /* New fontset.  */
+      xfs = XCreateFontSet (FRAME_X_DISPLAY (f),
+                            base_fontname, &missing_list,
+                            &missing_count, &def_string);
+      if (missing_list)
+        XFreeStringList (missing_list);
+    }
 
   if (FRAME_XIC_BASE_FONTNAME (f))
     xfree (FRAME_XIC_BASE_FONTNAME (f));
--- a/src/xsmfns.c	Tue Oct 26 01:28:28 2004 +0000
+++ b/src/xsmfns.c	Wed Oct 27 05:42:04 2004 +0000
@@ -73,33 +73,35 @@
 
 static int doing_interact = False;
 
-/* The session manager object for the session manager connection */
+/* The session manager object for the session manager connection.  */
 
 static SmcConn smc_conn;
 
-/* The client session id for this session */
+/* The client session id for this session.  */
+
 static char *client_id;
 
-/* The full path name to the Emacs program */
+/* The full path name to the Emacs program.  */
+
 static char *emacs_program;
 
-/* The client session id for this session as a lisp object. */
+/* The client session id for this session as a lisp object.  */
 
 Lisp_Object Vx_session_id;
 
 /* The id we had the previous session.  This is only available if we
-   have been started by the session manager with SMID_OPT. */
+   have been started by the session manager with SMID_OPT.  */
 
 Lisp_Object Vx_session_previous_id;
 
 /* The option we tell the session manager to start Emacs with when
-   restarting Emacs.  The client_id is appended. */
+   restarting Emacs.  The client_id is appended.  */
 
 #define SMID_OPT "--smid="
 
 
 /* The option to start Emacs without the splash screen when
-   restarting Emacs. */
+   restarting Emacs.  */
 
 #define NOSPLASH_OPT "--no-splash"
 
@@ -107,6 +109,7 @@
 /* Handle any messages from the session manager.  If no connection is
    open to a session manager, just return 0.
    Otherwise returns 1 if SAVE_SESSION_EVENT is stored in buffer BUFP.  */
+
 int
 x_session_check_input (bufp)
      struct input_event *bufp;
@@ -125,7 +128,7 @@
   /* Reset this so wo can check kind after callbacks have been called by
      IceProcessMessages.  The smc_interact_CB sets the kind to
      SAVE_SESSION_EVENT, but we don't know beforehand if that callback
-     will be called. */
+     will be called.  */
   emacs_event.kind = NO_EVENT;
 
   if (select (ice_fd+1, &read_fds,
@@ -142,7 +145,7 @@
 
 
   /* Check if smc_interact_CB was called and we shall generate a
-     SAVE_SESSION_EVENT. */
+     SAVE_SESSION_EVENT.  */
   if (emacs_event.kind == NO_EVENT)
     return 0;
 
@@ -150,7 +153,8 @@
   return 1;
 }
 
-/* Return non-zero if we have a connection to a session manager.*/
+/* Return non-zero if we have a connection to a session manager.  */
+
 int
 x_session_have_connection ()
 {
@@ -159,7 +163,8 @@
 
 /* This is called when the session manager says it is OK to interact with the
    user.  Here we set the kind to SAVE_SESSION_EVENT so an event is generated.
-   Then lisp code can interact with the user. */
+   Then lisp code can interact with the user.  */
+
 static void
 smc_interact_CB (smcConn, clientData)
      SmcConn smcConn;
@@ -175,7 +180,8 @@
    are started in the correct directory.
 
    If this is a shutdown and we can request to interact with the user,
-   we do so, because we don't know what the lisp code might do. */
+   we do so, because we don't know what the lisp code might do.  */
+
 static void
 smc_save_yourself_CB (smcConn,
                       clientData,
@@ -202,7 +208,7 @@
   char cwd[MAXPATHLEN+1];
   char *smid_opt;
 
-  /* How to start a new instance of Emacs */
+  /* How to start a new instance of Emacs.  */
   props[props_idx] = &prop_ptr[props_idx];
   props[props_idx]->name = SmCloneCommand;
   props[props_idx]->type = SmLISTofARRAY8;
@@ -212,7 +218,7 @@
   props[props_idx]->vals[0].value = emacs_program;
   ++props_idx;
 
-  /* The name of the program */
+  /* The name of the program.  */
   props[props_idx] = &prop_ptr[props_idx];
   props[props_idx]->name = SmProgram;
   props[props_idx]->type = SmARRAY8;
@@ -222,11 +228,11 @@
   props[props_idx]->vals[0].value = SDATA (Vinvocation_name);
   ++props_idx;
 
-  /* How to restart Emacs (i.e.: /path/to/emacs --smid=xxxx --no-splash). */
+  /* How to restart Emacs (i.e.: /path/to/emacs --smid=xxxx --no-splash).  */
   props[props_idx] = &prop_ptr[props_idx];
   props[props_idx]->name = SmRestartCommand;
   props[props_idx]->type = SmLISTofARRAY8;
-  props[props_idx]->num_vals = 3; /* /path/to/emacs, --smid=xxx --no-splash */
+  props[props_idx]->num_vals = 3; /* /path/to/emacs, --smid=xxx --no-splash  */
   props[props_idx]->vals = &values[val_idx];
   props[props_idx]->vals[0].length = strlen (emacs_program);
   props[props_idx]->vals[0].value = emacs_program;
@@ -243,7 +249,7 @@
   val_idx += 3;
   ++props_idx;
 
-  /* User id */
+  /* User id.  */
   props[props_idx] = &prop_ptr[props_idx];
   props[props_idx]->name = SmUserID;
   props[props_idx]->type = SmARRAY8;
@@ -253,7 +259,7 @@
   props[props_idx]->vals[0].value = SDATA (Vuser_login_name);
   ++props_idx;
 
-  /* The current directory property, not mandatory */
+  /* The current directory property, not mandatory.  */
 #ifdef HAVE_GETCWD
   if (getcwd (cwd, MAXPATHLEN+1) != 0)
 #else
@@ -275,18 +281,19 @@
 
   xfree (smid_opt);
 
-  /* See if we maybe shall interact with the user. */
+  /* See if we maybe shall interact with the user.  */
   if (interactStyle != SmInteractStyleAny
       || ! shutdown
       || saveType == SmSaveLocal
       || ! SmcInteractRequest (smcConn, SmDialogNormal, smc_interact_CB, 0))
     {
-      /* No interaction, we are done saving ourself. */
+      /* No interaction, we are done saving ourself.  */
       SmcSaveYourselfDone (smcConn, True);
     }
 }
 
-/* According to the SM specification, this shall close the connection */
+/* According to the SM specification, this shall close the connection.  */
+
 static void
 smc_die_CB (smcConn, clientData)
      SmcConn smcConn;
@@ -300,7 +307,8 @@
    According to the SM specification, we should not interact with the
    user between smc_save_yourself_CB is called and until smc_save_complete_CB
    is called.  It seems like a lot of job to implement this and it doesn't
-   even seem necessary. */
+   even seem necessary.  */
+
 static void
 smc_save_complete_CB (smcConn, clientData)
      SmcConn smcConn;
@@ -318,7 +326,8 @@
 }
 
 /* Error handlers for SM and ICE.  We don't want to exit Emacs just
-   because there is some error in the session management. */
+   because there is some error in the session management.  */
+
 static void
 smc_error_handler (smcConn,
                    swap,
@@ -335,7 +344,7 @@
      int severity;
      SmPointer values;
 {
-  /* Empty */
+  /* Empty  */
 }
 
 static void
@@ -354,7 +363,7 @@
      int severity;
      IcePointer values;
 {
-  /* Empty */
+  /* Empty  */
 }
 
 
@@ -362,12 +371,13 @@
 ice_io_error_handler (iceConn)
      IceConn iceConn;
 {
-  /* Connection probably gone. */
+  /* Connection probably gone.  */
   ice_fd = -1;
 }
 
 /* This is called when the ICE connection is created or closed.  The SM library
-   uses ICE as it transport protocol. */
+   uses ICE as it transport protocol.  */
+
 static void
 ice_conn_watch_CB (iceConn, clientData, opening, watchData)
      IceConn iceConn;
@@ -400,6 +410,7 @@
 }
 
 /* Create the client leader window.  */
+
 static void
 create_client_leader_window (dpyinfo, client_id)
      struct x_display_info *dpyinfo;
@@ -426,7 +437,8 @@
   dpyinfo->client_leader_window = w;
 }
 
-/* Try to open a connection to the session manager. */
+/* Try to open a connection to the session manager.  */
+
 void
 x_session_initialize (dpyinfo)
      struct x_display_info *dpyinfo;
@@ -438,17 +450,17 @@
   int  name_len = 0;
 
   /* Check if we where started by the session manager.  If so, we will
-     have a previous id. */
+     have a previous id.  */
   if (! EQ (Vx_session_previous_id, Qnil) && STRINGP (Vx_session_previous_id))
     previous_id = SDATA (Vx_session_previous_id);
 
-  /* Construct the path to the Emacs program. */
+  /* Construct the path to the Emacs program.  */
   if (! EQ (Vinvocation_directory, Qnil))
     name_len += strlen (SDATA (Vinvocation_directory));
   name_len += strlen (SDATA (Vinvocation_name));
 
   /* This malloc will not be freed, but it is only done once, and hopefully
-     not very large  */
+     not very large   */
   emacs_program = xmalloc (name_len + 1);
   emacs_program[0] = '\0';
 
@@ -457,7 +469,7 @@
   strcat (emacs_program, SDATA (Vinvocation_name));
 
   /* The SM protocol says all callbacks are mandatory, so set up all
-     here and in the mask passed to SmcOpenConnection */
+     here and in the mask passed to SmcOpenConnection.  */
   callbacks.save_yourself.callback = smc_save_yourself_CB;
   callbacks.save_yourself.client_data = 0;
   callbacks.die.callback = smc_die_CB;
@@ -467,17 +479,17 @@
   callbacks.shutdown_cancelled.callback = smc_shutdown_cancelled_CB;
   callbacks.shutdown_cancelled.client_data = 0;
 
-  /* Set error handlers. */
+  /* Set error handlers.  */
   SmcSetErrorHandler (smc_error_handler);
   IceSetErrorHandler (ice_error_handler);
   IceSetIOErrorHandler (ice_io_error_handler);
 
-  /* Install callback for when connection status changes. */
+  /* Install callback for when connection status changes.  */
   IceAddConnectionWatch (ice_conn_watch_CB, 0);
 
   /* Open the connection to the session manager.  A failure is not
      critical, it usually means that no session manager is running.
-     The errorstring is here for debugging. */
+     The errorstring is here for debugging.  */
   smc_conn = SmcOpenConnection (NULL, NULL, 1, 0,
                                 (SmcSaveYourselfProcMask|
                                  SmcDieProcMask|