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

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

Set the HOME environment variable in Emacs package debug script instead


From: Hongyi Zhao
Subject: Set the HOME environment variable in Emacs package debug script instead of using it on command line.
Date: Tue, 26 Oct 2021 10:01:19 +0800

I've writtent the following Emacs package debug script which can be
run by `$ bash /home/werner/.emacs.d/debug/.emacs.d/init.el`:

```emacs-lisp
#!/usr/bin/env bash
:;# $ realpath init.el
:;# /home/werner/.emacs.d/debug/.emacs.d/init.el
:; HOME=$(dirname $(dirname $(realpath -e $0))) proxychains-ng-socks5
/usr/local/bin/emacs -- "$@"; exit

;;Bootstrap straight
(defvar bootstrap-version)
(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el"
user-emacs-directory))
      (bootstrap-version 5))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el";
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))
(straight-use-package 'use-package)
(setq straight-use-package-by-default t)

(use-package company
  :demand t
  :hook
  (after-init . global-company-mode))
```
I want to set the HOME environment variable in the lisp code, so it
will not disturb the system environment variable settings.

Any tips for achieving this goal?

Regards,
HZ



reply via email to

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