unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
Cc: 810@emacsbugs.donarmstrong.com
Subject: bug#810: 23.0.60; atomic-change-group narrowing problem
Date: Fri, 29 Aug 2008 11:27:04 +0200	[thread overview]
Message-ID: <48B7C0E8.6070203@gmx.at> (raw)
In-Reply-To: <48B71A96.4040700@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 235 bytes --]

 > 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

[-- Attachment #2: 810.diff --]
[-- Type: text/plain, Size: 2200 bytes --]

*** 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)))))
  \f
  ;;;; 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))))))
  \f
  ;;;; Display-related functions.
  

  reply	other threads:[~2008-08-29  9:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <48C3A6BE.8030305@gmx.at>
2008-08-28 18:58 ` bug#810: 23.0.60; atomic-change-group narrowing problem Lennart Borgman (gmail)
2008-08-28 21:26   ` martin rudalics
2008-08-28 21:37     ` Lennart Borgman (gmail)
2008-08-29  9:27       ` martin rudalics [this message]
2008-09-01 17:56   ` martin rudalics
2008-09-01 20:43     ` Stefan Monnier
2008-09-01 21:20       ` martin rudalics
2008-09-01 21:53         ` Lennart Borgman (gmail)
2008-09-02  2:38           ` Stefan Monnier
2008-09-07  9:37             ` martin rudalics
2008-09-02 14:13         ` Richard M. Stallman
2008-09-07 10:15   ` bug#810: marked as done (23.0.60; atomic-change-group narrowing problem) Emacs bug Tracking System

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=48B7C0E8.6070203@gmx.at \
    --to=rudalics@gmx.at \
    --cc=810@emacsbugs.donarmstrong.com \
    --cc=lennart.borgman@gmail.com \
    /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).