emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/files.el,v


From: Eli Zaretskii
Subject: [Emacs-diffs] Changes to emacs/lisp/files.el,v
Date: Fri, 08 Dec 2006 18:05:13 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Eli Zaretskii <eliz>    06/12/08 18:05:12

Index: files.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/files.el,v
retrieving revision 1.866
retrieving revision 1.867
diff -u -b -r1.866 -r1.867
--- files.el    28 Nov 2006 02:20:32 -0000      1.866
+++ files.el    8 Dec 2006 18:05:12 -0000       1.867
@@ -1695,6 +1695,16 @@
   (if (file-directory-p filename)
       (signal 'file-error (list "Opening input file" "file is a directory"
                                 filename)))
+  ;; Check whether the file is uncommonly large (see find-file-noselect):
+  (let (size)
+    (when (and large-file-warning-threshold
+              (setq size (nth 7 (file-attributes filename)))
+              (> size large-file-warning-threshold)
+              (not (y-or-n-p
+                    (format "File %s is large (%dMB), really insert? "
+                            (file-name-nondirectory filename)
+                            (/ size 1048576)))))
+      (error "Aborted")))
   (let* ((buffer (find-buffer-visiting (abbreviate-file-name (file-truename 
filename))
                                        #'buffer-modified-p))
          (tem (funcall insert-func filename)))




reply via email to

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