-
Notifications
You must be signed in to change notification settings - Fork 347
haskell-present
does not follow its doc string
#607
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
Comments
Looks like functionality of these functions got messed, look: (defun haskell-process-do-simple-echo (line &optional mode)
"Send LINE to the GHCi process and echo the result in some
fashion, such as printing in the minibuffer, or using
haskell-present, depending on configuration."
(let ((process (haskell-interactive-process)))
(haskell-process-queue-command
process
(make-haskell-command
:state (list process line mode)
:go (lambda (state)
(haskell-process-send-string (car state) (cadr state)))
:complete (lambda (state response)
;; TODO: TBD: don't do this if
;; `haskell-process-use-presentation-mode' is t.
(haskell-interactive-mode-echo
(haskell-process-session (car state))
(replace-regexp-in-string "\n\\'" "" response)
(cl-caddr state))
(if haskell-process-use-presentation-mode
(progn (haskell-present (cadr state)
(haskell-process-session (car state))
response)
(haskell-session-assign
(haskell-process-session (car state))))
(haskell-mode-message-line response))))))) Likely, MODE should go to |
Very good, this is what rgrep shows:
Here is my proposal:
Additionally:
It turns that MODE was introduced to be used with Besides I'd prefer to rename Also, I think it would be good to have some customisable variable, say Phew! |
Hmm definitely looks inconsistent. Thanks for the investigation. Have a PR to clean it up? @gracjan may know the history of why it's like this. |
Surely, a bit later though. I want to have some feedback about custom-var (and about everything I mentioned) . It is possible to make something like multi optional choice, e.g. BTW, assigning session to buffer (or buffer to session) will be helpful when you want to kill session and all its buffers. Currently presentation mode buffers remains opened after you hit |
I really like the simplification that this brings. Thing I'd like to have:
The function @geraldus: Is there a way for you to split this pull request? There are unquestionable things in here that we could accept right away and then proceed with new functionality in another pull request. That would be more manageable. |
@geraldus: after rereading everything seems to be obvious except the variable. Please do the font locking as I described above. If somebody will like to have a variable they are always free to submit another issue/pr. |
Ok, last question: what about renaming |
Can confirm, that |
Rename confirmed. Use your name.
Use the assign so that it is killed properly.
|
Tidy up `haskell-present` and `haskell-process-do-simple-echo` according to #607
This is what doc string of
haskell-present
states:However, there is nothing related to SESSION arg in function body [1]:
However,
haskell-process-do-simple-echo
does session assignment, which is not documented [2]:(haskell-session-assign (haskell-process-session (car state)))
Am I missing something?
[1] https://github.com/haskell/haskell-mode/blob/master/haskell-presentation-mode.el#L38-L58
[2] https://github.com/haskell/haskell-mode/blob/master/haskell-interactive-mode.el#L1119-L1120
The text was updated successfully, but these errors were encountered: