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
|
||||
`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
|
||||
current line.
|
||||
current line unless point is at the beginning of a line.
|
||||
|
||||
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)
|
||||
(>= (point) start))))
|
||||
(count-chars-for-delete-tab ()
|
||||
(min (* (ceiling n tab-width) (if indent-tabs-mode 1 tab-width))
|
||||
(- (point) (pos-bol)))))
|
||||
(if (bolp)
|
||||
1
|
||||
(min (* (ceiling n tab-width) (if indent-tabs-mode 1 tab-width))
|
||||
(- (point) (pos-bol))))))
|
||||
(if (not (only-indentation-p))
|
||||
(delete-char (- n) killflag)
|
||||
(delete-char (- (count-chars-for-delete-tab)) killflag))))
|
||||
|
||||
Reference in New Issue
Block a user