From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Richard M. Stallman" Newsgroups: gmane.emacs.devel Subject: Re: Global Font Lock by default Date: Sun, 30 Oct 2005 09:52:45 -0500 Message-ID: References: Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1130688254 7405 80.91.229.2 (30 Oct 2005 16:04:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 30 Oct 2005 16:04:14 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 30 17:04:07 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EWFdi-0001Dc-1h for ged-emacs-devel@m.gmane.org; Sun, 30 Oct 2005 17:02:34 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EWFdh-0002LH-9Q for ged-emacs-devel@m.gmane.org; Sun, 30 Oct 2005 11:02:33 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EWEaA-0006dp-48 for emacs-devel@gnu.org; Sun, 30 Oct 2005 09:54:50 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EWEYA-0005q0-Il for emacs-devel@gnu.org; Sun, 30 Oct 2005 09:52:46 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EWEYA-0005ps-AN for emacs-devel@gnu.org; Sun, 30 Oct 2005 09:52:46 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EWEYA-0000ye-JM for emacs-devel@gnu.org; Sun, 30 Oct 2005 09:52:46 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1EWEY9-0005bS-8d; Sun, 30 Oct 2005 09:52:45 -0500 Original-To: storm@cua.dk (Kim F. Storm) In-reply-to: (storm@cua.dk) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:45138 Archived-At: > However, this does not work. The reason is that the value > of BYTES_USED, which I believe is obtained from mallinfo, > does not seem to decrease even when a large buffer is killed. This approach is probably not very protable. It is only used with DOUG_LEA_MALLOC, but that case is very important, since it is used on GNU/Linux. Can't you just try to malloc (and free) 10000 bytes, and report MEM FULL if it fails? It already does that; the issue here is what to do afterward. The idea is that when more memory is available Emacs should refill its memory reserve. The question is how to tell when more memory is available. Maybe you could add a "memory-full-hook" which could contain functions to be run when memory runs full -- this could involve turning off font-lock, kill some buffers (which?), and other things that may free up memory. That part is done--I made these things test `memory-full'. I found the mallinfo information and fixed the problem. I think this works now. So now I think we are ready to enable font-lock by default. Would someone like to do that?