Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#975 closed feature request (fixed)

Allow quoting of the file path in :load command

Reported by: cubranic@… Owned by:
Priority: normal Milestone:
Component: GHCi Version: 6.4.2
Keywords: Cc:
Operating System: Windows Architecture: x86
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

haskell-mode (version v2_1 distributed with XEmacs 21.4.13 on Windows) puts quotes around the full path of the file given as the argument to GHCi's ":load" command, which doesn't work. It seems like it would be a useful feature to be able to handle such paths, especially if the path contains spaces.

Change History (3)

comment:1 Changed 7 years ago by guest

I just upgraded to 6.6 and it's not a problem, except for the fact that XEmacs is passing backslashes in the path, which GHCi is interpreting as string escapes. Should :load be changed to use a platform's "native" path separator?

comment:2 Changed 7 years ago by igloo

  • Resolution set to fixed
  • Status changed from new to closed

I think the current GHCi behaviour makes sense, and allows any filename to be given.
It sounds like haskell-mode should be changed to escape backslashes, though.

Thanks
Ian

comment:3 Changed 7 years ago by guest

It sounds like haskell-mode should be changed to escape backslashes, though.

That's exactly what I ended up doing in my local haskell-ghci.el:

--- haskell-ghci.el.orig        2006-10-19 14:09:24.012317100 -0700
+++ haskell-ghci.el     2006-10-30 18:01:59.322452600 -0800
@@ -227,7 +227,7 @@
   (hack-local-variables)               ; in case they've changed
   (save-buffer)
   (let ((file (if (string-equal load-command ":load ")
-                 (concat "\"" buffer-file-name "\"")
+                 (replace-in-string (concat "\"" buffer-file-name "\"") "[\\\\]" "/")
                ""))
        (dir (expand-file-name default-directory))
        (cmd (and (boundp 'haskell-ghci-command)
Note: See TracTickets for help on using tickets.