help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Emacs22 large file y-or-n-p


From: Kevin Rodgers
Subject: Re: Emacs22 large file y-or-n-p
Date: Wed, 14 Jun 2006 09:58:13 -0600
User-agent: Thunderbird 1.5.0.4 (Windows/20060516)

Brendan Halpin wrote:
Pascal Bourguignon <address@hidden> writes:

Really Brendan!  M-x apropos RET large.*file RET

That doesn't tell me anything that wasn't clear from files.el --
I'm looking for a way to create a single exception, not turn it
off.

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)))

--
Kevin





reply via email to

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