Skip to content

Commit

Permalink
Merge pull request #588 from felixwellen/auto-delete-whitespaces
Browse files Browse the repository at this point in the history
Emacs-lisp code for deleting whitespaces on save
  • Loading branch information
ecavallo committed Sep 20, 2021
2 parents 77fbf78 + 5912167 commit 11ccf57
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,16 @@ When preparing a PR here are some general guidelines:
editing files by adding `(setq-default show-trailing-whitespace t)`
to `~/.emacs`. The command `M-x delete-trailing-whitespace` is also
very useful. It is possible to add a hook that runs this command
automatically when saving Agda files.
automatically when saving Agda files, by adding the following to your
`~/.emacs`:
```
;; delete trailing whitespace before saving in agda-mode
(defun agda-mode-delete-whitespace-before-save ()
(when (eq major-mode 'agda2-mode)
(delete-trailing-whitespace)))
(add-hook 'before-save-hook #'agda-mode-delete-whitespace-before-save)
```

- Use copattern-matching when instantiating records for efficiency.
This seems especially important when constructing Iso's.
Expand Down

0 comments on commit 11ccf57

Please sign in to comment.