unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#10939: 24.0.94; backward-delete-char-untabify read-only error
@ 2012-03-04 13:32 Leo
  2012-03-04 14:56 ` Stefan Monnier
  2012-03-05 19:03 ` Leo
  0 siblings, 2 replies; 5+ messages in thread
From: Leo @ 2012-03-04 13:32 UTC (permalink / raw)
  To: 10939

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





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#10939: 24.0.94; backward-delete-char-untabify read-only error
  2012-03-04 13:32 bug#10939: 24.0.94; backward-delete-char-untabify read-only error Leo
@ 2012-03-04 14:56 ` Stefan Monnier
  2012-03-05 10:40   ` Leo
  2012-03-05 19:03 ` Leo
  1 sibling, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2012-03-04 14:56 UTC (permalink / raw)
  To: Leo; +Cc: 10939

> @@ -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

Looks good, please install,


        Stefan





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#10939: 24.0.94; backward-delete-char-untabify read-only error
  2012-03-04 14:56 ` Stefan Monnier
@ 2012-03-05 10:40   ` Leo
  2012-03-05 15:03     ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Leo @ 2012-03-05 10:40 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 10939

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  <sdl.web@gmail.com>
+
+	* simple.el (backward-delete-char-untabify): Constrain point to
+	field (Bug#10939).
+
 2012-03-05  Chong Yidong  <cyd@gnu.org>
 
 	* 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.






^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#10939: 24.0.94; backward-delete-char-untabify read-only error
  2012-03-05 10:40   ` Leo
@ 2012-03-05 15:03     ` Stefan Monnier
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2012-03-05 15:03 UTC (permalink / raw)
  To: Leo; +Cc: 10939

>> Looks good, please install,
> 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.".

You need to add "bugtracker_debbugs_url = http://debbugs.gnu.org/{id}"
to your ~/.bazaar/bazaar.conf (in the [DEFAULTS] section).


        Stefan





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#10939: 24.0.94; backward-delete-char-untabify read-only error
  2012-03-04 13:32 bug#10939: 24.0.94; backward-delete-char-untabify read-only error Leo
  2012-03-04 14:56 ` Stefan Monnier
@ 2012-03-05 19:03 ` Leo
  1 sibling, 0 replies; 5+ messages in thread
From: Leo @ 2012-03-05 19:03 UTC (permalink / raw)
  To: 10939-done

Fixed in 24.1





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-03-05 19:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-04 13:32 bug#10939: 24.0.94; backward-delete-char-untabify read-only error Leo
2012-03-04 14:56 ` Stefan Monnier
2012-03-05 10:40   ` Leo
2012-03-05 15:03     ` Stefan Monnier
2012-03-05 19:03 ` Leo

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).