From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jambunathan K Newsgroups: gmane.emacs.help Subject: Re: Intelligently opening large files in emacs Date: Tue, 18 Mar 2014 20:35:36 +0530 Message-ID: <87fvmf35tr.fsf@gmail.com> References: <877g7rrjgw.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1395155293 28651 80.91.229.3 (18 Mar 2014 15:08:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 18 Mar 2014 15:08:13 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Dushyant Juneja Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 18 16:08:22 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WPvcr-0000Ty-0o for geh-help-gnu-emacs@m.gmane.org; Tue, 18 Mar 2014 16:08:21 +0100 Original-Received: from localhost ([::1]:35853 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPvcq-0006V2-Hk for geh-help-gnu-emacs@m.gmane.org; Tue, 18 Mar 2014 11:08:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58163) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPvcW-0006Tq-5x for help-gnu-emacs@gnu.org; Tue, 18 Mar 2014 11:08:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WPvcN-0007XI-N3 for help-gnu-emacs@gnu.org; Tue, 18 Mar 2014 11:08:00 -0400 Original-Received: from mail-pb0-x234.google.com ([2607:f8b0:400e:c01::234]:52854) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPvcN-0007X6-Fp for help-gnu-emacs@gnu.org; Tue, 18 Mar 2014 11:07:51 -0400 Original-Received: by mail-pb0-f52.google.com with SMTP id rr13so7445624pbb.11 for ; Tue, 18 Mar 2014 08:07:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=nblOTYTQli8ZZLPN7LhT7L8dLSx3WJbSVma0Mt439AY=; b=eG0hs8/7jCbfs4HDpYJDuUtsfFZVGqD5yhd3EXZgY3AiQaFSlcCOkoq+dOrImlR7px QNe8I5X3NUwqUKwrfsw0jTklu9cMqhOreWbtELIVA4gibXTEi3JwJh6t3QO18fVJaJV3 Susnv0G+dTd2RkEmScfoN0LzZBKUTlStSNWz7J81XFdkiRyzpcZ6FTIMKSRebww1+Tf5 rAN9KAJmxxBQ0iAXENDSi9qOghJCxaya3/8eIIJzDM1H1aX6IdHr/iRinijTJmsIQYn9 Q0hQuBRDGcRSSIie0E+ZY3E+plBs9f/JLmu3NiNf2UKTcyq4fx++ezm83yMVh2fPv6se bLFg== X-Received: by 10.66.226.145 with SMTP id rs17mr11023389pac.144.1395155270402; Tue, 18 Mar 2014 08:07:50 -0700 (PDT) Original-Received: from debian-6.05 ([101.63.194.115]) by mx.google.com with ESMTPSA id fn2sm89099034pab.38.2014.03.18.08.07.46 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Tue, 18 Mar 2014 08:07:48 -0700 (PDT) In-Reply-To: (Dushyant Juneja's message of "Tue, 18 Mar 2014 15:21:16 +0530") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c01::234 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:96583 Archived-At: Dushyant Juneja 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))))