-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathel-pres.elc
91 lines (77 loc) · 16.8 KB
/
el-pres.elc
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
;ELC
;;; Compiled by toups@deluge on Thu Apr 28 08:18:21 2011
;;; from file /home/toups/elisp/utils/el-pres.el
;;; in Emacs version 23.1.1
;;; with all optimizations.
;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
(< (aref emacs-version (1- (length emacs-version))) ?A)
(or (and (boundp 'epoch::version) epoch::version)
(string-lessp emacs-version "19.29")))
(error "`el-pres.el' was compiled for Emacs 19.29 or later"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\210\306\307!\207" [require utils scripting monad-parse functional cl provide el-pres] 2)
(defalias 'create-el-pres #[(dir) "\302!\203 \303\304\"\207\305!\210\306 \307\216\310!\210r\311\312!q\210\313c\210\314c\210\315c\210\316\317\320\321#+\207" [dir #1=#:hold-dir%10646 directoryp error "You probably don't want to create a presenation in an extent directory (%s)" make-directory wd ((cd #1#)) cd find-file "page-1.el" ";;; <Title>\n\n" "(dont-do (put-code-here))\n" ";;;Controls " insert-button "Home" action #[(button) "\300\301!\207" [find-file "page-1.el"] 2]] 4 nil "G"])
(defalias '=page #[nil "\300\301!\207" [=string "page-"] 2])
(defalias '=page-number #[nil "\306 \307\"\310 !\204 \311\312!\210\313\314!\211\205 \314K\315\216\314\316M\210\313\317!\211\205, \317K-\320\216\317\321M\210\313\322!\211.\205? \322K/\323\216\322\324M\210\313\325!\2110\205R \325K1\326\216\325\327M\210\330\331!\2112 L\210\330\332!\2113\3062J\307\"L\210\3102J!\204} \311\312!\210\330\333!\330\334!\330\335!\330\336!456\2117\337L\2106\337L\2105\337L\2104\337L\2107\340\341\342\343\3444D\3445D\3446D\3447D\3443D\3442D\345\257 EL\2106\340\341\342\346\3444D\3445D\3446D\3447D\3443D\3442D\345\257 EL\2105\340\341\342\347\3444D\3445D\3446D\3447D\3443D\3442D\345\257 EL\2104\340\341\342\350\3444D\3445D\3446D\3447D\3443D\3442D\345\257 EL\2104J\351\352\353!!\340\341\342\354\3444D\3445D\3446D\3447D\3443D\3442D\345\257 E\".\207" [monad-parse current-monad m-zero #1=#:--cl-letf-bound-- #2=#:--cl-letf-save-- #3=#:--cl-letf-bound-- tbl :m-zero monad\? error "Expected a monad in an mlet or similar form. \nA monad is a hash table with m-return and m-bind forms." fboundp m-bind ((byte-code "\203 \302 M\210\202 \303\302!\210\302\207" [#1# #2# m-bind fmakunbound] 2)) #[(v f) "\303\304\" \n\"\207" [current-monad v f tbl :m-bind] 3] m-return ((byte-code "\203 \302 M\210\202 \303\302!\210\302\207" [#3# #4=#:--cl-letf-save-- m-return fmakunbound] 2)) #[(v) "\302\303\" !\207" [current-monad v tbl :m-return] 3] >>= ((byte-code "\203 \302 M\210\202 \303\302!\210\302\207" [#5=#:--cl-letf-bound-- #6=#:--cl-letf-save-- >>= fmakunbound] 2)) #[(v f) "\303\304\" \n\"\207" [current-monad v f tbl :m-bind] 3] m-plus ((byte-code "\203 \302 M\210\202 \303\302!\210\302\207" [#7=#:--cl-letf-bound-- #8=#:--cl-letf-save-- m-plus fmakunbound] 2)) #[(mv1 mv2) "\303\304\" \n\"\207" [current-monad mv1 mv2 tbl :m-plus] 3] make-symbol "--current-monad--" "--m-zero--" "----cl-var--10650--" "----cl-var--10649--" "----cl-var--10648--" "----cl-var--10647--" nil lambda (&rest --cl-rest--) apply #[(#9=#:G10651 #10=#:G10652 #11=#:G10653 #12=#:G10654 #13=#:G10655 #14=#:G10656 mv1 mv2) "\303J\304\" \n\"\207" [#14# mv1 mv2 tbl :m-plus] 3] quote --cl-rest-- #[(#15=#:G10657 #16=#:G10658 #17=#:G10659 #18=#:G10660 #19=#:G10661 #20=#:G10662 v f) "\303J\304\" \n\"\207" [#20# v f tbl :m-bind] 3] #[(#21=#:G10663 #22=#:G10664 #23=#:G10665 #24=#:G10666 #25=#:G10667 #26=#:G10668 v) "\302J\303\" !\207" [#26# v tbl :m-return] 3] #[(#27=#:G10669 #28=#:G10670 #29=#:G10671 #30=#:G10672 #31=#:G10673 #32=#:G10674 v f) "\303J\304\" \n\"\207" [#32# v f tbl :m-bind] 3] one-or-more =satisfies digit-char\? #[(#33=#:G10675 #34=#:G10676 #35=#:G10677 #36=#:G10678 #37=#:G10679 #38=#:G10680 num) "\303\304!\211 L\210\nJ\305\306J\307\"!!)\207" [#39=#:--cl-num-- num #34# make-symbol "--num--" string-to-number coerce string] 6] #4# #5# #6# #7# #8# #40=#:--cl-current-monad-- #41=#:--cl-m-zero-- #42=#:--cl---cl-var--10647-- #43=#:--cl---cl-var--10648-- #44=#:--cl---cl-var--10649-- #45=#:--cl---cl-var--10650--] 14])
(defalias 'parse-page-name #[(name) "\306\307 \310\"\311 !\204 \312\313!\210\314\315!\211\205 \315K\316\216\315\317M\210\314\320!\211\205- \320K,\321\216\320\322M\210\314\323!\211-\205@ \323K.\324\216\323\325M\210\314\326!\211/\205S \326K0\327\216\326\330M\210\331\332!\2111 L\210\331\333!\2112\3071J\310\"L\210\3111J!\204~ \312\313!\210\331\334!\331\335!\331\336!\331\337!345\2116\340L\2105\340L\2104\340L\2103\340L\2106\341\342\343\344\3453D\3454D\3455D\3456D\3452D\3451D\346\257 EL\2105\341\342\343\347\3453D\3454D\3455D\3456D\3452D\3451D\346\257 EL\2104\341\342\343\350\3453D\3454D\3455D\3456D\3452D\3451D\346\257 EL\2103\341\342\343\351\3453D\3454D\3455D\3456D\3452D\3451D\346\257 EL\2103J\352 \341\342\343\353\3453D\3454D\3455D\3456D\3452D\3451D\346\257 E\".7\"\207" [monad-parse current-monad m-zero #1=#:--cl-letf-bound-- #2=#:--cl-letf-save-- #3=#:--cl-letf-bound-- parse-string tbl :m-zero monad\? error "Expected a monad in an mlet or similar form. \nA monad is a hash table with m-return and m-bind forms." fboundp m-bind ((byte-code "\203 \302 M\210\202 \303\302!\210\302\207" [#1# #2# m-bind fmakunbound] 2)) #[(v f) "\303\304\" \n\"\207" [current-monad v f tbl :m-bind] 3] m-return ((byte-code "\203 \302 M\210\202 \303\302!\210\302\207" [#3# #4=#:--cl-letf-save-- m-return fmakunbound] 2)) #[(v) "\302\303\" !\207" [current-monad v tbl :m-return] 3] >>= ((byte-code "\203 \302 M\210\202 \303\302!\210\302\207" [#5=#:--cl-letf-bound-- #6=#:--cl-letf-save-- >>= fmakunbound] 2)) #[(v f) "\303\304\" \n\"\207" [current-monad v f tbl :m-bind] 3] m-plus ((byte-code "\203 \302 M\210\202 \303\302!\210\302\207" [#7=#:--cl-letf-bound-- #8=#:--cl-letf-save-- m-plus fmakunbound] 2)) #[(mv1 mv2) "\303\304\" \n\"\207" [current-monad mv1 mv2 tbl :m-plus] 3] make-symbol "--current-monad--" "--m-zero--" "----cl-var--10684--" "----cl-var--10683--" "----cl-var--10682--" "----cl-var--10681--" nil lambda #9=(&rest --cl-rest--) apply #[(#10=#:G10685 #11=#:G10686 #12=#:G10687 #13=#:G10688 #14=#:G10689 #15=#:G10690 mv1 mv2) "\303J\304\" \n\"\207" [#15# mv1 mv2 tbl :m-plus] 3] quote --cl-rest-- #[(#16=#:G10691 #17=#:G10692 #18=#:G10693 #19=#:G10694 #20=#:G10695 #21=#:G10696 v f) "\303J\304\" \n\"\207" [#21# v f tbl :m-bind] 3] #[(#22=#:G10697 #23=#:G10698 #24=#:G10699 #25=#:G10700 #26=#:G10701 #27=#:G10702 v) "\302J\303\" !\207" [#27# v tbl :m-return] 3] #[(#28=#:G10703 #29=#:G10704 #30=#:G10705 #31=#:G10706 #32=#:G10707 #33=#:G10708 v f) "\303J\304\" \n\"\207" [#33# v f tbl :m-bind] 3] =page #[(#34=#:G10724 #35=#:G10725 #36=#:G10726 #37=#:G10727 #38=#:G10728 #39=#:G10729 _) "\306\307!\211 L\210\nJ\310 \311\312\313\314\315D\315\nD\315D\315\fD\315D\315D\315D\316\257\nE\")\207" [#40=#:--cl-_-- _ #34# #35# #36# #37# make-symbol "--_--" =page-number lambda #9# apply #[(#41=#:G10717 #42=#:G10718 #43=#:G10719 #44=#:G10720 #45=#:G10721 #46=#:G10722 #47=#:G10723 n) "\306\307!\211 L\210\nJ\310\311!\312\313\314\315\316D\316D\316\nD\316\fD\316D\316D\316D\316D\317\257E\")\207" [#48=#:--cl-n-- n #42# #41# #43# #44# make-symbol "--n--" =string ".el" lambda #9# apply #[(#49=#:G10709 #50=#:G10710 #51=#:G10711 #52=#:G10712 #53=#:G10713 #54=#:G10714 #55=#:G10715 #56=#:G10716 _) "\304\305!\211 JL\210\nJJ!)\207" [#57=#:--cl-_-- #50# #52# #49# make-symbol "--_--"] 3] quote --cl-rest-- #45# #46# #47#] 16] quote --cl-rest-- #38# #39#] 15] #4# #5# #6# #7# #8# #58=#:--cl-current-monad-- #59=#:--cl-m-zero-- #60=#:--cl---cl-var--10681-- #61=#:--cl---cl-var--10682-- #62=#:--cl---cl-var--10683-- #63=#:--cl---cl-var--10684-- name] 15])
(parse-page-name "page-1.el")
(defalias 'subsequent-page-exists\? #[(page-number) "\301\302\303T\"!\207" [page-number file-exists-p format "page-%d.el"] 4])
(defalias 'previous-page-exists\? #[(page-number) "\301\302\303S\"!\207" [page-number file-exists-p format "page-%d.el"] 4])
(defalias 'jump-to #[(button file) "r\301!q\210\302p!\210p)\207" [file find-file rebuild-control-panel] 2])
(defalias 'jump-to-page-number #[(button n) "r\301\302\303\"!q\210\304 \210p)\207" [n find-file format "page-%d.el" rebuild-control-panel] 4])
(defalias 'make-el-pres-page-unsafe #[(n) "r\301\302\303\"!q\210\304c\210\305c\210\306c\210\307!\203% \310\311\312\313\314\302\303S\"\"#\210\315c\210\316!\203; \310\311\312\313\314\302\303T\"\"#\210\317c\210\320 )\207" [n find-file format "page-%d.el" ";;; <Title>\n\n" "(dont-do (put-code-here))\n" ";;;Controls " previous-page-exists\? insert-button "<<<" action par jump-to " . " subsequent-page-exists\? " " save-buffer] 8])
(defalias 'any-pages\? #[(ls-results) "@\301\302O\303\230?\207" [ls-results 0 3 "ls:"] 3])
(defalias 'sort-by-page-descending #[(page-list) "\301\302\303\304\301\305\"\"\306\307\310\"\"\"\207" [page-list mapcar car functional-sort zip parse-page-name decorate-all > cadr] 8])
(defalias 'sort-by-page-ascending #[(page-list) "\301\302\303\304\301\305\"\"\306\307\310\"\"\"\207" [page-list mapcar car functional-sort zip parse-page-name decorate-all < cadr] 8])
(defalias 'increment-page-name #[(page-name) "\301\302\303!T\"\207" [page-name format "page-%d.el" parse-page-name] 4])
#@43 Not documented
(fn &optional (DIR (wd)))
(defalias 'safe-get-pages #[(&rest #1=#:--cl-rest--) "\203\f \211A@\202 \304 \203 \305\306\307GTD\"\210\304 \310\216\311 !\210\312\313!\314!\2050 ,\207" [#1# dir #2=#:hold-dir%10730 result wd signal wrong-number-of-arguments safe-get-pages ((cd #2#)) cd sh "ls page-*.el" any-pages\?] 4 (#$ . 9489)])
(defalias 'get-pages-by-number-predicate #[(dir predicate) "\304 \305\216\306 !\210\307\310 !!\311\312\313\314#\n\"+\207" [#1=#:hold-dir%10731 dir files predicate wd ((cd #1#)) cd sort-by-page-ascending safe-get-pages filter decorate-n 0 parse-page-name] 5])
#@45 Not documented
(fn N &optional (DIR (wd)))
(defalias 'get-pages-at-or-above #[(n &rest #1=#:--cl-rest--) "\203\f \211A@\202 \303 \203 \304\305\306\307G\\D\"\210\310 \311\312\n\"\")\207" [#1# dir n wd signal wrong-number-of-arguments get-pages-at-or-above 2 get-pages-by-number-predicate par >=] 5 (#$ . 10112)])
#@45 Not documented
(fn N &optional (DIR (wd)))
(defalias 'get-pages-above #[(n &rest #1=#:--cl-rest--) "\203\f \211A@\202 \303 \203 \304\305\306\307G\\D\"\210\310 \311\312\n\"\")\207" [#1# dir n wd signal wrong-number-of-arguments get-pages-above 2 get-pages-by-number-predicate par >] 5 (#$ . 10439)])
#@57 Not documented
(fn STARTING-WITH &optional (DIR (wd)))
(defalias 'move-pages-up #[(starting-with &rest #1=#:--cl-rest--) "\203\f \211A@\202 \306 \203 \307\310\311\312G\\D\"\210\306 \313\216\314 !\210\315\f\316\317\"#\320!\204: \321\322!\210\323\324!\211$\205E \324K%\325\216\324\326M\210\323\327!\211&\205X \327K'\330\216\327\331M\210\323\332!\211(\205k \332K)\333\216\332\334M\210\323\335!\211*\205~ \335K+\336\216\335\337M\210\324\340\341, \"!\342\".\207" [#1# dir #2=#:hold-dir%10732 reopen monad-maybe^i current-monad wd signal wrong-number-of-arguments move-pages-up 2 ((cd #2#)) cd nil tbl :m-zero monad\? error "Expected a monad in an mlet or similar form. \nA monad is a hash table with m-return and m-bind forms." fboundp m-bind ((byte-code "\203 \302 M\210\202 \303\302!\210\302\207" [#3=#:--cl-letf-bound-- #4=#:--cl-letf-save-- m-bind fmakunbound] 2)) #[(v f) "\303\304\" \n\"\207" [current-monad v f tbl :m-bind] 3] m-return ((byte-code "\203 \302 M\210\202 \303\302!\210\302\207" [#5=#:--cl-letf-bound-- #6=#:--cl-letf-save-- m-return fmakunbound] 2)) #[(v) "\302\303\" !\207" [current-monad v tbl :m-return] 3] >>= ((byte-code "\203 \302 M\210\202 \303\302!\210\302\207" [#7=#:--cl-letf-bound-- #8=#:--cl-letf-save-- >>= fmakunbound] 2)) #[(v f) "\303\304\" \n\"\207" [current-monad v f tbl :m-bind] 3] m-plus ((byte-code "\203 \302 M\210\202 \303\302!\210\302\207" [#9=#:--cl-letf-bound-- #10=#:--cl-letf-save-- m-plus fmakunbound] 2)) #[(mv1 mv2) "\303\304\" \n\"\207" [current-monad mv1 mv2 tbl :m-plus] 3] reverse get-pages-at-or-above #[(pages) "\302\303!\211 L\210\304\305\306J\"\307\310\311\312\313D\314FE\")\207" [#11=#:--cl-pages-- pages make-symbol "--pages--" m-bind mapcar increment-page-name lambda (&rest --cl-rest--) apply #[(#12=#:G10733 new-pages) "\nJ\306\301J\306:\203Y \f:\203Y @\f@\307!\203* \310\311\"\210\312!\211\203H rq\210\313!B\314 \210\315 \210))\316\"\210A\fA\202 ,\306:\203z @\317!\210A\211\202c +\306\207" [new-pages #13=#:--cl-new-pages-- #12# n #14=#:--cl-var-- p nil file-exists-p error "renamed page %s already exists, which should be impossible." get-buffer buffer-name save-buffer kill-buffer rename-file find-file-noselect #15=#:--cl-var-- buffer reopen #16=#:--cl-var-- r] 5] quote --cl-rest--] 9] m-zero #3# #4# #5# #6# #7# #8# #9# #10# starting-with] 6 (#$ . 10753)])
#@43 Not documented
(fn &optional (DIR (wd)))
(defalias 'el-pres-add-page-after #[(&rest #1=#:--cl-rest--) "\203\f \211A@\202 \304 \203 \305\306\307GTD\"\210\304 \310\216\311 !\210\312\313p!!\314T \"\210\315T!\210\316 ,\207" [#1# dir #2=#:hold-dir%10734 current-page wd signal wrong-number-of-arguments el-pres-add-page-after ((cd #2#)) cd parse-page-name buffer-name move-pages-up make-el-pres-page-unsafe rebuild-control-panels] 4 (#$ . 13180) nil])
(defalias 'get-end-of-line #[nil "\212\300\210`)\207" [nil] 1])
#@69 Not documented
(fn &optional (BUFFER (current-buffer)) (DIR (wd)))
(defalias 'insert-page-number-buttons #[(&rest #1=#:--cl-rest--) "\203\f \211A@\202 p\203 \211A@\202 \306 \203+ \307\310\311\312G\\D\"\210\313\314\n!!\315\316 !!\211\317:\203s @\315!\211U\203Z \320\321\"\210\202h \322\323\321\"\324\325\326\"#\210\327c\210)A\211\202= .\317\207" [#1# buffer dir current-page pages #2=#:--cl-var-- wd signal wrong-number-of-arguments insert-page-number-buttons 2 sort-by-page-ascending safe-get-pages parse-page-name buffer-name nil insertf "%d" insert-button format action par jump-to-page-number " " page pn] 8 (#$ . 13711)])
#@58 Not documented
(fn &optional (BUFFER (current-buffer)))
(defalias 'rebuild-control-panel #[(&rest #1=#:--cl-rest--) "\203\f \211A@\202 p\203 \303\304\305GTD\"\210r q\210\306 \210\307\310 !!\212db\210\311\312\313\314#\203; \315\224b\210\202A db\210\316c\210\317 \210`d|\210\320c\210\321\322\323\324\325\326\"#\210\327c\210\n\330V\203g \321\331\323\324\332\nS\"#\210\333c\210\334\335\336\nT\"!\203~ \321\337\323\324\332\nT\"#\210\327c\210\340 !\210\316c\210\341c\210\342c\210\321\343\323\344#\210)\306 +\207" [#1# buffer page-number signal wrong-number-of-arguments rebuild-control-panel save-buffer parse-page-name buffer-name search-backward ";;;Controls" nil t 0 "\n" beginning-of-line ";;;Controls " insert-button "Home" action par jump-to "page-1.el" " " 1 "<<<" jump-to-page-number " . " file-exists-p format "page-%d.el" ">>>" insert-page-number-buttons ";;;" " " "Index" #[(button) "\300 \207" [el-pres-build-index] 1]] 6 (#$ . 14382) nil])
#@43 Not documented
(fn &optional (DIR (wd)))
(defalias 'rebuild-control-panels #[(&rest #1=#:--cl-rest--) "\203\f \211A@\202 \306 \203 \307\310\311GTD\"\210\306 \312\216\313 !\210\314 !\211\315\f:\203_ \f@\316!\317!\211\203H \202K \320!\203W \321!\210+\fA\211\202. .\315\207" [#1# dir #2=#:hold-dir%10735 pages #3=#:--cl-var-- page wd signal wrong-number-of-arguments rebuild-control-panels ((cd #2#)) cd safe-get-pages nil parse-page-name get-buffer find-file-noselect rebuild-control-panel page-number already-open\? buffer] 4 (#$ . 15355) nil])
(defalias 'get-buffer-or-find-file #[(name) "\303!\304! \n*D\207" [name buf get\? get-buffer find-file-noselect] 3])
#@70 Not documented
(fn &optional (PAGE (buffer-name (current-buffer))))
(defalias 'get-page-title #[(&rest #1=#:--cl-rest--) "\203\f \211A@\202 \305p!\203 \306\307\310GTD\"\210\311 !\211\312\234\n\313\234r\fq\210\212eb\210\314\315\316\317\320 \321\211\313&\204C \322 \210!.\207" [#1# page #2=#:list-10736 open-already buf buffer-name signal wrong-number-of-arguments get-page-title get-buffer-or-find-file 0 1 chomp replace-regexp-in-string "\\(;;;\\).*\\'" "" buffer-subline nil kill-buffer] 9 (#$ . 16057)])
#@43 Not documented
(fn &optional (DIR (wd)))
(defalias 'el-pres-build-index #[(&rest #1=#:--cl-rest--) "\203\f \211A@\202 \306 \203 \307\310\311GTD\"\210\312\313 !!\306 \314\216\315 !\210r\316\317!q\210ed|\210\n\320\f:\203\\ \f@\321c\210\322\323\324\325!\"\326\327\330\"#\210\331c\210\fA\211\202: .\320\207" [#1# dir pages #2=#:hold-dir%10737 #3=#:--cl-var-- page wd signal wrong-number-of-arguments el-pres-build-index sort-by-page-ascending safe-get-pages ((cd #2#)) cd find-file "index.el" nil ";;; - " insert-button format "%s" get-page-title action par jump-to "\n"] 7 (#$ . 16584)])