all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ken Brown <kbrown@cornell.edu>
To: herring@lanl.gov
Cc: Eli Zaretskii <eliz@gnu.org>, cyd@stupidchicken.com, emacs-devel@gnu.org
Subject: Re: Cygwin patches
Date: Sun, 22 Nov 2009 07:59:56 -0500	[thread overview]
Message-ID: <4B0935CC.5010704@cornell.edu> (raw)
In-Reply-To: <39880.128.165.0.81.1258867518.squirrel@webmail.lanl.gov>

[-- Attachment #1: Type: text/plain, Size: 729 bytes --]

On 11/22/2009 12:25 AM, Davis Herring wrote:
>> +  (if (eq system-type 'cygwin)
>> +      (let ((winfile (shell-command-to-string (concat
>> +			  "cygpath -m " (shell-quote-argument file)))))
>> +	(setq file (concat "file://" (substring winfile 0 -1)))))
> 
> I would instead bind winfile to
> 
> (with-output-to-string
>   (call-process "cygpath" nil standard-output nil "-m" file))
> 
> (using, like `shell-command-to-string' does, the undocumented feature that
> `with-output-to-string' causes `standard-output' to be a temporary
> buffer).  Then you don't have to worry with `shell-quote-argument'.

Thanks for the suggestion.  My revised patch is attached.  If it looks 
OK, could someone please check it in?

Thanks.

Ken

[-- Attachment #2: browse-url.el.patch --]
[-- Type: text/plain, Size: 638 bytes --]

--- browse-url.el.orig	2009-11-21 12:33:40.000000000 -0500
+++ browse-url.el	2009-11-22 07:38:25.890761600 -0500
@@ -699,6 +699,10 @@
 (defun browse-url-file-url (file)
   "Return the URL corresponding to FILE.
 Use variable `browse-url-filename-alist' to map filenames to URLs."
+  (if (eq system-type 'cygwin)
+      (let ((winfile (with-output-to-string
+              (call-process "cygpath" nil standard-output nil "-m" file))))
+	(setq file (concat "file://" (substring winfile 0 -1)))))
   (let ((coding (and (default-value 'enable-multibyte-characters)
 		     (or file-name-coding-system
 			 default-file-name-coding-system))))

  reply	other threads:[~2009-11-22 12:59 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-20 20:00 Cygwin patches Ken Brown
2009-11-20 21:50 ` Chong Yidong
2009-11-20 21:59   ` Lennart Borgman
2009-11-20 22:26   ` Ken Brown
2009-11-20 23:54     ` Lennart Borgman
2009-11-21  8:12     ` Eli Zaretskii
2009-11-21 12:12       ` Ken Brown
2009-11-21 12:16         ` Lennart Borgman
2009-11-21 12:42         ` Eli Zaretskii
2009-11-21 21:21           ` Ken Brown
2009-11-21 21:48             ` Eli Zaretskii
2009-11-22  5:25             ` Davis Herring
2009-11-22 12:59               ` Ken Brown [this message]
2009-11-22 23:03                 ` Chong Yidong
2009-11-22 23:23                   ` Ken Brown
2009-11-22 23:30                     ` Lennart Borgman
2009-11-23  1:37                       ` Ken Brown
2009-11-23  1:42                         ` Lennart Borgman
2009-11-23  1:50                         ` Chong Yidong
2009-11-23  2:09                           ` Ken Brown
2009-11-23 19:50                             ` Ken Brown
2009-11-23 20:59                               ` Chong Yidong
  -- strict thread matches above, loose matches on Subject: below --
2009-11-20 23:40 Angelo Graziosi
2009-11-21  4:50 ` Chong Yidong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B0935CC.5010704@cornell.edu \
    --to=kbrown@cornell.edu \
    --cc=cyd@stupidchicken.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=herring@lanl.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.