auctex-devel
[Top][All Lists]
Advanced

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

Re: some new extension of xr-hyperref/hyperref


From: Uwe Brauer
Subject: Re: some new extension of xr-hyperref/hyperref
Date: Sat, 02 Dec 2023 08:11:07 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

>>> "AE" == Arash Esbati <arash@gnu.org> writes:

> Uwe Brauer <oub@mat.ucm.es> writes:
>> Fair enough, but then you might try later to add some modified reftex
>> support? I will try to send a patch later (against the latest master).

> There is really no need to add modified RefTeX support.  Suppose you
> write a refcount.el which looks like this:

> (TeX-add-style-hook
>  "refcount"
>  (lambda ()
>    (TeX-add-symbol
>     '("setcounterref" TeX-arg-counter TeX-arg-ref)
>     '("getrefbykeydefault"
>       TeX-arg-ref
>       (TeX-arg-completing-read ("page" "title" "name" "anchor" "url"))
>       "Default")))
>  ;; RefTeX reference style
>  (and LaTeX-reftex-ref-style-auto-activate
>       (fboundp 'reftex-ref-style-activate)
>       (reftex-ref-style-activate "Refcount"))
>  TeX-dialect)


Two remarks:

    1. It should be *TeX-add-symbols* not *TeX-add-symbol*, right?

    2. When I put this file in my private auctex style list, compile it,
       restart emacs open a file that contains \usepackage{refcount}
       I obtain an error that I attach.


> You only need to adjust `reftex-ref-style-alist' via customize or the
> code you sent, say in your init file:

>   (add-to-list 'reftex-ref-style-alist
>                '("Refcount" "refcount" (("\\getrefbykeydefault" ?G)))
>                t)

Ok, that works (or should work) because of the lines

--8<---------------cut here---------------start------------->8---
  (and LaTeX-reftex-ref-style-auto-activate
       (fboundp 'reftex-ref-style-activate)
       (reftex-ref-style-activate "Refcount"))
--8<---------------cut here---------------end--------------->8---

But then shouldn't something like this be added to nameref also, so that
the private setting 

--8<---------------cut here---------------start------------->8---
(add-to-list 'reftex-ref-style-alist
               '("Nameref" "nameref" (("\\nameref" ?m)))
               t)
--8<---------------cut here---------------end--------------->8---

Would work as well?

> For you, it should work, and for others without this entry, RefTeX
> should discard to code in the .el file silently (at least this is the
> theory).

But as I said I encounter problems.


>> BTW I had no time to test your patch for which you called for testers,
>> sorry.

> No problem, our usual process is to put code into testing via an ELPA
> release ;-)

>> I know you and others are not very fond of the idea to mix reftex code
>> into auctex, but then nobody is forced to use that code....

> The point is that I'm not fond of the idea to add a hard-coded entry to
> a user custom variable, in this case ?G for instance.  Others may use ?G
> for a different macro, how do we make sure there is no such clash?

Ok understood.

-- 
I strongly condemn Hamas heinous atrocities on Israel, especially the 
despicable pogroms.
I strongly condemn Putin's war of aggression against Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the EU and NATO membership of Ukraine. 

Attachment: refcount-bug.txt
Description: Text document

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

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