auctex
[Top][All Lists]
Advanced

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

Re: Custom RefTeX TOC entry


From: Arash Esbati
Subject: Re: Custom RefTeX TOC entry
Date: Thu, 02 Feb 2023 16:52:52 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Alessandro Bertulli <alessandro.bertulli96@gmail.com> writes:

> Arash Esbati <arash@gnu.org> writes:
>
>> I meant this part of the code from songs.el is not good:
>>
>>    ;; Tell RefTeX:
>>    (when (boundp 'reftex-section-levels)
>>      (dolist (elt '(("songchapter" . 0) ("songsection" . 1)))
>>        (add-to-list 'reftex-section-levels elt t)))
>>
>> I think we should leave this change to the users and an AUCTeX style
>> doesn't touch this variable at all.
>
> I am by no way an experienced user, so you surely will know better than
> me. However, according to the `songs` manual, `\songsection` is just the
> same as `\section`, so to me it makes sense to treat them equally. Same
> goes for `\songchapter`.

Yes, I understood that, but I didn't pay attention to the fact that
lists inside `reftex-section-levels' should be sorted; `add-to-list'
doesn't do that.  Now one could write a function which puts entries
"songchapter" and "songsection" in better places, but that would
probably never hit the user expectation.  But as always, patches are
welcome ;-)

> Treating each song as a different paragraph is OTOH just a convenience,
> but I find it useful (since usually if you're writing a song book that
> will be the basic unit of text you'll manipulate).

You mean the part with `LaTeX-paragraph-commands-add-locally', right?  I
thought it would be useful because of the similarity with \section and
\chapter.

> I've expanded the style code a bit, feel free to check it out and
> correct me if I did somenthing wrong

LGTM.  OTOH, you can tell best since you use that package :-)

> I have BTW one question about it: songs need to be inserted between
> `\beginsong` and `\endsong` commands. Those look like an environment to
> me, but LaTeX environments are inserted between `\begin{}` and `\end{}`
> macros. Where should I put those in the style file, so that AUCTeX
> inserts them in couples?

See attached; now you can insert \beginsong like a regular macro with
'C-c C-m beginsong RET' and you get the rest.  WDYT?

Best, Arash

Attachment: songs.el
Description: application/emacs-lisp


reply via email to

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