.dir-locals.el 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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'.
  7. (bug-reference-url-format . "http://bugs.gnu.org/%s")
  8. (bug-reference-bug-regexp
  9. . "<https?://\\(debbugs\\|bugs\\)\\.gnu\\.org/\\([0-9]+\\)>")
  10. ;; Emacs-Guix
  11. (eval . (setq-local guix-directory
  12. (locate-dominating-file default-directory
  13. ".dir-locals.el")))
  14. ;; Geiser
  15. ;; This allows automatically setting the `geiser-guile-load-path'
  16. ;; variable when using various Guix checkouts (e.g., via git worktrees).
  17. (eval . (let ((root-dir-unexpanded (locate-dominating-file
  18. default-directory ".dir-locals.el")))
  19. ;; While Guix should in theory always have a .dir-locals.el
  20. ;; (we are reading this file, after all) there seems to be a
  21. ;; strange problem where this code "escapes" to some other buffers,
  22. ;; at least vc-mode. See:
  23. ;; https://lists.gnu.org/archive/html/guix-devel/2020-11/msg00296.html
  24. ;; Upstream report: <https://bugs.gnu.org/44698>
  25. ;; Hence the following "when", which might otherwise be unnecessary;
  26. ;; it prevents causing an error when root-dir-unexpanded is nil.
  27. (when root-dir-unexpanded
  28. (let* ((root-dir (expand-file-name root-dir-unexpanded))
  29. ;; Workaround for bug https://issues.guix.gnu.org/43818.
  30. (root-dir* (directory-file-name root-dir)))
  31. (unless (boundp 'geiser-guile-load-path)
  32. (defvar geiser-guile-load-path '()))
  33. (make-local-variable 'geiser-guile-load-path)
  34. (require 'cl-lib)
  35. (cl-pushnew root-dir* geiser-guile-load-path
  36. :test #'string-equal)))))))
  37. (c-mode . ((c-file-style . "gnu")))
  38. (scheme-mode
  39. .
  40. ((indent-tabs-mode . nil)
  41. (eval . (put 'eval-when 'scheme-indent-function 1))
  42. (eval . (put 'call-with-prompt 'scheme-indent-function 1))
  43. (eval . (put 'test-assert 'scheme-indent-function 1))
  44. (eval . (put 'test-assertm 'scheme-indent-function 1))
  45. (eval . (put 'test-equalm 'scheme-indent-function 1))
  46. (eval . (put 'test-equal 'scheme-indent-function 1))
  47. (eval . (put 'test-eq 'scheme-indent-function 1))
  48. (eval . (put 'call-with-input-string 'scheme-indent-function 1))
  49. (eval . (put 'guard 'scheme-indent-function 1))
  50. (eval . (put 'lambda* 'scheme-indent-function 1))
  51. (eval . (put 'substitute* 'scheme-indent-function 1))
  52. (eval . (put 'match-record 'scheme-indent-function 2))
  53. ;; 'modify-phases' and its keywords.
  54. (eval . (put 'modify-phases 'scheme-indent-function 1))
  55. (eval . (put 'replace 'scheme-indent-function 1))
  56. (eval . (put 'add-before 'scheme-indent-function 2))
  57. (eval . (put 'add-after 'scheme-indent-function 2))
  58. (eval . (put 'modify-services 'scheme-indent-function 1))
  59. (eval . (put 'with-directory-excursion 'scheme-indent-function 1))
  60. (eval . (put 'with-file-lock 'scheme-indent-function 1))
  61. (eval . (put 'with-file-lock/no-wait 'scheme-indent-function 1))
  62. (eval . (put 'with-profile-lock 'scheme-indent-function 1))
  63. (eval . (put 'with-writable-file 'scheme-indent-function 2))
  64. (eval . (put 'package 'scheme-indent-function 0))
  65. (eval . (put 'package/inherit 'scheme-indent-function 1))
  66. (eval . (put 'origin 'scheme-indent-function 0))
  67. (eval . (put 'build-system 'scheme-indent-function 0))
  68. (eval . (put 'bag 'scheme-indent-function 0))
  69. (eval . (put 'graft 'scheme-indent-function 0))
  70. (eval . (put 'operating-system 'scheme-indent-function 0))
  71. (eval . (put 'file-system 'scheme-indent-function 0))
  72. (eval . (put 'manifest-entry 'scheme-indent-function 0))
  73. (eval . (put 'manifest-pattern 'scheme-indent-function 0))
  74. (eval . (put 'substitute-keyword-arguments 'scheme-indent-function 1))
  75. (eval . (put 'with-store 'scheme-indent-function 1))
  76. (eval . (put 'with-external-store 'scheme-indent-function 1))
  77. (eval . (put 'with-error-handling 'scheme-indent-function 0))
  78. (eval . (put 'with-mutex 'scheme-indent-function 1))
  79. (eval . (put 'with-atomic-file-output 'scheme-indent-function 1))
  80. (eval . (put 'call-with-compressed-output-port 'scheme-indent-function 2))
  81. (eval . (put 'call-with-decompressed-port 'scheme-indent-function 2))
  82. (eval . (put 'call-with-gzip-input-port 'scheme-indent-function 1))
  83. (eval . (put 'call-with-gzip-output-port 'scheme-indent-function 1))
  84. (eval . (put 'call-with-lzip-input-port 'scheme-indent-function 1))
  85. (eval . (put 'call-with-lzip-output-port 'scheme-indent-function 1))
  86. (eval . (put 'signature-case 'scheme-indent-function 1))
  87. (eval . (put 'emacs-batch-eval 'scheme-indent-function 0))
  88. (eval . (put 'emacs-batch-edit-file 'scheme-indent-function 1))
  89. (eval . (put 'emacs-substitute-sexps 'scheme-indent-function 1))
  90. (eval . (put 'emacs-substitute-variables 'scheme-indent-function 1))
  91. (eval . (put 'with-derivation-narinfo 'scheme-indent-function 1))
  92. (eval . (put 'with-derivation-substitute 'scheme-indent-function 2))
  93. (eval . (put 'with-status-report 'scheme-indent-function 1))
  94. (eval . (put 'with-status-verbosity 'scheme-indent-function 1))
  95. (eval . (put 'with-build-handler 'scheme-indent-function 1))
  96. (eval . (put 'mlambda 'scheme-indent-function 1))
  97. (eval . (put 'mlambdaq 'scheme-indent-function 1))
  98. (eval . (put 'syntax-parameterize 'scheme-indent-function 1))
  99. (eval . (put 'with-monad 'scheme-indent-function 1))
  100. (eval . (put 'mbegin 'scheme-indent-function 1))
  101. (eval . (put 'mwhen 'scheme-indent-function 1))
  102. (eval . (put 'munless 'scheme-indent-function 1))
  103. (eval . (put 'mlet* 'scheme-indent-function 2))
  104. (eval . (put 'mlet 'scheme-indent-function 2))
  105. (eval . (put 'run-with-store 'scheme-indent-function 1))
  106. (eval . (put 'run-with-state 'scheme-indent-function 1))
  107. (eval . (put 'wrap-program 'scheme-indent-function 1))
  108. (eval . (put 'with-imported-modules 'scheme-indent-function 1))
  109. (eval . (put 'with-extensions 'scheme-indent-function 1))
  110. (eval . (put 'with-parameters 'scheme-indent-function 1))
  111. (eval . (put 'let-system 'scheme-indent-function 1))
  112. (eval . (put 'with-build-variables 'scheme-indent-function 2))
  113. (eval . (put 'with-database 'scheme-indent-function 2))
  114. (eval . (put 'call-with-database 'scheme-indent-function 1))
  115. (eval . (put 'call-with-transaction 'scheme-indent-function 1))
  116. (eval . (put 'with-statement 'scheme-indent-function 3))
  117. (eval . (put 'call-with-retrying-transaction 'scheme-indent-function 1))
  118. (eval . (put 'call-with-savepoint 'scheme-indent-function 1))
  119. (eval . (put 'call-with-retrying-savepoint 'scheme-indent-function 1))
  120. (eval . (put 'call-with-container 'scheme-indent-function 1))
  121. (eval . (put 'container-excursion 'scheme-indent-function 1))
  122. (eval . (put 'eventually 'scheme-indent-function 1))
  123. (eval . (put 'call-with-progress-reporter 'scheme-indent-function 1))
  124. (eval . (put 'with-repository 'scheme-indent-function 2))
  125. (eval . (put 'with-temporary-git-repository 'scheme-indent-function 2))
  126. (eval . (put 'with-environment-variables 'scheme-indent-function 1))
  127. (eval . (put 'with-fresh-gnupg-setup 'scheme-indent-function 1))
  128. (eval . (put 'with-paginated-output-port 'scheme-indent-function 1))
  129. ;; This notably allows '(' in Paredit to not insert a space when the
  130. ;; preceding symbol is one of these.
  131. (eval . (modify-syntax-entry ?~ "'"))
  132. (eval . (modify-syntax-entry ?$ "'"))
  133. (eval . (modify-syntax-entry ?+ "'"))))
  134. (emacs-lisp-mode . ((indent-tabs-mode . nil)))
  135. (texinfo-mode . ((indent-tabs-mode . nil)
  136. (fill-column . 72))))