-
Notifications
You must be signed in to change notification settings - Fork 91
Don't close frame when done #172
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
The control of edit-server-done is based on edit-server-new-frame. If it's not set it shouldn't be deleting the frame (but it will delete the window). |
I think I understand what is happening. Because you only have window visible the whole frame disappears because nothing is left. On my emacs if I attempt that the frame survives but I get the message:
Could you try the following patch and report back:
It seems a bit ugly but let me know if it works for you first. |
That totally works! Thank you. Do you think this is the right approach overall? Is there a reason we're using |
I think the idea of kill-window is it returns your editing layout to where you were before. Of course being emacs I'm sure there are users who can tweak the layout via hooks but I think we want the default case to be as neat as possible. That said I have no idea what the breakdown of users using single-frame vs new-frame semantics is. |
Would it be reasonable to add the ability to customize the "quit" function? With a default of |
Won't we always want to kill the buffer? But yeah I'd accept a
edit-server-cleanup-frame-function patch so you could remove or do
something different instead of delete-window.
…On Tue, 4 Aug 2020 at 16:27, Harrison ***@***.***> wrote:
Would it be reasonable to add the ability to customize the "quit"
function? With a default of delete-window and a recommended alternative
of kill-buffer? I could look into making a pull request if that's
something we would want to do.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#172 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAFPOWSJ3NF35BK4DHHSHLR7ASHNANCNFSM4PTSF5MQ>
.
--
Alex, homepage http://www.bennee.com/~alex/
|
Ok sounds good! I'll probably look into that later this week. |
I wanted to chime in to say that I'd also prefer if My use case / configuration is a little different from @HarrisonMc555's: I usually have a frame that is split into two windows. When I have I also want to thank you for putting together this very useful package! |
I was finding the use of a new frame annoying, both because: (1) I'd prefer to have all of my other open buffers available alongside the edit-server window, and more importantly (2) with the use of a new frame, whenever you save, the frame is deleted and recreated; this means that, if I had split the frame, opened any other buffers in that frame, etc., all of that work is lost (and winner doesn't seem to be able to recover it, maybe because that frame is totally gone). The problem with NOT using a new frame is that when you're done (with C-c C-c), the current window gets deleted (see also stsquad/emacs_chrome#172). I'll work around that by using winner-undo. I thought about adding this (in misc.el; not yet tested): (require 'edit-server) ;; This is a total hack to prevent the edit-server from deleting the current window when ;; finishing. Otherwise, when edit-server-new-frame is nil, when finished editing, the ;; edit server's window is deleted, which I don't like. Ideally the edit-server code ;; wouldn't do that, but this function is a hacky workaround to prevent it. (defun my-edit-server-done () (interactive) ;; Here is the total hack: we temporarily set edit-server-new-frame to t to trick ;; edit-server-done into not calling delete-window. This works for now because the only ;; use of edit-server-new-frame is in a conditional to decide whether to call ;; delete-window, but if it were used for anything else, this might break. (let ((edit-server-new-frame t)) (edit-server-done))) but I'll just add that if winner-undo isn't enough of a fix.
My apologies if this is already documented somewhere and I just didn't find it—I've searched
customize
for "edit server" and looked through open and closed issues on GitHub and didn't find it.My personal preference when using the Emacs edit server is to open a new buffer (but not a new frame) when invoked. I would then like to close this buffer (typically with
C-c C-c
) and close the buffer—but not close the entire frame.I usually only have one Emacs frame open at a time, so when I invoke the edit server from Chrome it creates a new buffer. I will typically close all other buffers besides the edit server buffer. However, if I do that, then when I finish the edit server buffer and press
C-c C-c
, it closes the frame and my entire GUI frame is closed. So, I have to launch the GUI again from the command line.So, my question is this: can I configure
edit-server
to not close the frame when I'm done with the buffer? But to only close the buffer? When I close other buffers (e.g.kill-current-buffer
) the buffer is closed and I'm brought to a different (most recent?) buffer.For more background information, I am using the Emacs daemon (
emacs --daemon
) on macOS Mojave. I am using a relatively recent version ofemacs_chrome
installed manually so I could have access to custom keyboard shortcuts 😄 I believe I installed it about a month or two ago.And thank you for a great tool! It's really cool and helpful.
The text was updated successfully, but these errors were encountered: