branch: main
commit 361fd0ffbb0ac0efcb92c9792b7291bb1cdcbda0
Author: Arash Esbati <[email protected]>
Commit: Arash Esbati <[email protected]>
Simplify code for loading tex-site.el
* auctex.el: Delete the function `TeX-load-hack' and simply
require tex-site.el.
Set `no-byte-compile' to t in local variables to prevent
compilation error.
* tex-site.el.in: Don't `defalias' the deleted function.
---
auctex.el | 26 ++++++++++++--------------
tex-site.el.in | 2 --
2 files changed, 12 insertions(+), 16 deletions(-)
diff --git a/auctex.el b/auctex.el
index 2f7af507..9ad7ac17 100644
--- a/auctex.el
+++ b/auctex.el
@@ -33,20 +33,18 @@
;;; Code:
-;; This can be used for starting up AUCTeX. The following somewhat
-;; strange trick causes tex-site.el to be loaded in a way that can be
-;; safely undone using (unload-feature 'tex-site).
-
-;; FIXME: I don't quite understand in which way this is better than less
-;; strange code such as
-;; (require 'tex-site (expand-file-name "tex-site.el"
-;; (file-name-directory load-file-name))
-
-(autoload 'TeX-load-hack
- (expand-file-name "tex-site.el"
- (file-name-directory load-file-name)))
-(TeX-load-hack)
-
+;; This can be used for starting up AUCTeX, e.g., when not installed
+;; from ELPA. We have to set `no-byte-compile' to t otherwise the
+;; compiler will eval the form during the compilation where
+;; `load-file-name' is nil and things will go wrong.
+
+(require 'tex-site
+ (expand-file-name "tex-site.el"
+ (file-name-directory load-file-name)))
(provide 'auctex)
+;; Local Variables:
+;; no-byte-compile: t
+;; End:
+
;;; auctex.el ends here
diff --git a/tex-site.el.in b/tex-site.el.in
index 886d2918..462a7575 100644
--- a/tex-site.el.in
+++ b/tex-site.el.in
@@ -94,8 +94,6 @@ shared by all users of a site."
(doctex-mode . docTeX-mode))
"Alist of built-in TeX modes and their counterparts in AUCTeX.")
-(defalias 'TeX-load-hack #'ignore)
-
(defun tex-site-unload-function ()
(TeX-modes-set 'TeX-modes nil)