File: check.el

package info (click to toggle)
emacs-format-all-the-code 0.6.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 308 kB
  • sloc: lisp: 1,533; sh: 5; makefile: 2
file content (18 lines) | stat: -rw-r--r-- 809 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
(with-temp-buffer
  (insert-file-contents "../format-all.el")
  (let (forms)
    (condition-case () (while t (push (read (current-buffer)) forms))
      (end-of-file (setq forms (reverse forms))))
    (let* ((formatter-names
            (reverse
             (cl-reduce
              (lambda (names form)
                (if (and (consp form)
                         (eql 'define-format-all-formatter (cl-first form)))
                    (cons (cl-second form) names)
                  names))
              forms :initial-value '())))
           (sorted-names (sort (cl-copy-list formatter-names) 'string<)))
      (or (and (equal formatter-names sorted-names)
               (message "We have %d formatters" (length formatter-names)))
          (error "Formatter names are not in alphabetical order")))))