Defaults to \"^\", the null string at BOL.
This variable is only used if the variable
-`comint-use-prompt-regexp-instead-of-fields' is non-nil.
+`comint-use-prompt-regexp' is non-nil.
Good choices:
Canonical Lisp: \"^[^> \\n]*>+:? *\" (Lucid, franz, kcl, T, cscheme, oaklisp)
default is `comint-get-old-input-default', which either grabs the
current input field or grabs the current line and strips off leading
text matching `comint-prompt-regexp', depending on the value of
-`comint-use-prompt-regexp-instead-of-fields'.")
+`comint-use-prompt-regexp'.")
(defvar comint-dynamic-complete-functions
'(comint-replace-by-expanded-history comint-dynamic-complete-filename)
;; Note: If it is decided to purge comint-prompt-regexp from the source
;; entirely, searching for uses of this variable will help to identify
;; places that need attention.
-(defcustom comint-use-prompt-regexp-instead-of-fields nil
- "*If non-nil, use `comint-prompt-regexp' to distinguish prompts from user-input.
+(defcustom comint-use-prompt-regexp nil
+ "*If non-nil, use `comint-prompt-regexp' to recognize prompts.
If nil, then program output and user-input are given different `field'
properties, which Emacs commands can use to distinguish them (in
particular, common movement commands such as begining-of-line respect
:type 'boolean
:group 'comint)
+;; Autoload is necessary for Custom to recognize old alias.
+;;;###autoload
+(defvaralias 'comint-use-prompt-regexp-instead-of-fields
+ 'comint-use-prompt-regexp)
+(make-obsolete-variable 'comint-use-prompt-regexp-instead-of-fields
+ 'comint-use-prompt-regexp "22.1")
+
(defcustom comint-mode-hook '(turn-on-font-lock)
"Hook run upon entry to `comint-mode'.
This is run before the process is cranked up."
Returns t if successful."
(interactive)
(if (and comint-input-autoexpand
- (if comint-use-prompt-regexp-instead-of-fields
+ (if comint-use-prompt-regexp
;; Use comint-prompt-regexp
(save-excursion
(beginning-of-line)
If the interpreter is the csh,
`comint-get-old-input' is the default:
- If `comint-use-prompt-regexp-instead-of-fields' is nil, then
+ If `comint-use-prompt-regexp' is nil, then
either return the current input field, if point is on an input
field, or the current line, if point is on an output field.
- If `comint-use-prompt-regexp-instead-of-fields' is non-nil, then
+ If `comint-use-prompt-regexp' 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
font-lock-face comint-highlight-input
mouse-face highlight
help-echo "mouse-2: insert after prompt as new input"))
- (unless comint-use-prompt-regexp-instead-of-fields
+ (unless comint-use-prompt-regexp
;; Give old user input a field property of `input', to
;; distinguish it from both process output and unsent
;; input. The terminating newline is put into a special
;; `boundary' field to make cursor movement between input
;; and output fields smoother.
(put-text-property beg end 'field 'input)))
- (unless (or no-newline comint-use-prompt-regexp-instead-of-fields)
+ (unless (or no-newline comint-use-prompt-regexp)
;; Cover the terminating newline
(add-text-properties end (1+ end)
'(rear-nonsticky t
(goto-char (process-mark process)) ; in case a filter moved it
- (unless comint-use-prompt-regexp-instead-of-fields
+ (unless comint-use-prompt-regexp
(let ((inhibit-read-only t)
(inhibit-modification-hooks t))
(add-text-properties comint-last-output-start (point)
(defun comint-get-old-input-default ()
"Default for `comint-get-old-input'.
-If `comint-use-prompt-regexp-instead-of-fields' is nil, then either
+If `comint-use-prompt-regexp' is nil, then either
return the current input field, if point is on an input 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
+If `comint-use-prompt-regexp' is non-nil, then return
the current line with any initial string matching the regexp
`comint-prompt-regexp' removed."
(let ((bof (field-beginning)))
(defun comint-line-beginning-position ()
"Return the buffer position of the beginning of the line, after any prompt.
-If `comint-use-prompt-regexp-instead-of-fields' is non-nil, then the
-prompt skip is done by skipping text matching the regular expression
-`comint-prompt-regexp', a buffer local variable."
- (if comint-use-prompt-regexp-instead-of-fields
+If `comint-use-prompt-regexp' is non-nil, then the prompt skip is done by
+skipping text matching the regular expression `comint-prompt-regexp',
+a buffer local variable."
+ (if comint-use-prompt-regexp
;; Use comint-prompt-regexp
(save-excursion
(beginning-of-line)
(defun comint-bol (&optional arg)
"Go to the beginning of line, then skip past the prompt, if any.
If prefix argument is given (\\[universal-argument]) the prompt is not skipped.
-If `comint-use-prompt-regexp-instead-of-fields' is non-nil, then the
-prompt skip is done by skipping text matching the regular expression
-`comint-prompt-regexp', a buffer local variable."
+If `comint-use-prompt-regexp' is non-nil, then the prompt skip is done
+by skipping text matching the regular expression `comint-prompt-regexp',
+a buffer local variable."
(interactive "P")
(if arg
;; Unlike `beginning-of-line', forward-line ignores field boundaries
(interactive)
(push-mark)
(let ((pos (or (marker-position comint-last-input-end) (point-max))))
- (cond (comint-use-prompt-regexp-instead-of-fields
+ (cond (comint-use-prompt-regexp
(goto-char pos)
(beginning-of-line 0)
(set-window-start (selected-window) (point))
(defun comint-backward-matching-input (regexp n)
"Search backward through buffer for input fields that match REGEXP.
-If `comint-use-prompt-regexp-instead-of-fields' is non-nil, then input
-fields are identified by lines that match `comint-prompt-regexp'.
+If `comint-use-prompt-regexp' is non-nil, then input fields are identified
+by lines that match `comint-prompt-regexp'.
With prefix argument N, search for Nth previous match.
If N is negative, find the next or Nth next match."
(interactive (comint-regexp-arg "Backward input matching (regexp): "))
- (if comint-use-prompt-regexp-instead-of-fields
+ (if comint-use-prompt-regexp
;; Use comint-prompt-regexp
(let* ((re (concat comint-prompt-regexp ".*" regexp))
(pos (save-excursion (end-of-line (if (> n 0) 0 1))
(defun comint-forward-matching-input (regexp arg)
"Search forward through buffer for input fields that match REGEXP.
-If `comint-use-prompt-regexp-instead-of-fields' is non-nil, then input
-fields are identified by lines that match `comint-prompt-regexp'.
+If `comint-use-prompt-regexp' is non-nil, then input fields are identified
+by lines that match `comint-prompt-regexp'.
With prefix argument N, search for Nth following match.
If N is negative, find the previous or Nth previous match."
(defun comint-next-prompt (n)
"Move to end of Nth next prompt in the buffer.
-If `comint-use-prompt-regexp-instead-of-fields' is nil, then this means
-the beginning of the Nth next `input' field, otherwise, it means the Nth
-occurrence of text matching `comint-prompt-regexp'."
+If `comint-use-prompt-regexp' is nil, then this means the beginning of
+the Nth next `input' field, otherwise, it means the Nth occurrence of
+text matching `comint-prompt-regexp'."
(interactive "p")
- (if comint-use-prompt-regexp-instead-of-fields
+ (if comint-use-prompt-regexp
;; Use comint-prompt-regexp
(let ((paragraph-start comint-prompt-regexp))
(end-of-line (if (> n 0) 1 0))
(defun comint-previous-prompt (n)
"Move to end of Nth previous prompt in the buffer.
-If `comint-use-prompt-regexp-instead-of-fields' is nil, then this means
-the beginning of the Nth previous `input' field, otherwise, it means the Nth
-occurrence of text matching `comint-prompt-regexp'."
+If `comint-use-prompt-regexp' is nil, then this means the beginning of
+the Nth previous `input' field, otherwise, it means the Nth occurrence of
+text matching `comint-prompt-regexp'."
(interactive "p")
(comint-next-prompt (- n)))
;; appropriate magic default by examining what we think is the prompt)?
;;
;; Fixme: look for appropriate fields, rather than regexp, if
-;; `comint-use-prompt-regexp-instead-of-fields' is true.
+;; `comint-use-prompt-regexp' is true.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Variables