all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jambunathan K <kjambunathan@gmail.com>
To: Dushyant Juneja <juneja.dushyant@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Intelligently opening large files in emacs
Date: Tue, 18 Mar 2014 20:35:36 +0530	[thread overview]
Message-ID: <87fvmf35tr.fsf@gmail.com> (raw)
In-Reply-To: <CAJkb0UMEPuj38G3NAjtfCyjmr25QtshqOstSn8hcGfUncuytQw@mail.gmail.com> (Dushyant Juneja's message of "Tue, 18 Mar 2014 15:21:16 +0530")

Dushyant Juneja <juneja.dushyant@gmail.com> writes:

> My question hence is, is there a way to integrate find-file-literally
> in a way that emacs automatically opens large files using this
> function, and the smaller files using the usual find-file. Please help
> me if such is possible.

Feel free to steal from the snippet below.  (Remember to alter 1e3 apart
from other things).

    (defun my-find-file (filename)
      (interactive "fFile name:")
      (let ((size-in-bytes (nth 7 (file-attributes filename))))
        (if (< size-in-bytes 1e3)
            (find-file-literally filename)
          (vlf filename))))



  reply	other threads:[~2014-03-18 15:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-18  7:20 Intelligently opening large files in emacs Dushyant Juneja
2014-03-18  8:37 ` Jambunathan K
2014-03-18  9:51   ` Dushyant Juneja
2014-03-18 15:05     ` Jambunathan K [this message]
2014-03-18 16:55     ` Eli Zaretskii
2014-03-19  0:25       ` Stefan
     [not found]     ` <mailman.17438.1395161765.10748.help-gnu-emacs@gnu.org>
2014-03-18 18:25       ` Bug Dout
     [not found]   ` <mailman.17417.1395136301.10748.help-gnu-emacs@gnu.org>
2014-03-18 16:45     ` Felix Dietrich
2014-03-19  0:29 ` Stefan
2014-03-19  4:52   ` Marcin Borkowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fvmf35tr.fsf@gmail.com \
    --to=kjambunathan@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=juneja.dushyant@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.