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
commit37feda7bb70de0475576fc4daf0d728264149784 (patch)
treec7b78783205084fd1dddaf34d302f45b8139d619 /lisp/tabify.el
parentf9aff3f4ded05d1c61df69598ca2e1be673f6d0d (diff)
downloademacs-37feda7bb70de0475576fc4daf0d728264149784.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))