]> code.delx.au - gnu-emacs/blobdiff - lisp/comint.el
(menu-bar-help-menu): Add menu item for non-English
[gnu-emacs] / lisp / comint.el
index c48182b0988896fb5dbfeb8ccf3563c26aba0964..eac6095bdb3d675037d0db1bb9172db2a633f4eb 100644 (file)
 ;;  comint-save-input-ring-index       number  ...
 ;;  comint-input-autoexpand            symbol  ...
 ;;  comint-input-ignoredups            boolean ...
-;;  comint-last-input-match            string  ...
 ;;  comint-dynamic-complete-functions  hook   For the completion mechanism
 ;;  comint-completion-fignore          list    ...
 ;;  comint-file-name-chars             string  ...
@@ -692,12 +691,16 @@ buffer.  The hook `comint-exec-hook' is run after each exec."
              default-directory
            (char-to-string directory-sep-char)))
        proc decoding encoding changed)
-    (setq proc (apply 'start-process name buffer command switches))
+    (let ((exec-path (if (file-name-directory command)
+                        ;; If the command has slashes, make sure we
+                        ;; first look relative to the current directory.
+                        (cons default-directory exec-path) exec-path)))
+      (setq proc (apply 'start-process name buffer command switches)))
     (let ((coding-systems (process-coding-system proc)))
       (setq decoding (car coding-systems)
            encoding (cdr coding-systems)))
     ;; If start-process decided to use some coding system for decoding
-    ;; data sent form the process and the coding system doesn't
+    ;; data sent from the process and the coding system doesn't
     ;; specify EOL conversion, we had better convert CRLF to LF.
     (if (vectorp (coding-system-eol-type decoding))
        (setq decoding (coding-system-change-eol-conversion decoding 'dos)
@@ -759,10 +762,11 @@ See also `comint-input-ignoredups' and `comint-write-input-ring'."
             (message "Cannot read history file %s"
                      comint-input-ring-file-name)))
        (t
-        (let ((history-buf (get-buffer-create " *temp*"))
-              (file comint-input-ring-file-name)
-              (count 0)
-              (ring (make-ring comint-input-ring-size)))
+        (let* ((history-buf (get-buffer-create " *temp*"))
+               (file comint-input-ring-file-name)
+               (count 0)
+               (size comint-input-ring-size)
+               (ring (make-ring size)))
           (unwind-protect
               (save-excursion
                 (set-buffer history-buf)
@@ -772,7 +776,7 @@ See also `comint-input-ignoredups' and `comint-write-input-ring'."
                 ;; Save restriction in case file is already visited...
                 ;; Watch for those date stamps in history files!
                 (goto-char (point-max))
-                (while (and (< count comint-input-ring-size)
+                (while (and (< count size)
                             (re-search-backward "^[ \t]*\\([^#\n].*\\)[ \t]*$"
                                                 nil t))
               (let (start end history)
@@ -1339,11 +1343,18 @@ Similarly for Soar, Scheme, etc."
          (run-hook-with-args 'comint-output-filter-functions "")))))
 
 (defvar comint-preoutput-filter-functions nil 
-  "Functions to call before output is inserted into the buffer.
-These functions get one argument, a string containing the text to be
-inserted.  They return the string as it should be inserted.
+  "List of functions to call before inserting Comint output into the buffer.
+Each function gets one argument, a string containing the text received
+from the subprocess.  It should return the string to insert, perhaps
+the same string that was received, or perhaps a modified or transformed
+string.
 
-This variable is buffer-local.")
+The functions on the list are called sequentially, and each one is
+given the string returned by the previous one.  The string returned by
+the last function is the text that is actually inserted in the
+redirection buffer.
+
+This variable is permanent-local.")
 
 ;; The purpose of using this filter for comint processes
 ;; is to keep comint-last-input-end from moving forward
@@ -2681,7 +2692,6 @@ If NO-DISPLAY is non-nil, do not show the output buffer."
   "Send COMMAND to current process. 
 Return a list of expressions in the output which match REGEXP.
 REGEXP-GROUP is the regular expression group in REGEXP to use."
-  (interactive)
   (comint-redirect-results-list-from-process 
    (get-buffer-process (current-buffer))
    command regexp regexp-group))
@@ -2691,7 +2701,6 @@ REGEXP-GROUP is the regular expression group in REGEXP to use."
   "Send COMMAND to PROCESS. 
 Return a list of expressions in the output which match REGEXP.
 REGEXP-GROUP is the regular expression group in REGEXP to use."
-  (interactive)
   (let ((output-buffer " *Comint Redirect Work Buffer*")
        results)
     (save-excursion
@@ -2717,6 +2726,13 @@ REGEXP-GROUP is the regular expression group in REGEXP to use."
                    results)))
       results)))
 
+(mapc (lambda (x)
+       (add-to-list 'debug-ignored-errors x))
+      '("^Not at command line$"
+       "^Empty input ring$"
+       "^No history$"
+       "^Not found$"                   ; Too common?
+       "^Current buffer has no process$"))
 \f
 ;; Converting process modes to use comint mode
 ;; ===========================================================================