Emacs: how to disable ‘file changed on disk’ checking?

http://stackoverflow.com/questions/2284703/emacs-how-to-disable-file-changed-on-disk-checking

Emacs is really trying to help you here. Read the info page on Protection against Simultaneous Editing.

But, if you still want to avoid that message/prompt, you can redefine the function that is doing the prompting:

(defun ask-user-about-supersession-threat (fn)
  "blatantly ignore files that changed on disk"
  )
(defun ask-user-about-lock (file opponent)
  "always grab lock"
   t)

The second function there is for when two people are using Emacs to edit the same file, and would provide a similar prompt (but not the one you seemed to refer to in the question).

I’d advise against overriding the two routines, but it’s there if you want.


On the off chance global-auto-revert-mode is on, you could disable that. Add this to your .emacs:

(global-auto-revert-mode -1)

You can tell if the mode is on by looking at the variable of the same name:

C-h v global-auto-revert-mode RET

If the value is t, then the mode is on, otherwise it is off.

shareedit
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s