From unknown Sun Sep 07 23:15:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#32237: 27.0.50; Function in before-change-functions is called with first argument greater than the second Resent-From: =?UTF-8?Q?Micha=C5=82?= Kondraciuk Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Jul 2018 17:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 32237 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 32237@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15321939189758 (code B ref -1); Sat, 21 Jul 2018 17:26:01 +0000 Received: (at submit) by debbugs.gnu.org; 21 Jul 2018 17:25:18 +0000 Received: from localhost ([127.0.0.1]:51274 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fgvd8-0002XK-HJ for submit@debbugs.gnu.org; Sat, 21 Jul 2018 13:25:18 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50968) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fgvd6-0002X6-2Z for submit@debbugs.gnu.org; Sat, 21 Jul 2018 13:25:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fgvd0-0003qu-0i for submit@debbugs.gnu.org; Sat, 21 Jul 2018 13:25:10 -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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:49273) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fgvcz-0003qp-Sp for submit@debbugs.gnu.org; Sat, 21 Jul 2018 13:25:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41937) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgvcy-0006r4-Nv for bug-gnu-emacs@gnu.org; Sat, 21 Jul 2018 13:25:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fgvcv-0003op-KG for bug-gnu-emacs@gnu.org; Sat, 21 Jul 2018 13:25:08 -0400 Received: from sender-pp-092.zoho.com ([135.84.80.237]:25463) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fgvcv-0003lA-Bu for bug-gnu-emacs@gnu.org; Sat, 21 Jul 2018 13:25:05 -0400 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=zapps768; d=zoho.com; h=subject:from:to:references:message-id:date:user-agent:mime-version:in-reply-to:content-type; b=vTZFn61FrH3rh5mxpRyjketoBNFqrBemWjCfSbKn+/hxBMFbog/MrmNCV/7zrOx+6j2WfBaChFc2 1UVxS20U2lGWxmFGwhs8CpRBbw+MMvhGJOzPGeoKo+gCoVOKQw7x Received: from [192.168.0.87] (84-10-171-192.static.chello.pl [84.10.171.192]) by mx.zohomail.com with SMTPS id 1532191168897570.5227197576309; Sat, 21 Jul 2018 09:39:28 -0700 (PDT) From: =?UTF-8?Q?Micha=C5=82?= Kondraciuk References: Message-ID: <503f92da-ee58-ceaa-2dab-a5216bd18e7e@zoho.com> Date: Sat, 21 Jul 2018 18:39:26 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ZohoMailClient: External X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] 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-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: -5.0 (-----) If I eveluate the sexp below with M-: in emacs -Q, I get the message "before change 4 1", which is unexpected. The second argument should be greater than the first one, according to the documentation. (with-current-buffer "*scratch*" (erase-buffer) (insert "foo") (add-hook 'before-change-functions (lambda (beg end) (message "before change %d %d" beg end)) nil t) (with-temp-buffer (insert "foo") (let ((temp (current-buffer))) (with-current-buffer "*scratch*" (replace-buffer-contents temp))))) Repository revision: 2c242cb1a2956ecfa894d0110b837d4ecc43a69c From unknown Sun Sep 07 23:15:49 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: =?UTF-8?Q?Micha=C5=82?= Kondraciuk Subject: bug#32237: closed (Re: bug#32237: 27.0.50; Function in before-change-functions is called with first argument greater than the second) Message-ID: References: <83effwxy2t.fsf@gnu.org> <503f92da-ee58-ceaa-2dab-a5216bd18e7e@zoho.com> X-Gnu-PR-Message: they-closed 32237 X-Gnu-PR-Package: emacs Reply-To: 32237@debbugs.gnu.org Date: Sat, 21 Jul 2018 18:07:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1532196422-13751-1" This is a multi-part message in MIME format... ------------=_1532196422-13751-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #32237: 27.0.50; Function in before-change-functions is called with first a= rgument greater than the second which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 32237@debbugs.gnu.org. --=20 32237: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D32237 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1532196422-13751-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 32237-done) by debbugs.gnu.org; 21 Jul 2018 18:06:57 +0000 Received: from localhost ([127.0.0.1]:51299 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fgwHR-0003ZX-Fy for submit@debbugs.gnu.org; Sat, 21 Jul 2018 14:06:57 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56060) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fgwHQ-0003ZK-4s for 32237-done@debbugs.gnu.org; Sat, 21 Jul 2018 14:06:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fgwHH-0004nt-QR for 32237-done@debbugs.gnu.org; Sat, 21 Jul 2018 14:06: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.5 required=5.0 tests=BAYES_05 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:35657) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgwHH-0004np-Ma; Sat, 21 Jul 2018 14:06:47 -0400 Received: from [176.228.60.248] (port=2416 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fgwHH-0005x2-8T; Sat, 21 Jul 2018 14:06:47 -0400 Date: Sat, 21 Jul 2018 21:06:50 +0300 Message-Id: <83effwxy2t.fsf@gnu.org> From: Eli Zaretskii To: =?utf-8?Q?Micha=C5=82?= Kondraciuk In-reply-to: <503f92da-ee58-ceaa-2dab-a5216bd18e7e@zoho.com> (message from =?utf-8?Q?Micha=C5=82?= Kondraciuk on Sat, 21 Jul 2018 18:39:26 +0200) Subject: Re: bug#32237: 27.0.50; Function in before-change-functions is called with first argument greater than the second References: <503f92da-ee58-ceaa-2dab-a5216bd18e7e@zoho.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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: -5.0 (-----) X-Debbugs-Envelope-To: 32237-done Cc: 32237-done@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: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: MichaƂ Kondraciuk > Date: Sat, 21 Jul 2018 18:39:26 +0200 > > If I eveluate the sexp below with M-: in emacs -Q, I get the message > "before change 4 1", which is unexpected. The second argument should be > greater than the first one, according to the documentation. Thanks, fixed on the emacs-26 branch. ------------=_1532196422-13751-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 21 Jul 2018 17:25:18 +0000 Received: from localhost ([127.0.0.1]:51274 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fgvd8-0002XK-HJ for submit@debbugs.gnu.org; Sat, 21 Jul 2018 13:25:18 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50968) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fgvd6-0002X6-2Z for submit@debbugs.gnu.org; Sat, 21 Jul 2018 13:25:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fgvd0-0003qu-0i for submit@debbugs.gnu.org; Sat, 21 Jul 2018 13:25:10 -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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:49273) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fgvcz-0003qp-Sp for submit@debbugs.gnu.org; Sat, 21 Jul 2018 13:25:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41937) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgvcy-0006r4-Nv for bug-gnu-emacs@gnu.org; Sat, 21 Jul 2018 13:25:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fgvcv-0003op-KG for bug-gnu-emacs@gnu.org; Sat, 21 Jul 2018 13:25:08 -0400 Received: from sender-pp-092.zoho.com ([135.84.80.237]:25463) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fgvcv-0003lA-Bu for bug-gnu-emacs@gnu.org; Sat, 21 Jul 2018 13:25:05 -0400 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=zapps768; d=zoho.com; h=subject:from:to:references:message-id:date:user-agent:mime-version:in-reply-to:content-type; b=vTZFn61FrH3rh5mxpRyjketoBNFqrBemWjCfSbKn+/hxBMFbog/MrmNCV/7zrOx+6j2WfBaChFc2 1UVxS20U2lGWxmFGwhs8CpRBbw+MMvhGJOzPGeoKo+gCoVOKQw7x Received: from [192.168.0.87] (84-10-171-192.static.chello.pl [84.10.171.192]) by mx.zohomail.com with SMTPS id 1532191168897570.5227197576309; Sat, 21 Jul 2018 09:39:28 -0700 (PDT) Subject: 27.0.50; Function in before-change-functions is called with first argument greater than the second From: =?UTF-8?Q?Micha=c5=82_Kondraciuk?= To: bug-gnu-emacs@gnu.org References: Message-ID: <503f92da-ee58-ceaa-2dab-a5216bd18e7e@zoho.com> Date: Sat, 21 Jul 2018 18:39:26 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ZohoMailClient: External X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] 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: -5.0 (-----) If I eveluate the sexp below with M-: in emacs -Q, I get the message "before change 4 1", which is unexpected. The second argument should be greater than the first one, according to the documentation. (with-current-buffer "*scratch*" (erase-buffer) (insert "foo") (add-hook 'before-change-functions (lambda (beg end) (message "before change %d %d" beg end)) nil t) (with-temp-buffer (insert "foo") (let ((temp (current-buffer))) (with-current-buffer "*scratch*" (replace-buffer-contents temp))))) Repository revision: 2c242cb1a2956ecfa894d0110b837d4ecc43a69c ------------=_1532196422-13751-1--