branch: elpa/magit commit e40e8f199447bc8f121ad128ecd50017a595659f Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
Drop dependency on Dash --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- default.mk | 10 ---------- docs/magit.org | 6 ++---- docs/magit.texi | 6 ++---- lisp/magit-apply.el | 6 +++--- lisp/magit-base.el | 12 ++++++++++-- lisp/magit-section.el | 4 +--- lisp/magit.el | 1 - test/magit-tests.el | 1 - 9 files changed, 19 insertions(+), 29 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index b67a8055e3..c1fb4a0fc1 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -42,7 +42,7 @@ to save a shell command to the `kill-ring` and the system's clip-board, which yo Finally, if that didn't work and you have installed Magit from Melpa, then run commands similar to the ones above, but use tab completion to replace the various Ns with the correct versions: $ cd ~/.emacs.d/elpa/magit-N - $ emacs -Q --debug-init --eval '(setq debug-on-error t)' -L ../dash-N -L ../llama-N -L ../seq-N -L ../transient-N -L ../with-editor-N -L . -l magit + $ emacs -Q --debug-init --eval '(setq debug-on-error t)' -L ../llama-N -L ../seq-N -L ../transient-N -L ../with-editor-N -L . -l magit More debugging tools are described in the manual. diff --git a/default.mk b/default.mk index 1515088faa..72fd5fc46b 100644 --- a/default.mk +++ b/default.mk @@ -145,13 +145,6 @@ ifeq "$(COMPAT_DIR)" "" COMPAT_DIR = $(TOP)../compat endif -DASH_DIR ?= $(shell \ - find -L $(ELPA_DIR) -maxdepth 1 -regex '.*/dash-[.0-9]*' 2> /dev/null | \ - sort | tail -n 1) -ifeq "$(DASH_DIR)" "" - DASH_DIR = $(TOP)../dash -endif - LLAMA_DIR ?= $(shell \ find -L $(ELPA_DIR) -maxdepth 1 -regex '.*/llama-[.0-9]*' 2> /dev/null | \ sort | tail -n 1) @@ -198,7 +191,6 @@ LOAD_PATH = -L $(TOP)lisp ifdef CYGPATH LOAD_PATH += -L $(shell cygpath --mixed $(COMPAT_DIR)) - LOAD_PATH += -L $(shell cygpath --mixed $(DASH_DIR)) LOAD_PATH += -L $(shell cygpath --mixed $(LLAMA_DIR)) LOAD_PATH += -L $(shell cygpath --mixed $(SEQ_DIR)) LOAD_PATH += -L $(shell cygpath --mixed $(TRANSIENT_DIR)) @@ -208,7 +200,6 @@ ifdef CYGPATH endif else LOAD_PATH += -L $(COMPAT_DIR) - LOAD_PATH += -L $(DASH_DIR) LOAD_PATH += -L $(LLAMA_DIR) LOAD_PATH += -L $(SEQ_DIR) LOAD_PATH += -L $(TRANSIENT_DIR) @@ -229,7 +220,6 @@ endif # This isn't used by make, but is needed for the Compile ci workflow. DEPS = compat -DEPS += dash DEPS += llama DEPS += seq DEPS += transient/lisp diff --git a/docs/magit.org b/docs/magit.org index dd77eaae18..6d5918efcd 100644 --- a/docs/magit.org +++ b/docs/magit.org @@ -153,7 +153,7 @@ Now see [[*Post-Installation Tasks]]. ** Installing from the Git Repository -Magit depends on the ~compat~, ~dash~, ~llama~, ~seq~ (the built-in version is +Magit depends on the ~compat~, ~llama~, ~seq~ (the built-in version is enough when using Emacs >= 29.1), ~transient~ and ~with-editor~ libraries which are available from Melpa and Melpa-Stable. Install them using ~M-x package-install RET <package> RET~. Of course you may also install @@ -172,7 +172,7 @@ Then compile the libraries and generate the info manuals: $ make #+end_src -If you haven't installed ~compat~, ~dash~, ~llama~, ~seq~ (for Emacs < 29.1), +If you haven't installed ~compat~, ~llama~, ~seq~ (for Emacs < 29.1), ~transient~ and ~with-editor~ from Melpa, or at ~/path/to/magit/../<package>~, then you have to tell ~make~ where to find them. To do so create the file ~/path/to/magit/config.mk~ @@ -181,7 +181,6 @@ with the following content before running ~make~: #+begin_src makefile LOAD_PATH = -L ~/.emacs.d/site-lisp/magit/lisp LOAD_PATH += -L ~/.emacs.d/site-lisp/compat - LOAD_PATH += -L ~/.emacs.d/site-lisp/dash LOAD_PATH += -L ~/.emacs.d/site-lisp/llama LOAD_PATH += -L ~/.emacs.d/site-lisp/seq LOAD_PATH += -L ~/.emacs.d/site-lisp/transient/lisp @@ -204,7 +203,6 @@ you have to tell Emacs about them too, by prefixing the above with: #+begin_src emacs-lisp (add-to-list 'load-path "~/.emacs.d/site-lisp/compat") - (add-to-list 'load-path "~/.emacs.d/site-lisp/dash") (add-to-list 'load-path "~/.emacs.d/site-lisp/llama") (add-to-list 'load-path "~/.emacs.d/site-lisp/seq") (add-to-list 'load-path "~/.emacs.d/site-lisp/transient/lisp") diff --git a/docs/magit.texi b/docs/magit.texi index 7ad9e26402..ce18125b84 100644 --- a/docs/magit.texi +++ b/docs/magit.texi @@ -305,7 +305,7 @@ Now see @ref{Post-Installation Tasks}. @node Installing from the Git Repository @section Installing from the Git Repository -Magit depends on the @code{compat}, @code{dash}, @code{llama}, @code{seq} (the built-in version is +Magit depends on the @code{compat}, @code{llama}, @code{seq} (the built-in version is enough when using Emacs >= 29.1), @code{transient} and @code{with-editor} libraries which are available from Melpa and Melpa-Stable. Install them using @code{M-x package-install RET <package> RET}. Of course you may also install @@ -324,7 +324,7 @@ Then compile the libraries and generate the info manuals: $ make @end example -If you haven't installed @code{compat}, @code{dash}, @code{llama}, @code{seq} (for Emacs < 29.1), +If you haven't installed @code{compat}, @code{llama}, @code{seq} (for Emacs < 29.1), @code{transient} and @code{with-editor} from Melpa, or at @code{/path/to/magit/../<package>}, then you have to tell @code{make} where to find them. To do so create the file @code{/path/to/magit/config.mk} @@ -333,7 +333,6 @@ with the following content before running @code{make}: @example LOAD_PATH = -L ~/.emacs.d/site-lisp/magit/lisp LOAD_PATH += -L ~/.emacs.d/site-lisp/compat -LOAD_PATH += -L ~/.emacs.d/site-lisp/dash LOAD_PATH += -L ~/.emacs.d/site-lisp/llama LOAD_PATH += -L ~/.emacs.d/site-lisp/seq LOAD_PATH += -L ~/.emacs.d/site-lisp/transient/lisp @@ -356,7 +355,6 @@ you have to tell Emacs about them too, by prefixing the above with: @lisp (add-to-list 'load-path "~/.emacs.d/site-lisp/compat") -(add-to-list 'load-path "~/.emacs.d/site-lisp/dash") (add-to-list 'load-path "~/.emacs.d/site-lisp/llama") (add-to-list 'load-path "~/.emacs.d/site-lisp/seq") (add-to-list 'load-path "~/.emacs.d/site-lisp/transient/lisp") diff --git a/lisp/magit-apply.el b/lisp/magit-apply.el index 6dd8d34c7f..1c526caca5 100644 --- a/lisp/magit-apply.el +++ b/lisp/magit-apply.el @@ -703,7 +703,7 @@ of a side, then keep that side without prompting." (magit-discard-apply-n sections #'magit-apply-diffs))) (when binaries (let ((modified (magit-unstaged-files t))) - (setq binaries (-separate (##member % modified) binaries))) + (setq binaries (magit--separate (##member % modified) binaries))) (when (cadr binaries) (magit-call-git "reset" "--" (cadr binaries))) (when (car binaries) @@ -757,8 +757,8 @@ so causes the change to be applied to the index as well." magit-buffer-range) (t "--cached"))))) - (-separate (##member (oref % value) bs) - sections)))) + (magit--separate (##member (oref % value) bs) + sections)))) (magit-confirm-files 'reverse (mapcar (##oref % value) sections)) (cond ((length= sections 1) (magit-reverse-apply (car sections) #'magit-apply-diff args)) diff --git a/lisp/magit-base.el b/lisp/magit-base.el index 30d69d126c..e2b0d5a198 100644 --- a/lisp/magit-base.el +++ b/lisp/magit-base.el @@ -37,7 +37,6 @@ (require 'cl-lib) (require 'compat) -(require 'dash) (require 'eieio) (require 'llama) (require 'subr-x) @@ -882,7 +881,6 @@ See info node `(magit)Debugging Tools' for more information." (error "Cannot find mandatory dependency %s" lib))) '(;; Like `LOAD_PATH' in `default.mk'. "compat" - "dash" "llama" "seq" "transient" @@ -1020,6 +1018,16 @@ one trailing newline is added." (and (eq trim ?\n) "\n")) str))) +(defun magit--separate (pred list) + "Separate elements of LIST that do and don't satisfy PRED. +Return a list of two lists; the first containing the elements that +do satisfy PRED and the second containing the elements that don't." + (let (y n) + (dolist (elt list) + (push elt (if (funcall pred elt) y n))) + (list (nreverse y) + (nreverse n)))) + (defun magit--version> (v1 v2) "Return t if version V1 is higher (younger) than V2. This function should be named `version>' and be part of Emacs." diff --git a/lisp/magit-section.el b/lisp/magit-section.el index 4b299c31ee..db20b30ed2 100644 --- a/lisp/magit-section.el +++ b/lisp/magit-section.el @@ -12,7 +12,6 @@ ;; Package-Requires: ( ;; (emacs "27.1") ;; (compat "30.0.2.0") -;; (dash "2.19.1") ;; (llama "0.6.0") ;; (seq "2.24")) @@ -45,7 +44,6 @@ (require 'cl-lib) (require 'compat) -(require 'dash) (require 'eieio) (require 'llama) (require 'subr-x) @@ -1057,7 +1055,7 @@ global map, this involves advising `tab-bar--define-keys'." (defun magit-section-hidden-body (section &optional pred) (if-let ((children (oref section children))) - (funcall (or pred #'-any-p) #'magit-section-hidden-body children) + (funcall (or pred #'seq-some) #'magit-section-hidden-body children) (and (oref section content) (oref section hidden)))) diff --git a/lisp/magit.el b/lisp/magit.el index 75a123ba8d..6f909cb1ba 100644 --- a/lisp/magit.el +++ b/lisp/magit.el @@ -21,7 +21,6 @@ ;; Package-Requires: ( ;; (emacs "27.1") ;; (compat "30.0.2.0") -;; (dash "2.19.1") ;; (llama "0.6.0") ;; (magit-section "4.2.0") ;; (seq "2.24") diff --git a/test/magit-tests.el b/test/magit-tests.el index a67b53ca0f..dcf796d90c 100644 --- a/test/magit-tests.el +++ b/test/magit-tests.el @@ -20,7 +20,6 @@ ;;; Code: (require 'cl-lib) -(require 'dash) (require 'ert) (require 'tramp) (require 'tramp-sh)