auctex-devel
[Top][All Lists]
Advanced

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

Re: [AUCTeX-devel] Patch for Makefile to compile vs Emacs (e08e0880f9+)


From: Arash Esbati
Subject: Re: [AUCTeX-devel] Patch for Makefile to compile vs Emacs (e08e0880f9+)
Date: Sat, 04 May 2019 22:06:46 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50

Vladimir Lomov <address@hidden> writes:

> beginning with commit e08e0880f9 (that didn't compile clearly, one needs
> to use ca99c00f7574d one) Emacs failed to build auctex due to (I suppose
> because I don't know Emacs Lisp in details, and that commit is all
> about) lexical binding.

Hi Vladimir,

many thanks for raising this issue.  I can confirm that AUCTeX doesn't
build with current Emacs from git (my version is a90ad229).  I'm not
really familiar with lexical binding, but I'm puzzled that dynamically
binding `generated-autoload-file' causes an error and setq'ing it
resolves it.  From lisp manual[1]:

    Even when lexical binding is enabled, certain variables will
    continue to be dynamically bound.  These are called special
    variables.  Every variable that has been defined with defvar,
    defcustom or defconst is a special variable.

,----[ C-h v generated-autoload-file RET ]
| generated-autoload-file is a variable defined in ‘autoload.el’.
| Its value is nil
| 
|   This variable is safe as a file local variable if its value
|   satisfies the predicate ‘stringp’.
|   Probably introduced at or before Emacs version 23.1.
| 
| Documentation:
| File into which to write autoload definitions.
| A Lisp file can set this in its local variables section to make
| its autoloads go somewhere else.
| [...]
`----

> I looked into how Emacs buildin packages are compiled (as well as
> org-mode) and prepared the following patch for Makefile.in. It works
> fine for me (Emacs from git) but I didn't test it vs "stable" branch
> (26 I think).
>
> Patch:

I haven't tested your patch, but the following change does work for me
as well.  It moves the let-bound `generated-autoload-file' into the
third argument of `update-file-autoloads'.  I tested this one with Emacs
26.1. and it worked as well.

--8<---------------cut here---------------start------------->8---
diff --git a/Makefile.in b/Makefile.in
index 822eea9f..b98d0fdd 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -52,12 +52,15 @@ PACKAGE=auctex
 PACKAGE_INFO=auctex preview-latex
 address@hidden@
 ELCC=$(EMACS) -batch -q -no-site-file -no-init-file -l lpath.el
-AUTOLOAD=--eval '(let ((generated-autoload-file (expand-file-name "$@"))) \
-  (mapcar (function update-file-autoloads) command-line-args-left) \
-  (save-buffers-kill-emacs t))'
-
-PREVIEW_AUTOLOAD=--eval '(let ((generated-autoload-file (expand-file-name 
"$@"))) \
-               (update-file-autoloads "preview.el")(save-buffers-kill-emacs 
t))'
+AUTOLOAD=--eval '(progn \
+       (mapcar (lambda (arg) \
+                 (update-file-autoloads arg nil (expand-file-name "$@"))) \
+               command-line-args-left) \
+       (save-buffers-kill-emacs t))'
+
+PREVIEW_AUTOLOAD=--eval '(progn \
+               (update-file-autoloads "preview.el" nil (expand-file-name 
"$@")) \
+               (save-buffers-kill-emacs t))'

 # Files and directories excluded from distributed tar ball.
 EXCLUDEDFILES=autogen.sh .gitignore doc/.gitignore doc/tex-ref.log \
--8<---------------cut here---------------end--------------->8---
 
At any rate, I'm curious to know what's going wrong.  Maybe others can
comment on this.

Best, Arash

Footnotes:
[1]  
https://www.gnu.org/software/emacs/manual/html_node/elisp/Using-Lexical-Binding.html#Using-Lexical-Binding




reply via email to

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