;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\207" [require help-fns org] 2) #@38 Last matched snippet start position. (defvar tiny-beg nil (#$ . 153)) #@36 Last matched snippet end position. (defvar tiny-end nil (#$ . 229)) #@363 Expand current snippet. It polls the expander functions one by one if they can expand the thing at point. First one to return a string succeeds. These functions are expected to set `tiny-beg' and `tiny-end' to the bounds of the snippet that they matched. At the moment, only `tiny-mapconcat' is supported. `tiny-mapconcat2' should be added to expand rectangles. (defalias 'tiny-expand #[nil "\303 \211\205 b\210 \n|\210\304\305\"c)\207" [e tiny-beg tiny-end tiny-mapconcat eval t] 4 (#$ . 304) nil]) #@18 Setup shortcuts. (defalias 'tiny-setup-default #[nil "\300\301\302\"\207" [global-set-key [67108923] tiny-expand] 3 (#$ . 814)]) (defalias 'tiny--strip-n #[(str) "\301\302\303#\207" [str replace-regexp-in-string "\\\\n" "\n"] 4]) #@85 Format output of `tiny-mapconcat-parse'. Defaults are used in place of null values. (defalias 'tiny-mapconcat #[nil "\306 \211\205\265\307@\206\310!A@\211\204\311\202'\n\312\232\203&\313\202'\n\314\3158!\3168\2065\317\314 !\211\"<\203O\"@\320=\203O\"GS\202P\321\211#\321U\203_\320\"D\202a\"#\321U\203m\322\202o##\323\3248\206y\325!\211$@%\326&\327 \f \fY\203\220\326\202\221\322#'\330\331\332\333\334 DC\335\336%!\337\340$A\"BBEE\341'D\336 !F. )\207" [parsed n0 n1 s1 n2 expr tiny-mapconcat-parse string-to-number "0" " " "m" "" read 2 3 "x" list 0 1 tiny-extract-sexps 4 "%s" -1 number-sequence mapconcat lambda (x) let lst format tiny--strip-n mapcar #[(x) "\203\303!\207 T\nY\203\300\207\304 T\211\305BB\207" [x idx n-have read nth (lst)] 3] quote lexpr n-have tes fmt idx seq] 11 (#$ . 1051)]) (defconst tiny-format-str (byte-code "\304\305\306\307\310\311 \n %,\207" [character precision width flags "[+ #-0]\\{0,1\\}" "[0-9]*" "\\(?:\\.[0-9]+\\)?" "[sdoxXefgcS]?" format "\\(%s%s%s%s\\)("] 6)) #@243 Return (STR & FORMS). Each element of FORMS corresponds to a `format'-style % form in STR. * %% forms are skipped * %(sexp) is replaced with %s in STR, and put in FORMS * the rest of forms are untouched in STR, and put as nil in FORMS (defalias 'tiny-extract-sexps #[(str) "\306\307\211\211\3101\220\311\312\f #\211\205\213 T\f TH\313U\203( T\202\f \311 \f #=\203\204\314\315\f\"\211\203\204 G\\\316\f \"\211\203T\211A\242\202\\\317\320\321GD\"\322\323\324\f O#\nB\f\306 O\312\230\203x\325\202y\326\f\307OQ*\202\f\307\nB\202\f0\210\202\231\210\327\330\f \307O\"\210\f\n\237,B\207" [fexp beg forms start str tiny-format-str 0 nil (error) string-match "%" 37 match-string-no-properties 1 read-from-string signal wrong-number-of-arguments (_sexp . end) replace-regexp-in-string "(date" "(tiny-date" "s" "" message "Malformed sexp: %s" end _sexp] 7 (#$ . 2117)]) #@648 Try to match a snippet of this form: m[START][SEPARATOR]END[EXPR]|[FORMAT] * START - integer (defaults to 0) * SEPARATOR - string (defaults to " ") * END - integer (required) * EXPR - Lisp expression: function body with argument x (defaults to x) Parens are optional if it's unambiguous: - `(* 2 (+ x 3))' <-> *2+x3 - `(exp x)' <-> expx A closing paren may be added to resolve ambiguity: - `(* 2 (+ x 3) x)' <-> *2+x3) * FORMAT - string, `format'-style (defaults to "%s") | separator can be omitted if FORMAT starts with %. Return nil if nothing was matched, otherwise (START SEPARATOR END EXPR FORMAT) (defalias 'tiny-mapconcat-parse #[nil "\306\211\211\211\211\211\211\3072\316\310\311\312 \"\203>\313\314!\313\315!\316\224\316\225G\316U\203f \306\317\307\320\"\210\202f\310\321\312 \"\203a\313\314!\316\224\316\225G\316U\203f\317\307\306\"\210\202f\317\307\306\"\210\322\323\"\210\313\314\"\313\315\"\324\n!\211\203\206 \306\317\307\320\"\210\322\325\"\203\237\313\314\"\313\315\"\313\326\"\202\243 \306G\316U\204\314\322\327\"\204\270\322\330\"\203\307\324\313\314\"!\313\315\"\202\314\331\332\"\210\3200\205\340\n\333\232\203\331\306 \f \n \257.\207" [str fmt expr n2 s1 n1 nil done looking-back "\\bm\\(-?[0-9]+\\)\\(.*?\\)" line-beginning-position match-string-no-properties 1 2 0 throw t "\\bm\\([^%|\n]*[0-9][^\n]*\\)" string-match "^\\(.*?\\)|?\\(%.*\\)?$" tiny-tokenize "^\\([^\n0-9]*?\\)\\(-?[0-9]+\\)\\(.*\\)?$" 3 "^\\([^\n%|]*?\\)|\\([^\n]*\\)?$" "^\\([^\n%|]*?\\)\\(%[^\n]*\\)?$" error "Couldn't match %s" "" case-fold-search tiny-beg tiny-end] 7 (#$ . 3031)]) #@57 Transform shorthand Lisp expression STR to proper Lisp. (defalias 'tiny-tokenize #[(str) "\306\232\203\306\207\3071W\310\311G\312\211\211\211\310\313 !\"##!W\203=#\"O\211\314\230\203D \fB\315\fB\211\202/ \315\230\203T \2042\316\317!\202/ \320\230\203v\321\322\323#\"T\211\"O!\"\211\fB\315\fB\211\202/ \324\230\203\244\n\310Y\203\210\nS\202\214\316\325!\210\f@\315\230\203\230\f\210\fA\324\fB\315\fB\211\202/ \326\230\203\267\313\nT\326\fB\211\202/\327 ! \330 !\313=\204\341 \331=\204\341\312\313\f@\326\232\204\361\326\fB\nT\202\361 \203\375\332 !\203\375 \204\375 \fB\315\fB\211\202/\323 !\247\203)\333#\312O!$\321\322$\"\211%\fB\315\fB#%G\\\211\"*\202/\"T\"\312\203#\"\211#T\"\202#\f@\315\230\203I\f\210\fA\334\335\f\237\"\336\n\337\"P. 0\207\210\312\207" [str expect-fun n-paren allow-spc out s "" (error) 0 1 nil t "x" " " error "Unexpected \" \"" "?" format "%s" read ")" "Unexpected \")\"" "(" intern-soft help-function-arglist \, boundp string-to-number apply concat make-string 41 sym len j i num num-s] 10 (#$ . 4724)]) #@125 Return date representation of S. `org-mode' format is used. Optional SHIFT argument is the integer amount of days to shift. (defalias 'tiny-date #[(s &optional shift) "\305\306 !\307\310\311 \312#\"\313\314\315#\313\305\n!\314\315#\232\203\"\316\202#\317\f\203/\320\n\321\f!\"\322 \n\"+\207" [ct s time formatter shift decode-time current-time apply encode-time org-read-date-analyze nil cl-subseq 1 3 "%Y-%m-%d %a" "%Y-%m-%d %a %H:%M" time-add days-to-time format-time-string] 6 (#$ . 5851)]) #@914 Helper function for `tiny-expand'. The arguments to this function construct a “tiny expression” "mBSEO|F" where E is the end value (END-VAL) - defaults to 0 internally if nil or "", or 9 if BEGIN-VAL is nil or "" too. B is the begin value (BEGIN-VAL) - defaults to 0 internally if nil or "". S is the separator (SEP) - defaults to " " if nil or "". O is the elisp operation (OP) - defaults to "" if nil. F is the format (FMT) - defaults to "" if nil. If `tiny' expansion is possible at point, do it. Otherwise activate the helper to generate a valid “tiny expression” and expand that. Usage: Call TINY-HELPER, ↵↵↵↵↵ -> 0 1 2 3 4 5 6 7 8 9 Call TINY-HELPER, 9↵2↵_↵+1*x2↵↵ -> 5_7_9_11_13_15_17_19 Call TINY-HELPER, 15↵1↵↵-30*2x↵%x↵ -> 1c 1a 18 16 14 12 10 e c a 8 6 4 2 0 (defalias 'tiny-helper #[(&optional end-val begin-val sep op fmt) "\306 \210\307 \204\325\310\311!\206\310\312! \204\313\202 \n\204$\313\202%\n \204.\313\202/ \f\2048\313\2029\f \204B\313\202C \314 !#\314\n!$\315%#$U\203p#\316U\203e\317\202\200\320\321\322\n #!\210\202\200#$W\203\200\320\321\323\n #!\210\n\313\230\204\216 \313\230\203\216\324 \313\230\204\230\325 P\326\n \f \260%\327\321\330\331\332\333\334#\331%\333\335#;\203\275\331\333\335#\202\311\331\336\333\335#\337\331\340\333\335#Q$!\210%c\210\341 \210. \342 \207" [tiny-key-binding end-val begin-val sep op fmt barf-if-buffer-read-only tiny-mapconcat substitute-command-keys "\\[tiny-helper]" "\\[tiny-expand]" "" string-to-number nil 0 "9" user-error format "Begin value (%s) and End value (%s) cannot be the same" "End value (%s) has to be greater than the begin value (%s)" " " "|" "m" message "This %s expansion can also be done by typing %s and then %s" propertize "tiny" face font-lock-function-name-face font-lock-keyword-face "M-x tiny-helper" " or " "M-x tiny-expand" undo-boundary tiny-expand end-val-num begin-val-num tiny-expr] 11 (#$ . 6361) (byte-code "\301 \206\302 ?\205-\303\304\305\306#\307\310P!\307\311P!\307\312P!\307\313P!\307\314P!\257)\207" [prompt barf-if-buffer-read-only tiny-mapconcat propertize "tiny-helper: " face font-lock-function-name-face read-string "END value [Hit RET for default=0; Auto-set to 9 if both begin and end values are 0]: " "BEGIN value [Hit RET for default=0; Has to be *smaller* than the end value]: " "Separator [Hit RET for default=Space; eg: \\n; No math operators like - or = allowed]: " "Lisp Operation [Hit RET for default=\"\" (no Lisp operation); Parentheses are optional; eg: *xx | (+ x ?A) | *2+3x]: " "Format [Hit RET for default=\"\" (%0d); eg: %x | 0x%x | %c | %s | %(+ x x) | %014.2f | %03d; Parentheses required here for sexps]: "] 7)]) (provide 'tiny)