Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ghci-script-mode: Fix script loading by ghci-script-mode-load. #1824

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

Kariiem
Copy link
Contributor

@Kariiem Kariiem commented Sep 19, 2023

The current version of ghci-script-mode-load is defined as

(defun ghci-script-mode-load ()
  "Load the current script file into the GHCi session."
  (interactive)
  (let ((buffer (haskell-session-interactive-buffer (haskell-session)))
        (filename (buffer-file-name)))
    (save-buffer)
    (with-current-buffer buffer
      (set-marker haskell-interactive-mode-prompt-start (point-max))
      (haskell-interactive-mode-run-expr
       (concat ":script " filename)))))

The let binding calls (haskell-session-interactive-buffer (haskell-session)) which changes the current buffer by calling (haskell-interactive-switch) at haskell-interactive-mode.el::520, this causes the wrong binding for filename and also causes the save-buffer part to prompt for which file to save the *haskell-session* buffer in, which when canceled cancels the rest of the command (haskell-interactive-mode-run-expr (concat ":script " filename)).

@purcell purcell merged commit 0207074 into haskell:master Sep 20, 2023
10 checks passed
@purcell
Copy link
Member

purcell commented Sep 20, 2023

Great, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants