unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Chong Yidong <cyd@stupidchicken.com>
To: martin rudalics <rudalics@gmx.at>
Cc: Lennart Borgman <lennart.borgman@gmail.com>, emacs-devel@gnu.org
Subject: Re: Undo-limit default
Date: Sun, 07 Dec 2008 09:32:39 -0500	[thread overview]
Message-ID: <87vdtwf43c.fsf@cyd.mit.edu> (raw)
In-Reply-To: <493BCDB2.1010001@gmx.at> (martin rudalics's message of "Sun, 07 Dec 2008 14:20:50 +0100")

martin rudalics <rudalics@gmx.at> writes:

>> I thought that the `fontified' property did not go into the undo-list.
>> Are not the calls changing that property surrounded by macros that
>> should prevent that?
>
> Only those of font-lock itself.
>
>> What major modes do you see this in?
>
> All font-locked ones.  The property is stored as a text property and
> shows up whenever you delete or reinsert corresponding text.
>
> IMHO putting any font-lock handled property on the undo-list is harmful.

Could you check whether stripping out the font-lock information has any
bad effects?  The following untested patch should implement this
behavior:

*** trunk/src/undo.c.~1.86.~	2008-09-22 11:47:50.000000000 -0400
--- trunk/src/undo.c	2008-12-07 09:25:53.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
***************
*** 171,176 ****
--- 175,184 ----
  {
    Lisp_Object sbeg;
  
+   string = Fremove_text_properties (0, SCHARS (string),
+ 				    Vundo_discarded_text_properties,
+ 				    string);
+ 
    if (EQ (current_buffer->undo_list, Qt))
      return;
  
***************
*** 734,739 ****
--- 742,756 ----
    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_INT ("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 nil"), Qnil,
+ 					   intern ("jit-lock-defer-multiline"), Qnil);
+   staticpro (&Vundo_discarded_text_properties);
  }
  
  /* arch-tag: d546ee01-4aed-4ffb-bb8b-eefaae50d38a




  reply	other threads:[~2008-12-07 14:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-07  1:35 Undo-limit default Chong Yidong
2008-12-07  2:06 ` Michael Ekstrand
2008-12-07  2:12 ` Lennart Borgman
2008-12-07  8:15 ` Dan Nicolaescu
2008-12-07 13:02 ` martin rudalics
2008-12-07 13:10   ` Lennart Borgman
2008-12-07 13:20     ` martin rudalics
2008-12-07 14:32       ` Chong Yidong [this message]
2008-12-07 14:53         ` Chong Yidong
2008-12-08 11:48           ` Richard M Stallman
2008-12-07 14:59         ` martin rudalics
2008-12-07 15:07         ` Chong Yidong
2008-12-07 17:04           ` martin rudalics
2008-12-07 20:59         ` Stefan Monnier
2008-12-08 18:26           ` Richard M Stallman
2008-12-08 19:59             ` Stefan Monnier

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=87vdtwf43c.fsf@cyd.mit.edu \
    --to=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    --cc=lennart.borgman@gmail.com \
    --cc=rudalics@gmx.at \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).