Arash Esbati <ar...@gnu.org> writes:

> Ikumi Keita <ik...@ikumi.que.jp> writes:
>
>> Hi Didier,
>>
>>> I'm trying to define a macro using the active region (when available) as
>>> its second argument. There is no general facility for using the active
>>> region as an argument value (to the best of my knowledge, there's only
>>> the -1 specification, but it encompasses the macro name itself).
>>
>> (snip)
>>
>>> (defun LaTeX-fixme-active-region (optional)
>>>   (TeX-argument-insert (if (TeX-active-mark)
>>>                        (prog1 (buffer-substring (point) (mark))
>>>                          (delete-region (point) (mark))
>>>                          (deactivate-mark))
>>>                      "")
>>>                    optional))
>>
>>> Now defining my macro as follows:
>>
>>> (TeX-add-symbols `("foo" t LaTeX-fixme-active-region))
>>
>>> will entail the same behavior as with TeX-insert-braces, so I'm enclined
>>> to call that a bug (saving the excursion won't change anything BTW).
>>
>>> Any comment appreciated, thanks!
>>
>> How about this one?  With very breif testing, it seems to work:
>>
>> (defun LaTeX-fixme-active-region (optional)
>>   (TeX-argument-insert "" nil)
>>   (TeX-parse-argument optional nil))
>>
>> (TeX-add-symbols '("foo" LaTeX-fixme-active-region))
>>
>> The idea is very crude and ad hoc, but it does the required job anyway,
>> at the cost that it looks as if the macro "foo" took only one argument.
>
> (I'm going through old bug reports that unfortunately weren't resolved
> at the time.)
>
> Bonjour Didier,
>
> there were 2 responses to your query.  Is there anything else we can do,
> or can we mark this report as done close it?

No further comments, therefore I'm closing this.

Best, Arash



_______________________________________________
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex

Reply via email to