Auto update 'eat-term-shell-integration-directory'

* eat.el: Auto update 'eat-term-shell-integration-directory' if
not modified.
This commit is contained in:
Akib Azmain Turja 2022-12-07 13:17:37 +06:00
parent b3c81c3078
commit e6a7deafd0
No known key found for this signature in database
GPG key ID: 5535FCF54D88616B

25
eat.el
View file

@ -322,13 +322,18 @@ This value is used by terminal programs to identify the terminal."
(defvar eat--install-path nil
"Path to directory where Eat is installed.")
(defvar eat--shell-integration-path nil
"Path to directory where shell integration scripts are installed.")
(defvar eat-term-terminfo-directory)
(defvar eat-term-shell-integration-directory)
(let ((old-install-path eat--install-path))
(let ((old-install-path eat--install-path)
(old-shell-integration-path eat--shell-integration-path))
(setq eat--install-path
(copy-sequence
(file-name-directory (or load-file-name
buffer-file-name))))
(copy-sequence (file-name-directory
(or load-file-name buffer-file-name))))
(setq eat--shell-integration-path
(expand-file-name "integration" eat--install-path))
(defcustom eat-term-terminfo-directory eat--install-path
"Directory where required terminfo databases can be found.
@ -338,8 +343,10 @@ that describe the capabilities of the terminal."
:type 'directory
:group 'eat-term)
(defvar eat--term-shell-integration-directory)
(defcustom eat-term-shell-integration-directory
(expand-file-name "integration" eat--install-path)
eat--shell-integration-path
"Directory where Eat shell integration scripts can be found.
This value is exposed to terminal programs as
@ -349,9 +356,11 @@ This value is exposed to terminal programs as
:group 'eat-eshell)
(when (eq eat-term-terminfo-directory old-install-path)
(setq eat-term-terminfo-directory eat--install-path
eat-term-shell-integration-directory
(expand-file-name "integration" eat--install-path))))
(setq eat-term-terminfo-directory eat--install-path))
(when (eq eat-term-shell-integration-directory
old-shell-integration-path)
(setq eat-term-shell-integration-directory
eat--shell-integration-path)))
(defcustom eat-term-inside-emacs (format "%s,eat" emacs-version)
"Value for the `INSIDE_EMACS' environment variable."