[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: \hologo with selected text
From: |
Tassilo Horn |
Subject: |
Re: \hologo with selected text |
Date: |
Wed, 03 Mar 2021 07:19:20 +0100 |
User-agent: |
mu4e 1.5.8; emacs 28.0.50 |
Hi Arash,
>> I've now implemented that. If the region is active and the region's
>> text is a logo name contained in `LaTeX-hologo-logo-names', it'll just
>> be wrapped like \hologo{existingLogoName} instead of being queried.
>>
>> Please test!
>
> I did test it: Marking LaTeX2e in a .tex file and doing `C-c C-m
> hologo RET' ends in \hologoLaTeX2e whereas the desired result is
> \hologo{LaTeX2e}.
Eek, I can assure you it works for me, probably because I use
`electric-pair-mode' or something like that...
> How about this definition:
>
> (defun LaTeX-hologo--arg-use-region-or-query-logo-name (optional)
> (if (and (use-region-p)
> (member (buffer-substring (region-beginning) (region-end))
> LaTeX-hologo-logo-names))
> (progn
> (insert TeX-grop)
> (goto-char (region-end))
> (insert TeX-grcl))
> (TeX-argument-insert
> (completing-read
> (TeX-argument-prompt optional nil "Logo name")
> LaTeX-hologo-logo-names)
> optional)))
Yes, that's better! Thanks, pushed!
Bye,
Tassilo