feat(functions): Add function to toggle final-newline behaviour
This commit is contained in:
parent
4dce87d1e2
commit
f93f03661b
1 changed files with 8 additions and 0 deletions
|
@ -126,4 +126,12 @@ Including indent-buffer, which should not be called automatically on save."
|
|||
(let ((derivation (read-string "Derivation name (in <nixos>): ")))
|
||||
(insert (nix-store-path derivation))))
|
||||
|
||||
(defun toggle-force-newline ()
|
||||
"Buffer-local toggle for enforcing final newline on save."
|
||||
(interactive)
|
||||
(setq-local require-final-newline (not require-final-newline))
|
||||
(message "require-final-newline in buffer %s is now %s"
|
||||
(buffer-name)
|
||||
require-final-newline))
|
||||
|
||||
(provide 'functions)
|
||||
|
|
Loading…
Reference in a new issue