[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX] out comment every line
From: |
Nicolas Richard |
Subject: |
Re: [AUCTeX] out comment every line |
Date: |
Tue, 03 Mar 2015 16:19:38 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 |
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.