[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Please revamp the way floatrow.el handles figure defaults
From: |
Ikumi Keita |
Subject: |
Re: Please revamp the way floatrow.el handles figure defaults |
Date: |
Sun, 09 Feb 2025 22:40:30 +0900 |
Hi Arash,
>>>>> Arash Esbati <arash@gnu.org> writes:
>> But maybe you could put some warning into the description of the
>> LaTeX-update-style-hook that some styles might still use later hooks
>> to override its settings and mention some later hook that ensures that
>> won't happen (I guess TeX-auto-cleanup-hook).
> What do others think?
I don't have a particular objection against Alexander's idea.
>>> We decided long time ago to put things like this in AUCTeX style files
>>> which add entries to the parser:
>>>
>>> (add-hook 'TeX-auto-prepare-hook #'LaTeX-floatrow-auto-prepare t)
>>> (add-hook 'TeX-auto-cleanup-hook #'LaTeX-floatrow-auto-cleanup t)
>>> (add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
Honestly, I don't think this is an ideal treatment. Normally,
`TeX-auto-parse' is called in `TeX-auto-apply' called in
`TeX-update-style'. Thus adding `TeX-auto-parse' in
`TeX-update-style-hook' leads to calling `TeX-auto-parse' twice; it's
apparently an overhead. :-(
,----
| (defun TeX-update-style (&optional force)
| [...]
| (if (and TeX-parse-self
| (null (cdr-safe (assoc (TeX-strip-extension nil nil t)
| TeX-style-hook-list))))
| (TeX-auto-apply)) <---
| (run-hooks 'TeX-update-style-hook) <---
`----
However, I suppose it is very difficult to avoid this duplication under
the current implementation of "style application" of AUCTeX. In
addition, it's very complicated and it doesn't seem to me that we can
refactor it into a more sophisticated form to allow such fine-grained
separation keeping backward compatibility.
Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW