emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/comint.el


From: Luc Teirlinck
Subject: [Emacs-diffs] Changes to emacs/lisp/comint.el
Date: Tue, 26 Apr 2005 19:11:18 -0400

Index: emacs/lisp/comint.el
diff -c emacs/lisp/comint.el:1.316 emacs/lisp/comint.el:1.317
*** emacs/lisp/comint.el:1.316  Sun Apr 17 15:04:40 2005
--- emacs/lisp/comint.el        Tue Apr 26 23:11:17 2005
***************
*** 159,165 ****
  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.
  
  Good choices:
    Canonical Lisp: \"^[^> \\n]*>+:? *\" (Lucid, franz, kcl, T, cscheme, 
oaklisp)
--- 159,165 ----
  Defaults to \"^\", the null string at BOL.
  
  This variable is only used if the variable
! `comint-use-prompt-regexp' is non-nil.
  
  Good choices:
    Canonical Lisp: \"^[^> \\n]*>+:? *\" (Lucid, franz, kcl, T, cscheme, 
oaklisp)
***************
*** 353,359 ****
  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'.")
  
  (defvar comint-dynamic-complete-functions
    '(comint-replace-by-expanded-history comint-dynamic-complete-filename)
--- 353,359 ----
  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'.")
  
  (defvar comint-dynamic-complete-functions
    '(comint-replace-by-expanded-history comint-dynamic-complete-filename)
***************
*** 406,413 ****
  ;; 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.
  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
--- 406,413 ----
  ;; 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 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
***************
*** 415,420 ****
--- 415,427 ----
    :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."
***************
*** 1150,1156 ****
  Returns t if successful."
    (interactive)
    (if (and comint-input-autoexpand
!          (if comint-use-prompt-regexp-instead-of-fields
               ;; Use comint-prompt-regexp
               (save-excursion
                 (beginning-of-line)
--- 1157,1163 ----
  Returns t if successful."
    (interactive)
    (if (and comint-input-autoexpand
!          (if comint-use-prompt-regexp
               ;; Use comint-prompt-regexp
               (save-excursion
                 (beginning-of-line)
***************
*** 1419,1428 ****
  
  If the interpreter is the csh,
      `comint-get-old-input' is the default:
!       If `comint-use-prompt-regexp-instead-of-fields' 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 the current line with any initial string matching the
        regexp `comint-prompt-regexp' removed.
      `comint-input-filter-functions' monitors input for \"cd\", \"pushd\", and
--- 1426,1435 ----
  
  If the interpreter is the csh,
      `comint-get-old-input' is the default:
!       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' 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
***************
*** 1487,1500 ****
                 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
                ;; 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)
              ;; Cover the terminating newline
              (add-text-properties end (1+ end)
                                   '(rear-nonsticky t
--- 1494,1507 ----
                 font-lock-face comint-highlight-input
                 mouse-face highlight
                 help-echo "mouse-2: insert after prompt as new input"))
!             (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)
              ;; Cover the terminating newline
              (add-text-properties end (1+ end)
                                   '(rear-nonsticky t
***************
*** 1708,1714 ****
  
            (goto-char (process-mark process)) ; in case a filter moved it
  
!           (unless comint-use-prompt-regexp-instead-of-fields
                (let ((inhibit-read-only t)
                    (inhibit-modification-hooks t))
                  (add-text-properties comint-last-output-start (point)
--- 1715,1721 ----
  
            (goto-char (process-mark process)) ; in case a filter moved it
  
!           (unless comint-use-prompt-regexp
                (let ((inhibit-read-only t)
                    (inhibit-modification-hooks t))
                  (add-text-properties comint-last-output-start (point)
***************
*** 1844,1853 ****
  
  (defun comint-get-old-input-default ()
    "Default for `comint-get-old-input'.
! If `comint-use-prompt-regexp-instead-of-fields' 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
  the current line with any initial string matching the regexp
  `comint-prompt-regexp' removed."
    (let ((bof (field-beginning)))
--- 1851,1860 ----
  
  (defun comint-get-old-input-default ()
    "Default for `comint-get-old-input'.
! 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' is non-nil, then return
  the current line with any initial string matching the regexp
  `comint-prompt-regexp' removed."
    (let ((bof (field-beginning)))
***************
*** 1880,1889 ****
  
  (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
        ;; Use comint-prompt-regexp
        (save-excursion
        (beginning-of-line)
--- 1887,1896 ----
  
  (defun comint-line-beginning-position ()
    "Return the buffer position of the beginning of the line, after any prompt.
! 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)
***************
*** 1901,1909 ****
  (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."
    (interactive "P")
    (if arg
        ;; Unlike `beginning-of-line', forward-line ignores field boundaries
--- 1908,1916 ----
  (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' 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
***************
*** 2034,2040 ****
    (interactive)
    (push-mark)
    (let ((pos (or (marker-position comint-last-input-end) (point-max))))
!     (cond (comint-use-prompt-regexp-instead-of-fields
           (goto-char pos)
           (beginning-of-line 0)
           (set-window-start (selected-window) (point))
--- 2041,2047 ----
    (interactive)
    (push-mark)
    (let ((pos (or (marker-position comint-last-input-end) (point-max))))
!     (cond (comint-use-prompt-regexp
           (goto-char pos)
           (beginning-of-line 0)
           (set-window-start (selected-window) (point))
***************
*** 2127,2139 ****
  
  (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'.
  
  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
        ;; Use comint-prompt-regexp
        (let* ((re (concat comint-prompt-regexp ".*" regexp))
             (pos (save-excursion (end-of-line (if (> n 0) 0 1))
--- 2134,2146 ----
  
  (defun comint-backward-matching-input (regexp n)
    "Search backward 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'.
  
  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
        ;; Use comint-prompt-regexp
        (let* ((re (concat comint-prompt-regexp ".*" regexp))
             (pos (save-excursion (end-of-line (if (> n 0) 0 1))
***************
*** 2159,2166 ****
  
  (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'.
  
  With prefix argument N, search for Nth following match.
  If N is negative, find the previous or Nth previous match."
--- 2166,2173 ----
  
  (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'.
  
  With prefix argument N, search for Nth following match.
  If N is negative, find the previous or Nth previous match."
***************
*** 2170,2180 ****
  
  (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'."
    (interactive "p")
!   (if comint-use-prompt-regexp-instead-of-fields
        ;; Use comint-prompt-regexp
        (let ((paragraph-start comint-prompt-regexp))
        (end-of-line (if (> n 0) 1 0))
--- 2177,2187 ----
  
  (defun comint-next-prompt (n)
    "Move to end of Nth next prompt in the buffer.
! 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
        ;; Use comint-prompt-regexp
        (let ((paragraph-start comint-prompt-regexp))
        (end-of-line (if (> n 0) 1 0))
***************
*** 2207,2215 ****
  
  (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'."
    (interactive "p")
    (comint-next-prompt (- n)))
  
--- 2214,2222 ----
  
  (defun comint-previous-prompt (n)
    "Move to end of Nth previous prompt in the buffer.
! 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)))
  
***************
*** 3022,3028 ****
  ;; 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.
  
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;; Variables
--- 3029,3035 ----
  ;; appropriate magic default by examining what we think is the prompt)?
  ;;
  ;; Fixme: look for appropriate fields, rather than regexp, if
! ;; `comint-use-prompt-regexp' is true.
  
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;; Variables




reply via email to

[Prev in Thread] Current Thread [Next in Thread]