Skip to content
Open
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
19 changes: 19 additions & 0 deletions standardfmt.el
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,25 @@
:type 'string
:group 'standardfmt)

(defun standardfmt-lint ()
"Lint the current buffer with standard/semistandard."
(interactive)
(let ((msgbuf (get-buffer-create "*standardfmt-lint messages*"))
(coding-system-for-read 'utf-8)
(coding-system-for-write 'utf-8))

(save-restriction
(widen)
(with-current-buffer msgbuf (erase-buffer))

(message "Calling standard: %s -"
standardfmt-command)

(if (zerop (call-process-region (point-min) (point-max)
standardfmt-command nil msgbuf t "-"))
(message "Buffer conforms to semistandard")
(message "Buffer doesn't conform to semistandard")))))

(defun standardfmt ()
"Format the current buffer with standard/semistandard."
(interactive)
Expand Down