;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\207" [require window-purpose-switch window-purpose-configuration] 2) #@284 List of functions that toggle fixes. Each function in the list is responsible to toggle a fix. Each function should take no argument, and enable its fix if `purpose-mode' is non-nil, and disable it if `purpose-mode' is nil. Functions should be added to this variable via `add-hook'. (defvar purpose-fix-togglers-hook nil (#$ . 192)) #@309 Add advice or remove advice, depending on the value of `purpose-mode'. If `purpose-mode' is active, then add FUNCTION to SYMBOL according to WHERE, otherwise remove FUNCTION from SYMBOL. Refer to `advice-add' and `advice-remove' for further details of SYMBOL, WHERE and FUNCTION. (fn SYMBOL WHERE FUNCTION) (defalias 'purpose-fix-toggle-advice #[771 "\203\n\301#\207\302\"\207" [purpose-mode advice-add advice-remove] 7 (#$ . 532)]) #@157 Creates an advice toggler and optionally toggle on the advice. SYMBOL WHERE and FUNCTION have the same meaning as `advice-add'. (fn SYMBOL WHERE FUNCTION) (defalias 'purpose-fix-install-advice-toggler '(macro . #[771 "9\203 \202:\205A@\300\301\302\"!\303\304F\305\306\307DD\310\311\304\f\f\fFFE\312\313\307DEF\207" [intern format "purpose--fix-%s-advice-toggler" progn purpose-fix-toggle-advice unless fboundp function defun nil add-hook 'purpose-fix-togglers-hook] 16 (#$ . 980)])) (put 'purpose-fix-install-advice-toggler 'edebug-form-spec '(functionp symbolp function-form)) #@33 Integrates Edebug with Purpose. (defalias 'purpose--fix-edebug #[0 "\300\301\302\"\207" [eval-after-load edebug #[0 "\300\301\302\"\210\303\304\305\301#\210\306\307!\204\300\307\310\"\210\311\312\307\"\207" [defalias purpose--edebug-pop-to-buffer-advice #[513 "\300!\203\301!=\203\211\202*\301 =\203\302 \202*\303\304\"\206*\303\305!!\262\306\"\210\307!\210\310\311 !\312>\204C\313\311 !\210\314\304\"\207" [edebug-window-live-p window-buffer selected-window get-buffer-window 0 pop-to-buffer set-window-buffer select-window framep selected-frame (nil t pc) x-focus-frame set-window-hscroll] 5 "Reimplements `edebug-pop-to-buffer' using `pop-to-buffer'\n\nSince `edebug-pop-to-buffer' simply splits the last selected\nwindow before the minibuffer was popped up, the window it picks\nto display a edebug buffer does not respect `window-purpose' as\nall. This advice reimplements it by replacing the window\nspliting logic with `pop-to-buffer'.\n\n(fn BUFFER &optional WINDOW)"] purpose-fix-toggle-advice edebug-pop-to-buffer :override fboundp purpose--fix-edebug-pop-to-buffer-advice-toggler #[0 "\300\301\302\303#\207" [purpose-fix-toggle-advice edebug-pop-to-buffer :override purpose--edebug-pop-to-buffer-advice] 4] add-hook purpose-fix-togglers-hook] 4]] 3 (#$ . 1588)]) #@58 Integrate Purpose and `compilation-next-error-function'. (defalias 'purpose--fix-compilation-next-error-function #[0 "\300\301\302\"\207" [eval-after-load compile #[0 "\300\301\302\"\210\303\304\305\301#\210\306\307!\204\300\307\310\"\210\311\312\307\"\207" [defalias purpose--compilation-next-error-function #[385 "\300\301\302 !!\303!\204\304\"\207\305\306\"\210\307\310#\216\304\")\207" [get-buffer-window marker-buffer point-marker window-dedicated-p apply set-window-dedicated-p t make-closure #[0 "\302\300\301\"\207" [V0 V1 set-window-dedicated-p] 3]] 8 "Prevents `compilation-next-error-function'from hiding the compilation buffer.\n\nThis is done by ensuring that the buffer is dedicated for the\nduration of the function.\n\n(fn OLDFUN &rest ARGS)"] purpose-fix-toggle-advice compilation-next-error-function :around fboundp purpose--fix-compilation-next-error-function-advice-toggler #[0 "\300\301\302\303#\207" [purpose-fix-toggle-advice compilation-next-error-function :around purpose--compilation-next-error-function] 4] add-hook purpose-fix-togglers-hook] 4]] 3 (#$ . 2892)]) #@101 Set `isearch--display-help-action'. Prevents `isearch-describe-*' commands from bypassing purpose. (defalias 'purpose--fix-isearch #[0 "\300\301\302\"\207" [eval-after-load isearch #[0 "\301\211\207" [isearch--display-help-action (purpose--action-function)] 2]] 3 (#$ . 4002)]) #@361 Integrate `window-purpose' and `next-error'. Under `next-error-follow-minor-mode', `next-error-no-select' will override window-purpose's `display-buffer-overriding-action'. This will result in source buffers not displaying in the purpose-dedicated window for source code in complex window layouts. This fix makes sure `next-error' works with window-purpose. (defalias 'purpose--fix-next-error #[0 "\300\301\302\"\210\303\304\305\301#\210\306\307!\204\300\307\310\"\210\311\312\307\"\207" [defalias purpose--next-error #[385 "\301\302\")\207" [display-buffer-overriding-action (purpose--action-function) apply] 5 "Make sure `next-error' respects `purspose--action-function'.\n\n(fn OLDFUN &rest ARGS)" #[257 "\300!\207" [advice-eval-interactive-spec] 3 "\n\n(fn SPEC)"]] purpose-fix-toggle-advice next-error :around fboundp purpose--fix-next-error-advice-toggler #[0 "\300\301\302\303#\207" [purpose-fix-toggle-advice next-error :around purpose--next-error] 4] add-hook purpose-fix-togglers-hook] 4 (#$ . 4289)]) #@49 Add hydra's LV buffer to Purpose's ignore list. (defalias 'purpose--fix-hydra-lv #[0 "\300\301\302\"\207" [eval-after-load lv #[0 "\300\301\302\"\207" [add-to-list purpose-action-function-ignore-buffer-names "^ \\*LV\\*$"] 3]] 3 (#$ . 5315)]) #@33 Purpose configuration for helm. (defvar purpose--helm-conf (purpose-conf "helm" :regexp-purposes '(("^\\*Helm" . helm) ("^\\*helm" . helm))) (#$ . 5564)) #@107 Fix issues with helm. Add helm's buffers to Purposes's ignore list. Install helm's purpose configuration. (defalias 'purpose--fix-helm #[0 "\300\301\302\"\210\300\301\303\"\210\300\301\304\"\207" [eval-after-load helm #[0 "\300\301\302\"\207" [add-to-list purpose-action-function-ignore-buffer-names "^\\*Helm"] 3] #[0 "\300\301\302\"\207" [add-to-list purpose-action-function-ignore-buffer-names "^\\*helm"] 3] #[0 "\301\302\"\207" [purpose--helm-conf purpose-set-extension-configuration :helm] 3]] 3 (#$ . 5725)]) #@38 Create neotree window, with Purpose. (defalias 'purpose--fix-create-neo-window #[0 "\300\301!\302!\303\"\210\304 \210\305 \210\207" [neo-global--get-buffer t display-buffer neo-window--init neo-global--attach neo-global--reset-width] 5 (#$ . 6248)]) #@58 Display neotree window, with Purpose. (fn BUFFER ALIST) (defalias 'purpose--fix-display-neotree #[514 "\301 \302=\203\f\302\202 \303\304\305#\306\307$\210\207" [neo-window-position frame-root-window left right split-window nil purpose-change-buffer window] 10 (#$ . 6507)]) #@226 Integrate neotree with Purpose. Override the display and creation of the neotree window. When opening files from the neotree window, use Purpose only when necessary. Note: Don't call this function before `neotree' is loaded. (defalias 'purpose--fix-neotree-1 #[0 "\301\302\303\"\210\301\304\305\"\210\306\307\310\311\312\313BC#\"\210\314\315\316\"\210\317\320\321\302#\210\322\323!\204,\301\323\324\"\210\325\326\323\"\210\317\327\321\304#\210\322\330!\204B\301\330\331\"\210\325\326\330\"\207" [neo-buffer-name defalias purpose-fix-neotree-create-window-advice #[385 "\203\301 \207\302\"\207" [purpose--active-p purpose--fix-create-neo-window apply] 5 "Override `neo-global--create-window' with `purpose--fix-create-neo-window'.\nWhen `purpose--active-p' is nil, call original `neo-global--create-window'.\n\n(fn OLDFUN &rest ARGS)"] purpose-fix-neotree-open-file-advice #[770 "\203\f\211\204\f\301!\207\302\")\207" [purpose--active-p find-file nil] 6 "When ARG is nil, make sure Purpose is off while executing `neo-open-file'.\n\n(fn OLDFUN FULL-PATH &optional ARG)"] purpose-set-extension-configuration :neotree purpose-conf "Neotree" :name-purposes Neotree add-to-list purpose-special-action-sequences (Neotree purpose-display-reuse-window-buffer purpose-display-reuse-window-purpose purpose--fix-display-neotree) purpose-fix-toggle-advice neo-global--create-window :around fboundp purpose--fix-neo-global--create-window-advice-toggler #[0 "\300\301\302\303#\207" [purpose-fix-toggle-advice neo-global--create-window :around purpose-fix-neotree-create-window-advice] 4] add-hook purpose-fix-togglers-hook neo-open-file purpose--fix-neo-open-file-advice-toggler #[0 "\300\301\302\303#\207" [purpose-fix-toggle-advice neo-open-file :around purpose-fix-neotree-open-file-advice] 4]] 7 (#$ . 6798)]) #@58 Call `purpose--fix-neotree-1' after `neotree' is loaded. (defalias 'purpose--fix-neotree #[0 "\300\301\302\"\207" [eval-after-load neotree #[0 "\300 \207" [purpose--fix-neotree-1] 1]] 3 (#$ . 8620)]) #@120 Make Purpose inactive during some functions that use `org-no-popups'. Don't call this function before `org' is loaded. (defalias 'purpose--fix-org-no-popups-1 #[0 "\300\301\302\"\210\300\303\304\"\210\300\305\306\"\210\307\310\311\301#\210\312\313!\204 \300\313\314\"\210\315\316\313\"\210\307\317\311\303#\210\312\320!\2046\300\320\321\"\210\315\316\320\"\210\307\322\311\305#\210\312\323!\204L\300\323\324\"\210\315\316\323\"\207" [defalias purpose--fix-org-switch-to-buffer-other-window #[385 "\301\302\")\207" [purpose--active-p nil apply] 5 "Make Purpose inactive during `org-switch-to-buffer-other-window'.\n\n(fn OLDFUN &rest ARGS)"] purpose--fix-org-get-location #[385 "\301\302\")\207" [purpose--active-p nil apply] 5 "Make Purpose inactive during `org-get-location'.\n\n(fn OLDFUN &rest ARGS)"] purpose--fix-org-goto-location #[385 "\301\302\")\207" [purpose--active-p nil apply] 5 "Make Purpose inactive during `org-goto-location'.\n\n(fn OLDFUN &rest ARGS)"] purpose-fix-toggle-advice org-switch-to-buffer-other-window :around fboundp purpose--fix-org-switch-to-buffer-other-window-advice-toggler #[0 "\300\301\302\303#\207" [purpose-fix-toggle-advice org-switch-to-buffer-other-window :around purpose--fix-org-switch-to-buffer-other-window] 4] add-hook purpose-fix-togglers-hook org-get-location purpose--fix-org-get-location-advice-toggler #[0 "\300\301\302\303#\207" [purpose-fix-toggle-advice org-get-location :around purpose--fix-org-get-location] 4] org-goto-location purpose--fix-org-goto-location-advice-toggler #[0 "\300\301\302\303#\207" [purpose-fix-toggle-advice org-goto-location :around purpose--fix-org-goto-location] 4]] 4 (#$ . 8827)]) #@60 Call `purpose--fix-org-no-popups-1' after `org' is loaded. (defalias 'purpose--fix-org-no-popups #[0 "\300\301\302\"\207" [eval-after-load org #[0 "\300 \207" [purpose--fix-org-no-popups-1] 1]] 3 (#$ . 10510)]) #@116 Make Purpose inactive during `popwin:replicate-window-config'. Don't call this function before `popwin' is loaded. (defalias 'purpose--fix-popwin-1 #[0 "\300\301\302\"\210\303\304\305\301#\210\306\307!\204\300\307\310\"\210\311\312\307\"\207" [defalias purpose--fix-popwin-replicate #[385 "\301\302\")\207" [purpose--active-p nil apply] 5 "Make Purpose inactive during `popwin:replicate-window-config'.\n\n(fn OLDFUN &rest ARGS)"] purpose-fix-toggle-advice popwin:replicate-window-config :around fboundp purpose--fix-popwin:replicate-window-config-advice-toggler #[0 "\300\301\302\303#\207" [purpose-fix-toggle-advice popwin:replicate-window-config :around purpose--fix-popwin-replicate] 4] add-hook purpose-fix-togglers-hook] 4 (#$ . 10728)]) #@56 Call `purpose--fix-popwin-1' after `popwin' is loaded. (defalias 'purpose--fix-popwin #[0 "\300\301\302\"\207" [eval-after-load popwin #[0 "\300 \207" [purpose--fix-popwin-1] 1]] 3 (#$ . 11483)]) #@46 Use a seperate purpose for guide-key window. (defalias 'purpose--fix-guide-key #[0 "\300\301\302\"\207" [eval-after-load guide-key #[0 "\301\302\303\304\305\306BC#\"\207" [guide-key/guide-buffer-name purpose-set-extension-configuration :guide-key purpose-conf "guide-key" :name-purposes guide-key] 7]] 3 (#$ . 11685)]) #@71 Don't interfere with which-key, and use a seperate which-key purpose. (defalias 'purpose--fix-which-key #[0 "\300\301\302\"\207" [eval-after-load which-key #[0 "\301\302\303!\"\210\304\305\306\307\310\311BC#\"\207" [which-key-buffer-name add-to-list purpose-action-function-ignore-buffer-names regexp-quote purpose-set-extension-configuration :which-key purpose-conf "which-key" :name-purposes which-key] 7]] 3 (#$ . 12011)]) #@56 Let magit-popup display help windows the way it wants. (defalias 'purpose--fix-magit-popup #[0 "\300\301\302\"\207" [eval-after-load magit-popup #[0 "\300\301\302\"\210\300\301\303\"\210\304\305\306\301#\210\307\310!\204\300\310\311\"\210\312\313\310\"\210\304\314\306\301#\210\307\315!\2041\300\315\316\"\210\312\313\315\"\207" [defalias purpose--fix-magit-popup-help #[385 "\301\302\")\207" [purpose--active-p nil apply] 5 "Make Purpose inactive during `magit-popup-describe-function'.\n\n(fn OLDFUN &rest ARGS)"] #[385 "\301\302\")\207" [purpose--active-p nil apply] 5 "Make Purpose inactive during `magit-popup-manpage'.\n\n(fn OLDFUN &rest ARGS)"] purpose-fix-toggle-advice magit-popup-describe-function :around fboundp purpose--fix-magit-popup-describe-function-advice-toggler #[0 "\300\301\302\303#\207" [purpose-fix-toggle-advice magit-popup-describe-function :around purpose--fix-magit-popup-help] 4] add-hook purpose-fix-togglers-hook magit-popup-manpage purpose--fix-magit-popup-manpage-advice-toggler #[0 "\300\301\302\303#\207" [purpose-fix-toggle-advice magit-popup-manpage :around purpose--fix-magit-popup-help] 4]] 4]] 3 (#$ . 12445)]) #@53 Zone buffers should always open in the same window. (defalias 'purpose--fix-zone #[0 "\300\301\302\"\207" [eval-after-load zone #[0 "\300\301\302\303\304\305#\"\210\306\307\310\"\207" [purpose-set-extension-configuration :zone purpose-conf "zone" :name-purposes (("*zone*" . Zone)) add-to-list purpose-special-action-sequences (Zone display-buffer-same-window)] 6]] 3 (#$ . 13612)]) #@47 Integrate `window-purpose' with `whitespace'. (defalias 'purpose--fix-whitespace #[0 "\300\301\302\"\207" [eval-after-load whitespace #[0 "\300\301\302\"\210\303\304\305\301#\210\306\307!\204\300\307\310\"\210\311\312\307\"\207" [defalias purpose--whitespace-display-window-advice #[257 "r\211q\210\300 \210eb\210)\301!\207" [special-mode switch-to-buffer] 3 "Stops `whitespace-display-window' from splitting and shrinking windows.\n\n(fn BUFFER)"] purpose-fix-toggle-advice whitespace-display-window :override fboundp purpose--fix-whitespace-display-window-advice-toggler #[0 "\300\301\302\303#\207" [purpose-fix-toggle-advice whitespace-display-window :override purpose--whitespace-display-window-advice] 4] add-hook purpose-fix-togglers-hook] 4]] 3 (#$ . 14001)]) #@713 Install fixes for integrating Purpose with other features. EXCLUDE is a list of integrations to skip. Known members of EXCLUDE are: - 'edebug : don't integrate with edebug - 'compilation-next-error-function : don't integrate with `compilation-next-error-function'. - 'isearch : don't integrate with isearch - 'next-error : don't integrate with `next-error' - 'lv : don't integrate with lv (hydra) - 'helm : don't integrate with helm - 'neotree : don't integrate with neotree - 'org : don't integrate with org - 'popwin : don't integrate with popwin - 'guide-key : don't integrate with guide-key - 'which-key : don't integrate with which-key - 'whitespace : don't integrate with whitespace (fn &rest EXCLUDE) (defalias 'purpose-fix-install #[128 "\300>\204 \301 \210\302>\204\303 \210\304>\204\305 \210\306>\204$\307 \210\310>\204-\311 \210\312>\2046\313 \210\314>\204?\315 \210\316>\204H\317 \210\320>\204Q\321 \210\322>\204Z\323 \210\324>\204c\325 \210\326>\204l\327 \210\330>\204u\331 \210\332>?\205~\333 \207" [edebug purpose--fix-edebug compilation-next-error-function purpose--fix-compilation-next-error-function isearch purpose--fix-isearch next-error purpose--fix-next-error lv purpose--fix-hydra-lv helm purpose--fix-helm neotree purpose--fix-neotree org purpose--fix-org-no-popups popwin purpose--fix-popwin guide-key purpose--fix-guide-key which-key purpose--fix-which-key magit-popup purpose--fix-magit-popup zone purpose--fix-zone whitespace purpose--fix-whitespace] 3 (#$ . 14778) nil]) (provide 'window-purpose-fixes)