From unknown Sun Jun 22 11:35:17 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#23813 <23813@debbugs.gnu.org> To: bug#23813 <23813@debbugs.gnu.org> Subject: Status: 24.5; undo warning while find-file Reply-To: bug#23813 <23813@debbugs.gnu.org> Date: Sun, 22 Jun 2025 18:35:17 +0000 retitle 23813 24.5; undo warning while find-file reassign 23813 emacs submitter 23813 ynyaaa@gmail.com severity 23813 minor thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 21 07:48:58 2016 Received: (at submit) by debbugs.gnu.org; 21 Jun 2016 11:48:58 +0000 Received: from localhost ([127.0.0.1]:48661 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFKAs-0000yg-7Y for submit@debbugs.gnu.org; Tue, 21 Jun 2016 07:48:58 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56670) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFKAp-0000yS-Mu for submit@debbugs.gnu.org; Tue, 21 Jun 2016 07:48:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFKAh-0000QN-8m for submit@debbugs.gnu.org; Tue, 21 Jun 2016 07:48:50 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:44812) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFKAh-0000QG-5e for submit@debbugs.gnu.org; Tue, 21 Jun 2016 07:48:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFKAc-0001YS-Bq for bug-gnu-emacs@gnu.org; Tue, 21 Jun 2016 07:48:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFKAY-0000Ll-4t for bug-gnu-emacs@gnu.org; Tue, 21 Jun 2016 07:48:41 -0400 Received: from mail-pf0-x22b.google.com ([2607:f8b0:400e:c00::22b]:34307) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFKAX-0000Lg-Qc for bug-gnu-emacs@gnu.org; Tue, 21 Jun 2016 07:48:38 -0400 Received: by mail-pf0-x22b.google.com with SMTP id h14so6094430pfe.1 for ; Tue, 21 Jun 2016 04:48:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version; bh=BdUWyUWgofdqIXcaSMyboxRGOXmIfSTBPP0dUXutMUw=; b=eU5RUlt9xbKjn4BTbWOJg3zIu+aICnIXpdCqRLTQPffYI+wSCqdNNacq4EaWReooL/ 3svpHwwCyP3oeXgPztYLbccLrJqKRKcLpkbfqb/CbxeUNdS7mCGWs+MVIuKkYKh+N7wp 5k2M3u2n/57dCQFdW0miCe31TAaZQrGS9VuT3ZulEJtilYi1Q1kb4oF1FSNKyzyCqdV2 1peJB2eIgxcc3s0AQv89Bdr5SXWsz4nycota58xVbC5UpXH3//Rp51ZwoySDETP+czkL AvQC/Ta729H13K/Ej0/ADC4bGWZF1xq+ruIgq4qoVq1Vt17qMC+fjYUBh+TSQ/2teWo7 7IZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=BdUWyUWgofdqIXcaSMyboxRGOXmIfSTBPP0dUXutMUw=; b=QTYB2MFPEYeB+WsdZgaXPaadaDRmwU9TGKoNdAOxnD8CGCaa5UXfb97QNB+Vih+CoE OHzQN2gDJS6A3Lu1IylbViFLi4OojDJ3ofoX6L8GywIbBYTIaLDaZ/2MaTDsHidTPY9+ AQV1kQfTMrlMs7qNf+0MW13V/TM7VcZ2ZEU46bAoSMrjY33IjpBsfRsKHu3NNUvo3Sqd Cge55JQQd4PUnZYtntpgg8slX6SRwp7fLtg+hFZuAf0evRFhvw7QmgccWq7tGGo7eZ03 E+/B+4w4vn4v+gRUeUc028EwTB4/WcdxoYXbl1pXy0lS+ygi6D4cYcxCa9goH8w0aztb 36CA== X-Gm-Message-State: ALyK8tJGTzdTM8M6zLFqhzEqQWZqg+ik821CHwqE1ZQiIBMx82l5tQCJhJHHAyuA8B8MNg== X-Received: by 10.98.26.148 with SMTP id a142mr27499230pfa.46.1466509716471; Tue, 21 Jun 2016 04:48:36 -0700 (PDT) Received: from PNUT-PC (east49-p99.eaccess.hi-ho.ne.jp. [219.105.5.100]) by smtp.gmail.com with ESMTPSA id 77sm53246641pfp.66.2016.06.21.04.48.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Jun 2016 04:48:36 -0700 (PDT) From: ynyaaa@gmail.com To: bug-gnu-emacs@gnu.org Subject: 24.5; undo warning while find-file Date: Tue, 21 Jun 2016 20:48:30 +0900 Message-ID: <87a8ieu5ip.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) When `post-read-conversion' changes the buffer many times, undo warning buffer popups. This may occur while `find-file', even though undo info is not needed. (let ((tmpfile "/tmp/test-hz.txt")) (with-temp-buffer (dotimes (i 100000) (insert "~{R;~}\n")) (write-region (point-min) (point-max) tmpfile) (let ((coding-system-for-read 'hz)) (find-file tmpfile)))) Evaluating the form above, *Warnings* buffer shows this text. Warning (undo): Buffer `test-hz.txt' undo info was 12765470 bytes long. The undo info was discarded because it exceeded `undo-outer-limit'. This is normal if you executed a command that made a huge change to the buffer. In that case, to prevent similar problems in the future, set `undo-outer-limit' to a value that is large enough to cover the maximum size of normal changes you expect a single command to make, but not so large that it might exceed the maximum memory allotted to Emacs. If you did not execute any such command, the situation is probably due to a bug and you should report it. You can disable the popping up of this buffer by adding the entry (undo discard-info) to the user option `warning-suppress-types', which is defined in the `warnings' library. In GNU Emacs 24.5.1 (i686-pc-mingw32) of 2015-04-11 on LEG570 Windowing system distributor `Microsoft Corp.', version 6.0.6002 Configured using: `configure --prefix=/c/usr --host=i686-pc-mingw32' Important settings: value of $LANG: JPN locale-coding-system: cp932 Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent messages: Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils help-mode easymenu advice help-fns time-date japan-util tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp w32-common-fns disp-table w32-win w32-vars tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process w32notify w32 multi-tty emacs) Memory information: ((conses 8 78016 6918) (symbols 32 17691 0) (miscs 32 35 158) (strings 16 11326 4298) (string-bytes 1 284552) (vectors 8 10542) (vector-slots 4 465337 5130) (floats 8 58 110) (intervals 28 210 0) (buffers 508 13)) From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 09 08:28:10 2016 Received: (at 23813) by debbugs.gnu.org; 9 Jul 2016 12:28:10 +0000 Received: from localhost ([127.0.0.1]:43304 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLrMf-0008EP-RG for submit@debbugs.gnu.org; Sat, 09 Jul 2016 08:28:10 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37259) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLrMe-0008ED-8N for 23813@debbugs.gnu.org; Sat, 09 Jul 2016 08:28:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bLrMV-0007lF-OJ for 23813@debbugs.gnu.org; Sat, 09 Jul 2016 08:28:02 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_05,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39197) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLrMV-0007lA-Kr; Sat, 09 Jul 2016 08:27:59 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1656 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bLrMS-0003F6-8A; Sat, 09 Jul 2016 08:27:56 -0400 Date: Sat, 09 Jul 2016 15:27:47 +0300 Message-Id: <83a8hrgfng.fsf@gnu.org> From: Eli Zaretskii To: ynyaaa@gmail.com, phillip.lord@russet.org.uk (Phillip Lord) In-reply-to: <87a8ieu5ip.fsf@gmail.com> (ynyaaa@gmail.com) Subject: Re: bug#23813: 24.5; undo warning while find-file References: <87a8ieu5ip.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: 23813 Cc: 23813@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.3 (------) > From: ynyaaa@gmail.com > Date: Tue, 21 Jun 2016 20:48:30 +0900 > > When `post-read-conversion' changes the buffer many times, > undo warning buffer popups. > This may occur while `find-file', even though undo info is not needed. > > (let ((tmpfile "/tmp/test-hz.txt")) > (with-temp-buffer > (dotimes (i 100000) (insert "~{R;~}\n")) > (write-region (point-min) (point-max) tmpfile) > (let ((coding-system-for-read 'hz)) > (find-file tmpfile)))) > > Evaluating the form above, *Warnings* buffer shows this text. > Warning (undo): Buffer `test-hz.txt' undo info was 12765470 bytes long. > The undo info was discarded because it exceeded `undo-outer-limit'. > > This is normal if you executed a command that made a huge change > to the buffer. In that case, to prevent similar problems in the > future, set `undo-outer-limit' to a value that is large enough to > cover the maximum size of normal changes you expect a single > command to make, but not so large that it might exceed the > maximum memory allotted to Emacs. > > If you did not execute any such command, the situation is > probably due to a bug and you should report it. > > You can disable the popping up of this buffer by adding the entry > (undo discard-info) to the user option `warning-suppress-types', > which is defined in the `warnings' library. Phillip, what do you think about the patch below? diff --git a/src/coding.c b/src/coding.c index 29c90f0..b959f7d 100644 --- a/src/coding.c +++ b/src/coding.c @@ -7851,6 +7851,15 @@ code_conversion_save (bool with_work_buf, bool multibyte) return workbuf; } +static void +coding_restore_undo_list (Lisp_Object arg) +{ + Lisp_Object undo_list = XCAR (arg); + struct buffer *buf = XBUFFER (XCDR (arg)); + + bset_undo_list (buf, undo_list); +} + void decode_coding_gap (struct coding_system *coding, ptrdiff_t chars, ptrdiff_t bytes) @@ -7963,13 +7972,19 @@ decode_coding_gap (struct coding_system *coding, { ptrdiff_t prev_Z = Z, prev_Z_BYTE = Z_BYTE; Lisp_Object val; + Lisp_Object undo_list = BVAR (current_buffer, undo_list); + ptrdiff_t count1 = SPECPDL_INDEX (); + record_unwind_protect (coding_restore_undo_list, + Fcons (undo_list, Fcurrent_buffer ())); + bset_undo_list (current_buffer, Qt); TEMP_SET_PT_BOTH (coding->dst_pos, coding->dst_pos_byte); val = call1 (CODING_ATTR_POST_READ (attrs), make_number (coding->produced_char)); CHECK_NATNUM (val); coding->produced_char += Z - prev_Z; coding->produced += Z_BYTE - prev_Z_BYTE; + unbind_to (count1, Qnil); } unbind_to (count, Qnil); @@ -8110,13 +8125,19 @@ decode_coding_object (struct coding_system *coding, { ptrdiff_t prev_Z = Z, prev_Z_BYTE = Z_BYTE; Lisp_Object val; + Lisp_Object undo_list = BVAR (current_buffer, undo_list); + ptrdiff_t count1 = SPECPDL_INDEX (); + record_unwind_protect (coding_restore_undo_list, + Fcons (undo_list, Fcurrent_buffer ())); + bset_undo_list (current_buffer, Qt); TEMP_SET_PT_BOTH (coding->dst_pos, coding->dst_pos_byte); val = safe_call1 (CODING_ATTR_POST_READ (attrs), make_number (coding->produced_char)); CHECK_NATNUM (val); coding->produced_char += Z - prev_Z; coding->produced += Z_BYTE - prev_Z_BYTE; + unbind_to (count1, Qnil); } if (EQ (dst_object, Qt)) From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 30 04:25:57 2016 Received: (at 23813-done) by debbugs.gnu.org; 30 Jul 2016 08:25:57 +0000 Received: from localhost ([127.0.0.1]:51129 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bTPan-0003vg-4T for submit@debbugs.gnu.org; Sat, 30 Jul 2016 04:25:57 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39300) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bTPak-0003vT-Fn for 23813-done@debbugs.gnu.org; Sat, 30 Jul 2016 04:25:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bTPac-0007qP-7d for 23813-done@debbugs.gnu.org; Sat, 30 Jul 2016 04:25:49 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42857) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTPac-0007qG-4X; Sat, 30 Jul 2016 04:25:46 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2374 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bTPaa-0002Vr-2z; Sat, 30 Jul 2016 04:25:44 -0400 Date: Sat, 30 Jul 2016 11:25:39 +0300 Message-Id: <83vaznpm64.fsf@gnu.org> From: Eli Zaretskii To: ynyaaa@gmail.com In-reply-to: <83a8hrgfng.fsf@gnu.org> (message from Eli Zaretskii on Sat, 09 Jul 2016 15:27:47 +0300) Subject: Re: bug#23813: 24.5; undo warning while find-file References: <87a8ieu5ip.fsf@gmail.com> <83a8hrgfng.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: 23813-done Cc: 23813-done@debbugs.gnu.org, phillip.lord@russet.org.uk X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.3 (------) > Date: Sat, 09 Jul 2016 15:27:47 +0300 > From: Eli Zaretskii > Cc: 23813@debbugs.gnu.org > > > From: ynyaaa@gmail.com > > Date: Tue, 21 Jun 2016 20:48:30 +0900 > > > > When `post-read-conversion' changes the buffer many times, > > undo warning buffer popups. > > This may occur while `find-file', even though undo info is not needed. > > > > (let ((tmpfile "/tmp/test-hz.txt")) > > (with-temp-buffer > > (dotimes (i 100000) (insert "~{R;~}\n")) > > (write-region (point-min) (point-max) tmpfile) > > (let ((coding-system-for-read 'hz)) > > (find-file tmpfile)))) > > > > Evaluating the form above, *Warnings* buffer shows this text. > > Warning (undo): Buffer `test-hz.txt' undo info was 12765470 bytes long. > > The undo info was discarded because it exceeded `undo-outer-limit'. > > > > This is normal if you executed a command that made a huge change > > to the buffer. In that case, to prevent similar problems in the > > future, set `undo-outer-limit' to a value that is large enough to > > cover the maximum size of normal changes you expect a single > > command to make, but not so large that it might exceed the > > maximum memory allotted to Emacs. > > > > If you did not execute any such command, the situation is > > probably due to a bug and you should report it. > > > > You can disable the popping up of this buffer by adding the entry > > (undo discard-info) to the user option `warning-suppress-types', > > which is defined in the `warnings' library. > > Phillip, what do you think about the patch below? No comments, so I pushed the proposed change to the master branch, and I'm marking this bug done. Thanks. From unknown Sun Jun 22 11:35:17 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 27 Aug 2016 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator