spacemacs
spacemacs copied to clipboard
"Selecting deleted buffer" error upon common commands
"Selecting deleted buffer" error upon many commands (search, buffer, file, help...)
Description :octocat:
Everything works normally on startup. But at some point --- I have not found the triggering condition --- commands like SPC f f
or SPC b b
or even /
result in a "Selecting deleted buffer" message instead of the desired behavior.
Reproduction guide :beetle:
- Start Emacs
- Do work for a few minutes (sorry) --- I'm generally working in an org-mode file, and lately I've been using tables but I'm not sure if these are related.
Observed behaviour: :eyes: :broken_heart:
"Selecting deleted buffer" is the response to many basic commands. Sometimes, but not always, one or more sometimes-incorrectly closed (defun dotspacemacs/emacs-custom-settings ()) ...)
forms appear in the .spacemacs file, which I've been deleting manually to get the .spacemacs file to not crash so my configuration gets loaded correctly. Maybe this issue is like #7898 ?
Expected behaviour: :heart: :smile: Stuff works.
System Info :computer:
- OS: gnu/linux
- Emacs: 25.1.1
- Spacemacs: 0.200.9
- Spacemacs branch: develop (rev. 4361254e)
- Graphic display: t
- Distribution: spacemacs
- Editing style: vim
- Completion: ivy
- Layers:
(sql python html ivy better-defaults
(auto-completion :variables auto-completion-tab-key-behavior 'cycle auto-completion-space-key-behavior 'reject auto-completion-return-key-behavior 'reject auto-completion-enable-help-tooltip t auto-completion-enable-snippets-in-popup t auto-completion-enable-sort-by-usage t auto-completion-complete-with-key-sequence "jk" auto-completion-complete-with-key-sequence-delay 0.3)
(shell :variables shell-default-shell 'term shell-default-term-shell "/usr/bin/zsh" shell-default-height 40 shell-default-position 'bottom)
emacs-lisp javascript clojure latex git github restclient syntax-checking markdown deft org themes-megapack typography)
- System configuration features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11
Backtrace :paw_prints:
I don't know how to find a backtrace because the bug kills my ability to navigate buffers.
Update: I'm trying to find a minimal example of something that breaks everything. I went from working state, to deleting rows from one org-mode table and pasting them below another org-mode table, and saved, and that resulted in breakage. I have a couple functions that run on save which I will also try commenting out from my config.
A-ha! With these two functions no longer running after save, pasting rows and saving no longer breaks everything. These are the only 'after-save-hook
functions I had.
;; Tangle Org files when we save them
;; (defun tangle-on-save-org-mode-file()
;; (when (string= (message "%s" major-mode) "org-mode")
;; (org-babel-tangle)))
;; (add-hook 'after-save-hook 'tangle-on-save-org-mode-file)
(defun to-agenda-on-save-org-mode-file()
(when (string= (message "%s" major-mode) "org-mode")
(org-agenda-file-to-front)))
;; (add-hook 'after-save-hook 'to-agenda-on-save-org-mode-file)
I've found that simply running org-agenda-file-to-front
is enough to trigger this
The selecting deleted buffer happens to me from time to time as well and I cannot do a spc b b
or pretty much anything until I restart emacs.
Killing a ranger buffer and closing the new frame that was opened, puts you in a state where a lot of key bindings show the message: Selecting deleted buffer
Reproduction steps with the ranger layer installed
Open a ranger "session": SPC a r
Kill the selected ranger buffer: SPC b d
The messages buffer shows:
Ranger window was overwritten. Redirecting window to new frame
and a new frame opens, where the key bindings seem to work as expected. But when the new frame is closed: SPC q f
(SPC q z
in the master branch). Then the initial frame gets selected and when SPC
is pressed, then this message is shown:
Error running timer ‘which-key--update’: (error "Selecting deleted buffer")
The frame splits with the bottom window showing <M>
where the window number used to be. The top window shows 1
as the window number. The <M>
window doesn't close when the cursor is in the top window and SPC w m
is pressed to maximize that window.
A lot of key bindings show these messages (without opening a new frame):
Ranger window was overwritten. Redirecting window to new frame apply: Selecting deleted buffer
SPC q r
doesn't restart, it just shows the selecting deleted buffer
message. But one way of restarting, is to open a new frame SPC w F
, where SPC q r
works.
Sometimes it's also possible to get back to normal, without restarting, by pressing SPC b n
to switch to the ranger buffer. Or if the ranger buffer isn't found then open a new ranger buffer SPC a r
.
Press q
to close it.
System Info :computer:
- OS: windows-nt
- Emacs: 25.2.2
- Spacemacs: 0.200.9
- Spacemacs branch: develop (rev. a2137299)
- Graphic display: t
- Distribution: spacemacs
- Editing style: vim
- Completion: helm
- Layers:
(autohotkey markdown ranger emacs-lisp git github helm org syntax-checking version-control)
- System configuration features: XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS MODULES
I'm unable to reproduce the "Selecting deleted buffer" issue with ranger. The steps above, seems to have been related to another ranger issue, where the middle column, didn't show any text for files and some folders. That issue was fixed a couple of days ago.
Maybe this could be helpful:
It seems most likely that you've captured the buffer object for the original (and now deleted) buffer, and have passed that object to with-current-buffer, rather than the object for the new buffer. – phils Jun 27 '14 at 5:52
https://stackoverflow.com/questions/24443236/selecting-deleted-buffer-error-in-elisp?rq=1#comment37825323_24443236
I encountered this bug for the first time a few days ago. Mostly happens when working in org-mode, but can't nail it down any further yet. I can confirm that running org-agenda-file-to-front
is enough to trigger this behavior. I'm on the develop branch, using Emacs 25.1 on OS X 10.11.6 if that helps.
Has anyone found a workaround that isn't "restart emacs"?
This happens a lot for me recently. Only way to fix is to restart. Really annoying.
This reproduces it for me every time:
- Start Spacemacs
- SPC : customize-variable
- org-adapt-indentation
- Set to off
- Click Apply and Save
Any call to customize-variable followed by Apply and Save triggers the bug for me.
Yeah this is getting exceedingly annoying. It sometimes works and sometimes doesn't. Mostly doesn't.
I even tried wiping my .spacemacs to a clean slate and it was still doing it ???
This occurs for me if I open a multi-term
and kill the buffer (with SPC b d
). The only way I can close multi-term
s is by sending an EOF to the terminal, which isn't feasible if the application in the terminal has crashed or is spewing a lot of output, for example (but this fails even if the shell is responding).
As above, having to kill the entire session and resurrect is... not fun. :confused:
Turning off the Spacemacs layer nlinum
made my problem go away. Looks like some timer in nlinum
implementation was causing this issue. By default, Spacemacs comes with nlinum-relative
to enable line number support. I didn't know why I added nlinum
layer. I didn't notice any functionality missing after I removed that layer from my configuration.
Turning off the Spacemacs layer
nlinum
made my problem go away
I don't have this layer and I still have this problem :[
I was able to fix this my moving my custom-set-variables
into their own file as described here: https://github.com/syl20bnr/spacemacs/issues/7891#issuecomment-285958745
I had the same problem, and triggering it only needs moving the cursor to some space character and wait for a few seconds.
I get this when calling "cider-jack-in" and the command "sesman-quit" seems to fix it.
I get this when calling "cider-jack-in" and the command "sesman-quit" seems to fix it.
Yes, it works. I cider-jack-in the cider-nrepl and then cider-connect to another repl, then I kill the latter buffer. When I cider-connect the latter repl again, the problem is produced. Then I new a frame, sesman-quit it, and cider-connect again, it works.
I'm getting this error when invoking any agenda view. Using the develop branch.
Opening org agenda views under the prefix: SPC a o o
-
a
Agenda for current week or day -
t
List of all TODO entries -
n
Agenda and all TODOs
works for me without any errors.
Windows 1903
#### System Info :computer: - OS: windows-nt - Emacs: 26.3 - Spacemacs: 0.300.0 - Spacemacs branch: develop (rev. c3f13d039) - Graphic display: t - Distribution: spacemacs - Editing style: vim - Completion: helm - Layers: ```elisp (autohotkey auto-completion command-log emacs-lisp git helm helpful html imenu-list (java :variables java-backend 'meghanda) javascript latex lsp (markdown :variables markdown-live-preview-engine 'vmd markdown-command "vmd") multiple-cursors (org :variables org-agenda-files '("~/org/notes.org")) pdf python (shell :variables shell-default-shell 'shell shell-default-height 30 shell-default-position 'bottom) spell-checking (syntax-checking :variables syntax-checking-enable-by-default nil) treemacs version-control) ``` - System configuration features: XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS THREADS LCMS2
@npit If you meant something else, then could you provide some reproduction steps.
And it might help to narrow down when the issue is occurring if you include your system info.
Press SPC h d s
to copy your system info to the clipboard.
Currently, I'm getting the error when I invoke the GUI version of spacemacs, eg:
- running
emacsclient -c
from the terminal - running from my program launcher in plasma KDE, with an command of
emacsclient ~/path/to/file.org
oremacsclient -c
On the other hand, running emacsclient ~/path/to/file.org
from the terminal successfully spawns spacemacs, but in a terminal environment.
FWIW, after the *ERROR*: Selecting deleted buffer
error, the messages buffer displays a warning: [persp-mode] Warning: Can not restore the window configuration, because of the error -- (error Window #<window 49 on *scratch*> too small to accommodate state)
The system info:
#### System Info :computer:
- OS: gnu/linux
- Emacs: 26.3
- Spacemacs: 0.300.0
- Spacemacs branch: develop (rev. 3a1bfc2a9)
- Graphic display: nil
- Distribution: spacemacs
- Editing style: vim
- Completion: helm
- Layers:
‘‘‘elisp
(windows-scripts sql vimscript javascript shell-scripts dap helm html lsp search-engine git neotree
(auto-completion :variables auto-completion-enable-snippets-in-popup t auto-completion-enable-help-tooltip t)
c-c++ better-defaults emacs-lisp yaml csv themes-megapack markdown
(python :variables python-backend ’lsp python-lsp-server ’mspyls python-fill-column 99 python-formatter ’yapf python-format-on-save nil python-sort-imports-on-save t python-pipenv-activate t)
(ranger :variables ranger-cleanup-on-disable t ranger-show-literal nil ranger-show-preview t)
imenu-list colors
(colors :variables colors-enable-nyan-cat-progress-bar t)
org
(latex :variables latex-enable-auto-fill nil org-startup-indented t org-pretty-entities t latex-enable-folding t)
(shell :variables shell-default-height 30 shell-default-position ’bottom)
(spell-checking :variables spell-checking-enable-auto-dictionary t spell-checking-enable-by-default nil)
(languagetool :variables langtool-java-classpath "/usr/share/languagetool:/usr/share/java/languagetool/*" langtool-default-language "en-US")
(syntax-checking :variables syntax-checking-enable-by-default t)
mu4e)
‘‘‘
- System configuration features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES T\
HREADS LIBSYSTEMD LCMS2
I haven't been able to reproduce the error: Selecting deleted buffer
.
But I'm able to reproduce the warning (In Linux, but not in Windows):
[persp-mode] Warning: Can not restore the window configuration, because of the error -- (error Window #<window 5 on scratch> too small to accommodate state)
By first starting Spacemacs with a Gui client, then with a terminal client:
-
emacs --daemon
- start Spacemacs with a gui:
emacsclient -c
- close the gui:
SPC F d
- start Spacemacs in a terminal:
emacsclient -nw
The warning is shown for a split second in the minibuffer during startup, then it's visible in the messages buffer.
PopOS 19.10
#### System Info :computer: - OS: gnu/linux - Emacs: 26.3.50 - Spacemacs: 0.300.0 - Spacemacs branch: develop (rev. 0a7ab7873) - Graphic display: t - Distribution: spacemacs - Editing style: vim - Completion: helm - Layers: ```elisp (auto-completion command-log emacs-lisp git helm markdown multiple-cursors (org :variables org-agenda-files '("~/org/notes.org")) pdf python (shell :variables shell-default-shell 'term shell-default-height 30 shell-default-position 'bottom) spell-checking syntax-checking treemacs version-control) ``` - System configuration features: XPM JPEG TIFF GIF PNG SOUND DBUS GSETTINGS GLIB NOTIFY LIBSELINUX GNUTLS FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS
Same.
Just updated packages.
Agenda and Magit buffers do not work.
I have updated packages on the latest develop
branch and both org agenda and magit sems to be working.
Can you:
- Provide some reproduction steps.
- Include your system info. Press
SPC h d s
to copy them to your clipboard.
Manjaro, System Info (Click to expand)
#### System Info :computer: - OS: gnu/linux - Emacs: 27.1 - Spacemacs: 0.300.0 - Spacemacs branch: develop (rev. b606d82df) - Graphic display: t - Distribution: spacemacs - Editing style: vim - Completion: helm - Layers: ```elisp (emacs-lisp git helm lsp multiple-cursors org rust spell-checking syntax-checking version-control treemacs) ``` - System configuration features: XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON PDUMPER LCMS2 GMP
Windows 10, System Info (Click to expand)
#### System Info :computer: - OS: windows-nt - Emacs: 27.1 - Spacemacs: 0.300.0 - Spacemacs branch: develop (rev. b606d82df) - Graphic display: t - Distribution: spacemacs - Editing style: vim - Completion: helm - Layers: ```elisp (autohotkey emacs-lisp git helm javascript lsp multiple-cursors (org :variables org-agenda-files "c:/Users/username/org/notes.org") python rust spell-checking syntax-checking version-control treemacs) ``` - System configuration features: XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY W32NOTIFY ACL GNUTLS LIBXML2 HARFBUZZ ZLIB TOOLKIT_SCROLL_BARS MODULES THREADS JSON PDUMPER LCMS2 GMP
Dodged the bullet.
-> Nuke&paving ~/.emacs
helped. <-
Happens.
I can no longer provide info.
Just hit this issue after:
cider-jack-in
spc-b-d
to kill buffer
cider-jack-in
attempt to start new repl
Running sesman-quit
cleared the error for me and allowed cider-jack-in
to work again.
when this happens it prevents me from even closing emacs in a standard way
I had the same problem (mostly using SPC g s
for magit status). I had to delete ~/.emacs.d/elpa
and ~/.emacs.d/.cache
. Now it works. I also reset the environement variables using spacemacs/force-init-spacemacs-env
.
For me ~/.emacs.d
deletion does not help (while keeping the same ~/.spacemacs.d
). emacs version 27.2. Very annoying when having to open files 2 times with "HELM Find Files" (succeeds on the second run).