Hi Tassilo,

Tassilo Horn <[email protected]> writes:

> 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}.  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)))

Best, Arash

Reply via email to