ergoemacs/ergoemacs-mode

Freezing when Killing buffers...

mattfidler opened this issue · 11 comments

Found another small, but pretty baffling issue that happens when you have icicles and ergoemacs together. I have this function in my init that i use sometimes:

(defun delete-this-buffer-and-file ()
  "Removes file connected to current buffer and kills buffer."
  (interactive)
  (let ((filename (buffer-file-name))
        (buffer (current-buffer))
        (name (buffer-name)))
    (if (not (and filename (file-exists-p filename)))
        (error "Buffer '%s' is not visiting a file!" name)
      (when (yes-or-no-p "Are you sure you want to remove this file? ")
        (delete-file filename)
        (kill-buffer buffer)
        (message "File '%s' successfully removed" filename)))))

With ergoemacs+icicles this freezes emacs to death.

See Issue #372 @sg2002

This command works with ergoemacs-mode alone.

This command also works with icy-mode alone.

I enabled icy-mode and ergoemacs-mode and this command still works... I cannot reproduce this bug.

You could try

(defun delete-this-buffer-and-file ()
  "Removes file connected to current buffer and kills buffer."
  (interactive)
  (let ((filename (buffer-file-name))
        (buffer (current-buffer))
        (name (buffer-name)))
    (if (not (and filename (file-exists-p filename)))
        (error "Buffer '%s' is not visiting a file!" name)
      (when (yes-or-no-p "Are you sure you want to remove this file? ")
        (kill-buffer buffer)
        (delete-file filename)
        (message "File '%s' successfully removed" filename)))))

It makes no sense to me to delete the file until after the buffer is killed.

Happens for me with a basic config:

(require 'ergoemacs-mode)
(ergoemacs-mode 1)
(require 'icicles)
(icy-mode 1)
(defun test-freeze ()
  (interactive)
  (yes-or-no-p "Are you sure you want to remove this file? "))

Freeze happens only when both icicles and ergoemacs are enabled. Also it happens only when the function is called interactively.

Since you're probably using 25 beta, decided to test with it too, yep still happens with a recent nightly. Also tried 24.5 w64.

Normally I'm using official 24.5 32bit on windows.

I use 24.5 windows 32. I didn't have any issues yesterday.

On Wed, Mar 16, 2016, 12:51 PM sg2002 notifications@github.com wrote:

Happens for me with a basic config:

(require 'ergoemacs-mode)
(ergoemacs-mode 1)
(require 'icicles)
(icy-mode 1)
(defun test-freeze ()
(interactive)
(yes-or-no-p "Are you sure you want to remove this file? "))

Freeze happens only when both icicles and ergoemacs are enabled. Also it
happens only when the function is called interactively.

Since you're probably using 25 beta, decided to test with it too, yep
still happens with a recent nightly. Also tried 24.5 w64.

Normally I'm using official 24.5 32bit on windows.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#407 (comment)

I didn't call the function interactivly....

I called the function interactively in a basic evironment and cannot reproduce your error.

My environment can be duplicated by:

(require 'ergoemacs-mode)
(require 'ergoemacs-test)
(ergoemacs-mode 1)

Then interactivly calling ergoemacs-test-require-input. From there you can test the interactive call by C-1.

The code that is run is:

(add-to-list 'load-path "ergoemacs-mode")
(add-to-list 'load-path "icicles")
(eval-when-compile (require 'ergoemacs-macros) (require 'cl))
(setq ergoemacs-theme nil)
(setq ergoemacs-keyboard-layout "us")
(require 'ergoemacs-mode)
(ergoemacs-mode 1)
(require 'icicles)
(icy-mode 1)
(defun test-freeze ()
  (interactive)
  (yes-or-no-p "Are you sure you want to remove this file? "))
(global-set-key (kbd "C-1") 'test-freeze)
(insert "Try C-1 to see if emacs freezes.")

I run emacs -debug-init -Q -l compiled-file

C-1 works, but if I do M-a test-freeze from within the unit test emacs, the freeze happens.

I reproduced the behavior. It only occurs when calling from icicles M-a.

Please make sure this works for you.