Fix latex-tsv-to-table

This commit is contained in:
Adam Goldsmith 2015-10-05 18:26:06 -04:00
parent 6ff2c8e007
commit eb3b61a9ef

View File

@ -157,12 +157,12 @@
(defun latex-tsv-to-table ()
"Converts tab-seperated-values to a LaTeX table."
(interactive)
(let ((beg (region-beginning)) (lines (count-lines (region-beginning) (region-end))))
(let ((beg (region-beginning)) (end-line (line-number-at-pos (region-end))))
(save-excursion
(goto-char beg)
(indent-region beg (point))
(replace-regexp "\t" " & " nil beg (point))
(replace-regexp "$" " \\\\\\\\" nil beg (point))
(goto-line end-line)
(indent-region beg (point-at-eol))
(replace-regexp "\t" " & " nil beg (point-at-eol))
(replace-regexp "$" " \\\\\\\\" nil beg (point-at-eol))
(align beg (point))))))
(use-package fasd
:config