> Uwe Brauer <o...@mat.ucm.es> writes: > Hi Uwe,
> I didn't test it, but I'm pretty sure about the syntax ;-) If you look > closer at my code above for RefTeX, you'll see that it uses backquote ` > and not a quote '. See here for why[1]. Ok then I thought that was malformed by the MTA. Thanks for clarifying. > If you want to put that stuff in your .emacs, try something like this: > (with-eval-after-load "latex" > (add-to-list 'LaTeX-label-alist '("titledquestion" . LaTeX-exam-label))) > (require 'reftex) > (add-to-list 'reftex-label-alist > `("titledquestion" ?x > ,(concat LaTeX-exam-label "%f:") > "~\\ref{%s}" nil ("ejercicio") )) The latter did not work. I tried emacs -Q and loaded the file (require 'reftex) (add-to-list 'reftex-label-alist `("titledquestion" ?x ,(concat LaTeX-exam-label "%f:") "~\\ref{%s}" nil ("ejercicio") )) and obtained cons: Symbol's value as variable is void: LaTeX-exam-label So I did the following (defun my-reftex-label-alist-6 () "Sets reftex-label to have a 6th entry" (interactive) (setq reftex-label-alist '(`("titledquestion" ?x ,(concat LaTeX-exam-label "%f:") "~\\ref{%s}" nil ("ejercicio") )))) (add-hook 'reftex-mode-hook 'my-reftex-label-alist-6) And then run a test in file exam-test.tex When inserting a titledquestion I obtained an error: Debugger entered--Lisp error: (wrong-type-argument characterp ("titledquestion" 120 (\, (concat LaTeX-exam-label "%f:")) "~\\ref{%s}" nil ("ejercicio"))) char-to-string(("titledquestion" 120 (\, (concat LaTeX-exam-label "%f:")) "~\\ref{%s}" nil ("ejercicio"))) reftex-compile-variables() reftex-ensure-compiled-variables() reftex-access-scan-info(nil) reftex-label("questions" nil) LaTeX-label("questions" environment) LaTeX-exam-insert-label(nil) TeX-parse-argument(nil LaTeX-exam-insert-label) TeX-parse-arguments(("Title" ["Points"] LaTeX-exam-insert-label (TeX-arg-literal " "))) TeX-parse-macro("titledquestion" ("Title" ["Points"] LaTeX-exam-insert-label (TeX-arg-literal " "))) TeX-insert-macro("titledquestion") funcall-interactively(TeX-insert-macro "titledquestion") call-interactively(TeX-insert-macro nil nil) command-execute(TeX-insert-macro) _______________________________________________ auctex-devel mailing list auctex-devel@gnu.org https://lists.gnu.org/mailman/listinfo/auctex-devel