;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\303\304\305\306\307\310%\210\311\312\313\314\315\316\307\304&\210\311\317\320\321\315\322\307\304&\210\311\323\305\324\315\325\307\304&\207" [require cl-lib easy-mmode custom-declare-group bind-key nil "A simple way to manage personal keybindings" :group emacs custom-declare-variable bind-key-column-widths '(18 . 40) "Width of columns in `describe-personal-keybindings'." :type (cons integer integer) bind-key-segregation-regexp "\\`\\(\\(C-[chx] \\|M-[gso] \\)\\([CM]-\\)?\\|.+-\\)" "Regular expression used to divide key sets in the output from\n\\[describe-personal-keybindings]." regexp bind-key-describe-special-forms "If non-nil, extract docstrings from lambdas, closures and keymaps if possible." boolean] 8) #@29 override-global-mode keymap (defvar override-global-map (make-keymap) (#$ . 847)) #@109 Non-nil if Override-Global mode is enabled. Use the command `override-global-mode' to change this variable. (defvar override-global-mode t (#$ . 936)) (make-variable-buffer-local 'override-global-mode) #@604 A minor mode so that keymap settings override other modes. This is a minor mode. If called interactively, toggle the `Override-Global mode' mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode. If called from Lisp, toggle the mode if ARG is `toggle'. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number. To check whether the minor mode is enabled in the current buffer, evaluate `override-global-mode'. The mode's hook is called both when the mode is enabled and when it is disabled. (defalias 'override-global-mode #[(&optional arg) "\305  \306=\203\n?\202 \247\203 \307W\203\310\202\311\312\303!\2032\313\302 \"\n\2032\302 B\314\315\n\203<\316\202=\317\"\210\320\321!\203b\305 \203Q\305 \232\203b\322\323\324\n\203]\325\202^\326\f#\210))\327 \210\n\207" [#1=#:last-message arg override-global-mode local-minor-modes local current-message toggle 1 nil t boundp delq run-hooks override-global-mode-hook override-global-mode-on-hook override-global-mode-off-hook called-interactively-p any " in current buffer" message "Override-Global mode %sabled%s" "en" "dis" force-mode-line-update] 4 (#$ . 1145) (list (if current-prefix-arg (prefix-numeric-value current-prefix-arg) 'toggle))]) (defvar override-global-mode-hook nil) (byte-code "\302\303N\204\f\304\302\303\305#\210\304\302\306\307#\210\304\302\310\311C#\210\312\313\314\315\300!\205#\311\211%\210\316\317\313 BC\"\207" [override-global-mode-map override-global-map override-global-mode-hook variable-documentation put "Hook run after entering or leaving `override-global-mode'.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" custom-type hook standard-value nil add-minor-mode override-global-mode "" boundp add-to-list emulation-mode-map-alists] 6) #@100 List of bindings performed by `bind-key'. Elements have the form ((KEY . [MAP]) CMD ORIGINAL-CMD) (defvar personal-keybindings nil (#$ . 3085)) #@822 Bind KEY-NAME to COMMAND in KEYMAP (`global-map' if not passed). KEY-NAME may be a vector, in which case it is passed straight to `define-key'. Or it may be a string to be interpreted as spelled-out keystrokes, e.g., "C-c C-z". See documentation of `edmacro-mode' for details. COMMAND must be an interactive function or lambda form. KEYMAP, if present, should be a keymap variable or symbol. For example: (bind-key "M-h" #'some-interactive-function my-mode-map) (bind-key "M-h" #'some-interactive-function 'my-mode-map) If PREDICATE is non-nil, it is a form evaluated to determine when a key should be bound. It must return non-nil in such cases. Emacs can evaluate this form at any time that it does redisplay or operates on menu data structures, so you should write it so it can safely be called at any time. (defalias 'bind-key '(macro . #[(key-name command &optional keymap predicate) "\306\307!\306\310!\306\311!\306\312!\313 \fD\n\314\315 D \316 DFD\317\314\320 \321 DE\322 D FD \323\314\324 D \325 DF\314\321 D \326 DFED\327\330\nED\257\331\332\333 \334BBD\335\336/\337\340DEEDD\314\332\341\342\343\323 \344BBEFE0\203\212\345\346\n\326\347\350\351\352\353\354\3550/EE\257DF\202\220\345\356\n/FF,\207" [bindingvar kdescvar keyvar namevar key-name keymap make-symbol "name" "key" "kdesc" "binding" let* if vectorp read-kbd-macro kmap and symbolp symbol-value cons stringp key-description quote lookup-key (or kmap global-map) let entry assoc (personal-keybindings) details list unless numberp (setcdr entry details) add-to-list 'personal-keybindings (details) define-key (or kmap global-map) menu-item "" nil :filter lambda (&optional _) when (or kmap global-map) command predicate] 16 (#$ . 3237)])) #@95 Unbind the given KEY-NAME, within the KEYMAP (if specified). See `bind-key' for more details. (defalias 'unbind-key '(macro . #[(key-name &optional keymap) "\302\303\304 F\305\306\307\310\311\312 \203 \313\314\315\316E\317\320\321 DEF\202'\313\322\315\323EEED\324BBEE\207" [key-name keymap progn bind-key nil setq personal-keybindings cl-delete-if function lambda (k) and (consp (car k)) string= (caar k) eq (cdar k) quote (stringp (car k)) (car k) (personal-keybindings)] 15 (#$ . 4975)])) #@66 Similar to `bind-key', but overrides any mode-specific bindings. (defalias 'bind-key* '(macro . #[(key-name command &optional predicate) "\303 \304\n\257\207" [key-name command predicate bind-key override-global-map] 5 (#$ . 5477)])) #@618 Bind multiple keys at once. Accepts keyword arguments: :map MAP - a keymap into which the keybindings should be added :prefix KEY - prefix key for these bindings :prefix-map MAP - name of the prefix map that should be created for these bindings :prefix-docstring STR - docstring for the prefix-map variable :menu-name NAME - optional menu string for prefix map :filter FORM - optional form to determine when bindings apply The rest of the arguments are conses of keybinding string and a function symbol (unquoted). (defalias 'bind-keys-form #[(args keymap) "\306\211\211\211\211\211\211 \307!!\203\256\"\203\256\"@\310=\2032\f\2042\"A@\211 \202\233\"@\311=\203C\"A@\211\202\233\"@\312=\203[ \313>\204[\"A@\211\202\233\"@\314=\203l\"A@\211\202\233\"@\315=\203|\"A@\202\236\"@\316=\203\215\"A@\211\202\233\"@\317=\203\247\"A@\211\203\247\"AA\"\202\306\211!\204)\f\203\267 \203\277 \203\303\f\204\303\320\321!\210 \203\317 \204\317\320\322!\210 \204\330# \306\211$%\"\203\323\"@!\203\366\"$\306\211\"\202\340%\203%\"@C\244\210\202\f\"@C%\"A\211\"\204\343\324&\325\f\205m\326\fD\325 \205-\327\330\fD\331 FC \203<\332\330\fD\306 FC\202B\332\330\fDDC \203a \333=\204a& \334 \330\fD \n\257C\"\202k\334 \330\fD\306\n\257C#B& \335\336%\"\"$\205\217\337\203\212\317$BB\202\214$ \"#.\n\207" [pkg menu-name filter prefix prefix-map doc nil t :map :prefix-docstring :prefix-map (global-map override-global-map) :prefix :filter :menu-name :package error "Both :prefix-map and :prefix must be supplied" "If :menu-name is supplied, :prefix must be too" keywordp #[(map bindings) "\203- \203-\303>\204-\304\305\306DD\307\n!\310 9\203#\306 D\202$ \306\307\n!DEFC\207\n\207" [map pkg bindings (global-map override-global-map) if boundp quote macroexp-progn eval-after-load] 8] append defvar put quote 'variable-documentation define-prefix-command global-map bind-key cl-mapcan #[(form) "A\205 \305AD\n\203\306@ \n \257C\2029\f\2030\f\307=\2040\306@ \f \257C\2029\306@ \310 \257C)\207" [form fun prefix-map filter map function bind-key global-map nil] 5] bind-keys-form map cont args keymap next first #1=#:--cl-wrap--] 13 (#$ . 5720)]) #@618 Bind multiple keys at once. Accepts keyword arguments: :map MAP - a keymap into which the keybindings should be added :prefix KEY - prefix key for these bindings :prefix-map MAP - name of the prefix map that should be created for these bindings :prefix-docstring STR - docstring for the prefix-map variable :menu-name NAME - optional menu string for prefix map :filter FORM - optional form to determine when bindings apply The rest of the arguments are conses of keybinding string and a function symbol (unquoted). (defalias 'bind-keys '(macro . #[(&rest args) "\301\302\303\"!\207" [args macroexp-progn bind-keys-form nil] 4 (#$ . 8086)])) (defalias 'bind-keys* '(macro . #[(&rest args) "\301\302\303\"!\207" [args macroexp-progn bind-keys-form override-global-map] 4])) (defalias 'get-binding-description #[(elem) "<\203@@\303>\203 \203\3048;\203\3048\207\305\207@\306=\2035 \2033\3078;\2033\3078\207\310\207@\311=\203>\312\207\207 \203Z\313!\203Z\314N\211;\203W\n\202X)\2079\203a\207\315\207" [elem bind-key-describe-special-forms doc (lambda function) 2 "#" closure 3 "#" keymap "#" keymapp variable-documentation "#"] 3]) (defalias 'compare-keybindings #[(l r) "\306 \n@@\"\205\307\310\n@@\"\306 \f@@\"\205!\307\310\f@@\"\n@A\f\f@A \f\204< \203<\311\211B\202\265\f\203L \204L\312\311B\202\265\f\203p \203p\313\f!\313 !\230\204p\313\f!\313 !\231\311B\202\265 \204~ \203~\311\211B\202\265 \203\214 \204\214\312\311B\202\265 \203\255 \203\255 \230\203\245\n@@\f@@\231C\202\265 \231\311B\202\265\n@@\f@@\231C-\207" [bind-key-segregation-regexp regex l lgroup r rgroup string-match match-string 0 t nil symbol-name lkeymap rkeymap] 3]) #@61 Display all the personal keybindings defined by `bind-key'. (defalias 'describe-personal-keybindings #[nil "r\306\307!q\210p\310 \210 \311\211\312\211\312*\313 \210\314\315!\210+\211+,\316\317\320\321-@\322Z\323\"\321-A\324Z\323\"\321-@S\325\"\321-AS\325\"%!\210\311.\326/\327\"\211/\3110\2111\205;1@0.@A0@A=\204\214\316\317\3300@A0@@\321\331-@\\-A\\\325\"$!\210\202\237.\203\237\332.0\"A\203\237\316\333!\2100@@2\3340@AJ\206\260\335 \3362!\"30A@4\337085\3404!65\205\322\3405!7\3403!8\317\211\341-@-A#2\317\3426\"68\230\203\f5\20367\230\203\343\202\317\3447\"\202\317\3453\"$9\316\346\3479\"\203'\350\333\312\2119$\202)9!\210.0.1A\2111\204^\311+\351+!\210+\207" [default-directory #1=#:old-dir buffer-read-only buffer-file-name buffer-undo-list inhibit-modification-hooks get-buffer-create "*Personal Keybindings*" kill-all-local-variables nil t erase-buffer run-hooks temp-buffer-setup-hook princ format "Key name%s Command%s Comments\n%s %s ---------------------\n" make-string 9 32 8 45 sort #[(l r) "\302 \"@\207" [l r compare-keybindings] 3] "\n\n%s: %s\n%s\n\n" 21 compare-keybindings "\n" lookup-key current-global-map read-kbd-macro 2 get-binding-description "%%-%ds%%-%ds%%s\n" "`%s'" "" "was `%s'" "[now: `%s']" string-match "[ ]+\n" replace-match internal-temp-output-buffer-show inhibit-read-only #2=#:buf standard-output bind-key-column-widths last-binding personal-keybindings binding --dolist-tail-- key-name at-present command was-command command-desc was-command-desc at-present-desc line] 10 (#$ . 9952) nil]) (provide 'bind-key)