mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-24 07:20:37 +00:00
(comint-get-old-input-default): Don't signal an error if point is not on
an input field; instead, return the current line (using `comint-bol' to skip any prompt, in case we're not using fields at all).
This commit is contained in:
parent
c7cbaf4a0e
commit
d3b98912ef
@ -1,3 +1,14 @@
|
|||||||
|
2001-08-22 Miles Bader <miles@gnu.org>
|
||||||
|
|
||||||
|
* comint.el (comint-get-old-input-default): Don't signal an error
|
||||||
|
if point is not on an input field; instead, return the current
|
||||||
|
line (using `comint-bol' to skip any prompt, in case we're not
|
||||||
|
using fields at all).
|
||||||
|
|
||||||
|
* man.el (Man-mode-line-format): Variable removed.
|
||||||
|
(Man-mode): Change `mode-line-buffer-identification' instead of
|
||||||
|
`mode-line-format'.
|
||||||
|
|
||||||
2001-08-27 Gerd Moellmann <gerd@gnu.org>
|
2001-08-27 Gerd Moellmann <gerd@gnu.org>
|
||||||
|
|
||||||
* mail/sendmail.el (mail-send-hook): Remove a duplicate defcustom.
|
* mail/sendmail.el (mail-send-hook): Remove a duplicate defcustom.
|
||||||
|
@ -1372,10 +1372,13 @@ The values of `comint-get-old-input', `comint-input-filter-functions', and
|
|||||||
in the buffer. E.g.,
|
in the buffer. E.g.,
|
||||||
|
|
||||||
If the interpreter is the csh,
|
If the interpreter is the csh,
|
||||||
comint-get-old-input is the default: either return the current
|
comint-get-old-input is the default:
|
||||||
field, or take the current line and discard any
|
If `comint-use-prompt-regexp-instead-of-fields' is nil, then
|
||||||
initial string matching regexp `comint-prompt-regexp', depending
|
either return the current input field, if point is on an input
|
||||||
on the value of `comint-use-prompt-regexp-instead-of-fields'.
|
field, or the current line, if point is on an output field.
|
||||||
|
If `comint-use-prompt-regexp-instead-of-fields' is non-nil, then
|
||||||
|
return the current line with any initial string matching the
|
||||||
|
regexp `comint-prompt-regexp' removed.
|
||||||
comint-input-filter-functions monitors input for \"cd\", \"pushd\", and
|
comint-input-filter-functions monitors input for \"cd\", \"pushd\", and
|
||||||
\"popd\" commands. When it sees one, it cd's the buffer.
|
\"popd\" commands. When it sees one, it cd's the buffer.
|
||||||
comint-input-filter is the default: returns t if the input isn't all white
|
comint-input-filter is the default: returns t if the input isn't all white
|
||||||
@ -1753,21 +1756,17 @@ This function could be on `comint-output-filter-functions' or bound to a key."
|
|||||||
|
|
||||||
(defun comint-get-old-input-default ()
|
(defun comint-get-old-input-default ()
|
||||||
"Default for `comint-get-old-input'.
|
"Default for `comint-get-old-input'.
|
||||||
Returns either the current field, or the current line with any initial
|
If `comint-use-prompt-regexp-instead-of-fields' is nil, then either
|
||||||
text matching `comint-prompt-regexp' stripped off, depending on the
|
return the current input field, if point is on an input field, or the
|
||||||
value of `comint-use-prompt-regexp-instead-of-fields'."
|
current line, if point is on an output field.
|
||||||
(if comint-use-prompt-regexp-instead-of-fields
|
If `comint-use-prompt-regexp-instead-of-fields' is non-nil, then return
|
||||||
(save-excursion
|
the current line with any initial string matching the regexp
|
||||||
(beginning-of-line)
|
`comint-prompt-regexp' removed."
|
||||||
(comint-skip-prompt)
|
(let ((bof (field-beginning)))
|
||||||
(let ((beg (point)))
|
(if (eq (get-char-property bof 'field) 'input)
|
||||||
(end-of-line)
|
(field-string bof)
|
||||||
(buffer-substring beg (point))))
|
(comint-bol)
|
||||||
;; Return the contents of the field at the current point.
|
(buffer-substring (point) (line-end-position)))))
|
||||||
(let ((pos (field-beginning (point))))
|
|
||||||
(unless (eq (get-char-property pos 'field) 'input)
|
|
||||||
(error "Not an input field"))
|
|
||||||
(field-string pos))))
|
|
||||||
|
|
||||||
(defun comint-copy-old-input ()
|
(defun comint-copy-old-input ()
|
||||||
"Insert after prompt old input at point as new input to be edited.
|
"Insert after prompt old input at point as new input to be edited.
|
||||||
|
Loading…
Reference in New Issue
Block a user