;;; moy-latex.el --- Some stuff in addition to AUC-TeX ;; Copyright (C) 2002 ;; Author: Matthieu Moy ;; Keywords: tex ;; This file is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2, or (at your option) ;; any later version. ;; This file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;;; Commentary: ;; ;;; Code: (defun moy-gastex-move-horizontal-or-vertical (b e shift regexp-to-match) (save-restriction (save-excursion (narrow-to-region b e) (goto-char (point-min)) (while (re-search-forward regexp-to-match (point-max) t) (let* ((oldvalue-string (match-string 2)) (oldvalue (string-to-int oldvalue-string)) (newvalue (+ oldvalue shift))) (search-backward oldvalue-string) (delete-char (string-width oldvalue-string)) (insert (int-to-string newvalue)) ) ) )) ) ;;;###autoload (defun moy-gastex-move-horizontal (b e shift) "Moves the gastex automaton in the region horizontally." (interactive "r nShift: ") (moy-gastex-move-horizontal-or-vertical b e (or shift 10) "\\\\[a-z]*\\(\\[[^\\]*]\\)?([^)]*)(\\([0-9]+\\)," ) ) ;;;###autoload (defun moy-gastex-move-vertical (b e shift) "Moves the gastex automaton in the region horizontally." (interactive "r nShift: ") (moy-gastex-move-horizontal-or-vertical b e (or shift 10) "\\\\[a-z]*\\(\\[[^\\]*]\\)?([^)]*)([0-9]+,\\([0-9]+\\))" ) ) (provide 'moy-latex) ;;; moy-latex.el ends here ;; Testing purpose. ; \node[Nframe=n](L1)(42,110){$\idl{a}$} ; \node(A1)(62,110){} ; \node[Nmarks=r](B1)(92,110){} ; \drawedge(A1,B1){$a$}