From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: The *Warnings* buffer and undo Date: Sun, 01 Apr 2007 09:44:36 +0900 Message-ID: <87mz1sylcb.fsf@catnip.gol.com> References: <460583AD.7010002@gmail.com> <85abxxw46j.fsf@lola.goethe.zz> <87y7lf1z6t.fsf@catnip.gol.com> <87ejn6z6qr.fsf@catnip.gol.com> <871wj5ymd5.fsf@catnip.gol.com> Reply-To: Miles Bader NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1175388296 1759 80.91.229.12 (1 Apr 2007 00:44:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 1 Apr 2007 00:44:56 +0000 (UTC) Cc: rgm@gnu.org, lennart.borgman@gmail.com, emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 01 02:44:50 2007 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 1HXoBc-0006Wt-9G for ged-emacs-devel@m.gmane.org; Sun, 01 Apr 2007 02:44:48 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HXoET-0001Xw-FW for ged-emacs-devel@m.gmane.org; Sat, 31 Mar 2007 19:47:45 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HXoEP-0001Wb-CL for emacs-devel@gnu.org; Sat, 31 Mar 2007 20:47:41 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HXoEO-0001U0-3n for emacs-devel@gnu.org; Sat, 31 Mar 2007 20:47:41 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HXoEN-0001Tn-QE for emacs-devel@gnu.org; Sat, 31 Mar 2007 19:47:39 -0500 Original-Received: from smtp02.dentaku.gol.com ([203.216.5.72]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HXoBT-00048O-RU; Sat, 31 Mar 2007 20:44:40 -0400 Original-Received: from 203-216-98-180.dsl.gol.ne.jp ([203.216.98.180] helo=catnip.gol.com) by smtp02.dentaku.gol.com with esmtpa (Dentaku) id 1HXoBR-0004H5-Bm; Sun, 01 Apr 2007 09:44:37 +0900 Original-Received: by catnip.gol.com (Postfix, from userid 1000) id C6B412F43; Sun, 1 Apr 2007 09:44:36 +0900 (JST) System-Type: i686-pc-linux-gnu In-Reply-To: <871wj5ymd5.fsf@catnip.gol.com> (Miles Bader's message of "Sun\, 01 Apr 2007 09\:22\:30 +0900") Original-Lines: 30 X-Abuse-Complaints: abuse@gol.com X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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:68876 Archived-At: I wrote: > However in some other potential applications (someone mentioned > customization buffers, where you probably want to restrict undo to the > user-editable fields), things are not so simple, so having something > which works at a primitive level (like "inhibit-undo") might be nice in > general. I think I slightly mis-read your message. The method you mention -- looking at buffer-undo-list after the fact, and then removing some entries and using them to fix up the rest of the entries -- sounds like a very workable approach in lisp, since the to-be-discarded entries will contain all the information you need. A possible interface could be: (let ((keep-undo buffer-undo-list)) ;; do some modifications which shouldn't be kept in the undo list (do-some-buffer-modifications) (discard-undo-entries keep-undo)) "discard-undo-entries" would just take a tail of the undo list as an argument and discard everything before it (fixing up the rest). -Miles -- A zen-buddhist walked into a pizza shop and said, "Make me one with everything."