I added some lines to latex.el to acchieve automatic insertion of
separator lines within tabular environments similar to automatic
insertion of \item within description or itemize environments.
The diff is below (sorry, I'm no expert in creating diffs/patches, so I
used Emacs' diff-backup).
diff -c /usr/local/share/emacs/site-lisp/auctex/latex.el\~
/usr/local/share/emacs/site-lisp/auctex/latex.el
*** /usr/local/share/emacs/site-lisp/auctex/latex.el~ 2012-03-21
00:25:06.143391917 +0100
--- /usr/local/share/emacs/site-lisp/auctex/latex.el 2012-06-03
13:29:25.224582648 +0200
***************
*** 1133,1138 ****
--- 1133,1150 ----
"Insert a new bibitem."
(TeX-insert-macro "bibitem"))
+ (defun LaTeX-item-tabular ()
+ (interactive)
+ (save-excursion
+ (re-search-backward
+ "\\\\\\(begin\\|end\\) *{ *tabular *} *{\\([^%]*\\)}" nil t)
+ (message (match-string 2))
+ )
+ (let ((tableformat
+ (replace-regexp-in-string "{.*?}\\||\\|@\\| " "" (match-string 2))))
+ (message tableformat)
+ (insert (replace-regexp-in-string "." "& " tableformat) "\\\\")))
+
;;; Parser
(defvar LaTeX-auto-minimal-regexp-list
***************
*** 5054,5060 ****
(make-local-variable 'LaTeX-item-list)
(setq LaTeX-item-list '(("description" . LaTeX-item-argument)
! ("thebibliography" . LaTeX-item-bib)))
(setq TeX-complete-list
(append '(("\\\\cite\\[[^]\n\r\\%]*\\]{\\([^{}\n\r\\%,]*\\)"
--- 5066,5073 ----
(make-local-variable 'LaTeX-item-list)
(setq LaTeX-item-list '(("description" . LaTeX-item-argument)
! ("thebibliography" . LaTeX-item-bib)
! ("tabular" . LaTeX-item-tabular)))
(setq TeX-complete-list
(append '(("\\\\cite\\[[^]\n\r\\%]*\\]{\\([^{}\n\r\\%,]*\\)"
Diff finished. Sun Jun 3 13:32:45 2012
_______________________________________________
auctex-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/auctex-devel