From 64cdcfc697a0cd3f86b8f4ca94468a7cdf5c3415 Mon Sep 17 00:00:00 2001 From: josh rotenberg Date: Mon, 29 Nov 2021 10:32:17 -0800 Subject: [PATCH 01/14] fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 22503345c..9a7cefddb 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ To upgrade: 3. Run `rm -Rf .emacs.d/elpa/cider-*` 4. Open Emacs. You'll probably see some errors and your theme won't load. That's ok. -5. In Emacs, run `M-x package-refresh contents`. +5. In Emacs, run `M-x package-refresh-contents`. 6. In Emacs, run `M-x package-install cider`. 7. Close and re-open Emacs. From 335be1919ec328604b01af90bbdaeb3554e1a2de Mon Sep 17 00:00:00 2001 From: Daniel Higginbotham Date: Sat, 2 Apr 2022 11:42:30 -0400 Subject: [PATCH 02/14] Update README.md --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 9a7cefddb..08a66e70c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,15 @@ +# WARNING this does not work currently + +A lot has changed since I last put significant effort into this repo, and as a result this emacs +config is broken. I hope to get it working again soon (as of 2022-04-02). + +If you're completely new to Clojure and emacs, I recommend using [Calva](https://calva.io/), a plugin +for VSCode, rather than trying to learn both Clojure and Emacs at the same time. Other options: + +- [Practicalli Spacemacs](https://practical.li/spacemacs/) +- [Cursive](https://cursive-ide.com/) +- [Vim fireplace](https://github.com/tpope/vim-fireplace) + # this is a Clojure-friendly emacs config If you're new to emacs, check out From 83bfd6c10464e37e9e753e3c0ce93fd5fdfaf4f0 Mon Sep 17 00:00:00 2001 From: Zach Thomas Date: Tue, 6 Sep 2022 17:08:58 -0400 Subject: [PATCH 03/14] a pretty good start --- .gitignore | 2 + README.md | 49 +- customizations/elisp-editing.el | 14 +- customizations/git.el | 5 + customizations/markdown.el | 5 + customizations/navigation.el | 86 +- customizations/projects.el | 11 + customizations/setup-clojure.el | 99 +- customizations/setup-js.el | 9 +- customizations/shell-integration.el | 8 +- customizations/ui.el | 34 +- early-init.el | 2 + elpa/a-20180907.953/a-autoloads.el | 22 - elpa/a-20180907.953/a-pkg.el | 2 - elpa/a-20180907.953/a.el | 347 - elpa/archives/tromey/archive-contents | 447 - elpa/async-20180527.1730/async-autoloads.el | 174 - elpa/async-20180527.1730/async-bytecomp.el | 219 - elpa/async-20180527.1730/async-pkg.el | 6 - elpa/async-20180527.1730/async.el | 392 - elpa/async-20180527.1730/dired-async.el | 405 - elpa/async-20180527.1730/smtpmail-async.el | 73 - elpa/cider-0.23.0/cider-apropos.el | 212 - elpa/cider-0.23.0/cider-autoloads.el | 807 -- elpa/cider-0.23.0/cider-browse-ns.el | 232 - elpa/cider-0.23.0/cider-browse-spec.el | 357 - elpa/cider-0.23.0/cider-cheatsheet.el | 577 -- elpa/cider-0.23.0/cider-classpath.el | 110 - elpa/cider-0.23.0/cider-client.el | 710 -- elpa/cider-0.23.0/cider-clojuredocs.el | 159 - elpa/cider-0.23.0/cider-common.el | 400 - elpa/cider-0.23.0/cider-compat.el | 54 - elpa/cider-0.23.0/cider-completion.el | 257 - elpa/cider-0.23.0/cider-connection.el | 893 -- elpa/cider-0.23.0/cider-debug.el | 748 -- elpa/cider-0.23.0/cider-doc.el | 536 -- elpa/cider-0.23.0/cider-eldoc.el | 481 - elpa/cider-0.23.0/cider-eval.el | 1165 --- elpa/cider-0.23.0/cider-find.el | 229 - elpa/cider-0.23.0/cider-format.el | 150 - elpa/cider-0.23.0/cider-inspector.el | 419 - elpa/cider-0.23.0/cider-macroexpansion.el | 206 - elpa/cider-0.23.0/cider-mode.el | 1081 --- elpa/cider-0.23.0/cider-ns.el | 278 - elpa/cider-0.23.0/cider-overlays.el | 321 - elpa/cider-0.23.0/cider-pkg.el | 24 - elpa/cider-0.23.0/cider-popup.el | 137 - elpa/cider-0.23.0/cider-profile.el | 208 - elpa/cider-0.23.0/cider-repl-history.el | 726 -- elpa/cider-0.23.0/cider-repl.el | 1712 ---- elpa/cider-0.23.0/cider-resolve.el | 130 - elpa/cider-0.23.0/cider-scratch.el | 99 - elpa/cider-0.23.0/cider-selector.el | 174 - elpa/cider-0.23.0/cider-stacktrace.el | 889 -- elpa/cider-0.23.0/cider-test.el | 823 -- elpa/cider-0.23.0/cider-tracing.el | 90 - elpa/cider-0.23.0/cider-util.el | 794 -- elpa/cider-0.23.0/cider-xref.el | 183 - elpa/cider-0.23.0/cider.el | 1531 ---- elpa/cider-0.23.0/nrepl-client.el | 1340 --- elpa/cider-0.23.0/nrepl-dict.el | 193 - .../clojure-mode-autoloads.el | 161 - .../clojure-mode-pkg.el | 2 - .../clojure-mode.el | 2863 ------ ...ojure-mode-extra-font-locking-autoloads.el | 23 - .../clojure-mode-extra-font-locking-pkg.el | 2 - .../clojure-mode-extra-font-locking.el | 206 - elpa/dash-20180903.1042/dash-autoloads.el | 22 - elpa/dash-20180903.1042/dash-pkg.el | 2 - elpa/dash-20180903.1042/dash.el | 2987 ------- elpa/epl-20180205.2049/epl-autoloads.el | 22 - elpa/epl-20180205.2049/epl-pkg.el | 2 - elpa/epl-20180205.2049/epl.el | 711 -- .../exec-path-from-shell-autoloads.el | 50 - .../exec-path-from-shell-pkg.el | 2 - .../exec-path-from-shell.el | 272 - elpa/ghub-20180909.2230/dir | 18 - elpa/ghub-20180909.2230/ghub-autoloads.el | 63 - elpa/ghub-20180909.2230/ghub-graphql.el | 65 - elpa/ghub-20180909.2230/ghub-pkg.el | 13 - elpa/ghub-20180909.2230/ghub.el | 854 -- elpa/ghub-20180909.2230/ghub.info | 1002 --- elpa/ghub-20180909.2230/glab.el | 153 - .../git-commit-autoloads.el | 53 - .../git-commit-pkg.el | 2 - elpa/git-commit-20180802.2018/git-commit.el | 899 -- .../ido-completing-read+-autoloads.el | 97 - .../ido-completing-read+-pkg.el | 2 - .../ido-completing-read+.el | 1193 --- elpa/magit-2.13.0/AUTHORS.md | 303 - elpa/magit-2.13.0/LICENSE | 676 -- elpa/magit-2.13.0/dir | 18 - elpa/magit-2.13.0/git-rebase.el | 591 -- elpa/magit-2.13.0/magit-apply.el | 641 -- elpa/magit-2.13.0/magit-autoloads.el | 2544 ------ elpa/magit-2.13.0/magit-autorevert.el | 263 - elpa/magit-2.13.0/magit-bisect.el | 210 - elpa/magit-2.13.0/magit-blame.el | 927 -- elpa/magit-2.13.0/magit-bookmark.el | 366 - elpa/magit-2.13.0/magit-branch.el | 1078 --- elpa/magit-2.13.0/magit-collab.el | 173 - elpa/magit-2.13.0/magit-commit.el | 483 - elpa/magit-2.13.0/magit-core.el | 132 - elpa/magit-2.13.0/magit-diff.el | 2762 ------ elpa/magit-2.13.0/magit-ediff.el | 507 -- elpa/magit-2.13.0/magit-extras.el | 692 -- elpa/magit-2.13.0/magit-files.el | 560 -- elpa/magit-2.13.0/magit-git.el | 2106 ----- elpa/magit-2.13.0/magit-imenu.el | 241 - elpa/magit-2.13.0/magit-log.el | 1680 ---- elpa/magit-2.13.0/magit-margin.el | 234 - elpa/magit-2.13.0/magit-merge.el | 274 - elpa/magit-2.13.0/magit-mode.el | 1353 --- elpa/magit-2.13.0/magit-notes.el | 201 - elpa/magit-2.13.0/magit-obsolete.el | 155 - elpa/magit-2.13.0/magit-pkg.el | 12 - elpa/magit-2.13.0/magit-process.el | 1096 --- elpa/magit-2.13.0/magit-refs.el | 749 -- elpa/magit-2.13.0/magit-remote.el | 1052 --- elpa/magit-2.13.0/magit-repos.el | 317 - elpa/magit-2.13.0/magit-reset.el | 113 - elpa/magit-2.13.0/magit-section.el | 1328 --- elpa/magit-2.13.0/magit-sequence.el | 898 -- elpa/magit-2.13.0/magit-stash.el | 493 -- elpa/magit-2.13.0/magit-status.el | 576 -- elpa/magit-2.13.0/magit-submodule.el | 498 -- elpa/magit-2.13.0/magit-subtree.el | 146 - elpa/magit-2.13.0/magit-tag.el | 132 - elpa/magit-2.13.0/magit-utils.el | 960 -- elpa/magit-2.13.0/magit-wip.el | 286 - elpa/magit-2.13.0/magit-worktree.el | 176 - elpa/magit-2.13.0/magit.el | 598 -- elpa/magit-2.13.0/magit.info | 183 - elpa/magit-2.13.0/magit.info-1 | 7813 ----------------- elpa/magit-2.13.0/magit.info-2 | 2595 ------ elpa/magit-popup-20180726.2037/dir | 18 - .../magit-popup-autoloads.el | 26 - .../magit-popup-pkg.el | 14 - elpa/magit-popup-20180726.2037/magit-popup.el | 1366 --- .../magit-popup.info | 740 -- .../memoize-autoloads.el | 22 - elpa/memoize-20180614.1930/memoize-pkg.el | 2 - elpa/memoize-20180614.1930/memoize.el | 189 - .../paredit-20171127.205/paredit-autoloads.el | 38 - elpa/paredit-20171127.205/paredit-pkg.el | 2 - elpa/paredit-20171127.205/paredit.el | 2929 ------ elpa/parseclj-20190531.711/parseclj-ast.el | 205 - .../parseclj-autoloads.el | 48 - elpa/parseclj-20190531.711/parseclj-lex.el | 545 -- elpa/parseclj-20190531.711/parseclj-parser.el | 278 - elpa/parseclj-20190531.711/parseclj-pkg.el | 12 - elpa/parseclj-20190531.711/parseclj.el | 93 - .../parseedn-autoloads.el | 22 - elpa/parseedn-20191113.831/parseedn-pkg.el | 2 - elpa/parseedn-20191113.831/parseedn.el | 202 - .../pkg-info-autoloads.el | 127 - elpa/pkg-info-20150517.1143/pkg-info-pkg.el | 2 - elpa/pkg-info-20150517.1143/pkg-info.el | 331 - .../projectile-autoloads.el | 539 -- .../projectile-pkg.el | 2 - elpa/projectile-20180824.2239/projectile.el | 4113 --------- elpa/queue-0.2/queue-autoloads.el | 25 - elpa/queue-0.2/queue-pkg.el | 2 - elpa/queue-0.2/queue.el | 192 - .../rainbow-delimiters-autoloads.el | 38 - .../rainbow-delimiters-pkg.el | 2 - .../rainbow-delimiters.el | 300 - elpa/s-20180406.808/s-autoloads.el | 22 - elpa/s-20180406.808/s-pkg.el | 2 - elpa/s-20180406.808/s.el | 747 -- elpa/sesman-20190909.1754/sesman-autoloads.el | 106 - elpa/sesman-20190909.1754/sesman-browser.el | 482 - elpa/sesman-20190909.1754/sesman-pkg.el | 12 - elpa/sesman-20190909.1754/sesman.el | 1003 --- elpa/smex-20151212.2209/smex-autoloads.el | 37 - elpa/smex-20151212.2209/smex-pkg.el | 2 - elpa/smex-20151212.2209/smex.el | 484 - elpa/spinner-1.7.3/spinner-autoloads.el | 73 - elpa/spinner-1.7.3/spinner-pkg.el | 2 - elpa/spinner-1.7.3/spinner.el | 406 - .../tagedit-20161121.855/tagedit-autoloads.el | 127 - elpa/tagedit-20161121.855/tagedit-pkg.el | 2 - elpa/tagedit-20161121.855/tagedit.el | 1147 --- elpa/with-editor-20180726.2044/dir | 18 - .../with-editor-autoloads.el | 99 - .../with-editor-pkg.el | 13 - elpa/with-editor-20180726.2044/with-editor.el | 822 -- .../with-editor.info | 331 - init.el | 190 +- themes/color-theme-tomorrow.el | 610 -- themes/tomorrow-night-blue-theme.el | 2 - themes/tomorrow-night-bright-theme.el | 2 - themes/tomorrow-night-eighties-theme.el | 2 - themes/tomorrow-night-theme.el | 2 - themes/tomorrow-theme.el | 2 - themes/zenburn-theme.el | 474 - 196 files changed, 190 insertions(+), 92235 deletions(-) create mode 100644 customizations/git.el create mode 100644 customizations/markdown.el create mode 100644 customizations/projects.el create mode 100644 early-init.el delete mode 100644 elpa/a-20180907.953/a-autoloads.el delete mode 100644 elpa/a-20180907.953/a-pkg.el delete mode 100644 elpa/a-20180907.953/a.el delete mode 100644 elpa/archives/tromey/archive-contents delete mode 100644 elpa/async-20180527.1730/async-autoloads.el delete mode 100644 elpa/async-20180527.1730/async-bytecomp.el delete mode 100644 elpa/async-20180527.1730/async-pkg.el delete mode 100644 elpa/async-20180527.1730/async.el delete mode 100644 elpa/async-20180527.1730/dired-async.el delete mode 100644 elpa/async-20180527.1730/smtpmail-async.el delete mode 100644 elpa/cider-0.23.0/cider-apropos.el delete mode 100644 elpa/cider-0.23.0/cider-autoloads.el delete mode 100644 elpa/cider-0.23.0/cider-browse-ns.el delete mode 100644 elpa/cider-0.23.0/cider-browse-spec.el delete mode 100644 elpa/cider-0.23.0/cider-cheatsheet.el delete mode 100644 elpa/cider-0.23.0/cider-classpath.el delete mode 100644 elpa/cider-0.23.0/cider-client.el delete mode 100644 elpa/cider-0.23.0/cider-clojuredocs.el delete mode 100644 elpa/cider-0.23.0/cider-common.el delete mode 100644 elpa/cider-0.23.0/cider-compat.el delete mode 100644 elpa/cider-0.23.0/cider-completion.el delete mode 100644 elpa/cider-0.23.0/cider-connection.el delete mode 100644 elpa/cider-0.23.0/cider-debug.el delete mode 100644 elpa/cider-0.23.0/cider-doc.el delete mode 100644 elpa/cider-0.23.0/cider-eldoc.el delete mode 100644 elpa/cider-0.23.0/cider-eval.el delete mode 100644 elpa/cider-0.23.0/cider-find.el delete mode 100644 elpa/cider-0.23.0/cider-format.el delete mode 100644 elpa/cider-0.23.0/cider-inspector.el delete mode 100644 elpa/cider-0.23.0/cider-macroexpansion.el delete mode 100644 elpa/cider-0.23.0/cider-mode.el delete mode 100644 elpa/cider-0.23.0/cider-ns.el delete mode 100644 elpa/cider-0.23.0/cider-overlays.el delete mode 100644 elpa/cider-0.23.0/cider-pkg.el delete mode 100644 elpa/cider-0.23.0/cider-popup.el delete mode 100644 elpa/cider-0.23.0/cider-profile.el delete mode 100644 elpa/cider-0.23.0/cider-repl-history.el delete mode 100644 elpa/cider-0.23.0/cider-repl.el delete mode 100644 elpa/cider-0.23.0/cider-resolve.el delete mode 100644 elpa/cider-0.23.0/cider-scratch.el delete mode 100644 elpa/cider-0.23.0/cider-selector.el delete mode 100644 elpa/cider-0.23.0/cider-stacktrace.el delete mode 100644 elpa/cider-0.23.0/cider-test.el delete mode 100644 elpa/cider-0.23.0/cider-tracing.el delete mode 100644 elpa/cider-0.23.0/cider-util.el delete mode 100644 elpa/cider-0.23.0/cider-xref.el delete mode 100644 elpa/cider-0.23.0/cider.el delete mode 100644 elpa/cider-0.23.0/nrepl-client.el delete mode 100644 elpa/cider-0.23.0/nrepl-dict.el delete mode 100644 elpa/clojure-mode-20191112.1948/clojure-mode-autoloads.el delete mode 100644 elpa/clojure-mode-20191112.1948/clojure-mode-pkg.el delete mode 100644 elpa/clojure-mode-20191112.1948/clojure-mode.el delete mode 100644 elpa/clojure-mode-extra-font-locking-20190712.639/clojure-mode-extra-font-locking-autoloads.el delete mode 100644 elpa/clojure-mode-extra-font-locking-20190712.639/clojure-mode-extra-font-locking-pkg.el delete mode 100644 elpa/clojure-mode-extra-font-locking-20190712.639/clojure-mode-extra-font-locking.el delete mode 100644 elpa/dash-20180903.1042/dash-autoloads.el delete mode 100644 elpa/dash-20180903.1042/dash-pkg.el delete mode 100644 elpa/dash-20180903.1042/dash.el delete mode 100644 elpa/epl-20180205.2049/epl-autoloads.el delete mode 100644 elpa/epl-20180205.2049/epl-pkg.el delete mode 100644 elpa/epl-20180205.2049/epl.el delete mode 100644 elpa/exec-path-from-shell-20180324.204/exec-path-from-shell-autoloads.el delete mode 100644 elpa/exec-path-from-shell-20180324.204/exec-path-from-shell-pkg.el delete mode 100644 elpa/exec-path-from-shell-20180324.204/exec-path-from-shell.el delete mode 100644 elpa/ghub-20180909.2230/dir delete mode 100644 elpa/ghub-20180909.2230/ghub-autoloads.el delete mode 100644 elpa/ghub-20180909.2230/ghub-graphql.el delete mode 100644 elpa/ghub-20180909.2230/ghub-pkg.el delete mode 100644 elpa/ghub-20180909.2230/ghub.el delete mode 100644 elpa/ghub-20180909.2230/ghub.info delete mode 100644 elpa/ghub-20180909.2230/glab.el delete mode 100644 elpa/git-commit-20180802.2018/git-commit-autoloads.el delete mode 100644 elpa/git-commit-20180802.2018/git-commit-pkg.el delete mode 100644 elpa/git-commit-20180802.2018/git-commit.el delete mode 100644 elpa/ido-completing-read+-20180628.244/ido-completing-read+-autoloads.el delete mode 100644 elpa/ido-completing-read+-20180628.244/ido-completing-read+-pkg.el delete mode 100644 elpa/ido-completing-read+-20180628.244/ido-completing-read+.el delete mode 100644 elpa/magit-2.13.0/AUTHORS.md delete mode 100644 elpa/magit-2.13.0/LICENSE delete mode 100644 elpa/magit-2.13.0/dir delete mode 100644 elpa/magit-2.13.0/git-rebase.el delete mode 100644 elpa/magit-2.13.0/magit-apply.el delete mode 100644 elpa/magit-2.13.0/magit-autoloads.el delete mode 100644 elpa/magit-2.13.0/magit-autorevert.el delete mode 100644 elpa/magit-2.13.0/magit-bisect.el delete mode 100644 elpa/magit-2.13.0/magit-blame.el delete mode 100644 elpa/magit-2.13.0/magit-bookmark.el delete mode 100644 elpa/magit-2.13.0/magit-branch.el delete mode 100644 elpa/magit-2.13.0/magit-collab.el delete mode 100644 elpa/magit-2.13.0/magit-commit.el delete mode 100644 elpa/magit-2.13.0/magit-core.el delete mode 100644 elpa/magit-2.13.0/magit-diff.el delete mode 100644 elpa/magit-2.13.0/magit-ediff.el delete mode 100644 elpa/magit-2.13.0/magit-extras.el delete mode 100644 elpa/magit-2.13.0/magit-files.el delete mode 100644 elpa/magit-2.13.0/magit-git.el delete mode 100644 elpa/magit-2.13.0/magit-imenu.el delete mode 100644 elpa/magit-2.13.0/magit-log.el delete mode 100644 elpa/magit-2.13.0/magit-margin.el delete mode 100644 elpa/magit-2.13.0/magit-merge.el delete mode 100644 elpa/magit-2.13.0/magit-mode.el delete mode 100644 elpa/magit-2.13.0/magit-notes.el delete mode 100644 elpa/magit-2.13.0/magit-obsolete.el delete mode 100644 elpa/magit-2.13.0/magit-pkg.el delete mode 100644 elpa/magit-2.13.0/magit-process.el delete mode 100644 elpa/magit-2.13.0/magit-refs.el delete mode 100644 elpa/magit-2.13.0/magit-remote.el delete mode 100644 elpa/magit-2.13.0/magit-repos.el delete mode 100644 elpa/magit-2.13.0/magit-reset.el delete mode 100644 elpa/magit-2.13.0/magit-section.el delete mode 100644 elpa/magit-2.13.0/magit-sequence.el delete mode 100644 elpa/magit-2.13.0/magit-stash.el delete mode 100644 elpa/magit-2.13.0/magit-status.el delete mode 100644 elpa/magit-2.13.0/magit-submodule.el delete mode 100644 elpa/magit-2.13.0/magit-subtree.el delete mode 100644 elpa/magit-2.13.0/magit-tag.el delete mode 100644 elpa/magit-2.13.0/magit-utils.el delete mode 100644 elpa/magit-2.13.0/magit-wip.el delete mode 100644 elpa/magit-2.13.0/magit-worktree.el delete mode 100644 elpa/magit-2.13.0/magit.el delete mode 100644 elpa/magit-2.13.0/magit.info delete mode 100644 elpa/magit-2.13.0/magit.info-1 delete mode 100644 elpa/magit-2.13.0/magit.info-2 delete mode 100644 elpa/magit-popup-20180726.2037/dir delete mode 100644 elpa/magit-popup-20180726.2037/magit-popup-autoloads.el delete mode 100644 elpa/magit-popup-20180726.2037/magit-popup-pkg.el delete mode 100644 elpa/magit-popup-20180726.2037/magit-popup.el delete mode 100644 elpa/magit-popup-20180726.2037/magit-popup.info delete mode 100644 elpa/memoize-20180614.1930/memoize-autoloads.el delete mode 100644 elpa/memoize-20180614.1930/memoize-pkg.el delete mode 100644 elpa/memoize-20180614.1930/memoize.el delete mode 100644 elpa/paredit-20171127.205/paredit-autoloads.el delete mode 100644 elpa/paredit-20171127.205/paredit-pkg.el delete mode 100644 elpa/paredit-20171127.205/paredit.el delete mode 100644 elpa/parseclj-20190531.711/parseclj-ast.el delete mode 100644 elpa/parseclj-20190531.711/parseclj-autoloads.el delete mode 100644 elpa/parseclj-20190531.711/parseclj-lex.el delete mode 100644 elpa/parseclj-20190531.711/parseclj-parser.el delete mode 100644 elpa/parseclj-20190531.711/parseclj-pkg.el delete mode 100644 elpa/parseclj-20190531.711/parseclj.el delete mode 100644 elpa/parseedn-20191113.831/parseedn-autoloads.el delete mode 100644 elpa/parseedn-20191113.831/parseedn-pkg.el delete mode 100644 elpa/parseedn-20191113.831/parseedn.el delete mode 100644 elpa/pkg-info-20150517.1143/pkg-info-autoloads.el delete mode 100644 elpa/pkg-info-20150517.1143/pkg-info-pkg.el delete mode 100644 elpa/pkg-info-20150517.1143/pkg-info.el delete mode 100644 elpa/projectile-20180824.2239/projectile-autoloads.el delete mode 100644 elpa/projectile-20180824.2239/projectile-pkg.el delete mode 100644 elpa/projectile-20180824.2239/projectile.el delete mode 100644 elpa/queue-0.2/queue-autoloads.el delete mode 100644 elpa/queue-0.2/queue-pkg.el delete mode 100644 elpa/queue-0.2/queue.el delete mode 100644 elpa/rainbow-delimiters-20170929.1132/rainbow-delimiters-autoloads.el delete mode 100644 elpa/rainbow-delimiters-20170929.1132/rainbow-delimiters-pkg.el delete mode 100644 elpa/rainbow-delimiters-20170929.1132/rainbow-delimiters.el delete mode 100644 elpa/s-20180406.808/s-autoloads.el delete mode 100644 elpa/s-20180406.808/s-pkg.el delete mode 100644 elpa/s-20180406.808/s.el delete mode 100644 elpa/sesman-20190909.1754/sesman-autoloads.el delete mode 100644 elpa/sesman-20190909.1754/sesman-browser.el delete mode 100644 elpa/sesman-20190909.1754/sesman-pkg.el delete mode 100644 elpa/sesman-20190909.1754/sesman.el delete mode 100644 elpa/smex-20151212.2209/smex-autoloads.el delete mode 100644 elpa/smex-20151212.2209/smex-pkg.el delete mode 100644 elpa/smex-20151212.2209/smex.el delete mode 100644 elpa/spinner-1.7.3/spinner-autoloads.el delete mode 100644 elpa/spinner-1.7.3/spinner-pkg.el delete mode 100644 elpa/spinner-1.7.3/spinner.el delete mode 100644 elpa/tagedit-20161121.855/tagedit-autoloads.el delete mode 100644 elpa/tagedit-20161121.855/tagedit-pkg.el delete mode 100644 elpa/tagedit-20161121.855/tagedit.el delete mode 100644 elpa/with-editor-20180726.2044/dir delete mode 100644 elpa/with-editor-20180726.2044/with-editor-autoloads.el delete mode 100644 elpa/with-editor-20180726.2044/with-editor-pkg.el delete mode 100644 elpa/with-editor-20180726.2044/with-editor.el delete mode 100644 elpa/with-editor-20180726.2044/with-editor.info delete mode 100644 themes/color-theme-tomorrow.el delete mode 100644 themes/tomorrow-night-blue-theme.el delete mode 100644 themes/tomorrow-night-bright-theme.el delete mode 100644 themes/tomorrow-night-eighties-theme.el delete mode 100644 themes/tomorrow-night-theme.el delete mode 100644 themes/tomorrow-theme.el delete mode 100644 themes/zenburn-theme.el diff --git a/.gitignore b/.gitignore index 1eafb37ff..f5f87044f 100644 --- a/.gitignore +++ b/.gitignore @@ -9,5 +9,7 @@ projectile.cache auto-save-list backups melpa-stable +elpa +custom.el archive-contents *.elc diff --git a/README.md b/README.md index 08a66e70c..b543d6836 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,3 @@ -# WARNING this does not work currently - -A lot has changed since I last put significant effort into this repo, and as a result this emacs -config is broken. I hope to get it working again soon (as of 2022-04-02). - -If you're completely new to Clojure and emacs, I recommend using [Calva](https://calva.io/), a plugin -for VSCode, rather than trying to learn both Clojure and Emacs at the same time. Other options: - -- [Practicalli Spacemacs](https://practical.li/spacemacs/) -- [Cursive](https://cursive-ide.com/) -- [Vim fireplace](https://github.com/tpope/vim-fireplace) - # this is a Clojure-friendly emacs config If you're new to emacs, check out @@ -33,30 +21,19 @@ If you're new to emacs, check out Then open Emacs. ## Upgrading - -Before upgrading, ensure that your `.emacs.d` directory is under -version control so that you can always revert to a known good state. - -To upgrade: - -1. Edit `.emacs.d/init.el`, adding these lines after line 12: - - ```elisp - (add-to-list 'package-archives - '("melpa-stable" . "http://stable.melpa.org/packages/") t) - - (add-to-list 'package-pinned-packages '(cider . "melpa-stable") t) - ``` - -2. Close Emacs. -3. Run `rm -Rf .emacs.d/elpa/cider-*` -4. Open Emacs. You'll probably see some errors and your theme won't - load. That's ok. -5. In Emacs, run `M-x package-refresh-contents`. -6. In Emacs, run `M-x package-install cider`. -7. Close and re-open Emacs. - -That should install the latest version. Enjoy! +Each package we use gets updated by its authors, at whatever cadence works for +them. It's a good idea to stay up-to-date, to get improvements and bug +fixes. It's analogous to keeping the software up-to-date in your operating +system. + +When you run `M-x list-packages` it refreshes the cache of all the package +repositories, and then tells you in the status line whether there are any +updates to install. Press `U` to mark all upgradeable packages for installation, +and then press `x` to execute the installation. You will be prompted to confirm, +and when you press `y` the package updates will be installed. Press `q` to exit +the package list when it's finished. + +If you ever get curious to look, you can find all the installed packages in `~/.emacs.d/elpa`. ## Organization diff --git a/customizations/elisp-editing.el b/customizations/elisp-editing.el index 717634b96..66011d0ab 100644 --- a/customizations/elisp-editing.el +++ b/customizations/elisp-editing.el @@ -1,12 +1,12 @@ ;; Automatically load paredit when editing a lisp file ;; More at http://www.emacswiki.org/emacs/ParEdit -(autoload 'enable-paredit-mode "paredit" "Turn on pseudo-structural editing of Lisp code." t) -(add-hook 'emacs-lisp-mode-hook #'enable-paredit-mode) -(add-hook 'eval-expression-minibuffer-setup-hook #'enable-paredit-mode) -(add-hook 'ielm-mode-hook #'enable-paredit-mode) -(add-hook 'lisp-mode-hook #'enable-paredit-mode) -(add-hook 'lisp-interaction-mode-hook #'enable-paredit-mode) -(add-hook 'scheme-mode-hook #'enable-paredit-mode) +(setup (:package paredit) + (:hook-into emacs-lisp-mode + eval-expression-minibuffer-setup + ielm-mode + lisp-mode + lisp-interaction-mode + scheme-mode)) ;; eldoc-mode shows documentation in the minibuffer when writing code ;; http://www.emacswiki.org/emacs/ElDoc diff --git a/customizations/git.el b/customizations/git.el new file mode 100644 index 000000000..01e42926f --- /dev/null +++ b/customizations/git.el @@ -0,0 +1,5 @@ +;; magit is a full-fledged interface for git +;; https://magit.vc/manual/magit/ +(add-to-list 'package-pinned-packages '(magit . "melpa-stable") t) +(setup (:package magit) + (:global "C-M-;" magit-status)) diff --git a/customizations/markdown.el b/customizations/markdown.el new file mode 100644 index 000000000..feb12980a --- /dev/null +++ b/customizations/markdown.el @@ -0,0 +1,5 @@ +;; markdown is a syntax for writing prose documents in plain text +;; It is very commonly used for README files and documentation +;; https://daringfireball.net/projects/markdown/syntax +(setup (:package markdown-mode) + (:hook auto-fill-mode)) diff --git a/customizations/navigation.el b/customizations/navigation.el index 1d22037b3..5387d44b8 100644 --- a/customizations/navigation.el +++ b/customizations/navigation.el @@ -1,62 +1,30 @@ ;; These customizations make it easier for you to navigate files, ;; switch buffers, and choose options from the minibuffer. - -;; "When several buffers visit identically-named files, -;; Emacs must give the buffers distinct names. The usual method -;; for making buffer names unique adds ‘<2>’, ‘<3>’, etc. to the end -;; of the buffer names (all but one of them). -;; The forward naming method includes part of the file's directory -;; name at the beginning of the buffer name -;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Uniquify.html -(require 'uniquify) -(setq uniquify-buffer-name-style 'forward) - -;; Turn on recent file mode so that you can more easily switch to -;; recently edited files when you first start emacs -(setq recentf-save-file (concat user-emacs-directory ".recentf")) -(require 'recentf) -(recentf-mode 1) -(setq recentf-max-menu-items 40) - - -;; ido-mode allows you to more easily navigate choices. For example, -;; when you want to switch buffers, ido presents you with a list -;; of buffers in the the mini-buffer. As you start to type a buffer's -;; name, ido will narrow down the list of buffers to match the text -;; you've typed in -;; http://www.emacswiki.org/emacs/InteractivelyDoThings -(ido-mode t) - -;; This allows partial matches, e.g. "tl" will match "Tyrion Lannister" -(setq ido-enable-flex-matching t) - -;; Turn this behavior off because it's annoying -(setq ido-use-filename-at-point nil) - -;; Don't try to match file across all "work" directories; only match files -;; in the current directory displayed in the minibuffer -(setq ido-auto-merge-work-directories-length -1) - -;; Includes buffer names of recently open files, even if they're not -;; open now -(setq ido-use-virtual-buffers t) - -;; This enables ido in all contexts where it could be useful, not just -;; for selecting buffer and file names -(ido-ubiquitous-mode t) -(ido-everywhere t) - -;; Shows a list of buffers -(global-set-key (kbd "C-x C-b") 'ibuffer) - - -;; Enhances M-x to allow easier execution of commands. Provides -;; a filterable list of possible commands in the minibuffer -;; http://www.emacswiki.org/emacs/Smex -(setq smex-save-file (concat user-emacs-directory ".smex-items")) -(smex-initialize) -(global-set-key (kbd "M-x") 'smex) - -;; projectile everywhere! -(projectile-global-mode) +;; which-key is the best feature for the discoverability and +;; usability of Emacs. When you start a key sequence, e.g. C-x, +;; a menu opens up that shows you what all your next options +;; are. It's a great way to find out what's in Emacs, and it +;; helps transfer commands from your short-term memory to +;; your long-term memory and (finally) your muscle memory. +(setup (:package which-key) + (which-key-mode) + (:option which-key-idle-delay 0.3)) + +;; ivy is the completion framework. This makes M-x much +;; more usable. +;; installing counsel brings ivy and swiper as dependencies +;; swiper is a powerful search-with-a-buffer capability. +;; https://github.com/abo-abo/swiper +(setup (:package counsel) + (ivy-mode) + (:option ivy-use-virtual-buffers t + ivy-re-builders-alist '((t . ivy--regex-ignore-order)) + ivy-count-format "%d/%d ") + (:global "C-s" swiper + "s-f" swiper + "C-x C-f" counsel-find-file + "C-x C-b" counsel-switch-buffer + "M-x" counsel-M-x)) + +(setup (:package ivy-rich)) diff --git a/customizations/projects.el b/customizations/projects.el new file mode 100644 index 000000000..bf4d79ef8 --- /dev/null +++ b/customizations/projects.el @@ -0,0 +1,11 @@ +;; projectile is another amazing package from the +;; creator of CIDER. It's got lots of commands +;; for searching and managing files in a project. +(setup (:package projectile) + (projectile-mode +1) + (:bind "s-p" projectile-command-map + "C-c p" projectile-command-map)) + +;; counsel-projectile integrates projectile with +;; counsel's browse-and-select UI +(setup (:package counsel-projectile)) diff --git a/customizations/setup-clojure.el b/customizations/setup-clojure.el index 1b031266a..34780c740 100644 --- a/customizations/setup-clojure.el +++ b/customizations/setup-clojure.el @@ -1,50 +1,47 @@ -;;;; -;; Clojure -;;;; - -;; Enable paredit for Clojure -(add-hook 'clojure-mode-hook 'enable-paredit-mode) - -;; This is useful for working with camel-case tokens, like names of -;; Java classes (e.g. JavaClassName) -(add-hook 'clojure-mode-hook 'subword-mode) - -;; A little more syntax highlighting -(require 'clojure-mode-extra-font-locking) - -;; syntax hilighting for midje -(add-hook 'clojure-mode-hook - (lambda () - (setq inferior-lisp-program "lein repl") - (font-lock-add-keywords - nil - '(("(\\(facts?\\)" - (1 font-lock-keyword-face)) - ("(\\(background?\\)" - (1 font-lock-keyword-face)))) - (define-clojure-indent (fact 1)) - (define-clojure-indent (facts 1)) - (rainbow-delimiters-mode))) - -;;;; -;; Cider -;;;; - -;; provides minibuffer documentation for the code you're typing into the repl -(add-hook 'cider-mode-hook 'eldoc-mode) - -;; go right to the REPL buffer when it's finished connecting -(setq cider-repl-pop-to-buffer-on-connect t) - -;; When there's a cider error, show its buffer and switch to it -(setq cider-show-error-buffer t) -(setq cider-auto-select-error-buffer t) - -;; Where to store the cider history. -(setq cider-repl-history-file "~/.emacs.d/cider-history") - -;; Wrap when navigating history. -(setq cider-repl-wrap-history t) +;; clojure-mode is (naturally) the major mode for editing +;; Clojure and ClojureScript. subword-mode allows words +;; in camel case to be treated as separate words for +;; movement and editing commands. +;; https://github.com/clojure-emacs/clojure-mode +;; subword-mode is useful for working with camel-case tokens, +;; like names of Java classes (e.g. JavaClassName) +(setup (:package clojure-mode) + (:hook subword-mode + paredit-mode) + (:bind "C-c C-v" #'cider-start-http-server + "C-M-r" #'cider-refresh + "C-c u" #'cider-user-ns)) + +;; CIDER is a whole interactive development environment for +;; Clojure. There is a ton of functionality here, so be sure +;; to check out the excellent documentation at +;; https://docs.cider.mx/cider/index.html +(setup (:package cider) + (:bind "C-c u" #'cider-user-ns) + (:option cider-show-error-buffer t + cider-auto-select-error-buffer t + cider-repl-history-file "~/.emacs.d/cider-history" + cider-repl-pop-to-buffer-on-connect t + cider-repl-wrap-history t)) + +;; company provides auto-completion for CIDER +;; see https://docs.cider.mx/cider/usage/code_completion.html +(setup (:package company) + (:hook-into cider-mode + cider-repl-mode)) + +;; hydra provides a nice looking menu for commands +;; to see what's available, use M-x and the prefix cider-hydra +;; https://github.com/clojure-emacs/cider-hydra +(setup (:package cider-hydra) + (:hook-into clojure-mode)) + +;; additional refactorings for CIDER +;; e.g. add missing libspec, extract function, destructure keys +;; https://github.com/clojure-emacs/clj-refactor.el +(setup (:package clj-refactor) + (cljr-add-keybindings-with-prefix "C-c C-m") + (:hook-into clojure-mode)) ;; enable paredit in your REPL (add-hook 'cider-repl-mode-hook 'paredit-mode) @@ -66,7 +63,6 @@ (cider-interactive-eval (format "(println '(def server (%s/start))) (println 'server)" ns)) (cider-interactive-eval (format "(def server (%s/start)) (println server)" ns)))) - (defun cider-refresh () (interactive) (cider-interactive-eval (format "(user/reset)"))) @@ -74,10 +70,3 @@ (defun cider-user-ns () (interactive) (cider-repl-set-ns "user")) - -(eval-after-load 'cider - '(progn - (define-key clojure-mode-map (kbd "C-c C-v") 'cider-start-http-server) - (define-key clojure-mode-map (kbd "C-M-r") 'cider-refresh) - (define-key clojure-mode-map (kbd "C-c u") 'cider-user-ns) - (define-key cider-mode-map (kbd "C-c u") 'cider-user-ns))) diff --git a/customizations/setup-js.el b/customizations/setup-js.el index 896c09353..da50463ab 100644 --- a/customizations/setup-js.el +++ b/customizations/setup-js.el @@ -1,14 +1,11 @@ ;; javascript / html +(setup (:package tagedit) + (:hook-into html-mode)) + (add-to-list 'auto-mode-alist '("\\.js$" . js-mode)) (add-hook 'js-mode-hook 'subword-mode) (add-hook 'html-mode-hook 'subword-mode) (setq js-indent-level 2) -(eval-after-load "sgml-mode" - '(progn - (require 'tagedit) - (tagedit-add-paredit-like-keybindings) - (add-hook 'html-mode-hook (lambda () (tagedit-mode 1))))) - ;; coffeescript (add-to-list 'auto-mode-alist '("\\.coffee.erb$" . coffee-mode)) diff --git a/customizations/shell-integration.el b/customizations/shell-integration.el index 7460b0c55..70b7be0af 100644 --- a/customizations/shell-integration.el +++ b/customizations/shell-integration.el @@ -1,6 +1,6 @@ ;; Sets up exec-path-from shell ;; https://github.com/purcell/exec-path-from-shell -(when (memq window-system '(mac ns)) - (exec-path-from-shell-initialize) - (exec-path-from-shell-copy-envs - '("PATH"))) +(setup + (when (memq window-system '(mac ns))) + (:package exec-path-from-shell) + (exec-path-from-shell-initialize)) diff --git a/customizations/ui.el b/customizations/ui.el index 8a8ed9996..6c919d974 100644 --- a/customizations/ui.el +++ b/customizations/ui.el @@ -19,14 +19,24 @@ (when (fboundp 'scroll-bar-mode) (scroll-bar-mode -1)) -;; Color Themes -;; Read http://batsov.com/articles/2012/02/19/color-theming-in-emacs-reloaded/ -;; for a great explanation of emacs color themes. -;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Custom-Themes.html -;; for a more technical explanation. -(add-to-list 'custom-theme-load-path "~/.emacs.d/themes") -(add-to-list 'load-path "~/.emacs.d/themes") -(load-theme 'tomorrow-night-bright t) +;; doom is a whole Emacs distribution unto itself, +;; but it's got some really nice packages that you +;; can use a-la-carte. doom-modeline is simply a more +;; modern and more beautiful modeline. + +(setup (:package all-the-icons)) + +(setup (:package doom-modeline) + (doom-modeline-mode t)) + +;; Lots of great themes, both light ones +;; and dark ones. Use M-x load-theme to select one. +;; The first time you load one, it asks for +;; confirmation. You can see what they all +;; look like here: +;; https://github.com/doomemacs/themes/tree/screenshots +(setup (:package doom-themes) + (load-theme 'doom-laserwave t)) ;; increase font size for better readability (set-face-attribute 'default nil :height 140) @@ -56,6 +66,10 @@ ;; Mouse yank commands yank at point instead of at click. mouse-yank-at-point t) +(tool-bar-mode -1) + +(tooltip-mode -1) + ;; No cursor blinking, it's distracting (blink-cursor-mode 0) @@ -67,3 +81,7 @@ ;; no bell (setq ring-bell-function 'ignore) + +;; initial frame height and width +(add-to-list 'default-frame-alist '(height . 95)) +(add-to-list 'default-frame-alist '(width . 154)) diff --git a/early-init.el b/early-init.el new file mode 100644 index 000000000..b46a3b99c --- /dev/null +++ b/early-init.el @@ -0,0 +1,2 @@ +;; improve startup time by pausing garbage collection during init +(setq gc-cons-threshold most-positive-fixnum) diff --git a/elpa/a-20180907.953/a-autoloads.el b/elpa/a-20180907.953/a-autoloads.el deleted file mode 100644 index c9ec568d1..000000000 --- a/elpa/a-20180907.953/a-autoloads.el +++ /dev/null @@ -1,22 +0,0 @@ -;;; a-autoloads.el --- automatically extracted autoloads -;; -;;; Code: - -(add-to-list 'load-path (directory-file-name - (or (file-name-directory #$) (car load-path)))) - - -;;;### (autoloads nil "a" "a.el" (0 0 0 0)) -;;; Generated autoloads from a.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "a" '("a-"))) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; coding: utf-8 -;; End: -;;; a-autoloads.el ends here diff --git a/elpa/a-20180907.953/a-pkg.el b/elpa/a-20180907.953/a-pkg.el deleted file mode 100644 index f07f86445..000000000 --- a/elpa/a-20180907.953/a-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "a" "20180907.953" "Associative data structure functions" '((emacs "25")) :commit "18966975db7110d0aac726be95b593e2fc3d44ed" :keywords '("lisp") :authors '(("Arne Brasseur" . "arne@arnebrasseur.net")) :maintainer '("Arne Brasseur" . "arne@arnebrasseur.net") :url "https://github.com/plexus/a.el") diff --git a/elpa/a-20180907.953/a.el b/elpa/a-20180907.953/a.el deleted file mode 100644 index b699160ee..000000000 --- a/elpa/a-20180907.953/a.el +++ /dev/null @@ -1,347 +0,0 @@ -;;; a.el --- Associative data structure functions -*- lexical-binding: t; -*- - -;; Copyright (C) 2017 Arne Brasseur - -;; Author: Arne Brasseur -;; URL: https://github.com/plexus/a.el -;; Package-Version: 20180907.953 -;; Keywords: lisp -;; Version: 0.1.1 -;; Package-Requires: ((emacs "25")) - -;; This file is not part of GNU Emacs. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to -;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. - -;;; Commentary: - -;; Library for dealing with associative data structures: alists, hash-maps, and -;; vectors (for vectors, the indices are treated as keys). -;; -;; This library is largely inspired by Clojure, it has many of the functions -;; found in clojure.core, prefixed with `a-'. All functions treat their -;; arguments as immutable, so e.g. `a-assoc' will clone the hash-table or alist -;; it is given. Keep this in mind when writing performance sensitive code. - -;;; Code: - -(eval-when-compile (require 'subr-x)) ;; for things like hash-table-keys - -(require 'cl-lib) -(require 'seq) - -(defun a-associative-p (obj) - (or (not obj) - (hash-table-p obj) - (and (consp obj) (consp (car obj))))) - -(defalias 'a-associative? 'a-associative-p) - -(defun a-get (map key &optional not-found) - "Return the value MAP mapped to KEY, NOT-FOUND or nil if key not present." - (cond - ;; own implementation instead of alist-get so keys are checked with equal - ;; instead of eq - ((listp map) - (a--alist-get map key not-found)) - - ((vectorp map) - (if (a-has-key? map key) - (aref map key) - not-found)) - - ((hash-table-p map) - (gethash key map not-found)) - (t (user-error "Not associative: %S" map)))) - -(defun a--alist-get (map key &optional not-found) - "Like alist-get, but uses equal instead of eq to look up in map MAP key KEY. -Returns NOT-FOUND if the key is not present, or `nil' if -NOT-FOUND is not specified." - (cl-block nil - (seq-doseq (pair map) - (when (equal (car pair) key) - (cl-return (cdr pair)))) - not-found)) - -(defun a-get-in (m ks &optional not-found) - "Look up a value in a nested associative structure. - -Given a data structure M, and a sequence of keys KS, find the -value found by using each key in turn to do a lookup in the next -\"layer\". Return `nil' if the key is not present, or the NOT-FOUND -value if supplied." - (let ((result m)) - (cl-block nil - (seq-doseq (k ks) - (if (a-has-key? result k) - (setq result (a-get result k)) - (cl-return not-found))) - result))) - -(defmacro a-get* (&rest keys) - "Look up a value in a nested associative structure. - -Like a-get-in, but takes the key sequence KEYS directly as vararg -arguments, rather than as a single sequence." - (cl-labels ((rec (keys) - `(a-get ,(if (and (consp (cdr keys)) - (cddr keys)) - (rec (cdr keys)) - (cadr keys)) - ,(car keys)))) - (rec (nreverse keys)))) - -(defun a-has-key (coll k) - "Check if the given associative collection COLL has a certain key K." - (cond - ((listp coll) (not (eq (a--alist-get coll k :not-found) :not-found))) - ((vectorp coll) (and (integerp k) (< -1 k (length coll)))) - ((hash-table-p coll) (not (eq (gethash k coll :not-found) :not-found))) - (t (user-error "Not associative: %S" coll)))) - -(defalias 'a-has-key? 'a-has-key) - -(defun a-assoc-1 (coll k v) - "Like `a-assoc', (in COLL assoc K with V) but only takes a single k-v pair. -Internal helper function." - (cond - ((listp coll) - (if (a-has-key? coll k) - (mapcar (lambda (entry) - (if (equal (car entry) k) - (cons k v) - entry)) - coll) - (cons (cons k v) coll))) - - ((vectorp coll) - (if (and (integerp k) (> k 0)) - (if (< k (length coll)) - (let ((copy (copy-sequence coll))) - (aset copy k v) - copy) - (vconcat coll (make-list (- k (length coll)) nil) (list v))))) - - ((hash-table-p coll) - (let ((copy (copy-hash-table coll))) - (puthash k v copy) - copy)))) - -(defun a-assoc (coll &rest kvs) - "Return an updated collection COLL, associating values with keys KVS." - (when (not (cl-evenp (a-count kvs))) - (user-error "a-assoc requires an even number of arguments!")) - (seq-reduce (lambda (coll kv) - (seq-let [k v] kv - (a-assoc-1 coll k v))) - (seq-partition kvs 2) - coll)) - -(defun a-keys (coll) - "Return the keys in the collection COLL." - (cond - ((listp coll) - (mapcar #'car coll)) - - ((hash-table-p coll) - (hash-table-keys coll)))) - -(defun a-vals (coll) - "Return the values in the collection COLL." - (cond - ((listp coll) - (mapcar #'cdr coll)) - - ((hash-table-p coll) - (hash-table-values coll)))) - -(defun a-reduce-kv (fn from coll) - "Reduce with FN starting from FROM the collection COLL. -Reduce an associative collection COLL, starting with an initial -value of FROM. The reducing function FN receives the intermediate -value, key, and value." - (seq-reduce (lambda (acc key) - (funcall fn acc key (a-get coll key))) - (a-keys coll) - from)) - -(defun a-count (coll) - "Count the number of key-value pairs in COLL. -Like length, but can also return the length of hash tables." - (cond - ((seqp coll) - (length coll)) - - ((hash-table-p coll) - (hash-table-count coll)))) - -(defun a-equal (a b) - "Compare collections A, B for value equality. - -Associative collections (hash tables and a-lists) are considered -equal if they contain equal key-value pairs, regardless of order. - -Sequences (lists or vectors) are considered equal if they contain -the same elements in the same order. - -Collection elements are compared using `a-equal'. In other words, -the equality check is recursive, resulting in a \"deep\" equality -check. - -Anything that isn't associative or a sequence is compared with -`equal'." - (cond - ((and (a-associative? a) (a-associative? b)) - (or (equal a b) - (when (eq (a-count a) (a-count b)) - (cl-block nil - (seq-doseq (k (a-keys a)) - (when (not (a-equal (a-get a k) (a-get b k))) - (cl-return nil))) - t)))) - ((and (sequencep a) (sequencep b)) - (and (eq (length a) (length b)) - (or (and (seq-empty-p a) (seq-empty-p b)) - (and (a-equal (elt a 0) (elt b 0)) - (a-equal (seq-drop a 1) (seq-drop b 1)))))) - (t - (equal a b)))) - -(defalias 'a-equal? 'a-equal) - -(defun a-merge (&rest colls) - "Merge multiple associative collections. -Return the type of the first collection COLLS." - (seq-reduce (lambda (this that) - (a-reduce-kv (lambda (coll k v) - (a-assoc coll k v)) - this - that)) - (cdr colls) - (car colls))) - -(defun a-merge-with (f &rest colls) - "Merge multiple associative collections. -Return the type of the first collection COLLS. If a key exists in -both, then combine the associated values by calling f on them." - (seq-reduce (lambda (this that) - (a-reduce-kv (lambda (coll k v) - (a-assoc coll k (if (a-has-key coll k) - (funcall f v (a-get coll k)) - v))) - this - that)) - (cdr colls) - (car colls))) - -(defun a-alist (&rest kvs) - "Create an association list from the given keys and values KVS. -Arguments are simply provided in sequence, rather than as lists or cons cells. -For example: (a-alist :foo 123 :bar 456)" - (mapcar (lambda (kv) (cons (car kv) (cadr kv))) (seq-partition kvs 2))) - -(defalias 'a-list 'a-alist) - -(defun a-hash-table (&rest kvs) - "Create a hash table from the given keys and values KVS. -Arguments are simply provided in sequence, rather than as lists -or cons cells. As \"test\" for the hash table, equal is used. The -hash table is created without extra storage space, so with a size -equal to amount of key-value pairs, since it is assumed to be -treated as immutable. -For example: (a-hash-table :foo 123 :bar 456)" - (let* ((kv-pairs (seq-partition kvs 2)) - (hash-map (make-hash-table :test 'equal :size (length kv-pairs)))) - (seq-do (lambda (pair) - (puthash (car pair) (cadr pair) hash-map)) - kv-pairs) - hash-map)) - -(defun a-assoc-in (coll keys value) - "In collection COLL, at location KEYS, associate value VALUE. -Associates a value in a nested associative collection COLL, where -KEYS is a sequence of keys and VALUE is the new value and returns -a new nested structure. If any levels do not exist, association -lists will be created." - (cl-case (length keys) - (0 coll) - (1 (a-assoc-1 coll (elt keys 0) value)) - (t (a-assoc-1 coll - (elt keys 0) - (a-assoc-in (a-get coll (elt keys 0)) - (seq-drop keys 1) - value))))) - -(defun a-dissoc--list (list keys) - "Return updated LIST with KEYS removed. -Internal helper. Use `a-dissoc' instead." - (a-reduce-kv (lambda (res k v) - (if (member k keys) - res - (cons (cons k v) res))) - nil - list)) - -(defun a-dissoc--hash-table (table keys) - "Return updated TABLE with KEYS removed. -Internal helper. Use `a-dissoc' instead." - (let ((new-table (make-hash-table :size (hash-table-count table) - :test (hash-table-test table))) - (rest-keys (seq-remove (lambda (k) - (member k keys)) - (a-keys table)))) - (seq-doseq (k rest-keys) - (puthash k (gethash k table) new-table)) - new-table)) - -(defun a-dissoc (coll &rest keys) - "Return an updated version of collection COLL with the KEY removed." - (cond - ((listp coll) (a-dissoc--list coll keys)) - ((hash-table-p coll) (a-dissoc--hash-table coll keys)))) - -(defun a-update (coll key fn &rest args) - "In collection COLL, at location KEY, apply FN with extra args ARGS. -'Updates' a value in an associative collection COLL, where KEY is -a key and FN is a function that will take the old value and any -supplied args and return the new value, and returns a new -structure. If the key does not exist, nil is passed as the old -value." - (a-assoc-1 coll - key - (apply #'funcall fn (a-get coll key) args))) - -(defun a-update-in (coll keys fn &rest args) - "In collection COLL, at location KEYS, apply FN with extra args ARGS. -'Updates' a value in a nested associative collection COLL, where -KEYS is a sequence of keys and FN is a function that will take -the old value and any supplied ARGS and return the new value, and -returns a new nested structure. If any levels do not exist, -association lists will be created." - (cl-case (length keys) - (0 coll) - (1 (apply #'a-update coll (elt keys 0) fn args)) - (t (a-assoc-1 coll - (elt keys 0) - (apply #'a-update-in - (a-get coll (elt keys 0)) - (seq-drop keys 1) - fn - args))))) - -(provide 'a) -;;; a.el ends here diff --git a/elpa/archives/tromey/archive-contents b/elpa/archives/tromey/archive-contents deleted file mode 100644 index 0a7883543..000000000 --- a/elpa/archives/tromey/archive-contents +++ /dev/null @@ -1,447 +0,0 @@ -(1 - (load-relative . - [(0 1) - nil "relative file load (within a multi-file Emacs package)" single]) - (test-unit . - [(0 1) - nil "Unit Test Framework for Emacs Lisp " single]) - (zenburn . - [(1 8) - nil "just some alien fruit salad to keep you in the zone" single]) - (multi-project . - [(0 0 1) - nil "Work with multiple projects" single]) - (hungry-delete . - [(1 0) - nil "hungry delete minor mode" single]) - (Save-visited-files . - [(1 2) - nil "save opened files across sessions" single]) - (c-eldoc . - [(0 6) - nil "helpful description of the arguments to C functions" single]) - (mv-shell . - [(1 0) - nil "keep buffers in sync with filename throughout 'mv'commands in shell-mode." single]) - (diff-git . - [(0 1 1) - nil "Git integration with diff-mode" single]) - (html-script-src . - [(0 0 2) - nil "Insert