Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emacs-lisp code for deleting whitespaces on save #588

Merged
merged 3 commits into from
Sep 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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