Discussion:
[AUCTeX] Symbol's function definition is void: nil
Alad Wenter
2017-11-16 14:46:53 UTC
Permalink
Hi,

I have installed AUCTeX on emacs-25.2-x86_64, emacs-25-x86_64-deps and Windows 7 using GNU ELPA. (I don't use emacs 25.3 due to a DLL issue: [1])

When trying to Generate previews, I get a "Symbol's function definition is void: nil" error. I've set the TeX engine to luatex with the TeX-engine-set command.

Toggling debug-on-error results in the following output: (I replaced the file names with ## in the output)

Debugger entered--Lisp error: (void-function nil)
nil(nil t)
apply(nil (nil t))
(concat (and (stringp TeX-command-pos) TeX-command-pos) (apply (function nil) args) (and (stringp TeX-command-pos) TeX-command-pos))
(shell-quote-argument (concat (and (stringp TeX-command-pos) TeX-command-pos) (apply (function nil) args) (and (stringp TeX-command-pos) TeX-command-pos)))
(lambda (&rest args) (shell-quote-argument (concat (and (stringp TeX-command-pos) TeX-command-pos) (apply (function nil) args) (and (stringp TeX-command-pos) TeX-command-pos))))(nil t)
apply((lambda (&rest args) (shell-quote-argument (concat (and (stringp TeX-command-pos) TeX-command-pos) (apply (function nil) args) (and (stringp TeX-command-pos) TeX-command-pos)))) (nil t))
TeX-command-expand("%(latex)" nil)
TeX-inline-preview-internal("lualatex --jobname=\"_region_\" -file-line-error \"\\nonstopmode\\nofiles\\PassOptionsToPackage{active,tightpage,auctex}{preview}\\AtBeginDocument{\\ifx\\ifPreview\\undefined\\RequirePackage[displaymath,floats,graphics,textmath,sections,footnotes]{preview}[2004/11/05]\\fi}\" \"\\input\" \"_region_.tex\"" "_region_" (TeX-region-file . "_region_") #<buffer ##.tex> ("##" "lualatex -ini -interaction=nonstopmode \"&lualatex\" \"prv_##\".ini \"\\nonstopmode\\nofiles\\PassOptionsToPackage{active,tightpage,auctex}{preview}\\AtBeginDocument{\\ifx\\ifPreview\\undefined\\RequirePackage[displaymath,floats,graphics,textmath,sections,footnotes]{preview}[2004/11/05]\\fi}\" \"\\input\" \"##.tex\"" . #<overlay from 1 to 55 in ##.tex>) "##" ((lambda nil (/ 10.2 (preview-document-pt))) (72.05673758865248 . 71.88679245283019) [nil nil nil nil]))
preview-generate-preview(t "_region_" "lualatex --jobname=\"_region_\" -file-line-error \"\\nonstopmode\\nofiles\\PassOptionsToPackage{active,tightpage,auctex}{preview}\\AtBeginDocument{\\ifx\\ifPreview\\undefined\\RequirePackage[displaymath,floats,graphics,textmath,sections,footnotes]{preview}[2004/11/05]\\fi}\" \"\\input\" \"_region_.tex\"")
preview-region(1 9393)
preview-at-point()
funcall-interactively(preview-at-point)
call-interactively(preview-at-point nil nil)
command-execute(preview-at-point)

My .emacs file:

;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)

(put 'downcase-region 'disabled nil)
(put 'dired-find-alternate-file 'disabled nil)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(package-selected-packages (quote (ada-mode auctex))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)

My .emacs.d folder is empty apart from elpa, auto-save-list and a bookarks file. I have no other packages installed apart from AUCTeX. How can I troubleshoot this issue?

Best,
Alad

[1] http://gnu.emacs.help.narkive.com/4kg9yq1P/unable-to-run-64-bit-gnu-emacs-25-3-on-windows-7-professional-service-pack-1
David Kastrup
2017-11-16 15:24:41 UTC
Permalink
Post by Alad Wenter
I have installed AUCTeX on emacs-25.2-x86_64, emacs-25-x86_64-deps and Windows 7 using GNU ELPA. (I don't use emacs 25.3 due to a DLL issue: [1])
When trying to Generate previews, I get a "Symbol's function definition is void: nil" error. I've set the TeX engine to luatex with the TeX-engine-set command.
Toggling debug-on-error results in the following output: (I replaced the file names with ## in the output)
Debugger entered--Lisp error: (void-function nil)
nil(nil t)
apply(nil (nil t))
(concat (and (stringp TeX-command-pos) TeX-command-pos) (apply (function nil) args) (and (stringp TeX-command-pos) TeX-command-pos))
(shell-quote-argument (concat (and (stringp TeX-command-pos) TeX-command-pos) (apply (function nil) args) (and (stringp TeX-command-pos) TeX-command-pos)))
(lambda (&rest args) (shell-quote-argument (concat (and (stringp TeX-command-pos) TeX-command-pos) (apply (function nil) args) (and (stringp TeX-command-pos) TeX-command-pos))))(nil t)
apply((lambda (&rest args) (shell-quote-argument (concat (and (stringp TeX-command-pos) TeX-command-pos) (apply (function nil) args) (and (stringp TeX-command-pos) TeX-command-pos)))) (nil t))
TeX-command-expand("%(latex)" nil)
TeX-inline-preview-internal("lualatex --jobname=\"_region_\" -file-line-error \"\\nonstopmode\\nofiles\\PassOptionsToPackage{active,tightpage,auctex}{preview}\\AtBeginDocument{\\ifx\\ifPreview\\undefined\\RequirePackage[displaymath,floats,graphics,textmath,sections,footnotes]{preview}[2004/11/05]\\fi}\" \"\\input\" \"_region_.tex\"" "_region_" (TeX-region-file . "_region_") #<buffer ##.tex> ("##" "lualatex -ini -interaction=nonstopmode \"&lualatex\" \"prv_##\".ini \"\\nonstopmode\\nofiles\\PassOptionsToPackage{active,tightpage,auctex}{preview}\\AtBeginDocument{\\ifx\\ifPreview\\undefined\\RequirePackage[displaymath,floats,graphics,textmath,sections,footnotes]{preview}[2004/11/05]\\fi}\" \"\\input\" \"##.tex\"" . #<overlay from 1 to 55 in ##.tex>) "##" ((lambda nil (/ 10.2 (preview-document-pt))) (72.05673758865248 . 71.88679245283019) [nil nil nil nil]))
preview-generate-preview(t "_region_" "lualatex --jobname=\"_region_\" -file-line-error \"\\nonstopmode\\nofiles\\PassOptionsToPackage{active,tightpage,auctex}{preview}\\AtBeginDocument{\\ifx\\ifPreview\\undefined\\RequirePackage[displaymath,floats,graphics,textmath,sections,footnotes]{preview}[2004/11/05]\\fi}\" \"\\input\" \"_region_.tex\"")
preview-region(1 9393)
preview-at-point()
funcall-interactively(preview-at-point)
call-interactively(preview-at-point nil nil)
command-execute(preview-at-point)
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)
(put 'downcase-region 'disabled nil)
(put 'dired-find-alternate-file 'disabled nil)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(package-selected-packages (quote (ada-mode auctex))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
My .emacs.d folder is empty apart from elpa, auto-save-list and a bookarks file. I have no other packages installed apart from AUCTeX. How can I troubleshoot this issue?
Best,
Alad
[1] http://gnu.emacs.help.narkive.com/4kg9yq1P/unable-to-run-64-bit-gnu-emacs-25-3-on-windows-7-professional-service-pack-1
Looks to me like

commit 370a4b92155aebf3d0860c1211617d14d8e7951c
Author: Ikumi Keita <***@ikumi.que.jp>
Date: Fri May 26 22:29:59 2017 +0900

Resolve preview-latex incompatibility with Japanese TeX (Bug#25322)
[...]

is responsible here. It adds the line

(TeX-command-expand "%(latex)" nil)))))

which is an invalid use of TeX-command-expand (I have no idea how this
could have ever worked).

I have no idea what the intent of that line ever was. "nil" probably
needs to be some file expansion function.
--
David Kastrup
Ikumi Keita
2017-11-16 17:13:43 UTC
Permalink
Hi Alad and David,
Post by David Kastrup
Post by Alad Wenter
I have installed AUCTeX on emacs-25.2-x86_64, emacs-25-x86_64-deps and Windows 7 using GNU ELPA. (I don't use emacs 25.3 due to a DLL issue: [1])
When trying to Generate previews, I get a "Symbol's function definition is void: nil" error. I've set the TeX engine to luatex with the TeX-engine-set command.
Toggling debug-on-error results in the following output: (I replaced the file names with ## in the output)
Debugger entered--Lisp error: (void-function nil)
nil(nil t)
apply(nil (nil t))
(concat (and (stringp TeX-command-pos) TeX-command-pos) (apply (function nil) args) (and (stringp TeX-command-pos) TeX-command-pos))
(shell-quote-argument (concat (and (stringp TeX-command-pos) TeX-command-pos) (apply (function nil) args) (and (stringp TeX-command-pos) TeX-command-pos)))
(lambda (&rest args) (shell-quote-argument (concat (and (stringp TeX-command-pos) TeX-command-pos) (apply (function nil) args) (and (stringp TeX-command-pos) TeX-command-pos))))(nil t)
apply((lambda (&rest args) (shell-quote-argument (concat (and (stringp TeX-command-pos) TeX-command-pos) (apply (function nil) args) (and (stringp TeX-command-pos) TeX-command-pos)))) (nil t))
TeX-command-expand("%(latex)" nil)
TeX-inline-preview-internal("lualatex --jobname=\"_region_\" -file-line-error \"\\nonstopmode\\nofiles\\PassOptionsToPackage{active,tightpage,auctex}{preview}\\AtBeginDocument{\\ifx\\ifPreview\\undefined\\RequirePackage[displaymath,floats,graphics,textmath,sections,footnotes]{preview}[2004/11/05]\\fi}\" \"\\input\" \"_region_.tex\"" "_region_" (TeX-region-file . "_region_") #<buffer ##.tex> ("##" "lualatex -ini -interaction=nonstopmode \"&lualatex\" \"prv_##\".ini \"\\nonstopmode\\nofiles\\PassOptionsToPackage{active,tightpage,auctex}{preview}\\AtBeginDocument{\\ifx\\ifPreview\\undefined\\RequirePackage[displaymath,floats,graphics,textmath,sections,footnotes]{preview}[2004/11/05]\\fi}\" \"\\input\" \"##.tex\"" . #<overlay from 1 to 55 in ##.tex>) "##" ((lambda nil (/ 10.2 (preview-document-pt))) (72.05673758865248 . 71.88679245283019) [nil nil nil nil]))
preview-generate-preview(t "_region_" "lualatex --jobname=\"_region_\" -file-line-error \"\\nonstopmode\\nofiles\\PassOptionsToPackage{active,tightpage,auctex}{preview}\\AtBeginDocument{\\ifx\\ifPreview\\undefined\\RequirePackage[displaymath,floats,graphics,textmath,sections,footnotes]{preview}[2004/11/05]\\fi}\" \"\\input\" \"_region_.tex\"")
preview-region(1 9393)
preview-at-point()
funcall-interactively(preview-at-point)
call-interactively(preview-at-point nil nil)
command-execute(preview-at-point)
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)
(put 'downcase-region 'disabled nil)
(put 'dired-find-alternate-file 'disabled nil)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(package-selected-packages (quote (ada-mode auctex))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
My .emacs.d folder is empty apart from elpa, auto-save-list and a bookarks file. I have no other packages installed apart from AUCTeX. How can I troubleshoot this issue?
Best,
Alad
[1] http://gnu.emacs.help.narkive.com/4kg9yq1P/unable-to-run-64-bit-gnu-emacs-25-3-on-windows-7-professional-service-pack-1
Looks to me like
commit 370a4b92155aebf3d0860c1211617d14d8e7951c
Date: Fri May 26 22:29:59 2017 +0900
Resolve preview-latex incompatibility with Japanese TeX (Bug#25322)
[...]
is responsible here. It adds the line
(TeX-command-expand "%(latex)" nil)))))
which is an invalid use of TeX-command-expand (I have no idea how this
could have ever worked).
I'm sorry, this is my fault. I'll make out some work around.

David, thank you for tracking down this defect.
Post by David Kastrup
I have no idea what the intent of that line ever was. "nil" probably
needs to be some file expansion function.
The idea is that putting back the "--kanji" option dropped by the
preceding regular expression `preview-undump-replacements'. This option
is necessary to tell the coding system of the file to the Japanese
platex command.

I should have noticed the existence of "%s" in the fourth element of the
`luatex' entry of `TeX-engine-alist-builtin'. I faltly assumed that
this `TeX-command-expand' does not make use of its `file' argument when
its first argument is only "%(latex)". But it is wrong for lualatex
because of that "%s".

It is rather strange that preview-latex does work for lualatex file
without error on my machine, but it's not important, of course. Anyway,
I'll fix this issue.

Regards,
Ikumi Keita
Ikumi Keita
2017-11-16 19:14:57 UTC
Permalink
Hi Alad and David,
Post by Ikumi Keita
Post by David Kastrup
Looks to me like
commit 370a4b92155aebf3d0860c1211617d14d8e7951c
Date: Fri May 26 22:29:59 2017 +0900
Resolve preview-latex incompatibility with Japanese TeX (Bug#25322)
[...]
is responsible here. It adds the line
(TeX-command-expand "%(latex)" nil)))))
which is an invalid use of TeX-command-expand (I have no idea how this
could have ever worked).
I'm sorry, this is my fault. I'll make out some work around.
I've commited a change for this problem. I hope the problem is fixed in
the git repository. Please try it and report any further problems.

Regards,
Ikumi Keita
Alad Wenter
2017-12-08 13:35:11 UTC
Permalink
Post by Ikumi Keita
Hi Alad and David,
Post by Ikumi Keita
Post by David Kastrup
Looks to me like
commit 370a4b92155aebf3d0860c1211617d14d8e7951c
Date: Fri May 26 22:29:59 2017 +0900
Resolve preview-latex incompatibility with Japanese TeX (Bug#25322)
[...]
is responsible here. It adds the line
(TeX-command-expand "%(latex)" nil)))))
which is an invalid use of TeX-command-expand (I have no idea how this
could have ever worked).
I'm sorry, this is my fault. I'll make out some work around.
I've commited a change for this problem. I hope the problem is fixed in
the git repository. Please try it and report any further problems.
Regards,
Ikumi Keita
Hi Ikumi,

Sorry about the late reply, I only tested it now that a new release was made available on ELPA. I can confirm the preview functionality works as intended in 11.92.0. Thanks for the update!

Best,
Alad
Ikumi Keita
2017-12-08 14:14:15 UTC
Permalink
Hi Alad,
Post by Alad Wenter
Sorry about the late reply, I only tested it now that a new release
was made available on ELPA. I can confirm the preview functionality
works as intended in 11.92.0. Thanks for the update!
I'm glad to hear that. Thank you for reporing!

Bye,
Ikumi Keita

Loading...