diff options
author | Philip K <philip@warpmail.net> | 2020-03-28 13:14:28 +0100 |
---|---|---|
committer | Tino Calancha <tino.calancha@gmail.com> | 2020-03-28 13:14:28 +0100 |
commit | 98193d3bbb3538eda457d0db4ccccbcc4b04ce3d (patch) | |
tree | c1e995c04aecc7297dae7ca6e551b7aed282bc5c /contrib/emacs | |
parent | 88936b11aff49e48f79842e4628c55620e0ad736 (diff) |
emacs: Drop dependency on f library
The "f" library is a rather thin translation layer for already
existing Emacs functions. Most functions directly map to an already
existing function (eg. "f-no-ext" and "file-name-sans-extension"). For
this reason, removing "f" comes at no cost while reducing the number
of dependencies one has to count on and the user has to install.
Co-authored-by: Tino Calancha <tino.calancha@gmail.com>
Diffstat (limited to 'contrib/emacs')
-rw-r--r-- | contrib/emacs/CHANGELOG.md | 4 | ||||
-rw-r--r-- | contrib/emacs/Cask | 1 | ||||
-rw-r--r-- | contrib/emacs/password-store.el | 15 |
3 files changed, 11 insertions, 9 deletions
diff --git a/contrib/emacs/CHANGELOG.md b/contrib/emacs/CHANGELOG.md index 98c82fe..7173f65 100644 --- a/contrib/emacs/CHANGELOG.md +++ b/contrib/emacs/CHANGELOG.md @@ -1,3 +1,7 @@ +# 2.1.4 + +* Drop dependency on f library. + # 2.1.3 * Update password-store-clear docstring; clarify that the diff --git a/contrib/emacs/Cask b/contrib/emacs/Cask index f46b166..050e054 100644 --- a/contrib/emacs/Cask +++ b/contrib/emacs/Cask @@ -4,7 +4,6 @@ (package-file "password-store.el") (development - (depends-on "f") (depends-on "with-editor") (depends-on "ecukes") (depends-on "ert-runner") diff --git a/contrib/emacs/password-store.el b/contrib/emacs/password-store.el index ca8ae40..61c339e 100644 --- a/contrib/emacs/password-store.el +++ b/contrib/emacs/password-store.el @@ -4,9 +4,9 @@ ;; Author: Svend Sorensen <svend@svends.net> ;; Maintainer: Tino Calancha <tino.calancha@gmail.com> -;; Version: 2.1.3 +;; Version: 2.1.4 ;; URL: https://www.passwordstore.org/ -;; Package-Requires: ((emacs "25") (f "0.11.0") (s "1.9.0") (with-editor "2.5.11") (auth-source-pass "5.0.0")) +;; Package-Requires: ((emacs "25") (s "1.9.0") (with-editor "2.5.11") (auth-source-pass "5.0.0")) ;; Keywords: tools pass password password-store ;; This file is not part of GNU Emacs. @@ -33,7 +33,6 @@ ;;; Code: -(require 'f) (require 'with-editor) (require 'auth-source-pass) @@ -187,11 +186,11 @@ Nil arguments are ignored. Output is discarded." (defun password-store--entry-to-file (entry) "Return file name corresponding to ENTRY." - (concat (f-join (password-store-dir) entry) ".gpg")) + (concat (expand-file-name entry (password-store-dir)) ".gpg")) (defun password-store--file-to-entry (file) "Return entry name corresponding to FILE." - (f-no-ext (f-relative file (password-store-dir)))) + (file-name-sans-extension (file-relative-name file (password-store-dir)))) (defun password-store--completing-read (&optional require-match) "Read a password entry in the minibuffer, with completion. @@ -214,11 +213,11 @@ ENTRY is the name of a password-store entry." (defun password-store-list (&optional subdir) "List password entries under SUBDIR." (unless subdir (setq subdir "")) - (let ((dir (f-join (password-store-dir) subdir))) - (if (f-directory? dir) + (let ((dir (expand-file-name subdir (password-store-dir)))) + (if (file-directory-p dir) (delete-dups (mapcar 'password-store--file-to-entry - (f-files dir (lambda (file) (equal (f-ext file) "gpg")) t)))))) + (directory-files-recursively dir ".+\\.gpg\\'")))))) ;;;###autoload (defun password-store-edit (entry) |