From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#810: 23.0.60; atomic-change-group narrowing problem Date: Fri, 29 Aug 2008 11:27:04 +0200 Message-ID: <48B7C0E8.6070203@gmx.at> References: <48B6F562.9060006@gmail.com> <48B71820.7040108@gmx.at> <48B71A96.4040700@gmail.com> Reply-To: martin rudalics , 810@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000206020904060703030406" X-Trace: ger.gmane.org 1220003541 16260 80.91.229.12 (29 Aug 2008 09:52:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 Aug 2008 09:52:21 +0000 (UTC) Cc: 810@emacsbugs.donarmstrong.com To: "Lennart Borgman (gmail)" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 29 11:53:14 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KZ0fC-0006nt-Jn for geb-bug-gnu-emacs@m.gmane.org; Fri, 29 Aug 2008 11:53:06 +0200 Original-Received: from localhost ([127.0.0.1]:48112 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KZ0eD-0004O3-Pa for geb-bug-gnu-emacs@m.gmane.org; Fri, 29 Aug 2008 05:52:05 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KZ0Zt-0000V2-St for bug-gnu-emacs@gnu.org; Fri, 29 Aug 2008 05:47:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KZ0Zq-0000RW-Jm for bug-gnu-emacs@gnu.org; Fri, 29 Aug 2008 05:47:36 -0400 Original-Received: from [199.232.76.173] (port=34666 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KZ0Zp-0000R8-Vn for bug-gnu-emacs@gnu.org; Fri, 29 Aug 2008 05:47:34 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:59813) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KZ0Zp-0001T0-5p for bug-gnu-emacs@gnu.org; Fri, 29 Aug 2008 05:47:33 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m7T9lTf6009302; Fri, 29 Aug 2008 02:47:29 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m7T9e5O7006528; Fri, 29 Aug 2008 02:40:05 -0700 X-Loop: don@donarmstrong.com Resent-From: martin rudalics Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 29 Aug 2008 09:40:05 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 810 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 810-submit@emacsbugs.donarmstrong.com id=B810.12200022554369 (code B ref 810); Fri, 29 Aug 2008 09:40:05 +0000 Original-Received: (at 810) by emacsbugs.donarmstrong.com; 29 Aug 2008 09:30:55 +0000 Original-Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id m7T9UpQ9004355 for <810@emacsbugs.donarmstrong.com>; Fri, 29 Aug 2008 02:30:53 -0700 Original-Received: (qmail invoked by alias); 29 Aug 2008 09:30:46 -0000 Original-Received: from 62-47-33-217.adsl.highway.telekom.at (EHLO [62.47.33.217]) [62.47.33.217] by mail.gmx.net (mp003) with SMTP; 29 Aug 2008 11:30:46 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1/rXMQG3ZDroAiynSNKZyJvzqHR2hre5HdW2xNpxh F7Ydt9HyGuVDqF User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) In-Reply-To: <48B71A96.4040700@gmail.com> X-Y-GMX-Trusted: 0 X-FuHaFi: 0.87,0.63 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Resent-Date: Fri, 29 Aug 2008 05:47:36 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:19851 This is a multi-part message in MIME format. --------------000206020904060703030406 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit > 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 --------------000206020904060703030406 Content-Type: text/plain; name="810.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="810.diff" *** 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 stat= e. ! (setq buffer-undo-list elt))))) =0C ;;;; Display-related functions. =20 --- 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)))))) =0C ;;;; Display-related functions. =20 --------------000206020904060703030406--