summaryrefslogtreecommitdiff
path: root/lisp/tabify.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-04-13 17:04:57 +0000
committerRichard M. Stallman <rms@gnu.org>1995-04-13 17:04:57 +0000
commit7be313ea3b46a5877b0f2b2ee6639f1c3d660fef (patch)
tree48415c0f01e0f5d8491a59edec6f129b532787f0 /lisp/tabify.el
parent7af318194c2b9ade7c15e0e7f427041388e4a483 (diff)
downloademacs-7be313ea3b46a5877b0f2b2ee6639f1c3d660fef.tar.gz
(tabify): Include entire first line in narrowing.
Diffstat (limited to 'lisp/tabify.el')
-rw-r--r--lisp/tabify.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/tabify.el b/lisp/tabify.el
index aab939550c2..62d50aa0331 100644
--- a/lisp/tabify.el
+++ b/lisp/tabify.el
@@ -57,7 +57,11 @@ The variable `tab-width' controls the spacing of tab stops."
(interactive "r")
(save-excursion
(save-restriction
- (narrow-to-region start end)
+ ;; Include the beginning of the line in the narrowing
+ ;; since otherwise it will throw off current-column.
+ (goto-char start)
+ (beginning-of-line)
+ (narrow-to-region (point) end)
(goto-char start)
(while (re-search-forward "[ \t][ \t][ \t]*" nil t)
(let ((column (current-column))