Ticket #5265 (closed feature request: fixed)

Opened 2 years ago

Last modified 13 months ago

Support for additional .ghci files in GHCi.

Reported by: SamAnklesaria Owned by: pcapriotti
Priority: high Milestone: 7.6.1
Component: Compiler Version: 7.0.3
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Currently, GHCi only loads a single .ghci file. As a result, all user customizations and macros must be centralized to one location. Additionally, this leaves limited potential for tools using GHCi (cabal-install, for example) to customize the interpretation environment. I propose adding a -ghci-script flag for each additional .ghci file to be loaded in the order specified on the command line after the usual .ghci file in the current or user directory.

Attachments

5265.patch Download (3.7 KB) - added by SamAnklesaria 2 years ago.
5265-fix.patch Download (3.8 KB) - added by SamAnklesaria 23 months ago.
fixed mistake in previous patch
5265-fix.2.patch Download (3.8 KB) - added by SamAnklesaria 23 months ago.
uses dynamic flags instead. requires old patch to be reverted.
dyn5265..patch Download (4.5 KB) - added by SamAnklesaria 22 months ago.
dyn5265.patch Download (4.6 KB) - added by SamAnklesaria 21 months ago.
uses dynamic flags. requires old patch to be reverted

Change History

Changed 2 years ago by duncan

Note that we think we need this for the cabal repl feature that Sam is implementing for his GSoC project.  http://lambdasandwich.blogspot.com/2011/06/reloading-ghci.html

Our plan is for cabal to generate a ghci script that rebinds the :reload command so that it calls back out to cabal to re-run pre-processors (hsc2hs etc). Then cabal repl will invoke ghci -ghci-script dist/ghci or something like that.

Sam will be preparing a patch. I'll do the first review. If possible we're aiming for inclusion in the 7.2 release.

Changed 2 years ago by SamAnklesaria

  • owner changed from SamAnklesaria to duncan

Changed 2 years ago by SamAnklesaria

Changed 2 years ago by duncan

  • status changed from new to patch

Code looks good to me.

Changed 23 months ago by igloo

  • owner changed from duncan to igloo

Changed 23 months ago by igloo

  • status changed from patch to closed
  • resolution set to fixed

Applied, thanks

Changed 23 months ago by SamAnklesaria

  • owner igloo deleted
  • status changed from closed to new
  • resolution fixed deleted

Changed 23 months ago by SamAnklesaria

fixed mistake in previous patch

Changed 23 months ago by SamAnklesaria

  • owner set to duncan

Changed 23 months ago by SamAnklesaria

uses dynamic flags instead. requires old patch to be reverted.

Changed 23 months ago by SamAnklesaria

I did not intend to attach 5265-fix.2.patch. Ignore it please. dyn5265.patch is the real dynamic version.

Changed 22 months ago by igloo

  • milestone set to 7.4.1

Changed 22 months ago by SamAnklesaria

Changed 21 months ago by SamAnklesaria

uses dynamic flags. requires old patch to be reverted

Changed 15 months ago by igloo

  • priority changed from normal to low
  • milestone changed from 7.4.1 to 7.6.1

Changed 14 months ago by duncan

  • status changed from new to patch

Hmm, seems to be confusion about this. The current user guide claims (here and here) that the -ghci-script flag is supported, however my ghci-7.4.1 says it knows nothing about it.

Those two changes to the user guide are included in Sam's patch, but the rest of that patch doesn't seem to be there.

As far as I can see, the attached dyn5265.patch is good, so I'm changing this ticket status to 'patch'.

Changed 13 months ago by simonmar

  • owner changed from duncan to pcapriotti
  • difficulty set to Unknown
  • priority changed from low to high

Paulo, could you validate and push please?

Changed 13 months ago by p.capriotti@…

commit 76bde331226e933b65b6433e983c50da1ce3b532

Author: Paolo Capriotti <p.capriotti@gmail.com>
Date:   Wed Apr 11 14:34:25 2012 +0100

    Add support for additional .ghci files in GHCi (#5265)
    
    Patch by Sam Anklesaria <amsay@amsay.net>

 compiler/main/DynFlags.hs  |    7 ++++++-
 docs/users_guide/flags.xml |    6 ++++++
 docs/users_guide/ghci.xml  |   12 ++++++++++++
 ghc/InteractiveUI.hs       |    4 ++--
 4 files changed, 26 insertions(+), 3 deletions(-)

Changed 13 months ago by p.capriotti@…

commit ab52df86f5f76da6e19ee6562792ea43972a6f24

Author: Paolo Capriotti <p.capriotti@gmail.com>
Date:   Wed Apr 11 14:19:25 2012 +0100

    Revert "trac #5265 (support for additional .ghci files)"
    
    This reverts commit 991f141989940c897cb2fc3dba7b5b49342d402a.

 compiler/main/StaticFlags.hs |   11 +----------
 docs/users_guide/flags.xml   |    6 ------
 docs/users_guide/ghci.xml    |    4 ----
 ghc/InteractiveUI.hs         |    3 +--
 4 files changed, 2 insertions(+), 22 deletions(-)

Changed 13 months ago by pcapriotti

  • status changed from patch to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.