[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Disabling a mode based on the size of a buffer?
From: |
Tim Visher |
Subject: |
Re: Disabling a mode based on the size of a buffer? |
Date: |
Wed, 21 Aug 2013 10:11:17 -0400 |
On Tue, Aug 20, 2013 at 9:41 PM, Juanma Barranquero <lekktu@gmail.com> wrote:
> On Tue, Aug 20, 2013 at 7:08 PM, Tim Visher <tim.visher@gmail.com> 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