]> code.delx.au - gnu-emacs/blobdiff - lisp/eshell/esh-ext.el
Update copyright year to 2015
[gnu-emacs] / lisp / eshell / esh-ext.el
index 474e536de2eb07434b10ef5f02f0691c13155012..0b25b31eff9da863be324f9fd63deb1bc37207cf 100644 (file)
@@ -1,6 +1,6 @@
-;;; esh-ext.el --- commands external to Eshell
+;;; esh-ext.el --- commands external to Eshell  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1999-2013 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2015 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 
@@ -92,6 +92,10 @@ since nothing else but Eshell will be able to understand
        (setq list (cdr list)))
       file)))
 
+;; This file provides itself then eval-when-compile loads files that require it.
+;; This causes spurious "might not be defined at runtime" warnings.
+(declare-function eshell-search-path "esh-ext" (name))
+
 (defcustom eshell-windows-shell-file
   (if (eshell-under-windows-p)
       (if (string-match "\\(cmdproxy\\|sh\\)\\.\\(com\\|exe\\)"
@@ -292,6 +296,11 @@ line of the form #!<interp>."
       (let ((fullname (if (file-name-directory file) file
                        (eshell-search-path file)))
            (suffixes eshell-binary-suffixes))
+       (if (and fullname
+                (not (file-remote-p fullname))
+                (file-remote-p default-directory))
+           (setq fullname (expand-file-name
+                           (concat "./" fullname) default-directory)))
        (if (and fullname (not (or eshell-force-execution
                                   (file-executable-p fullname))))
            (while suffixes