HOME


sh-3ll 1.0
DIR:/proc/self/root/usr/share/emacs/26.1/lisp/emacs-lisp/
Upload File :
Current File : //proc/self/root/usr/share/emacs/26.1/lisp/emacs-lisp/subr-x.elc
;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.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


#@205 Internal implementation for `thread-first' and `thread-last'.
When Argument FIRST? is non-nil argument is threaded first, else
last.  FORMS are the expressions to be threaded.

(fn FIRST\=\? &rest FORMS)
(defalias 'internal--thread-argument '(macro . #[385 "\211:\203_\211@A\211:\203\\\211@\211:\203D\211@AA\211\300\f\211\2030BB\2028\301C\"BBBB\266\204\266\203\202WA\211\300	DBBB\266\203\262\262\202^@\207\211@\207" [internal--thread-argument append] 18 (#$ . 409)]))
#@283 Thread FORMS elements as the first argument of their successor.
Example:
    (thread-first
      5
      (+ 20)
      (/ 25)
      -
      (+ 40))
Is equivalent to:
    (+ (- (/ (+ 5 20) 25)) 40)
Note how the single `-' got converted into a list before
threading.

(fn &rest FORMS)
(defalias 'thread-first '(macro . #[128 "\300\301BB\207" [internal--thread-argument t] 4 (#$ . 919)]))
(byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put thread-first lisp-indent-function 1 put edebug-form-spec (form &rest [&or symbolp (sexp &rest form)])] 5)
#@281 Thread FORMS elements as the last argument of their successor.
Example:
    (thread-last
      5
      (+ 20)
      (/ 25)
      -
      (+ 40))
Is equivalent to:
    (+ 40 (- (/ 25 (+ 20 5))))
Note how the single `-' got converted into a list before
threading.

(fn &rest FORMS)
(defalias 'thread-last '(macro . #[128 "\300\301BB\207" [internal--thread-argument nil] 4 (#$ . 1484)]))
(byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put thread-last lisp-indent-function 1 put edebug-form-spec thread-first] 5)
#@116 Wrap ELT in a list if it is not one.
If ELT is of the form ((EXPR)), listify (EXPR) with a dummy symbol.

(fn ELT)
(defalias 'internal--listify #[257 "\2119\203	\211D\207\211A\204\300\301!@D\207\207" [make-symbol "s"] 3 (#$ . 2016)])
(put 'internal--listify 'byte-optimizer 'byte-compile-inline-expand)
#@49 Check BINDING is properly formed.

(fn BINDING)
(defalias 'internal--check-binding #[257 "\211G\300V\203\301\302\303B\"\210\207" [2 signal error "`let' bindings can have only one value-form"] 5 (#$ . 2330)])
(put 'internal--check-binding 'byte-optimizer 'byte-compile-inline-expand)
#@85 Build the conditional value form for BINDING using PREV-VAR.

(fn BINDING PREV-VAR)
(defalias 'internal--build-binding-value-form #[514 "@\211\300A@ED\207" [and] 7 (#$ . 2622)])
(put 'internal--build-binding-value-form 'byte-optimizer 'byte-compile-inline-expand)
#@72 Check and build a single BINDING with PREV-VAR.

(fn BINDING PREV-VAR)
(defalias 'internal--build-binding #[514 "\2119\203\211D\262\202\211A\204\300\301!@D\262\211G\302V\203)\303\304\305B\"\210@\211\306A@ED\207" [make-symbol "s" 2 signal error "`let' bindings can have only one value-form" and] 9 (#$ . 2895)])
#@70 Check and build conditional value forms for BINDINGS.

(fn BINDINGS)
(defalias 'internal--build-bindings #[257 "\300C\301\302\303\304\305\306!\307\"\310\311%\"\207" [t mapcar make-byte-code 257 "\301\300\242\"\300@\240\210\211\207" vconcat vector [internal--build-binding] 4 "\n\n(fn BINDING)"] 9 (#$ . 3229)])
#@183 Bind variables according to VARLIST and eval THEN or ELSE.
This is like `if-let' but doesn't handle a VARLIST of the form
(SYMBOL SOMETHING) specially.

(fn VARLIST THEN &rest ELSE)
(defalias 'if-let* '(macro . #[642 "\203\300\301!\211\262\302\303!@@BBBE\207\300\304E\207" [let* internal--build-bindings if last nil] 9 (#$ . 3552)]))
(byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put if-let* lisp-indent-function 2 put edebug-form-spec ((&rest [&or symbolp (symbolp form) (form)]) form body)] 5)
#@186 Bind variables according to VARLIST and conditionally eval BODY.
This is like `when-let' but doesn't handle a VARLIST of the form
(SYMBOL SOMETHING) specially.

(fn VARLIST &rest BODY)
(defalias 'when-let* '(macro . #[385 "\300\301!E\207" [if-let* macroexp-progn] 6 (#$ . 4081)]))
(byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put when-let* lisp-indent-function 1 put edebug-form-spec if-let*] 5)
#@195 Bind variables according to VARLIST and conditionally eval BODY.
Like `when-let*', except if BODY is empty and all the bindings
are non-nil, then the result is non-nil.

(fn VARLIST &rest BODY)
(defalias 'and-let* '(macro . #[385 "\300\203\"\301\302!\211\262\303\304!@@\211\262\206CBBE\202+\301\300\206)\305BB\207" [nil let* internal--build-bindings if last (t)] 8 (#$ . 4503)]))
(byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put and-let* lisp-indent-function 1 put edebug-form-spec ((&rest [&or symbolp (symbolp form) (form)]) body)] 5)
#@792 Bind variables according to SPEC and eval THEN or ELSE.
Each binding is evaluated in turn, and evaluation stops if a
binding value is nil.  If all are non-nil, the value of THEN is
returned, or the last form in ELSE is returned.

Each element of SPEC is a list (SYMBOL VALUEFORM) which binds
SYMBOL to the value of VALUEFORM.  An element can additionally be
of the form (VALUEFORM), which is evaluated and checked for nil;
i.e. SYMBOL can be omitted if only the test result is of
interest.  It can also be of the form SYMBOL, then the binding of
SYMBOL is checked for nil.

As a special case, a SPEC of the form (SYMBOL SOMETHING) is
interpreted like ((SYMBOL SOMETHING)). This exists for backward
compatibility with the old syntax that accepted only one
binding.

(fn SPEC THEN &rest ELSE)
(defalias 'if-let '(macro . #[642 "G\300X\203@<\204C\262\301\302!F\207" [2 if-let* macroexp-progn] 8 (#$ . 5078)]))
(byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put if-let lisp-indent-function 2 put edebug-form-spec ([&or (&rest [&or symbolp (symbolp form) (form)]) (symbolp form)] form body)] 5)
#@289 Bind variables according to SPEC and conditionally eval BODY.
Each binding is evaluated in turn, and evaluation stops if a
binding value is nil.  If all are non-nil, the value of the last
form in BODY is returned.

The variable list SPEC is the same as in `if-let'.

(fn SPEC &rest BODY)
(defalias 'when-let '(macro . #[385 "\300\301!E\207" [if-let macroexp-progn] 6 (#$ . 6201)]))
(byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put when-let lisp-indent-function 1 put edebug-form-spec if-let] 5)
#@70 Check whether HASH-TABLE is empty (has 0 elements).

(fn HASH-TABLE)
(defalias 'hash-table-empty-p #[257 "\300!\301U\207" [hash-table-count 0] 3 (#$ . 6721)])
(put 'hash-table-empty-p 'byte-optimizer 'byte-compile-inline-expand)
#@55 Return a list of keys in HASH-TABLE.

(fn HASH-TABLE)
(defalias 'hash-table-keys #[257 "\300C\301\302\303\304\305\306!\307\"\310\311%\"\210\211\242\237\207" [nil maphash make-byte-code 514 "\300\300\242B\240\207" vconcat vector [] 5 "\n\n(fn K --CL-VAR--)"] 9 (#$ . 6957)])
(put 'hash-table-keys 'byte-optimizer 'byte-compile-inline-expand)
#@57 Return a list of values in HASH-TABLE.

(fn HASH-TABLE)
(defalias 'hash-table-values #[257 "\300C\301\302\303\304\305\306!\307\"\310\311%\"\210\211\242\237\207" [nil maphash make-byte-code 514 "\300\300\242B\240\207" vconcat vector [] 5 "\n\n(fn --CL-VAR-- V)"] 9 (#$ . 7308)])
(put 'hash-table-values 'byte-optimizer 'byte-compile-inline-expand)
#@45 Check whether STRING is empty.

(fn STRING)
(defalias 'string-empty-p #[257 "\211\300\230\207" [""] 3 (#$ . 7665)])
(put 'string-empty-p 'byte-optimizer 'byte-compile-inline-expand)
#@69 Join all STRINGS using SEPARATOR.

(fn STRINGS &optional SEPARATOR)
(defalias 'string-join #[513 "\300\301#\207" [mapconcat identity] 6 (#$ . 7853)])
(byte-code "\300\301\302\303#\210\304\305\306\307#\210\310\305\306\311#\207" [put string-join byte-optimizer byte-compile-inline-expand defalias string-reverse reverse nil make-obsolete "25.1"] 4)
#@112 Trim STRING of leading string matching REGEXP.

REGEXP defaults to "[ \t\n\r]+".

(fn STRING &optional REGEXP)
(defalias 'string-trim-left #[513 "\300\301\206\302\303Q\"\203\304\305\306\211$\207\207" [string-match "\\`\\(?:" "[ 	\n
]+" "\\)" replace-match "" t] 7 (#$ . 8209)])
(put 'string-trim-left 'byte-optimizer 'byte-compile-inline-expand)
#@114 Trim STRING of trailing string matching REGEXP.

REGEXP defaults to  "[ \t\n\r]+".

(fn STRING &optional REGEXP)
(defalias 'string-trim-right #[513 "\300\301\206\302\303Q\"\203\304\305\306\211$\207\207" [string-match "\\(?:" "[ 	\n
]+" "\\)\\'" replace-match "" t] 7 (#$ . 8570)])
(put 'string-trim-right 'byte-optimizer 'byte-compile-inline-expand)
#@175 Trim STRING of leading and trailing strings matching TRIM-LEFT and TRIM-RIGHT.

TRIM-LEFT and TRIM-RIGHT default to "[ \t\n\r]+".

(fn STRING &optional TRIM-LEFT TRIM-RIGHT)
(defalias 'string-trim #[769 "\300\301\206	\302\303Q\"\203\304\305\306\211$\266\202\202\266\202\300\307\206&\302\310Q\"\2034\304\305\306\211$\207\207" [string-match "\\(?:" "[ 	\n
]+" "\\)\\'" replace-match "" t "\\`\\(?:" "\\)"] 10 (#$ . 8935)])
(put 'string-trim 'byte-optimizer 'byte-compile-inline-expand)
#@71 Check whether STRING is either empty or only whitespace.

(fn STRING)
(defalias 'string-blank-p #[257 "\301\302\303\304#)\207" [inhibit-changing-match-data "\\`[ 	\n
]*\\'" nil t string-match] 8 (#$ . 9443)])
(put 'string-blank-p 'byte-optimizer 'byte-compile-inline-expand)
#@59 Remove PREFIX from STRING if present.

(fn PREFIX STRING)
(defalias 'string-remove-prefix #[514 "\300\"\203
\211G\301O\207\207" [string-prefix-p nil] 5 (#$ . 9729)])
(put 'string-remove-prefix 'byte-optimizer 'byte-compile-inline-expand)
#@59 Remove SUFFIX from STRING if present.

(fn SUFFIX STRING)
(defalias 'string-remove-suffix #[514 "\300\"\203\211\301GGZO\207\207" [string-suffix-p 0] 6 (#$ . 9977)])
(byte-code "\300\301\302\303#\210\304\305!\207" [put string-remove-suffix byte-optimizer byte-compile-inline-expand provide subr-x] 4)