[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Underline fontification
From: |
Hendrik Rommeswinkel |
Subject: |
Re: Underline fontification |
Date: |
Sun, 19 Jun 2022 14:24:01 +0000 |
Hi Arash,
Underlining text might be ugly but overlining in mathematics / formal logic is
quite common so it is a pity that the overline cannot be configured in emacs to
actually be useful.
The changes in the ulem.el file are quite straightforward (changing 'textual to
'underline-command for the relevant functions) but writing a new soul.el is
currently beyond me. I presume most of the code in ulem.el is actually doing
package-relevant stuff and cannot just be copied?
modified style/ulem.el
@@ -69,14 +69,15 @@
;; Tell font-lock about the update.
(font-latex-add-keywords '(("useunder" "{{{"))
'function)
+ (font-latex-add-keywords '(("sout" "{")
+ ("xout" "{"))
+ 'textual)
(font-latex-add-keywords '(("uline" "{")
("uuline" "{")
("uwave" "{")
- ("sout" "{")
- ("xout" "{")
("dashuline" "{")
("dotuline" "{"))
- 'textual)))
+ 'underline-command)))
TeX-dialect)
Bests,
Hendrik
Sent with Proton Mail secure email.
------- Original Message -------
On Tuesday, June 14th, 2022 at 7:45 PM, Arash Esbati <arash@gnu.org> wrote:
> Hi Hendrik,
>
> Hendrik Rommeswinkel via Discussion list for AUCTeX developers
> auctex-devel@gnu.org writes:
>
> > I would like to suggest introducing fontification of the \underline
> > command and variations thereof from the ulem and soul packages.
>
>
> Thanks for your suggestion and the patch. In general, I think this is a
> good addition while underlinig text in general is not ;-)
>
> I have a minor comment below, though.
>
> What do others think about this change? I also think this change is
> small enough that we don't need to go through FSF paperwork.
>
> > git diff origin/master master
> > diff --git a/font-latex.el b/font-latex.el
> > index 92b6047a..93ae9bb0 100644
> > --- a/font-latex.el
> > +++ b/font-latex.el
> > @@ -431,6 +431,10 @@ variable `font-latex-fontify-sectioning'." ',num)
> > ("italic-command"
> > (("emph" "{") ("textit" "{") ("textsl" "{") ("mathit" "{"))
> > font-latex-italic-face 1 command)
> > + ("underline-command"
> > + (("underline" "{") ("ul" "{") ("uuline" "{") ("uwave" "{") ("dotuline"
> > "{")
> > + ("dashuline" "{"))
>
>
> In font-latex, we only add keywords provided by vanilla LaTeX. Keywords
> provided by packages go into the corresponding AUCTeX style file, in
> this case style/ulem.el and style/soul.el (which has to written).
> Hence, this becomes
>
> (("underline" "{"))
>
> Best, Arash
publickey - rommeswi@proton.me - 0xA02357C6.asc
Description: application/pgp-keys
signature.asc
Description: OpenPGP digital signature