Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
alisonjoe committed Sep 23, 2023
2 parents 685d495 + a76dfe3 commit bb177c7
Show file tree
Hide file tree
Showing 30 changed files with 249 additions and 166 deletions.
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
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 @@ -64,18 +64,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 @@ -153,6 +145,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
22 changes: 3 additions & 19 deletions lisp/init-lisp.el
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
(add-hook 'after-init-hook 'ipretty-mode))


(defun sanityinc/make-read-only (expression out-buffer-name)
(defun sanityinc/make-read-only (_expression out-buffer-name &rest _)
"Enable `view-mode' in the output buffer - if any - so it can be closed with `\"q\"."
(when (get-buffer out-buffer-name)
(with-current-buffer out-buffer-name
Expand Down Expand Up @@ -178,26 +178,10 @@ there is no current file, eval the current buffer."
"Enable features useful in any Lisp mode."
(run-hooks 'sanityinc/lispy-modes-hook))

(defun sanityinc/emacs-lisp-setup ()
"Enable features useful when working with elisp."
(set-up-hippie-expand-for-elisp))

(defconst sanityinc/elispy-modes
'(emacs-lisp-mode ielm-mode)
"Major modes relating to elisp.")

(defconst sanityinc/lispy-modes
(append sanityinc/elispy-modes
'(lisp-mode inferior-lisp-mode lisp-interaction-mode))
"All lispy major modes.")

(require 'derived)

(dolist (hook (mapcar #'derived-mode-hook-name sanityinc/lispy-modes))
(add-hook hook 'sanityinc/lisp-setup))

(dolist (hook (mapcar #'derived-mode-hook-name sanityinc/elispy-modes))
(add-hook hook 'sanityinc/emacs-lisp-setup))
(dolist (mode '(emacs-lisp-mode ielm-mode lisp-mode inferior-lisp-mode lisp-interaction-mode))
(add-hook (derived-mode-hook-name mode) 'sanityinc/lisp-setup))

(when (boundp 'eval-expression-minibuffer-setup-hook)
(add-hook 'eval-expression-minibuffer-setup-hook #'eldoc-mode))
Expand Down
16 changes: 16 additions & 0 deletions lisp/init-lua.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
;;; init-lua.el --- Support for Lua programming -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:

(require-package 'lua-mode)

(setq-default lua-indent-level 2)

(reformatter-define lua-format
:program "lua-format"
:args '("--indent-width=2" "--no-use-tab")
:lighter "LuaFmt ")


(provide 'init-lua)
;;; init-lua.el ends here
Loading

0 comments on commit bb177c7

Please sign in to comment.