mirror of https://github.com/Chizi123/.emacs.d.git

Chizi123
2018-11-18 c655eea759be1db69c5e6b45c228139d8390122a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
;ELC
;;; Compiled
;;; in Emacs version 26.1
;;; with all optimizations.
 
;;; This file uses dynamic docstrings, first added in Emacs 19.29.
 
;;; This file does not contain utf-8 non-ASCII characters,
;;; and so can be loaded in Emacs versions earlier than 23.
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 
(byte-code "\300\301!\210\302\303\304\305\306\307%\210\302\310\311\312\306\307%\210\302\313\314\315\306\307%\207" [require semantic/bovine/el custom-declare-variable srefactor-newline-threshold 40 "If a token is about to be inserted, if the current posistion\n  exceeds this threshold characters, insert the token in the next\n  line isntead. Note that this does not account for indentation\n  but the total number of characters in a line." :group srefactor srefactor-lisp-symbol-to-skip '(("progn" . 0) ("cond" . 0) ("save-excursion" . 0) ("unwind-protect" . 0) ("with-temp-buffer" . 0) ("defmethod" . 1) ("cons" . 2) ("kill-region" . 2) ("equal" . 2) ("member" . 2) ("eq?" . 2) ("eq" . 2) ("get" . 2) ("assoc" . 2) ("defun" . 2) ("defclass" . 2) ("defstruct" . 2) ("defmacro" . 2) ("defsubst" . 2) ("defface" . 2) ("defalias" . 2) ("defcustom" . 2) ("declare" . 2) ("defvar" . 2) ("defparameter" . 2) ("defconst" . 2) ("string-match" . 2) ("defcustom" . 2) ("setq" . 2) ("setq-default" . 2) ("member" . 2) ("setf" . 2) (">" . 2) ("<" . 2) ("<=" . 2) (">=" . 2) ("/=" . 2) ("=" . 2) ("some" . 2) ("define-key" . 3) ("modify-syntax-entry" . 3)) "A list of pairs of a symbol and a number that denotes how many\n  sexp to skip before inserting the first newline. " srefactor-clojure-symbol-to-skip '(("fn" . 1) ("ns" . 1) (":require" . 1) (":import" . 1) ("def" . 2) ("struct-map" . 1) ("defmacro" . 1) ("binding" . 1) ("with-bindings" . 1) ("doseq" . 1) ("catch" . 2) ("defn" . 2)) "A list of pairs of a symbol and a number that denotes how many\n  sexp to skip before inserting a newline. This will be merged\n  with `srefactor-lisp-symbol-to-skip'. Symbols in this list\n  overrides symbols in `srefactor-lisp-symbol-to-skip'."] 6)
(defvar token nil)
(defvar token-type nil)
(defvar token-str nil)
(defvar ignore-num nil)
(defvar tok-start nil)
(defvar next-token nil)
(defvar next-token-start nil)
(defvar next-token-end nil)
(defvar next-token-type nil)
(defvar next-token-str nil)
(defvar tok-end nil)
(defvar cur-buf nil)
(defvar first-token nil)
(defvar first-token-name nil)
(defvar second-token nil)
(defvar lexemes nil)
(defvar comment-token nil)
(defvar comment-content nil)
(defvar token-real-line nil)
(defvar next-token-real-line nil)
(defvar comment-real-line-start nil)
(defvar comment-real-line-end nil)
(defvar comment-token-start nil)
(defvar comment-token-end nil)
(defvar format-type nil)
(defvar recursive-p nil)
(defvar orig-format-type nil)
(defalias 'srefactor--appropriate-major-mode #[(major-mode) "\301=\203    \301 \207\302=\203\302 \207\303=\203\303 \207\304\305!\203*\305=\203*\305 \207\301 \207" [major-mode emacs-lisp-mode scheme-mode common-lisp-mode fboundp clojure-mode] 2])
(defalias 'srefactor--define-skip-list-for-mode #[(major-mode) "\303\304!\203\304=\203\305\306    \n\"\307\310#\207    \207" [major-mode srefactor-lisp-symbol-to-skip srefactor-clojure-symbol-to-skip fboundp clojure-mode cl-remove-duplicates append :test #[(a b) "@    @\232\207" [a b] 2]] 4])
#@24 Format current buffer.
(defalias 'srefactor-lisp-format-buffer #[nil "`\306ed\"    \n\307\310!rq\210\311\216\312 \210\313 \210 \314 !\315 \210c\210db\210\316 \203V`\212\317 \210`)\320\321\322\323&\210b\210*\2021\324 !\210\325ed\"\210\f\306ed\"+\326ed\"\210c\210b-\207" [major-mode srefactor-lisp-symbol-to-skip indent-tabs-mode cur-indent-mode orig-skip-list cur-major-mode buffer-substring-no-properties generate-new-buffer " *temp*" #[nil "\301!\205    \302!\207" [#1=#:temp-buffer buffer-name kill-buffer] 2] semantic-default-elisp-setup emacs-lisp-mode srefactor--define-skip-list-for-mode semantic-lex-init beginning-of-defun-raw forward-sexp srefactor--lisp-format-one-or-multi-lines multi-line nil t srefactor--appropriate-major-mode indent-region kill-region buf-content cur-pos #1# end beg] 7 (#$ . 3417) nil])
#@35 Format current defun point is in.
(defalias 'srefactor-lisp-format-defun #[nil "`\212\306u\210\307 \210`)\212    b\210\310 \210`)  \311    \n\"\312\313!rq\210\314\216\315 \210\316 \210\317!\320 \210c\210\321ede\322\323\324&\210\325!\210\f\326ed\"\210\311ed\"+\327    \n\"\210c\210b.\207" [orig-point beg end srefactor-lisp-symbol-to-skip orig-skip-list indent-tabs-mode 1 beginning-of-defun-raw forward-sexp buffer-substring-no-properties generate-new-buffer " *temp*" #[nil "\301!\205    \302!\207" [#1=#:temp-buffer buffer-name kill-buffer] 2] semantic-default-elisp-setup emacs-lisp-mode srefactor--define-skip-list-for-mode semantic-lex-init srefactor--lisp-format-one-or-multi-lines multi-line nil t srefactor--appropriate-major-mode indent-region kill-region cur-indent-mode major-mode cur-major-mode content #1#] 7 (#$ . 4278) nil])
#@329 Transform all sub-sexpressions current sexpression at point
into multiple lines separatedly. If the head symbol belongs to the
list `srefactor-lisp-symbol-to-skip', then the first N next
symbol/sexpressions (where N is the nummber associated with the
head symbol as stated in the list) are skipped before a newline
is inserted.
(defalias 'srefactor-lisp-format-sexp #[nil "`\212\306\307!\204\f\310 \210`)\212    b\210\311 \210`)  \312    \n\"\313\314!rq\210\315\216\316 \210\317 \210\320!\321 \210c\210\322ede\323\324\325&\210\326!\210\f\312ed\"+\327    \n\"\210c\210    b\210\311 \210`\330    \n\"\210b.\207" [orig-point beg end srefactor-lisp-symbol-to-skip orig-skip-list indent-tabs-mode looking-at "[({[]" backward-up-list forward-sexp buffer-substring-no-properties generate-new-buffer " *temp*" #[nil "\301!\205    \302!\207" [#1=#:temp-buffer buffer-name kill-buffer] 2] semantic-default-elisp-setup emacs-lisp-mode srefactor--define-skip-list-for-mode semantic-lex-init srefactor--lisp-format-one-or-multi-lines multi-line nil t srefactor--appropriate-major-mode kill-region indent-region cur-indent-mode major-mode cur-major-mode content #1#] 7 (#$ . 5150) nil])
#@106 Transform all sub-sexpressions current sexpression at point
into one line separated each one by a space.
(defalias 'srefactor-lisp-one-line #[(recursive-p) "`\212\306\307!\204\f\310 \210`)\212    b\210\311 \210`)  \312    \n\"\313\314!rq\210\315\216\316 \210\317 \210\320!\321 \210c\210\322ede\323\324&\210\325!\210\f\326ed\"\210\312ed\"+\327    \n\"\210c\210b.\207" [orig-point beg end srefactor-lisp-symbol-to-skip orig-skip-list indent-tabs-mode looking-at "[({[]" backward-up-list forward-sexp buffer-substring-no-properties generate-new-buffer " *temp*" #[nil "\301!\205    \302!\207" [#1=#:temp-buffer buffer-name kill-buffer] 2] semantic-default-elisp-setup emacs-lisp-mode srefactor--define-skip-list-for-mode semantic-lex-init srefactor--lisp-format-one-or-multi-lines one-line nil srefactor--appropriate-major-mode indent-region kill-region cur-indent-mode major-mode cur-major-mode content #1# recursive-p] 7 (#$ . 6351) "P"])
#@331 Turn the current sexpression into one line/multi-line depends
on the value of FORMAT-TYPE. If FORMAT-TYPE is 'one-line,
transforms all sub-sexpressions of the same level into one
line. If FORMAT-TYPE is 'multi-line, transforms all
sub-sexpressions of the same level into multiple lines.
 
Return the position of last closing sexp.
(defalias 'srefactor--lisp-format-one-or-multi-lines #[(beg end orig-point format-type &optional newline-betwen-semantic-lists recursive-p) "\306    \307#p\nA@\310\f!\nAA@#\311\312\313!!$%&\314\211'(\314\211)*\315\216\316\317\n\"\2049\320%\f@\317=\204H\316 +\"\203K\321,\316 +\"\211(A)\n\203\335\314\211-.\314\211/0\314\21112\3143\322 \210r$q\210'c\210\323 \210-\324=\203\2223\325\235\203\222\326 \210\202\330-\327=\204\256-\330=\204\256-\331=\204\2562\331=\203\264\332 \210\202\330-\333=\203\301\334 \210\202\330%\320=\203\316\335 \210\202\330%\336=\203\330\337 \210.\202V\340    \"\210`r$q\210\341ed\")c\210`\306    \307#4\205\342\n\237!.\f\207" [beg end lexemes cur-buf first-token first-token-name semantic-emacs-lisp-lexer 1 srefactor--lisp-token-text generate-new-buffer make-temp-name "" nil #[nil "\301!\207" [tmp-buf kill-buffer] 2] assoc semantic-list one-line t srefactor--lisp-forward-token srefactor--lisp-comment-formatter number ("+" "-" "*" "/") srefactor--lisp-number-formatter punctuation open-paren close-paren srefactor--lisp-punctuation-formatter symbol srefactor--lisp-symbol-formatter srefactor--lisp-oneline-formatter multi-line srefactor--lisp-multiline-formatter kill-region buffer-substring-no-properties srefactor--lisp-visit-semantic-list-lex second-token tmp-buf format-type orig-format-type token-str ignore-pair ignore-num token srefactor-lisp-symbol-to-skip newline-betwen-semantic-lists token-type tok-start tok-end next-token next-token-start next-token-type next-token-str recursive-p] 5 (#$ . 7324)])
#@94 Make use of dynamic scope of its parent
function `srefactor--lisp-format-one-or-multi-lines'
(defalias 'srefactor--lisp-number-formatter #[nil "\211\211A@\247\204\211AA\262\202\211A\262A\262b\210    c\210\306 \210\307c\210\310\211\211A@\247\2045\211AA\262\2029\211A\262@\262\211\211A@\247\204M\211AA\262\202Q\211A\262A\262TBB     P A@\n\311 \207" [token next-token-str first-token token-str first-token-name lexemes srefactor--lisp-comment-formatter " " symbol srefactor--lisp-forward-token second-token] 5 (#$ . 9255)])
#@94 Make use of dynamic scope of its parent
function `srefactor--lisp-format-one-or-multi-lines'
(defalias 'srefactor--lisp-punctuation-formatter #[nil "\305\211\306\307 !\203    c\210\310 \210\202 \311\n!=\203!\312 \210\205*\fB\211+\207" [token token-str orig-token first-token-name lexemes nil srefactor--lisp-token-in-punctuation-p srefactor--lisp-forward-token srefactor--lisp-comment-formatter srefactor--lisp-token-text srefactor--lisp-forward-first-second-token] 3 (#$ . 9799)])
#@145 Insert additional text based on symbol appearance. Make use of
dynamic scope of its parent function `srefactor--lisp-format-one-or-multi-lines'
(defalias 'srefactor--lisp-symbol-formatter #[nil "    \232\204L\n\306=\203L\307\310\"\203L\311c\210\312 \210 \313\235\203(c\210\312 \210\202c\210\f\314\232\203=\f\315\311\261\210\316 \210\312 \207\317 !\204J \203J\315c\207\320\207\321\235\203T\322\207\323\230\203]\311c\207\324=\203g\325 \207\306=\205p\326 \207" [token-str first-token-name orig-format-type token-type next-token-str next-token multi-line string-match ":.*" " " srefactor--lisp-forward-token (punctuation open-paren semantic-list) "}" "\n" srefactor--lisp-comment-formatter srefactor--lisp-token-in-punctuation-p t ("~@" "?") "" "." one-line srefactor--lisp-oneline-formatter srefactor--lisp-multiline-formatter format-type] 3 (#$ . 10298)])
(defalias 'srefactor--lisp-forward-first-second-token #[nil "\305    ! @\211\207" [token first-token first-token-name lexemes second-token srefactor--lisp-token-text] 2])
(defalias 'srefactor--lisp-forward-token #[nil "\211A\242\211\205\227    \211@\262    \211\211A@\247\204!\211AA\262\202%\211A\262@\262    \211\211A@\247\204:\211AA\262\202>\211A\262A\262\306    !@\211\211@\262    \211\211A@\247\204c\211AA\262\202g\211A\262@\262\n\211\211A@\247\204~\211AA\262\202\202\211A\262A\262 \203\223\306!\202\224\307\f    \207" [lexemes token token-type tok-start tok-end token-str srefactor--lisp-token-text "" next-token next-token-type next-token-start next-token-end next-token-str] 4])
(defalias 'srefactor--lisp-comment-formatter #[nil "\306\211\211\211\211\211\211\211\205\315\205\315rq\210\30710\310\"@0\2022\210\306)\211\205\315rq\210\211\211A@\247\204P\211AA\262\202T\211A\262@\262\211\211A@\247\204k\211AA\262\202o\211A\262A\262\311!\311 !\311!\311!\312 \")\313=\203\234\314\f\261\210\202\265\n    U\203\252\315\f\261\210\202\265\n    U\204\265\314\f\261\210\316!\204\313\316!\204\313\317\320\"\205\315\314c.\207" [comment-real-line-end comment-real-line-start token-real-line next-token-real-line comment-content comment-token-end nil (error) semantic-comment-lexer line-number-at-pos buffer-substring-no-properties string "\n" " " srefactor--lisp-token-in-punctuation-p string-match "[]}]" comment-token-start comment-token tok-end next-token-start cur-buf token-type token next-token token-str] 9])
(defalias 'srefactor--lisp-oneline-formatter #[nil "\304!?\205 `\305 Z\n\306=\204     X\203\307c\202\310c)\207" [token distance orig-format-type srefactor-newline-threshold srefactor--lisp-token-in-punctuation-p line-beginning-position one-line " " "\n"] 2])
(defalias 'srefactor--lisp-multiline-formatter #[nil "\203j    \n\232\203\306c\210\203\307U\203S\307V\203R\310 !\2034\311\312!\210 \fB\307\211\202\313 \210\nc\210\314 \210\315 !\203I\316 \210\202S\306c\210\202\311\312!\210\310\f@!\203c\317 \210\202f\320c\210\321\211\207    \n\232\203y \322=\204y\306c\207 \322=\203\217\323=\203\217    \n\232\203\217\306c\207\322=\203\231\320c\207\203\243\307U\203\246\320c\207\320c\207" [ignore-num first-token-name token-str token lexemes next-token-type " " 0 srefactor--lisp-token-paren-p delete-char -1 srefactor--lisp-forward-token srefactor--lisp-comment-formatter srefactor--lisp-token-in-punctuation-p srefactor--lisp-forward-first-second-token srefactor--lisp-punctuation-formatter "\n" nil semantic-list symbol token-type] 3])
(defalias 'srefactor--lisp-token-name-in-skip-list-p #[(token-name) "    \235\207" [token-name srefactor-lisp-symbol-to-skip] 2])
(defalias 'srefactor--lisp-token-in-punctuation-p #[(token) "\211@\262\301\235\207" [token (open-paren charquote close-paren punctuation)] 2])
(defalias 'srefactor--lisp-token-paren-p #[(token) "\211@\262\301\235\207" [token (open-paren close-paren)] 2])
(defalias 'srefactor--lisp-token-text #[(token) "\203<r    q\210\302\211\211A@\247\204\211AA\262\202\211A\262@\262\211\211A@\247\2042\211AA\262\2026\211A\262A\262\")\207\303\207" [token cur-buf buffer-substring-no-properties ""] 5])
#@67 Visit and format all sub-sexpressions (semantic list) in LEXEMES.
(defalias 'srefactor--lisp-visit-semantic-list-lex #[(lexemes) "\306\211\205\201\n@\211\211\211A@\247\204\211AA\262\202 \211A\262@\262    \211\211A@\247\2044\211AA\262\2028\211A\262A\262\306    @\307=\203x\f Z\310V\203x    \211\211A@\247\204_\211AA\262\202c\211A\262@\262b\210\311 \f  \312 \f\" &\210+\nA\211\204\306*\207" [lexemes token --dolist-tail-- tok-str tok-end tok-start nil semantic-list 2 srefactor--lisp-format-one-or-multi-lines assoc format-type srefactor-lisp-symbol-to-skip recursive-p] 9 (#$ . 14494)])
(defalias 'srefactor--lisp-comment-debug-messages #[nil "\306\307\"\210\306\310    \"\210\306\311\n\"\210\306\312 \"\210\306\312 \"\210\306\313\f\"\210\306\314 \"\210\306\315\"\210\306\316\"\207" [comment-token comment-token-start comment-token-end comment-content token-real-line next-token-real-line message "comment-token: %s" "comment-start: %s" "comment-end: %s" "comment-content: %s" "token-real-line: %s" "next-token-real-line: %s" "comment-real-line-start: %s" "comment-real-line-end %s" comment-real-line-start comment-real-line-end] 3])
(defalias 'srefactor--lisp-debug-messages #[nil "\306\307\"\210\306\310    \"\210\306\311\n\"\210 \203\306\312 \"\210\306\313\f\"\210\306\314 \"\210\306\315\"\207" [token token-type token-str ignore-num next-token next-token-type message "token: %s" "token-type: %s" "token-str: %s" "ignore-num: %s" "next-token: %s" "next-token-type: %s" "next-token-str: %s" next-token-str] 3])
(provide 'srefactor-lisp)