commit 18d2c95943fa6c5707574dbbd57cbf1f1e1c74d8
parent 703b086e53fd7b3a4eac3029bc588ce1c5c61796
Author: Vincent Demeester <vincent@sbr.pm>
Date: Fri, 7 Oct 2022 17:20:00 +0200
tools/emacs: add some autoload comments
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat:
4 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/tools/emacs/config/config-editing.el b/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
diff --git a/tools/emacs/config/programming-nix.el b/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*
diff --git a/tools/emacs/init.el b/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")))
diff --git a/tools/emacs/lisp/init-func.el b/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.