VM

Feature request: Add suffix option to vm-locate-executable-file

Asked by blueman on 2014-01-17

When using vm/emacs under Windows, I find that a lot of binary executables do not get automagically set since the executable files end in ".exe" -- Note I don't use cygwin Emacs but rather ntEmacs.
Specifically, vm-locate-executable-file doesn't handle the possibility that the executable ends in a suffix.

Note that locate-file (which is called by vm-locate-executable-file) does have the ability to search for the file +/- a list of potential suffixes.

Currently, mv vm startup code tests if I am on a Windows machine and if so then manually sets the binary location for a whole slew of executables referenced by VM (e.g., base64-decode, base64-encode, qp-decode, qp-encode, iconvert, etc.)

It would be nice to add to vm-locate executables-file the ability to also search an (optional) list of suffixes.

Specifically, one could
1. Add an optional argument 'suffixes' to vm-locate-executable-file to allow for suffixes (similar to 'locate-file')

2. Create a variable vm-executable-file-suffixes which is either nil or a list of default suffixes to append to file name when searching.

The logic for vm-locate-executable-file would be as follows:
  a] If SUFFIXES is nil and vm-executable-file-suffixes is nil, then behavior is as before
 b] If SUFFIXES is nil, but vm-executable-file-suffixes is non-nil than pass vm-executable-file-suffixes to 'locate-file'
 c] Iff SUFFIXES is non-nil, then pass SUFFIXES to vm-executable-file-suffixes

Any interest in adding such functionality to the code?

Thanks

Question information

Language:
English Edit question
Status:
Answered
For:
VM Edit question
Assignee:
No assignee Edit question
Last query:
2014-02-02
Last reply:
2014-02-03
blueman (blueman3) said : #1

Note if there is interest, I would be happy to help with the coding...

blueman (blueman3) said : #2

Note: looking at the code for vm-locate-executable-file, it's not clear to me why one tests whether locate-file is bound. It seems to be a standard elisp function. Or did it not exist in earlier versions, so alternative code is needed for earlier versions.

The reason I ask is that the modifications I suggested are nearly trivial to implement if one can assume locate-file exists since locate-file already allows for a SUFFIXES. Otherwise, in the case locate-file doesn't exist, one would need to add an additional loop to the manual elisp code to loop over the list of suffixes.

Launchpad Janitor (janitor) said : #3

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

blueman (blueman3) said : #4

I still would appreciate an answer (is anyone following these questions anymore?)

Uday Reddy (reddyuday) said : #5

Once again, it looks like you need to file a bug report if this isn't working for you. I don't see why it shouldn't be.

Can you help with this problem?

Provide an answer of your own, or ask blueman for more information if necessary.

To post a message you must log in.