changeset 727:540b047ece4d

*** empty log message ***
author Jim Blandy <jimb@redhat.com>
date Wed, 24 Jun 1992 05:09:26 +0000
parents 5f08efa38dd0
children 2d5acaebbe7e
files lib-src/etags.c lisp/emacs-lisp/autoload.el lisp/emacs-lisp/edebug.el lisp/emacs-lisp/lisp-mode.el lisp/frame.el lisp/play/blackbox.el lisp/progmodes/compile.el lisp/progmodes/etags.el lisp/progmodes/inf-lisp.el lisp/simple.el lisp/term/x-win.el lisp/textmodes/text-mode.el src/.gdbinit src/alloc.c src/eval.c src/fns.c src/keyboard.c src/search.c src/xdisp.c src/xfns.c src/xterm.c
diffstat 21 files changed, 409 insertions(+), 349 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/etags.c	Wed Jun 24 05:07:51 1992 +0000
+++ b/lib-src/etags.c	Wed Jun 24 05:09:26 1992 +0000
@@ -410,7 +410,7 @@
  * for self-documentation only.
  */
 #define LEVEL_OK_FOR_FUNCDEF()					\
-	(level==0 || c_ext && level==1 && structdef==sinbody)
+	(level==0 || (c_ext && level==1 && structdef==sinbody))
 
 /*
  * next_token_is_func
@@ -1283,7 +1283,7 @@
     fprintf (stdout, "%s %s %d\n",
 	     node->name, node->file, (node->lno + 63) / 64);
   else
-    fprintf (stdout, "%-16s%4d %-16s %s\n",
+    fprintf (stdout, "%-16s %3d %-16s %s\n",
 	     node->name, node->lno, node->file, node->pat);
 
   /* Output subentries that follow this one */
@@ -1468,7 +1468,8 @@
 	{
 	  if (c == '"')
 	    inquote = FALSE;
-	  continue;
+	  else if (c == '\\')
+	    c = *lp++;
 	}
       else if (inchar)
 	{
@@ -1493,7 +1494,8 @@
 	      }
 	    else if (c_ext && *lp == '/')
 	      {
-		c = 0;		/* C++ comment: skip rest of line */
+		c = 0;
+		break;
 	      }
 	    continue;
 	  case '#':
@@ -1886,7 +1888,10 @@
   /* Detect GNUmacs's function-defining macros. */
   if (definedef == dnone)
     {
-      if (strneq (tokp->p, "DEF", 3))
+      if (strneq (tokp->p, "DEF", 3)
+	  || strneq (tokp->p, "ENTRY", 5)
+	  || strneq (tokp->p, "SYSCALL", 7)
+	  || strneq (tokp->p, "PSEUDO", 6))
 	{
 	  next_token_is_func = TRUE;
 	  goto badone;
@@ -2084,7 +2089,10 @@
 
   while (isspace (*dbp))
     dbp++;
-  if (*dbp == 0 || (!isalpha (*dbp)) && (*dbp != '_') && (*dbp != '$'))
+  if (*dbp == 0
+      || (!isalpha (*dbp)
+	  && *dbp != '_'
+	  && *dbp != '$'))
     return;
   for (cp = dbp + 1; *cp && (isalpha (*cp) || isdigit (*cp)
 			     || (*cp == '_') || (*cp == '$')); cp++)
--- a/lisp/emacs-lisp/autoload.el	Wed Jun 24 05:07:51 1992 +0000
+++ b/lisp/emacs-lisp/autoload.el	Wed Jun 24 05:09:26 1992 +0000
@@ -59,14 +59,29 @@
 (defconst generate-autoload-section-trailer "\n;;;***\n"
   "String which indicates the end of the section of autoloads for a file.")
 
-;; Forms which have doc-strings which should be printed specially.
-;; A doc-string-elt property of ELT says that (nth ELT FORM) is
-;; the doc-string in FORM.
-;; Note: defconst and defvar should NOT be marked in this way.
-;; We don't want to produce defconsts and defvars that make-docfile can
-;; grok, because then it would grok them twice, once in foo.el (where they
-;; are given with ;;;###autoload) and once in loaddefs.el.
+;;; Forms which have doc-strings which should be printed specially.
+;;; A doc-string-elt property of ELT says that (nth ELT FORM) is
+;;; the doc-string in FORM.
+;;;
+;;; There used to be the following note here:
+;;; ;;; Note: defconst and defvar should NOT be marked in this way.
+;;; ;;; We don't want to produce defconsts and defvars that
+;;; ;;; make-docfile can grok, because then it would grok them twice,
+;;; ;;; once in foo.el (where they are given with ;;;###autoload) and
+;;; ;;; once in loaddefs.el.
+;;;
+;;; Counter-note: Yes, they should be marked in this way.
+;;; make-docfile only processes those files that are loaded into the
+;;; dumped Emacs, and those files should never have anything
+;;; autoloaded here.  The above-feared problem only occurs with files
+;;; which have autoloaded entries *and* are processed by make-docfile;
+;;; there should be no such files.
+
 (put 'autoload 'doc-string-elt 3)
+(put 'defun    'doc-string-elt 3)
+(put 'defvar   'doc-string-elt 3)
+(put 'defconst 'doc-string-elt 3)
+(put 'defmacro 'doc-string-elt 3)
 
 (defun generate-file-autoloads (file)
   "Insert at point a loaddefs autoload section for FILE.
@@ -86,6 +101,21 @@
 	(floating-output-format "%20e")
 	(done-any nil)
 	output-end)
+
+    ;; If the autoload section we create here uses an absolute
+    ;; pathname for FILE in its header, and then Emacs is installed
+    ;; under a different path on another system,
+    ;; `update-autoloads-here' won't be able to find the files to be
+    ;; autoloaded.  So, if FILE is in the same directory or a
+    ;; subdirectory of the current buffer's file, we'll make it
+    ;; relative to the current buffer's directory.
+    (setq file (expand-file-name file))
+    (if (and (< (length default-directory) (length file))
+	     (string= default-directory
+		      (substring file 0 (length default-directory))))
+	(progn
+	  (setq file (substring file (length default-directory)))))
+
     (message "Generating autoloads for %s..." file)
     (save-excursion
       (set-buffer inbuf)
--- a/lisp/emacs-lisp/edebug.el	Wed Jun 24 05:07:51 1992 +0000
+++ b/lisp/emacs-lisp/edebug.el	Wed Jun 24 05:09:26 1992 +0000
@@ -175,7 +175,6 @@
 ;; Put edebug.el in some directory in your load-path and byte-compile it.
 
 ;; Put the following forms in your .emacs file.
-;; (setq edebug-global-prefix "...whatever you want")  ; default is C-xX
 ;; (define-key emacs-lisp-mode-map "\^Xx" 'edebug-defun)
 ;; (autoload 'edebug-defun "edebug")
 ;; (autoload 'edebug-debug "edebug")
@@ -459,17 +458,32 @@
     ))
 
 
-;; The standard eval-current-buffer doesn't use eval-region.
-(if (not (fboundp 'edebug-emacs-eval-current-buffer))
-    (fset 'edebug-emacs-eval-current-buffer
-	  (symbol-function 'eval-current-buffer)))
-;; (fset 'eval-current-buffer (symbol-function 'edebug-emacs-eval-current-buffer))
-
-(defun eval-current-buffer (&optional edebug-e-c-b-output)
+(defun edebug-eval-current-buffer (&optional edebug-e-c-b-output)
   "Call eval-region on the whole buffer."
   (interactive)
   (eval-region (point-min) (point-max) edebug-e-c-b-output))
 
+(defun edebug-eval-buffer (&optional buffer edebug-e-c-b-output)
+  "Call eval-region on the whole buffer."
+  (interactive "bEval buffer: ")
+  (save-excursion
+    (set-buffer buffer)
+    (eval-region (point-min) (point-max) edebug-e-c-b-output)))
+
+;; The standard eval-current-buffer doesn't use eval-region.
+(if (and (fboundp 'eval-current-buffer)
+	 (not (fboundp 'edebug-emacs-eval-current-buffer)))
+    (progn
+      (fset 'edebug-emacs-eval-current-buffer
+	    (symbol-function 'eval-current-buffer))
+      (fset 'eval-current-buffer 'edebug-eval-current-buffer)))
+(if (and (fboundp 'eval-buffer)
+	 (not (fboundp 'edebug-emacs-eval-buffer)))
+    (progn
+      (fset 'edebug-emacs-eval-buffer
+	    (symbol-function 'eval-buffer))
+      (fset 'eval-buffer 'edebug-eval-buffer)))
+
 
 
 ;;;======================================================================
@@ -498,6 +512,7 @@
 ;;; for more details.
 
 
+;;;###autoload
 (defun edebug-defun ()
   "Evaluate defun or defmacro, like eval-defun, but with edebug calls.
 Print its name in the minibuffer and leave point after any error it finds,
@@ -2416,6 +2431,7 @@
 ;; Note that debug and its utilities must be byte-compiled to work, since
 ;; they depend on the backtrace looking a certain way.
 
+;;;###autoload
 (defun edebug-debug (&rest debugger-args)
   "Replacement for debug.  
 If an error or quit occurred and we are running an edebugged function,
--- a/lisp/emacs-lisp/lisp-mode.el	Wed Jun 24 05:07:51 1992 +0000
+++ b/lisp/emacs-lisp/lisp-mode.el	Wed Jun 24 05:09:26 1992 +0000
@@ -490,9 +490,11 @@
 If optional arg ENDPOS is given, indent each line, stopping when
 ENDPOS is encountered."
   (interactive)
-  (let ((indent-stack (list nil)) (next-depth 0) last-depth bol
-	outer-loop-done inner-loop-done state this-indent
-	(last-point (point)))
+  (let ((indent-stack (list nil))
+	(next-depth 0)
+	(starting-point (point))
+	(last-point (point))
+	last-depth bol outer-loop-done inner-loop-done state this-indent)
     ;; Get error now if we don't have a complete sexp after point.
     (save-excursion (forward-sexp 1))
     (save-excursion
@@ -529,10 +531,12 @@
 		(setcar (nthcdr 5 state) nil))
 	    (setq inner-loop-done t)))
 	(and endpos
-	     (while (<= next-depth 0)
-	       (setq indent-stack (append indent-stack (list nil)))
-	       (setq next-depth (1+ next-depth))
-	       (setq last-depth (1+ last-depth))))
+	     (<= next-depth 0)
+	     (progn
+	       (setq indent-stack (append indent-stack
+					  (make-list (- next-depth) nil))
+		     last-depth (- last-depth next-depth)
+		     next-depth 0)))
 	(or outer-loop-done
 	    (setq outer-loop-done (<= next-depth 0)))
 	(if outer-loop-done
@@ -557,7 +561,7 @@
 		(setq this-indent (car indent-stack))
 	      (let ((val (calculate-lisp-indent
 			  (if (car indent-stack) (- (car indent-stack))
-			    last-point))))
+			    starting-point))))
 		(if (integerp val)
 		    (setcar indent-stack
 			    (setq this-indent val))
--- a/lisp/frame.el	Wed Jun 24 05:07:51 1992 +0000
+++ b/lisp/frame.el	Wed Jun 24 05:09:26 1992 +0000
@@ -264,8 +264,10 @@
 			    (list (cons 'horizontal-scroll-bar toggle))))
 
 ;;;; Key bindings
-(define-prefix-command 'ctl-x-5-map)
-(define-key ctl-x-map "5" 'ctl-x-5-map)
+(defvar ctl-x-5-map (make-sparse-keymap)
+  "Keymap for screen commands.")
+(fset 'ctl-x-5-prefix ctl-x-5-map)
+(define-key ctl-x-map "5" 'ctl-x-5-prefix)
 
 (define-key ctl-x-5-map "2" 'new-screen)
 (define-key ctl-x-5-map "0" 'delete-screen)
--- a/lisp/play/blackbox.el	Wed Jun 24 05:07:51 1992 +0000
+++ b/lisp/play/blackbox.el	Wed Jun 24 05:09:26 1992 +0000
@@ -1,12 +1,12 @@
 ;;; blackbox.el --- blackbox game in Emacs Lisp
 
-;; Copyright (C) 1985, 1986, 1987 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1986, 1987, 1992 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 1, or (at your option)
+;; the Free Software Foundation; either version 2, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -114,6 +114,7 @@
   (setq major-mode 'blackbox-mode)
   (setq mode-name "Blackbox"))
 
+;;;###autoload
 (defun blackbox (num)
   "Play blackbox.  Optional prefix argument is the number of balls;
 the default is 4.
--- a/lisp/progmodes/compile.el	Wed Jun 24 05:07:51 1992 +0000
+++ b/lisp/progmodes/compile.el	Wed Jun 24 05:09:26 1992 +0000
@@ -1,4 +1,4 @@
-;;; compile.el --- run compiler as inferior of Emacs, and parse its error messages.
+;;; compile.el --- run compiler as inferior of Emacs, parse error messages.
 
 ;;;!!! dup removal is broken.
 
@@ -84,21 +84,24 @@
     ("^\\([^:( \t\n]+\\)[:( \t]+\\([0-9]+\\)[:) \t]" 1 2)
     ;; 4.3BSD lint pass 2
     ;; strcmp: variable # of args. llib-lc(359)  ::  /usr/src/foo/foo.c(8)
-    ("[ \t:]+\\([^:( \t\n]+\\)[ \t]*[:(]+[ \t]*\\([0-9]+\\)[:) \t]*$" 1 2)
+    ("[ \t:]+\\([^:( \t\n]+\\)[ \t]*[:(]*(+[ \t]*\\([0-9]+\\))[:) \t]*$" 1 2)
     ;; 4.3BSD lint pass 3
     ;; bloofle defined( /users/wolfgang/foo.c(4) ), but never used
-    ("[ \t(]+\\([^:( \t\n]+\\)[:( \t]+\\([0-9]+\\)[:) \t]+" 1 2)
+    ;; This used to be
+    ;; ("[ \t(]+\\([^:( \t\n]+\\)[:( \t]+\\([0-9]+\\)[:) \t]+" 1 2)
+    ;; which is regexp Impressionism - it matches almost anything!
+    ("([ \t]*\\([^:( \t\n]+\\)[ \t]*[:(][ \t]*\\([0-9]+\\))" 1 2)
     ;; Line 45 of "foo.c": bloofel undefined (who does this?)
-    ("^[Ll]ine[ \t]+\\([0-9]+\\)[ \t]+of[ \t]+\"\\([^\"]+\\)\":" 2 1)
+    ("^[Ll]ine[ \t]+\\([0-9]+\\)[ \t]+of[ \t]+\"\\([^\"\n]+\\)\":" 2 1)
     ;; Apollo cc, 4.3BSD fc
     ;; "foo.f", line 3: Error: syntax error near end of statement
-    ("^\"\\([^\"]+\\)\", line \\([0-9]+\\):" 1 2)
+    ("^\"\\([^\"\n]+\\)\", line \\([0-9]+\\):" 1 2)
     ;; HP-UX 7.0 fc
     ;; foo.f          :16    some horrible error message
-    ("\\([^ \t:]+\\)[ \t]*:\\([0-9]+\\)" 1 2)
+    ("^\\([^ \t\n:]+\\)[ \t]*:\\([0-9]+\\)" 1 2)
     ;; IBM AIX PS/2 C version 1.1
     ;; ****** Error number 140 in line 8 of file errors.c ******
-    ("in line \\([0-9]+\\) of file \\([^ ]+[^. ]\\)\\.? " 2 1)
+    ("in line \\([0-9]+\\) of file \\([^ \n]+[^. \n]\\)\\.? " 2 1)
     ;; IBM AIX lint is too painful to do right this way.  File name
     ;; prefixes entire sections rather than being on each line.
     )
@@ -132,18 +135,18 @@
 \(The \"-n\" option tells grep to output line numbers.)")
 
 (defconst compilation-enter-directory-regexp
-  ": Entering directory `\\\(.*\\\)'$"
+  ": Entering directory `\\(.*\\)'$"
   "Regular expression for a line in the compilation log that
-changes the current directory.  This must contain one \\\(, \\\) pair
+changes the current directory.  This must contain one \\(, \\) pair
 around the directory name.
 
 The default value matches lines printed by the `-w' option of GNU Make.")
 
 (defconst compilation-leave-directory-regexp
-  ": Leaving directory `\\\(.*\\\)'$"
+  ": Leaving directory `\\(.*\\)'$"
   "Regular expression for a line in the compilation log that
 changes the current directory to a previous value.  This may
-contain one \\\(, \\\) pair around the name of the directory
+contain one \\(, \\) pair around the name of the directory
 being moved from.  If it does not, the last directory entered
 \(by a line matching `compilation-enter-directory-regexp'\) is assumed.
 
@@ -343,6 +346,8 @@
 		   (setq omax (point-max)
 			 opoint (point))
 		   (goto-char omax)
+		   ;; Record where we put the message, so we can ignore it
+		   ;; later on.
 		   (insert ?\n mode-name " " msg)
 		   (forward-char -1)
 		   (insert " at " (substring (current-time-string) 0 19))
--- a/lisp/progmodes/etags.el	Wed Jun 24 05:07:51 1992 +0000
+++ b/lisp/progmodes/etags.el	Wed Jun 24 05:09:26 1992 +0000
@@ -1,12 +1,12 @@
 ;;; etags.el --- tags facility for Emacs.
 
-;; Copyright (C) 1985, 1986, 1988 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1986, 1988, 1992 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 1, or (at your option)
+;; the Free Software Foundation; either version 2, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -244,6 +244,26 @@
 ;;;###autoload
 (define-key ctl-x-4-map "." 'find-tag-other-window)
 
+;;;###autoload
+(defun find-tag-other-frame (tagname &optional next)
+  "Find tag (in current tag table) whose name contains TAGNAME.
+ Selects the buffer that the tag is contained in in another frame
+and puts point at its definition.
+ If TAGNAME is a null string, the expression in the buffer
+around or before point is used as the tag name.
+ If second arg NEXT is non-nil (interactively, with prefix arg),
+searches for the next tag in the tag table
+that matches the tagname used in the previous find-tag.
+
+See documentation of variable tags-file-name."
+  (interactive (if current-prefix-arg
+		   '(nil t)
+		   (find-tag-tag "Find tag other window: ")))
+  (let ((pop-up-screens t))
+    (find-tag tagname next t)))
+;;;###autoload
+(define-key ctl-x-5-map "." 'find-tag-other-frame)
+
 (defvar next-file-list nil
   "List of files for next-file to process.")
 
--- a/lisp/progmodes/inf-lisp.el	Wed Jun 24 05:07:51 1992 +0000
+++ b/lisp/progmodes/inf-lisp.el	Wed Jun 24 05:09:26 1992 +0000
@@ -100,11 +100,8 @@
 ;;; c-m-x   lisp-eval-defun         This binding is a gnu convention.
 ;;; c-c c-e lisp-eval-defun 	    Send the current defun to Lisp process.
 ;;; c-x c-e lisp-eval-last-sexp     Send the previous sexp to Lisp process.
-;;; c-c m-e lisp-eval-defun-and-go  After sending the defun, switch-to-lisp.
 ;;; c-c c-r lisp-eval-region        Send the current region to Lisp process.
-;;; c-c m-r lisp-eval-region-and-go After sending the region, switch-to-lisp.
 ;;; c-c c-c lisp-compile-defun      Compile the current defun in Lisp process.
-;;; c-c m-c lisp-compile-defun-and-go After compiling defun, switch-to-lisp.
 ;;; c-c c-z switch-to-lisp          Switch to the Lisp process buffer.
 ;;; c-c c-l lisp-load-file          (See above. In a Lisp file buffer, default
 ;;; c-c c-k lisp-compile-file        is to load/compile the current file.)
@@ -115,7 +112,6 @@
 
 ;;; cmulisp	    	    	    Fires up the Lisp process.
 ;;; lisp-compile-region     	    Compile all forms in the current region.
-;;; lisp-compile-region-and-go      After compiling region, switch-to-lisp.
 ;;;
 ;;; CMU Lisp Mode Variables:
 ;;; cmulisp-filter-regexp	    Match this => don't get saved on input hist
@@ -154,11 +150,8 @@
 (define-key lisp-mode-map "\M-\C-x"  'lisp-eval-defun)     ; Gnu convention
 (define-key lisp-mode-map "\C-x\C-e" 'lisp-eval-last-sexp) ; Gnu convention
 (define-key lisp-mode-map "\C-c\C-e" 'lisp-eval-defun)
-(define-key lisp-mode-map "\C-c\M-e" 'lisp-eval-defun-and-go)
 (define-key lisp-mode-map "\C-c\C-r" 'lisp-eval-region)
-(define-key lisp-mode-map "\C-c\M-r" 'lisp-eval-region-and-go)
 (define-key lisp-mode-map "\C-c\C-c" 'lisp-compile-defun)
-(define-key lisp-mode-map "\C-c\M-c" 'lisp-compile-defun-and-go)
 (define-key lisp-mode-map "\C-c\C-z" 'switch-to-lisp)
 (define-key lisp-mode-map "\C-c\C-l" 'lisp-load-file)
 (define-key lisp-mode-map "\C-c\C-k" 'lisp-compile-file)  ; "kompile" file
@@ -168,6 +161,37 @@
 (define-key lisp-mode-map "\C-c\C-v" 'lisp-show-variable-documentation)
 
 
+;;; This function exists for backwards compatibility.
+;;; Previous versions of this package bound commands to C-c <letter>
+;;; bindings, which is not allowed by the gnumacs standard.
+
+(defun cmulisp-install-letter-bindings ()
+  "This function binds many cmulisp commands to C-c <letter> bindings,
+where they are more accessible. C-c <letter> bindings are reserved for the
+user, so these bindings are non-standard. If you want them, you should
+have this function called by the cmulisp-load-hook:
+    (setq cmulisp-load-hook '(cmulisp-install-letter-bindings))
+You can modify this function to install just the bindings you want."
+
+  (define-key lisp-mode-map "\C-ce" 'lisp-eval-defun-and-go)
+  (define-key lisp-mode-map "\C-cr" 'lisp-eval-region-and-go)
+  (define-key lisp-mode-map "\C-cc" 'lisp-compile-defun-and-go)
+  (define-key lisp-mode-map "\C-cz" 'switch-to-lisp)
+  (define-key lisp-mode-map "\C-cl" 'lisp-load-file)
+  (define-key lisp-mode-map "\C-ck" 'lisp-compile-file)
+  (define-key lisp-mode-map "\C-ca" 'lisp-show-arglist)
+  (define-key lisp-mode-map "\C-cd" 'lisp-describe-sym)
+  (define-key lisp-mode-map "\C-cf" 'lisp-show-function-documentation)
+  (define-key lisp-mode-map "\C-cv" 'lisp-show-variable-documentation)
+
+  (define-key cmulisp-mode-map "\C-cl" 'lisp-load-file)
+  (define-key cmulisp-mode-map "\C-ck" 'lisp-compile-file)
+  (define-key cmulisp-mode-map "\C-ca" 'lisp-show-arglist)
+  (define-key cmulisp-mode-map "\C-cd" 'lisp-describe-sym)
+  (define-key cmulisp-mode-map "\C-cf" 'lisp-show-function-documentation)
+  (define-key cmulisp-mode-map "\C-cv" 'lisp-show-variable-documentation))
+
+
 (defvar inferior-lisp-program "lisp"
   "*Program name for invoking an inferior Lisp with `cmulisp'.")
 
@@ -220,9 +244,9 @@
     lisp-eval-region sends the current region to the Lisp process.
     lisp-compile-region compiles the current region.
 
-    lisp-eval-defun-and-go, lisp-compile-defun-and-go,
-        lisp-eval-region-and-go, and lisp-compile-region-and-go
-        switch to the Lisp process buffer after sending their text.
+    Prefixing the lisp-eval/compile-defun/region commands with
+    a \\[universal-argument] causes a switch to the Lisp process buffer after sending
+    the text.
 
 Commands:
 Return after the end of the process' output sends the text from the 
@@ -262,54 +286,87 @@
   "Don't save anything matching cmulisp-filter-regexp"
   (not (string-match cmulisp-filter-regexp str)))
 
-(defun cmulisp ()
+(defun cmulisp (cmd)
   "Run an inferior Lisp process, input and output via buffer *cmulisp*.
 If there is a process already running in *cmulisp*, just switch to that buffer.
-Takes the program name from the variable inferior-lisp-program.
+With argument, allows you to edit the command line (default is value
+of inferior-lisp-program).  Runs the hooks from cmulisp-mode-hook (after the
+comint-mode-hook is run).
 \(Type \\[describe-mode] in the process buffer for a list of commands.)"
-  (interactive)
-  (cond ((not (comint-check-proc "*cmulisp*"))
-	 (set-buffer (make-comint "cmulisp" inferior-lisp-program))
+  (interactive (list (if current-prefix-arg
+			 (read-string "Run lisp: " inferior-lisp-program)
+			 inferior-lisp-program)))
+  (if (not (comint-check-proc "*cmulisp*"))
+      (let ((cmdlist (cmulisp-args-to-list cmd)))
+	 (set-buffer (apply (function make-comint) "cmulisp" (car cmdlist) nil
+			    (cdr cmdlist)))
 	 (cmulisp-mode)))
   (setq cmulisp-buffer "*cmulisp*")
   (switch-to-buffer "*cmulisp*"))
 
-(defun lisp-eval-region (start end)
-  "Send the current region to the inferior Lisp process."
-  (interactive "r")
+;;; Break a string up into a list of arguments.
+;;; This will break if you have an argument with whitespace, as in
+;;; string = "-ab +c -x 'you lose'".
+(defun cmulisp-args-to-list (string)
+  (let ((where (string-match "[ \t]" string)))
+    (cond ((null where) (list string))
+	  ((not (= where 0))
+	   (cons (substring string 0 where)
+		 (tea-args-to-list (substring string (+ 1 where)
+					      (length string)))))
+	  (t (let ((pos (string-match "[^ \t]" string)))
+	       (if (null pos)
+		   nil
+		 (cmulsip-args-to-list (substring string pos
+						  (length string)))))))))
+
+(defun lisp-eval-region (start end &optional and-go)
+  "Send the current region to the inferior Lisp process.
+Prefix argument means switch-to-lisp afterwards."
+  (interactive "r\nP")
   (comint-send-region (cmulisp-proc) start end)
-  (comint-send-string (cmulisp-proc) "\n"))
+  (comint-send-string (cmulisp-proc) "\n")
+  (if and-go (switch-to-lisp t)))
 
-(defun lisp-eval-defun ()
-  "Send the current defun to the inferior Lisp process."
-  (interactive)
+(defun lisp-eval-defun (&optional and-go)
+  "Send the current defun to the inferior Lisp process.
+Prefix argument means switch-to-lisp afterwards."
+  (interactive "P")
   (save-excursion
-   (end-of-defun)
-   (let ((end (point)))
-     (beginning-of-defun)
-     (lisp-eval-region (point) end))))
+    (end-of-defun)
+    (skip-chars-backward " \t\n\r\f") ;  Makes allegro happy
+    (let ((end (point)))
+      (beginning-of-defun)
+      (lisp-eval-region (point) end)))
+  (if and-go (switch-to-lisp t)))
 
-(defun lisp-eval-last-sexp ()
-  "Send the previous sexp to the inferior Lisp process."
-  (interactive)
-  (lisp-eval-region (save-excursion (backward-sexp) (point)) (point)))
+(defun lisp-eval-last-sexp (&optional and-go)
+  "Send the previous sexp to the inferior Lisp process.
+Prefix argument means switch-to-lisp afterwards."
+  (interactive "P")
+  (lisp-eval-region (save-excursion (backward-sexp) (point)) (point) and-go))
 
-;;; CommonLisp COMPILE sux. 
-(defun lisp-compile-region (start end)
-  "Compile the current region in the inferior Lisp process."
-  (interactive "r")
+;;; Common Lisp COMPILE sux. 
+(defun lisp-compile-region (start end &optional and-go)
+  "Compile the current region in the inferior Lisp process.
+Prefix argument means switch-to-lisp afterwards."
+  (interactive "r\nP")
   (comint-send-string (cmulisp-proc)
     (format "(funcall (compile nil `(lambda () (progn 'compile %s))))\n"
-	    (buffer-substring start end))))
+	    (buffer-substring start end)))
+  (if and-go (switch-to-lisp t)))
 			 
-(defun lisp-compile-defun ()
-  "Compile the current defun in the inferior Lisp process."
-  (interactive)
+(defun lisp-compile-defun (&optional and-go)
+  "Compile the current defun in the inferior Lisp process.
+Prefix argument means switch-to-lisp afterwards."
+  (interactive "P")
   (save-excursion
     (end-of-defun)
+    (skip-chars-backward " \t\n\r\f") ;  Makes allegro happy
     (let ((e (point)))
       (beginning-of-defun)
-      (lisp-compile-region (point) e))))
+      (lisp-compile-region (point) e)))
+  (if and-go (switch-to-lisp t)))
 
 (defun switch-to-lisp (eob-p)
   "Switch to the inferior Lisp process buffer.
@@ -322,33 +379,35 @@
 	 (push-mark)
 	 (goto-char (point-max)))))
 
+
+;;; Now that lisp-compile/eval-defun/region takes an optional prefix arg,
+;;; these commands are redundant. But they are kept around for the user
+;;; to bind if he wishes, for backwards functionality, and because it's
+;;; easier to type C-c e than C-u C-c C-e.
+
 (defun lisp-eval-region-and-go (start end)
   "Send the current region to the inferior Lisp, 
 and switch to the process buffer."
   (interactive "r")
-  (lisp-eval-region start end)
-  (switch-to-lisp t))
+  (lisp-eval-region start end t))
 
 (defun lisp-eval-defun-and-go ()
   "Send the current defun to the inferior Lisp, 
 and switch to the process buffer."
   (interactive)
-  (lisp-eval-defun)
-  (switch-to-lisp t))
+  (lisp-eval-defun t))
 
 (defun lisp-compile-region-and-go (start end)
   "Compile the current region in the inferior Lisp, 
 and switch to the process buffer."
   (interactive "r")
-  (lisp-compile-region start end)
-  (switch-to-lisp t))
+  (lisp-compile-region start end t))
 
 (defun lisp-compile-defun-and-go ()
   "Compile the current defun in the inferior Lisp, 
 and switch to the process buffer."
   (interactive)
-  (lisp-compile-defun)
-  (switch-to-lisp t))
+  (lisp-compile-defun t))
 
 ;;; A version of the form in H. Shevis' soar-mode.el package. Less robust.
 ;(defun lisp-compile-sexp (start end)
@@ -406,7 +465,8 @@
   (setq lisp-prev-l/c-dir/file (cons (file-name-directory    file-name)
 				     (file-name-nondirectory file-name)))
   (comint-send-string (cmulisp-proc)
-		      (format inferior-lisp-load-command file-name)))
+		      (format inferior-lisp-load-command file-name))
+  (switch-to-lisp t))
 
 
 (defun lisp-compile-file (file-name)
@@ -419,7 +479,8 @@
 				     (file-name-nondirectory file-name)))
   (comint-send-string (cmulisp-proc) (concat "(compile-file \""
 					     file-name
-					     "\"\)\n")))
+					     "\"\)\n"))
+  (switch-to-lisp t))
 
 
 
@@ -541,7 +602,7 @@
     foo		cmulisp
     bar		cmulisp<2>
     *cmulisp*   cmulisp<3>
-If you do a \\[lisp-eval-defun-and-go] command on some Lisp source code, 
+If you do a \\[lisp-eval-defun] command on some Lisp source code, 
 what process do you send it to?
 
 - If you're in a process buffer (foo, bar, or *cmulisp*), 
@@ -598,6 +659,25 @@
 ;;; 3/12/90 Olin
 ;;; - lisp-load-file and lisp-compile-file no longer switch-to-lisp.
 ;;;   Tale suggested this.
+;;; - Reversed this decision 7/15/91. You need the visual feedback.
+;;;
+;;; 7/25/91 Olin
+;;; Changed all keybindings of the form C-c <letter>. These are
+;;; supposed to be reserved for the user to bind. This affected
+;;; mainly the compile/eval-defun/region[-and-go] commands.
+;;; This was painful, but necessary to adhere to the gnumacs standard.
+;;; For some backwards compatibility, see the 
+;;;     cmulisp-install-letter-bindings
+;;; function.
+;;;
+;;; 8/2/91 Olin
+;;; - The lisp-compile/eval-defun/region commands now take a prefix arg,
+;;;   which means switch-to-lisp after sending the text to the Lisp process.
+;;;   This obsoletes all the -and-go commands. The -and-go commands are
+;;;   kept around for historical reasons, and because the user can bind
+;;;   them to key sequences shorter than C-u C-c C-<letter>.
+;;; - If M-x cmulisp is invoked with a prefix arg, it allows you to
+;;;   edit the command line.
 
 (provide 'cmulisp)
 
--- a/lisp/simple.el	Wed Jun 24 05:07:51 1992 +0000
+++ b/lisp/simple.el	Wed Jun 24 05:09:26 1992 +0000
@@ -724,7 +724,14 @@
 The function should be called with no arguments.  If the function
 returns nil, then no other program has provided such text, and the top
 of the Emacs kill ring should be used.  If the function returns a
-string, that string should be put in the kill ring as the latest kill.")
+string, that string should be put in the kill ring as the latest kill.
+
+Note that the function should return a string only if a program other
+than Emacs has provided a string for pasting; if Emacs provided the
+most recent string, the function should return nil.  If it is
+difficult to tell whether Emacs or some other program provided the
+current string, it is probably good enough to return nil if the string
+is equal (according to `string=') to the last text Emacs provided.")
 
 
 
--- a/lisp/term/x-win.el	Wed Jun 24 05:07:51 1992 +0000
+++ b/lisp/term/x-win.el	Wed Jun 24 05:09:26 1992 +0000
@@ -447,6 +447,11 @@
       '(lambda ()
 	 (error "Suspending an emacs running under X makes no sense")))
 
+;;; We keep track of the last text selected here, so we can check the
+;;; current selection against it, and avoid passing back our own text
+;;; from x-cut-buffer-or-selection-value.
+(defvar x-last-selected-text nil)
+
 ;;; Make TEXT, a string, the primary and clipboard X selections.
 ;;; If you are running xclipboard, this means you can effectively
 ;;; have a window on a copy of the kill-ring.
@@ -455,14 +460,19 @@
 (defun x-select-text (text)
   (x-own-selection text 'cut-buffer0)
   (x-own-selection text 'clipboard)
-  (x-own-selection text))
+  (x-own-selection text)
+  (setq x-last-selected-text text))
 
 ;;; Return the value of the current X selection.  For compatibility
 ;;; with older X applications, this checks cut buffer 0 before
 ;;; retrieving the value of the primary selection.
 (defun x-cut-buffer-or-selection-value ()
-  (or (x-selection-value 'cut-buffer0)
-      (x-selection-value)))
+  (let ((text (or (x-selection-value 'cut-buffer0)
+		  (x-selection-value))))
+    (if (string= text x-last-selected-text)
+	nil
+      (setq x-last-selected-text nil)
+      text)))
 
 ;;; Arrange for the kill and yank functions to set and check the clipboard.
 (setq interprogram-cut-function 'x-select-text)
--- a/lisp/textmodes/text-mode.el	Wed Jun 24 05:07:51 1992 +0000
+++ b/lisp/textmodes/text-mode.el	Wed Jun 24 05:09:26 1992 +0000
@@ -1,12 +1,12 @@
 ;;; text-mode.el --- text mode, and its idiosyncratic commands.
 
-;; Copyright (C) 1985 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1992 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 1, or (at your option)
+;; the Free Software Foundation; either version 2, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -94,18 +94,6 @@
   (setq major-mode 'indented-text-mode)
   (run-hooks 'text-mode-hook))
 
-(defun change-log-mode ()
-  "Major mode for editing ChangeLog files.  See M-x add-change-log-entry.
-Almost the same as Indented Text mode, but prevents numeric backups
-and sets `left-margin' to 8 and `fill-column' to 74."
-  (interactive)
-  (indented-text-mode)
-  (setq left-margin 8)
-  (setq fill-column 74)
-  (make-local-variable 'version-control)
-  (setq version-control 'never)
-  (run-hooks 'change-log-mode-hook))
-
 (defun center-paragraph ()
   "Center each nonblank line in the paragraph at or after point.
 See center-line for more info."
--- a/src/.gdbinit	Wed Jun 24 05:07:51 1992 +0000
+++ b/src/.gdbinit	Wed Jun 24 05:09:26 1992 +0000
@@ -32,9 +32,12 @@
 
 define xwindow
 print (struct window *) ($ & 0x00ffffff)
+print ($->left)@4
+print $$
 end
 document xwindow
 Print $ as a window pointer, assuming it is an Elisp window value.
+Print the window's position as { left, top, height, width }.
 end
 
 define xmarker
@@ -46,9 +49,12 @@
 
 define xbuffer
 print (struct buffer *) ($ & 0x00ffffff)
+print &((struct Lisp_String *) (($->name) & 0x00ffffff))->data
+print $$
 end
 document xbuffer
-Print $ as a buffer pointer, assuming it is an Elisp buffer value.
+Set $ as a buffer pointer, assuming it is an Elisp buffer value.
+Print the name of the buffer.
 end
 
 define xsymbol
--- a/src/alloc.c	Wed Jun 24 05:07:51 1992 +0000
+++ b/src/alloc.c	Wed Jun 24 05:09:26 1992 +0000
@@ -960,7 +960,7 @@
 
 struct gcpro *gcprolist;
 
-#define NSTATICS 256
+#define NSTATICS 512
 
 Lisp_Object *staticvec[NSTATICS] = {0};
 
--- a/src/eval.c	Wed Jun 24 05:07:51 1992 +0000
+++ b/src/eval.c	Wed Jun 24 05:09:26 1992 +0000
@@ -41,8 +41,9 @@
     struct backtrace *next;
     Lisp_Object *function;
     Lisp_Object *args;	/* Points to vector of args. */
-    int nargs;		/* length of vector */
-	       /* if nargs is UNEVALLED, args points to slot holding list of unevalled args */
+    int nargs;		/* Length of vector.
+			   If nargs is UNEVALLED, args points to slot holding
+			   list of unevalled args */
     char evalargs;
     /* Nonzero means call value of debugger when done with this operation. */
     char debug_on_exit;
@@ -451,20 +452,33 @@
   if (!INTERACTIVE)
     return Qnil;
 
-  /*  Unless the object was compiled, skip the frame of interactive-p itself
-      (if interpreted) or the frame of byte-code (if called from
-      compiled function).  */
   btp = backtrace_list;
-  if (XTYPE (*btp->function) != Lisp_Compiled)
-    btp = btp->next;
-  while (btp
-	 && (btp->nargs == UNEVALLED || EQ (*btp->function, Qbytecode)))
+
+  /* If this isn't a byte-compiled function, there may be a frame at
+     the top for Finteractive_p itself.  If so, skip it.  */
+  fun = Findirect_function (*btp->function);
+  if (XTYPE (fun) == Lisp_Subr
+      && (struct Lisp_Subr *) XPNTR (fun) == &Sinteractive_p)
     btp = btp->next;
 
-  /* btp now points at the frame of the innermost function
-     that DOES eval its args.
-     If it is a built-in function (such as load or eval-region)
-     return nil.  */
+  /* If we're running an Emacs 18-style byte-compiled function, there
+     may be a frame for Fbytecode.  Now, given the strictest
+     definition, this function isn't really being called
+     interactively, but because that's the way Emacs 18 always builds
+     byte-compiled functions, we'll accept it for now.  */
+  if (EQ (*btp->function, Qbytecode))
+    btp = btp->next;
+
+  /* If this isn't a byte-compiled function, then we may now be
+     looking at several frames for special forms.  Skip past them.  */
+  while (btp && 
+	 btp->nargs == UNEVALLED)
+    btp = btp->next;
+
+  /* btp now points at the frame of the innermost function that isn't
+     a special form, ignoring frames for Finteractive_p and/or
+     Fbytecode at the top.  If this frame is for a built-in function
+     (such as load or eval-region) return nil.  */
   fun = Findirect_function (*btp->function);
   if (XTYPE (fun) == Lisp_Subr)
     return Qnil;
@@ -2320,8 +2334,8 @@
 
   DEFVAR_BOOL ("debug-on-quit", &debug_on_quit,
     "*Non-nil means enter debugger if quit is signaled (C-G, for example).\n\
-Does not apply if quit is handled by a `condition-case'.
-A non-nil value is equivalent to a `debug-on-error' value containing 'quit.");
+Does not apply if quit is handled by a `condition-case'.\n\
+A non-nil value is equivalent to a `debug-on-error' value containing `quit'.");
   debug_on_quit = 0;
 
   DEFVAR_BOOL ("debug-on-next-call", &debug_on_next_call,
--- a/src/fns.c	Wed Jun 24 05:07:51 1992 +0000
+++ b/src/fns.c	Wed Jun 24 05:09:26 1992 +0000
@@ -20,41 +20,6 @@
 
 #include "config.h"
 
-#ifdef LOAD_AVE_TYPE
-#ifdef BSD
-/* It appears param.h defines BSD and BSD4_3 in 4.3
-   and is not considerate enough to avoid bombing out
-   if they are already defined.  */
-#undef BSD
-#ifdef BSD4_3
-#undef BSD4_3
-#define XBSD4_3 /* XBSD4_3 says BSD4_3 is supposed to be defined.  */
-#endif
-#include <sys/param.h>
-/* Now if BSD or BSD4_3 was defined and is no longer,
-   define it again.  */
-#ifndef BSD
-#define BSD
-#endif
-#ifdef XBSD4_3
-#ifndef BSD4_3
-#define BSD4_3
-#endif
-#endif /* XBSD4_3 */
-#endif /* BSD */
-#ifndef VMS
-#ifndef NLIST_STRUCT
-#include <a.out.h> 
-#else /* NLIST_STRUCT */
-#include <nlist.h>
-#endif /* NLIST_STRUCT */
-#endif /* not VMS */
-#endif /* LOAD_AVE_TYPE */
-
-#ifdef DGUX
-#include <sys/dg_sys_info.h>  /* for load average info - DJB */
-#endif
-
 /* Note on some machines this defines `vector' as a typedef,
    so make sure we don't use that name in this file.  */
 #undef vector
@@ -1226,171 +1191,27 @@
   UNGCPRO;
 }
 
-/* Avoid static vars inside a function since in HPUX they dump as pure.  */
-#ifdef DGUX
-static struct dg_sys_info_load_info load_info;  /* what-a-mouthful! */
-
-#else /* Not DGUX */
-
-static int ldav_initialized;
-static int ldav_channel;
-#ifdef LOAD_AVE_TYPE
-#ifndef VMS
-static struct nlist ldav_nl[2];
-#endif /* VMS */
-#endif /* LOAD_AVE_TYPE */
-
-#define channel ldav_channel
-#define initialized ldav_initialized
-#define nl ldav_nl
-#endif /* Not DGUX */
-
 DEFUN ("load-average", Fload_average, Sload_average, 0, 0, 0,
   "Return list of 1 minute, 5 minute and 15 minute load averages.\n\
 Each of the three load averages is multiplied by 100,\n\
-then converted to integer.")
+then converted to integer.\n\
+If the 5-minute or 15-minute load averages are not available, return a\n\
+shortened list, containing only those averages which are available.")
   ()
 {
-#ifdef DGUX
-  /* perhaps there should be a "sys_load_avg" call in sysdep.c?! - DJB */
-  load_info.one_minute     = 0.0;	/* just in case there is an error */
-  load_info.five_minute    = 0.0;
-  load_info.fifteen_minute = 0.0;
-  dg_sys_info (&load_info, DG_SYS_INFO_LOAD_INFO_TYPE,
-	       DG_SYS_INFO_LOAD_VERSION_0);
-
-  return Fcons (make_number ((int)(load_info.one_minute * 100.0)),
-		Fcons (make_number ((int)(load_info.five_minute * 100.0)),
-		       Fcons (make_number ((int)(load_info.fifteen_minute * 100.0)),
-			      Qnil)));
-#else /* not DGUX */
-#ifndef LOAD_AVE_TYPE
-  error ("load-average not implemented for this operating system");
-
-#else /* LOAD_AVE_TYPE defined */
-
-  LOAD_AVE_TYPE load_ave[3];
-#ifdef VMS
-#ifndef eunice
-#include <iodef.h>
-#include <descrip.h>
-#else
-#include <vms/iodef.h>
-  struct {int dsc$w_length; char *dsc$a_pointer;} descriptor;
-#endif /* eunice */
-#endif /* VMS */
-
-  /* If this fails for any reason, we can return (0 0 0) */
-  load_ave[0] = 0.0; load_ave[1] = 0.0; load_ave[2] = 0.0;
+  double load_ave[3];
+  int loads = getloadavg (load_ave, 3);
+  Lisp_Object ret;
 
-#ifdef VMS
-  /*
-   *	VMS specific code -- read from the Load Ave driver
-   */
-
-  /*
-   *	Ensure that there is a channel open to the load ave device
-   */
-  if (initialized == 0)
-    {
-      /* Attempt to open the channel */
-#ifdef eunice
-      descriptor.size = 18;
-      descriptor.ptr  = "$$VMS_LOAD_AVERAGE";
-#else
-      $DESCRIPTOR(descriptor, "LAV0:");
-#endif
-      if (sys$assign (&descriptor, &channel, 0, 0) & 1)
-	initialized = 1;
-    }
-  /*
-   *	Read the load average vector
-   */
-  if (initialized)
-    {
-      if (!(sys$qiow (0, channel, IO$_READVBLK, 0, 0, 0,
-		     load_ave, 12, 0, 0, 0, 0)
-	    & 1))
-	{
-	  sys$dassgn (channel);
-	  initialized = 0;
-	}
-    }
-#else  /* not VMS */
-  /*
-   *	4.2BSD UNIX-specific code -- read _avenrun from /dev/kmem
-   */
+  if (loads < 0)
+    error ("load-average not implemented for this operating system");
 
-  /*
-   *	Make sure we have the address of _avenrun
-   */
-  if (nl[0].n_value == 0)
-    {
-      /*
-       *	Get the address of _avenrun
-       */
-#ifndef NLIST_STRUCT
-      strcpy (nl[0].n_name, LDAV_SYMBOL);
-      nl[1].n_zeroes = 0;
-#else /* NLIST_STRUCT */
-#ifdef convex
-      nl[0].n_un.n_name = LDAV_SYMBOL;
-      nl[1].n_un.n_name = 0;
-#else /* not convex */
-      nl[0].n_name = LDAV_SYMBOL;
-      nl[1].n_name = 0;
-#endif /* not convex */
-#endif /* NLIST_STRUCT */
-
-      nlist (KERNEL_FILE, nl);
+  ret = Qnil;
+  while (loads > 0)
+    ret = Fcons (make_number ((int) (load_ave[--loads] * 100.0)), ret);
 
-#ifdef FIXUP_KERNEL_SYMBOL_ADDR
-      FIXUP_KERNEL_SYMBOL_ADDR (nl);
-#endif /* FIXUP_KERNEL_SYMBOL_ADDR */
-    }
-  /*
-   *	Make sure we have /dev/kmem open
-   */
-  if (initialized == 0)
-    {
-      /*
-       *	Open /dev/kmem
-       */
-      channel = open ("/dev/kmem", 0);
-      if (channel >= 0) initialized = 1;
-    }
-  /*
-   *	If we can, get the load ave values
-   */
-  if ((nl[0].n_value != 0) && (initialized != 0))
-    {
-      /*
-       *	Seek to the correct address
-       */
-      lseek (channel, (long) nl[0].n_value, 0);
-      if (read (channel, load_ave, sizeof load_ave)
-	  != sizeof(load_ave))
-	{
-	  close (channel);
-	  initialized = 0;
-	}
-    }
-#endif /* not VMS */
-
-  /*
-   *	Return the list of load average values
-   */
-  return Fcons (make_number (LOAD_AVE_CVT (load_ave[0])),
-		Fcons (make_number (LOAD_AVE_CVT (load_ave[1])),
-		       Fcons (make_number (LOAD_AVE_CVT (load_ave[2])),
-			      Qnil)));
-#endif /* LOAD_AVE_TYPE */
-#endif /* not DGUX */
+  return ret;
 }
-
-#undef channel
-#undef initialized
-#undef nl
 
 Lisp_Object Vfeatures;
 
--- a/src/keyboard.c	Wed Jun 24 05:07:51 1992 +0000
+++ b/src/keyboard.c	Wed Jun 24 05:09:26 1992 +0000
@@ -1491,7 +1491,7 @@
 	     get returned to Emacs as an event, the next event read
 	     will set Vlast_event_screen again, so this is safe to do.  */
 	  extern SIGTYPE interrupt_signal ();
-	  XSET (Vlast_event_screen, Lisp_Screen, event->screen);
+	  Vlast_event_screen = SCREEN_FOCUS_SCREEN (event->screen);
 	  last_event_timestamp = event->timestamp;
 	  interrupt_signal ();
 	  return;
@@ -1610,6 +1610,10 @@
     {
       if (kbd_fetch_ptr == kbd_buffer + KBD_BUFFER_SIZE)
 	kbd_fetch_ptr = kbd_buffer;
+      /* Do the redirection specified by the focus_screen
+	 member now, before we return this event.  */
+      kbd_fetch_ptr->screen =
+	XSCREEN (SCREEN_FOCUS_SCREEN (kbd_fetch_ptr->screen));
       XSET (Vlast_event_screen, Lisp_Screen, kbd_fetch_ptr->screen);
       last_event_timestamp = kbd_fetch_ptr->timestamp;
       obj = make_lispy_event (kbd_fetch_ptr);
@@ -2765,7 +2769,7 @@
   GCPRO1 (keybuf[0]);
   gcpro1.nvars = (sizeof keybuf/sizeof (keybuf[0]));
 
-  if (! NILP (continue_echo))
+  if (NILP (continue_echo))
     this_command_key_count = 0;
 
   i = read_key_sequence (keybuf, (sizeof keybuf/sizeof (keybuf[0])),
@@ -3050,7 +3054,7 @@
 }
 
 DEFUN ("recent-keys", Frecent_keys, Srecent_keys, 0, 0, 0,
-  "Return a vector of last 100 events read from terminal.")
+  "Return vector of last 100 chars read from terminal.")
   ()
 {
   Lisp_Object val;
--- a/src/search.c	Wed Jun 24 05:07:51 1992 +0000
+++ b/src/search.c	Wed Jun 24 05:09:26 1992 +0000
@@ -59,9 +59,10 @@
    able to free or re-allocate it properly.  */
 static struct re_registers search_regs;
 
-/* Nonzero if search_regs are indices in a string; 0 if in a buffer.  */
-
-static int search_regs_from_string;
+/* The buffer in which the last search was performed, or
+   Qt if the last search was done in a string;
+   Qnil if no searching has been done yet.  */
+static Lisp_Object last_thing_searched;
 
 /* error condition signalled when regexp compile_pattern fails */
 
@@ -178,7 +179,7 @@
 	search_regs.start[i] += BEGV;
 	search_regs.end[i] += BEGV;
       }
-  search_regs_from_string = 0;
+  XSET (last_thing_searched, Lisp_Buffer, current_buffer);
   immediate_quit = 0;
   return val;
 }
@@ -219,7 +220,7 @@
 		   XSTRING (string)->size, s, XSTRING (string)->size - s,
 		   &search_regs);
   immediate_quit = 0;
-  search_regs_from_string = 1;
+  last_thing_searched = Qt;
   if (val == -2)
     matcher_overflow ();
   if (val < 0) return Qnil;
@@ -587,7 +588,7 @@
 		    search_regs.start[i] += j;
 		    search_regs.end[i] += j;
 		  }
-	      search_regs_from_string = 0;
+	      XSET (last_thing_searched, Lisp_Buffer, current_buffer);
 	      /* Set pos to the new position. */
 	      pos = search_regs.start[0];
 	    }
@@ -614,7 +615,7 @@
 		    search_regs.start[i] += j;
 		    search_regs.end[i] += j;
 		  }
-	      search_regs_from_string = 0;
+	      XSET (last_thing_searched, Lisp_Buffer, current_buffer);
 	      pos = search_regs.end[0];
 	    }
 	  else
@@ -804,7 +805,7 @@
 			= pos + cursor - p2 + ((direction > 0)
 					       ? 1 - len : 0);
 		      search_regs.end[0] = len + search_regs.start[0];
-		      search_regs_from_string = 0;
+		      XSET (last_thing_searched, Lisp_Buffer, current_buffer);
 		      if ((n -= direction) != 0)
 			cursor += dirlen; /* to resume search */
 		      else
@@ -878,7 +879,7 @@
 		      search_regs.start[0]
 			= pos + ((direction > 0) ? 1 - len : 0);
 		      search_regs.end[0] = len + search_regs.start[0];
-		      search_regs_from_string = 0;
+		      XSET (last_thing_searched, Lisp_Buffer, current_buffer);
 		      if ((n -= direction) != 0)
 			pos += dirlen; /* to resume search */
 		      else
@@ -1221,6 +1222,9 @@
   Lisp_Object *data;
   int i, len;
 
+  if (NILP (last_thing_searched))
+    error ("match-data called before any match found");
+
   data = (Lisp_Object *) alloca ((2 * search_regs.num_regs)
 				 * sizeof (Lisp_Object));
 
@@ -1230,19 +1234,26 @@
       int start = search_regs.start[i];
       if (start >= 0)
 	{
-	  if (search_regs_from_string)
+	  if (EQ (last_thing_searched, Qt))
 	    {
 	      XFASTINT (data[2 * i]) = start;
 	      XFASTINT (data[2 * i + 1]) = search_regs.end[i];
 	    }
-	  else
+	  else if (XTYPE (last_thing_searched) == Lisp_Buffer)
 	    {
 	      data[2 * i] = Fmake_marker ();
-	      Fset_marker (data[2 * i], make_number (start), Qnil);
+	      Fset_marker (data[2 * i],
+			   make_number (start),
+			   last_thing_searched);
 	      data[2 * i + 1] = Fmake_marker ();
 	      Fset_marker (data[2 * i + 1],
-			   make_number (search_regs.end[i]), Qnil);
+			   make_number (search_regs.end[i]), 
+			   last_thing_searched);
 	    }
+	  else
+	    /* last_thing_searched must always be Qt, a buffer, or Qnil.  */
+	    abort ();
+
 	  len = i;
 	}
       else
@@ -1264,6 +1275,10 @@
   if (!CONSP (list) && !NILP (list))
     list = wrong_type_argument (Qconsp, list, 0);
 
+  /* Unless we find a marker with a buffer in LIST, assume that this 
+     match data came from a string.  */
+  last_thing_searched = Qt;
+
   /* Allocate registers if they don't already exist.  */
   {
     int length = Flength (list) / 2;
@@ -1302,9 +1317,14 @@
 	}
       else
 	{
-	  if (XTYPE (marker) == Lisp_Marker
-	      && XMARKER (marker)->buffer == 0)
-	    XFASTINT (marker) = 0;
+	  if (XTYPE (marker) == Lisp_Marker)
+	    {
+	      if (XMARKER (marker)->buffer == 0)
+		XFASTINT (marker) = 0;
+	      else
+		XSET (last_thing_searched, Lisp_Buffer,
+		      XMARKER (marker)->buffer);
+	    }
 
 	  CHECK_NUMBER_COERCE_MARKER (marker, 0);
 	  search_regs.start[i] = XINT (marker);
@@ -1383,6 +1403,9 @@
   last_regexp = Qnil;
   staticpro (&last_regexp);
 
+  last_thing_searched = Qnil;
+  staticpro (&last_thing_searched);
+
   defsubr (&Sstring_match);
   defsubr (&Slooking_at);
   defsubr (&Sskip_chars_forward);
--- a/src/xdisp.c	Wed Jun 24 05:07:51 1992 +0000
+++ b/src/xdisp.c	Wed Jun 24 05:09:26 1992 +0000
@@ -311,6 +311,18 @@
       /* If desired cursor location is on this line, put it at end of text */
       if (SCREEN_CURSOR_Y (s) == vpos)
 	SCREEN_CURSOR_X (s) = s->desired_glyphs->used[vpos];
+
+      /* Fill the rest of the minibuffer window with blank lines.  */
+      {
+	int i;
+
+	for (i = vpos + 1; i < vpos + XWINDOW (minibuf_window)->height; i++)
+	  {
+	    get_display_line (s, i, 0);
+	    display_string (XWINDOW (minibuf_window), vpos,
+			    "", 0, 0, 0, SCREEN_WIDTH (s));
+	  }
+      }
     }
   else if (!EQ (minibuf_window, selected_window))
     windows_or_buffers_changed++;
--- a/src/xfns.c	Wed Jun 24 05:07:51 1992 +0000
+++ b/src/xfns.c	Wed Jun 24 05:09:26 1992 +0000
@@ -1043,6 +1043,10 @@
 {
   CHECK_STRING (arg, 0);
 
+  /* Don't change the name if it's already ARG.  */
+  if (! NILP (Fstring_equal (arg, s->name)))
+    return;
+
   if (s->display.x->window_desc)
     {
 #ifdef HAVE_X11
@@ -1056,7 +1060,6 @@
       XSetWMIconName (XDISPLAY s->display.x->window_desc, &prop);
       UNBLOCK_INPUT;
 #else
-      s->name = arg;
       BLOCK_INPUT;
       XStoreName (XDISPLAY s->display.x->window_desc,
 		  (char *) XSTRING (arg)->data);
@@ -1065,6 +1068,8 @@
       UNBLOCK_INPUT;
 #endif
     }
+
+  s->name = arg;
 }
 
 void
@@ -1868,8 +1873,9 @@
 		      build_string ("white"), "background", string);
   x_default_parameter (s, parms, "border-width",
 		      make_number (2), "BorderWidth", number);
+  /* This defaults to 2 in order to match XTerms.  */
   x_default_parameter (s, parms, "internal-border-width",
-		      make_number (1), "InternalBorderWidth", number);
+		      make_number (2), "InternalBorderWidth", number);
 
   /* Also do the stuff which must be set before the window exists. */
   x_default_parameter (s, parms, "foreground-color",
--- a/src/xterm.c	Wed Jun 24 05:07:51 1992 +0000
+++ b/src/xterm.c	Wed Jun 24 05:09:26 1992 +0000
@@ -1995,7 +1995,7 @@
 		    {
 		      bufp->kind = non_ascii_keystroke;
 		      XSET (bufp->code, Lisp_Int, (unsigned) keysym - 0xff50);
-		      bufp->screen = XSCREEN (SCREEN_FOCUS_SCREEN (s));
+		      bufp->screen = s;
 		      bufp->modifiers = x_convert_modifiers (modifiers);
 		      bufp->timestamp = event.xkey.time;
 		      bufp++;
@@ -2012,7 +2012,7 @@
 			    *copy_buffer |= METABIT;
 			  bufp->kind = ascii_keystroke;
 			  XSET (bufp->code, Lisp_Int, *copy_buffer);
-			  bufp->screen = XSCREEN (SCREEN_FOCUS_SCREEN (s));
+			  bufp->screen = s;
 			  bufp->timestamp = event.xkey.time;
 			  bufp++;
 			}
@@ -2021,7 +2021,7 @@
 			  {
 			    bufp->kind = ascii_keystroke;
 			    XSET (bufp->code, Lisp_Int, copy_buffer[i]);
-			    bufp->screen = XSCREEN (SCREEN_FOCUS_SCREEN (s));
+			    bufp->screen = s;
 			    bufp->timestamp = event.xkey.time;
 			    bufp++;
 			  }
@@ -2071,7 +2071,7 @@
 		    bufp->kind = ascii_keystroke;
 		    XSET (bufp->code, Lisp_Int, where_mapping[i]);
 		    XSET (bufp->time, Lisp_Int, event.xkey.time);
-		    bufp->screen = XSCREEN (SCREEN_FOCUS_SCREEN (s));
+		    bufp->screen = s;
 		    bufp++;
 		  }
 		count += nbytes;
@@ -2308,13 +2308,13 @@
 	    {
 	      bufp->kind = ascii_keystroke;
 	      bufp->code = (char) 'X' & 037; /* C-x */
-	      bufp->screen = XSCREEN (SCREEN_FOCUS_SCREEN (s));
+	      bufp->screen = s;
 	      XSET (bufp->time, Lisp_Int, event.xkey.time);
 	      bufp++;
 
 	      bufp->kind = ascii_keystroke;
 	      bufp->code = (char) 0; /* C-@ */
-	      bufp->screen = XSCREEN (SCREEN_FOCUS_SCREEN (s));
+	      bufp->screen = s;
 	      XSET (bufp->time, Lisp_Int, event.xkey.time);
 	      bufp++;
 
@@ -3606,6 +3606,9 @@
   Window window = s->display.x->window_desc;
 
   size_hints.flags = PResizeInc | PMinSize | PMaxSize;
+#ifdef PBaseSize
+  size_hints.flags |= PBaseSize;
+#endif
 
   flexlines = s->height;