Skip to content

Commit e10ff90

Browse files
authored
Move swiftpm-project-settings.el settings to .dir-locals.el (#7314)
Directory-local variables have been moved so that they are set directly in `.dir-locals.el`. ### Motivation: The variables set in `swiftpm-project-settings.el` can be set directly in `dir-locals.el`. There is no reason to move them to a separate file, and in fact doing that will automatically make Emacs flag the dir-locals as unsafe, since it will be being requested to evaluate a block of code, instead of setting known-safe variables. ### Modifications: `Utilities/Emacs/swiftpm-project-settings.el` has been removed. All variables set in it have been moved to `.dir-locals.el` itself. This allows the evaluation of all directory locals to be considered safe. Additionally, `swift-basic-offset` was changed to `swift-mode:basic-offset`. That appears to be the proper variable for setting indent width for Swift in Emacs. ### Result: Emacs users can edit the project more peacefully. Signed-off-by: Julia DeMille <[email protected]>
1 parent 3bcbb67 commit e10ff90

File tree

2 files changed

+3
-25
lines changed

2 files changed

+3
-25
lines changed

.dir-locals.el

+3-17
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,5 @@
1-
;;; Directory Local Variables
1+
;;; Directory Local Variables -*- no-byte-compile: t -*-
22
;;; For more information see (info "(emacs) Directory Variables")
33

4-
5-
((nil
6-
(eval .
7-
;; Auto-load the swiftpm project settings.
8-
(unless (featurep 'swiftpm-project-settings)
9-
(message "loading 'swiftpm-project-settings")
10-
;; Make sure the project's own utils directory is in the load path,
11-
;; but don't override any one the user might have set up.
12-
(add-to-list
13-
'load-path
14-
(concat
15-
(let ((dlff (dir-locals-find-file default-directory)))
16-
(if (listp dlff) (car dlff) (file-name-directory dlff)))
17-
"Utilities/Emacs")
18-
:append)
19-
(require 'swiftpm-project-settings)))))
4+
((nil . ((c-basic-offset . 4)))
5+
(swift-mode . ((swift-mode:basic-offset . 4))))

Utilities/Emacs/swiftpm-project-settings.el

-8
This file was deleted.

0 commit comments

Comments
 (0)