ability to evaluate code via elm-repl-push{-decl} without switching to the REPL buffer#113
Open
berkan wants to merge 3 commits intojcollard:masterfrom
Open
ability to evaluate code via elm-repl-push{-decl} without switching to the REPL buffer#113berkan wants to merge 3 commits intojcollard:masterfrom
berkan wants to merge 3 commits intojcollard:masterfrom
Conversation
* If universal argument NO-SWITCH is non-nil, then do not switch to the REPL buffer
* elm-repl-push & elm-repl-push-decl accept a universal argument which controls whether or not to switch to the REPL buffer after the push * variable elm-interactive-flip-arg-switch-behaviour determines the effect of the universal argument * after a push, functions in elm-interactive-after-push-hook are run with the result of the last push
68c303e to ab1d265 Compare Collaborator
| Thanks. This solution is greatly overthinking things IMO, and adds unnecessary complexity: it would be conceptually much simpler to just add a separate command that evaluates the selected region and prints the result in the minibuffer. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change allows
elm-repl-pushandelm-repl-push-declto work without switching to the REPL buffer.The use-case I'm addressing is to evaluate code directly from a source code buffer, with minimum disruptions.
The details of the change are:
elm-repl-push&elm-repl-push-declaccept a universal argument which controls whether or not to switch to the REPL buffer after the push.The default behaviour is:
nil, switch to the REPL buffer (the same as the current behaviour)non-nil, stay in the current buffer after the pushSetting the variable
elm-interactive-flip-arg-switch-behaviourtonon-nilreverses the default behaviour above.So, anybody who didn't want to switch to the REPL buffer after a push and don't want to use the universal argument all the time can set this to
t.After a push, functions in
elm-interactive-after-push-hookare run with the result of the last pushelm--print-resultwhich prints the first line of a possibly multi-line string in the echo area (this is so that the echo area doesn't grow and create an unnecessary visual distraction)