Bump :lang scheme
emacs-geiser/chez@4cb7f26 -> emacs-geiser/chez@03da1c1 emacs-geiser/chibi@54e7f38 -> emacs-geiser/chibi@6f59291 emacs-geiser/chicken@47be5b4 -> emacs-geiser/chicken@ceab39c emacs-geiser/gambit@0ee4156 -> emacs-geiser/gambit@3294c94 emacs-geiser/geiser@c5a9aae -> emacs-geiser/geiser@2b45bd3 emacs-geiser/guile@93ef710 -> emacs-geiser/guile@700ac98 emacs-geiser/racket@a87fd44 -> emacs-geiser/racket@22e56ce Also includes minor refactors.
This commit is contained in:
parent
1d155d0c2f
commit
cb4782b190
3 changed files with 24 additions and 25 deletions
|
@ -1,31 +1,30 @@
|
|||
;;; lang/scheme/autoload.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; HACK geiser-* plugins will try to add to these two variables, so it must be
|
||||
;; defined before their autoloads are evaluated. Fortunately, Doom modules'
|
||||
;; autoloads run earlier than package autoloads.
|
||||
;; TODO PR this upstream
|
||||
;; HACK `geiser' has poor autoload ettiquette. It calls
|
||||
;; `geiser-activate-implementation' and `geiser-implementation-extension'
|
||||
;; in their autoloads files. Sure, these functions are autoloaded, but this
|
||||
;; needlessly (and unavoidably) pulls in the `geiser-impl' package (et co)
|
||||
;; when geiser-X's autoloads are read (i.e. at startup).
|
||||
;;
|
||||
;; I rectify this by inlining calls to these two functions (and the
|
||||
;; `geiser-impl--add-to-alist' sub-call in
|
||||
;; `geiser-implementation-extension'), and autoloading the two variables
|
||||
;; they operate on. I do this from our autoloads file (which is read right
|
||||
;; before package autoloads are).
|
||||
;; TODO At some point, PR this behavior upstream (but not verbatim!)
|
||||
;;;###autoload (defvar geiser-active-implementations ())
|
||||
;;;###autoload (defvar geiser-implementations-alist ())
|
||||
|
||||
;; HACK `geiser-impl--add-to-alist' is autoloaded, but not inlined. This means
|
||||
;; `geiser-impl' is needlessly pulled in immediately at startup when
|
||||
;; geiser-X's autoloads are loaded. Since Doom byte-compiles its autoloads
|
||||
;; file we can avoid this by forcibly inlining the function (by redefining
|
||||
;; it with `defsubst').
|
||||
;; TODO PR this upstream
|
||||
;;;###autoload
|
||||
(defsubst geiser-impl--add-to-alist (kind what impl &optional append)
|
||||
(add-to-list 'geiser-implementations-alist (list (list kind what) impl) append))
|
||||
;;;###autoload (eval-and-compile (dolist (sym '(geiser-impl--add-to-alist geiser-activate-implementation geiser-implementation-extension)) (put sym 'byte-optimizer 'byte-compile-inline-expand)))
|
||||
|
||||
|
||||
(defvar calculate-lisp-indent-last-sexp)
|
||||
;; Adapted from https://github.com/alezost/emacs-config/blob/master/utils/al-scheme.el#L76-L123
|
||||
;;;###autoload
|
||||
(defun +scheme-scheme-indent-function-a (indent-point state)
|
||||
(defun +scheme-indent-function-a (indent-point state)
|
||||
"Advice to replace `scheme-indent-function'.
|
||||
|
||||
This function is the same as `scheme-indent-function' except it indents property
|
||||
lists properly and names starting with 'default'."
|
||||
This function is the same as `scheme-indent-function' except it properly indents
|
||||
property lists and names starting with 'default'."
|
||||
(let ((normal-indent (current-column)))
|
||||
(goto-char (1+ (elt state 1)))
|
||||
(parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue