unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* disabling undo boundaries
@ 2015-05-10 21:43 Phillip Lord
  2015-05-11  1:42 ` Stefan Monnier
  0 siblings, 1 reply; 52+ messages in thread
From: Phillip Lord @ 2015-05-10 21:43 UTC (permalink / raw)
  To: Emacs-Devel devel


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











^ permalink raw reply	[flat|nested] 52+ messages in thread

end of thread, other threads:[~2015-08-21  9:40 UTC | newest]

Thread overview: 52+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-10 21:43 disabling undo boundaries Phillip Lord
2015-05-11  1:42 ` Stefan Monnier
2015-05-11 11:46   ` Phillip Lord
2015-05-11 14:45     ` Stefan Monnier
2015-05-11 16:31       ` Phillip Lord
2015-05-11 19:30         ` Stefan Monnier
2015-05-11 20:42           ` Phillip Lord
2015-05-11 22:23             ` Stefan Monnier
2015-05-12 11:52               ` Phillip Lord
2015-05-12 20:15                 ` Stefan Monnier
2015-05-12 20:59                   ` Phillip Lord
2015-05-13 12:32                     ` Stefan Monnier
2015-05-13 15:40                       ` Phillip Lord
2015-05-14 15:28                         ` Stefan Monnier
2015-05-15 12:27                           ` Phillip Lord
2015-05-15 18:08                             ` Stefan Monnier
2015-05-15 19:49                               ` Phillip Lord
2015-05-15 23:45                                 ` Stefan Monnier
2015-05-16 13:31                                   ` Phillip Lord
2015-05-19 11:59                                     ` Phillip Lord
2015-05-19 19:42                                       ` Stefan Monnier
2015-05-19 21:48                                         ` Phillip Lord
2015-05-20  2:00                                           ` Stefan Monnier
2015-05-20  7:45                                             ` Phillip Lord
2015-05-20 12:53                                               ` Stefan Monnier
2015-05-21 11:15                                                 ` Phillip Lord
2015-05-21 15:44                                                   ` Stefan Monnier
2015-05-21 17:03                                                     ` Phillip Lord
2015-05-27 11:46                                                       ` Phillip Lord
2015-06-29  0:46                                                         ` Stefan Monnier
2015-08-04 14:18                                                           ` Phillip Lord
2015-08-06 21:02                                                             ` Phillip Lord
2015-08-06 22:20                                                             ` Stefan Monnier
2015-08-07 13:40                                                               ` Phillip Lord
2015-08-07 13:59                                                                 ` David Kastrup
2015-08-07 21:10                                                                   ` Phillip Lord
2015-08-08  5:39                                                                     ` David Kastrup
2015-08-08  9:58                                                                       ` Phillip Lord
2015-08-07 17:10                                                                 ` Stefan Monnier
2015-08-08 21:28                                                                   ` Stefan Monnier
2015-08-09 15:39                                                                     ` Phillip Lord
2015-08-09 16:30                                                                       ` Stefan Monnier
2015-08-09 16:50                                                                         ` Phillip Lord
2015-08-09 17:40                                                                           ` Stefan Monnier
2015-08-10  9:27                                                                             ` Phillip Lord
2015-08-10 21:21                                                                               ` Phillip Lord
2015-08-12 21:15                                                                               ` Stefan Monnier
2015-08-12 22:34                                                                                 ` Phillip Lord
2015-08-13  2:23                                                                                   ` Stefan Monnier
2015-08-21  9:40                                                                                     ` Phillip Lord
2015-08-07 23:49                                                     ` Davis Herring
2015-08-08 10:01                                                       ` Phillip Lord

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