aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2018-04-15 21:03:34 +0200
committerLars Ingebrigtsen2018-04-15 21:03:34 +0200
commit2e1caf3254ba6bf6bd764b60b24e298995ec2cb9 (patch)
tree34806a8e1f7cee8234c32cc6b9cf351344c91e62
parentb72de45eb00b6a1c35a3d11914fb862ebb30034a (diff)
downloademacs-2e1caf3254ba6bf6bd764b60b24e298995ec2cb9.tar.gz
emacs-2e1caf3254ba6bf6bd764b60b24e298995ec2cb9.zip
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.
-rw-r--r--lisp/files.el2
1 files changed, 2 insertions, 0 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 67a9abfa764..d98d09bb1e3 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."
2019OP-TYPE specifies the file operation being performed (for message to user)." 2019OP-TYPE specifies the file operation being performed (for message to user)."
2020 (when (and large-file-warning-threshold size 2020 (when (and large-file-warning-threshold size
2021 (> size large-file-warning-threshold) 2021 (> size large-file-warning-threshold)
2022 ;; No point in warning if we can't read it.
2023 (file-readable-p filename)
2022 (not (y-or-n-p (format "File %s is large (%s), really %s? " 2024 (not (y-or-n-p (format "File %s is large (%s), really %s? "
2023 (file-name-nondirectory filename) 2025 (file-name-nondirectory filename)
2024 (file-size-human-readable size) op-type)))) 2026 (file-size-human-readable size) op-type))))