;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\302\303\304\305\306\307%\210\310\311\312\313\306\303\314\315&\210\310\316\304\317\306\303\314\320&\210\310\321\322\323\306\303\314\320&\210\310\324\304\325\306\303\314\326&\210\327\324\330\331#\210\310\330\304\332\306\303\314\333&\210\310\334\322\335\306\303\314\320&\210\310\336\337\340\306\303\314\341&\210\310\342\343\344\306\303\314\345&\210\310\346\347\350\306\303\314\351&\210\352\353\304\354\306\303%\207" [require dash custom-declare-group winum nil "Navigate and manage windows using numbers." :group convenience custom-declare-variable winum-scope 'global "Frames affected by a number set." :type (choice (const :tag "frame local" frame-local) (const :tag "visible frames" visible) (const :tag "global" global)) winum-reverse-frame-list "If t, order frames by reverse order of creation.\nHas effect only when `winum-scope' is not 'frame-local." boolean winum-auto-assign-0-to-minibuffer t "If non-nil, `winum-mode' assigns 0 to the minibuffer when active." winum-assign-func "Function called for each window by `winum-mode'.\nThis is called before automatic assignment begins. The function should\nreturn a number to have it assigned to the current-window, nil otherwise.\n\nThis function along with `winum-auto-assign-0-to-minibuffer' are the only\nways to have 0 assigned to a window.\n\nExample: always assign *Calculator* the number 9 and *NeoTree* the number 0:\n\n (defun my-winum-assign-func ()\n (cond\n ((equal (buffer-name) \"*Calculator*\")\n 9)\n ((string-match-p (buffer-name) \".*\\*NeoTree\\*.*\")\n 0)\n (t\n nil)))\n\n (setq winum-assign-func 'my-winum-assign-func)" function make-obsolete-variable winum-assign-functions "2.0.0" "List of functions called for each window by `winum-mode'.\n\nThese functions allow for deterministic assignment of numbers to windows. Each\nfunction is called for every window. A function should return the number to be\nassigned to a window or nil. The *first* function to output a number for\na given window will determine this window's number.\n\nIf the list is empty or if every functions returns nil for a given window winum\nwill proceed to automatic number assignment.\n\nSince this list is meant to allow custom window assignment for *mutiple*\npackages at once it should never be directly set, only added to and removed\nfrom.\n\nThese functions, along with `winum-auto-assign-0-to-minibuffer', are the only\nway to have 0 assigned to a window.\n\nExample: always assign *Calculator* the number 9, *Flycheck-errors* the number 8\nand *NeoTree* the number 0:\n\n (defun winum-assign-9-to-calculator-8-to-flycheck-errors ()\n (cond\n ((equal (buffer-name) \"*Calculator*\") 9)\n ((equal (buffer-name) \"*Flycheck errors*\") 8)))\n\n (defun winum-assign-0-to-neotree ()\n (when (string-match-p (buffer-name) \".*\\*NeoTree\\*.*\") 10))\n\n (add-to-list\n 'winum-assign-functions #'winum-assign-9-to-calculator-8-to-flycheck-errors)\n (add-to-list\n 'winum-assign-functions #'winum-assign-0-to-neotree)" list winum-auto-setup-mode-line "When nil, `winum-mode' will not display window numbers in the mode-line.\nYou might want this to be nil if you use a package that already manages window\nnumbers in the mode-line." winum-mode-line-position 1 "The position in the mode-line `winum-mode' displays the number." integer winum-format " %s " "Format string defining how the window number looks like in the mode-line.\nThis string is passed to the `format' function along with the\nresult of `winum-get-number-string'." string winum-ignored-buffers '(" *which-key*") "List of buffers to ignore when assigning numbers." (repeat string) custom-declare-face winum-face "Face used for the number in the mode-line."] 8) #@71 Keymap to be used under the prefix provided by `winum-keymap-prefix'. (defvar winum-base-map (byte-code "\301 \302\303\304#\210\302\305\304#\210\302\306\307#\210\302\310\311#\210\302\312\313#\210\302\314\315#\210\302\316\317#\210\302\320\321#\210\302\322\323#\210\302\324\325#\210\302\326\327#\210\302\330\331#\210)\207" [map make-sparse-keymap define-key "`" winum-select-window-by-number [178] "0" winum-select-window-0-or-10 "1" winum-select-window-1 "2" winum-select-window-2 "3" winum-select-window-3 "4" winum-select-window-4 "5" winum-select-window-5 "6" winum-select-window-6 "7" winum-select-window-7 "8" winum-select-window-8 "9" winum-select-window-9] 4) (#$ . 3853)) #@31 Keymap used for `winum-mode'. (defvar winum-keymap (byte-code "\302 \303\304 #\210)\207" [map winum-base-map make-sparse-keymap define-key "w"] 4) (#$ . 4552)) #@48 Maximum number of frames that can be numbered. (defvar winum--max-frames 16 (#$ . 4722)) #@42 Current count of windows to be numbered. (defvar winum--window-count nil (#$ . 4817)) #@37 A list of window numbers to assign. (defvar winum--remaining nil (#$ . 4909)) #@104 Vector of windows indexed by their number. Used internally by winum to get a window provided a number. (defvar winum--window-vector nil (#$ . 4994)) #@108 Hash table of numbers indexed by their window. Used internally by winum to get a number provided a window. (defvar winum--numbers-table nil (#$ . 5150)) #@493 Table linking windows to numbers and numbers to windows for each frame. Used only when `winum-scope' is 'frame-local to keep track of separate window numbers sets in every frame. It is a hash table using Emacs frames as keys and cons of the form (`winum--window-vector' . `winum--numbers-table') as values. To get a window given a number, use the `car' of a value. To get a number given a window, use the `cdr' of a value. Such a structure allows for per-frame bidirectional fast access. (defvar winum--frames-table nil (#$ . 5310)) #@74 What is pushed into `mode-line-format' when setting it up automatically. (defvar winum--mode-line-segment '(:eval (format winum-format (winum-get-number-string))) (#$ . 5853)) #@80 Tracks the last used `winum-scope'. Needed to detect scope changes at runtime. (defvar winum--last-used-scope winum-scope (#$ . 6035)) #@251 Non-nil if Winum mode is enabled. See the `winum-mode' command for a description of this minor mode. Setting this variable directly does not take effect; either customize it (see the info node `Easy Customization') or call the function `winum-mode'. (custom-declare-variable 'winum-mode nil '(#$ . 6177) :set 'custom-set-minor-mode :initialize 'custom-initialize-default :type 'boolean) #@613 A minor mode that allows for managing windows based on window numbers. This is a minor mode. If called interactively, toggle the `Winum 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 `(default-value 'winum-mode)'. The mode's hook is called both when the mode is enabled and when it is disabled. (defalias 'winum-mode #[(&optional arg) "\305 \306\303 \307=\203\310\303!?\202\" \247\203! \311W\203!\312\202\"\313\"\210\314\302!\2039\315\303\n\"\310\303!\2039\303\nB \203C\316 \210\202F\317 \210\320\321\310\303!\203R\322\202S\323\"\210\324\325!\203~\326\303!\210\305 \203k\305 \232\203~\327\330\331\310\303!\203y\332\202z\333\f#\210))\334 \210\310\303!\207" [#1=#:last-message arg global-minor-modes winum-mode local current-message set-default toggle default-value 1 nil t boundp delq winum--init winum--deinit run-hooks winum-mode-hook winum-mode-on-hook winum-mode-off-hook called-interactively-p any customize-mark-as-set "" message "Winum mode %sabled%s" "en" "dis" force-mode-line-update] 4 (#$ . 6571) (list (if current-prefix-arg (prefix-numeric-value current-prefix-arg) 'toggle))]) (defvar winum-mode-hook nil) (byte-code "\301\302N\204\f\303\301\302\304#\210\303\301\305\306#\210\303\301\307\310C#\210\311\312\310\310\211%\207" [winum-keymap winum-mode-hook variable-documentation put "Hook run after entering or leaving `winum-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 winum-mode] 6) #@114 Jump to window 0 if assigned or 10 if exists. If prefix ARG is given, delete the window instead of selecting it. (defalias 'winum-select-window-0-or-10 #[(&optional arg) "\302\303!\203\203\304\202\303\202\203\305\202\306\307 !)\207" [arg n winum-get-window-by-number 0 - -10 10 winum-select-window-by-number] 2 (#$ . 8457) "P"]) #@86 Jump to window 0. If prefix ARG is given, delete the window instead of selecting it. (defalias 'winum-select-window-0 #[(&optional arg) "\301\203 \302\202\n\303!\207" [arg winum-select-window-by-number - 0] 2 (#$ . 8807) "P"]) #@86 Jump to window 1. If prefix ARG is given, delete the window instead of selecting it. (defalias 'winum-select-window-1 #[(&optional arg) "\301\203 \302\202\n\303!\207" [arg winum-select-window-by-number -1 1] 2 (#$ . 9043) "P"]) #@86 Jump to window 2. If prefix ARG is given, delete the window instead of selecting it. (defalias 'winum-select-window-2 #[(&optional arg) "\301\203 \302\202\n\303!\207" [arg winum-select-window-by-number -2 2] 2 (#$ . 9280) "P"]) #@86 Jump to window 3. If prefix ARG is given, delete the window instead of selecting it. (defalias 'winum-select-window-3 #[(&optional arg) "\301\203 \302\202\n\303!\207" [arg winum-select-window-by-number -3 3] 2 (#$ . 9517) "P"]) #@86 Jump to window 4. If prefix ARG is given, delete the window instead of selecting it. (defalias 'winum-select-window-4 #[(&optional arg) "\301\203 \302\202\n\303!\207" [arg winum-select-window-by-number -4 4] 2 (#$ . 9754) "P"]) #@86 Jump to window 5. If prefix ARG is given, delete the window instead of selecting it. (defalias 'winum-select-window-5 #[(&optional arg) "\301\203 \302\202\n\303!\207" [arg winum-select-window-by-number -5 5] 2 (#$ . 9991) "P"]) #@86 Jump to window 6. If prefix ARG is given, delete the window instead of selecting it. (defalias 'winum-select-window-6 #[(&optional arg) "\301\203 \302\202\n\303!\207" [arg winum-select-window-by-number -6 6] 2 (#$ . 10228) "P"]) #@86 Jump to window 7. If prefix ARG is given, delete the window instead of selecting it. (defalias 'winum-select-window-7 #[(&optional arg) "\301\203 \302\202\n\303!\207" [arg winum-select-window-by-number -7 7] 2 (#$ . 10466) "P"]) #@86 Jump to window 8. If prefix ARG is given, delete the window instead of selecting it. (defalias 'winum-select-window-8 #[(&optional arg) "\301\203 \302\202\n\303!\207" [arg winum-select-window-by-number -8 8] 2 (#$ . 10704) "P"]) #@86 Jump to window 9. If prefix ARG is given, delete the window instead of selecting it. (defalias 'winum-select-window-9 #[(&optional arg) "\301\203 \302\202\n\303!\207" [arg winum-select-window-by-number -9 9] 2 (#$ . 10942) "P"]) #@515 Select or delete window which number is specified by ARG. If the number is negative, delete the window instead of selecting it. There are several ways to provide the number: - if called from elisp with an argument, use it. - if called interactively with a numeric prefix argument, use it. - if prefix argument is the negative argument, delete window 0. - if prefix argument is the default prefix argument, delete current window. - if called interactively and no valid argument is provided, read from minibuffer. (defalias 'winum-select-window-by-number #[(&optional arg) "\250\203 \202D\306=\203\307\202D\203\310 \202D\311\312!\203B\313\314!\315 \316\317\320#)\266\203\204;\310 \202>\321 !)\202D\310 \322\323 !!\205X\250?\206X\307 V\f\203m \203g\324\f!\202q\325\f!\202q\326\327 \"+\207" [arg user-input-str inhibit-changing-match-data n w delete - 0 winum-get-number called-interactively-p any read-from-minibuffer "Window: " "[+-]?[0-9]+.*" nil t string-match string-to-number winum-get-window-by-number abs delete-window winum--switch-to-window error "No window numbered %d"] 7 (#$ . 11181) "P"]) #@297 Set key bindings prefix for `winum-keymap' based on `winum-base-map'. This function overrides the value of `winum-keymap', so you should call it before customization of `winum-keymap' and/or after customization of `winum-base-map'. PREFIX must be a key sequence, like the ones returned by `kbd'. (defalias 'winum-set-keymap-prefix #[(prefix) "\205\305 \306 \n#\210 )\307\f\236 \241\207" [prefix map winum-base-map winum-keymap minor-mode-map-alist make-sparse-keymap define-key winum-mode] 4 (#$ . 12321)]) #@52 Return window numbered N if exists, nil otherwise. (defalias 'winum-get-window-by-number #[(n) "\302  \303Y\205 GW\205 H)\207" [window-vector n winum--get-window-vector 0] 2 (#$ . 12840)]) #@240 Get the current or specified window's current number as a propertized string. WINDOW: if specified, the window of which we want to know the number. If not specified, the number of the currently selected window is returned. (defalias 'winum-get-number-string #[(&optional window) "\303!\211\247\203\304 !\202\305\306\n\307\310#*\207" [window n s winum-get-number int-to-string "" propertize face winum-face] 5 (#$ . 13043)]) #@216 Get the current or specified window's current number. WINDOW: if specified, the window of which we want to know the number. If not specified, the number of the currently selected window is returned. (defalias 'winum-get-number #[(&optional window) "\206\302 \303 \304 \")\207" [window w selected-window gethash winum--get-numbers-table] 3 (#$ . 13497)]) #@24 Initialize winum-mode. (defalias 'winum--init #[nil "\306 G \307=\203\310\311\n\"\202\310\311\" \203\312 \210\313\314\315\"\210\313\316\315\"\210\317 \320\211\205J@\321!\210\315 \210A\211\2043\320*\207" [winum--window-count winum-scope winum--max-frames winum--frames-table winum--numbers-table winum-auto-setup-mode-line winum--window-list frame-local make-hash-table :size winum--install-mode-line add-hook minibuffer-setup-hook winum--update window-configuration-change-hook frame-list nil select-frame frame --dolist-tail--] 4 (#$ . 13877)]) #@48 Actions performed when turning off winum-mode. (defalias 'winum--deinit #[nil "\203\302 \210\303\304\305\"\210\303\306\305\"\210\307\211\207" [winum-auto-setup-mode-line winum--frames-table winum--clear-mode-line remove-hook minibuffer-setup-hook winum--update window-configuration-change-hook nil] 3 (#$ . 14455)]) #@100 Install the window number from `winum-mode' to the mode-line. POSITION: position in the mode-line. (defalias 'winum--install-mode-line #[(&optional position) "\306\307!\310\n\206 \206\311 G^\312\f W\203* \211A\242B\fT\211\202* @\232\2048B \203G \211A\242B\2028\237\211\313\307\"\210+\314\315!\207" [res mode-line position winum-mode-line-position i --dotimes-limit-- default-value mode-line-format nil 1 0 set-default force-mode-line-update t winum--mode-line-segment nres] 4 (#$ . 14782)]) #@62 Remove the window number of `winum-mode' from the mode-line. (defalias 'winum--clear-mode-line #[nil "\306\305!\307 \203 \211A\242\211 \232\204\nB)\202\237\211\310\305\f\"\210+\311\312!\207" [res mode-line item winum--mode-line-segment nres mode-line-format default-value nil set-default force-mode-line-update t] 4 (#$ . 15313)]) #@24 Update window numbers. (defalias 'winum--update #[nil "\306 \211G\307 \310\311 T\312\"!\210\313\314 !\210 \203\315\316\"\210\f\2034\317 \2034\320\321!\2044\322\317 \321\"\210\312\211\205O@\322 !\210A\211\204=\312+\207" [windows winum--window-count winum--remaining winum-assign-functions winum-auto-assign-0-to-minibuffer w winum--window-list winum--available-numbers winum--set-window-vector make-vector nil clrhash winum--get-numbers-table -each winum--try-to-find-custom-number active-minibuffer-window winum-get-window-by-number 0 winum--assign --dolist-tail--] 5 (#$ . 15665)]) #@250 Try to find and assign a custom number for WINDOW. Do so by trying every function in `winum-assign-functions' and assign the *first* non nil integer. When multiple functions assign a number to a window log a warning and use the first number anyway. (defalias 'winum--try-to-find-custom-number #[(window) "\306!r\307\216\310 @\311\"\210r\312!q\210\313\314\315 \"\316\313\211 \210\f\210\203G\211A\242T A\203& \nB\202&,\n\237)\211@AG\317V\203d\320\321\314\322\"#\210\250\205o\323\".\207" [window save-selected-window--state #1=#:result winum-assign-functions it-index it internal--before-with-selected-window #[nil "\301!\207" [save-selected-window--state internal--after-with-selected-window] 2] select-window norecord window-buffer nil mapcar #[#2=(it) "\210\211 B\207" [it] 2] 0 1 message "Winum conflict - window %s was assigned a number by multiple custom assign functions: '%s'" #[#2# "\210\301\302@A#\207" [it format "%s -> %s"] 4] winum--assign #3=#:i #4=#:list nums num] 7 (#$ . 16277)]) #@166 Assign to window WINDOW the number NUMBER. If NUMBER is not specified, determine it first based on `winum--remaining'. Returns the assigned number, or nil on error. (defalias 'winum--assign #[(window &optional number) "\2034\305!\210\306 H\203\307\310\306 H $\210\311\207\306 \n I\210*\312 \313 #\210\314\f\"\207\f\205I\315 \313 \"?\205I\f@\316 \")\207" [number window #1=#:v #2=#:v winum--remaining winum--maybe-expand-window-vector winum--get-window-vector message "Number %s already assigned to %s, can't assign to %s" nil puthash winum--get-numbers-table delq gethash winum--assign] 5 (#$ . 17329)]) #@231 Expand `winum--window-vector' if NUMBER is bigger than its size. The size of `winum--window-vector' is normally based on the number of live windows, however a higher number can be reserved by the user-defined `winum-assign-func'. (defalias 'winum--maybe-expand-window-vector #[(number) "\303 \211G\n V\205\304\305\306\n ZT\307\"\"!*\207" [window-vector window-vector-length number winum--get-window-vector winum--set-window-vector vconcat make-vector nil] 7 (#$ . 17960)]) #@39 Return a list of interesting windows. (defalias 'winum--window-list #[nil "\302\303\304\267\2021\305\306 \203\307 \202\307 \237\"\2025\305\306 \203%\310 \202(\310 \237\"\2025\306 \2025\311\312\"\"\207" [winum-scope winum-reverse-frame-list cl-remove-if winum--ignore-window-p #s(hash-table size 3 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (global 8 visible 26 frame-local 44)) cl-mapcan winum--list-windows-in-frame frame-list visible-frame-list error "Invalid `winum-scope': %S"] 5 (#$ . 18444)]) #@52 Non-nil if WINDOW should be ignored for numbering. (defalias 'winum--ignore-window-p #[(window) "\303!\304 !\205 \305 !?\206 \306 !\307\230\206 \310\311!!\n\235)\207" [window f winum-ignored-buffers window-frame frame-live-p frame-visible-p terminal-name "initial_terminal" buffer-name window-buffer] 3 (#$ . 18982)]) #@55 List windows in frame F using natural Emacs ordering. (defalias 'winum--list-windows-in-frame #[(&optional f) "\301\302\303!#\207" [f window-list 0 frame-first-window] 5 (#$ . 19312)]) #@59 Set WINDOW-VECTOR according to the current `winum-scope'. (defalias 'winum--set-window-vector #[(window-vector) "\305 \210\306=\203\307\310 \311\312\n\"B #\207 \211\207" [winum-scope window-vector winum--window-count winum--frames-table winum--window-vector winum--check-for-scope-change frame-local puthash selected-frame make-hash-table :size] 6 (#$ . 19505)]) #@143 Return the window vector used to get a window given a number. This vector is not stored the same way depending on the value of `winum-scope'. (defalias 'winum--get-window-vector #[nil "\303 \210\304=\203\305\306 \"@\207\n\207" [winum-scope winum--frames-table winum--window-vector winum--check-for-scope-change frame-local gethash selected-frame] 3 (#$ . 19880)]) #@149 Return the numbers hashtable used to get a number given a window. This hashtable is not stored the same way depending on the value of `winum-scope' (defalias 'winum--get-numbers-table #[nil "\303 \210\304 \210\305=\203\306\307 \"A\207\n\207" [winum-scope winum--frames-table winum--numbers-table winum--check-for-scope-change winum--check-frames-table frame-local gethash selected-frame] 3 (#$ . 20255)]) #@332 Make sure `winum--frames-table' exists and is correctly equipped. Verifies 2 things (when `winum-scope' is frame local): * When `winum-scope' is frame-local for the first time it may be necessary to instantiate `winum--frames-table'. * A table entry for the current frame must be made when the frame has just been created. (defalias 'winum--check-frames-table #[nil "\303=\205 \204\304\305\n\"\306\307 \"?\205\310 \207" [winum-scope winum--frames-table winum--max-frames frame-local make-hash-table :size gethash selected-frame winum--update] 3 (#$ . 20671)]) #@200 Return a list of numbers from 1 to `winum--window-count'. 0 is is not part of the list as its assignment is either manual using the `winum-assign-func', or using `winum-auto-assign-0-to-minibuffer'. (defalias 'winum--available-numbers #[nil "\304 \305\n W\203\nTB\nT\211\202*\237)\207" [numbers winum--window-count i --dotimes-limit-- nil 0] 3 (#$ . 21255)]) #@77 Switch to the window WINDOW and switch input focus if on a different frame. (defalias 'winum--switch-to-window #[(window) "\302!\303 !\203 \304 =\204\305 !\210\306!\203!\307!\202%\310\311\")\207" [window frame window-frame frame-live-p selected-frame select-frame-set-input-focus window-live-p select-window error "Got a dead window %S"] 3 (#$ . 21631)]) #@166 Check whether the `winum-scope' has been changed. If a change is detected run `winum--init' to reinitialize all internal data structures according to the new scope. (defalias 'winum--check-for-scope-change #[nil " =?\205 \302 \207" [winum-scope winum--last-used-scope winum--init] 2 (#$ . 22004)]) #@63 Remove FRAME from `winum--frames-table' after it was deleted. (defalias 'winum--remove-deleted-frame-from-frames-table #[(frame) "\205\302 \"\207" [winum--frames-table frame remhash] 3 (#$ . 22312)]) (byte-code "\301\302\303\"\210\304B\305B\306B\307\310!\207" [debug-ignored-errors add-hook delete-frame-functions winum--remove-deleted-frame-from-frames-table "^No window numbered .$" "^Got a dead window .$" "^Invalid `winum-scope': .$" provide winum] 3)