Skip to content

Commit

Permalink
Touch up recently added functions
Browse files Browse the repository at this point in the history
  • Loading branch information
bbatsov committed Oct 30, 2022
1 parent bf1b7b1 commit d4d5b2b
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions projectile.el
Original file line number Diff line number Diff line change
Expand Up @@ -2427,27 +2427,23 @@ With a prefix arg INVALIDATE-CACHE invalidates the cache first."
(defun projectile-add-dir-local-variable (mode variable value)
"Run `add-dir-local-variable' with .dir-locals.el in root of project.

Parameters MODE VARIABLE VALUE are passed directly to `add-dir-local-variable'"
Parameters MODE VARIABLE VALUE are passed directly to `add-dir-local-variable'."
(let ((inhibit-read-only t)
(default-directory (projectile-project-root)))
(unless default-directory
(error "Setting dir-local variable in non-existing projectile project was requested"))
(default-directory (projectile-acquire-root)))
(add-dir-local-variable mode variable value)
(save-buffer)
(kill-buffer) ))
(kill-buffer)))

;;;###autoload
(defun projectile-delete-dir-local-variable (mode variable)
"Run `delete-dir-local-variable' with .dir-locals.el in root of project.

Parameters MODE VARIABLE VALUE are passed directly to `delete-dir-local-variable'"
Parameters MODE VARIABLE VALUE are passed directly to `delete-dir-local-variable'."
(let ((inhibit-read-only t)
(default-directory (projectile-project-root)))
(unless default-directory
(error "Setting dir-local variable in non-existing projectile project was requested"))
(default-directory (projectile-acquire-root)))
(delete-dir-local-variable mode variable)
(save-buffer)
(kill-buffer) ))
(kill-buffer)))


;;;; Sorting project files
Expand Down

0 comments on commit d4d5b2b

Please sign in to comment.