Subject: bug#32237: closed (Re: bug#32237: 27.0.50; Function in before-change-functions is called with first argument greater than the second)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 21 Jul 2018 18:07:02 +0000

Your bug report

#32237: 27.0.50; Function in before-change-functions is called with first argument 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 [email-masked].

-- 
32237: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=32237
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#32237: 27.0.50; Function in before-change-functions is called with first argument greater than the second
From: Eli Zaretskii <[email-masked]>
To: Michał Kondraciuk <[email-masked]>
Cc: [email-masked]
Date: Sat, 21 Jul 2018 21:06:50 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Michał Kondraciuk <[email-masked]>
> 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.

Subject: 27.0.50; Function in before-change-functions is called with first argument greater than the second
From: Michał Kondraciuk <[email-masked]>
To: [email-masked]
Date: Sat, 21 Jul 2018 18:39:26 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

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