;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301\302\303\304\305\306\307&\210\310\311\312\313\304\314%\210\310\315\316\317\304\314%\210\310\320\321\322\304\314%\210\310\323\324\325\304\314%\207" [custom-declare-variable makey-key-mode-show-usage t "Whether to show usage information when entering a popup." :group makey :type boolean custom-declare-face makey-key-mode-header-face ((t :inherit font-lock-keyword-face)) "Face for key mode header lines." makey-faces makey-key-mode-button-face ((t :inherit font-lock-builtin-face)) "Face for key mode buttons." makey-key-mode-switch-face ((t :inherit font-lock-warning-face)) "Face for key mode switches." makey-key-mode-args-face ((t :inherit widget-field)) "Face for key mode switch arguments."] 8) #@34 Delete a group from MASTER-GROUP (defalias 'makey-key-mode-delete-group #[(group master-group) "\304 \"\211\203\305\306\n \"\307!\210 )\207" [group master-group items makey-key-mode-keymaps assoc nil delq makey-key-mode-de-generate] 4 (#$ . 809)]) #@162 Add a new group to MASTER-GROUP If there already is a group of that name then this will completely remove it and put in its place an empty one of the same name. (defalias 'makey-key-mode-add-group #[(group master-group) "\302 \"\203\f\303 \"\210\304C\305CE B\211\207" [group master-group assoc makey-key-mode-delete-group actions switches] 3 (#$ . 1071)]) #@107 Return t if KEY is defined as any option within FOR-GROUP The option may be a switch, argument or action. (defalias 'makey-key-mode-key-defined-p #[(for-group key) "\30528\306!\307\310\211\2056 @\311\f\n\312=\203!\313 !\202%\311\n \"\"\203.\314\305\315\"\210 A\211\204\310+0\207" [for-group options type --dolist-tail-- key result makey-key-mode-options-for-group (actions switches arguments) nil assoc actions makey-get-actions throw t] 6 (#$ . 1439)]) #@61 Abstraction for setting values in `makey-key-mode-keymaps'. (defalias 'makey-key-mode-update-group #[(for-group thing &rest args) "\306!\307\n \"\f@ A\203-\310 \"\203!\311\312 #\210\2022 A\f AAB\241\210\2022 \fC\241\210\313\f +\207" [for-group options thing things args key makey-key-mode-options-for-group assoc makey-key-mode-key-defined-p error "%s is already defined in the %s group." nil makey-key-mode-keymaps] 4 (#$ . 1912)]) #@163 Add a new binding KEY in FOR-GROUP which will use READ-FUNC to receive input to apply to argument ARG is run. DESC should be a brief description of the binding. (defalias 'makey-key-mode-insert-argument #[(for-group key desc arg read-func) "\305\306 \n \f&\207" [for-group key desc arg read-func makey-key-mode-update-group arguments] 7 (#$ . 2363)]) #@144 Add a new binding KEY in FOR-GROUP which will add SWITCH to the command line when it runs. DESC should be a brief description of the binding. (defalias 'makey-key-mode-insert-switch #[(for-group key desc switch) "\304\305 \n %\207" [for-group key desc switch makey-key-mode-update-group switches] 6 (#$ . 2724)]) #@116 Add a new binding KEY in FOR-GROUP which will run command FUNC. DESC should be a brief description of the binding. (defalias 'makey-key-mode-insert-action #[(for-group key desc func) "\304\305 \n %\207" [for-group key desc func makey-key-mode-update-group actions] 6 (#$ . 3046)]) #@95 Retrieve the options for the group FOR-GROUP. This includes switches, commands and arguments. (defalias 'makey-key-mode-options-for-group #[(for-group) "\301\302\303!P! \207" [for-group intern "makey-key-mode-options-for-" symbol-name] 4 (#$ . 3334)]) #@75 Provide help for a key within FOR-GROUP The user is prompted for the key. (defalias 'makey-key-mode-help #[(for-group) "\305!\302 \236A@\306\307\310\n\203\307\311\n\"\202\312\"!\313\305!!\314 \f\"\2034\315\316\314 \f\"8!\202O \317\232\203K\n\203D\320\n!\202O\321\322\"\202O\321\323 \",\207" [for-group opts man-page seq actions makey-key-mode-options-for-group read-key-sequence format "Enter command prefix%s: " ", `?' for man `%s'" "" makey-get-actions assoc describe-function 2 "?" man error "No man page associated with `%s'" "No help associated with `%s'"] 6 (#$ . 3593)]) #@34 Run action/args/option at point. (defalias 'makey-key-mode-exec-at-point #[nil "\301`\302\"\206\n\303\304!\305\306\307 \"!)\207" [key get-text-property key-group-executor error "Nothing at point to do." call-interactively lookup-key current-local-map] 4 (#$ . 4194) nil]) #@44 Jump to the next action/args/option point. (defalias 'makey-key-mode-jump-to-next-exec #[nil "`\304\305\"dU\203e\202T\304\n\305\"\nU?\205( ?\206( =)\203<\ndU\2036e\2028\nT\202\nb\210\306\307w+\207" [oldp old p new get-text-property key-group-executor " " nil] 3 (#$ . 4475) nil]) #@116 This will be filled lazily with proper keymaps. These keymaps are created using `define-key' as they're requested. (defvar makey-key-mode-keymaps nil (#$ . 4783)) #@112 Construct a normal looking keymap for the key mode to use. Put it in `makey-key-mode-keymaps' for fast lookup. (defalias 'makey-key-mode-build-keymap #[(for-group) "\306!\307 !\303 \236A\304 \236A\305 \236A\310 \236A\311  \312 \313\"\210\314 \315\316#\210\314 \317\320#\210\314 \321\322\323\324\325\326DDF#\210\327!\f\323\"\211#\203}#@\"!\"\330\326D\326\331\"8D\326\332\"8D\326\333\"8D\257\"\210#A\211#\204Q*\n\323\"\211#\203\244#@\"!\"\334\326\331\"8DD\"\210#A\211#\204\210* \323\"\211#\203\314#@\"!\"\335\326D\331\"8E\"\210#A\211#\204\257*\323\"\211#\203\373#@\"!\"\336\326D\331\"8\326\332\"8DF\"\210#A\211#\204\330* \323\"\211#\203)#@\"!\"\337\326D\331\"8\326\332\"8DF\"\210#A\211#\204+ B$B$ .\207" [for-group options actions switches lisp-switches arguments makey-key-mode-options-for-group makey-get-actions lisp-arguments make-sparse-keymap suppress-keymap nodigits define-key "" (lambda nil (interactive) (makey-key-mode-command nil)) "q" (lambda nil (interactive) (makey-key-mode-command nil)) "?" lambda nil (interactive) makey-key-mode-help quote #[(k action) "\303\304 @!\305\306\307\nF#\207" [map k action define-key kbd lambda nil (interactive)] 7] makey-key-mode-toggle-lisp-option 2 3 4 makey-key-mode-command makey-key-mode-toggle-option makey-key-mode-add-lisp-variable makey-key-mode-add-argument map defkey k --dolist-tail-- makey-key-mode-keymaps] 10 (#$ . 4953)]) #@135 Prefix argument to the command that brought up the key-mode window. For internal use. Used by the command that's eventually invoked. (defvar makey-key-mode-prefix nil (#$ . 6435)) #@39 A hash-table of current argument set. (defvar makey-key-mode-current-args nil (#$ . 6622)) #@95 A hash-table of current lisp variables set. These will get let-bound when an action is called (defvar makey-key-mode-current-lisp-arguments nil (#$ . 6719)) #@26 Current lisp option set. (defvar makey-key-mode-current-lisp-options nil (#$ . 6882)) #@21 Current option set. (defvar makey-key-mode-current-options nil (#$ . 6974)) #@122 List of custom options to pass to the command line. Do not customize this (used in the `makey-key-mode' implementation). (defvar makey-custom-options nil (#$ . 7057)) (defalias 'makey-key-mode-command #[(func) "\206 \n\306\307\f\"\210\310\311 !\312!\313!\210\314!\210\306\315\"\210\310\211\203a@\211@AD\211\235\203P\210\202WB)A\211\2046*\316\317\320BB!-\207" [current-prefix-arg makey-key-mode-prefix makey-key-mode-current-options makey-custom-options makey-key-mode-current-args makey-key-mode-current-lisp-arguments maphash #[(k v) " P\nB\211\207" [k v makey-custom-options] 2] nil copy-hash-table copy-alist set-window-configuration kill-buffer #[(k v) "\304! D\211 \235\203 \202\n B\211)\207" [k v #1=#:x local-let-cells intern] 3] eval let* ((when func (if (stringp func) (call-interactively 'self-insert-command nil [func]) (call-interactively func)))) makey-key-mode-current-lisp-options current-lisp-switches current-variables local-let-cells makey-pre-key-mode-window-conf makey-key-mode-last-buffer lisp-option --dolist-tail-- #2=#:x] 5]) (defalias 'makey-key-mode-add-lisp-variable #[(for-group lisp-variable-name input-func) " \305P!\306 \n #\210\307\f!)\207" [input-func lisp-variable-name input makey-key-mode-current-lisp-arguments for-group ": " puthash makey-key-mode-redraw] 4]) (defalias 'makey-key-mode-add-argument #[(for-group arg-name input-func) " \305P!\306 \n #\210\307\f!)\207" [input-func arg-name input makey-key-mode-current-args for-group ": " puthash makey-key-mode-redraw] 4]) #@76 Toggles the appearance of OPTION-NAME in `makey-key-mode-current-options'. (defalias 'makey-key-mode-toggle-option #[(for-group option-name) " \235\203\303 \"\202 \235\203 \210\202 B\304\n!\207" [option-name makey-key-mode-current-options for-group delete makey-key-mode-redraw] 3 (#$ . 8640)]) #@135 Toggles the appearance of OPTION-NAME in `makey-key-mode-current-lisp-options'. Toggles between OPTION-VALUE-ON and OPTION-VALUE-OFF (defalias 'makey-key-mode-toggle-lisp-option #[(for-group option-name option-value-on option-value-off) "\306 \"A\203$\307 \"\nB\211 \235\203 \210\202 B)\2028\fB\211 \235\2033 \210\2027 B)\310 !\207" [option-name makey-key-mode-current-lisp-options option-value-off #1=#:x option-value-on #2=#:x assoc assq-delete-all makey-key-mode-redraw for-group] 4 (#$ . 8956)]) #@59 Format string to create the name of the makey-key buffer. (defvar makey-key-mode-buf-name "*makey-key: %s*" (#$ . 9483)) #@39 Store the last makey-key buffer used. (defvar makey-key-mode-last-buffer nil (#$ . 9610)) #@48 Will hold the pre-menu configuration of makey. (defvar makey-pre-key-mode-window-conf nil (#$ . 9706)) #@151 Mode for makey key selection. All commands, switches and options can be toggled/actioned with the key combination highlighted before the description. (defalias 'makey-key-mode #[(for-group &optional original-opts) "\306 \307\310 \311\n!\"!\211\312 \210\313\314!\210\315 !\210\316 \210\317\305!\210\320\317\321!\210\317\322!\210\317\323!\210\324 \317\325!\210\324 \317\326!\210\327\n!\210)\205W\330\331!\207" [makey-pre-key-mode-window-conf makey-key-mode-buf-name for-group buf makey-key-mode-last-buffer scroll-margin current-window-configuration get-buffer-create format symbol-name split-window-vertically other-window 1 switch-to-buffer kill-all-local-variables make-local-variable 0 makey-key-mode-current-options makey-key-mode-current-lisp-options makey-key-mode-current-args make-hash-table makey-key-mode-current-lisp-arguments makey-key-mode-prefix makey-key-mode-redraw message "Type a prefix key to toggle it. Run 'actions' with their prefixes. '?' for more help." original-opts current-prefix-arg makey-key-mode-show-usage] 6 (#$ . 9816) nil]) #@40 Get or build the keymap for FOR-GROUP. (defalias 'makey-key-mode-get-key-map #[(for-group) "\302 \"A\206 \303!\207" [for-group makey-key-mode-keymaps assoc makey-key-mode-build-keymap] 3 (#$ . 10902)]) #@32 (re)draw the makey key buffer. (defalias 'makey-key-mode-redraw #[(for-group) "\306\307`\310\"\306`\311 \312U\306\313 \210\314\315!\210\316\317!!\210\320!\321 \210\322\323\f\2039\324\f\325 \"A \203J\203Jb\210\326 \210\202[ \203X b\210\327\306w\210\202[\nb\210.\330\331 \207" [actions-p is-first old-point new-exec-pos current-exec buffer-read-only nil get-text-property key-group-executor buffer-size 0 erase-buffer make-local-variable font-lock-defaults use-local-map makey-key-mode-get-key-map makey-key-mode-draw delete-trailing-whitespace "makey-key-mode" makey-key-mode assoc makey-key-mode-build-exec-point-alist makey-key-mode-jump-to-next-exec " " t fit-window-to-buffer for-group mode-name major-mode] 6 (#$ . 11113)]) (defalias 'makey-key-mode-build-exec-point-alist #[nil "\212eb\210\302`\303\"\211\205`BCm\2044\302`\303\"=\204.\302`\303\"\211\203.`B B\304u\210\202 \237+\207" [exec exec-alist get-text-property key-group-executor nil] 5]) #@38 Draw a header with the correct face. (defalias 'makey-key-mode-draw-header #[(header) "\301\302\303#\304\261\207" [header propertize face makey-key-mode-header-face "\n"] 4 (#$ . 12110)]) #@68 When true, draw arguments in columns as with switches and options. (defvar makey-key-mode-args-in-cols nil (#$ . 12306)) #@33 Draw the args part of the menu. (defalias 'makey-key-mode-draw-args #[(args hash-table) "\302\303\304 ?$\207" [args makey-key-mode-args-in-cols makey-key-mode-draw-buttons "Args" #[(x) "\3048\305 \n\306#\307\310 \311 \247\203\312 !\202 \313\314##*\207" [x arg hash-table value 2 gethash "" format "(%s) %s" propertize int-to-string face makey-key-mode-args-face] 7]] 5 (#$ . 12433)]) #@37 Draw the switches part of the menu. (defalias 'makey-key-mode-draw-switches #[(switches switch-variable) "\301\302\303#\207" [switches makey-key-mode-draw-buttons "Switches" #[(x) "\304\305\3068\2119\203\307 !\202 \310 \"A\203#\311\n\312\313#\202$\n*\"\207" [x sym s switch-variable format "(%s)" 2 symbol-name assoc propertize face makey-key-mode-switch-face] 7]] 4 (#$ . 12831)]) #@36 Draw the actions part of the menu. (defalias 'makey-key-mode-draw-actions #[(header actions) "\302\303\304\" \305#\207" [header actions makey-key-mode-draw-buttons format "%s Actions" nil] 4 (#$ . 13230)]) (defalias 'makey-key-mode-draw-buttons #[(section xs maker &optional one-col-each) "\205\303 !\210\304\305\306\"\n\"\207" [xs section one-col-each makey-key-mode-draw-header makey-key-mode-draw-in-cols mapcar #[(x) "\306@\307\310#A@ \205 !\311\312 \n\f\203\313\202 \314\f\206%\314%\306 \315@#,\207" [x head desc maker more text propertize face makey-key-mode-button-face format " %s: %s%s%s" " " "" key-group-executor] 6]] 4]) #@146 Given a list of strings, print in columns (using `insert'). If ONE-COL-EACH is true then don't columify, but rather, draw each item on one line. (defalias 'makey-key-mode-draw-in-cols #[(strings one-col-each) "\305\306\307\310\"\"\203B@\311 \312\\\nGZ\313\"\nc\210\f\2041 Gi\\ \\\314 V\2037A\2037\315c\210\202: c\210*A\211\204\f)\315c\207" [strings longest-act str padding one-col-each apply max mapcar length make-string 3 32 window-width "\n"] 6 (#$ . 13889)]) #@40 Returns a list of actions in FOR-GROUP (defalias 'makey-get-actions #[(for-group) "\304\236A\305\211 :\203 @\306 \nA\" A\211\202\n +\207" [for-group #1=#:--cl-var-- sub-group action-items actions nil append] 4 (#$ . 14373)]) #@105 Draw actions, switches and parameters. Return the point before the actions part, if any, nil otherwise. (defalias 'makey-key-mode-draw #[(for-group) "\306!\302 \236A\303 \236A\304 \236A\305 \236A\307 \236A\310 \236A\311\312\n\"\210\312 \"\210\313\f\"\210\313 \"\210\203H\314 \311\211\203j@\315@A\"\210A\211\204S*\316c\210.\207" [for-group options switches lisp-switches arguments lisp-arguments makey-key-mode-options-for-group description actions nil makey-key-mode-draw-switches makey-key-mode-draw-args point-marker makey-key-mode-draw-actions "\n" p makey-key-mode-current-options makey-key-mode-current-lisp-options makey-key-mode-current-args makey-key-mode-current-lisp-arguments action --dolist-tail-- header-line-format] 4 (#$ . 14615)]) #@32 Unbind the function for GROUP. (defalias 'makey-key-mode-de-generate #[(group) "\301\302\303\304!P!!\207" [group fmakunbound intern "makey-key-mode-popup-" symbol-name] 5 (#$ . 15420)]) #@45 Generate the key-group-name menu for GROUP. (defalias 'makey-key-mode-generate #[(group-name group-details) "\306\307\236A\306\211\2032\f@\310 8\310 8JB\211\n\235\203&\n\210\202* \nB)\fA\211\204*\311\312\313\314\315!P!\306\316\315!P\317D\257!\210\311\312\313\320\315!P!\306\321\315!P\322\323\317D\317\nDE\257!*\207" [group-details opts lisp-variable-alist switch --dolist-tail-- #1=#:x nil lisp-switches 2 eval defun intern "makey-key-mode-options-for-" symbol-name "Options menu helper function for " quote "makey-key-mode-popup-" "Key menu for " (interactive) makey-key-mode group-name] 11 (#$ . 15613)]) #@74 Initializes KEY-GROUP and creates all the relevant interactive commands. (defalias 'makey-initialize-key-groups #[(key-group) "\302\303\304 \"\207" [makey-key-mode-keymaps key-group nil mapc #[(g) "\301@A\"\207" [g makey-key-mode-generate] 3]] 3 (#$ . 16254)]) (provide 'makey)