From 109aa8a95ecbbb2d7c62c2c98c10132885b1115f Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Mon, 5 Mar 2012 23:53:34 +0800 Subject: [PATCH] * lisp/simple.el (backward-delete-char-untabify): Constrain point to field. Fixes: debbugs:10939 --- lisp/ChangeLog | 3 +++ lisp/simple.el | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a6e04ca25db..394e082ecc8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-03-05 Leo Liu + * simple.el (backward-delete-char-untabify): Constrain point to + field (Bug#10939). + * eshell/em-cmpl.el (eshell-cmpl-initialize): Fix shift-tab key. 2012-03-05 Chong Yidong diff --git a/lisp/simple.el b/lisp/simple.el index 2b4651ba697..45daf99f614 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3463,8 +3463,10 @@ and KILLP is t if a prefix arg was specified." ((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 -- 2.39.2