unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* eshell - win32 - executable files
@ 2003-01-18 22:01 matt
  2003-01-19  6:02 ` John Wiegley
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: matt @ 2003-01-18 22:01 UTC (permalink / raw)


This may be something that I need to do in the Windows registry, but...

How can I specify which files are executable. On a windows system there 
are the normal ones like .exe, .bat, .com, etc. What I want to do is to 
tell emacs that another type of file is executable, so that I can just 
type the filename and have it execute like any other command. 
Specifically, a perl script. I want to be able to execute say 
"myscript.pl" without having to type: perl path_to_script/myscript.pl. I 
have the file association set in explorer, and the path to the script is 
in my path. I can execute it in cmd.exe by typing myscript.pl, but not 
in eshell.

Any ideas?

TIA -- Matt
-- 
Remove the X's to reply directly.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: eshell - win32 - executable files
  2003-01-18 22:01 eshell - win32 - executable files matt
@ 2003-01-19  6:02 ` John Wiegley
  2003-01-19  7:04   ` matt
  2003-01-20 11:59 ` Ehud Karni
       [not found] ` <mailman.581.1043065581.21513.help-gnu-emacs@gnu.org>
  2 siblings, 1 reply; 12+ messages in thread
From: John Wiegley @ 2003-01-19  6:02 UTC (permalink / raw)


>>>>> On Sat Jan 18, matt writes:

> This may be something that I need to do in the Windows registry,
> but...  How can I specify which files are executable. On a windows
> system there are the normal ones like .exe, .bat, .com, etc. What I
> want to do is to tell emacs that another type of file is
> executable, so that I can just type the filename and have it
> execute like any other command. Specifically, a perl script. I want
> to be able to execute say "myscript.pl" without having to type:
> perl path_to_script/myscript.pl. I have the file association set in
> explorer, and the path to the script is in my path. I can execute
> it in cmd.exe by typing myscript.pl, but not in eshell.

> Any ideas?

Configure the variable `eshell-binary-suffixes'.

John

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: eshell - win32 - executable files
  2003-01-19  6:02 ` John Wiegley
@ 2003-01-19  7:04   ` matt
  2003-01-19  7:12     ` John Wiegley
  2003-01-19  9:14     ` Sören Vogel
  0 siblings, 2 replies; 12+ messages in thread
From: matt @ 2003-01-19  7:04 UTC (permalink / raw)


John Wiegley wrote:
>>>>>>On Sat Jan 18, matt writes:
>>>>>
> 
>>This may be something that I need to do in the Windows registry,
>>but...  How can I specify which files are executable. On a windows
>>system there are the normal ones like .exe, .bat, .com, etc. What I
>>want to do is to tell emacs that another type of file is
>>executable, so that I can just type the filename and have it
>>execute like any other command. Specifically, a perl script. I want
>>to be able to execute say "myscript.pl" without having to type:
>>perl path_to_script/myscript.pl. I have the file association set in
>>explorer, and the path to the script is in my path. I can execute
>>it in cmd.exe by typing myscript.pl, but not in eshell.
> 
> 
>>Any ideas?
> 
> 
> Configure the variable `eshell-binary-suffixes'.
> 
> John

Thanks John. How do I do that? What I've done is not working. I found 
'eshell-binary-suffixes' in esh-ext.el, looks like this:

	(defcustom eshell-binary-suffixes
   	  (if (eshell-under-windows-p)
       	      '(".exe" ".com" ".bat" ".cmd" "")
            '(""))
         "*A list of suffixes used when searching for executable files."

I added ".pl" to the list. I tried load-file, load-library, and 
emacs-lisp-byte-compile-and-load. No luck. Is there somewhere else I 
should be setting this?

Thanks -- Matt

-- 
Remove the X's to reply directly.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: eshell - win32 - executable files
  2003-01-19  7:04   ` matt
@ 2003-01-19  7:12     ` John Wiegley
  2003-01-19  7:30       ` matt
  2003-01-19  9:14     ` Sören Vogel
  1 sibling, 1 reply; 12+ messages in thread
From: John Wiegley @ 2003-01-19  7:12 UTC (permalink / raw)


>>>>> On Sun Jan 19, matt writes:

> 	(defcustom eshell-binary-suffixes (if
> (eshell-under-windows-p) '(".exe" ".com" ".bat" ".cmd" "") '(""))
> "*A list of suffixes used when searching for executable files."

> I added ".pl" to the list. I tried load-file, load-library, and
> emacs-lisp-byte-compile-and-load. No luck. Is there somewhere else
> I should be setting this?

Try this, in your .emacs:

(eval-after-load "esh-ext"
  '(progn (add-to-list 'eshell-binary-suffixes ".pl")))

John

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: eshell - win32 - executable files
  2003-01-19  7:12     ` John Wiegley
@ 2003-01-19  7:30       ` matt
  2003-01-20 20:17         ` John Wiegley
  0 siblings, 1 reply; 12+ messages in thread
From: matt @ 2003-01-19  7:30 UTC (permalink / raw)


John Wiegley wrote:
>>>>>>On Sun Jan 19, matt writes:
>>>>>
> 
>>	(defcustom eshell-binary-suffixes (if
>>(eshell-under-windows-p) '(".exe" ".com" ".bat" ".cmd" "") '(""))
>>"*A list of suffixes used when searching for executable files."
> 
> 
>>I added ".pl" to the list. I tried load-file, load-library, and
>>emacs-lisp-byte-compile-and-load. No luck. Is there somewhere else
>>I should be setting this?
> 
> 
> Try this, in your .emacs:
> 
> (eval-after-load "esh-ext"
>   '(progn (add-to-list 'eshell-binary-suffixes ".pl")))
> 
> John

Still no luck. Does this work for you?

-- Matt

-- 
Remove the X's to reply directly.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: eshell - win32 - executable files
  2003-01-19  7:04   ` matt
  2003-01-19  7:12     ` John Wiegley
@ 2003-01-19  9:14     ` Sören Vogel
  2003-01-19  9:23       ` matt
  1 sibling, 1 reply; 12+ messages in thread
From: Sören Vogel @ 2003-01-19  9:14 UTC (permalink / raw)


Hi Matt,

might be done outside emacs, too:

my computer -- advanced -- environment variables -- PATHEXT

Sören.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: eshell - win32 - executable files
  2003-01-19  9:14     ` Sören Vogel
@ 2003-01-19  9:23       ` matt
  2003-01-19 10:12         ` Sören Vogel
  0 siblings, 1 reply; 12+ messages in thread
From: matt @ 2003-01-19  9:23 UTC (permalink / raw)


Sören Vogel wrote:
> Hi Matt,
> 
> might be done outside emacs, too:
> 
> my computer -- advanced -- environment variables -- PATHEXT
> 
> Sören.

As I mentioned in the original post, the file *is* in my path. I just 
need to let eshell know that .pl files are executable.

-- Matt
-- 
Remove the X's to reply directly.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: eshell - win32 - executable files
  2003-01-19  9:23       ` matt
@ 2003-01-19 10:12         ` Sören Vogel
  2003-01-19 10:34           ` matt
  0 siblings, 1 reply; 12+ messages in thread
From: Sören Vogel @ 2003-01-19 10:12 UTC (permalink / raw)


> > my computer -- advanced -- environment variables -- PATHEXT

PATHEXT does not mean PATH but what extensions executable files
might have to be recognized by the shell. If eshell refers to
environmental variables, too, it might work.

Sören.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: eshell - win32 - executable files
  2003-01-19 10:12         ` Sören Vogel
@ 2003-01-19 10:34           ` matt
  0 siblings, 0 replies; 12+ messages in thread
From: matt @ 2003-01-19 10:34 UTC (permalink / raw)


Sören Vogel wrote:
>>>my computer -- advanced -- environment variables -- PATHEXT
>>
> 
> PATHEXT does not mean PATH but what extensions executable files
> might have to be recognized by the shell. If eshell refers to
> environmental variables, too, it might work.
> 
> Sören.

You're right. Sorry, I didn't read your post close enough. 
Unfortunately, eshell doesn't seem to use that variable.

-- Matt

-- 
Remove the X's to reply directly.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: eshell - win32 - executable files
  2003-01-18 22:01 eshell - win32 - executable files matt
  2003-01-19  6:02 ` John Wiegley
@ 2003-01-20 11:59 ` Ehud Karni
       [not found] ` <mailman.581.1043065581.21513.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 12+ messages in thread
From: Ehud Karni @ 2003-01-20 11:59 UTC (permalink / raw)
  Cc: help-gnu-emacs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sat, 18 Jan 2003 22:01:50 GMT, matt <nwzmattXX@XXnetscape.net> wrote:
> 
> This may be something that I need to do in the Windows registry, but...
> 
> How can I specify which files are executable. On a windows system there 
> are the normal ones like .exe, .bat, .com, etc. What I want to do is to 
> tell emacs that another type of file is executable, so that I can just 
> type the filename and have it execute like any other command. 

I've seen this thread, and I think it went in the wrong direction.

Try to modify the 'executable-binary-suffixes' list like this:
    (add-to-list 'executable-binary-suffixes ".new-ext")
does it help ?

Ehud.


- -- 
 Ehud Karni           Tel: +972-3-7966-561  /"\
 Mivtach - Simon      Fax: +972-3-7966-667  \ /  ASCII Ribbon Campaign
 Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
 http://www.mvs.co.il  FAX:  1-815-5509341  / \
 mailto:ehud@unix.mvs.co.il                  Better  Safe  Than  Sorry
-----BEGIN PGP SIGNATURE-----
Comment: use http://www.keyserver.net/ to get my key (and others)

iD8DBQE+K+S3LFvTvpjqOY0RAhsIAJ9w0Xr30tdTBFOrWoSOYrIKm1NnlgCggFUU
YRx4D9aoSQnnlI3akQwxFPg=
=oT6s
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: eshell - win32 - executable files
  2003-01-19  7:30       ` matt
@ 2003-01-20 20:17         ` John Wiegley
  0 siblings, 0 replies; 12+ messages in thread
From: John Wiegley @ 2003-01-20 20:17 UTC (permalink / raw)


>>>>> On Sun Jan 19, matt writes:

> Still no luck. Does this work for you?

Hmm, once, when I used to use Windows machines, I was doing something
close to exactly this.  You definitely want to configure
`eshell-binary-suffixes'.  You can test it by using the "which"
command, followed by the name of your script.

Oh, wait, you must ALSO set `eshell-force-execution' to t.  :)

John

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: eshell - win32 - executable files
       [not found] ` <mailman.581.1043065581.21513.help-gnu-emacs@gnu.org>
@ 2003-01-20 20:23   ` Matt
  0 siblings, 0 replies; 12+ messages in thread
From: Matt @ 2003-01-20 20:23 UTC (permalink / raw)




Ehud Karni wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On Sat, 18 Jan 2003 22:01:50 GMT, matt <nwzmattXX@XXnetscape.net> wrote:
> 
>>This may be something that I need to do in the Windows registry, but...
>>
>>How can I specify which files are executable. On a windows system there 
>>are the normal ones like .exe, .bat, .com, etc. What I want to do is to 
>>tell emacs that another type of file is executable, so that I can just 
>>type the filename and have it execute like any other command. 
> 
> 
> I've seen this thread, and I think it went in the wrong direction.
> 
> Try to modify the 'executable-binary-suffixes' list like this:
>     (add-to-list 'executable-binary-suffixes ".new-ext")
> does it help ?
> 

I think you mean eshell-binary-suffixes. If I add that to my .emacs I 
get an error on startup:

Symbol's value as variable is void: eshell-binary-suffixes

but evaluating it after eshell is loaded works. Unfortunately, that does 
not fix the problem. At least not by itsself. After looking over 
esh-ext.el again, I found another variable - eshell-force-execution - 
which needs to be not-nil. Changing the value to t works. Here's what it 
says in the file:

(defcustom eshell-force-execution nil
   "*If non-nil, try to execute binary files regardless of permissions.
This can be useful on systems like Windows, where the operating system
doesn't happen to honor the permission bits in certain cases; or in
cases where you want to associate an interpreter with a particular
kind of script file, but the language won't let you but a '#!'
interpreter line in the file, and you don't want to make it executable
since nothing else but Eshell will be able to understand
`eshell-interpreter-alist'."
   :type 'boolean
   :group 'eshell-ext)

I made all of the changes directly to esh-ext.el, byte-compiled, and 
restarted emacs. After that, I had to make sure that there was the 
"shabang" line in the .pl file(#!c:/perl/bin/perl.exe -w). I usually 
don't add this in windows, because explorer takes care of the file 
association, and it's not needed. Also, the -w is there(apart from being 
good perl programming practice) because of the DOS carriage return 
character. eshell - like a unix shell - will complain that it cannot 
find perl.exe^M . The alternative is to run dos2unix on the file.

Thank for all the help.

-- Matt

-- 
Remove the X's to reply directly.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2003-01-20 20:23 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-18 22:01 eshell - win32 - executable files matt
2003-01-19  6:02 ` John Wiegley
2003-01-19  7:04   ` matt
2003-01-19  7:12     ` John Wiegley
2003-01-19  7:30       ` matt
2003-01-20 20:17         ` John Wiegley
2003-01-19  9:14     ` Sören Vogel
2003-01-19  9:23       ` matt
2003-01-19 10:12         ` Sören Vogel
2003-01-19 10:34           ` matt
2003-01-20 11:59 ` Ehud Karni
     [not found] ` <mailman.581.1043065581.21513.help-gnu-emacs@gnu.org>
2003-01-20 20:23   ` Matt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).