-;;; esh-ext --- commands external to Eshell
+;;; esh-ext.el --- commands external to Eshell
;; Copyright (C) 1999, 2000 Free Software Foundation
(provide 'esh-ext)
(eval-when-compile (require 'esh-maint))
+(require 'esh-util)
(defgroup eshell-ext nil
"External commands are invoked when operating system executables are
:type 'hook
:group 'eshell-ext)
-(defcustom eshell-binary-suffixes
- (if (eshell-under-windows-p)
- '(".exe" ".com" ".bat" ".cmd" "")
- '(""))
+(defcustom eshell-binary-suffixes exec-suffixes
"*A list of suffixes used when searching for executable files."
:type '(repeat string)
:group 'eshell-ext)
:type 'integer
:group 'eshell-ext)
+(defcustom eshell-explicit-command-char ?*
+ "*If this char occurs before a command name, call it externally.
+That is, although vi may be an alias, *vi will always call the
+external version. UNIX users may prefer this variable to be \."
+ :type 'character
+ :group 'eshell-ext)
+
;;; Functions:
(defun eshell-ext-initialize ()
"Initialize the external command handling code."
- (make-local-hook 'eshell-named-command-hook)
(add-hook 'eshell-named-command-hook 'eshell-explicit-command nil t))
(defun eshell-explicit-command (command args)
"If a command name begins with `*', call it externally always.
This bypasses all Lisp functions and aliases."
(when (and (> (length command) 1)
- (eq (aref command 0) ?*))
+ (eq (aref command 0) eshell-explicit-command-char))
(let ((cmd (eshell-search-path (substring command 1))))
(if cmd
(or (eshell-external-command cmd args)
default-directory)))
(find-file-name-handler default-directory
'shell-command))))
- (if handler
+ (if (and handler
+ (not (and (eshell-under-xemacs-p)
+ (eq handler 'dired-handler-fn))))
(eshell-remote-command handler command args))
(let ((interp (eshell-find-interpreter command)))
(assert interp)
(file-regular-p file))
(with-temp-buffer
(insert-file-contents-literally file nil 0 maxlen)
- (if (looking-at "#!\\([^ \t\n]+\\)\\([ \t]+\\(.+\\)\\)?")
+ (if (looking-at "#![ \t]*\\([^ \r\t\n]+\\)\\([ \t]+\\(.+\\)\\)?")
(if (match-string 3)
(list (match-string 1)
(match-string 3)
;;; Code:
+;;; arch-tag: 178d4064-7e60-4745-b81f-bab5d8d7c40f
;;; esh-ext.el ends here