From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: phillip.lord@newcastle.ac.uk (Phillip Lord) Newsgroups: gmane.emacs.devel Subject: disabling undo boundaries Date: Sun, 10 May 2015 22:43:18 +0100 Message-ID: <87fv746rd5.fsf@newcastle.ac.uk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1431294226 10470 80.91.229.3 (10 May 2015 21:43:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 10 May 2015 21:43:46 +0000 (UTC) To: Emacs-Devel devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 10 23:43:39 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YrZ0b-0004iF-3P for ged-emacs-devel@m.gmane.org; Sun, 10 May 2015 23:43:37 +0200 Original-Received: from localhost ([::1]:34593 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YrZ0a-0001kE-4n for ged-emacs-devel@m.gmane.org; Sun, 10 May 2015 17:43:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34378) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YrZ0W-0001k9-Qd for emacs-devel@gnu.org; Sun, 10 May 2015 17:43:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YrZ0T-0000tp-LE for emacs-devel@gnu.org; Sun, 10 May 2015 17:43:32 -0400 Original-Received: from cheviot22.ncl.ac.uk ([128.240.234.22]:44800) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YrZ0T-0000qy-Ee for emacs-devel@gnu.org; Sun, 10 May 2015 17:43:29 -0400 Original-Received: from smtpauth-vm.ncl.ac.uk ([10.8.233.129] helo=smtpauth.ncl.ac.uk) by cheviot22.ncl.ac.uk with esmtp (Exim 4.63) (envelope-from ) id 1YrZ0O-0000qQ-DT for emacs-devel@gnu.org; Sun, 10 May 2015 22:43:24 +0100 Original-Received: from cpc7-benw10-2-0-cust228.16-2.cable.virginm.net ([77.98.254.229] helo=localhost) by smtpauth.ncl.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1YrZ0N-0002DJ-4W for emacs-devel@gnu.org; Sun, 10 May 2015 22:43:24 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 128.240.234.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:186387 Archived-At: I am a little confused by undo boundaries and how and when they get set. Consider this, entirely pointless piece of code. (defvar fix-test-on nil) (defun fix-test-after-change-function (&rest _) (when fix-test-on (with-current-buffer (get-buffer "*scratch*") (insert "a")))) (add-hook 'after-change-functions 'fix-test-after-change-function) Now, If I delete buffer-undo-list in the current buffer (not *scratch*) then type "abc", I get a buffer-undo-list something like... (nil (355 . 358)) Now if I set fix-test-on to t and do the same, I get this. (nil (357 . 358) nil (356 . 357) nil (355 . 356)) I am wondering why the "nil" undo-boundaries get inserted when I change *a different* buffer. This does not really make sense to me, and is causing breakage in my package. I can't for the life of me find out where this nil boundary is getting added; it appears to happen *after* the after-change-function ends, as I find by logging buffer-undo-list in my a-c-f, so it's neither the buffer-change nor the insert itself. Unfortunately, this also means I cannot fix the problem in the a-c-f. Any other ideas welcome! Phil