From 661ae7c87ddd810c1ae11c56646eddc375646c36 Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Mon, 20 Dec 2021 23:08:31 +0100 Subject: [PATCH] Remove REMOTE arg from `eshell-info-banner--executable-find' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `eshell-info-banner--executable-find' now only acts according to the user’s preferences set with `eshell-info-banner-tramp-aware'. --- README.org | 6 ++++++ eshell-info-banner.el | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/README.org b/README.org index 7ae7acc..a3a3677 100644 --- a/README.org +++ b/README.org @@ -22,6 +22,7 @@ macOS. PR are welcome if you want to fix that! * Table of Contents :TOC_2_gh: - [[#introduction][Introduction]] - [[#recent-breaking-changes][Recent Breaking Changes]] + - [[#081][~0.8.1~]] - [[#070][~0.7.0~]] - [[#installation][Installation]] - [[#customizing][Customizing]] @@ -33,6 +34,11 @@ macOS. PR are welcome if you want to fix that! - [[#license][License]] * Recent Breaking Changes +** ~0.8.1~ +Version ~0.8.1~ removes the optional argument ~REMOTE~ from +~eshell-info-banner--executable-find~. It now only acts according to the +user’s preference set with ~eshell-info-banner-tramp-aware~. + ** ~0.7.0~ Version ~0.7.0~ renames several functions to conform with the Elisp Coding Conventions. diff --git a/eshell-info-banner.el b/eshell-info-banner.el index 20b5885..1ec3908 100644 --- a/eshell-info-banner.el +++ b/eshell-info-banner.el @@ -2,7 +2,7 @@ ;; Author: Lucien Cartier-Tilet ;; Maintainer: Lucien Cartier-Tilet -;; Version: 0.8.0 +;; Version: 0.8.1 ;; Package-Requires: ((emacs "25.1") (f "0.20") (s "1")) ;; Homepage: https://github.com/Phundrak/eshell-info-banner.el @@ -140,18 +140,18 @@ :type 'list :version "0.3.0") -(defun eshell-info-banner--executable-find (program &optional remote) - "Find PROGRAM executable, possibly on a REMOTE machine. +(defun eshell-info-banner--executable-find (program) + "Find PROGRAM executable, possibly on a remote machine. This is a wrapper around `executable-find' in order to avoid issues with older versions of the functions only accepting one -argument." +argument. `executable-find'’s remote argument has the value of +`eshell-info-banner-tramp-aware'." (if (version< emacs-version "27.1") - (let ((default-directory (if (and eshell-info-banner-tramp-aware - remote) + (let ((default-directory (if eshell-info-banner-tramp-aware default-directory "~"))) (executable-find program)) - (executable-find program remote))) + (executable-find program eshell-info-banner-tramp-aware))) (defcustom eshell-info-banner-duf-executable "duf" "Path to the `duf' executable." @@ -681,7 +681,7 @@ If RELEASE-FILE is nil, use '/etc/os-release'." (insert-file-contents (concat prefix "/bedrock/etc/bedrock-release")) (buffer-string)))) ;; Proxmox - ((eshell-info-banner--executable-find "pveversion" eshell-info-banner-tramp-aware) + ((eshell-info-banner--executable-find "pveversion") (let ((distro (eshell-info-banner--shell-command-to-string "pveversion"))) (save-match-data (string-match "/\\([^/]+\\)/" distro) @@ -689,9 +689,9 @@ If RELEASE-FILE is nil, use '/etc/os-release'." (substring-no-properties distro (match-beginning 1) (match-end 1)))))) - ((eshell-info-banner--executable-find "hostnamectl" eshell-info-banner-tramp-aware) + ((eshell-info-banner--executable-find "hostnamectl") (eshell-info-banner--get-os-information-from-hostnamectl)) - ((eshell-info-banner--executable-find "lsb_release" eshell-info-banner-tramp-aware) + ((eshell-info-banner--executable-find "lsb_release") (eshell-info-banner--get-os-information-from-lsb-release)) ((file-exists-p (concat prefix "/etc/os-release")) (eshell-info-banner--get-os-information-from-release-file))