From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: Undo-limit default Date: Sun, 07 Dec 2008 10:07:18 -0500 Message-ID: <87bpvo58ih.fsf@cyd.mit.edu> References: <873ah0n4xc.fsf@cyd.mit.edu> <493BC963.3000907@gmx.at> <493BCDB2.1010001@gmx.at> <87vdtwf43c.fsf@cyd.mit.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1228663486 14989 80.91.229.12 (7 Dec 2008 15:24:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 7 Dec 2008 15:24:46 +0000 (UTC) Cc: Lennart Borgman , emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 07 16:25:51 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L9LW2-0007g8-GZ for ged-emacs-devel@m.gmane.org; Sun, 07 Dec 2008 16:25:50 +0100 Original-Received: from localhost ([127.0.0.1]:43329 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L9LUr-0005wM-C3 for ged-emacs-devel@m.gmane.org; Sun, 07 Dec 2008 10:24:37 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L9LE4-0003vM-DN for emacs-devel@gnu.org; Sun, 07 Dec 2008 10:07:16 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L9LE3-0003ux-PC for emacs-devel@gnu.org; Sun, 07 Dec 2008 10:07:16 -0500 Original-Received: from [199.232.76.173] (port=56430 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L9LE3-0003ut-85 for emacs-devel@gnu.org; Sun, 07 Dec 2008 10:07:15 -0500 Original-Received: from cyd.mit.edu ([18.115.2.24]:36962) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L9LE2-00074S-TL for emacs-devel@gnu.org; Sun, 07 Dec 2008 10:07:14 -0500 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id B180557E1D3; Sun, 7 Dec 2008 10:07:18 -0500 (EST) In-Reply-To: <87vdtwf43c.fsf@cyd.mit.edu> (Chong Yidong's message of "Sun, 07 Dec 2008 09:32:39 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:106653 Archived-At: Chong Yidong writes: > Could you check whether stripping out the font-lock information has any > bad effects? The following untested patch should implement this > behavior: Whoops, too untested :-P Try this patch instead: *** trunk/src/undo.c.~1.86.~ 2008-09-24 23:23:04.000000000 -0400 --- trunk/src/undo.c 2008-12-07 10:05:52.000000000 -0500 *************** *** 60,65 **** --- 60,69 ---- int undo_inhibit_record_point; + /* Text properties not recorded in the undo list. */ + + Lisp_Object Vundo_discarded_text_properties; + /* Record point as it was at beginning of this command (if necessary) and prepare the undo info for recording a change. PT is the position of point that will naturally occur as a result of the *************** *** 174,179 **** --- 178,187 ---- if (EQ (current_buffer->undo_list, Qt)) return; + Fremove_text_properties (make_number (0), make_number (SCHARS (string)), + Vundo_discarded_text_properties, + string); + if (PT == beg + SCHARS (string)) { XSETINT (sbeg, -beg); *************** *** 734,739 **** --- 742,757 ---- DEFVAR_BOOL ("undo-inhibit-record-point", &undo_inhibit_record_point, doc: /* Non-nil means do not record `point' in `buffer-undo-list'. */); undo_inhibit_record_point = 0; + + DEFVAR_LISP ("undo-discarded-text-properties", &Vundo_discarded_text_properties, + doc: /* Text properties not recorded in the undo list. + This should be a property list whose property names specify the + properties to remove. (The values stored in the property list are + ignored.) */); + Vundo_discarded_text_properties + = list4 (intern ("fontified"), Qnil, + intern ("jit-lock-defer-multiline"), Qnil); + staticpro (&Vundo_discarded_text_properties); } /* arch-tag: d546ee01-4aed-4ffb-bb8b-eefaae50d38a