;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\303\304\305\306\307DD\310\311\312\313\314&\210\315\304\316\317#\210\303\320\305\306\321DD\322\311\312\313\314&\210\315\320\316\317#\210\303\323\305\306\324DD\325\311\312\313\314&\210\315\323\316\317#\210\303\326\305\306\327DD\330\311\312\313\314&\210\315\326\316\317#\210\303\331\305\306\332DD\333\311\312\313\314&\210\315\331\316\317#\207" [require cl-lib dash custom-declare-variable bui-true-string funcall function #[0 "\300\207" [#1="Yes"] 1 #1#] "String used if the value of a parameter is t." :type string :group bui put permanent-local t bui-false-string #[0 "\300\207" [#2="No"] 1 #2#] "String used if the value of a boolean parameter is nil." bui-empty-string #[0 "\300\207" [#3="—"] 1 #3#] "String used if the value of a non-boolean parameter is nil." bui-list-separator #[0 "\300\207" [#4=", "] 1 #4#] "String used to separate list values." bui-time-format #[0 "\300\207" [#5="%F %T"] 1 #5#] "String used to format time values.\nFor possible formats, see `format-time-string'."] 8) #@98 Return STRING propertized with FACE font-lock-face if it is non nil. (fn STRING &optional FACE) (defalias 'bui-propertize-maybe #[513 "\211\203\n\300\301#\207\207" [propertize font-lock-face] 6 (#$ . 1127)]) #@369 Convert VALUE into a string and return it. VALUE can be an expression of any type. If VALUE is t/nil, it is replaced with `bui-true-string'/`bui-empty-string'. If VALUE is list, its elements are concatenated using `bui-list-separator'. If FACE is non-nil, propertize returned string with this FACE. If VALUE is nil, it is not propertized. (fn VALUE &optional FACE) (defalias 'bui-get-string #[513 "\204\207<\203\303\304\305\" #\207;\203\2025\306=\203'\n\2025\247\2032\307!\2025\310!\311\"\207" [bui-empty-string bui-list-separator bui-true-string mapconcat make-closure #[257 "\301\302!\300\"\207" [V0 bui-propertize-maybe bui-get-string] 4 "\n\n(fn VAL)"] t number-to-string prin1-to-string bui-propertize-maybe] 6 (#$ . 1347)]) #@102 Return `bui-empty-string' if VALUE is nil, evaluate BODY otherwise. (fn &optional VALUE &rest BODY) (defalias 'bui-get-non-nil '(macro . #[384 "\300\301D\302BBB\207" [if null bui-empty-string] 6 (#$ . 2112)])) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put bui-get-non-nil lisp-indent-function 1 put edebug-form-spec t] 5) #@102 Insert `bui-empty-string' if VALUE is nil, evaluate BODY otherwise. (fn &optional VALUE &rest BODY) (defalias 'bui-insert-non-nil '(macro . #[384 "\300\301D\302BBB\207" [if null (insert bui-empty-string)] 6 (#$ . 2464)])) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put bui-insert-non-nil lisp-indent-function 1 put edebug-form-spec t] 5) #@155 Return formatted time string from TIME using `bui-time-format'. TIME can be either a time value (list), a number of seconds, or a time string. (fn TIME) (defalias 'bui-get-time-string #[257 "\211<\203 \211\202#\211\247\203\301!\202#\211;\203\302!\202#\303\304\"\305\"\207" [bui-time-format seconds-to-time date-to-time error "Unknown time format: %S" format-time-string] 5 (#$ . 2831)]) #@57 Return one-line string from a multi-line STR. (fn STR) (defalias 'bui-get-one-line #[257 "\300\301\302#\207" [replace-regexp-in-string "\n" " "] 5 (#$ . 3238)]) #@58 Return string by filling STR to COLUMN. (fn STR COLUMN) (defalias 'bui-get-filled-string #[514 "\301\302\303\"r\211q\210\304\305\"\216c\210\306ed\"\210)\307 *\207" [fill-column generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] fill-region buffer-string] 6 (#$ . 3407)]) #@145 Split string STR by lines and return a list of the resulting strings. If COLUMN is non-nil, fill STR to this column. (fn STR &optional COLUMN) (defalias 'bui-split-string #[513 "\211\203 \300\"\202\f\301\302\303#\207" [bui-get-filled-string split-string "\n *" t] 7 (#$ . 3751)]) (byte-code "\300\301\302\303\304DD\305\306\307\310\311&\207" [custom-declare-variable bui-indent funcall function #[0 "\300\207" [2] 1] "Number of spaces used to indent various parts of inserted text." :type integer :group bui-info] 8) #@88 Return `bui-indent' "multiplied" by LEVEL (1 by default) spaces. (fn &optional LEVEL) (defalias 'bui-get-indent #[256 "\301\206\302_\303\"\207" [bui-indent make-string 1 32] 4 (#$ . 4281)]) #@78 Insert `bui-indent' spaces LEVEL times (1 by default). (fn &optional LEVEL) (defalias 'bui-insert-indent #[256 "\300!c\207" [bui-get-indent] 3 (#$ . 4482)]) #@72 Insert N (1 by default) number of newlines at point. (fn &optional N) (defalias 'bui-newline #[256 "\211\206\300\301\302W\205\262T\262\303c\210\202\207" [1 0 nil "\n"] 6 (#$ . 4647)]) #@92 Evaluate BODY and indent inserted text by INDENT number of spaces. (fn INDENT &rest BODY) (defalias 'bui-with-indent '(macro . #[385 "\300\301!\300\302!\303\304BDD\305\306\307D\310\311 FEC\"BB\207" [make-symbol "region-beg" "indent" let ((point)) append unless zerop indent-rigidly (point)] 14 (#$ . 4850)])) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put bui-with-indent lisp-indent-function 1 put edebug-form-spec t] 5) #@183 Convert VALUE into a string and insert it at point. If FACE is non-nil, propertize VALUE with FACE. If FORMAT is non-nil, format VALUE with FORMAT. (fn VALUE &optional FACE FORMAT) (defalias 'bui-format-insert #[769 "\300\"\203\301\"\202\211c\207" [bui-get-string format] 7 (#$ . 5309)]) #@401 Like `mapconcat' but for inserting text. Apply FUNCTION to each element of SEQUENCE, and insert SEPARATOR at point between each FUNCTION call. If INDENT is non-nil, it should be a number of spaces used to indent each line of the inserted text. If COLUMN is non-nil, it should be a column number which shouldn't be exceeded by the inserted text. (fn FUNCTION SEQUENCE SEPARATOR &key INDENT COLUMN) (defalias 'bui-mapinsert #[899 "\300\301\"A@\300\302\"A@:\205w\242\243\206\303\205#Z` !\210\211\203h\211@\n\2058`c\210 \205B`!\210\f\203_iV\203_\212|\210b\210\304 \210)\266A\266\202\202,\210\211\303U?\205u\305`#\266\210\207" [plist-member :indent :column 0 bui-newline indent-rigidly] 20 (#$ . 5614)]) #@325 Convert VALUE into a string, split it and insert at point. If FACE is non-nil, propertize returned string with this FACE. If COLUMN is non-nil and result string is a one-line string longer than COLUMN, split it into several short lines. Separate inserted lines with SEPARATOR. (fn VALUE &optional FACE COLUMN SEPARATOR) (defalias 'bui-split-insert #[1025 "\204c\207\301\302\"\"\303\304\206\305#\207" [bui-empty-string bui-split-string bui-get-string bui-mapinsert insert ""] 9 (#$ . 6367)]) (byte-code "\300\301\302\303\304DD\305\306\307\310\311&\207" [custom-declare-variable bui-find-file-function funcall function #[0 "\300\207" [find-file] 1] "Function used to find a file.\nThe function is called by `bui-find-file' with a file name as a\nsingle argument." :type (choice (function-item find-file) (function-item org-open-file) (function :tag "Other function")) :group bui] 8) #@69 Find FILE (using `bui-find-file-function') if it exists. (fn FILE) (defalias 'bui-find-file #[257 "\301!\203\n!\207\302\303\"\207" [bui-find-file-function file-exists-p message "File '%s' does not exist."] 4 (#$ . 7270)]) #@68 Transform KEYWORD into symbol (without leading ':'). (fn KEYWORD) (defalias 'bui-keyword->symbol #[257 "\300\301!\302\303O!\207" [intern symbol-name 1 nil] 5 (#$ . 7504)]) #@76 Return SYMBOL if its value is not void, otherwise return nil. (fn SYMBOL) (defalias 'bui-symbol-if-bound #[257 "\300!\205\211\207" [boundp] 3 (#$ . 7684)]) #@82 Return symbol by appending SYMBOLS separating them with '-'. (fn &rest SYMBOLS) (defalias 'bui-make-symbol #[128 "\300\301\302\303#!\207" [intern mapconcat symbol-name "-"] 6 (#$ . 7850)]) #@87 Return SYMBOL's name, a string. This is like `symbol-name', but fancier. (fn SYMBOL) (defalias 'bui-symbol-title #[257 "\211\300=\203\301\207\302\303\304\305!#\306\307\310O!\310\311OP\207" [id "ID" replace-regexp-in-string "-" " " symbol-name capitalize 0 1 nil] 6 (#$ . 8047)]) #@768 Parse ARGS, bind variables from VARLIST and eval BODY. Find keyword values in ARGS, bind them to variables according to VARLIST, then evaluate BODY. ARGS is a keyword/value property list. Each element of VARLIST has a form: (SYMBOL KEYWORD [DEFAULT-VALUE]) SYMBOL is a variable name. KEYWORD is a symbol that will be searched in ARGS for an according value. If the value of KEYWORD does not exist, bind SYMBOL to DEFAULT-VALUE or nil. The rest arguments (that present in ARGS but not in VARLIST) will be bound to `%foreign-args' variable. Example: (bui-plist-let '(:two 8 :great ! :bui is) ((one :one 1) (two :two 2) (foo :smth)) (list one two foo %foreign-args)) => (1 8 nil (:bui is :great !)) (fn ARGS VARLIST &rest BODY) (defalias 'bui-plist-let '(macro . #[642 "\300\301!\302\303\304\305\"D\306B\"\307\310\311\312\313\303\304\314\"\315\"BB\316 \317BBEEEBBB\207" [make-symbol "args" let append mapcar #[257 "\211\242\243\211\243\211\242\243D\207" [] 10 "\n\n(fn SPEC)"] (%foreign-args) while pcase `(,key ,val \, rest-args) cl-case key #[257 "\211\242\243\211\242\243\211\243\211\300\301BBD\207" [setq (val)] 12 "\n\n(fn SPEC)"] ((t (setq %foreign-args (cl-list* key val %foreign-args)))) setq (rest-args)] 17 (#$ . 8339)])) (byte-code "\300\301\302\303#\300\207" [function-put bui-plist-let lisp-indent-function 2] 4) #@106 Apply FUNCTION to each keyword/value pair from PLIST. Return a list of the results. (fn FUNCTION PLIST) (defalias 'bui-map-plist #[514 "\211:\205$\211\242\243\211:\205\"\211\242\243\"\300\n\"B\266\205\266\202\207" [bui-map-plist] 13 (#$ . 9733)]) #@83 Define NAME function to access alist values using ASSOC-FUN. (fn NAME ASSOC-FUN) (defalias 'bui-define-alist-accessor '(macro . #[514 "\300\301\302\303\"\304\305\306\307\310\nD\311\n\312BD\313BBBF\257\207" [defun (alist &rest keys) format "Return value from ALIST by KEYS using `%s'.\nALIST is alist of alists of alists ... which can be consecutively\naccessed with KEYS." if (or (null alist) (null keys)) alist apply function cdr ((car keys) alist) ((cdr keys))] 14 (#$ . 10000)])) #@156 Return value from ALIST by KEYS using `assq'. ALIST is alist of alists of alists ... which can be consecutively accessed with KEYS. (fn ALIST &rest KEYS) (defalias 'bui-assq-value #[385 "\203\211\204\n\207\300\301@\236AA#\207" [apply bui-assq-value] 6 (#$ . 10496)]) #@157 Return value from ALIST by KEYS using `assoc'. ALIST is alist of alists of alists ... which can be consecutively accessed with KEYS. (fn ALIST &rest KEYS) (defalias 'bui-assoc-value #[385 "\203\211\204\n\207\300\301\302@\"AA#\207" [apply bui-assoc-value assoc] 7 (#$ . 10779)]) #@44 Return fill column for the current window. (defalias 'bui-fill-column #[0 "\301 ^\207" [fill-column window-width] 2 (#$ . 11072)]) #@133 Apply PREDICATES to all elements from LIST. Return a list of elements which satisfy all the PREDICATES. (fn LIST &rest PREDICATES) (defalias 'bui-filter #[385 "\211\204\207\300\301\302\"\"\207" [-filter make-closure #[257 "\301\300\302\303\211\211\2033\211A\262\242\262\262\211\262\2033!\211\262\2033\262\262T\262\202\266\211\262\205<\301\207" [V0 t 0 nil] 9 "\n\n(fn ELEMENT)"]] 6 (#$ . 11211)]) #@130 Put STRING into `kill-ring'. If NO-MESSAGE? is non-nil, do not display a message about it. (fn STRING &optional NO-MESSAGE\=\?) (defalias 'bui-copy-as-kill #[513 "\300!\210\211?\205 \301\302\"\207" [kill-new message "'%s' has been added to the kill ring."] 5 (#$ . 11647)]) #@422 Define `NAME' and `NAME-faces' customization groups. NAME should be a symbol. Remaining arguments (ARGS) should have a form [KEYWORD VALUE] ... Optional keywords: - `:parent-group' - name of a parent custom group. - `:parent-faces-group' - name of a parent custom faces group. - `:group-doc' - docstring of the `NAME' group. - `:faces-group-doc' - docstring of the `NAME-faces' group. (fn NAME &rest ARGS) (defalias 'bui-define-groups '(macro . #[385 "\300!\301\302P!\303\304\305\306\"\305\307\"\310\203^:\203\242\243\211:\203Y\211\242\243\311\267\202M\262 \202U\262\f\202U\262 \202U\262\n\202U BB\262\262\266\266\202\312\313 \310\314\315\fD\257\313 \310\314\315D\314\315D\257E\207" [symbol-name intern "-faces" bui bui-faces format "Settings for '%s' buffers." "Faces for '%s' buffers." nil #s(hash-table size 4 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (:parent-group 53 :parent-faces-group 59 :group-doc 65 :faces-group-doc 71)) progn defgroup :group quote] 21 (#$ . 11932)])) (byte-code "\300\301\302\303#\300\207" [function-put bui-define-groups lisp-indent-function 1] 4) #@291 Return `defvar' clause for SYMBOL inheriting it from PARENT symbol. Take docstring and value (unless VALUE is specified) from PARENT. If custom GROUP is non-nil and PARENT symbol has custom type, return `defcustom' clause instead. (fn SYMBOL PARENT &key GROUP (VALUE nil VALUE-BOUND\=\?)) (defalias 'bui-inherit-defvar-clause #[642 "\300\301\"A@\300\302\"\211\205\211A@\303\262\203\211\202J\205$?\304\305\"\2037\211\306\307\n\"P\2028\211\205A\310N\203W\211\203W\211\311=\204W\312\313BB\202X\211\211\203o\314\f\315\316D\301\316D\257\207\317\fF\207" [plist-member :group :value t documentation-property variable-documentation format "\nIf nil, use `%S'." custom-type boolean choice ((const nil)) defcustom :type quote defvar] 21 (#$ . 13105)]) #@875 Call the interactive form of FUNCTION to (partially) apply arguments. Return FUNCTION, if it has no `interactive' form. Otherwise, return a new function that does the same as FUNCTION, except its arguments are fixed to the values obtained interactively during this FUNCTION call. Any `<>' symbols returned by the `interactive' form of FUNCTION will be used as the place holders for arguments of the returned function. Also, if the `interactive' form returns a '&rest symbol, this will be used in the arglist of the returned function. For example, the following call: (bui-apply-interactive (lambda (x y &rest z) (interactive (list (read-number "Factor: ") '<> '&rest '<>)) (* x (apply '+ y z)))) will prompt for a number, x, and return a function that takes any number of arguments, adds them together and multiplies the result by x. (fn FUNCTION) (defalias 'bui-apply-interactive #[257 "\300!\211\203D\301\302\303\304\305BBBD!\306\307\310\311\"\"\312\313\"\312\313\"C\313>\301\303\314\2034\315 D\2027\nC\306\316\317 \" \"\"E!\207\207" [interactive-form eval call-interactively lambda (&rest args) (args) mapcar #[257 "\211\300=\203 \301 \207\207" [<> gensym] 3 "\n\n(fn X)"] cl-remove-if-not #[257 "\211\300>\207" [(<> &rest)] 3 "\n\n(fn Y)"] remove &rest append apply make-closure #[257 "\211\301=\203\300\242\300\211\242A\240\210\242\207\2119\204\211<\203\302D\207\207" [V0 <> quote] 4 "\n\n(fn X)"]] 16 (#$ . 13900)]) (provide 'bui-utils)