From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim Visher Newsgroups: gmane.emacs.help Subject: Re: Disabling a mode based on the size of a buffer? Date: Wed, 21 Aug 2013 10:11:17 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1377094354 4299 80.91.229.3 (21 Aug 2013 14:12:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 21 Aug 2013 14:12:34 +0000 (UTC) Cc: emacs To: Juanma Barranquero Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Aug 21 16:12:37 2013 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 1VC99H-0006nX-SS for geh-help-gnu-emacs@m.gmane.org; Wed, 21 Aug 2013 16:12:35 +0200 Original-Received: from localhost ([::1]:53970 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VC99H-0003uJ-Eq for geh-help-gnu-emacs@m.gmane.org; Wed, 21 Aug 2013 10:12:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48525) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VC98l-0003RC-8C for help-gnu-emacs@gnu.org; Wed, 21 Aug 2013 10:12:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VC98g-0000GB-Ks for help-gnu-emacs@gnu.org; Wed, 21 Aug 2013 10:12:03 -0400 Original-Received: from mail-vb0-x236.google.com ([2607:f8b0:400c:c02::236]:55553) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VC98g-0000G3-9W for help-gnu-emacs@gnu.org; Wed, 21 Aug 2013 10:11:58 -0400 Original-Received: by mail-vb0-f54.google.com with SMTP id q14so351115vbe.27 for ; Wed, 21 Aug 2013 07:11:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=xEf0GvYjLnVoP0ALyY0DBXWgpoRgoiWYgvtxSOut5IE=; b=AJyeFG1MgEmk+gIaSBTW8E7cSjFa5HvylARFtqCVUYe58a+hhK6hUouTi5vcdfRy0M Hna0Z9NQj+GnGuGxEcVQ9lkUCvXEadCqTAKZPrX9uN5VXG16GsYDy0zJM2aGWl/wuvWq k/kCvwjEgNbcjxQWMwTyv/I95OmJbgCFETjbr5yrAI66ldTyZeshOAYt+xyyR3xouz+D fDPpm1aKUSAd2cAj0hqPZJ04UNwEhNhforbDx55HjJyywT3jdd1ilSBlMpivtcDS6uZr UgPsroPowtLQQvJbU1LICL1mEWktqb/f3YTWtCqNkabjCfsxZ2mIVLj7b/su8iOQKeQt J9dQ== X-Received: by 10.52.73.135 with SMTP id l7mr5760810vdv.9.1377094317730; Wed, 21 Aug 2013 07:11:57 -0700 (PDT) Original-Received: by 10.221.54.129 with HTTP; Wed, 21 Aug 2013 07:11:17 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400c:c02::236 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:93029 Archived-At: On Tue, Aug 20, 2013 at 9:41 PM, Juanma Barranquero wrote: > On Tue, Aug 20, 2013 at 7:08 PM, Tim Visher wrote: > >> I'm basically wondering if there are predefined hooks with which I can >> make a decision to disable said modes if a buffer has reached a >> certain size limit. > > Not very sofisticate: > > (add-hook 'after-change-functions > (lambda (&rest _ignore) > (when (> (buffer-size) 1000000) > (fundamental-mode))) > nil t) That'd do it. :) -- In Christ, Timmy V. http://blog.twonegatives.com/ http://five.sentenc.es/ -- Spend less time on mail