From: Tim Visher <tim.visher@gmail.com>
To: Juanma Barranquero <lekktu@gmail.com>
Cc: emacs <help-gnu-emacs@gnu.org>
Subject: Re: Disabling a mode based on the size of a buffer?
Date: Wed, 21 Aug 2013 10:11:17 -0400 [thread overview]
Message-ID: <CAHa53uy6FwKM77C31PA_rNVLwnkG5g5fY4XXvOPVfr3Lv0mWgA@mail.gmail.com> (raw)
In-Reply-To: <CAAeL0SQv1MnE2Q=MD4vVe+o-F++BGrTtsoQbKhjAt2UDoGSRKA@mail.gmail.com>
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
next prev parent reply other threads:[~2013-08-21 14:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-20 17:08 Disabling a mode based on the size of a buffer? Tim Visher
2013-08-20 21:44 ` Michael Heerdegen
2013-08-21 14:10 ` Tim Visher
2013-08-22 5:25 ` Julien Cubizolles
2013-08-21 1:41 ` Juanma Barranquero
2013-08-21 14:11 ` Tim Visher [this message]
[not found] ` <mailman.451.1377049349.10748.help-gnu-emacs@gnu.org>
2013-08-25 13:52 ` Stefan Monnier
2013-08-25 21:00 ` Juanma Barranquero
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAHa53uy6FwKM77C31PA_rNVLwnkG5g5fY4XXvOPVfr3Lv0mWgA@mail.gmail.com \
--to=tim.visher@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=lekktu@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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).