[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacsclient - kill buffer, not frame

From: Eli Zaretskii
Subject: Re: emacsclient - kill buffer, not frame
Date: Fri, 20 Nov 2020 09:46:48 +0200

> From: Ken Goldman <>
> Date: Thu, 19 Nov 2020 17:12:06 -0500
> > You can't.  Because this makes no sense: that frame was created to
> > handle the buffer it displayed, so when the client buffer goes away,
> > the frame has no business to live anymore.
> It made sense for gnuclient, and for plain ol' emacs.  Kill
> one buffer and some other one gets displayed.

Plain Emacs doesn't work with client frames, it only displays frames
that the user created.  So it leaves it up to the user to delete those

> Frame A edits file 1.
> Frame B edits file 2.
> Frame A find-file file 2
> Frame B find-file file 1
> Now in Frame B, kill-buffer
> ... and Frame A disappears!?

Were all these frames created by "emacsclient -c"?  If so, deleting a
client frame makes a lot of sense, because otherwise you'd have gobs
of frames in your Emacs, one each for every file you wanted to edit.

If you don't want frames to be automatically deleted, simply don't
kill the buffers.  Why do you need to kill them?  Once you edited the
file and saved your edits, the buffer is not important, it can stay in
the session without being any problem.

> > What kind of workflow do you use that makes this a sensible thing to
> > do?  It sounds like you use emacsclient in some strange way, not the
> > way it was intended to be used.
> I typically have ~10 frames where I edit various files.  When
> I'm done with a task, I C-x C-b and delete the buffers I don't
> need any more.

Then simply don't delete them, and the frames will stay.

> You helped with the other work flow, where I double click and
> eventually have too many frames.  You showed me how to kill
> frames while leaving the buffers available.

Those other workflows did make sense.  Which is why Emacs already
caters to them.

One other solution is not to use -c.  Then you won't have so many
frames, and they will not be deleted when you kill the buffer.  So
another question to ask yourself is whether you really have to use -c
in your file associations.  (FWIW, I don't use it, and don't feel any
need to.)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]