Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge purcell #12

Merged
merged 65 commits into from
Sep 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
5ed2eee
Switch from company to corfu for completion
purcell Jul 22, 2022
6a22755
Don't set completion-styles locally in minibuffer
purcell Jul 22, 2022
e23ae9e
Account for csv-mode requiring newer Emacs versions
purcell Jul 22, 2022
03bd3ce
orderless isn't compatible with older emacsen
purcell Jul 22, 2022
ac935b1
Add Emacs 28.1 to CI
purcell Jul 22, 2022
a3a98a1
Emphasise that basic functionality may break in older Emacsen
purcell Jul 23, 2022
6190c87
Drop support for Emacs 25.x
purcell Jul 23, 2022
b0cc9ea
Disable corfu-auto in eshell-mode
purcell Aug 26, 2022
a8f2a45
Show flymake message first in eldoc, so it isn't hidden when using eglot
purcell Sep 8, 2022
aeb16fe
Prefer load-library to featurep when checking for available ob- libs
purcell Nov 18, 2022
f454802
Set ledger-mode-should-check-version to nil
purcell Nov 23, 2022
80ead24
Remove beacon to stop CI from breaking (see #87)
purcell Nov 25, 2022
6eec82f
Update config for corfu info popups
purcell Nov 29, 2022
a9e0eb8
Allow extra args in advised function
purcell Jan 17, 2023
289a748
[minibuffer] Fix "Invalid preview key" message in minibuffer
c6c7 Feb 13, 2023
3661217
Merge pull request #836 from c6c7/master
purcell Feb 13, 2023
678073d
When using rg for projectile file lists, print with nulls
purcell Feb 24, 2023
0297f15
Bind C-h A to describe-face
purcell Mar 29, 2023
fc2aa35
Use "nil" as the language server for nix-mode
purcell Mar 29, 2023
7507f17
Don't override RET binding globally, just rely on electric-indent
purcell Jun 6, 2023
1b18fd2
Prefer derived-mode-p when checking major-mode
purcell Jun 8, 2023
2e1c51d
Remove now-redundant eglot server override for tuareg-mode
purcell Jun 8, 2023
e76fb18
Remove default binding of RET in paredit-mode
purcell Jun 8, 2023
9b7ddc5
Upgrade granularity of magit diffs
purcell Jun 8, 2023
5f1ef30
Prefer "when" to "if" with no "else" branch
purcell Jun 28, 2023
9d80c30
Unconditionally load corfu-popupinfo
purcell Jul 10, 2023
6c88ee2
Add keybinding for flymake-show-buffer-diagnostics
purcell Jul 28, 2023
04ad959
Add basic treesitter support
purcell Aug 2, 2023
29f07b5
Fix snippet for treesitter remapping of js2-mode
purcell Aug 2, 2023
b53dc60
Alter clojure-ts-mode-hook along with clojure-mode-hook
purcell Aug 2, 2023
1506a90
Make treesitter auto-configuration code clearer
purcell Aug 2, 2023
048f7bd
Add Emacs 29.1 to CI, don't fail if Emacs HEAD fails
purcell Aug 2, 2023
9819951
Fix actions
purcell Aug 2, 2023
76a7050
Only run CI on Linux
purcell Aug 2, 2023
5050cb5
Fix bindings inside when-let
purcell Aug 2, 2023
f67b76f
Add dependabot config to get automatic Actions updates
purcell Aug 2, 2023
7ce2be5
chore(deps): bump actions/checkout from 2 to 3
dependabot[bot] Aug 2, 2023
989e37d
Merge pull request #847 from purcell/dependabot/github_actions/action…
purcell Aug 2, 2023
5d11407
Switch back from affe to consult-ripgrep
purcell Aug 4, 2023
e4ee065
Turn off consult preview for my consult-ripgrep wrapper too
purcell Aug 9, 2023
db0ebae
Don't set defunct consult config var
purcell Aug 9, 2023
2c76710
Restore M-<up> binding for paredit
purcell Aug 9, 2023
7a34484
More aggressively try to load treesit to judge its presence
purcell Aug 10, 2023
b9ec84c
Avoid duplicate flymake checkers when using flymake-flycheck
purcell Aug 10, 2023
6163387
When we have clojure-ts-mode, prefer clojurescript-ts-mode too
purcell Aug 11, 2023
e4df223
Add flymake-actionlint
purcell Aug 11, 2023
4bc86df
Remove defunct local patch for dash-at-point
purcell Aug 11, 2023
d71e9be
Add corfu-terminal-mode
purcell Aug 11, 2023
2f49e47
Properly enable paredit in lispy modes: had been unintentionally broken
purcell Aug 11, 2023
5f8d650
Enable pixel-scroll-precision-mode if available
purcell Aug 13, 2023
86befb5
No subword-mode in clojure-mode
purcell Aug 13, 2023
8d3ccb2
Remove misleading lists of lispy-modes
purcell Aug 13, 2023
1fe8f0d
Soft-fail when corfu-terminal is uninstallable, e.g. in Emacs 27
purcell Aug 14, 2023
7b174a5
Be more cautious before loading treesitter config
purcell Aug 16, 2023
4291138
Remove defunct references to init-*.el files
purcell Aug 17, 2023
aa0d9d9
Use nix-ts-mode, drop unused nix-related packages, tidy up treesitter…
purcell Aug 21, 2023
97f5438
Set up xref-js2 in all the JS modes
purcell Aug 23, 2023
b6e5c6c
Fix mistake in prior commit
purcell Aug 23, 2023
ba42e33
Use add-hook for eldoc-documentation-functions
purcell Aug 26, 2023
bc039c5
Suppress flycheck backend for shellcheck: we have a flymake equivalent
purcell Aug 26, 2023
1a0ca90
Enable slime-autodoc, remove slime load-path hacks
purcell Aug 26, 2023
ef94ad7
Move lua config to its own init-lua.el
purcell Aug 26, 2023
9eacae9
Use rename-visited-file instead of rename-this-file-and-buffer when a…
purcell Aug 26, 2023
2e29e5f
chore(deps): bump actions/checkout from 3 to 4
dependabot[bot] Sep 5, 2023
aae26a2
Merge pull request #851 from purcell/dependabot/github_actions/action…
purcell Sep 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
commit-message:
prefix: "chore"
include: "scope"
18 changes: 8 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,27 @@ on:

jobs:
build:
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
emacs_version:
- 25.1
- 25.2
- 25.3
- 26.1
- 26.2
- 26.3
- 27.1
- 27.2
- snapshot
- 28.1
- 29.1
experimental: [false]
include:
- os: macos-latest
emacs_version: 27.2
- emacs_version: snapshot
experimental: true
steps:
- uses: purcell/setup-emacs@master
with:
version: ${{ matrix.emacs_version }}

- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Check startup
run: ./test-startup.sh
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ CVS
cookies
/newsticker
\#*
/tree-sitter
/elpa
/elpa-*
site-lisp/package/
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ in the approximate order of how much I use them, from most to least:
* Erlang

In particular, there's a nice config for *autocompletion* with
[company](https://company-mode.github.io/), and
[corfu](https://github.com/minad/corfu), and
`flymake` (re-using backends from [flycheck](http://www.flycheck.org))
is used to immediately highlight syntax errors in Ruby, Python,
Javascript, Haskell and a number of other languages.
Expand All @@ -36,11 +36,12 @@ LSP support is provided using `eglot`.

## Supported Emacs versions

The config should run on Emacs 25.1 or greater and is designed to
degrade smoothly - see the CI build - but note that much newer
versions are required for an increasing number of key packages, so to
get full functionality you should use the latest Emacs version
available to you.
Use the latest released Emacs version available to you. The author
typically uses the latest stable version.

The config should run on Emacs 26.1 or greater and is designed to
degrade smoothly - see the CI build - but even basic enhancements
like completion may be unavailable if your Emacs is too old.

Some Windows users might need to follow
[these instructions](http://xn--9dbdkw.se/diary/how_to_enable_GnuTLS_for_Emacs_24_on_Windows/index.en.html)
Expand Down
16 changes: 10 additions & 6 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
;; Produce backtraces when errors occur: can be helpful to diagnose startup issues
;;(setq debug-on-error t)

(let ((minver "25.1"))
(let ((minver "26.1"))
(when (version< emacs-version minver)
(error "Your Emacs is too old -- this config requires v%s or higher" minver)))
(when (version< emacs-version "26.1")
(when (version< emacs-version "27.1")
(message "Your Emacs is old, and some functionality in this config will be disabled. Please upgrade if possible."))

(add-to-list 'load-path (expand-file-name "lisp" user-emacs-directory))
Expand Down Expand Up @@ -66,7 +66,7 @@
(require 'init-recentf)
(require 'init-minibuffer)
(require 'init-hippie-expand)
(require 'init-company)
(require 'init-corfu)
(require 'init-windows)
(require 'init-sessions)
(require 'init-mmm)
Expand Down Expand Up @@ -128,14 +128,13 @@
(require 'init-folding)
(require 'init-dash)

;;(require 'init-twitter)
;; (require 'init-mu)
(require 'init-ledger)
(require 'init-lua)

;; Extra packages which don't require any configuration

(require-package 'sudo-edit)
(require-package 'gnuplot)
(require-package 'lua-mode)
(require-package 'htmlize)
(when *is-a-mac*
(require-package 'osx-location))
Expand All @@ -151,6 +150,11 @@

(require 'init-direnv)

(when (and (require 'treesit nil t)
(fboundp 'treesit-available-p)
(treesit-available-p))
(require 'init-treesitter))



;; Allow access from emacsclient
Expand Down
7 changes: 4 additions & 3 deletions lisp/init-clojure.el
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

;; See also init-clojure-cider.el

(when (maybe-require-package 'clojure-mode)
(when (or (maybe-require-package 'clojure-ts-mode)
(maybe-require-package 'clojure-mode))
(require-package 'cljsbuild-mode)
(require-package 'elein)

(with-eval-after-load 'clojure-mode
(add-hook 'clojure-mode-hook 'sanityinc/lisp-setup)
(add-hook 'clojure-mode-hook 'subword-mode)))
(dolist (m '(clojure-mode-hook clojure-ts-mode-hook))
(add-hook m 'sanityinc/lisp-setup))))


(provide 'init-clojure)
Expand Down
31 changes: 0 additions & 31 deletions lisp/init-company.el

This file was deleted.

39 changes: 39 additions & 0 deletions lisp/init-corfu.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
;;; init-corfu.el --- Interactive completion in buffers -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:

;; WAITING: haskell-mode sets tags-table-list globally, breaks tags-completion-at-point-function
;; TODO Default sort order should place [a-z] before punctuation

(setq tab-always-indent 'complete)
(when (maybe-require-package 'orderless)
(with-eval-after-load 'vertico
(require 'orderless)
(setq completion-styles '(orderless basic))))
(setq completion-category-defaults nil
completion-category-overrides nil)
(setq completion-cycle-threshold 4)

(when (maybe-require-package 'corfu)
(setq-default corfu-auto t)
(with-eval-after-load 'eshell
(add-hook 'eshell-mode-hook (lambda () (setq-local corfu-auto nil))))
(setq-default corfu-quit-no-match 'separator)
(add-hook 'after-init-hook 'global-corfu-mode)



(with-eval-after-load 'corfu
(corfu-popupinfo-mode))

;; Make Corfu also work in terminals, without disturbing usual behaviour in GUI
(when (maybe-require-package 'corfu-terminal)
(with-eval-after-load 'corfu
(corfu-terminal-mode)))

;; TODO: https://github.com/jdtsmith/kind-icon
)


(provide 'init-corfu)
;;; init-corfu.el ends here
7 changes: 3 additions & 4 deletions lisp/init-csv.el
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
;;; Commentary:
;;; Code:

(require-package 'csv-mode)
(when (maybe-require-package 'csv-mode)
(add-auto-mode 'csv-mode "\\.[Cc][Ss][Vv]\\'")

(add-auto-mode 'csv-mode "\\.[Cc][Ss][Vv]\\'")

(setq csv-separators '("," ";" "|" " "))
(setq csv-separators '("," ";" "|" " ")))

(provide 'init-csv)
;;; init-csv.el ends here
13 changes: 4 additions & 9 deletions lisp/init-editing-utils.el
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,10 @@
(require-package 'mode-line-bell)
(add-hook 'after-init-hook 'mode-line-bell-mode)



(when (maybe-require-package 'beacon)
(setq-default beacon-lighter "")
(setq-default beacon-size 20)
(add-hook 'after-init-hook 'beacon-mode))



;;; Newline behaviour
;;; Newline behaviour (see also electric-indent-mode, enabled above)

(global-set-key (kbd "RET") 'newline-and-indent)
(defun sanityinc/newline-at-end-of-line ()
"Move to end of line, enter a newline, and reindent."
(interactive)
Expand Down Expand Up @@ -152,6 +144,9 @@

;;; Handy key bindings

(with-eval-after-load 'help
(define-key help-map "A" 'describe-face))

(global-set-key (kbd "C-.") 'set-mark-command)
(global-set-key (kbd "C-x C-.") 'pop-global-mark)

Expand Down
18 changes: 12 additions & 6 deletions lisp/init-flymake.el
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,33 @@
(when (maybe-require-package 'flymake-flycheck)
;; Disable flycheck checkers for which we have flymake equivalents
(with-eval-after-load 'flycheck
(setq-default flycheck-disabled-checkers
(append (default-value 'flycheck-disabled-checkers)
'(emacs-lisp emacs-lisp-checkdoc emacs-lisp-package))))
(setq-default
flycheck-disabled-checkers
(append (default-value 'flycheck-disabled-checkers)
'(emacs-lisp emacs-lisp-checkdoc emacs-lisp-package sh-shellcheck))))

(defun sanityinc/enable-flymake-flycheck ()
(setq-local flymake-diagnostic-functions
(append flymake-diagnostic-functions
(flymake-flycheck-all-chained-diagnostic-functions))))
(seq-uniq (append flymake-diagnostic-functions
(flymake-flycheck-all-chained-diagnostic-functions)))))

(add-hook 'flymake-mode-hook 'sanityinc/enable-flymake-flycheck)
(add-hook 'prog-mode-hook 'flymake-mode)
(add-hook 'text-mode-hook 'flymake-mode))

(with-eval-after-load 'flymake
;; Provide some flycheck-like bindings in flymake mode to ease transition
(define-key flymake-mode-map (kbd "C-c ! l") 'flymake-show-buffer-diagnostics)
(define-key flymake-mode-map (kbd "C-c ! n") 'flymake-goto-next-error)
(define-key flymake-mode-map (kbd "C-c ! p") 'flymake-goto-prev-error)
(define-key flymake-mode-map (kbd "C-c ! c") 'flymake-start))

(unless (version< emacs-version "28.1")
(setq eldoc-documentation-function 'eldoc-documentation-compose))
(setq eldoc-documentation-function 'eldoc-documentation-compose)

(add-hook 'flymake-mode-hook
(lambda ()
(add-hook 'eldoc-documentation-functions 'flymake-eldoc-function nil t))))

(provide 'init-flymake)
;;; init-flymake.el ends here
2 changes: 1 addition & 1 deletion lisp/init-git.el
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
(require-package 'git-link)

(when (maybe-require-package 'magit)
(setq-default magit-diff-refine-hunk t)
(setq-default magit-diff-refine-hunk 'all)

;; Hint: customize `magit-repository-directories' so that you can use C-u M-F12 to
;; quickly open magit on any one of your projects.
Expand Down
3 changes: 3 additions & 0 deletions lisp/init-github.el
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@
(maybe-require-package 'forge)
(maybe-require-package 'github-review)

(when (maybe-require-package 'flymake-actionlint)
(add-hook 'yaml-mode-hook 'flymake-actionlint-action-load-when-actions-file))

(provide 'init-github)
;;; init-github.el ends here
4 changes: 4 additions & 0 deletions lisp/init-gui-frames.el
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@

(require-package 'disable-mouse)


(when (fboundp 'pixel-scroll-precision-mode)
(pixel-scroll-precision-mode))


(provide 'init-gui-frames)
;;; init-gui-frames.el ends here
14 changes: 8 additions & 6 deletions lisp/init-javascript.el
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,21 @@
(sanityinc/major-mode-lighter 'js2-jsx-mode "JSX2"))



(require 'derived)
(when (and (or (executable-find "rg") (executable-find "ag"))
(maybe-require-package 'xref-js2))
(when (executable-find "rg")
(setq-default xref-js2-search-program 'rg))

(defun sanityinc/enable-xref-js2 ()
(add-hook 'xref-backend-functions #'xref-js2-xref-backend nil t))
(with-eval-after-load 'js
(define-key js-mode-map (kbd "M-.") nil)
(add-hook 'js-mode-hook 'sanityinc/enable-xref-js2))

(let ((base-mode (if (fboundp 'js-base-mode) 'js-base-mode 'js-mode)))
(with-eval-after-load 'js
(add-hook (derived-mode-hook-name base-mode) 'sanityinc/enable-xref-js2)
(define-key js-mode-map (kbd "M-.") nil)))
(with-eval-after-load 'js2-mode
(define-key js2-mode-map (kbd "M-.") nil)
(add-hook 'js2-mode-hook 'sanityinc/enable-xref-js2)))
(define-key js2-mode-map (kbd "M-.") nil)))



Expand Down
3 changes: 2 additions & 1 deletion lisp/init-ledger.el
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
(define-key ledger-mode-map (kbd "C-o") 'open-line))

(setq ledger-highlight-xact-under-point nil
ledger-use-iso-dates nil)
ledger-use-iso-dates nil
ledger-mode-should-check-version nil)

(with-eval-after-load 'ledger-mode
(when (memq window-system '(mac ns))
Expand Down
Loading
Loading