auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: \hologo with selected text


From: Arash Esbati
Subject: Re: \hologo with selected text
Date: Tue, 02 Mar 2021 22:56:20 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50

Hi Tassilo,

Tassilo Horn <tsdh@gnu.org> 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

[Prev in Thread] Current Thread [Next in Thread]