query for large object display

Rodney Sparapani rsparapa at post.its.mcw.edu
Tue Jan 15 17:07:28 CET 2002


Ben:

Not by default.  But, I run into this problem all the time so I have the 
following in my .emacs:

(defvar big-file-limit 400000)

(defadvice find-file (before huge-file-protection activate)
  (let* ((big-file-list (file-attributes filename))
         (big-file-size (nth 7 big-file-list)))

  (if big-file-list  
     (progn
      (if (or (equal big-file-size -1) (> big-file-size big-file-limit)) (progn
        (shell-command (concat "head -10000 " filename " > " filename "00"))
      (message "WARNING: only showing first 10000 lines of %s." filename)
      (setq filename (concat filename "00"))))))
))

Rodney

>Date: Tue, 15 Jan 2002 11:03:25 -0500 (EST)
>From: Ben Shoemaker <shoemake at ncbi.nlm.nih.gov>
>X-X-Sender: shoemake at scarecrow
>To: ess-help at stat.math.ethz.ch
>Subject: query for large object display
>MIME-Version: 1.0
>
>
>Hi,
>
>I use ESS version 5.1.19 in xemacs 20.4 and am very happy with it.
>Occasionally, however, I type an object's name and forget to explore first
>if it's a large object.  If it is, it causes xemacs to freeze up,
>sometimes indefinitely while it's trying to dump all of the data to the
>buffer.  Is there a variable to set which would query yes/no (or simply
>refuse to do it) if the object is beyond a certain size?
>
>Thanks in advance,
>
>Ben
>
>
>-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
>ess-help mailing list -- To (un)subscribe, send
>subscribe	or	unsubscribe
>(in the "body", not the subject !)  To: ess-help-request at stat.math.ethz.ch
>_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

Rodney Sparapani              Medical College of Wisconsin
Sr. Biostatistician           Patient Care & Outcomes Research (PCOR)
rsparapa at mcw.edu              http://www.mcw.edu/pcor
Was 'Name That Tune' rigged?  WWLD -- What Would Lombardi Do

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
ess-help mailing list -- To (un)subscribe, send
subscribe	or	unsubscribe
(in the "body", not the subject !)  To: ess-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the ESS-help mailing list