Comment 13 for bug 961468

Revision history for this message
Andreas Roehler (a-roehler) wrote : Re: [Bug 961468] Re: Bug in function py-separator-char

Am 22.03.2012 18:01, schrieb Richard Stanton:
> The "EPD hack" works under OS X, but not under Windows because there EPD
> is installed under directory c:\python27 - not easy to tell from the
> directory name...
>
> This seems to be getting compIicated! I have two suggestions here:
>
> 1) Insist on using python for this function, even if ipython is
> specified as the default python shell, since when I run the same
> commands using "python -c..." instead of "ipython -c.." at the command
> line, I get the output you were looking for.
>
> 2) Maybe it would be easier to do this a different way: Have py-
> separator-char set as a customizable variable, where the default value
> is set based on the OS Emacs is running under. For example, in my
> init.el I have the following:
>
>
> (defun system-type-is-windows ()
> (interactive)
> "Return true if system is Windows-based"
> (string-equal system-type "windows-nt"))
>
> (defun system-type-is-darwin ()
> (interactive)
> "Return true if system is darwin-based (Mac OS X)"
> (string-equal system-type "darwin"))
>
> Now I can selectively take actions if I'm running under Windows, for
> example, as follows:
>
> (when (system-type-is-windows)
> (setq py-separator-char "\\")
> )
>
> This just seems easier than trying to deal with parsing the output from
> every possible configuration of python...
>

OTOH if such a thing fails like returning a file-separator, how reliable might be the rest?
Rather inclined to make Python work in the circumstances given.