From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mathias Dahl Newsgroups: gmane.emacs.help Subject: Re: Emacs22 large file y-or-n-p Date: Wed, 14 Jun 2006 11:50:45 +0200 Message-ID: References: <87zmgg63vb.fsf@wivenhoe.staff8.ul.ie> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1150281639 19035 80.91.229.2 (14 Jun 2006 10:40:39 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 14 Jun 2006 10:40:39 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 14 12:40:34 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FqSnY-0005yI-Pr for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Jun 2006 12:40:33 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FqSnY-0007XD-8F for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Jun 2006 06:40:32 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 66 Original-X-Trace: individual.net GXo7jkqlmJtkovo0Vd97eAe26CgqU43aEPin2sv7ZPkgFMMwXl User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt) Cancel-Lock: sha1:WFa6JTzH+Cn4TtDcrhIcAIrhFRE= Original-Xref: shelby.stanford.edu gnu.emacs.help:139835 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:35459 Archived-At: Brendan Halpin writes: > Is there a lightweight way to avoid the check for RMAIL? I've > looked at the code (for find-file-noselect) and that permits > different size thresholds (and turning the check off altogether). > > Would defadvice around the rmail defun provide a handle? e.g. > temporarily raise the threshold variable's value to 100MB and > revert it afterwards? If I had this problem I would have hacked rmail.el, doing the below, or similar. Changed this: (let ((enable-local-variables nil)) (find-file-noselect file-name)) to this: (let ((large-file-warning-threshold nil) (enable-local-variables nil)) (find-file-noselect file-name)) or maybe to this: (let ((large-file-warning-threshold 40000000) (enable-local-variables nil)) (find-file-noselect file-name)) Or, in this code in files.el: (when (and large-file-warning-threshold (nth 7 attributes) ;; Don't ask again if we already have the file or ;; if we're asked to be quiet. ;;;;;;;; NEW CHECK STARTS HERE (not (string-match large-file-warning-exceptions filename)) ;;;;;;;; NEW CHECK ENDS HERE (not (or buf nowarn)) (> (nth 7 attributes) large-file-warning-threshold) (not (y-or-n-p (format "File %s is large (%dMB), really open? " (file-name-nondirectory filename) (/ (nth 7 attributes) 1048576))))) ;; New variable (defvar large-file-warning-exceptions nil "Regexp matching files that wont get their size checked") ;; And in your .emacs (setq large-file-warning-exceptions "my_rmail_file_regexp") This is probably the best solution in that it is more general. But I would not recommend changing Emacs "internal" lisp files in case you are prepared to get into trouble when new versions come. Or use the defadvice adviced (haha) by some people here. /Mathias