[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs22 large file y-or-n-p
From: |
Brendan Halpin |
Subject: |
Re: Emacs22 large file y-or-n-p |
Date: |
Wed, 14 Jun 2006 17:08:01 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
Kevin Rodgers <ihs_4664@yahoo.com> 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