Le 03/03/2015 15:57, Lars Madsen a écrit :
> Here is a sample of what happens
Great. One solution is to use markers.
See (info "(elisp) Overview of Markers") for more information about
markers. What we need here is the following property:
| But the marker's position value can change during the life of
| the marker, and often does. Insertion and deletion of text in the
| buffer relocate the marker.
Please try the following change
> (defun mytest ()
> (interactive)
> (let (
> beg
> end
> (T 0.5)
> )
> (sit-for T)
> (re-search-forward "{" nil t)
> (sit-for T)
> (goto-char (match-beginning 0))
> (sit-for T)
> (setq beg (point))
> (sit-for T)
> (forward-sexp)
> (sit-for T)
> (setq end (point))
Use (point-marker) here.
> (sit-for T)
> (TeX-comment-region beg end)
> (sit-for T)
> (goto-char end)
> )
> )
HTH,
--
Nicolas.
_______________________________________________
auctex mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/auctex