;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\207" [require cl-lib let-alist window-purpose-core window-purpose-utils] 2) #@141 Names of buffers for which the default `display-buffer' and `switch-to-buffer' behavior should not be overridden. This is a list of names. (defvar purpose-action-function-ignore-buffer-names '("^\\*Completions\\*$" "^\\*Ido Completions\\*$" "^\\*Choices\\*$") (#$ . 225)) (byte-code "\300\301\302\303\304DD\305\306\307\310\311\312\313& \210\300\314\302\303\315DD\316\306\307\310\317\312\320& \210\300\321\302\303\322DD\323\306\307\310\317\312\324& \207" [custom-declare-variable purpose-display-fallback funcall function #[0 "\300\207" [pop-up-window] 1] "Fallback action to use when `purpose--action-function' couldn't\ndisplay a buffer.\nThis should be either `pop-up-window' for displaying the buffer in a new\nwindow, `pop-up-frame' for displaying the buffer in a new frame, `error'\nfor signalling an error, or nil for using the regular (purpose-less)\n`display-buffer' behavior.\n`purpose-display-fallback' can also be a display function. In this\ncase, the function is called with two arguments: BUFFER and ALIST, and\nshould return the window that it used to display the buffer.\nAny other value is treated the same as nil." :group purpose :type (choice (const pop-up-window) (const pop-up-frame) (const error) (const nil) function) :package-version (window-purpose . "1.4") purpose-display-buffer-functions #[0 "\300\207" [nil] 1] "Hook to run after displaying a buffer with `purpose--action-function'.\nThis hook is called with one argument - the window used for display." hook (window-purpose . "1.4") purpose-select-buffer-hook #[0 "\300\207" [nil] 1] "Hook to run after selecting a buffer with `purpose-select-buffer'." (window-purpose . "1.2")] 10) #@128 When nil, Purpose's advices and `purpose--action-function' are not used. This is an internal variable, don't set it yourself. (defvar purpose--active-p nil (#$ . 1897)) #@156 Variable used by Purpose's display functions for setting an alist for `purpose--action-function'. This is an internal variable, don't change it yourself. (defvar purpose--alist nil (#$ . 2074)) (defvar purpose-action-sequences '((switch-to-buffer purpose-display-reuse-window-buffer purpose-display-reuse-window-purpose purpose-display-maybe-same-window purpose-display-maybe-other-window purpose-display-maybe-other-frame purpose-display-maybe-pop-up-window purpose-display-maybe-pop-up-frame) (prefer-same-window purpose-display-maybe-same-window purpose-display-reuse-window-buffer purpose-display-reuse-window-purpose purpose-display-maybe-other-window purpose-display-maybe-other-frame purpose-display-maybe-pop-up-window purpose-display-maybe-pop-up-frame) (force-same-window purpose-display-maybe-same-window) (prefer-other-window purpose-display-reuse-window-buffer purpose-display-reuse-window-purpose purpose-display-maybe-pop-up-frame purpose-display-maybe-pop-up-window purpose-display-maybe-other-window purpose-display-maybe-other-frame purpose-display-maybe-same-window) (prefer-other-frame purpose-display-reuse-window-buffer-other-frame purpose-display-reuse-window-purpose-other-frame purpose-display-maybe-other-frame purpose-display-maybe-pop-up-frame purpose-display-maybe-other-window purpose-display-maybe-pop-up-window purpose-display-reuse-window-buffer purpose-display-reuse-window-purpose purpose-display-maybe-same-window))) (defvar purpose-default-action-order 'prefer-other-window) #@545 This variable makes Purpose handle some buffers differently. `purpose-special-action-sequences' should be a list. Each entry in the list is a list itself, where: 1. the entry's first item (entry's car) is a condition 2. the entry's rest items (entry's cdr) are display functions Condition is either a purpose, or a predicate function that takes 3 arguments: PURPOSE, BUFFER, ALIST. When `purpose--action-function' tries to display a buffer, it will try first the action sequences in `purpose-special-action-sequences' whose condition was met. (defvar purpose-special-action-sequences nil (#$ . 3594)) (byte-code "\300\301\302\303\304DD\305\306\307\310\311\312\313& \210\300\314\302\303\315DD\316\306\307\310\317\312\320& \210\300\321\302\303\322DD\323\306\307\310\324\312\325& \210\300\326\302\303\327DD\330\306\307\310\331\312\332& \207" [custom-declare-variable purpose-display-at-top-height funcall function #[0 "\300\207" [8] 1] "Height for new windows created by `purpose-display-at-top'.\nThis should be either a positive integer or a percentage between 0 to 1.\nIf it is a positive integer, it is the number of lines in new windows\ncreated by `purpose-display-at-top'. If it is a percentage, the height\nof new windows will be that percentage out of the frame's total height.\n`purpose-display-at-top-height' can also have a value of nil. In this\ncase, `purpose-display-at-top-height' is ignored." :group purpose :type (choice number (const nil)) :package-version (window-purpose . "1.4") purpose-display-at-bottom-height #[0 "\300\207" [8] 1] "Height for new windows created by `purpose-display-at-bottom'.\nThis should be either a positive integer or a percentage between 0 to 1.\nIf it is a positive integer, it is the number of lines in new windows\ncreated by `purpose-display-at-bottom'. If it is a percentage, the\nheight of new windows will be that percentage out of the frame's total\nheight.\n`purpose-display-at-bottom-height' can also have a value of nil. In\nthis case, `purpose-display-at-bottom-height' is ignored." (choice number (const nil)) (window-purpose . "1.4") purpose-display-at-left-width #[0 "\300\207" [32] 1] "Width for new windows created by `purpose-display-at-left'.\nThis should be either a positive integer or a percentage between 0 to 1.\nIf it is a positive integer, it is the number of lines in new windows\ncreated by `purpose-display-at-left'. If it is a percentage, the width\nof new windows will be that percentage out of the frame's total width.\n`purpose-display-at-left-width' can also have a value of nil. In this\ncase, `purpose-display-at-left-width' is ignored." (choice number (const nil)) (window-purpose . "1.4") purpose-display-at-right-width #[0 "\300\207" [32] 1] "Width for new windows created by `purpose-display-at-right'.\nThis should be either a positive integer or a percentage between 0 to 1.\nIf it is a positive integer, it is the number of lines in new windows\ncreated by `purpose-display-at-right'. If it is a percentage, the\nwidth of new windows will be that percentage out of the frame's total\nwidth.\n`purpose-display-at-right-width' can also have a value of nil. In\nthis case, `purpose-display-at-right-width' is ignored." (choice number (const nil)) (window-purpose . "1.4")] 10) #@326 Display BUFFER in WINDOW, but don't select it. BUFFER, WINDOW, TYPE, ALIST and DEDICATED have the same meaning as in `window--display-buffer'. DEDICATED is ignored for Emacs versions in which `window--display-buffer' doesn't support a DEDICATED argument (i.e. version 27). (fn BUFFER WINDOW TYPE &optional ALIST DEDICATED) (defalias 'purpose-change-buffer #[1283 "\301\302\"\203\303%\207\303$\207" [emacs-version version< "27" window--display-buffer] 11 (#$ . 6872)]) #@127 Return non-nil if WINDOW can be reused to display BUFFER. WINDOW can be reused if it already show BUFFER. (fn WINDOW BUFFER) (defalias 'purpose-window-buffer-reusable-p #[514 "\300\301!\"\207" [eql window-buffer] 5 (#$ . 7361)]) #@167 Return non-nil of WINDOW can be reused for PURPOSE. WINDOW can be reused if it isn't buffer-dedicated and if it already has the purpose PURPOSE. (fn WINDOW PURPOSE) (defalias 'purpose-window-purpose-reusable-p #[514 "\300!?\205 \301\302!\"\207" [window-dedicated-p eql purpose-window-purpose] 6 (#$ . 7600)]) #@475 Return a list of reusable frames. If ALIST contains a `reusable-frames' entry, its value determines which frames to search for a reusable window: nil -- the selected frame A frame -- just that frame `visible' -- all visible frames 0 -- all frames on the current terminal t -- all frames. If ALIST contains no `reusable-frames' entry, search just the selected frame if `pop-up-frames' is nil; search all frames on the current terminal if it's non-nil. (fn ALIST) (defalias 'purpose--reusable-frames #[257 "\211\301\236A\301\236\203\211\202\203\302\202\303\211\204 \304 C\207\305!\203)\211C\207\211\306\267\202;\307 \207\310\311\312 \"\207\312 \207\313\314\"\210\303\207" [pop-up-frames reusable-frames 0 nil selected-frame framep #s(hash-table size 3 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (visible 47 0 50 t 56)) visible-frame-list cl-remove-if-not #[257 "\300\301!\301 \"\207" [eql frame-terminal] 4 "\n\n(fn FRAME)"] frame-list message "Bad value for reusable-frames in ALIST: %S"] 7 (#$ . 7921)]) #@16 (fn WINDOWS) (defalias 'purpose--pick-selected-or-any-window #[257 "\300 >\206\211@\207" [selected-window] 3 (#$ . 8981)]) #@892 Return a window that is already displaying BUFFER. Return nil if no usable window is found. If ALIST has a non-nil `inhibit-same-window' entry, the selected window is not eligible for reuse. If ALIST contains a `reusable-frames' entry, its value determines which frames to search for a reusable window: nil -- the selected frame (actually the last non-minibuffer frame) A frame -- just that frame `visible' -- all visible frames 0 -- all frames on the current terminal t -- all frames. If ALIST contains no `reusable-frames' entry, search just the selected frame if `display-buffer-reuse-frames' and `pop-up-frames' are both nil; search all frames on the current terminal if either of those variables is non-nil. If ALIST has a non-nil `inhibit-switch-frame' entry, then in the event that a window on another frame is chosen, avoid raising that frame. (fn BUFFER ALIST) (defalias 'purpose-display-reuse-window-buffer #[514 "\211\300\236A\301!\302\303\304\"!\305\306\307\310 \"\"\262\203$\311\312 \"\262\313!\262\211\2036\314\315 $\210\207" [inhibit-same-window purpose--reusable-frames purpose-flatten mapcar window-list nil cl-delete-if-not make-closure #[257 "\301\300\"\207" [V0 purpose-window-buffer-reusable-p] 4 "\n\n(fn WINDOW)"] delq selected-window purpose--pick-selected-or-any-window purpose-change-buffer reuse] 12 (#$ . 9116)]) #@949 Display BUFFER in a window that is already used for purpose PURPOSE. Return that window. Return nil if no usable window is found. Windows that are dediacted to their buffers are not eligible for reuse. PURPOSE defaults to BUFFER's purpose. If ALIST has a non-nil `inhibit-same-window' entry, the selected window is not eligible for reuse. If ALIST contains a `reusable-frames' entry, its value determines which frames to search for a reusable window: nil -- the selected frame A frame -- just that frame `visible' -- all visible frames 0 -- all frames on the current terminal t -- all frames. If ALIST contains no `reusable-frames' entry, search just the selected frame if `pop-up-frames' is nil; search all frames on the current terminal if it's non-nil. If ALIST has a non-nil `inhibit-switch-frame' entry, then in the event that a window on another frame is chosen, avoid raising that frame. (fn BUFFER ALIST &optional PURPOSE) (defalias 'purpose-display-reuse-window-purpose #[770 "\300\236A\301!\302\303\304\"!\206\305!\306\307\310\311\"\"\262\203+\312\313 \"\262\314!\262\211\203=\315 \316 $\210\207" [inhibit-same-window purpose--reusable-frames purpose-flatten mapcar window-list purpose-buffer-purpose nil cl-delete-if-not make-closure #[257 "\301\300\"\207" [V0 purpose-window-purpose-reusable-p] 4 "\n\n(fn WINDOW)"] delq selected-window purpose--pick-selected-or-any-window purpose-change-buffer reuse] 14 (#$ . 10503)]) #@911 Return a window that is already displaying BUFFER. Return nil if no usable window is found. Windows in the selected frame are not eligible for reuse, even if `reusable-frames' says to search the selected frame. If ALIST contains a `reusable-frames' entry, its value determines which frames to search for a reusable window: nil -- the selected frame (actually the last non-minibuffer frame) A frame -- just that frame `visible' -- all visible frames 0 -- all frames on the current terminal t -- all frames. If ALIST contains no `reusable-frames' entry, search just the selected frame if `display-buffer-reuse-frames' and `pop-up-frames' are both nil; search all frames on the current terminal if either of those variables is non-nil. If ALIST has a non-nil `inhibit-switch-frame' entry, then in the event that a window on another frame is chosen, avoid raising that frame. (fn BUFFER ALIST) (defalias 'purpose-display-reuse-window-buffer-other-frame #[514 "\300\301 \302!\"\303\304\305\"!\306\307\310\311\"\"\262@\262\211\203(\312\313$\210\207" [cl-delete selected-frame purpose--reusable-frames purpose-flatten mapcar window-list nil cl-delete-if-not make-closure #[257 "\301\300\"\207" [V0 purpose-window-buffer-reusable-p] 4 "\n\n(fn WINDOW)"] purpose-change-buffer reuse] 10 (#$ . 11983)]) #@1068 Display BUFFER in a window that is already used for purpose PURPOSE. Return that window. Return nil if no usable window is found. Windows that are dediacted to their buffers are not eligible for reuse. Windows in the selected frame are not eligible for reuse, even if `reusable-frames' says to search the selected frame. PURPOSE defaults to BUFFER's purpose. If ALIST has a non-nil `inhibit-same-window' entry, the selected window is not eligible for reuse. If ALIST contains a `reusable-frames' entry, its value determines which frames to search for a reusable window: nil -- the selected frame A frame -- just that frame `visible' -- all visible frames 0 -- all frames on the current terminal t -- all frames. If ALIST contains no `reusable-frames' entry, search just the selected frame if `pop-up-frames' is nil; search all frames on the current terminal if it's non-nil. If ALIST has a non-nil `inhibit-switch-frame' entry, then in the event that a window on another frame is chosen, avoid raising that frame. (fn BUFFER ALIST &optional PURPOSE) (defalias 'purpose-display-reuse-window-purpose-other-frame #[770 "\300\301 \302!\"\303\304\305\"!\206\306!\307\310\311\312\"\"\262@\262\211\203/\313\314 $\210\207" [cl-delete selected-frame purpose--reusable-frames purpose-flatten mapcar window-list purpose-buffer-purpose nil cl-delete-if-not make-closure #[257 "\301\300\"\207" [V0 purpose-window-purpose-reusable-p] 4 "\n\n(fn WINDOW)"] purpose-change-buffer reuse] 12 (#$ . 13318)]) #@135 Display BUFFER in selected window, no matter what. This function ignores window dedication and any entry in ALIST. (fn BUFFER ALIST) (defalias 'purpose-display-same-window #[514 "\300\301 \302$\210\301 \207" [purpose-change-buffer selected-window reuse] 7 (#$ . 14847)]) #@435 Display BUFFER in selected window, if possible. Return selected window if BUFFER was displayed, otherwise nil. It is not possible to display BUFFER in selected window if any of following is true: - selected window is dedicated to its buffer, and that buffer is not BUFFER itself - selected window is dedicated to its purpose, and BUFFER has a different purpose - entry `inhibit-same-window' in ALIST is non-nil (fn BUFFER ALIST) (defalias 'purpose-display-maybe-same-window #[514 "\211\300\236A\301 \206!\302 \203\303\304 \305!\"?\206!\211\206!\306 ?\205)\307\"\207" [inhibit-same-window window-dedicated-p purpose-window-purpose-dedicated-p eql purpose-window-purpose purpose-buffer-purpose window-minibuffer-p purpose-display-same-window] 8 (#$ . 15128)]) #@282 Return windows in FRAME that can be used to display BUFFER. Possible windows to use match these requirements: - window is not dediacted to its buffer - window is not dediacted to its purpose, or BUFFER has the same purpose FRAME defaults to the selected frame. (fn FRAME BUFFER) (defalias 'purpose-display--frame-usable-windows #[514 "\300\301\302\"\303!\"\207" [cl-remove-if-not make-closure #[257 "\301!\203\302\303!\300\"\205$\304!\203 \302\305!\306\300!\"\205$\307!?\207" [V0 window-dedicated-p eql window-buffer purpose-window-purpose-dedicated-p purpose-window-purpose purpose-buffer-purpose window-minibuffer-p] 5 "\n\n(fn WINDOW)"] window-list] 6 (#$ . 15909)]) #@312 Disply BUFFER in another window in the selected frame, if possible. Return that window. Return nil if no usable window is found. Possible windows to use match these requirements: - window is not dedicated to its buffer - window is not dedicated to its purpose, or BUFFER has the same purpose (fn BUFFER ALIST) (defalias 'purpose-display-maybe-other-window #[514 "\300\301\300\"\300\302\303 \"\262@\262\211\205\304\305$\210\211\207" [nil purpose-display--frame-usable-windows delete selected-window purpose-change-buffer reuse] 10 (#$ . 16600)]) #@351 Display BUFFER in another window in another frame, if possible. Return that window. Return nil if no usable window is found. Possible windows to use match these requirements: - window is not dedicated to its buffer - window is no dedicated to its purpose, or BUFFER has the same purpose This function doesn't raise the new frame. (fn BUFFER ALIST) (defalias 'purpose-display-maybe-other-frame #[514 "\300\301\302\303\304\"\305\306 \307 \"\"!\211@\211\205\310\311$\210\211\207" [nil purpose-flatten mapcar make-closure #[257 "\301\300\"\207" [V0 purpose-display--frame-usable-windows] 4 "\n\n(fn FRAME)"] remove selected-frame frame-list purpose-change-buffer reuse] 10 (#$ . 17164)]) #@364 Display BUFFER in a new window. If possible, the window is split in a sensible way. Otherwise, if FORCE-SPLIT is non-nil, the window is split vertically. The window that is split is either the largest window, or the least recently used window. If couldn't get the largest or least recently used window, split the selected window. (fn BUFFER ALIST FORCE-SPLIT) (defalias 'purpose-display-pop-up-window--internal #[771 "\301\302\303\"\206\304\302\303\"\206\305 \306!\206\205\307!\211\205+\310\311%\210\211\207" [display-buffer-mark-dedicated get-largest-window nil t get-lru-window selected-window split-window-sensibly split-window purpose-change-buffer window] 11 (#$ . 17866)]) #@367 Display BUFFER in a new window. The value of `pop-up-windows' is ignored. If possible, the window is split in a sensible way. Otherwise, it is simply split vertically. The window that is split is either the largest window, or the least recently used window. If couldn't get the largest or least recently used window, split the selected window. (fn BUFFER ALIST) (defalias 'purpose-display-pop-up-window #[514 "\300\301#\207" [purpose-display-pop-up-window--internal t] 6 (#$ . 18572)]) #@185 Display BUFFER in a new window, if possible. The display is possible if `pop-up-windows' is non-nil. The display is done similar to `display-buffer-pop-up-window'. (fn BUFFER ALIST) (defalias 'purpose-display-maybe-pop-up-window #[514 "\205 \301\302#\207" [pop-up-windows purpose-display-pop-up-window--internal nil] 6 (#$ . 19071)]) #@602 Display BUFFER in a new frame. This works by calling `pop-up-frame-function'. If successful, return the window used. Otherwise return nil. If ALIST has a non-nil `inhibit-switch-frame' entry, avoid raising the new frame. Variable `pop-up-frame-alist' is an alist of frame parameters for the new frame. If ALIST has a non-nil `pop-up-frame-parameters' entry, its value should be an alist of frame parameters to give the new frame. The values of `pop-up-frame-alist' and `pop-up-frame-parameters' are used both. In case of conflict, `pop-up-frame-parameters' takes precedence. (fn BUFFER ALIST) (defalias 'purpose-display-pop-up-frame #[514 "\211\303\236A\304\" \205rq\210 )\211\205\305!\211\205)\306\307\n%)\207" [pop-up-frame-alist pop-up-frame-function display-buffer-mark-dedicated pop-up-frame-parameters purpose-alist-combine frame-selected-window purpose-change-buffer frame] 12 (#$ . 19418)]) #@224 Display BUFFER in a new frame, if possible. The display is possible if `pop-up-frames' is non-nil (and not `graphic-only' on a text-only terminal). The display is done with `display-buffer-pop-up-frame'. (fn BUFFER ALIST) (defalias 'purpose-display-maybe-pop-up-frame #[514 "\301=\203 \302 \202\f\205\303\"\207" [pop-up-frames graphic-only display-graphic-p purpose-display-pop-up-frame] 5 (#$ . 20349)]) #@329 Convert HEIGHT into a number of lines. HEIGHT can be either a positive integer (number of lines), a percentage (number of lines relative to FRAME's height) or nil. If HEIGHT is nil, nil is returned, otherwise return the number of lines represented by HEIGHT. FRAME defaults to the selected frame. (fn HEIGHT &optional FRAME) (defalias 'purpose--normalize-height #[513 "\204\207\300W\203\301W\203\302\303!_!\207\250\203'\300V\203'\207\304\305\306D\"\207" [0 1 round frame-height signal wrong-type-argument "positive integer or percentage"] 6 (#$ . 20770)]) #@323 Convert WIDTH into a number of lines. WIDTH can be either a positive integer (number of lines), a percentage (number of lines relative to FRAME's width) or nil. If WIDTH is nil, nil is returned, otherwise return the number of lines represented by WIDTH. FRAME defaults to the selected frame. (fn WIDTH &optional FRAME) (defalias 'purpose--normalize-width #[513 "\204\207\300W\203\301W\203\302\303!_!\207\250\203'\300V\203'\207\304\305\306D\"\207" [0 1 round frame-width signal wrong-type-argument "positive integer or percentage"] 6 (#$ . 21354)]) #@759 Try to display a buffer in an existing window or in a new window. If the window returned by WINDOW-GETTER already displays BUFFER, or has the same purpose as BUFFER and is not buffer-dedicated, use it to display BUFFER. Otherwise, call WINDOW-CREATOR to create a new window, and display BUFFER in the new WINDOW. WINDOW-GETTER specifies which existing window to reuse for display. It should be a function that takes no arguments and returns a live window. WINDOW-CREATOR specifies how to create a new window for display, if necessary. It should be a function that takes no arguments and returns a live window. BUFFER is a buffer that should be displayed. ALIST has the same meaning as in `display-buffer'. (fn WINDOW-GETTER WINDOW-CREATOR BUFFER ALIST) (defalias 'purpose-display--at #[1028 " \211\203\300\"\204\301\302!\"\203\303\304$\210\207 \211\205-\303\305$\210\211\207" [purpose-window-buffer-reusable-p purpose-window-purpose-reusable-p purpose-buffer-purpose purpose-change-buffer reuse window] 11 (#$ . 21930)]) #@585 Display BUFFER at the top window, create such window if necessary. "top window" is a window as returned by `purpose-get-top-window'. ALIST is for compatibility with `display-buffer' and is ignored. HEIGHT specifies the height of the new window, if a new window needs to be created, and can take the same values as `purpose-display-at-top-height'. If HEIGHT is nil, then the height of the new window is specified by `purpose-display-at-top-height'. If `purpose-display-at-top-height' is also nil, then the new window will have the default height. (fn BUFFER ALIST &optional HEIGHT) (defalias 'purpose-display-at-top #[770 "\300\301\302\303\"$\207" [purpose-display--at purpose-get-top-window make-closure #[0 "\302\300\206 !\211\205 \211[\3031\304\305 \306#0\207\210\307\207" [V0 purpose-display-at-top-height purpose--normalize-height (error) split-window frame-root-window above nil] 6]] 8 (#$ . 22983)]) #@602 Display BUFFER at the bottom window, create such window if necessary. "bottom window" is a window as returned by `purpose-get-bottom-window'. ALIST is for compatibility with `display-buffer' and is ignored. HEIGHT specifies the height of the new window, if a new window needs to be created, and can take the same values as `purpose-display-at-bottom-height'. If HEIGHT is nil, then the height of the new window is specified by `purpose-display-at-bottom-height'. If `purpose-display-at-bottom-height' is also nil, then the new window will have the default height. (fn BUFFER ALIST &optional HEIGHT) (defalias 'purpose-display-at-bottom #[770 "\300\301\302\303\"$\207" [purpose-display--at purpose-get-bottom-window make-closure #[0 "\302\300\206 !\211\205 \211[\3031\304\305 \306#0\207\210\307\207" [V0 purpose-display-at-bottom-height purpose--normalize-height (error) split-window frame-root-window below nil] 6]] 8 (#$ . 23908)]) #@582 Display BUFFER at the left window, create such window if necessary. "left window" is a window as returned by `purpose-get-left-window'. ALIST is for compatibility with `display-buffer' and is ignored. WIDTH specifies the width of the new window, if a new window needs to be created, and can take the same values as `purpose-display-at-left-width'. If WIDTH is nil, then the width of the new window is specified by `purpose-display-at-left-width'. If `purpose-display-at-left-width' is also nil, then the new window will have the default width. (fn BUFFER ALIST &optional WIDTH) (defalias 'purpose-display-at-left #[770 "\300\301\302\303\"$\207" [purpose-display--at purpose-get-left-window make-closure #[0 "\302\300\206 !\211\205 \211[\3031\304\305 \306#0\207\210\307\207" [V0 purpose-display-at-left-width purpose--normalize-width (error) split-window frame-root-window left nil] 6]] 8 (#$ . 24859)]) #@588 Display BUFFER at the right window, create such window if necessary. "right window" is a window as returned by `purpose-get-right-window'. ALIST is for compatibility with `display-buffer' and is ignored. WIDTH specifies the width of the new window, if a new window needs to be created, and can take the same values as `purpose-display-at-right-width'. If WIDTH is nil, then the width of the new window is specified by `purpose-display-at-right-width'. If `purpose-display-at-right-width' is also nil, then the new window will have the default width. (fn BUFFER ALIST &optional WIDTH) (defalias 'purpose-display-at-right #[770 "\300\301\302\303\"$\207" [purpose-display--at purpose-get-right-window make-closure #[0 "\302\300\206 !\211\205 \211[\3031\304\305 \306#0\207\210\307\207" [V0 purpose-display-at-right-width purpose--normalize-width (error) split-window frame-root-window right nil] 6]] 8 (#$ . 25781)]) #@84 Determine whether `purpose--action-function' should run or not. (fn BUFFER ALIST) (defalias 'purpose--use-action-function-p #[514 "\205?\303\236A?\205?\304! \305\306:\2036@\262\305\306\307#)\266\203?\211\262\2036A\262\202\211\205;\306\266\203\262\207" [purpose--active-p purpose-action-function-ignore-buffer-names inhibit-changing-match-data inhibit-purpose buffer-name nil t string-match] 13 (#$ . 26712)]) #@569 Return special action sequences to use for display BUFFER. This function loops over list `purpose-special-action-sequences' and for each entry in the list: - check if the entry's condition (entry's car): a. is equal to BUFFER's purpose, or b. is a function that returns non-nil when called with these 3 arguments: buffer's purpose, BUFFER, ALIST. - if so, append the entry's action sequence to the result The function returns a list of display functions that `purpose--action-function' should use before trying the regular action sequence. (fn BUFFER ALIST) (defalias 'purpose--special-action-sequence #[514 "\301!\302\303\211\211:\203>@\262\211A\262\242\262\304\"\2042\305!\2037  #\2037B\262A\262\202\211\237\266\204!\207" [purpose-special-action-sequences purpose-buffer-purpose purpose-flatten nil eql functionp] 12 (#$ . 27152)]) #@272 Action function to use for overriding default display-buffer behavior. This function should be used by setting `display-buffer-overriding-action' to (purpose--action-function . nil). If ALIST is nil, it is ignored and `purpose--alist' is used instead. (fn BUFFER ALIST) (defalias 'purpose--action-function #[514 "\304\"\262\305\306#\210\307\"\205\267\211\310\236A\311\236A\312\"\313\206) \n\"\314#\211\315\203P\211\204PA\305\316@\"\210@\f\f\"\262\262\2022\262\211\203Z\211\202\245 \317\267\202z\305\320!\210\321\n\n\"\202\245\305\322!\210\323\n\n\"\202\245 \324=\204\206\325=\203\214\324\326!\202\245\327 !\203\240\305\330 \"\210 \n\n\"\202\245\305\331!\210\315\332!\205\261\211\333\334\"\210\262\266\207\262\207" [purpose--alist purpose-default-action-order purpose-action-sequences purpose-display-fallback purpose-alist-combine purpose-message "Purpose display: Buffer: %S; Alist: %S" purpose--use-action-function-p user-action-sequence action-order purpose--special-action-sequence purpose-alist-get append nil "trying: %S" #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (pop-up-frame 96 pop-up-window 109)) "trying fallback: purpose-display-pop-up-frame" purpose-display-pop-up-frame "trying fallback: purpose-display-pop-up-window" purpose-display-pop-up-window error force-same-window "No window available" functionp "trying custom fallback %s" "falling back to regular display-buffer" windowp run-hook-with-args purpose-display-buffer-functions] 15 (#$ . 28031)]) #@279 Display buffer BUFFER-OR-NAME in window and then select that window. ACTION-ORDER is used as the `action-order' entry in `purpose--action-function''s alist. This function runs hook `purpose-select-buffer-hook' when its done. (fn BUFFER-OR-NAME &optional ACTION-ORDER NORECORD) (defalias 'purpose-select-buffer #[769 "\301!\302\303#\304 \305!\306!\203'\211=\204!\307\"\210\310\"\210\311\312!\210)\207" [purpose--alist window-normalize-buffer-to-switch-to purpose-alist-set action-order selected-frame display-buffer window-frame select-frame-set-input-focus select-window run-hooks purpose-select-buffer-hook] 10 (#$ . 29603)]) #@312 Select buffer BUFFER-OR-NAME, preferably in the selected window. If FORCE-SAME-WINDOW is non-nil, don't select a different window if the currently selected window is not available. If BUFFER-OR-NAME is nil, select the buffer returned by `other-buffer'. (fn BUFFER-OR-NAME &optional NORECORD FORCE-SAME-WINDOW) (defalias 'purpose-switch-buffer #[769 "\300\301!\203\f\302\202 \303#\207" [purpose-select-buffer window-normalize-buffer-to-switch-to force-same-window switch-to-buffer] 7 (#$ . 30255) (byte-code "\300\301!C\207" [read-buffer-to-switch "[PU] Switch to buffer: "] 2)]) #@206 Select buffer BUFFER-OR-NAME in another window. Never selects the currently selected window. If BUFFER-OR-NAME is nil, select the buffer returned by `other-buffer'. (fn BUFFER-OR-NAME &optional NORECORD) (defalias 'purpose-switch-buffer-other-window #[513 "\302\303\304\302#\305\306!\307#*\207" [purpose--alist pop-up-windows t purpose-alist-set inhibit-same-window purpose-select-buffer window-normalize-buffer-to-switch-to prefer-other-window] 7 (#$ . 30847) (byte-code "\300\301!C\207" [read-buffer-to-switch "[PU] Switch to buffer: "] 2)]) #@172 Select buffer BUFFER-OR-NAME, preferably in another frame. If BUFFER-OR-NAME is nil, select the buffer returned by `other-buffer'. (fn BUFFER-OR-NAME &optional NORECORD) (defalias 'purpose-switch-buffer-other-frame #[513 "\302\303\304\302#\305\306!\307#*\207" [purpose--alist pop-up-frames t purpose-alist-set inhibit-same-window purpose-select-buffer window-normalize-buffer-to-switch-to prefer-other-frame] 7 (#$ . 31404) (byte-code "\300\301!C\207" [read-buffer-to-switch "[PU] Switch to buffer: "] 2)]) #@173 Select buffer BUFFER-OR-NAME, preferably in another window. If BUFFER-OR-NAME is nil, select the buffer returned by `other-buffer'. (fn BUFFER-OR-NAME &optional NORECORD) (defalias 'purpose-pop-buffer #[513 "\300\301!\302#\207" [purpose-select-buffer window-normalize-buffer-to-switch-to prefer-other-window] 6 (#$ . 31924) (byte-code "\300\301!C\207" [read-buffer-to-switch "[PU] Switch to buffer: "] 2)]) #@178 Select buffer BUFFER-OR-NAME, preferably in the selected window. If BUFFER-OR-NAME is nil, select the buffer returned by `other-buffer'. (fn BUFFER-OR-NAME &optional NORECORD) (defalias 'purpose-pop-buffer-same-window #[513 "\300\301!\302#\207" [purpose-select-buffer window-normalize-buffer-to-switch-to prefer-same-window] 6 (#$ . 32341) (byte-code "\300\301!C\207" [read-buffer-to-switch "[PU] Switch to buffer: "] 2)]) #@66 Return appropriate `action-order' value for ACTION. (fn ACTION) (defalias 'purpose-display--action-to-order #[257 "\211?#\207#\207" [purpose-message "switch-to-buffer advice" purpose--use-action-function-p window-normalize-buffer-to-switch-to nil purpose-switch-buffer called-interactively-p interactive ivy--switch-buffer-action purpose--function-stack] 9 (#$ . 33796)]) #@263 Advice for overriding `switch-to-buffer-other-window' conditionally. If Purpose is active (`purpose--active-p' is non-nil), call `purpose-switch-buffer-other-window', otherwise call `switch-to-buffer-other-window'. (fn OLDFUN BUFFER-OR-NAME &optional NORECORD) (defalias 'purpose-switch-to-buffer-other-window-advice #[770 "\301\302!\210\203 \303\"\207\"\207" [purpose--active-p purpose-message "switch-to-buffer-other-window advice" purpose-switch-buffer-other-window] 6 (#$ . 34427)]) #@260 Advice for overriding `switch-to-buffer-other-frame' conditionally. If Purpose is active (`purpose--active-p' is non-nil), call `purpose-switch-buffer-other-frame', otherwise call `switch-to-buffer-other-frame'. (fn OLDFUN BUFFER-OR-NAME &optional NORECORD) (defalias 'purpose-switch-to-buffer-other-frame-advice #[770 "\301\302!\210\203 \303\"\207\"\207" [purpose--active-p purpose-message "switch-to-buffer-other-frame advice" purpose-switch-buffer-other-frame] 6 (#$ . 34929)]) #@240 Advice for overriding `pop-to-buffer' conditionally. If Purpose is active (`purpose--active-p' is non-nil) and ACTION is nil, call `purpose-pop-buffer', otherwise call `pop-to-buffer'. (fn OLDFUN BUFFER-OR-NAME &optional ACTION NORECORD) (defalias 'purpose-pop-to-buffer-advice #[1026 "\301\302!\210\203\204\303\"\207#\207" [purpose--active-p purpose-message "pop-to-buffer advice" purpose-pop-buffer] 8 (#$ . 35425)]) #@251 Advice for overriding `pop-to-buffer-same-window' conditionally. If Purpose is active (`purpose--active-p' is non-nil), call `purpose-pop-buffer-same-window', otherwise call `pop-to-buffer-same-window'. (fn OLDFUN BUFFER-OR-NAME &optional NORECORD) (defalias 'purpose-pop-to-buffer-same-window-advice #[770 "\301\302!\210\203 \303\"\207\"\207" [purpose--active-p purpose-message "pop-to-buffer-same-window advice" purpose-pop-buffer-same-window] 6 (#$ . 35864)]) #@128 Make Purpose inactive while executing BODY. This works internally by temporarily setting `purpose--active-p'. (fn &rest BODY) (defalias 'without-purpose '(macro . #[128 "\300\301BB\207" [let ((purpose--active-p nil))] 4 (#$ . 36342)])) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put without-purpose lisp-indent-function defun put edebug-form-spec body] 5) #@148 Create a command that runs COMMAND with purpose inactive. This works internally by using `without-purpose' and `call-interactively'. (fn COMMAND) (defalias 'without-purpose-command '(macro . #[257 "\300\301\302\303\304DDF\207" [lambda nil (interactive) without-purpose call-interactively] 7 (#$ . 36726)])) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put without-purpose-command lisp-indent-function defun put edebug-form-spec function-form] 5) #@66 Prompt the user for a buffer with purpose PURPOSE. (fn PURPOSE) (defalias 'purpose-read-buffers-with-purpose #[257 "\300\301\302\303\304p\305!\"\"\"\207" [completing-read "[PU] Buffer: " mapcar buffer-name delq purpose-buffers-with-purpose] 9 (#$ . 37197)]) #@182 Prompt the user and switch to a buffer with purpose PURPOSE. If called interactively, or with PURPOSE nil, PURPOSE defaults to the current buffer's purpose. (fn &optional PURPOSE) (defalias 'purpose-switch-buffer-with-purpose #[256 "\300\301\206 \302p!!!\207" [purpose-switch-buffer purpose-read-buffers-with-purpose purpose-buffer-purpose] 5 (#$ . 37465) nil]) #@86 Like `purpose-switch-buffer-with-purpose', but first choose a PURPOSE. (fn PURPOSE) (defalias 'purpose-switch-buffer-with-some-purpose #[257 "\300!\207" [purpose-switch-buffer-with-purpose] 3 (#$ . 37836) (byte-code "\300\301\302\303\304 \"\305#C\207" [purpose-read-purpose "Purpose: " cl-delete-if-not purpose-buffers-with-purpose purpose-get-all-purposes t] 5)]) #@223 Prompt the user and switch to a buffer with purpose PURPOSE. The buffer is display in another window. If called interactively, or with PURPOSE nil, PURPOSE defaults to the current buffer's purpose. (fn &optional PURPOSE) (defalias 'purpose-switch-buffer-with-purpose-other-window #[256 "\300\301\206 \302p!!!\207" [purpose-switch-buffer-other-window purpose-read-buffers-with-purpose purpose-buffer-purpose] 5 (#$ . 38210) nil]) #@222 Prompt the user and switch to a buffer with purpose PURPOSE. The buffer is display in another frame. If called interactively, or with PURPOSE nil, PURPOSE defaults to the current buffer's purpose. (fn &optional PURPOSE) (defalias 'purpose-switch-buffer-with-purpose-other-frame #[256 "\300\301\206 \302p!!!\207" [purpose-switch-buffer-other-frame purpose-read-buffers-with-purpose purpose-buffer-purpose] 5 (#$ . 38649) nil]) #@914 Generate lambda to display a buffer and purpose-dedicate its window. The generated lambda takes two arguments - BUFFER and ALIST. It tries to display BUFFER, and if successful it purpose-dedicates the window used for display. DISPLAY-FN is the function used for displaying the buffer. EXTRA-ARGS is additional arguments to pass to DISPLAY-FN, and should be a list. The display is done by calling DISPLAY-FN with arguments BUFFER, ALIST and EXTRA-ARGS, like so: (apply display-fn buffer alist extra-args). Example of how this macro might be used: (defalias 'display-at-bottom-and-dedicate (purpose-generate-display-and-dedicate 'purpose-display-at-bottom)) Another example: (add-to-list purpose-special-action-sequences `(terminal ,(purpose-generate-display-and-dedicate purpose-display-at-bottom 6))) (fn DISPLAY-FN &rest EXTRA-ARGS) (defalias 'purpose-generate-display-and-dedicate '(macro . #[385 "\300\301\302\303\304\305\306\307 B\257DC\310BBE\207" [lambda (buffer alist) let window apply buffer alist list ((when window (purpose-set-window-purpose-dedicated-p window t)) window)] 12 (#$ . 39085)])) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put purpose-generate-display-and-dedicate lisp-indent-function defun put edebug-form-spec (function-form &rest sexp)] 5) #@701 Generate a lambda to display a buffer and execute additional actions. The generated lambda receives two arguments - buffer and alist - and can be used as a display function. The buffer is displayed by calling DISPLAY-FN with arguments two arguments - buffer and alist. If the display is successful, DO-FN is called with one argument - the window that was used for displaying the buffer. The lambda returns the window used for display, or nil if display was unsuccessful. Possible usage: (defalias 'display-at-left-and-do-stuff (purpose-generate-display-and-do 'purpose-display-at-left (lambda (window) (message "Let's do stuff!!")))) (fn DISPLAY-FN DO-FN) (defalias 'purpose-generate-display-and-do '(macro . #[514 "\300\301\302\303\304\305BBDC\306\303\304\307BBE\310BBBE\207" [lambda (buffer alist) let window funcall (buffer alist) when (window) (window)] 11 (#$ . 40462)])) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put purpose-generate-display-and-do lisp-indent-function defun put edebug-form-spec (function-form function-form)] 5) #@228 Override `purpose-special-action-sequences' temporarily. Set ACTIONS as `purpose-special-action-sequences' while BODY is executed. `purpose-special-action-sequences' is restored after BODY is executed. (fn ACTIONS &rest BODY) (defalias 'purpose-with-temp-display-actions '(macro . #[385 "\300\301DCBB\207" [let purpose-special-action-sequences] 5 (#$ . 41574)])) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put purpose-with-temp-display-actions lisp-indent-function 1 put edebug-form-spec (sexp body)] 5) #@303 Override `purpose-special-action-sequences' temporarily. Shortcut for using `purpose-with-temp-display-actions' with only one action. ACTION should be an entry suitable for `purpose-special-action-sequences'. BODY has the same meaning as in `purpose-with-temp-display-actions'. (fn ACTION &rest BODY) (defalias 'purpose-with-temp-display-action '(macro . #[385 "\300\301DBB\207" [purpose-with-temp-display-actions list] 5 (#$ . 42107)])) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put purpose-with-temp-display-action lisp-indent-function 1 put edebug-form-spec (sexp body)] 5) #@258 Add to `purpose-special-action-sequences' temporarily. ACTIONS is a list of actions that are added to `purpose-special-action-sequences' while BODY is executed. `purpose-special-action-sequences' is restored after BODY is executed. (fn ACTIONS &rest BODY) (defalias 'purpose-with-additional-display-actions '(macro . #[385 "\300\301\302\303BBDCBB\207" [let purpose-special-action-sequences append (purpose-special-action-sequences)] 7 (#$ . 42714)])) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put purpose-with-additional-display-actions lisp-indent-function 1 put edebug-form-spec (sexp body)] 5) #@313 Add to `purpose-special-action-sequences' temporarily. Shortcut for using `purpose-with-additional-display-actions' with only one action. ACTION should be an entry suitable for `purpose-special-action-sequences'. BODY has the same meaning as in `purpose-with-additional-display-actions'. (fn ACTION &rest BODY) (defalias 'purpose-with-additional-display-action '(macro . #[385 "\300\301DBB\207" [purpose-with-additional-display-actions list] 5 (#$ . 43341)])) (byte-code "\300\301\302\303#\304\301\305\306#\210\307\310!\207" [function-put purpose-with-additional-display-action lisp-indent-function 1 put edebug-form-spec (sexp body) provide window-purpose-switch] 5)