-
Notifications
You must be signed in to change notification settings - Fork 5
Overlay other windows, fixes, stack management and more... #13
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
base: master
Are you sure you want to change the base?
Conversation
@mehw nice work! I'm really liking it and it looks really good for the codebase. I've applied your patch locally to test it and have a few notes:
|
Also need to make sure that the tests pass. I need to update the matrix of which emacs it runs in. Currently its set to emacs 24 :( |
@dpsutton I'm happy you enjoy the code!
I'll push the modifications as new commits, but once you agree the code is ready, maybe it's the case to squash the fixes to keep the branch clean. What do you think? |
Absolutely! Happy to help and I really appreciate the work you have already done. About squashing, I'm not sure squashing brings any benefit. Your commits are atomic and descriptive. I see no reason to smash them into one. I'm happy to accept the PR with as many commits as it takes. Can you tell me what benefit the timers give? Why not just use messages so that the last one wins? Ie, if resize-window is outputting some message display that. But if whatever you have invoked is showing something, don't worry about timing and interfering? I don't see what benefit they bring yet. If you could explain that it would be helpful. The defcustom for whether to quit or not on unrecognized keys sounds like a good idea. You were more recently a new user so you could set the default behavior. Perhaps people new to it would prefer the warning that the key they hit was unrecognized? So the default behavior is to not quit but warn? |
Thanks!
Sorry, let me clarify. In this PR, squash each future fix with the commit it fixes. When you agree, a forced push could keep the history of this branch clean until it is ready to be merged into master...
The timer allows to show the resize-window's status "Resize mode: insert KEY, ? for help, q or SPACE to quit" again after printing an action's message. This is also a hint to the fact that resize-window is still active. It is not essential, though. I was thinking more about implementing a console (side window) to handle both the help menu and status messages...
Yes ...Warn that the key is unrecognized but give the possibility to use any unrecognized key to quit. |
@mehw I've been looking over it and I'm quite pleased. You've certainly done a lot to improve the codebase. I have a suggestion for displaying the timers:
or a bit fancier
we can just spinloop the notifications for some time to come back when the minibuffer is no longer active. You surprised me by moving the command that was under I think there is only one blocker remaining and that is to put a way to quit on unrecognized input. It's quite hard for me to use right now as I've grown accustomed to double tapping enter in dired buffers and Inhibiting when the minibuffer is active should suffice for my needs. |
oh also i updated the test matrix so if you rebase on master it should give a more modern array of emacsen to test against. I would like the tests to pass before merging but i can clean that up after if need be. Again thanks so much for making software that I use every day much better. |
"Unregistered key: %s -> %s" | ||
key (resize-window--key-str key)))))))) | ||
(quit | ||
(resize-window--display-menu 'kill) |
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.
this doesn't call resize-window--cancel-notify
like when a [?q]
input is read. Is this deliberate? Seems like cleanup should largely be consistent.
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.
You just spot a bug! I'll fix it.
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.
Fixed in forced push.
oh and one other thing: you certainly deserve a spot as one of the authors now. So I'll invite you to add your name into the header of the file if you wish. |
That is really a good idea! Great thinking!
I'm still debugging a move forward/backward in the stack. While I was coding,
Got it!
Are you talking about the notification mod you suggested?
I'll do a forced push of the rebased branch.
I see you use
Well... I shall thank you for making this software in the first place...!
That's a honor! Thanks! I'll push the rebased branch and your suggestions soon. I'm on it right now. |
7dbdb31
to
85a72c1
Compare
Forced push done:
TODO:
Coding right now... |
85a72c1
to
d5ce62b
Compare
I took some time to look at Cask... Forced push:
TODO:
Travis fails on emacs:
@dpsutton I see that previously on Travis some emacs-24 revisions were failing on Back to coding... |
I totally misspoke above. The only thing that I need to happen is a way to stop the event loop on unrecognized input. running testsCask is what i use and it is quite simple to get it running locally: $ cask install
$ make unit
Navigating the window stackI originally used k and y. K came from "kill" and y from "yank" so it would mimic the kill-ring buffer. Using a lower case and capital might throw some complications since capital letters are assumed to be a "big" movement of a lowercase. Note that Test RunnerI'll look into this but the feedback loop is slow. I might wait until after your patch to poke it. Just run the tests locally using |
I believe i have solved the testing issue if you rebase on master again. |
c0f1f01
to
f21ae31
Compare
Could
Thanks for the explanation!
I'm implementing forward/backward stack movements. Do you have any suggestion beside
You missed me... what happened to the feedback loop?
This is odd, Travis emacs-25.3 doesn't have There are still some Travis failures:
|
Updated
@dpsutton emacs-git-snapshot hangs up on cask for unknown reasons and Travis fails... |
Currently working on forward/backward stack movements... I'm trying different behaviours... |
c5dfb30
to
ea90493
Compare
@dpsutton I'm pushing the latest commit for review... Forced push:
TODO:
The window configurations stackThe stack is a customizable size holder for window configurations. It folds over. Moving after the end restarts from the beginning and vice versa. Old configurations are dropped due to a chosen reduction in its size or an exceding number of configurations saved. Move forward/backward via Special flags give hints about the direction followed, forward When a configuration is modified, adjacent positions in the stack are considered to see if such new configuration is already there. In such a case, modification flag and direction followed are set accordingly. |
@mehw I've run into a show stopper that needs to be addressed. Using resize-window will alter the window layout of other frames. For instance, I have two frames open, both just split down the middle. Switching windows in one frame will alter the window layout in the other frame. Usually the split is gone and I'm left with only window in the other frame when I switch to it. I'm guessing this is coming from the restoring the window configuration all the time and comparing it. I'm not sure I follow all of the care going through in that. |
Also, just to be clear about my priorities: I really like the cleanup and moving overlays to other windows. There's a lot of much needed cleanup in there. I'm a little worried that the stack browser of window configs might impose a bit more cognitive overhead on the user than i initially intended. Also, the mechanism at the moment seems to mutate and destroy other window's current configuration which can't work. Is there any way to merge in the current change with all of the window config stuff backed out and start a new PR for that when its more polished? At the moment this has ballooned into just a development branch rather than a feature branch. |
@dpsutton Thanks for spotting that! resize-window is currently using a single stack for all frames, also it allows frames to operate unrestricted on other frames... Any frame is able to restore the configuration of another frame, and doing so this will modify the layout of the frame the configuration belongs to.
In the graphical version of Emacs, try to place two frames side by side. The resize-window's status messages should appear at the bottom of the frame the restored configuration belongs to... In the terminal version
You get the same side effects from the master branch... It's not about refreshing/comparing the configurations, it is the way the stack is handled, unrestrictedly. Maybe you didn't step into this behaviour before cuz the implementation of the stack was just to pop configurations from it and forget them... but you'll land into this kind of chaotic behaviour eventually... Anyway, resize-window can be made frame-restricted (aka operate on the current frame only). Already working is when a frame is deleted, the next run of resize-window will tidy up the stack of obsolete configurations.
IMHO just restricting resize-window to operate only on the frame it was run from should clear the confusion... It's unexpected seeing the neighbouring frames' layout changing while operating from another frame... It is not the stack management that introduced this...!
Sure! We loose the stack management... The master branch still need to be fixed though, or these kind of problems will keep lurking... I'm working on the code right now... debugging... |
@mehw I think i was unclear. When I have two frames open, both with split window configurations, I get window changes and buffers appear even when I'm not doing any stack options. I can recreate this just by cycling through windows with Does that make sense? |
ea90493
to
6710a3c
Compare
Forced push:
Got it! @dpsutton could you please try the current PR instantiation?
I have a doubt. Shouldn't
How do you use Thanks! |
I grabbed your patch a second ago and I can't seem to recreate the bug now so that is good :) About that confusing stuff, I just meant that i understand there is one stack sharing window layouts from multiple frames. I'm used to that. In the past I never kept track of all window configs, just when they were killed down to one or when a manual "mark" was created. I'm not sure I could keep it all in my head. It was a convenience and we might be nearing bookmarks territory :) |
Forced push:
@dpsutton I'm addressing the overlay put over the buffer switched by |
f/n key pushes forward/down the current window right/below divider. If there is no right/below divider, it pulls forward/down the left/above. b/p key pulls backward/up the current window right/below divider. If there is no right/below divider, it pushes backward/up the left/above. Update: - readme.md
Refresh overlays after window split. Update: - readme.md
91f325c
to
12fb9be
Compare
Forced push:
@dpsutton I opened an issue about In brief... Soon after To overcome this odd behaviour it is preferable to use I also implemented a workaround to force update the current buffer values before
With more than one frame open, scrolling the stack to a configuration for another frame and pressing |
Exclude the help menu when saving a configuration. When restoring a configuration display the help menu only if it was currently open. Workaround to force update the current buffer values. Soon after `ivy-switch-buffer`, both `current-buffer` and `get-buffer-window` still reference the old buffer, not the one switched to.
Update: - test/resize-window-test.el
Update: - readme.md
The stack size is now customizable. Always remove the oldest window configurations in excess to respect the stack size. Avoid stack duplicates and add the current window configuration to the tail of the stack before reverting to a previous configuration. Update: - readme.md
Update: - readme.md
Update: - readme.md - test/resize-window-test.el
Support symbol, character (integer), key text, or key sequence as key. NOTE: `read-key' cannot capture "M-w", use `read-key-sequence-vector'.
Spinloop the status notification if the minibuffer is active by suggestion of Dan Sutton (see `resize-window--notify-status').
Window configurations stack utility functions. Suspend the notification if the minibuffer is active by suggestion of Dan Sutton (see `resize-window--notify'). Offers better compatibility with `ivy-switch-buffer' and commands which employ the minibuffer. Update: - readme.md
Save window configurations per frame in the stack, which allows to scroll the saved window configurations of the selected frame only. Update: - readme.md
12fb9be
to
c02a3c8
Compare
@dpsutton Please, take a look at the newly implemented frame awareness feature... I'm currently working on tests and frame related behaviour... Forced push:
TODO:
|
Hello.
Your work is so useful that I couldn't resist to study the code!
I did some modding to put overlays over the other windows rather than the current one. There are also some fixes and new ideas like a different stack management...
I hope you could provide some feedbacks.
PS: I'm still debugging the code, there are some additions I didn't push yet, like customizable bindings and aliases. I didn't update the readme, nor the tests...
Best regards,
Matthew