Subject: bug#10939: closed (Re: bug#10939: 24.0.94; backward-delete-char-untabify read-only error)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 05 Mar 2012 19:06:02 +0000

Your bug report

#10939: 24.0.94; backward-delete-char-untabify read-only error

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].

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

Subject: Re: bug#10939: 24.0.94; backward-delete-char-untabify read-only error
From: Leo <[email-masked]>
To: [email-masked]
Date: Tue, 06 Mar 2012 03:03:57 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Fixed in 24.1

Subject: 24.0.94; backward-delete-char-untabify read-only error
From: Leo <[email-masked]>
To: [email-masked]
Date: Sun, 04 Mar 2012 21:32:27 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

1. (setq backward-delete-char-untabify-method 'hungry)
2. (setq enable-recursive-minibuffers t)
3. M-: and then type some spaces
4. M-x backward-delete-char-untabify

You should see something like:
  delete-backward-char: Text is read-only

This patch fixes it:

diff --git a/lisp/simple.el b/lisp/simple.el
index c14d0d70..0faf54bc 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3458,8 +3458,10 @@ (defun backward-delete-char-untabify (arg &optional killp)
                      ((eq backward-delete-char-untabify-method 'all)
                       " \t\n\r")))
          (n (if skip
-                (let ((wh (- (point) (save-excursion (skip-chars-backward skip)
-                                                     (point)))))
+                (let* ((oldpt (point))
+                       (wh (- oldpt (save-excursion
+                                      (skip-chars-backward skip)
+                                      (constrain-to-field nil oldpt)))))
                   (+ arg (if (zerop wh) 0 (1- wh))))
               arg)))
     ;; Avoid warning about delete-backward-char