-
Notifications
You must be signed in to change notification settings - Fork 344
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
[WIP] Support internal prompts #1357
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,9 +104,9 @@ You can create new session using function `haskell-session-make'." | |
":set -v1" | ||
":set +c") ; :type-at in GHC 8+ | ||
"\n")) | ||
(haskell-process-send-string process ":set prompt \"\\4\"") | ||
(haskell-process-send-string process (format ":set prompt2 \"%s\"" | ||
haskell-interactive-prompt2))) | ||
haskell-interactive-prompt2)) | ||
(haskell-process-send-string process ":set prompt \"\\4\"")) | ||
|
||
:live (lambda (process buffer) | ||
(when (haskell-process-consume | ||
|
@@ -134,8 +134,20 @@ If I break, you can: | |
1. Restart: M-x haskell-process-restart | ||
2. Configure logging: C-h v haskell-process-log (useful for debugging) | ||
3. General config: M-x customize-mode | ||
4. Hide these tips: C-h v haskell-process-show-debug-tips"))))))) | ||
|
||
4. Hide these tips: C-h v haskell-process-show-debug-tips"))) | ||
(unless haskell-interactive-use-interactive-prompt | ||
(with-current-buffer (haskell-session-interactive-buffer | ||
(haskell-process-session process)) | ||
(setq-local haskell-interactive-mode-prompt-start (point-max-marker))) | ||
;; Now it's safe to set the prompt | ||
;; Make sure to double escape any newlines | ||
(haskell-interactive-mode-run-expr | ||
(format ":set prompt \"%s\\4\"" | ||
(replace-regexp-in-string "\n" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use |
||
"\\n" | ||
haskell-interactive-prompt | ||
nil | ||
t)))))))) | ||
(defun haskell-commands-process () | ||
"Get the Haskell session, throws an error if not available." | ||
(or (haskell-session-process (haskell-session-maybe)) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -324,6 +324,17 @@ The default is `haskell-interactive-prompt' with the last > replaced with |." | |
:type 'string | ||
:group 'haskell-interactive) | ||
|
||
(defcustom haskell-interactive-use-interactive-prompt t | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I really dislike forcing users to know about some magical defcustoms. Is there a way to get the same functionality to Just Work without any fuss like setting something to some value? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gracjan #1353 (comment) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gracjan @Pitometsu If you don't mind both of these things, then I can replace this version. Oh, I also don't see |
||
"Non-nil means that haskell-interactive uses its prompt at the | ||
Emacs side rather than setting it in GHCi directly. | ||
|
||
This is only useful to disable when you want a prompt containing | ||
your modules (as GHCi does by default), or if you apply extra | ||
properties (colours, etc.) to your prompt through GHCi." | ||
:type 'boolean | ||
:group 'haskell-interactive) | ||
|
||
|
||
(defcustom haskell-interactive-mode-eval-mode | ||
nil | ||
"Use the given mode's font-locking to render some text." | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use
haskell-string-literal-encode
here, it can handle escapes the Haskell way.