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

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