Commit 433d16a1 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

(comint-exec-1): Add the current-dir to the exec-path when

the command has a directory component (such as "./testml").
Also fix a typo in the comment.
parent 95cd4c40
...@@ -124,7 +124,6 @@ ...@@ -124,7 +124,6 @@
;; comint-save-input-ring-index number ... ;; comint-save-input-ring-index number ...
;; comint-input-autoexpand symbol ... ;; comint-input-autoexpand symbol ...
;; comint-input-ignoredups boolean ... ;; comint-input-ignoredups boolean ...
;; comint-last-input-match string ...
;; comint-dynamic-complete-functions hook For the completion mechanism ;; comint-dynamic-complete-functions hook For the completion mechanism
;; comint-completion-fignore list ... ;; comint-completion-fignore list ...
;; comint-file-name-chars string ... ;; comint-file-name-chars string ...
...@@ -692,12 +691,16 @@ buffer. The hook `comint-exec-hook' is run after each exec." ...@@ -692,12 +691,16 @@ buffer. The hook `comint-exec-hook' is run after each exec."
default-directory default-directory
(char-to-string directory-sep-char))) (char-to-string directory-sep-char)))
proc decoding encoding changed) 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))) (let ((coding-systems (process-coding-system proc)))
(setq decoding (car coding-systems) (setq decoding (car coding-systems)
encoding (cdr coding-systems))) encoding (cdr coding-systems)))
;; If start-process decided to use some coding system for decoding ;; 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. ;; specify EOL conversion, we had better convert CRLF to LF.
(if (vectorp (coding-system-eol-type decoding)) (if (vectorp (coding-system-eol-type decoding))
(setq decoding (coding-system-change-eol-conversion decoding 'dos) (setq decoding (coding-system-change-eol-conversion decoding 'dos)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment