From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.help Subject: Re: Disabling a mode based on the size of a buffer? Date: Wed, 21 Aug 2013 03:41:42 +0200 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 1377049355 23362 80.91.229.3 (21 Aug 2013 01:42:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 21 Aug 2013 01:42:35 +0000 (UTC) Cc: emacs To: Tim Visher Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Aug 21 03:42:38 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 1VBxRW-0003LM-Dz for geh-help-gnu-emacs@m.gmane.org; Wed, 21 Aug 2013 03:42:38 +0200 Original-Received: from localhost ([::1]:51001 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBxRV-0005MQ-Fj for geh-help-gnu-emacs@m.gmane.org; Tue, 20 Aug 2013 21:42:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55897) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBxRJ-0005MF-Mx for help-gnu-emacs@gnu.org; Tue, 20 Aug 2013 21:42:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VBxRI-0007yp-BE for help-gnu-emacs@gnu.org; Tue, 20 Aug 2013 21:42:25 -0400 Original-Received: from mail-ea0-x22f.google.com ([2a00:1450:4013:c01::22f]:56132) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBxRI-0007yj-4u for help-gnu-emacs@gnu.org; Tue, 20 Aug 2013 21:42:24 -0400 Original-Received: by mail-ea0-f175.google.com with SMTP id m14so525744eaj.34 for ; Tue, 20 Aug 2013 18:42:23 -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=K8OW9T1yNe2Ax8KL3n4vxaqXwTIs8rB7lj493TRScVo=; b=gv1JjZCfdczx6YSMAs/zemKmKwR+ZABixVIXbhTv1bKieVlytyccTMMJozxDUH1a5J OaduhPB1jdtqhw612K9/8l5Krx7dwwmxwDiL3PSRA7ijlLARIkcvGW49C/sWz/OS+OoD GMxPSZh9I2LeuxVUtrdHPjZ1wMuIikrl23ZW/b5LtpClT591iOSd4qXmQej+rBV7LuDj pyNT3JYi2fSteJ+1Xlyg3BK/uZKa9JJx42DgQkSFK2hh/7QtzGQFaT2bKlfAC4UTJEVo fvo1lW+7Qll0kOjdEWT1sGKPIDw4gQ91SUPRTuV8HGPlnKO8D/vxiO9yb3dAUQSoUgVM 1Khg== X-Received: by 10.14.174.195 with SMTP id x43mr6022535eel.47.1377049342982; Tue, 20 Aug 2013 18:42:22 -0700 (PDT) Original-Received: by 10.14.133.15 with HTTP; Tue, 20 Aug 2013 18:41:42 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c01::22f 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:93018 Archived-At: 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) HTH, J