]> git.eshelyaron.com Git - emacs.git/commitdiff
(comint-replace-by-expanded-history): Don't use
authorMiles Bader <miles@gnu.org>
Mon, 30 Oct 2000 06:22:20 +0000 (06:22 +0000)
committerMiles Bader <miles@gnu.org>
Mon, 30 Oct 2000 06:22:20 +0000 (06:22 +0000)
comint-get-old-input (we're not looking at *old* input).
(comint-get-old-input-default): If using fields, signal an error
when the point is not in an input field.

lisp/ChangeLog
lisp/comint.el

index 96748d3a426630a32fb77a8a23acd94e26799499..3e54c19f1a5bcbab9d4ea9805975cb8f33c7eb54 100644 (file)
@@ -1,3 +1,10 @@
+2000-10-30  Miles Bader  <miles@lsi.nec.co.jp>
+
+       * comint.el (comint-replace-by-expanded-history): Don't use
+       comint-get-old-input (we're not looking at *old* input).
+       (comint-get-old-input-default): If using fields, signal an error
+       when the point is not in an input field.
+
 2000-10-30  Kenichi Handa  <handa@etl.go.jp>
 
        * international/mule-conf.el: New charsets mule-unicode-2500-33ff
 2000-08-28  Peter Breton  <pbreton@ne.mediaone.net>
 
        * locate.el (locate): Cleaned up locate command's interactive prompting
-       Thanks to François_Pinard <pinard@iro.umontreal.ca> for suggestions.
+       Thanks to Fran\e,Ag\e(Bois_Pinard <pinard@iro.umontreal.ca> for suggestions.
 
        * filecache.el (file-cache-case-fold-search): New variable
        (file-cache-assoc-function): New variable
 
 2000-05-07  Dave Love  <fx@gnu.org>
 
-       * time.el: Small doc fixes from Pavel Janík ml.
+       * time.el: Small doc fixes from Pavel Jan\e,Am\e(Bk ml.
 
 2000-05-05  Dave Love  <fx@gnu.org>
 
index 8400530393d6239d43e2c0b59c0cfdc713f2b821..3a02d93ee725e88fb9be1fe3f5ca5e44028c05ce 100644 (file)
@@ -1106,14 +1106,15 @@ See `comint-magic-space' and `comint-replace-by-expanded-history-before-point'.
 Returns t if successful."
   (interactive)
   (if (and comint-input-autoexpand
-          (string-match "!\\|^\\^" (funcall comint-get-old-input))
           (if comint-use-prompt-regexp-instead-of-fields
               ;; Use comint-prompt-regexp
-              (save-excursion (beginning-of-line)
-                              (looking-at comint-prompt-regexp))
+              (save-excursion
+                (beginning-of-line)
+                (looking-at (concat comint-prompt-regexp "!\\|\\^")))
             ;; Use input fields.  User input that hasn't been entered
             ;; yet, at the end of the buffer, has a nil `field' property.
-            (null (get-char-property (point) 'field))))
+            (and (null (get-char-property (point) 'field))
+                 (string-match "!\\|^\\^" (field-string)))))
       ;; Looks like there might be history references in the command.
       (let ((previous-modified-tick (buffer-modified-tick)))
        (comint-replace-by-expanded-history-before-point silent start)
@@ -1711,8 +1712,10 @@ value of `comint-use-prompt-regexp-instead-of-fields'."
          (end-of-line)
          (buffer-substring beg (point))))
     ;; Return the contents of the field at the current point.
-    (field-string)))
-
+    (let ((pos (field-beginning (point))))
+      (unless (eq (get-char-property pos 'field) 'input)
+       (error "Point not in input field"))
+      (field-string pos))))
 
 (defun comint-copy-old-input ()
   "Insert after prompt old input at point as new input to be edited.