mirror of
https://github.com/vale981/ement.el
synced 2025-03-04 08:51:39 -05:00
Meta: Update makem.sh
This commit is contained in:
parent
a441c1f85a
commit
00bf7c02c7
1 changed files with 14 additions and 11 deletions
25
makem.sh
25
makem.sh
|
@ -255,20 +255,23 @@ Exits non-zero if mis-indented lines are found. Checks files in
|
|||
(let ((errors-p))
|
||||
(cl-labels ((lint-file (file)
|
||||
(find-file file)
|
||||
(let ((tick (buffer-modified-tick)))
|
||||
(let ((inhibit-message t))
|
||||
(indent-region (point-min) (point-max)))
|
||||
(when (/= tick (buffer-modified-tick))
|
||||
;; Indentation changed: warn for each line.
|
||||
(dolist (line (undo-lines buffer-undo-list))
|
||||
(message "%s:%s: Indentation mismatch" (buffer-name) line))
|
||||
(setf errors-p t))))
|
||||
(let ((inhibit-message t))
|
||||
(indent-region (point-min) (point-max)))
|
||||
(when buffer-undo-list
|
||||
;; Indentation changed: warn for each line.
|
||||
(dolist (line (undo-lines buffer-undo-list))
|
||||
(message "%s:%s: Indentation mismatch" (buffer-name) line))
|
||||
(setf errors-p t)))
|
||||
(undo-pos (entry)
|
||||
(cl-typecase (car entry)
|
||||
(number (car entry))
|
||||
(string (abs (cdr entry)))))
|
||||
(undo-lines (undo-list)
|
||||
;; Return list of lines changed in UNDO-LIST.
|
||||
(nreverse (cl-loop for elt in undo-list
|
||||
when (and (consp elt)
|
||||
(numberp (car elt)))
|
||||
collect (line-number-at-pos (car elt))))))
|
||||
for pos = (undo-pos elt)
|
||||
when pos
|
||||
collect (line-number-at-pos pos)))))
|
||||
(mapc #'lint-file (mapcar #'expand-file-name command-line-args-left))
|
||||
(when errors-p
|
||||
(kill-emacs 1)))))
|
||||
|
|
Loading…
Add table
Reference in a new issue