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

haskell-interactive-bring': Use pop-to-buffer'. #743

Merged
merged 1 commit into from
Jul 4, 2015

Conversation

the-kenny
Copy link
Contributor

This commit removes counter-intuitive logic when bringing a project buffer to the front.

One could argue that we want to make the old behavior configurable. If so, please comment here and I'll add a config option.

Fixes #710.

remove the counter-intuitive logic when switching to a project buffer
and replace with the canonical way of bring a buffer to the front.
@geraldus
Copy link
Contributor

geraldus commented Jul 3, 2015

This behaviour is exact what I expect from haskell-interactive-bring. Let's see what other people say.

@ivan-m
Copy link
Contributor

ivan-m commented Jul 4, 2015

Can you please describe the behaviour that this implements and how it differs from the current behaviour? I did look at #710 but don't really understand the problem (maybe I'm just used to dealing with the current behaviour).

@geraldus
Copy link
Contributor

geraldus commented Jul 4, 2015

@ivan-m I always have several windows layout (most of the time there are only two of them, but rarely I use three or four also). If I start new session using haskell-interactive-bring it replaces all my windows with single one visiting session's (REPL's) buffer. This is annoying to me, because in this case I have to split windows again, and revisit all needed buffers. Though I use REPL occasionally, but usually I need it for type info and compilation only. New behaviour does not breaks layout, just pops session buffer.

Here is a quick demo of current behaviour.

@the-kenny
Copy link
Contributor Author

The old behavior removed all window-splits in the current frame when
bringing the interaction buffer to the front except when there were
exactly two windows (e.g. one split) and one of them was the interaction
buffer.

The new behavior relies on the standard Emacs function to bring some
background buffer to the front. It will show the buffer in some
window, preferably not the current one (so current buffer showing code
will still be visible) and splits if necessary.

If the interaction buffer is currently visible on another frame, that
frame will be made visible.

The reason I implemented this was that I mostly work on high-resolution
displays with a fullscreen emacs frame. That frame is split multiple
times, showing multiple code buffers.

The old behavior of `haskell-interactive-bring' threw away all these
splits and left me with just one gigantic haskell interaction buffer.

Using `pop-to-buffer' instead of self-written logic is more robust and
future-proof. It's also the "standard" way of bringing some buffer to
the front (See cider
https://github.com/clojure-emacs/cider/blob/master/cider-interaction.el#L411
or even inf-haskell: https://github.com/the-kenny/haskell-mode/blob/master/inf-haskell.el#L205)

gracjan added a commit that referenced this pull request Jul 4, 2015
`haskell-interactive-bring': Use `pop-to-buffer'.
@gracjan gracjan merged commit dbd8578 into haskell:master Jul 4, 2015
@gracjan
Copy link
Contributor

gracjan commented Jul 4, 2015

@the-kenny: Thanks for great explanation. Merged.

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

4 participants