.dir-locals.el 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. ;; Per-directory local variables for GNU Emacs 23 and later.
  2. ((nil
  3. . ((fill-column . 78)
  4. (tab-width . 8)
  5. (sentence-end-double-space . t)
  6. ;; For use with 'bug-reference-prog-mode'. Extra bug-reference
  7. ;; configuration should be done in your Emacs user configuration file;
  8. ;; refer to (info (guix) The Perfect Setup).
  9. (bug-reference-bug-regexp
  10. . "\\(<https?://\\bugs\\.gnu\\.org/\\([0-9]+\\)>\\)")
  11. (bug-reference-url-format . "https://issues.guix.gnu.org/%s")
  12. (eval . (add-to-list 'completion-ignored-extensions ".go"))
  13. ;; Emacs-Guix
  14. (eval . (setq-local guix-directory
  15. (locate-dominating-file default-directory
  16. ".dir-locals.el")))
  17. ;; YASnippet
  18. (eval . (with-eval-after-load
  19. 'yasnippet
  20. (let ((guix-yasnippets
  21. (expand-file-name
  22. "etc/snippets/yas"
  23. (locate-dominating-file default-directory
  24. ".dir-locals.el"))))
  25. (unless (member guix-yasnippets yas-snippet-dirs)
  26. (add-to-list 'yas-snippet-dirs guix-yasnippets)
  27. (yas-reload-all)))))
  28. ;; Geiser
  29. ;; This allows automatically setting the `geiser-guile-load-path'
  30. ;; variable when using various Guix checkouts (e.g., via git worktrees).
  31. (geiser-repl-per-project-p . t)))
  32. (c-mode . ((c-file-style . "gnu")))
  33. (scheme-mode
  34. .
  35. ((indent-tabs-mode . nil)
  36. (eval . (put 'eval-when 'scheme-indent-function 1))
  37. (eval . (put 'call-with-prompt 'scheme-indent-function 1))
  38. (eval . (put 'test-assert 'scheme-indent-function 1))
  39. (eval . (put 'test-assertm 'scheme-indent-function 2))
  40. (eval . (put 'test-equalm 'scheme-indent-function 1))
  41. (eval . (put 'test-equal 'scheme-indent-function 1))
  42. (eval . (put 'test-eq 'scheme-indent-function 1))
  43. (eval . (put 'call-with-input-string 'scheme-indent-function 1))
  44. (eval . (put 'call-with-port 'scheme-indent-function 1))
  45. (eval . (put 'guard 'scheme-indent-function 1))
  46. (eval . (put 'lambda* 'scheme-indent-function 1))
  47. (eval . (put 'substitute* 'scheme-indent-function 1))
  48. (eval . (put 'match-record 'scheme-indent-function 3))
  49. (eval . (put 'match-record-lambda 'scheme-indent-function 2))
  50. ;; TODO: Contribute these to Emacs' scheme-mode.
  51. (eval . (put 'let-keywords 'scheme-indent-function 3))
  52. ;; 'modify-inputs' and its keywords.
  53. (eval . (put 'modify-inputs 'scheme-indent-function 1))
  54. (eval . (put 'replace 'scheme-indent-function 1))
  55. ;; 'modify-phases' and its keywords.
  56. (eval . (put 'modify-phases 'scheme-indent-function 1))
  57. (eval . (put 'replace 'scheme-indent-function 1))
  58. (eval . (put 'add-before 'scheme-indent-function 2))
  59. (eval . (put 'add-after 'scheme-indent-function 2))
  60. (eval . (put 'modify-services 'scheme-indent-function 1))
  61. (eval . (put 'with-directory-excursion 'scheme-indent-function 1))
  62. (eval . (put 'with-file-lock 'scheme-indent-function 1))
  63. (eval . (put 'with-file-lock/no-wait 'scheme-indent-function 1))
  64. (eval . (put 'with-profile-lock 'scheme-indent-function 1))
  65. (eval . (put 'with-writable-file 'scheme-indent-function 2))
  66. (eval . (put 'package 'scheme-indent-function 0))
  67. (eval . (put 'package/inherit 'scheme-indent-function 1))
  68. (eval . (put 'origin 'scheme-indent-function 0))
  69. (eval . (put 'build-system 'scheme-indent-function 0))
  70. (eval . (put 'bag 'scheme-indent-function 0))
  71. (eval . (put 'graft 'scheme-indent-function 0))
  72. (eval . (put 'operating-system 'scheme-indent-function 0))
  73. (eval . (put 'file-system 'scheme-indent-function 0))
  74. (eval . (put 'manifest-entry 'scheme-indent-function 0))
  75. (eval . (put 'manifest-pattern 'scheme-indent-function 0))
  76. (eval . (put 'substitute-keyword-arguments 'scheme-indent-function 1))
  77. (eval . (put 'with-store 'scheme-indent-function 1))
  78. (eval . (put 'with-external-store 'scheme-indent-function 1))
  79. (eval . (put 'with-error-handling 'scheme-indent-function 0))
  80. (eval . (put 'with-mutex 'scheme-indent-function 1))
  81. (eval . (put 'with-atomic-file-output 'scheme-indent-function 1))
  82. (eval . (put 'call-with-compressed-output-port 'scheme-indent-function 2))
  83. (eval . (put 'call-with-decompressed-port 'scheme-indent-function 2))
  84. (eval . (put 'call-with-gzip-input-port 'scheme-indent-function 1))
  85. (eval . (put 'call-with-gzip-output-port 'scheme-indent-function 1))
  86. (eval . (put 'call-with-lzip-input-port 'scheme-indent-function 1))
  87. (eval . (put 'call-with-lzip-output-port 'scheme-indent-function 1))
  88. (eval . (put 'signature-case 'scheme-indent-function 1))
  89. (eval . (put 'emacs-batch-eval 'scheme-indent-function 0))
  90. (eval . (put 'emacs-batch-edit-file 'scheme-indent-function 1))
  91. (eval . (put 'emacs-substitute-sexps 'scheme-indent-function 1))
  92. (eval . (put 'emacs-substitute-variables 'scheme-indent-function 1))
  93. (eval . (put 'with-derivation-narinfo 'scheme-indent-function 1))
  94. (eval . (put 'with-derivation-substitute 'scheme-indent-function 2))
  95. (eval . (put 'with-status-report 'scheme-indent-function 1))
  96. (eval . (put 'with-status-verbosity 'scheme-indent-function 1))
  97. (eval . (put 'with-build-handler 'scheme-indent-function 1))
  98. (eval . (put 'mlambda 'scheme-indent-function 1))
  99. (eval . (put 'mlambdaq 'scheme-indent-function 1))
  100. (eval . (put 'syntax-parameterize 'scheme-indent-function 1))
  101. (eval . (put 'with-monad 'scheme-indent-function 1))
  102. (eval . (put 'mbegin 'scheme-indent-function 1))
  103. (eval . (put 'mwhen 'scheme-indent-function 1))
  104. (eval . (put 'munless 'scheme-indent-function 1))
  105. (eval . (put 'mlet* 'scheme-indent-function 2))
  106. (eval . (put 'mlet 'scheme-indent-function 2))
  107. (eval . (put 'mparameterize 'scheme-indent-function 2))
  108. (eval . (put 'run-with-store 'scheme-indent-function 1))
  109. (eval . (put 'run-with-state 'scheme-indent-function 1))
  110. (eval . (put 'wrap-program 'scheme-indent-function 1))
  111. (eval . (put 'wrap-script 'scheme-indent-function 1))
  112. (eval . (put 'with-imported-modules 'scheme-indent-function 1))
  113. (eval . (put 'with-extensions 'scheme-indent-function 1))
  114. (eval . (put 'with-parameters 'scheme-indent-function 1))
  115. (eval . (put 'let-system 'scheme-indent-function 1))
  116. (eval . (put 'with-build-variables 'scheme-indent-function 2))
  117. (eval . (put 'with-database 'scheme-indent-function 2))
  118. (eval . (put 'call-with-database 'scheme-indent-function 1))
  119. (eval . (put 'call-with-transaction 'scheme-indent-function 1))
  120. (eval . (put 'with-statement 'scheme-indent-function 3))
  121. (eval . (put 'call-with-retrying-transaction 'scheme-indent-function 1))
  122. (eval . (put 'call-with-savepoint 'scheme-indent-function 1))
  123. (eval . (put 'call-with-retrying-savepoint 'scheme-indent-function 1))
  124. (eval . (put 'call-with-container 'scheme-indent-function 1))
  125. (eval . (put 'container-excursion 'scheme-indent-function 1))
  126. (eval . (put 'eventually 'scheme-indent-function 1))
  127. (eval . (put 'call-with-progress-reporter 'scheme-indent-function 1))
  128. (eval . (put 'with-repository 'scheme-indent-function 2))
  129. (eval . (put 'with-temporary-git-repository 'scheme-indent-function 2))
  130. (eval . (put 'with-environment-variables 'scheme-indent-function 1))
  131. (eval . (put 'with-fresh-gnupg-setup 'scheme-indent-function 1))
  132. (eval . (put 'with-paginated-output-port 'scheme-indent-function 1))
  133. (eval . (put 'with-shepherd-action 'scheme-indent-function 3))
  134. (eval . (put 'with-http-server 'scheme-indent-function 1))
  135. ;; This notably allows '(' in Paredit to not insert a space when the
  136. ;; preceding symbol is one of these.
  137. (eval . (modify-syntax-entry ?~ "'"))
  138. (eval . (modify-syntax-entry ?$ "'"))
  139. (eval . (modify-syntax-entry ?+ "'"))
  140. ;; Emacs 28 changed the behavior of 'lisp-fill-paragraph', which causes the
  141. ;; first line of package descriptions to extrude past 'fill-column', and
  142. ;; somehow that is deemed more correct upstream (see:
  143. ;; https://issues.guix.gnu.org/56197).
  144. (eval . (progn
  145. (require 'lisp-mode)
  146. (defun emacs27-lisp-fill-paragraph (&optional justify)
  147. (interactive "P")
  148. (or (fill-comment-paragraph justify)
  149. (let ((paragraph-start
  150. (concat paragraph-start
  151. "\\|\\s-*\\([(;\"]\\|\\s-:\\|`(\\|#'(\\)"))
  152. (paragraph-separate
  153. (concat paragraph-separate "\\|\\s-*\".*[,\\.]$"))
  154. (fill-column (if (and (integerp emacs-lisp-docstring-fill-column)
  155. (derived-mode-p 'emacs-lisp-mode))
  156. emacs-lisp-docstring-fill-column
  157. fill-column)))
  158. (fill-paragraph justify))
  159. ;; Never return nil.
  160. t))
  161. (setq-local fill-paragraph-function #'emacs27-lisp-fill-paragraph)))))
  162. (emacs-lisp-mode . ((indent-tabs-mode . nil)))
  163. (texinfo-mode . ((indent-tabs-mode . nil)
  164. (fill-column . 72))))