Last active
December 18, 2015 03:48
-
-
Save hirofumi/5720246 to your computer and use it in GitHub Desktop.
Call ask-user-about-supersession-threat only if the buffer is actually obsolete.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defadvice ask-user-about-supersession-threat (around ask-user-about-supersession-threat-if-necessary) | |
"Call ask-user-about-supersession-threat only if the buffer is actually obsolete." | |
(if (or (buffer-modified-p) | |
(verify-visited-file-modtime) | |
(< (* 8 1024 1024) (buffer-size)) | |
(/= 0 (call-process-region 1 (+ 1 (buffer-size)) "diff" nil nil nil "-q" (buffer-file-name) "-"))) | |
ad-do-it | |
(clear-visited-file-modtime) | |
(not-modified))) | |
(ad-activate 'ask-user-about-supersession-threat) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment