;ELC ;;; Compiled ;;; in Emacs version 26.3 ;;; 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\306\307\310\311&\210\302\312\304\313\306\307\310\311&\207" [require cc-mode custom-declare-variable electric-spacing-double-space-docs t "Enable double spacing of . in document lines - e,g, type '.' => get '. '." :type boolean :group electricity electric-spacing-docs "Enable electric-spacing in strings and comments."] 8) (defvar electric-spacing-rules '((61 . electric-spacing-self-insert-command) (60 . electric-spacing-<) (62 . electric-spacing->) (37 . electric-spacing-%) (43 . electric-spacing-+) (45 . electric-spacing--) (42 . electric-spacing-*) (47 . electric-spacing-/) (38 . electric-spacing-&) (124 . electric-spacing-self-insert-command) (58 . electric-spacing-:) (63 . electric-spacing-\?) (44 . electric-spacing-\,) (126 . electric-spacing-~) (46 . electric-spacing-\.))) (defalias 'electric-spacing-post-self-insert-function #[nil "\205 \n\236A\211\205\304 b\210\305\306!\210 )\207" [electric-spacing-mode last-command-event electric-spacing-rules rule electric--after-char-pos delete-char -1] 3]) (add-hook 'post-self-insert-hook 'electric-spacing-post-self-insert-function) #@111 Non-nil if Electric-Spacing mode is enabled. Use the command `electric-spacing-mode' to change this variable. (defvar electric-spacing-mode nil (#$ . 1555)) (make-variable-buffer-local 'electric-spacing-mode) #@441 Toggle automatic surrounding space insertion (Electric Spacing mode). With a prefix argument ARG, enable Electric Spacing mode if ARG is positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil. This is a local minor mode. When enabled, typing an operator automatically inserts surrounding spaces. e.g., `=' becomes ` = ',`+=' becomes ` += '. This is very handy for many programming languages. (defalias 'electric-spacing-mode #[(&optional arg) "\304  \305=\203\n?\202\306 !\307V\310\311\n\203\312\202\313\"\210\314\315!\203D\304 \2033\304 \232\203D\316\317\320\n\203?\321\202@\322 #\210))\323 \210\n\207" [#1=#:last-message arg electric-spacing-mode local current-message toggle prefix-numeric-value 0 run-hooks electric-spacing-mode-hook electric-spacing-mode-on-hook electric-spacing-mode-off-hook called-interactively-p any " in current buffer" message "Electric-Spacing mode %sabled%s" "en" "dis" force-mode-line-update] 4 (#$ . 1771) (list (or current-prefix-arg 'toggle))]) (defvar electric-spacing-mode-hook nil) (byte-code "\301\302N\204\f\303\301\302\304#\210\305\306\307\310\300!\205\311\211%\207" [electric-spacing-mode-map electric-spacing-mode-hook variable-documentation put "Hook run after entering or leaving `electric-spacing-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-spacing-mode " _+_" boundp nil] 6) #@43 Insert character with surrounding spaces. (defalias 'electric-spacing-self-insert-command #[nil "\301\302!!\207" [last-command-event electric-spacing-insert string] 3 (#$ . 3282)]) #@34 See `electric-spacing-insert-1'. (defalias 'electric-spacing-insert #[(op &optional only-where) "\303 \210\304 \203\305 \204\306!\207 \204\307\310\"\207\307\n\"\207" [op electric-spacing-docs only-where delete-horizontal-space electric-spacing-lispy-mode\? electric-spacing-document\? electric-spacing-lispy electric-spacing-insert-1 middle] 3 (#$ . 3470)]) #@278 Insert operator OP with surrounding spaces. e.g., `=' becomes ` = ', `+=' becomes ` += '. When `only-where' is 'after, we will insert space at back only; when `only-where' is 'before, we will insert space at front only; when `only-where' is 'middle, we will not insert space. (defalias 'electric-spacing-insert-1 #[(op &optional only-where) "\304=\203 \305 \261\207\306=\203 c\207\307=\203 \305\261\207n\310\311\312\313\312\314 \"\"!\315 \"\2048\n\2048\305c\210 \305\261\210\n\205C\316 )\207" [only-where op begin\? electric-spacing-rules before " " middle after looking-back regexp-opt mapcar char-to-string car line-beginning-position indent-according-to-mode] 7 (#$ . 3844)]) (defalias 'electric-spacing-c-types #[nil "\301P\207" [c-primitive-type-key "?"] 2]) (defalias 'electric-spacing-document\? #[nil "\300\301 8\207" [8 syntax-ppss] 2]) (defalias 'electric-spacing-lispy-mode\? #[nil "\300\301\302\303\304$\207" [derived-mode-p emacs-lisp-mode lisp-mode lisp-interaction-mode scheme-mode] 5]) #@173 We're in a Lisp-ish mode, so let's look for parenthesis. Meanwhile, if not found after ( operators are more likely to be function names, so let's not get too insert-happy. (defalias 'electric-spacing-lispy #[(op) "\212\301u\210\302\303!)\203\304\232\203\305\306\"\207\305\307\"\207\304\232\203&\305\310\"\207\305\306\"\207" [op -1 looking-at "(" "," electric-spacing-insert-1 middle after before] 3 (#$ . 4870)]) #@32 See `electric-spacing-insert'. (defalias 'electric-spacing-< #[nil "\203\f\301\302\303 \"\204\304\305!\203\306c\210\307u\207\310\311!\207" [c-buffer-is-cc-mode looking-back "\\(\\(?:#i\\(?:mport\\|nclude\\)\\|auto_ptr\\|const_cast\\|d\\(?:eque\\|ynmaic_cast\\)\\|hash_map\\|iterator\\|list\\|m\\(?:\\(?:ultim\\)?ap\\)\\|pair\\|reintepret_cast\\|s\\(?:et\\|ta\\(?:ck\\|tic_cast\\)\\)\\|template\\|vector\\)\\)\\ *" line-beginning-position derived-mode-p sgml-mode "<>" -1 electric-spacing-insert "<"] 3 (#$ . 5300)]) #@32 See `electric-spacing-insert'. (defalias 'electric-spacing-: #[nil "\203\301\302!\203\303\304!\207\303\304\305\"\207\306\307!\203\303\304!\207\303\304\310\"\207" [c-buffer-is-cc-mode looking-back "\\?.+" electric-spacing-insert ":" middle derived-mode-p haskell-mode after] 3 (#$ . 5828)]) #@32 See `electric-spacing-insert'. (defalias 'electric-spacing-\, #[nil "\300\301\302\"\207" [electric-spacing-insert "," after] 3 (#$ . 6131)]) #@32 See `electric-spacing-insert'. (defalias 'electric-spacing-\. #[nil "\203\302 \203\303\304\305\"\210\306c\207\307\310!\204; \203!\307\311!\204;\312\313\314\"\203.\307\315!\204;\312\316\317\"\203>\307\320!\203>\304c\207\312\321\322\314#\203R\307\304!\203O\304c\207\323c\207\303\304\305\"\210\306c\207" [electric-spacing-double-space-docs c-buffer-is-cc-mode electric-spacing-document\? electric-spacing-insert "." after " " looking-back "[0-9]" "[a-z]" derived-mode-p python-mode ruby-mode "[a-z)]" js-mode js2-mode "[a-z)$]" cperl-mode perl-mode " . "] 4 (#$ . 6278)]) #@32 See `electric-spacing-insert'. (defalias 'electric-spacing-& #[nil "\203!\301\302 \303P!\203\304\305\306\"\207\301\307!\203\304\305\310\"\207\304\305!\207\304\305!\207" [c-buffer-is-cc-mode looking-back electric-spacing-c-types " *" electric-spacing-insert "&" after "= *" before] 3 (#$ . 6867)]) #@32 See `electric-spacing-insert'. (defalias 'electric-spacing-* #[nil "\203:\301\302 \303P!\203\304\305\306\"\207\301\307!\203\304\305\310\"\207\301\311!\203+\304\305\310\"\210\312 \207\301\313!\2036\304\305\306\"\207\304\305!\207\304\305!\207" [c-buffer-is-cc-mode looking-back electric-spacing-c-types " *" electric-spacing-insert "*" before "\\* *" middle "^[ (]*" indent-according-to-mode "= *"] 3 (#$ . 7176)]) #@32 See `electric-spacing-insert'. (defalias 'electric-spacing-> #[nil "\203\301\302!\203\303\304!\210\305c\207\306\307!\207" [c-buffer-is-cc-mode looking-back " - " delete-char -3 "->" electric-spacing-insert ">"] 2 (#$ . 7603)]) #@32 See `electric-spacing-insert'. (defalias 'electric-spacing-+ #[nil "\203 \301\302!\203 \301\303!\203\212\304u\210\305 \210)\306\307\310\"\210\311 \207\306\307!\207" [c-buffer-is-cc-mode looking-back "\\+ *" "[a-zA-Z0-9_] +\\+ *" -2 delete-horizontal-space electric-spacing-insert "+" middle indent-according-to-mode] 3 (#$ . 7841)]) #@32 See `electric-spacing-insert'. (defalias 'electric-spacing-- #[nil "\203 \301\302!\203 \301\303!\203\212\304u\210\305 \210)\306\307\310\"\210\311 \207\306\307!\207" [c-buffer-is-cc-mode looking-back "\\- *" "[a-zA-Z0-9_] +\\- *" -2 delete-horizontal-space electric-spacing-insert "-" middle indent-according-to-mode] 3 (#$ . 8185)]) #@32 See `electric-spacing-insert'. (defalias 'electric-spacing-\? #[nil "\203\301\302!\207\301\302\303\"\207" [c-buffer-is-cc-mode electric-spacing-insert "?" after] 3 (#$ . 8529)]) #@32 See `electric-spacing-insert'. (defalias 'electric-spacing-% #[nil "\203\301\302!\203\301\303!\204\304c\207\305\304!\207\306\307!\203%\310 \203%\304c\207\305\304!\207" [c-buffer-is-cc-mode looking-back "\".*" "\",.*" "%" electric-spacing-insert derived-mode-p python-mode electric-spacing-document\?] 2 (#$ . 8716)]) #@32 See `electric-spacing-insert'. (defalias 'electric-spacing-~ #[nil "\300\301\302\303#\203\304\305!\203\306\307!\210\310c\207\311c\207\311c\207" [derived-mode-p ruby-mode perl-mode cperl-mode looking-back "= " delete-char -2 "=~ " "~"] 4 (#$ . 9048)]) #@32 See `electric-spacing-insert'. (defalias 'electric-spacing-/ #[nil "\300 \301=\203\212\302\303!\210\304\305!)\203\306c\207\307\306!\207" [line-number-at-pos 1 move-beginning-of-line nil looking-at "#!" "/" electric-spacing-insert] 2 (#$ . 9309)]) (provide 'electric-spacing)