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

From: Leo <[email-masked]>
Date: Mon, 05 Mar 2012 18:40:14 +0800

On 2012-03-04 22:56 +0800, Stefan Monnier wrote:
> Looks good, please install,
>
>
>         Stefan

I want to try out the C-c C-a command in *VC-log* buffer. But getting
this "bzr: ERROR: Unrecognized bug debbugs:10939. Commit refused.".

Debugger entered--Lisp error: (error #("Running bzr commit -m * ... --fixes debbugs:10939 lisp/ChangeLog lisp/simple.el...FAILED (status 3)" 22 24 (fontified t) 36 44 (face log-edit-header fontified t) 44 49 (face log-edit-header fontified t)))
  signal(error (#("Running bzr commit -m * ... --fixes debbugs:10939 lisp/ChangeLog lisp/simple.el...FAILED (status 3)" 22 24 (fontified t) 36 44 (face log-edit-header fontified t) 44 49 (face log-edit-header fontified t))))
  error("Running %s...FAILED (%s)" #("bzr commit -m * ... --fixes debbugs:10939 lisp/ChangeLog lisp/simple.el" 14 16 (fontified t) 28 36 (fontified t face log-edit-header) 36 41 (fontified t face log-edit-header)) "status 3")
  vc-do-command("*vc*" 0 "bzr" ("/Users/Shared/sources/EmacsBZR/trunk/lisp/ChangeLog" "/Users/Shared/sources/EmacsBZR/trunk/lisp/simple.el") "commit" "-m" #("* lisp/simple.el (backward-delete-char-untabify): Constrain point to\nfield.\n" 0 2 (fontified t) 2 16 (fontified t) 16 76 (fontified t)) "--fixes" #("debbugs:10939" 0 8 (fontified t face log-edit-header) 8 13 (fontified t face log-edit-header)))
  apply(vc-do-command "*vc*" 0 "bzr" ("/Users/Shared/sources/EmacsBZR/trunk/lisp/ChangeLog" "/Users/Shared/sources/EmacsBZR/trunk/lisp/simple.el") "commit" ("-m" #("* lisp/simple.el (backward-delete-char-untabify): Constrain point to\nfield.\n" 0 2 (fontified t) 2 16 (fontified t) 16 76 (fontified t)) "--fixes" #("debbugs:10939" 0 8 (fontified t face log-edit-header) 8 13 (fontified t face log-edit-header))))
  vc-bzr-command("commit" nil 0 ("/Users/Shared/sources/EmacsBZR/trunk/lisp/ChangeLog" "/Users/Shared/sources/EmacsBZR/trunk/lisp/simple.el") "-m" #("* lisp/simple.el (backward-delete-char-untabify): Constrain point to\nfield.\n" 0 2 (fontified t) 2 16 (fontified t) 16 76 (fontified t)) "--fixes" #("debbugs:10939" 0 8 (fontified t face log-edit-header) 8 13 (fontified t face log-edit-header)))
 .........

The vc-diff is:
=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog	2012-03-05 06:10:11 +0000
+++ lisp/ChangeLog	2012-03-05 10:30:14 +0000
@@ -1,3 +1,8 @@
+2012-03-05  Leo Liu  <[email-masked]>
+
+	* simple.el (backward-delete-char-untabify): Constrain point to
+	field (Bug#10939).
+
 2012-03-05  Chong Yidong  <[email-masked]>
 
 	* simple.el (count-words): If called from Lisp, return the word

=== modified file 'lisp/simple.el'
--- lisp/simple.el	2012-03-05 06:10:11 +0000
+++ lisp/simple.el	2012-03-05 10:28:16 +0000
@@ -3463,8 +3463,10 @@
                      ((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

And VC-log buffer has:

Fixes: debbugs:10939

* lisp/simple.el (backward-delete-char-untabify): Constrain point to
field.