Now that we are loading package autoloads files (as part of the generated doom-package-autoload-file when running make autoloads), many :commands properties are redundant. In fact, many def-package! blocks are redundant. In some cases, we can do without a config.el file entirely, and can move into the autoloads file or rely entirely on package autoloads. Also, many settings have been moved in their module's autoloads files, which makes them available ASAP; their use no longer depends on module load order. This gained me a modest ~10% boost in startup speed.
36 lines
936 B
EmacsLisp
36 lines
936 B
EmacsLisp
;;; tools/ein/autoload.el -*- lexical-binding: t; -*-
|
|
|
|
;;;###autoload
|
|
(def-setting! :ein-notebook-dir (dir)
|
|
"Set the default directory from where to open Jupyter notebooks."
|
|
`(setq ein:jupyter-default-notebook-directory ,dir))
|
|
|
|
|
|
;;
|
|
;; Library
|
|
;;
|
|
|
|
(defun +ein--collect-ein-buffer-links ()
|
|
(let ((end (window-end))
|
|
points)
|
|
(save-excursion
|
|
(goto-char (window-start))
|
|
(while (re-search-forward "~?/.+\\|\s\\[" end t)
|
|
(push (+ (match-beginning 0) 1) points))
|
|
(nreverse points))))
|
|
|
|
;;;###autoload
|
|
(defun +ein/ace-link-ein ()
|
|
"Ace jump to links in ein notebooklist."
|
|
(interactive)
|
|
(require 'avy)
|
|
(let ((res (avy-with +ein/ace-link-ein
|
|
(avy--process
|
|
(+ein--collect-ein-buffer-links)
|
|
#'avy--overlay-pre))))
|
|
;(avy--style-fn avy-style)))))
|
|
(when (numberp res)
|
|
(goto-char (1+ res))
|
|
(widget-button-press (point)))))
|
|
|
|
|