Commit 18d2c95943fa

Vincent Demeester <vincent@sbr.pm>
2022-10-07 17:20:00
tools/emacs: add some autoload comments
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 703b086
tools/emacs/config/config-editing.el
@@ -2,6 +2,7 @@
 ;;; Commentary:
 ;;; Editing configuration
 ;;; Code:
+
 (setq-default enable-remote-dir-locals t)
 
 ;; When finding file in non-existing directory, offer to create the
tools/emacs/config/programming-nix.el
@@ -5,13 +5,7 @@
 (use-package nix-mode
   :if *nix*
   :after (lsp)
-  :mode ("\\.nix\\'" "\\.nix.in\\'")
-  :config
-  (add-to-list 'lsp-language-id-configuration '(nix-mode . "nix"))
-  (lsp-register-client
-   (make-lsp-client :new-connection (lsp-stdio-connection '("rnix-lsp"))
-                    :major-modes '(nix-mode)
-                    :server-id 'nix)))
+  :mode ("\\.nix\\'" "\\.nix.in\\'"))
 
 (use-package nix-drv-mode
   :if *nix*
tools/emacs/lisp/init-func.el
@@ -1,18 +1,21 @@
 ;;; init-func.el --- -*- lexical-binding: t -*-
 ;;
 
+;;;###autoload
 (defun vde/el-load-dir (dir)
   "Load el files from the given folder `DIR'."
   (let ((files (directory-files dir nil "\.el$")))
     (while files
       (load-file (concat dir (pop files))))))
 
+;;;###autoload
 (defun vde/short-hostname ()
   "Return hostname in short (aka wakasu.local -> wakasu)."
   (string-match "[0-9A-Za-z-]+" system-name)
   (substring system-name (match-beginning 0) (match-end 0)))
 
 ;; https://endlessparentheses.com/updating-org-mode-include-statements-on-the-fly.html
+;;;###autoload
 (defun save-and-update-includes ()
   "Update the line numbers of #+INCLUDE:s in current buffer.
 Only looks at INCLUDEs that have either :range-begin or :range-end.
tools/emacs/init.el
@@ -10,6 +10,8 @@
   (message "Early init: Emacs Version < 27.0")
   (load (expand-file-name "early-init.el" user-emacs-directory)))
 
+(add-to-list 'load-path (concat user-emacs-directory "/lisp/"))
+
 (setq inhibit-default-init t)           ; Disable the site default settings
 
 (setq inhibit-startup-message t
@@ -136,7 +138,6 @@
   (not *sys/full*)
   "Is it a light system ?")
 
-(add-to-list 'load-path (concat user-emacs-directory "/lisp/"))
 (vde/el-load-dir (concat user-emacs-directory "/config/"))
 
 (if (file-exists-p (downcase (concat user-emacs-directory "/hosts/" (vde/short-hostname) ".el")))