From: Miles Bader Date: Mon, 30 Oct 2000 06:22:20 +0000 (+0000) Subject: (comint-replace-by-expanded-history): Don't use X-Git-Tag: emacs-pretest-21.0.90~424 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1ec321a75015beea1d3c53cacf97af697f53aac1;p=emacs.git (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. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 96748d3a426..3e54c19f1a5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2000-10-30 Miles Bader + + * 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 * international/mule-conf.el: New charsets mule-unicode-2500-33ff @@ -4798,7 +4805,7 @@ 2000-08-28 Peter Breton * locate.el (locate): Cleaned up locate command's interactive prompting - Thanks to François_Pinard for suggestions. + Thanks to Fran,Ag(Bois_Pinard for suggestions. * filecache.el (file-cache-case-fold-search): New variable (file-cache-assoc-function): New variable @@ -8729,7 +8736,7 @@ 2000-05-07 Dave Love - * time.el: Small doc fixes from Pavel Janík ml. + * time.el: Small doc fixes from Pavel Jan,Am(Bk ml. 2000-05-05 Dave Love diff --git a/lisp/comint.el b/lisp/comint.el index 8400530393d..3a02d93ee72 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -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.