help-gnu-emacs
[Top][All Lists]
Advanced

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

Refer to the directory of the currently being loaded elisp script from w


From: Hongyi Zhao
Subject: Refer to the directory of the currently being loaded elisp script from within the Emacs lisp file itself.
Date: Thu, 10 Jun 2021 23:02:04 +0800

I'm writing an elisp script which will load another file in the same
directory as this elisp script itself. The currently used command is
as follows:

(load-file (expand-file-name
"~/Public/repo/github.com/DvdMgr/screen2latex.el.git/auth.el.gpg"))

I want to construct the loaded file's path with the directory of the
elisp script itself, and I tried with the following but failed to do
the trick:

(load-file (concat (file-name-directory load-file-name) "/auth.el.gpg"))

Any hints/comments/suggestions for this problem?

Regards
-- 
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
NO. 552 North Gangtie Road, Xingtai, China



reply via email to

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