emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 2e1caf3: Don't warn the user about large files if t


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master 2e1caf3: Don't warn the user about large files if they are unreadable
Date: Sun, 15 Apr 2018 15:24:49 -0400 (EDT)

branch: master
commit 2e1caf3254ba6bf6bd764b60b24e298995ec2cb9
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Don't warn the user about large files if they are unreadable
    
    * lisp/files.el (abort-if-file-too-large): There's no point in
    warning the user about a too-large file if we're not able to read
    it (bug#29549).  Hopefully this doesn't introduce a race condition
    between this test and the `file-readable-p' test later.
---
 lisp/files.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lisp/files.el b/lisp/files.el
index 67a9abf..d98d09b 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2019,6 +2019,8 @@ think it does, because \"free\" is pretty hard to define 
in practice."
 OP-TYPE specifies the file operation being performed (for message to user)."
   (when (and large-file-warning-threshold size
             (> size large-file-warning-threshold)
+             ;; No point in warning if we can't read it.
+             (file-readable-p filename)
             (not (y-or-n-p (format "File %s is large (%s), really %s? "
                                    (file-name-nondirectory filename)
                                    (file-size-human-readable size) op-type))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]