Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs hangs when a file has changed on disk

Tags:

emacs

windows

I'm using Emacs v24.3.1 on Windows 8.

I had a file change on disk while I had an Emacs buffer open with that file. As soon as I attempt to make a change to the buffer, a message appears in the minibuffer.

Fileblah.txt changed on disk; really edit the buffer? (y, n, r or C-h) 

I would expect to be able to hit r to have it reload the disk version of the file, but nothing happens. Emacs completely stops responding to input. None of the listed keys work, nor do any other keys as far as I can tell. I can't C-g out of the minibuffer. Alt-F4 doesn't work, not does Close window from the task bar. I have to kill the process from task manager.

Anyone have any idea what I'm doing wrong here?

In cases it's various modes not playing nice with each other, for reference, my init.el is here. Nothing complex. Here's the breakdown:

  • better-defaults (ido-mode, remove menu-bar, uniquify buffer `forward, saveplace)
  • recentf-mode
  • custom frame title
  • visual-line-mode
  • require final newline and delete trailing whitespace on save
  • Markdown mode with auto-mode-alist
  • Flyspell with Aspell backend
  • Powershell mode with auto-mode-alist
  • Ruby auto-mode-alist
  • Puppet mode with auto-mode-alist
  • Feature (Gherkin) mode with auto-mode-alist

The specific file was a markdown file with Github-flavored Markdown mode and Flyspell mode enabled.

like image 410
recf Avatar asked Oct 20 '22 02:10

recf


1 Answers

As indicated in the comments of the question, the problem is caused by markdown-mode, and has not been fixed as of this answer (23 April 2015).

I found a workaround online however. I'm reproducing it here for posterity.

(defun leo-markdown-fontify-buffer-wiki-links-empty ()
  "Empty replacement for `markdown-fontify-buffer-wiki-links` due to hanging bug."
  (interactive))

(eval-after-load "markdown-mode"
    '(progn
       (fset 'markdown-fontify-buffer-wiki-links
             'leo-markdown-fontify-buffer-wiki-links-empty)))
like image 60
Norswap Avatar answered Oct 30 '22 22:10

Norswap