emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/idris-mode cb61f21432 08/13: Add idris-file-name-concat fu


From: ELPA Syncer
Subject: [nongnu] elpa/idris-mode cb61f21432 08/13: Add idris-file-name-concat function as backward compatible
Date: Thu, 5 Jan 2023 04:59:25 -0500 (EST)

branch: elpa/idris-mode
commit cb61f21432e9a711a3598027a47c3148b981284d
Author: Marek L <nospam.keram@gmail.com>
Commit: Marek L <nospam.keram@gmail.com>

    Add idris-file-name-concat function as backward compatible
    
    version of file-name-concat from Emacs 28
---
 idris-compat.el | 7 +++++++
 idris-repl.el   | 5 +++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/idris-compat.el b/idris-compat.el
index 2811f01bc8..d248d7f872 100644
--- a/idris-compat.el
+++ b/idris-compat.el
@@ -34,5 +34,12 @@ attention to case differences."
 (unless (fboundp 'gensym)
   (defalias 'gensym 'cl-gensym))
 
+(if (fboundp 'file-name-concat)
+    (defalias 'idris-file-name-concat 'file-name-concat)
+  (defun idris-file-name-concat (&rest components)
+    (let ((dirs (butlast components)))
+      (concat (apply 'concat (mapcar 'file-name-as-directory dirs))
+              (car (reverse components))))))
+
 (provide 'idris-compat)
 ;;; idris-compat.el ends here
diff --git a/idris-repl.el b/idris-repl.el
index 2baba65ccd..3a0d457800 100644
--- a/idris-repl.el
+++ b/idris-repl.el
@@ -545,8 +545,9 @@ The handler will use qeuery to ask the use if the error 
should be ingored."
 Use `idris-repl-history-file' if set or fallback
  to filepath computed from the `idris-interpreter-path'."
   (or idris-repl-history-file
-      ;; We should use `file-name-concat' but it is only in Emacs version 28+
-      (concat "~/." (file-name-nondirectory idris-interpreter-path) 
"/idris-history.eld")))
+      (idris-file-name-concat "~"
+                              (concat "." (file-name-nondirectory 
idris-interpreter-path))
+                              "idris-history.eld")))
 
 (defun idris-repl-read-history-filename ()
   (read-file-name "Use Idris REPL history from file: "



reply via email to

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