From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hongyi Zhao Newsgroups: gmane.emacs.help 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 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12390"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 10 17:04:36 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lrMEU-0002yC-TJ for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 10 Jun 2021 17:04:34 +0200 Original-Received: from localhost ([::1]:40492 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrMET-00078n-SF for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 10 Jun 2021 11:04:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46592) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrMCX-0005WB-7w for help-gnu-emacs@gnu.org; Thu, 10 Jun 2021 11:02:34 -0400 Original-Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]:36695) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lrMCR-0004Bs-Lx for help-gnu-emacs@gnu.org; Thu, 10 Jun 2021 11:02:31 -0400 Original-Received: by mail-lj1-x22a.google.com with SMTP id 131so5374217ljj.3 for ; Thu, 10 Jun 2021 08:02:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=5zMEbQcI/t7hgz3ExX3X+T2TAk9iDAL0/FP5z2hitwQ=; b=oV2aEtTzbQH+4LOJyRt2gUnSHe+WUxakWdmd3550AuyyT5s2Hs2d2P7C3HUYar7+Ie cPjGLMyB/zUcIVTHqb1zpalJHvXgvCRap3tcU+oXRYSjPFzt9BoUoaCJ7Z0D/EcN3puP ZmmN4ExN6CDWTC6q7U/y8yCug/2JyfE4OeACEnCyGw09jxxD2Ux9JB5q/gHchF2mMXX0 CW7fMrAQCn0c+lixHDlOgvHq4RIbzCaLcoHLS/ZMersIgdDRwuaOJGYWT4Ndf1CWSqiG rVwg8e6/ARKox60J3EGyMGvf+jsfON1UVDoExNa5TWbu4/eCXYEJYfEMJDFhs59JDgZa GxsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=5zMEbQcI/t7hgz3ExX3X+T2TAk9iDAL0/FP5z2hitwQ=; b=hVH+Ydrb81+vLH7dW5I4M2QyilWElMKQK1tpymRJjfVBmrv+LPKOsRuLSjm7AHl4qj jd2IlbA7idl75WQeDXiK2JLZW7R5LOBKYp08BedBwyiu8r9Yo1f+/VvEohvS+3gTvVyy 11zSPkK0nbHKDgUsvmy+2QpLxUpL1pIsc3HNEiMN6mFW6qrLf5kBvqpQCVcKXbz7YEgE xqGWuFBFYKofnxGAbO1qH7lsvmzRaxv19Y+JZP8J+bieHBpywJ8W8K29O8EKLsytgTCC YYQUskhPGeGS76npWVoOyrNJzqZz1Rpu4gnRXnVtLlZpKwwc+SsEQiF5VmZMtKRrobV9 /wBA== X-Gm-Message-State: AOAM531jWgrSVseKRoYaCvZYp0ffVAizKaTyQ98a2T6cSxDHnOYaMQtd +gQsrgYeCivb6f93Jri2Z4Kr3/KQDKuQFwATqkRi4t22JWdOcq8N5x8= X-Google-Smtp-Source: ABdhPJx5T3T+wZP4qoDh11iBG8/rFTQF27igecebive2s1Rt/PPfcjU3N4NgWuRQvZZjfvaP08P30K47BQxfQqIOjos= X-Received: by 2002:a2e:8e7c:: with SMTP id t28mr2565905ljk.246.1623337335997; Thu, 10 Jun 2021 08:02:15 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::22a; envelope-from=hongyi.zhao@gmail.com; helo=mail-lj1-x22a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:130702 Archived-At: 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 Theory and Simulation of Materials Hebei Vocational University of Technology and Engineering NO. 552 North Gangtie Road, Xingtai, China