GNU bug report logs -
#810
23.0.60; atomic-change-group narrowing problem
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
> I would suggest that this is a bug in the function. Think for example of
> the case that you want to test something during narrowing and be sure
> that the buffer is not changed.
Does the attached patch do what you want?
martin
[810.diff (text/plain, inline)]
*** subr.el.~1.602.~ 2008-07-31 07:33:45.000000000 +0200
--- subr.el 2008-08-29 11:15:34.765625000 +0200
***************
*** 1991,2016 ****
(dolist (elt handle)
(with-current-buffer (car elt)
(setq elt (cdr elt))
! (let ((old-car
! (if (consp elt) (car elt)))
! (old-cdr
! (if (consp elt) (cdr elt))))
! ;; Temporarily truncate the undo log at ELT.
! (when (consp elt)
! (setcar elt nil) (setcdr elt nil))
! (unless (eq last-command 'undo) (undo-start))
! ;; Make sure there's no confusion.
! (when (and (consp elt) (not (eq elt (last pending-undo-list))))
! (error "Undoing to some unrelated state"))
! ;; Undo it all.
! (save-excursion
! (while (listp pending-undo-list) (undo-more 1)))
! ;; Reset the modified cons cell ELT to its original content.
! (when (consp elt)
! (setcar elt old-car)
! (setcdr elt old-cdr))
! ;; Revert the undo info to what it was when we grabbed the state.
! (setq buffer-undo-list elt)))))
;;;; Display-related functions.
--- 1991,2018 ----
(dolist (elt handle)
(with-current-buffer (car elt)
(setq elt (cdr elt))
! (save-restriction
! (widen)
! (let ((old-car
! (if (consp elt) (car elt)))
! (old-cdr
! (if (consp elt) (cdr elt))))
! ;; Temporarily truncate the undo log at ELT.
! (when (consp elt)
! (setcar elt nil) (setcdr elt nil))
! (unless (eq last-command 'undo) (undo-start))
! ;; Make sure there's no confusion.
! (when (and (consp elt) (not (eq elt (last pending-undo-list))))
! (error "Undoing to some unrelated state"))
! ;; Undo it all.
! (save-excursion
! (while (listp pending-undo-list) (undo-more 1)))
! ;; Reset the modified cons cell ELT to its original content.
! (when (consp elt)
! (setcar elt old-car)
! (setcdr elt old-cdr))
! ;; Revert the undo info to what it was when we grabbed the state.
! (setq buffer-undo-list elt))))))
;;;; Display-related functions.
This bug report was last modified 16 years and 259 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.