Fix my/delete-backward-char-or-tab
This commit is contained in:
@@ -321,7 +321,7 @@ If there is only whitespace between point and the beginning of the current line,
|
|||||||
delete N characters worth of tabs, rounding up. For example, if N is 2 and
|
delete N characters worth of tabs, rounding up. For example, if N is 2 and
|
||||||
`tab-width' is 4, delete one tab. If `indent-tabs-mode' is nil, instead delete
|
`tab-width' is 4, delete one tab. If `indent-tabs-mode' is nil, instead delete
|
||||||
`tab-width' spaces. In this case, deletion stops at the beginning of the
|
`tab-width' spaces. In this case, deletion stops at the beginning of the
|
||||||
current line.
|
current line unless point is at the beginning of a line.
|
||||||
|
|
||||||
If point is anywhere else on the line, delete N characters.
|
If point is anywhere else on the line, delete N characters.
|
||||||
|
|
||||||
@@ -338,8 +338,10 @@ If KILLFLAG is non-nil, save the deleted text to the kill ring."
|
|||||||
(backward-prefix-chars)
|
(backward-prefix-chars)
|
||||||
(>= (point) start))))
|
(>= (point) start))))
|
||||||
(count-chars-for-delete-tab ()
|
(count-chars-for-delete-tab ()
|
||||||
|
(if (bolp)
|
||||||
|
1
|
||||||
(min (* (ceiling n tab-width) (if indent-tabs-mode 1 tab-width))
|
(min (* (ceiling n tab-width) (if indent-tabs-mode 1 tab-width))
|
||||||
(- (point) (pos-bol)))))
|
(- (point) (pos-bol))))))
|
||||||
(if (not (only-indentation-p))
|
(if (not (only-indentation-p))
|
||||||
(delete-char (- n) killflag)
|
(delete-char (- n) killflag)
|
||||||
(delete-char (- (count-chars-for-delete-tab)) killflag))))
|
(delete-char (- (count-chars-for-delete-tab)) killflag))))
|
||||||
|
|||||||
Reference in New Issue
Block a user