>>> "AE" == Arash Esbati <[email protected]> writes:

> Uwe Brauer <[email protected]> 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. 

Debugger entered--Lisp error: (wrong-number-of-arguments (2 . 3) 4)
  TeX-add-style-hook("refcount" #f(compiled-function () #<bytecode 
0x13f236e00670f278>) ("Default" "Refcount") :latex)
  byte-code("\302\303\304\10\205\20\0\305\306!\205\20\0\306\307!\11$\207" 
[LaTeX-reftex-ref-style-auto-activate TeX-dialect TeX-add-style-hook "refcount" 
#f(compiled-function () #<bytecode 0x13f236e00670f278>) fboundp 
reftex-ref-style-activate "Refcount"] 5)
  load("/home/oub/ALLES/emacs/site-lisp/auctex-private-sty..." nil nil t)
  load-file("/home/oub/ALLES/emacs/site-lisp/auctex-private-sty...")
  TeX-load-style-file("/home/oub/ALLES/emacs/site-lisp/auctex-private-sty...")
  TeX-load-style("refcount")
  #f(compiled-function (style) #<bytecode -0x1bb226a1af849faa>)("refcount")
  mapcar(#f(compiled-function (style) #<bytecode -0x1bb226a1af849faa>) 
("latex2e" "article" "art10" "xr-hyper" "nameref" "refcount" "hyperref" 
"currfile"))
  TeX-run-style-hooks("latex2e" "article" "art10" "xr-hyper" "nameref" 
"refcount" "hyperref" "currfile")
  (lambda nil (TeX-add-to-alist 'LaTeX-provided-package-options '(("hyperref" 
"colorlinks"))) (add-to-list 'LaTeX-verbatim-macros-with-braces-local "path") 
(add-to-list 'LaTeX-verbatim-macros-with-braces-local "url") (add-to-list 
'LaTeX-verbatim-macros-with-braces-local "nolinkurl") (add-to-list 
'LaTeX-verbatim-macros-with-braces-local "hyperbaseurl") (add-to-list 
'LaTeX-verbatim-macros-with-braces-local "hyperimage") (add-to-list 
'LaTeX-verbatim-macros-with-braces-local "hyperref") (add-to-list 
'LaTeX-verbatim-macros-with-braces-local "href") (add-to-list 
'LaTeX-verbatim-macros-with-delims-local "path") (TeX-run-style-hooks "latex2e" 
"article" "art10" "xr-hyper" "nameref" "refcount" "hyperref" "currfile") 
(LaTeX-add-labels "name" "sec:introduction" "eq:1" "eq:2"))()
  #f(compiled-function (hook) #<bytecode -0x17a02d3bb807c89f>)([TeX-style-hook 
(lambda nil (TeX-add-to-alist 'LaTeX-provided-package-options '(("hyperref" 
"colorlinks"))) (add-to-list 'LaTeX-verbatim-macros-with-braces-local "path") 
(add-to-list 'LaTeX-verbatim-macros-with-braces-local "url") (add-to-list 
'LaTeX-verbatim-macros-with-braces-local "nolinkurl") (add-to-list 
'LaTeX-verbatim-macros-with-braces-local "hyperbaseurl") (add-to-list 
'LaTeX-verbatim-macros-with-braces-local "hyperimage") (add-to-list 
'LaTeX-verbatim-macros-with-braces-local "hyperref") (add-to-list 
'LaTeX-verbatim-macros-with-braces-local "href") (add-to-list 
'LaTeX-verbatim-macros-with-delims-local "path") (TeX-run-style-hooks "latex2e" 
"article" "art10" "xr-hyper" "nameref" "refcount" "hyperref" "currfile") 
(LaTeX-add-labels "name" "sec:introduction" "eq:1" "eq:2")) 1])
  mapcar(#f(compiled-function (hook) #<bytecode -0x17a02d3bb807c89f>) 
([TeX-style-hook (lambda nil (TeX-add-to-alist 'LaTeX-provided-package-options 
'(("hyperref" "colorlinks"))) (add-to-list 
'LaTeX-verbatim-macros-with-braces-local "path") (add-to-list 
'LaTeX-verbatim-macros-with-braces-local "url") (add-to-list 
'LaTeX-verbatim-macros-with-braces-local "nolinkurl") (add-to-list 
'LaTeX-verbatim-macros-with-braces-local "hyperbaseurl") (add-to-list 
'LaTeX-verbatim-macros-with-braces-local "hyperimage") (add-to-list 
'LaTeX-verbatim-macros-with-braces-local "hyperref") (add-to-list 
'LaTeX-verbatim-macros-with-braces-local "href") (add-to-list 
'LaTeX-verbatim-macros-with-delims-local "path") (TeX-run-style-hooks "latex2e" 
"article" "art10" "xr-hyper" "nameref" "refcount" "hyperref" "currfile") 
(LaTeX-add-labels "name" "sec:introduction" "eq:1" "eq:2")) 1]))
  #f(compiled-function (style) #<bytecode -0x1bb226a1af849faa>)("docA")
  mapcar(#f(compiled-function (style) #<bytecode -0x1bb226a1af849faa>) ("docA"))
  TeX-run-style-hooks("docA")
  TeX-update-style(t)
  #f(compiled-function () #<bytecode 0x1ee88121cca49e29>)()
  run-hooks(find-file-hook)
  after-find-file(nil t)
  find-file-noselect-1(#<buffer docA.tex> 
"~/ALLES/tex/Test-Styles/External-documents-links/d..." nil nil 
"~/ALLES/tex/Test-Styles/External-documents-links/d..." (4730813 2050))
  find-file-noselect("/home/oub/ALLES/tex/Test-Styles/External-documents..." 
nil nil nil)
  #f(compiled-function (filename &optional wildcards) "Edit file 
FILENAME.\nSwitch to a buffer visiting file FILENAME,\ncreating one if none 
already exists.\nInteractively, the default if you just type RET is the current 
directory,\nbut the visited file name is available through the minibuffer 
history:\ntype \\[next-history-element] to pull it into the minibuffer.\n\nThe 
first time \\[next-history-element] is used after Emacs prompts for\nthe file 
name, the result is affected by `file-name-at-point-functions',\nwhich by 
default try to guess the file name by looking at point in the\ncurrent buffer.  
Customize the value of `file-name-at-point-functions'\nor set it to nil, if you 
want only the visited file name and the\ncurrent directory to be available on 
first \\[next-history-element]\nrequest.\n\nYou can visit files on remote 
machines by specifying something\nlike /ssh:SOME_REMOTE_MACHINE:FILE for the 
file name.  You can\nalso visit local files as a different user by 
specifying\n/sudo::FILE for the file name.\nSee the Info node `(tramp)File name 
Syntax' in the Tramp Info\nmanual, for more about this.\n\nInteractively, or if 
WILDCARDS is non-nil in a call from Lisp,\nexpand wildcards (if any) and visit 
multiple files.  You can\nsuppress wildcard expansion by setting 
`find-file-wildcards' to nil.\n\nTo visit a file without any kind of conversion 
and without\nautomatically choosing a major mode, use \\[find-file-literally]." 
(interactive #f(compiled-function () #<bytecode -0xa4f2815de68f505>)) 
#<bytecode 
-0x3dcdb3a801c3965>)("/home/oub/ALLES/tex/Test-Styles/External-documents..." 
nil)
  ad-Advice-find-file(#f(compiled-function (filename &optional wildcards) "Edit 
file FILENAME.\nSwitch to a buffer visiting file FILENAME,\ncreating one if 
none already exists.\nInteractively, the default if you just type RET is the 
current directory,\nbut the visited file name is available through the 
minibuffer history:\ntype \\[next-history-element] to pull it into the 
minibuffer.\n\nThe first time \\[next-history-element] is used after Emacs 
prompts for\nthe file name, the result is affected by 
`file-name-at-point-functions',\nwhich by default try to guess the file name by 
looking at point in the\ncurrent buffer.  Customize the value of 
`file-name-at-point-functions'\nor set it to nil, if you want only the visited 
file name and the\ncurrent directory to be available on first 
\\[next-history-element]\nrequest.\n\nYou can visit files on remote machines by 
specifying something\nlike /ssh:SOME_REMOTE_MACHINE:FILE for the file name.  
You can\nalso visit local files as a different user by specifying\n/sudo::FILE 
for the file name.\nSee the Info node `(tramp)File name Syntax' in the Tramp 
Info\nmanual, for more about this.\n\nInteractively, or if WILDCARDS is non-nil 
in a call from Lisp,\nexpand wildcards (if any) and visit multiple files.  You 
can\nsuppress wildcard expansion by setting `find-file-wildcards' to nil.\n\nTo 
visit a file without any kind of conversion and without\nautomatically choosing 
a major mode, use \\[find-file-literally]." (interactive #f(compiled-function 
() #<bytecode -0xa4f2815de68f505>)) #<bytecode -0x3dcdb3a801c3965>) 
"/home/oub/ALLES/tex/Test-Styles/External-documents...")
  apply(ad-Advice-find-file #f(compiled-function (filename &optional wildcards) 
"Edit file FILENAME.\nSwitch to a buffer visiting file FILENAME,\ncreating one 
if none already exists.\nInteractively, the default if you just type RET is the 
current directory,\nbut the visited file name is available through the 
minibuffer history:\ntype \\[next-history-element] to pull it into the 
minibuffer.\n\nThe first time \\[next-history-element] is used after Emacs 
prompts for\nthe file name, the result is affected by 
`file-name-at-point-functions',\nwhich by default try to guess the file name by 
looking at point in the\ncurrent buffer.  Customize the value of 
`file-name-at-point-functions'\nor set it to nil, if you want only the visited 
file name and the\ncurrent directory to be available on first 
\\[next-history-element]\nrequest.\n\nYou can visit files on remote machines by 
specifying something\nlike /ssh:SOME_REMOTE_MACHINE:FILE for the file name.  
You can\nalso visit local files as a different user by specifying\n/sudo::FILE 
for the file name.\nSee the Info node `(tramp)File name Syntax' in the Tramp 
Info\nmanual, for more about this.\n\nInteractively, or if WILDCARDS is non-nil 
in a call from Lisp,\nexpand wildcards (if any) and visit multiple files.  You 
can\nsuppress wildcard expansion by setting `find-file-wildcards' to nil.\n\nTo 
visit a file without any kind of conversion and without\nautomatically choosing 
a major mode, use \\[find-file-literally]." (interactive #f(compiled-function 
() #<bytecode -0xa4f2815de68f505>)) #<bytecode -0x3dcdb3a801c3965>) 
"/home/oub/ALLES/tex/Test-Styles/External-documents...")
  find-file("/home/oub/ALLES/tex/Test-Styles/External-documents...")
  dired--find-file(find-file 
"/home/oub/ALLES/tex/Test-Styles/External-documents...")
  
dired--find-possibly-alternative-file("/home/oub/ALLES/tex/Test-Styles/External-documents...")
  dired-find-file()
  funcall-interactively(dired-find-file)
  call-interactively(dired-find-file nil nil)
  command-execute(dired-find-file)

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

Reply via email to