[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/comint.el
From: |
Juanma Barranquero |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/comint.el |
Date: |
Thu, 21 Jul 2005 11:11:29 -0400 |
Index: emacs/lisp/comint.el
diff -c emacs/lisp/comint.el:1.327 emacs/lisp/comint.el:1.328
*** emacs/lisp/comint.el:1.327 Fri Jul 8 13:44:42 2005
--- emacs/lisp/comint.el Thu Jul 21 15:11:27 2005
***************
*** 411,427 ****
"*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
! field boundaries in a natural way)."
: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 nil
"Hook run upon entry to `comint-mode'.
--- 411,425 ----
"*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 `beginning-of-line'
! respect field boundaries in a natural way)."
:type 'boolean
:group 'comint)
;; Autoload is necessary for Custom to recognize old alias.
;;;###autoload
! (define-obsolete-variable-alias 'comint-use-prompt-regexp-instead-of-fields
! 'comint-use-prompt-regexp "22.1")
(defcustom comint-mode-hook nil
"Hook run upon entry to `comint-mode'.
***************
*** 1079,1092 ****
(if (string-match regexp (ring-ref comint-input-ring n))
n)))
! (defun comint-previous-matching-input (regexp arg)
"Search backwards through input history for match for REGEXP.
\(Previous history elements are earlier commands.)
With prefix argument N, search for Nth previous match.
If N is negative, find the next or Nth next match."
(interactive (comint-regexp-arg "Previous input matching (regexp): "))
! (setq arg (comint-search-arg arg))
! (let ((pos (comint-previous-matching-input-string-position regexp arg)))
;; Has a match been found?
(if (null pos)
(error "Not found")
--- 1077,1090 ----
(if (string-match regexp (ring-ref comint-input-ring n))
n)))
! (defun comint-previous-matching-input (regexp n)
"Search backwards through input history for match for REGEXP.
\(Previous history elements are earlier commands.)
With prefix argument N, search for Nth previous match.
If N is negative, find the next or Nth next match."
(interactive (comint-regexp-arg "Previous input matching (regexp): "))
! (setq n (comint-search-arg n))
! (let ((pos (comint-previous-matching-input-string-position regexp n)))
;; Has a match been found?
(if (null pos)
(error "Not found")
***************
*** 1099,1113 ****
(point))
(insert (ring-ref comint-input-ring pos)))))
! (defun comint-next-matching-input (regexp arg)
"Search forwards through input history for match for REGEXP.
\(Later history elements are more recent commands.)
With prefix argument N, search for Nth following match.
If N is negative, find the previous or Nth previous match."
(interactive (comint-regexp-arg "Next input matching (regexp): "))
! (comint-previous-matching-input regexp (- arg)))
! (defun comint-previous-matching-input-from-input (arg)
"Search backwards through input history for match for current input.
\(Previous history elements are earlier commands.)
With prefix argument N, search for Nth previous match.
--- 1097,1111 ----
(point))
(insert (ring-ref comint-input-ring pos)))))
! (defun comint-next-matching-input (regexp n)
"Search forwards through input history for match for REGEXP.
\(Later history elements are more recent commands.)
With prefix argument N, search for Nth following match.
If N is negative, find the previous or Nth previous match."
(interactive (comint-regexp-arg "Next input matching (regexp): "))
! (comint-previous-matching-input regexp (- n)))
! (defun comint-previous-matching-input-from-input (n)
"Search backwards through input history for match for current input.
\(Previous history elements are earlier commands.)
With prefix argument N, search for Nth previous match.
***************
*** 1124,1138 ****
comint-input-ring-index nil))
(comint-previous-matching-input
(concat "^" (regexp-quote comint-matching-input-from-input-string))
! arg))
! (defun comint-next-matching-input-from-input (arg)
"Search forwards through input history for match for current input.
\(Following history elements are more recent commands.)
With prefix argument N, search for Nth following match.
If N is negative, search backwards for the -Nth previous match."
(interactive "p")
! (comint-previous-matching-input-from-input (- arg)))
(defun comint-replace-by-expanded-history (&optional silent start)
--- 1122,1136 ----
comint-input-ring-index nil))
(comint-previous-matching-input
(concat "^" (regexp-quote comint-matching-input-from-input-string))
! n))
! (defun comint-next-matching-input-from-input (n)
"Search forwards through input history for match for current input.
\(Following history elements are more recent commands.)
With prefix argument N, search for Nth following match.
If N is negative, search backwards for the -Nth previous match."
(interactive "p")
! (comint-previous-matching-input-from-input (- n)))
(defun comint-replace-by-expanded-history (&optional silent start)
***************
*** 1434,1447 ****
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
! \"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
space.
If the Comint is Lucid Common Lisp,
! comint-get-old-input snarfs the sexp ending at point.
! comint-input-filter-functions does nothing.
! comint-input-filter returns nil if the input matches input-filter-regexp,
which matches (1) all whitespace (2) :a, :c, etc.
Similarly for Soar, Scheme, etc."
--- 1432,1445 ----
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
! \"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
space.
If the Comint is Lucid Common Lisp,
! `comint-get-old-input' snarfs the sexp ending at point.
! `comint-input-filter-functions' does nothing.
! `comint-input-filter' returns nil if the input matches
input-filter-regexp,
which matches (1) all whitespace (2) :a, :c, etc.
Similarly for Soar, Scheme, etc."
***************
*** 2002,2009 ****
(delete-region pmark (point))))
;; Output message and put back prompt
(comint-output-filter proc replacement)))
! (defalias 'comint-kill-output 'comint-delete-output)
! (make-obsolete 'comint-kill-output 'comint-delete-output "21.1")
(defun comint-write-output (filename &optional append mustbenew)
"Write output from interpreter since last input to FILENAME.
--- 2000,2007 ----
(delete-region pmark (point))))
;; Output message and put back prompt
(comint-output-filter proc replacement)))
! (define-obsolete-function-alias 'comint-kill-output
! 'comint-delete-output "21.1")
(defun comint-write-output (filename &optional append mustbenew)
"Write output from interpreter since last input to FILENAME.
***************
*** 2169,2175 ****
(goto-char pos))))
! (defun comint-forward-matching-input (regexp arg)
"Search forward through buffer for input fields that match REGEXP.
If `comint-use-prompt-regexp' is non-nil, then input fields are identified
by lines that match `comint-prompt-regexp'.
--- 2167,2173 ----
(goto-char pos))))
! (defun comint-forward-matching-input (regexp n)
"Search forward through buffer for input fields that match REGEXP.
If `comint-use-prompt-regexp' is non-nil, then input fields are identified
by lines that match `comint-prompt-regexp'.
***************
*** 2177,2183 ****
With prefix argument N, search for Nth following match.
If N is negative, find the previous or Nth previous match."
(interactive (comint-regexp-arg "Forward input matching (regexp): "))
! (comint-backward-matching-input regexp (- arg)))
(defun comint-next-prompt (n)
--- 2175,2181 ----
With prefix argument N, search for Nth following match.
If N is negative, find the previous or Nth previous match."
(interactive (comint-regexp-arg "Forward input matching (regexp): "))
! (comint-backward-matching-input regexp (- n)))
(defun comint-next-prompt (n)
***************
*** 2388,2394 ****
(defun comint-source-default (previous-dir/file source-modes)
"Compute the defaults for `load-file' and `compile-file' commands.
! PREVIOUS-DIR/FILE is a pair (directory . filename) from the last
source-file processing command, or nil if there hasn't been one yet.
SOURCE-MODES is a list used to determine what buffers contain source
files: if the major mode of the buffer is in SOURCE-MODES, it's source.
--- 2386,2392 ----
(defun comint-source-default (previous-dir/file source-modes)
"Compute the defaults for `load-file' and `compile-file' commands.
! PREVIOUS-DIR/FILE is a pair (DIRECTORY . FILENAME) from the last
source-file processing command, or nil if there hasn't been one yet.
SOURCE-MODES is a list used to determine what buffers contain source
files: if the major mode of the buffer is in SOURCE-MODES, it's source.
***************
*** 2409,2415 ****
the command has been run (PREVIOUS-DIR/FILE is nil), the default directory
is the cwd, with no default file. (\"no default file\" = nil)
! SOURCE-REGEXP is typically going to be something like (tea-mode)
for T programs, (lisp-mode) for Lisp programs, (soar-mode lisp-mode)
for Soar programs, etc.
--- 2407,2413 ----
the command has been run (PREVIOUS-DIR/FILE is nil), the default directory
is the cwd, with no default file. (\"no default file\" = nil)
! SOURCE-MODES is typically going to be something like (tea-mode)
for T programs, (lisp-mode) for Lisp programs, (soar-mode lisp-mode)
for Soar programs, etc.
***************
*** 2440,2446 ****
(set-buffer old-buffer)))))
(defun comint-extract-string ()
! "Return string around POINT, or nil."
(let ((syntax (syntax-ppss)))
(when (nth 3 syntax)
(condition-case ()
--- 2438,2444 ----
(set-buffer old-buffer)))))
(defun comint-extract-string ()
! "Return string around point, or nil."
(let ((syntax (syntax-ppss)))
(when (nth 3 syntax)
(condition-case ()
***************
*** 2460,2466 ****
PROMPT is the prompt string. PREV-DIR/FILE is the (DIRECTORY . FILE) pair
from the last source processing command. SOURCE-MODES is a list of major
modes used to determine what file buffers contain source files. (These
! two arguments are used for determining defaults). If MUSTMATCH-P is true,
then the filename reader will only accept a file that exists.
A typical use:
--- 2458,2464 ----
PROMPT is the prompt string. PREV-DIR/FILE is the (DIRECTORY . FILE) pair
from the last source processing command. SOURCE-MODES is a list of major
modes used to determine what file buffers contain source files. (These
! two arguments are used for determining defaults.) If MUSTMATCH-P is true,
then the filename reader will only accept a file that exists.
A typical use:
***************
*** 2618,2625 ****
(defun comint-word (word-chars)
"Return the word of WORD-CHARS at point, or nil if none is found.
Word constituents are considered to be those in WORD-CHARS, which is like the
! inside of a \"[...]\" (see `skip-chars-forward'),
! plus all non-ASCII characters."
(save-excursion
(let ((here (point))
giveup)
--- 2616,2622 ----
(defun comint-word (word-chars)
"Return the word of WORD-CHARS at point, or nil if none is found.
Word constituents are considered to be those in WORD-CHARS, which is like the
! inside of a \"[...]\" (see `skip-chars-forward'), plus all non-ASCII
characters."
(save-excursion
(let ((here (point))
giveup)