Rodolfo Medina <[email protected]> writes:
> (defun my-cancel-bar-numbers ()
> (interactive)
> (replace-regexp "\\\\bar %[0-9]+" "\\\\bar" nil (if (use-region-p)
> (region-beginning)) (if (use-region-p) (region-end)) nil)
> )
>
> and
>
> (defun my-number-bars ()
> (interactive)
> (replace-regexp "\\\\bar" (quote (replace-eval-replacement concat "\\\\bar %"
> (replace-quote (+ 2 replace-count)))) nil (if (use-region-p)
> (region-beginning)) (if (use-region-p) (region-end)) nil)
> )
>
> After all, I can use them separately, preceeded by `M-h'. But do you think
> it's possible, in the second definition, to replace not only `\bar' but the
> whole line including it...? That way, I could do without the first
> definition... I mean, use `replace-regexp' with sort of jolly expressions:
> replace `\bar' and whatever comes after it in the line...
This, alone, seems to do what I want:
(defun my-reset-bar-numbers ()
(interactive)
(replace-regexp "\\\\bar.*" (quote (replace-eval-replacement concat "\\\\bar %"
(replace-quote (+ 2 replace-count)))) nil (if (use-region-p)
(region-beginning)) (if (use-region-p) (region-end)) nil)
)
, possibly with `M-h' prefix...
Thanks, Joost and David...
Rodolfo
_______________________________________________
auctex mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/auctex