Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Renaming a directory causes a switching to killed buffer error #25

Closed
kensanata opened this Issue · 16 comments

2 participants

@kensanata

I decided to give sunrise-commander a try and got the latest copy from GitHub. I find that I can't "move directories" which I presume is done via renaming, ie. R. After M-x toggle-debug-on-error this is what I see:

Debugger entered--Lisp error: (error "Attempt to display deleted buffer")
  set-window-buffer(nil #<killed buffer>)
  switch-to-buffer(#<killed buffer>)
  (progn (switch-to-buffer (sr-other (quote buffer))) (if (eq major-mode (quote sr-virtual-mode)) (or (buffer-file-name) "Sunrise VIRTUAL buffer") nil))
  (unwind-protect (progn (switch-to-buffer (sr-other (quote buffer))) (if (eq major-mode (quote sr-virtual-mode)) (or (buffer-file-name) "Sunrise VIRTUAL buffer") nil)) (set-window-configuration wconfig))
  (let ((wconfig (current-window-configuration))) (unwind-protect (progn (switch-to-buffer (sr-other (quote buffer))) (if (eq major-mode (quote sr-virtual-mode)) (or (buffer-file-name) "Sunrise VIRTUAL buffer") nil)) (set-window-configuration wconfig)))
  sr-virtual-target()
  (if (sr-virtual-target) (progn (error "Cannot move files to a VIRTUAL buffer, try (C)opying instead")))
  sr-do-rename()
  call-interactively(sr-do-rename nil nil)

I'm not sure why the buffer is killed...

@escherdragon
@kensanata

I'll provide one when I manage to do it again. Today I started using sunrise-commander again and managed to confuse it. Suddenly j would jump to dired buffers, leaving me outside of sunrise-commander. As I'm just beginning there's a lot of M-x sunrise going on again and again as I try to find my bearing again. All I know that, after maybe 10 minutes of use, I again have the same problem. "switch-to-buffer: Attempt to display deleted buffer"
Sorry I cannot provide more info.

@kensanata

Here's an interesting phenomenon: I do M-x sunrise until I see my two panes again. On the left is /Volumes/Extern/RPG and on the right is /Volumes/Extern/RPG/Dungeons & Dragons/; I mark the directory Dragon Magazine on the right and hit R. The question I expect is whether I want to move the directory to /Volumes/Extern/RPG (the one visible on the left) but instead I am asked whether I want to move the directory to /Volumes/Extern/RPG/Dungeons & Dragons/Wizards of the Coast/Books – I directory I visited a while ago. Perhaps this is the same problem: The target buffer is not the left pane. When I check my buffer list, I don't see a buffer called "Books" or a buffer displaying the Buffer directory.

@escherdragon
@escherdragon
@kensanata

I mostly move from directory to directory using RET, j and J.

Just now, for example:

M-x s u n r i s e <return> C-h m C-s u p C-s C-s C-s
C-s C-s <S-up> <prior> C-h k <prior> C-h k <home> C-h
k <C-prior> C-h k C-g <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <return>
<escape> > <up> <return> <escape> > <up> <return> <escape>
> <up> <return> C-r u p C-r <C-left> <C-left> C-SPC
<C-right> <C-right> M-w <escape> x w h e r e <backspace>
<backspace> <backspace> <backspace> <backspace> C-g
C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s
C-s C-s C-s C-s C-s <down> <down> <S-up> J C-h m <next>
C-s p a s s i v e C-s C-s C-s <S-up> <S-left> C-c <return>
C-x k <return> M-x <up> <return> <S-right> <S-left>
<S-down> <S-up> C-h m <down> <down> <down> <down> <down>
<down> <down> <down> <down> C-s p a s s i v e C-s C-s
C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s
C-s C-s <up> <S-left> <S-up> <mouse-movement> <S-down>
C-s <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <C-tab> <C-tab>
<S-up> <C-tab> <C-tab> <C-tab> <S-up> <down> <down>
<down> <up> <up> <up> <up> <up> <up> <up> <up> <up>
<up> <up> <down> <down> <down> <down> <S-right> <S-left>
j <up> <up> <up> <up> <down> <down> <down> <down> a
l e x <tab> D r o p <tab> <return> <down> <down> <down>
<down> <down> <down> <S-right> j / V o l <tab> E x
<tab> R P <tab> <return> <down> <down> <down> <down>
<down> <up> <return> <S-left> R <escape> x v i e w
- l o s s <tab> <return>

and

Loading /Users/alex/elisp/magit-setup.el (source)...done
Loading /Users/alex/.session...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Starting Sunrise Commander...
Omitting...
(Nothing to omit)
Omitting...
Omitted 20 lines.
Omitting...
(Nothing to omit)
Omitting...
(Nothing to omit)
Been coding all night? Enjoy the Sunrise! (or press q to quit)
Type "q" to restore previous buffer, <M-down> to scroll help.
Mark saved where search started
scroll-down-command: Beginning of buffer
 [5 times]
Mark set

Mark set

Mark set

Mark saved where search started
Mark set
Quit
Mark saved where search started
Omitting...
(Nothing to omit)
Omitting...
Omitted 2 lines.
Omitting...
(Nothing to omit)

Mark saved where search started
Starting Sunrise Commander...
Been coding all night? Enjoy the Sunrise! (or press q to quit)
Type "q" to restore previous buffer, <M-down> to scroll help.
Mark saved where search started
windmove-do-window-select: No window left from selected window
try-expand-dabbrev: Buffer is read-only: #<buffer *Help*>
No expansion found [3 times]
Omitting...
(Nothing to omit)
Omitting...
Omitted 2 lines.
Omitting...
(Nothing to omit)
Omitting...
(Nothing to omit)
Omitting...
Omitted 2 lines.
Omitting...
(Nothing to omit)
Omitting...
(Nothing to omit)
Omitting...
Omitted 2 lines.
Omitting...
(Nothing to omit)
switch-to-buffer: Attempt to display deleted buffer

You can run the command `view-lossage' with C-h l
byte-code: Beginning of buffer [6 times]
Mark activated
Saved text from "M-x s u n r i s e <return> C-h m C-s u p"
byte-code: Beginning of buffer [6 times]
Mark set

As you can see, I started sunrise-commander twice. I think the reason was that I had tried M-RET to view a file and then used M-x sunrise to get my sunrise-command windows back.

@escherdragon
@kensanata
GNU Emacs 24.3.1 (x86_64-apple-darwin, NS apple-appkit-1038.36) of 2013-03-13 on bob.porkrind.org
@kensanata

I get the same behaviour with Emacs -Q and nothing but sunrise-commander.el loaded.

alex@Megabombus:~$ /Applications/Emacs.app/Contents/MacOS/Emacs-10.7 -nw -Q
@kensanata

We should rename this issue to "sr-right-buffer or sr-left-buffer point to a killed buffer"

@escherdragon
@kensanata

I tried to figure out which command caused sr-(left|right)-buffer to point to a killed buffer.

(add-hook 'post-command-hook
      (lambda ()
        (when (not (memq last-command
                 '(self-insert-command
                   )))
          (message "Last command: %S (%S/%S)"
               last-command
               sr-left-buffer
               sr-right-buffer))))

Here's what I found:

Last command: sr-mouse-move-cursor (#<buffer RPG (Sunrise)>/#<buffer ~ (Sunrise)>)
Last command: sr-find-file (#<buffer RPG (Sunrise)>/#<buffer ~ (Sunrise)>)
Last command: windmove-right (#<buffer RPG (Sunrise)>/#<buffer ~ (Sunrise)>)
Last command: sr-find-file (#<buffer RPG (Sunrise)>/#<buffer ~ (Sunrise)>)
Omitting...
(Nothing to omit)
Omitting...
Omitted 2 lines.
Omitting...
(Nothing to omit)
Last command: windmove-right (#<buffer RPG (Sunrise)>/#<killed buffer>)

I use

(windmove-default-keybindings)
@escherdragon
@kensanata

This seems to work. It just needs a safeguard again.

if: Symbol's value as variable is void: sr-running
@escherdragon
@escherdragon escherdragon referenced this issue from a commit
@escherdragon +Refactoring (#25): new pane-switching mechanism.
Now SC works correctly with Wind Move and with any other window navigation
feature that uses `select-window' to jump from one window to another.
9505783
@escherdragon
Owner

Hello again Alex,

The problem you reported has been fixed in commit 9505783.
A new version of the Sunrise Commander has been released as 6R451.
Thank you for reporting, and by all means do let me know if you find any other problems while using SC.

Cheers,

José A. Romero L.
escherdragon@gmail.com
"We who cut mere stones must always be envisioning cathedrals."
(Quarry worker's creed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.