| delorie.com/archives/browse.cgi | search |
| X-Recipient: | archive-cygwin AT delorie DOT com |
| DomainKey-Signature: | a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id |
| :list-unsubscribe:list-subscribe:list-archive:list-post | |
| :list-help:sender:subject:to:references:from:message-id:date | |
| :mime-version:in-reply-to:content-type | |
| :content-transfer-encoding; q=dns; s=default; b=CGMkewFbBvU4ji7G | |
| rfp4F80+mQkAr059srtfXQeJGoGer3RUUoyhEpZsE0cyiVD8kUFtYQLYP8XF1L8W | |
| MFg9bgw5cRKTz81iaV1mZRZQ9KzOoEno8MLeQeZmxtf5OO0DkSUOa74sLoq3o4JD | |
| /Ry/49n7n5dOmOzGCPqZwJ+PfWI= | |
| DKIM-Signature: | v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id |
| :list-unsubscribe:list-subscribe:list-archive:list-post | |
| :list-help:sender:subject:to:references:from:message-id:date | |
| :mime-version:in-reply-to:content-type | |
| :content-transfer-encoding; s=default; bh=F40qkEURPa9Q3SK/hEuskx | |
| 5IVeg=; b=A8/fQeu2VeTukLKS5GAvjQlmy3d3u1gVBn0JanF4DnFefXvO6phT4l | |
| 6lBULv8YUo4fpYeKzrgf2JjVIwzGoJkjNN0FJoTDdChgCx2zmi1kCAWB+8t+FO9k | |
| bseIFiVcX5KLshiBQSm3+H+R7QO0QGF8e92mNNkJb08522GfM277I= | |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Id: | <cygwin.cygwin.com> |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sourceware.org/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
| Authentication-Results: | sourceware.org; auth=none |
| X-Virus-Found: | No |
| X-Spam-SWARE-Status: | No, score=-1.9 required=5.0 tests=BAYES_00,KAM_INFOUSMEBIZ,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 |
| X-HELO: | homiemail-a43.g.dreamhost.com |
| Subject: | Re: Regtool can't set default value? |
| To: | cygwin AT cygwin DOT com |
| References: | <56096E62 DOT 2030606 AT dd-b DOT net> <loom DOT 20150928T193902-758 AT post DOT gmane DOT org> |
| From: | David Dyer-Bennet <dd-b AT dd-b DOT net> |
| Message-ID: | <560B5A58.4080906@dd-b.net> |
| Date: | Tue, 29 Sep 2015 22:43:20 -0500 |
| User-Agent: | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 |
| MIME-Version: | 1.0 |
| In-Reply-To: | <loom.20150928T193902-758@post.gmane.org> |
| X-IsSubscribed: | yes |
This does it:
regtool add '/root/SystemFileAssociations/text/shell/edit/command'
regtool set '/root/SystemFileAssociations/text/shell/edit/command/' -s
"$EDITWITHEMACS"
(If $EDITWITHEMACS is set to a suitable value)
On 9/28/2015 12:54, Brian Inglis wrote:
> David Dyer-Bennet <dd-b <at> dd-b.net> writes:
>
>>
>> I'm not sure I'm understanding this right. I'm trying to duplicate a
>> manual setup that works (for making text files in general have an edit
>> right-click option that invokes emacsclientw).
>>
>> In that manual setup, (sorry, using cygwin path notation while referring
>> to regedit, of course in regedit the path shows in Windows notation)
>> I've set up /root/txtfile/shell/edit/command with a value named
>> "(Default)" of type REG_EXPAND_SQ whose data is a (windows-style of
>> course) path to emacsclientw.exe (plus some switches plus "%1" for the
>> file name at the end). That works -- the right-click menu for a file
>> known to Windows as a txtfile (like foo.txt) has an "edit" entry, which
>> when clicked invokes emacsclientw.
>>
>> I'm trying to create this in a script using cygwin regtool. I can
>> create a key of /root/txtfile/shell/edit with a value of command having
>> the right data -- but that of course does not work. I can create a key
>> of /root/txtfile/shell/edit/command with *two* values named (Default),
>> the second of which is my value -- but that also does not work. (And I
>> can't delete the first value (Default) even in regedit.)
>>
>> I clearly don't understand something about the data that Regedit
>> displays under the name (Default), and how to create, delete, get, and
>> set value to it.
>>
>> How do I create this simple scenario using regtool? (It's not actually
>> emacs-specific, if you look at the default Windows registry for
>> /root/txtfile/shell/open/command you'll find a value named "(Default)"
>> of type REG_EXPAND_SZ giving a path to notepad.exe. If I wanted to
>> produce that using regtool, how would I do that?)
>>
>> (If there's no way to do it with regtool, that's weird, and in
>> particular a huge deficit in regtool since configuring preferred
>> handling of various file-types seems like one of the things you'd really
>> want to be able to do.
>>
>> (It *ought* to be possible for my script to write a .reg file that it
>> then feeds to regedit as an alternative way to do it, and if I can't
>> make regtool work I'll try that, but I don't need suggestions about
>> that, at least not yet -- I know how to do that, but am currently trying
>> to understand regtool, and will only give up if we determine fairly
>> authoritatively that regtool can't do what I need.)
>
> Use regedit export and import and Cygwin ls /proc/registry as well as
> regtool list on your entries to compare what works and what doesn't.
> You will probably find that in your script you need to quote quotes (") and
> backslashes (\), possibly multiple times, to get the path strings set
> properly - exported .reg files contain backslashed quotes, so getting that
> working in a script requires extra backslashes and/or quotes.
> Testing scripts by running via bash -vx script can show useful info like
> substitution results.
> Somewhere I can't find just now documents that some tool(s) use "@" to name
> (Default) - it is not actually named "(Default)".
>
>
>
> --
> Problem reports: http://cygwin.com/problems.html
> FAQ: http://cygwin.com/faq/
> Documentation: http://cygwin.com/docs.html
> Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
>
--
David Dyer-Bennet, dd-b AT dd-b DOT net; http://dd-b.net/
Snapshots: http://dd-b.net/dd-b/SnapshotAlbum/data/
Photos: http://dd-b.net/photography/gallery/
Dragaera: http://dragaera.info Nikon DSLR photo list:
http://d4scussion.com
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |