]> code.delx.au - gnu-emacs/commitdiff
(tabify): Include entire first line in narrowing.
authorRichard M. Stallman <rms@gnu.org>
Thu, 13 Apr 1995 17:04:57 +0000 (17:04 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 13 Apr 1995 17:04:57 +0000 (17:04 +0000)
lisp/tabify.el

index aab939550c2ef435e74e660ce7c1f5cbc81de79a..62d50aa03316f66822965e33ebd46c66160487ca 100644 (file)
@@ -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))