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: Richard M. Stallman
Subject: [Emacs-diffs] Changes to emacs/lisp/comint.el
Date: Sat, 12 Jan 2002 23:43:12 -0500

Index: emacs/lisp/comint.el
diff -c emacs/lisp/comint.el:1.257 emacs/lisp/comint.el:1.258
*** emacs/lisp/comint.el:1.257  Sat Jan 12 01:59:02 2002
--- emacs/lisp/comint.el        Sat Jan 12 23:43:12 2002
***************
*** 364,374 ****
--- 364,378 ----
  
  This variable is buffer-local.")
  
+ (defvar comint-input-sender-no-newline nil
+   "Non-nil directs the `comint-input-sender' function not to send a newline.")
+ 
  (defvar comint-input-sender (function comint-simple-send)
    "Function to actually send to PROCESS the STRING submitted by user.
  Usually this is just `comint-simple-send', but if your mode needs to
  massage the input string, put a different function here.
  `comint-simple-send' just sends the string plus a newline.
+ \(If `comint-input-sender-no-newline' is non-nil, it omits the newline.)
  This is called from the user command `comint-send-input'.")
  
  (defcustom comint-eol-on-send t
***************
*** 1365,1371 ****
                                  cmd))))
        (ring-insert comint-input-ring cmd)))
  
! (defun comint-send-input ()
    "Send input to process.
  After the process output mark, sends all text from the process mark to
  point as input to the process.  Before the process output mark, calls
--- 1369,1375 ----
                                  cmd))))
        (ring-insert comint-input-ring cmd)))
  
! (defun comint-send-input (&optional no-newline)
    "Send input to process.
  After the process output mark, sends all text from the process mark to
  point as input to the process.  Before the process output mark, calls
***************
*** 1440,1454 ****
                            (delete-region pmark start)
                            copy))))
  
!         (insert ?\n)
  
          (comint-add-to-input-history history)
  
          (run-hook-with-args 'comint-input-filter-functions
!                             (concat input "\n"))
  
          (let ((beg (marker-position pmark))
!               (end (1- (point))))
            (when (not (> beg end))     ; handle a special case
              ;; Make an overlay for the input field
              (let ((over (make-overlay beg end nil nil t)))
--- 1444,1460 ----
                            (delete-region pmark start)
                            copy))))
  
!         (unless no-newline
!           (insert ?\n))
  
          (comint-add-to-input-history history)
  
          (run-hook-with-args 'comint-input-filter-functions
!                             (if no-newline input
!                               (concat input "\n")))
  
          (let ((beg (marker-position pmark))
!               (end (if no-newline (point) (1- (point)))))
            (when (not (> beg end))     ; handle a special case
              ;; Make an overlay for the input field
              (let ((over (make-overlay beg end nil nil t)))
***************
*** 1484,1490 ****
          (set-marker (process-mark proc) (point))
          ;; clear the "accumulation" marker
          (set-marker comint-accum-marker nil)
!         (funcall comint-input-sender proc input)
  
          ;; Optionally delete echoed input (after checking it).
          (when comint-process-echoes
--- 1490,1497 ----
          (set-marker (process-mark proc) (point))
          ;; clear the "accumulation" marker
          (set-marker comint-accum-marker nil)
!         (let ((comint-input-sender-no-newline no-newline))
!           (funcall comint-input-sender proc input))
  
          ;; Optionally delete echoed input (after checking it).
          (when comint-process-echoes
***************
*** 1842,1848 ****
  This just sends STRING plus a newline. To override this,
  set the hook `comint-input-sender'."
    (comint-send-string proc string)
!   (comint-send-string proc "\n"))
  
  (defun comint-line-beginning-position ()
    "Returns the buffer position of the beginning of the line, after any prompt.
--- 1849,1858 ----
  This just sends STRING plus a newline. To override this,
  set the hook `comint-input-sender'."
    (comint-send-string proc string)
!   (if comint-input-sender-no-newline
!       (if (not (string-equal input ""))
!         (process-send-eof))
!     (comint-send-string proc "\n")))
  
  (defun comint-line-beginning-position ()
    "Returns the buffer position of the beginning of the line, after any prompt.
***************
*** 2125,2131 ****
  (defun comint-send-eof ()
    "Send an EOF to the current buffer's process."
    (interactive)
!   (comint-snapshot-last-prompt)
    (process-send-eof))
  
  
--- 2135,2141 ----
  (defun comint-send-eof ()
    "Send an EOF to the current buffer's process."
    (interactive)
!   (comint-send-input t)
    (process-send-eof))
  
  



reply via email to

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