;ELC ;;; Compiled ;;; in Emacs version 27.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\306DD\307\310\311\312\313\314\315& \210\302\316\304\305\317DD\320\310\321\312\313\314\322& \210\302\323\304\305\324DD\325\310\311\312\313\314\326& \210\302\327\304\305\330DD\331\310\321\312\313\314\332& \210\302\333\304\305\334DD\335\310\321\312\313\314\336& \210\302\337\304\305\340DD\341\310\321\312\313\314\342& \210\302\343\304\305\344DD\345\310\321\312\313\314\346& \210\302\347\304\305\350DD\351\310\321\312\313\314\352& \210\302\353\304\305\354DD\355\310\321\312\313\314\356& \207" [require electric custom-declare-variable electric-pair-pairs funcall function #[0 "\301@A@B\3028\3038BE\207" [electric-quote-chars (34 . 34) 2 3] 5] "Alist of pairs that should be used regardless of major mode.\n\nPairs of delimiters in this list are a fallback in case they have\nno syntax relevant to `electric-pair-mode' in the mode's syntax\ntable.\n\nSee also the variable `electric-pair-text-pairs'." :version "24.1" :group electricity :type (repeat (cons character character)) electric-pair-text-pairs #[0 "\301@A@B\3028\3038BE\207" [electric-quote-chars (34 . 34) 2 3] 5] "Alist of pairs that should always be used in comments and strings.\n\nPairs of delimiters in this list are a fallback in case they have\nno syntax relevant to `electric-pair-mode' in the syntax table\ndefined in `electric-pair-text-syntax-table'." "24.4" (repeat (cons character character)) electric-pair-skip-self #[0 "\300\207" [electric-pair-default-skip-self] 1] "If non-nil, skip char instead of inserting a second closing paren.\n\nWhen inserting a closing paren character right before the same character,\njust skip that character instead, so that hitting ( followed by ) results\nin \"()\" rather than \"())\".\n\nThis can be convenient for people who find it easier to hit ) than C-f.\n\nCan also be a function of one argument (the closer char just\ninserted), in which case that function's return value is\nconsidered instead." (choice (const :tag "Never skip" nil) (const :tag "Help balance" electric-pair-default-skip-self) (const :tag "Always skip" t) function) electric-pair-inhibit-predicate #[0 "\300\207" [electric-pair-default-inhibit] 1] "Predicate to prevent insertion of a matching pair.\n\nThe function is called with a single char (the opening char just inserted).\nIf it returns non-nil, then `electric-pair-mode' will not insert a matching\ncloser." (choice (const :tag "Conservative" electric-pair-conservative-inhibit) (const :tag "Help balance" electric-pair-default-inhibit) (const :tag "Always pair" ignore) function) electric-pair-preserve-balance #[0 "\300\207" [t] 1] "Non-nil if default pairing and skipping should help balance parentheses.\n\nThe default values of `electric-pair-inhibit-predicate' and\n`electric-pair-skip-self' check this variable before delegating to other\npredicates responsible for making decisions on whether to pair/skip some\ncharacters based on the actual state of the buffer's parentheses and\nquotes." boolean electric-pair-delete-adjacent-pairs #[0 "\300\207" [t] 1] "If non-nil, backspacing an open paren also deletes adjacent closer.\n\nCan also be a function of no arguments, in which case that function's\nreturn value is considered instead." (choice (const :tag "Yes" t) (const :tag "No" nil) function) electric-pair-open-newline-between-pairs #[0 "\300\207" [t] 1] "If non-nil, a newline between adjacent parentheses opens an extra one.\n\nCan also be a function of no arguments, in which case that function's\nreturn value is considered instead." (choice (const :tag "Yes" t) (const :tag "No" nil) function) electric-pair-skip-whitespace #[0 "\300\207" [t] 1] "If non-nil skip whitespace when skipping over closing parens.\n\nThe specific kind of whitespace skipped is given by the variable\n`electric-pair-skip-whitespace-chars'.\n\nThe symbol `chomp' specifies that the skipped-over whitespace\nshould be deleted.\n\nCan also be a function of no arguments, in which case that function's\nreturn value is considered instead." (choice (const :tag "Yes, jump over whitespace" t) (const :tag "Yes, and delete whitespace" chomp) (const :tag "No, no whitespace skipping" nil) function) electric-pair-skip-whitespace-chars #[0 "\300\301\302E\207" [9 32 10] 3] "Whitespace characters considered by `electric-pair-skip-whitespace'." (choice (set (const :tag "Space" 32) (const :tag "Tab" 9) (const :tag "Newline" 10)) (list character))] 10) #@232 Function to use to skip whitespace forward. Before attempting a skip, if `electric-pair-skip-whitespace' is non-nil, this function is called. It move point to a new buffer position, presumably skipping only whitespace in between. (defvar electric-pair-skip-whitespace-function 'electric-pair--skip-whitespace (#$ . 4836)) (make-variable-buffer-local 'electric-pair-skip-whitespace-function) #@69 Skip whitespace forward, not crossing comment or string boundaries. (defalias 'electric-pair--skip-whitespace #[0 "`\301\302 8\303\304\"\305w\210\211\301\302 8=?\205b\207" [electric-pair-skip-whitespace-chars 8 syntax-ppss apply string nil] 5 (#$ . 5234)]) #@227 Syntax table used when pairing inside comments and strings. `electric-pair-mode' considers this syntax table only when point in inside quotes or comments. If lookup fails here, `electric-pair-text-pairs' will be considered. (defvar electric-pair-text-syntax-table prog-mode-syntax-table (#$ . 5502)) #@13 (fn CHAR) (defalias 'electric-pair-conservative-inhibit #[257 "\211\300f=\206 \211`Sf=\203\211`S\206`Sf=\206 gz\301=\207" [nil 119] 3 (#$ . 5810)]) #@363 Calculate a list (SYNTAX PAIR UNCONDITIONAL STRING-OR-COMMENT-START). SYNTAX is COMMAND-EVENT's syntax character. PAIR is COMMAND-EVENT's pair. UNCONDITIONAL indicates the variables `electric-pair-pairs' or `electric-pair-text-pairs' were used to lookup syntax. STRING-OR-COMMENT-START indicates that point is inside a comment or string. (fn COMMAND-EVENT) (defalias 'electric-pair-syntax-info #[257 "o\206\f\303\212\304`S!)8\303\304`!8\211\205\211\203\202 \305 \305 p\306\307\310\311\312\"\313\"\314$\216\315!\210z\316!\206B)D\266\202\203Q\317 \n\"\202R\n\236\320\"@\321>\203l\317\322D\"\202\227\203\214@A=\203\202\323 \324F\202\227\325A\324F\202\227\211\205\227\326@\324F\207" [electric-pair-text-syntax-table electric-pair-text-pairs electric-pair-pairs 8 syntax-ppss syntax-table make-byte-code 0 "r\301q\210\302\300!)\207" vconcat vector [set-syntax-table] 2 set-syntax-table matching-paren append rassq (34 40 41 36) nil 34 t 40 41] 14 (#$ . 5973)]) #@13 (fn CHAR) (defalias 'electric-pair--insert #[257 "\211\304\211\305\306\307!,\207" [electric-layout-allow-duplicate-newlines electric-pair-mode blink-matching-paren last-command-event nil t self-insert-command 1] 5 (#$ . 6992)]) #@421 Like `with-syntax-table', but flush the syntax-ppss cache afterwards. Use this instead of (with-syntax-table TABLE BODY) when BODY contains code which may update the syntax-ppss cache. This includes calling `parse-partial-sexp' and any sexp-based movement functions when `parse-sexp-lookup-properties' is non-nil. The cache is flushed from position START, defaulting to point. (fn (TABLE &optional START) &rest BODY) (defalias 'electric-pair--with-uncached-syntax '(macro . #[128 "\211\203 \211A\262\242\202\300\301\302GD\"\211\203!\211A\262\242\202(\300\301\302GD\"\211A\262\242\203=\300\301\302\303G\\D\"\210\304\305!\306\307\206H\310DD\311\312 BB\313DEE\262\207" [signal wrong-number-of-arguments electric-pair--with-uncached-syntax 2 make-symbol "start" let (syntax-propertize-function #'ignore) (point) unwind-protect with-syntax-table syntax-ppss-flush-cache] 11 (#$ . 7233)])) (byte-code "\300\301\302\303#\210\304\301\305\306#\300\207" [put electric-pair--with-uncached-syntax edebug-form-spec ((form &optional form) body) function-put lisp-indent-function 1] 4) #@200 Like `syntax-ppss', but sometimes fallback to `parse-partial-sexp'. WHERE is a list defaulting to '(string comment) and indicates when to fallback to `parse-partial-sexp'. (fn &optional POS WHERE) (defalias 'electric-pair--syntax-ppss #[512 "\206`\206\n\303\304!\3058\205\306>\3078\205\310>\203*\3118T\202=\211\205=\3118b\210\312d[!\210\313\314!\210`\211\203u\315\316\317\320\321\322!\323\"\324$\216\325 p\316\317\326\321\322\"\327\"\324$\216\330 !\210\331 \")\266\202*\266\202\202\204\n\332>\203\203\331e\"\202\204\207" [syntax-propertize-function electric-pair-text-syntax-table major-mode (string comment) syntax-ppss 3 string 4 comment 8 forward-comment skip-syntax-forward " >!" ignore make-byte-code 0 "\301\300!\207" vconcat vector [syntax-ppss-flush-cache] 2 syntax-table "r\301q\210\302\300!)\207" [set-syntax-table] set-syntax-table parse-partial-sexp (c-mode c++ mode)] 19 (#$ . 8339)]) #@512 Examine lists forward or backward according to DIRECTION's sign. STRING-OR-COMMENT is info suitable for running `parse-partial-sexp'. Return a cons of two descriptions (MATCHED-P . PAIR) for the innermost and outermost lists that enclose point. The outermost list enclosing point is either the first top-level or first mismatched list found by listing up. If the outermost list is matched, don't rely on its PAIR. If point is not enclosed by any lists, return ((t) . (t)). (fn DIRECTION STRING-OR-COMMENT) (defalias 'electric-pair--balance-info #[514 "\302C\302C\203\f\202\303 \304\305\212\242\204\225\3061b\307`\310\311\312\313\314!\315\"\316$\216\303 p\310\311\317\313\314\"\320\"\316$\216\321!\210\322`\f\311V\203Nd\202Pd[\"\210  \")\266\202*\266\2020\202\221\323\324A@\"\203w\203\200\325\326 8\204\200\"\202\217\3278b\210$\262\210\202)\242\242B\207" [electric-pair-text-syntax-table syntax-propertize-function nil syntax-table #[514 "\211\300C\240\210\242?\205\300C\240\207" [t] 4 "\n\n(fn INNERMOST OUTERMOST)"] #[1028 "`\212\301W\203Q\3021L\211f\303`\304\301\305\306\307!\310\"\311$\216\312 p\304\301\313\306\307\"\314\"\311$\216\315!\210\316\317`\320\"\206>`Sf!)\266\202*\266\202=0\202\214\210\321\202\214\322`S!\323\3248!@\211f\205\212\206f`Sf\312 p\304\301\313\306\307\"\325\"\311$\216\315!\210\316!)\266\202\206\211=\266\203)\301V\203\235`\206\230`Sf\202\237`f\242\204\252B\240\210?\205\264B\240\207" [syntax-propertize-function 0 (scan-error) ignore make-byte-code "\301\300!\207" vconcat vector [syntax-ppss-flush-cache] 2 syntax-table "r\301q\210\302\300!)\207" [set-syntax-table] set-syntax-table matching-paren scan-sexps 1 nil electric-pair--syntax-ppss last 9 [set-syntax-table]] 18 "\n\n(fn DIRECTION INNERMOST OUTERMOST TABLE)"] (scan-error) ignore make-byte-code 0 "\301\300!\207" vconcat vector [syntax-ppss-flush-cache] 2 "r\301q\210\302\300!)\207" [set-syntax-table] set-syntax-table scan-sexps string-match "ends prematurely" 8 syntax-ppss 3] 18 (#$ . 9283)]) #@272 Next buffer position where strings are syntactically unexpected. Value is a function called with no arguments and returning a buffer position. Major modes should set this variable buffer-locally if they experience slowness with `electric-pair-mode' when pairing quotes. (defvar electric-pair-string-bound-function 'point-max (#$ . 11377)) #@76 Return non-nil if there are unbalanced strings started by CHAR. (fn CHAR) (defalias 'electric-pair--unbalanced-strings-p #[257 "\301 \212\3028\203\303\3048b\210\305d!\210\306\307!\210`!\202 \301 !)\3108\211\311=\206-=\207" [electric-pair-string-bound-function syntax-ppss 4 electric-pair--syntax-ppss 8 forward-comment skip-syntax-backward " >!" 3 t] 6 (#$ . 11723)]) #@210 Return non-nil if point is inside a string started by CHAR. A comments text is parsed with `electric-pair-text-syntax-table'. Also consider strings within comments, but not strings within strings. (fn CHAR) (defalias 'electric-pair--inside-string-p #[257 "\300`\301\"\3028\303D>\207" [electric-pair--syntax-ppss (comment) 3 t] 5 (#$ . 12109)]) #@19 (fn &rest BODY) (defalias 'electric-pair--save-literal-point-excursion '(macro . #[128 "\300\301!\302\303BC\304\305B\306DEE\207" [make-symbol "point" let ((point)) unwind-protect progn goto-char] 8 (#$ . 12463)])) #@231 Return non-nil if auto-pairing of CHAR would hurt parentheses' balance. Works by first removing the character from the buffer, then doing some list calculations, finally restoring the situation as if nothing happened. (fn CHAR) (defalias 'electric-pair-inhibit-if-helps-balance #[257 "\304!\211:\205\224\211@A\211:\205\222\211@A\211:\205\220\211A\211:\205\216\211@A\211?\205\214\3052\212\306 \307\211\307C\310\311\312\313\314 \"\315\"\316$\216\317!\210\320\321!\210\322\305\323\267\202\200\324\325 \"\211A\211@\203o\307\202t\211A =\266\202\202\201\326!\202\201\307\"\327\240\210,\266\2050\266\203\266\202\262\266\202\266\202\207" [most-positive-fixnum undo-strong-limit undo-limit undo-outer-limit electric-pair-syntax-info done prepare-change-group nil make-byte-code 0 "\301\242\203 \302\300!\207\303\300!\207" vconcat vector [accept-change-group cancel-change-group] 2 activate-change-group delete-char -1 throw #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (40 95 34 121)) electric-pair--balance-info 1 electric-pair--unbalanced-strings-p t] 24 (#$ . 12689)]) #@226 Return non-nil if skipping CHAR would benefit parentheses' balance. Works by first removing the character from the buffer, then doing some list calculations, finally restoring the situation as if nothing happened. (fn CHAR) (defalias 'electric-pair-skip-if-helps-balance #[257 "\300!\211:\205y\211@A\211:\205w\211@A\211:\205u\211A\211:\205s\211@A\211?\205q\301\302\303\304\305!\306\"\307$\216\310\311!\210\211\312\267\202m\313\311\"\211@A\211@\203W@\202a@\205a\211A=?\266\203\202n\314\f!\202n\315)\266\203\266\202\262\266\202\266\202\207" [electric-pair-syntax-info make-byte-code 0 "\300c\207" vconcat vector [] 1 delete-char -1 #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (41 69 34 102)) electric-pair--balance-info electric-pair--inside-string-p nil] 18 (#$ . 13840)]) #@13 (fn CHAR) (defalias 'electric-pair-default-skip-self #[257 "\203\301!\207\302\207" [electric-pair-preserve-balance electric-pair-skip-if-helps-balance t] 3 (#$ . 14688)]) #@13 (fn CHAR) (defalias 'electric-pair-default-inhibit #[257 "\203\301!\207\302!\207" [electric-pair-preserve-balance electric-pair-inhibit-if-helps-balance electric-pair-conservative-inhibit] 3 (#$ . 14871)]) (defalias 'electric-pair-post-self-insert-function #[0 "\205\306 \307\310 !\311:\203\246@A\211:\203\237\211@A\211:\203\230\211@A\211:\203\220\211A\211\204N \204>\307\202I\211\312>\203\211\313 \203\211\211\314=\204i\211\315=\203\\`\316 Y\204i\211\315=\204u\316 `Y\203u\212\316 b\210\317!)\202I \211S|\210\317!\210\316 b\210\317 !\202I\212 Sb\210\320\321!\322\246\323U)\204\236\307\202I\211\324>\203\204\314\325\n!\203\310`\326\323\327\330\331!\332\"\333$\216b\210\n !)\262\202\311\n\203\212\203\327\211\314=\204\362 \334=\204\350\325 !\203\350 \202\351 \211\262\203\362\f \210\307f )=\203\f\203\f \210 S \334=\203`\202|\210\307u\202I\211\335>\205I ?\205I\204D`\326\323\327\330\331!\332\"\333$\216b\210$ !)\262?\205I\212\317!)\266\203\202\213\325%!\203[% \202]%\205\213 \336=\205\213\337eT`d#\205\213\212\340\307x\210`S\206z`Sf)\341\307f!=\205\213\212\342\333\343\")\262\202\223 \266\202\202\232 \266\202\202\241 \266\202\202\250\211 \266\202\207" [electric-pair-mode last-command-event electric-pair-skip-self electric-pair-skip-whitespace electric-pair-skip-whitespace-function overwrite-mode electric--after-char-pos nil electric-pair-syntax-info #[0 "\302!\203  \202\f\205: \303=\205:\304eT`d#\205:\212\305\306x\210`S\206)`Sf)\307\306f!=\205:\212\310\311\312\")\207" [electric-pair-open-newline-between-pairs last-command-event functionp 10 < #1=" " nil matching-paren newline 1 t] 4] (40 41 34 36) use-region-p 34 41 mark electric-pair--insert skip-syntax-backward "\\" 2 0 (41 34 36) functionp make-byte-code "\300b\207" vconcat vector [] 1 chomp (40 34 36) 10 < #1# matching-paren newline t electric-pair-inhibit-predicate electric-pair-open-newline-between-pairs] 21]) (defalias 'electric-pair-will-use-region #[0 "\301 \205 \302!@\303>\207" [last-command-event use-region-p electric-pair-syntax-info (40 41 34 36)] 2]) #@170 When between adjacent paired delimiters, delete both of them. ARG and KILLP are passed directly to `backward-delete-char-untabify', which see. (fn ARG &optional KILLP) (defalias 'electric-pair-delete-pair #[513 "\300\301!\210\302\"\207" [delete-char 1 backward-delete-char-untabify] 5 (#$ . 17031) "*p\nP"]) #@38 Keymap used by `electric-pair-mode'. (defvar electric-pair-mode-map (byte-code "\300 \301\302\303\304\305\306\307\257#\210\211\207" [make-sparse-keymap define-key "" menu-item "" electric-pair-delete-pair :filter #[257 "`Sf\301f\205\f\302!\211@A@\2055\211\2055\303>\2055\211=\2055\304!\2030 \2021\2055\207" [electric-pair-delete-adjacent-pairs nil electric-pair-syntax-info (40 34 36) functionp] 8 "\n\n(fn CMD)"]] 9) (#$ . 17348)) (byte-code "\300\301\302\303\304DD\305\306\307\310\311\312\313\314\315& \207" [custom-declare-variable electric-pair-mode funcall function #[0 "\300\207" [nil] 1] "Non-nil if Electric-Pair mode is enabled.\nSee the `electric-pair-mode' command\nfor a description of this minor mode.\nSetting this variable directly does not take effect;\neither customize it (see the info node `Easy Customization')\nor call the function `electric-pair-mode'." :set custom-set-minor-mode :initialize custom-initialize-default :group electricity :type boolean] 12) #@686 Toggle automatic parens pairing (Electric Pair mode). If called interactively, enable Electric-Pair mode if ARG is positive, and disable it if ARG is zero or negative. If called from Lisp, also enable the mode if ARG is omitted or nil, and toggle it if ARG is `toggle'; disable the mode otherwise. Electric Pair mode is a global minor mode. When enabled, typing an open parenthesis automatically inserts the corresponding closing parenthesis, and vice versa. (Likewise for brackets, etc.). If the region is active, the parentheses (brackets, etc.) are inserted around the region instead. To toggle the mode in a single buffer, use `electric-pair-local-mode'. (fn &optional ARG) (defalias 'electric-pair-mode #[256 "\301 \302\300\303=\203\304\300!?\202\305!\306V\"\210\203*\307\310\311\312#\210\307\313\314\"\210\2024\315\310\311\"\210\315\313\314\"\210\316\317\304\300!\203@\320\202A\321\"\210\322\323!\203k\324\300!\210\301 \203Y\211\301 \232\203k\325\326\327\304\300!\203f\330\202g\331#\266\210\332 \210\304\300!\207" [electric-pair-mode current-message set-default toggle default-value prefix-numeric-value 0 add-hook post-self-insert-hook electric-pair-post-self-insert-function 50 self-insert-uses-region-functions electric-pair-will-use-region remove-hook run-hooks electric-pair-mode-hook electric-pair-mode-on-hook electric-pair-mode-off-hook called-interactively-p any customize-mark-as-set "" message "Electric-Pair mode %sabled%s" "en" "dis" force-mode-line-update] 7 (#$ . 18355) (byte-code "\206\301C\207" [current-prefix-arg toggle] 1)]) (defvar electric-pair-mode-hook nil) (byte-code "\301\302N\204\f\303\301\302\304#\210\305\306\307\310\300!\205\307\211%\207" [electric-pair-mode-map electric-pair-mode-hook variable-documentation put "Hook run after entering or leaving `electric-pair-mode'.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" add-minor-mode electric-pair-mode nil boundp] 6) #@322 Toggle `electric-pair-mode' only in this buffer. If called interactively, enable Electric-Pair-Local mode if ARG is positive, and disable it if ARG is zero or negative. If called from Lisp, also enable the mode if ARG is omitted or nil, and toggle it if ARG is `toggle'; disable the mode otherwise. (fn &optional ARG) (defalias 'electric-pair-local-mode #[256 "\301 p\302=\203\303\300p\"?\202\304!\305Vrq\210\306\300!\210\211)\266\307\300!=\2032\310\300!\210\202A\307\300!\204A\300\311!\210\312\300\313\"\210\314\315\303\300p\"\203N\316\202O\317\"\210\320\321!\203v\301 \203c\211\301 \232\203v\322\323\324\303\300p\"\203q\325\202r\326#\266\210\327 \210\303\300p\"\207" [electric-pair-mode current-message toggle buffer-local-value prefix-numeric-value 0 make-local-variable default-value kill-local-variable 1 set-default nil run-hooks electric-pair-local-mode-hook electric-pair-local-mode-on-hook electric-pair-local-mode-off-hook called-interactively-p any " in current buffer" message "Electric-Pair-Local mode %sabled%s" "en" "dis" force-mode-line-update] 8 (#$ . 20381) (byte-code "\206\301C\207" [current-prefix-arg toggle] 1)]) (defvar electric-pair-local-mode-hook nil) (byte-code "\300\301N\204\f\302\300\301\303#\210\304\305!\207" [electric-pair-local-mode-hook variable-documentation put "Hook run after entering or leaving `electric-pair-local-mode'.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" provide elec-pair] 4)