From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Brendan Halpin Newsgroups: gmane.emacs.help Subject: Re: Emacs22 large file y-or-n-p Date: Wed, 14 Jun 2006 17:08:01 +0100 Message-ID: <87pshb7mam.fsf@wivenhoe.staff8.ul.ie> References: <87zmgg63vb.fsf@wivenhoe.staff8.ul.ie> <87ver4wq22.fsf@thalassa.informatimago.com> <87slm82l0n.fsf@wivenhoe.staff8.ul.ie> Reply-To: brendan.halpin@ul.ie NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1150303306 6096 80.91.229.2 (14 Jun 2006 16:41:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 14 Jun 2006 16:41:46 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 14 18:41:39 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 1FqYQt-00081Z-Ud for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Jun 2006 18:41:32 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FqYQt-0004ry-DJ for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Jun 2006 12:41:31 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon06.news.prodigy.com!prodigy.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 37 Original-X-Trace: individual.net NjBdqQx24OGPQRzZ8BsUwQ7XxpSFiBuVl7hTyAtwOibuRDbgJR User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:/72d0MPRo+tlttoiLh660BI5kd0= Original-Xref: shelby.stanford.edu gnu.emacs.help:139849 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:35473 Archived-At: Kevin Rodgers writes: > Untested: > > (defvar large-file-warning-threshold-exceptions nil > "A list of regexps matching names of large files to be visited > without query. > This temporarily overrides `large-file-warning-threshold'.") > > (defadvice find-file-noselect (around > large-file-warning-threshold-exceptions > activate) > "Respect `large-file-warning-threshold-exceptions'." > (let ((large-file-warning-threshold > (if (and large-file-warning-threshold-exceptions > (catch 'any > (mapc (lambda (regexp) > (when (string-match regexp (ad-get-arg 0)) > (throw 'any t))) > large-file-warning-threshold-exceptions) > nil)) > nil ; disabled > large-file-warning-threshold))) > (ad-do-it))) I like it. I hacked something defadvice-ing M-x rmail, but this is more general. The only downside is that defadvice makes understanding program behaviour more difficult. Brendan -- Brendan Halpin, Department of Sociology, University of Limerick, Ireland Tel: w +353-61-213147 f +353-61-202569 h +353-61-338562; Room F2-025 x 3147 mailto:brendan.halpin@ul.ie http://www.ul.ie/sociology/brendan.halpin.html