;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\207" [require cl-lib eieio window-purpose-utils] 2) #@204 Create a function named NAME to check the content of a list. The generated function receives parameter OBJ, and checks that it is a list and each entry in it satisifies ENTRY-PRED. (fn NAME ENTRY-PRED) (defalias 'define-purpose-list-checker '(macro . #[514 "\300\301\302\303\"\304\305\306\307\310\311\312\313\314 \315BB\257E\257\207" [defun (obj) format "Check that OBJ is a list, and each entry in it satisifies %s." and (listp obj) cl-loop for entry in obj always funcall (entry)] 17 (#$ . 188)])) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put define-purpose-list-checker lisp-indent-function defun put edebug-form-spec (&define name function-form)] 5) #@51 Check that OBJ is a symbol and not nil. (fn OBJ) (defalias 'purpose-non-nil-symbol-p #[257 "\2119\205\211\207" [] 2 (#$ . 875)]) #@139 Check that OBJ is a pair of mode and purpose. OBJ should be a cons cell, whose car and cdr are both `purpose-non-nil-symbol-p'. (fn OBJ) (defalias 'purpose-mode-alist-entry-p #[257 "\211:\205\300@!\205\300A!\207" [purpose-non-nil-symbol-p] 3 (#$ . 1014)]) #@147 Check that OBJ is a pair of name and purpose. OBJ should be a cons cell, whose car is a string and cdr is a `purpose-non-nil-symbol-p'. (fn OBJ) (defalias 'purpose-name-alist-entry-p #[257 "\211:\205\211@;\205\300A!\207" [purpose-non-nil-symbol-p] 3 (#$ . 1284)]) (defalias 'purpose-regexp-alist-entry-p 'purpose-name-alist-entry-p "Check that OBJ is a pair of regexp and purpose.\nOBJ should be a cons cell, whose car is a string and cdr is a\n`purpose-non-nil-symbol-p'. Strictly speaking,\n`purpose-regexp-alist-entry-p' doesn't actually check that the car is a\nvalid regexp.") #@99 Check that OBJ is a list, and each entry in it satisifies #'purpose-mode-alist-entry-p. (fn OBJ) (defalias 'purpose-mode-alist-p #[257 "\211<\205(\211\300\301:\203!@\262\302!\211\262\203!A\262\202\211\205&\301\266\203\207" [nil t purpose-mode-alist-entry-p] 6 (#$ . 1879)]) #@99 Check that OBJ is a list, and each entry in it satisifies #'purpose-name-alist-entry-p. (fn OBJ) (defalias 'purpose-name-alist-p #[257 "\211<\205(\211\300\301:\203!@\262\302!\211\262\203!A\262\202\211\205&\301\266\203\207" [nil t purpose-name-alist-entry-p] 6 (#$ . 2173)]) #@101 Check that OBJ is a list, and each entry in it satisifies #'purpose-regexp-alist-entry-p. (fn OBJ) (defalias 'purpose-regexp-alist-p #[257 "\211<\205(\211\300\301:\203!@\262\302!\211\262\203!A\262\202\211\205&\301\266\203\207" [nil t purpose-regexp-alist-entry-p] 6 (#$ . 2468)]) (byte-code "\300\301\302\303!\"\210\300\304\305\303!\"\210\300\306\304\"\210\307\306\310\311#\210\312\303\313\304#\314\303\315\316\315$\207" [defalias purpose-conf-p eieio-make-class-predicate purpose-conf purpose-conf--eieio-childp eieio-make-child-predicate purpose-conf-child-p make-obsolete "use (cl-typep ... \\='purpose-conf) instead" "25.1" define-symbol-prop cl-deftype-satisfies eieio-defclass-internal nil ((mode-purposes :initarg :mode-purposes :initform 'nil :type (satisfies purpose-mode-alist-p)) (name-purposes :initarg :name-purposes :initform 'nil :type (satisfies purpose-name-alist-p)) (regexp-purposes :initarg :regexp-purposes :initform 'nil :type (satisfies purpose-regexp-alist-p)))] 6) #@69 Create a new object of class type `purpose-conf'. (fn &rest SLOTS) (defalias 'purpose-conf #[128 "\300\301\302#\207" [apply make-instance purpose-conf] 5 (#$ . 3478)]) (byte-code "\300\301\302\303#\300\207" [function-put purpose-conf compiler-macro purpose-conf--anon-cmacro] 4) #@26 (fn WHOLE &rest SLOTS) (defalias 'purpose-conf--anon-cmacro #[385 "\211@;\204\207\300\301\302@@#@\303@DABB\"\207" [macroexp-warn-and-return format "Obsolete name arg %S to constructor %S" identity] 7 (#$ . 3765)]) (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\320\321\322\323\312\324& \210\300\325\302\303\326DD\327\306\307\310\330\320\331\322\323\312\332& \210\300\333\302\303\334DD\335\306\307\310\336\320\337\322\323\312\340& \207" [custom-declare-variable purpose-use-default-configuration funcall function #[0 "\300\207" [t] 1] "Determine if the default configuration should be used.\nIf this is nil, the default configuration is ignored when getting the\npurpose of a buffer. The user configuration and extended configuration\nare used anyway." :group purpose :type boolean :package-version (window-purpose . "1.2") purpose-user-mode-purposes #[0 "\300\207" [nil] 1] "User configured alist mapping of modes to purposes.\nThe alist should match `purpose-mode-alist-p'.\nIf you set this variable in elisp-code, you should call the function\n`purpose-compile-user-configuration' immediately afterwards." (alist :key-type (symbol :tag "major mode") :value-type (symbol :tag "purpose")) :set #[514 "\300\"\301 \210\207" [set-default purpose-compile-user-configuration] 5 "\n\n(fn SYMBOL VALUE)"] :initialize custom-initialize-default (window-purpose . "1.2") purpose-user-name-purposes #[0 "\300\207" [nil] 1] "User configured alist mapping of names to purposes.\nThe alist should match `purpose-name-alist-p'.\nIf you set this variable in elisp-code, you should call the function\n`purpose-compile-user-configuration' immediately afterwards." (alist :key-type (string :tag "name") :value-type (symbol :tag "purpose")) #[514 "\300\"\301 \210\207" [set-default purpose-compile-user-configuration] 5 "\n\n(fn SYMBOL VALUE)"] (window-purpose . "1.2") purpose-user-regexp-purposes #[0 "\300\207" [nil] 1] "User configured alist mapping of regexps to purposes.\nThe alist should match `purpose-regexp-alist-p'.\nIf you set this variable in elisp-code, you should call the function\n`purpose-compile-user-configuration' immediately afterwards." (alist :key-type (string :tag "regexp") :value-type (symbol :tag "purpose")) #[514 "\300\"\301 \210\207" [set-default purpose-compile-user-configuration] 5 "\n\n(fn SYMBOL VALUE)"] (window-purpose . "1.2")] 14) #@442 A plist containing `purpose-conf' objects. An example of `purpose-extended-configuration': (list :python (purpose-conf :mode-purposes '((python-mode . python) (python-inferior-mode . interpreter))) :popups (purpose-conf :mode-purposes '((help-mode . right) (occur-mode . bottom) (grep-mode . bottom)))) (defvar purpose-extended-configuration nil (#$ . 6205)) #@134 The compiled user mapping of modes to purposes. The contents of this variable are generated by `purpose-compile-user-configuration'. (defvar purpose--user-mode-purposes (make-hash-table) (#$ . 6709)) #@134 The compiled user mapping of names to purposes. The contents of this variable are generated by `purpose-compile-user-configuration'. (defvar purpose--user-name-purposes (make-hash-table :test 'equal) (#$ . 6916)) #@136 The compiled user mapping of regexps to purposes. The contents of this variable are generated by `purpose-compile-user-configuration'. (defvar purpose--user-regexp-purposes (make-hash-table :test 'equal) (#$ . 7136)) #@152 The combined mapping of modes to purposes, of all extensions. The contents of this variable are generated by `purpose-compile-extended-configuration'. (defvar purpose--extended-mode-purposes (make-hash-table) (#$ . 7360)) #@152 The combined mapping of names to purposes, of all extensions. The contents of this variable are generated by `purpose-compile-extended-configuration'. (defvar purpose--extended-name-purposes (make-hash-table :test 'equal) (#$ . 7589)) #@154 The combined mapping of regexps to purposes, of all extensions. The contents of this variable are generated by `purpose-compile-extended-configuration'. (defvar purpose--extended-regexp-purposes (make-hash-table :test 'equal) (#$ . 7831)) #@131 The default mapping of modes to purposes. The contents of this variable are generated by `purpose-compile-default-configuration'. (defvar purpose--default-mode-purposes (make-hash-table) (#$ . 8077)) #@131 The default mapping of names to purposes. The contents of this variable are generated by `purpose-compile-default-configuration'. (defvar purpose--default-name-purposes (make-hash-table :test 'equal) (#$ . 8284)) #@133 The default mapping of regexps to purposes. The contents of this variable are generated by `purpose-compile-default-configuration'. (defvar purpose--default-regexp-purposes (make-hash-table :test 'equal) (#$ . 8504)) #@150 Fill hash table TABLE with ALIST's entries. TABLE is cleared before filling it, unless DONT-CLEAR is non-nil. (fn TABLE ALIST &optional DONT-CLEAR) (defalias 'purpose--fill-hash #[770 "\211\204\300!\210\301\302\303\"\"\207" [clrhash mapc make-closure #[257 "\301@A\300#\207" [V0 puthash] 5 "\n\n(fn ENTRY)"]] 7 (#$ . 8728)]) #@153 Set SYMBOL's value to VALUE and recompile user configuration. Recompilation is done by calling `purpose-compile-user-configuration'. (fn SYMBOL VALUE) (defalias 'purpose--set-and-compile-configuration #[514 "\300\"\301 \210\207" [set-default purpose-compile-user-configuration] 5 (#$ . 9068)]) #@258 Compile the purpose configuration of the user. Fill `purpose--user-mode-purposes', `purpose--user-name-purposes' and `purpose--user-regexp-purposes' according to `purpose-user-mode-purposes', `purpose-user-name-purposes' and `purpose-user-regexp-purposes'. (defalias 'purpose-compile-user-configuration #[0 "\306 \"\210\306\n \"\210\306\f \"\207" [purpose--user-mode-purposes purpose-user-mode-purposes purpose--user-name-purposes purpose-user-name-purposes purpose--user-regexp-purposes purpose-user-regexp-purposes purpose--fill-hash] 3 (#$ . 9372)]) #@211 Compile the purpose configuration of extensions. Fill `purpose--extended-mode-purposes', `purpose--extended-name-purposes' and `purpose--extended-regexp-purposes' according to `purpose-extended-configuration'. (defalias 'purpose-compile-extended-configuration #[0 "\304\305\"\210\304 \305\"\210\304\n\305\"\210\306\307\310\305\311 !\"\"\207" [purpose--extended-mode-purposes purpose--extended-name-purposes purpose--extended-regexp-purposes purpose-extended-configuration purpose--fill-hash nil mapc #[257 "\303\304\305\"\306#\210\303 \304\307\"\306#\210\303\n\304\310\"\306#\207" [purpose--extended-mode-purposes purpose--extended-name-purposes purpose--extended-regexp-purposes purpose--fill-hash slot-value :mode-purposes t :name-purposes :regexp-purposes] 6 "\n\n(fn EXTENSION-CONFIG)"] delq purpose-plist-values] 6 (#$ . 9933)]) #@43 Compile the default purpose configuraion. (defalias 'purpose-compile-default-configuration #[0 "\303\304\"\210\303 \305\"\210\303\n\306\"\207" [purpose--default-mode-purposes purpose--default-name-purposes purpose--default-regexp-purposes purpose--fill-hash ((prog-mode . edit) (text-mode . edit) (css-mode . edit) (comint-mode . terminal) (eshell-mode . terminal) (term-mode . terminal) (dired-mode . dired) (ibuffer-mode . buffers) (Buffer-menu-mode . buffers) (occur-mode . search) (grep-mode . search) (compilation-mode . search) (image-mode . image) (package-menu-mode . package)) ((".gitignore" . edit) (".hgignore" . edit) ("*shell*" . terminal)) (("^ \\*Minibuf-[0-9]*\\*$" . minibuf))] 3 (#$ . 10778)]) (byte-code "\300\301\302\303\302\304%\210\300\305\302\306\302\307%\207" [cl-generic-define-method purpose-conf-add-purposes nil ((config purpose-conf) modes names regexps) #[1028 "\300\301\302\303\n\301\"\"#\266\300\304\302\303\n\304\"\"#\266\300\305\302\303\n\305\"\"#\207" [eieio-oset :mode-purposes append slot-value :name-purposes :regexp-purposes] 13 "Add purposes to a `purpose-conf' object.\nMODES, NAMES and REGEXPS must be valid configuration alists as described in\n`purpose-mode-alist-p', `purpose-name-alist-p' and `purpose-regexp-alist-p'.\n\n(fn CONFIG MODES NAMES REGEXPS)"] purpose-conf-remove-purposes ((config purpose-conf) modes names regexps) #[1028 "\300\301\302\"\303\304$\300\301\305\"\303\306$\300\301\307\"\303\310$\311\302#\266\311\305#\266\311\307#\207" [cl-set-difference slot-value :mode-purposes :test #[514 "\300@\"\207" [eql] 5 "\n\n(fn ENTRY MODE)"] :name-purposes #[514 "@\230\207" #1=[] 4 "\n\n(fn ENTRY NAME)"] :regexp-purposes #[514 "@\230\207" #1# 4 "\n\n(fn ENTRY REGEXP)"] eieio-oset] 12 "Remove purposes from a `purpose-conf' object.\nMODES must be a list of major modes.\nNAMES must be a list names.\nREGEXPS must be a list regexps.\n\n(fn CONFIG MODES NAMES REGEXPS)"]] 6) #@536 Set an extension's entry in `purpose-extended-configuration'. EXT-KEYWORD should be a keyword used to identify the extension. CONFIG is a `purpose-conf' object containing the extension's purpose configuration. Example: (purpose-set-extension-configuration :python (purpose-conf "py" :mode-purposes '((python-mode . python) (inferior-python-mode . interpreter)))) This function calls `purpose-compile-extended-configuration' when its done. (fn EXT-KEYWORD CONFIG) (defalias 'purpose-set-extension-configuration #[514 "\301!\204 \302\303\301D\"\210\304#\305 \207" [purpose-extended-configuration keywordp signal wrong-type-argument plist-put purpose-compile-extended-configuration] 6 (#$ . 12759)]) #@150 Get an extension's entry in `purpose-extended-configuration'. EXT-KEYWORD is the same as in `purpose-set-extension-configuration'. (fn EXT-KEYWORD) (defalias 'purpose-get-extension-configuration #[257 "\301!\204 \302\303\301D\"\210\304\"\207" [purpose-extended-configuration keywordp signal wrong-type-argument plist-get] 5 (#$ . 13542)]) #@296 Delete an extension's entry in `purpose-extended-configuration'. EXT-KEYWORD is the same as in `purpose-set-extension-configuration'. Deletion is actually done by setting the extension's entry to nil. This function calls `purpose-compile-extended-configuration' when its done. (fn EXT-KEYWORD) (defalias 'purpose-del-extension-configuration #[257 "\300\301\"\207" [purpose-set-extension-configuration nil] 4 (#$ . 13894)]) #@499 Add purposes to an extension's purpose configuration. EXT-KEYWORD is the same as in `purpose-set-extension-configuration'. MODES, NAMES and REGEXPS must be valid configuration alists as described in `purpose-mode-alist-p', `purpose-name-alist-p' and `purpose-regexp-alist-p'. This function calls `purpose-compile-extended-configuration'. Example: (purpose-add-extension-purposes :python :regexps '(("\.hy$" . python))) (fn EXT-KEYWORD &key MODES NAMES REGEXPS) (defalias 'purpose-add-extension-purposes #[385 "\300\301\"A@\300\302\"A@\300\303\"A@\211\203=\211@\304>\203&\211AA\262\202\305>A@\2034\306\262\202\307\310@\"\210\202\210\311!\211\204K\312\313\"\210\314$\210\315\"\207" [plist-member :modes :names :regexps (:modes :names :regexps :allow-other-keys) :allow-other-keys nil error "Keyword argument %s not one of (:modes :names :regexps)" purpose-get-extension-configuration user-error "Missing extension configuration: %s" purpose-conf-add-purposes purpose-set-extension-configuration] 11 (#$ . 14326)]) #@566 Remove purposes from an extension's purpose configuration. EXT-KEYWORD is the same as in `purpose-set-extension-configuration'. MODES, NAMES and REGEXPS must be valid configuration alists as described in `purpose-mode-alist-p', `purpose-name-alist-p' and `purpose-regexp-alist-p'. This function calls `purpose-compile-extended-configuration'. Example: (purpose-remove-extension-purposes :python :modes '(inferior-python-mode) :regexps '("\.hy$")) (fn EXT-KEYWORD &key MODES NAMES REGEXPS) (defalias 'purpose-remove-extension-purposes #[385 "\300\301\"A@\300\302\"A@\300\303\"A@\211\203=\211@\304>\203&\211AA\262\202\305>A@\2034\306\262\202\307\310@\"\210\202\210\311!\211\204K\312\313\"\210\314$\210\315\"\207" [plist-member :modes :names :regexps (:modes :names :regexps :allow-other-keys) :allow-other-keys nil error "Keyword argument %s not one of (:modes :names :regexps)" purpose-get-extension-configuration user-error "Missing extension configuration: %s" purpose-conf-remove-purposes purpose-set-extension-configuration] 11 (#$ . 15410)]) #@575 Add and compile multiple user purposes. MODES must be a valid alist mapping major modes to purposes. NAMES must be a valid alist mapping names to purposes. REGEXPS must be a valid alist mapping regexps to purposes. This function calls `purpose-compile-user-configuration' to update user purposes. Example: (purpose-add-user-purposes :modes '((org-mode . org) (help-mode . popup)) :names '(("*scratch*" . popup)) :regexps '(("^\*foo" . terminal))) (fn &key MODES NAMES REGEXPS) (defalias 'purpose-add-user-purposes #[128 "\303\304\"A@\303\305\"A@\303\306\"A@\211\203=\211@\307>\203&\211AA\262\202\310>A@\2034\311\262\202\312\313@\"\210\202\210\314\"\314 \"\314\n\"\315 \207" [purpose-user-mode-purposes purpose-user-name-purposes purpose-user-regexp-purposes plist-member :modes :names :regexps (:modes :names :regexps :allow-other-keys) :allow-other-keys nil error "Keyword argument %s not one of (:modes :names :regexps)" append purpose-compile-user-configuration] 8 (#$ . 16567)]) #@437 Remove and compile multiple user purposes. MODES must be a list of major modes. NAMES must be a list of names. REGEXPS must be a list of regexps. This function calls `purpose-compile-user-configuration' to update user purposes. Example: (purpose-remove-user-purposes :modes '(org-mode help-mode) :names '("*scratch*") :regexps '("^\*foo")) (fn &key MODES NAMES REGEXPS) (defalias 'purpose-remove-user-purposes #[128 "\303\304\"A@\303\305\"A@\303\306\"A@\211\203=\211@\307>\203&\211AA\262\202\310>A@\2034\311\262\202\312\313@\"\210\202\210\314\315\316$\314 \315\317$\314\n\315\320$\211\321 \207" [purpose-user-mode-purposes purpose-user-name-purposes purpose-user-regexp-purposes plist-member :modes :names :regexps (:modes :names :regexps :allow-other-keys) :allow-other-keys nil error "Keyword argument %s not one of (:modes :names :regexps)" cl-set-difference :test #[514 "\300@\"\207" [eql] 5 "\n\n(fn ENTRY MODE)"] #[514 "@\230\207" #1=[] 4 "\n\n(fn ENTRY NAME)"] #[514 "@\230\207" #1# 4 "\n\n(fn ENTRY REGEXP)"] purpose-compile-user-configuration] 11 (#$ . 17678)]) #@91 Save the purpose configuration, execute BODY, restore the configuration. (fn &rest BODY) (defalias 'purpose-save-purpose-config '(macro . #[128 "\300\301BB\207" [let ((purpose--user-mode-purposes (copy-hash-table purpose--user-mode-purposes)) (purpose--user-name-purposes (copy-hash-table purpose--user-name-purposes)) (purpose--user-regexp-purposes (copy-hash-table purpose--user-regexp-purposes)) (purpose--extended-mode-purposes (copy-hash-table purpose--extended-mode-purposes)) (purpose--extended-name-purposes (copy-hash-table purpose--extended-name-purposes)) (purpose--extended-regexp-purposes (copy-hash-table purpose--extended-regexp-purposes)) (purpose--default-mode-purposes (copy-hash-table purpose--default-mode-purposes)) (purpose--default-name-purposes (copy-hash-table purpose--default-name-purposes)) (purpose--default-regexp-purposes (copy-hash-table purpose--default-regexp-purposes)) (purpose-use-default-configuration purpose-use-default-configuration) (purpose-user-mode-purposes purpose-user-mode-purposes) (purpose-user-name-purposes purpose-user-name-purposes) (purpose-user-regexp-purposes purpose-user-regexp-purposes) (purpose-extended-configuration purpose-extended-configuration))] 4 (#$ . 18853)])) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put purpose-save-purpose-config lisp-indent-function defun put edebug-form-spec body] 5) #@410 Execute BODY with a temporary purpose configuration. NAMES, REGEXPS and MODES should be alists as described in `purpose-user-name-purposes', `purpose-user-regexp-purposes' and `purpose-user-mode-purposes'. NAMES, REGEXPS and MODES are used instead of the current purpose configuration while BODY is executed. The purpose configuration is restored after BODY is executed. (fn NAMES REGEXPS MODES &rest BODY) (defalias 'purpose-with-temp-purposes '(macro . #[899 "\300\301\302\303\304D\305D\306D\257\307\310BBBBD\207" [purpose-save-purpose-config let (purpose-use-default-configuration nil) (purpose-extended-configuration nil) purpose-user-name-purposes purpose-user-regexp-purposes purpose-user-mode-purposes (purpose-compile-user-configuration) (purpose-compile-extended-configuration)] 12 (#$ . 20244)])) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put purpose-with-temp-purposes lisp-indent-function 3 put edebug-form-spec (sexp sexp sexp body)] 5) #@130 Execute BODY with an empty purpose configuration. The purpose configuration is restored after BODY is executed. (fn &rest BODY) (defalias 'purpose-with-empty-purposes '(macro . #[128 "\300\301\211\211BBBB\207" [purpose-with-temp-purposes nil] 6 (#$ . 21231)])) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put purpose-with-empty-purposes lisp-indent-function defun put edebug-form-spec body] 5) #@420 Execute BODY with an additional purpose configuration. NAMES, REGEXPS and MODES should be alists as described in `purpose-user-name-purposes', `purpose-user-regexp-purposes' and `purpose-user-mode-purposes'. NAMES, REGEXPS and MODES are used to add purposes to the current purpose configuration while BODY is executed. The purpose configuration is restored after BODY is executed. (fn NAMES REGEXPS MODES &rest BODY) (defalias 'purpose-with-additional-purposes '(macro . #[899 "\300\301\302\303\304BBD\305\303\306BBD\307\303\310BBDE\311BBBD\207" [purpose-save-purpose-config let purpose-user-name-purposes append (purpose-user-name-purposes) purpose-user-regexp-purposes (purpose-user-regexp-purposes) purpose-user-mode-purposes (purpose-user-mode-purposes) (purpose-compile-user-configuration)] 12 (#$ . 21652)])) (byte-code "\300\301\302\303#\304\301\305\306#\210\307 \210\310 \210\311 \210\312\313!\207" [function-put purpose-with-additional-purposes lisp-indent-function 3 put edebug-form-spec (sexp sexp sexp body) purpose-compile-user-configuration purpose-compile-extended-configuration purpose-compile-default-configuration provide window-purpose-configuration] 5)