Re: How to use the syntax table?

Plamen Tanovski <[email protected]>
Newsgroups gmane.emacs.auc-tex
Message-ID <[email protected]>
Ralf Angeli wrote:

> In case you don't need the functionality of being asked for what to do
> for every match, you could use something like the following function:
> 
> (defun my-TeX-replace-macro-arg (macro string)
>   "Search for MACRO and replace content of first argument with STRING."
>   (interactive "sMacro: \nsReplace content with: ")
>   (save-excursion
>     (let (start)
>       (while (re-search-forward (concat "\\\\" macro "{") nil t)
>       (setq start (point))
>       (goto-char (TeX-find-closing-brace))
>       (store-match-data (list start (1- (point))))
>       (replace-match string)))))
> 
> The function is very basic.  It does not have any error handling and
> matches only macros which have exactly a form of "\foo{bar}".

Thanks. This is a good point for me to start.

Best regards,
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.