summaryrefslogtreecommitdiff
path: root/tw/home/files/emacs-init.el
diff options
context:
space:
mode:
Diffstat (limited to 'tw/home/files/emacs-init.el')
-rw-r--r--tw/home/files/emacs-init.el47
1 files changed, 47 insertions, 0 deletions
diff --git a/tw/home/files/emacs-init.el b/tw/home/files/emacs-init.el
index dd9c073a..0bea0e57 100644
--- a/tw/home/files/emacs-init.el
+++ b/tw/home/files/emacs-init.el
@@ -563,4 +563,51 @@
(kbd "<localleader>el") #'eval-last-sexp
(kbd "<localleader>ep") #'eval-print-last-sexp)
+;; Guix-related .dir-locals.el entries. These are fine; don't prompt every time.
+(mapc (apply-partially #'add-to-list 'safe-local-eval-forms)
+ '((modify-syntax-entry 126 "'")
+ (modify-syntax-entry 36 "'")
+ (modify-syntax-entry 43 "'")
+ (progn
+ (require 'lisp-mode)
+ (defun emacs27-lisp-fill-paragraph (&optional justify)
+ (interactive "P")
+ (or (fill-comment-paragraph justify)
+ (let ((paragraph-start
+ (concat paragraph-start "\\|\\s-*\\([(;\"]\\|\\s-:\\|`(\\|#'(\\)"))
+ (paragraph-separate
+ (concat paragraph-separate "\\|\\s-*\".*[,\\.]$"))
+ (fill-column
+ (if (and (integerp emacs-lisp-docstring-fill-column)
+ (derived-mode-p 'emacs-lisp-mode))
+ emacs-lisp-docstring-fill-column
+ fill-column)))
+ (fill-paragraph justify))
+ t))
+ (setq-local fill-paragraph-function #'emacs27-lisp-fill-paragraph))
+
+ ;; Forms used by Guix upstream.
+ (add-to-list 'completion-ignored-extensions ".go")
+ (setq-local guix-directory (locate-dominating-file
+ default-directory ".dir-locals.el"))
+ (with-eval-after-load 'yasnippet
+ (let ((guix-yasnippets (expand-file-name
+ "etc/snippets/yas"
+ (locate-dominating-file
+ default-directory ".dir-locals.el"))))
+ (unless (member guix-yasnippets yas-snippet-dirs)
+ (add-to-list 'yas-snippet-dirs guix-yasnippets)
+ (yas-reload-all))))
+ (let ((root-dir-unexpanded (locate-dominating-file
+ default-directory ".dir-locals.el")))
+ (when root-dir-unexpanded
+ (let* ((root-dir (expand-file-name root-dir-unexpanded))
+ (root-dir* (directory-file-name root-dir)))
+ (unless (boundp 'geiser-guile-load-path)
+ (defvar geiser-guile-load-path 'nil))
+ (make-local-variable 'geiser-guile-load-path)
+ (require 'cl-lib)
+ (cl-pushnew root-dir* geiser-guile-load-path
+ :test #'string-equal))))))
+
;;; init.el ends here