X-Spam-Check-By: sourceware.org
Message-ID: <956f9b610608121827n46e1c555j8b35dfb8239ba0c8@mail.gmail.com>
Date: Sun, 13 Aug 2006 03:27:51 +0200
From: "Joe Tree" <tree.joe@gmail.com>
To: cygwin@cygwin.com
Subject: Re: cygpath as a key binding
In-Reply-To: <44DE8373.3030909@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <44DE8373.3030909@gmail.com>
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On 8/13/06, Jochen Wiedmann <jochen.wiedmann@gmail.com> wrote:
> Hi,
> is it possible to invoke cygpath as a key binding? For example, if my
> current command line is
>     tar c:\temp
> and my cursor is on c:\temp, then it would be nice to convert c:\temp
> into a Windows path by pressing a certain key.

sadly it would seem that the answer is "no, except with a lot of
hacking bash (or rather, readline)"

relevant documentation would be the "Readline" section of man bash
(readline is the library bash uses to read user input)
readline DOES allow for some configuration, but it does not seem to
have any option to run external commands to manipulate input, only
rather primitive editing, which consists mostly of predefined key
actions.

a rather silly option (not very useful for you, because it only works
for specific commands, and removes normal tab completion) is to set up
a programmable completion (a bash feature, see man bash, builtins,
complete) that calls cygpath:

user@cygwin$ complete -C "sh -c 'cygpath --dos \$2' --" justatest
user@cygwin$ justatest /etc/<tab>
user@cygwin$ justatest F:\cygwin\etc\

(one could try to make it act like normal completion, except when it
seems a path it can convert or thelike, but it doesn't seem very
workable)

- Joe

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

