[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
kill-this-buffer, perhaps doc issue
From: |
Andrés Ramírez |
Subject: |
kill-this-buffer, perhaps doc issue |
Date: |
Thu, 06 Oct 2016 10:39:21 -0500 |
Hi.
The other day I got a nice tip from:
http://irreal.org/blog/?p=5585
my function used to be this one:
--8<---------------cut here---------------start------------->8---
(defun emacswikino/kill-a-buffer (askp)
(interactive "P")
(if askp
(call-interactively #'ido-kill-buffer)
(kill-this-buffer)))
--8<---------------cut here---------------end--------------->8---
--8<---------------cut here---------------start------------->8---
(global-set-key (kbd "C-x k") 'emacswikino/kill-a-buffer) ;; (behavior imp)
used to be kill-buffer
--8<---------------cut here---------------end--------------->8---
It worked nice at the beginning. But after coming back from machine
hibernation "C-x k" stopped working. At that time I reverted back to the
old behaviour. But yesterday I digged a little bit about it. And found
this, which is related:
https://github.com/syl20bnr/spacemacs/issues/4929
Specifically this couple of comments:
--8<---------------cut here---------------start------------->8---
I only did a shallow research. It seems that menu-updating-frame points to an
invisible frame, but I guess its value should be nil. Perhaps the
persistent-server
feature works by creating an invisible frame, and that's what confuses
menu-updating-frame? Does this bug happen only with the persistent-server
enabled?
Anyway, it looks like kill-this-buffer is intended to be used only from the
menu-bar. We probably should use a different function. I don't think
evil-delete-buffer is
good, because it also closes the window (if there's more than 1 window). It
shouldn't be too hard to find a suitable function, or write one, if somebody is
up to it.
--8<---------------cut here---------------end--------------->8---
👍 2
--8<---------------cut here---------------start------------->8---
@bluesd
bluesd commented May 26, 2016
At least for me happens only with the dotspacemacs-persistent-server enabled
AND only if you close (SPC q z) the first emacs you invoke. After that, the
current
and future emacsclient -c never return when closing the frame, leaving the
terminal "Waiting for emacs..." without resuming to shell.
Also, in this "state", if you attempt to SPC q Q, the first time doesn't work
at all and you get the following legend: "Attempt to delete the sole visible or
iconified
frame". (I think this one's only appearing in Linux).
--8<---------------cut here---------------end--------------->8---
First comment. Is kill-this-buffer intended for being used just from the
menu? If the answer is yes then the docs need an improvement. It happens
with 25.1
Second comment. Sometimes I have got "Attempt to delete the sole visible
or iconified frame". Is this related to the same issue?
Finally that snippet ended like this:
--8<---------------cut here---------------start------------->8---
(defun emacswikino/kill-a-buffer (askp)
(interactive "P")
(if askp
(call-interactively #'ido-kill-buffer)
(kill-buffer (current-buffer))))
--8<---------------cut here---------------end--------------->8---
Regards
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- kill-this-buffer, perhaps doc issue,
Andrés Ramírez <=