;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (require 'cl-lib) #@50 Regex used for matching components of an import. (defvar haskell-align-imports-regexp "^\\(import[ ]+\\)\\(qualified \\)?[ ]*\\(\"[^\"]*\" \\)?[ ]*\\([A-Za-z0-9_.']+\\)[ ]*\\([ ]*as [A-Z][^ ]*\\)?[ ]*\\((.*)\\)?\\([ ]*hiding (.*)\\)?\\( -- .*\\)?[ ]*$" (#$ . 105)) (byte-code "\300\301\302\303\304DD\305\306\307\310\311&\207" [custom-declare-variable haskell-align-imports-pad-after-name funcall function #[0 "\300\207" [nil] 1] "Pad layout after the module name also." :type boolean :group haskell-interactive] 8) #@38 Align all the imports in the buffer. (defalias 'haskell-align-imports #[0 "\300 \203\212eb\210\301 \302!\303\304\305\"\"\266)\306\207" [haskell-align-imports-line-match haskell-align-imports-collect haskell-align-imports-padding mapc make-closure #[257 "\211Ab\210`\301 |\210\302\303\300@\"!c\207" [V0 line-end-position haskell-align-imports-chomp haskell-align-imports-fill] 5 "\n\n(fn X)"] nil] 6 (#$ . 627) nil]) #@44 Try to match the current line as a regexp. (defalias 'haskell-align-imports-line-match #[0 "\300\301 \302 \"\303\304\"\205\211\207" [buffer-substring-no-properties line-beginning-position line-end-position string-match "^import "] 4 (#$ . 1056)]) #@50 Collect a list of mark / import statement pairs. (defalias 'haskell-align-imports-collect #[0 "\300`d\232\204B\301 \204B\302 \211\203;\303\304\300\305X\203-\306\307\"!B\262T\262\202\211\237\266\202!\211\310 BB\262\210\210\300y\210\202\207" [nil haskell-align-imports-after-imports-p haskell-align-imports-line-match-it haskell-align-imports-merge-parts 1 8 haskell-align-imports-chomp match-string line-beginning-position] 9 (#$ . 1312)]) #@82 Merge together parts of an import statement that shouldn't be separated. (fn L) (defalias 'haskell-align-imports-merge-parts #[257 "\301\302\"\303\203*\211\304H\305H\306HE!\307H\310H\311H\312HE!\313HF\207\211\304H\305H\306HE!\307H\310H\311H\312H\313H\257!D\207" [haskell-align-imports-pad-after-name apply vector #[257 "\300\301\"\207" [cl-reduce #[514 "\211G\300V\203G\300V\203\301\202\302Q\207" [0 " " ""] 5 "\n\n(fn A B)"]] 4 "\n\n(fn LS)"] 0 1 2 3 4 5 6 7] 11 (#$ . 1775)]) #@58 Chomp leading and tailing whitespace from STR. (fn STR) (defalias 'haskell-align-imports-chomp #[257 "\211\203\n\300\301\302#\207\302\207" [replace-regexp-in-string "\\(^[[:space:]\n]*\\|[[:space:]\n]*$\\)" ""] 5 (#$ . 2295)]) #@72 Find the padding for each part of the import statements. (fn IMPORTS) (defalias 'haskell-align-imports-padding #[257 "\211\204\207\300\301\302\303\"\"\207" [cl-reduce #[514 "\300\301#\207" [cl-mapcar max] 6 "\n\n(fn A B)"] mapcar #[257 "\300\301@\"\207" [mapcar length] 4 "\n\n(fn X)"]] 6 (#$ . 2531)]) #@90 Fill an import line using the padding worked out from all statements. (fn PADDING LINE) (defalias 'haskell-align-imports-fill #[514 "\300\301\302\303#\304#\207" [mapconcat identity cl-mapcar #[514 "\211G\300V\203\211\301GZ\302\"P\207\301\302\"\207" [0 make-string 32] 6 "\n\n(fn PAD PART)"] " "] 8 (#$ . 2847)]) #@44 Try to match the current line as a regexp. (defalias 'haskell-align-imports-line-match-it #[0 "\301\302 \303 \"\304\"\205\211\207" [haskell-align-imports-regexp buffer-substring-no-properties line-beginning-position line-end-position string-match] 4 (#$ . 3173)]) #@32 Are we after the imports list? (defalias 'haskell-align-imports-after-imports-p #[0 "\212\301 b\210\302\303\304\305 \306\307$*??\207" [case-fold-search line-beginning-position nil search-forward-regexp "\\( = \\|\\\\| :: \\| ∷ \\)" line-end-position t 1] 5 (#$ . 3447)]) (provide 'haskell-align-imports)