Fix read-only errors in magit rebase buffers
Magit would refuse to abort/commit rebases due to delete-trailing-whitespace in write-file-functions, placed there by editorconfig.
This commit is contained in:
parent
156d717042
commit
6014a416b3
1 changed files with 7 additions and 0 deletions
|
@ -55,5 +55,12 @@ extension, try to guess one."
|
|||
(delq (assq mode editorconfig-indentation-alist)
|
||||
editorconfig-indentation-alist))
|
||||
|
||||
(defun +editorconfig|disable-trim-whitespace-in-read-only-buffers (props)
|
||||
"`delete-trailing-whitespace' can cause disruptive read-only errors. Prevent
|
||||
it from being added to read-only buffers."
|
||||
(when (and buffer-read-only (gethash 'trim_trailing_whitespace props))
|
||||
(remove-hook 'write-file-functions #'delete-trailing-whitespace :local)))
|
||||
(add-hook 'editorconfig-custom-hooks #'+editorconfig|disable-trim-whitespace-in-read-only-buffers)
|
||||
|
||||
;;
|
||||
(editorconfig-mode +1))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue